dsh-bash-terminal-ts 0.8.7 → 0.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/CHANGELOG.de.md +152 -0
- package/CHANGELOG.es.md +152 -0
- package/CHANGELOG.fr.md +152 -0
- package/CHANGELOG.it.md +152 -0
- package/CHANGELOG.md +201 -0
- package/CHANGELOG.ru.md +152 -0
- package/README.de.md +1 -1
- package/README.en.md +3 -2
- package/README.es.md +1 -1
- package/README.it.md +1 -1
- package/README.md +4 -3
- package/agent-presets/README.md +171 -170
- package/agent-presets/install-presets.mjs +180 -179
- package/agent-presets/standard-win-niu/agent.cordis.yml +271 -0
- package/agent-presets/standard-win-niu/preset.yml +2 -0
- package/cordis.patch.yml +84 -83
- package/dist/client.core.js +10 -1
- package/dist/client.js +10 -1
- package/docs/dsh-plugin-development.md +169 -0
- package/docs/niu-backend.md +197 -0
- package/dsh.plugin.json +22 -22
- package/lib/client.js +10 -1
- package/lib/dsh-types.d.ts +14 -2
- package/lib/index.d.ts +15 -2
- package/lib/index.js +43 -5
- package/lib/locales.js +9 -0
- package/lib/shell-id.d.ts +1 -1
- package/lib/shells.d.ts +1 -0
- package/lib/shells.js +8 -2
- package/lib/terminal.js +4 -0
- package/lib/webterminals/host.js +2 -2
- package/lib/webterminals/mount.js +1 -0
- package/locale/de.json +6 -4
- package/locale/en.json +6 -4
- package/locale/es.json +6 -4
- package/locale/fr.json +6 -4
- package/locale/it.json +6 -4
- package/locale/ja.json +6 -4
- package/locale/ko.json +6 -4
- package/locale/ru.json +6 -4
- package/locale/zh.json +6 -4
- package/package.json +25 -11
- package/scripts/check-artifacts.mjs +96 -93
- package/src/client.tsx +685 -685
- package/src/dsh-types.ts +332 -320
- package/src/index.ts +1316 -1275
- package/src/locales.ts +461 -452
- package/src/shell-id.ts +11 -11
- package/src/shells.ts +279 -272
- package/src/terminal.ts +616 -612
- package/src/webterminals/host.ts +361 -361
- package/src/webterminals/mount.ts +237 -236
package/README.de.md
CHANGED
|
@@ -10,7 +10,7 @@ DSH-Plugin (DeepSeek Harness): ein `shell`-Werkzeug, das unter Windows die Befeh
|
|
|
10
10
|
>
|
|
11
11
|
> | DSH-Segment | Branch | Plugin-Version | npm-dist-tag |
|
|
12
12
|
> |--------|------|----------|--------------|
|
|
13
|
-
> |
|
|
13
|
+
> | `>=0.1.0-rc.2 <0.3.0-0` (begrenzte Spanne) | `main` (dieser Branch, versionsübergreifender Hauptzweig) | 0.8.x | `latest` |
|
|
14
14
|
> | `>=0.2.0-rc.1 <0.2.1-0` | `compat/0.2.0` (historisch, eingefroren) | 0.7.x | `dsh-0.2.0` |
|
|
15
15
|
> | 0.1.7-rc.1 – 0.1.7.x | `compat/0.1.7` | 0.6.x | `dsh-0.1.7` |
|
|
16
16
|
> | 0.1.5-alpha.1 – 0.1.5-rc.x | `ts/0.1.5` (historisch, eingefroren) | ≤ 0.5.2 | `dsh-0.1.5` |
|
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 🌐 [简体中文](README.md) | [English](README.en.md) | [Français](README.fr.md) | [Deutsch](README.de.md) | [Italiano](README.it.md) | [Русский](README.ru.md) | [Español](README.es.md) · Community: [LINUX DO](https://linux.do) · [GitHub](https://github.com/drscrewdriver/dsh-bash-terminal-ts)
|
|
4
4
|
|
|
5
|
-
A DeepSeek Harness (DSH) plugin: one `shell` tool that runs commands through **PowerShell / Git Bash / MSYS2 / WSL** on Windows, plus an **interactive terminal** tool — all following the terminal **you** choose in the Web UI settings.
|
|
5
|
+
A DeepSeek Harness (DSH) plugin: one `shell` tool that runs commands through **PowerShell / Git Bash / MSYS2 / WSL / Niubash** on Windows, plus an **interactive terminal** tool — all following the terminal **you** choose in the Web UI settings.
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ A DeepSeek Harness (DSH) plugin: one `shell` tool that runs commands through **P
|
|
|
10
10
|
>
|
|
11
11
|
> | DSH segment | Branch | Plugin series | npm dist-tag |
|
|
12
12
|
> |-------------|--------|---------------|--------------|
|
|
13
|
-
> |
|
|
13
|
+
> | `>=0.1.0-rc.2 <0.3.0-0` (bounded range) | `main` (this branch, cross-version trunk) | 0.8.x | `latest` |
|
|
14
14
|
> | `>=0.2.0-rc.1 <0.2.1-0` | `compat/0.2.0` (historical, frozen) | 0.7.x | `dsh-0.2.0` |
|
|
15
15
|
> | 0.1.7-rc.1 – 0.1.7.x | `compat/0.1.7` | 0.6.x | `dsh-0.1.7` |
|
|
16
16
|
> | 0.1.5-alpha.1 – 0.1.5-rc.x | `ts/0.1.5` (historical, frozen) | ≤ 0.5.2 | `dsh-0.1.5` |
|
|
@@ -26,6 +26,7 @@ A DeepSeek Harness (DSH) plugin: one `shell` tool that runs commands through **P
|
|
|
26
26
|
| `gitbash` | Git for Windows `bash -lc <cmd>` | POSIX; `/d/workspace`; PATH includes `/usr/bin` and `/mingw64/bin` | `$NAME` |
|
|
27
27
|
| `msys2` | MSYS2 `bash -lc <cmd>` (`C:\msys64\usr\bin\bash.exe`) | POSIX; `/c/...`; PATH includes `/usr/bin` and `/mingw64/bin` (gcc / make) | `$NAME` (MSYSTEM=MINGW64 injected) |
|
|
28
28
|
| `wsl` | `wsl [-d <distro>] -e bash -lc <cmd>` | Linux; `/mnt/d/...` | `$NAME` (via WSLENV) |
|
|
29
|
+
| `niu` | [Niubash](https://github.com/unixwin/niubash) `niu -lc <cmd>` (Rust-native bash 5.3 semantics, no MSYS emulation layer) | POSIX; deterministic path translation for both `C:\...` and `/c/...`; command layer is WinuxCmd (178 applets) | `$NAME` |
|
|
29
30
|
|
|
30
31
|
- **User decides, the AI cannot override**: pick the default terminal in Settings -> General -> Default terminal (PowerShell / Git Bash / MSYS2 / WSL). The setting persists through the DSH settings system; the `shell` tool always obeys it.
|
|
31
32
|
- **Official sandbox seam**: the `shell` tool resolves the DSH sandbox policy per call and confines PowerShell argv through `ctx.sandbox` — same fail-closed `SandboxUnavailableError` semantics as the shipped executors. Git Bash, MSYS2 and WSL run unconfined: WSL is its own Linux VM, while Git Bash and MSYS2 cannot run under the DSH Windows ACL restricted-token runner (Cygwin/MSYS2 aborts with `CreateFileMapping` Win32 error 5). Official `sandbox_permissions` / `justification` escalation and denial markers included.
|
package/README.es.md
CHANGED
|
@@ -10,7 +10,7 @@ Plugin de DSH (DeepSeek Harness): una herramienta `shell` que ejecuta de forma u
|
|
|
10
10
|
>
|
|
11
11
|
> | Segmento DSH | Rama | Versión del plugin | dist-tag npm |
|
|
12
12
|
> |--------|------|----------|--------------|
|
|
13
|
-
> |
|
|
13
|
+
> | `>=0.1.0-rc.2 <0.3.0-0` (rango acotado) | `main` (esta rama, troncal entre versiones) | 0.8.x | `latest` |
|
|
14
14
|
> | `>=0.2.0-rc.1 <0.2.1-0` | `compat/0.2.0` (histórica, congelada) | 0.7.x | `dsh-0.2.0` |
|
|
15
15
|
> | 0.1.7-rc.1 – 0.1.7.x | `compat/0.1.7` | 0.6.x | `dsh-0.1.7` |
|
|
16
16
|
> | 0.1.5-alpha.1 – 0.1.5-rc.x | `ts/0.1.5` (histórica, congelada) | ≤ 0.5.2 | `dsh-0.1.5` |
|
package/README.it.md
CHANGED
|
@@ -10,7 +10,7 @@ Plugin DSH (DeepSeek Harness): uno strumento `shell` che esegue in modo unificat
|
|
|
10
10
|
>
|
|
11
11
|
> | Segmento DSH | Branch | Versione plugin | dist-tag npm |
|
|
12
12
|
> |--------|------|----------|--------------|
|
|
13
|
-
> |
|
|
13
|
+
> | `>=0.1.0-rc.2 <0.3.0-0` (intervallo delimitato) | `main` (questo branch, trunk cross-versione) | 0.8.x | `latest` |
|
|
14
14
|
> | `>=0.2.0-rc.1 <0.2.1-0` | `compat/0.2.0` (storico, congelato) | 0.7.x | `dsh-0.2.0` |
|
|
15
15
|
> | 0.1.7-rc.1 – 0.1.7.x | `compat/0.1.7` | 0.6.x | `dsh-0.1.7` |
|
|
16
16
|
> | 0.1.5-alpha.1 – 0.1.5-rc.x | `ts/0.1.5` (storico, congelata) | ≤ 0.5.2 | `dsh-0.1.5` |
|
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
DSH(DeepSeek Harness)插件:一个 `shell` 工具,在 Windows 上统一执行 **PowerShell / Git Bash / MSYS2 / WSL**
|
|
7
|
+
DSH(DeepSeek Harness)插件:一个 `shell` 工具,在 Windows 上统一执行 **PowerShell / Git Bash / MSYS2 / WSL / Niubash** 五种终端命令。
|
|
8
8
|
|
|
9
9
|
> **本仓库是 `MAXeaglet/dsh-bash-terminal` 的 TypeScript 重写**,带可用的 MSYS2/MINGW64 支持。兼容线按 DSH 宿主段划分,各线共用包名 `dsh-bash-terminal-ts`,以 npm dist-tag 区分:
|
|
10
10
|
>
|
|
11
11
|
> | DSH 段 | 分支 | 插件版本 | npm dist-tag |
|
|
12
12
|
> |--------|------|----------|--------------|
|
|
13
|
-
> |
|
|
13
|
+
> | `>=0.1.0-rc.2 <0.3.0-0`(有界区间,非枚举) | `main`(本分支,跨版本主干) | 0.8.x | `latest` |
|
|
14
14
|
> | `>=0.2.0-rc.1 <0.2.1-0` | `compat/0.2.0`(历史,冻结) | 0.7.x | `dsh-0.2.0` |
|
|
15
15
|
> | 0.1.7-rc.1 – 0.1.7.x | `compat/0.1.7` | 0.6.x | `dsh-0.1.7` |
|
|
16
16
|
> | 0.1.5-alpha.1 – 0.1.5-rc.x | `ts/0.1.5`(历史,冻结) | ≤ 0.5.2 | `dsh-0.1.5` |
|
|
@@ -24,6 +24,7 @@ DSH(DeepSeek Harness)插件:一个 `shell` 工具,在 Windows 上统一
|
|
|
24
24
|
| `gitbash` | Git for Windows `bash -lc <cmd>` | POSIX;`/d/workspace`;PATH 含 `/usr/bin`、`/mingw64/bin` | `$NAME` |
|
|
25
25
|
| `msys2` | MSYS2 `bash -lc <cmd>`(`C:\msys64\usr\bin\bash.exe`) | POSIX;`/c/...`;PATH 含 `/usr/bin`、`/mingw64/bin`(gcc / make) | `$NAME`(自动注入 `MSYSTEM=MINGW64`) |
|
|
26
26
|
| `wsl` | `wsl [-d <distro>] -e bash -lc <cmd>` | Linux;`/mnt/d/...` | `$NAME`(经 WSLENV) |
|
|
27
|
+
| `niu` | [Niubash](https://github.com/unixwin/niubash) `niu -lc <cmd>`(Rust 原生 bash 5.3 语义,无 MSYS 模拟层) | POSIX;`C:\...` 与 `/c/...` 均按确定性规则转换;命令层为 WinuxCmd(178 applets) | `$NAME` |
|
|
27
28
|
|
|
28
29
|
每次调用都启动全新 shell:**不保留状态**(cwd / 变量 / 别名)——请传 `workdir` 而不是用 `cd`。
|
|
29
30
|
|
|
@@ -41,7 +42,7 @@ DSH(DeepSeek Harness)插件:一个 `shell` 工具,在 Windows 上统一
|
|
|
41
42
|
- 后台任务注册进通用 `jobs` registry,支持 `run_in_background` / `job_output` / `job_kill`。
|
|
42
43
|
- 前端设置页的「默认终端」是枚举(UI 自动渲染为下拉),模型每次调用都只按该设置执行,无法自行切换终端。
|
|
43
44
|
- **钉版 POSIX 运行时载荷(第五个一等终端后端,默认关)**:载荷包 `@drscrewdriver/posix-runtime-win32-x64`(命名政策:我们的制品不带 bash/gitbash/msys token;里面是 Git-for-Windows 运行时树)。两层开关:`enablePosixPayload: true`(操作者门,启动时跑摘要校验)+ 设置页里的「POSIX payload」行开关 `shellPayload`(默认关,决定已装载载荷能否进选择器/被选为默认终端);它有自己的目录行、专属工具描述(bash -lc)、交互终端与 `payload-unconfined` 执法面,**不顶替 Git Bash 槽位**。载荷不随包下载,用 `node scripts/provision-payload.mjs --from <本地 PortableGit SFX>` 自备(反解包 + SHA-256 钉版,自管不取用任何第三方载荷包);**检测到已装 WSL 发行版时只记一条建议日志**(WSL 里的 bash 通常更好用,拿不准选 `wsl`),不屏蔽载荷行——硬门只有摘要校验一条;校验不过即 fail-closed,绝不裸跑、绝不静默换执行器。详见 `src/payload.ts` 头注释。
|
|
44
|
-
- **终端语义预设模板(`agent-presets/`)**:把「默认终端 + 命令语法 + 终端归属权」显式声明在 Agent Preset 层的可分发模板(PowerShell / Git Bash / MSYS2 / WSL2 / 钉版 POSIX
|
|
45
|
+
- **终端语义预设模板(`agent-presets/`)**:把「默认终端 + 命令语法 + 终端归属权」显式声明在 Agent Preset 层的可分发模板(PowerShell / Git Bash / MSYS2 / WSL2 / 钉版 POSIX 载荷 / Niubash 六变体,含 Terminal authority 锚),用 `npm run presets:install` 装机——对标那些「安装即改写默认终端语义」的插件:同一份 bash-first 体验,由你在预设层自己选,可审计、可复现。
|
|
45
46
|
|
|
46
47
|
## 安装(web profile)
|
|
47
48
|
|
package/agent-presets/README.md
CHANGED
|
@@ -1,170 +1,171 @@
|
|
|
1
|
-
# agent-presets — 终端语义预设模板(对标型对冲包)
|
|
2
|
-
|
|
3
|
-
> 中文 | [English below](#english)
|
|
4
|
-
|
|
5
|
-
## 这是什么
|
|
6
|
-
|
|
7
|
-
这组模板把「默认终端是什么、用什么语法写命令、谁有权改终端」这些语义**显式声明在
|
|
8
|
-
Agent Preset 层**,作为对 `dsh-ops` 一类「安装即改写默认终端语义(提示词优先其自带
|
|
9
|
-
bash)」插件的**对标型对冲**:同一份体验(bash-first、报错循环少),但你是在预设层
|
|
10
|
-
自己选的、可审计的、可复现的,而不是被某个插件在提示词层默默改掉的。
|
|
11
|
-
|
|
12
|
-
DSH 0.2.1-alpha.3 起子代理能力面强制走预设(`agentPreset`,toolFilter 已移除),
|
|
13
|
-
预设层是官方承认的「能力组合声明位」——把终端语义锚在这里,正是它该待的位置。
|
|
14
|
-
|
|
15
|
-
## 模板清单
|
|
16
|
-
|
|
17
|
-
| 模板 | 默认终端 | persona 语法锚 | 官方 shell 工具挂载 |
|
|
18
|
-
|------|----------|----------------|---------------------|
|
|
19
|
-
| `standard-win` | PowerShell (pwsh) | PowerShell 语法、`\` 路径、引号/编码/管道陷阱清单 | **tool-pwsh 保留**(win32 启用,沙箱化 PowerShell 面属 Windows 默认体验);tool-bash 禁用 |
|
|
20
|
-
| `standard-win-gitbash` | Git Bash | POSIX bash、`/c/...`、bash 错误纪律/MSYS 路径转换/CRLF-编码段 | tool-bash、tool-pwsh 均禁用 |
|
|
21
|
-
| `standard-win-msys2` | MSYS2 bash | POSIX bash、`/c/...`、错误纪律/路径转换/双运行时(msys vs mingw64)/CRLF-编码段 | 同上 |
|
|
22
|
-
| `standard-win-wsl2` | WSL2 bash | Linux bash、`/mnt/c/...`、错误纪律/真 Linux 无 MSYS 层/跨边界陷阱(CRLF、大小写、wslpath、python3)段 | 同上 |
|
|
23
|
-
| `standard-win-payload` | 插件自备的钉版 POSIX 运行时载荷 | POSIX bash、`/c/...`、错误纪律/MSYS 路径转换(含「缺工具是载荷树缺口,勿现场装系统版」)/CRLF-编码段 | 同上 |
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| `%%
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
#
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
#
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
payload
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
1
|
+
# agent-presets — 终端语义预设模板(对标型对冲包)
|
|
2
|
+
|
|
3
|
+
> 中文 | [English below](#english)
|
|
4
|
+
|
|
5
|
+
## 这是什么
|
|
6
|
+
|
|
7
|
+
这组模板把「默认终端是什么、用什么语法写命令、谁有权改终端」这些语义**显式声明在
|
|
8
|
+
Agent Preset 层**,作为对 `dsh-ops` 一类「安装即改写默认终端语义(提示词优先其自带
|
|
9
|
+
bash)」插件的**对标型对冲**:同一份体验(bash-first、报错循环少),但你是在预设层
|
|
10
|
+
自己选的、可审计的、可复现的,而不是被某个插件在提示词层默默改掉的。
|
|
11
|
+
|
|
12
|
+
DSH 0.2.1-alpha.3 起子代理能力面强制走预设(`agentPreset`,toolFilter 已移除),
|
|
13
|
+
预设层是官方承认的「能力组合声明位」——把终端语义锚在这里,正是它该待的位置。
|
|
14
|
+
|
|
15
|
+
## 模板清单
|
|
16
|
+
|
|
17
|
+
| 模板 | 默认终端 | persona 语法锚 | 官方 shell 工具挂载 |
|
|
18
|
+
|------|----------|----------------|---------------------|
|
|
19
|
+
| `standard-win` | PowerShell (pwsh) | PowerShell 语法、`\` 路径、引号/编码/管道陷阱清单 | **tool-pwsh 保留**(win32 启用,沙箱化 PowerShell 面属 Windows 默认体验);tool-bash 禁用 |
|
|
20
|
+
| `standard-win-gitbash` | Git Bash | POSIX bash、`/c/...`、bash 错误纪律/MSYS 路径转换/CRLF-编码段 | tool-bash、tool-pwsh 均禁用 |
|
|
21
|
+
| `standard-win-msys2` | MSYS2 bash | POSIX bash、`/c/...`、错误纪律/路径转换/双运行时(msys vs mingw64)/CRLF-编码段 | 同上 |
|
|
22
|
+
| `standard-win-wsl2` | WSL2 bash | Linux bash、`/mnt/c/...`、错误纪律/真 Linux 无 MSYS 层/跨边界陷阱(CRLF、大小写、wslpath、python3)段 | 同上 |
|
|
23
|
+
| `standard-win-payload` | 插件自备的钉版 POSIX 运行时载荷 | POSIX bash、`/c/...`、错误纪律/MSYS 路径转换(含「缺工具是载荷树缺口,勿现场装系统版」)/CRLF-编码段 | 同上 |
|
|
24
|
+
| `standard-win-niu` | Niubash (niu) | bash 5.3 语法、Windows 原生路径、错误纪律/无 MSYS 层(确定性路径翻译、niu-git、`/dev/null`→`nul`、`~/.niubashrc`)/CRLF-编码段 | 同上 |
|
|
25
|
+
|
|
26
|
+
官方 `tool-bash`(沙箱化同名 bash 工具)在**全部六份模板里无条件 disabled**:目录里
|
|
27
|
+
出现同名 `bash` 正是这组预设要对冲的带内干扰源。pwsh 工具则只在 bash 族四份里禁用
|
|
28
|
+
(那里 `shell` 已接 bash 后端);`standard-win` **保留官方 pwsh 工具**——win 默认体验
|
|
29
|
+
就该带沙箱化 PowerShell 面,主入口仍是本插件的 `shell` 工具(后端由用户在设置里选定)。
|
|
30
|
+
persona 的 Shell tool routing 行按各自策略声明;需要调整时改对应行即可。
|
|
31
|
+
|
|
32
|
+
bash 族四份预设的错误处理段与 `standard-win` 的 pwsh 六条陷阱清单对位:每个终端
|
|
33
|
+
的失败形态不一样(MSYS 静默改写参数 / WSL 大小写分裂 / pwsh null 管道),锚在
|
|
34
|
+
persona 层各自说清。
|
|
35
|
+
|
|
36
|
+
每个模板都含一行 **Terminal authority** 锚:终端由用户在
|
|
37
|
+
Settings → General → Default terminal 决定,模型不得因任何带内提示(包括其它插件的
|
|
38
|
+
工具广告)自行换终端——`wsl2` 版还额外写明「随包 MSYS 载荷不构成离开 WSL 的理由,
|
|
39
|
+
真 Linux bash 优先级更高」。这与本插件的机制锚(工具永远服从用户设置、模型无参数可
|
|
40
|
+
覆盖)双保险。
|
|
41
|
+
|
|
42
|
+
## 占位符(%%token%%)
|
|
43
|
+
|
|
44
|
+
| token | 含义 | 未提供时 |
|
|
45
|
+
|-------|------|----------|
|
|
46
|
+
| `%%pythonPath%%` | Windows Python 解释器路径(bash 版模板用 `/c/...` 形态) | 该行整行删除 |
|
|
47
|
+
| `%%winPythonWslPath%%` | Windows Python 在 WSL 内的挂载路径 | 该行整行删除 |
|
|
48
|
+
|
|
49
|
+
(`{{model}}` / `{{cwd}}` 是 DSH 宿主的原生模板变量,不归安装脚本管。)
|
|
50
|
+
|
|
51
|
+
## 安装
|
|
52
|
+
|
|
53
|
+
脚本随插件分发。两种拿到它的方式:
|
|
54
|
+
|
|
55
|
+
```powershell
|
|
56
|
+
# A) 从已装插件(在本机任意目录,cd 到 profile 目录后):
|
|
57
|
+
# 插件装在 npm/tgz 后,脚本位于:
|
|
58
|
+
# %USERPROFILE%\.dsh\profiles\<profile>\node_modules\dsh-bash-terminal-ts\agent-presets\install-presets.mjs
|
|
59
|
+
cd $env:USERPROFILE\.dsh\profiles\desktop
|
|
60
|
+
node .\node_modules\dsh-bash-terminal-ts\agent-presets\install-presets.mjs --name standard-win-gitbash
|
|
61
|
+
|
|
62
|
+
# B) 在源码仓里:
|
|
63
|
+
npm run presets:install -- --name standard-win-gitbash
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
常用参数(完整说明见 `--help`,里面有五种模板的语义对照与安装后三步):
|
|
67
|
+
|
|
68
|
+
```powershell
|
|
69
|
+
# 看有什么模板
|
|
70
|
+
node agent-presets/install-presets.mjs --list
|
|
71
|
+
|
|
72
|
+
# 干跑预览(不落盘)
|
|
73
|
+
node agent-presets/install-presets.mjs --name standard-win-gitbash --dry-run
|
|
74
|
+
|
|
75
|
+
# 正式安装:填充 python 路径;不填充则相关行自动删除
|
|
76
|
+
node agent-presets/install-presets.mjs --name standard-win-gitbash --name standard-win-wsl2 `
|
|
77
|
+
--set pythonPath=/c/Users/you/AppData/Local/Programs/Python/Python313/python.exe
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**机器中立保证**:模板不含任何本机事实(真实路径一律是 `%%token%%` 或 `<you>` 示例形);
|
|
81
|
+
不传 `--set` 安装永远是安全的——含未填 token 的行整行删除,不会把 `%%` 碎片写进提示词。
|
|
82
|
+
脚本只写预设文件:不联网、不改 PATH、不碰 profile 以外的配置。
|
|
83
|
+
|
|
84
|
+
目标目录默认 `%USERPROFILE%\.dsh\.agent-presets`(可用 `--dest` 改)。已有同名预设
|
|
85
|
+
会**先整目录备份到 `.agent-presets` 之外**(`%USERPROFILE%\.dsh\_agent-presets-backup\<时间戳>\`)
|
|
86
|
+
再覆盖——备份绝不留在挂载根里面,否则会被宿主当成一个预设挂载。
|
|
87
|
+
|
|
88
|
+
安装后三层对齐(`--help` 与安装完成提示都会把这三步说清):
|
|
89
|
+
|
|
90
|
+
1. 重启/热加载 DSH(宿主开机才挂载 `.agent-presets`);
|
|
91
|
+
2. 会话选用该预设(子代理经 `agentPreset` 继承);
|
|
92
|
+
3. 把本插件的 `defaultShell` 设成同一终端(Settings → General 或 `cordis.patch.yml`)。
|
|
93
|
+
选 `standard-win-payload` 还要两步都开:`enablePosixPayload: true`(操作者门,重启生效)
|
|
94
|
+
+ 设置页「POSIX payload」行开关 `shellPayload`(默认关)——载荷是双层 opt-in。
|
|
95
|
+
|
|
96
|
+
## 配套推荐:dsh-preset-doctor(DSH 预设医生)
|
|
97
|
+
|
|
98
|
+
装了这组模板后,推荐同时安装 **dsh-preset-doctor**(npm 直接可装)——它是预设层
|
|
99
|
+
的配套治理工具,与本模板包正好互补:
|
|
100
|
+
|
|
101
|
+
- **跨版本失效自动修**:DSH 把预设机制从「`.agent-presets/` 目录扫描」换到
|
|
102
|
+
「`cordis.patch.yml` 声明式」时,旧模板会静默失效(UI 只显示加载失败,没有
|
|
103
|
+
行号没有原因)。预设医生自动扫描、机械可修的**对齐到当前宿主版本语法**
|
|
104
|
+
(写前 `.bak`、原子写、幂等、零 LLM),不可机械修的逐条报告文件:行号+原因+建议。
|
|
105
|
+
- **行级开关与对齐**:每张预设卡内嵌 composition 行清单,可直接禁用/启用预设里的
|
|
106
|
+
某一工具行(比如把 bash 系模板的 `tool-pwsh` 再关掉一档)、漂移行一键「对齐」——
|
|
107
|
+
本模板包的人格/工具挂载声明从此不用手改 YAML。
|
|
108
|
+
- **代际显示**:告诉你每个预设「写于哪个版本时代、需要跨越哪些节点」,多主线
|
|
109
|
+
(0.1.1+ 五条线)运行时自选适配分支。
|
|
110
|
+
|
|
111
|
+
一句话分工:**本包把终端语义写进预设,预设医生让预设在各代宿主下持续可挂载、可治理。**
|
|
112
|
+
|
|
113
|
+
配套使用三步:
|
|
114
|
+
|
|
115
|
+
1. 在与本插件同一 profile 里 npm 安装 `dsh-preset-doctor`,重启;
|
|
116
|
+
2. 打开预设医生面板:刚装的这组模板会被扫成预设卡,每张卡显示它「写于哪个版本
|
|
117
|
+
时代、需跨越哪些节点」;宿主升过版的,卡上会出现漂移行与「对齐」按钮;
|
|
118
|
+
3. 机械可修的点「对齐」一次到位(自动 `.bak`+原子写);想微调模板里某一行的挂载
|
|
119
|
+
(比如把 bash 系模板的 `tool-pwsh` 行再禁用掉),用卡内行开关——不要手改 YAML。
|
|
120
|
+
|
|
121
|
+
## 与钉版 POSIX 载荷(增强 1)的衔接
|
|
122
|
+
|
|
123
|
+
`standard-win-payload` 假设你启用了本插件的备用载荷(命名政策:我们自己的制品不带 bash/gitbash/msys token,载荷包叫 `@drscrewdriver/posix-runtime-win32-x64`,里面是 Git-for-Windows 运行时树):
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
# profile 的 cordis.patch.yml(本插件条目 config 下)
|
|
127
|
+
enablePosixPayload: true # 操作者门:启动时跑摘要校验
|
|
128
|
+
# 可选:显式载荷根或其 bin/bash.exe;留空走自动发现
|
|
129
|
+
payloadPosixPath: ""
|
|
130
|
+
# 载荷解析成功后,还需在设置页打开「POSIX payload」行开关(shellPayload,默认关)
|
|
131
|
+
# 它才能进底部终端选择器/被选为默认终端(两层 opt-in)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
载荷用 `node scripts/provision-payload.mjs --from <本地 PortableGit SFX>` 自备
|
|
135
|
+
(反解包 + SHA-256 钉版,见脚本头注释)。**优先级规则**:检测到 WSL 已装发行版时
|
|
136
|
+
载荷不启用(WSL bash 更好用),系统装有 Git Bash / MSYS2 时也用不到载荷——载荷
|
|
137
|
+
只是最后一级备用执行器,且摘要校验不过就绝不运行(fail-closed)。
|
|
138
|
+
|
|
139
|
+
## English
|
|
140
|
+
|
|
141
|
+
These templates declare terminal semantics (default shell, command syntax, who may
|
|
142
|
+
change the terminal) **in the Agent Preset layer**, as a benchmark-style hedge
|
|
143
|
+
against harness plugins that silently rewrite default-terminal semantics at install
|
|
144
|
+
time. Same bash-first outcome, chosen by you, auditable, reproducible — and every
|
|
145
|
+
template carries a "Terminal authority" line telling the model not to switch
|
|
146
|
+
terminals because of in-band tool advertising. Install with
|
|
147
|
+
`node agent-presets/install-presets.mjs --name <preset> [--set key=value]` (run
|
|
148
|
+
`--help` for the full walkthrough: template semantics table, placeholder rules,
|
|
149
|
+
the three post-install alignment steps). From an installed plugin the script sits
|
|
150
|
+
at `node_modules/dsh-bash-terminal-ts/agent-presets/install-presets.mjs` inside
|
|
151
|
+
your profile dir. Machine-neutral by construction: templates carry no local
|
|
152
|
+
facts, and a line whose `%%token%%` was not filled via `--set` is dropped whole
|
|
153
|
+
— installing with zero `--set` flags is always safe. Existing presets are backed
|
|
154
|
+
up OUTSIDE the mount root before overwriting.
|
|
155
|
+
`standard-win-payload` pairs with this plugin's opt-in pinned POSIX runtime
|
|
156
|
+
payload (`enablePosixPayload`, package `@drscrewdriver/posix-runtime-win32-x64` —
|
|
157
|
+
our artifact names never carry bash/gitbash/msys tokens, though the tree inside is
|
|
158
|
+
Git-for-Windows; see `scripts/provision-payload.mjs`); a detected WSL
|
|
159
|
+
distro outranks the payload, and an unverifiable payload never runs.
|
|
160
|
+
|
|
161
|
+
Companion recommendation: install **dsh-preset-doctor** (on npm). It scans mounted
|
|
162
|
+
agent presets across host-version migrations, mechanically realigns what it can
|
|
163
|
+
(atomic, `.bak`-first, zero-LLM) and reports the rest with file:line and a
|
|
164
|
+
suggestion — including per-row switches inside each preset card, so the tool
|
|
165
|
+
rows these templates declare stay governable without hand-editing YAML. Using it
|
|
166
|
+
with these templates: install it in the same profile, restart, open its panel —
|
|
167
|
+
the presets you just installed appear as cards showing the era they were written
|
|
168
|
+
for; hit "对齐/align" on drifted ones and use the in-card row switches to tune
|
|
169
|
+
individual tool rows instead of editing YAML by hand. This package writes
|
|
170
|
+
terminal semantics into presets; preset-doctor keeps those presets mountable and
|
|
171
|
+
manageable across generations.
|