@opencode-ai/cli-darwin-x64 0.0.0-beta-202606050000
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/chunk-01tb5qes.js.map +131 -0
- package/bin/chunk-06d8aa69.js.map +10 -0
- package/bin/chunk-07w2xsfy.js.map +50 -0
- package/bin/chunk-0azwkk9z.js.map +12 -0
- package/bin/chunk-0d9ja06r.js.map +9 -0
- package/bin/chunk-0qebdpsf.js.map +167 -0
- package/bin/chunk-17j53wgt.js.map +11 -0
- package/bin/chunk-1jb1dn9p.js.map +10 -0
- package/bin/chunk-1paeax4j.js.map +56 -0
- package/bin/chunk-1wb39pye.js.map +9 -0
- package/bin/chunk-2wqpg9fb.js.map +10 -0
- package/bin/chunk-32ewzcjk.js.map +10 -0
- package/bin/chunk-3jqjf0hd.js.map +10 -0
- package/bin/chunk-3n6vddyq.js.map +73 -0
- package/bin/chunk-3r74gwy2.js.map +13 -0
- package/bin/chunk-3zmvhepw.js.map +10 -0
- package/bin/chunk-4980h0t7.js.map +37 -0
- package/bin/chunk-4de8gawx.js.map +10 -0
- package/bin/chunk-4q5k6a0e.js.map +10 -0
- package/bin/chunk-6ttpn29p.js.map +10 -0
- package/bin/chunk-7fvpf4bs.js.map +10 -0
- package/bin/chunk-7vb6kdat.js.map +10 -0
- package/bin/chunk-84amh6xf.js.map +11 -0
- package/bin/chunk-8akfq1ty.js.map +19 -0
- package/bin/chunk-8dnkfkds.js.map +10 -0
- package/bin/chunk-8rd9r1gb.js.map +11 -0
- package/bin/chunk-8x80qvzn.js.map +10 -0
- package/bin/chunk-943th5qs.js.map +10 -0
- package/bin/chunk-94yf089p.js.map +10 -0
- package/bin/chunk-98cxndhz.js.map +9 -0
- package/bin/chunk-9f8tmby0.js.map +9 -0
- package/bin/chunk-9fbstsnw.js.map +9 -0
- package/bin/chunk-9hq8aywf.js.map +10 -0
- package/bin/chunk-9vf55fj3.js.map +10 -0
- package/bin/chunk-9w9rk9en.js.map +20 -0
- package/bin/chunk-9y4hgfns.js.map +10 -0
- package/bin/chunk-aag5p1fp.js.map +10 -0
- package/bin/chunk-bt0r89ee.js.map +9 -0
- package/bin/chunk-c2gsyspz.js.map +10 -0
- package/bin/chunk-c8hr0q5n.js.map +10 -0
- package/bin/chunk-cab6ccj0.js.map +10 -0
- package/bin/chunk-ck4nkjtx.js.map +193 -0
- package/bin/chunk-cvm4kr56.js.map +23 -0
- package/bin/chunk-cyb9bpgm.js.map +10 -0
- package/bin/chunk-d1p8awq6.js.map +10 -0
- package/bin/chunk-d6nz1m6v.js.map +10 -0
- package/bin/chunk-d7v38w4j.js.map +27 -0
- package/bin/chunk-d9g5798m.js.map +81 -0
- package/bin/chunk-dcn0azxw.js.map +10 -0
- package/bin/chunk-dk4qekzk.js.map +10 -0
- package/bin/chunk-dk9tgwkh.js.map +9 -0
- package/bin/chunk-dzzhxh1c.js.map +10 -0
- package/bin/chunk-efsmps94.js.map +9 -0
- package/bin/chunk-fdw7znt6.js.map +11 -0
- package/bin/chunk-fs6t8jdg.js.map +10 -0
- package/bin/chunk-fzcqzwx5.js.map +10 -0
- package/bin/chunk-g4fcmhkj.js.map +11 -0
- package/bin/chunk-g4ff66n8.js.map +10 -0
- package/bin/chunk-g8mpn6ke.js.map +11 -0
- package/bin/chunk-gahs293a.js.map +10 -0
- package/bin/chunk-gh9dcqbv.js.map +10 -0
- package/bin/chunk-gmc0r6tm.js.map +13 -0
- package/bin/chunk-gv6nagng.js.map +10 -0
- package/bin/chunk-gyavdmtb.js.map +10 -0
- package/bin/chunk-h413ry19.js.map +10 -0
- package/bin/chunk-hav16yge.js.map +10 -0
- package/bin/chunk-hp5nnq6f.js.map +11 -0
- package/bin/chunk-hrcbafh3.js.map +9 -0
- package/bin/chunk-hxfsfpek.js.map +10 -0
- package/bin/chunk-jcqp2wmf.js.map +10 -0
- package/bin/chunk-jt9t8203.js.map +9 -0
- package/bin/chunk-k0980eb5.js.map +10 -0
- package/bin/chunk-kghptcgb.js.map +9 -0
- package/bin/chunk-kjyd3xxc.js.map +113 -0
- package/bin/chunk-kkvk5eez.js.map +10 -0
- package/bin/chunk-kv0b3sh5.js.map +10 -0
- package/bin/chunk-m9md5mth.js.map +10 -0
- package/bin/chunk-mf0qqhvb.js.map +10 -0
- package/bin/chunk-mfr0xsxw.js.map +9 -0
- package/bin/chunk-mkze6twx.js.map +10 -0
- package/bin/chunk-mzjs3qj3.js.map +10 -0
- package/bin/chunk-n10mj2m3.js.map +17 -0
- package/bin/chunk-n2fbt143.js.map +9 -0
- package/bin/chunk-n6a0rctn.js.map +9 -0
- package/bin/chunk-njn9a3jp.js.map +13 -0
- package/bin/chunk-nkhzpsnk.js.map +13 -0
- package/bin/chunk-ny5cyeha.js.map +10 -0
- package/bin/chunk-p3nkd9t2.js.map +10 -0
- package/bin/chunk-p3pr1t3k.js.map +10 -0
- package/bin/chunk-p7j7e7hb.js.map +10 -0
- package/bin/chunk-p89bk96c.js.map +10 -0
- package/bin/chunk-pjbsd0sw.js.map +10 -0
- package/bin/chunk-pnkd37ss.js.map +20 -0
- package/bin/chunk-q4n12vgf.js.map +388 -0
- package/bin/chunk-q6nf6fka.js.map +10 -0
- package/bin/chunk-qbpebjh2.js.map +10 -0
- package/bin/chunk-qgpzv4wt.js.map +15 -0
- package/bin/chunk-qq4f9z8v.js.map +10 -0
- package/bin/chunk-r55kafff.js.map +9 -0
- package/bin/chunk-rrwp4x01.js.map +10 -0
- package/bin/chunk-rt02k446.js.map +11 -0
- package/bin/chunk-s39nwv01.js.map +9 -0
- package/bin/chunk-s983v0dp.js.map +10 -0
- package/bin/chunk-san15sca.js.map +10 -0
- package/bin/chunk-sfk73pp2.js.map +10 -0
- package/bin/chunk-sjd3wbjd.js.map +10 -0
- package/bin/chunk-swbdmja3.js.map +10 -0
- package/bin/chunk-tc8tvjey.js.map +33 -0
- package/bin/chunk-tcqtz83b.js.map +10 -0
- package/bin/chunk-tgxxchfy.js.map +28 -0
- package/bin/chunk-tvxakxv2.js.map +10 -0
- package/bin/chunk-va2h4xya.js.map +37 -0
- package/bin/chunk-vezq3hc4.js.map +9 -0
- package/bin/chunk-vmbpvmpg.js.map +10 -0
- package/bin/chunk-vs30er58.js.map +10 -0
- package/bin/chunk-w7p62pb6.js.map +17 -0
- package/bin/chunk-wr4x72qd.js.map +13 -0
- package/bin/chunk-x3ywttp7.js.map +10 -0
- package/bin/chunk-x988wmrk.js.map +10 -0
- package/bin/chunk-x9zjg1f7.js.map +20 -0
- package/bin/chunk-xaqrhtz6.js.map +10 -0
- package/bin/chunk-xd2mrkwy.js.map +10 -0
- package/bin/chunk-xfh2377b.js.map +10 -0
- package/bin/chunk-xs0ras4j.js.map +51 -0
- package/bin/chunk-xt7ap9fb.js.map +10 -0
- package/bin/chunk-xya5qk3h.js.map +16 -0
- package/bin/chunk-xzka67m1.js.map +577 -0
- package/bin/chunk-yg7w4jgd.js.map +10 -0
- package/bin/chunk-yhpv46tb.js.map +20 -0
- package/bin/chunk-ymy66kr8.js.map +15 -0
- package/bin/chunk-yx4z6xsb.js.map +11 -0
- package/bin/chunk-yymwxqpy.js.map +10 -0
- package/bin/chunk-z70c75xe.js.map +11 -0
- package/bin/chunk-zkqyr3hc.js.map +10 -0
- package/bin/index.js.map +12 -0
- package/bin/lildax +0 -0
- package/package.json +15 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../node_modules/.bun/@ai-sdk+anthropic@3.0.81+d6123d32214422cb/node_modules/@ai-sdk/anthropic/dist/internal/index.mjs", "../../node_modules/.bun/@smithy+eventstream-codec@4.2.14/node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js", "../../node_modules/.bun/@smithy+util-hex-encoding@4.3.5/node_modules/@smithy/util-hex-encoding/dist-es/index.js", "../../node_modules/.bun/@smithy+eventstream-codec@4.2.14/node_modules/@smithy/eventstream-codec/dist-es/Int64.js", "../../node_modules/.bun/@smithy+eventstream-codec@4.2.14/node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js", "../../node_modules/.bun/@smithy+eventstream-codec@4.2.14/node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js", "../../node_modules/.bun/@smithy+util-buffer-from@4.3.5/node_modules/@smithy/util-buffer-from/dist-es/index.js", "../../node_modules/.bun/@smithy+util-utf8@4.2.2/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js", "../../node_modules/.bun/@smithy+util-utf8@4.2.2/node_modules/@smithy/util-utf8/dist-es/toUtf8.js", "../../node_modules/.bun/@ai-sdk+amazon-bedrock@4.0.112+d6123d32214422cb/node_modules/@ai-sdk/amazon-bedrock/dist/index.mjs"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"// src/anthropic-messages-language-model.ts\nimport {\n APICallError\n} from \"@ai-sdk/provider\";\nimport {\n combineHeaders,\n createEventSourceResponseHandler,\n createJsonResponseHandler,\n createToolNameMapping,\n generateId,\n parseProviderOptions as parseProviderOptions2,\n postJsonToApi,\n resolve\n} from \"@ai-sdk/provider-utils\";\n\n// src/anthropic-error.ts\nimport {\n createJsonErrorResponseHandler,\n lazySchema,\n zodSchema\n} from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\nvar 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);\nvar anthropicFailedResponseHandler = createJsonErrorResponseHandler({\n errorSchema: anthropicErrorDataSchema,\n errorToMessage: (data) => data.error.message\n});\n\n// src/anthropic-messages-api.ts\nimport {\n lazySchema as lazySchema2,\n zodSchema as zodSchema2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z2 } from \"zod/v4\";\nvar anthropicMessagesResponseSchema = lazySchema2(\n () => zodSchema2(\n z2.object({\n type: z2.literal(\"message\"),\n id: z2.string().nullish(),\n model: z2.string().nullish(),\n content: z2.array(\n z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"text\"),\n text: z2.string(),\n citations: z2.array(\n z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"web_search_result_location\"),\n cited_text: z2.string(),\n url: z2.string(),\n title: z2.string(),\n encrypted_index: z2.string()\n }),\n z2.object({\n type: z2.literal(\"page_location\"),\n cited_text: z2.string(),\n document_index: z2.number(),\n document_title: z2.string().nullable(),\n start_page_number: z2.number(),\n end_page_number: z2.number()\n }),\n z2.object({\n type: z2.literal(\"char_location\"),\n cited_text: z2.string(),\n document_index: z2.number(),\n document_title: z2.string().nullable(),\n start_char_index: z2.number(),\n end_char_index: z2.number()\n })\n ])\n ).optional()\n }),\n z2.object({\n type: z2.literal(\"thinking\"),\n thinking: z2.string(),\n signature: z2.string()\n }),\n z2.object({\n type: z2.literal(\"redacted_thinking\"),\n data: z2.string()\n }),\n z2.object({\n type: z2.literal(\"compaction\"),\n content: z2.string()\n }),\n z2.object({\n type: z2.literal(\"tool_use\"),\n id: z2.string(),\n name: z2.string(),\n input: z2.unknown(),\n // Programmatic tool calling: caller info when triggered from code execution\n caller: z2.union([\n z2.object({\n type: z2.literal(\"code_execution_20250825\"),\n tool_id: z2.string()\n }),\n z2.object({\n type: z2.literal(\"code_execution_20260120\"),\n tool_id: z2.string()\n }),\n z2.object({\n type: z2.literal(\"direct\")\n })\n ]).optional()\n }),\n z2.object({\n type: z2.literal(\"server_tool_use\"),\n id: z2.string(),\n name: z2.string(),\n input: z2.record(z2.string(), z2.unknown()).nullish(),\n caller: z2.union([\n z2.object({\n type: z2.literal(\"code_execution_20260120\"),\n tool_id: z2.string()\n }),\n z2.object({\n type: z2.literal(\"direct\")\n })\n ]).optional()\n }),\n z2.object({\n type: z2.literal(\"mcp_tool_use\"),\n id: z2.string(),\n name: z2.string(),\n input: z2.unknown(),\n server_name: z2.string()\n }),\n z2.object({\n type: z2.literal(\"mcp_tool_result\"),\n tool_use_id: z2.string(),\n is_error: z2.boolean(),\n content: z2.array(\n z2.union([\n z2.string(),\n z2.object({ type: z2.literal(\"text\"), text: z2.string() })\n ])\n )\n }),\n z2.object({\n type: z2.literal(\"web_fetch_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.union([\n z2.object({\n type: z2.literal(\"web_fetch_result\"),\n url: z2.string(),\n retrieved_at: z2.string(),\n content: z2.object({\n type: z2.literal(\"document\"),\n title: z2.string().nullable(),\n citations: z2.object({ enabled: z2.boolean() }).optional(),\n source: z2.union([\n z2.object({\n type: z2.literal(\"base64\"),\n media_type: z2.literal(\"application/pdf\"),\n data: z2.string()\n }),\n z2.object({\n type: z2.literal(\"text\"),\n media_type: z2.literal(\"text/plain\"),\n data: z2.string()\n })\n ])\n })\n }),\n z2.object({\n type: z2.literal(\"web_fetch_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n z2.object({\n type: z2.literal(\"web_search_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.union([\n z2.array(\n z2.object({\n type: z2.literal(\"web_search_result\"),\n url: z2.string(),\n title: z2.string(),\n encrypted_content: z2.string(),\n page_age: z2.string().nullish()\n })\n ),\n z2.object({\n type: z2.literal(\"web_search_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n // code execution results for code_execution_20250522 tool:\n z2.object({\n type: z2.literal(\"code_execution_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.union([\n z2.object({\n type: z2.literal(\"code_execution_result\"),\n stdout: z2.string(),\n stderr: z2.string(),\n return_code: z2.number(),\n content: z2.array(\n z2.object({\n type: z2.literal(\"code_execution_output\"),\n file_id: z2.string()\n })\n ).optional().default([])\n }),\n z2.object({\n type: z2.literal(\"encrypted_code_execution_result\"),\n encrypted_stdout: z2.string(),\n stderr: z2.string(),\n return_code: z2.number(),\n content: z2.array(\n z2.object({\n type: z2.literal(\"code_execution_output\"),\n file_id: z2.string()\n })\n ).optional().default([])\n }),\n z2.object({\n type: z2.literal(\"code_execution_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n // bash code execution results for code_execution_20250825 tool:\n z2.object({\n type: z2.literal(\"bash_code_execution_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"bash_code_execution_result\"),\n content: z2.array(\n z2.object({\n type: z2.literal(\"bash_code_execution_output\"),\n file_id: z2.string()\n })\n ),\n stdout: z2.string(),\n stderr: z2.string(),\n return_code: z2.number()\n }),\n z2.object({\n type: z2.literal(\"bash_code_execution_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n // text editor code execution results for code_execution_20250825 tool:\n z2.object({\n type: z2.literal(\"text_editor_code_execution_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"text_editor_code_execution_tool_result_error\"),\n error_code: z2.string()\n }),\n z2.object({\n type: z2.literal(\"text_editor_code_execution_view_result\"),\n content: z2.string(),\n file_type: z2.string(),\n num_lines: z2.number().nullable(),\n start_line: z2.number().nullable(),\n total_lines: z2.number().nullable()\n }),\n z2.object({\n type: z2.literal(\"text_editor_code_execution_create_result\"),\n is_file_update: z2.boolean()\n }),\n z2.object({\n type: z2.literal(\n \"text_editor_code_execution_str_replace_result\"\n ),\n lines: z2.array(z2.string()).nullable(),\n new_lines: z2.number().nullable(),\n new_start: z2.number().nullable(),\n old_lines: z2.number().nullable(),\n old_start: z2.number().nullable()\n })\n ])\n }),\n // tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:\n z2.object({\n type: z2.literal(\"tool_search_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.union([\n z2.object({\n type: z2.literal(\"tool_search_tool_search_result\"),\n tool_references: z2.array(\n z2.object({\n type: z2.literal(\"tool_reference\"),\n tool_name: z2.string()\n })\n )\n }),\n z2.object({\n type: z2.literal(\"tool_search_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n // advisor results for advisor_20260301:\n z2.object({\n type: z2.literal(\"advisor_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"advisor_result\"),\n text: z2.string()\n }),\n z2.object({\n type: z2.literal(\"advisor_redacted_result\"),\n encrypted_content: z2.string()\n }),\n z2.object({\n type: z2.literal(\"advisor_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n })\n ])\n ),\n stop_reason: z2.string().nullish(),\n stop_sequence: z2.string().nullish(),\n usage: z2.looseObject({\n input_tokens: z2.number(),\n output_tokens: z2.number(),\n cache_creation_input_tokens: z2.number().nullish(),\n cache_read_input_tokens: z2.number().nullish(),\n iterations: z2.array(\n z2.union([\n z2.object({\n type: z2.union([z2.literal(\"compaction\"), z2.literal(\"message\")]),\n input_tokens: z2.number(),\n output_tokens: z2.number(),\n cache_creation_input_tokens: z2.number().nullish(),\n cache_read_input_tokens: z2.number().nullish()\n }),\n z2.object({\n type: z2.literal(\"advisor_message\"),\n model: z2.string(),\n input_tokens: z2.number(),\n output_tokens: z2.number(),\n cache_creation_input_tokens: z2.number().nullish(),\n cache_read_input_tokens: z2.number().nullish()\n })\n ])\n ).nullish()\n }),\n container: z2.object({\n expires_at: z2.string(),\n id: z2.string(),\n skills: z2.array(\n z2.object({\n type: z2.union([z2.literal(\"anthropic\"), z2.literal(\"custom\")]),\n skill_id: z2.string(),\n version: z2.string()\n })\n ).nullish()\n }).nullish(),\n context_management: z2.object({\n applied_edits: z2.array(\n z2.union([\n z2.object({\n type: z2.literal(\"clear_tool_uses_20250919\"),\n cleared_tool_uses: z2.number(),\n cleared_input_tokens: z2.number()\n }),\n z2.object({\n type: z2.literal(\"clear_thinking_20251015\"),\n cleared_thinking_turns: z2.number(),\n cleared_input_tokens: z2.number()\n }),\n z2.object({\n type: z2.literal(\"compact_20260112\")\n })\n ])\n )\n }).nullish()\n })\n )\n);\nvar anthropicMessagesChunkSchema = lazySchema2(\n () => zodSchema2(\n z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"message_start\"),\n message: z2.object({\n id: z2.string().nullish(),\n model: z2.string().nullish(),\n role: z2.string().nullish(),\n usage: z2.looseObject({\n input_tokens: z2.number(),\n cache_creation_input_tokens: z2.number().nullish(),\n cache_read_input_tokens: z2.number().nullish()\n }),\n // Programmatic tool calling: content may be pre-populated for deferred tool calls\n content: z2.array(\n z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"tool_use\"),\n id: z2.string(),\n name: z2.string(),\n input: z2.unknown(),\n caller: z2.union([\n z2.object({\n type: z2.literal(\"code_execution_20250825\"),\n tool_id: z2.string()\n }),\n z2.object({\n type: z2.literal(\"code_execution_20260120\"),\n tool_id: z2.string()\n }),\n z2.object({\n type: z2.literal(\"direct\")\n })\n ]).optional()\n })\n ])\n ).nullish(),\n stop_reason: z2.string().nullish(),\n container: z2.object({\n expires_at: z2.string(),\n id: z2.string()\n }).nullish()\n })\n }),\n z2.object({\n type: z2.literal(\"content_block_start\"),\n index: z2.number(),\n content_block: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"text\"),\n text: z2.string()\n }),\n z2.object({\n type: z2.literal(\"thinking\"),\n thinking: z2.string()\n }),\n z2.object({\n type: z2.literal(\"tool_use\"),\n id: z2.string(),\n name: z2.string(),\n // Programmatic tool calling: input may be present directly for deferred tool calls\n input: z2.record(z2.string(), z2.unknown()).optional(),\n // Programmatic tool calling: caller info when triggered from code execution\n caller: z2.union([\n z2.object({\n type: z2.literal(\"code_execution_20250825\"),\n tool_id: z2.string()\n }),\n z2.object({\n type: z2.literal(\"code_execution_20260120\"),\n tool_id: z2.string()\n }),\n z2.object({\n type: z2.literal(\"direct\")\n })\n ]).optional()\n }),\n z2.object({\n type: z2.literal(\"redacted_thinking\"),\n data: z2.string()\n }),\n z2.object({\n type: z2.literal(\"compaction\"),\n content: z2.string().nullish()\n }),\n z2.object({\n type: z2.literal(\"server_tool_use\"),\n id: z2.string(),\n name: z2.string(),\n input: z2.record(z2.string(), z2.unknown()).nullish(),\n caller: z2.union([\n z2.object({\n type: z2.literal(\"code_execution_20260120\"),\n tool_id: z2.string()\n }),\n z2.object({\n type: z2.literal(\"direct\")\n })\n ]).optional()\n }),\n z2.object({\n type: z2.literal(\"mcp_tool_use\"),\n id: z2.string(),\n name: z2.string(),\n input: z2.unknown(),\n server_name: z2.string()\n }),\n z2.object({\n type: z2.literal(\"mcp_tool_result\"),\n tool_use_id: z2.string(),\n is_error: z2.boolean(),\n content: z2.array(\n z2.union([\n z2.string(),\n z2.object({ type: z2.literal(\"text\"), text: z2.string() })\n ])\n )\n }),\n z2.object({\n type: z2.literal(\"web_fetch_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.union([\n z2.object({\n type: z2.literal(\"web_fetch_result\"),\n url: z2.string(),\n retrieved_at: z2.string(),\n content: z2.object({\n type: z2.literal(\"document\"),\n title: z2.string().nullable(),\n citations: z2.object({ enabled: z2.boolean() }).optional(),\n source: z2.union([\n z2.object({\n type: z2.literal(\"base64\"),\n media_type: z2.literal(\"application/pdf\"),\n data: z2.string()\n }),\n z2.object({\n type: z2.literal(\"text\"),\n media_type: z2.literal(\"text/plain\"),\n data: z2.string()\n })\n ])\n })\n }),\n z2.object({\n type: z2.literal(\"web_fetch_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n z2.object({\n type: z2.literal(\"web_search_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.union([\n z2.array(\n z2.object({\n type: z2.literal(\"web_search_result\"),\n url: z2.string(),\n title: z2.string(),\n encrypted_content: z2.string(),\n page_age: z2.string().nullish()\n })\n ),\n z2.object({\n type: z2.literal(\"web_search_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n // code execution results for code_execution_20250522 tool:\n z2.object({\n type: z2.literal(\"code_execution_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.union([\n z2.object({\n type: z2.literal(\"code_execution_result\"),\n stdout: z2.string(),\n stderr: z2.string(),\n return_code: z2.number(),\n content: z2.array(\n z2.object({\n type: z2.literal(\"code_execution_output\"),\n file_id: z2.string()\n })\n ).optional().default([])\n }),\n z2.object({\n type: z2.literal(\"encrypted_code_execution_result\"),\n encrypted_stdout: z2.string(),\n stderr: z2.string(),\n return_code: z2.number(),\n content: z2.array(\n z2.object({\n type: z2.literal(\"code_execution_output\"),\n file_id: z2.string()\n })\n ).optional().default([])\n }),\n z2.object({\n type: z2.literal(\"code_execution_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n // bash code execution results for code_execution_20250825 tool:\n z2.object({\n type: z2.literal(\"bash_code_execution_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"bash_code_execution_result\"),\n content: z2.array(\n z2.object({\n type: z2.literal(\"bash_code_execution_output\"),\n file_id: z2.string()\n })\n ),\n stdout: z2.string(),\n stderr: z2.string(),\n return_code: z2.number()\n }),\n z2.object({\n type: z2.literal(\"bash_code_execution_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n // text editor code execution results for code_execution_20250825 tool:\n z2.object({\n type: z2.literal(\"text_editor_code_execution_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"text_editor_code_execution_tool_result_error\"),\n error_code: z2.string()\n }),\n z2.object({\n type: z2.literal(\"text_editor_code_execution_view_result\"),\n content: z2.string(),\n file_type: z2.string(),\n num_lines: z2.number().nullable(),\n start_line: z2.number().nullable(),\n total_lines: z2.number().nullable()\n }),\n z2.object({\n type: z2.literal(\"text_editor_code_execution_create_result\"),\n is_file_update: z2.boolean()\n }),\n z2.object({\n type: z2.literal(\n \"text_editor_code_execution_str_replace_result\"\n ),\n lines: z2.array(z2.string()).nullable(),\n new_lines: z2.number().nullable(),\n new_start: z2.number().nullable(),\n old_lines: z2.number().nullable(),\n old_start: z2.number().nullable()\n })\n ])\n }),\n // tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:\n z2.object({\n type: z2.literal(\"tool_search_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.union([\n z2.object({\n type: z2.literal(\"tool_search_tool_search_result\"),\n tool_references: z2.array(\n z2.object({\n type: z2.literal(\"tool_reference\"),\n tool_name: z2.string()\n })\n )\n }),\n z2.object({\n type: z2.literal(\"tool_search_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n }),\n // advisor results for advisor_20260301:\n z2.object({\n type: z2.literal(\"advisor_tool_result\"),\n tool_use_id: z2.string(),\n content: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"advisor_result\"),\n text: z2.string()\n }),\n z2.object({\n type: z2.literal(\"advisor_redacted_result\"),\n encrypted_content: z2.string()\n }),\n z2.object({\n type: z2.literal(\"advisor_tool_result_error\"),\n error_code: z2.string()\n })\n ])\n })\n ])\n }),\n z2.object({\n type: z2.literal(\"content_block_delta\"),\n index: z2.number(),\n delta: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"input_json_delta\"),\n partial_json: z2.string()\n }),\n z2.object({\n type: z2.literal(\"text_delta\"),\n text: z2.string()\n }),\n z2.object({\n type: z2.literal(\"thinking_delta\"),\n thinking: z2.string()\n }),\n z2.object({\n type: z2.literal(\"signature_delta\"),\n signature: z2.string()\n }),\n z2.object({\n type: z2.literal(\"compaction_delta\"),\n content: z2.string().nullish()\n }),\n z2.object({\n type: z2.literal(\"citations_delta\"),\n citation: z2.discriminatedUnion(\"type\", [\n z2.object({\n type: z2.literal(\"web_search_result_location\"),\n cited_text: z2.string(),\n url: z2.string(),\n title: z2.string(),\n encrypted_index: z2.string()\n }),\n z2.object({\n type: z2.literal(\"page_location\"),\n cited_text: z2.string(),\n document_index: z2.number(),\n document_title: z2.string().nullable(),\n start_page_number: z2.number(),\n end_page_number: z2.number()\n }),\n z2.object({\n type: z2.literal(\"char_location\"),\n cited_text: z2.string(),\n document_index: z2.number(),\n document_title: z2.string().nullable(),\n start_char_index: z2.number(),\n end_char_index: z2.number()\n })\n ])\n })\n ])\n }),\n z2.object({\n type: z2.literal(\"content_block_stop\"),\n index: z2.number()\n }),\n z2.object({\n type: z2.literal(\"error\"),\n error: z2.object({\n type: z2.string(),\n message: z2.string()\n })\n }),\n z2.object({\n type: z2.literal(\"message_delta\"),\n delta: z2.object({\n stop_reason: z2.string().nullish(),\n stop_sequence: z2.string().nullish(),\n container: z2.object({\n expires_at: z2.string(),\n id: z2.string(),\n skills: z2.array(\n z2.object({\n type: z2.union([\n z2.literal(\"anthropic\"),\n z2.literal(\"custom\")\n ]),\n skill_id: z2.string(),\n version: z2.string()\n })\n ).nullish()\n }).nullish()\n }),\n usage: z2.looseObject({\n input_tokens: z2.number().nullish(),\n output_tokens: z2.number(),\n cache_creation_input_tokens: z2.number().nullish(),\n cache_read_input_tokens: z2.number().nullish(),\n iterations: z2.array(\n z2.union([\n z2.object({\n type: z2.union([\n z2.literal(\"compaction\"),\n z2.literal(\"message\")\n ]),\n input_tokens: z2.number(),\n output_tokens: z2.number(),\n cache_creation_input_tokens: z2.number().nullish(),\n cache_read_input_tokens: z2.number().nullish()\n }),\n z2.object({\n type: z2.literal(\"advisor_message\"),\n model: z2.string(),\n input_tokens: z2.number(),\n output_tokens: z2.number(),\n cache_creation_input_tokens: z2.number().nullish(),\n cache_read_input_tokens: z2.number().nullish()\n })\n ])\n ).nullish()\n }),\n context_management: z2.object({\n applied_edits: z2.array(\n z2.union([\n z2.object({\n type: z2.literal(\"clear_tool_uses_20250919\"),\n cleared_tool_uses: z2.number(),\n cleared_input_tokens: z2.number()\n }),\n z2.object({\n type: z2.literal(\"clear_thinking_20251015\"),\n cleared_thinking_turns: z2.number(),\n cleared_input_tokens: z2.number()\n }),\n z2.object({\n type: z2.literal(\"compact_20260112\")\n })\n ])\n )\n }).nullish()\n }),\n z2.object({\n type: z2.literal(\"message_stop\")\n }),\n z2.object({\n type: z2.literal(\"ping\")\n })\n ])\n )\n);\nvar anthropicReasoningMetadataSchema = lazySchema2(\n () => zodSchema2(\n z2.object({\n signature: z2.string().optional(),\n redactedData: z2.string().optional()\n })\n )\n);\n\n// src/anthropic-messages-options.ts\nimport { z as z3 } from \"zod/v4\";\nvar anthropicFilePartProviderOptions = z3.object({\n /**\n * Citation configuration for this document.\n * When enabled, this document will generate citations in the response.\n */\n citations: z3.object({\n /**\n * Enable citations for this document\n */\n enabled: z3.boolean()\n }).optional(),\n /**\n * Custom title for the document.\n * If not provided, the filename will be used.\n */\n title: z3.string().optional(),\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: z3.string().optional()\n});\nvar anthropicLanguageModelOptions = z3.object({\n /**\n * Whether to send reasoning to the model.\n *\n * This allows you to deactivate reasoning inputs for models that do not support them.\n */\n sendReasoning: z3.boolean().optional(),\n /**\n * Determines how structured outputs are generated.\n *\n * - `outputFormat`: Use the `output_config.format` parameter to specify the structured output format.\n * - `jsonTool`: Use a special 'json' tool to specify the structured output format.\n * - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).\n */\n structuredOutputMode: z3.enum([\"outputFormat\", \"jsonTool\", \"auto\"]).optional(),\n /**\n * Configuration for enabling Claude's extended thinking.\n *\n * When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.\n * Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.\n */\n thinking: z3.discriminatedUnion(\"type\", [\n z3.object({\n /** for Sonnet 4.6, Opus 4.6, and newer models */\n type: z3.literal(\"adaptive\"),\n /**\n * Controls whether thinking content is included in the response.\n * - `\"omitted\"`: Thinking blocks are present but text is empty (default for Opus 4.7+).\n * - `\"summarized\"`: Thinking content is returned. Required to see reasoning output.\n */\n display: z3.enum([\"omitted\", \"summarized\"]).optional()\n }),\n z3.object({\n /** for models before Opus 4.6, except Sonnet 4.6 still supports it */\n type: z3.literal(\"enabled\"),\n budgetTokens: z3.number().optional()\n }),\n z3.object({\n type: z3.literal(\"disabled\")\n })\n ]).optional(),\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: z3.boolean().optional(),\n /**\n * Cache control settings for this message.\n * See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching\n */\n cacheControl: z3.object({\n type: z3.literal(\"ephemeral\"),\n ttl: z3.union([z3.literal(\"5m\"), z3.literal(\"1h\")]).optional()\n }).optional(),\n /**\n * Metadata to include with the request.\n *\n * See https://platform.claude.com/docs/en/api/messages/create for details.\n */\n metadata: z3.object({\n /**\n * An external identifier for the user associated with the request.\n *\n * Should be a UUID, hash value, or other opaque identifier.\n * Must not contain PII (name, email, phone number, etc.).\n */\n userId: z3.string().optional()\n }).optional(),\n /**\n * MCP servers to be utilized in this request.\n */\n mcpServers: z3.array(\n z3.object({\n type: z3.literal(\"url\"),\n name: z3.string(),\n url: z3.string(),\n authorizationToken: z3.string().nullish(),\n toolConfiguration: z3.object({\n enabled: z3.boolean().nullish(),\n allowedTools: z3.array(z3.string()).nullish()\n }).nullish()\n })\n ).optional(),\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: z3.object({\n id: z3.string().optional(),\n skills: z3.array(\n z3.object({\n type: z3.union([z3.literal(\"anthropic\"), z3.literal(\"custom\")]),\n skillId: z3.string(),\n version: z3.string().optional()\n })\n ).optional()\n }).optional(),\n /**\n * Whether to enable fine-grained (eager) streaming of tool call inputs\n * and structured outputs for every function tool in the request. When\n * true (the default), each function tool receives a default of\n * `eager_input_streaming: true` unless it explicitly sets\n * `providerOptions.anthropic.eagerInputStreaming`.\n *\n * @default true\n */\n toolStreaming: z3.boolean().optional(),\n /**\n * @default 'high'\n */\n effort: z3.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]).optional(),\n /**\n * Task budget for agentic turns. Informs the model of the total token budget\n * available for the current task, allowing it to prioritize work and wind down\n * gracefully as the budget is consumed.\n *\n * Advisory only — does not enforce a hard token limit.\n */\n taskBudget: z3.object({\n type: z3.literal(\"tokens\"),\n total: z3.number().int().min(2e4),\n remaining: z3.number().int().min(0).optional()\n }).optional(),\n /**\n * Enable fast mode for faster inference (2.5x faster output token speeds).\n * Only supported with claude-opus-4-6.\n */\n speed: z3.enum([\"fast\", \"standard\"]).optional(),\n /**\n * Controls where model inference runs for this request.\n *\n * - `\"global\"`: Inference may run in any available geography (default).\n * - `\"us\"`: Inference runs only in US-based infrastructure.\n *\n * See https://platform.claude.com/docs/en/build-with-claude/data-residency\n */\n inferenceGeo: z3.enum([\"us\", \"global\"]).optional(),\n /**\n * A set of beta features to enable.\n * Allow a provider to receive the full `betas` set if it needs it.\n */\n anthropicBeta: z3.array(z3.string()).optional(),\n contextManagement: z3.object({\n edits: z3.array(\n z3.discriminatedUnion(\"type\", [\n z3.object({\n type: z3.literal(\"clear_tool_uses_20250919\"),\n trigger: z3.discriminatedUnion(\"type\", [\n z3.object({\n type: z3.literal(\"input_tokens\"),\n value: z3.number()\n }),\n z3.object({\n type: z3.literal(\"tool_uses\"),\n value: z3.number()\n })\n ]).optional(),\n keep: z3.object({\n type: z3.literal(\"tool_uses\"),\n value: z3.number()\n }).optional(),\n clearAtLeast: z3.object({\n type: z3.literal(\"input_tokens\"),\n value: z3.number()\n }).optional(),\n clearToolInputs: z3.boolean().optional(),\n excludeTools: z3.array(z3.string()).optional()\n }),\n z3.object({\n type: z3.literal(\"clear_thinking_20251015\"),\n keep: z3.union([\n z3.literal(\"all\"),\n z3.object({\n type: z3.literal(\"thinking_turns\"),\n value: z3.number()\n })\n ]).optional()\n }),\n z3.object({\n type: z3.literal(\"compact_20260112\"),\n trigger: z3.object({\n type: z3.literal(\"input_tokens\"),\n value: z3.number()\n }).optional(),\n pauseAfterCompaction: z3.boolean().optional(),\n instructions: z3.string().optional()\n })\n ])\n )\n }).optional()\n});\n\n// src/anthropic-prepare-tools.ts\nimport {\n UnsupportedFunctionalityError\n} from \"@ai-sdk/provider\";\n\n// src/get-cache-control.ts\nvar MAX_CACHE_BREAKPOINTS = 4;\nfunction getCacheControl(providerMetadata) {\n var _a;\n const anthropic = providerMetadata == null ? void 0 : providerMetadata.anthropic;\n const cacheControlValue = (_a = anthropic == null ? void 0 : anthropic.cacheControl) != null ? _a : anthropic == null ? void 0 : anthropic.cache_control;\n return cacheControlValue;\n}\nvar CacheControlValidator = class {\n constructor() {\n this.breakpointCount = 0;\n this.warnings = [];\n }\n getCacheControl(providerMetadata, context) {\n const cacheControlValue = getCacheControl(providerMetadata);\n if (!cacheControlValue) {\n return void 0;\n }\n if (!context.canCache) {\n this.warnings.push({\n type: \"unsupported\",\n feature: \"cache_control on non-cacheable context\",\n details: `cache_control cannot be set on ${context.type}. It will be ignored.`\n });\n return void 0;\n }\n this.breakpointCount++;\n if (this.breakpointCount > MAX_CACHE_BREAKPOINTS) {\n this.warnings.push({\n type: \"unsupported\",\n feature: \"cacheControl breakpoint limit\",\n details: `Maximum ${MAX_CACHE_BREAKPOINTS} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`\n });\n return void 0;\n }\n return cacheControlValue;\n }\n getWarnings() {\n return this.warnings;\n }\n};\n\n// src/tool/advisor_20260301.ts\nimport {\n createProviderToolFactoryWithOutputSchema,\n lazySchema as lazySchema3,\n zodSchema as zodSchema3\n} from \"@ai-sdk/provider-utils\";\nimport { z as z4 } from \"zod/v4\";\nvar advisor_20260301ArgsSchema = lazySchema3(\n () => zodSchema3(\n z4.object({\n model: z4.string(),\n maxUses: z4.number().optional(),\n caching: z4.object({\n type: z4.literal(\"ephemeral\"),\n ttl: z4.union([z4.literal(\"5m\"), z4.literal(\"1h\")])\n }).optional()\n })\n )\n);\nvar advisor_20260301OutputSchema = lazySchema3(\n () => zodSchema3(\n z4.discriminatedUnion(\"type\", [\n z4.object({\n type: z4.literal(\"advisor_result\"),\n text: z4.string()\n }),\n z4.object({\n type: z4.literal(\"advisor_redacted_result\"),\n encryptedContent: z4.string()\n }),\n z4.object({\n type: z4.literal(\"advisor_tool_result_error\"),\n errorCode: z4.string()\n })\n ])\n )\n);\nvar advisor_20260301InputSchema = lazySchema3(\n () => zodSchema3(z4.object({}).strict())\n);\nvar factory = createProviderToolFactoryWithOutputSchema({\n id: \"anthropic.advisor_20260301\",\n inputSchema: advisor_20260301InputSchema,\n outputSchema: advisor_20260301OutputSchema,\n supportsDeferredResults: true\n});\nvar advisor_20260301 = (args) => {\n return factory(args);\n};\n\n// src/tool/text-editor_20250728.ts\nimport {\n createProviderToolFactory,\n lazySchema as lazySchema4,\n zodSchema as zodSchema4\n} from \"@ai-sdk/provider-utils\";\nimport { z as z5 } from \"zod/v4\";\nvar textEditor_20250728ArgsSchema = lazySchema4(\n () => zodSchema4(\n z5.object({\n maxCharacters: z5.number().optional()\n })\n )\n);\nvar textEditor_20250728InputSchema = lazySchema4(\n () => zodSchema4(\n z5.object({\n command: z5.enum([\"view\", \"create\", \"str_replace\", \"insert\"]),\n path: z5.string(),\n file_text: z5.string().optional(),\n insert_line: z5.number().int().optional(),\n new_str: z5.string().optional(),\n insert_text: z5.string().optional(),\n old_str: z5.string().optional(),\n view_range: z5.array(z5.number().int()).optional()\n })\n )\n);\nvar factory2 = createProviderToolFactory({\n id: \"anthropic.text_editor_20250728\",\n inputSchema: textEditor_20250728InputSchema\n});\nvar textEditor_20250728 = (args = {}) => {\n return factory2(args);\n};\n\n// src/tool/web-search_20260209.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,\n lazySchema as lazySchema5,\n zodSchema as zodSchema5\n} from \"@ai-sdk/provider-utils\";\nimport { z as z6 } from \"zod/v4\";\nvar webSearch_20260209ArgsSchema = lazySchema5(\n () => zodSchema5(\n z6.object({\n maxUses: z6.number().optional(),\n allowedDomains: z6.array(z6.string()).optional(),\n blockedDomains: z6.array(z6.string()).optional(),\n userLocation: z6.object({\n type: z6.literal(\"approximate\"),\n city: z6.string().optional(),\n region: z6.string().optional(),\n country: z6.string().optional(),\n timezone: z6.string().optional()\n }).optional()\n })\n )\n);\nvar webSearch_20260209OutputSchema = lazySchema5(\n () => zodSchema5(\n z6.array(\n z6.object({\n url: z6.string(),\n title: z6.string().nullable(),\n pageAge: z6.string().nullable(),\n encryptedContent: z6.string(),\n type: z6.literal(\"web_search_result\")\n })\n )\n )\n);\nvar webSearch_20260209InputSchema = lazySchema5(\n () => zodSchema5(\n z6.object({\n query: z6.string()\n })\n )\n);\nvar factory3 = createProviderToolFactoryWithOutputSchema2({\n id: \"anthropic.web_search_20260209\",\n inputSchema: webSearch_20260209InputSchema,\n outputSchema: webSearch_20260209OutputSchema,\n supportsDeferredResults: true\n});\nvar webSearch_20260209 = (args = {}) => {\n return factory3(args);\n};\n\n// src/tool/web-search_20250305.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,\n lazySchema as lazySchema6,\n zodSchema as zodSchema6\n} from \"@ai-sdk/provider-utils\";\nimport { z as z7 } from \"zod/v4\";\nvar webSearch_20250305ArgsSchema = lazySchema6(\n () => zodSchema6(\n z7.object({\n maxUses: z7.number().optional(),\n allowedDomains: z7.array(z7.string()).optional(),\n blockedDomains: z7.array(z7.string()).optional(),\n userLocation: z7.object({\n type: z7.literal(\"approximate\"),\n city: z7.string().optional(),\n region: z7.string().optional(),\n country: z7.string().optional(),\n timezone: z7.string().optional()\n }).optional()\n })\n )\n);\nvar webSearch_20250305OutputSchema = lazySchema6(\n () => zodSchema6(\n z7.array(\n z7.object({\n url: z7.string(),\n title: z7.string().nullable(),\n pageAge: z7.string().nullable(),\n encryptedContent: z7.string(),\n type: z7.literal(\"web_search_result\")\n })\n )\n )\n);\nvar webSearch_20250305InputSchema = lazySchema6(\n () => zodSchema6(\n z7.object({\n query: z7.string()\n })\n )\n);\nvar factory4 = createProviderToolFactoryWithOutputSchema3({\n id: \"anthropic.web_search_20250305\",\n inputSchema: webSearch_20250305InputSchema,\n outputSchema: webSearch_20250305OutputSchema,\n supportsDeferredResults: true\n});\nvar webSearch_20250305 = (args = {}) => {\n return factory4(args);\n};\n\n// src/tool/web-fetch-20260209.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,\n lazySchema as lazySchema7,\n zodSchema as zodSchema7\n} from \"@ai-sdk/provider-utils\";\nimport { z as z8 } from \"zod/v4\";\nvar webFetch_20260209ArgsSchema = lazySchema7(\n () => zodSchema7(\n z8.object({\n maxUses: z8.number().optional(),\n allowedDomains: z8.array(z8.string()).optional(),\n blockedDomains: z8.array(z8.string()).optional(),\n citations: z8.object({ enabled: z8.boolean() }).optional(),\n maxContentTokens: z8.number().optional()\n })\n )\n);\nvar webFetch_20260209OutputSchema = lazySchema7(\n () => zodSchema7(\n z8.object({\n type: z8.literal(\"web_fetch_result\"),\n url: z8.string(),\n content: z8.object({\n type: z8.literal(\"document\"),\n title: z8.string().nullable(),\n citations: z8.object({ enabled: z8.boolean() }).optional(),\n source: z8.union([\n z8.object({\n type: z8.literal(\"base64\"),\n mediaType: z8.literal(\"application/pdf\"),\n data: z8.string()\n }),\n z8.object({\n type: z8.literal(\"text\"),\n mediaType: z8.literal(\"text/plain\"),\n data: z8.string()\n })\n ])\n }),\n retrievedAt: z8.string().nullable()\n })\n )\n);\nvar webFetch_20260209InputSchema = lazySchema7(\n () => zodSchema7(\n z8.object({\n url: z8.string()\n })\n )\n);\nvar factory5 = createProviderToolFactoryWithOutputSchema4({\n id: \"anthropic.web_fetch_20260209\",\n inputSchema: webFetch_20260209InputSchema,\n outputSchema: webFetch_20260209OutputSchema,\n supportsDeferredResults: true\n});\nvar webFetch_20260209 = (args = {}) => {\n return factory5(args);\n};\n\n// src/tool/web-fetch-20250910.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,\n lazySchema as lazySchema8,\n zodSchema as zodSchema8\n} from \"@ai-sdk/provider-utils\";\nimport { z as z9 } from \"zod/v4\";\nvar webFetch_20250910ArgsSchema = lazySchema8(\n () => zodSchema8(\n z9.object({\n maxUses: z9.number().optional(),\n allowedDomains: z9.array(z9.string()).optional(),\n blockedDomains: z9.array(z9.string()).optional(),\n citations: z9.object({ enabled: z9.boolean() }).optional(),\n maxContentTokens: z9.number().optional()\n })\n )\n);\nvar webFetch_20250910OutputSchema = lazySchema8(\n () => zodSchema8(\n z9.object({\n type: z9.literal(\"web_fetch_result\"),\n url: z9.string(),\n content: z9.object({\n type: z9.literal(\"document\"),\n title: z9.string().nullable(),\n citations: z9.object({ enabled: z9.boolean() }).optional(),\n source: z9.union([\n z9.object({\n type: z9.literal(\"base64\"),\n mediaType: z9.literal(\"application/pdf\"),\n data: z9.string()\n }),\n z9.object({\n type: z9.literal(\"text\"),\n mediaType: z9.literal(\"text/plain\"),\n data: z9.string()\n })\n ])\n }),\n retrievedAt: z9.string().nullable()\n })\n )\n);\nvar webFetch_20250910InputSchema = lazySchema8(\n () => zodSchema8(\n z9.object({\n url: z9.string()\n })\n )\n);\nvar factory6 = createProviderToolFactoryWithOutputSchema5({\n id: \"anthropic.web_fetch_20250910\",\n inputSchema: webFetch_20250910InputSchema,\n outputSchema: webFetch_20250910OutputSchema,\n supportsDeferredResults: true\n});\nvar webFetch_20250910 = (args = {}) => {\n return factory6(args);\n};\n\n// src/anthropic-prepare-tools.ts\nimport { validateTypes } from \"@ai-sdk/provider-utils\";\nasync function prepareTools({\n tools,\n toolChoice,\n disableParallelToolUse,\n cacheControlValidator,\n supportsStructuredOutput,\n supportsStrictTools,\n defaultEagerInputStreaming = false\n}) {\n var _a, _b;\n tools = (tools == null ? void 0 : tools.length) ? tools : void 0;\n const toolWarnings = [];\n const betas = /* @__PURE__ */ new Set();\n const validator = cacheControlValidator || new CacheControlValidator();\n if (tools == null) {\n return { tools: void 0, toolChoice: void 0, toolWarnings, betas };\n }\n const anthropicTools2 = [];\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 const anthropicOptions = (_a = tool.providerOptions) == null ? void 0 : _a.anthropic;\n const eagerInputStreaming = (_b = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming) != null ? _b : defaultEagerInputStreaming;\n const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;\n const allowedCallers = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers;\n if (!supportsStrictTools && tool.strict != null) {\n toolWarnings.push({\n type: \"unsupported\",\n feature: \"strict\",\n details: `Tool '${tool.name}' has strict: ${tool.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`\n });\n }\n anthropicTools2.push({\n name: tool.name,\n description: tool.description,\n input_schema: tool.inputSchema,\n cache_control: cacheControl,\n ...eagerInputStreaming ? { eager_input_streaming: true } : {},\n ...supportsStrictTools === true && tool.strict != null ? { strict: tool.strict } : {},\n ...deferLoading != null ? { defer_loading: deferLoading } : {},\n ...allowedCallers != null ? { allowed_callers: allowedCallers } : {},\n ...tool.inputExamples != null ? {\n input_examples: tool.inputExamples.map(\n (example) => example.input\n )\n } : {}\n });\n if (supportsStructuredOutput === true) {\n betas.add(\"structured-outputs-2025-11-13\");\n }\n if (tool.inputExamples != null || allowedCallers != null) {\n betas.add(\"advanced-tool-use-2025-11-20\");\n }\n break;\n }\n case \"provider\": {\n switch (tool.id) {\n case \"anthropic.code_execution_20250522\": {\n betas.add(\"code-execution-2025-05-22\");\n anthropicTools2.push({\n type: \"code_execution_20250522\",\n name: \"code_execution\",\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.code_execution_20250825\": {\n betas.add(\"code-execution-2025-08-25\");\n anthropicTools2.push({\n type: \"code_execution_20250825\",\n name: \"code_execution\"\n });\n break;\n }\n case \"anthropic.code_execution_20260120\": {\n anthropicTools2.push({\n type: \"code_execution_20260120\",\n name: \"code_execution\"\n });\n break;\n }\n case \"anthropic.computer_20250124\": {\n betas.add(\"computer-use-2025-01-24\");\n anthropicTools2.push({\n name: \"computer\",\n type: \"computer_20250124\",\n display_width_px: tool.args.displayWidthPx,\n display_height_px: tool.args.displayHeightPx,\n display_number: tool.args.displayNumber,\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.computer_20251124\": {\n betas.add(\"computer-use-2025-11-24\");\n anthropicTools2.push({\n name: \"computer\",\n type: \"computer_20251124\",\n display_width_px: tool.args.displayWidthPx,\n display_height_px: tool.args.displayHeightPx,\n display_number: tool.args.displayNumber,\n enable_zoom: tool.args.enableZoom,\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.computer_20241022\": {\n betas.add(\"computer-use-2024-10-22\");\n anthropicTools2.push({\n name: \"computer\",\n type: \"computer_20241022\",\n display_width_px: tool.args.displayWidthPx,\n display_height_px: tool.args.displayHeightPx,\n display_number: tool.args.displayNumber,\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.text_editor_20250124\": {\n betas.add(\"computer-use-2025-01-24\");\n anthropicTools2.push({\n name: \"str_replace_editor\",\n type: \"text_editor_20250124\",\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.text_editor_20241022\": {\n betas.add(\"computer-use-2024-10-22\");\n anthropicTools2.push({\n name: \"str_replace_editor\",\n type: \"text_editor_20241022\",\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.text_editor_20250429\": {\n betas.add(\"computer-use-2025-01-24\");\n anthropicTools2.push({\n name: \"str_replace_based_edit_tool\",\n type: \"text_editor_20250429\",\n cache_control: void 0\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 anthropicTools2.push({\n name: \"str_replace_based_edit_tool\",\n type: \"text_editor_20250728\",\n max_characters: args.maxCharacters,\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.bash_20250124\": {\n betas.add(\"computer-use-2025-01-24\");\n anthropicTools2.push({\n name: \"bash\",\n type: \"bash_20250124\",\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.bash_20241022\": {\n betas.add(\"computer-use-2024-10-22\");\n anthropicTools2.push({\n name: \"bash\",\n type: \"bash_20241022\",\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.memory_20250818\": {\n betas.add(\"context-management-2025-06-27\");\n anthropicTools2.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 anthropicTools2.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: void 0\n });\n break;\n }\n case \"anthropic.web_fetch_20260209\": {\n betas.add(\"code-execution-web-tools-2026-02-09\");\n const args = await validateTypes({\n value: tool.args,\n schema: webFetch_20260209ArgsSchema\n });\n anthropicTools2.push({\n type: \"web_fetch_20260209\",\n name: \"web_fetch\",\n max_uses: args.maxUses,\n allowed_domains: args.allowedDomains,\n blocked_domains: args.blockedDomains,\n citations: args.citations,\n max_content_tokens: args.maxContentTokens,\n cache_control: void 0\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 anthropicTools2.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: void 0\n });\n break;\n }\n case \"anthropic.web_search_20260209\": {\n betas.add(\"code-execution-web-tools-2026-02-09\");\n const args = await validateTypes({\n value: tool.args,\n schema: webSearch_20260209ArgsSchema\n });\n anthropicTools2.push({\n type: \"web_search_20260209\",\n name: \"web_search\",\n max_uses: args.maxUses,\n allowed_domains: args.allowedDomains,\n blocked_domains: args.blockedDomains,\n user_location: args.userLocation,\n cache_control: void 0\n });\n break;\n }\n case \"anthropic.tool_search_regex_20251119\": {\n anthropicTools2.push({\n type: \"tool_search_tool_regex_20251119\",\n name: \"tool_search_tool_regex\"\n });\n break;\n }\n case \"anthropic.tool_search_bm25_20251119\": {\n anthropicTools2.push({\n type: \"tool_search_tool_bm25_20251119\",\n name: \"tool_search_tool_bm25\"\n });\n break;\n }\n case \"anthropic.advisor_20260301\": {\n betas.add(\"advisor-tool-2026-03-01\");\n const args = await validateTypes({\n value: tool.args,\n schema: advisor_20260301ArgsSchema\n });\n anthropicTools2.push({\n type: \"advisor_20260301\",\n name: \"advisor\",\n model: args.model,\n ...args.maxUses !== void 0 && { max_uses: args.maxUses },\n ...args.caching !== void 0 && { caching: args.caching }\n });\n break;\n }\n default: {\n toolWarnings.push({\n type: \"unsupported\",\n feature: `provider-defined tool ${tool.id}`\n });\n break;\n }\n }\n break;\n }\n default: {\n toolWarnings.push({\n type: \"unsupported\",\n feature: `tool ${tool}`\n });\n break;\n }\n }\n }\n if (toolChoice == null) {\n return {\n tools: anthropicTools2,\n toolChoice: disableParallelToolUse ? { type: \"auto\", disable_parallel_tool_use: disableParallelToolUse } : void 0,\n toolWarnings,\n betas\n };\n }\n const type = toolChoice.type;\n switch (type) {\n case \"auto\":\n return {\n tools: anthropicTools2,\n toolChoice: {\n type: \"auto\",\n disable_parallel_tool_use: disableParallelToolUse\n },\n toolWarnings,\n betas\n };\n case \"required\":\n return {\n tools: anthropicTools2,\n toolChoice: {\n type: \"any\",\n disable_parallel_tool_use: disableParallelToolUse\n },\n toolWarnings,\n betas\n };\n case \"none\":\n return { tools: void 0, toolChoice: void 0, toolWarnings, betas };\n case \"tool\":\n return {\n tools: anthropicTools2,\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 = type;\n throw new UnsupportedFunctionalityError({\n functionality: `tool choice type: ${_exhaustiveCheck}`\n });\n }\n }\n}\n\n// src/convert-anthropic-messages-usage.ts\nfunction convertAnthropicMessagesUsage({\n usage,\n rawUsage\n}) {\n var _a, _b;\n const cacheCreationTokens = (_a = usage.cache_creation_input_tokens) != null ? _a : 0;\n const cacheReadTokens = (_b = usage.cache_read_input_tokens) != null ? _b : 0;\n let inputTokens;\n let outputTokens;\n if (usage.iterations && usage.iterations.length > 0) {\n const executorIterations = usage.iterations.filter(\n (iter) => iter.type === \"compaction\" || iter.type === \"message\"\n );\n if (executorIterations.length > 0) {\n const totals = executorIterations.reduce(\n (acc, iter) => ({\n input: acc.input + iter.input_tokens,\n output: acc.output + iter.output_tokens\n }),\n { input: 0, output: 0 }\n );\n inputTokens = totals.input;\n outputTokens = totals.output;\n } else {\n inputTokens = usage.input_tokens;\n outputTokens = usage.output_tokens;\n }\n } else {\n inputTokens = usage.input_tokens;\n outputTokens = usage.output_tokens;\n }\n return {\n inputTokens: {\n total: inputTokens + cacheCreationTokens + cacheReadTokens,\n noCache: inputTokens,\n cacheRead: cacheReadTokens,\n cacheWrite: cacheCreationTokens\n },\n outputTokens: {\n total: outputTokens,\n text: void 0,\n reasoning: void 0\n },\n raw: rawUsage != null ? rawUsage : usage\n };\n}\n\n// src/convert-to-anthropic-messages-prompt.ts\nimport {\n UnsupportedFunctionalityError as UnsupportedFunctionalityError2\n} from \"@ai-sdk/provider\";\nimport {\n convertBase64ToUint8Array,\n convertToBase64,\n parseProviderOptions,\n safeParseJSON,\n validateTypes as validateTypes2,\n isNonNullable\n} from \"@ai-sdk/provider-utils\";\n\n// src/tool/code-execution_20250522.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,\n lazySchema as lazySchema9,\n zodSchema as zodSchema9\n} from \"@ai-sdk/provider-utils\";\nimport { z as z10 } from \"zod/v4\";\nvar codeExecution_20250522OutputSchema = lazySchema9(\n () => zodSchema9(\n z10.object({\n type: z10.literal(\"code_execution_result\"),\n stdout: z10.string(),\n stderr: z10.string(),\n return_code: z10.number(),\n content: z10.array(\n z10.object({\n type: z10.literal(\"code_execution_output\"),\n file_id: z10.string()\n })\n ).optional().default([])\n })\n )\n);\nvar codeExecution_20250522InputSchema = lazySchema9(\n () => zodSchema9(\n z10.object({\n code: z10.string()\n })\n )\n);\nvar factory7 = createProviderToolFactoryWithOutputSchema6({\n id: \"anthropic.code_execution_20250522\",\n inputSchema: codeExecution_20250522InputSchema,\n outputSchema: codeExecution_20250522OutputSchema\n});\nvar codeExecution_20250522 = (args = {}) => {\n return factory7(args);\n};\n\n// src/tool/code-execution_20250825.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,\n lazySchema as lazySchema10,\n zodSchema as zodSchema10\n} from \"@ai-sdk/provider-utils\";\nimport { z as z11 } from \"zod/v4\";\nvar codeExecution_20250825OutputSchema = lazySchema10(\n () => zodSchema10(\n z11.discriminatedUnion(\"type\", [\n z11.object({\n type: z11.literal(\"code_execution_result\"),\n stdout: z11.string(),\n stderr: z11.string(),\n return_code: z11.number(),\n content: z11.array(\n z11.object({\n type: z11.literal(\"code_execution_output\"),\n file_id: z11.string()\n })\n ).optional().default([])\n }),\n z11.object({\n type: z11.literal(\"bash_code_execution_result\"),\n content: z11.array(\n z11.object({\n type: z11.literal(\"bash_code_execution_output\"),\n file_id: z11.string()\n })\n ),\n stdout: z11.string(),\n stderr: z11.string(),\n return_code: z11.number()\n }),\n z11.object({\n type: z11.literal(\"bash_code_execution_tool_result_error\"),\n error_code: z11.string()\n }),\n z11.object({\n type: z11.literal(\"text_editor_code_execution_tool_result_error\"),\n error_code: z11.string()\n }),\n z11.object({\n type: z11.literal(\"text_editor_code_execution_view_result\"),\n content: z11.string(),\n file_type: z11.string(),\n num_lines: z11.number().nullable(),\n start_line: z11.number().nullable(),\n total_lines: z11.number().nullable()\n }),\n z11.object({\n type: z11.literal(\"text_editor_code_execution_create_result\"),\n is_file_update: z11.boolean()\n }),\n z11.object({\n type: z11.literal(\"text_editor_code_execution_str_replace_result\"),\n lines: z11.array(z11.string()).nullable(),\n new_lines: z11.number().nullable(),\n new_start: z11.number().nullable(),\n old_lines: z11.number().nullable(),\n old_start: z11.number().nullable()\n })\n ])\n )\n);\nvar codeExecution_20250825InputSchema = lazySchema10(\n () => zodSchema10(\n z11.discriminatedUnion(\"type\", [\n // Programmatic tool calling format (mapped from { code } by AI SDK)\n z11.object({\n type: z11.literal(\"programmatic-tool-call\"),\n code: z11.string()\n }),\n z11.object({\n type: z11.literal(\"bash_code_execution\"),\n command: z11.string()\n }),\n z11.discriminatedUnion(\"command\", [\n z11.object({\n type: z11.literal(\"text_editor_code_execution\"),\n command: z11.literal(\"view\"),\n path: z11.string()\n }),\n z11.object({\n type: z11.literal(\"text_editor_code_execution\"),\n command: z11.literal(\"create\"),\n path: z11.string(),\n file_text: z11.string().nullish()\n }),\n z11.object({\n type: z11.literal(\"text_editor_code_execution\"),\n command: z11.literal(\"str_replace\"),\n path: z11.string(),\n old_str: z11.string(),\n new_str: z11.string()\n })\n ])\n ])\n )\n);\nvar factory8 = createProviderToolFactoryWithOutputSchema7({\n id: \"anthropic.code_execution_20250825\",\n inputSchema: codeExecution_20250825InputSchema,\n outputSchema: codeExecution_20250825OutputSchema,\n // Programmatic tool calling: tool results may be deferred to a later turn\n // when code execution triggers a client-executed tool that needs to be\n // resolved before the code execution result can be returned.\n supportsDeferredResults: true\n});\nvar codeExecution_20250825 = (args = {}) => {\n return factory8(args);\n};\n\n// src/tool/code-execution_20260120.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,\n lazySchema as lazySchema11,\n zodSchema as zodSchema11\n} from \"@ai-sdk/provider-utils\";\nimport { z as z12 } from \"zod/v4\";\nvar codeExecution_20260120OutputSchema = lazySchema11(\n () => zodSchema11(\n z12.discriminatedUnion(\"type\", [\n z12.object({\n type: z12.literal(\"code_execution_result\"),\n stdout: z12.string(),\n stderr: z12.string(),\n return_code: z12.number(),\n content: z12.array(\n z12.object({\n type: z12.literal(\"code_execution_output\"),\n file_id: z12.string()\n })\n ).optional().default([])\n }),\n z12.object({\n type: z12.literal(\"encrypted_code_execution_result\"),\n encrypted_stdout: z12.string(),\n stderr: z12.string(),\n return_code: z12.number(),\n content: z12.array(\n z12.object({\n type: z12.literal(\"code_execution_output\"),\n file_id: z12.string()\n })\n ).optional().default([])\n }),\n z12.object({\n type: z12.literal(\"bash_code_execution_result\"),\n content: z12.array(\n z12.object({\n type: z12.literal(\"bash_code_execution_output\"),\n file_id: z12.string()\n })\n ),\n stdout: z12.string(),\n stderr: z12.string(),\n return_code: z12.number()\n }),\n z12.object({\n type: z12.literal(\"bash_code_execution_tool_result_error\"),\n error_code: z12.string()\n }),\n z12.object({\n type: z12.literal(\"text_editor_code_execution_tool_result_error\"),\n error_code: z12.string()\n }),\n z12.object({\n type: z12.literal(\"text_editor_code_execution_view_result\"),\n content: z12.string(),\n file_type: z12.string(),\n num_lines: z12.number().nullable(),\n start_line: z12.number().nullable(),\n total_lines: z12.number().nullable()\n }),\n z12.object({\n type: z12.literal(\"text_editor_code_execution_create_result\"),\n is_file_update: z12.boolean()\n }),\n z12.object({\n type: z12.literal(\"text_editor_code_execution_str_replace_result\"),\n lines: z12.array(z12.string()).nullable(),\n new_lines: z12.number().nullable(),\n new_start: z12.number().nullable(),\n old_lines: z12.number().nullable(),\n old_start: z12.number().nullable()\n })\n ])\n )\n);\nvar codeExecution_20260120InputSchema = lazySchema11(\n () => zodSchema11(\n z12.discriminatedUnion(\"type\", [\n z12.object({\n type: z12.literal(\"programmatic-tool-call\"),\n code: z12.string()\n }),\n z12.object({\n type: z12.literal(\"bash_code_execution\"),\n command: z12.string()\n }),\n z12.discriminatedUnion(\"command\", [\n z12.object({\n type: z12.literal(\"text_editor_code_execution\"),\n command: z12.literal(\"view\"),\n path: z12.string()\n }),\n z12.object({\n type: z12.literal(\"text_editor_code_execution\"),\n command: z12.literal(\"create\"),\n path: z12.string(),\n file_text: z12.string().nullish()\n }),\n z12.object({\n type: z12.literal(\"text_editor_code_execution\"),\n command: z12.literal(\"str_replace\"),\n path: z12.string(),\n old_str: z12.string(),\n new_str: z12.string()\n })\n ])\n ])\n )\n);\nvar factory9 = createProviderToolFactoryWithOutputSchema8({\n id: \"anthropic.code_execution_20260120\",\n inputSchema: codeExecution_20260120InputSchema,\n outputSchema: codeExecution_20260120OutputSchema,\n supportsDeferredResults: true\n});\nvar codeExecution_20260120 = (args = {}) => {\n return factory9(args);\n};\n\n// src/tool/tool-search-regex_20251119.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,\n lazySchema as lazySchema12,\n zodSchema as zodSchema12\n} from \"@ai-sdk/provider-utils\";\nimport { z as z13 } from \"zod/v4\";\nvar toolSearchRegex_20251119OutputSchema = lazySchema12(\n () => zodSchema12(\n z13.array(\n z13.object({\n type: z13.literal(\"tool_reference\"),\n toolName: z13.string()\n })\n )\n )\n);\nvar toolSearchRegex_20251119InputSchema = lazySchema12(\n () => zodSchema12(\n z13.object({\n /**\n * A regex pattern to search for tools.\n * Uses Python re.search() syntax. Maximum 200 characters.\n *\n * Examples:\n * - \"weather\" - matches tool names/descriptions containing \"weather\"\n * - \"get_.*_data\" - matches tools like get_user_data, get_weather_data\n * - \"database.*query|query.*database\" - OR patterns for flexibility\n * - \"(?i)slack\" - case-insensitive search\n */\n pattern: z13.string(),\n /**\n * Maximum number of tools to return. Optional.\n */\n limit: z13.number().optional()\n })\n )\n);\nvar factory10 = createProviderToolFactoryWithOutputSchema9({\n id: \"anthropic.tool_search_regex_20251119\",\n inputSchema: toolSearchRegex_20251119InputSchema,\n outputSchema: toolSearchRegex_20251119OutputSchema,\n supportsDeferredResults: true\n});\nvar toolSearchRegex_20251119 = (args = {}) => {\n return factory10(args);\n};\n\n// src/convert-to-anthropic-messages-prompt.ts\nfunction convertToString(data) {\n if (typeof data === \"string\") {\n return new TextDecoder().decode(convertBase64ToUint8Array(data));\n }\n if (data instanceof Uint8Array) {\n return new TextDecoder().decode(data);\n }\n if (data instanceof URL) {\n throw new UnsupportedFunctionalityError2({\n functionality: \"URL-based text documents are not supported for citations\"\n });\n }\n throw new UnsupportedFunctionalityError2({\n functionality: `unsupported data type for text documents: ${typeof data}`\n });\n}\nfunction isUrlData(data) {\n return data instanceof URL || isUrlString(data);\n}\nfunction isUrlString(data) {\n return typeof data === \"string\" && /^https?:\\/\\//i.test(data);\n}\nfunction getUrlString(data) {\n return data instanceof URL ? data.toString() : data;\n}\nasync function extractErrorValue(value) {\n if (typeof value === \"string\") {\n const result = await safeParseJSON({ text: value });\n if (result.success && typeof result.value === \"object\" && result.value !== null) {\n return result.value;\n }\n return {\n errorCode: \"unavailable\"\n };\n }\n if (typeof value === \"object\" && value !== null) {\n return value;\n }\n return {};\n}\nasync function convertToAnthropicMessagesPrompt({\n prompt,\n sendReasoning,\n warnings,\n cacheControlValidator,\n toolNameMapping\n}) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;\n const betas = /* @__PURE__ */ new Set();\n const blocks = groupIntoBlocks(prompt);\n const validator = cacheControlValidator || new CacheControlValidator();\n let system = void 0;\n const messages = [];\n async function shouldEnableCitations(providerMetadata) {\n var _a2, _b2;\n const anthropicOptions = await parseProviderOptions({\n provider: \"anthropic\",\n providerOptions: providerMetadata,\n schema: anthropicFilePartProviderOptions\n });\n return (_b2 = (_a2 = anthropicOptions == null ? void 0 : anthropicOptions.citations) == null ? void 0 : _a2.enabled) != null ? _b2 : false;\n }\n async function getDocumentMetadata(providerMetadata) {\n const anthropicOptions = await parseProviderOptions({\n provider: \"anthropic\",\n providerOptions: providerMetadata,\n schema: anthropicFilePartProviderOptions\n });\n return {\n title: anthropicOptions == null ? void 0 : anthropicOptions.title,\n context: anthropicOptions == null ? void 0 : anthropicOptions.context\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 switch (type) {\n case \"system\": {\n const content = block.messages.map(({ content: content2, providerOptions }) => ({\n type: \"text\",\n text: content2,\n cache_control: validator.getCacheControl(providerOptions, {\n type: \"system message\",\n canCache: true\n })\n }));\n if (system == null) {\n system = content;\n } else {\n messages.push({ role: \"system\", content });\n betas.add(\"mid-conversation-system-2026-04-07\");\n }\n break;\n }\n case \"user\": {\n const anthropicContent = [];\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 const isLastPart = j === content.length - 1;\n const cacheControl = (_a = validator.getCacheControl(part.providerOptions, {\n type: \"user message part\",\n canCache: true\n })) != null ? _a : isLastPart ? validator.getCacheControl(message.providerOptions, {\n type: \"user message\",\n canCache: true\n }) : void 0;\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 case \"file\": {\n if (part.mediaType.startsWith(\"image/\")) {\n anthropicContent.push({\n type: \"image\",\n source: isUrlData(part.data) ? {\n type: \"url\",\n url: getUrlString(part.data)\n } : {\n type: \"base64\",\n media_type: part.mediaType === \"image/*\" ? \"image/jpeg\" : 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 const enableCitations = await shouldEnableCitations(\n part.providerOptions\n );\n const metadata = await getDocumentMetadata(\n part.providerOptions\n );\n anthropicContent.push({\n type: \"document\",\n source: isUrlData(part.data) ? {\n type: \"url\",\n url: getUrlString(part.data)\n } : {\n type: \"base64\",\n media_type: \"application/pdf\",\n data: convertToBase64(part.data)\n },\n title: (_b = metadata.title) != null ? _b : 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 const metadata = await getDocumentMetadata(\n part.providerOptions\n );\n anthropicContent.push({\n type: \"document\",\n source: isUrlData(part.data) ? {\n type: \"url\",\n url: getUrlString(part.data)\n } : {\n type: \"text\",\n media_type: \"text/plain\",\n data: convertToString(part.data)\n },\n title: (_c = metadata.title) != null ? _c : 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 UnsupportedFunctionalityError2({\n functionality: `media type: ${part.mediaType}`\n });\n }\n break;\n }\n }\n }\n break;\n }\n case \"tool\": {\n for (let i2 = 0; i2 < content.length; i2++) {\n const part = content[i2];\n if (part.type === \"tool-approval-response\") {\n continue;\n }\n const output = part.output;\n const outputProviderOptions = \"providerOptions\" in output ? output.providerOptions : output.type === \"content\" ? (_d = output.value.find(\n (contentPart) => contentPart.providerOptions != null\n )) == null ? void 0 : _d.providerOptions : void 0;\n const isLastPart = i2 === content.length - 1;\n const cacheControl = (_f = (_e = validator.getCacheControl(part.providerOptions, {\n type: \"tool result part\",\n canCache: true\n })) != null ? _e : validator.getCacheControl(outputProviderOptions, {\n type: \"tool result output\",\n canCache: true\n })) != null ? _f : isLastPart ? validator.getCacheControl(message.providerOptions, {\n type: \"tool result message\",\n canCache: true\n }) : void 0;\n let contentValue;\n switch (output.type) {\n case \"content\":\n contentValue = output.value.map((contentPart) => {\n var _a2;\n switch (contentPart.type) {\n case \"text\":\n return {\n type: \"text\",\n text: contentPart.text\n };\n case \"image-data\": {\n return {\n type: \"image\",\n source: {\n type: \"base64\",\n media_type: contentPart.mediaType,\n data: contentPart.data\n }\n };\n }\n case \"image-url\": {\n return {\n type: \"image\",\n source: {\n type: \"url\",\n url: contentPart.url\n }\n };\n }\n case \"file-url\": {\n return {\n type: \"document\",\n source: {\n type: \"url\",\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\",\n source: {\n type: \"base64\",\n media_type: contentPart.mediaType,\n data: contentPart.data\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 return void 0;\n }\n case \"custom\": {\n const anthropicOptions = (_a2 = contentPart.providerOptions) == null ? void 0 : _a2.anthropic;\n if ((anthropicOptions == null ? void 0 : anthropicOptions.type) === \"tool-reference\") {\n return {\n type: \"tool_reference\",\n tool_name: anthropicOptions.toolName\n };\n }\n warnings.push({\n type: \"other\",\n message: `unsupported custom tool content part`\n });\n return void 0;\n }\n default: {\n warnings.push({\n type: \"other\",\n message: `unsupported tool content part type: ${contentPart.type}`\n });\n return void 0;\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 = (_g = output.reason) != null ? _g : \"Tool execution denied.\";\n break;\n case \"json\":\n case \"error-json\":\n default:\n contentValue = JSON.stringify(output.value);\n break;\n }\n anthropicContent.push({\n type: \"tool_result\",\n tool_use_id: part.toolCallId,\n content: contentValue,\n is_error: output.type === \"error-text\" || output.type === \"error-json\" ? true : void 0,\n cache_control: cacheControl\n });\n }\n break;\n }\n default: {\n const _exhaustiveCheck = role;\n throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n }\n }\n }\n messages.push({ role: \"user\", content: anthropicContent });\n break;\n }\n case \"assistant\": {\n const anthropicContent = [];\n const mcpToolUseIds = /* @__PURE__ */ new Set();\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 for (let k = 0; k < content.length; k++) {\n const part = content[k];\n const isLastContentPart = k === content.length - 1;\n const cacheControl = (_h = validator.getCacheControl(part.providerOptions, {\n type: \"assistant message part\",\n canCache: true\n })) != null ? _h : isLastContentPart ? validator.getCacheControl(message.providerOptions, {\n type: \"assistant message\",\n canCache: true\n }) : void 0;\n switch (part.type) {\n case \"text\": {\n const textMetadata = (_i = part.providerOptions) == null ? void 0 : _i.anthropic;\n if ((textMetadata == null ? void 0 : textMetadata.type) === \"compaction\") {\n anthropicContent.push({\n type: \"compaction\",\n content: part.text,\n cache_control: cacheControl\n });\n } else {\n anthropicContent.push({\n type: \"text\",\n text: (\n // trim the last text part if it's the last message in the block\n // because Anthropic does not allow trailing whitespace\n // in pre-filled assistant responses\n isLastBlock && isLastMessage && isLastContentPart ? part.text.trim() : part.text\n ),\n cache_control: cacheControl\n });\n }\n break;\n }\n case \"reasoning\": {\n if (sendReasoning) {\n const reasoningMetadata = await parseProviderOptions({\n provider: \"anthropic\",\n providerOptions: part.providerOptions,\n schema: anthropicReasoningMetadataSchema\n });\n if (reasoningMetadata != null) {\n if (reasoningMetadata.signature != null) {\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 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: \"sending reasoning content is disabled for this model\"\n });\n }\n break;\n }\n case \"tool-call\": {\n if (part.providerExecuted) {\n const providerToolName = toolNameMapping.toProviderToolName(\n part.toolName\n );\n const isMcpToolUse = ((_k = (_j = part.providerOptions) == null ? void 0 : _j.anthropic) == null ? void 0 : _k.type) === \"mcp-tool-use\";\n if (isMcpToolUse) {\n mcpToolUseIds.add(part.toolCallId);\n const serverName = (_m = (_l = part.providerOptions) == null ? void 0 : _l.anthropic) == null ? void 0 : _m.serverName;\n if (serverName == null || typeof serverName !== \"string\") {\n warnings.push({\n type: \"other\",\n message: \"mcp tool use server name is required and must be a string\"\n });\n break;\n }\n anthropicContent.push({\n type: \"mcp_tool_use\",\n id: part.toolCallId,\n name: part.toolName,\n input: part.input,\n server_name: serverName,\n cache_control: cacheControl\n });\n } else if (\n // code execution 20250825:\n providerToolName === \"code_execution\" && part.input != null && typeof part.input === \"object\" && \"type\" in part.input && typeof part.input.type === \"string\" && (part.input.type === \"bash_code_execution\" || 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,\n // map back to subtool name\n input: part.input,\n cache_control: cacheControl\n });\n } else if (\n // code execution 20250825 programmatic tool calling:\n // Strip the fake 'programmatic-tool-call' type before sending to Anthropic\n providerToolName === \"code_execution\" && part.input != null && typeof part.input === \"object\" && \"type\" in part.input && part.input.type === \"programmatic-tool-call\"\n ) {\n const { type: _, ...inputWithoutType } = part.input;\n anthropicContent.push({\n type: \"server_tool_use\",\n id: part.toolCallId,\n name: \"code_execution\",\n input: inputWithoutType,\n cache_control: cacheControl\n });\n } else {\n if (providerToolName === \"code_execution\" || // code execution 20250522\n providerToolName === \"web_fetch\" || providerToolName === \"web_search\") {\n anthropicContent.push({\n type: \"server_tool_use\",\n id: part.toolCallId,\n name: providerToolName,\n input: part.input,\n cache_control: cacheControl\n });\n } else if (providerToolName === \"tool_search_tool_regex\" || providerToolName === \"tool_search_tool_bm25\") {\n anthropicContent.push({\n type: \"server_tool_use\",\n id: part.toolCallId,\n name: providerToolName,\n input: part.input,\n cache_control: cacheControl\n });\n } else if (providerToolName === \"advisor\") {\n anthropicContent.push({\n type: \"server_tool_use\",\n id: part.toolCallId,\n name: \"advisor\",\n input: {},\n cache_control: cacheControl\n });\n } else {\n warnings.push({\n type: \"other\",\n message: `provider executed tool call for tool ${part.toolName} is not supported`\n });\n }\n }\n break;\n }\n const callerOptions = (_n = part.providerOptions) == null ? void 0 : _n.anthropic;\n const caller = (callerOptions == null ? void 0 : callerOptions.caller) ? (callerOptions.caller.type === \"code_execution_20250825\" || callerOptions.caller.type === \"code_execution_20260120\") && callerOptions.caller.toolId ? {\n type: callerOptions.caller.type,\n tool_id: callerOptions.caller.toolId\n } : callerOptions.caller.type === \"direct\" ? { type: \"direct\" } : void 0 : void 0;\n anthropicContent.push({\n type: \"tool_use\",\n id: part.toolCallId,\n name: part.toolName,\n input: part.input,\n ...caller && { caller },\n cache_control: cacheControl\n });\n break;\n }\n case \"tool-result\": {\n const providerToolName = toolNameMapping.toProviderToolName(\n part.toolName\n );\n if (mcpToolUseIds.has(part.toolCallId)) {\n const output = part.output;\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 break;\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,\n cache_control: cacheControl\n });\n } else if (providerToolName === \"code_execution\") {\n const output = part.output;\n if (output.type === \"error-text\" || output.type === \"error-json\") {\n let errorInfo = {};\n try {\n if (typeof output.value === \"string\") {\n errorInfo = JSON.parse(output.value);\n } else if (typeof output.value === \"object\" && output.value !== null) {\n errorInfo = output.value;\n }\n } catch (e) {\n }\n if (errorInfo.type === \"code_execution_tool_result_error\") {\n anthropicContent.push({\n type: \"code_execution_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: \"code_execution_tool_result_error\",\n error_code: (_o = errorInfo.errorCode) != null ? _o : \"unknown\"\n },\n cache_control: cacheControl\n });\n } else {\n anthropicContent.push({\n type: \"bash_code_execution_tool_result\",\n tool_use_id: part.toolCallId,\n cache_control: cacheControl,\n content: {\n type: \"bash_code_execution_tool_result_error\",\n error_code: (_p = errorInfo.errorCode) != null ? _p : \"unknown\"\n }\n });\n }\n break;\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 break;\n }\n if (output.value == null || typeof output.value !== \"object\" || !(\"type\" in output.value) || typeof output.value.type !== \"string\") {\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 if (output.value.type === \"code_execution_result\") {\n const codeExecutionOutput = await validateTypes2({\n value: output.value,\n schema: codeExecution_20250522OutputSchema\n });\n anthropicContent.push({\n type: \"code_execution_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: codeExecutionOutput.type,\n stdout: codeExecutionOutput.stdout,\n stderr: codeExecutionOutput.stderr,\n return_code: codeExecutionOutput.return_code,\n content: (_q = codeExecutionOutput.content) != null ? _q : []\n },\n cache_control: cacheControl\n });\n } else if (output.value.type === \"encrypted_code_execution_result\") {\n const codeExecutionOutput = await validateTypes2({\n value: output.value,\n schema: codeExecution_20260120OutputSchema\n });\n if (codeExecutionOutput.type === \"encrypted_code_execution_result\") {\n anthropicContent.push({\n type: \"code_execution_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: codeExecutionOutput.type,\n encrypted_stdout: codeExecutionOutput.encrypted_stdout,\n stderr: codeExecutionOutput.stderr,\n return_code: codeExecutionOutput.return_code,\n content: (_r = codeExecutionOutput.content) != null ? _r : []\n },\n cache_control: cacheControl\n });\n }\n } else {\n const codeExecutionOutput = await validateTypes2({\n value: output.value,\n schema: codeExecution_20250825OutputSchema\n });\n if (codeExecutionOutput.type === \"code_execution_result\") {\n anthropicContent.push({\n type: \"code_execution_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: codeExecutionOutput.type,\n stdout: codeExecutionOutput.stdout,\n stderr: codeExecutionOutput.stderr,\n return_code: codeExecutionOutput.return_code,\n content: (_s = codeExecutionOutput.content) != null ? _s : []\n },\n cache_control: cacheControl\n });\n } else if (codeExecutionOutput.type === \"bash_code_execution_result\" || codeExecutionOutput.type === \"bash_code_execution_tool_result_error\") {\n anthropicContent.push({\n type: \"bash_code_execution_tool_result\",\n tool_use_id: part.toolCallId,\n cache_control: cacheControl,\n content: codeExecutionOutput\n });\n } else {\n anthropicContent.push({\n type: \"text_editor_code_execution_tool_result\",\n tool_use_id: part.toolCallId,\n cache_control: cacheControl,\n content: codeExecutionOutput\n });\n }\n }\n break;\n }\n if (providerToolName === \"web_fetch\") {\n const output = part.output;\n if (output.type === \"error-json\") {\n anthropicContent.push({\n type: \"web_fetch_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: \"web_fetch_tool_result_error\",\n error_code: (_t = (await extractErrorValue(output.value)).errorCode) != null ? _t : \"unavailable\"\n },\n cache_control: cacheControl\n });\n break;\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 break;\n }\n const webFetchOutput = await validateTypes2({\n value: output.value,\n schema: webFetch_20250910OutputSchema\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 }\n }\n },\n cache_control: cacheControl\n });\n break;\n }\n if (providerToolName === \"web_search\") {\n const output = part.output;\n if (output.type === \"error-json\") {\n anthropicContent.push({\n type: \"web_search_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: \"web_search_tool_result_error\",\n error_code: (_u = (await extractErrorValue(output.value)).errorCode) != null ? _u : \"unavailable\"\n },\n cache_control: cacheControl\n });\n break;\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 break;\n }\n const webSearchOutput = await validateTypes2({\n value: output.value,\n schema: webSearch_20250305OutputSchema\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 break;\n }\n if (providerToolName === \"tool_search_tool_regex\" || providerToolName === \"tool_search_tool_bm25\") {\n const output = part.output;\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 break;\n }\n const toolSearchOutput = await validateTypes2({\n value: output.value,\n schema: toolSearchRegex_20251119OutputSchema\n });\n const toolReferences = toolSearchOutput.map((ref) => ({\n type: \"tool_reference\",\n tool_name: ref.toolName\n }));\n anthropicContent.push({\n type: \"tool_search_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: \"tool_search_tool_search_result\",\n tool_references: toolReferences\n },\n cache_control: cacheControl\n });\n break;\n }\n if (providerToolName === \"advisor\") {\n const output = part.output;\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 break;\n }\n const advisorOutput = await validateTypes2({\n value: output.value,\n schema: advisor_20260301OutputSchema\n });\n if (advisorOutput.type === \"advisor_result\") {\n anthropicContent.push({\n type: \"advisor_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: \"advisor_result\",\n text: advisorOutput.text\n },\n cache_control: cacheControl\n });\n } else if (advisorOutput.type === \"advisor_redacted_result\") {\n anthropicContent.push({\n type: \"advisor_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: \"advisor_redacted_result\",\n encrypted_content: advisorOutput.encryptedContent\n },\n cache_control: cacheControl\n });\n } else {\n anthropicContent.push({\n type: \"advisor_tool_result\",\n tool_use_id: part.toolCallId,\n content: {\n type: \"advisor_tool_result_error\",\n error_code: advisorOutput.errorCode\n },\n cache_control: cacheControl\n });\n }\n break;\n }\n warnings.push({\n type: \"other\",\n message: `provider executed tool result for tool ${part.toolName} is not supported`\n });\n break;\n }\n }\n }\n }\n messages.push({ role: \"assistant\", content: anthropicContent });\n break;\n }\n default: {\n const _exhaustiveCheck = type;\n throw new Error(`content type: ${_exhaustiveCheck}`);\n }\n }\n }\n return {\n prompt: { system, messages },\n betas\n };\n}\nfunction groupIntoBlocks(prompt) {\n const blocks = [];\n let currentBlock = void 0;\n for (const message of prompt) {\n const { role } = message;\n switch (role) {\n case \"system\": {\n if ((currentBlock == null ? void 0 : currentBlock.type) !== \"system\") {\n currentBlock = { type: \"system\", messages: [] };\n blocks.push(currentBlock);\n }\n currentBlock.messages.push(message);\n break;\n }\n case \"assistant\": {\n if ((currentBlock == null ? void 0 : currentBlock.type) !== \"assistant\") {\n currentBlock = { type: \"assistant\", messages: [] };\n blocks.push(currentBlock);\n }\n currentBlock.messages.push(message);\n break;\n }\n case \"user\": {\n if ((currentBlock == null ? void 0 : currentBlock.type) !== \"user\") {\n currentBlock = { type: \"user\", messages: [] };\n blocks.push(currentBlock);\n }\n currentBlock.messages.push(message);\n break;\n }\n case \"tool\": {\n if ((currentBlock == null ? void 0 : currentBlock.type) !== \"user\") {\n currentBlock = { type: \"user\", messages: [] };\n blocks.push(currentBlock);\n }\n currentBlock.messages.push(message);\n break;\n }\n default: {\n const _exhaustiveCheck = role;\n throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n }\n }\n }\n return blocks;\n}\n\n// src/map-anthropic-stop-reason.ts\nfunction mapAnthropicStopReason({\n finishReason,\n isJsonResponseFromTool\n}) {\n switch (finishReason) {\n case \"pause_turn\":\n case \"end_turn\":\n case \"stop_sequence\":\n return \"stop\";\n case \"refusal\":\n return \"content-filter\";\n case \"tool_use\":\n return isJsonResponseFromTool ? \"stop\" : \"tool-calls\";\n case \"max_tokens\":\n case \"model_context_window_exceeded\":\n return \"length\";\n case \"compaction\":\n return \"other\";\n default:\n return \"other\";\n }\n}\n\n// src/sanitize-json-schema.ts\nvar SUPPORTED_STRING_FORMATS = /* @__PURE__ */ new Set([\n \"date-time\",\n \"time\",\n \"date\",\n \"duration\",\n \"email\",\n \"hostname\",\n \"uri\",\n \"ipv4\",\n \"ipv6\",\n \"uuid\"\n]);\nvar DESCRIPTION_CONSTRAINT_KEYS = [\n \"minimum\",\n \"maximum\",\n \"exclusiveMinimum\",\n \"exclusiveMaximum\",\n \"multipleOf\",\n \"minLength\",\n \"maxLength\",\n \"pattern\",\n \"minItems\",\n \"maxItems\",\n \"uniqueItems\",\n \"minProperties\",\n \"maxProperties\",\n \"not\"\n];\nfunction sanitizeJsonSchema(schema) {\n return sanitizeSchema(schema);\n}\nfunction sanitizeDefinition(definition) {\n if (typeof definition === \"boolean\" || !isPlainObject(definition)) {\n return definition;\n }\n return sanitizeSchema(definition);\n}\nfunction sanitizeSchema(schema) {\n const result = {};\n const schemaWithDefs = schema;\n if (schema.$ref != null) {\n return { $ref: schema.$ref };\n }\n if (schema.$schema != null) {\n result.$schema = schema.$schema;\n }\n if (schema.$id != null) {\n result.$id = schema.$id;\n }\n if (schema.title != null) {\n result.title = schema.title;\n }\n if (schema.description != null) {\n result.description = schema.description;\n }\n if (schema.default !== void 0) {\n result.default = schema.default;\n }\n if (schema.const !== void 0) {\n result.const = schema.const;\n }\n if (schema.enum != null) {\n result.enum = schema.enum;\n }\n if (schema.type != null) {\n result.type = schema.type;\n }\n if (schema.anyOf != null) {\n result.anyOf = schema.anyOf.map(sanitizeDefinition);\n } else if (schema.oneOf != null) {\n result.anyOf = schema.oneOf.map(sanitizeDefinition);\n }\n if (schema.allOf != null) {\n result.allOf = schema.allOf.map(sanitizeDefinition);\n }\n if (schema.definitions != null) {\n result.definitions = Object.fromEntries(\n Object.entries(schema.definitions).map(([name, definition]) => [\n name,\n sanitizeDefinition(definition)\n ])\n );\n }\n if (schemaWithDefs.$defs != null) {\n const resultWithDefs = result;\n resultWithDefs.$defs = Object.fromEntries(\n Object.entries(schemaWithDefs.$defs).map(([name, definition]) => [\n name,\n sanitizeDefinition(definition)\n ])\n );\n }\n if (schema.type === \"object\" || schema.properties != null) {\n if (schema.properties != null) {\n result.properties = Object.fromEntries(\n Object.entries(schema.properties).map(([name, definition]) => [\n name,\n sanitizeDefinition(definition)\n ])\n );\n }\n result.additionalProperties = false;\n if (schema.required != null) {\n result.required = schema.required;\n }\n }\n if (schema.items != null) {\n result.items = Array.isArray(schema.items) ? schema.items.map(sanitizeDefinition) : sanitizeDefinition(schema.items);\n }\n if (typeof schema.format === \"string\" && SUPPORTED_STRING_FORMATS.has(schema.format)) {\n result.format = schema.format;\n }\n const constraintDescription = getConstraintDescription(schema);\n if (constraintDescription != null) {\n result.description = result.description == null ? constraintDescription : `${result.description}\n${constraintDescription}`;\n }\n return result;\n}\nfunction getConstraintDescription(schema) {\n const descriptions = DESCRIPTION_CONSTRAINT_KEYS.flatMap((key) => {\n const value = schema[key];\n if (value == null || value === false) {\n return [];\n }\n return `${formatConstraintName(key)}: ${formatConstraintValue(value)}`;\n });\n if (typeof schema.format === \"string\" && !SUPPORTED_STRING_FORMATS.has(schema.format)) {\n descriptions.push(`format: ${schema.format}`);\n }\n return descriptions.length === 0 ? void 0 : `${descriptions.join(\"; \")}.`;\n}\nfunction formatConstraintName(key) {\n return key.replace(/[A-Z]/g, (match) => ` ${match.toLowerCase()}`);\n}\nfunction formatConstraintValue(value) {\n if (typeof value === \"string\") {\n return value;\n }\n return JSON.stringify(value);\n}\nfunction isPlainObject(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// src/anthropic-messages-language-model.ts\nfunction createCitationSource(citation, citationDocuments, generateId2) {\n var _a;\n if (citation.type === \"web_search_result_location\") {\n return {\n type: \"source\",\n sourceType: \"url\",\n id: generateId2(),\n url: citation.url,\n title: citation.title,\n providerMetadata: {\n anthropic: {\n citedText: citation.cited_text,\n encryptedIndex: citation.encrypted_index\n }\n }\n };\n }\n if (citation.type !== \"page_location\" && citation.type !== \"char_location\") {\n return;\n }\n const documentInfo = citationDocuments[citation.document_index];\n if (!documentInfo) {\n return;\n }\n return {\n type: \"source\",\n sourceType: \"document\",\n id: generateId2(),\n mediaType: documentInfo.mediaType,\n title: (_a = citation.document_title) != null ? _a : documentInfo.title,\n filename: documentInfo.filename,\n providerMetadata: {\n anthropic: citation.type === \"page_location\" ? {\n citedText: citation.cited_text,\n startPageNumber: citation.start_page_number,\n endPageNumber: citation.end_page_number\n } : {\n citedText: citation.cited_text,\n startCharIndex: citation.start_char_index,\n endCharIndex: citation.end_char_index\n }\n }\n };\n}\nvar AnthropicMessagesLanguageModel = class {\n constructor(modelId, config) {\n this.specificationVersion = \"v3\";\n var _a;\n this.modelId = modelId;\n this.config = config;\n this.generateId = (_a = config.generateId) != null ? _a : generateId;\n }\n supportsUrl(url) {\n return url.protocol === \"https:\";\n }\n get provider() {\n return this.config.provider;\n }\n /**\n * Extracts the dynamic provider name from the config.provider string.\n * e.g., 'my-custom-anthropic.messages' -> 'my-custom-anthropic'\n */\n get providerOptionsName() {\n const provider = this.config.provider;\n const dotIndex = provider.indexOf(\".\");\n return dotIndex === -1 ? provider : provider.substring(0, dotIndex);\n }\n get supportedUrls() {\n var _a, _b, _c;\n return (_c = (_b = (_a = this.config).supportedUrls) == null ? void 0 : _b.call(_a)) != null ? _c : {};\n }\n async getArgs({\n userSuppliedBetas,\n prompt,\n maxOutputTokens,\n temperature,\n topP,\n topK,\n frequencyPenalty,\n presencePenalty,\n stopSequences,\n responseFormat,\n seed,\n tools,\n toolChoice,\n providerOptions,\n stream\n }) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;\n const warnings = [];\n if (frequencyPenalty != null) {\n warnings.push({ type: \"unsupported\", feature: \"frequencyPenalty\" });\n }\n if (presencePenalty != null) {\n warnings.push({ type: \"unsupported\", feature: \"presencePenalty\" });\n }\n if (seed != null) {\n warnings.push({ type: \"unsupported\", feature: \"seed\" });\n }\n if (temperature != null && temperature > 1) {\n warnings.push({\n type: \"unsupported\",\n feature: \"temperature\",\n details: `${temperature} exceeds anthropic maximum of 1.0. clamped to 1.0`\n });\n temperature = 1;\n } else if (temperature != null && temperature < 0) {\n warnings.push({\n type: \"unsupported\",\n feature: \"temperature\",\n details: `${temperature} is below anthropic minimum of 0. clamped to 0`\n });\n temperature = 0;\n }\n if ((responseFormat == null ? void 0 : responseFormat.type) === \"json\") {\n if (responseFormat.schema == null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"responseFormat\",\n details: \"JSON response format requires a schema. The response format is ignored.\"\n });\n }\n }\n const providerOptionsName = this.providerOptionsName;\n const canonicalOptions = await parseProviderOptions2({\n provider: \"anthropic\",\n providerOptions,\n schema: anthropicLanguageModelOptions\n });\n const customProviderOptions = providerOptionsName !== \"anthropic\" ? await parseProviderOptions2({\n provider: providerOptionsName,\n providerOptions,\n schema: anthropicLanguageModelOptions\n }) : null;\n const usedCustomProviderKey = customProviderOptions != null;\n const anthropicOptions = Object.assign(\n {},\n canonicalOptions != null ? canonicalOptions : {},\n customProviderOptions != null ? customProviderOptions : {}\n );\n const {\n maxOutputTokens: maxOutputTokensForModel,\n supportsStructuredOutput: modelSupportsStructuredOutput,\n rejectsSamplingParameters,\n isKnownModel\n } = getModelCapabilities(this.modelId);\n if (rejectsSamplingParameters) {\n if (temperature != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"temperature\",\n details: `temperature is not supported by ${this.modelId} and will be ignored`\n });\n temperature = void 0;\n }\n if (topK != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"topK\",\n details: `topK is not supported by ${this.modelId} and will be ignored`\n });\n topK = void 0;\n }\n if (topP != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"topP\",\n details: `topP is not supported by ${this.modelId} and will be ignored`\n });\n topP = void 0;\n }\n }\n const isAnthropicModel = isKnownModel || this.modelId.startsWith(\"claude-\");\n const supportsStructuredOutput = ((_a = this.config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;\n const supportsStrictTools = ((_b = this.config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;\n const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : \"auto\";\n const useStructuredOutput = structureOutputMode === \"outputFormat\" || structureOutputMode === \"auto\" && supportsStructuredOutput;\n const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null && !useStructuredOutput ? {\n type: \"function\",\n name: \"json\",\n description: \"Respond with a JSON object.\",\n inputSchema: responseFormat.schema\n } : void 0;\n const contextManagement = anthropicOptions == null ? void 0 : anthropicOptions.contextManagement;\n const cacheControlValidator = new CacheControlValidator();\n const toolNameMapping = createToolNameMapping({\n tools,\n providerToolNames: {\n \"anthropic.code_execution_20250522\": \"code_execution\",\n \"anthropic.code_execution_20250825\": \"code_execution\",\n \"anthropic.code_execution_20260120\": \"code_execution\",\n \"anthropic.computer_20241022\": \"computer\",\n \"anthropic.computer_20250124\": \"computer\",\n \"anthropic.text_editor_20241022\": \"str_replace_editor\",\n \"anthropic.text_editor_20250124\": \"str_replace_editor\",\n \"anthropic.text_editor_20250429\": \"str_replace_based_edit_tool\",\n \"anthropic.text_editor_20250728\": \"str_replace_based_edit_tool\",\n \"anthropic.bash_20241022\": \"bash\",\n \"anthropic.bash_20250124\": \"bash\",\n \"anthropic.memory_20250818\": \"memory\",\n \"anthropic.web_search_20250305\": \"web_search\",\n \"anthropic.web_search_20260209\": \"web_search\",\n \"anthropic.web_fetch_20250910\": \"web_fetch\",\n \"anthropic.web_fetch_20260209\": \"web_fetch\",\n \"anthropic.tool_search_regex_20251119\": \"tool_search_tool_regex\",\n \"anthropic.tool_search_bm25_20251119\": \"tool_search_tool_bm25\",\n \"anthropic.advisor_20260301\": \"advisor\"\n }\n });\n const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({\n prompt,\n sendReasoning: (_d = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _d : true,\n warnings,\n cacheControlValidator,\n toolNameMapping\n });\n const thinkingType = (_e = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _e.type;\n const isThinking = thinkingType === \"enabled\" || thinkingType === \"adaptive\";\n let thinkingBudget = thinkingType === \"enabled\" ? (_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.budgetTokens : void 0;\n const thinkingDisplay = thinkingType === \"adaptive\" ? (_g = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _g.display : void 0;\n const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;\n const baseArgs = {\n // model id:\n model: this.modelId,\n // standardized settings:\n max_tokens: maxTokens,\n temperature,\n top_k: topK,\n top_p: topP,\n stop_sequences: stopSequences,\n // provider specific settings:\n ...isThinking && {\n thinking: {\n type: thinkingType,\n ...thinkingBudget != null && { budget_tokens: thinkingBudget },\n ...thinkingDisplay != null && { display: thinkingDisplay }\n }\n },\n ...((anthropicOptions == null ? void 0 : anthropicOptions.effort) || (anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) || useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null) && {\n output_config: {\n ...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {\n effort: anthropicOptions.effort\n },\n ...(anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) && {\n task_budget: {\n type: anthropicOptions.taskBudget.type,\n total: anthropicOptions.taskBudget.total,\n ...anthropicOptions.taskBudget.remaining != null && {\n remaining: anthropicOptions.taskBudget.remaining\n }\n }\n },\n ...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null && {\n format: {\n type: \"json_schema\",\n schema: sanitizeJsonSchema(responseFormat.schema)\n }\n }\n }\n },\n ...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {\n speed: anthropicOptions.speed\n },\n ...(anthropicOptions == null ? void 0 : anthropicOptions.inferenceGeo) && {\n inference_geo: anthropicOptions.inferenceGeo\n },\n ...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {\n cache_control: anthropicOptions.cacheControl\n },\n ...((_h = anthropicOptions == null ? void 0 : anthropicOptions.metadata) == null ? void 0 : _h.userId) != null && {\n metadata: { user_id: anthropicOptions.metadata.userId }\n },\n // mcp servers:\n ...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && 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 allowed_tools: server.toolConfiguration.allowedTools,\n enabled: server.toolConfiguration.enabled\n } : void 0\n }))\n },\n // container: For programmatic tool calling (just an ID string) or agent skills (object with id and skills)\n ...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {\n container: anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0 ? (\n // Object format when skills are provided (agent skills feature)\n {\n id: anthropicOptions.container.id,\n skills: anthropicOptions.container.skills.map((skill) => ({\n type: skill.type,\n skill_id: skill.skillId,\n version: skill.version\n }))\n }\n ) : (\n // String format for container ID only (programmatic tool calling)\n anthropicOptions.container.id\n )\n },\n // prompt:\n system: messagesPrompt.system,\n messages: messagesPrompt.messages,\n ...contextManagement && {\n context_management: {\n edits: contextManagement.edits.map((edit) => {\n const strategy = edit.type;\n switch (strategy) {\n case \"clear_tool_uses_20250919\":\n return {\n type: edit.type,\n ...edit.trigger !== void 0 && {\n trigger: edit.trigger\n },\n ...edit.keep !== void 0 && { keep: edit.keep },\n ...edit.clearAtLeast !== void 0 && {\n clear_at_least: edit.clearAtLeast\n },\n ...edit.clearToolInputs !== void 0 && {\n clear_tool_inputs: edit.clearToolInputs\n },\n ...edit.excludeTools !== void 0 && {\n exclude_tools: edit.excludeTools\n }\n };\n case \"clear_thinking_20251015\":\n return {\n type: edit.type,\n ...edit.keep !== void 0 && { keep: edit.keep }\n };\n case \"compact_20260112\":\n return {\n type: edit.type,\n ...edit.trigger !== void 0 && {\n trigger: edit.trigger\n },\n ...edit.pauseAfterCompaction !== void 0 && {\n pause_after_compaction: edit.pauseAfterCompaction\n },\n ...edit.instructions !== void 0 && {\n instructions: edit.instructions\n }\n };\n default:\n warnings.push({\n type: \"other\",\n message: `Unknown context management strategy: ${strategy}`\n });\n return void 0;\n }\n }).filter((edit) => edit !== void 0)\n }\n }\n };\n if (isThinking) {\n if (thinkingType === \"enabled\" && thinkingBudget == null) {\n warnings.push({\n type: \"compatibility\",\n feature: \"extended thinking\",\n details: \"thinking budget is required when thinking is enabled. using default budget of 1024 tokens.\"\n });\n baseArgs.thinking = {\n type: \"enabled\",\n budget_tokens: 1024\n };\n thinkingBudget = 1024;\n }\n if (baseArgs.temperature != null) {\n baseArgs.temperature = void 0;\n warnings.push({\n type: \"unsupported\",\n feature: \"temperature\",\n details: \"temperature is not supported when thinking is enabled\"\n });\n }\n if (topK != null) {\n baseArgs.top_k = void 0;\n warnings.push({\n type: \"unsupported\",\n feature: \"topK\",\n details: \"topK is not supported when thinking is enabled\"\n });\n }\n if (topP != null) {\n baseArgs.top_p = void 0;\n warnings.push({\n type: \"unsupported\",\n feature: \"topP\",\n details: \"topP is not supported when thinking is enabled\"\n });\n }\n baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0);\n } else {\n if (isAnthropicModel && topP != null && temperature != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"topP\",\n details: `topP is not supported when temperature is set. topP is ignored.`\n });\n baseArgs.top_p = void 0;\n }\n }\n if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) {\n if (maxOutputTokens != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"maxOutputTokens\",\n details: `${baseArgs.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${maxOutputTokensForModel} max output tokens. The max output tokens have been limited to ${maxOutputTokensForModel}.`\n });\n }\n baseArgs.max_tokens = maxOutputTokensForModel;\n }\n if ((anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0) {\n betas.add(\"mcp-client-2025-04-04\");\n }\n if (contextManagement) {\n betas.add(\"context-management-2025-06-27\");\n if (contextManagement.edits.some((e) => e.type === \"compact_20260112\")) {\n betas.add(\"compact-2026-01-12\");\n }\n }\n if ((anthropicOptions == null ? void 0 : anthropicOptions.container) && anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0) {\n betas.add(\"code-execution-2025-08-25\");\n betas.add(\"skills-2025-10-02\");\n betas.add(\"files-api-2025-04-14\");\n if (!(tools == null ? void 0 : tools.some(\n (tool) => tool.type === \"provider\" && (tool.id === \"anthropic.code_execution_20250825\" || tool.id === \"anthropic.code_execution_20260120\")\n ))) {\n warnings.push({\n type: \"other\",\n message: \"code execution tool is required when using skills\"\n });\n }\n }\n if (anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) {\n betas.add(\"task-budgets-2026-03-13\");\n }\n if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === \"fast\") {\n betas.add(\"fast-mode-2026-02-01\");\n }\n const defaultEagerInputStreaming = stream && ((_i = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _i : true);\n const {\n tools: anthropicTools2,\n toolChoice: anthropicToolChoice,\n toolWarnings,\n betas: toolsBetas\n } = await prepareTools(\n jsonResponseTool != null ? {\n tools: [...tools != null ? tools : [], jsonResponseTool],\n toolChoice: { type: \"required\" },\n disableParallelToolUse: true,\n cacheControlValidator,\n supportsStructuredOutput: false,\n supportsStrictTools,\n defaultEagerInputStreaming\n } : {\n tools: tools != null ? tools : [],\n toolChoice,\n disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse,\n cacheControlValidator,\n supportsStructuredOutput,\n supportsStrictTools,\n defaultEagerInputStreaming\n }\n );\n const cacheWarnings = cacheControlValidator.getWarnings();\n return {\n args: {\n ...baseArgs,\n tools: anthropicTools2,\n tool_choice: anthropicToolChoice,\n stream: stream === true ? true : void 0\n // do not send when not streaming\n },\n warnings: [...warnings, ...toolWarnings, ...cacheWarnings],\n betas: /* @__PURE__ */ new Set([\n ...betas,\n ...toolsBetas,\n ...userSuppliedBetas,\n ...(_j = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _j : []\n ]),\n usesJsonResponseTool: jsonResponseTool != null,\n toolNameMapping,\n providerOptionsName,\n usedCustomProviderKey\n };\n }\n async getHeaders({\n betas,\n headers\n }) {\n return combineHeaders(\n await resolve(this.config.headers),\n headers,\n betas.size > 0 ? { \"anthropic-beta\": Array.from(betas).join(\",\") } : {}\n );\n }\n async getBetasFromHeaders(requestHeaders) {\n var _a, _b;\n const configHeaders = await resolve(this.config.headers);\n const configBetaHeader = (_a = configHeaders[\"anthropic-beta\"]) != null ? _a : \"\";\n const requestBetaHeader = (_b = requestHeaders == null ? void 0 : requestHeaders[\"anthropic-beta\"]) != null ? _b : \"\";\n return new Set(\n [\n ...configBetaHeader.toLowerCase().split(\",\"),\n ...requestBetaHeader.toLowerCase().split(\",\")\n ].map((beta) => beta.trim()).filter((beta) => beta !== \"\")\n );\n }\n buildRequestUrl(isStreaming) {\n var _a, _b, _c;\n return (_c = (_b = (_a = this.config).buildRequestUrl) == null ? void 0 : _b.call(_a, this.config.baseURL, isStreaming)) != null ? _c : `${this.config.baseURL}/messages`;\n }\n transformRequestBody(args, betas) {\n var _a, _b, _c;\n return (_c = (_b = (_a = this.config).transformRequestBody) == null ? void 0 : _b.call(_a, args, betas)) != null ? _c : args;\n }\n extractCitationDocuments(prompt) {\n const isCitationPart = (part) => {\n var _a, _b;\n if (part.type !== \"file\") {\n return false;\n }\n if (part.mediaType !== \"application/pdf\" && part.mediaType !== \"text/plain\") {\n return false;\n }\n const anthropic = (_a = part.providerOptions) == null ? void 0 : _a.anthropic;\n const citationsConfig = anthropic == null ? void 0 : anthropic.citations;\n return (_b = citationsConfig == null ? void 0 : citationsConfig.enabled) != null ? _b : false;\n };\n return prompt.filter((message) => message.role === \"user\").flatMap((message) => message.content).filter(isCitationPart).map((part) => {\n var _a;\n const filePart = part;\n return {\n title: (_a = filePart.filename) != null ? _a : \"Untitled Document\",\n filename: filePart.filename,\n mediaType: filePart.mediaType\n };\n });\n }\n async doGenerate(options) {\n var _a, _b, _c, _d, _e, _f, _g;\n const {\n args,\n warnings,\n betas,\n usesJsonResponseTool,\n toolNameMapping,\n providerOptionsName,\n usedCustomProviderKey\n } = await this.getArgs({\n ...options,\n stream: false,\n userSuppliedBetas: await this.getBetasFromHeaders(options.headers)\n });\n const citationDocuments = [\n ...this.extractCitationDocuments(options.prompt)\n ];\n const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(\n args.tools\n );\n const {\n responseHeaders,\n value: response,\n rawValue: rawResponse\n } = await postJsonToApi({\n url: this.buildRequestUrl(false),\n headers: await this.getHeaders({ betas, headers: options.headers }),\n body: this.transformRequestBody(args, betas),\n failedResponseHandler: anthropicFailedResponseHandler,\n successfulResponseHandler: createJsonResponseHandler(\n anthropicMessagesResponseSchema\n ),\n abortSignal: options.abortSignal,\n fetch: this.config.fetch\n });\n const content = [];\n const mcpToolCalls = {};\n const serverToolCalls = {};\n let isJsonResponseFromTool = false;\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 if (part.citations) {\n for (const citation of part.citations) {\n const source = createCitationSource(\n citation,\n citationDocuments,\n this.generateId\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 }\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 }\n }\n });\n break;\n }\n case \"compaction\": {\n content.push({\n type: \"text\",\n text: part.content,\n providerMetadata: {\n anthropic: {\n type: \"compaction\"\n }\n }\n });\n break;\n }\n case \"tool_use\": {\n const isJsonResponseTool = usesJsonResponseTool && part.name === \"json\";\n if (isJsonResponseTool) {\n isJsonResponseFromTool = true;\n content.push({\n type: \"text\",\n text: JSON.stringify(part.input)\n });\n } else {\n const caller = part.caller;\n const callerInfo = caller ? {\n type: caller.type,\n toolId: \"tool_id\" in caller ? caller.tool_id : void 0\n } : void 0;\n content.push({\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: part.name,\n input: JSON.stringify(part.input),\n ...callerInfo && {\n providerMetadata: {\n anthropic: {\n caller: callerInfo\n }\n }\n }\n });\n }\n break;\n }\n case \"server_tool_use\": {\n if (part.name === \"text_editor_code_execution\" || part.name === \"bash_code_execution\") {\n const providerToolName = \"code_execution\";\n content.push({\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n input: JSON.stringify({ type: part.name, ...part.input }),\n providerExecuted: true,\n // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n // tool was not explicitly provided. We therefore bypass the general validation by marking the\n // tool as dynamic.\n ...markCodeExecutionDynamic && providerToolName === \"code_execution\" ? { dynamic: true } : {}\n });\n } else if (part.name === \"web_search\" || part.name === \"code_execution\" || part.name === \"web_fetch\") {\n const inputToSerialize = part.name === \"code_execution\" && part.input != null && typeof part.input === \"object\" && \"code\" in part.input && !(\"type\" in part.input) ? { type: \"programmatic-tool-call\", ...part.input } : part.input;\n content.push({\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: toolNameMapping.toCustomToolName(part.name),\n input: JSON.stringify(inputToSerialize),\n providerExecuted: true,\n // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n // tool was not explicitly provided. We therefore bypass the general validation by marking the\n // tool as dynamic.\n ...markCodeExecutionDynamic && part.name === \"code_execution\" ? { dynamic: true } : {}\n });\n } else if (part.name === \"tool_search_tool_regex\" || part.name === \"tool_search_tool_bm25\") {\n serverToolCalls[part.id] = part.name;\n content.push({\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: toolNameMapping.toCustomToolName(part.name),\n input: JSON.stringify(part.input),\n providerExecuted: true\n });\n } else if (part.name === \"advisor\") {\n content.push({\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: toolNameMapping.toCustomToolName(\"advisor\"),\n input: JSON.stringify(part.input),\n providerExecuted: true\n });\n }\n break;\n }\n case \"mcp_tool_use\": {\n mcpToolCalls[part.id] = {\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: part.name,\n input: JSON.stringify(part.input),\n providerExecuted: true,\n dynamic: true,\n providerMetadata: {\n anthropic: {\n type: \"mcp-tool-use\",\n serverName: part.server_name\n }\n }\n };\n content.push(mcpToolCalls[part.id]);\n break;\n }\n case \"mcp_tool_result\": {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: mcpToolCalls[part.tool_use_id].toolName,\n isError: part.is_error,\n result: part.content,\n dynamic: true,\n providerMetadata: mcpToolCalls[part.tool_use_id].providerMetadata\n });\n break;\n }\n case \"web_fetch_tool_result\": {\n if (part.content.type === \"web_fetch_result\") {\n citationDocuments.push({\n title: (_a = part.content.content.title) != null ? _a : part.content.url,\n mediaType: part.content.content.source.media_type\n });\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"web_fetch\"),\n result: {\n type: \"web_fetch_result\",\n url: part.content.url,\n retrievedAt: part.content.retrieved_at,\n content: {\n type: part.content.content.type,\n title: part.content.content.title,\n citations: part.content.content.citations,\n source: {\n type: part.content.content.source.type,\n mediaType: part.content.content.source.media_type,\n data: part.content.content.source.data\n }\n }\n }\n });\n } else if (part.content.type === \"web_fetch_tool_result_error\") {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"web_fetch\"),\n isError: true,\n result: {\n type: \"web_fetch_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n break;\n }\n case \"web_search_tool_result\": {\n if (Array.isArray(part.content)) {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"web_search\"),\n result: part.content.map((result) => {\n var _a2;\n return {\n url: result.url,\n title: result.title,\n pageAge: (_a2 = result.page_age) != null ? _a2 : 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: (_b = result.page_age) != null ? _b : null\n }\n }\n });\n }\n } else {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"web_search\"),\n isError: true,\n result: {\n type: \"web_search_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n break;\n }\n // code execution 20250522:\n case \"code_execution_tool_result\": {\n if (part.content.type === \"code_execution_result\") {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n result: {\n type: part.content.type,\n stdout: part.content.stdout,\n stderr: part.content.stderr,\n return_code: part.content.return_code,\n content: (_c = part.content.content) != null ? _c : []\n }\n });\n } else if (part.content.type === \"encrypted_code_execution_result\") {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n result: {\n type: part.content.type,\n encrypted_stdout: part.content.encrypted_stdout,\n stderr: part.content.stderr,\n return_code: part.content.return_code,\n content: (_d = part.content.content) != null ? _d : []\n }\n });\n } else if (part.content.type === \"code_execution_tool_result_error\") {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n isError: true,\n result: {\n type: \"code_execution_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n break;\n }\n // code execution 20250825:\n case \"bash_code_execution_tool_result\":\n case \"text_editor_code_execution_tool_result\": {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n result: part.content\n });\n break;\n }\n // tool search tool results:\n case \"tool_search_tool_result\": {\n let providerToolName = serverToolCalls[part.tool_use_id];\n if (providerToolName == null) {\n const bm25CustomName = toolNameMapping.toCustomToolName(\n \"tool_search_tool_bm25\"\n );\n const regexCustomName = toolNameMapping.toCustomToolName(\n \"tool_search_tool_regex\"\n );\n if (bm25CustomName !== \"tool_search_tool_bm25\") {\n providerToolName = \"tool_search_tool_bm25\";\n } else if (regexCustomName !== \"tool_search_tool_regex\") {\n providerToolName = \"tool_search_tool_regex\";\n } else {\n providerToolName = \"tool_search_tool_regex\";\n }\n }\n if (part.content.type === \"tool_search_tool_search_result\") {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(providerToolName),\n result: part.content.tool_references.map((ref) => ({\n type: ref.type,\n toolName: ref.tool_name\n }))\n });\n } else {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(providerToolName),\n isError: true,\n result: {\n type: \"tool_search_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n break;\n }\n // advisor results for advisor_20260301:\n case \"advisor_tool_result\": {\n const advisorToolName = toolNameMapping.toCustomToolName(\"advisor\");\n if (part.content.type === \"advisor_result\") {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: advisorToolName,\n result: {\n type: \"advisor_result\",\n text: part.content.text\n }\n });\n } else if (part.content.type === \"advisor_redacted_result\") {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: advisorToolName,\n result: {\n type: \"advisor_redacted_result\",\n encryptedContent: part.content.encrypted_content\n }\n });\n } else {\n content.push({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: advisorToolName,\n isError: true,\n result: {\n type: \"advisor_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n break;\n }\n }\n }\n return {\n content,\n finishReason: {\n unified: mapAnthropicStopReason({\n finishReason: response.stop_reason,\n isJsonResponseFromTool\n }),\n raw: (_e = response.stop_reason) != null ? _e : void 0\n },\n usage: convertAnthropicMessagesUsage({ usage: response.usage }),\n request: { body: args },\n response: {\n id: (_f = response.id) != null ? _f : void 0,\n modelId: (_g = response.model) != null ? _g : void 0,\n headers: responseHeaders,\n body: rawResponse\n },\n warnings,\n providerMetadata: (() => {\n var _a2, _b2, _c2, _d2, _e2;\n const anthropicMetadata = {\n usage: response.usage,\n cacheCreationInputTokens: (_a2 = response.usage.cache_creation_input_tokens) != null ? _a2 : null,\n stopSequence: (_b2 = response.stop_sequence) != null ? _b2 : null,\n iterations: response.usage.iterations ? response.usage.iterations.map(\n (iter) => iter.type === \"advisor_message\" ? {\n type: iter.type,\n model: iter.model,\n inputTokens: iter.input_tokens,\n outputTokens: iter.output_tokens,\n ...iter.cache_creation_input_tokens ? {\n cacheCreationInputTokens: iter.cache_creation_input_tokens\n } : {},\n ...iter.cache_read_input_tokens ? {\n cacheReadInputTokens: iter.cache_read_input_tokens\n } : {}\n } : {\n type: iter.type,\n inputTokens: iter.input_tokens,\n outputTokens: iter.output_tokens,\n ...iter.cache_creation_input_tokens ? {\n cacheCreationInputTokens: iter.cache_creation_input_tokens\n } : {},\n ...iter.cache_read_input_tokens ? {\n cacheReadInputTokens: iter.cache_read_input_tokens\n } : {}\n }\n ) : null,\n container: response.container ? {\n expiresAt: response.container.expires_at,\n id: response.container.id,\n skills: (_d2 = (_c2 = response.container.skills) == null ? void 0 : _c2.map((skill) => ({\n type: skill.type,\n skillId: skill.skill_id,\n version: skill.version\n }))) != null ? _d2 : null\n } : null,\n contextManagement: (_e2 = mapAnthropicResponseContextManagement(\n response.context_management\n )) != null ? _e2 : null\n };\n const providerMetadata = {\n anthropic: anthropicMetadata\n };\n if (usedCustomProviderKey && providerOptionsName !== \"anthropic\") {\n providerMetadata[providerOptionsName] = anthropicMetadata;\n }\n return providerMetadata;\n })()\n };\n }\n async doStream(options) {\n var _a, _b;\n const {\n args: body,\n warnings,\n betas,\n usesJsonResponseTool,\n toolNameMapping,\n providerOptionsName,\n usedCustomProviderKey\n } = await this.getArgs({\n ...options,\n stream: true,\n userSuppliedBetas: await this.getBetasFromHeaders(options.headers)\n });\n const citationDocuments = [\n ...this.extractCitationDocuments(options.prompt)\n ];\n const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(\n body.tools\n );\n const url = this.buildRequestUrl(true);\n const { responseHeaders, value: response } = await postJsonToApi({\n url,\n headers: await this.getHeaders({ betas, headers: options.headers }),\n body: this.transformRequestBody(body, betas),\n failedResponseHandler: anthropicFailedResponseHandler,\n successfulResponseHandler: createEventSourceResponseHandler(\n anthropicMessagesChunkSchema\n ),\n abortSignal: options.abortSignal,\n fetch: this.config.fetch\n });\n let finishReason = {\n unified: \"other\",\n raw: void 0\n };\n const usage = {\n input_tokens: 0,\n output_tokens: 0,\n cache_creation_input_tokens: 0,\n cache_read_input_tokens: 0,\n iterations: null\n };\n const contentBlocks = {};\n const mcpToolCalls = {};\n const serverToolCalls = {};\n let contextManagement = null;\n let rawUsage = void 0;\n let cacheCreationInputTokens = null;\n let stopSequence = null;\n let container = null;\n let isJsonResponseFromTool = false;\n let blockType = void 0;\n const generateId2 = this.generateId;\n const transformedStream = response.pipeThrough(\n new TransformStream({\n start(controller) {\n controller.enqueue({ type: \"stream-start\", warnings });\n },\n transform(chunk, controller) {\n var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;\n if (options.includeRawChunks) {\n controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n }\n if (!chunk.success) {\n controller.enqueue({ type: \"error\", error: chunk.error });\n return;\n }\n const value = chunk.value;\n switch (value.type) {\n case \"ping\": {\n return;\n }\n case \"content_block_start\": {\n const part = value.content_block;\n const contentBlockType = part.type;\n blockType = contentBlockType;\n switch (contentBlockType) {\n case \"text\": {\n if (usesJsonResponseTool) {\n return;\n }\n contentBlocks[value.index] = { type: \"text\" };\n controller.enqueue({\n type: \"text-start\",\n id: String(value.index)\n });\n return;\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 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 }\n }\n });\n return;\n }\n case \"compaction\": {\n contentBlocks[value.index] = { type: \"text\" };\n controller.enqueue({\n type: \"text-start\",\n id: String(value.index),\n providerMetadata: {\n anthropic: {\n type: \"compaction\"\n }\n }\n });\n return;\n }\n case \"tool_use\": {\n const isJsonResponseTool = usesJsonResponseTool && part.name === \"json\";\n if (isJsonResponseTool) {\n isJsonResponseFromTool = true;\n contentBlocks[value.index] = { type: \"text\" };\n controller.enqueue({\n type: \"text-start\",\n id: String(value.index)\n });\n } else {\n const caller = part.caller;\n const callerInfo = caller ? {\n type: caller.type,\n toolId: \"tool_id\" in caller ? caller.tool_id : void 0\n } : void 0;\n const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;\n const initialInput = hasNonEmptyInput ? JSON.stringify(part.input) : \"\";\n contentBlocks[value.index] = {\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: part.name,\n input: initialInput,\n firstDelta: initialInput.length === 0,\n ...callerInfo && { caller: callerInfo }\n };\n controller.enqueue({\n type: \"tool-input-start\",\n id: part.id,\n toolName: part.name\n });\n }\n return;\n }\n case \"server_tool_use\": {\n if ([\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 const providerToolName = part.name === \"text_editor_code_execution\" || part.name === \"bash_code_execution\" ? \"code_execution\" : part.name;\n const customToolName = toolNameMapping.toCustomToolName(providerToolName);\n const finalInput = part.input != null && typeof part.input === \"object\" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : \"\";\n contentBlocks[value.index] = {\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: customToolName,\n input: finalInput,\n providerExecuted: true,\n // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n // tool was not explicitly provided. We therefore bypass the general validation by marking the\n // tool as dynamic.\n ...markCodeExecutionDynamic && providerToolName === \"code_execution\" ? { dynamic: true } : {},\n firstDelta: true,\n providerToolName\n };\n controller.enqueue({\n type: \"tool-input-start\",\n id: part.id,\n toolName: customToolName,\n providerExecuted: true,\n // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n // tool was not explicitly provided. We therefore bypass the general validation by marking the\n // tool as dynamic.\n ...markCodeExecutionDynamic && providerToolName === \"code_execution\" ? { dynamic: true } : {}\n });\n } else if (part.name === \"tool_search_tool_regex\" || part.name === \"tool_search_tool_bm25\") {\n serverToolCalls[part.id] = part.name;\n const customToolName = toolNameMapping.toCustomToolName(\n part.name\n );\n contentBlocks[value.index] = {\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: customToolName,\n input: \"\",\n providerExecuted: true,\n firstDelta: true,\n providerToolName: part.name\n };\n controller.enqueue({\n type: \"tool-input-start\",\n id: part.id,\n toolName: customToolName,\n providerExecuted: true\n });\n } else if (part.name === \"advisor\") {\n const customToolName = toolNameMapping.toCustomToolName(\"advisor\");\n contentBlocks[value.index] = {\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: customToolName,\n input: \"{}\",\n providerExecuted: true,\n firstDelta: true,\n providerToolName: part.name\n };\n controller.enqueue({\n type: \"tool-input-start\",\n id: part.id,\n toolName: customToolName,\n providerExecuted: true\n });\n }\n return;\n }\n case \"web_fetch_tool_result\": {\n if (part.content.type === \"web_fetch_result\") {\n citationDocuments.push({\n title: (_a2 = part.content.content.title) != null ? _a2 : part.content.url,\n mediaType: part.content.content.source.media_type\n });\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"web_fetch\"),\n result: {\n type: \"web_fetch_result\",\n url: part.content.url,\n retrievedAt: part.content.retrieved_at,\n content: {\n type: part.content.content.type,\n title: part.content.content.title,\n citations: part.content.content.citations,\n source: {\n type: part.content.content.source.type,\n mediaType: part.content.content.source.media_type,\n data: part.content.content.source.data\n }\n }\n }\n });\n } else if (part.content.type === \"web_fetch_tool_result_error\") {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"web_fetch\"),\n isError: true,\n result: {\n type: \"web_fetch_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n return;\n }\n case \"web_search_tool_result\": {\n if (Array.isArray(part.content)) {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"web_search\"),\n result: part.content.map((result) => {\n var _a3;\n return {\n url: result.url,\n title: result.title,\n pageAge: (_a3 = result.page_age) != null ? _a3 : 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: generateId2(),\n url: result.url,\n title: result.title,\n providerMetadata: {\n anthropic: {\n pageAge: (_b2 = result.page_age) != null ? _b2 : null\n }\n }\n });\n }\n } else {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"web_search\"),\n isError: true,\n result: {\n type: \"web_search_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n return;\n }\n // 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: toolNameMapping.toCustomToolName(\"code_execution\"),\n result: {\n type: part.content.type,\n stdout: part.content.stdout,\n stderr: part.content.stderr,\n return_code: part.content.return_code,\n content: (_c = part.content.content) != null ? _c : []\n }\n });\n } else if (part.content.type === \"encrypted_code_execution_result\") {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n result: {\n type: part.content.type,\n encrypted_stdout: part.content.encrypted_stdout,\n stderr: part.content.stderr,\n return_code: part.content.return_code,\n content: (_d = part.content.content) != null ? _d : []\n }\n });\n } else if (part.content.type === \"code_execution_tool_result_error\") {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n isError: true,\n result: {\n type: \"code_execution_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n return;\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: toolNameMapping.toCustomToolName(\"code_execution\"),\n result: part.content\n });\n return;\n }\n // tool search tool results:\n case \"tool_search_tool_result\": {\n let providerToolName = serverToolCalls[part.tool_use_id];\n if (providerToolName == null) {\n const bm25CustomName = toolNameMapping.toCustomToolName(\n \"tool_search_tool_bm25\"\n );\n const regexCustomName = toolNameMapping.toCustomToolName(\n \"tool_search_tool_regex\"\n );\n if (bm25CustomName !== \"tool_search_tool_bm25\") {\n providerToolName = \"tool_search_tool_bm25\";\n } else if (regexCustomName !== \"tool_search_tool_regex\") {\n providerToolName = \"tool_search_tool_regex\";\n } else {\n providerToolName = \"tool_search_tool_regex\";\n }\n }\n if (part.content.type === \"tool_search_tool_search_result\") {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(providerToolName),\n result: part.content.tool_references.map((ref) => ({\n type: ref.type,\n toolName: ref.tool_name\n }))\n });\n } else {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: toolNameMapping.toCustomToolName(providerToolName),\n isError: true,\n result: {\n type: \"tool_search_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n return;\n }\n // advisor results for advisor_20260301:\n // arrives fully formed in a single content_block_start (no deltas).\n case \"advisor_tool_result\": {\n const advisorToolName = toolNameMapping.toCustomToolName(\"advisor\");\n if (part.content.type === \"advisor_result\") {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: advisorToolName,\n result: {\n type: \"advisor_result\",\n text: part.content.text\n }\n });\n } else if (part.content.type === \"advisor_redacted_result\") {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: advisorToolName,\n result: {\n type: \"advisor_redacted_result\",\n encryptedContent: part.content.encrypted_content\n }\n });\n } else {\n controller.enqueue({\n type: \"tool-result\",\n toolCallId: part.tool_use_id,\n toolName: advisorToolName,\n isError: true,\n result: {\n type: \"advisor_tool_result_error\",\n errorCode: part.content.error_code\n }\n });\n }\n return;\n }\n 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 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: mcpToolCalls[part.tool_use_id].providerMetadata\n });\n return;\n }\n default: {\n const _exhaustiveCheck = contentBlockType;\n throw new Error(\n `Unsupported content block type: ${_exhaustiveCheck}`\n );\n }\n }\n }\n case \"content_block_stop\": {\n if (contentBlocks[value.index] != null) {\n const contentBlock = contentBlocks[value.index];\n switch (contentBlock.type) {\n case \"text\": {\n controller.enqueue({\n type: \"text-end\",\n id: String(value.index)\n });\n break;\n }\n case \"reasoning\": {\n controller.enqueue({\n type: \"reasoning-end\",\n id: String(value.index)\n });\n break;\n }\n case \"tool-call\":\n const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === \"json\";\n if (!isJsonResponseTool) {\n controller.enqueue({\n type: \"tool-input-end\",\n id: contentBlock.toolCallId\n });\n let finalInput = contentBlock.input === \"\" ? \"{}\" : contentBlock.input;\n if (contentBlock.providerToolName === \"code_execution\") {\n try {\n const parsed = JSON.parse(finalInput);\n if (parsed != null && typeof parsed === \"object\" && \"code\" in parsed && !(\"type\" in parsed)) {\n finalInput = JSON.stringify({\n type: \"programmatic-tool-call\",\n ...parsed\n });\n }\n } catch (e) {\n }\n }\n controller.enqueue({\n type: \"tool-call\",\n toolCallId: contentBlock.toolCallId,\n toolName: contentBlock.toolName,\n input: finalInput,\n providerExecuted: contentBlock.providerExecuted,\n // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n // tool was not explicitly provided. We therefore bypass the general validation by marking the\n // tool as dynamic.\n ...markCodeExecutionDynamic && contentBlock.providerToolName === \"code_execution\" ? { dynamic: true } : {},\n ...contentBlock.caller && {\n providerMetadata: {\n anthropic: {\n caller: contentBlock.caller\n }\n }\n }\n });\n }\n break;\n }\n delete contentBlocks[value.index];\n }\n blockType = void 0;\n return;\n }\n case \"content_block_delta\": {\n const deltaType = value.delta.type;\n switch (deltaType) {\n case \"text_delta\": {\n if (usesJsonResponseTool) {\n return;\n }\n controller.enqueue({\n type: \"text-delta\",\n id: String(value.index),\n delta: value.delta.text\n });\n return;\n }\n case \"thinking_delta\": {\n controller.enqueue({\n type: \"reasoning-delta\",\n id: String(value.index),\n delta: value.delta.thinking\n });\n return;\n }\n case \"signature_delta\": {\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 }\n }\n });\n }\n return;\n }\n case \"compaction_delta\": {\n if (value.delta.content != null) {\n controller.enqueue({\n type: \"text-delta\",\n id: String(value.index),\n delta: value.delta.content\n });\n }\n return;\n }\n case \"input_json_delta\": {\n const contentBlock = contentBlocks[value.index];\n let delta = value.delta.partial_json;\n if (delta.length === 0) {\n return;\n }\n if (isJsonResponseFromTool) {\n if ((contentBlock == null ? void 0 : contentBlock.type) !== \"text\") {\n return;\n }\n controller.enqueue({\n type: \"text-delta\",\n id: String(value.index),\n delta\n });\n } else {\n if ((contentBlock == null ? void 0 : contentBlock.type) !== \"tool-call\") {\n return;\n }\n if (contentBlock.firstDelta && contentBlock.providerToolName === \"code_execution\") {\n delta = `{\"type\": \"programmatic-tool-call\",${delta.substring(1)}`;\n }\n controller.enqueue({\n type: \"tool-input-delta\",\n id: contentBlock.toolCallId,\n delta\n });\n contentBlock.input += delta;\n contentBlock.firstDelta = false;\n }\n return;\n }\n case \"citations_delta\": {\n const citation = value.delta.citation;\n const source = createCitationSource(\n citation,\n citationDocuments,\n generateId2\n );\n if (source) {\n controller.enqueue(source);\n }\n return;\n }\n default: {\n const _exhaustiveCheck = deltaType;\n throw new Error(\n `Unsupported delta type: ${_exhaustiveCheck}`\n );\n }\n }\n }\n case \"message_start\": {\n usage.input_tokens = value.message.usage.input_tokens;\n usage.cache_read_input_tokens = (_e = value.message.usage.cache_read_input_tokens) != null ? _e : 0;\n usage.cache_creation_input_tokens = (_f = value.message.usage.cache_creation_input_tokens) != null ? _f : 0;\n rawUsage = {\n ...value.message.usage\n };\n cacheCreationInputTokens = (_g = value.message.usage.cache_creation_input_tokens) != null ? _g : null;\n if (value.message.container != null) {\n container = {\n expiresAt: value.message.container.expires_at,\n id: value.message.container.id,\n skills: null\n };\n }\n if (value.message.stop_reason != null) {\n finishReason = {\n unified: mapAnthropicStopReason({\n finishReason: value.message.stop_reason,\n isJsonResponseFromTool\n }),\n raw: value.message.stop_reason\n };\n }\n controller.enqueue({\n type: \"response-metadata\",\n id: (_h = value.message.id) != null ? _h : void 0,\n modelId: (_i = value.message.model) != null ? _i : void 0\n });\n if (value.message.content != null) {\n for (let contentIndex = 0; contentIndex < value.message.content.length; contentIndex++) {\n const part = value.message.content[contentIndex];\n if (part.type === \"tool_use\") {\n const caller = part.caller;\n const callerInfo = caller ? {\n type: caller.type,\n toolId: \"tool_id\" in caller ? caller.tool_id : void 0\n } : void 0;\n controller.enqueue({\n type: \"tool-input-start\",\n id: part.id,\n toolName: part.name\n });\n const inputStr = JSON.stringify((_j = part.input) != null ? _j : {});\n controller.enqueue({\n type: \"tool-input-delta\",\n id: part.id,\n delta: inputStr\n });\n controller.enqueue({\n type: \"tool-input-end\",\n id: part.id\n });\n controller.enqueue({\n type: \"tool-call\",\n toolCallId: part.id,\n toolName: part.name,\n input: inputStr,\n ...callerInfo && {\n providerMetadata: {\n anthropic: {\n caller: callerInfo\n }\n }\n }\n });\n }\n }\n }\n return;\n }\n case \"message_delta\": {\n if (value.usage.input_tokens != null && usage.input_tokens !== value.usage.input_tokens) {\n usage.input_tokens = value.usage.input_tokens;\n }\n usage.output_tokens = value.usage.output_tokens;\n if (value.usage.cache_read_input_tokens != null) {\n usage.cache_read_input_tokens = value.usage.cache_read_input_tokens;\n }\n if (value.usage.cache_creation_input_tokens != null) {\n usage.cache_creation_input_tokens = value.usage.cache_creation_input_tokens;\n cacheCreationInputTokens = value.usage.cache_creation_input_tokens;\n }\n if (value.usage.iterations != null) {\n usage.iterations = value.usage.iterations;\n }\n finishReason = {\n unified: mapAnthropicStopReason({\n finishReason: value.delta.stop_reason,\n isJsonResponseFromTool\n }),\n raw: (_k = value.delta.stop_reason) != null ? _k : void 0\n };\n stopSequence = (_l = value.delta.stop_sequence) != null ? _l : null;\n container = value.delta.container != null ? {\n expiresAt: value.delta.container.expires_at,\n id: value.delta.container.id,\n skills: (_n = (_m = value.delta.container.skills) == null ? void 0 : _m.map((skill) => ({\n type: skill.type,\n skillId: skill.skill_id,\n version: skill.version\n }))) != null ? _n : null\n } : null;\n if (value.context_management) {\n contextManagement = mapAnthropicResponseContextManagement(\n value.context_management\n );\n }\n rawUsage = {\n ...rawUsage,\n ...value.usage\n };\n return;\n }\n case \"message_stop\": {\n const anthropicMetadata = {\n usage: rawUsage != null ? rawUsage : null,\n cacheCreationInputTokens,\n stopSequence,\n iterations: usage.iterations ? usage.iterations.map(\n (iter) => iter.type === \"advisor_message\" ? {\n type: iter.type,\n model: iter.model,\n inputTokens: iter.input_tokens,\n outputTokens: iter.output_tokens,\n ...iter.cache_creation_input_tokens ? {\n cacheCreationInputTokens: iter.cache_creation_input_tokens\n } : {},\n ...iter.cache_read_input_tokens ? {\n cacheReadInputTokens: iter.cache_read_input_tokens\n } : {}\n } : {\n type: iter.type,\n inputTokens: iter.input_tokens,\n outputTokens: iter.output_tokens,\n ...iter.cache_creation_input_tokens ? {\n cacheCreationInputTokens: iter.cache_creation_input_tokens\n } : {},\n ...iter.cache_read_input_tokens ? {\n cacheReadInputTokens: iter.cache_read_input_tokens\n } : {}\n }\n ) : null,\n container,\n contextManagement\n };\n const providerMetadata = {\n anthropic: anthropicMetadata\n };\n if (usedCustomProviderKey && providerOptionsName !== \"anthropic\") {\n providerMetadata[providerOptionsName] = anthropicMetadata;\n }\n controller.enqueue({\n type: \"finish\",\n finishReason,\n usage: convertAnthropicMessagesUsage({ usage, rawUsage }),\n providerMetadata\n });\n return;\n }\n case \"error\": {\n controller.enqueue({ type: \"error\", error: value.error });\n return;\n }\n default: {\n const _exhaustiveCheck = value;\n throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`);\n }\n }\n }\n })\n );\n const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();\n const firstChunkReader = streamForFirstChunk.getReader();\n try {\n await firstChunkReader.read();\n let result = await firstChunkReader.read();\n if (((_a = result.value) == null ? void 0 : _a.type) === \"raw\") {\n result = await firstChunkReader.read();\n }\n if (((_b = result.value) == null ? void 0 : _b.type) === \"error\") {\n const error = result.value.error;\n throw new APICallError({\n message: error.message,\n url,\n requestBodyValues: body,\n statusCode: error.type === \"overloaded_error\" ? 529 : 500,\n responseHeaders,\n responseBody: JSON.stringify(error),\n isRetryable: error.type === \"overloaded_error\"\n });\n }\n } finally {\n firstChunkReader.cancel().catch(() => {\n });\n firstChunkReader.releaseLock();\n }\n return {\n stream: streamForConsumer,\n request: { body },\n response: { headers: responseHeaders }\n };\n }\n};\nfunction getModelCapabilities(modelId) {\n if (modelId.includes(\"claude-opus-4-8\") || modelId.includes(\"claude-opus-4-7\")) {\n return {\n maxOutputTokens: 128e3,\n supportsStructuredOutput: true,\n rejectsSamplingParameters: true,\n isKnownModel: true\n };\n } else if (modelId.includes(\"claude-sonnet-4-6\") || modelId.includes(\"claude-opus-4-6\")) {\n return {\n maxOutputTokens: 128e3,\n supportsStructuredOutput: true,\n rejectsSamplingParameters: false,\n isKnownModel: true\n };\n } else if (modelId.includes(\"claude-sonnet-4-5\") || modelId.includes(\"claude-opus-4-5\") || modelId.includes(\"claude-haiku-4-5\")) {\n return {\n maxOutputTokens: 64e3,\n supportsStructuredOutput: true,\n rejectsSamplingParameters: false,\n isKnownModel: true\n };\n } else if (modelId.includes(\"claude-opus-4-1\")) {\n return {\n maxOutputTokens: 32e3,\n supportsStructuredOutput: true,\n rejectsSamplingParameters: false,\n isKnownModel: true\n };\n } else if (modelId.includes(\"claude-sonnet-4-\")) {\n return {\n maxOutputTokens: 64e3,\n supportsStructuredOutput: false,\n rejectsSamplingParameters: false,\n isKnownModel: true\n };\n } else if (modelId.includes(\"claude-opus-4-\")) {\n return {\n maxOutputTokens: 32e3,\n supportsStructuredOutput: false,\n rejectsSamplingParameters: false,\n isKnownModel: true\n };\n } else if (modelId.includes(\"claude-3-haiku\")) {\n return {\n maxOutputTokens: 4096,\n supportsStructuredOutput: false,\n rejectsSamplingParameters: false,\n isKnownModel: true\n };\n } else {\n return {\n maxOutputTokens: 4096,\n supportsStructuredOutput: false,\n rejectsSamplingParameters: false,\n isKnownModel: false\n };\n }\n}\nfunction hasWebTool20260209WithoutCodeExecution(tools) {\n if (!tools) {\n return false;\n }\n let hasWebTool20260209 = false;\n let hasCodeExecutionTool = false;\n for (const tool of tools) {\n if (\"type\" in tool && (tool.type === \"web_fetch_20260209\" || tool.type === \"web_search_20260209\")) {\n hasWebTool20260209 = true;\n continue;\n }\n if (tool.name === \"code_execution\") {\n hasCodeExecutionTool = true;\n break;\n }\n }\n return hasWebTool20260209 && !hasCodeExecutionTool;\n}\nfunction mapAnthropicResponseContextManagement(contextManagement) {\n return contextManagement ? {\n appliedEdits: contextManagement.applied_edits.map((edit) => {\n const strategy = edit.type;\n switch (strategy) {\n case \"clear_tool_uses_20250919\":\n return {\n type: edit.type,\n clearedToolUses: edit.cleared_tool_uses,\n clearedInputTokens: edit.cleared_input_tokens\n };\n case \"clear_thinking_20251015\":\n return {\n type: edit.type,\n clearedThinkingTurns: edit.cleared_thinking_turns,\n clearedInputTokens: edit.cleared_input_tokens\n };\n case \"compact_20260112\":\n return {\n type: edit.type\n };\n }\n }).filter((edit) => edit !== void 0)\n } : null;\n}\n\n// src/tool/bash_20241022.ts\nimport {\n createProviderToolFactory as createProviderToolFactory2,\n lazySchema as lazySchema13,\n zodSchema as zodSchema13\n} from \"@ai-sdk/provider-utils\";\nimport { z as z14 } from \"zod/v4\";\nvar bash_20241022InputSchema = lazySchema13(\n () => zodSchema13(\n z14.object({\n command: z14.string(),\n restart: z14.boolean().optional()\n })\n )\n);\nvar bash_20241022 = createProviderToolFactory2({\n id: \"anthropic.bash_20241022\",\n inputSchema: bash_20241022InputSchema\n});\n\n// src/tool/bash_20250124.ts\nimport {\n createProviderToolFactory as createProviderToolFactory3,\n lazySchema as lazySchema14,\n zodSchema as zodSchema14\n} from \"@ai-sdk/provider-utils\";\nimport { z as z15 } from \"zod/v4\";\nvar bash_20250124InputSchema = lazySchema14(\n () => zodSchema14(\n z15.object({\n command: z15.string(),\n restart: z15.boolean().optional()\n })\n )\n);\nvar bash_20250124 = createProviderToolFactory3({\n id: \"anthropic.bash_20250124\",\n inputSchema: bash_20250124InputSchema\n});\n\n// src/tool/computer_20241022.ts\nimport {\n createProviderToolFactory as createProviderToolFactory4,\n lazySchema as lazySchema15,\n zodSchema as zodSchema15\n} from \"@ai-sdk/provider-utils\";\nimport { z as z16 } from \"zod/v4\";\nvar computer_20241022InputSchema = lazySchema15(\n () => zodSchema15(\n z16.object({\n action: z16.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: z16.array(z16.number().int()).optional(),\n text: z16.string().optional()\n })\n )\n);\nvar computer_20241022 = createProviderToolFactory4({\n id: \"anthropic.computer_20241022\",\n inputSchema: computer_20241022InputSchema\n});\n\n// src/tool/computer_20250124.ts\nimport {\n createProviderToolFactory as createProviderToolFactory5,\n lazySchema as lazySchema16,\n zodSchema as zodSchema16\n} from \"@ai-sdk/provider-utils\";\nimport { z as z17 } from \"zod/v4\";\nvar computer_20250124InputSchema = lazySchema16(\n () => zodSchema16(\n z17.object({\n action: z17.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: z17.tuple([z17.number().int(), z17.number().int()]).optional(),\n duration: z17.number().optional(),\n scroll_amount: z17.number().optional(),\n scroll_direction: z17.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n start_coordinate: z17.tuple([z17.number().int(), z17.number().int()]).optional(),\n text: z17.string().optional()\n })\n )\n);\nvar computer_20250124 = createProviderToolFactory5({\n id: \"anthropic.computer_20250124\",\n inputSchema: computer_20250124InputSchema\n});\n\n// src/tool/computer_20251124.ts\nimport {\n createProviderToolFactory as createProviderToolFactory6,\n lazySchema as lazySchema17,\n zodSchema as zodSchema17\n} from \"@ai-sdk/provider-utils\";\nimport { z as z18 } from \"zod/v4\";\nvar computer_20251124InputSchema = lazySchema17(\n () => zodSchema17(\n z18.object({\n action: z18.enum([\n \"key\",\n \"hold_key\",\n \"type\",\n \"cursor_position\",\n \"mouse_move\",\n \"left_mouse_down\",\n \"left_mouse_up\",\n \"left_click\",\n \"left_click_drag\",\n \"right_click\",\n \"middle_click\",\n \"double_click\",\n \"triple_click\",\n \"scroll\",\n \"wait\",\n \"screenshot\",\n \"zoom\"\n ]),\n coordinate: z18.tuple([z18.number().int(), z18.number().int()]).optional(),\n duration: z18.number().optional(),\n region: z18.tuple([\n z18.number().int(),\n z18.number().int(),\n z18.number().int(),\n z18.number().int()\n ]).optional(),\n scroll_amount: z18.number().optional(),\n scroll_direction: z18.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n start_coordinate: z18.tuple([z18.number().int(), z18.number().int()]).optional(),\n text: z18.string().optional()\n })\n )\n);\nvar computer_20251124 = createProviderToolFactory6({\n id: \"anthropic.computer_20251124\",\n inputSchema: computer_20251124InputSchema\n});\n\n// src/tool/memory_20250818.ts\nimport {\n createProviderToolFactory as createProviderToolFactory7,\n lazySchema as lazySchema18,\n zodSchema as zodSchema18\n} from \"@ai-sdk/provider-utils\";\nimport { z as z19 } from \"zod/v4\";\nvar memory_20250818InputSchema = lazySchema18(\n () => zodSchema18(\n z19.discriminatedUnion(\"command\", [\n z19.object({\n command: z19.literal(\"view\"),\n path: z19.string(),\n view_range: z19.tuple([z19.number(), z19.number()]).optional()\n }),\n z19.object({\n command: z19.literal(\"create\"),\n path: z19.string(),\n file_text: z19.string()\n }),\n z19.object({\n command: z19.literal(\"str_replace\"),\n path: z19.string(),\n old_str: z19.string(),\n new_str: z19.string()\n }),\n z19.object({\n command: z19.literal(\"insert\"),\n path: z19.string(),\n insert_line: z19.number(),\n insert_text: z19.string()\n }),\n z19.object({\n command: z19.literal(\"delete\"),\n path: z19.string()\n }),\n z19.object({\n command: z19.literal(\"rename\"),\n old_path: z19.string(),\n new_path: z19.string()\n })\n ])\n )\n);\nvar memory_20250818 = createProviderToolFactory7({\n id: \"anthropic.memory_20250818\",\n inputSchema: memory_20250818InputSchema\n});\n\n// src/tool/text-editor_20241022.ts\nimport {\n createProviderToolFactory as createProviderToolFactory8,\n lazySchema as lazySchema19,\n zodSchema as zodSchema19\n} from \"@ai-sdk/provider-utils\";\nimport { z as z20 } from \"zod/v4\";\nvar textEditor_20241022InputSchema = lazySchema19(\n () => zodSchema19(\n z20.object({\n command: z20.enum([\"view\", \"create\", \"str_replace\", \"insert\", \"undo_edit\"]),\n path: z20.string(),\n file_text: z20.string().optional(),\n insert_line: z20.number().int().optional(),\n new_str: z20.string().optional(),\n insert_text: z20.string().optional(),\n old_str: z20.string().optional(),\n view_range: z20.array(z20.number().int()).optional()\n })\n )\n);\nvar textEditor_20241022 = createProviderToolFactory8({\n id: \"anthropic.text_editor_20241022\",\n inputSchema: textEditor_20241022InputSchema\n});\n\n// src/tool/text-editor_20250124.ts\nimport {\n createProviderToolFactory as createProviderToolFactory9,\n lazySchema as lazySchema20,\n zodSchema as zodSchema20\n} from \"@ai-sdk/provider-utils\";\nimport { z as z21 } from \"zod/v4\";\nvar textEditor_20250124InputSchema = lazySchema20(\n () => zodSchema20(\n z21.object({\n command: z21.enum([\"view\", \"create\", \"str_replace\", \"insert\", \"undo_edit\"]),\n path: z21.string(),\n file_text: z21.string().optional(),\n insert_line: z21.number().int().optional(),\n new_str: z21.string().optional(),\n insert_text: z21.string().optional(),\n old_str: z21.string().optional(),\n view_range: z21.array(z21.number().int()).optional()\n })\n )\n);\nvar textEditor_20250124 = createProviderToolFactory9({\n id: \"anthropic.text_editor_20250124\",\n inputSchema: textEditor_20250124InputSchema\n});\n\n// src/tool/text-editor_20250429.ts\nimport {\n createProviderToolFactory as createProviderToolFactory10,\n lazySchema as lazySchema21,\n zodSchema as zodSchema21\n} from \"@ai-sdk/provider-utils\";\nimport { z as z22 } from \"zod/v4\";\nvar textEditor_20250429InputSchema = lazySchema21(\n () => zodSchema21(\n z22.object({\n command: z22.enum([\"view\", \"create\", \"str_replace\", \"insert\"]),\n path: z22.string(),\n file_text: z22.string().optional(),\n insert_line: z22.number().int().optional(),\n new_str: z22.string().optional(),\n insert_text: z22.string().optional(),\n old_str: z22.string().optional(),\n view_range: z22.array(z22.number().int()).optional()\n })\n )\n);\nvar textEditor_20250429 = createProviderToolFactory10({\n id: \"anthropic.text_editor_20250429\",\n inputSchema: textEditor_20250429InputSchema\n});\n\n// src/tool/tool-search-bm25_20251119.ts\nimport {\n createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,\n lazySchema as lazySchema22,\n zodSchema as zodSchema22\n} from \"@ai-sdk/provider-utils\";\nimport { z as z23 } from \"zod/v4\";\nvar toolSearchBm25_20251119OutputSchema = lazySchema22(\n () => zodSchema22(\n z23.array(\n z23.object({\n type: z23.literal(\"tool_reference\"),\n toolName: z23.string()\n })\n )\n )\n);\nvar toolSearchBm25_20251119InputSchema = lazySchema22(\n () => zodSchema22(\n z23.object({\n /**\n * A natural language query to search for tools.\n * Claude will use BM25 text search to find relevant tools.\n */\n query: z23.string(),\n /**\n * Maximum number of tools to return. Optional.\n */\n limit: z23.number().optional()\n })\n )\n);\nvar factory11 = createProviderToolFactoryWithOutputSchema10({\n id: \"anthropic.tool_search_bm25_20251119\",\n inputSchema: toolSearchBm25_20251119InputSchema,\n outputSchema: toolSearchBm25_20251119OutputSchema,\n supportsDeferredResults: true\n});\nvar toolSearchBm25_20251119 = (args = {}) => {\n return factory11(args);\n};\n\n// src/anthropic-tools.ts\nvar anthropicTools = {\n /**\n * Pairs a faster executor model with a higher-intelligence advisor model\n * that provides strategic guidance mid-generation.\n *\n * The advisor lets a faster, lower-cost executor model consult a\n * higher-intelligence advisor model server-side. The advisor reads the\n * executor's full transcript and produces a plan or course correction;\n * the executor continues with the task, informed by the advice. All of\n * this happens inside a single `/v1/messages` request.\n *\n * Beta header `advisor-tool-2026-03-01` is added automatically when this\n * tool is included.\n *\n * Multi-turn conversations: pass the full assistant content (including\n * `advisor_tool_result` blocks) back to the API on subsequent turns. If\n * you omit the advisor tool from `tools` on a follow-up turn while the\n * message history still contains `advisor_tool_result` blocks, the API\n * returns a `400 invalid_request_error`.\n *\n * Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,\n * Opus 4.7. The advisor must be at least as capable as the executor.\n *\n * @param model - The advisor model ID (required), e.g. `\"claude-opus-4-8\"`.\n * @param maxUses - Maximum advisor calls per request (per-request cap).\n * @param caching - Enables prompt caching for the advisor's transcript\n * across calls within a conversation. Worthwhile from ~3 advisor calls\n * per conversation.\n */\n advisor_20260301,\n /**\n * The bash tool enables Claude to execute shell commands in a persistent bash session,\n * allowing system operations, script execution, and command-line automation.\n *\n * Image results are supported.\n */\n bash_20241022,\n /**\n * The bash tool enables Claude to execute shell commands in a persistent bash session,\n * allowing system operations, script execution, and command-line automation.\n *\n * Image results are supported.\n */\n bash_20250124,\n /**\n * Claude can analyze data, create visualizations, perform complex calculations,\n * run system commands, create and edit files, and process uploaded files directly within\n * the API conversation.\n *\n * The code execution tool allows Claude to run Bash commands and manipulate files,\n * including writing code, in a secure, sandboxed environment.\n */\n codeExecution_20250522,\n /**\n * Claude can analyze data, create visualizations, perform complex calculations,\n * run system commands, create and edit files, and process uploaded files directly within\n * the API conversation.\n *\n * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,\n * including writing code, in a secure, sandboxed environment.\n *\n * This is the latest version with enhanced Bash support and file operations.\n */\n codeExecution_20250825,\n /**\n * Claude can analyze data, create visualizations, perform complex calculations,\n * run system commands, create and edit files, and process uploaded files directly within\n * the API conversation.\n *\n * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,\n * including writing code, in a secure, sandboxed environment.\n *\n * This is the recommended version. Does not require a beta header.\n *\n * Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5\n */\n codeExecution_20260120,\n /**\n * Claude can interact with computer environments through the computer use tool, which\n * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n *\n * Image results are supported.\n *\n * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n */\n computer_20241022,\n /**\n * Claude can interact with computer environments through the computer use tool, which\n * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n *\n * Image results are supported.\n *\n * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n */\n computer_20250124,\n /**\n * Claude can interact with computer environments through the computer use tool, which\n * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n *\n * This version adds the zoom action for detailed screen region inspection.\n *\n * Image results are supported.\n *\n * Supported models: Claude Opus 4.5\n *\n * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n * @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.\n */\n computer_20251124,\n /**\n * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.\n * Claude can create, read, update, and delete files that persist between sessions,\n * allowing it to build knowledge over time without keeping everything in the context window.\n * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.\n *\n * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.\n */\n memory_20250818,\n /**\n * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n * helping you debug, fix, and improve your code or other text documents. This allows Claude\n * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n *\n * Supported models: Claude Sonnet 3.5\n */\n textEditor_20241022,\n /**\n * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n * helping you debug, fix, and improve your code or other text documents. This allows Claude\n * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n *\n * Supported models: Claude Sonnet 3.7\n */\n textEditor_20250124,\n /**\n * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n * helping you debug, fix, and improve your code or other text documents. This allows Claude\n * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n *\n * Note: This version does not support the \"undo_edit\" command.\n *\n * @deprecated Use textEditor_20250728 instead\n */\n textEditor_20250429,\n /**\n * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n * helping you debug, fix, and improve your code or other text documents. This allows Claude\n * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n *\n * Note: This version does not support the \"undo_edit\" command and adds optional max_characters parameter.\n *\n * Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1\n *\n * @param maxCharacters - Optional maximum number of characters to view in the file\n */\n textEditor_20250728,\n /**\n * Creates a web fetch tool that gives Claude direct access to real-time web content.\n *\n * @param maxUses - The max_uses parameter limits the number of web fetches performed\n * @param allowedDomains - Only fetch from these domains\n * @param blockedDomains - Never fetch from these domains\n * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set \"citations\": {\"enabled\": true} to enable Claude to cite specific passages from fetched documents.\n * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.\n */\n webFetch_20250910,\n /**\n * Creates a web fetch tool that gives Claude direct access to real-time web content.\n *\n * @param maxUses - The max_uses parameter limits the number of web fetches performed\n * @param allowedDomains - Only fetch from these domains\n * @param blockedDomains - Never fetch from these domains\n * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set \"citations\": {\"enabled\": true} to enable Claude to cite specific passages from fetched documents.\n * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.\n */\n webFetch_20260209,\n /**\n * Creates a web search tool that gives Claude direct access to real-time web content.\n *\n * @param maxUses - Maximum number of web searches Claude can perform during the conversation.\n * @param allowedDomains - Optional list of domains that Claude is allowed to search.\n * @param blockedDomains - Optional list of domains that Claude should avoid when searching.\n * @param userLocation - Optional user location information to provide geographically relevant search results.\n */\n webSearch_20250305,\n /**\n * Creates a web search tool that gives Claude direct access to real-time web content.\n *\n * @param maxUses - Maximum number of web searches Claude can perform during the conversation.\n * @param allowedDomains - Optional list of domains that Claude is allowed to search.\n * @param blockedDomains - Optional list of domains that Claude should avoid when searching.\n * @param userLocation - Optional user location information to provide geographically relevant search results.\n */\n webSearch_20260209,\n /**\n * Creates a tool search tool that uses regex patterns to find tools.\n *\n * The tool search tool enables Claude to work with hundreds or thousands of tools\n * by dynamically discovering and loading them on-demand. Instead of loading all\n * tool definitions into the context window upfront, Claude searches your tool\n * catalog and loads only the tools it needs.\n *\n * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools\n * to mark them for deferred loading.\n *\n * Supported models: Claude Opus 4.5, Claude Sonnet 4.5\n */\n toolSearchRegex_20251119,\n /**\n * Creates a tool search tool that uses BM25 (natural language) to find tools.\n *\n * The tool search tool enables Claude to work with hundreds or thousands of tools\n * by dynamically discovering and loading them on-demand. Instead of loading all\n * tool definitions into the context window upfront, Claude searches your tool\n * catalog and loads only the tools it needs.\n *\n * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools\n * to mark them for deferred loading.\n *\n * Supported models: Claude Opus 4.5, Claude Sonnet 4.5\n */\n toolSearchBm25_20251119\n};\nexport {\n AnthropicMessagesLanguageModel,\n anthropicTools,\n prepareTools\n};\n//# sourceMappingURL=index.mjs.map",
|
|
6
|
+
"import { Crc32 } from \"@aws-crypto/crc32\";\nimport { HeaderMarshaller } from \"./HeaderMarshaller\";\nimport { splitMessage } from \"./splitMessage\";\nexport class EventStreamCodec {\n headerMarshaller;\n messageBuffer;\n isEndOfStream;\n constructor(toUtf8, fromUtf8) {\n this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8);\n this.messageBuffer = [];\n this.isEndOfStream = false;\n }\n feed(message) {\n this.messageBuffer.push(this.decode(message));\n }\n endOfStream() {\n this.isEndOfStream = true;\n }\n getMessage() {\n const message = this.messageBuffer.pop();\n const isEndOfStream = this.isEndOfStream;\n return {\n getMessage() {\n return message;\n },\n isEndOfStream() {\n return isEndOfStream;\n },\n };\n }\n getAvailableMessages() {\n const messages = this.messageBuffer;\n this.messageBuffer = [];\n const isEndOfStream = this.isEndOfStream;\n return {\n getMessages() {\n return messages;\n },\n isEndOfStream() {\n return isEndOfStream;\n },\n };\n }\n encode({ headers: rawHeaders, body }) {\n const headers = this.headerMarshaller.format(rawHeaders);\n const length = headers.byteLength + body.byteLength + 16;\n const out = new Uint8Array(length);\n const view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n const checksum = new Crc32();\n view.setUint32(0, length, false);\n view.setUint32(4, headers.byteLength, false);\n view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);\n out.set(headers, 12);\n out.set(body, headers.byteLength + 12);\n view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false);\n return out;\n }\n decode(message) {\n const { headers, body } = splitMessage(message);\n return { headers: this.headerMarshaller.parse(headers), body };\n }\n formatHeaders(rawHeaders) {\n return this.headerMarshaller.format(rawHeaders);\n }\n}\n",
|
|
7
|
+
"export { fromHex, toHex } from \"@smithy/core/serde\";\n",
|
|
8
|
+
"import { toHex } from \"@smithy/util-hex-encoding\";\nexport class Int64 {\n bytes;\n constructor(bytes) {\n this.bytes = bytes;\n if (bytes.byteLength !== 8) {\n throw new Error(\"Int64 buffers must be exactly 8 bytes\");\n }\n }\n static fromNumber(number) {\n if (number > 9_223_372_036_854_775_807 || number < -9_223_372_036_854_775_808) {\n throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);\n }\n const bytes = new Uint8Array(8);\n for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {\n bytes[i] = remaining;\n }\n if (number < 0) {\n negate(bytes);\n }\n return new Int64(bytes);\n }\n valueOf() {\n const bytes = this.bytes.slice(0);\n const negative = bytes[0] & 0b10000000;\n if (negative) {\n negate(bytes);\n }\n return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);\n }\n toString() {\n return String(this.valueOf());\n }\n}\nfunction negate(bytes) {\n for (let i = 0; i < 8; i++) {\n bytes[i] ^= 0xff;\n }\n for (let i = 7; i > -1; i--) {\n bytes[i]++;\n if (bytes[i] !== 0)\n break;\n }\n}\n",
|
|
9
|
+
"import { fromHex, toHex } from \"@smithy/util-hex-encoding\";\nimport { Int64 } from \"./Int64\";\nexport class HeaderMarshaller {\n toUtf8;\n fromUtf8;\n constructor(toUtf8, fromUtf8) {\n this.toUtf8 = toUtf8;\n this.fromUtf8 = fromUtf8;\n }\n format(headers) {\n const chunks = [];\n for (const headerName of Object.keys(headers)) {\n const bytes = this.fromUtf8(headerName);\n chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));\n }\n const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));\n let position = 0;\n for (const chunk of chunks) {\n out.set(chunk, position);\n position += chunk.byteLength;\n }\n return out;\n }\n formatHeaderValue(header) {\n switch (header.type) {\n case \"boolean\":\n return Uint8Array.from([header.value ? 0 : 1]);\n case \"byte\":\n return Uint8Array.from([2, header.value]);\n case \"short\":\n const shortView = new DataView(new ArrayBuffer(3));\n shortView.setUint8(0, 3);\n shortView.setInt16(1, header.value, false);\n return new Uint8Array(shortView.buffer);\n case \"integer\":\n const intView = new DataView(new ArrayBuffer(5));\n intView.setUint8(0, 4);\n intView.setInt32(1, header.value, false);\n return new Uint8Array(intView.buffer);\n case \"long\":\n const longBytes = new Uint8Array(9);\n longBytes[0] = 5;\n longBytes.set(header.value.bytes, 1);\n return longBytes;\n case \"binary\":\n const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));\n binView.setUint8(0, 6);\n binView.setUint16(1, header.value.byteLength, false);\n const binBytes = new Uint8Array(binView.buffer);\n binBytes.set(header.value, 3);\n return binBytes;\n case \"string\":\n const utf8Bytes = this.fromUtf8(header.value);\n const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));\n strView.setUint8(0, 7);\n strView.setUint16(1, utf8Bytes.byteLength, false);\n const strBytes = new Uint8Array(strView.buffer);\n strBytes.set(utf8Bytes, 3);\n return strBytes;\n case \"timestamp\":\n const tsBytes = new Uint8Array(9);\n tsBytes[0] = 8;\n tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);\n return tsBytes;\n case \"uuid\":\n if (!UUID_PATTERN.test(header.value)) {\n throw new Error(`Invalid UUID received: ${header.value}`);\n }\n const uuidBytes = new Uint8Array(17);\n uuidBytes[0] = 9;\n uuidBytes.set(fromHex(header.value.replace(/\\-/g, \"\")), 1);\n return uuidBytes;\n }\n }\n parse(headers) {\n const out = {};\n let position = 0;\n while (position < headers.byteLength) {\n const nameLength = headers.getUint8(position++);\n const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));\n position += nameLength;\n switch (headers.getUint8(position++)) {\n case 0:\n out[name] = {\n type: BOOLEAN_TAG,\n value: true,\n };\n break;\n case 1:\n out[name] = {\n type: BOOLEAN_TAG,\n value: false,\n };\n break;\n case 2:\n out[name] = {\n type: BYTE_TAG,\n value: headers.getInt8(position++),\n };\n break;\n case 3:\n out[name] = {\n type: SHORT_TAG,\n value: headers.getInt16(position, false),\n };\n position += 2;\n break;\n case 4:\n out[name] = {\n type: INT_TAG,\n value: headers.getInt32(position, false),\n };\n position += 4;\n break;\n case 5:\n out[name] = {\n type: LONG_TAG,\n value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)),\n };\n position += 8;\n break;\n case 6:\n const binaryLength = headers.getUint16(position, false);\n position += 2;\n out[name] = {\n type: BINARY_TAG,\n value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength),\n };\n position += binaryLength;\n break;\n case 7:\n const stringLength = headers.getUint16(position, false);\n position += 2;\n out[name] = {\n type: STRING_TAG,\n value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)),\n };\n position += stringLength;\n break;\n case 8:\n out[name] = {\n type: TIMESTAMP_TAG,\n value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()),\n };\n position += 8;\n break;\n case 9:\n const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);\n position += 16;\n out[name] = {\n type: UUID_TAG,\n value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,\n };\n break;\n default:\n throw new Error(`Unrecognized header type tag`);\n }\n }\n return out;\n }\n}\nvar HEADER_VALUE_TYPE;\n(function (HEADER_VALUE_TYPE) {\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"boolTrue\"] = 0] = \"boolTrue\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"boolFalse\"] = 1] = \"boolFalse\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"byte\"] = 2] = \"byte\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"short\"] = 3] = \"short\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"integer\"] = 4] = \"integer\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"long\"] = 5] = \"long\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"byteArray\"] = 6] = \"byteArray\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"string\"] = 7] = \"string\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"timestamp\"] = 8] = \"timestamp\";\n HEADER_VALUE_TYPE[HEADER_VALUE_TYPE[\"uuid\"] = 9] = \"uuid\";\n})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));\nconst BOOLEAN_TAG = \"boolean\";\nconst BYTE_TAG = \"byte\";\nconst SHORT_TAG = \"short\";\nconst INT_TAG = \"integer\";\nconst LONG_TAG = \"long\";\nconst BINARY_TAG = \"binary\";\nconst STRING_TAG = \"string\";\nconst TIMESTAMP_TAG = \"timestamp\";\nconst UUID_TAG = \"uuid\";\nconst UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;\n",
|
|
10
|
+
"import { Crc32 } from \"@aws-crypto/crc32\";\nconst PRELUDE_MEMBER_LENGTH = 4;\nconst PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;\nconst CHECKSUM_LENGTH = 4;\nconst MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;\nexport function splitMessage({ byteLength, byteOffset, buffer }) {\n if (byteLength < MINIMUM_MESSAGE_LENGTH) {\n throw new Error(\"Provided message too short to accommodate event stream message overhead\");\n }\n const view = new DataView(buffer, byteOffset, byteLength);\n const messageLength = view.getUint32(0, false);\n if (byteLength !== messageLength) {\n throw new Error(\"Reported message length does not match received message length\");\n }\n const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);\n const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);\n const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);\n const checksummer = new Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));\n if (expectedPreludeChecksum !== checksummer.digest()) {\n throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`);\n }\n checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH)));\n if (expectedMessageChecksum !== checksummer.digest()) {\n throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`);\n }\n return {\n headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),\n body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)),\n };\n}\n",
|
|
11
|
+
"export { fromArrayBuffer, fromString } from \"@smithy/core/serde\";\n",
|
|
12
|
+
"import { fromString } from \"@smithy/util-buffer-from\";\nexport const fromUtf8 = (input) => {\n const buf = fromString(input, \"utf8\");\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n};\n",
|
|
13
|
+
"import { fromArrayBuffer } from \"@smithy/util-buffer-from\";\nexport const toUtf8 = (input) => {\n if (typeof input === \"string\") {\n return input;\n }\n if (typeof input !== \"object\" || typeof input.byteOffset !== \"number\" || typeof input.byteLength !== \"number\") {\n throw new Error(\"@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.\");\n }\n return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString(\"utf8\");\n};\n",
|
|
14
|
+
"// src/bedrock-provider.ts\nimport { anthropicTools as anthropicTools2 } from \"@ai-sdk/anthropic/internal\";\nimport {\n generateId,\n loadOptionalSetting,\n loadSetting,\n withoutTrailingSlash,\n withUserAgentSuffix as withUserAgentSuffix2\n} from \"@ai-sdk/provider-utils\";\n\n// src/bedrock-chat-language-model.ts\nimport {\n combineHeaders,\n createJsonErrorResponseHandler,\n createJsonResponseHandler,\n parseProviderOptions as parseProviderOptions2,\n postJsonToApi,\n resolve\n} from \"@ai-sdk/provider-utils\";\nimport { z as z4 } from \"zod/v4\";\n\n// src/bedrock-api-types.ts\nvar BEDROCK_STOP_REASONS = [\n \"stop\",\n \"stop_sequence\",\n \"end_turn\",\n \"length\",\n \"max_tokens\",\n \"content-filter\",\n \"content_filtered\",\n \"guardrail_intervened\",\n \"tool-calls\",\n \"tool_use\"\n];\nvar BEDROCK_IMAGE_MIME_TYPES = {\n \"image/jpeg\": \"jpeg\",\n \"image/png\": \"png\",\n \"image/gif\": \"gif\",\n \"image/webp\": \"webp\"\n};\nvar BEDROCK_DOCUMENT_MIME_TYPES = {\n \"application/pdf\": \"pdf\",\n \"text/csv\": \"csv\",\n \"application/msword\": \"doc\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\": \"docx\",\n \"application/vnd.ms-excel\": \"xls\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\": \"xlsx\",\n \"text/html\": \"html\",\n \"text/plain\": \"txt\",\n \"text/markdown\": \"md\"\n};\n\n// src/bedrock-chat-options.ts\nimport { z } from \"zod/v4\";\nvar bedrockFilePartProviderOptions = z.object({\n /**\n * Citation configuration for this document.\n * When enabled, this document will generate citations in the response.\n */\n citations: z.object({\n /**\n * Enable citations for this document\n */\n enabled: z.boolean()\n }).optional()\n});\nvar amazonBedrockLanguageModelOptions = z.object({\n /**\n * Additional inference parameters that the model supports,\n * beyond the base set of inference parameters that Converse\n * supports in the inferenceConfig field\n */\n additionalModelRequestFields: z.record(z.string(), z.any()).optional(),\n reasoningConfig: z.object({\n type: z.union([\n z.literal(\"enabled\"),\n z.literal(\"disabled\"),\n z.literal(\"adaptive\")\n ]).optional(),\n budgetTokens: z.number().optional(),\n maxReasoningEffort: z.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]).optional(),\n display: z.enum([\"omitted\", \"summarized\"]).optional()\n }).optional(),\n /**\n * Anthropic beta features to enable\n */\n anthropicBeta: z.array(z.string()).optional(),\n /**\n * Service tier for the request.\n * @see https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html\n *\n * - 'reserved': Uses provisioned throughput capacity\n * - 'priority': Prioritizes low-latency inference when capacity is available\n * - 'default': Standard on-demand tier\n * - 'flex': Lower-cost tier for flexible latency workloads\n */\n serviceTier: z.enum([\"reserved\", \"priority\", \"default\", \"flex\"]).optional()\n});\n\n// src/bedrock-error.ts\nimport { z as z2 } from \"zod/v4\";\nvar BedrockErrorSchema = z2.object({\n message: z2.string(),\n type: z2.string().nullish()\n});\n\n// src/bedrock-event-stream-response-handler.ts\nimport { EmptyResponseBodyError } from \"@ai-sdk/provider\";\nimport {\n safeParseJSON,\n extractResponseHeaders,\n safeValidateTypes\n} from \"@ai-sdk/provider-utils\";\n\n// src/bedrock-event-stream-decoder.ts\nimport { EventStreamCodec } from \"@smithy/eventstream-codec\";\nimport { toUtf8, fromUtf8 } from \"@smithy/util-utf8\";\nfunction createBedrockEventStreamDecoder(body, processEvent) {\n const codec = new EventStreamCodec(toUtf8, fromUtf8);\n let buffer = new Uint8Array(0);\n const textDecoder = new TextDecoder();\n return body.pipeThrough(\n new TransformStream({\n async transform(chunk, controller) {\n var _a, _b;\n const newBuffer = new Uint8Array(buffer.length + chunk.length);\n newBuffer.set(buffer);\n newBuffer.set(chunk, buffer.length);\n buffer = newBuffer;\n while (buffer.length >= 4) {\n const totalLength = new DataView(\n buffer.buffer,\n buffer.byteOffset,\n buffer.byteLength\n ).getUint32(0, false);\n if (buffer.length < totalLength) {\n break;\n }\n try {\n const subView = buffer.subarray(0, totalLength);\n const decoded = codec.decode(subView);\n buffer = buffer.slice(totalLength);\n const messageType = (_a = decoded.headers[\":message-type\"]) == null ? void 0 : _a.value;\n const eventType = (_b = decoded.headers[\":event-type\"]) == null ? void 0 : _b.value;\n const data = textDecoder.decode(decoded.body);\n await processEvent({ messageType, eventType, data }, controller);\n } catch (e) {\n break;\n }\n }\n }\n })\n );\n}\n\n// src/bedrock-event-stream-response-handler.ts\nvar createBedrockEventStreamResponseHandler = (chunkSchema) => async ({ response }) => {\n const responseHeaders = extractResponseHeaders(response);\n if (response.body == null) {\n throw new EmptyResponseBodyError({});\n }\n return {\n responseHeaders,\n value: createBedrockEventStreamDecoder(\n response.body,\n async (event, controller) => {\n if (event.messageType === \"event\") {\n const parsedDataResult = await safeParseJSON({ text: event.data });\n if (!parsedDataResult.success) {\n controller.enqueue(parsedDataResult);\n return;\n }\n delete parsedDataResult.value.p;\n const wrappedData = {\n [event.eventType]: parsedDataResult.value\n };\n const validatedWrappedData = await safeValidateTypes({\n value: wrappedData,\n schema: chunkSchema\n });\n if (!validatedWrappedData.success) {\n controller.enqueue(validatedWrappedData);\n } else {\n controller.enqueue({\n success: true,\n value: validatedWrappedData.value,\n rawValue: wrappedData\n });\n }\n }\n }\n )\n };\n};\n\n// src/bedrock-prepare-tools.ts\nimport {\n UnsupportedFunctionalityError\n} from \"@ai-sdk/provider\";\nimport { asSchema } from \"@ai-sdk/provider-utils\";\nimport {\n anthropicTools,\n prepareTools as prepareAnthropicTools\n} from \"@ai-sdk/anthropic/internal\";\nasync function prepareTools({\n tools,\n toolChoice,\n modelId\n}) {\n var _a;\n const toolWarnings = [];\n const betas = /* @__PURE__ */ new Set();\n if (tools == null || tools.length === 0) {\n return {\n toolConfig: {},\n additionalTools: void 0,\n betas,\n toolWarnings\n };\n }\n const supportedTools = tools.filter((tool) => {\n if (tool.type === \"provider\" && tool.id === \"anthropic.web_search_20250305\") {\n toolWarnings.push({\n type: \"unsupported\",\n feature: \"web_search_20250305 tool\",\n details: \"The web_search_20250305 tool is not supported on Amazon Bedrock.\"\n });\n return false;\n }\n return true;\n });\n if (supportedTools.length === 0) {\n return {\n toolConfig: {},\n additionalTools: void 0,\n betas,\n toolWarnings\n };\n }\n const isAnthropicModel = modelId.includes(\"anthropic.\");\n const ProviderTools = supportedTools.filter((t) => t.type === \"provider\");\n const functionTools = supportedTools.filter((t) => t.type === \"function\");\n let additionalTools = void 0;\n const bedrockTools = [];\n const usingAnthropicTools = isAnthropicModel && ProviderTools.length > 0;\n if (usingAnthropicTools) {\n const {\n toolChoice: preparedAnthropicToolChoice,\n toolWarnings: anthropicToolWarnings,\n betas: anthropicBetas\n } = await prepareAnthropicTools({\n tools: ProviderTools,\n toolChoice,\n supportsStructuredOutput: false,\n supportsStrictTools: false\n });\n toolWarnings.push(...anthropicToolWarnings);\n anthropicBetas.forEach((beta) => betas.add(beta));\n if (preparedAnthropicToolChoice) {\n additionalTools = {\n tool_choice: preparedAnthropicToolChoice\n };\n }\n for (const tool of ProviderTools) {\n const toolFactory = Object.values(anthropicTools).find((factory) => {\n const instance = factory({});\n return instance.id === tool.id;\n });\n if (toolFactory != null) {\n const fullToolDefinition = toolFactory({});\n bedrockTools.push({\n toolSpec: {\n name: tool.name,\n inputSchema: {\n json: await asSchema(fullToolDefinition.inputSchema).jsonSchema\n }\n }\n });\n } else {\n toolWarnings.push({ type: \"unsupported\", feature: \"tool ${tool.id}\" });\n }\n }\n } else {\n for (const tool of ProviderTools) {\n toolWarnings.push({ type: \"unsupported\", feature: `tool ${tool.id}` });\n }\n }\n const filteredFunctionTools = (toolChoice == null ? void 0 : toolChoice.type) === \"tool\" ? functionTools.filter((t) => t.name === toolChoice.toolName) : functionTools;\n for (const tool of filteredFunctionTools) {\n bedrockTools.push({\n toolSpec: {\n name: tool.name,\n ...((_a = tool.description) == null ? void 0 : _a.trim()) !== \"\" ? { description: tool.description } : {},\n ...tool.strict != null ? { strict: tool.strict } : {},\n inputSchema: {\n json: tool.inputSchema\n }\n }\n });\n }\n let bedrockToolChoice = void 0;\n if (!usingAnthropicTools && bedrockTools.length > 0 && toolChoice) {\n const type = toolChoice.type;\n switch (type) {\n case \"auto\":\n bedrockToolChoice = { auto: {} };\n break;\n case \"required\":\n bedrockToolChoice = { any: {} };\n break;\n case \"none\":\n bedrockTools.length = 0;\n bedrockToolChoice = void 0;\n break;\n case \"tool\":\n bedrockToolChoice = { tool: { name: toolChoice.toolName } };\n break;\n default: {\n const _exhaustiveCheck = type;\n throw new UnsupportedFunctionalityError({\n functionality: `tool choice type: ${_exhaustiveCheck}`\n });\n }\n }\n }\n const toolConfig = bedrockTools.length > 0 ? { tools: bedrockTools, toolChoice: bedrockToolChoice } : {};\n return {\n toolConfig,\n additionalTools,\n betas,\n toolWarnings\n };\n}\n\n// src/convert-bedrock-usage.ts\nfunction convertBedrockUsage(usage) {\n var _a, _b;\n if (usage == null) {\n return {\n inputTokens: {\n total: void 0,\n noCache: void 0,\n cacheRead: void 0,\n cacheWrite: void 0\n },\n outputTokens: {\n total: void 0,\n text: void 0,\n reasoning: void 0\n },\n raw: void 0\n };\n }\n const inputTokens = usage.inputTokens;\n const outputTokens = usage.outputTokens;\n const cacheReadTokens = (_a = usage.cacheReadInputTokens) != null ? _a : 0;\n const cacheWriteTokens = (_b = usage.cacheWriteInputTokens) != null ? _b : 0;\n return {\n inputTokens: {\n total: inputTokens + cacheReadTokens + cacheWriteTokens,\n noCache: inputTokens,\n cacheRead: cacheReadTokens,\n cacheWrite: cacheWriteTokens\n },\n outputTokens: {\n total: outputTokens,\n text: outputTokens,\n reasoning: void 0\n },\n raw: usage\n };\n}\n\n// src/convert-to-bedrock-chat-messages.ts\nimport {\n UnsupportedFunctionalityError as UnsupportedFunctionalityError2\n} from \"@ai-sdk/provider\";\nimport {\n convertToBase64,\n parseProviderOptions,\n stripFileExtension\n} from \"@ai-sdk/provider-utils\";\n\n// src/bedrock-reasoning-metadata.ts\nimport { z as z3 } from \"zod/v4\";\nvar bedrockReasoningMetadataSchema = z3.object({\n signature: z3.string().optional(),\n redactedData: z3.string().optional()\n});\n\n// src/normalize-tool-call-id.ts\nfunction isMistralModel(modelId) {\n return modelId.includes(\"mistral.\");\n}\nfunction normalizeToolCallId(toolCallId, isMistral) {\n if (!isMistral) {\n return toolCallId;\n }\n const alphanumericChars = toolCallId.replace(/[^a-zA-Z0-9]/g, \"\");\n return alphanumericChars.slice(0, 9);\n}\n\n// src/convert-to-bedrock-chat-messages.ts\nfunction getCachePoint(providerMetadata) {\n var _a;\n const cachePointConfig = (_a = providerMetadata == null ? void 0 : providerMetadata.bedrock) == null ? void 0 : _a.cachePoint;\n if (!cachePointConfig) {\n return void 0;\n }\n return { cachePoint: cachePointConfig };\n}\nfunction pushCachePoint(content, providerMetadata) {\n const cachePoint = getCachePoint(providerMetadata);\n if (cachePoint) {\n content.push(cachePoint);\n }\n}\nasync function shouldEnableCitations(providerMetadata) {\n var _a, _b;\n const bedrockOptions = await parseProviderOptions({\n provider: \"bedrock\",\n providerOptions: providerMetadata,\n schema: bedrockFilePartProviderOptions\n });\n return (_b = (_a = bedrockOptions == null ? void 0 : bedrockOptions.citations) == null ? void 0 : _a.enabled) != null ? _b : false;\n}\nasync function convertToBedrockChatMessages(prompt, isMistral = false) {\n var _a;\n const blocks = groupIntoBlocks(prompt);\n let system = [];\n const messages = [];\n let documentCounter = 0;\n const generateDocumentName = () => `document-${++documentCounter}`;\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 switch (type) {\n case \"system\": {\n if (messages.length > 0) {\n throw new UnsupportedFunctionalityError2({\n functionality: \"Multiple system messages that are separated by user/assistant messages\"\n });\n }\n for (const message of block.messages) {\n system.push({ text: message.content });\n const cachePoint = getCachePoint(message.providerOptions);\n if (cachePoint) {\n system.push(cachePoint);\n }\n }\n break;\n }\n case \"user\": {\n const bedrockContent = [];\n for (const message of block.messages) {\n const { role, content, providerOptions } = message;\n switch (role) {\n case \"user\": {\n for (let j = 0; j < content.length; j++) {\n const part = content[j];\n switch (part.type) {\n case \"text\": {\n bedrockContent.push({\n text: part.text\n });\n break;\n }\n case \"file\": {\n if (part.data instanceof URL) {\n throw new UnsupportedFunctionalityError2({\n functionality: \"File URL data\"\n });\n }\n if (part.mediaType.startsWith(\"image/\")) {\n bedrockContent.push({\n image: {\n format: getBedrockImageFormat(part.mediaType),\n source: { bytes: convertToBase64(part.data) }\n }\n });\n } else {\n if (!part.mediaType) {\n throw new UnsupportedFunctionalityError2({\n functionality: \"file without mime type\",\n message: \"File mime type is required in user message part content\"\n });\n }\n const enableCitations = await shouldEnableCitations(\n part.providerOptions\n );\n bedrockContent.push({\n document: {\n format: getBedrockDocumentFormat(part.mediaType),\n name: part.filename ? stripFileExtension(part.filename) : generateDocumentName(),\n source: { bytes: convertToBase64(part.data) },\n ...enableCitations && {\n citations: { enabled: true }\n }\n }\n });\n }\n break;\n }\n }\n pushCachePoint(bedrockContent, part.providerOptions);\n }\n break;\n }\n case \"tool\": {\n for (const part of content) {\n if (part.type === \"tool-approval-response\") {\n continue;\n }\n let toolResultContent;\n const output = part.output;\n switch (output.type) {\n case \"content\": {\n toolResultContent = await Promise.all(\n output.value.map(async (contentPart) => {\n switch (contentPart.type) {\n case \"text\":\n return { text: contentPart.text };\n case \"image-data\": {\n return {\n image: {\n format: getBedrockImageFormat(\n contentPart.mediaType\n ),\n source: {\n bytes: convertToBase64(contentPart.data)\n }\n }\n };\n }\n case \"file-data\": {\n if (!contentPart.mediaType.startsWith(\"image/\")) {\n const enableCitations = await shouldEnableCitations(\n contentPart.providerOptions\n );\n return {\n document: {\n format: getBedrockDocumentFormat(\n contentPart.mediaType\n ),\n name: \"filename\" in contentPart && contentPart.filename ? stripFileExtension(contentPart.filename) : generateDocumentName(),\n source: {\n bytes: convertToBase64(contentPart.data)\n },\n ...enableCitations && {\n citations: { enabled: true }\n }\n }\n };\n }\n return {\n image: {\n format: getBedrockImageFormat(\n contentPart.mediaType\n ),\n source: {\n bytes: convertToBase64(contentPart.data)\n }\n }\n };\n }\n default: {\n throw new UnsupportedFunctionalityError2({\n functionality: `unsupported tool content part type: ${contentPart.type}`\n });\n }\n }\n })\n );\n break;\n }\n case \"text\":\n case \"error-text\":\n toolResultContent = [{ text: output.value }];\n break;\n case \"execution-denied\":\n toolResultContent = [\n { text: (_a = output.reason) != null ? _a : \"Tool execution denied.\" }\n ];\n break;\n case \"json\":\n case \"error-json\":\n default:\n toolResultContent = [\n { text: JSON.stringify(output.value) }\n ];\n break;\n }\n bedrockContent.push({\n toolResult: {\n toolUseId: normalizeToolCallId(part.toolCallId, isMistral),\n content: toolResultContent\n }\n });\n pushCachePoint(bedrockContent, part.providerOptions);\n }\n break;\n }\n default: {\n const _exhaustiveCheck = role;\n throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n }\n }\n pushCachePoint(bedrockContent, providerOptions);\n }\n messages.push({ role: \"user\", content: bedrockContent });\n break;\n }\n case \"assistant\": {\n const bedrockContent = [];\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 const hasReasoningBlocks = content.some(\n (part) => part.type === \"reasoning\"\n );\n for (let k = 0; k < content.length; k++) {\n const part = content[k];\n const isLastContentPart = k === content.length - 1;\n switch (part.type) {\n case \"text\": {\n if (!part.text.trim() && !hasReasoningBlocks) {\n break;\n }\n bedrockContent.push({\n text: (\n // trim the last text part if it's the last message in the block\n // because Bedrock does not allow trailing whitespace\n // in pre-filled assistant responses\n trimIfLast(\n isLastBlock,\n isLastMessage,\n isLastContentPart,\n part.text\n )\n )\n });\n break;\n }\n case \"reasoning\": {\n const reasoningMetadata = await parseProviderOptions({\n provider: \"bedrock\",\n providerOptions: part.providerOptions,\n schema: bedrockReasoningMetadataSchema\n });\n if ((reasoningMetadata == null ? void 0 : reasoningMetadata.signature) != null) {\n bedrockContent.push({\n reasoningContent: {\n reasoningText: {\n text: part.text,\n signature: reasoningMetadata.signature\n }\n }\n });\n } else if ((reasoningMetadata == null ? void 0 : reasoningMetadata.redactedData) != null) {\n bedrockContent.push({\n reasoningContent: {\n redactedReasoning: {\n data: reasoningMetadata.redactedData\n }\n }\n });\n }\n break;\n }\n case \"tool-call\": {\n bedrockContent.push({\n toolUse: {\n toolUseId: normalizeToolCallId(part.toolCallId, isMistral),\n name: part.toolName,\n input: part.input\n }\n });\n break;\n }\n }\n pushCachePoint(bedrockContent, part.providerOptions);\n }\n pushCachePoint(bedrockContent, message.providerOptions);\n }\n messages.push({ role: \"assistant\", content: bedrockContent });\n break;\n }\n default: {\n const _exhaustiveCheck = type;\n throw new Error(`Unsupported type: ${_exhaustiveCheck}`);\n }\n }\n }\n return { system, messages };\n}\nfunction getBedrockImageFormat(mimeType) {\n if (!mimeType) {\n throw new UnsupportedFunctionalityError2({\n functionality: \"image without mime type\",\n message: \"Image mime type is required in user message part content\"\n });\n }\n const format = BEDROCK_IMAGE_MIME_TYPES[mimeType];\n if (!format) {\n throw new UnsupportedFunctionalityError2({\n functionality: `image mime type: ${mimeType}`,\n message: `Unsupported image mime type: ${mimeType}, expected one of: ${Object.keys(BEDROCK_IMAGE_MIME_TYPES).join(\", \")}`\n });\n }\n return format;\n}\nfunction getBedrockDocumentFormat(mimeType) {\n const format = BEDROCK_DOCUMENT_MIME_TYPES[mimeType];\n if (!format) {\n throw new UnsupportedFunctionalityError2({\n functionality: `file mime type: ${mimeType}`,\n message: `Unsupported file mime type: ${mimeType}, expected one of: ${Object.keys(BEDROCK_DOCUMENT_MIME_TYPES).join(\", \")}`\n });\n }\n return format;\n}\nfunction trimIfLast(isLastBlock, isLastMessage, isLastContentPart, text) {\n return isLastBlock && isLastMessage && isLastContentPart ? text.trim() : text;\n}\nfunction groupIntoBlocks(prompt) {\n const blocks = [];\n let currentBlock = void 0;\n for (const message of prompt) {\n const { role } = message;\n switch (role) {\n case \"system\": {\n if ((currentBlock == null ? void 0 : currentBlock.type) !== \"system\") {\n currentBlock = { type: \"system\", messages: [] };\n blocks.push(currentBlock);\n }\n currentBlock.messages.push(message);\n break;\n }\n case \"assistant\": {\n if ((currentBlock == null ? void 0 : currentBlock.type) !== \"assistant\") {\n currentBlock = { type: \"assistant\", messages: [] };\n blocks.push(currentBlock);\n }\n currentBlock.messages.push(message);\n break;\n }\n case \"user\": {\n if ((currentBlock == null ? void 0 : currentBlock.type) !== \"user\") {\n currentBlock = { type: \"user\", messages: [] };\n blocks.push(currentBlock);\n }\n currentBlock.messages.push(message);\n break;\n }\n case \"tool\": {\n if ((currentBlock == null ? void 0 : currentBlock.type) !== \"user\") {\n currentBlock = { type: \"user\", messages: [] };\n blocks.push(currentBlock);\n }\n currentBlock.messages.push(message);\n break;\n }\n default: {\n const _exhaustiveCheck = role;\n throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n }\n }\n }\n return blocks;\n}\n\n// src/map-bedrock-finish-reason.ts\nfunction mapBedrockFinishReason(finishReason, isJsonResponseFromTool) {\n switch (finishReason) {\n case \"stop_sequence\":\n case \"end_turn\":\n return \"stop\";\n case \"max_tokens\":\n return \"length\";\n case \"content_filtered\":\n case \"guardrail_intervened\":\n return \"content-filter\";\n case \"tool_use\":\n return isJsonResponseFromTool ? \"stop\" : \"tool-calls\";\n default:\n return \"other\";\n }\n}\n\n// src/bedrock-chat-language-model.ts\nvar BedrockChatLanguageModel = class {\n constructor(modelId, config) {\n this.modelId = modelId;\n this.config = config;\n this.specificationVersion = \"v3\";\n this.provider = \"amazon-bedrock\";\n this.supportedUrls = {\n // no supported urls for bedrock\n };\n }\n 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 }) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;\n const bedrockOptions = (_a = await parseProviderOptions2({\n provider: \"bedrock\",\n providerOptions,\n schema: amazonBedrockLanguageModelOptions\n })) != null ? _a : {};\n const warnings = [];\n if (frequencyPenalty != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"frequencyPenalty\"\n });\n }\n if (presencePenalty != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"presencePenalty\"\n });\n }\n if (seed != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"seed\"\n });\n }\n if (temperature != null && temperature > 1) {\n warnings.push({\n type: \"unsupported\",\n feature: \"temperature\",\n details: `${temperature} exceeds bedrock maximum of 1.0. clamped to 1.0`\n });\n temperature = 1;\n } else if (temperature != null && temperature < 0) {\n warnings.push({\n type: \"unsupported\",\n feature: \"temperature\",\n details: `${temperature} is below bedrock minimum of 0. clamped to 0`\n });\n temperature = 0;\n }\n if (responseFormat != null && responseFormat.type !== \"text\" && responseFormat.type !== \"json\") {\n warnings.push({\n type: \"unsupported\",\n feature: \"responseFormat\",\n details: \"Only text and json response formats are supported.\"\n });\n }\n const isAnthropicModel = this.modelId.includes(\"anthropic\");\n const isThinkingEnabled = ((_b = bedrockOptions.reasoningConfig) == null ? void 0 : _b.type) === \"enabled\" || ((_c = bedrockOptions.reasoningConfig) == null ? void 0 : _c.type) === \"adaptive\";\n const useNativeStructuredOutput = isAnthropicModel && isThinkingEnabled && (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null;\n const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null && !useNativeStructuredOutput ? {\n type: \"function\",\n name: \"json\",\n description: \"Respond with a JSON object.\",\n inputSchema: responseFormat.schema\n } : void 0;\n const { toolConfig, additionalTools, toolWarnings, betas } = await prepareTools({\n tools: jsonResponseTool ? [...tools != null ? tools : [], jsonResponseTool] : tools,\n toolChoice: jsonResponseTool != null ? { type: \"required\" } : toolChoice,\n modelId: this.modelId\n });\n warnings.push(...toolWarnings);\n if (additionalTools) {\n bedrockOptions.additionalModelRequestFields = {\n ...bedrockOptions.additionalModelRequestFields,\n ...additionalTools\n };\n }\n if (betas.size > 0 || bedrockOptions.anthropicBeta) {\n const existingBetas = (_d = bedrockOptions.anthropicBeta) != null ? _d : [];\n const mergedBetas = betas.size > 0 ? [...existingBetas, ...Array.from(betas)] : existingBetas;\n bedrockOptions.additionalModelRequestFields = {\n ...bedrockOptions.additionalModelRequestFields,\n anthropic_beta: mergedBetas\n };\n }\n const thinkingType = (_e = bedrockOptions.reasoningConfig) == null ? void 0 : _e.type;\n const thinkingBudget = thinkingType === \"enabled\" ? (_f = bedrockOptions.reasoningConfig) == null ? void 0 : _f.budgetTokens : void 0;\n const thinkingDisplay = thinkingType === \"adaptive\" ? (_g = bedrockOptions.reasoningConfig) == null ? void 0 : _g.display : void 0;\n const isAnthropicThinkingEnabled = isAnthropicModel && isThinkingEnabled;\n const inferenceConfig = {\n ...maxOutputTokens != null && { maxTokens: maxOutputTokens },\n ...temperature != null && { temperature },\n ...topP != null && { topP },\n ...topK != null && { topK },\n ...stopSequences != null && { stopSequences }\n };\n if (isAnthropicThinkingEnabled) {\n if (thinkingBudget != null) {\n if (inferenceConfig.maxTokens != null) {\n inferenceConfig.maxTokens += thinkingBudget;\n } else {\n inferenceConfig.maxTokens = thinkingBudget + 4096;\n }\n bedrockOptions.additionalModelRequestFields = {\n ...bedrockOptions.additionalModelRequestFields,\n thinking: {\n type: \"enabled\",\n budget_tokens: thinkingBudget\n }\n };\n } else if (thinkingType === \"adaptive\") {\n bedrockOptions.additionalModelRequestFields = {\n ...bedrockOptions.additionalModelRequestFields,\n thinking: {\n type: \"adaptive\",\n ...thinkingDisplay != null && { display: thinkingDisplay }\n }\n };\n }\n } else if (!isAnthropicModel) {\n if (((_h = bedrockOptions.reasoningConfig) == null ? void 0 : _h.budgetTokens) != null) {\n warnings.push({\n type: \"unsupported\",\n feature: \"budgetTokens\",\n details: \"budgetTokens applies only to Anthropic models on Bedrock and will be ignored for this model.\"\n });\n }\n if (thinkingType === \"adaptive\") {\n warnings.push({\n type: \"unsupported\",\n feature: \"adaptive thinking\",\n details: \"adaptive thinking type applies only to Anthropic models on Bedrock.\"\n });\n }\n }\n const maxReasoningEffort = (_i = bedrockOptions.reasoningConfig) == null ? void 0 : _i.maxReasoningEffort;\n const isOpenAIModel = this.modelId.startsWith(\"openai.\");\n if (maxReasoningEffort != null) {\n if (isAnthropicModel) {\n bedrockOptions.additionalModelRequestFields = {\n ...bedrockOptions.additionalModelRequestFields,\n output_config: {\n ...(_j = bedrockOptions.additionalModelRequestFields) == null ? void 0 : _j.output_config,\n effort: maxReasoningEffort\n }\n };\n } else if (isOpenAIModel) {\n bedrockOptions.additionalModelRequestFields = {\n ...bedrockOptions.additionalModelRequestFields,\n reasoning_effort: maxReasoningEffort\n };\n } else {\n bedrockOptions.additionalModelRequestFields = {\n ...bedrockOptions.additionalModelRequestFields,\n reasoningConfig: {\n ...thinkingType != null && thinkingType !== \"adaptive\" && { type: thinkingType },\n ...thinkingBudget != null && { budgetTokens: thinkingBudget },\n maxReasoningEffort\n }\n };\n }\n }\n if (useNativeStructuredOutput) {\n bedrockOptions.additionalModelRequestFields = {\n ...bedrockOptions.additionalModelRequestFields,\n output_config: {\n ...(_k = bedrockOptions.additionalModelRequestFields) == null ? void 0 : _k.output_config,\n format: {\n type: \"json_schema\",\n schema: responseFormat.schema\n }\n }\n };\n }\n if (isAnthropicThinkingEnabled && inferenceConfig.temperature != null) {\n delete inferenceConfig.temperature;\n warnings.push({\n type: \"unsupported\",\n feature: \"temperature\",\n details: \"temperature is not supported when thinking is enabled\"\n });\n }\n if (isAnthropicThinkingEnabled && inferenceConfig.topP != null) {\n delete inferenceConfig.topP;\n warnings.push({\n type: \"unsupported\",\n feature: \"topP\",\n details: \"topP is not supported when thinking is enabled\"\n });\n }\n if (isAnthropicThinkingEnabled && inferenceConfig.topK != null) {\n delete inferenceConfig.topK;\n warnings.push({\n type: \"unsupported\",\n feature: \"topK\",\n details: \"topK is not supported when thinking is enabled\"\n });\n }\n const hasAnyTools = ((_m = (_l = toolConfig.tools) == null ? void 0 : _l.length) != null ? _m : 0) > 0 || additionalTools;\n let filteredPrompt = prompt;\n if (!hasAnyTools) {\n const hasToolContent = prompt.some(\n (message) => \"content\" in message && Array.isArray(message.content) && message.content.some(\n (part) => part.type === \"tool-call\" || part.type === \"tool-result\"\n )\n );\n if (hasToolContent) {\n filteredPrompt = prompt.map(\n (message) => message.role === \"system\" ? message : {\n ...message,\n content: message.content.filter(\n (part) => part.type !== \"tool-call\" && part.type !== \"tool-result\"\n )\n }\n ).filter(\n (message) => message.role === \"system\" || message.content.length > 0\n );\n warnings.push({\n type: \"unsupported\",\n feature: \"toolContent\",\n details: \"Tool calls and results removed from conversation because Bedrock does not support tool content without active tools.\"\n });\n }\n }\n const isMistral = isMistralModel(this.modelId);\n const { system, messages } = await convertToBedrockChatMessages(\n filteredPrompt,\n isMistral\n );\n const {\n reasoningConfig: _,\n additionalModelRequestFields: __,\n serviceTier: ___,\n ...filteredBedrockOptions\n } = (providerOptions == null ? void 0 : providerOptions.bedrock) || {};\n const additionalModelResponseFieldPaths = isAnthropicModel ? [\"/delta/stop_sequence\"] : void 0;\n return {\n command: {\n system,\n messages,\n additionalModelRequestFields: bedrockOptions.additionalModelRequestFields,\n ...additionalModelResponseFieldPaths && {\n additionalModelResponseFieldPaths\n },\n ...Object.keys(inferenceConfig).length > 0 && {\n inferenceConfig\n },\n ...bedrockOptions.serviceTier != null && {\n serviceTier: {\n type: bedrockOptions.serviceTier\n }\n },\n ...filteredBedrockOptions,\n ...toolConfig.tools !== void 0 && toolConfig.tools.length > 0 ? { toolConfig } : {}\n },\n warnings,\n usesJsonResponseTool: jsonResponseTool != null,\n betas\n };\n }\n async getHeaders({\n headers\n }) {\n return combineHeaders(await resolve(this.config.headers), headers);\n }\n async doGenerate(options) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;\n const {\n command: args,\n warnings,\n usesJsonResponseTool\n } = await this.getArgs(options);\n const url = `${this.getUrl(this.modelId)}/converse`;\n const { value: response, responseHeaders } = await postJsonToApi({\n url,\n headers: await this.getHeaders({ headers: options.headers }),\n body: args,\n failedResponseHandler: createJsonErrorResponseHandler({\n errorSchema: BedrockErrorSchema,\n errorToMessage: (error) => {\n var _a2;\n return `${(_a2 = error.message) != null ? _a2 : \"Unknown error\"}`;\n }\n }),\n successfulResponseHandler: createJsonResponseHandler(\n BedrockResponseSchema\n ),\n abortSignal: options.abortSignal,\n fetch: this.config.fetch\n });\n const content = [];\n let isJsonResponseFromTool = false;\n for (const part of response.output.message.content) {\n if (part.text != null) {\n content.push({ type: \"text\", text: part.text });\n }\n if (part.reasoningContent) {\n if (\"reasoningText\" in part.reasoningContent) {\n const reasoning = {\n type: \"reasoning\",\n text: part.reasoningContent.reasoningText.text\n };\n if (part.reasoningContent.reasoningText.signature) {\n reasoning.providerMetadata = {\n bedrock: {\n signature: part.reasoningContent.reasoningText.signature\n }\n };\n }\n content.push(reasoning);\n } else if (\"redactedReasoning\" in part.reasoningContent) {\n content.push({\n type: \"reasoning\",\n text: \"\",\n providerMetadata: {\n bedrock: {\n redactedData: (_a = part.reasoningContent.redactedReasoning.data) != null ? _a : \"\"\n }\n }\n });\n }\n }\n if (part.toolUse) {\n const isJsonResponseTool = usesJsonResponseTool && part.toolUse.name === \"json\";\n if (isJsonResponseTool) {\n isJsonResponseFromTool = true;\n content.push({\n type: \"text\",\n text: JSON.stringify(part.toolUse.input)\n });\n } else {\n const isMistral = isMistralModel(this.modelId);\n const rawToolCallId = (_c = (_b = part.toolUse) == null ? void 0 : _b.toolUseId) != null ? _c : this.config.generateId();\n content.push({\n type: \"tool-call\",\n toolCallId: normalizeToolCallId(rawToolCallId, isMistral),\n toolName: (_e = (_d = part.toolUse) == null ? void 0 : _d.name) != null ? _e : `tool-${this.config.generateId()}`,\n input: JSON.stringify((_g = (_f = part.toolUse) == null ? void 0 : _f.input) != null ? _g : {})\n });\n }\n }\n }\n const stopSequence = (_j = (_i = (_h = response.additionalModelResponseFields) == null ? void 0 : _h.delta) == null ? void 0 : _i.stop_sequence) != null ? _j : null;\n const providerMetadata = response.trace || response.usage || response.performanceConfig || response.serviceTier || isJsonResponseFromTool || stopSequence ? {\n bedrock: {\n ...response.trace && typeof response.trace === \"object\" ? { trace: response.trace } : {},\n ...response.performanceConfig && {\n performanceConfig: response.performanceConfig\n },\n ...response.serviceTier && {\n serviceTier: response.serviceTier\n },\n ...(((_k = response.usage) == null ? void 0 : _k.cacheWriteInputTokens) != null || ((_l = response.usage) == null ? void 0 : _l.cacheDetails) != null) && {\n usage: {\n ...response.usage.cacheWriteInputTokens != null && {\n cacheWriteInputTokens: response.usage.cacheWriteInputTokens\n },\n ...response.usage.cacheDetails != null && {\n cacheDetails: response.usage.cacheDetails\n }\n }\n },\n ...isJsonResponseFromTool && { isJsonResponseFromTool: true },\n stopSequence\n }\n } : void 0;\n return {\n content,\n finishReason: {\n unified: mapBedrockFinishReason(\n response.stopReason,\n isJsonResponseFromTool\n ),\n raw: (_m = response.stopReason) != null ? _m : void 0\n },\n usage: convertBedrockUsage(response.usage),\n response: {\n id: (_n = responseHeaders == null ? void 0 : responseHeaders[\"x-amzn-requestid\"]) != null ? _n : void 0,\n timestamp: (responseHeaders == null ? void 0 : responseHeaders[\"date\"]) != null ? new Date(responseHeaders[\"date\"]) : void 0,\n modelId: this.modelId,\n headers: responseHeaders\n },\n warnings,\n ...providerMetadata && { providerMetadata }\n };\n }\n async doStream(options) {\n const {\n command: args,\n warnings,\n usesJsonResponseTool\n } = await this.getArgs(options);\n const modelId = this.modelId;\n const isMistral = isMistralModel(modelId);\n const url = `${this.getUrl(modelId)}/converse-stream`;\n const { value: response, responseHeaders } = await postJsonToApi({\n url,\n headers: await this.getHeaders({ headers: options.headers }),\n body: args,\n failedResponseHandler: createJsonErrorResponseHandler({\n errorSchema: BedrockErrorSchema,\n errorToMessage: (error) => `${error.type}: ${error.message}`\n }),\n successfulResponseHandler: createBedrockEventStreamResponseHandler(BedrockStreamSchema),\n abortSignal: options.abortSignal,\n fetch: this.config.fetch\n });\n let finishReason = {\n unified: \"other\",\n raw: void 0\n };\n let usage = void 0;\n let providerMetadata = void 0;\n let isJsonResponseFromTool = false;\n let stopSequence = null;\n const contentBlocks = {};\n return {\n stream: response.pipeThrough(\n new TransformStream({\n start(controller) {\n var _a;\n controller.enqueue({ type: \"stream-start\", warnings });\n controller.enqueue({\n type: \"response-metadata\",\n id: (_a = responseHeaders == null ? void 0 : responseHeaders[\"x-amzn-requestid\"]) != null ? _a : void 0,\n timestamp: (responseHeaders == null ? void 0 : responseHeaders[\"date\"]) != null ? new Date(responseHeaders[\"date\"]) : void 0,\n modelId\n });\n },\n transform(chunk, controller) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;\n function enqueueError(bedrockError) {\n finishReason = { unified: \"error\", raw: void 0 };\n controller.enqueue({ type: \"error\", error: bedrockError });\n }\n if (options.includeRawChunks) {\n controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n }\n if (!chunk.success) {\n enqueueError(chunk.error);\n return;\n }\n const value = chunk.value;\n if (value.internalServerException) {\n enqueueError(value.internalServerException);\n return;\n }\n if (value.modelStreamErrorException) {\n enqueueError(value.modelStreamErrorException);\n return;\n }\n if (value.throttlingException) {\n enqueueError(value.throttlingException);\n return;\n }\n if (value.validationException) {\n enqueueError(value.validationException);\n return;\n }\n if (value.messageStop) {\n finishReason = {\n unified: mapBedrockFinishReason(\n value.messageStop.stopReason,\n isJsonResponseFromTool\n ),\n raw: (_a = value.messageStop.stopReason) != null ? _a : void 0\n };\n stopSequence = (_d = (_c = (_b = value.messageStop.additionalModelResponseFields) == null ? void 0 : _b.delta) == null ? void 0 : _c.stop_sequence) != null ? _d : null;\n }\n if (value.metadata) {\n if (value.metadata.usage) {\n usage = value.metadata.usage;\n }\n const cacheUsage = ((_e = value.metadata.usage) == null ? void 0 : _e.cacheWriteInputTokens) != null || ((_f = value.metadata.usage) == null ? void 0 : _f.cacheDetails) != null ? {\n usage: {\n ...((_g = value.metadata.usage) == null ? void 0 : _g.cacheWriteInputTokens) != null && {\n cacheWriteInputTokens: value.metadata.usage.cacheWriteInputTokens\n },\n ...((_h = value.metadata.usage) == null ? void 0 : _h.cacheDetails) != null && {\n cacheDetails: value.metadata.usage.cacheDetails\n }\n }\n } : void 0;\n const trace = value.metadata.trace ? {\n trace: value.metadata.trace\n } : void 0;\n if (cacheUsage || trace || value.metadata.performanceConfig || value.metadata.serviceTier) {\n providerMetadata = {\n bedrock: {\n ...cacheUsage,\n ...trace,\n ...value.metadata.performanceConfig && {\n performanceConfig: value.metadata.performanceConfig\n },\n ...value.metadata.serviceTier && {\n serviceTier: value.metadata.serviceTier\n }\n }\n };\n }\n }\n if (((_i = value.contentBlockStart) == null ? void 0 : _i.contentBlockIndex) != null && !((_k = (_j = value.contentBlockStart) == null ? void 0 : _j.start) == null ? void 0 : _k.toolUse)) {\n const blockIndex = value.contentBlockStart.contentBlockIndex;\n contentBlocks[blockIndex] = { type: \"text\" };\n controller.enqueue({\n type: \"text-start\",\n id: String(blockIndex)\n });\n }\n if (((_l = value.contentBlockDelta) == null ? void 0 : _l.delta) && \"text\" in value.contentBlockDelta.delta && value.contentBlockDelta.delta.text) {\n const blockIndex = value.contentBlockDelta.contentBlockIndex || 0;\n if (contentBlocks[blockIndex] == null) {\n contentBlocks[blockIndex] = { type: \"text\" };\n controller.enqueue({\n type: \"text-start\",\n id: String(blockIndex)\n });\n }\n controller.enqueue({\n type: \"text-delta\",\n id: String(blockIndex),\n delta: value.contentBlockDelta.delta.text\n });\n }\n if (((_m = value.contentBlockStop) == null ? void 0 : _m.contentBlockIndex) != null) {\n const blockIndex = value.contentBlockStop.contentBlockIndex;\n const contentBlock = contentBlocks[blockIndex];\n if (contentBlock != null) {\n if (contentBlock.type === \"reasoning\") {\n controller.enqueue({\n type: \"reasoning-end\",\n id: String(blockIndex)\n });\n } else if (contentBlock.type === \"text\") {\n controller.enqueue({\n type: \"text-end\",\n id: String(blockIndex)\n });\n } else if (contentBlock.type === \"tool-call\") {\n if (contentBlock.isJsonResponseTool) {\n isJsonResponseFromTool = true;\n controller.enqueue({\n type: \"text-start\",\n id: String(blockIndex)\n });\n controller.enqueue({\n type: \"text-delta\",\n id: String(blockIndex),\n delta: contentBlock.jsonText\n });\n controller.enqueue({\n type: \"text-end\",\n id: String(blockIndex)\n });\n } else {\n controller.enqueue({\n type: \"tool-input-end\",\n id: contentBlock.toolCallId\n });\n controller.enqueue({\n type: \"tool-call\",\n toolCallId: contentBlock.toolCallId,\n toolName: contentBlock.toolName,\n input: contentBlock.jsonText === \"\" ? \"{}\" : contentBlock.jsonText\n });\n }\n }\n delete contentBlocks[blockIndex];\n }\n }\n if (((_n = value.contentBlockDelta) == null ? void 0 : _n.delta) && \"reasoningContent\" in value.contentBlockDelta.delta && value.contentBlockDelta.delta.reasoningContent) {\n const blockIndex = value.contentBlockDelta.contentBlockIndex || 0;\n const reasoningContent = value.contentBlockDelta.delta.reasoningContent;\n if (\"text\" in reasoningContent && reasoningContent.text) {\n if (contentBlocks[blockIndex] == null) {\n contentBlocks[blockIndex] = { type: \"reasoning\" };\n controller.enqueue({\n type: \"reasoning-start\",\n id: String(blockIndex)\n });\n }\n controller.enqueue({\n type: \"reasoning-delta\",\n id: String(blockIndex),\n delta: reasoningContent.text\n });\n } else if (\"signature\" in reasoningContent && reasoningContent.signature) {\n if (contentBlocks[blockIndex] == null) {\n contentBlocks[blockIndex] = { type: \"reasoning\" };\n controller.enqueue({\n type: \"reasoning-start\",\n id: String(blockIndex)\n });\n }\n controller.enqueue({\n type: \"reasoning-delta\",\n id: String(blockIndex),\n delta: \"\",\n providerMetadata: {\n bedrock: {\n signature: reasoningContent.signature\n }\n }\n });\n } else if (\"data\" in reasoningContent && reasoningContent.data) {\n if (contentBlocks[blockIndex] == null) {\n contentBlocks[blockIndex] = { type: \"reasoning\" };\n controller.enqueue({\n type: \"reasoning-start\",\n id: String(blockIndex)\n });\n }\n controller.enqueue({\n type: \"reasoning-delta\",\n id: String(blockIndex),\n delta: \"\",\n providerMetadata: {\n bedrock: {\n redactedData: reasoningContent.data\n }\n }\n });\n }\n }\n const contentBlockStart = value.contentBlockStart;\n if (((_o = contentBlockStart == null ? void 0 : contentBlockStart.start) == null ? void 0 : _o.toolUse) != null) {\n const toolUse = contentBlockStart.start.toolUse;\n const blockIndex = contentBlockStart.contentBlockIndex;\n const isJsonResponseTool = usesJsonResponseTool && toolUse.name === \"json\";\n const normalizedToolCallId = normalizeToolCallId(\n toolUse.toolUseId,\n isMistral\n );\n contentBlocks[blockIndex] = {\n type: \"tool-call\",\n toolCallId: normalizedToolCallId,\n toolName: toolUse.name,\n jsonText: \"\",\n isJsonResponseTool\n };\n if (!isJsonResponseTool) {\n controller.enqueue({\n type: \"tool-input-start\",\n id: normalizedToolCallId,\n toolName: toolUse.name\n });\n }\n }\n const contentBlockDelta = value.contentBlockDelta;\n if ((contentBlockDelta == null ? void 0 : contentBlockDelta.delta) && \"toolUse\" in contentBlockDelta.delta && contentBlockDelta.delta.toolUse) {\n const blockIndex = contentBlockDelta.contentBlockIndex;\n const contentBlock = contentBlocks[blockIndex];\n if ((contentBlock == null ? void 0 : contentBlock.type) === \"tool-call\") {\n const delta = (_p = contentBlockDelta.delta.toolUse.input) != null ? _p : \"\";\n if (!contentBlock.isJsonResponseTool) {\n controller.enqueue({\n type: \"tool-input-delta\",\n id: contentBlock.toolCallId,\n delta\n });\n }\n contentBlock.jsonText += delta;\n }\n }\n },\n flush(controller) {\n if (isJsonResponseFromTool || stopSequence != null) {\n if (providerMetadata) {\n providerMetadata.bedrock = {\n ...providerMetadata.bedrock,\n ...isJsonResponseFromTool && {\n isJsonResponseFromTool: true\n },\n stopSequence\n };\n } else {\n providerMetadata = {\n bedrock: {\n ...isJsonResponseFromTool && {\n isJsonResponseFromTool: true\n },\n stopSequence\n }\n };\n }\n }\n controller.enqueue({\n type: \"finish\",\n finishReason,\n usage: convertBedrockUsage(usage),\n ...providerMetadata && { providerMetadata }\n });\n }\n })\n ),\n // TODO request?\n response: { headers: responseHeaders }\n };\n }\n getUrl(modelId) {\n const encodedModelId = encodeURIComponent(modelId);\n return `${this.config.baseUrl()}/model/${encodedModelId}`;\n }\n};\nvar BedrockStopReasonSchema = z4.union([\n z4.enum(BEDROCK_STOP_REASONS),\n z4.string()\n]);\nvar BedrockAdditionalModelResponseFieldsSchema = z4.object({\n delta: z4.object({\n stop_sequence: z4.string().nullish()\n }).nullish()\n}).catchall(z4.unknown());\nvar BedrockToolUseSchema = z4.object({\n toolUseId: z4.string(),\n name: z4.string(),\n input: z4.unknown().optional()\n});\nvar BedrockReasoningTextSchema = z4.object({\n signature: z4.string().nullish(),\n text: z4.string()\n});\nvar BedrockRedactedReasoningSchema = z4.object({\n data: z4.string()\n});\nvar BedrockResponseSchema = z4.object({\n metrics: z4.object({\n latencyMs: z4.number()\n }).nullish(),\n output: z4.object({\n message: z4.object({\n content: z4.array(\n z4.object({\n text: z4.string().nullish(),\n toolUse: BedrockToolUseSchema.nullish(),\n reasoningContent: z4.union([\n z4.object({\n reasoningText: BedrockReasoningTextSchema\n }),\n z4.object({\n redactedReasoning: BedrockRedactedReasoningSchema\n })\n ]).nullish()\n })\n ),\n role: z4.string()\n })\n }),\n stopReason: BedrockStopReasonSchema,\n additionalModelResponseFields: BedrockAdditionalModelResponseFieldsSchema.nullish(),\n trace: z4.unknown().nullish(),\n performanceConfig: z4.object({ latency: z4.string() }).nullish(),\n serviceTier: z4.object({ type: z4.string() }).nullish(),\n usage: z4.object({\n inputTokens: z4.number(),\n outputTokens: z4.number(),\n totalTokens: z4.number(),\n cacheReadInputTokens: z4.number().nullish(),\n cacheWriteInputTokens: z4.number().nullish(),\n cacheDetails: z4.array(z4.object({ inputTokens: z4.number(), ttl: z4.string() })).nullish()\n })\n});\nvar BedrockStreamSchema = z4.object({\n contentBlockDelta: z4.object({\n contentBlockIndex: z4.number(),\n delta: z4.union([\n z4.object({ text: z4.string() }),\n z4.object({ toolUse: z4.object({ input: z4.string() }) }),\n z4.object({\n reasoningContent: z4.object({ text: z4.string() })\n }),\n z4.object({\n reasoningContent: z4.object({\n signature: z4.string()\n })\n }),\n z4.object({\n reasoningContent: z4.object({ data: z4.string() })\n })\n ]).nullish()\n }).nullish(),\n contentBlockStart: z4.object({\n contentBlockIndex: z4.number(),\n start: z4.object({\n toolUse: BedrockToolUseSchema.nullish()\n }).nullish()\n }).nullish(),\n contentBlockStop: z4.object({\n contentBlockIndex: z4.number()\n }).nullish(),\n internalServerException: z4.record(z4.string(), z4.unknown()).nullish(),\n messageStop: z4.object({\n additionalModelResponseFields: BedrockAdditionalModelResponseFieldsSchema.nullish(),\n stopReason: BedrockStopReasonSchema\n }).nullish(),\n metadata: z4.object({\n trace: z4.unknown().nullish(),\n performanceConfig: z4.object({ latency: z4.string() }).nullish(),\n serviceTier: z4.object({ type: z4.string() }).nullish(),\n usage: z4.object({\n cacheReadInputTokens: z4.number().nullish(),\n cacheWriteInputTokens: z4.number().nullish(),\n cacheDetails: z4.array(z4.object({ inputTokens: z4.number(), ttl: z4.string() })).nullish(),\n inputTokens: z4.number(),\n outputTokens: z4.number()\n }).nullish()\n }).nullish(),\n modelStreamErrorException: z4.record(z4.string(), z4.unknown()).nullish(),\n throttlingException: z4.record(z4.string(), z4.unknown()).nullish(),\n validationException: z4.record(z4.string(), z4.unknown()).nullish()\n});\n\n// src/bedrock-embedding-model.ts\nimport {\n TooManyEmbeddingValuesForCallError\n} from \"@ai-sdk/provider\";\nimport {\n combineHeaders as combineHeaders2,\n createJsonErrorResponseHandler as createJsonErrorResponseHandler2,\n createJsonResponseHandler as createJsonResponseHandler2,\n parseProviderOptions as parseProviderOptions3,\n postJsonToApi as postJsonToApi2,\n resolve as resolve2\n} from \"@ai-sdk/provider-utils\";\n\n// src/bedrock-embedding-options.ts\nimport { z as z5 } from \"zod/v4\";\nvar amazonBedrockEmbeddingModelOptionsSchema = z5.object({\n /**\n * The number of dimensions the resulting output embeddings should have (defaults to 1024).\n * Only supported in amazon.titan-embed-text-v2:0.\n */\n dimensions: z5.union([z5.literal(1024), z5.literal(512), z5.literal(256)]).optional(),\n /**\n * Flag indicating whether or not to normalize the output embeddings. Defaults to true.\n * Only supported in amazon.titan-embed-text-v2:0.\n */\n normalize: z5.boolean().optional(),\n /**\n * The number of dimensions for Nova embedding models (defaults to 1024).\n * Supported values: 256, 384, 1024, 3072.\n * Only supported in amazon.nova-* embedding models.\n */\n embeddingDimension: z5.union([z5.literal(256), z5.literal(384), z5.literal(1024), z5.literal(3072)]).optional(),\n /**\n * The purpose of the embedding. Defaults to 'GENERIC_INDEX'.\n * Only supported in amazon.nova-* embedding models.\n */\n embeddingPurpose: z5.enum([\n \"GENERIC_INDEX\",\n \"TEXT_RETRIEVAL\",\n \"IMAGE_RETRIEVAL\",\n \"VIDEO_RETRIEVAL\",\n \"DOCUMENT_RETRIEVAL\",\n \"AUDIO_RETRIEVAL\",\n \"GENERIC_RETRIEVAL\",\n \"CLASSIFICATION\",\n \"CLUSTERING\"\n ]).optional(),\n /**\n * Input type for Cohere embedding models on Bedrock.\n * Common values: `search_document`, `search_query`, `classification`, `clustering`.\n * If not set, the provider defaults to `search_query`.\n */\n inputType: z5.enum([\"search_document\", \"search_query\", \"classification\", \"clustering\"]).optional(),\n /**\n * Truncation behavior when input exceeds the model's context length.\n * Supported in Cohere and Nova embedding models. Defaults to 'END' for Nova models.\n */\n truncate: z5.enum([\"NONE\", \"START\", \"END\"]).optional(),\n /**\n * The number of dimensions the resulting output embeddings should have (defaults to 1536).\n * Only supported in cohere.embed-v4:0 and newer Cohere embedding models.\n */\n outputDimension: z5.union([z5.literal(256), z5.literal(512), z5.literal(1024), z5.literal(1536)]).optional()\n});\n\n// src/bedrock-embedding-model.ts\nimport { z as z6 } from \"zod/v4\";\nvar BedrockEmbeddingModel = class {\n constructor(modelId, config) {\n this.modelId = modelId;\n this.config = config;\n this.specificationVersion = \"v3\";\n this.provider = \"amazon-bedrock\";\n this.maxEmbeddingsPerCall = 1;\n this.supportsParallelCalls = true;\n }\n getUrl(modelId) {\n const encodedModelId = encodeURIComponent(modelId);\n return `${this.config.baseUrl()}/model/${encodedModelId}/invoke`;\n }\n async doEmbed({\n values,\n headers,\n abortSignal,\n providerOptions\n }) {\n var _a, _b, _c, _d, _e, _f;\n if (values.length > this.maxEmbeddingsPerCall) {\n throw new TooManyEmbeddingValuesForCallError({\n provider: this.provider,\n modelId: this.modelId,\n maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n values\n });\n }\n const bedrockOptions = (_a = await parseProviderOptions3({\n provider: \"bedrock\",\n providerOptions,\n schema: amazonBedrockEmbeddingModelOptionsSchema\n })) != null ? _a : {};\n const isNovaModel = this.modelId.startsWith(\"amazon.nova-\") && this.modelId.includes(\"embed\");\n const isCohereModel = this.modelId.startsWith(\"cohere.embed-\");\n const args = isNovaModel ? {\n taskType: \"SINGLE_EMBEDDING\",\n singleEmbeddingParams: {\n embeddingPurpose: (_b = bedrockOptions.embeddingPurpose) != null ? _b : \"GENERIC_INDEX\",\n embeddingDimension: (_c = bedrockOptions.embeddingDimension) != null ? _c : 1024,\n text: {\n truncationMode: (_d = bedrockOptions.truncate) != null ? _d : \"END\",\n value: values[0]\n }\n }\n } : isCohereModel ? {\n // Cohere embedding models on Bedrock require `input_type`.\n // Without it, the service attempts other schema branches and rejects the request.\n input_type: (_e = bedrockOptions.inputType) != null ? _e : \"search_query\",\n texts: [values[0]],\n truncate: bedrockOptions.truncate,\n output_dimension: bedrockOptions.outputDimension\n } : {\n inputText: values[0],\n dimensions: bedrockOptions.dimensions,\n normalize: bedrockOptions.normalize\n };\n const url = this.getUrl(this.modelId);\n const { value: response } = await postJsonToApi2({\n url,\n headers: await resolve2(\n combineHeaders2(await resolve2(this.config.headers), headers)\n ),\n body: args,\n failedResponseHandler: createJsonErrorResponseHandler2({\n errorSchema: BedrockErrorSchema,\n errorToMessage: (error) => `${error.type}: ${error.message}`\n }),\n successfulResponseHandler: createJsonResponseHandler2(\n BedrockEmbeddingResponseSchema\n ),\n fetch: this.config.fetch,\n abortSignal\n });\n let embedding;\n if (\"embedding\" in response) {\n embedding = response.embedding;\n } else if (Array.isArray(response.embeddings)) {\n const firstEmbedding = response.embeddings[0];\n if (typeof firstEmbedding === \"object\" && firstEmbedding !== null && \"embeddingType\" in firstEmbedding) {\n embedding = firstEmbedding.embedding;\n } else {\n embedding = firstEmbedding;\n }\n } else {\n embedding = response.embeddings.float[0];\n }\n const tokens = \"inputTextTokenCount\" in response ? response.inputTextTokenCount : \"inputTokenCount\" in response ? (_f = response.inputTokenCount) != null ? _f : 0 : NaN;\n return {\n embeddings: [embedding],\n usage: { tokens },\n warnings: []\n };\n }\n};\nvar BedrockEmbeddingResponseSchema = z6.union([\n // Titan-style response\n z6.object({\n embedding: z6.array(z6.number()),\n inputTextTokenCount: z6.number()\n }),\n // Nova-style response\n z6.object({\n embeddings: z6.array(\n z6.object({\n embeddingType: z6.string(),\n embedding: z6.array(z6.number())\n })\n ),\n inputTokenCount: z6.number().optional()\n }),\n // Cohere v3-style response\n z6.object({\n embeddings: z6.array(z6.array(z6.number()))\n }),\n // Cohere v4-style response\n z6.object({\n embeddings: z6.object({\n float: z6.array(z6.array(z6.number()))\n })\n })\n]);\n\n// src/bedrock-image-model.ts\nimport {\n combineHeaders as combineHeaders3,\n convertUint8ArrayToBase64,\n createJsonErrorResponseHandler as createJsonErrorResponseHandler3,\n createJsonResponseHandler as createJsonResponseHandler3,\n postJsonToApi as postJsonToApi3,\n resolve as resolve3\n} from \"@ai-sdk/provider-utils\";\n\n// src/bedrock-image-settings.ts\nvar modelMaxImagesPerCall = {\n \"amazon.nova-canvas-v1:0\": 5\n};\n\n// src/bedrock-image-model.ts\nimport { z as z7 } from \"zod/v4\";\nvar BedrockImageModel = class {\n constructor(modelId, config) {\n this.modelId = modelId;\n this.config = config;\n this.specificationVersion = \"v3\";\n this.provider = \"amazon-bedrock\";\n }\n get maxImagesPerCall() {\n var _a;\n return (_a = modelMaxImagesPerCall[this.modelId]) != null ? _a : 1;\n }\n getUrl(modelId) {\n const encodedModelId = encodeURIComponent(modelId);\n return `${this.config.baseUrl()}/model/${encodedModelId}/invoke`;\n }\n async doGenerate({\n prompt,\n n,\n size,\n aspectRatio,\n seed,\n providerOptions,\n headers,\n abortSignal,\n files,\n mask\n }) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;\n const warnings = [];\n const [width, height] = size ? size.split(\"x\").map(Number) : [];\n const hasFiles = files != null && files.length > 0;\n const imageGenerationConfig = {\n ...width ? { width } : {},\n ...height ? { height } : {},\n ...seed ? { seed } : {},\n ...n ? { numberOfImages: n } : {},\n ...((_a = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _a.quality) ? { quality: providerOptions.bedrock.quality } : {},\n ...((_b = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _b.cfgScale) ? { cfgScale: providerOptions.bedrock.cfgScale } : {}\n };\n let args;\n if (hasFiles) {\n const hasMask = (mask == null ? void 0 : mask.type) != null;\n const hasMaskPrompt = ((_c = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _c.maskPrompt) != null;\n const taskType = (_e = (_d = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _d.taskType) != null ? _e : hasMask || hasMaskPrompt ? \"INPAINTING\" : \"IMAGE_VARIATION\";\n const sourceImageBase64 = getBase64Data(files[0]);\n switch (taskType) {\n case \"INPAINTING\": {\n const inPaintingParams = {\n image: sourceImageBase64,\n ...prompt ? { text: prompt } : {},\n ...((_f = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _f.negativeText) ? { negativeText: providerOptions.bedrock.negativeText } : {}\n };\n if (hasMask) {\n inPaintingParams.maskImage = getBase64Data(mask);\n } else if (hasMaskPrompt) {\n inPaintingParams.maskPrompt = providerOptions.bedrock.maskPrompt;\n }\n args = {\n taskType: \"INPAINTING\",\n inPaintingParams,\n imageGenerationConfig\n };\n break;\n }\n case \"OUTPAINTING\": {\n const outPaintingParams = {\n image: sourceImageBase64,\n ...prompt ? { text: prompt } : {},\n ...((_g = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _g.negativeText) ? { negativeText: providerOptions.bedrock.negativeText } : {},\n ...((_h = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _h.outPaintingMode) ? { outPaintingMode: providerOptions.bedrock.outPaintingMode } : {}\n };\n if (hasMask) {\n outPaintingParams.maskImage = getBase64Data(mask);\n } else if (hasMaskPrompt) {\n outPaintingParams.maskPrompt = providerOptions.bedrock.maskPrompt;\n }\n args = {\n taskType: \"OUTPAINTING\",\n outPaintingParams,\n imageGenerationConfig\n };\n break;\n }\n case \"BACKGROUND_REMOVAL\": {\n args = {\n taskType: \"BACKGROUND_REMOVAL\",\n backgroundRemovalParams: {\n image: sourceImageBase64\n }\n };\n break;\n }\n case \"IMAGE_VARIATION\": {\n const images = files.map((file) => getBase64Data(file));\n const imageVariationParams = {\n images,\n ...prompt ? { text: prompt } : {},\n ...((_i = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _i.negativeText) ? { negativeText: providerOptions.bedrock.negativeText } : {},\n ...((_j = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _j.similarityStrength) != null ? {\n similarityStrength: providerOptions.bedrock.similarityStrength\n } : {}\n };\n args = {\n taskType: \"IMAGE_VARIATION\",\n imageVariationParams,\n imageGenerationConfig\n };\n break;\n }\n default:\n throw new Error(`Unsupported task type: ${taskType}`);\n }\n } else {\n args = {\n taskType: \"TEXT_IMAGE\",\n textToImageParams: {\n text: prompt,\n ...((_k = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _k.negativeText) ? {\n negativeText: providerOptions.bedrock.negativeText\n } : {},\n ...((_l = providerOptions == null ? void 0 : providerOptions.bedrock) == null ? void 0 : _l.style) ? {\n style: providerOptions.bedrock.style\n } : {}\n },\n imageGenerationConfig\n };\n }\n if (aspectRatio != void 0) {\n warnings.push({\n type: \"unsupported\",\n feature: \"aspectRatio\",\n details: \"This model does not support aspect ratio. Use `size` instead.\"\n });\n }\n const currentDate = (_o = (_n = (_m = this.config._internal) == null ? void 0 : _m.currentDate) == null ? void 0 : _n.call(_m)) != null ? _o : /* @__PURE__ */ new Date();\n const { value: response, responseHeaders } = await postJsonToApi3({\n url: this.getUrl(this.modelId),\n headers: await resolve3(\n combineHeaders3(await resolve3(this.config.headers), headers)\n ),\n body: args,\n failedResponseHandler: createJsonErrorResponseHandler3({\n errorSchema: BedrockErrorSchema,\n errorToMessage: (error) => `${error.type}: ${error.message}`\n }),\n successfulResponseHandler: createJsonResponseHandler3(\n bedrockImageResponseSchema\n ),\n abortSignal,\n fetch: this.config.fetch\n });\n if (response.status === \"Request Moderated\") {\n const moderationReasons = (_p = response.details) == null ? void 0 : _p[\"Moderation Reasons\"];\n const reasons = Array.isArray(moderationReasons) ? moderationReasons : [\"Unknown\"];\n throw new Error(\n `Amazon Bedrock request was moderated: ${reasons.join(\", \")}`\n );\n }\n if (!response.images || response.images.length === 0) {\n throw new Error(\n \"Amazon Bedrock returned no images. \" + (response.status ? `Status: ${response.status}` : \"\")\n );\n }\n return {\n images: response.images,\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders\n }\n };\n }\n};\nfunction getBase64Data(file) {\n if (file.type === \"url\") {\n throw new Error(\n \"URL-based images are not supported for Amazon Bedrock image editing. Please provide the image data directly.\"\n );\n }\n if (file.data instanceof Uint8Array) {\n return convertUint8ArrayToBase64(file.data);\n }\n return file.data;\n}\nvar bedrockImageResponseSchema = z7.object({\n // Normal successful response\n images: z7.array(z7.string()).optional(),\n // Moderation response fields\n id: z7.string().optional(),\n status: z7.string().optional(),\n result: z7.unknown().optional(),\n progress: z7.unknown().optional(),\n details: z7.record(z7.string(), z7.unknown()).optional(),\n preview: z7.unknown().optional()\n});\n\n// src/bedrock-sigv4-fetch.ts\nimport {\n combineHeaders as combineHeaders4,\n normalizeHeaders,\n withUserAgentSuffix,\n getRuntimeEnvironmentUserAgent\n} from \"@ai-sdk/provider-utils\";\nimport { AwsV4Signer } from \"aws4fetch\";\n\n// src/version.ts\nvar VERSION = true ? \"4.0.112\" : \"0.0.0-test\";\n\n// src/bedrock-sigv4-fetch.ts\nfunction createSigV4FetchFunction(getCredentials, fetch, service = \"bedrock\") {\n return async (input, init) => {\n var _a, _b;\n const effectiveFetch = fetch != null ? fetch : globalThis.fetch;\n const request = input instanceof Request ? input : void 0;\n const originalHeaders = combineHeaders4(\n normalizeHeaders(request == null ? void 0 : request.headers),\n normalizeHeaders(init == null ? void 0 : init.headers)\n );\n const headersWithUserAgent = withUserAgentSuffix(\n originalHeaders,\n `ai-sdk/amazon-bedrock/${VERSION}`,\n getRuntimeEnvironmentUserAgent()\n );\n let effectiveBody = (_a = init == null ? void 0 : init.body) != null ? _a : void 0;\n if (effectiveBody === void 0 && request && request.body !== null) {\n try {\n effectiveBody = await request.clone().text();\n } catch (e) {\n }\n }\n const effectiveMethod = (_b = init == null ? void 0 : init.method) != null ? _b : request == null ? void 0 : request.method;\n if ((effectiveMethod == null ? void 0 : effectiveMethod.toUpperCase()) !== \"POST\" || !effectiveBody) {\n return effectiveFetch(input, {\n ...init,\n headers: headersWithUserAgent\n });\n }\n const url = typeof input === \"string\" ? input : input instanceof URL ? input.href : input.url;\n const body = prepareBodyString(effectiveBody);\n const credentials = await getCredentials();\n const signer = new AwsV4Signer({\n url,\n method: \"POST\",\n headers: Object.entries(headersWithUserAgent),\n body,\n region: credentials.region,\n accessKeyId: credentials.accessKeyId,\n secretAccessKey: credentials.secretAccessKey,\n sessionToken: credentials.sessionToken,\n service\n });\n const signingResult = await signer.sign();\n const signedHeaders = normalizeHeaders(signingResult.headers);\n const combinedHeaders = combineHeaders4(headersWithUserAgent, signedHeaders);\n return effectiveFetch(input, {\n ...init,\n body,\n headers: combinedHeaders\n });\n };\n}\nfunction prepareBodyString(body) {\n if (typeof body === \"string\") {\n return body;\n } else if (body instanceof Uint8Array) {\n return new TextDecoder().decode(body);\n } else if (body instanceof ArrayBuffer) {\n return new TextDecoder().decode(new Uint8Array(body));\n } else {\n return JSON.stringify(body);\n }\n}\nfunction createApiKeyFetchFunction(apiKey, fetch) {\n return async (input, init) => {\n const effectiveFetch = fetch != null ? fetch : globalThis.fetch;\n const originalHeaders = normalizeHeaders(init == null ? void 0 : init.headers);\n const headersWithUserAgent = withUserAgentSuffix(\n originalHeaders,\n `ai-sdk/amazon-bedrock/${VERSION}`,\n getRuntimeEnvironmentUserAgent()\n );\n const finalHeaders = combineHeaders4(headersWithUserAgent, {\n Authorization: `Bearer ${apiKey}`\n });\n return effectiveFetch(input, {\n ...init,\n headers: finalHeaders\n });\n };\n}\n\n// src/reranking/bedrock-reranking-model.ts\nimport {\n combineHeaders as combineHeaders5,\n createJsonErrorResponseHandler as createJsonErrorResponseHandler4,\n createJsonResponseHandler as createJsonResponseHandler4,\n parseProviderOptions as parseProviderOptions4,\n postJsonToApi as postJsonToApi4,\n resolve as resolve4\n} from \"@ai-sdk/provider-utils\";\n\n// src/reranking/bedrock-reranking-api.ts\nimport { lazySchema, zodSchema } from \"@ai-sdk/provider-utils\";\nimport { z as z8 } from \"zod/v4\";\nvar bedrockRerankingResponseSchema = lazySchema(\n () => zodSchema(\n z8.object({\n results: z8.array(\n z8.object({\n index: z8.number(),\n relevanceScore: z8.number()\n })\n ),\n nextToken: z8.string().optional()\n })\n )\n);\n\n// src/reranking/bedrock-reranking-options.ts\nimport { lazySchema as lazySchema2, zodSchema as zodSchema2 } from \"@ai-sdk/provider-utils\";\nimport { z as z9 } from \"zod/v4\";\nvar amazonBedrockRerankingModelOptionsSchema = lazySchema2(\n () => zodSchema2(\n z9.object({\n /**\n * If the total number of results was greater than could fit in a response, a token is returned in the nextToken field. You can enter that token in this field to return the next batch of results.\n */\n nextToken: z9.string().optional(),\n /**\n * Additional model request fields to pass to the model.\n */\n additionalModelRequestFields: z9.record(z9.string(), z9.any()).optional()\n })\n )\n);\n\n// src/reranking/bedrock-reranking-model.ts\nvar BedrockRerankingModel = class {\n constructor(modelId, config) {\n this.modelId = modelId;\n this.config = config;\n this.specificationVersion = \"v3\";\n this.provider = \"amazon-bedrock\";\n }\n async doRerank({\n documents,\n headers,\n query,\n topN,\n abortSignal,\n providerOptions\n }) {\n const bedrockOptions = await parseProviderOptions4({\n provider: \"bedrock\",\n providerOptions,\n schema: amazonBedrockRerankingModelOptionsSchema\n });\n const {\n value: response,\n responseHeaders,\n rawValue\n } = await postJsonToApi4({\n url: `${this.config.baseUrl()}/rerank`,\n headers: await resolve4(\n combineHeaders5(await resolve4(this.config.headers), headers)\n ),\n body: {\n nextToken: bedrockOptions == null ? void 0 : bedrockOptions.nextToken,\n queries: [\n {\n textQuery: { text: query },\n type: \"TEXT\"\n }\n ],\n rerankingConfiguration: {\n bedrockRerankingConfiguration: {\n modelConfiguration: {\n modelArn: `arn:aws:bedrock:${this.config.region}::foundation-model/${this.modelId}`,\n additionalModelRequestFields: bedrockOptions == null ? void 0 : bedrockOptions.additionalModelRequestFields\n },\n numberOfResults: topN\n },\n type: \"BEDROCK_RERANKING_MODEL\"\n },\n sources: documents.values.map((value) => ({\n type: \"INLINE\",\n inlineDocumentSource: documents.type === \"text\" ? {\n type: \"TEXT\",\n textDocument: { text: value }\n } : {\n type: \"JSON\",\n jsonDocument: value\n }\n }))\n },\n failedResponseHandler: createJsonErrorResponseHandler4({\n errorSchema: BedrockErrorSchema,\n errorToMessage: (error) => `${error.type}: ${error.message}`\n }),\n successfulResponseHandler: createJsonResponseHandler4(\n bedrockRerankingResponseSchema\n ),\n fetch: this.config.fetch,\n abortSignal\n });\n return {\n ranking: response.results,\n response: {\n headers: responseHeaders,\n body: rawValue\n }\n };\n }\n};\n\n// src/bedrock-provider.ts\nfunction createAmazonBedrock(options = {}) {\n const rawApiKey = loadOptionalSetting({\n settingValue: options.apiKey,\n environmentVariableName: \"AWS_BEARER_TOKEN_BEDROCK\"\n });\n const apiKey = rawApiKey && rawApiKey.trim().length > 0 ? rawApiKey.trim() : void 0;\n const fetchFunction = apiKey ? createApiKeyFetchFunction(apiKey, options.fetch) : createSigV4FetchFunction(async () => {\n const region = loadSetting({\n settingValue: options.region,\n settingName: \"region\",\n environmentVariableName: \"AWS_REGION\",\n description: \"AWS region\"\n });\n if (options.credentialProvider) {\n try {\n return {\n ...await options.credentialProvider(),\n region\n };\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(\n `AWS credential provider failed: ${errorMessage}. Please ensure your credential provider returns valid AWS credentials with accessKeyId and secretAccessKey properties.`\n );\n }\n }\n try {\n return {\n region,\n accessKeyId: loadSetting({\n settingValue: options.accessKeyId,\n settingName: \"accessKeyId\",\n environmentVariableName: \"AWS_ACCESS_KEY_ID\",\n description: \"AWS access key ID\"\n }),\n secretAccessKey: loadSetting({\n settingValue: options.secretAccessKey,\n settingName: \"secretAccessKey\",\n environmentVariableName: \"AWS_SECRET_ACCESS_KEY\",\n description: \"AWS secret access key\"\n }),\n sessionToken: options.accessKeyId != null && options.secretAccessKey != null ? options.sessionToken : loadOptionalSetting({\n settingValue: options.sessionToken,\n environmentVariableName: \"AWS_SESSION_TOKEN\"\n })\n };\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n if (errorMessage.includes(\"AWS_ACCESS_KEY_ID\") || errorMessage.includes(\"accessKeyId\")) {\n throw new Error(\n `AWS SigV4 authentication requires AWS credentials. Please provide either:\n1. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables\n2. Provide accessKeyId and secretAccessKey in options\n3. Use a credentialProvider function\n4. Use API key authentication with AWS_BEARER_TOKEN_BEDROCK or apiKey option\nOriginal error: ${errorMessage}`\n );\n }\n if (errorMessage.includes(\"AWS_SECRET_ACCESS_KEY\") || errorMessage.includes(\"secretAccessKey\")) {\n throw new Error(\n `AWS SigV4 authentication requires both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. Please ensure both credentials are provided.\nOriginal error: ${errorMessage}`\n );\n }\n throw error;\n }\n }, options.fetch);\n const getHeaders = () => {\n var _a;\n const baseHeaders = (_a = options.headers) != null ? _a : {};\n return withUserAgentSuffix2(baseHeaders, `ai-sdk/amazon-bedrock/${VERSION}`);\n };\n const getBedrockRuntimeBaseUrl = () => {\n var _a, _b;\n return (_b = withoutTrailingSlash(\n (_a = options.baseURL) != null ? _a : `https://bedrock-runtime.${loadSetting({\n settingValue: options.region,\n settingName: \"region\",\n environmentVariableName: \"AWS_REGION\",\n description: \"AWS region\"\n })}.amazonaws.com`\n )) != null ? _b : `https://bedrock-runtime.us-east-1.amazonaws.com`;\n };\n const getBedrockAgentRuntimeBaseUrl = () => {\n var _a, _b;\n return (_b = withoutTrailingSlash(\n (_a = options.baseURL) != null ? _a : `https://bedrock-agent-runtime.${loadSetting({\n settingValue: options.region,\n settingName: \"region\",\n environmentVariableName: \"AWS_REGION\",\n description: \"AWS region\"\n })}.amazonaws.com`\n )) != null ? _b : `https://bedrock-agent-runtime.us-west-2.amazonaws.com`;\n };\n const createChatModel = (modelId) => new BedrockChatLanguageModel(modelId, {\n baseUrl: getBedrockRuntimeBaseUrl,\n headers: getHeaders,\n fetch: fetchFunction,\n generateId\n });\n const provider = function(modelId) {\n if (new.target) {\n throw new Error(\n \"The Amazon Bedrock model function cannot be called with the new keyword.\"\n );\n }\n return createChatModel(modelId);\n };\n const createEmbeddingModel = (modelId) => new BedrockEmbeddingModel(modelId, {\n baseUrl: getBedrockRuntimeBaseUrl,\n headers: getHeaders,\n fetch: fetchFunction\n });\n const createImageModel = (modelId) => new BedrockImageModel(modelId, {\n baseUrl: getBedrockRuntimeBaseUrl,\n headers: getHeaders,\n fetch: fetchFunction\n });\n const createRerankingModel = (modelId) => new BedrockRerankingModel(modelId, {\n baseUrl: getBedrockAgentRuntimeBaseUrl,\n region: loadSetting({\n settingValue: options.region,\n settingName: \"region\",\n environmentVariableName: \"AWS_REGION\",\n description: \"AWS region\"\n }),\n headers: getHeaders,\n fetch: fetchFunction\n });\n provider.specificationVersion = \"v3\";\n provider.languageModel = createChatModel;\n provider.embedding = createEmbeddingModel;\n provider.embeddingModel = createEmbeddingModel;\n provider.textEmbedding = createEmbeddingModel;\n provider.textEmbeddingModel = createEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n provider.reranking = createRerankingModel;\n provider.rerankingModel = createRerankingModel;\n provider.tools = anthropicTools2;\n return provider;\n}\nvar bedrock = createAmazonBedrock();\nexport {\n VERSION,\n bedrock,\n createAmazonBedrock\n};\n//# sourceMappingURL=index.mjs.map"
|
|
15
|
+
],
|
|
16
|
+
"mappings": ";shBAsBA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