/** * Pure line builders for the non-interactive surface (06-ONESHOT §2/§3). * * One exported function per `AgentEvent` kind, each returning `readonly * string[]`. No streams, no clocks, no process reads — every row is derived * from the event plus the injected `StreamContext`, and every glyph, colour and * body preview comes from the same `ui-core` presenters the Ink feed uses. */ import type { AgentEvent } from "../agent/events.js"; import { type Glyphs } from "../classic/render/glyphs.js"; import { type InkTheme } from "../classic/render/ink-theme.js"; export type StreamVerbosity = "quiet" | "normal" | "verbose"; export interface StreamContextInput { readonly columns: number; readonly color: boolean; readonly unicode: boolean; readonly verbosity: StreamVerbosity; readonly showThinking: boolean; } export interface StreamContext { /** Content columns available to a row: `columns - 2`. */ readonly width: number; readonly ink: InkTheme; readonly glyphs: Glyphs; readonly verbosity: StreamVerbosity; readonly showThinking: boolean; /** ASCII surfaces spell status out as `[tool]` rather than paint a glyph. */ readonly plainPrefixes: boolean; /** Collapsed body rows; `--verbose` raises the cap (§3 rule 5). */ readonly bodyRows: number; } /** Collapsed tool-output preview rows, and the `--verbose` ceiling. */ export declare const COLLAPSED_BODY_ROWS = 3; export declare const VERBOSE_BODY_ROWS = 40; export declare function createStreamContext(input: StreamContextInput): StreamContext; export declare function buildTurnStartLines(ctx: StreamContext, event: Extract): readonly string[]; /** Status text drives the spinner at `normal`; `--verbose` also logs each one. */ export declare function buildStatusLines(ctx: StreamContext, event: Extract): readonly string[]; /** Streaming fragments are aggregated by their terminal event; nothing to print. */ export declare function buildThinkingDeltaLines(): readonly string[]; export declare function buildThinkingBlockLines(ctx: StreamContext, event: Extract): readonly string[]; export declare function buildAssistantDeltaLines(): readonly string[]; export declare function buildAssistantMessageLines(ctx: StreamContext, event: Extract): readonly string[]; /** Shared by `assistant-message` and the `finish()` outcome write. */ export declare function renderAnswerLines(ctx: StreamContext, text: string): readonly string[]; export declare function buildNoticeLines(ctx: StreamContext, event: Extract): readonly string[]; export declare function buildToolCallLines(ctx: StreamContext, event: Extract): readonly string[]; /** Queued → executing is a spinner label change, not a transcript row. */ export declare function buildToolStartLines(): readonly string[]; export declare function buildToolOutputLines(ctx: StreamContext, event: Extract, tool?: { readonly name?: string | undefined; }): readonly string[]; export interface ToolResultExtras { /** Wall time for the call, injected by the renderer's clock. */ readonly elapsed?: string | undefined; } export declare function buildToolResultLines(ctx: StreamContext, event: Extract, extras?: ToolResultExtras): readonly string[]; export declare function buildToolBlockedLines(ctx: StreamContext, event: Extract): readonly string[]; /** * File-diff card for a mutation tool: title row plus `+N −M`, hunks only under * `--verbose` (§3 rule 6). */ export declare function buildToolDiffLines(ctx: StreamContext, event: Extract, name: string): readonly string[]; /** `tool.batch` body: one row per nested tool, plus the shared summary line. */ export declare function buildBatchLines(ctx: StreamContext, body: string): readonly string[]; export declare function buildPlanUpdateLines(ctx: StreamContext, event: Extract): readonly string[]; export declare function buildConfirmRequestLines(ctx: StreamContext, event: Extract): readonly string[]; /** The outcome is written by `finish()`; `turn-end` itself prints nothing. */ export declare function buildTurnEndLines(): readonly string[]; export declare function buildTurnAbortedLines(ctx: StreamContext): readonly string[]; export declare function buildTurnErrorLines(ctx: StreamContext, event: Extract): readonly string[]; export declare function buildCompactionStartLines(ctx: StreamContext, event: Extract): readonly string[]; /** Compaction bodies never stream to the transcript (§3 rule 8). */ export declare function buildCompactionDeltaLines(): readonly string[]; export declare function buildCompactionCompletedLines(ctx: StreamContext, event: Extract): readonly string[]; export declare function buildCompactionFailedLines(ctx: StreamContext, event: Extract): readonly string[]; export declare function buildCompactedLines(ctx: StreamContext, event: Extract): readonly string[]; export declare function buildTokenUsageLines(ctx: StreamContext, event: Extract): readonly string[]; export declare function buildContextEstimateLines(ctx: StreamContext, event: Extract): readonly string[];