dsh-plugin-wsl-env 0.17.1 → 0.19.0
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/CHANGELOG.md +225 -0
- package/CONTRIBUTING.md +37 -5
- package/README.md +61 -6
- package/SUPPORT.md +3 -3
- package/agent/native/linux-aarch64/dsh-wsl-agent +0 -0
- package/agent/native/linux-x86_64/dsh-wsl-agent +0 -0
- package/agent/wsl-agent.sh +331 -11
- package/cordis.patch.yml +10 -5
- package/docs/AGENT-PROTOCOL-V7.md +175 -0
- package/docs/API.md +24 -0
- package/docs/ARCHITECTURE.md +20 -6
- package/docs/COMPATIBILITY.md +1 -1
- package/docs/CONFIGURATION.md +33 -5
- package/docs/CONFIGURATION.zh.md +25 -4
- package/docs/LIMITATIONS.md +39 -7
- package/docs/LIMITATIONS.zh.md +31 -6
- package/docs/MIGRATION.md +4 -4
- package/docs/PEER-PARITY.md +94 -35
- package/docs/QUICKSTART.md +19 -2
- package/docs/QUICKSTART.zh.md +16 -1
- package/docs/README.zh.md +47 -7
- package/docs/RELEASING.md +3 -2
- package/docs/REQUIREMENTS.zh.md +11 -6
- package/docs/ROADMAP-1.0.md +40 -29
- package/docs/ROADMAP.md +10 -6
- package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +6 -1
- package/docs/UPSTREAM-FSIO-EXPORT.md +2 -2
- package/docs/UPSTREAM-SERVICE-SWAP.md +124 -0
- package/docs/UPSTREAM-SESSION-NOTICE.md +3 -1
- package/docs/UPSTREAM-TERMINAL-TITLE.md +3 -0
- package/docs/root-fs-routing.md +3 -3
- package/lib/agent-confined.js +4 -4
- package/lib/agent-errors.d.ts +1 -1
- package/lib/agent-errors.js +1 -1
- package/lib/agent-exec.d.ts +1 -1
- package/lib/agent-exec.js +1 -1
- package/lib/agent-protocol.d.ts +58 -8
- package/lib/agent-protocol.js +40 -7
- package/lib/agent-shared.d.ts +1 -1
- package/lib/agent-shared.js +1 -1
- package/lib/agent.d.ts +171 -1
- package/lib/agent.js +448 -288
- package/lib/auto-preset.d.ts +1 -1
- package/lib/auto-preset.js +1 -1
- package/lib/bwrap.d.ts +1 -1
- package/lib/bwrap.js +1 -1
- package/lib/distro-route.d.ts +1 -1
- package/lib/distro-route.js +1 -1
- package/lib/doctor-live.d.ts +53 -0
- package/lib/doctor-live.js +37 -0
- package/lib/file-reference-wsl.d.ts +1 -1
- package/lib/file-reference-wsl.js +1 -1
- package/lib/fs-decisions.d.ts +1 -1
- package/lib/fs-decisions.js +1 -1
- package/lib/fs-routing.d.ts +52 -2
- package/lib/fs-routing.js +56 -1
- package/lib/fs-substrate.d.ts +90 -11
- package/lib/fs-substrate.js +202 -1
- package/lib/fs.d.ts +1 -1
- package/lib/fs.js +1 -1
- package/lib/fsio-agent.d.ts +128 -4
- package/lib/fsio-agent.js +224 -15
- package/lib/fsio-text.d.ts +1 -1
- package/lib/fsio-text.js +1 -1
- package/lib/git-exec.d.ts +1 -1
- package/lib/git-exec.js +1 -1
- package/lib/git-route.d.ts +1 -1
- package/lib/git-route.js +1 -1
- package/lib/index.d.ts +127 -3
- package/lib/index.js +301 -99
- package/lib/listing.d.ts +1 -1
- package/lib/listing.js +1 -1
- package/lib/native-agent.d.ts +1 -1
- package/lib/native-agent.js +2 -2
- package/lib/paths.d.ts +6 -3
- package/lib/paths.js +4 -4
- package/lib/picker.d.ts +1 -1
- package/lib/picker.js +7 -7
- package/lib/ports.d.ts +1 -1
- package/lib/ports.js +1 -1
- package/lib/preflight.d.ts +1 -1
- package/lib/preflight.js +1 -1
- package/lib/sandbox-core.d.ts +1 -1
- package/lib/sandbox-core.js +2 -2
- package/lib/sandbox.d.ts +1 -1
- package/lib/sandbox.js +1 -1
- package/lib/search-exec.d.ts +1 -1
- package/lib/search-exec.js +1 -1
- package/lib/search-route.d.ts +1 -1
- package/lib/search-route.js +1 -1
- package/lib/session-runtime.d.ts +1 -1
- package/lib/session-runtime.js +2 -2
- package/lib/session-scope.d.ts +1 -1
- package/lib/session-scope.js +1 -1
- package/lib/shell-env.d.ts +1 -1
- package/lib/shell-env.js +1 -1
- package/lib/shell.d.ts +1 -1
- package/lib/shell.js +1 -1
- package/lib/subprocess.d.ts +1 -1
- package/lib/subprocess.js +2 -2
- package/lib/terminal-activity.d.ts +1 -1
- package/lib/terminal-activity.js +1 -1
- package/lib/terminal-route.d.ts +1 -1
- package/lib/terminal-route.js +1 -1
- package/lib/watcher.d.ts +1 -1
- package/lib/watcher.js +1 -1
- package/lib/wsl.d.ts +1 -31
- package/lib/wsl.js +1 -21
- package/package.json +41 -28
- package/scripts/doctor.mjs +34 -11
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,231 @@ document: the 0.1.0 entry's `design-history §` references are to
|
|
|
14
14
|
keeps the superseded designs under the section numbers they had while they
|
|
15
15
|
were part of the record.
|
|
16
16
|
|
|
17
|
+
## [Unreleased]
|
|
18
|
+
|
|
19
|
+
## [0.19.0] - 2026-11-06
|
|
20
|
+
|
|
21
|
+
One theme: the wire and the doctor catch up with the substrate — protocol v7
|
|
22
|
+
(WSL-312), the live-resident report (WSL-313), and the probe/e2e evidence a
|
|
23
|
+
behaviour change owes the release notes.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **`doctor --wsl <path>` pins the `wsl.exe` every probe uses.** The doctor's
|
|
28
|
+
probes resolved `wsl.exe` from `PATH`, so a PATH race (one probe seeing one
|
|
29
|
+
binary, the next another) could not be ruled out; the flag rebinds every
|
|
30
|
+
probe and `doctorReport` forwards it, and the reject path carries the full
|
|
31
|
+
diagnostics.
|
|
32
|
+
|
|
33
|
+
- **`./index` is a public subpath.** The composition root's named surface
|
|
34
|
+
(`WslShellExecutor`, `WslFileSystem`, `doctorReport`,
|
|
35
|
+
`effectiveMaskWindowsDrive`, the row factories) is importable as
|
|
36
|
+
`dsh-plugin-wsl-env/index`, so tooling that wants the doctor's report or the
|
|
37
|
+
composition root's symbols no longer reaches into `lib/index.js` by file
|
|
38
|
+
path. The exports map and the generated `lib/index.d.ts` are the contract;
|
|
39
|
+
`docs/API.md` is the tour.
|
|
40
|
+
|
|
41
|
+
- **Agent protocol v7 (WSL-312): concurrent-ready FS frames, structured
|
|
42
|
+
errors, batched reads, and the peer's patch/delete/move operations.** HELLO
|
|
43
|
+
now advertises capabilities (`conc`, `batch`); failed FS ops answer with the
|
|
44
|
+
structured `FSERR|id|reason|b64` line; the new `FSB` batch frame answers a
|
|
45
|
+
GUI-preview-shaped stat+list+read in one round trip
|
|
46
|
+
(`test/probe/gui-preview-batch.sh` measures it); and the FS vocabulary grows
|
|
47
|
+
`delete`/`move` with the peer's guard dialects. `patchText` applies hunks
|
|
48
|
+
in-process through `@deepseek-ai/dsh-fs-patch` (new peer dependency), so the
|
|
49
|
+
`FS_PATCH_MISMATCH` dialect is the peer's byte-for-byte. Both agent
|
|
50
|
+
implementations ship v7 in lockstep (shell script + native binaries for
|
|
51
|
+
x86_64/aarch64), the host accepts agents 6–7 and gates every v7 frame on the
|
|
52
|
+
negotiated version, and the `0.18.0` declared gap for the peer's three new
|
|
53
|
+
operations is closed. Design: [docs/AGENT-PROTOCOL-V7.md](docs/AGENT-PROTOCOL-V7.md);
|
|
54
|
+
evidence: `agent/native/spike/test.mjs` (28 checks), `test/fs-substrate.test.mjs`
|
|
55
|
+
(17), `test/agent-protocol.test.mjs` (20).
|
|
56
|
+
|
|
57
|
+
- **The doctor can now report a live resident's failures (WSL-313).** The
|
|
58
|
+
CLI's handshake check states its probe source ("probed: a fresh resident")
|
|
59
|
+
and keeps saying that a live resident's `lastError` is host-private — the
|
|
60
|
+
CLI is a separate process and no IPC is invented. The merge happens only
|
|
61
|
+
where the context is reachable: `doctorReport(distro)` in `lib/index.js`
|
|
62
|
+
collects the shipped script as a subprocess and folds
|
|
63
|
+
`sharedAgent(distro).status()` in via `mergeLiveResidentStatus`
|
|
64
|
+
(`lib/doctor-live.js`) — a snapshot that answers for no resident changes
|
|
65
|
+
nothing; a `dead` live resident fails the check; a `lastError` on a running
|
|
66
|
+
one surfaces as `warn` with deaths/pending named, and the report tally
|
|
67
|
+
follows.
|
|
68
|
+
|
|
69
|
+
### Changed
|
|
70
|
+
|
|
71
|
+
- **A failed login-shell probe now refuses the command instead of silently
|
|
72
|
+
running it under bash.** `wsl-shell`'s `shell` key stays empty by default and
|
|
73
|
+
resolves the distro user's login shell (`getent passwd`, then `$SHELL`); when
|
|
74
|
+
both probes fail — a cold distro, a flaky first `wsl.exe` call, a musl distro
|
|
75
|
+
without `getent` — the executor used to answer the literal `bash` for that
|
|
76
|
+
one call, running the command under an interpreter the user never configured
|
|
77
|
+
and telling no one. The resolvers now throw the refusal `runInDistro` used
|
|
78
|
+
before its removal (the distro, both probes, and the `shell:` escape hatch); the failure is
|
|
79
|
+
still not cached, so a retry re-probes; and the tool's self-presentation
|
|
80
|
+
reads `shell` rather than a bash that nothing resolved.
|
|
81
|
+
|
|
82
|
+
- **`toLinuxPath` no longer accepts a `distro` option.** The mapping is
|
|
83
|
+
coordinate-only and read no pin: the option was forwarded into the function's
|
|
84
|
+
own recursion and never consulted. The signature narrows to
|
|
85
|
+
`{ cwd?: string }`, the seven call sites that passed the pin drop it, and
|
|
86
|
+
every mapping result is unchanged — `test/paths.test.mjs` pins the UNC, drive
|
|
87
|
+
and relative forms without the option.
|
|
88
|
+
|
|
89
|
+
### Removed
|
|
90
|
+
|
|
91
|
+
- **`runInDistro`.** The `./wsl` helper had no callers left: the shell
|
|
92
|
+
resolvers and the `shell-env` row probe through their own paths, so what
|
|
93
|
+
remained was dead public surface on a package whose exported names and error
|
|
94
|
+
codes are API. Its refusal wording is not lost — the executor's resolvers
|
|
95
|
+
throw `dsh-plugin-wsl: distro "…" named no usable shell (passwd probe and
|
|
96
|
+
$SHELL both failed)`, which the Changed entry above describes. The ignored
|
|
97
|
+
`toLinuxPath` option went in the same pass.
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
|
|
101
|
+
- **The published name survives a power loss with its contents.** The shell
|
|
102
|
+
agent synced the staged file but not the containing directory, so the
|
|
103
|
+
rename that published a write or a move could vanish on restart while the
|
|
104
|
+
data survived (REVIEW 2026-10-03, still-open 1). After the publish rename —
|
|
105
|
+
both the write path and the move-over path — the agent now fsyncs the
|
|
106
|
+
destination's containing directory (`sync -d`, best effort: sync builds
|
|
107
|
+
without `-d` and filesystems refusing a directory fsync degrade to the
|
|
108
|
+
peer's promise silently). The native agent keeps its file-level `sync_all`
|
|
109
|
+
until its next build; the divergence is declared in `docs/PEER-PARITY.md`
|
|
110
|
+
(divergence 6).
|
|
111
|
+
- **A wedged unit-test file now fails in three minutes instead of hanging the
|
|
112
|
+
run.** `node --test` has no per-file deadline, and `--test-timeout` bounds
|
|
113
|
+
only tests a file has registered — a script-style suite that leaves a handle
|
|
114
|
+
alive behind an unsettled top-level await hangs before registration, and the
|
|
115
|
+
runner's "Promise resolution is still pending" message never arrives because
|
|
116
|
+
the loop never drains. `scripts/test-watchdog.mjs` now wraps `test:unit` and
|
|
117
|
+
`test:coverage`: the command runs untouched, and at the 180 s deadline the
|
|
118
|
+
wrapper interrupts the process group (SIGINT, so node prints its
|
|
119
|
+
"Interrupted while running" list naming the still-running file;
|
|
120
|
+
`taskkill /T` on Windows) and exits 124. `DSH_TEST_WATCHDOG_MS` overrides the
|
|
121
|
+
deadline. Observed shape: `test/shell-env.test.mjs` sat 584 s inside a 587 s
|
|
122
|
+
run, so every re-run paid the caller's whole command budget.
|
|
123
|
+
|
|
124
|
+
- **The coverage gate now proves every shipped module is measured.** Node's
|
|
125
|
+
coverage is load-based: `lib/git-exec.js` and the three peer-bound rows
|
|
126
|
+
(`picker`, `auto-preset`, `subprocess`) had no row at all, so the 96.65%
|
|
127
|
+
headline was computed over 35 of 41 modules. `test/git-exec.test.mjs` — nine
|
|
128
|
+
checks that passed but were in neither gate list — is wired into both, and
|
|
129
|
+
`scripts/coverage-gate.mjs` wraps `test:coverage`: every `lib/*.js` must be
|
|
130
|
+
measured or carry a reason in `test/coverage-allowlist.json`, every measured
|
|
131
|
+
module must clear 85/70/60 (line/branch/function), and a stale allowlist
|
|
132
|
+
entry fails the run. `test/provider.test.mjs` also asserts the
|
|
133
|
+
`lib/shell.js` and `lib/fs.js` re-exports now, so the measured set is 38 of
|
|
134
|
+
41 instead of 35.
|
|
135
|
+
|
|
136
|
+
- **Two test-harness defects that could hang the gate or misreport it.** The
|
|
137
|
+
`check()` helper in `test/doctor.test.mjs` called its body synchronously
|
|
138
|
+
while two checks were `async`: `PASS` printed before any assertion ran, a
|
|
139
|
+
rejection escaped as an unhandled one, and the fixture cleanup could delete
|
|
140
|
+
the fake `wsl.exe` while `doctorReport` was still spawning it. The helper now
|
|
141
|
+
awaits. The live-agent helpers in `test/fs-substrate.test.mjs` and
|
|
142
|
+
`test/fsio-agent.test.mjs` close in `finally`, and the `close()` methods of
|
|
143
|
+
the three script-backed harnesses bound the SHUTDOWN wait at 2 s and kill on
|
|
144
|
+
timeout, so a failing check cannot leak a `sh` that makes `node --test` wait
|
|
145
|
+
forever.
|
|
146
|
+
|
|
147
|
+
### Documentation
|
|
148
|
+
|
|
149
|
+
- **The install steps no longer assume a `dsh` executable.** The Windows
|
|
150
|
+
desktop app ships `DeepSeek Harness.exe` only — the CLI entry lives inside
|
|
151
|
+
`resources/app.asar`, and the probe scripts start it through
|
|
152
|
+
`ELECTRON_RUN_AS_NODE`. The README, QUICKSTART (both languages),
|
|
153
|
+
CONFIGURATION, MIGRATION, ARCHITECTURE, SUPPORT and the first-use template
|
|
154
|
+
now lead with the desktop path (**Plugins** in the sidebar, then **Add
|
|
155
|
+
plugin** — which writes the profile's `package.json` and
|
|
156
|
+
`dsh.profile.bundles`) and label the
|
|
157
|
+
`dsh ...` forms as the CLI distribution's.
|
|
158
|
+
|
|
159
|
+
- **The README asks whether the plugin is needed before it says how to install
|
|
160
|
+
it.** A harness that can live in the distro — the CLI in a terminal, or
|
|
161
|
+
`dsh web` in a browser — needs no bridge at all, and the new decision table
|
|
162
|
+
says so. It also records the one trap when the two are mixed: `desktop` is
|
|
163
|
+
the Electron app's reserved profile, and the npm CLI refuses to manage that
|
|
164
|
+
profile's plugins.
|
|
165
|
+
|
|
166
|
+
- **The desktop start line is the executable, not a command.** The installer's
|
|
167
|
+
shortcut launches `DeepSeek Harness.exe` with no arguments, and the GUI opens
|
|
168
|
+
the profile it is configured with — the one the Plugins page writes into.
|
|
169
|
+
`dsh --profile <name>` stays a CLI-distribution line.
|
|
170
|
+
|
|
171
|
+
## [0.18.0] - 2026-11-05
|
|
172
|
+
|
|
173
|
+
Track the desktop `0.2.2-rc.1` release: the bundle layer is regenerated from
|
|
174
|
+
its shipped patch file, the peer floor moves to the `0.2.2-rc.1` npm line with
|
|
175
|
+
the peer-parity re-run the layering rule requires, and the one genuinely broken
|
|
176
|
+
path is documented with its operator rule.
|
|
177
|
+
|
|
178
|
+
### Changed
|
|
179
|
+
|
|
180
|
+
- **Raised the peer floor and dev pins to the `0.2.2-rc.1` npm line, with the
|
|
181
|
+
peer-parity re-run the layering rule requires.** All ten `@deepseek-ai/dsh-*`
|
|
182
|
+
peers move to `0.2.2-rc.1` (`peerDependencies >=0.2.2-rc.1`), cordis to
|
|
183
|
+
`^4.1.0` with dev pins `4.1.0`, and schemastery to `^3.19.0` — the release's
|
|
184
|
+
own pairing. Two companion fixes rode the move: the `cordis-plugin-*` dev
|
|
185
|
+
pins (`*`) resolved to `1.0.x`, which cordis 4.1.0 breaks at boot (the
|
|
186
|
+
`internal/config` waterfall dereferences a null `parent`; both pins are now
|
|
187
|
+
the release's `1.1.0`), and the `pnpm-workspace.yaml`
|
|
188
|
+
`minimumReleaseAgeExclude` list follows the pins as pnpm rewrites it.
|
|
189
|
+
`src/` changes, all defensive and documented in
|
|
190
|
+
[PEER-PARITY.md](docs/PEER-PARITY.md): the peer's new `patchText`/
|
|
191
|
+
`deleteFile`/`moveFile` operations are refused honestly on the distro side
|
|
192
|
+
(`FS_IO_ERROR` naming the substrate gap — the inherited host implementation
|
|
193
|
+
would target the wrong filesystem) and routed by the usual coordinates
|
|
194
|
+
otherwise; `wslWritableRoots` now honors `additionalWritableRoots` under the
|
|
195
|
+
upstream together-grant contract (a same-distro UNC extra root is granted,
|
|
196
|
+
a Windows-path extra root in a distro workspace fails closed with the
|
|
197
|
+
peer's `SandboxInvalidRootError`). The parity table was re-walked against
|
|
198
|
+
the `0.2.2-rc.1` tarballs: every replicated read/edit string survived
|
|
199
|
+
verbatim, both declared divergences stand, and the line references were
|
|
200
|
+
re-recorded (`dsh-fs-local`'s `lib/index.js` grew 909 → 1048 lines).
|
|
201
|
+
|
|
202
|
+
### Fixed
|
|
203
|
+
|
|
204
|
+
- **Adapted to the desktop `0.2.2-rc.1` release.** The `preset-wsl` row is
|
|
205
|
+
regenerated from the release's `standard.patch.yml` (`dsh-v0.2.2-rc.1`):
|
|
206
|
+
`tool-fs` pins `applyPatch: false` (the base `patchText` is the host-side
|
|
207
|
+
implementation and must not quietly cross the 9p share for a distro
|
|
208
|
+
workspace), the removed `tool-subagent-list-agents` row is dropped,
|
|
209
|
+
`tool-subagent` moves from `modelSelectionSettings` to
|
|
210
|
+
`modelSelection` + `modelDiscovery`, and `tool-plugin-manager` follows the
|
|
211
|
+
shipped contextual disable. No `src/` changes were needed: every peer
|
|
212
|
+
symbol the plugin imports survives unchanged in the release's bundled
|
|
213
|
+
copies (`dsh-fs-local` gained patch machinery the preset keeps disabled;
|
|
214
|
+
`dsh-sandbox`'s `writableRoots` now honors `additionalWritableRoots`,
|
|
215
|
+
matching the upstream dialect), and the compatibility audit ran against
|
|
216
|
+
the release's bundled peer copies. The `peerDependencies` floor against
|
|
217
|
+
the freshly published `0.2.2-rc.1` npm line is raised in its own
|
|
218
|
+
commit — the peer-parity re-run the layering rule requires — not in
|
|
219
|
+
this one.
|
|
220
|
+
- Documented the one genuinely broken path: **enabling the bundle through
|
|
221
|
+
the GUI on a running profile fails on app `0.2.2-rc.1`** while sessions
|
|
222
|
+
hold the replaced services, because cordis 4.1.0 retains a disposing
|
|
223
|
+
provider's registrations until its dependents drain
|
|
224
|
+
([UPSTREAM-SERVICE-SWAP.md](docs/UPSTREAM-SERVICE-SWAP.md) — mechanism,
|
|
225
|
+
isolated repro on both version pairs, and upstream remediation
|
|
226
|
+
directions; [LIMITATIONS.md](docs/LIMITATIONS.md) records the
|
|
227
|
+
operator rule: the selection persists and a restart applies it).
|
|
228
|
+
Cold-boot composition is unaffected and verified against the release's
|
|
229
|
+
actual bundle layers.
|
|
230
|
+
|
|
231
|
+
## [0.17.1] - 2026-11-01
|
|
232
|
+
|
|
233
|
+
### Fixed
|
|
234
|
+
|
|
235
|
+
- **The npm package now ships the Chinese user docs** (`QUICKSTART.zh.md`,
|
|
236
|
+
`CONFIGURATION.zh.md`, `LIMITATIONS.zh.md` — added to the files list after
|
|
237
|
+
the packaging link check caught their absence from the 0.17.0 tarball), and
|
|
238
|
+
`package.json`'s Chinese `description` is readable again instead of
|
|
239
|
+
`\uXXXX` escapes (a release-script `ensure_ascii` slip; the parsed value
|
|
240
|
+
was always correct). No shipped-code changes.
|
|
241
|
+
|
|
17
242
|
## [0.17.0] - 2026-11-01
|
|
18
243
|
|
|
19
244
|
### Changed
|
package/CONTRIBUTING.md
CHANGED
|
@@ -23,9 +23,10 @@ Developing and running the gates do have dependencies. The tests import pinned
|
|
|
23
23
|
algorithm, and the boot test starts a row through the real Loader — so a fresh
|
|
24
24
|
checkout needs one `pnpm install` before the gates pass.
|
|
25
25
|
|
|
26
|
-
Those pins are deliberate, and they split by role. The
|
|
27
|
-
exact so the gates and the `docs/PEER-PARITY.md` audit
|
|
28
|
-
|
|
26
|
+
Those pins are deliberate, and they split by role. The `@deepseek-ai/*`
|
|
27
|
+
`devDependencies` stay exact so the gates and the `docs/PEER-PARITY.md` audit
|
|
28
|
+
name one reproducible line (the toolchain deps — typescript, js-yaml,
|
|
29
|
+
`@types/*` — ride ranges and move by hand). The `peerDependencies` are floors — `>=` for the `@deepseek-ai/dsh-*`
|
|
29
30
|
packages, caret for `@deepseek-ai/cordis` and `@deepseek-ai/schemastery` — so
|
|
30
31
|
an app that ships a newer harness keeps installing the plugin without waiting
|
|
31
32
|
for a plugin release. A floor is still raised on purpose, not by drift: it
|
|
@@ -184,7 +185,7 @@ terminal if you would rather not see the prompt.
|
|
|
184
185
|
|---|---|---|
|
|
185
186
|
| `pnpm test` | style checks, relative links, syntax pass, build consistency, type check, and unit tests | no |
|
|
186
187
|
| `pnpm run lint:links` | relative Markdown links in README, CONTRIBUTING, AGENTS and `docs/**` | no |
|
|
187
|
-
| `pnpm run test:coverage` | unit tests with coverage | no |
|
|
188
|
+
| `pnpm run test:coverage` | unit tests with coverage, then the per-module gate: every `lib/*.js` measured or allowlisted, per-module floors 85/70/60 | no |
|
|
188
189
|
| `pnpm run lint:style` | style and lint rules | no |
|
|
189
190
|
| `pnpm run lint:build` | the build-freshness check: every source has its artifacts and the committed bytes match a real build | no |
|
|
190
191
|
| `pnpm run lint:types` | the TypeScript check over `test/**` and the ambient types (`tsc --noEmit`) | no |
|
|
@@ -226,7 +227,7 @@ still need Windows and WSL2, but no harness boot and no profile: run them from a
|
|
|
226
227
|
distro terminal with Node available, and they reach `wsl.exe` through interop.
|
|
227
228
|
|
|
228
229
|
Two conveniences for the real-machine set. `test/probe/run-all-when-closed.sh
|
|
229
|
-
--include-fs` runs all
|
|
230
|
+
--include-fs` runs all seventeen probes once the app has exited. The interop shell
|
|
230
231
|
matrix uses the `wslfs` profile, systemd and a lingering user manager; it fails
|
|
231
232
|
when Windows interop or its temporary marker cannot be verified. And `ci.yml` has a
|
|
232
233
|
scheduled and manually dispatched `probes` job: `sandbox` runs whenever a default distro
|
|
@@ -236,6 +237,18 @@ its `runs-on` carries the GitHub-hosted `windows-latest` label; when the hosted
|
|
|
236
237
|
runner has no usable distro the job is a green no-op (`skip all`). Where a default
|
|
237
238
|
distro launches without bubblewrap, the `sandbox` leg fails, not skips.
|
|
238
239
|
|
|
240
|
+
**Self-hosted runner label collision — known exposure.** The development
|
|
241
|
+
machine's self-hosted runner fulfills the GitHub-hosted `windows-latest` label,
|
|
242
|
+
so the unit matrix's Windows legs execute there on every push and PR. PR code
|
|
243
|
+
from a fork is skipped on those legs (`ci.yml`'s step-level fork gate), but the
|
|
244
|
+
durable fix is renaming the runner's label to something unambiguous (for
|
|
245
|
+
example `self-hosted-wsl`) in the runner's settings and repointing the two
|
|
246
|
+
`windows-latest` consumers in `ci.yml` at it — until then, treat the label as
|
|
247
|
+
shared infrastructure, not hosted capacity. Also note the install steps carry
|
|
248
|
+
`--config.minimum-release-age=0` (pnpm 11.7's lockfile re-verification ignores
|
|
249
|
+
`minimumReleaseAgeExclude`; the flag is the documented remedy in
|
|
250
|
+
`release.yml`).
|
|
251
|
+
|
|
239
252
|
## Adding a test
|
|
240
253
|
|
|
241
254
|
Choose the layer by what the test needs.
|
|
@@ -249,6 +262,25 @@ Unit tests run under `node --test`. The `test:unit` and the `test:coverage` list
|
|
|
249
262
|
in `package.json` name their files explicitly; a test that only touches this
|
|
250
263
|
repository belongs in both. Keep the lists synchronized without duplicate entries.
|
|
251
264
|
|
|
265
|
+
Both scripts run their list under `scripts/test-watchdog.mjs`, which bounds the
|
|
266
|
+
whole run at 180 s (`DSH_TEST_WATCHDOG_MS` overrides). `node --test` has no
|
|
267
|
+
per-file deadline, so a script-style file that leaves a handle alive behind an
|
|
268
|
+
unsettled top-level await would otherwise hang the gate until the caller kills
|
|
269
|
+
it; at the deadline the wrapper interrupts the run and node's "Interrupted while
|
|
270
|
+
running" list names the file that never finished. The scripts also pass
|
|
271
|
+
`--test-timeout=60000`, which bounds only tests a file registers with `test()` —
|
|
272
|
+
the watchdog is what covers a hang at module evaluation.
|
|
273
|
+
|
|
274
|
+
`test:coverage` runs that list through `scripts/coverage-gate.mjs` as well.
|
|
275
|
+
Node's coverage is load-based — a module no test imports has no row, so the
|
|
276
|
+
global percentage silently measures a subset — so the gate requires every
|
|
277
|
+
`lib/*.js` to be measured or named in `test/coverage-allowlist.json` with the
|
|
278
|
+
reason it cannot be loaded by the gated suite, and holds every measured module
|
|
279
|
+
to floors of 85 lines / 70 branches / 60 functions. A new module without a test
|
|
280
|
+
fails the gate, and so does an allowlist entry for a module that no longer
|
|
281
|
+
exists. Adding a test is the preferred fix; the allowlist keeps the remaining
|
|
282
|
+
probe-only rows visible instead of letting them vanish from the denominator.
|
|
283
|
+
|
|
252
284
|
A test that imports a pinned `@deepseek-ai/*` package goes in the same lists and
|
|
253
285
|
needs no guarding — CI runs `pnpm install --frozen-lockfile` over the locked tree
|
|
254
286
|
before `pnpm test`. For example,
|
package/README.md
CHANGED
|
@@ -14,6 +14,32 @@ Windows + WSL 2 only.
|
|
|
14
14
|
|
|
15
15
|
**New here?** Start with [docs/QUICKSTART.md](docs/QUICKSTART.md) — prerequisites, recipes and the compatibility table.
|
|
16
16
|
|
|
17
|
+
## Do I need this plugin?
|
|
18
|
+
|
|
19
|
+
If the harness itself can run in the distro, it is simpler **not** to use this
|
|
20
|
+
plugin: install the CLI there and run it from the distro's shell. No UNC paths,
|
|
21
|
+
no 9p round trips, no Windows-to-distro agent.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# inside the distro; the CLI needs Node >= 24.9
|
|
25
|
+
npm install -g @deepseek-ai/dsh
|
|
26
|
+
dsh web # browser UI, reached through WSL's localhost forwarding
|
|
27
|
+
dsh headless "run the tests" # one task, one answer, exit
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use this plugin when the harness has to stay on Windows:
|
|
31
|
+
|
|
32
|
+
| Your setup | What to use |
|
|
33
|
+
|---|---|
|
|
34
|
+
| Work happens inside WSL; a terminal or browser UI is enough | the CLI installed in the distro |
|
|
35
|
+
| You want the Windows desktop app, with commands and files in the distro | this plugin |
|
|
36
|
+
| One session must reach Windows and WSL folders at once | this plugin — per-path routing is the point |
|
|
37
|
+
|
|
38
|
+
Mixing the two has one trap: the `desktop` profile name is owned by the Electron
|
|
39
|
+
app, and the npm CLI refuses to manage that profile's plugins — use the app's
|
|
40
|
+
Plugins page for it. [docs/VALUE.zh.md](docs/VALUE.zh.md) has the full
|
|
41
|
+
comparison and the cases this plugin is not for.
|
|
42
|
+
|
|
17
43
|
## Why this plugin
|
|
18
44
|
|
|
19
45
|
A Windows coding tool that works on WSL projects has three options: run the whole tool inside the distro, connect to a helper server inside the distro, or let the plugin provide the distro environment. This plugin is the third option. One workflow covers both kinds of session, with the distro's real tools and the command sandbox intact.
|
|
@@ -59,10 +85,25 @@ No Node.js is required inside the distro.
|
|
|
59
85
|
|
|
60
86
|
## Install
|
|
61
87
|
|
|
62
|
-
|
|
88
|
+
The Windows desktop app ships **no `dsh` executable**: the installer writes
|
|
89
|
+
`DeepSeek Harness.exe`, and the CLI entry lives inside `resources/app.asar`
|
|
90
|
+
(the probe scripts launch it through `ELECTRON_RUN_AS_NODE`). Use the
|
|
91
|
+
distribution you have.
|
|
92
|
+
|
|
93
|
+
**Desktop app.** Open **Plugins** in the sidebar, choose **Add plugin**, enter
|
|
94
|
+
the exact package name `dsh-plugin-wsl-env`, then enable it. The plugin manager
|
|
95
|
+
writes the active profile's `package.json` — the dependency and the
|
|
96
|
+
`dsh.profile.bundles` entry — which is the same state the CLI command below
|
|
97
|
+
produces. To run from a checkout, add it as a linked package instead of a
|
|
98
|
+
name. Start it the way the installer's shortcut does: `DeepSeek Harness.exe`,
|
|
99
|
+
no arguments. The app opens the profile it is configured with — the one the
|
|
100
|
+
Plugins page writes into — so a different profile is a CLI-distribution thing
|
|
101
|
+
(`dsh --profile <name>`).
|
|
102
|
+
|
|
103
|
+
**CLI distribution** (`dsh` on `PATH`), in a Windows terminal:
|
|
63
104
|
|
|
64
105
|
```powershell
|
|
65
|
-
dsh wsl --from-default-profile web --dump-config # create
|
|
106
|
+
dsh wsl --from-default-profile web --dump-config # create a profile named wsl
|
|
66
107
|
dsh plugin --profile wsl add dsh-plugin-wsl-env # install the plugin and its settings
|
|
67
108
|
dsh --profile wsl --dump-config # verify: prints "# == dsh-plugin-wsl-env"
|
|
68
109
|
dsh --profile wsl # start
|
|
@@ -76,7 +117,12 @@ wsl.exe -d <distro> -u root -- apt-get install -y bubblewrap
|
|
|
76
117
|
|
|
77
118
|
From a checkout, `pnpm run doctor` is the one-command environment check: Windows/WSL versions, the distro and its shell, bubblewrap usability, systemd / the user manager / Linger, the optional tools, peer versions, the agent cache, a fresh-agent handshake, stale session scopes and the known profile-patch trap. Each failure prints one copy-paste remedy; `--json` is for scripts, and `--fix` sweeps stale scopes (package installation needs `--fix --install` and an explicit confirmation). `pnpm run diagnose` is its read-only alias. `pnpm run bootstrap <distro>` remains the narrower tool-install helper.
|
|
78
119
|
|
|
79
|
-
Upgrade by
|
|
120
|
+
Upgrade by installing again (Plugins page, or the `add` command). Uninstall on
|
|
121
|
+
the Plugins page, or with `dsh plugin --profile wsl remove dsh-plugin-wsl-env`
|
|
122
|
+
where the CLI is installed; the agent cache under `~/.cache/dsh-wsl` can then be
|
|
123
|
+
deleted. If you added a local `workspace-files-wsl` workaround to your profile to
|
|
124
|
+
restore previews, remove it after upgrading: the plugin no longer mounts that
|
|
125
|
+
row.
|
|
80
126
|
|
|
81
127
|
## Using it
|
|
82
128
|
|
|
@@ -96,18 +142,24 @@ Settings live on named rows in `$DSH_HOME/profiles/<name>/cordis.patch.yml`. The
|
|
|
96
142
|
|---|---|---|---|
|
|
97
143
|
| `wsl-shell` | `distro` | `''` | distro mode; empty/`auto` follows the workspace, `default` forces WSL's default |
|
|
98
144
|
| | `sandbox` | `true` | confine commands with `bubblewrap` |
|
|
99
|
-
| | `sessionSandbox` | `true` | run the session's commands in one systemd user scope |
|
|
145
|
+
| | `sessionSandbox` | shipped `true` | run the session's commands in one systemd user scope |
|
|
100
146
|
| | `agentBackend` | `auto` | `auto`, `native` or `shell` for the in-distro agent |
|
|
101
147
|
| | `maskWindowsDrive` | `false` | hide `/mnt` from confined commands |
|
|
102
148
|
| `wsl-fs` | `distro` | `''` | distro mode; empty/`auto` follows each target path |
|
|
103
149
|
| | `restrictToDistro` | `true` | under a fixed distro, refuse paths that belong to another distro |
|
|
104
150
|
| | `sandbox` | `true` | check confined writes against the policy |
|
|
105
|
-
| | `sessionSandbox` | `true` | run confined writes in the session runtime |
|
|
151
|
+
| | `sessionSandbox` | shipped `true` | run confined writes in the session runtime |
|
|
106
152
|
| | `substrate` | `agent` | in-distro agent; `share` is rejected at startup |
|
|
107
153
|
| `directory-picker-wsl` | `includeHostHome` | `true` | also list the Windows home directory |
|
|
108
154
|
| `subprocess-wsl` | `distro` | `''` | distro mode; empty/`auto` follows the launch directory |
|
|
109
155
|
|
|
110
|
-
`
|
|
156
|
+
`fs-routing` is the top-level router for root-level `ctx.fs` calls: its distro
|
|
157
|
+
settings are independent of `wsl-fs`, and it is a top-level row patched by id
|
|
158
|
+
like the others. `wsl-shell` and `wsl-fs` are inside the shipped `wsl` preset,
|
|
159
|
+
so overriding them by id does not work. Override the whole `preset-wsl` row
|
|
160
|
+
instead; [docs/CONFIGURATION.md](docs/CONFIGURATION.md) has the recipe and the
|
|
161
|
+
remaining keys. [`cordis.patch.yml`](cordis.patch.yml) is the commented
|
|
162
|
+
reference for every shipped value.
|
|
111
163
|
|
|
112
164
|
## Architecture
|
|
113
165
|
|
|
@@ -176,6 +228,9 @@ Real-machine probes run on Windows + WSL only. See [CONTRIBUTING.md](CONTRIBUTIN
|
|
|
176
228
|
|---|---|
|
|
177
229
|
| [docs/QUICKSTART.md](docs/QUICKSTART.md) | first run, recipes, compatibility |
|
|
178
230
|
| [docs/PERFORMANCE.md](docs/PERFORMANCE.md) | ext4 agent vs 9p, measured latency, how to reproduce |
|
|
231
|
+
| [docs/MIGRATION.md](docs/MIGRATION.md) | upgrading from earlier versions, release gates |
|
|
232
|
+
| [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md) | the tested Windows/WSL/distro matrix and scope decisions |
|
|
233
|
+
| [docs/API.md](docs/API.md) | the package's subpath exports at a glance |
|
|
179
234
|
| [docs/CONFIGURATION.md](docs/CONFIGURATION.md) | every configuration key and how to override it |
|
|
180
235
|
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | services, path routing, sandbox, error codes |
|
|
181
236
|
| [docs/LIMITATIONS.md](docs/LIMITATIONS.md) | what the plugin does not do |
|
package/SUPPORT.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|---|---|
|
|
7
7
|
| Operating system | Windows 10 and Windows 11 |
|
|
8
8
|
| Linux side | WSL2 with at least one distro, and systemd as PID 1 with a lingering user manager (`loginctl enable-linger`) for the shipped session runtime. Set `sessionSandbox: false` on the preset's `wsl-shell` to keep the per-command sandbox instead |
|
|
9
|
-
| DSH packages | `peerDependencies` declares a `0.2.
|
|
9
|
+
| DSH packages | `peerDependencies` declares a `0.2.2-rc.1` floor; newer versions require compatibility validation |
|
|
10
10
|
| Plugin version | the latest published version only |
|
|
11
11
|
| Node | 22.19+ (`^22.19.0`), or 24 and later (`>=24.0.0`) |
|
|
12
12
|
|
|
@@ -60,7 +60,7 @@ issue for one.
|
|
|
60
60
|
|
|
61
61
|
## Compatibility expectations
|
|
62
62
|
|
|
63
|
-
The DSH peer ranges start at `0.2.
|
|
63
|
+
The DSH peer ranges start at `0.2.2-rc.1`; development dependencies pin that
|
|
64
64
|
version exactly for testing. Cordis and Schemastery use caret peer ranges.
|
|
65
65
|
The accepted range does not guarantee compatibility with every newer release:
|
|
66
66
|
an upstream change can require a new release of this plugin.
|
|
@@ -96,7 +96,7 @@ what it cannot see:
|
|
|
96
96
|
| The diagnose report | `pnpm run diagnose <distro>` (read-only; review and redact before sharing) |
|
|
97
97
|
| Plugin version | `npm ls dsh-plugin-wsl-env`, or the git tag you built from |
|
|
98
98
|
| DSH version | the version of the harness you run |
|
|
99
|
-
| The composed configuration | `dsh --profile <name> --dump-config
|
|
99
|
+
| The composed configuration | On the CLI distribution, `dsh --profile <name> --dump-config` (the `dsh-plugin-wsl-env` layer and the rows it patches). The desktop app has no `dsh` command; attach the profile's `cordis.patch.yml` instead |
|
|
100
100
|
| Sandbox behaviour, in depth | the output of `npm run probe:sandbox`, run from inside the distro (`wsl.exe -d <distro>` first) — the probe calls `bwrap` and reads `lib/bwrap.js` there, so it needs both in the distro |
|
|
101
101
|
| What you expected and what happened | one paragraph each |
|
|
102
102
|
| A reproduction | the exact command, or the exact sequence of clicks |
|
|
Binary file
|
|
Binary file
|