giter00/dsh-headroom
giter00★ 1JavaScript最后同步: 2026-08-18
deepSeek harness上下文压缩工具
README 摘要
dsh-headroom 适配 DeepSeek Harness (dsh) 的上下文自动压缩插件,思路参考 Headroom。 工具输出在进入模型之前先被压缩:JSON、搜索、日志、表格与长文本各自走专用压缩器; 所有 有损压缩 都会把原文存入本地 CCR store,并在压缩结果里注入一个短 marker, 模型需要精确原文时调用 headroom retrieve(id=…) 即可逐字节取回。 特性 - 自动压缩工具输出 :挂载 tools/post-execute ,在工具结果物化之前替换文本内容。 - 内容路由,专用压缩器 : 内容类型 压缩策略 JSON 数组/对象 SmartCrusher 风格透视: keys + rows + common ,长单元格截断 grep/ripgrep 结果 按文件折叠: file (N matches) + line[:col]: rest 构建/测试/日志 连续重复行折叠 + 保留 error/fail/exception/assert 上下文 CSV/TSV/markdown 表格 保留表头与首尾行,中间行 offload 长文本 Kompress 风格 ML 压缩 (默认):逐词打分 + must-keep 保护 + CCR 可逆取回; textStrategy: 'head-tail' 可切回首尾截断 代码 默认不压缩 (JS 端口不做 AST 压缩,避免破坏可补丁字节; read / str replace editor 的行号前缀会先剥离再识别) 文件工具 默认不压缩 ( read / str replace editor / edit / write 及其匹配 .js/ .ts/ .json/ .yml 的路径) Kompress 文本压缩 (参考 Headroom 的 Kompress-v2-base ML 模型): 文本按词切分 → 每词打分( score = keep概率 × (0.5 + 0.5 × span分数) ,模拟模型的 token 分类头 + span CNN 双头)→ score 0.5 保留(或 targetRatio 取 top-k)→ 数字 / hex / 全大写标识符 / 路径 / 扩展名 / CLI flag / CamelCase 等 语义脆弱词强制保留 → 保留词重组。默认评分器是确定性纯 JS 启发式;如需接入真实 Kompress-v2-base 模型,可 库级注入 自定义 scorer ( compressKompressText(text, { scorer }) / createKompressCompressor({ scorer }) ), 管线完全一致(插件配置暂不暴露 scorer 项)。 - 可逆压缩(CCR) :所有有损压缩都保存原文, he…
在 GitHub 查看完整 README →分类
DeepSeek Harness: Everything is a Plugin.
★ 182,325
amruthpillai/reactive-resumeA one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
★ 41,477
anywhere-labs/deepseek-harness-desktop为 DeepSeek Harness (DSH) 插件生态打造的现代化桌面端解决方案。万物皆「插件」,桌面本身也是「插件」。
★ 17,784