dsh-wsl-tool 1.8.1 → 1.8.2
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/README.md +27 -2
- package/README.zh-CN.md +19 -3
- package/cordis.patch.yml +8 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
A model-facing **WSL** tool plugin for DeepSeek Harness (DSH). It lets an agent run
|
|
5
|
+
A model-facing **WSL** tool plugin for DeepSeek Harness (DSH). It lets an agent run
|
|
6
|
+
Linux commands through `wsl.exe` directly — no hand-written `.sh` scripts or `pwsh`
|
|
7
|
+
wrappers — and for command execution it essentially matches a native Linux DSH: a
|
|
8
|
+
real Linux kernel and bash, exit codes and signals, timeouts, truncation with spill
|
|
9
|
+
files, background jobs the built-in job tools read back, stdin, and automatic
|
|
10
|
+
Windows/WSL path translation.
|
|
11
|
+
|
|
12
|
+
Two limits are worth knowing before you rely on it. A `wsl` call runs below DSH's
|
|
13
|
+
sandbox, so a file policy does not confine it (see [Sandboxing](#sandboxing)); and a
|
|
14
|
+
project kept on a Windows drive keeps **Windows** filesystem semantics — no POSIX
|
|
15
|
+
permissions, case-insensitive names, no file-change notifications — at a fraction
|
|
16
|
+
of the speed (see [Notes](#notes)).
|
|
6
17
|
|
|
7
18
|
## Tools
|
|
8
19
|
|
|
@@ -184,7 +195,21 @@ takes effect on restart.
|
|
|
184
195
|
workspace: /mnt/d/DSHworkarea (Windows drive mount /mnt/d — builds, installs and git are much slower here; prefer a path under /home when it matters)
|
|
185
196
|
```
|
|
186
197
|
|
|
187
|
-
It is worth believing. Measured on the author's machine: a 128 MB sequential write
|
|
198
|
+
It is worth believing. Measured on the author's machine: a 128 MB sequential write
|
|
199
|
+
ran at ~2.1 GB/s on ext4 against ~247 MB/s on `/mnt/d`, and creating 400 small
|
|
200
|
+
files took under 10 ms against 0.72 s (a later re-run: 884 vs 116 MB/s, and 13 ms
|
|
201
|
+
against 745 ms — the ratios hold at roughly 8× and 50×).
|
|
202
|
+
|
|
203
|
+
It is not only slower. `/mnt/<drive>` is a 9p (drvfs) mount, so it keeps **Windows**
|
|
204
|
+
filesystem semantics: `chmod`/`chown` do not stick (a `chmod 600` reads back as
|
|
205
|
+
`777`), names are case-insensitive (so a case-sensitive import only fails on Linux
|
|
206
|
+
CI), symlinks and the executable bit are synthetic, and **inotify does not work at
|
|
207
|
+
all** — a watcher inside the distro receives no events for writes from either side
|
|
208
|
+
(measured with an inotify probe on `/mnt/d`: zero events for a Windows-side write
|
|
209
|
+
and for a Linux-side write, while the same probe on ext4 reported create, modify
|
|
210
|
+
and close-write). Dev servers, `--watch` modes and file-watching tests are
|
|
211
|
+
therefore blind on a Windows drive. Keep a project under `/home` when it matters:
|
|
212
|
+
it recovers real semantics, real watch events, and the speed above.
|
|
188
213
|
- Destructive commands are refused unless the call passes `allowDangerous: true`:
|
|
189
214
|
- **any recursive delete** — `rm -r`, `rm -rf`, `rm -r -f`, `rm -R --force`, `rm --recursive` — because with stdin on `/dev/null` nothing prompts, so `rm -r tree` deletes silently. Each `rm` invocation is judged on its own command segment, so `rm a -f; rm b -r` cannot combine into a pass;
|
|
190
215
|
- `dd` onto a block device, `mkfs`, partitioning/wiping tools (`fdisk`, `parted`, `wipefs`, `mkswap`, …), power control (`shutdown`, `reboot`, `systemctl reboot`, …), redirection onto a block device, and fork bombs;
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
面向模型(model-facing)的 **WSL** 工具插件,用于 DeepSeek Harness(DSH)。它让智能体直接通过
|
|
5
|
+
面向模型(model-facing)的 **WSL** 工具插件,用于 DeepSeek Harness(DSH)。它让智能体直接通过
|
|
6
|
+
`wsl.exe` 执行 Linux 命令——无需手写 `.sh` 脚本或 `pwsh` 包装——并且在**命令执行**这一层基本对齐
|
|
7
|
+
Linux 原生 DSH:真实的 Linux 内核与 bash、退出码与信号、超时、截断与落盘、可用内置 job 工具读回的
|
|
8
|
+
后台作业、stdin,以及 Windows/WSL 路径自动转换。
|
|
9
|
+
|
|
10
|
+
有两点限制值得在依赖它之前知道:`wsl` 调用位于 DSH 沙箱层之下,文件策略约束不到它
|
|
11
|
+
(见[沙箱边界](#沙箱边界));项目放在 Windows 盘上时仍是 **Windows** 的文件系统语义——没有 POSIX
|
|
12
|
+
权限位、文件名大小写不敏感、收不到文件变更通知——速度也低一个数量级(见[注意事项](#注意事项))。
|
|
6
13
|
|
|
7
14
|
## 工具
|
|
8
15
|
|
|
@@ -186,8 +193,17 @@ DSH_SUBPROCESS_LOCAL=/path/to/dsh/node_modules npm run test:real
|
|
|
186
193
|
workspace: /mnt/d/DSHworkarea (Windows drive mount /mnt/d — builds, installs and git are much slower here; prefer a path under /home when it matters)
|
|
187
194
|
```
|
|
188
195
|
|
|
189
|
-
这个提示值得当真。作者机器实测:128 MB 顺序写在 ext4 上约 **2.1 GB/s**,在 `/mnt/d` 上约
|
|
190
|
-
|
|
196
|
+
这个提示值得当真。作者机器实测:128 MB 顺序写在 ext4 上约 **2.1 GB/s**,在 `/mnt/d` 上约
|
|
197
|
+
**247 MB/s**;创建 400 个小文件 ext4 **不到 10 ms**,`/mnt/d` 要 **0.72 s**
|
|
198
|
+
(后来复测:**884 vs 116 MB/s**、**13 ms vs 745 ms**,比值稳定在约 8× 与 50×)。
|
|
199
|
+
|
|
200
|
+
不只是慢。`/mnt/<盘>` 是 9p(drvfs)挂载,保留的是 **Windows** 的文件系统语义:
|
|
201
|
+
`chmod`/`chown` 不生效(`chmod 600` 读回来是 `777`)、文件名**大小写不敏感**(大小写写错只在
|
|
202
|
+
Linux CI 上才炸)、符号链接与可执行位是合成的,而且 **inotify 完全不工作**——发行版里的 watcher
|
|
203
|
+
对两侧写入都收不到任何事件(用 inotify 探针实测:`/mnt/d` 上 Windows 侧写入与 Linux 侧写入均为
|
|
204
|
+
**0 事件**,而同一探针在 ext4 上正常报出创建/修改/关闭写入)。因此 dev server、`--watch` 模式
|
|
205
|
+
与文件监听的测试在 Windows 盘上都是瞎的。需要时把项目放到 `/home` 下:语义、监听事件与上面那档
|
|
206
|
+
速度一次性都回来。
|
|
191
207
|
- 危险命令默认被拒绝,除非调用时传 `allowDangerous: true`:
|
|
192
208
|
- **任何递归删除**——`rm -r`、`rm -rf`、`rm -r -f`、`rm -R --force`、`rm --recursive`——
|
|
193
209
|
因为 stdin 指向 `/dev/null` 时不会产生任何提示,`rm -r tree` 会静默删除整棵树。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
# This bundle layer
|
|
2
|
-
#
|
|
1
|
+
# This bundle layer inserts the wsl tool plugin process-wide, so every agent
|
|
2
|
+
# preset gets the `wsl`/`wsl-path`/`wsl-env` tools without declaring anything.
|
|
3
|
+
#
|
|
4
|
+
# Do NOT also add a `tool-wsl` row to a preset. DSH registers tools by name and
|
|
5
|
+
# the second registration fails with
|
|
6
|
+
# `tool "wsl" is already registered in this scope`. To keep the tools out of a
|
|
7
|
+
# composition, override this row by id in a later patch layer (`- id: tool-wsl`
|
|
8
|
+
# with `disabled: true`) instead of duplicating it.
|
|
3
9
|
|
|
4
10
|
# The entry name is PATH-RELATIVE on purpose. DSH anchors a relative `name:` to
|
|
5
11
|
# the directory of the patch file that declared it (`anchorInsertedPluginNames`),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-wsl-tool",
|
|
3
|
-
"version": "1.8.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.8.2",
|
|
4
|
+
"description": "Run Linux commands from Windows through WSL, essentially matching a native Linux DSH for command execution: background jobs, stdin, path translation, a destructive-command guard and a WSL capability report. WSL calls run below the DSH sandbox, and a project on a Windows drive keeps Windows filesystem semantics.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "MIT",
|