deepseek-harness/packages/compact
2026-08-05 11:56:14 +08:00
..
command-compact refactor(session): route construction through Session.create 2026-08-05 11:56:14 +08:00
compact refactor(session): route construction through Session.create 2026-08-05 11:56:14 +08:00
compact-basic refactor(session): route construction through Session.create 2026-08-05 11:56:14 +08:00
compact-tool-result-prune refactor(session): route construction through Session.create 2026-08-05 11:56:14 +08:00
README.i18n.yaml docs(i18n): proofread active Chinese documentation 2026-08-04 17:36:14 +08:00
README.md round 1: implement bracket-first manual compaction 2026-07-30 17:40:25 +08:00
README.zh.md docs(i18n): proofread active Chinese documentation 2026-08-04 17:36:14 +08:00

compact/ — compaction capability family

English | 中文

A compaction capability family (see capability seams): an abstract interface, a summarizing backend, a model-free tool-result pruning companion, and a human command adapter. All product packages.

Package Role ctx key
compact/ Abstract compaction seam (interface + compact/* events + CompactionResult) ctx.compact
compact-basic/ A backend: ctx.tokenMeter pressure + token-budget retention + llm.stream() summarization (registers ctx.compact)
compact-tool-result-prune/ Optional model-free head/middle/tail rewriting before summary compaction ctx.toolResultPrune
command-compact/ Human /compact command over the backend-independent compactNow() seam (registers on ctx.commands)

The interface lives at compact/compact/, the backend at compact/compact-basic/, deterministic pruning at compact/compact-tool-result-prune/, and the command at compact/command-compact/. Unlike the bash seam, the interface depends on dsh-session and dsh-llm because its verbs are defined over a Session and its output uses ContentBlock. That deviation is recorded in the compaction capability-seam Agent Note. Token measurement remains a reusable LLM-family service; a template- or model-backed compactor can replace compact-basic without changing the meter, pruner, command, or automatic callers.