@dsh-electron/dsh-plugin-multi-root-workspace 0.1.11 → 0.1.13

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 (52) hide show
  1. package/CHANGELOG.en.md +25 -1
  2. package/CHANGELOG.md +25 -1
  3. package/README.en.md +10 -8
  4. package/README.md +10 -8
  5. package/cordis.patch.yml +7 -2
  6. package/lib/auto-review.js +1 -1
  7. package/lib/client.js +197 -74
  8. package/lib/client.js.map +1 -1
  9. package/lib/{command-BGdz7VBH.js → command-B9855H7y.js} +3 -2
  10. package/lib/command.js +1 -1
  11. package/lib/{compat-BiW-m_q0.js → compat-Bg2HFVMX.js} +3 -0
  12. package/lib/compat.js +1 -1
  13. package/lib/{sandbox-CXk5h-ct.js → dialects-Dr4rDR-H.js} +6 -264
  14. package/lib/{fs-BTXySwSG.js → fs-CfzJq2wd.js} +23 -8
  15. package/lib/fs.js +1 -1
  16. package/lib/index.js +7 -6
  17. package/lib/{instructions-MePoRigy.js → instructions-KsUwUFE0.js} +53 -37
  18. package/lib/instructions.js +1 -1
  19. package/lib/lsp.js +19 -16
  20. package/lib/native-win32-2waCRkPI.js +312 -0
  21. package/lib/process-fence.js +62 -12
  22. package/lib/protocol-CJOvAvOS.js +652 -0
  23. package/lib/{registry-KSsmU393.js → registry-Bv431TfO.js} +717 -74
  24. package/lib/registry-operation-C2ZV3Jhw.js +116 -0
  25. package/lib/registry.js +3 -2
  26. package/lib/{review-context-AH-SXHmj.js → review-context-NDpKeMCc.js} +1 -1
  27. package/lib/review-context.js +1 -1
  28. package/lib/sandbox-C-vCJCp3.js +278 -0
  29. package/lib/sandbox.js +1 -1
  30. package/lib/scope.js +101 -11
  31. package/lib/skills.js +48 -29
  32. package/lib/types/authority/native-win32.d.ts +7 -0
  33. package/lib/types/authority/native.d.ts +23 -0
  34. package/lib/types/authority/protocol.d.ts +70 -0
  35. package/lib/types/authority/recovery.d.ts +58 -0
  36. package/lib/types/client/RootSwitcher.d.ts +6 -3
  37. package/lib/types/client/files-tree/adapter.d.ts +63 -1
  38. package/lib/types/compat/authority-storage.d.ts +6 -0
  39. package/lib/types/compat/dsh-version.d.ts +4 -4
  40. package/lib/types/compat/open-in-app-device.d.ts +1 -1
  41. package/lib/types/compat/process-entrypoints.d.ts +2 -0
  42. package/lib/types/compat/process-profile.d.ts +3 -0
  43. package/lib/types/compat/sandbox-confine.d.ts +2 -0
  44. package/lib/types/fs.d.ts +4 -1
  45. package/lib/types/instructions.d.ts +0 -47
  46. package/lib/types/registry-operation.d.ts +31 -0
  47. package/lib/types/registry.d.ts +145 -6
  48. package/lib/types/scope.d.ts +28 -0
  49. package/lib/types/skills/catalog.d.ts +3 -0
  50. package/lib/types/skills/pool.d.ts +1 -1
  51. package/lib/workspace-files.js +63 -7
  52. package/package.json +38 -31
package/CHANGELOG.en.md CHANGED
@@ -8,6 +8,28 @@ This file records the user-visible changes of every **released** version.
8
8
  - For installation sources, the supported upstream runtimes, and known limitations, see the [README](./README.en.md).
