前言¶
用 DeepSeek Harness(dsh)做 profile 開發時,第三方插件往往通過 dsh plugin --profile <p> add <pkg> 裝進 ~/.dsh/profiles/<p>/。裝多了容易忘記裝了誰、版本是否落後;依賴寫在 package.json 的 dependencies 裏,卻未必出現在 dsh.profile.bundles,等於沒真正進插件層;想對照 registry 更新,還得自己進 profile 目錄跑 pnpm outdated 和升級命令。官方「設置 → 插件」頁主要回答「哪些插件被 Loader 加載、啓用狀態如何」,和「外部 npm/git 包裝了沒、能不能升」是兩條線。下面介紹社區插件 dsh-plugin-management(維護者 YUYUY9527):在設置里加「外部插件」視圖,並給 agent 暴露查詢與更新工具。
這是什麼¶
dsh-plugin-management 是面向 dsh 的外部插件管理器:對當前 profile 裏非 @deepseek-ai/* 的第三方依賴做 inventory(已裝版本、版本範圍、是否生效爲插件層、能否更新),並支持一鍵更新、卸載,以及複製各包的安裝命令。
- 倉庫:YUYUY9527/dsh-plugin-management
- 目錄頁:SkillHub 插件頁
- 分類:客戶端(Settings → Plugins UI + agent 工具
external_plugins) - 許可證:MIT(見倉庫
package.json) - 當前包版本(資料):1.2.1
核心功能¶
| 能力 | 說明 |
|---|---|
| 外部插件清單 | 列出 profile dependencies 中外部包:已裝版本、範圍、是否在 dsh.profile.bundles 中生效、registry 或 link: 等本地 spec |
| 版本檢查 | 使用 pnpm outdated --format json,區分範圍內可更新與需 --latest 的跨大版本升級 |
| 一鍵更新 | 單包、全部可更新、跨大版本(latest)三種粒度 |
| 卸載 | 面板兩行確認後執行 dsh plugin --profile <p> remove <包名>,並從 dsh.profile.bundles 移除 |
| 安裝命令展示 | 每行給出可複製的 dsh plugin --profile <p> add …(registry 可釘最新;本地/git/tarball 原樣複用 spec) |
| 結果回顯 | 展示實際命令、退出碼、stdout/stderr 尾部,並提示需重啓 dsh 後新版本加載或卸載生效 |
| Profile 切換 | 自動識別當前運行 profile,也可手動切換 |
| Agent 工具 | external_plugins:list / update / uninstall |
| 雙語 | 界面跟隨 locale(zh / en) |
判斷邏輯簡要對應 profile 目錄結構:dependencies 表示「裝着誰」;dsh.profile.bundles 表示「誰作爲插件層被裝配」;node_modules/<pkg>/package.json 的 version 與 dsh.bundle.patch 用於實際版本與是否爲 bundle。
安裝與啓用¶
裝完後重啓 dsh 纔會完成 bundle 裝配。add 的 spec 原樣交給 pnpm,因此 pnpm 支持的寫法均可使用。--profile 必須是你在跑的那個 profile(例如 dsh web 對應 web)。
公網安裝示例(來自 README,可按需選用其一):
# 鎖定版本(推薦:git tag)
dsh plugin --profile web add github:YUYUY9527/dsh-plugin-management#v1.0.0
# 跟隨倉庫最新代碼
dsh plugin --profile web add github:YUYUY9527/dsh-plugin-management
# Release 包 URL(本機無需 git)
dsh plugin --profile web add https://github.com/YUYUY9527/dsh-plugin-management/releases/download/v1.0.0/dsh-plugin-management-1.0.0.tgz
# npm registry(README 註明尚未發佈,發佈後可用)
dsh plugin --profile web add dsh-plugin-management
加完後可檢查是否裝配進配置:
dsh --profile web --dump-config | grep dsh-plugin-management
運行環境:package.json 要求 Node >=22.0.0。維護者說明本包分發以 GitHub Release + git 安裝 爲主,npm 路徑尚未啓用。
可選配置(cordis.patch.yml 中本插件條目下的 config):
- id: dsh-plugin-management
config:
apiPath: /dsh-plugin-management/api # 路由衝突時修改
sandboxMode: danger-full-access # 執行 pnpm/dsh 時的沙箱模式
默認 sandboxMode 爲 danger-full-access,是因爲一鍵更新需要寫 pnpm store(不在 profile 目錄內);若改爲更嚴模式,更新可能被同一沙箱規則拒絕——屬文檔中的有意取捨。
典型用法¶
設置界面¶
重啓 dsh 後打開 設置 → 插件,在官方 tab 之後會出現 「外部插件」:
- 頂部選擇 profile(「自動」= 當前運行實例)、點「刷新」或「一鍵更新 (N)」。
- 每行查看包名、版本、狀態徽標(可更新 / 可升級 / 最新 / 本地鏈接 / 非插件層 / 已廢棄等)。
- 按需點「更新」「升級到最新」或「卸載」(卸載需 4 秒內二次確認)。
- 底部查看命令輸出;有變更時按提示重啓 dsh。
頁面會先展示本地清單,再自動聯網做版本檢查;失敗會顯示原因而非靜默「未檢查」。
模型工具¶
Agent 可調用 external_plugins:
external_plugins action=list
external_plugins action=list check=false
external_plugins action=update profile=web
external_plugins action=update names=["dsh-tinyfish-search"]
external_plugins action=update latest=true
external_plugins action=uninstall names=["dsh-tinyfish-search"]
卸載必須顯式 names,沒有「卸全部」。
HTTP API(同源)¶
默認前綴 /dsh-plugin-management/api,例如 GET /inventory?profile=&check=1&refresh=1、POST /update、POST /uninstall(body 中 names 必填)。跨站請求會被拒絕。
適用場景與注意¶
適合誰:長期在固定 profile 上堆多個社區 dsh 插件、需要一眼看清「裝了什麼、生沒生效、要不要升」的開發者;也希望 agent 能代查清單、批量更新或按名卸載的場景。
範圍與限制(README 明確說明):
- 只管理當前 profile 的第三方依賴,不涵蓋
@deepseek-ai/*與模板自帶 in-box bundle。 - 不提供「安裝新插件」的 UI——新裝仍用
dsh plugin add;本插件專注看見、更新、卸載與命令複製。 - 跨大版本升級不校驗與當前 dsh 的兼容性,升級前需自行看目標包說明。
- 插件在 當前 dsh 進程權限與沙箱 下執行 shell/pnpm;安裝前應閱讀源碼與 MIT 許可證,並理解
sandboxMode含義。
臨時禁用本插件而不卸載:在 profile 的 cordis.patch.yml 對應條目加 disabled: true。命令行移除本插件:
dsh plugin --profile web remove dsh-plugin-management
結尾¶
dsh-plugin-management 把「profile 裏第三方包裝了什麼、是否在 bundles 裏生效、registry 上有沒有新版本」收斂到設置頁的一 tab,並把同一套能力交給 external_plugins 與 HTTP API。與官方插件加載視圖互補,減少靠記憶維護 package.json 和手工進目錄升級的成本。
- 目錄頁:https://www.skillhub.cn/plugins/YUYUY9527/dsh-plugin-management
- GitHub:https://github.com/YUYUY9527/dsh-plugin-management
社區插件目錄(SkillHub)獨立於 DeepSeek / 幻方,並非官方應用商店;使用前請自行覈對倉庫與 Release 來源。