merge chore/dsh-0.2.1-rc.1-release-0.28.0: prepare stable RC adapter

This commit is contained in:
Menghuan1918 committed 2026-10-17 14:03:22 +08:00
commit 0fab0afdbb
18 files changed
+608 -503

No files matched your search

+2 -2
View File
@@ -171,14 +171,14 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Pin the exact 0.2.1-alpha.5 host CLI; never use a dist-tag.
# Pin the exact 0.2.1-rc.1 host CLI; never use a dist-tag.
# Keep peer resolution ON: do not add --legacy-peer-deps; it skips boot peers.
# The lanes speak the slash-only RPC dialect (tests/e2e/host-protocol.ts).
# NODE_OPTIONS below preserves the heap budget needed for prerelease peer resolution.
- name: Install dsh CLI (pinned)
env:
NODE_OPTIONS: --max-old-space-size=4096
run: npm install -g @deepseek-ai/dsh@0.2.1-alpha.5
run: npm install -g @deepseek-ai/dsh@0.2.1-rc.1
# lib/ is gitignored; the tarball is produced from this build.
- name: Build and pack the npm tarball
+8 -4
View File
@@ -31,7 +31,7 @@
本地:`pnpm build && pnpm pack && pnpm exec playwright install chromium && pnpm test:mount`。
- **钉版写精确版本号,绝不写 dist-tag**(`alpha` / `latest` / `next` 的指向与候选版经常不一致);默认与 CI 同为 `@deepseek-ai/dsh@0.2.1-alpha.5`。
- **钉版写精确版本号,绝不写 dist-tag**(`alpha` / `latest` / `next` 的指向与候选版经常不一致);默认与 CI 同为 `@deepseek-ai/dsh@0.2.1-rc.1`。
- 该步骤需要 `NODE_OPTIONS=--max-old-space-size=4096`(浮动的传递依赖会组出混合 peer 图 → ERESOLVE 后 OOM);**不要加 `--legacy-peer-deps`**(会跳掉 boot 必需的 peer,CLI 直接 `ERR_MODULE_NOT_FOUND`)。
- 本机 npm registry 是 npmmirror、对新预发布滞后:装不到时 `pnpm install --registry https://registry.npmjs.org`。
- Windows lane 跑 `pnpm test:windows`(`--maxWorkers=1`),`vitest.config.ts` 的 `testTimeout: 30_000` 与它配套。e2e spec 命名 `*.e2e.ts` + vitest `exclude` 双保险;**改 `exclude` 必须保留默认排除项**。
@@ -40,18 +40,22 @@
## 3. DSH 版本适配
- **当前基线 DSH 0.2.1-alpha.5(v0.28.0-alpha.0 起)**。13 条 `@deepseek-ai/dsh-*` peer 一律写 `^<基线>` 浮动 caret 范围、**绝不钉精确版本**(只有 devDependencies 精确钉);本包不声明 `package.json#engines.dsh`,因此走 peer 兼容性检查;alpha.5 对声明了该字段的包优先且仅按它判定,不读 peer。`dsh.plugin.json#engines.dsh` 不参与这一规则。`tests/market-manifest.spec.ts` 钉住这条形状。
- **当前基线 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 下限。**
- 支持线(用户侧):0.2.0-rc.2 用户固定 npm 已发布的 **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.28.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` / 自建信任例外。
- **沿用 alpha.5 的删除契约**:不再依赖 `@deepseek-ai/dsh-invariants`、`ctx.invariants` 或上游 `/invariant` 子路径,也不发布本插件的 invariant companion;HTTP/WS 准入统一调用 `ctx.connection.requestRejection(req)`,仅 `undefined` 放行,不恢复 `webRuntime` / 自建信任例外。
- **v0.28.0 正式版接管 npm `latest`**:宿主 npm `latest` 此时仍指向 `0.2.0-rc.2`,不满足本插件 RC 基线;用户已明确接受这一分离,所有安装文档必须显著提醒旧宿主固定 `v0.26.1`,不要用浮动 `latest`。发布 workflow 沿用现有版本号规则,无需改动。
- **本次 RC 适配不改功能实现**:alpha.5 → rc.1 上游完整树差异共 355 项,全部为 `package.json`,源码零变化;同步版本、peer、伴随依赖与文档,重新获取 RC 验证证据,不沿用 alpha 测试数字。
- 动设置面 / sidechat / 原生 tab 之前,先读 [docs/host-contracts.md](docs/host-contracts.md)(原 §3.4 的 1–12 条按原编号都在那里)。
---
## 4. 发版
v0.28.0 正式版沿用现有发布规则进入 npm `latest`,无需修改 workflow;这不代表宿主的 `latest` 已升级到本插件所需 RC。
[release.yml](.github/workflows/release.yml) 在 GitHub Release(tag `vX.Y.Z`)触发:版本 bump → `build` / `typecheck` / `test` → 校验 tag 与版本一致 → `pnpm publish --provenance --access public`。认证走 npm **Trusted Publishing(OIDC)**,不配 `NPM_TOKEN`。调试用 `workflow_dispatch` + `dry_run=true` 只打包不发版。
---
+7
View File
@@ -2,6 +2,13 @@
> 本文档收录 dsh-better-sidebar 的完整发布历史(最新版摘要见 [README](README_ZH.md);同步发布于 [GitHub Releases](https://github.com/omdsh-dev/DSH-better-sidebar/releases))。
### v0.28.0
- **正式版支持线前移到 DSH 0.2.1-rc.1+**:13 条 DSH peer 下限统一为 `^0.2.1-rc.1`,开发依赖、CI 与安装脚本使用精确 RC 基线。不新增运行时兼容层、不改功能实现。
- **沿用已发布 alpha 的功能**:上游 alpha.5 → rc.1 完整源码树差异共 355 项,全部为 `package.json`,源码零变化;本次仅同步版本、依赖声明与文档。伴随依赖调整为 Cordis peer `^4.0.5` / dev `4.0.5`、group `1.0.5`、schemastery `~3.18.5`,include 保持 `1.0.10`。
- **发布渠道切换至 npm `latest`**:插件 v0.28.0 即将接管 `latest`,现有 workflow 按正式版本号自动选择该标签,无需修改。**宿主 npm `latest` 此时仍是 0.2.0-rc.2,不能安装本版**;该宿主必须固定插件 **v0.26.1**。DSH 0.2.1-alpha.5 用户固定 **v0.28.0-alpha.0**;0.2.0-rc.1、0.1.7 及更早支持线保持原指引。用户已明确接受两个包的 `latest` 不对齐风险。
- **RC 验证独立取证**:结果见 [DSH 0.2.1-rc.1 适配记录](docs/plans/2026-10-17-dsh-0.2.1-rc.1-adaptation.md);未完成的检查保持待验证,不沿用下方 alpha 发布时的测试数字。
### v0.28.0-alpha.0(预发布)
- **支持线前移到 DSH 0.2.1-alpha.5+**:13 条 DSH peer 使用 `^0.2.1-alpha.5`,开发依赖与 CI / 安装脚本钉精确基线。0.2.0-rc.2 用户请固定 npm 已发布的 **v0.26.1**(v0.27.0 尚未发布);本 alpha 使用 `dsh-better-sidebar@0.28.0-alpha.0`,不是 `latest`。
+7
View File
@@ -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.28.0
- **Stable plugin support moves to DSH 0.2.1-rc.1+**: all 13 DSH peer floors are `^0.2.1-rc.1`; development dependencies, CI and installers pin the exact RC baseline. No runtime compatibility layer or feature implementation changes are introduced.
- **Retain the published alpha's functionality**: the upstream alpha.5 → rc.1 full source-tree diff contains 355 files, all `package.json`, with no source changes. This release updates versions, dependency declarations and documentation only. Companion versions are Cordis peer `^4.0.5` / dev `4.0.5`, group `1.0.5`, schemastery `~3.18.5`, and unchanged include `1.0.10`.
- **Move to npm `latest`**: v0.28.0 will take over the plugin's `latest` tag through the existing stable-version workflow; no workflow change is needed. **DSH's own `latest` still points to 0.2.0-rc.2 and cannot run this release**: pin plugin **v0.26.1** on that host. DSH 0.2.1-alpha.5 users pin **v0.28.0-alpha.0**; earlier support-line guidance is unchanged. The user explicitly accepted the independent tags' compatibility risk.
- **Fresh RC validation**: see the [DSH 0.2.1-rc.1 adaptation record](docs/plans/2026-10-17-dsh-0.2.1-rc.1-adaptation.md). Incomplete checks remain pending; test counts from the alpha release below are not reused as RC evidence.
### v0.28.0-alpha.0 (prerelease)
- **Support moves to DSH 0.2.1-alpha.5+**: 13 DSH peers use `^0.2.1-alpha.5`; development dependencies, CI and installers pin the exact baseline. DSH 0.2.0-rc.2 users should pin npm-published **v0.26.1** (v0.27.0 has not been published). Install this alpha explicitly as `dsh-better-sidebar@0.28.0-alpha.0`, not `latest`.
+17 -7
View File
@@ -7,7 +7,7 @@
<a href="https://github.com/omdsh-dev/DSH-better-sidebar/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/omdsh-dev/DSH-better-sidebar/actions/workflows/ci.yml/badge.svg" /></a>
<a href="https://github.com/omdsh-dev/DSH-better-sidebar/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/omdsh-dev/DSH-better-sidebar" /></a>
<a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" /></a>
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh?activeTab=versions"><img alt="Supported DSH versions: 0.2.1-alpha.5+" src="https://img.shields.io/badge/DSH-0.2.1--alpha.5%2B-4d6bfe" /></a>
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh?activeTab=versions"><img alt="Supported DSH versions: 0.2.1-rc.1+" src="https://img.shields.io/badge/DSH-0.2.1--rc.1%2B-4d6bfe" /></a>
</div>
<div align="center">
@@ -39,17 +39,20 @@ With the `dsh-context` plugin installed, three places offer a one-click jump int
## 🚀 Installation
```sh
dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0
dsh plugin --profile web add dsh-better-sidebar@latest
```
Then **hard-refresh the browser** (Cmd/Ctrl+Shift+R). Requires DSH **0.2.1-alpha.5+**.
Then **hard-refresh the browser** (Cmd/Ctrl+Shift+R). Requires DSH **0.2.1-rc.1+**.
> **Compatibility warning — v0.28.0 will take over this plugin's npm `latest`.** DSH's own npm `latest` still points to **0.2.0-rc.2**, which is **not compatible** with v0.28.0. On that host, pin `dsh-better-sidebar@0.26.1` instead of using the command above. DSH 0.2.1-alpha.5 users must pin `dsh-better-sidebar@0.28.0-alpha.0`. Upgrade the host explicitly to `0.2.1-rc.1` before installing v0.28.0; the two packages' `latest` tags are independent.
<details>
<summary><b>Pick the plugin version for your DSH version</b></summary>
| Your DSH version | Install command |
| --- | --- |
| **0.2.1-alpha.5+** (this alpha support line) | `dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0` |
| **0.2.1-rc.1+** | `dsh plugin --profile web add dsh-better-sidebar@0.28.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` |
| **0.1.7-rc.1 ~ 0.1.7 stable** | `dsh plugin --profile web add dsh-better-sidebar@0.22.1` |
@@ -67,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. Run dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0 (this alpha, not latest)
1. Confirm DSH is 0.2.1-rc.1 or newer, then run dsh plugin --profile web add dsh-better-sidebar@0.28.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.0-alpha.0` (macOS / Linux / Windows Git Bash; `./scripts/install.ps1 -Version 0.28.0-alpha.0` for native Windows). It handles installation + bundle registration.
**One-line script** — clone this repo and run `bash scripts/install.sh 0.28.0` (macOS / Linux / Windows Git Bash; `./scripts/install.ps1 -Version 0.28.0` for native Windows). It handles installation + bundle registration.
**Updating**: just re-run the install command, then hard-refresh the browser.
@@ -89,12 +92,19 @@ 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-alpha.5 dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0`. |
| `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.0`. |
</details>
## 🆕 Recent Updates
**v0.28.0 — stable plugin release for DSH 0.2.1-rc.1+**
- Move all 13 DSH peer floors to `^0.2.1-rc.1`; retain the alpha.0 functionality without runtime changes
- The upstream alpha.5 → rc.1 full-tree diff contains 355 files, all `package.json`; no source changes
- v0.28.0 will replace this plugin’s npm `latest`, even while DSH’s `latest` remains 0.2.0-rc.2; old hosts must pin the versions in the table above
- RC validation is pending; see the [RC adaptation record](./docs/plans/2026-10-17-dsh-0.2.1-rc.1-adaptation.md). Earlier alpha test counts are not RC evidence
**v0.28.0-alpha.0 (prerelease)**
- Adapt to DSH **0.2.1-alpha.5+**: use native Connection admission for HTTP/WS and remove the retired invariant companion and dependency
+17 -7
View File
@@ -7,7 +7,7 @@
<a href="https://github.com/omdsh-dev/DSH-better-sidebar/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/omdsh-dev/DSH-better-sidebar/actions/workflows/ci.yml/badge.svg" /></a>
<a href="https://github.com/omdsh-dev/DSH-better-sidebar/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/omdsh-dev/DSH-better-sidebar" /></a>
<a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" /></a>
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh?activeTab=versions"><img alt="支持的 DSH 版本:0.2.1-alpha.5+" src="https://img.shields.io/badge/DSH-0.2.1--alpha.5%2B-4d6bfe" /></a>
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh?activeTab=versions"><img alt="支持的 DSH 版本:0.2.1-rc.1+" src="https://img.shields.io/badge/DSH-0.2.1--rc.1%2B-4d6bfe" /></a>
</div>
<div align="center">
@@ -39,17 +39,20 @@
## 🚀 安装
```sh
dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0
dsh plugin --profile web add dsh-better-sidebar@latest
```
装完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可。要求 DSH **0.2.1-alpha.5+**。
装完**硬刷新浏览器**(Cmd/Ctrl+Shift+R)即可。要求 DSH **0.2.1-rc.1+**。
> **兼容性警告:插件 v0.28.0 即将接管 npm `latest`。** DSH 自身的 npm `latest` 此时仍是 **0.2.0-rc.2**,**不能使用 v0.28.0**;该宿主必须固定 `dsh-better-sidebar@0.26.1`,不要执行上方浮动安装命令。DSH 0.2.1-alpha.5 用户固定 `dsh-better-sidebar@0.28.0-alpha.0`。安装 v0.28.0 前请显式升级宿主到 `0.2.1-rc.1`,两个包的 `latest` 标签不是同一支持线。
<details>
<summary><b>按 DSH 版本选插件版本</b></summary>
| 你的 DSH 版本 | 安装命令 |
| --- | --- |
| **0.2.1-alpha.5+**(本 alpha 支持线) | `dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0` |
| **0.2.1-rc.1+** | `dsh plugin --profile web add dsh-better-sidebar@0.28.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` |
| **0.1.7-rc.1 ~ 0.1.7 正式版** | `dsh plugin --profile web add dsh-better-sidebar@0.22.1` |
@@ -67,12 +70,12 @@ dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0
```text
帮我安装 dsh-better-sidebar 插件(DSH 侧边栏工作台),步骤:
1. 执行 dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0(本次 alpha,非 latest)
1. 先确认 DSH 为 0.2.1-rc.1 或更新版本,再执行 dsh plugin --profile web add dsh-better-sidebar@0.28.0
2. 完成后提醒我硬刷新浏览器(Cmd/Ctrl+Shift+R)
遇到报错先查 https://github.com/omdsh-dev/DSH-better-sidebar README 的常见问题表。
```
**一键脚本**——克隆本仓库后执行 `bash scripts/install.sh 0.28.0-alpha.0`(macOS / Linux / Windows Git Bash;Windows 原生用 `./scripts/install.ps1 -Version 0.28.0-alpha.0`),自动完成安装 + bundle 注册。
**一键脚本**——克隆本仓库后执行 `bash scripts/install.sh 0.28.0`(macOS / Linux / Windows Git Bash;Windows 原生用 `./scripts/install.ps1 -Version 0.28.0`),自动完成安装 + bundle 注册。
**更新**:重跑一次安装命令即可,然后硬刷新浏览器。
@@ -89,12 +92,19 @@ dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0
| 页面出现**两个侧边栏** | 双挂载。删掉 `~/.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-alpha.5 dsh plugin --profile web add dsh-better-sidebar@0.28.0-alpha.0`。 |
| 提示 `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.0`。 |
</details>
## 🆕 最近更新
**v0.28.0 — 面向 DSH 0.2.1-rc.1+ 的插件正式版**
- 13 条 DSH peer 下限前移到 `^0.2.1-rc.1`,沿用 alpha.0 的功能实现,不增加运行时改动
- 上游 alpha.5 → rc.1 完整树差异共 355 个文件,全部为 `package.json`,源码零变化
- v0.28.0 即将接管插件 npm `latest`,但宿主 `latest` 仍为 0.2.0-rc.2;旧宿主必须按上表固定旧插件版本
- RC 验证待执行,见 [RC 适配记录](./docs/plans/2026-10-17-dsh-0.2.1-rc.1-adaptation.md);不把历史 alpha 测试统计当作 RC 验证证据
**v0.28.0-alpha.0(预发布)**
- 适配 DSH **0.2.1-alpha.5+**:HTTP/WS 改用宿主 Connection admission,移除已废弃的 invariant companion 与依赖
+3 -1
View File
@@ -2,7 +2,9 @@
> 面向 **消费插件开发者**:如何让你的插件向 better-sidebar 注册新的侧边栏页面(tab)和文件类型预览器。
>
> 适用版本:**v0.4.0+**(`ctx.betterSidebar` 服务);声明式设置 **v0.4.1+**;text/number 设置行 **v0.11.0+**;badge/生命周期/定向打开/插件设置/版本探测 **v0.12.0+**;select 设置行(`settingSelect`)与外链认领(`urlTarget`)**v0.13.0+**;统一 `@deepseek-ai/cordis` 类型基底 **v0.15.2+**;路由前缀安全解析(`hostRouteUrl`)**v0.25.0+**。当前版本 **v0.28.0-alpha.0**(13 条 DSH peer 下限 `^0.2.1-alpha.5`,仅支持 DSH **0.2.1-alpha.5+**;0.2.0-rc.2 请用 npm 已发布的 v0.26.1(v0.27.0 尚未发布),0.2.0-rc.1 请用 v0.24.1,0.1.7 线请用 v0.22.1——caret 范围跨 minor 不成立,`^0.1.7-rc.1` 会被 0.2.0 宿主的启动预检静默禁用)。**v0.19.0 移除了自绘右侧面板与自由窗口**(见 §0、§11);**自 v0.20.0 开发线起**(**注意:0.20.0 从未发布到 npm,这些变更全部落在 v0.21.1**)插件**移除了自带的终端**(宿主 0.1.6 的 `ui-sidebar-terminal` 取代,见 §4.4)、**移除了终端固定(pin)**,并在 0.1.7 上**把浏览器视图与只读文件预览整体让给宿主**(`ui-sidebar-browser` / `ui-sidebar-documentpreview`,见 §4.4、§5.4)、**收敛了外链接管**(见 §4.1)、**重写了设置接入面**(`SettingsForms`,见 §8.2)、**给文件树加了实时刷新**(见 §10);同时**删除了轮尾产物行接管**(DSH 0.1.6 把 `conversation.chat.turnTail` 从 chain 改成只能追加的 list,替换语义不复存在)。
> 适用版本:**v0.4.0+**(`ctx.betterSidebar` 服务);声明式设置 **v0.4.1+**;text/number 设置行 **v0.11.0+**;badge/生命周期/定向打开/插件设置/版本探测 **v0.12.0+**;select 设置行(`settingSelect`)与外链认领(`urlTarget`)**v0.13.0+**;统一 `@deepseek-ai/cordis` 类型基底 **v0.15.2+**;路由前缀安全解析(`hostRouteUrl`)**v0.25.0+**。当前版本 **v0.28.0 正式版**(13 条 DSH peer 下限 `^0.2.1-rc.1`,仅支持 DSH **0.2.1-rc.1+**;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——caret 范围跨 minor 不成立,`^0.1.7-rc.1` 会被 0.2.0 宿主的启动预检静默禁用)。**v0.19.0 移除了自绘右侧面板与自由窗口**(见 §0、§11);**自 v0.20.0 开发线起**(**注意:0.20.0 从未发布到 npm,这些变更全部落在 v0.21.1**)插件**移除了自带的终端**(宿主 0.1.6 的 `ui-sidebar-terminal` 取代,见 §4.4)、**移除了终端固定(pin)**,并在 0.1.7 上**把浏览器视图与只读文件预览整体让给宿主**(`ui-sidebar-browser` / `ui-sidebar-documentpreview`,见 §4.4、§5.4)、**收敛了外链接管**(见 §4.1)、**重写了设置接入面**(`SettingsForms`,见 §8.2)、**给文件树加了实时刷新**(见 §10);同时**删除了轮尾产物行接管**(DSH 0.1.6 把 `conversation.chat.turnTail` 从 chain 改成只能追加的 list,替换语义不复存在)。
> **正式版发布提醒**:v0.28.0 即将接管插件 npm `latest`,而宿主 npm `latest` 仍为 0.2.0-rc.2,不能据此判断兼容。旧 rc.2 宿主必须固定插件 v0.26.1;旧 alpha.5 固定 v0.28.0-alpha.0。用户已接受此标签分离,发布 workflow 不变。
> 本次 alpha.5 → rc.1 上游完整树差异 355 项全部为 `package.json`、源码零变化,因此不改功能实现;伴随依赖为 Cordis peer `^4.0.5` / dev `4.0.5`、group `1.0.5`、schemastery `~3.18.5`、include `1.0.10`。RC 验证单独记录于 [适配记录](plans/2026-10-17-dsh-0.2.1-rc.1-adaptation.md),不以已发布 alpha 的测试数字替代。
> 权威代码:`src/client/service.ts`(服务实现)、`src/client/builtins/`(内置 6 tab + 3 viewer 参考实现)、`lib/types/client/service.d.ts`(类型声明)。
> alpha.5 已删除 `@deepseek-ai/dsh-invariants` 与上游 `/invariant` 子路径;本插件同步移除 invariant companion,不提供替代注册服务。HTTP/WS 准入遵循宿主 Connection(见 §6.2)。
> 当前目录语义:文件 / Git / 终端与新建 sidechat 跟随会话 `working_directory`。live 读 `ctx.workingDirectory.get(session)`;cold 通过 `ctx.sessionQuery.observeSession` 的 all projections 读取并在 `finally` 释放 lease。linked worktree 仍按 base 目录记账;新 sidechat seed 尾部盖章当前 cwd,防止继承历史目录覆盖它。
+6 -4
View File
@@ -2,10 +2,12 @@
> 从 `AGENTS.md` §3 移出的深度参考(原 §3.4 第 1–12 条与 0.1.5–0.1.7 历史线中仍然生效的部分)。
> **编号保持不变**:代码、测试与文档里写的「AGENTS.md §3.4 第 N 条」就是本文第 N 条。
> 历史版本已不在支持线内(当前基线 DSH 0.2.1-alpha.5,见 [AGENTS.md](../AGENTS.md) §3);逐条适配过程见 [docs/plans/](plans/) 与 [CHANGELOG.md](../CHANGELOG.md)。
> 历史版本已不在支持线内(当前基线 DSH 0.2.1-rc.1,见 [AGENTS.md](../AGENTS.md) §3);逐条适配过程见 [docs/plans/](plans/) 与 [CHANGELOG.md](../CHANGELOG.md)。
当前适配约束:HTTP/WS 均由 `ctx.connection.requestRejection(req)` 裁决 Host/Origin 与浏览器认证,只有 `undefined` 放行,不读取已删除的 `webRuntime`。alpha.5 同时移除了 `@deepseek-ai/dsh-invariants`、`ctx.invariants` 和上游 `/invariant` 子路径;本插件不再发布 invariant companion。
本次 RC 适配只更新版本与依赖声明,不改变上述行为。alpha.5 → rc.1 上游完整树差异共 355 项、全部为 `package.json`,源码零变化;本次验证见 [RC 适配记录](plans/2026-10-17-dsh-0.2.1-rc.1-adaptation.md),不复用历史 alpha 测试数字。
## A. 0.1.5–0.1.7 引入、至今仍是现行约束的行为
**历史线**:0.1.5–0.1.7 的适配逐条记录在 [docs/plans/](plans/)(`2026-09-*-dsh-0.1.5/0.1.6/0.1.7-*-adaptation.md`)与 [CHANGELOG.md](../CHANGELOG.md),**已不在支持线内**,也不写运行时兼容层。下面几条是那几版引入、**至今仍是现行约束**的行为:
@@ -32,7 +34,7 @@
5. **`dsh-subagent` 的 `SUBAGENT_DESCRIPTOR_VERSION` 仍是 3**:sidechat 种子的 `subagent/descriptor` 版本由宿主包盖章,插件不硬编码;测试断言跟随常量(`tests/sidechat-routes.spec.ts`),勿钉字面量。
6. **`@deepseek-ai/dsh-client-runtime` 包已消亡**(继任 seed 是裸名 `dsh-client-store`,无 `/client` 子路径):peerDependencies、devDependencies、`dsh.client.inject`、chunk externals 白名单(`src/client/chunk-loader.ts` / `tsdown.config.ts` 各有一处说明它已移除的注释)**无活引用**。
7. **e2e scratch profile 的 `minimumReleaseAgeExclude` 含 `'@deepseek-ai/*'`**(字面配置在 `scripts/e2e-common.sh` 的 `e2e_write_profile` heredoc,`e2e-mount.sh` / `e2e-aggregate-mount.sh` 都调它;与仓库根 `pnpm-workspace.yaml` 同策):alpha 版本常在发布后 24h 内跑 lane,pnpm 11 的 `minimumReleaseAge` 默认会拒装新鲜包。
8. **插件开发树的 dsh-* 传递 peer 需提升为 devDependencies**:npm 上的宿主包把姊妹包(`dsh-attachment` / `scope` / `session-projection` / `system-prompt` / `user-approval` / `util-time` 等)声明为 peerDependencies(由宿主 bundle 树统一提供,插件仓库没有),插件若只直接依赖其中一部分,其余 peer 在 pnpm 下会解析到树上残留的旧版——测试加载即崩。因此 devDependencies 需涵盖 dev 树实际触达的全部 peer,与直接依赖同款精确钉版;**一律以 `pnpm peers check` 的实际输出为准,不要预加**(`dsh-workspace` / `dsh-agent-preset-registry` 只是 `dsh-subagent` 的 optional peer 且从不被 import)。当前伴随依赖为 Cordis `4.0.5`、schemastery `~3.18.5-alpha.2`、group `1.0.5-alpha.2` 与 include `1.0.10`;不直接钉 loader、不设 override,稳定 Cordis 同时满足宿主 alpha 与稳定传递 loader 的范围;`cordis-plugin-group` / `-include` 是 `dsh-app-boot` / `dsh-config-editor` 的**传递 peer**,只改 `dependencies` 不够(pnpm 会继续沿用 lockfile 里的旧副本),要**显式钉进 devDependencies** 才收敛。例外已消除:`dsh-client-locale` 与 DSH 同 tuple,不再允许落后。
8. **插件开发树的 dsh-* 传递 peer 需提升为 devDependencies**:npm 上的宿主包把姊妹包(`dsh-attachment` / `scope` / `session-projection` / `system-prompt` / `user-approval` / `util-time` 等)声明为 peerDependencies(由宿主 bundle 树统一提供,插件仓库没有),插件若只直接依赖其中一部分,其余 peer 在 pnpm 下会解析到树上残留的旧版——测试加载即崩。因此 devDependencies 需涵盖 dev 树实际触达的全部 peer,与直接依赖同款精确钉版;**一律以 `pnpm peers check` 的实际输出为准,不要预加**(`dsh-workspace` / `dsh-agent-preset-registry` 只是 `dsh-subagent` 的 optional peer 且从不被 import)。当前伴随依赖为 Cordis `4.0.5`、schemastery `~3.18.5`、group `1.0.5` 与 include `1.0.10`;不直接钉 loader、不设 override,Cordis peer 下限为 `^4.0.5`,dev 精确 `4.0.5`;与 RC 宿主及传递 loader 的范围一致;`cordis-plugin-group` / `-include` 是 `dsh-app-boot` / `dsh-config-editor` 的**传递 peer**,只改 `dependencies` 不够(pnpm 会继续沿用 lockfile 里的旧副本),要**显式钉进 devDependencies** 才收敛。例外已消除:`dsh-client-locale` 与 DSH 同 tuple,不再允许落后。
9. **右侧栏是 DSH 原生栏,插件只提供 tab 类型**(**编号提示**:旧文与代码注释里把它引用作 `§3.10` / `§3 第 10 条`——`tests/native-surface-cross-session.spec.ts` 的 `§3.10` 与指南 §10 表格里的「第 10 条」都指本条):聊天里一切文件打开(工具行 / 产物行 / 正文提及 / 行内代码路径)统一走 `ctx.sidebarRight.openResource(fileAddressFor(sessionId, cwd, path))`,其中文件地址语法为「一律 session 作用域、绝对路径保留前导 `/`」,`parseFileAddress` 前缀解析并去 `?`/`#`。插件的每个 `TabDescriptor` 注册成原生 tab 类型(`kind = descriptor.id`,`extension` 带)+ 原生 tab 体(`sidebar.right.pane.tab` keyed 槽,key = `dsh-better-sidebar:<id>`);`editor` 类型同时认领 `dsh-resource://file/**`(**但按本文 A 节的清单让出一部分**),并接管内置 `files` 页面 kind(`openTab('files')` 打开插件文件树,注销即复位)。`ctx.sidebarRight.openTab/openResource/close` 只对**在屏会话**写入,跨会话用具体类上的 `openTabIn/openResourceIn/closeIn`;原生 tab 的插件侧状态在 `src/client/native/tab-adapter.tsx`。几条硬事实:
- **注册必须等服务、不能等槽声明**:原生栏先声明 `sidebar.right.pane.tab` 再 `provide('sidebarRightTabs')`,真机 profile 上槽声明回调里 `ctx.get('sidebarRightTabs')` 仍是 undefined(实测 3 秒后才出现),按槽触发注册会静默什么都不注册且永不重试——用 `ctx.inject(['sidebarRightTabs'], cb)` 驱动类型注册(`tests/native-surface.spec.ts` 以「槽先触发、服务后到达」的顺序守护)。
- `SidebarRightGuideEntry.id` **必填且同 provider 内唯一**(缺它会静默清空整个承载面);同 provider 的 guide 条目是**追加**关系(`chain` 那种「替换宿主条目」的语义只存在于 `conversation.chat.turnTail` 且已被上游改成 `list`)。**指南只描述 ≤4 条条目**(`GuideBody.tsx` 的 `MAX_DESCRIBED_ENTRIES`):更长是整列丢弃而不是截断——插件默认贡献 4 个 guide 条目(文件 / Git / 任务管理 / 侧边对话),加上宿主终端条目后可能超限;插件**不恢复**旧的 `nativeGuideDesc` 通用兜底句。
@@ -40,6 +42,6 @@
- **原生注册账本的两条不变量**(`tests/native-registration.spec.ts` 守护):① `live` 里同时装着描述符类型(键 = descriptor id)与 `files` 接管(键 = `FILES_KIND`,**永远不在 `wanted` 里**),清理循环必须**跳过 `FILES_KIND`**——它只由编辑器类型的 `wantsFiles/hasFiles` 开关分支与 seat disposer 管理;否则每次通知都会把它拆掉再重建,而 teardown 期间的那次重建会把 id 孤儿化:`tabs.register` 建在**宿主** ctx 上(宿主 ctx 此时仍活着)所以照样成功,紧随的 `ctx.slots.inject` 建在**插件** ctx 上却抛 `cannot create effect on inactive context`,`live.set` 永不执行 → 该 id 在整页生命周期内不可再注册(真机表现:`native register files error: … already registered` 刷屏 + 文件树落到宿主空态,只有刷新页面才恢复;实证见 [docs/plans/2026-09-28-native-files-takeover-reload-leak.md](plans/2026-09-28-native-files-takeover-reload-leak.md))。② 因此「注册成功一半」是**可达状态**:任何在宿主取走 id **之后**失败的注册(槽位注册抛错等)必须**回滚释放该 type** 并释放已经建好的槽位,插件侧只留一个下次通知可以重试的失败,绝不留下无处释放的 id。相关断言必须写在注册表的**事件日志**上而不是「活着的 id 集合」上:孤儿 id 会让键集合看起来完全正常,键集合断言在未修复代码上同样通过。
- **原生 tab 的状态保留(已采纳 `keepMounted: true`)**:宿主因此把访问过的 body 挂住,同会话切 tab 不再卸载,组件态(树滚动、未保存草稿、chip 重命名)随之免费保留,**不需要**任何 module-level 记忆。三条必须同时成立的配套事实:(a) **记录不能随卸载删除**(只由 `surface.close` 与「会话消失」回收),而「切回会话清零」那一路(真机日志里 `DISPOSE type …:files` → `register`、同键 `drop`+`mint`)已由上面的 `FILES_KIND` 守卫挡掉(真机 e2e 现断言跨会话 `scrollTop` 复原);(b) 原生 tab id **每会话各自计数**(`tab1`…)且多会话同号并存,记录与写面一律按 `sessionId::tabId` 记账,`Surface.update/has/activate` 的 `sessionId` 缺省按 `sidebarRight.mounted` 解析,多会话同名时**拒绝而不是猜**;(c) **展开集的权威在插件 store 的会话状态里**(`attachStore` + `syncExpanded` + `getSessionStates().expanded`,由 `native/index.ts` 绑定),记录只负责**身份**与投影——两套持久化会互相打架,插件不自持「每记录的展开集」。设计过程与实测见 [docs/plans/2026-09-25-native-tab-state-retention-keepmounted.md](plans/2026-09-25-native-tab-state-retention-keepmounted.md)。
10. **自定义种子必须带 fork 标记对(`meta.isSeeded: true` + `inheritedEventCount`),且 create 后必须 `inbox.clear()`、冷恢复必须按 id 精确清扫——标记对必要但不充分**:dsh-session 契约规定「只给 seed 不标 isSeeded,种子算重放历史而非继承前缀」——缺标记时 `Session.ownEvents()` 含整个种子,子会话的 inbox 折重放种子里的 `agent/inbox/spliced`,**继承父会话切割时刻未领取的 inbox 输入**。**但运行时 inbox 不走 `ownEvents()`**:`ReactLoopInbox.current()` → `ctx.sessionProjections.stateOf()` → `SessionProjectionRegistry.cellFor` 折的是 `snapshotEvents()` **全量日志(含继承种子前缀)**,且标准 inbox 投影的 `init` 忽略 `inheritedEventCount`、注册表 `session/created` 急切初始化跳过一切种子会话(seq ≠ 0)——种子里的 `agent/inbox/spliced` 会原样重放进子会话 live inbox。因此 sidechat 宿主 `agents.create` 成功后、任何 inject/followup 之前必须 `handle.agent.inbox.clear()`(durable 补偿 splice 是 own 事件,冷恢复折存储日志同样归零)。**幽灵的来源比「父会话排队」更宽**:父会话 mid-turn 且工具有未返回调用时,种子被截断在 `turn/start` 之前,而 inbox 的「领取」splice 发生在 `turn/start` **之后** → **父会话本轮开头已领取的输入**在种子折叠里仍是 pending;`clear()` 是唯一能一次清干净的硬围栏(create 时本线程自己不可能有排队输入)。**冷恢复不能沿用 `clear()`**(会误杀「用户在线程里排队、宿主重启后尚未领取」的合法输入):改为 `dropInheritedGhosts`——`inheritedPendingIds(log, inheritedEventCount)` 只折继承前缀得到幽灵 id 集合,再逐个 `agent.inbox.remove(id)`,精确且幂等(`src/sidechat-core.ts` 纯函数,`tests/sidechat-core.spec.ts` / `tests/sidechat-routes.spec.ts` 守护)。宿主 `session.fork`(api-session-controller)的调用即规范形态(注意:宿主自己的 `fork` **没有**这一步补偿,同窗口有同样的暴露面);回归由 `tests/sidechat-seed-validation.spec.ts`(真实 `Session.create` + 对 `ownEvents()` 跑 inbox 折 + **真实 `SessionProjectionRegistry`** 折全量日志钉住上游洞与 clear 补偿)守护。**模型选择同为 agent 作用域**:`sidechat.model` 必须同时落 `session.append('model/selection', …)`(宿主 `selectForNextRequest` 的同一形状)与 `installModelSelection(agent.ctx, ref)`(`@deepseek-ai/dsh-agent` 公开导出),否则控制器缓存的 per-agent selection 永不回读投影;resume 后也要按日志里的有效选择重装(`src/sidechat-routes.ts` 的 `ensureModelSelection`)。**上游 0.2.0 新增的 `buildForkSeed` 与本插件手工的 `buildSidechatInheritance` 职责重叠,但收益不明确**(插件另有 dangling-tool-call 退回结构化快照的自有需求),暂不替换。
11. **`dsh.plugin.json` 从来不是 DSH 契约**(全树 grep 0 命中):DSH 真正读的是 `package.json` 的 `dsh.bundle.patch` + `dsh.client`(`platform`/`inject`/`immediately`/`external`)+ `exports["./client"]`。`dsh.plugin.json` 与 `lib/client-registry.js` 只服务第三方 registry(社区市场)通道,`tests/manifest-consistency.spec.ts` 守护的是这条通道的形状,不是 DSH 契约。**不要混淆两个 manifest 的 `engines.dsh`**:alpha.5 的兼容性检查优先读取 `package.json#engines.dsh`,存在时由它独立裁决;本插件未声明此字段,仍由 13 条 DSH peer 决定兼容性。`dsh.plugin.json#engines.dsh` 只是第三方 registry 元数据,不能替代 package 字段;`dsh.manifestVersion` 也不是版本兼容性开关。`dsh.bundle.patch` 有形状校验(非法值会 `throw`,引导期跳过该 bundle),本插件是合法的单字符串。
11. **`dsh.plugin.json` 从来不是 DSH 契约**(全树 grep 0 命中):DSH 真正读的是 `package.json` 的 `dsh.bundle.patch` + `dsh.client`(`platform`/`inject`/`immediately`/`external`)+ `exports["./client"]`。`dsh.plugin.json` 与 `lib/client-registry.js` 只服务第三方 registry(社区市场)通道,`tests/manifest-consistency.spec.ts` 守护的是这条通道的形状,不是 DSH 契约。**不要混淆两个 manifest 的 `engines.dsh`**:当前宿主的兼容性检查优先读取 `package.json#engines.dsh`,存在时由它独立裁决;本插件未声明此字段,仍由 13 条 DSH peer 决定兼容性。`dsh.plugin.json#engines.dsh` 只是第三方 registry 元数据,不能替代 package 字段;`dsh.manifestVersion` 也不是版本兼容性开关。`dsh.bundle.patch` 有形状校验(非法值会 `throw`,引导期跳过该 bundle),本插件是合法的单字符串。
**插件展示元数据**(Plugins 页与 `plugin_manager` 列表,v0.21.1 起已采纳)三条硬规则:`package.json#icon` 必须是**包内相对路径**且写进 `files`(36×36、纯填充无描边、**双色渐变**——与 DSH 自带 `PluginArtwork*` 同风格,单色版在 30px 行内尺寸下会读成一块纯色板);`locale/en.json` 是发现基线(缺它整个目录都不读,`meta.title` / `description` 在这里);`exports` 必须暴露 `./locale/*.json` 与 `./package.json`。**所有失败都是静默的**——元数据有问题只会退化成一行纯文字,没有任何报错;`tests/plugin-meta.spec.ts` 守护「声明了就必须发布出去」。plugin-manager 侧另有**多 registry 回退**(配置源 → `fallbackRegistries`,默认含 `registry.npmmirror.com`;`network`/`timeout`/`not-found`/`no-matching-version` 会自动问下一个源;`registry` 入参只存在于 Web 对话框与 `plugin_manager` 工具,**CLI 没有 registry flag**)。
12. **宿主版本兼容性是启动期硬约束**:alpha.5 先读插件 `package.json#engines.dsh`;字段存在时只按该范围判定,DSH peer 不再拓宽或收窄结果。字段缺席时回退检查名字为 `@deepseek-ai/dsh` 或以 `@deepseek-ai/dsh-` 开头的 peer,按 `semver.satisfies(宿主版本, range, { includePrerelease: true })` 判定。本插件刻意不新增该字段,仍由 13 条 DSH peer 的 `^0.2.1-alpha.5` 支持线约束,optional peer 没有豁免。`engines` 非对象或 `engines.dsh` 非字符串会导致兼容性清单不可读并拒绝加载;`workspace:` 仅在 peer 中有效。安装与 profile 启动拒绝可能禁用整行,需读 `disabling profile plugin` 日志;拒绝记录字段已由 `peers` 改为 `requirements`,其中 key 为 `engines.dsh` 或回退检查的 peer 包名。`pnpm peers check` 校验的是 dev 依赖树,不能证明宿主启动预检通过。[官方升级指南](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-alpha.5/docs/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.md)。
12. **宿主版本兼容性是启动期硬约束**:当前宿主先读插件 `package.json#engines.dsh`;字段存在时只按该范围判定,DSH peer 不再拓宽或收窄结果。字段缺席时回退检查名字为 `@deepseek-ai/dsh` 或以 `@deepseek-ai/dsh-` 开头的 peer,按 `semver.satisfies(宿主版本, range, { includePrerelease: true })` 判定。本插件刻意不新增该字段,仍由 13 条 DSH peer 的 `^0.2.1-rc.1` 支持线约束,optional peer 没有豁免。`engines` 非对象或 `engines.dsh` 非字符串会导致兼容性清单不可读并拒绝加载;`workspace:` 仅在 peer 中有效。安装与 profile 启动拒绝可能禁用整行,需读 `disabling profile plugin` 日志;拒绝记录字段已由 `peers` 改为 `requirements`,其中 key 为 `engines.dsh` 或回退检查的 peer 包名。`pnpm peers check` 校验的是 dev 依赖树,不能证明宿主启动预检通过。[官方升级指南](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-alpha.5/docs/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.md)。
@@ -0,0 +1,63 @@
# DSH 0.2.1-rc.1 适配记录(插件 v0.28.0 正式版)
> 状态:实施中。RC 挂载与发布尚待验证;不声明已经发布或完整验收通过。本记录只采用本次 RC 的新鲜证据,不沿用已发布 alpha 的测试数字。
## 1. 已批准范围与支持线
- 宿主基线:DSH `0.2.1-rc.1`;插件正式版本:`0.28.0`。
- 13 条 DSH peer 下限统一为 `^0.2.1-rc.1`;开发依赖、CI 与安装脚本精确钉 RC。
- 本次不改功能实现、不新增运行时兼容层;沿用 alpha.5 适配的 Connection admission、当前执行目录、终端 labels、Context 联动及 Git 图谱等行为。
- 伴随依赖:Cordis peer `^4.0.5` / dev `4.0.5`、group `1.0.5`、schemastery `~3.18.5`、include `1.0.10`。
| 宿主版本 | 使用插件 |
| --- | --- |
| DSH 0.2.1-rc.1+ | v0.28.0 |
| DSH 0.2.1-alpha.5 | 固定 v0.28.0-alpha.0 |
| DSH 0.2.0-rc.2 | 固定 v0.26.1 |
| DSH 0.2.0-rc.1 | 固定 v0.24.1 |
| DSH 0.1.7-rc.1 至 0.1.7 正式版 | 固定 v0.22.1 |
| DSH 0.1.7-alpha.x | 先升级宿主到 rc.1 |
| DSH 0.1.6 及更早(含 0.1.5) | 固定 v0.19.1 |
## 2. 上游差异与功能边界
已批准计划的源码取证结论:alpha.5 → rc.1 上游完整树差异共 **355 个文件,全部为 `package.json`,源码零变化**。因此本批适配只更新版本、依赖与文档,不借版本前移增加功能或重写既有实现。
主线程另行完成已发布产物核查:24 个消费包 × 两个版本,共 48 个 tarball 的 integrity 均匹配;非 manifest 内容除 client-modules 的一行遥测 commit 戳外相同,消费声明与裸 import 差集无变化。会话格式仍为 4,子代理描述符仍为 3,profile roster 仍为 58 项。源码树与已发布产物分别记录,不把产物遥测戳误写成源码行为变化。
## 3. 正式版进入 latest 的明确风险
v0.28.0 **即将接管插件 npm `latest`**,而 DSH 自身的 npm `latest` 此时仍指向 **0.2.0-rc.2**。用户已明确接受这一标签分离:不能把“宿主和插件都装 latest”当作兼容安装方法。
- 新用户须先显式升级宿主到 `0.2.1-rc.1`,再安装插件 v0.28.0。
- 旧 rc.2 宿主必须固定 `dsh-better-sidebar@0.26.1`;旧 alpha.5 固定 `dsh-better-sidebar@0.28.0-alpha.0`。
- 不为保留旧宿主而放宽本版 peer 下限。
- 发布沿用现有 workflow:无预发布后缀的插件版本进入 `latest`,不修改 workflow,也不把本次插件正式版标成 alpha。
正式版安装命令(发布完成后):
```sh
dsh plugin --profile web add dsh-better-sidebar@0.28.0
```
## 4. 本次 RC 验证矩阵
以下已执行结果由主线程提供并回填;文档子任务本身未运行测试、安装、构建或打包。未完成项保持待验证。
| 检查 | 当前状态 |
| --- | --- |
| 上游完整源码树差异 | 已核对:355 项全部 package.json,源码零变化 |
| 消费包产物 integrity / 类型面 / import 差集 | 主线程已复核报告:48 tarball integrity 匹配,类型及 import 无变化 |
| 会话格式 / 子代理描述符 / profile roster | 主线程已复核:4 / 3 / 58,未变 |
| 安装 RC 依赖与 peers 检查 | 已执行;仅可选 better-locale 的 4 条历史 peer 警告 |
| typecheck / lint | 主线程报告通过 |
| 构建后完整单元测试 | 主线程报告:221 文件,2682 passed / 17 skipped(共 2699),28.83 s |
| build / browser consumer types / pack | 主线程报告通过 |
| 精确 DSH 0.2.1-rc.1 真实挂载 | 13 passed / 3 skipped,2.6 min;Context 专用用例由独立三态 lane 覆盖 |
| RC 聚合双挂载与 Context 联动 | 通过;聚合 settings.get 返回 ok:true、未知方法 404;Context dual / tab-only / no-context 三态各 1 项通过,另 2 项按变体跳过 |
| 远端 Linux / Windows / plugin-mount CI | 待验证 |
| GitHub Release 与 npm latest / provenance | 待发布与验证 |
## 5. 文档同步与历史保留
当前基线、安装警告、支持线和伴随依赖同步至 AGENTS、双语 README、接入指南及宿主契约;双语 CHANGELOG 只新增 v0.28.0 条目,已发布 v0.28.0-alpha.0 及更早正文不改写。历史 alpha 验证记录仅作历史,不作为 RC 挂载或发布成功的证据。
+2 -2
View File
@@ -1,10 +1,10 @@
{
"id": "dsh-external/dsh-better-sidebar",
"version": "0.28.0-alpha.0",
"version": "0.28.0",
"main": "./lib/index.js",
"description": "更好用的右侧边栏——文件树、编辑器、文件变动、任务和侧边对话都收在这一栏里,每个会话互不干扰。暴露服务供其他插件注册侧边栏页面与文件预览器",
"engines": {
"dsh": ">=0.2.1-alpha.5"
"dsh": ">=0.2.1-rc.1"
},
"contributes": {
"tools": [],
+45 -45
View File
@@ -1,6 +1,6 @@
{
"name": "dsh-better-sidebar",
"version": "0.28.0-alpha.0",
"version": "0.28.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": {
@@ -90,20 +90,20 @@
},
"license": "MIT",
"peerDependencies": {
"@deepseek-ai/cordis": "^4.0.5-alpha.2",
"@deepseek-ai/dsh-agent": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-client-locale": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-settings": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-sidebar-right": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-slots": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-host-webserver": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-llm": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-session": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-settings": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-subagent": "^0.2.1-alpha.5",
"@deepseek-ai/dsh-tools": "^0.2.1-alpha.5",
"@deepseek-ai/cordis": "^4.0.5",
"@deepseek-ai/dsh-agent": "^0.2.1-rc.1",
"@deepseek-ai/dsh-client-locale": "^0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-primitives": "^0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-sidebar-right": "^0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.1",
"@deepseek-ai/dsh-host-webserver": "^0.2.1-rc.1",
"@deepseek-ai/dsh-llm": "^0.2.1-rc.1",
"@deepseek-ai/dsh-session": "^0.2.1-rc.1",
"@deepseek-ai/dsh-settings": "^0.2.1-rc.1",
"@deepseek-ai/dsh-subagent": "^0.2.1-rc.1",
"@deepseek-ai/dsh-tools": "^0.2.1-rc.1",
"@huanlin/dsh-plugin-better-locale": "^0.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
@@ -138,7 +138,7 @@
"@codemirror/search": "^6.7.1",
"@codemirror/state": "^6.7.1",
"@codemirror/view": "^6.43.8",
"@deepseek-ai/schemastery": "~3.18.5-alpha.2",
"@deepseek-ai/schemastery": "~3.18.5",
"@formkit/auto-animate": "^0.10.0",
"@lezer/highlight": "^1.2.3",
"@xterm/addon-fit": "^0.11.0",
@@ -154,36 +154,36 @@
"devDependencies": {
"@cordisjs/plugin-loader": "^1.0.0-rc.5",
"@deepseek-ai/cordis": "4.0.5",
"@deepseek-ai/cordis-plugin-group": "1.0.5-alpha.2",
"@deepseek-ai/cordis-plugin-group": "1.0.5",
"@deepseek-ai/cordis-plugin-include": "1.0.10",
"@deepseek-ai/dsh-agent": "0.2.1-alpha.5",
"@deepseek-ai/dsh-agent-loop": "0.2.1-alpha.5",
"@deepseek-ai/dsh-attachment": "0.2.1-alpha.5",
"@deepseek-ai/dsh-client-locale": "0.2.1-alpha.5",
"@deepseek-ai/dsh-client-store": "0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-settings": "0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-alpha.5",
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.5",
"@deepseek-ai/dsh-host-webserver": "0.2.1-alpha.5",
"@deepseek-ai/dsh-llm": "0.2.1-alpha.5",
"@deepseek-ai/dsh-ptc-runtime": "0.2.1-alpha.5",
"@deepseek-ai/dsh-sandbox": "0.2.1-alpha.5",
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-alpha.5",
"@deepseek-ai/dsh-scope": "0.2.1-alpha.5",
"@deepseek-ai/dsh-session": "0.2.1-alpha.5",
"@deepseek-ai/dsh-session-persistence": "0.2.1-alpha.5",
"@deepseek-ai/dsh-session-projection": "0.2.1-alpha.5",
"@deepseek-ai/dsh-settings": "0.2.1-alpha.5",
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.5",
"@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.5",
"@deepseek-ai/dsh-tools": "0.2.1-alpha.5",
"@deepseek-ai/dsh-user-approval": "0.2.1-alpha.5",
"@deepseek-ai/dsh-util-code-language": "0.2.1-alpha.5",
"@deepseek-ai/dsh-util-time": "0.2.1-alpha.5",
"@deepseek-ai/dsh-util-workspace-path": "0.2.1-alpha.5",
"@deepseek-ai/dsh-working-directory": "0.2.1-alpha.5",
"@deepseek-ai/dsh-agent": "0.2.1-rc.1",
"@deepseek-ai/dsh-agent-loop": "0.2.1-rc.1",
"@deepseek-ai/dsh-attachment": "0.2.1-rc.1",
"@deepseek-ai/dsh-client-locale": "0.2.1-rc.1",
"@deepseek-ai/dsh-client-store": "0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-rc.1",
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.1",
"@deepseek-ai/dsh-host-webserver": "0.2.1-rc.1",
"@deepseek-ai/dsh-llm": "0.2.1-rc.1",
"@deepseek-ai/dsh-ptc-runtime": "0.2.1-rc.1",
"@deepseek-ai/dsh-sandbox": "0.2.1-rc.1",
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-rc.1",
"@deepseek-ai/dsh-scope": "0.2.1-rc.1",
"@deepseek-ai/dsh-session": "0.2.1-rc.1",
"@deepseek-ai/dsh-session-persistence": "0.2.1-rc.1",
"@deepseek-ai/dsh-session-projection": "0.2.1-rc.1",
"@deepseek-ai/dsh-settings": "0.2.1-rc.1",
"@deepseek-ai/dsh-subagent": "0.2.1-rc.1",
"@deepseek-ai/dsh-system-prompt": "0.2.1-rc.1",
"@deepseek-ai/dsh-tools": "0.2.1-rc.1",
"@deepseek-ai/dsh-user-approval": "0.2.1-rc.1",
"@deepseek-ai/dsh-util-code-language": "0.2.1-rc.1",
"@deepseek-ai/dsh-util-time": "0.2.1-rc.1",
"@deepseek-ai/dsh-util-workspace-path": "0.2.1-rc.1",
"@deepseek-ai/dsh-working-directory": "0.2.1-rc.1",
"@eslint/js": "^10.0.1",
"@huanlin/dsh-plugin-better-locale": "^0.1.0",
"@playwright/test": "^1.62.1",
+422 -422
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -44,7 +44,7 @@ e2e_require_cmd() {
# 回退的 npx 版本是显式钉死的:不钉就会解析 npm 的 dist-tag,可能静默挂到
# 插件不支持的宿主上。**必须写精确版本,不能写 `@next`/`@alpha` 等 dist-tag**。
# 该版本必须与 package.json 的 DSH peer 基线同步。
DSH_NPX_SPEC="${DSH_NPX_SPEC:-@deepseek-ai/dsh@0.2.1-alpha.5}"
DSH_NPX_SPEC="${DSH_NPX_SPEC:-@deepseek-ai/dsh@0.2.1-rc.1}"
e2e_resolve_dsh_cmd() {
local explicit="${DSH_CMD}"
if ! command -v "$DSH_CMD" >/dev/null 2>&1; then
@@ -66,7 +66,7 @@ e2e_resolve_dsh_cmd() {
# 己在挂什么),只告警。
e2e_check_dsh_version() {
local explicit="$1" actual expected
expected="${DSH_EXPECT_VERSION:-0.2.1-alpha.5}"
expected="${DSH_EXPECT_VERSION:-0.2.1-rc.1}"
# `dsh --version` 冷启动要走 npx,给足预算;拿不到版本就只告警。
actual="$($DSH_CMD --version 2>/dev/null | tr -d '[:space:]' | head -c 64 || true)"
case "$actual" in
+2 -2
View File
@@ -28,7 +28,7 @@
# 环境变量(均可省略):
# DSH_HOME 默认 %USERPROFILE%\.dsh
# REGISTRY 默认 https://registry.npmjs.org
# DSH_CMD 默认优先 PATH 上的 dsh,缺省回退 npx -y --package @deepseek-ai/dsh@0.2.1-alpha.5
# DSH_CMD 默认优先 PATH 上的 dsh,缺省回退 npx -y --package @deepseek-ai/dsh@0.2.1-rc.1
#
# 说明:
# - pnpm 11 的 minimumReleaseAge 会拒绝发布 <24h 的新版本。脚本会预写
@@ -173,7 +173,7 @@ Ensure-WorkspaceSettings
if ($CLI -eq 'dsh') {
$cliArgs = @('plugin', '--profile', $Profile, 'add', "$PKG@$SPEC")
} else {
$cliArgs = @('-y', '--package', '@deepseek-ai/dsh@0.2.1-alpha.5', 'dsh', 'plugin', '--profile', $Profile, 'add', "$PKG@$SPEC")
$cliArgs = @('-y', '--package', '@deepseek-ai/dsh@0.2.1-rc.1', 'dsh', 'plugin', '--profile', $Profile, 'add', "$PKG@$SPEC")
}
Say "执行 $CLI plugin --profile $Profile add $PKG@$SPEC ..."
$addOut = & $CLI @cliArgs 2>&1
+2 -2
View File
@@ -24,7 +24,7 @@
# 环境(均可省略,脚本会自动探测):
# DSH_HOME 默认 ~/.dsh(Windows Git Bash 下回退 $USERPROFILE/.dsh)
# REGISTRY 默认 https://registry.npmjs.org(发布源;装依赖仍走 pnpm 配置)
# DSH_CMD 默认优先用 PATH 上的 `dsh`,缺省回退 npx -y --package @deepseek-ai/dsh@0.2.1-alpha.5
# DSH_CMD 默认优先用 PATH 上的 `dsh`,缺省回退 npx -y --package @deepseek-ai/dsh@0.2.1-rc.1
#
# 说明:
# - pnpm 11 的 minimumReleaseAge 会拒绝发布 <24h 的新版本。脚本会预写
@@ -140,7 +140,7 @@ dsh_cli() {
if command -v "$DSH_CMD" >/dev/null 2>&1; then
printf '%s' "$DSH_CMD"
elif command -v npx >/dev/null 2>&1; then
printf 'npx -y --package @deepseek-ai/dsh@0.2.1-alpha.5 dsh'
printf 'npx -y --package @deepseek-ai/dsh@0.2.1-rc.1 dsh'
else
die "未找到 dsh 或 npx。请先安装 DSH(并确保 Node/npm 可用),或用 DSH_CMD 指定 dsh 路径。"
fi
+1 -1
View File
@@ -819,7 +819,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.0-alpha.0'
export const SIDEBAR_SERVICE_VERSION = '0.28.0'
/**
* Monotonic capability list consumers use to gate new API usage (features
+1 -1
View File
@@ -5,7 +5,7 @@
import { readFileSync } from 'node:fs'
import { describe, expect, it } from 'vitest'
const baseline = '0.2.1-alpha.5'
const baseline = '0.2.1-rc.1'
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'))
const bash = readFileSync(new URL('../scripts/install.sh', import.meta.url), 'utf8')
const powershell = readFileSync(new URL('../scripts/install.ps1', import.meta.url), 'utf8')
+1 -1
View File
@@ -142,7 +142,7 @@ describe('DSH community-market manifest compatibility', () => {
const dshPeers = Object.keys(peers).filter(name => name === '@deepseek-ai/dsh' || name.startsWith('@deepseek-ai/dsh-'))
expect(dshPeers.length).toBeGreaterThan(10)
for (const name of dshPeers) {
expect(peers[name], name).toMatch(/^\^0\.2\.1-alpha\.5$/)
expect(peers[name], name).toMatch(/^\^0\.2\.1-rc\.1$/)
}
})
})