dsh-plugin-wsl-env 0.11.0 → 0.13.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/CONTRIBUTING.md +29 -7
  3. package/README.md +124 -138
  4. package/SECURITY.md +11 -1
  5. package/SUPPORT.md +29 -2
  6. package/cordis.patch.yml +17 -19
  7. package/docs/ARCHITECTURE.md +30 -29
  8. package/docs/CONFIGURATION.md +81 -21
  9. package/docs/LIMITATIONS.md +71 -6
  10. package/docs/MIGRATION.md +98 -0
  11. package/docs/PARITY.md +1 -1
  12. package/docs/PERFORMANCE.md +60 -0
  13. package/docs/QUICKSTART.md +125 -0
  14. package/docs/README.zh.md +117 -137
  15. package/docs/ROADMAP-1.0.md +780 -0
  16. package/docs/ROADMAP.md +4 -0
  17. package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +80 -0
  18. package/docs/UPSTREAM-LSP-SEAM.md +90 -0
  19. package/docs/UPSTREAM-SESSION-NOTICE.md +95 -0
  20. package/lib/agent-errors.d.ts +19 -0
  21. package/lib/agent-errors.js +22 -0
  22. package/lib/agent-exec.js +2 -2
  23. package/lib/agent.d.ts +68 -5
  24. package/lib/agent.js +129 -22
  25. package/lib/distro-route.d.ts +75 -0
  26. package/lib/distro-route.js +86 -0
  27. package/lib/fs-routing.d.ts +4 -1
  28. package/lib/index.d.ts +166 -37
  29. package/lib/index.js +353 -75
  30. package/lib/paths.d.ts +15 -0
  31. package/lib/paths.js +28 -0
  32. package/lib/preflight.d.ts +46 -3
  33. package/lib/preflight.js +83 -14
  34. package/lib/shell-env.d.ts +9 -3
  35. package/lib/shell-env.js +121 -43
  36. package/lib/subprocess.d.ts +12 -3
  37. package/lib/subprocess.js +21 -3
  38. package/package.json +23 -15
  39. package/scripts/diagnose.sh +9 -88
  40. package/scripts/doctor.mjs +548 -0
  41. package/scripts/profile-preset.mjs +254 -0
  42. package/lib/workspace-files-route.d.ts +0 -136
  43. package/lib/workspace-files-route.js +0 -225
  44. package/lib/workspace-files-wsl.d.ts +0 -257
  45. package/lib/workspace-files-wsl.js +0 -418
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-wsl-env",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "\u8ba9 DeepSeek Harness \u4ee5 WSL \u5b50\u7cfb\u7edf\u4f5c\u4e3a\u4f1a\u8bdd\u7684\u6267\u884c\u73af\u5883\uff1ashell\u3001\u6587\u4ef6\u8bfb\u5199\u4e0e\u547d\u4ee4\u6267\u884c\u5747\u5728\u5b50\u7cfb\u7edf\u5185\u5b8c\u6210\uff0c\u76ee\u5f55\u9009\u62e9\u5668\u4e0e GUI \u7ec8\u7aef\u540c\u6837\u5b9a\u4f4d\u5230\u5b50\u7cfb\u7edf\u8def\u5f84\uff0c\u5e76\u901a\u8fc7\u5b50\u7cfb\u7edf\u5185\u7684 bubblewrap \u5bf9\u547d\u4ee4\u8fdb\u884c\u6c99\u7bb1\u9694\u79bb",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -75,10 +75,6 @@
75
75
  },
76
76
  "./subprocess/locale/en.json": "./locale/subprocess/en.json",
77
77
  "./subprocess/locale/zh.json": "./locale/subprocess/zh.json",
78
- "./workspace-files-wsl": {
79
- "types": "./lib/workspace-files-wsl.d.ts",
80
- "default": "./lib/workspace-files-wsl.js"
81
- },
82
78
  "./wsl": {
83
79
  "types": "./lib/wsl.d.ts",
84
80
  "default": "./lib/wsl.js"
@@ -99,31 +95,41 @@
99
95
  "examples/**/*.yml",
100
96
  "README.md",
101
97
  "docs/README.zh.md",
98
+ "docs/QUICKSTART.md",
99
+ "docs/PERFORMANCE.md",
102
100
  "docs/CONFIGURATION.md",
103
101
  "docs/LIMITATIONS.md",
104
102
  "docs/PARITY.md",
105
103
  "docs/PEER-PARITY.md",
106
104
  "docs/UPSTREAM-FSIO-EXPORT.md",
105
+ "docs/UPSTREAM-LSP-SEAM.md",
106
+ "docs/UPSTREAM-FILE-REFERENCE-SEAM.md",
107
+ "docs/MIGRATION.md",
108
+ "docs/UPSTREAM-SESSION-NOTICE.md",
107
109
  "docs/UPSTREAM-TERMINAL-TITLE.md",
108
110
  "docs/ARCHITECTURE.md",
109
111
  "docs/ROADMAP.md",
112
+ "docs/ROADMAP-1.0.md",
110
113
  "CHANGELOG.md",
111
114
  "CONTRIBUTING.md",
112
115
  "SECURITY.md",
113
116
  "SUPPORT.md",
114
117
  "LICENSE",
115
118
  "scripts/bootstrap.sh",
116
- "scripts/diagnose.sh"
119
+ "scripts/diagnose.sh",
120
+ "scripts/doctor.mjs",
121
+ "scripts/profile-preset.mjs"
117
122
  ],
