/** * Shared model/provider failure classification. * * Workflows, subagents, and the main chat all need the same decision about * whether a provider failure may spend another model candidate. Keep this * module free of AgentSession and workflow imports so the published SDK can * expose it to the raw-TypeScript companion packages without a cycle. */ export type ModelFallbackFailureKind = "auth_on_candidate_provider" | "rate_limit" | "provider_unavailable" | "network_timeout" | "transport_error" | "model_unavailable" | "request_incompatible" | "cancelled" | "task_failure" | "unknown"; export type ModelFallbackFailureSource = "assistant_message" | "diagnostic" | "throw" | "structured" | "string_fallback"; export interface ModelFallbackFailureSignal { readonly kind: ModelFallbackFailureKind; readonly message: string; readonly source: ModelFallbackFailureSource; readonly stopReason?: string; readonly status?: number; readonly code?: string | number; readonly name?: string; } export declare function errorMessage(error: unknown): string; /** Alias used by the subagent package's older public helper name. */ export declare const modelFailureMessage: typeof errorMessage; export declare function normalizeModelFailureSignal(error: unknown): ModelFallbackFailureSignal; /** Whether a task-failure signal is a provider safety/refusal response. */ export declare function isSafetyRefusalFailure(error: unknown): boolean; /** True when this failure may spend a configured model fallback candidate. */ export declare function isRetryableModelFailure(error: unknown): boolean; /** True when the same model may be requested again before fallback advances. */ export declare function isRetryableSameModelFailure(error: unknown): boolean; //# sourceMappingURL=model-fallback-failures.d.ts.map