export interface DiagnosticErrorInfo { name?: string; message: string; stack?: string; code?: string | number; } export interface AssistantMessageDiagnostic { type: string; timestamp: number; error?: DiagnosticErrorInfo; details?: Record; } export declare function formatThrownValue(value: unknown): string; export declare function extractDiagnosticError(error: unknown): DiagnosticErrorInfo; export declare function createAssistantMessageDiagnostic(type: string, error: unknown, details?: Record): AssistantMessageDiagnostic; export declare function appendAssistantMessageDiagnostic(message: T, diagnostic: AssistantMessageDiagnostic): void; /** Detail budget (chars) for enriched provider error messages. */ export declare const PROVIDER_ERROR_DETAIL_BUDGET = 600; /** * Build an enriched provider error message for retry diagnostics: * * ` | HTTP | code= | type= | requestID= | provider error: ` * * The original message stays verbatim at the BEGINNING so the transient / * rate-limit regex classifiers (`isTransientApiError`, `isRateLimitError`) * still match it — they regex the message string, so the prefix must remain * intact and untruncated. Detail parts come from the OpenAI SDK's APIError * shape: `status` (set for HTTP-level failures, undefined for mid-stream SSE * error chunks), `.error` (the raw provider JSON body — message / code / * type / metadata), plus the top-level `code` / `type` copies and * `requestID` the SDK attaches. The detail portion is clamped so the total * stays within the ~600-char budget; the original message is never * truncated. */ export declare function enrichProviderErrorMessage(error: unknown, budget?: number): string; //# sourceMappingURL=diagnostics.d.ts.map