import type { TrackingMeta } from "../tracking/registry.js"; import type { UnknownWriteCause } from "./types.js"; export interface RunTerminalTrackingFields { runId: string; threadId: string; turnId: string; status: "completed" | "errored" | "aborted" | "truncated"; terminalReason: string; errorCode?: string; dispatchMode?: string; abortReason?: string; durationMs?: number; model?: string; engineName?: string; attemptCount?: number; /** For `write_tool_outcome_unknown`: the call held back, and why. */ blockedTool?: string; blockedBy?: UnknownWriteCause; /** Set only by a reap, which ends a run outside the process running it. */ reap?: { source: string; recoveryOutcome?: string; }; } /** * The one `agent_run_terminal` sender, shared by the run's own process and the * SQL writes that end a run for it, so the two shapes cannot drift apart. The returned promise never * rejects, so a caller can hand it to `waitUntil` without guarding it. */ export declare function trackRunTerminal(fields: RunTerminalTrackingFields, source: TrackingMeta | undefined): Promise;