export declare function describeErrorWithCauses(err: unknown, maxLinks?: number): string; export declare function isProviderConnectionErrorMessage(message: string): boolean; export declare function isProviderConnectionError(err: unknown): boolean; export declare function isContextOverflowMessage(message: string): boolean; export declare const BUILDER_GATEWAY_INTERNAL_ERROR_CODE = "builder_gateway_internal_error"; export declare const PROVIDER_TRANSIENT_REJECTION_ERROR_CODE = "provider_transient_rejection"; export declare const PROVIDER_RATE_LIMITED_ERROR_CODE = "provider_rate_limited"; export declare function isCreditsLimitErrorCode(errorCode?: string): boolean; export declare function isBareProviderRejectionMessage(message: string): boolean; export declare function isBuilderGatewayInternalErrorMessage(message: string): boolean; export declare function isGenericInternalServerErrorMessage(message: string): boolean; export declare function canonicalizeBuilderGatewayErrorCode(code: string | undefined, message: string): string | undefined; export declare function isContextOverflowCode(code: string | undefined): boolean; export interface ProviderErrorClassification { errorCode?: string; statusCode?: number; providerRetryable?: boolean; retryAfterMs?: number; } export declare function isInvalidAttachmentProviderMessage(message: string): boolean; export declare function extractRetryAfterMs(err: unknown): number | undefined; export declare function classifyProviderError(err: unknown, timedOut?: boolean): ProviderErrorClassification; /** * Last-resort error code for a terminal error that reached persistence with no * structured code. Persisting `"unknown"` is not a neutral default: the client * auto-recovers a fixed list of transport codes, so an unclassified transient * blip ends the user's chat while the identical failure carrying its real code * resumes. Over four days that gap was 28% of ALL production chat turns. * * The invariant is NOT "only transport failures may be named". It is: a code * returned here must be absent from the client's recoverable list unless a * fresh attempt genuinely helps. Naming a deterministic failure is what stops * it from reaching the user as raw provider text and hiding inside `unknown`; * naming it *recoverable* is what buys a retry spiral. Those are different * decisions, and `error-detail.spec.ts` asserts the deterministic codes below * stay non-recoverable. */ export declare function classifyTerminalErrorCode(message: string | undefined): string | undefined;