import type { FailureContext } from "../shared/failure-report.js"; export interface CaptureErrorContext { errorMessagePolicy?: "omit"; route?: string; method?: string; userAgent?: string; /** * Whether the failure was caught by the app. Omitted, an explicit * `captureError()` call counts as handled; the Nitro error hook sets `false`. */ handled?: boolean; tags?: Record; extra?: Record; contexts?: Record>; aiTraceId?: string; /** * Identifiers the call site knows and the boundary cannot derive (an * automation's own thread, a run it started). Merged into * `extra.failureContext`; ambient run/thread ids are filled in for the rest. */ failure?: Partial; } export type CaptureErrorProvider = (error: unknown, context: CaptureErrorContext) => string | undefined | void; export declare function registerErrorCaptureProvider(name: string, provider: CaptureErrorProvider): () => void; export type ErrorFloodClass = "transient-database" | "database-credential" | "configuration"; export interface CaptureErrorStats { emitted: number; floodSuppressed: number; floodSummaries: number; noiseSuppressed: Record; activeFloodKeys: number; } export declare function getCaptureErrorStats(): CaptureErrorStats; export declare function resetCaptureErrorStateForTests(): void; export declare function captureError(error: unknown, callerContext?: CaptureErrorContext): string | undefined; export declare const captureServerError: typeof captureError;