dsh-plugin-wsl-env 0.23.1 → 0.25.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 (77) hide show
  1. package/CHANGELOG.md +212 -0
  2. package/README.md +9 -5
  3. package/SECURITY.md +10 -0
  4. package/client.js +974 -165
  5. package/cordis.patch.yml +28 -3
  6. package/docs/API.md +2 -1
  7. package/docs/ARCHITECTURE.md +36 -13
  8. package/docs/COMPATIBILITY.md +5 -0
  9. package/docs/CONFIGURATION.md +80 -9
  10. package/docs/CONFIGURATION.zh.md +64 -8
  11. package/docs/DIAGNOSTICS.md +48 -20
  12. package/docs/DIAGNOSTICS.zh.md +36 -14
  13. package/docs/LIMITATIONS.md +36 -9
  14. package/docs/LIMITATIONS.zh.md +26 -7
  15. package/docs/MIGRATION.md +1 -1
  16. package/docs/PEER-PARITY.md +4 -4
  17. package/docs/QUICKSTART.md +42 -12
  18. package/docs/QUICKSTART.zh.md +29 -8
  19. package/docs/README.zh.md +9 -5
  20. package/docs/RELEASING.md +17 -13
  21. package/docs/REQUIREMENTS.zh.md +5 -4
  22. package/docs/UPSTREAM-FSIO-EXPORT.md +5 -4
  23. package/docs/UPSTREAM-PROMPT-ADAPTERS.md +85 -0
  24. package/docs/root-fs-routing.md +1 -1
  25. package/lib/agent-confined.d.ts +7 -1
  26. package/lib/agent-confined.js +3 -3
  27. package/lib/auto-preset.d.ts +27 -0
  28. package/lib/auto-preset.js +40 -3
  29. package/lib/bwrap.d.ts +14 -0
  30. package/lib/bwrap.js +11 -0
  31. package/lib/client-host.d.ts +2 -2
  32. package/lib/client-host.js +2 -2
  33. package/lib/cwd-prompt.d.ts +41 -3
  34. package/lib/cwd-prompt.js +125 -8
  35. package/lib/doctor-report.d.ts +50 -0
  36. package/lib/doctor-report.js +172 -0
  37. package/lib/fs-routing.d.ts +1 -1
  38. package/lib/fs-routing.js +1 -1
  39. package/lib/fs.d.ts +1 -1
  40. package/lib/fs.js +1 -1
  41. package/lib/index.d.ts +6 -1464
  42. package/lib/index.js +5 -2120
  43. package/lib/listing.d.ts +21 -9
  44. package/lib/listing.js +25 -21
  45. package/lib/messages.d.ts +1 -1
  46. package/lib/messages.js +3 -3
  47. package/lib/picker.d.ts +50 -16
  48. package/lib/picker.js +103 -23
  49. package/lib/preflight.d.ts +7 -4
  50. package/lib/preflight.js +27 -13
  51. package/lib/preset-choice.d.ts +22 -3
  52. package/lib/preset-choice.js +36 -3
  53. package/lib/provider-common.d.ts +58 -0
  54. package/lib/provider-common.js +123 -0
  55. package/lib/sandbox-core.d.ts +1 -0
  56. package/lib/sandbox-core.js +4 -2
  57. package/lib/session-runtime.d.ts +7 -1
  58. package/lib/session-runtime.js +9 -2
  59. package/lib/shell.d.ts +1 -1
  60. package/lib/shell.js +1 -1
  61. package/lib/status.d.ts +261 -0
  62. package/lib/status.js +425 -0
  63. package/lib/writable-roots.d.ts +109 -0
  64. package/lib/writable-roots.js +257 -0
  65. package/lib/wsl-doctor-tool.d.ts +8 -0
  66. package/lib/wsl-doctor-tool.js +18 -20
  67. package/lib/wsl-filesystem.d.ts +692 -0
  68. package/lib/wsl-filesystem.js +897 -0
  69. package/lib/wsl-shell.d.ts +742 -0
  70. package/lib/wsl-shell.js +965 -0
  71. package/lib/wsl.d.ts +13 -1
  72. package/lib/wsl.js +16 -1
  73. package/locale/doctor/en.json +3 -2
  74. package/locale/doctor/zh.json +3 -2
  75. package/package.json +12 -4
  76. package/scripts/doctor.mjs +436 -226
  77. package/scripts/profile-preset.mjs +17 -5
