import type { LanguageModelV4, LanguageModelV4CallOptions } from "@ai-sdk/provider"; import type { ResolvedEntry } from "./stream.js"; import type { RouterAdmissionSnapshot, RouterHealthSnapshot, RouterRetryBudgetSnapshot } from "./types.js"; /** * A candidate entry normalized to a single internal shape, regardless of which * of the three accepted `ProviderEntry` forms the user wrote. */ import { RouterModelConfig } from "./router-model-config.js"; export declare abstract class RouterModelState extends RouterModelConfig { protected computeSupportedUrls(): Promise> | Record; healthSnapshot(): RouterHealthSnapshot[]; admissionSnapshot(): RouterAdmissionSnapshot[]; retryBudgetSnapshot(): RouterRetryBudgetSnapshot | undefined; /** * Commit a survivor into cooldown state, but only when reaching it actually * involved an earlier candidate failing (`hadFailure`), or when it is the * primary recovering (`fullIndex === 0`). A candidate reached merely because * earlier entries were modality-filtered out must NOT become sticky — * otherwise a later request of a different modality would skip a perfectly * healthy higher-priority primary. No-op when cooldown is disabled. */ protected commitSurvivor(fullIndex: number, hadFailure: boolean): void; protected assertHasCandidate(candidates: ResolvedEntry[]): void; /** Lazily instantiate (and cache) the model for a candidate index. */ protected instantiate(index: number): LanguageModelV4; /** * Filter entries by the prompt's required modalities and order them for this * request. With sticky cooldown, the active survivor is promoted to the head * instead of becoming a start offset, so every other compatible candidate * remains reachable if that survivor fails. */ protected selectCandidates(options: LanguageModelV4CallOptions, phase: "generate" | "stream-open"): { candidates: ResolvedEntry[]; startIndex: number; }; protected applySelection(candidates: ResolvedEntry[], from?: number): void; }