@aexol/opencode-wizard 0.3.10 → 0.3.13

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 (40) hide show
  1. package/README.md +4 -1
  2. package/dist/graphql-operations.d.ts +5 -4
  3. package/dist/graphql-operations.js +27 -2
  4. package/dist/graphql-operations.js.map +1 -1
  5. package/dist/plugin-tools.d.ts +3 -0
  6. package/dist/plugin-tools.js +12 -9
  7. package/dist/plugin-tools.js.map +1 -1
  8. package/dist/published-skills-system-note.js +1 -1
  9. package/dist/published-skills-system-note.js.map +1 -1
  10. package/dist/published-skills-transform.d.ts +22 -4
  11. package/dist/published-skills-transform.js +21 -5
  12. package/dist/published-skills-transform.js.map +1 -1
  13. package/dist/server/client.d.ts +11 -4
  14. package/dist/server/client.js +89 -6
  15. package/dist/server/client.js.map +1 -1
  16. package/dist/server/preferences.js +2 -1
  17. package/dist/server/preferences.js.map +1 -1
  18. package/dist/server/runtime.d.ts +1 -1
  19. package/dist/server/runtime.js +178 -27
  20. package/dist/server/runtime.js.map +1 -1
  21. package/dist/server/status.js +6 -2
  22. package/dist/server/status.js.map +1 -1
  23. package/dist/server/types.d.ts +17 -4
  24. package/dist/server/types.js.map +1 -1
  25. package/dist/smoke-published-skills.js +6 -3
  26. package/dist/smoke-published-skills.js.map +1 -1
  27. package/dist/tui/components/skill-picker-dialog.d.ts +7 -0
  28. package/dist/tui/components/skill-picker-dialog.js +94 -0
  29. package/dist/tui/components/skill-picker-dialog.js.map +1 -0
  30. package/dist/tui/components/status-content.d.ts +4 -0
  31. package/dist/tui/components/status-content.js +145 -20
  32. package/dist/tui/components/status-content.js.map +1 -1
  33. package/dist/tui/plugin.js +36 -69
  34. package/dist/tui/plugin.js.map +1 -1
  35. package/dist/tui/skill-helpers.d.ts +15 -2
  36. package/dist/tui/skill-helpers.js +82 -20
  37. package/dist/tui/skill-helpers.js.map +1 -1
  38. package/dist/tui/slots.js +13 -3
  39. package/dist/tui/slots.js.map +1 -1
  40. package/package.json +2 -2
@@ -7,7 +7,7 @@ import { setProp as _$setProp } from "@opentui/solid";
7
7
  import { createElement as _$createElement } from "@opentui/solid";
8
8
  import { createMemo } from 'solid-js';
9
9
  import { compactStatusMessage, formatAuthStatus, formatBackendOriginLabel, formatSkillsCatalogUnavailableMessage } from '../formatting.js';
10
- import { getInstallableNotInstalledSkills, getUserRoleRow } from '../skill-helpers.js';
10
+ import { getSkillCatalogSummary, getSkillListRows, getUserRoleRow } from '../skill-helpers.js';
11
11
  import { Row } from './common.js';
12
12
  export const StatusContent = props => {
13
13
  if (props.status.kind === 'loading') {
@@ -61,6 +61,131 @@ export const SkillsRows = props => {
61
61
  return _el$5;
62
62
  })();
63
63
  };
