@sparkelf/dsh-client-ui-skill-center 0.2.0-rc.45 → 0.2.0-rc.46
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/lib/client.js +70 -71
- package/lib/types/client/SkillCenterPage.d.ts +2 -2
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/slot-contract.d.ts +18 -0
- package/package.json +42 -42
- package/LICENSE +0 -21
package/lib/client.js
CHANGED
|
@@ -4,9 +4,9 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
7
|
let react = require("react");
|
|
9
8
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
//#region \0dsh-css:/root/projects/deepseek-harness-plus/packages/plus/ui-skill-center/src/client/SkillCenterPage.module.css.mjs
|
|
11
11
|
const css = ".DGiSta_page{box-sizing:border-box;height:100%;color:var(--dsw-alias-label-primary);flex-direction:column;align-items:center;gap:32px;padding:28px clamp(24px,4vw,48px) 48px;display:flex;overflow:auto}.DGiSta_page>*{width:100%;max-width:960px}.DGiSta_pageHead{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.DGiSta_pageTitle{margin:0;font-size:20px;font-weight:500;line-height:28px}.DGiSta_pageIntro{color:var(--dsw-alias-label-secondary);margin:4px 0 0;font-size:13px;line-height:20px}.DGiSta_toolbar{justify-content:flex-end;align-items:center;gap:16px;display:flex}.DGiSta_iconButton{width:28px;height:28px;color:var(--dsw-alias-label-caption);cursor:pointer;background:0 0;border:0;border-radius:28px;justify-content:center;align-items:center;display:inline-flex}.DGiSta_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.DGiSta_iconButton:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.DGiSta_iconWrap{display:inline-flex}.DGiSta_button{border:.5px solid var(--dsw-alias-border-l3);height:32px;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border-radius:8px;padding:0 12px;font-size:13px}.DGiSta_button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.DGiSta_button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.DGiSta_search{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);width:100%;height:36px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:10px;padding:0 12px;font-size:13px}.DGiSta_search::placeholder{color:var(--dsw-alias-label-tertiary)}.DGiSta_group{margin-top:32px}.DGiSta_groupTitle{align-items:baseline;gap:8px;margin:0 0 4px;font-size:15px;font-weight:500;line-height:22px;display:flex}.DGiSta_groupCount{color:var(--dsw-alias-label-tertiary);font-size:13px;font-weight:400}.DGiSta_groupHint{color:var(--dsw-alias-label-caption);font-size:12px;font-weight:400}.DGiSta_cards{margin:0;padding:0;list-style:none}.DGiSta_card{border-radius:12px;min-width:0;margin:0 -8px}.DGiSta_card:hover{background:var(--dsw-alias-interactive-bg-hover)}.DGiSta_cardHead{align-items:center;gap:14px;padding:8px;display:flex}.DGiSta_cardIcon{border:.5px solid var(--dsw-alias-border-l3);width:48px;height:48px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;justify-content:center;align-items:center;display:inline-flex}.DGiSta_cardForeign{opacity:.72}.DGiSta_cardMain{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.DGiSta_workspaceBadge{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary);vertical-align:middle;border-radius:4px;margin-left:8px;padding:1px 6px;font-size:11px;font-weight:400;line-height:16px}.DGiSta_cardTitle{text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500;line-height:20px;overflow:hidden}.DGiSta_cardDesc{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:13px;line-height:18px;display:-webkit-box;overflow:hidden}.DGiSta_cardWhenToUse{color:var(--dsw-alias-label-caption);font-size:12px;line-height:18px}.DGiSta_cardMarks{flex-wrap:wrap;gap:6px;margin-top:2px;display:flex}.DGiSta_mark{border:.5px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-tertiary);border-radius:4px;padding:1px 6px;font-size:11px;line-height:16px}.DGiSta_markOn{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary)}.DGiSta_markOff{border-color:var(--dsw-alias-border-l4);color:var(--dsw-alias-label-caption)}.DGiSta_markDanger{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}.DGiSta_cardEnd{flex:none;align-items:center;gap:8px;display:flex}.DGiSta_switch{background:var(--dsw-alias-border-l3);cursor:pointer;border:none;border-radius:10px;width:36px;height:20px;transition:background .12s;position:relative}.DGiSta_switch:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.DGiSta_switchOn{background:var(--dsw-alias-state-success-primary)}.DGiSta_switch:after{content:\"\";background:var(--dsw-alias-bg-layer-1);border-radius:50%;width:16px;height:16px;transition:transform .12s;position:absolute;top:2px;left:2px}.DGiSta_switchOn:after{transform:translate(16px)}.DGiSta_dialog{width:min(560px,100%)}.DGiSta_form{flex-direction:column;gap:12px;display:flex}.DGiSta_field{flex-direction:column;gap:4px;display:flex}.DGiSta_fieldLabel{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.DGiSta_input{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);height:32px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:8px;padding:0 10px;font-size:13px}.DGiSta_textarea{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);min-height:80px;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-markdown-code-block-small);resize:vertical;background:0 0;border-radius:8px;padding:8px 10px;font-size:12px}.DGiSta_status{text-align:center;color:var(--dsw-alias-label-tertiary);padding:32px 0;font-size:13px}.DGiSta_statusError{color:var(--dsw-alias-state-error-primary)}";
|
|
12
12
|
const tagId = "@sparkelf/dsh-client-ui-skill-center/SkillCenterPage.module.css";
|
|
@@ -59,7 +59,7 @@ window.__ModuleLoader__.load({
|
|
|
59
59
|
"workspaceBadge": "DGiSta_workspaceBadge"
|
|
60
60
|
};
|
|
61
61
|
//#endregion
|
|
62
|
-
//#region
|
|
62
|
+
//#region src/client/api.ts
|
|
63
63
|
/**
|
|
64
64
|
* Skill center API client. Talks to the host route family over same-origin
|
|
65
65
|
* fetch; the host owns the trust fence.
|
|
@@ -131,7 +131,7 @@ window.__ModuleLoader__.load({
|
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
133
|
//#endregion
|
|
134
|
-
//#region
|
|
134
|
+
//#region src/client/SkillCenterPage.tsx
|
|
135
135
|
/**
|
|
136
136
|
* Skill center page. Browses the loaded skills grouped by source, toggles model
|
|
137
137
|
* invocation, creates a skill, and deletes one into a recoverable trash.
|
|
@@ -147,9 +147,9 @@ window.__ModuleLoader__.load({
|
|
|
147
147
|
* @returns the labelled field.
|
|
148
148
|
*/
|
|
149
149
|
function DraftField({ label, children }) {
|
|
150
|
-
return (0, react_jsx_runtime.jsxs)("div", {
|
|
150
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
151
151
|
className: SkillCenterPage_module_css_default.field,
|
|
152
|
-
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
152
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
153
153
|
className: SkillCenterPage_module_css_default.fieldLabel,
|
|
154
154
|
children: label
|
|
155
155
|
}), children]
|
|
@@ -161,45 +161,45 @@ window.__ModuleLoader__.load({
|
|
|
161
161
|
* @returns the row.
|
|
162
162
|
*/
|
|
163
163
|
function SkillCard({ skill, t, onToggle, onDelete }) {
|
|
164
|
-
return (0, react_jsx_runtime.jsx)("li", {
|
|
164
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
165
165
|
className: skill.isActiveWorkspace === false && skill.workspaceName !== void 0 ? SkillCenterPage_module_css_default.card + " " + SkillCenterPage_module_css_default.cardForeign : SkillCenterPage_module_css_default.card,
|
|
166
|
-
children: (0, react_jsx_runtime.jsxs)("div", {
|
|
166
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
167
167
|
className: SkillCenterPage_module_css_default.cardHead,
|
|
168
168
|
children: [
|
|
169
|
-
(0, react_jsx_runtime.jsx)("span", {
|
|
169
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
170
170
|
className: SkillCenterPage_module_css_default.cardIcon,
|
|
171
|
-
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSkillOutlineRegular, { size: 22 })
|
|
171
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSkillOutlineRegular, { size: 22 })
|
|
172
172
|
}),
|
|
173
|
-
(0, react_jsx_runtime.jsxs)("div", {
|
|
173
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
174
174
|
className: SkillCenterPage_module_css_default.cardMain,
|
|
175
175
|
children: [
|
|
176
|
-
(0, react_jsx_runtime.jsxs)("div", {
|
|
176
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
177
177
|
className: SkillCenterPage_module_css_default.cardTitle,
|
|
178
|
-
children: [skill.name, skill.workspaceName === void 0 ? null : (0, react_jsx_runtime.jsx)("span", {
|
|
178
|
+
children: [skill.name, skill.workspaceName === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
179
179
|
className: SkillCenterPage_module_css_default.workspaceBadge,
|
|
180
180
|
children: skill.workspaceName
|
|
181
181
|
})]
|
|
182
182
|
}),
|
|
183
|
-
(0, react_jsx_runtime.jsx)("div", {
|
|
183
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
184
184
|
className: SkillCenterPage_module_css_default.cardDesc,
|
|
185
185
|
children: skill.description
|
|
186
186
|
}),
|
|
187
|
-
skill.whenToUse === void 0 ? null : (0, react_jsx_runtime.jsx)("div", {
|
|
187
|
+
skill.whenToUse === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
188
188
|
className: SkillCenterPage_module_css_default.cardWhenToUse,
|
|
189
189
|
children: skill.whenToUse
|
|
190
190
|
}),
|
|
191
|
-
(0, react_jsx_runtime.jsxs)("div", {
|
|
191
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
192
192
|
className: SkillCenterPage_module_css_default.cardMarks,
|
|
193
193
|
children: [
|
|
194
|
-
(0, react_jsx_runtime.jsx)("span", {
|
|
194
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
195
195
|
className: skill.modelInvocable ? SkillCenterPage_module_css_default.mark + " " + SkillCenterPage_module_css_default.markOn : SkillCenterPage_module_css_default.mark + " " + SkillCenterPage_module_css_default.markOff,
|
|
196
196
|
children: t("skill.modelInvocable")
|
|
197
197
|
}),
|
|
198
|
-
(0, react_jsx_runtime.jsx)("span", {
|
|
198
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
199
199
|
className: skill.userInvocable ? SkillCenterPage_module_css_default.mark + " " + SkillCenterPage_module_css_default.markOn : SkillCenterPage_module_css_default.mark + " " + SkillCenterPage_module_css_default.markOff,
|
|
200
200
|
children: t("skill.userInvocable")
|
|
201
201
|
}),
|
|
202
|
-
skill.linked === true ? (0, react_jsx_runtime.jsx)("span", {
|
|
202
|
+
skill.linked === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
203
203
|
className: SkillCenterPage_module_css_default.mark + " " + SkillCenterPage_module_css_default.markDanger,
|
|
204
204
|
children: t("skill.linked")
|
|
205
205
|
}) : null
|
|
@@ -207,9 +207,9 @@ window.__ModuleLoader__.load({
|
|
|
207
207
|
})
|
|
208
208
|
]
|
|
209
209
|
}),
|
|
210
|
-
(0, react_jsx_runtime.jsxs)("div", {
|
|
210
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
211
211
|
className: SkillCenterPage_module_css_default.cardEnd,
|
|
212
|
-
children: [(0, react_jsx_runtime.jsx)("button", {
|
|
212
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
213
213
|
type: "button",
|
|
214
214
|
className: skill.modelInvocable ? SkillCenterPage_module_css_default.switch + " " + SkillCenterPage_module_css_default.switchOn : SkillCenterPage_module_css_default.switch,
|
|
215
215
|
"aria-label": skill.modelInvocable ? t("skill.disabled") : t("skill.enabled"),
|
|
@@ -217,7 +217,7 @@ window.__ModuleLoader__.load({
|
|
|
217
217
|
onClick: () => {
|
|
218
218
|
onToggle(skill, !skill.modelInvocable);
|
|
219
219
|
}
|
|
220
|
-
}), skill.path === void 0 || skill.linked === true ? null : (0, react_jsx_runtime.jsx)("button", {
|
|
220
|
+
}), skill.path === void 0 || skill.linked === true ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
221
221
|
type: "button",
|
|
222
222
|
className: SkillCenterPage_module_css_default.button,
|
|
223
223
|
onClick: () => {
|
|
@@ -235,7 +235,7 @@ window.__ModuleLoader__.load({
|
|
|
235
235
|
* @param props - the slot's runtime share: the dictionary resolver and the workspace rows.
|
|
236
236
|
* @returns the rendered panel.
|
|
237
237
|
*/
|
|
238
|
-
function SkillCenterPage({ t, ...runtime }) {
|
|
238
|
+
function SkillCenterPage({ t, renderSlot, ...runtime }) {
|
|
239
239
|
const api = (0, react.useMemo)(() => new SkillApi(), []);
|
|
240
240
|
const [state, setState] = (0, react.useState)({ kind: "loading" });
|
|
241
241
|
const [query, setQuery] = (0, react.useState)("");
|
|
@@ -344,20 +344,20 @@ window.__ModuleLoader__.load({
|
|
|
344
344
|
load
|
|
345
345
|
]);
|
|
346
346
|
const total = state.kind === "ready" ? state.payload.groups.reduce((n, g) => n + g.skills.length, 0) : 0;
|
|
347
|
-
return (0, react_jsx_runtime.jsxs)("div", {
|
|
347
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
348
348
|
className: SkillCenterPage_module_css_default.page,
|
|
349
349
|
children: [
|
|
350
|
-
(0, react_jsx_runtime.jsxs)("header", {
|
|
350
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
351
351
|
className: SkillCenterPage_module_css_default.pageHead,
|
|
352
|
-
children: [(0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("h1", {
|
|
352
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
353
353
|
className: SkillCenterPage_module_css_default.pageTitle,
|
|
354
354
|
children: t("panel")
|
|
355
|
-
}), (0, react_jsx_runtime.jsx)("p", {
|
|
355
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
356
356
|
className: SkillCenterPage_module_css_default.pageIntro,
|
|
357
357
|
children: t("panel.intro")
|
|
358
|
-
})] }), (0, react_jsx_runtime.jsxs)("div", {
|
|
358
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
359
359
|
className: SkillCenterPage_module_css_default.toolbar,
|
|
360
|
-
children: [(0, react_jsx_runtime.jsx)("button", {
|
|
360
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
361
361
|
type: "button",
|
|
362
362
|
className: SkillCenterPage_module_css_default.iconButton,
|
|
363
363
|
"aria-label": t("action.refresh"),
|
|
@@ -365,15 +365,15 @@ window.__ModuleLoader__.load({
|
|
|
365
365
|
onClick: () => {
|
|
366
366
|
load();
|
|
367
367
|
},
|
|
368
|
-
children: (0, react_jsx_runtime.jsx)("span", {
|
|
368
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
369
369
|
className: SkillCenterPage_module_css_default.iconWrap,
|
|
370
370
|
"aria-hidden": "true",
|
|
371
|
-
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, {})
|
|
371
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, {})
|
|
372
372
|
})
|
|
373
|
-
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
373
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
374
374
|
variant: "primary",
|
|
375
375
|
size: "sm",
|
|
376
|
-
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutlineRegular, { size: 13 }),
|
|
376
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutlineRegular, { size: 13 }),
|
|
377
377
|
onClick: () => {
|
|
378
378
|
setCreating((v) => !v);
|
|
379
379
|
},
|
|
@@ -381,7 +381,7 @@ window.__ModuleLoader__.load({
|
|
|
381
381
|
})]
|
|
382
382
|
})]
|
|
383
383
|
}),
|
|
384
|
-
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
384
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
385
385
|
open: creating,
|
|
386
386
|
onClose: () => {
|
|
387
387
|
setCreating(false);
|
|
@@ -389,58 +389,58 @@ window.__ModuleLoader__.load({
|
|
|
389
389
|
title: t("create.title"),
|
|
390
390
|
closeLabel: t("action.cancel"),
|
|
391
391
|
className: SkillCenterPage_module_css_default.dialog,
|
|
392
|
-
footer: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
392
|
+
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
393
393
|
variant: "outline",
|
|
394
394
|
autoFocus: true,
|
|
395
395
|
onClick: () => {
|
|
396
396
|
setCreating(false);
|
|
397
397
|
},
|
|
398
398
|
children: t("action.cancel")
|
|
399
|
-
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
399
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
400
400
|
variant: "primary",
|
|
401
401
|
onClick: () => {
|
|
402
402
|
submit();
|
|
403
403
|
},
|
|
404
404
|
children: t("action.confirm")
|
|
405
405
|
})] }),
|
|
406
|
-
children: (0, react_jsx_runtime.jsxs)("div", {
|
|
406
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
407
407
|
className: SkillCenterPage_module_css_default.form,
|
|
408
408
|
children: [
|
|
409
|
-
(0, react_jsx_runtime.jsx)(DraftField, {
|
|
409
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DraftField, {
|
|
410
410
|
label: t("create.name"),
|
|
411
|
-
children: (0, react_jsx_runtime.jsx)("input", {
|
|
411
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
412
412
|
className: SkillCenterPage_module_css_default.input,
|
|
413
413
|
value: draft.name,
|
|
414
414
|
onChange: set("name")
|
|
415
415
|
})
|
|
416
416
|
}),
|
|
417
|
-
(0, react_jsx_runtime.jsx)(DraftField, {
|
|
417
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DraftField, {
|
|
418
418
|
label: t("create.description"),
|
|
419
|
-
children: (0, react_jsx_runtime.jsx)("input", {
|
|
419
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
420
420
|
className: SkillCenterPage_module_css_default.input,
|
|
421
421
|
value: draft.description,
|
|
422
422
|
onChange: set("description")
|
|
423
423
|
})
|
|
424
424
|
}),
|
|
425
|
-
(0, react_jsx_runtime.jsx)(DraftField, {
|
|
425
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DraftField, {
|
|
426
426
|
label: t("create.whenToUse"),
|
|
427
|
-
children: (0, react_jsx_runtime.jsx)("input", {
|
|
427
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
428
428
|
className: SkillCenterPage_module_css_default.input,
|
|
429
429
|
value: draft.whenToUse,
|
|
430
430
|
onChange: set("whenToUse")
|
|
431
431
|
})
|
|
432
432
|
}),
|
|
433
|
-
(0, react_jsx_runtime.jsx)(DraftField, {
|
|
433
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DraftField, {
|
|
434
434
|
label: t("create.content"),
|
|
435
|
-
children: (0, react_jsx_runtime.jsx)("textarea", {
|
|
435
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
436
436
|
className: SkillCenterPage_module_css_default.textarea,
|
|
437
437
|
value: draft.content,
|
|
438
438
|
onChange: set("content")
|
|
439
439
|
})
|
|
440
440
|
}),
|
|
441
|
-
(0, react_jsx_runtime.jsx)(DraftField, {
|
|
441
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DraftField, {
|
|
442
442
|
label: t("create.root"),
|
|
443
|
-
children: (0, react_jsx_runtime.jsxs)("select", {
|
|
443
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
444
444
|
className: SkillCenterPage_module_css_default.input,
|
|
445
445
|
value: draft.root,
|
|
446
446
|
onChange: (e) => {
|
|
@@ -449,10 +449,10 @@ window.__ModuleLoader__.load({
|
|
|
449
449
|
root: e.target.value === "project" ? "project" : "user"
|
|
450
450
|
}));
|
|
451
451
|
},
|
|
452
|
-
children: [(0, react_jsx_runtime.jsx)("option", {
|
|
452
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
453
453
|
value: "user",
|
|
454
454
|
children: t("create.rootUser")
|
|
455
|
-
}), (0, react_jsx_runtime.jsx)("option", {
|
|
455
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
456
456
|
value: "project",
|
|
457
457
|
children: t("create.rootProject")
|
|
458
458
|
})]
|
|
@@ -461,7 +461,7 @@ window.__ModuleLoader__.load({
|
|
|
461
461
|
]
|
|
462
462
|
})
|
|
463
463
|
}),
|
|
464
|
-
(0, react_jsx_runtime.jsx)("input", {
|
|
464
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
465
465
|
className: SkillCenterPage_module_css_default.search,
|
|
466
466
|
placeholder: t("search.placeholder"),
|
|
467
467
|
value: query,
|
|
@@ -469,11 +469,11 @@ window.__ModuleLoader__.load({
|
|
|
469
469
|
setQuery(e.target.value);
|
|
470
470
|
}
|
|
471
471
|
}),
|
|
472
|
-
state.kind === "loading" ? (0, react_jsx_runtime.jsx)("div", {
|
|
472
|
+
state.kind === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
473
473
|
className: SkillCenterPage_module_css_default.status,
|
|
474
474
|
children: t("state.loading")
|
|
475
475
|
}) : null,
|
|
476
|
-
state.kind === "failed" ? (0, react_jsx_runtime.jsxs)("div", {
|
|
476
|
+
state.kind === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
477
477
|
className: SkillCenterPage_module_css_default.status + " " + SkillCenterPage_module_css_default.statusError,
|
|
478
478
|
children: [
|
|
479
479
|
t("state.failed"),
|
|
@@ -481,32 +481,32 @@ window.__ModuleLoader__.load({
|
|
|
481
481
|
state.message
|
|
482
482
|
]
|
|
483
483
|
}) : null,
|
|
484
|
-
state.kind === "ready" && groups.length === 0 ? (0, react_jsx_runtime.jsx)("div", {
|
|
484
|
+
state.kind === "ready" && groups.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
485
485
|
className: SkillCenterPage_module_css_default.status,
|
|
486
486
|
children: query.trim() === "" ? t("state.empty") : t("search.noMatches")
|
|
487
487
|
}) : null,
|
|
488
|
-
state.kind === "ready" && groups.length > 0 && total === 0 ? (0, react_jsx_runtime.jsx)("div", {
|
|
488
|
+
state.kind === "ready" && groups.length > 0 && total === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
489
489
|
className: SkillCenterPage_module_css_default.status,
|
|
490
490
|
children: t("state.empty")
|
|
491
491
|
}) : null,
|
|
492
|
-
groups.map((group) => (0, react_jsx_runtime.jsxs)("div", {
|
|
492
|
+
groups.map((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
493
493
|
className: SkillCenterPage_module_css_default.group,
|
|
494
|
-
children: [(0, react_jsx_runtime.jsxs)("h2", {
|
|
494
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h2", {
|
|
495
495
|
className: SkillCenterPage_module_css_default.groupTitle,
|
|
496
496
|
children: [
|
|
497
497
|
group.title,
|
|
498
|
-
(0, react_jsx_runtime.jsx)("span", {
|
|
498
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
499
499
|
className: SkillCenterPage_module_css_default.groupCount,
|
|
500
500
|
children: group.skills.length
|
|
501
501
|
}),
|
|
502
|
-
(0, react_jsx_runtime.jsx)("span", {
|
|
502
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
503
503
|
className: SkillCenterPage_module_css_default.groupHint,
|
|
504
504
|
children: group.hint
|
|
505
505
|
})
|
|
506
506
|
]
|
|
507
|
-
}), (0, react_jsx_runtime.jsx)("ul", {
|
|
507
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
508
508
|
className: SkillCenterPage_module_css_default.cards,
|
|
509
|
-
children: group.skills.map((skill) => (0, react_jsx_runtime.jsx)(SkillCard, {
|
|
509
|
+
children: group.skills.map((skill) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SkillCard, {
|
|
510
510
|
skill,
|
|
511
511
|
t,
|
|
512
512
|
onToggle: (s, enabled) => {
|
|
@@ -517,28 +517,23 @@ window.__ModuleLoader__.load({
|
|
|
517
517
|
}
|
|
518
518
|
}, group.key + ":" + skill.name))
|
|
519
519
|
})]
|
|
520
|
-
}, group.key))
|
|
520
|
+
}, group.key)),
|
|
521
|
+
renderSlot("skill-center.section", {})
|
|
521
522
|
]
|
|
522
523
|
});
|
|
523
524
|
}
|
|
524
525
|
//#endregion
|
|
525
|
-
//#region
|
|
526
|
+
//#region src/client/SkillCenterPanelIcon.tsx
|
|
526
527
|
/**
|
|
527
528
|
* Render the glyph at the size the sidebar asks for.
|
|
528
529
|
* @param props - the sidebar's icon share: requested edge and selected state.
|
|
529
530
|
* @returns the icon element.
|
|
530
531
|
*/
|
|
531
532
|
function SkillCenterPanelIcon({ size }) {
|
|
532
|
-
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSkillOutlineRegular, { size });
|
|
533
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSkillOutlineRegular, { size });
|
|
533
534
|
}
|
|
534
535
|
//#endregion
|
|
535
|
-
//#region
|
|
536
|
-
/**
|
|
537
|
-
* Skill center dictionaries. Keys are typed so the panel and the sidebar entry
|
|
538
|
-
* cannot reference a string that does not exist in both languages.
|
|
539
|
-
*
|
|
540
|
-
* @module @sparkelf/dsh-client-ui-skill-center/client/locales
|
|
541
|
-
*/
|
|
536
|
+
//#region src/client/locales.ts
|
|
542
537
|
/** Simplified Chinese dictionary. */
|
|
543
538
|
const zh = {
|
|
544
539
|
"panel": "技能中心",
|
|
@@ -600,7 +595,7 @@ window.__ModuleLoader__.load({
|
|
|
600
595
|
"delete.confirm": "Deleting moves it into .trash, where it can be restored. Delete?"
|
|
601
596
|
};
|
|
602
597
|
//#endregion
|
|
603
|
-
//#region
|
|
598
|
+
//#region src/client/index.ts
|
|
604
599
|
/** Dictionary namespace owned by this plugin. */
|
|
605
600
|
const NS = "skillCenter";
|
|
606
601
|
/** The id shared by the sidebar entry and the main panel it opens. */
|
|
@@ -620,7 +615,11 @@ window.__ModuleLoader__.load({
|
|
|
620
615
|
ctx.slots.inject("main", () => ctx.slots.register({
|
|
621
616
|
name: "main",
|
|
622
617
|
key: PANEL_ID,
|
|
623
|
-
locale: NS
|
|
618
|
+
locale: NS,
|
|
619
|
+
children: { "skill-center.section": {
|
|
620
|
+
kind: "list",
|
|
621
|
+
scope: "root"
|
|
622
|
+
} }
|
|
624
623
|
}, SkillCenterPage));
|
|
625
624
|
ctx.slots.inject("sidebar.panellist", () => ctx.slots.register({
|
|
626
625
|
name: "sidebar.panellist",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module @sparkelf/dsh-client-ui-skill-center/client/SkillCenterPage
|
|
9
9
|
*/
|
|
10
10
|
import { type ReactNode } from 'react';
|
|
11
|
-
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
11
|
+
import type { PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
12
12
|
import type { SkillCenterLocaleKey } from './locales.ts';
|
|
13
13
|
/** What the panel needs from its slot: the dictionary resolver. */
|
|
14
14
|
export interface SkillCenterPageProps {
|
|
@@ -19,5 +19,5 @@ export interface SkillCenterPageProps {
|
|
|
19
19
|
* @param props - the slot's runtime share: the dictionary resolver and the workspace rows.
|
|
20
20
|
* @returns the rendered panel.
|
|
21
21
|
*/
|
|
22
|
-
export declare function SkillCenterPage({ t, ...runtime }: PropsRuntime<'main'> & SkillCenterPageProps): ReactNode;
|
|
22
|
+
export declare function SkillCenterPage({ t, renderSlot, ...runtime }: PropsRuntime<'main'> & PropsRenderSlots<'skill-center.section'> & SkillCenterPageProps): ReactNode;
|
|
23
23
|
//# sourceMappingURL=SkillCenterPage.d.ts.map
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Context } from '@deepseek-ai/cordis';
|
|
10
10
|
import type { MainPanelId } from '@deepseek-ai/dsh-client-ui-layout/client';
|
|
11
|
+
export type { SkillCenterSectionOwnerProps } from './slot-contract.ts';
|
|
11
12
|
import { type SkillCenterLocaleKey } from './locales.ts';
|
|
12
13
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
13
14
|
interface LocaleNamespaceMap {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner props a contributed section receives. The slot passes none today; the type exists so a
|
|
3
|
+
* consumer can name the slot's owner share without importing the page.
|
|
4
|
+
*/
|
|
5
|
+
export interface SkillCenterSectionOwnerProps {
|
|
6
|
+
/** Reserved for an owner share the panel may add; currently empty. */
|
|
7
|
+
readonly reserved?: never;
|
|
8
|
+
}
|
|
9
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
10
|
+
interface SlotMap {
|
|
11
|
+
/** A section contributed to the skill center page, below the skill list. */
|
|
12
|
+
'skill-center.section': {
|
|
13
|
+
kind: 'list';
|
|
14
|
+
scope: 'root';
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=slot-contract.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@sparkelf/dsh-client-ui-skill-center",
|
|
3
|
+
"version": "0.2.0-rc.46",
|
|
2
4
|
"description": "Skill center for the dsh web client: browses loaded skills grouped by source, enables or disables model invocation, creates skills, and deletes them into a recoverable trash",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/plus/ui-skill-center"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./client": {
|
|
22
|
+
"types": "./lib/types/client/index.d.ts",
|
|
23
|
+
"default": "./lib/client.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
18
26
|
},
|
|
19
27
|
"dsh": {
|
|
20
28
|
"client": {
|
|
@@ -25,16 +33,9 @@
|
|
|
25
33
|
"platform": "web"
|
|
26
34
|
}
|
|
27
35
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"types": "./lib/types/index.d.ts"
|
|
32
|
-
},
|
|
33
|
-
"./client": {
|
|
34
|
-
"default": "./lib/client.js",
|
|
35
|
-
"types": "./lib/types/client/index.d.ts"
|
|
36
|
-
},
|
|
37
|
-
"./package.json": "./package.json"
|
|
36
|
+
"scripts": {
|
|
37
|
+
"bundle": "tsdown",
|
|
38
|
+
"watch": "tsdown --watch"
|
|
38
39
|
},
|
|
39
40
|
"files": [
|
|
40
41
|
"lib/index.js",
|
|
@@ -42,24 +43,23 @@
|
|
|
42
43
|
"lib/types/**/*.d.ts"
|
|
43
44
|
],
|
|
44
45
|
"license": "MIT",
|
|
45
|
-
"main": "lib/index.js",
|
|
46
|
-
"name": "@sparkelf/dsh-client-ui-skill-center",
|
|
47
46
|
"peerDependencies": {
|
|
48
47
|
"@deepseek-ai/cordis": ">=4.0.1"
|
|
49
48
|
},
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@deepseek-ai/cordis": "workspace:^",
|
|
51
|
+
"@deepseek-ai/dsh-client-locale": "workspace:^",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-layout": "workspace:^",
|
|
53
|
+
"@deepseek-ai/dsh-client-ui-primitives": "workspace:^",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-renderer": "workspace:^",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "workspace:^",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-slots": "workspace:^",
|
|
57
|
+
"@deepseek-ai/dsh-host-webserver": "workspace:^",
|
|
58
|
+
"@deepseek-ai/dsh-session": "workspace:^",
|
|
59
|
+
"@deepseek-ai/dsh-skill": "workspace:^",
|
|
60
|
+
"@types/react": "~18.3.1",
|
|
61
|
+
"@types/react-dom": "~18.3.0",
|
|
62
|
+
"react": "^18.2.0",
|
|
63
|
+
"react-dom": "^18.2.0"
|
|
64
|
+
}
|
|
65
65
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 DeepSeek
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|