import type { AssistantMessage } from "@mariozechner/pi-ai"; import type { OpenClawConfig } from "../../config/config.js"; export { extractLeadingHttpStatus, formatRawAssistantErrorForUi, isCloudflareOrHtmlErrorPage, parseApiErrorInfo, } from "../../shared/assistant-error-format.js"; import type { FailoverReason } from "./types.js"; export { isAuthErrorMessage, isAuthPermanentErrorMessage, isBillingErrorMessage, isOverloadedErrorMessage, isRateLimitErrorMessage, isServerErrorMessage, isTimeoutErrorMessage, } from "./failover-matches.js"; export declare function formatBillingErrorMessage(provider?: string, model?: string): string; export declare const BILLING_ERROR_USER_MESSAGE: string; export declare function isContextOverflowError(errorMessage?: string): boolean; export declare function isLikelyContextOverflowError(errorMessage?: string): boolean; export declare function isCompactionFailureError(errorMessage?: string): boolean; export declare function extractObservedOverflowTokenCount(errorMessage?: string): number | undefined; export type FailoverSignal = { status?: number; code?: string; message?: string; }; export type FailoverClassification = { kind: "reason"; reason: FailoverReason; } | { kind: "context_overflow"; }; export declare function isTransientHttpError(raw: string): boolean; export declare function classifyFailoverReasonFromHttpStatus(status: number | undefined, message?: string): FailoverReason | null; export declare function classifyFailoverSignal(signal: FailoverSignal): FailoverClassification | null; export declare function getApiErrorPayloadFingerprint(raw?: string): string | null; export declare function isRawApiErrorPayload(raw?: string): boolean; export declare function formatAssistantErrorText(msg: AssistantMessage, opts?: { cfg?: OpenClawConfig; sessionKey?: string; provider?: string; model?: string; }): string | undefined; export declare function sanitizeUserFacingText(text: unknown, opts?: { errorContext?: boolean; }): string; export declare function isRateLimitAssistantError(msg: AssistantMessage | undefined): boolean; export declare function isMissingToolCallInputError(raw: string): boolean; export declare function isBillingAssistantError(msg: AssistantMessage | undefined): boolean; export declare function parseImageDimensionError(raw: string): { maxDimensionPx?: number; messageIndex?: number; contentIndex?: number; raw: string; } | null; export declare function isImageDimensionErrorMessage(raw: string): boolean; export declare function parseImageSizeError(raw: string): { maxMb?: number; raw: string; } | null; export declare function isImageSizeError(errorMessage?: string): boolean; export declare function isCloudCodeAssistFormatError(raw: string): boolean; export declare function isAuthAssistantError(msg: AssistantMessage | undefined): boolean; export declare function isModelNotFoundErrorMessage(raw: string): boolean; export declare function classifyFailoverReason(raw: string): FailoverReason | null; export declare function isFailoverErrorMessage(raw: string): boolean; export declare function isFailoverAssistantError(msg: AssistantMessage | undefined): boolean;