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.
Files changed (118) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +8 -8
  3. package/README.zh.md +8 -8
  4. package/THIRD_PARTY_NOTICES.md +2011 -449
  5. package/dist/assets/fonts/Montserrat-OFL.txt +93 -0
  6. package/dist/assets/fonts/montserrat-light-Cvd2VjE_.woff2 +0 -0
  7. package/dist/assets/fonts/montserrat-medium-B4OyO9CN.woff2 +0 -0
  8. package/dist/assets/fonts/montserrat-regular-DYep38cA.woff2 +0 -0
  9. package/dist/assets/index-Cq6ljTv2.css +1 -0
  10. package/dist/assets/index-Dy0OhsZ5.js +127 -0
  11. package/dist/assets/langs/asciidoc-Ve4PFQV2.js +2 -0
  12. package/dist/assets/langs/bat-BkioyH1T.js +2 -0
  13. package/dist/assets/langs/bibtex-CHM0blh-.js +2 -0
  14. package/dist/assets/langs/clojure-P80f7IUj.js +2 -0
  15. package/dist/assets/langs/cmake-D1j8_8rp.js +2 -0
  16. package/dist/assets/langs/csv-fuZLfV_i.js +2 -0
  17. package/dist/assets/langs/dart-bE4Kk8sk.js +2 -0
  18. package/dist/assets/langs/diff-D97Zzqfu.js +2 -0
  19. package/dist/assets/langs/dotenv-Da5cRb03.js +2 -0
  20. package/dist/assets/langs/elixir-CvYZzuDY.js +2 -0
  21. package/dist/assets/langs/erlang-DsQrWhSR.js +2 -0
  22. package/dist/assets/langs/fish-BvzEVeQv.js +2 -0
  23. package/dist/assets/langs/fsharp-CXgrBDvD.js +2 -0
  24. package/dist/assets/langs/graphql-DujV8YkJ.js +2 -0
  25. package/dist/assets/langs/groovy-gcz8RCvz.js +2 -0
  26. package/dist/assets/langs/haskell-Df6bDoY_.js +2 -0
  27. package/dist/assets/langs/hcl-BWvSN4gD.js +2 -0
  28. package/dist/assets/langs/html-derivative-DOyKdj44.js +2 -0
  29. package/dist/assets/langs/html-fwsONPVS.js +2 -0
  30. package/dist/assets/langs/http-DcV90OkR.js +2 -0
  31. package/dist/assets/langs/javascript-DI5JR1nB.js +2 -0
  32. package/dist/assets/langs/julia-BpJ6DjL_.js +2 -0
  33. package/dist/assets/langs/latex-B4C7GdlO.js +2 -0
  34. package/dist/assets/langs/log-2UxHyX5q.js +2 -0
  35. package/dist/assets/langs/make-CHLpvVh8.js +2 -0
  36. package/dist/assets/langs/nix-CwoSXNpI.js +2 -0
  37. package/dist/assets/langs/perl-DsWkoyyU.js +2 -0
  38. package/dist/assets/langs/php-LEPfNACG.js +2 -0
  39. package/dist/assets/langs/powershell-Dpen1YoG.js +2 -0
  40. package/dist/assets/langs/proto-C7zT0LnQ.js +2 -0
  41. package/dist/assets/langs/r-Dspwwk_N.js +2 -0
  42. package/dist/assets/langs/rst-BbocfKWr.js +2 -0
  43. package/dist/assets/langs/ruby-R292Iif0.js +2 -0
  44. package/dist/assets/langs/scala-C151Ov-r.js +2 -0
  45. package/dist/assets/langs/svelte-DNMY6jOf.js +2 -0
  46. package/dist/assets/langs/system-verilog-CnnmHF94.js +2 -0
  47. package/dist/assets/langs/vb-D17OF-Vu.js +2 -0
  48. package/dist/assets/langs/verilog-BQ8w6xss.js +2 -0
  49. package/dist/assets/langs/vue-Dq2x6432.js +2 -0
  50. package/dist/favicon-dark.svg +3 -0
  51. package/dist/favicon.svg +0 -5
  52. package/dist/index.html +5 -4
  53. package/dist/manifest.webmanifest +3 -4
  54. package/dist/plugins/@deepseek-ai/dsh-api-gateway/client.js +353 -101
  55. package/dist/plugins/@deepseek-ai/dsh-api-job-controller/client.js +367 -0
  56. package/dist/plugins/@deepseek-ai/dsh-api-remotes/client.js +7223 -3584
  57. package/dist/plugins/@deepseek-ai/dsh-api-session-controller/client.js +1107 -991
  58. package/dist/plugins/@deepseek-ai/dsh-api-workspace-controller/client.js +119 -6
  59. package/dist/plugins/@deepseek-ai/dsh-api-workspace-files/client.js +41 -35
  60. package/dist/plugins/@deepseek-ai/dsh-client-connection/client.js +354 -5279
  61. package/dist/plugins/@deepseek-ai/dsh-client-file-upload/client.js +10 -23
  62. package/dist/plugins/@deepseek-ai/dsh-client-locale/client.js +234 -80
  63. package/dist/plugins/@deepseek-ai/dsh-client-modules/client.js +554 -46
  64. package/dist/plugins/@deepseek-ai/dsh-client-shortcuts/client.js +2006 -0
  65. package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +1090 -914
  66. package/dist/plugins/@deepseek-ai/dsh-client-ui-approval/client.js +79 -6
  67. package/dist/plugins/@deepseek-ai/dsh-client-ui-attachment/client.js +126 -155
  68. package/dist/plugins/@deepseek-ai/dsh-client-ui-chat/client.js +5776 -1593
  69. package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +375 -121
  70. package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +3524 -1923
  71. package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +1615 -258
  72. package/dist/plugins/@deepseek-ai/dsh-client-ui-directory-picker-browse/client.js +9 -9
  73. package/dist/plugins/@deepseek-ai/dsh-client-ui-goal/client.js +25 -10
  74. package/dist/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js +169 -24
  75. package/dist/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js +413 -63
  76. package/dist/plugins/@deepseek-ai/dsh-client-ui-layout/client.js +131 -14
  77. package/dist/plugins/@deepseek-ai/dsh-client-ui-message-feedback/client.js +24 -22
  78. package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +281 -128
  79. package/dist/plugins/@deepseek-ai/dsh-client-ui-open-in-app/client.js +674 -223
  80. package/dist/plugins/@deepseek-ai/dsh-client-ui-plan/client.js +596 -18
  81. package/dist/plugins/@deepseek-ai/dsh-client-ui-reference/client.js +92 -9
  82. package/dist/plugins/@deepseek-ai/dsh-client-ui-renderer/client.js +467 -59
  83. package/dist/plugins/@deepseek-ai/dsh-client-ui-session/client.js +231 -72
  84. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings/client.js +281 -117
  85. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +642 -122
  86. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-models/client.js +1565 -438
  87. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/client.js +201 -75
  88. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-plugins/client.js +30 -1628
  89. package/dist/plugins/@deepseek-ai/dsh-client-ui-shortcuts/client.js +1163 -0
  90. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +165 -39
  91. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-browser/client.js +1648 -0
  92. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client.js +5515 -25622
  93. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-files/client.js +419 -118
  94. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-right/client.js +5692 -260
  95. package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +156 -41
  96. package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +386 -263
  97. package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +183 -73
  98. package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +2367 -429
  99. package/dist/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js +788 -270
  100. package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +87 -79
  101. package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +28 -14
  102. package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +2647 -1044
  103. package/dist/plugins/@deepseek-ai/dsh-typert-registry/client.js +22 -7
  104. package/dist/plugins/dsh-edge-client-ui/client.js +1 -10
  105. package/package.json +96 -86
  106. package/scripts/cli.mjs +16 -4
  107. package/scripts/install.d.mts +12 -2
  108. package/scripts/install.mjs +36 -9
  109. package/scripts/legal-files.mjs +15 -0
  110. package/worker/direct/index.js +2564 -1822
  111. package/worker/isolated/index.js +2144 -1402
  112. package/dist/assets/index-BKQ_L1z6.js +0 -117
  113. package/dist/assets/index-DPX2bQLO.css +0 -1
  114. package/dist/assets/langs/html-CfGypltT.js +0 -2
  115. package/dist/assets/langs/php-DJl5gRdb.js +0 -2
  116. package/dist/assets/langs/ruby-5eNB0pDK.js +0 -2
  117. package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +0 -505
  118. package/dist/plugins/@deepseek-ai/dsh-client-ui-schedule/client.js +0 -307
