Commit Graph
149 Commits
Author SHA1 Message Date
taekchef cd1251be2d feat: prepare Sidebar 0.29.0 GenUI provider release 2026-10-28 14:48:08 +08:00
taekchef 60c3fff158 merge: integrate Sidebar provider PR #1033 with current dev 2026-10-28 14:40:13 +08:00
Menghuan1918 e3d32cde42 chore(release): prepare v0.28.2
- bump package.json / dsh.plugin.json / SIDEBAR_SERVICE_VERSION to 0.28.2
- CHANGELOG: v0.28.2 (cold cwd from the stored workspace header) with the
  measured numbers; CHANGELOG_EN mirrors it
- README / README_ZH: install commands and installer args target 0.28.2;
  Recent Updates trimmed to v0.28.2 / v0.28.1 / v0.28.0
- AGENTS + external-plugin-guide: current stable version is v0.28.2
- plan record: 40,157,518-byte session benchmark (1 header read, 0 full
  reads, 3 ms, +0.3 MB RSS; pre-fix 6 calls = 6 full reads, +1.0 GB peak)
2026-10-27 22:58:01 +08:00
taekchef fc717fbbff merge origin/main into genui-sidechat-surface: keep main's row-level rewrite pass and streaming parse inside the GenUI row component 2026-10-27 11:39:58 +08:00
Menghuan1918 f7a11ddbfe fix(host): root a detached session at its stored header, not a full log read
cwdOf() resolves the cwd for every file/Git route, and a cold (detached)
session paid one host observation per call: sessionQuery.observeSession({
projectionMode: 'all' }) decodes the whole zstd artifact and hydrates every
projection to answer with one workingDirectory string. The 0.28.1
single-flight only covered /sidebar/api, while the real startup fan-out
never goes through it: the fs-watch socket sends one frame PER WATCHED
DIRECTORY (server resolves cwd before it even reads the op), /sidebar/file
and /sidebar/html resolve per resource, upload/write per call. A 39 MB
session was therefore decoded dozens of times in parallel — the 44-read
OOM on 0.28.0 and the 36 reads reported against 0.28.1 are the same path,
not a broken dedupe.

A detached session now resolves through sessionPersistence.stat(), which
reads the first zstd frame only (header-only, never the log), memoized per
session id (headers are immutable) and shared in-flight across concurrent
asks. activeWorktreeRootOf() answers a detached session with that address
and no longer folds the stored log. Once the host attaches the session the
committed working_directory and linked-worktree following resume as before.

Trade-off (documented): until attach, the sidebar roots at the original
project rather than the agent's last directory/worktree.

tests/smoke.spec.ts rewrites the cwd group (header ahead of a stale hint,
one header read per session, 12 concurrent asks share one, stat absent or
failing falls back to the hint, live committed directory wins, relative
header cwd still refused) and tests/active-worktree.spec.ts pins that a
detached session performs no persistence read and no git probe.
2026-10-27 11:36:09 +08:00
Menghuan1918 8ee6e8de27 chore(release): prepare v0.28.1
- bump package.json / dsh.plugin.json / SIDEBAR_SERVICE_VERSION to 0.28.1
- CHANGELOG: 未发布 → v0.28.1; CHANGELOG_EN gains the v0.28.1 summary
- README / README_ZH: install commands target 0.28.1; Recent Updates
  trimmed to v0.28.1 / v0.28.0 / v0.27.0; Git screenshot alt + tags note
- refresh docs/screenshots/files-tree.png and changes-tree.png from a
  neutral demo workspace (git colors + tag pills in the commit graph)
