/** * The one native model-catalog read. * * Two surfaces ask the same question of `ctx.llm` — which exact routes exist * right now — and then project the answer differently: `/model` shows the * current Agent's choices, and the subagent authorization editor shows * candidates for a Host setting. Neither projection is allowed to become a * second source of truth, so the read itself lives here once. * * Route catalogs are independent, so every provider read begins before any is * awaited. `Promise.all` over the mapped array keeps `listProviders()` order no * matter which adapter settles first, and a provider whose listing fails is * recorded rather than silently dropped: an unreachable route must not hide the * ones that work. A failure here is ADVISORY — it says what the live catalog * could not answer, and never authorizes or deauthorizes anything. The Host * setting is the only authorization authority. * @module dshline/model-catalog */ import type { Context } from '@deepseek-ai/cordis'; /** One route a mounted adapter currently advertises. */ export interface ModelCatalogRoute { /** Provider ROUTE key, the value `listModels` and `GenerateOptions.provider` take. */ readonly provider: string; /** Provider display name, for a label a person reads. */ readonly providerName: string; /** Provider-owned model id. */ readonly model: string; /** Provider-owned display name, which may equal the id. */ readonly modelName: string; } /** What one catalog read found, and which provider routes it could not reach. */ export interface ModelCatalogReading { /** Every advertised route, in `listProviders()` order. */ readonly routes: ModelCatalogRoute[]; /** Route keys whose listing failed, in `listProviders()` order. */ readonly failedProviders: string[]; } /** * Stable identity for one exact `provider/model` route. * * The NUL separator cannot appear in a provider or model id, so two different * routes never collide. The result is OPAQUE: it is a Map/Set key and is never * parsed back into a route — the route object is always kept beside it. * @param provider - provider route key. * @param model - provider-owned model id. * @returns the opaque identity key. */ export declare function modelRouteKey(provider: string, model: string): string; /** * Every model the mounted adapters currently advertise. * * `listProviders()` returns `{ id, name }` where **`id`** is the route key * `listModels` takes, and `name` is a label for humans. Every read begins * before any is awaited, and a failed route is recorded in * {@link ModelCatalogReading.failedProviders} rather than rejecting the whole * catalog. * @param ctx - context carrying the llm registry. * @returns the advertised routes in provider order, and the routes that failed. */ export declare function readModelCatalog(ctx: Context): Promise; //# sourceMappingURL=model-catalog.d.ts.map