/** * Model-capability discovery for Anthropic-family models. * * Two 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. * * - others (amazon-bedrock, google-vertex, etc.): no equivalent * discovery endpoint; the static fallback table in * anthropic-capabilities.ts is used. * * Discovery runs at most once per (provider, baseUrl, apiKey-hash) per * process. Concurrent calls join the same in-flight promise. Failures are * silent — we leave the static fallback in place and try again next * process. 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. Returns a Promise that resolves * once the capability cache has been populated (or the attempt has failed). * Subsequent calls with the same (provider, baseUrl) 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; /** 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; //# sourceMappingURL=anthropic-discovery.d.ts.map