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

@dsh-cc/compaction-cost-gate

提供基于成本门控的计划步骤压缩服务 通过评估Token节省与重写成本决定是否压缩,适合需要优化Token开销的任务。

套件
@dsh-cc/compaction-cost-gate
相容性
待驗證
Harness 依賴範圍
>=0.2.0-rc.2
Cordis 依賴範圍
>=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.