@aexol/opencode-wizard 0.3.2 → 0.3.4

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.
Files changed (97) hide show
  1. package/README.md +4 -0
  2. package/dist/graphql-operations.d.ts +4 -0
  3. package/dist/graphql-operations.js +225 -0
  4. package/dist/graphql-operations.js.map +1 -0
  5. package/dist/plugin-tools.d.ts +64 -0
  6. package/dist/plugin-tools.js +57 -0
  7. package/dist/plugin-tools.js.map +1 -0
  8. package/dist/published-skills-system-note.d.ts +9 -0
  9. package/dist/published-skills-system-note.js +34 -0
  10. package/dist/published-skills-system-note.js.map +1 -0
  11. package/dist/published-skills-transform.d.ts +161 -0
  12. package/dist/published-skills-transform.js +238 -0
  13. package/dist/published-skills-transform.js.map +1 -0
  14. package/dist/server/auth-flow.d.ts +10 -0
  15. package/dist/server/auth-flow.js +215 -0
  16. package/dist/server/auth-flow.js.map +1 -0
  17. package/dist/server/auth-store.d.ts +19 -0
  18. package/dist/server/auth-store.js +177 -0
  19. package/dist/server/auth-store.js.map +1 -0
  20. package/dist/server/client.d.ts +51 -0
  21. package/dist/server/client.js +244 -0
  22. package/dist/server/client.js.map +1 -0
  23. package/dist/server/config.d.ts +2 -0
  24. package/dist/server/config.js +82 -0
  25. package/dist/server/config.js.map +1 -0
  26. package/dist/server/constants.d.ts +26 -0
  27. package/dist/server/constants.js +32 -0
  28. package/dist/server/constants.js.map +1 -0
  29. package/dist/server/path-utils.d.ts +2 -0
  30. package/dist/server/path-utils.js +8 -0
  31. package/dist/server/path-utils.js.map +1 -0
  32. package/dist/server/presence.d.ts +14 -0
  33. package/dist/server/presence.js +68 -0
  34. package/dist/server/presence.js.map +1 -0
  35. package/dist/server/runtime.d.ts +32 -0
  36. package/dist/server/runtime.js +1110 -0
  37. package/dist/server/runtime.js.map +1 -0
  38. package/dist/server/status.d.ts +27 -0
  39. package/dist/server/status.js +224 -0
  40. package/dist/server/status.js.map +1 -0
  41. package/dist/server/types.d.ts +321 -0
  42. package/dist/server/types.js +2 -0
  43. package/dist/server/types.js.map +1 -0
  44. package/dist/server/workspace.d.ts +15 -0
  45. package/dist/server/workspace.js +126 -0
  46. package/dist/server/workspace.js.map +1 -0
  47. package/dist/server.d.ts +4 -304
  48. package/dist/server.js +4 -2489
  49. package/dist/server.js.map +1 -1
  50. package/dist/smoke-published-skills.js +11 -9
  51. package/dist/smoke-published-skills.js.map +1 -1
  52. package/dist/tui/components/common.d.ts +15 -0
  53. package/dist/tui/components/common.js +81 -0
  54. package/dist/tui/components/common.js.map +1 -0
  55. package/dist/tui/components/preference-action-notice-row.d.ts +5 -0
  56. package/dist/tui/components/preference-action-notice-row.js +17 -0
  57. package/dist/tui/components/preference-action-notice-row.js.map +1 -0
  58. package/dist/tui/components/skill-catalog-row.d.ts +8 -0
  59. package/dist/tui/components/skill-catalog-row.js +124 -0
  60. package/dist/tui/components/skill-catalog-row.js.map +1 -0
  61. package/dist/tui/components/status-content.d.ts +14 -0
  62. package/dist/tui/components/status-content.js +131 -0
  63. package/dist/tui/components/status-content.js.map +1 -0
  64. package/dist/tui/components/wizard-skills-dialog-content.d.ts +9 -0
  65. package/dist/tui/components/wizard-skills-dialog-content.js +219 -0
  66. package/dist/tui/components/wizard-skills-dialog-content.js.map +1 -0
  67. package/dist/tui/components/wizard-skills-dialog.d.ts +7 -0
  68. package/dist/tui/components/wizard-skills-dialog.js +156 -0
  69. package/dist/tui/components/wizard-skills-dialog.js.map +1 -0
  70. package/dist/tui/constants.d.ts +8 -0
  71. package/dist/tui/constants.js +9 -0
  72. package/dist/tui/constants.js.map +1 -0
  73. package/dist/tui/formatting.d.ts +8 -0
  74. package/dist/tui/formatting.js +45 -0
  75. package/dist/tui/formatting.js.map +1 -0
  76. package/dist/tui/plugin.d.ts +2 -0
  77. package/dist/tui/plugin.js +26 -0
  78. package/dist/tui/plugin.js.map +1 -0
  79. package/dist/tui/rendering.d.ts +2 -0
  80. package/dist/tui/rendering.js +8 -0
  81. package/dist/tui/rendering.js.map +1 -0
  82. package/dist/tui/skill-helpers.d.ts +13 -0
  83. package/dist/tui/skill-helpers.js +49 -0
  84. package/dist/tui/skill-helpers.js.map +1 -0
  85. package/dist/tui/slots.d.ts +2 -0
  86. package/dist/tui/slots.js +56 -0
  87. package/dist/tui/slots.js.map +1 -0
  88. package/dist/tui/status.d.ts +2 -0
  89. package/dist/tui/status.js +21 -0
  90. package/dist/tui/status.js.map +1 -0
  91. package/dist/tui/types.d.ts +75 -0
  92. package/dist/tui/types.js +2 -0
  93. package/dist/tui/types.js.map +1 -0
  94. package/dist/tui.d.ts +1 -44
  95. package/dist/tui.js +2 -870
  96. package/dist/tui.js.map +1 -1
  97. package/package.json +1 -1
package/README.md CHANGED
@@ -52,6 +52,10 @@ Call `opencode_wizard_published_skills_fetch` without `skill` or `skills` to man
52
52
 
53
53
  No-arg discovery returns published skill summaries, assignment counts split into `global`, `project`, `user`, and `other`, policy metadata, and no markdown bodies. Existing `skill` and `skills` calls still fetch one or more full skill body/detail payloads by slug, artifact name, or skill name.
54
54
 
