/** * Progress state — the pure projection of an operation's lifecycle events. * * One projector folds the event stream into this state; the live frame reads * the latest state and never consumes raw events. The fold is a pure * function, so it is deterministic over a recorded event log and independent * of terminal width, mode, or renderer. */ import type { BlockingClass, OperationEvent, OperationMode, OperationPhase, ProgressAttempt, ProgressUnit, SettledOutcome, UnitState } from "@agentxm/workspace/transitions/planning"; export interface ProgressMeasure { readonly done: number; readonly total?: number; readonly unit: ProgressUnit; } export interface ProgressUnitState { readonly id: string; readonly label: string; readonly parentId?: string; readonly index: number; readonly total?: number; readonly status: "running" | UnitState; readonly startedAtMs: number; readonly settledAtMs?: number; readonly measure?: ProgressMeasure; /** The attempt in flight, present only while a producer is retrying the unit. */ readonly attempt?: ProgressAttempt; } export interface ProgressWait { readonly blockingClass: BlockingClass; readonly subject: string; readonly detail: string; readonly sinceMs: number; } export interface ProgressOperation { readonly id: string; readonly name: string; readonly mode: OperationMode; readonly startedAtMs: number; } export interface ProgressSettlement { readonly outcome: SettledOutcome; readonly atMs: number; } export interface ProgressState { readonly operation?: ProgressOperation; readonly phase?: OperationPhase; /** Every observed unit in start order, running and settled alike. */ readonly units: ReadonlyArray; /** Open waits, one per subject. */ readonly waiting: ReadonlyArray; readonly settled?: ProgressSettlement; /** Sequence number of the last folded event; 0 before any event. */ readonly lastSeq: number; } export declare const initialProgress: ProgressState; /** Fold one event into the state. UnitStarted and UnitResolved admit unknown units. */ export declare const reduceProgress: (state: ProgressState, event: OperationEvent) => ProgressState; /** Elapsed milliseconds of the operation at `nowMs`, or at settlement. */ export declare const operationElapsedMs: (state: ProgressState, nowMs?: number) => number | undefined; //# sourceMappingURL=progress.d.ts.map