/** * The live ledger — the plan's rows joined to lifecycle progress. * * One ledger previews, streams, and settles. The rows a plan showed are the * rows the live region paints while the operation runs, joined to projected * progress by unit id: a row moves from its plan mark to the running mark and * on to its final mark, nested units roll up into the row that planned them, * and a wait whose subject is a unit pauses that row. An operation with no * plan, such as sign-in or upgrade, synthesizes its rows from the units it * reports. * * Settled rows leave the window and return in the result, so a long plan folds * into a count rather than scrolling past the height the scene allows. * * Every function here is pure: a recorded event log and the space the scene * gives decide the document. Wording comes from the phrase layer; the painter * owns every glyph. */ import type { Doc, LedgerColumn, LedgerFold, LedgerRow, Mark, SummaryPart, Text } from "./doc.js"; import { type ProgressState } from "./progress.js"; /** * What a plan contributes to its live ledger: the identity of each unit, as * the plan ledger showed it. The live ledger appends the two columns that * change while an operation runs, so plan, progress, and result differ only * in their final columns. */ export interface LivePlan { /** The title line the plan opened with, repainted above the live rows. */ readonly title: Text; readonly aside?: ReadonlyArray; /** The columns that identify a unit — its name, and any value fixed by the plan. */ readonly columns: ReadonlyArray; readonly rows: ReadonlyArray; /** Rows omitted from the live window because they have no work to run. */ readonly folds?: ReadonlyArray; /** Planning-time warnings that must remain visible at the gate. */ readonly attention?: Doc; /** The plan verdict shown before lifecycle progress starts. */ readonly verdict?: Text; /** A dim line beneath the ledger, such as the flag that reveals details. */ readonly hint?: Text; } export interface LivePlanRow { /** The unit id the plan layer assigned; lifecycle events carry the same one. */ readonly id: string; /** The mark the plan gave the row, which a unit that changed as planned keeps. */ readonly plannedMark: Mark; /** The planning word kept until the unit starts. */ readonly plannedStatus: Text; /** One cell per identifying column. */ readonly cells: ReadonlyArray; readonly depth?: number; } export interface LiveLedgerOptions { readonly plan?: LivePlan; /** Rows the whole ledger part may use, from the scene's height budget. */ readonly rows: number; /** Wall clock for the elapsed time on the status line. */ readonly nowMs: number; } /** One row of a live ledger: the line it paints, and where the window puts it. */ export interface LiveRow { readonly row: LedgerRow; /** `active` is running or paused, `pending` has not started, `settled` is done. */ readonly place: "active" | "pending" | "settled"; } /** * The rows a live ledger holds: the plan's, in plan order, or — where no plan * was presented — the units the operation reported, in the order they were * first observed. A nested unit never gets a row of its own; it rolls up. */ export declare const joinLiveRows: (state: ProgressState, plan: LivePlan | undefined) => ReadonlyArray; /** * The rows the window shows and the line that stands for the rest: work in * flight first, then the units waiting their turn, and never a settled row — * those have said what they had to say and return in the result ledger. */ export declare const liveWindow: (rows: ReadonlyArray, budget: number) => { readonly rows: ReadonlyArray; readonly folded?: LedgerFold; }; /** * The live region's ledger: the operation's title, the window of rows the * height allows, and the line that says how far it has come. Empty before the * operation starts and once it has settled, because the result ledger says * everything that is left to say. */ export declare const liveLedgerDoc: (state: ProgressState, options: LiveLedgerOptions) => Doc; //# sourceMappingURL=live-ledger.d.ts.map