118
123
  "scripts": {
119
- "test": "pnpm run lint:style && pnpm run test:syntax && pnpm run lint:build && pnpm run lint:types && pnpm run test:unit",
124
+ "test": "pnpm run lint:style && pnpm run lint:links && pnpm run test:syntax && pnpm run lint:build && pnpm run lint:types && pnpm run test:unit",
120
125
  "lint:types": "tsc --noEmit",
121
126
  "build": "node scripts/build.mjs",
122
127
  "lint:build": "node test/build-freshness.mjs",
123
- "test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=84 --test-coverage-functions=70 test/agent-exec.test.mjs test/agent-fs-script.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/fs-substrate.test.mjs test/fs.boot.test.mjs test/workspace-files-wsl.test.mjs test/composition.test.mjs test/provider.test.mjs test/file-reference-wsl.test.mjs test/fsio-agent.test.mjs test/fsio-text.test.mjs test/git-route.test.mjs test/listing.test.mjs test/paths.test.mjs test/ports.test.mjs test/preset-choice.test.mjs test/probe-cache.test.mjs test/preflight.test.mjs test/sandbox.test.mjs test/search-exec.test.mjs test/search-route.test.mjs test/shell.test.mjs test/terminal-activity.test.mjs test/terminal.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs test/session-scope.test.mjs test/session-runtime.test.mjs test/native-agent.test.mjs test/peers.test.mjs test/agent-shared.test.mjs",
128
+ "test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=84 --test-coverage-functions=70 --test-coverage-exclude='scripts/**' test/agent-exec.test.mjs test/agent-fs-script.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/fs-substrate.test.mjs test/fs.boot.test.mjs test/composition.test.mjs test/provider.test.mjs test/file-reference-wsl.test.mjs test/fsio-agent.test.mjs test/fsio-text.test.mjs test/git-route.test.mjs test/listing.test.mjs test/paths.test.mjs test/ports.test.mjs test/preset-choice.test.mjs test/probe-cache.test.mjs test/preflight.test.mjs test/sandbox.test.mjs test/search-exec.test.mjs test/search-route.test.mjs test/shell.test.mjs test/terminal-activity.test.mjs test/terminal.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs test/session-scope.test.mjs test/session-runtime.test.mjs test/native-agent.test.mjs test/peers.test.mjs test/agent-shared.test.mjs test/distro-route.test.mjs test/fs-routing.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs",
124
129
  "test:syntax": "node test/syntax.mjs",
125
- "test:unit": "node --test test/fs.boot.test.mjs test/fsio-text.test.mjs test/workspace-files-wsl.test.mjs test/composition.test.mjs test/provider.test.mjs test/file-reference-wsl.test.mjs test/paths.test.mjs test/listing.test.mjs test/shell.test.mjs test/terminal.test.mjs test/probe-cache.test.mjs test/preflight.test.mjs test/preset-choice.test.mjs test/sandbox.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/agent-fs-script.test.mjs test/fsio-agent.test.mjs test/fs-substrate.test.mjs test/agent-exec.test.mjs test/ports.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs test/git-route.test.mjs test/fsio-text.test.mjs test/search-route.test.mjs test/search-exec.test.mjs test/terminal-activity.test.mjs test/session-scope.test.mjs test/session-runtime.test.mjs test/native-agent.test.mjs test/peers.test.mjs test/agent-shared.test.mjs",
130
+ "test:unit": "node --test test/fs.boot.test.mjs test/fsio-text.test.mjs test/composition.test.mjs test/provider.test.mjs test/file-reference-wsl.test.mjs test/paths.test.mjs test/listing.test.mjs test/shell.test.mjs test/terminal.test.mjs test/probe-cache.test.mjs test/preflight.test.mjs test/preset-choice.test.mjs test/sandbox.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/agent-fs-script.test.mjs test/fsio-agent.test.mjs test/fs-substrate.test.mjs test/agent-exec.test.mjs test/ports.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs test/git-route.test.mjs test/search-route.test.mjs test/search-exec.test.mjs test/terminal-activity.test.mjs test/session-scope.test.mjs test/session-runtime.test.mjs test/native-agent.test.mjs test/peers.test.mjs test/agent-shared.test.mjs test/distro-route.test.mjs test/fs-routing.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs",
126
131
  "lint:style": "node test/style.mjs",
132
+ "lint:links": "node scripts/check-links.mjs",
127
133
  "prepublishOnly": "pnpm test",
128
134
  "probe": "bash test/probe/run.sh",
129
135
  "probe:missing-wsl": "bash test/probe/missing-wsl.sh",
@@ -138,8 +144,15 @@
138
144
  "probe:agent": "bash test/probe/agent.sh",
139
145
  "probe:substrate": "bash test/probe/substrate.sh",
140
146
  "probe:exec": "bash test/probe/exec.sh",
147
+ "probe:fs-routing": "bash test/probe/fs-routing.sh",
148
+ "probe:gui-preview": "bash test/probe/gui-preview.sh",
149
+ "probe:file-reference": "bash test/probe/file-reference-9p.sh",
141
150
  "bootstrap": "bash scripts/bootstrap.sh",
142
- "diagnose": "bash scripts/diagnose.sh"
151
+ "diagnose": "bash scripts/diagnose.sh",
152
+ "doctor": "node scripts/doctor.mjs",
153
+ "preset": "node scripts/profile-preset.mjs",
154
+ "e2e:install": "bash test/e2e/install.sh",
155
+ "canary:peers": "node scripts/peer-canary.mjs"
143
156
  },
