Skip to content

v0.27.0 — 支持 DSH 0.2.x(不再被判定不兼容而跳过)

Latest

Choose a tag to compare

@He2way He2way released this 23 Oct 08:38

v0.27.0 — 支持 DSH 0.2.x / DSH 0.2.x support

问题:升级到 DSH 0.2.1-rc.2 后整个工作台消失。原因不是崩溃,而是 DSH 现在会静默跳过 engines.dsh 范围不含当前版本的 profile bundle:

dsh: skipping profile bundle "dsh-task-console": Error: Plugin dsh-task-console@0.26.1
is incompatible with dsh 0.2.1-rc.2: requirements {"engines.dsh":">=0.1.5-rc.1 <0.2.0-0"}

插件从未被加载,所以它自己不会给出任何报错。

修复:

  • engines.dsh 扩到 ">=0.1.5-rc.1 <0.3.0-0",覆盖 0.2 代;并把插件真正用到的客户端 API 在 0.2.1 上逐项核对(modules/remote、slots(shell.overlay 仍是 list 槽、register({name,id,order,label}, Component) 形式不变)、标准 props(useSessions/useSessionStatus)、sessions(create/fork/retain/using/binding/list)、会话面(prompt/updateQueue/cancel/getSnapshot)、workspaces(list/archiveSession(sessionId, options?))、模块加载握手、dsh.client 清单字段)。
  • 新增 npm run check:compat:用 DSH 自己的评估器(dsh-app-boot 的 evaluatePluginCompatibility)遍历本机所有 DSH 版本,最新版本会跳过本插件时直接失败。npm test 也跑同一检查(本机没有 DSH 时自动跳过),并断言范围仍覆盖 0.1→0.3、CHANGELOG 顶部版本与 package.json 一致、以及在 DSH 形状的 ctx 上调用 apply() 仍能完成 shell.overlay 注册。
  • 顺手加固与新版 React 的兼容:任务台里每个 useSessions 选择器只返回快照中已有的引用,子代理行改用 useMemo 派生,避免 useSyncExternalStore 在快照未变时读到新对象。

升级后注意:profile 组合在启动时计算,所以要把正在运行的 dsh web 重启一次(再按 Ctrl+Shift+R 刷新页面),插件才会重新被组合进来。

Install / 安装

dsh plugin --profile web add dsh-task-console           # npm(发布后)
dsh plugin --profile web add ./dsh-task-console.tgz     # 本 Release 的预构建 tarball

Full changelog / 完整变更记录: CHANGELOG.md