Move COMPACT_CHECKPOINT_SOURCE and isCompactCheckpointSource into a cordis-free src/checkpoint.ts leaf, re-exported from the root so every host-side consumer keeps its import. The client can then type-import the leaf without reaching dsh-session's root, whose Context merge declares the host sessions service and collides with the client's -- the dsh-commands/brand shape. Renaming the plugin id now fails the client typecheck. Also: keep recoverable summary text when a compact/summary mixes text with other block types, and capture the seeded-history provenance seqs from the pushes that produce them instead of deriving them by arithmetic.
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 deferred model-facing consumer. 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 |
tool-compact/ (deferred) |
Model-facing /compact tool over ctx.compact |
(registers on ctx.tools) |
The interface lives at compact/compact/, the backend at compact/compact-basic/, and deterministic pruning at compact/compact-tool-result-prune/. 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, or callers.