{"version":3,"sources":["../src/anthropic-provider.ts","../src/version.ts","../src/anthropic-messages-language-model.ts","../src/anthropic-error.ts","../src/anthropic-messages-api.ts","../src/anthropic-messages-options.ts","../src/anthropic-prepare-tools.ts","../src/get-cache-control.ts","../src/tool/advisor_20260301.ts","../src/tool/text-editor_20250728.ts","../src/tool/web-search_20260209.ts","../src/tool/web-search_20250305.ts","../src/tool/web-fetch-20260209.ts","../src/tool/web-fetch-20250910.ts","../src/convert-anthropic-messages-usage.ts","../src/convert-to-anthropic-messages-prompt.ts","../src/tool/code-execution_20250522.ts","../src/tool/code-execution_20250825.ts","../src/tool/code-execution_20260120.ts","../src/tool/tool-search-regex_20251119.ts","../src/map-anthropic-stop-reason.ts","../src/sanitize-json-schema.ts","../src/tool/bash_20241022.ts","../src/tool/bash_20250124.ts","../src/tool/computer_20241022.ts","../src/tool/computer_20250124.ts","../src/tool/computer_20251124.ts","../src/tool/memory_20250818.ts","../src/tool/text-editor_20241022.ts","../src/tool/text-editor_20250124.ts","../src/tool/text-editor_20250429.ts","../src/tool/tool-search-bm25_20251119.ts","../src/anthropic-tools.ts","../src/forward-anthropic-container-id-from-last-step.ts"],"sourcesContent":["import {\n  InvalidArgumentError,\n  NoSuchModelError,\n  type LanguageModelV3,\n  type ProviderV3,\n} from '@ai-sdk/provider';\nimport {\n  generateId,\n  loadApiKey,\n  loadOptionalSetting,\n  withoutTrailingSlash,\n  withUserAgentSuffix,\n  type FetchFunction,\n} from '@ai-sdk/provider-utils';\nimport { VERSION } from './version';\nimport { AnthropicMessagesLanguageModel } from './anthropic-messages-language-model';\nimport type { AnthropicMessagesModelId } from './anthropic-messages-options';\nimport { anthropicTools } from './anthropic-tools';\n\nexport interface AnthropicProvider extends ProviderV3 {\n  /**\n   * Creates a model for text generation.\n   */\n  (modelId: AnthropicMessagesModelId): LanguageModelV3;\n\n  /**\n   * Creates a model for text generation.\n   */\n  languageModel(modelId: AnthropicMessagesModelId): LanguageModelV3;\n\n  chat(modelId: AnthropicMessagesModelId): LanguageModelV3;\n\n  messages(modelId: AnthropicMessagesModelId): LanguageModelV3;\n\n  /**\n   * @deprecated Use `embeddingModel` instead.\n   */\n  textEmbeddingModel(modelId: string): never;\n\n  /**\n   * Anthropic-specific computer use tool.\n   */\n  tools: typeof anthropicTools;\n}\n\nexport interface AnthropicProviderSettings {\n  /**\n   * Use a different URL prefix for API calls, e.g. to use proxy servers.\n   * The default prefix is `https://api.anthropic.com/v1`.\n   */\n  baseURL?: string;\n\n  /**\n   * API key that is being send using the `x-api-key` header.\n   * It defaults to the `ANTHROPIC_API_KEY` environment variable.\n   * Only one of `apiKey` or `authToken` is required.\n   */\n  apiKey?: string;\n\n  /**\n   * Auth token that is being sent using the `Authorization: Bearer` header.\n   * It defaults to the `ANTHROPIC_AUTH_TOKEN` environment variable.\n   * Only one of `apiKey` or `authToken` is required.\n   */\n  authToken?: string;\n\n  /**\n   * Custom headers to include in the requests.\n   */\n  headers?: Record<string, string>;\n\n  /**\n   * Custom fetch implementation. You can use it as a middleware to intercept requests,\n   * or to provide a custom fetch implementation for e.g. testing.\n   */\n  fetch?: FetchFunction;\n\n  generateId?: () => string;\n\n  /**\n   * Custom provider name\n   * Defaults to 'anthropic.messages'.\n   */\n  name?: string;\n}\n\n/**\n * Create an Anthropic provider instance.\n */\nexport function createAnthropic(\n  options: AnthropicProviderSettings = {},\n): AnthropicProvider {\n  const baseURL =\n    withoutTrailingSlash(\n      loadOptionalSetting({\n        settingValue: options.baseURL,\n        environmentVariableName: 'ANTHROPIC_BASE_URL',\n      }),\n    ) ?? 'https://api.anthropic.com/v1';\n\n  const providerName = options.name ?? 'anthropic.messages';\n\n  // Only error if both are explicitly provided in options\n  if (options.apiKey && options.authToken) {\n    throw new InvalidArgumentError({\n      argument: 'apiKey/authToken',\n      message:\n        'Both apiKey and authToken were provided. Please use only one authentication method.',\n    });\n  }\n\n  const getHeaders = () => {\n    const authHeaders: Record<string, string> = options.authToken\n      ? { Authorization: `Bearer ${options.authToken}` }\n      : {\n          'x-api-key': loadApiKey({\n            apiKey: options.apiKey,\n            environmentVariableName: 'ANTHROPIC_API_KEY',\n            description: 'Anthropic',\n          }),\n        };\n\n    return withUserAgentSuffix(\n      {\n        'anthropic-version': '2023-06-01',\n        ...authHeaders,\n        ...options.headers,\n      },\n      `ai-sdk/anthropic/${VERSION}`,\n    );\n  };\n\n  const createChatModel = (modelId: AnthropicMessagesModelId) =>\n    new AnthropicMessagesLanguageModel(modelId, {\n      provider: providerName,\n      baseURL,\n      headers: getHeaders,\n      fetch: options.fetch,\n      generateId: options.generateId ?? generateId,\n      supportedUrls: () => ({\n        'image/*': [/^https?:\\/\\/.*$/],\n        'application/pdf': [/^https?:\\/\\/.*$/],\n      }),\n    });\n\n  const provider = function (modelId: AnthropicMessagesModelId) {\n    if (new.target) {\n      throw new Error(\n        'The Anthropic model function cannot be called with the new keyword.',\n      );\n    }\n\n    return createChatModel(modelId);\n  };\n\n  provider.specificationVersion = 'v3' as const;\n  provider.languageModel = createChatModel;\n  provider.chat = createChatModel;\n  provider.messages = createChatModel;\n\n  provider.embeddingModel = (modelId: string) => {\n    throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });\n  };\n  provider.textEmbeddingModel = provider.embeddingModel;\n  provider.imageModel = (modelId: string) => {\n    throw new NoSuchModelError({ modelId, modelType: 'imageModel' });\n  };\n\n  provider.tools = anthropicTools;\n\n  return provider;\n}\n\n/**\n * Default Anthropic provider instance.\n */\nexport const anthropic = createAnthropic();\n","// Version string of this package injected at build time.\ndeclare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n  typeof __PACKAGE_VERSION__ !== 'undefined'\n    ? __PACKAGE_VERSION__\n    : '0.0.0-test';\n","import {\n  APICallError,\n  type JSONObject,\n  type LanguageModelV3,\n  type LanguageModelV3CallOptions,\n  type LanguageModelV3Content,\n  type LanguageModelV3FinishReason,\n  type LanguageModelV3FunctionTool,\n  type LanguageModelV3GenerateResult,\n  type LanguageModelV3Prompt,\n  type LanguageModelV3Source,\n  type LanguageModelV3StreamPart,\n  type LanguageModelV3StreamResult,\n  type LanguageModelV3ToolCall,\n  type SharedV3ProviderMetadata,\n  type SharedV3Warning,\n} from '@ai-sdk/provider';\nimport {\n  combineHeaders,\n  createEventSourceResponseHandler,\n  createJsonResponseHandler,\n  createToolNameMapping,\n  generateId,\n  parseProviderOptions,\n  postJsonToApi,\n  resolve,\n  type FetchFunction,\n  type InferSchema,\n  type ParseResult,\n  type Resolvable,\n} from '@ai-sdk/provider-utils';\nimport { anthropicFailedResponseHandler } from './anthropic-error';\nimport type {\n  AnthropicMessageMetadata,\n  AnthropicUsageIteration,\n} from './anthropic-message-metadata';\nimport {\n  anthropicMessagesChunkSchema,\n  anthropicMessagesResponseSchema,\n  type AnthropicContainer,\n  type AnthropicReasoningMetadata,\n  type AnthropicResponseContextManagement,\n  type AnthropicTool,\n  type Citation,\n} from './anthropic-messages-api';\nimport {\n  anthropicLanguageModelOptions,\n  type AnthropicMessagesModelId,\n} from './anthropic-messages-options';\nimport { prepareTools } from './anthropic-prepare-tools';\nimport {\n  convertAnthropicMessagesUsage,\n  type AnthropicMessagesUsage,\n} from './convert-anthropic-messages-usage';\nimport { convertToAnthropicMessagesPrompt } from './convert-to-anthropic-messages-prompt';\nimport { CacheControlValidator } from './get-cache-control';\nimport { mapAnthropicStopReason } from './map-anthropic-stop-reason';\nimport { sanitizeJsonSchema } from './sanitize-json-schema';\n\nfunction createCitationSource(\n  citation: Citation,\n  citationDocuments: Array<{\n    title: string;\n    filename?: string;\n    mediaType: string;\n  }>,\n  generateId: () => string,\n): LanguageModelV3Source | undefined {\n  if (citation.type === 'web_search_result_location') {\n    return {\n      type: 'source' as const,\n      sourceType: 'url' as const,\n      id: generateId(),\n      url: citation.url,\n      title: citation.title,\n      providerMetadata: {\n        anthropic: {\n          citedText: citation.cited_text,\n          encryptedIndex: citation.encrypted_index,\n        },\n      } satisfies SharedV3ProviderMetadata,\n    };\n  }\n\n  if (citation.type !== 'page_location' && citation.type !== 'char_location') {\n    return;\n  }\n\n  const documentInfo = citationDocuments[citation.document_index];\n\n  if (!documentInfo) {\n    return;\n  }\n\n  return {\n    type: 'source' as const,\n    sourceType: 'document' as const,\n    id: generateId(),\n    mediaType: documentInfo.mediaType,\n    title: citation.document_title ?? documentInfo.title,\n    filename: documentInfo.filename,\n    providerMetadata: {\n      anthropic:\n        citation.type === 'page_location'\n          ? {\n              citedText: citation.cited_text,\n              startPageNumber: citation.start_page_number,\n              endPageNumber: citation.end_page_number,\n            }\n          : {\n              citedText: citation.cited_text,\n              startCharIndex: citation.start_char_index,\n              endCharIndex: citation.end_char_index,\n            },\n    } satisfies SharedV3ProviderMetadata,\n  };\n}\n\ntype AnthropicMessagesConfig = {\n  provider: string;\n  baseURL: string;\n  headers: Resolvable<Record<string, string | undefined>>;\n  fetch?: FetchFunction;\n  buildRequestUrl?: (baseURL: string, isStreaming: boolean) => string;\n  transformRequestBody?: (\n    args: Record<string, any>,\n    betas: Set<string>,\n  ) => Record<string, any>;\n  supportedUrls?: () => LanguageModelV3['supportedUrls'];\n  generateId?: () => string;\n\n  /**\n   * When false, the model will use JSON tool fallback for structured outputs.\n   */\n  supportsNativeStructuredOutput?: boolean;\n\n  /**\n   * When false, `strict` on tool definitions will be ignored and a warning emitted.\n   * Defaults to true.\n   */\n  supportsStrictTools?: boolean;\n};\n\nexport class AnthropicMessagesLanguageModel implements LanguageModelV3 {\n  readonly specificationVersion = 'v3';\n\n  readonly modelId: AnthropicMessagesModelId;\n\n  private readonly config: AnthropicMessagesConfig;\n  private readonly generateId: () => string;\n\n  constructor(\n    modelId: AnthropicMessagesModelId,\n    config: AnthropicMessagesConfig,\n  ) {\n    this.modelId = modelId;\n    this.config = config;\n    this.generateId = config.generateId ?? generateId;\n  }\n\n  supportsUrl(url: URL): boolean {\n    return url.protocol === 'https:';\n  }\n\n  get provider(): string {\n    return this.config.provider;\n  }\n\n  /**\n   * Extracts the dynamic provider name from the config.provider string.\n   * e.g., 'my-custom-anthropic.messages' -> 'my-custom-anthropic'\n   */\n  private get providerOptionsName(): string {\n    const provider = this.config.provider;\n    const dotIndex = provider.indexOf('.');\n    return dotIndex === -1 ? provider : provider.substring(0, dotIndex);\n  }\n\n  get supportedUrls() {\n    return this.config.supportedUrls?.() ?? {};\n  }\n\n  private async getArgs({\n    userSuppliedBetas,\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    stopSequences,\n    responseFormat,\n    seed,\n    tools,\n    toolChoice,\n    providerOptions,\n    stream,\n  }: LanguageModelV3CallOptions & {\n    stream: boolean;\n    userSuppliedBetas: Set<string>;\n  }) {\n    const warnings: SharedV3Warning[] = [];\n\n    if (frequencyPenalty != null) {\n      warnings.push({ type: 'unsupported', feature: 'frequencyPenalty' });\n    }\n\n    if (presencePenalty != null) {\n      warnings.push({ type: 'unsupported', feature: 'presencePenalty' });\n    }\n\n    if (seed != null) {\n      warnings.push({ type: 'unsupported', feature: 'seed' });\n    }\n\n    if (temperature != null && temperature > 1) {\n      warnings.push({\n        type: 'unsupported',\n        feature: 'temperature',\n        details: `${temperature} exceeds anthropic maximum of 1.0. clamped to 1.0`,\n      });\n      temperature = 1;\n    } else if (temperature != null && temperature < 0) {\n      warnings.push({\n        type: 'unsupported',\n        feature: 'temperature',\n        details: `${temperature} is below anthropic minimum of 0. clamped to 0`,\n      });\n      temperature = 0;\n    }\n\n    if (responseFormat?.type === 'json') {\n      if (responseFormat.schema == null) {\n        warnings.push({\n          type: 'unsupported',\n          feature: 'responseFormat',\n          details:\n            'JSON response format requires a schema. ' +\n            'The response format is ignored.',\n        });\n      }\n    }\n\n    const providerOptionsName = this.providerOptionsName;\n\n    // Parse provider options from both canonical 'anthropic' key and custom key\n    const canonicalOptions = await parseProviderOptions({\n      provider: 'anthropic',\n      providerOptions,\n      schema: anthropicLanguageModelOptions,\n    });\n\n    const customProviderOptions =\n      providerOptionsName !== 'anthropic'\n        ? await parseProviderOptions({\n            provider: providerOptionsName,\n            providerOptions,\n            schema: anthropicLanguageModelOptions,\n          })\n        : null;\n\n    // Track if custom key was explicitly used\n    const usedCustomProviderKey = customProviderOptions != null;\n\n    // Merge options\n    const anthropicOptions = Object.assign(\n      {},\n      canonicalOptions ?? {},\n      customProviderOptions ?? {},\n    );\n\n    const {\n      maxOutputTokens: maxOutputTokensForModel,\n      supportsStructuredOutput: modelSupportsStructuredOutput,\n      rejectsSamplingParameters,\n      isKnownModel,\n    } = getModelCapabilities(this.modelId);\n\n    if (rejectsSamplingParameters) {\n      if (temperature != null) {\n        warnings.push({\n          type: 'unsupported',\n          feature: 'temperature',\n          details: `temperature is not supported by ${this.modelId} and will be ignored`,\n        });\n        temperature = undefined;\n      }\n      if (topK != null) {\n        warnings.push({\n          type: 'unsupported',\n          feature: 'topK',\n          details: `topK is not supported by ${this.modelId} and will be ignored`,\n        });\n        topK = undefined;\n      }\n      if (topP != null) {\n        warnings.push({\n          type: 'unsupported',\n          feature: 'topP',\n          details: `topP is not supported by ${this.modelId} and will be ignored`,\n        });\n        topP = undefined;\n      }\n    }\n\n    const isAnthropicModel = isKnownModel || this.modelId.startsWith('claude-');\n\n    const supportsStructuredOutput =\n      (this.config.supportsNativeStructuredOutput ?? true) &&\n      modelSupportsStructuredOutput;\n\n    const supportsStrictTools =\n      (this.config.supportsStrictTools ?? true) &&\n      modelSupportsStructuredOutput;\n\n    const structureOutputMode =\n      anthropicOptions?.structuredOutputMode ?? 'auto';\n    const useStructuredOutput =\n      structureOutputMode === 'outputFormat' ||\n      (structureOutputMode === 'auto' && supportsStructuredOutput);\n\n    const jsonResponseTool: LanguageModelV3FunctionTool | undefined =\n      responseFormat?.type === 'json' &&\n      responseFormat.schema != null &&\n      !useStructuredOutput\n        ? {\n            type: 'function',\n            name: 'json',\n            description: 'Respond with a JSON object.',\n            inputSchema: responseFormat.schema,\n          }\n        : undefined;\n\n    const contextManagement = anthropicOptions?.contextManagement;\n\n    // Create a shared cache control validator to track breakpoints across tools and messages\n    const cacheControlValidator = new CacheControlValidator();\n\n    const toolNameMapping = createToolNameMapping({\n      tools,\n      providerToolNames: {\n        'anthropic.code_execution_20250522': 'code_execution',\n        'anthropic.code_execution_20250825': 'code_execution',\n        'anthropic.code_execution_20260120': 'code_execution',\n        'anthropic.computer_20241022': 'computer',\n        'anthropic.computer_20250124': 'computer',\n        'anthropic.text_editor_20241022': 'str_replace_editor',\n        'anthropic.text_editor_20250124': 'str_replace_editor',\n        'anthropic.text_editor_20250429': 'str_replace_based_edit_tool',\n        'anthropic.text_editor_20250728': 'str_replace_based_edit_tool',\n        'anthropic.bash_20241022': 'bash',\n        'anthropic.bash_20250124': 'bash',\n        'anthropic.memory_20250818': 'memory',\n        'anthropic.web_search_20250305': 'web_search',\n        'anthropic.web_search_20260209': 'web_search',\n        'anthropic.web_fetch_20250910': 'web_fetch',\n        'anthropic.web_fetch_20260209': 'web_fetch',\n        'anthropic.tool_search_regex_20251119': 'tool_search_tool_regex',\n        'anthropic.tool_search_bm25_20251119': 'tool_search_tool_bm25',\n        'anthropic.advisor_20260301': 'advisor',\n      },\n    });\n\n    const { prompt: messagesPrompt, betas } =\n      await convertToAnthropicMessagesPrompt({\n        prompt,\n        sendReasoning: anthropicOptions?.sendReasoning ?? true,\n        warnings,\n        cacheControlValidator,\n        toolNameMapping,\n      });\n\n    const thinkingType = anthropicOptions?.thinking?.type;\n    const isThinking =\n      thinkingType === 'enabled' || thinkingType === 'adaptive';\n    let thinkingBudget =\n      thinkingType === 'enabled'\n        ? anthropicOptions?.thinking?.budgetTokens\n        : undefined;\n    const thinkingDisplay =\n      thinkingType === 'adaptive'\n        ? anthropicOptions?.thinking?.display\n        : undefined;\n\n    const maxTokens = maxOutputTokens ?? maxOutputTokensForModel;\n\n    const baseArgs = {\n      // model id:\n      model: this.modelId,\n\n      // standardized settings:\n      max_tokens: maxTokens,\n      temperature,\n      top_k: topK,\n      top_p: topP,\n      stop_sequences: stopSequences,\n\n      // provider specific settings:\n      ...(isThinking && {\n        thinking: {\n          type: thinkingType,\n          ...(thinkingBudget != null && { budget_tokens: thinkingBudget }),\n          ...(thinkingDisplay != null && { display: thinkingDisplay }),\n        },\n      }),\n      ...((anthropicOptions?.effort ||\n        anthropicOptions?.taskBudget ||\n        (useStructuredOutput &&\n          responseFormat?.type === 'json' &&\n          responseFormat.schema != null)) && {\n        output_config: {\n          ...(anthropicOptions?.effort && {\n            effort: anthropicOptions.effort,\n          }),\n          ...(anthropicOptions?.taskBudget && {\n            task_budget: {\n              type: anthropicOptions.taskBudget.type,\n              total: anthropicOptions.taskBudget.total,\n              ...(anthropicOptions.taskBudget.remaining != null && {\n                remaining: anthropicOptions.taskBudget.remaining,\n              }),\n            },\n          }),\n          ...(useStructuredOutput &&\n            responseFormat?.type === 'json' &&\n            responseFormat.schema != null && {\n              format: {\n                type: 'json_schema',\n                schema: sanitizeJsonSchema(responseFormat.schema),\n              },\n            }),\n        },\n      }),\n      ...(anthropicOptions?.speed && {\n        speed: anthropicOptions.speed,\n      }),\n      ...(anthropicOptions?.inferenceGeo && {\n        inference_geo: anthropicOptions.inferenceGeo,\n      }),\n      ...(anthropicOptions?.cacheControl && {\n        cache_control: anthropicOptions.cacheControl,\n      }),\n      ...(anthropicOptions?.metadata?.userId != null && {\n        metadata: { user_id: anthropicOptions.metadata.userId },\n      }),\n\n      // mcp servers:\n      ...(anthropicOptions?.mcpServers &&\n        anthropicOptions.mcpServers.length > 0 && {\n          mcp_servers: anthropicOptions.mcpServers.map(server => ({\n            type: server.type,\n            name: server.name,\n            url: server.url,\n            authorization_token: server.authorizationToken,\n            tool_configuration: server.toolConfiguration\n              ? {\n                  allowed_tools: server.toolConfiguration.allowedTools,\n                  enabled: server.toolConfiguration.enabled,\n                }\n              : undefined,\n          })),\n        }),\n\n      // container: For programmatic tool calling (just an ID string) or agent skills (object with id and skills)\n      ...(anthropicOptions?.container && {\n        container:\n          anthropicOptions.container.skills &&\n          anthropicOptions.container.skills.length > 0\n            ? // Object format when skills are provided (agent skills feature)\n              ({\n                id: anthropicOptions.container.id,\n                skills: anthropicOptions.container.skills.map(skill => ({\n                  type: skill.type,\n                  skill_id: skill.skillId,\n                  version: skill.version,\n                })),\n              } satisfies AnthropicContainer)\n            : // String format for container ID only (programmatic tool calling)\n              anthropicOptions.container.id,\n      }),\n\n      // prompt:\n      system: messagesPrompt.system,\n      messages: messagesPrompt.messages,\n\n      ...(contextManagement && {\n        context_management: {\n          edits: contextManagement.edits\n            .map(edit => {\n              const strategy = edit.type;\n              switch (strategy) {\n                case 'clear_tool_uses_20250919':\n                  return {\n                    type: edit.type,\n                    ...(edit.trigger !== undefined && {\n                      trigger: edit.trigger,\n                    }),\n                    ...(edit.keep !== undefined && { keep: edit.keep }),\n                    ...(edit.clearAtLeast !== undefined && {\n                      clear_at_least: edit.clearAtLeast,\n                    }),\n                    ...(edit.clearToolInputs !== undefined && {\n                      clear_tool_inputs: edit.clearToolInputs,\n                    }),\n                    ...(edit.excludeTools !== undefined && {\n                      exclude_tools: edit.excludeTools,\n                    }),\n                  };\n\n                case 'clear_thinking_20251015':\n                  return {\n                    type: edit.type,\n                    ...(edit.keep !== undefined && { keep: edit.keep }),\n                  };\n\n                case 'compact_20260112':\n                  return {\n                    type: edit.type,\n                    ...(edit.trigger !== undefined && {\n                      trigger: edit.trigger,\n                    }),\n                    ...(edit.pauseAfterCompaction !== undefined && {\n                      pause_after_compaction: edit.pauseAfterCompaction,\n                    }),\n                    ...(edit.instructions !== undefined && {\n                      instructions: edit.instructions,\n                    }),\n                  };\n\n                default:\n                  warnings.push({\n                    type: 'other',\n                    message: `Unknown context management strategy: ${strategy}`,\n                  });\n                  return undefined;\n              }\n            })\n            .filter(edit => edit !== undefined),\n        },\n      }),\n    };\n\n    if (isThinking) {\n      if (thinkingType === 'enabled' && thinkingBudget == null) {\n        warnings.push({\n          type: 'compatibility',\n          feature: 'extended thinking',\n          details:\n            'thinking budget is required when thinking is enabled. using default budget of 1024 tokens.',\n        });\n\n        baseArgs.thinking = {\n          type: 'enabled',\n          budget_tokens: 1024,\n        };\n\n        thinkingBudget = 1024;\n      }\n\n      if (baseArgs.temperature != null) {\n        baseArgs.temperature = undefined;\n        warnings.push({\n          type: 'unsupported',\n          feature: 'temperature',\n          details: 'temperature is not supported when thinking is enabled',\n        });\n      }\n\n      if (topK != null) {\n        baseArgs.top_k = undefined;\n        warnings.push({\n          type: 'unsupported',\n          feature: 'topK',\n          details: 'topK is not supported when thinking is enabled',\n        });\n      }\n\n      if (topP != null) {\n        baseArgs.top_p = undefined;\n        warnings.push({\n          type: 'unsupported',\n          feature: 'topP',\n          details: 'topP is not supported when thinking is enabled',\n        });\n      }\n\n      // adjust max tokens to account for thinking:\n      baseArgs.max_tokens = maxTokens + (thinkingBudget ?? 0);\n    } else {\n      // Only check temperature/topP mutual exclusivity for known Anthropic models\n      // when thinking is not enabled. Non-Anthropic models using the Anthropic-compatible\n      // API (e.g. Minimax) may require both parameters to be set.\n      if (isAnthropicModel && topP != null && temperature != null) {\n        warnings.push({\n          type: 'unsupported',\n          feature: 'topP',\n          details: `topP is not supported when temperature is set. topP is ignored.`,\n        });\n        baseArgs.top_p = undefined;\n      }\n    }\n\n    // limit to max output tokens for known models to enable model switching without breaking it:\n    if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) {\n      // only warn if max output tokens is provided as input:\n      if (maxOutputTokens != null) {\n        warnings.push({\n          type: 'unsupported',\n          feature: 'maxOutputTokens',\n          details:\n            `${baseArgs.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${maxOutputTokensForModel} max output tokens. ` +\n            `The max output tokens have been limited to ${maxOutputTokensForModel}.`,\n        });\n      }\n      baseArgs.max_tokens = maxOutputTokensForModel;\n    }\n\n    if (\n      anthropicOptions?.mcpServers &&\n      anthropicOptions.mcpServers.length > 0\n    ) {\n      betas.add('mcp-client-2025-04-04');\n    }\n\n    if (contextManagement) {\n      betas.add('context-management-2025-06-27');\n\n      // Add compaction beta if compact edit is present\n      if (contextManagement.edits.some(e => e.type === 'compact_20260112')) {\n        betas.add('compact-2026-01-12');\n      }\n    }\n\n    if (\n      anthropicOptions?.container &&\n      anthropicOptions.container.skills &&\n      anthropicOptions.container.skills.length > 0\n    ) {\n      betas.add('code-execution-2025-08-25');\n      betas.add('skills-2025-10-02');\n      betas.add('files-api-2025-04-14');\n\n      if (\n        !tools?.some(\n          tool =>\n            tool.type === 'provider' &&\n            (tool.id === 'anthropic.code_execution_20250825' ||\n              tool.id === 'anthropic.code_execution_20260120'),\n        )\n      ) {\n        warnings.push({\n          type: 'other',\n          message: 'code execution tool is required when using skills',\n        });\n      }\n    }\n\n    if (anthropicOptions?.taskBudget) {\n      betas.add('task-budgets-2026-03-13');\n    }\n\n    if (anthropicOptions?.speed === 'fast') {\n      betas.add('fast-mode-2026-02-01');\n    }\n\n    const defaultEagerInputStreaming =\n      stream && (anthropicOptions?.toolStreaming ?? true);\n\n    const {\n      tools: anthropicTools,\n      toolChoice: anthropicToolChoice,\n      toolWarnings,\n      betas: toolsBetas,\n    } = await prepareTools(\n      jsonResponseTool != null\n        ? {\n            tools: [...(tools ?? []), jsonResponseTool],\n            toolChoice: { type: 'required' },\n            disableParallelToolUse: true,\n            cacheControlValidator,\n            supportsStructuredOutput: false,\n            supportsStrictTools,\n            defaultEagerInputStreaming,\n          }\n        : {\n            tools: tools ?? [],\n            toolChoice,\n            disableParallelToolUse: anthropicOptions?.disableParallelToolUse,\n            cacheControlValidator,\n            supportsStructuredOutput,\n            supportsStrictTools,\n            defaultEagerInputStreaming,\n          },\n    );\n\n    // Extract cache control warnings once at the end\n    const cacheWarnings = cacheControlValidator.getWarnings();\n\n    return {\n      args: {\n        ...baseArgs,\n        tools: anthropicTools,\n        tool_choice: anthropicToolChoice,\n        stream: stream === true ? true : undefined, // do not send when not streaming\n      },\n      warnings: [...warnings, ...toolWarnings, ...cacheWarnings],\n      betas: new Set([\n        ...betas,\n        ...toolsBetas,\n        ...userSuppliedBetas,\n        ...(anthropicOptions?.anthropicBeta ?? []),\n      ]),\n      usesJsonResponseTool: jsonResponseTool != null,\n      toolNameMapping,\n      providerOptionsName,\n      usedCustomProviderKey,\n    };\n  }\n\n  private async getHeaders({\n    betas,\n    headers,\n  }: {\n    betas: Set<string>;\n    headers: Record<string, string | undefined> | undefined;\n  }) {\n    return combineHeaders(\n      await resolve(this.config.headers),\n      headers,\n      betas.size > 0 ? { 'anthropic-beta': Array.from(betas).join(',') } : {},\n    );\n  }\n\n  private async getBetasFromHeaders(\n    requestHeaders: Record<string, string | undefined> | undefined,\n  ) {\n    const configHeaders = await resolve(this.config.headers);\n\n    const configBetaHeader = configHeaders['anthropic-beta'] ?? '';\n    const requestBetaHeader = requestHeaders?.['anthropic-beta'] ?? '';\n\n    return new Set(\n      [\n        ...configBetaHeader.toLowerCase().split(','),\n        ...requestBetaHeader.toLowerCase().split(','),\n      ]\n        .map(beta => beta.trim())\n        .filter(beta => beta !== ''),\n    );\n  }\n\n  private buildRequestUrl(isStreaming: boolean): string {\n    return (\n      this.config.buildRequestUrl?.(this.config.baseURL, isStreaming) ??\n      `${this.config.baseURL}/messages`\n    );\n  }\n\n  private transformRequestBody(\n    args: Record<string, any>,\n    betas: Set<string>,\n  ): Record<string, any> {\n    return this.config.transformRequestBody?.(args, betas) ?? args;\n  }\n\n  private extractCitationDocuments(prompt: LanguageModelV3Prompt): Array<{\n    title: string;\n    filename?: string;\n    mediaType: string;\n  }> {\n    const isCitationPart = (part: {\n      type: string;\n      mediaType?: string;\n      providerOptions?: { anthropic?: { citations?: { enabled?: boolean } } };\n    }) => {\n      if (part.type !== 'file') {\n        return false;\n      }\n\n      if (\n        part.mediaType !== 'application/pdf' &&\n        part.mediaType !== 'text/plain'\n      ) {\n        return false;\n      }\n\n      const anthropic = part.providerOptions?.anthropic;\n      const citationsConfig = anthropic?.citations as\n        | { enabled?: boolean }\n        | undefined;\n      return citationsConfig?.enabled ?? false;\n    };\n\n    return prompt\n      .filter(message => message.role === 'user')\n      .flatMap(message => message.content)\n      .filter(isCitationPart)\n      .map(part => {\n        // TypeScript knows this is a file part due to our filter\n        const filePart = part as Extract<typeof part, { type: 'file' }>;\n        return {\n          title: filePart.filename ?? 'Untitled Document',\n          filename: filePart.filename,\n          mediaType: filePart.mediaType,\n        };\n      });\n  }\n\n  async doGenerate(\n    options: LanguageModelV3CallOptions,\n  ): Promise<LanguageModelV3GenerateResult> {\n    const {\n      args,\n      warnings,\n      betas,\n      usesJsonResponseTool,\n      toolNameMapping,\n      providerOptionsName,\n      usedCustomProviderKey,\n    } = await this.getArgs({\n      ...options,\n      stream: false,\n      userSuppliedBetas: await this.getBetasFromHeaders(options.headers),\n    });\n\n    // Extract citation documents for response processing\n    const citationDocuments = [\n      ...this.extractCitationDocuments(options.prompt),\n    ];\n\n    const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(\n      args.tools,\n    );\n\n    const {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse,\n    } = await postJsonToApi({\n      url: this.buildRequestUrl(false),\n      headers: await this.getHeaders({ betas, headers: options.headers }),\n      body: this.transformRequestBody(args, betas),\n      failedResponseHandler: anthropicFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        anthropicMessagesResponseSchema,\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch,\n    });\n\n    const content: Array<LanguageModelV3Content> = [];\n    const mcpToolCalls: Record<string, LanguageModelV3ToolCall> = {};\n    const serverToolCalls: Record<string, string> = {}; // tool_use_id -> provider tool name\n    let isJsonResponseFromTool = false;\n\n    // map response content to content array\n    for (const part of response.content) {\n      switch (part.type) {\n        case 'text': {\n          if (!usesJsonResponseTool) {\n            content.push({ type: 'text', text: part.text });\n\n            // Process citations if present\n            if (part.citations) {\n              for (const citation of part.citations) {\n                const source = createCitationSource(\n                  citation,\n                  citationDocuments,\n                  this.generateId,\n                );\n\n                if (source) {\n                  content.push(source);\n                }\n              }\n            }\n          }\n          break;\n        }\n        case 'thinking': {\n          content.push({\n            type: 'reasoning',\n            text: part.thinking,\n            providerMetadata: {\n              anthropic: {\n                signature: part.signature,\n              } satisfies AnthropicReasoningMetadata,\n            },\n          });\n          break;\n        }\n        case 'redacted_thinking': {\n          content.push({\n            type: 'reasoning',\n            text: '',\n            providerMetadata: {\n              anthropic: {\n                redactedData: part.data,\n              } satisfies AnthropicReasoningMetadata,\n            },\n          });\n          break;\n        }\n        case 'compaction': {\n          content.push({\n            type: 'text',\n            text: part.content,\n            providerMetadata: {\n              anthropic: {\n                type: 'compaction',\n              },\n            },\n          });\n          break;\n        }\n        case 'tool_use': {\n          const isJsonResponseTool =\n            usesJsonResponseTool && part.name === 'json';\n\n          if (isJsonResponseTool) {\n            isJsonResponseFromTool = true;\n\n            // when a json response tool is used, the tool call becomes the text:\n            content.push({\n              type: 'text',\n              text: JSON.stringify(part.input),\n            });\n          } else {\n            const caller = part.caller;\n            const callerInfo = caller\n              ? {\n                  type: caller.type,\n                  toolId: 'tool_id' in caller ? caller.tool_id : undefined,\n                }\n              : undefined;\n\n            content.push({\n              type: 'tool-call',\n              toolCallId: part.id,\n              toolName: part.name,\n              input: JSON.stringify(part.input),\n              ...(callerInfo && {\n                providerMetadata: {\n                  anthropic: {\n                    caller: callerInfo,\n                  },\n                },\n              }),\n            });\n          }\n\n          break;\n        }\n        case 'server_tool_use': {\n          // code execution 20250825 needs mapping:\n          if (\n            part.name === 'text_editor_code_execution' ||\n            part.name === 'bash_code_execution'\n          ) {\n            content.push({\n              type: 'tool-call',\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName('code_execution'),\n              input: JSON.stringify({ type: part.name, ...part.input }),\n              providerExecuted: true,\n            });\n          } else if (\n            part.name === 'web_search' ||\n            part.name === 'code_execution' ||\n            part.name === 'web_fetch'\n          ) {\n            // For code_execution, inject 'programmatic-tool-call' type when input has { code } format\n            const inputToSerialize =\n              part.name === 'code_execution' &&\n              part.input != null &&\n              typeof part.input === 'object' &&\n              'code' in part.input &&\n              !('type' in part.input)\n                ? { type: 'programmatic-tool-call', ...part.input }\n                : part.input;\n\n            content.push({\n              type: 'tool-call',\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName(part.name),\n              input: JSON.stringify(inputToSerialize),\n              providerExecuted: true,\n              // We want this 'code_execution' tool call to be allowed even if the tool is not explicitly provided.\n              // Since the validation generally bypasses dynamic tools, we mark this specific tool as dynamic.\n              ...(markCodeExecutionDynamic && part.name === 'code_execution'\n                ? { dynamic: true }\n                : {}),\n            });\n          } else if (\n            part.name === 'tool_search_tool_regex' ||\n            part.name === 'tool_search_tool_bm25'\n          ) {\n            serverToolCalls[part.id] = part.name;\n            content.push({\n              type: 'tool-call',\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName(part.name),\n              input: JSON.stringify(part.input),\n              providerExecuted: true,\n            });\n          } else if (part.name === 'advisor') {\n            content.push({\n              type: 'tool-call',\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName('advisor'),\n              input: JSON.stringify(part.input),\n              providerExecuted: true,\n            });\n          }\n\n          break;\n        }\n        case 'mcp_tool_use': {\n          mcpToolCalls[part.id] = {\n            type: 'tool-call',\n            toolCallId: part.id,\n            toolName: part.name,\n            input: JSON.stringify(part.input),\n            providerExecuted: true,\n            dynamic: true,\n            providerMetadata: {\n              anthropic: {\n                type: 'mcp-tool-use',\n                serverName: part.server_name,\n              },\n            },\n          };\n          content.push(mcpToolCalls[part.id]);\n          break;\n        }\n        case 'mcp_tool_result': {\n          content.push({\n            type: 'tool-result',\n            toolCallId: part.tool_use_id,\n            toolName: mcpToolCalls[part.tool_use_id].toolName,\n            isError: part.is_error,\n            result: part.content,\n            dynamic: true,\n            providerMetadata: mcpToolCalls[part.tool_use_id].providerMetadata,\n          });\n          break;\n        }\n        case 'web_fetch_tool_result': {\n          if (part.content.type === 'web_fetch_result') {\n            citationDocuments.push({\n              title: part.content.content.title ?? part.content.url,\n              mediaType: part.content.content.source.media_type,\n            });\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName('web_fetch'),\n              result: {\n                type: 'web_fetch_result',\n                url: part.content.url,\n                retrievedAt: part.content.retrieved_at,\n                content: {\n                  type: part.content.content.type,\n                  title: part.content.content.title,\n                  citations: part.content.content.citations,\n                  source: {\n                    type: part.content.content.source.type,\n                    mediaType: part.content.content.source.media_type,\n                    data: part.content.content.source.data,\n                  },\n                },\n              },\n            });\n          } else if (part.content.type === 'web_fetch_tool_result_error') {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName('web_fetch'),\n              isError: true,\n              result: {\n                type: 'web_fetch_tool_result_error',\n                errorCode: part.content.error_code,\n              },\n            });\n          }\n          break;\n        }\n        case 'web_search_tool_result': {\n          if (Array.isArray(part.content)) {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName('web_search'),\n              result: part.content.map(result => ({\n                url: result.url,\n                title: result.title,\n                pageAge: result.page_age ?? null,\n                encryptedContent: result.encrypted_content,\n                type: result.type,\n              })),\n            });\n\n            for (const result of part.content) {\n              content.push({\n                type: 'source',\n                sourceType: 'url',\n                id: this.generateId(),\n                url: result.url,\n                title: result.title,\n                providerMetadata: {\n                  anthropic: {\n                    pageAge: result.page_age ?? null,\n                  },\n                },\n              });\n            }\n          } else {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName('web_search'),\n              isError: true,\n              result: {\n                type: 'web_search_tool_result_error',\n                errorCode: part.content.error_code,\n              },\n            });\n          }\n          break;\n        }\n\n        // code execution 20250522:\n        case 'code_execution_tool_result': {\n          if (part.content.type === 'code_execution_result') {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName('code_execution'),\n              result: {\n                type: part.content.type,\n                stdout: part.content.stdout,\n                stderr: part.content.stderr,\n                return_code: part.content.return_code,\n                content: part.content.content ?? [],\n              },\n            });\n          } else if (part.content.type === 'encrypted_code_execution_result') {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName('code_execution'),\n              result: {\n                type: part.content.type,\n                encrypted_stdout: part.content.encrypted_stdout,\n                stderr: part.content.stderr,\n                return_code: part.content.return_code,\n                content: part.content.content ?? [],\n              },\n            });\n          } else if (part.content.type === 'code_execution_tool_result_error') {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName('code_execution'),\n              isError: true,\n              result: {\n                type: 'code_execution_tool_result_error',\n                errorCode: part.content.error_code,\n              },\n            });\n          }\n          break;\n        }\n\n        // code execution 20250825:\n        case 'bash_code_execution_tool_result':\n        case 'text_editor_code_execution_tool_result': {\n          content.push({\n            type: 'tool-result',\n            toolCallId: part.tool_use_id,\n            toolName: toolNameMapping.toCustomToolName('code_execution'),\n            result: part.content,\n          });\n          break;\n        }\n\n        // tool search tool results:\n        case 'tool_search_tool_result': {\n          let providerToolName = serverToolCalls[part.tool_use_id];\n\n          if (providerToolName == null) {\n            const bm25CustomName = toolNameMapping.toCustomToolName(\n              'tool_search_tool_bm25',\n            );\n            const regexCustomName = toolNameMapping.toCustomToolName(\n              'tool_search_tool_regex',\n            );\n\n            if (bm25CustomName !== 'tool_search_tool_bm25') {\n              providerToolName = 'tool_search_tool_bm25';\n            } else if (regexCustomName !== 'tool_search_tool_regex') {\n              providerToolName = 'tool_search_tool_regex';\n            } else {\n              providerToolName = 'tool_search_tool_regex';\n            }\n          }\n\n          if (part.content.type === 'tool_search_tool_search_result') {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(providerToolName),\n              result: part.content.tool_references.map(ref => ({\n                type: ref.type,\n                toolName: ref.tool_name,\n              })),\n            });\n          } else {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(providerToolName),\n              isError: true,\n              result: {\n                type: 'tool_search_tool_result_error',\n                errorCode: part.content.error_code,\n              },\n            });\n          }\n          break;\n        }\n\n        // advisor results for advisor_20260301:\n        case 'advisor_tool_result': {\n          const advisorToolName = toolNameMapping.toCustomToolName('advisor');\n          if (part.content.type === 'advisor_result') {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: advisorToolName,\n              result: {\n                type: 'advisor_result',\n                text: part.content.text,\n              },\n            });\n          } else if (part.content.type === 'advisor_redacted_result') {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: advisorToolName,\n              result: {\n                type: 'advisor_redacted_result',\n                encryptedContent: part.content.encrypted_content,\n              },\n            });\n          } else {\n            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: advisorToolName,\n              isError: true,\n              result: {\n                type: 'advisor_tool_result_error',\n                errorCode: part.content.error_code,\n              },\n            });\n          }\n          break;\n        }\n      }\n    }\n\n    return {\n      content,\n      finishReason: {\n        unified: mapAnthropicStopReason({\n          finishReason: response.stop_reason,\n          isJsonResponseFromTool,\n        }),\n        raw: response.stop_reason ?? undefined,\n      },\n      usage: convertAnthropicMessagesUsage({ usage: response.usage }),\n      request: { body: args },\n      response: {\n        id: response.id ?? undefined,\n        modelId: response.model ?? undefined,\n        headers: responseHeaders,\n        body: rawResponse,\n      },\n      warnings,\n      providerMetadata: (() => {\n        const anthropicMetadata = {\n          usage: response.usage as JSONObject,\n          cacheCreationInputTokens:\n            response.usage.cache_creation_input_tokens ?? null,\n          stopSequence: response.stop_sequence ?? null,\n\n          iterations: response.usage.iterations\n            ? response.usage.iterations.map(iter =>\n                iter.type === 'advisor_message'\n                  ? ({\n                      type: iter.type,\n                      model: iter.model,\n                      inputTokens: iter.input_tokens,\n                      outputTokens: iter.output_tokens,\n                      ...(iter.cache_creation_input_tokens\n                        ? {\n                            cacheCreationInputTokens:\n                              iter.cache_creation_input_tokens,\n                          }\n                        : {}),\n                      ...(iter.cache_read_input_tokens\n                        ? {\n                            cacheReadInputTokens: iter.cache_read_input_tokens,\n                          }\n                        : {}),\n                    } satisfies AnthropicUsageIteration)\n                  : ({\n                      type: iter.type,\n                      inputTokens: iter.input_tokens,\n                      outputTokens: iter.output_tokens,\n                      ...(iter.cache_creation_input_tokens\n                        ? {\n                            cacheCreationInputTokens:\n                              iter.cache_creation_input_tokens,\n                          }\n                        : {}),\n                      ...(iter.cache_read_input_tokens\n                        ? {\n                            cacheReadInputTokens: iter.cache_read_input_tokens,\n                          }\n                        : {}),\n                    } satisfies AnthropicUsageIteration),\n              )\n            : null,\n          container: response.container\n            ? {\n                expiresAt: response.container.expires_at,\n                id: response.container.id,\n                skills:\n                  response.container.skills?.map(skill => ({\n                    type: skill.type,\n                    skillId: skill.skill_id,\n                    version: skill.version,\n                  })) ?? null,\n              }\n            : null,\n          contextManagement:\n            mapAnthropicResponseContextManagement(\n              response.context_management,\n            ) ?? null,\n        } satisfies AnthropicMessageMetadata;\n\n        const providerMetadata: SharedV3ProviderMetadata = {\n          anthropic: anthropicMetadata,\n        };\n\n        if (usedCustomProviderKey && providerOptionsName !== 'anthropic') {\n          providerMetadata[providerOptionsName] = anthropicMetadata;\n        }\n\n        return providerMetadata;\n      })(),\n    };\n  }\n\n  async doStream(\n    options: LanguageModelV3CallOptions,\n  ): Promise<LanguageModelV3StreamResult> {\n    const {\n      args: body,\n      warnings,\n      betas,\n      usesJsonResponseTool,\n      toolNameMapping,\n      providerOptionsName,\n      usedCustomProviderKey,\n    } = await this.getArgs({\n      ...options,\n      stream: true,\n      userSuppliedBetas: await this.getBetasFromHeaders(options.headers),\n    });\n\n    // Extract citation documents for response processing\n    const citationDocuments = [\n      ...this.extractCitationDocuments(options.prompt),\n    ];\n\n    const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(\n      body.tools,\n    );\n\n    const url = this.buildRequestUrl(true);\n    const { responseHeaders, value: response } = await postJsonToApi({\n      url,\n      headers: await this.getHeaders({ betas, headers: options.headers }),\n      body: this.transformRequestBody(body, betas),\n      failedResponseHandler: anthropicFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(\n        anthropicMessagesChunkSchema,\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch,\n    });\n\n    let finishReason: LanguageModelV3FinishReason = {\n      unified: 'other',\n      raw: undefined,\n    };\n    const usage: AnthropicMessagesUsage = {\n      input_tokens: 0,\n      output_tokens: 0,\n      cache_creation_input_tokens: 0,\n      cache_read_input_tokens: 0,\n      iterations: null,\n    };\n\n    const contentBlocks: Record<\n      number,\n      | {\n          type: 'tool-call';\n          toolCallId: string;\n          toolName: string;\n          input: string;\n          providerExecuted?: boolean;\n          firstDelta: boolean;\n          providerToolName?: string;\n          caller?: {\n            type:\n              | 'code_execution_20250825'\n              | 'code_execution_20260120'\n              | 'direct';\n            toolId?: string;\n          };\n        }\n      | { type: 'text' | 'reasoning' }\n    > = {};\n    const mcpToolCalls: Record<string, LanguageModelV3ToolCall> = {};\n    const serverToolCalls: Record<string, string> = {}; // tool_use_id -> provider tool name\n\n    let contextManagement:\n      | AnthropicMessageMetadata['contextManagement']\n      | null = null;\n    let rawUsage: JSONObject | undefined = undefined;\n    let cacheCreationInputTokens: number | null = null;\n    let stopSequence: string | null = null;\n    let container: AnthropicMessageMetadata['container'] | null = null;\n    let isJsonResponseFromTool = false;\n\n    let blockType:\n      | 'text'\n      | 'thinking'\n      | 'tool_use'\n      | 'redacted_thinking'\n      | 'server_tool_use'\n      | 'web_fetch_tool_result'\n      | 'web_search_tool_result'\n      | 'code_execution_tool_result'\n      | 'text_editor_code_execution_tool_result'\n      | 'bash_code_execution_tool_result'\n      | 'tool_search_tool_result'\n      | 'advisor_tool_result'\n      | 'mcp_tool_use'\n      | 'mcp_tool_result'\n      | 'compaction'\n      | undefined = undefined;\n\n    const generateId = this.generateId;\n\n    const transformedStream = response.pipeThrough(\n      new TransformStream<\n        ParseResult<InferSchema<typeof anthropicMessagesChunkSchema>>,\n        LanguageModelV3StreamPart\n      >({\n        start(controller) {\n          controller.enqueue({ type: 'stream-start', warnings });\n        },\n\n        transform(chunk, controller) {\n          if (options.includeRawChunks) {\n            controller.enqueue({ type: 'raw', rawValue: chunk.rawValue });\n          }\n\n          if (!chunk.success) {\n            controller.enqueue({ type: 'error', error: chunk.error });\n            return;\n          }\n\n          const value = chunk.value;\n\n          switch (value.type) {\n            case 'ping': {\n              return; // ignored\n            }\n\n            case 'content_block_start': {\n              const part = value.content_block;\n              const contentBlockType = part.type;\n              blockType = contentBlockType;\n\n              switch (contentBlockType) {\n                case 'text': {\n                  // when a json response tool is used, the tool call is returned as text,\n                  // so we ignore the text content:\n                  if (usesJsonResponseTool) {\n                    return;\n                  }\n\n                  contentBlocks[value.index] = { type: 'text' };\n                  controller.enqueue({\n                    type: 'text-start',\n                    id: String(value.index),\n                  });\n                  return;\n                }\n\n                case 'thinking': {\n                  contentBlocks[value.index] = { type: 'reasoning' };\n                  controller.enqueue({\n                    type: 'reasoning-start',\n                    id: String(value.index),\n                  });\n                  return;\n                }\n\n                case 'redacted_thinking': {\n                  contentBlocks[value.index] = { type: 'reasoning' };\n                  controller.enqueue({\n                    type: 'reasoning-start',\n                    id: String(value.index),\n                    providerMetadata: {\n                      anthropic: {\n                        redactedData: part.data,\n                      } satisfies AnthropicReasoningMetadata,\n                    },\n                  });\n                  return;\n                }\n\n                case 'compaction': {\n                  contentBlocks[value.index] = { type: 'text' };\n                  controller.enqueue({\n                    type: 'text-start',\n                    id: String(value.index),\n                    providerMetadata: {\n                      anthropic: {\n                        type: 'compaction',\n                      },\n                    },\n                  });\n                  return;\n                }\n\n                case 'tool_use': {\n                  const isJsonResponseTool =\n                    usesJsonResponseTool && part.name === 'json';\n\n                  if (isJsonResponseTool) {\n                    isJsonResponseFromTool = true;\n\n                    contentBlocks[value.index] = { type: 'text' };\n\n                    controller.enqueue({\n                      type: 'text-start',\n                      id: String(value.index),\n                    });\n                  } else {\n                    // Extract caller info for type-safe access\n                    const caller = part.caller;\n                    const callerInfo = caller\n                      ? {\n                          type: caller.type,\n                          toolId:\n                            'tool_id' in caller ? caller.tool_id : undefined,\n                        }\n                      : undefined;\n\n                    // Programmatic tool calling: for deferred tool calls from code_execution,\n                    // input may be present directly in content_block_start.\n                    // Only use if non-empty (empty {} means input comes via deltas)\n                    const hasNonEmptyInput =\n                      part.input && Object.keys(part.input).length > 0;\n                    const initialInput = hasNonEmptyInput\n                      ? JSON.stringify(part.input)\n                      : '';\n\n                    contentBlocks[value.index] = {\n                      type: 'tool-call',\n                      toolCallId: part.id,\n                      toolName: part.name,\n                      input: initialInput,\n                      firstDelta: initialInput.length === 0,\n                      ...(callerInfo && { caller: callerInfo }),\n                    };\n\n                    controller.enqueue({\n                      type: 'tool-input-start',\n                      id: part.id,\n                      toolName: part.name,\n                    });\n                  }\n                  return;\n                }\n\n                case 'server_tool_use': {\n                  if (\n                    [\n                      'web_fetch',\n                      'web_search',\n                      // code execution 20250825:\n                      'code_execution',\n                      // code execution 20250825 text editor:\n                      'text_editor_code_execution',\n                      // code execution 20250825 bash:\n                      'bash_code_execution',\n                    ].includes(part.name)\n                  ) {\n                    // map tool names for the code execution 20250825 tool:\n                    const providerToolName =\n                      part.name === 'text_editor_code_execution' ||\n                      part.name === 'bash_code_execution'\n                        ? 'code_execution'\n                        : part.name;\n\n                    const customToolName =\n                      toolNameMapping.toCustomToolName(providerToolName);\n\n                    // Tools like 'web_fetch_20260209' provide input data here.\n                    // Other tools like 'code_execution_20260120' provide input data via deltas.\n                    // So we only use this if it's non-empty to avoid conflicts.\n                    const finalInput =\n                      part.input != null &&\n                      typeof part.input === 'object' &&\n                      Object.keys(part.input).length > 0\n                        ? JSON.stringify(part.input)\n                        : '';\n\n                    contentBlocks[value.index] = {\n                      type: 'tool-call',\n                      toolCallId: part.id,\n                      toolName: customToolName,\n                      input: finalInput,\n                      providerExecuted: true,\n                      ...(markCodeExecutionDynamic &&\n                      providerToolName === 'code_execution'\n                        ? { dynamic: true }\n                        : {}),\n                      firstDelta: true,\n                      providerToolName: part.name,\n                    };\n\n                    controller.enqueue({\n                      type: 'tool-input-start',\n                      id: part.id,\n                      toolName: customToolName,\n                      providerExecuted: true,\n                      ...(markCodeExecutionDynamic &&\n                      providerToolName === 'code_execution'\n                        ? { dynamic: true }\n                        : {}),\n                    });\n                  } else if (\n                    part.name === 'tool_search_tool_regex' ||\n                    part.name === 'tool_search_tool_bm25'\n                  ) {\n                    serverToolCalls[part.id] = part.name;\n                    const customToolName = toolNameMapping.toCustomToolName(\n                      part.name,\n                    );\n\n                    contentBlocks[value.index] = {\n                      type: 'tool-call',\n                      toolCallId: part.id,\n                      toolName: customToolName,\n                      input: '',\n                      providerExecuted: true,\n                      firstDelta: true,\n                      providerToolName: part.name,\n                    };\n\n                    controller.enqueue({\n                      type: 'tool-input-start',\n                      id: part.id,\n                      toolName: customToolName,\n                      providerExecuted: true,\n                    });\n                  } else if (part.name === 'advisor') {\n                    const customToolName =\n                      toolNameMapping.toCustomToolName('advisor');\n\n                    contentBlocks[value.index] = {\n                      type: 'tool-call',\n                      toolCallId: part.id,\n                      toolName: customToolName,\n                      input: '{}',\n                      providerExecuted: true,\n                      firstDelta: true,\n                      providerToolName: part.name,\n                    };\n\n                    controller.enqueue({\n                      type: 'tool-input-start',\n                      id: part.id,\n                      toolName: customToolName,\n                      providerExecuted: true,\n                    });\n                  }\n\n                  return;\n                }\n\n                case 'web_fetch_tool_result': {\n                  if (part.content.type === 'web_fetch_result') {\n                    citationDocuments.push({\n                      title: part.content.content.title ?? part.content.url,\n                      mediaType: part.content.content.source.media_type,\n                    });\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName('web_fetch'),\n                      result: {\n                        type: 'web_fetch_result',\n                        url: part.content.url,\n                        retrievedAt: part.content.retrieved_at,\n                        content: {\n                          type: part.content.content.type,\n                          title: part.content.content.title,\n                          citations: part.content.content.citations,\n                          source: {\n                            type: part.content.content.source.type,\n                            mediaType: part.content.content.source.media_type,\n                            data: part.content.content.source.data,\n                          },\n                        },\n                      },\n                    });\n                  } else if (\n                    part.content.type === 'web_fetch_tool_result_error'\n                  ) {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName('web_fetch'),\n                      isError: true,\n                      result: {\n                        type: 'web_fetch_tool_result_error',\n                        errorCode: part.content.error_code,\n                      },\n                    });\n                  }\n\n                  return;\n                }\n\n                case 'web_search_tool_result': {\n                  if (Array.isArray(part.content)) {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName('web_search'),\n                      result: part.content.map(result => ({\n                        url: result.url,\n                        title: result.title,\n                        pageAge: result.page_age ?? null,\n                        encryptedContent: result.encrypted_content,\n                        type: result.type,\n                      })),\n                    });\n\n                    for (const result of part.content) {\n                      controller.enqueue({\n                        type: 'source',\n                        sourceType: 'url',\n                        id: generateId(),\n                        url: result.url,\n                        title: result.title,\n                        providerMetadata: {\n                          anthropic: {\n                            pageAge: result.page_age ?? null,\n                          },\n                        },\n                      });\n                    }\n                  } else {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName('web_search'),\n                      isError: true,\n                      result: {\n                        type: 'web_search_tool_result_error',\n                        errorCode: part.content.error_code,\n                      },\n                    });\n                  }\n                  return;\n                }\n\n                // code execution 20250522:\n                case 'code_execution_tool_result': {\n                  if (part.content.type === 'code_execution_result') {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName:\n                        toolNameMapping.toCustomToolName('code_execution'),\n                      result: {\n                        type: part.content.type,\n                        stdout: part.content.stdout,\n                        stderr: part.content.stderr,\n                        return_code: part.content.return_code,\n                        content: part.content.content ?? [],\n                      },\n                    });\n                  } else if (\n                    part.content.type === 'encrypted_code_execution_result'\n                  ) {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName:\n                        toolNameMapping.toCustomToolName('code_execution'),\n                      result: {\n                        type: part.content.type,\n                        encrypted_stdout: part.content.encrypted_stdout,\n                        stderr: part.content.stderr,\n                        return_code: part.content.return_code,\n                        content: part.content.content ?? [],\n                      },\n                    });\n                  } else if (\n                    part.content.type === 'code_execution_tool_result_error'\n                  ) {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName:\n                        toolNameMapping.toCustomToolName('code_execution'),\n                      isError: true,\n                      result: {\n                        type: 'code_execution_tool_result_error',\n                        errorCode: part.content.error_code,\n                      },\n                    });\n                  }\n\n                  return;\n                }\n\n                // code execution 20250825:\n                case 'bash_code_execution_tool_result':\n                case 'text_editor_code_execution_tool_result': {\n                  controller.enqueue({\n                    type: 'tool-result',\n                    toolCallId: part.tool_use_id,\n                    toolName:\n                      toolNameMapping.toCustomToolName('code_execution'),\n                    result: part.content,\n                  });\n                  return;\n                }\n\n                // tool search tool results:\n                case 'tool_search_tool_result': {\n                  let providerToolName = serverToolCalls[part.tool_use_id];\n\n                  if (providerToolName == null) {\n                    const bm25CustomName = toolNameMapping.toCustomToolName(\n                      'tool_search_tool_bm25',\n                    );\n                    const regexCustomName = toolNameMapping.toCustomToolName(\n                      'tool_search_tool_regex',\n                    );\n\n                    if (bm25CustomName !== 'tool_search_tool_bm25') {\n                      providerToolName = 'tool_search_tool_bm25';\n                    } else if (regexCustomName !== 'tool_search_tool_regex') {\n                      providerToolName = 'tool_search_tool_regex';\n                    } else {\n                      providerToolName = 'tool_search_tool_regex';\n                    }\n                  }\n\n                  if (part.content.type === 'tool_search_tool_search_result') {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName:\n                        toolNameMapping.toCustomToolName(providerToolName),\n                      result: part.content.tool_references.map(ref => ({\n                        type: ref.type,\n                        toolName: ref.tool_name,\n                      })),\n                    });\n                  } else {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName:\n                        toolNameMapping.toCustomToolName(providerToolName),\n                      isError: true,\n                      result: {\n                        type: 'tool_search_tool_result_error',\n                        errorCode: part.content.error_code,\n                      },\n                    });\n                  }\n                  return;\n                }\n\n                // advisor results for advisor_20260301:\n                // arrives fully formed in a single content_block_start (no deltas).\n                case 'advisor_tool_result': {\n                  const advisorToolName =\n                    toolNameMapping.toCustomToolName('advisor');\n                  if (part.content.type === 'advisor_result') {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName: advisorToolName,\n                      result: {\n                        type: 'advisor_result',\n                        text: part.content.text,\n                      },\n                    });\n                  } else if (part.content.type === 'advisor_redacted_result') {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName: advisorToolName,\n                      result: {\n                        type: 'advisor_redacted_result',\n                        encryptedContent: part.content.encrypted_content,\n                      },\n                    });\n                  } else {\n                    controller.enqueue({\n                      type: 'tool-result',\n                      toolCallId: part.tool_use_id,\n                      toolName: advisorToolName,\n                      isError: true,\n                      result: {\n                        type: 'advisor_tool_result_error',\n                        errorCode: part.content.error_code,\n                      },\n                    });\n                  }\n                  return;\n                }\n\n                case 'mcp_tool_use': {\n                  mcpToolCalls[part.id] = {\n                    type: 'tool-call',\n                    toolCallId: part.id,\n                    toolName: part.name,\n                    input: JSON.stringify(part.input),\n                    providerExecuted: true,\n                    dynamic: true,\n                    providerMetadata: {\n                      anthropic: {\n                        type: 'mcp-tool-use',\n                        serverName: part.server_name,\n                      },\n                    },\n                  };\n                  controller.enqueue(mcpToolCalls[part.id]);\n                  return;\n                }\n\n                case 'mcp_tool_result': {\n                  controller.enqueue({\n                    type: 'tool-result',\n                    toolCallId: part.tool_use_id,\n                    toolName: mcpToolCalls[part.tool_use_id].toolName,\n                    isError: part.is_error,\n                    result: part.content,\n                    dynamic: true,\n                    providerMetadata:\n                      mcpToolCalls[part.tool_use_id].providerMetadata,\n                  });\n                  return;\n                }\n\n                default: {\n                  const _exhaustiveCheck: never = contentBlockType;\n                  throw new Error(\n                    `Unsupported content block type: ${_exhaustiveCheck}`,\n                  );\n                }\n              }\n            }\n\n            case 'content_block_stop': {\n              // when finishing a tool call block, send the full tool call:\n              if (contentBlocks[value.index] != null) {\n                const contentBlock = contentBlocks[value.index];\n\n                switch (contentBlock.type) {\n                  case 'text': {\n                    controller.enqueue({\n                      type: 'text-end',\n                      id: String(value.index),\n                    });\n                    break;\n                  }\n\n                  case 'reasoning': {\n                    controller.enqueue({\n                      type: 'reasoning-end',\n                      id: String(value.index),\n                    });\n                    break;\n                  }\n\n                  case 'tool-call':\n                    // when a json response tool is used, the tool call is returned as text,\n                    // so we ignore the tool call content:\n                    const isJsonResponseTool =\n                      usesJsonResponseTool && contentBlock.toolName === 'json';\n\n                    if (!isJsonResponseTool) {\n                      controller.enqueue({\n                        type: 'tool-input-end',\n                        id: contentBlock.toolCallId,\n                      });\n\n                      // For code_execution, inject 'programmatic-tool-call' type\n                      // when input has { code } format (programmatic tool calling)\n                      let finalInput =\n                        contentBlock.input === '' ? '{}' : contentBlock.input;\n                      if (contentBlock.providerToolName === 'code_execution') {\n                        try {\n                          const parsed = JSON.parse(finalInput);\n                          if (\n                            parsed != null &&\n                            typeof parsed === 'object' &&\n                            'code' in parsed &&\n                            !('type' in parsed)\n                          ) {\n                            finalInput = JSON.stringify({\n                              type: 'programmatic-tool-call',\n                              ...parsed,\n                            });\n                          }\n                        } catch {\n                          // ignore parse errors, use original input\n                        }\n                      }\n\n                      controller.enqueue({\n                        type: 'tool-call',\n                        toolCallId: contentBlock.toolCallId,\n                        toolName: contentBlock.toolName,\n                        input: finalInput,\n                        providerExecuted: contentBlock.providerExecuted,\n                        ...(markCodeExecutionDynamic &&\n                        contentBlock.providerToolName === 'code_execution'\n                          ? { dynamic: true }\n                          : {}),\n                        ...(contentBlock.caller && {\n                          providerMetadata: {\n                            anthropic: {\n                              caller: contentBlock.caller,\n                            },\n                          },\n                        }),\n                      });\n                    }\n                    break;\n                }\n\n                delete contentBlocks[value.index];\n              }\n\n              blockType = undefined; // reset block type\n\n              return;\n            }\n\n            case 'content_block_delta': {\n              const deltaType = value.delta.type;\n\n              switch (deltaType) {\n                case 'text_delta': {\n                  // when a json response tool is used, the tool call is returned as text,\n                  // so we ignore the text content:\n                  if (usesJsonResponseTool) {\n                    return; // excluding the text-start will also exclude the text-end\n                  }\n\n                  controller.enqueue({\n                    type: 'text-delta',\n                    id: String(value.index),\n                    delta: value.delta.text,\n                  });\n\n                  return;\n                }\n\n                case 'thinking_delta': {\n                  controller.enqueue({\n                    type: 'reasoning-delta',\n                    id: String(value.index),\n                    delta: value.delta.thinking,\n                  });\n\n                  return;\n                }\n\n                case 'signature_delta': {\n                  // signature are only supported on thinking blocks:\n                  if (blockType === 'thinking') {\n                    controller.enqueue({\n                      type: 'reasoning-delta',\n                      id: String(value.index),\n                      delta: '',\n                      providerMetadata: {\n                        anthropic: {\n                          signature: value.delta.signature,\n                        } satisfies AnthropicReasoningMetadata,\n                      },\n                    });\n                  }\n\n                  return;\n                }\n\n                case 'compaction_delta': {\n                  if (value.delta.content != null) {\n                    controller.enqueue({\n                      type: 'text-delta',\n                      id: String(value.index),\n                      delta: value.delta.content,\n                    });\n                  }\n\n                  return;\n                }\n\n                case 'input_json_delta': {\n                  const contentBlock = contentBlocks[value.index];\n                  let delta = value.delta.partial_json;\n\n                  // skip empty deltas to enable replacing the first character\n                  // in the code execution 20250825 tool.\n                  if (delta.length === 0) {\n                    return;\n                  }\n\n                  if (isJsonResponseFromTool) {\n                    if (contentBlock?.type !== 'text') {\n                      return; // exclude reasoning\n                    }\n\n                    controller.enqueue({\n                      type: 'text-delta',\n                      id: String(value.index),\n                      delta,\n                    });\n                  } else {\n                    if (contentBlock?.type !== 'tool-call') {\n                      return;\n                    }\n\n                    // for the code execution 20250825, we need to add\n                    // the type to the delta and change the tool name.\n                    if (\n                      contentBlock.firstDelta &&\n                      (contentBlock.providerToolName ===\n                        'bash_code_execution' ||\n                        contentBlock.providerToolName ===\n                          'text_editor_code_execution')\n                    ) {\n                      delta = `{\"type\": \"${contentBlock.providerToolName}\",${delta.substring(1)}`;\n                    }\n\n                    controller.enqueue({\n                      type: 'tool-input-delta',\n                      id: contentBlock.toolCallId,\n                      delta,\n                    });\n\n                    contentBlock.input += delta;\n                    contentBlock.firstDelta = false;\n                  }\n\n                  return;\n                }\n\n                case 'citations_delta': {\n                  const citation = value.delta.citation;\n                  const source = createCitationSource(\n                    citation,\n                    citationDocuments,\n                    generateId,\n                  );\n\n                  if (source) {\n                    controller.enqueue(source);\n                  }\n\n                  return;\n                }\n\n                default: {\n                  const _exhaustiveCheck: never = deltaType;\n                  throw new Error(\n                    `Unsupported delta type: ${_exhaustiveCheck}`,\n                  );\n                }\n              }\n            }\n\n            case 'message_start': {\n              usage.input_tokens = value.message.usage.input_tokens;\n              usage.cache_read_input_tokens =\n                value.message.usage.cache_read_input_tokens ?? 0;\n              usage.cache_creation_input_tokens =\n                value.message.usage.cache_creation_input_tokens ?? 0;\n\n              rawUsage = {\n                ...(value.message.usage as JSONObject),\n              };\n\n              cacheCreationInputTokens =\n                value.message.usage.cache_creation_input_tokens ?? null;\n\n              if (value.message.container != null) {\n                container = {\n                  expiresAt: value.message.container.expires_at,\n                  id: value.message.container.id,\n                  skills: null,\n                };\n              }\n\n              if (value.message.stop_reason != null) {\n                finishReason = {\n                  unified: mapAnthropicStopReason({\n                    finishReason: value.message.stop_reason,\n                    isJsonResponseFromTool,\n                  }),\n                  raw: value.message.stop_reason,\n                };\n              }\n\n              controller.enqueue({\n                type: 'response-metadata',\n                id: value.message.id ?? undefined,\n                modelId: value.message.model ?? undefined,\n              });\n\n              // Programmatic tool calling: process pre-populated content blocks\n              // (for deferred tool calls, content may be in message_start)\n              if (value.message.content != null) {\n                for (\n                  let contentIndex = 0;\n                  contentIndex < value.message.content.length;\n                  contentIndex++\n                ) {\n                  const part = value.message.content[contentIndex];\n                  if (part.type === 'tool_use') {\n                    const caller = part.caller;\n                    const callerInfo = caller\n                      ? {\n                          type: caller.type,\n                          toolId:\n                            'tool_id' in caller ? caller.tool_id : undefined,\n                        }\n                      : undefined;\n\n                    controller.enqueue({\n                      type: 'tool-input-start',\n                      id: part.id,\n                      toolName: part.name,\n                    });\n\n                    const inputStr = JSON.stringify(part.input ?? {});\n                    controller.enqueue({\n                      type: 'tool-input-delta',\n                      id: part.id,\n                      delta: inputStr,\n                    });\n\n                    controller.enqueue({\n                      type: 'tool-input-end',\n                      id: part.id,\n                    });\n\n                    controller.enqueue({\n                      type: 'tool-call',\n                      toolCallId: part.id,\n                      toolName: part.name,\n                      input: inputStr,\n                      ...(callerInfo && {\n                        providerMetadata: {\n                          anthropic: {\n                            caller: callerInfo,\n                          },\n                        },\n                      }),\n                    });\n                  }\n                }\n              }\n\n              return;\n            }\n\n            case 'message_delta': {\n              if (\n                value.usage.input_tokens != null &&\n                usage.input_tokens !== value.usage.input_tokens\n              ) {\n                usage.input_tokens = value.usage.input_tokens;\n              }\n              usage.output_tokens = value.usage.output_tokens;\n\n              if (value.usage.cache_read_input_tokens != null) {\n                usage.cache_read_input_tokens =\n                  value.usage.cache_read_input_tokens;\n              }\n              if (value.usage.cache_creation_input_tokens != null) {\n                usage.cache_creation_input_tokens =\n                  value.usage.cache_creation_input_tokens;\n                cacheCreationInputTokens =\n                  value.usage.cache_creation_input_tokens;\n              }\n              if (value.usage.iterations != null) {\n                usage.iterations = value.usage.iterations;\n              }\n\n              finishReason = {\n                unified: mapAnthropicStopReason({\n                  finishReason: value.delta.stop_reason,\n                  isJsonResponseFromTool,\n                }),\n                raw: value.delta.stop_reason ?? undefined,\n              };\n\n              stopSequence = value.delta.stop_sequence ?? null;\n              container =\n                value.delta.container != null\n                  ? {\n                      expiresAt: value.delta.container.expires_at,\n                      id: value.delta.container.id,\n                      skills:\n                        value.delta.container.skills?.map(skill => ({\n                          type: skill.type,\n                          skillId: skill.skill_id,\n                          version: skill.version,\n                        })) ?? null,\n                    }\n                  : null;\n\n              if (value.context_management) {\n                contextManagement = mapAnthropicResponseContextManagement(\n                  value.context_management,\n                );\n              }\n\n              rawUsage = {\n                ...rawUsage,\n                ...(value.usage as JSONObject),\n              };\n\n              return;\n            }\n\n            case 'message_stop': {\n              const anthropicMetadata = {\n                usage: (rawUsage as JSONObject) ?? null,\n                cacheCreationInputTokens,\n                stopSequence,\n                iterations: usage.iterations\n                  ? usage.iterations.map(iter =>\n                      iter.type === 'advisor_message'\n                        ? ({\n                            type: iter.type,\n                            model: iter.model,\n                            inputTokens: iter.input_tokens,\n                            outputTokens: iter.output_tokens,\n                            ...(iter.cache_creation_input_tokens\n                              ? {\n                                  cacheCreationInputTokens:\n                                    iter.cache_creation_input_tokens,\n                                }\n                              : {}),\n                            ...(iter.cache_read_input_tokens\n                              ? {\n                                  cacheReadInputTokens:\n                                    iter.cache_read_input_tokens,\n                                }\n                              : {}),\n                          } satisfies AnthropicUsageIteration)\n                        : ({\n                            type: iter.type,\n                            inputTokens: iter.input_tokens,\n                            outputTokens: iter.output_tokens,\n                            ...(iter.cache_creation_input_tokens\n                              ? {\n                                  cacheCreationInputTokens:\n                                    iter.cache_creation_input_tokens,\n                                }\n                              : {}),\n                            ...(iter.cache_read_input_tokens\n                              ? {\n                                  cacheReadInputTokens:\n                                    iter.cache_read_input_tokens,\n                                }\n                              : {}),\n                          } satisfies AnthropicUsageIteration),\n                    )\n                  : null,\n                container,\n                contextManagement,\n              } satisfies AnthropicMessageMetadata;\n\n              const providerMetadata: SharedV3ProviderMetadata = {\n                anthropic: anthropicMetadata,\n              };\n\n              if (\n                usedCustomProviderKey &&\n                providerOptionsName !== 'anthropic'\n              ) {\n                providerMetadata[providerOptionsName] = anthropicMetadata;\n              }\n\n              controller.enqueue({\n                type: 'finish',\n                finishReason,\n                usage: convertAnthropicMessagesUsage({ usage, rawUsage }),\n                providerMetadata,\n              });\n              return;\n            }\n\n            case 'error': {\n              controller.enqueue({ type: 'error', error: value.error });\n              return;\n            }\n\n            default: {\n              const _exhaustiveCheck: never = value;\n              throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`);\n            }\n          }\n        },\n      }),\n    );\n\n    // The first chunk needs to be pulled immediately to check if it is an error\n    const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();\n\n    const firstChunkReader = streamForFirstChunk.getReader();\n    try {\n      await firstChunkReader.read(); // streamStart comes first, ignored\n\n      let result = await firstChunkReader.read();\n\n      // when raw chunks are enabled, the first chunk is a raw chunk, so we need to read the next chunk\n      if (result.value?.type === 'raw') {\n        result = await firstChunkReader.read();\n      }\n\n      // The Anthropic API returns 200 responses when there are overloaded errors.\n      // We handle the case where the first chunk is an error here and transform\n      // it into an APICallError.\n      if (result.value?.type === 'error') {\n        const error = result.value.error as { message: string; type: string };\n\n        throw new APICallError({\n          message: error.message,\n          url,\n          requestBodyValues: body,\n          statusCode: error.type === 'overloaded_error' ? 529 : 500,\n          responseHeaders,\n          responseBody: JSON.stringify(error),\n          isRetryable: error.type === 'overloaded_error',\n        });\n      }\n    } finally {\n      firstChunkReader.cancel().catch(() => {});\n      firstChunkReader.releaseLock();\n    }\n\n    return {\n      stream: streamForConsumer,\n      request: { body },\n      response: { headers: responseHeaders },\n    };\n  }\n}\n\n/**\n * Returns the capabilities of a Claude model that are used for defaults and feature selection.\n *\n * @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table\n * @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs\n */\nfunction getModelCapabilities(modelId: string): {\n  maxOutputTokens: number;\n  supportsStructuredOutput: boolean;\n  rejectsSamplingParameters: boolean;\n  isKnownModel: boolean;\n} {\n  if (modelId.includes('claude-opus-4-7')) {\n    return {\n      maxOutputTokens: 128000,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      isKnownModel: true,\n    };\n  } else if (\n    modelId.includes('claude-sonnet-4-6') ||\n    modelId.includes('claude-opus-4-6')\n  ) {\n    return {\n      maxOutputTokens: 128000,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: false,\n      isKnownModel: true,\n    };\n  } else if (\n    modelId.includes('claude-sonnet-4-5') ||\n    modelId.includes('claude-opus-4-5') ||\n    modelId.includes('claude-haiku-4-5')\n  ) {\n    return {\n      maxOutputTokens: 64000,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: false,\n      isKnownModel: true,\n    };\n  } else if (modelId.includes('claude-opus-4-1')) {\n    return {\n      maxOutputTokens: 32000,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: false,\n      isKnownModel: true,\n    };\n  } else if (modelId.includes('claude-sonnet-4-')) {\n    return {\n      maxOutputTokens: 64000,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      isKnownModel: true,\n    };\n  } else if (modelId.includes('claude-opus-4-')) {\n    return {\n      maxOutputTokens: 32000,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      isKnownModel: true,\n    };\n  } else if (modelId.includes('claude-3-haiku')) {\n    return {\n      maxOutputTokens: 4096,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      isKnownModel: true,\n    };\n  } else {\n    return {\n      maxOutputTokens: 4096,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      isKnownModel: false,\n    };\n  }\n}\n\nfunction hasWebTool20260209WithoutCodeExecution(\n  tools: AnthropicTool[] | undefined,\n): boolean {\n  if (!tools) {\n    return false;\n  }\n  let hasWebTool20260209 = false;\n  let hasCodeExecutionTool = false;\n  for (const tool of tools) {\n    if (\n      'type' in tool &&\n      (tool.type === 'web_fetch_20260209' ||\n        tool.type === 'web_search_20260209')\n    ) {\n      hasWebTool20260209 = true;\n      continue;\n    }\n    if (tool.name === 'code_execution') {\n      hasCodeExecutionTool = true;\n      break;\n    }\n  }\n  return hasWebTool20260209 && !hasCodeExecutionTool;\n}\n\nfunction mapAnthropicResponseContextManagement(\n  contextManagement: AnthropicResponseContextManagement | null | undefined,\n): AnthropicMessageMetadata['contextManagement'] | null {\n  return contextManagement\n    ? {\n        appliedEdits: contextManagement.applied_edits\n          .map(edit => {\n            const strategy = edit.type;\n\n            switch (strategy) {\n              case 'clear_tool_uses_20250919':\n                return {\n                  type: edit.type,\n                  clearedToolUses: edit.cleared_tool_uses,\n                  clearedInputTokens: edit.cleared_input_tokens,\n                };\n\n              case 'clear_thinking_20251015':\n                return {\n                  type: edit.type,\n                  clearedThinkingTurns: edit.cleared_thinking_turns,\n                  clearedInputTokens: edit.cleared_input_tokens,\n                };\n\n              case 'compact_20260112':\n                return {\n                  type: edit.type,\n                };\n            }\n          })\n          .filter(edit => edit !== undefined),\n      }\n    : null;\n}\n","import {\n  createJsonErrorResponseHandler,\n  lazySchema,\n  zodSchema,\n  type InferSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const anthropicErrorDataSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      type: z.literal('error'),\n      error: z.object({\n        type: z.string(),\n        message: z.string(),\n      }),\n    }),\n  ),\n);\n\nexport type AnthropicErrorData = InferSchema<typeof anthropicErrorDataSchema>;\n\nexport const anthropicFailedResponseHandler = createJsonErrorResponseHandler({\n  errorSchema: anthropicErrorDataSchema,\n  errorToMessage: data => data.error.message,\n});\n","import type { JSONSchema7 } from '@ai-sdk/provider';\nimport {\n  lazySchema,\n  zodSchema,\n  type InferSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport type AnthropicMessagesPrompt = {\n  system: Array<AnthropicTextContent> | undefined;\n  messages: AnthropicMessage[];\n};\n\nexport type AnthropicMessage = AnthropicUserMessage | AnthropicAssistantMessage;\n\nexport type AnthropicCacheControl = {\n  type: 'ephemeral';\n  ttl?: '5m' | '1h';\n};\n\nexport interface AnthropicUserMessage {\n  role: 'user';\n  content: Array<\n    | AnthropicTextContent\n    | AnthropicImageContent\n    | AnthropicDocumentContent\n    | AnthropicToolResultContent\n  >;\n}\n\nexport interface AnthropicAssistantMessage {\n  role: 'assistant';\n  content: Array<\n    | AnthropicTextContent\n    | AnthropicThinkingContent\n    | AnthropicRedactedThinkingContent\n    | AnthropicToolCallContent\n    | AnthropicServerToolUseContent\n    | AnthropicCodeExecutionToolResultContent\n    | AnthropicWebFetchToolResultContent\n    | AnthropicWebSearchToolResultContent\n    | AnthropicToolSearchToolResultContent\n    | AnthropicBashCodeExecutionToolResultContent\n    | AnthropicTextEditorCodeExecutionToolResultContent\n    | AnthropicAdvisorToolResultContent\n    | AnthropicMcpToolUseContent\n    | AnthropicMcpToolResultContent\n    | AnthropicCompactionContent\n  >;\n}\n\nexport interface AnthropicCompactionContent {\n  type: 'compaction';\n  content: string;\n  cache_control?: AnthropicCacheControl;\n}\n\nexport interface AnthropicTextContent {\n  type: 'text';\n  text: string;\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport interface AnthropicThinkingContent {\n  type: 'thinking';\n  thinking: string;\n  signature: string;\n  // Note: thinking blocks cannot be directly cached with cache_control.\n  // They are cached implicitly when appearing in previous assistant turns.\n  cache_control?: never;\n}\n\nexport interface AnthropicRedactedThinkingContent {\n  type: 'redacted_thinking';\n  data: string;\n  // Note: redacted thinking blocks cannot be directly cached with cache_control.\n  // They are cached implicitly when appearing in previous assistant turns.\n  cache_control?: never;\n}\n\ntype AnthropicContentSource =\n  | {\n      type: 'base64';\n      media_type: string;\n      data: string;\n    }\n  | {\n      type: 'url';\n      url: string;\n    }\n  | {\n      type: 'text';\n      media_type: 'text/plain';\n      data: string;\n    };\n\nexport interface AnthropicImageContent {\n  type: 'image';\n  source: AnthropicContentSource;\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport interface AnthropicDocumentContent {\n  type: 'document';\n  source: AnthropicContentSource;\n  title?: string;\n  context?: string;\n  citations?: { enabled: boolean };\n  cache_control: AnthropicCacheControl | undefined;\n}\n\n/**\n * The caller information for programmatic tool calling.\n * Present when a tool is called from within code execution.\n */\nexport type AnthropicToolCallCaller =\n  | {\n      type: 'code_execution_20250825';\n      tool_id: string;\n    }\n  | {\n      type: 'code_execution_20260120';\n      tool_id: string;\n    }\n  | {\n      type: 'direct';\n    };\n\nexport interface AnthropicToolCallContent {\n  type: 'tool_use';\n  id: string;\n  name: string;\n  input: unknown;\n  /**\n   * Present when this tool call was triggered by a server-executed tool\n   * (e.g., code execution calling a user-defined tool programmatically).\n   */\n  caller?: AnthropicToolCallCaller;\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport interface AnthropicServerToolUseContent {\n  type: 'server_tool_use';\n  id: string;\n  name:\n    | 'web_fetch'\n    | 'web_search'\n    // code execution 20250522:\n    | 'code_execution'\n    // code execution 20250825:\n    | 'bash_code_execution'\n    | 'text_editor_code_execution'\n    // tool search:\n    | 'tool_search_tool_regex'\n    | 'tool_search_tool_bm25'\n    // advisor:\n    | 'advisor';\n  input: unknown;\n  cache_control: AnthropicCacheControl | undefined;\n}\n\n// Nested content types for tool results (without cache_control)\n// Sub-content blocks cannot be cached directly according to Anthropic docs\ntype AnthropicNestedTextContent = Omit<\n  AnthropicTextContent,\n  'cache_control'\n> & {\n  cache_control?: never;\n};\n\ntype AnthropicNestedImageContent = Omit<\n  AnthropicImageContent,\n  'cache_control'\n> & {\n  cache_control?: never;\n};\n\ntype AnthropicNestedDocumentContent = Omit<\n  AnthropicDocumentContent,\n  'cache_control'\n> & {\n  cache_control?: never;\n};\n\nexport interface AnthropicToolReferenceContent {\n  type: 'tool_reference';\n  tool_name: string;\n}\n\nexport interface AnthropicToolResultContent {\n  type: 'tool_result';\n  tool_use_id: string;\n  content:\n    | string\n    | Array<\n        | AnthropicNestedTextContent\n        | AnthropicNestedImageContent\n        | AnthropicNestedDocumentContent\n        | AnthropicToolReferenceContent\n      >;\n  is_error: boolean | undefined;\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport interface AnthropicWebSearchToolResultContent {\n  type: 'web_search_tool_result';\n  tool_use_id: string;\n  content: Array<{\n    url: string;\n    title: string | null;\n    page_age: string | null;\n    encrypted_content: string;\n    type: string;\n  }>;\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport interface AnthropicToolSearchToolResultContent {\n  type: 'tool_search_tool_result';\n  tool_use_id: string;\n  content:\n    | {\n        type: 'tool_search_tool_search_result';\n        tool_references: Array<{\n          type: 'tool_reference';\n          tool_name: string;\n        }>;\n      }\n    | {\n        type: 'tool_search_tool_result_error';\n        error_code: string;\n      };\n  cache_control: AnthropicCacheControl | undefined;\n}\n\n// code execution results for code_execution_20250522 tool:\nexport interface AnthropicCodeExecutionToolResultContent {\n  type: 'code_execution_tool_result';\n  tool_use_id: string;\n  content:\n    | {\n        type: 'code_execution_result';\n        stdout: string;\n        stderr: string;\n        return_code: number;\n        content: Array<{ type: 'code_execution_output'; file_id: string }>;\n      }\n    | {\n        type: 'encrypted_code_execution_result';\n        encrypted_stdout: string;\n        stderr: string;\n        return_code: number;\n        content: Array<{ type: 'code_execution_output'; file_id: string }>;\n      }\n    | {\n        type: 'code_execution_tool_result_error';\n        error_code: string;\n      };\n  cache_control: AnthropicCacheControl | undefined;\n}\n\n// text editor code execution results for code_execution_20250825 tool:\nexport interface AnthropicTextEditorCodeExecutionToolResultContent {\n  type: 'text_editor_code_execution_tool_result';\n  tool_use_id: string;\n  content:\n    | {\n        type: 'text_editor_code_execution_tool_result_error';\n        error_code: string;\n      }\n    | {\n        type: 'text_editor_code_execution_create_result';\n        is_file_update: boolean;\n      }\n    | {\n        type: 'text_editor_code_execution_view_result';\n        content: string;\n        file_type: string;\n        num_lines: number | null;\n        start_line: number | null;\n        total_lines: number | null;\n      }\n    | {\n        type: 'text_editor_code_execution_str_replace_result';\n        lines: string[] | null;\n        new_lines: number | null;\n        new_start: number | null;\n        old_lines: number | null;\n        old_start: number | null;\n      };\n  cache_control: AnthropicCacheControl | undefined;\n}\n\n// bash code execution results for code_execution_20250825 tool:\nexport interface AnthropicBashCodeExecutionToolResultContent {\n  type: 'bash_code_execution_tool_result';\n  tool_use_id: string;\n  content:\n    | {\n        type: 'bash_code_execution_result';\n        stdout: string;\n        stderr: string;\n        return_code: number;\n        content: {\n          type: 'bash_code_execution_output';\n          file_id: string;\n        }[];\n      }\n    | {\n        type: 'bash_code_execution_tool_result_error';\n        error_code: string;\n      };\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport interface AnthropicAdvisorToolResultContent {\n  type: 'advisor_tool_result';\n  tool_use_id: string;\n  content:\n    | {\n        type: 'advisor_result';\n        text: string;\n      }\n    | {\n        type: 'advisor_redacted_result';\n        encrypted_content: string;\n      }\n    | {\n        type: 'advisor_tool_result_error';\n        /**\n         * Available options: `max_uses_exceeded`, `too_many_requests`,\n         * `overloaded`, `prompt_too_long`, `execution_time_exceeded`,\n         * `unavailable`.\n         */\n        error_code: string;\n      };\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport interface AnthropicWebFetchToolResultContent {\n  type: 'web_fetch_tool_result';\n  tool_use_id: string;\n  content:\n    | {\n        type: 'web_fetch_result';\n        url: string;\n        retrieved_at: string | null;\n        content: {\n          type: 'document';\n          title: string | null;\n          citations?: { enabled: boolean };\n          source:\n            | { type: 'base64'; media_type: 'application/pdf'; data: string }\n            | { type: 'text'; media_type: 'text/plain'; data: string };\n        };\n      }\n    | {\n        type: 'web_fetch_tool_result_error';\n        error_code: string;\n      };\n  cache_control: AnthropicCacheControl | undefined;\n}\nexport interface AnthropicMcpToolUseContent {\n  type: 'mcp_tool_use';\n  id: string;\n  name: string;\n  server_name: string;\n  input: unknown;\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport interface AnthropicMcpToolResultContent {\n  type: 'mcp_tool_result';\n  tool_use_id: string;\n  is_error: boolean;\n  content: string | Array<{ type: 'text'; text: string }>;\n  cache_control: AnthropicCacheControl | undefined;\n}\n\nexport type AnthropicTool =\n  | {\n      name: string;\n      description: string | undefined;\n      input_schema: JSONSchema7;\n      cache_control: AnthropicCacheControl | undefined;\n      eager_input_streaming?: boolean;\n      strict?: boolean;\n      /**\n       * When true, this tool is deferred and will only be loaded when\n       * discovered via the tool search tool.\n       */\n      defer_loading?: boolean;\n      /**\n       * Programmatic tool calling: specifies which server-executed tools\n       * are allowed to call this tool. When set, only the specified callers\n       * can invoke this tool programmatically.\n       *\n       * @example ['code_execution_20250825']\n       */\n      allowed_callers?: Array<\n        'direct' | 'code_execution_20250825' | 'code_execution_20260120'\n      >;\n    }\n  | {\n      type: 'code_execution_20250522';\n      name: string;\n      cache_control: AnthropicCacheControl | undefined;\n    }\n  | {\n      type: 'code_execution_20250825';\n      name: string;\n    }\n  | {\n      type: 'code_execution_20260120';\n      name: string;\n    }\n  | {\n      name: string;\n      type: 'computer_20250124' | 'computer_20241022';\n      display_width_px: number;\n      display_height_px: number;\n      display_number: number;\n      cache_control: AnthropicCacheControl | undefined;\n    }\n  | {\n      name: string;\n      type: 'computer_20251124';\n      display_width_px: number;\n      display_height_px: number;\n      display_number: number;\n      enable_zoom?: boolean;\n      cache_control: AnthropicCacheControl | undefined;\n    }\n  | {\n      name: string;\n      type:\n        | 'text_editor_20250124'\n        | 'text_editor_20241022'\n        | 'text_editor_20250429';\n      cache_control: AnthropicCacheControl | undefined;\n    }\n  | {\n      name: string;\n      type: 'text_editor_20250728';\n      max_characters?: number;\n      cache_control: AnthropicCacheControl | undefined;\n    }\n  | {\n      name: string;\n      type: 'bash_20250124' | 'bash_20241022';\n      cache_control: AnthropicCacheControl | undefined;\n    }\n  | {\n      name: string;\n      type: 'memory_20250818';\n    }\n  | {\n      type: 'web_fetch_20250910' | 'web_fetch_20260209';\n      name: string;\n      max_uses?: number;\n      allowed_domains?: string[];\n      blocked_domains?: string[];\n      citations?: { enabled: boolean };\n      max_content_tokens?: number;\n      cache_control: AnthropicCacheControl | undefined;\n    }\n  | {\n      type: 'web_search_20250305' | 'web_search_20260209';\n      name: string;\n      max_uses?: number;\n      allowed_domains?: string[];\n      blocked_domains?: string[];\n      user_location?: {\n        type: 'approximate';\n        city?: string;\n        region?: string;\n        country?: string;\n        timezone?: string;\n      };\n      cache_control: AnthropicCacheControl | undefined;\n    }\n  | {\n      type: 'tool_search_tool_regex_20251119';\n      name: string;\n    }\n  | {\n      type: 'tool_search_tool_bm25_20251119';\n      name: string;\n    }\n  | {\n      type: 'advisor_20260301';\n      name: 'advisor';\n      model: string;\n      max_uses?: number;\n      caching?: {\n        type: 'ephemeral';\n        ttl: '5m' | '1h';\n      };\n    };\n\nexport type AnthropicSpeed = 'fast' | 'standard';\n\nexport type AnthropicToolChoice =\n  | { type: 'auto' | 'any'; disable_parallel_tool_use?: boolean }\n  | { type: 'tool'; name: string; disable_parallel_tool_use?: boolean };\n\nexport type AnthropicContainer = {\n  id?: string | null;\n  skills?: Array<{\n    type: 'anthropic' | 'custom';\n    skill_id: string;\n    version?: string;\n  }> | null;\n};\n\nexport type AnthropicInputTokensTrigger = {\n  type: 'input_tokens';\n  value: number;\n};\n\nexport type AnthropicToolUsesTrigger = {\n  type: 'tool_uses';\n  value: number;\n};\n\nexport type AnthropicContextManagementTrigger =\n  | AnthropicInputTokensTrigger\n  | AnthropicToolUsesTrigger;\n\nexport type AnthropicClearToolUsesEdit = {\n  type: 'clear_tool_uses_20250919';\n  trigger?: AnthropicContextManagementTrigger;\n  keep?: {\n    type: 'tool_uses';\n    value: number;\n  };\n  clear_at_least?: {\n    type: 'input_tokens';\n    value: number;\n  };\n  clear_tool_inputs?: boolean;\n  exclude_tools?: string[];\n};\n\nexport type AnthropicClearThinkingBlockEdit = {\n  type: 'clear_thinking_20251015';\n  keep?: 'all' | { type: 'thinking_turns'; value: number };\n};\n\nexport type AnthropicCompactEdit = {\n  type: 'compact_20260112';\n  trigger?: AnthropicInputTokensTrigger;\n  pause_after_compaction?: boolean;\n  instructions?: string;\n};\n\nexport type AnthropicContextManagementEdit =\n  | AnthropicClearToolUsesEdit\n  | AnthropicClearThinkingBlockEdit\n  | AnthropicCompactEdit;\n\nexport type AnthropicContextManagementConfig = {\n  edits: AnthropicContextManagementEdit[];\n};\n\nexport type AnthropicResponseClearToolUsesEdit = {\n  type: 'clear_tool_uses_20250919';\n  cleared_tool_uses: number;\n  cleared_input_tokens: number;\n};\n\nexport type AnthropicResponseClearThinkingBlockEdit = {\n  type: 'clear_thinking_20251015';\n  cleared_thinking_turns: number;\n  cleared_input_tokens: number;\n};\n\nexport type AnthropicResponseCompactEdit = {\n  type: 'compact_20260112';\n};\n\nexport type AnthropicResponseContextManagementEdit =\n  | AnthropicResponseClearToolUsesEdit\n  | AnthropicResponseClearThinkingBlockEdit\n  | AnthropicResponseCompactEdit;\n\nexport type AnthropicResponseContextManagement = {\n  applied_edits: AnthropicResponseContextManagementEdit[];\n};\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nexport const anthropicMessagesResponseSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      type: z.literal('message'),\n      id: z.string().nullish(),\n      model: z.string().nullish(),\n      content: z.array(\n        z.discriminatedUnion('type', [\n          z.object({\n            type: z.literal('text'),\n            text: z.string(),\n            citations: z\n              .array(\n                z.discriminatedUnion('type', [\n                  z.object({\n                    type: z.literal('web_search_result_location'),\n                    cited_text: z.string(),\n                    url: z.string(),\n                    title: z.string(),\n                    encrypted_index: z.string(),\n                  }),\n                  z.object({\n                    type: z.literal('page_location'),\n                    cited_text: z.string(),\n                    document_index: z.number(),\n                    document_title: z.string().nullable(),\n                    start_page_number: z.number(),\n                    end_page_number: z.number(),\n                  }),\n                  z.object({\n                    type: z.literal('char_location'),\n                    cited_text: z.string(),\n                    document_index: z.number(),\n                    document_title: z.string().nullable(),\n                    start_char_index: z.number(),\n                    end_char_index: z.number(),\n                  }),\n                ]),\n              )\n              .optional(),\n          }),\n          z.object({\n            type: z.literal('thinking'),\n            thinking: z.string(),\n            signature: z.string(),\n          }),\n          z.object({\n            type: z.literal('redacted_thinking'),\n            data: z.string(),\n          }),\n          z.object({\n            type: z.literal('compaction'),\n            content: z.string(),\n          }),\n          z.object({\n            type: z.literal('tool_use'),\n            id: z.string(),\n            name: z.string(),\n            input: z.unknown(),\n            // Programmatic tool calling: caller info when triggered from code execution\n            caller: z\n              .union([\n                z.object({\n                  type: z.literal('code_execution_20250825'),\n                  tool_id: z.string(),\n                }),\n                z.object({\n                  type: z.literal('code_execution_20260120'),\n                  tool_id: z.string(),\n                }),\n                z.object({\n                  type: z.literal('direct'),\n                }),\n              ])\n              .optional(),\n          }),\n          z.object({\n            type: z.literal('server_tool_use'),\n            id: z.string(),\n            name: z.string(),\n            input: z.record(z.string(), z.unknown()).nullish(),\n            caller: z\n              .union([\n                z.object({\n                  type: z.literal('code_execution_20260120'),\n                  tool_id: z.string(),\n                }),\n                z.object({\n                  type: z.literal('direct'),\n                }),\n              ])\n              .optional(),\n          }),\n          z.object({\n            type: z.literal('mcp_tool_use'),\n            id: z.string(),\n            name: z.string(),\n            input: z.unknown(),\n            server_name: z.string(),\n          }),\n          z.object({\n            type: z.literal('mcp_tool_result'),\n            tool_use_id: z.string(),\n            is_error: z.boolean(),\n            content: z.array(\n              z.union([\n                z.string(),\n                z.object({ type: z.literal('text'), text: z.string() }),\n              ]),\n            ),\n          }),\n          z.object({\n            type: z.literal('web_fetch_tool_result'),\n            tool_use_id: z.string(),\n            content: z.union([\n              z.object({\n                type: z.literal('web_fetch_result'),\n                url: z.string(),\n                retrieved_at: z.string(),\n                content: z.object({\n                  type: z.literal('document'),\n                  title: z.string().nullable(),\n                  citations: z.object({ enabled: z.boolean() }).optional(),\n                  source: z.union([\n                    z.object({\n                      type: z.literal('base64'),\n                      media_type: z.literal('application/pdf'),\n                      data: z.string(),\n                    }),\n                    z.object({\n                      type: z.literal('text'),\n                      media_type: z.literal('text/plain'),\n                      data: z.string(),\n                    }),\n                  ]),\n                }),\n              }),\n              z.object({\n                type: z.literal('web_fetch_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          z.object({\n            type: z.literal('web_search_tool_result'),\n            tool_use_id: z.string(),\n            content: z.union([\n              z.array(\n                z.object({\n                  type: z.literal('web_search_result'),\n                  url: z.string(),\n                  title: z.string(),\n                  encrypted_content: z.string(),\n                  page_age: z.string().nullish(),\n                }),\n              ),\n              z.object({\n                type: z.literal('web_search_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          // code execution results for code_execution_20250522 tool:\n          z.object({\n            type: z.literal('code_execution_tool_result'),\n            tool_use_id: z.string(),\n            content: z.union([\n              z.object({\n                type: z.literal('code_execution_result'),\n                stdout: z.string(),\n                stderr: z.string(),\n                return_code: z.number(),\n                content: z\n                  .array(\n                    z.object({\n                      type: z.literal('code_execution_output'),\n                      file_id: z.string(),\n                    }),\n                  )\n                  .optional()\n                  .default([]),\n              }),\n              z.object({\n                type: z.literal('encrypted_code_execution_result'),\n                encrypted_stdout: z.string(),\n                stderr: z.string(),\n                return_code: z.number(),\n                content: z\n                  .array(\n                    z.object({\n                      type: z.literal('code_execution_output'),\n                      file_id: z.string(),\n                    }),\n                  )\n                  .optional()\n                  .default([]),\n              }),\n              z.object({\n                type: z.literal('code_execution_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          // bash code execution results for code_execution_20250825 tool:\n          z.object({\n            type: z.literal('bash_code_execution_tool_result'),\n            tool_use_id: z.string(),\n            content: z.discriminatedUnion('type', [\n              z.object({\n                type: z.literal('bash_code_execution_result'),\n                content: z.array(\n                  z.object({\n                    type: z.literal('bash_code_execution_output'),\n                    file_id: z.string(),\n                  }),\n                ),\n                stdout: z.string(),\n                stderr: z.string(),\n                return_code: z.number(),\n              }),\n              z.object({\n                type: z.literal('bash_code_execution_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          // text editor code execution results for code_execution_20250825 tool:\n          z.object({\n            type: z.literal('text_editor_code_execution_tool_result'),\n            tool_use_id: z.string(),\n            content: z.discriminatedUnion('type', [\n              z.object({\n                type: z.literal('text_editor_code_execution_tool_result_error'),\n                error_code: z.string(),\n              }),\n              z.object({\n                type: z.literal('text_editor_code_execution_view_result'),\n                content: z.string(),\n                file_type: z.string(),\n                num_lines: z.number().nullable(),\n                start_line: z.number().nullable(),\n                total_lines: z.number().nullable(),\n              }),\n              z.object({\n                type: z.literal('text_editor_code_execution_create_result'),\n                is_file_update: z.boolean(),\n              }),\n              z.object({\n                type: z.literal(\n                  'text_editor_code_execution_str_replace_result',\n                ),\n                lines: z.array(z.string()).nullable(),\n                new_lines: z.number().nullable(),\n                new_start: z.number().nullable(),\n                old_lines: z.number().nullable(),\n                old_start: z.number().nullable(),\n              }),\n            ]),\n          }),\n          // tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:\n          z.object({\n            type: z.literal('tool_search_tool_result'),\n            tool_use_id: z.string(),\n            content: z.union([\n              z.object({\n                type: z.literal('tool_search_tool_search_result'),\n                tool_references: z.array(\n                  z.object({\n                    type: z.literal('tool_reference'),\n                    tool_name: z.string(),\n                  }),\n                ),\n              }),\n              z.object({\n                type: z.literal('tool_search_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          // advisor results for advisor_20260301:\n          z.object({\n            type: z.literal('advisor_tool_result'),\n            tool_use_id: z.string(),\n            content: z.discriminatedUnion('type', [\n              z.object({\n                type: z.literal('advisor_result'),\n                text: z.string(),\n              }),\n              z.object({\n                type: z.literal('advisor_redacted_result'),\n                encrypted_content: z.string(),\n              }),\n              z.object({\n                type: z.literal('advisor_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n        ]),\n      ),\n      stop_reason: z.string().nullish(),\n      stop_sequence: z.string().nullish(),\n      usage: z.looseObject({\n        input_tokens: z.number(),\n        output_tokens: z.number(),\n        cache_creation_input_tokens: z.number().nullish(),\n        cache_read_input_tokens: z.number().nullish(),\n        iterations: z\n          .array(\n            z.union([\n              z.object({\n                type: z.union([z.literal('compaction'), z.literal('message')]),\n                input_tokens: z.number(),\n                output_tokens: z.number(),\n                cache_creation_input_tokens: z.number().nullish(),\n                cache_read_input_tokens: z.number().nullish(),\n              }),\n              z.object({\n                type: z.literal('advisor_message'),\n                model: z.string(),\n                input_tokens: z.number(),\n                output_tokens: z.number(),\n                cache_creation_input_tokens: z.number().nullish(),\n                cache_read_input_tokens: z.number().nullish(),\n              }),\n            ]),\n          )\n          .nullish(),\n      }),\n      container: z\n        .object({\n          expires_at: z.string(),\n          id: z.string(),\n          skills: z\n            .array(\n              z.object({\n                type: z.union([z.literal('anthropic'), z.literal('custom')]),\n                skill_id: z.string(),\n                version: z.string(),\n              }),\n            )\n            .nullish(),\n        })\n        .nullish(),\n      context_management: z\n        .object({\n          applied_edits: z.array(\n            z.union([\n              z.object({\n                type: z.literal('clear_tool_uses_20250919'),\n                cleared_tool_uses: z.number(),\n                cleared_input_tokens: z.number(),\n              }),\n              z.object({\n                type: z.literal('clear_thinking_20251015'),\n                cleared_thinking_turns: z.number(),\n                cleared_input_tokens: z.number(),\n              }),\n              z.object({\n                type: z.literal('compact_20260112'),\n              }),\n            ]),\n          ),\n        })\n        .nullish(),\n    }),\n  ),\n);\n\n// limited version of the schema, focused on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nexport const anthropicMessagesChunkSchema = lazySchema(() =>\n  zodSchema(\n    z.discriminatedUnion('type', [\n      z.object({\n        type: z.literal('message_start'),\n        message: z.object({\n          id: z.string().nullish(),\n          model: z.string().nullish(),\n          role: z.string().nullish(),\n          usage: z.looseObject({\n            input_tokens: z.number(),\n            cache_creation_input_tokens: z.number().nullish(),\n            cache_read_input_tokens: z.number().nullish(),\n          }),\n          // Programmatic tool calling: content may be pre-populated for deferred tool calls\n          content: z\n            .array(\n              z.discriminatedUnion('type', [\n                z.object({\n                  type: z.literal('tool_use'),\n                  id: z.string(),\n                  name: z.string(),\n                  input: z.unknown(),\n                  caller: z\n                    .union([\n                      z.object({\n                        type: z.literal('code_execution_20250825'),\n                        tool_id: z.string(),\n                      }),\n                      z.object({\n                        type: z.literal('code_execution_20260120'),\n                        tool_id: z.string(),\n                      }),\n                      z.object({\n                        type: z.literal('direct'),\n                      }),\n                    ])\n                    .optional(),\n                }),\n              ]),\n            )\n            .nullish(),\n          stop_reason: z.string().nullish(),\n          container: z\n            .object({\n              expires_at: z.string(),\n              id: z.string(),\n            })\n            .nullish(),\n        }),\n      }),\n      z.object({\n        type: z.literal('content_block_start'),\n        index: z.number(),\n        content_block: z.discriminatedUnion('type', [\n          z.object({\n            type: z.literal('text'),\n            text: z.string(),\n          }),\n          z.object({\n            type: z.literal('thinking'),\n            thinking: z.string(),\n          }),\n          z.object({\n            type: z.literal('tool_use'),\n            id: z.string(),\n            name: z.string(),\n            // Programmatic tool calling: input may be present directly for deferred tool calls\n            input: z.record(z.string(), z.unknown()).optional(),\n            // Programmatic tool calling: caller info when triggered from code execution\n            caller: z\n              .union([\n                z.object({\n                  type: z.literal('code_execution_20250825'),\n                  tool_id: z.string(),\n                }),\n                z.object({\n                  type: z.literal('code_execution_20260120'),\n                  tool_id: z.string(),\n                }),\n                z.object({\n                  type: z.literal('direct'),\n                }),\n              ])\n              .optional(),\n          }),\n          z.object({\n            type: z.literal('redacted_thinking'),\n            data: z.string(),\n          }),\n          z.object({\n            type: z.literal('compaction'),\n            content: z.string().nullish(),\n          }),\n          z.object({\n            type: z.literal('server_tool_use'),\n            id: z.string(),\n            name: z.string(),\n            input: z.record(z.string(), z.unknown()).nullish(),\n            caller: z\n              .union([\n                z.object({\n                  type: z.literal('code_execution_20260120'),\n                  tool_id: z.string(),\n                }),\n                z.object({\n                  type: z.literal('direct'),\n                }),\n              ])\n              .optional(),\n          }),\n          z.object({\n            type: z.literal('mcp_tool_use'),\n            id: z.string(),\n            name: z.string(),\n            input: z.unknown(),\n            server_name: z.string(),\n          }),\n          z.object({\n            type: z.literal('mcp_tool_result'),\n            tool_use_id: z.string(),\n            is_error: z.boolean(),\n            content: z.array(\n              z.union([\n                z.string(),\n                z.object({ type: z.literal('text'), text: z.string() }),\n              ]),\n            ),\n          }),\n          z.object({\n            type: z.literal('web_fetch_tool_result'),\n            tool_use_id: z.string(),\n            content: z.union([\n              z.object({\n                type: z.literal('web_fetch_result'),\n                url: z.string(),\n                retrieved_at: z.string(),\n                content: z.object({\n                  type: z.literal('document'),\n                  title: z.string().nullable(),\n                  citations: z.object({ enabled: z.boolean() }).optional(),\n                  source: z.union([\n                    z.object({\n                      type: z.literal('base64'),\n                      media_type: z.literal('application/pdf'),\n                      data: z.string(),\n                    }),\n                    z.object({\n                      type: z.literal('text'),\n                      media_type: z.literal('text/plain'),\n                      data: z.string(),\n                    }),\n                  ]),\n                }),\n              }),\n              z.object({\n                type: z.literal('web_fetch_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          z.object({\n            type: z.literal('web_search_tool_result'),\n            tool_use_id: z.string(),\n            content: z.union([\n              z.array(\n                z.object({\n                  type: z.literal('web_search_result'),\n                  url: z.string(),\n                  title: z.string(),\n                  encrypted_content: z.string(),\n                  page_age: z.string().nullish(),\n                }),\n              ),\n              z.object({\n                type: z.literal('web_search_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          // code execution results for code_execution_20250522 tool:\n          z.object({\n            type: z.literal('code_execution_tool_result'),\n            tool_use_id: z.string(),\n            content: z.union([\n              z.object({\n                type: z.literal('code_execution_result'),\n                stdout: z.string(),\n                stderr: z.string(),\n                return_code: z.number(),\n                content: z\n                  .array(\n                    z.object({\n                      type: z.literal('code_execution_output'),\n                      file_id: z.string(),\n                    }),\n                  )\n                  .optional()\n                  .default([]),\n              }),\n              z.object({\n                type: z.literal('encrypted_code_execution_result'),\n                encrypted_stdout: z.string(),\n                stderr: z.string(),\n                return_code: z.number(),\n                content: z\n                  .array(\n                    z.object({\n                      type: z.literal('code_execution_output'),\n                      file_id: z.string(),\n                    }),\n                  )\n                  .optional()\n                  .default([]),\n              }),\n              z.object({\n                type: z.literal('code_execution_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          // bash code execution results for code_execution_20250825 tool:\n          z.object({\n            type: z.literal('bash_code_execution_tool_result'),\n            tool_use_id: z.string(),\n            content: z.discriminatedUnion('type', [\n              z.object({\n                type: z.literal('bash_code_execution_result'),\n                content: z.array(\n                  z.object({\n                    type: z.literal('bash_code_execution_output'),\n                    file_id: z.string(),\n                  }),\n                ),\n                stdout: z.string(),\n                stderr: z.string(),\n                return_code: z.number(),\n              }),\n              z.object({\n                type: z.literal('bash_code_execution_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          // text editor code execution results for code_execution_20250825 tool:\n          z.object({\n            type: z.literal('text_editor_code_execution_tool_result'),\n            tool_use_id: z.string(),\n            content: z.discriminatedUnion('type', [\n              z.object({\n                type: z.literal('text_editor_code_execution_tool_result_error'),\n                error_code: z.string(),\n              }),\n              z.object({\n                type: z.literal('text_editor_code_execution_view_result'),\n                content: z.string(),\n                file_type: z.string(),\n                num_lines: z.number().nullable(),\n                start_line: z.number().nullable(),\n                total_lines: z.number().nullable(),\n              }),\n              z.object({\n                type: z.literal('text_editor_code_execution_create_result'),\n                is_file_update: z.boolean(),\n              }),\n              z.object({\n                type: z.literal(\n                  'text_editor_code_execution_str_replace_result',\n                ),\n                lines: z.array(z.string()).nullable(),\n                new_lines: z.number().nullable(),\n                new_start: z.number().nullable(),\n                old_lines: z.number().nullable(),\n                old_start: z.number().nullable(),\n              }),\n            ]),\n          }),\n          // tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:\n          z.object({\n            type: z.literal('tool_search_tool_result'),\n            tool_use_id: z.string(),\n            content: z.union([\n              z.object({\n                type: z.literal('tool_search_tool_search_result'),\n                tool_references: z.array(\n                  z.object({\n                    type: z.literal('tool_reference'),\n                    tool_name: z.string(),\n                  }),\n                ),\n              }),\n              z.object({\n                type: z.literal('tool_search_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n          // advisor results for advisor_20260301:\n          z.object({\n            type: z.literal('advisor_tool_result'),\n            tool_use_id: z.string(),\n            content: z.discriminatedUnion('type', [\n              z.object({\n                type: z.literal('advisor_result'),\n                text: z.string(),\n              }),\n              z.object({\n                type: z.literal('advisor_redacted_result'),\n                encrypted_content: z.string(),\n              }),\n              z.object({\n                type: z.literal('advisor_tool_result_error'),\n                error_code: z.string(),\n              }),\n            ]),\n          }),\n        ]),\n      }),\n      z.object({\n        type: z.literal('content_block_delta'),\n        index: z.number(),\n        delta: z.discriminatedUnion('type', [\n          z.object({\n            type: z.literal('input_json_delta'),\n            partial_json: z.string(),\n          }),\n          z.object({\n            type: z.literal('text_delta'),\n            text: z.string(),\n          }),\n          z.object({\n            type: z.literal('thinking_delta'),\n            thinking: z.string(),\n          }),\n          z.object({\n            type: z.literal('signature_delta'),\n            signature: z.string(),\n          }),\n          z.object({\n            type: z.literal('compaction_delta'),\n            content: z.string().nullish(),\n          }),\n          z.object({\n            type: z.literal('citations_delta'),\n            citation: z.discriminatedUnion('type', [\n              z.object({\n                type: z.literal('web_search_result_location'),\n                cited_text: z.string(),\n                url: z.string(),\n                title: z.string(),\n                encrypted_index: z.string(),\n              }),\n              z.object({\n                type: z.literal('page_location'),\n                cited_text: z.string(),\n                document_index: z.number(),\n                document_title: z.string().nullable(),\n                start_page_number: z.number(),\n                end_page_number: z.number(),\n              }),\n              z.object({\n                type: z.literal('char_location'),\n                cited_text: z.string(),\n                document_index: z.number(),\n                document_title: z.string().nullable(),\n                start_char_index: z.number(),\n                end_char_index: z.number(),\n              }),\n            ]),\n          }),\n        ]),\n      }),\n      z.object({\n        type: z.literal('content_block_stop'),\n        index: z.number(),\n      }),\n      z.object({\n        type: z.literal('error'),\n        error: z.object({\n          type: z.string(),\n          message: z.string(),\n        }),\n      }),\n      z.object({\n        type: z.literal('message_delta'),\n        delta: z.object({\n          stop_reason: z.string().nullish(),\n          stop_sequence: z.string().nullish(),\n          container: z\n            .object({\n              expires_at: z.string(),\n              id: z.string(),\n              skills: z\n                .array(\n                  z.object({\n                    type: z.union([\n                      z.literal('anthropic'),\n                      z.literal('custom'),\n                    ]),\n                    skill_id: z.string(),\n                    version: z.string(),\n                  }),\n                )\n                .nullish(),\n            })\n            .nullish(),\n        }),\n        usage: z.looseObject({\n          input_tokens: z.number().nullish(),\n          output_tokens: z.number(),\n          cache_creation_input_tokens: z.number().nullish(),\n          cache_read_input_tokens: z.number().nullish(),\n          iterations: z\n            .array(\n              z.union([\n                z.object({\n                  type: z.union([\n                    z.literal('compaction'),\n                    z.literal('message'),\n                  ]),\n                  input_tokens: z.number(),\n                  output_tokens: z.number(),\n                  cache_creation_input_tokens: z.number().nullish(),\n                  cache_read_input_tokens: z.number().nullish(),\n                }),\n                z.object({\n                  type: z.literal('advisor_message'),\n                  model: z.string(),\n                  input_tokens: z.number(),\n                  output_tokens: z.number(),\n                  cache_creation_input_tokens: z.number().nullish(),\n                  cache_read_input_tokens: z.number().nullish(),\n                }),\n              ]),\n            )\n            .nullish(),\n        }),\n        context_management: z\n          .object({\n            applied_edits: z.array(\n              z.union([\n                z.object({\n                  type: z.literal('clear_tool_uses_20250919'),\n                  cleared_tool_uses: z.number(),\n                  cleared_input_tokens: z.number(),\n                }),\n                z.object({\n                  type: z.literal('clear_thinking_20251015'),\n                  cleared_thinking_turns: z.number(),\n                  cleared_input_tokens: z.number(),\n                }),\n                z.object({\n                  type: z.literal('compact_20260112'),\n                }),\n              ]),\n            ),\n          })\n          .nullish(),\n      }),\n      z.object({\n        type: z.literal('message_stop'),\n      }),\n      z.object({\n        type: z.literal('ping'),\n      }),\n    ]),\n  ),\n);\n\nexport const anthropicReasoningMetadataSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      signature: z.string().optional(),\n      redactedData: z.string().optional(),\n    }),\n  ),\n);\n\nexport type AnthropicReasoningMetadata = InferSchema<\n  typeof anthropicReasoningMetadataSchema\n>;\n\nexport type Citation = NonNullable<\n  (InferSchema<typeof anthropicMessagesResponseSchema>['content'][number] & {\n    type: 'text';\n  })['citations']\n>[number];\n","import { z } from 'zod/v4';\n\n// https://docs.claude.com/en/docs/about-claude/models/overview\nexport type AnthropicMessagesModelId =\n  | 'claude-3-haiku-20240307'\n  | 'claude-haiku-4-5-20251001'\n  | 'claude-haiku-4-5'\n  | 'claude-opus-4-0'\n  | 'claude-opus-4-20250514'\n  | 'claude-opus-4-1-20250805'\n  | 'claude-opus-4-1'\n  | 'claude-opus-4-5'\n  | 'claude-opus-4-5-20251101'\n  | 'claude-sonnet-4-0'\n  | 'claude-sonnet-4-20250514'\n  | 'claude-sonnet-4-5-20250929'\n  | 'claude-sonnet-4-5'\n  | 'claude-sonnet-4-6'\n  | 'claude-opus-4-6'\n  | 'claude-opus-4-7'\n  | (string & {});\n\n/**\n * Anthropic file part provider options for document-specific features.\n * These options apply to individual file parts (documents).\n */\nexport const anthropicFilePartProviderOptions = z.object({\n  /**\n   * Citation configuration for this document.\n   * When enabled, this document will generate citations in the response.\n   */\n  citations: z\n    .object({\n      /**\n       * Enable citations for this document\n       */\n      enabled: z.boolean(),\n    })\n    .optional(),\n\n  /**\n   * Custom title for the document.\n   * If not provided, the filename will be used.\n   */\n  title: z.string().optional(),\n\n  /**\n   * Context about the document that will be passed to the model\n   * but not used towards cited content.\n   * Useful for storing document metadata as text or stringified JSON.\n   */\n  context: z.string().optional(),\n});\n\nexport type AnthropicFilePartProviderOptions = z.infer<\n  typeof anthropicFilePartProviderOptions\n>;\n\nexport const anthropicLanguageModelOptions = z.object({\n  /**\n   * Whether to send reasoning to the model.\n   *\n   * This allows you to deactivate reasoning inputs for models that do not support them.\n   */\n  sendReasoning: z.boolean().optional(),\n\n  /**\n   * Determines how structured outputs are generated.\n   *\n   * - `outputFormat`: Use the `output_config.format` parameter to specify the structured output format.\n   * - `jsonTool`: Use a special 'json' tool to specify the structured output format.\n   * - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).\n   */\n  structuredOutputMode: z.enum(['outputFormat', 'jsonTool', 'auto']).optional(),\n\n  /**\n   * Configuration for enabling Claude's extended thinking.\n   *\n   * When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.\n   * Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.\n   */\n  thinking: z\n    .discriminatedUnion('type', [\n      z.object({\n        /** for Sonnet 4.6, Opus 4.6, and newer models */\n        type: z.literal('adaptive'),\n        /**\n         * Controls whether thinking content is included in the response.\n         * - `\"omitted\"`: Thinking blocks are present but text is empty (default for Opus 4.7+).\n         * - `\"summarized\"`: Thinking content is returned. Required to see reasoning output.\n         */\n        display: z.enum(['omitted', 'summarized']).optional(),\n      }),\n      z.object({\n        /** for models before Opus 4.6, except Sonnet 4.6 still supports it */\n        type: z.literal('enabled'),\n        budgetTokens: z.number().optional(),\n      }),\n      z.object({\n        type: z.literal('disabled'),\n      }),\n    ])\n    .optional(),\n\n  /**\n   * Whether to disable parallel function calling during tool use. Default is false.\n   * When set to true, Claude will use at most one tool per response.\n   */\n  disableParallelToolUse: z.boolean().optional(),\n\n  /**\n   * Cache control settings for this message.\n   * See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching\n   */\n  cacheControl: z\n    .object({\n      type: z.literal('ephemeral'),\n      ttl: z.union([z.literal('5m'), z.literal('1h')]).optional(),\n    })\n    .optional(),\n\n  /**\n   * Metadata to include with the request.\n   *\n   * See https://platform.claude.com/docs/en/api/messages/create for details.\n   */\n  metadata: z\n    .object({\n      /**\n       * An external identifier for the user associated with the request.\n       *\n       * Should be a UUID, hash value, or other opaque identifier.\n       * Must not contain PII (name, email, phone number, etc.).\n       */\n      userId: z.string().optional(),\n    })\n    .optional(),\n\n  /**\n   * MCP servers to be utilized in this request.\n   */\n  mcpServers: z\n    .array(\n      z.object({\n        type: z.literal('url'),\n        name: z.string(),\n        url: z.string(),\n        authorizationToken: z.string().nullish(),\n        toolConfiguration: z\n          .object({\n            enabled: z.boolean().nullish(),\n            allowedTools: z.array(z.string()).nullish(),\n          })\n          .nullish(),\n      }),\n    )\n    .optional(),\n\n  /**\n   * Agent Skills configuration. Skills enable Claude to perform specialized tasks\n   * like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.\n   * Requires code execution tool to be enabled.\n   */\n  container: z\n    .object({\n      id: z.string().optional(),\n      skills: z\n        .array(\n          z.object({\n            type: z.union([z.literal('anthropic'), z.literal('custom')]),\n            skillId: z.string(),\n            version: z.string().optional(),\n          }),\n        )\n        .optional(),\n    })\n    .optional(),\n\n  /**\n   * Whether to enable fine-grained (eager) streaming of tool call inputs\n   * and structured outputs for every function tool in the request. When\n   * true (the default), each function tool receives a default of\n   * `eager_input_streaming: true` unless it explicitly sets\n   * `providerOptions.anthropic.eagerInputStreaming`.\n   *\n   * @default true\n   */\n  toolStreaming: z.boolean().optional(),\n\n  /**\n   * @default 'high'\n   */\n  effort: z.enum(['low', 'medium', 'high', 'xhigh', 'max']).optional(),\n\n  /**\n   * Task budget for agentic turns. Informs the model of the total token budget\n   * available for the current task, allowing it to prioritize work and wind down\n   * gracefully as the budget is consumed.\n   *\n   * Advisory only — does not enforce a hard token limit.\n   */\n  taskBudget: z\n    .object({\n      type: z.literal('tokens'),\n      total: z.number().int().min(20000),\n      remaining: z.number().int().min(0).optional(),\n    })\n    .optional(),\n\n  /**\n   * Enable fast mode for faster inference (2.5x faster output token speeds).\n   * Only supported with claude-opus-4-6.\n   */\n  speed: z.enum(['fast', 'standard']).optional(),\n\n  /**\n   * Controls where model inference runs for this request.\n   *\n   * - `\"global\"`: Inference may run in any available geography (default).\n   * - `\"us\"`: Inference runs only in US-based infrastructure.\n   *\n   * See https://platform.claude.com/docs/en/build-with-claude/data-residency\n   */\n  inferenceGeo: z.enum(['us', 'global']).optional(),\n\n  /**\n   * A set of beta features to enable.\n   * Allow a provider to receive the full `betas` set if it needs it.\n   */\n  anthropicBeta: z.array(z.string()).optional(),\n\n  contextManagement: z\n    .object({\n      edits: z.array(\n        z.discriminatedUnion('type', [\n          z.object({\n            type: z.literal('clear_tool_uses_20250919'),\n            trigger: z\n              .discriminatedUnion('type', [\n                z.object({\n                  type: z.literal('input_tokens'),\n                  value: z.number(),\n                }),\n                z.object({\n                  type: z.literal('tool_uses'),\n                  value: z.number(),\n                }),\n              ])\n              .optional(),\n            keep: z\n              .object({\n                type: z.literal('tool_uses'),\n                value: z.number(),\n              })\n              .optional(),\n            clearAtLeast: z\n              .object({\n                type: z.literal('input_tokens'),\n                value: z.number(),\n              })\n              .optional(),\n            clearToolInputs: z.boolean().optional(),\n            excludeTools: z.array(z.string()).optional(),\n          }),\n          z.object({\n            type: z.literal('clear_thinking_20251015'),\n            keep: z\n              .union([\n                z.literal('all'),\n                z.object({\n                  type: z.literal('thinking_turns'),\n                  value: z.number(),\n                }),\n              ])\n              .optional(),\n          }),\n          z.object({\n            type: z.literal('compact_20260112'),\n            trigger: z\n              .object({\n                type: z.literal('input_tokens'),\n                value: z.number(),\n              })\n              .optional(),\n            pauseAfterCompaction: z.boolean().optional(),\n            instructions: z.string().optional(),\n          }),\n        ]),\n      ),\n    })\n    .optional(),\n});\n\nexport type AnthropicLanguageModelOptions = z.infer<\n  typeof anthropicLanguageModelOptions\n>;\n","import {\n  UnsupportedFunctionalityError,\n  type LanguageModelV3CallOptions,\n  type SharedV3Warning,\n} from '@ai-sdk/provider';\nimport type {\n  AnthropicTool,\n  AnthropicToolChoice,\n} from './anthropic-messages-api';\nimport { CacheControlValidator } from './get-cache-control';\nimport { advisor_20260301ArgsSchema } from './tool/advisor_20260301';\nimport { textEditor_20250728ArgsSchema } from './tool/text-editor_20250728';\nimport { webSearch_20260209ArgsSchema } from './tool/web-search_20260209';\nimport { webSearch_20250305ArgsSchema } from './tool/web-search_20250305';\nimport { webFetch_20260209ArgsSchema } from './tool/web-fetch-20260209';\nimport { webFetch_20250910ArgsSchema } from './tool/web-fetch-20250910';\nimport { validateTypes } from '@ai-sdk/provider-utils';\n\nexport interface AnthropicToolOptions {\n  deferLoading?: boolean;\n  allowedCallers?: Array<\n    'direct' | 'code_execution_20250825' | 'code_execution_20260120'\n  >;\n  eagerInputStreaming?: boolean;\n}\n\nexport async function prepareTools({\n  tools,\n  toolChoice,\n  disableParallelToolUse,\n  cacheControlValidator,\n  supportsStructuredOutput,\n  supportsStrictTools,\n  defaultEagerInputStreaming = false,\n}: {\n  tools: LanguageModelV3CallOptions['tools'];\n  toolChoice: LanguageModelV3CallOptions['toolChoice'] | undefined;\n  disableParallelToolUse?: boolean;\n  cacheControlValidator?: CacheControlValidator;\n\n  /**\n   * Whether the model supports native structured output response format.\n   */\n  supportsStructuredOutput: boolean;\n\n  /**\n   * Whether the model supports strict mode on tool definitions.\n   */\n  supportsStrictTools: boolean;\n\n  /**\n   * Default for `eager_input_streaming` on function tools that do not set\n   * it explicitly. Driven by the model-level `toolStreaming` option.\n   */\n  defaultEagerInputStreaming?: boolean;\n}): Promise<{\n  tools: Array<AnthropicTool> | undefined;\n  toolChoice: AnthropicToolChoice | undefined;\n  toolWarnings: SharedV3Warning[];\n  betas: Set<string>;\n}> {\n  // when the tools array is empty, change it to undefined to prevent errors:\n  tools = tools?.length ? tools : undefined;\n\n  const toolWarnings: SharedV3Warning[] = [];\n  const betas = new Set<string>();\n  const validator = cacheControlValidator || new CacheControlValidator();\n\n  if (tools == null) {\n    return { tools: undefined, toolChoice: undefined, toolWarnings, betas };\n  }\n\n  const anthropicTools: AnthropicTool[] = [];\n\n  for (const tool of tools) {\n    switch (tool.type) {\n      case 'function': {\n        const cacheControl = validator.getCacheControl(tool.providerOptions, {\n          type: 'tool definition',\n          canCache: true,\n        });\n\n        // Read Anthropic-specific provider options\n        const anthropicOptions = tool.providerOptions?.anthropic as\n          | AnthropicToolOptions\n          | undefined;\n        // eager_input_streaming is only supported on custom (function) tools.\n        // Fall back to the model-level default when the tool doesn't set it.\n        const eagerInputStreaming =\n          anthropicOptions?.eagerInputStreaming ?? defaultEagerInputStreaming;\n        const deferLoading = anthropicOptions?.deferLoading;\n        const allowedCallers = anthropicOptions?.allowedCallers;\n\n        if (!supportsStrictTools && tool.strict != null) {\n          toolWarnings.push({\n            type: 'unsupported',\n            feature: 'strict',\n            details: `Tool '${tool.name}' has strict: ${tool.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`,\n          });\n        }\n\n        anthropicTools.push({\n          name: tool.name,\n          description: tool.description,\n          input_schema: tool.inputSchema,\n          cache_control: cacheControl,\n          ...(eagerInputStreaming ? { eager_input_streaming: true } : {}),\n          ...(supportsStrictTools === true && tool.strict != null\n            ? { strict: tool.strict }\n            : {}),\n          ...(deferLoading != null ? { defer_loading: deferLoading } : {}),\n          ...(allowedCallers != null\n            ? { allowed_callers: allowedCallers }\n            : {}),\n          ...(tool.inputExamples != null\n            ? {\n                input_examples: tool.inputExamples.map(\n                  example => example.input,\n                ),\n              }\n            : {}),\n        });\n\n        if (supportsStructuredOutput === true) {\n          betas.add('structured-outputs-2025-11-13');\n        }\n\n        if (tool.inputExamples != null || allowedCallers != null) {\n          betas.add('advanced-tool-use-2025-11-20');\n        }\n\n        break;\n      }\n\n      case 'provider': {\n        // Note: Provider-defined tools don't currently support providerOptions in the SDK,\n        // so cache_control cannot be set on them. The Anthropic API supports caching all tools,\n        // but the SDK would need to be updated to expose providerOptions on provider-defined tools.\n        switch (tool.id) {\n          case 'anthropic.code_execution_20250522': {\n            betas.add('code-execution-2025-05-22');\n            anthropicTools.push({\n              type: 'code_execution_20250522',\n              name: 'code_execution',\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.code_execution_20250825': {\n            betas.add('code-execution-2025-08-25');\n            anthropicTools.push({\n              type: 'code_execution_20250825',\n              name: 'code_execution',\n            });\n            break;\n          }\n          case 'anthropic.code_execution_20260120': {\n            anthropicTools.push({\n              type: 'code_execution_20260120',\n              name: 'code_execution',\n            });\n            break;\n          }\n          case 'anthropic.computer_20250124': {\n            betas.add('computer-use-2025-01-24');\n            anthropicTools.push({\n              name: 'computer',\n              type: 'computer_20250124',\n              display_width_px: tool.args.displayWidthPx as number,\n              display_height_px: tool.args.displayHeightPx as number,\n              display_number: tool.args.displayNumber as number,\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.computer_20251124': {\n            betas.add('computer-use-2025-11-24');\n            anthropicTools.push({\n              name: 'computer',\n              type: 'computer_20251124',\n              display_width_px: tool.args.displayWidthPx as number,\n              display_height_px: tool.args.displayHeightPx as number,\n              display_number: tool.args.displayNumber as number,\n              enable_zoom: tool.args.enableZoom as boolean,\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.computer_20241022': {\n            betas.add('computer-use-2024-10-22');\n            anthropicTools.push({\n              name: 'computer',\n              type: 'computer_20241022',\n              display_width_px: tool.args.displayWidthPx as number,\n              display_height_px: tool.args.displayHeightPx as number,\n              display_number: tool.args.displayNumber as number,\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.text_editor_20250124': {\n            betas.add('computer-use-2025-01-24');\n            anthropicTools.push({\n              name: 'str_replace_editor',\n              type: 'text_editor_20250124',\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.text_editor_20241022': {\n            betas.add('computer-use-2024-10-22');\n            anthropicTools.push({\n              name: 'str_replace_editor',\n              type: 'text_editor_20241022',\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.text_editor_20250429': {\n            betas.add('computer-use-2025-01-24');\n            anthropicTools.push({\n              name: 'str_replace_based_edit_tool',\n              type: 'text_editor_20250429',\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.text_editor_20250728': {\n            const args = await validateTypes({\n              value: tool.args,\n              schema: textEditor_20250728ArgsSchema,\n            });\n            anthropicTools.push({\n              name: 'str_replace_based_edit_tool',\n              type: 'text_editor_20250728',\n              max_characters: args.maxCharacters,\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.bash_20250124': {\n            betas.add('computer-use-2025-01-24');\n            anthropicTools.push({\n              name: 'bash',\n              type: 'bash_20250124',\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.bash_20241022': {\n            betas.add('computer-use-2024-10-22');\n            anthropicTools.push({\n              name: 'bash',\n              type: 'bash_20241022',\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.memory_20250818': {\n            betas.add('context-management-2025-06-27');\n            anthropicTools.push({\n              name: 'memory',\n              type: 'memory_20250818',\n            });\n            break;\n          }\n          case 'anthropic.web_fetch_20250910': {\n            betas.add('web-fetch-2025-09-10');\n            const args = await validateTypes({\n              value: tool.args,\n              schema: webFetch_20250910ArgsSchema,\n            });\n            anthropicTools.push({\n              type: 'web_fetch_20250910',\n              name: 'web_fetch',\n              max_uses: args.maxUses,\n              allowed_domains: args.allowedDomains,\n              blocked_domains: args.blockedDomains,\n              citations: args.citations,\n              max_content_tokens: args.maxContentTokens,\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.web_fetch_20260209': {\n            betas.add('code-execution-web-tools-2026-02-09');\n            const args = await validateTypes({\n              value: tool.args,\n              schema: webFetch_20260209ArgsSchema,\n            });\n            anthropicTools.push({\n              type: 'web_fetch_20260209',\n              name: 'web_fetch',\n              max_uses: args.maxUses,\n              allowed_domains: args.allowedDomains,\n              blocked_domains: args.blockedDomains,\n              citations: args.citations,\n              max_content_tokens: args.maxContentTokens,\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.web_search_20250305': {\n            const args = await validateTypes({\n              value: tool.args,\n              schema: webSearch_20250305ArgsSchema,\n            });\n            anthropicTools.push({\n              type: 'web_search_20250305',\n              name: 'web_search',\n              max_uses: args.maxUses,\n              allowed_domains: args.allowedDomains,\n              blocked_domains: args.blockedDomains,\n              user_location: args.userLocation,\n              cache_control: undefined,\n            });\n            break;\n          }\n          case 'anthropic.web_search_20260209': {\n            betas.add('code-execution-web-tools-2026-02-09');\n            const args = await validateTypes({\n              value: tool.args,\n              schema: webSearch_20260209ArgsSchema,\n            });\n            anthropicTools.push({\n              type: 'web_search_20260209',\n              name: 'web_search',\n              max_uses: args.maxUses,\n              allowed_domains: args.allowedDomains,\n              blocked_domains: args.blockedDomains,\n              user_location: args.userLocation,\n              cache_control: undefined,\n            });\n            break;\n          }\n\n          case 'anthropic.tool_search_regex_20251119': {\n            anthropicTools.push({\n              type: 'tool_search_tool_regex_20251119',\n              name: 'tool_search_tool_regex',\n            });\n            break;\n          }\n\n          case 'anthropic.tool_search_bm25_20251119': {\n            anthropicTools.push({\n              type: 'tool_search_tool_bm25_20251119',\n              name: 'tool_search_tool_bm25',\n            });\n            break;\n          }\n\n          case 'anthropic.advisor_20260301': {\n            betas.add('advisor-tool-2026-03-01');\n            const args = await validateTypes({\n              value: tool.args,\n              schema: advisor_20260301ArgsSchema,\n            });\n            anthropicTools.push({\n              type: 'advisor_20260301',\n              name: 'advisor',\n              model: args.model,\n              ...(args.maxUses !== undefined && { max_uses: args.maxUses }),\n              ...(args.caching !== undefined && { caching: args.caching }),\n            });\n            break;\n          }\n\n          default: {\n            toolWarnings.push({\n              type: 'unsupported',\n              feature: `provider-defined tool ${tool.id}`,\n            });\n            break;\n          }\n        }\n        break;\n      }\n\n      default: {\n        toolWarnings.push({\n          type: 'unsupported',\n          feature: `tool ${tool}`,\n        });\n        break;\n      }\n    }\n  }\n\n  if (toolChoice == null) {\n    return {\n      tools: anthropicTools,\n      toolChoice: disableParallelToolUse\n        ? { type: 'auto', disable_parallel_tool_use: disableParallelToolUse }\n        : undefined,\n      toolWarnings,\n      betas,\n    };\n  }\n\n  const type = toolChoice.type;\n\n  switch (type) {\n    case 'auto':\n      return {\n        tools: anthropicTools,\n        toolChoice: {\n          type: 'auto',\n          disable_parallel_tool_use: disableParallelToolUse,\n        },\n        toolWarnings,\n        betas,\n      };\n    case 'required':\n      return {\n        tools: anthropicTools,\n        toolChoice: {\n          type: 'any',\n          disable_parallel_tool_use: disableParallelToolUse,\n        },\n        toolWarnings,\n        betas,\n      };\n    case 'none':\n      // Anthropic does not support 'none' tool choice, so we remove the tools:\n      return { tools: undefined, toolChoice: undefined, toolWarnings, betas };\n    case 'tool':\n      return {\n        tools: anthropicTools,\n        toolChoice: {\n          type: 'tool',\n          name: toolChoice.toolName,\n          disable_parallel_tool_use: disableParallelToolUse,\n        },\n        toolWarnings,\n        betas,\n      };\n    default: {\n      const _exhaustiveCheck: never = type;\n      throw new UnsupportedFunctionalityError({\n        functionality: `tool choice type: ${_exhaustiveCheck}`,\n      });\n    }\n  }\n}\n","import type {\n  SharedV3Warning,\n  SharedV3ProviderMetadata,\n} from '@ai-sdk/provider';\nimport type { AnthropicCacheControl } from './anthropic-messages-api';\n\n// Anthropic allows a maximum of 4 cache breakpoints per request\nconst MAX_CACHE_BREAKPOINTS = 4;\n\n// Helper function to extract cache_control from provider metadata\n// Allows both cacheControl and cache_control for flexibility\nfunction getCacheControl(\n  providerMetadata: SharedV3ProviderMetadata | undefined,\n): AnthropicCacheControl | undefined {\n  const anthropic = providerMetadata?.anthropic;\n\n  // allow both cacheControl and cache_control:\n  const cacheControlValue = anthropic?.cacheControl ?? anthropic?.cache_control;\n\n  // Pass through value assuming it is of the correct type.\n  // The Anthropic API will validate the value.\n  return cacheControlValue as AnthropicCacheControl | undefined;\n}\n\nexport class CacheControlValidator {\n  private breakpointCount = 0;\n  private warnings: SharedV3Warning[] = [];\n\n  getCacheControl(\n    providerMetadata: SharedV3ProviderMetadata | undefined,\n    context: { type: string; canCache: boolean },\n  ): AnthropicCacheControl | undefined {\n    const cacheControlValue = getCacheControl(providerMetadata);\n\n    if (!cacheControlValue) {\n      return undefined;\n    }\n\n    // Validate that cache_control is allowed in this context\n    if (!context.canCache) {\n      this.warnings.push({\n        type: 'unsupported',\n        feature: 'cache_control on non-cacheable context',\n        details: `cache_control cannot be set on ${context.type}. It will be ignored.`,\n      });\n      return undefined;\n    }\n\n    // Validate cache breakpoint limit\n    this.breakpointCount++;\n    if (this.breakpointCount > MAX_CACHE_BREAKPOINTS) {\n      this.warnings.push({\n        type: 'unsupported',\n        feature: 'cacheControl breakpoint limit',\n        details: `Maximum ${MAX_CACHE_BREAKPOINTS} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`,\n      });\n      return undefined;\n    }\n\n    return cacheControlValue;\n  }\n\n  getWarnings(): SharedV3Warning[] {\n    return this.warnings;\n  }\n}\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const advisor_20260301ArgsSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      model: z.string(),\n      maxUses: z.number().optional(),\n      caching: z\n        .object({\n          type: z.literal('ephemeral'),\n          ttl: z.union([z.literal('5m'), z.literal('1h')]),\n        })\n        .optional(),\n    }),\n  ),\n);\n\nexport const advisor_20260301OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.discriminatedUnion('type', [\n      z.object({\n        type: z.literal('advisor_result'),\n        text: z.string(),\n      }),\n      z.object({\n        type: z.literal('advisor_redacted_result'),\n        encryptedContent: z.string(),\n      }),\n      z.object({\n        type: z.literal('advisor_tool_result_error'),\n        errorCode: z.string(),\n      }),\n    ]),\n  ),\n);\n\nconst advisor_20260301InputSchema = lazySchema(() =>\n  zodSchema(z.object({}).strict()),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  // Input is always empty: the executor emits server_tool_use with empty input\n  // and the server constructs the advisor's view from the full transcript.\n  {},\n  | {\n      type: 'advisor_result';\n\n      /**\n       * Plaintext advice from the advisor model.\n       */\n      text: string;\n    }\n  | {\n      type: 'advisor_redacted_result';\n\n      /**\n       * Opaque, encrypted advice. Must be round-tripped verbatim on subsequent\n       * turns; the server decrypts it server-side when rendering the advisor's\n       * advice into the executor's prompt.\n       */\n      encryptedContent: string;\n    }\n  | {\n      type: 'advisor_tool_result_error';\n\n      /**\n       * Available options: `max_uses_exceeded`, `too_many_requests`,\n       * `overloaded`, `prompt_too_long`, `execution_time_exceeded`,\n       * `unavailable`.\n       */\n      errorCode: string;\n    },\n  {\n    /**\n     * The advisor model ID, such as `\"claude-opus-4-7\"`. Billed at this\n     * model's rates for the sub-inference.\n     *\n     * The advisor must be at least as capable as the executor; an invalid\n     * pair returns a `400 invalid_request_error` from the API.\n     */\n    model: string;\n\n    /**\n     * Maximum number of advisor calls allowed in a single request. Once the\n     * executor reaches this cap, further advisor calls return an\n     * `advisor_tool_result_error` with `error_code: \"max_uses_exceeded\"` and\n     * the executor continues without further advice.\n     *\n     * This is a per-request cap, not a per-conversation cap. To enforce\n     * conversation-level limits, count advisor calls client-side; when you\n     * hit your cap, remove the advisor tool from `tools` AND strip all\n     * `advisor_tool_result` blocks from your message history (otherwise the\n     * API returns `400 invalid_request_error`).\n     */\n    maxUses?: number;\n\n    /**\n     * Enables prompt caching for the advisor's own transcript across calls\n     * within a conversation. Unlike `cache_control` on content blocks, this\n     * is not a breakpoint marker; it is an on/off switch. The server decides\n     * where cache boundaries go.\n     *\n     * The cache write costs more than the reads save when the advisor is\n     * called two or fewer times per conversation; caching breaks even at\n     * roughly three advisor calls. Enable it for long agent loops; keep it\n     * off for short tasks. Keep it consistent across a conversation —\n     * toggling causes cache misses.\n     */\n    caching?: {\n      type: 'ephemeral';\n      ttl: '5m' | '1h';\n    };\n  }\n>({\n  id: 'anthropic.advisor_20260301',\n  inputSchema: advisor_20260301InputSchema,\n  outputSchema: advisor_20260301OutputSchema,\n  supportsDeferredResults: true,\n});\n\nexport const advisor_20260301 = (args: Parameters<typeof factory>[0]) => {\n  return factory(args);\n};\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const textEditor_20250728ArgsSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      maxCharacters: z.number().optional(),\n    }),\n  ),\n);\n\nconst textEditor_20250728InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      command: z.enum(['view', 'create', 'str_replace', 'insert']),\n      path: z.string(),\n      file_text: z.string().optional(),\n      insert_line: z.number().int().optional(),\n      new_str: z.string().optional(),\n      insert_text: z.string().optional(),\n      old_str: z.string().optional(),\n      view_range: z.array(z.number().int()).optional(),\n    }),\n  ),\n);\n\nconst factory = createProviderToolFactory<\n  {\n    /**\n     * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`.\n     * Note: `undo_edit` is not supported in Claude 4 models.\n     */\n    command: 'view' | 'create' | 'str_replace' | 'insert';\n\n    /**\n     * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.\n     */\n    path: string;\n\n    /**\n     * Required parameter of `create` command, with the content of the file to be created.\n     */\n    file_text?: string;\n\n    /**\n     * Required parameter of `insert` command. The `new_str` will be inserted AFTER the line `insert_line` of `path`.\n     */\n    insert_line?: number;\n\n    /**\n     * Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).\n     */\n    new_str?: string;\n\n    /**\n     * Required parameter of `insert` command containing the text to insert.\n     */\n    insert_text?: string;\n\n    /**\n     * Required parameter of `str_replace` command containing the string in `path` to replace.\n     */\n    old_str?: string;\n\n    /**\n     * Optional parameter of `view` command when `path` points to a file. If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file.\n     */\n    view_range?: number[];\n  },\n  {\n    /**\n     * Optional parameter to control truncation when viewing large files. Only compatible with text_editor_20250728 and later versions.\n     */\n    maxCharacters?: number;\n  }\n>({\n  id: 'anthropic.text_editor_20250728',\n  inputSchema: textEditor_20250728InputSchema,\n});\n\nexport const textEditor_20250728 = (\n  args: Parameters<typeof factory>[0] = {}, // default\n) => {\n  return factory(args);\n};\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const webSearch_20260209ArgsSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      maxUses: z.number().optional(),\n      allowedDomains: z.array(z.string()).optional(),\n      blockedDomains: z.array(z.string()).optional(),\n      userLocation: z\n        .object({\n          type: z.literal('approximate'),\n          city: z.string().optional(),\n          region: z.string().optional(),\n          country: z.string().optional(),\n          timezone: z.string().optional(),\n        })\n        .optional(),\n    }),\n  ),\n);\n\nexport const webSearch_20260209OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.array(\n      z.object({\n        url: z.string(),\n        title: z.string().nullable(),\n        pageAge: z.string().nullable(),\n        encryptedContent: z.string(),\n        type: z.literal('web_search_result'),\n      }),\n    ),\n  ),\n);\n\nconst webSearch_20260209InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      query: z.string(),\n    }),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  {\n    /**\n     * The search query to execute.\n     */\n    query: string;\n  },\n  Array<{\n    type: 'web_search_result';\n\n    /**\n     * The URL of the source page.\n     */\n    url: string;\n\n    /**\n     * The title of the source page.\n     */\n    title: string | null;\n\n    /**\n     * When the site was last updated\n     */\n    pageAge: string | null;\n\n    /**\n     * Encrypted content that must be passed back in multi-turn conversations for citations\n     */\n    encryptedContent: string;\n  }>,\n  {\n    /**\n     * Maximum number of web searches Claude can perform during the conversation.\n     */\n    maxUses?: number;\n\n    /**\n     * Optional list of domains that Claude is allowed to search.\n     */\n    allowedDomains?: string[];\n\n    /**\n     * Optional list of domains that Claude should avoid when searching.\n     */\n    blockedDomains?: string[];\n\n    /**\n     * Optional user location information to provide geographically relevant search results.\n     */\n    userLocation?: {\n      /**\n       * The type of location (must be approximate)\n       */\n      type: 'approximate';\n\n      /**\n       * The city name\n       */\n      city?: string;\n\n      /**\n       * The region or state\n       */\n      region?: string;\n\n      /**\n       * The country\n       */\n      country?: string;\n\n      /**\n       * The IANA timezone ID.\n       */\n      timezone?: string;\n    };\n  }\n>({\n  id: 'anthropic.web_search_20260209',\n  inputSchema: webSearch_20260209InputSchema,\n  outputSchema: webSearch_20260209OutputSchema,\n  supportsDeferredResults: true,\n});\n\nexport const webSearch_20260209 = (\n  args: Parameters<typeof factory>[0] = {}, // default\n) => {\n  return factory(args);\n};\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const webSearch_20250305ArgsSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      maxUses: z.number().optional(),\n      allowedDomains: z.array(z.string()).optional(),\n      blockedDomains: z.array(z.string()).optional(),\n      userLocation: z\n        .object({\n          type: z.literal('approximate'),\n          city: z.string().optional(),\n          region: z.string().optional(),\n          country: z.string().optional(),\n          timezone: z.string().optional(),\n        })\n        .optional(),\n    }),\n  ),\n);\n\nexport const webSearch_20250305OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.array(\n      z.object({\n        url: z.string(),\n        title: z.string().nullable(),\n        pageAge: z.string().nullable(),\n        encryptedContent: z.string(),\n        type: z.literal('web_search_result'),\n      }),\n    ),\n  ),\n);\n\nconst webSearch_20250305InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      query: z.string(),\n    }),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  {\n    /**\n     * The search query to execute.\n     */\n    query: string;\n  },\n  Array<{\n    type: 'web_search_result';\n\n    /**\n     * The URL of the source page.\n     */\n    url: string;\n\n    /**\n     * The title of the source page.\n     */\n    title: string | null;\n\n    /**\n     * When the site was last updated\n     */\n    pageAge: string | null;\n\n    /**\n     * Encrypted content that must be passed back in multi-turn conversations for citations\n     */\n    encryptedContent: string;\n  }>,\n  {\n    /**\n     * Maximum number of web searches Claude can perform during the conversation.\n     */\n    maxUses?: number;\n\n    /**\n     * Optional list of domains that Claude is allowed to search.\n     */\n    allowedDomains?: string[];\n\n    /**\n     * Optional list of domains that Claude should avoid when searching.\n     */\n    blockedDomains?: string[];\n\n    /**\n     * Optional user location information to provide geographically relevant search results.\n     */\n    userLocation?: {\n      /**\n       * The type of location (must be approximate)\n       */\n      type: 'approximate';\n\n      /**\n       * The city name\n       */\n      city?: string;\n\n      /**\n       * The region or state\n       */\n      region?: string;\n\n      /**\n       * The country\n       */\n      country?: string;\n\n      /**\n       * The IANA timezone ID.\n       */\n      timezone?: string;\n    };\n  }\n>({\n  id: 'anthropic.web_search_20250305',\n  inputSchema: webSearch_20250305InputSchema,\n  outputSchema: webSearch_20250305OutputSchema,\n  supportsDeferredResults: true,\n});\n\nexport const webSearch_20250305 = (\n  args: Parameters<typeof factory>[0] = {}, // default\n) => {\n  return factory(args);\n};\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const webFetch_20260209ArgsSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      maxUses: z.number().optional(),\n      allowedDomains: z.array(z.string()).optional(),\n      blockedDomains: z.array(z.string()).optional(),\n      citations: z.object({ enabled: z.boolean() }).optional(),\n      maxContentTokens: z.number().optional(),\n    }),\n  ),\n);\n\nexport const webFetch_20260209OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      type: z.literal('web_fetch_result'),\n      url: z.string(),\n      content: z.object({\n        type: z.literal('document'),\n        title: z.string().nullable(),\n        citations: z.object({ enabled: z.boolean() }).optional(),\n        source: z.union([\n          z.object({\n            type: z.literal('base64'),\n            mediaType: z.literal('application/pdf'),\n            data: z.string(),\n          }),\n          z.object({\n            type: z.literal('text'),\n            mediaType: z.literal('text/plain'),\n            data: z.string(),\n          }),\n        ]),\n      }),\n      retrievedAt: z.string().nullable(),\n    }),\n  ),\n);\n\nconst webFetch_20260209InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      url: z.string(),\n    }),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  {\n    /**\n     * The URL to fetch.\n     */\n    url: string;\n  },\n  {\n    type: 'web_fetch_result';\n\n    /**\n     * Fetched content URL\n     */\n    url: string;\n\n    /**\n     * Fetched content.\n     */\n    content: {\n      type: 'document';\n\n      /**\n       * Title of the document\n       */\n      title: string | null;\n\n      /**\n       * Citation configuration for the document\n       */\n      citations?: { enabled: boolean };\n\n      source:\n        | {\n            type: 'base64';\n            mediaType: 'application/pdf';\n            data: string;\n          }\n        | {\n            type: 'text';\n            mediaType: 'text/plain';\n            data: string;\n          };\n    };\n\n    /**\n     * ISO 8601 timestamp when the content was retrieved\n     */\n    retrievedAt: string | null;\n  },\n  {\n    /**\n     * The maxUses parameter limits the number of web fetches performed\n     */\n    maxUses?: number;\n\n    /**\n     * Only fetch from these domains\n     */\n    allowedDomains?: string[];\n\n    /**\n     * Never fetch from these domains\n     */\n    blockedDomains?: string[];\n\n    /**\n     * Unlike web search where citations are always enabled, citations are optional for\n     * web fetch. Set \"citations\": {\"enabled\": true} to enable Claude to cite specific passages\n     * from fetched documents.\n     */\n    citations?: {\n      enabled: boolean;\n    };\n\n    /**\n     * The maxContentTokens parameter limits the amount of content that will be included in the context.\n     */\n    maxContentTokens?: number;\n  }\n>({\n  id: 'anthropic.web_fetch_20260209',\n  inputSchema: webFetch_20260209InputSchema,\n  outputSchema: webFetch_20260209OutputSchema,\n  supportsDeferredResults: true,\n});\n\nexport const webFetch_20260209 = (\n  args: Parameters<typeof factory>[0] = {}, // default\n) => {\n  return factory(args);\n};\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const webFetch_20250910ArgsSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      maxUses: z.number().optional(),\n      allowedDomains: z.array(z.string()).optional(),\n      blockedDomains: z.array(z.string()).optional(),\n      citations: z.object({ enabled: z.boolean() }).optional(),\n      maxContentTokens: z.number().optional(),\n    }),\n  ),\n);\n\nexport const webFetch_20250910OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      type: z.literal('web_fetch_result'),\n      url: z.string(),\n      content: z.object({\n        type: z.literal('document'),\n        title: z.string().nullable(),\n        citations: z.object({ enabled: z.boolean() }).optional(),\n        source: z.union([\n          z.object({\n            type: z.literal('base64'),\n            mediaType: z.literal('application/pdf'),\n            data: z.string(),\n          }),\n          z.object({\n            type: z.literal('text'),\n            mediaType: z.literal('text/plain'),\n            data: z.string(),\n          }),\n        ]),\n      }),\n      retrievedAt: z.string().nullable(),\n    }),\n  ),\n);\n\nconst webFetch_20250910InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      url: z.string(),\n    }),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  {\n    /**\n     * The URL to fetch.\n     */\n    url: string;\n  },\n  {\n    type: 'web_fetch_result';\n\n    /**\n     * Fetched content URL\n     */\n    url: string;\n\n    /**\n     * Fetched content.\n     */\n    content: {\n      type: 'document';\n\n      /**\n       * Title of the document\n       */\n      title: string | null;\n\n      /**\n       * Citation configuration for the document\n       */\n      citations?: { enabled: boolean };\n\n      source:\n        | {\n            type: 'base64';\n            mediaType: 'application/pdf';\n            data: string;\n          }\n        | {\n            type: 'text';\n            mediaType: 'text/plain';\n            data: string;\n          };\n    };\n\n    /**\n     * ISO 8601 timestamp when the content was retrieved\n     */\n    retrievedAt: string | null;\n  },\n  {\n    /**\n     * The maxUses parameter limits the number of web fetches performed\n     */\n    maxUses?: number;\n\n    /**\n     * Only fetch from these domains\n     */\n    allowedDomains?: string[];\n\n    /**\n     * Never fetch from these domains\n     */\n    blockedDomains?: string[];\n\n    /**\n     * Unlike web search where citations are always enabled, citations are optional for\n     * web fetch. Set \"citations\": {\"enabled\": true} to enable Claude to cite specific passages\n     * from fetched documents.\n     */\n    citations?: {\n      enabled: boolean;\n    };\n\n    /**\n     * The maxContentTokens parameter limits the amount of content that will be included in the context.\n     */\n    maxContentTokens?: number;\n  }\n>({\n  id: 'anthropic.web_fetch_20250910',\n  inputSchema: webFetch_20250910InputSchema,\n  outputSchema: webFetch_20250910OutputSchema,\n  supportsDeferredResults: true,\n});\n\nexport const webFetch_20250910 = (\n  args: Parameters<typeof factory>[0] = {}, // default\n) => {\n  return factory(args);\n};\n","import type { JSONObject, LanguageModelV3Usage } from '@ai-sdk/provider';\n\n/**\n * Represents a single iteration in the usage breakdown.\n *\n * - `compaction` / `message`: executor iterations, billed at executor rates.\n * - `advisor_message`: advisor sub-inference, billed at the advisor model's\n *   rates. The `model` field carries the advisor model ID. Advisor tokens\n *   are NOT rolled into the top-level totals because they bill at a\n *   different rate; inspect this array for advisor cost tracking.\n */\nexport type AnthropicUsageIteration =\n  | {\n      type: 'compaction' | 'message';\n      input_tokens: number;\n      output_tokens: number;\n      cache_creation_input_tokens?: number | null;\n      cache_read_input_tokens?: number | null;\n    }\n  | {\n      type: 'advisor_message';\n      model: string;\n      input_tokens: number;\n      output_tokens: number;\n      cache_creation_input_tokens?: number | null;\n      cache_read_input_tokens?: number | null;\n    };\n\nexport type AnthropicMessagesUsage = {\n  input_tokens: number;\n  output_tokens: number;\n  cache_creation_input_tokens?: number | null;\n  cache_read_input_tokens?: number | null;\n  /**\n   * When compaction is triggered or the advisor tool is invoked, this\n   * array contains usage for each sampling iteration. Top-level\n   * input_tokens and output_tokens exclude compaction iteration usage,\n   * and the advisor sub-inference is also not rolled into the top-level\n   * totals because it bills at a different rate. Use this array for\n   * per-iteration cost tracking.\n   */\n  iterations?: AnthropicUsageIteration[] | null;\n};\n\nexport function convertAnthropicMessagesUsage({\n  usage,\n  rawUsage,\n}: {\n  usage: AnthropicMessagesUsage;\n  rawUsage?: JSONObject;\n}): LanguageModelV3Usage {\n  const cacheCreationTokens = usage.cache_creation_input_tokens ?? 0;\n  const cacheReadTokens = usage.cache_read_input_tokens ?? 0;\n\n  // When iterations is present (compaction or advisor), sum across executor\n  // iterations to get the true executor totals. The top-level input_tokens\n  // and output_tokens exclude compaction usage. Advisor (`advisor_message`)\n  // iterations are filtered out: they bill at the advisor model's rates,\n  // not the executor's, so they don't belong in the top-level totals.\n  let inputTokens: number;\n  let outputTokens: number;\n\n  if (usage.iterations && usage.iterations.length > 0) {\n    const executorIterations = usage.iterations.filter(\n      iter => iter.type === 'compaction' || iter.type === 'message',\n    );\n\n    if (executorIterations.length > 0) {\n      const totals = executorIterations.reduce(\n        (acc, iter) => ({\n          input: acc.input + iter.input_tokens,\n          output: acc.output + iter.output_tokens,\n        }),\n        { input: 0, output: 0 },\n      );\n      inputTokens = totals.input;\n      outputTokens = totals.output;\n    } else {\n      inputTokens = usage.input_tokens;\n      outputTokens = usage.output_tokens;\n    }\n  } else {\n    inputTokens = usage.input_tokens;\n    outputTokens = usage.output_tokens;\n  }\n\n  return {\n    inputTokens: {\n      total: inputTokens + cacheCreationTokens + cacheReadTokens,\n      noCache: inputTokens,\n      cacheRead: cacheReadTokens,\n      cacheWrite: cacheCreationTokens,\n    },\n    outputTokens: {\n      total: outputTokens,\n      text: undefined,\n      reasoning: undefined,\n    },\n    raw: rawUsage ?? usage,\n  };\n}\n","import {\n  UnsupportedFunctionalityError,\n  type SharedV3Warning,\n  type LanguageModelV3DataContent,\n  type LanguageModelV3Message,\n  type LanguageModelV3Prompt,\n  type SharedV3ProviderMetadata,\n} from '@ai-sdk/provider';\nimport {\n  convertBase64ToUint8Array,\n  convertToBase64,\n  parseProviderOptions,\n  validateTypes,\n  isNonNullable,\n  type ToolNameMapping,\n} from '@ai-sdk/provider-utils';\nimport {\n  anthropicReasoningMetadataSchema,\n  type AnthropicAssistantMessage,\n  type AnthropicMessagesPrompt,\n  type AnthropicToolResultContent,\n  type AnthropicUserMessage,\n  type AnthropicWebFetchToolResultContent,\n} from './anthropic-messages-api';\nimport { anthropicFilePartProviderOptions } from './anthropic-messages-options';\nimport { CacheControlValidator } from './get-cache-control';\nimport { advisor_20260301OutputSchema } from './tool/advisor_20260301';\nimport { codeExecution_20250522OutputSchema } from './tool/code-execution_20250522';\nimport { codeExecution_20250825OutputSchema } from './tool/code-execution_20250825';\nimport { codeExecution_20260120OutputSchema } from './tool/code-execution_20260120';\nimport { toolSearchRegex_20251119OutputSchema as toolSearchOutputSchema } from './tool/tool-search-regex_20251119';\nimport { webFetch_20250910OutputSchema } from './tool/web-fetch-20250910';\nimport { webSearch_20250305OutputSchema } from './tool/web-search_20250305';\n\nfunction convertToString(data: LanguageModelV3DataContent): string {\n  if (typeof data === 'string') {\n    return new TextDecoder().decode(convertBase64ToUint8Array(data));\n  }\n\n  if (data instanceof Uint8Array) {\n    return new TextDecoder().decode(data);\n  }\n\n  if (data instanceof URL) {\n    throw new UnsupportedFunctionalityError({\n      functionality: 'URL-based text documents are not supported for citations',\n    });\n  }\n\n  throw new UnsupportedFunctionalityError({\n    functionality: `unsupported data type for text documents: ${typeof data}`,\n  });\n}\n\n/**\n * Checks if data is a URL (either a URL object or a URL string).\n */\nfunction isUrlData(\n  data: LanguageModelV3DataContent,\n): data is URL | (string & { __brand: 'url-string' }) {\n  return data instanceof URL || isUrlString(data);\n}\n\nfunction isUrlString(data: LanguageModelV3DataContent): boolean {\n  return typeof data === 'string' && /^https?:\\/\\//i.test(data);\n}\n\nfunction getUrlString(data: LanguageModelV3DataContent): string {\n  return data instanceof URL ? data.toString() : (data as string);\n}\n\nexport async function convertToAnthropicMessagesPrompt({\n  prompt,\n  sendReasoning,\n  warnings,\n  cacheControlValidator,\n  toolNameMapping,\n}: {\n  prompt: LanguageModelV3Prompt;\n  sendReasoning: boolean;\n  warnings: SharedV3Warning[];\n  cacheControlValidator?: CacheControlValidator;\n  toolNameMapping: ToolNameMapping;\n}): Promise<{\n  prompt: AnthropicMessagesPrompt;\n  betas: Set<string>;\n}> {\n  const betas = new Set<string>();\n  const blocks = groupIntoBlocks(prompt);\n  const validator = cacheControlValidator || new CacheControlValidator();\n\n  let system: AnthropicMessagesPrompt['system'] = undefined;\n  const messages: AnthropicMessagesPrompt['messages'] = [];\n\n  async function shouldEnableCitations(\n    providerMetadata: SharedV3ProviderMetadata | undefined,\n  ): Promise<boolean> {\n    const anthropicOptions = await parseProviderOptions({\n      provider: 'anthropic',\n      providerOptions: providerMetadata,\n      schema: anthropicFilePartProviderOptions,\n    });\n\n    return anthropicOptions?.citations?.enabled ?? false;\n  }\n\n  async function getDocumentMetadata(\n    providerMetadata: SharedV3ProviderMetadata | undefined,\n  ): Promise<{ title?: string; context?: string }> {\n    const anthropicOptions = await parseProviderOptions({\n      provider: 'anthropic',\n      providerOptions: providerMetadata,\n      schema: anthropicFilePartProviderOptions,\n    });\n\n    return {\n      title: anthropicOptions?.title,\n      context: anthropicOptions?.context,\n    };\n  }\n\n  for (let i = 0; i < blocks.length; i++) {\n    const block = blocks[i];\n    const isLastBlock = i === blocks.length - 1;\n    const type = block.type;\n\n    switch (type) {\n      case 'system': {\n        if (system != null) {\n          throw new UnsupportedFunctionalityError({\n            functionality:\n              'Multiple system messages that are separated by user/assistant messages',\n          });\n        }\n\n        system = block.messages.map(({ content, providerOptions }) => ({\n          type: 'text',\n          text: content,\n          cache_control: validator.getCacheControl(providerOptions, {\n            type: 'system message',\n            canCache: true,\n          }),\n        }));\n\n        break;\n      }\n\n      case 'user': {\n        // combines all user and tool messages in this block into a single message:\n        const anthropicContent: AnthropicUserMessage['content'] = [];\n\n        for (const message of block.messages) {\n          const { role, content } = message;\n          switch (role) {\n            case 'user': {\n              for (let j = 0; j < content.length; j++) {\n                const part = content[j];\n\n                // cache control: first add cache control from part.\n                // for the last part of a message,\n                // check also if the message has cache control.\n                const isLastPart = j === content.length - 1;\n\n                const cacheControl =\n                  validator.getCacheControl(part.providerOptions, {\n                    type: 'user message part',\n                    canCache: true,\n                  }) ??\n                  (isLastPart\n                    ? validator.getCacheControl(message.providerOptions, {\n                        type: 'user message',\n                        canCache: true,\n                      })\n                    : undefined);\n\n                switch (part.type) {\n                  case 'text': {\n                    anthropicContent.push({\n                      type: 'text',\n                      text: part.text,\n                      cache_control: cacheControl,\n                    });\n                    break;\n                  }\n\n                  case 'file': {\n                    if (part.mediaType.startsWith('image/')) {\n                      anthropicContent.push({\n                        type: 'image',\n                        source: isUrlData(part.data)\n                          ? {\n                              type: 'url',\n                              url: getUrlString(part.data),\n                            }\n                          : {\n                              type: 'base64',\n                              media_type:\n                                part.mediaType === 'image/*'\n                                  ? 'image/jpeg'\n                                  : part.mediaType,\n                              data: convertToBase64(part.data),\n                            },\n                        cache_control: cacheControl,\n                      });\n                    } else if (part.mediaType === 'application/pdf') {\n                      betas.add('pdfs-2024-09-25');\n\n                      const enableCitations = await shouldEnableCitations(\n                        part.providerOptions,\n                      );\n\n                      const metadata = await getDocumentMetadata(\n                        part.providerOptions,\n                      );\n\n                      anthropicContent.push({\n                        type: 'document',\n                        source: isUrlData(part.data)\n                          ? {\n                              type: 'url',\n                              url: getUrlString(part.data),\n                            }\n                          : {\n                              type: 'base64',\n                              media_type: 'application/pdf',\n                              data: convertToBase64(part.data),\n                            },\n                        title: metadata.title ?? part.filename,\n                        ...(metadata.context && { context: metadata.context }),\n                        ...(enableCitations && {\n                          citations: { enabled: true },\n                        }),\n                        cache_control: cacheControl,\n                      });\n                    } else if (part.mediaType === 'text/plain') {\n                      const enableCitations = await shouldEnableCitations(\n                        part.providerOptions,\n                      );\n\n                      const metadata = await getDocumentMetadata(\n                        part.providerOptions,\n                      );\n\n                      anthropicContent.push({\n                        type: 'document',\n                        source: isUrlData(part.data)\n                          ? {\n                              type: 'url',\n                              url: getUrlString(part.data),\n                            }\n                          : {\n                              type: 'text',\n                              media_type: 'text/plain',\n                              data: convertToString(part.data),\n                            },\n                        title: metadata.title ?? part.filename,\n                        ...(metadata.context && { context: metadata.context }),\n                        ...(enableCitations && {\n                          citations: { enabled: true },\n                        }),\n                        cache_control: cacheControl,\n                      });\n                    } else {\n                      throw new UnsupportedFunctionalityError({\n                        functionality: `media type: ${part.mediaType}`,\n                      });\n                    }\n\n                    break;\n                  }\n                }\n              }\n\n              break;\n            }\n            case 'tool': {\n              for (let i = 0; i < content.length; i++) {\n                const part = content[i];\n\n                if (part.type === 'tool-approval-response') {\n                  continue;\n                }\n\n                const output = part.output;\n                const outputProviderOptions =\n                  'providerOptions' in output\n                    ? output.providerOptions\n                    : output.type === 'content'\n                      ? output.value.find(\n                          contentPart => contentPart.providerOptions != null,\n                        )?.providerOptions\n                      : undefined;\n\n                // cache control: first add cache control from part.\n                // then from tool result output, and for the last part of a\n                // message, check also if the message has cache control.\n                const isLastPart = i === content.length - 1;\n\n                const cacheControl =\n                  validator.getCacheControl(part.providerOptions, {\n                    type: 'tool result part',\n                    canCache: true,\n                  }) ??\n                  validator.getCacheControl(outputProviderOptions, {\n                    type: 'tool result output',\n                    canCache: true,\n                  }) ??\n                  (isLastPart\n                    ? validator.getCacheControl(message.providerOptions, {\n                        type: 'tool result message',\n                        canCache: true,\n                      })\n                    : undefined);\n\n                let contentValue: AnthropicToolResultContent['content'];\n                switch (output.type) {\n                  case 'content':\n                    contentValue = output.value\n                      .map(contentPart => {\n                        switch (contentPart.type) {\n                          case 'text':\n                            return {\n                              type: 'text' as const,\n                              text: contentPart.text,\n                            };\n                          case 'image-data': {\n                            return {\n                              type: 'image' as const,\n                              source: {\n                                type: 'base64' as const,\n                                media_type: contentPart.mediaType,\n                                data: contentPart.data,\n                              },\n                            };\n                          }\n                          case 'image-url': {\n                            return {\n                              type: 'image' as const,\n                              source: {\n                                type: 'url' as const,\n                                url: contentPart.url,\n                              },\n                            };\n                          }\n                          case 'file-url': {\n                            return {\n                              type: 'document' as const,\n                              source: {\n                                type: 'url' as const,\n                                url: contentPart.url,\n                              },\n                            };\n                          }\n                          case 'file-data': {\n                            if (contentPart.mediaType === 'application/pdf') {\n                              betas.add('pdfs-2024-09-25');\n                              return {\n                                type: 'document' as const,\n                                source: {\n                                  type: 'base64' as const,\n                                  media_type: contentPart.mediaType,\n                                  data: contentPart.data,\n                                },\n                              };\n                            }\n\n                            warnings.push({\n                              type: 'other',\n                              message: `unsupported tool content part type: ${contentPart.type} with media type: ${contentPart.mediaType}`,\n                            });\n\n                            return undefined;\n                          }\n                          case 'custom': {\n                            const anthropicOptions = contentPart.providerOptions\n                              ?.anthropic as\n                              | { type: string; toolName?: string }\n                              | undefined;\n                            if (anthropicOptions?.type === 'tool-reference') {\n                              return {\n                                type: 'tool_reference' as const,\n                                tool_name: anthropicOptions.toolName!,\n                              };\n                            }\n                            warnings.push({\n                              type: 'other',\n                              message: `unsupported custom tool content part`,\n                            });\n                            return undefined;\n                          }\n                          default: {\n                            warnings.push({\n                              type: 'other',\n                              message: `unsupported tool content part type: ${contentPart.type}`,\n                            });\n\n                            return undefined;\n                          }\n                        }\n                      })\n                      .filter(isNonNullable);\n                    break;\n                  case 'text':\n                  case 'error-text':\n                    contentValue = output.value;\n                    break;\n                  case 'execution-denied':\n                    contentValue = output.reason ?? 'Tool execution denied.';\n                    break;\n                  case 'json':\n                  case 'error-json':\n                  default:\n                    contentValue = JSON.stringify(output.value);\n                    break;\n                }\n\n                anthropicContent.push({\n                  type: 'tool_result',\n                  tool_use_id: part.toolCallId,\n                  content: contentValue,\n                  is_error:\n                    output.type === 'error-text' || output.type === 'error-json'\n                      ? true\n                      : undefined,\n                  cache_control: cacheControl,\n                });\n              }\n\n              break;\n            }\n            default: {\n              const _exhaustiveCheck: never = role;\n              throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n            }\n          }\n        }\n\n        messages.push({ role: 'user', content: anthropicContent });\n\n        break;\n      }\n\n      case 'assistant': {\n        // combines multiple assistant messages in this block into a single message:\n        const anthropicContent: AnthropicAssistantMessage['content'] = [];\n\n        const mcpToolUseIds = new Set<string>();\n\n        for (let j = 0; j < block.messages.length; j++) {\n          const message = block.messages[j];\n          const isLastMessage = j === block.messages.length - 1;\n          const { content } = message;\n\n          for (let k = 0; k < content.length; k++) {\n            const part = content[k];\n            const isLastContentPart = k === content.length - 1;\n\n            // cache control: first add cache control from part.\n            // for the last part of a message,\n            // check also if the message has cache control.\n            const cacheControl =\n              validator.getCacheControl(part.providerOptions, {\n                type: 'assistant message part',\n                canCache: true,\n              }) ??\n              (isLastContentPart\n                ? validator.getCacheControl(message.providerOptions, {\n                    type: 'assistant message',\n                    canCache: true,\n                  })\n                : undefined);\n\n            switch (part.type) {\n              case 'text': {\n                // Check if this is a compaction block (via providerMetadata)\n                const textMetadata = part.providerOptions?.anthropic as\n                  | { type?: string }\n                  | undefined;\n\n                if (textMetadata?.type === 'compaction') {\n                  anthropicContent.push({\n                    type: 'compaction',\n                    content: part.text,\n                    cache_control: cacheControl,\n                  });\n                } else {\n                  anthropicContent.push({\n                    type: 'text',\n                    text:\n                      // trim the last text part if it's the last message in the block\n                      // because Anthropic does not allow trailing whitespace\n                      // in pre-filled assistant responses\n                      isLastBlock && isLastMessage && isLastContentPart\n                        ? part.text.trim()\n                        : part.text,\n\n                    cache_control: cacheControl,\n                  });\n                }\n                break;\n              }\n\n              case 'reasoning': {\n                if (sendReasoning) {\n                  const reasoningMetadata = await parseProviderOptions({\n                    provider: 'anthropic',\n                    providerOptions: part.providerOptions,\n                    schema: anthropicReasoningMetadataSchema,\n                  });\n\n                  if (reasoningMetadata != null) {\n                    if (reasoningMetadata.signature != null) {\n                      // Note: thinking blocks cannot have cache_control directly\n                      // They are cached implicitly when in previous assistant turns\n                      // Validate to provide helpful error message\n                      validator.getCacheControl(part.providerOptions, {\n                        type: 'thinking block',\n                        canCache: false,\n                      });\n                      anthropicContent.push({\n                        type: 'thinking',\n                        thinking: part.text,\n                        signature: reasoningMetadata.signature,\n                      });\n                    } else if (reasoningMetadata.redactedData != null) {\n                      // Note: redacted thinking blocks cannot have cache_control directly\n                      // They are cached implicitly when in previous assistant turns\n                      // Validate to provide helpful error message\n                      validator.getCacheControl(part.providerOptions, {\n                        type: 'redacted thinking block',\n                        canCache: false,\n                      });\n                      anthropicContent.push({\n                        type: 'redacted_thinking',\n                        data: reasoningMetadata.redactedData,\n                      });\n                    } else {\n                      warnings.push({\n                        type: 'other',\n                        message: 'unsupported reasoning metadata',\n                      });\n                    }\n                  } else {\n                    warnings.push({\n                      type: 'other',\n                      message: 'unsupported reasoning metadata',\n                    });\n                  }\n                } else {\n                  warnings.push({\n                    type: 'other',\n                    message:\n                      'sending reasoning content is disabled for this model',\n                  });\n                }\n                break;\n              }\n\n              case 'tool-call': {\n                if (part.providerExecuted) {\n                  const providerToolName = toolNameMapping.toProviderToolName(\n                    part.toolName,\n                  );\n                  const isMcpToolUse =\n                    part.providerOptions?.anthropic?.type === 'mcp-tool-use';\n\n                  if (isMcpToolUse) {\n                    mcpToolUseIds.add(part.toolCallId);\n\n                    const serverName =\n                      part.providerOptions?.anthropic?.serverName;\n\n                    if (serverName == null || typeof serverName !== 'string') {\n                      warnings.push({\n                        type: 'other',\n                        message:\n                          'mcp tool use server name is required and must be a string',\n                      });\n                      break;\n                    }\n\n                    anthropicContent.push({\n                      type: 'mcp_tool_use',\n                      id: part.toolCallId,\n                      name: part.toolName,\n                      input: part.input,\n                      server_name: serverName,\n                      cache_control: cacheControl,\n                    });\n                  } else if (\n                    // code execution 20250825:\n                    providerToolName === 'code_execution' &&\n                    part.input != null &&\n                    typeof part.input === 'object' &&\n                    'type' in part.input &&\n                    typeof part.input.type === 'string' &&\n                    (part.input.type === 'bash_code_execution' ||\n                      part.input.type === 'text_editor_code_execution')\n                  ) {\n                    anthropicContent.push({\n                      type: 'server_tool_use',\n                      id: part.toolCallId,\n                      name: part.input.type, // map back to subtool name\n                      input: part.input,\n                      cache_control: cacheControl,\n                    });\n                  } else if (\n                    // code execution 20250825 programmatic tool calling:\n                    // Strip the fake 'programmatic-tool-call' type before sending to Anthropic\n                    providerToolName === 'code_execution' &&\n                    part.input != null &&\n                    typeof part.input === 'object' &&\n                    'type' in part.input &&\n                    part.input.type === 'programmatic-tool-call'\n                  ) {\n                    const { type: _, ...inputWithoutType } = part.input as {\n                      type: string;\n                      code: string;\n                    };\n                    anthropicContent.push({\n                      type: 'server_tool_use',\n                      id: part.toolCallId,\n                      name: 'code_execution',\n                      input: inputWithoutType,\n                      cache_control: cacheControl,\n                    });\n                  } else {\n                    if (\n                      providerToolName === 'code_execution' || // code execution 20250522\n                      providerToolName === 'web_fetch' ||\n                      providerToolName === 'web_search'\n                    ) {\n                      anthropicContent.push({\n                        type: 'server_tool_use',\n                        id: part.toolCallId,\n                        name: providerToolName,\n                        input: part.input,\n                        cache_control: cacheControl,\n                      });\n                    } else if (\n                      providerToolName === 'tool_search_tool_regex' ||\n                      providerToolName === 'tool_search_tool_bm25'\n                    ) {\n                      anthropicContent.push({\n                        type: 'server_tool_use',\n                        id: part.toolCallId,\n                        name: providerToolName,\n                        input: part.input,\n                        cache_control: cacheControl,\n                      });\n                    } else if (providerToolName === 'advisor') {\n                      // The advisor server_tool_use.input is always {}.\n                      anthropicContent.push({\n                        type: 'server_tool_use',\n                        id: part.toolCallId,\n                        name: 'advisor',\n                        input: {},\n                        cache_control: cacheControl,\n                      });\n                    } else {\n                      warnings.push({\n                        type: 'other',\n                        message: `provider executed tool call for tool ${part.toolName} is not supported`,\n                      });\n                    }\n                  }\n\n                  break;\n                }\n\n                // Extract caller info from provider options for programmatic tool calling\n                const callerOptions = part.providerOptions?.anthropic as\n                  | { caller?: { type: string; toolId?: string } }\n                  | undefined;\n                const caller = callerOptions?.caller\n                  ? (callerOptions.caller.type === 'code_execution_20250825' ||\n                      callerOptions.caller.type ===\n                        'code_execution_20260120') &&\n                    callerOptions.caller.toolId\n                    ? {\n                        type: callerOptions.caller.type as\n                          | 'code_execution_20250825'\n                          | 'code_execution_20260120',\n                        tool_id: callerOptions.caller.toolId,\n                      }\n                    : callerOptions.caller.type === 'direct'\n                      ? { type: 'direct' as const }\n                      : undefined\n                  : undefined;\n\n                anthropicContent.push({\n                  type: 'tool_use',\n                  id: part.toolCallId,\n                  name: part.toolName,\n                  input: part.input,\n                  ...(caller && { caller }),\n                  cache_control: cacheControl,\n                });\n                break;\n              }\n\n              case 'tool-result': {\n                const providerToolName = toolNameMapping.toProviderToolName(\n                  part.toolName,\n                );\n\n                if (mcpToolUseIds.has(part.toolCallId)) {\n                  const output = part.output;\n\n                  if (output.type !== 'json' && output.type !== 'error-json') {\n                    warnings.push({\n                      type: 'other',\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`,\n                    });\n\n                    break;\n                  }\n\n                  anthropicContent.push({\n                    type: 'mcp_tool_result',\n                    tool_use_id: part.toolCallId,\n                    is_error: output.type === 'error-json',\n                    content: output.value as unknown as\n                      | string\n                      | Array<{ type: 'text'; text: string }>,\n                    cache_control: cacheControl,\n                  });\n                } else if (providerToolName === 'code_execution') {\n                  const output = part.output;\n\n                  // Handle error types for code_execution tools (e.g., from programmatic tool calling)\n                  if (\n                    output.type === 'error-text' ||\n                    output.type === 'error-json'\n                  ) {\n                    let errorInfo: { type?: string; errorCode?: string } = {};\n                    try {\n                      if (typeof output.value === 'string') {\n                        errorInfo = JSON.parse(output.value);\n                      } else if (\n                        typeof output.value === 'object' &&\n                        output.value !== null\n                      ) {\n                        errorInfo = output.value as typeof errorInfo;\n                      }\n                    } catch {}\n\n                    if (errorInfo.type === 'code_execution_tool_result_error') {\n                      anthropicContent.push({\n                        type: 'code_execution_tool_result',\n                        tool_use_id: part.toolCallId,\n                        content: {\n                          type: 'code_execution_tool_result_error' as const,\n                          error_code: errorInfo.errorCode ?? 'unknown',\n                        },\n                        cache_control: cacheControl,\n                      });\n                    } else {\n                      anthropicContent.push({\n                        type: 'bash_code_execution_tool_result',\n                        tool_use_id: part.toolCallId,\n                        cache_control: cacheControl,\n                        content: {\n                          type: 'bash_code_execution_tool_result_error' as const,\n                          error_code: errorInfo.errorCode ?? 'unknown',\n                        },\n                      });\n                    }\n                    break;\n                  }\n\n                  if (output.type !== 'json') {\n                    warnings.push({\n                      type: 'other',\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`,\n                    });\n\n                    break;\n                  }\n\n                  if (\n                    output.value == null ||\n                    typeof output.value !== 'object' ||\n                    !('type' in output.value) ||\n                    typeof output.value.type !== 'string'\n                  ) {\n                    warnings.push({\n                      type: 'other',\n                      message: `provider executed tool result output value is not a valid code execution result for tool ${part.toolName}`,\n                    });\n                    break;\n                  }\n\n                  // to distinguish between code execution 20250522, 20250825,\n                  // and encrypted results (from web_fetch_20260209/web_search_20260209 injection),\n                  // we check the type property in output.value\n                  if (output.value.type === 'code_execution_result') {\n                    // code execution 20250522\n                    const codeExecutionOutput = await validateTypes({\n                      value: output.value,\n                      schema: codeExecution_20250522OutputSchema,\n                    });\n\n                    anthropicContent.push({\n                      type: 'code_execution_tool_result',\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: codeExecutionOutput.type,\n                        stdout: codeExecutionOutput.stdout,\n                        stderr: codeExecutionOutput.stderr,\n                        return_code: codeExecutionOutput.return_code,\n                        content: codeExecutionOutput.content ?? [],\n                      },\n                      cache_control: cacheControl,\n                    });\n                  } else if (\n                    output.value.type === 'encrypted_code_execution_result'\n                  ) {\n                    // code execution 20260120 encrypted result\n                    const codeExecutionOutput = await validateTypes({\n                      value: output.value,\n                      schema: codeExecution_20260120OutputSchema,\n                    });\n\n                    if (\n                      codeExecutionOutput.type ===\n                      'encrypted_code_execution_result'\n                    ) {\n                      anthropicContent.push({\n                        type: 'code_execution_tool_result',\n                        tool_use_id: part.toolCallId,\n                        content: {\n                          type: codeExecutionOutput.type,\n                          encrypted_stdout:\n                            codeExecutionOutput.encrypted_stdout,\n                          stderr: codeExecutionOutput.stderr,\n                          return_code: codeExecutionOutput.return_code,\n                          content: codeExecutionOutput.content ?? [],\n                        },\n                        cache_control: cacheControl,\n                      });\n                    }\n                  } else {\n                    // code execution 20250825\n                    const codeExecutionOutput = await validateTypes({\n                      value: output.value,\n                      schema: codeExecution_20250825OutputSchema,\n                    });\n\n                    if (codeExecutionOutput.type === 'code_execution_result') {\n                      anthropicContent.push({\n                        type: 'code_execution_tool_result',\n                        tool_use_id: part.toolCallId,\n                        content: {\n                          type: codeExecutionOutput.type,\n                          stdout: codeExecutionOutput.stdout,\n                          stderr: codeExecutionOutput.stderr,\n                          return_code: codeExecutionOutput.return_code,\n                          content: codeExecutionOutput.content ?? [],\n                        },\n                        cache_control: cacheControl,\n                      });\n                    } else if (\n                      codeExecutionOutput.type ===\n                        'bash_code_execution_result' ||\n                      codeExecutionOutput.type ===\n                        'bash_code_execution_tool_result_error'\n                    ) {\n                      anthropicContent.push({\n                        type: 'bash_code_execution_tool_result',\n                        tool_use_id: part.toolCallId,\n                        cache_control: cacheControl,\n                        content: codeExecutionOutput,\n                      });\n                    } else {\n                      anthropicContent.push({\n                        type: 'text_editor_code_execution_tool_result',\n                        tool_use_id: part.toolCallId,\n                        cache_control: cacheControl,\n                        content: codeExecutionOutput,\n                      });\n                    }\n                  }\n                  break;\n                }\n\n                if (providerToolName === 'web_fetch') {\n                  const output = part.output;\n\n                  if (output.type === 'error-json') {\n                    let errorValue: { errorCode?: string } = {};\n                    try {\n                      if (typeof output.value === 'string') {\n                        errorValue = JSON.parse(output.value);\n                      } else if (\n                        typeof output.value === 'object' &&\n                        output.value !== null\n                      ) {\n                        errorValue = output.value as typeof errorValue;\n                      }\n                    } catch {\n                      // If parsing fails, treat the value as-is\n                      const extractedErrorCode = (\n                        output.value as Record<string, unknown>\n                      )?.errorCode;\n                      errorValue = {\n                        errorCode:\n                          typeof extractedErrorCode === 'string'\n                            ? extractedErrorCode\n                            : 'unavailable',\n                      };\n                    }\n\n                    anthropicContent.push({\n                      type: 'web_fetch_tool_result',\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: 'web_fetch_tool_result_error',\n                        error_code: errorValue.errorCode ?? 'unavailable',\n                      },\n                      cache_control: cacheControl,\n                    });\n\n                    break;\n                  }\n\n                  if (output.type !== 'json') {\n                    warnings.push({\n                      type: 'other',\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`,\n                    });\n\n                    break;\n                  }\n\n                  // ideally we'd switch schema based on the tool version (e.g.\n                  // web_fetch_20260209 vs web_fetch_20250910), but since both\n                  // versions share an identical output schema, we use one here.\n                  const webFetchOutput = await validateTypes({\n                    value: output.value,\n                    schema: webFetch_20250910OutputSchema,\n                  });\n\n                  anthropicContent.push({\n                    type: 'web_fetch_tool_result',\n                    tool_use_id: part.toolCallId,\n                    content: {\n                      type: 'web_fetch_result',\n                      url: webFetchOutput.url,\n                      retrieved_at: webFetchOutput.retrievedAt,\n                      content: {\n                        type: 'document',\n                        title: webFetchOutput.content.title,\n                        citations: webFetchOutput.content.citations,\n                        source: {\n                          type: webFetchOutput.content.source.type,\n                          media_type: webFetchOutput.content.source.mediaType,\n                          data: webFetchOutput.content.source.data,\n                        } as Extract<\n                          AnthropicWebFetchToolResultContent['content'],\n                          { type: 'web_fetch_result' }\n                        >['content']['source'],\n                      },\n                    },\n                    cache_control: cacheControl,\n                  });\n\n                  break;\n                }\n\n                if (providerToolName === 'web_search') {\n                  const output = part.output;\n\n                  if (output.type !== 'json') {\n                    warnings.push({\n                      type: 'other',\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`,\n                    });\n\n                    break;\n                  }\n\n                  // ideally we'd switch schema based on the tool version (e.g.\n                  // web_search_20260209 vs web_search_20250305), but since both\n                  // versions share an identical output schema, we use one here.\n                  const webSearchOutput = await validateTypes({\n                    value: output.value,\n                    schema: webSearch_20250305OutputSchema,\n                  });\n\n                  anthropicContent.push({\n                    type: 'web_search_tool_result',\n                    tool_use_id: part.toolCallId,\n                    content: webSearchOutput.map(result => ({\n                      url: result.url,\n                      title: result.title,\n                      page_age: result.pageAge,\n                      encrypted_content: result.encryptedContent,\n                      type: result.type,\n                    })),\n                    cache_control: cacheControl,\n                  });\n\n                  break;\n                }\n\n                if (\n                  providerToolName === 'tool_search_tool_regex' ||\n                  providerToolName === 'tool_search_tool_bm25'\n                ) {\n                  const output = part.output;\n\n                  if (output.type !== 'json') {\n                    warnings.push({\n                      type: 'other',\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`,\n                    });\n\n                    break;\n                  }\n\n                  const toolSearchOutput = await validateTypes({\n                    value: output.value,\n                    schema: toolSearchOutputSchema,\n                  });\n\n                  // Convert tool references back to API format\n                  const toolReferences = toolSearchOutput.map(ref => ({\n                    type: 'tool_reference' as const,\n                    tool_name: ref.toolName,\n                  }));\n\n                  anthropicContent.push({\n                    type: 'tool_search_tool_result',\n                    tool_use_id: part.toolCallId,\n                    content: {\n                      type: 'tool_search_tool_search_result',\n                      tool_references: toolReferences,\n                    },\n                    cache_control: cacheControl,\n                  });\n\n                  break;\n                }\n\n                if (providerToolName === 'advisor') {\n                  const output = part.output;\n\n                  if (output.type !== 'json' && output.type !== 'error-json') {\n                    warnings.push({\n                      type: 'other',\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`,\n                    });\n\n                    break;\n                  }\n\n                  const advisorOutput = await validateTypes({\n                    value: output.value,\n                    schema: advisor_20260301OutputSchema,\n                  });\n\n                  if (advisorOutput.type === 'advisor_result') {\n                    anthropicContent.push({\n                      type: 'advisor_tool_result',\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: 'advisor_result',\n                        text: advisorOutput.text,\n                      },\n                      cache_control: cacheControl,\n                    });\n                  } else if (advisorOutput.type === 'advisor_redacted_result') {\n                    anthropicContent.push({\n                      type: 'advisor_tool_result',\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: 'advisor_redacted_result',\n                        encrypted_content: advisorOutput.encryptedContent,\n                      },\n                      cache_control: cacheControl,\n                    });\n                  } else {\n                    anthropicContent.push({\n                      type: 'advisor_tool_result',\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: 'advisor_tool_result_error',\n                        error_code: advisorOutput.errorCode,\n                      },\n                      cache_control: cacheControl,\n                    });\n                  }\n\n                  break;\n                }\n\n                warnings.push({\n                  type: 'other',\n                  message: `provider executed tool result for tool ${part.toolName} is not supported`,\n                });\n\n                break;\n              }\n            }\n          }\n        }\n\n        messages.push({ role: 'assistant', content: anthropicContent });\n\n        break;\n      }\n\n      default: {\n        const _exhaustiveCheck: never = type;\n        throw new Error(`content type: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n\n  return {\n    prompt: { system, messages },\n    betas,\n  };\n}\n\ntype SystemBlock = {\n  type: 'system';\n  messages: Array<LanguageModelV3Message & { role: 'system' }>;\n};\ntype AssistantBlock = {\n  type: 'assistant';\n  messages: Array<LanguageModelV3Message & { role: 'assistant' }>;\n};\ntype UserBlock = {\n  type: 'user';\n  messages: Array<LanguageModelV3Message & { role: 'user' | 'tool' }>;\n};\n\nfunction groupIntoBlocks(\n  prompt: LanguageModelV3Prompt,\n): Array<SystemBlock | AssistantBlock | UserBlock> {\n  const blocks: Array<SystemBlock | AssistantBlock | UserBlock> = [];\n  let currentBlock: SystemBlock | AssistantBlock | UserBlock | undefined =\n    undefined;\n\n  for (const message of prompt) {\n    const { role } = message;\n    switch (role) {\n      case 'system': {\n        if (currentBlock?.type !== 'system') {\n          currentBlock = { type: 'system', messages: [] };\n          blocks.push(currentBlock);\n        }\n\n        currentBlock.messages.push(message);\n        break;\n      }\n      case 'assistant': {\n        if (currentBlock?.type !== 'assistant') {\n          currentBlock = { type: 'assistant', messages: [] };\n          blocks.push(currentBlock);\n        }\n\n        currentBlock.messages.push(message);\n        break;\n      }\n      case 'user': {\n        if (currentBlock?.type !== 'user') {\n          currentBlock = { type: 'user', messages: [] };\n          blocks.push(currentBlock);\n        }\n\n        currentBlock.messages.push(message);\n        break;\n      }\n      case 'tool': {\n        if (currentBlock?.type !== 'user') {\n          currentBlock = { type: 'user', messages: [] };\n          blocks.push(currentBlock);\n        }\n\n        currentBlock.messages.push(message);\n        break;\n      }\n      default: {\n        const _exhaustiveCheck: never = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n\n  return blocks;\n}\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const codeExecution_20250522OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      type: z.literal('code_execution_result'),\n      stdout: z.string(),\n      stderr: z.string(),\n      return_code: z.number(),\n      content: z\n        .array(\n          z.object({\n            type: z.literal('code_execution_output'),\n            file_id: z.string(),\n          }),\n        )\n        .optional()\n        .default([]),\n    }),\n  ),\n);\n\nconst codeExecution_20250522InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      code: z.string(),\n    }),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  {\n    /**\n     * The Python code to execute.\n     */\n    code: string;\n  },\n  {\n    type: 'code_execution_result';\n    stdout: string;\n    stderr: string;\n    return_code: number;\n    content: Array<{ type: 'code_execution_output'; file_id: string }>;\n  },\n  {}\n>({\n  id: 'anthropic.code_execution_20250522',\n  inputSchema: codeExecution_20250522InputSchema,\n  outputSchema: codeExecution_20250522OutputSchema,\n});\n\nexport const codeExecution_20250522 = (\n  args: Parameters<typeof factory>[0] = {},\n) => {\n  return factory(args);\n};\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const codeExecution_20250825OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.discriminatedUnion('type', [\n      z.object({\n        type: z.literal('code_execution_result'),\n        stdout: z.string(),\n        stderr: z.string(),\n        return_code: z.number(),\n        content: z\n          .array(\n            z.object({\n              type: z.literal('code_execution_output'),\n              file_id: z.string(),\n            }),\n          )\n          .optional()\n          .default([]),\n      }),\n      z.object({\n        type: z.literal('bash_code_execution_result'),\n        content: z.array(\n          z.object({\n            type: z.literal('bash_code_execution_output'),\n            file_id: z.string(),\n          }),\n        ),\n        stdout: z.string(),\n        stderr: z.string(),\n        return_code: z.number(),\n      }),\n      z.object({\n        type: z.literal('bash_code_execution_tool_result_error'),\n        error_code: z.string(),\n      }),\n      z.object({\n        type: z.literal('text_editor_code_execution_tool_result_error'),\n        error_code: z.string(),\n      }),\n      z.object({\n        type: z.literal('text_editor_code_execution_view_result'),\n        content: z.string(),\n        file_type: z.string(),\n        num_lines: z.number().nullable(),\n        start_line: z.number().nullable(),\n        total_lines: z.number().nullable(),\n      }),\n      z.object({\n        type: z.literal('text_editor_code_execution_create_result'),\n        is_file_update: z.boolean(),\n      }),\n      z.object({\n        type: z.literal('text_editor_code_execution_str_replace_result'),\n        lines: z.array(z.string()).nullable(),\n        new_lines: z.number().nullable(),\n        new_start: z.number().nullable(),\n        old_lines: z.number().nullable(),\n        old_start: z.number().nullable(),\n      }),\n    ]),\n  ),\n);\n\nexport const codeExecution_20250825InputSchema = lazySchema(() =>\n  zodSchema(\n    z.discriminatedUnion('type', [\n      // Programmatic tool calling format (mapped from { code } by AI SDK)\n      z.object({\n        type: z.literal('programmatic-tool-call'),\n        code: z.string(),\n      }),\n      z.object({\n        type: z.literal('bash_code_execution'),\n        command: z.string(),\n      }),\n      z.discriminatedUnion('command', [\n        z.object({\n          type: z.literal('text_editor_code_execution'),\n          command: z.literal('view'),\n          path: z.string(),\n        }),\n        z.object({\n          type: z.literal('text_editor_code_execution'),\n          command: z.literal('create'),\n          path: z.string(),\n          file_text: z.string().nullish(),\n        }),\n        z.object({\n          type: z.literal('text_editor_code_execution'),\n          command: z.literal('str_replace'),\n          path: z.string(),\n          old_str: z.string(),\n          new_str: z.string(),\n        }),\n      ]),\n    ]),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  | {\n      type: 'programmatic-tool-call';\n      /**\n       * Programmatic tool calling: Python code to execute when code_execution\n       * is used with allowedCallers to trigger client-executed tools.\n       */\n      code: string;\n    }\n  | {\n      type: 'bash_code_execution';\n\n      /**\n       * Shell command to execute.\n       */\n      command: string;\n    }\n  | {\n      type: 'text_editor_code_execution';\n      command: 'view';\n\n      /**\n       * The path to the file to view.\n       */\n      path: string;\n    }\n  | {\n      type: 'text_editor_code_execution';\n      command: 'create';\n\n      /**\n       * The path to the file to edit.\n       */\n      path: string;\n\n      /**\n       * The text of the file to edit.\n       */\n      file_text?: string | null;\n    }\n  | {\n      type: 'text_editor_code_execution';\n      command: 'str_replace';\n\n      /**\n       * The path to the file to edit.\n       */\n      path: string;\n\n      /**\n       * The string to replace.\n       */\n      old_str: string;\n\n      /**\n       * The new string to replace the old string with.\n       */\n      new_str: string;\n    },\n  | {\n      /**\n       * Programmatic tool calling result: returned when code_execution runs code\n       * that calls client-executed tools via allowedCallers.\n       */\n      type: 'code_execution_result';\n\n      /**\n       * Output from successful execution\n       */\n      stdout: string;\n\n      /**\n       * Error messages if execution fails\n       */\n      stderr: string;\n\n      /**\n       * 0 for success, non-zero for failure\n       */\n      return_code: number;\n\n      /**\n       * Output file Id list\n       */\n      content: Array<{ type: 'code_execution_output'; file_id: string }>;\n    }\n  | {\n      type: 'bash_code_execution_result';\n\n      /**\n       * Output file Id list\n       */\n      content: Array<{\n        type: 'bash_code_execution_output';\n        file_id: string;\n      }>;\n\n      /**\n       * Output from successful execution\n       */\n      stdout: string;\n\n      /**\n       * Error messages if execution fails\n       */\n      stderr: string;\n\n      /**\n       * 0 for success, non-zero for failure\n       */\n      return_code: number;\n    }\n  | {\n      type: 'bash_code_execution_tool_result_error';\n\n      /**\n       * Available options: invalid_tool_input, unavailable, too_many_requests,\n       * execution_time_exceeded, output_file_too_large.\n       */\n      error_code: string;\n    }\n  | {\n      type: 'text_editor_code_execution_tool_result_error';\n\n      /**\n       * Available options: invalid_tool_input, unavailable, too_many_requests,\n       * execution_time_exceeded, file_not_found.\n       */\n      error_code: string;\n    }\n  | {\n      type: 'text_editor_code_execution_view_result';\n\n      content: string;\n\n      /**\n       * The type of the file. Available options: text, image, pdf.\n       */\n      file_type: string;\n\n      num_lines: number | null;\n      start_line: number | null;\n      total_lines: number | null;\n    }\n  | {\n      type: 'text_editor_code_execution_create_result';\n\n      is_file_update: boolean;\n    }\n  | {\n      type: 'text_editor_code_execution_str_replace_result';\n\n      lines: string[] | null;\n      new_lines: number | null;\n      new_start: number | null;\n      old_lines: number | null;\n      old_start: number | null;\n    },\n  {\n    // no arguments\n  }\n>({\n  id: 'anthropic.code_execution_20250825',\n  inputSchema: codeExecution_20250825InputSchema,\n  outputSchema: codeExecution_20250825OutputSchema,\n  // Programmatic tool calling: tool results may be deferred to a later turn\n  // when code execution triggers a client-executed tool that needs to be\n  // resolved before the code execution result can be returned.\n  supportsDeferredResults: true,\n});\n\nexport const codeExecution_20250825 = (\n  args: Parameters<typeof factory>[0] = {},\n) => {\n  return factory(args);\n};\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nexport const codeExecution_20260120OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.discriminatedUnion('type', [\n      z.object({\n        type: z.literal('code_execution_result'),\n        stdout: z.string(),\n        stderr: z.string(),\n        return_code: z.number(),\n        content: z\n          .array(\n            z.object({\n              type: z.literal('code_execution_output'),\n              file_id: z.string(),\n            }),\n          )\n          .optional()\n          .default([]),\n      }),\n      z.object({\n        type: z.literal('encrypted_code_execution_result'),\n        encrypted_stdout: z.string(),\n        stderr: z.string(),\n        return_code: z.number(),\n        content: z\n          .array(\n            z.object({\n              type: z.literal('code_execution_output'),\n              file_id: z.string(),\n            }),\n          )\n          .optional()\n          .default([]),\n      }),\n      z.object({\n        type: z.literal('bash_code_execution_result'),\n        content: z.array(\n          z.object({\n            type: z.literal('bash_code_execution_output'),\n            file_id: z.string(),\n          }),\n        ),\n        stdout: z.string(),\n        stderr: z.string(),\n        return_code: z.number(),\n      }),\n      z.object({\n        type: z.literal('bash_code_execution_tool_result_error'),\n        error_code: z.string(),\n      }),\n      z.object({\n        type: z.literal('text_editor_code_execution_tool_result_error'),\n        error_code: z.string(),\n      }),\n      z.object({\n        type: z.literal('text_editor_code_execution_view_result'),\n        content: z.string(),\n        file_type: z.string(),\n        num_lines: z.number().nullable(),\n        start_line: z.number().nullable(),\n        total_lines: z.number().nullable(),\n      }),\n      z.object({\n        type: z.literal('text_editor_code_execution_create_result'),\n        is_file_update: z.boolean(),\n      }),\n      z.object({\n        type: z.literal('text_editor_code_execution_str_replace_result'),\n        lines: z.array(z.string()).nullable(),\n        new_lines: z.number().nullable(),\n        new_start: z.number().nullable(),\n        old_lines: z.number().nullable(),\n        old_start: z.number().nullable(),\n      }),\n    ]),\n  ),\n);\n\nexport const codeExecution_20260120InputSchema = lazySchema(() =>\n  zodSchema(\n    z.discriminatedUnion('type', [\n      z.object({\n        type: z.literal('programmatic-tool-call'),\n        code: z.string(),\n      }),\n      z.object({\n        type: z.literal('bash_code_execution'),\n        command: z.string(),\n      }),\n      z.discriminatedUnion('command', [\n        z.object({\n          type: z.literal('text_editor_code_execution'),\n          command: z.literal('view'),\n          path: z.string(),\n        }),\n        z.object({\n          type: z.literal('text_editor_code_execution'),\n          command: z.literal('create'),\n          path: z.string(),\n          file_text: z.string().nullish(),\n        }),\n        z.object({\n          type: z.literal('text_editor_code_execution'),\n          command: z.literal('str_replace'),\n          path: z.string(),\n          old_str: z.string(),\n          new_str: z.string(),\n        }),\n      ]),\n    ]),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  | {\n      type: 'programmatic-tool-call';\n      /**\n       * Programmatic tool calling: Python code to execute when code_execution\n       * is used with allowedCallers to trigger client-executed tools.\n       */\n      code: string;\n    }\n  | {\n      type: 'bash_code_execution';\n\n      /**\n       * Shell command to execute.\n       */\n      command: string;\n    }\n  | {\n      type: 'text_editor_code_execution';\n      command: 'view';\n\n      /**\n       * The path to the file to view.\n       */\n      path: string;\n    }\n  | {\n      type: 'text_editor_code_execution';\n      command: 'create';\n\n      /**\n       * The path to the file to edit.\n       */\n      path: string;\n\n      /**\n       * The text of the file to edit.\n       */\n      file_text?: string | null;\n    }\n  | {\n      type: 'text_editor_code_execution';\n      command: 'str_replace';\n\n      /**\n       * The path to the file to edit.\n       */\n      path: string;\n\n      /**\n       * The string to replace.\n       */\n      old_str: string;\n\n      /**\n       * The new string to replace the old string with.\n       */\n      new_str: string;\n    },\n  | {\n      /**\n       * Programmatic tool calling result: returned when code_execution runs code\n       * that calls client-executed tools via allowedCallers.\n       */\n      type: 'code_execution_result';\n\n      /**\n       * Output from successful execution\n       */\n      stdout: string;\n\n      /**\n       * Error messages if execution fails\n       */\n      stderr: string;\n\n      /**\n       * 0 for success, non-zero for failure\n       */\n      return_code: number;\n\n      /**\n       * Output file Id list\n       */\n      content: Array<{ type: 'code_execution_output'; file_id: string }>;\n    }\n  | {\n      type: 'encrypted_code_execution_result';\n\n      /**\n       * Encrypted output from successful execution\n       */\n      encrypted_stdout: string;\n\n      /**\n       * Error messages if execution fails\n       */\n      stderr: string;\n\n      /**\n       * 0 for success, non-zero for failure\n       */\n      return_code: number;\n\n      /**\n       * Output file Id list\n       */\n      content: Array<{ type: 'code_execution_output'; file_id: string }>;\n    }\n  | {\n      type: 'bash_code_execution_result';\n\n      /**\n       * Output file Id list\n       */\n      content: Array<{\n        type: 'bash_code_execution_output';\n        file_id: string;\n      }>;\n\n      /**\n       * Output from successful execution\n       */\n      stdout: string;\n\n      /**\n       * Error messages if execution fails\n       */\n      stderr: string;\n\n      /**\n       * 0 for success, non-zero for failure\n       */\n      return_code: number;\n    }\n  | {\n      type: 'bash_code_execution_tool_result_error';\n\n      /**\n       * Available options: invalid_tool_input, unavailable, too_many_requests,\n       * execution_time_exceeded, output_file_too_large.\n       */\n      error_code: string;\n    }\n  | {\n      type: 'text_editor_code_execution_tool_result_error';\n\n      /**\n       * Available options: invalid_tool_input, unavailable, too_many_requests,\n       * execution_time_exceeded, file_not_found.\n       */\n      error_code: string;\n    }\n  | {\n      type: 'text_editor_code_execution_view_result';\n\n      content: string;\n\n      /**\n       * The type of the file. Available options: text, image, pdf.\n       */\n      file_type: string;\n\n      num_lines: number | null;\n      start_line: number | null;\n      total_lines: number | null;\n    }\n  | {\n      type: 'text_editor_code_execution_create_result';\n\n      is_file_update: boolean;\n    }\n  | {\n      type: 'text_editor_code_execution_str_replace_result';\n\n      lines: string[] | null;\n      new_lines: number | null;\n      new_start: number | null;\n      old_lines: number | null;\n      old_start: number | null;\n    },\n  {\n    // no arguments\n  }\n>({\n  id: 'anthropic.code_execution_20260120',\n  inputSchema: codeExecution_20260120InputSchema,\n  outputSchema: codeExecution_20260120OutputSchema,\n  supportsDeferredResults: true,\n});\n\nexport const codeExecution_20260120 = (\n  args: Parameters<typeof factory>[0] = {},\n) => {\n  return factory(args);\n};\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\n/**\n * Output schema for tool search results - returns tool references\n * that are automatically expanded into full tool definitions by the API.\n */\nexport const toolSearchRegex_20251119OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.array(\n      z.object({\n        type: z.literal('tool_reference'),\n        toolName: z.string(),\n      }),\n    ),\n  ),\n);\n\n/**\n * Input schema for regex-based tool search.\n * Claude constructs regex patterns using Python's re.search() syntax.\n */\nconst toolSearchRegex_20251119InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      /**\n       * A regex pattern to search for tools.\n       * Uses Python re.search() syntax. Maximum 200 characters.\n       *\n       * Examples:\n       * - \"weather\" - matches tool names/descriptions containing \"weather\"\n       * - \"get_.*_data\" - matches tools like get_user_data, get_weather_data\n       * - \"database.*query|query.*database\" - OR patterns for flexibility\n       * - \"(?i)slack\" - case-insensitive search\n       */\n      pattern: z.string(),\n      /**\n       * Maximum number of tools to return. Optional.\n       */\n      limit: z.number().optional(),\n    }),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  {\n    /**\n     * A regex pattern to search for tools.\n     * Uses Python re.search() syntax. Maximum 200 characters.\n     *\n     * Examples:\n     * - \"weather\" - matches tool names/descriptions containing \"weather\"\n     * - \"get_.*_data\" - matches tools like get_user_data, get_weather_data\n     * - \"database.*query|query.*database\" - OR patterns for flexibility\n     * - \"(?i)slack\" - case-insensitive search\n     */\n    pattern: string;\n    /**\n     * Maximum number of tools to return. Optional.\n     */\n    limit?: number;\n  },\n  Array<{\n    type: 'tool_reference';\n    /**\n     * The name of the discovered tool.\n     */\n    toolName: string;\n  }>,\n  {}\n>({\n  id: 'anthropic.tool_search_regex_20251119',\n  inputSchema: toolSearchRegex_20251119InputSchema,\n  outputSchema: toolSearchRegex_20251119OutputSchema,\n  supportsDeferredResults: true,\n});\n\n/**\n * Creates a tool search tool that uses regex patterns to find tools.\n *\n * The tool search tool enables Claude to work with hundreds or thousands of tools\n * by dynamically discovering and loading them on-demand. Instead of loading all\n * tool definitions into the context window upfront, Claude searches your tool\n * catalog and loads only the tools it needs.\n *\n * When Claude uses this tool, it constructs regex patterns using Python's\n * re.search() syntax (NOT natural language queries).\n *\n * **Important**: This tool should never have `deferLoading: true` in providerOptions.\n *\n * @example\n * ```ts\n * import { anthropicTools } from '@ai-sdk/anthropic';\n *\n * const tools = {\n *   toolSearch: anthropicTools.toolSearchRegex_20251119(),\n *   // Other tools with deferLoading...\n * };\n * ```\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-search-tool\n */\nexport const toolSearchRegex_20251119 = (\n  args: Parameters<typeof factory>[0] = {},\n) => {\n  return factory(args);\n};\n","import type { LanguageModelV3FinishReason } from '@ai-sdk/provider';\n\n/**\n * @see https://docs.anthropic.com/en/api/messages#response-stop-reason\n */\nexport function mapAnthropicStopReason({\n  finishReason,\n  isJsonResponseFromTool,\n}: {\n  finishReason: string | null | undefined;\n  isJsonResponseFromTool?: boolean;\n}): LanguageModelV3FinishReason['unified'] {\n  switch (finishReason) {\n    case 'pause_turn':\n    case 'end_turn':\n    case 'stop_sequence':\n      return 'stop';\n    case 'refusal':\n      return 'content-filter';\n    case 'tool_use':\n      return isJsonResponseFromTool ? 'stop' : 'tool-calls';\n    case 'max_tokens':\n    case 'model_context_window_exceeded':\n      return 'length';\n    case 'compaction':\n      return 'other';\n    default:\n      return 'other';\n  }\n}\n","import type { JSONSchema7, JSONSchema7Definition } from '@ai-sdk/provider';\n\nconst SUPPORTED_STRING_FORMATS = new Set([\n  'date-time',\n  'time',\n  'date',\n  'duration',\n  'email',\n  'hostname',\n  'uri',\n  'ipv4',\n  'ipv6',\n  'uuid',\n]);\n\nconst DESCRIPTION_CONSTRAINT_KEYS = [\n  'minimum',\n  'maximum',\n  'exclusiveMinimum',\n  'exclusiveMaximum',\n  'multipleOf',\n  'minLength',\n  'maxLength',\n  'pattern',\n  'minItems',\n  'maxItems',\n  'uniqueItems',\n  'minProperties',\n  'maxProperties',\n  'not',\n] satisfies Array<keyof JSONSchema7>;\n\n/**\n * Removes JSON Schema keywords that Anthropic rejects in\n * `output_config.format.schema`.\n *\n * The full original schema is still used by AI SDK result validation. This\n * only relaxes the schema sent to Anthropic's constrained decoder.\n */\nexport function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7 {\n  return sanitizeSchema(schema) as JSONSchema7;\n}\n\nfunction sanitizeDefinition(\n  definition: JSONSchema7Definition,\n): JSONSchema7Definition {\n  if (typeof definition === 'boolean' || !isPlainObject(definition)) {\n    return definition;\n  }\n\n  return sanitizeSchema(definition as JSONSchema7);\n}\n\nfunction sanitizeSchema(schema: JSONSchema7): JSONSchema7 {\n  const result: JSONSchema7 = {};\n  const schemaWithDefs = schema as JSONSchema7 & {\n    $defs?: Record<string, JSONSchema7Definition>;\n  };\n\n  if (schema.$ref != null) {\n    return { $ref: schema.$ref };\n  }\n\n  if (schema.$schema != null) {\n    result.$schema = schema.$schema;\n  }\n\n  if (schema.$id != null) {\n    result.$id = schema.$id;\n  }\n\n  if (schema.title != null) {\n    result.title = schema.title;\n  }\n\n  if (schema.description != null) {\n    result.description = schema.description;\n  }\n\n  if (schema.default !== undefined) {\n    result.default = schema.default;\n  }\n\n  if (schema.const !== undefined) {\n    result.const = schema.const;\n  }\n\n  if (schema.enum != null) {\n    result.enum = schema.enum;\n  }\n\n  if (schema.type != null) {\n    result.type = schema.type;\n  }\n\n  if (schema.anyOf != null) {\n    result.anyOf = schema.anyOf.map(sanitizeDefinition);\n  } else if (schema.oneOf != null) {\n    result.anyOf = schema.oneOf.map(sanitizeDefinition);\n  }\n\n  if (schema.allOf != null) {\n    result.allOf = schema.allOf.map(sanitizeDefinition);\n  }\n\n  if (schema.definitions != null) {\n    result.definitions = Object.fromEntries(\n      Object.entries(schema.definitions).map(([name, definition]) => [\n        name,\n        sanitizeDefinition(definition),\n      ]),\n    );\n  }\n\n  if (schemaWithDefs.$defs != null) {\n    const resultWithDefs = result as JSONSchema7 & {\n      $defs?: Record<string, JSONSchema7Definition>;\n    };\n    resultWithDefs.$defs = Object.fromEntries(\n      Object.entries(schemaWithDefs.$defs).map(([name, definition]) => [\n        name,\n        sanitizeDefinition(definition),\n      ]),\n    );\n  }\n\n  if (schema.type === 'object' || schema.properties != null) {\n    if (schema.properties != null) {\n      result.properties = Object.fromEntries(\n        Object.entries(schema.properties).map(([name, definition]) => [\n          name,\n          sanitizeDefinition(definition),\n        ]),\n      );\n    }\n\n    result.additionalProperties = false;\n\n    if (schema.required != null) {\n      result.required = schema.required;\n    }\n  }\n\n  if (schema.items != null) {\n    result.items = Array.isArray(schema.items)\n      ? schema.items.map(sanitizeDefinition)\n      : sanitizeDefinition(schema.items);\n  }\n\n  if (\n    typeof schema.format === 'string' &&\n    SUPPORTED_STRING_FORMATS.has(schema.format)\n  ) {\n    result.format = schema.format;\n  }\n\n  const constraintDescription = getConstraintDescription(schema);\n  if (constraintDescription != null) {\n    result.description =\n      result.description == null\n        ? constraintDescription\n        : `${result.description}\\n${constraintDescription}`;\n  }\n\n  return result;\n}\n\nfunction getConstraintDescription(schema: JSONSchema7): string | undefined {\n  const descriptions = DESCRIPTION_CONSTRAINT_KEYS.flatMap(key => {\n    const value = schema[key];\n\n    if (value == null || value === false) {\n      return [];\n    }\n\n    return `${formatConstraintName(key)}: ${formatConstraintValue(value)}`;\n  });\n\n  if (\n    typeof schema.format === 'string' &&\n    !SUPPORTED_STRING_FORMATS.has(schema.format)\n  ) {\n    descriptions.push(`format: ${schema.format}`);\n  }\n\n  return descriptions.length === 0 ? undefined : `${descriptions.join('; ')}.`;\n}\n\nfunction formatConstraintName(key: string): string {\n  return key.replace(/[A-Z]/g, match => ` ${match.toLowerCase()}`);\n}\n\nfunction formatConstraintValue(value: unknown): string {\n  if (typeof value === 'string') {\n    return value;\n  }\n\n  return JSON.stringify(value);\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n  return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst bash_20241022InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      command: z.string(),\n      restart: z.boolean().optional(),\n    }),\n  ),\n);\n\nexport const bash_20241022 = createProviderToolFactory<\n  {\n    /**\n     * The bash command to run. Required unless the tool is being restarted.\n     */\n    command: string;\n\n    /**\n     * Specifying true will restart this tool. Otherwise, leave this unspecified.\n     */\n    restart?: boolean;\n  },\n  {}\n>({\n  id: 'anthropic.bash_20241022',\n  inputSchema: bash_20241022InputSchema,\n});\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst bash_20250124InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      command: z.string(),\n      restart: z.boolean().optional(),\n    }),\n  ),\n);\n\nexport const bash_20250124 = createProviderToolFactory<\n  {\n    /**\n     * The bash command to run. Required unless the tool is being restarted.\n     */\n    command: string;\n\n    /**\n     * Specifying true will restart this tool. Otherwise, leave this unspecified.\n     */\n    restart?: boolean;\n  },\n  {}\n>({\n  id: 'anthropic.bash_20250124',\n  inputSchema: bash_20250124InputSchema,\n});\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst computer_20241022InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      action: z.enum([\n        'key',\n        'type',\n        'mouse_move',\n        'left_click',\n        'left_click_drag',\n        'right_click',\n        'middle_click',\n        'double_click',\n        'screenshot',\n        'cursor_position',\n      ]),\n      coordinate: z.array(z.number().int()).optional(),\n      text: z.string().optional(),\n    }),\n  ),\n);\n\nexport const computer_20241022 = createProviderToolFactory<\n  {\n    /**\n     * The action to perform. The available actions are:\n     * - `key`: Press a key or key-combination on the keyboard.\n     *   - This supports xdotool's `key` syntax.\n     *   - Examples: \"a\", \"Return\", \"alt+Tab\", \"ctrl+s\", \"Up\", \"KP_0\" (for the numpad 0 key).\n     * - `type`: Type a string of text on the keyboard.\n     * - `cursor_position`: Get the current (x, y) pixel coordinate of the cursor on the screen.\n     * - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on the screen.\n     * - `left_click`: Click the left mouse button.\n     * - `left_click_drag`: Click and drag the cursor to a specified (x, y) pixel coordinate on the screen.\n     * - `right_click`: Click the right mouse button.\n     * - `middle_click`: Click the middle mouse button.\n     * - `double_click`: Double-click the left mouse button.\n     * - `screenshot`: Take a screenshot of the screen.\n     */\n    action:\n      | 'key'\n      | 'type'\n      | 'mouse_move'\n      | 'left_click'\n      | 'left_click_drag'\n      | 'right_click'\n      | 'middle_click'\n      | 'double_click'\n      | 'screenshot'\n      | 'cursor_position';\n\n    /**\n     * (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=mouse_move` and `action=left_click_drag`.\n     */\n    coordinate?: number[];\n\n    /**\n     * Required only by `action=type` and `action=key`.\n     */\n    text?: string;\n  },\n  {\n    /**\n     * The width of the display being controlled by the model in pixels.\n     */\n    displayWidthPx: number;\n\n    /**\n     * The height of the display being controlled by the model in pixels.\n     */\n    displayHeightPx: number;\n\n    /**\n     * The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n     */\n    displayNumber?: number;\n  }\n>({\n  id: 'anthropic.computer_20241022',\n  inputSchema: computer_20241022InputSchema,\n});\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst computer_20250124InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      action: z.enum([\n        'key',\n        'hold_key',\n        'type',\n        'cursor_position',\n        'mouse_move',\n        'left_mouse_down',\n        'left_mouse_up',\n        'left_click',\n        'left_click_drag',\n        'right_click',\n        'middle_click',\n        'double_click',\n        'triple_click',\n        'scroll',\n        'wait',\n        'screenshot',\n      ]),\n      coordinate: z.tuple([z.number().int(), z.number().int()]).optional(),\n      duration: z.number().optional(),\n      scroll_amount: z.number().optional(),\n      scroll_direction: z.enum(['up', 'down', 'left', 'right']).optional(),\n      start_coordinate: z\n        .tuple([z.number().int(), z.number().int()])\n        .optional(),\n      text: z.string().optional(),\n    }),\n  ),\n);\n\nexport const computer_20250124 = createProviderToolFactory<\n  {\n    /**\n     * - `key`: Press a key or key-combination on the keyboard.\n     *   - This supports xdotool's `key` syntax.\n     *   - Examples: \"a\", \"Return\", \"alt+Tab\", \"ctrl+s\", \"Up\", \"KP_0\" (for the numpad 0 key).\n     * - `hold_key`: Hold down a key or multiple keys for a specified duration (in seconds). Supports the same syntax as `key`.\n     * - `type`: Type a string of text on the keyboard.\n     * - `cursor_position`: Get the current (x, y) pixel coordinate of the cursor on the screen.\n     * - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on the screen.\n     * - `left_mouse_down`: Press the left mouse button.\n     * - `left_mouse_up`: Release the left mouse button.\n     * - `left_click`: Click the left mouse button at the specified (x, y) pixel coordinate on the screen. You can also include a key combination to hold down while clicking using the `text` parameter.\n     * - `left_click_drag`: Click and drag the cursor from `start_coordinate` to a specified (x, y) pixel coordinate on the screen.\n     * - `right_click`: Click the right mouse button at the specified (x, y) pixel coordinate on the screen.\n     * - `middle_click`: Click the middle mouse button at the specified (x, y) pixel coordinate on the screen.\n     * - `double_click`: Double-click the left mouse button at the specified (x, y) pixel coordinate on the screen.\n     * - `triple_click`: Triple-click the left mouse button at the specified (x, y) pixel coordinate on the screen.\n     * - `scroll`: Scroll the screen in a specified direction by a specified amount of clicks of the scroll wheel, at the specified (x, y) pixel coordinate. DO NOT use PageUp/PageDown to scroll.\n     * - `wait`: Wait for a specified duration (in seconds).\n     * - `screenshot`: Take a screenshot of the screen.\n     */\n    action:\n      | 'key'\n      | 'hold_key'\n      | 'type'\n      | 'cursor_position'\n      | 'mouse_move'\n      | 'left_mouse_down'\n      | 'left_mouse_up'\n      | 'left_click'\n      | 'left_click_drag'\n      | 'right_click'\n      | 'middle_click'\n      | 'double_click'\n      | 'triple_click'\n      | 'scroll'\n      | 'wait'\n      | 'screenshot';\n\n    /**\n     * (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=mouse_move` and `action=left_click_drag`.\n     */\n    coordinate?: [number, number];\n\n    /**\n     * The duration to hold the key down for. Required only by `action=hold_key` and `action=wait`.\n     */\n    duration?: number;\n\n    /**\n     * The number of 'clicks' to scroll. Required only by `action=scroll`.\n     */\n    scroll_amount?: number;\n\n    /**\n     * The direction to scroll the screen. Required only by `action=scroll`.\n     */\n    scroll_direction?: 'up' | 'down' | 'left' | 'right';\n\n    /**\n     * (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to start the drag from. Required only by `action=left_click_drag`.\n     */\n    start_coordinate?: [number, number];\n\n    /**\n     * Required only by `action=type`, `action=key`, and `action=hold_key`. Can also be used by click or scroll actions to hold down keys while clicking or scrolling.\n     */\n    text?: string;\n  },\n  {\n    /**\n     * The width of the display being controlled by the model in pixels.\n     */\n    displayWidthPx: number;\n\n    /**\n     * The height of the display being controlled by the model in pixels.\n     */\n    displayHeightPx: number;\n\n    /**\n     * The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n     */\n    displayNumber?: number;\n  }\n>({\n  id: 'anthropic.computer_20250124',\n  inputSchema: computer_20250124InputSchema,\n});\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst computer_20251124InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      action: z.enum([\n        'key',\n        'hold_key',\n        'type',\n        'cursor_position',\n        'mouse_move',\n        'left_mouse_down',\n        'left_mouse_up',\n        'left_click',\n        'left_click_drag',\n        'right_click',\n        'middle_click',\n        'double_click',\n        'triple_click',\n        'scroll',\n        'wait',\n        'screenshot',\n        'zoom',\n      ]),\n      coordinate: z.tuple([z.number().int(), z.number().int()]).optional(),\n      duration: z.number().optional(),\n      region: z\n        .tuple([\n          z.number().int(),\n          z.number().int(),\n          z.number().int(),\n          z.number().int(),\n        ])\n        .optional(),\n      scroll_amount: z.number().optional(),\n      scroll_direction: z.enum(['up', 'down', 'left', 'right']).optional(),\n      start_coordinate: z\n        .tuple([z.number().int(), z.number().int()])\n        .optional(),\n      text: z.string().optional(),\n    }),\n  ),\n);\n\nexport const computer_20251124 = createProviderToolFactory<\n  {\n    /**\n     * - `key`: Press a key or key-combination on the keyboard.\n     *   - This supports xdotool's `key` syntax.\n     *   - Examples: \"a\", \"Return\", \"alt+Tab\", \"ctrl+s\", \"Up\", \"KP_0\" (for the numpad 0 key).\n     * - `hold_key`: Hold down a key or multiple keys for a specified duration (in seconds). Supports the same syntax as `key`.\n     * - `type`: Type a string of text on the keyboard.\n     * - `cursor_position`: Get the current (x, y) pixel coordinate of the cursor on the screen.\n     * - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on the screen.\n     * - `left_mouse_down`: Press the left mouse button.\n     * - `left_mouse_up`: Release the left mouse button.\n     * - `left_click`: Click the left mouse button at the specified (x, y) pixel coordinate on the screen. You can also include a key combination to hold down while clicking using the `text` parameter.\n     * - `left_click_drag`: Click and drag the cursor from `start_coordinate` to a specified (x, y) pixel coordinate on the screen.\n     * - `right_click`: Click the right mouse button at the specified (x, y) pixel coordinate on the screen.\n     * - `middle_click`: Click the middle mouse button at the specified (x, y) pixel coordinate on the screen.\n     * - `double_click`: Double-click the left mouse button at the specified (x, y) pixel coordinate on the screen.\n     * - `triple_click`: Triple-click the left mouse button at the specified (x, y) pixel coordinate on the screen.\n     * - `scroll`: Scroll the screen in a specified direction by a specified amount of clicks of the scroll wheel, at the specified (x, y) pixel coordinate. DO NOT use PageUp/PageDown to scroll.\n     * - `wait`: Wait for a specified duration (in seconds).\n     * - `screenshot`: Take a screenshot of the screen.\n     * - `zoom`: View a specific region of the screen at full resolution. Requires `enableZoom: true` in tool definition. Takes a `region` parameter with coordinates `[x1, y1, x2, y2]` defining top-left and bottom-right corners of the area to inspect.\n     */\n    action:\n      | 'key'\n      | 'hold_key'\n      | 'type'\n      | 'cursor_position'\n      | 'mouse_move'\n      | 'left_mouse_down'\n      | 'left_mouse_up'\n      | 'left_click'\n      | 'left_click_drag'\n      | 'right_click'\n      | 'middle_click'\n      | 'double_click'\n      | 'triple_click'\n      | 'scroll'\n      | 'wait'\n      | 'screenshot'\n      | 'zoom';\n\n    /**\n     * (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=mouse_move` and `action=left_click_drag`.\n     */\n    coordinate?: [number, number];\n\n    /**\n     * The duration to hold the key down for. Required only by `action=hold_key` and `action=wait`.\n     */\n    duration?: number;\n\n    /**\n     * [x1, y1, x2, y2]: The coordinates defining the region to zoom into. x1, y1 is the top-left corner and x2, y2 is the bottom-right corner. Required only by `action=zoom`.\n     */\n    region?: [number, number, number, number];\n\n    /**\n     * The number of 'clicks' to scroll. Required only by `action=scroll`.\n     */\n    scroll_amount?: number;\n\n    /**\n     * The direction to scroll the screen. Required only by `action=scroll`.\n     */\n    scroll_direction?: 'up' | 'down' | 'left' | 'right';\n\n    /**\n     * (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to start the drag from. Required only by `action=left_click_drag`.\n     */\n    start_coordinate?: [number, number];\n\n    /**\n     * Required only by `action=type`, `action=key`, and `action=hold_key`. Can also be used by click or scroll actions to hold down keys while clicking or scrolling.\n     */\n    text?: string;\n  },\n  {\n    /**\n     * The width of the display being controlled by the model in pixels.\n     */\n    displayWidthPx: number;\n\n    /**\n     * The height of the display being controlled by the model in pixels.\n     */\n    displayHeightPx: number;\n\n    /**\n     * The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n     */\n    displayNumber?: number;\n\n    /**\n     * Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.\n     */\n    enableZoom?: boolean;\n  }\n>({\n  id: 'anthropic.computer_20251124',\n  inputSchema: computer_20251124InputSchema,\n});\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst memory_20250818InputSchema = lazySchema(() =>\n  zodSchema(\n    z.discriminatedUnion('command', [\n      z.object({\n        command: z.literal('view'),\n        path: z.string(),\n        view_range: z.tuple([z.number(), z.number()]).optional(),\n      }),\n      z.object({\n        command: z.literal('create'),\n        path: z.string(),\n        file_text: z.string(),\n      }),\n      z.object({\n        command: z.literal('str_replace'),\n        path: z.string(),\n        old_str: z.string(),\n        new_str: z.string(),\n      }),\n      z.object({\n        command: z.literal('insert'),\n        path: z.string(),\n        insert_line: z.number(),\n        insert_text: z.string(),\n      }),\n      z.object({\n        command: z.literal('delete'),\n        path: z.string(),\n      }),\n      z.object({\n        command: z.literal('rename'),\n        old_path: z.string(),\n        new_path: z.string(),\n      }),\n    ]),\n  ),\n);\n\nexport const memory_20250818 = createProviderToolFactory<\n  | { command: 'view'; path: string; view_range?: [number, number] }\n  | { command: 'create'; path: string; file_text: string }\n  | { command: 'str_replace'; path: string; old_str: string; new_str: string }\n  | {\n      command: 'insert';\n      path: string;\n      insert_line: number;\n      insert_text: string;\n    }\n  | { command: 'delete'; path: string }\n  | { command: 'rename'; old_path: string; new_path: string },\n  {}\n>({\n  id: 'anthropic.memory_20250818',\n  inputSchema: memory_20250818InputSchema,\n});\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst textEditor_20241022InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      command: z.enum(['view', 'create', 'str_replace', 'insert', 'undo_edit']),\n      path: z.string(),\n      file_text: z.string().optional(),\n      insert_line: z.number().int().optional(),\n      new_str: z.string().optional(),\n      insert_text: z.string().optional(),\n      old_str: z.string().optional(),\n      view_range: z.array(z.number().int()).optional(),\n    }),\n  ),\n);\n\nexport const textEditor_20241022 = createProviderToolFactory<\n  {\n    /**\n     * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`, `undo_edit`.\n     */\n    command: 'view' | 'create' | 'str_replace' | 'insert' | 'undo_edit';\n\n    /**\n     * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.\n     */\n    path: string;\n\n    /**\n     * Required parameter of `create` command, with the content of the file to be created.\n     */\n    file_text?: string;\n\n    /**\n     * Required parameter of `insert` command. The `new_str` will be inserted AFTER the line `insert_line` of `path`.\n     */\n    insert_line?: number;\n\n    /**\n     * Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).\n     */\n    new_str?: string;\n\n    /**\n     * Required parameter of `insert` command containing the text to insert.\n     */\n    insert_text?: string;\n\n    /**\n     * Required parameter of `str_replace` command containing the string in `path` to replace.\n     */\n    old_str?: string;\n\n    /**\n     * Optional parameter of `view` command when `path` points to a file. If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file.\n     */\n    view_range?: number[];\n  },\n  {}\n>({\n  id: 'anthropic.text_editor_20241022',\n  inputSchema: textEditor_20241022InputSchema,\n});\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst textEditor_20250124InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      command: z.enum(['view', 'create', 'str_replace', 'insert', 'undo_edit']),\n      path: z.string(),\n      file_text: z.string().optional(),\n      insert_line: z.number().int().optional(),\n      new_str: z.string().optional(),\n      insert_text: z.string().optional(),\n      old_str: z.string().optional(),\n      view_range: z.array(z.number().int()).optional(),\n    }),\n  ),\n);\n\nexport const textEditor_20250124 = createProviderToolFactory<\n  {\n    /**\n     * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`, `undo_edit`.\n     */\n    command: 'view' | 'create' | 'str_replace' | 'insert' | 'undo_edit';\n\n    /**\n     * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.\n     */\n    path: string;\n\n    /**\n     * Required parameter of `create` command, with the content of the file to be created.\n     */\n    file_text?: string;\n\n    /**\n     * Required parameter of `insert` command. The `new_str` will be inserted AFTER the line `insert_line` of `path`.\n     */\n    insert_line?: number;\n\n    /**\n     * Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).\n     */\n    new_str?: string;\n\n    /**\n     * Required parameter of `insert` command containing the text to insert.\n     */\n    insert_text?: string;\n\n    /**\n     * Required parameter of `str_replace` command containing the string in `path` to replace.\n     */\n    old_str?: string;\n\n    /**\n     * Optional parameter of `view` command when `path` points to a file. If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file.\n     */\n    view_range?: number[];\n  },\n  {}\n>({\n  id: 'anthropic.text_editor_20250124',\n  inputSchema: textEditor_20250124InputSchema,\n});\n","import {\n  createProviderToolFactory,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\nconst textEditor_20250429InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      command: z.enum(['view', 'create', 'str_replace', 'insert']),\n      path: z.string(),\n      file_text: z.string().optional(),\n      insert_line: z.number().int().optional(),\n      new_str: z.string().optional(),\n      insert_text: z.string().optional(),\n      old_str: z.string().optional(),\n      view_range: z.array(z.number().int()).optional(),\n    }),\n  ),\n);\n\nexport const textEditor_20250429 = createProviderToolFactory<\n  {\n    /**\n     * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`.\n     * Note: `undo_edit` is not supported in Claude 4 models.\n     */\n    command: 'view' | 'create' | 'str_replace' | 'insert';\n\n    /**\n     * Absolute path to file or directory, e.g. `/repo/file.py` or `/repo`.\n     */\n    path: string;\n\n    /**\n     * Required parameter of `create` command, with the content of the file to be created.\n     */\n    file_text?: string;\n\n    /**\n     * Required parameter of `insert` command. The `new_str` will be inserted AFTER the line `insert_line` of `path`.\n     */\n    insert_line?: number;\n\n    /**\n     * Optional parameter of `str_replace` command containing the new string (if not given, no string will be added).\n     */\n    new_str?: string;\n\n    /**\n     * Required parameter of `insert` command containing the text to insert.\n     */\n    insert_text?: string;\n\n    /**\n     * Required parameter of `str_replace` command containing the string in `path` to replace.\n     */\n    old_str?: string;\n\n    /**\n     * Optional parameter of `view` command when `path` points to a file. If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file.\n     */\n    view_range?: number[];\n  },\n  {}\n>({\n  id: 'anthropic.text_editor_20250429',\n  inputSchema: textEditor_20250429InputSchema,\n});\n","import {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema,\n  zodSchema,\n} from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\n\n/**\n * Output schema for tool search results - returns tool references\n * that are automatically expanded into full tool definitions by the API.\n */\nexport const toolSearchBm25_20251119OutputSchema = lazySchema(() =>\n  zodSchema(\n    z.array(\n      z.object({\n        type: z.literal('tool_reference'),\n        toolName: z.string(),\n      }),\n    ),\n  ),\n);\n\n/**\n * Input schema for BM25-based tool search.\n * Claude uses natural language queries to search for tools.\n */\nconst toolSearchBm25_20251119InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      /**\n       * A natural language query to search for tools.\n       * Claude will use BM25 text search to find relevant tools.\n       */\n      query: z.string(),\n      /**\n       * Maximum number of tools to return. Optional.\n       */\n      limit: z.number().optional(),\n    }),\n  ),\n);\n\nconst factory = createProviderToolFactoryWithOutputSchema<\n  {\n    /**\n     * A natural language query to search for tools.\n     * Claude will use BM25 text search to find relevant tools.\n     */\n    query: string;\n    /**\n     * Maximum number of tools to return. Optional.\n     */\n    limit?: number;\n  },\n  Array<{\n    type: 'tool_reference';\n    /**\n     * The name of the discovered tool.\n     */\n    toolName: string;\n  }>,\n  {}\n>({\n  id: 'anthropic.tool_search_bm25_20251119',\n  inputSchema: toolSearchBm25_20251119InputSchema,\n  outputSchema: toolSearchBm25_20251119OutputSchema,\n  supportsDeferredResults: true,\n});\n\n/**\n * Creates a tool search tool that uses BM25 (natural language) to find tools.\n *\n * The tool search tool enables Claude to work with hundreds or thousands of tools\n * by dynamically discovering and loading them on-demand. Instead of loading all\n * tool definitions into the context window upfront, Claude searches your tool\n * catalog and loads only the tools it needs.\n *\n * When Claude uses this tool, it uses natural language queries (NOT regex patterns)\n * to search for tools using BM25 text search.\n *\n * **Important**: This tool should never have `deferLoading: true` in providerOptions.\n *\n * @example\n * ```ts\n * import { anthropicTools } from '@ai-sdk/anthropic';\n *\n * const tools = {\n *   toolSearch: anthropicTools.toolSearchBm25_20251119(),\n *   // Other tools with deferLoading...\n * };\n * ```\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-search-tool\n */\nexport const toolSearchBm25_20251119 = (\n  args: Parameters<typeof factory>[0] = {},\n) => {\n  return factory(args);\n};\n","import { advisor_20260301 } from './tool/advisor_20260301';\nimport { bash_20241022 } from './tool/bash_20241022';\nimport { bash_20250124 } from './tool/bash_20250124';\nimport { codeExecution_20250522 } from './tool/code-execution_20250522';\nimport { codeExecution_20250825 } from './tool/code-execution_20250825';\nimport { codeExecution_20260120 } from './tool/code-execution_20260120';\nimport { computer_20241022 } from './tool/computer_20241022';\nimport { computer_20250124 } from './tool/computer_20250124';\nimport { computer_20251124 } from './tool/computer_20251124';\nimport { memory_20250818 } from './tool/memory_20250818';\nimport { textEditor_20241022 } from './tool/text-editor_20241022';\nimport { textEditor_20250124 } from './tool/text-editor_20250124';\nimport { textEditor_20250429 } from './tool/text-editor_20250429';\nimport { textEditor_20250728 } from './tool/text-editor_20250728';\nimport { toolSearchBm25_20251119 } from './tool/tool-search-bm25_20251119';\nimport { toolSearchRegex_20251119 } from './tool/tool-search-regex_20251119';\nimport { webFetch_20260209 } from './tool/web-fetch-20260209';\nimport { webFetch_20250910 } from './tool/web-fetch-20250910';\nimport { webSearch_20260209 } from './tool/web-search_20260209';\nimport { webSearch_20250305 } from './tool/web-search_20250305';\n\nexport const anthropicTools = {\n  /**\n   * Pairs a faster executor model with a higher-intelligence advisor model\n   * that provides strategic guidance mid-generation.\n   *\n   * The advisor lets a faster, lower-cost executor model consult a\n   * higher-intelligence advisor model server-side. The advisor reads the\n   * executor's full transcript and produces a plan or course correction;\n   * the executor continues with the task, informed by the advice. All of\n   * this happens inside a single `/v1/messages` request.\n   *\n   * Beta header `advisor-tool-2026-03-01` is added automatically when this\n   * tool is included.\n   *\n   * Multi-turn conversations: pass the full assistant content (including\n   * `advisor_tool_result` blocks) back to the API on subsequent turns. If\n   * you omit the advisor tool from `tools` on a follow-up turn while the\n   * message history still contains `advisor_tool_result` blocks, the API\n   * returns a `400 invalid_request_error`.\n   *\n   * Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,\n   * Opus 4.7. The advisor must be at least as capable as the executor.\n   *\n   * @param model - The advisor model ID (required), e.g. `\"claude-opus-4-7\"`.\n   * @param maxUses - Maximum advisor calls per request (per-request cap).\n   * @param caching - Enables prompt caching for the advisor's transcript\n   * across calls within a conversation. Worthwhile from ~3 advisor calls\n   * per conversation.\n   */\n  advisor_20260301,\n\n  /**\n   * The bash tool enables Claude to execute shell commands in a persistent bash session,\n   * allowing system operations, script execution, and command-line automation.\n   *\n   * Image results are supported.\n   */\n  bash_20241022,\n\n  /**\n   * The bash tool enables Claude to execute shell commands in a persistent bash session,\n   * allowing system operations, script execution, and command-line automation.\n   *\n   * Image results are supported.\n   */\n  bash_20250124,\n\n  /**\n   * Claude can analyze data, create visualizations, perform complex calculations,\n   * run system commands, create and edit files, and process uploaded files directly within\n   * the API conversation.\n   *\n   * The code execution tool allows Claude to run Bash commands and manipulate files,\n   * including writing code, in a secure, sandboxed environment.\n   */\n  codeExecution_20250522,\n\n  /**\n   * Claude can analyze data, create visualizations, perform complex calculations,\n   * run system commands, create and edit files, and process uploaded files directly within\n   * the API conversation.\n   *\n   * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,\n   * including writing code, in a secure, sandboxed environment.\n   *\n   * This is the latest version with enhanced Bash support and file operations.\n   */\n  codeExecution_20250825,\n\n  /**\n   * Claude can analyze data, create visualizations, perform complex calculations,\n   * run system commands, create and edit files, and process uploaded files directly within\n   * the API conversation.\n   *\n   * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,\n   * including writing code, in a secure, sandboxed environment.\n   *\n   * This is the recommended version. Does not require a beta header.\n   *\n   * Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5\n   */\n  codeExecution_20260120,\n\n  /**\n   * Claude can interact with computer environments through the computer use tool, which\n   * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n   *\n   * Image results are supported.\n   *\n   * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n   * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n   * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n   */\n  computer_20241022,\n\n  /**\n   * Claude can interact with computer environments through the computer use tool, which\n   * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n   *\n   * Image results are supported.\n   *\n   * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n   * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n   * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n   */\n  computer_20250124,\n\n  /**\n   * Claude can interact with computer environments through the computer use tool, which\n   * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n   *\n   * This version adds the zoom action for detailed screen region inspection.\n   *\n   * Image results are supported.\n   *\n   * Supported models: Claude Opus 4.5\n   *\n   * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n   * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n   * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n   * @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.\n   */\n  computer_20251124,\n\n  /**\n   * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.\n   * Claude can create, read, update, and delete files that persist between sessions,\n   * allowing it to build knowledge over time without keeping everything in the context window.\n   * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.\n   *\n   * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.\n   */\n  memory_20250818,\n\n  /**\n   * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n   * helping you debug, fix, and improve your code or other text documents. This allows Claude\n   * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n   *\n   * Supported models: Claude Sonnet 3.5\n   */\n  textEditor_20241022,\n\n  /**\n   * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n   * helping you debug, fix, and improve your code or other text documents. This allows Claude\n   * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n   *\n   * Supported models: Claude Sonnet 3.7\n   */\n  textEditor_20250124,\n\n  /**\n   * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n   * helping you debug, fix, and improve your code or other text documents. This allows Claude\n   * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n   *\n   * Note: This version does not support the \"undo_edit\" command.\n   *\n   * @deprecated Use textEditor_20250728 instead\n   */\n  textEditor_20250429,\n\n  /**\n   * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n   * helping you debug, fix, and improve your code or other text documents. This allows Claude\n   * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n   *\n   * Note: This version does not support the \"undo_edit\" command and adds optional max_characters parameter.\n   *\n   * Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1\n   *\n   * @param maxCharacters - Optional maximum number of characters to view in the file\n   */\n  textEditor_20250728,\n\n  /**\n   * Creates a web fetch tool that gives Claude direct access to real-time web content.\n   *\n   * @param maxUses - The max_uses parameter limits the number of web fetches performed\n   * @param allowedDomains - Only fetch from these domains\n   * @param blockedDomains - Never fetch from these domains\n   * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set \"citations\": {\"enabled\": true} to enable Claude to cite specific passages from fetched documents.\n   * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.\n   */\n  webFetch_20250910,\n\n  /**\n   * Creates a web fetch tool that gives Claude direct access to real-time web content.\n   *\n   * @param maxUses - The max_uses parameter limits the number of web fetches performed\n   * @param allowedDomains - Only fetch from these domains\n   * @param blockedDomains - Never fetch from these domains\n   * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set \"citations\": {\"enabled\": true} to enable Claude to cite specific passages from fetched documents.\n   * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.\n   */\n  webFetch_20260209,\n\n  /**\n   * Creates a web search tool that gives Claude direct access to real-time web content.\n   *\n   * @param maxUses - Maximum number of web searches Claude can perform during the conversation.\n   * @param allowedDomains - Optional list of domains that Claude is allowed to search.\n   * @param blockedDomains - Optional list of domains that Claude should avoid when searching.\n   * @param userLocation - Optional user location information to provide geographically relevant search results.\n   */\n  webSearch_20250305,\n\n  /**\n   * Creates a web search tool that gives Claude direct access to real-time web content.\n   *\n   * @param maxUses - Maximum number of web searches Claude can perform during the conversation.\n   * @param allowedDomains - Optional list of domains that Claude is allowed to search.\n   * @param blockedDomains - Optional list of domains that Claude should avoid when searching.\n   * @param userLocation - Optional user location information to provide geographically relevant search results.\n   */\n  webSearch_20260209,\n\n  /**\n   * Creates a tool search tool that uses regex patterns to find tools.\n   *\n   * The tool search tool enables Claude to work with hundreds or thousands of tools\n   * by dynamically discovering and loading them on-demand. Instead of loading all\n   * tool definitions into the context window upfront, Claude searches your tool\n   * catalog and loads only the tools it needs.\n   *\n   * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools\n   * to mark them for deferred loading.\n   *\n   * Supported models: Claude Opus 4.5, Claude Sonnet 4.5\n   */\n  toolSearchRegex_20251119,\n\n  /**\n   * Creates a tool search tool that uses BM25 (natural language) to find tools.\n   *\n   * The tool search tool enables Claude to work with hundreds or thousands of tools\n   * by dynamically discovering and loading them on-demand. Instead of loading all\n   * tool definitions into the context window upfront, Claude searches your tool\n   * catalog and loads only the tools it needs.\n   *\n   * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools\n   * to mark them for deferred loading.\n   *\n   * Supported models: Claude Opus 4.5, Claude Sonnet 4.5\n   */\n  toolSearchBm25_20251119,\n};\n","import type { JSONObject } from '@ai-sdk/provider';\nimport type { AnthropicMessageMetadata } from './anthropic-message-metadata';\n\n/**\n * Sets the Anthropic container ID in the provider options based on\n * any previous step's provider metadata.\n *\n * Searches backwards through steps to find the most recent container ID.\n * You can use this function in `prepareStep` to forward the container ID between steps.\n */\nexport function forwardAnthropicContainerIdFromLastStep({\n  steps,\n}: {\n  steps: Array<{\n    providerMetadata?: Record<string, JSONObject>;\n  }>;\n}): undefined | { providerOptions?: Record<string, JSONObject> } {\n  // Search backwards through steps to find the most recent container ID\n  for (let i = steps.length - 1; i >= 0; i--) {\n    const containerId = (\n      steps[i].providerMetadata?.anthropic as\n        | AnthropicMessageMetadata\n        | undefined\n    )?.container?.id;\n\n    if (containerId) {\n      return {\n        providerOptions: {\n          anthropic: {\n            container: { id: containerId },\n          },\n        },\n      };\n    }\n  }\n\n  return undefined;\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE,cAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;;;ACXA,IAAM,UACX,OACI,WACA;;;ACLN;AAAA,EACE;AAAA,OAeK;AACP;AAAA,EACE;AAAA,EACA;AAA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AAa;AACf,aAAO;AAAA,QACL,iBAAiB;AAAA,UACf,WAAW;AAAA,YACT,WAAW,EAAE,IAAI,YAAY;AAAA,UAC/B;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":["generateId","parseProviderOptions","lazySchema","zodSchema","z","z","anthropic","lazySchema","zodSchema","z","lazySchema","zodSchema","z","factory","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","anthropicTools","UnsupportedFunctionalityError","validateTypes","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","UnsupportedFunctionalityError","_a","_b","i","validateTypes","generateId","parseProviderOptions","anthropicTools","anthropic","_a","_b","_c","_d","_e","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactory","lazySchema","zodSchema","z","createProviderToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","_a","generateId"]}