import type { FallbackEntry } from "../agents/fallback-chains"; export type ModelResolutionInput = { /** User-specified model override (already qualified, e.g. "openai/gpt-5.4"). */ override?: string; /** Fallback chain with explicit provider lists per entry. */ fallbackChain?: FallbackEntry[]; /** Connected provider IDs. If omitted, reads from disk cache. */ connectedProviders?: string[] | null; }; export type ModelResolutionSource = "override" | "fallback" | "skipped"; export type ModelResolutionResult = { /** Fully qualified model: "provider/model". */ model: string; source: ModelResolutionSource; variant?: string; }; /** * Resolve a model by matching fallback entries against connected providers. * * 1. If an explicit override is given, use it directly. * 2. Iterate the fallback chain — for each entry, check if any of its * providers are in the connected set. Return the first match as * "provider/model". * 3. If no connected providers data exists (first run), return undefined * so the caller can let OpenCode handle routing. */ export declare function resolveModel(input: ModelResolutionInput): ModelResolutionResult | undefined; export type QualifiedFallbackInput = { /** User override (already qualified). */ override?: string; /** Already-qualified model strings to try in order. */ fallbackChain?: string[]; /** Set of available models for availability checking. */ availableModels?: Set; }; /** * Resolve a model from a list of already-qualified strings. * Used by runtime fallback hooks (model-fallback, runtime-fallback, * foreground-fallback) that operate on qualified model IDs. */ export declare function resolveQualifiedModel(input: QualifiedFallbackInput): ModelResolutionResult | undefined;