@aexol/opencode-wizard 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/graphql-operations.d.ts +1 -0
- package/dist/graphql-operations.js +11 -0
- package/dist/graphql-operations.js.map +1 -1
- package/dist/plugin-tools.js +4 -4
- package/dist/plugin-tools.js.map +1 -1
- package/dist/published-skills-system-note.d.ts +1 -1
- package/dist/published-skills-system-note.js +1 -17
- package/dist/published-skills-system-note.js.map +1 -1
- package/dist/server/client.d.ts +7 -1
- package/dist/server/client.js +59 -2
- package/dist/server/client.js.map +1 -1
- package/dist/server/runtime.js +18 -16
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/status.d.ts +3 -2
- package/dist/server/status.js +15 -9
- package/dist/server/status.js.map +1 -1
- package/dist/server/types.d.ts +9 -0
- package/dist/server/types.js.map +1 -1
- package/dist/smoke-published-skills.js +4 -3
- package/dist/smoke-published-skills.js.map +1 -1
- package/dist/tui/components/status-content.d.ts +4 -0
- package/dist/tui/components/status-content.js +168 -61
- package/dist/tui/components/status-content.js.map +1 -1
- package/dist/tui/formatting.js +3 -4
- package/dist/tui/formatting.js.map +1 -1
- package/dist/tui/plugin.js +1 -1
- package/dist/tui/plugin.js.map +1 -1
- package/dist/tui/skill-helpers.d.ts +2 -0
- package/dist/tui/skill-helpers.js +18 -14
- package/dist/tui/skill-helpers.js.map +1 -1
- package/dist/tui/slots.js +2 -2
- package/dist/tui/slots.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { memo as _$memo } from "@opentui/solid";
|
|
2
1
|
import { createComponent as _$createComponent } from "@opentui/solid";
|
|
3
2
|
import { insert as _$insert } from "@opentui/solid";
|
|
4
3
|
import { effect as _$effect } from "@opentui/solid";
|
|
@@ -8,7 +7,7 @@ import { setProp as _$setProp } from "@opentui/solid";
|
|
|
8
7
|
import { createElement as _$createElement } from "@opentui/solid";
|
|
9
8
|
import { createMemo } from 'solid-js';
|
|
10
9
|
import { compactStatusMessage, formatAuthStatus, formatBackendOriginLabel, formatSkillsCatalogUnavailableMessage } from '../formatting.js';
|
|
11
|
-
import {
|
|
10
|
+
import { getSkillCatalogSummary, getSkillListRows, getUserRoleRow } from '../skill-helpers.js';
|
|
12
11
|
import { Row } from './common.js';
|
|
13
12
|
export const StatusContent = props => {
|
|
14
13
|
if (props.status.kind === 'loading') {
|
|
@@ -62,8 +61,128 @@ export const SkillsRows = props => {
|
|
|
62
61
|
return _el$5;
|
|
63
62
|
})();
|
|
64
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
|
+
});
|
|
99
|
+
};
|
|
100
|
+
return (() => {
|
|
101
|
+
var _el$0 = _$createElement("box");
|
|
102
|
+
_$setProp(_el$0, "width", "100%");
|
|
103
|
+
_$setProp(_el$0, "flexDirection", "column");
|
|
104
|
+
_$setProp(_el$0, "overflow", "hidden");
|
|
105
|
+
_$insert(_el$0, content);
|
|
106
|
+
return _el$0;
|
|
107
|
+
})();
|
|
108
|
+
};
|
|
109
|
+
const ReadySidebarSkillRows = props => {
|
|
110
|
+
if (!props.snapshot.catalog) {
|
|
111
|
+
return (() => {
|
|
112
|
+
var _el$1 = _$createElement("text"),
|
|
113
|
+
_el$10 = _$createTextNode(`skills unavailable: `);
|
|
114
|
+
_$insertNode(_el$1, _el$10);
|
|
115
|
+
_$setProp(_el$1, "wrapMode", "none");
|
|
116
|
+
_$setProp(_el$1, "overflow", "hidden");
|
|
117
|
+
_$insert(_el$1, () => formatSkillsCatalogUnavailableMessage(props.snapshot), null);
|
|
118
|
+
_$effect(_$p => _$setProp(_el$1, "fg", props.theme.textMuted, _$p));
|
|
119
|
+
return _el$1;
|
|
120
|
+
})();
|
|
121
|
+
}
|
|
122
|
+
const skillRows = getSkillListRows(props.snapshot);
|
|
123
|
+
if (skillRows.length === 0) {
|
|
124
|
+
return (() => {
|
|
125
|
+
var _el$11 = _$createElement("box"),
|
|
126
|
+
_el$12 = _$createElement("text");
|
|
127
|
+
_$insertNode(_el$11, _el$12);
|
|
128
|
+
_$setProp(_el$11, "width", "100%");
|
|
129
|
+
_$setProp(_el$11, "flexDirection", "column");
|
|
130
|
+
_$setProp(_el$11, "overflow", "hidden");
|
|
131
|
+
_$insert(_el$11, _$createComponent(Row, {
|
|
132
|
+
label: "skills",
|
|
133
|
+
get value() {
|
|
134
|
+
return getSkillCatalogSummary(props.snapshot);
|
|
135
|
+
},
|
|
136
|
+
get labelColor() {
|
|
137
|
+
return props.theme.textMuted;
|
|
138
|
+
},
|
|
139
|
+
get valueColor() {
|
|
140
|
+
return props.theme.text;
|
|
141
|
+
}
|
|
142
|
+
}), _el$12);
|
|
143
|
+
_$insertNode(_el$12, _$createTextNode(`no skills listed`));
|
|
144
|
+
_$setProp(_el$12, "wrapMode", "none");
|
|
145
|
+
_$setProp(_el$12, "overflow", "hidden");
|
|
146
|
+
_$effect(_$p => _$setProp(_el$12, "fg", props.theme.textMuted, _$p));
|
|
147
|
+
return _el$11;
|
|
148
|
+
})();
|
|
149
|
+
}
|
|
150
|
+
return (() => {
|
|
151
|
+
var _el$14 = _$createElement("box");
|
|
152
|
+
_$setProp(_el$14, "width", "100%");
|
|
153
|
+
_$setProp(_el$14, "flexDirection", "column");
|
|
154
|
+
_$setProp(_el$14, "overflow", "hidden");
|
|
155
|
+
_$insert(_el$14, _$createComponent(Row, {
|
|
156
|
+
label: "skills",
|
|
157
|
+
get value() {
|
|
158
|
+
return getSkillCatalogSummary(props.snapshot);
|
|
159
|
+
},
|
|
160
|
+
get labelColor() {
|
|
161
|
+
return props.theme.textMuted;
|
|
162
|
+
},
|
|
163
|
+
get valueColor() {
|
|
164
|
+
return props.theme.text;
|
|
165
|
+
}
|
|
166
|
+
}), null);
|
|
167
|
+
_$insert(_el$14, () => skillRows.map(row => _$createComponent(Row, {
|
|
168
|
+
get label() {
|
|
169
|
+
return row.label;
|
|
170
|
+
},
|
|
171
|
+
get value() {
|
|
172
|
+
return row.value;
|
|
173
|
+
},
|
|
174
|
+
get labelColor() {
|
|
175
|
+
return props.theme.textMuted;
|
|
176
|
+
},
|
|
177
|
+
get valueColor() {
|
|
178
|
+
return props.theme.text;
|
|
179
|
+
}
|
|
180
|
+
})), null);
|
|
181
|
+
return _el$14;
|
|
182
|
+
})();
|
|
183
|
+
};
|
|
65
184
|
export const ReadyRows = props => {
|
|
66
|
-
const
|
|
185
|
+
const roleRow = getUserRoleRow(props.snapshot);
|
|
67
186
|
const statusRows = [_$createComponent(Row, {
|
|
68
187
|
label: "url",
|
|
69
188
|
get value() {
|
|
@@ -86,28 +205,15 @@ export const ReadyRows = props => {
|
|
|
86
205
|
get valueColor() {
|
|
87
206
|
return props.theme.text;
|
|
88
207
|
}
|
|
89
|
-
})
|
|
90
|
-
get label() {
|
|
91
|
-
return row.label;
|
|
92
|
-
},
|
|
93
|
-
get value() {
|
|
94
|
-
return row.value;
|
|
95
|
-
},
|
|
96
|
-
get labelColor() {
|
|
97
|
-
return props.theme.textMuted;
|
|
98
|
-
},
|
|
99
|
-
get valueColor() {
|
|
100
|
-
return props.theme.text;
|
|
101
|
-
}
|
|
102
|
-
})))];
|
|
208
|
+
})];
|
|
103
209
|
if (!props.snapshot.catalog) {
|
|
104
210
|
return (() => {
|
|
105
|
-
var _el$
|
|
106
|
-
_$setProp(_el$
|
|
107
|
-
_$setProp(_el$
|
|
108
|
-
_$setProp(_el$
|
|
109
|
-
_$insert(_el$
|
|
110
|
-
_$insert(_el$
|
|
211
|
+
var _el$15 = _$createElement("box");
|
|
212
|
+
_$setProp(_el$15, "width", "100%");
|
|
213
|
+
_$setProp(_el$15, "flexDirection", "column");
|
|
214
|
+
_$setProp(_el$15, "overflow", "hidden");
|
|
215
|
+
_$insert(_el$15, statusRows, null);
|
|
216
|
+
_$insert(_el$15, _$createComponent(Row, {
|
|
111
217
|
label: "catalog",
|
|
112
218
|
get value() {
|
|
113
219
|
return formatSkillsCatalogUnavailableMessage(props.snapshot);
|
|
@@ -119,21 +225,34 @@ export const ReadyRows = props => {
|
|
|
119
225
|
return props.theme.text;
|
|
120
226
|
}
|
|
121
227
|
}), null);
|
|
122
|
-
|
|
228
|
+
_$insert(_el$15, _$createComponent(Row, {
|
|
229
|
+
get label() {
|
|
230
|
+
return roleRow.label;
|
|
231
|
+
},
|
|
232
|
+
get value() {
|
|
233
|
+
return roleRow.value;
|
|
234
|
+
},
|
|
235
|
+
get labelColor() {
|
|
236
|
+
return props.theme.textMuted;
|
|
237
|
+
},
|
|
238
|
+
get valueColor() {
|
|
239
|
+
return props.theme.text;
|
|
240
|
+
}
|
|
241
|
+
}), null);
|
|
242
|
+
return _el$15;
|
|
123
243
|
})();
|
|
124
244
|
}
|
|
125
|
-
const installableNotInstalledCount = getInstallableNotInstalledSkills(props.snapshot).length;
|
|
126
|
-
const catalogStatus = `${props.snapshot.catalog.publishedSkillCount} loaded · ${installableNotInstalledCount} installable · ${props.snapshot.ignoredPublishedSkills.count} ignored`;
|
|
127
|
-
const skillRows = getSkillListRows(props.snapshot);
|
|
128
245
|
return (() => {
|
|
129
|
-
var _el$
|
|
130
|
-
_$setProp(_el$
|
|
131
|
-
_$setProp(_el$
|
|
132
|
-
_$setProp(_el$
|
|
133
|
-
_$insert(_el$
|
|
134
|
-
_$insert(_el$
|
|
246
|
+
var _el$16 = _$createElement("box");
|
|
247
|
+
_$setProp(_el$16, "width", "100%");
|
|
248
|
+
_$setProp(_el$16, "flexDirection", "column");
|
|
249
|
+
_$setProp(_el$16, "overflow", "hidden");
|
|
250
|
+
_$insert(_el$16, statusRows, null);
|
|
251
|
+
_$insert(_el$16, _$createComponent(Row, {
|
|
135
252
|
label: "catalog",
|
|
136
|
-
value
|
|
253
|
+
get value() {
|
|
254
|
+
return getSkillCatalogSummary(props.snapshot);
|
|
255
|
+
},
|
|
137
256
|
get labelColor() {
|
|
138
257
|
return props.theme.textMuted;
|
|
139
258
|
},
|
|
@@ -141,33 +260,21 @@ export const ReadyRows = props => {
|
|
|
141
260
|
return props.theme.text;
|
|
142
261
|
}
|
|
143
262
|
}), null);
|
|
144
|
-
_$insert(_el$
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
})) : _$createComponent(Row, {
|
|
160
|
-
label: "skills",
|
|
161
|
-
value: "none assigned yet",
|
|
162
|
-
get labelColor() {
|
|
163
|
-
return props.theme.textMuted;
|
|
164
|
-
},
|
|
165
|
-
get valueColor() {
|
|
166
|
-
return props.theme.text;
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
})(), null);
|
|
170
|
-
return _el$7;
|
|
263
|
+
_$insert(_el$16, _$createComponent(Row, {
|
|
264
|
+
get label() {
|
|
265
|
+
return roleRow.label;
|
|
266
|
+
},
|
|
267
|
+
get value() {
|
|
268
|
+
return roleRow.value;
|
|
269
|
+
},
|
|
270
|
+
get labelColor() {
|
|
271
|
+
return props.theme.textMuted;
|
|
272
|
+
},
|
|
273
|
+
get valueColor() {
|
|
274
|
+
return props.theme.text;
|
|
275
|
+
}
|
|
276
|
+
}), null);
|
|
277
|
+
return _el$16;
|
|
171
278
|
})();
|
|
172
279
|
};
|
|
173
280
|
//# sourceMappingURL=status-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createMemo","compactStatusMessage","formatAuthStatus","formatBackendOriginLabel","formatSkillsCatalogUnavailableMessage","getInstallableNotInstalledSkills","getSkillActionRows","getSkillListRows","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","actionRows","statusRows","label","value","backendOrigin","labelColor","valueColor","text","_$memo","map","row","catalog","_el$6","installableNotInstalledCount","length","catalogStatus","publishedSkillCount","ignoredPublishedSkills","count","skillRows","_el$7","_c$"],"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, getSkillActionRows, getSkillListRows } 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 actionRows = getSkillActionRows(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 {actionRows.map((row) => (\n <Row label={row.label} value={row.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n ))}\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 </box>\n );\n }\n\n const installableNotInstalledCount = getInstallableNotInstalledSkills(props.snapshot).length;\n const catalogStatus = `${props.snapshot.catalog.publishedSkillCount} loaded · ${installableNotInstalledCount} installable · ${props.snapshot.ignoredPublishedSkills.count} ignored`;\n const skillRows = getSkillListRows(props.snapshot);\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 {skillRows.length > 0 ? (\n skillRows.map((row) => (\n <Row label={row.label} value={row.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n ))\n ) : (\n <Row label=\"skills\" value=\"none assigned yet\" labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n )}\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,kBAAkB,EAAEC,gBAAgB,QAAQ,qBAAqB;AAE5G,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,CAACC,MAAM,CAACC,IAAI,KAAK,OAAO,EAAE;IACjC;MAAA,IAAAU,KAAA,GAAAR,eAAA;QAAAS,KAAA,GAAAP,gBAAA;MAAAD,YAAA,CAAAO,KAAA,EAAAC,KAAA;MAAAN,SAAA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AA,OACzGW,SAAS,CAACL,MAAM,GAAG,CAAC;MAAA,aAApBO,GAAA,KACCF,SAAS,CAACV,GAAG,CAAEC,GAAG,IAAAnB,iBAAA,CACfnB,GAAG;QAAA,IAAC8B,KAAKA,CAAA;UAAA,OAAEQ,GAAG,CAACR,KAAK;QAAA;QAAA,IAAEC,KAAKA,CAAA;UAAA,OAAEO,GAAG,CAACP,KAAK;QAAA;QAAA,IAAEE,UAAUA,CAAA;UAAA,OAAE/B,KAAK,CAACU,KAAK,CAACC,SAAS;QAAA;QAAA,IAAEqB,UAAUA,CAAA;UAAA,OAAEhC,KAAK,CAACU,KAAK,CAACuB,IAAI;QAAA;MAAA,EACzG,CAAC,GAAAhB,iBAAA,CAEDnB,GAAG;QAAC8B,KAAK;QAAUC,KAAK;QAAA,IAAqBE,UAAUA,CAAA;UAAA,OAAE/B,KAAK,CAACU,KAAK,CAACC,SAAS;QAAA;QAAA,IAAEqB,UAAUA,CAAA;UAAA,OAAEhC,KAAK,CAACU,KAAK,CAACuB,IAAI;QAAA;MAAA,EAC9G;IAAA;IAAA,OAAAa,KAAA;EAAA;AAGP,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","_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 <ReadySidebarSkillRows snapshot={status.snapshot} theme={theme()} />;\n };\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {content()}\n </box>\n );\n};\n\nconst ReadySidebarSkillRows = (props: { snapshot: PluginStatusSnapshot; theme: TuiPluginApi['theme']['current'] }) => {\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);\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,kBAAkB;AAC1I,SAASC,sBAAsB,EAAEC,gBAAgB,EAAEC,cAAc,QAAQ,qBAAqB;AAE9F,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,CAACC,MAAM,CAACC,IAAI,KAAK,OAAO,EAAE;IACjC;MAAA,IAAAU,KAAA,GAAAR,eAAA;QAAAS,KAAA,GAAAP,gBAAA;MAAAD,YAAA,CAAAO,KAAA,EAAAC,KAAA;MAAAN,SAAA,CAAAK,KAAA,cAC0C,MAAM;MAAAL,SAAA,CAAAK,KAAA,cAAU,QAAQ;MAAAE,QAAA,CAAAF,KAAA,QAChDrB,oBAAoB,CAACS,KAAK,CAACC,MAAM,CAACc,OAAO,CAAC;MAAAP,QAAA,CAAAC,GAAA,IAAAF,SAAA,CAAAK,KAAA,QADhDZ,KAAK,CAACU,KAAK,CAACM,OAAO,EAAAP,GAAA;MAAA,OAAAG,KAAA;IAAA;EAIjC;EAEA,OAAAK,iBAAA,CA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|
package/dist/tui/formatting.js
CHANGED
|
@@ -13,10 +13,9 @@ export const formatSkillsCatalogUnavailableMessage = snapshot => {
|
|
|
13
13
|
return 'unavailable';
|
|
14
14
|
};
|
|
15
15
|
export const formatAuthStatus = snapshot => {
|
|
16
|
-
|
|
17
|
-
if (snapshot.authState.
|
|
18
|
-
|
|
19
|
-
return `${snapshot.authState.email}${roleLabel}`;
|
|
16
|
+
if (snapshot.authState.status !== 'authenticated') return snapshot.authState.status;
|
|
17
|
+
if (!snapshot.authState.email) return 'authenticated';
|
|
18
|
+
return snapshot.authState.email;
|
|
20
19
|
};
|
|
21
20
|
export const formatBackendOriginLabel = backendOrigin => {
|
|
22
21
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MAX_STATUS_MESSAGE_LENGTH","compactStatusMessage","message","length","slice","formatSkillsCatalogUnavailableMessage","snapshot","catalog","status","formatAuthStatus","
|
|
1
|
+
{"version":3,"names":["MAX_STATUS_MESSAGE_LENGTH","compactStatusMessage","message","length","slice","formatSkillsCatalogUnavailableMessage","snapshot","catalog","status","formatAuthStatus","authState","email","formatBackendOriginLabel","backendOrigin","hostname","URL","includes"],"sources":["../../src/tui/formatting.ts"],"sourcesContent":["import type { PluginStatusSnapshot } from '../server.js';\nimport { MAX_STATUS_MESSAGE_LENGTH } from './constants.js';\n\nexport const compactStatusMessage = (message: string): string => {\n if (message.length <= MAX_STATUS_MESSAGE_LENGTH) return message;\n\n return `${message.slice(0, MAX_STATUS_MESSAGE_LENGTH - 1)}…`;\n};\n\nexport const formatSkillsCatalogUnavailableMessage = (snapshot: PluginStatusSnapshot): string => {\n if (!snapshot.catalog && snapshot.status === 'missing_auth') {\n if (snapshot.message) return compactStatusMessage(snapshot.message);\n\n return 'locked (browser auth pending)';\n }\n\n if (!snapshot.catalog && snapshot.message) return compactStatusMessage(snapshot.message);\n if (!snapshot.catalog) return `unavailable (${snapshot.status})`;\n\n return 'unavailable';\n};\n\nexport const formatAuthStatus = (snapshot: PluginStatusSnapshot): string => {\n if (snapshot.authState.status !== 'authenticated') return snapshot.authState.status;\n if (!snapshot.authState.email) return 'authenticated';\n\n return snapshot.authState.email;\n};\n\nexport const formatBackendOriginLabel = (backendOrigin: string): string => {\n try {\n const { hostname } = new URL(backendOrigin);\n if (hostname === 'localhost' || hostname === '127.0.0.1') return 'localhost';\n\n return 'opencode-wizard';\n } catch {\n if (backendOrigin.includes('localhost') || backendOrigin.includes('127.0.0.1')) return 'localhost';\n\n return 'opencode-wizard';\n }\n};\n"],"mappings":"AACA,SAASA,yBAAyB,QAAQ,gBAAgB;AAE1D,OAAO,MAAMC,oBAAoB,GAAIC,OAAe,IAAa;EAC/D,IAAIA,OAAO,CAACC,MAAM,IAAIH,yBAAyB,EAAE,OAAOE,OAAO;EAE/D,OAAO,GAAGA,OAAO,CAACE,KAAK,CAAC,CAAC,EAAEJ,yBAAyB,GAAG,CAAC,CAAC,GAAG;AAC9D,CAAC;AAED,OAAO,MAAMK,qCAAqC,GAAIC,QAA8B,IAAa;EAC/F,IAAI,CAACA,QAAQ,CAACC,OAAO,IAAID,QAAQ,CAACE,MAAM,KAAK,cAAc,EAAE;IAC3D,IAAIF,QAAQ,CAACJ,OAAO,EAAE,OAAOD,oBAAoB,CAACK,QAAQ,CAACJ,OAAO,CAAC;IAEnE,OAAO,+BAA+B;EACxC;EAEA,IAAI,CAACI,QAAQ,CAACC,OAAO,IAAID,QAAQ,CAACJ,OAAO,EAAE,OAAOD,oBAAoB,CAACK,QAAQ,CAACJ,OAAO,CAAC;EACxF,IAAI,CAACI,QAAQ,CAACC,OAAO,EAAE,OAAO,gBAAgBD,QAAQ,CAACE,MAAM,GAAG;EAEhE,OAAO,aAAa;AACtB,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAIH,QAA8B,IAAa;EAC1E,IAAIA,QAAQ,CAACI,SAAS,CAACF,MAAM,KAAK,eAAe,EAAE,OAAOF,QAAQ,CAACI,SAAS,CAACF,MAAM;EACnF,IAAI,CAACF,QAAQ,CAACI,SAAS,CAACC,KAAK,EAAE,OAAO,eAAe;EAErD,OAAOL,QAAQ,CAACI,SAAS,CAACC,KAAK;AACjC,CAAC;AAED,OAAO,MAAMC,wBAAwB,GAAIC,aAAqB,IAAa;EACzE,IAAI;IACF,MAAM;MAAEC;IAAS,CAAC,GAAG,IAAIC,GAAG,CAACF,aAAa,CAAC;IAC3C,IAAIC,QAAQ,KAAK,WAAW,IAAIA,QAAQ,KAAK,WAAW,EAAE,OAAO,WAAW;IAE5E,OAAO,iBAAiB;EAC1B,CAAC,CAAC,MAAM;IACN,IAAID,aAAa,CAACG,QAAQ,CAAC,WAAW,CAAC,IAAIH,aAAa,CAACG,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,WAAW;IAElG,OAAO,iBAAiB;EAC1B;AACF,CAAC","ignoreList":[]}
|
package/dist/tui/plugin.js
CHANGED
|
@@ -106,7 +106,7 @@ export const tui = async api => {
|
|
|
106
106
|
void loadStatus(api).then(nextStatus => {
|
|
107
107
|
setStatus(nextStatus);
|
|
108
108
|
if (nextStatus.kind === 'ready') {
|
|
109
|
-
const nextMode = nextStatus.snapshot.
|
|
109
|
+
const nextMode = nextStatus.snapshot.availableTools.includes('opencode_wizard_editor_create_or_update_skill') ? 'editor' : 'shared';
|
|
110
110
|
if (registeredActionMode !== nextMode) {
|
|
111
111
|
commandRegistration?.unregister?.();
|
|
112
112
|
commandRegistration = registerSkillActions(api, refreshStatus, nextMode);
|
package/dist/tui/plugin.js.map
CHANGED
|
@@ -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","
|
|
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,QA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EAAErB,UAAU,GAAG,CAAC;UACnCqB,mBAAmB,GAAGR,oBAAoB,CAAClB,GAAG,EAAEQ,aAAa,EAAEsB,QAAQ,CAAC;UACxEL,oBAAoB,GAAGC,mBAAmB,GAAGI,QAAQ,GAAG,IAAI;QAC9D;MACF;MACAlC,aAAa,CAACI,GAAG,CAAC;IACpB,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":[]}
|
|
@@ -5,5 +5,7 @@ export type SkillListRow = {
|
|
|
5
5
|
label: string;
|
|
6
6
|
value: string;
|
|
7
7
|
};
|
|
8
|
+
export declare const getSkillCatalogSummary: (snapshot: PluginStatusSnapshot) => string;
|
|
9
|
+
export declare const getUserRoleRow: (snapshot: PluginStatusSnapshot) => SkillListRow;
|
|
8
10
|
export declare const getSkillListRows: (snapshot: PluginStatusSnapshot) => SkillListRow[];
|
|
9
11
|
export declare const getSkillActionRows: (snapshot: PluginStatusSnapshot) => SkillListRow[];
|
|
@@ -6,6 +6,23 @@ 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
|
+
};
|
|
17
|
+
const getUserRoleLabel = snapshot => {
|
|
18
|
+
if (snapshot.authState.role) return snapshot.authState.role;
|
|
19
|
+
if (snapshot.authState.status === 'authenticated') return 'unknown';
|
|
20
|
+
return 'none';
|
|
21
|
+
};
|
|
22
|
+
export const getUserRoleRow = snapshot => ({
|
|
23
|
+
label: 'role',
|
|
24
|
+
value: getUserRoleLabel(snapshot)
|
|
25
|
+
});
|
|
9
26
|
const compactSkillName = skill => {
|
|
10
27
|
const name = skill.skillName.trim() || skill.artifactName.trim() || skill.skillSlug;
|
|
11
28
|
if (name === skill.skillSlug) return name;
|
|
@@ -37,18 +54,5 @@ export const getSkillListRows = snapshot => {
|
|
|
37
54
|
value: `${rows.length - MAX_LISTED_SKILLS} hidden · use opencode_wizard_published_skills_fetch`
|
|
38
55
|
}];
|
|
39
56
|
};
|
|
40
|
-
export const getSkillActionRows = snapshot =>
|
|
41
|
-
const rows = [{
|
|
42
|
-
label: 'commands',
|
|
43
|
-
value: 'Wizard: status · fetch skill · manage preference'
|
|
44
|
-
}, {
|
|
45
|
-
label: 'manage',
|
|
46
|
-
value: 'install/uninstall · ignore/unignore via preference_set'
|
|
47
|
-
}];
|
|
48
|
-
if (snapshot.authState.role !== 'EDITOR') return rows;
|
|
49
|
-
return [...rows, {
|
|
50
|
-
label: 'editor',
|
|
51
|
-
value: 'create/update markdown · import external · publish seed'
|
|
52
|
-
}];
|
|
53
|
-
};
|
|
57
|
+
export const getSkillActionRows = snapshot => [getUserRoleRow(snapshot)];
|
|
54
58
|
//# sourceMappingURL=skill-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MAX_LISTED_SKILLS","getInstallableNotInstalledSkills","snapshot","installableSkills","installableCatalog","skills","length","activeSkillSlugs","Set","catalog","map","skill","skillSlug","ignoredSkillSlugs","ignoredPublishedSkills","filter","has","compactSkillName","name","skillName","trim","artifactName","toEffectiveSkillLabel","assignmentSource","includes","contextKind","getSkillListRows","activeRows","
|
|
1
|
+
{"version":3,"names":["MAX_LISTED_SKILLS","getInstallableNotInstalledSkills","snapshot","installableSkills","installableCatalog","skills","length","activeSkillSlugs","Set","catalog","map","skill","skillSlug","ignoredSkillSlugs","ignoredPublishedSkills","filter","has","getSkillCatalogSummary","loadedSkillCount","publishedSkillCount","workspaceSkillCount","assignmentCounts","project","userSkillCount","user","globalSkillCount","global","getUserRoleLabel","authState","role","status","getUserRoleRow","label","value","compactSkillName","name","skillName","trim","artifactName","toEffectiveSkillLabel","assignmentSource","includes","contextKind","getSkillListRows","activeRows","availableRows","ignoredRows","rows","slice","getSkillActionRows"],"sources":["../../src/tui/skill-helpers.ts"],"sourcesContent":["import type { PluginStatusSnapshot } from '../server.js';\nimport type { PublishedSkillSummary } from './types.js';\n\nconst MAX_LISTED_SKILLS = 6;\n\nexport const getInstallableNotInstalledSkills = (snapshot: PluginStatusSnapshot): PublishedSkillSummary[] => {\n const installableSkills = snapshot.installableCatalog?.skills ?? [];\n if (installableSkills.length === 0) return [];\n\n const activeSkillSlugs = new Set(snapshot.catalog?.skills.map((skill) => skill.skillSlug) ?? []);\n const ignoredSkillSlugs = new Set(snapshot.ignoredPublishedSkills.skills.map((skill) => skill.skillSlug));\n\n return installableSkills.filter(\n (skill) => !activeSkillSlugs.has(skill.skillSlug) && !ignoredSkillSlugs.has(skill.skillSlug),\n );\n};\n\nexport type SkillListRow = {\n label: string;\n value: string;\n};\n\nexport const getSkillCatalogSummary = (snapshot: PluginStatusSnapshot): string => {\n const catalog = snapshot.catalog;\n const loadedSkillCount = catalog?.publishedSkillCount ?? 0;\n const workspaceSkillCount = catalog?.assignmentCounts?.project ?? 0;\n const userSkillCount = catalog?.assignmentCounts?.user ?? 0;\n const globalSkillCount = catalog?.assignmentCounts?.global ?? 0;\n\n return `${loadedSkillCount} loaded · ${workspaceSkillCount} workspace · ${userSkillCount} user · ${globalSkillCount} global`;\n};\n\nconst getUserRoleLabel = (snapshot: PluginStatusSnapshot): string => {\n if (snapshot.authState.role) return snapshot.authState.role;\n if (snapshot.authState.status === 'authenticated') return 'unknown';\n\n return 'none';\n};\n\nexport const getUserRoleRow = (snapshot: PluginStatusSnapshot): SkillListRow => ({\n label: 'role',\n value: getUserRoleLabel(snapshot),\n});\n\nconst compactSkillName = (skill: PublishedSkillSummary): string => {\n const name = skill.skillName.trim() || skill.artifactName.trim() || skill.skillSlug;\n if (name === skill.skillSlug) return name;\n\n return `${name} (${skill.skillSlug})`;\n};\n\nconst toEffectiveSkillLabel = (skill: PublishedSkillSummary): string => {\n if (skill.assignmentSource.includes('USER')) return 'user';\n if (skill.contextKind === 'global') return 'global';\n if (skill.contextKind === 'project') return 'project';\n\n return 'active';\n};\n\nexport const getSkillListRows = (snapshot: PluginStatusSnapshot): SkillListRow[] => {\n const activeRows = (snapshot.catalog?.skills ?? []).map((skill) => ({\n label: toEffectiveSkillLabel(skill),\n value: compactSkillName(skill),\n }));\n const availableRows = getInstallableNotInstalledSkills(snapshot).map((skill) => ({\n label: 'available',\n value: compactSkillName(skill),\n }));\n const ignoredRows = snapshot.ignoredPublishedSkills.skills.map((skill) => ({\n label: 'ignored',\n value: compactSkillName(skill),\n }));\n const rows = [...activeRows, ...availableRows, ...ignoredRows];\n if (rows.length <= MAX_LISTED_SKILLS) return rows;\n\n return [\n ...rows.slice(0, MAX_LISTED_SKILLS),\n {\n label: 'more',\n value: `${rows.length - MAX_LISTED_SKILLS} hidden · use opencode_wizard_published_skills_fetch`,\n },\n ];\n};\n\nexport const getSkillActionRows = (snapshot: PluginStatusSnapshot): SkillListRow[] => [getUserRoleRow(snapshot)];\n"],"mappings":"AAGA,MAAMA,iBAAiB,GAAG,CAAC;AAE3B,OAAO,MAAMC,gCAAgC,GAAIC,QAA8B,IAA8B;EAC3G,MAAMC,iBAAiB,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KAAM;IAC/EqB,KAAK,EAAE,WAAW;IAClBC,KAAK,EAAEC,gBAAgB,CAACvB,KAAK;EAC/B,CAAC,CAAC,CAAC;EACH,MAAMmC,WAAW,GAAG5C,QAAQ,CAACY,sBAAsB,CAACT,MAAM,CAACK,GAAG,CAAEC,KAAK,KAAM;IACzEqB,KAAK,EAAE,SAAS;IAChBC,KAAK,EAAEC,gBAAgB,CAACvB,KAAK;EAC/B,CAAC,CAAC,CAAC;EACH,MAAMoC,IAAI,GAAG,CAAC,GAAGH,UAAU,EAAE,GAAGC,aAAa,EAAE,GAAGC,WAAW,CAAC;EAC9D,IAAIC,IAAI,CAACzC,MAAM,IAAIN,iBAAiB,EAAE,OAAO+C,IAAI;EAEjD,OAAO,CACL,GAAGA,IAAI,CAACC,KAAK,CAAC,CAAC,EAAEhD,iBAAiB,CAAC,EACnC;IACEgC,KAAK,EAAE,MAAM;IACbC,KAAK,EAAE,GAAGc,IAAI,CAACzC,MAAM,GAAGN,iBAAiB;EAC3C,CAAC,CACF;AACH,CAAC;AAED,OAAO,MAAMiD,kBAAkB,GAAI/C,QAA8B,IAAqB,CAAC6B,cAAc,CAAC7B,QAAQ,CAAC,CAAC","ignoreList":[]}
|
package/dist/tui/slots.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@opentui/solid";
|
|
2
2
|
import { Panel } from './components/common.js';
|
|
3
|
-
import { SkillsRows } from './components/status-content.js';
|
|
3
|
+
import { SidebarSkillsRows, SkillsRows } from './components/status-content.js';
|
|
4
4
|
export const createWizardStatusSlot = (api, status, _refreshStatus) => ({
|
|
5
5
|
order: 240,
|
|
6
6
|
slots: {
|
|
@@ -22,7 +22,7 @@ export const createWizardStatusSlot = (api, status, _refreshStatus) => ({
|
|
|
22
22
|
return api.theme.current;
|
|
23
23
|
},
|
|
24
24
|
get children() {
|
|
25
|
-
return _$createComponent(
|
|
25
|
+
return _$createComponent(SidebarSkillsRows, {
|
|
26
26
|
api: api,
|
|
27
27
|
status: status
|
|
28
28
|
});
|
package/dist/tui/slots.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Panel","SkillsRows","createWizardStatusSlot","api","status","_refreshStatus","order","slots","home_bottom","_$createComponent","title","theme","current","children","sidebar_content","_ctx","_value"],"sources":["../../src/tui/slots.tsx"],"sourcesContent":["import type { RefreshStatus, StatusState, TuiPluginApi, TuiSlotContext, TuiSlotPlugin } from './types.js';\nimport { Panel } from './components/common.js';\nimport { SkillsRows } from './components/status-content.js';\n\nexport const createWizardStatusSlot = (\n api: TuiPluginApi,\n status: () => StatusState,\n _refreshStatus: RefreshStatus,\n): TuiSlotPlugin => ({\n order: 240,\n slots: {\n home_bottom: () => (\n <Panel title=\"Wizard Skills\" theme={api.theme.current}>\n <SkillsRows api={api} status={status} />\n </Panel>\n ),\n sidebar_content: (_ctx: TuiSlotContext, _value: { session_id: string }) => (\n <Panel title=\"Wizard Skills\" theme={api.theme.current}>\n <
|
|
1
|
+
{"version":3,"names":["Panel","SidebarSkillsRows","SkillsRows","createWizardStatusSlot","api","status","_refreshStatus","order","slots","home_bottom","_$createComponent","title","theme","current","children","sidebar_content","_ctx","_value"],"sources":["../../src/tui/slots.tsx"],"sourcesContent":["import type { RefreshStatus, StatusState, TuiPluginApi, TuiSlotContext, TuiSlotPlugin } from './types.js';\nimport { Panel } from './components/common.js';\nimport { SidebarSkillsRows, SkillsRows } from './components/status-content.js';\n\nexport const createWizardStatusSlot = (\n api: TuiPluginApi,\n status: () => StatusState,\n _refreshStatus: RefreshStatus,\n): TuiSlotPlugin => ({\n order: 240,\n slots: {\n home_bottom: () => (\n <Panel title=\"Wizard Skills\" theme={api.theme.current}>\n <SkillsRows api={api} status={status} />\n </Panel>\n ),\n sidebar_content: (_ctx: TuiSlotContext, _value: { session_id: string }) => (\n <Panel title=\"Wizard Skills\" theme={api.theme.current}>\n <SidebarSkillsRows api={api} status={status} />\n </Panel>\n ),\n },\n});\n"],"mappings":";AACA,SAASA,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,iBAAiB,EAAEC,UAAU,QAAQ,gCAAgC;AAE9E,OAAO,MAAMC,sBAAsB,GAAGA,CACpCC,GAAiB,EACjBC,MAAyB,EACzBC,cAA6B,MACV;EACnBC,KAAK,EAAE,GAAG;EACVC,KAAK,EAAE;IACLC,WAAW,EAAEA,CAAA,KAAAC,iBAAA,CACVV,KAAK;MAACW,KAAK;MAAA,IAAiBC,KAAKA,CAAA;QAAA,OAAER,GAAG,CAACQ,KAAK,CAACC,OAAO;MAAA;MAAA,IAAAC,SAAA;QAAA,OAAAJ,iBAAA,CAClDR,UAAU;UAACE,GAAG,EAAEA,GAAG;UAAEC,MAAM,EAAEA;QAAM;MAAA;IAAA,EAEvC;IACDU,eAAe,EAAEA,CAACC,IAAoB,EAAEC,MAA8B,KAAAP,iBAAA,CACnEV,KAAK;MAACW,KAAK;MAAA,IAAiBC,KAAKA,CAAA;QAAA,OAAER,GAAG,CAACQ,KAAK,CAACC,OAAO;MAAA;MAAA,IAAAC,SAAA;QAAA,OAAAJ,iBAAA,CAClDT,iBAAiB;UAACG,GAAG,EAAEA,GAAG;UAAEC,MAAM,EAAEA;QAAM;MAAA;IAAA;EAGjD;AACF,CAAC,CAAC","ignoreList":[]}
|