dsh-more 0.1.1 → 0.1.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.md CHANGED
@@ -6,7 +6,7 @@ Practical, independently switchable patches for missing context and history cont
6
6
 
7
7
  `dsh-more` integrates with the existing DSH interface instead of adding a separate management dashboard. Its current patch set can edit a user message and restart from that point, remove one message while preserving the surrounding context, and permanently delete a session while leaving native archive behavior intact.
8
8
 
9
- > **Compatibility:** development dependencies target DeepSeek Harness `0.1.5-rc.2` and require Node.js `>= 24`. The current source has also been verified in a local linked installation of the official macOS desktop `0.1.7-rc.2`. DSH is still a release candidate, so upgrades may require adapter changes.
9
+ > **Compatibility:** the development/test baseline is DeepSeek Harness `0.2.1-rc.2`. All patches and existing peer ranges are preserved. Type, feature and isolated Host checks pass against the target RC; Windows path/build/script fixes are not a claim of Windows Desktop end-to-end verification. Node.js 24+ is recommended; the package engine also allows Node.js 22.19+.
10
10
 
11
11
  ## Features
12
12
 
@@ -16,6 +16,10 @@ Practical, independently switchable patches for missing context and history cont
16
16
  | Delete one message | User- and assistant-message action rows | Removes the selected model-surface node, expands only when tool call/result pairing requires it, rebuilds the surviving context, and opens a child session | On |
17
17
  | Permanently delete session | Separate item beside the native Archive action | Stops and unloads the target session, removes its exact JSONL persistence directory, detaches it from workspaces, and synchronizes the lists incrementally | On |
18
18
  | Model capabilities | Settings → Models → Model capabilities | Configure image support, selectable thinking types and parameter formats per model | On |
19
+ | Fast mode | Composer toolbar and `/fast` | Toggle faster model service for the current session (may consume quota faster) | On |
20
+ | Markdown export | Conversation toolbar / More menu | Export messages and tool results with Windows-safe download filenames | On |
21
+ | Automatic titles | After the first request | Generate a title using the current model, preserving manual names | On |
22
+ | Independent tasks and grouping | Workspace picker / session menu | Create an independent task with its draft intact; group sessions without changing their working directories | On |
19
23
 
20
24
  Patch switches live under **Settings → Plugins → Plugin configuration → DSH More** and take effect without rebuilding the plugin.
21
25
 
@@ -24,11 +28,24 @@ Patch switches live under **Settings → Plugins → Plugin configuration → DS
24
28
  ### Requirements
25
29
 
26
30
  - Node.js `>= 24`
27
- - A working `dsh` CLI and a Web profile compatible with DSH `0.1.5-rc.2`
31
+ - A working `dsh` CLI and a Web or Desktop profile on DeepSeek Harness `0.2.1-rc.2`
28
32
  - Access to the npm registry that publishes `dsh-more`
29
33
 
30
34
  pnpm is needed only when installing or developing from source. For a published release, use the DSH plugin command so the package is installed into the selected DSH profile; do not install it globally with `npm install -g`.
31
35
 
36
+ ### Windows: install this unreleased fix
37
+
38
+ The existing npm release is not this working-tree fix. Build a tarball with `pnpm install --frozen-lockfile`, `pnpm run check`, `pnpm run test:runtime`, then `npm pack`, or copy the resulting tarball from another machine.
39
+
40
+ For Desktop, initialize the app once, fully quit it, and use the **Desktop-supplied `dsh` command** (verify `Get-Command dsh` and `dsh --version`) to run:
41
+
42
+ ```powershell
43
+ dsh plugin --profile desktop add "C:\Downloads\dsh-more-0.1.1.tgz"
44
+ dsh plugin --profile desktop list dsh-more --depth 0
45
+ ```
46
+
47
+ The generic npm CLI rejects the reserved Desktop profile; use the installed Desktop carrier instead of replacing its profile. For a browser Web service, use `--profile web` and restart the original `dsh web`. Web and Desktop profiles are separate. Reopen Desktop / reload the browser and check all DSH More switches. Quote paths containing spaces or non-ASCII characters. Windows Desktop manual acceptance is still required; see the [compatibility record](./docs/desktop-compatibility.md).
48
+
32
49
  ### Install the latest release from npm
33
50
 
34
51
  ```sh
@@ -235,14 +252,14 @@ Generated source, `dist/`, and tarballs are not committed. `prepack` runs the co
235
252
 
236
253
  ### Dependency updates
237
254
 
238
- `package.json` uses compatible version ranges so installs and updates can resolve newer versions within those ranges. `pnpm-lock.yaml` preserves reproducible builds; a normal install keeps already locked versions. To refresh dependencies and validate them:
255
+ `package.json` declares compatible Host peer ranges, but pins the DSH development SDK to `0.2.1-rc.2` (with Cordis 4.0.5, Schemastery 3.18.5 and Zod 4.4.3). `pnpm-lock.yaml` preserves the verified graph. When changing the SDK baseline, update these pins together, reinstall, and validate:
239
256
 
240
257
  ```sh
241
258
  pnpm update
242
259
  pnpm run check
243
260
  ```
244
261
 
245
- The DSH range `^0.1.5-rc.2` accepts later stable `0.1.x` releases and newer `0.1.5` RCs. It does not cross into `0.2` or include alpha/RC releases with a different version tuple.
262
+ DSH Host peers use `^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5`. The `^0.2.1-alpha.5` range includes `0.2.1-rc.2` on the same version tuple, without bypassing compatibility checks. Prereleases on other version tuples still require verification.
246
263
 
247
264
  ### Verification scope
248
265
 
@@ -254,9 +271,9 @@ The repository does not currently contain a full browser end-to-end suite agains
254
271
 
255
272
  See the [desktop verification record](./docs/desktop-compatibility.md) for the actual macOS `0.1.7-rc.2` window checks. The desktop adapter navigates through `uiWorkspace.openSession()`, reads current selection from `retainedBy.mainView`, and temporarily retains newly created Sessions until their drafts can be transferred. Independent tasks, edit/delete handoffs, and current-session deletion share this adapter.
256
273
 
257
- Development and host dependency ranges use `^0.1.5-rc.2`; the lockfile records the versions currently verified. The adapters and tests cover the current session format, message provenance, `main.conversation` slot, and JSONL persistence snapshots and location capability. For an existing local linked install, rebuild, restart DSH, and reload the page to load both the new Host and Client.
274
+ Development uses the pinned `0.2.1-rc.2` SDK; Host peer ranges preserve existing RC/alpha compatibility. The removed `webRuntime` service is no longer required; requests use the authenticated Connection Fetch registry. Settings adapters support ConfigForms/SettingsForms and the previous APIs. The adapters and tests cover the current session format, message provenance, `main.conversation` slot, and JSONL persistence snapshots and location capability. For an existing local linked install, rebuild, restart DSH, and reload the page to load both the new Host and Client.
258
275
 
259
- - The current dependency set targets DSH `0.1.5-rc.2`; pre-release API or DOM changes can require adapter updates.
276
+ - The current test baseline is DSH `0.2.1-rc.2`; future pre-release API or DOM changes can require adapter updates. Run `pnpm run test:runtime` for isolated RC Host integration checks (temporary profile and fake model; no user history or credentials).
260
277
  - In-product DSH More copy is currently primarily Simplified Chinese, although native Copy/Archive selectors recognize both Chinese and English labels.
261
278
  - Message actions operate only on ordinary user messages and assistant messages still present in the current model surface; editing requires a completed owning turn.
262
279
  - Permanent deletion requires a `jsonl` backend with a valid location capability. Its current `locate` hook is internal; the adapter checks its presence and result. Tests cover plain and Zstandard-compressed session files.
package/README.zh-CN.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  `dsh-more` 不创建平行的“管理中心”,而是把能力直接嵌入 DSH 现有界面。当前补丁可以编辑用户消息并从该处重新开始、在保留前后上下文的前提下删除单条消息,以及在不改变原生归档语义的情况下永久删除会话。
8
8
 
9
- > **兼容性:** 开发依赖基线为 DeepSeek Harness `0.1.5-rc.2`,要求 Node.js `>= 24`。当前源码也已在官方 macOS 桌面端 `0.1.7-rc.2` 本地链接安装中验证。DSH 仍是 RC 版本,升级后可能需要调整集中适配层。
9
+ > **兼容性:** 开发与测试基线为 DeepSeek Harness `0.2.1-rc.2`。保留全部补丁及已有 peer 兼容范围,已通过目标 RC 的类型、功能和隔离 Host 验收;Windows 路径、构建与脚本兼容修复不等同于 Windows Desktop 实机逐项验收。推荐 Node.js 24+;包引擎也允许 Node.js 22.19+。
10
10
 
11
11
  ## 功能概览
12
12
 
@@ -17,6 +17,9 @@
17
17
  | 永久删除会话 | 原生“归档会话”旁的独立菜单项 | 停止并卸载目标会话,移除其精确 JSONL 持久化目录,从 Workspace 脱离并增量同步列表 | 开启 |
18
18
  | 模型能力配置 | 设置 → 模型 → 模型能力 | 按模型配置识图、可选思考类型及接口参数格式,不自动猜测能力 | 开启 |
19
19
  | 加速 | 输入框工具栏与 `/fast` 命令 | 开关当前会话的加速。响应更快,但会更快消耗额度 | 开启 |
20
+ | Markdown 导出 | 会话工具栏 / 更多操作 | 导出消息与工具结果,下载文件名兼容 Windows | 开启 |
21
+ | 自动标题 | 新会话首次需求后 | 用当前模型生成标题,保留手动命名 | 开启 |
22
+ | 独立任务与手动归组 | 工作区下拉框 / 会话菜单 | 保留草稿创建独立任务;归组不改变工作目录 | 开启 |
20
23
 
21
24
  补丁开关位于 **设置 → 插件 → 插件配置 → DSH More**,修改后实时生效,无需重新构建插件。
22
25
 
@@ -25,11 +28,38 @@
25
28
  ### 环境要求
26
29
 
27
30
  - Node.js `>= 24`
28
- - 可正常使用的 `dsh` CLI,以及与 DSH `0.1.5-rc.2` 兼容的 Web profile
31
+ - 可正常使用的 `dsh` CLI,以及 DeepSeek Harness `0.2.1-rc.2` 的 Web 或 Desktop profile
29
32
  - 能访问发布 `dsh-more` 的 npm registry
30
33
 
31
34
  只有从源码安装或参与开发时才需要 pnpm。安装已发布版本时,应通过 DSH 插件命令把包加入指定 profile;不要使用 `npm install -g` 全局安装。
32
35
 
36
+ ### Windows 安装本次修复(尚未发布到 npm)
37
+
38
+ 不要把 npm 上的旧包当成本次修复版。可将本仓库构建的 `dsh-more-0.1.1.tgz` 复制到 Windows 后安装;也可在 Windows 源码目录执行:
39
+
40
+ ```powershell
41
+ node --version
42
+ pnpm install --frozen-lockfile
43
+ pnpm run check
44
+ pnpm run test:runtime
45
+ npm pack
46
+ ```
47
+
48
+ - **桌面应用**:先启动 Desktop 一次完成初始化,再完整退出。使用 **Desktop 安装附带的 `dsh` 命令**,确认 `dsh --version` 为 `0.2.1-rc.2`,然后安装到 `desktop` profile:
49
+
50
+ ```powershell
51
+ Get-Command dsh | Select-Object Source
52
+ dsh --version
53
+ dsh plugin --profile desktop add "C:\Downloads\dsh-more-0.1.1.tgz"
54
+ dsh plugin --profile desktop list dsh-more --depth 0
55
+ ```
56
+
57
+ 若提示 desktop 由 Electron 专属管理,说明调用的是 npm 安装的通用 CLI,而非 Desktop 的配套命令;请切换命令来源,不要重建或覆盖 Desktop profile。
58
+
59
+ - **浏览器 Web 服务**:改用 `dsh plugin --profile web add "C:\Downloads\dsh-more-0.1.1.tgz"`,之后重启原来的 `dsh web`。
60
+
61
+ 安装后重新打开 Desktop / 刷新 Web 页面,在 **设置 → 插件 → 插件配置 → DSH More** 确认所有补丁开关。Web 与 Desktop 是不同 profile,安装到 web 不会自动影响桌面应用。路径含空格或中文时务必加引号。本次没有修改用户 DSH 安装或会话,也没有发布 npm;Windows 实机逐项验收仍需执行,见[兼容记录](./docs/desktop-compatibility.md)。
62
+
33
63
  ### 从 npm 安装最新版
34
64
 
35
65
  ```sh