@@ -5,10 +5,42 @@ window.__ModuleLoader__.load({
5
5
  var exports = module.exports;
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  let _deepseek_ai_dsh_client_ui_slots = require("@deepseek-ai/dsh-client-ui-slots");
8
- let react_jsx_runtime = require("react/jsx-runtime");
9
- let react = require("react");
10
8
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
11
9
  let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
10
+ let react_jsx_runtime = require("react/jsx-runtime");
11
+ let react = require("react");
12
+ let react_dom = require("react-dom");
13
+ //#region lib/types/client/shell-store.js
14
+ /** Shared settings viewing state for its mouse and command entry points. */
15
+ /**
16
+ * Declare the settings dialog state and its complete mutation API.
17
+ * @returns one root-scoped store handle for the settings shell.
18
+ */
19
+ function createSettingsShellStore() {
20
+ return (0, _deepseek_ai_dsh_client_store.defineStore)({
21
+ init: () => ({
22
+ open: false,
23
+ activeId: void 0
24
+ }),
25
+ actions: {
26
+ open: (d) => {
27
+ d.open = true;
28
+ },
29
+ close: (d) => {
30
+ d.open = false;
31
+ d.activeId = void 0;
32
+ },
33
+ select: (d, id) => {
34
+ d.activeId = id;
35
+ },
36
+ openSection: (d, id) => {
37
+ d.activeId = id;
38
+ d.open = true;
39
+ }
40
+ }
41
+ });
42
+ }
43
+ //#endregion
12
44
  //#region ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
13
45
  function r(e) {
14
46
  var t, f, n = "";
@@ -25,13 +57,13 @@ window.__ModuleLoader__.load({
25
57
  }
26
58
  //#endregion
27
59
  //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/SettingsRoot.module.css.mjs
28
- const css$3 = ".VOzbGW_triggerRow{flex:none;align-items:center;gap:8px;width:calc(100% + 4px);margin:4px -2px;display:flex}.VOzbGW_triggerRow.VOzbGW_railRow{width:36px;margin:8px 0 10px}.VOzbGW_trigger{box-sizing:border-box;cursor:pointer;width:auto;min-width:0;height:42px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:12px;flex:1;align-items:center;gap:8px;margin:0;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.VOzbGW_trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}.VOzbGW_trigger.VOzbGW_rail{corner-shape:round;border-radius:50%;flex:none;justify-content:center;gap:0;width:36px;height:36px;margin:0;padding:0}.VOzbGW_triggerLabel{white-space:nowrap;overflow:hidden}.VOzbGW_overlay{z-index:1000;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.VOzbGW_mask{background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);position:absolute;inset:0}.VOzbGW_panel{z-index:1;background:var(--dsw-alias-bg-layer-2);width:800px;max-width:calc(100vw - 48px);height:min(800px,100vh - 48px);box-shadow:var(--dsw-elevation-prominent);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:32px;display:flex;position:relative;overflow:hidden}.VOzbGW_nav{box-sizing:border-box;flex-direction:column;flex:none;gap:18px;width:188px;padding:22px 12px 0;display:flex}.VOzbGW_navTitle{color:var(--dsw-alias-label-primary);padding:0 12px;font-size:16px;font-weight:500;line-height:24px}.VOzbGW_navList{flex-direction:column;gap:4px;display:flex}.VOzbGW_navCell{box-sizing:border-box;cursor:pointer;height:40px;color:var(--dsw-alias-label-primary);text-align:left;background:0 0;border:none;border-radius:12px;align-items:center;gap:8px;padding:9px 16px 9px 12px;font-family:inherit;font-size:14px;font-weight:400;line-height:22px;display:flex}.VOzbGW_navCell:hover{background:var(--dsw-specific-sidebar-nav-item-hover)}.VOzbGW_navCell.VOzbGW_active{background:var(--dsw-specific-sidebar-nav-item-active)}.VOzbGW_navIcon{flex:none}.VOzbGW_navLabel{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.VOzbGW_content{flex-direction:column;flex:1;min-width:0;display:flex}.VOzbGW_header{box-sizing:border-box;flex:none;justify-content:space-between;align-items:flex-start;gap:8px;height:54px;padding:20px 14px 8px 10px;display:flex}.VOzbGW_actions{justify-content:flex-end;align-items:center;gap:8px;min-width:0;margin-left:auto;display:flex}.VOzbGW_close{cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:0;display:inline-flex}.VOzbGW_close:hover{background:var(--dsw-alias-interactive-bg-hover)}.VOzbGW_options{flex:1;min-height:0;padding:0 24px 24px;overflow-y:auto}.VOzbGW_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}";
29
- const tagId$3 = "@deepseek-ai/dsh-client-ui-settings-general/SettingsRoot.module.css";
30
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
60
+ const css$6 = ".VOzbGW_triggerRow{flex:none;align-items:center;gap:8px;width:calc(100% + 4px);margin:4px -2px;display:flex;position:relative}.VOzbGW_triggerRow.VOzbGW_railRow{width:36px;margin:8px 0 10px}.VOzbGW_trigger{box-sizing:border-box;border-radius:var(--dsw-radius-md);cursor:pointer;width:auto;min-width:0;height:42px;color:var(--dsw-alias-label-primary);background:0 0;border:none;flex:1;align-items:center;gap:8px;margin:0;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.VOzbGW_trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}.VOzbGW_trigger.VOzbGW_rail{flex:none;justify-content:center;gap:0;width:36px;height:36px;margin:0;padding:0}.VOzbGW_triggerLabel{white-space:nowrap;overflow:hidden}.VOzbGW_overlay{z-index:1000;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.VOzbGW_mask{inset:var(--dsh-frame-chrome-top,0px) 0 0;background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);position:absolute}.VOzbGW_panel{z-index:1;width:800px;height:min(800px, calc(100vh - 2 * max(24px, var(--dsh-frame-overlay-top,24px))));border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-2);max-width:calc(100vw - 48px);box-shadow:var(--dsw-elevation-prominent);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);display:flex;position:relative;overflow:hidden}.VOzbGW_panel:focus{outline:none}.VOzbGW_nav{box-sizing:border-box;flex-direction:column;flex:none;gap:18px;width:188px;padding:22px 12px 0;display:flex}.VOzbGW_navTitle{color:var(--dsw-alias-label-primary);padding:0 12px;font-size:16px;font-weight:500;line-height:24px}.VOzbGW_navList{flex-direction:column;gap:4px;display:flex;overflow-y:auto}.VOzbGW_navCell{box-sizing:border-box;border-radius:var(--dsw-radius-md);cursor:pointer;height:40px;color:var(--dsw-alias-label-primary);text-align:left;background:0 0;border:none;align-items:center;gap:8px;padding:9px 16px 9px 12px;font-family:inherit;font-size:14px;font-weight:400;line-height:22px;display:flex}.VOzbGW_navCell:hover{background:var(--dsw-specific-sidebar-nav-item-hover)}.VOzbGW_navCell.VOzbGW_active{background:var(--dsw-specific-sidebar-nav-item-active)}.VOzbGW_navIcon{flex:none}.VOzbGW_navLabel{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.VOzbGW_content{flex-direction:column;flex:1;min-width:0;display:flex}.VOzbGW_header{box-sizing:border-box;flex:none;justify-content:space-between;align-items:flex-start;gap:8px;height:54px;padding:20px 14px 8px 10px;display:flex}.VOzbGW_actions{justify-content:flex-end;align-items:center;gap:8px;min-width:0;margin-left:auto;display:flex}.VOzbGW_close{border-radius:var(--dsw-radius-sm);cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-primary);background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.VOzbGW_close:hover{background:var(--dsw-alias-interactive-bg-hover)}.VOzbGW_options{flex:1;min-height:0;padding:0 24px 24px;overflow-y:auto}.VOzbGW_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}";
61
+ const tagId$6 = "@deepseek-ai/dsh-client-ui-settings-general/SettingsRoot.module.css";
62
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) {
31
63
  const tag = document.createElement("style");
32
64
  tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
33
- tag.dataset.pluginCss = tagId$3;
34
- tag.textContent = css$3;
65
+ tag.dataset.pluginCss = tagId$6;
66
+ tag.textContent = css$6;
35
67
  document.head.appendChild(tag);
36
68
  }
37
69
  var SettingsRoot_module_css_default = {
@@ -58,61 +90,194 @@ window.__ModuleLoader__.load({
58
90
  "triggerRow": "VOzbGW_triggerRow"
59
91
  };
60
92
  //#endregion
93
+ //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/DesktopUpdateIndicator.module.css.mjs
94
+ const css$5 = ".DOUpOa_indicator{box-sizing:border-box;border:1px solid color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 20%, transparent);border-radius:var(--dsw-radius-sm);height:28px;color:var(--dsw-alias-brand-primary-new-colorprimary-new-color);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 8%, transparent);text-align:left;white-space:nowrap;cursor:pointer;flex:none;grid-template-columns:14px max-content;align-items:center;column-gap:4px;padding:0 8px;font-family:inherit;font-size:12px;font-weight:500;line-height:18px;display:inline-grid}.DOUpOa_icon{place-items:center;width:14px;height:14px;display:grid}.DOUpOa_badge{inset-inline-end:2px;corner-shape:round;background:var(--dsw-alias-brand-primary-new-colorprimary-new-color);border-radius:50%;width:6px;height:6px;position:absolute;top:2px}.DOUpOa_errorDot{corner-shape:round;background:currentColor;border-radius:50%;width:6px;height:6px}.DOUpOa_spinner{animation:1s linear infinite DOUpOa_spin}@keyframes DOUpOa_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.DOUpOa_spinner{animation:none}}.DOUpOa_indicator[aria-disabled=true]{cursor:default}";
95
+ const tagId$5 = "@deepseek-ai/dsh-client-ui-settings-general/DesktopUpdateIndicator.module.css";
96
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
97
+ const tag = document.createElement("style");
98
+ tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
99
+ tag.dataset.pluginCss = tagId$5;
100
+ tag.textContent = css$5;
101
+ document.head.appendChild(tag);
102
+ }
103
+ var DesktopUpdateIndicator_module_css_default = {
104
+ "badge": "DOUpOa_badge",
105
+ "errorDot": "DOUpOa_errorDot",
106
+ "icon": "DOUpOa_icon",
107
+ "indicator": "DOUpOa_indicator",
108
+ "spin": "DOUpOa_spin",
109
+ "spinner": "DOUpOa_spinner"
110
+ };
111
+ //#endregion
112
+ //#region lib/types/client/DesktopUpdateIndicator.js
113
+ /** Optional Electron status presentation; the native shell owns actions and Web owns visible copy. */
114
+ const BUSY_PHASES = new Set([
115
+ "checking",
116
+ "downloading",
117
+ "verifying",
118
+ "installing"
119
+ ]);
120
+ function updateCopy(state, t) {
121
+ const label = {
122
+ idle: "",
123
+ checking: t("desktop.update.checking"),
124
+ available: t("desktop.update.available"),
125
+ downloading: t("desktop.update.progress", { percent: state.percent ?? 0 }),
126
+ verifying: t("desktop.update.verifying"),
127
+ installing: t("desktop.update.installing"),
128
+ ready: t("desktop.update.ready"),
129
+ error: t("desktop.update.retry")
130
+ }[state.phase];
131
+ if (state.phase === "checking" || state.phase === "verifying" || state.phase === "installing") return {
132
+ label,
133
+ detail: state.version ?? label
134
+ };
135
+ if (state.phase === "error") return {
136
+ label,
137
+ detail: {
138
+ check: t("desktop.update.checkFailed"),
139
+ "check-network": t("desktop.update.checkNetworkFailed"),
140
+ download: t("desktop.update.downloadFailed"),
141
+ "download-network": t("desktop.update.downloadNetworkFailed"),
142
+ install: t("desktop.update.installFailed"),
143
+ "install-network": t("desktop.update.installNetworkFailed"),
144
+ "stop-failed": t("desktop.update.stopFailed"),
145
+ "tasks-changed": t("desktop.update.tasksChanged"),
146
+ "tasks-unavailable": t("desktop.update.tasksUnavailable")
147
+ }[state.failure ?? "install"]
148
+ };
149
+ if (state.phase === "downloading" && state.version !== void 0) return {
150
+ label,
151
+ detail: t("desktop.update.downloadDetail", {
152
+ percent: state.percent ?? 0,
153
+ version: state.version
154
+ })
155
+ };
156
+ return {
157
+ label,
158
+ detail: state.version === void 0 ? label : t("desktop.update.versionDetail", {
159
+ label,
160
+ version: state.version
161
+ })
162
+ };
163
+ }
164
+ /**
165
+ * Render update status with connection-indicator geometry and brand-blue labels, including retries.
166
+ * @param props - Connection priority, sidebar width, and localized bridge-failure copy.
167
+ * @returns Desktop-only status beside the account button, or nothing in browsers.
168
+ */
169
+ function DesktopUpdateIndicator({ wide, hidden, t, view, onOpen }) {
170
+ const { presentation: state, failed, opening } = view;
171
+ if (!wide || hidden || !failed && (state === void 0 || state.phase === "idle")) return null;
172
+ const retryLabel = t("desktop.update.retry");
173
+ const copy = state === void 0 ? {
174
+ label: retryLabel,
175
+ detail: retryLabel
176
+ } : updateCopy(state, t);
177
+ const label = failed ? retryLabel : copy.label;
178
+ const error = failed || state?.phase === "error";
179
+ const busy = opening || state !== void 0 && BUSY_PHASES.has(state.phase);
180
+ return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
181
+ label: failed ? retryLabel : copy.detail,
182
+ side: "top",
183
+ children: (0, react_jsx_runtime.jsxs)("button", {
184
+ type: "button",
185
+ className: DesktopUpdateIndicator_module_css_default.indicator,
186
+ "aria-label": label,
187
+ "aria-disabled": busy,
188
+ onClick: () => {
189
+ if (!busy) onOpen();
190
+ },
191
+ children: [(0, react_jsx_runtime.jsx)("span", {
192
+ className: DesktopUpdateIndicator_module_css_default.icon,
193
+ "aria-hidden": "true",
194
+ children: error ? (0, react_jsx_runtime.jsx)("span", { className: DesktopUpdateIndicator_module_css_default.errorDot }) : busy ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconLoadingOutlineRegular, {
195
+ className: DesktopUpdateIndicator_module_css_default.spinner,
196
+ size: 14
197
+ }) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDownloadOutlineRegular, { size: 14 })
198
+ }), (0, react_jsx_runtime.jsx)("span", { children: label })]
199
+ })
200
+ });
201
+ }
202
+ /**
203
+ * @param props - Framework-bound carrier and connection state.
204
+ * @returns A non-interactive brand-blue notification on the sidebar expand button.
205
+ */
206
+ function DesktopUpdateBadge({ useDesktopUpdate, useConnectionState, t }) {
207
+ const { presentation: state, failed } = useDesktopUpdate((value) => value);
208
+ const connection = useConnectionState((value) => value);
209
+ if ((connection === "disconnected" || connection === "connecting") && state?.phase !== "installing" || !failed && (state === void 0 || state.phase === "idle")) return null;
210
+ const retryLabel = t("desktop.update.retry");
211
+ const copy = state === void 0 ? {
212
+ label: retryLabel,
213
+ detail: retryLabel
214
+ } : updateCopy(state, t);
215
+ const label = failed ? retryLabel : copy.label;
216
+ return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
217
+ label: failed ? label : copy.detail,
218
+ side: "right",
219
+ children: (0, react_jsx_runtime.jsx)("span", {
220
+ role: "img",
221
+ "aria-label": label,
222
+ className: DesktopUpdateIndicator_module_css_default.badge
223
+ })
224
+ });
225
+ }
226
+ //#endregion
61
227
  //#region lib/types/client/SettingsRoot.js
