dsh-wsl-tool 1.8.2 → 1.9.1
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 +35 -1
- package/README.zh-CN.md +29 -1
- package/cordis.patch.yml +4 -0
- package/extras/terminal-wsl.patch.yml +34 -0
- package/package.json +3 -2
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,40 @@ 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
|
+
## Optional: a WSL terminal in the sidebar
|
|
138
|
+
|
|
139
|
+
The desktop app's sidebar terminal can open WSL instead of a Windows shell. It is
|
|
140
|
+
**opt-in** — installing this plugin does not change which shell your terminals
|
|
141
|
+
open — and the patch that enables it ships in the package as
|
|
142
|
+
[`extras/terminal-wsl.patch.yml`](extras/terminal-wsl.patch.yml).
|
|
143
|
+
|
|
144
|
+
To turn it on, copy that entry into your profile's own patch layer
|
|
145
|
+
(`$DSH_HOME/profiles/<profile>/cordis.patch.yml`); a CLI launch can instead pass
|
|
146
|
+
`--patch <path to the installed file>`. It applies at the next app start.
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
- id: terminal-controller
|
|
150
|
+
config:
|
|
151
|
+
shell:
|
|
152
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
153
|
+
name: WSL
|
|
154
|
+
args: ['-e', 'bash', '-l']
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
- The sidebar's 新建终端 list is built from the composed `terminal-controller`
|
|
158
|
+
row: it lists the configured `shell` first and keeps the shells it discovers
|
|
159
|
+
(`powershell`, `cmd`, `bash`, …) selectable. The picker is core UI, so overriding
|
|
160
|
+
that row is the supported way in — which is also why this cannot be a plain
|
|
161
|
+
plugin entry.
|
|
162
|
+
- No distribution is pinned, so `wsl.exe` follows the system default — the same
|
|
163
|
+
rule the tools use when `DSH_WSL_DISTRO` is unset. Add `-d <name>` to `args` to
|
|
164
|
+
pin one.
|
|
165
|
+
- The session workspace is a Windows path that `wsl.exe` translates, so the
|
|
166
|
+
terminal opens in `/mnt/<drive>/…` exactly like the Windows shells do; and it is
|
|
167
|
+
a real PTY (`xterm-256color`), so full-screen programs work.
|
|
168
|
+
- An id-targeted patch replaces that row's whole config, so restate anything else
|
|
169
|
+
you had set on it (terminal limits, scrollback, a custom `shellCandidates` list).
|
|
170
|
+
|
|
137
171
|
## `wsl` parameters
|
|
138
172
|
|
|
139
173
|
| Param | Required | Type | Notes |
|
|
@@ -342,7 +376,7 @@ A `file:` dependency is a **copy**, so editing this checkout does not change wha
|
|
|
342
376
|
DSH loads. After any change:
|
|
343
377
|
|
|
344
378
|
```sh
|
|
345
|
-
npm run sync # copies into ~/.dsh/profiles/
|
|
379
|
+
npm run sync # copies into ~/.dsh/profiles/desktop/node_modules/dsh-wsl
|
|
346
380
|
npm run sync -- /path/to/profiles/<profile>/node_modules/<your-key>
|
|
347
381
|
```
|
|
348
382
|
|
package/README.zh-CN.md
CHANGED
|
@@ -116,6 +116,34 @@ 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 而不是 Windows shell。这是**可选**的 —— 装插件**不会**改你终端默认
|
|
122
|
+
开什么 —— 启用用的 patch 随包提供:[`extras/terminal-wsl.patch.yml`](extras/terminal-wsl.patch.yml)。
|
|
123
|
+
|
|
124
|
+
启用方式:把里面的条目复制进你自己 profile 的 patch 层
|
|
125
|
+
(`$DSH_HOME/profiles/<profile>/cordis.patch.yml`);命令行启动也可以改成
|
|
126
|
+
`--patch <已安装文件路径>`。**下次启动应用时生效。**
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
- id: terminal-controller
|
|
130
|
+
config:
|
|
131
|
+
shell:
|
|
132
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
133
|
+
name: WSL
|
|
134
|
+
args: ['-e', 'bash', '-l']
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- 「新建终端」的列表来自组合里的 `terminal-controller` 行:它把配置的 `shell` 排在最前,同时保留
|
|
138
|
+
它发现的 `powershell`/`cmd`/`bash` 等可选。那个选择列表属于核心 UI,所以**按 id 覆盖该行**是
|
|
139
|
+
受支持的入口 —— 这也是它没法做成普通插件条目的原因。
|
|
140
|
+
- **不锁定发行版**:`wsl.exe` 跟随系统默认,与工具在未设 `DSH_WSL_DISTRO` 时的规则一致。要锁定就
|
|
141
|
+
在 `args` 里加 `-d <名字>`。
|
|
142
|
+
- 会话工作区是 Windows 路径,`wsl.exe` 会自动翻译,因此终端像 Windows shell 一样落在
|
|
143
|
+
`/mnt/<盘>/…`;而且是**真 PTY**(`xterm-256color`),全屏程序可用。
|
|
144
|
+
- 按 id 的 patch 会**整段替换**该行 config,你之前在该行上设过的东西(终端上限、scrollback、
|
|
145
|
+
自定义 `shellCandidates`)要一并重述。
|
|
146
|
+
|
|
119
147
|
## `wsl` 参数
|
|
120
148
|
|
|
121
149
|
| 参数 | 必填 | 类型 | 说明 |
|
|
@@ -318,7 +346,7 @@ DSH_SUBPROCESS_LOCAL=/path/to/dsh/node_modules npm run test:real
|
|
|
318
346
|
`file:` 依赖是**副本**,改本仓库不会改变 DSH 实际加载的内容。任何改动之后:
|
|
319
347
|
|
|
320
348
|
```sh
|
|
321
|
-
npm run sync # 复制到 ~/.dsh/profiles/
|
|
349
|
+
npm run sync # 复制到 ~/.dsh/profiles/desktop/node_modules/dsh-wsl
|
|
322
350
|
npm run sync -- /path/to/profiles/<profile>/node_modules/<你的依赖名>
|
|
323
351
|
```
|
|
324
352
|
|
package/cordis.patch.yml
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
# `tool "wsl" is already registered in this scope`. To keep the tools out of a
|
|
7
7
|
# composition, override this row by id in a later patch layer (`- id: tool-wsl`
|
|
8
8
|
# with `disabled: true`) instead of duplicating it.
|
|
9
|
+
#
|
|
10
|
+
# This file deliberately changes nothing else: installing a tool plugin must not
|
|
11
|
+
# reshape someone's session. Pointing the desktop app's sidebar terminal at WSL is
|
|
12
|
+
# offered as an opt-in instead — see `extras/terminal-wsl.patch.yml`.
|
|
9
13
|
|
|
10
14
|
# The entry name is PATH-RELATIVE on purpose. DSH anchors a relative `name:` to
|
|
11
15
|
# the directory of the patch file that declared it (`anchorInsertedPluginNames`),
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# OPTIONAL — give the desktop app's sidebar terminal a WSL shell.
|
|
2
|
+
#
|
|
3
|
+
# This is deliberately NOT part of the bundle patch: installing a tool plugin must
|
|
4
|
+
# not change which shell someone's terminals open by default. To opt in, copy the
|
|
5
|
+
# entry below into the profile's own patch layer
|
|
6
|
+
# (`$DSH_HOME/profiles/<profile>/cordis.patch.yml`), or hand this file to a CLI
|
|
7
|
+
# launch with `--patch <path to this file>`. It applies at the next app start.
|
|
8
|
+
#
|
|
9
|
+
# Why an id-targeted override: the sidebar's 新建终端 list is built from the
|
|
10
|
+
# composed `terminal-controller` row, which discovers shells from
|
|
11
|
+
# `shellCandidates` and lists the configured `shell` first. A candidate entry
|
|
12
|
+
# cannot do it — a shell found by name gets `-i` appended, and `wsl.exe -i` is a
|
|
13
|
+
# hard error. The picker itself is core UI, so a plugin cannot add an entry to it;
|
|
14
|
+
# overriding the row is the supported way in.
|
|
15
|
+
#
|
|
16
|
+
# The path is absolute because a configured shell that fails to resolve makes every
|
|
17
|
+
# new terminal fail, not just this one, and wsl.exe ships with Windows at a fixed
|
|
18
|
+
# location whether or not a distribution is installed yet.
|
|
19
|
+
#
|
|
20
|
+
# No distribution is pinned, so `wsl.exe` follows the system default — the same
|
|
21
|
+
# rule the tools use when `DSH_WSL_DISTRO` is unset. Add `-d <name>` to `args` to
|
|
22
|
+
# pin one.
|
|
23
|
+
#
|
|
24
|
+
# An id-targeted patch replaces that row's whole config, so anything a layer below
|
|
25
|
+
# set on it (terminal limits, scrollback, a custom `shellCandidates` list) falls
|
|
26
|
+
# back to its schema default; only `shell` is set here on purpose. Never add
|
|
27
|
+
# `disabled:` — that would switch the whole terminal feature off instead of
|
|
28
|
+
# adjusting it.
|
|
29
|
+
- id: terminal-controller
|
|
30
|
+
config:
|
|
31
|
+
shell:
|
|
32
|
+
path: 'C:\Windows\System32\wsl.exe'
|
|
33
|
+
name: WSL
|
|
34
|
+
args: ['-e', 'bash', '-l']
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-wsl-tool",
|
|
3
|
-
"version": "1.
|
|
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.",
|
|
3
|
+
"version": "1.9.1",
|
|
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. Optionally gives the desktop app's sidebar terminal a WSL shell. 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",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"README.md",
|
|
31
31
|
"README.zh-CN.md",
|
|
32
32
|
"PUBLISHING.md",
|
|
33
|
+
"extras",
|
|
33
34
|
"screenshots.json",
|
|
34
35
|
"assets",
|
|
35
36
|
"LICENSE"
|