import type { SKYKOIConfig } from "../config/config.js"; import type { FailoverReason } from "./pi-embedded-helpers.js"; export { clearStickyModelFallbacks } from "./model-fallback-sticky.js"; type FallbackAttempt = { provider: string; model: string; error: string; reason?: FailoverReason; status?: number; code?: string; }; export declare function runWithModelFallback(params: { cfg: SKYKOIConfig | undefined; provider: string; model: string; koiDir?: string; /** Optional explicit fallbacks list; when provided (even empty), replaces kois.defaults.model.fallbacks. */ fallbacksOverride?: string[]; /** `info.sticky` marks a run resuming a REMEMBERED fallback (no fresh failure * this turn) — callers use it to announce the switch only the first time. */ run: (provider: string, model: string, info?: { sticky: boolean; }) => Promise; onError?: (attempt: { provider: string; model: string; error: unknown; attempt: number; total: number; }) => void | Promise; }): Promise<{ result: T; provider: string; model: string; attempts: FallbackAttempt[]; }>; export declare function runWithImageModelFallback(params: { cfg: SKYKOIConfig | undefined; modelOverride?: string; run: (provider: string, model: string) => Promise; onError?: (attempt: { provider: string; model: string; error: unknown; attempt: number; total: number; }) => void | Promise; }): Promise<{ result: T; provider: string; model: string; attempts: FallbackAttempt[]; }>;