DeepSeek Harness 插件

474885697-alt/dsh-kit#dsh-project-checkup

分类 开发与运行时 收录于 2026-11-10

按项目里的 dsh-checkup.json 运行检查(文件、语法、JSON、HTTP 健康、资源计数,以及你列出的 node/npm 脚本与命令),没有配置时回退到自动探测的默认项。

安装

# Release 预构建包

dsh plugin --profile web add "https://github.com/474885697-alt/dsh-kit/releases/download/v0.1.0/dsh-project-checkup-0.1.0.tgz"

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:474885697-alt/dsh-kit#path:/plugins/dsh-project-checkup

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

项目体检:检查项写在 dsh-checkup.json 里,换项目不用改代码。

版本 0.1.1 | 包名 dsh-project-checkup | 仅宿主侧(无客户端代码)| MIT

它解决什么问题

原先的检查项是写死的(某个项目专属),换个目录就全废。现在改成声明式:检查项由 JSON 描述,插件只提供执行器。

找不到配置时自动探测:package.json、index.html、server.js / src/index.js、.git、README.md,识别不到就给一条「未识别到项目特征」的提示。

12 种检查类型:file、dir、json、syntax、script、npm、http、count、scan、todo、command、note。

安装

plugin_manager install_bundle target="C:/Users/03/Documents/deepseek-harness/default-workspace/plugins/dsh-project-checkup"

装完即可用,工具会出现在工具列表里;用 plugin_health 可以体检清单。要卸载就用插件页的开关。

用法示例

示例:最小配置(项目根目录 dsh-checkup.json)

{
  "name": "我的项目",
  "quick": [
    { "type": "file", "path": "index.html", "message": "入口页存在" },
    { "type": "syntax", "path": "server.js" },
    { "type": "http", "url": "http://127.0.0.1:3000/api/health", "expect": 200 }
  ],
  "full": [
    { "type": "count", "path": "assets/art/generated", "pattern": "\.png$", "min": 30 }
  ]
}

示例:跑一次

GET /api/dsh-project-checkup/scan?scope=quick&dir=C:/path/to/project
# → { ok, name, projectDir, profileSource, summary:{pass,warn,fail,skip,total,score}, checks:[…] }

HTTP 路由(仅本机 loopback)

方法 路径 说明
GET /api/dsh-project-checkup/scan ?scope=quick|full&dir=<绝对路径>,返回检查项与分数
GET /api/dsh-project-checkup/profile 返回解析到的配置来源与候选目录

配置

  • 配置文件查找顺序:项目内 dsh-checkup.json / .dsh-checkup.json → 全局 ~/.dsh/dsh-project-checkup/checks.json → 自动探测。
  • 目录查找顺序:?dir= 参数 → 全局配置的 projectDir → 环境变量 DSH_PROJECT_CHECKUP_DIR → 当前工作目录 → 用户主目录。
  • npm 类型在 Windows 上走 cmd.exe /d /s /c npm run <name>(避开 spawn EINVAL)。

数据存在哪

  • 全局配置:~/.dsh/dsh-project-checkup/config.json(projectDir)。不写任何缓存。

安全边界

  • 只读项目文件;http 检查只发 GET,超时 ≤45 秒。
  • 自动探测不会执行 npm build/test,避免打开项目就编译。

已知行为

  • note 类型恒为 warn,适合放「这个项目需要手动确认」的提醒。

验收

  • quick 6 项 / full 12 项实测全 pass;临时空目录给出 pass + warn 组合。

宿主兼容性

  • Web / 桌面宿主:HTTP 路由与工具都可用。
  • headless / CLI(没有 webServer 服务):路由自动跳过,工具照常注册。

UI audit (ui-audit.cjs)

If a project provides tools/ui-audit.cjs, the plugin automatically adds a full-scope check named ui-audit. It runs the script with --strict --json and is marked optional: if the local service is down, the item is downgraded to warn instead of failing the whole checkup.

The script should test real page geometry, not only static strings: horizontal overflow, fixed-control overlap, modal viewport bounds, close-button visibility, and small hit targets. See docs/ui-contract.md in the Seeker workspace for the reference contract.

Recommended full scope:

GET /api/dsh-project-checkup/scan?scope=full&dir=<project>

optional applies to any check spec; a failed optional check is reported as warn with a [可选] prefix.

SEEKER_URL and platform groups

HTTP checks may use ${SEEKER_URL} in url; it expands at run time from the environment, falling back to a single default constant (http://127.0.0.1:3000) that can be overridden without editing code:

$env:SEEKER_URL = 'http://127.0.0.1:3120'
node -e "import('./plugins/dsh-project-checkup/lib/index.js').then(async m => console.log(JSON.stringify(await m.scan('quick', process.cwd()))))"

Each check may declare group: "web" | "apk" | "file"; pass group as the third argument to scan(scope, dir, group) or ?group= on the scan route to run one group alone. A failing http item now reports fail for that item only — other items still run. adb checks return unverified (not fail) when adb or a device is missing; unverified is counted separately in summary and does not fail the run.

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。