import type { StoredMessage } from "./types.js";
export interface Turn {
    /** Index of the first message in this turn (user message) */
    startIndex: number;
    /** Index of the last message in this turn (assistant message with cumulativeInputTokens) */
    endIndex: number;
    /** Token count for this turn (delta from previous turn) */
    tokenCount: number;
    /** Indices of tool messages within this turn */
    toolMessageIndices: number[];
}
/**
 * Groups messages into turns. Each turn ends with an assistant message
 * that has cumulativeInputTokens. The token count for a turn is calculated
 * as the delta between consecutive assistant messages' cumulativeInputTokens.
 */
export declare function identifyTurns(messages: StoredMessage[]): Turn[];
/**
 * Selects the most recent turns that fit within the token budget.
 * Walks backward through turns, accumulating token counts.
 */
export declare function selectRecentTurns(turns: Turn[], tokenBudget: number): Turn[];
//# sourceMappingURL=turns.d.ts.map