/** * Token-aware conversation compaction (sliding window). * * Phase-1 sibling of the reference engines' compaction. When a conversation's * estimated token count exceeds a budget, drop the oldest non-system messages * (keeping the system prompt and most recent turns) so the next model call stays * within context. A coarse char/4 token estimate is used. * * Safety: the kept window never *starts* on a `tool` message (which would orphan * a tool result whose preceding `assistant` tool_call was trimmed). */ type Message = Record; export declare function estimateTokens(message: Message): number; /** * Return `messages` trimmed to roughly `maxTokens`, preserving system messages * and the most recent turns. Returns the input unchanged when already within * budget or when `maxTokens` is non-positive (disabled). */ export declare function compact(messages: Message[], maxTokens: number): Message[]; export {}; //# sourceMappingURL=compaction.d.ts.map