import { LLMProviderInterface, ProviderFactoryConfig, ModelCapabilities, ToolDefinition, ToolArgs, ToolTenvs, ProviderModelInfo, ProviderRequest, ProviderResponse, ProviderStreamChunk, InspectedRequest, ProviderFactoryWithOptions } from '@standardagents/spec'; import { z } from 'zod'; export { extractUsageBuckets } from './pricing.js'; export { AnthropicModelPricing, AnthropicUsageBuckets, calculateAnthropicUsageCost, getAnthropicModelPricing } from '@standardagents/provider-pricing'; import '@anthropic-ai/sdk'; /** * Anthropic provider options schema. * * Defines typed providerOptions for Anthropic (Claude) models, providing * TypeScript autocompletion and runtime validation. * * @see https://platform.claude.com/docs/en/api/messages * @module */ /** * Anthropic provider options schema. * * These options are passed directly to the Anthropic Messages API and control * various aspects of request handling and generation. * * @example * ```typescript * providerOptions: { * service_tier: 'auto', * metadata: { user_id: 'user-123' }, * cacheSystemPrompt: true, * } * ``` */ declare const anthropicProviderOptions: z.ZodObject<{ service_tier: z.ZodOptional>; metadata: z.ZodOptional; }, z.core.$strip>>; cacheSystemPrompt: z.ZodOptional; thinking: z.ZodOptional>; }, z.core.$loose>; /** * TypeScript type for Anthropic provider options. * Inferred from the Zod schema for type-safe usage. */ type AnthropicProviderOptions = z.infer; /** * Anthropic provider implementation for Standard Agents * * Uses the Messages API for all requests via the official @anthropic-ai/sdk. * Supports the full Claude family: claude-fable-5, claude-opus-4-x, * claude-sonnet-4-x, claude-haiku-4-5, claude-3-x, etc. */ declare class AnthropicProvider implements LLMProviderInterface { readonly name = "anthropic"; readonly specificationVersion: "1"; private client; private config; /** Cache for models list to avoid repeated API calls */ private static modelsCache; private static modelsCacheTime; private static readonly CACHE_TTL; constructor(config: ProviderFactoryConfig); private getClient; supportsModel(modelId: string): boolean; /** * Get the icon for this provider as a data URI. * Always returns the Anthropic icon since all models are from Anthropic. */ getIcon(_modelId?: string): string; /** * Capability mappings for Anthropic models, keyed by model ID prefix. * Used as a fallback when the live Models API is unavailable; the API's * capability listing takes precedence when reachable. */ private static readonly MODEL_CAPABILITIES; /** * Look up static capabilities for a model by exact then prefix match. */ private static lookupStaticCapabilities; /** * Map a live Models API capability listing to Standard Agents capabilities. */ private static mapLiveCapabilities; /** * Get capabilities for a specific model. * Prefers the live Models API (which reports per-model capability flags) * and falls back to the static prefix table when the API is unreachable. */ getModelCapabilities(modelId: string): Promise; /** * Provider-embedded tools using defineTool(). * These are Anthropic's server-side tools that execute on Anthropic's * servers. The execute function is a no-op since execution is handled by * the provider; results surface as providerTools entries on the response. */ private static readonly TOOLS; /** * Get tools embedded in this provider. * Anthropic's web_search server tool is available on all current models. * * @param modelId - Optional filter to get tools available for a specific model * @returns Record of tool name to tool definition */ getTools(_modelId?: string): Record>; /** * Fetch models from the Anthropic Models API with caching. */ private fetchModelsWithCache; /** * Map Anthropic model info to ProviderModelInfo. */ private mapToProviderModelInfo; /** * Get list of available models from Anthropic. * Fetches from the Models API with caching. * * @param filter - Optional search string to filter models by name/id */ getModels(filter?: string): Promise; /** * Resolve the default max_tokens for a model from the static capability * table, clamped so non-streaming requests stay under HTTP timeouts. */ private defaultMaxTokensFor; generate(request: ProviderRequest): Promise; stream(request: ProviderRequest): Promise>; private toProviderError; /** * Transform a ProviderRequest to Anthropic Messages API format for inspection. * Returns the exact request body that would be sent, with base64 data truncated. */ inspectRequest(request: ProviderRequest): Promise; } /** * Anthropic (Claude) provider factory for Standard Agents * * Includes typed providerOptions for Anthropic-specific configuration. * * @example * ```typescript * import { defineModel } from '@standardagents/builder'; * import { anthropic } from '@standardagents/anthropic'; * * export default defineModel({ * name: 'claude-opus', * provider: anthropic, * model: 'claude-opus-4-8', * inputPrice: 5, * outputPrice: 25, * capabilities: { * supportsImages: true, * supportsToolCalls: true, * supportsJsonMode: true, * maxContextTokens: 1000000, * }, * providerOptions: { * cacheSystemPrompt: true, * }, * }); * ``` */ declare const anthropic: ProviderFactoryWithOptions; export { AnthropicProvider, type AnthropicProviderOptions, anthropic, anthropicProviderOptions };