import type { ILLMProvider } from "../llm/ILLMProvider.ts"; import type { Message } from "../llm/types.ts"; /** * Compresses conversation context when approaching token limits. * * Estimates token usage via a heuristic (content.length / 4), then * summarises the middle block into a single assistant message when * the total exceeds a configurable threshold ratio of the context window. * The system prompt and last N messages are preserved verbatim. * * Used before LLM calls to prevent context overflow without losing * critical conversation boundaries. */ export declare class ContextCompressor { private llm; private thresholdRatio; private defaultContextWindow; constructor(llm: ILLMProvider, thresholdRatio?: number, defaultContextWindow?: number); compress(messages: Message[], modelContextWindow?: number, isSkillContentProtected?: boolean): Promise; private splitMessages; private compressProtected; private partitionProtected; private classifyTurn; private ensureValidToolSequence; private hasMatchingAssistant; private summarize; private estimateTokens; } //# sourceMappingURL=ContextCompressor.d.ts.map