import { type TreeIndex } from "./forest.js"; import type { TreeNode } from "./types.js"; export type TraceError = { /** The first occurrence's node id. */ id: string; message: string; errorType: string | undefined; /** How often the same message was logged in the same place within a * second: an error rethrown up a call stack is one error. */ count: number; /** Milliseconds since the epoch of the first occurrence. */ at: number; /** The tool call the error was logged inside, innermost, or undefined * for an error between calls. */ toolId: string | undefined; node: TreeNode; }; /** How the whole run ended, as its lifecycle events record it. `paused` * is a run waiting for someone to answer an interrupt. */ export type RunStatus = "done" | "crashed" | "paused" | "running"; export declare function traceErrors(trace: TreeNode, index?: TreeIndex): TraceError[]; export declare function runStatus(trace: TreeNode): RunStatus; /** One pause of the run: an interrupt went to a person, and the run * resumed when the next `agentStart` was logged, if it has yet. */ export type RunPause = { interruptId: string | undefined; pausedAt: number; resumedAt: number | undefined; /** The `interruptResolved` event that paused the run. */ node: TreeNode; }; export declare function runPauses(trace: TreeNode): RunPause[];