@dsh-electron/dsh-plugin-multi-root-workspace 0.1.4 → 0.1.6

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 (49) hide show
  1. package/CHANGELOG.en.md +19 -2
  2. package/CHANGELOG.md +19 -2
  3. package/README.en.md +17 -13
  4. package/README.md +16 -14
  5. package/cordis.patch.yml +4 -0
  6. package/lib/client.js +320 -18
  7. package/lib/client.js.map +1 -1
  8. package/lib/{command-DyOWujPo.js → command-CTdNvwt1.js} +107 -6
  9. package/lib/command.js +1 -1
  10. package/lib/{compat-PNEKXGa6.js → compat-B6ZqbQBy.js} +23 -3
  11. package/lib/compat.js +1 -1
  12. package/lib/index.js +5 -5
  13. package/lib/{instructions-Cn1Jj5Xi.js → instructions-DfzN-wVf.js} +106 -26
  14. package/lib/instructions.js +1 -1
  15. package/lib/lsp.js +38 -0
  16. package/lib/method-wrapper-Zc-JlDP3.js +51 -0
  17. package/lib/sandbox-BRXl_FpF.js +132 -0
  18. package/lib/sandbox.js +1 -1
  19. package/lib/scope.js +12 -6
  20. package/lib/session-directory-BLOstut1.js +9 -0
  21. package/lib/tool-context-CpgIFcCB.js +6 -0
  22. package/lib/types/client/RootFileTree.d.ts +12 -0
  23. package/lib/types/client/WorkspaceFoldersAction.d.ts +3 -0
  24. package/lib/types/client/index.d.ts +13 -2
  25. package/lib/types/client/locales.d.ts +14 -0
  26. package/lib/types/client/styles.d.ts +1 -1
  27. package/lib/types/compat/client-icons.d.ts +1 -1
  28. package/lib/types/compat/client-session.d.ts +2 -0
  29. package/lib/types/compat/dsh-version.d.ts +5 -3
  30. package/lib/types/compat/instruction-overlap.d.ts +7 -0
  31. package/lib/types/compat/session-directory.d.ts +4 -0
  32. package/lib/types/compat/tool-context.d.ts +9 -0
  33. package/lib/types/compat/tool-result.d.ts +1 -1
  34. package/lib/types/compat/workspace-files.d.ts +5 -0
  35. package/lib/types/contract.d.ts +24 -5
  36. package/lib/types/index.d.ts +2 -2
  37. package/lib/types/lsp.d.ts +4 -0
  38. package/lib/types/method-wrapper.d.ts +2 -0
  39. package/lib/types/panel-files.d.ts +3 -0
  40. package/lib/types/sandbox.d.ts +2 -11
  41. package/lib/types/scope.d.ts +3 -0
  42. package/lib/types/windows-profile.d.ts +13 -0
  43. package/lib/types/windows-runner.d.ts +1 -0
  44. package/lib/types/workspace-files.d.ts +4 -0
  45. package/lib/types/workspace-routing.d.ts +11 -0
  46. package/lib/{sandbox-D8Fw95FM.js → windows-profile-CiFsFYIV.js} +64 -138
  47. package/lib/windows-runner.js +68 -0
  48. package/lib/workspace-files.js +68 -0
  49. package/package.json +90 -47
package/CHANGELOG.en.md CHANGED
@@ -8,7 +8,22 @@ 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
- ## [Unreleased]
11
+ ## [0.1.6] - 2026-10-11
12
+
13
+ ### Added
14
+
15
+ - Exact-version support for DSH `0.2.1-alpha.1` and `0.2.1-alpha.2`. Session origin is separated from the dynamic working directory, so changing cwd does not change registry ownership or authorized roots. Adds Worktree management, additional-root LSP routing, Windows kernel-enforced multi-root access, and additional-root file browsing and preview in Workspace Folders.
16
+ - Additional-root instructions are restored and re-delivered after cwd changes when still applicable.
17
+
18
+ ### Changed
19
+
20
+ - Additional-root file trees and LSP routing are isolated per root; Worktree operations do not mutate root-registry authorization.
21
+
22
+ ## [0.1.5] - 2026-09-30
23
+
24
+ ### Added
25
+
26
+ - Exact-version support for DSH `0.2.0-rc.1` and `0.2.0-rc.2`, while retaining every previously supported release. CI verifies every release in the compatibility contract across the enabled operating systems.
12
27
 
