dsh-edge 0.18.0 → 0.19.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +8 -8
- package/README.zh.md +8 -8
- package/THIRD_PARTY_NOTICES.md +2011 -449
- package/dist/assets/fonts/Montserrat-OFL.txt +93 -0
- package/dist/assets/fonts/montserrat-light-Cvd2VjE_.woff2 +0 -0
- package/dist/assets/fonts/montserrat-medium-B4OyO9CN.woff2 +0 -0
- package/dist/assets/fonts/montserrat-regular-DYep38cA.woff2 +0 -0
- package/dist/assets/index-Cq6ljTv2.css +1 -0
- package/dist/assets/index-Dy0OhsZ5.js +127 -0
- package/dist/assets/langs/asciidoc-Ve4PFQV2.js +2 -0
- package/dist/assets/langs/bat-BkioyH1T.js +2 -0
- package/dist/assets/langs/bibtex-CHM0blh-.js +2 -0
- package/dist/assets/langs/clojure-P80f7IUj.js +2 -0
- package/dist/assets/langs/cmake-D1j8_8rp.js +2 -0
- package/dist/assets/langs/csv-fuZLfV_i.js +2 -0
- package/dist/assets/langs/dart-bE4Kk8sk.js +2 -0
- package/dist/assets/langs/diff-D97Zzqfu.js +2 -0
- package/dist/assets/langs/dotenv-Da5cRb03.js +2 -0
- package/dist/assets/langs/elixir-CvYZzuDY.js +2 -0
- package/dist/assets/langs/erlang-DsQrWhSR.js +2 -0
- package/dist/assets/langs/fish-BvzEVeQv.js +2 -0
- package/dist/assets/langs/fsharp-CXgrBDvD.js +2 -0
- package/dist/assets/langs/graphql-DujV8YkJ.js +2 -0
- package/dist/assets/langs/groovy-gcz8RCvz.js +2 -0
- package/dist/assets/langs/haskell-Df6bDoY_.js +2 -0
- package/dist/assets/langs/hcl-BWvSN4gD.js +2 -0
- package/dist/assets/langs/html-derivative-DOyKdj44.js +2 -0
- package/dist/assets/langs/html-fwsONPVS.js +2 -0
- package/dist/assets/langs/http-DcV90OkR.js +2 -0
- package/dist/assets/langs/javascript-DI5JR1nB.js +2 -0
- package/dist/assets/langs/julia-BpJ6DjL_.js +2 -0
- package/dist/assets/langs/latex-B4C7GdlO.js +2 -0
- package/dist/assets/langs/log-2UxHyX5q.js +2 -0
- package/dist/assets/langs/make-CHLpvVh8.js +2 -0
- package/dist/assets/langs/nix-CwoSXNpI.js +2 -0
- package/dist/assets/langs/perl-DsWkoyyU.js +2 -0
- package/dist/assets/langs/php-LEPfNACG.js +2 -0
- package/dist/assets/langs/powershell-Dpen1YoG.js +2 -0
- package/dist/assets/langs/proto-C7zT0LnQ.js +2 -0
- package/dist/assets/langs/r-Dspwwk_N.js +2 -0
- package/dist/assets/langs/rst-BbocfKWr.js +2 -0
- package/dist/assets/langs/ruby-R292Iif0.js +2 -0
- package/dist/assets/langs/scala-C151Ov-r.js +2 -0
- package/dist/assets/langs/svelte-DNMY6jOf.js +2 -0
- package/dist/assets/langs/system-verilog-CnnmHF94.js +2 -0
- package/dist/assets/langs/vb-D17OF-Vu.js +2 -0
- package/dist/assets/langs/verilog-BQ8w6xss.js +2 -0
- package/dist/assets/langs/vue-Dq2x6432.js +2 -0
- package/dist/favicon-dark.svg +3 -0
- package/dist/favicon.svg +0 -5
- package/dist/index.html +5 -4
- package/dist/manifest.webmanifest +3 -4
- package/dist/plugins/@deepseek-ai/dsh-api-gateway/client.js +353 -101
- package/dist/plugins/@deepseek-ai/dsh-api-job-controller/client.js +367 -0
- package/dist/plugins/@deepseek-ai/dsh-api-remotes/client.js +7223 -3584
- package/dist/plugins/@deepseek-ai/dsh-api-session-controller/client.js +1107 -991
- package/dist/plugins/@deepseek-ai/dsh-api-workspace-controller/client.js +119 -6
- package/dist/plugins/@deepseek-ai/dsh-api-workspace-files/client.js +41 -35
- package/dist/plugins/@deepseek-ai/dsh-client-connection/client.js +354 -5279
- package/dist/plugins/@deepseek-ai/dsh-client-file-upload/client.js +10 -23
- package/dist/plugins/@deepseek-ai/dsh-client-locale/client.js +234 -80
- package/dist/plugins/@deepseek-ai/dsh-client-modules/client.js +554 -46
- package/dist/plugins/@deepseek-ai/dsh-client-shortcuts/client.js +2006 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +1090 -914
- package/dist/plugins/@deepseek-ai/dsh-client-ui-approval/client.js +79 -6
- package/dist/plugins/@deepseek-ai/dsh-client-ui-attachment/client.js +126 -155
- package/dist/plugins/@deepseek-ai/dsh-client-ui-chat/client.js +5776 -1593
- package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +375 -121
- package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +3524 -1923
- package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +1615 -258
- package/dist/plugins/@deepseek-ai/dsh-client-ui-directory-picker-browse/client.js +9 -9
- package/dist/plugins/@deepseek-ai/dsh-client-ui-goal/client.js +25 -10
- package/dist/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js +169 -24
- package/dist/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js +413 -63
- package/dist/plugins/@deepseek-ai/dsh-client-ui-layout/client.js +131 -14
- package/dist/plugins/@deepseek-ai/dsh-client-ui-message-feedback/client.js +24 -22
- package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +281 -128
- package/dist/plugins/@deepseek-ai/dsh-client-ui-open-in-app/client.js +674 -223
- package/dist/plugins/@deepseek-ai/dsh-client-ui-plan/client.js +596 -18
- package/dist/plugins/@deepseek-ai/dsh-client-ui-reference/client.js +92 -9
- package/dist/plugins/@deepseek-ai/dsh-client-ui-renderer/client.js +467 -59
- package/dist/plugins/@deepseek-ai/dsh-client-ui-session/client.js +231 -72
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings/client.js +281 -117
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +642 -122
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-models/client.js +1565 -438
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/client.js +201 -75
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-plugins/client.js +30 -1628
- package/dist/plugins/@deepseek-ai/dsh-client-ui-shortcuts/client.js +1163 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +165 -39
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-browser/client.js +1648 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client.js +5515 -25622
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-files/client.js +419 -118
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-right/client.js +5692 -260
- package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +156 -41
- package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +386 -263
- package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +183 -73
- package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +2367 -429
- package/dist/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js +788 -270
- package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +87 -79
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +28 -14
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +2647 -1044
- package/dist/plugins/@deepseek-ai/dsh-typert-registry/client.js +22 -7
- package/dist/plugins/dsh-edge-client-ui/client.js +1 -10
- package/package.json +96 -86
- package/scripts/cli.mjs +16 -4
- package/scripts/install.d.mts +12 -2
- package/scripts/install.mjs +36 -9
- package/scripts/legal-files.mjs +15 -0
- package/worker/direct/index.js +2564 -1822
- package/worker/isolated/index.js +2144 -1402
- package/dist/assets/index-BKQ_L1z6.js +0 -117
- package/dist/assets/index-DPX2bQLO.css +0 -1
- package/dist/assets/langs/html-CfGypltT.js +0 -2
- package/dist/assets/langs/php-DJl5gRdb.js +0 -2
- package/dist/assets/langs/ruby-5eNB0pDK.js +0 -2
- package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +0 -505
- package/dist/plugins/@deepseek-ai/dsh-client-ui-schedule/client.js +0 -307
|
@@ -8,7 +8,7 @@ window.__ModuleLoader__.load({
|
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
10
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-jobs/src/client/JobListAction.module.css.mjs
|
|
11
|
-
const css = ".QsffPG_root{position:relative}.QsffPG_trigger{min-height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;
|
|
11
|
+
const css = ".QsffPG_root{position:relative}.QsffPG_trigger{border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;align-items:center;gap:3px;padding:3px 2px;font-size:12px;line-height:18px;display:inline-flex}.QsffPG_trigger:hover,.QsffPG_trigger:focus-visible{color:var(--dsw-alias-label-secondary)}.QsffPG_trigger svg{transition:transform .12s}.QsffPG_triggerOpen{transform:rotate(180deg)}.QsffPG_triggerDot{flex:none}.QsffPG_count{margin:0 5px}.QsffPG_menu{z-index:100;box-sizing:border-box;border-radius:var(--dsw-radius-lg);background:var(--dsw-specific-menu);width:500px;max-width:min(560px,100vw - 32px);max-height:min(480px,100vh - 140px);backdrop-filter:var(--dsw-menu-backdrop-filter);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-prominent);border:0;flex-direction:column;gap:1px;margin:0;padding:3px;list-style:none;display:flex;position:absolute;top:calc(100% + 5px);left:0;overflow:auto}.QsffPG_sectionHeader{border-top:.5px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-tertiary);justify-content:space-between;align-items:center;margin:4px 4px 1px;padding:4px 0 3px;font-size:11px;line-height:16px;display:flex}.QsffPG_sectionHeader:first-child{border-top:0;margin-top:0}.QsffPG_sectionToggle,.QsffPG_sectionClear{border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;align-items:center;gap:3px;padding:2px 4px;font-size:11px;line-height:16px;display:inline-flex}.QsffPG_sectionToggle:hover,.QsffPG_sectionToggle:focus-visible,.QsffPG_sectionClear:hover,.QsffPG_sectionClear:focus-visible{background:var(--dsw-alias-fill-l1);color:var(--dsw-alias-label-secondary)}.QsffPG_sectionChevron{transition:transform .12s;transform:rotate(-90deg)}.QsffPG_sectionChevronOpen{transform:none}.QsffPG_item{flex-direction:column;display:flex}.QsffPG_rowLine{align-items:stretch;gap:6px;display:flex}.QsffPG_rowLineLive{border-radius:var(--dsw-radius-md);background:var(--dsw-alias-fill-l2);padding:4px 8px 4px 2px}.QsffPG_rowLineLive:hover{background:color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent)}.QsffPG_rowLineLive .QsffPG_kind{background:var(--dsw-specific-menu)}.QsffPG_rowLine .QsffPG_row{flex:1;min-width:0}.QsffPG_rowLineLive .QsffPG_row:hover{background:0 0}.QsffPG_rowLineLive .QsffPG_row:focus-visible{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent)}.QsffPG_chevronBox{border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm);background:var(--dsw-specific-menu);flex:none;justify-content:center;align-self:center;align-items:center;width:20px;height:20px;display:inline-flex}.QsffPG_stop{border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm);background:var(--dsw-specific-menu);width:20px;height:20px;color:var(--dsw-alias-label-secondary);cursor:pointer;flex:none;justify-content:center;align-self:center;align-items:center;padding:0;display:inline-flex}.QsffPG_stop:hover,.QsffPG_stop:focus-visible{border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary) 45%, transparent);color:var(--dsw-alias-state-error-primary)}.QsffPG_stopArmed,.QsffPG_stopArmed:hover,.QsffPG_stopArmed:focus-visible{border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary) 45%, transparent);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);width:auto;color:var(--dsw-alias-state-error-primary);gap:4px;padding:0 7px}.QsffPG_stopLabel{white-space:nowrap;font-size:11px;line-height:18px}.QsffPG_stopFailed{color:var(--dsw-alias-state-error-primary)}.QsffPG_row{box-sizing:border-box;border-radius:var(--dsw-radius-sm);width:100%;min-height:28px;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;border:0;align-items:center;gap:6px;padding:4px 7px;font-size:12px;line-height:17px;display:flex}.QsffPG_row:hover,.QsffPG_row:focus-visible{background:var(--dsw-alias-fill-l1)}.QsffPG_rowStatic{cursor:default}.QsffPG_rowStatic:hover{background:0 0}.QsffPG_rowSettled{color:var(--dsw-alias-label-tertiary)}.QsffPG_row .QsffPG_rowDot{flex:none}.QsffPG_main{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.QsffPG_primary{align-items:baseline;gap:8px;min-width:0;display:flex}.QsffPG_secondary{align-items:center;gap:6px;min-width:0;display:flex}.QsffPG_kind{border-radius:var(--dsw-radius-xs);background:var(--dsw-alias-fill-l2);color:var(--dsw-alias-label-secondary);flex:none;padding:0 5px;font-size:10px;line-height:16px}.QsffPG_label{min-width:0;font-family:var(--dsw-font-mono);white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}.QsffPG_status{max-width:60%;color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;flex:none;font-size:10px;line-height:16px;overflow:hidden}.QsffPG_duration{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:11px;line-height:18px}.QsffPG_chevron{color:var(--dsw-alias-label-tertiary);flex:none}.QsffPG_chevronOpen{transform:rotate(180deg)}.QsffPG_panel{--dsl-terminal-command-whitespace:pre-wrap;--dsl-terminal-line-whitespace:pre-wrap;--dsl-terminal-output-max-height:288px;margin:0 8px 8px}.QsffPG_panel [data-terminal]{--dsl-terminal-gutter:12px}.QsffPG_notice{color:var(--dsw-alias-label-tertiary);margin:0 8px 6px;font-size:11px;line-height:16px}.QsffPG_noticeError{color:var(--dsw-alias-state-error-primary)}";
|
|
12
12
|
const tagId = "@deepseek-ai/dsh-client-ui-jobs/JobListAction.module.css";
|
|
13
13
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
14
14
|
const tag = document.createElement("style");
|
|
@@ -18,16 +18,38 @@ window.__ModuleLoader__.load({
|
|
|
18
18
|
document.head.appendChild(tag);
|
|
19
19
|
}
|
|
20
20
|
var JobListAction_module_css_default = {
|
|
21
|
+
"chevron": "QsffPG_chevron",
|
|
22
|
+
"chevronBox": "QsffPG_chevronBox",
|
|
23
|
+
"chevronOpen": "QsffPG_chevronOpen",
|
|
21
24
|
"count": "QsffPG_count",
|
|
22
25
|
"duration": "QsffPG_duration",
|
|
26
|
+
"item": "QsffPG_item",
|
|
23
27
|
"kind": "QsffPG_kind",
|
|
24
28
|
"label": "QsffPG_label",
|
|
29
|
+
"main": "QsffPG_main",
|
|
25
30
|
"menu": "QsffPG_menu",
|
|
31
|
+
"notice": "QsffPG_notice",
|
|
32
|
+
"noticeError": "QsffPG_noticeError",
|
|
33
|
+
"panel": "QsffPG_panel",
|
|
34
|
+
"primary": "QsffPG_primary",
|
|
26
35
|
"root": "QsffPG_root",
|
|
27
36
|
"row": "QsffPG_row",
|
|
28
37
|
"rowDot": "QsffPG_rowDot",
|
|
38
|
+
"rowLine": "QsffPG_rowLine",
|
|
39
|
+
"rowLineLive": "QsffPG_rowLineLive",
|
|
29
40
|
"rowSettled": "QsffPG_rowSettled",
|
|
41
|
+
"rowStatic": "QsffPG_rowStatic",
|
|
42
|
+
"secondary": "QsffPG_secondary",
|
|
43
|
+
"sectionChevron": "QsffPG_sectionChevron",
|
|
44
|
+
"sectionChevronOpen": "QsffPG_sectionChevronOpen",
|
|
45
|
+
"sectionClear": "QsffPG_sectionClear",
|
|
46
|
+
"sectionHeader": "QsffPG_sectionHeader",
|
|
47
|
+
"sectionToggle": "QsffPG_sectionToggle",
|
|
30
48
|
"status": "QsffPG_status",
|
|
49
|
+
"stop": "QsffPG_stop",
|
|
50
|
+
"stopArmed": "QsffPG_stopArmed",
|
|
51
|
+
"stopFailed": "QsffPG_stopFailed",
|
|
52
|
+
"stopLabel": "QsffPG_stopLabel",
|
|
31
53
|
"trigger": "QsffPG_trigger",
|
|
32
54
|
"triggerDot": "QsffPG_triggerDot",
|
|
33
55
|
"triggerOpen": "QsffPG_triggerOpen"
|
|
@@ -35,11 +57,27 @@ window.__ModuleLoader__.load({
|
|
|
35
57
|
//#endregion
|
|
36
58
|
//#region lib/types/client/JobListAction.js
|
|
37
59
|
/** Stable empty list so a session with no jobs keeps one array identity. */
|
|
38
|
-
const
|
|
39
|
-
/**
|
|
60
|
+
const NO_JOBS = [];
|
|
61
|
+
/** Minimum gap kept between the popover and the viewport edges (the Menu primitive's portal margin). */
|
|
62
|
+
const VIEWPORT_MARGIN = 12;
|
|
63
|
+
/** How long an armed kill waits for its confirming press before disarming. */
|
|
64
|
+
const KILL_ARM_MS = 3e3;
|
|
65
|
+
/** How long a failed kill keeps its hint before the button resets. */
|
|
66
|
+
const KILL_FAILED_MS = 4e3;
|
|
40
67
|
function isLive(job) {
|
|
41
68
|
return job.status === "running" || job.status === "stopping";
|
|
42
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Whether the row offers an output panel: every live job (its output may
|
|
72
|
+
* still arrive) and a settled one that left retained output behind.
|
|
73
|
+
*/
|
|
74
|
+
function isObservable(job) {
|
|
75
|
+
return isLive(job) || job.output.total > 0;
|
|
76
|
+
}
|
|
77
|
+
/** The one-line qualifier beside the status: live progress while running, the terminal reason once settled. */
|
|
78
|
+
function jobDetail(job) {
|
|
79
|
+
return job.progress ?? job.detail;
|
|
80
|
+
}
|
|
43
81
|
/** Closed-union exhaustiveness fence for the wire status set. */
|
|
44
82
|
/* v8 ignore next 3 -- closed-union backstop; only reached if a status is forged */
|
|
45
83
|
function assertNever(value) {
|
|
@@ -60,7 +98,6 @@ window.__ModuleLoader__.load({
|
|
|
60
98
|
default: return assertNever(status);
|
|
61
99
|
}
|
|
62
100
|
}
|
|
63
|
-
/** Human status word for the row and its accessible name. */
|
|
64
101
|
function statusLabel(status, t) {
|
|
65
102
|
switch (status) {
|
|
66
103
|
case "running": return t("status.running");
|
|
@@ -73,9 +110,9 @@ window.__ModuleLoader__.load({
|
|
|
73
110
|
}
|
|
74
111
|
}
|
|
75
112
|
/**
|
|
76
|
-
* Elapsed time in at most two adjacent units. A
|
|
77
|
-
*
|
|
78
|
-
*
|
|
113
|
+
* Elapsed time in at most two adjacent units. A job that outlives an hour is
|
|
114
|
+
* already exceptional, so hours is the widest unit — beyond that the figure
|
|
115
|
+
* stays in hours rather than growing a day/month vocabulary no producer
|
|
79
116
|
* currently reaches.
|
|
80
117
|
*/
|
|
81
118
|
function formatDuration(elapsedMs, t) {
|
|
@@ -93,8 +130,30 @@ window.__ModuleLoader__.load({
|
|
|
93
130
|
});
|
|
94
131
|
return t("duration.seconds", { seconds });
|
|
95
132
|
}
|
|
133
|
+
/** Localized display copy for the embedded terminal panel. */
|
|
134
|
+
function terminalLabels(t) {
|
|
135
|
+
return {
|
|
136
|
+
/* v8 ignore next */
|
|
137
|
+
signal: (signal) => t("terminal.signal", { signal }),
|
|
138
|
+
/* v8 ignore next */
|
|
139
|
+
exitCode: (code) => t("terminal.exitCode", { code }),
|
|
140
|
+
noExitCode: t("terminal.noExitCode"),
|
|
141
|
+
running: t("terminal.running"),
|
|
142
|
+
failed: t("terminal.failed"),
|
|
143
|
+
done: t("terminal.done"),
|
|
144
|
+
copy: t("terminal.copy"),
|
|
145
|
+
copied: t("terminal.copied"),
|
|
146
|
+
noOutput: t("terminal.noOutput"),
|
|
147
|
+
collapseAria: t("terminal.collapseAria"),
|
|
148
|
+
collapse: t("terminal.collapse"),
|
|
149
|
+
/* v8 ignore next */
|
|
150
|
+
expandAria: (hidden) => t("terminal.expandAria", { n: hidden }),
|
|
151
|
+
/* v8 ignore next */
|
|
152
|
+
expand: (hidden) => t("terminal.expand", { n: hidden })
|
|
153
|
+
};
|
|
154
|
+
}
|
|
96
155
|
/**
|
|
97
|
-
* Live rows first in start order, then settled rows newest-first. Two
|
|
156
|
+
* Live rows first in start order, then settled rows newest-first. Two rows
|
|
98
157
|
* that settled in the same millisecond fall back to start order, so the sort
|
|
99
158
|
* never depends on the host's map iteration.
|
|
100
159
|
*/
|
|
@@ -107,24 +166,170 @@ window.__ModuleLoader__.load({
|
|
|
107
166
|
return finished !== 0 ? finished : left.startedAt - right.startedAt;
|
|
108
167
|
});
|
|
109
168
|
}
|
|
169
|
+
/** One job row plus, when observable and expanded, its live output panel. */
|
|
170
|
+
function JobItem({ job, view, expanded, now, onToggle, kill, t }) {
|
|
171
|
+
const live = isLive(job);
|
|
172
|
+
const status = statusLabel(job.status, t);
|
|
173
|
+
const detail = jobDetail(job);
|
|
174
|
+
const observable = isObservable(job);
|
|
175
|
+
const labels = (0, react.useMemo)(() => terminalLabels(t), [t]);
|
|
176
|
+
const duration = formatDuration(live ? now - job.startedAt : (job.finishedAt ?? job.startedAt) - job.startedAt, t);
|
|
177
|
+
const durationCell = (0, react_jsx_runtime.jsx)("span", {
|
|
178
|
+
className: JobListAction_module_css_default.duration,
|
|
179
|
+
title: t(live ? "duration.title.live" : "duration.title.done", { duration }),
|
|
180
|
+
children: duration
|
|
181
|
+
});
|
|
182
|
+
const body = live ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
183
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
184
|
+
state: dotState(job.status),
|
|
185
|
+
className: JobListAction_module_css_default.rowDot
|
|
186
|
+
}),
|
|
187
|
+
(0, react_jsx_runtime.jsxs)("span", {
|
|
188
|
+
className: JobListAction_module_css_default.main,
|
|
189
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
190
|
+
className: JobListAction_module_css_default.primary,
|
|
191
|
+
children: (0, react_jsx_runtime.jsx)("span", {
|
|
192
|
+
className: JobListAction_module_css_default.label,
|
|
193
|
+
title: job.label,
|
|
194
|
+
children: job.label
|
|
195
|
+
})
|
|
196
|
+
}), (0, react_jsx_runtime.jsxs)("span", {
|
|
197
|
+
className: JobListAction_module_css_default.secondary,
|
|
198
|
+
title: detail ?? status,
|
|
199
|
+
children: [
|
|
200
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
201
|
+
className: JobListAction_module_css_default.kind,
|
|
202
|
+
children: job.kind
|
|
203
|
+
}),
|
|
204
|
+
detail !== void 0 ? (0, react_jsx_runtime.jsx)("span", {
|
|
205
|
+
className: JobListAction_module_css_default.status,
|
|
206
|
+
children: detail
|
|
207
|
+
}) : null,
|
|
208
|
+
durationCell
|
|
209
|
+
]
|
|
210
|
+
})]
|
|
211
|
+
}),
|
|
212
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
213
|
+
className: JobListAction_module_css_default.chevronBox,
|
|
214
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {
|
|
215
|
+
size: 12,
|
|
216
|
+
className: expanded ? `${JobListAction_module_css_default.chevron} ${JobListAction_module_css_default.chevronOpen}` : JobListAction_module_css_default.chevron
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
|
+
] }) : (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
220
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
221
|
+
state: dotState(job.status),
|
|
222
|
+
className: JobListAction_module_css_default.rowDot
|
|
223
|
+
}),
|
|
224
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
225
|
+
className: JobListAction_module_css_default.kind,
|
|
226
|
+
children: job.kind
|
|
227
|
+
}),
|
|
228
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
229
|
+
className: JobListAction_module_css_default.label,
|
|
230
|
+
title: job.label,
|
|
231
|
+
children: job.label
|
|
232
|
+
}),
|
|
233
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
234
|
+
className: JobListAction_module_css_default.status,
|
|
235
|
+
title: detail ?? status,
|
|
236
|
+
children: detail ?? status
|
|
237
|
+
}),
|
|
238
|
+
durationCell,
|
|
239
|
+
observable ? (0, react_jsx_runtime.jsx)("span", {
|
|
240
|
+
className: JobListAction_module_css_default.chevronBox,
|
|
241
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {
|
|
242
|
+
size: 12,
|
|
243
|
+
className: expanded ? `${JobListAction_module_css_default.chevron} ${JobListAction_module_css_default.chevronOpen}` : JobListAction_module_css_default.chevron
|
|
244
|
+
})
|
|
245
|
+
}) : null
|
|
246
|
+
] });
|
|
247
|
+
const killTitle = kill === void 0 ? void 0 : kill.state === "armed" ? t("kill.confirm") : kill.state === "failed" ? t("kill.failed") : t("kill.stop", { label: job.label });
|
|
248
|
+
return (0, react_jsx_runtime.jsxs)("li", {
|
|
249
|
+
className: JobListAction_module_css_default.item,
|
|
250
|
+
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
251
|
+
className: live ? `${JobListAction_module_css_default.rowLine} ${JobListAction_module_css_default.rowLineLive}` : JobListAction_module_css_default.rowLine,
|
|
252
|
+
children: [observable ? (0, react_jsx_runtime.jsx)("button", {
|
|
253
|
+
type: "button",
|
|
254
|
+
className: live ? JobListAction_module_css_default.row : `${JobListAction_module_css_default.row} ${JobListAction_module_css_default.rowSettled}`,
|
|
255
|
+
"aria-expanded": expanded,
|
|
256
|
+
"aria-label": t(expanded ? "row.collapseAria" : "row.expandAria", { label: job.label }),
|
|
257
|
+
onClick: onToggle,
|
|
258
|
+
children: body
|
|
259
|
+
}) : (0, react_jsx_runtime.jsx)("span", {
|
|
260
|
+
className: `${JobListAction_module_css_default.row} ${JobListAction_module_css_default.rowSettled} ${JobListAction_module_css_default.rowStatic}`,
|
|
261
|
+
children: body
|
|
262
|
+
}), kill !== void 0 ? (0, react_jsx_runtime.jsxs)("button", {
|
|
263
|
+
type: "button",
|
|
264
|
+
className: kill.state === "armed" ? `${JobListAction_module_css_default.stop} ${JobListAction_module_css_default.stopArmed}` : kill.state === "failed" ? `${JobListAction_module_css_default.stop} ${JobListAction_module_css_default.stopFailed}` : JobListAction_module_css_default.stop,
|
|
265
|
+
"data-kill-state": kill.state,
|
|
266
|
+
disabled: kill.state === "pending",
|
|
267
|
+
"aria-label": killTitle,
|
|
268
|
+
title: killTitle,
|
|
269
|
+
onClick: kill.onPress,
|
|
270
|
+
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconStopFillRegular, { size: 10 }), kill.state === "armed" ? (0, react_jsx_runtime.jsx)("span", {
|
|
271
|
+
className: JobListAction_module_css_default.stopLabel,
|
|
272
|
+
children: t("kill.confirmAction")
|
|
273
|
+
}) : null]
|
|
274
|
+
}) : null]
|
|
275
|
+
}), expanded && view !== void 0 ? (0, react_jsx_runtime.jsxs)("div", {
|
|
276
|
+
className: JobListAction_module_css_default.panel,
|
|
277
|
+
children: [
|
|
278
|
+
view.gapBefore ? (0, react_jsx_runtime.jsx)("div", {
|
|
279
|
+
className: JobListAction_module_css_default.notice,
|
|
280
|
+
children: t("output.gap")
|
|
281
|
+
}) : null,
|
|
282
|
+
view.error !== void 0 ? (0, react_jsx_runtime.jsx)("div", {
|
|
283
|
+
className: `${JobListAction_module_css_default.notice} ${JobListAction_module_css_default.noticeError}`,
|
|
284
|
+
children: t("output.error", { error: view.error })
|
|
285
|
+
}) : null,
|
|
286
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.TerminalBlock, {
|
|
287
|
+
command: job.label,
|
|
288
|
+
output: view.text,
|
|
289
|
+
running: live,
|
|
290
|
+
copyText: job.label,
|
|
291
|
+
runStateDot: false,
|
|
292
|
+
maxLines: Number.POSITIVE_INFINITY,
|
|
293
|
+
labels
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
}) : null]
|
|
297
|
+
});
|
|
298
|
+
}
|
|
110
299
|
/**
|
|
111
|
-
* Session-header entry point for this session's background jobs.
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
300
|
+
* Session-header entry point for this session's background jobs. Mounting it
|
|
301
|
+
* keeps the session's roster stream open; it renders nothing at all until the
|
|
302
|
+
* session can see at least one job. Expanding an observable row (a live job,
|
|
303
|
+
* or a settled one with retained output) starts its observation stream, and
|
|
304
|
+
* collapsing (or closing the popover) stops it — output only flows while
|
|
305
|
+
* someone is watching. A running row carries a two-press stop button that
|
|
306
|
+
* requests a human kill through the job controller.
|
|
307
|
+
* @param props - runtime slot currency, the jobs snapshot hook, the roster,
|
|
308
|
+
* observation, and kill controls, and the namespace translator.
|
|
115
309
|
* @returns the trigger and its popover list, or null when there is nothing to show.
|
|
116
310
|
*/
|
|
117
|
-
function JobListAction({ sessionId,
|
|
118
|
-
const jobs =
|
|
311
|
+
function JobListAction({ sessionId, useJobs, watchRows, observe, killJob, t }) {
|
|
312
|
+
const jobs = useJobs((state) => state.rows[sessionId]) ?? NO_JOBS;
|
|
313
|
+
const observedViews = useJobs((state) => state.observed);
|
|
119
314
|
const [open, setOpen] = (0, react.useState)(false);
|
|
315
|
+
const [expandedKey, setExpandedKey] = (0, react.useState)(void 0);
|
|
120
316
|
const [now, setNow] = (0, react.useState)(() => Date.now());
|
|
317
|
+
const [settledOpen, setSettledOpen] = (0, react.useState)(void 0);
|
|
318
|
+
const [clearedKeys, setClearedKeys] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
|
319
|
+
const [killPhase, setKillPhase] = (0, react.useState)(void 0);
|
|
121
320
|
const rootRef = (0, react.useRef)(null);
|
|
122
321
|
const triggerRef = (0, react.useRef)(null);
|
|
322
|
+
const menuRef = (0, react.useRef)(null);
|
|
323
|
+
const [menuShift, setMenuShift] = (0, react.useState)(0);
|
|
123
324
|
const rows = (0, react.useMemo)(() => ordered(jobs), [jobs]);
|
|
124
|
-
const
|
|
325
|
+
const liveRows = (0, react.useMemo)(() => rows.filter(isLive), [rows]);
|
|
326
|
+
const settledRows = (0, react.useMemo)(() => rows.filter((job) => !isLive(job) && !clearedKeys.has(String(job.id))), [rows, clearedKeys]);
|
|
327
|
+
const settledExpanded = settledOpen ?? liveRows.length === 0;
|
|
328
|
+
const visibleCount = liveRows.length + settledRows.length;
|
|
125
329
|
(0, _deepseek_ai_dsh_client_ui_primitives.useDismissOnOutsidePointer)(rootRef, open, setOpen);
|
|
330
|
+
(0, react.useEffect)(() => watchRows(sessionId), [sessionId, watchRows]);
|
|
126
331
|
(0, react.useEffect)(() => {
|
|
127
|
-
if (!open ||
|
|
332
|
+
if (!open || liveRows.length === 0) return;
|
|
128
333
|
setNow(Date.now());
|
|
129
334
|
const timer = setInterval(() => {
|
|
130
335
|
setNow(Date.now());
|
|
@@ -132,18 +337,108 @@ window.__ModuleLoader__.load({
|
|
|
132
337
|
return () => {
|
|
133
338
|
clearInterval(timer);
|
|
134
339
|
};
|
|
135
|
-
}, [open,
|
|
340
|
+
}, [open, liveRows.length]);
|
|
341
|
+
(0, react.useLayoutEffect)(() => {
|
|
342
|
+
if (!open) {
|
|
343
|
+
setMenuShift(0);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
const fit = () => {
|
|
347
|
+
const root = rootRef.current;
|
|
348
|
+
const menu = menuRef.current;
|
|
349
|
+
/* v8 ignore next -- both refs are attached while the open popover renders. */
|
|
350
|
+
if (root === null || menu === null) return;
|
|
351
|
+
const width = menu.offsetWidth;
|
|
352
|
+
if (width === 0) return;
|
|
353
|
+
const anchorLeft = root.getBoundingClientRect().left;
|
|
354
|
+
setMenuShift(Math.max(VIEWPORT_MARGIN - anchorLeft, Math.min(0, window.innerWidth - VIEWPORT_MARGIN - width - anchorLeft)));
|
|
355
|
+
};
|
|
356
|
+
fit();
|
|
357
|
+
window.addEventListener("resize", fit);
|
|
358
|
+
return () => {
|
|
359
|
+
window.removeEventListener("resize", fit);
|
|
360
|
+
};
|
|
361
|
+
}, [open]);
|
|
362
|
+
const expandedRow = open && expandedKey !== void 0 ? rows.find((job) => String(job.id) === expandedKey) : void 0;
|
|
363
|
+
const activeJob = expandedRow !== void 0 && isObservable(expandedRow) ? expandedRow.id : void 0;
|
|
364
|
+
(0, react.useEffect)(() => {
|
|
365
|
+
if (activeJob === void 0) return;
|
|
366
|
+
return observe(sessionId, activeJob);
|
|
367
|
+
}, [
|
|
368
|
+
sessionId,
|
|
369
|
+
activeJob,
|
|
370
|
+
observe
|
|
371
|
+
]);
|
|
372
|
+
(0, react.useEffect)(() => {
|
|
373
|
+
if (visibleCount === 0 && open) setOpen(false);
|
|
374
|
+
}, [visibleCount, open]);
|
|
375
|
+
(0, react.useEffect)(() => {
|
|
376
|
+
if (expandedKey !== void 0 && !rows.some((job) => String(job.id) === expandedKey)) setExpandedKey(void 0);
|
|
377
|
+
}, [rows, expandedKey]);
|
|
378
|
+
(0, react.useEffect)(() => {
|
|
379
|
+
if (killPhase === void 0 || killPhase.state === "pending") return;
|
|
380
|
+
const timer = setTimeout(() => {
|
|
381
|
+
setKillPhase(void 0);
|
|
382
|
+
}, killPhase.state === "armed" ? KILL_ARM_MS : KILL_FAILED_MS);
|
|
383
|
+
return () => {
|
|
384
|
+
clearTimeout(timer);
|
|
385
|
+
};
|
|
386
|
+
}, [killPhase]);
|
|
136
387
|
(0, react.useEffect)(() => {
|
|
137
|
-
if (
|
|
138
|
-
}, [
|
|
139
|
-
|
|
140
|
-
|
|
388
|
+
if (killPhase !== void 0 && !rows.some((job) => String(job.id) === killPhase.key && job.status === "running")) setKillPhase(void 0);
|
|
389
|
+
}, [rows, killPhase]);
|
|
390
|
+
const pressKill = (job) => {
|
|
391
|
+
const key = String(job.id);
|
|
392
|
+
if (killPhase?.key !== key || killPhase.state !== "armed") {
|
|
393
|
+
setKillPhase({
|
|
394
|
+
key,
|
|
395
|
+
state: "armed"
|
|
396
|
+
});
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
setKillPhase({
|
|
400
|
+
key,
|
|
401
|
+
state: "pending"
|
|
402
|
+
});
|
|
403
|
+
killJob(sessionId, key).then((ok) => {
|
|
404
|
+
setKillPhase((current) => current?.key === key && !ok ? {
|
|
405
|
+
key,
|
|
406
|
+
state: "failed"
|
|
407
|
+
} : current);
|
|
408
|
+
});
|
|
409
|
+
};
|
|
410
|
+
if (visibleCount === 0) return null;
|
|
411
|
+
const countLabel = t(liveRows.length > 0 ? liveRows.length === 1 ? "count.live.one" : "count.live.other" : visibleCount === 1 ? "count.idle.one" : "count.idle.other", { count: liveRows.length > 0 ? liveRows.length : visibleCount });
|
|
412
|
+
const clearSettled = () => {
|
|
413
|
+
setClearedKeys((current) => {
|
|
414
|
+
const next = new Set(current);
|
|
415
|
+
for (const job of settledRows) next.add(String(job.id));
|
|
416
|
+
return next;
|
|
417
|
+
});
|
|
418
|
+
if (expandedKey !== void 0 && settledRows.some((job) => String(job.id) === expandedKey)) setExpandedKey(void 0);
|
|
419
|
+
};
|
|
141
420
|
const onKeyDown = (event) => {
|
|
142
421
|
if (event.key !== "Escape" || !open) return;
|
|
143
422
|
event.preventDefault();
|
|
144
423
|
setOpen(false);
|
|
145
424
|
triggerRef.current?.focus();
|
|
146
425
|
};
|
|
426
|
+
const item = (job) => (0, react_jsx_runtime.jsx)(JobItem, {
|
|
427
|
+
job,
|
|
428
|
+
view: isObservable(job) ? observedViews[String(job.id)] : void 0,
|
|
429
|
+
expanded: expandedKey === String(job.id),
|
|
430
|
+
now,
|
|
431
|
+
onToggle: () => {
|
|
432
|
+
setExpandedKey((current) => current === String(job.id) ? void 0 : String(job.id));
|
|
433
|
+
},
|
|
434
|
+
...job.status === "running" ? { kill: {
|
|
435
|
+
state: killPhase?.key === String(job.id) ? killPhase.state : "idle",
|
|
436
|
+
onPress: () => {
|
|
437
|
+
pressKill(job);
|
|
438
|
+
}
|
|
439
|
+
} } : {},
|
|
440
|
+
t
|
|
441
|
+
}, String(job.id));
|
|
147
442
|
return (0, react_jsx_runtime.jsxs)("div", {
|
|
148
443
|
ref: rootRef,
|
|
149
444
|
className: JobListAction_module_css_default.root,
|
|
@@ -159,7 +454,7 @@ window.__ModuleLoader__.load({
|
|
|
159
454
|
setOpen((current) => !current);
|
|
160
455
|
},
|
|
161
456
|
children: [
|
|
162
|
-
|
|
457
|
+
liveRows.length > 0 ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
163
458
|
state: "ongoing",
|
|
164
459
|
className: JobListAction_module_css_default.triggerDot
|
|
165
460
|
}) : null,
|
|
@@ -167,44 +462,45 @@ window.__ModuleLoader__.load({
|
|
|
167
462
|
className: JobListAction_module_css_default.count,
|
|
168
463
|
children: countLabel
|
|
169
464
|
}),
|
|
170
|
-
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.
|
|
465
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {
|
|
466
|
+
size: 12,
|
|
467
|
+
className: open ? JobListAction_module_css_default.triggerOpen : void 0
|
|
468
|
+
})
|
|
171
469
|
]
|
|
172
|
-
}), open ? (0, react_jsx_runtime.
|
|
470
|
+
}), open ? (0, react_jsx_runtime.jsxs)("ul", {
|
|
471
|
+
ref: menuRef,
|
|
173
472
|
className: JobListAction_module_css_default.menu,
|
|
473
|
+
style: { left: menuShift },
|
|
174
474
|
"aria-label": t("list.aria"),
|
|
175
|
-
children:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
})
|
|
205
|
-
]
|
|
206
|
-
}, job.id);
|
|
207
|
-
})
|
|
475
|
+
children: [
|
|
476
|
+
liveRows.length > 0 ? (0, react_jsx_runtime.jsx)("li", {
|
|
477
|
+
className: JobListAction_module_css_default.sectionHeader,
|
|
478
|
+
"aria-hidden": "true",
|
|
479
|
+
children: t("section.live")
|
|
480
|
+
}) : null,
|
|
481
|
+
liveRows.map(item),
|
|
482
|
+
settledRows.length > 0 ? (0, react_jsx_runtime.jsxs)("li", {
|
|
483
|
+
className: JobListAction_module_css_default.sectionHeader,
|
|
484
|
+
children: [(0, react_jsx_runtime.jsxs)("button", {
|
|
485
|
+
type: "button",
|
|
486
|
+
className: JobListAction_module_css_default.sectionToggle,
|
|
487
|
+
"aria-expanded": settledExpanded,
|
|
488
|
+
onClick: () => {
|
|
489
|
+
setSettledOpen(!settledExpanded);
|
|
490
|
+
},
|
|
491
|
+
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {
|
|
492
|
+
size: 12,
|
|
493
|
+
className: settledExpanded ? `${JobListAction_module_css_default.sectionChevron} ${JobListAction_module_css_default.sectionChevronOpen}` : JobListAction_module_css_default.sectionChevron
|
|
494
|
+
}), t("section.settledCount", { count: settledRows.length })]
|
|
495
|
+
}), (0, react_jsx_runtime.jsx)("button", {
|
|
496
|
+
type: "button",
|
|
497
|
+
className: JobListAction_module_css_default.sectionClear,
|
|
498
|
+
onClick: clearSettled,
|
|
499
|
+
children: t("section.clear")
|
|
500
|
+
})]
|
|
501
|
+
}) : null,
|
|
502
|
+
settledExpanded ? settledRows.map(item) : null
|
|
503
|
+
]
|
|
208
504
|
}) : null]
|
|
209
505
|
});
|
|
210
506
|
}
|
|
@@ -217,6 +513,15 @@ window.__ModuleLoader__.load({
|
|
|
217
513
|
"count.idle.one": "{count} 个后台任务",
|
|
218
514
|
"count.idle.other": "{count} 个后台任务",
|
|
219
515
|
"list.aria": "后台任务",
|
|
516
|
+
"section.live": "进行中",
|
|
517
|
+
"section.settledCount": "已结束 {count}",
|
|
518
|
+
"section.clear": "清空",
|
|
519
|
+
"row.expandAria": "展开 {label} 的实时输出",
|
|
520
|
+
"row.collapseAria": "收起 {label} 的实时输出",
|
|
521
|
+
"kill.stop": "停止任务 {label}",
|
|
522
|
+
"kill.confirm": "再次点击确认停止",
|
|
523
|
+
"kill.confirmAction": "确认停止",
|
|
524
|
+
"kill.failed": "停止失败",
|
|
220
525
|
"status.running": "运行中",
|
|
221
526
|
"status.stopping": "正在停止",
|
|
222
527
|
"status.completed": "已完成",
|
|
@@ -226,7 +531,22 @@ window.__ModuleLoader__.load({
|
|
|
226
531
|
"duration.minutes": "{minutes}分{seconds}秒",
|
|
227
532
|
"duration.hours": "{hours}小时{minutes}分",
|
|
228
533
|
"duration.title.live": "已运行 {duration}",
|
|
229
|
-
"duration.title.done": "耗时 {duration}"
|
|
534
|
+
"duration.title.done": "耗时 {duration}",
|
|
535
|
+
"output.gap": "……较早的输出已丢弃……",
|
|
536
|
+
"output.error": "实时输出流中断:{error}",
|
|
537
|
+
"terminal.signal": "信号 {signal}",
|
|
538
|
+
"terminal.exitCode": "退出码 {code}",
|
|
539
|
+
"terminal.noExitCode": "未正常退出",
|
|
540
|
+
"terminal.running": "运行中",
|
|
541
|
+
"terminal.failed": "已失败",
|
|
542
|
+
"terminal.done": "已完成",
|
|
543
|
+
"terminal.copy": "复制",
|
|
544
|
+
"terminal.copied": "已复制",
|
|
545
|
+
"terminal.noOutput": "(无输出)",
|
|
546
|
+
"terminal.collapse": "收起",
|
|
547
|
+
"terminal.collapseAria": "收起输出",
|
|
548
|
+
"terminal.expand": "展开其余 {n} 行",
|
|
549
|
+
"terminal.expandAria": "展开被折叠的 {n} 行输出"
|
|
230
550
|
};
|
|
231
551
|
/** English dictionary, key-identical to the Chinese source of truth. */
|
|
232
552
|
const en = {
|
|
@@ -235,6 +555,15 @@ window.__ModuleLoader__.load({
|
|
|
235
555
|
"count.idle.one": "{count} background job",
|
|
236
556
|
"count.idle.other": "{count} background jobs",
|
|
237
557
|
"list.aria": "Background jobs",
|
|
558
|
+
"section.live": "Running",
|
|
559
|
+
"section.settledCount": "Finished {count}",
|
|
560
|
+
"section.clear": "Clear",
|
|
561
|
+
"row.expandAria": "Show live output of {label}",
|
|
562
|
+
"row.collapseAria": "Hide live output of {label}",
|
|
563
|
+
"kill.stop": "Stop task {label}",
|
|
564
|
+
"kill.confirm": "Click again to confirm",
|
|
565
|
+
"kill.confirmAction": "Confirm stop",
|
|
566
|
+
"kill.failed": "Stop failed",
|
|
238
567
|
"status.running": "running",
|
|
239
568
|
"status.stopping": "stopping",
|
|
240
569
|
"status.completed": "completed",
|
|
@@ -244,13 +573,28 @@ window.__ModuleLoader__.load({
|
|
|
244
573
|
"duration.minutes": "{minutes}m {seconds}s",
|
|
245
574
|
"duration.hours": "{hours}h {minutes}m",
|
|
246
575
|
"duration.title.live": "Running for {duration}",
|
|
247
|
-
"duration.title.done": "Took {duration}"
|
|
576
|
+
"duration.title.done": "Took {duration}",
|
|
577
|
+
"output.gap": "… earlier output dropped …",
|
|
578
|
+
"output.error": "live output stream interrupted: {error}",
|
|
579
|
+
"terminal.signal": "signal {signal}",
|
|
580
|
+
"terminal.exitCode": "exit {code}",
|
|
581
|
+
"terminal.noExitCode": "no exit code",
|
|
582
|
+
"terminal.running": "running",
|
|
583
|
+
"terminal.failed": "failed",
|
|
584
|
+
"terminal.done": "done",
|
|
585
|
+
"terminal.copy": "Copy",
|
|
586
|
+
"terminal.copied": "Copied",
|
|
587
|
+
"terminal.noOutput": "(no output)",
|
|
588
|
+
"terminal.collapse": "Collapse",
|
|
589
|
+
"terminal.collapseAria": "Collapse output",
|
|
590
|
+
"terminal.expand": "Show {n} more lines",
|
|
591
|
+
"terminal.expandAria": "Expand {n} collapsed output lines"
|
|
248
592
|
};
|
|
249
593
|
//#endregion
|
|
250
594
|
//#region lib/types/client/index.js
|
|
251
|
-
/** Required services
|
|
595
|
+
/** Required services: the jobs rosters, observations, and kill, the slot registry, and dictionaries. */
|
|
252
596
|
const inject = [
|
|
253
|
-
"
|
|
597
|
+
"jobs",
|
|
254
598
|
"slots",
|
|
255
599
|
"locale"
|
|
256
600
|
];
|
|
@@ -262,12 +606,18 @@ window.__ModuleLoader__.load({
|
|
|
262
606
|
ctx.effect(() => ctx.locale.register("job", {
|
|
263
607
|
zh,
|
|
264
608
|
en
|
|
265
|
-
}), "ui-
|
|
609
|
+
}), "ui-jobs: dictionaries");
|
|
266
610
|
ctx.slots.inject("conversation.session.header.actions", () => ctx.slots.register({
|
|
267
611
|
name: "conversation.session.header.actions",
|
|
268
612
|
id: "job-list",
|
|
269
613
|
order: 20,
|
|
270
|
-
locale: "job"
|
|
614
|
+
locale: "job",
|
|
615
|
+
inject: () => ({
|
|
616
|
+
hooks: { jobs: ctx.jobs.state },
|
|
617
|
+
watchRows: (sessionId) => ctx.jobs.watchRows(sessionId),
|
|
618
|
+
observe: (sessionId, id) => ctx.jobs.observe(sessionId, id),
|
|
619
|
+
killJob: async (sessionId, jobId) => (await ctx.jobs.kill(sessionId, jobId)).ok
|
|
620
|
+
})
|
|
271
621
|
}, JobListAction));
|
|
272
622
|
}
|
|
273
623
|
//#endregion
|