@aexol/opencode-wizard 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,19 +1,21 @@
1
1
  # @aexol/opencode-wizard
2
2
 
3
- `@aexol/opencode-wizard` is a separately releasable OpenCode plugin package for fetching published skills from the opencode-wizard backend runtime and surfacing plugin status in the TUI.
3
+ `@aexol/opencode-wizard` is a separately releasable OpenCode and Pi plugin package for fetching published skills from the opencode-wizard backend runtime and surfacing plugin status in OpenCode/Pi hosts.
4
4
 
5
5
  ## Package target
6
6
 
7
7
  - `oc-plugin: ["server", "tui"]`
8
8
  - `./server` → `dist/server.js`
9
9
  - `./tui` → `dist/tui.js`
10
+ - `pi.extensions: ["./dist/pi.js"]`
11
+ - `./pi` → `dist/pi.js`
10
12
  - no generated runtime skill directory is published; the plugin stays fetch-only at runtime
11
13
  - native OpenCode `skills.urls` is treated as a public/static registry complement, not as the private wizard delivery authority
12
14
  - the TUI is a compact status panel: it shows backend URL, signed-in identity, role, and catalog counts while mutations still run through guarded tools
13
15
 
14
16
  ## Local development
15
17
 
16
- This monorepo still path-loads the same package from `./plugin/opencode-wizard` during local OpenCode development.
18
+ This monorepo still path-loads the same package from `./plugins/opencode-wizard` during local OpenCode development.
17
19
 
18
20
  Backend origin resolution defaults to the deployed backend at `https://opencode-wizard.aexol.work` for both local path-loaded and packaged plugin usage. Set `OPENCODE_WIZARD_BACKEND_ORIGIN` explicitly to target a local/backend URL. Generic host `APP_URL` and `PORT` are ignored so released plugin usage does not accidentally target placeholder app URLs or the OpenCode host port.
19
21
 
@@ -39,6 +41,29 @@ OpenCode server/plugin host can install the published package by package name in
39
41
 
40
42
  For repo-local development, continue using the local path-based config already documented in this repository.
41
43
 
44
+ ## Pi package usage
45
+
46
+ The same npm package can be loaded by Pi as a native Pi package/plugin; it does not use MCP and does not duplicate degraded static catalog stubs.
47
+
48
+ ```bash
49
+ pi install -l ./plugins/opencode-wizard
50
+ # or use the published package when available:
51
+ pi install @aexol/opencode-wizard@latest
52
+ ```
53
+
54
+ Pi loads the `pi.extensions` entrypoint at `./dist/pi.js`, registers Pi-native tools, and bridges them to the same real backend/client/runtime handlers used by the OpenCode server plugin:
55
+
56
+ - `wizard_status` → `opencode_wizard_status`
57
+ - `wizard_catalog_fetch` → `opencode_wizard_catalog_fetch`
58
+ - `wizard_artifact_fetch` → `opencode_wizard_artifact_fetch`
59
+ - `wizard_artifact_preference_set` → `opencode_wizard_artifact_preference_set`
60
+ - `wizard_published_skills_fetch` → `opencode_wizard_published_skills_fetch`
61
+ - `wizard_published_skill_preference_set` → `opencode_wizard_published_skill_preference_set`
62
+
63
+ The Pi `before_agent_start` hook calls the same runtime system-note path as OpenCode, so dynamic prompt context comes from real backend catalog/status resolution when auth and catalog fetches succeed. Missing auth, forbidden role, backend, or catalog failures are returned as explicit operational states by the existing wizard runtime; no tokens are exposed.
64
+
65
+ Pi usage has the same backend configuration and auth prerequisites as OpenCode usage: the backend origin defaults to `https://opencode-wizard.aexol.work`, `OPENCODE_WIZARD_BACKEND_ORIGIN` can override it, and plugin session auth is stored in `~/.config/opencode/opencode-wizard.json`.
66
+
42
67
  ## Native `skills.urls` compatibility
43
68
 
44
69
  OpenCode's native `skills.urls` support downloads public/static skill registries from base URLs that expose an `index.json` and file paths under that base URL. Current support has no plugin session/header integration, so it must not be pointed at private opencode-wizard skill delivery.
@@ -77,11 +102,11 @@ Editors can import external artifacts without writing project files via `opencod
77
102
 
78
103
  ## Release flow
79
104
 
80
- 1. Bump `version` in `plugin/opencode-wizard/package.json`.
105
+ 1. Bump `version` in `plugins/opencode-wizard/package.json`.
81
106
  2. Run `npm run plugin:release:check` from the repo root.
82
107
  3. If you are following the repo release-tag convention, create Git tag `plugin-opencode-wizard-v<version>`.
83
108
  4. Push the release commit/tag so GitLab can run the shared npm public publish job.
84
109
 
85
- The CI publish job comes from `ci/templates/node/npm-publish-public.yml`, stays manual on the repo `deploy` stage, runs from `plugin/opencode-wizard` via `APP_ROOT`, runs `npm run release:check` including `npm pack --dry-run`, deletes the inherited `@aexol` GitLab registry override, packs the exact release tarball with `npm pack`, and publishes that tarball with `npm publish --provenance --access public --registry https://registry.npmjs.org/ ./*.tgz`.
110
+ The CI publish job comes from `ci/templates/node/npm-publish-public.yml`, stays manual on the repo `deploy` stage, runs from `plugins/opencode-wizard` via `APP_ROOT`, runs `npm run release:check` including `npm pack --dry-run`, deletes the inherited `@aexol` GitLab registry override, packs the exact release tarball with `npm pack`, and publishes that tarball with `npm publish --provenance --access public --registry https://registry.npmjs.org/ ./*.tgz`.
86
111
 
87
112
  GitLab provides a `SIGSTORE_ID_TOKEN` (`aud: sigstore`) for npm provenance, and the packed `*.tgz` is retained as a 30-day job artifact. The current flow still requires the existing `NPM_AUTH_TOKEN`; npm trusted publishing for GitLab would be the stronger future option once configured because it can remove the long-lived npm token. After release, `npm audit signatures` from a throwaway install is an optional registry verification check.
package/dist/pi.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { buildPiTools, default } from './server-pi.js';
package/dist/pi.js ADDED
@@ -0,0 +1,2 @@
1
+ export { buildPiTools, default } from './server-pi.js';
2
+ //# sourceMappingURL=pi.js.map
package/dist/pi.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":["buildPiTools","default"],"sources":["../src/pi.ts"],"sourcesContent":["export { buildPiTools, default } from './server-pi.js';\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,OAAO,QAAQ,gBAAgB","ignoreList":[]}
@@ -69,7 +69,7 @@ export type ToolExecuteContext = {
69
69
  metadata: Record<string, string>;
70
70
  }) => void;
71
71
  };
