import type * as smoltalk from "smoltalk"; export type CompactionConfig = { trigger: "token" | "messages"; threshold: number; }; export declare function shouldCompact(messages: smoltalk.Message[], config: CompactionConfig): boolean; /** * Find a safe split point that respects message boundaries. * * Walk forward from the midpoint until the boundary message is a `user` * or `assistant` message. A `tool` reply is never a boundary — keeping * the thread from a tool reply onward would orphan it from the * `assistant` message carrying its `tool_calls`. Any other role is safe: * tool replies always follow their assistant message, so keeping from an * assistant message keeps its replies with it. Accepting assistant * boundaries matters for agentic tool loops, where the only user message * is the opening request and everything after is assistant/tool traffic. * * Returns the index of the message that should be the FIRST kept message * (i.e., everything before this index is compacted). * * Returns -1 if no clean boundary exists (caller should skip compacting). */ export declare function findCompactionSplitPoint(messages: smoltalk.Message[]): number; export declare function buildCompactionPrompt(messages: smoltalk.Message[]): string; export declare function buildMergeSummaryPrompt(existingSummary: string, newSummary: string): string;