{"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/text-editor_20250728.ts","../src/tool/web-search_20250305.ts","../src/tool/web-fetch-20250910.ts","../src/convert-to-anthropic-messages-prompt.ts","../src/tool/code-execution_20250522.ts","../src/tool/code-execution_20250825.ts","../src/map-anthropic-stop-reason.ts","../src/tool/bash_20241022.ts","../src/tool/bash_20250124.ts","../src/tool/computer_20241022.ts","../src/tool/computer_20250124.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/anthropic-tools.ts"],"sourcesContent":["import {\n  LanguageModelV3,\n  NoSuchModelError,\n  ProviderV3,\n} from '@ai-sdk/provider';\nimport {\n  FetchFunction,\n  generateId,\n  loadApiKey,\n  loadOptionalSetting,\n  withoutTrailingSlash,\n  withUserAgentSuffix,\n} from '@ai-sdk/provider-utils';\nimport { VERSION } from './version';\nimport { AnthropicMessagesLanguageModel } from './anthropic-messages-language-model';\nimport { AnthropicMessagesModelId } from './anthropic-messages-options';\nimport { anthropicTools } from './anthropic-tools';\n\nexport interface AnthropicProvider extends ProviderV3 {\n  /**\nCreates a model for text generation.\n*/\n  (modelId: AnthropicMessagesModelId): LanguageModelV3;\n\n  /**\nCreates 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  /**\nAnthropic-specific computer use tool.\n   */\n  tools: typeof anthropicTools;\n}\n\nexport interface AnthropicProviderSettings {\n  /**\nUse a different URL prefix for API calls, e.g. to use proxy servers.\nThe default prefix is `https://api.anthropic.com/v1`.\n   */\n  baseURL?: string;\n\n  /**\nAPI key that is being send using the `x-api-key` header.\nIt defaults to the `ANTHROPIC_API_KEY` environment variable.\n   */\n  apiKey?: string;\n\n  /**\nCustom headers to include in the requests.\n     */\n  headers?: Record<string, string>;\n\n  /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor 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/**\nCreate 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  const getHeaders = () =>\n    withUserAgentSuffix(\n      {\n        'anthropic-version': '2023-06-01',\n        'x-api-key': loadApiKey({\n          apiKey: options.apiKey,\n          environmentVariableName: 'ANTHROPIC_API_KEY',\n          description: 'Anthropic',\n        }),\n        ...options.headers,\n      },\n      `ai-sdk/anthropic/${VERSION}`,\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      }),\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.textEmbeddingModel = (modelId: string) => {\n    throw new NoSuchModelError({ modelId, modelType: 'textEmbeddingModel' });\n  };\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/**\nDefault 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  JSONObject,\n  LanguageModelV3,\n  LanguageModelV3CallWarning,\n  LanguageModelV3Content,\n  LanguageModelV3FinishReason,\n  LanguageModelV3FunctionTool,\n  LanguageModelV3Prompt,\n  LanguageModelV3Source,\n  LanguageModelV3StreamPart,\n  LanguageModelV3ToolCall,\n  LanguageModelV3Usage,\n  SharedV3ProviderMetadata,\n  UnsupportedFunctionalityError,\n} from '@ai-sdk/provider';\nimport {\n  combineHeaders,\n  createEventSourceResponseHandler,\n  createJsonResponseHandler,\n  FetchFunction,\n  generateId,\n  InferSchema,\n  parseProviderOptions,\n  ParseResult,\n  postJsonToApi,\n  Resolvable,\n  resolve,\n} from '@ai-sdk/provider-utils';\nimport { anthropicFailedResponseHandler } from './anthropic-error';\nimport { AnthropicMessageMetadata } from './anthropic-message-metadata';\nimport {\n  AnthropicContainer,\n  anthropicMessagesChunkSchema,\n  anthropicMessagesResponseSchema,\n  AnthropicReasoningMetadata,\n  Citation,\n} from './anthropic-messages-api';\nimport {\n  AnthropicMessagesModelId,\n  anthropicProviderOptions,\n} from './anthropic-messages-options';\nimport { prepareTools } from './anthropic-prepare-tools';\nimport { convertToAnthropicMessagesPrompt } from './convert-to-anthropic-messages-prompt';\nimport { CacheControlValidator } from './get-cache-control';\nimport { mapAnthropicStopReason } from './map-anthropic-stop-reason';\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 !== '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?: (args: Record<string, any>) => Record<string, any>;\n  supportedUrls?: () => LanguageModelV3['supportedUrls'];\n  generateId?: () => string;\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  get supportedUrls() {\n    return this.config.supportedUrls?.() ?? {};\n  }\n\n  private async getArgs({\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  }: Parameters<LanguageModelV3['doGenerate']>[0] & { stream: boolean }) {\n    const warnings: LanguageModelV3CallWarning[] = [];\n\n    if (frequencyPenalty != null) {\n      warnings.push({\n        type: 'unsupported-setting',\n        setting: 'frequencyPenalty',\n      });\n    }\n\n    if (presencePenalty != null) {\n      warnings.push({\n        type: 'unsupported-setting',\n        setting: 'presencePenalty',\n      });\n    }\n\n    if (seed != null) {\n      warnings.push({\n        type: 'unsupported-setting',\n        setting: 'seed',\n      });\n    }\n\n    if (responseFormat?.type === 'json') {\n      if (responseFormat.schema == null) {\n        warnings.push({\n          type: 'unsupported-setting',\n          setting: 'responseFormat',\n          details:\n            'JSON response format requires a schema. ' +\n            'The response format is ignored.',\n        });\n      }\n    }\n\n    const jsonResponseTool: LanguageModelV3FunctionTool | undefined =\n      responseFormat?.type === 'json' && responseFormat.schema != null\n        ? {\n            type: 'function',\n            name: 'json',\n            description: 'Respond with a JSON object.',\n            inputSchema: responseFormat.schema,\n          }\n        : undefined;\n\n    const anthropicOptions = await parseProviderOptions({\n      provider: 'anthropic',\n      providerOptions,\n      schema: anthropicProviderOptions,\n    });\n\n    // Create a shared cache control validator to track breakpoints across tools and messages\n    const cacheControlValidator = new CacheControlValidator();\n\n    const { prompt: messagesPrompt, betas } =\n      await convertToAnthropicMessagesPrompt({\n        prompt,\n        sendReasoning: anthropicOptions?.sendReasoning ?? true,\n        warnings,\n        cacheControlValidator,\n      });\n\n    const isThinking = anthropicOptions?.thinking?.type === 'enabled';\n    const thinkingBudget = anthropicOptions?.thinking?.budgetTokens;\n\n    const { maxOutputTokens: maxOutputTokensForModel, knownModel } =\n      getMaxOutputTokensForModel(this.modelId);\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: { type: 'enabled', budget_tokens: thinkingBudget },\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 with agent skills:\n      ...(anthropicOptions?.container && {\n        container: {\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      }),\n\n      // prompt:\n      system: messagesPrompt.system,\n      messages: messagesPrompt.messages,\n    };\n\n    if (isThinking) {\n      if (thinkingBudget == null) {\n        throw new UnsupportedFunctionalityError({\n          functionality: 'thinking requires a budget',\n        });\n      }\n\n      if (baseArgs.temperature != null) {\n        baseArgs.temperature = undefined;\n        warnings.push({\n          type: 'unsupported-setting',\n          setting: '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-setting',\n          setting: '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-setting',\n          setting: '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;\n    }\n\n    // limit to max output tokens for known models to enable model switching without breaking it:\n    if (knownModel && 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-setting',\n          setting: '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 (\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-defined' &&\n            tool.id === 'anthropic.code_execution_20250825',\n        )\n      ) {\n        warnings.push({\n          type: 'other',\n          message: 'code execution tool is required when using skills',\n        });\n      }\n    }\n\n    // only when streaming: enable fine-grained tool streaming\n    if (stream && (anthropicOptions?.toolStreaming ?? true)) {\n      betas.add('fine-grained-tool-streaming-2025-05-14');\n    }\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          }\n        : {\n            tools: tools ?? [],\n            toolChoice,\n            disableParallelToolUse: anthropicOptions?.disableParallelToolUse,\n            cacheControlValidator,\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([...betas, ...toolsBetas]),\n      usesJsonResponseTool: jsonResponseTool != null,\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      betas.size > 0 ? { 'anthropic-beta': Array.from(betas).join(',') } : {},\n      headers,\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(args: Record<string, any>): Record<string, any> {\n    return this.config.transformRequestBody?.(args) ?? 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: Parameters<LanguageModelV3['doGenerate']>[0],\n  ): Promise<Awaited<ReturnType<LanguageModelV3['doGenerate']>>> {\n    const { args, warnings, betas, usesJsonResponseTool } = await this.getArgs({\n      ...options,\n      stream: false,\n    });\n\n    // Extract citation documents for response processing\n    const citationDocuments = this.extractCitationDocuments(options.prompt);\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),\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    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 '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            content.push({\n              type: 'tool-call',\n              toolCallId: part.id,\n              toolName: part.name,\n              input: JSON.stringify(part.input),\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: '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            content.push({\n              type: 'tool-call',\n              toolCallId: part.id,\n              toolName: part.name,\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            content.push({\n              type: 'tool-result',\n              toolCallId: part.tool_use_id,\n              toolName: '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: '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: '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: '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: '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              },\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: '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: 'code_execution',\n            result: part.content,\n          });\n          break;\n        }\n      }\n    }\n\n    return {\n      content,\n      finishReason: mapAnthropicStopReason({\n        finishReason: response.stop_reason,\n        isJsonResponseFromTool,\n      }),\n      usage: {\n        inputTokens: response.usage.input_tokens,\n        outputTokens: response.usage.output_tokens,\n        totalTokens: response.usage.input_tokens + response.usage.output_tokens,\n        cachedInputTokens: response.usage.cache_read_input_tokens ?? undefined,\n      },\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        anthropic: {\n          usage: response.usage as JSONObject,\n          cacheCreationInputTokens:\n            response.usage.cache_creation_input_tokens ?? null,\n          stopSequence: response.stop_sequence ?? 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        } satisfies AnthropicMessageMetadata,\n      },\n    };\n  }\n\n  async doStream(\n    options: Parameters<LanguageModelV3['doStream']>[0],\n  ): Promise<Awaited<ReturnType<LanguageModelV3['doStream']>>> {\n    const {\n      args: body,\n      warnings,\n      betas,\n      usesJsonResponseTool,\n    } = await this.getArgs({\n      ...options,\n      stream: true,\n    });\n\n    // Extract citation documents for response processing\n    const citationDocuments = this.extractCitationDocuments(options.prompt);\n\n    const { responseHeaders, value: response } = await postJsonToApi({\n      url: this.buildRequestUrl(true),\n      headers: await this.getHeaders({ betas, headers: options.headers }),\n      body: this.transformRequestBody(body),\n      failedResponseHandler: anthropicFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(\n        anthropicMessagesChunkSchema,\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch,\n    });\n\n    let finishReason: LanguageModelV3FinishReason = 'unknown';\n    const usage: LanguageModelV3Usage = {\n      inputTokens: undefined,\n      outputTokens: undefined,\n      totalTokens: undefined,\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        }\n      | { type: 'text' | 'reasoning' }\n    > = {};\n    const mcpToolCalls: Record<string, LanguageModelV3ToolCall> = {};\n\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      | 'mcp_tool_use'\n      | 'mcp_tool_result'\n      | undefined = undefined;\n\n    const generateId = this.generateId;\n\n    return {\n      stream: 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 '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                      contentBlocks[value.index] = {\n                        type: 'tool-call',\n                        toolCallId: part.id,\n                        toolName: part.name,\n                        input: '',\n                        firstDelta: true,\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                      contentBlocks[value.index] = {\n                        type: 'tool-call',\n                        toolCallId: part.id,\n                        toolName: part.name,\n                        input: '',\n                        providerExecuted: true,\n                        firstDelta: true,\n                      };\n\n                      // map tool names for the code execution 20250825 tool:\n                      const mappedToolName =\n                        part.name === 'text_editor_code_execution' ||\n                        part.name === 'bash_code_execution'\n                          ? 'code_execution'\n                          : part.name;\n\n                      controller.enqueue({\n                        type: 'tool-input-start',\n                        id: part.id,\n                        toolName: mappedToolName,\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                      controller.enqueue({\n                        type: 'tool-result',\n                        toolCallId: part.tool_use_id,\n                        toolName: '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: '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: '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: '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: '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                        },\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: '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: 'code_execution',\n                      result: part.content,\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 &&\n                        contentBlock.toolName === 'json';\n\n                      if (!isJsonResponseTool) {\n                        controller.enqueue({\n                          type: 'tool-input-end',\n                          id: contentBlock.toolCallId,\n                        });\n\n                        // map tool names for the code execution 20250825 tool:\n                        const toolName =\n                          contentBlock.toolName ===\n                            'text_editor_code_execution' ||\n                          contentBlock.toolName === 'bash_code_execution'\n                            ? 'code_execution'\n                            : contentBlock.toolName;\n\n                        controller.enqueue({\n                          type: 'tool-call',\n                          toolCallId: contentBlock.toolCallId,\n                          toolName,\n                          input: contentBlock.input,\n                          providerExecuted: contentBlock.providerExecuted,\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 '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.toolName === 'bash_code_execution' ||\n                          contentBlock.toolName ===\n                            'text_editor_code_execution')\n                      ) {\n                        delta = `{\"type\": \"${contentBlock.toolName}\",${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.inputTokens = value.message.usage.input_tokens;\n                usage.cachedInputTokens =\n                  value.message.usage.cache_read_input_tokens ?? undefined;\n\n                rawUsage = {\n                  ...(value.message.usage as JSONObject),\n                };\n\n                cacheCreationInputTokens =\n                  value.message.usage.cache_creation_input_tokens ?? null;\n\n                controller.enqueue({\n                  type: 'response-metadata',\n                  id: value.message.id ?? undefined,\n                  modelId: value.message.model ?? undefined,\n                });\n\n                return;\n              }\n\n              case 'message_delta': {\n                usage.outputTokens = value.usage.output_tokens;\n                usage.totalTokens =\n                  (usage.inputTokens ?? 0) + (value.usage.output_tokens ?? 0);\n\n                finishReason = mapAnthropicStopReason({\n                  finishReason: value.delta.stop_reason,\n                  isJsonResponseFromTool,\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                rawUsage = {\n                  ...rawUsage,\n                  ...(value.usage as JSONObject),\n                };\n\n                return;\n              }\n\n              case 'message_stop': {\n                controller.enqueue({\n                  type: 'finish',\n                  finishReason,\n                  usage,\n                  providerMetadata: {\n                    anthropic: {\n                      usage: (rawUsage as JSONObject) ?? null,\n                      cacheCreationInputTokens,\n                      stopSequence,\n                      container,\n                    } satisfies AnthropicMessageMetadata,\n                  },\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      request: { body },\n      response: { headers: responseHeaders },\n    };\n  }\n}\n\n// see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table\nfunction getMaxOutputTokensForModel(modelId: string): {\n  maxOutputTokens: number;\n  knownModel: boolean;\n} {\n  if (\n    modelId.includes('claude-sonnet-4-') ||\n    modelId.includes('claude-3-7-sonnet') ||\n    modelId.includes('claude-haiku-4-5')\n  ) {\n    return { maxOutputTokens: 64000, knownModel: true };\n  } else if (modelId.includes('claude-opus-4-')) {\n    return { maxOutputTokens: 32000, knownModel: true };\n  } else if (modelId.includes('claude-3-5-haiku')) {\n    return { maxOutputTokens: 8192, knownModel: true };\n  } else if (modelId.includes('claude-3-haiku')) {\n    return { maxOutputTokens: 4096, knownModel: true };\n  } else {\n    return { maxOutputTokens: 4096, knownModel: false };\n  }\n}\n","import {\n  createJsonErrorResponseHandler,\n  InferSchema,\n  lazySchema,\n  zodSchema,\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 { JSONSchema7 } from '@ai-sdk/provider';\nimport { InferSchema, lazySchema, zodSchema } 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    | AnthropicBashCodeExecutionToolResultContent\n    | AnthropicTextEditorCodeExecutionToolResultContent\n    | AnthropicMcpToolUseContent\n    | AnthropicMcpToolResultContent\n  >;\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\nexport interface AnthropicToolCallContent {\n  type: 'tool_use';\n  id: string;\n  name: string;\n  input: unknown;\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  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 AnthropicToolResultContent {\n  type: 'tool_result';\n  tool_use_id: string;\n  content:\n    | string\n    | Array<\n        | AnthropicNestedTextContent\n        | AnthropicNestedImageContent\n        | AnthropicNestedDocumentContent\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;\n    page_age: string | null;\n    encrypted_content: string;\n    type: 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    type: 'code_execution_result';\n    stdout: string;\n    stderr: string;\n    return_code: number;\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 AnthropicWebFetchToolResultContent {\n  type: 'web_fetch_tool_result';\n  tool_use_id: string;\n  content: {\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  cache_control: AnthropicCacheControl | undefined;\n}\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    }\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      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:\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';\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';\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\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\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('tool_use'),\n            id: z.string(),\n            name: z.string(),\n            input: z.unknown(),\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          }),\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.object({\n                    type: z.literal('text'),\n                    media_type: z.string(),\n                    data: z.string(),\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              }),\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        ]),\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      }),\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    }),\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          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        }),\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          }),\n          z.object({\n            type: z.literal('redacted_thinking'),\n            data: z.string(),\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          }),\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.object({\n                    type: z.literal('text'),\n                    media_type: z.string(),\n                    data: z.string(),\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              }),\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        ]),\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('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          output_tokens: z.number(),\n          cache_creation_input_tokens: z.number().nullish(),\n        }),\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-haiku-4-5'\n  | 'claude-haiku-4-5-20251001'\n  | 'claude-sonnet-4-5'\n  | 'claude-sonnet-4-5-20250929'\n  | 'claude-opus-4-1'\n  | 'claude-opus-4-0'\n  | 'claude-sonnet-4-0'\n  | 'claude-opus-4-1-20250805'\n  | 'claude-opus-4-20250514'\n  | 'claude-sonnet-4-20250514'\n  | 'claude-3-7-sonnet-latest'\n  | 'claude-3-7-sonnet-20250219'\n  | 'claude-3-5-haiku-latest'\n  | 'claude-3-5-haiku-20241022'\n  | 'claude-3-haiku-20240307'\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 anthropicProviderOptions = z.object({\n  sendReasoning: z.boolean().optional(),\n\n  thinking: z\n    .object({\n      type: z.union([z.literal('enabled'), z.literal('disabled')]),\n      budgetTokens: z.number().optional(),\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  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 tool streaming (and structured output streaming).\n   *\n   * When set to false, the model will return all tool calls and results\n   * at once after a delay.\n   *\n   * @default true\n   */\n  toolStreaming: z.boolean().optional(),\n});\n\nexport type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;\n","import {\n  LanguageModelV3CallOptions,\n  LanguageModelV3CallWarning,\n  UnsupportedFunctionalityError,\n} from '@ai-sdk/provider';\nimport { AnthropicTool, AnthropicToolChoice } from './anthropic-messages-api';\nimport { CacheControlValidator } from './get-cache-control';\nimport { textEditor_20250728ArgsSchema } from './tool/text-editor_20250728';\nimport { webSearch_20250305ArgsSchema } from './tool/web-search_20250305';\nimport { webFetch_20250910ArgsSchema } from './tool/web-fetch-20250910';\nimport { validateTypes } from '@ai-sdk/provider-utils';\n\nexport async function prepareTools({\n  tools,\n  toolChoice,\n  disableParallelToolUse,\n  cacheControlValidator,\n}: {\n  tools: LanguageModelV3CallOptions['tools'];\n  toolChoice?: LanguageModelV3CallOptions['toolChoice'];\n  disableParallelToolUse?: boolean;\n  cacheControlValidator?: CacheControlValidator;\n}): Promise<{\n  tools: Array<AnthropicTool> | undefined;\n  toolChoice: AnthropicToolChoice | undefined;\n  toolWarnings: LanguageModelV3CallWarning[];\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: LanguageModelV3CallWarning[] = [];\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        anthropicTools.push({\n          name: tool.name,\n          description: tool.description,\n          input_schema: tool.inputSchema,\n          cache_control: cacheControl,\n        });\n        break;\n      }\n\n      case 'provider-defined': {\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.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_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_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\n          default: {\n            toolWarnings.push({ type: 'unsupported-tool', tool });\n            break;\n          }\n        }\n        break;\n      }\n\n      default: {\n        toolWarnings.push({ type: 'unsupported-tool', tool });\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 {\n  LanguageModelV3CallWarning,\n  SharedV3ProviderMetadata,\n} from '@ai-sdk/provider';\nimport { 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: LanguageModelV3CallWarning[] = [];\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-setting',\n        setting: 'cacheControl',\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-setting',\n        setting: 'cacheControl',\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(): LanguageModelV3CallWarning[] {\n    return this.warnings;\n  }\n}\n","import { createProviderDefinedToolFactory } from '@ai-sdk/provider-utils';\nimport { z } from 'zod/v4';\nimport { lazySchema, zodSchema } from '@ai-sdk/provider-utils';\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      old_str: z.string().optional(),\n      view_range: z.array(z.number().int()).optional(),\n    }),\n  ),\n);\n\nconst factory = createProviderDefinedToolFactory<\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). Required parameter of `insert` command containing the string to insert.\n     */\n    new_str?: 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  name: 'str_replace_based_edit_tool',\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  createProviderDefinedToolFactoryWithOutputSchema,\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(),\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 = createProviderDefinedToolFactoryWithOutputSchema<\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;\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  name: 'web_search',\n  inputSchema: webSearch_20250305InputSchema,\n  outputSchema: webSearch_20250305OutputSchema,\n});\n\nexport const webSearch_20250305 = (\n  args: Parameters<typeof factory>[0] = {}, // default\n) => {\n  return factory(args);\n};\n","import {\n  createProviderDefinedToolFactoryWithOutputSchema,\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(),\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 = createProviderDefinedToolFactoryWithOutputSchema<\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;\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  name: 'web_fetch',\n  inputSchema: webFetch_20250910InputSchema,\n  outputSchema: webFetch_20250910OutputSchema,\n});\n\nexport const webFetch_20250910 = (\n  args: Parameters<typeof factory>[0] = {}, // default\n) => {\n  return factory(args);\n};\n","import {\n  LanguageModelV3CallWarning,\n  LanguageModelV3DataContent,\n  LanguageModelV3Message,\n  LanguageModelV3Prompt,\n  SharedV3ProviderMetadata,\n  UnsupportedFunctionalityError,\n} from '@ai-sdk/provider';\nimport {\n  convertToBase64,\n  parseProviderOptions,\n  validateTypes,\n  isNonNullable,\n} from '@ai-sdk/provider-utils';\nimport {\n  AnthropicAssistantMessage,\n  AnthropicMessagesPrompt,\n  anthropicReasoningMetadataSchema,\n  AnthropicToolResultContent,\n  AnthropicUserMessage,\n  AnthropicWebFetchToolResultContent,\n} from './anthropic-messages-api';\nimport { anthropicFilePartProviderOptions } from './anthropic-messages-options';\nimport { CacheControlValidator } from './get-cache-control';\nimport { codeExecution_20250522OutputSchema } from './tool/code-execution_20250522';\nimport { codeExecution_20250825OutputSchema } from './tool/code-execution_20250825';\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 Buffer.from(data, 'base64').toString('utf-8');\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\nexport async function convertToAnthropicMessagesPrompt({\n  prompt,\n  sendReasoning,\n  warnings,\n  cacheControlValidator,\n}: {\n  prompt: LanguageModelV3Prompt;\n  sendReasoning: boolean;\n  warnings: LanguageModelV3CallWarning[];\n  cacheControlValidator?: CacheControlValidator;\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:\n                          part.data instanceof URL\n                            ? {\n                                type: 'url',\n                                url: part.data.toString(),\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:\n                          part.data instanceof URL\n                            ? {\n                                type: 'url',\n                                url: part.data.toString(),\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:\n                          part.data instanceof URL\n                            ? {\n                                type: 'url',\n                                url: part.data.toString(),\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                // 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 = i === content.length - 1;\n\n                const cacheControl =\n                  validator.getCacheControl(part.providerOptions, {\n                    type: 'tool result part',\n                    canCache: true,\n                  }) ??\n                  (isLastPart\n                    ? validator.getCacheControl(message.providerOptions, {\n                        type: 'tool result message',\n                        canCache: true,\n                      })\n                    : undefined);\n\n                const output = part.output;\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                          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                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                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 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                    part.toolName === '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                    part.toolName === 'code_execution' || // code execution 20250522\n                    part.toolName === 'web_fetch' ||\n                    part.toolName === 'web_search'\n                  ) {\n                    anthropicContent.push({\n                      type: 'server_tool_use',\n                      id: part.toolCallId,\n                      name: part.toolName,\n                      input: part.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                  break;\n                }\n\n                anthropicContent.push({\n                  type: 'tool_use',\n                  id: part.toolCallId,\n                  name: part.toolName,\n                  input: part.input,\n                  cache_control: cacheControl,\n                });\n                break;\n              }\n\n              case 'tool-result': {\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 (part.toolName === 'code_execution') {\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                  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 and 20250825,\n                  // we check if a type property is present in the 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                      },\n                      cache_control: cacheControl,\n                    });\n                  } else {\n                    // code execution 20250825\n                    const codeExecutionOutput = await validateTypes({\n                      value: output.value,\n                      schema: codeExecution_20250825OutputSchema,\n                    });\n\n                    anthropicContent.push(\n                      codeExecutionOutput.type ===\n                        'bash_code_execution_result' ||\n                        codeExecutionOutput.type ===\n                          'bash_code_execution_tool_result_error'\n                        ? {\n                            type: 'bash_code_execution_tool_result',\n                            tool_use_id: part.toolCallId,\n                            cache_control: cacheControl,\n                            content: codeExecutionOutput,\n                          }\n                        : {\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 (part.toolName === 'web_fetch') {\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 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 AnthropicWebFetchToolResultContent['content']['content']['source'],\n                      },\n                    },\n                    cache_control: cacheControl,\n                  });\n\n                  break;\n                }\n\n                if (part.toolName === '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                  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                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  createProviderDefinedToolFactoryWithOutputSchema,\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    }),\n  ),\n);\n\nconst codeExecution_20250522InputSchema = lazySchema(() =>\n  zodSchema(\n    z.object({\n      code: z.string(),\n    }),\n  ),\n);\n\nconst factory = createProviderDefinedToolFactoryWithOutputSchema<\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  },\n  {}\n>({\n  id: 'anthropic.code_execution_20250522',\n  name: 'code_execution',\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  createProviderDefinedToolFactoryWithOutputSchema,\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('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      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 = createProviderDefinedToolFactoryWithOutputSchema<\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      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  name: 'code_execution',\n  inputSchema: codeExecution_20250825InputSchema,\n  outputSchema: codeExecution_20250825OutputSchema,\n});\n\nexport const codeExecution_20250825 = (\n  args: Parameters<typeof factory>[0] = {},\n) => {\n  return factory(args);\n};\n","import { 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 {\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      return 'length';\n    default:\n      return 'unknown';\n  }\n}\n","import {\n  createProviderDefinedToolFactory,\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 = createProviderDefinedToolFactory<\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  name: 'bash',\n  inputSchema: bash_20241022InputSchema,\n});\n","import {\n  createProviderDefinedToolFactory,\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 = createProviderDefinedToolFactory<\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  name: 'bash',\n  inputSchema: bash_20250124InputSchema,\n});\n","import {\n  createProviderDefinedToolFactory,\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 = createProviderDefinedToolFactory<\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  name: 'computer',\n  inputSchema: computer_20241022InputSchema,\n});\n","import {\n  createProviderDefinedToolFactory,\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 = createProviderDefinedToolFactory<\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  name: 'computer',\n  inputSchema: computer_20250124InputSchema,\n});\n","import {\n  createProviderDefinedToolFactory,\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 = createProviderDefinedToolFactory<\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  name: 'memory',\n  inputSchema: memory_20250818InputSchema,\n});\n","import {\n  createProviderDefinedToolFactory,\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      old_str: z.string().optional(),\n      view_range: z.array(z.number().int()).optional(),\n    }),\n  ),\n);\n\nexport const textEditor_20241022 = createProviderDefinedToolFactory<\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). Required parameter of `insert` command containing the string to insert.\n     */\n    new_str?: 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  name: 'str_replace_editor',\n  inputSchema: textEditor_20241022InputSchema,\n});\n","import {\n  createProviderDefinedToolFactory,\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      old_str: z.string().optional(),\n      view_range: z.array(z.number().int()).optional(),\n    }),\n  ),\n);\n\nexport const textEditor_20250124 = createProviderDefinedToolFactory<\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). Required parameter of `insert` command containing the string to insert.\n     */\n    new_str?: 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  name: 'str_replace_editor',\n  inputSchema: textEditor_20250124InputSchema,\n});\n","import {\n  createProviderDefinedToolFactory,\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      old_str: z.string().optional(),\n      view_range: z.array(z.number().int()).optional(),\n    }),\n  ),\n);\n\nexport const textEditor_20250429 = createProviderDefinedToolFactory<\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). Required parameter of `insert` command containing the string to insert.\n     */\n    new_str?: 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  name: 'str_replace_based_edit_tool',\n  inputSchema: textEditor_20250429InputSchema,\n});\n","import { 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 { computer_20241022 } from './tool/computer_20241022';\nimport { computer_20250124 } from './tool/computer_20250124';\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 { webFetch_20250910 } from './tool/web-fetch-20250910';\nimport { webSearch_20250305 } from './tool/web-search_20250305';\n\nexport const anthropicTools = {\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   * Tool name must be `bash`.\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   * Tool name must be `bash`.\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   * Tool name must be `code_execution`.\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   * Tool name must be `code_execution`.\n   */\n  codeExecution_20250825,\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   * Tool name must be `computer`.\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   * Tool name must be `computer`.\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   * 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   * Tool name must be `memory`.\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   * Tool name must be `str_replace_editor`.\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   * Tool name must be `str_replace_editor`.\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   * Tool name must be `str_replace_based_edit_tool`.\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   * Tool name must be `str_replace_based_edit_tool`.\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   * Tool name must be `web_fetch`.\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 search tool that gives Claude direct access to real-time web content.\n   *\n   * Tool name must be `web_search`.\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"],"mappings":";AAAA;AAAA,EAEE;AAAA,OAEK;AACP;AAAA,EAEE,cAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACVA,IAAM,UACX,OACI,kBACA;;;ACLN;AAAA,EAaE,iCAAAC;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAEA,wBAAAC;AAAA,EAEA;AAAA,EAEA;AAAA,OACK;;;AC3BP;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS;AAEX,IAAM,2BAA2B;AAAA,EAAW,MACjD;AAAA,IACE,EAAE,OAAO;AAAA,MACP,MAAM,EAAE,QAAQ,OAAO;AAAA,MACvB,OAAO,EAAE,OAAO;AAAA,QACd,MAAM,EAAE,OAAO;AAAA,QACf,SAAS,EAAE,OAAO;AAAA,MACpB,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAIO,IAAM,iCAAiC,+BAA+B;AAAA,EAC3E,aAAa;AAAA,EACb,gBAAgB,UAAQ,KAAK,MAAM;AACrC,CAAC;;;ACxBD,SAAsB,cAAAC,aAAY,aAAAC,kBAAiB;AACnD,SAAS,KAAAC,UAAS;AAwWX,IAAM,kCAAkCF;AAAA,EAAW,MACxDC;AAAA,IACEC,GAAE,O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,QAAAI;AAuGI,eAAI,+BAA+B,SAAS;AAAA,MAC1C,UAAU;AAAA,MACV;AAAA,MACA,SAAS;AAAA,MACT,OAAO,QAAQ;AAAA,MACf,aAAYA,MAAA,QAAQ,eAAR,OAAAA,MAAsBC;AAAA,MAClC,eAAe,OAAO;AAAA,QACpB,WAAW,CAAC,iBAAiB;AAAA,MAC/B;AAAA,IACF,CAAC;AAAA;AAEH,QAAM,WAAW,SAAU,SAAmC;AAC5D,QAAI,YAAY;AACd,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,WAAO,gBAAgB,OAAO;AAAA,EAChC;AAEA,WAAS,uBAAuB;AAChC,WAAS,gBAAgB;AACzB,WAAS,OAAO;AAChB,WAAS,WAAW;AAEpB,WAAS,qBAAqB,CAAC,YAAoB;AACjD,UAAM,IAAI,iBAAiB,EAAE,SAAS,WAAW,qBAAqB,CAAC;AAAA,EACzE;AACA,WAAS,aAAa,CAAC,YAAoB;AACzC,UAAM,IAAI,iBAAiB,EAAE,SAAS,WAAW,aAAa,CAAC;AAAA,EACjE;AAEA,WAAS,QAAQ;AAEjB,SAAO;AACT;AAKO,IAAM,YAAY,gBAAgB;","names":["generateId","UnsupportedFunctionalityError","parseProviderOptions","lazySchema","zodSchema","z","z","anthropic","z","lazySchema","zodSchema","lazySchema","zodSchema","z","factory","createProviderDefinedToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","anthropicTools","UnsupportedFunctionalityError","validateTypes","createProviderDefinedToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","createProviderDefinedToolFactoryWithOutputSchema","lazySchema","zodSchema","z","factory","UnsupportedFunctionalityError","_a","_b","i","validateTypes","generateId","parseProviderOptions","UnsupportedFunctionalityError","anthropicTools","anthropic","_a","createProviderDefinedToolFactory","lazySchema","zodSchema","z","createProviderDefinedToolFactory","lazySchema","zodSchema","z","createProviderDefinedToolFactory","lazySchema","zodSchema","z","createProviderDefinedToolFactory","lazySchema","zodSchema","z","createProviderDefinedToolFactory","lazySchema","zodSchema","z","createProviderDefinedToolFactory","lazySchema","zodSchema","z","createProviderDefinedToolFactory","lazySchema","zodSchema","z","createProviderDefinedToolFactory","lazySchema","zodSchema","z","_a","generateId"]}