import type { Capabilities, ProviderError, Request } from '@wrongstack/core/types'; import { type HeadersLike } from './error-parse.js'; import type { AnthropicStreamState } from './presets/anthropic.js'; import type { WireAdapterStreamOptions } from './wire-adapter.js'; import { WireFormatProvider } from './wire-format.js'; export interface AnthropicProviderOptions { apiKey: string; baseUrl?: string | undefined; apiVersion?: string | undefined; beta?: string[] | undefined; fetchImpl?: typeof fetch | undefined; /** * Override the provider id surfaced on the `Provider` instance. Defaults to * the wire-format `cfg.id` (`'anthropic'`) when omitted so direct * `new AnthropicProvider({...})` callers — tests, plugins — keep their * expected `id === 'anthropic'` without having to opt in. * * Set this when a user-visible config provider (e.g. `minimax-token-plan` * with `family: 'anthropic'`) needs to keep its chosen id through the * Anthropic wire family. Without it, every Anthropic-compatible proxy * shows up in the status bar / provider pickers as plain `anthropic`. */ id?: string | undefined; /** Raw stream debugging and hang-detection options. */ streamOpts?: WireAdapterStreamOptions | undefined; /** * Maximum number of tool definitions the provider accepts per request. * When set, lower-priority tools are filtered out centrally by * `WireAdapter.stream()` before the request body is built. */ maxTools?: number | undefined; } export declare class AnthropicProvider extends WireFormatProvider { readonly id: string; readonly capabilities: Capabilities; private readonly opts; constructor(opts: AnthropicProviderOptions); /** * Override buildHeaders to support proxy auth detection and custom beta headers. * * Third-party Anthropic-compatible proxies (kimi-for-coding, zai-coding-plan, * anyrouter, …) reject `x-api-key` and require `Authorization: Bearer`. * The preset always sends `x-api-key`; this override checks the base URL and * switches to Bearer auth when targeting a non-Anthropic host. */ protected buildHeaders(_req: Request): Record; protected translateError(status: number, text: string, headers?: HeadersLike): ProviderError; } //# sourceMappingURL=anthropic.d.ts.map