dsh-edge 0.1.0
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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +183 -0
- package/README.zh.md +183 -0
- package/THIRD_PARTY_NOTICES.md +199 -0
- package/dist/_headers +3 -0
- package/dist/assets/fonts/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/fonts/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/fonts/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/fonts/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/fonts/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/fonts/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/fonts/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/fonts/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/fonts/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/fonts/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/fonts/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/fonts/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/fonts/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/fonts/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/fonts/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/fonts/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/fonts/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/fonts/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/fonts/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/fonts/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/fonts/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/assets/index-C-1AiF3k.js +112 -0
- package/dist/assets/index-CSGf6Qzd.css +1 -0
- package/dist/assets/langs/c-BIGW1oBm.js +2 -0
- package/dist/assets/langs/cpp-DIPi6g--.js +2 -0
- package/dist/assets/langs/csharp-DSvCPggb.js +2 -0
- package/dist/assets/langs/css-CLj8gQPS.js +2 -0
- package/dist/assets/langs/go-C27-OAKa.js +2 -0
- package/dist/assets/langs/html-CfGypltT.js +2 -0
- package/dist/assets/langs/ini-BEwlwnbL.js +2 -0
- package/dist/assets/langs/java-CylS5w8V.js +2 -0
- package/dist/assets/langs/kotlin-BdnUsdx6.js +2 -0
- package/dist/assets/langs/less-B1dDrJ26.js +2 -0
- package/dist/assets/langs/lua-BaeVxFsk.js +2 -0
- package/dist/assets/langs/markdown-Cvjx9yec.js +2 -0
- package/dist/assets/langs/mdx-Cmh6b_Ma.js +2 -0
- package/dist/assets/langs/php-D-uCvoST.js +2 -0
- package/dist/assets/langs/python-B6aJPvgy.js +2 -0
- package/dist/assets/langs/ruby-DEItuUFs.js +2 -0
- package/dist/assets/langs/rust-B1yitclQ.js +2 -0
- package/dist/assets/langs/scss-D5BDwBP9.js +2 -0
- package/dist/assets/langs/sql-CRqJ_cUM.js +2 -0
- package/dist/assets/langs/swift-D82vCrfD.js +2 -0
- package/dist/assets/langs/toml-vGWfd6FD.js +2 -0
- package/dist/assets/langs/xml-sdJ4AIDG.js +2 -0
- package/dist/assets/langs/yaml-Buea-lGh.js +2 -0
- package/dist/assets/vendor-Cjbwl5VI.js +411 -0
- package/dist/assets/vendor-CjyC-hUb.css +1 -0
- package/dist/favicon.svg +8 -0
- package/dist/index.html +35 -0
- package/dist/manifest.webmanifest +16 -0
- package/dist/plugins/@deepseek-ai/dsh-api-gateway/client.js +420 -0
- package/dist/plugins/@deepseek-ai/dsh-api-remotes/client.js +5937 -0
- package/dist/plugins/@deepseek-ai/dsh-client-connection/client.js +10207 -0
- package/dist/plugins/@deepseek-ai/dsh-client-locale/client.js +1231 -0
- package/dist/plugins/@deepseek-ai/dsh-client-modules/client.js +259 -0
- package/dist/plugins/@deepseek-ai/dsh-client-runtime/client.js +10539 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +1725 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +1116 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +9832 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +373 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-edge/client.js +549 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js +859 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js +280 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-layout/client.js +456 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +804 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +461 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings/client.js +254 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +609 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +292 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +327 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +710 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +1312 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +1630 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js +7370 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +700 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +474 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +2426 -0
- package/dist/plugins/@deepseek-ai/dsh-typert-registry/client.js +1372 -0
- package/package.json +97 -0
- package/scripts/assemble-web.mjs +230 -0
- package/scripts/bundle-size.d.mts +2 -0
- package/scripts/bundle-size.mjs +26 -0
- package/scripts/bundle.mjs +53 -0
- package/scripts/cli.d.mts +39 -0
- package/scripts/cli.mjs +496 -0
- package/scripts/install.d.mts +149 -0
- package/scripts/install.mjs +989 -0
- package/scripts/legal-files.mjs +24 -0
- package/scripts/verify-packed.mjs +32 -0
- package/scripts/wrangler-config.d.mts +18 -0
- package/scripts/wrangler-config.mjs +84 -0
- package/src/agent.ts +119 -0
- package/src/auth.ts +352 -0
- package/src/deepseek.ts +231 -0
- package/src/deployment.ts +147 -0
- package/src/direct-shell-core-empty.ts +10 -0
- package/src/direct-shell-protocol.ts +5 -0
- package/src/direct-shell.ts +341 -0
- package/src/do-session-persistence.ts +1064 -0
- package/src/edge-api.ts +796 -0
- package/src/edge-credentials.ts +56 -0
- package/src/edge-remotes.ts +41 -0
- package/src/edge-workspace-store.ts +339 -0
- package/src/http.ts +212 -0
- package/src/index.ts +196 -0
- package/src/instance.ts +1007 -0
- package/src/isolated-direct-shell-unavailable.ts +11 -0
- package/src/protocol.ts +39 -0
- package/src/release.ts +9 -0
- package/src/session-store.ts +1110 -0
- package/src/sse.ts +86 -0
- package/src/web-search.ts +38 -0
- package/src/workspace.ts +270 -0
- package/wrangler.jsonc +56 -0
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "@deepseek-ai/dsh-client-ui-workflow-run",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
var module = { exports: {} };
|
|
5
|
+
var exports = module.exports;
|
|
6
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
|
+
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
|
11
|
+
//#region \0dsh-css:/private/var/folders/nm/n5smty9962gf5rhjc5855kt80000gn/T/dsh-edge-release-worktree.XXXXXX.RcJjogaGt4/repo/packages/client/ui-workflow-run/src/client/WorkflowRunPanel.module.css.mjs
|
|
12
|
+
const css = ".-OTyAG_root{width:100%;min-width:0}.-OTyAG_runHeader{box-sizing:border-box;background:var(--dsw-alias-bg-module-platform);border-radius:8px;align-items:center;gap:6px;width:100%;min-width:0;height:32px;padding:0 8px;display:flex}.-OTyAG_runHeader:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}.-OTyAG_runLeading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:0;display:inline-flex}.-OTyAG_runTitle{max-width:42%;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:14px;font-weight:510;line-height:24px;overflow:hidden}.-OTyAG_runSummary{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;line-height:18px;overflow:hidden}.-OTyAG_statusTail{height:20px;color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;align-items:center;gap:4px;font-size:11px;font-weight:510;line-height:16px;display:inline-flex;overflow:hidden}.-OTyAG_phaseHeader{box-sizing:border-box;align-items:center;gap:6px;width:100%;min-width:0;height:32px;display:flex}.-OTyAG_phaseHeader:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px;border-radius:4px}.-OTyAG_phaseLeading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:0;display:inline-flex}.-OTyAG_phaseTitle{min-width:0;max-width:42%;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:0 auto;font-size:14px;line-height:24px;overflow:hidden}.-OTyAG_phaseCount{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;line-height:20px;overflow:hidden}.-OTyAG_phaseStatus{width:132px;color:var(--dsw-alias-label-secondary);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:13px;line-height:20px;overflow:hidden}.-OTyAG_separator{background:var(--dsw-alias-label-tertiary);border-radius:50%;flex:none;width:2px;height:2px}.-OTyAG_phaseList{flex-direction:column;gap:4px;min-width:0;padding:4px 0 0 16px;display:flex}.-OTyAG_phase{min-width:0}.-OTyAG_members{flex-direction:column;gap:2px;min-width:0;padding:0 0 0 16px;display:flex}.-OTyAG_memberRow,.-OTyAG_memberButton{width:100%;min-width:0;min-height:24px;color:var(--dsw-alias-label-secondary);font:inherit;text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:12px;padding:0;display:flex}.-OTyAG_memberButton{cursor:pointer}.-OTyAG_memberButton .-OTyAG_memberLabel{color:var(--dsw-alias-state-business-primary);text-underline-position:from-font;text-decoration:underline}.-OTyAG_dotSlot{flex:none;justify-content:center;align-items:center;width:16px;height:24px;display:inline-flex;overflow:hidden}.-OTyAG_memberButton:focus-visible{outline:none}.-OTyAG_memberButton:focus-visible .-OTyAG_memberLabelWrap{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.-OTyAG_memberLabelWrap{border-radius:4px;flex:1;align-items:center;min-width:0;height:24px;padding:0 2px;display:flex;overflow:hidden}.-OTyAG_memberLabel{min-width:0;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:14px;line-height:24px;overflow:hidden}.-OTyAG_memberStatus{width:64px;color:var(--dsw-alias-label-secondary);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:13px;line-height:20px;overflow:hidden}.-OTyAG_empty{color:var(--dsw-alias-label-tertiary);padding:0;font-size:13px;line-height:20px}@media (width<=560px){.-OTyAG_phaseList,.-OTyAG_members{padding-left:12px}}";
|
|
13
|
+
const tagId = "@deepseek-ai/dsh-client-ui-workflow-run/WorkflowRunPanel.module.css";
|
|
14
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
15
|
+
const tag = document.createElement("style");
|
|
16
|
+
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-workflow-run";
|
|
17
|
+
tag.dataset.pluginCss = tagId;
|
|
18
|
+
tag.textContent = css;
|
|
19
|
+
document.head.appendChild(tag);
|
|
20
|
+
}
|
|
21
|
+
var WorkflowRunPanel_module_css_default = {
|
|
22
|
+
"memberLabelWrap": "-OTyAG_memberLabelWrap",
|
|
23
|
+
"runSummary": "-OTyAG_runSummary",
|
|
24
|
+
"separator": "-OTyAG_separator",
|
|
25
|
+
"phaseHeader": "-OTyAG_phaseHeader",
|
|
26
|
+
"root": "-OTyAG_root",
|
|
27
|
+
"phaseCount": "-OTyAG_phaseCount",
|
|
28
|
+
"memberButton": "-OTyAG_memberButton",
|
|
29
|
+
"dotSlot": "-OTyAG_dotSlot",
|
|
30
|
+
"phaseLeading": "-OTyAG_phaseLeading",
|
|
31
|
+
"members": "-OTyAG_members",
|
|
32
|
+
"phaseTitle": "-OTyAG_phaseTitle",
|
|
33
|
+
"runLeading": "-OTyAG_runLeading",
|
|
34
|
+
"runTitle": "-OTyAG_runTitle",
|
|
35
|
+
"memberLabel": "-OTyAG_memberLabel",
|
|
36
|
+
"runHeader": "-OTyAG_runHeader",
|
|
37
|
+
"phaseList": "-OTyAG_phaseList",
|
|
38
|
+
"memberStatus": "-OTyAG_memberStatus",
|
|
39
|
+
"memberRow": "-OTyAG_memberRow",
|
|
40
|
+
"empty": "-OTyAG_empty",
|
|
41
|
+
"statusTail": "-OTyAG_statusTail",
|
|
42
|
+
"phaseStatus": "-OTyAG_phaseStatus",
|
|
43
|
+
"phase": "-OTyAG_phase"
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region lib/types/client/WorkflowRunPanel.js
|
|
47
|
+
const STATUS_KEYS = {
|
|
48
|
+
running: "status.running",
|
|
49
|
+
completed: "status.completed",
|
|
50
|
+
failed: "status.failed",
|
|
51
|
+
cancelled: "status.cancelled",
|
|
52
|
+
interrupted: "status.interrupted"
|
|
53
|
+
};
|
|
54
|
+
function dotState(status) {
|
|
55
|
+
switch (status) {
|
|
56
|
+
case "running": return "ongoing";
|
|
57
|
+
case "completed": return "done";
|
|
58
|
+
case "failed": return "error";
|
|
59
|
+
case "cancelled":
|
|
60
|
+
case "interrupted": return "warning";
|
|
61
|
+
/* v8 ignore next -- WorkflowRunStatus is closed and every variant is handled above. */
|
|
62
|
+
default: return status;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function readablePhase(phase, t) {
|
|
66
|
+
if (phase === null) return t("phase.unassigned");
|
|
67
|
+
return phase === "" ? t("phase.empty") : phase;
|
|
68
|
+
}
|
|
69
|
+
function readableMember(label, t) {
|
|
70
|
+
return label === "" ? t("member.empty") : label;
|
|
71
|
+
}
|
|
72
|
+
function statusCount(status, count, t) {
|
|
73
|
+
return t(`statusCount.${status}`, { count });
|
|
74
|
+
}
|
|
75
|
+
function memberCount(count, t) {
|
|
76
|
+
return t(count === 1 ? "run.members.one" : "run.members.other", { count });
|
|
77
|
+
}
|
|
78
|
+
function phaseRequiresExpansion(phase) {
|
|
79
|
+
return phase.members.some((member) => member.status !== "completed");
|
|
80
|
+
}
|
|
81
|
+
/* v8 ignore next -- DisclosureRow requires the callback but cannot invoke it when expandable is false. */
|
|
82
|
+
const forcedOpenToggle = () => {};
|
|
83
|
+
function ManualDisclosure(props) {
|
|
84
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
85
|
+
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
|
|
86
|
+
...props,
|
|
87
|
+
open,
|
|
88
|
+
expandable: true,
|
|
89
|
+
onToggle: () => {
|
|
90
|
+
setOpen((value) => !value);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function StatusDisclosure({ cleanCycleKey, requiresExpansion, ...props }) {
|
|
95
|
+
if (!requiresExpansion) return (0, react_jsx_runtime.jsx)(ManualDisclosure, { ...props }, cleanCycleKey);
|
|
96
|
+
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
|
|
97
|
+
...props,
|
|
98
|
+
open: true,
|
|
99
|
+
expandable: false,
|
|
100
|
+
onToggle: forcedOpenToggle
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function phaseStatusSummary(members, t) {
|
|
104
|
+
const counts = /* @__PURE__ */ new Map();
|
|
105
|
+
for (const member of members) counts.set(member.status, (counts.get(member.status) ?? 0) + 1);
|
|
106
|
+
const count = (status) => counts.get(status) ?? 0;
|
|
107
|
+
const active = [
|
|
108
|
+
"running",
|
|
109
|
+
"failed",
|
|
110
|
+
"cancelled",
|
|
111
|
+
"interrupted"
|
|
112
|
+
].filter((status) => count(status) > 0);
|
|
113
|
+
if (active.length === 0) return statusCount("completed", count("completed"), t);
|
|
114
|
+
return (active.includes("interrupted") && count("completed") > 0 ? ["completed", ...active] : active).map((status) => statusCount(status, count(status), t)).join(" · ");
|
|
115
|
+
}
|
|
116
|
+
function navigableMembers(sessions, phases, parentId) {
|
|
117
|
+
const ordinary = new Set(sessions.ids);
|
|
118
|
+
const result = [];
|
|
119
|
+
for (const phase of phases) for (const member of phase.members) {
|
|
120
|
+
const summary = sessions.byId[member.childId];
|
|
121
|
+
if (member.status === "running" && ordinary.has(member.childId) && summary?.origin === "subagent" && summary.parentId === parentId && summary.running) result.push(member.childId);
|
|
122
|
+
}
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
function RunHeader({ children, count, name, requiresExpansion, status, t }) {
|
|
126
|
+
return (0, react_jsx_runtime.jsx)(StatusDisclosure, {
|
|
127
|
+
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {}),
|
|
128
|
+
title: t("run.title", { name }),
|
|
129
|
+
requiresExpansion,
|
|
130
|
+
expandOnRowClick: true,
|
|
131
|
+
previewChevron: false,
|
|
132
|
+
keepContentWhenOpen: true,
|
|
133
|
+
rowClassName: WorkflowRunPanel_module_css_default.runHeader,
|
|
134
|
+
leadingClassName: WorkflowRunPanel_module_css_default.runLeading,
|
|
135
|
+
titleClassName: WorkflowRunPanel_module_css_default.runTitle,
|
|
136
|
+
collapsedContent: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
137
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
138
|
+
className: WorkflowRunPanel_module_css_default.separator,
|
|
139
|
+
"aria-hidden": true
|
|
140
|
+
}),
|
|
141
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
142
|
+
className: WorkflowRunPanel_module_css_default.runSummary,
|
|
143
|
+
children: memberCount(count, t)
|
|
144
|
+
}),
|
|
145
|
+
(0, react_jsx_runtime.jsxs)("span", {
|
|
146
|
+
className: WorkflowRunPanel_module_css_default.statusTail,
|
|
147
|
+
"data-status": status,
|
|
148
|
+
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: dotState(status) }), (0, react_jsx_runtime.jsx)("span", { children: t(STATUS_KEYS[status]) })]
|
|
149
|
+
})
|
|
150
|
+
] }),
|
|
151
|
+
children
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function MemberRow({ member, navigable, openSession, t }) {
|
|
155
|
+
const name = readableMember(member.label, t);
|
|
156
|
+
const content = (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
157
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
158
|
+
className: WorkflowRunPanel_module_css_default.dotSlot,
|
|
159
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: dotState(member.status) })
|
|
160
|
+
}),
|
|
161
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
162
|
+
className: WorkflowRunPanel_module_css_default.memberLabelWrap,
|
|
163
|
+
"data-member-label-wrap": true,
|
|
164
|
+
children: (0, react_jsx_runtime.jsx)("span", {
|
|
165
|
+
className: WorkflowRunPanel_module_css_default.memberLabel,
|
|
166
|
+
"data-member-label": true,
|
|
167
|
+
children: name
|
|
168
|
+
})
|
|
169
|
+
}),
|
|
170
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
171
|
+
className: WorkflowRunPanel_module_css_default.memberStatus,
|
|
172
|
+
"data-member-status-text": true,
|
|
173
|
+
children: t(STATUS_KEYS[member.status])
|
|
174
|
+
})
|
|
175
|
+
] });
|
|
176
|
+
if (!navigable) return (0, react_jsx_runtime.jsx)("div", {
|
|
177
|
+
className: WorkflowRunPanel_module_css_default.memberRow,
|
|
178
|
+
"data-member-status": member.status,
|
|
179
|
+
children: content
|
|
180
|
+
});
|
|
181
|
+
return (0, react_jsx_runtime.jsx)("button", {
|
|
182
|
+
type: "button",
|
|
183
|
+
className: WorkflowRunPanel_module_css_default.memberButton,
|
|
184
|
+
"data-member-status": member.status,
|
|
185
|
+
"aria-label": t("member.open", { name }),
|
|
186
|
+
onClick: () => {
|
|
187
|
+
openSession(member.childId);
|
|
188
|
+
},
|
|
189
|
+
children: content
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function PhaseSection({ phase, navigable, openSession, t }) {
|
|
193
|
+
return (0, react_jsx_runtime.jsx)(StatusDisclosure, {
|
|
194
|
+
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {}),
|
|
195
|
+
title: readablePhase(phase.phase, t),
|
|
196
|
+
cleanCycleKey: phase.members.length,
|
|
197
|
+
requiresExpansion: phaseRequiresExpansion(phase),
|
|
198
|
+
expandOnRowClick: true,
|
|
199
|
+
previewChevron: false,
|
|
200
|
+
keepContentWhenOpen: true,
|
|
201
|
+
className: WorkflowRunPanel_module_css_default.phase,
|
|
202
|
+
rowClassName: WorkflowRunPanel_module_css_default.phaseHeader,
|
|
203
|
+
leadingClassName: WorkflowRunPanel_module_css_default.phaseLeading,
|
|
204
|
+
titleClassName: WorkflowRunPanel_module_css_default.phaseTitle,
|
|
205
|
+
collapsedContent: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
206
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
207
|
+
className: WorkflowRunPanel_module_css_default.separator,
|
|
208
|
+
"aria-hidden": true
|
|
209
|
+
}),
|
|
210
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
211
|
+
className: WorkflowRunPanel_module_css_default.phaseCount,
|
|
212
|
+
"data-phase-count": true,
|
|
213
|
+
children: memberCount(phase.members.length, t)
|
|
214
|
+
}),
|
|
215
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
216
|
+
className: WorkflowRunPanel_module_css_default.phaseStatus,
|
|
217
|
+
"data-phase-status-text": true,
|
|
218
|
+
children: phaseStatusSummary(phase.members, t)
|
|
219
|
+
})
|
|
220
|
+
] }),
|
|
221
|
+
children: (0, react_jsx_runtime.jsx)("div", {
|
|
222
|
+
className: WorkflowRunPanel_module_css_default.members,
|
|
223
|
+
children: phase.members.map((member) => (0, react_jsx_runtime.jsx)(MemberRow, {
|
|
224
|
+
member,
|
|
225
|
+
navigable: navigable.includes(member.childId),
|
|
226
|
+
openSession,
|
|
227
|
+
t
|
|
228
|
+
}, member.seq))
|
|
229
|
+
})
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/** Render one durable workflow run with status-driven run and phase disclosure. */
|
|
233
|
+
function WorkflowRunPanel({ node, sessionId, useSessions, openSession, t }) {
|
|
234
|
+
const totalMembers = node.data.phases.reduce((count, phase) => count + phase.members.length, 0);
|
|
235
|
+
const requiresExpansion = node.data.status !== "completed" || node.data.phases.some(phaseRequiresExpansion);
|
|
236
|
+
const navigable = useSessions((sessions) => navigableMembers(sessions, node.data.phases, sessionId), _deepseek_ai_dsh_client_runtime_client.shallowEqual);
|
|
237
|
+
return (0, react_jsx_runtime.jsx)("section", {
|
|
238
|
+
className: WorkflowRunPanel_module_css_default.root,
|
|
239
|
+
"data-workflow-run": true,
|
|
240
|
+
"data-run-status": node.data.status,
|
|
241
|
+
children: (0, react_jsx_runtime.jsx)(RunHeader, {
|
|
242
|
+
count: totalMembers,
|
|
243
|
+
name: node.data.name,
|
|
244
|
+
requiresExpansion,
|
|
245
|
+
status: node.data.status,
|
|
246
|
+
t,
|
|
247
|
+
children: (0, react_jsx_runtime.jsx)("div", {
|
|
248
|
+
className: WorkflowRunPanel_module_css_default.phaseList,
|
|
249
|
+
children: node.data.phases.length === 0 ? (0, react_jsx_runtime.jsx)("span", {
|
|
250
|
+
className: WorkflowRunPanel_module_css_default.empty,
|
|
251
|
+
children: t("run.empty")
|
|
252
|
+
}) : node.data.phases.map((phase) => (0, react_jsx_runtime.jsx)(PhaseSection, {
|
|
253
|
+
phase,
|
|
254
|
+
navigable,
|
|
255
|
+
openSession,
|
|
256
|
+
t
|
|
257
|
+
}, phase.key))
|
|
258
|
+
})
|
|
259
|
+
})
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region lib/types/client/locales.js
|
|
264
|
+
/** `workflowRun` namespace dictionaries. */
|
|
265
|
+
/** Dictionary namespace owned by this plugin. */
|
|
266
|
+
const NS = "workflowRun";
|
|
267
|
+
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
268
|
+
const zh = {
|
|
269
|
+
"run.title": "{name}",
|
|
270
|
+
"run.members.one": "{count} 个成员",
|
|
271
|
+
"run.members.other": "{count} 个成员",
|
|
272
|
+
"run.empty": "没有启动成员",
|
|
273
|
+
"phase.unassigned": "未分阶段",
|
|
274
|
+
"phase.empty": "空阶段名",
|
|
275
|
+
"statusCount.running": "运行中 {count}",
|
|
276
|
+
"statusCount.completed": "已完成 {count}",
|
|
277
|
+
"statusCount.failed": "失败 {count}",
|
|
278
|
+
"statusCount.cancelled": "已取消 {count}",
|
|
279
|
+
"statusCount.interrupted": "已中断 {count}",
|
|
280
|
+
"member.empty": "空成员名",
|
|
281
|
+
"member.open": "打开 {name}",
|
|
282
|
+
"status.running": "运行中",
|
|
283
|
+
"status.completed": "已完成",
|
|
284
|
+
"status.failed": "失败",
|
|
285
|
+
"status.cancelled": "已取消",
|
|
286
|
+
"status.interrupted": "已中断"
|
|
287
|
+
};
|
|
288
|
+
/** English dictionary (same key set). */
|
|
289
|
+
const en = {
|
|
290
|
+
"run.title": "{name}",
|
|
291
|
+
"run.members.one": "{count} member",
|
|
292
|
+
"run.members.other": "{count} members",
|
|
293
|
+
"run.empty": "No members started",
|
|
294
|
+
"phase.unassigned": "Unphased",
|
|
295
|
+
"phase.empty": "Empty phase name",
|
|
296
|
+
"statusCount.running": "Running {count}",
|
|
297
|
+
"statusCount.completed": "Completed {count}",
|
|
298
|
+
"statusCount.failed": "Failed {count}",
|
|
299
|
+
"statusCount.cancelled": "Cancelled {count}",
|
|
300
|
+
"statusCount.interrupted": "Interrupted {count}",
|
|
301
|
+
"member.empty": "Empty member name",
|
|
302
|
+
"member.open": "Open {name}",
|
|
303
|
+
"status.running": "Running",
|
|
304
|
+
"status.completed": "Completed",
|
|
305
|
+
"status.failed": "Failed",
|
|
306
|
+
"status.cancelled": "Cancelled",
|
|
307
|
+
"status.interrupted": "Interrupted"
|
|
308
|
+
};
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region lib/types/client/workflow-definition.js
|
|
311
|
+
/**
|
|
312
|
+
* Build a collision-free phase key preserving absent versus empty identity.
|
|
313
|
+
* @param phase - exact phase string, or null for an omitted field.
|
|
314
|
+
* @returns the stable renderer key for that phase identity.
|
|
315
|
+
*/
|
|
316
|
+
function workflowPhaseKey(phase) {
|
|
317
|
+
return phase === null ? "missing" : `value:${phase.length}:${phase}`;
|
|
318
|
+
}
|
|
319
|
+
function statusFromStopReason(stopReason) {
|
|
320
|
+
switch (stopReason) {
|
|
321
|
+
case "completed": return "completed";
|
|
322
|
+
case "cancelled": return "cancelled";
|
|
323
|
+
case "error": return "failed";
|
|
324
|
+
/* v8 ignore next -- WorkflowStopReason is closed and every variant is handled above. */
|
|
325
|
+
default: return stopReason;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
function statusFromOutcome(outcome) {
|
|
329
|
+
switch (outcome) {
|
|
330
|
+
case "completed": return "completed";
|
|
331
|
+
case "cancelled": return "cancelled";
|
|
332
|
+
case "failed": return "failed";
|
|
333
|
+
/* v8 ignore next -- WorkflowAgentOutcome is closed and every variant is handled above. */
|
|
334
|
+
default: return outcome;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function locationClosed(location) {
|
|
338
|
+
if (location.kind === "step") return location.step.status === "closed" || location.turn.status === "closed";
|
|
339
|
+
return location.kind === "turn" && location.turn.status === "closed";
|
|
340
|
+
}
|
|
341
|
+
function projectWorkflow(context, location) {
|
|
342
|
+
const state = context.state;
|
|
343
|
+
const interrupted = state.stopReason === void 0 && locationClosed(location);
|
|
344
|
+
const phases = /* @__PURE__ */ new Map();
|
|
345
|
+
for (const member of state.members) {
|
|
346
|
+
const phase = member.phase === void 0 ? null : member.phase;
|
|
347
|
+
const key = workflowPhaseKey(phase);
|
|
348
|
+
let group = phases.get(key);
|
|
349
|
+
if (group === void 0) {
|
|
350
|
+
group = {
|
|
351
|
+
phase,
|
|
352
|
+
members: []
|
|
353
|
+
};
|
|
354
|
+
phases.set(key, group);
|
|
355
|
+
}
|
|
356
|
+
group.members.push({
|
|
357
|
+
seq: member.seq,
|
|
358
|
+
label: member.label,
|
|
359
|
+
childId: member.childId,
|
|
360
|
+
status: member.outcome === void 0 ? interrupted ? "interrupted" : "running" : statusFromOutcome(member.outcome)
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
const projectedPhases = [...phases].map(([key, phase]) => ({
|
|
364
|
+
key,
|
|
365
|
+
phase: phase.phase,
|
|
366
|
+
members: phase.members
|
|
367
|
+
}));
|
|
368
|
+
return {
|
|
369
|
+
name: state.name,
|
|
370
|
+
status: state.stopReason === void 0 ? interrupted ? "interrupted" : "running" : statusFromStopReason(state.stopReason),
|
|
371
|
+
phases: projectedPhases
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
function updateAgentStart(state, data) {
|
|
375
|
+
const member = {
|
|
376
|
+
seq: data.seq,
|
|
377
|
+
label: data.label,
|
|
378
|
+
...data.phase === void 0 ? {} : { phase: data.phase },
|
|
379
|
+
childId: data.childId
|
|
380
|
+
};
|
|
381
|
+
return {
|
|
382
|
+
...state,
|
|
383
|
+
members: [...state.members, member]
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function updateAgentEnd(state, data) {
|
|
387
|
+
return {
|
|
388
|
+
...state,
|
|
389
|
+
members: state.members.map((member) => member.seq === data.seq ? {
|
|
390
|
+
...member,
|
|
391
|
+
outcome: data.outcome
|
|
392
|
+
} : member)
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
/** Durable workflow event family folded into one keyed Chat node. */
|
|
396
|
+
const workflowRunDefinition = {
|
|
397
|
+
kind: "workflow-run",
|
|
398
|
+
target: "chat",
|
|
399
|
+
match: (event) => {
|
|
400
|
+
if (event.type === "tool-workflow/run-start") return {
|
|
401
|
+
id: String(event.data.runId),
|
|
402
|
+
role: "start"
|
|
403
|
+
};
|
|
404
|
+
if (event.type === "tool-workflow/agent-start" || event.type === "tool-workflow/agent-end" || event.type === "tool-workflow/run-end") return {
|
|
405
|
+
id: String(event.data.runId),
|
|
406
|
+
role: "update"
|
|
407
|
+
};
|
|
408
|
+
return null;
|
|
409
|
+
},
|
|
410
|
+
start: (_context, match) => {
|
|
411
|
+
if (match.event.type !== "tool-workflow/run-start") throw new Error("workflow-run start requires tool-workflow/run-start");
|
|
412
|
+
return {
|
|
413
|
+
name: match.event.data.name,
|
|
414
|
+
members: []
|
|
415
|
+
};
|
|
416
|
+
},
|
|
417
|
+
update: (context, match) => {
|
|
418
|
+
if (match.event.type === "tool-workflow/agent-start") return updateAgentStart(context.state, match.event.data);
|
|
419
|
+
if (match.event.type === "tool-workflow/agent-end") return updateAgentEnd(context.state, match.event.data);
|
|
420
|
+
if (match.event.type === "tool-workflow/run-end") return {
|
|
421
|
+
...context.state,
|
|
422
|
+
stopReason: match.event.data.stopReason
|
|
423
|
+
};
|
|
424
|
+
return context.state;
|
|
425
|
+
},
|
|
426
|
+
buildViewNode: (context) => {
|
|
427
|
+
if (context.start === void 0) return null;
|
|
428
|
+
const data = projectWorkflow(context, context.start.location);
|
|
429
|
+
return {
|
|
430
|
+
key: context.key,
|
|
431
|
+
kind: "workflow-run",
|
|
432
|
+
id: context.id,
|
|
433
|
+
target: "chat",
|
|
434
|
+
anchorSeq: context.start.event.seq,
|
|
435
|
+
location: context.start.location,
|
|
436
|
+
visibility: "visible",
|
|
437
|
+
data
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
//#endregion
|
|
442
|
+
//#region lib/types/client/index.js
|
|
443
|
+
/** Browser plugin for durable workflow-run Conversation Nodes. */
|
|
444
|
+
/** Required services for Definition, keyed renderer, navigation, and copy. */
|
|
445
|
+
const inject = [
|
|
446
|
+
"conversationEvents",
|
|
447
|
+
"slots",
|
|
448
|
+
"sessions",
|
|
449
|
+
"locale"
|
|
450
|
+
];
|
|
451
|
+
/** Register the workflow Definition, dictionary, and keyed Chat renderer. */
|
|
452
|
+
function apply(ctx) {
|
|
453
|
+
ctx.conversationEvents.register(workflowRunDefinition);
|
|
454
|
+
ctx.effect(() => ctx.locale.register(NS, {
|
|
455
|
+
zh,
|
|
456
|
+
en
|
|
457
|
+
}), "ui-workflow-run: dictionaries");
|
|
458
|
+
ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
|
|
459
|
+
name: "conversation.chat.node",
|
|
460
|
+
key: "workflow-run",
|
|
461
|
+
locale: NS,
|
|
462
|
+
inject: () => ({ openSession: (id) => {
|
|
463
|
+
ctx.sessions.open(id);
|
|
464
|
+
} })
|
|
465
|
+
}, WorkflowRunPanel));
|
|
466
|
+
}
|
|
467
|
+
//#endregion
|
|
468
|
+
exports.apply = apply;
|
|
469
|
+
exports.inject = inject;
|
|
470
|
+
return module.exports;
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
//# sourceMappingURL=client.js.map
|