dsh-cc/dsh-cc--packages-compaction-compaction-cost-gate ↗★ 4

@dsh-cc/compaction-cost-gate

Cost-gated plan-step compaction: fire compactNow at todo boundaries only when projected input-token savings beat the prompt-cache rewrite price plus unamortized debt 通过评估Token节省与重写成本决定是否压缩,适合需要优化Token开销的任务。

패키지
@dsh-cc/compaction-cost-gate
호환성
미검증
Harness peer 범위
>=0.2.0-rc.2
Cordis peer 범위
>=0.2.0-rc.2
버전
0.9.1-rc.1
라이선스
Apache-2.0
최근 업데이트
2026. 10. 13.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗

Usage

import type { Context } from '@deepseek-ai/cordis'
import CompactionCostGate from '@dsh-cc/compaction-cost-gate'

export function apply(ctx: Context): void {
  ctx.plugin(CompactionCostGate)
}

The service is mounted by the cc preset (compaction group, id compaction-cost-gate). The compaction engine is deliberately not injected: cordis strict-read means a hard inject would kill the service where compaction is absent. It is read through a guarded accessor; when absent the package inactivates with one log line and one compaction-unavailable ledger row. Because a scoped get() cannot cross an isolate boundary, the gate shares the compaction realm.