/** * Text the panel draws: columns, colours and the words behind each cell. Pure * functions over records — no terminal, no clock, no store — so a renderer can * be read and tested without the panel around it. * * @author mystery4f <40482524+mystery4f@users.noreply.github.com> */ import type { ThemeColor } from "@earendil-works/pi-coding-agent"; import type { CmdLoopTask, FireRecord, LoopBase, PromptLoopTask, Task, TaskKind, TaskStatus } from "../../tasks/base/task.js"; import type { Iteration, IterationCall } from "../../tasks/loop/iteration.js"; import { type PanelTaskView } from "./model.js"; /** Size column: output bytes for a process task; a loop task has no output file. */ export declare function formatSize(row: PanelTaskView): string; /** The live dot: running is loud, a stopped task is a hollow ring, paused is a warning. */ export declare function dotColour(task: Task): ThemeColor; /** Exit column: a process has a code, a loop has fires instead, a chain has steps. */ export declare function exitText(task: Task): string; /** * Right-hand numbers: a process reports runtime, output size and how long ago it last * changed; a loop its fires, schedule and the same age. Recency sits on the right so a * row that just moved to the top says why (ADR-0010). */ export declare function rightText(row: PanelTaskView, now: number, room?: number, foreign?: boolean): string; /** Name colour, as the replaced panel had it: the ending decides, not the kind. */ export declare function nameColour(task: Task): ThemeColor; export declare function messageOf(error: unknown): string; /** Iteration states, read from the one task-status palette. */ export declare const ITERATION_COLOUR: { running: "accent"; completed: "success"; aborted: "warning"; interrupted: "warning"; }; /** Tool-call states, read from the same palette. */ export declare const CALL_COLOUR: { running: "accent"; completed: "success"; failed: "error"; aborted: "warning"; interrupted: "warning"; }; export declare function isCommandCall(call: IterationCall): boolean; export declare function firesText(task: LoopBase): string; /** * Failed fires in a row on a command loop. Only a fire that ran can fail, so an * prompt loop never carries a streak and its rows never claim one (ADR-0017). */ export declare function failureStreak(task: Task): number; /** A raised signal on a command loop: the check has something outstanding (ADR-0018). */ export declare function signalWord(task: Task): string; /** Fires that never ran because the previous one still was, appended to the count. */ export declare function missedText(task: CmdLoopTask): string; export declare function nextFireText(task: LoopBase, row: PanelTaskView, backingOff?: boolean): string; /** Iteration list heading: kept and dropped counts are both stated, never hidden. */ export declare function iterationsText(task: PromptLoopTask): string; /** Fire list heading: kept and dropped counts are both stated, never hidden. */ export declare function firesHeading(task: CmdLoopTask): string; /** One fire row: number, time, outcome, exit code, duration and bytes (ADR-0015). */ export declare function fireLine(fire: FireRecord): string; /** The glyph a strip cell prints for its outcome; `–` never ran (ADR-0015). */ export declare const FIRE_MARK: { running: string; success: string; failed: string; signalled: string; skipped: string; interrupted: string; }; /** Strip colour by outcome: live, done, failed, never-ran, cut short by a stop. */ export declare const FIRE_COLOUR: { running: "accent"; success: "success"; failed: "error"; signalled: "warning"; skipped: "muted"; interrupted: "warning"; }; /** The mark a chain step carries on its line, one glyph per status it can hold. */ export declare const STEP_MARK: { running: string; paused: string; completed: string; failed: string; killed: string; interrupted: string; waiting: string; skipped: string; stopped: string; }; /** Step colour by status, so a finished step reads as done and a skipped one as absent. */ export declare function stepColour(status: TaskStatus): ThemeColor; /** One iteration row: fire number, result, when it ran, and what it cost. */ export declare function iterationLine(iteration: Iteration): string; /** How many calls the iteration kept; the dropped ones are marked below the list. */ export declare function callsText(iteration: Iteration): string; /** * Where the visible call window sits, oldest first. `rows` is how many lines the * pane can give the calls, so a short pane reports the shorter range it shows * instead of promising rows it never drew. */ export declare function callsHeading(iteration: Iteration, requested: number, rows?: number): string; export declare function callTopFor(iteration: Iteration, requested: number, rows?: number): number; /** A free-form field as one line: the panel draws rows, not paragraphs. */ export declare function singleLine(text: string, maxLength: number): string; /** * Short kind word printed in a row. Search uses the same word, so a reader who * sees `llm` can type `llm` and find that row. */ export declare function kindWord(kind: TaskKind): "proc" | "llm" | "cmd" | "chn";