export declare const AGENT_FAILURE_CATEGORIES: { readonly EXTERNAL_ABORT: "external_abort"; readonly PART_TIMEOUT: "part_timeout"; readonly PROVIDER_ERROR: "provider_error"; readonly PROVIDER_STREAM_PARSE_ERROR: "provider_stream_parse_error"; readonly STREAM_IDLE_TIMEOUT: "stream_idle_timeout"; }; export declare const MAX_AGENT_FAILURE_MESSAGE_BYTES: number; export type AgentFailureCategory = typeof AGENT_FAILURE_CATEGORIES[keyof typeof AGENT_FAILURE_CATEGORIES]; export interface AgentFailureResponseLike { readonly status: string; readonly content: string; readonly error?: string; readonly failureCategory?: AgentFailureCategory; } export declare function isAgentFailureCategory(value: unknown): value is AgentFailureCategory; export interface AgentFailureDetail { category: AgentFailureCategory; reason: string; } interface FormatAgentFailureOptions { includeCategoryPrefix?: boolean; } export declare function createPartTimeoutReason(timeoutMs: number): string; export declare function createExternalAbortFailure(reason: unknown): AgentFailureDetail; export declare function createPartTimeoutFailure(reason: unknown): AgentFailureDetail; export declare function createProviderErrorFailure(reason: unknown): AgentFailureDetail; export declare function createProviderStreamParseFailure(reason: unknown): AgentFailureDetail; export declare function createStreamIdleTimeoutFailure(reason: unknown): AgentFailureDetail; export declare function classifyAbortSignalReason(reason: unknown): AgentFailureDetail; export declare function formatAgentFailure(detail: AgentFailureDetail, options?: FormatAgentFailureOptions): string; export declare class AgentFailureError extends Error { readonly failureCategory: AgentFailureCategory; readonly reason: string; constructor(detail: AgentFailureDetail); } export declare class ProviderStreamParseError extends AgentFailureError { constructor(reason: unknown); } export declare function createAgentFailureError(category: AgentFailureCategory, reason: unknown): AgentFailureError; export declare function createAgentResponseFailureError(response: AgentFailureResponseLike, fallbackPrefix: string): Error; export declare function isAgentFailureError(error: unknown): error is AgentFailureError; export declare function stripProviderStreamParsePrefix(reason: unknown): string; export declare function createProviderStreamParseError(reason: unknown): ProviderStreamParseError; export declare function isProviderStreamParseError(error: unknown): error is ProviderStreamParseError; export {}; //# sourceMappingURL=agent-failure.d.ts.map