package/lib/wsl.d.ts CHANGED
@@ -59,6 +59,18 @@ export declare function runCapture(argv: string[], signal?: AbortSignal, deadlin
59
59
  * @returns distro names in WSL's own order, default distro first.
60
60
  */
61
61
  export declare function listDistros(options?: WslCallOptions): Promise<string[]>;
62
+ /**
63
+ * List the distros that are running right now (`wsl.exe -l --running -q`).
64
+ *
65
+ * The status panel uses this to decide which stored results may be refreshed
66
+ * in the background: probing a stopped distro boots it, and a page load must
67
+ * never do that. A failure here is not fatal to the caller — no running list
68
+ * means no background refresh, which is a prompt to check on demand instead.
69
+ *
70
+ * @param options - the `wsl.exe` path and optional cancellation.
71
+ * @returns running distro names in WSL's own order.
72
+ */
73
+ export declare function listRunningDistros(options?: WslCallOptions): Promise<string[]>;
62
74
  /**
63
75
  * Parse `wsl.exe -l -q` output into distro names. A pure seam so the CRLF and
64
76
  * blank-line shapes of the real output are unit-testable on hosts without
@@ -167,7 +179,7 @@ export interface WslTerminalOptions {
167
179
  /**
168
180
  * The `wsl.exe` argv that opens one interactive shell inside a distro.
169
181
  *
170
- * This is the terminal twin of the command form built in `lib/index.js`, with
182
+ * This is the terminal twin of the command form built in `lib/wsl-shell.js`, with
171
183
  * three deliberate differences:
172
184
  *
173
185
  * - There is no command string. With no pinned shell the launch ends here and
package/lib/wsl.js CHANGED
@@ -81,6 +81,21 @@ export async function listDistros(options = {}) {
81
81
  const stdout = await runCapture([options.wslPath ?? DEFAULT_WSL_PATH, "-l", "-q"], options.signal);
82
82
  return parseDistroList(stdout);
83
83
  }
84
+ /**
85
+ * List the distros that are running right now (`wsl.exe -l --running -q`).
86
+ *
87
+ * The status panel uses this to decide which stored results may be refreshed
88
+ * in the background: probing a stopped distro boots it, and a page load must
89
+ * never do that. A failure here is not fatal to the caller — no running list
90
+ * means no background refresh, which is a prompt to check on demand instead.
91
+ *
92
+ * @param options - the `wsl.exe` path and optional cancellation.
93
+ * @returns running distro names in WSL's own order.
94
+ */
95
+ export async function listRunningDistros(options = {}) {
96
+ const stdout = await runCapture([options.wslPath ?? DEFAULT_WSL_PATH, "-l", "--running", "-q"], options.signal);
97
+ return parseDistroList(stdout);
98
+ }
84
99
  /**
85
100
  * Parse `wsl.exe -l -q` output into distro names. A pure seam so the CRLF and
86
101
  * blank-line shapes of the real output are unit-testable on hosts without
@@ -226,7 +241,7 @@ export function interactiveShellArgs(shellPath, login) {
226
241
  /**
227
242
  * The `wsl.exe` argv that opens one interactive shell inside a distro.
228
243
  *
229
- * This is the terminal twin of the command form built in `lib/index.js`, with
244
+ * This is the terminal twin of the command form built in `lib/wsl-shell.js`, with
230
245
  * three deliberate differences:
231
246
  *
232
247
  * - There is no command string. With no pinned shell the launch ends here and
@@ -15,7 +15,7 @@
15
15
  "verdict.ready.many": "verdict: READY — the first command should succeed in each of: {targets}",
16
16
  "verdict.blocked": "verdict: BLOCKED by: {blockers} — apply the fixes above, then rerun",
17
17
  "fix.prefix": " fix: {remedy}",
18
- "fix.hint": "run with --fix to sweep stale scopes; --fix --install asks before installing packages",
18
+ "fix.hint": "run with --fix to sweep stale scopes and purge a broken agent cache; --fix --install asks before installing packages",
19
19
  "sessions.title": "sessions across running distros",
20
20
  "sessions.none": " (none)",
21
21
  "sessions.no-user-manager": "no user manager — scopes unavailable",
@@ -26,5 +26,6 @@
26
26
  "bundle.redacted": ", redacted",
27
27
  "refusal.read-only": "doctor: --read-only refuses --fix/--install; run `pnpm run doctor --fix` instead",
28
28
  "refusal.scoped-fix": "doctor: --fix needs a full run — a scoped run cannot re-verify what it did not probe",
29
- "confirm.install": "Install {packages} in \"{distro}\" as root?"
29
+ "confirm.install": "Install {packages} in \"{distro}\" as root?",
30
+ "refusal.owned-install": "doctor: --fix-owned repairs plugin-owned state only and cannot be combined with --install"
30
31
  }
@@ -15,7 +15,7 @@
15
15
  "verdict.ready.many": "裁决: READY——首条命令应能在以下每个 distro 中成功: {targets}",
16
16
  "verdict.blocked": "裁决: BLOCKED——阻断项: {blockers};先应用上方的修复,再重跑",
17
17
  "fix.prefix": " 修复: {remedy}",
18
- "fix.hint": "加 --fix 清扫残留 scope;--fix --install 安装软件包前会先询问",
18
+ "fix.hint": "加 --fix 清扫残留 scope 并清理损坏的 agent 缓存;--fix --install 安装软件包前会先询问",
19
19
  "sessions.title": "正在运行的 distro 会话",
20
20
  "sessions.none": " (无)",
21
21
  "sessions.no-user-manager": "无用户管理器——scope 不可用",
@@ -26,5 +26,6 @@
26
26
  "bundle.redacted": ",已脱敏",
27
27
  "refusal.read-only": "doctor: --read-only 拒绝 --fix/--install;请改用 `pnpm run doctor --fix`",
28
28
  "refusal.scoped-fix": "doctor: --fix 需要完整运行——分区运行无法复核未探测的项目",
29
- "confirm.install": "以 root 在 \"{distro}\" 中安装 {packages}?"
29
+ "confirm.install": "以 root 在 \"{distro}\" 中安装 {packages}?",
30
+ "refusal.owned-install": "doctor: --fix-owned 只修复插件自有状态,不能与 --install 同用"
30
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-wsl-env",
3
- "version": "0.23.1",
3
+ "version": "0.25.0",
4
4
  "description": "在 WSL 的 Linux 实例中打开项目工作区,在对应 Linux 空间中进行命令执行、运行 shell 脚本和文件访问,以获得全套 Linux Shell 工具链收益,并通过 bubblewrap 对命令进行沙箱隔离",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -83,6 +83,10 @@
83
83
  "types": "./lib/shell-env.d.ts",
84
84
  "default": "./lib/shell-env.js"
85
85
  },
86
+ "./status": {
87
+ "types": "./lib/status.d.ts",
88
+ "default": "./lib/status.js"
89
+ },
86
90
  "./shell-env/locale/en.json": "./locale/shell-env/en.json",
87
91
  "./shell-env/locale/zh.json": "./locale/shell-env/zh.json",
88
92
  "./subprocess": {
@@ -116,8 +120,11 @@
116
120
  "platform": "web",
117
121
  "immediately": true,
118
122
  "inject": [
123
+ "@deepseek-ai/dsh-api-remotes",
119
124
  "@deepseek-ai/dsh-client-ui-slots",
120
- "@deepseek-ai/dsh-client-ui-conversation"
125
+ "@deepseek-ai/dsh-client-ui-layout",
126
+ "@deepseek-ai/dsh-client-ui-sidebar",
127
+ "@deepseek-ai/dsh-client-ui-workspace"
121
128
  ]
122
129
  }
123
130
  },
@@ -147,6 +154,7 @@
147
154
  "docs/root-fs-routing.md",
148
155
  "docs/VALUE.zh.md",
149
156
  "docs/UPSTREAM-OPEN-IN-APP.md",
157
+ "docs/UPSTREAM-PROMPT-ADAPTERS.md",
150
158
  "docs/adr/0002-native-agent.md",
151
159
  "docs/PARITY.md",
152
160
  "docs/PEER-PARITY.md",
@@ -181,9 +189,9 @@
181
189
  "lint:types": "tsc --noEmit",
182
190
  "build": "node scripts/build.mjs",
183
191
  "lint:build": "node test/build-freshness.mjs",
184
- "test:coverage": "node scripts/coverage-gate.mjs -- node --test --test-timeout=60000 --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=84 --test-coverage-functions=70 --test-coverage-exclude='scripts/**' --test-coverage-exclude='test/**' 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-exec.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/shell-env.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/update-check.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs test/probe-runner.test.mjs test/cwd-prompt.test.mjs test/cwd-prompt-tool.test.mjs test/wsl-doctor-tool.test.mjs test/wsl-doctor-command.test.mjs test/client-host.test.mjs test/messages.test.mjs",
192
+ "test:coverage": "node scripts/coverage-gate.mjs -- node --test --test-timeout=60000 --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=84 --test-coverage-functions=70 --test-coverage-exclude='scripts/**' --test-coverage-exclude='test/**' 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-exec.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/writable-roots.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/shell-env.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/update-check.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs test/probe-runner.test.mjs test/cwd-prompt.test.mjs test/cwd-prompt-tool.test.mjs test/wsl-doctor-tool.test.mjs test/wsl-doctor-command.test.mjs test/status.test.mjs test/client-host.test.mjs test/messages.test.mjs",
185
193
  "test:syntax": "node test/syntax.mjs",
186
- "test:unit": "node scripts/test-watchdog.mjs -- node --test --test-timeout=60000 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/shell-env.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-exec.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/update-check.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs test/probe-runner.test.mjs test/cwd-prompt.test.mjs test/cwd-prompt-tool.test.mjs test/wsl-doctor-tool.test.mjs test/wsl-doctor-command.test.mjs test/client-host.test.mjs test/messages.test.mjs",
194
+ "test:unit": "node scripts/test-watchdog.mjs -- node --test --test-timeout=60000 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/shell-env.test.mjs test/terminal.test.mjs test/probe-cache.test.mjs test/writable-roots.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-exec.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/update-check.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs test/probe-runner.test.mjs test/cwd-prompt.test.mjs test/cwd-prompt-tool.test.mjs test/wsl-doctor-tool.test.mjs test/wsl-doctor-command.test.mjs test/status.test.mjs test/client-host.test.mjs test/messages.test.mjs",
187
195
  "lint:style": "node test/style.mjs",
188
196
  "lint:links": "node scripts/check-links.mjs",
189
197
  "lint:requirements": "node scripts/check-requirements.mjs",