Aeternus123/dsh-rtk-filter

Aeternus123★ 4JavaScript最后同步: 2026-08-20

在 GitHub 打开

README 摘要

dsh-rtk-filter A DeepSeek Harness (DSH) plugin that pipes oversized command output through the rtk CLI and hands the model RTK's condensed text instead of the raw output — a tools/post-execute result transformer that slashes token/context usage. 一个 DeepSeek Harness(DSH)插件:执行命令时自动调用系统命令 rtk 过滤输出。 当 bash / job output 等工具返回超过阈值的纯文本结果时,插件把原始输出通过 stdin 管道交给 rtk ,把 RTK 精简后的文本作为大模型最终看到的内容,从而显著减少 上下文占用。 安装 / Installation 仓库已包含编译产物( lib/ ), clone 后无需构建即可挂载 。 方式一:GitHub 安装(推荐) 方式二:本地挂载(开发) 无论哪种方式,最后在 profile 的 cordis.patch.yml 里挂载插件(包内自带 cordis.patch.yml ,用 dsh plugin add 安装时自动生效;手动挂载时追加): 前置条件 :系统装有 rtk(如 brew install rtk );未安装时插件静默降级,不影响任何命令。 开发 / Development 核心思路:注入点在哪里(调研结论) 关键探索点:命令输出在返回大模型之前,如何拦截并修改? 在 DSH 的架构里, 命令执行的真正入口是 ctx.shell 服务(Service) ,模型侧的 bash 工具只是它的一个 Consumer。输出回传模型前,最贴近的、官方文档化的扩展点是: - tools/post-execute 瀑布事件 ( @deepseek-ai/dsh-tools 注册表提供)—— 每个工具调用在 dispatch 完成后、 lossless 物化之前 经过这个 waterfall, 监听者可以返回 { kind: 'accept', content: [...] } 替换模型看到的内容。 这正是「输出在返回给大模型之前」的拦截点。官方同款范例: - @deepseek-ai/dsh-spill-policy (spill 策略插件,把超大文本结果替换为预览+落盘定位) - @deepseek-ai/dsh-hooks- (Claude Code / Codex 钩子桥) - @deepseek-ai/dsh-repeat-tool-reminder (重复工具提醒) 为什么不选其他方向: - ctx.shell.run() 服务包装 :能…

在 GitHub 查看完整 README →
工具/开发dsh-plugin

分类