import type { PlanTodoItem, Row, ToolDiffHunk } from './transcript-types.js'; type ToolRow = Extract; type PlanRow = Extract; /** Long sessions keep the newest rows; older ones are dropped from the front. */ export declare const MAX_TRANSCRIPT_ROWS = 5000; /** * Drop the oldest rows past `max` and report how many went. The caller owns the * things that point at rows (the focused card, clickable maps), so they can be * invalidated with that count. */ export declare function boundTranscriptRows(rows: Row[], max?: number): number; export declare function findToolRowByCallId(rows: readonly Row[], callId: string): ToolRow | undefined; /** The card a repeated call of the same tool should merge into, if any. */ export declare function findMergeableToolRow(rows: readonly Row[], next: { name: string; args: string; }): ToolRow | undefined; /** * Fold a repeated call into the card that is already on screen: the card grows * a repeat mark and starts over as `running`. `now` is passed in so the flip * animation is testable. */ export declare function mergeToolCard(previous: ToolRow, next: { callId: string; name: string; args: string; title: string; summary: string; diff?: ToolDiffHunk[]; }, now: number, replaying?: boolean): void; export declare function findLivePlanRow(rows: readonly Row[]): PlanRow | undefined; /** Whether the plan card should open on its own when it has work left. */ export declare function planShouldDefaultExpand(plan: { active?: boolean; pending?: boolean; todos: readonly PlanTodoItem[]; }): boolean; /** Older / finished plans stay in the scrolling transcript, greyed out. */ export declare function archiveStalePlans(rows: readonly Row[], keep?: PlanRow): void; export interface TranscriptWindow { /** Index of the first transcript line on screen; a fresh window means a repaint. */ start: number; /** Clamped scroll offset; the caller stores it back for the next paint. */ scrollOffset: number; visibleLines: string[]; visibleRefs: (T | undefined)[]; /** Blank lines added above so a short transcript sits against the chrome. */ padding: number; } /** * Pick the slice of the transcript the terminal shows. * * `available` is the row budget the chrome left over; `reveal` is a row a fresh * message wants on screen, which wins over the current scroll position. A * transcript shorter than the budget is padded at the top so the prompt stays * at the bottom instead of floating in the middle of the screen. */ export declare function windowTranscript(input: { lines: readonly string[]; refs: readonly (T | undefined)[]; available: number; scrollOffset: number; reveal?: T | undefined; }): TranscriptWindow; export {};