@@ -236,14 +266,14 @@ pnpm run package # 构建并生成 npm tarball
236
266
 
237
267
  ### 依赖更新
238
268
 
239
- `package.json` 使用兼容版本范围,允许安装或更新时解析范围内的新版本;`pnpm-lock.yaml` 保留可复现的构建结果,普通安装不会自动改写已经锁定的版本。更新依赖并验证:
269
+ `package.json` 的宿主 peer 使用兼容范围;DSH 开发 SDK 则固定为 `0.2.1-rc.2`,并同步固定 Cordis 4.0.5、Schemastery 3.18.5 与 Zod 4.4.3,避免不同版本类型混用。`pnpm-lock.yaml` 保留已验证依赖图。更换 SDK 基线时应一起更新这些固定版本,重新安装并验证:
240
270
 
241
271
  ```sh
242
272
  pnpm update
243
273
  pnpm run check
244
274
  ```
245
275
 
246
- DSH 的 `^0.1.5-rc.2` 接受后续 `0.1.x` 正式版本和 `0.1.5` 的更新 RC,不自动跨入 `0.2`,也不包含其他版本基线的 alpha/RC。
276
+ 宿主 DSH peer 使用 `^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5`。其中 `^0.2.1-alpha.5` 包含同一版本基线的 `0.2.1-rc.2`,不需要禁用版本检查;不同版本基线的预发布版仍需重新验证。
247
277
 
248
278
  ### 验证范围
249
279
 
@@ -255,9 +285,9 @@ DSH 的 `^0.1.5-rc.2` 接受后续 `0.1.x` 正式版本和 `0.1.5` 的更新 RC
255
285
 
256
286
  官方 macOS 桌面端 `0.1.7-rc.2` 的实际窗口验证记录见 [桌面端兼容检查](./docs/desktop-compatibility.md)。新版使用 `uiWorkspace.openSession()` 导航,以 `retainedBy.mainView` 识别当前会话;创建后通过临时 Session reference 等待草稿可用,完成交接后释放。独立任务、消息编辑/删除后的跳转和当前会话删除共用该适配。
257
287
 
258
- 开发与宿主依赖统一使用 `^0.1.5-rc.2`,锁文件记录当前已验证版本。已适配新版会话格式、消息来源字段、`main.conversation` 插槽,以及 JSONL 后端的持久化快照和定位能力。已有本地链接安装在重新构建后,需要重启 DSH 并刷新页面以加载新的 Host 和 Client。
288
+ 开发 SDK 固定在 `0.2.1-rc.2`;宿主 peer 保留已有 RC/alpha 兼容范围。插件不再强依赖已移除的 `webRuntime`,请求走受认证的 Connection Fetch registry;设置层同时兼容 ConfigForms/SettingsForms 与旧接口。已适配新版会话格式、消息来源字段、`main.conversation` 插槽,以及 JSONL 后端的持久化快照和定位能力。已有本地链接安装在重新构建后,需要重启 DSH 并刷新页面以加载新的 Host 和 Client。
259
289
 
260
- - 当前依赖面向 DSH `0.1.5-rc.2`;预发布 API 或 DOM 变化可能要求更新 adapter。
290
+ - 当前测试基线为 DSH `0.2.1-rc.2`;后续预发布 API 或 DOM 变化仍可能要求更新 adapter。`pnpm run test:runtime` 会用临时 profile 和模型替身运行隔离 RC Host 验收,不使用用户历史或密钥。
261
291
  - DSH More 的产品内文案目前以简体中文为主;对 DSH 原生 Copy/Archive 元素的定位同时识别中英文标签。
262
292
  - 消息操作只面向仍在当前 model surface 中的普通用户消息和助手消息;编辑要求所属轮次已经完成。
263
293
  - 永久删除只支持提供有效定位能力的 `jsonl` 后端;当前后端的 `locate` 为内部接口,调用前会检查能力及返回值,测试覆盖普通和 Zstandard 压缩会话文件。
package/cordis.patch.yml CHANGED
@@ -2,5 +2,7 @@
2
2
  - insert:
3
3
  - id: dsh-more-session-groups
4
4
  name: dsh-more/session-groups
5
+ - id: dsh-more/fast-mode
6
+ name: dsh-more/fast-mode
5
7
  - id: dsh-more
6
8
  name: dsh-more
package/dist/client.js CHANGED
@@ -47,7 +47,8 @@ var PATCH_CATALOG = [
47
47
  { "id": "model-capabilities", "name": "\u6A21\u578B\u80FD\u529B\u914D\u7F6E", "description": "\u5728\u6A21\u578B\u914D\u7F6E\u9875\u8BBE\u7F6E\u6BCF\u4E2A\u6A21\u578B\u7684\u8BC6\u56FE\u80FD\u529B\u3001\u53EF\u9009\u601D\u8003\u7C7B\u578B\u4E0E\u601D\u8003\u53C2\u6570\u683C\u5F0F", "defaultEnabled": true, "order": 500, "clientKind": "standalone" },
48
48
  { "id": "fast-mode", "name": "\u52A0\u901F", "description": "\u5728\u8F93\u5165\u6846\u548C /fast \u547D\u4EE4\u4E2D\u5F00\u5173\u52A0\u901F\u3002\u54CD\u5E94\u66F4\u5FEB\uFF0C\u4F46\u4F1A\u66F4\u5FEB\u6D88\u8017\u989D\u5EA6", "defaultEnabled": true, "order": 550, "clientKind": "standalone" },
49
49
  { "id": "session-auto-title", "name": "\u4F1A\u8BDD\u81EA\u52A8\u547D\u540D", "description": "\u65B0\u4F1A\u8BDD\u9996\u6761\u9700\u6C42\u540E\uFF0C\u4F7F\u7528\u5F53\u524D\u6A21\u578B\u751F\u6210\u300C\u7C7B\u578B \xB7 \u5177\u4F53\u4EFB\u52A1\u300D\u6807\u9898\uFF1B\u4FDD\u7559\u624B\u52A8\u547D\u540D\uFF0C\u5931\u8D25\u65F6\u4FDD\u7559\u539F\u6709\u6807\u9898", "defaultEnabled": true, "order": 600, "clientKind": "standalone" },
50
- { "id": "projectless-tasks", "name": "\u72EC\u7ACB\u4EFB\u52A1", "description": "\u5728\u5DE5\u4F5C\u533A\u4E0B\u62C9\u6846\u521B\u5EFA\u72EC\u7ACB\u4EFB\u52A1\u5E76\u4FDD\u7559\u8349\u7A3F\uFF0C\u4E5F\u53EF\u5C06\u672A\u5206\u7EC4\u4F1A\u8BDD\u79FB\u5165\u5DE5\u4F5C\u533A\u5217\u8868", "defaultEnabled": true, "order": 700, "clientKind": "standalone" }
50
+ { "id": "projectless-tasks", "name": "\u72EC\u7ACB\u4EFB\u52A1", "description": "\u5728\u5DE5\u4F5C\u533A\u4E0B\u62C9\u6846\u521B\u5EFA\u72EC\u7ACB\u4EFB\u52A1\u5E76\u4FDD\u7559\u8349\u7A3F\uFF0C\u4E5F\u53EF\u5C06\u672A\u5206\u7EC4\u4F1A\u8BDD\u79FB\u5165\u5DE5\u4F5C\u533A\u5217\u8868", "defaultEnabled": true, "order": 700, "clientKind": "standalone" },
51
+ { "id": "terminal-clipboard", "name": "\u7EC8\u7AEF\u590D\u5236\u7C98\u8D34", "description": "\u53F3\u4FA7\u7EC8\u7AEF\u9009\u4E2D\u81EA\u52A8\u590D\u5236\u3001\u53F3\u952E\u7C98\u8D34\uFF0C\u652F\u6301 Ctrl+Shift+C/V \u548C Shift+Insert\uFF1B\u65E0\u9009\u533A\u65F6\u4FDD\u7559 Ctrl+C \u4E2D\u65AD", "defaultEnabled": true, "order": 800, "clientKind": "standalone" }
51
52
  ];
