/** Pure viewport, selection, and scrolling rules for exclusive TUI panels. */ import type { TranscriptEntry } from './projection.ts'; /** * Remove assistant settlements that contain reasoning but no final response. * They remain in the durable transcript and in the Ctrl/Alt+R fold; excluding * them only from Ctrl+O navigation prevents short progress thoughts from * appearing as a long run of misleading `reply` entries. */ export declare function inspectableTranscriptEntries(entries: readonly TranscriptEntry[]): readonly TranscriptEntry[]; /** Terminal-space allocation for the inspector's one dynamic screen. */ export interface InspectorViewport { /** Maximum dynamic rows, kept strictly below the terminal height. */ maxHeight: number; /** Rows available to the selected entry after border, title, and footer. */ bodyRows: number; /** Optional blank rows separating title/body/footer on roomy terminals. */ gapRows: 0 | 2; /** Columns available inside the horizontal border and padding. */ contentColumns: number; /** Safe outer width for a bordered dynamic panel; never writes column N. */ outerColumns: number; /** Tiny terminals use a borderless one-line close hint. */ compact: boolean; } /** One transcript-to-composer gutter, collapsed on short terminals. */ export declare function layoutGutterRows(rows: number): 0 | 1; /** Measured chrome that sits below (or in) the live region. */ export interface LiveRegionChrome { /** Terminal rows. */ readonly terminalRows: number; /** Editor rows inside the composer band (frozen reports 1). */ readonly composerRows: number; /** Status footer rows. */ readonly statusBarRows: 1 | 2; /** Completion menu rows (0 when closed). */ readonly menuRows: number; /** Transcript-to-composer gutter. */ readonly gutterRows: 0 | 1; /** Notice line present. */ readonly notice: boolean; /** Todo summary line present. */ readonly todo: boolean; /** Agents summary line present. */ readonly agents: boolean; } /** * Rows left for live transcript and streaming after pinning the composer and * status at the bottom. Variable chrome (menu, notice, todos, agents, extra * status row, extra editor rows) is deducted here so those rows cover the * live region instead of growing the tree and moving the bottom bar. */ export declare function liveRegionBudget(chrome: LiveRegionChrome): number; /** * Keep the inspector plus its persistent status/composer chrome below * `stdout.rows`: at equality Ink clears the terminal and rewrites all * accumulated `` output on every frame. */ export declare function panelViewport(columns: number, rows: number): InspectorViewport; /** * Viewport for an expanded (near-fullscreen) document overlay: the document * replaces the transcript area entirely, so the half-screen overlay cap and * the inter-section gaps drop away while the bottom live region (composer, * status) and the Static-rewrite margin stay reserved. The result stays * below terminal height, which is what keeps Ink off its full-rewrite path. */ export declare function expandedDocumentViewport(columns: number, rows: number): InspectorViewport; /** Backward-compatible name for the Ctrl+O-specific caller and tests. */ export declare function inspectorViewport(columns: number, rows: number): InspectorViewport; /** Clamp a first-visible row to the range representable by one viewport. */ export declare function clampScroll(offset: number, totalRows: number, visibleRows: number): number; /** Move a viewport by a signed row delta without escaping its content. */ export declare function moveScroll(offset: number, delta: number, totalRows: number, visibleRows: number): number; /** Keep one focused row visible while preserving the current window when possible. */ export declare function revealRow(offset: number, row: number, totalRows: number, visibleRows: number): number; /** Center a selected list row where possible, clamped at both ends. */ export declare function selectionWindow(cursor: number, totalRows: number, visibleRows: number): number; /** Follow appended history only while the inspector cursor was at the tail. */ export declare function followInspectorCursor(cursor: number, previousLength: number, nextLength: number): number;