dsh-plugin-wsl-env 0.26.0 → 0.26.1
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 +58 -0
- package/README.md +54 -157
- package/SUPPORT.md +2 -2
- package/SUPPORT.zh.md +2 -2
- package/docs/ARCHITECTURE.md +13 -4
- package/docs/ARCHITECTURE.zh.md +10 -3
- package/docs/CONFIGURATION.md +5 -8
- package/docs/CONFIGURATION.zh.md +4 -6
- package/docs/DIAGNOSTICS.md +16 -0
- package/docs/DIAGNOSTICS.zh.md +11 -0
- package/docs/MIGRATION.md +4 -1
- package/docs/MIGRATION.zh.md +4 -1
- package/docs/PEER-PARITY.md +16 -0
- package/docs/QUICKSTART.md +20 -14
- package/docs/QUICKSTART.zh.md +17 -15
- package/docs/README.zh.md +58 -145
- package/docs/RELEASING.md +2 -2
- package/docs/REQUIREMENTS.zh.md +1 -1
- package/docs/ROADMAP-1.0.md +1 -1
- package/docs/VALUE.md +27 -0
- package/docs/VALUE.zh.md +27 -0
- package/docs/screenshots/with-plugin.png +0 -0
- package/docs/screenshots/with-plugin.svg +59 -0
- package/docs/screenshots/with-plugin.zh.png +0 -0
- package/docs/screenshots/with-plugin.zh.svg +56 -0
- package/docs/screenshots/without-plugin.png +0 -0
- package/docs/screenshots/without-plugin.svg +50 -0
- package/docs/screenshots/without-plugin.zh.png +0 -0
- package/docs/screenshots/without-plugin.zh.svg +45 -0
- package/lib/doctor-report.js +8 -1
- package/lib/peer-versions.d.ts +53 -0
- package/lib/peer-versions.js +137 -0
- package/lib/update-check.d.ts +2 -2
- package/lib/update-check.js +2 -2
- package/lib/wsl-doctor-command.js +2 -1
- package/package.json +9 -2
- package/scripts/doctor.mjs +127 -9
package/docs/QUICKSTART.md
CHANGED
|
@@ -7,9 +7,17 @@ This page is the entry point; every claim links to the document that owns it.
|
|
|
7
7
|
|
|
8
8
|
## 0. Do you need this plugin?
|
|
9
9
|
|
|
10
|
-
If the harness can run inside the distro, installing the CLI there
|
|
11
|
-
|
|
12
|
-
[README's decision table](../README.md#do-i-need-this-plugin) has the cases
|
|
10
|
+
If the harness can run inside the distro, installing the CLI there and
|
|
11
|
+
skipping this plugin is simpler — the
|
|
12
|
+
[README's decision table](../README.md#do-i-need-this-plugin) has the cases:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# inside the distro; the CLI needs Node >= 24.9
|
|
16
|
+
npm install -g @deepseek-ai/dsh
|
|
17
|
+
dsh web # browser UI, reached through WSL's localhost forwarding
|
|
18
|
+
dsh headless "run the tests" # one task, one answer, exit
|
|
19
|
+
```
|
|
20
|
+
|
|
13
21
|
The rest of this page assumes the desktop app stays on Windows and this plugin
|
|
14
22
|
supplies the WSL environment.
|
|
15
23
|
|
|
@@ -59,25 +67,23 @@ The desktop app has no `dsh` command; open **Plugins** in the sidebar, choose
|
|
|
59
67
|
**Add plugin**, and enter the exact package name `dsh-plugin-wsl-env`. That
|
|
60
68
|
writes the profile's `package.json` and its `dsh.profile.bundles` entry.
|
|
61
69
|
|
|
62
|
-
With the CLI distribution (`dsh` on `PATH`), from Windows PowerShell:
|
|
63
|
-
|
|
64
|
-
```powershell
|
|
65
|
-
dsh plugin --profile <profile> add dsh-plugin-wsl-env
|
|
66
|
-
# if it resolves to a stale version (same-day registry metadata cache), pin it:
|
|
67
|
-
# dsh plugin --profile <profile> add dsh-plugin-wsl-env@<latest>
|
|
68
|
-
dsh --profile <profile> --dump-config # the plugin rows must be there
|
|
69
|
-
```
|
|
70
|
-
|
|
71
70
|
For a profile that already overrides the preset, keep the override as the full
|
|
72
71
|
`preset-wsl` block — `pnpm run preset --check <patch>` fails loudly when a layer
|
|
73
72
|
targets `wsl-shell`/`wsl-fs` by id.
|
|
74
73
|
|
|
74
|
+
The plugin never edits the installed `resources/app.asar`: an app upgrade
|
|
75
|
+
cannot drop the bridge, and a plugin update only needs a reinstall and restart.
|
|
76
|
+
Upgrade = install again on the Plugins page, then restart (the harness has no
|
|
77
|
+
hot reload); uninstall happens on the same page, after which `~/.cache/dsh-wsl`
|
|
78
|
+
can be deleted. If you added a local `workspace-files-wsl` workaround to your
|
|
79
|
+
profile to restore previews, remove it after upgrading: the plugin no longer
|
|
80
|
+
mounts that row.
|
|
81
|
+
|
|
75
82
|
## 3. Open a WSL workspace
|
|
76
83
|
|
|
77
84
|
Start the desktop app the way its Start-menu shortcut does: `DeepSeek Harness.exe`,
|
|
78
85
|
no arguments — it opens the profile the app is configured with (the Plugins page
|
|
79
|
-
writes into that one).
|
|
80
|
-
profile of that name.)
|
|
86
|
+
writes into that one).
|
|
81
87
|
|
|
82
88
|
In the GUI, open a folder through the picker (`\\wsl.localhost\<distro>\home\<you>\proj`)
|
|
83
89
|
or an UNC path directly. The session's commands, file tools, terminal and previews
|
package/docs/QUICKSTART.zh.md
CHANGED
|
@@ -7,10 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
## 0. 需要这个插件吗?
|
|
9
9
|
|
|
10
|
-
如果 harness 可以整个跑在发行版里,把 CLI
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
如果 harness 可以整个跑在发行版里,把 CLI 装进去并跳过本插件会更简单——
|
|
11
|
+
判断表见 [README](README.zh.md#需要这个插件吗):
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# 在发行版内执行;CLI 要求 Node >= 24.9
|
|
15
|
+
npm install -g @deepseek-ai/dsh
|
|
16
|
+
dsh web # 浏览器界面,经 WSL 的 localhost 转发访问
|
|
17
|
+
dsh headless "run the tests" # 单任务、输出答案后退出
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
本页其余部分假定桌面应用留在 Windows,由本插件提供 WSL 环境。
|
|
14
21
|
|
|
15
22
|
## 1. 前置条件
|
|
16
23
|
|
|
@@ -51,24 +58,19 @@ agent 缓存,两者都会复检;以及确认后的 Windows git 信任)或
|
|
|
51
58
|
`dsh-plugin-wsl-env` 安装。这一步写入该 profile 的 `package.json` 与
|
|
52
59
|
`dsh.profile.bundles`。
|
|
53
60
|
|
|
54
|
-
使用 CLI 发行版(`dsh` 在 `PATH` 上)时,在 Windows PowerShell 中:
|
|
55
|
-
|
|
56
|
-
```powershell
|
|
57
|
-
dsh plugin --profile <profile> add dsh-plugin-wsl-env
|
|
58
|
-
# 若解析到旧版本(发布当天的元数据缓存),显式指定:
|
|
59
|
-
# dsh plugin --profile <profile> add dsh-plugin-wsl-env@<latest>
|
|
60
|
-
dsh --profile <profile> --dump-config # 输出中必须包含插件的行
|
|
61
|
-
```
|
|
62
|
-
|
|
63
61
|
如果 profile 已覆盖 preset,请保持覆盖为完整的
|
|
64
62
|
`preset-wsl` 块——当某个层直接按 id 指向 `wsl-shell`/`wsl-fs` 时,
|
|
65
63
|
`pnpm run preset --check <patch>` 会明确报错。
|
|
66
64
|
|
|
65
|
+
插件不修改已安装的 `resources/app.asar`:应用升级不受影响,插件升级只需重新
|
|
66
|
+
安装并重启。升级 = 在 Plugins 页重新安装后重启(harness 无热重载);卸载也在
|
|
67
|
+
Plugins 页,之后可删 `~/.cache/dsh-wsl`。曾为恢复预览加过 `workspace-files-wsl`
|
|
68
|
+
临时覆盖的,升级后删除:插件不再挂载该行。
|
|
69
|
+
|
|
67
70
|
## 3. 打开 WSL 工作区
|
|
68
71
|
|
|
69
72
|
启动桌面应用的方式与它安装的快捷方式一致:`DeepSeek Harness.exe`,不带参数——
|
|
70
|
-
它打开的是应用自己配置的 profile(也就是 Plugins
|
|
71
|
-
发行版:`dsh --profile <名字>` 启动指定名字的 profile。)
|
|
73
|
+
它打开的是应用自己配置的 profile(也就是 Plugins 页面写入的那个)。
|
|
72
74
|
|
|
73
75
|
在 GUI 中,通过选择器打开文件夹(`\\wsl.localhost\<distro>\home\<you>\proj`),
|
|
74
76
|
或直接打开 UNC 路径。会话的命令、文件工具、终端和预览
|
package/docs/README.zh.md
CHANGED
|
@@ -6,61 +6,67 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/dsh-plugin-wsl-env)
|
|
7
7
|
[](../LICENSE)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
把 WSL 2 发行版变成 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 桌面会话的执行环境:命令、文件、终端都在发行版内运行,harness 留在 Windows。DeepSeek Harness 有两种形态——带 Web UI 的 npm CLI,与 macOS/Windows 桌面应用;本插件只服务其中一种组合:Windows 桌面应用 + WSL 2 中的项目。发行版内不装服务、不开端口;受限命令经 `bubblewrap` 沙箱。
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+

|
|
12
12
|
|
|
13
|
-
|
|
13
|
+

|
|
14
14
|
|
|
15
|
-
**刚接触?** 从 [
|
|
15
|
+
**刚接触?** 从 [QUICKSTART.zh.md](QUICKSTART.zh.md) 开始。
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## 为什么用这个插件
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
发行版里,直接在发行版终端运行。没有 UNC 路径、没有 9p 往返,也没有
|
|
21
|
-
Windows→发行版的 agent。
|
|
19
|
+
「agent 在 WSL 项目上反复失败时,让桌面应用直接在发行版环境里工作——不搬家、不装服务、不放弃沙箱。」
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
- 模型的强项是 POSIX,弱项是 CMD/PowerShell:Windows 工作区只能用弱项,WSL 工作区经 `wsl.exe` 逐条包装又丢失环境与状态。本插件让脚本在持久的发行版会话里原样运行。
|
|
22
|
+
- 命令跑在发行版登录 shell:`PATH`、`nvm`、`cargo`、`pyenv`、rc 文件全部生效。
|
|
23
|
+
- 发行版内无服务、无端口;唯一持久物是 `~/.cache/dsh-wsl/agent/` 下的 agent 缓存。
|
|
24
|
+
- 受限命令默认经 `bubblewrap`;缺 bwrap 时命令失败,不脱箱。
|
|
25
|
+
- 环境按会话生效:发行版目录会话进发行版,Windows 目录会话不变,可同进程并存。
|
|
26
|
+
- 与 GUI 集成:文件夹选择器列出发行版,终端在发行版内打开,模型可见监听端口。
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
完整论证(为什么是 Linux 而不是 PowerShell、价值与代价)见 [VALUE.zh.md](VALUE.zh.md)。
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|---|---|
|
|
34
|
-
| 工作区在 WSL 内,终端或浏览器界面够用 | 装在发行版里的 CLI |
|
|
35
|
-
| 想要 Windows 桌面应用,命令与文件落在发行版 | 本插件 |
|
|
36
|
-
| 同一会话要同时访问 Windows 与 WSL 工作区 | 本插件(按路径路由正是它的价值) |
|
|
30
|
+
## 安装
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
管理它的插件——桌面场景请用应用内的 Plugins 页面。[VALUE.zh.md](VALUE.zh.md)
|
|
40
|
-
有完整对照和"不适用"清单。
|
|
32
|
+
桌面应用没有 `dsh` 可执行程序;插件经 **Plugins** 页安装。三步:
|
|
41
33
|
|
|
42
|
-
|
|
34
|
+
1. `wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap`
|
|
35
|
+
2. Plugins 页:**Add plugin** → `dsh-plugin-wsl-env`,启用。
|
|
36
|
+
3. 重启应用,打开发行版内的文件夹;输入 `/wsl-doctor`(宿主侧执行)得到 `ready`/`blocked` 裁决。
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
其余前置(发行版内不需要 Node.js):
|
|
45
39
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
40
|
+
| 前置 | 说明 |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Windows 10/11 + WSL 2 + ≥1 个发行版 | `wsl.exe -l -v` 显示 `VERSION 2`;缺则 `wsl.exe --install` |
|
|
43
|
+
| systemd + Linger(默认会话沙箱需要) | `/etc/wsl.conf` 设 `[boot] systemd=true`,`wsl --shutdown`,执行一次 `loginctl enable-linger "$USER"`;无 systemd 时设 `sessionSandbox` 为 `auto` 或 `false` |
|
|
44
|
+
| 可选:`ripgrep`、`git`、`inotify-tools` | `pnpm run bootstrap <发行版>` 打印安装命令 |
|
|
51
45
|
|
|
52
|
-
|
|
46
|
+
插件不修改已安装的 `resources/app.asar`。升级 = 重新安装后重启;卸载在 Plugins 页面,之后可删 `~/.cache/dsh-wsl`。细节见 [QUICKSTART.zh.md](QUICKSTART.zh.md)。
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
## 需要这个插件吗?
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
- **工具链支持。** Node、Python、Rust、Go、C/C++ 和多数构建系统先在 Linux 上验证。Windows 支持往往是移植,引号、路径、换行和文件锁都不一样。
|
|
58
|
-
- **Shell 语义。** PowerShell 和 `cmd` 在引号、转义、管道、环境变量、退出码和路径分隔符上都与 POSIX 不同。混用两套语法,很容易产生看起来像模型犯的低级错误。
|
|
59
|
-
- **环境漂移。** Windows 侧的 PowerShell 版本、执行策略、PATH 和已装工具因人而异;Linux 环境更容易复现和容器化。
|
|
50
|
+
harness 能整个跑在发行版里时,不用本插件更简单:把 CLI 装进发行版即可(命令见 [QUICKSTART §0](QUICKSTART.zh.md))。harness 必须留在 Windows 时才用本插件:
|
|
60
51
|
|
|
61
|
-
|
|
52
|
+
| 场景 | 用什么 |
|
|
53
|
+
|---|---|
|
|
54
|
+
| 终端或浏览器界面够用 | 发行版内的 CLI |
|
|
55
|
+
| 要 Windows 桌面应用,命令与文件在发行版 | 本插件 |
|
|
56
|
+
| 一个会话同时访问 Windows 与 WSL 目录 | 本插件 |
|
|
62
57
|
|
|
63
|
-
|
|
58
|
+
坑:`desktop` profile 名由 Electron 应用独占,npm CLI 拒绝管理它的插件——用应用内 Plugins 页。完整对照见 [VALUE.zh.md](VALUE.zh.md)。
|
|
59
|
+
|
|
60
|
+
## 使用
|
|
61
|
+
|
|
62
|
+
打开发行版文件夹作为工作区,如 `\\wsl.localhost\ubuntu\home\you\project`。
|
|
63
|
+
|
|
64
|
+
- 打开哪个发行版的文件夹,就在哪个发行版执行。
|
|
65
|
+
- 命令在发行版登录 shell 中运行;`/home/you/x` 与 `\\wsl.localhost\ubuntu\home\you\x` 是同一文件。
|
|
66
|
+
- **New terminal** 在同一发行版、同一目录打开 shell。
|
|
67
|
+
- 模型可见监听端口并返回 dev server URL(WSL 2 转发 localhost)。
|
|
68
|
+
- 权限:`read-only` / `workspace-write`(默认)/ `danger-full-access`;只有最后一档不经沙箱。
|
|
69
|
+
- 侧边栏 **WSL 环境** 面板按发行版诊断,见 [DIAGNOSTICS.zh.md](DIAGNOSTICS.zh.md)。
|
|
64
70
|
|
|
65
71
|
## 方案对比
|
|
66
72
|
|
|
@@ -71,127 +77,36 @@ Windows 上的编程工具要在 WSL 项目中工作,有三条路:把整个
|
|
|
71
77
|
| 命令沙箱 | 无 | `bubblewrap` |
|
|
72
78
|
| 卸载 | 删除服务 | 删除缓存 |
|
|
73
79
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## 要求
|
|
77
|
-
|
|
78
|
-
- Windows 10 或 11,启用 WSL 2,并至少有一个发行版。
|
|
79
|
-
- 发行版内安装 `bubblewrap`,必需。
|
|
80
|
-
- 默认的会话沙箱需要 systemd:在 `/etc/wsl.conf` 设置 `[boot] systemd=true`,重启 WSL,然后执行一次 `loginctl enable-linger "$USER"`。没有 systemd 时,在 `wsl-shell` 和 `wsl-fs` 上把 `sessionSandbox` 设为 `auto`(可用时仍用 scope,否则每条命令单独约束)或显式 `false`。
|
|
81
|
-
- 可选:`ripgrep` 用于搜索,`git` 用于变更快照,`inotify-tools` 用于文件监视。
|
|
82
|
-
|
|
83
|
-
发行版内不需要 Node.js。
|
|
84
|
-
|
|
85
|
-
## 安装
|
|
86
|
-
|
|
87
|
-
Windows 桌面应用**没有 `dsh` 可执行程序**:安装器只写 `DeepSeek Harness.exe`,
|
|
88
|
-
CLI 入口在 `resources/app.asar` 内部(探针脚本通过 `ELECTRON_RUN_AS_NODE` 启动它)。
|
|
89
|
-
按你手上的发行版二选一。
|
|
90
|
-
|
|
91
|
-
**桌面应用**:在侧边栏打开 **插件**,点 **Add plugin**,填精确包名
|
|
92
|
-
`dsh-plugin-wsl-env` 并启用。插件管理器写入当前 profile 的 `package.json`
|
|
93
|
-
(依赖项与 `dsh.profile.bundles`),与下面的 CLI 命令得到的状态一致。从检出
|
|
94
|
-
目录运行时,改为以链接形式添加该目录。启动方式与安装器创建的快捷方式一致:
|
|
95
|
-
`DeepSeek Harness.exe`,不带参数。桌面应用打开的是它自己配置的 profile——也就是
|
|
96
|
-
Plugins 页面写入的那个;要用别的 profile 属于 CLI 发行版的事
|
|
97
|
-
(`dsh --profile <名字>`)。
|
|
98
|
-
|
|
99
|
-
**不对宿主打补丁。** 插件从不修改已安装的 `resources/app.asar`。
|
|
100
|
-
**在 VS Code 中打开(WSL)** 的桥完全在插件行内,因此应用升级不会丢掉它,
|
|
101
|
-
插件升级也只需重新安装并重启——没有重新打 archive 补丁的步骤。应用自带的
|
|
102
|
-
"Open in app" 是独立的上游缺陷,见
|
|
103
|
-
[docs/UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md)。
|
|
104
|
-
|
|
105
|
-
**CLI 发行版**(`dsh` 在 `PATH` 上),在 Windows 终端执行:
|
|
106
|
-
|
|
107
|
-
```powershell
|
|
108
|
-
dsh wsl --from-default-profile web --dump-config # 创建 profile
|
|
109
|
-
dsh plugin --profile wsl add dsh-plugin-wsl-env # 安装插件及其配置
|
|
110
|
-
dsh --profile wsl --dump-config # 检查:输出 "# == dsh-plugin-wsl-env"
|
|
111
|
-
dsh --profile wsl # 启动
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
第一条命令之前安装 `bubblewrap`:
|
|
115
|
-
|
|
116
|
-
```powershell
|
|
117
|
-
wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
在插件检出目录中,`pnpm run doctor` 是一键环境体检:Windows/WSL 平台、每个发行版的 WSL 模式与身份、`.wslconfig` 与 `/etc/wsl.conf` 交叉核对、发行版与宿主卷、时钟与 DNS、bubblewrap 可用性、systemd / user manager / Linger、可选工具、peer 版本、native agent 与其缓存、新 agent 握手、证明链路完好的 shell 冒烟腿(帧 I/O、受限围栏、批量 substrate)与一条 native HELLO 腿、残留会话 scope、已知的 profile 补丁与废弃键陷阱。报告逐项列出每个检查——按 distro 分组,每项带显式状态标记,失败项下附可复制的处理办法——并以裁决收尾:`ready`(本次运行覆盖的检查全部通过,不保证每条命令都成功)或 `blocked`(列明待修项),按生效配置计算。运行可以收窄范围:`--quick` 只探首条命令的前置项(约 10 秒),`--sections <分区清单>`(逗号分隔)只运行指定分区,且范围化报告会把未运行的检查显式列为跳过项。`--json` 供脚本使用;`--fix` 会复核它修过的项——插件自有的残留 scope 清扫与 agent 缓存清理是安全自动的,安装包需要 `--fix --install` 并显式确认,`--fix-owned` 只运行插件自有的这两类(即侧边栏面板的“修复”动作)——`--all` 检查每个已装发行版,`--bundle <路径>` 写出可附加到问题报告的诊断文件(`--redact` 将路径脱敏)。固定骨架按宿主语言渲染——从 Windows 区域设置检测,可用 `--locale <标签>` 或 `DSH_WSL_DOCTOR_LOCALE` 覆盖;`--json` 保持语言无关。同一份报告经三个入口给出:本 CLI、`/wsl-doctor` 命令(在输入框输入——宿主侧执行,不进模型对话)、以及 `wsl_doctor` 模型工具(进程内采集,合并常驻 agent 的实时状态)。`DSH_WSL_DOCTOR` 还携带一条现成命令(`sh -c "$DSH_WSL_DOCTOR --json"`),可在发行版内直接重放 doctor。`pnpm run diagnose` 是 CLI 的只读别名。`pnpm run bootstrap <发行版>` 仍是较窄的工具安装助手。
|
|
121
|
-
|
|
122
|
-
插件大约每天自行检查一次更新(启动后 2–10 分钟内首查),方式是询问应用的插件管理器——它从不自行联网。当存在更新的稳定版时,每个发行版会话中受管的 `DSH_WSL_PLUGIN_UPDATE` 变量会携带该事实;补丁配置里的 `wsl-update-check.enabled: false` 可关闭该检查。升级保持手动,因为 harness 没有热重载:重新安装(Plugins 页面或 `add` 命令),然后重启。
|
|
123
|
-
|
|
124
|
-
卸载:在 Plugins 页面移除,或在 CLI 发行版执行 `dsh plugin --profile wsl remove dsh-plugin-wsl-env`;之后可删除 `~/.cache/dsh-wsl`。如果你为了恢复预览在 profile 里加过 `workspace-files-wsl` 的临时覆盖,升级后请删掉:插件不再挂载该行。
|
|
125
|
-
|
|
126
|
-
## 使用
|
|
127
|
-
|
|
128
|
-
打开一个发行版文件夹作为工作区,例如 `\\wsl.localhost\ubuntu\home\you\project`。
|
|
129
|
-
|
|
130
|
-
- 打开哪个发行版的文件夹,就在哪个发行版执行——即使它不是 WSL 的默认发行版。
|
|
131
|
-
- 命令在发行版登录 shell 中运行。`/home/you/x` 与 `\\wsl.localhost\ubuntu\home\you\x` 是同一个文件。
|
|
132
|
-
- **New terminal** 在同一发行版、同一目录打开 shell。
|
|
133
|
-
- 模型能看到监听端口,并返回 dev server 的 URL。WSL 2 会把 localhost 转发到 Windows。
|
|
134
|
-
- 权限选择器:`read-only`、`workspace-write`(默认)、`danger-full-access`。只有 `danger-full-access` 不经过沙箱。
|
|
135
|
-
- 侧边栏的 **WSL 环境** 面板是诊断页:列出已安装的发行版,可对单个发行版运行 doctor 快速检查(bwrap / systemd / Linger 等前置项),并提供一次完整运行(`--fix-owned`,存在插件可修复项时标为 **修复**,否则标为 **完整检查**)——清扫残留 session scope、清理损坏的 agent 缓存并逐一复检,不安装软件包、不改写 Windows 配置;其余告警保留各自的手动处理办法。每个已检查的行还显示上次检查时间、来源(**手动** 或页面加载时的 **后台** 复核)与结果结构——各状态计数与分区分布。每个已检查的行还可展开查看本次运行执行的全部检查项,按分区分组、逐项带状态与依据(快速检查未触及的目录项只计数、不伪装成结果),绿色或异常的行都能被审计而不只是被相信。不必再打开 doctor 就能决定下一步。每个发行版的最后一次结果保存在 `$DSH_HOME/cache/dsh-plugin-wsl-env/status.json`(缺省回退到 `~/.dsh`),页面刷新或应用重启后仍可见;加载时只对正在运行的发行版在后台复核(不会启动已停止的发行版),后台运行失败会按实际观测覆盖已存结果。不标记“已过期”:时间戳就是时间戳。经 **添加工作区** 选中发行版目录时,会问一次 **Remote WSL**(默认,发行版内执行)还是 **Windows 访问**(按 9p 共享打开,没有 Linux 工具链),后者记录在 `auto-preset` 行的 `windowsWorkspaces` 中。这些记录下来的目录也会出现在能感知后果的位置:运行非 WSL preset 的发行版工作区会在输入框上方常驻一条警示(会话尚未开始时可一键切换;已开始后可修正访问记录),会话页头在警示收起后保留 **WSL工作区正以Windows模式打开** 小标记,面板里也列出已记录的目录供审计。
|
|
80
|
+
桌面远程更成熟;CLI 装进 WSL 更简单。本插件用于:harness 留在 Windows,且命令需要沙箱。
|
|
136
81
|
|
|
137
82
|
## 配置
|
|
138
83
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
| 行 | 键 | 默认值 | 作用 |
|
|
142
|
-
|---|---|---|---|
|
|
143
|
-
| `wsl-shell` | `distro` | `''` | 发行版模式;空/`auto` 跟随工作区,`default` 强制 WSL 默认 |
|
|
144
|
-
| | `sandbox` | `true` | 用 `bubblewrap` 约束命令 |
|
|
145
|
-
| | `sessionSandbox` | `false`;随包 `true` | 会话命令跑在同一个 systemd user scope 中 |
|
|
146
|
-
| | `agentBackend` | `auto` | 发行版内 agent:`auto`、`native` 或 `shell` |
|
|
147
|
-
| | `maskWindowsDrive` | `false` | 让受限命令看不到 `/mnt` |
|
|
148
|
-
| | `writableRoots` | `[]` | 额外可写的发行版目录(工具链缓存等;`wsl-fs` 上配同一列表) |
|
|
149
|
-
| `wsl-fs` | `distro` | `''` | 发行版模式;空/`auto` 跟随每个目标路径 |
|
|
150
|
-
| | `restrictToDistro` | `true` | 固定发行版(`default` 或名字)时拒绝属于其他发行版的路径 |
|
|
151
|
-
| | `sandbox` | `true` | 按策略检查受限写入 |
|
|
152
|
-
| | `sessionSandbox` | `false`;随包 `true` | 受限写入跑在会话 runtime 中 |
|
|
153
|
-
| | `substrate` | `agent` | 发行版内 agent;`share` 在启动时被拒绝 |
|
|
154
|
-
| | `writableRoots` | `[]` | 与 `wsl-shell` 相同的额外可写目录列表 |
|
|
155
|
-
| `directory-picker-wsl` | `includeHostHome` | `true` | 同时提供 Windows 路径分支(从驱动器开始) |
|
|
156
|
-
| `subprocess-wsl` | `distro` | `''` | 发行版模式;空/`auto` 跟随启动目录 |
|
|
157
|
-
| `wsl-preflight` | `distro` | `''` | 环境检查探测的发行版;空/`auto` 跟随会话工作区 |
|
|
158
|
-
| | `startup` | `true` | 插件加载时预先运行同一组检查,让判定在任何会话打开之前就出现在日志里 |
|
|
159
|
-
|
|
160
|
-
`fs-routing` 是根级 `ctx.fs` 调用的顶层路由:它的发行版设置独立于 `wsl-fs`,也是按 id 在顶层补丁中覆盖的行。`wsl-shell` 和 `wsl-fs` 位于随包的 `wsl` preset 中,按 id 覆盖无效。要改就覆盖整个 `preset-wsl` 行;配方和其余键见 [CONFIGURATION.zh.md](CONFIGURATION.zh.md)。[`cordis.patch.yml`](../cordis.patch.yml) 是随包值的注释参考。
|
|
84
|
+
配置在 `$DSH_HOME/profiles/<名字>/cordis.patch.yml` 的命名行上。`wsl-shell`/`wsl-fs` 嵌套在 `preset-wsl` 里,按 id 覆盖无效,须整行覆盖。全部键与配方见 [CONFIGURATION.zh.md](CONFIGURATION.zh.md);[`cordis.patch.yml`](../cordis.patch.yml) 是随包值的注释参考。
|
|
161
85
|
|
|
162
86
|
## 架构
|
|
163
87
|
|
|
164
|
-
一个 harness 进程可同时服务 Windows 文件夹会话和发行版文件夹会话。服务分两层挂载:
|
|
165
|
-
|
|
166
88
|
```text
|
|
167
|
-
|
|
89
|
+
应用层(每进程)
|
|
168
90
|
├─ directory-picker-wsl、workspace-files、subprocess-wsl
|
|
169
|
-
├─ fs-routing
|
|
170
|
-
└─ auto-preset
|
|
91
|
+
├─ fs-routing:根级文件系统按路径分流
|
|
92
|
+
└─ auto-preset:会话打开发行版目录时绑定 wsl preset
|
|
171
93
|
|
|
172
|
-
wsl preset
|
|
94
|
+
wsl preset(每会话)
|
|
173
95
|
├─ wsl-shell:命令
|
|
174
96
|
└─ wsl-fs:文件操作
|
|
175
97
|
```
|
|
176
98
|
|
|
177
|
-
|
|
178
|
-
- `wsl-fs` 通过同一个发行版内 agent 提供读写。受限写入运行在 mount profile 与策略一致的常驻 agent 中,由内核执行写入边界。没有宿主机侧的文件回退:agent 不可用时文件操作直接失败。
|
|
179
|
-
- GUI 文件树和预览使用随包的 `workspace-files` 行,而不是插件的替换行:它的客户端半边是浏览器的 `file` 资源提供者。WSL 路径经根级路由读取,仍在发行版内,但会多几次 agent 往返。
|
|
180
|
-
- 应用层服务按路径分流:发行版 UNC 路径走发行版,Windows 盘符路径留在宿主。见 [docs/root-fs-routing.md](root-fs-routing.md)。
|
|
99
|
+
命令与文件走发行版内常驻 agent(systemd user scope + `bubblewrap` profile)。发行版 UNC 路径进发行版,盘符路径留宿主。详见 [ARCHITECTURE.zh.md](ARCHITECTURE.zh.md)。
|
|
181
100
|
|
|
182
101
|
## 沙箱
|
|
183
102
|
|
|
184
103
|
| 模式 | 命令可以做什么 |
|
|
185
104
|
|---|---|
|
|
186
|
-
| `read-only` |
|
|
187
|
-
| `workspace-write` |
|
|
188
|
-
| `danger-full-access` |
|
|
189
|
-
|
|
190
|
-
设置 `sessionSandbox: false` 时,`workspace-write` 命令使用私有的 `/tmp`,而不是发行版的真实 `/tmp`;`read-only` 不挂载可写的 `/tmp`。
|
|
105
|
+
| `read-only` | 读整个发行版;仅新挂载的 `/dev`,其余不可写 |
|
|
106
|
+
| `workspace-write` | 加上会话工作区与配置的 `writableRoots` |
|
|
107
|
+
| `danger-full-access` | 不经沙箱 |
|
|
191
108
|
|
|
192
|
-
`bubblewrap`
|
|
193
|
-
|
|
194
|
-
隔离上报为 `partial`。发行版内的命令仍可通过 `/mnt/c` 启动 Windows 程序,`bubblewrap` 无法控制 Windows 进程。`maskWindowsDrive: true` 让受限视图看不到 `/mnt`,但会被 `interopVisibility: visible` 覆盖;遮罩只能收窄这个洞,不能关死。关闭 WSL interop 需要另行在发行版的 `/etc/wsl.conf` 中设置 `[interop] enabled=false`。见 [ARCHITECTURE.zh.md](ARCHITECTURE.zh.md#沙箱) 和 [SECURITY.zh.md](../SECURITY.zh.md)。
|
|
109
|
+
缺 `bubblewrap` 时受限命令报 `SANDBOX_UNAVAILABLE`,不运行。隔离为 `partial`:发行版内进程仍可经 `/mnt/c` 启动 Windows 程序。详见 [ARCHITECTURE.zh.md](ARCHITECTURE.zh.md#沙箱) 与 [SECURITY.zh.md](../SECURITY.zh.md)。
|
|
195
110
|
|
|
196
111
|
## 常见问题
|
|
197
112
|
|
|
@@ -201,11 +116,11 @@ wsl preset(每个会话)
|
|
|
201
116
|
| 会话在第一条命令前就被拒绝 | 运行 `pnpm run doctor`;启用 systemd 和 linger,或把 `wsl-shell`、`wsl-fs` 上的 `sessionSandbox` 设为 `auto` 或 `false` |
|
|
202
117
|
| 发行版内 `glob`、`grep` 很慢 | 运行 `pnpm run bootstrap <发行版>`,使用打印的安装命令安装 `ripgrep` |
|
|
203
118
|
| `npm install` / `pnpm add` 报 `EROFS` | 沙箱默认只授予工作区;在 `wsl-shell` 和 `wsl-fs` 上配置 `writableRoots`(如 `~/.npm`、`~/.cache`、`~/.local/share/pnpm`),见 [CONFIGURATION](CONFIGURATION.zh.md#工具链缓存与额外可写目录) |
|
|
204
|
-
|
|
|
119
|
+
| Plugins 页面装完没有任何日志 | 以 profile 的 `package.json` 与 `dsh.profile.bundles` 为准:列出插件即安装成功 |
|
|
205
120
|
| 对 `wsl-shell`/`wsl-fs` 的 profile 补丁不生效 | 这些行嵌套在 `preset-wsl` 里。运行 `pnpm run preset --check <补丁>`;它会失败并输出需要粘贴的完整块 |
|
|
206
121
|
| 改了 `lib/` 但不生效 | 运行 `pnpm run sync:windows`,然后重启应用 |
|
|
207
122
|
|
|
208
|
-
|
|
123
|
+
更多错误码见 [ARCHITECTURE.zh.md](ARCHITECTURE.zh.md#错误码),插件不做的事见 [LIMITATIONS.zh.md](LIMITATIONS.zh.md)。
|
|
209
124
|
|
|
210
125
|
## 开发
|
|
211
126
|
|
|
@@ -217,9 +132,7 @@ pnpm run test:coverage # 带覆盖率阈值的单元测试
|
|
|
217
132
|
pnpm run sync:windows # 更新应用加载的 Windows 侧副本
|
|
218
133
|
```
|
|
219
134
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
真机探针仅在 Windows + WSL 下运行。见 [CONTRIBUTING.zh.md](../CONTRIBUTING.zh.md) 和 `test/probe/`。
|
|
135
|
+
Node `^22.19.0 || >=24.0.0`;`src/` 是 TypeScript,`lib/` 是提交进仓的构建产物。真机探针仅 Windows + WSL。见 [CONTRIBUTING.zh.md](../CONTRIBUTING.zh.md) 与 `test/probe/`。
|
|
223
136
|
|
|
224
137
|
## 文档
|
|
225
138
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -146,7 +146,7 @@ A manual publish does not create the GitHub Release, so do step 7 by hand.
|
|
|
146
146
|
|
|
147
147
|
`npm publish` prints `+ dsh-plugin-wsl-env@x.y.z` when the upload is accepted. That
|
|
148
148
|
is not the same as the version being visible. The version and the `dist-tags`
|
|
149
|
-
appear in the registry
|
|
149
|
+
appear in the registry several minutes later (0.26.0 took about six), so poll instead of checking once — the release workflow waits up to ten minutes:
|
|
150
150
|
|
|
151
151
|
```bash
|
|
152
152
|
# expect 200, not 404
|
|
@@ -261,7 +261,7 @@ npm does not let a published version be replaced, so the fix goes forward:
|
|
|
261
261
|
|
|
262
262
|
| Fact | What it means in practice |
|
|
263
263
|
|---|---|
|
|
264
|
-
| `npm publish` prints success at upload time | The version may still return 404 for
|
|
264
|
+
| `npm publish` prints success at upload time | The version may still return 404 for several minutes (0.26.0 took about six). Poll the registry for up to ten minutes, and do not conclude that the publish failed. |
|
|
265
265
|
| A repeated publish of the same version is refused | npm checks the registry first and stops with `You cannot publish over the previously published versions: x.y.z.`; a registry-side conflict surfaces as `EPUBLISHCONFLICT` ("Cannot publish over existing version."). Either one means the first publish landed. Verify it instead of publishing again — the release workflow's already-published check exists for the same reason. |
|
|
266
266
|
| The npm readme is chosen from the candidate files at the package root, and the rule is not fully explained. With `README.md` and `README.zh.md` side by side, version 0.1.1 published as `readmeFilename: README.zh.md`, so its npm page rendered Chinese — even though the tarball listed `README.md` first. Both names match the npm CLI's own selection code (`@npmcli/package-json/lib/normalize.js` globs `{README,README.*}` and accepts `/\.m?a?r?k?d?o?w?n?$/i`, which does match `.md`), so neither name is screened out. | Do not rely on the rule. Keep exactly one readme candidate at the package root, which `pnpm run lint:style` checks. The Chinese README lives in `docs/` for this reason. |
|
|
267
267
|
| A local `~/.npmrc` may point at a mirror | Pass `--registry=https://registry.npmjs.org/` on every publish and every verification. |
|
package/docs/REQUIREMENTS.zh.md
CHANGED
|
@@ -58,7 +58,7 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
|
|
|
58
58
|
| R22 | 支持矩阵:Windows 10/11 + WSL2 + Node `^22.19.0 \|\| >=24.0.0` + peer 版本范围 | SUPPORT 全文 | ⑥:支持与不受支持清单、peer 范围及精确开发依赖成文;Node 20 在范围外(理由见 SUPPORT,`engines` 为准) | `peerDependencies`、`devDependencies` 与 `engines`(`package.json`);CI 矩阵(ci.yml) | 新 peer 版本仍需验证 |
|
|
59
59
|
| R23 | 根平面 `ctx.fs` 按坐标路由:发行版 UNC 由发行版内 agent 服务(inotify 或轮询 watch),盘符路径留在宿主;接替随发的 `fs-sandbox` 行 | README「Architecture」;ARCHITECTURE「The root-plane filesystem takeover」;CONFIGURATION `fs-routing` 行;root-fs-routing.md(设计) | ①②③⑤:路由判定与接替理由(写围栏在根平面无消费者)成文;`distro` 的 `auto`/`default`/pin 三态、每个 UNC 目标由自身 distro 服务、pin 下拒外来路径,以及 `distroCwd`/`restrictToDistro`/`sandbox`/`maskWindowsDrive`/`watchMaxDepth` 逐键成表,且自成一行、不与会话级行联动;`sandbox` 失败关闭成文 | `fs-routing.test.mjs`(纯谓词与路径助手)、`provider.test.mjs`(per-distro substrate/worldPath) | 类本体无单测(需 DSH peers 与实机);由组合测试与真机探针覆盖 |
|
|
60
60
|
| R24 | GUI 文件树与预览在发行版内服务:沿用随包 `workspace-files` 行(server/client 成对),经根级 `fs-routing` 读写 distro UNC;盘符 scope 交宿主 | README「Architecture」;ARCHITECTURE「The root-plane filesystem takeover」;CONFIGURATION `workspace-files` 行 | ①②③⑤:沿用官方 server/client,浏览器 `file` provider 不丢,预览可用;路由与宿主/发行版 scope 成文;容量键由官方行承载、可覆盖;较直连多 4–6 次往返及其取舍在 LIMITATIONS 成文 | `fs-routing.test.mjs`、组合测试(`workspace-files` 保持启用、接管行不存在) | — |
|
|
61
|
-
| R25 | 安装/卸载/升级流:四步安装、幂等陷阱及补救、ES 模块重启须知 | README「Install」「Troubleshooting」 | ①③:每步预期输出、`add` 幂等性陷阱的补救(先 remove 再 add)、pnpm UNC 链接极限成文 | 人工步骤,无自动化(依赖真实
|
|
61
|
+
| R25 | 安装/卸载/升级流:四步安装、幂等陷阱及补救、ES 模块重启须知 | README「Install」「Troubleshooting」 | ①③:每步预期输出、`add` 幂等性陷阱的补救(先 remove 再 add)、pnpm UNC 链接极限成文 | 人工步骤,无自动化(依赖真实 Windows 桌面应用 + WSL;打包链路由 `e2e:install` 覆盖) | 无自动化守护 |
|
|
62
62
|
| R26 | 诊断三入口同一份逐项报告:独立 CLI、`/wsl-doctor` UI 命令(宿主侧、不进模型历史)、`wsl_doctor` 模型工具(进程内合并常驻状态);报告按 distro 分组逐项带显式状态标记与失败修复;`--quick`/`--sections`(工具侧 `depth`/`section`)收窄范围且未运行项显式列为跳过 | DIAGNOSTICS「The surfaces」;README「Install」;CONFIGURATION「Diagnose configuration and refusals」 | ①②④:三入口的分工与边界成文;范围化报告携带 `scope`、`--fix` 要求完整运行成文;逐项化与跳过行的形态由 parity 测试钉住 | `wsl-doctor-tool.test.mjs`(digest/渲染/CHECK_CATALOG parity)、`wsl-doctor-command.test.mjs`(语法/handler/子进程面)、`doctor.test.mjs`(CLI 采集) | 真机多 distro 报告依赖实机;报告形态的宿主渲染(命令面 UI)无单测 |
|
|
63
63
|
| R27 | doctor CLI 独立性:不加载 peer 依赖与宿主服务,插件运行时本身损坏时仍可诊断;固定骨架本地化(Windows 区域设置检测,`--locale`/`DSH_WSL_DOCTOR_LOCALE` 覆盖),逐项事实保持英文,`--json` 语言无关 | DIAGNOSTICS「The surfaces」;CONFIGURATION「Message language」;LIMITATIONS「消息本地化」条 | ①②④:peer-free 内联与防漂移对拍成文;catalog 键 parity 与占位符行为有测试 | `doctor.test.mjs`(inlining parity、locale catalog、检测与覆盖) | 语言检测需 Windows registry(非 Windows 上回退英文,`run` 不抛错) |
|
|
64
64
|
| R28 | 每日更新检查经宿主插件管理器委托,不自取;事实进 `DSH_WSL_PLUGIN_UPDATE`;`wsl-update-check.enabled: false` 可关闭 | README「Install」;CONFIGURATION `wsl-update-check` 行 | ①②⑤:委托路径、TTL、关闭开关成文 | `update-check.test.mjs` | doctor 不再自行查询 registry:更新提示只走这条委托路径 |
|
package/docs/ROADMAP-1.0.md
CHANGED
|
@@ -131,7 +131,7 @@ correct once configured" and "the plugin is correct on first contact".
|
|
|
131
131
|
|---|---|---|---|
|
|
132
132
|
| [P1.1](#wsl-201--sessionsandbox-auto) | `sessionSandbox: auto` for distros without systemd | Non-systemd distro runs the first command under per-command bwrap and reports the narrower scope; explicit `true` still refuses | M |
|
|
133
133
|
| [P1.2](#wsl-202--compatibility-matrix-and-aarch64) | Compatibility matrix and real validation | Tier 1 (Ubuntu/Debian, systemd, x86_64) green; aarch64 spike runs under qemu; Tier 2 status documented | L |
|
|
134
|
-
| [P1.3](#wsl-203--installupgradeuninstall-e2e) | Install/upgrade/uninstall E2E | Temporary `DSH_HOME`, packed tarball, profile install (Plugins page
|
|
134
|
+
| [P1.3](#wsl-203--installupgradeuninstall-e2e) | Install/upgrade/uninstall E2E | Temporary `DSH_HOME`, packed tarball, profile install (the Plugins page), composed state via the profile's `cordis.patch.yml`, remove; upgrade from the previous minor | M |
|
|
135
135
|
| [P1.4](#wsl-204---references-seam) | `@` references seam | Measure the 9p cost; land the upstream `FileReferenceTraversal` seam or a declared, tested fallback | L |
|
|
136
136
|
| [P1.5](#wsl-205--lsp-provider-spike) | LSP provider spike | A documented plan and prototype for `ctx.lsp` over fs + subprocess, conditional on the desktop composition mounting LSP | M |
|
|
137
137
|
| [P1.6](#wsl-206--gui-preview-performance) | GUI preview performance | Baseline measured; p95 <= 1s/MiB for a representative page; v6 only if the measurement justifies it | M |
|
package/docs/VALUE.md
CHANGED
|
@@ -76,6 +76,19 @@ This plugin fills the combination beyond those three: **the app stays on Windows
|
|
|
76
76
|
|
|
77
77
|
**Evidence.** [ARCHITECTURE "Error codes"](ARCHITECTURE.md#error-codes), [README "Troubleshooting"](../README.md#troubleshooting); `test/ports.test.mjs`, `test/preflight.test.mjs`, `test/terminal.test.mjs`.
|
|
78
78
|
|
|
79
|
+
### Why Linux, not PowerShell
|
|
80
|
+
|
|
81
|
+
The underlying argument for Value 1: most coding agents learn from Linux-first material, and most open-source toolchains are built and tested on Linux first. Asking an agent to work through a Windows shell adds a translation layer on every call:
|
|
82
|
+
|
|
83
|
+
- **Training prior.** Examples, CI scripts, Dockerfiles and most public answers use POSIX shells and GNU tools. A model's first instinct is `bash`, not PowerShell.
|
|
84
|
+
- **Toolchain support.** Node, Python, Rust, Go, C/C++ and most build systems are validated on Linux first. Windows support is often a port with different quoting, paths, line endings and file locking.
|
|
85
|
+
- **Shell semantics.** PowerShell and `cmd` differ from POSIX in quoting, escaping, pipelines, environment variables, exit codes and path separators. Mixing the two produces errors that look like model mistakes.
|
|
86
|
+
- **Environment drift.** Windows setups vary by PowerShell version, execution policy, PATH and installed tools. Linux environments are easier to reproduce and containerize.
|
|
87
|
+
|
|
88
|
+
The result is more failed commands, more retries and more time spent on syntax instead of the task. Generated code is affected too: shell snippets, build commands and CI-style one-liners are usually written for POSIX, and the distro is where they run unchanged. A real Linux login shell removes that translation layer. Modern PowerShell and Windows-native toolchains narrow the gap, but the default prior and most project scripts still assume POSIX.
|
|
89
|
+
|
|
90
|
+
This plugin keeps the GUI on Windows and moves only the execution environment into the distro, so the agent gets the shell that its training and the toolchain both assume.
|
|
91
|
+
|
|
79
92
|
## 3. Value comparison with alternatives
|
|
80
93
|
|
|
81
94
|
| | No integration (open UNC on the Windows side) | Desktop remote (VS Code Remote-WSL, etc.) | Install the CLI inside WSL | This plugin |
|
|
@@ -90,6 +103,20 @@ This plugin fills the combination beyond those three: **the app stays on Windows
|
|
|
90
103
|
|
|
91
104
|
**Say plainly where others are stronger.** Reopening a workspace in desktop remote is instantaneous, and the service is always resident; VS Code's remote has years of production hardening. A CLI installed inside WSL needs no bridge at all. This plugin does not try to win on those dimensions; it solves one combination: **DSH on Windows, the project in WSL, and commands that must be sandboxed.**
|
|
92
105
|
|
|
106
|
+
### Against Remote-SSH (Windows host)
|
|
107
|
+
|
|
108
|
+
Remote-SSH can also reach a WSL distro from Windows (VS Code normally uses its Remote-WSL extension for the local case, not SSH; this is about Remote-SSH). It requires sshd inside the distro, and the differences from this plugin concentrate in a few rows:
|
|
109
|
+
|
|
110
|
+
| | Remote-SSH to WSL | This plugin |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| Reach | any SSH host (cloud VMs, remote servers) | local WSL 2 distros only |
|
|
113
|
+
| Setup | openssh-server in the distro, keys; a WSL NAT IP changes on every restart — port proxy or mirrored networking needed | none — install from the Plugins page |
|
|
114
|
+
| Network | sshd listening on a port | stdio over wsl.exe, no port, nothing listening |
|
|
115
|
+
| In-distro footprint | `~/.vscode-server` (accumulates per version, needs maintenance) | one content-addressed agent cache |
|
|
116
|
+
| Command sandbox | none | bubblewrap + the DSH permission tiers |
|
|
117
|
+
|
|
118
|
+
**Where Remote-SSH is stronger, plainly**: when the target machine is not the local WSL (cloud VMs, office servers) it is the right tool, and the host does not have to be Windows. This plugin covers only the local-distro arrival — the trade is zero network configuration, no server-side in the distro, and a command sandbox.
|
|
119
|
+
|
|
93
120
|
## 4. Costs, boundaries, and non-applicability
|
|
94
121
|
|
|
95
122
|
Value is benefit minus cost. The following should be known before installation:
|
package/docs/VALUE.zh.md
CHANGED
|
@@ -76,6 +76,19 @@ DSH 是 Windows 桌面应用,项目在 WSL 的 ext4 里。不做集成,三
|
|
|
76
76
|
|
|
77
77
|
**证据。** [ARCHITECTURE「错误码」](ARCHITECTURE.zh.md#错误码)、[README「常见问题」](README.zh.md#常见问题);`test/ports.test.mjs`、`test/preflight.test.mjs`、`test/terminal.test.mjs`。
|
|
78
78
|
|
|
79
|
+
### 为什么是 Linux,而不是 PowerShell
|
|
80
|
+
|
|
81
|
+
价值一的底层论据:多数编程 agent 的训练材料以 Linux 为主,开源工具链也大多先在 Linux 上构建和测试。让 agent 在 Windows shell 里工作,等于要求它在每次调用时做一层翻译:
|
|
82
|
+
|
|
83
|
+
- **训练先验。** 示例、CI 脚本、Dockerfile 和大多数公开答案用的是 POSIX shell 和 GNU 工具;模型的第一反应是 `bash`,不是 PowerShell。
|
|
84
|
+
- **工具链支持。** Node、Python、Rust、Go、C/C++ 和多数构建系统先在 Linux 上验证。Windows 支持往往是移植,引号、路径、换行和文件锁都不一样。
|
|
85
|
+
- **Shell 语义。** PowerShell 和 `cmd` 在引号、转义、管道、环境变量、退出码和路径分隔符上都与 POSIX 不同。混用两套语法,很容易产生看起来像模型犯的低级错误。
|
|
86
|
+
- **环境漂移。** Windows 侧的 PowerShell 版本、执行策略、PATH 和已装工具因人而异;Linux 环境更容易复现和容器化。
|
|
87
|
+
|
|
88
|
+
结果是更多失败的命令、更多重试,以及更多时间花在语法而不是任务上。生成的代码也一样:shell 片段、构建命令和 CI 风格的一行命令通常按 POSIX 编写,发行版才是它们原样运行的地方。真实的 Linux 登录 shell 去掉了这层翻译。现代 PowerShell 和 Windows 原生工具在缩小差距,但默认先验和多数项目脚本仍然假设 POSIX。
|
|
89
|
+
|
|
90
|
+
本插件把 GUI 留在 Windows,只把执行环境移进发行版,让 agent 得到它的训练和工具链都假设的那个 shell。
|
|
91
|
+
|
|
79
92
|
## 3. 和替代方案的价值对照
|
|
80
93
|
|
|
81
94
|
| | 不做集成(Windows 侧开 UNC) | 桌面远程(VS Code Remote-WSL 等) | 把 CLI 装进 WSL | 本插件 |
|
|
@@ -90,6 +103,20 @@ DSH 是 Windows 桌面应用,项目在 WSL 的 ext4 里。不做集成,三
|
|
|
90
103
|
|
|
91
104
|
**别人更强的地方要直说。** 桌面远程重开工作区是即时的,服务常驻;VS Code 的远程有多年生产打磨。CLI 装进 WSL 则完全不需要桥接。本插件不试图在这些维度取胜,它只解决一个组合:**DSH 在 Windows 上,项目在 WSL 里,命令要有沙箱。**
|
|
92
105
|
|
|
106
|
+
### 与 Remote-SSH 的对照(Windows 宿主)
|
|
107
|
+
|
|
108
|
+
Remote-SSH 也能在 Windows 上连 WSL 发行版(VS Code 连本机 WSL 更常用 Remote-WSL 扩展,不经 SSH;这里单说 Remote-SSH)。它要求发行版内运行 sshd,与本插件的差别集中在几行:
|
|
109
|
+
|
|
110
|
+
| | Remote-SSH 到 WSL | 本插件 |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| 到达范围 | 任意 SSH 主机(云主机、远程服务器) | 仅本机 WSL 2 发行版 |
|
|
113
|
+
| 前置配置 | 发行版内装 openssh-server、配密钥;WSL NAT 下 IP 随重启变化,需端口转发或镜像网络 | 无——插件页安装即用 |
|
|
114
|
+
| 网络 | sshd 监听端口 | 经 wsl.exe 的 stdio,无端口、无监听 |
|
|
115
|
+
| 发行版内足迹 | `~/.vscode-server`(按版本累积,需维护) | 一个内容寻址 agent 缓存 |
|
|
116
|
+
| 命令沙箱 | 无 | bubblewrap + DSH 权限档位 |
|
|
117
|
+
|
|
118
|
+
**Remote-SSH 更强的地方照直说**:目标机器不是本机 WSL(云主机、公司服务器)时它是正确工具,且宿主不限 Windows。本插件只覆盖本机发行版这一种到达——代价是换来零网络配置、发行版内无服务端、命令有沙箱。
|
|
119
|
+
|
|
93
120
|
## 4. 代价、边界与不适用
|
|
94
121
|
|
|
95
122
|
价值是收益减代价。下面这些是安装前就该知道的:
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="940" height="640" viewBox="0 0 940 640" font-family="-apple-system, 'Segoe UI', Helvetica, Arial, sans-serif">
|
|
2
|
+
<defs>
|
|
3
|
+
<marker id="arrow2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
4
|
+
<path d="M0,0 L10,5 L0,10 z" fill="#64748B"/>
|
|
5
|
+
</marker>
|
|
6
|
+
</defs>
|
|
7
|
+
<rect width="940" height="640" fill="#FFFFFF"/>
|
|
8
|
+
|
|
9
|
+
<text x="470" y="34" text-anchor="middle" font-size="17" font-weight="600" fill="#111827">With the plugin — one session, two halves</text>
|
|
10
|
+
<text x="470" y="56" text-anchor="middle" font-size="12.5" fill="#6B7280">the GUI and model calls stay on Windows; commands and files run inside the distro</text>
|
|
11
|
+
|
|
12
|
+
<!-- Windows host -->
|
|
13
|
+
<rect x="40" y="78" width="860" height="280" rx="10" fill="#EFF6FF" stroke="#93C5FD" stroke-width="1.5"/>
|
|
14
|
+
<text x="56" y="102" font-size="12" font-weight="700" fill="#1D4ED8" letter-spacing="0.5">WINDOWS HOST</text>
|
|
15
|
+
|
|
16
|
+
<rect x="60" y="114" width="820" height="100" rx="8" fill="#FFFFFF" stroke="#60A5FA"/>
|
|
17
|
+
<text x="76" y="138" font-size="13" font-weight="700" fill="#1E3A8A">DeepSeek Harness Desktop</text>
|
|
18
|
+
<text x="76" y="160" font-size="12.5" fill="#374151">GUI — chat · file tree · previews · terminal panel</text>
|
|
19
|
+
<text x="76" y="180" font-size="12.5" fill="#374151">model calls (LLM API traffic)</text>
|
|
20
|
+
<text x="76" y="200" font-size="12.5" fill="#374151">profiles & session state — <tspan font-family="ui-monospace, Consolas, monospace" font-size="12">%USERPROFILE%\.dsh</tspan></text>
|
|
21
|
+
|
|
22
|
+
<rect x="60" y="230" width="820" height="108" rx="8" fill="#DBEAFE" stroke="#60A5FA"/>
|
|
23
|
+
<text x="76" y="254" font-size="13" font-weight="700" fill="#1E40AF">dsh-plugin-wsl-env — host half</text>
|
|
24
|
+
<text x="76" y="278" font-size="12" fill="#1E3A8A" font-family="ui-monospace, Consolas, monospace">fs-routing: \wsl.localhost\… → distro · C:\… → host</text>
|
|
25
|
+
<text x="76" y="298" font-size="12.5" fill="#1E3A8A">auto-preset binds the wsl preset when a session opens a distro folder</text>
|
|
26
|
+
<text x="76" y="318" font-size="12.5" fill="#1E3A8A">distro picker · doctor host-side probes · a Windows-folder session stays unchanged</text>
|
|
27
|
+
|
|
28
|
+
<!-- the stdio channel -->
|
|
29
|
+
<line x1="470" y1="366" x2="470" y2="414" stroke="#64748B" stroke-width="2" marker-start="url(#arrow2)" marker-end="url(#arrow2)"/>
|
|
30
|
+
<text x="486" y="390" font-size="12.5" font-weight="700" fill="#374151">stdio over wsl.exe — once, for the whole session</text>
|
|
31
|
+
<rect x="150" y="376" width="250" height="22" rx="11" fill="#DCFCE7"/>
|
|
32
|
+
<text x="275" y="391" text-anchor="middle" font-size="11.5" font-weight="700" fill="#15803D">no port · no service · nothing listening</text>
|
|
33
|
+
|
|
34
|
+
<!-- distro -->
|
|
35
|
+
<rect x="40" y="422" width="860" height="188" rx="10" fill="#F0FDF4" stroke="#86EFAC" stroke-width="1.5"/>
|
|
36
|
+
<text x="56" y="446" font-size="12" font-weight="700" fill="#15803D" letter-spacing="0.5">WSL 2 DISTRO (LINUX VM)</text>
|
|
37
|
+
<text x="76" y="470" font-size="13" font-weight="700" fill="#166534">resident agent</text>
|
|
38
|
+
<text x="196" y="470" font-size="12" fill="#374151" font-family="ui-monospace, Consolas, monospace">~/.cache/dsh-wsl/agent/ (content-addressed, nothing else persisted)</text>
|
|
39
|
+
|
|
40
|
+
<rect x="60" y="484" width="266" height="104" rx="8" fill="#FFFFFF" stroke="#BBF7D0"/>
|
|
41
|
+
<text x="76" y="508" font-size="12.5" font-weight="700" fill="#166534">commands</text>
|
|
42
|
+
<text x="76" y="530" font-size="11.5" fill="#374151">plain POSIX — no wsl.exe prefix;</text>
|
|
43
|
+
<text x="76" y="548" font-size="11.5" fill="#374151">login shell: PATH, nvm, cargo, rc</text>
|
|
44
|
+
<text x="76" y="566" font-size="11.5" fill="#374151">bubblewrap fence per command</text>
|
|
45
|
+
|
|
46
|
+
<rect x="337" y="484" width="266" height="104" rx="8" fill="#FFFFFF" stroke="#BBF7D0"/>
|
|
47
|
+
<text x="353" y="508" font-size="12.5" font-weight="700" fill="#166534">files</text>
|
|
48
|
+
<text x="353" y="530" font-size="11.5" fill="#374151">ext4 native semantics</text>
|
|
49
|
+
<text x="353" y="548" font-size="11.5" fill="#374151">the distro’s own rg · watch</text>
|
|
50
|
+
<text x="353" y="566" font-size="11.5" fill="#374151">git change snapshots</text>
|
|
51
|
+
|
|
52
|
+
<rect x="614" y="484" width="266" height="104" rx="8" fill="#FFFFFF" stroke="#BBF7D0"/>
|
|
53
|
+
<text x="630" y="508" font-size="12.5" font-weight="700" fill="#166534">session runtime</text>
|
|
54
|
+
<text x="630" y="530" font-size="11.5" fill="#374151">one systemd user scope — env and</text>
|
|
55
|
+
<text x="630" y="548" font-size="11.5" fill="#374151">background state persist; dev servers</text>
|
|
56
|
+
<text x="630" y="566" font-size="11.5" fill="#374151">survive · ports → DSH_WSL_PORTS</text>
|
|
57
|
+
|
|
58
|
+
<text x="470" y="628" text-anchor="middle" font-size="12" fill="#6B7280">path decides: a distro-folder session runs here, a drive-letter session stays on Windows — both in one process</text>
|
|
59
|
+
</svg>
|
|
Binary file
|