dsh-wsl-tool 1.8.2 → 1.9.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.
- package/PUBLISHING.md +11 -2
- package/README.md +39 -1
- package/README.zh-CN.md +34 -1
- package/cordis.patch.yml +32 -0
- package/package.json +1 -1
package/PUBLISHING.md
CHANGED
|
@@ -61,10 +61,11 @@ both that the entry stays relative and that it resolves.
|
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
`npm run sync` defaults to
|
|
64
|
-
`%USERPROFILE%/.dsh/profiles/
|
|
64
|
+
`%USERPROFILE%/.dsh/profiles/desktop/node_modules/dsh-wsl` — the folder the
|
|
65
65
|
profile's dependency key created, which need not match the npm name. Pass a
|
|
66
66
|
path to target another profile. Restart DSH afterwards: the plugin is imported
|
|
67
|
-
once at load.
|
|
67
|
+
once at load. A patch change (the tool row, or the sidebar terminal override)
|
|
68
|
+
is read at composition time, so it needs that restart too.
|
|
68
69
|
|
|
69
70
|
3. The tag runs the pipeline. The order is deliberate — the release asset goes
|
|
70
71
|
**first** because it is the market's critical path, then npm, so a failing npm
|
|
@@ -100,6 +101,14 @@ both that the entry stays relative and that it resolves.
|
|
|
100
101
|
artifact, not just the metadata. Scripted requests to `npmjs.com`'s HTML hit a
|
|
101
102
|
Cloudflare challenge; the registry API is the source of truth.
|
|
102
103
|
|
|
104
|
+
Expect the registry's caches to lag a publish by minutes, and to lag
|
|
105
|
+
*inconsistently*: the full packument, the abbreviated (install) packument,
|
|
106
|
+
`/-/package/<name>/dist-tags` and the tarball URL each cache separately, so one
|
|
107
|
+
endpoint can already report the new version while `npm install` still answers
|
|
108
|
+
`404` for its tarball. Re-query instead of concluding the publish failed, and
|
|
109
|
+
cache-bust the tarball URL (`?cb=<random>`) to tell a stale negative entry apart
|
|
110
|
+
from an artifact that is genuinely missing.
|
|
111
|
+
|
|
103
112
|
**Market asset** (this is what users install, and it is independent of npm):
|
|
104
113
|
|
|
105
114
|
```sh
|
package/README.md
CHANGED
|
@@ -134,6 +134,44 @@ A background job is owned by the calling session (`owner: exec.agent.id`), which
|
|
|
134
134
|
is what lets the model read it back with `job_output`/`job_kill` and what keeps
|
|
135
135
|
other sessions out; an execution with no agent starts the job unowned.
|
|
136
136
|
|
|
137
|
+
## A WSL terminal in the sidebar
|
|
138
|
+
|
|
139
|
+
Installing this plugin also gives the desktop app's sidebar terminal a **WSL**
|
|
140
|
+
shell. `cordis.patch.yml` overrides the composed `terminal-controller` row, whose
|
|
141
|
+
configured shell is listed **first** and selected by default; the shells that row
|
|
142
|
+
discovers (`powershell`, `cmd`, `bash`, …) stay selectable, so 新建终端 offers WSL
|
|
143
|
+
next to them.
|
|
144
|
+
|
|
145
|
+
```yaml
|
|
146
|
+
- id: terminal-controller
|
|
147
|
+
config:
|
|
148
|
+
shell:
|
|
149
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
150
|
+
name: WSL
|
|
151
|
+
args: ['-e', 'bash', '-l']
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
- No distribution is pinned, so `wsl.exe` follows the system default — the same
|
|
155
|
+
rule the tools use when `DSH_WSL_DISTRO` is unset.
|
|
156
|
+
- The session workspace is a Windows path that `wsl.exe` translates, so the
|
|
157
|
+
terminal opens in `/mnt/<drive>/…` exactly like the Windows shells do; and it is
|
|
158
|
+
a real PTY (`xterm-256color`), so full-screen programs work.
|
|
159
|
+
- **Pinning a distribution, or choosing a different default, is a later patch
|
|
160
|
+
layer** — a profile's own `cordis.patch.yml` wins over this bundle:
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
- id: terminal-controller
|
|
164
|
+
config:
|
|
165
|
+
shell:
|
|
166
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
167
|
+
name: WSL
|
|
168
|
+
args: ['-d', 'Ubuntu-22.04', '-e', 'bash', '-l']
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
An id-targeted patch replaces that row's whole config, so restate anything else
|
|
172
|
+
you had set on it.
|
|
173
|
+
- Applies at the next app start.
|
|
174
|
+
|
|
137
175
|
## `wsl` parameters
|
|
138
176
|
|
|
139
177
|
| Param | Required | Type | Notes |
|
|
@@ -342,7 +380,7 @@ A `file:` dependency is a **copy**, so editing this checkout does not change wha
|
|
|
342
380
|
DSH loads. After any change:
|
|
343
381
|
|
|
344
382
|
```sh
|
|
345
|
-
npm run sync # copies into ~/.dsh/profiles/
|
|
383
|
+
npm run sync # copies into ~/.dsh/profiles/desktop/node_modules/dsh-wsl
|
|
346
384
|
npm run sync -- /path/to/profiles/<profile>/node_modules/<your-key>
|
|
347
385
|
```
|
|
348
386
|
|
package/README.zh-CN.md
CHANGED
|
@@ -116,6 +116,39 @@ DSH_SUBPROCESS_LOCAL=/path/to/dsh/node_modules npm run test:real
|
|
|
116
116
|
`job_output`/`job_kill` 读回它的依据,也是其他会话读不到它的围栏;exec 里没有 agent 时
|
|
117
117
|
任务则是无主的。
|
|
118
118
|
|
|
119
|
+
## 在侧边栏开一个 WSL 终端
|
|
120
|
+
|
|
121
|
+
装了这个插件,桌面版侧边栏终端就多出一个 **WSL** shell:插件的 `cordis.patch.yml` 覆盖组合里的
|
|
122
|
+
`terminal-controller` 行,而该行配置的 shell 会排在**第一位**并成为默认;它由 `shellCandidates`
|
|
123
|
+
发现的 `powershell`/`cmd`/`bash` 等仍然可选,所以「新建终端」里 WSL 与它们并列。
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
- id: terminal-controller
|
|
127
|
+
config:
|
|
128
|
+
shell:
|
|
129
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
130
|
+
name: WSL
|
|
131
|
+
args: ['-e', 'bash', '-l']
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- **不锁定发行版**:`wsl.exe` 跟随系统默认,与工具在未设 `DSH_WSL_DISTRO` 时的规则一致。
|
|
135
|
+
- 会话工作区是 Windows 路径,`wsl.exe` 会自动翻译,因此终端像 Windows shell 一样落在
|
|
136
|
+
`/mnt/<盘>/…`;而且是**真 PTY**(`xterm-256color`),全屏程序可用。
|
|
137
|
+
- **要锁定发行版或换默认 shell**,在更靠后的 patch 层里重述该行即可 —— profile 自己的
|
|
138
|
+
`cordis.patch.yml` 优先于本组合包:
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
- id: terminal-controller
|
|
142
|
+
config:
|
|
143
|
+
shell:
|
|
144
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
145
|
+
name: WSL
|
|
146
|
+
args: ['-d', 'Ubuntu-22.04', '-e', 'bash', '-l']
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
按 id 的 patch 会**整段替换**该行 config,其他设置要一并重述。
|
|
150
|
+
- **下次启动应用时生效。**
|
|
151
|
+
|
|
119
152
|
## `wsl` 参数
|
|
120
153
|
|
|
121
154
|
| 参数 | 必填 | 类型 | 说明 |
|
|
@@ -318,7 +351,7 @@ DSH_SUBPROCESS_LOCAL=/path/to/dsh/node_modules npm run test:real
|
|
|
318
351
|
`file:` 依赖是**副本**,改本仓库不会改变 DSH 实际加载的内容。任何改动之后:
|
|
319
352
|
|
|
320
353
|
```sh
|
|
321
|
-
npm run sync # 复制到 ~/.dsh/profiles/
|
|
354
|
+
npm run sync # 复制到 ~/.dsh/profiles/desktop/node_modules/dsh-wsl
|
|
322
355
|
npm run sync -- /path/to/profiles/<profile>/node_modules/<你的依赖名>
|
|
323
356
|
```
|
|
324
357
|
|
package/cordis.patch.yml
CHANGED
|
@@ -19,3 +19,35 @@
|
|
|
19
19
|
- insert:
|
|
20
20
|
- id: tool-wsl
|
|
21
21
|
name: './index.js'
|
|
22
|
+
|
|
23
|
+
# ── Sidebar terminal: a WSL shell, listed first and selected by default ────────
|
|
24
|
+
#
|
|
25
|
+
# The desktop app's 新建终端 list is built from the composed `terminal-controller`
|
|
26
|
+
# row: it discovers shells from `shellCandidates` and puts the configured `shell`
|
|
27
|
+
# first. Overriding that row here is what makes installing this plugin also give
|
|
28
|
+
# you a Linux terminal in the sidebar. (A candidate entry cannot do it: a shell
|
|
29
|
+
# discovered by name gets `-i` appended, and `wsl.exe -i` is a hard error.)
|
|
30
|
+
#
|
|
31
|
+
# The path is absolute because the configured shell must resolve, and a shell that
|
|
32
|
+
# cannot resolve makes every new terminal fail rather than just this one: wsl.exe
|
|
33
|
+
# ships with Windows at a fixed location, so this resolves even where no
|
|
34
|
+
# distribution is installed yet.
|
|
35
|
+
#
|
|
36
|
+
# No distro is pinned, so `wsl.exe` follows the system default — the same rule the
|
|
37
|
+
# tools use when DSH_WSL_DISTRO is unset. Add `-d <name>` to `args` to pin one.
|
|
38
|
+
#
|
|
39
|
+
# This changes the default terminal shell, which is deliberate for a WSL plugin
|
|
40
|
+
# and reversible: a later patch layer wins, so restating the row in a profile's own
|
|
41
|
+
# cordis.patch.yml overrides it (and a profile that sets its own `shell` there is
|
|
42
|
+
# unaffected by this row).
|
|
43
|
+
#
|
|
44
|
+
# An id-targeted patch replaces the whole config, so anything the layer below set
|
|
45
|
+
# on this row (limits, scrollback, a custom shellCandidates list) falls back to its
|
|
46
|
+
# schema default. Only `shell` is set here on purpose. Never add `disabled:` here:
|
|
47
|
+
# that would switch off the terminal feature for the user instead of just this row.
|
|
48
|
+
- id: terminal-controller
|
|
49
|
+
config:
|
|
50
|
+
shell:
|
|
51
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
52
|
+
name: WSL
|
|
53
|
+
args: ['-e', 'bash', '-l']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-wsl-tool",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
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",
|