62
228
  /**
63
229
  * Settings shell root: the sidebar-foot trigger row plus the centered modal
64
- * panel (figma 501:29947, 1080x700) with the section nav rail. The shell is
230
+ * panel (figma 2552:26025, 760x500) with the section nav rail. The shell is
65
231
  * a pure composition face — slot-owned text (trigger label, panel title,
66
232
  * close label, sections) arrives from registrants through slots; accessible
67
233
  * names resolve from localized content (trigger: shell locale; dialog:
68
234
  * aria-labelledby the title node; close: visually-hidden slot text). Modal
69
- * open state and the active section id are component-local viewing state;
235
+ * open state and the active section id belong to the declared owner store;
70
236
  * the onboarding coordinator mounts exactly one ordered registrant while the
71
237
  * sessions-derived empty-Hero fact is active. Visible dialog chrome belongs
72
238
  * to the step, so a mounted-but-deciding step paints nothing here.
73
239
  */
74
240
  const RECOVERY_CONFIRMATION_MS = 2e3;
241
+ /** Minimum visible time for the connecting pill; shorter attempts read as flicker. */
242
+ const CONNECTING_MIN_VISIBLE_MS = 800;
75
243
  /** Nav glyph by section id; unknown ids fall back to the settings gear. */
76
244
  function navIcon(id) {
77
- if (id === "models") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDataOutline16, {
245
+ if (id === "account") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconUserOutlineMedium, {
78
246
  className: SettingsRoot_module_css_default.navIcon,
79
247
  size: 16
80
248
  });
81
- if (id === "agent-presets") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutline16, {
249
+ if (id === "models") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDataOutlineMedium, {
82
250
  className: SettingsRoot_module_css_default.navIcon,
83
251
  size: 16
84
252
  });
85
- if (id === "plugins") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPersonalizationOutline16, {
253
+ if (id === "agent-presets") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutlineMedium, {
86
254
  className: SettingsRoot_module_css_default.navIcon,
87
255
  size: 16
88
256
  });
89
- return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutline16, {
257
+ if (id === "plugins") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPersonalizationOutlineMedium, {
258
+ className: SettingsRoot_module_css_default.navIcon,
259
+ size: 16
260
+ });
261
+ if (id === "archived-sessions") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconArchiveOutlineMedium, {
262
+ className: SettingsRoot_module_css_default.navIcon,
263
+ size: 16
264
+ });
265
+ return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutlineMedium, {
90
266
  className: SettingsRoot_module_css_default.navIcon,
91
267
  size: 16
92
268
  });
