/** * Shared resolution of `settings.fallbackModels` entries. * * These helpers were module-private to `agent-session-retry.ts`. They are * extracted (not copied) so compaction planner borrowing resolves candidates * with exactly the same semantics as main-chat model fallback, without reusing * `_trySwitchToFallbackModel`, which is main-chat turn machinery. */ import type { Api, Model } from "@bastani/pi-ai/compat"; import type { ThinkingLevel } from "@earendil-works/pi-agent-core"; /** Minimal runtime surface needed to resolve a configured fallback entry. */ export interface FallbackModelLookup { getAvailableSnapshot(): readonly Model[]; getModel(provider: string, modelId: string): Model | undefined; hasConfiguredAuth(provider: string): boolean; } /** A configured fallback entry resolved to a concrete model. */ export interface FallbackModelCandidate { model: Model; thinkingLevel?: ThinkingLevel; } /** Split a `provider/model[:thinkingLevel]` entry into its model id and optional level. */ export declare function splitFallbackModel(value: string): { modelId: string; thinkingLevel?: ThinkingLevel; }; /** * Resolve one configured fallback entry against the model registry. * * Unqualified ids search the available (authenticated) models and prefer the * current/default provider when ambiguous; qualified ids require configured * auth. Unusable candidates resolve to `undefined`. */ export declare function resolveFallbackModel(value: string, lookup: FallbackModelLookup, preferredProvider: string | undefined): FallbackModelCandidate | undefined; /** Stable `provider/model:level` identity for one attempted fallback candidate. */ export declare function fallbackKey(model: Model, thinkingLevel: ThinkingLevel | undefined): string; //# sourceMappingURL=fallback-models.d.ts.map