/** * Pure math for capping the TUI transcript that is re-rendered on reload/resume. * * These functions estimate wrapped line counts for agent messages and select the * tail of a message list that fits within the reload budget, trimming an oversized * head message when needed. They read only their arguments and hold no UI or session * state, so they live outside interactive-mode and are unit-testable in isolation. */ import type { AgentMessage } from "@caupulican/pi-agent-core"; import type { Message } from "@caupulican/pi-ai"; export declare const TUI_HISTORY_RELOAD_MAX_LINES = 1000; export declare const TUI_HISTORY_RELOAD_WRAP_WIDTH = 100; export interface TuiHistoryReloadOptions { /** Read tool-result content while sizing history. False when tool output is collapsed. */ includeToolResultContent?: boolean; } export declare function getContentText(content: unknown): string; export declare function getUserMessageText(message: Message): string; export declare function getTuiHistoryMessageText(message: AgentMessage): string; export declare function estimateTuiHistoryLines(message: AgentMessage, options?: TuiHistoryReloadOptions): number; export declare function trimTextToTuiHistoryTail(text: string, maxEstimatedLines: number): string; export declare function trimMessageToTuiHistoryTail(message: AgentMessage, maxEstimatedLines: number): AgentMessage; export declare function messagesForTuiHistoryReload(messages: AgentMessage[], options?: TuiHistoryReloadOptions): { messages: AgentMessage[]; omittedMessages: number; estimatedLines: number; }; //# sourceMappingURL=history-reload-math.d.ts.map