64
+ export const SidebarSkillsRows = props => {
65
+ const theme = createMemo(() => props.api.theme.current);
66
+ const currentStatus = () => props.status();
67
+ const content = () => {
68
+ const status = currentStatus();
69
+ if (status.kind === 'loading') {
70
+ return (() => {
71
+ var _el$6 = _$createElement("text");
72
+ _$insertNode(_el$6, _$createTextNode(`skills loading…`));
73
+ _$setProp(_el$6, "wrapMode", "none");
74
+ _$setProp(_el$6, "overflow", "hidden");
75
+ _$effect(_$p => _$setProp(_el$6, "fg", theme().textMuted, _$p));
76
+ return _el$6;
77
+ })();
78
+ }
79
+ if (status.kind === 'error') {
80
+ return (() => {
81
+ var _el$8 = _$createElement("text"),
82
+ _el$9 = _$createTextNode(`skills unavailable: `);
83
+ _$insertNode(_el$8, _el$9);
84
+ _$setProp(_el$8, "wrapMode", "none");
85
+ _$setProp(_el$8, "overflow", "hidden");
86
+ _$insert(_el$8, () => compactStatusMessage(status.message), null);
87
+ _$effect(_$p => _$setProp(_el$8, "fg", theme().warning, _$p));
88
+ return _el$8;
89
+ })();
90
+ }
91
+ return _$createComponent(ReadySidebarSkillRows, {
92
+ get snapshot() {
93
+ return status.snapshot;
94
+ },
95
+ get theme() {
96
+ return theme();
97
+ },
98
+ get canOpenPicker() {
99
+ return Boolean((props.api.command?.register || props.api.commands?.register) && props.api.ui?.dialog?.replace);
100
+ }
101
+ });
102
+ };
103
+ return (() => {
104
+ var _el$0 = _$createElement("box");
105
+ _$setProp(_el$0, "width", "100%");
106
+ _$setProp(_el$0, "flexDirection", "column");
107
+ _$setProp(_el$0, "overflow", "hidden");
108
+ _$insert(_el$0, content);
109
+ return _el$0;
110
+ })();
111
+ };
112
+ const ReadySidebarSkillRows = props => {
113
+ if (!props.snapshot.catalog) {
114
+ return (() => {
115
+ var _el$1 = _$createElement("text"),
116
+ _el$10 = _$createTextNode(`skills unavailable: `);
117
+ _$insertNode(_el$1, _el$10);
118
+ _$setProp(_el$1, "wrapMode", "none");
119
+ _$setProp(_el$1, "overflow", "hidden");
120
+ _$insert(_el$1, () => formatSkillsCatalogUnavailableMessage(props.snapshot), null);
121
+ _$effect(_$p => _$setProp(_el$1, "fg", props.theme.textMuted, _$p));
122
+ return _el$1;
123
+ })();
124
+ }
125
+ const skillRows = getSkillListRows(props.snapshot, {
126
+ canOpenPicker: props.canOpenPicker
127
+ });
128
+ if (skillRows.length === 0) {
129
+ return (() => {
130
+ var _el$11 = _$createElement("box"),
131
+ _el$12 = _$createElement("text");
132
+ _$insertNode(_el$11, _el$12);
133
+ _$setProp(_el$11, "width", "100%");
134
+ _$setProp(_el$11, "flexDirection", "column");
135
+ _$setProp(_el$11, "overflow", "hidden");
136
+ _$insert(_el$11, _$createComponent(Row, {
137
+ label: "skills",
138
+ get value() {
139
+ return getSkillCatalogSummary(props.snapshot);
140
+ },
141
+ get labelColor() {
142
+ return props.theme.textMuted;
143
+ },
144
+ get valueColor() {
145
+ return props.theme.text;
146
+ }
147
+ }), _el$12);
148
+ _$insertNode(_el$12, _$createTextNode(`no skills listed`));
149
+ _$setProp(_el$12, "wrapMode", "none");
150
+ _$setProp(_el$12, "overflow", "hidden");
151
+ _$effect(_$p => _$setProp(_el$12, "fg", props.theme.textMuted, _$p));
152
+ return _el$11;
153
+ })();
154
+ }
155
+ return (() => {
156
+ var _el$14 = _$createElement("box");
157
+ _$setProp(_el$14, "width", "100%");
158
+ _$setProp(_el$14, "flexDirection", "column");
159
+ _$setProp(_el$14, "overflow", "hidden");
160
+ _$insert(_el$14, _$createComponent(Row, {
161
+ label: "skills",
162
+ get value() {
163
+ return getSkillCatalogSummary(props.snapshot);
164
+ },
165
+ get labelColor() {
166
+ return props.theme.textMuted;
167
+ },
168
+ get valueColor() {
169
+ return props.theme.text;
170
+ }
171
+ }), null);
172
+ _$insert(_el$14, () => skillRows.map(row => _$createComponent(Row, {
173
+ get label() {
174
+ return row.label;
175
+ },
176
+ get value() {
177
+ return row.value;
178
+ },
179
+ get labelColor() {
180
+ return props.theme.textMuted;
181
+ },
182
+ get valueColor() {
183
+ return props.theme.text;
184
+ }
185
+ })), null);
186
+ return _el$14;
187
+ })();
188
+ };
64
189
  export const ReadyRows = props => {
65
190
  const roleRow = getUserRoleRow(props.snapshot);
66
191
  const statusRows = [_$createComponent(Row, {
@@ -88,12 +213,12 @@ export const ReadyRows = props => {
88
213
  })];
89
214
  if (!props.snapshot.catalog) {
90
215
  return (() => {
91
- var _el$6 = _$createElement("box");
92
- _$setProp(_el$6, "width", "100%");
93
- _$setProp(_el$6, "flexDirection", "column");
94
- _$setProp(_el$6, "overflow", "hidden");
95
- _$insert(_el$6, statusRows, null);
96
- _$insert(_el$6, _$createComponent(Row, {
216
+ var _el$15 = _$createElement("box");
217
+ _$setProp(_el$15, "width", "100%");
218
+ _$setProp(_el$15, "flexDirection", "column");
219
+ _$setProp(_el$15, "overflow", "hidden");
220
+ _$insert(_el$15, statusRows, null);
221
+ _$insert(_el$15, _$createComponent(Row, {
97
222
  label: "catalog",
98
223
  get value() {
99
224
  return formatSkillsCatalogUnavailableMessage(props.snapshot);
@@ -105,7 +230,7 @@ export const ReadyRows = props => {
105
230
  return props.theme.text;
106
231
  }
107
232
  }), null);
108
- _$insert(_el$6, _$createComponent(Row, {
233
+ _$insert(_el$15, _$createComponent(Row, {
109
234
  get label() {
110
235
  return roleRow.label;
111
236
  },
@@ -119,20 +244,20 @@ export const ReadyRows = props => {
119
244
  return props.theme.text;
120
245
  }
121
246
  }), null);
122
- return _el$6;
247
+ return _el$15;
123
248
  })();
124
249
  }
125
- const installableNotInstalledCount = getInstallableNotInstalledSkills(props.snapshot).length;
126
- const catalogStatus = `${props.snapshot.catalog.publishedSkillCount} loaded · ${installableNotInstalledCount} installable`;
127
250
  return (() => {
128
- var _el$7 = _$createElement("box");
129
- _$setProp(_el$7, "width", "100%");
130
- _$setProp(_el$7, "flexDirection", "column");
131
- _$setProp(_el$7, "overflow", "hidden");
132
- _$insert(_el$7, statusRows, null);
133
- _$insert(_el$7, _$createComponent(Row, {
251
+ var _el$16 = _$createElement("box");
252
+ _$setProp(_el$16, "width", "100%");
253
+ _$setProp(_el$16, "flexDirection", "column");
254
+ _$setProp(_el$16, "overflow", "hidden");
255
+ _$insert(_el$16, statusRows, null);
256
+ _$insert(_el$16, _$createComponent(Row, {
134
257
  label: "catalog",
135
- value: catalogStatus,
258
+ get value() {
259
+ return getSkillCatalogSummary(props.snapshot);
260
+ },
136
261
  get labelColor() {
137
262
  return props.theme.textMuted;
138
263
  },
@@ -140,7 +265,7 @@ export const ReadyRows = props => {
140
265
  return props.theme.text;
141
266
  }
142
267
  }), null);
143
- _$insert(_el$7, _$createComponent(Row, {
268
+ _$insert(_el$16, _$createComponent(Row, {
144
269
  get label() {
145
270
  return roleRow.label;
146
271
  },
@@ -154,7 +279,7 @@ export const ReadyRows = props => {
154
279
  return props.theme.text;
155
280
  }
156
281
  }), null);
157
- return _el$7;
282
+ return _el$16;
158
283
  })();
159
284
  };
160
285
  //# sourceMappingURL=status-content.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createMemo","compactStatusMessage","formatAuthStatus","formatBackendOriginLabel","formatSkillsCatalogUnavailableMessage","getInstallableNotInstalledSkills","getUserRoleRow","Row","StatusContent","props","status","kind","_el$","_$createElement","_$insertNode","_$createTextNode","_$setProp","_$effect","_$p","theme","textMuted","_el$3","_el$4","_$insert","message","warning","_$createComponent","ReadyRows","snapshot","SkillsRows","api","current","statusContent","currentStatus","_el$5","roleRow","statusRows","label","value","backendOrigin","labelColor","valueColor","text","catalog","_el$6","installableNotInstalledCount","length","catalogStatus","publishedSkillCount","_el$7"],"sources":["../../../src/tui/components/status-content.tsx"],"sourcesContent":["import { createMemo } from 'solid-js';\nimport type { PluginStatusSnapshot } from '../../server.js';\nimport { compactStatusMessage, formatAuthStatus, formatBackendOriginLabel, formatSkillsCatalogUnavailableMessage } from '../formatting.js';\nimport { getInstallableNotInstalledSkills, getUserRoleRow } from '../skill-helpers.js';\nimport type { StatusState, TuiPluginApi } from '../types.js';\nimport { Row } from './common.js';\n\nexport const StatusContent = (props: { status: StatusState; theme: TuiPluginApi['theme']['current'] }) => {\n if (props.status.kind === 'loading') {\n return (\n <text fg={props.theme.textMuted} wrapMode=\"none\" overflow=\"hidden\">\n loading…\n </text>\n );\n }\n\n if (props.status.kind === 'error') {\n return (\n <text fg={props.theme.warning} wrapMode=\"none\" overflow=\"hidden\">\n unavailable: {compactStatusMessage(props.status.message)}\n </text>\n );\n }\n\n return <ReadyRows snapshot={props.status.snapshot} theme={props.theme} />;\n};\n\nexport const SkillsRows = (props: { api: TuiPluginApi; status: () => StatusState }) => {\n const theme = createMemo(() => props.api.theme.current);\n const statusContent = () => {\n const currentStatus = props.status();\n\n return <StatusContent status={currentStatus} theme={theme()} />;\n };\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusContent()}\n </box>\n );\n};\n\nexport const ReadyRows = (props: { snapshot: PluginStatusSnapshot; theme: TuiPluginApi['theme']['current'] }) => {\n const roleRow = getUserRoleRow(props.snapshot);\n const statusRows = (\n <>\n <Row\n label=\"url\"\n value={formatBackendOriginLabel(props.snapshot.backendOrigin)}\n labelColor={props.theme.textMuted}\n valueColor={props.theme.text}\n />\n <Row label=\"auth\" value={formatAuthStatus(props.snapshot)} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </>\n );\n\n if (!props.snapshot.catalog) {\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusRows}\n <Row\n label=\"catalog\"\n value={formatSkillsCatalogUnavailableMessage(props.snapshot)}\n labelColor={props.theme.textMuted}\n valueColor={props.theme.text}\n />\n <Row label={roleRow.label} value={roleRow.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </box>\n );\n }\n\n const installableNotInstalledCount = getInstallableNotInstalledSkills(props.snapshot).length;\n const catalogStatus = `${props.snapshot.catalog.publishedSkillCount} loaded · ${installableNotInstalledCount} installable`;\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusRows}\n <Row label=\"catalog\" value={catalogStatus} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n <Row label={roleRow.label} value={roleRow.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </box>\n );\n};\n"],"mappings":";;;;;;;AAAA,SAASA,UAAU,QAAQ,UAAU;AAErC,SAASC,oBAAoB,EAAEC,gBAAgB,EAAEC,wBAAwB,EAAEC,qCAAqC,QAAQ,kBAAkB;AAC1I,SAASC,gCAAgC,EAAEC,cAAc,QAAQ,qBAAqB;AAEtF,SAASC,GAAG,QAAQ,aAAa;AAEjC,OAAO,MAAMC,aAAa,GAAIC,KAAuE,IAAK;EACxG,IAAIA,KAAK,CAACC,MAAM,CAACC,IAAI,KAAK,SAAS,EAAE;IACnC;MAAA,IAAAC,IAAA,GAAAC,eAAA;MAAAC,YAAA,CAAAF,IAAA,EAAAG,gBAAA;MAAAC,SAAA,CAAAJ,IAAA,cAC4C,MAAM;MAAAI,SAAA,CAAAJ,IAAA,cAAU,QAAQ;MAAAK,QAAA,CAAAC,GAAA,IAAAF,SAAA,CAAAJ,IAAA,QAAxDH,KAAK,CAACU,KAAK,CAACC,SAAS,EAAAF,GAAA;MAAA,OAAAN,IAAA;IAAA;EAInC;EAEA,IAAIH,KAAK,CA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C8B,KAAKA,CAAA;QAAA,OAAEF,OAAO,CAACE,KAAK;MAAA;MAAA,IAAEC,KAAKA,CAAA;QAAA,OAAEH,OAAO,CAACG,KAAK;MAAA;MAAA,IAAEE,UAAUA,CAAA;QAAA,OAAE/B,KAAK,CAACU,KAAK,CAACC,SAAS;MAAA;MAAA,IAAEqB,UAAUA,CAAA;QAAA,OAAEhC,KAAK,CAACU,KAAK,CAACuB,IAAI;MAAA;IAAA;IAAA,OAAAO,KAAA;EAAA;AAGtH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createMemo","compactStatusMessage","formatAuthStatus","formatBackendOriginLabel","formatSkillsCatalogUnavailableMessage","getSkillCatalogSummary","getSkillListRows","getUserRoleRow","Row","StatusContent","props","status","kind","_el$","_$createElement","_$insertNode","_$createTextNode","_$setProp","_$effect","_$p","theme","textMuted","_el$3","_el$4","_$insert","message","warning","_$createComponent","ReadyRows","snapshot","SkillsRows","api","current","statusContent","currentStatus","_el$5","SidebarSkillsRows","content","_el$6","_el$8","_el$9","ReadySidebarSkillRows","canOpenPicker","Boolean","command","register","commands","ui","dialog","replace","_el$0","catalog","_el$1","_el$10","skillRows","length","_el$11","_el$12","label","value","labelColor","valueColor","text","_el$14","map","row","roleRow","statusRows","backendOrigin","_el$15","_el$16"],"sources":["../../../src/tui/components/status-content.tsx"],"sourcesContent":["import { createMemo } from 'solid-js';\nimport type { PluginStatusSnapshot } from '../../server.js';\nimport { compactStatusMessage, formatAuthStatus, formatBackendOriginLabel, formatSkillsCatalogUnavailableMessage } from '../formatting.js';\nimport { getSkillCatalogSummary, getSkillListRows, getUserRoleRow } from '../skill-helpers.js';\nimport type { StatusState, TuiPluginApi } from '../types.js';\nimport { Row } from './common.js';\n\nexport const StatusContent = (props: { status: StatusState; theme: TuiPluginApi['theme']['current'] }) => {\n if (props.status.kind === 'loading') {\n return (\n <text fg={props.theme.textMuted} wrapMode=\"none\" overflow=\"hidden\">\n loading…\n </text>\n );\n }\n\n if (props.status.kind === 'error') {\n return (\n <text fg={props.theme.warning} wrapMode=\"none\" overflow=\"hidden\">\n unavailable: {compactStatusMessage(props.status.message)}\n </text>\n );\n }\n\n return <ReadyRows snapshot={props.status.snapshot} theme={props.theme} />;\n};\n\nexport const SkillsRows = (props: { api: TuiPluginApi; status: () => StatusState }) => {\n const theme = createMemo(() => props.api.theme.current);\n const statusContent = () => {\n const currentStatus = props.status();\n\n return <StatusContent status={currentStatus} theme={theme()} />;\n };\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusContent()}\n </box>\n );\n};\n\nexport const SidebarSkillsRows = (props: { api: TuiPluginApi; status: () => StatusState }) => {\n const theme = createMemo(() => props.api.theme.current);\n const currentStatus = () => props.status();\n\n const content = () => {\n const status = currentStatus();\n if (status.kind === 'loading') {\n return (\n <text fg={theme().textMuted} wrapMode=\"none\" overflow=\"hidden\">\n skills loading…\n </text>\n );\n }\n\n if (status.kind === 'error') {\n return (\n <text fg={theme().warning} wrapMode=\"none\" overflow=\"hidden\">\n skills unavailable: {compactStatusMessage(status.message)}\n </text>\n );\n }\n\n return (\n <ReadySidebarSkillRows\n snapshot={status.snapshot}\n theme={theme()}\n canOpenPicker={Boolean((props.api.command?.register || props.api.commands?.register) && props.api.ui?.dialog?.replace)}\n />\n );\n };\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {content()}\n </box>\n );\n};\n\nconst ReadySidebarSkillRows = (props: {\n snapshot: PluginStatusSnapshot;\n theme: TuiPluginApi['theme']['current'];\n canOpenPicker: boolean;\n}) => {\n if (!props.snapshot.catalog) {\n return (\n <text fg={props.theme.textMuted} wrapMode=\"none\" overflow=\"hidden\">\n skills unavailable: {formatSkillsCatalogUnavailableMessage(props.snapshot)}\n </text>\n );\n }\n\n const skillRows = getSkillListRows(props.snapshot, { canOpenPicker: props.canOpenPicker });\n if (skillRows.length === 0) {\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n <Row label=\"skills\" value={getSkillCatalogSummary(props.snapshot)} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n <text fg={props.theme.textMuted} wrapMode=\"none\" overflow=\"hidden\">\n no skills listed\n </text>\n </box>\n );\n }\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n <Row label=\"skills\" value={getSkillCatalogSummary(props.snapshot)} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n {skillRows.map((row) => (\n <Row label={row.label} value={row.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n ))}\n </box>\n );\n};\n\nexport const ReadyRows = (props: { snapshot: PluginStatusSnapshot; theme: TuiPluginApi['theme']['current'] }) => {\n const roleRow = getUserRoleRow(props.snapshot);\n const statusRows = (\n <>\n <Row\n label=\"url\"\n value={formatBackendOriginLabel(props.snapshot.backendOrigin)}\n labelColor={props.theme.textMuted}\n valueColor={props.theme.text}\n />\n <Row label=\"auth\" value={formatAuthStatus(props.snapshot)} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </>\n );\n\n if (!props.snapshot.catalog) {\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusRows}\n <Row\n label=\"catalog\"\n value={formatSkillsCatalogUnavailableMessage(props.snapshot)}\n labelColor={props.theme.textMuted}\n valueColor={props.theme.text}\n />\n <Row label={roleRow.label} value={roleRow.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </box>\n );\n }\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusRows}\n <Row label=\"catalog\" value={getSkillCatalogSummary(props.snapshot)} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n <Row label={roleRow.label} value={roleRow.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </box>\n );\n};\n"],"mappings":";;;;;;;AAAA,SAASA,UAAU,QAAQ,UAAU;AAErC,SAASC,oBAAoB,EAAEC,gBAAgB,EAAEC,wBAAwB,EAAEC,qCAAqC,QAAQ,kBAA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OAAAQ,MAAA;EAAA;AAGtH,CAAC","ignoreList":[]}
@@ -1,10 +1,11 @@
1
1
  import { createSignal } from 'solid-js';
2
2
  import { STATUS_REFRESH_INTERVAL_MS } from './constants.js';
3
+ import { SkillPickerDialog } from './components/skill-picker-dialog.js';
3
4
  import { requestRender } from './rendering.js';
5
+ import { getSkillPickerCommands } from './skill-helpers.js';
4
6
  import { createWizardStatusSlot } from './slots.js';
5
7
  import { loadStatus } from './status.js';
6
- const registerCommandActions = (api, actions) => {
7
- const commandProvider = () => actions;
8
+ const registerCommandActions = (api, commandProvider) => {
8
9
  if (api.command?.register) {
9
10
  return {
10
11
  unregister: api.command.register(commandProvider) ?? null
@@ -17,7 +18,18 @@ const registerCommandActions = (api, actions) => {
17
18
  }
18
19
  return null;
19
20
  };
20
- const createSharedSkillActions = refreshStatus => [{
21
+ const canOpenSkillPicker = api => Boolean(api.ui?.dialog?.replace);
22
+ const openSkillPickerDialog = (api, snapshot, row) => {
23
+ if (!api.ui?.dialog?.replace) return;
24
+ api.ui.dialog.setSize?.('large');
25
+ api.ui.dialog.replace(() => SkillPickerDialog({
26
+ snapshot,
27
+ theme: api.theme.current,
28
+ selectedSkillSlug: row?.skillSlug
29
+ }), () => requestRender(api));
30
+ requestRender(api);
31
+ };
32
+ const createSharedSkillActions = (api, refreshStatus, status) => [{
21
33
  value: 'opencode-wizard.status',
22
34
  title: 'Wizard: status',
23
35
  description: 'Refresh plugin auth, backend, catalog, source, and workspace-resolution status via opencode_wizard_status.',
@@ -28,73 +40,33 @@ const createSharedSkillActions = refreshStatus => [{
28
40
  onSelect: () => refreshStatus({
29
41
  showLoading: true
30
42
  })
31
- }, {
32
- value: 'opencode-wizard.fetch-published-skill',
33
- title: 'Wizard: fetch published skill',
34
- description: 'Fetch wizard-listed skill bodies/details with opencode_wizard_published_skills_fetch; pass refresh: true for fresh backend data.',
35
- category: 'Wizard',
36
- slash: {
37
- name: 'wizard-fetch-skill'
38
- },
39
- onSelect: () => refreshStatus({
40
- showLoading: true
41
- })
42
- }, {
43
- value: 'opencode-wizard.manage-skill-preference',
44
- title: 'Wizard: manage skill preference',
45
- description: 'Use opencode_wizard_published_skill_preference_set to install, uninstall, ignore, or unignore a published skill for project/global scope.',
46
- category: 'Wizard',
47
- slash: {
48
- name: 'wizard-manage-skill'
49
- },
50
- onSelect: () => refreshStatus({
51
- showLoading: true
52
- })
53
- }];
54
- const createEditorSkillActions = refreshStatus => [{
55
- value: 'opencode-wizard.editor.create-or-update-skill',
56
- title: 'Wizard: create/update skill from markdown',
57
- description: 'Canonical EDITOR flow: call opencode_wizard_editor_create_or_update_skill with complete SKILL.md markdownContent; no local seed file required.',
58
- category: 'Wizard',
59
- slash: {
60
- name: 'wizard-create-skill'
61
- },
62
- onSelect: () => refreshStatus({
63
- showLoading: true
64
- })
65
- }, {
66
- value: 'opencode-wizard.editor.import-artifact',
67
- title: 'Wizard: import external artifact',
68
- description: 'External source flow: call opencode_wizard_artifact_import for SKILL or DESIGN_DOC URLs/command-like sources; no project files are written.',
43
+ }, ...(canOpenSkillPicker(api) ? [{
44
+ value: 'opencode-wizard.skills',
45
+ title: 'Wizard: skills catalog',
46
+ description: 'Open a read-only wizard skill catalog. Use tools for fetch/install/ignore actions.',
69
47
  category: 'Wizard',
70
48
  slash: {
71
- name: 'wizard-import-artifact'
49
+ name: 'wizard-skills'
72
50
  },
73
- onSelect: () => refreshStatus({
74
- showLoading: true
75
- })
76
- }, {
77
- value: 'opencode-wizard.editor.publish-seed-skill',
78
- title: 'Wizard: publish local seed skill',
79
- description: 'Legacy seed flow: call opencode_wizard_editor_publish_skill for .opencode/skills/<slug>/SKILL.md when a local seed already exists.',
80
- category: 'Wizard',
81
- slash: {
82
- name: 'wizard-publish-seed'
83
- },
84
- onSelect: () => refreshStatus({
85
- showLoading: true
86
- })
87
- }];
88
- const registerSkillActions = (api, refreshStatus, mode) => {
89
- const sharedActions = createSharedSkillActions(refreshStatus);
90
- const actions = mode === 'editor' ? [...sharedActions, ...createEditorSkillActions(refreshStatus)] : sharedActions;
91
- return registerCommandActions(api, actions);
51
+ onSelect: () => {
52
+ const currentStatus = status();
53
+ if (currentStatus.kind !== 'ready') return;
54
+ openSkillPickerDialog(api, currentStatus.snapshot);
55
+ }
56
+ }] : [])];
57
+ const registerSkillActions = (api, refreshStatus, status) => {
58
+ const sharedActions = createSharedSkillActions(api, refreshStatus, status);
59
+ return registerCommandActions(api, () => {
60
+ const currentStatus = status();
61
+ if (currentStatus.kind !== 'ready') return sharedActions;
62
+ if (!canOpenSkillPicker(api)) return sharedActions;
63
+ return [...sharedActions, ...getSkillPickerCommands(currentStatus.snapshot, row => openSkillPickerDialog(api, currentStatus.snapshot, row))];
64
+ });
92
65
  };
93
66
  export const tui = async api => {
94
67
  const [status, setStatus] = createSignal({
95
68
  kind: 'loading'
96
69
  });
97
- let registeredActionMode = null;
98
70
  let commandRegistration = null;
99
71
  const refreshStatus = options => {
100
72
  if (options?.showLoading) {
@@ -105,13 +77,8 @@ export const tui = async api => {
105
77
  }
106
78
  void loadStatus(api).then(nextStatus => {
107
79
  setStatus(nextStatus);
108
- if (nextStatus.kind === 'ready') {
109
- const nextMode = nextStatus.snapshot.availableTools.includes('opencode_wizard_editor_create_or_update_skill') ? 'editor' : 'shared';
110
- if (registeredActionMode !== nextMode) {
111
- commandRegistration?.unregister?.();
112
- commandRegistration = registerSkillActions(api, refreshStatus, nextMode);
113
- registeredActionMode = commandRegistration ? nextMode : null;
114
- }
80
+ if (!commandRegistration) {
81
+ commandRegistration = registerSkillActions(api, refreshStatus, status);
115
82
  }
116
83
  requestRender(api);
117
84
  });
@@ -1 +1 @@
1
- {"version":3,"names":["createSignal","STATUS_REFRESH_INTERVAL_MS","requestRender","createWizardStatusSlot","loadStatus","registerCommandActions","api","actions","commandProvider","command","register","unregister","commands","createSharedSkillActions","refreshStatus","value","title","description","category","slash","name","onSelect","showLoading","createEditorSkillActions","registerSkillActions","mode","sharedActions","tui","status","setStatus","kind","registeredActionMode","commandRegistration","options","then","nextStatus","nextMode","snapshot","availableTools","includes","slots","setInterval"],"sources":["../../src/tui/plugin.ts"],"sourcesContent":["import { createSignal } from 'solid-js';\nimport { STATUS_REFRESH_INTERVAL_MS } from './constants.js';\nimport { requestRender } from './rendering.js';\nimport { createWizardStatusSlot } from './slots.js';\nimport { loadStatus } from './status.js';\nimport type { RefreshStatus, StatusState, TuiCommand, TuiPlugin, TuiPluginApi } from './types.js';\n\ntype RegisteredActionMode = 'shared' | 'editor';\ntype CommandRegistration = {\n unregister: (() => void) | null;\n};\n\nconst registerCommandActions = (api: TuiPluginApi, actions: TuiCommand[]): CommandRegistration | null => {\n const commandProvider = () => actions;\n\n if (api.command?.register) {\n return { unregister: api.command.register(commandProvider) ?? null };\n }\n\n if (api.commands?.register) {\n return { unregister: api.commands.register(commandProvider) ?? null };\n }\n\n return null;\n};\n\nconst createSharedSkillActions = (refreshStatus: RefreshStatus): TuiCommand[] => [\n {\n value: 'opencode-wizard.status',\n title: 'Wizard: status',\n description: 'Refresh plugin auth, backend, catalog, source, and workspace-resolution status via opencode_wizard_status.',\n category: 'Wizard',\n slash: {\n name: 'wizard-status',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n {\n value: 'opencode-wizard.fetch-published-skill',\n title: 'Wizard: fetch published skill',\n description: 'Fetch wizard-listed skill bodies/details with opencode_wizard_published_skills_fetch; pass refresh: true for fresh backend data.',\n category: 'Wizard',\n slash: {\n name: 'wizard-fetch-skill',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n {\n value: 'opencode-wizard.manage-skill-preference',\n title: 'Wizard: manage skill preference',\n description:\n 'Use opencode_wizard_published_skill_preference_set to install, uninstall, ignore, or unignore a published skill for project/global scope.',\n category: 'Wizard',\n slash: {\n name: 'wizard-manage-skill',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n];\n\nconst createEditorSkillActions = (refreshStatus: RefreshStatus): TuiCommand[] => [\n {\n value: 'opencode-wizard.editor.create-or-update-skill',\n title: 'Wizard: create/update skill from markdown',\n description:\n 'Canonical EDITOR flow: call opencode_wizard_editor_create_or_update_skill with complete SKILL.md markdownContent; no local seed file required.',\n category: 'Wizard',\n slash: {\n name: 'wizard-create-skill',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n {\n value: 'opencode-wizard.editor.import-artifact',\n title: 'Wizard: import external artifact',\n description:\n 'External source flow: call opencode_wizard_artifact_import for SKILL or DESIGN_DOC URLs/command-like sources; no project files are written.',\n category: 'Wizard',\n slash: {\n name: 'wizard-import-artifact',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n {\n value: 'opencode-wizard.editor.publish-seed-skill',\n title: 'Wizard: publish local seed skill',\n description:\n 'Legacy seed flow: call opencode_wizard_editor_publish_skill for .opencode/skills/<slug>/SKILL.md when a local seed already exists.',\n category: 'Wizard',\n slash: {\n name: 'wizard-publish-seed',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n];\n\nconst registerSkillActions = (\n api: TuiPluginApi,\n refreshStatus: RefreshStatus,\n mode: RegisteredActionMode,\n): CommandRegistration | null => {\n const sharedActions = createSharedSkillActions(refreshStatus);\n const actions = mode === 'editor' ? [...sharedActions, ...createEditorSkillActions(refreshStatus)] : sharedActions;\n\n return registerCommandActions(api, actions);\n};\n\nexport const tui: TuiPlugin = async (api) => {\n const [status, setStatus] = createSignal<StatusState>({ kind: 'loading' });\n let registeredActionMode: RegisteredActionMode | null = null;\n let commandRegistration: CommandRegistration | null = null;\n const refreshStatus: RefreshStatus = (options) => {\n if (options?.showLoading) {\n setStatus({ kind: 'loading' });\n requestRender(api);\n }\n\n void loadStatus(api).then((nextStatus) => {\n setStatus(nextStatus);\n if (nextStatus.kind === 'ready') {\n const nextMode: RegisteredActionMode = nextStatus.snapshot.availableTools.includes(\n 'opencode_wizard_editor_create_or_update_skill',\n )\n ? 'editor'\n : 'shared';\n if (registeredActionMode !== nextMode) {\n commandRegistration?.unregister?.();\n commandRegistration = registerSkillActions(api, refreshStatus, nextMode);\n registeredActionMode = commandRegistration ? nextMode : null;\n }\n }\n requestRender(api);\n });\n };\n\n api.slots.register(createWizardStatusSlot(api, status, refreshStatus));\n refreshStatus();\n setInterval(refreshStatus, STATUS_REFRESH_INTERVAL_MS);\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,UAAU;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAC3D,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,sBAAsB,QAAQ,YAAY;AACnD,SAASC,UAAU,QAAQ,aAAa;AAQxC,MAAMC,sBAAsB,GAAGA,CAACC,GAAiB,EAAEC,OAAqB,KAAiC;EACvG,MAAMC,eAAe,GAAGA,CAAA,KAAMD,OAAO;EAErC,IAAID,GAAG,CAACG,OAAO,EAAEC,QAAQ,EAAE;IACzB,OAAO;MAAEC,UAAU,EAAEL,GAAG,CAACG,OAAO,CAACC,QAAQ,CAACF,eAAe,CAAC,IAAI;IAAK,CAAC;EACtE;EAEA,IAAIF,GAAG,CAACM,QAAQ,EAAEF,QAAQ,EAAE;IAC1B,OAAO;MAAEC,UAAU,EAAEL,GAAG,CAACM,QAAQ,CAACF,QAAQ,CAACF,eAAe,CAAC,IAAI;IAAK,CAAC;EACvE;EAEA,OAAO,IAAI;AACb,CAAC;AAED,MAAMK,wBAAwB,GAAIC,aAA4B,IAAmB,CAC/E;EACEC,KAAK,EAAE,wBAAwB;EAC/BC,KAAK,EAAE,gBAAgB;EACvBC,WAAW,EAAE,4GAA4G;EACzHC,QAAQ,EAAE,QAAQ;EAClBC,KAAK,EAAE;IACLC,IAAI,EAAE;EACR,CAAC;EACDC,QAAQ,EAAEA,CAAA,KAAMP,aAAa,CAAC;IAAEQ,WAAW,EAAE;EAAK,CAAC;AACrD,CAAC,EACD;EACEP,KAAK,EAAE,uCAAuC;EAC9CC,KAAK,EAAE,+BAA+B;EACtCC,WAAW,EAAE,kIAAkI;EAC/IC,QAAQ,EAAE,QAAQ;EAClBC,KAAK,E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,CAAC,CAAC;EACJ,CAAC;EAEDA,GAAG,CAACkC,KAAK,CAAC9B,QAAQ,CAACP,sBAAsB,CAACG,GAAG,EAAEsB,MAAM,EAAEd,aAAa,CAAC,CAAC;EACtEA,aAAa,CAAC,CAAC;EACf2B,WAAW,CAAC3B,aAAa,EAAEb,0BAA0B,CAAC;AACxD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createSignal","STATUS_REFRESH_INTERVAL_MS","SkillPickerDialog","requestRender","getSkillPickerCommands","createWizardStatusSlot","loadStatus","registerCommandActions","api","commandProvider","command","register","unregister","commands","canOpenSkillPicker","Boolean","ui","dialog","replace","openSkillPickerDialog","snapshot","row","setSize","theme","current","selectedSkillSlug","skillSlug","createSharedSkillActions","refreshStatus","status","value","title","description","category","slash","name","onSelect","showLoading","currentStatus","kind","registerSkillActions","sharedActions","tui","setStatus","commandRegistration","options","then","nextStatus","slots","setInterval"],"sources":["../../src/tui/plugin.ts"],"sourcesContent":["import { createSignal } from 'solid-js';\nimport { STATUS_REFRESH_INTERVAL_MS } from './constants.js';\nimport { SkillPickerDialog } from './components/skill-picker-dialog.js';\nimport { requestRender } from './rendering.js';\nimport { getSkillPickerCommands, type SkillPickerRow } from './skill-helpers.js';\nimport { createWizardStatusSlot } from './slots.js';\nimport { loadStatus } from './status.js';\nimport type { RefreshStatus, StatusState, TuiCommand, TuiPlugin, TuiPluginApi } from './types.js';\n\ntype CommandRegistration = {\n unregister: (() => void) | null;\n};\n\nconst registerCommandActions = (api: TuiPluginApi, commandProvider: () => TuiCommand[]): CommandRegistration | null => {\n if (api.command?.register) {\n return { unregister: api.command.register(commandProvider) ?? null };\n }\n\n if (api.commands?.register) {\n return { unregister: api.commands.register(commandProvider) ?? null };\n }\n\n return null;\n};\n\nconst canOpenSkillPicker = (api: TuiPluginApi): boolean => Boolean(api.ui?.dialog?.replace);\n\nconst openSkillPickerDialog = (api: TuiPluginApi, snapshot: Extract<StatusState, { kind: 'ready' }>['snapshot'], row?: SkillPickerRow) => {\n if (!api.ui?.dialog?.replace) return;\n\n api.ui.dialog.setSize?.('large');\n api.ui.dialog.replace(\n () => SkillPickerDialog({ snapshot, theme: api.theme.current, selectedSkillSlug: row?.skillSlug }),\n () => requestRender(api),\n );\n requestRender(api);\n};\n\nconst createSharedSkillActions = (api: TuiPluginApi, refreshStatus: RefreshStatus, status: () => StatusState): TuiCommand[] => [\n {\n value: 'opencode-wizard.status',\n title: 'Wizard: status',\n description: 'Refresh plugin auth, backend, catalog, source, and workspace-resolution status via opencode_wizard_status.',\n category: 'Wizard',\n slash: {\n name: 'wizard-status',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n ...(canOpenSkillPicker(api)\n ? [\n {\n value: 'opencode-wizard.skills',\n title: 'Wizard: skills catalog',\n description: 'Open a read-only wizard skill catalog. Use tools for fetch/install/ignore actions.',\n category: 'Wizard',\n slash: {\n name: 'wizard-skills',\n },\n onSelect: () => {\n const currentStatus = status();\n if (currentStatus.kind !== 'ready') return;\n openSkillPickerDialog(api, currentStatus.snapshot);\n },\n },\n ]\n : []),\n];\n\nconst registerSkillActions = (\n api: TuiPluginApi,\n refreshStatus: RefreshStatus,\n status: () => StatusState,\n): CommandRegistration | null => {\n const sharedActions = createSharedSkillActions(api, refreshStatus, status);\n\n return registerCommandActions(api, () => {\n const currentStatus = status();\n if (currentStatus.kind !== 'ready') return sharedActions;\n if (!canOpenSkillPicker(api)) return sharedActions;\n\n return [\n ...sharedActions,\n ...getSkillPickerCommands(currentStatus.snapshot, (row) => openSkillPickerDialog(api, currentStatus.snapshot, row)),\n ];\n });\n};\n\nexport const tui: TuiPlugin = async (api) => {\n const [status, setStatus] = createSignal<StatusState>({ kind: 'loading' });\n let commandRegistration: CommandRegistration | null = null;\n const refreshStatus: RefreshStatus = (options) => {\n if (options?.showLoading) {\n setStatus({ kind: 'loading' });\n requestRender(api);\n }\n\n void loadStatus(api).then((nextStatus) => {\n setStatus(nextStatus);\n if (!commandRegistration) {\n commandRegistration = registerSkillActions(api, refreshStatus, status);\n }\n requestRender(api);\n });\n };\n\n api.slots.register(createWizardStatusSlot(api, status, refreshStatus));\n refreshStatus();\n setInterval(refreshStatus, STATUS_REFRESH_INTERVAL_MS);\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,UAAU;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAC3D,SAASC,iBAAiB,QAAQ,qCAAqC;AACvE,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,sBAAsB,QAA6B,oBAAoB;AAChF,SAASC,sBAAsB,QAAQ,YAAY;AACnD,SAASC,UAAU,QAAQ,aAAa;AAOxC,MAAMC,sBAAsB,GAAGA,CAACC,GAAiB,EAAEC,eAAmC,KAAiC;EACrH,IAAID,GAAG,CAACE,OAAO,EAAEC,QAAQ,EAAE;IACzB,OAAO;MAAEC,UAAU,EAAEJ,GAAG,CAACE,OAAO,CAACC,QAAQ,CAACF,eAAe,CAAC,IAAI;IAAK,CAAC;EACtE;EAEA,IAAID,GAAG,CAACK,QAAQ,EAAEF,QAAQ,EAAE;IAC1B,OAAO;MAAEC,UAAU,EAAEJ,GAAG,CAACK,QAAQ,CAACF,QAAQ,CAACF,eAAe,CAAC,IAAI;IAAK,CAAC;EACvE;EAEA,OAAO,IAAI;AACb,CAAC;AAED,MAAMK,kBAAkB,GAAIN,GAAiB,IAAcO,OAAO,CAACP,GAAG,CAACQ,EAAE,EAAEC,MAAM,EAAEC,OAAO,CAAC;AAE3F,MAAMC,qBAAqB,GAAGA,CAACX,GAAiB,EAAEY,QAA6D,EAAEC,GAAoB,KAAK;EACxI,IAAI,CAACb,GAAG,CAACQ,EAAE,EAAEC,MAAM,EAAEC,OAAO,EAAE;EAE9BV,GAAG,CAACQ,EAAE,CAACC,MAAM,CAACK,OAAO,GAAG,OAAO,CAAC;EAChCd,GAAG,CAACQ,EAAE,CAACC,MAAM,CAACC,OAAO,CACnB,MAAMhB,iBAAiB,CAAC;IAAEkB,QAAQ;IAAEG,KA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server.js';
2
- import type { PublishedSkillSummary } from './types.js';
2
+ import type { PublishedSkillSummary, TuiCommand } from './types.js';
3
+ type SkillListOptions = {
4
+ canOpenPicker?: boolean;
5
+ };
3
6
  export declare const getInstallableNotInstalledSkills: (snapshot: PluginStatusSnapshot) => PublishedSkillSummary[];
4
7
  export type SkillListRow = {
5
8
  label: string;
6
9
  value: string;
7
10
  };
11
+ export type SkillPickerRow = SkillListRow & {
12
+ skillSlug: string;
13
+ description: string;
14
+ toolHint: string;
15
+ relevance: number | null;
16
+ };
17
+ export declare const getSkillCatalogSummary: (snapshot: PluginStatusSnapshot) => string;
8
18
  export declare const getUserRoleRow: (snapshot: PluginStatusSnapshot) => SkillListRow;
9
- export declare const getSkillListRows: (snapshot: PluginStatusSnapshot) => SkillListRow[];
19
+ export declare const getSkillListRows: (snapshot: PluginStatusSnapshot, options?: SkillListOptions) => SkillListRow[];
10
20
  export declare const getSkillActionRows: (snapshot: PluginStatusSnapshot) => SkillListRow[];
21
+ export declare const getSkillPickerRows: (snapshot: PluginStatusSnapshot, query?: string) => SkillPickerRow[];
22
+ export declare const getSkillPickerCommands: (snapshot: PluginStatusSnapshot, onSelect?: (row: SkillPickerRow) => void) => TuiCommand[];
23
+ export {};
@@ -1,4 +1,4 @@
1
- const MAX_LISTED_SKILLS = 6;
1
+ const MAX_PICKER_SKILLS = 24;
2
2
  export const getInstallableNotInstalledSkills = snapshot => {
3
3
  const installableSkills = snapshot.installableCatalog?.skills ?? [];
4
4
  if (installableSkills.length === 0) return [];
@@ -6,9 +6,17 @@ export const getInstallableNotInstalledSkills = snapshot => {
6
6
  const ignoredSkillSlugs = new Set(snapshot.ignoredPublishedSkills.skills.map(skill => skill.skillSlug));
7
7
  return installableSkills.filter(skill => !activeSkillSlugs.has(skill.skillSlug) && !ignoredSkillSlugs.has(skill.skillSlug));
8
8
  };
9
+ export const getSkillCatalogSummary = snapshot => {
10
+ const catalog = snapshot.catalog;
11
+ const loadedSkillCount = catalog?.publishedSkillCount ?? 0;
12
+ const workspaceSkillCount = catalog?.assignmentCounts?.project ?? 0;
13
+ const userSkillCount = catalog?.assignmentCounts?.user ?? 0;
14
+ const globalSkillCount = catalog?.assignmentCounts?.global ?? 0;
15
+ return `${loadedSkillCount} loaded · ${workspaceSkillCount} workspace · ${userSkillCount} user · ${globalSkillCount} global`;
16
+ };
9
17
  const getUserRoleLabel = snapshot => {
10
18
  if (snapshot.authState.role) return snapshot.authState.role;
11
- if (snapshot.authState.status === 'authenticated') return 'USER';
19
+ if (snapshot.authState.status === 'authenticated') return 'unknown';
12
20
  return 'none';
13
21
  };
14
22
  export const getUserRoleRow = snapshot => ({
@@ -26,25 +34,79 @@ const toEffectiveSkillLabel = skill => {
26
34
  if (skill.contextKind === 'project') return 'project';
27
35
  return 'active';
28
36
  };
29
- export const getSkillListRows = snapshot => {
30
- const activeRows = (snapshot.catalog?.skills ?? []).map(skill => ({
31
- label: toEffectiveSkillLabel(skill),
32
- value: compactSkillName(skill)
33
- }));
34
- const availableRows = getInstallableNotInstalledSkills(snapshot).map(skill => ({
35
- label: 'available',
36
- value: compactSkillName(skill)
37
- }));
38
- const ignoredRows = snapshot.ignoredPublishedSkills.skills.map(skill => ({
39
- label: 'ignored',
40
- value: compactSkillName(skill)
41
- }));
42
- const rows = [...activeRows, ...availableRows, ...ignoredRows];
43
- if (rows.length <= MAX_LISTED_SKILLS) return rows;
44
- return [...rows.slice(0, MAX_LISTED_SKILLS), {
45
- label: 'more',
46
- value: `${rows.length - MAX_LISTED_SKILLS} hidden · use opencode_wizard_published_skills_fetch`
37
+ export const getSkillListRows = (snapshot, options = {}) => {
38
+ const rows = [options.canOpenPicker ? {
39
+ label: 'open',
40
+ value: '/wizard-skills'
41
+ } : {
42
+ label: 'fetch',
43
+ value: 'opencode_wizard_published_skills_fetch'
44
+ }];
45
+ if (getInstallableNotInstalledSkills(snapshot).length === 0 && snapshot.ignoredPublishedSkills.skills.length === 0) return rows;
46
+ return [...rows, {
47
+ label: 'manage',
48
+ value: 'opencode_wizard_published_skill_preference_set'
47
49
  }];
48
50
  };
49
51
  export const getSkillActionRows = snapshot => [getUserRoleRow(snapshot)];
52
+ const normalizePickerText = value => value?.trim().toLowerCase() ?? '';
53
+ const getSkillSearchText = skill => [skill.skillSlug, skill.skillName, skill.artifactName, skill.artifactDescription, skill.whenToUse, skill.recommendationReason, ...skill.identifiers, ...skill.tags.flatMap(tag => [tag.slug, tag.label, tag.facet?.slug, tag.facet?.label])].map(normalizePickerText).filter(Boolean).join(' ');
54
+ const getPickerLabel = skill => {
55
+ if (skill.contextKind === 'installable') return 'available';
56
+ return toEffectiveSkillLabel(skill);
57
+ };
58
+ const getSkillToolHint = (skill, label) => {
59
+ if (label === 'available') {
60
+ return `read-only: install with opencode_wizard_published_skill_preference_set skill=${skill.skillSlug}`;
61
+ }
62
+ if (label === 'ignored') {
63
+ return `read-only: unignore with opencode_wizard_published_skill_preference_set skill=${skill.skillSlug}`;
64
+ }
65
+ return `read-only: fetch body with opencode_wizard_published_skills_fetch skill=${skill.skillSlug}`;
66
+ };
67
+ const toPickerRow = (skill, label) => ({
68
+ label,
69
+ value: compactSkillName(skill),
70
+ skillSlug: skill.skillSlug,
71
+ description: [skill.recommendationReason, skill.whenToUse, skill.artifactDescription].map(item => item?.trim()).find(item => Boolean(item)) ?? '',
72
+ toolHint: getSkillToolHint(skill, label),
73
+ relevance: skill.relevance ?? null
74
+ });
75
+ const getPickerSkills = snapshot => [...(snapshot.catalog?.skills ?? []).map(skill => ({
76
+ skill,
77
+ label: getPickerLabel(skill)
78
+ })), ...getInstallableNotInstalledSkills(snapshot).map(skill => ({
79
+ skill,
80
+ label: 'available'
81
+ })), ...snapshot.ignoredPublishedSkills.skills.map(skill => ({
82
+ skill,
83
+ label: 'ignored'
84
+ }))];
85
+ export const getSkillPickerRows = (snapshot, query = '') => {
86
+ const normalizedQuery = normalizePickerText(query);
87
+ const tokens = normalizedQuery.split(/\s+/u).filter(Boolean);
88
+ return getPickerSkills(snapshot).filter(({
89
+ skill
90
+ }) => {
91
+ if (tokens.length === 0) return true;
92
+ const searchText = getSkillSearchText(skill);
93
+ return tokens.every(token => searchText.includes(token));
94
+ }).sort((left, right) => {
95
+ const leftRelevance = left.skill.relevance ?? -1;
96
+ const rightRelevance = right.skill.relevance ?? -1;
97
+ if (leftRelevance !== rightRelevance) return rightRelevance - leftRelevance;
98
+ return left.skill.skillSlug.localeCompare(right.skill.skillSlug);
99
+ }).slice(0, MAX_PICKER_SKILLS).map(({
100
+ skill,
101
+ label
102
+ }) => toPickerRow(skill, label));
103
+ };
104
+ export const getSkillPickerCommands = (snapshot, onSelect) => getSkillPickerRows(snapshot).map(row => ({
105
+ value: `opencode-wizard.skill-picker.${row.label}.${row.skillSlug}`,
106
+ title: `Wizard skill: ${row.value}`,
107
+ description: [row.label, row.relevance === null ? null : `relevance ${row.relevance}`, row.description, row.toolHint].filter(item => Boolean(item)).join(' · '),
108
+ category: 'Wizard skills',
109
+ suggested: row.relevance !== null && row.relevance >= 80,
110
+ onSelect: onSelect ? () => onSelect(row) : undefined
111
+ }));
50
112
  //# sourceMappingURL=skill-helpers.js.map