@ai-sdk/anthropic 4.0.59 → 4.0.61

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/dist/index.js CHANGED
@@ -272,7 +272,7 @@ var anthropicResponseSchema = lazySchema3(
272
272
  }),
273
273
  z3.object({
274
274
  type: z3.literal("compaction"),
275
- content: z3.string()
275
+ content: z3.string().nullish()
276
276
  }),
277
277
  z3.object({
278
278
  type: z3.literal("tool_use"),
@@ -280,7 +280,9 @@ var anthropicResponseSchema = lazySchema3(
280
280
  name: z3.string(),
281
281
  input: z3.unknown(),
282
282
  // Programmatic tool calling: caller info when triggered from code execution
283
- caller: anthropicToolCallCallerSchema.optional()
283
+ caller: anthropicToolCallCallerSchema.optional(),
284
+ // Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
285
+ toolset_name: z3.string().nullish()
284
286
  }),
285
287
  z3.object({
286
288
  type: z3.literal("server_tool_use"),
@@ -583,7 +585,8 @@ var anthropicChunkSchema = lazySchema3(
583
585
  id: z3.string(),
584
586
  name: z3.string(),
585
587
  input: z3.unknown(),
586
- caller: anthropicToolCallCallerSchema.optional()
588
+ caller: anthropicToolCallCallerSchema.optional(),
589
+ toolset_name: z3.string().nullish()
587
590
  })
588
591
  ])
589
592
  ).nullish(),
@@ -614,7 +617,9 @@ var anthropicChunkSchema = lazySchema3(
614
617
  // Programmatic tool calling: input may be present directly for deferred tool calls
615
618
  input: z3.record(z3.string(), z3.unknown()).optional(),
616
619
  // Programmatic tool calling: caller info when triggered from code execution
617
- caller: anthropicToolCallCallerSchema.optional()
620
+ caller: anthropicToolCallCallerSchema.optional(),
621
+ // Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
622
+ toolset_name: z3.string().nullish()
618
623
  }),
