前言¶
DeepSeek Harness 的理念之一是「一切皆插件」。但在 DSH 插件開發裏,一個很容易出現的誤區是:插件能被加載,並不等於工具能被真實調用。
dsh-plugin-template 是一個面向 DSH 插件開發者的社區起始模板。它提供一個最小可運行的插件結構,並通過 CI 安裝打包產物、真實調用內置的 hello 工具、運行 DSH web 啓動冒煙測試,來驗證插件不只是“能裝進去”,而是“能跑起來”。
這是什麼¶
- 倉庫名:
zoahdev/dsh-plugin-template - 定位:DeepSeek Harness plugins 的最小化、已驗證社區起始模板
- 維護者:
zoahdev - 許可證:MIT
package.json版本:0.1.0- 測試環境:
dsh0.1.0-rc.6、Node24、pnpm11
它是社區模板,不是官方 DeepSeek 模板,不是安全審計,也不是生產就緒證明。社區目錄是獨立站點,與 DeepSeek / 幻方沒有官方從屬關係。
核心能力¶
下面介紹模板中已覈實的能力:
- 包含 bundle manifest 與
cordis.patch.yml插件行配置。 - 提供一個
hello工具,CI 會安裝打包產物並真實調用該工具。 - 內置運行時 peer-version guard,拒絕不滿足
^0.1.0-rc.6的@deepseek-ai/dsh-tools。 - 包含單元測試、打包集成測試和 DSH 啓動冒煙測試。
- 支持本地
dsh-plugin-doctor檢查和 GitHub Action 健康檢查。
安裝與啓用¶
下面的示例使用模板本地打包後的 tarball 安裝。
先克隆倉庫,並運行安裝、測試和打包命令:
git clone https://github.com/zoahdev/dsh-plugin-template.git my-plugin
cd my-plugin
pnpm install && pnpm test && pnpm pack
這一步會生成本地插件包 dsh-plugin-template-0.1.0.tgz。
將插件安裝到 DSH 的 web profile:
dsh plugin --profile web add ./dsh-plugin-template-0.1.0.tgz
啓動 DSH web:
dsh web --port 4099
典型用法¶
模板內置了一個 hello 工具。啓動後,可以讓 agent 執行:
Use the hello tool to greet Ada.
這個示例用於驗證插件註冊、工具暴露和實際調用鏈路,而不是隻驗證插件文件存在。
如果你準備對改名後的插件做本地健康檢查,可以運行:
node lib/bin.js --full <your-plugin-directory>
依賴與運行限制¶
使用這個模板時,需要注意以下已覈實的限制:
peerDependencies使用 caret range^0.1.0-rc.6,不是固定版本 pin。- 模板測試基於
dsh0.1.0-rc.6、Node24、pnpm11。 - pnpm 可能靜默鏈接舊 RC;插件會拒絕加載,不應使用
--legacy-peer-deps抑制錯誤。 - DSH web 啓動冒煙在
windows-latest運行,因爲ubuntu-latest缺少上游linux-x64 pty.node prebuild。
適用場景¶
適合:
- 想從已有可運行模板開始做 DSH 插件。
- 希望通過 CI 證明插件能加載、工具能調用。
- 希望在本地檢查和 CI 檢查之間保持一致性。
不適合:
- 需要官方 DeepSeek 背書。
- 需要安全審計結論。
- 需要生產就緒證明。
插件會以當前 dsh 進程權限運行。安裝前應檢查源碼、許可證和依賴,確認其符合你的使用場景。
結尾¶
dsh-plugin-template 的價值不在於功能多,而在於它把“插件可加載、工具可調用、版本不匹配會拒絕”做成了一條可復現的檢查路徑。
- 社區目錄:https://www.skillhub.cn/plugins/zoahdev/dsh-plugin-template
- GitHub:https://github.com/zoahdev/dsh-plugin-template