/** * strategies/reactive.ts * * Reactive compaction strategy, emergency compaction triggered when the * provider returns a prompt-too-long error. * * This strategy must shrink the context aggressively and immediately, with * minimal latency. It uses a fixed-percentage drop that guarantees the * compacted context fits within a conservative safety margin (50% of the * context window). */ import type { StrategyInput, StrategyOutput } from '../types.js'; /** * Applies reactive compaction to handle a prompt-too-long error. * * Drops messages from the oldest end until the estimated token count * falls below `contextWindow * REACTIVE_TARGET_FRACTION`, then prepends * a reactive handoff note. * * @param input - Strategy input. `input.meta.limit` may carry the provider's * reported token limit for logging purposes. * @returns Strategy output with a drastically reduced message list. */ export declare function runReactive(input: StrategyInput): StrategyOutput; //# sourceMappingURL=reactive.d.ts.map