dsh-plugin-wsl-env 0.26.4 → 0.27.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 +61 -0
- package/CONTRIBUTING.md +7 -4
- package/CONTRIBUTING.zh.md +3 -2
- package/README.md +1 -1
- package/SECURITY.md +21 -7
- package/SECURITY.zh.md +18 -5
- package/client.js +351 -48
- package/cordis.patch.yml +26 -10
- package/docs/API.md +2 -1
- package/docs/API.zh.md +2 -1
- package/docs/ARCHITECTURE.md +22 -4
- package/docs/ARCHITECTURE.zh.md +18 -4
- package/docs/CONFIGURATION.md +96 -12
- package/docs/CONFIGURATION.zh.md +80 -8
- package/docs/DIAGNOSTICS.md +22 -11
- package/docs/DIAGNOSTICS.zh.md +17 -9
- package/docs/LIMITATIONS.md +27 -4
- package/docs/LIMITATIONS.zh.md +20 -3
- package/docs/MIGRATION.md +2 -2
- package/docs/MIGRATION.zh.md +2 -2
- package/docs/QUICKSTART.md +31 -20
- package/docs/QUICKSTART.zh.md +16 -9
- package/docs/README.zh.md +1 -1
- package/docs/REQUIREMENTS.zh.md +3 -2
- package/lib/agent-confined.d.ts +9 -1
- package/lib/agent-confined.js +3 -3
- package/lib/bwrap.d.ts +16 -0
- package/lib/bwrap.js +9 -0
- package/lib/fs-routing.d.ts +3 -0
- package/lib/fs-routing.js +2 -0
- package/lib/messages.js +2 -2
- package/lib/plugin-update.d.ts +212 -0
- package/lib/plugin-update.js +283 -0
- package/lib/sandbox-core.d.ts +2 -0
- package/lib/sandbox-core.js +5 -3
- package/lib/session-runtime.d.ts +10 -1
- package/lib/session-runtime.js +3 -1
- package/lib/shell-env.js +1 -1
- package/lib/socket-isolation.d.ts +103 -0
- package/lib/socket-isolation.js +166 -0
- package/lib/status.d.ts +21 -8
- package/lib/status.js +53 -18
- package/lib/update-check.d.ts +49 -9
- package/lib/update-check.js +81 -28
- package/lib/wsl-doctor-tool.js +2 -0
- package/lib/wsl-filesystem.d.ts +39 -1
- package/lib/wsl-filesystem.js +51 -4
- package/lib/wsl-shell.d.ts +67 -3
- package/lib/wsl-shell.js +75 -12
- package/package.json +8 -3
- package/scripts/doctor.mjs +199 -3
- package/scripts/profile-preset.mjs +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,67 @@ were part of the record.
|
|
|
16
16
|
|
|
17
17
|
## [Unreleased]
|
|
18
18
|
|
|
19
|
+
## [0.27.0] - 2026-11-19
|
|
20
|
+
|
|
21
|
+
Minor release: harden the opt-in sandbox's process-authority surface and add the diagnostics and panel upgrades around it.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **The WSL environment panel now shows the plugin's version and upgrades it
|
|
26
|
+
in one click.** A **插件版本** card reports the installed and running
|
|
27
|
+
versions, asks the host's plugin manager (`listVersions`) for the newest
|
|
28
|
+
installable stable release, and labels a newer compatible release with a
|
|
29
|
+
reminder. **一键升级** posts to the new `wsl-plugin-update` route, which calls
|
|
30
|
+
the host's `updateBundle` only after that click; the panel reports
|
|
31
|
+
`applied`, `restart-required`, rollback, pending build scripts, and a
|
|
32
|
+
`not-updatable`/old-host fallback instead of claiming success. The route
|
|
33
|
+
caches its read for `wsl-plugin-update.cacheMs` (ten minutes by default), and
|
|
34
|
+
the periodic check remains read-only.
|
|
35
|
+
|
|
36
|
+
- **The WSL environment panel clears stored check results.** Each checked row
|
|
37
|
+
offers **清除** and the card offers **清除全部**: both `DELETE`
|
|
38
|
+
`/api/wsl-env/status` (with or without `?distro=<name>`), which drops the
|
|
39
|
+
in-memory and persisted verdict so the next load shows "not checked" again.
|
|
40
|
+
Clearing is host-local — it lists and probes no distro — so it still works
|
|
41
|
+
when `wsl.exe` or the doctor is unavailable; the panel disables it while a
|
|
42
|
+
check is in flight so an answer cannot restore a cleared row.
|
|
43
|
+
|
|
44
|
+
- **`socketIsolation` masks the sockets a confined process would use to escape
|
|
45
|
+
the mount profile.** The key applies to the command, write and routed rows
|
|
46
|
+
(`wsl-shell`, `wsl-fs`, `fs-routing`). `off` keeps the previous behavior;
|
|
47
|
+
`session-bus` binds `/dev/null` over `$XDG_RUNTIME_DIR/bus` and
|
|
48
|
+
`$XDG_RUNTIME_DIR/systemd/private`, so `systemd-run --user`/`systemctl --user`
|
|
49
|
+
fail inside the profile; `strict` also masks `/run/dbus/system_bus_socket`,
|
|
50
|
+
the container sockets the distro user can reach, and `/run/WSL` — the WSL
|
|
51
|
+
interop transport — so a Windows executable copied into the workspace fails
|
|
52
|
+
at the host bridge. The doctor's
|
|
53
|
+
`sandbox.isolation` row reports the effective stance and the detected
|
|
54
|
+
surfaces; `pnpm run preset --socket-isolation` (or `--strict`, which also
|
|
55
|
+
enables the `/mnt` mask) writes the nested rows, and the top-level
|
|
56
|
+
`fs-routing` row takes the same value by hand. The masks are a narrowing,
|
|
57
|
+
not a closure: same-user `/proc` and other IPC remain, the distro-wide
|
|
58
|
+
interop switch is still `[interop] enabled=false`, `enforcement` stays
|
|
59
|
+
`partial`, and `pnpm run probe:sandbox` proves the default reaches the user
|
|
60
|
+
manager while both stances do not (and strict blocks a copied PE).
|
|
61
|
+
|
|
62
|
+
- **The doctor names the effective `workspace-write` writable roots, and a
|
|
63
|
+
real-machine probe proves them.** `sandbox.grants` lists the `writableRoots`
|
|
64
|
+
configured on both nested rows, expands `~`, checks the physical-directory
|
|
65
|
+
rule, names a missing, unreadable or symlinked root with its remedy, and
|
|
66
|
+
warns when `wsl-shell` and `wsl-fs` disagree. `pnpm run probe:cache-write`
|
|
67
|
+
drives the per-command bwrap profile and the session runtime with a temporary
|
|
68
|
+
cache root: the granted directory is writable and an ungranted sibling stays
|
|
69
|
+
`EROFS`.
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
|
|
73
|
+
- **The panel's check actions are two fixed buttons: 快速检查 and 完整检查.**
|
|
74
|
+
No row relabels its action to **重新检查** after a result, and the full run
|
|
75
|
+
no longer appears as **修复** when it can repair plugin-owned state. Both
|
|
76
|
+
buttons are present before and after a check, and every click runs the doctor
|
|
77
|
+
again; **完整检查** still performs the `--fix-owned` run and shows its
|
|
78
|
+
before → after rows.
|
|
79
|
+
|
|
19
80
|
## [0.26.4] - 2026-11-18
|
|
20
81
|
|
|
21
82
|
Patch release: bound a wedged resident agent's request, localize the remaining
|
package/CONTRIBUTING.md
CHANGED
|
@@ -198,7 +198,8 @@ terminal if you would rather not see the prompt.
|
|
|
198
198
|
| `pnpm run e2e:install` | packed-tarball install/upgrade/uninstall into a temporary `DSH_HOME`; the newest published → current leg boots the profile with an overlay probe and asserts the three takeovers mount | yes; Windows + WSL |
|
|
199
199
|
| `pnpm run doctor` | the environment prerequisites, peers and caches (`--json` for scripts; `diagnose` is the read-only alias) | no; inside the distro |
|
|
200
200
|
| `pnpm run probe` | filesystem behaviour against a real distro | yes |
|
|
201
|
-
| `pnpm run probe:sandbox` | what bubblewrap confines and what it does not | no |
|
|
201
|
+
| `pnpm run probe:sandbox` | what bubblewrap confines and what it does not, including the socket-isolation stances and the strict interop-transport mask | no |
|
|
202
|
+
| `pnpm run probe:cache-write` | the writable-root grants through the per-command profile and the session runtime | no; inside the distro |
|
|
202
203
|
| `pnpm run probe:sandbox-shell` | the confined executor through a real boot | yes |
|
|
203
204
|
| `pnpm run probe:interop-shell` | resident and one-shot interop for drive and copied executables, with and without the `/mnt` mask | yes |
|
|
204
205
|
| `pnpm run probe:terminal` | the terminal provider | yes |
|
|
@@ -326,9 +327,11 @@ and `*-probe.yml` files in the same directory. Harness probes including `run.sh`
|
|
|
326
327
|
`terminal.sh`, `sandbox-shell.sh`, `interop-shell.sh`, `picker.sh`,
|
|
327
328
|
`fs-routing.sh`, `missing-wsl.sh` and `sandbox-off.sh` use the throwaway profile
|
|
328
329
|
whose setup is documented in the header of `test/probe/run.sh`. The distro probes
|
|
329
|
-
(`substrate.sh`, `watch.sh`, `agent.sh`, `exec.sh`) boot no
|
|
330
|
-
from a distro terminal and drive the resident agent through the
|
|
331
|
-
|
|
330
|
+
(`substrate.sh`, `watch.sh`, `agent.sh`, `exec.sh`, `cache-write.sh`) boot no
|
|
331
|
+
harness: they run from a distro terminal and drive the resident agent through the
|
|
332
|
+
`wsl.exe` interop transport; `cache-write.sh` additionally starts its own session
|
|
333
|
+
runtime scope and a per-command profile to prove the writable-root grants.
|
|
334
|
+
`sandbox.sh` and `mode.sh` need neither a harness boot nor a profile.
|
|
332
335
|
|
|
333
336
|
Keep probe output idempotent. Several probes delete their scratch files at the
|
|
334
337
|
start, because a leftover file from an earlier run changes the result.
|
package/CONTRIBUTING.zh.md
CHANGED
|
@@ -92,7 +92,8 @@ pnpm run sync:windows
|
|
|
92
92
|
| `pnpm run e2e:install` | 在临时 `DSH_HOME` 中安装/升级/卸载打包 tarball;“最新已发布版 → 当前版本”leg 会用 overlay 探针启动 profile,断言三个接管实际挂载 | 是;Windows + WSL |
|
|
93
93
|
| `pnpm run doctor` | 环境前置项、peer 和缓存(脚本使用 `--json`;`diagnose` 是只读别名) | 否;在发行版内 |
|
|
94
94
|
| `pnpm run probe` | 针对真实发行版的文件系统行为 | 是 |
|
|
95
|
-
| `pnpm run probe:sandbox` | bubblewrap
|
|
95
|
+
| `pnpm run probe:sandbox` | bubblewrap 隔离了什么、没有隔离什么,含 socket 隔离档位与 strict 的 interop 传输遮蔽 | 否 |
|
|
96
|
+
| `pnpm run probe:cache-write` | 通过 per-command profile 与 session runtime 验证可写根授权 | 否;在发行版内 |
|
|
96
97
|
| `pnpm run probe:sandbox-shell` | 通过真实启动验证受限执行器 | 是 |
|
|
97
98
|
| `pnpm run probe:interop-shell` | 对盘符可执行文件和复制出的可执行文件进行驻留式与一次性互操作,含/不含 `/mnt` 掩码 | 是 |
|
|
98
99
|
| `pnpm run probe:terminal` | 终端 provider | 是 |
|
|
@@ -146,7 +147,7 @@ import 固定版本 `@deepseek-ai/*` 包的测试也进入同样的列表,无
|
|
|
146
147
|
|
|
147
148
|
先运行一次 `pnpm exec playwright install chromium`,再运行测试套件:`pnpm run test:browser`。CI 的 `browser` 任务在 `ubuntu-latest` 上做同样的事;`pnpm test` 不依赖浏览器,因此没有浏览器的检出仍能运行常规检查。
|
|
148
149
|
|
|
149
|
-
探针是 shell 脚本,外加它们加载的小型插件文件:同目录下的 `*-probe.mjs` 和 `*-probe.yml`。harness 探针包括 `run.sh`、`terminal.sh`、`sandbox-shell.sh`、`interop-shell.sh`、`picker.sh`、`fs-routing.sh`、`missing-wsl.sh` 和 `sandbox-off.sh`,它们使用一次性 profile,其设置记录在 `test/probe/run.sh` 的文件头中。发行版探针(`substrate.sh`、`watch.sh`、`agent.sh`、`exec.sh`)不启动 harness:它们从发行版终端运行,并通过 `wsl.exe` 互操作传输驱动驻留 agent
|
|
150
|
+
探针是 shell 脚本,外加它们加载的小型插件文件:同目录下的 `*-probe.mjs` 和 `*-probe.yml`。harness 探针包括 `run.sh`、`terminal.sh`、`sandbox-shell.sh`、`interop-shell.sh`、`picker.sh`、`fs-routing.sh`、`missing-wsl.sh` 和 `sandbox-off.sh`,它们使用一次性 profile,其设置记录在 `test/probe/run.sh` 的文件头中。发行版探针(`substrate.sh`、`watch.sh`、`agent.sh`、`exec.sh`、`cache-write.sh`)不启动 harness:它们从发行版终端运行,并通过 `wsl.exe` 互操作传输驱动驻留 agent;`cache-write.sh` 还会自行启动一个 session runtime scope 与一个 per-command profile,以验证可写根授权。`sandbox.sh` 和 `mode.sh` 既不需要启动 harness,也不需要 profile。
|
|
150
151
|
|
|
151
152
|
保持探针输出幂等。若干探针会在开始时删除自己的临时文件,因为早先运行遗留的文件会改变结果。
|
|
152
153
|
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ Remaining prerequisites (no Node.js needed inside the distro):
|
|
|
43
43
|
| systemd + Linger (default session sandbox) | `[boot] systemd=true` in `/etc/wsl.conf`, `wsl --shutdown`, run `loginctl enable-linger "$USER"` once; without systemd set `sessionSandbox` to `auto` or `false` |
|
|
44
44
|
| Optional: `ripgrep`, `git`, `inotify-tools` | `pnpm run bootstrap <distro>` prints the install commands |
|
|
45
45
|
|
|
46
|
-
The plugin never edits the installed `resources/app.asar`.
|
|
46
|
+
The plugin never edits the installed `resources/app.asar`. The sidebar **WSL environment** panel shows the installed and running plugin versions, checks the registry through the host's plugin manager, and offers a one-click upgrade when a newer stable release exists; installing again from the Plugins page remains the fallback. An upgrade takes effect after a restart, or after a page reload when the host reports HMR applied it. Uninstall on the Plugins page, then `~/.cache/dsh-wsl` can be deleted. Details in [docs/QUICKSTART.md](docs/QUICKSTART.md).
|
|
47
47
|
|
|
48
48
|
## Do I need this plugin?
|
|
49
49
|
|
package/SECURITY.md
CHANGED
|
@@ -105,13 +105,27 @@ A report is still welcome if you find an escape that does not depend on interop,
|
|
|
105
105
|
if the masked profile is bypassable from `/mnt`, or if the plugin ever reports
|
|
106
106
|
`full` while interop is reachable.
|
|
107
107
|
|
|
108
|
-
One escape of that kind is known and
|
|
109
|
-
distro user's own service manager to start a unit,
|
|
110
|
-
mount profile — a write to the distro user's home
|
|
111
|
-
from inside the fence is refused. Masking `/mnt`
|
|
112
|
-
because it never involves interop. The
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
One escape of that kind is known and narrowed by an opt-in profile: a
|
|
109
|
+
confined command can ask the distro user's own service manager to start a unit,
|
|
110
|
+
and that unit runs outside the mount profile — a write to the distro user's home
|
|
111
|
+
succeeds where the same write from inside the fence is refused. Masking `/mnt`
|
|
112
|
+
does not narrow this path because it never involves interop. The confined rows'
|
|
113
|
+
(`wsl-shell`, `wsl-fs`, `fs-routing`) `socketIsolation` key masks the path when
|
|
114
|
+
enabled: `session-bus` binds `/dev/null` over `$XDG_RUNTIME_DIR/bus` and
|
|
115
|
+
`$XDG_RUNTIME_DIR/systemd/private` (so `systemd-run --user` fails inside the
|
|
116
|
+
profile), and `strict` also masks `/run/dbus/system_bus_socket`, the container
|
|
117
|
+
sockets the distro user can reach, and `/run/WSL` (the WSL interop transport);
|
|
118
|
+
in strict, an executable copied into the workspace still fails because `/init`
|
|
119
|
+
cannot reach the host bridge. The doctor's `sandbox.isolation` row reports the
|
|
120
|
+
effective stance and the detected surfaces. The default is `off`: the escape
|
|
121
|
+
remains reachable unless an operator chooses a stance, and the masks are a
|
|
122
|
+
user-level narrowing, not a closure — same-user `/proc` and other IPC remain,
|
|
123
|
+
and `enforcement` stays `partial`. The distro-wide switch is still `[interop]
|
|
124
|
+
enabled=false` plus `wsl.exe --shutdown`. The reproduction steps stay private; the exact
|
|
125
|
+
paths are listed in
|
|
126
|
+
[docs/CONFIGURATION.md](docs/CONFIGURATION.md#socket-isolation) because an
|
|
127
|
+
operator must know what the key covers. The finding, its verification and the
|
|
128
|
+
remaining decision are recorded in
|
|
115
129
|
[docs/superpowers/value-discovery-2026-11-10.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/value-discovery-2026-11-10.md)
|
|
116
130
|
(E4). Report new instances through the private channel above, as with any escape.
|
|
117
131
|
|
package/SECURITY.zh.md
CHANGED
|
@@ -93,11 +93,24 @@ WSL interop 启动 Windows 程序,例如 `/mnt/c/.../*.exe`。该程序在 Lin
|
|
|
93
93
|
如果你发现不依赖 interop 的逃逸、遮蔽后的 profile 可从 `/mnt` 绕过,或插件
|
|
94
94
|
在 interop 可达时报告 `full`,仍欢迎报告。
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
unit,而该 unit 在挂载 profile
|
|
98
|
-
|
|
99
|
-
interop
|
|
100
|
-
|
|
96
|
+
已知有一类逃逸可被一个默认关闭的档位收窄:受限命令可以请求发行版用户自己的
|
|
97
|
+
服务管理器启动一个 unit,而该 unit 在挂载 profile 之外运行——对发行版用户
|
|
98
|
+
主目录的写入会成功,而围栏内同样的写入会被拒绝。遮蔽 `/mnt` 不能收窄这条
|
|
99
|
+
路径,因为它从不涉及 interop。启用受限行(`wsl-shell`、`wsl-fs`、
|
|
100
|
+
`fs-routing`)的 `socketIsolation` 后,该路径会被遮蔽:`session-bus` 把
|
|
101
|
+
`/dev/null` 绑到
|
|
102
|
+
`$XDG_RUNTIME_DIR/bus` 与 `$XDG_RUNTIME_DIR/systemd/private`(受限 profile
|
|
103
|
+
内的 `systemd-run --user` 失败),`strict` 还会遮蔽
|
|
104
|
+
`/run/dbus/system_bus_socket`、发行版用户可触达的容器 socket 与 `/run/WSL`
|
|
105
|
+
(WSL interop 传输);strict 下复制进工作区的可执行文件仍会失败,因为
|
|
106
|
+
`/init` 连不到 host bridge。doctor 的 `sandbox.isolation` 行报告生效档位与
|
|
107
|
+
探测到的面。默认值是 `off`:除非 operator 选择档位,逃逸仍然可达;遮蔽是
|
|
108
|
+
用户级收窄,不是关闭——同用户 `/proc` 与其他 IPC 仍在,`enforcement` 仍是
|
|
109
|
+
`partial`。整发行版开关仍是 `[interop] enabled=false` 加
|
|
110
|
+
`wsl.exe --shutdown`。
|
|
111
|
+
复现步骤仍不公开;具体路径列在
|
|
112
|
+
[docs/CONFIGURATION.zh.md](docs/CONFIGURATION.zh.md#socket-isolation),因为
|
|
113
|
+
operator 需要知道该键覆盖什么。发现、验证与剩余决定记录在
|
|
101
114
|
[docs/superpowers/value-discovery-2026-11-10.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/value-discovery-2026-11-10.md)
|
|
102
115
|
(E4)。与其他逃逸一样,请通过上方的私有渠道报告新实例。
|
|
103
116
|
|