/** * Model discovery for Anthropic-family models and DigitalOcean. * * Three backends, dispatched by provider: * * - github-copilot: GET {baseUrl}/models — OpenAI-style listing with rich * `capabilities.supports` (adaptive_thinking, reasoning_effort, limits. * max_context_window_tokens). The 1M context tier on Copilot is exposed * as separate model ids (for example claude-opus-4.6-1m) rather than * via a beta header; the bare id (claude-opus-4.6) is hard-capped at * 200k regardless of any beta header (which the relay rejects). * Discovery surfaces every id the response returns so the user can * select the right one in the picker. * * - anthropic: GET {baseUrl}/v1/models — Anthropic-native with * `capabilities.thinking.types.adaptive.supported`, * `capabilities.effort.{max,xhigh}.supported`, `max_input_tokens`. * The 1M context tier is gated by `anthropic-beta: context-1m-2025-08-07` * on the same id; we detect it by making a second probe with that * header and observing whether `max_input_tokens` rises. * * - digitalocean: GET {baseUrl}/models — OpenAI-style listing scoped to a * model access key. It adds listed model ids with conservative metadata. * * - others (amazon-bedrock, google-vertex, etc.): no equivalent discovery * endpoint; the static fallback table in anthropic-capabilities.ts is used. * * Anthropic-family discovery runs at most once per (provider, baseUrl, * apiKey-hash) per process. DigitalOcean runs on every call so switching * access keys replaces the account-scoped catalog. Failures are silent — we * leave the static fallback in place. The discovery layer never throws back * to the caller. * * The discovered registry entries (new model ids, corrected contextWindow) * are also pushed into the in-memory model registry via * `mergeDiscoveredModels` so the model picker reflects reality. */ import type { Api, Model } from "../types.js"; /** * Trigger discovery for a provider+baseUrl+credential. Returns a Promise that * resolves once the capability cache has been populated (or the attempt has * failed). Subsequent calls with the same scope join the in-flight promise. * * Never throws. On any error the static fallback remains in place. */ export declare function discoverAnthropicCapabilities(provider: string, baseUrl: string, apiKey: string, extraHeaders?: Record): Promise; export declare function discoverDigitalOceanModels(baseUrl: string, apiKey: string, extraHeaders?: Record): Promise; /** Test-only: clear discovery memo so tests can re-run. */ export declare function _clearDiscoveryStateForTests(): void; /** Not for external use: called by models.ts at module load to wire the registry hook. */ export declare function _setRegistryHook(hook: (provider: string, model: Model) => void): void; /** Not for external use: called by models.ts at module load to wire the registry replacement hook. */ export declare function _setRegistryReplaceHook(hook: (provider: string, models: Model[]) => void): void; //# sourceMappingURL=anthropic-discovery.d.ts.map