dsh-lens-lite
Post-edit diagnostics for DeepSeek Harness: runs configured type-checkers and linters after a successful write/edit and feeds the findings back to the model as tool-result context
AI Analysis
核心用途是在 AI 修改代码后自动运行 tsc、eslint 等工具进行语法和类型检查。适合代码编写任务,能让 Agent 及时发现并修正代码错误。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ben7am1n/dsh-lens-liteREADME
Read the full README ↗Configuration
Every deployment-varying value is a config field. The plugin ships no built-in commands: which checkers exist is a property of your toolchain, not of this package.
- id: lens-lite
name: dsh-lens-lite
config:
tools: [write, edit, str_replace_editor]
maxDiagnosticChars: 4000
checkers:
- name: tsc
extensions: ['.ts', '.tsx']
argv: ['npx', '--no-install', 'tsc', '--noEmit']
cwd: '.'
timeoutMs: 60000
- name: eslint
extensions: ['.ts', '.tsx', '.js', '.jsx']
argv: ['npx', '--no-install', 'eslint', '--format', 'compact', '{file}']
cleanExitCodes: [0]
- name: ruff
extensions: ['.py']
argv: ['ruff', 'check', '--output-format', 'concise', '{file}']
- name: go-vet
extensions: ['.go']
argv: ['go', 'vet', '{dir}']
streams: [stderr]
Checker fields
| Field | Default | Meaning |
|---|---|---|
name | — (required) | Label shown to the model above this checker's output |
extensions | — (required) | Lowercase, leading-dot extensions this checker claims |
argv | — (required) | Executable + arguments. argv[0] resolves against the subprocess provider's scrubbed PATH. Never shell-interpreted |
cwd | . | Working directory, resolved against the harness process directory (your workspace root) |
timeoutMs | 30000 | Wall-clock bound; the process tree is terminated when it expires |
graceMs | 2000 | SIGTERM→SIGKILL grace for that termination |
maxOutputBytes | 65536 | In-memory cap per collected stream; overflow keeps the tail |
cleanExitCodes | [0] | Exit codes meaning "no findings" |
streams | [stdout, stderr] | Which streams carry findings, in concatenation order |
argv entries support three placeholders, substituted per run:
| Placeholder | Value |
|---|---|
{file} | Absolute path of the edited file |
{relFile} | That path relative to cwd |
{dir} | Its containing directory |
Plugin fields
| Field | Default | Meaning |
|---|---|---|
tools | [write, edit, str_replace_editor] | Tool names whose successful results are inspected |
checkers | [] | Checkers, all consulted; empty means the plugin does nothing (it says so once at load) |
maxDiagnosticChars | 4000 | Cap on model-visible diagnostic text per result; overflow keeps the head, because the first error is usually the cause of the rest |