13
28
  ## [0.1.4] - 2026-09-25
14
29
 
@@ -99,7 +114,9 @@ The first release: the three MVP milestones (M1–M3).
99
114
 
100
115
  - 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.
101
116
 
102
- [Unreleased]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.4...HEAD
117
+ [Unreleased]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.6...HEAD
118
+ [0.1.6]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.5...v0.1.6
119
+ [0.1.5]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.4...v0.1.5
103
120
  [0.1.4]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.3...v0.1.4
104
121
  [0.1.3]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.2...v0.1.3
105
122
  [0.1.2]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.1...v0.1.2
package/CHANGELOG.md CHANGED
@@ -8,7 +8,22 @@ 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
- ## [Unreleased]
11
+ ## [0.1.6] - 2026-10-11
12
+
13
+ ### Added
14
+
15
+ - 精确支持 DSH `0.2.1-alpha.1` 与 `0.2.1-alpha.2`。动态 working directory 与 Session origin 分离:cwd 切换不改变注册表归属或授权根;新增 Worktree 管理、附加根 LSP 路由、Windows 内核级多根,以及 Workspace Folders 附加根文件浏览与预览。
16
+ - 附加根说明文件的 cwd 切换恢复与补发行为,避免上游撤回后遗漏仍有效的说明。
17
+
18
+ ### Changed
19
+
20
+ - 附加根文件树与 LSP 按根隔离;Worktree 操作不改变根注册表授权。
21
+
22
+ ## [0.1.5] - 2026-09-30
23
+
24
+ ### Added
25
+
26
+ - 精确支持 DSH `0.2.0-rc.1` 与 `0.2.0-rc.2`,保留此前全部支持版本。CI 会在所有启用的操作系统上验证兼容合同中的每个版本。
12
27
 
13
28
  ## [0.1.4] - 2026-09-25
14
29
 
@@ -99,7 +114,9 @@ English: [CHANGELOG.en.md](./CHANGELOG.en.md)
99
114
 
100
115
  - 发布前外部评审提出的 8 项发现(其中 3 项发布阻断)全部修复,每项各带一个回归测试:登记目录被替换为符号链接后授权转移(引入 `recordedPath`,**重新解析路径不等于重新授权**)、并发修改注册表丢写或复活已撤销的授权(每个主根的变更串行)、刷新不重新检查目录、手输路径被目录选择器覆盖、`reveal` 的应答契约与失败码、重复 id 未校验、主根未纳入嵌套校验、CI 先测后构建。
101
116
 
102
- [Unreleased]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.4...HEAD
117
+ [Unreleased]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.6...HEAD
118
+ [0.1.6]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.5...v0.1.6
119
+ [0.1.5]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.4...v0.1.5
103
120
  [0.1.4]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.3...v0.1.4
104
121
  [0.1.3]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.2...v0.1.3
105
122
  [0.1.2]: https://github.com/cherrchen/dsh-plugin-multi-root-workspace/compare/v0.1.1...v0.1.2
package/README.en.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  An out-of-tree plugin bundle for DSH (DeepSeek Harness) that widens the Workspace write scope from a single canonical directory to "**one primary root + N additional roots**" — **without modifying any package in the upstream repository**.
8
8
 
9
- The problem it solves: a real development project is usually several independent Git repositories, while DSH natively treats only the session working directory as the writable root, so working across repositories means juggling sessions.
9
+ The problem it solves: a real development project is usually several independent Git repositories, while DSH natively treats only the session origin as the writable root, so working across repositories means juggling sessions.
10
10
 
11
11
  Three things make this plugin worth looking at:
12
12
 
