diff --git a/AGENTS.md b/AGENTS.md index 14b35226..02f4dab1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,7 +42,7 @@ - **当前基线 DSH 0.2.1-rc.1(v0.28.0 正式版起)**。13 条 `@deepseek-ai/dsh-*` peer 下限均为 `^0.2.1-rc.1` 浮动 caret 范围、**绝不钉精确版本**(只有 devDependencies 精确钉);本包不声明 `package.json#engines.dsh`,因此走 peer 兼容性检查;宿主对声明了该字段的包优先且仅按它判定,不读 peer。`dsh.plugin.json#engines.dsh` 不参与这一规则。`tests/market-manifest.spec.ts` 钉住这条形状。 - **0.x caret 不跨 minor,但可跨 patch**:`^0.1.7-rc.1` 对 `0.2.0-rc.1` 判定为 false → 整行 `disabled`、插件静默不加载。**抬基线必须同批抬 peer 下限。** -- 支持线(用户侧):DSH **0.2.1-rc.1+** 使用插件 **v0.28.2**;0.2.1-alpha.5 用户固定 **v0.28.0-alpha.0**;0.2.0-rc.2 用户固定 **v0.26.1**(v0.27.0 尚未发布);0.2.0-rc.1 用户固定 v0.24.1;0.1.7 线的最后支持版是 **v0.22.1**(v0.23.0 从未发布到 npm)。按本仓库先例**不写运行时兼容层**。 +- 支持线(用户侧):DSH **0.2.1-rc.1+** 使用插件 **v0.29.0**;0.2.1-alpha.5 用户固定 **v0.28.0-alpha.0**;0.2.0-rc.2 用户固定 **v0.26.1**(v0.27.0 尚未发布);0.2.0-rc.1 用户固定 v0.24.1;0.1.7 线的最后支持版是 **v0.22.1**(v0.23.0 从未发布到 npm)。按本仓库先例**不写运行时兼容层**。 - **抬基线动作清单**:① `pnpm peers check`,把失配的传递 peer 提升进 devDependencies;② 扫宿主包产物的**裸 import 差集**(`pnpm peers check` 看不到这类失败,0.1.7 线是 `zustand` / `immer`);③ 对消费的宿主包做类型面 diff(重点 `ui-primitives` / `dsh-session` / `sidebar-right`),确认导出只增不减;④ 复查会话格式版本、`SUBAGENT_DESCRIPTOR_VERSION`、web profile 的 inject 列表;⑤ 同批同步 CI 钉版、`scripts/e2e-common.sh`、**`scripts/install.sh` / `scripts/install.ps1`(随包发布、会直接给用户 npx 命令)** 与 README / 指南的版本行。 - **用户 profile 自己的 `overrides: '@deepseek-ai/dsh-*'` 要同批抬**,否则旧包遮蔽 bundle → 预检禁用 `config-editor` → `settings` 行永久 `pending`;先看宿主日志的 `disabling profile plugin row` 与 `pending (waiting for service: …)`。 - **沿用 alpha.5 的删除契约**:不再依赖 `@deepseek-ai/dsh-invariants`、`ctx.invariants` 或上游 `/invariant` 子路径,也不发布本插件的 invariant companion;HTTP/WS 准入统一调用 `ctx.connection.requestRejection(req)`,仅 `undefined` 放行,不恢复 `webRuntime` / 自建信任例外。 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6279ab82..7beabaf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ > 本文档收录 dsh-better-sidebar 的完整发布历史(最新版摘要见 [README](README_ZH.md);同步发布于 [GitHub Releases](https://github.com/omdsh-dev/DSH-better-sidebar/releases))。 +### v0.29.0 + +- **侧边对话接入 GenUI**:通过现有 `ctx.betterSidebar` 服务新增可选的 `registerSidechatSurfaceAdapter`,支持 GenUI 0.15.0 渲染已结算的助手回复;未注册消费方时保持原 Markdown。 +- **子线程归属与生命周期**:保留线程、消息及原始文本块身份;隐藏、切换线程、替换行或卸载后撤销旧回调,交互不会转发到主会话。保留原链接改写缓存、媒体处理与流式状态。 +- **冷恢复边界**:仅移除明确标为继承的历史前缀,普通恢复标记不再清掉子线程历史。 +- **贡献**:感谢 [@sunxiuguo](https://github.com/sunxiuguo) 的配套实现([#1033](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1033));保留原始贡献提交,并整合最新 dev 与 0.28.2 的冷会话读取修复。 + ### v0.28.2 - 🛡 **冷会话(detached)的 cwd 改读工作区地址,不再整份解码会话日志**:`sessionQuery.observeSession(..., { projectionMode: 'all' })` 为拿一个 `workingDirectory` 要解码整份 zstd 日志并水合全部投影;而启动期真正并发的是 **fs-watch 每监视目录一帧**、`/sidebar/file|html` 每资源一次、`/sidebar/upload|write` 每次一次——它们都绕过 0.28.1 只覆盖 `/sidebar/api` 的 `cwdOf()` 单飞,所以 39 MB 级会话在 130–180 ms 里被并发整读数十次(0.28.0 的 44 次 OOM、0.28.1 的 36 次是同一路径,不是「去重失效」)。现在 detached 会话的 cwd 走 `sessionPersistence.stat` 的 **header-only** 读(只读第一个 zstd 帧)+ 进程内 memo/在飞去重,`activeWorktreeRootOf` 对 detached 会话直接返回该地址;宿主 attach 后仍跟随 `working_directory` 与 linked worktree。 diff --git a/CHANGELOG_EN.md b/CHANGELOG_EN.md index fbebd5e3..094f26ee 100644 --- a/CHANGELOG_EN.md +++ b/CHANGELOG_EN.md @@ -4,6 +4,13 @@ > > 📝 The Chinese [CHANGELOG](./CHANGELOG.md) is the authoritative, item-by-item record; this file carries the English summaries and has historically lagged behind it. Where the two disagree, the Chinese one is current. +### v0.29.0 + +- **GenUI in side chats**: the existing `ctx.betterSidebar` service exposes the opt-in `registerSidechatSurfaceAdapter` for GenUI 0.15.0 to render settled assistant replies. Without a consumer, Markdown rendering stays unchanged. +- **Child-thread ownership and lifecycle**: preserve thread, event and original text-block identity. Hiding, switching threads, replacing a row or disposing the plugin revokes old callbacks; actions never fall back to the main conversation. Existing rewrite caches, media handling and streaming state remain intact. +- **Cold-resume boundary**: remove only an explicitly inherited history prefix; ordinary restore markers no longer discard child history. +- **Contribution**: thanks to [@sunxiuguo](https://github.com/sunxiuguo) for the provider implementation ([#1033](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1033)). Original commits are preserved, alongside current dev and the 0.28.2 cold-session read fix. + ### v0.28.2 - 🛡 **A detached session's cwd now comes from its stored workspace address instead of decoding the whole session log.** `sessionQuery.observeSession(..., { projectionMode: 'all' })` decodes the entire zstd artifact and hydrates every projection to answer with one `workingDirectory` string. The real startup fan-out never went through the 0.28.1 `cwdOf()` single-flight (which only covers `/sidebar/api`): the fs-watch socket sends **one frame per watched directory**, and `/sidebar/file|html` resolve cwd per resource, `/sidebar/upload|write` per call — so a 39 MB session was fully decoded dozens of times inside 130–180 ms (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). The cold cwd now uses `sessionPersistence.stat` — a **header-only** read (first zstd frame) with a process-level memo and same-session in-flight sharing — and `activeWorktreeRootOf` returns that address for detached sessions. Once the host attaches the session, the committed `working_directory` and linked-worktree following resume as before. diff --git a/README.md b/README.md index 8301ed1a..e78763a9 100644 --- a/README.md +++ b/README.md @@ -44,14 +44,14 @@ dsh plugin --profile web add dsh-better-sidebar@latest Then **hard-refresh the browser** (Cmd/Ctrl+Shift+R). Requires DSH **0.2.1-rc.1+**. -> **Compatibility warning — match the plugin to the host line.** As of 2026-10-26, DSH's npm `latest` is **0.2.1-rc.2**, so the command above installs the compatible v0.28.2. Hosts still on **0.2.0-rc.2** must pin `dsh-better-sidebar@0.26.1` (and should upgrade the host to `0.2.1-rc.2` first); DSH 0.2.1-alpha.5 users must pin `dsh-better-sidebar@0.28.0-alpha.0`. The marketplace installer picks the plugin's `latest` regardless of host version, so an old host gets a version-rejection error — upgrade the host or pin the version explicitly. The two packages' `latest` tags are independent. +> **Compatibility warning — match the plugin to the host line.** As of 2026-10-28, DSH's npm `latest` is **0.2.1-rc.2**, so the command above installs the compatible v0.29.0. Hosts still on **0.2.0-rc.2** must pin `dsh-better-sidebar@0.26.1` (and should upgrade the host to `0.2.1-rc.2` first); DSH 0.2.1-alpha.5 users must pin `dsh-better-sidebar@0.28.0-alpha.0`. The marketplace installer picks the plugin's `latest` regardless of host version, so an old host gets a version-rejection error — upgrade the host or pin the version explicitly. The two packages' `latest` tags are independent.
Pick the plugin version for your DSH version | Your DSH version | Install command | | --- | --- | -| **0.2.1-rc.1+** | `dsh plugin --profile web add dsh-better-sidebar@0.28.2` | +| **0.2.1-rc.1+** | `dsh plugin --profile web add dsh-better-sidebar@0.29.0` | | **0.2.1-alpha.5** | `dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0` | | **0.2.0-rc.2** | `dsh plugin --profile web add dsh-better-sidebar@0.26.1` | | **0.2.0-rc.1** | `dsh plugin --profile web add dsh-better-sidebar@0.24.1` | @@ -70,12 +70,12 @@ Always pin **exact versions** for older releases (`latest` moves forward with ea ```text Install the dsh-better-sidebar plugin (a sidebar workbench for DSH): -1. Confirm DSH is 0.2.1-rc.1 or newer, then run dsh plugin --profile web add dsh-better-sidebar@0.28.2 +1. Confirm DSH is 0.2.1-rc.1 or newer, then run dsh plugin --profile web add dsh-better-sidebar@0.29.0 2. Remind me to hard-refresh the browser (Cmd/Ctrl+Shift+R) afterwards If something fails, check the FAQ table in https://github.com/omdsh-dev/DSH-better-sidebar README first. ``` -**One-line script** — clone this repo and run `bash scripts/install.sh 0.28.2` (macOS / Linux / Windows Git Bash; `./scripts/install.ps1 -Version 0.28.2` for native Windows). It handles installation + bundle registration. +**One-line script** — clone this repo and run `bash scripts/install.sh 0.29.0` (macOS / Linux / Windows Git Bash; `./scripts/install.ps1 -Version 0.29.0` for native Windows). It handles installation + bundle registration. **Updating**: just re-run the install command, then hard-refresh the browser. @@ -92,12 +92,18 @@ If something fails, check the FAQ table in https://github.com/omdsh-dev/DSH-bett | **Two sidebars** on the page | Double mounting. Remove the legacy manual mount line (`- insert: ... better-sidebar ...`) from `~/.dsh/profiles/web/cordis.patch.yml`; aggregate packages mounting this package under a different id are auto-yielded, no action needed. | | Settings values gone after upgrade | Since DSH 0.1.7, preferences live on this plugin's mount row in the profile (default entry id `better-sidebar`). The plugin migrates your old `settings.yaml` values once on first start and never overwrites newer values. | | Terminal unavailable | Terminals are provided by **DSH itself** (this plugin ships no PTY) — see DSH docs; "host provides no terminal capability" in the bottom terminal means this deployment has no terminal controller mounted. | -| `dsh: command not found` | Install DSH first; or use `npx -y --package @deepseek-ai/dsh@0.2.1-rc.1 dsh plugin --profile web add dsh-better-sidebar@0.28.2`. | +| `dsh: command not found` | Install DSH first; or use `npx -y --package @deepseek-ai/dsh@0.2.1-rc.1 dsh plugin --profile web add dsh-better-sidebar@0.29.0`. |
## 🆕 Recent Updates +**v0.29.0 — GenUI in side chats** + +- Adds the opt-in `registerSidechatSurfaceAdapter` service for GenUI 0.15.0. Settled assistant replies can render interactive components, with actions and state kept in the owning child thread. +- Uninstalled consumers, streaming replies and unsupported fences retain the existing Markdown view. The 0.28.2 cold-session read fix remains included. +- Provider contribution: [@sunxiuguo](https://github.com/sunxiuguo), [#1033](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1033). + **v0.28.2 — large-session cold-read fix** - **Root cause fixed**: a detached session's cwd no longer decodes the whole session log — it reads the workspace address stored in the header (first zstd frame only, header-only), memoized per session with in-flight sharing; `activeWorktreeRootOf` no longer folds the stored log for a detached session diff --git a/README_ZH.md b/README_ZH.md index ec1c9849..18f7c404 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -44,14 +44,14 @@ dsh plugin --profile web add dsh-better-sidebar@latest 装完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可。要求 DSH **0.2.1-rc.1+**。 -> **兼容性警告:插件版本必须与宿主线匹配。** 截至 2026-10-26,DSH 的 npm `latest` 是 **0.2.1-rc.2**,上方命令安装的 v0.28.2 与之兼容。仍停留在 **0.2.0-rc.2** 的宿主必须固定 `dsh-better-sidebar@0.26.1`(并建议先升级宿主到 `0.2.1-rc.2`);DSH 0.2.1-alpha.5 用户固定 `dsh-better-sidebar@0.28.0-alpha.0`。市场安装器按插件的 `latest` 安装、不按宿主版本选版本,旧宿主会收到版本拒绝错误——请升级宿主或显式固定版本。两个包的 `latest` 标签不是同一支持线。 +> **兼容性警告:插件版本必须与宿主线匹配。** 截至 2026-10-28,DSH 的 npm `latest` 是 **0.2.1-rc.2**,上方命令安装的 v0.29.0 与之兼容。仍停留在 **0.2.0-rc.2** 的宿主必须固定 `dsh-better-sidebar@0.26.1`(并建议先升级宿主到 `0.2.1-rc.2`);DSH 0.2.1-alpha.5 用户固定 `dsh-better-sidebar@0.28.0-alpha.0`。市场安装器按插件的 `latest` 安装、不按宿主版本选版本,旧宿主会收到版本拒绝错误——请升级宿主或显式固定版本。两个包的 `latest` 标签不是同一支持线。
按 DSH 版本选插件版本 | 你的 DSH 版本 | 安装命令 | | --- | --- | -| **0.2.1-rc.1+** | `dsh plugin --profile web add dsh-better-sidebar@0.28.2` | +| **0.2.1-rc.1+** | `dsh plugin --profile web add dsh-better-sidebar@0.29.0` | | **0.2.1-alpha.5** | `dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0` | | **0.2.0-rc.2** | `dsh plugin --profile web add dsh-better-sidebar@0.26.1` | | **0.2.0-rc.1** | `dsh plugin --profile web add dsh-better-sidebar@0.24.1` | @@ -70,12 +70,12 @@ dsh plugin --profile web add dsh-better-sidebar@latest ```text 帮我安装 dsh-better-sidebar 插件(DSH 侧边栏工作台),步骤: -1. 先确认 DSH 为 0.2.1-rc.1 或更新版本,再执行 dsh plugin --profile web add dsh-better-sidebar@0.28.2 +1. 先确认 DSH 为 0.2.1-rc.1 或更新版本,再执行 dsh plugin --profile web add dsh-better-sidebar@0.29.0 2. 完成后提醒我硬刷新浏览器(Cmd/Ctrl+Shift+R) 遇到报错先查 https://github.com/omdsh-dev/DSH-better-sidebar README 的常见问题表。 ``` -**一键脚本**——克隆本仓库后执行 `bash scripts/install.sh 0.28.2`(macOS / Linux / Windows Git Bash;Windows 原生用 `./scripts/install.ps1 -Version 0.28.2`),自动完成安装 + bundle 注册。 +**一键脚本**——克隆本仓库后执行 `bash scripts/install.sh 0.29.0`(macOS / Linux / Windows Git Bash;Windows 原生用 `./scripts/install.ps1 -Version 0.29.0`),自动完成安装 + bundle 注册。 **更新**:重跑一次安装命令即可,然后硬刷新浏览器。 @@ -92,12 +92,18 @@ dsh plugin --profile web add dsh-better-sidebar@latest | 页面出现**两个侧边栏** | 双挂载。删掉 `~/.dsh/profiles/web/cordis.patch.yml` 里旧的手动挂载行(`- insert: ... better-sidebar ...`);聚合包以不同 id 挂载本包时会自动退让,无需处理。 | | 升级后设置页的值去哪了 | DSH 0.1.7 起偏好写在 profile 里本插件的挂载行上(默认 entry id `better-sidebar`),插件首次启动会把旧 `settings.yaml` 里的配置一次性回迁,不会覆盖新设的值。 | | 终端无法使用 | 终端由 **DSH 自身**提供(本插件不自带 PTY),请查 DSH 侧文档;底部终端显示「宿主未提供终端能力」= 这个部署没挂终端控制器。 | -| 提示 `dsh: command not found` | 先安装 DSH;或用 `npx -y --package @deepseek-ai/dsh@0.2.1-rc.1 dsh plugin --profile web add dsh-better-sidebar@0.28.2`。 | +| 提示 `dsh: command not found` | 先安装 DSH;或用 `npx -y --package @deepseek-ai/dsh@0.2.1-rc.1 dsh plugin --profile web add dsh-better-sidebar@0.29.0`。 |
## 🆕 最近更新 +**v0.29.0 — 侧边对话接入 GenUI** + +- 新增可选的 `registerSidechatSurfaceAdapter` 服务,配合 GenUI 0.15.0 在已结算的侧边回复里渲染交互组件;状态和动作归属对应子线程。 +- 未安装消费插件、流式回复及不支持的围栏继续显示原 Markdown;保留 0.28.2 的冷会话读取修复。 +- 配套实现由 [@sunxiuguo](https://github.com/sunxiuguo) 贡献,见 [#1033](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1033)。 + **v0.28.2 — 大会话冷读修复** - **根因修复**:detached 会话的 cwd 不再解码整份会话日志——改读存储在 header 里的工作区地址(只读第一个 zstd 帧,header-only),按会话做进程内缓存与在飞去重;`activeWorktreeRootOf` 对 detached 会话不再折持久化日志 diff --git a/docs/external-plugin-guide.md b/docs/external-plugin-guide.md index 1c828883..b410d119 100644 --- a/docs/external-plugin-guide.md +++ b/docs/external-plugin-guide.md @@ -997,7 +997,7 @@ ctx.effect(() => ### 7.1 侧边对话渲染适配器(新增提案,尚未发布) -这是配合 [dsh-genui #354](https://github.com/omdsh-dev/dsh-genui/issues/354) 的**新增、窄范围接入提案**,不是 v0.28.0 或既有发布版本承诺过的契约。消费方必须先探测方法存在;未安装、旧版本或未注册适配器时,侧边对话继续使用原有 `MarkdownText` 和 `markdownTextProps()`,不改变普通 Markdown 与代码围栏。 +这是 v0.29.0 新增、配合 GenUI 0.15.0 的窄范围接入能力,关联 [dsh-genui #354](https://github.com/omdsh-dev/dsh-genui/issues/354)。消费方必须先探测方法存在;未安装、旧版本或未注册适配器时,侧边对话继续使用原有 `MarkdownText` 和 `markdownTextProps()`,不改变普通 Markdown 与代码围栏。 ```ts interface SidechatSurface { diff --git a/dsh.plugin.json b/dsh.plugin.json index 7969d0d6..078704e7 100644 --- a/dsh.plugin.json +++ b/dsh.plugin.json @@ -1,6 +1,6 @@ { "id": "dsh-external/dsh-better-sidebar", - "version": "0.28.2", + "version": "0.29.0", "main": "./lib/index.js", "description": "更好用的右侧边栏——文件树、编辑器、文件变动、任务和侧边对话都收在这一栏里,每个会话互不干扰。暴露服务供其他插件注册侧边栏页面与文件预览器", "engines": { diff --git a/package.json b/package.json index 466636cf..41234d7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsh-better-sidebar", - "version": "0.28.2", + "version": "0.29.0", "description": "Better Sidebar for DSH — file tree, editor, changes, tasks and side chat in one column, separate for every conversation. Also exposes a service other plugins use to register sidebar tabs and file viewers.", "type": "module", "repository": { diff --git a/src/client/service.ts b/src/client/service.ts index b327d18e..cf310445 100644 --- a/src/client/service.ts +++ b/src/client/service.ts @@ -840,7 +840,7 @@ export function matchUrlTarget(tabs: readonly TabDescriptor[], url: URL): TabDes * The plugin version this service instance reports. Keep in lockstep with * `package.json`'s version — `tests/service.spec.ts` asserts the pair. */ -export const SIDEBAR_SERVICE_VERSION = '0.28.2' +export const SIDEBAR_SERVICE_VERSION = '0.29.0' /** * Monotonic capability list consumers use to gate new API usage (features