@ai-sdk/anthropic 4.0.59 → 4.0.60
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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +47 -1
- package/dist/index.js +958 -559
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +84 -2
- package/dist/internal/index.js +906 -507
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +125 -14
- package/package.json +1 -1
- package/src/anthropic-api.ts +23 -0
- package/src/anthropic-language-model-options.ts +13 -3
- package/src/anthropic-language-model.ts +287 -5
- package/src/anthropic-prepare-tools.ts +76 -0
- package/src/anthropic-tools.ts +25 -0
- package/src/convert-to-anthropic-prompt.ts +74 -1
- package/src/tool/computer-toolset_20260801.ts +165 -0
package/dist/index.js
CHANGED
|
@@ -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-
|
|
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
|
-
*
|
|
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/
|
|
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
|
|
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
|
-
|
|
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
|
|
1465
|
+
var computerToolset_20260801ArgsSchema = lazySchema5(
|
|
1420
1466
|
() => zodSchema5(
|
|
1421
1467
|
z6.object({
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
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
|
|
1434
|
-
id: "anthropic.
|
|
1435
|
-
inputSchema:
|
|
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/
|
|
1483
|
+
// src/tool/text-editor_20250728.ts
|
|
1442
1484
|
import {
|
|
1443
|
-
|
|
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
|
|
1490
|
+
var textEditor_20250728ArgsSchema = lazySchema6(
|
|
1449
1491
|
() => zodSchema6(
|
|
1450
1492
|
z7.object({
|
|
1451
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
1486
|
-
id: "anthropic.
|
|
1487
|
-
inputSchema:
|
|
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
|
|
1492
|
-
return
|
|
1515
|
+
var textEditor_20250728 = (args = {}) => {
|
|
1516
|
+
return factory2(args);
|
|
1493
1517
|
};
|
|
1494
1518
|
|
|
1495
|
-
// src/tool/web-
|
|
1519
|
+
// src/tool/web-search_20260318.ts
|
|
1496
1520
|
import {
|
|
1497
|
-
createProviderExecutedToolFactory as
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1539
|
-
id: "anthropic.
|
|
1540
|
-
inputSchema:
|
|
1541
|
-
outputSchema:
|
|
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
|
|
1545
|
-
return
|
|
1569
|
+
var webSearch_20260318 = (args = {}) => {
|
|
1570
|
+
return factory3(args);
|
|
1546
1571
|
};
|
|
1547
1572
|
|
|
1548
|
-
// src/tool/web-
|
|
1573
|
+
// src/tool/web-search_20260209.ts
|
|
1549
1574
|
import {
|
|
1550
|
-
createProviderExecutedToolFactory as
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1592
|
-
id: "anthropic.
|
|
1593
|
-
inputSchema:
|
|
1594
|
-
outputSchema:
|
|
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
|
|
1598
|
-
return
|
|
1622
|
+
var webSearch_20260209 = (args = {}) => {
|
|
1623
|
+
return factory4(args);
|
|
1599
1624
|
};
|
|
1600
1625
|
|
|
1601
|
-
// src/tool/web-
|
|
1626
|
+
// src/tool/web-search_20250305.ts
|
|
1602
1627
|
import {
|
|
1603
|
-
createProviderExecutedToolFactory as
|
|
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
|
|
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
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
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
|
|
1649
|
+
var webSearch_20250305OutputSchema = lazySchema9(
|
|
1622
1650
|
() => zodSchema9(
|
|
1623
|
-
z10.
|
|
1624
|
-
|
|
1625
|
-
|
|
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
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
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
|
|
1662
|
+
var webSearch_20250305InputSchema = lazySchema9(
|
|
1648
1663
|
() => zodSchema9(
|
|
1649
1664
|
z10.object({
|
|
1650
|
-
|
|
1665
|
+
query: z10.string()
|
|
1651
1666
|
})
|
|
1652
1667
|
)
|
|
1653
1668
|
);
|
|
1654
|
-
var
|
|
1655
|
-
id: "anthropic.
|
|
1656
|
-
inputSchema:
|
|
1657
|
-
outputSchema:
|
|
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
|
|
1661
|
-
return
|
|
1675
|
+
var webSearch_20250305 = (args = {}) => {
|
|
1676
|
+
return factory5(args);
|
|
1662
1677
|
};
|
|
1663
1678
|
|
|
1664
|
-
// src/tool/web-fetch-
|
|
1679
|
+
// src/tool/web-fetch-20260318.ts
|
|
1665
1680
|
import {
|
|
1666
|
-
createProviderExecutedToolFactory as
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1716
|
-
id: "anthropic.
|
|
1717
|
-
inputSchema:
|
|
1718
|
-
outputSchema:
|
|
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
|
|
1722
|
-
return
|
|
1738
|
+
var webFetch_20260318 = (args = {}) => {
|
|
1739
|
+
return factory6(args);
|
|
1723
1740
|
};
|
|
1724
1741
|
|
|
1725
|
-
// src/tool/web-fetch-
|
|
1742
|
+
// src/tool/web-fetch-20260209.ts
|
|
1726
1743
|
import {
|
|
1727
|
-
createProviderExecutedToolFactory as
|
|
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
|
|
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
|
|
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
|
|
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
|
|
2256
|
-
zodSchema as
|
|
2393
|
+
lazySchema as lazySchema13,
|
|
2394
|
+
zodSchema as zodSchema13
|
|
2257
2395
|
} from "@ai-sdk/provider-utils";
|
|
2258
|
-
import { z as
|
|
2259
|
-
var codeExecution_20250522OutputSchema =
|
|
2260
|
-
() =>
|
|
2261
|
-
|
|
2262
|
-
type:
|
|
2263
|
-
stdout:
|
|
2264
|
-
stderr:
|
|
2265
|
-
return_code:
|
|
2266
|
-
content:
|
|
2267
|
-
|
|
2268
|
-
type:
|
|
2269
|
-
file_id:
|
|
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 =
|
|
2276
|
-
() =>
|
|
2277
|
-
|
|
2278
|
-
code:
|
|
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
|
|
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
|
|
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
|
|
2567
|
-
zodSchema as
|
|
2704
|
+
lazySchema as lazySchema16,
|
|
2705
|
+
zodSchema as zodSchema16
|
|
2568
2706
|
} from "@ai-sdk/provider-utils";
|
|
2569
|
-
import { z as
|
|
2570
|
-
var toolSearchRegex_20251119OutputSchema =
|
|
2571
|
-
() =>
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
type:
|
|
2575
|
-
toolName:
|
|
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 =
|
|
2581
|
-
() =>
|
|
2582
|
-
|
|
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:
|
|
2731
|
+
pattern: z17.string(),
|
|
2594
2732
|
/**
|
|
2595
2733
|
* Maximum number of tools to return. Optional.
|
|
2596
2734
|
*/
|
|
2597
|
-
limit:
|
|
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-
|
|
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
|
|
@@ -3258,6 +3403,33 @@ async function convertToAnthropicPrompt({
|
|
|
3258
3403
|
}
|
|
3259
3404
|
break;
|
|
3260
3405
|
}
|
|
3406
|
+
const toolsetName = getAnthropicToolsetName({
|
|
3407
|
+
toolName: part.toolName,
|
|
3408
|
+
providerOptions: part.providerOptions,
|
|
3409
|
+
toolsetNames
|
|
3410
|
+
});
|
|
3411
|
+
if (toolsetName != null) {
|
|
3412
|
+
const { action, ...memberInput } = toAnthropicToolInput(
|
|
3413
|
+
part.input
|
|
3414
|
+
);
|
|
3415
|
+
if (typeof action !== "string") {
|
|
3416
|
+
warnings.push({
|
|
3417
|
+
type: "other",
|
|
3418
|
+
message: `toolset tool call for tool ${part.toolName} is missing the action`
|
|
3419
|
+
});
|
|
3420
|
+
break;
|
|
3421
|
+
}
|
|
3422
|
+
anthropicContent.push({
|
|
3423
|
+
type: "tool_use",
|
|
3424
|
+
id: part.toolCallId,
|
|
3425
|
+
name: action,
|
|
3426
|
+
toolset_name: toolsetName,
|
|
3427
|
+
input: memberInput,
|
|
3428
|
+
...caller && { caller },
|
|
3429
|
+
cache_control: cacheControl
|
|
3430
|
+
});
|
|
3431
|
+
break;
|
|
3432
|
+
}
|
|
3261
3433
|
anthropicContent.push({
|
|
3262
3434
|
type: "tool_use",
|
|
3263
3435
|
id: part.toolCallId,
|
|
@@ -3681,6 +3853,19 @@ function moveToolUseBlocksToEnd(content) {
|
|
|
3681
3853
|
flushSegment();
|
|
3682
3854
|
return result;
|
|
3683
3855
|
}
|
|
3856
|
+
function getAnthropicToolsetName({
|
|
3857
|
+
toolName,
|
|
3858
|
+
providerOptions,
|
|
3859
|
+
toolsetNames
|
|
3860
|
+
}) {
|
|
3861
|
+
var _a;
|
|
3862
|
+
const fromTools = toolsetNames[toolName];
|
|
3863
|
+
if (fromTools != null) {
|
|
3864
|
+
return fromTools;
|
|
3865
|
+
}
|
|
3866
|
+
const fromMetadata = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.toolsetName;
|
|
3867
|
+
return typeof fromMetadata === "string" ? fromMetadata : void 0;
|
|
3868
|
+
}
|
|
3684
3869
|
function getAnthropicCaller(providerOptions) {
|
|
3685
3870
|
var _a;
|
|
3686
3871
|
const caller = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.caller;
|
|
@@ -3950,9 +4135,27 @@ function getAnthropicCallerInfo(caller) {
|
|
|
3950
4135
|
toolId: "tool_id" in caller ? caller.tool_id : void 0
|
|
3951
4136
|
};
|
|
3952
4137
|
}
|
|
3953
|
-
function getAnthropicCallerMetadata(caller) {
|
|
3954
|
-
const callerInfo = getAnthropicCallerInfo(caller);
|
|
3955
|
-
return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
|
|
4138
|
+
function getAnthropicCallerMetadata(caller) {
|
|
4139
|
+
const callerInfo = getAnthropicCallerInfo(caller);
|
|
4140
|
+
return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
|
|
4141
|
+
}
|
|
4142
|
+
function getAnthropicToolsetNames(tools) {
|
|
4143
|
+
const toolsetNames = {};
|
|
4144
|
+
for (const tool of tools != null ? tools : []) {
|
|
4145
|
+
if (tool.type === "provider" && tool.id === "anthropic.computer_toolset_20260801") {
|
|
4146
|
+
toolsetNames[tool.name] = "computer";
|
|
4147
|
+
}
|
|
4148
|
+
}
|
|
4149
|
+
return toolsetNames;
|
|
4150
|
+
}
|
|
4151
|
+
function toToolsetMemberInput({
|
|
4152
|
+
memberName,
|
|
4153
|
+
input
|
|
4154
|
+
}) {
|
|
4155
|
+
return {
|
|
4156
|
+
action: memberName,
|
|
4157
|
+
...typeof input === "object" && input !== null && !Array.isArray(input) ? input : {}
|
|
4158
|
+
};
|
|
3956
4159
|
}
|
|
3957
4160
|
function getProviderOptionsName(provider) {
|
|
3958
4161
|
const dotIndex = provider.indexOf(".");
|
|
@@ -4066,6 +4269,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4066
4269
|
rejectsSamplingParameters,
|
|
4067
4270
|
supportsXhighEffort,
|
|
4068
4271
|
rejectsThinkingDisabledAboveHighEffort,
|
|
4272
|
+
rejectsThinkingDisabled,
|
|
4273
|
+
rejectsForcedToolUse,
|
|
4069
4274
|
isKnownModel
|
|
4070
4275
|
} = getModelCapabilities(modelId);
|
|
4071
4276
|
if (!isKnownModel && maxOutputTokens == null) {
|
|
@@ -4105,7 +4310,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4105
4310
|
const supportsStructuredOutput = ((_a = config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
4106
4311
|
const supportsStrictTools = ((_b = config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
4107
4312
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
4108
|
-
|
|
4313
|
+
let useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
4314
|
+
if (!useStructuredOutput && rejectsForcedToolUse && supportsStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
|
|
4315
|
+
warnings.push({
|
|
4316
|
+
type: "unsupported",
|
|
4317
|
+
feature: "providerOptions.anthropic.structuredOutputMode",
|
|
4318
|
+
details: `structuredOutputMode 'jsonTool' is not supported by ${modelId} because it rejects forced tool use. Using 'outputFormat' instead.`
|
|
4319
|
+
});
|
|
4320
|
+
useStructuredOutput = true;
|
|
4321
|
+
}
|
|
4109
4322
|
const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
4110
4323
|
type: "function",
|
|
4111
4324
|
name: "json",
|
|
@@ -4129,6 +4342,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4129
4342
|
"anthropic.code_execution_20260120": "code_execution",
|
|
4130
4343
|
"anthropic.computer_20241022": "computer",
|
|
4131
4344
|
"anthropic.computer_20250124": "computer",
|
|
4345
|
+
"anthropic.computer_20251124": "computer",
|
|
4346
|
+
"anthropic.computer_toolset_20260801": "computer",
|
|
4132
4347
|
"anthropic.text_editor_20241022": "str_replace_editor",
|
|
4133
4348
|
"anthropic.text_editor_20250124": "str_replace_editor",
|
|
4134
4349
|
"anthropic.text_editor_20250429": "str_replace_based_edit_tool",
|
|
@@ -4147,18 +4362,22 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4147
4362
|
"anthropic.advisor_20260301": "advisor"
|
|
4148
4363
|
}
|
|
4149
4364
|
});
|
|
4365
|
+
const toolsetNames = getAnthropicToolsetNames(tools);
|
|
4150
4366
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicPrompt({
|
|
4151
4367
|
prompt,
|
|
4152
4368
|
sendReasoning: (_d = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _d : true,
|
|
4153
4369
|
warnings,
|
|
4154
4370
|
cacheControlValidator,
|
|
4155
|
-
toolNameMapping
|
|
4371
|
+
toolNameMapping,
|
|
4372
|
+
toolsetNames
|
|
4156
4373
|
});
|
|
4157
4374
|
if (isCustomReasoning(reasoning) && (anthropicOptions == null ? void 0 : anthropicOptions.effort) == null) {
|
|
4158
4375
|
const reasoningConfig = resolveAnthropicReasoningConfig({
|
|
4159
4376
|
reasoning,
|
|
4377
|
+
modelId,
|
|
4160
4378
|
supportsAdaptiveThinking,
|
|
4161
4379
|
supportsXhighEffort,
|
|
4380
|
+
rejectsThinkingDisabled,
|
|
4162
4381
|
maxOutputTokensForModel,
|
|
4163
4382
|
warnings
|
|
4164
4383
|
});
|
|
@@ -4171,6 +4390,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4171
4390
|
}
|
|
4172
4391
|
}
|
|
4173
4392
|
}
|
|
4393
|
+
if (rejectsThinkingDisabled && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null) {
|
|
4394
|
+
const thinking = anthropicOptions.thinking;
|
|
4395
|
+
if (thinking.type === "disabled") {
|
|
4396
|
+
warnings.push({
|
|
4397
|
+
type: "unsupported",
|
|
4398
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4399
|
+
details: `thinking cannot be disabled for ${modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
|
|
4400
|
+
});
|
|
4401
|
+
anthropicOptions.thinking = void 0;
|
|
4402
|
+
} else if (thinking.type === "enabled") {
|
|
4403
|
+
warnings.push({
|
|
4404
|
+
type: "unsupported",
|
|
4405
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4406
|
+
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.`
|
|
4407
|
+
});
|
|
4408
|
+
anthropicOptions.thinking = { type: "adaptive" };
|
|
4409
|
+
}
|
|
4410
|
+
}
|
|
4174
4411
|
if (rejectsThinkingDisabledAboveHighEffort && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.type) === "disabled" && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
4175
4412
|
warnings.push({
|
|
4176
4413
|
type: "unsupported",
|
|
@@ -4457,7 +4694,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4457
4694
|
cacheControlValidator,
|
|
4458
4695
|
supportsStructuredOutput: false,
|
|
4459
4696
|
supportsStrictTools,
|
|
4460
|
-
defaultEagerInputStreaming
|
|
4697
|
+
defaultEagerInputStreaming,
|
|
4698
|
+
rejectsForcedToolUse
|
|
4461
4699
|
} : {
|
|
4462
4700
|
tools: tools != null ? tools : [],
|
|
4463
4701
|
toolChoice,
|
|
@@ -4465,7 +4703,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4465
4703
|
cacheControlValidator,
|
|
4466
4704
|
supportsStructuredOutput,
|
|
4467
4705
|
supportsStrictTools,
|
|
4468
|
-
defaultEagerInputStreaming
|
|
4706
|
+
defaultEagerInputStreaming,
|
|
4707
|
+
rejectsForcedToolUse
|
|
4469
4708
|
}
|
|
4470
4709
|
);
|
|
4471
4710
|
const cacheWarnings = cacheControlValidator.getWarnings();
|
|
@@ -4551,7 +4790,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4551
4790
|
});
|
|
4552
4791
|
}
|
|
4553
4792
|
async doGenerate(options) {
|
|
4554
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4793
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
4555
4794
|
const {
|
|
4556
4795
|
args,
|
|
4557
4796
|
warnings,
|
|
@@ -4673,6 +4912,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4673
4912
|
type: "text",
|
|
4674
4913
|
text: JSON.stringify(part.input)
|
|
4675
4914
|
});
|
|
4915
|
+
} else if (part.toolset_name != null) {
|
|
4916
|
+
content.push({
|
|
4917
|
+
type: "tool-call",
|
|
4918
|
+
toolCallId: part.id,
|
|
4919
|
+
toolName: toolNameMapping.toCustomToolName(part.toolset_name),
|
|
4920
|
+
input: JSON.stringify(
|
|
4921
|
+
toToolsetMemberInput({
|
|
4922
|
+
memberName: part.name,
|
|
4923
|
+
input: part.input
|
|
4924
|
+
})
|
|
4925
|
+
),
|
|
4926
|
+
providerMetadata: {
|
|
4927
|
+
anthropic: {
|
|
4928
|
+
toolsetName: part.toolset_name,
|
|
4929
|
+
...(_b = getAnthropicCallerMetadata(part.caller).providerMetadata) == null ? void 0 : _b.anthropic
|
|
4930
|
+
}
|
|
4931
|
+
}
|
|
4932
|
+
});
|
|
4676
4933
|
} else {
|
|
4677
4934
|
content.push({
|
|
4678
4935
|
type: "tool-call",
|
|
@@ -4770,7 +5027,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4770
5027
|
case "web_fetch_tool_result": {
|
|
4771
5028
|
if (part.content.type === "web_fetch_result") {
|
|
4772
5029
|
citationDocuments.push({
|
|
4773
|
-
title: (
|
|
5030
|
+
title: (_c = part.content.content.title) != null ? _c : part.content.url,
|
|
4774
5031
|
mediaType: part.content.content.source.media_type
|
|
4775
5032
|
});
|
|
4776
5033
|
content.push({
|
|
@@ -4836,7 +5093,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4836
5093
|
...result.title != null ? { title: result.title } : {},
|
|
4837
5094
|
providerMetadata: {
|
|
4838
5095
|
anthropic: {
|
|
4839
|
-
pageAge: (
|
|
5096
|
+
pageAge: (_d = result.page_age) != null ? _d : null
|
|
4840
5097
|
}
|
|
4841
5098
|
}
|
|
4842
5099
|
});
|
|
@@ -4868,7 +5125,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4868
5125
|
stdout: part.content.stdout,
|
|
4869
5126
|
stderr: part.content.stderr,
|
|
4870
5127
|
return_code: part.content.return_code,
|
|
4871
|
-
content: (
|
|
5128
|
+
content: (_e = part.content.content) != null ? _e : []
|
|
4872
5129
|
}
|
|
4873
5130
|
});
|
|
4874
5131
|
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
@@ -4881,7 +5138,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4881
5138
|
encrypted_stdout: part.content.encrypted_stdout,
|
|
4882
5139
|
stderr: part.content.stderr,
|
|
4883
5140
|
return_code: part.content.return_code,
|
|
4884
|
-
content: (
|
|
5141
|
+
content: (_f = part.content.content) != null ? _f : []
|
|
4885
5142
|
}
|
|
4886
5143
|
});
|
|
4887
5144
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
@@ -5009,13 +5266,13 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5009
5266
|
finishReason: response.stop_reason,
|
|
5010
5267
|
isJsonResponseFromTool
|
|
5011
5268
|
}),
|
|
5012
|
-
raw: (
|
|
5269
|
+
raw: (_g = response.stop_reason) != null ? _g : void 0
|
|
5013
5270
|
},
|
|
5014
5271
|
usage: convertAnthropicUsage({ usage: response.usage }),
|
|
5015
5272
|
request: { body: args },
|
|
5016
5273
|
response: {
|
|
5017
|
-
id: (
|
|
5018
|
-
modelId: (
|
|
5274
|
+
id: (_h = response.id) != null ? _h : void 0,
|
|
5275
|
+
modelId: (_i = response.model) != null ? _i : void 0,
|
|
5019
5276
|
headers: responseHeaders,
|
|
5020
5277
|
body: rawResponse
|
|
5021
5278
|
},
|
|
@@ -5216,6 +5473,29 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5216
5473
|
type: "text-start",
|
|
5217
5474
|
id: String(value.index)
|
|
5218
5475
|
});
|
|
5476
|
+
} else if (part.toolset_name != null) {
|
|
5477
|
+
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5478
|
+
const customToolName = toolNameMapping.toCustomToolName(
|
|
5479
|
+
part.toolset_name
|
|
5480
|
+
);
|
|
5481
|
+
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
5482
|
+
contentBlocks[value.index] = {
|
|
5483
|
+
type: "tool-call",
|
|
5484
|
+
toolCallId: part.id,
|
|
5485
|
+
toolName: customToolName,
|
|
5486
|
+
input: hasNonEmptyInput ? JSON.stringify(part.input) : "",
|
|
5487
|
+
firstDelta: true,
|
|
5488
|
+
toolset: {
|
|
5489
|
+
name: part.toolset_name,
|
|
5490
|
+
memberName: part.name
|
|
5491
|
+
},
|
|
5492
|
+
...callerInfo && { caller: callerInfo }
|
|
5493
|
+
};
|
|
5494
|
+
controller.enqueue({
|
|
5495
|
+
type: "tool-input-start",
|
|
5496
|
+
id: part.id,
|
|
5497
|
+
toolName: customToolName
|
|
5498
|
+
});
|
|
5219
5499
|
} else {
|
|
5220
5500
|
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5221
5501
|
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
@@ -5615,6 +5895,25 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5615
5895
|
case "tool-call":
|
|
5616
5896
|
const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === "json";
|
|
5617
5897
|
if (!isJsonResponseTool) {
|
|
5898
|
+
if (contentBlock.toolset != null) {
|
|
5899
|
+
let memberInput = {};
|
|
5900
|
+
try {
|
|
5901
|
+
memberInput = contentBlock.input === "" ? {} : secureJsonParse2(contentBlock.input);
|
|
5902
|
+
} catch (e) {
|
|
5903
|
+
memberInput = void 0;
|
|
5904
|
+
}
|
|
5905
|
+
contentBlock.input = memberInput === void 0 ? contentBlock.input : JSON.stringify(
|
|
5906
|
+
toToolsetMemberInput({
|
|
5907
|
+
memberName: contentBlock.toolset.memberName,
|
|
5908
|
+
input: memberInput
|
|
5909
|
+
})
|
|
5910
|
+
);
|
|
5911
|
+
controller.enqueue({
|
|
5912
|
+
type: "tool-input-delta",
|
|
5913
|
+
id: contentBlock.toolCallId,
|
|
5914
|
+
delta: contentBlock.input
|
|
5915
|
+
});
|
|
5916
|
+
}
|
|
5618
5917
|
controller.enqueue({
|
|
5619
5918
|
type: "tool-input-end",
|
|
5620
5919
|
id: contentBlock.toolCallId
|
|
@@ -5643,10 +5942,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5643
5942
|
// tool was not explicitly provided. We therefore bypass the general validation by marking the
|
|
5644
5943
|
// tool as dynamic.
|
|
5645
5944
|
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
5646
|
-
...contentBlock.caller && {
|
|
5945
|
+
...(contentBlock.caller || contentBlock.toolset) && {
|
|
5647
5946
|
providerMetadata: {
|
|
5648
5947
|
anthropic: {
|
|
5649
|
-
|
|
5948
|
+
...contentBlock.toolset && {
|
|
5949
|
+
toolsetName: contentBlock.toolset.name
|
|
5950
|
+
},
|
|
5951
|
+
...contentBlock.caller && {
|
|
5952
|
+
caller: contentBlock.caller
|
|
5953
|
+
}
|
|
5650
5954
|
}
|
|
5651
5955
|
}
|
|
5652
5956
|
}
|
|
@@ -5725,6 +6029,10 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5725
6029
|
if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
|
|
5726
6030
|
return;
|
|
5727
6031
|
}
|
|
6032
|
+
if (contentBlock.toolset != null) {
|
|
6033
|
+
contentBlock.input += delta;
|
|
6034
|
+
return;
|
|
6035
|
+
}
|
|
5728
6036
|
if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
|
|
5729
6037
|
delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
|
|
5730
6038
|
}
|
|
@@ -5990,7 +6298,19 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5990
6298
|
}
|
|
5991
6299
|
};
|
|
5992
6300
|
function getModelCapabilities(modelId) {
|
|
5993
|
-
if (modelId.includes("claude-opus-5")) {
|
|
6301
|
+
if (modelId.includes("claude-opus-5-5")) {
|
|
6302
|
+
return {
|
|
6303
|
+
maxOutputTokens: 128e3,
|
|
6304
|
+
supportsStructuredOutput: true,
|
|
6305
|
+
supportsAdaptiveThinking: true,
|
|
6306
|
+
rejectsSamplingParameters: true,
|
|
6307
|
+
supportsXhighEffort: true,
|
|
6308
|
+
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6309
|
+
rejectsThinkingDisabled: true,
|
|
6310
|
+
rejectsForcedToolUse: true,
|
|
6311
|
+
isKnownModel: true
|
|
6312
|
+
};
|
|
6313
|
+
} else if (modelId.includes("claude-opus-5")) {
|
|
5994
6314
|
return {
|
|
5995
6315
|
maxOutputTokens: 128e3,
|
|
5996
6316
|
supportsStructuredOutput: true,
|
|
@@ -5998,9 +6318,35 @@ function getModelCapabilities(modelId) {
|
|
|
5998
6318
|
rejectsSamplingParameters: true,
|
|
5999
6319
|
supportsXhighEffort: true,
|
|
6000
6320
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6321
|
+
rejectsThinkingDisabled: false,
|
|
6322
|
+
rejectsForcedToolUse: false,
|
|
6323
|
+
isKnownModel: true
|
|
6324
|
+
};
|
|
6325
|
+
} else if (modelId.includes("claude-fable-5-1")) {
|
|
6326
|
+
return {
|
|
6327
|
+
maxOutputTokens: 128e3,
|
|
6328
|
+
supportsStructuredOutput: true,
|
|
6329
|
+
supportsAdaptiveThinking: true,
|
|
6330
|
+
rejectsSamplingParameters: true,
|
|
6331
|
+
supportsXhighEffort: true,
|
|
6332
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6333
|
+
rejectsThinkingDisabled: true,
|
|
6334
|
+
rejectsForcedToolUse: true,
|
|
6335
|
+
isKnownModel: true
|
|
6336
|
+
};
|
|
6337
|
+
} else if (modelId.includes("claude-fable-5")) {
|
|
6338
|
+
return {
|
|
6339
|
+
maxOutputTokens: 128e3,
|
|
6340
|
+
supportsStructuredOutput: true,
|
|
6341
|
+
supportsAdaptiveThinking: true,
|
|
6342
|
+
rejectsSamplingParameters: true,
|
|
6343
|
+
supportsXhighEffort: true,
|
|
6344
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6345
|
+
rejectsThinkingDisabled: true,
|
|
6346
|
+
rejectsForcedToolUse: false,
|
|
6001
6347
|
isKnownModel: true
|
|
6002
6348
|
};
|
|
6003
|
-
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-
|
|
6349
|
+
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) {
|
|
6004
6350
|
return {
|
|
6005
6351
|
maxOutputTokens: 128e3,
|
|
6006
6352
|
supportsStructuredOutput: true,
|
|
@@ -6008,6 +6354,8 @@ function getModelCapabilities(modelId) {
|
|
|
6008
6354
|
rejectsSamplingParameters: true,
|
|
6009
6355
|
supportsXhighEffort: true,
|
|
6010
6356
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6357
|
+
rejectsThinkingDisabled: false,
|
|
6358
|
+
rejectsForcedToolUse: false,
|
|
6011
6359
|
isKnownModel: true
|
|
6012
6360
|
};
|
|
6013
6361
|
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
@@ -6018,6 +6366,8 @@ function getModelCapabilities(modelId) {
|
|
|
6018
6366
|
rejectsSamplingParameters: false,
|
|
6019
6367
|
supportsXhighEffort: false,
|
|
6020
6368
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6369
|
+
rejectsThinkingDisabled: false,
|
|
6370
|
+
rejectsForcedToolUse: false,
|
|
6021
6371
|
isKnownModel: true
|
|
6022
6372
|
};
|
|
6023
6373
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
@@ -6028,6 +6378,8 @@ function getModelCapabilities(modelId) {
|
|
|
6028
6378
|
rejectsSamplingParameters: false,
|
|
6029
6379
|
supportsXhighEffort: false,
|
|
6030
6380
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6381
|
+
rejectsThinkingDisabled: false,
|
|
6382
|
+
rejectsForcedToolUse: false,
|
|
6031
6383
|
isKnownModel: true
|
|
6032
6384
|
};
|
|
6033
6385
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
@@ -6038,6 +6390,8 @@ function getModelCapabilities(modelId) {
|
|
|
6038
6390
|
rejectsSamplingParameters: false,
|
|
6039
6391
|
supportsXhighEffort: false,
|
|
6040
6392
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6393
|
+
rejectsThinkingDisabled: false,
|
|
6394
|
+
rejectsForcedToolUse: false,
|
|
6041
6395
|
isKnownModel: true
|
|
6042
6396
|
};
|
|
6043
6397
|
} else if (/claude-sonnet-4(?:-|@)/.test(modelId)) {
|
|
@@ -6048,6 +6402,8 @@ function getModelCapabilities(modelId) {
|
|
|
6048
6402
|
rejectsSamplingParameters: false,
|
|
6049
6403
|
supportsXhighEffort: false,
|
|
6050
6404
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6405
|
+
rejectsThinkingDisabled: false,
|
|
6406
|
+
rejectsForcedToolUse: false,
|
|
6051
6407
|
isKnownModel: true
|
|
6052
6408
|
};
|
|
6053
6409
|
} else if (/claude-opus-4(?:-|@)/.test(modelId)) {
|
|
@@ -6058,6 +6414,8 @@ function getModelCapabilities(modelId) {
|
|
|
6058
6414
|
rejectsSamplingParameters: false,
|
|
6059
6415
|
supportsXhighEffort: false,
|
|
6060
6416
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6417
|
+
rejectsThinkingDisabled: false,
|
|
6418
|
+
rejectsForcedToolUse: false,
|
|
6061
6419
|
isKnownModel: true
|
|
6062
6420
|
};
|
|
6063
6421
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
@@ -6068,6 +6426,8 @@ function getModelCapabilities(modelId) {
|
|
|
6068
6426
|
rejectsSamplingParameters: false,
|
|
6069
6427
|
supportsXhighEffort: false,
|
|
6070
6428
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6429
|
+
rejectsThinkingDisabled: false,
|
|
6430
|
+
rejectsForcedToolUse: false,
|
|
6071
6431
|
isKnownModel: true
|
|
6072
6432
|
};
|
|
6073
6433
|
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
@@ -6078,6 +6438,8 @@ function getModelCapabilities(modelId) {
|
|
|
6078
6438
|
rejectsSamplingParameters: false,
|
|
6079
6439
|
supportsXhighEffort: false,
|
|
6080
6440
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6441
|
+
rejectsThinkingDisabled: false,
|
|
6442
|
+
rejectsForcedToolUse: false,
|
|
6081
6443
|
isKnownModel: false
|
|
6082
6444
|
};
|
|
6083
6445
|
} else if (modelId.includes("claude-")) {
|
|
@@ -6088,6 +6450,8 @@ function getModelCapabilities(modelId) {
|
|
|
6088
6450
|
rejectsSamplingParameters: true,
|
|
6089
6451
|
supportsXhighEffort: true,
|
|
6090
6452
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6453
|
+
rejectsThinkingDisabled: false,
|
|
6454
|
+
rejectsForcedToolUse: false,
|
|
6091
6455
|
isKnownModel: false
|
|
6092
6456
|
};
|
|
6093
6457
|
} else {
|
|
@@ -6098,6 +6462,8 @@ function getModelCapabilities(modelId) {
|
|
|
6098
6462
|
rejectsSamplingParameters: false,
|
|
6099
6463
|
supportsXhighEffort: false,
|
|
6100
6464
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6465
|
+
rejectsThinkingDisabled: false,
|
|
6466
|
+
rejectsForcedToolUse: false,
|
|
6101
6467
|
isKnownModel: false
|
|
6102
6468
|
};
|
|
6103
6469
|
}
|
|
@@ -6122,8 +6488,10 @@ function hasDynamicFilteringWebToolWithoutCodeExecution(tools) {
|
|
|
6122
6488
|
}
|
|
6123
6489
|
function resolveAnthropicReasoningConfig({
|
|
6124
6490
|
reasoning,
|
|
6491
|
+
modelId,
|
|
6125
6492
|
supportsAdaptiveThinking,
|
|
6126
6493
|
supportsXhighEffort,
|
|
6494
|
+
rejectsThinkingDisabled,
|
|
6127
6495
|
maxOutputTokensForModel,
|
|
6128
6496
|
warnings
|
|
6129
6497
|
}) {
|
|
@@ -6131,6 +6499,14 @@ function resolveAnthropicReasoningConfig({
|
|
|
6131
6499
|
return void 0;
|
|
6132
6500
|
}
|
|
6133
6501
|
if (reasoning === "none") {
|
|
6502
|
+
if (rejectsThinkingDisabled) {
|
|
6503
|
+
warnings.push({
|
|
6504
|
+
type: "compatibility",
|
|
6505
|
+
feature: "reasoning",
|
|
6506
|
+
details: `reasoning 'none' is not supported by ${modelId}; it always uses adaptive thinking. Using effort 'low' to minimize thinking instead.`
|
|
6507
|
+
});
|
|
6508
|
+
return { effort: "low" };
|
|
6509
|
+
}
|
|
6134
6510
|
return { thinking: { type: "disabled" } };
|
|
6135
6511
|
}
|
|
6136
6512
|
if (supportsAdaptiveThinking) {
|
|
@@ -6212,47 +6588,47 @@ import {
|
|
|
6212
6588
|
generateId as generateId2,
|
|
6213
6589
|
getFromApi,
|
|
6214
6590
|
isRecord as isRecord2,
|
|
6215
|
-
lazySchema as
|
|
6591
|
+
lazySchema as lazySchema17,
|
|
6216
6592
|
normalizeBatchRequestCounts,
|
|
6217
6593
|
normalizeHeaders,
|
|
6218
6594
|
parseProviderOptions as parseProviderOptions3,
|
|
6219
6595
|
postJsonToApi as postJsonToApi2,
|
|
6220
6596
|
resolve as resolve2,
|
|
6221
6597
|
safeValidateTypes,
|
|
6222
|
-
zodSchema as
|
|
6598
|
+
zodSchema as zodSchema17
|
|
6223
6599
|
} from "@ai-sdk/provider-utils";
|
|
6224
|
-
import { z as
|
|
6600
|
+
import { z as z18 } from "zod/v4";
|
|
6225
6601
|
var anthropicBatchRequestIdPattern = /^[A-Za-z0-9_-]{1,64}$/;
|
|
6226
6602
|
var anthropicBatchProviderOptionsSchema = anthropicLanguageModelOptions.pick({
|
|
6227
6603
|
anthropicBeta: true
|
|
6228
6604
|
});
|
|
6229
|
-
var anthropicBatchResponseZodSchema = () =>
|
|
6230
|
-
id:
|
|
6231
|
-
type:
|
|
6232
|
-
processing_status:
|
|
6233
|
-
request_counts:
|
|
6234
|
-
processing:
|
|
6235
|
-
succeeded:
|
|
6236
|
-
errored:
|
|
6237
|
-
canceled:
|
|
6238
|
-
expired:
|
|
6605
|
+
var anthropicBatchResponseZodSchema = () => z18.object({
|
|
6606
|
+
id: z18.string(),
|
|
6607
|
+
type: z18.literal("message_batch"),
|
|
6608
|
+
processing_status: z18.string(),
|
|
6609
|
+
request_counts: z18.object({
|
|
6610
|
+
processing: z18.number(),
|
|
6611
|
+
succeeded: z18.number(),
|
|
6612
|
+
errored: z18.number(),
|
|
6613
|
+
canceled: z18.number(),
|
|
6614
|
+
expired: z18.number()
|
|
6239
6615
|
}),
|
|
6240
|
-
created_at:
|
|
6241
|
-
expires_at:
|
|
6242
|
-
archived_at:
|
|
6243
|
-
cancel_initiated_at:
|
|
6244
|
-
ended_at:
|
|
6245
|
-
results_url:
|
|
6616
|
+
created_at: z18.string(),
|
|
6617
|
+
expires_at: z18.string(),
|
|
6618
|
+
archived_at: z18.string().nullish(),
|
|
6619
|
+
cancel_initiated_at: z18.string().nullish(),
|
|
6620
|
+
ended_at: z18.string().nullish(),
|
|
6621
|
+
results_url: z18.string().nullish()
|
|
6246
6622
|
});
|
|
6247
|
-
var anthropicBatchResponseSchema =
|
|
6248
|
-
() =>
|
|
6623
|
+
var anthropicBatchResponseSchema = lazySchema17(
|
|
6624
|
+
() => zodSchema17(anthropicBatchResponseZodSchema())
|
|
6249
6625
|
);
|
|
6250
|
-
var anthropicBatchListResponseSchema =
|
|
6251
|
-
() =>
|
|
6252
|
-
|
|
6253
|
-
data:
|
|
6254
|
-
has_more:
|
|
6255
|
-
last_id:
|
|
6626
|
+
var anthropicBatchListResponseSchema = lazySchema17(
|
|
6627
|
+
() => zodSchema17(
|
|
6628
|
+
z18.object({
|
|
6629
|
+
data: z18.array(anthropicBatchResponseZodSchema()),
|
|
6630
|
+
has_more: z18.boolean(),
|
|
6631
|
+
last_id: z18.string().nullish()
|
|
6256
6632
|
})
|
|
6257
6633
|
)
|
|
6258
6634
|
);
|
|
@@ -6275,34 +6651,34 @@ var knownAnthropicBatchContentTypes = /* @__PURE__ */ new Set([
|
|
|
6275
6651
|
"web_fetch_tool_result",
|
|
6276
6652
|
"web_search_tool_result"
|
|
6277
6653
|
]);
|
|
6278
|
-
var anthropicBatchResultSchema =
|
|
6279
|
-
() =>
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
type:
|
|
6283
|
-
message:
|
|
6654
|
+
var anthropicBatchResultSchema = lazySchema17(
|
|
6655
|
+
() => zodSchema17(
|
|
6656
|
+
z18.discriminatedUnion("type", [
|
|
6657
|
+
z18.object({
|
|
6658
|
+
type: z18.literal("succeeded"),
|
|
6659
|
+
message: z18.unknown()
|
|
6284
6660
|
}),
|
|
6285
|
-
|
|
6286
|
-
type:
|
|
6287
|
-
error:
|
|
6288
|
-
type:
|
|
6289
|
-
error:
|
|
6290
|
-
type:
|
|
6291
|
-
message:
|
|
6661
|
+
z18.object({
|
|
6662
|
+
type: z18.literal("errored"),
|
|
6663
|
+
error: z18.object({
|
|
6664
|
+
type: z18.literal("error"),
|
|
6665
|
+
error: z18.object({
|
|
6666
|
+
type: z18.string(),
|
|
6667
|
+
message: z18.string()
|
|
6292
6668
|
}),
|
|
6293
|
-
request_id:
|
|
6669
|
+
request_id: z18.string().nullish()
|
|
6294
6670
|
})
|
|
6295
6671
|
}),
|
|
6296
|
-
|
|
6297
|
-
|
|
6672
|
+
z18.object({ type: z18.literal("canceled") }),
|
|
6673
|
+
z18.object({ type: z18.literal("expired") })
|
|
6298
6674
|
])
|
|
6299
6675
|
)
|
|
6300
6676
|
);
|
|
6301
|
-
var anthropicBatchResultLineSchema =
|
|
6302
|
-
() =>
|
|
6303
|
-
|
|
6304
|
-
custom_id:
|
|
6305
|
-
result:
|
|
6677
|
+
var anthropicBatchResultLineSchema = lazySchema17(
|
|
6678
|
+
() => zodSchema17(
|
|
6679
|
+
z18.object({
|
|
6680
|
+
custom_id: z18.string(),
|
|
6681
|
+
result: z18.unknown()
|
|
6306
6682
|
})
|
|
6307
6683
|
)
|
|
6308
6684
|
);
|
|
@@ -7114,20 +7490,20 @@ function mapAnthropicStopDetails2(stopDetails) {
|
|
|
7114
7490
|
|
|
7115
7491
|
// src/tool/bash_20241022.ts
|
|
7116
7492
|
import {
|
|
7117
|
-
createProviderDefinedToolFactory as
|
|
7118
|
-
lazySchema as
|
|
7119
|
-
zodSchema as
|
|
7493
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
|
|
7494
|
+
lazySchema as lazySchema18,
|
|
7495
|
+
zodSchema as zodSchema18
|
|
7120
7496
|
} from "@ai-sdk/provider-utils";
|
|
7121
|
-
import { z as
|
|
7122
|
-
var bash_20241022InputSchema =
|
|
7123
|
-
() =>
|
|
7124
|
-
|
|
7125
|
-
command:
|
|
7126
|
-
restart:
|
|
7497
|
+
import { z as z19 } from "zod/v4";
|
|
7498
|
+
var bash_20241022InputSchema = lazySchema18(
|
|
7499
|
+
() => zodSchema18(
|
|
7500
|
+
z19.object({
|
|
7501
|
+
command: z19.string(),
|
|
7502
|
+
restart: z19.boolean().optional()
|
|
7127
7503
|
})
|
|
7128
7504
|
)
|
|
7129
7505
|
);
|
|
7130
|
-
var bash_20241022_internal =
|
|
7506
|
+
var bash_20241022_internal = createProviderDefinedToolFactory3({
|
|
7131
7507
|
id: "anthropic.bash_20241022",
|
|
7132
7508
|
inputSchema: bash_20241022InputSchema
|
|
7133
7509
|
});
|
|
@@ -7155,20 +7531,20 @@ function bash_20241022(options = {}) {
|
|
|
7155
7531
|
|
|
7156
7532
|
// src/tool/bash_20250124.ts
|
|
7157
7533
|
import {
|
|
7158
|
-
createProviderDefinedToolFactory as
|
|
7159
|
-
lazySchema as
|
|
7160
|
-
zodSchema as
|
|
7534
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
|
|
7535
|
+
lazySchema as lazySchema19,
|
|
7536
|
+
zodSchema as zodSchema19
|
|
7161
7537
|
} from "@ai-sdk/provider-utils";
|
|
7162
|
-
import { z as
|
|
7163
|
-
var bash_20250124InputSchema =
|
|
7164
|
-
() =>
|
|
7165
|
-
|
|
7166
|
-
command:
|
|
7167
|
-
restart:
|
|
7538
|
+
import { z as z20 } from "zod/v4";
|
|
7539
|
+
var bash_20250124InputSchema = lazySchema19(
|
|
7540
|
+
() => zodSchema19(
|
|
7541
|
+
z20.object({
|
|
7542
|
+
command: z20.string(),
|
|
7543
|
+
restart: z20.boolean().optional()
|
|
7168
7544
|
})
|
|
7169
7545
|
)
|
|
7170
7546
|
);
|
|
7171
|
-
var bash_20250124_internal =
|
|
7547
|
+
var bash_20250124_internal = createProviderDefinedToolFactory4({
|
|
7172
7548
|
id: "anthropic.bash_20250124",
|
|
7173
7549
|
inputSchema: bash_20250124InputSchema
|
|
7174
7550
|
});
|
|
@@ -7196,15 +7572,15 @@ function bash_20250124(options = {}) {
|
|
|
7196
7572
|
|
|
7197
7573
|
// src/tool/computer_20241022.ts
|
|
7198
7574
|
import {
|
|
7199
|
-
createProviderDefinedToolFactory as
|
|
7200
|
-
lazySchema as
|
|
7201
|
-
zodSchema as
|
|
7575
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
|
|
7576
|
+
lazySchema as lazySchema20,
|
|
7577
|
+
zodSchema as zodSchema20
|
|
7202
7578
|
} from "@ai-sdk/provider-utils";
|
|
7203
|
-
import { z as
|
|
7204
|
-
var computer_20241022InputSchema =
|
|
7205
|
-
() =>
|
|
7206
|
-
|
|
7207
|
-
action:
|
|
7579
|
+
import { z as z21 } from "zod/v4";
|
|
7580
|
+
var computer_20241022InputSchema = lazySchema20(
|
|
7581
|
+
() => zodSchema20(
|
|
7582
|
+
z21.object({
|
|
7583
|
+
action: z21.enum([
|
|
7208
7584
|
"key",
|
|
7209
7585
|
"type",
|
|
7210
7586
|
"mouse_move",
|
|
@@ -7216,27 +7592,27 @@ var computer_20241022InputSchema = lazySchema19(
|
|
|
7216
7592
|
"screenshot",
|
|
7217
7593
|
"cursor_position"
|
|
7218
7594
|
]),
|
|
7219
|
-
coordinate:
|
|
7220
|
-
text:
|
|
7595
|
+
coordinate: z21.array(z21.number().int()).optional(),
|
|
7596
|
+
text: z21.string().optional()
|
|
7221
7597
|
})
|
|
7222
7598
|
)
|
|
7223
7599
|
);
|
|
7224
|
-
var computer_20241022 =
|
|
7600
|
+
var computer_20241022 = createProviderDefinedToolFactory5({
|
|
7225
7601
|
id: "anthropic.computer_20241022",
|
|
7226
7602
|
inputSchema: computer_20241022InputSchema
|
|
7227
7603
|
});
|
|
7228
7604
|
|
|
7229
7605
|
// src/tool/computer_20250124.ts
|
|
7230
7606
|
import {
|
|
7231
|
-
createProviderDefinedToolFactory as
|
|
7232
|
-
lazySchema as
|
|
7233
|
-
zodSchema as
|
|
7607
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
|
|
7608
|
+
lazySchema as lazySchema21,
|
|
7609
|
+
zodSchema as zodSchema21
|
|
7234
7610
|
} from "@ai-sdk/provider-utils";
|
|
7235
|
-
import { z as
|
|
7236
|
-
var computer_20250124InputSchema =
|
|
7237
|
-
() =>
|
|
7238
|
-
|
|
7239
|
-
action:
|
|
7611
|
+
import { z as z22 } from "zod/v4";
|
|
7612
|
+
var computer_20250124InputSchema = lazySchema21(
|
|
7613
|
+
() => zodSchema21(
|
|
7614
|
+
z22.object({
|
|
7615
|
+
action: z22.enum([
|
|
7240
7616
|
"key",
|
|
7241
7617
|
"hold_key",
|
|
7242
7618
|
"type",
|
|
@@ -7254,31 +7630,31 @@ var computer_20250124InputSchema = lazySchema20(
|
|
|
7254
7630
|
"wait",
|
|
7255
7631
|
"screenshot"
|
|
7256
7632
|
]),
|
|
7257
|
-
coordinate:
|
|
7258
|
-
duration:
|
|
7259
|
-
scroll_amount:
|
|
7260
|
-
scroll_direction:
|
|
7261
|
-
start_coordinate:
|
|
7262
|
-
text:
|
|
7633
|
+
coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
|
|
7634
|
+
duration: z22.number().optional(),
|
|
7635
|
+
scroll_amount: z22.number().optional(),
|
|
7636
|
+
scroll_direction: z22.enum(["up", "down", "left", "right"]).optional(),
|
|
7637
|
+
start_coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
|
|
7638
|
+
text: z22.string().optional()
|
|
7263
7639
|
})
|
|
7264
7640
|
)
|
|
7265
7641
|
);
|
|
7266
|
-
var computer_20250124 =
|
|
7642
|
+
var computer_20250124 = createProviderDefinedToolFactory6({
|
|
7267
7643
|
id: "anthropic.computer_20250124",
|
|
7268
7644
|
inputSchema: computer_20250124InputSchema
|
|
7269
7645
|
});
|
|
7270
7646
|
|
|
7271
7647
|
// src/tool/computer_20251124.ts
|
|
7272
7648
|
import {
|
|
7273
|
-
createProviderDefinedToolFactory as
|
|
7274
|
-
lazySchema as
|
|
7275
|
-
zodSchema as
|
|
7649
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
|
|
7650
|
+
lazySchema as lazySchema22,
|
|
7651
|
+
zodSchema as zodSchema22
|
|
7276
7652
|
} from "@ai-sdk/provider-utils";
|
|
7277
|
-
import { z as
|
|
7278
|
-
var computer_20251124InputSchema =
|
|
7279
|
-
() =>
|
|
7280
|
-
|
|
7281
|
-
action:
|
|
7653
|
+
import { z as z23 } from "zod/v4";
|
|
7654
|
+
var computer_20251124InputSchema = lazySchema22(
|
|
7655
|
+
() => zodSchema22(
|
|
7656
|
+
z23.object({
|
|
7657
|
+
action: z23.enum([
|
|
7282
7658
|
"key",
|
|
7283
7659
|
"hold_key",
|
|
7284
7660
|
"type",
|
|
@@ -7297,109 +7673,83 @@ var computer_20251124InputSchema = lazySchema21(
|
|
|
7297
7673
|
"screenshot",
|
|
7298
7674
|
"zoom"
|
|
7299
7675
|
]),
|
|
7300
|
-
coordinate:
|
|
7301
|
-
duration:
|
|
7302
|
-
region:
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7676
|
+
coordinate: z23.tuple([z23.number().int(), z23.number().int()]).optional(),
|
|
7677
|
+
duration: z23.number().optional(),
|
|
7678
|
+
region: z23.tuple([
|
|
7679
|
+
z23.number().int(),
|
|
7680
|
+
z23.number().int(),
|
|
7681
|
+
z23.number().int(),
|
|
7682
|
+
z23.number().int()
|
|
7307
7683
|
]).optional(),
|
|
7308
|
-
scroll_amount:
|
|
7309
|
-
scroll_direction:
|
|
7310
|
-
start_coordinate:
|
|
7311
|
-
text:
|
|
7684
|
+
scroll_amount: z23.number().optional(),
|
|
7685
|
+
scroll_direction: z23.enum(["up", "down", "left", "right"]).optional(),
|
|
7686
|
+
start_coordinate: z23.tuple([z23.number().int(), z23.number().int()]).optional(),
|
|
7687
|
+
text: z23.string().optional()
|
|
7312
7688
|
})
|
|
7313
7689
|
)
|
|
7314
7690
|
);
|
|
7315
|
-
var computer_20251124 =
|
|
7691
|
+
var computer_20251124 = createProviderDefinedToolFactory7({
|
|
7316
7692
|
id: "anthropic.computer_20251124",
|
|
7317
7693
|
inputSchema: computer_20251124InputSchema
|
|
7318
7694
|
});
|
|
7319
7695
|
|
|
7320
7696
|
// src/tool/memory_20250818.ts
|
|
7321
7697
|
import {
|
|
7322
|
-
createProviderDefinedToolFactory as
|
|
7323
|
-
lazySchema as
|
|
7324
|
-
zodSchema as
|
|
7698
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
7699
|
+
lazySchema as lazySchema23,
|
|
7700
|
+
zodSchema as zodSchema23
|
|
7325
7701
|
} from "@ai-sdk/provider-utils";
|
|
7326
|
-
import { z as
|
|
7327
|
-
var memory_20250818InputSchema =
|
|
7328
|
-
() =>
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
command:
|
|
7332
|
-
path:
|
|
7333
|
-
view_range:
|
|
7702
|
+
import { z as z24 } from "zod/v4";
|
|
7703
|
+
var memory_20250818InputSchema = lazySchema23(
|
|
7704
|
+
() => zodSchema23(
|
|
7705
|
+
z24.discriminatedUnion("command", [
|
|
7706
|
+
z24.object({
|
|
7707
|
+
command: z24.literal("view"),
|
|
7708
|
+
path: z24.string(),
|
|
7709
|
+
view_range: z24.tuple([z24.number(), z24.number()]).optional()
|
|
7334
7710
|
}),
|
|
7335
|
-
|
|
7336
|
-
command:
|
|
7337
|
-
path:
|
|
7338
|
-
file_text:
|
|
7711
|
+
z24.object({
|
|
7712
|
+
command: z24.literal("create"),
|
|
7713
|
+
path: z24.string(),
|
|
7714
|
+
file_text: z24.string()
|
|
7339
7715
|
}),
|
|
7340
|
-
|
|
7341
|
-
command:
|
|
7342
|
-
path:
|
|
7343
|
-
old_str:
|
|
7344
|
-
new_str:
|
|
7716
|
+
z24.object({
|
|
7717
|
+
command: z24.literal("str_replace"),
|
|
7718
|
+
path: z24.string(),
|
|
7719
|
+
old_str: z24.string(),
|
|
7720
|
+
new_str: z24.string()
|
|
7345
7721
|
}),
|
|
7346
|
-
|
|
7347
|
-
command:
|
|
7348
|
-
path:
|
|
7349
|
-
insert_line:
|
|
7350
|
-
insert_text:
|
|
7722
|
+
z24.object({
|
|
7723
|
+
command: z24.literal("insert"),
|
|
7724
|
+
path: z24.string(),
|
|
7725
|
+
insert_line: z24.number(),
|
|
7726
|
+
insert_text: z24.string()
|
|
7351
7727
|
}),
|
|
7352
|
-
|
|
7353
|
-
command:
|
|
7354
|
-
path:
|
|
7728
|
+
z24.object({
|
|
7729
|
+
command: z24.literal("delete"),
|
|
7730
|
+
path: z24.string()
|
|
7355
7731
|
}),
|
|
7356
|
-
|
|
7357
|
-
command:
|
|
7358
|
-
old_path:
|
|
7359
|
-
new_path:
|
|
7732
|
+
z24.object({
|
|
7733
|
+
command: z24.literal("rename"),
|
|
7734
|
+
old_path: z24.string(),
|
|
7735
|
+
new_path: z24.string()
|
|
7360
7736
|
})
|
|
7361
7737
|
])
|
|
7362
7738
|
)
|
|
7363
7739
|
);
|
|
7364
|
-
var memory_20250818 =
|
|
7740
|
+
var memory_20250818 = createProviderDefinedToolFactory8({
|
|
7365
7741
|
id: "anthropic.memory_20250818",
|
|
7366
7742
|
inputSchema: memory_20250818InputSchema
|
|
7367
7743
|
});
|
|
7368
7744
|
|
|
7369
7745
|
// 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
7746
|
import {
|
|
7397
7747
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
|
|
7398
7748
|
lazySchema as lazySchema24,
|
|
7399
7749
|
zodSchema as zodSchema24
|
|
7400
7750
|
} from "@ai-sdk/provider-utils";
|
|
7401
7751
|
import { z as z25 } from "zod/v4";
|
|
7402
|
-
var
|
|
7752
|
+
var textEditor_20241022InputSchema = lazySchema24(
|
|
7403
7753
|
() => zodSchema24(
|
|
7404
7754
|
z25.object({
|
|
7405
7755
|
command: z25.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -7413,22 +7763,22 @@ var textEditor_20250124InputSchema = lazySchema24(
|
|
|
7413
7763
|
})
|
|
7414
7764
|
)
|
|
7415
7765
|
);
|
|
7416
|
-
var
|
|
7417
|
-
id: "anthropic.
|
|
7418
|
-
inputSchema:
|
|
7766
|
+
var textEditor_20241022 = createProviderDefinedToolFactory9({
|
|
7767
|
+
id: "anthropic.text_editor_20241022",
|
|
7768
|
+
inputSchema: textEditor_20241022InputSchema
|
|
7419
7769
|
});
|
|
7420
7770
|
|
|
7421
|
-
// src/tool/text-
|
|
7771
|
+
// src/tool/text-editor_20250124.ts
|
|
7422
7772
|
import {
|
|
7423
7773
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory10,
|
|
7424
7774
|
lazySchema as lazySchema25,
|
|
7425
7775
|
zodSchema as zodSchema25
|
|
7426
7776
|
} from "@ai-sdk/provider-utils";
|
|
7427
7777
|
import { z as z26 } from "zod/v4";
|
|
7428
|
-
var
|
|
7778
|
+
var textEditor_20250124InputSchema = lazySchema25(
|
|
7429
7779
|
() => zodSchema25(
|
|
7430
7780
|
z26.object({
|
|
7431
|
-
command: z26.enum(["view", "create", "str_replace", "insert"]),
|
|
7781
|
+
command: z26.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
7432
7782
|
path: z26.string(),
|
|
7433
7783
|
file_text: z26.string().optional(),
|
|
7434
7784
|
insert_line: z26.number().int().optional(),
|
|
@@ -7439,40 +7789,66 @@ var textEditor_20250429InputSchema = lazySchema25(
|
|
|
7439
7789
|
})
|
|
7440
7790
|
)
|
|
7441
7791
|
);
|
|
7442
|
-
var
|
|
7443
|
-
id: "anthropic.
|
|
7444
|
-
inputSchema:
|
|
7792
|
+
var textEditor_20250124 = createProviderDefinedToolFactory10({
|
|
7793
|
+
id: "anthropic.text_editor_20250124",
|
|
7794
|
+
inputSchema: textEditor_20250124InputSchema
|
|
7445
7795
|
});
|
|
7446
7796
|
|
|
7447
|
-
// src/tool/
|
|
7797
|
+
// src/tool/text-editor_20250429.ts
|
|
7448
7798
|
import {
|
|
7449
|
-
|
|
7799
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory11,
|
|
7450
7800
|
lazySchema as lazySchema26,
|
|
7451
7801
|
zodSchema as zodSchema26
|
|
7452
7802
|
} from "@ai-sdk/provider-utils";
|
|
7453
7803
|
import { z as z27 } from "zod/v4";
|
|
7454
|
-
var
|
|
7804
|
+
var textEditor_20250429InputSchema = lazySchema26(
|
|
7455
7805
|
() => zodSchema26(
|
|
7456
|
-
z27.
|
|
7457
|
-
z27.
|
|
7458
|
-
|
|
7459
|
-
|
|
7806
|
+
z27.object({
|
|
7807
|
+
command: z27.enum(["view", "create", "str_replace", "insert"]),
|
|
7808
|
+
path: z27.string(),
|
|
7809
|
+
file_text: z27.string().optional(),
|
|
7810
|
+
insert_line: z27.number().int().optional(),
|
|
7811
|
+
new_str: z27.string().optional(),
|
|
7812
|
+
insert_text: z27.string().optional(),
|
|
7813
|
+
old_str: z27.string().optional(),
|
|
7814
|
+
view_range: z27.array(z27.number().int()).optional()
|
|
7815
|
+
})
|
|
7816
|
+
)
|
|
7817
|
+
);
|
|
7818
|
+
var textEditor_20250429 = createProviderDefinedToolFactory11({
|
|
7819
|
+
id: "anthropic.text_editor_20250429",
|
|
7820
|
+
inputSchema: textEditor_20250429InputSchema
|
|
7821
|
+
});
|
|
7822
|
+
|
|
7823
|
+
// src/tool/tool-search-bm25_20251119.ts
|
|
7824
|
+
import {
|
|
7825
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory12,
|
|
7826
|
+
lazySchema as lazySchema27,
|
|
7827
|
+
zodSchema as zodSchema27
|
|
7828
|
+
} from "@ai-sdk/provider-utils";
|
|
7829
|
+
import { z as z28 } from "zod/v4";
|
|
7830
|
+
var toolSearchBm25_20251119OutputSchema = lazySchema27(
|
|
7831
|
+
() => zodSchema27(
|
|
7832
|
+
z28.array(
|
|
7833
|
+
z28.object({
|
|
7834
|
+
type: z28.literal("tool_reference"),
|
|
7835
|
+
toolName: z28.string()
|
|
7460
7836
|
})
|
|
7461
7837
|
)
|
|
7462
7838
|
)
|
|
7463
7839
|
);
|
|
7464
|
-
var toolSearchBm25_20251119InputSchema =
|
|
7465
|
-
() =>
|
|
7466
|
-
|
|
7840
|
+
var toolSearchBm25_20251119InputSchema = lazySchema27(
|
|
7841
|
+
() => zodSchema27(
|
|
7842
|
+
z28.object({
|
|
7467
7843
|
/**
|
|
7468
7844
|
* A natural language query to search for tools.
|
|
7469
7845
|
* Claude will use BM25 text search to find relevant tools.
|
|
7470
7846
|
*/
|
|
7471
|
-
query:
|
|
7847
|
+
query: z28.string(),
|
|
7472
7848
|
/**
|
|
7473
7849
|
* Maximum number of tools to return. Optional.
|
|
7474
7850
|
*/
|
|
7475
|
-
limit:
|
|
7851
|
+
limit: z28.number().optional()
|
|
7476
7852
|
})
|
|
7477
7853
|
)
|
|
7478
7854
|
);
|
|
@@ -7604,6 +7980,29 @@ var anthropicTools = {
|
|
|
7604
7980
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
7605
7981
|
*/
|
|
7606
7982
|
computer_20251124,
|
|
7983
|
+
/**
|
|
7984
|
+
* The computer toolset lets Claude control a computer through screenshots,
|
|
7985
|
+
* mouse, and keyboard. It replaces the versioned computer tools
|
|
7986
|
+
* (`computer_20251124` and earlier) on newer models.
|
|
7987
|
+
*
|
|
7988
|
+
* The API returns each computer action as its own `tool_use` block with
|
|
7989
|
+
* `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
|
|
7990
|
+
* and exposes the member name as `action`, so `execute` receives the same
|
|
7991
|
+
* input shape as the older computer tools. Claude may return several actions
|
|
7992
|
+
* in one turn.
|
|
7993
|
+
*
|
|
7994
|
+
* Coordinates are always in the pixel space of the screenshots you return;
|
|
7995
|
+
* there are no display size parameters. Zoom is enabled by default.
|
|
7996
|
+
*
|
|
7997
|
+
* Does not require a beta header.
|
|
7998
|
+
*
|
|
7999
|
+
* Supported models: Claude Opus 5.5 (required; older computer tool types
|
|
8000
|
+
* are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
|
|
8001
|
+
*
|
|
8002
|
+
* @param configs - Per-member settings keyed by member name, e.g.
|
|
8003
|
+
* `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
|
|
8004
|
+
*/
|
|
8005
|
+
computerToolset_20260801,
|
|
7607
8006
|
/**
|
|
7608
8007
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
7609
8008
|
* Claude can create, read, update, and delete files that persist between sessions,
|
|
@@ -7752,40 +8151,40 @@ import {
|
|
|
7752
8151
|
} from "@ai-sdk/provider-utils";
|
|
7753
8152
|
|
|
7754
8153
|
// src/skills/anthropic-skills-api.ts
|
|
7755
|
-
import { lazySchema as
|
|
7756
|
-
import { z as
|
|
7757
|
-
var anthropicSkillResponseSchema =
|
|
7758
|
-
() =>
|
|
7759
|
-
|
|
7760
|
-
id:
|
|
7761
|
-
display_title:
|
|
7762
|
-
name:
|
|
7763
|
-
description:
|
|
7764
|
-
latest_version:
|
|
7765
|
-
source:
|
|
7766
|
-
created_at:
|
|
7767
|
-
updated_at:
|
|
8154
|
+
import { lazySchema as lazySchema28, zodSchema as zodSchema28 } from "@ai-sdk/provider-utils";
|
|
8155
|
+
import { z as z29 } from "zod/v4";
|
|
8156
|
+
var anthropicSkillResponseSchema = lazySchema28(
|
|
8157
|
+
() => zodSchema28(
|
|
8158
|
+
z29.object({
|
|
8159
|
+
id: z29.string(),
|
|
8160
|
+
display_title: z29.string().nullish(),
|
|
8161
|
+
name: z29.string().nullish(),
|
|
8162
|
+
description: z29.string().nullish(),
|
|
8163
|
+
latest_version: z29.string().nullish(),
|
|
8164
|
+
source: z29.string(),
|
|
8165
|
+
created_at: z29.string(),
|
|
8166
|
+
updated_at: z29.string()
|
|
7768
8167
|
})
|
|
7769
8168
|
)
|
|
7770
8169
|
);
|
|
7771
|
-
var anthropicSkillVersionListResponseSchema =
|
|
7772
|
-
() =>
|
|
7773
|
-
|
|
7774
|
-
data:
|
|
7775
|
-
|
|
7776
|
-
version:
|
|
8170
|
+
var anthropicSkillVersionListResponseSchema = lazySchema28(
|
|
8171
|
+
() => zodSchema28(
|
|
8172
|
+
z29.object({
|
|
8173
|
+
data: z29.array(
|
|
8174
|
+
z29.object({
|
|
8175
|
+
version: z29.string()
|
|
7777
8176
|
})
|
|
7778
8177
|
)
|
|
7779
8178
|
})
|
|
7780
8179
|
)
|
|
7781
8180
|
);
|
|
7782
|
-
var anthropicSkillVersionResponseSchema =
|
|
7783
|
-
() =>
|
|
7784
|
-
|
|
7785
|
-
type:
|
|
7786
|
-
skill_id:
|
|
7787
|
-
name:
|
|
7788
|
-
description:
|
|
8181
|
+
var anthropicSkillVersionResponseSchema = lazySchema28(
|
|
8182
|
+
() => zodSchema28(
|
|
8183
|
+
z29.object({
|
|
8184
|
+
type: z29.string(),
|
|
8185
|
+
skill_id: z29.string(),
|
|
8186
|
+
name: z29.string().nullish(),
|
|
8187
|
+
description: z29.string().nullish()
|
|
7789
8188
|
})
|
|
7790
8189
|
)
|
|
7791
8190
|
);
|
|
@@ -7876,7 +8275,7 @@ var AnthropicSkills = class {
|
|
|
7876
8275
|
};
|
|
7877
8276
|
|
|
7878
8277
|
// src/version.ts
|
|
7879
|
-
var VERSION = true ? "4.0.
|
|
8278
|
+
var VERSION = true ? "4.0.60" : "0.0.0-test";
|
|
7880
8279
|
|
|
7881
8280
|
// src/anthropic-provider.ts
|
|
7882
8281
|
var ANTHROPIC_API_URL = "https://api.anthropic.com";
|