在開發 DeepSeek Harness (DSH) 插件時,通常需要配置構建流程或管理依賴。這裏提供一個極簡的參考實現,它不依賴額外的運行時,也不需要編譯步驟,適合作爲插件開發的起點。
插件概述¶
這是一個 DeepSeek Harness (DSH) 的最小插件示例。由 LuwendiWuyi 維護。它通過 JavaScript 實現,在啓動終端輸出一條問候語。插件不增加模型工具或聊天界面元素,僅用於演示插件加載機制。
安裝與啓用¶
使用已安裝的 DSH 運行以下命令安裝:
dsh plugin --profile web add github:LuwendiWuyi/dsh-hello-plugin
需要滿足的運行環境是 Node.js 22.19+ 或 24+,以及可用的 pnpm。
安裝或卸載之後,需要重啓對應的 profile。
典型用法¶
源碼版驗證¶
如果使用 DeepSeek Harness 源碼版,在源碼倉庫根目錄將 dsh 替換爲 pnpm dsh:
pnpm dsh plugin --profile hello-demo add github:LuwendiWuyi/dsh-hello-plugin
安裝後,使用 --dump-config 檢查配置是否生效。輸出結果中應包含 # == dsh-hello-plugin。
啓動 profile:
pnpm dsh --profile hello-demo
啓動後終端應出現 [hello-plugin] Hello, DSH! 插件加載成功。,按 Ctrl+C 退出。
打包與卸載¶
在插件目錄運行 pnpm pack 可生成 .tgz 文件,然後使用絕對路徑安裝:
dsh plugin --profile web add /absolute/path/to/dsh-hello-plugin-0.1.0.tgz
卸載命令:
dsh plugin --profile web remove dsh-hello-plugin
注意事項¶
該插件將輸出寫入 stderr,確保 stdout 保留給宿主應用。
總結¶
這個插件展示瞭如何在 DSH 生態中創建一個無依賴的擴展。通過查看其 index.js 和 cordis.patch.yml 文件,可以瞭解插件激活的入口與配置方式。