Commit Graph
825 Commits
Author SHA1 Message Date
kelvinwww 2895434a29 fix: 修复 PTC 子调用在本轮文件中缺失 2026-10-11 22:59:14 +08:00
Menghuan1918 62b797665f docs: 接入指南 / README / AGENTS / CHANGELOG 与设计文档同步
- 指南 §5.2 / §5.3 / §6:FileViewerProps 的 truncated → size + largeFile、
  新增 visible;fs.read 三态;新增 fs.readPage;fs.write 迁到 raw 路由
- 指南 §6.1:打包改原生命令的完整说明(工具探测顺序、-y 与符号链接环、
  公共祖先定位、临时文件 + 流式下发、unavailable 501),删掉已不存在的
  ZIP_MAX_ENTRIES / ZIP_MAX_BYTES 与 src/zip.ts 的说法
- README / README_EN:挂载示例的四个限额收缩为 listLimit,并说明三个键
  已删除、旧 profile 残留值会被静默忽略
- AGENTS §6 测试地图:6 tab + 4 viewer、新增的六个守护 spec
- CHANGELOG / CHANGELOG_EN:未发布段
- docs/plans/2026-10-11-streaming-transfer-jsonl-preview.md:设计过程、
  与 VS Code Web 的对照(含「VS Code 并不分页」的纠错)与实施偏差记录

另修一处 lint:jsonl.ts 的 truncate 助手在重写摘要后成了死代码
2026-10-11 22:43:30 +08:00
Menghuan1918 27f71a3bd7 test: 适配流式传输 / JSONL / 大文件分页的新契约
- 新增 fs-read-page / jsonl / jsonl-language / file-stream-route 四个 spec
- 新增 archive 相关的两个 spec 之外的:写路由 spec 改指向 /sidebar/write,
  并补上「远超旧的 1 MiB JSON 上限的一次保存」这条回归
- 上传与 fs-operations 的 size cap 断言改为「远超旧上限仍成功且不留残file」
- 查看器契约 port 到 kind 联合 + largeFile;新增 editor-large-file 取代
  截断保存用例;内置 viewer 清单变 4 个
- smoke / plugin-shape 适配:删掉的四个配置键、新增的 /sidebar/write 路由、
  文件名对应的 route 错误码由 500 变 400、fs.read 的 too-large 分支
- smoke 的 GET 改走真 node:http(字节路由要真 Writable),并 closeAllConnections
  以免 undici 的 keep-alive 把用例拖过超时
- 21 份词典同步:18(+1) 个新 key、删除 truncation/zipProgress、
  pluginVideoPreviewDesc 去掉已不存在的 mediaLimit 说法

测试发现的两个真实缺陷一并修复:
- lang-jsonl 的字符串分支把 StringStream.next() 的 undefined 当成 null,
  遇到第一个未闭合字符串就无限增长直到 RangeError
- 分页读取原先锁死第一页嗅探到的编码,会让「长 ASCII 前缀 + GBK 正文」的
  文件后半段变乱码;改为只锁宽字符编码,字节序编码逐页各自嗅探(分页按行
  对齐,不会切断字符)
2026-10-11 22:36:42 +08:00
Menghuan1918 79ee383c5e feat(tasks): 小条只说原生状态、聚合按组展开、浮窗活动行移到标题下
用户 brief:下方条不再显示「运行中」而是原生状态;「最近活动」以小字号写到
标题下方;展开不要点一个全开;顺带修其他的。

四条用户确认的口径:

- 小条(图模式 CardBar):运行中/已结算都由**活动行取代状态词**,措辞取宿主
  `chat` 命名空间(正在分析请求 / 正在读取文件 · main.ts / 正在准备读取文件 /
  正在运行命令 · npm run build),与主对话逐字一致。**`空闲` 与 `出错` 保留
  状态词**(不被任何活动措辞蕴含),**没有活动数据时回退状态词**,小条不空。
  状态点、执行扫光、折叠 chevron、22px 高度全不变 → 画布几何零改动。
- 根节点接上 live:live 路由一直把拓扑根的 fold 放进 `live[rootSessionId]`,而
  模型从未挂到根节点上——主代理卡片的状态文本因此恒为 thinking 兜底(这就是
  「大部分时间一直显示正在分析请求」的真因),树模式根行也恒为「思考中…」。
- 节点详情:删掉「最近活动 | 值」那一行(键值格的值列在 280px 被省略、标签又
  占三分之一宽),改为标题下的 10px 活动行 + 夹两行的实时文本;**无数据不渲染
  这一块**(此前每个浮窗都显示「最近活动:正在分析请求」,已结算节点也一样)。
  新增共享规则 `activityLine(node)`:running → 宿主 live 措辞,其余 → 宿主
  done.* 措辞,无 summary → undefined(调用方回退状态词,不谎报)。删 `tasksNodeActivity`(20 份词典)。
- 按组展开:模型新增 `expandedGroups`(键 = 新增的导出 `foldGroupId`,哈希
  `fold:<parentId>[:idle]`),只覆盖「本来就要折」的分支——点聚合只开该组,兄弟组/
  页级规则/手工折叠都不动。页面侧 `expandGroup` 同时把该组成员从 `foldedIds` 摘掉,
  **控制条收起时清空按组展开**(判据写在收起分支,自查时抓到一次反了并补了判别性
  用例:翻回去即红)。树里的聚合行同一语义,行内副文案固定为「展开」。
- 聚合卡计数只说一次:待命组徽标此前印**字面量字母 N**(`tasksFoldIdleGroup` 在 20 份
  词典里都没有 `{count}` 插值),现在插值真实计数;小条只留 `出错 N` 尾注 + 展开箭头,
  完整 tally 仍是 `aria-label` 与 tooltip(屏幕阅读器看不到徽标)。
- 树模式实时行图标按活动类别取:`tool-icons.tsx`(工具名映射,只有一处写死 bash 的
  调用)换成 `activity-icons.tsx` 的 `activityGlyph(kind)`,`Record<ProcessActivity, …>`
  让上游新增类别编译失败而不是静默兜底。

测试 2227 passed / 17 skipped(190 文件)、tsc 0 错误、eslint 0 错误、构建通过。
tasks-page 新增 FakeChatLocale(挂宿主 chat 命名空间,否则只能断言到 fallback 的
detail,钉不住契约)。设计文档 docs/plans/2026-10-11-tasks-status-and-group-fold.md,
其中记录了「README 的 v0.22.0 发布说明不改」的偏差理由(git log -L 显示那四条自发布
提交后再未被碰过,进行中通道是 CHANGELOG 的 Unreleased)。
2026-10-11 22:04:28 +08:00
Atlas Zeng 0c3e5e9279 merge #881 into dev(推荐目录收录音频预览插件 dsh-plugin-better-sidebar-plugin-audio)
Refs #881
2026-10-11 21:54:53 +08:00
unsc9 42bfd9386e refactor(changes): 精简两侧行数改动的注释、测试夹具与合约(行为不变)
上一个提交(bdf3c33)过了一轮「代码精简」审查(复用 / 简化 / 效率 / 修在哪一层
四个角度,四个只读子代理并发),这里只落地行为完全不变的那批。

- 同一个「两侧不能相加」的理由原先在 5 处源码注释与 4 处测试注释里各写一遍,
  措辞已经开始分叉。完整理由只留在权威位置 `GitStatusEntry` 的字段文档;
  `status()`、`api.ts` 的镜像类型、`ChangeFile.counts`、GitLens 的调用处与三处
  测试注释压成一行并指回去。
- 用例夹具:`change-tree-counts.spec.ts` 的 `entry()` 从「传一个 sides 对象」改成
  「传一个读数 + 一个侧」,收掉 13 处 `{ unstaged: … }` 外壳;那个 `side` 用生产
  侧导出的 `ChangeSide`——它此前导出了却没有任何消费者。
- 同文件「两侧不相加」的用例原先两侧读数对称(都是 1/1),两条断言的期望值逐字
  相同:把两侧读反也照样绿。夹具改成不对称(staged 1/1、unstaged 5/0),「相加」
  与「读错边」两种错误现在都会失败。
- `git.spec.ts` 里第 4 份「建仓引导」提成局部 `mkRepo(files, config)`,与紧邻用例
  共用(少一次重复的 4 个 git 进程)。
- `git-view-worktree.spec.tsx` 的 `mountTree` 形参原先手写镜像了 `GitStatusEntry`
  的四个成员,改回 `GitStatusEntry[]`(同文件上方本就 import 了它)。

按「超出本次 diff / 会改变行为」跳过的四条,留档:GitLens 里 band↔侧的六处穿线
(要重写两个本 diff 没动过、近乎逐字重复的渲染块)、「这行会不会印数字」的两处
判断(合一就必须让 0/0 行不再渲染那个空 span,那是改输出)、快照身份的两份实现
(造键 vs 判等,本就是两件事)、服务端 `git.suggest-message` 又推一遍「属于哪
一侧」(本 diff 之外,且与本次 bug 同类)。另:`GitStatusEntry` 在 `git.ts` 与
`api.ts` 的两份声明是刻意的镜像(浏览器侧声明图不能碰 `node:*`),不合并。

验证:`tsc --noEmit` 通过;eslint 对 7 个改动文件无输出;受影响的 6 个测试文件
173 条全绿(含真起 git 进程的用例);完整单测 189 文件 / 2234 用例,失败仍是与
改动前同一批 8 条环境性失败(3 条 Windows 建符号链接 EPERM、1 条 `tar` 在 Windows
输出 CRLF、4 条中文语言标签),无新增。
2026-10-11 17:59:32 +08:00
unsc9 e4a2d530ea refactor(tabs): 精简改名/删除页签调解的原生枚举与用例装配(行为不变)
上一个提交(e876aa9)过了一轮「代码精简」审查(复用 / 简化 / 效率 / 修在哪一层
四个角度,四个只读子代理并发),这里只落地行为完全不变的那批,净减 37 行。