93
269
  }
94
270
  /**
95
- * The modal layer: full-viewport mask + centered panel. Close paths: the
271
+ * Body-portaled modal layer: full-viewport mask + centered panel. Close paths: the
96
272
  * header button, a mask click, and document-level Escape (mounted only while
97
273
  * open, so the listener lifetime is the panel's).
98
274
  */
99
275
  function SettingsPanel({ rows, renderSlot, activeId, onSelect, onClose }) {
100
276
  const active = rows.find((r) => r.id === activeId)?.id ?? rows[0]?.id;
101
277
  const titleId = (0, react.useId)();
102
- (0, react.useEffect)(() => {
103
- const onKeyDown = (e) => {
104
- if (e.key === "Escape") onClose();
105
- };
106
- document.addEventListener("keydown", onKeyDown);
107
- return () => {
108
- document.removeEventListener("keydown", onKeyDown);
109
- };
110
- }, [onClose]);
111
- const closeButton = (0, react.useRef)(null);
112
- (0, react.useEffect)(() => {
113
- closeButton.current?.focus();
114
- }, []);
115
- return (0, react_jsx_runtime.jsxs)("div", {
278
+ const panel = (0, react.useRef)(null);
279
+ (0, _deepseek_ai_dsh_client_ui_primitives.useModalLayer)(panel, true, onClose);
280
+ return (0, react_dom.createPortal)((0, react_jsx_runtime.jsxs)("div", {
116
281
  className: SettingsRoot_module_css_default.overlay,
117
282
  role: "presentation",
118
283
  children: [(0, react_jsx_runtime.jsx)("div", {
@@ -120,6 +285,9 @@ window.__ModuleLoader__.load({
120
285
  "aria-hidden": "true",
121
286
  onClick: onClose
122
287
  }), (0, react_jsx_runtime.jsxs)("div", {
288
+ ref: panel,
289
+ tabIndex: -1,
290
+ "data-shortcut-modal": "settings",
123
291
  className: SettingsRoot_module_css_default.panel,
124
292
  role: "dialog",
125
293
  "aria-modal": "true",
@@ -129,6 +297,8 @@ window.__ModuleLoader__.load({
129
297
  children: [(0, react_jsx_runtime.jsx)("div", {
130
298
  className: SettingsRoot_module_css_default.navTitle,
131
299
  id: titleId,
300
+ tabIndex: -1,
301
+ "data-modal-autofocus": active === void 0 ? "" : void 0,
132
302
  children: renderSlot("settings.header", {})
133
303
  }), (0, react_jsx_runtime.jsx)("div", {
134
304
  className: SettingsRoot_module_css_default.navList,
@@ -136,6 +306,7 @@ window.__ModuleLoader__.load({
136
306
  type: "button",
137
307
  className: clsx(SettingsRoot_module_css_default.navCell, row.id === active && SettingsRoot_module_css_default.active),
138
308
  "aria-current": row.id === active ? "true" : void 0,
309
+ "data-modal-autofocus": row.id === active ? "" : void 0,
139
310
  onClick: () => {
140
311
  onSelect(row.id);
141
312
  },
@@ -153,11 +324,10 @@ window.__ModuleLoader__.load({
153
324
  className: SettingsRoot_module_css_default.actions,
154
325
  children: renderSlot("settings.action", {})
155
326
  }), (0, react_jsx_runtime.jsxs)("button", {
156
- ref: closeButton,
157
327
  type: "button",
158
328
  className: SettingsRoot_module_css_default.close,
159
329
  onClick: onClose,
160
- children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, { size: 14 }), (0, react_jsx_runtime.jsx)("span", {
330
+ children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, { size: 14 }), (0, react_jsx_runtime.jsx)("span", {
161
331
  className: SettingsRoot_module_css_default.hiddenLabel,
162
332
  children: renderSlot("settings.close", {})
163
333
  })]
@@ -168,7 +338,7 @@ window.__ModuleLoader__.load({
168
338
  })]
169
339
  })]
170
340
  })]
171
- });
341
+ }), document.body);
172
342
  }
173
343
  /**
174
344
  * Render the settings trigger and panel.
@@ -176,35 +346,39 @@ window.__ModuleLoader__.load({
176
346
  * @returns the settings shell element tree.
177
347
  */
178
348
  function SettingsRoot(props) {
179
- const { wide, reconnect, useConnectionState, useSections, useOnboardingSteps, useSessions, renderSlot, t } = props;
180
- const [open, setOpen] = (0, react.useState)(false);
181
- const [activeId, setActiveId] = (0, react.useState)(void 0);
349
+ const { wide, reconnect, useConnectionState, useSections, useOnboardingSteps, useSessions, renderSlot, t, useDesktopUpdate, openDesktopUpdate, useStore, actions, useShortcuts } = props;
350
+ const { open, activeId } = useStore((state) => state);
351
+ const shortcut = useShortcuts((rows) => rows.find((row) => row.id === "settings.open"));
352
+ const { close, openSection } = actions;
353
+ const [requestedOnboarding, setRequestedOnboarding] = (0, react.useState)();
182
354
  const [completedOnboarding, setCompletedOnboarding] = (0, react.useState)(() => /* @__PURE__ */ new Set());
183
355
  const [showRecovery, setShowRecovery] = (0, react.useState)(false);
184
- const triggerButton = (0, react.useRef)(null);
185
- const wasOpen = (0, react.useRef)(open);
186
- const close = (0, react.useCallback)(() => {
187
- setOpen(false);
188
- setActiveId(void 0);
189
- }, []);
190
- (0, react.useEffect)(() => {
191
- if (wasOpen.current && !open) triggerButton.current?.focus();
192
- wasOpen.current = open;
193
- }, [open]);
194
- const openSection = (0, react.useCallback)((id) => {
195
- setActiveId(id);
196
- setOpen(true);
197
- }, []);
356
+ const [holdConnecting, setHoldConnecting] = (0, react.useState)(false);
357
+ const connectingShownAt = (0, react.useRef)(void 0);
198
358
  const rows = useSections((s) => s);
359
+ const desktopUpdate = useDesktopUpdate((state) => state);
199
360
  const connectionState = useConnectionState((state) => state);
200
361
  const previousConnectionState = (0, react.useRef)(connectionState);
201
362
  const onboardingSteps = useOnboardingSteps((s) => s);
202
- const onboardingActive = useSessions((state) => state.phase === "ready" && (state.current === void 0 || state.byId[state.current]?.blank === true));
203
- const onboardingStep = onboardingActive ? onboardingSteps.find((step) => !completedOnboarding.has(step.id)) : void 0;
363
+ const onboardingActive = useSessions((state) => {
364
+ const main = Object.values(state.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0);
365
+ return state.phase === "ready" && (main === void 0 || main.blank);
366
+ });
367
+ const onboardingStep = requestedOnboarding !== void 0 ? onboardingSteps.find((step) => step.id === requestedOnboarding) : onboardingActive ? onboardingSteps.find((step) => !completedOnboarding.has(step.id)) : void 0;
204
368
  (0, react.useEffect)(() => {
205
369
  if (onboardingActive) return;
206
370
  setCompletedOnboarding(/* @__PURE__ */ new Set());
207
371
  }, [onboardingActive]);
372
+ const onboardingStepSeen = (0, react.useRef)(onboardingStep);
373
+ (0, react.useEffect)(() => {
374
+ const appeared = onboardingStepSeen.current === void 0 && onboardingStep !== void 0;
375
+ onboardingStepSeen.current = onboardingStep;
376
+ if (appeared && open) close();
377
+ }, [
378
+ onboardingStep,
379
+ open,
380
+ close
381
+ ]);
208
382
  (0, react.useLayoutEffect)(() => {
209
383
  const previous = previousConnectionState.current;
210
384
  previousConnectionState.current = connectionState;
@@ -214,57 +388,107 @@ window.__ModuleLoader__.load({
214
388
  }
215
389
  if (previous !== "disconnected" && previous !== "connecting") return;
216
390
  setShowRecovery(true);
391
+ }, [connectionState]);
392
+ (0, react.useLayoutEffect)(() => {
393
+ if (!showRecovery || holdConnecting) return;
217
394
  const timeout = window.setTimeout(() => {
218
395
  setShowRecovery(false);
219
396
  }, RECOVERY_CONFIRMATION_MS);
220
397
  return () => {
221
398
  window.clearTimeout(timeout);
222
399
  };
400
+ }, [showRecovery, holdConnecting]);
401
+ (0, react.useLayoutEffect)(() => {
402
+ if (connectionState === "connecting") {
403
+ connectingShownAt.current = Date.now();
404
+ return;
405
+ }
406
+ const shownAt = connectingShownAt.current;
407
+ if (shownAt === void 0) return;
408
+ connectingShownAt.current = void 0;
409
+ const remaining = CONNECTING_MIN_VISIBLE_MS - (Date.now() - shownAt);
410
+ if (remaining <= 0) return;
411
+ setHoldConnecting(true);
412
+ const timeout = window.setTimeout(() => {
413
+ setHoldConnecting(false);
414
+ }, remaining);
415
+ return () => {
416
+ window.clearTimeout(timeout);
417
+ setHoldConnecting(false);
418
+ };
223
419
  }, [connectionState]);
224
420
  const completeOnboardingStep = (0, react.useCallback)((id) => {
421
+ setRequestedOnboarding(void 0);
225
422
  setCompletedOnboarding((previous) => {
226
423
  if (previous.has(id)) return previous;
227
424
  return new Set([...previous, id]);
228
425
  });
229
426
  }, []);
230
427
  let connectionIndicator;
231
- if (connectionState === "disconnected") connectionIndicator = "disconnected";
232
- else if (connectionState === "connecting") connectionIndicator = "connecting";
428
+ if (connectionState === "connecting" || holdConnecting) connectionIndicator = "connecting";
429
+ else if (connectionState === "disconnected") connectionIndicator = "disconnected";
233
430
  else if (showRecovery) connectionIndicator = "recovered";
234
431
  return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
235
432
  (0, react_jsx_runtime.jsxs)("div", {
236
433
  className: clsx(SettingsRoot_module_css_default.triggerRow, !wide && SettingsRoot_module_css_default.railRow),
237
- children: [(0, react_jsx_runtime.jsx)("button", {
238
- ref: triggerButton,
239
- type: "button",
240
- className: clsx(SettingsRoot_module_css_default.trigger, !wide && SettingsRoot_module_css_default.rail),
241
- "aria-label": t("trigger"),
242
- "aria-haspopup": "dialog",
243
- "aria-expanded": open,
244
- onClick: () => {
245
- setOpen(true);
246
- },
247
- children: renderSlot("settings.trigger", { wide })
248
- }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.ConnectionIndicator, {
249
- state: wide ? connectionIndicator : void 0,
250
- disconnectedLabel: t("connection.error"),
251
- reconnectLabel: t("connection.retry"),
252
- connectingLabel: t("connection.connecting"),
253
- recoveredLabel: t("connection.connected"),
254
- reconnectActionLabel: t("connection.reconnect"),
255
- restartActionLabel: t("connection.restart"),
256
- onReconnect: reconnect
257
- })]
434
+ children: [
435
+ renderSlot("settings.launcher", {
436
+ wide,
437
+ settingsOpen: open,
438
+ openSettings: actions.open,
439
+ ...shortcut?.keys.length ? { settingsShortcut: {
440
+ keys: shortcut.keys,
441
+ aria: shortcut.aria
442
+ } } : {},
443
+ openOnboarding: (id) => {
444
+ close();
445
+ setRequestedOnboarding(id);
446
+ }
447
+ }, { fallback: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
448
+ disabled: open,
449
+ label: t("trigger"),
450
+ shortcutKeys: shortcut?.keys,
451
+ children: (0, react_jsx_runtime.jsx)("button", {
452
+ type: "button",
453
+ className: clsx(SettingsRoot_module_css_default.trigger, !wide && SettingsRoot_module_css_default.rail),
454
+ "aria-label": t("trigger"),
455
+ "aria-keyshortcuts": shortcut?.aria,
456
+ "aria-haspopup": "dialog",
457
+ "aria-expanded": open,
458
+ onClick: () => {
459
+ actions.open();
460
+ },
461
+ children: renderSlot("settings.trigger", { wide })
462
+ })
463
+ }) }),
464
+ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.ConnectionIndicator, {
465
+ state: wide && desktopUpdate.presentation?.phase !== "installing" ? connectionIndicator : void 0,
466
+ disconnectedLabel: t("connection.error"),
467
+ connectingLabel: t("connection.connecting"),
468
+ recoveredLabel: t("connection.connected"),
469
+ reconnectActionLabel: t("connection.reconnect"),
470
+ restartActionLabel: t("connection.restart"),
471
+ onReconnect: reconnect
472
+ }),
473
+ (0, react_jsx_runtime.jsx)(DesktopUpdateIndicator, {
474
+ wide,
475
+ hidden: connectionIndicator !== void 0 && desktopUpdate.presentation?.phase !== "installing",
476
+ t,
477
+ view: desktopUpdate,
478
+ onOpen: openDesktopUpdate
479
+ })
480
+ ]
258
481
  }),
259
482
  open && (0, react_jsx_runtime.jsx)(SettingsPanel, {
260
483
  rows,
261
484
  renderSlot,
262
485
  activeId,
263
- onSelect: setActiveId,
486
+ onSelect: actions.select,
264
487
  onClose: close
265
488
  }),
266
489
  onboardingStep !== void 0 && renderSlot("settings.onboarding", {
267
490
  stepId: onboardingStep.id,
491
+ explicit: requestedOnboarding !== void 0,
268
492
  complete: () => {
269
493
  completeOnboardingStep(onboardingStep.id);
270
494
  },
@@ -273,14 +497,84 @@ window.__ModuleLoader__.load({
273
497
  ] });
274
498
  }
275
499
  //#endregion
500
+ //#region lib/types/client/desktop-update-source.js
501
+ /** Client-owned observation of the optional Desktop preload. */
502
+ /** Owns one preload subscription across both sidebar locations. */
503
+ var DesktopUpdateSource = class {
504
+ bridge;
505
+ /** Framework-observed carrier status shared by both sidebar controls. */
506
+ store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
507
+ failed: false,
508
+ opening: false
509
+ });
510
+ live = true;
511
+ received = false;
512
+ unsubscribe;
513
+ /** @param bridge - Optional isolated Electron API, absent in ordinary browsers. */
514
+ constructor(bridge) {
515
+ this.bridge = bridge;
516
+ this.unsubscribe = bridge?.subscribe((presentation) => {
517
+ if (!this.live) return;
518
+ this.received = true;
519
+ this.store.set({
520
+ ...this.store.getSnapshot(),
521
+ presentation,
522
+ failed: false
523
+ });
524
+ });
525
+ bridge?.status().then((presentation) => {
526
+ if (this.live && !this.received) this.store.set({
527
+ ...this.store.getSnapshot(),
528
+ presentation
529
+ });
530
+ }, () => {
531
+ if (this.live && !this.received) this.store.set({
532
+ ...this.store.getSnapshot(),
533
+ failed: true
534
+ });
535
+ });
536
+ }
537
+ /** Invoke one user action; subsequent clicks join the shell-owned operation. */
538
+ open() {
539
+ if (!this.live || this.bridge === void 0) return;
540
+ const state = this.store.getSnapshot();
541
+ if (state.opening || state.presentation !== void 0 && [
542
+ "checking",
543
+ "downloading",
544
+ "verifying",
545
+ "installing"
546
+ ].includes(state.presentation.phase)) return;
547
+ this.store.set({
548
+ ...state,
549
+ opening: true
550
+ });
551
+ this.bridge.open().catch(() => {
552
+ if (this.live) this.store.set({
553
+ ...this.store.getSnapshot(),
554
+ failed: true
555
+ });
556
+ }).finally(() => {
557
+ if (this.live) this.store.set({
558
+ ...this.store.getSnapshot(),
559
+ opening: false
560
+ });
561
+ });
562
+ }
563
+ /** Detach the carrier and ignore any pending status or action completion. */
564
+ dispose() {
565
+ this.live = false;
566
+ this.unsubscribe?.();
567
+ }
568
+ };
569
+ //#endregion
276
570
  //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/chrome.module.css.mjs
277
- const css$2 = ".UQsH_q_triggerLabel{white-space:nowrap;overflow:hidden}";
278
- const tagId$2 = "@deepseek-ai/dsh-client-ui-settings-general/chrome.module.css";
279
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
571
+ const css$4 = ".UQsH_q_triggerLabel{white-space:nowrap;overflow:hidden}";
572
+ const tagId$4 = "@deepseek-ai/dsh-client-ui-settings-general/chrome.module.css";
573
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
280
574
  const tag = document.createElement("style");
281
575
  tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
282
- tag.dataset.pluginCss = tagId$2;
283
- tag.textContent = css$2;
576
+ tag.dataset.pluginCss = tagId$4;
577
+ tag.textContent = css$4;
284
578
  document.head.appendChild(tag);
285
579
  }
286
580
  var chrome_module_css_default = { "triggerLabel": "UQsH_q_triggerLabel" };
@@ -298,7 +592,7 @@ window.__ModuleLoader__.load({
298
592
  * @returns the trigger content fragment.
299
593
  */
300
594
  function TriggerContent({ wide, t }) {
301
- return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [wide ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutline16, { size: 16 }) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutline14, { size: 18 }), wide && (0, react_jsx_runtime.jsx)("span", {
595
+ return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutlineMedium, { size: wide ? 16 : 18 }), wide && (0, react_jsx_runtime.jsx)("span", {
302
596
  className: chrome_module_css_default.triggerLabel,
303
597
  children: t("trigger")
304
598
  })] });
@@ -321,13 +615,13 @@ window.__ModuleLoader__.load({
321
615
  }
322
616
  //#endregion
323
617
  //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/GeneralSection.module.css.mjs
324
- const css$1 = "._WvWnq_section{flex-direction:column;width:100%;display:flex}._WvWnq_section>[data-slot=\"settings.general.item\"]>:last-child{border-bottom:none}";
325
- const tagId$1 = "@deepseek-ai/dsh-client-ui-settings-general/GeneralSection.module.css";
326
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
618
+ const css$3 = "._WvWnq_section{flex-direction:column;width:100%;display:flex}._WvWnq_section>[data-slot=\"settings.general.item\"]>:last-child{border-bottom:none}";
619
+ const tagId$3 = "@deepseek-ai/dsh-client-ui-settings-general/GeneralSection.module.css";
620
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
327
621
  const tag = document.createElement("style");
328
622
  tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
329
- tag.dataset.pluginCss = tagId$1;
330
- tag.textContent = css$1;
623
+ tag.dataset.pluginCss = tagId$3;
624
+ tag.textContent = css$3;
331
625
  document.head.appendChild(tag);
332
626
  }
333
627
  var GeneralSection_module_css_default = { "section": "_WvWnq_section" };
@@ -345,6 +639,90 @@ window.__ModuleLoader__.load({
345
639
  });
346
640
  }
347
641
  //#endregion
642
+ //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/CurrentVersionRow.module.css.mjs
643
+ const css$2 = ".yIbyla_row{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;padding:16px 0;font-size:14px;line-height:22px}";
644
+ const tagId$2 = "@deepseek-ai/dsh-client-ui-settings-general/CurrentVersionRow.module.css";
645
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
646
+ const tag = document.createElement("style");
647
+ tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
648
+ tag.dataset.pluginCss = tagId$2;
649
+ tag.textContent = css$2;
650
+ document.head.appendChild(tag);
651
+ }
652
+ var CurrentVersionRow_module_css_default = { "row": "yIbyla_row" };
653
+ //#endregion
654
+ //#region lib/types/client/CurrentVersionRow.js
655
+ /**
656
+ * Render the version embedded by the client build; partial builds without metadata omit the row.
657
+ * @param props - runtime share and localized copy.
658
+ * @returns the current release label, or nothing when build metadata is absent.
659
+ */
660
+ function CurrentVersionRow({ t }) {
661
+ return (0, react_jsx_runtime.jsx)("div", {
662
+ className: CurrentVersionRow_module_css_default.row,
663
+ children: t("general.currentVersion", { version: "0.2.0-rc.1" })
664
+ });
665
+ }
666
+ //#endregion
667
+ //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/DeveloperToolsRow.module.css.mjs
668
+ const css$1 = ".Pt1bsG_row{border-bottom:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:24px;padding:16px 0;display:flex}.Pt1bsG_title{font-size:14px;line-height:20px}.Pt1bsG_description{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:12px;line-height:18px}";
669
+ const tagId$1 = "@deepseek-ai/dsh-client-ui-settings-general/DeveloperToolsRow.module.css";
670
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
671
+ const tag = document.createElement("style");
672
+ tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
673
+ tag.dataset.pluginCss = tagId$1;
674
+ tag.textContent = css$1;
675
+ document.head.appendChild(tag);
676
+ }
677
+ var DeveloperToolsRow_module_css_default = {
678
+ "description": "Pt1bsG_description",
679
+ "row": "Pt1bsG_row",
680
+ "title": "Pt1bsG_title"
681
+ };
682
+ //#endregion
683
+ //#region lib/types/client/DeveloperToolsRow.js
684
+ /** General Settings control for shared developer-tool visibility and previews. */
685
+ /**
686
+ * Render the developer-tool toggle.
687
+ * @param props - accepted preference, writer and localized copy.
688
+ * @returns the General Settings row.
689
+ */
690
+ function DeveloperToolsRow({ useDeveloperTools, setEnabled, t }) {
691
+ const enabled = useDeveloperTools((value) => value);
692
+ const [busy, setBusy] = (0, react.useState)(false);
693
+ const [failed, setFailed] = (0, react.useState)(false);
694
+ return (0, react_jsx_runtime.jsxs)("div", {
695
+ className: DeveloperToolsRow_module_css_default.row,
696
+ children: [(0, react_jsx_runtime.jsxs)("div", { children: [
697
+ (0, react_jsx_runtime.jsx)("div", {
698
+ className: DeveloperToolsRow_module_css_default.title,
699
+ children: t("developerTools.title")
700
+ }),
701
+ (0, react_jsx_runtime.jsx)("div", {
702
+ className: DeveloperToolsRow_module_css_default.description,
703
+ children: t("developerTools.description")
704
+ }),
705
+ failed && (0, react_jsx_runtime.jsx)("div", {
706
+ role: "alert",
707
+ children: t("developerTools.error")
708
+ })
709
+ ] }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
710
+ checked: enabled,
711
+ disabled: busy,
712
+ label: t("developerTools.title"),
713
+ onChange: (next) => {
714
+ setFailed(false);
715
+ setBusy(true);
716
+ setEnabled(next).catch(() => {
717
+ setFailed(true);
718
+ }).finally(() => {
719
+ setBusy(false);
720
+ });
721
+ }
722
+ })]
723
+ });
724
+ }
725
+ //#endregion
348
726
  //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/SettingsDocumentAction.module.css.mjs
