Aeternus123/dsh-rtk-filter ↗★ 2
dsh-rtk-filter
DeepSeek Harness 插件:将过长的命令输出通过外部 rtk 命令行工具过滤,并向模型提供压缩后的输出,而非原始文本。
AI 分析
核心用途是过滤和压缩过长的工具执行输出(如 bash 结果),避免撑爆上下文。适合频繁执行会产生大量日志的命令、需要控制 Token 消耗的开发任务。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Aeternus123/dsh-rtk-filter说明文档
阅读完整 README ↗配置项
| 配置 | 类型 | 默认 | 说明 |
|---|---|---|---|
enabled | boolean | true | 总开关;false 时插件完全空转(不注册任何监听器) |
command | string | 'rtk' | rtk 可执行文件;裸名先走 PATH,再自动探测候选目录(Homebrew/Rustup 等),或直接写绝对路径 |
args | string[] | [] | 透传给 rtk 的附加参数;通用推荐 ['pipe'](见下节) |
tools | string[] | ['bash', 'job_output'] | 需要过滤的工具名;可加 run_code、pwsh 等 |
minBytes | number | 2048 | 低于此字节数的输出直接放行(避免每条命令都付 RTK 延迟) |
timeoutMs | number | 15000 | rtk 超时;超时则 SIGKILL 整个进程组并保留原始输出 |
notice | boolean | true | 替换文本中追加 [rtk: output condensed N → M bytes] 提示行 |
使用应用自带 node 运行(stub rtk 位于 tests/bin/rtk)
/Applications/DeepSeek\ Harness.app/Contents/Resources/dsh/node/bin/node --test tests/rtk-filter.test.mjs