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

DSH Plugin Check

8
Published by omdsh-dev

DSH 插件健康检查工具:扫描插件仓库的清单协议 / patch 格式 / 构建陷阱 / hub 收录状态,零依赖只读,注册 plugin_check 工具

Developer Toolsdiagnosticsdshdsh-pluginlinting

Get this plugin

Review the source, then continue to the publisher.

dsh plugin add @deepseek-ai/dsh-plugin-check@latest
Get this plugin
Share on X ↗

About this plugin

Source snapshot 8/13/2026

dsh-plugin-check

English

DSH 插件健康检查工具 —— 扫描插件仓库,诊断清单协议 / patch 格式 / 构建陷阱 / hub 收录状态,输出合规报告与修复建议。只读,不修改、不构建被检查仓库。

License

动机

组织内插件仓库持续增长,作者踩过的坑(cordis 双副本、tsconfig 三件套、patch name 不一致、产物 .ts 残留——运行时必崩)本可以自动化拦截。本工具把全部实测踩坑变成可自动检查的门禁:模型或 CI 直接对仓库目录跑一次 plugin_check,拿合规报告与修复建议。

安全模型

  • 只读:仅 readdir/stat/readFile,绝不修改或构建被检查仓库
  • 零业务依赖:仅 node 内置模块(fs/path/child_process)
  • hub 检查离线优先:先读本地 hub catalog(DSH_HUB_SOURCE 或 cwd/hub/ 下),gh 调用作 fallback;全部失败静默降级 skipped(报告如实标注,不算警告)
  • 不执行 tsc:构建陷阱全部静态文本扫描(快、无副作用)

工具声明

注册 plugin_check 工具(@deepseek-ai/dsh-plugin-check,row id tool-plugin-check),统一输出 JSON 文本。

参数类型必填说明
actionstringcheck / scan / schema
pathstring插件仓库目录(check)或父目录(scan);默认当前工作目录
strictbooleanstrict 模式:warning 升级为 error 影响 verdict,默认 false

Actions

action功能
check检查单个插件仓库目录 → 合规报告(verdict/errors/warnings/suggestions)
scan扫描父目录下所有 dsh-* 插件仓库(有 package.json 者)→ 汇总报告
schema输出全部检测项清单与判定标准(按形态适用的检测项矩阵,供模型/人核对)

形态识别与检测项(按形态适用,33 项)

类别errorwarning
清单协议no-manifest / invalid-name / missing-main-or-types / no-patchincomplete-files / missing-peer / no-bundle-decl
patch 格式malformed-patch / patch-name-mismatch / duplicate-row-idunexpected-fields
构建陷阱no-source-entry / no-tsconfig / missing-ts-ext-imports / lib-layout-mismatch / stale-ts-importsmissing-rewrite-imports / types-path-mismatch / implicit-node-types / no-build-script
生态合规(Profile Bundle)core-row-idmissing-profile-install-example / manual-install-only / core-modification-required
hub 收录not-in-hub(hub-skipped 为 info)

生态合规四项(immediate-adjustments-bundle-profile-plan §4.5):

  • core-row-id:patch 条目使用官方核心 row(tools/session/llm/web/permission);
  • missing-profile-install-example:README 缺 dsh plugin --profile ... add 示例;
  • manual-install-only:无法通过标准 Profile Bundle 安装(无 patch 或 README 无示例);
  • core-modification-required:默认安装流程要求修改 DSH 核心(git apply / cp 进 monorepo;明确标注"手动安装与旧版本兼容"的段落不计入)。

verdict:0 error → pass;有 error → fail;仅 warning → warn。 kind:registry / skill / collection / tool-bundle / bundle / infra / unknown——按形态套用不同检查集(X-01 共享矩阵)。 checks:固定检查项的执行结果(total/passed/failed/warned/skipped),不再是 issue 数。

示例

plugin_check { action: "check", path: "C:/Users/admin/Desktop/dshext/dsh-tool-csv" }
  → {"repo":"dsh-tool-csv","kind":"tool-bundle","verdict":"pass","checks":{"total":24,"passed":24,...}}

plugin_check { action: "scan", path: "C:/Users/admin/Desktop/dshext" }
  → {"root":"...","scanned":11,"reports":[...]}   # dsh-my-rsi 等不合规仓库会带 error+suggestions

npm rc.1 兼容(已验证)

本插件已迁移到 npm rc.1 依赖线,并在 @deepseek-ai/dsh@0.0.1-rc.1 的隔离 consumer 中完成全链路验证:

  • 类型/运行时@deepseek-ai/cordis@^4.0.1-rc.1 + @deepseek-ai/dsh-tools@^0.0.1-rc.1 + @deepseek-ai/dsh-invariants@^0.0.1-rc.1(peer);不再依赖 unscoped cordis
  • 独立构建npm install(devDependencies 自包含 typescript/vitest/@types/node)→ npm run typechecknpm testnpm run buildnpm pack
  • 消费验证:tarball 装入 rc.1 consumer → dsh --profile compat --dump-config 出现本插件 row → 工具真实注册与执行通过
  • 启动方式npx -p @deepseek-ai/dsh@0.0.1-rc.1 dsh web(lib 生产模式;勿 install -g 全局安装)

安装

Profile Bundle(推荐)

将本插件作为独立 bundle 安装到 profile(0806+):

# 交互式(web)profile
dsh plugin --profile web add "C:/path/to/dsh-plugin-check"
# 一次性任务(headless)profile —— dsh run 默认使用 headless
dsh plugin --profile headless add "C:/path/to/dsh-plugin-check"

包内 dsh.bundle.patch 会在安装后自动把插件加入 profile 的 layer stack(row id:tool-plugin-check)。插件缺失的 peer 依赖(cordis@deepseek-ai/dsh-tools)由 profile 的 healed profiles/node_modules 回退安装提供。

⚠️ web 与 headless 是不同 profile:web 安装不会自动覆盖 headless;dsh run 默认使用 headless profile。Windows 路径使用正斜杠(C:/...)。

验证安装

dsh --profile web --dump-config | grep tool-plugin-check

运行验证

dsh run "使用 plugin_check 工具检查一个插件仓库"

手动安装与旧版本兼容

仅适用于不支持 Profile Bundle 的旧快照或插件开发调试环境(本地 junction/symlink、手动编辑 profile 层)。

测试

node <monorepo>/node_modules/vitest/vitest.mjs run tests   # 38 用例
  • manifest.spec.ts / patch.spec.ts / build-check.spec.ts:每项检测的命中与不误报(fixtures 临时目录生成)
  • report.spec.ts:verdict 判定(含 strict 升级)、suggestions 模板、hub-skipped 不升级
  • register.spec.ts:注册契约(AUDIT-CROSS-02 风格)

自检基线(2026-08-08 实测)

组织内 8 个插件(time/encoding/json/calculator/csv/regex/markdown/session-health)全部 pass、零 error、零 warning。检查过程发现并修复了 4 个旧插件的真实合规缺陷(tsconfig 缺三件套——重建会产生坏产物;缺 build/prepack scripts)。

许可

MIT