import type { NexusAIConfig } from '../types/config.js'; import { type AliasMetadata, type ModelCapabilities } from '../types/providers.js'; /** A model name resolved through aliases to a model, provider, and capabilities. */ export interface ResolvedModel { /** The name requested. */ requestedModel: string; /** The concrete model it resolves to. */ model: string; /** The provider it belongs to, or null when unknown. */ providerName: string | null; /** Its registry entry, when there is one. */ capabilities?: ModelCapabilities; /** Present when the requested name was an alias rather than a concrete model. */ alias?: AliasMetadata; } /** * Resolves an alias, checking application aliases before bundled ones. A name that is not an alias * is returned unchanged. */ export declare function resolveModelAlias(model: string, aliases?: Record): string; /** Bundled and application model entries merged, application entries winning. */ export declare function getModelRegistry(config?: Pick): Record; /** Bundled and application aliases merged, application aliases winning. */ export declare function getModelAliases(config?: Pick): Record; /** * Stage and provenance for every alias, with application-registered metadata layered on top. * * An alias registered through `models.aliases` without metadata is reported as stable, because an * application pinning its own alias has already made that choice deliberately. */ export declare function getAliasMetadata(config?: Pick): Record; /** * Resolves an alias and looks up model capabilities. * * This runs on every completion, so it reads the bundled and application maps directly rather than * merging them into a new object first. `getModelRegistry()` and `getModelAliases()` remain the * merged views for listing and inspection. */ export declare function resolveModel(model: string, config?: Pick): ResolvedModel; /** Every model name in the registry, sorted. */ export declare function listKnownModels(config?: Pick): string[]; /** Every model in the registry that belongs to a provider, sorted. */ export declare function listModelsForProvider(providerName: string, config?: Pick): string[]; /** A model's registry entry, resolving aliases first. */ export declare function getModelCapabilities(model: string, config?: Pick): ModelCapabilities | undefined; /** Where a model entry came from and when it was last checked. */ export interface ModelProvenance { /** The name that was requested, which may be an alias. */ requestedModel: string; /** The concrete model the request resolves to. */ model: string; /** The provider it belongs to, or null when unknown. */ providerName: string | null; /** ISO-8601 date the entry was last verified. */ verifiedAt: string; /** Where the entry's data came from. */ source: string; /** Alias stage and provenance, when the requested name was an alias. */ alias?: AliasMetadata; /** Its registry entry, when there is one. */ capabilities?: ModelCapabilities; } /** * Reports where a model entry came from and when it was last checked. * * Bundled entries fall back to the registry-wide provenance date, so `verifiedAt` is always a real * date rather than an absent field a caller has to special-case. */ export declare function describeModel(model: string, config?: Pick): ModelProvenance; /** How old the model registry is. */ export interface RegistryFreshness { /** ISO-8601 date the bundled registry was last verified. */ verifiedAt: string; /** Days since then. */ ageDays: number; /** True when the registry or any entry is older than the window. */ stale: boolean; /** The window, in days. Defaults to 180. */ maxAgeDays: number; /** Entries carrying their own `verifiedAt` that are older than the window. */ staleModels: string[]; } /** * Measures how old the bundled registry data is. * * Model metadata and pricing drift silently as providers change their lineups, so a release check * can fail on this rather than discovering the drift from a wrong cost estimate in production. */ export declare function checkRegistryFreshness(options?: { now?: Date; maxAgeDays?: number; config?: Pick; }): RegistryFreshness; /** Throws when the bundled registry has not been verified inside the configured window. */ export declare function assertRegistryFreshness(options?: { now?: Date; maxAgeDays?: number; config?: Pick; }): RegistryFreshness;