import { type RunStatus, type TraceError } from "./problems.js"; import { type ToolStoryRow } from "./story.js"; import { type Round } from "./timeline/rounds.js"; import type { TreeNode } from "./types.js"; /** One column of the overview charts: a completed call, or a request that * failed before the provider answered (`round` undefined, `failure` set). */ export type OverviewCall = { /** The round id, or the failed request's story row id so the trace * screen can open it. */ id: string; round: Round | undefined; failure: TraceError | undefined; /** The problems marked on this column: the tools it requested that * failed, the errors logged between calls that landed here, and the * request failure itself. */ errors: TraceError[]; /** The tools this call requested, in story order. */ tools: ToolStoryRow[]; /** The tool call this request ran inside, with the index of the call * that requested that tool when the log shows it; undefined at the top. */ inside: { toolName: string; requestedBy: number | undefined; } | undefined; /** Every tool call this request ran inside, outermost first; empty at * the top. The charts bracket the calls that share one. */ enclosing: { id: string; toolName: string; }[]; /** The index of the call this one continues, with that call's reply and * tool results added: the previous call on the same thread inside the * same tools (see `roundDeltas`); undefined for the first on a thread. */ continues: number | undefined; /** Order key: the completion time, or the failure time. */ at: number; /** The round's thread name; undefined for a failed request or an unnamed thread. */ threadLabel: string | undefined; /** The name the charts and legend show: the label, with `#2`, `#3` * added when another thread already took the same name, so two calls * of one sub-agent tool read as two threads. `unnamed` without a label. */ threadName: string; }; export type OverviewData = { models: string[]; status: RunStatus; /** The turns' working time; the waits for the person are `waitingMs`. */ workingMs: number; waitingMs: number; costUsd: number; rounds: Round[]; calls: OverviewCall[]; errors: TraceError[]; }; export declare function overviewData(trace: TreeNode): OverviewData; /** The distinct thread names across the calls, in order of first use, so * every screen that colors by thread picks the same color for a name. */ export declare function threadNames(calls: OverviewCall[]): string[];