/** * Provider Model Source Contract, a registration-time check that every * provider names where its model list actually comes from, so a caller can * always tell a live-refreshed list apart from a hand-maintained one and * both apart from a silently dead, undated array. * * Mirrors the fail-closed shape of `runtime/tools/contract-verifier.ts`: a * provider that fails this check is rejected at registration time with an * actionable message, instead of being allowed to register with an * undeclared model source and no way for a caller to tell whether that's a * bug, an outage, or simply a provider nobody wired up yet. * * A provider passes only when it declares a `modelSource` of: * - `live-discovery` , fetches its own model list from a live API, or * - `dated-static` , with a non-empty `asOf`, a complete hand-maintained * list verified as of that date, or * - `catalog-backed` , its real selectable models come from the shared, * independently refreshed model catalog. * * A non-empty `models` array is no longer accepted by itself: a provider * whose list happens to be populated but never says where that list came * from (or how it stays current) is exactly the undeclared, silently-stale * pattern this check exists to make unwritable, whether or not `models` is * empty today. */ import type { LLMProvider } from './interface.js'; export interface ProviderModelSourceViolation { readonly providerName: string; readonly message: string; } /** Minimal shape needed to run the check, real providers satisfy this trivially. */ export type ModelSourceCheckable = Pick; /** * Verify a single provider's declared model source. Returns an empty array * when the provider passes. */ export declare function verifyProviderModelSource(provider: ModelSourceCheckable): ProviderModelSourceViolation[]; /** Format a rejection into a single throwable error message. */ export declare function formatProviderModelSourceRejection(violations: readonly ProviderModelSourceViolation[]): string; /** Verify and throw in one call, the fail-closed registration-time gate callers actually want. */ export declare function assertProviderModelSource(provider: ModelSourceCheckable): void; //# sourceMappingURL=model-source-contract.d.ts.map