import { type EngineName } from "./models.js"; import type { JinnConfig, ModelRegistry } from "./types.js"; /** * Problems with the `fallback` chains under an `engines` mapping (empty = valid). * Unknown names and self-references are refused because a chain naming a typo would * fail silently — it simply never fires — rather than loudly. Cycles across engines * are deliberately accepted: they are how "either of these two" reads in config, and * the runtime walker carries a visited set. */ export declare function validateEngineFallbackChains(engines: Record): string[]; /** * Problems with the `fallbackModelMap` tables under an `engines` mapping (empty = valid). * The map is read with the pinned model as the key at the moment of a swap, so an entry * that is not a model id on both sides is one that can never match — refused here rather * than left to look like a mapping that simply never fires. */ export declare function validateEngineFallbackModelMaps(engines: Record): string[]; /** * The model a turn should run on once its engine has been substituted. * * `undefined` is the floor rule and the default answer: drop the pin, let the * substitute's own configured default apply. A model id belongs to exactly one * provider, so carrying one across a swap is how a codex pin reached Anthropic and * came back `model_not_found`. `engines..fallbackModelMap` is the only way a * pin survives — and only when the substitute actually serves what the map names, * because a map that could name anything would just spell the same bug in config. * An entry validation never saw, because it predates the check or was written by * hand, is refused here too rather than handed to a CLI as an argv. */ export declare function resolveSubstituteModel(config: JinnConfig, registry: ModelRegistry, { from, to, model }: { from: string; to: string; model: string | null | undefined; }): string | undefined; /** * Map the deprecated `sessions.rateLimitStrategy: "fallback"` / `sessions.fallbackEngine` * pair onto `engines.claude.fallback`, in place. An explicit chain always wins, an * explicit empty one included — that is an operator saying "no fallback" in the current * spelling. Both legacy keys are left on the config so whatever still reads them keeps * behaving exactly as it did. */ export declare function applyLegacyFallbackMigration(config: JinnConfig, warn?: (message: string) => void): void; /** * The first engine in `from`'s chain that `isUsable` accepts, continuing through the * chain of every engine it rejects. What "usable" means belongs to the caller — the * session runtime asks for registered and installed. * * The visited set is what makes the cycles the validator deliberately allows safe, and * it holds `from` from the start so the engine that just failed is never its own answer. */ export declare function resolveFallbackEngine(config: JinnConfig, from: string, isUsable: (engine: EngineName) => boolean): EngineName | null; //# sourceMappingURL=engine-fallback.d.ts.map