- AGENTS + external-plugin-guide: current stable version is v0.28.1
2026-10-26 17:43:39 +08:00
Menghuan1918 5bacf5fa0c 修复提交图标签缺失并校验标签分页快照 2026-10-26 15:19:02 +08:00
Menghuan1918 8c08758afd merge #956: fix(sidebar): worktree 会话的根选择与地址基准(#947 / #950 / #952) 2026-10-26 15:00:57 +08:00
Menghuan1918 22eb6ebddf merge #929: fix(tree): 改名/删除的调解覆盖后台会话的页签 + 标题只在派生自文件名时跟随(#915 后续) 2026-10-26 15:00:55 +08:00
Menghuan1918 787d873a8c fix(tasks): restore graph expansion and configurable branch folding
Reset per-gesture travel before node guards so a preceding background pan cannot suppress the next card click. Index and iteratively lay out graph topology, memoize agent card contents, and project complete settled branches under independent existing-settings preferences.

Keep unknown real workflow catalogs and explicitly opened descendant paths visible. Add regression coverage and real rc.1 browser/baseline validation evidence.
2026-10-23 12:38:23 +08:00
路从今夜白 9a11166c92 feat(sidechat): expose opt-in transcript surfaces for GenUI 2026-10-22 21:22:25 +08:00
ymac 099128d1b6 merge origin/dev into fix/worktree-root-address-base
四处冲突,都不是「选一边」能了事的:

1) `src/active-worktree.ts` 的头注释:上游这半个月把模块重写了一遍(cwd 解析收敛:
   TTL 15s、在飞去重、三个缓存加 LRU 上界、`working-directory/change` 作为证据边界),
   本分支加的是「工作区内只有同仓库的 linked worktree 才采纳」(#952)。两边都保留:
   一句讲采纳判定,一句讲证据边界。

2/3) `isLinkedWorktree` 一带:上游保留布尔缓存 + 每次探测,本分支把它换成
   `gitIdentityOf`(一次 `rev-parse` 同时给出 git dir 与 common dir,并带自己的缓存),
   由它派生出 `isLinkedWorktree` 与 `isAdoptableTop`。合并后**只留身份缓存**
   (布尔缓存成为同一趟探测的第二份副本,且负结果两边都缓存),`cachePut` 给身份缓存
   补上 LRU 上界,模块头注释的「三个缓存」正好仍是三个。

4) `AGENTS.md`:上游把 §3 整体搬进 `docs/host-contracts.md`(原 §3.4 的 1–12 条按原编号),
   本分支往旧 §3.4 追加了第 13 条(会话地址基准)。取上游的 `AGENTS.md`,把第 13 条
   按新家的体例写进 `docs/host-contracts.md` §B(编号 13 接在第 12 条后),并把四处
   「第 1–12 条」更新为「第 1–13 条」。

顺带:`tests/active-worktree.spec.ts` 的 `rmSync` 导入在上游侧被同一个文件的重排吃掉,
补回。

门禁:typecheck 干净;全量 vitest 2691 passed / 17 skipped / 1 failed(唯一红是既有的
smoke 写 `$HOME` 被本机沙箱 EPERM 拒);`active-worktree` / `worktree-address` /
`native-surface` 70 passed。
2026-10-18 23:19:59 +08:00
Menghuan1918 66c91091bc chore(release): adapt to DSH 0.2.1-rc.1 for 0.28.0 2026-10-17 14:03:22 +08:00
Menghuan1918 6417547bb5 merge origin/dev: include Context diagnostics and graph layout fixes
# Conflicts:
#	CHANGELOG.md
2026-10-17 11:52:48 +08:00
Menghuan1918 38d94bdb98 fix(git): let commit graph fill available sidebar height
Replace the 460px viewport cap with flex allocation. Bound the graph section minimum so long history scrolls internally instead of stretching the outer list. Verify tall and narrow panes, preview selection, folding and long Changes lists in the mounted host.
2026-10-17 11:33:55 +08:00
Menghuan1918 93c43b0ac9 feat: add optional Context diagnostics navigation
Use an activation-scoped Cordis controller for session, agent, and job-owner entries. Reuse native Context tabs, cancel stale navigation, and close source overlays without canceling pending requests.

