import type { LLMProvider, ChatRequest, ChatResponse, ProviderBatchAdapter, ProviderModelSource, ProviderRuntimeMetadata, ProviderRuntimeMetadataDeps } from './interface.js'; import { type LiveModelDiscoveryResult } from './live-model-discovery.js'; import type { CacheHitTracker, CachePolicyReader } from './cache-strategy.js'; /** * Dated fallback model list, used when no API key is configured (so a live * /v1/models call isn't possible) and as the offline baseline when a live * call fails with no prior cache. Live-verified against a real Anthropic * API key's GET /v1/models response on 2026-07-12; update this list (and * the date below) whenever it is re-verified. */ export declare const ANTHROPIC_DATED_STATIC_MODELS: readonly string[]; export declare const ANTHROPIC_DATED_STATIC_MODELS_AS_OF = "2026-07-12"; /** * AnthropicProvider, calls the Anthropic Messages API directly via fetch. * System message is a top-level field (not a message). Tool results are * `tool_result` content blocks inside `user` messages. * Supports SSE streaming when onDelta is provided. */ export declare class AnthropicProvider implements LLMProvider { readonly name = "anthropic"; readonly credentialAuthority: "resolver"; readonly modelSource: ProviderModelSource; readonly batch: ProviderBatchAdapter; /** * Populated synchronously with the dated-static baseline at construction * (never empty), then replaced by `refreshModels()` with the live * /v1/models result. See `modelSource`. */ private _models; get models(): string[]; /** * Per-model max output tokens as the PROVIDER reports them, populated by * `refreshModels()` from GET /v1/models. * * Empty until a live refresh succeeds, which is why the offline table still * has to be correct, but once populated it is authoritative, so a model * released after this build shipped is capped at its real limit instead of * whatever the table happens to guess. */ private readonly _liveMaxOutput; private readonly apiKey; private readonly cacheHitTracker; private readonly modelsCachePath; /** * Where `cache.enabled` and `cache.stableTtl` are read from, per request. * * Read at request time rather than captured at construction, for the reason * `cache.monitorHitRate` and `cache.hitRateWarningThreshold` are: a config * change applies to the next turn, not the next restart. Absent when an * embedder constructs this provider with nothing but a key, which leaves the * shipped defaults in force. */ private readonly cachePolicy; constructor(apiKey: string, cacheHitTracker?: Pick, modelsCachePath?: string, cachePolicy?: CachePolicyReader); chat(params: ChatRequest): Promise; describeRuntime(deps: ProviderRuntimeMetadataDeps): Promise; isConfigured(): boolean; /** * Re-check Anthropic's live model list. Called at boot (background, * respects the on-disk TTL cache) and on-demand for a picker-open * re-check or an explicit user refresh (`force: true`, bypasses the TTL * cache). Always resolves, falls back to the on-disk cache, then to the * dated-static list, and reports the honest reason when live discovery * fails rather than silently keeping stale data with no explanation. */ refreshModels(force?: boolean): Promise; /** * Clamp a requested max_tokens to what this model actually allows. * * Live limit first (what the provider says), offline table second. A model * the live call did not cover, because there is no API key, or because the * call failed, still gets a real cap rather than the generic default, * provided the table has an arm for it. */ private clampMaxTokens; private createChatBatch; private retrieveBatch; private cancelBatch; private getBatchResults; private batchHeaders; private toAnthropicBatchMessageParams; private mapAnthropicBatchStatus; private readJsonResponse; private parseAnthropicBatchResult; private anthropicBatchMessageToChatResponse; } //# sourceMappingURL=anthropic.d.ts.map