52
53
  var DEFAULT_PATCH_SETTINGS = {
53
54
  "message-edit": true,
@@ -57,7 +58,8 @@ var DEFAULT_PATCH_SETTINGS = {
57
58
  "model-capabilities": true,
58
59
  "fast-mode": true,
59
60
  "session-auto-title": true,
60
- "projectless-tasks": true
61
+ "projectless-tasks": true,
62
+ "terminal-clipboard": true
61
63
  };
62
64
  function decodePatchSettings(value) {
63
65
  if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
@@ -152,7 +154,8 @@ function apiErrorText(error) {
152
154
 
153
155
  // src/platform/dsh/client/runtime.ts
154
156
  function currentSessionId(list) {
155
- if (list.current !== void 0) return list.current;
157
+ const legacy = list;
158
+ if (legacy.current !== void 0) return legacy.current;
156
159
  return Object.values(list.byId).find((row) => {
157
160
  const retained = row.retainedBy;
158
161
  return (retained?.mainView ?? 0) > 0;
@@ -619,9 +622,9 @@ function installSessionDeleteMenuItems(onDelete) {
619
622
  flush();
620
623
  const observer = new MutationObserver((records) => {
621
624
  let removedKnownItem = false;
622
- for (const record of records) {
623
- record.addedNodes.forEach(collectButtons);
624
- if (record.removedNodes.length > 0 && deleteItems.size > 0) removedKnownItem = true;
625
+ for (const record2 of records) {
626
+ record2.addedNodes.forEach(collectButtons);
627
+ if (record2.removedNodes.length > 0 && deleteItems.size > 0) removedKnownItem = true;
625
628
  }
626
629
  if (pendingButtons.size > 0 || removedKnownItem) schedule();
627
630
  });
@@ -781,7 +784,8 @@ var CONVERSATION_MARKDOWN_EXPORT_PATCH_ID = "conversation-markdown-export";
781
784
 
782
785
  // src/patches/conversation-markdown-export/client/filename.ts
783
786
  function safeStem(value) {
784
- return [...value.normalize("NFKC").replace(/[\u0000-\u001f\u007f/\\?%*:|"<>]+/g, "-").replace(/\s+/g, " ").replace(/^[.\s-]+|[.\s-]+$/g, "")].slice(0, 80).join("").trim();
787
+ const stem = [...value.normalize("NFKC").replace(/[\u0000-\u001f\u007f/\\?%*:|"<>]+/g, "-").replace(/\s+/g, " ").replace(/^[.\s-]+|[.\s-]+$/g, "")].slice(0, 80).join("").replace(/[.\s]+$/g, "");
788
+ return /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?: *[.]| *$)/i.test(stem) ? `_${stem}` : stem;
785
789
  }
786
790
  function markdownFilename(title, sessionId) {
787
791
  const fallback = safeStem(`dsh-conversation-${sessionId}`) || "dsh-conversation";
@@ -1709,10 +1713,11 @@ var clientPatch4 = {
1709
1713
  name: "fast",
1710
1714
  label: () => "\u52A0\u901F",
1711
1715
  description: () => "\u5F00\u542F\u6216\u5173\u95ED\u5F53\u524D\u4F1A\u8BDD\u7684\u52A0\u901F\u3002\u54CD\u5E94\u66F4\u5FEB\uFF0C\u4F46\u4F1A\u66F4\u5FEB\u6D88\u8017\u989D\u5EA6",
1712
- available: (session) => sessions?.subagentAddress?.(session.sessionId) === void 0,
1716
+ available: (session) => activation.getSnapshot()[FAST_MODE_PATCH_ID] && sessions?.subagentAddress?.(session.sessionId) === void 0,
1713
1717
  ui: {
1714
1718
  kind: "action",
1715
1719
  run: (session) => {
1720
+ if (!activation.getSnapshot()[FAST_MODE_PATCH_ID]) return;
1716
1721
  void toggleFastMode(ctx, String(session.sessionId));
1717
1722
  }
1718
1723
  }
@@ -2457,9 +2462,181 @@ var clientPatch6 = {
2457
2462
  }
2458
2463
  };
2459
2464
 
2465
+ // src/patches/terminal-clipboard/shared.ts
2466
+ var TERMINAL_CLIPBOARD_PATCH_ID = "terminal-clipboard";
2467
+
2468
+ // src/patches/terminal-clipboard/client/terminal.ts
2469
+ function record(value) {
2470
+ return value !== null && typeof value === "object" ? value : void 0;
2471
+ }
2472
+ function terminal(value, root) {
2473
+ const candidate = record(value);
2474
+ if (candidate?.element !== root || !candidate.textarea || candidate.textarea !== root.querySelector("textarea.xterm-helper-textarea")) return;
2475
+ if (!record(candidate.options) || typeof candidate.getSelection !== "function" || typeof candidate.paste !== "function" || typeof candidate.focus !== "function") return;
2476
+ return candidate;
2477
+ }
2478
+ function resolveTerminal(root) {
2479
+ for (let node = root, depth = 0; node && depth < 4; node = node.parentElement, depth++) {
2480
+ const key = Object.keys(node).find((key2) => key2.startsWith("__reactFiber$"));
2481
+ if (!key) continue;
2482
+ let fiber = record(node[key]);
2483
+ for (let level = 0; fiber && level < 12; level++, fiber = record(fiber.return)) {
2484
+ for (const version of [fiber, record(fiber.alternate)]) {
2485
+ let hook = record(version?.memoizedState);
2486
+ for (let index = 0; hook && index < 32; index++, hook = record(hook.next)) {
2487
+ const found = terminal(record(hook.memoizedState)?.current, root);
2488
+ if (found) return found;
2489
+ }
2490
+ }
2491
+ }
2492
+ }
2493
+ }
2494
+
2495
+ // src/patches/terminal-clipboard/client/clipboard.ts
2496
+ function installTerminalClipboard(doc, resolve = resolveTerminal) {
2497
+ let active = true;
2498
+ let gesture;
2499
+ let pasteRevision = 0;
2500
+ let notice;
2501
+ let noticeTimer;
2502
+ const clipboard = doc.defaultView?.navigator.clipboard;
2503
+ const rootAt = (target) => {
2504
+ if (!(target instanceof Element)) return;
2505
+ return target.closest(".xterm") ?? void 0;
2506
+ };
2507
+ const report = (action) => {
2508
+ if (!active) return;
2509
+ notice?.remove();
2510
+ clearTimeout(noticeTimer);
2511
+ notice = doc.createElement("div");
2512
+ notice.setAttribute("role", "status");
2513
+ notice.setAttribute("data-dshmore-terminal-notice", "");
2514
+ notice.textContent = "\u7EC8\u7AEF" + action + "\u5931\u8D25\uFF1A\u8BF7\u5141\u8BB8\u526A\u8D34\u677F\u8BBF\u95EE\uFF0C\u6216\u7528 Shift+\u53F3\u952E\u6253\u5F00\u539F\u751F\u83DC\u5355\uFF1B\u4E5F\u53EF\u4F7F\u7528 macOS \u7684 \u2318C/\u2318V \u6216\u7CFB\u7EDF\u539F\u751F\u7C98\u8D34\u5FEB\u6377\u952E\u3002";
2515
+ notice.style.cssText = "position:fixed;bottom:24px;right:24px;z-index:10000;max-width:360px;padding:12px 16px;border-radius:8px;background:#252525;color:#fff;font-size:13px;box-shadow:0 4px 20px #0005";
2516
+ doc.body.append(notice);
2517
+ noticeTimer = setTimeout(() => {
2518
+ notice?.remove();
2519
+ notice = void 0;
2520
+ }, 6e3);
2521
+ };
2522
+ const copy = async (text) => {
2523
+ if (!text || !active) return;
2524
+ try {
2525
+ if (!clipboard?.writeText) throw new Error("Clipboard unavailable");
2526
+ await clipboard.writeText(text);
2527
+ } catch {
2528
+ report("\u590D\u5236");
2529
+ }
2530
+ };
2531
+ const paste = async (root, term) => {
2532
+ const revision = ++pasteRevision;
2533
+ if (term.options.disableStdin) return;
2534
+ term.focus();
2535
+ try {
2536
+ if (!clipboard?.readText) throw new Error("Clipboard unavailable");
2537
+ const text = await clipboard.readText();
2538
+ if (!active || revision !== pasteRevision || !root.isConnected || resolve(root) !== term || term.options.disableStdin || !root.contains(doc.activeElement)) return;
2539
+ if (text) term.paste(text);
2540
+ } catch {
2541
+ report("\u7C98\u8D34");
2542
+ }
2543
+ };
2544
+ const consume = (event) => {
2545
+ event.preventDefault();
2546
+ event.stopImmediatePropagation();
2547
+ };
2548
+ const contextmenu = (event) => {
2549
+ if (event.shiftKey) return;
2550
+ const root = rootAt(event.target);
2551
+ const term = root && resolve(root);
2552
+ if (!root || !term || term.options.disableStdin) return;
2553
+ consume(event);
2554
+ void paste(root, term);
2555
+ };
2556
+ const keydown = (event) => {
2557
+ if (event.isComposing || event.altKey) return;
2558
+ const root = rootAt(event.target);
2559
+ const term = root && resolve(root);
2560
+ if (!root || !term) return;
2561
+ const key = event.key.toLowerCase();
2562
+ if (key === "c" && (event.ctrlKey || event.metaKey)) {
2563
+ const selection = term.getSelection();
2564
+ if (!selection) return;
2565
+ if (event.metaKey && !event.ctrlKey) return;
2566
+ consume(event);
2567
+ if (!event.repeat) void copy(selection);
2568
+ } else if (key === "v" && event.ctrlKey && event.shiftKey && !event.metaKey || key === "insert" && event.shiftKey && !event.ctrlKey && !event.metaKey) {
2569
+ if (term.options.disableStdin) return;
2570
+ consume(event);
2571
+ if (!event.repeat) void paste(root, term);
2572
+ }
2573
+ };
2574
+ const mousedown = (event) => {
2575
+ gesture = void 0;
2576
+ if (event.button !== 0 || event.ctrlKey || event.metaKey || event.altKey) return;
2577
+ const root = rootAt(event.target);
2578
+ const term = root && resolve(root);
2579
+ if (root && term) gesture = { root, before: term.getSelection() };
2580
+ };
2581
+ const mouseup = (event) => {
2582
+ const started = gesture;
2583
+ gesture = void 0;
2584
+ if (event.button !== 0 || !started) return;
2585
+ queueMicrotask(() => {
2586
+ if (!active || !started.root.isConnected) return;
2587
+ const text = resolve(started.root)?.getSelection();
2588
+ if (text && text !== started.before) void copy(text);
2589
+ });
2590
+ };
2591
+ const blur = () => {
2592
+ gesture = void 0;
2593
+ pasteRevision++;
2594
+ };
2595
+ doc.addEventListener("contextmenu", contextmenu, true);
2596
+ doc.addEventListener("keydown", keydown, true);
2597
+ doc.addEventListener("mousedown", mousedown, true);
2598
+ doc.addEventListener("mouseup", mouseup, true);
2599
+ doc.defaultView?.addEventListener("blur", blur);
2600
+ return () => {
2601
+ active = false;
2602
+ blur();
2603
+ doc.removeEventListener("contextmenu", contextmenu, true);
2604
+ doc.removeEventListener("keydown", keydown, true);
2605
+ doc.removeEventListener("mousedown", mousedown, true);
2606
+ doc.removeEventListener("mouseup", mouseup, true);
2607
+ doc.defaultView?.removeEventListener("blur", blur);
2608
+ clearTimeout(noticeTimer);
2609
+ notice?.remove();
2610
+ };
2611
+ }
2612
+
2613
+ // src/patches/terminal-clipboard/client/index.ts
2614
+ var clientPatch7 = {
2615
+ id: TERMINAL_CLIPBOARD_PATCH_ID,
2616
+ install: (ctx, activation) => {
2617
+ ctx.effect(() => {
2618
+ let dispose;
2619
+ const sync = () => {
2620
+ if (activation.getSnapshot()[TERMINAL_CLIPBOARD_PATCH_ID]) {
2621
+ dispose ??= installTerminalClipboard(document);
2622
+ } else {
2623
+ dispose?.();
2624
+ dispose = void 0;
2625
+ }
2626
+ };
2627
+ const unsubscribe = activation.subscribe(sync);
2628
+ sync();
2629
+ return () => {
2630
+ unsubscribe();
2631
+ dispose?.();
2632
+ };
2633
+ });
2634
+ }
2635
+ };
2636
+
2460
2637
  // src/generated/client-registry.ts
2461
2638
  var MESSAGE_ACTION_PATCHES = [{ id: "message-edit", order: 100, useActions: useMessageActions }, { id: "message-delete", order: 200, useActions: useMessageActions2 }];
2462
- var CLIENT_PATCHES = [clientPatch, clientPatch2, clientPatch3, clientPatch4, clientPatch5, clientPatch6];
2639
+ var CLIENT_PATCHES = [clientPatch, clientPatch2, clientPatch3, clientPatch4, clientPatch5, clientPatch6, clientPatch7];
2463
2640
 
2464
2641
  // src/kernel/client/activation.ts
2465
2642
  var ClientPatchActivation = class {
@@ -2570,7 +2747,8 @@ function installPatchConfigCard(ctx, activation) {
2570
2747
  }, () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PatchConfigCard, { activation, initiallyOpen: true }) })));
2571
2748
  return;
2572
2749
  }
2573
- ctx.slots.inject("settings.plugin.item", () => ctx.slots.register({
2750
+ const legacy = ctx.slots;
2751
+ legacy.inject("settings.plugin.item", () => legacy.register({
2574
2752
  name: "settings.plugin.item",
2575
2753
  key: PATCH_SETTINGS_NAMESPACE,
2576
2754
  priority: 90
@@ -2832,12 +3010,12 @@ function useMessageTargets(props, hiddenSeqs, hiddenTrajectoryKeys, active = tru
2832
3010
  };
2833
3011
  requestFullScanRef.current = requestFullScan;
2834
3012
  const observer = new MutationObserver((records) => {
2835
- for (const record of records) {
2836
- if (record.removedNodes.length > 0) {
3013
+ for (const record2 of records) {
3014
+ if (record2.removedNodes.length > 0) {
2837
3015
  pruneDisconnected = true;
2838
- collectRows(record.target);
3016
+ collectRows(record2.target);
2839
3017
  }
2840
- record.addedNodes.forEach(collectRows);
3018
+ record2.addedNodes.forEach(collectRows);
2841
3019
  }
2842
3020
  if (pendingChatRows.size > 0 || pendingTrajectoryRows.size > 0 || pruneDisconnected) schedule();
2843
3021
  });
@@ -0,0 +1,34 @@
1
+ // src/patches/fast-mode/host/settings.ts
2
+ import z from "@deepseek-ai/schemastery";
3
+
4
+ // src/platform/dsh/host/settings.ts
5
+ function liveSetting(schema) {
6
+ const volatile = Reflect.get(schema, "volatile");
7
+ return typeof volatile === "function" ? volatile.call(schema) : schema;
8
+ }
9
+
10
+ // src/patches/fast-mode/shared.ts
11
+ var DEFAULT_FAST_MODE_SETTINGS = {
12
+ defaultEnabled: false,
13
+ serviceTier: "priority",
14
+ speed: 1.5,
15
+ enableAnthropicFastMode: true,
16
+ customBodyParams: {},
17
+ customHeaders: {}
18
+ };
19
+
20
+ // src/patches/fast-mode/host/settings.ts
21
+ var Config = z.object({
22
+ defaultEnabled: liveSetting(z.boolean().default(DEFAULT_FAST_MODE_SETTINGS.defaultEnabled)),
23
+ serviceTier: liveSetting(z.string().default(DEFAULT_FAST_MODE_SETTINGS.serviceTier)),
24
+ speed: liveSetting(z.number().default(DEFAULT_FAST_MODE_SETTINGS.speed)),
25
+ enableAnthropicFastMode: liveSetting(z.boolean().default(DEFAULT_FAST_MODE_SETTINGS.enableAnthropicFastMode)),
26
+ customBodyParams: liveSetting(z.dict(z.any()).default({})),
27
+ customHeaders: liveSetting(z.dict(z.string()).default({}))
28
+ });
29
+ function apply() {
30
+ }
31
+ export {
32
+ Config,
33
+ apply
34
+ };
package/dist/index.js CHANGED
@@ -180,7 +180,7 @@ function retainedRuntimeContexts(seed) {
180
180
  const event = seed[index];
181
181
  if (event?.type !== "user/message") continue;
182
182
  const source = event.data.source;
183
- if (source.plugin !== RUNTIME_CONTEXT_PLUGIN) continue;
183
+ if (source.kind !== "runtime-context" && source.plugin !== RUNTIME_CONTEXT_PLUGIN) continue;
184
184
  if (source.form === "snapshot" && Array.isArray(source.sections)) {
185
185
  const sections = source.sections.filter((section) => {
186
186
  const value = section;
@@ -991,7 +991,7 @@ ${body}`;
991
991
  function sourceLabel(event) {
992
992
  const source = event.data.source;
993
993
  if (source.kind === "user") return "\u7528\u6237";
994
- if (source.kind === "plugin") return `\u4E0A\u4E0B\u6587 \xB7 ${singleLine(source.plugin) || "\u63D2\u4EF6"}`;
994
+ if (source.kind === "plugin") return `\u4E0A\u4E0B\u6587 \xB7 ${singleLine(source.plugin ?? "") || "\u63D2\u4EF6"}`;
995
995
  return "\u4E0A\u4E0B\u6587";
996
996
  }
997
997
  function conversationMarkdown(events, options) {
@@ -1026,7 +1026,7 @@ function conversationMarkdown(events, options) {
1026
1026
  if (event.type === "tool/result") {
1027
1027
  const callId = String(event.data.message.source.callId);
1028
1028
  const block = event.data.message.content[0];
1029
- const failed = block?.type === "tool-result" && block.isError === true;
1029
+ const failed = event.data.message.isError === true || block?.type === "tool-result" && block.isError === true;
1030
1030
  const resultContent = block?.type === "tool-result" ? block.content : event.data.message.content;
1031
1031
  const name2 = singleLine(callNames.get(callId) ?? callId) || "\u672A\u547D\u540D\u5DE5\u5177";
1032
1032
  sections.push(messageSection(
@@ -1160,7 +1160,8 @@ function settingValue(value) {
1160
1160
  return typeof get === "function" ? get.call(value) : value;
1161
1161
  }
1162
1162
  function readSettings(ctx, namespace) {
1163
- if (typeof ctx.settings.get === "function") return ctx.settings.get(namespace);
1163
+ const legacy = ctx.settings;
1164
+ if (typeof legacy.get === "function") return legacy.get(namespace);
1164
1165
  return ctx.settings.describe().find((entry) => entry.ns === namespace)?.value;
1165
1166
  }
1166
1167
 
@@ -1424,6 +1425,9 @@ var hostPatch5 = {
1424
1425
  // src/patches/fast-mode/host/index.ts
1425
1426
  import { AsyncLocalStorage } from "node:async_hooks";
1426
1427
 
1428
+ // src/patches/fast-mode/host/settings.ts
1429
+ import z2 from "@deepseek-ai/schemastery";
1430
+
1427
1431
  // src/patches/fast-mode/shared.ts
1428
1432
  var FAST_MODE_PATCH_ID = "fast-mode";
1429
1433
  var FAST_MODE_SETTINGS_NS = "dsh-more/fast-mode";
@@ -1436,6 +1440,16 @@ var DEFAULT_FAST_MODE_SETTINGS = {
1436
1440
  customHeaders: {}
1437
1441
  };
1438
1442
 
1443
+ // src/patches/fast-mode/host/settings.ts
1444
+ var Config = z2.object({
1445
+ defaultEnabled: liveSetting(z2.boolean().default(DEFAULT_FAST_MODE_SETTINGS.defaultEnabled)),
1446
+ serviceTier: liveSetting(z2.string().default(DEFAULT_FAST_MODE_SETTINGS.serviceTier)),
1447
+ speed: liveSetting(z2.number().default(DEFAULT_FAST_MODE_SETTINGS.speed)),
1448
+ enableAnthropicFastMode: liveSetting(z2.boolean().default(DEFAULT_FAST_MODE_SETTINGS.enableAnthropicFastMode)),
1449
+ customBodyParams: liveSetting(z2.dict(z2.any()).default({})),
1450
+ customHeaders: liveSetting(z2.dict(z2.string()).default({}))
1451
+ });
1452
+
1439
1453
  // src/patches/fast-mode/host/index.ts
1440
1454
  var activeFastSessionStorage = new AsyncLocalStorage();
1441
1455
  var fastSessions = /* @__PURE__ */ new Set();
@@ -1455,11 +1469,11 @@ function toggleFastSession(sessionId) {
1455
1469
  var interceptorInstalled = false;
1456
1470
  var currentSettings = { ...DEFAULT_FAST_MODE_SETTINGS };
1457
1471
  function readSettings2(ctx) {
1458
- const descriptor = ctx.settings?.describe?.().find((entry) => entry.ns === FAST_MODE_SETTINGS_NS);
1459
- if (!descriptor || typeof descriptor.value !== "object" || descriptor.value === null) {
1472
+ const value = readSettings(ctx, FAST_MODE_SETTINGS_NS);
1473
+ if (typeof value !== "object" || value === null) {
1460
1474
  return { ...DEFAULT_FAST_MODE_SETTINGS };
1461
1475
  }
1462
- const val = descriptor.value;
1476
+ const val = value;
1463
1477
  return {
1464
1478
  defaultEnabled: typeof val.defaultEnabled === "boolean" ? val.defaultEnabled : false,
1465
1479
  serviceTier: typeof val.serviceTier === "string" && val.serviceTier ? val.serviceTier : "priority",
@@ -1534,19 +1548,27 @@ function installFastModeInterceptor() {
1534
1548
  interceptorInstalled = true;
1535
1549
  const originalFetch = globalThis.fetch;
1536
1550
  globalThis.fetch = async function(input, init) {
1551
+ let patched = { input, init };
1537
1552
  try {
1538
- const patched = patchFastRequest(input, init);
1539
- return await originalFetch.call(this, patched.input, patched.init);
1553
+ patched = patchFastRequest(input, init);
1540
1554
  } catch (error) {
1541
1555
  console.warn("fast-mode fetch interceptor error, sending the original request", error);
1542
- return originalFetch.call(this, input, init);
1543
1556
  }
1557
+ return originalFetch.call(this, patched.input, patched.init);
1544
1558
  };
1545
1559
  }
1546
1560
  var hostPatch6 = {
1547
1561
  id: FAST_MODE_PATCH_ID,
1548
1562
  setup: (ctx) => {
1549
- currentSettings = readSettings2(ctx);
1563
+ const legacy = ctx.settings;
1564
+ legacy.register?.(FAST_MODE_SETTINGS_NS, Config);
1565
+ const refreshSettings = () => {
1566
+ currentSettings = readSettings2(ctx);
1567
+ };
1568
+ refreshSettings();
1569
+ const disposeSettings = ctx.on("settings/document-updated", (namespace) => {
1570
+ if (namespace === FAST_MODE_SETTINGS_NS) refreshSettings();
1571
+ });
1550
1572
  installFastModeInterceptor();
1551
1573
  const dispose = ctx.on("llm/stream", (options, next) => {
1552
1574
  if (options?.purpose === "session-title" || options?.purpose === "compaction") return next();
@@ -1557,6 +1579,7 @@ var hostPatch6 = {
1557
1579
  }, { global: true, prepend: true });
1558
1580
  return () => {
1559
1581
  if (typeof dispose === "function") dispose();
1582
+ if (typeof disposeSettings === "function") disposeSettings();
1560
1583
  };
1561
1584
  },
1562
1585
  routes: ({ ctx }) => ({
@@ -1588,10 +1611,9 @@ var hostPatch6 = {
1588
1611
  customBodyParams: typeof payload.customBodyParams === "object" && payload.customBodyParams !== null ? payload.customBodyParams : {},
1589
1612
  customHeaders: typeof payload.customHeaders === "object" && payload.customHeaders !== null ? payload.customHeaders : {}
1590
1613
  };
1614
+ if (!descriptor || typeof ctx.settings?.mutate !== "function") throw new Error("\u52A0\u901F\u914D\u7F6E\u5C1A\u672A\u6CE8\u518C\uFF0C\u65E0\u6CD5\u4FDD\u5B58");
1615
+ await ctx.settings.mutate(FAST_MODE_SETTINGS_NS, [{ op: "set", path: [], value: next }], descriptor.revision);
1591
1616
  currentSettings = next;
1592
- if (typeof ctx.settings?.mutate === "function") {
1593
- await ctx.settings.mutate(FAST_MODE_SETTINGS_NS, [{ op: "set", path: [], value: next }], descriptor?.revision ?? 0);
1594
- }
1595
1617
  return next;
1596
1618
  }
1597
1619
  })
@@ -1736,10 +1758,10 @@ function decodeSessionGroups(value) {
1736
1758
  }
1737
1759
 
1738
1760
  // src/patches/projectless-tasks/host/groups.ts
1739
- import z2 from "@deepseek-ai/schemastery";
1761
+ import z3 from "@deepseek-ai/schemastery";
1740
1762
  import { SessionId as SessionId7 } from "@deepseek-ai/dsh-session";
1741
1763
  import { WorkspaceId } from "@deepseek-ai/dsh-workspace";
1742
- var SessionGroupsSchema = z2.object({ assignments: z2.dict(z2.string()).default({}) });
1764
+ var SessionGroupsSchema = z3.object({ assignments: z3.dict(z3.string()).default({}) });
1743
1765
  async function moveSessionGroup(ctx, payload) {
1744
1766
  const sessionId = SessionId7(requireString(payload, "sessionId"));
1745
1767
  if (typeof payload !== "object" || payload === null || !("workspaceId" in payload) || !(payload.workspaceId === null || typeof payload.workspaceId === "string" && payload.workspaceId.length > 0)) {
@@ -1778,8 +1800,9 @@ var hostPatch8 = {
1778
1800
  id: PROJECTLESS_TASKS_PATCH_ID,
1779
1801
  setup: (ctx) => {
1780
1802
  const fiber = ctx.inject(["settings"], (scope) => {
1781
- if (typeof scope.settings.register === "function") {
1782
- scope.settings.register(SESSION_GROUPS_NAMESPACE, SessionGroupsSchema);
1803
+ const legacy = scope.settings;
1804
+ if (typeof legacy.register === "function") {
1805
+ legacy.register(SESSION_GROUPS_NAMESPACE, SessionGroupsSchema);
1783
1806
  }
1784
1807
  });
1785
1808
  return () => {
@@ -1789,8 +1812,17 @@ var hostPatch8 = {
1789
1812
  routes: ({ ctx }) => ({ prepare: (payload) => prepareTask(payload), move: (payload) => moveSessionGroup(ctx, payload) })
1790
1813
  };
1791
1814
 
1815
+ // src/patches/terminal-clipboard/shared.ts
1816
+ var TERMINAL_CLIPBOARD_PATCH_ID = "terminal-clipboard";
1817
+
1818
+ // src/patches/terminal-clipboard/host/index.ts
1819
+ var hostPatch9 = {
1820
+ id: TERMINAL_CLIPBOARD_PATCH_ID,
1821
+ routes: () => ({ status: () => ({ available: true }) })
1822
+ };
1823
+
1792
1824
  // src/generated/host-registry.ts
1793
- var HOST_PATCHES = [hostPatch, hostPatch2, hostPatch3, hostPatch4, hostPatch5, hostPatch6, hostPatch7, hostPatch8];
1825
+ var HOST_PATCHES = [hostPatch, hostPatch2, hostPatch3, hostPatch4, hostPatch5, hostPatch6, hostPatch7, hostPatch8, hostPatch9];
1794
1826
 
1795
1827
  // src/generated/patch-catalog.ts
1796
1828
  var PATCH_CATALOG = [
@@ -1801,7 +1833,8 @@ var PATCH_CATALOG = [
1801
1833
  { "id": "model-capabilities", "name": "\u6A21\u578B\u80FD\u529B\u914D\u7F6E", "description": "\u5728\u6A21\u578B\u914D\u7F6E\u9875\u8BBE\u7F6E\u6BCF\u4E2A\u6A21\u578B\u7684\u8BC6\u56FE\u80FD\u529B\u3001\u53EF\u9009\u601D\u8003\u7C7B\u578B\u4E0E\u601D\u8003\u53C2\u6570\u683C\u5F0F", "defaultEnabled": true, "order": 500, "clientKind": "standalone" },
1802
1834
  { "id": "fast-mode", "name": "\u52A0\u901F", "description": "\u5728\u8F93\u5165\u6846\u548C /fast \u547D\u4EE4\u4E2D\u5F00\u5173\u52A0\u901F\u3002\u54CD\u5E94\u66F4\u5FEB\uFF0C\u4F46\u4F1A\u66F4\u5FEB\u6D88\u8017\u989D\u5EA6", "defaultEnabled": true, "order": 550, "clientKind": "standalone" },
1803
1835
  { "id": "session-auto-title", "name": "\u4F1A\u8BDD\u81EA\u52A8\u547D\u540D", "description": "\u65B0\u4F1A\u8BDD\u9996\u6761\u9700\u6C42\u540E\uFF0C\u4F7F\u7528\u5F53\u524D\u6A21\u578B\u751F\u6210\u300C\u7C7B\u578B \xB7 \u5177\u4F53\u4EFB\u52A1\u300D\u6807\u9898\uFF1B\u4FDD\u7559\u624B\u52A8\u547D\u540D\uFF0C\u5931\u8D25\u65F6\u4FDD\u7559\u539F\u6709\u6807\u9898", "defaultEnabled": true, "order": 600, "clientKind": "standalone" },
1804
- { "id": "projectless-tasks", "name": "\u72EC\u7ACB\u4EFB\u52A1", "description": "\u5728\u5DE5\u4F5C\u533A\u4E0B\u62C9\u6846\u521B\u5EFA\u72EC\u7ACB\u4EFB\u52A1\u5E76\u4FDD\u7559\u8349\u7A3F\uFF0C\u4E5F\u53EF\u5C06\u672A\u5206\u7EC4\u4F1A\u8BDD\u79FB\u5165\u5DE5\u4F5C\u533A\u5217\u8868", "defaultEnabled": true, "order": 700, "clientKind": "standalone" }
1836
+ { "id": "projectless-tasks", "name": "\u72EC\u7ACB\u4EFB\u52A1", "description": "\u5728\u5DE5\u4F5C\u533A\u4E0B\u62C9\u6846\u521B\u5EFA\u72EC\u7ACB\u4EFB\u52A1\u5E76\u4FDD\u7559\u8349\u7A3F\uFF0C\u4E5F\u53EF\u5C06\u672A\u5206\u7EC4\u4F1A\u8BDD\u79FB\u5165\u5DE5\u4F5C\u533A\u5217\u8868", "defaultEnabled": true, "order": 700, "clientKind": "standalone" },
1837
+ { "id": "terminal-clipboard", "name": "\u7EC8\u7AEF\u590D\u5236\u7C98\u8D34", "description": "\u53F3\u4FA7\u7EC8\u7AEF\u9009\u4E2D\u81EA\u52A8\u590D\u5236\u3001\u53F3\u952E\u7C98\u8D34\uFF0C\u652F\u6301 Ctrl+Shift+C/V \u548C Shift+Insert\uFF1B\u65E0\u9009\u533A\u65F6\u4FDD\u7559 Ctrl+C \u4E2D\u65AD", "defaultEnabled": true, "order": 800, "clientKind": "standalone" }
1805
1838
  ];
1806
1839
  var DEFAULT_PATCH_SETTINGS = {
1807
1840
  "message-edit": true,
@@ -1811,7 +1844,8 @@ var DEFAULT_PATCH_SETTINGS = {
1811
1844
  "model-capabilities": true,
1812
1845
  "fast-mode": true,
1813
1846
  "session-auto-title": true,
1814
- "projectless-tasks": true
1847
+ "projectless-tasks": true,
1848
+ "terminal-clipboard": true
1815
1849
  };
1816
1850
  function decodePatchSettings(value) {
1817
1851
  if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
@@ -1887,40 +1921,42 @@ var HostPatchActivation = class {
1887
1921
  };
1888
1922
 
1889
1923
  // src/kernel/host/settings.ts
1890
- import z4 from "@deepseek-ai/schemastery";
1924
+ import z5 from "@deepseek-ai/schemastery";
1891
1925
 
1892
1926
  // src/generated/host-settings-schema.ts
1893
- import z3 from "@deepseek-ai/schemastery";
1894
- var PatchSettingsSchema = z3.object({
1895
- "message-edit": z3.boolean().default(true),
1896
- "message-delete": z3.boolean().default(true),
1897
- "session-delete": z3.boolean().default(true),
1898
- "conversation-markdown-export": z3.boolean().default(true),
1899
- "model-capabilities": z3.boolean().default(true),
1900
- "fast-mode": z3.boolean().default(true),
1901
- "session-auto-title": z3.boolean().default(true),
1902
- "projectless-tasks": z3.boolean().default(true)
1927
+ import z4 from "@deepseek-ai/schemastery";
1928
+ var PatchSettingsSchema = z4.object({
1929
+ "message-edit": z4.boolean().default(true),
1930
+ "message-delete": z4.boolean().default(true),
1931
+ "session-delete": z4.boolean().default(true),
1932
+ "conversation-markdown-export": z4.boolean().default(true),
1933
+ "model-capabilities": z4.boolean().default(true),
1934
+ "fast-mode": z4.boolean().default(true),
1935
+ "session-auto-title": z4.boolean().default(true),
1936
+ "projectless-tasks": z4.boolean().default(true),
1937
+ "terminal-clipboard": z4.boolean().default(true)
1903
1938
  });
1904
1939
 
1905
1940
  // src/kernel/host/settings.ts
1906
1941
  var PATCH_SETTINGS_NAMESPACE2 = PATCH_SETTINGS_NAMESPACE;
1907
- var PatchConfig = z4.object(Object.fromEntries(
1942
+ var PatchConfig = z5.object(Object.fromEntries(
1908
1943
  Object.entries(PatchSettingsSchema.dict ?? {}).map(([key, schema2]) => [key, liveSetting(schema2)])
1909
1944
  ));
1910
1945
  function installPatchSettings(ctx, activation, config = DEFAULT_PATCH_SETTINGS) {
1911
- if (typeof ctx.settings.installSection !== "function") {
1946
+ const settings = ctx.settings;
1947
+ if (typeof settings.installSection !== "function") {
1912
1948
  const refresh = () => {
1913
1949
  const values = typeof config === "object" && config !== null ? Object.fromEntries(Object.entries(config).map(([key, value]) => [key, settingValue(value)])) : config;
1914
- const settings = decodePatchSettings(values);
1915
- if (settings === void 0) throw new TypeError("Invalid DSH More patch configuration");
1916
- activation.apply(settings);
1950
+ const settings2 = decodePatchSettings(values);
1951
+ if (settings2 === void 0) throw new TypeError("Invalid DSH More patch configuration");
1952
+ activation.apply(settings2);
1917
1953
  };
1918
1954
  ctx.on("loader/volatile-update", refresh);
1919
1955
  refresh();
1920
1956
  return;
1921
1957
  }
1922
1958
  let source = () => DEFAULT_PATCH_SETTINGS;
1923
- ctx.settings.installSection(ctx, PATCH_SETTINGS_NAMESPACE2, PatchSettingsSchema, DEFAULT_PATCH_SETTINGS, {
1959
+ settings.installSection(ctx, PATCH_SETTINGS_NAMESPACE2, PatchSettingsSchema, DEFAULT_PATCH_SETTINGS, {
1924
1960
  setSource: (next) => {
1925
1961
  source = next;
1926
1962
  },
@@ -2068,7 +2104,6 @@ function registerPatchApi(ctx, patches, confirmationSecret, isEnabled) {
2068
2104
  var name = PLUGIN_NAME;
2069
2105
  var inject = [
2070
2106
  "webServer",
2071
- "webRuntime",
2072
2107
  "agents",
2073
2108
  "sessions",
2074
2109
  "connection",
@@ -1,20 +1,22 @@
1
1
  import z from '@deepseek-ai/schemastery';
2
- export declare const PatchSettingsSchema: z<Schemastery.ObjectS<{
3
- "message-edit": z<boolean, boolean>;
4
- "message-delete": z<boolean, boolean>;
5
- "session-delete": z<boolean, boolean>;
6
- "conversation-markdown-export": z<boolean, boolean>;
7
- "model-capabilities": z<boolean, boolean>;
8
- "fast-mode": z<boolean, boolean>;
9
- "session-auto-title": z<boolean, boolean>;
10
- "projectless-tasks": z<boolean, boolean>;
11
- }>, Schemastery.ObjectT<{
12
- "message-edit": z<boolean, boolean>;
13
- "message-delete": z<boolean, boolean>;
14
- "session-delete": z<boolean, boolean>;
15
- "conversation-markdown-export": z<boolean, boolean>;
16
- "model-capabilities": z<boolean, boolean>;
17
- "fast-mode": z<boolean, boolean>;
18
- "session-auto-title": z<boolean, boolean>;
19
- "projectless-tasks": z<boolean, boolean>;
20
- }>>;
2
+ export declare const PatchSettingsSchema: z<Schemastery.ObjectS<NoInfer<{
3
+ "message-edit": z<boolean, boolean, "defined">;
4
+ "message-delete": z<boolean, boolean, "defined">;
5
+ "session-delete": z<boolean, boolean, "defined">;
6
+ "conversation-markdown-export": z<boolean, boolean, "defined">;
7
+ "model-capabilities": z<boolean, boolean, "defined">;
8
+ "fast-mode": z<boolean, boolean, "defined">;
9
+ "session-auto-title": z<boolean, boolean, "defined">;
10
+ "projectless-tasks": z<boolean, boolean, "defined">;
11
+ "terminal-clipboard": z<boolean, boolean, "defined">;
12
+ }>>, Schemastery.ObjectT<NoInfer<{
13
+ "message-edit": z<boolean, boolean, "defined">;
14
+ "message-delete": z<boolean, boolean, "defined">;
15
+ "session-delete": z<boolean, boolean, "defined">;
16
+ "conversation-markdown-export": z<boolean, boolean, "defined">;
17
+ "model-capabilities": z<boolean, boolean, "defined">;
18
+ "fast-mode": z<boolean, boolean, "defined">;
19
+ "session-auto-title": z<boolean, boolean, "defined">;
20
+ "projectless-tasks": z<boolean, boolean, "defined">;
21
+ "terminal-clipboard": z<boolean, boolean, "defined">;
22
+ }>>, "plain">;
@@ -54,6 +54,13 @@ export declare const PATCH_CATALOG: readonly [{
54
54
  readonly defaultEnabled: true;
55
55
  readonly order: 700;
56
56
  readonly clientKind: "standalone";
57
+ }, {
58
+ readonly id: "terminal-clipboard";
59
+ readonly name: "终端复制粘贴";
60
+ readonly description: "右侧终端选中自动复制、右键粘贴,支持 Ctrl+Shift+C/V 和 Shift+Insert;无选区时保留 Ctrl+C 中断";
61
+ readonly defaultEnabled: true;
62
+ readonly order: 800;
63
+ readonly clientKind: "standalone";
57
64
  }];
58
65
  export type PatchId = typeof PATCH_CATALOG[number]['id'];
59
66
  export interface PatchSettings {
@@ -65,6 +72,7 @@ export interface PatchSettings {
65
72
  "fast-mode": boolean;
66
73
  "session-auto-title": boolean;
67
74
  "projectless-tasks": boolean;
75
+ "terminal-clipboard": boolean;
68
76
  }
69
77
  export declare const DEFAULT_PATCH_SETTINGS: PatchSettings;
70
78
  export declare function decodePatchSettings(value: unknown): PatchSettings | undefined;
@@ -1,5 +1,5 @@
1
- import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
2
- import type { SettingsScopeSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client';
1
+ import type { SettingsScope } from '../../platform/dsh/client/settings.js';
2
+ import type { SettingsScopeSnapshot } from '../../platform/dsh/client/settings.js';
3
3
  import { type PatchId, type PatchSettings } from '../../generated/patch-catalog.js';
4
4
  export interface PatchActivationSource {
5
5
  getSnapshot(): PatchSettings;
@@ -1,11 +1,15 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
2
  import z from '@deepseek-ai/schemastery';
3
3
  import type { HostPatchActivation } from './activation.js';
4
+ export type LegacyInstallSection = <T>(ctx: Context, namespace: string, schema: z<T>, defaults: T, hooks: {
5
+ setSource(source: () => T): void;
6
+ onChange(): void;
7
+ }) => void;
4
8
  export declare const PATCH_SETTINGS_NAMESPACE = "dsh-more";
5
- export declare const PatchConfig: z<Schemastery.ObjectS<{
9
+ export declare const PatchConfig: z<Schemastery.ObjectS<NoInfer<{
6
10
  [k: string]: z<any>;
7
- }>, Schemastery.ObjectT<{
11
+ }>>, Schemastery.ObjectT<NoInfer<{
8
12
  [k: string]: z<any>;
9
- }>>;
13
+ }>>, "plain">;
10
14
  /** Bind persisted DSH settings to live Host patch activation. */
11
15
  export declare function installPatchSettings(ctx: Context, activation: HostPatchActivation, config?: unknown): void;
@@ -0,0 +1,6 @@
1
+ import z from '@deepseek-ai/schemastery';
2
+ import { type FastModeSettings } from '../shared.js';
3
+ /** Companion entry projects the existing namespace into the host's settings forms. */
4
+ export declare const Config: z<FastModeSettings>;
5
+ /** The host owns persistence; the fast-mode patch consumes the live descriptor. */
6
+ export declare function apply(): void;
@@ -1,4 +1,4 @@
1
- import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
1
+ import type { SettingsScope } from '../../../platform/dsh/client/settings.js';
2
2
  export type {} from '@deepseek-ai/dsh-client-ui-settings';
3
3
  import type { PatchActivationSource } from '../../../kernel/client/activation.js';
4
4
  import type { ClientPatch } from '../../../kernel/client/patch.js';
@@ -4,7 +4,7 @@ import type { SessionId } from '@deepseek-ai/dsh-session/types';
4
4
  import type { SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
5
5
  import type { WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client';
6
6
  import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
7
- import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
7
+ import type { SettingsScope } from '../../../platform/dsh/client/settings.js';
8
8
  import type { PatchActivationSource } from '../../../kernel/client/activation.js';
9
9
  import { type SessionGroups } from '../groups.js';
10
10
  /** Only the sidebar receives grouping metadata; execution and workspace selection use native cwd. */
@@ -0,0 +1,5 @@
1
+ import { type TerminalHandle } from './terminal.js';
2
+ type Resolve = (root: HTMLElement) => TerminalHandle | undefined;
3
+ /** Delegation handles terminal tabs/remounts without a global MutationObserver. */
4
+ export declare function installTerminalClipboard(doc: Document, resolve?: Resolve): () => void;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { ClientPatch } from '../../../kernel/client/patch.js';
2
+ export declare const clientPatch: ClientPatch;
@@ -0,0 +1,17 @@
1
+ /** Only the public xterm surface is used after locating the native React ref. */
2
+ export interface TerminalHandle {
3
+ element: HTMLElement;
4
+ textarea: HTMLTextAreaElement;
5
+ options: {
6
+ disableStdin?: boolean;
7
+ };
8
+ getSelection(): string;
9
+ paste(text: string): void;
10
+ focus(): void;
11
+ }
12
+ /**
13
+ * DSH's TerminalScreen keeps xterm in a useRef but exposes no terminal API.
14
+ * Isolate the version-sensitive lookup here, bound every walk, and fail closed.
15
+ * Never mutate React internals, xterm prototypes, or the native key handler.
16
+ */
17
+ export declare function resolveTerminal(root: HTMLElement): TerminalHandle | undefined;
@@ -0,0 +1,2 @@
1
+ import type { HostPatch } from '../../../kernel/host/patch.js';
2
+ export declare const hostPatch: HostPatch;
@@ -0,0 +1 @@
1
+ export declare const TERMINAL_CLIPBOARD_PATCH_ID = "terminal-clipboard";
@@ -2,7 +2,9 @@ import type { Context } from '@deepseek-ai/cordis';
2
2
  import type { ISessions, SessionListState } from '@deepseek-ai/dsh-api-session-controller/client';
3
3
  import type { IWorkspaces } from '@deepseek-ai/dsh-api-workspace-controller/client';
4
4
  import type { SessionId } from '@deepseek-ai/dsh-session/types';
5
- export interface RefreshableSessions extends Pick<ISessions, 'list' | 'open'> {
5
+ export type OpenSession = (id: SessionId | undefined) => void;
6
+ export interface RefreshableSessions extends Pick<ISessions, 'list'> {
7
+ open: OpenSession;
6
8
  refresh(): Promise<void>;
7
9
  }
8
10
  export interface RefreshableWorkspaces extends IWorkspaces {
@@ -12,7 +14,8 @@ export interface SessionReference {
12
14
  ready: Promise<unknown>;
13
15
  release(): void;
14
16
  }
15
- export interface TaskSessionActions extends Pick<ISessions, 'create' | 'open'> {
17
+ export interface TaskSessionActions extends Pick<ISessions, 'create'> {
18
+ open: OpenSession;
16
19
  retain?(id: SessionId): SessionReference;
17
20
  }
18
21
  /** 0.1.7 moved view selection out of the catalog and exposes reference owners. */
@@ -1,5 +1,19 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
- import type { SettingsScope, SettingsScopeSpec } from '@deepseek-ai/dsh-client-ui-settings/client';
2
+ import type { ConfigForm as NativeConfigForm, ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client';
3
+ /** Plugin-owned facade: old scopes throw on refusal; native forms return a boolean. */
4
+ export interface SettingsScopeSnapshot<T> extends ConfigFormSnapshot<T> {
5
+ mode?: 'host' | 'local';
6
+ }
7
+ export interface SettingsScopeSpec<T> {
8
+ namespace: string;
9
+ decode?(value: unknown): T | undefined;
10
+ }
11
+ export interface SettingsScope<T> extends Omit<NativeConfigForm<T>, 'set' | 'unset' | 'mutate'> {
12
+ getSnapshot(): SettingsScopeSnapshot<T>;
13
+ set(field: string, value: unknown): Promise<void>;
14
+ unset(field: string): Promise<void>;
15
+ mutate(...args: Parameters<NativeConfigForm<T>['mutate']>): Promise<void>;
16
+ }
3
17
  /** Keep feature consumers stable across the settingsScope -> configForms service rename. */
4
18
  export declare function bindSettings<T>(ctx: Context, spec: SettingsScopeSpec<T>): SettingsScope<T>;
5
19
  /** Each supported DSH release provides one of these settings services. */
@@ -1,5 +1,87 @@
1
1
  # 桌面端兼容记录
2
2
 
3
+ ## 2026-10-22:DSH 0.2.1-rc.2 与 Windows 适配
4
+
5
+ 本次保留原有全部功能及工作区已有修改,没有使用 `allow-version` 或关闭补丁来绕过兼容问题。开发 SDK 和锁文件已固定到 `0.2.1-rc.2`,Cordis 4.0.5、Schemastery 3.18.5;既有 `^0.2.1-alpha.5` peer 本身覆盖同版本基线的 RC,不需另加不安全豁免。
6
+
7
+ ### 已发现的问题
8
+
9
+ | 问题 | 处理 |
10
+ | --- | --- |
11
+ | 构建将 `URL.pathname` 作为 esbuild 工作目录,Windows 盘符以及包含空格、中文、`#`、`%` 的路径会错误 | 统一使用 `fileURLToPath`;在特殊字符目录从不同 cwd 执行真实构建回归 |
12
+ | release 直接 spawn npm,Windows 的 `npm.cmd` 不能作为普通可执行程序启动 | 找到 `npm-cli.js` 后交给 Node 执行;不使用 shell,避免参数中的 `%s`、引号和符号被解释 |
13
+ | Desktop 验收硬编码 macOS 路径,默认 symlink 在 Windows 受权限限制 | 增加 Windows 安装目录/exe 查找与显式路径;目录链接使用 junction;清理重试处理临时文件锁 |
14
+ | Markdown 下载使用 Windows 保留设备名(CON、AUX、COM1 等) | 安全前缀并处理截断后的尾随点,保留普通文件名 |
15
+ | 加速设置缺少配置入口,保存失败前提前改变内存状态 | 补齐原生 Config entry,保存成功后生效;保留会话开关与自定义参数 |
16
+ | 加速拦截器把网络失败也当作准备失败,再发一次原请求;`/fast` 忽略补丁开关 | 网络和取消错误不重复发送;命令可用性和执行均检查实时开关 |
17
+
18
+ 这些是代码中确认的问题;由于没有用户 Windows 报错日志,不能断言每一项都是该机器本次无法使用的直接原因。Web 与 Desktop profile 分离,装到 `web` 不会加载到桌面端,也必须核对。
19
+
20
+ ### 验证与边界
21
+
22
+ - macOS 上使用 Node **24.22.1** 完成 `npm run check`:清单、peer、类型、**46 个测试文件 / 359 项测试**、**11 项脚本回归**和构建全部通过,无跳过。
23
+ - npm SDK Host 和本机实际安装的 Desktop Host 均为 **0.2.1-rc.2**,隔离验收通过。除历史功能外,新增原生加速设置保存、读取、启停和 loopback HTTP 请求验证,确认发出 `service_tier: priority` 与自定义请求头,关闭补丁时不加速。
24
+ - 隔离 Desktop profile 仍出现上游 telemetry `serviceVersion` 缺失及 analytics 等待警告;插件断言全部通过。原生 UI fixture 图标警告不计作真实窗口验收。
25
+ - 目标 RC 的真实 SDK Host 使用临时 DSH_HOME 和本地模型替身;不读取用户历史或使用模型密钥。检查 bundle 没有被跳过、受认证 Fetch registry、未登录请求 401。
26
+ - Windows 路径语义测试覆盖盘符、UNC、长路径、中文空格、独立任务识别、精确会话目录删除和危险路径拒绝。
27
+ - CI 扩展为 Linux / Windows / macOS × Node 22.19 / 24,并在 Node 24 上跑 SDK Host。**配置 CI 不等于已执行远端 Windows CI;本轮无 Windows 实机逐项验收。**
28
+ - 工作区同期新增的 `terminal-clipboard` 也保留在构建和全量测试中;本次不覆盖其实现。
29
+
30
+ ### Windows 重跑和安装
31
+
32
+ ```powershell
33
+ pnpm install --frozen-lockfile
34
+ pnpm run check
35
+ pnpm run test:runtime
36
+ # 可选:检查这台机器实际安装的 Desktop,不是 npm SDK
37
+ $env:DSH_MORE_DESKTOP_APP = "C:\实际安装目录\DeepSeek Harness.exe"
38
+ pnpm run test:desktop
39
+ npm pack
40
+ ```
41
+
42
+ 把生成的包安装到**实际使用的 profile**;桌面端需先完整退出,并使用 Desktop 自带 `dsh`(不是 npm 通用 CLI):
43
+
44
+ ```powershell
45
+ Get-Command dsh | Select-Object Source
46
+ dsh --version
47
+ dsh plugin --profile desktop add "C:\Downloads\dsh-more-0.1.1.tgz"
48
+ dsh plugin --profile desktop list dsh-more --depth 0
49
+ ```
50
+
51
+ 重新打开 Desktop 后,在设置里确认所有补丁开关,再用测试会话验收:编辑续跑、用户/助手消息删除、冷/实时会话永久删除、模型能力保存、加速及 `/fast`、Markdown 下载、自动标题、独立任务和手动归组;检查源会话历史保留,开关关闭/恢复和重启后的配置持久化。终端复制粘贴按其当前工作区功能单独验证。
52
+
53
+ 本次修复尚未发布 npm;不能用 `dsh-more@latest` 代替这里的本地修复包。没有重启或修改用户正在运行的 DSH,也没有提交/推送代码。
54
+
55
+ ## 2026-10-16:适配 DSH 0.2.1-alpha.5
56
+
57
+ npm 的 `alpha` 标签在本轮查询时为 `0.2.1-alpha.5`。本轮修改:
58
+
59
+ - 宿主 DSH peer 保留既有 RC 分支,并增加 `^0.2.1-alpha.5`;Cordis/Schemastery 也显式允许对应 alpha。开发 SDK 与锁文件统一固定在已验证的 alpha,不用全量预发布豁免。
60
+ - 移除已被 alpha 删除的 `webRuntime` 强注入,避免插件永久等待服务;Host 与插件清单的注入声明保持一致,并等待 `connection` 就绪。
61
+ - 预设类型依赖从已停止发布的 `dsh-agent-presets` 迁到 `dsh-agent-preset-registry`,保留原有 `agentPresets.composeFrom` 的精确代际继承。
62
+ - 设置、会话导航、旧菜单插槽统一收敛到适配层;内容 Factory 改用正式 `ConversationContentProps`,不再借用已变窄的 shell props。
63
+ - 导出兼容 alpha 的一等工具结果消息及旧版包裹内容,正确保留失败标记;续跑上下文同时识别新版 `runtime-context` 来源与旧版插件来源。
64
+ - 测试改用真实 SettingsForms(仅配置文档 IO 为内存替身),原生 SlotRegistry/renderer/ConversationContent 默认读取固定 SDK;不再因没有 Desktop 安装包而跳过。
65
+
66
+ 验证范围:
67
+
68
+ - 类型检查、全量 Vitest **41 个文件、296 项测试通过,无跳过**,包含原生 alpha 客户端模块。
69
+ - 隔离 alpha Host 与本机 Desktop `0.2.0-rc.2` 均通过导出、编辑续跑、删除重建、原历史保留、归组持久化、永久删除、补丁开关、模型能力保存/冲突及标题中间件验收;同时断言 bundle 未被跳过、路由进入认证 Fetch registry、未登录请求返回 401。
70
+ - 两种 Host 验收只用临时 DSH_HOME 和模型替身;未使用用户密钥或修改用户会话。隔离 desktop composition 仍会报告上游 telemetry serviceVersion 缺失及 analytics 等待警告,与插件断言无关。
71
+ - 原生内容测试的图标替身有 React 属性警告,不影响功能断言。现有 RC 安装包的原生客户端两项回归也通过。
72
+ - `pnpm run check`、peer 检查、构建、`npm pack --dry-run` 和 diff 空白检查均通过。本机最终源码验证使用现有 Node.js 26.3.0;已配置 Node 22/24 CI,但本轮未执行远端 CI。宿主自带的签名 Node 24 因 macOS 库验证拒载 npm 的 rolldown 原生绑定,未通过修改签名或关闭安全检查绕过。
73
+
74
+ 重跑:
75
+
76
+ ```sh
77
+ pnpm install --frozen-lockfile
78
+ pnpm run check
79
+ pnpm run test:runtime # 固定 npm alpha Host;已加入 CI Node 24
80
+ pnpm run test:desktop # 本机 Desktop 安装包
81
+ ```
82
+
83
+ 本轮没有替换或重启用户的 DSH,没有 alpha 真实窗口逐项点击验收,也未发布 npm、提交或推送。已有本地链接安装需重启 DSH 并刷新页面,让新 peer、Host 与 Client 一起加载。
84
+
3
85
  ## 2026-10-15:适配 Desktop 0.2.0-rc.2
4
86
 
5
87
  本次确认并修复两层失效,未使用版本豁免绕过 DSH 的兼容检查:
package/dsh.plugin.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "dsh-more",
3
3
  "description": "Practical patches for missing DSH Web context and history controls",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "entry": {
6
6
  "name": "dsh-more",
7
7
  "inject": [
8
8
  "webServer",
9
- "webRuntime",
10
9
  "agents",
11
10
  "sessions",
11
+ "connection",
12
12
  "sessionPersistence",
13
13
  "sessionProjections",
14
14
  "workspaceRegistry",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-more",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Practical patches for missing DeepSeek Harness Web context and history controls.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -41,7 +41,11 @@
41
41
  "types": "./dist/types/patches/projectless-tasks/host/settings.d.ts",
42
42
  "default": "./dist/session-groups.js"
43
43
  },
44
- "./package.json": "./package.json"
44
+ "./package.json": "./package.json",
45
+ "./fast-mode": {
46
+ "types": "./dist/types/patches/fast-mode/host/settings.d.ts",
47
+ "default": "./dist/fast-mode.js"
48
+ }
45
49
  },
46
50
  "files": [
47
51
  "dist",
@@ -81,8 +85,10 @@
81
85
  "build": "node build.mjs",
82
86
  "typecheck": "npm run generate && tsc --noEmit",
83
87
  "test": "npm run generate && vitest run",
88
+ "test:scripts": "node --test scripts/platform-regression.mjs",
89
+ "test:runtime": "npm run build && node scripts/check-desktop-runtime.mjs --sdk",
84
90
  "test:desktop": "npm run build && node scripts/check-desktop-runtime.mjs",
85
- "check": "npm run validate:package && npm run peers:check && npm run typecheck && npm run test && npm run build",
91
+ "check": "npm run validate:package && npm run peers:check && npm run typecheck && npm run test:scripts && npm run test && npm run build",
86
92
  "package": "npm pack",
87
93
  "package:check": "npm pack --dry-run",
88
94
  "release": "node scripts/release.mjs",
@@ -94,59 +100,58 @@
94
100
  "prepack": "npm run check"
95
101
  },
96
102
  "peerDependencies": {
97
- "@deepseek-ai/cordis": "^4.0.2",
98
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.2 || ^0.2.0-rc.2",
99
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-rc.2 || ^0.2.0-rc.2",
100
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.2 || ^0.2.0-rc.2",
101
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.5-rc.2 || ^0.2.0-rc.2",
102
- "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.5-rc.2 || ^0.2.0-rc.2",
103
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.2 || ^0.2.0-rc.2",
104
- "@deepseek-ai/dsh-compaction": "^0.1.5-rc.2 || ^0.2.0-rc.2",
105
- "@deepseek-ai/dsh-agent-presets": "^0.1.5-rc.2 || ^0.2.0-rc.2",
106
- "@deepseek-ai/dsh-host-webserver": "^0.1.5-rc.2 || ^0.2.0-rc.2",
107
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.2 || ^0.2.0-rc.2",
108
- "@deepseek-ai/dsh-session": "^0.1.5-rc.2 || ^0.2.0-rc.2",
109
- "@deepseek-ai/dsh-session-persistence": "^0.1.5-rc.2 || ^0.2.0-rc.2",
110
- "@deepseek-ai/dsh-session-projection": "^0.1.5-rc.2 || ^0.2.0-rc.2",
111
- "@deepseek-ai/dsh-settings": "^0.1.5-rc.2 || ^0.2.0-rc.2",
112
- "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2 || ^0.2.0-rc.2",
113
- "@deepseek-ai/dsh-workspace": "^0.1.5-rc.2 || ^0.2.0-rc.2",
114
- "@deepseek-ai/dsh-web-app": "^0.1.5-rc.2 || ^0.2.0-rc.2",
115
- "@deepseek-ai/schemastery": "^3.18.2",
103
+ "@deepseek-ai/cordis": "^4.0.2 || ^4.0.5-alpha.2",
104
+ "@deepseek-ai/dsh-agent": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
105
+ "@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
106
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
107
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
108
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
109
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
110
+ "@deepseek-ai/dsh-compaction": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
111
+ "@deepseek-ai/dsh-host-webserver": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
112
+ "@deepseek-ai/dsh-llm": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
113
+ "@deepseek-ai/dsh-session": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
114
+ "@deepseek-ai/dsh-session-persistence": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
115
+ "@deepseek-ai/dsh-session-projection": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
116
+ "@deepseek-ai/dsh-settings": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
117
+ "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
118
+ "@deepseek-ai/dsh-workspace": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
119
+ "@deepseek-ai/dsh-web-app": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
120
+ "@deepseek-ai/schemastery": "^3.18.2 || ^3.18.5-alpha.2",
116
121
  "react": "^18.2.0",
117
122
  "react-dom": "^18.2.0",
118
123
  "zod": "^4.4.3",
119
- "@deepseek-ai/dsh-api-session-controller": "^0.1.5-rc.2 || ^0.2.0-rc.2",
120
- "@deepseek-ai/dsh-api-workspace-controller": "^0.1.5-rc.2 || ^0.2.0-rc.2",
121
- "@deepseek-ai/dsh-client-ui-chat": "^0.1.5-rc.2 || ^0.2.0-rc.2",
122
- "@deepseek-ai/dsh-client-ui-session": "^0.1.5-rc.2 || ^0.2.0-rc.2",
123
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.2 || ^0.2.0-rc.2",
124
- "@deepseek-ai/dsh-client-store": "^0.1.5-rc.2 || ^0.2.0-rc.2",
125
- "@deepseek-ai/dsh-llm-retry": "^0.1.5-rc.2 || ^0.2.0-rc.2",
126
- "@deepseek-ai/dsh-session-title": "^0.1.5-rc.2 || ^0.2.0-rc.2",
127
- "@deepseek-ai/dsh-client-ui-layout": "^0.1.5-rc.2 || ^0.2.0-rc.2"
124
+ "@deepseek-ai/dsh-api-session-controller": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
125
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
126
+ "@deepseek-ai/dsh-client-ui-chat": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
127
+ "@deepseek-ai/dsh-client-ui-session": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
128
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
129
+ "@deepseek-ai/dsh-client-store": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
130
+ "@deepseek-ai/dsh-llm-retry": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
131
+ "@deepseek-ai/dsh-session-title": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5",
132
+ "@deepseek-ai/dsh-client-ui-layout": "^0.1.5-rc.2 || ^0.2.0-rc.2 || ^0.2.1-alpha.5"
128
133
  },
129
134
  "devDependencies": {
130
- "@deepseek-ai/cordis": "^4.0.2",
131
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.2",
132
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.5-rc.2",
133
- "@deepseek-ai/dsh-client-ui-layout": "^0.1.5-rc.2",
134
- "@deepseek-ai/dsh-client-ui-primitives": "^0.1.5-rc.2",
135
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.5-rc.2",
136
- "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.5-rc.2",
137
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.5-rc.2",
138
- "@deepseek-ai/dsh-compaction": "^0.1.5-rc.2",
139
- "@deepseek-ai/dsh-agent-presets": "^0.1.5-rc.2",
140
- "@deepseek-ai/dsh-host-webserver": "^0.1.5-rc.2",
141
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.2",
142
- "@deepseek-ai/dsh-session": "^0.1.5-rc.2",
143
- "@deepseek-ai/dsh-session-persistence": "^0.1.5-rc.2",
144
- "@deepseek-ai/dsh-session-projection": "^0.1.5-rc.2",
145
- "@deepseek-ai/dsh-settings": "^0.1.5-rc.2",
146
- "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2",
147
- "@deepseek-ai/dsh-workspace": "^0.1.5-rc.2",
148
- "@deepseek-ai/dsh-web-app": "^0.1.5-rc.2",
149
- "@deepseek-ai/schemastery": "^3.18.2",
135
+ "@deepseek-ai/dsh": "0.2.1-rc.2",
136
+ "@deepseek-ai/cordis": "4.0.5",
137
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.2",
138
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.2",
139
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.1-rc.2",
140
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.2",
141
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.2",
142
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.2.1-rc.2",
143
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.2",
144
+ "@deepseek-ai/dsh-compaction": "0.2.1-rc.2",
145
+ "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.2",
146
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
147
+ "@deepseek-ai/dsh-session": "0.2.1-rc.2",
148
+ "@deepseek-ai/dsh-session-persistence": "0.2.1-rc.2",
149
+ "@deepseek-ai/dsh-session-projection": "0.2.1-rc.2",
150
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.2",
151
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
152
+ "@deepseek-ai/dsh-workspace": "0.2.1-rc.2",
153
+ "@deepseek-ai/dsh-web-app": "0.2.1-rc.2",
154
+ "@deepseek-ai/schemastery": "3.18.5",
150
155
  "@types/node": "^24.0.0",
151
156
  "@types/react": "^18.3.0",
152
157
  "@types/react-dom": "^18.3.0",
@@ -155,16 +160,20 @@
155
160
  "react-dom": "^18.3.1",
156
161
  "typescript": "^5.9.2",
157
162
  "vitest": "^4.0.0",
158
- "zod": "^4.4.3",
159
- "@deepseek-ai/dsh-api-session-controller": "^0.1.5-rc.2",
160
- "@deepseek-ai/dsh-api-workspace-controller": "^0.1.5-rc.2",
161
- "@deepseek-ai/dsh-client-ui-chat": "^0.1.5-rc.2",
162
- "@deepseek-ai/dsh-client-ui-session": "^0.1.5-rc.2",
163
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.5-rc.2",
164
- "@deepseek-ai/dsh-client-store": "^0.1.5-rc.2",
165
- "@deepseek-ai/dsh-llm-retry": "^0.1.5-rc.2",
163
+ "zod": "4.4.3",
164
+ "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.2",
165
+ "@deepseek-ai/dsh-api-workspace-controller": "0.2.1-rc.2",
166
+ "@deepseek-ai/dsh-client-ui-chat": "0.2.1-rc.2",
167
+ "@deepseek-ai/dsh-client-ui-session": "0.2.1-rc.2",
168
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.2",
169
+ "@deepseek-ai/dsh-client-store": "0.2.1-rc.2",
170
+ "@deepseek-ai/dsh-llm-retry": "0.2.1-rc.2",
166
171
  "happy-dom": "^20.14.0",
167
- "@deepseek-ai/dsh-session-title": "^0.1.5-rc.2",
168
- "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.5-rc.2"
172
+ "@deepseek-ai/dsh-session-title": "0.2.1-rc.2",
173
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-rc.2",
174
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.2",
175
+ "@deepseek-ai/cordis-plugin-include": "1.0.10",
176
+ "@deepseek-ai/cordis-plugin-loader": "1.0.6",
177
+ "@deepseek-ai/cordis-plugin-group": "1.0.5"
169
178
  }
170
179
  }