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
羽毛球分组比赛记分
小程序二维码

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

小夜