- **原生页签枚举接回仓库既有的那条缝**:`SidebarSurface` 已有 `tabTypeOf?`
  (存在理由逐字相同:「service 自己看不见原生记录」),新增可选
  `pathTabs?()`,service 上加 `@internal nativePathTabs()` 转发。删掉
  `src/client/native/surface.ts` 里的模块级单例 `installed`、
  `installedNativeSurface()`,以及 dispose 里那条「只有仍是当前实例才清句柄」
  的顺序敏感守卫——那是同一个状态被存两份才需要的补丁。`NativePathTab` 从
  `native/tab-adapter.tsx` 上移到 `service.ts`(与 `NativeTabParams` 并列,
  `SidebarSurface` 的方法就引用它),`createNativeSurface` 因此回到直接
  `return { … }`,不再需要局部 `surface` 变量。
- `tab-adapter.tsx` 的 `ensure()`:`adopted`(三目求值 + `!== undefined` +
  `||`)改成具名布尔 `newNavigation`,`meta` 与 `path` 共用一次判断。真值表
  逐格等价(revision 缺省 → true;已定义且不同 → true;已定义且相同 → false)。
- `closePathTabs` 的 `tab.absolute !== target &&` 多余:`isWithinWorkspace`
  本身对目标自身就返回 true,一条判断同时覆盖「这个文件」与「这个目录下」。
- `EditorHost.tsx` 的布尔 `movedPath` 与 `tree-mutations.ts` 里返回**路径**的
  `movedPath` 撞名,改成 `pathChanged`。
- 用例装配:`mountNativeSession()` 一次装好 store / service / editor 描述符 /
  原生承载面 / 会话,`resetModuleRegistries()` 供 `beforeEach` 与 `afterEach`
  共用,`openNativeFile()` 参数化 seat 与 cwd(收掉两处手写 `records.ensure`)。
  六个用例各自少 5 行样板,用例数与断言不变(15 条)。

按「超出本次 diff / 会改变行为」跳过的三条,留档:改名标记改挂 `SidebarTab`
临时字段(要动持久化 schema 与 `updateTab` 公开 patch 类型)、标记在「宿主直接
关页签且编辑器不再挂载」这条极端路径上不回收(每次几百字节)、批量删除逐行重跑
全量枚举(低于可测量门槛)。

