dsh-plugin-doctor:DeepSeek Harness 插件健康檢查

前言

DeepSeek Harness(DSH)生態裏,插件可以承擔工作流能力;社區目錄頁面是獨立站點,不等同於官方應用商店。對插件作者來說,發佈前需要確認 manifestpatchentrybuildpack 與 fresh-profile 安裝驗證都能通過,否則問題可能只在 agent 調用或 profile 安裝時暴露。

下面介紹 zoahdev/dsh-plugin-doctor。它對應 RFC #1629 dsh plugin check 的插件健康檢查思路,提供 CLI 檢查和 agent 可調用的 plugin_check 工具。

這是什麼

dsh-plugin-doctor 是一個 DeepSeek Harness 插件健康檢查工具,維護者爲 zoahdev,許可證爲 MIT。

它的核心定位是:

  • CLI 模式:dsh-plugin-doctornode lib/bin.js 可在終端或 CI 中運行。
  • Plugin shell 模式:安裝後可被 agent 調用 plugin_check 工具。
  • 檢查範圍:manifestpatchentryfilesbuildpackinstallconfig
  • 附加能力:profile 檢查、只讀審計、環境診斷、secret-safe env provenance、supply-chain poison preflight 與 broken tool-call-sequence detection。

核心功能

dsh-plugin-doctor 的能力可以分成幾類。

插件發佈前檢查

它覆蓋插件發佈鏈路中的常見檢查項:

  • manifest
  • patch
  • entry
  • files
  • build
  • pack
  • install
  • config

這類檢查用於確認插件結構、入口、打包和安裝配置是否完整。

profile 檢查

已覈實資料中列出的 profile 檢查包括:

  • host-shadowing
  • manifest BOM
  • large-files
  • entry-points
  • profile-deps
  • native-modules

這些檢查面向 DSH profile 環境,用於發現宿主實例、profile 依賴、入口文件、原生模塊等可能影響運行的問題。

啓發式安全檢查

已覈實功能包括:

  • pre-execute-side-effects
  • shell-launcher

它們是啓發式檢查,用於提示潛在的前置副作用和 shell launcher 風險。

read-only audit 模式

audit 是單獨的只讀檢查模式。

它會報告:

  • 包身份
  • lifecycle scripts
  • Cordis patch operations
  • capabilities
  • findings

已覈實資料說明:audit 是 read-only inspection mode,不會導入目標插件、不會運行 lifecycle scripts、不會安裝依賴,也不會訪問 registry。

audit-batch 批量審計

audit-batch 支持批量審計,並支持 --json / --markdown 輸出。

環境診斷

環境診斷覆蓋:

  • node/pnpm/dsh PATH
  • Web UI port
  • Windows bash 等

env explain

env explain 用於 secret-safe env provenance,值始終顯示爲 [redacted]

供應鏈與工具調用檢查

已覈實功能還包括:

  • supply-chain poison preflight
  • broken tool-call-sequence detection

退出碼

退出碼規則爲:

  • 沒有失敗項時爲 0
  • 存在失敗項時爲 1

--json 用於輸出機器可讀報告,適合 CI。

安裝與啓用

從 npm 安裝到指定 profile:

dsh plugin --profile web add dsh-plugin-doctor

已覈實資料中也給出本地構建安裝示例:

dsh plugin --profile web add ./dsh-plugin-doctor-1.6.0.tgz

需要注意:已覈實資料中 package.json 版本爲 1.16.0,而本地安裝示例引用 dsh-plugin-doctor-1.6.0.tgz,二者不一致,資料未說明原因。

安裝前應檢查源碼與許可證。該工具會以當前 dsh 進程權限運行。

典型用法

當前目錄快速檢查

npx dsh-plugin-doctor .

build 檢查

npx dsh-plugin-doctor --build ./my-plugin

full 驗證

npx dsh-plugin-doctor --full ./my-plugin

preflight / check

npx dsh-plugin-doctor preflight ./my-plugin
npx dsh-plugin-doctor check ./my-plugin

只讀 audit

npx dsh-plugin-doctor audit ./my-plugin

audit compare

npx dsh-plugin-doctor audit ./new-version --compare ./old-version --json

audit-batch

npx dsh-plugin-doctor audit-batch ./plugins/plugin-a ./plugins/plugin-b --json

audit-batch 也支持 --markdown 輸出。

profile 檢查

npx dsh-plugin-doctor --profile ~/.dsh/profiles/web

環境診斷

npx dsh-plugin-doctor --env

env explain

npx dsh-plugin-doctor env explain DEEPSEEK_API_KEY

agent 調用

安裝到 DSH profile 後,可以讓 agent 先運行 build,再做 full 驗證。agent 會調用 plugin_check 工具,並可選傳入 build / full 標誌。

適用場景與注意

適合以下場景:

  • DSH 插件開發者在提交或發佈前做健康檢查
  • CI 中對插件包做機器可讀檢查
  • 對 DSH profile 環境做診斷
  • 對插件包做只讀審計
  • 讓 agent 在插件 shell 中調用 plugin_check

需要注意:

  • audit 是 read-only inspection mode,不會導入目標插件、不會運行 lifecycle scripts、不會安裝依賴,也不會訪問 registry。
  • working-tree fallback 會跳過 testsfixturesexamplesdemos、普通 JSON data 和 undeclared development scripts。
  • 已覈實資料列出的 peerDependencies 爲:
  • @deepseek-ai/cordis ^4.0.1
  • @deepseek-ai/schemastery ^3.18.1
  • @deepseek-ai/dsh-tools ^0.1.0-rc.6
  • 插件會以當前 dsh 進程權限運行,安裝前應檢查源碼與許可證。

鏈接

  • GitHub:https://github.com/zoahdev/dsh-plugin-doctor
  • 插件線索中列出的目錄頁:https://www.skillhub.cn/plugins/zoahdev/dsh-plugin-doctor
羽毛球分组比赛记分
小程序二维码

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

小夜