dsh-gitbash-shell 0.31.0 → 0.32.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 CHANGED
@@ -3,6 +3,98 @@
3
3
  > 倒序排列,新版本条目在最上面。条目格式:`## vX.Y.Z — YYYY-MM-DD` + 类型(feat / fix / docs / chore)+ 要点 + 相关链接。
4
4
  > 纪律见 AGENTS.md「变更记录纪律」:发版前先更新本文件并随版本提交;事故复盘、复现与真机验证记录也记在这里。
5
5
 
6
+ ## v0.32.0 — 2026-09-28
7
+
8
+ **类型**:chore(宿主下限提高到 >= 0.1.7-rc:删除 0.1.6 以前的全部兼容路径,插件瘦身六分之一)
9
+
10
+ - **删除物化路径**:dsh 0.1.7 移除目录预设机制后,声明式注册(registerVariant + src/compositions.js)是唯一生效路径,物化分支在所有受支持宿主上都是死代码。整体删除:era 探测(detectBuiltInEra / baseForRoster / eraSuffix,0.1.1→0.1.2 code→ptc 改名)、persona text/split 双形态(0.1.3-alpha.2)、present 探测注入(0.1.5-alpha.2)、行形态对齐(0.1.6-alpha.1)、materialize / pickComposition / syncDecision / firstUserRoot / detectPeerCoverage(仅旧 era 调用;声明式路径的 peer 信号走 PEER_CAPABILITY inject 链)与 apply 的物化分支。src/index.js 3099 → 2549 行。
11
+ - **资产目录删除**:assets/<variant>/ 是物化专用源(声明式数据在 src/compositions.js),随路径一并删除;package.json 的 files 同步去掉 assets。
12
+ - **保留**:声明式四变体注册与 volatile 重注册、PEER_CAPABILITY 去重链(preset id 永不变,含 code-gitbash 历史名)、路径方言(POSIX 翻译/虚拟挂载/run_code 内路径)、终端工具清单、inspect-registry shim、marker 守卫的旧物化残留清理(升级路径)。
13
+ - **宿主下限**:engines.dsh 与 peer @deepseek-ai/dsh → >=0.1.7-rc。smoke 123 项 → 98 项(物化 / era / persona / present / rows 断言随实现删除);已知无关失败保留:toolchain 的 PATH 顺序用例在 macOS 上因分隔符断言失败(HEAD 既有,Windows 专用)。
14
+
15
+ ## v0.31.1 — 2026-09-27
16
+
17
+ **类型**:fix(issue #12:0.29.1 在 DSH 0.1.7-rc.2 上仍解析到 profile 里的 schemastery 3.18.2,每次 shell 调用报
18
+ `TypeError: config.timeoutMs.get is not a function`)
19
+
20
+ > 报告者 **tkhs101** 的分析是准确的(根因、复现步骤、建议方向都对)。本条目按他的复现步骤逐条核对后落地。
21
+
22
+ ### 结论:是「我们解析到哪一份 schemastery」的问题,不是用户的配置问题
23
+
24
+ `@deepseek-ai/schemastery` 在本插件里是 **peer**,由环境提供 —— Node 从**插件文件向上**找 `node_modules`,
25
+ 在 hoisted profile 里会先撞上**被其他依赖提升到 profile 根**的旧副本(报告者机器实测:3.18.2,**没有 `volatile()`**),
26
+ 而宿主 dsh 自己用的是安装目录里与 shell 包放在一起的 3.18.4(有)。
27
+
28
+ **用户什么都没做错**:hoisted 布局是 pnpm 的正常产物,旧副本被提升也是其他依赖的正常行为,不需要改任何配置。
29
+
30
+ ### 影响
31
+
32
+ 插件把 `pwsh-sandbox` 关掉、把 `ctx.shell` 换成 Git Bash 之后,它的 Config 因为探测不到 `volatile()`
33
+ 退化成普通值,基类随即在 `.get()` 上抛错:
34
+
35
+ ```
36
+ TypeError: config.timeoutMs.get is not a function
37
+ ```
38
+
39
+ **每一次 shell 调用都失败**(包括 `echo hi`),等于 agent 完全没有命令行能力;而**宿主日志全绿**
40
+ (插件行加载成功),报错信息也指不到插件 —— 只能靠卸载插件来确认。卸载即恢复。
41
+
42
+ ### 根因链(每层都有代码位置)
43
+
44
+ 1. `src/shell.js:46` 静态 `import z from '@deepseek-ai/schemastery'` —— 自 v0.24.4 起**一字未改**,
45
+ 所以 **0.29.1 与 0.31.0 带的是同一个缺陷**(报告者不是"版本旧",升级插件修不了)。
46
+ 2. Node 解析 → 插件所在 profile 的 `node_modules/@deepseek-ai/schemastery` = **3.18.2**。
47
+ 3. `live(schema)` 的判据是 `typeof schema.volatile === 'function'` → 3.18.2 没有 → 返回普通 schema。
48
+ 4. 宿主 dsh 0.1.7 的 `LocalBashExecutor` 把这六个字段声明为 `.volatile()`
49
+ (`packages/shell/bash-local/src/index.ts:100-107`),并在 `assertServiceableBashConfig`(line 80)
50
+ 与 `resolve`(line 124/132)里调 `.get()`。
51
+ 5. ⇒ 崩。
52
+
53
+ **v0.24.4(issue #6)的探测只在「我们碰巧解析到的那份恰好有 `volatile()`」时有效** —— 报告者指出的正是这个软肋。
54
+
55
+ ### 修复
56
+
57
+ 新增 **`src/schemastery.js`**:不再让解析顺序决定用哪份,而是**问宿主**。
58
+
59
+ - **`hostWantsVolatileRefs(ParentConfig)`** —— 直接调用**宿主自己**的 `SandboxBashExecutor.Config({})`,
60
+ 看 `timeoutMs` 解析成 `{ get() }` 还是普通值。这正是"这个宿主会不会调 `.get()`"的直接读数
61
+ (0.1.7+ → `true`;≤0.1.6 → `false`),读的是**行为**,不碰任何私有 schema 结构。
62
+ - **候选顺序**:shell 包自己的解析域(权威,与执行器同源)→ 插件自身域。
63
+ - **`chooseCopy` 纯函数**(可测)的判定:
64
+ - 宿主要 volatile 且**自己的副本能服务** → 保持自己那份(**能服务就不换**)。
65
+ - 宿主要 volatile 而自己的副本**不能** → **重定向到 shell 包那份**(#12 的修法),并打一行日志说明取自哪里。
66
+ - 宿主读普通值(≤0.1.6)→ 保持自己那份,**绝不**递一个它不会 `.get()` 的 ref(#12 的镜像错误)。
67
+ - 宿主答不上来 → 保持 v0.31.0 行为(逐字段探测),**不替宿主猜**。
68
+ - 宿主明确要而哪儿都没有 → 保留自己那份(**不改变其它行为**)但**大声说明原因**,
69
+ 不再留一个与插件看不出关系的神秘 TypeError。
70
+ - **两个消费点共用同一份缓存解析**(`src/shell.js` 的执行器 Config ↔ `src/index.js` 的行 Config 与旧时代
71
+ settings 命名空间)—— 否则两处可能拿到不同的 schemastery,设置项与执行器就会各说各话。
72
+ - **静态 peer import 全部消除**(它会让一行加载失败静默杀掉整行 —— v0.24.3 的教训),改由
73
+ `src/schemastery.js` 内**动态**加载。
74
+
75
+ ### 验证
76
+
77
+ - `npm test` **123/123**(新增 5 项):宿主行为的三种回答(`true`/`false`/无法判定)、`hasVolatile` 的边界
78
+ (含抛错的 getter)、`chooseCopy` 的完整矩阵(含"能服务就不换"与"顺序不决定结果")、共享加载器的
79
+ 缓存一致性、两个半都不得静态 import peer。
80
+ - **临时拓扑复现 + 修复对照**(插件域真装 `@deepseek-ai/schemastery@3.18.2`,shell 包域真装 `3.18.4`,
81
+ 且 shell 包用真的 `.volatile()` 声明 Config —— 与 issue 描述逐条对应):
82
+
83
+ | 场景 | 修复前 v0.31.0 | 修复后 |
84
+ |---|---|---|
85
+ | 新宿主 + 根目录被提升的旧副本(**#12 原场景**) | `timeoutMs = 120000`、`.get` 不存在 → **DISAGREE**(即报告者的崩溃) | `timeoutMs = {}`、`.get` 是函数 → **AGREE**;日志 `schemastery taken from the shell packages instead of this plugin's own resolution (host-volatile-redirected)` |
86
+ | 旧宿主 ≤0.1.6(读普通值) | — | 两边都是普通值 → **AGREE**(即使 shell 包那份 capable,也**没有被误用**) |
87
+
88
+ **判据是「插件与宿主的解析结果是否一致」,不是「有没有 `.get()`」** —— 后者在旧宿主上会给出反向的错误结论
89
+ (旧宿主拿到 ref 同样是崩)。
90
+ - **第三种组合(宿主要 volatile 而两边都没有)在现实中不可达**:宿主能正常跑,就说明它自己解析到了配套副本,
91
+ 而"shell 包域"正是宿主的域。该分支仍保留 fail-loud 日志作为防御,并由单元测试覆盖。
92
+
93
+ ### 相关
94
+
95
+ - issue #12(报告者 tkhs101,含完整复现步骤与修复建议)
96
+ - issue #6 / v0.24.4:同一崩溃的**另一方向**(当时是完全没有 volatile 探测)
97
+
6
98
  ## v0.31.0 — 2026-09-27
7
99
 
8
100
  **类型**:fix + feat(用户报告:点开对话里的文件链接,原生右侧栏显示「文件不存在,可能已被移动或删除」)
package/dsh.plugin.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-gitbash-shell",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "main": "./src/index.js",
5
- "description": "Windows 全模式 Git Bash:用 Git for Windows bash 替换 PowerShell 执行器,并物化 standard/minimal/code/cordis 的 Git Bash 变体 preset。双 era 适配 dsh <= 0.1.1(内置 id 'code')与 >= 0.1.2(改名 'ptc'),启动探测自动选择,preset id 永不变。联动:dsh-ptc-cordis-preset(两者同装时 PTC 创造模式自动物化为 Git Bash 版)+ dsh-better-sidebar(终端 UI 标签与模型 terminal_* 工具自动切到 Git Bash)。",
5
+ "description": "Windows 全模式 Git Bash:用 Git for Windows bash 替换 PowerShell 执行器,声明式注册 standard/minimal/code/cordis 的 Git Bash 变体 preset(preset id 永不变)。联动:dsh-ptc-cordis-preset(两者同装时 PTC 创造模式带 Git Bash 行且可去重)+ dsh-better-sidebar(终端 UI 标签与模型 terminal_* 工具自动切到 Git Bash)。",
6
6
  "engines": {
7
- "dsh": ">=0.0.1"
7
+ "dsh": ">=0.1.7-rc"
8
8
  },
9
9
  "contributes": {
10
10
  "tools": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gitbash-shell",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "description": "Windows 上让 agent 的每条 shell 命令改经 Git for Windows bash 执行;物化四个内置预设的 Git Bash 变体,统一 MSYS 盘根路径方言,侧栏终端接管可开关。· Run every agent shell command through Git for Windows bash on Windows; materialize Git Bash variants of the built-in presets, unify the MSYS drive-root path dialect, and adopt the sidebar terminal behind a switch.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "engines": {
19
19
  "node": ">=18",
20
- "dsh": ">=0.1.0"
20
+ "dsh": ">=0.1.7-rc"
21
21
  },
22
22
  "dsh": {
23
23
  "bundle": {
@@ -35,7 +35,6 @@
35
35
  },
36
36
  "files": [
37
37
  "src",
38
- "assets",
39
38
  "cordis.patch.yml",
40
39
  "dsh.plugin.json",
41
40
  "CHANGELOG.md",
@@ -60,7 +59,7 @@
60
59
  "license": "MIT",
61
60
  "peerDependencies": {
62
61
  "@deepseek-ai/cordis": "^4.0.1",
63
- "@deepseek-ai/dsh": ">=0.1.0",
62
+ "@deepseek-ai/dsh": ">=0.1.7-rc",
64
63
  "@deepseek-ai/schemastery": "^3.18.1"
65
64
  },
66
65
  "peerDependenciesMeta": {