dsh-plugin-wsl-env 0.21.0 → 0.23.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 (86) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/CONTRIBUTING.md +7 -3
  3. package/README.md +11 -9
  4. package/SUPPORT.md +1 -1
  5. package/client.js +153 -33
  6. package/cordis.patch.yml +13 -4
  7. package/docs/AGENT-PROTOCOL-V7.md +4 -4
  8. package/docs/API.md +12 -2
  9. package/docs/ARCHITECTURE.md +59 -19
  10. package/docs/CONFIGURATION.md +44 -13
  11. package/docs/CONFIGURATION.zh.md +44 -8
  12. package/docs/DIAGNOSTICS.md +41 -1
  13. package/docs/DIAGNOSTICS.zh.md +34 -2
  14. package/docs/LIMITATIONS.md +42 -17
  15. package/docs/LIMITATIONS.zh.md +47 -12
  16. package/docs/MIGRATION.md +1 -1
  17. package/docs/PEER-PARITY.md +8 -7
  18. package/docs/QUICKSTART.md +16 -8
  19. package/docs/QUICKSTART.zh.md +22 -4
  20. package/docs/README.zh.md +19 -10
  21. package/docs/RELEASING.md +8 -3
  22. package/docs/REQUIREMENTS.zh.md +11 -6
  23. package/docs/ROADMAP-1.0.md +12 -11
  24. package/docs/ROADMAP.md +10 -8
  25. package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +3 -2
  26. package/docs/UPSTREAM-FSIO-EXPORT.md +8 -9
  27. package/docs/UPSTREAM-SERVICE-SWAP.md +9 -5
  28. package/docs/UPSTREAM-TERMINAL-TITLE.md +9 -8
  29. package/docs/VALUE.zh.md +5 -5
  30. package/docs/root-fs-routing.md +26 -19
  31. package/lib/agent-confined.d.ts +2 -2
  32. package/lib/agent-confined.js +0 -1
  33. package/lib/agent-exec.d.ts +2 -11
  34. package/lib/agent-protocol.d.ts +6 -5
  35. package/lib/agent.d.ts +5 -5
  36. package/lib/auto-preset.d.ts +4 -3
  37. package/lib/bwrap.d.ts +2 -1
  38. package/lib/client-host.d.ts +1 -1
  39. package/lib/client-host.js +1 -1
  40. package/lib/cwd-prompt-tool.d.ts +4 -20
  41. package/lib/cwd-prompt.d.ts +11 -10
  42. package/lib/distro-route.d.ts +3 -2
  43. package/lib/doctor-live.d.ts +2 -1
  44. package/lib/fs-routing.d.ts +29 -1
  45. package/lib/fs-routing.js +30 -3
  46. package/lib/fs-substrate.d.ts +0 -1
  47. package/lib/fs-substrate.js +0 -1
  48. package/lib/fsio-agent.d.ts +3 -21
  49. package/lib/fsio-agent.js +2 -4
  50. package/lib/git-exec.d.ts +3 -2
  51. package/lib/git-route.d.ts +4 -2
  52. package/lib/git-route.js +4 -2
  53. package/lib/index.d.ts +20 -10
  54. package/lib/index.js +128 -12
  55. package/lib/listing.d.ts +2 -1
  56. package/lib/messages.d.ts +82 -1
  57. package/lib/messages.js +94 -1
  58. package/lib/native-agent.d.ts +3 -2
  59. package/lib/paths.d.ts +2 -1
  60. package/lib/picker.d.ts +1 -14
  61. package/lib/picker.js +1 -2
  62. package/lib/preflight.d.ts +5 -4
  63. package/lib/probe-cache.d.ts +2 -1
  64. package/lib/sandbox-core.d.ts +2 -11
  65. package/lib/sandbox-core.js +1 -1
  66. package/lib/sandbox.d.ts +0 -1
  67. package/lib/sandbox.js +0 -4
  68. package/lib/search-exec.d.ts +2 -1
  69. package/lib/session-runtime.d.ts +3 -2
  70. package/lib/shell-env.d.ts +3 -2
  71. package/lib/shell.d.ts +1 -1
  72. package/lib/shell.js +1 -1
  73. package/lib/subprocess.d.ts +1 -1
  74. package/lib/update-check.d.ts +3 -3
  75. package/lib/wsl-doctor-command.d.ts +133 -0
  76. package/lib/wsl-doctor-command.js +381 -0
  77. package/lib/wsl-doctor-tool.d.ts +101 -16
  78. package/lib/wsl-doctor-tool.js +290 -22
  79. package/lib/wsl.d.ts +3 -2
  80. package/locale/doctor/en.json +30 -0
  81. package/locale/doctor/zh.json +30 -0
  82. package/package.json +29 -31
  83. package/scripts/bootstrap-import.sh +189 -0
  84. package/scripts/doctor.mjs +569 -141
  85. package/scripts/open-wsl-vscode.ps1 +36 -0
  86. package/examples/preset-wsl-session-sandbox.cordis.patch.yml +0 -178
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env pwsh
2
+ # Open a WSL folder in VS Code through Remote-WSL — the full Linux
3
+ # integration (distro shell, extensions in the distro, local ext4 speed) —
4
+ # instead of the degraded UNC share (9p files, Windows terminal, Windows
5
+ # extensions).
6
+ #
7
+ # scripts/open-wsl-vscode.ps1 -Path "\\wsl.localhost\ubuntu\home\me\proj"
8
+ # scripts/open-wsl-vscode.ps1 -Path "/home/me/proj" -Distro ubuntu
9
+ #
10
+ # Requires VS Code on PATH (the `code` shim) and the Remote-WSL extension.
11
+
12
+ param(
13
+ [Parameter(Mandatory = $true)][string]$Path,
14
+ [string]$Distro
15
+ )
16
+
17
+ $ErrorActionPreference = "Stop"
18
+
19
+ # Shape 1: a WSL UNC path carries its own distro name.
20
+ if ($Path -match '^\\\\wsl(?:\.localhost)?\\([^\\]+)\\(.*)$') {
21
+ $Distro = $Matches[1]
22
+ $LinuxPath = "/" + ($Matches[2] -replace "\\", "/")
23
+ }
24
+ elseif ($Path -match "^/") {
25
+ # Shape 2: a Linux path needs the distro named explicitly.
26
+ if (-not $Distro) { throw "open-wsl-vscode: a Linux path requires -Distro" }
27
+ $LinuxPath = $Path -replace "\\", "/"
28
+ }
29
+ else {
30
+ throw "open-wsl-vscode: not a WSL UNC path or a Linux path: $Path"
31
+ }
32
+
33
+ $Uri = "vscode-remote://wsl+$Distro$LinuxPath"
34
+ Write-Output "opening $Uri"
35
+ & code --folder-uri $Uri
36
+ if ($LASTEXITCODE -ne 0) { throw "code exited $LASTEXITCODE" }
@@ -1,178 +0,0 @@
1
- # A profile-patch fragment for `$DSH_HOME/profiles/<name>/cordis.patch.yml`.
2
- # It is the plugin's ENTIRE `preset-wsl` row (a row's config is replaced whole,
3
- # never deep-merged) with `sessionSandbox: true` on the `wsl-shell` AND
4
- # `wsl-fs` plugins.
5
- #
6
- # Paste it in place of any existing `- id: preset-wsl` entry in that profile
7
- # layer, then restart the app. Regenerate it from the plugin's
8
- # `cordis.patch.yml` whenever the shipped preset changes.
9
-
10
- - id: preset-wsl
11
- name: '@deepseek-ai/dsh-agent-preset'
12
- config:
13
- id: wsl
14
- order: 2
15
- plugins:
16
- - id: wsl-env
17
- name: cordis:group
18
- group: true
19
- isolate:
20
- shell: true
21
- fs: true
22
- config:
23
- # ── the WSL environment for this preset only ────────────────────
24
- # No `cwd`: an empty default workdir means the distro user's home,
25
- # asked of the distro itself. Pin a directory here to override it —
26
- # a value that is right on one machine is wrong on every other.
27
- #
28
- # Commands run in one persistent systemd user scope per session
29
- # (ADR 0001): a background dev server survives the command that
30
- # started it, `/tmp` is the distro's real `/tmp`, and `ps` sees the
31
- # session. This needs systemd as PID 1 (`[boot] systemd=true` in
32
- # /etc/wsl.conf) and a lingering user manager (`loginctl
33
- # enable-linger <user>`); the preflight refuses with those remedies
34
- # when one is missing. Set `sessionSandbox: false` for the old
35
- # per-command shape. Bubblewrap is still required for the mount
36
- # profile; without it the providers fail closed.
37
- - id: wsl-shell
38
- name: 'dsh-plugin-wsl-env'
39
- config:
40
- distro: ''
41
- loginShell: true
42
- timeoutMs: 120000
43
- maxTimeoutMs: 600000
44
- sessionSandbox: true
45
- agentBackend: auto
46
- - id: wsl-fs
47
- name: 'dsh-plugin-wsl-env/fs'
48
- config:
49
- distro: ''
50
- restrictToDistro: true
51
- # agent (the default): reads/writes/identities run inside the
52
- # distro over the resident agent (lib/fs-substrate.js) —
53
- # native symlinks and mode bits, the write guard survives to
54
- # publication, and confined mutations are kernel-enforced.
55
- # share: the opt-out — the Windows-side host fs stack over
56
- # the 9p share.
57
- substrate: agent
58
- # Confined writes ride the session runtime (ADR 0001), so they
59
- # share the command's real /tmp and workspace mounts.
60
- sessionSandbox: true
61
- - id: persona
62
- name: '@deepseek-ai/dsh-persona'
63
- config:
64
- prefix: You are a coding agent powered by the {{model}} model.
65
- - id: agent-instructions
66
- name: '@deepseek-ai/dsh-agent-instructions'
67
- config:
68
- maxBytes: 65536
69
- - id: time-context
70
- name: '@deepseek-ai/dsh-time-context'
71
- - id: tool-bash
72
- name: '@deepseek-ai/dsh-tool-bash'
73
- disabled: false
74
- - id: tool-pwsh
75
- name: '@deepseek-ai/dsh-tool-pwsh'
76
- disabled: true
77
- - id: tool-fs
78
- name: '@deepseek-ai/dsh-tool-fs'
79
- - id: tool-fs-search
80
- name: '@deepseek-ai/dsh-tool-fs-search'
81
- config:
82
- sampleOverCapGlobResults: false
83
- - id: tool-jobs
84
- name: '@deepseek-ai/dsh-tool-jobs'
85
- - id: tool-schedule
86
- name: '@deepseek-ai/dsh-tool-schedule'
87
- - id: skill-filesystem
88
- name: '@deepseek-ai/dsh-skill-filesystem'
89
- - id: tool-skill
90
- name: '@deepseek-ai/dsh-tool-skill'
91
- - id: command-goal
92
- name: '@deepseek-ai/dsh-command-goal'
93
- - id: tool-goal
94
- name: '@deepseek-ai/dsh-tool-goal'
95
- - id: planning
96
- name: cordis:group
97
- group: true
98
- isolate:
99
- planMode: true
100
- config:
101
- - id: plan-mode
102
- name: '@deepseek-ai/dsh-plan-mode'
103
- config:
104
- section: |
105
- You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
106
-
107
- Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
108
-
109
- The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
110
-
111
- Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
112
-
113
- Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
114
-
115
- When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
116
- - id: compaction
117
- name: cordis:group
118
- group: true
119
- isolate:
120
- compaction: true
121
- toolResultPruner: true
122
- config:
123
- - id: compaction-basic
124
- name: '@deepseek-ai/dsh-compaction-basic'
125
- - id: command-compact
126
- name: '@deepseek-ai/dsh-command-compact'
127
- - id: tool-result-pruner
128
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
129
- config:
130
- thresholdChars: 8192
131
- headChars: 4096
132
- tailChars: 1024
133
- - id: delegation
134
- name: cordis:group
135
- group: true
136
- isolate:
137
- workflowEngine: true
138
- config:
139
- - id: tool-subagent-control
140
- name: '@deepseek-ai/dsh-tool-subagent-control'
141
- - id: tool-subagent-list-agents
142
- name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
143
- - id: tool-subagent
144
- name: '@deepseek-ai/dsh-tool-subagent'
145
- config:
146
- provider: spawn
147
- toolName: subagent
148
- modelSelectionSettings: true
149
- - id: tool-subagent-fork
150
- name: '@deepseek-ai/dsh-tool-subagent'
151
- config:
152
- provider: fork
153
- toolName: subagent_fork
154
- - id: workflow-ptc
155
- name: '@deepseek-ai/dsh-workflow-ptc'
156
- config:
157
- provider: spawn
158
- - id: tool-workflow
159
- name: '@deepseek-ai/dsh-tool-workflow'
160
- - id: tool-ask-user
161
- name: '@deepseek-ai/dsh-tool-ask-user'
162
- - id: tool-todo
163
- name: '@deepseek-ai/dsh-tool-todo'
164
- config:
165
- allowParallelInProgress: true
166
- - id: tool-web
167
- name: '@deepseek-ai/dsh-tool-web'
168
- config:
169
- fetch: true
170
- searchTimeoutMs: 60000
171
- - id: present
172
- name: '@deepseek-ai/dsh-tool-present'
173
- - id: tool-plugin-manager
174
- name: '@deepseek-ai/dsh-plugin-manager/tools'
175
- disabled: true
176
- - id: tool-plugin-market
177
- name: '@deepseek-ai/dsh-plugin-market/tools'
178
- disabled: true