dsh-plugin-updater
Every plugin, one click. Updating plugins in DSH means opening each bundle's page and pressing Update, one by one. This plugin adds a single Updates tab: it checks every installed plugin and updates all of them in one click.
DSH 更新插件只能一个个点进插件详情页、逐个点「更新」。这个插件在「插件」页加一个「可更新」标签:检查所有插件,点一次「全部更新」,全部升到最新兼容版本。
需要 DeepSeek Harness
>= 0.2.2-rc.1 < 0.4.0(Web / Desktop profile)。 用到的远程接口(pluginManager.listVersions/updateBundle)自 0.2.2-rc.1 起提供;当前在 0.2.2-rc.5 上实测。
功能
- 一键批量更新:不用再逐个点进插件详情页。标签里列出所有有新版的插件(当前版本 → 最新兼容版本),点「全部更新」按顺序装完。
- 走官方通道:调用 DSH 自己的
pluginManager.updateBundle,和单个插件详情页的「更新」完全同一条路径,不额外跑脚本、不改 profile 文件。 - 候选版本与官方一致:必须有
dsh.bundle、兼容当前 DSH 版本、非预发布、未弃用;不满足的版本不会选。 - 过程可见可控:显示「正在更新 2/5」和当前插件名;结束给出成功 / 需重启 / 失败计数;可以「停止」(当前这个装完后停),失败行可「重试」。
- 切标签不中断:批量任务的状态在组件外,切到「已安装」再回来,进度和结果都还在。
- 跟随主题与语言:只用
--dsw-*主题 token,中文 / 英文字典跟随 DSH 语言设置。
安装
应用内(推荐)
- 侧边栏打开 插件。
- 点右上角 +(添加插件)。
- 填仓库地址:
https://github.com/ZNovaDev/dsh-plugin-updater,安装。 - 切到 可更新 标签即可使用。
也可以钉住某个提交:https://github.com/ZNovaDev/dsh-plugin-updater#<commit>。
CLI(非 Desktop 的自建 profile)
dsh plugin --profile <profile> add https://github.com/ZNovaDev/dsh-plugin-updater
Desktop 的 desktop profile 由应用自己管理,用上面的应用内方式安装。
使用
- 打开 插件 → 可更新,标签页自动检查版本(最多 4 个注册表查询并发)。
- 核对列表里的版本号,点 全部更新(N)。
- 需要重启的更新会在结束后提示;重启 DSH 后生效。
- 想重新读取版本点 重新检查。
限制
- 只覆盖从 npm 注册表安装的插件;从 Git(
github:owner/repo#commit)或本地目录 /link:安装的插件不参与,请用它们自己的方式更新。 - 只做「更新」,不负责安装新插件、不修改插件配置、不改启用状态。
- 更新期间插件可能短暂停止(官方更新路径会先卸载旧版本再装新版本,失败时自动恢复旧版本)。
- 版本检查依赖注册表可达;全部检查失败时会明确提示,而不是报「已是最新」。
工作原理
插件页 ── 贡献 plugins.tab 标签 ──▶ dsh-plugin-updater(浏览器端 client.js)
│ ctx.remote.pluginManager.listBundles()
│ ctx.remote.pluginManager.listVersions(name)
▼
ctx.remote.pluginManager.updateBundle(name, version, { registry })
client.js是手写的浏览器端模块(window.__ModuleLoader__.load),无需构建。index.js是空的宿主端;包通过dsh.bundle.patch成为一个 bundle。locale/*.json提供插件列表里的标题、描述。
开发
git clone https://github.com/ZNovaDev/dsh-plugin-updater.git
把仓库目录作为本地插件安装(插件页「添加插件」里填绝对路径),改 client.js 后浏览器端会热更新;改 package.json / index.js / patch 后在插件页重新启用或重装一次。
目录:
index.js 宿主端入口(空)
client.js 浏览器端:标签页 UI + 批量更新流程
cordis.patch.yml bundle patch:插入一行插件
locale/{zh,en}.json 插件管理器的标题 / 描述
icon.svg 插件图标
English
Adds an Updates tab to the Plugins page, so updating every plugin no longer means opening each bundle's page and pressing Update one by one. It lists every plugin installed from an npm registry that has a newer compatible version and installs them one after another through DSH's own pluginManager.updateBundle, with per-plugin progress, stop, and retry. Plugins installed from Git or a local directory are not included. Updates that change host code need a DSH restart.
Install: Plugins → + → https://github.com/ZNovaDev/dsh-plugin-updater.
License
MIT © ZNovaDev
No comments yet. Be the first to write one.