@aexol/opencode-wizard 0.2.1 → 0.3.0

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/dist/server.d.ts CHANGED
@@ -163,6 +163,12 @@ type PublishedSkillDetail = PublishedSkillSummary & {
163
163
  files: PublishedSkillArtifactFilePayload[];
164
164
  resources: PublishedSkillArtifactFilePayload[];
165
165
  };
166
+ export type PublishedSkillFetchArgs = {
167
+ skill?: string;
168
+ skills?: string;
169
+ directory?: string;
170
+ refresh?: boolean;
171
+ };
166
172
  type OpencodePluginServerInput = {
167
173
  worktree: string;
168
174
  directory: string;
@@ -253,6 +259,7 @@ export declare const resolveConfig: (worktree: string) => Promise<ResolvedConfig
253
259
  export declare const buildSkillMarkdown: (item: PublishedSkillDetailItem) => string;
254
260
  export declare const toPublishedSkillDetail: (item: PublishedSkillDetailItem) => PublishedSkillDetail;
255
261
  export declare const toPublishedSkillCatalog: (payload: PublishedSkillCatalogPayload) => PublishedSkillsSuccessState;
262
+ export declare const parseRequestedSkillArgs: (args: PublishedSkillFetchArgs) => string[];
256
263
  export declare const selectPublishedSkills: <TItem extends PublishedSkillCatalogItem>(payload: Omit<PublishedSkillCatalogPayload, "skills"> & {
257
264
  skills: TItem[];
258
265
  }, identifiers: string[]) => {
package/dist/server.js CHANGED
@@ -795,11 +795,10 @@ const mergeSkillIdentifiers = values => {
795
795
  return true;
796
796
  });
797
797
  };