9
9
  - The evidence, numbering, and release state of each version live in the [roadmap progress ledger](./docs/plans/active/2026-09-12-multi-root-workspace.md#进度总账). The body of each GitHub Release is generated from the commit history by `scripts/release-notes.mjs` and is the complete raw list behind this file.
10
10
 
11
+ ## [0.1.13] - 2026-10-31
12
+
13
+ ### Added
14
+
15
+ - **Background recovery for the shared Registry (on by default)**: when Hosts share a registry, retryable authority contention, disconnections, and storage-open failures are retried automatically with backoff and jitter. A follower is considered recovered only after it has resynchronized its tracked primary roots. Set `backgroundRecovery: false` on `multi-root-registry` to disable background retries; on-demand recovery remains available. Configuration errors and writes with an unknown state still require configuration correction or a restart. Recovery preserves deny boundaries, every new operation still requires admission, and mutations with an unknown result are never replayed automatically. Read-only diagnostics and deduplicated transition logs help diagnose failures ([ADR-0026](./docs/decisions/ADR-0026-registry-background-recovery.md)).
16
+
17
+ ### Fixed
18
+
19
+ - **Files tab retains its selected root when opening a file**: when opening a file in an additional root unmounts and remounts the Files tab, its selected root, expanded directories, and scroll position are retained. A pending or failed list request no longer resets the selection to the primary root; closing the tab cleans up watches and tree resources.
20
+ - **Shared-authority recovery safety and consistency**: a retry cannot bypass a failed storage-to-lock binding check. Recovery synchronizes root projections and publishes consistent state in a batch; empty snapshots clear stale boundaries, and failed recovery rounds no longer generate repeated notifications. On Windows, the request timer stays active during the connection handshake so the process cannot exit prematurely.
21
+
22
+ ## [0.1.12] - 2026-10-30
23
+
24
+ ### Added
25
+
26
+ - **Multiple Hosts can use additional roots at the same time (on by default)**: the bundle now configures a shared storage authority (`sharedStorageRoot`) — previously only the Host holding the store lease could use additional roots, and a second Host sharing the same registry was fail-closed. Now a single owner opens the storage medium and manages persistence, while the other Hosts read and write through their own Registry facades over kernel-authenticated local IPC; every mutation and each new operation's admission is ordered at the owner: operations that arrive after a revocation are refused immediately, ones admitted before it may finish, and a disconnect preserves the established deny boundary; when the owner exits or crashes a follower contends, takes over, and recovers under a new epoch, and a lost committed reply is never replayed. Copied exec argv and expired handles cannot stand in for a fresh admission, the synchronous confine/spawn entry points keep their return shape, and every consumer path (fs, sandbox, shell/PTC/agent PTY, LSP, Files/watch, instructions, Skills) goes through admission. Profiles without `sharedStorageRoot` keep the legacy contended-fail-closed behavior ([ADR-0024](./docs/decisions/ADR-0024-registry-operation-admission.md), [ADR-0025](./docs/decisions/ADR-0025-shared-registry-authority.md), [shared service architecture](./docs/architecture/registry-authority-service.md)).
27
+ - **Exact support for DSH `0.2.1-rc.5`**: the delta from `0.2.1-rc.4` does not touch this plugin's interfaces, so no new adapter branch is needed; the dev pin stays at `0.2.2-alpha.2` and the support matrix now covers 20 exact releases.
28
+
29
+ ### Changed
30
+
31
+ - **Dependency security floors raised**: the plugin's direct `zod` floor moves to `^4.6.7`; on the development side `vitest` moves to `^4.1.12`, and `@modelcontextprotocol/sdk` `^1.32.2` is declared explicitly to keep GenAI's optional `mcpToTool` capability on a fixed release. The full development tree's advisories drop from 1 critical / 17 high / 27 moderate to 5 high / 6 moderate; the remaining advisories in host trees are introduced by DSH's own exact pins (e.g. zod `4.4.3`, Undici `8.11.2`) and are not resolved by this plugin release ([dependency security review](./docs/troubleshooting/dependency-security-alerts.md)).
32
+
11
33
  ## [0.1.11] - 2026-10-29
12
34
 
13
35
  ### Added
@@ -192,7 +214,9 @@ The first release: the three MVP milestones (M1–M3).
192
214
 
193
215
  - All eight findings of the pre-release external review (three of them release-blocking) are fixed, each with a regression test: a registered directory replaced by a symlink transplanting its authority (which introduced `recordedPath` — **re-resolving a path is not re-authorizing it**), concurrent registry mutations losing a write or reviving a revoked grant (per-primary-root mutations are serialized), a refresh not re-checking directories, a typed path being overwritten by the directory picker, the `reveal` response contract and failure code, duplicate ids not validated, the primary root missing from nesting validation, and CI testing before building.
194
216
 
195
- [Unreleased]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.11...HEAD
217
+ [Unreleased]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.13...HEAD
218
+ [0.1.13]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.12...v0.1.13
219
+ [0.1.12]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.11...v0.1.12
196
220
  [0.1.11]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.10...v0.1.11
197
221
  [0.1.10]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.9...v0.1.10
198
222
  [0.1.9]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.8...v0.1.9
package/CHANGELOG.md CHANGED
@@ -8,6 +8,28 @@ English: [CHANGELOG.en.md](./CHANGELOG.en.md)
8
8
  - 安装方式、受支持的上游运行时与已知限制见 [README](./README.md)。
9
9
  - 每个版本的实施证据、编号口径与发布状态见[路线图 §进度总账](./docs/plans/active/2026-09-12-multi-root-workspace.md#进度总账);GitHub Release 的正文由 `scripts/release-notes.mjs` 从 commit 历史生成,是本文件之外的完整原始清单。
10
10
 
11
+ ## [0.1.13] - 2026-10-31
12
+
13
+ ### Added
14
+
15
+ - **共享 Registry 后台恢复(默认开启)**:多个 Host 共享登记表时,可重试的权威争用、断线或存储打开失败会以退避和抖动自动重试;follower 重新同步已跟踪主根后才视为恢复。`multi-root-registry` 的 `backgroundRecovery: false` 可关闭后台重试,按需恢复仍可用;配置错误和状态不明的写入仍需修正配置或重启。恢复期间继续保留拒绝边界,每个新操作仍须授权,结果不明的变更不会自动重放。只读诊断信息和去重的状态转换日志有助于排查故障([ADR-0026](./docs/decisions/ADR-0026-registry-background-recovery.md))。
16
+
17
+ ### Fixed
18
+
19
+ - **Files 页签打开文件后保留所选根**:打开附加根中的文件导致 Files 页签卸载并重新挂载时,保留该页签所选的根、目录展开状态与滚动位置;列表尚未应答或请求失败不会误将选择切回主根,关闭页签时会清理监听与目录树资源。
20
+ - **共享权威恢复的安全性和一致性**:介质与锁绑定校验失败后重试不能绕过校验;恢复时同步根投影并批量发布一致的状态,空快照能清除过期边界,失败的恢复轮次不再产生重复通知。Windows 连接握手期间保持请求计时器有效,避免进程提前退出。
21
+
22
+ ## [0.1.12] - 2026-10-30
23
+
24
+ ### Added
25
+
26
+ - **多个 Host 可同时使用附加根(默认开启)**:bundle 现默认配置共享存储权威(`sharedStorageRoot`)——此前只有持有 store 租约的 Host 能使用附加根,共享同一登记的第二个 Host 一律 fail-closed。现在唯一 owner 打开存储介质并管理持久化,其余 Host 经本机内核认证的 IPC 通过各自的 Registry facade 读写;所有变更与每个新操作的授权在 owner 处统一排序:撤权后的新操作立即被拒,撤权前已准入的操作可以完成,断线/失联时保留既有拒绝边界;owner 退出或崩溃时 follower 竞选接管并以新 epoch 恢复,丢失的已提交应答不会自动重放。已复制的执行参数与过期句柄不能顶替新准入,同步 confine/spawn 入口保持原有返回形状;fs、sandbox、shell/PTC/agent PTY、LSP、Files/watch、指令与 Skills 消费路径全部接入准入。未启用 `sharedStorageRoot` 的 profile 保留旧的「争用即 fail-closed」行为([ADR-0024](./docs/decisions/ADR-0024-registry-operation-admission.md)、[ADR-0025](./docs/decisions/ADR-0025-shared-registry-authority.md)、[共享服务架构](./docs/architecture/registry-authority-service.md))。
27
+ - **精确支持 DSH `0.2.1-rc.5`**:相对 `0.2.1-rc.4` 没有触及本插件的接口变化,不新增适配分支;开发 pin 保持 `0.2.2-alpha.2`,支持矩阵现为 20 个精确版本。
28
+
29
+ ### Changed
30
+
31
+ - **依赖安全下限提升**:本插件直接依赖的 `zod` 下限升至 `^4.6.7`;开发侧 `vitest` 升至 `^4.1.12`,并显式声明 `@modelcontextprotocol/sdk` `^1.32.2` 以保留 GenAI `mcpToTool` 的可选能力。完整开发树的公告告警从 1 critical / 17 high / 27 moderate 降为 5 high / 6 moderate;宿主树中剩余告警均由 DSH 精确 pin 引入(如 zod `4.4.3`、Undici `8.11.2`),不随本插件版本解决([依赖安全排查](./docs/troubleshooting/dependency-security-alerts.md))。
32
+
11
33
  ## [0.1.11] - 2026-10-29
12
34
 
13
35
  ### Added
@@ -192,7 +214,9 @@ English: [CHANGELOG.en.md](./CHANGELOG.en.md)
192
214
 
193
215
  - 发布前外部评审提出的 8 项发现(其中 3 项发布阻断)全部修复,每项各带一个回归测试:登记目录被替换为符号链接后授权转移(引入 `recordedPath`,**重新解析路径不等于重新授权**)、并发修改注册表丢写或复活已撤销的授权(每个主根的变更串行)、刷新不重新检查目录、手输路径被目录选择器覆盖、`reveal` 的应答契约与失败码、重复 id 未校验、主根未纳入嵌套校验、CI 先测后构建。
194
216
 
195
- [Unreleased]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.11...HEAD
217
+ [Unreleased]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.13...HEAD
218
+ [0.1.13]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.12...v0.1.13
219
+ [0.1.12]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.11...v0.1.12
196
220
  [0.1.11]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.10...v0.1.11
197
221
  [0.1.10]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.9...v0.1.10
198
222
  [0.1.9]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.8...v0.1.9
package/README.en.md CHANGED
@@ -16,11 +16,12 @@ Not every project is a monorepo. A real development project is usually several i
16
16
 
17
17
  - **No new tools**: the agent keeps using the native `read` / `write` / `edit` / `bash`; only the granted directories grow.
18
18
  - **Sandbox confinement**: an additional root may inherit the session's (primary root's) permission setting, or be pinned to read-only or read-write; under read-only and read-write, confinement does not rest on system prompts — it is enforced by an in-process filesystem fence plus kernel-level sandboxes (macOS Seatbelt / Linux bwrap / Landlock / Windows ACL), with files and bash sharing one and the same scope.
19
+ - **Browse additional roots in the Files tab**: the Files tab header switches between the primary root and any registered additional root; an additional root's directory renders in the same native Files view, with open-file, open-in-app, and auto-refresh behaving identically.
19
20
  - **Optional Auto review (off by default)**: a fork of upstream's experimental auto-review that gives the reviewer the additional directories' context — the current workspace topology, each root's access level, and live instruction files; it ships disabled and only takes effect once the `@dsh-electron/dsh-plugin-multi-root-workspace/auto-review` row is explicitly enabled in the Plugin Manager row list, taking over the official bundle while on.
20
21
  - **Additional-root Skills**: discovers `.dsh/skills` and `.agents/skills` inside additional folders, invoked through the namespaced `/alias-id:skill-name` reference and the native `skill` tool; each root has an independent toggle and editable `aliasId`, with a global setting that defaults to on.
21
22
  - **Absent when absent**: with no additional root configured, its behavior is item-for-item identical to an uninstalled harness; every misconfiguration fails loudly instead of silently degrading.
22
23
 
23
- Current released version: `v0.1.11`. The user-visible changes of each version live in the [CHANGELOG](./CHANGELOG.en.md); progress and release state live in the [roadmap progress ledger](./docs/plans/active/2026-09-12-multi-root-workspace.md#进度总账).
24
+ Current released version: `v0.1.13`. The user-visible changes of each version live in the [CHANGELOG](./CHANGELOG.en.md); progress and release state live in the [roadmap progress ledger](./docs/plans/active/2026-09-12-multi-root-workspace.md#进度总账).
24
25
 
25
26
  ## Quick Start
26
27
 
@@ -49,7 +50,7 @@ The agent can now read, write, and run bash in that directory — the default is
49
50
  | `0.1.6` | `0.1.6-alpha.1`, `0.1.6-alpha.2` |
50
51
  | `0.1.7` | `0.1.7-alpha.1`, `0.1.7-alpha.2`, `0.1.7-rc.1`, `0.1.7-rc.2` |
51
52
  | `0.2.0` | `0.2.0-rc.1`, `0.2.0-rc.2` |
52
- | `0.2.1` | `0.2.1-alpha.1`, `0.2.1-alpha.2`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.1`, `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4` |
53
+ | `0.2.1` | `0.2.1-alpha.1`, `0.2.1-alpha.2`, `0.2.1-alpha.3`, `0.2.1-alpha.4`, `0.2.1-alpha.5`, `0.2.1-rc.1`, `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4`, `0.2.1-rc.5` |
53
54
  | `0.2.2` | `0.2.2-alpha.2` |
54
55
 
55
56
  The plugin does not start — as if it were not installed — when the DSH release is not in the table or the `@deepseek-ai/dsh-*` packages disagree on a version.
@@ -93,8 +94,8 @@ This installs pre-built artifacts; the first install needs the `allowBuilds` add
93
94
  ```sh
94
95
  pnpm pack @dsh-electron/dsh-plugin-multi-root-workspace
95
96
  # or download the tgz from the GitHub Release assets, e.g.:
96
- # https://github.com/cherrchen/dsh-plugin-multi-root-workspace/releases/download/v0.1.11/dsh-electron-dsh-plugin-multi-root-workspace-0.1.11.tgz
97
- dsh plugin --profile web add ./dsh-electron-dsh-plugin-multi-root-workspace-0.1.11.tgz
97
+ # https://github.com/cherrchen/dsh-plugin-multi-root-workspace/releases/download/v0.1.13/dsh-electron-dsh-plugin-multi-root-workspace-0.1.13.tgz
98
+ dsh plugin --profile web add ./dsh-electron-dsh-plugin-multi-root-workspace-0.1.13.tgz
98
99
  ```
99
100
 
100
101
  Also pre-built, handy for air-gapped or offline delivery; the first install needs the same `allowBuilds` addition.
@@ -113,10 +114,10 @@ allowBuilds:
113
114
  koffi: true
114
115
  ```
115
116
 
116
- Pinning a version (e.g. `#v0.1.11`) is recommended so a later push cannot silently change what actually runs:
117
+ Pinning a version (e.g. `#v0.1.13`) is recommended so a later push cannot silently change what actually runs:
117
118
 
118
119
  ```sh
119
- dsh plugin --profile web add github:cherrchen/dsh-plugin-multi-root-workspace#v0.1.11
120
+ dsh plugin --profile web add github:cherrchen/dsh-plugin-multi-root-workspace#v0.1.13
120
121
  ```
121
122
 
122
123
  ### Install from a local clone
@@ -181,6 +182,7 @@ Expected output:
181
182
  - id: multi-root-registry
182
183
  name: '@dsh-electron/dsh-plugin-multi-root-workspace/registry'
183
184
  config:
185
+ sharedStorageRoot: !!js dshHomePath('storages')
184
186
  leasePath: !!js dshHomePath('storages/multi_root_workspace.lock')
185
187
  maxAdditionalRoots: 16
186
188
  - id: multi-root-instructions
@@ -260,7 +262,7 @@ For multi-root reviewer context, enable the default-disabled [Auto Review row](.
260
262
  .
261
263
  ├── src/
262
264
  │ ├── roots.ts pure rules: canonicalization, conflict validation, record classification (available/missing/redirected/invalid)
263
- │ ├── registry.ts the root registry: dsh-storage-domain persistence, mutations of one primary root serialized in one queue
265
+ │ ├── registry.ts one storage core and Host facades, store-wide ordering of mutations and admissions
264
266
  │ ├── registry-lease.ts cross-process Registry Authority: POSIX flock (the kernel releases it on process death)
265
267
  │ ├── registry-lease-win32.ts ditto, the Windows named-semaphore implementation
266
268
  │ ├── scope.ts ctx.multiRootScope: the single authorization source, plus the model-visible topology snapshot
@@ -295,7 +297,7 @@ Issues and PRs are welcome:
295
297
  ## Known Limitations
296
298
 
297
299
  - An additional root's instruction files arrive as they become relevant: the one at the root's top level is injected before the session's first step, and a subdirectory's is injected once the session has **successfully** worked in that directory. A nested file is re-examined only when its directory is examined (the root's own every step; a subdirectory's because it was delivered from, or because of a fresh touch), delivery state is in-process (so a resumed session may be told again), and only the `read` / `write` / `edit` tool names count. The primary root's chain and the user-global file remain upstream's job, and this plugin does not inject them a second time ([ADR-0010](./docs/decisions/ADR-0010-additional-root-instruction-scope.md)).
298
- - Single writer per store: only one DSH process at a time may hold the root registry for a given `$DSH_HOME`; another process reports the registry as unavailable (`registry-contended`) and takes over on refresh once the holder exits or crashes. That is deliberate fail-closed behavior, not a race waiting to be fixed ([ADR-0007](./docs/decisions/ADR-0007-registry-authority-lease.md)).
300
+ - Hosts share one Registry service: one Host owns storage and each instance obtains admission for new operations. Disconnection stops new additional-root grants; a successor takes over through the kernel lease. Sharing is local to one user and lock namespace; Linux requires SO_PEERPIDFD, and Windows is limited to one login session. Existing processes and PTYs retain their launch snapshot ([architecture](./docs/architecture/registry-authority-service.md), Chinese).
299
301
  - The supported matrix is an exact-version allowlist: on a host whose release is not on the list, or whose core packages disagree about the release, the `fs` / `sandbox` / `registry` / `instructions` / `lsp` / `workspace-files` rows **do not start** and the composition degrades to "the plugin is not installed" ([ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md)).
300
302
  - The Windows multi-root runner inherits upstream partial enforcement, caller-owned directory requirements, and private-temp isolation. Running processes retain their initial roots; later processes use the updated set ([ADR-0011](./docs/decisions/ADR-0011-multi-root-workspace-consumers.md)).
301
303
  - **Network and device paths cannot be additional roots on Windows**: UNC (`\\server\share`), `\\?\`, `\\.\`, and mapped network drives are rejected at registration with `unsupported-path` — the restricted token's capability SID cannot be shown to bind SMB access ([ADR-0011 amendment](./docs/decisions/ADR-0011-multi-root-workspace-consumers.md)).
package/README.md CHANGED
@@ -16,11 +16,12 @@
16
16
 
17
17
  - **不新增工具**:Agent 照旧使用原生 `read` / `write` / `edit` / `bash`,只是授权的目录变多了。
18
18
  - **沙箱约束**:附加根可继承会话(主目录)的权限设置,也可单独固定为只读或读写;在只读与读写下,约束不靠系统提示词,而由进程内文件围栏 + 内核级沙箱(macOS Seatbelt / Linux bwrap / Landlock / Windows ACL)执行,文件与 bash 共享同一份授权范围。
19
+ - **Files 页签浏览附加根**:Files 页签头部可直接在主根与任一已登记附加根之间切换,附加根的目录树以与主根相同的原生 Files 视图呈现,打开文件、在外部应用打开、自动刷新等操作完全一致。
19
20
  - **可选 Auto review(默认关闭)**:fork 上游实验性「自动授权审查」,向 Reviewer 补充附加目录的审查上下文——当前工作区拓扑、各根访问级别与实时指令文件;出厂关闭,需在插件管理器的行列表中显式打开 `@dsh-electron/dsh-plugin-multi-root-workspace/auto-review` 行后生效,启用时接管官方同名 bundle。
20
21
  - **附属根 Skills**:发现附属目录的 `.dsh/skills` 与 `.agents/skills`,附属根经 `/alias-id:skill-name` 命名空间调用原生 `skill` 工具;每根独立开关、可编辑 `aliasId`,全局设置默认开启。
21
22
  - **不配等于没装**:未登记附加根时行为与未装插件逐项一致;配置错误一律明确报错,从不静默降级。
22
23
 
23
- 当前发布版本 `v0.1.11`。各版本的用户可见变更见 [CHANGELOG](./CHANGELOG.md);进度与发布状态见[路线图 §进度总账](./docs/plans/active/2026-09-12-multi-root-workspace.md#进度总账)。
24
+ 当前发布版本 `v0.1.13`。各版本的用户可见变更见 [CHANGELOG](./CHANGELOG.md);进度与发布状态见[路线图 §进度总账](./docs/plans/active/2026-09-12-multi-root-workspace.md#进度总账)。
24
25
 
25
26
  ## 快速开始
26
27
 
@@ -51,7 +52,7 @@ tarball、GitHub、本地源码等其他安装方式见[安装](#安装)。
51
52
  | `0.1.6` | `0.1.6-alpha.1`、`0.1.6-alpha.2` |
52
53
  | `0.1.7` | `0.1.7-alpha.1`、`0.1.7-alpha.2`、`0.1.7-rc.1`、`0.1.7-rc.2` |
53
54
  | `0.2.0` | `0.2.0-rc.1`、`0.2.0-rc.2` |
54
- | `0.2.1` | `0.2.1-alpha.1`、`0.2.1-alpha.2`、`0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.1`、`0.2.1-rc.2`、`0.2.1-rc.3`、`0.2.1-rc.4` |
55
+ | `0.2.1` | `0.2.1-alpha.1`、`0.2.1-alpha.2`、`0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`、`0.2.1-rc.1`、`0.2.1-rc.2`、`0.2.1-rc.3`、`0.2.1-rc.4`、`0.2.1-rc.5` |
55
56
  | `0.2.2` | `0.2.2-alpha.2` |
56
57
 
57
58
  DSH 版本不在表内、或 `@deepseek-ai/dsh-*` 各包版本不一致时,插件不会启动,行为等同没装。
@@ -95,8 +96,8 @@ dsh plugin --profile web add @dsh-electron/dsh-plugin-multi-root-workspace
95
96
  ```sh
96
97
  pnpm pack @dsh-electron/dsh-plugin-multi-root-workspace
97
98
  # 或从 GitHub Release 资产下载,例如:
98
- # https://github.com/cherrchen/dsh-plugin-multi-root-workspace/releases/download/v0.1.11/dsh-electron-dsh-plugin-multi-root-workspace-0.1.11.tgz
99
- dsh plugin --profile web add ./dsh-electron-dsh-plugin-multi-root-workspace-0.1.11.tgz
99
+ # https://github.com/cherrchen/dsh-plugin-multi-root-workspace/releases/download/v0.1.13/dsh-electron-dsh-plugin-multi-root-workspace-0.1.13.tgz
100
+ dsh plugin --profile web add ./dsh-electron-dsh-plugin-multi-root-workspace-0.1.13.tgz
100
101
  ```
101
102
 
102
103
  同样是预构建产物,适合内网或离线环境交付;首次安装同样需要添加 `allowBuilds`。
@@ -115,10 +116,10 @@ allowBuilds:
115
116
  koffi: true
116
117
  ```
117
118
 
118
- 建议锁定版本(如 `#v0.1.11`),让后续推送无法悄悄改变实际运行的内容:
119
+ 建议锁定版本(如 `#v0.1.13`),让后续推送无法悄悄改变实际运行的内容:
119
120
 
120
121
  ```sh
121
- dsh plugin --profile web add github:cherrchen/dsh-plugin-multi-root-workspace#v0.1.11
122
+ dsh plugin --profile web add github:cherrchen/dsh-plugin-multi-root-workspace#v0.1.13
122
123
  ```
123
124
 
124
125
  ### 从本地源码安装
@@ -183,6 +184,7 @@ dsh --profile web --dump-config | grep -A3 'multi-root'
183
184
  - id: multi-root-registry
184
185
  name: '@dsh-electron/dsh-plugin-multi-root-workspace/registry'
185
186
  config:
187
+ sharedStorageRoot: !!js dshHomePath('storages')
186
188
  leasePath: !!js dshHomePath('storages/multi_root_workspace.lock')
187
189
  maxAdditionalRoots: 16
188
190
  - id: multi-root-instructions
@@ -262,7 +264,7 @@ Settings → Plugins → Multi-root Workspace 中的 **启用附属根 Skills**
262
264
  .
263
265
  ├── src/
264
266
  │ ├── roots.ts 纯规则层:canonical 化、冲突校验、登记状态分类(available/missing/redirected/invalid)
265
- │ ├── registry.ts 根注册表:dsh-storage-domain 持久化,同一主根的变更在一条队列里串行
267
+ │ ├── registry.ts 根注册表:dsh-storage-domain 持久化,唯一存储核心与 Host facade,store-wide 准入/变更排序
266
268
  │ ├── registry-lease.ts 跨进程 Registry Authority:POSIX flock(进程死亡由内核释放)
267
269
  │ ├── registry-lease-win32.ts 同上,Windows named semaphore 实现
268
270
  │ ├── scope.ts ctx.multiRootScope:唯一的授权源,兼发模型可见的拓扑快照
@@ -297,7 +299,7 @@ Settings → Plugins → Multi-root Workspace 中的 **启用附属根 Skills**
297
299
  ## 已知限制
298
300
 
299
301
  - 附加根的指令文件按需到达模型:根目录顶层的那一份在会话第一步之前注入,子目录里的那一份在本会话**成功**触碰过该目录之后注入;nested 文件只会在其目录被考察到时重新检查(根层每一步,子目录依赖已投递或有新触碰),投递状态是进程内的(resume 后可能再告知一次),也只识别 `read` / `write` / `edit` 三个工具名。主根与 user-global 的指令链仍由上游负责,本插件不重复注入([ADR-0010](./docs/decisions/ADR-0010-additional-root-instruction-scope.md))。
300
- - 跨进程单写者:同一 `$DSH_HOME` 上同时只允许一个 DSH 进程持有根登记表;另一个进程显示登记表不可用(`registry-contended`),持锁者退出或崩溃后刷新即接管——这是刻意的 fail-closed,不是待修的竞态([ADR-0007](./docs/decisions/ADR-0007-registry-authority-lease.md))。
302
+ - 多 Host 共享同一登记服务:只有一个 Host 管理存储,各实例逐操作取得授权;断线停止新附加授权,权威退出后按内核锁接管。限同机器、同用户及同锁命名空间;Linux 共享连接需要 SO_PEERPIDFD,Windows 限同登录会话。旧进程/PTY 保留启动快照([共享架构](./docs/architecture/registry-authority-service.md))。
301
303
  - 支持矩阵是精确版本 allowlist:宿主版本不在清单上、或核心包混装了不同版本时,`fs` / `sandbox` / `registry` / `instructions` / `lsp` / `workspace-files` 六行**不启动**,组合退化为"没装这个插件"([ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md))。
302
304
  - Windows 多根 runner 继承上游 partial enforcement、caller-owned 目录及 private temp 分离条件;已启动进程保留启动时根集合,后续进程使用更新后的集合([ADR-0011](./docs/decisions/ADR-0011-multi-root-workspace-consumers.md))。
303
305
  - **Windows 上的网络与设备路径不能成为附加根**:UNC(`\\server\share`)、`\\?\`、`\\.\` 与映射网络盘在登记时即以 `unsupported-path` 拒绝——restricted token 的 capability SID 无法绑定 SMB 访问([ADR-0011 修订](./docs/decisions/ADR-0011-multi-root-workspace-consumers.md))。
package/cordis.patch.yml CHANGED
@@ -79,14 +79,19 @@
79
79
  - id: multi-root-registry
80
80
  name: '@dsh-electron/dsh-plugin-multi-root-workspace/registry'
81
81
  config:
82
- # Store-wide kernel lease beside the JSON domain document. A custom
83
- # storage-json.root must override this path in lockstep (ADR-0007).
82
+ # Shared authority owns this explicit JSON medium; followers use IPC.
83
+ # Change both paths together for a custom Registry store (ADR-0025).
84
+ sharedStorageRoot: !!js dshHomePath('storages')
84
85
  leasePath: !!js dshHomePath('storages/multi_root_workspace.lock')
85
86
  # Cap on stored additional-root records per primary root (integer,
86
87
  # 1..64; the count covers every state, so it is stable). A store that
87
88
  # already exceeds it keeps granting — only new adds are refused. Bench
88
89
  # evidence for the default: docs/reference/bench-root-scale-*.json.
89
90
  maxAdditionalRoots: 16
91
+ # Bounded background recovery of a degraded authority (contended,
92
+ # follower reconnect, retryable storage failure); on by default.
93
+ # Set false for on-demand recovery only (refresh still works).
94
+ backgroundRecovery: true
90
95
  # Upstream `agent-instructions` only discovers instruction files from the
91
96
  # session cwd upward, so an additional root's own AGENTS.md is invisible to
92
97
  # the model. This row closes that gap for the additional roots only; the
@@ -1,4 +1,4 @@
1
- import { n as assertAutoReviewRelease, t as MultiRootReviewContext } from "./review-context-AH-SXHmj.js";
1
+ import { n as assertAutoReviewRelease, t as MultiRootReviewContext } from "./review-context-NDpKeMCc.js";
2
2
  import { t as assertForkPackages } from "./auto-review-packages-nRjnb4pU.js";
3
3
  import { t as wrapMethod } from "./method-wrapper-CFY3p3j2.js";
4
4
  //#region src/compat/auto-review-loader.ts