dsh-plugin-template:DeepSeek Harness 插件的最小化已驗證起始模板

前言

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
  • 測試環境:dsh 0.1.0-rc.6、Node 24、pnpm 11

它是社區模板,不是官方 DeepSeek 模板,不是安全審計,也不是生產就緒證明。社區目錄是獨立站點,與 DeepSeek / 幻方沒有官方從屬關係。

核心能力

下面介紹模板中已覈實的能力:

  1. 包含 bundle manifest 與 cordis.patch.yml 插件行配置。
  2. 提供一個 hello 工具,CI 會安裝打包產物並真實調用該工具。
  3. 內置運行時 peer-version guard,拒絕不滿足 ^0.1.0-rc.6 的 @deepseek-ai/dsh-tools。
  4. 包含單元測試、打包集成測試和 DSH 啓動冒煙測試。
  5. 支持本地 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。
  • 模板測試基於 dsh 0.1.0-rc.6、Node 24、pnpm 11。
  • 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
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