@@ -24,6 +24,8 @@ Three things make this plugin worth looking at:
24
24
 
25
25
  **Done and released: `v0.1.4`** — with the `v0.1.3` contract unchanged, the supported upstream runtimes grow to `0.1.7-rc.2` (same shapes as `0.1.7-rc.1`, no new adapter branch; cordis stays at `~4.0.4`). See the [CHANGELOG](./CHANGELOG.en.md).
26
26
 
27
+ **`v0.1.5` is released**. This development branch contains unreleased support for DSH `0.2.1-alpha.1` / `0.2.1-alpha.2`, separation of dynamic cwd from Session origin, and LSP, Windows ACL, additional-root file browsing, and Worktree capabilities. These changes are proposed for `v0.1.6`; see the [roadmap ledger](./docs/plans/active/2026-09-12-multi-root-workspace.md) for release status.
28
+
27
29
  The single source of truth for progress, numbering, and release state is the [roadmap progress ledger](./docs/plans/active/2026-09-12-multi-root-workspace.md#进度总账) (M1–M4 are the MVP milestone numbers, H1–H4 are the `v0.1.1` batch numbers, and H1 is M4); per-item evidence lives in the [completed plans](./docs/plans/README.md), and the user-visible changes of each version are in the [CHANGELOG](./CHANGELOG.en.md).
28
30
 
29
31
  ## Quick Start
@@ -45,13 +47,13 @@ The agent can now read, write, and run bash in that directory, with the same rig
45
47
 
46
48
  ## Requirements
47
49
 
48
- - **Using the published plugin**: you need a *supported* DSH runtime — currently **`0.1.5-rc.2`, `0.1.6-alpha.1`, `0.1.6-alpha.2`, `0.1.7-alpha.1`, `0.1.7-alpha.2`, `0.1.7-rc.1`, and `0.1.7-rc.2`**, and nothing else will install or run (see below). `dsh plugin` installs the package into the matching profile, and no local Node toolchain is required
50
+ - **Using a plugin built from this checkout**: you need a *supported* DSH runtime — currently **`0.1.5-rc.2`, `0.1.6-alpha.1`, `0.1.6-alpha.2`, `0.1.7-alpha.1`, `0.1.7-alpha.2`, `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-alpha.1`, and `0.2.1-alpha.2`**, and nothing else will install or run (see below). `dsh plugin` installs the package into the matching profile, and no local Node toolchain is required
49
51
  - **Building from source / contributing**: **Node.js** `^22.19.0 || >=24` (pinned by the repository's `engines`), **Git**, and **pnpm 11** (`packageManager` pins `pnpm@11.25.0`; corepack recommended)
50
- - **DSH runtime**: the dev pin is exactly `0.1.5-rc.2`, the baseline among the supported releases; the upgrade procedure lives in the [development workflow](./docs/development/plugin-development-workflow.md)
51
- - **Platforms**: kernel-level multi-root is complete on macOS (Seatbelt) and Linux (bwrap or Landlock); on Windows only the `fs` write path covers additional roots (confined bash/PTY does not — see [known limitations](#known-limitations))
52
+ - **DSH runtime**: the dev pin is exactly `0.2.1-alpha.2`, the baseline among the supported releases; the upgrade procedure lives in the [development workflow](./docs/development/plugin-development-workflow.md)
53
+ - **Platforms**: macOS Seatbelt and Linux bwrap/Landlock; the development branch also implements a Windows root-set ACL runner. Platform validation is recorded in the [roadmap](./docs/plans/active/2026-09-12-multi-root-workspace.md#b1b3第二期-p12026-10-02).
52
54
  - Running the smoke tests needs **no model credentials**: the e2e model turns are served by an inline scripted model endpoint
53
55
 
54
- **The supported DSH versions are an exact list, not a range.** This plugin replaces `ctx.fs` and `ctx.sandbox` — the security boundary itself — and it recognizes kernel sandbox dialects from argv shapes measured against specific upstream releases. So `peerDependencies` names only the releases that have actually been through the full verification, and startup checks again: if the host's release is not on the list, or several `@deepseek-ai/dsh-*` packages disagree about which release they are, the fs / sandbox / registry / instructions rows **do not start**, the composition degrades to "this plugin is not installed", and one explanatory line is logged. To diagnose, see [troubleshooting: unsupported DSH release](./docs/troubleshooting/unsupported-dsh-release.md); for the reasoning, [ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md).
56
+ **The supported DSH versions are an exact list, not a range.** This plugin replaces `ctx.fs` and `ctx.sandbox` — the security boundary itself — and it recognizes kernel sandbox dialects from argv shapes measured against specific upstream releases. So `peerDependencies` names only the releases that have actually been through the full verification, and startup checks again: if the host's release is not on the list, or several `@deepseek-ai/dsh-*` packages disagree about which release they are, the fs / sandbox / registry / instructions / lsp / workspace-files rows **do not start**, the composition degrades to "this plugin is not installed", and one explanatory line is logged. To diagnose, see [troubleshooting: unsupported DSH release](./docs/troubleshooting/unsupported-dsh-release.md); for the reasoning, [ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md).
55
57
 
56
58
  ## Installation
57
59
 
@@ -86,8 +88,8 @@ This installs pre-built artifacts (the plugin itself is never compiled), but the
86
88
  ```sh
87
89
  pnpm pack @dsh-electron/dsh-plugin-multi-root-workspace
88
90
  # or download the tgz from the GitHub Release assets, e.g.:
89
- # https://github.com/cherrchen/dsh-plugin-multi-root-workspace/releases/download/v0.1.4/dsh-electron-dsh-plugin-multi-root-workspace-0.1.4.tgz
90
- dsh plugin --profile web add ./dsh-electron-dsh-plugin-multi-root-workspace-0.1.4.tgz
91
+ # https://github.com/cherrchen/dsh-plugin-multi-root-workspace/releases/download/v0.1.5/dsh-electron-dsh-plugin-multi-root-workspace-0.1.5.tgz
92
+ dsh plugin --profile web add ./dsh-electron-dsh-plugin-multi-root-workspace-0.1.5.tgz
91
93
  ```
92
94
 
93
95
  Also pre-built (the plugin itself is never compiled here), handy for air-gapped or offline delivery — and the first `add` needs the same `allowBuilds` answer.
@@ -106,10 +108,10 @@ allowBuilds:
106
108
  koffi: true
107
109
  ```
108
110
 
109
- Then run `add` again. Pinning a tag (e.g. `#v0.1.4`) is recommended so a later push cannot silently change what actually runs:
111
+ Then run `add` again. Pinning a tag (e.g. `#v0.1.5`) is recommended so a later push cannot silently change what actually runs:
110
112
 
111
113
  ```sh
112
- dsh plugin --profile web add github:cherrchen/dsh-plugin-multi-root-workspace#v0.1.4
114
+ dsh plugin --profile web add github:cherrchen/dsh-plugin-multi-root-workspace#v0.1.5
113
115
  ```
114
116
 
115
117
  ### Install from a local clone (development & debugging)
@@ -144,7 +146,7 @@ dsh plugin --profile web add "$PWD"
144
146
  dsh --profile web --dump-config
145
147
  ```
146
148
 
147
- Expected: **only** the `fs-sandbox` and `sandbox` rows are replaced by the plugin's `multi-root-fs` / `multi-root-sandbox`, with eight rows inserted (`multi-root-compat` / `fs` / `sandbox` / `scope` / `registry` / `instructions` / `command`, plus the client carrier row `multi-root-client`); `bash-sandbox` stays upstream (bash and the PTY backend take their roots from `ctx.sandbox`). After starting `dsh --profile web`, the Folders action appears at the sidebar foot.
149
+ Expected: **only** the `fs-sandbox` and `sandbox` rows are replaced by the plugin's `multi-root-fs` / `multi-root-sandbox`, with ten rows inserted (`multi-root-compat` / `fs` / `sandbox` / `scope` / `registry` / `instructions` / `lsp` / `workspace-files` / `command`, plus the client carrier row `multi-root-client`); `bash-sandbox` stays upstream (bash and the PTY backend take their roots from `ctx.sandbox`). After starting `dsh --profile web`, the Folders action appears at the sidebar foot.
148
150
 
149
151
  ## Usage
150
152
 
@@ -209,10 +211,10 @@ Issues and PRs are welcome:
209
211
 
210
212
  - 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)).
211
213
  - 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)).
212
- - 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` rows **do not start** and the composition degrades to "the plugin is not installed" ([ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md)).
213
- - Kernel-level multi-root does not exist on Windows: the `fs` write path covers additional roots, but confined bash/PTY cannot write them (the plugin emits one explicit warning for a populated scope); see the first-release scope in the [requirements document](./docs/requirements/multi-root-workspace.md).
214
+ - 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)).
215
+ - 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)).
214
216
  - An additional root has the same rights as the primary root (no per-root read-only), and cannot become the default working directory of bash/PTY (session cwd semantics are unchanged).
215
- - The `workspace-files` client file tree still sees the primary root only.
217
+ - Browse additional roots in the Workspace Folders dialog with manual refresh, expandable directories, and previews of up to 200 text lines. The native primary-root Files tab remains and offers a dialog action where supported. LSP uses the containing additional root as its own workspace; the host must configure the relevant language server ([ADR-0011](./docs/decisions/ADR-0011-multi-root-workspace-consumers.md)).
216
218
  - The command's own output text is English (a host-side handler has no active locale to consult); the panel is bilingual.
217
219
  - The Workspace Folders panel is a sidebar footer action plus a dialog rather than a full panel: `sidebar.footer.action` is offered by every supported release, whereas `sidebar.panellist` / `main` are not.
218
220
 
@@ -234,3 +236,5 @@ Repository-wide rules for Coding Agents are defined in [`AGENTS.md`](./AGENTS.md
234
236
  ## License
235
237
 
236
238
  [MIT](./LICENSE)
239
+
240
+ Dynamic working directories affect relative path resolution and new processes. They do not grant access or change the session origin that owns the root registry. See [ADR-0012](./docs/decisions/ADR-0012-session-origin-and-effective-cwd.md).
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  DSH(DeepSeek Harness)的外部插件 bundle:把 Workspace 的可写范围从"一个 canonical 目录"扩展为"**一个主根 + N 个附加根**",且**不修改上游仓库任何包**。
8
8
 
9
- 它解决的问题是:一个开发项目往往由多个独立 Git Repository 组成,而 DSH 原生只把会话工作目录当作唯一的可写根,Agent 跨仓库干活就得反复换会话。
9
+ 它解决的问题是:一个开发项目往往由多个独立 Git Repository 组成,而 DSH 原生只把会话原始项目当作唯一的可写根,Agent 跨仓库干活就得反复换会话。
10
10
 
11
11
  这个插件的三个核心价值:
12
12
 
@@ -24,6 +24,8 @@ DSH(DeepSeek Harness)的外部插件 bundle:把 Workspace 的可写范围
24
24
 
25
25
  **已完成并发布:`v0.1.4`**——在 `v0.1.3` 契约不变的前提下,受支持的上游运行时扩展到 `0.1.7-rc.2`(形状与 `0.1.7-rc.1` 相同,适配层无新分支;cordis 仍是 `~4.0.4`)。详见 [CHANGELOG](./CHANGELOG.md)。
26
26
 
27
+ **v0.1.5 已发布**。当前开发分支包含尚未发布的 DSH `0.2.1-alpha.1` / `0.2.1-alpha.2` 支持、动态 cwd / Session origin 分离,以及 LSP、Windows ACL、附加根文件浏览与 Worktree 能力;这些变更拟纳入 `v0.1.6`,发布状态见[路线账本](./docs/plans/active/2026-09-12-multi-root-workspace.md)。
28
+
27
29
  进度、编号与发布状态的唯一真源是[路线图 §进度总账](./docs/plans/active/2026-09-12-multi-root-workspace.md#进度总账)(M1–M4 是 MVP 里程碑编号,H1–H4 是 `v0.1.1` 批次编号,其中 H1 即 M4);逐项证据见各[已完成计划](./docs/plans/README.md),每个版本的用户可见变更见 [CHANGELOG](./CHANGELOG.md)。
28
30
 
29
31
  ## 快速开始
@@ -43,17 +45,17 @@ dsh --profile web
43
45
  /workspace-folders add ~/code/another-repo
44
46
  ```
45
47
 
46
- 之后 Agent 即可在该目录读写、跑 bash——与本会话的工作目录同权。
48
+ 之后 Agent 即可在该目录读写、跑 bash——与本会话的主根同权。DSH 的动态 working directory 只影响新操作的相对路径和执行目录,切换 cwd 不会新增授权,也不会改变注册表归属。
47
49
 
48
50
  ## 环境要求
49
51
 
50
- - **使用已发布的插件**:需要一个受支持的 DSH 运行时 —— 当前是 **`0.1.5-rc.2`、`0.1.6-alpha.1`、`0.1.6-alpha.2`、`0.1.7-alpha.1`、`0.1.7-alpha.2`、`0.1.7-rc.1` 与 `0.1.7-rc.2`**,别的版本装不上也不会跑(见下)。`dsh plugin` 会把包装进对应 profile,无需本地 Node 工具链
52
+ - **使用本源码构建的插件**:需要一个受支持的 DSH 运行时 —— 当前是 **`0.1.5-rc.2`、`0.1.6-alpha.1`、`0.1.6-alpha.2`、`0.1.7-alpha.1`、`0.1.7-alpha.2`、`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1` 与 `0.2.1-alpha.2`**,别的版本装不上也不会跑(见下)。`dsh plugin` 会把包装进对应 profile,无需本地 Node 工具链
51
53
  - **从源码构建 / 参与**:**Node.js** `^22.19.0 || >=24`(仓库 `engines` 钉住)、**Git**、**pnpm 11**(`packageManager` 钉 `pnpm@11.25.0`,建议经 corepack 启用)
52
- - **DSH 运行时**:开发依赖精确 pin 在 `0.1.5-rc.2`(受支持版本里的基线);升级流程见[开发工作流](./docs/development/plugin-development-workflow.md)
53
- - **平台支持**:macOS(Seatbelt)与 Linux(bwrap 或 Landlock)内核级多根全量;Windows 仅 `fs` 写路径覆盖附加根(受限 bash/PTY 不含,见[已知限制](#已知限制第一期))
54
+ - **DSH 运行时**:开发依赖精确 pin 在 `0.2.1-alpha.2`(受支持版本里的基线);升级流程见[开发工作流](./docs/development/plugin-development-workflow.md)
55
+ - **平台支持**:macOS Seatbelt / Linux bwrap、Landlock;当前开发分支还实现 Windows root-set ACL runner,平台验证状态见[路线账本](./docs/plans/active/2026-09-12-multi-root-workspace.md#b1b3第二期-p12026-10-02)。
54
56
  - 运行冒烟测试**不需要模型凭据**:e2e 的模型轮次由内联的脚本化模型端点提供
55
57
 
56
- **受支持的 DSH 版本是一份精确清单,不是一个范围。** 因为本插件替换的是 `ctx.fs` 与 `ctx.sandbox`——安全边界本身——而它识别内核沙箱方言靠的是对具体上游版本实测出来的 argv 形状。所以 `peerDependencies` 只列真正跑过全套验证的版本,启动时也会再查一遍:宿主的版本不在清单上,或者若干个 `@deepseek-ai/dsh-*` 混装了不同版本,那么 fs / sandbox / registry / instructions 四行**不启动**,组合退化成"没装这个插件",并打印一条说明。诊断办法见[故障排查:DSH 版本不在支持矩阵上](./docs/troubleshooting/unsupported-dsh-release.md),理由见 [ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md)。
58
+ **受支持的 DSH 版本是一份精确清单,不是一个范围。** 因为本插件替换的是 `ctx.fs` 与 `ctx.sandbox`——安全边界本身——而它识别内核沙箱方言靠的是对具体上游版本实测出来的 argv 形状。所以 `peerDependencies` 只列真正跑过全套验证的版本,启动时也会再查一遍:宿主的版本不在清单上,或者若干个 `@deepseek-ai/dsh-*` 混装了不同版本,那么 fs / sandbox / registry / instructions / lsp / workspace-files 六行**不启动**,组合退化成"没装这个插件",并打印一条说明。诊断办法见[故障排查:DSH 版本不在支持矩阵上](./docs/troubleshooting/unsupported-dsh-release.md),理由见 [ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md)。
57
59
 
58
60
  ## 安装
59
61
 
@@ -88,8 +90,8 @@ dsh plugin --profile web add @dsh-electron/dsh-plugin-multi-root-workspace
88
90
  ```sh
89
91
  pnpm pack @dsh-electron/dsh-plugin-multi-root-workspace
90
92
  # 或从 GitHub Release 资产下载,例如:
91
- # https://github.com/cherrchen/dsh-plugin-multi-root-workspace/releases/download/v0.1.4/dsh-electron-dsh-plugin-multi-root-workspace-0.1.4.tgz
92
- dsh plugin --profile web add ./dsh-electron-dsh-plugin-multi-root-workspace-0.1.4.tgz
93
+ # https://github.com/cherrchen/dsh-plugin-multi-root-workspace/releases/download/v0.1.5/dsh-electron-dsh-plugin-multi-root-workspace-0.1.5.tgz
94
+ dsh plugin --profile web add ./dsh-electron-dsh-plugin-multi-root-workspace-0.1.5.tgz
93
95
  ```
94
96
 
95
97
  同样是预构建产物(不需要编译本插件本身),适合内网或离线环境交付;首次 `add` 同样要回答那一次 `allowBuilds`。
@@ -108,10 +110,10 @@ allowBuilds:
108
110
  koffi: true
109
111
  ```
110
112
 
111
- 然后重新执行 `add` 即可。建议锁定 tag(如 `#v0.1.4`),让后续推送无法悄悄改变实际运行的内容:
113
+ 然后重新执行 `add` 即可。建议锁定 tag(如 `#v0.1.5`),让后续推送无法悄悄改变实际运行的内容:
112
114
 
113
115
  ```sh
114
- dsh plugin --profile web add github:cherrchen/dsh-plugin-multi-root-workspace#v0.1.4
116
+ dsh plugin --profile web add github:cherrchen/dsh-plugin-multi-root-workspace#v0.1.5
115
117
  ```
116
118
 
117
119
  ### 从本地源码安装(开发调试)
@@ -146,7 +148,7 @@ dsh plugin --profile web add "$PWD"
146
148
  dsh --profile web --dump-config
147
149
  ```
148
150
 
149
- 预期:组合里**仅** `fs-sandbox` 与 `sandbox` 两行被替换为插件的 `multi-root-fs` / `multi-root-sandbox`,并插入 8 行(`multi-root-compat` / `fs` / `sandbox` / `scope` / `registry` / `instructions` / `command` 与 client 载体行 `multi-root-client`);`bash-sandbox` 保持上游(bash 与 PTY 经 `ctx.sandbox` 取根)。启动 `dsh --profile web` 后,侧栏底部出现 Folders 动作。
151
+ 预期:组合里**仅** `fs-sandbox` 与 `sandbox` 两行被替换为插件的 `multi-root-fs` / `multi-root-sandbox`,并插入 10 行(`multi-root-compat` / `fs` / `sandbox` / `scope` / `registry` / `instructions` / `lsp` / `workspace-files` / `command` 与 client 载体行 `multi-root-client`);`bash-sandbox` 保持上游(bash 与 PTY 经 `ctx.sandbox` 取根)。启动 `dsh --profile web` 后,侧栏底部出现 Folders 动作。
150
152
 
151
153
  ## 使用方法
152
154
 
@@ -211,10 +213,10 @@ docs/ 需求、架构、决策记录(ADR)、计划、开发工
211
213
 
212
214
  - 附加根的指令文件按需到达模型:根目录顶层的那一份在会话第一步之前注入,子目录里的那一份在本会话**成功**触碰过该目录之后注入;nested 文件只会在其目录被考察到时重新检查(根层每一步,子目录依赖已投递或有新触碰),投递状态是进程内的(resume 后可能再告知一次),也只识别 `read` / `write` / `edit` 三个工具名。主根与 user-global 的指令链仍由上游负责,本插件不重复注入([ADR-0010](./docs/decisions/ADR-0010-additional-root-instruction-scope.md))。
213
215
  - 跨进程单写者:同一 `$DSH_HOME` 上同时只允许一个 DSH 进程持有根登记表;另一个进程显示登记表不可用(`registry-contended`),持锁者退出或崩溃后刷新即接管——这是刻意的 fail-closed,不是待修的竞态([ADR-0007](./docs/decisions/ADR-0007-registry-authority-lease.md))。
214
- - 支持矩阵是精确版本 allowlist:宿主版本不在清单上、或核心包混装了不同版本时,`fs` / `sandbox` / `registry` / `instructions` 四行**不启动**,组合退化为"没装这个插件"([ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md))。
215
- - Windows 的内核级多根未实现:`fs` 写路径覆盖附加根,但受限 bash/PTY 写不进去(非空 scope 时插件输出一次显式告警);详见[需求文档](./docs/requirements/multi-root-workspace.md)第一期范围。
216
+ - 支持矩阵是精确版本 allowlist:宿主版本不在清单上、或核心包混装了不同版本时,`fs` / `sandbox` / `registry` / `instructions` / `lsp` / `workspace-files` 六行**不启动**,组合退化为"没装这个插件"([ADR-0009](./docs/decisions/ADR-0009-dsh-compat-contract.md))。
217
+ - Windows 多根 runner 继承上游 partial enforcement、caller-owned 目录及 private temp 分离条件;已启动进程保留启动时根集合,后续进程使用更新后的集合([ADR-0011](./docs/decisions/ADR-0011-multi-root-workspace-consumers.md))。
216
218
  - 附加根与主根同权(无 per-root read-only);附加根不能作为 bash/PTY 的默认工作目录(session cwd 语义不变)。
217
- - `workspace-files`(Client 文件树)仍只看主根。
219
+ - 附加根文件树位于“工作区目录”对话框,采用手动刷新;可展开目录和预览前 200 行文本。主根原生 Files tab 保留,有 actions slot 时提供打开该对话框的入口。LSP 按附加文件所在根初始化独立 workspace;需要宿主配置对应语言服务器([ADR-0011](./docs/decisions/ADR-0011-multi-root-workspace-consumers.md))。
218
220
  - 命令的输出文案为英文(host 侧没有活动语言信息),面板文案中英双语跟随界面语言。
219
221
  - Workspace Folders 面板是「侧栏底部动作 + 对话框」,不是独立全屏面板:`sidebar.footer.action` 是所有受支持版本都提供的插槽,而 `sidebar.panellist`/`main` 不是。
220
222
 
package/cordis.patch.yml CHANGED
@@ -59,6 +59,10 @@
59
59
  name: '@dsh-electron/dsh-plugin-multi-root-workspace/instructions'
60
60
  config:
61
61
  maxBytes: 65536
62
+ - id: multi-root-lsp
63
+ name: '@dsh-electron/dsh-plugin-multi-root-workspace/lsp'
64
+ - id: multi-root-workspace-files
65
+ name: '@dsh-electron/dsh-plugin-multi-root-workspace/workspace-files'
62
66
  - id: multi-root-command
63
67
  name: '@dsh-electron/dsh-plugin-multi-root-workspace/command'
64
68
  - id: multi-root-client