144
157
  "packageManager": "pnpm@11.7.0",
145
158
  "engines": {
@@ -166,7 +179,6 @@
166
179
  "@deepseek-ai/cordis": "4.0.5",
167
180
  "@deepseek-ai/cordis-plugin-include": "*",
168
181
  "@deepseek-ai/cordis-plugin-loader": "*",
169
- "@deepseek-ai/dsh-api-workspace-files": "0.2.1-rc.2",
170
182
  "@deepseek-ai/dsh-bash-local": "0.2.1-rc.2",
171
183
  "@deepseek-ai/dsh-fs": "0.2.1-rc.2",
172
184
  "@deepseek-ai/dsh-fs-local": "0.2.1-rc.2",
@@ -184,7 +196,6 @@
184
196
  },
185
197
  "peerDependencies": {
186
198
  "@deepseek-ai/cordis": "~4.0.5",
187
- "@deepseek-ai/dsh-api-workspace-files": "0.2.1-rc.2",
188
199
  "@deepseek-ai/dsh-bash-local": "0.2.1-rc.2",
189
200
  "@deepseek-ai/dsh-fs": "0.2.1-rc.2",
190
201
  "@deepseek-ai/dsh-fs-local": "0.2.1-rc.2",
@@ -199,9 +210,6 @@
199
210
  "@deepseek-ai/cordis": {
200
211
  "optional": true
201
212
  },
202
- "@deepseek-ai/dsh-api-workspace-files": {
203
- "optional": true
204
- },
205
213
  "@deepseek-ai/dsh-bash-local": {
206
214
  "optional": true
207
215
  },
@@ -1,92 +1,13 @@
1
1
  #!/usr/bin/env bash
2
- # Collect a read-only diagnostic report for a bug report, in one command:
2
+ # Read-only alias for `doctor`: the same checks and the same report, with no way
3
+ # to change the machine. `--fix`/`--install` are refused here on purpose —
4
+ # diagnostics collected for a bug report must not repair anything.
3
5
  #
4
- # pnpm run diagnose -- [distro] # distro optional; default distro otherwise
6
+ # pnpm run diagnose -- [distro] [--json]
5
7
  #
6
- # Prints versions and probe verdicts as plain text that can be pasted into an
7
- # issue as-is. It runs NO installation, changes nothing in the distro, and reads
8
- # nothing secret: the report is tool versions, a kernel release and probe
9
- # verdicts. Exit code is always 0 — the report is informational; the verdict
10
- # lines carry the failures.
11
- #
12
- # Deeper sandbox probing lives in `npm run probe:sandbox` (run inside the
13
- # distro); this script answers "what is installed and does bwrap run at all".
14
-
15
- set -u
16
- export WSL_UTF8=1 # wsl.exe writes UTF-16LE without it; read as UTF-8 that is mojibake
17
-
18
- DISTRO="${1:-}"
19
-
20
- ok() { printf 'ok %s\n' "$1"; }
21
- miss() { printf 'MISSING %s\n' "$1"; }
22
- info() { printf 'info %s\n' "$1"; }
23
- header(){ printf '\n== %s ==\n' "$1"; }
24
-
25
- echo "# dsh-plugin-wsl-env diagnose report"
26
-
27
- header "host"
28
- winver="$(cmd.exe /c ver 2>/dev/null | tr -d '\r' | grep -o '[0-9][0-9.]*' | head -1)"
29
- if [ -n "$winver" ]; then ok "windows build $winver"; else info "windows build unknown (cmd.exe not reachable through interop)"; fi
30
- wsl_ver="$(wsl.exe --version 2>/dev/null | tr -d '\0\r' | head -2 | tr '\n' ' ')"
31
- if [ -n "$wsl_ver" ]; then ok "wsl: $wsl_ver"; else info "wsl --version unsupported on this WSL build"; fi
32
- wsl_status="$(wsl.exe --status 2>/dev/null | tr -d '\0\r' | tr '\n' ' ')"
33
- [ -n "$wsl_status" ] && info "wsl status: $wsl_status"
34
- wsl.exe -l -v 2>/dev/null | tr -d '\0\r' | grep -v '^$' | sed 's/^/ /'
35
-
36
- header "plugin"
37
- echo " plugin version: $(node -p "require('./package.json').version" 2>/dev/null || echo unknown)"
38
- echo " dsh version: $(dsh --version 2>/dev/null || echo unknown)"
39
-
40
- if [ -z "$DISTRO" ]; then
41
- DISTRO="$(wsl.exe -l -q 2>/dev/null | tr -d '\0\r' | grep -v '^$' | head -1)"
42
- fi
43
- if [ -z "$DISTRO" ]; then
44
- header "distro"
45
- miss "no distro installed — 'wsl.exe --list --online' lists names, 'wsl --install -d <name>' installs one"
46
- exit 0
47
- fi
48
-
49
- header "distro: $DISTRO"
50
- in_distro() { wsl.exe -d "$DISTRO" --exec sh -c "$1" 2>/dev/null; }
51
-
52
- info "kernel: $(in_distro 'uname -r')"
53
- family="$(in_distro 'for m in apt-get dnf pacman zypper; do command -v $m && break; done' | tr -d '\r')"
54
- case "$family" in
55
- *apt-get) info "package family: apt" ;;
56
- *dnf) info "package family: dnf" ;;
57
- *pacman) info "package family: pacman" ;;
58
- *zypper) info "package family: zypper" ;;
59
- *) info "package family: unknown" ;;
60
- esac
61
-
62
- for tool in bwrap rg git inotifywait; do
63
- if in_distro "command -v $tool" | grep -q .; then
64
- case "$tool" in
65
- bwrap) ver="$(in_distro 'bwrap --version' | tr -d '\r' | head -1)" ;;
66
- rg) ver="$(in_distro 'rg --version' | tr -d '\r' | head -1)" ;;
67
- git) ver="$(in_distro 'git --version' | tr -d '\r' | head -1)" ;;
68
- inotifywait) ver="inotifywait (no version flag)" ;;
69
- esac
70
- ok "$ver"
71
- else
72
- case "$tool" in
73
- bwrap) miss "bwrap — REQUIRED; every confined command fails closed without it. Install: wsl.exe -d $DISTRO -u root -- apt-get install -y bubblewrap (or: pnpm run bootstrap -- $DISTRO --install)" ;;
74
- rg) miss "ripgrep — the search tool falls back to slower matching without it" ;;
75
- git) miss "git — snapshot and diff baselines degrade without it" ;;
76
- inotifywait) miss "inotify-tools — file watching falls back to polling without it" ;;
77
- esac
78
- fi
79
- done
80
-
81
- if in_distro 'command -v bwrap' | grep -q .; then
82
- if in_distro 'bwrap --ro-bind / / -- true'; then
83
- ok "bwrap runs a read-only profile (the usability probe passes)"
84
- else
85
- miss "bwrap is installed but FAILED the read-only profile probe — likely the kernel (unprivileged user namespaces disabled) or an unusable build; reinstalling will not help"
86
- fi
87
- fi
8
+ # Doctor is `scripts/doctor.mjs`; see its header for what it covers. Exit status
9
+ # follows doctor: 0 when no check failed, 1 when one did.
10
+ set -euo pipefail
88
11
 
89
- header "notes"
90
- info "trace file: set DSH_WSL_TRACE=<path> to record the auto-preset decisions, then re-run the scenario"
91
- info "paste this report into the issue's Output section; redact anything you would rather not publish"
92
- exit 0
12
+ HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
13
+ exec node "$HERE/doctor.mjs" --read-only "$@"