import { type Checkpoint } from "../../runtime/state/checkpointStore.js"; import type { CheckpointEdit } from "../../runtime/state/checkpointPatch/index.js"; import type { LoopStopKind } from "../../runtime/state/sourceLocation.js"; /** Where a pane looks: a stack by branch path and, when the stop is one * of the tool loop's own, which kind, so the shown frame is the caller * under the loop's. */ export type ViewAt = { branchPath: string[]; loopStop: LoopStopKind | undefined; }; /** The edits queued at a stop and the line the driver printed for each. */ export type PendingPreview = { edits: CheckpointEdit[]; applied: string[]; }; /** What the panes draw from: the stop's checkpoint, where the stop is, * where the person is looking (another branch, after `b`), the module * whose globals the globals pane shows (the viewed frame's), and the * edits queued so far. */ export type StopView = { checkpoint: Checkpoint; stop: ViewAt; viewed: ViewAt; moduleId: string; pending: PendingPreview; }; /** A frame by its stack and its distance from the top, 0 the last. */ export type FrameRef = { branchPath: string[]; depth: number; }; export type PaneName = "threads" | "locals" | "globals" | "callStack" | "branches" | "guards"; /** One row of a pane, as the pane prints it and as an edit anchors to * it, with the address the patch library takes. */ export type PaneRow = { kind: "thread"; id: string; label: string | null; active: boolean; messageCount: number; } | { kind: "local"; name: string; value: unknown; arg: boolean; frame: FrameRef; } | { kind: "global"; module: string; name: string; value: unknown; branchPath: string[]; } | { kind: "frame"; scopeName: string; moduleId: string; frame: FrameRef; } | { kind: "tool"; name: string; removed: boolean; loop: { branchPath: string[]; }; } | { kind: "branch"; key: string; path: string[]; label: string; status: string; owner: string; } | { kind: "loop"; round: number; removedTools: string[]; tools: string[] | null; } | { kind: "guard"; index: number; label: string | null; dimension: "cost" | "time"; /** The figures shown: a branch's own copy of an inherited guard. */ limit: number; spent: number; /** The owning copy's limit, the whole budget; `limit` unless the * row is a branch's copy. */ ownerLimit: number; disarmed: boolean; root: boolean; }; export type RowKind = PaneRow["kind"]; /** The rows a pane shows at this view. The one place a pane row is * made: the panes draw these, and the edits anchor to them. */ export declare function rowsFor(pane: PaneName, view: StopView): PaneRow[];