dsh-cc/dsh-cc--packages-compaction-compaction-basic-cc ↗★ 1

@dsh-cc/compaction-basic

CC BasicCompactionEngine subclass carrying per-agent /compact preservation hints 适合需在压缩时保留指定内容的开发者;需代码方式接入。

패키지
@dsh-cc/compaction-basic
호환성
미검증
Harness peer 범위
>=0.1.5-rc.1
Cordis peer 범위
>=0.1.5-rc.1
버전
0.7.1
라이선스
Apache-2.0
최근 업데이트
2026. 9. 16.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 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 of BasicCompactionEngine; its summarize() override applies the parked hint, or passes the input through unchanged when none is set.
  • setCompactHint(agent, hint) — park a hint for agent (last write wins).
  • takeCompactHint(agent) — take and clear the parked hint; undefined when 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 /compact is byte-identical to upstream.