dsh-compressor
A slim port of Headroom: compresses tool output, cuts up to 20% of context, without affecting the model's context cache or agent performance.
Install
dsh plugin --profile web add dsh-compressor
Sandbox test results
| Stage | Result |
|---|---|
| 1 install | ✗ |
| 2 list | — |
| 3 mount | — |
| 4 boot | — |
dsh: initialized profile web at /home/node/.dsh/profiles/webFour stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).
README
dsh-compressor
DeepSeek Harness bundle. Compresses long tool results in-process and restores them with compressor_retrieve.
On 20 redacted real DSH sessions, Session.deriveMessages() JSON shrank by up to 20%. Official spill left verbatim. Reproduce: node scripts/measure-sessions.mjs.
Install into a DSH profile
dsh plugin forwards to pnpm in $DSH_HOME/profiles/<name>. Relative paths are resolved from the directory you run dsh in.
Local checkout
dsh plugin --profile web add ./plugins/dsh-compressor
GitHub subdirectory (plugin is not the repo root)
dsh plugin --profile web add github:lifeodyssey/dsh-compressor#path:plugins/dsh-compressor
npm (after npm publish from this directory)
dsh plugin --profile web add dsh-compressor
Confirm the layer:
dsh --profile web --dump-config
You should see # == dsh-compressor and id: dsh-compressor.
pnpm must be on PATH. Git-hosted installs may ask you to allow a prepare/build script under the profile’s pnpm-workspace.yaml (allowBuilds). This package ships prebuilt native/*.node and compiled lib/; it should not need rustc on the user’s machine.
Behavior
Hooks:
agent/pre-step— rewrite eligibletool/resultnodes on the session surface soSession.deriveMessages()sees the crushed formtools/post-execute— crush a new tool result as it is accepted
Originals: $DSH_HOME/dsh-compressor/<sha256>. Retrieve: compressor_retrieve with <<compressor:64hex>> or the bare hash.
Crushers: official Headroom Rust Log / Smart / Text / Search / Diff via napi (darwin-arm64, linux-x64-gnu). Code-aware off. Kompress off. CCR retrieve is not the user protocol.
Official DSH spill (preview + filesystem path + read/grep) is left alone.
Develop / test
pnpm install pnpm test pnpm typecheck
Rebuild JS after source edits: pnpm build. Rebuild the native addon only if you change Rust crushers: pnpm build:native (needs the repo’s Cargo workspace).
Publish to npm
The npm name dsh-compressor is currently free. Publish this directory, not the repository root.
pnpm install pnpm build # confirm files: lib/, native/*.node, cordis.patch.yml npm publish --access public
Then users install with dsh plugin --profile web add dsh-compressor. Bump version in package.json for each release.
Requires an npm account with publish rights. Do not commit .npmrc tokens.
Rendered from the README published on npm. Formatted only, not edited.
Versions
Published on npm::1,最后更新 2026-08-15