import type { ProviderRegistry } from './registry.js'; import type { ModelLimitsService } from './model-limits.js'; import type { MinimalModelDefinition } from './model-catalog-synthetic.js'; import { type ModelsDevReasoningOption } from './reasoning-effort.js'; import type { ModelCapabilityFactsSource } from './capabilities.js'; export interface CatalogProvider { id: string; name: string; envVars: string[]; baseUrl: string; requiresKey?: boolean | undefined; } /** Catalog rates, USD per 1M tokens. Cache rates present only when the feed carried them. */ export interface CatalogModelPricing { input: number; output: number; cacheRead?: number | undefined; cacheWrite?: number | undefined; } export interface CatalogModel { id: string; name: string; family?: string | undefined; provider: string; providerId: string; providerEnvVars: string[]; /** Null when the catalog carried no cost for this model, honestly unpriced, never $0. */ pricing: CatalogModelPricing | null; tier: 'free' | 'paid' | 'subscription'; contextWindow?: number | undefined; maxOutputTokens?: number | undefined; reasoning?: boolean | undefined; /** * The feed's per-model `reasoning_options`, carried verbatim. Absent means * the catalog said nothing (fall through to the curated family table); an * empty array means the catalog said this model has no configurable levels. */ reasoningOptions?: ModelsDevReasoningOption[] | undefined; /** * The feed's per-model `modalities.input` list, carried verbatim, e.g. * `['text', 'image', 'pdf']`. This is the catalog's own answer to "does this * model accept images", which is what `multimodal` should be read from. * Absent means the entry carried no modality block at all. */ inputModalities?: readonly string[] | undefined; } export interface PricingCatalog { fetchedAt: number; models: CatalogModel[]; } /** * Legacy string-keyed catalog price lookup. Returns null when the model is * absent from the catalog or its entry carries no cost, absent must never * look free. Prefer ProviderRegistry.resolveModelPricing (model-pricing.ts), * which resolves per (provider, model) with manual/provider/catalog * precedence and an explicit source. */ export declare function getCostFromPricingCatalog(modelId: string, catalog: Pick, modelLimitsService?: Pick, opts?: { debug?: boolean; }): CatalogModelPricing | null; export declare function normalizeModelId(modelId: string): string; export declare function hasKeyForProvider(provider: CatalogProvider): boolean; export interface CatalogModelEntry { id: string; displayName: string; provider: string; context: number; tier: 'free' | 'paid' | 'subscription'; } export interface CatalogModelChange { model: CatalogModel; changes: string[]; } export interface CatalogDiff { added: CatalogModel[]; removed: CatalogModel[]; changed: CatalogModelChange[]; } export interface ModelCatalog { getModel(modelId: string): CatalogModelEntry | null; findLargerContextModels(minContext: number, tier?: 'free' | 'paid' | 'subscription', limit?: number): CatalogModelEntry[]; } type ModelCatalogRegistry = Pick; export declare class RegistryBackedCatalog implements ModelCatalog { private readonly registry; private entriesCache; private entriesCacheVersion; constructor(registry: ModelCatalogRegistry); private getEntries; getModel(modelId: string): CatalogModelEntry | null; findLargerContextModels(minContext: number, tier?: 'free' | 'paid' | 'subscription', limit?: number): CatalogModelEntry[]; } export declare function createModelCatalog(registry: ModelCatalogRegistry): ModelCatalog; export declare function getCatalogModelDefinitionsFrom(models: readonly CatalogModel[]): MinimalModelDefinition[]; /** * Build a `ModelCapabilityFactsSource` over the catalog, so the capability * registry reads each model's real context window, output cap and reasoning * support instead of a hand-maintained per-model table. * * Lookup prefers the `providerId:modelId` pair, because the same model id is * served by several providers at different limits (an OpenRouter mirror and * the first-party endpoint do not always agree). A bare-id match is the * fallback for callers that only have the id. * * A field the catalog does not carry is left undefined rather than defaulted, * so the registry falls through to its static tables instead of recording a * zero as though the provider had reported one. */ export declare function modelCapabilityFactsFromCatalog(models: readonly CatalogModel[]): ModelCapabilityFactsSource; export type { MinimalModelDefinition, SyntheticModelInfo } from './model-catalog-synthetic.js'; export { fetchCatalog, getCatalogCachePath, getCatalogTmpPath, isCatalogCacheStale, loadCatalogCache, saveCatalogCache, } from './model-catalog-cache.js'; export { buildSyntheticCanonicalModels, getSyntheticBackendModelIds, getSyntheticModelDefinitions, getSyntheticModelInfo, nameToSlug, normalizeModelName, } from './model-catalog-synthetic.js'; export { diffCatalogs, filterRelevantChanges, formatChangeNotifications, notifyCatalogChanges, } from './model-catalog-notifications.js'; //# sourceMappingURL=model-catalog.d.ts.map