import type { CaptureErrorContext } from "../server/capture-error.js"; import { type FailureContext } from "../shared/failure-report.js"; /** * Builds the packet for one failure. Explicit fields win; the run's thread and * run ids come from the ambient request context when the caller was inside a * chat run, so a capture made anywhere in the run still names its thread. */ export declare function buildFailureContext(input?: Partial): FailureContext; /** * Returns `context` with the packet under `extra.failureContext`, which every * error provider forwards as additional data. The packet is derived from what * the call site already says (`tags.action`, `extra.runId`, `aiTraceId`, ...) * so no existing capture has to change to gain a thread link. A run id also * becomes `aiTraceId`, which joins the exception to the run's `$ai_trace`. */ export declare function withFailureContext(context: CaptureErrorContext, options?: { errorCode?: string; failureClass?: string; }): CaptureErrorContext;