前言¶
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