a179-sanae/dsh-code-check ↗★ 1
@a179-sanae/dsh-code-check
Auto type-check and lint diagnostics for DeepSeek Harness: after the model edits code, tsc runs in the background and a code_check tool reports what broke
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:a179-sanae/dsh-code-check说明文档
阅读完整 README ↗dsh-code-check
DeepSeek Harness(DSH)的自动类型检查诊断插件。
模型编辑或创建代码文件后,本插件在后台(按项目、防抖)自动运行
tsc --noEmit,并通过 code_check 工具汇报哪里改坏了——按文件分组,带
行列号、严重级别和 TS 错误码。模型看到报告后可以自己修复,形成
"改 → 查 → 修"闭环。Claude Code 有官方 LSP 插件,pi 有 pi-lens,现在 DSH
也有了 dsh-code-check。
特性
- 监听 harness 的
fs/observed变更事件(与内置 skill 文件系统同一条缝),零核心改动。 - 800ms 防抖,连续编辑合并为每个项目一次检查。
- 按被编辑文件向上找最近的
tsconfig.json,只检查对应项目。 - 直接以
node typescript/bin/tsc方式启动:不经过 shell / npx /.cmd,Windows 与 POSIX 行为完全一致。 code_check工具返回缓存报告,传run: true强制重跑,支持按路径过滤。首次调用时会扫描调用方工作区找tsconfig.json,没编辑过也能用。- 优雅降级:没有
tsconfig.json或本地没装 TypeScript 时给出明确提示,而不是崩溃。 - 全部配置项可通过
settings.yaml/ profile patch 层调整。
安装
dsh plugin --profile web add "github:a179-sanae/dsh-code-check#main"
安装后重启 dsh web。工具会自动出现在模型的工具集里,结果以普通工具
卡片渲染在 Web UI 中——不需要任何 UI 改动。
安装注意事项
@deepseek-ai/*运行时包(cordis、schemastery、dsh-tools、dsh-llm)是 peer 依赖:由 DSH 宿主提供。不要把它们手动装进 profile——profile 里出现第二份dsh-tools会让宿主的工具调度器解析到 错误实例,所有工具调用都会报Cannot read properties of undefined (reading 'prepare')(已在 rc.6 实测,属宿主 loader 解析问题)。- 若插件加载报
Cannot find package '@deepseek-ai/...',说明 profile 安装 没解析到宿主包:检查 profile 的pnpm-workspace.yaml,并在pnpm install --force后重新执行dsh plugin --profile web add "github:a179-sanae/dsh-code-check#main"。
用法
让模型正常改代码即可:后台检查会自动调度,随时可以让模型:
- 直接说 "run code_check" 查看当前诊断
- 或模型在编辑后自行调用
code_check
首次使用:项目通过文件编辑事件(fs/observed)习得;还没编辑过时,带
run: true 的 code_check 会先扫描调用方工作区找 tsconfig.json,按需检查。
示例报告:
Type check report — 2 diagnostics (checked at 21:30:04)
src/app.ts:12:5 error TS2345 Argument of type 'string' is not assignable to parameter of type 'number'
src/app.ts:40:1 error TS2304 Cannot find name 'foo'
Tip: fix the errors, then call code_check again to verify.
配置
全部可选,默认值如下: