/** * One gateway, several wire protocols. * * `llm-pi-ai` puts `api` on the *provider* entry, not on a model entry, so a * gateway whose catalogue spans protocols (Command Code: 55 of 71 models answer * `/responses`, 8 only `/chat/completions`, the Claude family only `/messages`) * cannot be one entry. The wizard therefore keeps one row per gateway and * expands it into sibling entries — `command-code`, `command-code-responses`, * `command-code-messages` — with each model filed under the protocol it * actually speaks. Everything here is pure so the split can be tested without * a settings file or a network. */ export type GatewayProtocol = 'openai-responses' | 'openai-completions' | 'anthropic-messages'; /** Preference order for a model a gateway lists on more than one route. */ export declare const GATEWAY_PROTOCOL_PREFERENCE: readonly GatewayProtocol[]; /** Id suffix per protocol; the base entry keeps the plain gateway id. */ export declare const GATEWAY_PROTOCOL_SUFFIX: Record; /** The endpoint path each protocol speaks, for messages and hints. */ export declare const GATEWAY_PROTOCOL_ENDPOINT: Record; /** The endpoint strings gateways publish; `null` for anything unrecognised. */ export declare function endpointProtocol(endpoint: string): GatewayProtocol | null; /** `command-code` + `openai-responses` → `command-code-responses`. */ export declare function siblingProviderId(baseId: string, protocol: GatewayProtocol): string; /** The protocol a sibling id carries, or null when it is not one of ours. */ export declare function siblingProtocolOf(id: string): GatewayProtocol | null; /** True when `id` is a sibling of `baseId` (and not the base itself). */ export declare function isSiblingOf(baseId: string, id: string): boolean; /** The gateway id a sibling row belongs to; a base id comes back unchanged. */ export declare function baseProviderIdOf(id: string): string; /** The protocol a provider entry's `api` names, when it is one of the three we model. */ export declare function declaredProtocol(value: unknown): GatewayProtocol | undefined; /** * Whether an entry that speaks `protocol` may serve `model`, according to the * gateway's own `supported_endpoints`. A gateway that publishes nothing about * the model — or no protocol to check against — never blocks it: silence is not * a refusal, only an explicit list that omits the protocol is. */ export declare function gatewayServesModel(endpoints: ReadonlyMap | undefined, model: string, protocol: GatewayProtocol | undefined): boolean; /** * The protocols a gateway lists for `model`, in preference order. Empty when the * gateway says nothing, which callers read as "no opinion". */ export declare function advertisedProtocols(endpoints: ReadonlyMap | undefined, model: string): GatewayProtocol[]; /** * The protocol one model should be filed under. The gateway's own * `supported_endpoints` decide when it publishes them; a model already * configured on a route the gateway still lists keeps that route, and a model * the gateway does not describe keeps the route it is already on rather than * being relocated by a hand-maintained table. Otherwise the earliest entry in * `preference` wins, then the table, then the gateway's own primary protocol. */ export declare function resolveModelProtocol(input: { advertised?: readonly string[]; /** The provider protocol this model is already configured on, if any. */ existing?: GatewayProtocol; table?: GatewayProtocol; fallback: GatewayProtocol; preference?: readonly GatewayProtocol[]; }): GatewayProtocol; /** * Every model of one gateway, filed by protocol. `existing` carries the * protocol each model is already configured on, so re-running setup keeps a * working placement instead of re-homing it. Models the gateway does not * describe, that are not configured yet, and that the table does not know land * on `fallback`, which is the gateway's own pinned protocol — the one its * default models were verified on. */ export declare function splitModelsByProtocol(input: { models: readonly string[]; advertised?: ReadonlyMap; existing?: ReadonlyMap; table?: Readonly>; fallback: GatewayProtocol; preference?: readonly GatewayProtocol[]; }): Map; /** * OpenCode Go's published endpoint table (https://opencode.ai/docs/go/), because * `GET /zen/go/v1/models` carries no `supported_endpoints` field at all. * * The whole DeepSeek family answers `/responses` (verified against the live * gateway, and what this plugin's pinned template has shipped since 0.7.0) even * though the page still lists those models under chat. A route that works is not * downgraded because a document lags. Zen's own (non-Go) route publishes no * table here — unknown models there take the gateway's primary protocol. */ export declare const ZEN_GO_MODEL_PROTOCOLS: Readonly>; /** The built-in table for a gateway base URL, when we have one. */ export declare function gatewayModelTable(baseURL: string): Readonly> | undefined;