* feat(settings): add opencode plugins page Manage opencode `plugin` array entries (npm, scoped npm, versioned, local paths) and auto-loaded plugin files in `~/.config/opencode/plugins/` and `<project>/.opencode/plugins/`. Mirrors MCP CRUD pattern. - Server: `plugins.js` data layer + `plugin-routes.js` REST routes - UI: PluginsSidebar / PluginsPage / AddPluginDialog - Store: usePluginsStore (cache TTL, in-flight dedup, narrow selectors) - i18n: 41 keys across 7 locales Whitelist /api/config/plugins in JSON body-parser so POST/PATCH bodies parse; opencode plugin specs runtime-resolve OPENCODE_CONFIG dir so parallel test files do not cross-pollute module-frozen consts. * feat(settings/plugins): hook npm registry for update + invalid-version detection Plugins page now consults registry.npmjs.org with a 1h server cache. Sidebar rows show an update badge with the latest version, group headers show how many updates are available, the kebab adds an "Update to latest" action that reuses the existing PATCH+restart flow, and the editor surfaces a banner for update-available / missing-version / missing-package / malformed / missing-path / unreadable-path / offline-registry states. A refresh button in the sidebar header forces a cache bypass. - Server: `npm-registry.js` (cache + in-flight dedup + 5s timeout, 404 cached, network failures NOT cached) + `plugin-spec.js` (parser + exact semver detection) + `GET /api/config/plugins/registry?specs=...&refresh=` - Routes accept up to 100 specs/request, dedup by npm package name before fetching, classify each result by kind, never propagate network failure as 500. - Client: `registryInfo` slice + `loadRegistryInfo` (fire-and-forget after loadPlugins, refreshes on mutations) + `updateToLatest(id)`. - UI: `RegistryBadge` per-row + `RegistryBanner` per-entry editor, both use theme tokens (text-only color, no new bg/border tokens) and the shared Icon sprite. Per-spec subscriptions only. - i18n: 24 new keys (incl. split singular/plural for "N update(s) available" because the runtime does not parse ICU plural format). * fix(settings/plugins): keep registry badge visible for long specs Sidebar entry row used `inline-flex` with `truncate` only on the spec text. With long npm specs the badge could be pushed past the row edge and clipped by the parent overflow. Switch to `flex` with spec `flex-1 min-w-0 truncate` and add `shrink-0` to the badge wrapper so the update indicator stays anchored to the right of the row. * fix(settings/plugins): use code-box icon to distinguish from MCP Plugins nav entry used 'plug' which is visually too close to MCP's 'plug-2' icon. Swap to 'code-box' for clearer differentiation in the Settings nav list. * Update packages/ui/src/components/sections/plugins/PluginsPage.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Quat3rnion <81202811+Quat3rnion@users.noreply.github.com> * Update packages/ui/src/stores/usePluginsStore.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Quat3rnion <81202811+Quat3rnion@users.noreply.github.com> * fix(settings/plugins): validate registry directory + surface save errors - registry endpoint: return 400 on invalid directory query (was silently falling back to homedir, breaking relative path specs) - save failure toast: prefer result.message over generic 'Reload failed' * fix(settings/plugins): address review follow-ups --------- Signed-off-by: Quat3rnion <81202811+Quat3rnion@users.noreply.github.com> Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
96 lines
1.7 KiB
JavaScript
96 lines
1.7 KiB
JavaScript
export {
|
|
AGENT_DIR,
|
|
COMMAND_DIR,
|
|
SKILL_DIR,
|
|
CONFIG_FILE,
|
|
AGENT_SCOPE,
|
|
COMMAND_SCOPE,
|
|
SKILL_SCOPE,
|
|
readConfig,
|
|
writeConfig,
|
|
readSkillSupportingFile,
|
|
writeSkillSupportingFile,
|
|
deleteSkillSupportingFile,
|
|
} from './shared.js';
|
|
|
|
export {
|
|
getAgentScope,
|
|
getAgentPermissionSource,
|
|
getAgentSources,
|
|
getAgentConfig,
|
|
createAgent,
|
|
updateAgent,
|
|
deleteAgent,
|
|
} from './agents.js';
|
|
|
|
export {
|
|
getCommandScope,
|
|
getCommandSources,
|
|
createCommand,
|
|
updateCommand,
|
|
deleteCommand,
|
|
} from './commands.js';
|
|
|
|
export {
|
|
getSkillSources,
|
|
getSkillScope,
|
|
discoverSkills,
|
|
mergeDiscoveredSkills,
|
|
createSkill,
|
|
updateSkill,
|
|
deleteSkill,
|
|
} from './skills.js';
|
|
|
|
export {
|
|
getProviderSources,
|
|
removeProviderConfig,
|
|
} from './providers.js';
|
|
|
|
export {
|
|
readAuthFile,
|
|
writeAuthFile,
|
|
removeProviderAuth,
|
|
getProviderAuth,
|
|
listProviderAuths,
|
|
AUTH_FILE,
|
|
OPENCODE_DATA_DIR,
|
|
} from './auth.js';
|
|
|
|
export { createUiAuth } from '../ui-auth/ui-auth.js';
|
|
|
|
export {
|
|
listMcpConfigs,
|
|
getMcpConfig,
|
|
createMcpConfig,
|
|
updateMcpConfig,
|
|
deleteMcpConfig,
|
|
} from './mcp.js';
|
|
|
|
export {
|
|
listPluginEntries,
|
|
getPluginEntry,
|
|
createPluginEntry,
|
|
updatePluginEntry,
|
|
deletePluginEntry,
|
|
listPluginDirFiles,
|
|
readPluginDirFile,
|
|
writePluginDirFile,
|
|
deletePluginDirFile,
|
|
encodePluginId,
|
|
decodePluginId,
|
|
parsePluginRaw,
|
|
serializePluginEntry,
|
|
} from './plugins.js';
|
|
|
|
export {
|
|
listSnippets,
|
|
getSnippet,
|
|
createSnippet,
|
|
updateSnippet,
|
|
deleteSnippet,
|
|
expandSnippets,
|
|
} from './snippets.js';
|
|
|
|
export { getNpmInfo, lookupNpmPackage, clearCache as clearNpmCache } from './npm-registry.js';
|
|
export { parseNpmSpec, parsePathSpec, isExactSemver } from './plugin-spec.js';
|