619
624
  z3.object({
620
625
  type: z3.literal("redacted_thinking"),
@@ -1007,8 +1012,8 @@ var anthropicSystemMessageProviderOptions = z4.object({
1007
1012
  clearAt: z4.literal("next_user_message").optional(),
1008
1013
  /**
1009
1014
  * Sets the model effort for the turn that follows this mid-conversation
1010
- * system message. The required `mid-conversation-effort-2026-08-01` beta
1011
- * is added automatically.
1015
+ * system message. The required `mid-conversation-output-config-2026-07-01`
1016
+ * beta is added automatically.
1012
1017
  */
1013
1018
  effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
1014
1019
  /**
@@ -1058,6 +1063,11 @@ var anthropicLanguageModelOptions = z4.object({
1058
1063
  *
1059
1064
  * When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
1060
1065
  * Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
1066
+ *
1067
+ * Models that always use adaptive thinking (e.g. `claude-opus-5-5`,
1068
+ * `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
1069
+ * provider drops the unsupported setting, emits a warning, and sends an
1070
+ * adaptive thinking request. Use `effort` to control how much they think.
1061
1071
  */
1062
1072
  thinking: z4.union([
1063
1073
  z4.discriminatedUnion("type", [
@@ -1170,7 +1180,11 @@ var anthropicLanguageModelOptions = z4.object({
1170
1180
  */
1171
1181
  toolStreaming: z4.boolean().optional(),
1172
1182
  /**
1173
- * @default 'high'
1183
+ * Controls how much effort the model spends on thinking, text responses,
1184
+ * and tool calls. On models that always use adaptive thinking
1185
+ * (e.g. `claude-opus-5-5`), effort is the main lever for latency and cost.
1186
+ *
1187
+ * The API default is `high` for most models and `medium` for `claude-opus-5-5`.
1174
1188
  */
1175
1189
  effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
1176
1190
  /**
@@ -1402,104 +1416,114 @@ var advisor_20260301 = (args) => {
1402
1416
  return factory(args);
1403
1417
  };
1404
1418
 
1405
- // src/tool/text-editor_20250728.ts
1419
+ // src/tool/computer-toolset_20260801.ts
1406
1420
  import {
1407
1421
  createProviderDefinedToolFactory,
1408
1422
  lazySchema as lazySchema5,
1409
1423
  zodSchema as zodSchema5
1410
1424
  } from "@ai-sdk/provider-utils";
1411
1425
  import { z as z6 } from "zod/v4";
1412
- var textEditor_20250728ArgsSchema = lazySchema5(
1426
+ var computerToolset_20260801Members = [
1427
+ "screenshot",
1428
+ "zoom",
1429
+ "left_click",
1430
+ "right_click",
1431
+ "middle_click",
1432
+ "double_click",
1433
+ "triple_click",
1434
+ "left_click_drag",
1435
+ "mouse_move",
1436
+ "left_mouse_down",
1437
+ "left_mouse_up",
1438
+ "cursor_position",
1439
+ "scroll",
1440
+ "type",
1441
+ "key",
1442
+ "hold_key",
1443
+ "wait"
1444
+ ];
1445
+ var computerToolset_20260801InputSchema = lazySchema5(
1413
1446
  () => zodSchema5(
1414
1447
  z6.object({
1415
- maxCharacters: z6.number().optional()
1448
+ action: z6.enum(computerToolset_20260801Members),
1449
+ coordinate: z6.tuple([z6.number().int(), z6.number().int()]).optional(),
1450
+ duration: z6.number().optional(),
1451
+ region: z6.tuple([
1452
+ z6.number().int(),
1453
+ z6.number().int(),
1454
+ z6.number().int(),
1455
+ z6.number().int()
1456
+ ]).optional(),
1457
+ repeat: z6.number().int().optional(),
1458
+ scroll_amount: z6.number().optional(),
1459
+ scroll_direction: z6.enum(["up", "down", "left", "right"]).optional(),
1460
+ start_coordinate: z6.tuple([z6.number().int(), z6.number().int()]).optional(),
1461
+ text: z6.string().optional()
1416
1462
  })
1417
1463
  )
1418
1464
  );
1419
- var textEditor_20250728InputSchema = lazySchema5(
1465
+ var computerToolset_20260801ArgsSchema = lazySchema5(
1420
1466
  () => zodSchema5(
1421
1467
  z6.object({
1422
- command: z6.enum(["view", "create", "str_replace", "insert"]),
1423
- path: z6.string(),
1424
- file_text: z6.string().optional(),
1425
- insert_line: z6.number().int().optional(),
1426
- new_str: z6.string().optional(),
1427
- insert_text: z6.string().optional(),
1428
- old_str: z6.string().optional(),
1429
- view_range: z6.array(z6.number().int()).optional()
1468
+ configs: z6.partialRecord(
1469
+ z6.enum(computerToolset_20260801Members),
1470
+ z6.object({
1471
+ enabled: z6.boolean().optional(),
1472
+ deferLoading: z6.boolean().optional()
1473
+ })
1474
+ ).optional()
1430
1475
  })
1431
1476
  )
1432
1477
  );
1433
- var factory2 = createProviderDefinedToolFactory({
1434
- id: "anthropic.text_editor_20250728",
1435
- inputSchema: textEditor_20250728InputSchema
1478
+ var computerToolset_20260801 = createProviderDefinedToolFactory({
1479
+ id: "anthropic.computer_toolset_20260801",
1480
+ inputSchema: computerToolset_20260801InputSchema
1436
1481
  });
1437
- var textEditor_20250728 = (args = {}) => {
1438
- return factory2(args);
1439
- };
1440
1482
 
1441
- // src/tool/web-search_20260318.ts
1483
+ // src/tool/text-editor_20250728.ts
1442
1484
  import {
1443
- createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
1485
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
1444
1486
  lazySchema as lazySchema6,
1445
1487
  zodSchema as zodSchema6
1446
1488
  } from "@ai-sdk/provider-utils";
1447
1489
  import { z as z7 } from "zod/v4";
1448
- var webSearch_20260318ArgsSchema = lazySchema6(
1490
+ var textEditor_20250728ArgsSchema = lazySchema6(
1449
1491
  () => zodSchema6(
1450
1492
  z7.object({
1451
- maxUses: z7.number().optional(),
1452
- allowedDomains: z7.array(z7.string()).optional(),
1453
- blockedDomains: z7.array(z7.string()).optional(),
1454
- userLocation: z7.object({
1455
- type: z7.literal("approximate"),
1456
- city: z7.string().optional(),
1457
- region: z7.string().optional(),
1458
- country: z7.string().optional(),
1459
- timezone: z7.string().optional()
1460
- }).optional(),
1461
- responseInclusion: z7.enum(["full", "excluded"]).optional()
1493
+ maxCharacters: z7.number().optional()
1462
1494
  })
1463
1495
  )
1464
1496
  );
1465
- var webSearch_20260318OutputSchema = lazySchema6(
1466
- () => zodSchema6(
1467
- z7.array(
1468
- z7.object({
1469
- url: z7.string(),
1470
- title: z7.string().nullable(),
1471
- pageAge: z7.string().nullable(),
1472
- encryptedContent: z7.string(),
1473
- type: z7.literal("web_search_result")
1474
- })
1475
- )
1476
- )
1477
- );
1478
- var webSearch_20260318InputSchema = lazySchema6(
1497
+ var textEditor_20250728InputSchema = lazySchema6(
1479
1498
  () => zodSchema6(
1480
1499
  z7.object({
1481
- query: z7.string()
1500
+ command: z7.enum(["view", "create", "str_replace", "insert"]),
1501
+ path: z7.string(),
1502
+ file_text: z7.string().optional(),
1503
+ insert_line: z7.number().int().optional(),
1504
+ new_str: z7.string().optional(),
1505
+ insert_text: z7.string().optional(),
1506
+ old_str: z7.string().optional(),
1507
+ view_range: z7.array(z7.number().int()).optional()
1482
1508
  })
1483
1509
  )
1484
1510
  );
1485
- var factory3 = createProviderExecutedToolFactory2({
1486
- id: "anthropic.web_search_20260318",
1487
- inputSchema: webSearch_20260318InputSchema,
1488
- outputSchema: webSearch_20260318OutputSchema,
1489
- supportsDeferredResults: true
1511
+ var factory2 = createProviderDefinedToolFactory2({
1512
+ id: "anthropic.text_editor_20250728",
1513
+ inputSchema: textEditor_20250728InputSchema
1490
1514
  });
1491
- var webSearch_20260318 = (args = {}) => {
1492
- return factory3(args);
1515
+ var textEditor_20250728 = (args = {}) => {
1516
+ return factory2(args);
1493
1517
  };
1494
1518
 
1495
- // src/tool/web-search_20260209.ts
1519
+ // src/tool/web-search_20260318.ts
1496
1520
  import {
1497
- createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
1521
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
1498
1522
  lazySchema as lazySchema7,
1499
1523
  zodSchema as zodSchema7
1500
1524
  } from "@ai-sdk/provider-utils";
1501
1525
  import { z as z8 } from "zod/v4";
1502
- var webSearch_20260209ArgsSchema = lazySchema7(
1526
+ var webSearch_20260318ArgsSchema = lazySchema7(
1503
1527
  () => zodSchema7(
1504
1528
  z8.object({
1505
1529
  maxUses: z8.number().optional(),
@@ -1511,11 +1535,12 @@ var webSearch_20260209ArgsSchema = lazySchema7(
1511
1535
  region: z8.string().optional(),
1512
1536
  country: z8.string().optional(),
1513
1537
  timezone: z8.string().optional()
1514
- }).optional()
1538
+ }).optional(),
1539
+ responseInclusion: z8.enum(["full", "excluded"]).optional()
1515
1540
  })
1516
1541
  )
1517
1542
  );
1518
- var webSearch_20260209OutputSchema = lazySchema7(
1543
+ var webSearch_20260318OutputSchema = lazySchema7(
1519
1544
  () => zodSchema7(
1520
1545
  z8.array(
1521
1546
  z8.object({
@@ -1528,31 +1553,31 @@ var webSearch_20260209OutputSchema = lazySchema7(
1528
1553
  )
1529
1554
  )
1530
1555
  );
1531
- var webSearch_20260209InputSchema = lazySchema7(
1556
+ var webSearch_20260318InputSchema = lazySchema7(
1532
1557
  () => zodSchema7(
1533
1558
  z8.object({
1534
1559
  query: z8.string()
1535
1560
  })
1536
1561
  )
1537
1562
  );
1538
- var factory4 = createProviderExecutedToolFactory3({
1539
- id: "anthropic.web_search_20260209",
1540
- inputSchema: webSearch_20260209InputSchema,
1541
- outputSchema: webSearch_20260209OutputSchema,
1563
+ var factory3 = createProviderExecutedToolFactory2({
1564
+ id: "anthropic.web_search_20260318",
1565
+ inputSchema: webSearch_20260318InputSchema,
1566
+ outputSchema: webSearch_20260318OutputSchema,
1542
1567
  supportsDeferredResults: true
1543
1568
  });
1544
- var webSearch_20260209 = (args = {}) => {
1545
- return factory4(args);
1569
+ var webSearch_20260318 = (args = {}) => {
1570
+ return factory3(args);
1546
1571
  };
1547
1572
 
1548
- // src/tool/web-search_20250305.ts
1573
+ // src/tool/web-search_20260209.ts
1549
1574
  import {
1550
- createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
1575
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
1551
1576
  lazySchema as lazySchema8,
1552
1577
  zodSchema as zodSchema8
1553
1578
  } from "@ai-sdk/provider-utils";
1554
1579
  import { z as z9 } from "zod/v4";
1555
- var webSearch_20250305ArgsSchema = lazySchema8(
1580
+ var webSearch_20260209ArgsSchema = lazySchema8(
1556
1581
  () => zodSchema8(
1557
1582
  z9.object({
1558
1583
  maxUses: z9.number().optional(),
@@ -1568,7 +1593,7 @@ var webSearch_20250305ArgsSchema = lazySchema8(
1568
1593
  })
1569
1594
  )
1570
1595
  );
1571
- var webSearch_20250305OutputSchema = lazySchema8(
1596
+ var webSearch_20260209OutputSchema = lazySchema8(
1572
1597
  () => zodSchema8(
1573
1598
  z9.array(
1574
1599
  z9.object({
@@ -1581,105 +1606,97 @@ var webSearch_20250305OutputSchema = lazySchema8(
1581
1606
  )
1582
1607
  )
1583
1608
  );
1584
- var webSearch_20250305InputSchema = lazySchema8(
1609
+ var webSearch_20260209InputSchema = lazySchema8(
1585
1610
  () => zodSchema8(
1586
1611
  z9.object({
1587
1612
  query: z9.string()
1588
1613
  })
1589
1614
  )
1590
1615
  );
1591
- var factory5 = createProviderExecutedToolFactory4({
1592
- id: "anthropic.web_search_20250305",
1593
- inputSchema: webSearch_20250305InputSchema,
1594
- outputSchema: webSearch_20250305OutputSchema,
1616
+ var factory4 = createProviderExecutedToolFactory3({
1617
+ id: "anthropic.web_search_20260209",
1618
+ inputSchema: webSearch_20260209InputSchema,
1619
+ outputSchema: webSearch_20260209OutputSchema,
1595
1620
  supportsDeferredResults: true
1596
1621
  });
1597
- var webSearch_20250305 = (args = {}) => {
1598
- return factory5(args);
1622
+ var webSearch_20260209 = (args = {}) => {
1623
+ return factory4(args);
1599
1624
  };
1600
1625
 
1601
- // src/tool/web-fetch-20260318.ts
1626
+ // src/tool/web-search_20250305.ts
1602
1627
  import {
1603
- createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
1628
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
1604
1629
  lazySchema as lazySchema9,
1605
1630
  zodSchema as zodSchema9
1606
1631
  } from "@ai-sdk/provider-utils";
1607
1632
  import { z as z10 } from "zod/v4";
1608
- var webFetch_20260318ArgsSchema = lazySchema9(
1633
+ var webSearch_20250305ArgsSchema = lazySchema9(
1609
1634
  () => zodSchema9(
1610
1635
  z10.object({
1611
1636
  maxUses: z10.number().optional(),
1612
1637
  allowedDomains: z10.array(z10.string()).optional(),
1613
1638
  blockedDomains: z10.array(z10.string()).optional(),
1614
- citations: z10.object({ enabled: z10.boolean() }).optional(),
1615
- maxContentTokens: z10.number().optional(),
1616
- useCache: z10.boolean().optional(),
1617
- responseInclusion: z10.enum(["full", "excluded"]).optional()
1639
+ userLocation: z10.object({
1640
+ type: z10.literal("approximate"),
1641
+ city: z10.string().optional(),
1642
+ region: z10.string().optional(),
1643
+ country: z10.string().optional(),
1644
+ timezone: z10.string().optional()
1645
+ }).optional()
1618
1646
  })
1619
1647
  )
1620
1648
  );
1621
- var webFetch_20260318OutputSchema = lazySchema9(
1649
+ var webSearch_20250305OutputSchema = lazySchema9(
1622
1650
  () => zodSchema9(
1623
- z10.object({
1624
- type: z10.literal("web_fetch_result"),
1625
- url: z10.string(),
1626
- content: z10.object({
1627
- type: z10.literal("document"),
1651
+ z10.array(
1652
+ z10.object({
1653
+ url: z10.string(),
1628
1654
  title: z10.string().nullable(),
1629
- citations: z10.object({ enabled: z10.boolean() }).optional(),
1630
- source: z10.union([
1631
- z10.object({
1632
- type: z10.literal("base64"),
1633
- mediaType: z10.literal("application/pdf"),
1634
- data: z10.string()
1635
- }),
1636
- z10.object({
1637
- type: z10.literal("text"),
1638
- mediaType: z10.literal("text/plain"),
1639
- data: z10.string()
1640
- })
1641
- ])
1642
- }),
1643
- retrievedAt: z10.string().nullable()
1644
- })
1655
+ pageAge: z10.string().nullable(),
1656
+ encryptedContent: z10.string(),
1657
+ type: z10.literal("web_search_result")
1658
+ })
1659
+ )
1645
1660
  )
1646
1661
  );
1647
- var webFetch_20260318InputSchema = lazySchema9(
1662
+ var webSearch_20250305InputSchema = lazySchema9(
1648
1663
  () => zodSchema9(
1649
1664
  z10.object({
1650
- url: z10.string()
1665
+ query: z10.string()
1651
1666
  })
1652
1667
  )
1653
1668
  );
1654
- var factory6 = createProviderExecutedToolFactory5({
1655
- id: "anthropic.web_fetch_20260318",
1656
- inputSchema: webFetch_20260318InputSchema,
1657
- outputSchema: webFetch_20260318OutputSchema,
1669
+ var factory5 = createProviderExecutedToolFactory4({
1670
+ id: "anthropic.web_search_20250305",
1671
+ inputSchema: webSearch_20250305InputSchema,
1672
+ outputSchema: webSearch_20250305OutputSchema,
1658
1673
  supportsDeferredResults: true
1659
1674
  });
1660
- var webFetch_20260318 = (args = {}) => {
1661
- return factory6(args);
1675
+ var webSearch_20250305 = (args = {}) => {
1676
+ return factory5(args);
1662
1677
  };
1663
1678
 
1664
- // src/tool/web-fetch-20260209.ts
1679
+ // src/tool/web-fetch-20260318.ts
1665
1680
  import {
1666
- createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
1681
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
1667
1682
  lazySchema as lazySchema10,
1668
1683
  zodSchema as zodSchema10
1669
1684
  } from "@ai-sdk/provider-utils";
1670
1685
  import { z as z11 } from "zod/v4";
1671
- var webFetch_20260209ArgsSchema = lazySchema10(
1686
+ var webFetch_20260318ArgsSchema = lazySchema10(
1672
1687
  () => zodSchema10(
1673
1688
  z11.object({
1674
1689
  maxUses: z11.number().optional(),
1675
1690
  allowedDomains: z11.array(z11.string()).optional(),
1676
1691
  blockedDomains: z11.array(z11.string()).optional(),
1677
1692
  citations: z11.object({ enabled: z11.boolean() }).optional(),
1678
- maxContentTokens: z11.number().optional()
1693
+ maxContentTokens: z11.number().optional(),
1694
+ useCache: z11.boolean().optional(),
1695
+ responseInclusion: z11.enum(["full", "excluded"]).optional()
1679
1696
  })
1680
1697
  )
1681
1698
  );
1682
- var webFetch_20260209OutputSchema = lazySchema10(
1699
+ var webFetch_20260318OutputSchema = lazySchema10(
1683
1700
  () => zodSchema10(
1684
1701
  z11.object({
1685
1702
  type: z11.literal("web_fetch_result"),
@@ -1705,31 +1722,31 @@ var webFetch_20260209OutputSchema = lazySchema10(
1705
1722
  })
1706
1723
  )
1707
1724
  );
1708
- var webFetch_20260209InputSchema = lazySchema10(
1725
+ var webFetch_20260318InputSchema = lazySchema10(
1709
1726
  () => zodSchema10(
1710
1727
  z11.object({
1711
1728
  url: z11.string()
1712
1729
  })
1713
1730
  )
1714
1731
  );
1715
- var factory7 = createProviderExecutedToolFactory6({
1716
- id: "anthropic.web_fetch_20260209",
1717
- inputSchema: webFetch_20260209InputSchema,
1718
- outputSchema: webFetch_20260209OutputSchema,
1732
+ var factory6 = createProviderExecutedToolFactory5({
1733
+ id: "anthropic.web_fetch_20260318",
1734
+ inputSchema: webFetch_20260318InputSchema,
1735
+ outputSchema: webFetch_20260318OutputSchema,
1719
1736
  supportsDeferredResults: true
1720
1737
  });
1721
- var webFetch_20260209 = (args = {}) => {
1722
- return factory7(args);
1738
+ var webFetch_20260318 = (args = {}) => {
1739
+ return factory6(args);
1723
1740
  };
1724
1741
 
1725
- // src/tool/web-fetch-20250910.ts
1742
+ // src/tool/web-fetch-20260209.ts
1726
1743
  import {
1727
- createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
1744
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
1728
1745
  lazySchema as lazySchema11,
1729
1746
  zodSchema as zodSchema11
1730
1747
  } from "@ai-sdk/provider-utils";
1731
1748
  import { z as z12 } from "zod/v4";
1732
- var webFetch_20250910ArgsSchema = lazySchema11(
1749
+ var webFetch_20260209ArgsSchema = lazySchema11(
1733
1750
  () => zodSchema11(
1734
1751
  z12.object({
1735
1752
  maxUses: z12.number().optional(),
@@ -1740,7 +1757,7 @@ var webFetch_20250910ArgsSchema = lazySchema11(
1740
1757
  })
1741
1758
  )
1742
1759
  );
1743
- var webFetch_20250910OutputSchema = lazySchema11(
1760
+ var webFetch_20260209OutputSchema = lazySchema11(
1744
1761
  () => zodSchema11(
1745
1762
  z12.object({
1746
1763
  type: z12.literal("web_fetch_result"),
@@ -1766,13 +1783,74 @@ var webFetch_20250910OutputSchema = lazySchema11(
1766
1783
  })
1767
1784
  )
1768
1785
  );
1769
- var webFetch_20250910InputSchema = lazySchema11(
1786
+ var webFetch_20260209InputSchema = lazySchema11(
1770
1787
  () => zodSchema11(
1771
1788
  z12.object({
1772
1789
  url: z12.string()
1773
1790
  })
1774
1791
  )
1775
1792
  );
1793
+ var factory7 = createProviderExecutedToolFactory6({
1794
+ id: "anthropic.web_fetch_20260209",
1795
+ inputSchema: webFetch_20260209InputSchema,
1796
+ outputSchema: webFetch_20260209OutputSchema,
1797
+ supportsDeferredResults: true
1798
+ });
1799
+ var webFetch_20260209 = (args = {}) => {
1800
+ return factory7(args);
1801
+ };
1802
+
1803
+ // src/tool/web-fetch-20250910.ts
1804
+ import {
1805
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
1806
+ lazySchema as lazySchema12,
1807
+ zodSchema as zodSchema12
1808
+ } from "@ai-sdk/provider-utils";
1809
+ import { z as z13 } from "zod/v4";
1810
+ var webFetch_20250910ArgsSchema = lazySchema12(
1811
+ () => zodSchema12(
1812
+ z13.object({
1813
+ maxUses: z13.number().optional(),
1814
+ allowedDomains: z13.array(z13.string()).optional(),
1815
+ blockedDomains: z13.array(z13.string()).optional(),
1816
+ citations: z13.object({ enabled: z13.boolean() }).optional(),
1817
+ maxContentTokens: z13.number().optional()
1818
+ })
1819
+ )
1820
+ );
1821
+ var webFetch_20250910OutputSchema = lazySchema12(
1822
+ () => zodSchema12(
1823
+ z13.object({
1824
+ type: z13.literal("web_fetch_result"),
1825
+ url: z13.string(),
1826
+ content: z13.object({
1827
+ type: z13.literal("document"),
1828
+ title: z13.string().nullable(),
1829
+ citations: z13.object({ enabled: z13.boolean() }).optional(),
1830
+ source: z13.union([
1831
+ z13.object({
1832
+ type: z13.literal("base64"),
1833
+ mediaType: z13.literal("application/pdf"),
1834
+ data: z13.string()
1835
+ }),
1836
+ z13.object({
1837
+ type: z13.literal("text"),
1838
+ mediaType: z13.literal("text/plain"),
1839
+ data: z13.string()
1840
+ })
1841
+ ])
1842
+ }),
1843
+ retrievedAt: z13.string().nullable()
1844
+ })
1845
+ )
1846
+ );
1847
+ var webFetch_20250910InputSchema = lazySchema12(
1848
+ () => zodSchema12(
1849
+ z13.object({
1850
+ url: z13.string()
1851
+ })
1852
+ )
1853
+ );
1776
1854
  var factory8 = createProviderExecutedToolFactory7({
1777
1855
  id: "anthropic.web_fetch_20250910",
1778
1856
  inputSchema: webFetch_20250910InputSchema,
@@ -1792,7 +1870,8 @@ async function prepareTools({
1792
1870
  cacheControlValidator,
1793
1871
  supportsStructuredOutput,
1794
1872
  supportsStrictTools,
1795
- defaultEagerInputStreaming = false
1873
+ defaultEagerInputStreaming = false,
1874
+ rejectsForcedToolUse = false
1796
1875
  }) {
1797
1876
  var _a, _b;
1798
1877
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
@@ -1895,6 +1974,31 @@ async function prepareTools({
1895
1974
  });
1896
1975
  break;
1897
1976
  }
1977
+ case "anthropic.computer_toolset_20260801": {
1978
+ const args = await validateTypes({
1979
+ value: tool.args,
1980
+ schema: computerToolset_20260801ArgsSchema
1981
+ });
1982
+ const configs = args.configs != null ? Object.fromEntries(
1983
+ Object.entries(args.configs).map(([member, config]) => [
1984
+ member,
1985
+ {
1986
+ ...(config == null ? void 0 : config.enabled) != null && {
1987
+ enabled: config.enabled
1988
+ },
1989
+ ...(config == null ? void 0 : config.deferLoading) != null && {
1990
+ defer_loading: config.deferLoading
1991
+ }
1992
+ }
1993
+ ])
1994
+ ) : void 0;
1995
+ anthropicTools2.push({
1996
+ type: "computer_toolset_20260801",
1997
+ ...configs != null && { configs },
1998
+ cache_control: void 0
1999
+ });
2000
+ break;
2001
+ }
1898
2002
  case "anthropic.computer_20241022": {
1899
2003
  betas.add("computer-use-2024-10-22");
1900
2004
  anthropicTools2.push({
@@ -2150,6 +2254,22 @@ async function prepareTools({
2150
2254
  betas
2151
2255
  };
2152
2256
  case "required":
2257
+ if (rejectsForcedToolUse) {
2258
+ toolWarnings.push({
2259
+ type: "unsupported",
2260
+ feature: "toolChoice",
2261
+ details: `toolChoice 'required' is not supported by this model because it rejects forced tool use. Using 'auto' instead. Instruct the model to use a tool in the prompt and verify that a tool call was made.`
2262
+ });
2263
+ return {
2264
+ tools: anthropicTools2,
2265
+ toolChoice: {
2266
+ type: "auto",
2267
+ disable_parallel_tool_use: disableParallelToolUse
2268
+ },
2269
+ toolWarnings,
2270
+ betas
2271
+ };
2272
+ }
2153
2273
  return {
2154
2274
  tools: anthropicTools2,
2155
2275
  toolChoice: {
@@ -2162,6 +2282,24 @@ async function prepareTools({
2162
2282
  case "none":
2163
2283
  return { tools: void 0, toolChoice: void 0, toolWarnings, betas };
2164
2284
  case "tool":
2285
+ if (rejectsForcedToolUse) {
2286
+ toolWarnings.push({
2287
+ type: "unsupported",
2288
+ feature: "toolChoice",
2289
+ details: `toolChoice 'tool' is not supported by this model because it rejects forced tool use. Only the '${toolChoice.toolName}' tool is sent with 'auto' tool choice. Instruct the model to use the tool in the prompt and verify that a tool call was made.`
2290
+ });
2291
+ return {
2292
+ tools: anthropicTools2.filter(
2293
+ (tool) => "name" in tool && tool.name === toolChoice.toolName
2294
+ ),
2295
+ toolChoice: {
2296
+ type: "auto",
2297
+ disable_parallel_tool_use: disableParallelToolUse
2298
+ },
2299
+ toolWarnings,
2300
+ betas
2301
+ };
2302
+ }
2165
2303
  return {
2166
2304
  tools: anthropicTools2,
2167
2305
  toolChoice: {
@@ -2252,30 +2390,30 @@ import {
2252
2390
  // src/tool/code-execution_20250522.ts
2253
2391
  import {
2254
2392
  createProviderExecutedToolFactory as createProviderExecutedToolFactory8,
2255
- lazySchema as lazySchema12,
2256
- zodSchema as zodSchema12
2393
+ lazySchema as lazySchema13,
2394
+ zodSchema as zodSchema13
2257
2395
  } from "@ai-sdk/provider-utils";
2258
- import { z as z13 } from "zod/v4";
2259
- var codeExecution_20250522OutputSchema = lazySchema12(
2260
- () => zodSchema12(
2261
- z13.object({
2262
- type: z13.literal("code_execution_result"),
2263
- stdout: z13.string(),
2264
- stderr: z13.string(),
2265
- return_code: z13.number(),
2266
- content: z13.array(
2267
- z13.object({
2268
- type: z13.literal("code_execution_output"),
2269
- file_id: z13.string()
2396
+ import { z as z14 } from "zod/v4";
2397
+ var codeExecution_20250522OutputSchema = lazySchema13(
2398
+ () => zodSchema13(
2399
+ z14.object({
2400
+ type: z14.literal("code_execution_result"),
2401
+ stdout: z14.string(),
2402
+ stderr: z14.string(),
2403
+ return_code: z14.number(),
2404
+ content: z14.array(
2405
+ z14.object({
2406
+ type: z14.literal("code_execution_output"),
2407
+ file_id: z14.string()
2270
2408
  })
2271
2409
  ).optional().default([])
2272
2410
  })
2273
2411
  )
2274
2412
  );
2275
- var codeExecution_20250522InputSchema = lazySchema12(
2276
- () => zodSchema12(
2277
- z13.object({
2278
- code: z13.string()
2413
+ var codeExecution_20250522InputSchema = lazySchema13(
2414
+ () => zodSchema13(
2415
+ z14.object({
2416
+ code: z14.string()
2279
2417
  })
2280
2418
  )
2281
2419
  );
@@ -2292,143 +2430,11 @@ var codeExecution_20250522 = (args = {}) => {
2292
2430
  import {
2293
2431
  createProviderExecutedToolFactory as createProviderExecutedToolFactory9,
2294
2432
  experimental_toolCaller,
2295
- lazySchema as lazySchema13,
2296
- zodSchema as zodSchema13
2297
- } from "@ai-sdk/provider-utils";
2298
- import { z as z14 } from "zod/v4";
2299
- var codeExecution_20250825OutputSchema = lazySchema13(
2300
- () => zodSchema13(
2301
- z14.discriminatedUnion("type", [
2302
- z14.object({
2303
- type: z14.literal("code_execution_result"),
2304
- stdout: z14.string(),
2305
- stderr: z14.string(),
2306
- return_code: z14.number(),
2307
- content: z14.array(
2308
- z14.object({
2309
- type: z14.literal("code_execution_output"),
2310
- file_id: z14.string()
2311
- })
2312
- ).optional().default([])
2313
- }),
2314
- z14.object({
2315
- type: z14.literal("bash_code_execution_result"),
2316
- content: z14.array(
2317
- z14.object({
2318
- type: z14.literal("bash_code_execution_output"),
2319
- file_id: z14.string()
2320
- })
2321
- ),
2322
- stdout: z14.string(),
2323
- stderr: z14.string(),
2324
- return_code: z14.number()
2325
- }),
2326
- z14.object({
2327
- type: z14.literal("bash_code_execution_tool_result_error"),
2328
- error_code: z14.string()
2329
- }),
2330
- z14.object({
2331
- type: z14.literal("text_editor_code_execution_tool_result_error"),
2332
- error_code: z14.string()
2333
- }),
2334
- z14.object({
2335
- type: z14.literal("text_editor_code_execution_view_result"),
2336
- content: z14.string(),
2337
- file_type: z14.string(),
2338
- num_lines: z14.number().nullable(),
2339
- start_line: z14.number().nullable(),
2340
- total_lines: z14.number().nullable()
2341
- }),
2342
- z14.object({
2343
- type: z14.literal("text_editor_code_execution_create_result"),
2344
- is_file_update: z14.boolean()
2345
- }),
2346
- z14.object({
2347
- type: z14.literal("text_editor_code_execution_str_replace_result"),
2348
- lines: z14.array(z14.string()).nullable(),
2349
- new_lines: z14.number().nullable(),
2350
- new_start: z14.number().nullable(),
2351
- old_lines: z14.number().nullable(),
2352
- old_start: z14.number().nullable()
2353
- })
2354
- ])
2355
- )
2356
- );
2357
- var codeExecution_20250825InputSchema = lazySchema13(
2358
- () => zodSchema13(
2359
- z14.discriminatedUnion("type", [
2360
- // Programmatic tool calling format (mapped from { code } by AI SDK)
2361
- z14.object({
2362
- type: z14.literal("programmatic-tool-call"),
2363
- code: z14.string()
2364
- }),
2365
- z14.object({
2366
- type: z14.literal("bash_code_execution"),
2367
- command: z14.string()
2368
- }),
2369
- z14.discriminatedUnion("command", [
2370
- z14.object({
2371
- type: z14.literal("text_editor_code_execution"),
2372
- command: z14.literal("view"),
2373
- path: z14.string()
2374
- }),
2375
- z14.object({
2376
- type: z14.literal("text_editor_code_execution"),
2377
- command: z14.literal("create"),
2378
- path: z14.string(),
2379
- file_text: z14.string().nullish()
2380
- }),
2381
- z14.object({
2382
- type: z14.literal("text_editor_code_execution"),
2383
- command: z14.literal("str_replace"),
2384
- path: z14.string(),
2385
- old_str: z14.string(),
2386
- new_str: z14.string()
2387
- })
2388
- ])
2389
- ])
2390
- )
2391
- );
2392
- var factory10 = createProviderExecutedToolFactory9({
2393
- id: "anthropic.code_execution_20250825",
2394
- inputSchema: codeExecution_20250825InputSchema,
2395
- outputSchema: codeExecution_20250825OutputSchema,
2396
- // Programmatic tool calling: tool results may be deferred to a later turn
2397
- // when code execution triggers a client-executed tool that needs to be
2398
- // resolved before the code execution result can be returned.
2399
- supportsDeferredResults: true
2400
- });
2401
- var codeExecution_20250825 = (args = {}) => {
2402
- return experimental_toolCaller(factory10(args), {
2403
- type: "provider",
2404
- prepareProviderOptions: (providerOptions) => {
2405
- var _a;
2406
- const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
2407
- return {
2408
- ...providerOptions,
2409
- anthropic: {
2410
- ...anthropicOptions,
2411
- allowedCallers: [
2412
- .../* @__PURE__ */ new Set([
2413
- ...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
2414
- "code_execution_20250825"
2415
- ])
2416
- ]
2417
- }
2418
- };
2419
- }
2420
- });
2421
- };
2422
-
2423
- // src/tool/code-execution_20260120.ts
2424
- import {
2425
- createProviderExecutedToolFactory as createProviderExecutedToolFactory10,
2426
- experimental_toolCaller as experimental_toolCaller2,
2427
2433
  lazySchema as lazySchema14,
2428
2434
  zodSchema as zodSchema14
2429
2435
  } from "@ai-sdk/provider-utils";
2430
2436
  import { z as z15 } from "zod/v4";
2431
- var codeExecution_20260120OutputSchema = lazySchema14(
2437
+ var codeExecution_20250825OutputSchema = lazySchema14(
2432
2438
  () => zodSchema14(
2433
2439
  z15.discriminatedUnion("type", [
2434
2440
  z15.object({
@@ -2443,18 +2449,6 @@ var codeExecution_20260120OutputSchema = lazySchema14(
2443
2449
  })
2444
2450
  ).optional().default([])
2445
2451
  }),
2446
- z15.object({
2447
- type: z15.literal("encrypted_code_execution_result"),
2448
- encrypted_stdout: z15.string(),
2449
- stderr: z15.string(),
2450
- return_code: z15.number(),
2451
- content: z15.array(
2452
- z15.object({
2453
- type: z15.literal("code_execution_output"),
2454
- file_id: z15.string()
2455
- })
2456
- ).optional().default([])
2457
- }),
2458
2452
  z15.object({
2459
2453
  type: z15.literal("bash_code_execution_result"),
2460
2454
  content: z15.array(
@@ -2498,9 +2492,10 @@ var codeExecution_20260120OutputSchema = lazySchema14(
2498
2492
  ])
2499
2493
  )
2500
2494
  );
2501
- var codeExecution_20260120InputSchema = lazySchema14(
2495
+ var codeExecution_20250825InputSchema = lazySchema14(
2502
2496
  () => zodSchema14(
2503
2497
  z15.discriminatedUnion("type", [
2498
+ // Programmatic tool calling format (mapped from { code } by AI SDK)
2504
2499
  z15.object({
2505
2500
  type: z15.literal("programmatic-tool-call"),
2506
2501
  code: z15.string()
@@ -2532,6 +2527,149 @@ var codeExecution_20260120InputSchema = lazySchema14(
2532
2527
  ])
2533
2528
  )
2534
2529
  );
2530
+ var factory10 = createProviderExecutedToolFactory9({
2531
+ id: "anthropic.code_execution_20250825",
2532
+ inputSchema: codeExecution_20250825InputSchema,
2533
+ outputSchema: codeExecution_20250825OutputSchema,
2534
+ // Programmatic tool calling: tool results may be deferred to a later turn
2535
+ // when code execution triggers a client-executed tool that needs to be
2536
+ // resolved before the code execution result can be returned.
2537
+ supportsDeferredResults: true
2538
+ });
2539
+ var codeExecution_20250825 = (args = {}) => {
2540
+ return experimental_toolCaller(factory10(args), {
2541
+ type: "provider",
2542
+ prepareProviderOptions: (providerOptions) => {
2543
+ var _a;
2544
+ const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
2545
+ return {
2546
+ ...providerOptions,
2547
+ anthropic: {
2548
+ ...anthropicOptions,
2549
+ allowedCallers: [
2550
+ .../* @__PURE__ */ new Set([
2551
+ ...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
2552
+ "code_execution_20250825"
2553
+ ])
2554
+ ]
2555
+ }
2556
+ };
2557
+ }
2558
+ });
2559
+ };
2560
+
2561
+ // src/tool/code-execution_20260120.ts
2562
+ import {
2563
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory10,
2564
+ experimental_toolCaller as experimental_toolCaller2,
2565
+ lazySchema as lazySchema15,
2566
+ zodSchema as zodSchema15
2567
+ } from "@ai-sdk/provider-utils";
2568
+ import { z as z16 } from "zod/v4";
2569
+ var codeExecution_20260120OutputSchema = lazySchema15(
2570
+ () => zodSchema15(
2571
+ z16.discriminatedUnion("type", [
2572
+ z16.object({
2573
+ type: z16.literal("code_execution_result"),
2574
+ stdout: z16.string(),
2575
+ stderr: z16.string(),
2576
+ return_code: z16.number(),
2577
+ content: z16.array(
2578
+ z16.object({
2579
+ type: z16.literal("code_execution_output"),
2580
+ file_id: z16.string()
2581
+ })
2582
+ ).optional().default([])
2583
+ }),
2584
+ z16.object({
2585
+ type: z16.literal("encrypted_code_execution_result"),
2586
+ encrypted_stdout: z16.string(),
2587
+ stderr: z16.string(),
2588
+ return_code: z16.number(),
2589
+ content: z16.array(
2590
+ z16.object({
2591
+ type: z16.literal("code_execution_output"),
2592
+ file_id: z16.string()
2593
+ })
2594
+ ).optional().default([])
2595
+ }),
2596
+ z16.object({
2597
+ type: z16.literal("bash_code_execution_result"),
2598
+ content: z16.array(
2599
+ z16.object({
2600
+ type: z16.literal("bash_code_execution_output"),
2601
+ file_id: z16.string()
2602
+ })
2603
+ ),
2604
+ stdout: z16.string(),
2605
+ stderr: z16.string(),
2606
+ return_code: z16.number()
2607
+ }),
2608
+ z16.object({
2609
+ type: z16.literal("bash_code_execution_tool_result_error"),
2610
+ error_code: z16.string()
2611
+ }),
2612
+ z16.object({
2613
+ type: z16.literal("text_editor_code_execution_tool_result_error"),
2614
+ error_code: z16.string()
2615
+ }),
2616
+ z16.object({
2617
+ type: z16.literal("text_editor_code_execution_view_result"),
2618
+ content: z16.string(),
2619
+ file_type: z16.string(),
2620
+ num_lines: z16.number().nullable(),
2621
+ start_line: z16.number().nullable(),
2622
+ total_lines: z16.number().nullable()
2623
+ }),
2624
+ z16.object({
2625
+ type: z16.literal("text_editor_code_execution_create_result"),
2626
+ is_file_update: z16.boolean()
2627
+ }),
2628
+ z16.object({
2629
+ type: z16.literal("text_editor_code_execution_str_replace_result"),
2630
+ lines: z16.array(z16.string()).nullable(),
2631
+ new_lines: z16.number().nullable(),
2632
+ new_start: z16.number().nullable(),
2633
+ old_lines: z16.number().nullable(),
2634
+ old_start: z16.number().nullable()
2635
+ })
2636
+ ])
2637
+ )
2638
+ );
2639
+ var codeExecution_20260120InputSchema = lazySchema15(
2640
+ () => zodSchema15(
2641
+ z16.discriminatedUnion("type", [
2642
+ z16.object({
2643
+ type: z16.literal("programmatic-tool-call"),
2644
+ code: z16.string()
2645
+ }),
2646
+ z16.object({
2647
+ type: z16.literal("bash_code_execution"),
2648
+ command: z16.string()
2649
+ }),
2650
+ z16.discriminatedUnion("command", [
2651
+ z16.object({
2652
+ type: z16.literal("text_editor_code_execution"),
2653
+ command: z16.literal("view"),
2654
+ path: z16.string()
2655
+ }),
2656
+ z16.object({
2657
+ type: z16.literal("text_editor_code_execution"),
2658
+ command: z16.literal("create"),
2659
+ path: z16.string(),
2660
+ file_text: z16.string().nullish()
2661
+ }),
2662
+ z16.object({
2663
+ type: z16.literal("text_editor_code_execution"),
2664
+ command: z16.literal("str_replace"),
2665
+ path: z16.string(),
2666
+ old_str: z16.string(),
2667
+ new_str: z16.string()
2668
+ })
2669
+ ])
2670
+ ])
2671
+ )
2672
+ );
2535
2673
  var factory11 = createProviderExecutedToolFactory10({
2536
2674
  id: "anthropic.code_execution_20260120",
2537
2675
  inputSchema: codeExecution_20260120InputSchema,
@@ -2563,23 +2701,23 @@ var codeExecution_20260120 = (args = {}) => {
2563
2701
  // src/tool/tool-search-regex_20251119.ts
2564
2702
  import {
2565
2703
  createProviderExecutedToolFactory as createProviderExecutedToolFactory11,
2566
- lazySchema as lazySchema15,
2567
- zodSchema as zodSchema15
2704
+ lazySchema as lazySchema16,
2705
+ zodSchema as zodSchema16
2568
2706
  } from "@ai-sdk/provider-utils";
2569
- import { z as z16 } from "zod/v4";
2570
- var toolSearchRegex_20251119OutputSchema = lazySchema15(
2571
- () => zodSchema15(
2572
- z16.array(
2573
- z16.object({
2574
- type: z16.literal("tool_reference"),
2575
- toolName: z16.string()
2707
+ import { z as z17 } from "zod/v4";
2708
+ var toolSearchRegex_20251119OutputSchema = lazySchema16(
2709
+ () => zodSchema16(
2710
+ z17.array(
2711
+ z17.object({
2712
+ type: z17.literal("tool_reference"),
2713
+ toolName: z17.string()
2576
2714
  })
2577
2715
  )
2578
2716
  )
2579
2717
  );
2580
- var toolSearchRegex_20251119InputSchema = lazySchema15(
2581
- () => zodSchema15(
2582
- z16.object({
2718
+ var toolSearchRegex_20251119InputSchema = lazySchema16(
2719
+ () => zodSchema16(
2720
+ z17.object({
2583
2721
  /**
2584
2722
  * A regex pattern to search for tools.
2585
2723
  * Uses Python re.search() syntax. Maximum 200 characters.
@@ -2590,11 +2728,11 @@ var toolSearchRegex_20251119InputSchema = lazySchema15(
2590
2728
  * - "database.*query|query.*database" - OR patterns for flexibility
2591
2729
  * - "(?i)slack" - case-insensitive search
2592
2730
  */
2593
- pattern: z16.string(),
2731
+ pattern: z17.string(),
2594
2732
  /**
2595
2733
  * Maximum number of tools to return. Optional.
2596
2734
  */
2597
- limit: z16.number().optional()
2735
+ limit: z17.number().optional()
2598
2736
  })
2599
2737
  )
2600
2738
  );
@@ -2635,7 +2773,8 @@ async function convertToAnthropicPrompt({
2635
2773
  sendReasoning,
2636
2774
  warnings,
2637
2775
  cacheControlValidator,
2638
- toolNameMapping
2776
+ toolNameMapping,
2777
+ toolsetNames = {}
2639
2778
  }) {
2640
2779
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
2641
2780
  const betas = /* @__PURE__ */ new Set();
@@ -2758,7 +2897,7 @@ async function convertToAnthropicPrompt({
2758
2897
  betas.add("mid-conversation-system-clear-at-2026-08-21");
2759
2898
  }
2760
2899
  if (message.effort != null) {
2761
- betas.add("mid-conversation-effort-2026-08-01");
2900
+ betas.add("mid-conversation-output-config-2026-07-01");
2762
2901
  }
2763
2902
  }
2764
2903
  }
@@ -3058,9 +3197,15 @@ async function convertToAnthropicPrompt({
3058
3197
  contentValue = JSON.stringify(output.value);
3059
3198
  break;
3060
3199
  }
3200
+ const toolsetName = getAnthropicToolsetName({
3201
+ toolName: part.toolName,
3202
+ providerOptions: part.providerOptions,
3203
+ toolsetNames
3204
+ });
3061
3205
  anthropicContent.push({
3062
3206
  type: "tool_result",
3063
3207
  tool_use_id: part.toolCallId,
3208
+ ...toolsetName != null && { toolset_name: toolsetName },
3064
3209
  content: contentValue,
3065
3210
  is_error: output.type === "error-text" || output.type === "error-json" ? true : void 0,
3066
3211
  cache_control: cacheControl
@@ -3098,6 +3243,9 @@ async function convertToAnthropicPrompt({
3098
3243
  case "text": {
3099
3244
  const textMetadata = (_k = part.providerOptions) == null ? void 0 : _k.anthropic;
3100
3245
  if ((textMetadata == null ? void 0 : textMetadata.type) === "compaction") {
3246
+ if (part.text === "") {
3247
+ break;
3248
+ }
3101
3249
  anthropicContent.push({
3102
3250
  type: "compaction",
3103
3251
  content: part.text,
@@ -3258,6 +3406,33 @@ async function convertToAnthropicPrompt({
3258
3406
  }
3259
3407
  break;
3260
3408
  }
3409
+ const toolsetName = getAnthropicToolsetName({
3410
+ toolName: part.toolName,
3411
+ providerOptions: part.providerOptions,
3412
+ toolsetNames
3413
+ });
3414
+ if (toolsetName != null) {
3415
+ const { action, ...memberInput } = toAnthropicToolInput(
3416
+ part.input
3417
+ );
3418
+ if (typeof action !== "string") {
3419
+ warnings.push({
3420
+ type: "other",
3421
+ message: `toolset tool call for tool ${part.toolName} is missing the action`
3422
+ });
3423
+ break;
3424
+ }
3425
+ anthropicContent.push({
3426
+ type: "tool_use",
3427
+ id: part.toolCallId,
3428
+ name: action,
3429
+ toolset_name: toolsetName,
3430
+ input: memberInput,
3431
+ ...caller && { caller },
3432
+ cache_control: cacheControl
3433
+ });
3434
+ break;
3435
+ }
3261
3436
  anthropicContent.push({
3262
3437
  type: "tool_use",
3263
3438
  id: part.toolCallId,
@@ -3597,10 +3772,12 @@ async function convertToAnthropicPrompt({
3597
3772
  }
3598
3773
  }
3599
3774
  }
3600
- messages.push({
3601
- role: "assistant",
3602
- content: moveToolUseBlocksToEnd(anthropicContent)
3603
- });
3775
+ if (anthropicContent.length > 0) {
3776
+ messages.push({
3777
+ role: "assistant",
3778
+ content: moveToolUseBlocksToEnd(anthropicContent)
3779
+ });
3780
+ }
3604
3781
  break;
3605
3782
  }
3606
3783
  default: {
@@ -3681,6 +3858,19 @@ function moveToolUseBlocksToEnd(content) {
3681
3858
  flushSegment();
3682
3859
  return result;
3683
3860
  }
3861
+ function getAnthropicToolsetName({
3862
+ toolName,
3863
+ providerOptions,
3864
+ toolsetNames
3865
+ }) {
3866
+ var _a;
3867
+ const fromTools = toolsetNames[toolName];
3868
+ if (fromTools != null) {
3869
+ return fromTools;
3870
+ }
3871
+ const fromMetadata = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.toolsetName;
3872
+ return typeof fromMetadata === "string" ? fromMetadata : void 0;
3873
+ }
3684
3874
  function getAnthropicCaller(providerOptions) {
3685
3875
  var _a;
3686
3876
  const caller = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.caller;
@@ -3954,6 +4144,24 @@ function getAnthropicCallerMetadata(caller) {
3954
4144
  const callerInfo = getAnthropicCallerInfo(caller);
3955
4145
  return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
3956
4146
  }
4147
+ function getAnthropicToolsetNames(tools) {
4148
+ const toolsetNames = {};
4149
+ for (const tool of tools != null ? tools : []) {
4150
+ if (tool.type === "provider" && tool.id === "anthropic.computer_toolset_20260801") {
4151
+ toolsetNames[tool.name] = "computer";
4152
+ }
4153
+ }
4154
+ return toolsetNames;
4155
+ }
4156
+ function toToolsetMemberInput({
4157
+ memberName,
4158
+ input
4159
+ }) {
4160
+ return {
4161
+ action: memberName,
4162
+ ...typeof input === "object" && input !== null && !Array.isArray(input) ? input : {}
4163
+ };
4164
+ }
3957
4165
  function getProviderOptionsName(provider) {
3958
4166
  const dotIndex = provider.indexOf(".");
3959
4167
  return dotIndex === -1 ? provider : provider.substring(0, dotIndex);
@@ -4066,6 +4274,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4066
4274
  rejectsSamplingParameters,
4067
4275
  supportsXhighEffort,
4068
4276
  rejectsThinkingDisabledAboveHighEffort,
4277
+ rejectsThinkingDisabled,
4278
+ rejectsForcedToolUse,
4069
4279
  isKnownModel
4070
4280
  } = getModelCapabilities(modelId);
4071
4281
  if (!isKnownModel && maxOutputTokens == null) {
@@ -4105,7 +4315,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4105
4315
  const supportsStructuredOutput = ((_a = config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
4106
4316
  const supportsStrictTools = ((_b = config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
4107
4317
  const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
4108
- const useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
4318
+ let useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
4319
+ if (!useStructuredOutput && rejectsForcedToolUse && supportsStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
4320
+ warnings.push({
4321
+ type: "unsupported",
4322
+ feature: "providerOptions.anthropic.structuredOutputMode",
4323
+ details: `structuredOutputMode 'jsonTool' is not supported by ${modelId} because it rejects forced tool use. Using 'outputFormat' instead.`
4324
+ });
4325
+ useStructuredOutput = true;
4326
+ }
4109
4327
  const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
4110
4328
  type: "function",
4111
4329
  name: "json",
@@ -4129,6 +4347,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4129
4347
  "anthropic.code_execution_20260120": "code_execution",
4130
4348
  "anthropic.computer_20241022": "computer",
4131
4349
  "anthropic.computer_20250124": "computer",
4350
+ "anthropic.computer_20251124": "computer",
4351
+ "anthropic.computer_toolset_20260801": "computer",
4132
4352
  "anthropic.text_editor_20241022": "str_replace_editor",
4133
4353
  "anthropic.text_editor_20250124": "str_replace_editor",
4134
4354
  "anthropic.text_editor_20250429": "str_replace_based_edit_tool",
@@ -4147,18 +4367,22 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4147
4367
  "anthropic.advisor_20260301": "advisor"
4148
4368
  }
4149
4369
  });
4370
+ const toolsetNames = getAnthropicToolsetNames(tools);
4150
4371
  const { prompt: messagesPrompt, betas } = await convertToAnthropicPrompt({
4151
4372
  prompt,
4152
4373
  sendReasoning: (_d = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _d : true,
4153
4374
  warnings,
4154
4375
  cacheControlValidator,
4155
- toolNameMapping
4376
+ toolNameMapping,
4377
+ toolsetNames
4156
4378
  });
4157
4379
  if (isCustomReasoning(reasoning) && (anthropicOptions == null ? void 0 : anthropicOptions.effort) == null) {
4158
4380
  const reasoningConfig = resolveAnthropicReasoningConfig({
4159
4381
  reasoning,
4382
+ modelId,
4160
4383
  supportsAdaptiveThinking,
4161
4384
  supportsXhighEffort,
4385
+ rejectsThinkingDisabled,
4162
4386
  maxOutputTokensForModel,
4163
4387
  warnings
4164
4388
  });
@@ -4171,6 +4395,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4171
4395
  }
4172
4396
  }
4173
4397
  }
4398
+ if (rejectsThinkingDisabled && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null) {
4399
+ const thinking = anthropicOptions.thinking;
4400
+ if (thinking.type === "disabled") {
4401
+ warnings.push({
4402
+ type: "unsupported",
4403
+ feature: "providerOptions.anthropic.thinking",
4404
+ details: `thinking cannot be disabled for ${modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
4405
+ });
4406
+ anthropicOptions.thinking = void 0;
4407
+ } else if (thinking.type === "enabled") {
4408
+ warnings.push({
4409
+ type: "unsupported",
4410
+ feature: "providerOptions.anthropic.thinking",
4411
+ details: `budget-based thinking is not supported by ${modelId}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`
4412
+ });
4413
+ anthropicOptions.thinking = { type: "adaptive" };
4414
+ }
4415
+ }
4174
4416
  if (rejectsThinkingDisabledAboveHighEffort && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.type) === "disabled" && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
4175
4417
  warnings.push({
4176
4418
  type: "unsupported",
@@ -4457,7 +4699,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4457
4699
  cacheControlValidator,
4458
4700
  supportsStructuredOutput: false,
4459
4701
  supportsStrictTools,
4460
- defaultEagerInputStreaming
4702
+ defaultEagerInputStreaming,
4703
+ rejectsForcedToolUse
4461
4704
  } : {
4462
4705
  tools: tools != null ? tools : [],
4463
4706
  toolChoice,
@@ -4465,7 +4708,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4465
4708
  cacheControlValidator,
4466
4709
  supportsStructuredOutput,
4467
4710
  supportsStrictTools,
4468
- defaultEagerInputStreaming
4711
+ defaultEagerInputStreaming,
4712
+ rejectsForcedToolUse
4469
4713
  }
4470
4714
  );
4471
4715
  const cacheWarnings = cacheControlValidator.getWarnings();
@@ -4551,7 +4795,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4551
4795
  });
4552
4796
  }
4553
4797
  async doGenerate(options) {
4554
- var _a, _b, _c, _d, _e, _f, _g, _h;
4798
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
4555
4799
  const {
4556
4800
  args,
4557
4801
  warnings,
@@ -4654,6 +4898,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4654
4898
  break;
4655
4899
  }
4656
4900
  case "compaction": {
4901
+ if (!part.content) {
4902
+ break;
4903
+ }
4657
4904
  content.push({
4658
4905
  type: "text",
4659
4906
  text: part.content,
@@ -4673,6 +4920,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4673
4920
  type: "text",
4674
4921
  text: JSON.stringify(part.input)
4675
4922
  });
4923
+ } else if (part.toolset_name != null) {
4924
+ content.push({
4925
+ type: "tool-call",
4926
+ toolCallId: part.id,
4927
+ toolName: toolNameMapping.toCustomToolName(part.toolset_name),
4928
+ input: JSON.stringify(
4929
+ toToolsetMemberInput({
4930
+ memberName: part.name,
4931
+ input: part.input
4932
+ })
4933
+ ),
4934
+ providerMetadata: {
4935
+ anthropic: {
4936
+ toolsetName: part.toolset_name,
4937
+ ...(_b = getAnthropicCallerMetadata(part.caller).providerMetadata) == null ? void 0 : _b.anthropic
4938
+ }
4939
+ }
4940
+ });
4676
4941
  } else {
4677
4942
  content.push({
4678
4943
  type: "tool-call",
@@ -4770,7 +5035,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4770
5035
  case "web_fetch_tool_result": {
4771
5036
  if (part.content.type === "web_fetch_result") {
4772
5037
  citationDocuments.push({
4773
- title: (_b = part.content.content.title) != null ? _b : part.content.url,
5038
+ title: (_c = part.content.content.title) != null ? _c : part.content.url,
4774
5039
  mediaType: part.content.content.source.media_type
4775
5040
  });
4776
5041
  content.push({
@@ -4836,7 +5101,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4836
5101
  ...result.title != null ? { title: result.title } : {},
4837
5102
  providerMetadata: {
4838
5103
  anthropic: {
4839
- pageAge: (_c = result.page_age) != null ? _c : null
5104
+ pageAge: (_d = result.page_age) != null ? _d : null
4840
5105
  }
4841
5106
  }
4842
5107
  });
@@ -4868,7 +5133,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4868
5133
  stdout: part.content.stdout,
4869
5134
  stderr: part.content.stderr,
4870
5135
  return_code: part.content.return_code,
4871
- content: (_d = part.content.content) != null ? _d : []
5136
+ content: (_e = part.content.content) != null ? _e : []
4872
5137
  }
4873
5138
  });
4874
5139
  } else if (part.content.type === "encrypted_code_execution_result") {
@@ -4881,7 +5146,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
4881
5146
  encrypted_stdout: part.content.encrypted_stdout,
4882
5147
  stderr: part.content.stderr,
4883
5148
  return_code: part.content.return_code,
4884
- content: (_e = part.content.content) != null ? _e : []
5149
+ content: (_f = part.content.content) != null ? _f : []
4885
5150
  }
4886
5151
  });
4887
5152
  } else if (part.content.type === "code_execution_tool_result_error") {
@@ -5009,13 +5274,13 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
5009
5274
  finishReason: response.stop_reason,
5010
5275
  isJsonResponseFromTool
5011
5276
  }),
5012
- raw: (_f = response.stop_reason) != null ? _f : void 0
5277
+ raw: (_g = response.stop_reason) != null ? _g : void 0
5013
5278
  },
5014
5279
  usage: convertAnthropicUsage({ usage: response.usage }),
5015
5280
  request: { body: args },
5016
5281
  response: {
5017
- id: (_g = response.id) != null ? _g : void 0,
5018
- modelId: (_h = response.model) != null ? _h : void 0,
5282
+ id: (_h = response.id) != null ? _h : void 0,
5283
+ modelId: (_i = response.model) != null ? _i : void 0,
5019
5284
  headers: responseHeaders,
5020
5285
  body: rawResponse
5021
5286
  },
@@ -5216,6 +5481,29 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
5216
5481
  type: "text-start",
5217
5482
  id: String(value.index)
5218
5483
  });
5484
+ } else if (part.toolset_name != null) {
5485
+ const callerInfo = getAnthropicCallerInfo(part.caller);
5486
+ const customToolName = toolNameMapping.toCustomToolName(
5487
+ part.toolset_name
5488
+ );
5489
+ const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
5490
+ contentBlocks[value.index] = {
5491
+ type: "tool-call",
5492
+ toolCallId: part.id,
5493
+ toolName: customToolName,
5494
+ input: hasNonEmptyInput ? JSON.stringify(part.input) : "",
5495
+ firstDelta: true,
5496
+ toolset: {
5497
+ name: part.toolset_name,
5498
+ memberName: part.name
5499
+ },
5500
+ ...callerInfo && { caller: callerInfo }
5501
+ };
5502
+ controller.enqueue({
5503
+ type: "tool-input-start",
5504
+ id: part.id,
5505
+ toolName: customToolName
5506
+ });
5219
5507
  } else {
5220
5508
  const callerInfo = getAnthropicCallerInfo(part.caller);
5221
5509
  const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
@@ -5615,6 +5903,25 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
5615
5903
  case "tool-call":
5616
5904
  const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === "json";
5617
5905
  if (!isJsonResponseTool) {
5906
+ if (contentBlock.toolset != null) {
5907
+ let memberInput = {};
5908
+ try {
5909
+ memberInput = contentBlock.input === "" ? {} : secureJsonParse2(contentBlock.input);
5910
+ } catch (e) {
5911
+ memberInput = void 0;
5912
+ }
5913
+ contentBlock.input = memberInput === void 0 ? contentBlock.input : JSON.stringify(
5914
+ toToolsetMemberInput({
5915
+ memberName: contentBlock.toolset.memberName,
5916
+ input: memberInput
5917
+ })
5918
+ );
5919
+ controller.enqueue({
5920
+ type: "tool-input-delta",
5921
+ id: contentBlock.toolCallId,
5922
+ delta: contentBlock.input
5923
+ });
5924
+ }
5618
5925
  controller.enqueue({
5619
5926
  type: "tool-input-end",
5620
5927
  id: contentBlock.toolCallId
@@ -5643,10 +5950,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
5643
5950
  // tool was not explicitly provided. We therefore bypass the general validation by marking the
5644
5951
  // tool as dynamic.
5645
5952
  ...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
5646
- ...contentBlock.caller && {
5953
+ ...(contentBlock.caller || contentBlock.toolset) && {
5647
5954
  providerMetadata: {
5648
5955
  anthropic: {
5649
- caller: contentBlock.caller
5956
+ ...contentBlock.toolset && {
5957
+ toolsetName: contentBlock.toolset.name
5958
+ },
5959
+ ...contentBlock.caller && {
5960
+ caller: contentBlock.caller
5961
+ }
5650
5962
  }
5651
5963
  }
5652
5964
  }
@@ -5725,6 +6037,10 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
5725
6037
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
5726
6038
  return;
5727
6039
  }
6040
+ if (contentBlock.toolset != null) {
6041
+ contentBlock.input += delta;
6042
+ return;
6043
+ }
5728
6044
  if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
5729
6045
  delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
5730
6046
  }
@@ -5990,7 +6306,19 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
5990
6306
  }
5991
6307
  };
5992
6308
  function getModelCapabilities(modelId) {
5993
- if (modelId.includes("claude-opus-5")) {
6309
+ if (modelId.includes("claude-opus-5-5")) {
6310
+ return {
6311
+ maxOutputTokens: 128e3,
6312
+ supportsStructuredOutput: true,
6313
+ supportsAdaptiveThinking: true,
6314
+ rejectsSamplingParameters: true,
6315
+ supportsXhighEffort: true,
6316
+ rejectsThinkingDisabledAboveHighEffort: true,
6317
+ rejectsThinkingDisabled: true,
6318
+ rejectsForcedToolUse: true,
6319
+ isKnownModel: true
6320
+ };
6321
+ } else if (modelId.includes("claude-opus-5")) {
5994
6322
  return {
5995
6323
  maxOutputTokens: 128e3,
5996
6324
  supportsStructuredOutput: true,
@@ -5998,9 +6326,35 @@ function getModelCapabilities(modelId) {
5998
6326
  rejectsSamplingParameters: true,
5999
6327
  supportsXhighEffort: true,
6000
6328
  rejectsThinkingDisabledAboveHighEffort: true,
6329
+ rejectsThinkingDisabled: false,
6330
+ rejectsForcedToolUse: false,
6331
+ isKnownModel: true
6332
+ };
6333
+ } else if (modelId.includes("claude-fable-5-1")) {
6334
+ return {
6335
+ maxOutputTokens: 128e3,
6336
+ supportsStructuredOutput: true,
6337
+ supportsAdaptiveThinking: true,
6338
+ rejectsSamplingParameters: true,
6339
+ supportsXhighEffort: true,
6340
+ rejectsThinkingDisabledAboveHighEffort: false,
6341
+ rejectsThinkingDisabled: true,
6342
+ rejectsForcedToolUse: true,
6343
+ isKnownModel: true
6344
+ };
6345
+ } else if (modelId.includes("claude-fable-5")) {
6346
+ return {
6347
+ maxOutputTokens: 128e3,
6348
+ supportsStructuredOutput: true,
6349
+ supportsAdaptiveThinking: true,
6350
+ rejectsSamplingParameters: true,
6351
+ supportsXhighEffort: true,
6352
+ rejectsThinkingDisabledAboveHighEffort: false,
6353
+ rejectsThinkingDisabled: true,
6354
+ rejectsForcedToolUse: false,
6001
6355
  isKnownModel: true
6002
6356
  };
6003
- } else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-fable-5") || modelId.includes("claude-sonnet-5")) {
6357
+ } else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) {
6004
6358
  return {
6005
6359
  maxOutputTokens: 128e3,
6006
6360
  supportsStructuredOutput: true,
@@ -6008,6 +6362,8 @@ function getModelCapabilities(modelId) {
6008
6362
  rejectsSamplingParameters: true,
6009
6363
  supportsXhighEffort: true,
6010
6364
  rejectsThinkingDisabledAboveHighEffort: false,
6365
+ rejectsThinkingDisabled: false,
6366
+ rejectsForcedToolUse: false,
6011
6367
  isKnownModel: true
6012
6368
  };
6013
6369
  } else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
@@ -6018,6 +6374,8 @@ function getModelCapabilities(modelId) {
6018
6374
  rejectsSamplingParameters: false,
6019
6375
  supportsXhighEffort: false,
6020
6376
  rejectsThinkingDisabledAboveHighEffort: false,
6377
+ rejectsThinkingDisabled: false,
6378
+ rejectsForcedToolUse: false,
6021
6379
  isKnownModel: true
6022
6380
  };
6023
6381
  } else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
@@ -6028,6 +6386,8 @@ function getModelCapabilities(modelId) {
6028
6386
  rejectsSamplingParameters: false,
6029
6387
  supportsXhighEffort: false,
6030
6388
  rejectsThinkingDisabledAboveHighEffort: false,
6389
+ rejectsThinkingDisabled: false,
6390
+ rejectsForcedToolUse: false,
6031
6391
  isKnownModel: true
6032
6392
  };
6033
6393
  } else if (modelId.includes("claude-opus-4-1")) {
@@ -6038,6 +6398,8 @@ function getModelCapabilities(modelId) {
6038
6398
  rejectsSamplingParameters: false,
6039
6399
  supportsXhighEffort: false,
6040
6400
  rejectsThinkingDisabledAboveHighEffort: false,
6401
+ rejectsThinkingDisabled: false,
6402
+ rejectsForcedToolUse: false,
6041
6403
  isKnownModel: true
6042
6404
  };
6043
6405
  } else if (/claude-sonnet-4(?:-|@)/.test(modelId)) {
@@ -6048,6 +6410,8 @@ function getModelCapabilities(modelId) {
6048
6410
  rejectsSamplingParameters: false,
6049
6411
  supportsXhighEffort: false,
6050
6412
  rejectsThinkingDisabledAboveHighEffort: false,
6413
+ rejectsThinkingDisabled: false,
6414
+ rejectsForcedToolUse: false,
6051
6415
  isKnownModel: true
6052
6416
  };
6053
6417
  } else if (/claude-opus-4(?:-|@)/.test(modelId)) {
@@ -6058,6 +6422,8 @@ function getModelCapabilities(modelId) {
6058
6422
  rejectsSamplingParameters: false,
6059
6423
  supportsXhighEffort: false,
6060
6424
  rejectsThinkingDisabledAboveHighEffort: false,
6425
+ rejectsThinkingDisabled: false,
6426
+ rejectsForcedToolUse: false,
6061
6427
  isKnownModel: true
6062
6428
  };
6063
6429
  } else if (modelId.includes("claude-3-haiku")) {
@@ -6068,6 +6434,8 @@ function getModelCapabilities(modelId) {
6068
6434
  rejectsSamplingParameters: false,
6069
6435
  supportsXhighEffort: false,
6070
6436
  rejectsThinkingDisabledAboveHighEffort: false,
6437
+ rejectsThinkingDisabled: false,
6438
+ rejectsForcedToolUse: false,
6071
6439
  isKnownModel: true
6072
6440
  };
6073
6441
  } else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
@@ -6078,6 +6446,8 @@ function getModelCapabilities(modelId) {
6078
6446
  rejectsSamplingParameters: false,
6079
6447
  supportsXhighEffort: false,
6080
6448
  rejectsThinkingDisabledAboveHighEffort: false,
6449
+ rejectsThinkingDisabled: false,
6450
+ rejectsForcedToolUse: false,
6081
6451
  isKnownModel: false
6082
6452
  };
6083
6453
  } else if (modelId.includes("claude-")) {
@@ -6088,6 +6458,8 @@ function getModelCapabilities(modelId) {
6088
6458
  rejectsSamplingParameters: true,
6089
6459
  supportsXhighEffort: true,
6090
6460
  rejectsThinkingDisabledAboveHighEffort: true,
6461
+ rejectsThinkingDisabled: false,
6462
+ rejectsForcedToolUse: false,
6091
6463
  isKnownModel: false
6092
6464
  };
6093
6465
  } else {
@@ -6098,6 +6470,8 @@ function getModelCapabilities(modelId) {
6098
6470
  rejectsSamplingParameters: false,
6099
6471
  supportsXhighEffort: false,
6100
6472
  rejectsThinkingDisabledAboveHighEffort: false,
6473
+ rejectsThinkingDisabled: false,
6474
+ rejectsForcedToolUse: false,
6101
6475
  isKnownModel: false
6102
6476
  };
6103
6477
  }
@@ -6122,8 +6496,10 @@ function hasDynamicFilteringWebToolWithoutCodeExecution(tools) {
6122
6496
  }
6123
6497
  function resolveAnthropicReasoningConfig({
6124
6498
  reasoning,
6499
+ modelId,
6125
6500
  supportsAdaptiveThinking,
6126
6501
  supportsXhighEffort,
6502
+ rejectsThinkingDisabled,
6127
6503
  maxOutputTokensForModel,
6128
6504
  warnings
6129
6505
  }) {
@@ -6131,6 +6507,14 @@ function resolveAnthropicReasoningConfig({
6131
6507
  return void 0;
6132
6508
  }
6133
6509
  if (reasoning === "none") {
6510
+ if (rejectsThinkingDisabled) {
6511
+ warnings.push({
6512
+ type: "compatibility",
6513
+ feature: "reasoning",
6514
+ details: `reasoning 'none' is not supported by ${modelId}; it always uses adaptive thinking. Using effort 'low' to minimize thinking instead.`
6515
+ });
6516
+ return { effort: "low" };
6517
+ }
6134
6518
  return { thinking: { type: "disabled" } };
6135
6519
  }
6136
6520
  if (supportsAdaptiveThinking) {
@@ -6212,47 +6596,47 @@ import {
6212
6596
  generateId as generateId2,
6213
6597
  getFromApi,
6214
6598
  isRecord as isRecord2,
6215
- lazySchema as lazySchema16,
6599
+ lazySchema as lazySchema17,
6216
6600
  normalizeBatchRequestCounts,
6217
6601
  normalizeHeaders,
6218
6602
  parseProviderOptions as parseProviderOptions3,
6219
6603
  postJsonToApi as postJsonToApi2,
6220
6604
  resolve as resolve2,
6221
6605
  safeValidateTypes,
6222
- zodSchema as zodSchema16
6606
+ zodSchema as zodSchema17
6223
6607
  } from "@ai-sdk/provider-utils";
6224
- import { z as z17 } from "zod/v4";
6608
+ import { z as z18 } from "zod/v4";
6225
6609
  var anthropicBatchRequestIdPattern = /^[A-Za-z0-9_-]{1,64}$/;
6226
6610
  var anthropicBatchProviderOptionsSchema = anthropicLanguageModelOptions.pick({
6227
6611
  anthropicBeta: true
6228
6612
  });
6229
- var anthropicBatchResponseZodSchema = () => z17.object({
6230
- id: z17.string(),
6231
- type: z17.literal("message_batch"),
6232
- processing_status: z17.string(),
6233
- request_counts: z17.object({
6234
- processing: z17.number(),
6235
- succeeded: z17.number(),
6236
- errored: z17.number(),
6237
- canceled: z17.number(),
6238
- expired: z17.number()
6613
+ var anthropicBatchResponseZodSchema = () => z18.object({
6614
+ id: z18.string(),
6615
+ type: z18.literal("message_batch"),
6616
+ processing_status: z18.string(),
6617
+ request_counts: z18.object({
6618
+ processing: z18.number(),
6619
+ succeeded: z18.number(),
6620
+ errored: z18.number(),
6621
+ canceled: z18.number(),
6622
+ expired: z18.number()
6239
6623
  }),
6240
- created_at: z17.string(),
6241
- expires_at: z17.string(),
6242
- archived_at: z17.string().nullish(),
6243
- cancel_initiated_at: z17.string().nullish(),
6244
- ended_at: z17.string().nullish(),
6245
- results_url: z17.string().nullish()
6624
+ created_at: z18.string(),
6625
+ expires_at: z18.string(),
6626
+ archived_at: z18.string().nullish(),
6627
+ cancel_initiated_at: z18.string().nullish(),
6628
+ ended_at: z18.string().nullish(),
6629
+ results_url: z18.string().nullish()
6246
6630
  });
6247
- var anthropicBatchResponseSchema = lazySchema16(
6248
- () => zodSchema16(anthropicBatchResponseZodSchema())
6631
+ var anthropicBatchResponseSchema = lazySchema17(
6632
+ () => zodSchema17(anthropicBatchResponseZodSchema())
6249
6633
  );
6250
- var anthropicBatchListResponseSchema = lazySchema16(
6251
- () => zodSchema16(
6252
- z17.object({
6253
- data: z17.array(anthropicBatchResponseZodSchema()),
6254
- has_more: z17.boolean(),
6255
- last_id: z17.string().nullish()
6634
+ var anthropicBatchListResponseSchema = lazySchema17(
6635
+ () => zodSchema17(
6636
+ z18.object({
6637
+ data: z18.array(anthropicBatchResponseZodSchema()),
6638
+ has_more: z18.boolean(),
6639
+ last_id: z18.string().nullish()
6256
6640
  })
6257
6641
  )
6258
6642
  );
@@ -6275,34 +6659,34 @@ var knownAnthropicBatchContentTypes = /* @__PURE__ */ new Set([
6275
6659
  "web_fetch_tool_result",
6276
6660
  "web_search_tool_result"
6277
6661
  ]);
6278
- var anthropicBatchResultSchema = lazySchema16(
6279
- () => zodSchema16(
6280
- z17.discriminatedUnion("type", [
6281
- z17.object({
6282
- type: z17.literal("succeeded"),
6283
- message: z17.unknown()
6662
+ var anthropicBatchResultSchema = lazySchema17(
6663
+ () => zodSchema17(
6664
+ z18.discriminatedUnion("type", [
6665
+ z18.object({
6666
+ type: z18.literal("succeeded"),
6667
+ message: z18.unknown()
6284
6668
  }),
6285
- z17.object({
6286
- type: z17.literal("errored"),
6287
- error: z17.object({
6288
- type: z17.literal("error"),
6289
- error: z17.object({
6290
- type: z17.string(),
6291
- message: z17.string()
6669
+ z18.object({
6670
+ type: z18.literal("errored"),
6671
+ error: z18.object({
6672
+ type: z18.literal("error"),
6673
+ error: z18.object({
6674
+ type: z18.string(),
6675
+ message: z18.string()
6292
6676
  }),
6293
- request_id: z17.string().nullish()
6677
+ request_id: z18.string().nullish()
6294
6678
  })
6295
6679
  }),
6296
- z17.object({ type: z17.literal("canceled") }),
6297
- z17.object({ type: z17.literal("expired") })
6680
+ z18.object({ type: z18.literal("canceled") }),
6681
+ z18.object({ type: z18.literal("expired") })
6298
6682
  ])
6299
6683
  )
6300
6684
  );
6301
- var anthropicBatchResultLineSchema = lazySchema16(
6302
- () => zodSchema16(
6303
- z17.object({
6304
- custom_id: z17.string(),
6305
- result: z17.unknown()
6685
+ var anthropicBatchResultLineSchema = lazySchema17(
6686
+ () => zodSchema17(
6687
+ z18.object({
6688
+ custom_id: z18.string(),
6689
+ result: z18.unknown()
6306
6690
  })
6307
6691
  )
6308
6692
  );
@@ -6784,6 +7168,9 @@ function convertAnthropicBatchResponse(response, generateId4) {
6784
7168
  });
6785
7169
  break;
6786
7170
  case "compaction":
7171
+ if (!part.content) {
7172
+ break;
7173
+ }
6787
7174
  content.push({
6788
7175
  type: "text",
6789
7176
  text: part.content,
@@ -7114,20 +7501,20 @@ function mapAnthropicStopDetails2(stopDetails) {
7114
7501
 
7115
7502
  // src/tool/bash_20241022.ts
7116
7503
  import {
7117
- createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
7118
- lazySchema as lazySchema17,
7119
- zodSchema as zodSchema17
7504
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
7505
+ lazySchema as lazySchema18,
7506
+ zodSchema as zodSchema18
7120
7507
  } from "@ai-sdk/provider-utils";
7121
- import { z as z18 } from "zod/v4";
7122
- var bash_20241022InputSchema = lazySchema17(
7123
- () => zodSchema17(
7124
- z18.object({
7125
- command: z18.string(),
7126
- restart: z18.boolean().optional()
7508
+ import { z as z19 } from "zod/v4";
7509
+ var bash_20241022InputSchema = lazySchema18(
7510
+ () => zodSchema18(
7511
+ z19.object({
7512
+ command: z19.string(),
7513
+ restart: z19.boolean().optional()
7127
7514
  })
7128
7515
  )
7129
7516
  );
7130
- var bash_20241022_internal = createProviderDefinedToolFactory2({
7517
+ var bash_20241022_internal = createProviderDefinedToolFactory3({
7131
7518
  id: "anthropic.bash_20241022",
7132
7519
  inputSchema: bash_20241022InputSchema
7133
7520
  });
@@ -7155,20 +7542,20 @@ function bash_20241022(options = {}) {
7155
7542
 
7156
7543
  // src/tool/bash_20250124.ts
7157
7544
  import {
7158
- createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
7159
- lazySchema as lazySchema18,
7160
- zodSchema as zodSchema18
7545
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
7546
+ lazySchema as lazySchema19,
7547
+ zodSchema as zodSchema19
7161
7548
  } from "@ai-sdk/provider-utils";
7162
- import { z as z19 } from "zod/v4";
7163
- var bash_20250124InputSchema = lazySchema18(
7164
- () => zodSchema18(
7165
- z19.object({
7166
- command: z19.string(),
7167
- restart: z19.boolean().optional()
7549
+ import { z as z20 } from "zod/v4";
7550
+ var bash_20250124InputSchema = lazySchema19(
7551
+ () => zodSchema19(
7552
+ z20.object({
7553
+ command: z20.string(),
7554
+ restart: z20.boolean().optional()
7168
7555
  })
7169
7556
  )
7170
7557
  );
7171
- var bash_20250124_internal = createProviderDefinedToolFactory3({
7558
+ var bash_20250124_internal = createProviderDefinedToolFactory4({
7172
7559
  id: "anthropic.bash_20250124",
7173
7560
  inputSchema: bash_20250124InputSchema
7174
7561
  });
@@ -7196,15 +7583,15 @@ function bash_20250124(options = {}) {
7196
7583
 
7197
7584
  // src/tool/computer_20241022.ts
7198
7585
  import {
7199
- createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
7200
- lazySchema as lazySchema19,
7201
- zodSchema as zodSchema19
7586
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
7587
+ lazySchema as lazySchema20,
7588
+ zodSchema as zodSchema20
7202
7589
  } from "@ai-sdk/provider-utils";
7203
- import { z as z20 } from "zod/v4";
7204
- var computer_20241022InputSchema = lazySchema19(
7205
- () => zodSchema19(
7206
- z20.object({
7207
- action: z20.enum([
7590
+ import { z as z21 } from "zod/v4";
7591
+ var computer_20241022InputSchema = lazySchema20(
7592
+ () => zodSchema20(
7593
+ z21.object({
7594
+ action: z21.enum([
7208
7595
  "key",
7209
7596
  "type",
7210
7597
  "mouse_move",
@@ -7216,27 +7603,27 @@ var computer_20241022InputSchema = lazySchema19(
7216
7603
  "screenshot",
7217
7604
  "cursor_position"
7218
7605
  ]),
7219
- coordinate: z20.array(z20.number().int()).optional(),
7220
- text: z20.string().optional()
7606
+ coordinate: z21.array(z21.number().int()).optional(),
7607
+ text: z21.string().optional()
7221
7608
  })
7222
7609
  )
7223
7610
  );
7224
- var computer_20241022 = createProviderDefinedToolFactory4({
7611
+ var computer_20241022 = createProviderDefinedToolFactory5({
7225
7612
  id: "anthropic.computer_20241022",
7226
7613
  inputSchema: computer_20241022InputSchema
7227
7614
  });
7228
7615
 
7229
7616
  // src/tool/computer_20250124.ts
7230
7617
  import {
7231
- createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
7232
- lazySchema as lazySchema20,
7233
- zodSchema as zodSchema20
7618
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
7619
+ lazySchema as lazySchema21,
7620
+ zodSchema as zodSchema21
7234
7621
  } from "@ai-sdk/provider-utils";
7235
- import { z as z21 } from "zod/v4";
7236
- var computer_20250124InputSchema = lazySchema20(
7237
- () => zodSchema20(
7238
- z21.object({
7239
- action: z21.enum([
7622
+ import { z as z22 } from "zod/v4";
7623
+ var computer_20250124InputSchema = lazySchema21(
7624
+ () => zodSchema21(
7625
+ z22.object({
7626
+ action: z22.enum([
7240
7627
  "key",
7241
7628
  "hold_key",
7242
7629
  "type",
@@ -7254,31 +7641,31 @@ var computer_20250124InputSchema = lazySchema20(
7254
7641
  "wait",
7255
7642
  "screenshot"
7256
7643
  ]),
7257
- coordinate: z21.tuple([z21.number().int(), z21.number().int()]).optional(),
7258
- duration: z21.number().optional(),
7259
- scroll_amount: z21.number().optional(),
7260
- scroll_direction: z21.enum(["up", "down", "left", "right"]).optional(),
7261
- start_coordinate: z21.tuple([z21.number().int(), z21.number().int()]).optional(),
7262
- text: z21.string().optional()
7644
+ coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
7645
+ duration: z22.number().optional(),
7646
+ scroll_amount: z22.number().optional(),
7647
+ scroll_direction: z22.enum(["up", "down", "left", "right"]).optional(),
7648
+ start_coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
7649
+ text: z22.string().optional()
7263
7650
  })
7264
7651
  )
7265
7652
  );
7266
- var computer_20250124 = createProviderDefinedToolFactory5({
7653
+ var computer_20250124 = createProviderDefinedToolFactory6({
7267
7654
  id: "anthropic.computer_20250124",
7268
7655
  inputSchema: computer_20250124InputSchema
7269
7656
  });
7270
7657
 
7271
7658
  // src/tool/computer_20251124.ts
7272
7659
  import {
7273
- createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
7274
- lazySchema as lazySchema21,
7275
- zodSchema as zodSchema21
7660
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
7661
+ lazySchema as lazySchema22,
7662
+ zodSchema as zodSchema22
7276
7663
  } from "@ai-sdk/provider-utils";
7277
- import { z as z22 } from "zod/v4";
7278
- var computer_20251124InputSchema = lazySchema21(
7279
- () => zodSchema21(
7280
- z22.object({
7281
- action: z22.enum([
7664
+ import { z as z23 } from "zod/v4";
7665
+ var computer_20251124InputSchema = lazySchema22(
7666
+ () => zodSchema22(
7667
+ z23.object({
7668
+ action: z23.enum([
7282
7669
  "key",
7283
7670
  "hold_key",
7284
7671
  "type",
@@ -7297,109 +7684,83 @@ var computer_20251124InputSchema = lazySchema21(
7297
7684
  "screenshot",
7298
7685
  "zoom"
7299
7686
  ]),
7300
- coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
7301
- duration: z22.number().optional(),
7302
- region: z22.tuple([
7303
- z22.number().int(),
7304
- z22.number().int(),
7305
- z22.number().int(),
7306
- z22.number().int()
7687
+ coordinate: z23.tuple([z23.number().int(), z23.number().int()]).optional(),
7688
+ duration: z23.number().optional(),
7689
+ region: z23.tuple([
7690
+ z23.number().int(),
7691
+ z23.number().int(),
7692
+ z23.number().int(),
7693
+ z23.number().int()
7307
7694
  ]).optional(),
7308
- scroll_amount: z22.number().optional(),
7309
- scroll_direction: z22.enum(["up", "down", "left", "right"]).optional(),
7310
- start_coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
7311
- text: z22.string().optional()
7695
+ scroll_amount: z23.number().optional(),
7696
+ scroll_direction: z23.enum(["up", "down", "left", "right"]).optional(),
7697
+ start_coordinate: z23.tuple([z23.number().int(), z23.number().int()]).optional(),
7698
+ text: z23.string().optional()
7312
7699
  })
7313
7700
  )
7314
7701
  );
7315
- var computer_20251124 = createProviderDefinedToolFactory6({
7702
+ var computer_20251124 = createProviderDefinedToolFactory7({
7316
7703
  id: "anthropic.computer_20251124",
7317
7704
  inputSchema: computer_20251124InputSchema
7318
7705
  });
7319
7706
 
7320
7707
  // src/tool/memory_20250818.ts
7321
7708
  import {
7322
- createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
7323
- lazySchema as lazySchema22,
7324
- zodSchema as zodSchema22
7709
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
7710
+ lazySchema as lazySchema23,
7711
+ zodSchema as zodSchema23
7325
7712
  } from "@ai-sdk/provider-utils";
7326
- import { z as z23 } from "zod/v4";
7327
- var memory_20250818InputSchema = lazySchema22(
7328
- () => zodSchema22(
7329
- z23.discriminatedUnion("command", [
7330
- z23.object({
7331
- command: z23.literal("view"),
7332
- path: z23.string(),
7333
- view_range: z23.tuple([z23.number(), z23.number()]).optional()
7713
+ import { z as z24 } from "zod/v4";
7714
+ var memory_20250818InputSchema = lazySchema23(
7715
+ () => zodSchema23(
7716
+ z24.discriminatedUnion("command", [
7717
+ z24.object({
7718
+ command: z24.literal("view"),
7719
+ path: z24.string(),
7720
+ view_range: z24.tuple([z24.number(), z24.number()]).optional()
7334
7721
  }),
7335
- z23.object({
7336
- command: z23.literal("create"),
7337
- path: z23.string(),
7338
- file_text: z23.string()
7722
+ z24.object({
7723
+ command: z24.literal("create"),
7724
+ path: z24.string(),
7725
+ file_text: z24.string()
7339
7726
  }),
7340
- z23.object({
7341
- command: z23.literal("str_replace"),
7342
- path: z23.string(),
7343
- old_str: z23.string(),
7344
- new_str: z23.string()
7727
+ z24.object({
7728
+ command: z24.literal("str_replace"),
7729
+ path: z24.string(),
7730
+ old_str: z24.string(),
7731
+ new_str: z24.string()
7345
7732
  }),
7346
- z23.object({
7347
- command: z23.literal("insert"),
7348
- path: z23.string(),
7349
- insert_line: z23.number(),
7350
- insert_text: z23.string()
7733
+ z24.object({
7734
+ command: z24.literal("insert"),
7735
+ path: z24.string(),
7736
+ insert_line: z24.number(),
7737
+ insert_text: z24.string()
7351
7738
  }),
7352
- z23.object({
7353
- command: z23.literal("delete"),
7354
- path: z23.string()
7739
+ z24.object({
7740
+ command: z24.literal("delete"),
7741
+ path: z24.string()
7355
7742
  }),
7356
- z23.object({
7357
- command: z23.literal("rename"),
7358
- old_path: z23.string(),
7359
- new_path: z23.string()
7743
+ z24.object({
7744
+ command: z24.literal("rename"),
7745
+ old_path: z24.string(),
7746
+ new_path: z24.string()
7360
7747
  })
7361
7748
  ])
7362
7749
  )
7363
7750
  );
7364
- var memory_20250818 = createProviderDefinedToolFactory7({
7751
+ var memory_20250818 = createProviderDefinedToolFactory8({
7365
7752
  id: "anthropic.memory_20250818",
7366
7753
  inputSchema: memory_20250818InputSchema
7367
7754
  });
7368
7755
 
7369
7756
  // src/tool/text-editor_20241022.ts
7370
- import {
7371
- createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
7372
- lazySchema as lazySchema23,
7373
- zodSchema as zodSchema23
7374
- } from "@ai-sdk/provider-utils";
7375
- import { z as z24 } from "zod/v4";
7376
- var textEditor_20241022InputSchema = lazySchema23(
7377
- () => zodSchema23(
7378
- z24.object({
7379
- command: z24.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
7380
- path: z24.string(),
7381
- file_text: z24.string().optional(),
7382
- insert_line: z24.number().int().optional(),
7383
- new_str: z24.string().optional(),
7384
- insert_text: z24.string().optional(),
7385
- old_str: z24.string().optional(),
7386
- view_range: z24.array(z24.number().int()).optional()
7387
- })
7388
- )
7389
- );
7390
- var textEditor_20241022 = createProviderDefinedToolFactory8({
7391
- id: "anthropic.text_editor_20241022",
7392
- inputSchema: textEditor_20241022InputSchema
7393
- });
7394
-
7395
- // src/tool/text-editor_20250124.ts
7396
7757
  import {
7397
7758
  createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
7398
7759
  lazySchema as lazySchema24,
7399
7760
  zodSchema as zodSchema24
7400
7761
  } from "@ai-sdk/provider-utils";
7401
7762
  import { z as z25 } from "zod/v4";
7402
- var textEditor_20250124InputSchema = lazySchema24(
7763
+ var textEditor_20241022InputSchema = lazySchema24(
7403
7764
  () => zodSchema24(
7404
7765
  z25.object({
7405
7766
  command: z25.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
@@ -7413,22 +7774,22 @@ var textEditor_20250124InputSchema = lazySchema24(
7413
7774
  })
7414
7775
  )
7415
7776
  );
7416
- var textEditor_20250124 = createProviderDefinedToolFactory9({
7417
- id: "anthropic.text_editor_20250124",
7418
- inputSchema: textEditor_20250124InputSchema
7777
+ var textEditor_20241022 = createProviderDefinedToolFactory9({
7778
+ id: "anthropic.text_editor_20241022",
7779
+ inputSchema: textEditor_20241022InputSchema
7419
7780
  });
7420
7781
 
7421
- // src/tool/text-editor_20250429.ts
7782
+ // src/tool/text-editor_20250124.ts
7422
7783
  import {
7423
7784
  createProviderDefinedToolFactory as createProviderDefinedToolFactory10,
7424
7785
  lazySchema as lazySchema25,
7425
7786
  zodSchema as zodSchema25
7426
7787
  } from "@ai-sdk/provider-utils";
7427
7788
  import { z as z26 } from "zod/v4";
7428
- var textEditor_20250429InputSchema = lazySchema25(
7789
+ var textEditor_20250124InputSchema = lazySchema25(
7429
7790
  () => zodSchema25(
7430
7791
  z26.object({
7431
- command: z26.enum(["view", "create", "str_replace", "insert"]),
7792
+ command: z26.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
7432
7793
  path: z26.string(),
7433
7794
  file_text: z26.string().optional(),
7434
7795
  insert_line: z26.number().int().optional(),
@@ -7439,40 +7800,66 @@ var textEditor_20250429InputSchema = lazySchema25(
7439
7800
  })
7440
7801
  )
7441
7802
  );
7442
- var textEditor_20250429 = createProviderDefinedToolFactory10({
7443
- id: "anthropic.text_editor_20250429",
7444
- inputSchema: textEditor_20250429InputSchema
7803
+ var textEditor_20250124 = createProviderDefinedToolFactory10({
7804
+ id: "anthropic.text_editor_20250124",
7805
+ inputSchema: textEditor_20250124InputSchema
7445
7806
  });
7446
7807
 
7447
- // src/tool/tool-search-bm25_20251119.ts
7808
+ // src/tool/text-editor_20250429.ts
7448
7809
  import {
7449
- createProviderExecutedToolFactory as createProviderExecutedToolFactory12,
7810
+ createProviderDefinedToolFactory as createProviderDefinedToolFactory11,
7450
7811
  lazySchema as lazySchema26,
7451
7812
  zodSchema as zodSchema26
7452
7813
  } from "@ai-sdk/provider-utils";
7453
7814
  import { z as z27 } from "zod/v4";
7454
- var toolSearchBm25_20251119OutputSchema = lazySchema26(
7815
+ var textEditor_20250429InputSchema = lazySchema26(
7455
7816
  () => zodSchema26(
7456
- z27.array(
7457
- z27.object({
7458
- type: z27.literal("tool_reference"),
7459
- toolName: z27.string()
7817
+ z27.object({
7818
+ command: z27.enum(["view", "create", "str_replace", "insert"]),
7819
+ path: z27.string(),
7820
+ file_text: z27.string().optional(),
7821
+ insert_line: z27.number().int().optional(),
7822
+ new_str: z27.string().optional(),
7823
+ insert_text: z27.string().optional(),
7824
+ old_str: z27.string().optional(),
7825
+ view_range: z27.array(z27.number().int()).optional()
7826
+ })
7827
+ )
7828
+ );
7829
+ var textEditor_20250429 = createProviderDefinedToolFactory11({
7830
+ id: "anthropic.text_editor_20250429",
7831
+ inputSchema: textEditor_20250429InputSchema
7832
+ });
7833
+
7834
+ // src/tool/tool-search-bm25_20251119.ts
7835
+ import {
7836
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory12,
7837
+ lazySchema as lazySchema27,
7838
+ zodSchema as zodSchema27
7839
+ } from "@ai-sdk/provider-utils";
7840
+ import { z as z28 } from "zod/v4";
7841
+ var toolSearchBm25_20251119OutputSchema = lazySchema27(
7842
+ () => zodSchema27(
7843
+ z28.array(
7844
+ z28.object({
7845
+ type: z28.literal("tool_reference"),
7846
+ toolName: z28.string()
7460
7847
  })
7461
7848
  )
7462
7849
  )
7463
7850
  );
7464
- var toolSearchBm25_20251119InputSchema = lazySchema26(
7465
- () => zodSchema26(
7466
- z27.object({
7851
+ var toolSearchBm25_20251119InputSchema = lazySchema27(
7852
+ () => zodSchema27(
7853
+ z28.object({
7467
7854
  /**
7468
7855
  * A natural language query to search for tools.
7469
7856
  * Claude will use BM25 text search to find relevant tools.
7470
7857
  */
7471
- query: z27.string(),
7858
+ query: z28.string(),
7472
7859
  /**
7473
7860
  * Maximum number of tools to return. Optional.
7474
7861
  */
7475
- limit: z27.number().optional()
7862
+ limit: z28.number().optional()
7476
7863
  })
7477
7864
  )
7478
7865
  );
@@ -7604,6 +7991,29 @@ var anthropicTools = {
7604
7991
  * @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
7605
7992
  */
7606
7993
  computer_20251124,
7994
+ /**
7995
+ * The computer toolset lets Claude control a computer through screenshots,
7996
+ * mouse, and keyboard. It replaces the versioned computer tools
7997
+ * (`computer_20251124` and earlier) on newer models.
7998
+ *
7999
+ * The API returns each computer action as its own `tool_use` block with
8000
+ * `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
8001
+ * and exposes the member name as `action`, so `execute` receives the same
8002
+ * input shape as the older computer tools. Claude may return several actions
8003
+ * in one turn.
8004
+ *
8005
+ * Coordinates are always in the pixel space of the screenshots you return;
8006
+ * there are no display size parameters. Zoom is enabled by default.
8007
+ *
8008
+ * Does not require a beta header.
8009
+ *
8010
+ * Supported models: Claude Opus 5.5 (required; older computer tool types
8011
+ * are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
8012
+ *
8013
+ * @param configs - Per-member settings keyed by member name, e.g.
8014
+ * `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
8015
+ */
8016
+ computerToolset_20260801,
7607
8017
  /**
7608
8018
  * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
7609
8019
  * Claude can create, read, update, and delete files that persist between sessions,
@@ -7752,40 +8162,40 @@ import {
7752
8162
  } from "@ai-sdk/provider-utils";
7753
8163
 
7754
8164
  // src/skills/anthropic-skills-api.ts
7755
- import { lazySchema as lazySchema27, zodSchema as zodSchema27 } from "@ai-sdk/provider-utils";
7756
- import { z as z28 } from "zod/v4";
7757
- var anthropicSkillResponseSchema = lazySchema27(
7758
- () => zodSchema27(
7759
- z28.object({
7760
- id: z28.string(),
7761
- display_title: z28.string().nullish(),
7762
- name: z28.string().nullish(),
7763
- description: z28.string().nullish(),
7764
- latest_version: z28.string().nullish(),
7765
- source: z28.string(),
7766
- created_at: z28.string(),
7767
- updated_at: z28.string()
8165
+ import { lazySchema as lazySchema28, zodSchema as zodSchema28 } from "@ai-sdk/provider-utils";
8166
+ import { z as z29 } from "zod/v4";
8167
+ var anthropicSkillResponseSchema = lazySchema28(
8168
+ () => zodSchema28(
8169
+ z29.object({
8170
+ id: z29.string(),
8171
+ display_title: z29.string().nullish(),
8172
+ name: z29.string().nullish(),
8173
+ description: z29.string().nullish(),
8174
+ latest_version: z29.string().nullish(),
8175
+ source: z29.string(),
8176
+ created_at: z29.string(),
8177
+ updated_at: z29.string()
7768
8178
  })
7769
8179
  )
7770
8180
  );
7771
- var anthropicSkillVersionListResponseSchema = lazySchema27(
7772
- () => zodSchema27(
7773
- z28.object({
7774
- data: z28.array(
7775
- z28.object({
7776
- version: z28.string()
8181
+ var anthropicSkillVersionListResponseSchema = lazySchema28(
8182
+ () => zodSchema28(
8183
+ z29.object({
8184
+ data: z29.array(
8185
+ z29.object({
8186
+ version: z29.string()
7777
8187
  })
7778
8188
  )
7779
8189
  })
7780
8190
  )
7781
8191
  );
7782
- var anthropicSkillVersionResponseSchema = lazySchema27(
7783
- () => zodSchema27(
7784
- z28.object({
7785
- type: z28.string(),
7786
- skill_id: z28.string(),
7787
- name: z28.string().nullish(),
7788
- description: z28.string().nullish()
8192
+ var anthropicSkillVersionResponseSchema = lazySchema28(
8193
+ () => zodSchema28(
8194
+ z29.object({
8195
+ type: z29.string(),
8196
+ skill_id: z29.string(),
8197
+ name: z29.string().nullish(),
8198
+ description: z29.string().nullish()
7789
8199
  })
7790
8200
  )
7791
8201
  );
@@ -7876,7 +8286,7 @@ var AnthropicSkills = class {
7876
8286
  };
7877
8287
 
7878
8288
  // src/version.ts
7879
- var VERSION = true ? "4.0.59" : "0.0.0-test";
8289
+ var VERSION = true ? "4.0.61" : "0.0.0-test";
7880
8290
 
7881
8291
  // src/anthropic-provider.ts
7882
8292
  var ANTHROPIC_API_URL = "https://api.anthropic.com";