/**
 * OwlCoda TUI Message Display
 *
 * Formats conversation messages and tool use blocks for terminal display.
 * Each message type has its own visual treatment.
 *
 * Visual notes:
 * - ⏺ (U+23FA) blinking indicator for tool in-progress
 * - ⎿ (U+23BF) tree bracket for nested tool output
 * - Dashed borders for file diffs
 * - Truncated command display (2 lines / 160 chars max)
 */
export declare function userFacingToolName(name: string): string;
export declare function shouldRouteToolStartFooterOnly(name: string): boolean;
export declare function shouldRouteToolEndFooterOnly(name: string, isError: boolean): boolean;
export declare function formatFooterOnlyToolStart(name: string): string;
export declare function formatFooterOnlyToolEnd(name: string, durationMs: number): string;
export declare function formatToolUseHeader(name: string, input: Record<string, unknown>): string;
/**
 * Format a tool in-progress message ("Running…" style).
 *
 * ```
 *   ⎿  Running…
 * ```
 */
export declare function formatToolProgress(message?: string): string;
/**
 * Try to pretty-print JSON content in tool output.
 * Keeps one-line JSON readable in the native terminal UI:
 * - Each line is independently checked for valid JSON
 * - Valid JSON is re-formatted with 2-space indentation
 * - Skipped if formatted output exceeds JSON_FORMAT_MAX_CHARS
 * - Precision loss detection for large numbers
 */
export declare function tryJsonFormatOutput(output: string): string;
/**
 * Format a tool result with tree bracket nesting.
 *
 * Success:
 * ```
 *   ⎿  ✓ bash  (1.2s)
 * ```
 *
 * Error:
 * ```
 *   ⎿  ✗ bash  (50ms)
 *        Error: not found
 * ```
 */
export declare function formatToolResult(name: string, output: string, isError: boolean, durationMs: number): string;
export type ChangeAction = 'update' | 'create' | 'overwrite';
export interface ChangeBlockResultOptions {
    toolName: string;
    action: ChangeAction;
    path: string;
    added: number;
    removed: number;
    durationMs: number;
    /** Pre-rendered change-block body lines (indented, selection-safe). */
    bodyLines: string[];
    isError?: boolean;
}
/**
 * Format a tool result whose evidence is a change block.
 *
 * Emits:
 * ```
 *   ⎿  ✓ Update src/foo.ts · +2 -1  (1.2s)
 *       42    context line
 *       43  - old line
 *       43  + new line
 *       44    context line
 * ```
 *
 * The path is shown in the header so the user sees *what* changed before
 * scanning the hunk; the `+N -M` summary doubles as a headline. Selection-
 * first: no borders, no background bands in the header — a drag-select
 * pulls raw diff lines, not decoration.
 */
export declare function formatChangeBlockResult(opts: ChangeBlockResultOptions): string;
/**
 * Format a tool result for transcript display.
 *
 * Previous version wrapped every output line with `│ … │` via renderBox
 * — when a tool errored and produced 15-30 lines of diagnostic output,
 * every row drew a bright red `│` on both sides, producing a "wall of
 * red verticals" that dominated the transcript and made the real error
 * message hard to pick out.
 *
 * New layout, git-log-ish:
 *
 *   ╴╴╴ ✗ Bash (11.2s) ╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴
 *     ▎ cat: /var/folders/…/tmp.xxx/smoke_reporting.log
 *     ▎ No such file or directory
 *     ▎ …
 *
 * Header: single horizontal rule prefixed with the status icon + tool
 * name + duration, colored by outcome (success green / error red).
 * Body: each output line indented and tagged with a single thin left
 * rail `▎` — one vertical glyph per row, dimmed for success and
 * colored for error. No right border, no bottom border. Quieter in
 * scrollback, still easy to visually bracket.
 */
export declare function formatToolResultBox(name: string, output: string, isError: boolean, durationMs: number): string;
interface CollapsedToolEntry {
    name: string;
    input: Record<string, unknown>;
    output: string;
    isError: boolean;
    durationMs: number;
}
/**
 * Groups consecutive collapsible tool results into a collapsed summary.
 *
 * Repeated read/search/list tool uses collapse
 * into "Read N files, searched M patterns" with Ctrl+O to expand.
 * Our version: collapsed summary line, /verbose to expand.
 */
export declare class ToolResultCollector {
    private buffer;
    private _verbose;
    get verbose(): boolean;
    set verbose(v: boolean);
    /** Check if a tool name is collapsible. */
    isCollapsible(name: string): boolean;
    /** Add a tool result to the current group. Returns null if buffered, or flush text if non-collapsible. */
    add(entry: CollapsedToolEntry): string | null;
    /** Flush any buffered group into display text and reset. */
    flush(): string;
    /** Number of buffered entries. */
    get pending(): number;
    /** Drop any buffered entries without rendering them. */
    clear(): void;
}
/**
 * Format the REPL prompt character.
 * ❯ (U+276F) — bright when ready, dimmed when loading.
 */
