/** * Runtime context data supplied to a {@link CompactionStrategy} * when deciding whether to compact the context window. * * @docLink packages/runner/dev-guide#compaction */ export interface CompactionContext { estimatedTokens: number; contextWindow: number; messageCount: number; lastCompactionSeq: number | null; timeSinceLastCompaction: number | null; } /** * Strategy for deciding when the context window should be compacted. * * Implementations receive the current {@link CompactionContext} and * return true when compaction should proceed. * * @docLink packages/runner/dev-guide#compaction */ export interface CompactionStrategy { shouldCompact(context: CompactionContext): boolean; } /** * Compaction strategy that triggers when estimated token usage * exceeds a percentage of the context window. A cooldown period * prevents thrashing. * * @docLink packages/runner/dev-guide#compaction */ export declare class TokenThresholdStrategy implements CompactionStrategy { private readonly thresholdPercent; private readonly minCooldownMs; constructor(opts: { thresholdPercent: number; minCooldownMs: number; }); shouldCompact(context: CompactionContext): boolean; } //# sourceMappingURL=strategy.d.ts.map