import type { Message } from "../types/index.js"; export interface ApiRound { messages: Message[]; estimatedTokens: number; } /** * Groups messages into "API rounds" — each round corresponds to one API * call-response cycle. This is critical because in agentic sessions with a * single user prompt, Wave creates a new Message per API round (each recursive * sendAIMessage call creates a new assistant message). * * Boundaries: * - A new `role: "user"` message starts a new round. * - A new `role: "assistant"` message with a different `id` starts a new round. * - A message with a `compact` block is pushed as its own round and starts a * new round after it. */ export declare function groupMessagesByApiRound(messages: Message[]): ApiRound[]; /** * Returns the last `roundCount` complete API rounds as a flat message array. * Never splits a tool_use/tool_result pair. If fewer rounds exist, returns all. */ export declare function getLastApiRounds(messages: Message[], roundCount: number): Message[];