798
- const parseRequestedSkillArgs = args => {
798
+ export const parseRequestedSkillArgs = args => {
799
799
  const requestedSkills = [];
800
800
  if (typeof args.skill === 'string') {
801
- const normalizedSkill = args.skill.trim();
802
- if (normalizedSkill) requestedSkills.push(normalizedSkill);
801
+ requestedSkills.push(...parseSkillIdentifiers(args.skill));
803
802
  }
804
803
  if (typeof args.skills === 'string') {
805
804
  requestedSkills.push(...parseSkillIdentifiers(args.skills));
@@ -860,7 +859,7 @@ export const buildSystemNote = (result, config, details) => {
860
859
  const userSkills = catalog.skills.filter(skill => isUserPublishedSkillAssignment(skill.assignmentSource)).slice(0, 5).map(buildSkillCatalogLine);
861
860
  const detailLines = details.slice(0, SYSTEM_NOTE_DETAIL_LIMIT).map(buildSkillDetailSnippetLine);
862
861
  const detailBlock = detailLines.length > 0 ? ` Loaded body snippets (capped):\n${truncateText(detailLines.join('\n'), SYSTEM_NOTE_DETAIL_CHAR_LIMIT)}` : '';
863
- return [result.fetchResult.payload.workspace ? `Prefer opencode-wizard backend-published fetched skill bodies for scoped/private wizard skills in workspace ${result.fetchResult.payload.workspace.slug}.` : 'Prefer opencode-wizard backend-published global fetched skill bodies; workspace-specific skills are unavailable because the workspace was not found.', `Current directory: ${result.directoryPath}.`, `Published skills for this scope: ${renderedSkillNames}${renderedCountSuffix}; counts: ${catalog.assignmentCounts.global} global, ${catalog.assignmentCounts.project} workspace, ${catalog.assignmentCounts.user} user, ${catalog.assignmentCounts.other} other (GLOBAL SCOPE: ${catalog.assignmentCounts.global}, PROJECT SCOPE: ${catalog.assignmentCounts.project}, USER SCOPE: ${catalog.assignmentCounts.user}).`, 'Use catalog whenToUse guidance to decide applicability; when it matches the task, fetch full bodies with opencode_wizard_published_skills_fetch and prefer those fetched bodies for current scoped/private wizard guidance.', 'GLOBAL_CONTEXT skills are active context skills and are not project-installable; PROJECT_INSTALLABLE skills can be assigned to GLOBAL SCOPE, PROJECT SCOPE, or USER SCOPE; assignment rows decide which scope is active here.', globalSkills.length > 0 ? `GLOBAL SCOPE / Global context skills:\n${globalSkills.join('\n')}` : 'GLOBAL SCOPE / Global context skills: none.', projectSkills.length > 0 ? `PROJECT SCOPE / Project-scoped active skills:\n${projectSkills.join('\n')}` : 'PROJECT SCOPE / Project-scoped active skills: none.', userSkills.length > 0 ? `USER SCOPE / User-scoped active skills:\n${userSkills.join('\n')}` : 'USER SCOPE / User-scoped active skills: none.', detailBlock, 'Local/native sources can still complement wizard skills: .opencode/skills is source seed content, skills.urls is a public/static complement, and backend-published fetched bodies are preferred for private/scoped wizard guidance.', `Root source seed path remains seed/source content: ${config.rootSkillSeedPath}/**.`].filter(line => line.length > 0).join(' ');
862
+ return [result.fetchResult.payload.workspace ? `Prefer opencode-wizard backend-published fetched skill bodies for scoped/private wizard skills in workspace ${result.fetchResult.payload.workspace.slug}.` : 'Prefer opencode-wizard backend-published global fetched skill bodies; workspace-specific skills are unavailable because the workspace was not found.', `Current directory: ${result.directoryPath}.`, `Published skills for this scope: ${renderedSkillNames}${renderedCountSuffix}; counts: ${catalog.assignmentCounts.global} global, ${catalog.assignmentCounts.project} workspace, ${catalog.assignmentCounts.user} user, ${catalog.assignmentCounts.other} other (GLOBAL SCOPE: ${catalog.assignmentCounts.global}, PROJECT SCOPE: ${catalog.assignmentCounts.project}, USER SCOPE: ${catalog.assignmentCounts.user}).`, 'Wizard-published skills listed in this note/catalog are not necessarily native OpenCode skills; they may be private, scoped, or backend-published records that only the opencode-wizard fetch tool can load.', 'Use the native OpenCode skill tool only for local/native skills that appear in native available_skills; do not use it for wizard-private/scoped/backend-published skill slugs unless that same skill is also listed by native available_skills.', 'If a native skill call fails with an error like `Skill "diagnose" not found. Available skills: ...` and `diagnose` (or the requested slug/name) is wizard-listed here, treat that failure as evidence to call opencode_wizard_published_skills_fetch for the wizard skill body instead.', 'Use catalog whenToUse guidance to decide applicability; fetch full bodies with opencode_wizard_published_skills_fetch and prefer those fetched bodies for current scoped/private wizard guidance, preferring the `skills` field with comma/newline-separated identifiers for multiple bodies; `skill` is for one identifier but remains backward-compatible with delimited lists.', 'GLOBAL_CONTEXT skills are active context skills and are not project-installable; PROJECT_INSTALLABLE skills can be assigned to GLOBAL SCOPE, PROJECT SCOPE, or USER SCOPE; assignment rows decide which scope is active here.', globalSkills.length > 0 ? `GLOBAL SCOPE / Global context skills:\n${globalSkills.join('\n')}` : 'GLOBAL SCOPE / Global context skills: none.', projectSkills.length > 0 ? `PROJECT SCOPE / Project-scoped active skills:\n${projectSkills.join('\n')}` : 'PROJECT SCOPE / Project-scoped active skills: none.', userSkills.length > 0 ? `USER SCOPE / User-scoped active skills:\n${userSkills.join('\n')}` : 'USER SCOPE / User-scoped active skills: none.', detailBlock, 'Local/native sources can still complement wizard skills: .opencode/skills is source seed content, skills.urls is a public/static complement, and backend-published fetched bodies are preferred for private/scoped wizard guidance.', `Root source seed path remains seed/source content: ${config.rootSkillSeedPath}/**.`].filter(line => line.length > 0).join(' ');
864
863
  };
865
864
  const toWorkspaceResolutionOutput = resolution => ({
866
865
  requestedDirectory: resolution.requestedDirectory,
@@ -2323,7 +2322,7 @@ const OpencodeWizardSkillsPlugin = async input => {
2323
2322
  },
2324
2323
  fetchedAt: filteredPublishedSkillsResult.fetchResult.fetchedAt,
2325
2324
  source: filteredPublishedSkillsResult.fetchResult.source,
2326
- message: 'Catalog discovery only. Provide `skill` or `skills` to fetch markdown bodies/details for selected skills.'
2325
+ message: 'Catalog discovery only. Provide `skill` for one identifier or prefer `skills` for comma/newline-separated multiple identifiers to fetch markdown bodies/details.'
2327
2326
  }, null, 2),
2328
2327
  metadata: {
2329
2328
  status: 'ready',
@@ -2487,9 +2486,9 @@ const OpencodeWizardSkillsPlugin = async input => {
2487
2486
  return {
2488
2487
  tool: {
2489
2488
  opencode_wizard_published_skills_fetch: tool({
2490
- description: 'Fetch one or multiple published skill bodies/details for the current scope; call with no args to discover the catalog and bootstrap auth when needed',
2489
+ description: 'Fetch one or multiple wizard-published skill bodies/details for the current scope. Use this for wizard-listed/private/scoped/backend-published skill slugs instead of the native OpenCode skill tool, and after native errors like `Skill "..." not found`; prefer `skills` for multiple identifiers and call with no args to discover the catalog and bootstrap auth when needed',
2491
2490
  args: {
2492
- skill: tool.schema.string().optional().describe('Single skill slug, artifact name, or skill name'),
2491
+ skill: tool.schema.string().optional().describe('Single skill slug, artifact name, or skill name; backward-compatible with comma/newline-delimited lists'),
2493
2492
  skills: tool.schema.string().optional().describe('One or more comma-separated or newline-separated skill slugs, artifact names, or skill names'),
2494
2493
  directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),
2495
2494
  refresh: tool.schema.boolean().optional().describe('Bypass the local plugin cache for this request')