/**
 * Message History Self-Repair (Vibe-inspired)
 *
 * Cleans and repairs malformed message sequences before sending to the LLM.
 * Fixes orphaned tool results, missing assistant messages, duplicate roles,
 * and other common issues that cause API errors.
 */
export interface LLMMessage {
    role: 'system' | 'user' | 'assistant' | 'tool';
    content: string | null;
    tool_call_id?: string;
    tool_calls?: Array<{
        id: string;
        type: 'function';
        function: {
            name: string;
            arguments: string;
        };
    }>;
    name?: string;
}
export interface RepairResult {
    messages: LLMMessage[];
    repaired: boolean;
    repairs: string[];
}
/**
 * Repair a message history to ensure it's valid for LLM API calls.
 *
 * Fixes:
 * 1. Orphaned tool results (tool message without preceding assistant tool_call)
 * 2. Missing tool results (assistant with tool_calls but no following tool messages)
 * 3. Consecutive same-role messages (merge or insert bridge)
 * 4. Empty content messages
 * 5. First message must be system or user
 */
export declare function repairMessageHistory(messages: LLMMessage[]): RepairResult;