export declare function formatPrompt(opts?: {
    dimmed?: boolean;
    mode?: 'normal' | 'bash';
}): string;
export interface PromptDockFrameOptions {
    dimmed?: boolean;
    mode?: 'normal' | 'bash';
    multiline?: boolean;
    multilineRows?: number;
}
export interface PromptDockFrame {
    width: number;
    contentWidth: number;
    height: number;
    bodyRows: number;
    top: string;
    promptLine: string;
    fillerLines: string[];
    bottom: string;
    cursorColumn: number;
    leftBorder: string;
    rightBorder: string;
    multiline: boolean;
}
/**
 * Render a compact dock header above the readline prompt.
 * This keeps the input surface visually explicit without replacing readline.
 */
export declare function formatPromptDock(opts?: {
    dimmed?: boolean;
    mode?: 'normal' | 'bash';
}): string;
/**
 * Render a full-frame prompt dock. The prompt line is prepainted so readline can
 * type inside a visually complete box, and multiline mode gets filler rows with `~`.
 */
export declare function renderPromptDockFrame(opts?: PromptDockFrameOptions): PromptDockFrame;
export declare function renderPromptDockInputLine(frame: PromptDockFrame, input?: string): string;
/**
 * Format a user message display.
 */
export declare function formatUserMessage(text: string): string;
/**
 * Format an assistant text response header.
 */
export declare function formatAssistantHeader(): string;
/**
 * Thinking block — terminal port of the design's `oc-thinking`:
 *
 *   ▾ THINKING                 0.4s        ← head: small caps + chev + dur
 *   │ {body line 1}                        ← left hair-faint rule on every body row
 *   │ {body line 2}
 *
 * Collapsed (active && no text): one-line head w/ a pulsing dot.
 * Expanded: head + body lines, body indented past a vertical rule.
 */
export declare function formatThinking(opts?: {
    active?: boolean;
    text?: string;
    durationMs?: number;
}): string;
/**
 * Marker — terminal port of the design's `oc-marker`:
 *
 *   —  cwd ~/code/owlcoda · branch main · no pending changes
 *   —  ↯ INTERRUPTED BY USER · 0.4s INTO TOOL CALL
 *
 * Used for low-noise lifecycle events (cwd / branch echo, /clear,
 * /resume, interrupts, session restored). Three kinds:
 *   info  → mute em-dash + dim body
 *   warn  → warn em-dash + warn body  (interrupts, queue dropped)
 *   err   → err  em-dash + err  body  (session abort)
 *
 * Body text is rendered VERBATIM. The design's CSS uses
 * `text-transform: uppercase + letter-spacing: 0.12em` for visual
 * "metadata" feel — but in a terminal, mechanically uppercasing and
 * inserting thin spaces between every glyph mangles paths
 * (`~/AI/gitrep/owlcoda` becomes unreadable) and loses case-sensitive
 * info. We render exactly what the caller passes; the caller can
 * choose to write `INTERRUPTED BY USER` themselves when the text is a
 * label rather than data.
 */
export type MarkerKind = 'info' | 'warn' | 'err';
export declare function formatMarker(text: string, kind?: MarkerKind): string;
/**
 * Format a system/notification message.
 *
 * Lifecycle events (clear/resume/interrupt) render as quiet markers;
 * substantive notices (errors with body, MCP connect, rate limit) keep
 * the more visible banner treatment.
 */
export declare function formatSystemMessage(text: string): string;
export type PlatformEventKind = 'session' | 'router';
/**
 * Format a runtime/platform event that should remain readable in the transcript.
 */
export declare function formatPlatformEvent(kind: PlatformEventKind, text: string): string;
/**
 * Format an error message with box.
 */
export declare function formatErrorMessage(error: string): string;
/**
 * Format an error message inside a box.
 */
export declare function formatErrorBox(title: string, detail: string): string;
/**
 * Format token usage display after a response.
 */
export declare function formatTokenUsage(inputTokens: number, outputTokens: number): string;
/**
 * Format stop reason (only shown for unusual stops).
 */
export declare function formatStopReason(reason: string | null): string;
/**
 * Format iteration count.
 */
