@ai-sdk/anthropic 4.0.59 → 4.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/index.d.ts +47 -1
- package/dist/index.js +971 -561
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +85 -3
- package/dist/internal/index.js +919 -512
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +125 -14
- package/package.json +3 -3
- package/src/anthropic-api.ts +24 -1
- package/src/anthropic-batch.ts +4 -0
- package/src/anthropic-language-model-options.ts +13 -3
- package/src/anthropic-language-model.ts +291 -5
- package/src/anthropic-prepare-tools.ts +76 -0
- package/src/anthropic-tools.ts +25 -0
- package/src/convert-to-anthropic-prompt.ts +84 -5
- package/src/tool/computer-toolset_20260801.ts +165 -0
package/dist/internal/index.js
CHANGED
|
@@ -257,7 +257,7 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
257
257
|
}),
|
|
258
258
|
z3.object({
|
|
259
259
|
type: z3.literal("compaction"),
|
|
260
|
-
content: z3.string()
|
|
260
|
+
content: z3.string().nullish()
|
|
261
261
|
}),
|
|
262
262
|
z3.object({
|
|
263
263
|
type: z3.literal("tool_use"),
|
|
@@ -265,7 +265,9 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
265
265
|
name: z3.string(),
|
|
266
266
|
input: z3.unknown(),
|
|
267
267
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
268
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
268
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
269
|
+
// Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
|
|
270
|
+
toolset_name: z3.string().nullish()
|
|
269
271
|
}),
|
|
270
272
|
z3.object({
|
|
271
273
|
type: z3.literal("server_tool_use"),
|
|
@@ -568,7 +570,8 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
568
570
|
id: z3.string(),
|
|
569
571
|
name: z3.string(),
|
|
570
572
|
input: z3.unknown(),
|
|
571
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
573
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
574
|
+
toolset_name: z3.string().nullish()
|
|
572
575
|
})
|
|
573
576
|
])
|
|
574
577
|
).nullish(),
|
|
@@ -599,7 +602,9 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
599
602
|
// Programmatic tool calling: input may be present directly for deferred tool calls
|
|
600
603
|
input: z3.record(z3.string(), z3.unknown()).optional(),
|
|
601
604
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
602
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
605
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
606
|
+
// Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
|
|
607
|
+
toolset_name: z3.string().nullish()
|
|
603
608
|
}),
|
|
604
609
|
z3.object({
|
|
605
610
|
type: z3.literal("redacted_thinking"),
|
|
@@ -992,8 +997,8 @@ var anthropicSystemMessageProviderOptions = z4.object({
|
|
|
992
997
|
clearAt: z4.literal("next_user_message").optional(),
|
|
993
998
|
/**
|
|
994
999
|
* Sets the model effort for the turn that follows this mid-conversation
|
|
995
|
-
* system message. The required `mid-conversation-
|
|
996
|
-
* is added automatically.
|
|
1000
|
+
* system message. The required `mid-conversation-output-config-2026-07-01`
|
|
1001
|
+
* beta is added automatically.
|
|
997
1002
|
*/
|
|
998
1003
|
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
999
1004
|
/**
|
|
@@ -1043,6 +1048,11 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1043
1048
|
*
|
|
1044
1049
|
* When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
|
|
1045
1050
|
* Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
|
|
1051
|
+
*
|
|
1052
|
+
* Models that always use adaptive thinking (e.g. `claude-opus-5-5`,
|
|
1053
|
+
* `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
|
|
1054
|
+
* provider drops the unsupported setting, emits a warning, and sends an
|
|
1055
|
+
* adaptive thinking request. Use `effort` to control how much they think.
|
|
1046
1056
|
*/
|
|
1047
1057
|
thinking: z4.union([
|
|
1048
1058
|
z4.discriminatedUnion("type", [
|
|
@@ -1155,7 +1165,11 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1155
1165
|
*/
|
|
1156
1166
|
toolStreaming: z4.boolean().optional(),
|
|
1157
1167
|
/**
|
|
1158
|
-
*
|
|
1168
|
+
* Controls how much effort the model spends on thinking, text responses,
|
|
1169
|
+
* and tool calls. On models that always use adaptive thinking
|
|
1170
|
+
* (e.g. `claude-opus-5-5`), effort is the main lever for latency and cost.
|
|
1171
|
+
*
|
|
1172
|
+
* The API default is `high` for most models and `medium` for `claude-opus-5-5`.
|
|
1159
1173
|
*/
|
|
1160
1174
|
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
1161
1175
|
/**
|
|
@@ -1387,104 +1401,114 @@ var advisor_20260301 = (args) => {
|
|
|
1387
1401
|
return factory(args);
|
|
1388
1402
|
};
|
|
1389
1403
|
|
|
1390
|
-
// src/tool/
|
|
1404
|
+
// src/tool/computer-toolset_20260801.ts
|
|
1391
1405
|
import {
|
|
1392
1406
|
createProviderDefinedToolFactory,
|
|
1393
1407
|
lazySchema as lazySchema5,
|
|
1394
1408
|
zodSchema as zodSchema5
|
|
1395
1409
|
} from "@ai-sdk/provider-utils";
|
|
1396
1410
|
import { z as z6 } from "zod/v4";
|
|
1397
|
-
var
|
|
1411
|
+
var computerToolset_20260801Members = [
|
|
1412
|
+
"screenshot",
|
|
1413
|
+
"zoom",
|
|
1414
|
+
"left_click",
|
|
1415
|
+
"right_click",
|
|
1416
|
+
"middle_click",
|
|
1417
|
+
"double_click",
|
|
1418
|
+
"triple_click",
|
|
1419
|
+
"left_click_drag",
|
|
1420
|
+
"mouse_move",
|
|
1421
|
+
"left_mouse_down",
|
|
1422
|
+
"left_mouse_up",
|
|
1423
|
+
"cursor_position",
|
|
1424
|
+
"scroll",
|
|
1425
|
+
"type",
|
|
1426
|
+
"key",
|
|
1427
|
+
"hold_key",
|
|
1428
|
+
"wait"
|
|
1429
|
+
];
|
|
1430
|
+
var computerToolset_20260801InputSchema = lazySchema5(
|
|
1398
1431
|
() => zodSchema5(
|
|
1399
1432
|
z6.object({
|
|
1400
|
-
|
|
1433
|
+
action: z6.enum(computerToolset_20260801Members),
|
|
1434
|
+
coordinate: z6.tuple([z6.number().int(), z6.number().int()]).optional(),
|
|
1435
|
+
duration: z6.number().optional(),
|
|
1436
|
+
region: z6.tuple([
|
|
1437
|
+
z6.number().int(),
|
|
1438
|
+
z6.number().int(),
|
|
1439
|
+
z6.number().int(),
|
|
1440
|
+
z6.number().int()
|
|
1441
|
+
]).optional(),
|
|
1442
|
+
repeat: z6.number().int().optional(),
|
|
1443
|
+
scroll_amount: z6.number().optional(),
|
|
1444
|
+
scroll_direction: z6.enum(["up", "down", "left", "right"]).optional(),
|
|
1445
|
+
start_coordinate: z6.tuple([z6.number().int(), z6.number().int()]).optional(),
|
|
1446
|
+
text: z6.string().optional()
|
|
1401
1447
|
})
|
|
1402
1448
|
)
|
|
1403
1449
|
);
|
|
1404
|
-
var
|
|
1450
|
+
var computerToolset_20260801ArgsSchema = lazySchema5(
|
|
1405
1451
|
() => zodSchema5(
|
|
1406
1452
|
z6.object({
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
view_range: z6.array(z6.number().int()).optional()
|
|
1453
|
+
configs: z6.partialRecord(
|
|
1454
|
+
z6.enum(computerToolset_20260801Members),
|
|
1455
|
+
z6.object({
|
|
1456
|
+
enabled: z6.boolean().optional(),
|
|
1457
|
+
deferLoading: z6.boolean().optional()
|
|
1458
|
+
})
|
|
1459
|
+
).optional()
|
|
1415
1460
|
})
|
|
1416
1461
|
)
|
|
1417
1462
|
);
|
|
1418
|
-
var
|
|
1419
|
-
id: "anthropic.
|
|
1420
|
-
inputSchema:
|
|
1463
|
+
var computerToolset_20260801 = createProviderDefinedToolFactory({
|
|
1464
|
+
id: "anthropic.computer_toolset_20260801",
|
|
1465
|
+
inputSchema: computerToolset_20260801InputSchema
|
|
1421
1466
|
});
|
|
1422
|
-
var textEditor_20250728 = (args = {}) => {
|
|
1423
|
-
return factory2(args);
|
|
1424
|
-
};
|
|
1425
1467
|
|
|
1426
|
-
// src/tool/
|
|
1468
|
+
// src/tool/text-editor_20250728.ts
|
|
1427
1469
|
import {
|
|
1428
|
-
|
|
1470
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
|
|
1429
1471
|
lazySchema as lazySchema6,
|
|
1430
1472
|
zodSchema as zodSchema6
|
|
1431
1473
|
} from "@ai-sdk/provider-utils";
|
|
1432
1474
|
import { z as z7 } from "zod/v4";
|
|
1433
|
-
var
|
|
1475
|
+
var textEditor_20250728ArgsSchema = lazySchema6(
|
|
1434
1476
|
() => zodSchema6(
|
|
1435
1477
|
z7.object({
|
|
1436
|
-
|
|
1437
|
-
allowedDomains: z7.array(z7.string()).optional(),
|
|
1438
|
-
blockedDomains: z7.array(z7.string()).optional(),
|
|
1439
|
-
userLocation: z7.object({
|
|
1440
|
-
type: z7.literal("approximate"),
|
|
1441
|
-
city: z7.string().optional(),
|
|
1442
|
-
region: z7.string().optional(),
|
|
1443
|
-
country: z7.string().optional(),
|
|
1444
|
-
timezone: z7.string().optional()
|
|
1445
|
-
}).optional(),
|
|
1446
|
-
responseInclusion: z7.enum(["full", "excluded"]).optional()
|
|
1478
|
+
maxCharacters: z7.number().optional()
|
|
1447
1479
|
})
|
|
1448
1480
|
)
|
|
1449
1481
|
);
|
|
1450
|
-
var
|
|
1451
|
-
() => zodSchema6(
|
|
1452
|
-
z7.array(
|
|
1453
|
-
z7.object({
|
|
1454
|
-
url: z7.string(),
|
|
1455
|
-
title: z7.string().nullable(),
|
|
1456
|
-
pageAge: z7.string().nullable(),
|
|
1457
|
-
encryptedContent: z7.string(),
|
|
1458
|
-
type: z7.literal("web_search_result")
|
|
1459
|
-
})
|
|
1460
|
-
)
|
|
1461
|
-
)
|
|
1462
|
-
);
|
|
1463
|
-
var webSearch_20260318InputSchema = lazySchema6(
|
|
1482
|
+
var textEditor_20250728InputSchema = lazySchema6(
|
|
1464
1483
|
() => zodSchema6(
|
|
1465
1484
|
z7.object({
|
|
1466
|
-
|
|
1485
|
+
command: z7.enum(["view", "create", "str_replace", "insert"]),
|
|
1486
|
+
path: z7.string(),
|
|
1487
|
+
file_text: z7.string().optional(),
|
|
1488
|
+
insert_line: z7.number().int().optional(),
|
|
1489
|
+
new_str: z7.string().optional(),
|
|
1490
|
+
insert_text: z7.string().optional(),
|
|
1491
|
+
old_str: z7.string().optional(),
|
|
1492
|
+
view_range: z7.array(z7.number().int()).optional()
|
|
1467
1493
|
})
|
|
1468
1494
|
)
|
|
1469
1495
|
);
|
|
1470
|
-
var
|
|
1471
|
-
id: "anthropic.
|
|
1472
|
-
inputSchema:
|
|
1473
|
-
outputSchema: webSearch_20260318OutputSchema,
|
|
1474
|
-
supportsDeferredResults: true
|
|
1496
|
+
var factory2 = createProviderDefinedToolFactory2({
|
|
1497
|
+
id: "anthropic.text_editor_20250728",
|
|
1498
|
+
inputSchema: textEditor_20250728InputSchema
|
|
1475
1499
|
});
|
|
1476
|
-
var
|
|
1477
|
-
return
|
|
1500
|
+
var textEditor_20250728 = (args = {}) => {
|
|
1501
|
+
return factory2(args);
|
|
1478
1502
|
};
|
|
1479
1503
|
|
|
1480
|
-
// src/tool/web-
|
|
1504
|
+
// src/tool/web-search_20260318.ts
|
|
1481
1505
|
import {
|
|
1482
|
-
createProviderExecutedToolFactory as
|
|
1506
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
|
|
1483
1507
|
lazySchema as lazySchema7,
|
|
1484
1508
|
zodSchema as zodSchema7
|
|
1485
1509
|
} from "@ai-sdk/provider-utils";
|
|
1486
1510
|
import { z as z8 } from "zod/v4";
|
|
1487
|
-
var
|
|
1511
|
+
var webSearch_20260318ArgsSchema = lazySchema7(
|
|
1488
1512
|
() => zodSchema7(
|
|
1489
1513
|
z8.object({
|
|
1490
1514
|
maxUses: z8.number().optional(),
|
|
@@ -1496,11 +1520,12 @@ var webSearch_20260209ArgsSchema = lazySchema7(
|
|
|
1496
1520
|
region: z8.string().optional(),
|
|
1497
1521
|
country: z8.string().optional(),
|
|
1498
1522
|
timezone: z8.string().optional()
|
|
1499
|
-
}).optional()
|
|
1523
|
+
}).optional(),
|
|
1524
|
+
responseInclusion: z8.enum(["full", "excluded"]).optional()
|
|
1500
1525
|
})
|
|
1501
1526
|
)
|
|
1502
1527
|
);
|
|
1503
|
-
var
|
|
1528
|
+
var webSearch_20260318OutputSchema = lazySchema7(
|
|
1504
1529
|
() => zodSchema7(
|
|
1505
1530
|
z8.array(
|
|
1506
1531
|
z8.object({
|
|
@@ -1513,31 +1538,31 @@ var webSearch_20260209OutputSchema = lazySchema7(
|
|
|
1513
1538
|
)
|
|
1514
1539
|
)
|
|
1515
1540
|
);
|
|
1516
|
-
var
|
|
1541
|
+
var webSearch_20260318InputSchema = lazySchema7(
|
|
1517
1542
|
() => zodSchema7(
|
|
1518
1543
|
z8.object({
|
|
1519
1544
|
query: z8.string()
|
|
1520
1545
|
})
|
|
1521
1546
|
)
|
|
1522
1547
|
);
|
|
1523
|
-
var
|
|
1524
|
-
id: "anthropic.
|
|
1525
|
-
inputSchema:
|
|
1526
|
-
outputSchema:
|
|
1548
|
+
var factory3 = createProviderExecutedToolFactory2({
|
|
1549
|
+
id: "anthropic.web_search_20260318",
|
|
1550
|
+
inputSchema: webSearch_20260318InputSchema,
|
|
1551
|
+
outputSchema: webSearch_20260318OutputSchema,
|
|
1527
1552
|
supportsDeferredResults: true
|
|
1528
1553
|
});
|
|
1529
|
-
var
|
|
1530
|
-
return
|
|
1554
|
+
var webSearch_20260318 = (args = {}) => {
|
|
1555
|
+
return factory3(args);
|
|
1531
1556
|
};
|
|
1532
1557
|
|
|
1533
|
-
// src/tool/web-
|
|
1558
|
+
// src/tool/web-search_20260209.ts
|
|
1534
1559
|
import {
|
|
1535
|
-
createProviderExecutedToolFactory as
|
|
1560
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
|
|
1536
1561
|
lazySchema as lazySchema8,
|
|
1537
1562
|
zodSchema as zodSchema8
|
|
1538
1563
|
} from "@ai-sdk/provider-utils";
|
|
1539
1564
|
import { z as z9 } from "zod/v4";
|
|
1540
|
-
var
|
|
1565
|
+
var webSearch_20260209ArgsSchema = lazySchema8(
|
|
1541
1566
|
() => zodSchema8(
|
|
1542
1567
|
z9.object({
|
|
1543
1568
|
maxUses: z9.number().optional(),
|
|
@@ -1553,7 +1578,7 @@ var webSearch_20250305ArgsSchema = lazySchema8(
|
|
|
1553
1578
|
})
|
|
1554
1579
|
)
|
|
1555
1580
|
);
|
|
1556
|
-
var
|
|
1581
|
+
var webSearch_20260209OutputSchema = lazySchema8(
|
|
1557
1582
|
() => zodSchema8(
|
|
1558
1583
|
z9.array(
|
|
1559
1584
|
z9.object({
|
|
@@ -1566,105 +1591,97 @@ var webSearch_20250305OutputSchema = lazySchema8(
|
|
|
1566
1591
|
)
|
|
1567
1592
|
)
|
|
1568
1593
|
);
|
|
1569
|
-
var
|
|
1594
|
+
var webSearch_20260209InputSchema = lazySchema8(
|
|
1570
1595
|
() => zodSchema8(
|
|
1571
1596
|
z9.object({
|
|
1572
1597
|
query: z9.string()
|
|
1573
1598
|
})
|
|
1574
1599
|
)
|
|
1575
1600
|
);
|
|
1576
|
-
var
|
|
1577
|
-
id: "anthropic.
|
|
1578
|
-
inputSchema:
|
|
1579
|
-
outputSchema:
|
|
1601
|
+
var factory4 = createProviderExecutedToolFactory3({
|
|
1602
|
+
id: "anthropic.web_search_20260209",
|
|
1603
|
+
inputSchema: webSearch_20260209InputSchema,
|
|
1604
|
+
outputSchema: webSearch_20260209OutputSchema,
|
|
1580
1605
|
supportsDeferredResults: true
|
|
1581
1606
|
});
|
|
1582
|
-
var
|
|
1583
|
-
return
|
|
1607
|
+
var webSearch_20260209 = (args = {}) => {
|
|
1608
|
+
return factory4(args);
|
|
1584
1609
|
};
|
|
1585
1610
|
|
|
1586
|
-
// src/tool/web-
|
|
1611
|
+
// src/tool/web-search_20250305.ts
|
|
1587
1612
|
import {
|
|
1588
|
-
createProviderExecutedToolFactory as
|
|
1613
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
|
|
1589
1614
|
lazySchema as lazySchema9,
|
|
1590
1615
|
zodSchema as zodSchema9
|
|
1591
1616
|
} from "@ai-sdk/provider-utils";
|
|
1592
1617
|
import { z as z10 } from "zod/v4";
|
|
1593
|
-
var
|
|
1618
|
+
var webSearch_20250305ArgsSchema = lazySchema9(
|
|
1594
1619
|
() => zodSchema9(
|
|
1595
1620
|
z10.object({
|
|
1596
1621
|
maxUses: z10.number().optional(),
|
|
1597
1622
|
allowedDomains: z10.array(z10.string()).optional(),
|
|
1598
1623
|
blockedDomains: z10.array(z10.string()).optional(),
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1624
|
+
userLocation: z10.object({
|
|
1625
|
+
type: z10.literal("approximate"),
|
|
1626
|
+
city: z10.string().optional(),
|
|
1627
|
+
region: z10.string().optional(),
|
|
1628
|
+
country: z10.string().optional(),
|
|
1629
|
+
timezone: z10.string().optional()
|
|
1630
|
+
}).optional()
|
|
1603
1631
|
})
|
|
1604
1632
|
)
|
|
1605
1633
|
);
|
|
1606
|
-
var
|
|
1634
|
+
var webSearch_20250305OutputSchema = lazySchema9(
|
|
1607
1635
|
() => zodSchema9(
|
|
1608
|
-
z10.
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
content: z10.object({
|
|
1612
|
-
type: z10.literal("document"),
|
|
1636
|
+
z10.array(
|
|
1637
|
+
z10.object({
|
|
1638
|
+
url: z10.string(),
|
|
1613
1639
|
title: z10.string().nullable(),
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
data: z10.string()
|
|
1620
|
-
}),
|
|
1621
|
-
z10.object({
|
|
1622
|
-
type: z10.literal("text"),
|
|
1623
|
-
mediaType: z10.literal("text/plain"),
|
|
1624
|
-
data: z10.string()
|
|
1625
|
-
})
|
|
1626
|
-
])
|
|
1627
|
-
}),
|
|
1628
|
-
retrievedAt: z10.string().nullable()
|
|
1629
|
-
})
|
|
1640
|
+
pageAge: z10.string().nullable(),
|
|
1641
|
+
encryptedContent: z10.string(),
|
|
1642
|
+
type: z10.literal("web_search_result")
|
|
1643
|
+
})
|
|
1644
|
+
)
|
|
1630
1645
|
)
|
|
1631
1646
|
);
|
|
1632
|
-
var
|
|
1647
|
+
var webSearch_20250305InputSchema = lazySchema9(
|
|
1633
1648
|
() => zodSchema9(
|
|
1634
1649
|
z10.object({
|
|
1635
|
-
|
|
1650
|
+
query: z10.string()
|
|
1636
1651
|
})
|
|
1637
1652
|
)
|
|
1638
1653
|
);
|
|
1639
|
-
var
|
|
1640
|
-
id: "anthropic.
|
|
1641
|
-
inputSchema:
|
|
1642
|
-
outputSchema:
|
|
1654
|
+
var factory5 = createProviderExecutedToolFactory4({
|
|
1655
|
+
id: "anthropic.web_search_20250305",
|
|
1656
|
+
inputSchema: webSearch_20250305InputSchema,
|
|
1657
|
+
outputSchema: webSearch_20250305OutputSchema,
|
|
1643
1658
|
supportsDeferredResults: true
|
|
1644
1659
|
});
|
|
1645
|
-
var
|
|
1646
|
-
return
|
|
1660
|
+
var webSearch_20250305 = (args = {}) => {
|
|
1661
|
+
return factory5(args);
|
|
1647
1662
|
};
|
|
1648
1663
|
|
|
1649
|
-
// src/tool/web-fetch-
|
|
1664
|
+
// src/tool/web-fetch-20260318.ts
|
|
1650
1665
|
import {
|
|
1651
|
-
createProviderExecutedToolFactory as
|
|
1666
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
1652
1667
|
lazySchema as lazySchema10,
|
|
1653
1668
|
zodSchema as zodSchema10
|
|
1654
1669
|
} from "@ai-sdk/provider-utils";
|
|
1655
1670
|
import { z as z11 } from "zod/v4";
|
|
1656
|
-
var
|
|
1671
|
+
var webFetch_20260318ArgsSchema = lazySchema10(
|
|
1657
1672
|
() => zodSchema10(
|
|
1658
1673
|
z11.object({
|
|
1659
1674
|
maxUses: z11.number().optional(),
|
|
1660
1675
|
allowedDomains: z11.array(z11.string()).optional(),
|
|
1661
1676
|
blockedDomains: z11.array(z11.string()).optional(),
|
|
1662
1677
|
citations: z11.object({ enabled: z11.boolean() }).optional(),
|
|
1663
|
-
maxContentTokens: z11.number().optional()
|
|
1678
|
+
maxContentTokens: z11.number().optional(),
|
|
1679
|
+
useCache: z11.boolean().optional(),
|
|
1680
|
+
responseInclusion: z11.enum(["full", "excluded"]).optional()
|
|
1664
1681
|
})
|
|
1665
1682
|
)
|
|
1666
1683
|
);
|
|
1667
|
-
var
|
|
1684
|
+
var webFetch_20260318OutputSchema = lazySchema10(
|
|
1668
1685
|
() => zodSchema10(
|
|
1669
1686
|
z11.object({
|
|
1670
1687
|
type: z11.literal("web_fetch_result"),
|
|
@@ -1690,31 +1707,31 @@ var webFetch_20260209OutputSchema = lazySchema10(
|
|
|
1690
1707
|
})
|
|
1691
1708
|
)
|
|
1692
1709
|
);
|
|
1693
|
-
var
|
|
1710
|
+
var webFetch_20260318InputSchema = lazySchema10(
|
|
1694
1711
|
() => zodSchema10(
|
|
1695
1712
|
z11.object({
|
|
1696
1713
|
url: z11.string()
|
|
1697
1714
|
})
|
|
1698
1715
|
)
|
|
1699
1716
|
);
|
|
1700
|
-
var
|
|
1701
|
-
id: "anthropic.
|
|
1702
|
-
inputSchema:
|
|
1703
|
-
outputSchema:
|
|
1717
|
+
var factory6 = createProviderExecutedToolFactory5({
|
|
1718
|
+
id: "anthropic.web_fetch_20260318",
|
|
1719
|
+
inputSchema: webFetch_20260318InputSchema,
|
|
1720
|
+
outputSchema: webFetch_20260318OutputSchema,
|
|
1704
1721
|
supportsDeferredResults: true
|
|
1705
1722
|
});
|
|
1706
|
-
var
|
|
1707
|
-
return
|
|
1723
|
+
var webFetch_20260318 = (args = {}) => {
|
|
1724
|
+
return factory6(args);
|
|
1708
1725
|
};
|
|
1709
1726
|
|
|
1710
|
-
// src/tool/web-fetch-
|
|
1727
|
+
// src/tool/web-fetch-20260209.ts
|
|
1711
1728
|
import {
|
|
1712
|
-
createProviderExecutedToolFactory as
|
|
1729
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
|
|
1713
1730
|
lazySchema as lazySchema11,
|
|
1714
1731
|
zodSchema as zodSchema11
|
|
1715
1732
|
} from "@ai-sdk/provider-utils";
|
|
1716
1733
|
import { z as z12 } from "zod/v4";
|
|
1717
|
-
var
|
|
1734
|
+
var webFetch_20260209ArgsSchema = lazySchema11(
|
|
1718
1735
|
() => zodSchema11(
|
|
1719
1736
|
z12.object({
|
|
1720
1737
|
maxUses: z12.number().optional(),
|
|
@@ -1725,7 +1742,7 @@ var webFetch_20250910ArgsSchema = lazySchema11(
|
|
|
1725
1742
|
})
|
|
1726
1743
|
)
|
|
1727
1744
|
);
|
|
1728
|
-
var
|
|
1745
|
+
var webFetch_20260209OutputSchema = lazySchema11(
|
|
1729
1746
|
() => zodSchema11(
|
|
1730
1747
|
z12.object({
|
|
1731
1748
|
type: z12.literal("web_fetch_result"),
|
|
@@ -1751,13 +1768,74 @@ var webFetch_20250910OutputSchema = lazySchema11(
|
|
|
1751
1768
|
})
|
|
1752
1769
|
)
|
|
1753
1770
|
);
|
|
1754
|
-
var
|
|
1771
|
+
var webFetch_20260209InputSchema = lazySchema11(
|
|
1755
1772
|
() => zodSchema11(
|
|
1756
1773
|
z12.object({
|
|
1757
1774
|
url: z12.string()
|
|
1758
1775
|
})
|
|
1759
1776
|
)
|
|
1760
1777
|
);
|
|
1778
|
+
var factory7 = createProviderExecutedToolFactory6({
|
|
1779
|
+
id: "anthropic.web_fetch_20260209",
|
|
1780
|
+
inputSchema: webFetch_20260209InputSchema,
|
|
1781
|
+
outputSchema: webFetch_20260209OutputSchema,
|
|
1782
|
+
supportsDeferredResults: true
|
|
1783
|
+
});
|
|
1784
|
+
var webFetch_20260209 = (args = {}) => {
|
|
1785
|
+
return factory7(args);
|
|
1786
|
+
};
|
|
1787
|
+
|
|
1788
|
+
// src/tool/web-fetch-20250910.ts
|
|
1789
|
+
import {
|
|
1790
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
|
|
1791
|
+
lazySchema as lazySchema12,
|
|
1792
|
+
zodSchema as zodSchema12
|
|
1793
|
+
} from "@ai-sdk/provider-utils";
|
|
1794
|
+
import { z as z13 } from "zod/v4";
|
|
1795
|
+
var webFetch_20250910ArgsSchema = lazySchema12(
|
|
1796
|
+
() => zodSchema12(
|
|
1797
|
+
z13.object({
|
|
1798
|
+
maxUses: z13.number().optional(),
|
|
1799
|
+
allowedDomains: z13.array(z13.string()).optional(),
|
|
1800
|
+
blockedDomains: z13.array(z13.string()).optional(),
|
|
1801
|
+
citations: z13.object({ enabled: z13.boolean() }).optional(),
|
|
1802
|
+
maxContentTokens: z13.number().optional()
|
|
1803
|
+
})
|
|
1804
|
+
)
|
|
1805
|
+
);
|
|
1806
|
+
var webFetch_20250910OutputSchema = lazySchema12(
|
|
1807
|
+
() => zodSchema12(
|
|
1808
|
+
z13.object({
|
|
1809
|
+
type: z13.literal("web_fetch_result"),
|
|
1810
|
+
url: z13.string(),
|
|
1811
|
+
content: z13.object({
|
|
1812
|
+
type: z13.literal("document"),
|
|
1813
|
+
title: z13.string().nullable(),
|
|
1814
|
+
citations: z13.object({ enabled: z13.boolean() }).optional(),
|
|
1815
|
+
source: z13.union([
|
|
1816
|
+
z13.object({
|
|
1817
|
+
type: z13.literal("base64"),
|
|
1818
|
+
mediaType: z13.literal("application/pdf"),
|
|
1819
|
+
data: z13.string()
|
|
1820
|
+
}),
|
|
1821
|
+
z13.object({
|
|
1822
|
+
type: z13.literal("text"),
|
|
1823
|
+
mediaType: z13.literal("text/plain"),
|
|
1824
|
+
data: z13.string()
|
|
1825
|
+
})
|
|
1826
|
+
])
|
|
1827
|
+
}),
|
|
1828
|
+
retrievedAt: z13.string().nullable()
|
|
1829
|
+
})
|
|
1830
|
+
)
|
|
1831
|
+
);
|
|
1832
|
+
var webFetch_20250910InputSchema = lazySchema12(
|
|
1833
|
+
() => zodSchema12(
|
|
1834
|
+
z13.object({
|
|
1835
|
+
url: z13.string()
|
|
1836
|
+
})
|
|
1837
|
+
)
|
|
1838
|
+
);
|
|
1761
1839
|
var factory8 = createProviderExecutedToolFactory7({
|
|
1762
1840
|
id: "anthropic.web_fetch_20250910",
|
|
1763
1841
|
inputSchema: webFetch_20250910InputSchema,
|
|
@@ -1777,7 +1855,8 @@ async function prepareTools({
|
|
|
1777
1855
|
cacheControlValidator,
|
|
1778
1856
|
supportsStructuredOutput,
|
|
1779
1857
|
supportsStrictTools,
|
|
1780
|
-
defaultEagerInputStreaming = false
|
|
1858
|
+
defaultEagerInputStreaming = false,
|
|
1859
|
+
rejectsForcedToolUse = false
|
|
1781
1860
|
}) {
|
|
1782
1861
|
var _a, _b;
|
|
1783
1862
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
@@ -1880,6 +1959,31 @@ async function prepareTools({
|
|
|
1880
1959
|
});
|
|
1881
1960
|
break;
|
|
1882
1961
|
}
|
|
1962
|
+
case "anthropic.computer_toolset_20260801": {
|
|
1963
|
+
const args = await validateTypes({
|
|
1964
|
+
value: tool.args,
|
|
1965
|
+
schema: computerToolset_20260801ArgsSchema
|
|
1966
|
+
});
|
|
1967
|
+
const configs = args.configs != null ? Object.fromEntries(
|
|
1968
|
+
Object.entries(args.configs).map(([member, config]) => [
|
|
1969
|
+
member,
|
|
1970
|
+
{
|
|
1971
|
+
...(config == null ? void 0 : config.enabled) != null && {
|
|
1972
|
+
enabled: config.enabled
|
|
1973
|
+
},
|
|
1974
|
+
...(config == null ? void 0 : config.deferLoading) != null && {
|
|
1975
|
+
defer_loading: config.deferLoading
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
])
|
|
1979
|
+
) : void 0;
|
|
1980
|
+
anthropicTools2.push({
|
|
1981
|
+
type: "computer_toolset_20260801",
|
|
1982
|
+
...configs != null && { configs },
|
|
1983
|
+
cache_control: void 0
|
|
1984
|
+
});
|
|
1985
|
+
break;
|
|
1986
|
+
}
|
|
1883
1987
|
case "anthropic.computer_20241022": {
|
|
1884
1988
|
betas.add("computer-use-2024-10-22");
|
|
1885
1989
|
anthropicTools2.push({
|
|
@@ -2135,6 +2239,22 @@ async function prepareTools({
|
|
|
2135
2239
|
betas
|
|
2136
2240
|
};
|
|
2137
2241
|
case "required":
|
|
2242
|
+
if (rejectsForcedToolUse) {
|
|
2243
|
+
toolWarnings.push({
|
|
2244
|
+
type: "unsupported",
|
|
2245
|
+
feature: "toolChoice",
|
|
2246
|
+
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.`
|
|
2247
|
+
});
|
|
2248
|
+
return {
|
|
2249
|
+
tools: anthropicTools2,
|
|
2250
|
+
toolChoice: {
|
|
2251
|
+
type: "auto",
|
|
2252
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
2253
|
+
},
|
|
2254
|
+
toolWarnings,
|
|
2255
|
+
betas
|
|
2256
|
+
};
|
|
2257
|
+
}
|
|
2138
2258
|
return {
|
|
2139
2259
|
tools: anthropicTools2,
|
|
2140
2260
|
toolChoice: {
|
|
@@ -2147,6 +2267,24 @@ async function prepareTools({
|
|
|
2147
2267
|
case "none":
|
|
2148
2268
|
return { tools: void 0, toolChoice: void 0, toolWarnings, betas };
|
|
2149
2269
|
case "tool":
|
|
2270
|
+
if (rejectsForcedToolUse) {
|
|
2271
|
+
toolWarnings.push({
|
|
2272
|
+
type: "unsupported",
|
|
2273
|
+
feature: "toolChoice",
|
|
2274
|
+
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.`
|
|
2275
|
+
});
|
|
2276
|
+
return {
|
|
2277
|
+
tools: anthropicTools2.filter(
|
|
2278
|
+
(tool) => "name" in tool && tool.name === toolChoice.toolName
|
|
2279
|
+
),
|
|
2280
|
+
toolChoice: {
|
|
2281
|
+
type: "auto",
|
|
2282
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
2283
|
+
},
|
|
2284
|
+
toolWarnings,
|
|
2285
|
+
betas
|
|
2286
|
+
};
|
|
2287
|
+
}
|
|
2150
2288
|
return {
|
|
2151
2289
|
tools: anthropicTools2,
|
|
2152
2290
|
toolChoice: {
|
|
@@ -2237,30 +2375,30 @@ import {
|
|
|
2237
2375
|
// src/tool/code-execution_20250522.ts
|
|
2238
2376
|
import {
|
|
2239
2377
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory8,
|
|
2240
|
-
lazySchema as
|
|
2241
|
-
zodSchema as
|
|
2378
|
+
lazySchema as lazySchema13,
|
|
2379
|
+
zodSchema as zodSchema13
|
|
2242
2380
|
} from "@ai-sdk/provider-utils";
|
|
2243
|
-
import { z as
|
|
2244
|
-
var codeExecution_20250522OutputSchema =
|
|
2245
|
-
() =>
|
|
2246
|
-
|
|
2247
|
-
type:
|
|
2248
|
-
stdout:
|
|
2249
|
-
stderr:
|
|
2250
|
-
return_code:
|
|
2251
|
-
content:
|
|
2252
|
-
|
|
2253
|
-
type:
|
|
2254
|
-
file_id:
|
|
2381
|
+
import { z as z14 } from "zod/v4";
|
|
2382
|
+
var codeExecution_20250522OutputSchema = lazySchema13(
|
|
2383
|
+
() => zodSchema13(
|
|
2384
|
+
z14.object({
|
|
2385
|
+
type: z14.literal("code_execution_result"),
|
|
2386
|
+
stdout: z14.string(),
|
|
2387
|
+
stderr: z14.string(),
|
|
2388
|
+
return_code: z14.number(),
|
|
2389
|
+
content: z14.array(
|
|
2390
|
+
z14.object({
|
|
2391
|
+
type: z14.literal("code_execution_output"),
|
|
2392
|
+
file_id: z14.string()
|
|
2255
2393
|
})
|
|
2256
2394
|
).optional().default([])
|
|
2257
2395
|
})
|
|
2258
2396
|
)
|
|
2259
2397
|
);
|
|
2260
|
-
var codeExecution_20250522InputSchema =
|
|
2261
|
-
() =>
|
|
2262
|
-
|
|
2263
|
-
code:
|
|
2398
|
+
var codeExecution_20250522InputSchema = lazySchema13(
|
|
2399
|
+
() => zodSchema13(
|
|
2400
|
+
z14.object({
|
|
2401
|
+
code: z14.string()
|
|
2264
2402
|
})
|
|
2265
2403
|
)
|
|
2266
2404
|
);
|
|
@@ -2277,143 +2415,11 @@ var codeExecution_20250522 = (args = {}) => {
|
|
|
2277
2415
|
import {
|
|
2278
2416
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory9,
|
|
2279
2417
|
experimental_toolCaller,
|
|
2280
|
-
lazySchema as lazySchema13,
|
|
2281
|
-
zodSchema as zodSchema13
|
|
2282
|
-
} from "@ai-sdk/provider-utils";
|
|
2283
|
-
import { z as z14 } from "zod/v4";
|
|
2284
|
-
var codeExecution_20250825OutputSchema = lazySchema13(
|
|
2285
|
-
() => zodSchema13(
|
|
2286
|
-
z14.discriminatedUnion("type", [
|
|
2287
|
-
z14.object({
|
|
2288
|
-
type: z14.literal("code_execution_result"),
|
|
2289
|
-
stdout: z14.string(),
|
|
2290
|
-
stderr: z14.string(),
|
|
2291
|
-
return_code: z14.number(),
|
|
2292
|
-
content: z14.array(
|
|
2293
|
-
z14.object({
|
|
2294
|
-
type: z14.literal("code_execution_output"),
|
|
2295
|
-
file_id: z14.string()
|
|
2296
|
-
})
|
|
2297
|
-
).optional().default([])
|
|
2298
|
-
}),
|
|
2299
|
-
z14.object({
|
|
2300
|
-
type: z14.literal("bash_code_execution_result"),
|
|
2301
|
-
content: z14.array(
|
|
2302
|
-
z14.object({
|
|
2303
|
-
type: z14.literal("bash_code_execution_output"),
|
|
2304
|
-
file_id: z14.string()
|
|
2305
|
-
})
|
|
2306
|
-
),
|
|
2307
|
-
stdout: z14.string(),
|
|
2308
|
-
stderr: z14.string(),
|
|
2309
|
-
return_code: z14.number()
|
|
2310
|
-
}),
|
|
2311
|
-
z14.object({
|
|
2312
|
-
type: z14.literal("bash_code_execution_tool_result_error"),
|
|
2313
|
-
error_code: z14.string()
|
|
2314
|
-
}),
|
|
2315
|
-
z14.object({
|
|
2316
|
-
type: z14.literal("text_editor_code_execution_tool_result_error"),
|
|
2317
|
-
error_code: z14.string()
|
|
2318
|
-
}),
|
|
2319
|
-
z14.object({
|
|
2320
|
-
type: z14.literal("text_editor_code_execution_view_result"),
|
|
2321
|
-
content: z14.string(),
|
|
2322
|
-
file_type: z14.string(),
|
|
2323
|
-
num_lines: z14.number().nullable(),
|
|
2324
|
-
start_line: z14.number().nullable(),
|
|
2325
|
-
total_lines: z14.number().nullable()
|
|
2326
|
-
}),
|
|
2327
|
-
z14.object({
|
|
2328
|
-
type: z14.literal("text_editor_code_execution_create_result"),
|
|
2329
|
-
is_file_update: z14.boolean()
|
|
2330
|
-
}),
|
|
2331
|
-
z14.object({
|
|
2332
|
-
type: z14.literal("text_editor_code_execution_str_replace_result"),
|
|
2333
|
-
lines: z14.array(z14.string()).nullable(),
|
|
2334
|
-
new_lines: z14.number().nullable(),
|
|
2335
|
-
new_start: z14.number().nullable(),
|
|
2336
|
-
old_lines: z14.number().nullable(),
|
|
2337
|
-
old_start: z14.number().nullable()
|
|
2338
|
-
})
|
|
2339
|
-
])
|
|
2340
|
-
)
|
|
2341
|
-
);
|
|
2342
|
-
var codeExecution_20250825InputSchema = lazySchema13(
|
|
2343
|
-
() => zodSchema13(
|
|
2344
|
-
z14.discriminatedUnion("type", [
|
|
2345
|
-
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2346
|
-
z14.object({
|
|
2347
|
-
type: z14.literal("programmatic-tool-call"),
|
|
2348
|
-
code: z14.string()
|
|
2349
|
-
}),
|
|
2350
|
-
z14.object({
|
|
2351
|
-
type: z14.literal("bash_code_execution"),
|
|
2352
|
-
command: z14.string()
|
|
2353
|
-
}),
|
|
2354
|
-
z14.discriminatedUnion("command", [
|
|
2355
|
-
z14.object({
|
|
2356
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2357
|
-
command: z14.literal("view"),
|
|
2358
|
-
path: z14.string()
|
|
2359
|
-
}),
|
|
2360
|
-
z14.object({
|
|
2361
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2362
|
-
command: z14.literal("create"),
|
|
2363
|
-
path: z14.string(),
|
|
2364
|
-
file_text: z14.string().nullish()
|
|
2365
|
-
}),
|
|
2366
|
-
z14.object({
|
|
2367
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2368
|
-
command: z14.literal("str_replace"),
|
|
2369
|
-
path: z14.string(),
|
|
2370
|
-
old_str: z14.string(),
|
|
2371
|
-
new_str: z14.string()
|
|
2372
|
-
})
|
|
2373
|
-
])
|
|
2374
|
-
])
|
|
2375
|
-
)
|
|
2376
|
-
);
|
|
2377
|
-
var factory10 = createProviderExecutedToolFactory9({
|
|
2378
|
-
id: "anthropic.code_execution_20250825",
|
|
2379
|
-
inputSchema: codeExecution_20250825InputSchema,
|
|
2380
|
-
outputSchema: codeExecution_20250825OutputSchema,
|
|
2381
|
-
// Programmatic tool calling: tool results may be deferred to a later turn
|
|
2382
|
-
// when code execution triggers a client-executed tool that needs to be
|
|
2383
|
-
// resolved before the code execution result can be returned.
|
|
2384
|
-
supportsDeferredResults: true
|
|
2385
|
-
});
|
|
2386
|
-
var codeExecution_20250825 = (args = {}) => {
|
|
2387
|
-
return experimental_toolCaller(factory10(args), {
|
|
2388
|
-
type: "provider",
|
|
2389
|
-
prepareProviderOptions: (providerOptions) => {
|
|
2390
|
-
var _a;
|
|
2391
|
-
const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
|
|
2392
|
-
return {
|
|
2393
|
-
...providerOptions,
|
|
2394
|
-
anthropic: {
|
|
2395
|
-
...anthropicOptions,
|
|
2396
|
-
allowedCallers: [
|
|
2397
|
-
.../* @__PURE__ */ new Set([
|
|
2398
|
-
...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
|
|
2399
|
-
"code_execution_20250825"
|
|
2400
|
-
])
|
|
2401
|
-
]
|
|
2402
|
-
}
|
|
2403
|
-
};
|
|
2404
|
-
}
|
|
2405
|
-
});
|
|
2406
|
-
};
|
|
2407
|
-
|
|
2408
|
-
// src/tool/code-execution_20260120.ts
|
|
2409
|
-
import {
|
|
2410
|
-
createProviderExecutedToolFactory as createProviderExecutedToolFactory10,
|
|
2411
|
-
experimental_toolCaller as experimental_toolCaller2,
|
|
2412
2418
|
lazySchema as lazySchema14,
|
|
2413
2419
|
zodSchema as zodSchema14
|
|
2414
2420
|
} from "@ai-sdk/provider-utils";
|
|
2415
2421
|
import { z as z15 } from "zod/v4";
|
|
2416
|
-
var
|
|
2422
|
+
var codeExecution_20250825OutputSchema = lazySchema14(
|
|
2417
2423
|
() => zodSchema14(
|
|
2418
2424
|
z15.discriminatedUnion("type", [
|
|
2419
2425
|
z15.object({
|
|
@@ -2428,18 +2434,6 @@ var codeExecution_20260120OutputSchema = lazySchema14(
|
|
|
2428
2434
|
})
|
|
2429
2435
|
).optional().default([])
|
|
2430
2436
|
}),
|
|
2431
|
-
z15.object({
|
|
2432
|
-
type: z15.literal("encrypted_code_execution_result"),
|
|
2433
|
-
encrypted_stdout: z15.string(),
|
|
2434
|
-
stderr: z15.string(),
|
|
2435
|
-
return_code: z15.number(),
|
|
2436
|
-
content: z15.array(
|
|
2437
|
-
z15.object({
|
|
2438
|
-
type: z15.literal("code_execution_output"),
|
|
2439
|
-
file_id: z15.string()
|
|
2440
|
-
})
|
|
2441
|
-
).optional().default([])
|
|
2442
|
-
}),
|
|
2443
2437
|
z15.object({
|
|
2444
2438
|
type: z15.literal("bash_code_execution_result"),
|
|
2445
2439
|
content: z15.array(
|
|
@@ -2483,9 +2477,10 @@ var codeExecution_20260120OutputSchema = lazySchema14(
|
|
|
2483
2477
|
])
|
|
2484
2478
|
)
|
|
2485
2479
|
);
|
|
2486
|
-
var
|
|
2480
|
+
var codeExecution_20250825InputSchema = lazySchema14(
|
|
2487
2481
|
() => zodSchema14(
|
|
2488
2482
|
z15.discriminatedUnion("type", [
|
|
2483
|
+
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2489
2484
|
z15.object({
|
|
2490
2485
|
type: z15.literal("programmatic-tool-call"),
|
|
2491
2486
|
code: z15.string()
|
|
@@ -2517,6 +2512,149 @@ var codeExecution_20260120InputSchema = lazySchema14(
|
|
|
2517
2512
|
])
|
|
2518
2513
|
)
|
|
2519
2514
|
);
|
|
2515
|
+
var factory10 = createProviderExecutedToolFactory9({
|
|
2516
|
+
id: "anthropic.code_execution_20250825",
|
|
2517
|
+
inputSchema: codeExecution_20250825InputSchema,
|
|
2518
|
+
outputSchema: codeExecution_20250825OutputSchema,
|
|
2519
|
+
// Programmatic tool calling: tool results may be deferred to a later turn
|
|
2520
|
+
// when code execution triggers a client-executed tool that needs to be
|
|
2521
|
+
// resolved before the code execution result can be returned.
|
|
2522
|
+
supportsDeferredResults: true
|
|
2523
|
+
});
|
|
2524
|
+
var codeExecution_20250825 = (args = {}) => {
|
|
2525
|
+
return experimental_toolCaller(factory10(args), {
|
|
2526
|
+
type: "provider",
|
|
2527
|
+
prepareProviderOptions: (providerOptions) => {
|
|
2528
|
+
var _a;
|
|
2529
|
+
const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
|
|
2530
|
+
return {
|
|
2531
|
+
...providerOptions,
|
|
2532
|
+
anthropic: {
|
|
2533
|
+
...anthropicOptions,
|
|
2534
|
+
allowedCallers: [
|
|
2535
|
+
.../* @__PURE__ */ new Set([
|
|
2536
|
+
...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
|
|
2537
|
+
"code_execution_20250825"
|
|
2538
|
+
])
|
|
2539
|
+
]
|
|
2540
|
+
}
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
});
|
|
2544
|
+
};
|
|
2545
|
+
|
|
2546
|
+
// src/tool/code-execution_20260120.ts
|
|
2547
|
+
import {
|
|
2548
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory10,
|
|
2549
|
+
experimental_toolCaller as experimental_toolCaller2,
|
|
2550
|
+
lazySchema as lazySchema15,
|
|
2551
|
+
zodSchema as zodSchema15
|
|
2552
|
+
} from "@ai-sdk/provider-utils";
|
|
2553
|
+
import { z as z16 } from "zod/v4";
|
|
2554
|
+
var codeExecution_20260120OutputSchema = lazySchema15(
|
|
2555
|
+
() => zodSchema15(
|
|
2556
|
+
z16.discriminatedUnion("type", [
|
|
2557
|
+
z16.object({
|
|
2558
|
+
type: z16.literal("code_execution_result"),
|
|
2559
|
+
stdout: z16.string(),
|
|
2560
|
+
stderr: z16.string(),
|
|
2561
|
+
return_code: z16.number(),
|
|
2562
|
+
content: z16.array(
|
|
2563
|
+
z16.object({
|
|
2564
|
+
type: z16.literal("code_execution_output"),
|
|
2565
|
+
file_id: z16.string()
|
|
2566
|
+
})
|
|
2567
|
+
).optional().default([])
|
|
2568
|
+
}),
|
|
2569
|
+
z16.object({
|
|
2570
|
+
type: z16.literal("encrypted_code_execution_result"),
|
|
2571
|
+
encrypted_stdout: z16.string(),
|
|
2572
|
+
stderr: z16.string(),
|
|
2573
|
+
return_code: z16.number(),
|
|
2574
|
+
content: z16.array(
|
|
2575
|
+
z16.object({
|
|
2576
|
+
type: z16.literal("code_execution_output"),
|
|
2577
|
+
file_id: z16.string()
|
|
2578
|
+
})
|
|
2579
|
+
).optional().default([])
|
|
2580
|
+
}),
|
|
2581
|
+
z16.object({
|
|
2582
|
+
type: z16.literal("bash_code_execution_result"),
|
|
2583
|
+
content: z16.array(
|
|
2584
|
+
z16.object({
|
|
2585
|
+
type: z16.literal("bash_code_execution_output"),
|
|
2586
|
+
file_id: z16.string()
|
|
2587
|
+
})
|
|
2588
|
+
),
|
|
2589
|
+
stdout: z16.string(),
|
|
2590
|
+
stderr: z16.string(),
|
|
2591
|
+
return_code: z16.number()
|
|
2592
|
+
}),
|
|
2593
|
+
z16.object({
|
|
2594
|
+
type: z16.literal("bash_code_execution_tool_result_error"),
|
|
2595
|
+
error_code: z16.string()
|
|
2596
|
+
}),
|
|
2597
|
+
z16.object({
|
|
2598
|
+
type: z16.literal("text_editor_code_execution_tool_result_error"),
|
|
2599
|
+
error_code: z16.string()
|
|
2600
|
+
}),
|
|
2601
|
+
z16.object({
|
|
2602
|
+
type: z16.literal("text_editor_code_execution_view_result"),
|
|
2603
|
+
content: z16.string(),
|
|
2604
|
+
file_type: z16.string(),
|
|
2605
|
+
num_lines: z16.number().nullable(),
|
|
2606
|
+
start_line: z16.number().nullable(),
|
|
2607
|
+
total_lines: z16.number().nullable()
|
|
2608
|
+
}),
|
|
2609
|
+
z16.object({
|
|
2610
|
+
type: z16.literal("text_editor_code_execution_create_result"),
|
|
2611
|
+
is_file_update: z16.boolean()
|
|
2612
|
+
}),
|
|
2613
|
+
z16.object({
|
|
2614
|
+
type: z16.literal("text_editor_code_execution_str_replace_result"),
|
|
2615
|
+
lines: z16.array(z16.string()).nullable(),
|
|
2616
|
+
new_lines: z16.number().nullable(),
|
|
2617
|
+
new_start: z16.number().nullable(),
|
|
2618
|
+
old_lines: z16.number().nullable(),
|
|
2619
|
+
old_start: z16.number().nullable()
|
|
2620
|
+
})
|
|
2621
|
+
])
|
|
2622
|
+
)
|
|
2623
|
+
);
|
|
2624
|
+
var codeExecution_20260120InputSchema = lazySchema15(
|
|
2625
|
+
() => zodSchema15(
|
|
2626
|
+
z16.discriminatedUnion("type", [
|
|
2627
|
+
z16.object({
|
|
2628
|
+
type: z16.literal("programmatic-tool-call"),
|
|
2629
|
+
code: z16.string()
|
|
2630
|
+
}),
|
|
2631
|
+
z16.object({
|
|
2632
|
+
type: z16.literal("bash_code_execution"),
|
|
2633
|
+
command: z16.string()
|
|
2634
|
+
}),
|
|
2635
|
+
z16.discriminatedUnion("command", [
|
|
2636
|
+
z16.object({
|
|
2637
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2638
|
+
command: z16.literal("view"),
|
|
2639
|
+
path: z16.string()
|
|
2640
|
+
}),
|
|
2641
|
+
z16.object({
|
|
2642
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2643
|
+
command: z16.literal("create"),
|
|
2644
|
+
path: z16.string(),
|
|
2645
|
+
file_text: z16.string().nullish()
|
|
2646
|
+
}),
|
|
2647
|
+
z16.object({
|
|
2648
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2649
|
+
command: z16.literal("str_replace"),
|
|
2650
|
+
path: z16.string(),
|
|
2651
|
+
old_str: z16.string(),
|
|
2652
|
+
new_str: z16.string()
|
|
2653
|
+
})
|
|
2654
|
+
])
|
|
2655
|
+
])
|
|
2656
|
+
)
|
|
2657
|
+
);
|
|
2520
2658
|
var factory11 = createProviderExecutedToolFactory10({
|
|
2521
2659
|
id: "anthropic.code_execution_20260120",
|
|
2522
2660
|
inputSchema: codeExecution_20260120InputSchema,
|
|
@@ -2548,23 +2686,23 @@ var codeExecution_20260120 = (args = {}) => {
|
|
|
2548
2686
|
// src/tool/tool-search-regex_20251119.ts
|
|
2549
2687
|
import {
|
|
2550
2688
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory11,
|
|
2551
|
-
lazySchema as
|
|
2552
|
-
zodSchema as
|
|
2689
|
+
lazySchema as lazySchema16,
|
|
2690
|
+
zodSchema as zodSchema16
|
|
2553
2691
|
} from "@ai-sdk/provider-utils";
|
|
2554
|
-
import { z as
|
|
2555
|
-
var toolSearchRegex_20251119OutputSchema =
|
|
2556
|
-
() =>
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
type:
|
|
2560
|
-
toolName:
|
|
2692
|
+
import { z as z17 } from "zod/v4";
|
|
2693
|
+
var toolSearchRegex_20251119OutputSchema = lazySchema16(
|
|
2694
|
+
() => zodSchema16(
|
|
2695
|
+
z17.array(
|
|
2696
|
+
z17.object({
|
|
2697
|
+
type: z17.literal("tool_reference"),
|
|
2698
|
+
toolName: z17.string()
|
|
2561
2699
|
})
|
|
2562
2700
|
)
|
|
2563
2701
|
)
|
|
2564
2702
|
);
|
|
2565
|
-
var toolSearchRegex_20251119InputSchema =
|
|
2566
|
-
() =>
|
|
2567
|
-
|
|
2703
|
+
var toolSearchRegex_20251119InputSchema = lazySchema16(
|
|
2704
|
+
() => zodSchema16(
|
|
2705
|
+
z17.object({
|
|
2568
2706
|
/**
|
|
2569
2707
|
* A regex pattern to search for tools.
|
|
2570
2708
|
* Uses Python re.search() syntax. Maximum 200 characters.
|
|
@@ -2575,11 +2713,11 @@ var toolSearchRegex_20251119InputSchema = lazySchema15(
|
|
|
2575
2713
|
* - "database.*query|query.*database" - OR patterns for flexibility
|
|
2576
2714
|
* - "(?i)slack" - case-insensitive search
|
|
2577
2715
|
*/
|
|
2578
|
-
pattern:
|
|
2716
|
+
pattern: z17.string(),
|
|
2579
2717
|
/**
|
|
2580
2718
|
* Maximum number of tools to return. Optional.
|
|
2581
2719
|
*/
|
|
2582
|
-
limit:
|
|
2720
|
+
limit: z17.number().optional()
|
|
2583
2721
|
})
|
|
2584
2722
|
)
|
|
2585
2723
|
);
|
|
@@ -2620,7 +2758,8 @@ async function convertToAnthropicPrompt({
|
|
|
2620
2758
|
sendReasoning,
|
|
2621
2759
|
warnings,
|
|
2622
2760
|
cacheControlValidator,
|
|
2623
|
-
toolNameMapping
|
|
2761
|
+
toolNameMapping,
|
|
2762
|
+
toolsetNames = {}
|
|
2624
2763
|
}) {
|
|
2625
2764
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2626
2765
|
const betas = /* @__PURE__ */ new Set();
|
|
@@ -2743,7 +2882,7 @@ async function convertToAnthropicPrompt({
|
|
|
2743
2882
|
betas.add("mid-conversation-system-clear-at-2026-08-21");
|
|
2744
2883
|
}
|
|
2745
2884
|
if (message.effort != null) {
|
|
2746
|
-
betas.add("mid-conversation-
|
|
2885
|
+
betas.add("mid-conversation-output-config-2026-07-01");
|
|
2747
2886
|
}
|
|
2748
2887
|
}
|
|
2749
2888
|
}
|
|
@@ -3043,9 +3182,15 @@ async function convertToAnthropicPrompt({
|
|
|
3043
3182
|
contentValue = JSON.stringify(output.value);
|
|
3044
3183
|
break;
|
|
3045
3184
|
}
|
|
3185
|
+
const toolsetName = getAnthropicToolsetName({
|
|
3186
|
+
toolName: part.toolName,
|
|
3187
|
+
providerOptions: part.providerOptions,
|
|
3188
|
+
toolsetNames
|
|
3189
|
+
});
|
|
3046
3190
|
anthropicContent.push({
|
|
3047
3191
|
type: "tool_result",
|
|
3048
3192
|
tool_use_id: part.toolCallId,
|
|
3193
|
+
...toolsetName != null && { toolset_name: toolsetName },
|
|
3049
3194
|
content: contentValue,
|
|
3050
3195
|
is_error: output.type === "error-text" || output.type === "error-json" ? true : void 0,
|
|
3051
3196
|
cache_control: cacheControl
|
|
@@ -3083,6 +3228,9 @@ async function convertToAnthropicPrompt({
|
|
|
3083
3228
|
case "text": {
|
|
3084
3229
|
const textMetadata = (_k = part.providerOptions) == null ? void 0 : _k.anthropic;
|
|
3085
3230
|
if ((textMetadata == null ? void 0 : textMetadata.type) === "compaction") {
|
|
3231
|
+
if (part.text === "") {
|
|
3232
|
+
break;
|
|
3233
|
+
}
|
|
3086
3234
|
anthropicContent.push({
|
|
3087
3235
|
type: "compaction",
|
|
3088
3236
|
content: part.text,
|
|
@@ -3243,6 +3391,33 @@ async function convertToAnthropicPrompt({
|
|
|
3243
3391
|
}
|
|
3244
3392
|
break;
|
|
3245
3393
|
}
|
|
3394
|
+
const toolsetName = getAnthropicToolsetName({
|
|
3395
|
+
toolName: part.toolName,
|
|
3396
|
+
providerOptions: part.providerOptions,
|
|
3397
|
+
toolsetNames
|
|
3398
|
+
});
|
|
3399
|
+
if (toolsetName != null) {
|
|
3400
|
+
const { action, ...memberInput } = toAnthropicToolInput(
|
|
3401
|
+
part.input
|
|
3402
|
+
);
|
|
3403
|
+
if (typeof action !== "string") {
|
|
3404
|
+
warnings.push({
|
|
3405
|
+
type: "other",
|
|
3406
|
+
message: `toolset tool call for tool ${part.toolName} is missing the action`
|
|
3407
|
+
});
|
|
3408
|
+
break;
|
|
3409
|
+
}
|
|
3410
|
+
anthropicContent.push({
|
|
3411
|
+
type: "tool_use",
|
|
3412
|
+
id: part.toolCallId,
|
|
3413
|
+
name: action,
|
|
3414
|
+
toolset_name: toolsetName,
|
|
3415
|
+
input: memberInput,
|
|
3416
|
+
...caller && { caller },
|
|
3417
|
+
cache_control: cacheControl
|
|
3418
|
+
});
|
|
3419
|
+
break;
|
|
3420
|
+
}
|
|
3246
3421
|
anthropicContent.push({
|
|
3247
3422
|
type: "tool_use",
|
|
3248
3423
|
id: part.toolCallId,
|
|
@@ -3582,10 +3757,12 @@ async function convertToAnthropicPrompt({
|
|
|
3582
3757
|
}
|
|
3583
3758
|
}
|
|
3584
3759
|
}
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3760
|
+
if (anthropicContent.length > 0) {
|
|
3761
|
+
messages.push({
|
|
3762
|
+
role: "assistant",
|
|
3763
|
+
content: moveToolUseBlocksToEnd(anthropicContent)
|
|
3764
|
+
});
|
|
3765
|
+
}
|
|
3589
3766
|
break;
|
|
3590
3767
|
}
|
|
3591
3768
|
default: {
|
|
@@ -3666,6 +3843,19 @@ function moveToolUseBlocksToEnd(content) {
|
|
|
3666
3843
|
flushSegment();
|
|
3667
3844
|
return result;
|
|
3668
3845
|
}
|
|
3846
|
+
function getAnthropicToolsetName({
|
|
3847
|
+
toolName,
|
|
3848
|
+
providerOptions,
|
|
3849
|
+
toolsetNames
|
|
3850
|
+
}) {
|
|
3851
|
+
var _a;
|
|
3852
|
+
const fromTools = toolsetNames[toolName];
|
|
3853
|
+
if (fromTools != null) {
|
|
3854
|
+
return fromTools;
|
|
3855
|
+
}
|
|
3856
|
+
const fromMetadata = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.toolsetName;
|
|
3857
|
+
return typeof fromMetadata === "string" ? fromMetadata : void 0;
|
|
3858
|
+
}
|
|
3669
3859
|
function getAnthropicCaller(providerOptions) {
|
|
3670
3860
|
var _a;
|
|
3671
3861
|
const caller = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.caller;
|
|
@@ -3939,6 +4129,24 @@ function getAnthropicCallerMetadata(caller) {
|
|
|
3939
4129
|
const callerInfo = getAnthropicCallerInfo(caller);
|
|
3940
4130
|
return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
|
|
3941
4131
|
}
|
|
4132
|
+
function getAnthropicToolsetNames(tools) {
|
|
4133
|
+
const toolsetNames = {};
|
|
4134
|
+
for (const tool of tools != null ? tools : []) {
|
|
4135
|
+
if (tool.type === "provider" && tool.id === "anthropic.computer_toolset_20260801") {
|
|
4136
|
+
toolsetNames[tool.name] = "computer";
|
|
4137
|
+
}
|
|
4138
|
+
}
|
|
4139
|
+
return toolsetNames;
|
|
4140
|
+
}
|
|
4141
|
+
function toToolsetMemberInput({
|
|
4142
|
+
memberName,
|
|
4143
|
+
input
|
|
4144
|
+
}) {
|
|
4145
|
+
return {
|
|
4146
|
+
action: memberName,
|
|
4147
|
+
...typeof input === "object" && input !== null && !Array.isArray(input) ? input : {}
|
|
4148
|
+
};
|
|
4149
|
+
}
|
|
3942
4150
|
function getProviderOptionsName(provider) {
|
|
3943
4151
|
const dotIndex = provider.indexOf(".");
|
|
3944
4152
|
return dotIndex === -1 ? provider : provider.substring(0, dotIndex);
|
|
@@ -4051,6 +4259,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4051
4259
|
rejectsSamplingParameters,
|
|
4052
4260
|
supportsXhighEffort,
|
|
4053
4261
|
rejectsThinkingDisabledAboveHighEffort,
|
|
4262
|
+
rejectsThinkingDisabled,
|
|
4263
|
+
rejectsForcedToolUse,
|
|
4054
4264
|
isKnownModel
|
|
4055
4265
|
} = getModelCapabilities(modelId);
|
|
4056
4266
|
if (!isKnownModel && maxOutputTokens == null) {
|
|
@@ -4090,7 +4300,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4090
4300
|
const supportsStructuredOutput = ((_a = config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
4091
4301
|
const supportsStrictTools = ((_b = config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
4092
4302
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
4093
|
-
|
|
4303
|
+
let useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
4304
|
+
if (!useStructuredOutput && rejectsForcedToolUse && supportsStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
|
|
4305
|
+
warnings.push({
|
|
4306
|
+
type: "unsupported",
|
|
4307
|
+
feature: "providerOptions.anthropic.structuredOutputMode",
|
|
4308
|
+
details: `structuredOutputMode 'jsonTool' is not supported by ${modelId} because it rejects forced tool use. Using 'outputFormat' instead.`
|
|
4309
|
+
});
|
|
4310
|
+
useStructuredOutput = true;
|
|
4311
|
+
}
|
|
4094
4312
|
const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
4095
4313
|
type: "function",
|
|
4096
4314
|
name: "json",
|
|
@@ -4114,6 +4332,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4114
4332
|
"anthropic.code_execution_20260120": "code_execution",
|
|
4115
4333
|
"anthropic.computer_20241022": "computer",
|
|
4116
4334
|
"anthropic.computer_20250124": "computer",
|
|
4335
|
+
"anthropic.computer_20251124": "computer",
|
|
4336
|
+
"anthropic.computer_toolset_20260801": "computer",
|
|
4117
4337
|
"anthropic.text_editor_20241022": "str_replace_editor",
|
|
4118
4338
|
"anthropic.text_editor_20250124": "str_replace_editor",
|
|
4119
4339
|
"anthropic.text_editor_20250429": "str_replace_based_edit_tool",
|
|
@@ -4132,18 +4352,22 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4132
4352
|
"anthropic.advisor_20260301": "advisor"
|
|
4133
4353
|
}
|
|
4134
4354
|
});
|
|
4355
|
+
const toolsetNames = getAnthropicToolsetNames(tools);
|
|
4135
4356
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicPrompt({
|
|
4136
4357
|
prompt,
|
|
4137
4358
|
sendReasoning: (_d = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _d : true,
|
|
4138
4359
|
warnings,
|
|
4139
4360
|
cacheControlValidator,
|
|
4140
|
-
toolNameMapping
|
|
4361
|
+
toolNameMapping,
|
|
4362
|
+
toolsetNames
|
|
4141
4363
|
});
|
|
4142
4364
|
if (isCustomReasoning(reasoning) && (anthropicOptions == null ? void 0 : anthropicOptions.effort) == null) {
|
|
4143
4365
|
const reasoningConfig = resolveAnthropicReasoningConfig({
|
|
4144
4366
|
reasoning,
|
|
4367
|
+
modelId,
|
|
4145
4368
|
supportsAdaptiveThinking,
|
|
4146
4369
|
supportsXhighEffort,
|
|
4370
|
+
rejectsThinkingDisabled,
|
|
4147
4371
|
maxOutputTokensForModel,
|
|
4148
4372
|
warnings
|
|
4149
4373
|
});
|
|
@@ -4156,6 +4380,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4156
4380
|
}
|
|
4157
4381
|
}
|
|
4158
4382
|
}
|
|
4383
|
+
if (rejectsThinkingDisabled && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null) {
|
|
4384
|
+
const thinking = anthropicOptions.thinking;
|
|
4385
|
+
if (thinking.type === "disabled") {
|
|
4386
|
+
warnings.push({
|
|
4387
|
+
type: "unsupported",
|
|
4388
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4389
|
+
details: `thinking cannot be disabled for ${modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
|
|
4390
|
+
});
|
|
4391
|
+
anthropicOptions.thinking = void 0;
|
|
4392
|
+
} else if (thinking.type === "enabled") {
|
|
4393
|
+
warnings.push({
|
|
4394
|
+
type: "unsupported",
|
|
4395
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4396
|
+
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.`
|
|
4397
|
+
});
|
|
4398
|
+
anthropicOptions.thinking = { type: "adaptive" };
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4159
4401
|
if (rejectsThinkingDisabledAboveHighEffort && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.type) === "disabled" && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
4160
4402
|
warnings.push({
|
|
4161
4403
|
type: "unsupported",
|
|
@@ -4442,7 +4684,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4442
4684
|
cacheControlValidator,
|
|
4443
4685
|
supportsStructuredOutput: false,
|
|
4444
4686
|
supportsStrictTools,
|
|
4445
|
-
defaultEagerInputStreaming
|
|
4687
|
+
defaultEagerInputStreaming,
|
|
4688
|
+
rejectsForcedToolUse
|
|
4446
4689
|
} : {
|
|
4447
4690
|
tools: tools != null ? tools : [],
|
|
4448
4691
|
toolChoice,
|
|
@@ -4450,7 +4693,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4450
4693
|
cacheControlValidator,
|
|
4451
4694
|
supportsStructuredOutput,
|
|
4452
4695
|
supportsStrictTools,
|
|
4453
|
-
defaultEagerInputStreaming
|
|
4696
|
+
defaultEagerInputStreaming,
|
|
4697
|
+
rejectsForcedToolUse
|
|
4454
4698
|
}
|
|
4455
4699
|
);
|
|
4456
4700
|
const cacheWarnings = cacheControlValidator.getWarnings();
|
|
@@ -4536,7 +4780,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4536
4780
|
});
|
|
4537
4781
|
}
|
|
4538
4782
|
async doGenerate(options) {
|
|
4539
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4783
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
4540
4784
|
const {
|
|
4541
4785
|
args,
|
|
4542
4786
|
warnings,
|
|
@@ -4639,6 +4883,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4639
4883
|
break;
|
|
4640
4884
|
}
|
|
4641
4885
|
case "compaction": {
|
|
4886
|
+
if (!part.content) {
|
|
4887
|
+
break;
|
|
4888
|
+
}
|
|
4642
4889
|
content.push({
|
|
4643
4890
|
type: "text",
|
|
4644
4891
|
text: part.content,
|
|
@@ -4658,6 +4905,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4658
4905
|
type: "text",
|
|
4659
4906
|
text: JSON.stringify(part.input)
|
|
4660
4907
|
});
|
|
4908
|
+
} else if (part.toolset_name != null) {
|
|
4909
|
+
content.push({
|
|
4910
|
+
type: "tool-call",
|
|
4911
|
+
toolCallId: part.id,
|
|
4912
|
+
toolName: toolNameMapping.toCustomToolName(part.toolset_name),
|
|
4913
|
+
input: JSON.stringify(
|
|
4914
|
+
toToolsetMemberInput({
|
|
4915
|
+
memberName: part.name,
|
|
4916
|
+
input: part.input
|
|
4917
|
+
})
|
|
4918
|
+
),
|
|
4919
|
+
providerMetadata: {
|
|
4920
|
+
anthropic: {
|
|
4921
|
+
toolsetName: part.toolset_name,
|
|
4922
|
+
...(_b = getAnthropicCallerMetadata(part.caller).providerMetadata) == null ? void 0 : _b.anthropic
|
|
4923
|
+
}
|
|
4924
|
+
}
|
|
4925
|
+
});
|
|
4661
4926
|
} else {
|
|
4662
4927
|
content.push({
|
|
4663
4928
|
type: "tool-call",
|
|
@@ -4755,7 +5020,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4755
5020
|
case "web_fetch_tool_result": {
|
|
4756
5021
|
if (part.content.type === "web_fetch_result") {
|
|
4757
5022
|
citationDocuments.push({
|
|
4758
|
-
title: (
|
|
5023
|
+
title: (_c = part.content.content.title) != null ? _c : part.content.url,
|
|
4759
5024
|
mediaType: part.content.content.source.media_type
|
|
4760
5025
|
});
|
|
4761
5026
|
content.push({
|
|
@@ -4821,7 +5086,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4821
5086
|
...result.title != null ? { title: result.title } : {},
|
|
4822
5087
|
providerMetadata: {
|
|
4823
5088
|
anthropic: {
|
|
4824
|
-
pageAge: (
|
|
5089
|
+
pageAge: (_d = result.page_age) != null ? _d : null
|
|
4825
5090
|
}
|
|
4826
5091
|
}
|
|
4827
5092
|
});
|
|
@@ -4853,7 +5118,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4853
5118
|
stdout: part.content.stdout,
|
|
4854
5119
|
stderr: part.content.stderr,
|
|
4855
5120
|
return_code: part.content.return_code,
|
|
4856
|
-
content: (
|
|
5121
|
+
content: (_e = part.content.content) != null ? _e : []
|
|
4857
5122
|
}
|
|
4858
5123
|
});
|
|
4859
5124
|
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
@@ -4866,7 +5131,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4866
5131
|
encrypted_stdout: part.content.encrypted_stdout,
|
|
4867
5132
|
stderr: part.content.stderr,
|
|
4868
5133
|
return_code: part.content.return_code,
|
|
4869
|
-
content: (
|
|
5134
|
+
content: (_f = part.content.content) != null ? _f : []
|
|
4870
5135
|
}
|
|
4871
5136
|
});
|
|
4872
5137
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
@@ -4994,13 +5259,13 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4994
5259
|
finishReason: response.stop_reason,
|
|
4995
5260
|
isJsonResponseFromTool
|
|
4996
5261
|
}),
|
|
4997
|
-
raw: (
|
|
5262
|
+
raw: (_g = response.stop_reason) != null ? _g : void 0
|
|
4998
5263
|
},
|
|
4999
5264
|
usage: convertAnthropicUsage({ usage: response.usage }),
|
|
5000
5265
|
request: { body: args },
|
|
5001
5266
|
response: {
|
|
5002
|
-
id: (
|
|
5003
|
-
modelId: (
|
|
5267
|
+
id: (_h = response.id) != null ? _h : void 0,
|
|
5268
|
+
modelId: (_i = response.model) != null ? _i : void 0,
|
|
5004
5269
|
headers: responseHeaders,
|
|
5005
5270
|
body: rawResponse
|
|
5006
5271
|
},
|
|
@@ -5201,6 +5466,29 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5201
5466
|
type: "text-start",
|
|
5202
5467
|
id: String(value.index)
|
|
5203
5468
|
});
|
|
5469
|
+
} else if (part.toolset_name != null) {
|
|
5470
|
+
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5471
|
+
const customToolName = toolNameMapping.toCustomToolName(
|
|
5472
|
+
part.toolset_name
|
|
5473
|
+
);
|
|
5474
|
+
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
5475
|
+
contentBlocks[value.index] = {
|
|
5476
|
+
type: "tool-call",
|
|
5477
|
+
toolCallId: part.id,
|
|
5478
|
+
toolName: customToolName,
|
|
5479
|
+
input: hasNonEmptyInput ? JSON.stringify(part.input) : "",
|
|
5480
|
+
firstDelta: true,
|
|
5481
|
+
toolset: {
|
|
5482
|
+
name: part.toolset_name,
|
|
5483
|
+
memberName: part.name
|
|
5484
|
+
},
|
|
5485
|
+
...callerInfo && { caller: callerInfo }
|
|
5486
|
+
};
|
|
5487
|
+
controller.enqueue({
|
|
5488
|
+
type: "tool-input-start",
|
|
5489
|
+
id: part.id,
|
|
5490
|
+
toolName: customToolName
|
|
5491
|
+
});
|
|
5204
5492
|
} else {
|
|
5205
5493
|
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5206
5494
|
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
@@ -5600,6 +5888,25 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5600
5888
|
case "tool-call":
|
|
5601
5889
|
const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === "json";
|
|
5602
5890
|
if (!isJsonResponseTool) {
|
|
5891
|
+
if (contentBlock.toolset != null) {
|
|
5892
|
+
let memberInput = {};
|
|
5893
|
+
try {
|
|
5894
|
+
memberInput = contentBlock.input === "" ? {} : secureJsonParse2(contentBlock.input);
|
|
5895
|
+
} catch (e) {
|
|
5896
|
+
memberInput = void 0;
|
|
5897
|
+
}
|
|
5898
|
+
contentBlock.input = memberInput === void 0 ? contentBlock.input : JSON.stringify(
|
|
5899
|
+
toToolsetMemberInput({
|
|
5900
|
+
memberName: contentBlock.toolset.memberName,
|
|
5901
|
+
input: memberInput
|
|
5902
|
+
})
|
|
5903
|
+
);
|
|
5904
|
+
controller.enqueue({
|
|
5905
|
+
type: "tool-input-delta",
|
|
5906
|
+
id: contentBlock.toolCallId,
|
|
5907
|
+
delta: contentBlock.input
|
|
5908
|
+
});
|
|
5909
|
+
}
|
|
5603
5910
|
controller.enqueue({
|
|
5604
5911
|
type: "tool-input-end",
|
|
5605
5912
|
id: contentBlock.toolCallId
|
|
@@ -5628,10 +5935,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5628
5935
|
// tool was not explicitly provided. We therefore bypass the general validation by marking the
|
|
5629
5936
|
// tool as dynamic.
|
|
5630
5937
|
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
5631
|
-
...contentBlock.caller && {
|
|
5938
|
+
...(contentBlock.caller || contentBlock.toolset) && {
|
|
5632
5939
|
providerMetadata: {
|
|
5633
5940
|
anthropic: {
|
|
5634
|
-
|
|
5941
|
+
...contentBlock.toolset && {
|
|
5942
|
+
toolsetName: contentBlock.toolset.name
|
|
5943
|
+
},
|
|
5944
|
+
...contentBlock.caller && {
|
|
5945
|
+
caller: contentBlock.caller
|
|
5946
|
+
}
|
|
5635
5947
|
}
|
|
5636
5948
|
}
|
|
5637
5949
|
}
|
|
@@ -5710,6 +6022,10 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5710
6022
|
if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
|
|
5711
6023
|
return;
|
|
5712
6024
|
}
|
|
6025
|
+
if (contentBlock.toolset != null) {
|
|
6026
|
+
contentBlock.input += delta;
|
|
6027
|
+
return;
|
|
6028
|
+
}
|
|
5713
6029
|
if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
|
|
5714
6030
|
delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
|
|
5715
6031
|
}
|
|
@@ -5975,7 +6291,19 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5975
6291
|
}
|
|
5976
6292
|
};
|
|
5977
6293
|
function getModelCapabilities(modelId) {
|
|
5978
|
-
if (modelId.includes("claude-opus-5")) {
|
|
6294
|
+
if (modelId.includes("claude-opus-5-5")) {
|
|
6295
|
+
return {
|
|
6296
|
+
maxOutputTokens: 128e3,
|
|
6297
|
+
supportsStructuredOutput: true,
|
|
6298
|
+
supportsAdaptiveThinking: true,
|
|
6299
|
+
rejectsSamplingParameters: true,
|
|
6300
|
+
supportsXhighEffort: true,
|
|
6301
|
+
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6302
|
+
rejectsThinkingDisabled: true,
|
|
6303
|
+
rejectsForcedToolUse: true,
|
|
6304
|
+
isKnownModel: true
|
|
6305
|
+
};
|
|
6306
|
+
} else if (modelId.includes("claude-opus-5")) {
|
|
5979
6307
|
return {
|
|
5980
6308
|
maxOutputTokens: 128e3,
|
|
5981
6309
|
supportsStructuredOutput: true,
|
|
@@ -5983,9 +6311,35 @@ function getModelCapabilities(modelId) {
|
|
|
5983
6311
|
rejectsSamplingParameters: true,
|
|
5984
6312
|
supportsXhighEffort: true,
|
|
5985
6313
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6314
|
+
rejectsThinkingDisabled: false,
|
|
6315
|
+
rejectsForcedToolUse: false,
|
|
6316
|
+
isKnownModel: true
|
|
6317
|
+
};
|
|
6318
|
+
} else if (modelId.includes("claude-fable-5-1")) {
|
|
6319
|
+
return {
|
|
6320
|
+
maxOutputTokens: 128e3,
|
|
6321
|
+
supportsStructuredOutput: true,
|
|
6322
|
+
supportsAdaptiveThinking: true,
|
|
6323
|
+
rejectsSamplingParameters: true,
|
|
6324
|
+
supportsXhighEffort: true,
|
|
6325
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6326
|
+
rejectsThinkingDisabled: true,
|
|
6327
|
+
rejectsForcedToolUse: true,
|
|
6328
|
+
isKnownModel: true
|
|
6329
|
+
};
|
|
6330
|
+
} else if (modelId.includes("claude-fable-5")) {
|
|
6331
|
+
return {
|
|
6332
|
+
maxOutputTokens: 128e3,
|
|
6333
|
+
supportsStructuredOutput: true,
|
|
6334
|
+
supportsAdaptiveThinking: true,
|
|
6335
|
+
rejectsSamplingParameters: true,
|
|
6336
|
+
supportsXhighEffort: true,
|
|
6337
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6338
|
+
rejectsThinkingDisabled: true,
|
|
6339
|
+
rejectsForcedToolUse: false,
|
|
5986
6340
|
isKnownModel: true
|
|
5987
6341
|
};
|
|
5988
|
-
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-
|
|
6342
|
+
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) {
|
|
5989
6343
|
return {
|
|
5990
6344
|
maxOutputTokens: 128e3,
|
|
5991
6345
|
supportsStructuredOutput: true,
|
|
@@ -5993,6 +6347,8 @@ function getModelCapabilities(modelId) {
|
|
|
5993
6347
|
rejectsSamplingParameters: true,
|
|
5994
6348
|
supportsXhighEffort: true,
|
|
5995
6349
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6350
|
+
rejectsThinkingDisabled: false,
|
|
6351
|
+
rejectsForcedToolUse: false,
|
|
5996
6352
|
isKnownModel: true
|
|
5997
6353
|
};
|
|
5998
6354
|
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
@@ -6003,6 +6359,8 @@ function getModelCapabilities(modelId) {
|
|
|
6003
6359
|
rejectsSamplingParameters: false,
|
|
6004
6360
|
supportsXhighEffort: false,
|
|
6005
6361
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6362
|
+
rejectsThinkingDisabled: false,
|
|
6363
|
+
rejectsForcedToolUse: false,
|
|
6006
6364
|
isKnownModel: true
|
|
6007
6365
|
};
|
|
6008
6366
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
@@ -6013,6 +6371,8 @@ function getModelCapabilities(modelId) {
|
|
|
6013
6371
|
rejectsSamplingParameters: false,
|
|
6014
6372
|
supportsXhighEffort: false,
|
|
6015
6373
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6374
|
+
rejectsThinkingDisabled: false,
|
|
6375
|
+
rejectsForcedToolUse: false,
|
|
6016
6376
|
isKnownModel: true
|
|
6017
6377
|
};
|
|
6018
6378
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
@@ -6023,6 +6383,8 @@ function getModelCapabilities(modelId) {
|
|
|
6023
6383
|
rejectsSamplingParameters: false,
|
|
6024
6384
|
supportsXhighEffort: false,
|
|
6025
6385
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6386
|
+
rejectsThinkingDisabled: false,
|
|
6387
|
+
rejectsForcedToolUse: false,
|
|
6026
6388
|
isKnownModel: true
|
|
6027
6389
|
};
|
|
6028
6390
|
} else if (/claude-sonnet-4(?:-|@)/.test(modelId)) {
|
|
@@ -6033,6 +6395,8 @@ function getModelCapabilities(modelId) {
|
|
|
6033
6395
|
rejectsSamplingParameters: false,
|
|
6034
6396
|
supportsXhighEffort: false,
|
|
6035
6397
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6398
|
+
rejectsThinkingDisabled: false,
|
|
6399
|
+
rejectsForcedToolUse: false,
|
|
6036
6400
|
isKnownModel: true
|
|
6037
6401
|
};
|
|
6038
6402
|
} else if (/claude-opus-4(?:-|@)/.test(modelId)) {
|
|
@@ -6043,6 +6407,8 @@ function getModelCapabilities(modelId) {
|
|
|
6043
6407
|
rejectsSamplingParameters: false,
|
|
6044
6408
|
supportsXhighEffort: false,
|
|
6045
6409
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6410
|
+
rejectsThinkingDisabled: false,
|
|
6411
|
+
rejectsForcedToolUse: false,
|
|
6046
6412
|
isKnownModel: true
|
|
6047
6413
|
};
|
|
6048
6414
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
@@ -6053,6 +6419,8 @@ function getModelCapabilities(modelId) {
|
|
|
6053
6419
|
rejectsSamplingParameters: false,
|
|
6054
6420
|
supportsXhighEffort: false,
|
|
6055
6421
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6422
|
+
rejectsThinkingDisabled: false,
|
|
6423
|
+
rejectsForcedToolUse: false,
|
|
6056
6424
|
isKnownModel: true
|
|
6057
6425
|
};
|
|
6058
6426
|
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
@@ -6063,6 +6431,8 @@ function getModelCapabilities(modelId) {
|
|
|
6063
6431
|
rejectsSamplingParameters: false,
|
|
6064
6432
|
supportsXhighEffort: false,
|
|
6065
6433
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6434
|
+
rejectsThinkingDisabled: false,
|
|
6435
|
+
rejectsForcedToolUse: false,
|
|
6066
6436
|
isKnownModel: false
|
|
6067
6437
|
};
|
|
6068
6438
|
} else if (modelId.includes("claude-")) {
|
|
@@ -6073,6 +6443,8 @@ function getModelCapabilities(modelId) {
|
|
|
6073
6443
|
rejectsSamplingParameters: true,
|
|
6074
6444
|
supportsXhighEffort: true,
|
|
6075
6445
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6446
|
+
rejectsThinkingDisabled: false,
|
|
6447
|
+
rejectsForcedToolUse: false,
|
|
6076
6448
|
isKnownModel: false
|
|
6077
6449
|
};
|
|
6078
6450
|
} else {
|
|
@@ -6083,6 +6455,8 @@ function getModelCapabilities(modelId) {
|
|
|
6083
6455
|
rejectsSamplingParameters: false,
|
|
6084
6456
|
supportsXhighEffort: false,
|
|
6085
6457
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6458
|
+
rejectsThinkingDisabled: false,
|
|
6459
|
+
rejectsForcedToolUse: false,
|
|
6086
6460
|
isKnownModel: false
|
|
6087
6461
|
};
|
|
6088
6462
|
}
|
|
@@ -6107,8 +6481,10 @@ function hasDynamicFilteringWebToolWithoutCodeExecution(tools) {
|
|
|
6107
6481
|
}
|
|
6108
6482
|
function resolveAnthropicReasoningConfig({
|
|
6109
6483
|
reasoning,
|
|
6484
|
+
modelId,
|
|
6110
6485
|
supportsAdaptiveThinking,
|
|
6111
6486
|
supportsXhighEffort,
|
|
6487
|
+
rejectsThinkingDisabled,
|
|
6112
6488
|
maxOutputTokensForModel,
|
|
6113
6489
|
warnings
|
|
6114
6490
|
}) {
|
|
@@ -6116,6 +6492,14 @@ function resolveAnthropicReasoningConfig({
|
|
|
6116
6492
|
return void 0;
|
|
6117
6493
|
}
|
|
6118
6494
|
if (reasoning === "none") {
|
|
6495
|
+
if (rejectsThinkingDisabled) {
|
|
6496
|
+
warnings.push({
|
|
6497
|
+
type: "compatibility",
|
|
6498
|
+
feature: "reasoning",
|
|
6499
|
+
details: `reasoning 'none' is not supported by ${modelId}; it always uses adaptive thinking. Using effort 'low' to minimize thinking instead.`
|
|
6500
|
+
});
|
|
6501
|
+
return { effort: "low" };
|
|
6502
|
+
}
|
|
6119
6503
|
return { thinking: { type: "disabled" } };
|
|
6120
6504
|
}
|
|
6121
6505
|
if (supportsAdaptiveThinking) {
|
|
@@ -6185,20 +6569,20 @@ function mapAnthropicStopDetails(stopDetails) {
|
|
|
6185
6569
|
|
|
6186
6570
|
// src/tool/bash_20241022.ts
|
|
6187
6571
|
import {
|
|
6188
|
-
createProviderDefinedToolFactory as
|
|
6189
|
-
lazySchema as
|
|
6190
|
-
zodSchema as
|
|
6572
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
|
|
6573
|
+
lazySchema as lazySchema17,
|
|
6574
|
+
zodSchema as zodSchema17
|
|
6191
6575
|
} from "@ai-sdk/provider-utils";
|
|
6192
|
-
import { z as
|
|
6193
|
-
var bash_20241022InputSchema =
|
|
6194
|
-
() =>
|
|
6195
|
-
|
|
6196
|
-
command:
|
|
6197
|
-
restart:
|
|
6576
|
+
import { z as z18 } from "zod/v4";
|
|
6577
|
+
var bash_20241022InputSchema = lazySchema17(
|
|
6578
|
+
() => zodSchema17(
|
|
6579
|
+
z18.object({
|
|
6580
|
+
command: z18.string(),
|
|
6581
|
+
restart: z18.boolean().optional()
|
|
6198
6582
|
})
|
|
6199
6583
|
)
|
|
6200
6584
|
);
|
|
6201
|
-
var bash_20241022_internal =
|
|
6585
|
+
var bash_20241022_internal = createProviderDefinedToolFactory3({
|
|
6202
6586
|
id: "anthropic.bash_20241022",
|
|
6203
6587
|
inputSchema: bash_20241022InputSchema
|
|
6204
6588
|
});
|
|
@@ -6226,20 +6610,20 @@ function bash_20241022(options = {}) {
|
|
|
6226
6610
|
|
|
6227
6611
|
// src/tool/bash_20250124.ts
|
|
6228
6612
|
import {
|
|
6229
|
-
createProviderDefinedToolFactory as
|
|
6230
|
-
lazySchema as
|
|
6231
|
-
zodSchema as
|
|
6613
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
|
|
6614
|
+
lazySchema as lazySchema18,
|
|
6615
|
+
zodSchema as zodSchema18
|
|
6232
6616
|
} from "@ai-sdk/provider-utils";
|
|
6233
|
-
import { z as
|
|
6234
|
-
var bash_20250124InputSchema =
|
|
6235
|
-
() =>
|
|
6236
|
-
|
|
6237
|
-
command:
|
|
6238
|
-
restart:
|
|
6617
|
+
import { z as z19 } from "zod/v4";
|
|
6618
|
+
var bash_20250124InputSchema = lazySchema18(
|
|
6619
|
+
() => zodSchema18(
|
|
6620
|
+
z19.object({
|
|
6621
|
+
command: z19.string(),
|
|
6622
|
+
restart: z19.boolean().optional()
|
|
6239
6623
|
})
|
|
6240
6624
|
)
|
|
6241
6625
|
);
|
|
6242
|
-
var bash_20250124_internal =
|
|
6626
|
+
var bash_20250124_internal = createProviderDefinedToolFactory4({
|
|
6243
6627
|
id: "anthropic.bash_20250124",
|
|
6244
6628
|
inputSchema: bash_20250124InputSchema
|
|
6245
6629
|
});
|
|
@@ -6267,15 +6651,15 @@ function bash_20250124(options = {}) {
|
|
|
6267
6651
|
|
|
6268
6652
|
// src/tool/computer_20241022.ts
|
|
6269
6653
|
import {
|
|
6270
|
-
createProviderDefinedToolFactory as
|
|
6271
|
-
lazySchema as
|
|
6272
|
-
zodSchema as
|
|
6654
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
|
|
6655
|
+
lazySchema as lazySchema19,
|
|
6656
|
+
zodSchema as zodSchema19
|
|
6273
6657
|
} from "@ai-sdk/provider-utils";
|
|
6274
|
-
import { z as
|
|
6275
|
-
var computer_20241022InputSchema =
|
|
6276
|
-
() =>
|
|
6277
|
-
|
|
6278
|
-
action:
|
|
6658
|
+
import { z as z20 } from "zod/v4";
|
|
6659
|
+
var computer_20241022InputSchema = lazySchema19(
|
|
6660
|
+
() => zodSchema19(
|
|
6661
|
+
z20.object({
|
|
6662
|
+
action: z20.enum([
|
|
6279
6663
|
"key",
|
|
6280
6664
|
"type",
|
|
6281
6665
|
"mouse_move",
|
|
@@ -6287,27 +6671,27 @@ var computer_20241022InputSchema = lazySchema18(
|
|
|
6287
6671
|
"screenshot",
|
|
6288
6672
|
"cursor_position"
|
|
6289
6673
|
]),
|
|
6290
|
-
coordinate:
|
|
6291
|
-
text:
|
|
6674
|
+
coordinate: z20.array(z20.number().int()).optional(),
|
|
6675
|
+
text: z20.string().optional()
|
|
6292
6676
|
})
|
|
6293
6677
|
)
|
|
6294
6678
|
);
|
|
6295
|
-
var computer_20241022 =
|
|
6679
|
+
var computer_20241022 = createProviderDefinedToolFactory5({
|
|
6296
6680
|
id: "anthropic.computer_20241022",
|
|
6297
6681
|
inputSchema: computer_20241022InputSchema
|
|
6298
6682
|
});
|
|
6299
6683
|
|
|
6300
6684
|
// src/tool/computer_20250124.ts
|
|
6301
6685
|
import {
|
|
6302
|
-
createProviderDefinedToolFactory as
|
|
6303
|
-
lazySchema as
|
|
6304
|
-
zodSchema as
|
|
6686
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
|
|
6687
|
+
lazySchema as lazySchema20,
|
|
6688
|
+
zodSchema as zodSchema20
|
|
6305
6689
|
} from "@ai-sdk/provider-utils";
|
|
6306
|
-
import { z as
|
|
6307
|
-
var computer_20250124InputSchema =
|
|
6308
|
-
() =>
|
|
6309
|
-
|
|
6310
|
-
action:
|
|
6690
|
+
import { z as z21 } from "zod/v4";
|
|
6691
|
+
var computer_20250124InputSchema = lazySchema20(
|
|
6692
|
+
() => zodSchema20(
|
|
6693
|
+
z21.object({
|
|
6694
|
+
action: z21.enum([
|
|
6311
6695
|
"key",
|
|
6312
6696
|
"hold_key",
|
|
6313
6697
|
"type",
|
|
@@ -6325,31 +6709,31 @@ var computer_20250124InputSchema = lazySchema19(
|
|
|
6325
6709
|
"wait",
|
|
6326
6710
|
"screenshot"
|
|
6327
6711
|
]),
|
|
6328
|
-
coordinate:
|
|
6329
|
-
duration:
|
|
6330
|
-
scroll_amount:
|
|
6331
|
-
scroll_direction:
|
|
6332
|
-
start_coordinate:
|
|
6333
|
-
text:
|
|
6712
|
+
coordinate: z21.tuple([z21.number().int(), z21.number().int()]).optional(),
|
|
6713
|
+
duration: z21.number().optional(),
|
|
6714
|
+
scroll_amount: z21.number().optional(),
|
|
6715
|
+
scroll_direction: z21.enum(["up", "down", "left", "right"]).optional(),
|
|
6716
|
+
start_coordinate: z21.tuple([z21.number().int(), z21.number().int()]).optional(),
|
|
6717
|
+
text: z21.string().optional()
|
|
6334
6718
|
})
|
|
6335
6719
|
)
|
|
6336
6720
|
);
|
|
6337
|
-
var computer_20250124 =
|
|
6721
|
+
var computer_20250124 = createProviderDefinedToolFactory6({
|
|
6338
6722
|
id: "anthropic.computer_20250124",
|
|
6339
6723
|
inputSchema: computer_20250124InputSchema
|
|
6340
6724
|
});
|
|
6341
6725
|
|
|
6342
6726
|
// src/tool/computer_20251124.ts
|
|
6343
6727
|
import {
|
|
6344
|
-
createProviderDefinedToolFactory as
|
|
6345
|
-
lazySchema as
|
|
6346
|
-
zodSchema as
|
|
6728
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
|
|
6729
|
+
lazySchema as lazySchema21,
|
|
6730
|
+
zodSchema as zodSchema21
|
|
6347
6731
|
} from "@ai-sdk/provider-utils";
|
|
6348
|
-
import { z as
|
|
6349
|
-
var computer_20251124InputSchema =
|
|
6350
|
-
() =>
|
|
6351
|
-
|
|
6352
|
-
action:
|
|
6732
|
+
import { z as z22 } from "zod/v4";
|
|
6733
|
+
var computer_20251124InputSchema = lazySchema21(
|
|
6734
|
+
() => zodSchema21(
|
|
6735
|
+
z22.object({
|
|
6736
|
+
action: z22.enum([
|
|
6353
6737
|
"key",
|
|
6354
6738
|
"hold_key",
|
|
6355
6739
|
"type",
|
|
@@ -6368,109 +6752,83 @@ var computer_20251124InputSchema = lazySchema20(
|
|
|
6368
6752
|
"screenshot",
|
|
6369
6753
|
"zoom"
|
|
6370
6754
|
]),
|
|
6371
|
-
coordinate:
|
|
6372
|
-
duration:
|
|
6373
|
-
region:
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6755
|
+
coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
|
|
6756
|
+
duration: z22.number().optional(),
|
|
6757
|
+
region: z22.tuple([
|
|
6758
|
+
z22.number().int(),
|
|
6759
|
+
z22.number().int(),
|
|
6760
|
+
z22.number().int(),
|
|
6761
|
+
z22.number().int()
|
|
6378
6762
|
]).optional(),
|
|
6379
|
-
scroll_amount:
|
|
6380
|
-
scroll_direction:
|
|
6381
|
-
start_coordinate:
|
|
6382
|
-
text:
|
|
6763
|
+
scroll_amount: z22.number().optional(),
|
|
6764
|
+
scroll_direction: z22.enum(["up", "down", "left", "right"]).optional(),
|
|
6765
|
+
start_coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
|
|
6766
|
+
text: z22.string().optional()
|
|
6383
6767
|
})
|
|
6384
6768
|
)
|
|
6385
6769
|
);
|
|
6386
|
-
var computer_20251124 =
|
|
6770
|
+
var computer_20251124 = createProviderDefinedToolFactory7({
|
|
6387
6771
|
id: "anthropic.computer_20251124",
|
|
6388
6772
|
inputSchema: computer_20251124InputSchema
|
|
6389
6773
|
});
|
|
6390
6774
|
|
|
6391
6775
|
// src/tool/memory_20250818.ts
|
|
6392
6776
|
import {
|
|
6393
|
-
createProviderDefinedToolFactory as
|
|
6394
|
-
lazySchema as
|
|
6395
|
-
zodSchema as
|
|
6777
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
6778
|
+
lazySchema as lazySchema22,
|
|
6779
|
+
zodSchema as zodSchema22
|
|
6396
6780
|
} from "@ai-sdk/provider-utils";
|
|
6397
|
-
import { z as
|
|
6398
|
-
var memory_20250818InputSchema =
|
|
6399
|
-
() =>
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
command:
|
|
6403
|
-
path:
|
|
6404
|
-
view_range:
|
|
6781
|
+
import { z as z23 } from "zod/v4";
|
|
6782
|
+
var memory_20250818InputSchema = lazySchema22(
|
|
6783
|
+
() => zodSchema22(
|
|
6784
|
+
z23.discriminatedUnion("command", [
|
|
6785
|
+
z23.object({
|
|
6786
|
+
command: z23.literal("view"),
|
|
6787
|
+
path: z23.string(),
|
|
6788
|
+
view_range: z23.tuple([z23.number(), z23.number()]).optional()
|
|
6405
6789
|
}),
|
|
6406
|
-
|
|
6407
|
-
command:
|
|
6408
|
-
path:
|
|
6409
|
-
file_text:
|
|
6790
|
+
z23.object({
|
|
6791
|
+
command: z23.literal("create"),
|
|
6792
|
+
path: z23.string(),
|
|
6793
|
+
file_text: z23.string()
|
|
6410
6794
|
}),
|
|
6411
|
-
|
|
6412
|
-
command:
|
|
6413
|
-
path:
|
|
6414
|
-
old_str:
|
|
6415
|
-
new_str:
|
|
6795
|
+
z23.object({
|
|
6796
|
+
command: z23.literal("str_replace"),
|
|
6797
|
+
path: z23.string(),
|
|
6798
|
+
old_str: z23.string(),
|
|
6799
|
+
new_str: z23.string()
|
|
6416
6800
|
}),
|
|
6417
|
-
|
|
6418
|
-
command:
|
|
6419
|
-
path:
|
|
6420
|
-
insert_line:
|
|
6421
|
-
insert_text:
|
|
6801
|
+
z23.object({
|
|
6802
|
+
command: z23.literal("insert"),
|
|
6803
|
+
path: z23.string(),
|
|
6804
|
+
insert_line: z23.number(),
|
|
6805
|
+
insert_text: z23.string()
|
|
6422
6806
|
}),
|
|
6423
|
-
|
|
6424
|
-
command:
|
|
6425
|
-
path:
|
|
6807
|
+
z23.object({
|
|
6808
|
+
command: z23.literal("delete"),
|
|
6809
|
+
path: z23.string()
|
|
6426
6810
|
}),
|
|
6427
|
-
|
|
6428
|
-
command:
|
|
6429
|
-
old_path:
|
|
6430
|
-
new_path:
|
|
6811
|
+
z23.object({
|
|
6812
|
+
command: z23.literal("rename"),
|
|
6813
|
+
old_path: z23.string(),
|
|
6814
|
+
new_path: z23.string()
|
|
6431
6815
|
})
|
|
6432
6816
|
])
|
|
6433
6817
|
)
|
|
6434
6818
|
);
|
|
6435
|
-
var memory_20250818 =
|
|
6819
|
+
var memory_20250818 = createProviderDefinedToolFactory8({
|
|
6436
6820
|
id: "anthropic.memory_20250818",
|
|
6437
6821
|
inputSchema: memory_20250818InputSchema
|
|
6438
6822
|
});
|
|
6439
6823
|
|
|
6440
6824
|
// src/tool/text-editor_20241022.ts
|
|
6441
|
-
import {
|
|
6442
|
-
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
6443
|
-
lazySchema as lazySchema22,
|
|
6444
|
-
zodSchema as zodSchema22
|
|
6445
|
-
} from "@ai-sdk/provider-utils";
|
|
6446
|
-
import { z as z23 } from "zod/v4";
|
|
6447
|
-
var textEditor_20241022InputSchema = lazySchema22(
|
|
6448
|
-
() => zodSchema22(
|
|
6449
|
-
z23.object({
|
|
6450
|
-
command: z23.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
6451
|
-
path: z23.string(),
|
|
6452
|
-
file_text: z23.string().optional(),
|
|
6453
|
-
insert_line: z23.number().int().optional(),
|
|
6454
|
-
new_str: z23.string().optional(),
|
|
6455
|
-
insert_text: z23.string().optional(),
|
|
6456
|
-
old_str: z23.string().optional(),
|
|
6457
|
-
view_range: z23.array(z23.number().int()).optional()
|
|
6458
|
-
})
|
|
6459
|
-
)
|
|
6460
|
-
);
|
|
6461
|
-
var textEditor_20241022 = createProviderDefinedToolFactory8({
|
|
6462
|
-
id: "anthropic.text_editor_20241022",
|
|
6463
|
-
inputSchema: textEditor_20241022InputSchema
|
|
6464
|
-
});
|
|
6465
|
-
|
|
6466
|
-
// src/tool/text-editor_20250124.ts
|
|
6467
6825
|
import {
|
|
6468
6826
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
|
|
6469
6827
|
lazySchema as lazySchema23,
|
|
6470
6828
|
zodSchema as zodSchema23
|
|
6471
6829
|
} from "@ai-sdk/provider-utils";
|
|
6472
6830
|
import { z as z24 } from "zod/v4";
|
|
6473
|
-
var
|
|
6831
|
+
var textEditor_20241022InputSchema = lazySchema23(
|
|
6474
6832
|
() => zodSchema23(
|
|
6475
6833
|
z24.object({
|
|
6476
6834
|
command: z24.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -6484,22 +6842,22 @@ var textEditor_20250124InputSchema = lazySchema23(
|
|
|
6484
6842
|
})
|
|
6485
6843
|
)
|
|
6486
6844
|
);
|
|
6487
|
-
var
|
|
6488
|
-
id: "anthropic.
|
|
6489
|
-
inputSchema:
|
|
6845
|
+
var textEditor_20241022 = createProviderDefinedToolFactory9({
|
|
6846
|
+
id: "anthropic.text_editor_20241022",
|
|
6847
|
+
inputSchema: textEditor_20241022InputSchema
|
|
6490
6848
|
});
|
|
6491
6849
|
|
|
6492
|
-
// src/tool/text-
|
|
6850
|
+
// src/tool/text-editor_20250124.ts
|
|
6493
6851
|
import {
|
|
6494
6852
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory10,
|
|
6495
6853
|
lazySchema as lazySchema24,
|
|
6496
6854
|
zodSchema as zodSchema24
|
|
6497
6855
|
} from "@ai-sdk/provider-utils";
|
|
6498
6856
|
import { z as z25 } from "zod/v4";
|
|
6499
|
-
var
|
|
6857
|
+
var textEditor_20250124InputSchema = lazySchema24(
|
|
6500
6858
|
() => zodSchema24(
|
|
6501
6859
|
z25.object({
|
|
6502
|
-
command: z25.enum(["view", "create", "str_replace", "insert"]),
|
|
6860
|
+
command: z25.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
6503
6861
|
path: z25.string(),
|
|
6504
6862
|
file_text: z25.string().optional(),
|
|
6505
6863
|
insert_line: z25.number().int().optional(),
|
|
@@ -6510,40 +6868,66 @@ var textEditor_20250429InputSchema = lazySchema24(
|
|
|
6510
6868
|
})
|
|
6511
6869
|
)
|
|
6512
6870
|
);
|
|
6513
|
-
var
|
|
6514
|
-
id: "anthropic.
|
|
6515
|
-
inputSchema:
|
|
6871
|
+
var textEditor_20250124 = createProviderDefinedToolFactory10({
|
|
6872
|
+
id: "anthropic.text_editor_20250124",
|
|
6873
|
+
inputSchema: textEditor_20250124InputSchema
|
|
6516
6874
|
});
|
|
6517
6875
|
|
|
6518
|
-
// src/tool/
|
|
6876
|
+
// src/tool/text-editor_20250429.ts
|
|
6519
6877
|
import {
|
|
6520
|
-
|
|
6878
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory11,
|
|
6521
6879
|
lazySchema as lazySchema25,
|
|
6522
6880
|
zodSchema as zodSchema25
|
|
6523
6881
|
} from "@ai-sdk/provider-utils";
|
|
6524
6882
|
import { z as z26 } from "zod/v4";
|
|
6525
|
-
var
|
|
6883
|
+
var textEditor_20250429InputSchema = lazySchema25(
|
|
6526
6884
|
() => zodSchema25(
|
|
6527
|
-
z26.
|
|
6528
|
-
z26.
|
|
6529
|
-
|
|
6530
|
-
|
|
6885
|
+
z26.object({
|
|
6886
|
+
command: z26.enum(["view", "create", "str_replace", "insert"]),
|
|
6887
|
+
path: z26.string(),
|
|
6888
|
+
file_text: z26.string().optional(),
|
|
6889
|
+
insert_line: z26.number().int().optional(),
|
|
6890
|
+
new_str: z26.string().optional(),
|
|
6891
|
+
insert_text: z26.string().optional(),
|
|
6892
|
+
old_str: z26.string().optional(),
|
|
6893
|
+
view_range: z26.array(z26.number().int()).optional()
|
|
6894
|
+
})
|
|
6895
|
+
)
|
|
6896
|
+
);
|
|
6897
|
+
var textEditor_20250429 = createProviderDefinedToolFactory11({
|
|
6898
|
+
id: "anthropic.text_editor_20250429",
|
|
6899
|
+
inputSchema: textEditor_20250429InputSchema
|
|
6900
|
+
});
|
|
6901
|
+
|
|
6902
|
+
// src/tool/tool-search-bm25_20251119.ts
|
|
6903
|
+
import {
|
|
6904
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory12,
|
|
6905
|
+
lazySchema as lazySchema26,
|
|
6906
|
+
zodSchema as zodSchema26
|
|
6907
|
+
} from "@ai-sdk/provider-utils";
|
|
6908
|
+
import { z as z27 } from "zod/v4";
|
|
6909
|
+
var toolSearchBm25_20251119OutputSchema = lazySchema26(
|
|
6910
|
+
() => zodSchema26(
|
|
6911
|
+
z27.array(
|
|
6912
|
+
z27.object({
|
|
6913
|
+
type: z27.literal("tool_reference"),
|
|
6914
|
+
toolName: z27.string()
|
|
6531
6915
|
})
|
|
6532
6916
|
)
|
|
6533
6917
|
)
|
|
6534
6918
|
);
|
|
6535
|
-
var toolSearchBm25_20251119InputSchema =
|
|
6536
|
-
() =>
|
|
6537
|
-
|
|
6919
|
+
var toolSearchBm25_20251119InputSchema = lazySchema26(
|
|
6920
|
+
() => zodSchema26(
|
|
6921
|
+
z27.object({
|
|
6538
6922
|
/**
|
|
6539
6923
|
* A natural language query to search for tools.
|
|
6540
6924
|
* Claude will use BM25 text search to find relevant tools.
|
|
6541
6925
|
*/
|
|
6542
|
-
query:
|
|
6926
|
+
query: z27.string(),
|
|
6543
6927
|
/**
|
|
6544
6928
|
* Maximum number of tools to return. Optional.
|
|
6545
6929
|
*/
|
|
6546
|
-
limit:
|
|
6930
|
+
limit: z27.number().optional()
|
|
6547
6931
|
})
|
|
6548
6932
|
)
|
|
6549
6933
|
);
|
|
@@ -6675,6 +7059,29 @@ var anthropicTools = {
|
|
|
6675
7059
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
6676
7060
|
*/
|
|
6677
7061
|
computer_20251124,
|
|
7062
|
+
/**
|
|
7063
|
+
* The computer toolset lets Claude control a computer through screenshots,
|
|
7064
|
+
* mouse, and keyboard. It replaces the versioned computer tools
|
|
7065
|
+
* (`computer_20251124` and earlier) on newer models.
|
|
7066
|
+
*
|
|
7067
|
+
* The API returns each computer action as its own `tool_use` block with
|
|
7068
|
+
* `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
|
|
7069
|
+
* and exposes the member name as `action`, so `execute` receives the same
|
|
7070
|
+
* input shape as the older computer tools. Claude may return several actions
|
|
7071
|
+
* in one turn.
|
|
7072
|
+
*
|
|
7073
|
+
* Coordinates are always in the pixel space of the screenshots you return;
|
|
7074
|
+
* there are no display size parameters. Zoom is enabled by default.
|
|
7075
|
+
*
|
|
7076
|
+
* Does not require a beta header.
|
|
7077
|
+
*
|
|
7078
|
+
* Supported models: Claude Opus 5.5 (required; older computer tool types
|
|
7079
|
+
* are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
|
|
7080
|
+
*
|
|
7081
|
+
* @param configs - Per-member settings keyed by member name, e.g.
|
|
7082
|
+
* `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
|
|
7083
|
+
*/
|
|
7084
|
+
computerToolset_20260801,
|
|
6678
7085
|
/**
|
|
6679
7086
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
6680
7087
|
* Claude can create, read, update, and delete files that persist between sessions,
|
|
@@ -6823,40 +7230,40 @@ import {
|
|
|
6823
7230
|
} from "@ai-sdk/provider-utils";
|
|
6824
7231
|
|
|
6825
7232
|
// src/skills/anthropic-skills-api.ts
|
|
6826
|
-
import { lazySchema as
|
|
6827
|
-
import { z as
|
|
6828
|
-
var anthropicSkillResponseSchema =
|
|
6829
|
-
() =>
|
|
6830
|
-
|
|
6831
|
-
id:
|
|
6832
|
-
display_title:
|
|
6833
|
-
name:
|
|
6834
|
-
description:
|
|
6835
|
-
latest_version:
|
|
6836
|
-
source:
|
|
6837
|
-
created_at:
|
|
6838
|
-
updated_at:
|
|
7233
|
+
import { lazySchema as lazySchema27, zodSchema as zodSchema27 } from "@ai-sdk/provider-utils";
|
|
7234
|
+
import { z as z28 } from "zod/v4";
|
|
7235
|
+
var anthropicSkillResponseSchema = lazySchema27(
|
|
7236
|
+
() => zodSchema27(
|
|
7237
|
+
z28.object({
|
|
7238
|
+
id: z28.string(),
|
|
7239
|
+
display_title: z28.string().nullish(),
|
|
7240
|
+
name: z28.string().nullish(),
|
|
7241
|
+
description: z28.string().nullish(),
|
|
7242
|
+
latest_version: z28.string().nullish(),
|
|
7243
|
+
source: z28.string(),
|
|
7244
|
+
created_at: z28.string(),
|
|
7245
|
+
updated_at: z28.string()
|
|
6839
7246
|
})
|
|
6840
7247
|
)
|
|
6841
7248
|
);
|
|
6842
|
-
var anthropicSkillVersionListResponseSchema =
|
|
6843
|
-
() =>
|
|
6844
|
-
|
|
6845
|
-
data:
|
|
6846
|
-
|
|
6847
|
-
version:
|
|
7249
|
+
var anthropicSkillVersionListResponseSchema = lazySchema27(
|
|
7250
|
+
() => zodSchema27(
|
|
7251
|
+
z28.object({
|
|
7252
|
+
data: z28.array(
|
|
7253
|
+
z28.object({
|
|
7254
|
+
version: z28.string()
|
|
6848
7255
|
})
|
|
6849
7256
|
)
|
|
6850
7257
|
})
|
|
6851
7258
|
)
|
|
6852
7259
|
);
|
|
6853
|
-
var anthropicSkillVersionResponseSchema =
|
|
6854
|
-
() =>
|
|
6855
|
-
|
|
6856
|
-
type:
|
|
6857
|
-
skill_id:
|
|
6858
|
-
name:
|
|
6859
|
-
description:
|
|
7260
|
+
var anthropicSkillVersionResponseSchema = lazySchema27(
|
|
7261
|
+
() => zodSchema27(
|
|
7262
|
+
z28.object({
|
|
7263
|
+
type: z28.string(),
|
|
7264
|
+
skill_id: z28.string(),
|
|
7265
|
+
name: z28.string().nullish(),
|
|
7266
|
+
description: z28.string().nullish()
|
|
6860
7267
|
})
|
|
6861
7268
|
)
|
|
6862
7269
|
);
|