349
727
  const css = ".me01iq_action{align-items:center;gap:8px;min-width:0;display:flex}.me01iq_error{max-width:180px;color:var(--dsw-alias-state-error-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}";
350
728
  const tagId = "@deepseek-ai/dsh-client-ui-settings-general/SettingsDocumentAction.module.css";
@@ -481,32 +859,76 @@ window.__ModuleLoader__.load({
481
859
  /** Simplified Chinese dictionary (the key-set source of truth). */
482
860
  const zh = {
483
861
  "trigger": "设置",
862
+ "shortcut.open": "打开设置",
863
+ "desktop.update.available": "新版本",
864
+ "desktop.update.checking": "正在检查更新…",
865
+ "desktop.update.progress": "{percent}%",
866
+ "desktop.update.verifying": "正在校验更新文件…",
867
+ "desktop.update.installing": "正在准备重启…",
868
+ "desktop.update.ready": "安装并重启",
869
+ "desktop.update.retry": "重试更新",
870
+ "desktop.update.versionDetail": "{label}:{version}",
871
+ "desktop.update.downloadDetail": "正在下载更新:{percent}%\n目标版本:{version}",
872
+ "desktop.update.checkFailed": "检查更新失败,请稍后重试。",
873
+ "desktop.update.downloadFailed": "下载更新失败,请重试。",
874
+ "desktop.update.installFailed": "安装更新失败,请稍后重试。",
875
+ "desktop.update.checkNetworkFailed": "检查更新失败,请检查网络连接后重试。",
876
+ "desktop.update.downloadNetworkFailed": "下载更新失败,请检查网络连接后重试。",
877
+ "desktop.update.installNetworkFailed": "安装更新失败,请检查网络连接后重试。",
878
+ "desktop.update.stopFailed": "未能安全停止任务,更新尚未安装,请稍后重试。",
879
+ "desktop.update.tasksChanged": "有新任务开始运行,请重新确认是否停止任务并更新。",
880
+ "desktop.update.tasksUnavailable": "无法确认任务状态,请在工作区就绪后重试更新。",
484
881
  "title": "设置",
485
882
  "close": "关闭",
486
883
  "openDocument": "打开配置文件",
487
884
  "openDocument.error": "无法打开配置文件",
488
885
  "general.nav": "通用设置",
489
- "connection.error": "连接异常",
490
- "connection.retry": "立即重连",
491
- "connection.connecting": "自动重连中",
886
+ "general.currentVersion": "当前版本:{version}",
887
+ "developerTools.title": "代码工作工具",
888
+ "developerTools.error": "保存失败,请重试",
889
+ "developerTools.description": "开启后显示轨迹、本轮代码差异,新对话中的 Agent 预设切换",
890
+ "connection.error": "连接异常,刷新重试",
891
+ "connection.connecting": "重新连接中",
492
892
  "connection.connected": "连接成功",
493
893
  "connection.reconnect": "连接异常,点击立即重连",
494
- "connection.restart": "连接中断,正在自动重试,点击立即重连"
894
+ "connection.restart": "连接中断,正在重试,点击立即重连"
495
895
  };
496
896
  /** English dictionary, checked complete against the zh key set. */
497
897
  const en = {
498
898
  "trigger": "Settings",
899
+ "shortcut.open": "Open settings",
900
+ "desktop.update.available": "Update",
901
+ "desktop.update.checking": "Checking for updates…",
902
+ "desktop.update.progress": "{percent}%",
903
+ "desktop.update.verifying": "Verifying update files…",
904
+ "desktop.update.installing": "Preparing to restart…",
905
+ "desktop.update.ready": "Install and Restart",
906
+ "desktop.update.retry": "Retry update",
907
+ "desktop.update.versionDetail": "{label}: {version}",
908
+ "desktop.update.downloadDetail": "Downloading update: {percent}%\nTarget version: {version}",
909
+ "desktop.update.checkFailed": "Could not check for updates. Please try again later.",
910
+ "desktop.update.downloadFailed": "Could not download the update. Please try again.",
911
+ "desktop.update.installFailed": "Could not install the update. Please try again later.",
912
+ "desktop.update.checkNetworkFailed": "Could not check for updates. Check your connection and try again.",
913
+ "desktop.update.downloadNetworkFailed": "Could not download the update. Check your connection and try again.",
914
+ "desktop.update.installNetworkFailed": "Could not install the update. Check your connection and try again.",
915
+ "desktop.update.stopFailed": "Could not safely stop the tasks. The update has not been installed. Please try again later.",
916
+ "desktop.update.tasksChanged": "New tasks have started. Confirm again to stop the tasks and update.",
917
+ "desktop.update.tasksUnavailable": "Task status is unavailable. Try updating again when the workspace is ready.",
499
918
  "title": "Settings",
500
919
  "close": "Close",
501
920
  "openDocument": "Open configuration file",
502
921
  "openDocument.error": "Could not open configuration file",
503
922
  "general.nav": "General",
923
+ "general.currentVersion": "Current version: {version}",
924
+ "developerTools.title": "Coding Tools",
925
+ "developerTools.error": "Could not save. Please try again.",
926
+ "developerTools.description": "Shows trajectory, code diffs, and Agent preset switching in new chats",
504
927
  "connection.error": "Disconnected",
505
- "connection.retry": "Reconnect now",
506
928
  "connection.connecting": "Reconnecting",
507
929
  "connection.connected": "Connected",
508
930
  "connection.reconnect": "Disconnected, reconnect now",
509
- "connection.restart": "Reconnecting automatically, reconnect now"
931
+ "connection.restart": "Reconnecting, reconnect now"
510
932
  };
511
933
  //#endregion
512
934
  //#region lib/types/client/index.js
@@ -523,7 +945,8 @@ window.__ModuleLoader__.load({
523
945
  "connection",
524
946
  "remote",
525
947
  "remote.settings",
526
- "settingsScope"
948
+ "configForms",
949
+ "shortcuts"
527
950
  ];
528
951
  /**
529
952
  * Register the `settings` dictionaries, the chrome content, and the General
@@ -531,13 +954,42 @@ window.__ModuleLoader__.load({
531
954
  * @param ctx - client root context.
532
955
  */
533
956
  function apply(ctx) {
957
+ ctx.slots.inject("settings.general.item", () => ctx.slots.register({
958
+ name: "settings.general.item",
959
+ id: "developer-tools",
960
+ order: 15,
961
+ locale: NS,
962
+ inject: () => ({
963
+ hooks: { developerTools: ctx.configForms.developerTools.enabled },
964
+ setEnabled: (enabled) => ctx.configForms.developerTools.setEnabled(enabled)
965
+ })
966
+ }, DeveloperToolsRow));
967
+ ctx.slots.inject("settings.general.item", () => ctx.slots.register({
968
+ name: "settings.general.item",
969
+ id: "current-version",
970
+ order: 100,
971
+ locale: NS
972
+ }, CurrentVersionRow));
534
973
  ctx.effect(() => ctx.locale.register(NS, {
535
974
  zh,
536
975
  en
537
976
  }), "ui-settings-general: dictionaries");
538
977
  const connection = ctx.get("connection");
978
+ const carrier = globalThis.dshDesktop;
979
+ const desktopUpdate = new DesktopUpdateSource(carrier?.protocolVersion === 1 ? carrier.updates : void 0);
980
+ ctx.effect(() => () => {
981
+ desktopUpdate.dispose();
982
+ }, "ui-settings-general: desktop update carrier");
983
+ ctx.slots.inject("sidebar.toggle.badge", () => ctx.slots.register({
984
+ name: "sidebar.toggle.badge",
985
+ locale: NS,
986
+ inject: () => ({ hooks: {
987
+ desktopUpdate: desktopUpdate.store,
988
+ connectionState: connection.state
989
+ } })
990
+ }, DesktopUpdateBadge));
539
991
  const t = ctx.locale.bind(NS);
540
- const documentController = ctx.remote.$host.isLoopback ? new SettingsDocumentStore(ctx, ctx.settingsScope.describe()) : void 0;
992
+ const documentController = ctx.remote.$host.isLoopback ? new SettingsDocumentStore(ctx, ctx.configForms.describe()) : void 0;
541
993
  const documentInjected = documentController === void 0 ? void 0 : () => ({
542
994
  controller: documentController,
543
995
  hooks: { snapshot: documentController.store }
@@ -551,10 +1003,15 @@ window.__ModuleLoader__.load({
551
1003
  let onboardingVersion = -1;
552
1004
  let onboardingSteps = [];
553
1005
  const shellInjected = () => ({
1006
+ openDesktopUpdate: () => {
1007
+ desktopUpdate.open();
1008
+ },
554
1009
  reconnect: () => {
555
1010
  connection.reconnect();
556
1011
  },
557
1012
  hooks: {
1013
+ shortcuts: ctx.shortcuts.catalog,
1014
+ desktopUpdate: desktopUpdate.store,
558
1015
  connectionState: connection.state,
559
1016
  sections: {
560
1017
  getSnapshot: () => {
@@ -598,37 +1055,100 @@ window.__ModuleLoader__.load({
598
1055
  }
599
1056
  }
600
1057
  });
601
- ctx.slots.inject("sidebar.settings", () => ctx.slots.register({
602
- name: "sidebar.settings",
603
- locale: NS,
604
- children: {
605
- "settings.trigger": {
606
- kind: "single",
607
- scope: "root"
608
- },
609
- "settings.header": {
610
- kind: "single",
611
- scope: "root"
612
- },
613
- "settings.action": {
614
- kind: "list",
615
- scope: "root"
616
- },
617
- "settings.close": {
618
- kind: "single",
619
- scope: "root"
620
- },
621
- "settings.section": {
622
- kind: "list",
623
- scope: "root"
1058
+ ctx.slots.inject("sidebar.settings", () => {
1059
+ const shellHandle = createSettingsShellStore();
1060
+ const shellInstance = shellHandle.create();
1061
+ const shellStore = {
1062
+ ...shellHandle,
1063
+ create: () => shellInstance
1064
+ };
1065
+ const disposeCommand = ctx.shortcuts.register({
1066
+ id: "settings.open",
1067
+ label: () => t("shortcut.open"),
1068
+ aliases: ["settings", "preferences"],
1069
+ defaults: {
1070
+ "desktop:macos": {
1071
+ code: "Comma",
1072
+ modifiers: ["primary"]
1073
+ },
1074
+ "desktop:windows": {
1075
+ code: "Comma",
1076
+ modifiers: ["primary"]
1077
+ },
1078
+ "desktop:linux": {
1079
+ code: "Comma",
1080
+ modifiers: ["primary"]
1081
+ },
1082
+ "web:macos": {
1083
+ code: "Comma",
1084
+ modifiers: ["primary"]
1085
+ },
1086
+ "web:windows": {
1087
+ code: "Comma",
1088
+ modifiers: ["primary"]
1089
+ }
624
1090
  },
625
- "settings.onboarding": {
626
- kind: "list",
627
- scope: "root"
1091
+ regions: [
1092
+ "page",
1093
+ "editable",
1094
+ "terminal"
1095
+ ],
1096
+ modals: ["settings"],
1097
+ resolve: ({ modal }) => {
1098
+ if (modal !== null && modal !== "settings") return {
1099
+ status: "blocked",
1100
+ reason: "modal"
1101
+ };
1102
+ return {
1103
+ status: "handled",
1104
+ run: () => {
1105
+ if (modal === "settings") (0, _deepseek_ai_dsh_client_ui_primitives.closeTopModal)(document);
1106
+ else shellInstance.actions.open();
1107
+ }
1108
+ };
628
1109
  }
629
- },
630
- inject: shellInjected
631
- }, SettingsRoot));
1110
+ });
1111
+ const disposeSlot = ctx.slots.register({
1112
+ name: "sidebar.settings",
1113
+ locale: NS,
1114
+ store: shellStore,
1115
+ children: {
1116
+ "settings.launcher": {
1117
+ kind: "single",
1118
+ scope: "root"
1119
+ },
1120
+ "settings.trigger": {
1121
+ kind: "single",
1122
+ scope: "root"
1123
+ },
1124
+ "settings.header": {
1125
+ kind: "single",
1126
+ scope: "root"
1127
+ },
1128
+ "settings.action": {
1129
+ kind: "list",
1130
+ scope: "root"
1131
+ },
1132
+ "settings.close": {
1133
+ kind: "single",
1134
+ scope: "root"
1135
+ },
1136
+ "settings.section": {
1137
+ kind: "list",
1138
+ scope: "root"
1139
+ },
1140
+ "settings.onboarding": {
1141
+ kind: "list",
1142
+ scope: "root"
1143
+ }
1144
+ },
1145
+ inject: shellInjected
1146
+ }, SettingsRoot);
1147
+ return () => {
1148
+ disposeCommand();
1149
+ disposeSlot();
1150
+ };
1151
+ });
632
1152
  ctx.slots.inject("settings.trigger", () => ctx.slots.register({
633
1153
  name: "settings.trigger",
634
1154
  locale: NS