验证:`tsc --noEmit` 通过;eslint 对 6 个改动文件无输出;`vitest run --dir tests`
189 个文件 2240 条用例,184 个文件通过,8 条失败均与本次改动无关且为环境原因
(3 条 Windows 建符号链接 EPERM、1 条 `tar` 在 Windows 输出 CRLF 使结尾带 `\r`、
4 条中文语言标签)——覆盖本次改动模块的用例全绿(`editor-unsaved-guard` 15、
`native-surface` 50,另有 `service`、`editor-host`)。旁证:本地
`.tmp-audit/upstream-tree` 那份不含本改动的镜像副本,在 `tasks-model` 上红的是
同样 4 条。
2026-10-11 16:49:24 +08:00
ymac 776e777da7 fix(editor): 落地到行时把光标亮出来,并让引用赢过预览的阅读位置(#826 收尾之四)
第一次真机手测反馈:跳转确实进了编辑视图,但**看不到光标**,所以不知道落在哪一行。
两个原因:

1. **没给编辑器焦点**。落地只 `dispatch({ selection })`,而 CodeMirror 只在
   **获焦**的编辑器里画光标,且零长度选择本身不画任何东西——未获焦的落地读起来
   就是「文件打开了,停在某处」。现在只在**行号引用**这条路上 `view.focus()`
   (普通打开不动读者的焦点,读者可能是从聊天输入框点的链接)。

2. **预览的阅读位置会覆盖它**。进入编辑态时那条「按预览滚动位置恢复」的副作用
   声明在落地之后,两个 effect 在同一次提交里,它会把选择与滚动重新写回读者
   刚才预览的地方——读者先在预览里滚动过,再点带行号的引用,跳转就被静默抹掉。
   落地前清掉 `previewSyncRef`:引用要的是源码里的那一行,不是预览里那个位置。

测试:text-editor-line-jump.spec.tsx 加 3 例(落地后 focus 被调用、普通打开不抢焦点、
markdown 翻转后仍获焦)+ 1 例判别性用例(预览滚到 90% 后再跳第 3 行,最后一次
dispatch 必须是第 3 行的 offset 8 而不是按比例算出的 14;去掉清空那行即红)。
2026-10-11 16:06:42 +08:00
ymac 6dd0486f5c fix(editor): 换文件 / 重命名时丢掉继承来的 landing line(#826 收尾之三)
`updateTab` 的补丁只有 title/path/meta,所以两条「插件自己改路径」的路都把上一个
文件的行号留在了记录里:合并模式在页头路径框输另一个文件、以及文件树里重命名
打开的文件(`retargetPathTabs`)。后果与 reload 那条同症状——新文件跳到旧行号,
markdown 还被拉进编辑态。宿主导航那条路径本来就有清理规则
(`params.line !== existing.tab.line`),插件自己写的路径没有。

规则统一为「**改 path 就是一次新的打开**」,瞬态行号随之清掉,落在两个记录层:
`patchTab`(store 分支)与原生记录的 `update()`(`updateTab` 的 native 分支);
只改 title / meta 的补丁不动它(同一文件,行号仍属于当前这次导航)。

测试:native-tab-line.spec.ts 加两例(换 path 清掉、只改 title 保留),
editor-line-nav-mode.spec.tsx 的第四条从「模拟 updateTab 的结果」改成驱动真实
`service.updateTab` 并断言记录里 `line` 消失、编辑器留在预览态。
2026-10-11 15:56:49 +08:00
ymac 68d6c33025 fix(markdown): 预览里的 #L131 链接也带上行号(#826 收尾之二)
插件自绘的 markdown 预览(编辑器预览 / 侧边对话转录 / 变更阅读窗 / 任务窗口)
里点 `./other.md#L42`,文件打开了却不跳行——而且停在预览态,源码被当成段落
渲染成一坨。聊天正文里同一个链接能跳:那一侧的 `navigation.params.line` 由宿主
解析后落进记录,而插件这一侧的 delegate `openFile(path, { line })` 收到的行号
只被当成「这是行号不是标题锚点」的判据,随后 `openSidebarFile` 就把它丢了
(种子没有 line 字段,原生分支的 `surface.openResource` 也没传——末跳本身是
支持的)。

补齐三跳:`use-markdown-surface` 把 `options.line` 传下去(拿不到时按宿主语法
自己解析片段,新增 `lineOfHostFragment`,区间取起始行),`openSidebarFile` 与
`OpenTabSeed` 各带一个可选 `line`,`openTab` 的原生分支转发给
`surface.openResource`、底部工作台的 mint 落进 tab。落地后的行为与聊天正文那条
一致:跳到那一行,markdown/html 离开预览(预览里没有源码行号),并且——承上一条
提交——读者随时能点回预览。

测试:markdown-surface.spec.tsx 走真实宿主 MarkdownText 点链接,钉住 `#L42` 与
`#L20-L25` 进记录、标题锚点仍然只走 parked 片段;markdown-navigation.spec.ts 钉
新解析器;file-open-claim.spec.ts 钉种子透传与「不传就不带这个键」。
2026-10-11 12:02:55 +08:00
ymac 46a870a471 fix(editor): 引用行号不再永久占有 markdown 的模式(#826 收尾)
跳到 #L131 后回不到预览:TextEditor 收到行号会把 markdown/html 强制切到编辑态,
而「这条导航是否已经消费过」记在组件实例里(landedAtRef)。EditorHost 的每次
reload 都用 loading 行替换 viewer(页头刷新、「编辑 → 预览」边沿 #167 part B、
预览态保存后的刷新、#855 自动刷新),重建出的实例又是 preview 模式 + 空记忆,
于是同一个行号再次强制切编辑——读者点「预览」当场被切回去。

记忆改由宿主持有(它比 viewer 活得久):TextEditor 定位完成后回调
`onLineConsumed()`,EditorHost 记住已消费的 `${path}#${line}` 并停止再下发,
直到换文件(新的一次打开)或换行号(新引用)。公开面纯增量:
`FileViewerProps.onLineConsumed?: () => void`,不消费 `line` 的第三方 viewer
行为不变。

测试:tests/editor-line-nav-mode.spec.tsx(新,3 例,真 TextEditor 过 EditorHost:
落地后能回预览 / 刷新不回弹 / 同文件新行号仍落地),text-editor-line-jump.spec.tsx
补 2 例钉住消费契约(定位后恰好一次、普通打开不消费)。
2026-10-11 11:43:51 +08:00
unsc9 e876aa9667 fix(tabs): 改名/删除的页签调解覆盖右侧栏原生页签,并让改名不再重载文档
文件树改名/删除后的页签调解只走 `state.bottomSplits`(插件自己的底部工作台),
而当前架构下文件默认开在 **DSH 原生右侧栏**:有原生承载面时 `service.openTab`
直接走 native,从不写 store。那些页签因此从不参与调解——

- 改名后:页签仍绑旧路径,`EditorHost` 的保存按旧名字写盘;旧名字已被改掉,
  `fs.write` 的 `mkdir -p` + 写入把旧文件(连同被一并删掉的父目录)重建出来,
  界面还报「已保存」。仓库里于是同时留下新旧两份,新名字那份是旧内容。
- 删除后:连「有未保存改动,确定关吗」都不弹(`closePathTabs` 同样只遍历底部
  工作台),Ctrl+S 直接复活刚删掉的文件。

改动:

- `NativeTabRecords.pathTabs()` 按路径枚举原生记录(带 seat session),
  `NativeSurface.fileTabs()` 把它交给调解;`installedNativeSurface()` 是插件自身
  读原生承载面的句柄(模块级,与 `editor-dirty.ts` 同款「每次激活一份」)。
- `tree-mutations.ts`:两个页签空间一起遍历;改名按**子树**匹配(与删除同口径,
  此前只有删除覆盖子树,目录改名时子树里的页签连底部工作台也不改道);原生页签
  的关闭带上自己的 seat session。
- 改名**不重载文档**:`path` 变化原本会让编辑器重载,而重载会换掉文档并丢掉只存在
  于编辑器实例里的草稿——可改名并没有改字节。现在 `retargetPathTabs` 用
  `markRetargetedPath` / `consumeRetargetedPath` 把这次移动交给编辑器认领:文档与
  草稿留着,下一次保存落到新名字;没有这个标记的 `path` 变化(真实切换文件)照旧
  加载。
- `tab-adapter.tsx` 的 `ensure()`:`path` 与 `meta` 一样,只被「尚未采纳的导航修订」
  覆盖。原生承载面每次渲染都重投同一次导航,无条件按地址改 `path` 会把插件侧的
  改址当渲染垃圾丢掉——调解刚改完,下一次渲染就改回旧名字。
- 设计文档补实施偏差:`docs/plans/2026-09-04-file-tree-rename-delete-design.md`。

用例:`tests/editor-unsaved-guard.spec.tsx` 新增 `tree rename/delete
reconciliation`(原生页签改名改址、目录改名两个空间都改道、改名不重读文件且草稿
仍在、删除时脏页签先问、目录删除连子树关);`tests/native-surface.spec.ts` 新增
`path enumeration and the navigation gate`(枚举只含带路径的记录、插件侧改址扛得住
同修订重投、新修订仍按地址改回)。

复查后收紧(三支独立评审小队 + 自查收敛到同一处):

- `retargetedPaths` 的键由「tab id」改成「编辑器看到的那一侧会话 + tab id」
  (`pathTabKey`,写方与读方共用同一处定义):原生 tab id 每会话各自计数(`tab1`
  每个会话都有),只按 id 记键时两个会话的编辑器共用一个槽——其中一个(哪怕它自己
  的路径没动)在清理时会抹掉另一个尚未认领的移动,被抹掉的那个照旧重载、照旧丢草稿。
  同一键仍允许一个移动被认领多次(两个席位显示同一会话的文件时)。
- 生命周期补齐:`clear` 现在按细键生效,编辑器卸载时回收,删除关闭页签时也回收
  (原先只增不减:每次「改名没被已挂载编辑器认领」都会留一条)。
- `View` 记下 seat session:`pathTabs()` 不必再从视图键里拆 session,`retain()` 也
  不再重复同一份拆分(键只是内部编码,不该被别处解析)。
- 子树尾段改用 `paths.ts` 的 `relativeTo`(分隔符与大小写口径与全仓其它相对路径
  统一;原先手写的 slice 在旧路径带尾分隔符或大小写不同拼写时会算错);顺手删掉
  一条与既有用例重复的回归用例(`native-surface.spec.ts` 既有的「同记录二次
  ensure 且无 revision 时 path 跟着走」已经钉住同一事实)。
- **两种路径拼写**:聊天文件链接打开的页签,`path` 来自地址,而 `fileAddressFor`
  在工作区内一律写相对拼写(`src/a.ts`);文件树改名给的却是绝对路径。最初按原样
  比较,这类页签(正是默认打开方式)会整条判成「无关」,仍绑在刚被改名掉的旧名字
  上。现在比较统一在「按会话 cwd 解析后的绝对拼写」上进行,写回记录时用调用方给的
  新名;`movedPath` 的相等判断改用 `relativeTo` 的 `.`(字符串相等在 `E:/a` 与
  `E:\a` 混拼时会把 `新名/.` 写进记录)。
2026-10-10 22:19:07 +08:00
unsc9 d6d927bf6a fix(fs): 带基线保存时目标已不存在判冲突,不再无提示重建被删的文件
`fs.write` 的乐观并发门只在「读得到磁盘 mtime 且与基线不符」时报冲突。目标
已被删除或改名走时,`stat` 失败被 `.catch(() => undefined)` 吃掉,代码把
「读不到」当成「没有基线可比」,于是整段门禁跳过、直接写盘:文件被重建,被
一并删掉的父目录也被 `mkdir -p` 重建,客户端清掉 dirty 并显示「已保存」——
用户刚做的删除被无提示地推翻。

数字基线只可能来自一次成功的读取,也就是那个路径当时确实有文件;所以「读不
到」是磁盘上的删除/改名,不是「新建」意图——新建走 `fs.createFile`,上传走
上传写入,都不经过这条分支。据此把 `current === undefined` 单独判成 409
`fs-conflict`(消息写明 no longer exists on disk)。

改动:
- `src/index.ts`:冲突门拆出「目标不存在」这一支
- `docs/external-plugin-guide.md` 的 `fs.write` 行、`src/client/api.ts` 的
  `fsWrite` 注释:同步这条语义
- `tests/fs-write-route.spec.ts` 两条新用例:目标文件被删(409,不重建、无
  临时文件残留)、父目录被删(409,目录不被重建)

客户端沿用既有的 `fs-conflict` 横幅(「文件已在磁盘上被其它来源改动。保存已
中止,你的修改仍留在编辑器里。」):删除属于「磁盘上被改动」,草稿保留与
重载按钮都仍然成立,因此不新增 20 份词典的词条。
2026-10-10 21:40:49 +08:00
unsc9 9f1724e3df fix(diff): 改动块内的 ---/+++ 不再当文件头,删掉 -- … 行不再截断 diff
删除行的 diff 原文是 `-` 加源码原文,所以删掉一行以「`-- `」(两个减号加
一个空格)开头的内容——SQL / Lua / Haskell 注释、文档或脚本里的命令行参数
行——会产出 `--- foo`,与文件头分隔行 `--- a/路径` 逐字节同形。解析器把
「在 hunk 内」那道闸门排在 `---`/`+++` 两个分支之后,等于没保护它们:命中
后当前 hunk 当场被截断(该行之后没有 `@@` 可重新同步时,剩下的改动整段不
显示),并把被删文本盖到 oldPath 上。新增行原文以 `++ ` 开头(C 的
`++ i;`)同理会把 newPath 改成 `i;` 并丢掉那一行。

git 从不在 hunk 内写 `---`/`+++`,所以判据是「在不在 hunk 内」:两个分支
各加 !inHunk 守卫(等价于把它们挪到那道闸门之后)。

实测(同一份 fixture,修复前 → 修复后,直接跑真实 parseUnifiedDiff):

  删掉 `-- foo`:oldPath `"foo"` → `"a/sample.txt"`;hunk 1 行 → 3 行
  新增 `++ i;`:newPath `"i;"` → `"b/loop.c"`;新增行丢失 → 保留
  统计与 `git diff --numstat` 一致(0/1 与 1/0)

用例:`tests/diff-rows.spec.ts` 新增一组 3 例(删除行、新增行,以及 hunk
之后的真文件头仍要认得——守护这道守卫别把正常头也挡掉)。
2026-10-10 20:34:23 +08:00
unsc9 bdf3c33865 fix(changes): 变更面板两侧行数不再相加,各分组各读自己那一侧(#131)
同一文件同时有已暂存与未暂存改动(porcelain 'MM')时,status() 把
`git diff --cached --numstat`(index 对 HEAD)与 `git diff --numstat`
(worktree 对 index)按路径相加成一个数。两次 diff 的基线不同,相加会把
两者都看到的那几行算两遍:改写一行并暂存、再改同一行,两组各自显示
`+2 −2`,真值只有 `+1 −1`;面板里该文件出现两次,于是同一个虚高值被印
两遍、也被两个分组头各合计一遍。原注释写的「两侧都是对 HEAD 量的」前提
不成立——不带 --cached 的 git diff 量的是 worktree 对 index。

改为让两侧各自保留读数,一路传到分组:

- src/git.ts / src/client/api.ts:`counts` 拆成 `staged` / `unstaged`,
  各查各的 numstat 表;删掉 addLineCounts
- src/client/changes/change-tree.ts:`buildChangeTree(entries, side)`
  按分组取自己那一侧,叶子上的 `counts` 因此只代表所在分组
- src/client/changes/GitLens.tsx:两个分组各传自己的 side;内容键改成
  同时含两侧,否则「只动了一侧的行数」不会重建树
- src/client/ui/git-status.ts:快照比较逐侧比,语义与原来一致

用例:`tests/git.spec.ts` 新增真实仓库用例钉住 `MM` 的两侧读数并断言不再
出现相加值(原用例正好钉着旧行为,一并改);`tests/change-tree-counts.spec.ts`
与 `tests/git-view-worktree.spec.tsx` 钉住每个分组只读自己那一侧。
2026-10-10 20:07:32 +08:00
Menghuan1918 a0cfd30b48 chore(release): v0.25.0 —— 支持线前移到 DSH 0.2.0-rc.2(npm latest)
- 版本 0.24.1 → 0.25.0;CHANGELOG 的 Unreleased 段落成 v0.25.0。
- **支持线**:peer 下限 `^0.2.0-rc.1` → `^0.2.0-rc.2`,CI 与挂载 lane 的钉版同步 →
  `@deepseek-ai/dsh@0.2.0-rc.2`(`latest` 现在正是这一版),31 个 `@deepseek-ai/*`
  devDependencies 与 lockfile 同批抬到 rc.2,`dsh.plugin.json` 的 engines 同步。
- **0.2.0-rc.1 及更早(含 0.1.7 线)请固定 v0.24.1**:caret 范围跨不过预发布元组,
  `^0.2.0-rc.2` 对 rc.1 判定为 false,会被宿主启动预检整行静默禁用。
- 文档同步:AGENTS §2/§3.0、README / README_EN 的徽章与支持线、接入指南的活跃提法
  (历史发布记录与 docs/plans 里的 rc.1 保留原样,那是记录不是声明)。
- 本版内容与贡献者致谢见 CHANGELOG 的 v0.25.0 段。

门禁:rc.2 上 typecheck / lint 干净,全量 189 文件 2213 通过(唯一红是
`fs-watch.spec.ts` 真起 fs.watch 的并行负载 flake,单跑 6/6 绿,与本版无关)。
2026-10-10 01:16:38 +08:00
Menghuan1918 20307d5f6a feat(dock): 右侧面板展开时不显示底部入口(按用户口径重做)
上一版把「没展开」理解成了**底栏**(在 `BottomDockToggle` 里判 `bottomOpen`),
方向反了;先 `8e3447b` 整个 revert,再按真实口径重做:**宿主右侧面板展开时不显示
这个按钮**。

- 新增 `src/client/sidebar/right-panel-open.ts` 的 `useRightPanelOpen()`:
  首帧同步读取 + 每 500ms 复核。
- `BottomDockToggle`(会话头入口)与 `DockFallback`(空白会话备用入口)都在展开态
  返回 null —— 备用入口连 portal 空壳一起省掉。

**判据必须是「可见」,不能是「在不在 DOM 里」**:实测宿主把两个角落控件都留在文档里
(落屏时 `[data-sidebar-right-expand]` 与 `[data-sidebar-right-toggle]` 各 1 个,而面板
明明已经展开),只有可见性区分得开 —— 展开时可见的是 Collapse、收起时可见的是 Open。
早先按属性存在与否判定会一直读成「没展开」,按钮照旧出现在宿主编簇旁边(真机实测到)。

判据的方向也刻意取安全侧:宿主哪天换命名 → 读成 false(不隐藏),按钮照旧可用、
位置由让位逻辑兜住,而不是把按钮永久藏掉。

测试:`tests/dock-fallback.spec.tsx` 新增「右侧栏展开时一个入口都没有」(造一个**可见**的
Collapse 控件;**还原门即红** `右侧栏展开时不该有备用入口: expected <span…> to be null`),
并把两条定位用例改回「收起形态」的锚点 —— 展开态已经不渲染,那两条原先为之写的
「打开形态锚点」用例随之删除(规则把那个状态整个去掉了)。既有 8 条全绿。
`tests/e2e/blank-session-dock-entry.e2e.ts` 在真机跑过:1 passed。
2026-10-10 00:40:02 +08:00
Menghuan1918 8e3447b27a revert: 回退「只在未展开时显示底部入口」——把「没展开」理解成了底栏,实际是指右侧面板 2026-10-10 00:35:46 +08:00
Menghuan1918 31b11ef3b8 feat(dock): 底部入口只在未展开时出现(展开态交给面板自己的 ×)
产品决定(用户提的):底栏展开后不再显示头部入口 —— 收起由面板页签条右端那个 ×
负责,头部再来一个「收起」既冗余,又多一个「展开态该把入口摆哪儿」的状态。

- `BottomDockToggle`:`bottomOpen === true` 时返回 null(不再切 aria-label /
  aria-pressed,那个「收起」形态整个去掉)。
- `DockFallback`:同样在展开态不渲染(连空壳也省掉)。

顺带的效果:备用入口与宿主 chrome 争位置这件事,只在**未展开**这一个状态下需要处理。

测试:
- `tests/dock-fallback.spec.tsx` 新增「展开态一个入口都没有」用例(9 条全绿)。
- `tests/e2e/blank-session-dock-entry.e2e.ts` 按新语义改写 —— 原先断言展开后
  `data-active='true'`,现在断言**入口退场、屏上 0 个**,并补上「用面板自己的 ×
  收起后,会话头入口回来且仍只有一套」。**真机跑过:1 passed**。

全量 189 文件 / 2215 通过,typecheck / lint 干净。
2026-10-10 00:33:32 +08:00
Menghuan1918 570bebc85e fix(dock): 占位判定改用命中测试 + 多点采样(修「tab 多的时候位置也错误」)
两个真问题:

1. **页签芯片筛不出来**。原先把「占位」定义成 `button, [role="button"]` 的 rect
   相交,而右侧栏的页签芯片不是这两者 —— 页签一多,让位会**停在芯片上**。
   改用 `document.elementsFromPoint`:直接问页面「这一格下面有什么」,
   与宿主用什么标签、什么类名无关。判定为占位的是**不透明的小控件**
   (≤300px 宽:页签芯片、图标胶囊);整行的不透明背景板(会话头 titleRow、
   面板 tabStrip、面板本体)不算 —— 把它们算进去会让入口一路退到屏幕中间
   (实测退到 x=530)。

2. **只测中心点不够**。槽位宽 28px,中心空着不代表右缘不压着邻居:
   实测中心判空、box 却与 Split/Fullscreen 相交。现在沿水平方向采 **5 个点**
   (2 / 8 / 14 / 20 / 26),整格全空才算空;让位步长同时收到 4px。

真机复测(2200px 视口、右侧栏打开、开过页签):
入口落在 `2066`,宿主整簇从 `Split@2094` 起 —— **rect 相交为零**。

判别性:`tests/dock-fallback.spec.tsx` 的芯片用例把命中测试桩成「x > 430 被页签盖住」,
断言入口退到 `404px`;**关掉命中测试即红**
(`expected '464px' to be '404px'`,464 正是压在页签上的位置)。全 8 条绿,
全量 189 文件 / 2214 通过,typecheck / lint 干净。
2026-10-09 23:09:53 +08:00
Menghuan1918 225d814ce5 fix(dock): 备用入口让位要逐个槽位试探,不能只挪一个固定偏移
`fix/dock-toggle-anchor` 让锚点认出了宿主角落控件的**打开形态**
(`data-sidebar-right-toggle`),但当右侧栏打开时那个座位旁边还有同伴:宿主的角落控件
是肩并肩一簇。真机实测(2200px 视口):

    打开态:Split@2094  Fullscreen@2130  Collapse@2166   (各 28px,间隔 8px)

`measure()` 只往锚点左侧挪 `GAP + BUTTON_SIZE = 36px`,于是从 Collapse(2166) 让到
2130 —— **精确压住 Fullscreen**(28x28px 全重叠)。

改为:先按锚点算槽位,然后**逐个槽位左移,直到该槽位与任何宿主按钮都不相交**
(竖直方向真的相交才算占位,最多退 8 格;极窄窗口下停在最左,宁可贴边也不叠)。

真机复测(同一探针、同一视口):

    关闭态:入口 2124..2152,宿主 Open right sidebar@2160        → 零重叠
    打开态:入口 2058..2086,宿主整簇 Split@2094/Fs@2130/Col@2166 → 零重叠

判别性:`tests/dock-fallback.spec.tsx` 再加一条 —— 锚点在 500、紧邻左侧 464..492
站着 Fullscreen,断言入口落在 `428px`;**关掉步进即红**
(`expected '464px' to be '428px'`,即停在 Fullscreen 上)。既有 6 条保持绿;
全量 189 文件 / 2213 通过;typecheck / lint 干净。
2026-10-09 21:36:31 +08:00
Menghuan1918 0dcdb414b9 fix(dock): 备用入口的锚点要认宿主角落控件的两种形态(修压在「收起右侧栏」上)
现象:右侧栏打开时,右上角出现**两个图标叠在一起**——插件的「展开底部面板」压在
宿主的「收起右侧栏」上(用户截图)。

根因:备用入口按宿主角落控件的 rect 左移 `GAP + BUTTON_SIZE = 36px` 定位,但锚点只查
`[data-sidebar-right-expand]`。实测宿主那个座位有两种形态:

- 右侧栏**关闭**:`data-sidebar-right-expand`(aria-label「Open right sidebar」);
- 右侧栏**打开**:该属性**整个消失**,同一座位换成 `data-sidebar-right-toggle`
  (aria-label「Collapse right sidebar」)。

于是右侧栏一打开,`measure()` 找不到锚点、落到视口兜底坐标 `innerWidth - 44` ——
而那里正是宿主自己的角落按钮群(Split / Fullscreen / Collapse)。2200px 视口实测:
入口 = `2156..2184`,宿主 Collapse = `2166..2194` → **重叠 18x26px**,并切到 Fullscreen
2px。与用户截图逐字一致。

修法:锚点选择器同时认两种形态
(`'[data-sidebar-right-expand], [data-sidebar-right-toggle]'`)。

判别性:`tests/dock-fallback.spec.tsx` 新增一条 —— 只挂 `data-sidebar-right-toggle`
的宿主按钮 + 桩掉它的 rect,断言备用入口的 `left` 是 `464px`(= 500-8-28);
**还原锚点即红**:`expected '980px' to be '464px'`(980 = jsdom `innerWidth 1024 - 44`
的兜底值)。全量 189 文件 / 2212 通过;typecheck / lint 干净。
2026-10-09 21:33:39 +08:00
unsc9 ebc5d0b6b7 refactor: 精简 dev 相对 main 新增代码里的重复与白干(行为不变)
dev 分支的新增代码过了一轮「代码精简」审查(复用 / 简化 / 效率 / 修在哪一层四个角度,
分宿主侧、客户端外壳、客户端功能面板三片,另加测试与脚本),这里只落地行为完全不变的那批:

- `runGitRaw` 是 `runGit` 的纯转发别名(三个角度都点到):导出 `runGit`、删掉别名,
  `active-worktree.ts` 与它的 `vi.mock` 键同步改名。
- `open-external.ts` 的 `messageOf` 与 `fs-tree.ts` 的导出逐字相同:删本地实现改 import。
- `fs-operations.ts` 的单段名校验抄了三遍(注释却自称 shared rule):提成
  `assertSingleSegmentName`,rename / mkdir / 新建文件三处共用。
- `fs-tree.ts` 两个探测函数各抄一遍有界并发池:提成 `forEachRow`。
- `index.ts` 自己复刻了一遍 `request/header` 的 provider/model 读取:改调
  `collectModelRoutes(events, 1)[0]`;`lowestReasoningEffortOf` 的三态循环收成
  best/bestRank;`formatModelRoute` 零调用点,删掉(连带自测)。
- `state.ts`:`markUnread` / `clearUnread` 的当前会话路径改走已有的 `reduce`
  (「归约器返回同引用即 no-op」本来就在 reduce 里),删掉私有的 `replaceCurrent`;
  非当前会话那条仍只写内存不落盘,行为未动。
- `editor-dirty.ts`:`DirtyEntry.sessionId` 只服务一个没有生产调用者的
  `dirtyCountForSession`,会话隔离已由 `sessionId::tabId` 这个键承载,两个一起删,
  用例改断 `isEditorDirty(tabId, sessionId)`。
- `FileTree.tsx`:同一批行原先 `renderLevel` 与 `visibleRows` 各排一次,收进按
  `(data, sort)` 记忆的 `entriesFor`(照 `chainFor` 的形状)。
- `dock-fallback.tsx`:500ms 重测出的坐标没变就不换 state 对象(省掉一次无意义重渲染)。
- 其余同形收口:`DiffPane` 的死分支、`terminal-client` 的 `bottomTerminalKey`
  (与 `bottomTerminalContentId` 同值,调用点复用同一个 id)、`SideChatView` 的
  O(线程×目录) 排序扫描降为 Map、`conversation-draft` 的末段路径复用 `paths.baseName`、
  `TreePanel` 的目录命中集按 results 记忆。

验证:`tsc --noEmit` 只剩改动前那 3 条缺 `@xterm/*` 的既有报错;eslint 干净;
全套 vitest 与改动前的失败集合逐条一致(13 条,均为环境原因:缺 xterm 的构建/转换类
3 条、Windows 符号链接权限 3 条、语言字典串味 4 条、真起 git 的冒烟 1 条、文件级 1 条)。
2026-10-09 16:04:24 +08:00
unsc9 9021d1094e fix(client): 草稿守卫按会话记账、折叠行重命名落链尾、16 位小端数据不再当文本
代码审查第一档的三条真实缺陷(都带判别性用例):

- 未保存草稿的注册表改按 `sessionId::tabId` 记账。原生/工作台 id 只在**会话内**唯一
  (每个会话各自铸造 tab1…,工作台对同一文件在各会话复用 editor:<path>),按裸 tab id
  记账时会话 B 的编辑器挂载会报 clean 并删掉会话 A 的记录 —— 记录一没,刷新守卫就放行,
  A 的草稿静默丢失。读/清/确认三个入口都带上会话;不带会话时按「任一会话命中」保守处理
  (宁可多问一次,也不放过活着的草稿)。
- 折叠行(a/b/c 一行)的重命名提交**链尾**:菜单与预填名都指向链尾,提交却用了行渲染所在
  的链头 —— 不改字直接回车会把父目录改名。
- 无 BOM UTF-16 探测加一道「解码结果必须是文本」:16 位小端数据(值域 <256 的采样表/音频
  缓冲)高字节恒 0,与 UTF-16 的 NUL 车道一模一样,被当文本打开后可编辑、保存按 UTF-16
  整份改写(奇数长度还会丢尾字节)。真实 UTF-16 脚本/配置照旧识别。

测试:editor-unsaved-guard 新增跨会话回归两条并改写旧的「同 id 跨会话重指向」语义、
file-tree-compact-fold 新增折叠行重命名落链尾、text-encoding 新增 16 位小端判二进制
(同形状的真文本仍判 UTF-16)。
2026-10-09 15:25:53 +08:00
Menghuan1918 85736b5294 fix(dock): 会话头入口在场时,空白会话的底部入口让位(修「展开底栏」叠成两个)
现象:右上角出现**两个**「展开底部面板」按钮,精确重叠成一团(用户截图)。

根因:两套入口的互斥只靠 `session.phase`,而相位是**每 1s 轮询**来的、会话头入口
由宿主自行决定何时渲染 —— 两者之间必然有窗口;更糟的是相位路由失读时按「非 blank」
降级,一个从未成功读到的会话可能长期停在 blank。而两套入口在版面上**就是同一个
位置**(备用入口按宿主「Open right sidebar」的 rect 左移 8+28px),同时在场即重叠。

修法:在相位之外再加一条**与相位无关**的兜底 —— 只要 DOM 里存在一个不在
`[data-dsh-dock-fallback]` 内的 `[data-dsh-bottom-toggle]`(即会话头那套入口真的
渲染了),备用入口就让位。判定挂在既有的 500ms 位置对齐节拍上(resize 时也刷新),
因此最多 500ms 的让位延迟。

判别性:`tests/dock-fallback.spec.tsx` 新增「造出『相位说 blank + 会话头入口在场』
的不一致状态」用例 —— **还原守卫即红**(`会话头入口在场时备用入口必须让位:
expected <span…> to be null`);另 4 条既有用例(blank 渲染 / 非 blank 不渲染 /
相位未知不渲染 / 路由不支持降级)保持绿。typecheck / lint 干净。
2026-10-09 10:29:10 +08:00
Menghuan1918 e656d5ba11 test(editor-host): 条件等待前先给一个宏任务边界,预算抬到 10s
`05d259cc` 把 `waitForTreeRow` 换成显式条件预算后,CI 上仍然红了一次,而且这次
**整整耗光了 5s**(5044ms,`vi.waitFor.timeout tests/editor-host.spec.tsx:89`),
下一轮同样的代码又是绿的 —— 说明问题不只是「预算太小」,而是那一轮里树的那次
flush 根本没被排上。

mount helper(`mountHostWithTreeWithCwd` 等)只 drain 两个微任务,而负载下 React
把异步 `fs.trees` 应答引发的 `setState` + flush 整个推迟到微任务之后是完全可能的
(`630d10f` 的提交信息已经记下这个机制)。所以现在在条件等待之前先让出一个**宏任务
边界**,给那次被推迟的 flush 一个真正运行的机会,再把预算放在 10s(仍在套件
`testTimeout: 15s` 之下,真正列不出该行时照样红在断言上,而不是红在测试时钟上)。

纯测试改动;本机 `tests/editor-host.spec.tsx` 14/14 绿。
2026-10-08 22:46:27 +08:00
Menghuan1918 45285014d9 merge fix/826-file-link-line-jump into dev(#826 第二半:行号不再被解析完就扔掉。两种写法合流到同一个字段——#L131 由宿主解析成 navigation.params.line、path:131 由插件在 path-line.ts 切出,都落到 SidebarTab.line,再经 FileViewerProps.line 交给 viewer;TextEditor 到达时定位一次并高亮,越界钳到最后一行,区间只取起始行。line 是瞬态(sanitizePersistedTab 白名单不含它,刷新不把读者拽回旧行);markdown/html 收到行号先强制切到编辑态再定位,避开预览自己的挂载滚动恢复。公开面是纯增量:FileViewerProps.line?: number)
# Conflicts:
#	docs/external-plugin-guide.md
2026-10-08 22:20:45 +08:00
Menghuan1918 698721eb34 merge fix/desktop-shell-http-base into dev(桌面壳的 HTTP 与 WebSocket 需要不同基址:壳把页面放在 dsh-app://app/、注入的 streamBaseUrl 指向另一个 origin,而壳的 protocol.handle 会把非静态 dsh-app 路径同源转发给宿主——插件的 JSON 路由不带 CORS 头,发到注入 origin 就是跨源、被浏览器直接拒(满屏 Failed to fetch);于是 HTTP 改骑页面基址 hostHttpBase()(document.baseURI,反代前缀也带在里面),WebSocket 继续用注入 origin。含 base-path 三种场景的用例) 2026-10-08 21:58:34 +08:00
Menghuan1918 d241faf8ea merge fix/editor-reveal-remeasure into dev(#837 后续:宿主用 MOVED 的方式 park/还原 tab body,移动节点不改变 border box,所以只看 box 变化的 ResizeObserver 永远不触发——一个在隐藏宿主里被打开的编辑器会把视口量成 0 并一直留着空白的虚拟视口(行号槽还在画,正文空)。改为每次「显现」都重新测量:IntersectionObserver 报显现本身、rAF 兜住与挂载同帧的那次显现,另接 visibilitychange / window resize;全部可缺省且逐个 dispose) 2026-10-08 21:58:34 +08:00
Menghuan1918 5d259cca61 test(editor-host): 慢 runner 上给「等树渲染出行」一个 5s 条件预算
CI(ubuntu lane,2 核、与 184 个文件并行)稳定红在
`tests/editor-host.spec.tsx > EditorHost native-tab context-menu actions >
keeps the bottom-workbench split for a tab that lives there`,签名是
`AssertionError: expected false to be true`、落在 **spec:74**(`waitForTreeRow`
里的 `expect(found).toBe(true)`),耗时 ~1026ms —— 正好是 `vi.waitFor` 的
**默认 1000ms**。

根因不是产品缺陷,而是预算错配:`vi.waitFor` 的默认超时与套件的
`testTimeout`(15s,当年为 Windows lane 的真实子进程抬的)**互不相干**,仍是 1s。
上次 `630d10f` 已经把这个 helper 从「drain 微任务」改成「等真实渲染条件」,但条件
等待的预算没跟着抬,于是一旦 `fs.trees` 的应答 + React flush 越过 1s(满载的
2 核 runner 上很容易),断言还是先超时。

本机复现(往 `fs.trees` mock 注入 1200ms):
- 默认 1s 预算 → 1049ms 红,签名与 CI 逐字相同;
- 5s 预算 → 1296ms 绿。

仍是**条件**等待而不是固定时长:行一渲染出来就返回;树永远列不出该行时用例照样
失败(只是从 1s 变成 5s),`630d10f` 的反判别性检查继续成立。测试改动,产品代码
零改动。同一暴露面还有 7 处 `vi.waitFor` 未给预算(`zip.spec.ts` ×4 /
`dock-fallback.spec.tsx` ×2 / 本文件外),暂未在 lane 上翻车,未一并改动。
2026-10-08 21:58:13 +08:00
Menghuan1918 657f75c1be merge fix/session-scope-write-guard into dev(#848 会话切换不再把上一个项目的写操作带进新项目:文件树选中集/菜单/内联编辑器/确认框随会话与 cwd 一起失效,批量删除与打包构建按 generation 退役结算;含收尾修正——删除确认与拖拽上传改在**调用点**复核 armed scope,关掉「swap 已提交、passive effect 未 flush」之间那个仍会把 B 的 scope 配 A 的绝对路径发出去的丢数据窗口)
# Conflicts:
#	src/client/FileTree.tsx
2026-10-08 21:56:03 +08:00
Menghuan1918 62c1a0cc63 fix(safety): 删除确认与拖拽上传在调用点校验自己的 scope(#848 收尾)
独立正确性评审在 PR #853 上复现出一个**仍然丢数据**的窗口,本提交把它关掉:

**HIGH|单行删除**:`confirmDelete` 只装 `{path, isDir, name}`,scope 在确认时现读。
换会话的清理写在 **passive** effect 里,而点击可以落在「swap 已提交、effect 尚未
flush」之间 —— 此时 `propsRef.current` 已经是新会话。实测(`flushSync` 提交 swap
后立刻点那个仍挂在 DOM 上的 Confirm):

```
fsRemove({sessionId:'s2',cwd:'/projects/beta'}, '/projects/alpha/a.ts')
```

宿主对绝对路径原样执行(包含性检查是刻意移除的),于是**删掉的是上一个项目的文件**,
正是本 PR 要修的那件事。批量走的第一次 `fsRemove` 同样直接发在点击处理器里。

修法是把「armed 时的 scope」随确认一起存下来,并在**调用点**复核(`sameScope`):
单行删除存进 `confirmDelete.scope`,批量把 `confirmDeleteSelected` 从 boolean 换成
`FsScope | null`;不一致就整条请求不发(fail closed),请求本身用 armed scope,
scope 与 path 因此永远属于同一个项目。同时在途结算也按 `scopeGenRef` 退役,
不再把结果写进已经换过的项目。

**MEDIUM|拖拽上传**:`reportDrop` 的 `uploadItemsFromDrop(...).then` 里用的是**最新**
props 的 `onUploadRequest`,而 `dir` 是拖拽开始时的旧路径 —— 一次落点会把这批文件
传进新项目的树里。现在同样 armed/复核,不一致即丢弃。

测试:`tests/file-tree-session-scope.spec.tsx` 新增两条 —— 上面那条窗口的判别性用例
(**还原守卫即红**:`expected "vi.fn()" to not be called at all, but actually been
called 1 times`)与一条正向对照,钉住「请求里的 scope 与 path 必须同源」(只数调用
次数抓不到 scope 被换掉的回归)。typecheck / lint 干净,该 spec 6/6 绿。
2026-10-08 21:55:12 +08:00
Menghuan1918 06dff2f56e merge fix/871-preserve-eol into dev(#871 保存保持文件原有行尾:宿主侧在 fs.write 的唯一咽喉点先按盘上内容嗅探行尾(4096 字符多数表决,与宿主 dsh-fs-local 的 detectLineEndings 同判据),写回时按同一判定归一化,CRLF 文件不再被写成 LF 而产出整文件 diff;mtime 冲突基线、fs-conflict 横幅与 #855 的 dirty/编辑态跳过语义均不变)
# Conflicts:
#	CHANGELOG.md
2026-10-08 21:52:00 +08:00
Menghuan1918 ec26c6892b fix(fs-search): 合并收尾——点前缀手势的反斜杠按平台门控(#879)
`isDirectPathQuery` 的 `/^\.+[/\\]/` 没有做平台门控:POSIX 上 `.\notes` 是
**合法文件名**(点 + 反斜杠,两部分都是名字字符),却被判成「点前缀相对路径」
送进 `resolveTarget`,stat 一个不可能存在的路径 → 必然空结果,同时丢掉名字查询
与引擎资格。现改为平台门控的 `DOT_ANCHORED_RE`(win32 才收 `\`),并把分隔符
判定收敛到共享的 `SEPARATOR_RE`,`hasSeparator` 与它同源、不会再分叉。

判别性:新增用例 `a dot-prefixed POSIX name with a backslash stays a name query`,
还原实现即红(`matches` 由 `['.\\notes.md']` 变 `[]`、`probed` 由 true 变 false)。
`tests/fs-search.spec.ts` 31 条 + `tests/search-engines.spec.ts` 38 条全绿。

顺带:`src/search-engines.ts` 的 `close` 结算注释原写「timeout/error 的结算
在下面」,实际两者注册在上面(:282/:283),改正方向。
2026-10-08 21:48:13 +08:00
Menghuan1918 e655bf2e44 merge fix/879-fs-search-path-query into dev(#879 搜索框粘贴路径结构性零命中:searchFiles 按查询形态分流——指名单一目标(绝对路径 / ~ / ./ / ../)经 resolveTarget stat 直取、缺失立即空结果不再烧 10 万预算,含分隔符的相对片段按根相对路径匹配,普通名字查询原样不变;SKIP_DIR_NAMES 补 .worktrees/.worktree/target/venv/.venv/__pycache__,walk 与两条引擎 argv 共用。含客户端「工作区外目录命中行只清空查询」守卫)
# Conflicts:
#	CHANGELOG.md
2026-10-08 21:47:02 +08:00
finley08 fc61cddc16 fix(routes): HTTP routes ride the page base again — the desktop shell is cross-origin to the injected transport origin
The prefix fix routed every route through `__DSH_TRANSPORT__.streamBaseUrl`.
For WebSockets that base is required (a custom scheme cannot host `ws:`, and
the shell page's host is the literal `app`, whose DNS lookup never completes),
but for HTTP it is a DIFFERENT origin than the page: the Electron shell serves
the GUI from `dsh-app://app/` while `streamBaseUrl` is the Host's
`http://127.0.0.1:<port>` (`streamBaseUrl: new URL(hostUrl).origin` in the
shell's `main.js`, via `DESKTOP_IPC.boot`).

Measured on DSH 0.2.0-rc.2 + Electron shell:
- `OPTIONS /sidebar/api/fs.trees` (Origin: dsh-app://app, preflight for the
  plugin's JSON POSTs) → `405 method not allowed`, no `Access-Control-Allow-*`
  header; the actual POST answers `400` with no CORS header either.
- The shell's `protocol.handle('dsh-app', …)` forwards every NON-STATIC
  `dsh-app://app` path to the Host (`forwardWebRequest(request, hostUrl,
  hostCookie)`), so `dsh-app://app/sidebar/api/…` reaches the Host same-origin —
  the exact shape `fetch('/sidebar/api/…')` produced before the prefix fix.

Consequence in the desktop window: every plugin request is blocked by the
browser and surfaces as "Failed to fetch" — file tree (the whole sidebar body),
git, editor, uploads, archive, chunk loading. The web profile in a browser is
unaffected (there the page origin IS the transport origin), which is why the
mount lane cannot see it.

HTTP now resolves against `document.baseURI` — which carries a reverse-proxy
directory prefix too, so one rule covers both deployments — and falls back to
the transport base when no page base exists (specs / SSR). WebSockets keep the
transport base. `tests/base-path.spec.ts` pins the split per transport,
including the shell case and the no-page-base fallback.
2026-10-08 11:39:11 +08:00
finley08 b0d354f209 fix(editor): re-measure a revealed editor even when its host is only MOVED
The native right sidebar parks a `keepMounted` tab body through the host's
`retainTab` path, which moves the body into a hidden seat and back. Moving a
node never changes its border box, so the `ResizeObserver` added in #837
(d3df20e / db563ca) is never called for that path: a CodeMirror view created
while its host was hidden keeps the zero-sized viewport it measured, and the
editor stays visually blank — gutter line numbers drawn, document body empty —
until the tab is remounted. Observed on DSH 0.2.0-rc.2 + the Electron shell
with a `.yaml` file opened from the file tree while another tab was active: the
buffer holds the text (select-all copies it), only the paint is missing.

Three additive recoveries, next to the existing measure:

- `IntersectionObserver` on the host — reports the reveal itself, so a body
  that was merely moved is re-measured (the box need not change).
- a `requestAnimationFrame` follow-up after mount — a reveal that lands in the
  mount's own frame happens after CodeMirror's first measure read a zero box.
- `visibilitychange` / `window resize` — the document-level equivalents.

A non-intersecting report spends nothing, so pane scrolling does not queue
measures. `tests/text-editor-visibility.spec.tsx` gains a case for the
size-preserving reveal (and pins that the invisible report is ignored); the
existing ResizeObserver cases are unchanged.
2026-10-08 08:14:34 +08:00
kelvinwww 731964ede6 fix: 解析本轮文件的完整路径 2026-10-07 12:24:38 +08:00
NolanHo 6497046c9e fix(search-engines): settle streamLines on close, propagate fd dirs-run failures (#883)
streamLines settled its promise on the child's 'exit' event. Node fires
'exit' the moment the process dies, while the stdout pipe may still hold
undrained data — under host load the exit event can win that race and the
promise resolved with a still-empty lines array. fd's second --type d run
was the common victim (both children race, the match run usually drains
first), so the observable signature was matches intact with dirs: [] —
directory hits silently degraded into open-as-file errors, the exact
error surface #801 fixed, now intermittent.

Settlement moves to 'close' (process dead AND stdio drained, so every
readline line event has fired). The truncation kill, the timeout and the
spawn-error paths keep their semantics: whichever finish() ran first
sets the closed flag and the close handler is idempotent. The --version
probe keeps 'exit' — its stdio is 'ignore', the exit code is the only
signal it reads.

The fd branch also no longer swallows the directory run's failure: the
.catch(() => empty dir list) is deleted, so a rejection now reaches
runEngine's existing broken-marking and this one search falls back to
the plain walk — symmetric with the main run, where the old catch
degraded every failure into an invisible "zero directories".

Evidence: on an fd-equipped Linux host the real-engine suite reproduced
7/30 runs on clean dev (signature constant), 0/30 after the one-line
close change; upstream CI never saw it (ubuntu lane has no fd; ci-windows
runs serially). Two deterministic cases now pin the contracts through the
new spawner hook (scripted PassThrough children replay the racy event
order directly); each was verified red by temporarily reverting the
corresponding half of the fix.
2026-10-06 10:50:51 -07:00
kelvinwww 96e5a2cb87 fix: 减少 changes.ops 空窗重复请求 2026-10-07 00:53:36 +08:00
HuanLinOTO 3d6d55d2ea feat(catalog): 预览插件目录收录音频预览插件(dsh-plugin-better-sidebar-plugin-audio)
- src/client/plugins-viewers.ts:新增 PluginEntry,设置页「添加插件」弹窗的预览插件目录可一键复制安装命令
- i18n:pluginAudioName / pluginAudioDesc 同步全部 20 份词典(zh/en + 19 份第三语言),key 集合由 tests/locales.spec.ts 守护
- tests/plugin-list.spec.ts:该条目写进目录清单断言
- README.md / README_EN.md:预览插件表格 3 → 4

验证:pnpm typecheck 通过;vitest run tests/locales.spec.ts tests/plugin-list.spec.ts 全绿(29 用例)。本机全量 pnpm test 的 7 个失败与本改动无关(tasks-model 语言回退 / git / plugin-meta 打包 / editor-host),已在未改动的 dev 上复现同一失败集合。
2026-10-07 00:31:16 +08:00
NolanHo 0d9fee85b8 fix(fs-search): direct-open for pasted paths + fragment path matching (#879)
A query carrying a path separator can never match an entry NAME — names
never contain separators — so pasting any path into the search box was
structurally guaranteed to return {matches:[],truncated:true} while the
walk burned its full 100k-visit budget (measured: 1.9s on a Rust repo
whose two worktree forests alone held 97k entries; real directories were
never reached).

searchFiles now routes by query shape, all three modalities sharing one
result contract:

- A query naming one path (absolute, ~/…, ./x, ../x) resolves through
  resolveTarget — the SAME primitive fs.read uses, so ~ expands (#713),
  dot-anchored spellings join onto the session cwd, and win32
  WSL/dsh-remote namespaces reinterpret — then stats the target. The hit
  is the RESOLVED path (resolve() strips shell-completion trailing
  separators, which the client's exact-string row comparisons could never
  match); a missing target answers empty immediately. Directory targets
  ride the #801 dirs contract. The exclude pref does not apply: a pasted
  path is explicit intent, same as the fs.read the click performs.
- A separator-carrying relative fragment (records/exp1) matches by
  root-relative PATH in the walk; the engines are name matchers (fd has
  no --full-path here, rg's globs are single-segment) so argv
  construction is untouched.
- Plain name queries are unchanged, and no NAME query is stolen: on
  POSIX a backslash is a name character (the ~\ gesture counts only on
  win32; util.ts~ / ~$doc.docx / .env stay name queries).

SKIP_DIR_NAMES gains the budget-eating forests seen in the wild:
.worktrees/.worktree (git worktree layouts), target, venv/.venv and
__pycache__ — shared by the walk and both engine argvs as before.

Client: a directory hit OUTSIDE the cwd (newly reachable via the paste
branch) only clears the query — the tree is cwd-rooted, and the old
ancestorDirs call synthesized junk expanded entries for foreign paths.

Verified: vitest fs-search/smoke/search-persist suites green; full run
2171 passed with one failure proven pre-existing on the clean tree
(git.spec checkout case, host git lacks --end-of-options; #841);
typecheck/lint clean.
2026-10-06 08:25:30 -07:00
ymac 419d1c4b67 fix(editor): 保存保持文件原有行尾,不再把 CRLF 文件写成 LF(#871)
编辑器传送的永远是 LF 文档(CodeMirror 没有别的行模型),`fs.write` 原样落盘,
于是在 Windows 检出上「改一行」= 整文件 diff。

- `text-encoding.ts`:`encodingOfFile` 扩成 `fileFormatOf(path)`,同一趟 64 KiB sniff
  同时给出 `{ encoding, eol }`;新增 `detectEol` / `restoreEol`(口径与宿主
  dsh-fs-local 的 detectLineEndings / restoreLineEndings 一致:前 4096 字符多数票、
  孤立 \r 不计票也不改写、还原前先归一化以免 \r\r\n)。
- `index.ts` 的 `fs.write`:落盘改为 `encodeText(restoreEol(content, eol), encoding)`。
  客户端零改动,所有保存入口自动覆盖;新文件仍是 UTF-8 + LF(项目级行尾约定另议)。
- 测试:text-encoding 补 3 条、fs-write-route 补 3 条端到端;拿掉 restoreEol 调用即 2 条红。
- 文档:设计文档 docs/plans/2026-10-06-preserve-eol-on-save.md、CHANGELOG、AGENTS §5 保存语义。

顺带核实(写进设计文档):宿主 `edit` 工具会保住行尾(editText 走 restoreLineEndings),
宿主 `write` 工具不会(writeText 原样写模型文本),那一半插件无权干预。
2026-10-06 15:36:36 +08:00
Menghuan1918 630d10fb54 test(editor-host): 等文件树真的渲染出该行再断言(修慢 runner 上的加载竞态)
两个 mount helper 只 drain 微任务,而文件树层级缓存由异步 fs.trees 应答填充:一旦那次刷新
被排成宏任务,helper 返回时树仍在 loading 行,断言就找不到 [class*="explorerName"](CI 上
names= 为空 / 本地注入延迟时 names=tmp,CI 只报了第一个挂掉的用例,同一模式实际影响 3 个)。

改为 vi.waitFor 等待真实渲染条件(不是调大固定超时):树真列不出该行时仍按 1s 超时失败——
反判别性检查(把 mock 里的 a.ts 换成永不出现的 b.ts)确认 3 个用例仍会在 1.0s 内失败。
300ms 宏任务注入下:修复前 5/5 轮全红(各 3 用例)→ 修复后 5/5 轮全绿 14/14。

纯测试改动,产品代码零改动(与 #855 无关:把 EditorHost.tsx 单独 revert 到 #855 之前,
同一探针仍 3/3 轮全红、文本逐字相同)。
2026-10-06 01:19:38 +08:00
Menghuan1918 0ee870ade2 merge fix/crlf-markdown-surface into dev(修 CRLF 输入下的三层 \r 误判与预览双拼写渲染:markdown-html 的 isBlank / mermaid-blocks 的 CLOSE_FENCE_RE / markdown-code 的 closesFence 把 \r 当内容,导致 HTML 段永不终止、mermaid 围栏吞掉余下文件、链接改写从第一个围栏起全部失效;TextEditor 的 draft 快照把 CodeMirror 归一化后的 LF 文档覆盖预览源,使挂载那一趟写入的标题 id 被丢弃。含测试脚手架 CRLF 安全化与 9 条 CRLF≡LF 判别性用例) 2026-10-06 00:57:35 +08:00
Menghuan1918 dc04efaabf test(editor): #855 收尾——补 read 与 opBaseline 两条判别性守护
独立验证节点列出的两处测试盲区,逐条补判别性用例(12 → 14 例):

- **「只认 write/edit」这半个判据此前无守护**(变异:把命中判据放行
  `kind === 'read'` 后原有 12 例全绿)。新增「B: 模型 read 本文件零重读」:
  读出的是最近一次「模型读这个文件」的调用,字节没变,任何重读都是多余。
  变异复验:放行 `read` → 仅该例红(`expected 2 to be 1`),其余 13 例绿。
- **`EditorHost` 的 `opBaseline` 守卫此前未被判别**(变异:放松守卫后原有
  12 例全绿)。新增「I: 重新定向到刚被 touch 的路径不重复读」:同一 tab
  切到刚被模型写过的路径时,它自己的加载就是那次写入的新鲜读数,不得再重读
  重挂(否则滚动位置在字节相同时被丢掉)。变异复验:只留 `null` 判断、不再
  按路径比对基线 → 仅该例红(`expected 2 to be 1`),其余 13 例(含原有
  12 例)绿 → **保留守卫**,不是「只省一次多余重读」。
  附注:把守卫连同消费行一起删掉是更狠的变异,会在这条例上变成重载自旋
  (隔离运行 15s 超时),全量跑还会因该自旋污染后续用例——两个变异都只用于
  取证,源码已逐字节还原(`git diff --exit-code` 干净)。
2026-10-06 00:55:49 +08:00
Menghuan1918 ee5be9b601 fix(markdown): read a CRLF document exactly like its LF twin (#363)
The markdown pipeline's line-based scanners split on `\n` and then reason
about each line, so a Windows checkout (`core.autocrlf=true` — the
`ci-windows` lane) broke three of them at once:

- `splitHtmlBlocks`'s blank-line test (`/^[ \t]*$/`) read a CRLF blank line
  (`'\r'`) as content, so an HTML run never ended: on this repo's own README
  the splitter produced 4 segments instead of 36, and the markdown after a
  `<div>` run was rendered as raw text.
- `CLOSE_FENCE_RE` (`[ \t]*$`) never matched a CRLF closing fence, so
  `splitMermaidBlocks` swallowed the rest of the file and the splitter's own
  open-fence state never closed.
- `closesFence` (`/^[ \t]*$/`) left every CRLF fence open, so
  `maskCodeRegions` masked from the first fence to the end of the file and
  the link rewriter stopped claiming every `.md` link after it (first
  divergence on README.md: `./CHANGELOG.md%23v0230`, claimed under LF, left
  as an inert `#v0230` destination under CRLF).

The editor preview rendered the document twice as well: its draft snapshot
publishes CodeMirror's live document — always LF, whatever the file used —
one commit after mount, and that CRLF→LF re-render makes the host rebuild the
markdown elements whose text changed, discarding the heading ids the surface
pass had just written (the MutationObserver only heals them a microtask
later). Line endings are not an edit: the snapshot now keeps `draft` null
while the live document is the loaded content under any line-ending spelling.

Tests: `scanDocumentAnchors` and the README TOC slice split on `/\r?\n/`;
tests/markdown-crlf.spec.ts pins the CRLF≡LF invariant across the splitter,
the mask, both rewriters and the mermaid splitter, and two surface cases
mount a CRLF document through the real renderer — one of them a CRLF copy of
the README, so every lane exercises the spelling only `ci-windows` checks
out. Reverting the `\r` fixes turns nine of them red.
2026-10-06 00:54:24 +08:00
Menghuan1918 1748c7b0d4 feat(editor): LLM 改完文件后自动刷新正在看的预览(#855)
模型在会话里 write/edit 一个正开着的文件后,侧栏里仍是旧内容,只能手点刷新或
关掉重开——加载 effect 的依赖里没有任何一项会因写盘而变化,keepMounted 又让
切走再切回不重挂。

信号源用插件自有的 `changes.ops` 增量流(宿主按 seq > afterSeq 下发 tool/call +
tool/result,客户端折成文件操作),不新增第二个轮询机制:没有 fs.watch,也没有
任何周期性的 fsRead 指纹轮询。

- 新增 src/client/ops-stream.ts:每会话一条流 + 成员选举一个 leader,只有 leader
  跑 usePolling(self-scheduling,2.5s,与文件变动页会话透镜同一路由同一节奏)。
  一个会话开 N 个编辑器 tab 每 tick 仍只有 1 个 changes.ops 请求;成员全部离开即
  停轮询但保留游标与已发布状态,页签回来时补折离开期间错过的增量。
- 只发布结算成功的 write/edit(running === false && !isError);第一帧是基线,
  打开前已结算的写入一律不触发。
- 命中判定 fileOpKey(cwd, path):resolveSidebarPath 归一相对路径 + `.`/`..` 词法
  折叠 + 分隔符统一 + Windows 盘符/UNC 大小写折叠。
- EditorHost:命中且非 dirty、非编辑态时 setReloadSeq(+1)——复用页头刷新按钮那条
  完全相同的加载路径,手动入口原样保留。脏态优先:dirty 时绝不覆盖用户输入。

测试 tests/editor-auto-refresh.spec.tsx(12 例,jsdom + 假计时器),逐条做了
「还原源码即红」的变异验证;#167 的既有 4 条未改动。
docs:接入指南 §5.2 与行为差异表、CHANGELOG、设计文档。
2026-10-06 00:34:42 +08:00
Menghuan1918 76cf851a45 merge feat/363-md-cross-file-anchors into dev(#363 Markdown 跨文件 / 锚点导航:官方 MarkdownDelegateProvider + %23 片段载体认领本地 .md 链接、标题获得与 GitHub 一致的 slug id、空锚点隐藏、跨文件待处理锚点表;含验证 reject 后的修复:slug 不 trim/不折叠空白/删 VS16 使两份 README 的 TOC 锚点 0/15→15/15、共享围栏 mask 修 ~~~ 与图片 pass 的既有盲区、滚动宿主祖先分支的 shipped 用例)
# Conflicts:
#	CHANGELOG.md
2026-10-06 00:19:47 +08:00
Menghuan1918 fab329d469 fix(markdown): match GitHub's heading slug and mask ~~~ fences (#363)
Two defects the independent verification rejected, plus the test gaps they
left behind.

1. `githubHeadingSlug` was not GitHub's slugger. It trimmed and collapsed
   whitespace runs (GitHub does neither: every space becomes its own dash) and
   kept `\p{M}`, which left the variation selector of `🖼️` inside the id. The
   consequence was the issue's main scenario: the repo's OWN READMEs resolved
   **0 of 15** table-of-contents anchors, and the click was claimed yet did
   nothing (`scrollTop` stayed 0). The slug is now `toLowerCase()`, drop
   pictographs / `\uFE00-\uFE0F` / regional indicators / `\p{C}`, drop
   everything that is not a letter, digit, combining mark, space, `-` or `_`,
   then each space → `-`. Emoji are removed here because GitHub removes them
   while RENDERING the heading (to `<img>`) before its slugger runs; that is
   the one deliberate difference from `github-slugger`, and it is what turns
   `🚀 安装` into GitHub's real `-安装`.

2. Both source rewriters inlined a fence mask that only recognised ```, so a
   link or image demonstrated inside a `~~~` fence was rewritten
   (`[y](./b.md#u)` → `[y](./b.md%23u)`; the image half predates this feature:
   `rewriteLocalImageUrls('~~~\n![i](./p.png)\n~~~')` already produced a
   `/sidebar/file` URL on 58d7f71). One shared mask now lives in
   `src/client/markdown-code.ts` (CommonMark: 3+ backticks OR 3+ tildes, a
   closing fence no shorter than its opener, an unclosed fence running to the
   end of the text) and both passes use it.

Evidence (all on the merged tree, HEAD after `git merge origin/dev`):
- Real `TextEditor` + real host `MarkdownText`, every TOC anchor clicked:
  README.md `0/15 → 15/15`, README_EN.md `0/15 → 15/15` (shipped as a case in
  tests/markdown-surface.spec.tsx; the id-level counts are 0/16 → 16/16).
- Parity against the actual `github-slugger@2.0.0` regex (vendored in
  tests/helpers/github-slug-reference.ts), plus explicit emoji/VS16 cases.
- Mutation: restoring the old trim+collapse+`\p{M}` slug reddens 9 cases
  (both README cases included); dropping the tilde fence reddens the new
  fence case in BOTH the link and the image spec; forcing `scrollHostFor` to
  return the container reddens the two new ancestor-scroller cases.
- `scrollHostFor`'s ancestor branch was unreachable from the shipped suite
  (the mutation above used to leave 33/33 green): tests/markdown-surface.spec.tsx
  now injects the computed style (`overflowY: auto` + `scrollHeight`/
  `clientHeight`) and asserts the write lands on the ancestor, that neither
  `window.scrollTo` nor `scrollIntoView` is called, and that the container's
  own `scrollTop` is never written.

Also: the untrue "exactly like GitHub does" comment, four-form fence cases per
pass (``` / ```` / ~~~ / an inline span inside ~~~), a CHANGELOG entry, and the
recorded narrow edges (a destination with an escaped parenthesis or a
single-quoted title is not claimed — plain text, unchanged; `#L24` does not
jump to a line).

Gates: typecheck / lint clean, `vitest run --maxWorkers=3` 182 files, 2120
passed | 13 skipped; `pnpm build` complete; mount lane
(`DSH_CMD='npx -y --package @deepseek-ai/dsh@0.2.0-rc.1 dsh' pnpm test:mount`)
9 passed (2.0m), exit 0. The bare `pnpm test:mount` now dies in preflight
because the installed CLI is 0.2.0-rc.2 while the baseline pins 0.2.0-rc.1;
the lane count is 9 rather than the verifier's 11 because merging origin/dev
removed the two WCO/preset cases with the titleBar mechanism.
2026-10-06 00:19:11 +08:00