/** * Model preflight and freshness checks. * * Two related, provider-agnostic concerns, kept as pure functions so they can * be unit-tested without the real registry: * * 1. Preflight: verify that configured model references (defaults, smart-routing * pins) still resolve against the model registry. Model IDs churn as * providers add/remove models, so a default can silently point at a removed * ID and only fail at runtime. * * 2. Freshness: given a configured model and the models available for its * provider, detect strictly-newer siblings in the same family so we can nudge * the user (e.g. "your OpenAI default gpt-5.4 is behind gpt-5.6"). */ export interface ParsedModelId { /** Non-numeric leading tokens joined by "-" (e.g. "gpt", "claude-sonnet"). */ stem: string; /** Flattened numeric version components (e.g. [5, 6] for gpt-5.6). */ version: number[]; /** Sorted variant tokens (e.g. ["mini"]). */ variants: string[]; /** Whether the id contains a dated snapshot token. */ dated: boolean; } /** * Parse a model id into a family stem, a numeric version, and variant tokens. * Deliberately simple and conservative: version tokens are dotted numbers, * dated snapshots are flagged, everything after the first version token that * isn't a version is treated as a variant. */ export declare function parseModelId(id: string): ParsedModelId; /** * Given the currently configured model id and the set of model ids available * for the same provider, return the ids that are a strictly-newer version of * the same family (same stem, same variant set), newest first. * * Conservative by design: only clean (non-dated) candidates are suggested, so * we never nudge someone from a stable alias onto a dated snapshot. */ export declare function findNewerModels(currentId: string, candidateIds: readonly string[]): string[]; export interface PreflightProblem { provider: string; /** The reference kind that failed to resolve. */ kind: "default" | "smart-routing"; /** Extra detail for smart-routing tier, when applicable. */ tier?: string; modelId: string; message: string; } export interface FreshnessNote { provider: string; currentId: string; /** Newer sibling ids in the same family, newest first. */ newer: string[]; } /** * Check that every configured default resolves against the registry, and * collect freshness notes for defaults that have newer siblings. * * `providerModelIds` maps a provider to the model ids it exposes in the * registry. `defaults` maps a provider to its configured default model id. */ export declare function checkDefaults(defaults: Record, providerModelIds: Record): { problems: PreflightProblem[]; freshness: FreshnessNote[]; }; /** * Validate user-pinned smart-routing model references against the registry. * `pins` maps a tier to a "provider/model-id" reference (as stored in settings). * A reference resolves when its model id exists for its provider. */ export declare function checkSmartRoutingPins(pins: Record, providerModelIds: Record): PreflightProblem[]; //# sourceMappingURL=model-freshness.d.ts.map