dsh-cc/dsh-cc--packages-compaction-compaction-basic-cc ↗★ 1
@dsh-cc/compaction-basic
CC 压缩引擎子类,为每个 Agent 的 /compact 携带保留提示。 适合需在压缩时保留指定内容的开发者;需代码方式接入。
安裝
此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗
說明文件
閱讀完整 README ↗Usage
import CcBasicCompactionEngine from '@dsh-cc/compaction-basic'
import { setCompactHint, takeCompactHint, applyCompactHint } from '@dsh-cc/compaction-basic'
// Set the preservation hint the next compaction of this agent will honour.
setCompactHint(agent, 'Keep the migration plan and open TODOs')
// The engine consumes the hint inside summarize() (take = read + clear),
// so a later compaction of the same agent starts hint-free.
CcBasicCompactionEngine— drop-in subclass ofBasicCompactionEngine; itssummarize()override applies the parked hint, or passes the input through unchanged when none is set.setCompactHint(agent, hint)— park a hint foragent(last write wins).takeCompactHint(agent)— take and clear the parked hint;undefinedwhen none.applyCompactHint(input, hint)— append the hint as one extra user message at the end of the summarizer input's replayed messages; an empty/whitespace hint returns the input unchanged (same reference), so a bare/compactis byte-identical to upstream.