/** * The watch view's three layouts — cards, table, lanes — drawn from one frame model * (colorful-autopilot-watch/AC-1..AC-5, colorful-autopilot-watch/AC-9, * colorful-autopilot-watch/AC-11). * * Pure: the model is read once per frame by `watch.ts`, and a key that switches the * view re-renders it here without reading anything again. * * @module */ import { type Hue, type Paint } from './ansi.js'; import type { PauseRecord } from './pause.js'; import type { ItemStep, RunRecord } from './state.js'; export type View = 'cards' | 'table' | 'lanes'; export declare const VIEWS: readonly View[]; /** `v` cycles cards › table › lanes › cards (colorful-autopilot-watch/AC-7). */ export declare function nextView(v: View): View; /** No name means cards; a name that is not a view is null (colorful-autopilot-watch/AC-6). */ export declare function parseView(name: string | undefined): View | null; export declare const UNKNOWN_VIEW: (name: string) => string; /** One item as a frame shows it. Null fields are unknown or not yet recorded. */ export interface WatchItem { name: string; /** The roadmap title in full, or the instance name when it cannot be read. */ title: string; step: ItemStep; phase: string | null; /** As `aidlc status` writes it: `3/7`, `1/3 ▸1`. */ tasks: string | null; inStep: string | null; /** `#126 CI pending`. */ pr: string | null; /** The last thing autopilot said, with its age. */ event: string | null; error: string | null; /** Why the item waits on a person, in words; null when it does not. */ reason: string | null; } export interface FrameModel { run: RunRecord | null; paused: PauseRecord | null; /** `last pass 2m ago`, `stopped (STOP file present)`, `backing off until …`. */ driver: string; items: WatchItem[]; queue: string[]; } export interface RenderOpts { view: View; columns?: number; rows?: number; colour: boolean; /** Keys are read: the footer names them (colorful-autopilot-watch/AC-9). */ keys: boolean; } interface StepLook { label: string; hue: Hue; } export declare function stepLook(step: ItemStep): StepLook; /** The coloured step badge, shared with the operator dashboard so it is never copied (operator-console/AC-55). */ export declare function stepBadge(p: Paint, step: ItemStep): string; /** * `req ━ design ━ [impl] ─ test ─ deploy`: done green, the current phase bracketed, * the rest dim. Null for a phase outside the strip, which is then named in words. */ export declare function phaseStrip(p: Paint, phase: string | null): { text: string; width: number; } | null; /** `■■□□□ 2/5`; the bar is skipped past ten tasks, where it would be noise. */ export declare function taskBar(tasks: string): string; /** `…/logs/run-2026.log`: the end of a path is the part that tells runs apart. */ export declare function shortenLeft(text: string, max: number): string; export declare const COLUMNS: string[]; /** One item's table cells, in `COLUMNS` order. */ export declare function cellsOf(item: WatchItem): string[]; interface Lane { name: string; hue: Hue; steps: readonly ItemStep[]; } /** Grouped by what each item waits on (colorful-autopilot-watch/AC-5). */ export declare const LANES: readonly Lane[]; export declare function laneOf(step: ItemStep): number; export interface ItemsOpts { view: View; width: number; /** Rows the items may take; cards fall back to one line each past it, and always at 0 or below. */ rows?: number; /** Put before each item's first line; every other line of the item is indented by `leadWidth`. */ lead?: (item: WatchItem, index: number) => string; leadWidth?: number; /** The table only: no width, so no column is dropped (a frame off a terminal). */ unbounded?: boolean; } /** * The items alone, in one view, without the watch view's header and footer — what the * operator dashboard's BUILDING panel draws (building-panel-all-instances/AC-6). `first[i]` * is the line item `i` starts on. */ export declare function itemsBody(p: Paint, items: WatchItem[], o: ItemsOpts): { lines: string[]; first: number[]; hidden: string[]; }; /** The whole frame for one view: header, the items, footer. */ export declare function renderFrame(m: FrameModel, o: RenderOpts): string[]; export {}; //# sourceMappingURL=watch-view.d.ts.map