export declare function formatIterations(count: number): string;
export interface StatusBarOptions {
    model: string;
    tokens?: {
        input: number;
        output: number;
        max: number;
    };
    agents?: number;
    approve?: boolean;
    mode?: string;
    /** Estimated cost in USD (optional). */
    cost?: number;
    /** Number of conversation turns. */
    turns?: number;
    /** Duration of last request in ms. */
    durationMs?: number;
    /** Per-tool approved count. */
    perToolApproved?: number;
    /** Current working directory (truncated basename shown in status). */
    cwd?: string;
}
/**
 * Render a compact status line for the bottom of the terminal.
 * Compact density: model │ context │ cost │ approval │ duration
 */
export declare function renderStatusBar(opts: StatusBarOptions): string;
/**
 * Compact single-line rail for the composer panel's bottom.
 *
 * Fields (left-to-right, separated by · ):
 *   model · mode · status · context · draft
 * Right-aligned hint:
 *   Ctrl+C interrupt  (when busy)
 *   Enter send · Shift+Enter newline  (when idle)
 */
export interface ComposerRailOptions {
    readonly model: string;
    readonly mode: 'plan' | 'act' | 'auto' | 'manual';
    readonly busy: boolean;
    readonly queued: number;
    readonly contextTokens: number;
    readonly contextMax: number;
    readonly draftChars: number;
    /**
     * Low-churn terminals can render a stable draft-presence cell instead of
     * changing the rail on every typed character.
     */
    readonly draftCellMode?: 'count' | 'presence' | 'hidden';
    readonly interruptRequested: boolean;
    /** Available terminal columns. Enables fullscreen-first width pruning. */
    readonly columns?: number;
    /** True when a permission prompt owns the composer. */
    readonly approval?: boolean;
    /** Active tool name while busy, if known. */
    readonly activeToolName?: string;
    /** True when the visible REPL state is a recoverable error. */
    readonly error?: boolean;
    /** Estimated session cost in USD (UsageTracker.cost snapshot). */
    readonly cost?: number;
    /** Active git branch (welcome.ts readGitBranch helper). */
    readonly branch?: string | null;
    /** Connected MCP server count (MCPManager). */
    readonly mcpConnected?: number;
    /**
     * Active overlay/panel context — drives the right-aligned hint. The
     * design's rail surfaces different hotkeys depending on what owns the
     * pane: `↵ resume · d delete · esc close` in /sessions, etc.
     */
    readonly hintContext?: 'idle' | 'busy' | 'approval' | 'sessions' | 'settings' | 'mcp' | 'slash' | 'at' | 'model' | 'theme';
    /**
     * True when `autoApprove` is on (env var or `/yolo`/`/approve on`).
     * In yolo mode every tool call — including `dangerous` bash like
     * `rm -rf /` — runs without a permission prompt. The rail surfaces
     * a red `YOLO` cell so the user can't forget the safety net is off.
     */
    readonly yolo?: boolean;
}
/**
 * Status rail — terminal port of the design's `oc-rail` footer.
 *
 * Anatomy (cells separated by hair-faint │):
 *   ● {state-label-in-state-color} │ MODEL {model in ink} │
 *   CTX {n/m in ink} │ MODE {label} │ DRAFT {n} │ … {hint right-aligned}
 *
 * State colors mirror the design's `.cell.is-{state}` rules:
 *   ready=success · busy/tool=accent · wait/queue=warn · err=error.
 */
export declare function renderComposerRail(opts: ComposerRailOptions): string;
/**
 * Format a keyboard shortcut hint: "Enter to confirm · Esc to cancel"
 * Keyboard shortcut hint + byline pattern.
 */
export declare function formatKeyHint(hints: Array<{
    key: string;
    action: string;
}>): string;
/**
 * Format a rate-limit countdown message.
 * Rate-limit countdown timer.
 */
export declare function formatRateLimitCountdown(remainingMs: number, total: number, current: number): string;
/**
 * Always-visible status bar pinned to the terminal bottom row.
 *
 * Uses ANSI scroll-region + cursor-save/restore to reserve the
 * last terminal row for status info without disrupting normal
 * output flow.
 *
 * Architecture uses an imperative ANSI layout rather than a React box tree —
 * we use imperative ANSI escape sequences.
 */
export declare class PersistentStatusBar {
    private lastContent;
    private installed;
    private reservedRows;
    /** Number of bottom rows reserved for dock + status chrome. */
    setReservedRows(rows: number): void;
    getReservedRows(): number;
    getScrollBottomRow(): number;
    private applyScrollRegion;
    private repaintLastContent;
    /** Reserve the bottom row by setting a scroll region. */
    install(): void;
    /** Release the bottom row and restore full-screen scroll. */
    uninstall(): void;
    /** Paint / repaint the status bar content on the reserved bottom row. */
    update(opts: StatusBarOptions): void;
    /** Handle terminal resize — reinstall scroll region with new dimensions. */
    handleResize(): void;
    get isInstalled(): boolean;
}
export {};