55
+ Workspace delivery still follows the backend contract: the plugin sends `workspaceSlug` when it has one, otherwise falls back to `repositoryUrl`. The plugin now prefers configured or learned workspace slug mappings over a repo-basename fallback, and learns durable slug-to-repo mappings from successful backend catalog responses so worktrees and nontrivial repo roots stay aligned.
56
+
57
+ Published skill fetches still support `refresh: true`, but normal cache entries now self-expire after 30 seconds and fetch/status payloads surface `source`, `workspaceSlug`, and `workspaceSlugSource` so stale-vs-refreshed behavior is visible without relying on manual cache deletion.
58
+
55
59
  Use `opencode_wizard_published_skill_preference_set` for non-TUI preference actions (`install`, `uninstall`, `ignore`, `unignore`) against the same server-backed preference API used by the TUI overlay.
56
60
 
57
61
  `GLOBAL_CONTEXT` skills are active context skills and are not meant to be installed per project. `PROJECT_INSTALLABLE` skills are gallery/installable skills that may be attached globally or to a workspace/path through assignment records; those assignments remain the source of truth for what is active in a catalog response.
@@ -0,0 +1,4 @@
1
+ export declare const PUBLISHED_SKILLS_CATALOG_QUERY = "\n query PluginPublishedSkills($input: PublishedSkillsDeliveryInput!) {\n pluginPublishedSkills(input: $input) {\n workspace {\n id\n slug\n name\n repositoryUrl\n defaultBranch\n status\n }\n directoryPath\n skills {\n assignmentSource\n assignmentType\n scopePath\n includeChildren\n skill {\n id\n slug\n name\n summary\n whenToUse\n status\n installPolicy\n tags {\n id\n slug\n label\n description\n facet {\n id\n slug\n label\n description\n }\n }\n }\n skillVersion {\n id\n version\n title\n summary\n status\n }\n publishedArtifact {\n id\n frontmatterName\n frontmatterDescription\n checksum\n publishedAt\n fileCount\n }\n }\n catalogSkills {\n skill {\n id\n slug\n name\n summary\n whenToUse\n status\n installPolicy\n tags {\n id\n slug\n label\n description\n facet {\n id\n slug\n label\n description\n }\n }\n }\n skillVersion {\n id\n version\n title\n summary\n status\n }\n publishedArtifact {\n id\n frontmatterName\n frontmatterDescription\n checksum\n publishedAt\n fileCount\n }\n }\n userPreferences {\n scopeKey\n userKey\n ignoredSkills {\n assignmentSource\n assignmentType\n scopePath\n includeChildren\n skill {\n id\n slug\n name\n summary\n whenToUse\n status\n installPolicy\n tags {\n id\n slug\n label\n description\n facet {\n id\n slug\n label\n description\n }\n }\n }\n skillVersion {\n id\n version\n title\n summary\n status\n }\n publishedArtifact {\n id\n frontmatterName\n frontmatterDescription\n checksum\n publishedAt\n fileCount\n }\n }\n }\n }\n }\n";
2
+ export declare const SET_PUBLISHED_SKILL_PREFERENCE_MUTATION = "\n mutation SetPublishedSkillPreference($input: SetPublishedSkillPreferenceInput!) {\n setPublishedSkillPreference(input: $input) {\n scopeKey\n userKey\n ignoredSkills {\n assignmentSource\n assignmentType\n scopePath\n includeChildren\n skill {\n id\n slug\n name\n summary\n whenToUse\n status\n installPolicy\n tags {\n id\n slug\n label\n description\n facet {\n id\n slug\n label\n description\n }\n }\n }\n skillVersion {\n id\n version\n title\n summary\n status\n }\n publishedArtifact {\n id\n frontmatterName\n frontmatterDescription\n checksum\n publishedAt\n fileCount\n }\n }\n }\n }\n";
3
+ export declare const PUBLISHED_SKILL_DETAIL_QUERY = "\n query PluginPublishedSkillVersionArtifact($input: PublishedSkillArtifactDetailInput!) {\n pluginPublishedSkillVersionArtifact(input: $input) {\n id\n frontmatterName\n frontmatterDescription\n markdownBody\n renderedContent\n checksum\n publishedAt\n fileCount\n files {\n id\n relativePath\n contentType\n content\n checksum\n size\n sortOrder\n }\n }\n }\n";
4
+ export declare const CREATE_OR_UPDATE_SKILL_FROM_MARKDOWN_MUTATION = "\n mutation CreateOrUpdateSkillFromMarkdown($markdownContent: String!) {\n createOrUpdateSkillFromMarkdown(markdownContent: $markdownContent) {\n success\n skillSlug\n skillVersionId\n errors\n }\n }\n";
@@ -0,0 +1,225 @@
1
+ export const PUBLISHED_SKILLS_CATALOG_QUERY = `
2
+ query PluginPublishedSkills($input: PublishedSkillsDeliveryInput!) {
3
+ pluginPublishedSkills(input: $input) {
4
+ workspace {
5
+ id
6
+ slug
7
+ name
8
+ repositoryUrl
9
+ defaultBranch
10
+ status
11
+ }
12
+ directoryPath
13
+ skills {
14
+ assignmentSource
15
+ assignmentType
16
+ scopePath
17
+ includeChildren
18
+ skill {
19
+ id
20
+ slug
21
+ name
22
+ summary
23
+ whenToUse
24
+ status
25
+ installPolicy
26
+ tags {
27
+ id
28
+ slug
29
+ label
30
+ description
31
+ facet {
32
+ id
33
+ slug
34
+ label
35
+ description
36
+ }
37
+ }
38
+ }
39
+ skillVersion {
40
+ id
41
+ version
42
+ title
43
+ summary
44
+ status
45
+ }
46
+ publishedArtifact {
47
+ id
48
+ frontmatterName
49
+ frontmatterDescription
50
+ checksum
51
+ publishedAt
52
+ fileCount
53
+ }
54
+ }
55
+ catalogSkills {
56
+ skill {
57
+ id
58
+ slug
59
+ name
60
+ summary
61
+ whenToUse
62
+ status
63
+ installPolicy
64
+ tags {
65
+ id
66
+ slug
67
+ label
68
+ description
69
+ facet {
70
+ id
71
+ slug
72
+ label
73
+ description
74
+ }
75
+ }
76
+ }
77
+ skillVersion {
78
+ id
79
+ version
80
+ title
81
+ summary
82
+ status
83
+ }
84
+ publishedArtifact {
85
+ id
86
+ frontmatterName
87
+ frontmatterDescription
88
+ checksum
89
+ publishedAt
90
+ fileCount
91
+ }
92
+ }
93
+ userPreferences {
94
+ scopeKey
95
+ userKey
96
+ ignoredSkills {
97
+ assignmentSource
98
+ assignmentType
99
+ scopePath
100
+ includeChildren
101
+ skill {
102
+ id
103
+ slug
104
+ name
105
+ summary
106
+ whenToUse
107
+ status
108
+ installPolicy
109
+ tags {
110
+ id
111
+ slug
112
+ label
113
+ description
114
+ facet {
115
+ id
116
+ slug
117
+ label
118
+ description
119
+ }
120
+ }
121
+ }
122
+ skillVersion {
123
+ id
124
+ version
125
+ title
126
+ summary
127
+ status
128
+ }
129
+ publishedArtifact {
130
+ id
131
+ frontmatterName
132
+ frontmatterDescription
133
+ checksum
134
+ publishedAt
135
+ fileCount
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ `;
142
+ export const SET_PUBLISHED_SKILL_PREFERENCE_MUTATION = `
143
+ mutation SetPublishedSkillPreference($input: SetPublishedSkillPreferenceInput!) {
144
+ setPublishedSkillPreference(input: $input) {
145
+ scopeKey
146
+ userKey
147
+ ignoredSkills {
148
+ assignmentSource
149
+ assignmentType
150
+ scopePath
151
+ includeChildren
152
+ skill {
153
+ id
154
+ slug
155
+ name
156
+ summary
157
+ whenToUse
158
+ status
159
+ installPolicy
160
+ tags {
161
+ id
162
+ slug
163
+ label
164
+ description
165
+ facet {
166
+ id
167
+ slug
168
+ label
169
+ description
170
+ }
171
+ }
172
+ }
173
+ skillVersion {
174
+ id
175
+ version
176
+ title
177
+ summary
178
+ status
179
+ }
180
+ publishedArtifact {
181
+ id
182
+ frontmatterName
183
+ frontmatterDescription
184
+ checksum
185
+ publishedAt
186
+ fileCount
187
+ }
188
+ }
189
+ }
190
+ }
191
+ `;
192
+ export const PUBLISHED_SKILL_DETAIL_QUERY = `
193
+ query PluginPublishedSkillVersionArtifact($input: PublishedSkillArtifactDetailInput!) {
194
+ pluginPublishedSkillVersionArtifact(input: $input) {
195
+ id
196
+ frontmatterName
197
+ frontmatterDescription
198
+ markdownBody
199
+ renderedContent
200
+ checksum
201
+ publishedAt
202
+ fileCount
203
+ files {
204
+ id
205
+ relativePath
206
+ contentType
207
+ content
208
+ checksum
209
+ size
210
+ sortOrder
211
+ }
212
+ }
213
+ }
214
+ `;
215
+ export const CREATE_OR_UPDATE_SKILL_FROM_MARKDOWN_MUTATION = `
216
+ mutation CreateOrUpdateSkillFromMarkdown($markdownContent: String!) {
217
+ createOrUpdateSkillFromMarkdown(markdownContent: $markdownContent) {
218
+ success
219
+ skillSlug
220
+ skillVersionId
221
+ errors
222
+ }
223
+ }
224
+ `;
225
+ //# sourceMappingURL=graphql-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PUBLISHED_SKILLS_CATALOG_QUERY","SET_PUBLISHED_SKILL_PREFERENCE_MUTATION","PUBLISHED_SKILL_DETAIL_QUERY","CREATE_OR_UPDATE_SKILL_FROM_MARKDOWN_MUTATION"],"sources":["../src/graphql-operations.ts"],"sourcesContent":["export const PUBLISHED_SKILLS_CATALOG_QUERY = `\n query PluginPublishedSkills($input: PublishedSkillsDeliveryInput!) {\n pluginPublishedSkills(input: $input) {\n workspace {\n id\n slug\n name\n repositoryUrl\n defaultBranch\n status\n }\n directoryPath\n skills {\n assignmentSource\n assignmentType\n scopePath\n includeChildren\n skill {\n id\n slug\n name\n summary\n whenToUse\n status\n installPolicy\n tags {\n id\n slug\n label\n description\n facet {\n id\n slug\n label\n description\n }\n }\n }\n skillVersion {\n id\n version\n title\n summary\n status\n }\n publishedArtifact {\n id\n frontmatterName\n frontmatterDescription\n checksum\n publishedAt\n fileCount\n }\n }\n catalogSkills {\n skill {\n id\n slug\n name\n summary\n whenToUse\n status\n installPolicy\n tags {\n id\n slug\n label\n description\n facet {\n id\n slug\n label\n description\n }\n }\n }\n skillVersion {\n id\n version\n title\n summary\n status\n }\n publishedArtifact {\n id\n frontmatterName\n frontmatterDescription\n checksum\n publishedAt\n fileCount\n }\n }\n userPreferences {\n scopeKey\n userKey\n ignoredSkills {\n assignmentSource\n assignmentType\n scopePath\n includeChildren\n skill {\n id\n slug\n name\n summary\n whenToUse\n status\n installPolicy\n tags {\n id\n slug\n label\n description\n facet {\n id\n slug\n label\n description\n }\n }\n }\n skillVersion {\n id\n version\n title\n summary\n status\n }\n publishedArtifact {\n id\n frontmatterName\n frontmatterDescription\n checksum\n publishedAt\n fileCount\n }\n }\n }\n }\n }\n`;\n\nexport const SET_PUBLISHED_SKILL_PREFERENCE_MUTATION = `\n mutation SetPublishedSkillPreference($input: SetPublishedSkillPreferenceInput!) {\n setPublishedSkillPreference(input: $input) {\n scopeKey\n userKey\n ignoredSkills {\n assignmentSource\n assignmentType\n scopePath\n includeChildren\n skill {\n id\n slug\n name\n summary\n whenToUse\n status\n installPolicy\n tags {\n id\n slug\n label\n description\n facet {\n id\n slug\n label\n description\n }\n }\n }\n skillVersion {\n id\n version\n title\n summary\n status\n }\n publishedArtifact {\n id\n frontmatterName\n frontmatterDescription\n checksum\n publishedAt\n fileCount\n }\n }\n }\n }\n`;\n\nexport const PUBLISHED_SKILL_DETAIL_QUERY = `\n query PluginPublishedSkillVersionArtifact($input: PublishedSkillArtifactDetailInput!) {\n pluginPublishedSkillVersionArtifact(input: $input) {\n id\n frontmatterName\n frontmatterDescription\n markdownBody\n renderedContent\n checksum\n publishedAt\n fileCount\n files {\n id\n relativePath\n contentType\n content\n checksum\n size\n sortOrder\n }\n }\n }\n`;\n\nexport const CREATE_OR_UPDATE_SKILL_FROM_MARKDOWN_MUTATION = `\n mutation CreateOrUpdateSkillFromMarkdown($markdownContent: String!) {\n createOrUpdateSkillFromMarkdown(markdownContent: $markdownContent) {\n success\n skillSlug\n skillVersionId\n errors\n }\n }\n`;\n"],"mappings":"AAAA,OAAO,MAAMA,8BAA8B,GAAG;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,uCAAuC,GAAG;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,4BAA4B,GAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,6CAA6C,GAAG;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,64 @@
1
+ export type PublishedSkillFetchArgs = {
2
+ skill?: string;
3
+ skills?: string;
4
+ directory?: string;
5
+ refresh?: boolean;
6
+ };
7
+ export type PluginStatusArgs = {
8
+ directory?: string;
9
+ };
10
+ export type PublishedSkillPreferenceArgs = {
11
+ skill: string;
12
+ action: string;
13
+ preferenceScope?: string;
14
+ directory?: string;
15
+ };
16
+ export type EditorPublishSkillArgs = {
17
+ skillSlug: string;
18
+ directory?: string;
19
+ };
20
+ type ToolSchemaValue<TSelf> = {
21
+ optional: () => TSelf;
22
+ describe: (description: string) => TSelf;
23
+ };
24
+ type ToolSchema = {
25
+ string: () => ToolSchemaValue<ToolSchemaValue<unknown>>;
26
+ boolean: () => ToolSchemaValue<ToolSchemaValue<unknown>>;
27
+ };
28
+ export type ToolExecuteContext = {
29
+ directory: string;
30
+ abort: AbortSignal;
31
+ metadata: (payload: {
32
+ title: string;
33
+ metadata: Record<string, string>;
34
+ }) => void;
35
+ };
36
+ type ToolDefinition<TArgs extends object> = {
37
+ description: string;
38
+ args: {
39
+ [K in keyof TArgs]-?: unknown;
40
+ };
41
+ execute: (args: TArgs, context: ToolExecuteContext) => Promise<unknown>;
42
+ };
43
+ export type ToolFactory = (<TArgs extends object>(definition: ToolDefinition<TArgs>) => unknown) & {
44
+ schema: ToolSchema;
45
+ };
46
+ type PublishedSkillToolHandlers = {
47
+ fetchPublishedSkills: (args: PublishedSkillFetchArgs, context: ToolExecuteContext) => Promise<unknown>;
48
+ updatePublishedSkillPreference: (args: PublishedSkillPreferenceArgs, context: ToolExecuteContext) => Promise<unknown>;
49
+ getStatus: (args: PluginStatusArgs, context: ToolExecuteContext) => Promise<unknown>;
50
+ publishEditorSkill: (args: EditorPublishSkillArgs, context: ToolExecuteContext) => Promise<unknown>;
51
+ };
52
+ export declare const AVAILABLE_PUBLISHED_SKILL_TOOLS: string[];
53
+ export declare const resolveAvailableTools: (role: string | null | undefined) => string[];
54
+ export declare const createPublishedSkillToolDefinitions: (tool: ToolFactory, handlers: PublishedSkillToolHandlers) => {
55
+ sharedTools: {
56
+ opencode_wizard_published_skills_fetch: unknown;
57
+ opencode_wizard_published_skill_preference_set: unknown;
58
+ opencode_wizard_status: unknown;
59
+ };
60
+ editorOnlyTools: {
61
+ opencode_wizard_editor_publish_skill: unknown;
62
+ };
63
+ };
64
+ export {};
@@ -0,0 +1,57 @@
1
+ export const AVAILABLE_PUBLISHED_SKILL_TOOLS = ['opencode_wizard_published_skills_fetch', 'opencode_wizard_published_skill_preference_set', 'opencode_wizard_status', 'opencode_wizard_editor_publish_skill'];
2
+ const SHARED_PUBLISHED_SKILL_TOOLS = AVAILABLE_PUBLISHED_SKILL_TOOLS.slice(0, 3);
3
+ export const resolveAvailableTools = role => {
4
+ if (role === 'ADMIN') return [...SHARED_PUBLISHED_SKILL_TOOLS];
5
+ if (role === 'EDITOR') return [...AVAILABLE_PUBLISHED_SKILL_TOOLS];
6
+ return [];
7
+ };
8
+ export const createPublishedSkillToolDefinitions = (tool, handlers) => ({
9
+ sharedTools: {
10
+ opencode_wizard_published_skills_fetch: tool({
11
+ 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',
12
+ args: {
13
+ skill: tool.schema.string().optional().describe('Single skill slug, artifact name, or skill name; backward-compatible with comma/newline-delimited lists'),
14
+ skills: tool.schema.string().optional().describe('One or more comma-separated or newline-separated skill slugs, artifact names, or skill names'),
15
+ directory: tool.schema.string().optional().describe('Optional absolute or relative directory override'),
16
+ refresh: tool.schema.boolean().optional().describe('Bypass the local plugin cache for this request')
17
+ },
18
+ async execute(args, context) {
19
+ return handlers.fetchPublishedSkills(args, context);
20
+ }
21
+ }),
22
+ opencode_wizard_published_skill_preference_set: tool({
23
+ description: 'Install, uninstall, ignore, or unignore a backend-published wizard skill for non-TUI workflows using the same shared server-backed preference API as the TUI overlay',
24
+ args: {
25
+ skill: tool.schema.string().describe('Published skill slug, artifact name, or skill name to update'),
26
+ action: tool.schema.string().describe('Preference action: install, uninstall, ignore, or unignore'),
27
+ preferenceScope: tool.schema.string().optional().describe('Preference scope for the action: project or global; defaults to project'),
28
+ directory: tool.schema.string().optional().describe('Optional absolute or relative directory override')
29
+ },
30
+ async execute(args, context) {
31
+ return handlers.updatePublishedSkillPreference(args, context);
32
+ }
33
+ }),
34
+ opencode_wizard_status: tool({
35
+ description: 'Report opencode-wizard plugin status, bootstrap auth when missing, and return a safe auth summary without exposing tokens',
36
+ args: {
37
+ directory: tool.schema.string().optional().describe('Optional absolute or relative directory override')
38
+ },
39
+ async execute(args, context) {
40
+ return handlers.getStatus(args, context);
41
+ }
42
+ })
43
+ },
44
+ editorOnlyTools: {
45
+ opencode_wizard_editor_publish_skill: tool({
46
+ description: 'Read skill markdown files from .opencode/skills/ and publish them to the backend via the createOrUpdateSkillFromMarkdown mutation. Requires EDITOR role.',
47
+ args: {
48
+ skillSlug: tool.schema.string().describe('Skill slug matching a directory under .opencode/skills/'),
49
+ directory: tool.schema.string().optional().describe('Optional absolute or relative directory override')
50
+ },
51
+ async execute(args, context) {
52
+ return handlers.publishEditorSkill(args, context);
53
+ }
54
+ })
55
+ }
56
+ });
57
+ //# sourceMappingURL=plugin-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AVAILABLE_PUBLISHED_SKILL_TOOLS","SHARED_PUBLISHED_SKILL_TOOLS","slice","resolveAvailableTools","role","createPublishedSkillToolDefinitions","tool","handlers","sharedTools","opencode_wizard_published_skills_fetch","description","args","skill","schema","string","optional","describe","skills","directory","refresh","boolean","execute","context","fetchPublishedSkills","opencode_wizard_published_skill_preference_set","action","preferenceScope","updatePublishedSkillPreference","opencode_wizard_status","getStatus","editorOnlyTools","opencode_wizard_editor_publish_skill","skillSlug","publishEditorSkill"],"sources":["../src/plugin-tools.ts"],"sourcesContent":["export type PublishedSkillFetchArgs = {\n skill?: string;\n skills?: string;\n directory?: string;\n refresh?: boolean;\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 EditorPublishSkillArgs = {\n skillSlug: 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 updatePublishedSkillPreference: (args: PublishedSkillPreferenceArgs, context: ToolExecuteContext) => Promise<unknown>;\n getStatus: (args: PluginStatusArgs, context: ToolExecuteContext) => Promise<unknown>;\n publishEditorSkill: (args: EditorPublishSkillArgs, context: ToolExecuteContext) => Promise<unknown>;\n};\n\nexport const AVAILABLE_PUBLISHED_SKILL_TOOLS = [\n 'opencode_wizard_published_skills_fetch',\n 'opencode_wizard_published_skill_preference_set',\n 'opencode_wizard_status',\n 'opencode_wizard_editor_publish_skill',\n];\n\nconst SHARED_PUBLISHED_SKILL_TOOLS = AVAILABLE_PUBLISHED_SKILL_TOOLS.slice(0, 3);\n\nexport const resolveAvailableTools = (role: string | null | undefined): string[] => {\n if (role === 'ADMIN') return [...SHARED_PUBLISHED_SKILL_TOOLS];\n if (role === 'EDITOR') return [...AVAILABLE_PUBLISHED_SKILL_TOOLS];\n return [];\n};\n\nexport const createPublishedSkillToolDefinitions = (\n tool: ToolFactory,\n handlers: PublishedSkillToolHandlers,\n) => ({\n sharedTools: {\n opencode_wizard_published_skills_fetch: tool<PublishedSkillFetchArgs>({\n description:\n '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',\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 },\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 'Install, uninstall, ignore, or unignore a backend-published wizard skill for non-TUI workflows using the same shared server-backed preference API as the TUI overlay',\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 or global; defaults to project'),\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 'Report opencode-wizard plugin status, bootstrap auth when missing, and return a safe auth summary without exposing tokens',\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_publish_skill: tool<EditorPublishSkillArgs>({\n description:\n 'Read skill markdown files from .opencode/skills/ and publish them to the backend via the createOrUpdateSkillFromMarkdown mutation. Requires 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 },\n});\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import { type PublishedSkillsSuccessState } from './published-skills-transform.js';
2
+ export declare const buildPublishedSkillsSystemNote: ({ workspace, directoryPath, catalog, details: _details, }: {
3
+ workspace: {
4
+ slug: string;
5
+ } | null;
6
+ directoryPath: string;
7
+ catalog: PublishedSkillsSuccessState;
8
+ details: unknown[];
9
+ }) => string;
@@ -0,0 +1,34 @@
1
+ import { isUserPublishedSkillAssignment } from './published-skills-transform.js';
2
+ const SYSTEM_NOTE_SKILL_NAME_LIMIT = 10;
3
+ const SYSTEM_NOTE_SKILL_DESCRIPTION_LIMIT = 140;
4
+ const truncateText = (value, maxLength) => {
5
+ const normalized = value.replace(/\s+/gu, ' ').trim();
6
+ if (normalized.length <= maxLength) return normalized;
7
+ return `${normalized.slice(0, Math.max(maxLength - 1, 0)).trimEnd()}…`;
8
+ };
9
+ const SCOPE_LABELS = {
10
+ global: 'GLOBAL SCOPE',
11
+ project: 'PROJECT SCOPE',
12
+ installable: 'INSTALLABLE'
13
+ };
14
+ const buildSkillCatalogLine = skill => {
15
+ const description = truncateText(skill.whenToUse || skill.artifactDescription || skill.skillName || skill.skillSlug, SYSTEM_NOTE_SKILL_DESCRIPTION_LIMIT);
16
+ const scopeLabel = isUserPublishedSkillAssignment(skill.assignmentSource) ? 'USER SCOPE' : SCOPE_LABELS[skill.contextKind] || 'PROJECT SCOPE';
17
+ return `- ${skill.artifactName || skill.skillName} (${skill.skillSlug}, ${scopeLabel}): ${description}`;
18
+ };
19
+ export const buildPublishedSkillsSystemNote = ({
20
+ workspace,
21
+ directoryPath,
22
+ catalog,
23
+ details: _details
24
+ }) => {
25
+ const skillNames = catalog.skills.map(skill => skill.artifactName || skill.skillName || skill.skillSlug);
26
+ const renderedSkillNames = skillNames.length > 0 ? skillNames.slice(0, SYSTEM_NOTE_SKILL_NAME_LIMIT).join(', ') : 'none';
27
+ const remainingCount = Math.max(skillNames.length - SYSTEM_NOTE_SKILL_NAME_LIMIT, 0);
28
+ const renderedCountSuffix = remainingCount > 0 ? ` (+${remainingCount} more)` : '';
29
+ const globalSkills = catalog.skills.filter(skill => skill.contextKind === 'global' && !isUserPublishedSkillAssignment(skill.assignmentSource)).slice(0, 8).map(buildSkillCatalogLine);
30
+ const projectSkills = catalog.skills.filter(skill => skill.contextKind === 'project' && !isUserPublishedSkillAssignment(skill.assignmentSource)).slice(0, 5).map(buildSkillCatalogLine);
31
+ const userSkills = catalog.skills.filter(skill => isUserPublishedSkillAssignment(skill.assignmentSource)).slice(0, 5).map(buildSkillCatalogLine);
32
+ return [workspace ? `Workspace: ${workspace.slug}.` : 'Workspace not found; workspace-scoped wizard skills are unavailable.', `Current directory: ${directoryPath}.`, `Active wizard skills: ${renderedSkillNames}${renderedCountSuffix}.`, `Counts: ${catalog.assignmentCounts.global} global, ${catalog.assignmentCounts.project} project, ${catalog.assignmentCounts.user} user, ${catalog.assignmentCounts.other} other.`, 'Wizard-listed skills are backend-published; fetch body via `opencode_wizard_published_skills_fetch` before use (`skills`/`skill` for multiple/single). If native skill loading fails for a wizard name, fetch it. Fetched wizard bodies are authoritative over local seed/native sources.', globalSkills.length > 0 ? `Global skills:\n${globalSkills.join('\n')}` : 'Global skills: none.', projectSkills.length > 0 ? `Project skills:\n${projectSkills.join('\n')}` : 'Project skills: none.', userSkills.length > 0 ? `User skills:\n${userSkills.join('\n')}` : 'User skills: none.'].filter(Boolean).join(' ');
33
+ };
34
+ //# sourceMappingURL=published-skills-system-note.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isUserPublishedSkillAssignment","SYSTEM_NOTE_SKILL_NAME_LIMIT","SYSTEM_NOTE_SKILL_DESCRIPTION_LIMIT","truncateText","value","maxLength","normalized","replace","trim","length","slice","Math","max","trimEnd","SCOPE_LABELS","global","project","installable","buildSkillCatalogLine","skill","description","whenToUse","artifactDescription","skillName","skillSlug","scopeLabel","assignmentSource","contextKind","artifactName","buildPublishedSkillsSystemNote","workspace","directoryPath","catalog","details","_details","skillNames","skills","map","renderedSkillNames","join","remainingCount","renderedCountSuffix","globalSkills","filter","projectSkills","userSkills","slug","assignmentCounts","user","other","Boolean"],"sources":["../src/published-skills-system-note.ts"],"sourcesContent":["import {\n isUserPublishedSkillAssignment,\n type PublishedSkillsSuccessState,\n} from './published-skills-transform.js';\n\nconst SYSTEM_NOTE_SKILL_NAME_LIMIT = 10;\nconst SYSTEM_NOTE_SKILL_DESCRIPTION_LIMIT = 140;\n\nconst truncateText = (value: string, maxLength: number): string => {\n const normalized = value.replace(/\\s+/gu, ' ').trim();\n if (normalized.length <= maxLength) return normalized;\n return `${normalized.slice(0, Math.max(maxLength - 1, 0)).trimEnd()}…`;\n};\n\nconst SCOPE_LABELS: Record<PublishedSkillsSuccessState['skills'][number]['contextKind'], string> = {\n global: 'GLOBAL SCOPE',\n project: 'PROJECT SCOPE',\n installable: 'INSTALLABLE',\n};\n\nconst buildSkillCatalogLine = (skill: PublishedSkillsSuccessState['skills'][number]): string => {\n const description = truncateText(\n skill.whenToUse || skill.artifactDescription || skill.skillName || skill.skillSlug,\n SYSTEM_NOTE_SKILL_DESCRIPTION_LIMIT,\n );\n const scopeLabel = isUserPublishedSkillAssignment(skill.assignmentSource)\n ? 'USER SCOPE'\n : (SCOPE_LABELS[skill.contextKind] || 'PROJECT SCOPE');\n return `- ${skill.artifactName || skill.skillName} (${skill.skillSlug}, ${scopeLabel}): ${description}`;\n};\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 const globalSkills = catalog.skills\n .filter((skill) => skill.contextKind === 'global' && !isUserPublishedSkillAssignment(skill.assignmentSource))\n .slice(0, 8)\n .map(buildSkillCatalogLine);\n const projectSkills = catalog.skills\n .filter((skill) => skill.contextKind === 'project' && !isUserPublishedSkillAssignment(skill.assignmentSource))\n .slice(0, 5)\n .map(buildSkillCatalogLine);\n const userSkills = catalog.skills\n .filter((skill) => isUserPublishedSkillAssignment(skill.assignmentSource))\n .slice(0, 5)\n .map(buildSkillCatalogLine);\n\n return [\n workspace ? `Workspace: ${workspace.slug}.` : 'Workspace not found; workspace-scoped wizard skills are unavailable.',\n `Current directory: ${directoryPath}.`,\n `Active wizard skills: ${renderedSkillNames}${renderedCountSuffix}.`,\n `Counts: ${catalog.assignmentCounts.global} global, ${catalog.assignmentCounts.project} project, ${catalog.assignmentCounts.user} user, ${catalog.assignmentCounts.other} other.`,\n 'Wizard-listed skills are backend-published; fetch body via `opencode_wizard_published_skills_fetch` before use (`skills`/`skill` for multiple/single). If native skill loading fails for a wizard name, fetch it. Fetched wizard bodies are authoritative over local seed/native sources.',\n globalSkills.length > 0 ? `Global skills:\\n${globalSkills.join('\\n')}` : 'Global skills: none.',\n projectSkills.length > 0 ? `Project skills:\\n${projectSkills.join('\\n')}` : 'Project skills: none.',\n userSkills.length > 0 ? `User skills:\\n${userSkills.join('\\n')}` : 'User skills: none.',\n ]\n .filter(Boolean)\n .join(' ');\n};\n"],"mappings":"AAAA,SACEA,8BAA8B,QAEzB,iCAAiC;AAExC,MAAMC,4BAA4B,GAAG,EAAE;AACvC,MAAMC,mCAAmC,GAAG,GAAG;AAE/C,MAAMC,YAAY,GAAGA,CAACC,KAAa,EAAEC,SAAiB,KAAa;EACjE,MAAMC,UAAU,GAAGF,KAAK,CAACG,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAACC,IAAI,CAAC,CAAC;EACrD,IAAIF,UAAU,CAACG,MAAM,IAAIJ,SAAS,EAAE,OAAOC,UAAU;EACrD,OAAO,GAAGA,UAAU,CAACI,KAAK,CAAC,CAAC,EAAEC,IAAI,CAACC,GAAG,CAACP,SAAS,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAACQ,OAAO,CAAC,CAAC,GAAG;AACxE,CAAC;AAED,MAAMC,YAA0F,GAAG;EACjGC,MAAM,EAAE,cAAc;EACtBC,OAAO,EAAE,eAAe;EACxBC,WAAW,EAAE;AACf,CAAC;AAED,MAAMC,qBAAqB,GAAIC,KAAoD,IAAa;EAC9F,MAAMC,WAAW,GAAGjB,YAAY,CAC9BgB,KAAK,CAACE,SAAS,IAAIF,KAAK,CAACG,mBAAmB,IAAIH,KAAK,CAACI,SAAS,IAAIJ,KAAK,CAACK,SAAS,EAClFtB,mCACF,CAAC;EACD,MAAMuB,UAAU,GAAGzB,8BAA8B,CAACmB,KAAK,CAACO,gBAAgB,CAAC,GACrE,YAAY,GACXZ,YAAY,CAACK,KAAK,CAACQ,WAAW,CAAC,IAAI,eAAgB;EACxD,OAAO,KAAKR,KAAK,CAACS,YAAY,IAAIT,KAAK,CAACI,SAAS,KAAKJ,KAAK,CAACK,SAAS,KAAKC,UAAU,MAAML,WAAW,EAAE;AACzG,CAAC;AAED,OAAO,MAAMS,8BAA8B,GAAGA,CAAC;EAC7CC,SAAS;EACTC,aAAa;EACbC,OAAO;EACPC,OAAO,EAAEC;AAMX,CAAC,KAAa;EACZ,MAAMC,UAAU,GAAGH,OAAO,CAACI,MAAM,CAACC,GAAG,CAAElB,KAAK,IAAKA,KAAK,CAACS,YAAY,IAAIT,KAAK,CAACI,SAAS,IAAIJ,KAAK,CAACK,SAAS,CAAC;EAC1G,MAAMc,kBAAkB,GACtBH,UAAU,CAAC1B,MAAM,GAAG,CAAC,GAAG0B,UAAU,CAACzB,KAAK,CAAC,CAAC,EAAET,4BAA4B,CAAC,CAACsC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM;EAC/F,MAAMC,cAAc,GAAG7B,IAAI,CAACC,GAAG,CAACuB,UAAU,CAAC1B,MAAM,GAAGR,4BAA4B,EAAE,CAAC,CAAC;EACpF,MAAMwC,mBAAmB,GAAGD,cAAc,GAAG,CAAC,GAAG,MAAMA,cAAc,QAAQ,GAAG,EAAE;EAClF,MAAME,YAAY,GAAGV,OAAO,CAACI,MAAM,CAChCO,MAAM,CAAExB,KAAK,IAAKA,KAAK,CAACQ,WAAW,KAAK,QAAQ,IAAI,CAAC3B,8BAA8B,CAACmB,KAAK,CAACO,gBAAgB,CAAC,CAAC,CAC5GhB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACX2B,GAAG,CAACnB,qBAAqB,CAAC;EAC7B,MAAM0B,aAAa,GAAGZ,OAAO,CAACI,MAAM,CACjCO,MAAM,CAAExB,KAAK,IAAKA,KAAK,CAACQ,WAAW,KAAK,SAAS,IAAI,CAAC3B,8BAA8B,CAACmB,KAAK,CAACO,gBAAgB,CAAC,CAAC,CAC7GhB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACX2B,GAAG,CAACnB,qBAAqB,CAAC;EAC7B,MAAM2B,UAAU,GAAGb,OAAO,CAACI,MAAM,CAC9BO,MAAM,CAAExB,KAAK,IAAKnB,8BAA8B,CAACmB,KAAK,CAACO,gBAAgB,CAAC,CAAC,CACzEhB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACX2B,GAAG,CAACnB,qBAAqB,CAAC;EAE7B,OAAO,CACLY,SAAS,GAAG,cAAcA,SAAS,CAACgB,IAAI,GAAG,GAAG,sEAAsE,EACpH,sBAAsBf,aAAa,GAAG,EACtC,yBAAyBO,kBAAkB,GAAGG,mBAAmB,GAAG,EACpE,WAAWT,OAAO,CAACe,gBAAgB,CAAChC,MAAM,YAAYiB,OAAO,CAACe,gBAAgB,CAAC/B,OAAO,aAAagB,OAAO,CAACe,gBAAgB,CAACC,IAAI,UAAUhB,OAAO,CAACe,gBAAgB,CAACE,KAAK,SAAS,EACjL,2RAA2R,EAC3RP,YAAY,CAACjC,MAAM,GAAG,CAAC,GAAG,mBAAmBiC,YAAY,CAACH,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,sBAAsB,EAC/FK,aAAa,CAACnC,MAAM,GAAG,CAAC,GAAG,oBAAoBmC,aAAa,CAACL,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,uBAAuB,EACnGM,UAAU,CAACpC,MAAM,GAAG,CAAC,GAAG,iBAAiBoC,UAAU,CAACN,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,oBAAoB,CACxF,CACEI,MAAM,CAACO,OAAO,CAAC,CACfX,IAAI,CAAC,GAAG,CAAC;AACd,CAAC","ignoreList":[]}
@@ -0,0 +1,161 @@
1
+ type PublishedSkillFacetLike = {
2
+ slug: string;
3
+ label: string;
4
+ description?: string | null;
5
+ };
6
+ type PublishedSkillTagLike = {
7
+ slug: string;
8
+ label: string;
9
+ description?: string | null;
10
+ facet?: PublishedSkillFacetLike | null;
11
+ };
12
+ type PublishedSkillInstallPolicy = 'GLOBAL_CONTEXT' | 'PROJECT_INSTALLABLE';
13
+ type PublishedSkillCatalogItemLike = {
14
+ assignmentSource: string;
15
+ assignmentType: string;
16
+ scopePath: string;
17
+ includeChildren?: boolean | null;
18
+ skill: {
19
+ id: string;
20
+ slug: string;
21
+ name: string;
22
+ summary?: string | null;
23
+ whenToUse?: string | null;
24
+ status: string;
25
+ installPolicy: PublishedSkillInstallPolicy;
26
+ tags: PublishedSkillTagLike[];
27
+ };
28
+ skillVersion: {
29
+ id: string;
30
+ version: string;
31
+ title?: string | null;
32
+ summary?: string | null;
33
+ status: string;
34
+ };
35
+ publishedArtifact: {
36
+ id: string;
37
+ frontmatterName: string;
38
+ frontmatterDescription: string;
39
+ checksum: string;
40
+ publishedAt: string;
41
+ fileCount: number;
42
+ };
43
+ };
44
+ type PublishedSkillArtifactFileLike = {
45
+ id: string;
46
+ relativePath: string;
47
+ contentType: string;
48
+ content: string;
49
+ checksum: string;
50
+ size: number;
51
+ sortOrder: number;
52
+ };
53
+ type PublishedSkillDetailItemLike = PublishedSkillCatalogItemLike & {
54
+ publishedArtifact: PublishedSkillCatalogItemLike['publishedArtifact'] & {
55
+ markdownBody: string;
56
+ renderedContent: string;
57
+ files: PublishedSkillArtifactFileLike[];
58
+ };
59
+ };
60
+ type PublishedSkillInstallableCatalogItemLike = Pick<PublishedSkillCatalogItemLike, 'skill' | 'skillVersion' | 'publishedArtifact'>;
61
+ type PublishedSkillCatalogPayloadLike<TItem extends PublishedSkillCatalogItemLike = PublishedSkillCatalogItemLike> = {
62
+ workspace: {
63
+ id: string;
64
+ slug: string;
65
+ name: string;
66
+ repositoryUrl?: string | null;
67
+ defaultBranch?: string | null;
68
+ status: string;
69
+ } | null;
70
+ directoryPath: string;
71
+ skills: TItem[];
72
+ catalogSkills: PublishedSkillInstallableCatalogItemLike[];
73
+ userPreferences: {
74
+ scopeKey: string;
75
+ userKey: string;
76
+ ignoredSkills: PublishedSkillCatalogItemLike[];
77
+ };
78
+ };
79
+ export type PublishedSkillFacetSummary = {
80
+ slug: string;
81
+ label: string;
82
+ description: string | null;
83
+ };
84
+ export type PublishedSkillTagSummary = {
85
+ slug: string;
86
+ label: string;
87
+ description: string | null;
88
+ facet: PublishedSkillFacetSummary | null;
89
+ };
90
+ export type PublishedSkillSummary = {
91
+ skillSlug: string;
92
+ skillName: string;
93
+ artifactName: string;
94
+ artifactDescription: string;
95
+ whenToUse: string | null;
96
+ version: string;
97
+ assignmentSource: string;
98
+ assignmentType: string;
99
+ scopePath: string;
100
+ includeChildren: boolean | null;
101
+ checksum: string;
102
+ publishedAt: string;
103
+ fileCount: number;
104
+ identifiers: string[];
105
+ tags: PublishedSkillTagSummary[];
106
+ contextKind: 'global' | 'project' | 'installable';
107
+ installPolicy: PublishedSkillInstallPolicy;
108
+ assignmentLabel: string;
109
+ policyLabel: string;
110
+ };
111
+ export type PublishedSkillDetail = PublishedSkillSummary & {
112
+ skillId: string;
113
+ skillVersionId: string;
114
+ artifactId: string;
115
+ markdownDocument: string;
116
+ markdownBody: string;
117
+ renderedContent: string;
118
+ files: PublishedSkillArtifactFileLike[];
119
+ resources: PublishedSkillArtifactFileLike[];
120
+ };
121
+ export type PublishedSkillsSuccessState = {
122
+ pluginId: string;
123
+ runtimeMode: 'tool_fetch_only';
124
+ deliveryModel: 'backend_published_installed_effective_skills';
125
+ workspace: PublishedSkillCatalogPayloadLike['workspace'];
126
+ directoryPath: string;
127
+ rootSkillSeedPath: string;
128
+ availableTools: string[];
129
+ publishedSkillCount: number;
130
+ assignmentCounts: {
131
+ global: number;
132
+ project: number;
133
+ user: number;
134
+ other: number;
135
+ };
136
+ facets: PublishedSkillFacetSummary[];
137
+ skills: PublishedSkillSummary[];
138
+ };
139
+ type PublishedSkillCatalogOptions = {
140
+ pluginId: string;
141
+ rootSkillSeedPath: string;
142
+ availableTools: string[];
143
+ };
144
+ export declare const formatSkillLabel: (item: PublishedSkillCatalogItemLike) => string;
145
+ export declare const buildSkillMarkdown: (item: PublishedSkillDetailItemLike) => string;
146
+ export declare const isUserPublishedSkillAssignment: (assignmentSource: string) => boolean;
147
+ export declare const toPublishedSkillSummary: (item: PublishedSkillCatalogItemLike) => PublishedSkillSummary;
148
+ export declare const toPublishedSkillDetail: (item: PublishedSkillDetailItemLike) => PublishedSkillDetail;
149
+ export declare const toInstallableSkillSummary: (item: PublishedSkillInstallableCatalogItemLike) => PublishedSkillSummary;
150
+ export declare const toPublishedSkillCatalog: (payload: PublishedSkillCatalogPayloadLike, options: PublishedSkillCatalogOptions) => PublishedSkillsSuccessState;
151
+ export declare const parseRequestedSkillArgs: (args: {
152
+ skill?: string;
153
+ skills?: string;
154
+ }) => string[];
155
+ export declare const selectPublishedSkills: <TItem extends PublishedSkillCatalogItemLike>(payload: Omit<PublishedSkillCatalogPayloadLike<TItem>, "skills"> & {
156
+ skills: TItem[];
157
+ }, identifiers: string[]) => {
158
+ selectedItems: TItem[];
159
+ missingIdentifiers: string[];
160
+ };
161
+ export {};