Verify optional capability lifecycle, truthful job ownership, three real dsh-context configurations, and the existing mount regression suite.
2026-10-17 02:20:53 +08:00
Menghuan1918 4ebd3e9bdd chore: adapt sidebar to DSH 0.2.1-alpha.5 2026-10-17 02:12:44 +08:00
Menghuan1918 b5fec8d9a2 chore(release): prepare 0.27.0 Git page integration 2026-10-16 21:57:02 +08:00
Menghuan1918 0ba7edf444 fix(git): keep selected change rows inside their groups
Restore selection declarations removed with logRow during graph integration. Dangling selectors had inherited absolute positioning and borders from indent guides. Add parsed CSS and mounted browser regression coverage for staged, unstaged and conflict rows.
2026-10-16 21:45:57 +08:00
Menghuan1918 71c8243a2b docs: Git 页面合并车的 CHANGELOG 段、融合设计文档与接入文档/AGENTS 同步
- CHANGELOG 顶部新增 Unreleased 段(11 个 PR 的逐条说明与贡献者署名);
- 新增 docs/plans/2026-10-16-git-page-vscode-scm-merge.md(决策 D2/D5、被剔除的夹带、
  有意偏差、守住的不变量、未做清单、过程中修掉的三处 CI 红);
- guide:页签名、Source Control 视角、changes.ops 的 wait 长轮询口径、guide 条目名;
- AGENTS §5/§6:内置 tab 名与测试地图补入本批新增/改写的 spec。
2026-10-16 17:31:41 +08:00
Menghuan1918 40ed740f3a merge pr-944 (#944 feat(git): Git 内容区改为 VS Code Source Control 结构) into dev(@hairyf)
冲突解决(按 D4 与仓库现役不变量):
- status() 改为 porcelain v2(branch/upstream/ahead-behind/detached/operation 一次读回),
  但保留 dev 的行/字段上限、pathspec 化 numstat 与 #909 的分侧计数;v2 记录遍历抽成
  porcelainV2Tokens,状态解析与 pathspec 提取共用同一份字段知识;
- GitLens 的 Merge/Staged/Changes 三组取 #944,两组各读自己那一侧(#909),
  Merge 组不印行数(冲突不是行数故事,也不许把某一侧当「这个数」);
  sideEntries 保留(每组只读自己那一半的 XY 字母);
- ChangesTab 保留 #939 的官方 Tabs 外观与 a11y 包装、刷新按 #944 只留给本轮文件镜头;
- 测试:git.spec 导入取并集、rmSync 清理改回 removeTree、smoke 的 branch/detached 断言
  按 porcelain v2 语义改写,其余用例按新契约微调(band 顺序、changesOps 第 4 参 wait)。

剔除夹带(D4):.agents/skills/handle/SKILL.md、eslint/vitest 的 soruce/vscode 忽略项、
webRuntime→connection.requestRejection 栅栏与 ownEntryId 放宽(index.ts / context-types.ts
取 dev)、栅栏类测试桩与注释一并回退,栅栏归属留给 0.2.1 兼容批。
2026-10-16 17:14:06 +08:00
Menghuan1918 9f630d1618 merge pr-940 (#940 fix(changes): 本轮文件操作改为平铺行) into dev(@hairyf)
冲突解决:README.md 取 dev(PR 基于拆分前的旧中英双 README,改动目标已不存在),
README_EN.md 保持删除;guide 的 usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch]
           [--no-optional-locks] [--no-advice] [--bare] [--git-dir=<path>]
           [--work-tree=<path>] [--namespace=<name>] [--config-env=<name>=<envvar>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   restore    Restore working tree files
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   diff       Show changes between commits, commit and working tree, etc
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   backfill   Download missing objects in a partial clone
   branch     List, create, or delete branches
   commit     Record changes to the repository
   history    EXPERIMENTAL: Rewrite history
   merge      Join two or more development histories together
   rebase     Reapply commits on top of another base tip
   reset      Set `HEAD` or the index to a known state
   switch     Switch branches
   tag        Create, list, delete or verify tags

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system. 行合并「平铺措辞 + 下划线 Tabs 说明」;
editor-host.spec.tsx 的 RENDER_WAIT_MS 注释保留 dev 的 CI 史,并补记 PR 的夹具泄漏结论。
2026-10-16 16:38:37 +08:00
Menghuan1918 1de5e44394 merge pr-939 (#939 fix(changes): 镜头切换器改用官方 Tabs 样式) into dev(@hairyf) 2026-10-16 16:31:17 +08:00
ymac f826e63658 docs: 地址基准与 worktree 根选择的规则与设计(#947 / #950 / #952)
- AGENTS §3.4 新增第 13 条:会话地址的基准是会话 header cwd,构造端与消费端都
  经 addressBaseOf 取基准、在消费边界解析成绝对路径;工作区内部的 linked worktree
  只有同一仓库(--git-common-dir 相等)才算「会话搬走了」。
- 接入指南 §10 新增同名条目(消费插件自己也解析文件地址时照同一条规则),并补上
  openSidebarFile 的新签名 `{ line?, cwd? }`。
- 新增 docs/plans/2026-10-14-worktree-root-and-address-base.md:三个症状、根因
  (宿主两端自洽 / 插件换基准 / 判定只看拓扑)、口径 A/B 决策表与实测真值表、
  逐文件实施、复现与正式用例、残留(裸相对路径聊天链接属上游 worktree 无感)。
2026-10-14 23:18:15 +08:00
hairyf 5efc7beae0 Merge remote-tracking branch 'origin/dev' into feat/git-scm-941
# Conflicts:
#	eslint.config.js
2026-10-13 23:19:26 +08:00
Menghuan1918 8171beb5a2 chore(release): v0.26.0 —— 版本号、CHANGELOG 定版与补齐、README 与指南同步
**版本号三处同步**:`package.json` / `dsh.plugin.json` / `src/client/service.ts`
的 `SIDEBAR_SERVICE_VERSION` 0.25.0 → 0.26.0(`tests/manifest-consistency.spec.ts`
钉住前两者一致;service.ts 里其余 `v0.25.0+` 是历史功能标注,未动)。

**CHANGELOG**:`### Unreleased` 定版为 `### v0.26.0`;删掉任务面板那批的**首轮
旧稿重复块**(61–75 行与定稿重复且措辞互相矛盾,合并遗留);补上此前完全缺失的
三条——
- PR #925 侧边对话整批(实时推送 / 排队可见 / per-thread 模型选择 / 幽灵输入精确
  清扫 / 底栏重构);
- 文件树的「加载中」占位把子树永久卡死(占位所有权跟着请求走 + 丢弃时补发一次);
- `.jsonl` 预览谎报「文件过大」(阈值决定提示,不是组件决定);
- 预览插件目录收录音频预览插件(#881)。
另外把 `.delta/` 排除那条工具修复并入 git 轮询条目的测试小节。

**README / README_EN**:修掉「v0.24.1 起要求 0.2.0-rc.2+」这处事实错误(v0.24.1 的
peer 是 `^0.2.0-rc.1`,v0.25.0 才是 `^0.2.0-rc.2`)、跟着过时的「`latest` 仍是
0.1.7-rc.2」、以及支持线表格与徽章 alt 里的旧版本号;**补上此前从未写过的 v0.25.0
条目**并新增 v0.26.0 条目(四件大事 + 性能段)。README_EN 同步。

**CHANGELOG_EN**:停在 v0.24.1 已两版(无门禁守护),补 v0.26.0 与 v0.25.0,
并把头部说明改成「中文 CHANGELOG 为逐条权威、本文件是英文摘要且历史上滞后」。

**指南**:§4.4 内置清单的 viewer 数 3 → 4(补 `jsonl`);`terminal-bottom` 的
`single` 列与实际不符(#926 已去掉 `single`、改为 `createTab` 每次铸新 id),
两处「`contentId` 恒定」同步订正为每页签一个实例。
2026-10-13 22:44:05 +08:00
hairyf 228b753ad2 fix(git): finalize reviewed SCM groups and scope-safe actions 2026-10-13 22:42:16 +08:00
hairyf 0f9472b57f fix(host): resolve settings namespace for file-mounted plugin 2026-10-13 22:41:06 +08:00
hairyf 428347da13 fix(host): use native connection admission for HTTP and WebSocket routes 2026-10-13 20:37:43 +08:00
hairyf 3a1cf3d4b7 fix(changes): flatten session operation rows 2026-10-13 16:18:07 +08:00
hairyf 872a975e15 fix(changes): reuse official conversation Tabs styling 2026-10-13 15:49:04 +08:00
ymac 3f7a344a49 docs: 记录 #915 后续——标题只在来自文件名时才跟随改名
- CHANGELOG:`### Unreleased` 置顶补这一条(含判别性实测)。
- 指南 §7:`updateTab` 的 JSDoc 补「派生标题跟着改名、作者自设的标题原样
  保留」——这条 UI 行为由 service 的写面决定,按 AGENTS §5 同批同步。
2026-10-12 08:49:56 +08:00
ymac 2d850a5261 docs: 记录 #915 后续——后台会话页签的调解与定向写入
- CHANGELOG:`### Unreleased` 置顶补这一条(含两条判别性实测)。
- 指南 §7:`updateTab` / `closeTab` 的 JSDoc 补「指到不在屏的会话时写进它
  自己的布局(定向通道,不发布、不通知)」——AGENTS §5 要求 service.ts 的
  行为变更同批同步指南。
2026-10-12 08:48:37 +08:00
Menghuan1918 77854af361 docs: 独立验证后的收尾(#915 条目事实性修正 + 补 #910/#911/#901 条目 + updateTab 的 JSDoc 合并)
独立验证(3 个未参与解冲突的 agent)在这批合入后抓出的问题:

- CHANGELOG #915 条目里「写回时保留该页签自己的拼写」与实现矛盾:记录写的是调用方
  给的新名(绝对拼写),保留旧拼写的是**改名标记**的 from(tree-mutations.ts:186-191)。
- #910 / #911 / #901 三条用户可见修复在本批合入时都没有 CHANGELOG 条目,补上(按合入
  顺序「新在上」:901 → 915 → 916 → 911 → 910)。
- #915 条目里「原生枚举没有进消费插件的公开面」措辞过强:本批确实新增了 3 个导出成员
  (NativePathTab / SidebarSurface.pathTabs? / @internal 的 nativePathTabs),改成
  「没有当成消费 API 宣传」。
- src/client/service.ts 的 updateTab 上叠了两个 JSDoc 块,TSDoc 只挂最后一块、解释
  sessionId 的那块成了浮空注释——合并成一块(原文档面)。
- 指南 §7 的 updateTab 签名补上第三个参数 sessionId?(该行此前就漏了)。

typecheck 干净,全量 2432 passed / 17 skipped。
2026-10-12 02:00:52 +08:00
Menghuan1918 db7216eac8 docs: 补 #915 的 CHANGELOG 条目与指南 §7 的原生承载面行为说明(#912 未带文档面)
- CHANGELOG:`### Unreleased` 置顶补 #915 条目(按 #912 的实际实现写;被取代的
  PR #917 那段里的 `ctx.betterSidebar.pathTabs()` / `store.reduceFor` / 「标题只在
  派生自文件名时跟随」三处说法与实现不符,未照搬)。
- 指南 §7:`updateTab` 的 JSDoc 补「写入在原生承载面上是稳的」(导航门控)与
  「文件树改名/删除调解覆盖原生页签」——AGENTS §5 要求 service.ts 的行为变更
  同批同步指南;§7 的接口块在 ```ts 围栏内,所以写成 JSDoc 续行而不是散文段。\n
2026-10-12 01:52:52 +08:00
Atlas Zeng 4bb914ef4a Merge pull request #916 from yanzhaohui1999/fix/826-line-nav-mode
fix(editor): 行号落地四处收尾:能切回预览、插件预览也跳行、换文件不继承行号、落地有光标(#826)
2026-10-12 01:39:20 +08:00
Menghuan1918 ecb347eb11 merge origin/dev into fix/826-line-nav-mode(#826 行号落地四处收尾 合上 dev 的 #924/#925 与流式/任务批)
两处冲突的解法:
- CHANGELOG.md:dev 的 v0.25.0 落版提交已把「#826 第二半」条目移进已发布的 `### v0.25.0`,
  因此该条目全篇只保留一份——留在 v0.25.0 原位,并采用 #916 修正后的措辞
  (「并高亮该行」→「并给编辑器焦点(CodeMirror 只在获焦时画光标)」);
  #916 新增的「引用行号的四处收尾(#914 回归报告)」条目置于 `### Unreleased` 最上方(该节新在上);
  dev 的其余段落(Unreleased 与 v0.25.0 两节)逐字未动。
- src/client/service.ts:保留 dev 新的 `FileViewerProps.content` 文档(超限见 `largeFile`)
  与 #924/#925 带来的侧边对话 / 流式面,叠加 #916 的 `onLineConsumed` 文档;
  `OpenTabSeed.line`、`createBetterSidebarService` 的三处 seed 透传与 `updateTab` 文档补充按 #916 落地。

验证:pnpm typecheck 通过;pnpm test 203 文件 / 2419 用例全绿(17 skip),
含 #916 的 tests/editor-line-nav-mode.spec.tsx 等 6 个 spec。
2026-10-12 01:27:18 +08:00
Menghuan1918 293b0e12ea merge origin/dev into fix/fs-write-missing-conflict(#911:带基线保存时目标已删除判 fs-conflict,语义落进 dev 的 writeWorkspaceText)
#924 把 fs.write 从 /sidebar/api 的 JSON 路由移到了 raw /sidebar/write →
src/fs-operations.ts 的 writeWorkspaceText,所以 #911 只改 src/index.ts 里那段
内联实现已经不存在了:冲突取 dev 侧(新的 fs.readPage 路由 + 已迁走的 fs.write),
把语义重落到 writeWorkspaceText,并同步改文档、客户端注释与其两个新用例。

解冲突的四个文件:
- src/index.ts:整份取 dev(#911 在此处的改动全部落在已被 #924 删除的内联实现里)
- src/fs-operations.ts(非冲突文件,语义落点):基线检查 current !== undefined && current !== expected
  → current !== expected;stat 失败(目标或父目录被删除)同样判 409,不再 mkdir -p 重建
- src/client/api.ts:保留 dev 的 fsRead 三态 + 新增 fsReadPage,fsWrite 注释合入「目标已不存在也判冲突」
- docs/external-plugin-guide.md:保留 dev 的 fs.read / fs.readPage / fs.write(raw) 三行,往 fs.write 行补该语义
- tests/fs-write-route.spec.ts:保留 dev 的两个新用例,并把 #911 的两个用例改写到 raw 路由
  (invoke(route.api,'fs.read') 取基线 + invokeWrite(route,…) 保存)
2026-10-12 01:26:19 +08:00
Menghuan1918 51c1650928 feat(preview): 超大文件改追加式滚动 + 加载全部按钮
按用户要求对齐 VS Code 的 output/log 面板:

- 滚到底**追加**下一页而不是替换当前页:读者读过的内容不会被抽走,
  行号跨页连续;footer 改成「已加载 第 a–b 行/条记录 · 已读/总大小」
- 超限提示条最右侧新增「加载全部」按钮,加载中显示字节进度,到 EOF 置灰
- 游标模型整体删除(不再有 prev/next 与页码),只剩一个只向前的累加器,
  比原来的 LRU 缓存 + 页表简单得多

唯一 VS Code 不需要而这里必须有的:行数上限 MAX_PREVIEW_ROWS = 50000。
它的 TextModel 与视图都虚拟化,模型塞进一个 GB、DOM 仍很小;这里渲染的是
真实元素,没有上限就是「加载全部」一点即卡死。到顶后停止追加并提示下载。

上限放在 hook 里(useTextPager 的 maxLines 参数)而不是视图按**已渲染**
行数判断——这是测试抓出来的:loadAll 在 await 循环中推进时 React 还没重
渲染,读渲染态的数字会滞后好几页把上限冲过去(spec 里 worker 十秒 OOM)。

另一个测试抓出的真 bug:appendOnce 原来从 setState 渲染态读 nextOffset,
在同一批 await 里拿到的是**上一页**的偏移,于是 loadAll 会反复请求同一页
(同样是 OOM)。游标改由 nextOffsetRef/atEndRef 在响应到达时同步写入。

测试:新增 tests/text-pages.spec.ts(9 例:追加不丢页、EOF 终态、loadAll
串行推进、上限截断与 atCap、失败中止、reload 清空、行数计账),
editor-large-file 补 6 例视图行为(滚动追加、中途不追加、自动填充视口、
加载全部分页、上限提示、默认上限不误报);chunk-artifact 的 externals
桩表补 react.memo(editor chunk 现在在模块求值期 memo 一行组件)。
2026-10-12 00:11:07 +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
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 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
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 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
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
Menghuan1918 34ce191981 docs: 修正 #855 的用例数、脏态出口口径与轮询叠加口径
- **[硬数字]** CHANGELOG 的 `tests/editor-auto-refresh.spec.tsx` 用例数
  11 → 14(原本就少 1,加上本批新增 2 例);同批核对:既有 #167 的 4 条、
  2.5s 节奏、「N 个编辑器 tab 每 tick 1 个请求」均属实。
- **[用户可见承诺]** 删掉「dirty / 编辑态由既有的『编辑 → 预览』边沿补刷」
  这句不成立的话:该边沿**自身带 dirty 守卫**(`EditorHost.tsx` 的边沿判定
  要求 `dirty !== true`,`tests/editor-refresh.spec.tsx` 的 B 例两半都钉住了:
  干净时 fsRead 1→2,dirty 时仍是 1)。按事实改写为:未 dirty 时点页头
  「预览」会重载并拿到新内容;dirty 时该边沿被抑制,真正的两条出口是**页头
  刷新按钮**(`window.confirm` 后重载)与**「保存 → `fs-conflict` 横幅的
  reload」**(保存带 `mtimeMs` 基线,不会静默覆盖模型字节)。结论句:dirty
  期间保持旧内容直到用户显式动作,**不存在看不到新内容的死路**。指南 §5.2、
  指南行为差异表、CHANGELOG、设计文档 §4.2 四处同步。
- **[叠加口径]** 同一会话同时开着文件变动页(会话透镜)与编辑器时,该会话
  每 tick 是 **2 个** `changes.ops` 请求——「每 tick 1 个」只算编辑器这一份。
  一次性探针实测:会话透镜单独 1/tick、编辑器单独 1/tick、两者同开 2/tick
  (记进 CHANGELOG、指南行为差异表与设计文档 §4.1)。
- 设计文档 §5/§6 的用例数与门禁数字同步为本次实测(184 文件 2152 通过 /
  13 跳过 / 0 失败)。
2026-10-06 00:55:52 +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 e4a4c3fa4c merge origin/dev into feat/774-terminal-tab(#774 收尾前置)
dev 前进 12 个提交(titleBar 让位机制整体移除、#132 新建文件与排序三档、
#817 后台激活改标记未读、#412 Windows「在应用中打开」候选链等)。两处冲突,
都是「双方各自新增的内容」,无实质取舍:

- CHANGELOG.md:Unreleased 保留双方条目。#774 一组在最上(本分支的新条目),
  其后是 dev 的「移除 titleBar 让位机制」「#132 新建文件 / 排序」一组,再往下
  是既有的 #109 / #203 一组(与文件里原有的空行分组一致)。
- tests/e2e/mount.e2e.ts:只在下一条用例的标题行冲突——保留本分支新增的底部
  终端用例(#774),标题取 dev 侧的新名(`a shell-stamped render URL mounts
  normally; …`;dev 已把 WCO / preset 两条场景删掉)。
- 21 份词典、AGENTS.md、docs/external-plugin-guide.md、README 自动合并:dev 删的
  12 个 titleBar 词典 key 保持删除,本分支新增的 3 个 terminal 词条保持新增。
2026-10-06 00:07:23 +08:00