import type { Screen } from "./screen.js"; import { type RowMarks } from "../marks.js"; import type { Element } from "../../tui/elements.js"; import type { KeyEvent } from "../../tui/input/types.js"; import type { ViewerThresholds } from "../thresholds.js"; import type { Interval } from "../timeline/intervals.js"; import { type TimelineSpan } from "../timeline/spans.js"; import type { TreeNode } from "../types.js"; import type { ViewAction, Viewport } from "../views/view.js"; export declare class TimelineScreen implements Screen { private traceId; private readonly thresholds; readonly screenName: "timeline"; private rounds; /** Tool spans the story outline says are waiting for an interrupt response. */ private waitingToolIds; private pageRows; /** The session's turns, one per message the person sent. With several, * each is drawn under its own row and axis, one after another. */ private turns; /** The run's wall time split into work and waits for the person. */ private times; /** The turn the zoom belongs to; a zoom never reaches another turn. */ private zoomTurn; private moves; private roots; private drillPath; /** undefined = unzoomed: the window tracks the drill root's full extent. */ private zoom; private cursor; private scrollTop; private hideAdmin; private query; private message; private following; private lineNumbers; private marks; private index; /** Every row of the drill view, folded ones included. */ private allRows; /** The rows drawn: `allRows` without what sits under a folded span. */ private rows; /** Spans the reader folded, by `rowKey`: a span that runs across turns * is drawn once per turn, and each copy folds on its own. */ private folded; /** Completed sub-agent groups folded on first sight, as on the trace. */ private defaultFolded; /** Groups whose default has been applied once, so a group the reader * opened stays open across follow updates. */ private foldDefaultsApplied; constructor(roots: TreeNode[], traceId: string, thresholds: ViewerThresholds, opts?: { drillTo?: string; }); /** Several turns: each carries its own axis line, so the screen draws * none at the top. */ private stacked; private chromeRows; /** The nearest row at or past `position` the cursor may rest on: an * axis or wait line is read, not selected. */ private selectable; private bindings; handleKey(ev: KeyEvent, viewport: Viewport): ViewAction; helpLines(): string[]; private moveSibling; private openDetail; private resetZoom; private toggleAdmin; private promptSearch; render(viewport: Viewport, sharedHints?: string): Element; setData(roots: TreeNode[]): void; setMarks(marks: RowMarks): void; focusId(): string | undefined; /** A turn header, an axis, a wait, or a gap is drawn but is no row of the * trace: nothing can be said about it, so it has no row id. */ selectedRowId(): string | undefined; setFocus(id: string): void; setTrace(traceId: string): void; applySearch(query: string): void; escape(): boolean; /** The row `id` lands on in the current view: itself, a lone round's * span, or the nearest ancestor that is drawn. A row under a folded * span counts as drawn; `reveal` opens the way to it. */ private drawnIdFor; /** A focus outside the drilled-in subtree: leave the drill so it shows. */ private afterLeavingDrill; notify(message: string): void; setFollowIndicator(on: boolean): void; /** Test probes — reading, never mutating. */ rowSpans(): TimelineSpan[]; cursorSpanId(): string | undefined; currentWindow(): Interval; private derive; /** Where the cursor lands after the rows are rebuilt: the row it was on * by turn-qualified key, else the nearest row above it by key, else * the same span or round by id in the same turn, else its first copy. */ private restoredPosition; /** A completed thread inside a tool folds the first time it is seen, as * a sub-agent's group does on the trace; a top-level thread never folds * by itself, and a thread still in its tool loop is not complete. The * rows the cursor is on or inside (`keep`) stay open, and count as * handled so a later update does not fold them. A fold reopens when its * thread runs again. */ private applyFoldDefaults; private hasChildRows; private rowKey; private isFolded; /** `allRows` without the rows under a folded span: once a folded row is * met, everything deeper than it is skipped until a row at its depth * or above. */ private visibleRows; /** The rows above `position` in `allRows` that contain it: the nearest * shallower row, then the nearest shallower than that, and so on. */ private ancestorRows; private open; /** Open every fold above the row and put the cursor on it. An id drawn * in several turns reveals its first copy. */ private reveal; private revealAt; /** The visible position of the row at `position` in `allRows`, or of * the folded row that hides it. */ private visiblePosition; /** Enter: fold or unfold a span with rows under it. A round opens in the * trace and a span with nothing under it opens its detail, as Right does. */ private toggleFoldOrOpen; private selected; private drillOrOpen; private drillOut; /** A turn's working time, which its bars are cut to; undefined when the * trace is one turn and the rows' own extent is the axis. */ private turnWindow; private cursorTurn; /** The axis a row is drawn on: its turn's zoom, else its turn's window, * else the whole view. */ private windowFor; private viewExtent; private rowsExtent; private viewStart; private window; private zoomBy; private pan; private applySearchText; /** Searches every row, folded or not, and opens the way to a match. */ private jumpMatch; private headerText; private footerText; /** What a search matches. A row the cursor cannot rest on has none. */ private rowText; /** ✖ for a span that logged an error itself, ⏸ for a tool waiting on a * person. The tool status comes from the story outline, so the timeline * and the trace never disagree about a tool. */ private mark; private threadLabel; private renderRow; /** A turn's row is its title across the gutter and bar columns with its * cost and call count at the right; its axis line is blank in the * gutter, the axis in the bar column, `total/self` at the right; a wait * row is one dim line. */ private turnParts; private labelPart; private barPart; private statsPart; private statsText; } /** What one flame row SAYS: llm rows show the asked question plus * tokens/cost; tool rows show the tool name and its first string * argument; everything else shows its display name and spanDetail. */ export declare class RowLabel { private readonly node; constructor(node: TreeNode); computeText(): string; private llmCost; private firstStringArg; } /** `total`, or `total/self` when they meaningfully differ; colored by the * duration thresholds so "slow" reads the same here as in the tree. */ export declare class DurationCell { private readonly thresholds; constructor(thresholds: ViewerThresholds); computeText(span: TimelineSpan, width: number): { text: string; color: string | undefined; }; }