前言¶
DeepSeek Harness(DSH)通过插件化架构扩展功能,但版本更新依赖手动检查 npm registry,对于习惯使用 npm 全局安装的用户来说存在遗漏更新的可能。这个插件在 DSH 的 Web 界面中提供版本对比与升级入口,减少手动查阅的时间。
插件定位¶
dsh-npm-update-notifier 是 DeepSeek Harness 的一个联网工具插件,由 Atirut Wattanamongkol 维护。它读取当前运行的 DSH CLI 已安装的 @deepseek-ai/dsh 版本,与 npm registry 的 latest 标签版本进行对比,在 Web 界面和通知栏中展示差异。
核心功能¶
- 版本对比:读取当前 DSH 已安装版本与 npm latest 版本,显示版本号和发布时间。
- 状态展示:在「Settings → General → DSH updates」中显示对比结果,包含「Up to date」或「Update available」徽章。
- 检查与升级:提供「Check now」按钮,以及带复制功能的升级命令。
- 通知提醒:当存在更新时,右上角显示可关闭的通知,仅当检测到更新版本时重新出现。
- 缓存策略:检查结果缓存
checkIntervalMinutes(默认 60 分钟),打开的页面每 6 小时重新读取缓存。 - 多注册表支持:可配置 registryUrl,用于 npm 或镜像源。
安装与启用¶
从 GitHub 仓库安装:
dsh plugin --profile web add git+https://github.com/atirutw/dsh-npm-update-notifier
或从本地克隆安装:
dsh plugin --profile web add /path/to/dsh-npm-update-notifier
在 Web GUI 中也可通过「Plugins → Add plugin」选择目录安装。安装后若 bundle 未立即加载,需重启 DSH。
配置说明¶
默认配置如下:
- id: dsh-npm-update-notifier
name: dsh-npm-update-notifier
config:
checkIntervalMinutes: 120
timeoutMs: 8000
registryUrl: https://registry.npmjs.org
packageName: "@deepseek-ai/dsh"
| 字段 | 默认值 | 说明 |
|---|---|---|
checkIntervalMinutes |
60 |
成功检查结果的缓存时长。设为 0 则每次请求都检查。 |
timeoutMs |
10000 |
registry 请求超时时间,被限制在 1–60 秒。 |
registryUrl |
https://registry.npmjs.org |
查询的 npm registry 地址。 |
packageName |
@deepseek-ai/dsh |
监控的包名。 |
适用场景与注意¶
- 适合通过 npm 全局安装 DSH 的用户,通过源码启动的本地构建也可使用。
- 桌面打包构建可能无法获取已安装包路径,此时安装行会显示「installed package could not be located」。
- 插件仅发送 GET 请求获取 npm packument,无遥测数据。
- 通知关闭状态存储在浏览器 localStorage,按浏览器和版本分别记录。
- 升级命令根据安装路径推断为 npm、pnpm 或 yarn global。
- 预发布版本按 semver 规则排序。
- 插件与 DeepSeek 无官方隶属关系。
总结¶
dsh-npm-update-notifier 将 npm 版本检测集成到 DSH Web 界面,提供状态展示与一键升级入口。适合需要保持 DSH 版本更新的 npm 全局安装用户,安装前建议检查源码与许可证。
- 目录页:https://www.skillhub.cn/plugins/atirutw/dsh-npm-update-notifier
- GitHub:https://github.com/atirutw/dsh-npm-update-notifier