dsh-gitbash-shell 0.38.5 → 0.39.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.md +51 -0
- package/README.md +47 -33
- package/README_EN.md +44 -27
- package/cordis.patch.yml +23 -30
- package/dsh.plugin.json +2 -2
- package/package.json +10 -2
- package/src/bash-path.js +7 -4
- package/src/bash-render.js +239 -0
- package/src/bash-tool.js +589 -0
- package/src/client.js +48 -45
- package/src/compositions.js +3 -3
- package/src/index.js +28 -35
- package/src/inline-tools.js +164 -393
- package/src/shell.js +12 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,57 @@
|
|
|
3
3
|
> 倒序排列,新版本条目在最上面。条目格式:`## vX.Y.Z — YYYY-MM-DD` + 类型(feat / fix / docs / chore)+ 要点 + 相关链接。
|
|
4
4
|
> 纪律见 AGENTS.md「变更记录纪律」:发版前先更新本文件并随版本提交;事故复盘、复现与真机验证记录也记在这里。
|
|
5
5
|
|
|
6
|
+
## v0.39.0 — 2026-10-13
|
|
7
|
+
|
|
8
|
+
**类型**:feat(架构转向:route B——插件自带 bash 工具,不再替换宿主执行器;DSH STORE 收录合规)。
|
|
9
|
+
|
|
10
|
+
- **背景**:AI-Scarlett/DSH-Store(第三方插件市场)的固定 Commit 检查对 v0.38.5 给出确定性拒绝
|
|
11
|
+
`SUBMISSION_PATCH_PROTECTED: Bundle Patch appears to disable an official component`
|
|
12
|
+
([DSH-Store#1396](https://github.com/AI-Scarlett/DSH-Store/issues/1396))——扫描器
|
|
13
|
+
(`check-plugin-submission.mjs:173-175`)对 patch 文本做双正则 AND 判定
|
|
14
|
+
(`出现 @deepseek-ai/ 字样` ∧ `出现字面 disabled: true`),而本插件的 patch 恰好双中:
|
|
15
|
+
禁用官方 `pwsh-sandbox` 执行器行正是「替换 shell 底座」架构的落点。市场契约
|
|
16
|
+
(「不禁用、替换官方组件」)与旧架构**本质冲突**,用户裁决走 route B:为收录改造架构,
|
|
17
|
+
而不是钻扫描器字面的空子。
|
|
18
|
+
- **新架构(route B)**:宿主 PowerShell 执行器(`pwsh-sandbox`)**原样保留**,patch 变为
|
|
19
|
+
**纯新增**(只 insert `gitbash-shell` 插件行 + better-sidebar 终端 shell 探测式 edit)。
|
|
20
|
+
bash 能力改为**插件自有工具**:
|
|
21
|
+
- `src/bash-tool.js`:自有 `bash` 工具,对官方 `@deepseek-ai/dsh-tool-bash`
|
|
22
|
+
**调用级镜像**(schema/输出三态 union/后台 jobs/超时晋升/沙箱升级/渲染/prompt 节),
|
|
23
|
+
唯一替换点 = `ctx.shell.resolve/execute` → **私有执行器实例**
|
|
24
|
+
(构造于私有 cordis scope 的 `GitBashSandboxExecutor`,`static inject` 全链生效,
|
|
25
|
+
永不注册为 `ctx.shell` 服务——官方 PowerShell 执行器的工作不受任何影响);
|
|
26
|
+
- `src/bash-render.js`:官方 render.ts/background.ts 的逐调用镜像
|
|
27
|
+
(exit 标记契约、`[stderr]` 段、denial/escalation 标记、ring 读、晋升文本),
|
|
28
|
+
沙箱 marker 内联为官方原文;
|
|
29
|
+
- 宿主依赖(`dsh-tools` 的 defineTool、`dsh-sandbox` 的升级助手)经宿主 loader 通道解析,
|
|
30
|
+
缺席时定义退化为 plain JSON schema、升级面整体不广告——**严格变窄,不变宽**。
|
|
31
|
+
- **pwsh 语义反转**:官方 `pwsh` 工具重新成为**真 PowerShell**(官方解析器自动优先
|
|
32
|
+
PowerShell 7)——假工具恒灭逻辑随执行器替换一起退役。`pwshTool` 开关(字段名不变,
|
|
33
|
+
默认关)语义变为「**显示 pwsh 工具**」:关 = 每 agent `tools.restrict` 隐藏 + pre-execute
|
|
34
|
+
兜底拒(理由句指路设置卡);开 = 真工具直接可见。**`pwsh7` 旁路工具整体退役**
|
|
35
|
+
(与官方 pwsh 跑同一二进制,纯冗余);`resolveHostPwsh7`/`pwshArgv`/`validatePwshArgs`
|
|
36
|
+
及其 21 门语言词条随之删除,设置卡词条改写为 pwsh 显示开关。
|
|
37
|
+
- **patch 收紧**:`pwsh-sandbox` 禁用行与 `gitbash-executor` 行删除;`executorConfiguredBashPath`
|
|
38
|
+
的二段式读取保留作老 profile 兼容层(读不到即回退 `gitbash-shell` 行值);better-sidebar
|
|
39
|
+
edit 的硬编码 `C:/Program Files/Git/bin/bash.exe` 改为 boot 期 `!!js` 探测
|
|
40
|
+
(默认安装位置 → LOCALAPPDATA,两处皆缺返回 '' 交还官方行为,issue #13 教训)。
|
|
41
|
+
**冒烟新增「市场门禁自检」断言**:patch 永远不得同时携带 `@deepseek-ai/` 字样与字面
|
|
42
|
+
`disabled: true`——把上架契约锁进测试,防未来回归。
|
|
43
|
+
- **行为变化**:①官方 `pwsh` 不再被无条件拒绝(开关开后是真 PowerShell);②bashPath 显式
|
|
44
|
+
配置只认 `gitbash-shell` 行(executor 行随 patch 删除,该层配置本来就是空串默认);
|
|
45
|
+
③老 profile 里手写的 `gitbash-executor` 行会在启动日志出现「unknown row」级提示
|
|
46
|
+
(宿主行为),配置值请迁移到设置卡 bashPath。
|
|
47
|
+
- **冒烟**:122 项(121 绿 + 1 项历史实测跳过「path rescue measured」,与本版无关):inlineNeeds 新形状(hidePwsh 随开关)、
|
|
48
|
+
bash-tool 模块面(无 shell inject/双形态 schema/硬校验)、bash-render 标记契约、
|
|
49
|
+
后台适配、市场门禁自检、patch 形态锁(不再出现 pwsh-sandbox/gitbash-executor/字面禁用)。
|
|
50
|
+
- **真机验证(win32)**:待做——按 AGENTS §4l 纪律,真机通过前本版本不标「完成」:
|
|
51
|
+
①启动日志 `own bash tool ready (private Git Bash executor at ...)`;
|
|
52
|
+
②新会话 bash 工具出现,`command -v bash` 指向 Git 安装目录;官方 pwsh 不在工具面;
|
|
53
|
+
③设置卡开 pwsh 工具 → 新会话 pwsh 出现且 `Get-Process` 等 cmdlet 真实执行;
|
|
54
|
+
④后台任务:`sleep 30` + run_in_background → job_output/job_kill;
|
|
55
|
+
⑤PTY 终端「· Git Bash」不受影响;⑥dsh-ops 同装时让位不变。
|
|
56
|
+
|
|
6
57
|
## v0.38.5 — 2026-10-13
|
|
7
58
|
|
|
8
59
|
**类型**:fix(用户 27 工具全量冒烟报告的 FastCtx 两项;bash 工具真机验收通过)。
|
package/README.md
CHANGED
|
@@ -4,16 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
简体中文 | [English](README_EN.md)
|
|
6
6
|
|
|
7
|
-
> 让 DeepSeek Harness (dsh) 在 Windows
|
|
8
|
-
> ——
|
|
9
|
-
>
|
|
7
|
+
> 让 DeepSeek Harness (dsh) 在 Windows 上**默认用 Git Bash 跑命令**的官方风格插件
|
|
8
|
+
> —— 不替换宿主执行器(官方 PowerShell 执行器原样保留):新增自有 bash 工具
|
|
9
|
+
> (私有 Git Bash 执行器实例,不注册为服务),并为所有模式注册对应的 Git Bash 版
|
|
10
|
+
> agent preset。
|
|
10
11
|
|
|
11
12
|
## 它解决什么
|
|
12
13
|
|
|
13
14
|
官方 Windows 组合默认把 `dsh-pwsh-sandbox` 作为 `ctx.shell`(PowerShell 执行器),
|
|
14
15
|
且各 preset 的 `tool-bash` 行在 win32 上被禁用——因为在 Windows 上裸 `bash`
|
|
15
|
-
会解析到 `C:\Windows\System32\bash.exe`(WSL 占位)
|
|
16
|
-
`
|
|
16
|
+
会解析到 `C:\Windows\System32\bash.exe`(WSL 占位)。本插件**不替换这个执行器**:
|
|
17
|
+
它新增一个自有 `bash` 工具,执行在私有的 Git Bash 执行器实例上(继承官方
|
|
18
|
+
`@deepseek-ai/dsh-bash-sandbox`,`bashPath` 只认 Git for Windows)。沙箱语义在
|
|
19
|
+
POSIX 宿主上完整保留;
|
|
17
20
|
**Windows 宿主上受限模式有一处重要例外——见下方
|
|
18
21
|
[「安全语义:Windows 上的受限模式」](#安全语义windows-上的受限模式)**。
|
|
19
22
|
|
|
@@ -21,16 +24,18 @@
|
|
|
21
24
|
|
|
22
25
|
- **官方四个模式直接获得 Git Bash**——模式列表保持官方原样,不再新增变体:
|
|
23
26
|
每个会话创建时,本插件探测该模式的工具面,「有 pwsh 无 bash」(官方 Windows
|
|
24
|
-
组合的形态)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
组合的形态)即在该会话内注册**自有 bash 工具**(对官方 tool-bash 逐调用镜像:
|
|
28
|
+
后台任务、审批升级、渲染行为不变)。宿主官方 `pwsh` 工具是**真正的
|
|
29
|
+
PowerShell**(v0.39.0 起,本插件不再替换执行器),默认被隐藏、开关显示——见下一条。
|
|
27
30
|
- **bash 工具说明附带路由规则**:能用 Git Bash 就用 Git Bash;只有必须用到
|
|
28
31
|
Windows 原生能力(cmdlet/注册表/服务/WMI)时才用 PowerShell;bash 出错在
|
|
29
32
|
bash 里修,禁止在 bash 里嵌 `pwsh -Command`(变量展开与输出编码会在那里坏掉)。
|
|
30
|
-
- **`
|
|
31
|
-
|
|
32
|
-
`
|
|
33
|
-
|
|
33
|
+
- **`pwsh` 工具(官方 PowerShell,默认隐藏,开关显示)**:宿主官方的 `pwsh` 工具
|
|
34
|
+
就是真正的 PowerShell(官方解析器自动优先 PowerShell 7),可直接用于 Windows
|
|
35
|
+
原生操作(cmdlet/注册表/服务/WMI)。默认关闭(`pwshTool` 开关):该工具对本插件
|
|
36
|
+
会话隐藏,主机保持 bash 优先;开启后它直接可见可用——无需安装任何额外组件。
|
|
37
|
+
旧 PowerShell 7 旁路工具(v0.37–v0.38.5 的独立工具)已随 v0.39.0 新架构退役;
|
|
38
|
+
命令仍然首选 bash 工具。
|
|
34
39
|
- **`gb_*` FastCtx 文件工具(默认开)**:`gb_inspect_local_file`/`gb_grep`/
|
|
35
40
|
`gb_glob`/`gb_replace`(Rust 实现:批量范围读取带 token 预算、grep 截断
|
|
36
41
|
标注、编码探测)。它们是官方 read/grep/glob/edit 的**补充**——官方工具接
|
|
@@ -80,26 +85,30 @@ dsh plugin --profile web add dsh-gitbash-shell
|
|
|
80
85
|
|
|
81
86
|
## 它做了什么
|
|
82
87
|
|
|
83
|
-
bundle patch(`cordis.patch.yml`)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
bundle patch(`cordis.patch.yml`)是**纯新增**(v0.39.0 起):只插入本插件行
|
|
89
|
+
`gitbash-shell`,不禁用、不替换任何官方行——宿主官方 PowerShell 执行器与全部
|
|
90
|
+
官方组件保持原位。旧版「替换执行器」的三步 patch 在 route B 下变成运行时工作:
|
|
91
|
+
|
|
92
|
+
1. **不再撤 `pwsh-sandbox`、不再插执行器行**:插件不再替换宿主执行器,官方
|
|
93
|
+
`pwsh` 工具重新是真正的 PowerShell;
|
|
94
|
+
2. **自有 bash 工具跑在私有执行器实例上**(`src/bash-tool.js` + `src/shell.js`):
|
|
95
|
+
`GitBashSandboxExecutor` 继承官方 `@deepseek-ai/dsh-bash-sandbox`,仅把内层
|
|
96
|
+
argv 换成 `<git-bash.exe> -c <command>`,在私有 cordis scope 中构造、**永不
|
|
97
|
+
注册为 `ctx.shell` 服务**。沙箱策略/拒绝分类/后台任务/超时/设置节沿用官方
|
|
98
|
+
实现;full-access 分支单独接 Git Bash(父类那里硬编码裸 `bash`);
|
|
90
99
|
**Windows 上受限分支有一处例外,见下一节**;
|
|
91
|
-
3.
|
|
100
|
+
3. **`gitbash-shell` 行**(`dsh-gitbash-shell`):**v0.35.0 起双形态**——
|
|
92
101
|
默认(`variantPresets: false`)不注册变体,由**行内工具补位**
|
|
93
|
-
(`src/inline-tools.js`)在 `agent/created`
|
|
94
|
-
|
|
95
|
-
(`src/fastctx-bridge.js`)
|
|
102
|
+
(`src/inline-tools.js`)在 `agent/created` 时按工具面注册自有 bash 工具;
|
|
103
|
+
官方 `pwsh`(真 PowerShell)默认隐藏(`pwshTool` 开关显示);`gb_*` 工具
|
|
104
|
+
(`src/fastctx-bridge.js`)随行发布。开关打开时按 v0.32.0 起的**声明式注册**
|
|
96
105
|
(`ctx.agentPresets.register`)提供上表 4 个 preset 变体——
|
|
97
106
|
行集是仓库里已提交、可 diff 的 JS 数据(`src/compositions.js`),**不再物化
|
|
98
107
|
任何目录**;旧版本遗留在磁盘上的物化树,启动时仅当 marker 判定为
|
|
99
108
|
「未被用户改过」才单向清理,用户改过的绝不碰(清理不受开关影响)。
|
|
100
109
|
|
|
101
110
|
**环境变量**:`bash.exe` 是 host 进程的直接子进程(不经 git-bash 登录壳),完整继承
|
|
102
|
-
系统环境变量与 `DSH_*`
|
|
111
|
+
系统环境变量与 `DSH_*` 快照。
|
|
103
112
|
|
|
104
113
|
## 安全语义:Windows 上的受限模式
|
|
105
114
|
|
|
@@ -127,7 +136,8 @@ bundle patch(`cordis.patch.yml`)应用三个改动:
|
|
|
127
136
|
(Low → Medium);`$env:TEMP` 不再被重定向到 per-session 隔离目录。
|
|
128
137
|
|
|
129
138
|
**如果你需要 shell 也被硬性拦住**(例如不希望模型经 shell 写工作区外的任何路径),
|
|
130
|
-
|
|
139
|
+
注意本插件的自有 bash 工具在 Windows 受限模式下同样 unconfined(见上)——不用
|
|
140
|
+
它、或卸载本插件让它消失即可;官方 PowerShell 执行器从未被本插件触碰。
|
|
131
141
|
`danger-full-access` 预设本来就不受限,装不装本插件行为一致。
|
|
132
142
|
|
|
133
143
|
> 这一取舍的完整分析(含 0.6.0~0.13.1 的故障史与社区两派对比)见 CHANGELOG
|
|
@@ -237,14 +247,16 @@ DSH 自己的「新建终端」**不经过**本插件的执行器:它由官方
|
|
|
237
247
|
请把 profile 的 patch 里 `terminal-controller` 行的 `shell` 字段**删掉**,再重启 DSH(终端随即回到原来的 shell);
|
|
238
248
|
只想让它别再自动改、但不介意保留现状的话,关开关即可。
|
|
239
249
|
|
|
240
|
-
## 配置(
|
|
250
|
+
## 配置(自有 bash 工具)
|
|
241
251
|
|
|
242
|
-
`gitbash-
|
|
252
|
+
`bashPath` 经设置卡「Git Bash 路径」(= `gitbash-shell` 行 config 的 `bashPath`
|
|
253
|
+
字段)配置;pre-v0.39 旧 profile 遗留的 `gitbash-executor` 行配置仍被读取
|
|
254
|
+
(兼容,优先级更高):
|
|
243
255
|
|
|
244
256
|
```yaml
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
257
|
+
- id: gitbash-shell
|
|
258
|
+
config:
|
|
259
|
+
bashPath: "D:/Tools/Git/bin/bash.exe" # 默认空 = 自动探测链
|
|
248
260
|
```
|
|
249
261
|
|
|
250
262
|
## 验证
|
|
@@ -254,7 +266,8 @@ npm test
|
|
|
254
266
|
```
|
|
255
267
|
|
|
256
268
|
重启 host 后新会话:
|
|
257
|
-
-
|
|
269
|
+
- 工具列表里出现自有 `bash` 工具(执行在 Git Bash 上);官方 `pwsh` 工具默认隐藏,
|
|
270
|
+
设置卡开启「pwsh 工具」开关后可见(真正的 PowerShell);
|
|
258
271
|
- `echo \$BASH_VERSION` 有输出、`command -v bash` 指向 Git 安装目录。
|
|
259
272
|
|
|
260
273
|
## 卸载
|
|
@@ -265,7 +278,8 @@ dsh plugin --profile web remove dsh-gitbash-shell
|
|
|
265
278
|
|
|
266
279
|
或删除 profile`package.json` 中依赖 + `dsh.profile.bundles` 中的条目后
|
|
267
280
|
`dsh plugin --profile web install`。卸载并重启后,未改过的 `* -gitbash`
|
|
268
|
-
preset
|
|
281
|
+
preset 会被插件自动清理;宿主官方 PowerShell 执行器原样保留(本插件从未替换它),
|
|
282
|
+
官方 `pwsh` 工具不再被隐藏。
|
|
269
283
|
|
|
270
284
|
## 与 dsh-ptc-cordis-preset 联动
|
|
271
285
|
|
|
@@ -344,7 +358,7 @@ Config 的布尔字段 `pythonRuntime`(默认 `false`),由它在 profile 组合
|
|
|
344
358
|
|
|
345
359
|
## POSIX 路径方言(v0.7.0 引入,受 `posixPaths` 开关门控)
|
|
346
360
|
|
|
347
|
-
Windows
|
|
361
|
+
Windows 上本插件让命令默认走自有 Git Bash 工具的同时,让**模型看到的路径**统一成 MSYS 盘根
|
|
348
362
|
POSIX 形式(`/c/Users/...`、`/c/Program Files/...`)。开关是 settings 命名空间
|
|
349
363
|
`gitbash-shell` 的布尔字段 `posixPaths`,**默认开启**(v0.10.0 起),可在 **设置 → 插件**
|
|
350
364
|
里本插件的「Git Bash 路径方言」卡片上随时切换;不修改任何 preset / 组合文件,标准/极简/
|
package/README_EN.md
CHANGED
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
[简体中文](README.md) | English
|
|
6
6
|
|
|
7
|
-
> Run **
|
|
8
|
-
> Harness (dsh) —
|
|
9
|
-
>
|
|
10
|
-
> a
|
|
7
|
+
> Run **agent commands on Git Bash by default** on Windows with DeepSeek
|
|
8
|
+
> Harness (dsh) — the plugin does NOT replace the host executor (the official
|
|
9
|
+
> PowerShell executor stays untouched): it adds its own `bash` tool running
|
|
10
|
+
> on a PRIVATE Git Bash executor instance, gives the four OFFICIAL presets
|
|
11
|
+
> Git Bash through a per-agent inline tool patch (v0.35.0), keeps the
|
|
12
|
+
> official `pwsh` tool (REAL PowerShell) hidden behind a switch (`pwshTool`,
|
|
13
|
+
> off by default), publishes the `gb_*` FastCtx file
|
|
11
14
|
> tools, and keeps the four `· Git Bash` variant presets behind a switch
|
|
12
15
|
> (`variantPresets`, off by default).
|
|
13
16
|
|
|
@@ -35,20 +38,30 @@ dsh plugin --profile web add dsh-gitbash-shell
|
|
|
35
38
|
|
|
36
39
|
## What it does
|
|
37
40
|
|
|
38
|
-
The bundle patch (`cordis.patch.yml`):
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
The bundle patch (`cordis.patch.yml`) is ADDITIVE ONLY (v0.39.0): it inserts
|
|
42
|
+
this plugin's row (`gitbash-shell`) and nothing else — no official row is
|
|
43
|
+
disabled or replaced, and the host's own PowerShell executor keeps its place.
|
|
44
|
+
The old "replace the executor" three-step patch became runtime work:
|
|
45
|
+
|
|
46
|
+
1. **`pwsh-sandbox` is NOT withdrawn and no executor row is inserted**: the
|
|
47
|
+
plugin no longer replaces the host executor, so the official `pwsh` tool
|
|
48
|
+
is REAL PowerShell again;
|
|
49
|
+
2. **the own bash tool runs on a PRIVATE executor instance**
|
|
50
|
+
(`src/bash-tool.js` + `src/shell.js`): `GitBashSandboxExecutor` — a
|
|
51
|
+
subclass of the shipped `@deepseek-ai/dsh-bash-sandbox` whose inner argv
|
|
52
|
+
is `<git-bash.exe> -c <command>` — is constructed in a private cordis
|
|
53
|
+
scope and is NEVER registered as the `ctx.shell` service (sandbox policy,
|
|
54
|
+
denial classification, background jobs, and settings behavior all
|
|
55
|
+
inherited; **one Windows exception for confined modes — see the next
|
|
56
|
+
section**);
|
|
57
|
+
3. **the `gitbash-shell` row**. **v0.35.0 dual form** — by default
|
|
47
58
|
(`variantPresets: false`) it registers NO variants: the inline tool patch
|
|
48
|
-
(`src/inline-tools.js`)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
(`src/inline-tools.js`) registers the own bash tool per agent whenever the
|
|
60
|
+
tool face says "pwsh yes / bash no"; the official `pwsh` tool (REAL
|
|
61
|
+
PowerShell) stays hidden behind the `pwshTool` switch (off by default);
|
|
62
|
+
the `gb_*`
|
|
63
|
+
FastCtx tools
|
|
64
|
+
(`src/fastctx-bridge.js`) publish alongside. With the switch on, it registers the four
|
|
52
65
|
preset variants **declaratively** (`ctx.agentPresets.register`,
|
|
53
66
|
v0.32.0+) — the row sets are committed, diffable JS data
|
|
54
67
|
(`src/compositions.js`) and **no directory is ever materialized**;
|
|
@@ -57,8 +70,7 @@ The bundle patch (`cordis.patch.yml`):
|
|
|
57
70
|
ignores the switch).
|
|
58
71
|
|
|
59
72
|
Environment: `bash.exe` is spawned as a direct child of the host, so it
|
|
60
|
-
inherits the full system environment plus the `DSH_*` snapshot
|
|
61
|
-
the pwsh executor did.
|
|
73
|
+
inherits the full system environment plus the `DSH_*` snapshot.
|
|
62
74
|
|
|
63
75
|
### Upgrading from 0.34.x
|
|
64
76
|
|
|
@@ -104,10 +116,11 @@ permission presets actually run **UNCONFINED**:
|
|
|
104
116
|
longer redirected to a per-session directory.
|
|
105
117
|
|
|
106
118
|
**If you need the shell itself hard-fenced too** (e.g. the model must not
|
|
107
|
-
write anywhere outside the workspace through the shell),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
write anywhere outside the workspace through the shell), note that this
|
|
120
|
+
plugin's own bash tool also runs confined commands UNCONFINED on Windows (see
|
|
121
|
+
above) — avoid it there, or uninstall the plugin so the tool goes away; the
|
|
122
|
+
official PowerShell executor was never touched by this plugin. The
|
|
123
|
+
`danger-full-access` preset is unconfined by design either way.
|
|
111
124
|
|
|
112
125
|
> The full analysis (the 0.6.0–0.13.1 failure history and the community's two
|
|
113
126
|
> camps) is in the CHANGELOG under v0.13.2 and in the `src/shell.js` header.
|
|
@@ -132,11 +145,14 @@ the four-variant roster of 0.24.x is unchanged; see
|
|
|
132
145
|
[Cooperation with dsh-ptc-cordis-preset](#cooperation-with-dsh-ptc-cordis-preset) for the decision
|
|
133
146
|
rule, the timing, and how both sides share one state.
|
|
134
147
|
|
|
135
|
-
|
|
148
|
+
Own-bash-tool config: `bashPath` lives on the settings card (= the `bashPath`
|
|
149
|
+
field of the `gitbash-shell` row config); a pre-v0.39 legacy profile's
|
|
150
|
+
`gitbash-executor` row config is still read first (compatibility):
|
|
136
151
|
|
|
137
152
|
```yaml
|
|
138
|
-
|
|
139
|
-
|
|
153
|
+
- id: gitbash-shell
|
|
154
|
+
config:
|
|
155
|
+
bashPath: "D:/Tools/Git/bin/bash.exe" # default '' (empty) = automatic chain
|
|
140
156
|
```
|
|
141
157
|
|
|
142
158
|
The automatic chain (empty `bashPath`) probes, in order: explicit settings → default
|
|
@@ -199,7 +215,8 @@ capability ships in **dsh-ptc-cordis-preset ≥ 0.14.0**.
|
|
|
199
215
|
|
|
200
216
|
## POSIX path dialect (introduced in v0.7.0, gated by the `posixPaths` switch)
|
|
201
217
|
|
|
202
|
-
While
|
|
218
|
+
While commands default to this plugin's own Git Bash tool on Windows, the
|
|
219
|
+
plugin makes every path the
|
|
203
220
|
model sees use the MSYS drive-root POSIX form (/c/Users/..., /c/Program Files/...). The switch
|
|
204
221
|
is the `posixPaths` boolean in the `gitbash-shell` settings namespace; it is **on by default**
|
|
205
222
|
(since v0.10.0) and can be toggled any time on this plugin's "Git Bash path dialect" card in
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# dsh-gitbash-shell bundle patch
|
|
1
|
+
# dsh-gitbash-shell bundle patch (route B, v0.39.0)
|
|
2
2
|
#
|
|
3
3
|
# Installed through the official CLI —
|
|
4
4
|
#
|
|
@@ -6,41 +6,27 @@
|
|
|
6
6
|
#
|
|
7
7
|
# — the command reconciles `dsh.profile.bundles` against installed packages
|
|
8
8
|
# and, seeing this declaration, appends dsh-gitbash-shell to the bundle
|
|
9
|
-
# stack. The profile boot then merges this patch:
|
|
9
|
+
# stack. The profile boot then merges this patch, which is ADDITIVE ONLY:
|
|
10
10
|
#
|
|
11
|
-
# 1.
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
# user-trust preset root.
|
|
11
|
+
# 1. insert the plugin row (id `gitbash-shell`, matching the settings
|
|
12
|
+
# namespace string). Everything the plugin does — the own bash tool over
|
|
13
|
+
# a PRIVATE Git Bash executor (src/bash-tool.js + src/shell.js), the
|
|
14
|
+
# declarative preset variants, the terminal adoption, the path dialect —
|
|
15
|
+
# is runtime work owned by that row. The host's own PowerShell executor
|
|
16
|
+
# and every official row keep their places untouched; no official
|
|
17
|
+
# component is disabled, replaced or duplicated here.
|
|
19
18
|
#
|
|
20
|
-
# On non-Windows hosts the
|
|
21
|
-
#
|
|
19
|
+
# On non-Windows hosts the row mounts inert: the inline tool patch, the
|
|
20
|
+
# executor construction and the client half are all platform-gated in code.
|
|
22
21
|
#
|
|
23
|
-
# This patch deliberately does NOT flip
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
- id: pwsh-sandbox
|
|
27
|
-
disabled: true
|
|
28
|
-
|
|
22
|
+
# This patch deliberately does NOT flip ANY base row: the web surface's own
|
|
23
|
+
# gates decide which model-facing tools exist, and the plugin's runtime layer
|
|
24
|
+
# composes with them per agent.
|
|
29
25
|
- insert:
|
|
30
|
-
- id: gitbash-executor
|
|
31
|
-
name: dsh-gitbash-shell/shell
|
|
32
|
-
disabled: !!js process.platform !== 'win32'
|
|
33
|
-
config:
|
|
34
|
-
timeoutMs: 60000
|
|
35
|
-
# EMPTY = AUTO (v0.28.0, issue #11): the shared resolver walks
|
|
36
|
-
# setting > default install paths > PATH > registry PATH, and accepts
|
|
37
|
-
# ONLY Git for Windows' bash. A hard-coded C: path here made a Git
|
|
38
|
-
# installed elsewhere (e.g. Q:/Git) look like "dsh is broken".
|
|
39
|
-
bashPath: ""
|
|
40
|
-
|
|
41
26
|
# Row id 'gitbash-shell' (was 'gitbash-presets' through v0.23.0): dsh >= 0.1.7
|
|
42
27
|
# keys a plugin's live Config form and the one-shot legacy settings.yaml
|
|
43
28
|
# import by the row id, so it now matches the settings namespace string.
|
|
29
|
+
# Older hosts treat the id as opaque.
|
|
44
30
|
- id: gitbash-shell
|
|
45
31
|
name: dsh-gitbash-shell
|
|
46
32
|
|
|
@@ -52,8 +38,15 @@
|
|
|
52
38
|
# ('shell.get' name), so pointing config.shell at Git Bash on Windows makes
|
|
53
39
|
# the sidebar terminal open bash AND display a 'bash' tab label; per-open
|
|
54
40
|
# settings overrides (which this plugin also fills) then agree with it.
|
|
41
|
+
#
|
|
42
|
+
# The path is PROBED at boot (v0.39.0, hardening the v0.15-era hardcode that
|
|
43
|
+
# broke on Git installs outside the default directory — issue #13): the two
|
|
44
|
+
# standard install roots are probed via node:fs, and when neither exists the
|
|
45
|
+
# value resolves to '' which the sidebar treats as "no override" (the
|
|
46
|
+
# per-open settings path and the terminal adoption remain the authoritative
|
|
47
|
+
# channels on such machines).
|
|
55
48
|
- id: better-sidebar
|
|
56
49
|
name: dsh-better-sidebar
|
|
57
50
|
config:
|
|
58
51
|
shell: !!js >-
|
|
59
|
-
process.platform
|
|
52
|
+
(() => { try { if (process.platform !== 'win32') return ''; const fs = process.getBuiltinModule('node:fs'); const pf = (process.env.ProgramFiles ?? process.env.PROGRAMFILES ?? 'C:\\Program Files').replace(/[\\/]+$/, ''); const lad = (process.env.LOCALAPPDATA ?? '').replace(/[\\/]+$/, ''); const candidates = [pf + '\\Git\\bin\\bash.exe', lad === '' ? '' : lad + '\\Programs\\Git\\bin\\bash.exe']; for (const candidate of candidates) { if (candidate !== '' && fs.existsSync(candidate)) return candidate } return '' } catch { return '' } })()
|
package/dsh.plugin.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-gitbash-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"description": "Windows 全模式 Git Bash
|
|
5
|
+
"description": "Windows 全模式 Git Bash:自带 bash 工具(私有 Git Bash 执行器实例,官方 PowerShell 执行器原样保留),官方四个模式经行内工具补位直接获得 Git Bash(v0.35.0 起;v0.39.0 起不再替换宿主执行器),四个 *·Git Bash 变体 preset 可开关;官方 pwsh 工具默认隐藏、开关可见(真 PowerShell);附带 gb_* FastCtx 文件工具,检测到 dsh-ops 自动让位。联动:dsh-ptc-cordis-preset(PTC 创造模式带 Git Bash 行且可去重)+ dsh-better-sidebar(终端标签自动切 Git Bash)。",
|
|
6
6
|
"engines": {
|
|
7
7
|
"dsh": ">=0.1.7-rc"
|
|
8
8
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-gitbash-shell",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Windows
|
|
3
|
+
"version": "0.39.0",
|
|
4
|
+
"description": "Windows 上给 agent 一个真正的 Git Bash 命令工具:私有 Git Bash 执行器实例(官方 PowerShell 执行器原样保留),统一 MSYS 盘根路径方言,官方 pwsh 工具默认隐藏可开关,物化四个内置预设的 Git Bash 变体,侧栏终端接管可开关。· Give agents a real Git Bash tool on Windows: a private Git Bash executor instance (the official PowerShell executor stays untouched), a unified MSYS drive-root path dialect, an opt-in official pwsh tool, and four Git Bash preset variants.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -30,6 +30,14 @@
|
|
|
30
30
|
"@deepseek-ai/dsh-client-ui-settings"
|
|
31
31
|
],
|
|
32
32
|
"platform": "web"
|
|
33
|
+
},
|
|
34
|
+
"compatibility": {
|
|
35
|
+
"dsh": ">=0.1.7-rc",
|
|
36
|
+
"dshReleases": {
|
|
37
|
+
"0.2.0-rc.2": "compatible",
|
|
38
|
+
"0.2.1-alpha.1": "compatible",
|
|
39
|
+
"0.2.1-alpha.2": "compatible"
|
|
40
|
+
}
|
|
33
41
|
}
|
|
34
42
|
},
|
|
35
43
|
"files": [
|
package/src/bash-path.js
CHANGED
|
@@ -298,10 +298,13 @@ export function effectiveConfiguredBashPath(ownRowValue, settingsValue) {
|
|
|
298
298
|
|
|
299
299
|
/**
|
|
300
300
|
* The `gitbash-executor` ROW's own `bashPath` — the highest-priority tier.
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
*
|
|
301
|
+
* ROUTE B (v0.39.0): the executor row no longer exists in the shipped patch,
|
|
302
|
+
* so on current installs this tier reads '' and the `gitbash-shell` settings
|
|
303
|
+
* row below is the only explicit tier. The read is KEPT as a compatibility
|
|
304
|
+
* layer: profiles installed before v0.39.0 may still carry the row (the host
|
|
305
|
+
* merges profile-patch layers by id), and an explicit value written there
|
|
306
|
+
* back then must keep winning over a silent auto-chain. Absent row / absent
|
|
307
|
+
* config / any loader shape change reads ''.
|
|
305
308
|
*
|
|
306
309
|
* TWO access paths, because hosts differ (issue #13, measured on 0.2.0-rc.2):
|
|
307
310
|
* bundle-patched rows live in the OWNING PLUGIN'S SUBTREE there, so a bare
|