@cannbot-plugin/cannbot-harness 0.3.0 → 0.3.1
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 +9 -15
- package/lib/client.js.map +1 -1
- package/lib/index.js +156 -6
- package/package.json +2 -1
- package/runtime/initializer-compat.cjs +25 -0
package/lib/client.js
CHANGED
|
@@ -341,7 +341,7 @@ window.__ModuleLoader__.load({
|
|
|
341
341
|
body: JSON.stringify(body)
|
|
342
342
|
})).ok) {
|
|
343
343
|
await pull();
|
|
344
|
-
throw new Error(
|
|
344
|
+
throw new Error(state.status?.message || "工作流准备失败,请检查插件日志。");
|
|
345
345
|
}
|
|
346
346
|
await pull();
|
|
347
347
|
};
|
|
@@ -730,7 +730,8 @@ window.__ModuleLoader__.load({
|
|
|
730
730
|
...snapshot,
|
|
731
731
|
pending: true,
|
|
732
732
|
error: false,
|
|
733
|
-
errorKind: void 0
|
|
733
|
+
errorKind: void 0,
|
|
734
|
+
errorMessage: void 0
|
|
734
735
|
});
|
|
735
736
|
let stage = "prepare";
|
|
736
737
|
try {
|
|
@@ -753,12 +754,13 @@ window.__ModuleLoader__.load({
|
|
|
753
754
|
error: false,
|
|
754
755
|
values: valuesOf(result)
|
|
755
756
|
});
|
|
756
|
-
} catch {
|
|
757
|
+
} catch (error) {
|
|
757
758
|
if (own === generation) publish({
|
|
758
759
|
...snapshot,
|
|
759
760
|
pending: false,
|
|
760
761
|
error: true,
|
|
761
|
-
errorKind: stage
|
|
762
|
+
errorKind: stage,
|
|
763
|
+
errorMessage: error instanceof Error ? error.message : void 0
|
|
762
764
|
});
|
|
763
765
|
} finally {
|
|
764
766
|
release();
|
|
@@ -1398,7 +1400,7 @@ window.__ModuleLoader__.load({
|
|
|
1398
1400
|
await selection.choose(id, request.workflow);
|
|
1399
1401
|
signal.throwIfAborted();
|
|
1400
1402
|
const saved = selection.getSnapshot();
|
|
1401
|
-
if (!saved.ready || saved.pending || saved.error || (saved.values[id] ?? "") !== request.workflow) throw new Error("工作流准备未完成,请在插件设置中查看日志后重试。");
|
|
1403
|
+
if (!saved.ready || saved.pending || saved.error || (saved.values[id] ?? "") !== request.workflow) throw new Error(saved.errorMessage || "工作流准备未完成,请在插件设置中查看日志后重试。");
|
|
1402
1404
|
if (conversation.blocks.storeFor(id).getSnapshot()) throw new Error("当前对话暂时不能发送,请稍后重试。");
|
|
1403
1405
|
const input = conversation.input.for(binding.ctx);
|
|
1404
1406
|
if (conversation.input.requestDraftInitialization(binding, {
|
|
@@ -1453,7 +1455,7 @@ window.__ModuleLoader__.load({
|
|
|
1453
1455
|
const copy = (workflow) => workflowCopy(workflow, (key) => zh[key]);
|
|
1454
1456
|
function Workbench({ ctx, content, selection, store, library = false }) {
|
|
1455
1457
|
const state = (0, react.useSyncExternalStore)(store.subscribe, store.getSnapshot);
|
|
1456
|
-
const { workflows
|
|
1458
|
+
const { workflows } = (0, react.useSyncExternalStore)(content.subscribe, content.getSnapshot);
|
|
1457
1459
|
const workspaceSource = ctx.workspaces.list;
|
|
1458
1460
|
const workspaceBinding = (0, react.useMemo)(() => ({
|
|
1459
1461
|
subscribe: (listener) => workspaceSource.subscribe(listener),
|
|
@@ -1847,14 +1849,6 @@ window.__ModuleLoader__.load({
|
|
|
1847
1849
|
})]
|
|
1848
1850
|
})
|
|
1849
1851
|
]
|
|
1850
|
-
}),
|
|
1851
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
|
|
1852
|
-
className: "cwb-footer",
|
|
1853
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: status?.phase === "syncing" ? "正在准备工作流包…" : status?.phase === "error" ? "工作流准备异常,请查看插件设置。" : "工作流内容可独立更新" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1854
|
-
className: "cwb-text-button",
|
|
1855
|
-
onClick: settings,
|
|
1856
|
-
children: "查看插件设置 ↗"
|
|
1857
|
-
})]
|
|
1858
1852
|
})
|
|
1859
1853
|
]
|
|
1860
1854
|
})]
|
|
@@ -1967,7 +1961,7 @@ window.__ModuleLoader__.load({
|
|
|
1967
1961
|
}
|
|
1968
1962
|
//#endregion
|
|
1969
1963
|
//#region \0dsh-global-css:D:\code\cannbot-harness-plugin\src\client\workbench.css.mjs
|
|
1970
|
-
const css = ".cannbot-workbench{--cwb-ink:var(--dsw-alias-label-primary,#17181d);--cwb-muted:var(--dsw-alias-label-secondary,#677185);--cwb-surface:var(--dsw-alias-bg-layer-1,#fff);--cwb-border:var(--dsw-alias-border-l2,#e2e5eb);--cwb-soft:var(--dsw-alias-bg-layer-3,#f6f8fa);--cwb-accent:var(--dsw-alias-state-business-primary,#da203e);--cwb-selected:var(--dsw-alias-state-business-tertiary,#fdeef0);color:var(--cwb-ink);background:var(--cwb-surface);height:100%;font-family:inherit;font-size:14px;overflow:auto}.cannbot-workbench *,.cannbot-workbench :before,.cannbot-workbench :after{box-sizing:border-box}.cannbot-workbench button,.cannbot-workbench input,.cannbot-workbench select,.cannbot-workbench textarea{font:inherit}.cannbot-workbench button{cursor:pointer}.cannbot-workbench button:disabled{opacity:.5;cursor:default}.cannbot-workbench :is(button,input,select,textarea):focus-visible{outline:2px solid var(--cwb-accent);outline-offset:3px}.cwb-header{border-bottom:1px solid var(--cwb-border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;min-height:62px;padding:12px 30px;display:flex}.cwb-workspace{flex-wrap:wrap;align-items:center;gap:12px;min-width:0;display:flex}.cwb-workspace-info{min-width:0}.cwb-workspace-choice{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.cwb-inherited{color:var(--cwb-muted);background:var(--cwb-soft);border-radius:5px;padding:3px 7px;font-size:11px}.cwb-workspace-path{text-overflow:ellipsis;white-space:nowrap;max-width:min(52vw,560px);color:var(--cwb-muted);padding-left:6px;font-size:12px;line-height:1.5;display:block;overflow:hidden}.cwb-workspace select{background:var(--cwb-surface);max-width:300px;color:var(--cwb-ink);border:0;padding:6px}.cwb-content{max-width:1260px;margin:0 auto;padding:26px 32px 22px}.cwb-heading{margin-bottom:20px}.cwb-heading h1{letter-spacing:-.5px;margin:0 0 8px;font-size:28px;font-weight:650;line-height:1.3}.cwb-heading p{color:var(--cwb-muted);margin:0;font-size:15px;line-height:1.6}.cwb-text-button{color:var(--cwb-muted);text-align:start;background:0 0;border:0;align-items:center;gap:7px;padding:5px 2px;display:inline-flex}.cwb-text-button:hover:not(:disabled){color:var(--cwb-accent)}.cwb-composer{background:var(--cwb-surface);border:1px solid var(--cwb-border);border-radius:14px;padding:18px 20px 14px;box-shadow:0 5px 20px #17213b05}.cwb-composer:focus-within{border-color:var(--cwb-accent)}.cwb-composer textarea{resize:vertical;width:100%;min-height:72px;max-height:340px;color:var(--cwb-ink);background:0 0;border:0;outline:0;padding:0;font-size:15px;line-height:1.65;display:block}.cwb-composer textarea:focus-visible{outline:0}.cwb-composer textarea::placeholder{color:var(--cwb-muted)}.cwb-composer-actions,.cwb-composer-tools{flex-wrap:wrap;align-items:center;gap:16px;min-width:0;display:flex}.cwb-composer-actions{justify-content:space-between;margin-top:12px}.cwb-primary{color:#fff;white-space:nowrap;background:#da203e;border:1px solid #d91d3e;border-radius:9px;justify-content:center;align-items:center;gap:22px;min-height:42px;padding:10px 22px;font-weight:550;display:inline-flex}.cwb-primary:hover:not(:disabled){background:#b11430}.cwb-selection{color:var(--cwb-accent);background:var(--cwb-selected);border-radius:7px;align-items:center;gap:8px;min-width:0;max-width:100%;padding:6px 9px;font-size:12px;display:inline-flex}.cwb-selection>span{overflow-wrap:anywhere}.cwb-selection button,.cwb-files button{color:inherit;background:0 0;border:0;padding:0 4px;font-size:18px}.cwb-files{flex-wrap:wrap;gap:8px;margin:0;padding:10px 0;list-style:none;display:flex}.cwb-files li{border:1px solid var(--cwb-border);border-radius:6px;align-items:center;gap:6px;max-width:250px;padding:3px 6px;display:inline-flex}.cwb-files li span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.cwb-hint{color:var(--cwb-muted);margin:10px 0 0;font-size:12px;line-height:1.6}.cwb-error{border-left:3px solid var(--cwb-accent);background:var(--cwb-selected);color:var(--cwb-ink);padding:12px 14px;line-height:1.6}.cwb-error-heading{justify-content:space-between;align-items:center;gap:12px;display:flex}.cwb-error .cwb-text-button{color:var(--cwb-accent)}.cwb-error summary{cursor:pointer;color:var(--cwb-muted);font-size:12px}.cwb-error details p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.cwb-catalog-heading{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin:26px 0 6px;display:flex}.cwb-catalog-heading h2{margin:0;font-size:20px;font-weight:600}.cwb-search{border:1px solid var(--cwb-border);color:var(--cwb-muted);border-radius:8px;align-items:center;gap:9px;padding:8px 11px;display:flex}.cwb-search input{width:170px;color:var(--cwb-ink);background:0 0;border:0;outline:0;font-size:13px}.cwb-categories{border-bottom:1px solid var(--cwb-border);gap:22px;margin-bottom:18px;display:flex;overflow-x:auto}.cwb-categories button{color:var(--cwb-muted);white-space:nowrap;background:0 0;border:0;border-bottom:2px solid #0000;padding:12px 3px}.cwb-categories button[aria-pressed=true]{border-bottom-color:var(--cwb-accent);color:var(--cwb-accent);font-weight:550}.cwb-grid{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:10px;display:grid}.cwb-card{text-align:start;border:1px solid var(--cwb-border);width:100%;min-height:96px;color:var(--cwb-ink);background:var(--cwb-surface);border-radius:9px;grid-template-columns:28px minmax(0,1fr) 18px;align-items:start;gap:10px;padding:14px;transition:border-color .15s,background .15s;display:grid}.cwb-card:hover:not(:disabled){border-color:var(--cwb-accent)}.cwb-card[aria-pressed=true]{border-color:var(--cwb-accent);background:var(--cwb-selected)}.cwb-card-icon{background:var(--cwb-selected);width:40px;height:40px;color:var(--cwb-accent);border-radius:9px;flex:none;justify-content:center;align-items:center;display:inline-flex}.cwb-card .cwb-card-icon{border-radius:6px;width:28px;height:28px}.cwb-card .cwb-card-icon svg{width:19px;height:19px}.cwb-card-copy{flex-direction:column;gap:5px;min-width:0;padding-top:3px;display:flex}.cwb-card-copy strong{overflow-wrap:anywhere;font-size:14px;font-weight:600;line-height:1.4}.cwb-card-copy>span{color:var(--cwb-muted);font-size:12px;line-height:1.55}.cwb-card-corner{width:18px;height:18px;color:var(--cwb-muted);background:0 0;border:0;justify-content:center;align-items:center;margin-top:3px;display:inline-flex}.cwb-card-corner svg{flex:none;display:block}.cwb-
|
|
1964
|
+
const css = ".cannbot-workbench{--cwb-ink:var(--dsw-alias-label-primary,#17181d);--cwb-muted:var(--dsw-alias-label-secondary,#677185);--cwb-surface:var(--dsw-alias-bg-layer-1,#fff);--cwb-border:var(--dsw-alias-border-l2,#e2e5eb);--cwb-soft:var(--dsw-alias-bg-layer-3,#f6f8fa);--cwb-accent:var(--dsw-alias-state-business-primary,#da203e);--cwb-selected:var(--dsw-alias-state-business-tertiary,#fdeef0);color:var(--cwb-ink);background:var(--cwb-surface);height:100%;font-family:inherit;font-size:14px;overflow:auto}.cannbot-workbench *,.cannbot-workbench :before,.cannbot-workbench :after{box-sizing:border-box}.cannbot-workbench button,.cannbot-workbench input,.cannbot-workbench select,.cannbot-workbench textarea{font:inherit}.cannbot-workbench button{cursor:pointer}.cannbot-workbench button:disabled{opacity:.5;cursor:default}.cannbot-workbench :is(button,input,select,textarea):focus-visible{outline:2px solid var(--cwb-accent);outline-offset:3px}.cwb-header{border-bottom:1px solid var(--cwb-border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;min-height:62px;padding:12px 30px;display:flex}.cwb-workspace{flex-wrap:wrap;align-items:center;gap:12px;min-width:0;display:flex}.cwb-workspace-info{min-width:0}.cwb-workspace-choice{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.cwb-inherited{color:var(--cwb-muted);background:var(--cwb-soft);border-radius:5px;padding:3px 7px;font-size:11px}.cwb-workspace-path{text-overflow:ellipsis;white-space:nowrap;max-width:min(52vw,560px);color:var(--cwb-muted);padding-left:6px;font-size:12px;line-height:1.5;display:block;overflow:hidden}.cwb-workspace select{background:var(--cwb-surface);max-width:300px;color:var(--cwb-ink);border:0;padding:6px}.cwb-content{max-width:1260px;margin:0 auto;padding:26px 32px 22px}.cwb-heading{margin-bottom:20px}.cwb-heading h1{letter-spacing:-.5px;margin:0 0 8px;font-size:28px;font-weight:650;line-height:1.3}.cwb-heading p{color:var(--cwb-muted);margin:0;font-size:15px;line-height:1.6}.cwb-text-button{color:var(--cwb-muted);text-align:start;background:0 0;border:0;align-items:center;gap:7px;padding:5px 2px;display:inline-flex}.cwb-text-button:hover:not(:disabled){color:var(--cwb-accent)}.cwb-composer{background:var(--cwb-surface);border:1px solid var(--cwb-border);border-radius:14px;padding:18px 20px 14px;box-shadow:0 5px 20px #17213b05}.cwb-composer:focus-within{border-color:var(--cwb-accent)}.cwb-composer textarea{resize:vertical;width:100%;min-height:72px;max-height:340px;color:var(--cwb-ink);background:0 0;border:0;outline:0;padding:0;font-size:15px;line-height:1.65;display:block}.cwb-composer textarea:focus-visible{outline:0}.cwb-composer textarea::placeholder{color:var(--cwb-muted)}.cwb-composer-actions,.cwb-composer-tools{flex-wrap:wrap;align-items:center;gap:16px;min-width:0;display:flex}.cwb-composer-actions{justify-content:space-between;margin-top:12px}.cwb-primary{color:#fff;white-space:nowrap;background:#da203e;border:1px solid #d91d3e;border-radius:9px;justify-content:center;align-items:center;gap:22px;min-height:42px;padding:10px 22px;font-weight:550;display:inline-flex}.cwb-primary:hover:not(:disabled){background:#b11430}.cwb-selection{color:var(--cwb-accent);background:var(--cwb-selected);border-radius:7px;align-items:center;gap:8px;min-width:0;max-width:100%;padding:6px 9px;font-size:12px;display:inline-flex}.cwb-selection>span{overflow-wrap:anywhere}.cwb-selection button,.cwb-files button{color:inherit;background:0 0;border:0;padding:0 4px;font-size:18px}.cwb-files{flex-wrap:wrap;gap:8px;margin:0;padding:10px 0;list-style:none;display:flex}.cwb-files li{border:1px solid var(--cwb-border);border-radius:6px;align-items:center;gap:6px;max-width:250px;padding:3px 6px;display:inline-flex}.cwb-files li span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.cwb-hint{color:var(--cwb-muted);margin:10px 0 0;font-size:12px;line-height:1.6}.cwb-error{border-left:3px solid var(--cwb-accent);background:var(--cwb-selected);color:var(--cwb-ink);padding:12px 14px;line-height:1.6}.cwb-error-heading{justify-content:space-between;align-items:center;gap:12px;display:flex}.cwb-error .cwb-text-button{color:var(--cwb-accent)}.cwb-error summary{cursor:pointer;color:var(--cwb-muted);font-size:12px}.cwb-error details p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.cwb-catalog-heading{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin:26px 0 6px;display:flex}.cwb-catalog-heading h2{margin:0;font-size:20px;font-weight:600}.cwb-search{border:1px solid var(--cwb-border);color:var(--cwb-muted);border-radius:8px;align-items:center;gap:9px;padding:8px 11px;display:flex}.cwb-search input{width:170px;color:var(--cwb-ink);background:0 0;border:0;outline:0;font-size:13px}.cwb-categories{border-bottom:1px solid var(--cwb-border);gap:22px;margin-bottom:18px;display:flex;overflow-x:auto}.cwb-categories button{color:var(--cwb-muted);white-space:nowrap;background:0 0;border:0;border-bottom:2px solid #0000;padding:12px 3px}.cwb-categories button[aria-pressed=true]{border-bottom-color:var(--cwb-accent);color:var(--cwb-accent);font-weight:550}.cwb-grid{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:10px;display:grid}.cwb-card{text-align:start;border:1px solid var(--cwb-border);width:100%;min-height:96px;color:var(--cwb-ink);background:var(--cwb-surface);border-radius:9px;grid-template-columns:28px minmax(0,1fr) 18px;align-items:start;gap:10px;padding:14px;transition:border-color .15s,background .15s;display:grid}.cwb-card:hover:not(:disabled){border-color:var(--cwb-accent)}.cwb-card[aria-pressed=true]{border-color:var(--cwb-accent);background:var(--cwb-selected)}.cwb-card-icon{background:var(--cwb-selected);width:40px;height:40px;color:var(--cwb-accent);border-radius:9px;flex:none;justify-content:center;align-items:center;display:inline-flex}.cwb-card .cwb-card-icon{border-radius:6px;width:28px;height:28px}.cwb-card .cwb-card-icon svg{width:19px;height:19px}.cwb-card-copy{flex-direction:column;gap:5px;min-width:0;padding-top:3px;display:flex}.cwb-card-copy strong{overflow-wrap:anywhere;font-size:14px;font-weight:600;line-height:1.4}.cwb-card-copy>span{color:var(--cwb-muted);font-size:12px;line-height:1.55}.cwb-card-corner{width:18px;height:18px;color:var(--cwb-muted);background:0 0;border:0;justify-content:center;align-items:center;margin-top:3px;display:inline-flex}.cwb-card-corner svg{flex:none;display:block}.cwb-empty{color:var(--cwb-muted);padding:20px 0;line-height:1.7}.cwb-library{border:1px solid var(--cwb-border);border-radius:12px;grid-template-columns:minmax(220px,.85fr) minmax(0,2fr);display:grid;overflow:hidden}.cwb-library-list{background:var(--cwb-soft);border-right:1px solid var(--cwb-border);padding:10px}.cwb-library-list button{text-align:start;width:100%;color:var(--cwb-ink);background:0 0;border:1px solid #0000;border-radius:8px;gap:12px;padding:14px 12px;display:flex}.cwb-library-list button[aria-current=true]{border-color:var(--cwb-border);background:var(--cwb-surface)}.cwb-library-list button[aria-current=true]>svg{color:var(--cwb-accent)}.cwb-library-list button>svg{flex:none;margin-top:2px}.cwb-library-list button span{min-width:0}.cwb-library-list strong{overflow-wrap:anywhere;font-size:13px;font-weight:550;line-height:1.5;display:block}.cwb-library-list small{color:var(--cwb-muted);margin-top:5px;font-size:12px;line-height:1.6;display:block}.cwb-detail{min-width:0;padding:28px 30px}.cwb-detail-title{align-items:center;gap:14px;display:flex}.cwb-detail-title small{color:var(--cwb-muted);font-size:12px}.cwb-detail-title h2{overflow-wrap:anywhere;margin:5px 0 0;font-size:21px;line-height:1.4}.cwb-detail-summary{color:var(--cwb-muted);margin:17px 0 20px;line-height:1.7}.cwb-guide-sections{grid-template-columns:1fr;gap:18px;margin-top:28px;display:grid}.cwb-detail h3{margin:0 0 9px;font-size:14px;font-weight:600}.cwb-guide-sections ul{color:var(--cwb-muted);margin:0;padding-left:18px;font-size:13px;line-height:1.9}.cwb-example{border:1px solid var(--cwb-border);background:var(--cwb-soft);border-radius:9px;margin-top:24px;padding:18px}.cwb-example p{color:var(--cwb-muted);margin:8px 0;font-size:13px;line-height:1.8}.cwb-example .cwb-text-button{color:var(--cwb-accent)}.cwb-example small{color:var(--cwb-muted);margin-top:6px;font-size:11px;display:block}.cwb-version{border-top:1px solid var(--cwb-border);color:var(--cwb-muted);margin-top:24px;padding-top:18px;font-size:12px;line-height:1.8}.cwb-version summary{cursor:pointer}.cwb-version-actions{flex-wrap:wrap;gap:15px;display:flex}.cannbot-workbench{container:cwb/inline-size}@container cwb (width<=900px){.cwb-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@container cwb (width<=590px){.cwb-grid{grid-template-columns:1fr}}@media (width<=1120px){.cwb-content{padding:24px}.cwb-library{grid-template-columns:minmax(190px,.9fr) minmax(0,1.6fr)}.cwb-detail{padding:22px}}@media (width<=700px){.cwb-header{padding:12px 16px}.cwb-content{padding:22px 16px}.cwb-heading h1{font-size:25px}.cwb-grid,.cwb-library{grid-template-columns:1fr}.cwb-library-list{border-right:0;border-bottom:1px solid var(--cwb-border);max-height:220px;overflow:auto}.cwb-composer{padding:15px}.cwb-workspace select{max-width:190px}.cwb-composer-tools{gap:8px}.cwb-composer-actions{align-items:end}.cwb-primary{padding:9px 17px}.cwb-search,.cwb-search input{width:100%}}@media (prefers-reduced-motion:reduce){.cwb-card{transition:none}}";
|
|
1971
1965
|
const tagId = "@cannbot-plugin/cannbot-harness/workbench.css";
|
|
1972
1966
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
1973
1967
|
const tag = document.createElement("style");
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["primitives","primitives","LegacyMenu","unwrap","raw","Fragment","interfaceCss"],"sources":["../src/client/locales.ts","../src/client/Brand.tsx","../src/workflows.ts","../src/client/workflow-copy.ts","../src/client/WorkflowIcon.tsx","../src/content-types.ts","../src/client/content-store.ts","../src/client/WorkflowSelector.tsx","../src/client/WorkflowCompat.tsx","../src/client/theme.ts","../src/client/InterfaceToggle.tsx","../src/client/presentation.ts","../src/client/slot-compat.ts","../src/client/workflow-selection.ts","../src/client/plugin-update.ts","../src/client/PluginUpdateCard.tsx","../src/client/host-update.ts","../src/client/ContentCard.tsx","../src/client/register-updates.ts","../src/client/workbench-state.ts","../src/client/workbench-data.ts","../src/client/workbench-workspace.ts","../src/client/WorkbenchIcon.tsx","../src/client/workbench-launch.ts","../src/client/Workbench.tsx","../src/client/register-workbench.ts","../src/client/index.ts"],"sourcesContent":["export const PRODUCT = 'CANNBot Harness'\nexport const NAMESPACE = 'cannbotHarness'\nexport const PACKAGE = '@cannbot-plugin/cannbot-harness'\nexport const COMMAND = '/ops-direct-invoke'\n\nexport const zh = {\n contentCatalog: '工作流目录', contentCheck: '检查工作流更新', contentVersion: '当前版本', contentLatest: '最新版本', contentPinned: '已固定回退版本',\n contentInstall: '安装', contentUpdate: '更新', contentRollback: '回退到', contentUpToDate: '已是最新', contentUnchecked: '已安装,可使用', contentNotInstalled: '未安装', contentUnavailable: '暂不可用',\n contentTitle: '工作流管理', contentSync: '更新全部工作流', contentBusy: '正在准备…', contentDownloading: '正在从 npm 获取独立工作流包…',\n contentInitializing: '正在执行官方安装器,准备工作区依赖…', contentReady: '工作流已准备完成,可独立更新。选择工作流时自动准备当前工作区。',\n contentFailed: '准备未完成。已有工作流版本保留;请查看日志后重试。', contentFallback: '正在准备首次安装的工作流包。', contentWorkflows: '个已安装工作流', contentLogs: '查看准备日志',\n updateBackground: '后台正在更新,请勿重复安装。', updateRestored: '更新失败,已恢复旧版。',\n updateRepair: '更新和恢复未完成,请在插件页重新安装原版本。', updateConnectionLost: '连接中断,后台更新可能仍在进行。请重新打开插件页确认版本,勿重复安装。', updateDismiss: '关闭更新提示',\n updateTitle: '版本更新', updateCurrent: '当前版本', updateCheck: '检查更新', updateChecking: '正在检查…',\n updateTo: '更新到', updateRunning: '正在更新…', updateAvailable: '发现新版本,点击上方按钮更新。',\n updateLatest: '当前已是最新版本。', updateDone: '更新已完成。', updateRestart: '新版已安装,重启 DSH 后生效。',\n updateManual: '当前 DSH 要求先卸载旧版。请先下载新版包,再在插件页卸载旧版并添加下载的安装包。',\n updateIncompatible: '当前 DSH 不支持此版本,请先升级 DSH。', updateFailed: '暂时无法完成,请稍后重试。', updateDownload: '下载新版安装包',\n workflow: '选择工作流', ordinary: '普通对话', saving: '正在应用工作流…', operator: 'ops-direct-invoke', commandHint: '发送时自动应用所选工作流,只需填写需求。',\n flash: 'ops-direct-invoke-flash', registry: 'ops-registry-invoke', model: 'model-infer-optimize',\n hccl: 'hccl-op-generator', triton: 'triton-op-generator', catlass: 'catlass-op-generator', performance: 'ops-perf-optimize', pypto: 'pypto-op-orchestrator',\n operatorDescription: '开发 Ascend C 算子,通过直调方式接入使用。',\n flashDescription: '快速生成并验证 Ascend C 算子。',\n registryDescription: '开发 Ascend C 注册算子,通过 ACLNN / GEIR 接入框架。',\n modelDescription: '将模型迁移到 NPU,完成精度对齐与推理性能优化。',\n hcclDescription: '开发 HCCL AICPU 通信算子,协同完成代码生成与验证。',\n tritonDescription: '生成并优化 Triton-Ascend 算子代码。',\n catlassDescription: '基于 CATLASS 模板开发矩阵计算、注意力等算子,验证精度与性能。',\n performanceDescription: '分析并优化 Ascend C 算子性能,验证精度并检查性能退化。',\n pyptoDescription: '开发并调优 PyPTO 算子,也支持对已有算子单独调优。',\n chooseWorkspace: '请先选择工作目录。', insertFailed: '工作流准备或设置未完成,请到插件详情查看准备日志后重试。', settingsRetry: '设置连接失败,重试', workflowRetry: '工作流未就绪,重试',\n}\nexport const en: typeof zh = {\n contentCatalog: 'Workflow catalog', contentCheck: 'Check workflow updates', contentVersion: 'Installed', contentLatest: 'Latest', contentPinned: 'Rolled-back version pinned',\n contentInstall: 'Install', contentUpdate: 'Update', contentRollback: 'Roll back to', contentUpToDate: 'Up to date', contentUnchecked: 'Installed and ready', contentNotInstalled: 'Not installed', contentUnavailable: 'Unavailable',\n contentTitle: 'Workflow manager', contentSync: 'Update all workflows', contentBusy: 'Preparing…', contentDownloading: 'Fetching independent workflow packages from npm…',\n contentInitializing: 'Running the official installer to prepare workspace dependencies…', contentReady: 'Workflows are ready and can be updated independently. Selecting one prepares this workspace automatically.',\n contentFailed: 'Preparation did not finish. Existing workflow versions are retained; check the log and retry.', contentFallback: 'Preparing the first workflow package installation.', contentWorkflows: 'installed workflows', contentLogs: 'View preparation log',\n updateBackground: 'Updating in the background. Do not install again.', updateRestored: 'Update failed; the previous version was restored.',\n updateRepair: 'Update and recovery did not finish. Reinstall the previous version from Plugins.', updateConnectionLost: 'Connection lost. The Host may still be updating. Reopen Plugins to check the version before retrying.', updateDismiss: 'Dismiss update notice',\n updateTitle: 'Updates', updateCurrent: 'Installed version', updateCheck: 'Check for updates', updateChecking: 'Checking…',\n updateTo: 'Update to', updateRunning: 'Updating…', updateAvailable: 'A new version is available. Use the button above to update.',\n updateLatest: 'You are up to date.', updateDone: 'Update completed.', updateRestart: 'The update is installed. Restart DSH to apply it.',\n updateManual: 'This DSH version requires removing the old plugin first. Download the update, then uninstall the old plugin and add the downloaded package.',\n updateIncompatible: 'This release requires updating DSH first.', updateFailed: 'Unable to complete this operation. Please retry.', updateDownload: 'Download update',\n workflow: 'Choose workflow', ordinary: 'Ordinary conversation', saving: 'Applying workflow…', operator: 'ops-direct-invoke', commandHint: 'The selected workflow is applied in the background when you send.',\n flash: 'ops-direct-invoke-flash', registry: 'ops-registry-invoke', model: 'model-infer-optimize',\n hccl: 'hccl-op-generator', triton: 'triton-op-generator', catlass: 'catlass-op-generator', performance: 'ops-perf-optimize', pypto: 'pypto-op-orchestrator',\n operatorDescription: 'Develop Ascend C operators and integrate them through direct invocation.',\n flashDescription: 'Quickly generate and validate Ascend C operators.',\n registryDescription: 'Develop registered Ascend C operators for framework integration through ACLNN / GEIR.',\n modelDescription: 'Migrate models to NPU, align accuracy and optimize inference performance.',\n hcclDescription: 'Develop HCCL AICPU communication operators with coordinated code generation and validation.',\n tritonDescription: 'Generate and optimize Triton-Ascend operator code.',\n catlassDescription: 'Build matrix and attention operators using CATLASS templates; validate accuracy and performance.',\n performanceDescription: 'Analyze and optimize Ascend C operator performance, checking accuracy and regressions.',\n pyptoDescription: 'Develop and tune PyPTO operators, or tune existing operators independently.',\n chooseWorkspace: 'Choose a working directory first.', insertFailed: 'Workflow preparation or saving failed. Check preparation logs in the plugin details and retry.', settingsRetry: 'Reconnect settings', workflowRetry: 'Retry workflow',\n}\nexport type LocaleKey = keyof typeof zh\n","import type { HeroBrandMarkOwnerProps } from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type { SidebarBrandMarkOwnerProps } from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport { PRODUCT } from './locales.ts'\n\nexport function Mark({ size }: { size: number }) {\n return <svg width={size} height={size} viewBox=\"0 0 40 40\" aria-hidden=\"true\">\n <rect x=\"1\" y=\"1\" width=\"38\" height=\"38\" rx=\"12\" fill=\"var(--dsw-alias-brand-primary)\" />\n <path d=\"M27 12a11 11 0 1 0 0 16\" fill=\"none\" stroke=\"var(--dsw-alias-label-primary-foreground)\" strokeWidth=\"4\" strokeLinecap=\"round\" />\n </svg>\n}\nexport function SidebarMark({ size }: SidebarBrandMarkOwnerProps) { return <Mark size={size} /> }\nexport function SidebarName() { return <span className=\"cannbot-harness-name\">{PRODUCT}</span> }\nexport function Hero({ size }: HeroBrandMarkOwnerProps) {\n return <span data-cannbot-harness-hero=\"\"><Mark size={size} /><span>{PRODUCT}</span></span>\n}\n","export const WORKFLOWS = [\n { id: 'ops-direct-invoke', label: 'operator', description: 'operatorDescription' },\n { id: 'ops-direct-invoke-flash', label: 'flash', description: 'flashDescription' },\n { id: 'ops-registry-invoke', label: 'registry', description: 'registryDescription' },\n { id: 'model-infer-optimize', label: 'model', description: 'modelDescription' },\n { id: 'hccl-op-generator', label: 'hccl', description: 'hcclDescription' },\n { id: 'triton-op-generator', label: 'triton', description: 'tritonDescription' },\n { id: 'catlass-op-generator', label: 'catlass', description: 'catlassDescription' },\n { id: 'ops-perf-optimize', label: 'performance', description: 'performanceDescription' },\n { id: 'pypto-op-orchestrator', label: 'pypto', description: 'pyptoDescription' },\n] as const\n","import { WORKFLOWS } from '../workflows.ts'\nimport type { LocaleKey } from './locales.ts'\n\n/** Keep presentation consistent even when an older workflow package has a Chinese title. */\nexport function workflowCopy(workflow: { id: string; title: string; description?: string }, t: (key: LocaleKey) => string) {\n const known = WORKFLOWS.find(item => item.id === workflow.id)\n return { name: workflow.id, description: known ? t(known.description) : workflow.description ?? (workflow.title === workflow.id ? '' : workflow.title) }\n}\n","import * as primitives from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ComponentType } from 'react'\n\n/** The exact icon component used by DSH's original Standard mode selector. */\nexport function WorkflowIcon({ size = 16 }: { size?: number }) {\n const icons = primitives as unknown as Record<string, ComponentType<{ size?: number }>>\n const Icon = icons.IconAgentPresetOutlineRegular ?? icons.IconAgentPresetOutline16 ?? icons.IconRefreshOutline16\n return Icon ? <Icon size={size} /> : null\n}\n\nexport function ChevronIcon({ size = 12 }: { size?: number }) {\n const icons = primitives as unknown as Record<string, ComponentType<{ size?: number }>>\n const Icon = icons.IconChevronDownOutlineRegular ?? icons.IconChevronDownOutline14\n return Icon ? <Icon size={size} /> : <svg width={size} height={size} viewBox=\"0 0 12 12\" fill=\"none\" aria-hidden=\"true\"><path d=\"m3 4.5 3 3 3-3\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n}\n","export interface ContentPlugin { id: string; title: string; aliases: Record<string, string>; resourceDirectory?: string; version?: string; packageName?: string }\nexport interface ContentSkill { name: string; originalName: string; pluginId: string; path: string; entry: boolean }\nexport interface ContentCatalog { revision?: string; commit?: string; skillsCommit?: string; plugins: ContentPlugin[]; exposedSkills: ContentSkill[] }\nexport interface WorkflowEntry { id: string; title: string; package: string; default: boolean }\nexport interface WorkflowRow extends WorkflowEntry {\n version?: string; latest?: string; previous?: string; installed: boolean; pinned: boolean; error?: string\n}\nexport interface WorkflowDescriptor {\n schemaVersion: 1; id: string; title: string; version: string\n initialization: { kind: 'cannbot-cli'; entry: string } | { kind: 'skill-native' }\n skills: { name: string; path: string; hash: string; entry: boolean }[]\n source: { repository: string; commit: string; skillsCommit: string }\n}\nexport interface ContentStatus {\n phase: 'idle' | 'syncing' | 'ready' | 'error' | 'initializing'\n plugins: { id: string; title: string }[]\n commit?: string; skillsCommit?: string; updatedAt?: string\n fallback: boolean; message: string; log: string\n workflows?: WorkflowRow[]; busy?: boolean; catalogVersion?: string\n}\nexport const CONTENT_PATH = 'api/cannbot-harness/content'\n","import { WORKFLOWS } from '../workflows.ts'\nimport { CONTENT_PATH, type ContentStatus } from '../content-types.ts'\nexport interface DynamicWorkflow { id: string; title: string }\nconst initial: { workflows: DynamicWorkflow[]; status: ContentStatus | undefined } = { workflows: WORKFLOWS.map(({ id }) => ({ id, title: id })), status: undefined }\nexport function createContentStore() {\n let state = initial, closed = false, timer: ReturnType<typeof setTimeout> | undefined\n const listeners = new Set<() => void>()\n const publish = (status: ContentStatus) => { if (!closed) { state = { status, workflows: status.plugins }; for (const listener of listeners) listener() } }\n const endpoint = () => new URL(CONTENT_PATH, document.baseURI)\n const pull = async () => {\n try {\n const response = await fetch(endpoint(), { credentials: 'same-origin', cache: 'no-store', signal: AbortSignal.timeout(15000) })\n if (response.ok) {\n const status = await response.json() as ContentStatus\n if (Array.isArray(status.plugins) && status.plugins.every(item => /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(item.id) && typeof item.title === 'string')) publish(status)\n }\n } catch { /* Keep the last catalog across a short disconnect. */ }\n }\n const post = async (body: object) => {\n const response = await fetch(endpoint(), { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) })\n if (!response.ok) { await pull(); throw new Error('CANNBot content preparation failed') }\n await pull()\n }\n return {\n getSnapshot: () => state,\n subscribe(listener: () => void) { listeners.add(listener); return () => { listeners.delete(listener) } },\n start() {\n const tick = async () => { await pull(); if (!closed) timer = setTimeout(() => { void tick() }, 3000) }\n void tick()\n return () => { closed = true; clearTimeout(timer); listeners.clear() }\n },\n sync: () => post({ action: 'sync' }),\n check: () => post({ action: 'check' }),\n update: (id: string, version: string) => post({ action: 'update', id, version }),\n rollback: (id: string) => post({ action: 'rollback', id }),\n prepare: (sessionId: string, id: string) => post({ action: 'prepare', sessionId, id }),\n }\n}\nexport type ContentStore = ReturnType<typeof createContentStore>\nexport const fallbackContent = { getSnapshot: () => initial, subscribe: (_: () => void) => () => {} }\n","import { useState, useSyncExternalStore, type ComponentType, type ReactNode } from 'react'\nimport * as primitives from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport { workflowCopy } from './workflow-copy.ts'\nimport { WorkflowIcon, ChevronIcon } from './WorkflowIcon.tsx'\nimport type { WorkflowSelection } from './workflow-selection.ts'\nimport { fallbackContent, type ContentStore, type DynamicWorkflow } from './content-store.ts'\n\nexport type WorkflowProps = PropsRuntime<'conversation.hero.agentPreset'> & PropsLocale<'cannbotHarness'> & { selection: WorkflowSelection; content?: ContentStore }\n\n/** Select a workflow without submitting, replacing text, or discarding reference chips. */\nexport function WorkflowSelector({ sessionId, inputActions, useInput, t, selection, content = fallbackContent as ContentStore }: WorkflowProps) {\n const { workflows } = useSyncExternalStore(content.subscribe, content.getSnapshot)\n const copy = (workflow: DynamicWorkflow) => workflowCopy(workflow, t)\n const input = useInput(state => state)\n const saved = useSyncExternalStore(selection.subscribe, selection.getSnapshot)\n const [open, setOpen] = useState(false)\n const selected = workflows.find(workflow => sessionId && saved.values[sessionId] === workflow.id)\n const available = !!sessionId && saved.ready && !saved.pending && inputActions !== undefined && input !== undefined && input.phase === 'plain'\n const pick = (id: string) => {\n setOpen(false)\n if (sessionId && available) void selection.choose(sessionId, id, t('saving'))\n }\n const anchor = (\n <button type=\"button\" className=\"cannbot-harness-workflow-trigger\" aria-label={t('workflow')} aria-haspopup=\"menu\" aria-expanded={open}\n disabled={!available} title={inputActions === undefined ? t('chooseWorkspace') : t('commandHint')}\n onClick={() => setOpen(value => !value)}>\n <WorkflowIcon />\n <span className=\"cannbot-harness-workflow-label\" lang={selected ? 'en' : undefined}>{selected ? copy(selected).name : t('workflow')}</span><ChevronIcon size={12} />\n </button>\n )\n const label = (workflow: DynamicWorkflow) => <span className=\"cannbot-harness-workflow-option\">\n <span lang=\"en\">{copy(workflow).name}</span>\n {copy(workflow).description && <>{' '}<small>{copy(workflow).description}</small></>}\n </span>\n const { Menu, MenuItemButton } = primitives\n const LegacyMenu = Menu as unknown as ComponentType<{ open: boolean; anchor: ReactNode; portal: boolean; className: string; onClose(): void; selectedId?: string; onSelect(id: string): void; items: { id: string; label: ReactNode; icon: ReactNode }[] }>\n return <span className=\"cannbot-harness-workflow\">\n {typeof MenuItemButton === 'function' ? <Menu open={open} onClose={() => setOpen(false)} portal className=\"cannbot-harness-workflow-anchor\" anchor={anchor}>\n <MenuItemButton icon={<WorkflowIcon />} onSelect={() => pick('')}>{t('ordinary')}</MenuItemButton>\n {workflows.map(workflow => <MenuItemButton key={workflow.id} icon={<WorkflowIcon />} onSelect={() => pick(workflow.id)}>{label(workflow)}</MenuItemButton>)}\n </Menu> : <LegacyMenu open={open} onClose={() => setOpen(false)} portal className=\"cannbot-harness-workflow-anchor\" anchor={anchor}\n selectedId={selected?.id} items={[{ id: '', label: t('ordinary'), icon: <WorkflowIcon /> }, ...workflows.map(workflow => ({ id: workflow.id, label: label(workflow), icon: <WorkflowIcon /> }))]}\n onSelect={pick} />}\n {saved.error && <span role=\"alert\" className=\"cannbot-harness-error\">\n <button type=\"button\" onClick={() => selection.retry()} title={t('insertFailed')}>\n {t(saved.errorKind === 'settings' ? 'settingsRetry' : 'workflowRetry')}\n </button>\n </span>}\n </span>\n}\n","import { useMemo, useSyncExternalStore } from 'react'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport { WorkflowSelector, type WorkflowProps } from './WorkflowSelector.tsx'\n\n/** Older DSH declares the hero seat at root scope. Resolve its current session\n * through the public services rather than reaching into the editor or DOM. */\nexport function WorkflowCompat({ ctx, ...props }: WorkflowProps & { ctx: Context }) {\n return typeof props.useInput === 'function'\n ? <WorkflowSelector {...props} />\n : <LegacyWorkflow ctx={ctx} {...props} />\n}\n\nfunction LegacyWorkflow({ ctx, ...props }: WorkflowProps & { ctx: Context }) {\n type Input = ReturnType<Context['conversation']['input']['for']>\n const legacy = ctx as unknown as { sessions: { list: { subscribe(listener: () => void): () => void; getSnapshot(): { current?: string } }; scope(id: string): Context | undefined } }\n const sessions = useSyncExternalStore(legacy.sessions.list.subscribe, legacy.sessions.list.getSnapshot)\n const input = useMemo(() => {\n const scope = sessions.current && legacy.sessions.scope(sessions.current)\n return scope ? ctx.conversation.input.for(scope) as Input : undefined\n }, [ctx, sessions.current])\n const state = useSyncExternalStore(input?.state.subscribe ?? noSubscribe, input?.state.getSnapshot ?? noSnapshot)\n return <WorkflowSelector {...props} sessionId={sessions.current as WorkflowProps['sessionId']} useInput={select => state ? select(state) : undefined as never} inputActions={input ? {} as WorkflowProps['inputActions'] : undefined} />\n}\nconst noSubscribe = () => () => {}\nconst noSnapshot = () => undefined\n","import type { ThemeTokenOverrides } from '@deepseek-ai/dsh-client-ui-theme/client'\n\n/** Portal design-v2 palette, applied through the documented theme override layer. */\nexport const cannTheme: ThemeTokenOverrides = Object.fromEntries(Object.entries({\n '--dsw-alias-bg-base': ['#ffffff', '#101114'],\n '--dsw-alias-bg-layer-1': ['#ffffff', '#17191e'],\n '--dsw-alias-bg-layer-2': ['#ffffff', '#1d2026'],\n '--dsw-alias-bg-layer-3': ['#f6f8fa', '#252830'],\n '--dsw-specific-sidebar-fill': ['#f6f8fa', '#14161b'],\n '--dsw-specific-input-major': ['#ffffff', '#1d2026'],\n '--dsw-specific-sidebar-nav-item-active': ['#fdeef0', '#392029'],\n '--dsw-specific-sidebar-nav-item-active-accent': ['#fdeef0', '#392029'],\n '--dsw-alias-label-primary': ['#17181d', '#f3f4f6'],\n '--dsw-alias-label-primary-foreground': ['#ffffff', '#ffffff'],\n '--dsw-alias-label-primary-inverted': ['#ffffff', '#ffffff'],\n '--dsw-alias-label-primary-dimmed': ['#30343e', '#dde1e8'],\n '--dsw-alias-label-primary-bluish': ['#7f0f26', '#ff9aab'],\n '--dsw-alias-label-secondary': ['#59637a', '#b0b8c7'],\n '--dsw-alias-label-tertiary': ['#727d91', '#929db0'],\n '--dsw-alias-brand-primary': ['#da203e', '#ef4560'],\n '--dsw-alias-brand-text': ['#17181d', '#f3f4f6'],\n '--dsw-alias-button-primary-hover': ['#b11430', '#ff647d'],\n '--dsw-alias-button-info-fill': ['#da203e', '#da203e'],\n '--dsw-alias-button-info-hover': ['#b11430', '#b11430'],\n '--dsw-alias-state-business-primary': ['#da203e', '#ff8297'],\n '--dsw-alias-state-business-tertiary': ['#fdeef0', '#392029'],\n '--dsw-alias-link': ['#b11430', '#ff9aab'],\n '--dsw-focus-ring-color': ['#da203e', '#ff8297'],\n '--dsw-alias-border-l1': ['#f0f1f5', '#252830'],\n '--dsw-alias-border-l2': ['#e6e9ef', '#323641'],\n '--dsw-alias-border-l3': ['#dce0e8', '#414754'],\n '--dsw-alias-border-l4': ['#ced4df', '#505867'],\n '--dsw-alias-interactive-bg-hover': ['#eef0f4', '#252830'],\n '--dsw-alias-interactive-bg-active': ['#fdeef0', '#392029'],\n '--dsw-specific-bubble': ['#fff3f5', '#302027'],\n '--dsw-specific-bubble-highlight': ['#fbd6dd', '#59303d'],\n '--dsw-radius-panel': ['18px', '18px'],\n '--dsw-radius-xl': ['14px', '14px'],\n '--dsw-radius-lg': ['12px', '12px'],\n '--dsw-radius-md': ['10px', '10px'],\n '--cann-grid': ['#e6e9ef', '#323641'],\n '--cann-night': ['#0e0f12', '#0e0f12'],\n '--cann-night-label': ['#dde1e8', '#dde1e8'],\n}).map(([name, values]) => [name, { light: values[0]!, dark: values[1]! }]))\n","import { useSyncExternalStore } from 'react'\nimport type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { PresentationController } from './presentation.ts'\nimport { Mark } from './Brand.tsx'\nimport { PRODUCT } from './locales.ts'\n\nexport function InterfaceToggle({ wide, controller }: PropsRuntime<'sidebar.footer.action'> & { controller: PresentationController }) {\n const enabled = useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot)\n return <div className={`cannbot-harness-toggle${wide ? '' : ' cannbot-harness-toggle-compact'}`}>\n <span className=\"cannbot-harness-toggle-name\" title={PRODUCT}><Mark size={20} />{wide && <span>{PRODUCT}</span>}</span>\n <button type=\"button\" role=\"switch\" aria-label={PRODUCT} aria-checked={enabled} title={PRODUCT}\n className=\"cannbot-harness-switch\" onClick={() => controller.setEnabled(!enabled)}><span /></button>\n </div>\n}\n","/** Per-activation UI preference: enabling the plugin always starts with its interface on. */\nexport interface PresentationController {\n getSnapshot(): boolean\n subscribe(listener: () => void): () => void\n setEnabled(enabled: boolean): void\n dispose(): void\n}\nexport function createPresentationController(mount: () => () => void): PresentationController {\n let enabled = true\n let stopped = false\n let unmount: (() => void) | undefined = mount()\n const listeners = new Set<() => void>()\n return {\n getSnapshot: () => enabled,\n subscribe(listener) { listeners.add(listener); return () => { listeners.delete(listener) } },\n setEnabled(next) {\n if (stopped || next === enabled) return\n if (next) unmount = mount()\n else { unmount?.(); unmount = undefined }\n enabled = next\n for (const listener of listeners) listener()\n },\n dispose() { if (stopped) return; stopped = true; unmount?.(); unmount = undefined; listeners.clear() },\n }\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { SlotMap } from '@deepseek-ai/dsh-client-ui-slots'\n\n/** Older DSH declares the injected parent modules before this plugin and uses direct register(). */\nexport function injectSlot(ctx: Context, name: keyof SlotMap & string, register: () => () => void): () => void {\n return typeof ctx.slots.inject === 'function' ? ctx.slots.inject(name, register) : register()\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport { WORKFLOWS } from '../workflows.ts'\n\nconst NS = 'cannbot-harness'\ntype Values = Record<string, string>\ninterface Choice { sessionId: string; workflow: string }\ninterface View { ns: string; value: { selections?: Choice[] }; revision?: number }\nconst valuesOf = (view?: View): Values => Object.fromEntries((view?.value.selections ?? []).map(item => [item.sessionId, item.workflow]))\nexport interface WorkflowTransport {\n describe(): Promise<{ namespaces: View[] }>\n update(ns: string, patch: { selections: Choice[] }, revision?: number): Promise<View>\n}\nexport interface SelectionSnapshot { ready: boolean; pending: boolean; error: boolean; errorKind?: 'settings' | 'prepare' | 'save'; values: Values }\nexport interface WorkflowSelection {\n subscribe(listener: () => void): () => void\n getSnapshot(): SelectionSnapshot\n attach(transport: WorkflowTransport): () => void\n choose(sessionId: string, workflow: string, reason?: string): Promise<void>\n retry(): void\n dispose(): void\n}\nexport function createWorkflowSelection(blockSubmission: (sessionId: string, reason: string) => () => void = () => () => {}, prepare: (sessionId: string, id: string) => Promise<void> = async () => {}): WorkflowSelection {\n let snapshot: SelectionSnapshot = { ready: false, pending: false, error: false, values: {} }\n let transport: WorkflowTransport | undefined\n let generation = 0\n let pendingRelease: (() => void) | undefined\n let timer: ReturnType<typeof setTimeout> | undefined\n let lastChoice: { sessionId: string; workflow: string; reason: string } | undefined\n const listeners = new Set<() => void>()\n const publish = (next: SelectionSnapshot) => { snapshot = next; for (const listener of listeners) listener() }\n const read = async (current: WorkflowTransport, own: number, attempt = 0) => {\n try {\n const view = await current.describe()\n if (own !== generation) return\n const section = view.namespaces.find(item => item.ns === NS)\n if (!section) throw new Error('Workflow settings are not active yet')\n publish({ ready: true, pending: false, error: false, values: valuesOf(section) })\n } catch {\n if (own !== generation) return\n // Profile settings describe only active fibers. A browser can connect while\n // async plugin activation or a profile reload is still completing.\n if (attempt >= 9) publish({ ...snapshot, ready: false, pending: false, error: true, errorKind: 'settings' })\n timer = setTimeout(() => { void read(current, own, Math.min(attempt + 1, 9)) }, attempt < 9 ? Math.min(250 * (attempt + 1), 1500) : 5000)\n }\n }\n const api: WorkflowSelection = {\n subscribe(listener) { listeners.add(listener); return () => { listeners.delete(listener) } },\n getSnapshot: () => snapshot,\n attach(next) {\n clearTimeout(timer)\n pendingRelease?.(); pendingRelease = undefined\n transport = next\n const own = ++generation\n publish({ ...snapshot, ready: false, pending: false, error: false, errorKind: undefined })\n void read(next, own)\n return () => { if (own === generation) { generation++; clearTimeout(timer); transport = undefined; publish({ ...snapshot, ready: false }) } }\n },\n async choose(sessionId, workflow, reason = 'CANNBot Harness…') {\n if (!transport || !snapshot.ready || snapshot.pending) return\n if (workflow !== '' && !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(workflow)) throw new Error('Unknown workflow')\n const current = transport, own = generation\n lastChoice = { sessionId, workflow, reason }\n const unblock = blockSubmission(sessionId, reason)\n let released = false\n const release = () => { if (!released) { released = true; unblock() } }\n pendingRelease = release\n publish({ ...snapshot, pending: true, error: false, errorKind: undefined })\n let stage: 'prepare' | 'save' = 'prepare'\n try {\n if (workflow) await prepare(sessionId, workflow)\n stage = 'save'\n // Fresh revision prevents simultaneous windows from overwriting selections.\n const view = (await current.describe()).namespaces.find(item => item.ns === NS)\n if (!view) throw new Error('Workflow settings unavailable')\n const values = { ...valuesOf(view), [sessionId]: workflow }\n const selections = Object.entries(values).filter(([, id]) => id !== '').map(([sessionId, workflow]) => ({ sessionId, workflow }))\n const result = await current.update(NS, { selections }, view.revision)\n if (own === generation) publish({ ready: true, pending: false, error: false, values: valuesOf(result) })\n } catch {\n if (own === generation) publish({ ...snapshot, pending: false, error: true, errorKind: stage })\n } finally {\n release()\n if (pendingRelease === release) pendingRelease = undefined\n }\n },\n retry() {\n if (snapshot.errorKind === 'settings' && transport) {\n clearTimeout(timer)\n publish({ ...snapshot, error: false, errorKind: undefined })\n void read(transport, generation)\n } else if (lastChoice) void api.choose(lastChoice.sessionId, lastChoice.workflow, lastChoice.reason)\n },\n dispose() { generation++; clearTimeout(timer); transport = undefined; pendingRelease?.(); pendingRelease = undefined; listeners.clear() },\n }\n return api\n}\n\n/** Both transports are official DSH settings APIs; no private editor access. */\nexport function connectWorkflowSelection(ctx: Context, selection: WorkflowSelection) {\n ctx.inject(['remote', 'remote.settings'], scoped => {\n const settings = scoped.remote.settings\n scoped.effect(() => selection.attach({\n describe: async () => unwrap(await settings.describe()),\n update: async (ns, patch, revision) => unwrap(await settings.update(ns, patch, revision)),\n }))\n })\n ctx.inject(['connection'], scoped => {\n const api = (scoped as unknown as { connection: { api?: { settings: { describe(payload: object): Promise<unknown>; update(payload: object): Promise<unknown> } } } }).connection.api\n if (!api?.settings) return\n scoped.effect(() => selection.attach({\n describe: async () => unwrap(await api.settings.describe({})),\n update: async (ns, patch, expectedRevision) => unwrap(await api.settings.update({ ns, patch, expectedRevision })),\n }))\n })\n}\nfunction unwrap<T>(response: unknown): T {\n const raw = response as { result?: unknown }\n const result = (raw.result ?? response) as { ok: boolean; value: T; error?: { message: string } }\n if (!result.ok) throw new Error(result.error?.message ?? 'Workflow settings failed')\n return result.value\n}\n","export const UPDATE_PACKAGES = ['cannbot-harness', '@cannbot-plugin/cannbot-harness'] as const\nexport interface InstalledBundle { name: string; version?: string; installed: boolean }\nexport interface Change { application: string; error?: { code: string }; version?: string }\nexport interface UpdateBridge {\n list(): Promise<InstalledBundle[]>\n install(spec: string): Promise<Change>\n update?(name: string, version: string): Promise<{ result: Change; restore?: Change }>\n}\nexport interface Release { name: string; version: string; tarball: string }\nexport type UpdatePhase = 'idle' | 'checking' | 'latest' | 'available' | 'updating' | 'done' | 'restart' | 'manual' | 'incompatible' | 'error'\nexport interface UpdateSnapshot { phase: UpdatePhase; current?: string; release?: Release; packageName?: string }\n\n/** Only stable npm releases of our two installation entries may be selected. */\nexport function newerVersion(candidate: string, current: string): boolean {\n const next = /^(\\d+)\\.(\\d+)\\.(\\d+)$/.exec(candidate)\n const old = /^(\\d+)\\.(\\d+)\\.(\\d+)(?:[-+].*)?$/.exec(current)\n if (!next || !old) return false\n for (let index = 1; index < 4; index++) {\n const difference = Number(next[index]) - Number(old[index])\n if (difference) return difference > 0\n }\n return current.includes('-')\n}\n\nexport async function latestRelease(name: string, signal: AbortSignal): Promise<Release> {\n if (!UPDATE_PACKAGES.includes(name as typeof UPDATE_PACKAGES[number])) throw new Error('Unsupported update target')\n const answers = await Promise.allSettled(['https://registry.npmjs.org/', 'https://registry.npmmirror.com/'].map(async registry => {\n const response = await fetch(`${registry}${encodeURIComponent(name)}/latest`, {\n signal: AbortSignal.any([signal, AbortSignal.timeout(15000)]), cache: 'no-store',\n })\n if (!response.ok) throw new Error('Registry unavailable')\n const manifest = await response.json() as { name?: string; version?: string; dist?: { tarball?: string }; dsh?: { bundle?: unknown } }\n if (manifest.name !== name || !manifest.version || !/^\\d+\\.\\d+\\.\\d+$/.test(manifest.version) || !manifest.dsh?.bundle || !manifest.dist?.tarball) throw new Error('Invalid release')\n const url = new URL(manifest.dist.tarball)\n if (url.protocol !== 'https:' || !['registry.npmjs.org', 'registry.npmmirror.com'].includes(url.hostname)) throw new Error('Invalid download origin')\n return { name, version: manifest.version, tarball: url.href }\n }))\n signal.throwIfAborted()\n const releases = answers.flatMap(answer => answer.status === 'fulfilled' ? [answer.value] : [])\n const latest = releases.reduce<Release | undefined>((best, release) => !best || newerVersion(release.version, best.version) ? release : best, undefined)\n if (!latest) throw new Error('No release available')\n return latest\n}\n\nexport function createPluginUpdater(bridge: UpdateBridge, requestedName: string, lookup = latestRelease) {\n let state: UpdateSnapshot = { phase: 'idle' }\n let disposed = false\n let checking: AbortController | undefined\n const listeners = new Set<() => void>()\n const publish = (next: UpdateSnapshot) => { if (disposed) return; state = next; for (const listener of listeners) listener() }\n const failed = (result: Change) => !['applied', 'restart-required'].includes(result.application) || !!result.error\n return {\n getSnapshot: () => state,\n subscribe(listener: () => void) { listeners.add(listener); return () => { listeners.delete(listener) } },\n async check() {\n if (disposed || state.phase === 'checking' || state.phase === 'updating') return\n checking?.abort()\n const abort = new AbortController()\n checking = abort\n publish({ ...state, phase: 'checking' })\n try {\n const bundles = (await bridge.list()).filter(bundle => bundle.installed && UPDATE_PACKAGES.includes(bundle.name as typeof UPDATE_PACKAGES[number]))\n // Update the actual direct dependency, preserving short/long installation form.\n const bundle = bundles.find(bundle => bundle.name === requestedName) ?? bundles[0]\n if (!bundle?.version) throw new Error('Installed entry unavailable')\n publish({ ...state, current: bundle.version, packageName: bundle.name })\n const release = await lookup(bundle.name, abort.signal)\n if (checking !== abort || disposed) return\n publish({ phase: newerVersion(release.version, bundle.version) ? 'available' : 'latest', current: bundle.version, release, packageName: bundle.name })\n } catch {\n if (!abort.signal.aborted) publish({ ...state, phase: 'error' })\n }\n },\n async update() {\n if (disposed || state.phase !== 'available' || !state.release || !state.packageName) return\n const target = state.release, name = state.packageName\n publish({ ...state, phase: 'updating' })\n try {\n // The Host owns the complete transaction, including self-removal and recovery.\n // Frontend disposal must never cancel an update that already started.\n const answer = bridge.update\n ? await bridge.update(name, target.version)\n : { result: await bridge.install(`${name}@${target.version}`) }\n const result = answer.result\n if (failed(result)) {\n const code = result.error?.code\n publish({ ...state, phase: code === 'already-installed' || code === 'stop-profile' ? 'manual' : code === 'incompatible-version' ? 'incompatible' : 'error' })\n } else {\n publish({ ...state, phase: result.application === 'restart-required' ? 'restart' : 'done', current: target.version })\n }\n } catch { publish({ ...state, phase: 'error' }) }\n },\n dispose() { disposed = true; checking?.abort(); listeners.clear() },\n }\n}\nexport type PluginUpdater = ReturnType<typeof createPluginUpdater>\n","import { useEffect, useSyncExternalStore } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { PluginUpdater } from './plugin-update.ts'\n\nexport function PluginUpdateCard({ updater, t }: { updater: PluginUpdater } & PropsLocale<'cannbotHarness'>) {\n const state = useSyncExternalStore(updater.subscribe, updater.getSnapshot)\n useEffect(() => { void updater.check() }, [updater])\n const busy = state.phase === 'checking' || state.phase === 'updating'\n const canUpdate = state.phase === 'available'\n const message = state.phase === 'latest' ? t('updateLatest')\n : state.phase === 'available' ? t('updateAvailable')\n : state.phase === 'updating' ? t('updateRunning')\n : state.phase === 'done' ? t('updateDone')\n : state.phase === 'restart' ? t('updateRestart')\n : state.phase === 'manual' ? t('updateManual')\n : state.phase === 'incompatible' ? t('updateIncompatible')\n : state.phase === 'error' ? t('updateFailed') : ''\n return <section className=\"cannbot-harness-update\" aria-label={t('updateTitle')}>\n <div className=\"cannbot-harness-update-heading\"><h4>{t('updateTitle')}</h4>\n {state.current && <span>{t('updateCurrent')} {state.current}</span>}</div>\n <div className=\"cannbot-harness-update-actions\">\n {state.phase === 'manual' && state.release ? <>\n <a className=\"cannbot-harness-update-button\" href={state.release.tarball} download rel=\"noreferrer\">{t('updateDownload')} {state.release.version}</a>\n <button type=\"button\" className=\"cannbot-harness-update-recheck\" onClick={() => { void updater.check() }}>{t('updateCheck')}</button>\n </> :\n <button type=\"button\" className=\"cannbot-harness-update-button\" disabled={busy}\n onClick={() => { void (canUpdate ? updater.update() : updater.check()) }}>\n {state.phase === 'checking' ? t('updateChecking') : state.phase === 'updating' ? t('updateRunning')\n : canUpdate ? `${t('updateTo')} ${state.release?.version}` : t('updateCheck')}\n </button>\n }\n </div>\n {message && <p role={state.phase === 'error' ? 'alert' : 'status'} aria-live=\"polite\">{message}</p>}\n </section>\n}\n","import type { Change } from './plugin-update.ts'\nimport { en, zh } from './locales.ts'\n\n/** This notice belongs to the in-flight update, so removing the plugin must not remove it. */\nexport async function updateOnHost(name: string, version: string): Promise<{ result: Change; restore?: Change }> {\n const words = document.documentElement.lang.startsWith('en') ? en : zh\n const notice = document.createElement('div')\n notice.setAttribute('role', 'status')\n notice.setAttribute('aria-live', 'polite')\n notice.dataset.cannbotUpdate = 'progress'\n Object.assign(notice.style, { position: 'fixed', bottom: '24px', right: '24px', zIndex: '2147483647',\n maxWidth: 'min(380px, calc(100vw - 48px))', padding: '16px', borderRadius: '12px',\n background: 'var(--dsw-alias-bg-base, white)', color: 'var(--dsw-alias-label-primary, #222)',\n border: '1px solid var(--dsw-alias-border-l2, #ddd)', boxShadow: '0 8px 32px #0002', fontSize: '13px', lineHeight: '1.6' })\n const text = document.createElement('span')\n text.textContent = `${words.updateRunning} ${version} · ${words.updateBackground}`\n notice.append(text)\n document.body.append(notice)\n try {\n const response = await fetch(new URL('api/cannbot-harness/update', document.baseURI), {\n method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ name, version }),\n // No plugin-lifetime abort: its own uninstall is expected during the transaction.\n })\n if (!response.ok) throw new Error('Host update unavailable')\n const answer = await response.json() as { result: Change; restore?: Change }\n if (!answer?.result || typeof answer.result.application !== 'string') throw new Error('Invalid update result')\n const succeeded = (result: Change) => !result.error && ['applied', 'restart-required'].includes(result.application)\n text.textContent = succeeded(answer.result)\n ? `${answer.result.application === 'restart-required' ? words.updateRestart : words.updateDone} (${version})`\n : answer.restore ? succeeded(answer.restore) ? words.updateRestored : words.updateRepair : words.updateFailed\n return answer\n } catch (error) {\n text.textContent = words.updateConnectionLost\n throw error\n } finally {\n const close = document.createElement('button')\n close.type = 'button'; close.textContent = '×'; close.setAttribute('aria-label', words.updateDismiss)\n Object.assign(close.style, { marginLeft: '12px', border: '0', background: 'transparent', color: 'inherit', cursor: 'pointer', fontSize: '18px' })\n close.addEventListener('click', () => notice.remove(), { once: true })\n notice.append(close)\n }\n}\n","import { useState, useSyncExternalStore } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { ContentStore } from './content-store.ts'\nimport { newerVersion } from './plugin-update.ts'\nimport { workflowCopy } from './workflow-copy.ts'\nexport function ContentCard({ content, t }: { content: ContentStore } & PropsLocale<'cannbotHarness'>) {\n const { status } = useSyncExternalStore(content.subscribe, content.getSnapshot)\n const [failed, setFailed] = useState(false)\n const busy = status?.busy || status?.phase === 'syncing' || status?.phase === 'initializing'\n const act = (action: () => Promise<void>) => { setFailed(false); void action().catch(() => setFailed(true)) }\n return <section className=\"cannbot-harness-update cannbot-harness-content\" aria-label={t('contentTitle')}>\n <div className=\"cannbot-harness-update-heading\"><h4>{t('contentTitle')}</h4>\n {status?.catalogVersion && <span>{t('contentCatalog')} {status.catalogVersion}</span>}</div>\n <div className=\"cannbot-harness-update-actions\">\n <button type=\"button\" className=\"cannbot-harness-update-button\" disabled={busy} onClick={() => act(content.sync)}>{busy ? t('contentBusy') : t('contentSync')}</button>\n <button type=\"button\" className=\"cannbot-harness-update-recheck\" disabled={busy} onClick={() => act(content.check)}>{t('contentCheck')}</button>\n </div>\n <p role={failed || status?.phase === 'error' ? 'alert' : 'status'} aria-live=\"polite\">\n {failed || status?.phase === 'error' ? t('contentFailed') : status?.phase === 'initializing' ? t('contentInitializing') : status?.phase === 'syncing' ? t('contentDownloading') : status?.fallback ? t('contentFallback') : t('contentReady')}\n </p>\n {status && <p>{status.plugins.length} {t('contentWorkflows')}</p>}\n <div className=\"cannbot-harness-workflow-packages\">\n {status?.workflows?.map(row => {\n const available = row.latest && (!row.version || newerVersion(row.latest, row.version))\n const copy = workflowCopy(row, t)\n return <div className=\"cannbot-harness-workflow-package\" key={row.id}>\n <div><strong lang=\"en\">{copy.name}</strong><small>{copy.description}</small><small lang=\"en\">{row.package}</small>\n <small>{row.version ? `${t('contentVersion')} ${row.version}` : t('contentNotInstalled')}\n {available && ` · ${t('contentLatest')} ${row.latest}`}{row.pinned && ` · ${t('contentPinned')}`}</small>\n {row.error && <small role=\"alert\">{row.error}</small>}</div>\n <div className=\"cannbot-harness-workflow-package-actions\">\n {available ? <button type=\"button\" className=\"cannbot-harness-update-recheck\" disabled={busy}\n aria-label={`${row.installed ? t('contentUpdate') : t('contentInstall')} ${copy.name}`}\n onClick={() => act(() => content.update(row.id, row.latest!))}>{row.installed ? t('contentUpdate') : t('contentInstall')}</button>\n : <small>{row.installed ? row.latest ? t('contentUpToDate') : t('contentUnchecked') : t('contentUnavailable')}</small>}\n {row.previous && <button type=\"button\" className=\"cannbot-harness-update-recheck\" disabled={busy}\n aria-label={`${t('contentRollback')} ${copy.name}`} onClick={() => act(() => content.rollback(row.id))}>{t('contentRollback')} {row.previous}</button>}\n </div>\n </div>\n })}\n </div>\n {(status?.log || status?.message) && <details><summary>{t('contentLogs')}</summary><pre>{status.message}{'\\n'}{status.log}</pre></details>}\n </section>\n}\n","import { createElement, Fragment } from 'react'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { createPluginUpdater, UPDATE_PACKAGES } from './plugin-update.ts'\nimport { PluginUpdateCard } from './PluginUpdateCard.tsx'\nimport { NAMESPACE } from './locales.ts'\nimport { injectSlot } from './slot-compat.ts'\nimport { updateOnHost } from './host-update.ts'\nimport { ContentCard } from './ContentCard.tsx'\nimport type { ContentStore } from './content-store.ts'\n\n/** Optional integration: old DSH versions without a Plugins page keep loading. */\nexport function registerPluginUpdates(ctx: Context, content?: ContentStore) {\n ctx.inject(['remote', 'remote.pluginManager'], scoped => {\n const manager = scoped.remote.pluginManager\n for (const name of UPDATE_PACKAGES) {\n const updater = createPluginUpdater({\n list: async () => unwrap(await manager.listBundles()),\n install: async spec => unwrap(await manager.installBundle(spec, { saveExact: true })),\n update: updateOnHost,\n }, name)\n scoped.effect(() => () => updater.dispose())\n scoped.effect(() => injectSlot(scoped, 'plugins.bundle.config', () => scoped.slots.register({\n name: 'plugins.bundle.config', key: name, locale: NAMESPACE,\n }, props => createElement(Fragment, null,\n createElement(PluginUpdateCard, { ...(props as PropsLocale<'cannbotHarness'>), updater }),\n content && createElement(ContentCard, { ...(props as PropsLocale<'cannbotHarness'>), content })))))\n }\n })\n}\nfunction unwrap<T>(result: { ok: true; value: T } | { ok: false; error: unknown }): T {\n if (!result.ok) throw result.error\n return result.value\n}\n","export type PreparationStage = 'idle' | 'workspace' | 'dependencies' | 'upload' | 'conversation'\nexport const preparationLabels: Record<PreparationStage, string> = { idle: '', workspace: '正在准备工作区…', dependencies: '正在准备工作流依赖…', upload: '正在上传文件…', conversation: '正在进入对话…' }\nexport interface WorkbenchState { prompt: string; workflow: string; workspaceId: string; files: File[]; detail: string; busy: boolean; error: string; stage: PreparationStage }\nexport function createWorkbenchState() {\n let state: WorkbenchState = { prompt: '', workflow: '', workspaceId: '', files: [], detail: 'ops-direct-invoke', busy: false, error: '', stage: 'idle' }\n const listeners = new Set<() => void>()\n const lifetime = new AbortController()\n return {\n signal: lifetime.signal,\n getSnapshot: () => state,\n subscribe(listener: () => void) { listeners.add(listener); return () => { listeners.delete(listener) } },\n set(patch: Partial<WorkbenchState>) { if (lifetime.signal.aborted) return; state = { ...state, ...patch }; for (const listener of listeners) listener() },\n dispose() { lifetime.abort(); listeners.clear() },\n }\n}\nexport type WorkbenchStore = ReturnType<typeof createWorkbenchState>\n","/** Presentation copy only. Execution and initialization remain owned by the workflow packages. */\nexport const categories = ['全部', 'Ascend C', '其他算子', '通信', '性能优化'] as const\nexport type Category = typeof categories[number]\nexport interface WorkflowGuide { category: Category; icon: string; scenes: string[]; inputs: string[]; outputs: string[]; example: string }\nexport const guides: Record<string, WorkflowGuide> = {\n 'ops-direct-invoke': { category: 'Ascend C', icon: 'code', scenes: ['开发新的 Ascend C 算子', '通过直调方式集成算子'], inputs: ['必需:算子功能、输入输出及数据类型', '可选:参考实现、目标硬件及性能要求'], outputs: ['算子实现与直调示例', '按实际环境生成的验证结果及运行说明'], example: '请开发一个 Ascend C 的 Add 算子,输入为两个 float16 张量,并通过直调方式验证结果。' },\n 'ops-direct-invoke-flash': { category: 'Ascend C', icon: 'flash', scenes: ['快速实现与验证算子原型', '从明确的功能需求开始开发'], inputs: ['必需:算子功能及输入输出规格', '可选:参考代码、测试数据及目标硬件'], outputs: ['Ascend C 算子代码', '在可用环境中执行的编译与精度验证结果'], example: '帮我快速生成并验证一个 Ascend C 的 MatMul 算子,输入使用 float16,请先确认形状约束。' },\n 'ops-registry-invoke': { category: 'Ascend C', icon: 'document', scenes: ['开发需要注册到框架的算子', '通过 ACLNN / GEIR 接入算子'], inputs: ['必需:算子定义、输入输出及接入方式', '可选:现有工程、参考实现及目标环境'], outputs: ['注册算子相关代码及接入示例', '按实际环境完成的验证与使用说明'], example: '开发一个 Ascend C 的自定义算子,并通过 ACLNN 接入。请先检查当前工程及输入输出定义。' },\n 'triton-op-generator': { category: '其他算子', icon: 'code', scenes: ['使用 Triton-Ascend 开发算子', '优化已有 Triton 算子实现'], inputs: ['必需:功能需求或已有 Triton 代码', '可选:张量规格、目标硬件与性能目标'], outputs: ['Triton-Ascend 算子代码', '实际执行的验证与调优记录'], example: '使用 Triton-Ascend 实现一个逐元素 Add 算子,并为不同输入形状添加验证。' },\n 'catlass-op-generator': { category: '其他算子', icon: 'layers', scenes: ['基于 CATLASS 模板开发矩阵计算算子', '开发注意力相关算子并验证精度与性能'], inputs: ['必需:计算需求及张量规格', '可选:CATLASS 工程、参考实现与性能目标'], outputs: ['基于 CATLASS 的实现及调用示例', '可用环境中的精度与性能验证结果'], example: '基于 CATLASS 模板开发一个矩阵乘算子,请先检查工程环境,再验证精度与性能。' },\n 'pypto-op-orchestrator': { category: '其他算子', icon: 'nodes', scenes: ['使用 PyPTO 开发并调优算子', '单独调优已有的 PyPTO 算子'], inputs: ['必需:算子需求或已有 PyPTO 代码', '可选:测试用例、目标硬件与性能目标'], outputs: ['PyPTO 算子实现或调优修改', '按实际执行情况整理的验证与优化结果'], example: '请分析当前 PyPTO 算子,保持计算结果一致,尝试优化性能并记录验证结果。' },\n 'hccl-op-generator': { category: '通信', icon: 'arrows', scenes: ['开发 HCCL AICPU 通信算子', '生成通信代码并准备验证'], inputs: ['必需:通信操作、参与设备及数据规格', '可选:现有通信工程及运行环境'], outputs: ['通信算子相关代码', '在可用设备环境中的验证结果及运行说明'], example: '帮我开发一个 HCCL AICPU 通信算子,请先确认通信操作、设备数量和测试环境。' },\n 'ops-perf-optimize': { category: '性能优化', icon: 'chart', scenes: ['分析已有 Ascend C 算子的性能瓶颈', '在保持精度的前提下迭代调优'], inputs: ['必需:已有算子代码及复现方法', '可选:基准数据、性能分析结果与目标'], outputs: ['性能分析及代码修改', '精度检查、性能对比及退化检查记录'], example: '请分析当前 Ascend C 算子的性能瓶颈,在保持精度的前提下优化,并对比修改前后的表现。' },\n 'model-infer-optimize': { category: '性能优化', icon: 'gear', scenes: ['将模型迁移到 NPU', '对齐精度并优化推理性能'], inputs: ['必需:模型代码、依赖及运行方法', '可选:模型权重路径、测试数据和基准结果'], outputs: ['模型迁移或推理优化修改', '实际完成的精度对齐与性能验证记录'], example: '请将当前模型迁移到 NPU,先检查依赖与运行方式,再进行精度对齐和推理性能优化。' },\n}\nexport const guideFor = (id: string): WorkflowGuide => guides[id] ?? { category: '其他算子', icon: 'nodes', scenes: ['使用此工作流完成开发需求'], inputs: ['请描述目标,并提供相关工程或代码'], outputs: ['以工作流实际执行结果为准'], example: '请根据当前工程和我的需求开展工作,开始前先检查必要的输入。' }\nexport const cardOrder = Object.keys(guides)\nconst inputHints: Record<string, string> = {\n 'ops-direct-invoke': '可补充算子功能、输入形状、数据类型和目标硬件。',\n 'ops-direct-invoke-flash': '可补充输入形状、数据类型和目标硬件。',\n 'ops-registry-invoke': '可补充输入输出规格,以及 ACLNN / GEIR 接入要求。',\n 'triton-op-generator': '可补充张量规格、参考实现和目标硬件。',\n 'catlass-op-generator': '可补充矩阵形状、精度要求和性能目标。',\n 'pypto-op-orchestrator': '可补充 PyPTO 代码、测试用例和调优目标。',\n 'hccl-op-generator': '可补充通信操作、设备数量和数据规格。',\n 'ops-perf-optimize': '可补充现有代码、复现步骤和性能基准。',\n 'model-infer-optimize': '可补充模型路径、运行方式和精度基准。',\n}\nexport const inputHintFor = (id: string) => inputHints[id] ?? '可补充当前工程、相关代码和预期结果。'\n","/** Read only the public Session catalog and its main-view retention facts. */\nexport function inheritedWorkspaceId(workspaces: readonly { workspaceId: string; sessionIds?: readonly string[] }[], sessions: { current?: string; byId?: Record<string, { id?: string; retainedBy?: { mainView?: number } }> }): string | undefined {\n const current = sessions.current ?? Object.entries(sessions.byId ?? {}).find(([, session]) => (session.retainedBy?.mainView ?? 0) > 0)?.[0]\n return current ? workspaces.find(workspace => workspace.sessionIds?.includes(current))?.workspaceId : undefined\n}\n","export function WorkbenchIcon({ name = 'grid', size = 20 }: { name?: string; size?: number }) {\n const paths: Record<string, string> = {\n grid: 'M3 3h7v7H3z M14 3h7v7h-7z M3 14h7v7H3z M14 14h7v7h-7z',\n code: 'm8 6-6 6 6 6 M16 6l6 6-6 6 M14 3l-4 18',\n flash: 'm13 2-9 12h7l-1 8 10-13h-7z',\n document: 'M5 3h14v18H5z M8 8h8 M8 12h8 M8 16h5',\n layers: 'm12 2 10 6-10 6L2 8z M2 12l10 6 10-6 M2 16l10 6 10-6',\n nodes: 'M10 2h4v4h-4z M2 18h6v4H2z M16 18h6v4h-6z M12 6v6 M5 18v-6h14v6',\n arrows: 'M3 7h17l-4-4 M20 7l-4 4 M21 17H4l4-4 M4 17l4 4',\n chart: 'M3 13h4v8H3z M10 8h4v13h-4z M17 3h4v18h-4z',\n gear: 'M9 3h6l1 3 3 1 2 5-2 5-3 1-1 3H9l-1-3-3-1-2-5 2-5 3-1z M9 12a3 3 0 1 0 6 0a3 3 0 1 0-6 0',\n folder: 'M2 6h8l2 3h10v12H2z M2 6V3h7l3 3h10v3',\n search: 'M16 16l6 6 M18 10a8 8 0 1 0-16 0a8 8 0 1 0 16 0',\n clip: 'm8 13 7-7a3 3 0 0 1 4 4L9 20a5 5 0 0 1-7-7L13 2 M6 15l9-9',\n }\n return <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d={paths[name] ?? paths.grid} /></svg>\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { ConversationController } from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type { WorkspaceId } from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\nimport type { WorkflowSelection } from './workflow-selection.ts'\nimport type { PreparationStage } from './workbench-state.ts'\n\n/** Transfer to the resident DSH composer; its own submit policy remains authoritative. */\nexport async function launchWorkbench(ctx: Context, selection: WorkflowSelection, request: { workspaceId: string; workflow: string; prompt: string; files: readonly File[] }, signal: AbortSignal, onStage: (stage: PreparationStage) => void = () => {}) {\n if (!selection.getSnapshot().ready || selection.getSnapshot().pending) throw new Error('工作流设置尚未就绪,请稍后重试。')\n signal.throwIfAborted()\n const startingPanel = ctx.layout.panelInfo.getSnapshot().activePanelId\n // The development workspace also includes legacy Context declarations.\n const sessions = ctx.sessions as unknown as ISessions\n onStage('workspace')\n const id = await sessions.create({ workspaceId: request.workspaceId as WorkspaceId })\n signal.throwIfAborted()\n const reference = sessions.retain(id, { source: 'controllerOperation', signal })\n const conversation = ctx.conversation as ConversationController\n let attachments: ReturnType<ConversationController['createDrafts']> = []\n let transferred = false\n try {\n const binding = await reference.ready\n signal.throwIfAborted()\n if (request.workflow) onStage('dependencies')\n await selection.choose(id, request.workflow)\n signal.throwIfAborted()\n const saved = selection.getSnapshot()\n if (!saved.ready || saved.pending || saved.error || (saved.values[id] ?? '') !== request.workflow) throw new Error('工作流准备未完成,请在插件设置中查看日志后重试。')\n if (conversation.blocks.storeFor(id).getSnapshot()) throw new Error('当前对话暂时不能发送,请稍后重试。')\n const input = conversation.input.for(binding.ctx)\n const initialized = conversation.input.requestDraftInitialization(binding, { prompt: request.prompt, whenDraftExists: 'keep' })\n if (initialized !== 'applied') throw new Error('新对话已存在草稿,已保留内容,请重试。')\n if (request.files.length) {\n onStage('upload')\n if (typeof conversation.createDrafts !== 'function') throw new Error('此 DSH 版本请进入对话后添加文件。')\n attachments = conversation.createDrafts(id, request.files, true)\n await waitForUploads(conversation, attachments.map(item => item.id), signal)\n if (!input.addAttachments(attachments.map(item => item.id))) throw new Error('文件暂时无法加入对话,请重试。')\n }\n signal.throwIfAborted()\n if (ctx.layout.panelInfo.getSnapshot().activePanelId !== startingPanel) throw new Error('你已离开工作台,需求已保留;返回后可重新开始。')\n // Navigation acquires its own reference before this transaction releases ours.\n onStage('conversation')\n ctx.uiWorkspace.openSession(id)\n transferred = true\n input.submit('queue', 'click')\n } finally {\n if (!transferred) for (const attachment of attachments) conversation.releaseDraftAttachment(attachment.id)\n reference.release()\n }\n}\n\nfunction waitForUploads(conversation: ConversationController, ids: readonly string[], signal: AbortSignal): Promise<void> {\n return new Promise((resolve, reject) => {\n let unsubscribe = () => {}, timer: ReturnType<typeof setTimeout> | undefined\n const finish = (error?: unknown) => { unsubscribe(); clearTimeout(timer); signal.removeEventListener('abort', abort); error ? reject(error) : resolve() }\n const abort = () => finish(signal.reason ?? new Error('操作已取消。'))\n const check = () => {\n const uploads = conversation.fileUploads.getSnapshot()\n const failed = ids.map(id => uploads[id]).find(upload => upload?.status === 'error')\n if (failed?.status === 'error') finish(new Error(`文件上传失败:${failed.message}`))\n else if (ids.every(id => uploads[id]?.status === 'ready')) finish()\n }\n unsubscribe = conversation.fileUploads.subscribe(check)\n timer = setTimeout(() => finish(new Error('文件上传超时,请检查连接后重试。')), 120000)\n signal.addEventListener('abort', abort, { once: true })\n if (signal.aborted) abort(); else check()\n })\n}\n","import { useMemo, useRef, useState, useSyncExternalStore, type FormEvent } from 'react'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type { MainPanelId } from '@deepseek-ai/dsh-client-ui-layout/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport type { WorkflowSelection } from './workflow-selection.ts'\nimport type { ContentStore, DynamicWorkflow } from './content-store.ts'\nimport { preparationLabels, type WorkbenchStore } from './workbench-state.ts'\nimport { cardOrder, categories, guideFor, type Category } from './workbench-data.ts'\nimport { inheritedWorkspaceId } from './workbench-workspace.ts'\nimport { WorkbenchIcon } from './WorkbenchIcon.tsx'\nimport { workflowCopy } from './workflow-copy.ts'\nimport { zh, PACKAGE } from './locales.ts'\nimport { launchWorkbench } from './workbench-launch.ts'\nimport { newerVersion } from './plugin-update.ts'\n\nexport const HOME_PANEL = 'cannbot-harness-workbench' as MainPanelId\nexport const LIBRARY_PANEL = 'cannbot-harness-workflows' as MainPanelId\nconst copy = (workflow: DynamicWorkflow) => workflowCopy(workflow, key => zh[key])\nexport interface WorkbenchProps { ctx: Context; content: ContentStore; selection: WorkflowSelection; store: WorkbenchStore; library?: boolean }\n\nexport function Workbench({ ctx, content, selection, store, library = false }: WorkbenchProps) {\n const state = useSyncExternalStore(store.subscribe, store.getSnapshot)\n const { workflows, status } = useSyncExternalStore(content.subscribe, content.getSnapshot)\n const workspaceSource = ctx.workspaces.list\n const workspaceBinding = useMemo(() => ({ subscribe: (listener: () => void) => workspaceSource.subscribe(listener), getSnapshot: () => workspaceSource.getSnapshot() }), [workspaceSource])\n const workspaceState = useSyncExternalStore(workspaceBinding.subscribe, workspaceBinding.getSnapshot)\n const sessionSource = (ctx.sessions as unknown as ISessions).list\n const sessionBinding = useMemo(() => ({ subscribe: (listener: () => void) => sessionSource.subscribe(listener), getSnapshot: () => sessionSource.getSnapshot() }), [sessionSource])\n const sessionState = useSyncExternalStore(sessionBinding.subscribe, sessionBinding.getSnapshot)\n const saved = useSyncExternalStore(selection.subscribe, selection.getSnapshot)\n const [category, setCategory] = useState<Category>('全部')\n const [query, setQuery] = useState('')\n const input = useRef<HTMLTextAreaElement>(null)\n const files = useRef<HTMLInputElement>(null)\n const ordered = [...workflows].sort((a, b) => (cardOrder.indexOf(a.id) < 0 ? 999 : cardOrder.indexOf(a.id)) - (cardOrder.indexOf(b.id) < 0 ? 999 : cardOrder.indexOf(b.id)))\n const visible = ordered.filter(workflow => (category === '全部' || guideFor(workflow.id).category === category) && `${workflow.id} ${copy(workflow).description}`.toLowerCase().includes(query.toLowerCase().trim()))\n const inheritedId = inheritedWorkspaceId(workspaceState.items, sessionState)\n const workspace = workspaceState.items.find(item => item.workspaceId === (state.workspaceId || inheritedId))\n const inherited = !state.workspaceId && !!workspace && workspace.workspaceId === inheritedId\n const selected = workflows.find(item => item.id === state.workflow)\n const detail = workflows.find(item => item.id === state.detail) ?? workflows[0]\n const navigate = (panel: MainPanelId) => ctx.layout.selectPanel(panel)\n const settings = () => ctx.get('pluginNavigation')?.openBundle(PACKAGE)\n const fail = (error: unknown) => store.set({ error: error instanceof Error ? error.message : '暂时无法完成,请重试。' })\n const addWorkspace = async () => {\n if (store.getSnapshot().busy) return\n store.set({ error: '', busy: true, stage: 'workspace' })\n try {\n const path = await ctx.uiWorkspace.pickDirectory()\n if (path && !store.signal.aborted) { const created = await ctx.workspaces.create({ path }); store.set({ workspaceId: created.workspaceId }) }\n } catch (error) { fail(error) } finally { store.set({ busy: false, stage: 'idle' }) }\n }\n const start = async (event?: FormEvent) => {\n event?.preventDefault()\n if (store.getSnapshot().busy) return\n if (!workspace) { store.set({ error: '请先选择或添加工作区。' }); return }\n if (!state.prompt.trim() && state.files.length === 0) { input.current?.focus(); return }\n store.set({ busy: true, error: '', stage: 'workspace' })\n try {\n await launchWorkbench(ctx, selection, { workspaceId: workspace.workspaceId, workflow: state.workflow, prompt: state.prompt, files: state.files }, store.signal, stage => store.set({ stage }))\n store.set({ prompt: '', files: [] })\n } catch (error) { fail(error) } finally { store.set({ busy: false, stage: 'idle' }) }\n }\n const useWorkflow = (id: string, example?: string) => {\n store.set({ workflow: id, ...(example && !state.prompt.trim() ? { prompt: example } : {}), error: '' })\n navigate(HOME_PANEL)\n }\n return <main className=\"cannbot-workbench\" aria-label={library ? 'CANNBot 工作流' : 'CANNBot工作台'}>\n <header className=\"cwb-header\">\n <div className=\"cwb-workspace\"><WorkbenchIcon name=\"folder\" /><div className=\"cwb-workspace-info\"><div className=\"cwb-workspace-choice\">\n <select aria-label=\"当前工作区\" value={workspace?.workspaceId ?? ''} disabled={state.busy || workspaceState.phase !== 'ready'} onChange={event => store.set({ workspaceId: event.target.value, error: '' })}>\n {!workspace && <option value=\"\">选择工作区</option>}\n {workspaceState.items.map(item => <option key={item.workspaceId} value={item.workspaceId}>{item.title === 'default-workspace' ? '默认工作区' : item.title}</option>)}\n </select>{inherited && <span className=\"cwb-inherited\">沿用当前对话</span>}</div>{workspace && <span className=\"cwb-workspace-path\" title={workspace.path}>{workspace.path}</span>}</div><button className=\"cwb-text-button\" disabled={state.busy} onClick={() => void addWorkspace()}>+ 添加工作区</button>\n </div>\n {library && <button className=\"cwb-text-button\" onClick={settings}>插件设置</button>}\n </header>\n <div className=\"cwb-content\">\n <div className=\"cwb-heading\"><h1>{library ? '找到适合你的工作流' : '开始你的 Ascend 开发'}</h1>{library && <p>了解适用场景,准备好输入,再开始。</p>}</div>\n {!library && <>\n <form className=\"cwb-composer\" onSubmit={event => void start(event)} onDragOver={event => event.preventDefault()} onDrop={event => { event.preventDefault(); if (!state.busy) store.set({ files: [...state.files, ...Array.from(event.dataTransfer.files)] }) }}>\n <textarea ref={input} aria-label=\"开发需求\" placeholder={selected ? `例如:${guideFor(selected.id).example}` : '描述算子需求,或添加需要优化的代码。'} value={state.prompt} disabled={state.busy} onChange={event => store.set({ prompt: event.target.value })} />\n {state.files.length > 0 && <ul className=\"cwb-files\">{state.files.map((file, index) => <li key={`${file.name}-${index}`}><WorkbenchIcon name=\"document\" size={14} /><span>{file.name}</span><button type=\"button\" disabled={state.busy} aria-label={`移除 ${file.name}`} onClick={() => store.set({ files: state.files.filter((_, i) => i !== index) })}>×</button></li>)}</ul>}\n <div className=\"cwb-composer-actions\"><div className=\"cwb-composer-tools\">\n <input type=\"file\" multiple hidden ref={files} onChange={event => { store.set({ files: [...state.files, ...Array.from(event.target.files ?? [])] }); event.target.value = '' }} />\n <button type=\"button\" className=\"cwb-text-button\" disabled={state.busy} onClick={() => files.current?.click()}><WorkbenchIcon name=\"clip\" size={18} />添加文件</button>\n {state.workflow && <span className=\"cwb-selection\"><WorkbenchIcon name={guideFor(state.workflow).icon} size={16} /><span>{state.workflow}</span><button type=\"button\" disabled={state.busy} aria-label=\"取消工作流选择\" onClick={() => store.set({ workflow: '' })}>×</button></span>}\n </div><button className=\"cwb-primary\" type=\"submit\" disabled={state.busy || !saved.ready || saved.pending || (!state.prompt.trim() && !state.files.length)}>{state.busy ? '处理中…' : '开始'}<span aria-hidden=\"true\">→</span></button></div>\n </form>\n {(state.busy || !saved.ready || !workspace) && <p className=\"cwb-hint\" role=\"status\" aria-live=\"polite\">{state.busy ? preparationLabels[state.stage] : !saved.ready ? '正在连接工作流设置…' : '请先选择或添加工作区。'}</p>}\n {saved.errorKind === 'settings' && <button className=\"cwb-text-button\" onClick={() => selection.retry()}>重试连接工作流设置</button>}\n </>}\n {state.error && <div className=\"cwb-error\" role=\"alert\"><div className=\"cwb-error-heading\"><span>暂时无法开始,需求和文件已保留。</span><button type=\"button\" className=\"cwb-text-button\" disabled={state.busy || !saved.ready || saved.pending} onClick={() => void start()}>重试</button></div><details><summary>查看原因</summary><p>{state.error}</p><button className=\"cwb-text-button\" onClick={settings}>打开插件设置</button></details></div>}\n {workspaceState.state === 'error' && <p role=\"alert\" className=\"cwb-error\">工作区加载失败,请检查 DSH 连接。</p>}\n {!library && state.workflow && !selected && <p role=\"alert\" className=\"cwb-error\">所选工作流已不在当前目录中,请重新选择。</p>}\n <section className=\"cwb-catalog\" aria-label=\"工作流目录\">\n <div className=\"cwb-catalog-heading\"><h2>{library ? '全部工作流' : '工作流'}</h2><label className=\"cwb-search\"><WorkbenchIcon name=\"search\" size={17} /><input aria-label=\"搜索工作流\" placeholder=\"搜索工作流\" value={query} onChange={event => setQuery(event.target.value)} /></label></div>\n <div className=\"cwb-categories\" role=\"group\" aria-label=\"工作流分类\">{categories.map(item => <button key={item} aria-pressed={category === item} onClick={() => setCategory(item)}>{item}</button>)}</div>\n {library ? <div className=\"cwb-library\"><nav aria-label=\"选择工作流详情\" className=\"cwb-library-list\">{visible.map(workflow => <button key={workflow.id} aria-current={detail?.id === workflow.id ? 'true' : undefined} onClick={() => store.set({ detail: workflow.id })}><WorkbenchIcon name={guideFor(workflow.id).icon} /><span><strong>{workflow.id}</strong><small>{copy(workflow).description}</small></span></button>)}{!visible.length && <p className=\"cwb-empty\">没有匹配的工作流</p>}</nav>\n {detail ? <WorkflowDetail key={detail.id} workflow={detail} content={content} onUse={() => useWorkflow(detail.id)} onExample={() => useWorkflow(detail.id, guideFor(detail.id).example)} onSettings={settings} /> : <p className=\"cwb-empty\">工作流目录尚未准备完成,请到插件设置查看准备状态。</p>}\n </div> : <div className=\"cwb-grid\">{visible.map(workflow => <button type=\"button\" key={workflow.id} className=\"cwb-card\" aria-pressed={state.workflow === workflow.id} disabled={state.busy} onClick={() => { const next = state.workflow === workflow.id ? '' : workflow.id; store.set({ workflow: next, error: '' }); if (next) input.current?.focus() }}>\n <span className=\"cwb-card-icon\"><WorkbenchIcon name={guideFor(workflow.id).icon} size={23} /></span><span className=\"cwb-card-copy\"><strong>{workflow.id}</strong><span>{copy(workflow).description}</span></span><span className=\"cwb-card-corner\" aria-hidden=\"true\"><svg width=\"18\" height=\"18\" viewBox=\"0 0 20 20\" fill=\"none\"><circle cx=\"10\" cy=\"10\" r=\"8\" fill={state.workflow === workflow.id ? '#da203e' : 'none'} stroke={state.workflow === workflow.id ? '#da203e' : 'currentColor'} strokeWidth=\"1.2\" />{state.workflow === workflow.id && <path d=\"m6 10 2.6 2.6L14 7.2\" stroke=\"white\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />}</svg></span>\n </button>)}{!visible.length && <p className=\"cwb-empty\">没有匹配的工作流,请换一个关键词或分类。</p>}</div>}\n </section>\n <footer className=\"cwb-footer\"><span>{status?.phase === 'syncing' ? '正在准备工作流包…' : status?.phase === 'error' ? '工作流准备异常,请查看插件设置。' : '工作流内容可独立更新'}</span><button className=\"cwb-text-button\" onClick={settings}>查看插件设置 ↗</button></footer>\n </div>\n </main>\n}\n\nfunction WorkflowDetail({ workflow, content, onUse, onExample, onSettings }: { workflow: DynamicWorkflow; content: ContentStore; onUse(): void; onExample(): void; onSettings(): void }) {\n const { status } = useSyncExternalStore(content.subscribe, content.getSnapshot)\n const [error, setError] = useState(''), [pending, setPending] = useState(false)\n const guide = guideFor(workflow.id), row = status?.workflows?.find(item => item.id === workflow.id)\n const busy = pending || status?.busy || status?.phase === 'syncing' || status?.phase === 'initializing'\n const act = async (action: () => Promise<void>) => { setError(''); setPending(true); try { await action() } catch { setError('操作未完成,请在插件设置中查看日志后重试。') } finally { setPending(false) } }\n return <article className=\"cwb-detail\" key={workflow.id}>\n <div className=\"cwb-detail-title\"><span className=\"cwb-card-icon\"><WorkbenchIcon name={guide.icon} size={25} /></span><span><small>{guide.category}</small><h2>{workflow.id}</h2></span></div>\n <p className=\"cwb-detail-summary\">{copy(workflow).description}</p>\n <button className=\"cwb-primary\" onClick={onUse}>使用此工作流 <span aria-hidden=\"true\">→</span></button>\n <div className=\"cwb-guide-sections\">{[['适合做什么', guide.scenes], ['需要提供什么', guide.inputs], ['可以获得什么', guide.outputs]].map(([title, entries]) => <section key={title as string}><h3>{title}</h3><ul>{(entries as string[]).map(line => <li key={line}>{line}</li>)}</ul></section>)}</div>\n <section className=\"cwb-example\"><h3>试试这样描述需求</h3><p>{guide.example}</p><button className=\"cwb-text-button\" onClick={onExample}>使用此示例 ↗</button><small>已有需求会保留,不会被示例覆盖。</small></section>\n <details className=\"cwb-version\"><summary>版本与更新 {row?.version ? ` · ${row.version}` : ''}</summary><p>{row?.installed ? `已安装 ${row.version ?? ''}` : '安装状态尚未确认,请检查插件设置。'}{row?.latest && ` · 最新版本 ${row.latest}`}</p><div className=\"cwb-version-actions\"><button className=\"cwb-text-button\" disabled={busy} onClick={() => void act(content.check)}>检查更新</button>\n {row?.latest && (!row.version || newerVersion(row.latest, row.version)) && <button className=\"cwb-text-button\" disabled={busy} onClick={() => void act(() => content.update(row.id, row.latest!))}>{row.installed ? '更新工作流' : '安装工作流'}</button>}\n {row?.previous && <button className=\"cwb-text-button\" disabled={busy} onClick={() => void act(() => content.rollback(row.id))}>回退到 {row.previous}</button>}<button className=\"cwb-text-button\" onClick={onSettings}>准备日志与管理</button></div><p>初始化和验证以当前工作区的实际环境为准。</p>{error && <p role=\"alert\">{error}</p>}</details>\n </article>\n}\n","import { createElement } from 'react'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-layout/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\nimport type { WorkflowSelection } from './workflow-selection.ts'\nimport type { ContentStore } from './content-store.ts'\nimport { Workbench, HOME_PANEL, LIBRARY_PANEL } from './Workbench.tsx'\nimport { WorkbenchIcon } from './WorkbenchIcon.tsx'\nimport { createWorkbenchState } from './workbench-state.ts'\nimport { injectSlot } from './slot-compat.ts'\nimport './workbench.css'\n\n/** Optional public-slot integration: older DSH keeps its existing branded conversation. */\nexport function registerWorkbench(ctx: Context, selection: WorkflowSelection, content: ContentStore): () => void {\n const fiber = ctx.inject(['layout', 'uiWorkspace', 'workspaces'], scoped => {\n if (typeof scoped.uiWorkspace.openSession !== 'function' || typeof (scoped.sessions as unknown as ISessions).retain !== 'function'\n || typeof scoped.conversation.input.requestDraftInitialization !== 'function') return\n scoped.effect(() => {\n const store = createWorkbenchState()\n const releases: (() => void)[] = []\n for (const [id, library] of [[HOME_PANEL, false], [LIBRARY_PANEL, true]] as const) {\n releases.push(injectSlot(scoped, 'main', () => scoped.slots.register({ name: 'main', key: id }, () => createElement(Workbench, { ctx: scoped, selection, content, store, library }))))\n if (!library) releases.push(injectSlot(scoped, 'sidebar.panellist', () => scoped.slots.register({ name: 'sidebar.panellist', id, order: -100, label: 'CANNBot工作台' }, ({ size }) => createElement(WorkbenchIcon, { name: 'grid', size }))))\n }\n return () => {\n store.dispose()\n if ([HOME_PANEL, LIBRARY_PANEL].includes(scoped.layout.panelInfo.getSnapshot().activePanelId!)) scoped.layout.selectPanel(null)\n for (const release of releases.reverse()) release()\n }\n })\n })\n return () => { if (typeof fiber?.dispose === 'function') void fiber.dispose() }\n}\n","/** Browser companion using the existing DSH theme, settings and UI slots. */\nimport type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-theme/client'\nimport { en, zh, NAMESPACE, PACKAGE, type LocaleKey } from './locales.ts'\nimport { SidebarMark, SidebarName, Hero } from './Brand.tsx'\nimport { WorkflowCompat } from './WorkflowCompat.tsx'\nimport { cannTheme } from './theme.ts'\nimport interfaceCss from './interface.css?inline'\nimport './controls.css'\nimport { createElement } from 'react'\nimport { InterfaceToggle } from './InterfaceToggle.tsx'\nimport { createPresentationController } from './presentation.ts'\nimport { injectSlot } from './slot-compat.ts'\nimport { createWorkflowSelection, connectWorkflowSelection, type WorkflowSelection } from './workflow-selection.ts'\nimport { registerPluginUpdates } from './register-updates.ts'\nimport { createContentStore, type ContentStore } from './content-store.ts'\nimport { registerWorkbench } from './register-workbench.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap { cannbotHarness: LocaleKey }\n}\nexport const inject = ['slots', 'theme', 'locale', 'sessions', 'conversation']\n\n/** Register presentation with an explicit disposer so the original entries remain live underneath. */\nfunction mountInterface(ctx: Context, selection: WorkflowSelection, content: ContentStore): () => void {\n const style = document.createElement('style')\n style.dataset.cannbotHarness = 'interface'\n style.textContent = interfaceCss\n document.head.append(style)\n const releases = [\n ctx.theme.overrideTokens(PACKAGE, cannTheme),\n injectSlot(ctx, 'sidebar.brand.mark', () => ctx.slots.register({ name: 'sidebar.brand.mark', priority: -100 }, SidebarMark)),\n injectSlot(ctx, 'sidebar.brand.name', () => ctx.slots.register({ name: 'sidebar.brand.name', priority: -100 }, SidebarName)),\n injectSlot(ctx, 'conversation.hero.brand.mark', () => ctx.slots.register({ name: 'conversation.hero.brand.mark', priority: -100 }, Hero)),\n injectSlot(ctx, 'conversation.hero.agentPreset', () => ctx.slots.register({ name: 'conversation.hero.agentPreset', priority: -100, locale: NAMESPACE }, props => createElement(WorkflowCompat, { ...props, ctx, selection, content }))),\n registerWorkbench(ctx, selection, content),\n ]\n return () => { for (const release of releases.reverse()) release(); style.remove() }\n}\n\nexport function apply(ctx: Context): void {\n const content = createContentStore()\n ctx.effect(() => content.start())\n registerPluginUpdates(ctx, content)\n const selection = createWorkflowSelection((sessionId, reason) => {\n const blocks = ctx.conversation.blocks\n const id = sessionId as Parameters<typeof blocks.set>[0]\n const store = blocks.storeFor(id)\n // Do not replace a block owned by another DSH plugin.\n if (store.getSnapshot() !== undefined) return () => {}\n const block = { reason }\n blocks.set(id, block)\n return () => { if (store.getSnapshot() === block) blocks.set(id, undefined) }\n }, content.prepare)\n connectWorkflowSelection(ctx, selection)\n ctx.effect(() => () => selection.dispose())\n ctx.effect(() => ctx.locale.register(NAMESPACE, { zh, en, ja: en, es: en, fr: en, de: en, ru: en, pt: en }))\n ctx.effect(() => {\n const controller = createPresentationController(() => mountInterface(ctx, selection, content))\n const releaseToggle = injectSlot(ctx, 'sidebar.footer.action', () => ctx.slots.register({\n name: 'sidebar.footer.action', id: 'cannbot-harness-interface', order: -100,\n }, props => createElement(InterfaceToggle, { ...props, controller })))\n return () => { releaseToggle(); controller.dispose() }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;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S;KACtF,MAAM;KAAyB,IAAI;KAA6B,OAAO;IACzE,IAAG,WAAA,GAAA,MAAA,cAAA,CAAuB,iBAAiB;KAAE,GAAG;KAAO;IAAW,CAAC,CAAC,CAAC;IACrE,aAAa;KAAE,cAAc;KAAG,WAAW,QAAQ;IAAE;GACvD,CAAC;EACH"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["primitives","primitives","LegacyMenu","unwrap","raw","Fragment","interfaceCss"],"sources":["../src/client/locales.ts","../src/client/Brand.tsx","../src/workflows.ts","../src/client/workflow-copy.ts","../src/client/WorkflowIcon.tsx","../src/content-types.ts","../src/client/content-store.ts","../src/client/WorkflowSelector.tsx","../src/client/WorkflowCompat.tsx","../src/client/theme.ts","../src/client/InterfaceToggle.tsx","../src/client/presentation.ts","../src/client/slot-compat.ts","../src/client/workflow-selection.ts","../src/client/plugin-update.ts","../src/client/PluginUpdateCard.tsx","../src/client/host-update.ts","../src/client/ContentCard.tsx","../src/client/register-updates.ts","../src/client/workbench-state.ts","../src/client/workbench-data.ts","../src/client/workbench-workspace.ts","../src/client/WorkbenchIcon.tsx","../src/client/workbench-launch.ts","../src/client/Workbench.tsx","../src/client/register-workbench.ts","../src/client/index.ts"],"sourcesContent":["export const PRODUCT = 'CANNBot Harness'\nexport const NAMESPACE = 'cannbotHarness'\nexport const PACKAGE = '@cannbot-plugin/cannbot-harness'\nexport const COMMAND = '/ops-direct-invoke'\n\nexport const zh = {\n contentCatalog: '工作流目录', contentCheck: '检查工作流更新', contentVersion: '当前版本', contentLatest: '最新版本', contentPinned: '已固定回退版本',\n contentInstall: '安装', contentUpdate: '更新', contentRollback: '回退到', contentUpToDate: '已是最新', contentUnchecked: '已安装,可使用', contentNotInstalled: '未安装', contentUnavailable: '暂不可用',\n contentTitle: '工作流管理', contentSync: '更新全部工作流', contentBusy: '正在准备…', contentDownloading: '正在从 npm 获取独立工作流包…',\n contentInitializing: '正在执行官方安装器,准备工作区依赖…', contentReady: '工作流已准备完成,可独立更新。选择工作流时自动准备当前工作区。',\n contentFailed: '准备未完成。已有工作流版本保留;请查看日志后重试。', contentFallback: '正在准备首次安装的工作流包。', contentWorkflows: '个已安装工作流', contentLogs: '查看准备日志',\n updateBackground: '后台正在更新,请勿重复安装。', updateRestored: '更新失败,已恢复旧版。',\n updateRepair: '更新和恢复未完成,请在插件页重新安装原版本。', updateConnectionLost: '连接中断,后台更新可能仍在进行。请重新打开插件页确认版本,勿重复安装。', updateDismiss: '关闭更新提示',\n updateTitle: '版本更新', updateCurrent: '当前版本', updateCheck: '检查更新', updateChecking: '正在检查…',\n updateTo: '更新到', updateRunning: '正在更新…', updateAvailable: '发现新版本,点击上方按钮更新。',\n updateLatest: '当前已是最新版本。', updateDone: '更新已完成。', updateRestart: '新版已安装,重启 DSH 后生效。',\n updateManual: '当前 DSH 要求先卸载旧版。请先下载新版包,再在插件页卸载旧版并添加下载的安装包。',\n updateIncompatible: '当前 DSH 不支持此版本,请先升级 DSH。', updateFailed: '暂时无法完成,请稍后重试。', updateDownload: '下载新版安装包',\n workflow: '选择工作流', ordinary: '普通对话', saving: '正在应用工作流…', operator: 'ops-direct-invoke', commandHint: '发送时自动应用所选工作流,只需填写需求。',\n flash: 'ops-direct-invoke-flash', registry: 'ops-registry-invoke', model: 'model-infer-optimize',\n hccl: 'hccl-op-generator', triton: 'triton-op-generator', catlass: 'catlass-op-generator', performance: 'ops-perf-optimize', pypto: 'pypto-op-orchestrator',\n operatorDescription: '开发 Ascend C 算子,通过直调方式接入使用。',\n flashDescription: '快速生成并验证 Ascend C 算子。',\n registryDescription: '开发 Ascend C 注册算子,通过 ACLNN / GEIR 接入框架。',\n modelDescription: '将模型迁移到 NPU,完成精度对齐与推理性能优化。',\n hcclDescription: '开发 HCCL AICPU 通信算子,协同完成代码生成与验证。',\n tritonDescription: '生成并优化 Triton-Ascend 算子代码。',\n catlassDescription: '基于 CATLASS 模板开发矩阵计算、注意力等算子,验证精度与性能。',\n performanceDescription: '分析并优化 Ascend C 算子性能,验证精度并检查性能退化。',\n pyptoDescription: '开发并调优 PyPTO 算子,也支持对已有算子单独调优。',\n chooseWorkspace: '请先选择工作目录。', insertFailed: '工作流准备或设置未完成,请到插件详情查看准备日志后重试。', settingsRetry: '设置连接失败,重试', workflowRetry: '工作流未就绪,重试',\n}\nexport const en: typeof zh = {\n contentCatalog: 'Workflow catalog', contentCheck: 'Check workflow updates', contentVersion: 'Installed', contentLatest: 'Latest', contentPinned: 'Rolled-back version pinned',\n contentInstall: 'Install', contentUpdate: 'Update', contentRollback: 'Roll back to', contentUpToDate: 'Up to date', contentUnchecked: 'Installed and ready', contentNotInstalled: 'Not installed', contentUnavailable: 'Unavailable',\n contentTitle: 'Workflow manager', contentSync: 'Update all workflows', contentBusy: 'Preparing…', contentDownloading: 'Fetching independent workflow packages from npm…',\n contentInitializing: 'Running the official installer to prepare workspace dependencies…', contentReady: 'Workflows are ready and can be updated independently. Selecting one prepares this workspace automatically.',\n contentFailed: 'Preparation did not finish. Existing workflow versions are retained; check the log and retry.', contentFallback: 'Preparing the first workflow package installation.', contentWorkflows: 'installed workflows', contentLogs: 'View preparation log',\n updateBackground: 'Updating in the background. Do not install again.', updateRestored: 'Update failed; the previous version was restored.',\n updateRepair: 'Update and recovery did not finish. Reinstall the previous version from Plugins.', updateConnectionLost: 'Connection lost. The Host may still be updating. Reopen Plugins to check the version before retrying.', updateDismiss: 'Dismiss update notice',\n updateTitle: 'Updates', updateCurrent: 'Installed version', updateCheck: 'Check for updates', updateChecking: 'Checking…',\n updateTo: 'Update to', updateRunning: 'Updating…', updateAvailable: 'A new version is available. Use the button above to update.',\n updateLatest: 'You are up to date.', updateDone: 'Update completed.', updateRestart: 'The update is installed. Restart DSH to apply it.',\n updateManual: 'This DSH version requires removing the old plugin first. Download the update, then uninstall the old plugin and add the downloaded package.',\n updateIncompatible: 'This release requires updating DSH first.', updateFailed: 'Unable to complete this operation. Please retry.', updateDownload: 'Download update',\n workflow: 'Choose workflow', ordinary: 'Ordinary conversation', saving: 'Applying workflow…', operator: 'ops-direct-invoke', commandHint: 'The selected workflow is applied in the background when you send.',\n flash: 'ops-direct-invoke-flash', registry: 'ops-registry-invoke', model: 'model-infer-optimize',\n hccl: 'hccl-op-generator', triton: 'triton-op-generator', catlass: 'catlass-op-generator', performance: 'ops-perf-optimize', pypto: 'pypto-op-orchestrator',\n operatorDescription: 'Develop Ascend C operators and integrate them through direct invocation.',\n flashDescription: 'Quickly generate and validate Ascend C operators.',\n registryDescription: 'Develop registered Ascend C operators for framework integration through ACLNN / GEIR.',\n modelDescription: 'Migrate models to NPU, align accuracy and optimize inference performance.',\n hcclDescription: 'Develop HCCL AICPU communication operators with coordinated code generation and validation.',\n tritonDescription: 'Generate and optimize Triton-Ascend operator code.',\n catlassDescription: 'Build matrix and attention operators using CATLASS templates; validate accuracy and performance.',\n performanceDescription: 'Analyze and optimize Ascend C operator performance, checking accuracy and regressions.',\n pyptoDescription: 'Develop and tune PyPTO operators, or tune existing operators independently.',\n chooseWorkspace: 'Choose a working directory first.', insertFailed: 'Workflow preparation or saving failed. Check preparation logs in the plugin details and retry.', settingsRetry: 'Reconnect settings', workflowRetry: 'Retry workflow',\n}\nexport type LocaleKey = keyof typeof zh\n","import type { HeroBrandMarkOwnerProps } from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type { SidebarBrandMarkOwnerProps } from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport { PRODUCT } from './locales.ts'\n\nexport function Mark({ size }: { size: number }) {\n return <svg width={size} height={size} viewBox=\"0 0 40 40\" aria-hidden=\"true\">\n <rect x=\"1\" y=\"1\" width=\"38\" height=\"38\" rx=\"12\" fill=\"var(--dsw-alias-brand-primary)\" />\n <path d=\"M27 12a11 11 0 1 0 0 16\" fill=\"none\" stroke=\"var(--dsw-alias-label-primary-foreground)\" strokeWidth=\"4\" strokeLinecap=\"round\" />\n </svg>\n}\nexport function SidebarMark({ size }: SidebarBrandMarkOwnerProps) { return <Mark size={size} /> }\nexport function SidebarName() { return <span className=\"cannbot-harness-name\">{PRODUCT}</span> }\nexport function Hero({ size }: HeroBrandMarkOwnerProps) {\n return <span data-cannbot-harness-hero=\"\"><Mark size={size} /><span>{PRODUCT}</span></span>\n}\n","export const WORKFLOWS = [\n { id: 'ops-direct-invoke', label: 'operator', description: 'operatorDescription' },\n { id: 'ops-direct-invoke-flash', label: 'flash', description: 'flashDescription' },\n { id: 'ops-registry-invoke', label: 'registry', description: 'registryDescription' },\n { id: 'model-infer-optimize', label: 'model', description: 'modelDescription' },\n { id: 'hccl-op-generator', label: 'hccl', description: 'hcclDescription' },\n { id: 'triton-op-generator', label: 'triton', description: 'tritonDescription' },\n { id: 'catlass-op-generator', label: 'catlass', description: 'catlassDescription' },\n { id: 'ops-perf-optimize', label: 'performance', description: 'performanceDescription' },\n { id: 'pypto-op-orchestrator', label: 'pypto', description: 'pyptoDescription' },\n] as const\n","import { WORKFLOWS } from '../workflows.ts'\nimport type { LocaleKey } from './locales.ts'\n\n/** Keep presentation consistent even when an older workflow package has a Chinese title. */\nexport function workflowCopy(workflow: { id: string; title: string; description?: string }, t: (key: LocaleKey) => string) {\n const known = WORKFLOWS.find(item => item.id === workflow.id)\n return { name: workflow.id, description: known ? t(known.description) : workflow.description ?? (workflow.title === workflow.id ? '' : workflow.title) }\n}\n","import * as primitives from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ComponentType } from 'react'\n\n/** The exact icon component used by DSH's original Standard mode selector. */\nexport function WorkflowIcon({ size = 16 }: { size?: number }) {\n const icons = primitives as unknown as Record<string, ComponentType<{ size?: number }>>\n const Icon = icons.IconAgentPresetOutlineRegular ?? icons.IconAgentPresetOutline16 ?? icons.IconRefreshOutline16\n return Icon ? <Icon size={size} /> : null\n}\n\nexport function ChevronIcon({ size = 12 }: { size?: number }) {\n const icons = primitives as unknown as Record<string, ComponentType<{ size?: number }>>\n const Icon = icons.IconChevronDownOutlineRegular ?? icons.IconChevronDownOutline14\n return Icon ? <Icon size={size} /> : <svg width={size} height={size} viewBox=\"0 0 12 12\" fill=\"none\" aria-hidden=\"true\"><path d=\"m3 4.5 3 3 3-3\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n}\n","export interface ContentPlugin { id: string; title: string; aliases: Record<string, string>; resourceDirectory?: string; version?: string; packageName?: string }\nexport interface ContentSkill { name: string; originalName: string; pluginId: string; path: string; entry: boolean }\nexport interface ContentCatalog { revision?: string; commit?: string; skillsCommit?: string; plugins: ContentPlugin[]; exposedSkills: ContentSkill[] }\nexport interface WorkflowEntry { id: string; title: string; package: string; default: boolean }\nexport interface WorkflowRow extends WorkflowEntry {\n version?: string; latest?: string; previous?: string; installed: boolean; pinned: boolean; error?: string\n}\nexport interface WorkflowDescriptor {\n schemaVersion: 1; id: string; title: string; version: string\n initialization: { kind: 'cannbot-cli'; entry: string } | { kind: 'skill-native' }\n skills: { name: string; path: string; hash: string; entry: boolean }[]\n source: { repository: string; commit: string; skillsCommit: string }\n}\nexport interface ContentStatus {\n phase: 'idle' | 'syncing' | 'ready' | 'error' | 'initializing'\n plugins: { id: string; title: string }[]\n commit?: string; skillsCommit?: string; updatedAt?: string\n fallback: boolean; message: string; log: string\n workflows?: WorkflowRow[]; busy?: boolean; catalogVersion?: string\n}\nexport const CONTENT_PATH = 'api/cannbot-harness/content'\n","import { WORKFLOWS } from '../workflows.ts'\nimport { CONTENT_PATH, type ContentStatus } from '../content-types.ts'\nexport interface DynamicWorkflow { id: string; title: string }\nconst initial: { workflows: DynamicWorkflow[]; status: ContentStatus | undefined } = { workflows: WORKFLOWS.map(({ id }) => ({ id, title: id })), status: undefined }\nexport function createContentStore() {\n let state = initial, closed = false, timer: ReturnType<typeof setTimeout> | undefined\n const listeners = new Set<() => void>()\n const publish = (status: ContentStatus) => { if (!closed) { state = { status, workflows: status.plugins }; for (const listener of listeners) listener() } }\n const endpoint = () => new URL(CONTENT_PATH, document.baseURI)\n const pull = async () => {\n try {\n const response = await fetch(endpoint(), { credentials: 'same-origin', cache: 'no-store', signal: AbortSignal.timeout(15000) })\n if (response.ok) {\n const status = await response.json() as ContentStatus\n if (Array.isArray(status.plugins) && status.plugins.every(item => /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(item.id) && typeof item.title === 'string')) publish(status)\n }\n } catch { /* Keep the last catalog across a short disconnect. */ }\n }\n const post = async (body: object) => {\n const response = await fetch(endpoint(), { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) })\n if (!response.ok) { await pull(); throw new Error(state.status?.message || '工作流准备失败,请检查插件日志。') }\n await pull()\n }\n return {\n getSnapshot: () => state,\n subscribe(listener: () => void) { listeners.add(listener); return () => { listeners.delete(listener) } },\n start() {\n const tick = async () => { await pull(); if (!closed) timer = setTimeout(() => { void tick() }, 3000) }\n void tick()\n return () => { closed = true; clearTimeout(timer); listeners.clear() }\n },\n sync: () => post({ action: 'sync' }),\n check: () => post({ action: 'check' }),\n update: (id: string, version: string) => post({ action: 'update', id, version }),\n rollback: (id: string) => post({ action: 'rollback', id }),\n prepare: (sessionId: string, id: string) => post({ action: 'prepare', sessionId, id }),\n }\n}\nexport type ContentStore = ReturnType<typeof createContentStore>\nexport const fallbackContent = { getSnapshot: () => initial, subscribe: (_: () => void) => () => {} }\n","import { useState, useSyncExternalStore, type ComponentType, type ReactNode } from 'react'\nimport * as primitives from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport { workflowCopy } from './workflow-copy.ts'\nimport { WorkflowIcon, ChevronIcon } from './WorkflowIcon.tsx'\nimport type { WorkflowSelection } from './workflow-selection.ts'\nimport { fallbackContent, type ContentStore, type DynamicWorkflow } from './content-store.ts'\n\nexport type WorkflowProps = PropsRuntime<'conversation.hero.agentPreset'> & PropsLocale<'cannbotHarness'> & { selection: WorkflowSelection; content?: ContentStore }\n\n/** Select a workflow without submitting, replacing text, or discarding reference chips. */\nexport function WorkflowSelector({ sessionId, inputActions, useInput, t, selection, content = fallbackContent as ContentStore }: WorkflowProps) {\n const { workflows } = useSyncExternalStore(content.subscribe, content.getSnapshot)\n const copy = (workflow: DynamicWorkflow) => workflowCopy(workflow, t)\n const input = useInput(state => state)\n const saved = useSyncExternalStore(selection.subscribe, selection.getSnapshot)\n const [open, setOpen] = useState(false)\n const selected = workflows.find(workflow => sessionId && saved.values[sessionId] === workflow.id)\n const available = !!sessionId && saved.ready && !saved.pending && inputActions !== undefined && input !== undefined && input.phase === 'plain'\n const pick = (id: string) => {\n setOpen(false)\n if (sessionId && available) void selection.choose(sessionId, id, t('saving'))\n }\n const anchor = (\n <button type=\"button\" className=\"cannbot-harness-workflow-trigger\" aria-label={t('workflow')} aria-haspopup=\"menu\" aria-expanded={open}\n disabled={!available} title={inputActions === undefined ? t('chooseWorkspace') : t('commandHint')}\n onClick={() => setOpen(value => !value)}>\n <WorkflowIcon />\n <span className=\"cannbot-harness-workflow-label\" lang={selected ? 'en' : undefined}>{selected ? copy(selected).name : t('workflow')}</span><ChevronIcon size={12} />\n </button>\n )\n const label = (workflow: DynamicWorkflow) => <span className=\"cannbot-harness-workflow-option\">\n <span lang=\"en\">{copy(workflow).name}</span>\n {copy(workflow).description && <>{' '}<small>{copy(workflow).description}</small></>}\n </span>\n const { Menu, MenuItemButton } = primitives\n const LegacyMenu = Menu as unknown as ComponentType<{ open: boolean; anchor: ReactNode; portal: boolean; className: string; onClose(): void; selectedId?: string; onSelect(id: string): void; items: { id: string; label: ReactNode; icon: ReactNode }[] }>\n return <span className=\"cannbot-harness-workflow\">\n {typeof MenuItemButton === 'function' ? <Menu open={open} onClose={() => setOpen(false)} portal className=\"cannbot-harness-workflow-anchor\" anchor={anchor}>\n <MenuItemButton icon={<WorkflowIcon />} onSelect={() => pick('')}>{t('ordinary')}</MenuItemButton>\n {workflows.map(workflow => <MenuItemButton key={workflow.id} icon={<WorkflowIcon />} onSelect={() => pick(workflow.id)}>{label(workflow)}</MenuItemButton>)}\n </Menu> : <LegacyMenu open={open} onClose={() => setOpen(false)} portal className=\"cannbot-harness-workflow-anchor\" anchor={anchor}\n selectedId={selected?.id} items={[{ id: '', label: t('ordinary'), icon: <WorkflowIcon /> }, ...workflows.map(workflow => ({ id: workflow.id, label: label(workflow), icon: <WorkflowIcon /> }))]}\n onSelect={pick} />}\n {saved.error && <span role=\"alert\" className=\"cannbot-harness-error\">\n <button type=\"button\" onClick={() => selection.retry()} title={t('insertFailed')}>\n {t(saved.errorKind === 'settings' ? 'settingsRetry' : 'workflowRetry')}\n </button>\n </span>}\n </span>\n}\n","import { useMemo, useSyncExternalStore } from 'react'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport { WorkflowSelector, type WorkflowProps } from './WorkflowSelector.tsx'\n\n/** Older DSH declares the hero seat at root scope. Resolve its current session\n * through the public services rather than reaching into the editor or DOM. */\nexport function WorkflowCompat({ ctx, ...props }: WorkflowProps & { ctx: Context }) {\n return typeof props.useInput === 'function'\n ? <WorkflowSelector {...props} />\n : <LegacyWorkflow ctx={ctx} {...props} />\n}\n\nfunction LegacyWorkflow({ ctx, ...props }: WorkflowProps & { ctx: Context }) {\n type Input = ReturnType<Context['conversation']['input']['for']>\n const legacy = ctx as unknown as { sessions: { list: { subscribe(listener: () => void): () => void; getSnapshot(): { current?: string } }; scope(id: string): Context | undefined } }\n const sessions = useSyncExternalStore(legacy.sessions.list.subscribe, legacy.sessions.list.getSnapshot)\n const input = useMemo(() => {\n const scope = sessions.current && legacy.sessions.scope(sessions.current)\n return scope ? ctx.conversation.input.for(scope) as Input : undefined\n }, [ctx, sessions.current])\n const state = useSyncExternalStore(input?.state.subscribe ?? noSubscribe, input?.state.getSnapshot ?? noSnapshot)\n return <WorkflowSelector {...props} sessionId={sessions.current as WorkflowProps['sessionId']} useInput={select => state ? select(state) : undefined as never} inputActions={input ? {} as WorkflowProps['inputActions'] : undefined} />\n}\nconst noSubscribe = () => () => {}\nconst noSnapshot = () => undefined\n","import type { ThemeTokenOverrides } from '@deepseek-ai/dsh-client-ui-theme/client'\n\n/** Portal design-v2 palette, applied through the documented theme override layer. */\nexport const cannTheme: ThemeTokenOverrides = Object.fromEntries(Object.entries({\n '--dsw-alias-bg-base': ['#ffffff', '#101114'],\n '--dsw-alias-bg-layer-1': ['#ffffff', '#17191e'],\n '--dsw-alias-bg-layer-2': ['#ffffff', '#1d2026'],\n '--dsw-alias-bg-layer-3': ['#f6f8fa', '#252830'],\n '--dsw-specific-sidebar-fill': ['#f6f8fa', '#14161b'],\n '--dsw-specific-input-major': ['#ffffff', '#1d2026'],\n '--dsw-specific-sidebar-nav-item-active': ['#fdeef0', '#392029'],\n '--dsw-specific-sidebar-nav-item-active-accent': ['#fdeef0', '#392029'],\n '--dsw-alias-label-primary': ['#17181d', '#f3f4f6'],\n '--dsw-alias-label-primary-foreground': ['#ffffff', '#ffffff'],\n '--dsw-alias-label-primary-inverted': ['#ffffff', '#ffffff'],\n '--dsw-alias-label-primary-dimmed': ['#30343e', '#dde1e8'],\n '--dsw-alias-label-primary-bluish': ['#7f0f26', '#ff9aab'],\n '--dsw-alias-label-secondary': ['#59637a', '#b0b8c7'],\n '--dsw-alias-label-tertiary': ['#727d91', '#929db0'],\n '--dsw-alias-brand-primary': ['#da203e', '#ef4560'],\n '--dsw-alias-brand-text': ['#17181d', '#f3f4f6'],\n '--dsw-alias-button-primary-hover': ['#b11430', '#ff647d'],\n '--dsw-alias-button-info-fill': ['#da203e', '#da203e'],\n '--dsw-alias-button-info-hover': ['#b11430', '#b11430'],\n '--dsw-alias-state-business-primary': ['#da203e', '#ff8297'],\n '--dsw-alias-state-business-tertiary': ['#fdeef0', '#392029'],\n '--dsw-alias-link': ['#b11430', '#ff9aab'],\n '--dsw-focus-ring-color': ['#da203e', '#ff8297'],\n '--dsw-alias-border-l1': ['#f0f1f5', '#252830'],\n '--dsw-alias-border-l2': ['#e6e9ef', '#323641'],\n '--dsw-alias-border-l3': ['#dce0e8', '#414754'],\n '--dsw-alias-border-l4': ['#ced4df', '#505867'],\n '--dsw-alias-interactive-bg-hover': ['#eef0f4', '#252830'],\n '--dsw-alias-interactive-bg-active': ['#fdeef0', '#392029'],\n '--dsw-specific-bubble': ['#fff3f5', '#302027'],\n '--dsw-specific-bubble-highlight': ['#fbd6dd', '#59303d'],\n '--dsw-radius-panel': ['18px', '18px'],\n '--dsw-radius-xl': ['14px', '14px'],\n '--dsw-radius-lg': ['12px', '12px'],\n '--dsw-radius-md': ['10px', '10px'],\n '--cann-grid': ['#e6e9ef', '#323641'],\n '--cann-night': ['#0e0f12', '#0e0f12'],\n '--cann-night-label': ['#dde1e8', '#dde1e8'],\n}).map(([name, values]) => [name, { light: values[0]!, dark: values[1]! }]))\n","import { useSyncExternalStore } from 'react'\nimport type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { PresentationController } from './presentation.ts'\nimport { Mark } from './Brand.tsx'\nimport { PRODUCT } from './locales.ts'\n\nexport function InterfaceToggle({ wide, controller }: PropsRuntime<'sidebar.footer.action'> & { controller: PresentationController }) {\n const enabled = useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot)\n return <div className={`cannbot-harness-toggle${wide ? '' : ' cannbot-harness-toggle-compact'}`}>\n <span className=\"cannbot-harness-toggle-name\" title={PRODUCT}><Mark size={20} />{wide && <span>{PRODUCT}</span>}</span>\n <button type=\"button\" role=\"switch\" aria-label={PRODUCT} aria-checked={enabled} title={PRODUCT}\n className=\"cannbot-harness-switch\" onClick={() => controller.setEnabled(!enabled)}><span /></button>\n </div>\n}\n","/** Per-activation UI preference: enabling the plugin always starts with its interface on. */\nexport interface PresentationController {\n getSnapshot(): boolean\n subscribe(listener: () => void): () => void\n setEnabled(enabled: boolean): void\n dispose(): void\n}\nexport function createPresentationController(mount: () => () => void): PresentationController {\n let enabled = true\n let stopped = false\n let unmount: (() => void) | undefined = mount()\n const listeners = new Set<() => void>()\n return {\n getSnapshot: () => enabled,\n subscribe(listener) { listeners.add(listener); return () => { listeners.delete(listener) } },\n setEnabled(next) {\n if (stopped || next === enabled) return\n if (next) unmount = mount()\n else { unmount?.(); unmount = undefined }\n enabled = next\n for (const listener of listeners) listener()\n },\n dispose() { if (stopped) return; stopped = true; unmount?.(); unmount = undefined; listeners.clear() },\n }\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { SlotMap } from '@deepseek-ai/dsh-client-ui-slots'\n\n/** Older DSH declares the injected parent modules before this plugin and uses direct register(). */\nexport function injectSlot(ctx: Context, name: keyof SlotMap & string, register: () => () => void): () => void {\n return typeof ctx.slots.inject === 'function' ? ctx.slots.inject(name, register) : register()\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport { WORKFLOWS } from '../workflows.ts'\n\nconst NS = 'cannbot-harness'\ntype Values = Record<string, string>\ninterface Choice { sessionId: string; workflow: string }\ninterface View { ns: string; value: { selections?: Choice[] }; revision?: number }\nconst valuesOf = (view?: View): Values => Object.fromEntries((view?.value.selections ?? []).map(item => [item.sessionId, item.workflow]))\nexport interface WorkflowTransport {\n describe(): Promise<{ namespaces: View[] }>\n update(ns: string, patch: { selections: Choice[] }, revision?: number): Promise<View>\n}\nexport interface SelectionSnapshot { ready: boolean; pending: boolean; error: boolean; errorKind?: 'settings' | 'prepare' | 'save'; errorMessage?: string; values: Values }\nexport interface WorkflowSelection {\n subscribe(listener: () => void): () => void\n getSnapshot(): SelectionSnapshot\n attach(transport: WorkflowTransport): () => void\n choose(sessionId: string, workflow: string, reason?: string): Promise<void>\n retry(): void\n dispose(): void\n}\nexport function createWorkflowSelection(blockSubmission: (sessionId: string, reason: string) => () => void = () => () => {}, prepare: (sessionId: string, id: string) => Promise<void> = async () => {}): WorkflowSelection {\n let snapshot: SelectionSnapshot = { ready: false, pending: false, error: false, values: {} }\n let transport: WorkflowTransport | undefined\n let generation = 0\n let pendingRelease: (() => void) | undefined\n let timer: ReturnType<typeof setTimeout> | undefined\n let lastChoice: { sessionId: string; workflow: string; reason: string } | undefined\n const listeners = new Set<() => void>()\n const publish = (next: SelectionSnapshot) => { snapshot = next; for (const listener of listeners) listener() }\n const read = async (current: WorkflowTransport, own: number, attempt = 0) => {\n try {\n const view = await current.describe()\n if (own !== generation) return\n const section = view.namespaces.find(item => item.ns === NS)\n if (!section) throw new Error('Workflow settings are not active yet')\n publish({ ready: true, pending: false, error: false, values: valuesOf(section) })\n } catch {\n if (own !== generation) return\n // Profile settings describe only active fibers. A browser can connect while\n // async plugin activation or a profile reload is still completing.\n if (attempt >= 9) publish({ ...snapshot, ready: false, pending: false, error: true, errorKind: 'settings' })\n timer = setTimeout(() => { void read(current, own, Math.min(attempt + 1, 9)) }, attempt < 9 ? Math.min(250 * (attempt + 1), 1500) : 5000)\n }\n }\n const api: WorkflowSelection = {\n subscribe(listener) { listeners.add(listener); return () => { listeners.delete(listener) } },\n getSnapshot: () => snapshot,\n attach(next) {\n clearTimeout(timer)\n pendingRelease?.(); pendingRelease = undefined\n transport = next\n const own = ++generation\n publish({ ...snapshot, ready: false, pending: false, error: false, errorKind: undefined })\n void read(next, own)\n return () => { if (own === generation) { generation++; clearTimeout(timer); transport = undefined; publish({ ...snapshot, ready: false }) } }\n },\n async choose(sessionId, workflow, reason = 'CANNBot Harness…') {\n if (!transport || !snapshot.ready || snapshot.pending) return\n if (workflow !== '' && !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(workflow)) throw new Error('Unknown workflow')\n const current = transport, own = generation\n lastChoice = { sessionId, workflow, reason }\n const unblock = blockSubmission(sessionId, reason)\n let released = false\n const release = () => { if (!released) { released = true; unblock() } }\n pendingRelease = release\n publish({ ...snapshot, pending: true, error: false, errorKind: undefined, errorMessage: undefined })\n let stage: 'prepare' | 'save' = 'prepare'\n try {\n if (workflow) await prepare(sessionId, workflow)\n stage = 'save'\n // Fresh revision prevents simultaneous windows from overwriting selections.\n const view = (await current.describe()).namespaces.find(item => item.ns === NS)\n if (!view) throw new Error('Workflow settings unavailable')\n const values = { ...valuesOf(view), [sessionId]: workflow }\n const selections = Object.entries(values).filter(([, id]) => id !== '').map(([sessionId, workflow]) => ({ sessionId, workflow }))\n const result = await current.update(NS, { selections }, view.revision)\n if (own === generation) publish({ ready: true, pending: false, error: false, values: valuesOf(result) })\n } catch (error) {\n if (own === generation) publish({ ...snapshot, pending: false, error: true, errorKind: stage, errorMessage: error instanceof Error ? error.message : undefined })\n } finally {\n release()\n if (pendingRelease === release) pendingRelease = undefined\n }\n },\n retry() {\n if (snapshot.errorKind === 'settings' && transport) {\n clearTimeout(timer)\n publish({ ...snapshot, error: false, errorKind: undefined })\n void read(transport, generation)\n } else if (lastChoice) void api.choose(lastChoice.sessionId, lastChoice.workflow, lastChoice.reason)\n },\n dispose() { generation++; clearTimeout(timer); transport = undefined; pendingRelease?.(); pendingRelease = undefined; listeners.clear() },\n }\n return api\n}\n\n/** Both transports are official DSH settings APIs; no private editor access. */\nexport function connectWorkflowSelection(ctx: Context, selection: WorkflowSelection) {\n ctx.inject(['remote', 'remote.settings'], scoped => {\n const settings = scoped.remote.settings\n scoped.effect(() => selection.attach({\n describe: async () => unwrap(await settings.describe()),\n update: async (ns, patch, revision) => unwrap(await settings.update(ns, patch, revision)),\n }))\n })\n ctx.inject(['connection'], scoped => {\n const api = (scoped as unknown as { connection: { api?: { settings: { describe(payload: object): Promise<unknown>; update(payload: object): Promise<unknown> } } } }).connection.api\n if (!api?.settings) return\n scoped.effect(() => selection.attach({\n describe: async () => unwrap(await api.settings.describe({})),\n update: async (ns, patch, expectedRevision) => unwrap(await api.settings.update({ ns, patch, expectedRevision })),\n }))\n })\n}\nfunction unwrap<T>(response: unknown): T {\n const raw = response as { result?: unknown }\n const result = (raw.result ?? response) as { ok: boolean; value: T; error?: { message: string } }\n if (!result.ok) throw new Error(result.error?.message ?? 'Workflow settings failed')\n return result.value\n}\n","export const UPDATE_PACKAGES = ['cannbot-harness', '@cannbot-plugin/cannbot-harness'] as const\nexport interface InstalledBundle { name: string; version?: string; installed: boolean }\nexport interface Change { application: string; error?: { code: string }; version?: string }\nexport interface UpdateBridge {\n list(): Promise<InstalledBundle[]>\n install(spec: string): Promise<Change>\n update?(name: string, version: string): Promise<{ result: Change; restore?: Change }>\n}\nexport interface Release { name: string; version: string; tarball: string }\nexport type UpdatePhase = 'idle' | 'checking' | 'latest' | 'available' | 'updating' | 'done' | 'restart' | 'manual' | 'incompatible' | 'error'\nexport interface UpdateSnapshot { phase: UpdatePhase; current?: string; release?: Release; packageName?: string }\n\n/** Only stable npm releases of our two installation entries may be selected. */\nexport function newerVersion(candidate: string, current: string): boolean {\n const next = /^(\\d+)\\.(\\d+)\\.(\\d+)$/.exec(candidate)\n const old = /^(\\d+)\\.(\\d+)\\.(\\d+)(?:[-+].*)?$/.exec(current)\n if (!next || !old) return false\n for (let index = 1; index < 4; index++) {\n const difference = Number(next[index]) - Number(old[index])\n if (difference) return difference > 0\n }\n return current.includes('-')\n}\n\nexport async function latestRelease(name: string, signal: AbortSignal): Promise<Release> {\n if (!UPDATE_PACKAGES.includes(name as typeof UPDATE_PACKAGES[number])) throw new Error('Unsupported update target')\n const answers = await Promise.allSettled(['https://registry.npmjs.org/', 'https://registry.npmmirror.com/'].map(async registry => {\n const response = await fetch(`${registry}${encodeURIComponent(name)}/latest`, {\n signal: AbortSignal.any([signal, AbortSignal.timeout(15000)]), cache: 'no-store',\n })\n if (!response.ok) throw new Error('Registry unavailable')\n const manifest = await response.json() as { name?: string; version?: string; dist?: { tarball?: string }; dsh?: { bundle?: unknown } }\n if (manifest.name !== name || !manifest.version || !/^\\d+\\.\\d+\\.\\d+$/.test(manifest.version) || !manifest.dsh?.bundle || !manifest.dist?.tarball) throw new Error('Invalid release')\n const url = new URL(manifest.dist.tarball)\n if (url.protocol !== 'https:' || !['registry.npmjs.org', 'registry.npmmirror.com'].includes(url.hostname)) throw new Error('Invalid download origin')\n return { name, version: manifest.version, tarball: url.href }\n }))\n signal.throwIfAborted()\n const releases = answers.flatMap(answer => answer.status === 'fulfilled' ? [answer.value] : [])\n const latest = releases.reduce<Release | undefined>((best, release) => !best || newerVersion(release.version, best.version) ? release : best, undefined)\n if (!latest) throw new Error('No release available')\n return latest\n}\n\nexport function createPluginUpdater(bridge: UpdateBridge, requestedName: string, lookup = latestRelease) {\n let state: UpdateSnapshot = { phase: 'idle' }\n let disposed = false\n let checking: AbortController | undefined\n const listeners = new Set<() => void>()\n const publish = (next: UpdateSnapshot) => { if (disposed) return; state = next; for (const listener of listeners) listener() }\n const failed = (result: Change) => !['applied', 'restart-required'].includes(result.application) || !!result.error\n return {\n getSnapshot: () => state,\n subscribe(listener: () => void) { listeners.add(listener); return () => { listeners.delete(listener) } },\n async check() {\n if (disposed || state.phase === 'checking' || state.phase === 'updating') return\n checking?.abort()\n const abort = new AbortController()\n checking = abort\n publish({ ...state, phase: 'checking' })\n try {\n const bundles = (await bridge.list()).filter(bundle => bundle.installed && UPDATE_PACKAGES.includes(bundle.name as typeof UPDATE_PACKAGES[number]))\n // Update the actual direct dependency, preserving short/long installation form.\n const bundle = bundles.find(bundle => bundle.name === requestedName) ?? bundles[0]\n if (!bundle?.version) throw new Error('Installed entry unavailable')\n publish({ ...state, current: bundle.version, packageName: bundle.name })\n const release = await lookup(bundle.name, abort.signal)\n if (checking !== abort || disposed) return\n publish({ phase: newerVersion(release.version, bundle.version) ? 'available' : 'latest', current: bundle.version, release, packageName: bundle.name })\n } catch {\n if (!abort.signal.aborted) publish({ ...state, phase: 'error' })\n }\n },\n async update() {\n if (disposed || state.phase !== 'available' || !state.release || !state.packageName) return\n const target = state.release, name = state.packageName\n publish({ ...state, phase: 'updating' })\n try {\n // The Host owns the complete transaction, including self-removal and recovery.\n // Frontend disposal must never cancel an update that already started.\n const answer = bridge.update\n ? await bridge.update(name, target.version)\n : { result: await bridge.install(`${name}@${target.version}`) }\n const result = answer.result\n if (failed(result)) {\n const code = result.error?.code\n publish({ ...state, phase: code === 'already-installed' || code === 'stop-profile' ? 'manual' : code === 'incompatible-version' ? 'incompatible' : 'error' })\n } else {\n publish({ ...state, phase: result.application === 'restart-required' ? 'restart' : 'done', current: target.version })\n }\n } catch { publish({ ...state, phase: 'error' }) }\n },\n dispose() { disposed = true; checking?.abort(); listeners.clear() },\n }\n}\nexport type PluginUpdater = ReturnType<typeof createPluginUpdater>\n","import { useEffect, useSyncExternalStore } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { PluginUpdater } from './plugin-update.ts'\n\nexport function PluginUpdateCard({ updater, t }: { updater: PluginUpdater } & PropsLocale<'cannbotHarness'>) {\n const state = useSyncExternalStore(updater.subscribe, updater.getSnapshot)\n useEffect(() => { void updater.check() }, [updater])\n const busy = state.phase === 'checking' || state.phase === 'updating'\n const canUpdate = state.phase === 'available'\n const message = state.phase === 'latest' ? t('updateLatest')\n : state.phase === 'available' ? t('updateAvailable')\n : state.phase === 'updating' ? t('updateRunning')\n : state.phase === 'done' ? t('updateDone')\n : state.phase === 'restart' ? t('updateRestart')\n : state.phase === 'manual' ? t('updateManual')\n : state.phase === 'incompatible' ? t('updateIncompatible')\n : state.phase === 'error' ? t('updateFailed') : ''\n return <section className=\"cannbot-harness-update\" aria-label={t('updateTitle')}>\n <div className=\"cannbot-harness-update-heading\"><h4>{t('updateTitle')}</h4>\n {state.current && <span>{t('updateCurrent')} {state.current}</span>}</div>\n <div className=\"cannbot-harness-update-actions\">\n {state.phase === 'manual' && state.release ? <>\n <a className=\"cannbot-harness-update-button\" href={state.release.tarball} download rel=\"noreferrer\">{t('updateDownload')} {state.release.version}</a>\n <button type=\"button\" className=\"cannbot-harness-update-recheck\" onClick={() => { void updater.check() }}>{t('updateCheck')}</button>\n </> :\n <button type=\"button\" className=\"cannbot-harness-update-button\" disabled={busy}\n onClick={() => { void (canUpdate ? updater.update() : updater.check()) }}>\n {state.phase === 'checking' ? t('updateChecking') : state.phase === 'updating' ? t('updateRunning')\n : canUpdate ? `${t('updateTo')} ${state.release?.version}` : t('updateCheck')}\n </button>\n }\n </div>\n {message && <p role={state.phase === 'error' ? 'alert' : 'status'} aria-live=\"polite\">{message}</p>}\n </section>\n}\n","import type { Change } from './plugin-update.ts'\nimport { en, zh } from './locales.ts'\n\n/** This notice belongs to the in-flight update, so removing the plugin must not remove it. */\nexport async function updateOnHost(name: string, version: string): Promise<{ result: Change; restore?: Change }> {\n const words = document.documentElement.lang.startsWith('en') ? en : zh\n const notice = document.createElement('div')\n notice.setAttribute('role', 'status')\n notice.setAttribute('aria-live', 'polite')\n notice.dataset.cannbotUpdate = 'progress'\n Object.assign(notice.style, { position: 'fixed', bottom: '24px', right: '24px', zIndex: '2147483647',\n maxWidth: 'min(380px, calc(100vw - 48px))', padding: '16px', borderRadius: '12px',\n background: 'var(--dsw-alias-bg-base, white)', color: 'var(--dsw-alias-label-primary, #222)',\n border: '1px solid var(--dsw-alias-border-l2, #ddd)', boxShadow: '0 8px 32px #0002', fontSize: '13px', lineHeight: '1.6' })\n const text = document.createElement('span')\n text.textContent = `${words.updateRunning} ${version} · ${words.updateBackground}`\n notice.append(text)\n document.body.append(notice)\n try {\n const response = await fetch(new URL('api/cannbot-harness/update', document.baseURI), {\n method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ name, version }),\n // No plugin-lifetime abort: its own uninstall is expected during the transaction.\n })\n if (!response.ok) throw new Error('Host update unavailable')\n const answer = await response.json() as { result: Change; restore?: Change }\n if (!answer?.result || typeof answer.result.application !== 'string') throw new Error('Invalid update result')\n const succeeded = (result: Change) => !result.error && ['applied', 'restart-required'].includes(result.application)\n text.textContent = succeeded(answer.result)\n ? `${answer.result.application === 'restart-required' ? words.updateRestart : words.updateDone} (${version})`\n : answer.restore ? succeeded(answer.restore) ? words.updateRestored : words.updateRepair : words.updateFailed\n return answer\n } catch (error) {\n text.textContent = words.updateConnectionLost\n throw error\n } finally {\n const close = document.createElement('button')\n close.type = 'button'; close.textContent = '×'; close.setAttribute('aria-label', words.updateDismiss)\n Object.assign(close.style, { marginLeft: '12px', border: '0', background: 'transparent', color: 'inherit', cursor: 'pointer', fontSize: '18px' })\n close.addEventListener('click', () => notice.remove(), { once: true })\n notice.append(close)\n }\n}\n","import { useState, useSyncExternalStore } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { ContentStore } from './content-store.ts'\nimport { newerVersion } from './plugin-update.ts'\nimport { workflowCopy } from './workflow-copy.ts'\nexport function ContentCard({ content, t }: { content: ContentStore } & PropsLocale<'cannbotHarness'>) {\n const { status } = useSyncExternalStore(content.subscribe, content.getSnapshot)\n const [failed, setFailed] = useState(false)\n const busy = status?.busy || status?.phase === 'syncing' || status?.phase === 'initializing'\n const act = (action: () => Promise<void>) => { setFailed(false); void action().catch(() => setFailed(true)) }\n return <section className=\"cannbot-harness-update cannbot-harness-content\" aria-label={t('contentTitle')}>\n <div className=\"cannbot-harness-update-heading\"><h4>{t('contentTitle')}</h4>\n {status?.catalogVersion && <span>{t('contentCatalog')} {status.catalogVersion}</span>}</div>\n <div className=\"cannbot-harness-update-actions\">\n <button type=\"button\" className=\"cannbot-harness-update-button\" disabled={busy} onClick={() => act(content.sync)}>{busy ? t('contentBusy') : t('contentSync')}</button>\n <button type=\"button\" className=\"cannbot-harness-update-recheck\" disabled={busy} onClick={() => act(content.check)}>{t('contentCheck')}</button>\n </div>\n <p role={failed || status?.phase === 'error' ? 'alert' : 'status'} aria-live=\"polite\">\n {failed || status?.phase === 'error' ? t('contentFailed') : status?.phase === 'initializing' ? t('contentInitializing') : status?.phase === 'syncing' ? t('contentDownloading') : status?.fallback ? t('contentFallback') : t('contentReady')}\n </p>\n {status && <p>{status.plugins.length} {t('contentWorkflows')}</p>}\n <div className=\"cannbot-harness-workflow-packages\">\n {status?.workflows?.map(row => {\n const available = row.latest && (!row.version || newerVersion(row.latest, row.version))\n const copy = workflowCopy(row, t)\n return <div className=\"cannbot-harness-workflow-package\" key={row.id}>\n <div><strong lang=\"en\">{copy.name}</strong><small>{copy.description}</small><small lang=\"en\">{row.package}</small>\n <small>{row.version ? `${t('contentVersion')} ${row.version}` : t('contentNotInstalled')}\n {available && ` · ${t('contentLatest')} ${row.latest}`}{row.pinned && ` · ${t('contentPinned')}`}</small>\n {row.error && <small role=\"alert\">{row.error}</small>}</div>\n <div className=\"cannbot-harness-workflow-package-actions\">\n {available ? <button type=\"button\" className=\"cannbot-harness-update-recheck\" disabled={busy}\n aria-label={`${row.installed ? t('contentUpdate') : t('contentInstall')} ${copy.name}`}\n onClick={() => act(() => content.update(row.id, row.latest!))}>{row.installed ? t('contentUpdate') : t('contentInstall')}</button>\n : <small>{row.installed ? row.latest ? t('contentUpToDate') : t('contentUnchecked') : t('contentUnavailable')}</small>}\n {row.previous && <button type=\"button\" className=\"cannbot-harness-update-recheck\" disabled={busy}\n aria-label={`${t('contentRollback')} ${copy.name}`} onClick={() => act(() => content.rollback(row.id))}>{t('contentRollback')} {row.previous}</button>}\n </div>\n </div>\n })}\n </div>\n {(status?.log || status?.message) && <details><summary>{t('contentLogs')}</summary><pre>{status.message}{'\\n'}{status.log}</pre></details>}\n </section>\n}\n","import { createElement, Fragment } from 'react'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { createPluginUpdater, UPDATE_PACKAGES } from './plugin-update.ts'\nimport { PluginUpdateCard } from './PluginUpdateCard.tsx'\nimport { NAMESPACE } from './locales.ts'\nimport { injectSlot } from './slot-compat.ts'\nimport { updateOnHost } from './host-update.ts'\nimport { ContentCard } from './ContentCard.tsx'\nimport type { ContentStore } from './content-store.ts'\n\n/** Optional integration: old DSH versions without a Plugins page keep loading. */\nexport function registerPluginUpdates(ctx: Context, content?: ContentStore) {\n ctx.inject(['remote', 'remote.pluginManager'], scoped => {\n const manager = scoped.remote.pluginManager\n for (const name of UPDATE_PACKAGES) {\n const updater = createPluginUpdater({\n list: async () => unwrap(await manager.listBundles()),\n install: async spec => unwrap(await manager.installBundle(spec, { saveExact: true })),\n update: updateOnHost,\n }, name)\n scoped.effect(() => () => updater.dispose())\n scoped.effect(() => injectSlot(scoped, 'plugins.bundle.config', () => scoped.slots.register({\n name: 'plugins.bundle.config', key: name, locale: NAMESPACE,\n }, props => createElement(Fragment, null,\n createElement(PluginUpdateCard, { ...(props as PropsLocale<'cannbotHarness'>), updater }),\n content && createElement(ContentCard, { ...(props as PropsLocale<'cannbotHarness'>), content })))))\n }\n })\n}\nfunction unwrap<T>(result: { ok: true; value: T } | { ok: false; error: unknown }): T {\n if (!result.ok) throw result.error\n return result.value\n}\n","export type PreparationStage = 'idle' | 'workspace' | 'dependencies' | 'upload' | 'conversation'\nexport const preparationLabels: Record<PreparationStage, string> = { idle: '', workspace: '正在准备工作区…', dependencies: '正在准备工作流依赖…', upload: '正在上传文件…', conversation: '正在进入对话…' }\nexport interface WorkbenchState { prompt: string; workflow: string; workspaceId: string; files: File[]; detail: string; busy: boolean; error: string; stage: PreparationStage }\nexport function createWorkbenchState() {\n let state: WorkbenchState = { prompt: '', workflow: '', workspaceId: '', files: [], detail: 'ops-direct-invoke', busy: false, error: '', stage: 'idle' }\n const listeners = new Set<() => void>()\n const lifetime = new AbortController()\n return {\n signal: lifetime.signal,\n getSnapshot: () => state,\n subscribe(listener: () => void) { listeners.add(listener); return () => { listeners.delete(listener) } },\n set(patch: Partial<WorkbenchState>) { if (lifetime.signal.aborted) return; state = { ...state, ...patch }; for (const listener of listeners) listener() },\n dispose() { lifetime.abort(); listeners.clear() },\n }\n}\nexport type WorkbenchStore = ReturnType<typeof createWorkbenchState>\n","/** Presentation copy only. Execution and initialization remain owned by the workflow packages. */\nexport const categories = ['全部', 'Ascend C', '其他算子', '通信', '性能优化'] as const\nexport type Category = typeof categories[number]\nexport interface WorkflowGuide { category: Category; icon: string; scenes: string[]; inputs: string[]; outputs: string[]; example: string }\nexport const guides: Record<string, WorkflowGuide> = {\n 'ops-direct-invoke': { category: 'Ascend C', icon: 'code', scenes: ['开发新的 Ascend C 算子', '通过直调方式集成算子'], inputs: ['必需:算子功能、输入输出及数据类型', '可选:参考实现、目标硬件及性能要求'], outputs: ['算子实现与直调示例', '按实际环境生成的验证结果及运行说明'], example: '请开发一个 Ascend C 的 Add 算子,输入为两个 float16 张量,并通过直调方式验证结果。' },\n 'ops-direct-invoke-flash': { category: 'Ascend C', icon: 'flash', scenes: ['快速实现与验证算子原型', '从明确的功能需求开始开发'], inputs: ['必需:算子功能及输入输出规格', '可选:参考代码、测试数据及目标硬件'], outputs: ['Ascend C 算子代码', '在可用环境中执行的编译与精度验证结果'], example: '帮我快速生成并验证一个 Ascend C 的 MatMul 算子,输入使用 float16,请先确认形状约束。' },\n 'ops-registry-invoke': { category: 'Ascend C', icon: 'document', scenes: ['开发需要注册到框架的算子', '通过 ACLNN / GEIR 接入算子'], inputs: ['必需:算子定义、输入输出及接入方式', '可选:现有工程、参考实现及目标环境'], outputs: ['注册算子相关代码及接入示例', '按实际环境完成的验证与使用说明'], example: '开发一个 Ascend C 的自定义算子,并通过 ACLNN 接入。请先检查当前工程及输入输出定义。' },\n 'triton-op-generator': { category: '其他算子', icon: 'code', scenes: ['使用 Triton-Ascend 开发算子', '优化已有 Triton 算子实现'], inputs: ['必需:功能需求或已有 Triton 代码', '可选:张量规格、目标硬件与性能目标'], outputs: ['Triton-Ascend 算子代码', '实际执行的验证与调优记录'], example: '使用 Triton-Ascend 实现一个逐元素 Add 算子,并为不同输入形状添加验证。' },\n 'catlass-op-generator': { category: '其他算子', icon: 'layers', scenes: ['基于 CATLASS 模板开发矩阵计算算子', '开发注意力相关算子并验证精度与性能'], inputs: ['必需:计算需求及张量规格', '可选:CATLASS 工程、参考实现与性能目标'], outputs: ['基于 CATLASS 的实现及调用示例', '可用环境中的精度与性能验证结果'], example: '基于 CATLASS 模板开发一个矩阵乘算子,请先检查工程环境,再验证精度与性能。' },\n 'pypto-op-orchestrator': { category: '其他算子', icon: 'nodes', scenes: ['使用 PyPTO 开发并调优算子', '单独调优已有的 PyPTO 算子'], inputs: ['必需:算子需求或已有 PyPTO 代码', '可选:测试用例、目标硬件与性能目标'], outputs: ['PyPTO 算子实现或调优修改', '按实际执行情况整理的验证与优化结果'], example: '请分析当前 PyPTO 算子,保持计算结果一致,尝试优化性能并记录验证结果。' },\n 'hccl-op-generator': { category: '通信', icon: 'arrows', scenes: ['开发 HCCL AICPU 通信算子', '生成通信代码并准备验证'], inputs: ['必需:通信操作、参与设备及数据规格', '可选:现有通信工程及运行环境'], outputs: ['通信算子相关代码', '在可用设备环境中的验证结果及运行说明'], example: '帮我开发一个 HCCL AICPU 通信算子,请先确认通信操作、设备数量和测试环境。' },\n 'ops-perf-optimize': { category: '性能优化', icon: 'chart', scenes: ['分析已有 Ascend C 算子的性能瓶颈', '在保持精度的前提下迭代调优'], inputs: ['必需:已有算子代码及复现方法', '可选:基准数据、性能分析结果与目标'], outputs: ['性能分析及代码修改', '精度检查、性能对比及退化检查记录'], example: '请分析当前 Ascend C 算子的性能瓶颈,在保持精度的前提下优化,并对比修改前后的表现。' },\n 'model-infer-optimize': { category: '性能优化', icon: 'gear', scenes: ['将模型迁移到 NPU', '对齐精度并优化推理性能'], inputs: ['必需:模型代码、依赖及运行方法', '可选:模型权重路径、测试数据和基准结果'], outputs: ['模型迁移或推理优化修改', '实际完成的精度对齐与性能验证记录'], example: '请将当前模型迁移到 NPU,先检查依赖与运行方式,再进行精度对齐和推理性能优化。' },\n}\nexport const guideFor = (id: string): WorkflowGuide => guides[id] ?? { category: '其他算子', icon: 'nodes', scenes: ['使用此工作流完成开发需求'], inputs: ['请描述目标,并提供相关工程或代码'], outputs: ['以工作流实际执行结果为准'], example: '请根据当前工程和我的需求开展工作,开始前先检查必要的输入。' }\nexport const cardOrder = Object.keys(guides)\nconst inputHints: Record<string, string> = {\n 'ops-direct-invoke': '可补充算子功能、输入形状、数据类型和目标硬件。',\n 'ops-direct-invoke-flash': '可补充输入形状、数据类型和目标硬件。',\n 'ops-registry-invoke': '可补充输入输出规格,以及 ACLNN / GEIR 接入要求。',\n 'triton-op-generator': '可补充张量规格、参考实现和目标硬件。',\n 'catlass-op-generator': '可补充矩阵形状、精度要求和性能目标。',\n 'pypto-op-orchestrator': '可补充 PyPTO 代码、测试用例和调优目标。',\n 'hccl-op-generator': '可补充通信操作、设备数量和数据规格。',\n 'ops-perf-optimize': '可补充现有代码、复现步骤和性能基准。',\n 'model-infer-optimize': '可补充模型路径、运行方式和精度基准。',\n}\nexport const inputHintFor = (id: string) => inputHints[id] ?? '可补充当前工程、相关代码和预期结果。'\n","/** Read only the public Session catalog and its main-view retention facts. */\nexport function inheritedWorkspaceId(workspaces: readonly { workspaceId: string; sessionIds?: readonly string[] }[], sessions: { current?: string; byId?: Record<string, { id?: string; retainedBy?: { mainView?: number } }> }): string | undefined {\n const current = sessions.current ?? Object.entries(sessions.byId ?? {}).find(([, session]) => (session.retainedBy?.mainView ?? 0) > 0)?.[0]\n return current ? workspaces.find(workspace => workspace.sessionIds?.includes(current))?.workspaceId : undefined\n}\n","export function WorkbenchIcon({ name = 'grid', size = 20 }: { name?: string; size?: number }) {\n const paths: Record<string, string> = {\n grid: 'M3 3h7v7H3z M14 3h7v7h-7z M3 14h7v7H3z M14 14h7v7h-7z',\n code: 'm8 6-6 6 6 6 M16 6l6 6-6 6 M14 3l-4 18',\n flash: 'm13 2-9 12h7l-1 8 10-13h-7z',\n document: 'M5 3h14v18H5z M8 8h8 M8 12h8 M8 16h5',\n layers: 'm12 2 10 6-10 6L2 8z M2 12l10 6 10-6 M2 16l10 6 10-6',\n nodes: 'M10 2h4v4h-4z M2 18h6v4H2z M16 18h6v4h-6z M12 6v6 M5 18v-6h14v6',\n arrows: 'M3 7h17l-4-4 M20 7l-4 4 M21 17H4l4-4 M4 17l4 4',\n chart: 'M3 13h4v8H3z M10 8h4v13h-4z M17 3h4v18h-4z',\n gear: 'M9 3h6l1 3 3 1 2 5-2 5-3 1-1 3H9l-1-3-3-1-2-5 2-5 3-1z M9 12a3 3 0 1 0 6 0a3 3 0 1 0-6 0',\n folder: 'M2 6h8l2 3h10v12H2z M2 6V3h7l3 3h10v3',\n search: 'M16 16l6 6 M18 10a8 8 0 1 0-16 0a8 8 0 1 0 16 0',\n clip: 'm8 13 7-7a3 3 0 0 1 4 4L9 20a5 5 0 0 1-7-7L13 2 M6 15l9-9',\n }\n return <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d={paths[name] ?? paths.grid} /></svg>\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { ConversationController } from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type { WorkspaceId } from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\nimport type { WorkflowSelection } from './workflow-selection.ts'\nimport type { PreparationStage } from './workbench-state.ts'\n\n/** Transfer to the resident DSH composer; its own submit policy remains authoritative. */\nexport async function launchWorkbench(ctx: Context, selection: WorkflowSelection, request: { workspaceId: string; workflow: string; prompt: string; files: readonly File[] }, signal: AbortSignal, onStage: (stage: PreparationStage) => void = () => {}) {\n if (!selection.getSnapshot().ready || selection.getSnapshot().pending) throw new Error('工作流设置尚未就绪,请稍后重试。')\n signal.throwIfAborted()\n const startingPanel = ctx.layout.panelInfo.getSnapshot().activePanelId\n // The development workspace also includes legacy Context declarations.\n const sessions = ctx.sessions as unknown as ISessions\n onStage('workspace')\n const id = await sessions.create({ workspaceId: request.workspaceId as WorkspaceId })\n signal.throwIfAborted()\n const reference = sessions.retain(id, { source: 'controllerOperation', signal })\n const conversation = ctx.conversation as ConversationController\n let attachments: ReturnType<ConversationController['createDrafts']> = []\n let transferred = false\n try {\n const binding = await reference.ready\n signal.throwIfAborted()\n if (request.workflow) onStage('dependencies')\n await selection.choose(id, request.workflow)\n signal.throwIfAborted()\n const saved = selection.getSnapshot()\n if (!saved.ready || saved.pending || saved.error || (saved.values[id] ?? '') !== request.workflow) throw new Error(saved.errorMessage || '工作流准备未完成,请在插件设置中查看日志后重试。')\n if (conversation.blocks.storeFor(id).getSnapshot()) throw new Error('当前对话暂时不能发送,请稍后重试。')\n const input = conversation.input.for(binding.ctx)\n const initialized = conversation.input.requestDraftInitialization(binding, { prompt: request.prompt, whenDraftExists: 'keep' })\n if (initialized !== 'applied') throw new Error('新对话已存在草稿,已保留内容,请重试。')\n if (request.files.length) {\n onStage('upload')\n if (typeof conversation.createDrafts !== 'function') throw new Error('此 DSH 版本请进入对话后添加文件。')\n attachments = conversation.createDrafts(id, request.files, true)\n await waitForUploads(conversation, attachments.map(item => item.id), signal)\n if (!input.addAttachments(attachments.map(item => item.id))) throw new Error('文件暂时无法加入对话,请重试。')\n }\n signal.throwIfAborted()\n if (ctx.layout.panelInfo.getSnapshot().activePanelId !== startingPanel) throw new Error('你已离开工作台,需求已保留;返回后可重新开始。')\n // Navigation acquires its own reference before this transaction releases ours.\n onStage('conversation')\n ctx.uiWorkspace.openSession(id)\n transferred = true\n input.submit('queue', 'click')\n } finally {\n if (!transferred) for (const attachment of attachments) conversation.releaseDraftAttachment(attachment.id)\n reference.release()\n }\n}\n\nfunction waitForUploads(conversation: ConversationController, ids: readonly string[], signal: AbortSignal): Promise<void> {\n return new Promise((resolve, reject) => {\n let unsubscribe = () => {}, timer: ReturnType<typeof setTimeout> | undefined\n const finish = (error?: unknown) => { unsubscribe(); clearTimeout(timer); signal.removeEventListener('abort', abort); error ? reject(error) : resolve() }\n const abort = () => finish(signal.reason ?? new Error('操作已取消。'))\n const check = () => {\n const uploads = conversation.fileUploads.getSnapshot()\n const failed = ids.map(id => uploads[id]).find(upload => upload?.status === 'error')\n if (failed?.status === 'error') finish(new Error(`文件上传失败:${failed.message}`))\n else if (ids.every(id => uploads[id]?.status === 'ready')) finish()\n }\n unsubscribe = conversation.fileUploads.subscribe(check)\n timer = setTimeout(() => finish(new Error('文件上传超时,请检查连接后重试。')), 120000)\n signal.addEventListener('abort', abort, { once: true })\n if (signal.aborted) abort(); else check()\n })\n}\n","import { useMemo, useRef, useState, useSyncExternalStore, type FormEvent } from 'react'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type { MainPanelId } from '@deepseek-ai/dsh-client-ui-layout/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport type { WorkflowSelection } from './workflow-selection.ts'\nimport type { ContentStore, DynamicWorkflow } from './content-store.ts'\nimport { preparationLabels, type WorkbenchStore } from './workbench-state.ts'\nimport { cardOrder, categories, guideFor, type Category } from './workbench-data.ts'\nimport { inheritedWorkspaceId } from './workbench-workspace.ts'\nimport { WorkbenchIcon } from './WorkbenchIcon.tsx'\nimport { workflowCopy } from './workflow-copy.ts'\nimport { zh, PACKAGE } from './locales.ts'\nimport { launchWorkbench } from './workbench-launch.ts'\nimport { newerVersion } from './plugin-update.ts'\n\nexport const HOME_PANEL = 'cannbot-harness-workbench' as MainPanelId\nexport const LIBRARY_PANEL = 'cannbot-harness-workflows' as MainPanelId\nconst copy = (workflow: DynamicWorkflow) => workflowCopy(workflow, key => zh[key])\nexport interface WorkbenchProps { ctx: Context; content: ContentStore; selection: WorkflowSelection; store: WorkbenchStore; library?: boolean }\n\nexport function Workbench({ ctx, content, selection, store, library = false }: WorkbenchProps) {\n const state = useSyncExternalStore(store.subscribe, store.getSnapshot)\n const { workflows } = useSyncExternalStore(content.subscribe, content.getSnapshot)\n const workspaceSource = ctx.workspaces.list\n const workspaceBinding = useMemo(() => ({ subscribe: (listener: () => void) => workspaceSource.subscribe(listener), getSnapshot: () => workspaceSource.getSnapshot() }), [workspaceSource])\n const workspaceState = useSyncExternalStore(workspaceBinding.subscribe, workspaceBinding.getSnapshot)\n const sessionSource = (ctx.sessions as unknown as ISessions).list\n const sessionBinding = useMemo(() => ({ subscribe: (listener: () => void) => sessionSource.subscribe(listener), getSnapshot: () => sessionSource.getSnapshot() }), [sessionSource])\n const sessionState = useSyncExternalStore(sessionBinding.subscribe, sessionBinding.getSnapshot)\n const saved = useSyncExternalStore(selection.subscribe, selection.getSnapshot)\n const [category, setCategory] = useState<Category>('全部')\n const [query, setQuery] = useState('')\n const input = useRef<HTMLTextAreaElement>(null)\n const files = useRef<HTMLInputElement>(null)\n const ordered = [...workflows].sort((a, b) => (cardOrder.indexOf(a.id) < 0 ? 999 : cardOrder.indexOf(a.id)) - (cardOrder.indexOf(b.id) < 0 ? 999 : cardOrder.indexOf(b.id)))\n const visible = ordered.filter(workflow => (category === '全部' || guideFor(workflow.id).category === category) && `${workflow.id} ${copy(workflow).description}`.toLowerCase().includes(query.toLowerCase().trim()))\n const inheritedId = inheritedWorkspaceId(workspaceState.items, sessionState)\n const workspace = workspaceState.items.find(item => item.workspaceId === (state.workspaceId || inheritedId))\n const inherited = !state.workspaceId && !!workspace && workspace.workspaceId === inheritedId\n const selected = workflows.find(item => item.id === state.workflow)\n const detail = workflows.find(item => item.id === state.detail) ?? workflows[0]\n const navigate = (panel: MainPanelId) => ctx.layout.selectPanel(panel)\n const settings = () => ctx.get('pluginNavigation')?.openBundle(PACKAGE)\n const fail = (error: unknown) => store.set({ error: error instanceof Error ? error.message : '暂时无法完成,请重试。' })\n const addWorkspace = async () => {\n if (store.getSnapshot().busy) return\n store.set({ error: '', busy: true, stage: 'workspace' })\n try {\n const path = await ctx.uiWorkspace.pickDirectory()\n if (path && !store.signal.aborted) { const created = await ctx.workspaces.create({ path }); store.set({ workspaceId: created.workspaceId }) }\n } catch (error) { fail(error) } finally { store.set({ busy: false, stage: 'idle' }) }\n }\n const start = async (event?: FormEvent) => {\n event?.preventDefault()\n if (store.getSnapshot().busy) return\n if (!workspace) { store.set({ error: '请先选择或添加工作区。' }); return }\n if (!state.prompt.trim() && state.files.length === 0) { input.current?.focus(); return }\n store.set({ busy: true, error: '', stage: 'workspace' })\n try {\n await launchWorkbench(ctx, selection, { workspaceId: workspace.workspaceId, workflow: state.workflow, prompt: state.prompt, files: state.files }, store.signal, stage => store.set({ stage }))\n store.set({ prompt: '', files: [] })\n } catch (error) { fail(error) } finally { store.set({ busy: false, stage: 'idle' }) }\n }\n const useWorkflow = (id: string, example?: string) => {\n store.set({ workflow: id, ...(example && !state.prompt.trim() ? { prompt: example } : {}), error: '' })\n navigate(HOME_PANEL)\n }\n return <main className=\"cannbot-workbench\" aria-label={library ? 'CANNBot 工作流' : 'CANNBot工作台'}>\n <header className=\"cwb-header\">\n <div className=\"cwb-workspace\"><WorkbenchIcon name=\"folder\" /><div className=\"cwb-workspace-info\"><div className=\"cwb-workspace-choice\">\n <select aria-label=\"当前工作区\" value={workspace?.workspaceId ?? ''} disabled={state.busy || workspaceState.phase !== 'ready'} onChange={event => store.set({ workspaceId: event.target.value, error: '' })}>\n {!workspace && <option value=\"\">选择工作区</option>}\n {workspaceState.items.map(item => <option key={item.workspaceId} value={item.workspaceId}>{item.title === 'default-workspace' ? '默认工作区' : item.title}</option>)}\n </select>{inherited && <span className=\"cwb-inherited\">沿用当前对话</span>}</div>{workspace && <span className=\"cwb-workspace-path\" title={workspace.path}>{workspace.path}</span>}</div><button className=\"cwb-text-button\" disabled={state.busy} onClick={() => void addWorkspace()}>+ 添加工作区</button>\n </div>\n {library && <button className=\"cwb-text-button\" onClick={settings}>插件设置</button>}\n </header>\n <div className=\"cwb-content\">\n <div className=\"cwb-heading\"><h1>{library ? '找到适合你的工作流' : '开始你的 Ascend 开发'}</h1>{library && <p>了解适用场景,准备好输入,再开始。</p>}</div>\n {!library && <>\n <form className=\"cwb-composer\" onSubmit={event => void start(event)} onDragOver={event => event.preventDefault()} onDrop={event => { event.preventDefault(); if (!state.busy) store.set({ files: [...state.files, ...Array.from(event.dataTransfer.files)] }) }}>\n <textarea ref={input} aria-label=\"开发需求\" placeholder={selected ? `例如:${guideFor(selected.id).example}` : '描述算子需求,或添加需要优化的代码。'} value={state.prompt} disabled={state.busy} onChange={event => store.set({ prompt: event.target.value })} />\n {state.files.length > 0 && <ul className=\"cwb-files\">{state.files.map((file, index) => <li key={`${file.name}-${index}`}><WorkbenchIcon name=\"document\" size={14} /><span>{file.name}</span><button type=\"button\" disabled={state.busy} aria-label={`移除 ${file.name}`} onClick={() => store.set({ files: state.files.filter((_, i) => i !== index) })}>×</button></li>)}</ul>}\n <div className=\"cwb-composer-actions\"><div className=\"cwb-composer-tools\">\n <input type=\"file\" multiple hidden ref={files} onChange={event => { store.set({ files: [...state.files, ...Array.from(event.target.files ?? [])] }); event.target.value = '' }} />\n <button type=\"button\" className=\"cwb-text-button\" disabled={state.busy} onClick={() => files.current?.click()}><WorkbenchIcon name=\"clip\" size={18} />添加文件</button>\n {state.workflow && <span className=\"cwb-selection\"><WorkbenchIcon name={guideFor(state.workflow).icon} size={16} /><span>{state.workflow}</span><button type=\"button\" disabled={state.busy} aria-label=\"取消工作流选择\" onClick={() => store.set({ workflow: '' })}>×</button></span>}\n </div><button className=\"cwb-primary\" type=\"submit\" disabled={state.busy || !saved.ready || saved.pending || (!state.prompt.trim() && !state.files.length)}>{state.busy ? '处理中…' : '开始'}<span aria-hidden=\"true\">→</span></button></div>\n </form>\n {(state.busy || !saved.ready || !workspace) && <p className=\"cwb-hint\" role=\"status\" aria-live=\"polite\">{state.busy ? preparationLabels[state.stage] : !saved.ready ? '正在连接工作流设置…' : '请先选择或添加工作区。'}</p>}\n {saved.errorKind === 'settings' && <button className=\"cwb-text-button\" onClick={() => selection.retry()}>重试连接工作流设置</button>}\n </>}\n {state.error && <div className=\"cwb-error\" role=\"alert\"><div className=\"cwb-error-heading\"><span>暂时无法开始,需求和文件已保留。</span><button type=\"button\" className=\"cwb-text-button\" disabled={state.busy || !saved.ready || saved.pending} onClick={() => void start()}>重试</button></div><details><summary>查看原因</summary><p>{state.error}</p><button className=\"cwb-text-button\" onClick={settings}>打开插件设置</button></details></div>}\n {workspaceState.state === 'error' && <p role=\"alert\" className=\"cwb-error\">工作区加载失败,请检查 DSH 连接。</p>}\n {!library && state.workflow && !selected && <p role=\"alert\" className=\"cwb-error\">所选工作流已不在当前目录中,请重新选择。</p>}\n <section className=\"cwb-catalog\" aria-label=\"工作流目录\">\n <div className=\"cwb-catalog-heading\"><h2>{library ? '全部工作流' : '工作流'}</h2><label className=\"cwb-search\"><WorkbenchIcon name=\"search\" size={17} /><input aria-label=\"搜索工作流\" placeholder=\"搜索工作流\" value={query} onChange={event => setQuery(event.target.value)} /></label></div>\n <div className=\"cwb-categories\" role=\"group\" aria-label=\"工作流分类\">{categories.map(item => <button key={item} aria-pressed={category === item} onClick={() => setCategory(item)}>{item}</button>)}</div>\n {library ? <div className=\"cwb-library\"><nav aria-label=\"选择工作流详情\" className=\"cwb-library-list\">{visible.map(workflow => <button key={workflow.id} aria-current={detail?.id === workflow.id ? 'true' : undefined} onClick={() => store.set({ detail: workflow.id })}><WorkbenchIcon name={guideFor(workflow.id).icon} /><span><strong>{workflow.id}</strong><small>{copy(workflow).description}</small></span></button>)}{!visible.length && <p className=\"cwb-empty\">没有匹配的工作流</p>}</nav>\n {detail ? <WorkflowDetail key={detail.id} workflow={detail} content={content} onUse={() => useWorkflow(detail.id)} onExample={() => useWorkflow(detail.id, guideFor(detail.id).example)} onSettings={settings} /> : <p className=\"cwb-empty\">工作流目录尚未准备完成,请到插件设置查看准备状态。</p>}\n </div> : <div className=\"cwb-grid\">{visible.map(workflow => <button type=\"button\" key={workflow.id} className=\"cwb-card\" aria-pressed={state.workflow === workflow.id} disabled={state.busy} onClick={() => { const next = state.workflow === workflow.id ? '' : workflow.id; store.set({ workflow: next, error: '' }); if (next) input.current?.focus() }}>\n <span className=\"cwb-card-icon\"><WorkbenchIcon name={guideFor(workflow.id).icon} size={23} /></span><span className=\"cwb-card-copy\"><strong>{workflow.id}</strong><span>{copy(workflow).description}</span></span><span className=\"cwb-card-corner\" aria-hidden=\"true\"><svg width=\"18\" height=\"18\" viewBox=\"0 0 20 20\" fill=\"none\"><circle cx=\"10\" cy=\"10\" r=\"8\" fill={state.workflow === workflow.id ? '#da203e' : 'none'} stroke={state.workflow === workflow.id ? '#da203e' : 'currentColor'} strokeWidth=\"1.2\" />{state.workflow === workflow.id && <path d=\"m6 10 2.6 2.6L14 7.2\" stroke=\"white\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />}</svg></span>\n </button>)}{!visible.length && <p className=\"cwb-empty\">没有匹配的工作流,请换一个关键词或分类。</p>}</div>}\n </section>\n </div>\n </main>\n}\n\nfunction WorkflowDetail({ workflow, content, onUse, onExample, onSettings }: { workflow: DynamicWorkflow; content: ContentStore; onUse(): void; onExample(): void; onSettings(): void }) {\n const { status } = useSyncExternalStore(content.subscribe, content.getSnapshot)\n const [error, setError] = useState(''), [pending, setPending] = useState(false)\n const guide = guideFor(workflow.id), row = status?.workflows?.find(item => item.id === workflow.id)\n const busy = pending || status?.busy || status?.phase === 'syncing' || status?.phase === 'initializing'\n const act = async (action: () => Promise<void>) => { setError(''); setPending(true); try { await action() } catch { setError('操作未完成,请在插件设置中查看日志后重试。') } finally { setPending(false) } }\n return <article className=\"cwb-detail\" key={workflow.id}>\n <div className=\"cwb-detail-title\"><span className=\"cwb-card-icon\"><WorkbenchIcon name={guide.icon} size={25} /></span><span><small>{guide.category}</small><h2>{workflow.id}</h2></span></div>\n <p className=\"cwb-detail-summary\">{copy(workflow).description}</p>\n <button className=\"cwb-primary\" onClick={onUse}>使用此工作流 <span aria-hidden=\"true\">→</span></button>\n <div className=\"cwb-guide-sections\">{[['适合做什么', guide.scenes], ['需要提供什么', guide.inputs], ['可以获得什么', guide.outputs]].map(([title, entries]) => <section key={title as string}><h3>{title}</h3><ul>{(entries as string[]).map(line => <li key={line}>{line}</li>)}</ul></section>)}</div>\n <section className=\"cwb-example\"><h3>试试这样描述需求</h3><p>{guide.example}</p><button className=\"cwb-text-button\" onClick={onExample}>使用此示例 ↗</button><small>已有需求会保留,不会被示例覆盖。</small></section>\n <details className=\"cwb-version\"><summary>版本与更新 {row?.version ? ` · ${row.version}` : ''}</summary><p>{row?.installed ? `已安装 ${row.version ?? ''}` : '安装状态尚未确认,请检查插件设置。'}{row?.latest && ` · 最新版本 ${row.latest}`}</p><div className=\"cwb-version-actions\"><button className=\"cwb-text-button\" disabled={busy} onClick={() => void act(content.check)}>检查更新</button>\n {row?.latest && (!row.version || newerVersion(row.latest, row.version)) && <button className=\"cwb-text-button\" disabled={busy} onClick={() => void act(() => content.update(row.id, row.latest!))}>{row.installed ? '更新工作流' : '安装工作流'}</button>}\n {row?.previous && <button className=\"cwb-text-button\" disabled={busy} onClick={() => void act(() => content.rollback(row.id))}>回退到 {row.previous}</button>}<button className=\"cwb-text-button\" onClick={onSettings}>准备日志与管理</button></div><p>初始化和验证以当前工作区的实际环境为准。</p>{error && <p role=\"alert\">{error}</p>}</details>\n </article>\n}\n","import { createElement } from 'react'\nimport type { Context } from '@deepseek-ai/cordis'\nimport type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-layout/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\nimport type { WorkflowSelection } from './workflow-selection.ts'\nimport type { ContentStore } from './content-store.ts'\nimport { Workbench, HOME_PANEL, LIBRARY_PANEL } from './Workbench.tsx'\nimport { WorkbenchIcon } from './WorkbenchIcon.tsx'\nimport { createWorkbenchState } from './workbench-state.ts'\nimport { injectSlot } from './slot-compat.ts'\nimport './workbench.css'\n\n/** Optional public-slot integration: older DSH keeps its existing branded conversation. */\nexport function registerWorkbench(ctx: Context, selection: WorkflowSelection, content: ContentStore): () => void {\n const fiber = ctx.inject(['layout', 'uiWorkspace', 'workspaces'], scoped => {\n if (typeof scoped.uiWorkspace.openSession !== 'function' || typeof (scoped.sessions as unknown as ISessions).retain !== 'function'\n || typeof scoped.conversation.input.requestDraftInitialization !== 'function') return\n scoped.effect(() => {\n const store = createWorkbenchState()\n const releases: (() => void)[] = []\n for (const [id, library] of [[HOME_PANEL, false], [LIBRARY_PANEL, true]] as const) {\n releases.push(injectSlot(scoped, 'main', () => scoped.slots.register({ name: 'main', key: id }, () => createElement(Workbench, { ctx: scoped, selection, content, store, library }))))\n if (!library) releases.push(injectSlot(scoped, 'sidebar.panellist', () => scoped.slots.register({ name: 'sidebar.panellist', id, order: -100, label: 'CANNBot工作台' }, ({ size }) => createElement(WorkbenchIcon, { name: 'grid', size }))))\n }\n return () => {\n store.dispose()\n if ([HOME_PANEL, LIBRARY_PANEL].includes(scoped.layout.panelInfo.getSnapshot().activePanelId!)) scoped.layout.selectPanel(null)\n for (const release of releases.reverse()) release()\n }\n })\n })\n return () => { if (typeof fiber?.dispose === 'function') void fiber.dispose() }\n}\n","/** Browser companion using the existing DSH theme, settings and UI slots. */\nimport type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-theme/client'\nimport { en, zh, NAMESPACE, PACKAGE, type LocaleKey } from './locales.ts'\nimport { SidebarMark, SidebarName, Hero } from './Brand.tsx'\nimport { WorkflowCompat } from './WorkflowCompat.tsx'\nimport { cannTheme } from './theme.ts'\nimport interfaceCss from './interface.css?inline'\nimport './controls.css'\nimport { createElement } from 'react'\nimport { InterfaceToggle } from './InterfaceToggle.tsx'\nimport { createPresentationController } from './presentation.ts'\nimport { injectSlot } from './slot-compat.ts'\nimport { createWorkflowSelection, connectWorkflowSelection, type WorkflowSelection } from './workflow-selection.ts'\nimport { registerPluginUpdates } from './register-updates.ts'\nimport { createContentStore, type ContentStore } from './content-store.ts'\nimport { registerWorkbench } from './register-workbench.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap { cannbotHarness: LocaleKey }\n}\nexport const inject = ['slots', 'theme', 'locale', 'sessions', 'conversation']\n\n/** Register presentation with an explicit disposer so the original entries remain live underneath. */\nfunction mountInterface(ctx: Context, selection: WorkflowSelection, content: ContentStore): () => void {\n const style = document.createElement('style')\n style.dataset.cannbotHarness = 'interface'\n style.textContent = interfaceCss\n document.head.append(style)\n const releases = [\n ctx.theme.overrideTokens(PACKAGE, cannTheme),\n injectSlot(ctx, 'sidebar.brand.mark', () => ctx.slots.register({ name: 'sidebar.brand.mark', priority: -100 }, SidebarMark)),\n injectSlot(ctx, 'sidebar.brand.name', () => ctx.slots.register({ name: 'sidebar.brand.name', priority: -100 }, SidebarName)),\n injectSlot(ctx, 'conversation.hero.brand.mark', () => ctx.slots.register({ name: 'conversation.hero.brand.mark', priority: -100 }, Hero)),\n injectSlot(ctx, 'conversation.hero.agentPreset', () => ctx.slots.register({ name: 'conversation.hero.agentPreset', priority: -100, locale: NAMESPACE }, props => createElement(WorkflowCompat, { ...props, ctx, selection, content }))),\n registerWorkbench(ctx, selection, content),\n ]\n return () => { for (const release of releases.reverse()) release(); style.remove() }\n}\n\nexport function apply(ctx: Context): void {\n const content = createContentStore()\n ctx.effect(() => content.start())\n registerPluginUpdates(ctx, content)\n const selection = createWorkflowSelection((sessionId, reason) => {\n const blocks = ctx.conversation.blocks\n const id = sessionId as Parameters<typeof blocks.set>[0]\n const store = blocks.storeFor(id)\n // Do not replace a block owned by another DSH plugin.\n if (store.getSnapshot() !== undefined) return () => {}\n const block = { reason }\n blocks.set(id, block)\n return () => { if (store.getSnapshot() === block) blocks.set(id, undefined) }\n }, content.prepare)\n connectWorkflowSelection(ctx, selection)\n ctx.effect(() => () => selection.dispose())\n ctx.effect(() => ctx.locale.register(NAMESPACE, { zh, en, ja: en, es: en, fr: en, de: en, ru: en, pt: en }))\n ctx.effect(() => {\n const controller = createPresentationController(() => mountInterface(ctx, selection, content))\n const releaseToggle = injectSlot(ctx, 'sidebar.footer.action', () => ctx.slots.register({\n name: 'sidebar.footer.action', id: 'cannbot-harness-interface', order: -100,\n }, props => createElement(InterfaceToggle, { ...props, controller })))\n return () => { releaseToggle(); controller.dispose() }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,MAAa,UAAU;EACvB,MAAa,YAAY;EACzB,MAAa,UAAU;EAGvB,MAAa,KAAK;GAChB,gBAAgB;GAAS,cAAc;GAAW,gBAAgB;GAAQ,eAAe;GAAQ,eAAe;GAChH,gBAAgB;GAAM,eAAe;GAAM,iBAAiB;GAAO,iBAAiB;GAAQ,kBAAkB;GAAW,qBAAqB;GAAO,oBAAoB;GACzK,cAAc;GAAS,aAAa;GAAW,aAAa;GAAS,oBAAoB;GACzF,qBAAqB;GAAsB,cAAc;GACzD,eAAe;GAA6B,iBAAiB;GAAkB,kBAAkB;GAAW,aAAa;GACzH,kBAAkB;GAAkB,gBAAgB;GACpD,cAAc;GAA0B,sBAAsB;GAAuC,eAAe;GACpH,aAAa;GAAQ,eAAe;GAAQ,aAAa;GAAQ,gBAAgB;GACjF,UAAU;GAAO,eAAe;GAAS,iBAAiB;GAC1D,cAAc;GAAa,YAAY;GAAU,eAAe;GAChE,cAAc;GACd,oBAAoB;GAA2B,cAAc;GAAiB,gBAAgB;GAC9F,UAAU;GAAS,UAAU;GAAQ,QAAQ;GAAY,UAAU;GAAqB,aAAa;GACrG,OAAO;GAA2B,UAAU;GAAuB,OAAO;GAC1E,MAAM;GAAqB,QAAQ;GAAuB,SAAS;GAAwB,aAAa;GAAqB,OAAO;GACpI,qBAAqB;GACrB,kBAAkB;GAClB,qBAAqB;GACrB,kBAAkB;GAClB,iBAAiB;GACjB,mBAAmB;GACnB,oBAAoB;GACpB,wBAAwB;GACxB,kBAAkB;GAClB,iBAAiB;GAAa,cAAc;GA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CAAC;IAC7F,MAAM,gBAAgB,WAAW,KAAK,+BAA+B,IAAI,MAAM,SAAS;KACtF,MAAM;KAAyB,IAAI;KAA6B,OAAO;IACzE,IAAG,WAAA,GAAA,MAAA,cAAA,CAAuB,iBAAiB;KAAE,GAAG;KAAO;IAAW,CAAC,CAAC,CAAC;IACrE,aAAa;KAAE,cAAc;KAAG,WAAW,QAAQ;IAAE;GACvD,CAAC;EACH"}
|
package/lib/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import { isUserInvocable, renderSkillContent } from "@deepseek-ai/dsh-skill";
|
|
|
7
7
|
import z from "@deepseek-ai/schemastery";
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
9
9
|
import { createHash, randomUUID } from "node:crypto";
|
|
10
|
-
import { readFileSync, realpathSync, statSync } from "node:fs";
|
|
11
|
-
import { cp, mkdir, mkdtemp, open, readFile, realpath, rename, unlink, writeFile } from "node:fs/promises";
|
|
10
|
+
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
11
|
+
import { cp, lstat, mkdir, mkdtemp, open, readFile, realpath, rename, rm, unlink, writeFile } from "node:fs/promises";
|
|
12
12
|
import { homedir } from "node:os";
|
|
13
13
|
//#region src/workflows.ts
|
|
14
14
|
const WORKFLOWS = [
|
|
@@ -273,6 +273,145 @@ async function withContentLock(path, action) {
|
|
|
273
273
|
if (await readFile(path, "utf8").catch(() => "") === owner) await unlink(path);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/initializer-transaction.ts
|
|
278
|
+
const transient = new Set([
|
|
279
|
+
"EIO",
|
|
280
|
+
"EBUSY",
|
|
281
|
+
"EPERM",
|
|
282
|
+
"EACCES",
|
|
283
|
+
"ENOENT"
|
|
284
|
+
]);
|
|
285
|
+
async function retry(action) {
|
|
286
|
+
for (let attempt = 0;; attempt++) try {
|
|
287
|
+
return await action();
|
|
288
|
+
} catch (error) {
|
|
289
|
+
if (!transient.has(error.code ?? "") || attempt === 6) throw error;
|
|
290
|
+
await new Promise((done) => setTimeout(done, Math.min(100 * 2 ** attempt, 800)));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
function inside$1(root, path) {
|
|
294
|
+
const target = resolve(root, path), diff = relative(root, target);
|
|
295
|
+
if (!diff || diff === ".." || diff.startsWith(".." + sep) || isAbsolute(diff)) throw new Error("Invalid initialization recovery path");
|
|
296
|
+
return target;
|
|
297
|
+
}
|
|
298
|
+
async function present(path) {
|
|
299
|
+
try {
|
|
300
|
+
await lstat(path);
|
|
301
|
+
return true;
|
|
302
|
+
} catch (error) {
|
|
303
|
+
if (error.code === "ENOENT") return false;
|
|
304
|
+
throw error;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
async function checkParent(workspace, path) {
|
|
308
|
+
let parent = resolve(path, "..");
|
|
309
|
+
while (parent !== workspace && !await present(parent)) parent = resolve(parent, "..");
|
|
310
|
+
if (parent !== workspace) inside$1(workspace, await realpath(parent));
|
|
311
|
+
}
|
|
312
|
+
/** Snapshot only installer-owned destinations; dependency repositories are never removed. */
|
|
313
|
+
async function initializeTransaction(workspace, recoveryRoot, descriptor, resources, initialize) {
|
|
314
|
+
await mkdir(recoveryRoot, { recursive: true });
|
|
315
|
+
const journalPath = join(recoveryRoot, "recovery.json");
|
|
316
|
+
async function restore(journal) {
|
|
317
|
+
if (journal.workspace !== workspace || !relative(recoveryRoot, journal.directory).startsWith("snapshot-") || relative(recoveryRoot, journal.directory).includes(sep)) throw new Error("Invalid initialization recovery journal");
|
|
318
|
+
for (const entry of journal.entries) {
|
|
319
|
+
const destination = inside$1(workspace, entry.path), saved = inside$1(journal.directory, entry.slot);
|
|
320
|
+
const parent = resolve(destination, "..");
|
|
321
|
+
await checkParent(workspace, destination);
|
|
322
|
+
await retry(() => rm(destination, {
|
|
323
|
+
recursive: true,
|
|
324
|
+
force: true,
|
|
325
|
+
maxRetries: 3,
|
|
326
|
+
retryDelay: 100
|
|
327
|
+
}));
|
|
328
|
+
if (entry.present) {
|
|
329
|
+
await mkdir(parent, { recursive: true });
|
|
330
|
+
await retry(() => cp(saved, destination, {
|
|
331
|
+
recursive: true,
|
|
332
|
+
dereference: false,
|
|
333
|
+
verbatimSymlinks: true
|
|
334
|
+
}));
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
const previous = await readFile(journalPath, "utf8").catch((error) => {
|
|
339
|
+
if (error.code === "ENOENT") return "";
|
|
340
|
+
throw error;
|
|
341
|
+
});
|
|
342
|
+
if (previous) {
|
|
343
|
+
const journal = JSON.parse(previous);
|
|
344
|
+
await restore(journal);
|
|
345
|
+
await rm(journalPath);
|
|
346
|
+
await rm(journal.directory, {
|
|
347
|
+
recursive: true,
|
|
348
|
+
force: true,
|
|
349
|
+
maxRetries: 3,
|
|
350
|
+
retryDelay: 100
|
|
351
|
+
}).catch(() => {});
|
|
352
|
+
}
|
|
353
|
+
const paths = new Set(descriptor.skills.map((skill) => `.dsh/skills/${skill.name}`));
|
|
354
|
+
paths.add(`.cannbot/plugins/${descriptor.id}`);
|
|
355
|
+
for (const file of [
|
|
356
|
+
"AGENTS.md",
|
|
357
|
+
"CLAUDE.md",
|
|
358
|
+
".dsh/cannbot-plugin.json",
|
|
359
|
+
".cannbot/settings.json",
|
|
360
|
+
".cannbot/permissions"
|
|
361
|
+
]) paths.add(file);
|
|
362
|
+
const manifestPath = join(resources, ".claude-plugin/plugin.json");
|
|
363
|
+
if (await present(manifestPath)) {
|
|
364
|
+
const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
365
|
+
for (const path of manifest.agents ?? []) {
|
|
366
|
+
const text = await readFile(inside$1(resources, path), "utf8");
|
|
367
|
+
const name = /^name:\s*([^\r\n]+)$/m.exec(text)?.[1]?.trim();
|
|
368
|
+
if (!name || !/^[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*$/.test(name)) throw new Error("Invalid initializer agent name");
|
|
369
|
+
paths.add(`.dsh/agents/${name}.md`);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const directory = await mkdtemp(join(recoveryRoot, "snapshot-"));
|
|
373
|
+
const journal = {
|
|
374
|
+
workspace,
|
|
375
|
+
directory,
|
|
376
|
+
entries: []
|
|
377
|
+
};
|
|
378
|
+
for (const path of paths) {
|
|
379
|
+
const source = inside$1(workspace, path);
|
|
380
|
+
await checkParent(workspace, source);
|
|
381
|
+
const exists = await present(source), slot = String(journal.entries.length);
|
|
382
|
+
if (exists) await retry(() => cp(source, join(directory, slot), {
|
|
383
|
+
recursive: true,
|
|
384
|
+
dereference: false,
|
|
385
|
+
verbatimSymlinks: true
|
|
386
|
+
}));
|
|
387
|
+
journal.entries.push({
|
|
388
|
+
path,
|
|
389
|
+
present: exists,
|
|
390
|
+
slot
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
const temporary = journalPath + ".tmp";
|
|
394
|
+
await writeFile(temporary, JSON.stringify(journal), { mode: 384 });
|
|
395
|
+
await rename(temporary, journalPath);
|
|
396
|
+
try {
|
|
397
|
+
await initialize();
|
|
398
|
+
} catch (error) {
|
|
399
|
+
try {
|
|
400
|
+
await restore(journal);
|
|
401
|
+
await rm(journalPath);
|
|
402
|
+
} catch (recovery) {
|
|
403
|
+
throw new Error(`${error.message}\n自动恢复未完成,备份保留在 ${directory}:${recovery.message}`);
|
|
404
|
+
}
|
|
405
|
+
throw new Error(`${error.message}\n已恢复本次初始化前的 Skills 和工作区配置。`);
|
|
406
|
+
}
|
|
407
|
+
await rm(journalPath);
|
|
408
|
+
await rm(directory, {
|
|
409
|
+
recursive: true,
|
|
410
|
+
force: true,
|
|
411
|
+
maxRetries: 3,
|
|
412
|
+
retryDelay: 100
|
|
413
|
+
}).catch(() => {});
|
|
414
|
+
}
|
|
276
415
|
const CATALOG_PACKAGE = "@cannbot-plugin/workflow-catalog";
|
|
277
416
|
const REGISTRY = "https://registry.npmjs.org/";
|
|
278
417
|
const MIRROR = "https://registry.npmmirror.com/";
|
|
@@ -733,7 +872,13 @@ var ContentManager = class {
|
|
|
733
872
|
async runInitializer(entry, args, cwd) {
|
|
734
873
|
await new Promise((accept, reject) => {
|
|
735
874
|
let output = "", stopped = false;
|
|
736
|
-
const
|
|
875
|
+
const compatibility = join(import.meta.dirname, "../runtime/initializer-compat.cjs");
|
|
876
|
+
const child = spawn(process.execPath, [
|
|
877
|
+
"--require",
|
|
878
|
+
compatibility,
|
|
879
|
+
entry,
|
|
880
|
+
...args
|
|
881
|
+
], {
|
|
737
882
|
cwd,
|
|
738
883
|
windowsHide: true,
|
|
739
884
|
detached: process.platform !== "win32",
|
|
@@ -744,6 +889,8 @@ var ContentManager = class {
|
|
|
744
889
|
],
|
|
745
890
|
env: {
|
|
746
891
|
...process.env,
|
|
892
|
+
...process.versions.electron ? { ELECTRON_RUN_AS_NODE: "1" } : {},
|
|
893
|
+
CANNBOT_INITIALIZER_WORKSPACE: cwd,
|
|
747
894
|
GIT_TERMINAL_PROMPT: "0",
|
|
748
895
|
GCM_INTERACTIVE: "never"
|
|
749
896
|
}
|
|
@@ -800,7 +947,9 @@ var ContentManager = class {
|
|
|
800
947
|
let job = this.jobs.get(jobKey);
|
|
801
948
|
if (!job) {
|
|
802
949
|
job = withContentLock(join(this.root, "initialized", key, "workspace.lock"), async () => {
|
|
803
|
-
|
|
950
|
+
const recoveryRoot = join(this.root, "initialized", key, "recovery");
|
|
951
|
+
const skillsPresent = descriptor.skills.every((skill) => existsSync(join(workspace, ".dsh/skills", skill.name, "SKILL.md")));
|
|
952
|
+
if (await readFile(marker, "utf8").catch(() => "") === receipt && !existsSync(join(recoveryRoot, "recovery.json")) && (descriptor.initialization.kind !== "cannbot-cli" || skillsPresent)) return;
|
|
804
953
|
this.publish({
|
|
805
954
|
phase: "initializing",
|
|
806
955
|
message: `Preparing ${id}@${record.version} for this workspace…`,
|
|
@@ -808,7 +957,8 @@ var ContentManager = class {
|
|
|
808
957
|
});
|
|
809
958
|
if (descriptor.initialization.kind === "cannbot-cli") {
|
|
810
959
|
const root = inside(this.root, record.directory);
|
|
811
|
-
|
|
960
|
+
const entry = inside(root, descriptor.initialization.entry);
|
|
961
|
+
await initializeTransaction(workspace, recoveryRoot, descriptor, join(root, "resources"), () => this.runInitializer(entry, [
|
|
812
962
|
"install",
|
|
813
963
|
id,
|
|
814
964
|
"--tool",
|
|
@@ -817,7 +967,7 @@ var ContentManager = class {
|
|
|
817
967
|
workspace,
|
|
818
968
|
"--plugin-dir",
|
|
819
969
|
join(root, "resources")
|
|
820
|
-
], workspace);
|
|
970
|
+
], workspace));
|
|
821
971
|
}
|
|
822
972
|
await writeFile(marker, receipt, { mode: 384 });
|
|
823
973
|
this.publish({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cannbot-plugin/cannbot-harness",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "CANNBot Harness: Ascend development workbench with independently versioned workflow packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN THIRD_PARTY_NOTICES.md",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"lib",
|
|
17
|
+
"runtime/initializer-compat.cjs",
|
|
17
18
|
"workflow-defaults.json",
|
|
18
19
|
"locale",
|
|
19
20
|
"cordis.patch.yml",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Used only by the official initializer subprocess. Never patches the DSH host.
|
|
2
|
+
const fs = require('node:fs')
|
|
3
|
+
const path = require('node:path')
|
|
4
|
+
const root = process.env.CANNBOT_INITIALIZER_WORKSPACE
|
|
5
|
+
if (process.platform === 'win32' && root) {
|
|
6
|
+
const cp = fs.cpSync
|
|
7
|
+
const wait = new Int32Array(new SharedArrayBuffer(4))
|
|
8
|
+
const managed = value => {
|
|
9
|
+
if (typeof value !== 'string') return false
|
|
10
|
+
const relative = path.relative(root, path.resolve(value))
|
|
11
|
+
return !path.isAbsolute(relative) && ['.dsh', '.cannbot'].some(name => relative.startsWith(name + path.sep))
|
|
12
|
+
}
|
|
13
|
+
fs.cpSync = function (source, destination, options) {
|
|
14
|
+
for (let attempt = 0; ; attempt++) {
|
|
15
|
+
try { return cp(source, destination, options) }
|
|
16
|
+
catch (error) {
|
|
17
|
+
// Windows may report EIO while a just-deleted directory is still closing.
|
|
18
|
+
// Do not rerun the whole installer, or retry missing source files.
|
|
19
|
+
if (!managed(destination) || !fs.existsSync(source) || !['EIO', 'EBUSY', 'EPERM', 'EACCES', 'ENOENT'].includes(error.code) || attempt === 6) throw error
|
|
20
|
+
Atomics.wait(wait, 0, 0, Math.min(100 * 2 ** attempt, 800))
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
require('node:module').syncBuiltinESMExports()
|
|
25
|
+
}
|