lifeodyssey/dsh-compressor

DeepSeek Harness plugin: compress tool output, cut up to 20% of context, without touching the context cache or agent performance.

Bundle 已验证 MIT Rust 未知
Bundle 已验证

已收录

1

Tools

Bundle 已验证

版本未知
语言Rust
许可证MIT
在 GitHub 查看

预览

第 1 个预览,共 2 个:lifeodyssey/dsh-compressor
第 2 个预览,共 2 个:lifeodyssey/dsh-compressor

功能介绍

Headroom 的精简移植,在不影响模型上下文缓存以及 Agent 性能的情况下,压缩工具的输出,至多减少 20% 的上下文。

适合

  • 工具调用较多、长日志、JSON、搜索结果、文本或 diff 大量占用上下文的 agent 会话。
  • 希望缩短模型可见工具输出,同时把原始内容保存在磁盘上以便取回的工作流。
  • 希望保持已发送上下文前缀不变以复用缓存的长会话。

不适合

  • 工具输出本来就很短、压缩收益有限的会话。
  • 需要基于 tree-sitter 的代码感知压缩或基于 ONNX 的长文本压缩的工作流;这些压缩器尚未接入。
  • 要求每个工具结果的全部细节始终立即可见、不能通过取回工具补充上下文的场景。

README

English 中文

dsh-compressor

npm CI

A slim port of Headroom. Compresses tool output and cuts up to 20% of context, without affecting the model’s context cache or agent performance.

Install

dsh plugin --profile web add dsh-compressor

How it works

A tool run leaves a long log / JSON / diff. Only a small part of it is useful. This plugin shortens that output before the next turn, keeps the original on disk, leaves the already-sent prefix alone so the cache stays valid, and gives the agent a tool to pull the full context back.

flowchart LR
  A[Tool finishes] --> B{Output long?}
  B -->|no| C[Full text stays]
  B -->|yes| D[Shorten and save original]
  D --> E[Model sees the useful part]

Compressor code comes from Headroom. Wired in today: Log / Smart / Text / Search / Diff. The only crushers not wired in yet:

  • Code-aware (tree-sitter, source code)
  • Kompress (ONNX, long prose)

Develop

cd plugins/dsh-compressor
pnpm install
pnpm test

Contributing

Open PRs on this repo, not on Headroom.

Plugin code is in plugins/dsh-compressor (Node 22+, pnpm):

cd plugins/dsh-compressor
pnpm install
pnpm test
pnpm typecheck

Crushers live in crates/:

cargo test --workspace
make test-parity

One change per PR. Plugin changes need tests; crusher changes need cargo test. Details: CONTRIBUTING.md.

This plugin is MIT. crates/headroom-* remains Apache-2.0.

常见问题常见问题

在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:lifeodyssey/dsh-compressor。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。