import type { Message } from './types.js';
/** Transcript row for TUI and HTTP clients (flattened from persisted session messages). */
export interface ClientHistoryMessage {
    role: 'user' | 'assistant' | 'system';
    content: string;
    timestamp?: number;
    toolCalls?: Array<{
        name: string;
        args?: unknown;
        result?: string;
        isError?: boolean;
    }>;
}
export declare function flattenMessageContent(content: string | unknown[]): string;
/**
 * Maps gateway/session API messages into a linear chat history for clients.
 * Tool / toolResult rows are merged into assistant `toolCalls` when ids match; otherwise skipped.
 */
export declare function messagesToClientHistory(messages: Message[], opts?: {
    limit?: number;
}): ClientHistoryMessage[];