72
- type ToolDefinition<TArgs extends object> = {
72
+ export type ToolDefinition<TArgs extends object> = {
73
73
  description: string;
74
74
  args: {
75
75
  [K in keyof TArgs]-?: unknown;
@@ -1 +1 @@
1
- {"version":3,"names":["AVAILABLE_PUBLISHED_SKILL_TOOLS","SHARED_PUBLISHED_SKILL_TOOLS","slice","hasPrivilegedWizardToolRole","role","resolveAvailableTools","createPublishedSkillToolDefinitions","tool","handlers","sharedTools","opencode_wizard_catalog_fetch","description","args","artifactKind","schema","string","optional","describe","directory","refresh","boolean","recommendationContext","execute","context","fetchWizardArtifactCatalog","opencode_wizard_artifact_fetch","artifact","artifacts","fetchWizardArtifacts","opencode_wizard_artifact_preference_set","action","preferenceScope","updateWizardArtifactPreference","opencode_wizard_published_skills_fetch","skill","skills","fetchPublishedSkills","opencode_wizard_published_skill_preference_set","updatePublishedSkillPreference","opencode_wizard_status","getStatus","editorOnlyTools","opencode_wizard_editor_create_or_update_skill","markdownContent","createOrUpdateEditorSkill","opencode_wizard_editor_publish_skill","skillSlug","publishEditorSkill","opencode_wizard_artifact_import","source","slug","name","summary","importWizardArtifact"],"sources":["../src/plugin-tools.ts"],"sourcesContent":["export type PublishedSkillFetchArgs = {\n skill?: string;\n skills?: string;\n directory?: string;\n refresh?: boolean;\n recommendationContext?: string;\n};\n\nexport type WizardArtifactKind = 'SKILL' | 'DESIGN_DOC';\n\nexport type WizardArtifactCatalogFetchArgs = {\n artifactKind?: string;\n directory?: string;\n refresh?: boolean;\n recommendationContext?: string;\n};\n\nexport type WizardArtifactFetchArgs = {\n artifactKind?: string;\n artifact?: string;\n artifacts?: string;\n directory?: string;\n refresh?: boolean;\n recommendationContext?: string;\n};\n\nexport type PluginStatusArgs = {\n directory?: string;\n};\n\nexport type PublishedSkillPreferenceArgs = {\n skill: string;\n action: string;\n preferenceScope?: string;\n directory?: string;\n};\n\nexport type WizardArtifactPreferenceArgs = {\n artifactKind?: string;\n artifact: string;\n action: string;\n preferenceScope?: string;\n directory?: string;\n};\n\nexport type EditorPublishSkillArgs = {\n skillSlug: string;\n directory?: string;\n};\n\nexport type EditorCreateOrUpdateSkillArgs = {\n markdownContent: string;\n directory?: string;\n};\n\nexport type WizardArtifactImportArgs = {\n artifactKind?: string;\n source: string;\n slug?: string;\n skill?: string;\n name?: string;\n summary?: string;\n directory?: string;\n};\n\ntype ToolSchemaValue<TSelf> = {\n optional: () => TSelf;\n describe: (description: string) => TSelf;\n};\n\ntype ToolSchema = {\n string: () => ToolSchemaValue<ToolSchemaValue<unknown>>;\n boolean: () => ToolSchemaValue<ToolSchemaValue<unknown>>;\n};\n\nexport type ToolExecuteContext = {\n directory: string;\n abort: AbortSignal;\n metadata: (payload: { title: string; metadata: Record<string, string> }) => void;\n};\n\ntype ToolDefinition<TArgs extends object> = {\n description: string;\n args: { [K in keyof TArgs]-?: unknown };\n execute: (args: TArgs, context: ToolExecuteContext) => Promise<unknown>;\n};\n\nexport type ToolFactory = (<TArgs extends object>(definition: ToolDefinition<TArgs>) => unknown) & {\n schema: ToolSchema;\n};\n\ntype PublishedSkillToolHandlers = {\n fetchPublishedSkills: (args: PublishedSkillFetchArgs, context: ToolExecuteContext) => Promise<unknown>;\n fetchWizardArtifactCatalog: (args: WizardArtifactCatalogFetchArgs, context: ToolExecuteContext) => Promise<unknown>;\n fetchWizardArtifacts: (args: WizardArtifactFetchArgs, context: ToolExecuteContext) => Promise<unknown>;\n updatePublishedSkillPreference: (args: PublishedSkillPreferenceArgs, context: ToolExecuteContext) => Promise<unknown>;\n updateWizardArtifactPreference: (args: WizardArtifactPreferenceArgs, context: ToolExecuteContext) => Promise<unknown>;\n getStatus: (args: PluginStatusArgs, context: ToolExecuteContext) => Promise<unknown>;\n createOrUpdateEditorSkill: (args: EditorCreateOrUpdateSkillArgs, context: ToolExecuteContext) => Promise<unknown>;\n publishEditorSkill: (args: EditorPublishSkillArgs, context: ToolExecuteContext) => Promise<unknown>;\n importWizardArtifact: (args: WizardArtifactImportArgs, context: ToolExecuteContext) => Promise<unknown>;\n};\n\nexport const AVAILABLE_PUBLISHED_SKILL_TOOLS = [\n 'opencode_wizard_catalog_fetch',\n 'opencode_wizard_artifact_fetch',\n 'opencode_wizard_artifact_preference_set',\n 'opencode_wizard_published_skills_fetch',\n 'opencode_wizard_published_skill_preference_set',\n 'opencode_wizard_status',\n 'opencode_wizard_editor_create_or_update_skill',\n 'opencode_wizard_editor_publish_skill',\n 'opencode_wizard_artifact_import',\n];\n\nconst SHARED_PUBLISHED_SKILL_TOOLS = AVAILABLE_PUBLISHED_SKILL_TOOLS.slice(0, 6);\n\nexport const hasPrivilegedWizardToolRole = (role: string | null | undefined): boolean =>\n role === 'ADMIN' || role === 'EDITOR';\n\nexport const resolveAvailableTools = (role: string | null | undefined): string[] => {\n if (hasPrivilegedWizardToolRole(role)) return [...AVAILABLE_PUBLISHED_SKILL_TOOLS];\n return [...SHARED_PUBLISHED_SKILL_TOOLS];\n};\n\nexport const createPublishedSkillToolDefinitions = (\n tool: ToolFactory,\n handlers: PublishedSkillToolHandlers,\n) => ({\n sharedTools: {\n opencode_wizard_catalog_fetch: tool<WizardArtifactCatalogFetchArgs>({\n description:\n 'Always-available canonical wizard artifact catalog tool. Supports artifactKind SKILL and DESIGN_DOC; catalog metadata is candidate discovery only, and bodies/files should be fetched before using a matching wizard artifact as guidance.',\n args: {\n artifactKind: tool.schema\n .string()\n .optional()\n .describe('Wizard artifact kind to catalog: SKILL or DESIGN_DOC; defaults to SKILL'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n refresh: tool.schema.boolean().optional().describe('Bypass the local plugin cache for this request'),\n recommendationContext: tool.schema\n .string()\n .optional()\n .describe(\n 'Optional metadata-only relevance/ranking context for catalog recommendations; fetched artifact bodies/files remain the authority.',\n ),\n },\n async execute(args, context) {\n return handlers.fetchWizardArtifactCatalog(args, context);\n },\n }),\n opencode_wizard_artifact_fetch: tool<WizardArtifactFetchArgs>({\n description:\n 'Always-available canonical wizard artifact detail tool. Supports artifactKind SKILL and DESIGN_DOC; fetched backend-authorized bodies/files are the reference content when a matching effective artifact is used.',\n args: {\n artifactKind: tool.schema\n .string()\n .optional()\n .describe('Wizard artifact kind to fetch: SKILL or DESIGN_DOC; defaults to SKILL'),\n artifact: tool.schema\n .string()\n .optional()\n .describe('Single artifact identifier; for SKILL this is a skill slug, artifact name, or skill name'),\n artifacts: tool.schema\n .string()\n .optional()\n .describe('One or more comma-separated or newline-separated artifact identifiers'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n refresh: tool.schema.boolean().optional().describe('Bypass the local plugin cache for this request'),\n recommendationContext: tool.schema\n .string()\n .optional()\n .describe(\n 'Optional metadata-only relevance/ranking context for artifact discovery and suggestions; fetched bodies/files remain the authority.',\n ),\n },\n async execute(args, context) {\n return handlers.fetchWizardArtifacts(args, context);\n },\n }),\n opencode_wizard_artifact_preference_set: tool<WizardArtifactPreferenceArgs>({\n description:\n 'Always-available canonical wizard artifact preference tool. Supports SKILL and DESIGN_DOC install/uninstall/ignore/unignore through server-backed artifact preference APIs. To disable a per-user global starter/global skill, call artifactKind=SKILL action=ignore preferenceScope=global; use action=unignore preferenceScope=global to enable it again.',\n args: {\n artifactKind: tool.schema\n .string()\n .optional()\n .describe('Wizard artifact kind to update: SKILL or DESIGN_DOC; defaults to SKILL'),\n artifact: tool.schema.string().describe('Artifact identifier; for SKILL this is the published skill slug'),\n action: tool.schema\n .string()\n .describe('Preference action: install, uninstall, ignore, or unignore'),\n preferenceScope: tool.schema\n .string()\n .optional()\n .describe('Preference scope for the action: project/workspace or global; defaults to project. Use global with ignore/unignore to disable or enable starter/global skills for the current user.'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.updateWizardArtifactPreference(args, context);\n },\n }),\n opencode_wizard_published_skills_fetch: tool<PublishedSkillFetchArgs>({\n description:\n 'Always-available tool to fetch one or multiple wizard-published SKILL.md bodies/details for the current scope. When a backend-published wizard-listed skill matches the task, use the fetched body as reference guidance; catalog/status metadata only identifies candidates. Use this for wizard-listed/private/scoped/backend-published skill slugs instead of the native OpenCode skill tool; auth/catalog failures are returned in tool output. Prefer `skills` for multiple identifiers, call with no args to discover/bootstrap auth, and pass `refresh: true` before clearing plugin/OpenCode caches',\n args: {\n skill: tool.schema\n .string()\n .optional()\n .describe(\n 'Single skill slug, artifact name, or skill name; backward-compatible with comma/newline-delimited lists',\n ),\n skills: tool.schema\n .string()\n .optional()\n .describe('One or more comma-separated or newline-separated skill slugs, artifact names, or skill names'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n refresh: tool.schema.boolean().optional().describe('Bypass the local plugin cache for this request'),\n recommendationContext: tool.schema\n .string()\n .optional()\n .describe(\n 'Optional metadata-only relevance/ranking context for skill recommendations; fetched SKILL.md bodies remain the authority.',\n ),\n },\n async execute(args, context) {\n return handlers.fetchPublishedSkills(args, context);\n },\n }),\n opencode_wizard_published_skill_preference_set: tool<PublishedSkillPreferenceArgs>({\n description:\n 'Always-available tool to install, uninstall, ignore, or unignore a backend-published wizard skill for non-TUI workflows using the shared server-backed preference API; auth/catalog failures are returned in tool output. Disable a per-user global starter/global skill with skill=<slug> action=ignore preferenceScope=global; enable it again with action=unignore preferenceScope=global.',\n args: {\n skill: tool.schema.string().describe('Published skill slug, artifact name, or skill name to update'),\n action: tool.schema\n .string()\n .describe('Preference action: install, uninstall, ignore, or unignore'),\n preferenceScope: tool.schema\n .string()\n .optional()\n .describe('Preference scope for the action: project/workspace or global; defaults to project. Use global with ignore/unignore to turn starter/global skills off or on for the current user.'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.updatePublishedSkillPreference(args, context);\n },\n }),\n opencode_wizard_status: tool<PluginStatusArgs>({\n description:\n 'Always-available tool to report opencode-wizard plugin status, bootstrap auth when missing, and return safe auth/catalog/source/cache/workspace metadata without exposing tokens; fetch matching wizard skill bodies before using them as guidance',\n args: {\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.getStatus(args, context);\n },\n }),\n },\n editorOnlyTools: {\n opencode_wizard_editor_create_or_update_skill: tool<EditorCreateOrUpdateSkillArgs>({\n description:\n 'Canonical privileged skill creation/update tool for ADMIN or EDITOR sessions. Sends direct SKILL.md markdown content to the backend createOrUpdateSkillFromMarkdown mutation and creates a workspace assignment when the directory resolves to a backend workspace.',\n args: {\n markdownContent: tool.schema\n .string()\n .describe('Complete SKILL.md markdown content, including frontmatter when the backend skill contract requires it'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.createOrUpdateEditorSkill(args, context);\n },\n }),\n opencode_wizard_editor_publish_skill: tool<EditorPublishSkillArgs>({\n description:\n 'Read skill markdown files from .opencode/skills/ and publish them to the backend via the createOrUpdateSkillFromMarkdown mutation, then assign them to the resolved workspace when available. Requires ADMIN or EDITOR role.',\n args: {\n skillSlug: tool.schema\n .string()\n .describe('Skill slug matching a directory under .opencode/skills/'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.publishEditorSkill(args, context);\n },\n }),\n opencode_wizard_artifact_import: tool<WizardArtifactImportArgs>({\n description:\n 'Privileged ADMIN/EDITOR import tool for external wizard artifacts. Supports SKILL from GitHub/raw SKILL.md sources and DESIGN_DOC from direct URLs or command-like inputs such as `npx getdesign@latest add bmw-m`. Imported backend artifacts become the plugin runtime authority; no project files are written.',\n args: {\n artifactKind: tool.schema\n .string()\n .optional()\n .describe('Wizard artifact kind to import: SKILL or DESIGN_DOC; inferred from source when omitted'),\n source: tool.schema\n .string()\n .describe('Direct URL or command-like input, e.g. `https://github.com/vercel-labs/skills --skill find-skills` or `npx getdesign@latest add bmw-m`'),\n slug: tool.schema.string().optional().describe('Artifact slug; required for DESIGN_DOC unless inferable'),\n skill: tool.schema.string().optional().describe('Skill directory/name for SKILL repo imports'),\n name: tool.schema.string().optional().describe('Optional display name override'),\n summary: tool.schema.string().optional().describe('Optional summary/description override'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.importWizardArtifact(args, context);\n },\n }),\n },\n});\n"],"mappings":"AAuGA,OAAO,MAAMA,+BAA+B,GAAG,CAC7C,+BAA+B,EAC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I,CAAC;QACrJiC,IAAI,EAAE3C,IAAI,CAACO,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,yDAAyD,CAAC;QACzGiB,KAAK,EAAE3B,IAAI,CAACO,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,6CAA6C,CAAC;QAC9FkC,IAAI,EAAE5C,IAAI,CAACO,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,gCAAgC,CAAC;QAChFmC,OAAO,EAAE7C,IAAI,CAACO,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,uCAAuC,CAAC;QAC1FC,SAAS,EAAEX,IAAI,CAACO,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,kDAAkD;MACxG,CAAC;MACD,MAAMK,OAAOA,CAACV,IAAI,EAAEW,OAAO,EAAE;QAC3B,OAAOf,QAAQ,CAAC6C,oBAAoB,CAACzC,IAAI,EAAEW,OAAO,CAAC;MACrD;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["AVAILABLE_PUBLISHED_SKILL_TOOLS","SHARED_PUBLISHED_SKILL_TOOLS","slice","hasPrivilegedWizardToolRole","role","resolveAvailableTools","createPublishedSkillToolDefinitions","tool","handlers","sharedTools","opencode_wizard_catalog_fetch","description","args","artifactKind","schema","string","optional","describe","directory","refresh","boolean","recommendationContext","execute","context","fetchWizardArtifactCatalog","opencode_wizard_artifact_fetch","artifact","artifacts","fetchWizardArtifacts","opencode_wizard_artifact_preference_set","action","preferenceScope","updateWizardArtifactPreference","opencode_wizard_published_skills_fetch","skill","skills","fetchPublishedSkills","opencode_wizard_published_skill_preference_set","updatePublishedSkillPreference","opencode_wizard_status","getStatus","editorOnlyTools","opencode_wizard_editor_create_or_update_skill","markdownContent","createOrUpdateEditorSkill","opencode_wizard_editor_publish_skill","skillSlug","publishEditorSkill","opencode_wizard_artifact_import","source","slug","name","summary","importWizardArtifact"],"sources":["../src/plugin-tools.ts"],"sourcesContent":["export type PublishedSkillFetchArgs = {\n skill?: string;\n skills?: string;\n directory?: string;\n refresh?: boolean;\n recommendationContext?: string;\n};\n\nexport type WizardArtifactKind = 'SKILL' | 'DESIGN_DOC';\n\nexport type WizardArtifactCatalogFetchArgs = {\n artifactKind?: string;\n directory?: string;\n refresh?: boolean;\n recommendationContext?: string;\n};\n\nexport type WizardArtifactFetchArgs = {\n artifactKind?: string;\n artifact?: string;\n artifacts?: string;\n directory?: string;\n refresh?: boolean;\n recommendationContext?: string;\n};\n\nexport type PluginStatusArgs = {\n directory?: string;\n};\n\nexport type PublishedSkillPreferenceArgs = {\n skill: string;\n action: string;\n preferenceScope?: string;\n directory?: string;\n};\n\nexport type WizardArtifactPreferenceArgs = {\n artifactKind?: string;\n artifact: string;\n action: string;\n preferenceScope?: string;\n directory?: string;\n};\n\nexport type EditorPublishSkillArgs = {\n skillSlug: string;\n directory?: string;\n};\n\nexport type EditorCreateOrUpdateSkillArgs = {\n markdownContent: string;\n directory?: string;\n};\n\nexport type WizardArtifactImportArgs = {\n artifactKind?: string;\n source: string;\n slug?: string;\n skill?: string;\n name?: string;\n summary?: string;\n directory?: string;\n};\n\ntype ToolSchemaValue<TSelf> = {\n optional: () => TSelf;\n describe: (description: string) => TSelf;\n};\n\ntype ToolSchema = {\n string: () => ToolSchemaValue<ToolSchemaValue<unknown>>;\n boolean: () => ToolSchemaValue<ToolSchemaValue<unknown>>;\n};\n\nexport type ToolExecuteContext = {\n directory: string;\n abort: AbortSignal;\n metadata: (payload: { title: string; metadata: Record<string, string> }) => void;\n};\n\nexport type ToolDefinition<TArgs extends object> = {\n description: string;\n args: { [K in keyof TArgs]-?: unknown };\n execute: (args: TArgs, context: ToolExecuteContext) => Promise<unknown>;\n};\n\nexport type ToolFactory = (<TArgs extends object>(definition: ToolDefinition<TArgs>) => unknown) & {\n schema: ToolSchema;\n};\n\ntype PublishedSkillToolHandlers = {\n fetchPublishedSkills: (args: PublishedSkillFetchArgs, context: ToolExecuteContext) => Promise<unknown>;\n fetchWizardArtifactCatalog: (args: WizardArtifactCatalogFetchArgs, context: ToolExecuteContext) => Promise<unknown>;\n fetchWizardArtifacts: (args: WizardArtifactFetchArgs, context: ToolExecuteContext) => Promise<unknown>;\n updatePublishedSkillPreference: (args: PublishedSkillPreferenceArgs, context: ToolExecuteContext) => Promise<unknown>;\n updateWizardArtifactPreference: (args: WizardArtifactPreferenceArgs, context: ToolExecuteContext) => Promise<unknown>;\n getStatus: (args: PluginStatusArgs, context: ToolExecuteContext) => Promise<unknown>;\n createOrUpdateEditorSkill: (args: EditorCreateOrUpdateSkillArgs, context: ToolExecuteContext) => Promise<unknown>;\n publishEditorSkill: (args: EditorPublishSkillArgs, context: ToolExecuteContext) => Promise<unknown>;\n importWizardArtifact: (args: WizardArtifactImportArgs, context: ToolExecuteContext) => Promise<unknown>;\n};\n\nexport const AVAILABLE_PUBLISHED_SKILL_TOOLS = [\n 'opencode_wizard_catalog_fetch',\n 'opencode_wizard_artifact_fetch',\n 'opencode_wizard_artifact_preference_set',\n 'opencode_wizard_published_skills_fetch',\n 'opencode_wizard_published_skill_preference_set',\n 'opencode_wizard_status',\n 'opencode_wizard_editor_create_or_update_skill',\n 'opencode_wizard_editor_publish_skill',\n 'opencode_wizard_artifact_import',\n];\n\nconst SHARED_PUBLISHED_SKILL_TOOLS = AVAILABLE_PUBLISHED_SKILL_TOOLS.slice(0, 6);\n\nexport const hasPrivilegedWizardToolRole = (role: string | null | undefined): boolean =>\n role === 'ADMIN' || role === 'EDITOR';\n\nexport const resolveAvailableTools = (role: string | null | undefined): string[] => {\n if (hasPrivilegedWizardToolRole(role)) return [...AVAILABLE_PUBLISHED_SKILL_TOOLS];\n return [...SHARED_PUBLISHED_SKILL_TOOLS];\n};\n\nexport const createPublishedSkillToolDefinitions = (\n tool: ToolFactory,\n handlers: PublishedSkillToolHandlers,\n) => ({\n sharedTools: {\n opencode_wizard_catalog_fetch: tool<WizardArtifactCatalogFetchArgs>({\n description:\n 'Always-available canonical wizard artifact catalog tool. Supports artifactKind SKILL and DESIGN_DOC; catalog metadata is candidate discovery only, and bodies/files should be fetched before using a matching wizard artifact as guidance.',\n args: {\n artifactKind: tool.schema\n .string()\n .optional()\n .describe('Wizard artifact kind to catalog: SKILL or DESIGN_DOC; defaults to SKILL'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n refresh: tool.schema.boolean().optional().describe('Bypass the local plugin cache for this request'),\n recommendationContext: tool.schema\n .string()\n .optional()\n .describe(\n 'Optional metadata-only relevance/ranking context for catalog recommendations; fetched artifact bodies/files remain the authority.',\n ),\n },\n async execute(args, context) {\n return handlers.fetchWizardArtifactCatalog(args, context);\n },\n }),\n opencode_wizard_artifact_fetch: tool<WizardArtifactFetchArgs>({\n description:\n 'Always-available canonical wizard artifact detail tool. Supports artifactKind SKILL and DESIGN_DOC; fetched backend-authorized bodies/files are the reference content when a matching effective artifact is used.',\n args: {\n artifactKind: tool.schema\n .string()\n .optional()\n .describe('Wizard artifact kind to fetch: SKILL or DESIGN_DOC; defaults to SKILL'),\n artifact: tool.schema\n .string()\n .optional()\n .describe('Single artifact identifier; for SKILL this is a skill slug, artifact name, or skill name'),\n artifacts: tool.schema\n .string()\n .optional()\n .describe('One or more comma-separated or newline-separated artifact identifiers'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n refresh: tool.schema.boolean().optional().describe('Bypass the local plugin cache for this request'),\n recommendationContext: tool.schema\n .string()\n .optional()\n .describe(\n 'Optional metadata-only relevance/ranking context for artifact discovery and suggestions; fetched bodies/files remain the authority.',\n ),\n },\n async execute(args, context) {\n return handlers.fetchWizardArtifacts(args, context);\n },\n }),\n opencode_wizard_artifact_preference_set: tool<WizardArtifactPreferenceArgs>({\n description:\n 'Always-available canonical wizard artifact preference tool. Supports SKILL and DESIGN_DOC install/uninstall/ignore/unignore through server-backed artifact preference APIs. To disable a per-user global starter/global skill, call artifactKind=SKILL action=ignore preferenceScope=global; use action=unignore preferenceScope=global to enable it again.',\n args: {\n artifactKind: tool.schema\n .string()\n .optional()\n .describe('Wizard artifact kind to update: SKILL or DESIGN_DOC; defaults to SKILL'),\n artifact: tool.schema.string().describe('Artifact identifier; for SKILL this is the published skill slug'),\n action: tool.schema\n .string()\n .describe('Preference action: install, uninstall, ignore, or unignore'),\n preferenceScope: tool.schema\n .string()\n .optional()\n .describe('Preference scope for the action: project/workspace or global; defaults to project. Use global with ignore/unignore to disable or enable starter/global skills for the current user.'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.updateWizardArtifactPreference(args, context);\n },\n }),\n opencode_wizard_published_skills_fetch: tool<PublishedSkillFetchArgs>({\n description:\n 'Always-available tool to fetch one or multiple wizard-published SKILL.md bodies/details for the current scope. When a backend-published wizard-listed skill matches the task, use the fetched body as reference guidance; catalog/status metadata only identifies candidates. Use this for wizard-listed/private/scoped/backend-published skill slugs instead of the native OpenCode skill tool; auth/catalog failures are returned in tool output. Prefer `skills` for multiple identifiers, call with no args to discover/bootstrap auth, and pass `refresh: true` before clearing plugin/OpenCode caches',\n args: {\n skill: tool.schema\n .string()\n .optional()\n .describe(\n 'Single skill slug, artifact name, or skill name; backward-compatible with comma/newline-delimited lists',\n ),\n skills: tool.schema\n .string()\n .optional()\n .describe('One or more comma-separated or newline-separated skill slugs, artifact names, or skill names'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n refresh: tool.schema.boolean().optional().describe('Bypass the local plugin cache for this request'),\n recommendationContext: tool.schema\n .string()\n .optional()\n .describe(\n 'Optional metadata-only relevance/ranking context for skill recommendations; fetched SKILL.md bodies remain the authority.',\n ),\n },\n async execute(args, context) {\n return handlers.fetchPublishedSkills(args, context);\n },\n }),\n opencode_wizard_published_skill_preference_set: tool<PublishedSkillPreferenceArgs>({\n description:\n 'Always-available tool to install, uninstall, ignore, or unignore a backend-published wizard skill for non-TUI workflows using the shared server-backed preference API; auth/catalog failures are returned in tool output. Disable a per-user global starter/global skill with skill=<slug> action=ignore preferenceScope=global; enable it again with action=unignore preferenceScope=global.',\n args: {\n skill: tool.schema.string().describe('Published skill slug, artifact name, or skill name to update'),\n action: tool.schema\n .string()\n .describe('Preference action: install, uninstall, ignore, or unignore'),\n preferenceScope: tool.schema\n .string()\n .optional()\n .describe('Preference scope for the action: project/workspace or global; defaults to project. Use global with ignore/unignore to turn starter/global skills off or on for the current user.'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.updatePublishedSkillPreference(args, context);\n },\n }),\n opencode_wizard_status: tool<PluginStatusArgs>({\n description:\n 'Always-available tool to report opencode-wizard plugin status, bootstrap auth when missing, and return safe auth/catalog/source/cache/workspace metadata without exposing tokens; fetch matching wizard skill bodies before using them as guidance',\n args: {\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.getStatus(args, context);\n },\n }),\n },\n editorOnlyTools: {\n opencode_wizard_editor_create_or_update_skill: tool<EditorCreateOrUpdateSkillArgs>({\n description:\n 'Canonical privileged skill creation/update tool for ADMIN or EDITOR sessions. Sends direct SKILL.md markdown content to the backend createOrUpdateSkillFromMarkdown mutation and creates a workspace assignment when the directory resolves to a backend workspace.',\n args: {\n markdownContent: tool.schema\n .string()\n .describe('Complete SKILL.md markdown content, including frontmatter when the backend skill contract requires it'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.createOrUpdateEditorSkill(args, context);\n },\n }),\n opencode_wizard_editor_publish_skill: tool<EditorPublishSkillArgs>({\n description:\n 'Read skill markdown files from .opencode/skills/ and publish them to the backend via the createOrUpdateSkillFromMarkdown mutation, then assign them to the resolved workspace when available. Requires ADMIN or EDITOR role.',\n args: {\n skillSlug: tool.schema\n .string()\n .describe('Skill slug matching a directory under .opencode/skills/'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.publishEditorSkill(args, context);\n },\n }),\n opencode_wizard_artifact_import: tool<WizardArtifactImportArgs>({\n description:\n 'Privileged ADMIN/EDITOR import tool for external wizard artifacts. Supports SKILL from GitHub/raw SKILL.md sources and DESIGN_DOC from direct URLs or command-like inputs such as `npx getdesign@latest add bmw-m`. Imported backend artifacts become the plugin runtime authority; no project files are written.',\n args: {\n artifactKind: tool.schema\n .string()\n .optional()\n .describe('Wizard artifact kind to import: SKILL or DESIGN_DOC; inferred from source when omitted'),\n source: tool.schema\n .string()\n .describe('Direct URL or command-like input, e.g. `https://github.com/vercel-labs/skills --skill find-skills` or `npx getdesign@latest add bmw-m`'),\n slug: tool.schema.string().optional().describe('Artifact slug; required for DESIGN_DOC unless inferable'),\n skill: tool.schema.string().optional().describe('Skill directory/name for SKILL repo imports'),\n name: tool.schema.string().optional().describe('Optional display name override'),\n summary: tool.schema.string().optional().describe('Optional summary/description override'),\n directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),\n },\n async execute(args, context) {\n return handlers.importWizardArtifact(args, context);\n },\n }),\n },\n});\n"],"mappings":"AAuGA,OAAO,MAAMA,+BAA+B,GAAG,CAC7C,+BAA+B,EAC/B,gCAAgC,EAChC,yCAAyC,EACzC,wCAAwC,EACxC,gDAAgD,EAChD,wBAAwB,EACxB,+CAA+C,EAC/C,sCAAsC,EACtC,iCAAiC,CAClC;AAED,MAAMC,4BAA4B,GAAGD,+BAA+B,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAEhF,OAAO,MAAMC,2BAA2B,GAAIC,IAA+B,IACzEA,IAAI,KAAK,OAAO,IAAIA,IAAI,KAAK,QAAQ;AAEvC,OAAO,MAAMC,qBAAqB,GAAID,IAA+B,IAAe;EACl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C,CAACC,QAAQ,CAAC,gCAAgC,CAAC;QAChFmC,OAAO,EAAE7C,IAAI,CAACO,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,uCAAuC,CAAC;QAC1FC,SAAS,EAAEX,IAAI,CAACO,MAAM,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,kDAAkD;MACxG,CAAC;MACD,MAAMK,OAAOA,CAACV,IAAI,EAAEW,OAAO,EAAE;QAC3B,OAAOf,QAAQ,CAAC6C,oBAAoB,CAACzC,IAAI,EAAEW,OAAO,CAAC;MACrD;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
@@ -9,6 +9,6 @@ export const buildPublishedSkillsSystemNote = ({
9
9
  const renderedSkillNames = skillNames.length > 0 ? skillNames.slice(0, SYSTEM_NOTE_SKILL_NAME_LIMIT).join(', ') : 'none';
10
10
  const remainingCount = Math.max(skillNames.length - SYSTEM_NOTE_SKILL_NAME_LIMIT, 0);
11
11
  const renderedCountSuffix = remainingCount > 0 ? ` (+${remainingCount} more)` : '';
12
- return [workspace ? `Workspace: ${workspace.slug}.` : 'Workspace not found; workspace-scoped wizard skills are unavailable.', `Directory: ${directoryPath}.`, `Wizard-listed skills (${skillNames.length}): ${renderedSkillNames}${renderedCountSuffix}.`, 'Fetch rule: only when the user task materially matches a wizard-listed skill workflow, fetch it with `opencode_wizard_published_skills_fetch`; the fetched `SKILL.md` is authoritative.', 'Catalog/status metadata is discovery-only, not executable skill instructions.', 'If fetch/auth/catalog fails, report degraded wizard-skill context and continue with normal repo evidence when safe.', 'Use `refresh: true` before cache deletion; use `opencode_wizard_artifact_fetch` for non-skill wizard artifacts.'].filter(Boolean).join(' ');
12
+ return [workspace ? `Workspace: ${workspace.slug}.` : 'Workspace not found; workspace-scoped wizard skills are unavailable.', `Directory: ${directoryPath}.`, `Wizard-listed skills (${skillNames.length}): ${renderedSkillNames}${renderedCountSuffix}.`, 'Fetch rule: only when skill instructions could materially change routing, implementation, validation, or artifact structure, fetch a matching wizard-listed skill with `opencode_wizard_published_skills_fetch`; the fetched `SKILL.md` is authoritative.', 'Catalog/status metadata is discovery-only, not executable skill instructions; native/local `.opencode/skills` or OpenCode skill bodies are fallback/source material only when no same-named wizard body can be fetched.', 'If fetch/auth/catalog fails, report degraded wizard-skill context and continue with normal repo evidence when safe.', 'Use `refresh: true` before cache deletion; use `opencode_wizard_artifact_fetch` for non-skill wizard artifacts.'].filter(Boolean).join(' ');
13
13
  };
14
14
  //# sourceMappingURL=published-skills-system-note.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SYSTEM_NOTE_SKILL_NAME_LIMIT","buildPublishedSkillsSystemNote","workspace","directoryPath","catalog","details","_details","skillNames","skills","map","skill","artifactName","skillName","skillSlug","renderedSkillNames","length","slice","join","remainingCount","Math","max","renderedCountSuffix","slug","filter","Boolean"],"sources":["../src/published-skills-system-note.ts"],"sourcesContent":["import type { PublishedSkillsSuccessState } from './published-skills-transform.js';\n\nconst SYSTEM_NOTE_SKILL_NAME_LIMIT = 10;\n\nexport const buildPublishedSkillsSystemNote = ({\n workspace,\n directoryPath,\n catalog,\n details: _details,\n}: {\n workspace: { slug: string } | null;\n directoryPath: string;\n catalog: PublishedSkillsSuccessState;\n details: unknown[];\n}): string => {\n const skillNames = catalog.skills.map((skill) => skill.artifactName || skill.skillName || skill.skillSlug);\n const renderedSkillNames =\n skillNames.length > 0 ? skillNames.slice(0, SYSTEM_NOTE_SKILL_NAME_LIMIT).join(', ') : 'none';\n const remainingCount = Math.max(skillNames.length - SYSTEM_NOTE_SKILL_NAME_LIMIT, 0);\n const renderedCountSuffix = remainingCount > 0 ? ` (+${remainingCount} more)` : '';\n\n return [\n workspace ? `Workspace: ${workspace.slug}.` : 'Workspace not found; workspace-scoped wizard skills are unavailable.',\n `Directory: ${directoryPath}.`,\n `Wizard-listed skills (${skillNames.length}): ${renderedSkillNames}${renderedCountSuffix}.`,\n 'Fetch rule: only when the user task materially matches a wizard-listed skill workflow, fetch it with `opencode_wizard_published_skills_fetch`; the fetched `SKILL.md` is authoritative.',\n 'Catalog/status metadata is discovery-only, not executable skill instructions.',\n 'If fetch/auth/catalog fails, report degraded wizard-skill context and continue with normal repo evidence when safe.',\n 'Use `refresh: true` before cache deletion; use `opencode_wizard_artifact_fetch` for non-skill wizard artifacts.',\n ]\n .filter(Boolean)\n .join(' ');\n};\n"],"mappings":"AAEA,MAAMA,4BAA4B,GAAG,EAAE;AAEvC,OAAO,MAAMC,8BAA8B,GAAGA,CAAC;EAC7CC,SAAS;EACTC,aAAa;EACbC,OAAO;EACPC,OAAO,EAAEC;AAMX,CAAC,KAAa;EACZ,MAAMC,UAAU,GAAGH,OAAO,CAACI,MAAM,CAACC,GAAG,CAAEC,KAAK,IAAKA,KAAK,CAACC,YAAY,IAAID,KAAK,CAACE,SAAS,IAAIF,KAAK,CAACG,SAAS,CAAC;EAC1G,MAAMC,kBAAkB,GACtBP,UAAU,CAACQ,MAAM,GAAG,CAAC,GAAGR,UAAU,CAACS,KAAK,CAAC,CAAC,EAAEhB,4BAA4B,CAAC,CAACiB,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM;EAC/F,MAAMC,cAAc,GAAGC,IAAI,CAACC,GAAG,CAACb,UAAU,CAACQ,MAAM,GAAGf,4BAA4B,EAAE,CAAC,CAAC;EACpF,MAAMqB,mBAAmB,GAAGH,cAAc,GAAG,CAAC,GAAG,MAAMA,cAAc,QAAQ,GAAG,EAAE;EAElF,OAAO,CACLhB,SAAS,GAAG,cAAcA,SAAS,CAACoB,IAAI,GAAG,GAAG,sEAAsE,EACpH,cAAcnB,aAAa,GAAG,EAC9B,yBAAyBI,UAAU,CAACQ,MAAM,MAAMD,kBAAkB,GAAGO,mBAAmB,GAAG,EAC3F,yLAAyL,EACzL,+EAA+E,EAC/E,qHAAqH,EACrH,iHAAiH,CAClH,CACEE,MAAM,CAACC,OAAO,CAAC,CACfP,IAAI,CAAC,GAAG,CAAC;AACd,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["SYSTEM_NOTE_SKILL_NAME_LIMIT","buildPublishedSkillsSystemNote","workspace","directoryPath","catalog","details","_details","skillNames","skills","map","skill","artifactName","skillName","skillSlug","renderedSkillNames","length","slice","join","remainingCount","Math","max","renderedCountSuffix","slug","filter","Boolean"],"sources":["../src/published-skills-system-note.ts"],"sourcesContent":["import type { PublishedSkillsSuccessState } from './published-skills-transform.js';\n\nconst SYSTEM_NOTE_SKILL_NAME_LIMIT = 10;\n\nexport const buildPublishedSkillsSystemNote = ({\n workspace,\n directoryPath,\n catalog,\n details: _details,\n}: {\n workspace: { slug: string } | null;\n directoryPath: string;\n catalog: PublishedSkillsSuccessState;\n details: unknown[];\n}): string => {\n const skillNames = catalog.skills.map((skill) => skill.artifactName || skill.skillName || skill.skillSlug);\n const renderedSkillNames =\n skillNames.length > 0 ? skillNames.slice(0, SYSTEM_NOTE_SKILL_NAME_LIMIT).join(', ') : 'none';\n const remainingCount = Math.max(skillNames.length - SYSTEM_NOTE_SKILL_NAME_LIMIT, 0);\n const renderedCountSuffix = remainingCount > 0 ? ` (+${remainingCount} more)` : '';\n\n return [\n workspace ? `Workspace: ${workspace.slug}.` : 'Workspace not found; workspace-scoped wizard skills are unavailable.',\n `Directory: ${directoryPath}.`,\n `Wizard-listed skills (${skillNames.length}): ${renderedSkillNames}${renderedCountSuffix}.`,\n 'Fetch rule: only when skill instructions could materially change routing, implementation, validation, or artifact structure, fetch a matching wizard-listed skill with `opencode_wizard_published_skills_fetch`; the fetched `SKILL.md` is authoritative.',\n 'Catalog/status metadata is discovery-only, not executable skill instructions; native/local `.opencode/skills` or OpenCode skill bodies are fallback/source material only when no same-named wizard body can be fetched.',\n 'If fetch/auth/catalog fails, report degraded wizard-skill context and continue with normal repo evidence when safe.',\n 'Use `refresh: true` before cache deletion; use `opencode_wizard_artifact_fetch` for non-skill wizard artifacts.',\n ]\n .filter(Boolean)\n .join(' ');\n};\n"],"mappings":"AAEA,MAAMA,4BAA4B,GAAG,EAAE;AAEvC,OAAO,MAAMC,8BAA8B,GAAGA,CAAC;EAC7CC,SAAS;EACTC,aAAa;EACbC,OAAO;EACPC,OAAO,EAAEC;AAMX,CAAC,KAAa;EACZ,MAAMC,UAAU,GAAGH,OAAO,CAACI,MAAM,CAACC,GAAG,CAAEC,KAAK,IAAKA,KAAK,CAACC,YAAY,IAAID,KAAK,CAACE,SAAS,IAAIF,KAAK,CAACG,SAAS,CAAC;EAC1G,MAAMC,kBAAkB,GACtBP,UAAU,CAACQ,MAAM,GAAG,CAAC,GAAGR,UAAU,CAACS,KAAK,CAAC,CAAC,EAAEhB,4BAA4B,CAAC,CAACiB,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM;EAC/F,MAAMC,cAAc,GAAGC,IAAI,CAACC,GAAG,CAACb,UAAU,CAACQ,MAAM,GAAGf,4BAA4B,EAAE,CAAC,CAAC;EACpF,MAAMqB,mBAAmB,GAAGH,cAAc,GAAG,CAAC,GAAG,MAAMA,cAAc,QAAQ,GAAG,EAAE;EAElF,OAAO,CACLhB,SAAS,GAAG,cAAcA,SAAS,CAACoB,IAAI,GAAG,GAAG,sEAAsE,EACpH,cAAcnB,aAAa,GAAG,EAC9B,yBAAyBI,UAAU,CAACQ,MAAM,MAAMD,kBAAkB,GAAGO,mBAAmB,GAAG,EAC3F,2PAA2P,EAC3P,yNAAyN,EACzN,qHAAqH,EACrH,iHAAiH,CAClH,CACEE,MAAM,CAACC,OAAO,CAAC,CACfP,IAAI,CAAC,GAAG,CAAC;AACd,CAAC","ignoreList":[]}
@@ -3,7 +3,7 @@ export declare const CACHE_TTL_MS = 30000;
3
3
  export declare const WORKSPACE_MAPPING_LIMIT = 100;
4
4
  export declare const ROOT_SKILL_SEED_PATH = ".opencode/skills";
5
5
  export declare const getGlobalConfigPath: () => string;
6
- export declare const LEGACY_AUTH_STATE_PATH = "plugin/opencode-wizard/.generated/auth-state.json";
6
+ export declare const LEGACY_AUTH_STATE_PATH = "plugins/opencode-wizard/.generated/auth-state.json";
7
7
  export declare const OIDC_ISSUER = "https://login.microsoftonline.com/86f4caf4-0d6f-4682-9a06-ea57f3e4e76c/v2.0";
8
8
  export declare const OIDC_CLIENT_ID = "da963901-2375-442b-9e99-14e59f43eda2";
9
9
  export declare const OIDC_CALLBACK_ORIGIN = "http://localhost:24953";
@@ -5,7 +5,7 @@ export const CACHE_TTL_MS = 30_000;
5
5
  export const WORKSPACE_MAPPING_LIMIT = 100;
6
6
  export const ROOT_SKILL_SEED_PATH = '.opencode/skills';
7
7
  export const getGlobalConfigPath = () => path.join(os.homedir(), '.config', 'opencode', 'opencode-wizard.json');
8
- export const LEGACY_AUTH_STATE_PATH = 'plugin/opencode-wizard/.generated/auth-state.json';
8
+ export const LEGACY_AUTH_STATE_PATH = 'plugins/opencode-wizard/.generated/auth-state.json';
9
9
  export const OIDC_ISSUER = 'https://login.microsoftonline.com/86f4caf4-0d6f-4682-9a06-ea57f3e4e76c/v2.0';
10
10
  export const OIDC_CLIENT_ID = 'da963901-2375-442b-9e99-14e59f43eda2';
11
11
  export const OIDC_CALLBACK_ORIGIN = 'http://localhost:24953';
@@ -1 +1 @@
1
- {"version":3,"names":["os","path","PLUGIN_ID","CACHE_TTL_MS","WORKSPACE_MAPPING_LIMIT","ROOT_SKILL_SEED_PATH","getGlobalConfigPath","join","homedir","LEGACY_AUTH_STATE_PATH","OIDC_ISSUER","OIDC_CLIENT_ID","OIDC_CALLBACK_ORIGIN","OIDC_CALLBACK_PATH","OIDC_CALLBACK_URL","OIDC_SCOPES","LOGIN_TIMEOUT_MS","PRESENCE_EVENT_TIMEOUT_MS","PRESENCE_EVENT_MAX_ATTEMPTS","PRESENCE_EVENT_RETRY_DELAY_MS","PRESENCE_SHUTDOWN_SIGNALS","PRESENCE_SIGNAL_EXIT_CODES","SIGINT","SIGTERM","SIGHUP","NATIVE_SKILLS_URL_COMPATIBILITY","configKey","deliveryMode","wizardPrivateDelivery","authSupport","guidance"],"sources":["../../src/server/constants.ts"],"sourcesContent":["import os from 'node:os';\nimport path from 'node:path';\n\nexport const PLUGIN_ID = 'opencode-wizard';\nexport const CACHE_TTL_MS = 30_000;\nexport const WORKSPACE_MAPPING_LIMIT = 100;\nexport const ROOT_SKILL_SEED_PATH = '.opencode/skills';\nexport const getGlobalConfigPath = (): string => path.join(os.homedir(), '.config', 'opencode', 'opencode-wizard.json');\nexport const LEGACY_AUTH_STATE_PATH = 'plugin/opencode-wizard/.generated/auth-state.json';\nexport const OIDC_ISSUER = 'https://login.microsoftonline.com/86f4caf4-0d6f-4682-9a06-ea57f3e4e76c/v2.0';\nexport const OIDC_CLIENT_ID = 'da963901-2375-442b-9e99-14e59f43eda2';\nexport const OIDC_CALLBACK_ORIGIN = 'http://localhost:24953';\nexport const OIDC_CALLBACK_PATH = '/oauth/callback';\nexport const OIDC_CALLBACK_URL = `${OIDC_CALLBACK_ORIGIN}${OIDC_CALLBACK_PATH}`;\nexport const OIDC_SCOPES = ['openid', 'profile', 'email'];\nexport const LOGIN_TIMEOUT_MS = 5 * 60_000;\nexport const PRESENCE_EVENT_TIMEOUT_MS = 3_000;\nexport const PRESENCE_EVENT_MAX_ATTEMPTS = 2;\nexport const PRESENCE_EVENT_RETRY_DELAY_MS = 250;\nexport const PRESENCE_SHUTDOWN_SIGNALS = ['SIGINT', 'SIGTERM', 'SIGHUP'] as const satisfies readonly NodeJS.Signals[];\nexport const PRESENCE_SIGNAL_EXIT_CODES: Record<(typeof PRESENCE_SHUTDOWN_SIGNALS)[number], number> = {\n SIGINT: 130,\n SIGTERM: 143,\n SIGHUP: 129,\n};\n\nexport type NativeSkillsUrlCompatibility = {\n configKey: 'skills.urls';\n deliveryMode: 'public_static_registry';\n wizardPrivateDelivery: 'authenticated_scoped_fetch_tool';\n authSupport: 'none';\n guidance: string;\n};\n\nexport const NATIVE_SKILLS_URL_COMPATIBILITY: NativeSkillsUrlCompatibility = {\n configKey: 'skills.urls',\n deliveryMode: 'public_static_registry',\n wizardPrivateDelivery: 'authenticated_scoped_fetch_tool',\n authSupport: 'none',\n guidance:\n 'OpenCode skills.urls is for public/static registries and complements opencode-wizard; private workspace-scoped skills stay available through the authenticated fetch tool only.',\n};\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,SAAS;AACxB,OAAOC,IAAI,MAAM,WAAW;AAE5B,OAAO,MAAMC,SAAS,GAAG,iBAAiB;AAC1C,OAAO,MAAMC,YAAY,GAAG,MAAM;AAClC,OAAO,MAAMC,uBAAuB,GAAG,GAAG;AAC1C,OAAO,MAAMC,oBAAoB,GAAG,kBAAkB;AACtD,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAcL,IAAI,CAACM,IAAI,CAACP,EAAE,CAACQ,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,sBAAsB,CAAC;AACvH,OAAO,MAAMC,sBAAsB,GAAG,mDAAmD;AACzF,OAAO,MAAMC,WAAW,GAAG,6EAA6E;AACxG,OAAO,MAAMC,cAAc,GAAG,sCAAsC;AACpE,OAAO,MAAMC,oBAAoB,GAAG,wBAAwB;AAC5D,OAAO,MAAMC,kBAAkB,GAAG,iBAAiB;AACnD,OAAO,MAAMC,iBAAiB,GAAG,GAAGF,oBAAoB,GAAGC,kBAAkB,EAAE;AAC/E,OAAO,MAAME,WAAW,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;AACzD,OAAO,MAAMC,gBAAgB,GAAG,CAAC,GAAG,MAAM;AAC1C,OAAO,MAAMC,yBAAyB,GAAG,KAAK;AAC9C,OAAO,MAAMC,2BAA2B,GAAG,CAAC;AAC5C,OAAO,MAAMC,6BAA6B,GAAG,GAAG;AAChD,OAAO,MAAMC,yBAAyB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAA8C;AACrH,OAAO,MAAMC,0BAAsF,GAAG;EACpGC,MAAM,EAAE,GAAG;EACXC,OAAO,EAAE,GAAG;EACZC,MAAM,EAAE;AACV,CAAC;AAUD,OAAO,MAAMC,+BAA6D,GAAG;EAC3EC,SAAS,EAAE,aAAa;EACxBC,YAAY,EAAE,wBAAwB;EACtCC,qBAAqB,EAAE,iCAAiC;EACxDC,WAAW,EAAE,MAAM;EACnBC,QAAQ,EACN;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["os","path","PLUGIN_ID","CACHE_TTL_MS","WORKSPACE_MAPPING_LIMIT","ROOT_SKILL_SEED_PATH","getGlobalConfigPath","join","homedir","LEGACY_AUTH_STATE_PATH","OIDC_ISSUER","OIDC_CLIENT_ID","OIDC_CALLBACK_ORIGIN","OIDC_CALLBACK_PATH","OIDC_CALLBACK_URL","OIDC_SCOPES","LOGIN_TIMEOUT_MS","PRESENCE_EVENT_TIMEOUT_MS","PRESENCE_EVENT_MAX_ATTEMPTS","PRESENCE_EVENT_RETRY_DELAY_MS","PRESENCE_SHUTDOWN_SIGNALS","PRESENCE_SIGNAL_EXIT_CODES","SIGINT","SIGTERM","SIGHUP","NATIVE_SKILLS_URL_COMPATIBILITY","configKey","deliveryMode","wizardPrivateDelivery","authSupport","guidance"],"sources":["../../src/server/constants.ts"],"sourcesContent":["import os from 'node:os';\nimport path from 'node:path';\n\nexport const PLUGIN_ID = 'opencode-wizard';\nexport const CACHE_TTL_MS = 30_000;\nexport const WORKSPACE_MAPPING_LIMIT = 100;\nexport const ROOT_SKILL_SEED_PATH = '.opencode/skills';\nexport const getGlobalConfigPath = (): string => path.join(os.homedir(), '.config', 'opencode', 'opencode-wizard.json');\nexport const LEGACY_AUTH_STATE_PATH = 'plugins/opencode-wizard/.generated/auth-state.json';\nexport const OIDC_ISSUER = 'https://login.microsoftonline.com/86f4caf4-0d6f-4682-9a06-ea57f3e4e76c/v2.0';\nexport const OIDC_CLIENT_ID = 'da963901-2375-442b-9e99-14e59f43eda2';\nexport const OIDC_CALLBACK_ORIGIN = 'http://localhost:24953';\nexport const OIDC_CALLBACK_PATH = '/oauth/callback';\nexport const OIDC_CALLBACK_URL = `${OIDC_CALLBACK_ORIGIN}${OIDC_CALLBACK_PATH}`;\nexport const OIDC_SCOPES = ['openid', 'profile', 'email'];\nexport const LOGIN_TIMEOUT_MS = 5 * 60_000;\nexport const PRESENCE_EVENT_TIMEOUT_MS = 3_000;\nexport const PRESENCE_EVENT_MAX_ATTEMPTS = 2;\nexport const PRESENCE_EVENT_RETRY_DELAY_MS = 250;\nexport const PRESENCE_SHUTDOWN_SIGNALS = ['SIGINT', 'SIGTERM', 'SIGHUP'] as const satisfies readonly NodeJS.Signals[];\nexport const PRESENCE_SIGNAL_EXIT_CODES: Record<(typeof PRESENCE_SHUTDOWN_SIGNALS)[number], number> = {\n SIGINT: 130,\n SIGTERM: 143,\n SIGHUP: 129,\n};\n\nexport type NativeSkillsUrlCompatibility = {\n configKey: 'skills.urls';\n deliveryMode: 'public_static_registry';\n wizardPrivateDelivery: 'authenticated_scoped_fetch_tool';\n authSupport: 'none';\n guidance: string;\n};\n\nexport const NATIVE_SKILLS_URL_COMPATIBILITY: NativeSkillsUrlCompatibility = {\n configKey: 'skills.urls',\n deliveryMode: 'public_static_registry',\n wizardPrivateDelivery: 'authenticated_scoped_fetch_tool',\n authSupport: 'none',\n guidance:\n 'OpenCode skills.urls is for public/static registries and complements opencode-wizard; private workspace-scoped skills stay available through the authenticated fetch tool only.',\n};\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,SAAS;AACxB,OAAOC,IAAI,MAAM,WAAW;AAE5B,OAAO,MAAMC,SAAS,GAAG,iBAAiB;AAC1C,OAAO,MAAMC,YAAY,GAAG,MAAM;AAClC,OAAO,MAAMC,uBAAuB,GAAG,GAAG;AAC1C,OAAO,MAAMC,oBAAoB,GAAG,kBAAkB;AACtD,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAcL,IAAI,CAACM,IAAI,CAACP,EAAE,CAACQ,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,sBAAsB,CAAC;AACvH,OAAO,MAAMC,sBAAsB,GAAG,oDAAoD;AAC1F,OAAO,MAAMC,WAAW,GAAG,6EAA6E;AACxG,OAAO,MAAMC,cAAc,GAAG,sCAAsC;AACpE,OAAO,MAAMC,oBAAoB,GAAG,wBAAwB;AAC5D,OAAO,MAAMC,kBAAkB,GAAG,iBAAiB;AACnD,OAAO,MAAMC,iBAAiB,GAAG,GAAGF,oBAAoB,GAAGC,kBAAkB,EAAE;AAC/E,OAAO,MAAME,WAAW,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;AACzD,OAAO,MAAMC,gBAAgB,GAAG,CAAC,GAAG,MAAM;AAC1C,OAAO,MAAMC,yBAAyB,GAAG,KAAK;AAC9C,OAAO,MAAMC,2BAA2B,GAAG,CAAC;AAC5C,OAAO,MAAMC,6BAA6B,GAAG,GAAG;AAChD,OAAO,MAAMC,yBAAyB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAA8C;AACrH,OAAO,MAAMC,0BAAsF,GAAG;EACpGC,MAAM,EAAE,GAAG;EACXC,OAAO,EAAE,GAAG;EACZC,MAAM,EAAE;AACV,CAAC;AAUD,OAAO,MAAMC,+BAA6D,GAAG;EAC3EC,SAAS,EAAE,aAAa;EACxBC,YAAY,EAAE,wBAAwB;EACtCC,qBAAqB,EAAE,iCAAiC;EACxDC,WAAW,EAAE,MAAM;EACnBC,QAAQ,EACN;AACJ,CAAC","ignoreList":[]}
@@ -1,13 +1,9 @@
1
+ import { type ToolFactory } from '../plugin-tools.js';
1
2
  export { resolveConfig } from './config.js';
2
3
  export { PLUGIN_ID, NATIVE_SKILLS_URL_COMPATIBILITY, type NativeSkillsUrlCompatibility } from './constants.js';
3
4
  export { buildSystemNote, resolvePluginStatusSnapshot, toPluginAuthStateSummary, toPublishedSkillCatalog, } from './status.js';
4
- import type { OpencodePluginServer } from './types.js';
5
+ import type { OpencodePluginServer, OpencodePluginServerInput } from './types.js';
5
6
  export type { PluginAuthStateSummary, PluginStatusSnapshot, PublishedSkillCatalogItem, PublishedSkillCatalogPayload, PublishedSkillDetailItem, PublishedSkillInstallableCatalogItem, } from './types.js';
6
7
  export { resolvePluginStatusSnapshotWithAuthBootstrap } from './auth-bootstrap.js';
7
8
  export { setPublishedSkillIgnored, setPublishedSkillInstalled, toPublishedSkillPreferenceScope } from './preferences.js';
8
- export declare const OpencodeWizardSkillsPlugin: OpencodePluginServer;
9
- declare const _default: {
10
- id: string;
11
- server: OpencodePluginServer;
12
- };
13
- export default _default;
9
+ export declare const createWizardRuntime: (input: OpencodePluginServerInput, tool: ToolFactory) => ReturnType<OpencodePluginServer>;
@@ -18,7 +18,6 @@ import { createIdleLoginBootstrapSnapshot } from './auth-bootstrap.js';
18
18
  import { fetchWizardArtifactImportSource, planWizardArtifactImport } from './import-sources.js';
19
19
  import { getCatalogCacheKey, resolvePublishedSkillPreferenceCacheContext, setPublishedSkillIgnored, setPublishedSkillInstalled, toPublishedSkillPreferenceAction, toPublishedSkillPreferenceScope } from './preferences.js';
20
20
  export { buildSystemNote, resolvePluginStatusSnapshot, toPluginAuthStateSummary, toPublishedSkillCatalog } from './status.js';
21
- const importOpencodePluginModule = new Function('specifier', 'return import(specifier)');
22
21
  export { resolvePluginStatusSnapshotWithAuthBootstrap } from './auth-bootstrap.js';
23
22
  export { setPublishedSkillIgnored, setPublishedSkillInstalled, toPublishedSkillPreferenceScope } from './preferences.js';
24
23
  const getDetailCacheKey = (catalogCacheKey, skillVersionId, revision) => {
@@ -217,10 +216,7 @@ const getMissingIdentifierSuggestions = (identifiers, candidates) => identifiers
217
216
  identifier,
218
217
  suggestions: getIdentifierSuggestions(identifier, candidates)
219
218
  }));
220
- export const OpencodeWizardSkillsPlugin = async input => {
221
- const {
222
- tool
223
- } = await importOpencodePluginModule('@opencode-ai/plugin');
219
+ export const createWizardRuntime = async (input, tool) => {
224
220
  const config = await resolveConfig(input.worktree);
225
221
  const workspacePath = normalizeAbsolutePath(input.worktree);
226
222
  const cache = new Map();
@@ -502,7 +498,8 @@ export const OpencodeWizardSkillsPlugin = async input => {
502
498
  const cacheKey = getDetailCacheKey(catalogCacheKey, item.skillVersion.id, itemRevision);
503
499
  const inflightKey = getDetailInflightKey(catalogCacheKey, item.skillVersion.id, purpose);
504
500
  const cached = detailCache.get(cacheKey);
505
- if (useCache && cached && cached.expiresAt > Date.now()) {
501
+ const shouldUseDetailCache = useCache && purpose !== 'TOOL_FETCH';
502
+ if (shouldUseDetailCache && cached && cached.expiresAt > Date.now()) {
506
503
  return {
507
504
  ok: true,
508
505
  detail: toPublishedSkillDetail({
@@ -512,7 +509,7 @@ export const OpencodeWizardSkillsPlugin = async input => {
512
509
  };
513
510
  }
514
511
  const inflight = detailInflight.get(inflightKey);
515
- if (inflight) {
512
+ if (shouldUseDetailCache && inflight) {
516
513
  return inflight;
517
514
  }
518
515
  const requestPromise = (async () => {
@@ -584,14 +581,15 @@ export const OpencodeWizardSkillsPlugin = async input => {
584
581
  const cacheKey = getDetailCacheKey(catalogCacheKey, item.artifactVersion.id, itemRevision);
585
582
  const inflightKey = JSON.stringify([catalogCacheKey, item.artifactVersion.id, itemRevision, purpose]);
586
583
  const cached = wizardArtifactDetailCache.get(cacheKey);
587
- if (useCache && cached && cached.expiresAt > Date.now()) {
584
+ const shouldUseDetailCache = useCache && purpose !== 'TOOL_FETCH';
585
+ if (shouldUseDetailCache && cached && cached.expiresAt > Date.now()) {
588
586
  return {
589
587
  ok: true,
590
588
  artifact: cached.artifact
591
589
  };
592
590
  }
593
591
  const inflight = wizardArtifactDetailInflight.get(inflightKey);
594
- if (useCache && inflight) {
592
+ if (shouldUseDetailCache && inflight) {
595
593
  const inflightResult = await inflight;
596
594
  if (!inflightResult.ok) return inflightResult;
597
595
  return {
@@ -1882,8 +1880,4 @@ export const OpencodeWizardSkillsPlugin = async input => {
1882
1880
  }
1883
1881
  };
1884
1882
  };
1885
- export default {
1886
- id: PLUGIN_ID,
1887
- server: OpencodeWizardSkillsPlugin
1888
- };
1889
1883
  //# sourceMappingURL=runtime.js.map