dshplugin.devDeepSeek Harness Plugins
DSH Plugin Doctor plugin logo
DeepSeek Harness Plugin

DSH Plugin Doctor

0
Published by lin-cheng-lab

DSH 插件体检:安装前检查 peer 版本兼容性,防止 rc 不匹配崩溃 🩺

Developer Toolsdsh-plugin

Get this plugin

Review the source, then continue to the publisher.

dsh plugin add dsh-plugin-doctor@latest
Get this plugin
Share on X ↗

About this plugin

Source snapshot 8/13/2026

🩺 dsh-plugin-doctor

DSH 插件体检工具 —— 安装任何 DSH 插件之前,先体检再装,防止 rc 版本不匹配导致的启动崩溃。

为什么需要它

DSH 插件生态发展很快,很多插件还在快速迭代(rc 版本阶段)。插件声明的 peerDependencies(如 @deepseek-ai/dsh-tools@^0.0.1)与你本机的 DSH 版本 (如 0.1.0-rc.6)不匹配时,装进去轻则工具不工作,重则 web 界面直接起不来

本插件把"装之前先检查"变成一条命令,输出一份体检报告:

检查项说明
🏥 本地环境读取本机 DSH / cordis / dsh-tools / dsh-workflow 版本
🔗 仓库可访问插件仓库是否公开(404 直接拦下,防止装"幽灵插件")
📦 bundle 声明是否声明 dsh.bundle.patch(官方可安装格式)
⚖️ peer 兼容性核心:插件要求的版本 vs 本机实际版本逐项对比(semver 匹配)
🏗️ 构建产物main 指向的入口文件是否已提交到仓库

体检结论三档:🟢 ok(可以装)· 🟡 warn(谨慎,注意风险项)· 🔴 danger(别装,装了会崩)。

安装

# 从 GitHub 安装(发布后)
dsh plugin --profile web add "github:<你的用户名>/dsh-plugin-doctor"

# 或从本地源码安装
dsh plugin --profile web add "file:/path/to/dsh-plugin-doctor"

重启 profile 后生效:

dsh --profile web

使用

安装后,向 DSH 说一句人话即可,例如:

帮我用 plugin_doctor 检查一下 dsh-external/dsh-deep-research

工具接受三种输入:

  • GitHub 仓库 URL:https://github.com/owner/repo
  • owner/repo 简写:owner/repo
  • npm 包名:@scope/namename

输出示例(节选):

{
  "target": "dsh-external/dsh-deep-research",
  "verdict": "danger",
  "summary": "体检不通过,不要安装",
  "checks": [
    { "name": "本地环境", "status": "pass", "detail": "DSH 0.1.0-rc.6 · cordis 4.0.1 · dsh-tools 0.1.0-rc.6 ..." },
    { "name": "仓库可访问", "status": "pass", "detail": "github.com/dsh-external/dsh-deep-research 可访问" },
    {
      "name": "peer 兼容性",
      "status": "fail",
      "detail": "2 个 peer 依赖与本地版本不匹配(rc 不匹配风险!)",
      "items": [
        { "dep": "@deepseek-ai/dsh-tools", "required": "^0.0.1", "installed": "0.1.0-rc.6", "ok": false },
        { "dep": "@deepseek-ai/dsh-workflow", "required": "^0.0.1", "installed": "0.1.0-rc.6", "ok": false }
      ]
    }
  ],
  "recommendation": "不要安装:存在不兼容项,装进去可能导致启动崩溃。等插件更新适配后再装。"
}

工作原理

  • 网络检查走 DSH 内置 web 服务(ctx.web.fetch),不需要额外权限
  • 本机版本走 fs 服务读取全局安装的 DSH 包清单
  • semver 匹配为内置纯函数实现(零依赖),支持 ^ ~ >= <= > < = * 与多条件范围, 正确处理 prerelease(rc)版本规则
  • 工具通过 ctx.tools.register(defineTool(...)) 注册,随 profile 加载/卸载

开发

npm install --legacy-peer-deps   # 安装 typescript(跳过未发布的 @deepseek-ai peer)
npm run build                    # tsc → lib/

类型解析依赖本机 DSH 安装中的 @deepseek-ai/cordis@deepseek-ai/dsh-tools

ln -sfn <dsh安装>/node_modules/@deepseek-ai/cordis  node_modules/@deepseek-ai/cordis
ln -sfn <dsh安装>/node_modules/@deepseek-ai/dsh-tools node_modules/@deepseek-ai/dsh-tools

许可

MIT