@ai-sdk/anthropic 4.0.58 → 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 +18 -0
- package/dist/index.d.ts +77 -2
- package/dist/index.js +1005 -556
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +99 -2
- package/dist/internal/index.js +955 -507
- package/dist/internal/index.js.map +1 -1
- package/docs/05-anthropic.mdx +176 -14
- package/package.json +1 -1
- package/src/anthropic-api.ts +46 -0
- package/src/anthropic-batch.ts +3 -0
- package/src/anthropic-language-model-options.ts +32 -3
- package/src/anthropic-language-model.ts +315 -5
- package/src/anthropic-message-metadata.ts +14 -0
- 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
|
@@ -156,6 +156,20 @@ var anthropicStopDetailsSchema = z3.object({
|
|
|
156
156
|
explanation: z3.string().nullish(),
|
|
157
157
|
recommended_model: z3.string().nullish()
|
|
158
158
|
});
|
|
159
|
+
var anthropicSafeguardResultSchema = z3.object({
|
|
160
|
+
type: z3.string(),
|
|
161
|
+
status: z3.object({
|
|
162
|
+
type: z3.string(),
|
|
163
|
+
tool_uses: z3.record(
|
|
164
|
+
z3.string(),
|
|
165
|
+
z3.object({
|
|
166
|
+
type: z3.string(),
|
|
167
|
+
outcome: z3.string().nullish(),
|
|
168
|
+
explanation: z3.string().nullish()
|
|
169
|
+
})
|
|
170
|
+
).nullish()
|
|
171
|
+
})
|
|
172
|
+
});
|
|
159
173
|
var anthropicToolCallCallerSchema = z3.union([
|
|
160
174
|
z3.object({
|
|
161
175
|
type: z3.literal("code_execution_20250825"),
|
|
@@ -266,7 +280,9 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
266
280
|
name: z3.string(),
|
|
267
281
|
input: z3.unknown(),
|
|
268
282
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
269
|
-
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()
|
|
270
286
|
}),
|
|
271
287
|
z3.object({
|
|
272
288
|
type: z3.literal("server_tool_use"),
|
|
@@ -489,6 +505,7 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
489
505
|
stop_sequence: z3.string().nullish(),
|
|
490
506
|
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
491
507
|
input_transformations: z3.array(anthropicInputTransformationSchema).nullish(),
|
|
508
|
+
safeguard_results: z3.array(anthropicSafeguardResultSchema).nullish(),
|
|
492
509
|
usage: z3.looseObject({
|
|
493
510
|
input_tokens: z3.number(),
|
|
494
511
|
output_tokens: z3.number(),
|
|
@@ -568,7 +585,8 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
568
585
|
id: z3.string(),
|
|
569
586
|
name: z3.string(),
|
|
570
587
|
input: z3.unknown(),
|
|
571
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
588
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
589
|
+
toolset_name: z3.string().nullish()
|
|
572
590
|
})
|
|
573
591
|
])
|
|
574
592
|
).nullish(),
|
|
@@ -599,7 +617,9 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
599
617
|
// Programmatic tool calling: input may be present directly for deferred tool calls
|
|
600
618
|
input: z3.record(z3.string(), z3.unknown()).optional(),
|
|
601
619
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
602
|
-
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()
|
|
603
623
|
}),
|
|
604
624
|
z3.object({
|
|
605
625
|
type: z3.literal("redacted_thinking"),
|
|
@@ -872,6 +892,7 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
872
892
|
stop_reason: z3.string().nullish(),
|
|
873
893
|
stop_sequence: z3.string().nullish(),
|
|
874
894
|
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
895
|
+
safeguard_results: z3.array(anthropicSafeguardResultSchema).nullish(),
|
|
875
896
|
container: z3.object({
|
|
876
897
|
expires_at: z3.string(),
|
|
877
898
|
id: z3.string(),
|
|
@@ -991,8 +1012,8 @@ var anthropicSystemMessageProviderOptions = z4.object({
|
|
|
991
1012
|
clearAt: z4.literal("next_user_message").optional(),
|
|
992
1013
|
/**
|
|
993
1014
|
* Sets the model effort for the turn that follows this mid-conversation
|
|
994
|
-
* system message. The required `mid-conversation-
|
|
995
|
-
* is added automatically.
|
|
1015
|
+
* system message. The required `mid-conversation-output-config-2026-07-01`
|
|
1016
|
+
* beta is added automatically.
|
|
996
1017
|
*/
|
|
997
1018
|
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
998
1019
|
/**
|
|
@@ -1042,6 +1063,11 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1042
1063
|
*
|
|
1043
1064
|
* When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
|
|
1044
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.
|
|
1045
1071
|
*/
|
|
1046
1072
|
thinking: z4.union([
|
|
1047
1073
|
z4.discriminatedUnion("type", [
|
|
@@ -1154,7 +1180,11 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1154
1180
|
*/
|
|
1155
1181
|
toolStreaming: z4.boolean().optional(),
|
|
1156
1182
|
/**
|
|
1157
|
-
*
|
|
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`.
|
|
1158
1188
|
*/
|
|
1159
1189
|
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
1160
1190
|
/**
|
|
@@ -1220,6 +1250,22 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1220
1250
|
* Allow a provider to receive the full `betas` set if it needs it.
|
|
1221
1251
|
*/
|
|
1222
1252
|
anthropicBeta: z4.array(z4.string()).optional(),
|
|
1253
|
+
/**
|
|
1254
|
+
* Server-side safeguards to run as part of the request.
|
|
1255
|
+
*
|
|
1256
|
+
* `dangerous_tool_use` asks the API to classify every `tool_use` block in
|
|
1257
|
+
* the response for dangerous actions (the check Claude Code's auto mode
|
|
1258
|
+
* relies on). The per-call verdicts are returned in
|
|
1259
|
+
* `providerMetadata.anthropic.safeguardResults`, keyed by tool call id.
|
|
1260
|
+
* `classifierContext` is passed through to the API as `classifier_context`.
|
|
1261
|
+
* The `dangerous-tool-use-2026-09-03` beta is added automatically.
|
|
1262
|
+
*/
|
|
1263
|
+
safeguards: z4.array(
|
|
1264
|
+
z4.object({
|
|
1265
|
+
type: z4.literal("dangerous_tool_use"),
|
|
1266
|
+
classifierContext: z4.record(z4.string(), z4.unknown()).optional()
|
|
1267
|
+
})
|
|
1268
|
+
).optional(),
|
|
1223
1269
|
contextManagement: z4.object({
|
|
1224
1270
|
edits: z4.array(
|
|
1225
1271
|
z4.discriminatedUnion("type", [
|
|
@@ -1370,104 +1416,114 @@ var advisor_20260301 = (args) => {
|
|
|
1370
1416
|
return factory(args);
|
|
1371
1417
|
};
|
|
1372
1418
|
|
|
1373
|
-
// src/tool/
|
|
1419
|
+
// src/tool/computer-toolset_20260801.ts
|
|
1374
1420
|
import {
|
|
1375
1421
|
createProviderDefinedToolFactory,
|
|
1376
1422
|
lazySchema as lazySchema5,
|
|
1377
1423
|
zodSchema as zodSchema5
|
|
1378
1424
|
} from "@ai-sdk/provider-utils";
|
|
1379
1425
|
import { z as z6 } from "zod/v4";
|
|
1380
|
-
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(
|
|
1381
1446
|
() => zodSchema5(
|
|
1382
1447
|
z6.object({
|
|
1383
|
-
|
|
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()
|
|
1384
1462
|
})
|
|
1385
1463
|
)
|
|
1386
1464
|
);
|
|
1387
|
-
var
|
|
1465
|
+
var computerToolset_20260801ArgsSchema = lazySchema5(
|
|
1388
1466
|
() => zodSchema5(
|
|
1389
1467
|
z6.object({
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
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()
|
|
1398
1475
|
})
|
|
1399
1476
|
)
|
|
1400
1477
|
);
|
|
1401
|
-
var
|
|
1402
|
-
id: "anthropic.
|
|
1403
|
-
inputSchema:
|
|
1478
|
+
var computerToolset_20260801 = createProviderDefinedToolFactory({
|
|
1479
|
+
id: "anthropic.computer_toolset_20260801",
|
|
1480
|
+
inputSchema: computerToolset_20260801InputSchema
|
|
1404
1481
|
});
|
|
1405
|
-
var textEditor_20250728 = (args = {}) => {
|
|
1406
|
-
return factory2(args);
|
|
1407
|
-
};
|
|
1408
1482
|
|
|
1409
|
-
// src/tool/
|
|
1483
|
+
// src/tool/text-editor_20250728.ts
|
|
1410
1484
|
import {
|
|
1411
|
-
|
|
1485
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
|
|
1412
1486
|
lazySchema as lazySchema6,
|
|
1413
1487
|
zodSchema as zodSchema6
|
|
1414
1488
|
} from "@ai-sdk/provider-utils";
|
|
1415
1489
|
import { z as z7 } from "zod/v4";
|
|
1416
|
-
var
|
|
1490
|
+
var textEditor_20250728ArgsSchema = lazySchema6(
|
|
1417
1491
|
() => zodSchema6(
|
|
1418
1492
|
z7.object({
|
|
1419
|
-
|
|
1420
|
-
allowedDomains: z7.array(z7.string()).optional(),
|
|
1421
|
-
blockedDomains: z7.array(z7.string()).optional(),
|
|
1422
|
-
userLocation: z7.object({
|
|
1423
|
-
type: z7.literal("approximate"),
|
|
1424
|
-
city: z7.string().optional(),
|
|
1425
|
-
region: z7.string().optional(),
|
|
1426
|
-
country: z7.string().optional(),
|
|
1427
|
-
timezone: z7.string().optional()
|
|
1428
|
-
}).optional(),
|
|
1429
|
-
responseInclusion: z7.enum(["full", "excluded"]).optional()
|
|
1493
|
+
maxCharacters: z7.number().optional()
|
|
1430
1494
|
})
|
|
1431
1495
|
)
|
|
1432
1496
|
);
|
|
1433
|
-
var
|
|
1434
|
-
() => zodSchema6(
|
|
1435
|
-
z7.array(
|
|
1436
|
-
z7.object({
|
|
1437
|
-
url: z7.string(),
|
|
1438
|
-
title: z7.string().nullable(),
|
|
1439
|
-
pageAge: z7.string().nullable(),
|
|
1440
|
-
encryptedContent: z7.string(),
|
|
1441
|
-
type: z7.literal("web_search_result")
|
|
1442
|
-
})
|
|
1443
|
-
)
|
|
1444
|
-
)
|
|
1445
|
-
);
|
|
1446
|
-
var webSearch_20260318InputSchema = lazySchema6(
|
|
1497
|
+
var textEditor_20250728InputSchema = lazySchema6(
|
|
1447
1498
|
() => zodSchema6(
|
|
1448
1499
|
z7.object({
|
|
1449
|
-
|
|
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()
|
|
1450
1508
|
})
|
|
1451
1509
|
)
|
|
1452
1510
|
);
|
|
1453
|
-
var
|
|
1454
|
-
id: "anthropic.
|
|
1455
|
-
inputSchema:
|
|
1456
|
-
outputSchema: webSearch_20260318OutputSchema,
|
|
1457
|
-
supportsDeferredResults: true
|
|
1511
|
+
var factory2 = createProviderDefinedToolFactory2({
|
|
1512
|
+
id: "anthropic.text_editor_20250728",
|
|
1513
|
+
inputSchema: textEditor_20250728InputSchema
|
|
1458
1514
|
});
|
|
1459
|
-
var
|
|
1460
|
-
return
|
|
1515
|
+
var textEditor_20250728 = (args = {}) => {
|
|
1516
|
+
return factory2(args);
|
|
1461
1517
|
};
|
|
1462
1518
|
|
|
1463
|
-
// src/tool/web-
|
|
1519
|
+
// src/tool/web-search_20260318.ts
|
|
1464
1520
|
import {
|
|
1465
|
-
createProviderExecutedToolFactory as
|
|
1521
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
|
|
1466
1522
|
lazySchema as lazySchema7,
|
|
1467
1523
|
zodSchema as zodSchema7
|
|
1468
1524
|
} from "@ai-sdk/provider-utils";
|
|
1469
1525
|
import { z as z8 } from "zod/v4";
|
|
1470
|
-
var
|
|
1526
|
+
var webSearch_20260318ArgsSchema = lazySchema7(
|
|
1471
1527
|
() => zodSchema7(
|
|
1472
1528
|
z8.object({
|
|
1473
1529
|
maxUses: z8.number().optional(),
|
|
@@ -1479,11 +1535,12 @@ var webSearch_20260209ArgsSchema = lazySchema7(
|
|
|
1479
1535
|
region: z8.string().optional(),
|
|
1480
1536
|
country: z8.string().optional(),
|
|
1481
1537
|
timezone: z8.string().optional()
|
|
1482
|
-
}).optional()
|
|
1538
|
+
}).optional(),
|
|
1539
|
+
responseInclusion: z8.enum(["full", "excluded"]).optional()
|
|
1483
1540
|
})
|
|
1484
1541
|
)
|
|
1485
1542
|
);
|
|
1486
|
-
var
|
|
1543
|
+
var webSearch_20260318OutputSchema = lazySchema7(
|
|
1487
1544
|
() => zodSchema7(
|
|
1488
1545
|
z8.array(
|
|
1489
1546
|
z8.object({
|
|
@@ -1496,31 +1553,31 @@ var webSearch_20260209OutputSchema = lazySchema7(
|
|
|
1496
1553
|
)
|
|
1497
1554
|
)
|
|
1498
1555
|
);
|
|
1499
|
-
var
|
|
1556
|
+
var webSearch_20260318InputSchema = lazySchema7(
|
|
1500
1557
|
() => zodSchema7(
|
|
1501
1558
|
z8.object({
|
|
1502
1559
|
query: z8.string()
|
|
1503
1560
|
})
|
|
1504
1561
|
)
|
|
1505
1562
|
);
|
|
1506
|
-
var
|
|
1507
|
-
id: "anthropic.
|
|
1508
|
-
inputSchema:
|
|
1509
|
-
outputSchema:
|
|
1563
|
+
var factory3 = createProviderExecutedToolFactory2({
|
|
1564
|
+
id: "anthropic.web_search_20260318",
|
|
1565
|
+
inputSchema: webSearch_20260318InputSchema,
|
|
1566
|
+
outputSchema: webSearch_20260318OutputSchema,
|
|
1510
1567
|
supportsDeferredResults: true
|
|
1511
1568
|
});
|
|
1512
|
-
var
|
|
1513
|
-
return
|
|
1569
|
+
var webSearch_20260318 = (args = {}) => {
|
|
1570
|
+
return factory3(args);
|
|
1514
1571
|
};
|
|
1515
1572
|
|
|
1516
|
-
// src/tool/web-
|
|
1573
|
+
// src/tool/web-search_20260209.ts
|
|
1517
1574
|
import {
|
|
1518
|
-
createProviderExecutedToolFactory as
|
|
1575
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
|
|
1519
1576
|
lazySchema as lazySchema8,
|
|
1520
1577
|
zodSchema as zodSchema8
|
|
1521
1578
|
} from "@ai-sdk/provider-utils";
|
|
1522
1579
|
import { z as z9 } from "zod/v4";
|
|
1523
|
-
var
|
|
1580
|
+
var webSearch_20260209ArgsSchema = lazySchema8(
|
|
1524
1581
|
() => zodSchema8(
|
|
1525
1582
|
z9.object({
|
|
1526
1583
|
maxUses: z9.number().optional(),
|
|
@@ -1536,7 +1593,7 @@ var webSearch_20250305ArgsSchema = lazySchema8(
|
|
|
1536
1593
|
})
|
|
1537
1594
|
)
|
|
1538
1595
|
);
|
|
1539
|
-
var
|
|
1596
|
+
var webSearch_20260209OutputSchema = lazySchema8(
|
|
1540
1597
|
() => zodSchema8(
|
|
1541
1598
|
z9.array(
|
|
1542
1599
|
z9.object({
|
|
@@ -1549,105 +1606,97 @@ var webSearch_20250305OutputSchema = lazySchema8(
|
|
|
1549
1606
|
)
|
|
1550
1607
|
)
|
|
1551
1608
|
);
|
|
1552
|
-
var
|
|
1609
|
+
var webSearch_20260209InputSchema = lazySchema8(
|
|
1553
1610
|
() => zodSchema8(
|
|
1554
1611
|
z9.object({
|
|
1555
1612
|
query: z9.string()
|
|
1556
1613
|
})
|
|
1557
1614
|
)
|
|
1558
1615
|
);
|
|
1559
|
-
var
|
|
1560
|
-
id: "anthropic.
|
|
1561
|
-
inputSchema:
|
|
1562
|
-
outputSchema:
|
|
1616
|
+
var factory4 = createProviderExecutedToolFactory3({
|
|
1617
|
+
id: "anthropic.web_search_20260209",
|
|
1618
|
+
inputSchema: webSearch_20260209InputSchema,
|
|
1619
|
+
outputSchema: webSearch_20260209OutputSchema,
|
|
1563
1620
|
supportsDeferredResults: true
|
|
1564
1621
|
});
|
|
1565
|
-
var
|
|
1566
|
-
return
|
|
1622
|
+
var webSearch_20260209 = (args = {}) => {
|
|
1623
|
+
return factory4(args);
|
|
1567
1624
|
};
|
|
1568
1625
|
|
|
1569
|
-
// src/tool/web-
|
|
1626
|
+
// src/tool/web-search_20250305.ts
|
|
1570
1627
|
import {
|
|
1571
|
-
createProviderExecutedToolFactory as
|
|
1628
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
|
|
1572
1629
|
lazySchema as lazySchema9,
|
|
1573
1630
|
zodSchema as zodSchema9
|
|
1574
1631
|
} from "@ai-sdk/provider-utils";
|
|
1575
1632
|
import { z as z10 } from "zod/v4";
|
|
1576
|
-
var
|
|
1633
|
+
var webSearch_20250305ArgsSchema = lazySchema9(
|
|
1577
1634
|
() => zodSchema9(
|
|
1578
1635
|
z10.object({
|
|
1579
1636
|
maxUses: z10.number().optional(),
|
|
1580
1637
|
allowedDomains: z10.array(z10.string()).optional(),
|
|
1581
1638
|
blockedDomains: z10.array(z10.string()).optional(),
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
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()
|
|
1586
1646
|
})
|
|
1587
1647
|
)
|
|
1588
1648
|
);
|
|
1589
|
-
var
|
|
1649
|
+
var webSearch_20250305OutputSchema = lazySchema9(
|
|
1590
1650
|
() => zodSchema9(
|
|
1591
|
-
z10.
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
content: z10.object({
|
|
1595
|
-
type: z10.literal("document"),
|
|
1651
|
+
z10.array(
|
|
1652
|
+
z10.object({
|
|
1653
|
+
url: z10.string(),
|
|
1596
1654
|
title: z10.string().nullable(),
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
data: z10.string()
|
|
1603
|
-
}),
|
|
1604
|
-
z10.object({
|
|
1605
|
-
type: z10.literal("text"),
|
|
1606
|
-
mediaType: z10.literal("text/plain"),
|
|
1607
|
-
data: z10.string()
|
|
1608
|
-
})
|
|
1609
|
-
])
|
|
1610
|
-
}),
|
|
1611
|
-
retrievedAt: z10.string().nullable()
|
|
1612
|
-
})
|
|
1655
|
+
pageAge: z10.string().nullable(),
|
|
1656
|
+
encryptedContent: z10.string(),
|
|
1657
|
+
type: z10.literal("web_search_result")
|
|
1658
|
+
})
|
|
1659
|
+
)
|
|
1613
1660
|
)
|
|
1614
1661
|
);
|
|
1615
|
-
var
|
|
1662
|
+
var webSearch_20250305InputSchema = lazySchema9(
|
|
1616
1663
|
() => zodSchema9(
|
|
1617
1664
|
z10.object({
|
|
1618
|
-
|
|
1665
|
+
query: z10.string()
|
|
1619
1666
|
})
|
|
1620
1667
|
)
|
|
1621
1668
|
);
|
|
1622
|
-
var
|
|
1623
|
-
id: "anthropic.
|
|
1624
|
-
inputSchema:
|
|
1625
|
-
outputSchema:
|
|
1669
|
+
var factory5 = createProviderExecutedToolFactory4({
|
|
1670
|
+
id: "anthropic.web_search_20250305",
|
|
1671
|
+
inputSchema: webSearch_20250305InputSchema,
|
|
1672
|
+
outputSchema: webSearch_20250305OutputSchema,
|
|
1626
1673
|
supportsDeferredResults: true
|
|
1627
1674
|
});
|
|
1628
|
-
var
|
|
1629
|
-
return
|
|
1675
|
+
var webSearch_20250305 = (args = {}) => {
|
|
1676
|
+
return factory5(args);
|
|
1630
1677
|
};
|
|
1631
1678
|
|
|
1632
|
-
// src/tool/web-fetch-
|
|
1679
|
+
// src/tool/web-fetch-20260318.ts
|
|
1633
1680
|
import {
|
|
1634
|
-
createProviderExecutedToolFactory as
|
|
1681
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
1635
1682
|
lazySchema as lazySchema10,
|
|
1636
1683
|
zodSchema as zodSchema10
|
|
1637
1684
|
} from "@ai-sdk/provider-utils";
|
|
1638
1685
|
import { z as z11 } from "zod/v4";
|
|
1639
|
-
var
|
|
1686
|
+
var webFetch_20260318ArgsSchema = lazySchema10(
|
|
1640
1687
|
() => zodSchema10(
|
|
1641
1688
|
z11.object({
|
|
1642
1689
|
maxUses: z11.number().optional(),
|
|
1643
1690
|
allowedDomains: z11.array(z11.string()).optional(),
|
|
1644
1691
|
blockedDomains: z11.array(z11.string()).optional(),
|
|
1645
1692
|
citations: z11.object({ enabled: z11.boolean() }).optional(),
|
|
1646
|
-
maxContentTokens: z11.number().optional()
|
|
1693
|
+
maxContentTokens: z11.number().optional(),
|
|
1694
|
+
useCache: z11.boolean().optional(),
|
|
1695
|
+
responseInclusion: z11.enum(["full", "excluded"]).optional()
|
|
1647
1696
|
})
|
|
1648
1697
|
)
|
|
1649
1698
|
);
|
|
1650
|
-
var
|
|
1699
|
+
var webFetch_20260318OutputSchema = lazySchema10(
|
|
1651
1700
|
() => zodSchema10(
|
|
1652
1701
|
z11.object({
|
|
1653
1702
|
type: z11.literal("web_fetch_result"),
|
|
@@ -1673,31 +1722,31 @@ var webFetch_20260209OutputSchema = lazySchema10(
|
|
|
1673
1722
|
})
|
|
1674
1723
|
)
|
|
1675
1724
|
);
|
|
1676
|
-
var
|
|
1725
|
+
var webFetch_20260318InputSchema = lazySchema10(
|
|
1677
1726
|
() => zodSchema10(
|
|
1678
1727
|
z11.object({
|
|
1679
1728
|
url: z11.string()
|
|
1680
1729
|
})
|
|
1681
1730
|
)
|
|
1682
1731
|
);
|
|
1683
|
-
var
|
|
1684
|
-
id: "anthropic.
|
|
1685
|
-
inputSchema:
|
|
1686
|
-
outputSchema:
|
|
1732
|
+
var factory6 = createProviderExecutedToolFactory5({
|
|
1733
|
+
id: "anthropic.web_fetch_20260318",
|
|
1734
|
+
inputSchema: webFetch_20260318InputSchema,
|
|
1735
|
+
outputSchema: webFetch_20260318OutputSchema,
|
|
1687
1736
|
supportsDeferredResults: true
|
|
1688
1737
|
});
|
|
1689
|
-
var
|
|
1690
|
-
return
|
|
1738
|
+
var webFetch_20260318 = (args = {}) => {
|
|
1739
|
+
return factory6(args);
|
|
1691
1740
|
};
|
|
1692
1741
|
|
|
1693
|
-
// src/tool/web-fetch-
|
|
1742
|
+
// src/tool/web-fetch-20260209.ts
|
|
1694
1743
|
import {
|
|
1695
|
-
createProviderExecutedToolFactory as
|
|
1744
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
|
|
1696
1745
|
lazySchema as lazySchema11,
|
|
1697
1746
|
zodSchema as zodSchema11
|
|
1698
1747
|
} from "@ai-sdk/provider-utils";
|
|
1699
1748
|
import { z as z12 } from "zod/v4";
|
|
1700
|
-
var
|
|
1749
|
+
var webFetch_20260209ArgsSchema = lazySchema11(
|
|
1701
1750
|
() => zodSchema11(
|
|
1702
1751
|
z12.object({
|
|
1703
1752
|
maxUses: z12.number().optional(),
|
|
@@ -1708,7 +1757,7 @@ var webFetch_20250910ArgsSchema = lazySchema11(
|
|
|
1708
1757
|
})
|
|
1709
1758
|
)
|
|
1710
1759
|
);
|
|
1711
|
-
var
|
|
1760
|
+
var webFetch_20260209OutputSchema = lazySchema11(
|
|
1712
1761
|
() => zodSchema11(
|
|
1713
1762
|
z12.object({
|
|
1714
1763
|
type: z12.literal("web_fetch_result"),
|
|
@@ -1734,13 +1783,74 @@ var webFetch_20250910OutputSchema = lazySchema11(
|
|
|
1734
1783
|
})
|
|
1735
1784
|
)
|
|
1736
1785
|
);
|
|
1737
|
-
var
|
|
1786
|
+
var webFetch_20260209InputSchema = lazySchema11(
|
|
1738
1787
|
() => zodSchema11(
|
|
1739
1788
|
z12.object({
|
|
1740
1789
|
url: z12.string()
|
|
1741
1790
|
})
|
|
1742
1791
|
)
|
|
1743
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
|
+
);
|
|
1744
1854
|
var factory8 = createProviderExecutedToolFactory7({
|
|
1745
1855
|
id: "anthropic.web_fetch_20250910",
|
|
1746
1856
|
inputSchema: webFetch_20250910InputSchema,
|
|
@@ -1760,7 +1870,8 @@ async function prepareTools({
|
|
|
1760
1870
|
cacheControlValidator,
|
|
1761
1871
|
supportsStructuredOutput,
|
|
1762
1872
|
supportsStrictTools,
|
|
1763
|
-
defaultEagerInputStreaming = false
|
|
1873
|
+
defaultEagerInputStreaming = false,
|
|
1874
|
+
rejectsForcedToolUse = false
|
|
1764
1875
|
}) {
|
|
1765
1876
|
var _a, _b;
|
|
1766
1877
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
@@ -1863,6 +1974,31 @@ async function prepareTools({
|
|
|
1863
1974
|
});
|
|
1864
1975
|
break;
|
|
1865
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
|
+
}
|
|
1866
2002
|
case "anthropic.computer_20241022": {
|
|
1867
2003
|
betas.add("computer-use-2024-10-22");
|
|
1868
2004
|
anthropicTools2.push({
|
|
@@ -2118,6 +2254,22 @@ async function prepareTools({
|
|
|
2118
2254
|
betas
|
|
2119
2255
|
};
|
|
2120
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
|
+
}
|
|
2121
2273
|
return {
|
|
2122
2274
|
tools: anthropicTools2,
|
|
2123
2275
|
toolChoice: {
|
|
@@ -2130,6 +2282,24 @@ async function prepareTools({
|
|
|
2130
2282
|
case "none":
|
|
2131
2283
|
return { tools: void 0, toolChoice: void 0, toolWarnings, betas };
|
|
2132
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
|
+
}
|
|
2133
2303
|
return {
|
|
2134
2304
|
tools: anthropicTools2,
|
|
2135
2305
|
toolChoice: {
|
|
@@ -2220,30 +2390,30 @@ import {
|
|
|
2220
2390
|
// src/tool/code-execution_20250522.ts
|
|
2221
2391
|
import {
|
|
2222
2392
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory8,
|
|
2223
|
-
lazySchema as
|
|
2224
|
-
zodSchema as
|
|
2393
|
+
lazySchema as lazySchema13,
|
|
2394
|
+
zodSchema as zodSchema13
|
|
2225
2395
|
} from "@ai-sdk/provider-utils";
|
|
2226
|
-
import { z as
|
|
2227
|
-
var codeExecution_20250522OutputSchema =
|
|
2228
|
-
() =>
|
|
2229
|
-
|
|
2230
|
-
type:
|
|
2231
|
-
stdout:
|
|
2232
|
-
stderr:
|
|
2233
|
-
return_code:
|
|
2234
|
-
content:
|
|
2235
|
-
|
|
2236
|
-
type:
|
|
2237
|
-
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()
|
|
2238
2408
|
})
|
|
2239
2409
|
).optional().default([])
|
|
2240
2410
|
})
|
|
2241
2411
|
)
|
|
2242
2412
|
);
|
|
2243
|
-
var codeExecution_20250522InputSchema =
|
|
2244
|
-
() =>
|
|
2245
|
-
|
|
2246
|
-
code:
|
|
2413
|
+
var codeExecution_20250522InputSchema = lazySchema13(
|
|
2414
|
+
() => zodSchema13(
|
|
2415
|
+
z14.object({
|
|
2416
|
+
code: z14.string()
|
|
2247
2417
|
})
|
|
2248
2418
|
)
|
|
2249
2419
|
);
|
|
@@ -2260,143 +2430,11 @@ var codeExecution_20250522 = (args = {}) => {
|
|
|
2260
2430
|
import {
|
|
2261
2431
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory9,
|
|
2262
2432
|
experimental_toolCaller,
|
|
2263
|
-
lazySchema as lazySchema13,
|
|
2264
|
-
zodSchema as zodSchema13
|
|
2265
|
-
} from "@ai-sdk/provider-utils";
|
|
2266
|
-
import { z as z14 } from "zod/v4";
|
|
2267
|
-
var codeExecution_20250825OutputSchema = lazySchema13(
|
|
2268
|
-
() => zodSchema13(
|
|
2269
|
-
z14.discriminatedUnion("type", [
|
|
2270
|
-
z14.object({
|
|
2271
|
-
type: z14.literal("code_execution_result"),
|
|
2272
|
-
stdout: z14.string(),
|
|
2273
|
-
stderr: z14.string(),
|
|
2274
|
-
return_code: z14.number(),
|
|
2275
|
-
content: z14.array(
|
|
2276
|
-
z14.object({
|
|
2277
|
-
type: z14.literal("code_execution_output"),
|
|
2278
|
-
file_id: z14.string()
|
|
2279
|
-
})
|
|
2280
|
-
).optional().default([])
|
|
2281
|
-
}),
|
|
2282
|
-
z14.object({
|
|
2283
|
-
type: z14.literal("bash_code_execution_result"),
|
|
2284
|
-
content: z14.array(
|
|
2285
|
-
z14.object({
|
|
2286
|
-
type: z14.literal("bash_code_execution_output"),
|
|
2287
|
-
file_id: z14.string()
|
|
2288
|
-
})
|
|
2289
|
-
),
|
|
2290
|
-
stdout: z14.string(),
|
|
2291
|
-
stderr: z14.string(),
|
|
2292
|
-
return_code: z14.number()
|
|
2293
|
-
}),
|
|
2294
|
-
z14.object({
|
|
2295
|
-
type: z14.literal("bash_code_execution_tool_result_error"),
|
|
2296
|
-
error_code: z14.string()
|
|
2297
|
-
}),
|
|
2298
|
-
z14.object({
|
|
2299
|
-
type: z14.literal("text_editor_code_execution_tool_result_error"),
|
|
2300
|
-
error_code: z14.string()
|
|
2301
|
-
}),
|
|
2302
|
-
z14.object({
|
|
2303
|
-
type: z14.literal("text_editor_code_execution_view_result"),
|
|
2304
|
-
content: z14.string(),
|
|
2305
|
-
file_type: z14.string(),
|
|
2306
|
-
num_lines: z14.number().nullable(),
|
|
2307
|
-
start_line: z14.number().nullable(),
|
|
2308
|
-
total_lines: z14.number().nullable()
|
|
2309
|
-
}),
|
|
2310
|
-
z14.object({
|
|
2311
|
-
type: z14.literal("text_editor_code_execution_create_result"),
|
|
2312
|
-
is_file_update: z14.boolean()
|
|
2313
|
-
}),
|
|
2314
|
-
z14.object({
|
|
2315
|
-
type: z14.literal("text_editor_code_execution_str_replace_result"),
|
|
2316
|
-
lines: z14.array(z14.string()).nullable(),
|
|
2317
|
-
new_lines: z14.number().nullable(),
|
|
2318
|
-
new_start: z14.number().nullable(),
|
|
2319
|
-
old_lines: z14.number().nullable(),
|
|
2320
|
-
old_start: z14.number().nullable()
|
|
2321
|
-
})
|
|
2322
|
-
])
|
|
2323
|
-
)
|
|
2324
|
-
);
|
|
2325
|
-
var codeExecution_20250825InputSchema = lazySchema13(
|
|
2326
|
-
() => zodSchema13(
|
|
2327
|
-
z14.discriminatedUnion("type", [
|
|
2328
|
-
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2329
|
-
z14.object({
|
|
2330
|
-
type: z14.literal("programmatic-tool-call"),
|
|
2331
|
-
code: z14.string()
|
|
2332
|
-
}),
|
|
2333
|
-
z14.object({
|
|
2334
|
-
type: z14.literal("bash_code_execution"),
|
|
2335
|
-
command: z14.string()
|
|
2336
|
-
}),
|
|
2337
|
-
z14.discriminatedUnion("command", [
|
|
2338
|
-
z14.object({
|
|
2339
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2340
|
-
command: z14.literal("view"),
|
|
2341
|
-
path: z14.string()
|
|
2342
|
-
}),
|
|
2343
|
-
z14.object({
|
|
2344
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2345
|
-
command: z14.literal("create"),
|
|
2346
|
-
path: z14.string(),
|
|
2347
|
-
file_text: z14.string().nullish()
|
|
2348
|
-
}),
|
|
2349
|
-
z14.object({
|
|
2350
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2351
|
-
command: z14.literal("str_replace"),
|
|
2352
|
-
path: z14.string(),
|
|
2353
|
-
old_str: z14.string(),
|
|
2354
|
-
new_str: z14.string()
|
|
2355
|
-
})
|
|
2356
|
-
])
|
|
2357
|
-
])
|
|
2358
|
-
)
|
|
2359
|
-
);
|
|
2360
|
-
var factory10 = createProviderExecutedToolFactory9({
|
|
2361
|
-
id: "anthropic.code_execution_20250825",
|
|
2362
|
-
inputSchema: codeExecution_20250825InputSchema,
|
|
2363
|
-
outputSchema: codeExecution_20250825OutputSchema,
|
|
2364
|
-
// Programmatic tool calling: tool results may be deferred to a later turn
|
|
2365
|
-
// when code execution triggers a client-executed tool that needs to be
|
|
2366
|
-
// resolved before the code execution result can be returned.
|
|
2367
|
-
supportsDeferredResults: true
|
|
2368
|
-
});
|
|
2369
|
-
var codeExecution_20250825 = (args = {}) => {
|
|
2370
|
-
return experimental_toolCaller(factory10(args), {
|
|
2371
|
-
type: "provider",
|
|
2372
|
-
prepareProviderOptions: (providerOptions) => {
|
|
2373
|
-
var _a;
|
|
2374
|
-
const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
|
|
2375
|
-
return {
|
|
2376
|
-
...providerOptions,
|
|
2377
|
-
anthropic: {
|
|
2378
|
-
...anthropicOptions,
|
|
2379
|
-
allowedCallers: [
|
|
2380
|
-
.../* @__PURE__ */ new Set([
|
|
2381
|
-
...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
|
|
2382
|
-
"code_execution_20250825"
|
|
2383
|
-
])
|
|
2384
|
-
]
|
|
2385
|
-
}
|
|
2386
|
-
};
|
|
2387
|
-
}
|
|
2388
|
-
});
|
|
2389
|
-
};
|
|
2390
|
-
|
|
2391
|
-
// src/tool/code-execution_20260120.ts
|
|
2392
|
-
import {
|
|
2393
|
-
createProviderExecutedToolFactory as createProviderExecutedToolFactory10,
|
|
2394
|
-
experimental_toolCaller as experimental_toolCaller2,
|
|
2395
2433
|
lazySchema as lazySchema14,
|
|
2396
2434
|
zodSchema as zodSchema14
|
|
2397
2435
|
} from "@ai-sdk/provider-utils";
|
|
2398
2436
|
import { z as z15 } from "zod/v4";
|
|
2399
|
-
var
|
|
2437
|
+
var codeExecution_20250825OutputSchema = lazySchema14(
|
|
2400
2438
|
() => zodSchema14(
|
|
2401
2439
|
z15.discriminatedUnion("type", [
|
|
2402
2440
|
z15.object({
|
|
@@ -2411,18 +2449,6 @@ var codeExecution_20260120OutputSchema = lazySchema14(
|
|
|
2411
2449
|
})
|
|
2412
2450
|
).optional().default([])
|
|
2413
2451
|
}),
|
|
2414
|
-
z15.object({
|
|
2415
|
-
type: z15.literal("encrypted_code_execution_result"),
|
|
2416
|
-
encrypted_stdout: z15.string(),
|
|
2417
|
-
stderr: z15.string(),
|
|
2418
|
-
return_code: z15.number(),
|
|
2419
|
-
content: z15.array(
|
|
2420
|
-
z15.object({
|
|
2421
|
-
type: z15.literal("code_execution_output"),
|
|
2422
|
-
file_id: z15.string()
|
|
2423
|
-
})
|
|
2424
|
-
).optional().default([])
|
|
2425
|
-
}),
|
|
2426
2452
|
z15.object({
|
|
2427
2453
|
type: z15.literal("bash_code_execution_result"),
|
|
2428
2454
|
content: z15.array(
|
|
@@ -2466,9 +2492,10 @@ var codeExecution_20260120OutputSchema = lazySchema14(
|
|
|
2466
2492
|
])
|
|
2467
2493
|
)
|
|
2468
2494
|
);
|
|
2469
|
-
var
|
|
2495
|
+
var codeExecution_20250825InputSchema = lazySchema14(
|
|
2470
2496
|
() => zodSchema14(
|
|
2471
2497
|
z15.discriminatedUnion("type", [
|
|
2498
|
+
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2472
2499
|
z15.object({
|
|
2473
2500
|
type: z15.literal("programmatic-tool-call"),
|
|
2474
2501
|
code: z15.string()
|
|
@@ -2500,6 +2527,149 @@ var codeExecution_20260120InputSchema = lazySchema14(
|
|
|
2500
2527
|
])
|
|
2501
2528
|
)
|
|
2502
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
|
+
);
|
|
2503
2673
|
var factory11 = createProviderExecutedToolFactory10({
|
|
2504
2674
|
id: "anthropic.code_execution_20260120",
|
|
2505
2675
|
inputSchema: codeExecution_20260120InputSchema,
|
|
@@ -2531,23 +2701,23 @@ var codeExecution_20260120 = (args = {}) => {
|
|
|
2531
2701
|
// src/tool/tool-search-regex_20251119.ts
|
|
2532
2702
|
import {
|
|
2533
2703
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory11,
|
|
2534
|
-
lazySchema as
|
|
2535
|
-
zodSchema as
|
|
2704
|
+
lazySchema as lazySchema16,
|
|
2705
|
+
zodSchema as zodSchema16
|
|
2536
2706
|
} from "@ai-sdk/provider-utils";
|
|
2537
|
-
import { z as
|
|
2538
|
-
var toolSearchRegex_20251119OutputSchema =
|
|
2539
|
-
() =>
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
type:
|
|
2543
|
-
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()
|
|
2544
2714
|
})
|
|
2545
2715
|
)
|
|
2546
2716
|
)
|
|
2547
2717
|
);
|
|
2548
|
-
var toolSearchRegex_20251119InputSchema =
|
|
2549
|
-
() =>
|
|
2550
|
-
|
|
2718
|
+
var toolSearchRegex_20251119InputSchema = lazySchema16(
|
|
2719
|
+
() => zodSchema16(
|
|
2720
|
+
z17.object({
|
|
2551
2721
|
/**
|
|
2552
2722
|
* A regex pattern to search for tools.
|
|
2553
2723
|
* Uses Python re.search() syntax. Maximum 200 characters.
|
|
@@ -2558,11 +2728,11 @@ var toolSearchRegex_20251119InputSchema = lazySchema15(
|
|
|
2558
2728
|
* - "database.*query|query.*database" - OR patterns for flexibility
|
|
2559
2729
|
* - "(?i)slack" - case-insensitive search
|
|
2560
2730
|
*/
|
|
2561
|
-
pattern:
|
|
2731
|
+
pattern: z17.string(),
|
|
2562
2732
|
/**
|
|
2563
2733
|
* Maximum number of tools to return. Optional.
|
|
2564
2734
|
*/
|
|
2565
|
-
limit:
|
|
2735
|
+
limit: z17.number().optional()
|
|
2566
2736
|
})
|
|
2567
2737
|
)
|
|
2568
2738
|
);
|
|
@@ -2603,7 +2773,8 @@ async function convertToAnthropicPrompt({
|
|
|
2603
2773
|
sendReasoning,
|
|
2604
2774
|
warnings,
|
|
2605
2775
|
cacheControlValidator,
|
|
2606
|
-
toolNameMapping
|
|
2776
|
+
toolNameMapping,
|
|
2777
|
+
toolsetNames = {}
|
|
2607
2778
|
}) {
|
|
2608
2779
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2609
2780
|
const betas = /* @__PURE__ */ new Set();
|
|
@@ -2726,7 +2897,7 @@ async function convertToAnthropicPrompt({
|
|
|
2726
2897
|
betas.add("mid-conversation-system-clear-at-2026-08-21");
|
|
2727
2898
|
}
|
|
2728
2899
|
if (message.effort != null) {
|
|
2729
|
-
betas.add("mid-conversation-
|
|
2900
|
+
betas.add("mid-conversation-output-config-2026-07-01");
|
|
2730
2901
|
}
|
|
2731
2902
|
}
|
|
2732
2903
|
}
|
|
@@ -3026,9 +3197,15 @@ async function convertToAnthropicPrompt({
|
|
|
3026
3197
|
contentValue = JSON.stringify(output.value);
|
|
3027
3198
|
break;
|
|
3028
3199
|
}
|
|
3200
|
+
const toolsetName = getAnthropicToolsetName({
|
|
3201
|
+
toolName: part.toolName,
|
|
3202
|
+
providerOptions: part.providerOptions,
|
|
3203
|
+
toolsetNames
|
|
3204
|
+
});
|
|
3029
3205
|
anthropicContent.push({
|
|
3030
3206
|
type: "tool_result",
|
|
3031
3207
|
tool_use_id: part.toolCallId,
|
|
3208
|
+
...toolsetName != null && { toolset_name: toolsetName },
|
|
3032
3209
|
content: contentValue,
|
|
3033
3210
|
is_error: output.type === "error-text" || output.type === "error-json" ? true : void 0,
|
|
3034
3211
|
cache_control: cacheControl
|
|
@@ -3226,6 +3403,33 @@ async function convertToAnthropicPrompt({
|
|
|
3226
3403
|
}
|
|
3227
3404
|
break;
|
|
3228
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
|
+
}
|
|
3229
3433
|
anthropicContent.push({
|
|
3230
3434
|
type: "tool_use",
|
|
3231
3435
|
id: part.toolCallId,
|
|
@@ -3649,6 +3853,19 @@ function moveToolUseBlocksToEnd(content) {
|
|
|
3649
3853
|
flushSegment();
|
|
3650
3854
|
return result;
|
|
3651
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
|
+
}
|
|
3652
3869
|
function getAnthropicCaller(providerOptions) {
|
|
3653
3870
|
var _a;
|
|
3654
3871
|
const caller = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.caller;
|
|
@@ -3922,6 +4139,24 @@ function getAnthropicCallerMetadata(caller) {
|
|
|
3922
4139
|
const callerInfo = getAnthropicCallerInfo(caller);
|
|
3923
4140
|
return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
|
|
3924
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
|
+
};
|
|
4159
|
+
}
|
|
3925
4160
|
function getProviderOptionsName(provider) {
|
|
3926
4161
|
const dotIndex = provider.indexOf(".");
|
|
3927
4162
|
return dotIndex === -1 ? provider : provider.substring(0, dotIndex);
|
|
@@ -4034,6 +4269,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4034
4269
|
rejectsSamplingParameters,
|
|
4035
4270
|
supportsXhighEffort,
|
|
4036
4271
|
rejectsThinkingDisabledAboveHighEffort,
|
|
4272
|
+
rejectsThinkingDisabled,
|
|
4273
|
+
rejectsForcedToolUse,
|
|
4037
4274
|
isKnownModel
|
|
4038
4275
|
} = getModelCapabilities(modelId);
|
|
4039
4276
|
if (!isKnownModel && maxOutputTokens == null) {
|
|
@@ -4073,7 +4310,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4073
4310
|
const supportsStructuredOutput = ((_a = config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
4074
4311
|
const supportsStrictTools = ((_b = config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
4075
4312
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
4076
|
-
|
|
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
|
+
}
|
|
4077
4322
|
const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
4078
4323
|
type: "function",
|
|
4079
4324
|
name: "json",
|
|
@@ -4097,6 +4342,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4097
4342
|
"anthropic.code_execution_20260120": "code_execution",
|
|
4098
4343
|
"anthropic.computer_20241022": "computer",
|
|
4099
4344
|
"anthropic.computer_20250124": "computer",
|
|
4345
|
+
"anthropic.computer_20251124": "computer",
|
|
4346
|
+
"anthropic.computer_toolset_20260801": "computer",
|
|
4100
4347
|
"anthropic.text_editor_20241022": "str_replace_editor",
|
|
4101
4348
|
"anthropic.text_editor_20250124": "str_replace_editor",
|
|
4102
4349
|
"anthropic.text_editor_20250429": "str_replace_based_edit_tool",
|
|
@@ -4115,18 +4362,22 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4115
4362
|
"anthropic.advisor_20260301": "advisor"
|
|
4116
4363
|
}
|
|
4117
4364
|
});
|
|
4365
|
+
const toolsetNames = getAnthropicToolsetNames(tools);
|
|
4118
4366
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicPrompt({
|
|
4119
4367
|
prompt,
|
|
4120
4368
|
sendReasoning: (_d = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _d : true,
|
|
4121
4369
|
warnings,
|
|
4122
4370
|
cacheControlValidator,
|
|
4123
|
-
toolNameMapping
|
|
4371
|
+
toolNameMapping,
|
|
4372
|
+
toolsetNames
|
|
4124
4373
|
});
|
|
4125
4374
|
if (isCustomReasoning(reasoning) && (anthropicOptions == null ? void 0 : anthropicOptions.effort) == null) {
|
|
4126
4375
|
const reasoningConfig = resolveAnthropicReasoningConfig({
|
|
4127
4376
|
reasoning,
|
|
4377
|
+
modelId,
|
|
4128
4378
|
supportsAdaptiveThinking,
|
|
4129
4379
|
supportsXhighEffort,
|
|
4380
|
+
rejectsThinkingDisabled,
|
|
4130
4381
|
maxOutputTokensForModel,
|
|
4131
4382
|
warnings
|
|
4132
4383
|
});
|
|
@@ -4139,6 +4390,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4139
4390
|
}
|
|
4140
4391
|
}
|
|
4141
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
|
+
}
|
|
4142
4411
|
if (rejectsThinkingDisabledAboveHighEffort && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.type) === "disabled" && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
4143
4412
|
warnings.push({
|
|
4144
4413
|
type: "unsupported",
|
|
@@ -4252,6 +4521,14 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4252
4521
|
// prompt:
|
|
4253
4522
|
system: messagesPrompt.system,
|
|
4254
4523
|
messages: messagesPrompt.messages,
|
|
4524
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.safeguards) && anthropicOptions.safeguards.length > 0 && {
|
|
4525
|
+
safeguards: anthropicOptions.safeguards.map((safeguard) => ({
|
|
4526
|
+
type: safeguard.type,
|
|
4527
|
+
...safeguard.classifierContext !== void 0 && {
|
|
4528
|
+
classifier_context: safeguard.classifierContext
|
|
4529
|
+
}
|
|
4530
|
+
}))
|
|
4531
|
+
},
|
|
4255
4532
|
...contextManagement && {
|
|
4256
4533
|
context_management: {
|
|
4257
4534
|
edits: contextManagement.edits.map((edit) => {
|
|
@@ -4364,6 +4641,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4364
4641
|
if ((anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0) {
|
|
4365
4642
|
betas.add("mcp-client-2025-04-04");
|
|
4366
4643
|
}
|
|
4644
|
+
if ((anthropicOptions == null ? void 0 : anthropicOptions.safeguards) && anthropicOptions.safeguards.length > 0) {
|
|
4645
|
+
betas.add("dangerous-tool-use-2026-09-03");
|
|
4646
|
+
}
|
|
4367
4647
|
if (contextManagement) {
|
|
4368
4648
|
betas.add("context-management-2025-06-27");
|
|
4369
4649
|
if (contextManagement.edits.some((e) => e.type === "compact_20260112")) {
|
|
@@ -4414,7 +4694,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4414
4694
|
cacheControlValidator,
|
|
4415
4695
|
supportsStructuredOutput: false,
|
|
4416
4696
|
supportsStrictTools,
|
|
4417
|
-
defaultEagerInputStreaming
|
|
4697
|
+
defaultEagerInputStreaming,
|
|
4698
|
+
rejectsForcedToolUse
|
|
4418
4699
|
} : {
|
|
4419
4700
|
tools: tools != null ? tools : [],
|
|
4420
4701
|
toolChoice,
|
|
@@ -4422,7 +4703,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4422
4703
|
cacheControlValidator,
|
|
4423
4704
|
supportsStructuredOutput,
|
|
4424
4705
|
supportsStrictTools,
|
|
4425
|
-
defaultEagerInputStreaming
|
|
4706
|
+
defaultEagerInputStreaming,
|
|
4707
|
+
rejectsForcedToolUse
|
|
4426
4708
|
}
|
|
4427
4709
|
);
|
|
4428
4710
|
const cacheWarnings = cacheControlValidator.getWarnings();
|
|
@@ -4508,7 +4790,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4508
4790
|
});
|
|
4509
4791
|
}
|
|
4510
4792
|
async doGenerate(options) {
|
|
4511
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4793
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
4512
4794
|
const {
|
|
4513
4795
|
args,
|
|
4514
4796
|
warnings,
|
|
@@ -4630,6 +4912,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4630
4912
|
type: "text",
|
|
4631
4913
|
text: JSON.stringify(part.input)
|
|
4632
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
|
+
});
|
|
4633
4933
|
} else {
|
|
4634
4934
|
content.push({
|
|
4635
4935
|
type: "tool-call",
|
|
@@ -4727,7 +5027,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4727
5027
|
case "web_fetch_tool_result": {
|
|
4728
5028
|
if (part.content.type === "web_fetch_result") {
|
|
4729
5029
|
citationDocuments.push({
|
|
4730
|
-
title: (
|
|
5030
|
+
title: (_c = part.content.content.title) != null ? _c : part.content.url,
|
|
4731
5031
|
mediaType: part.content.content.source.media_type
|
|
4732
5032
|
});
|
|
4733
5033
|
content.push({
|
|
@@ -4793,7 +5093,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4793
5093
|
...result.title != null ? { title: result.title } : {},
|
|
4794
5094
|
providerMetadata: {
|
|
4795
5095
|
anthropic: {
|
|
4796
|
-
pageAge: (
|
|
5096
|
+
pageAge: (_d = result.page_age) != null ? _d : null
|
|
4797
5097
|
}
|
|
4798
5098
|
}
|
|
4799
5099
|
});
|
|
@@ -4825,7 +5125,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4825
5125
|
stdout: part.content.stdout,
|
|
4826
5126
|
stderr: part.content.stderr,
|
|
4827
5127
|
return_code: part.content.return_code,
|
|
4828
|
-
content: (
|
|
5128
|
+
content: (_e = part.content.content) != null ? _e : []
|
|
4829
5129
|
}
|
|
4830
5130
|
});
|
|
4831
5131
|
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
@@ -4838,7 +5138,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4838
5138
|
encrypted_stdout: part.content.encrypted_stdout,
|
|
4839
5139
|
stderr: part.content.stderr,
|
|
4840
5140
|
return_code: part.content.return_code,
|
|
4841
|
-
content: (
|
|
5141
|
+
content: (_f = part.content.content) != null ? _f : []
|
|
4842
5142
|
}
|
|
4843
5143
|
});
|
|
4844
5144
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
@@ -4966,13 +5266,13 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4966
5266
|
finishReason: response.stop_reason,
|
|
4967
5267
|
isJsonResponseFromTool
|
|
4968
5268
|
}),
|
|
4969
|
-
raw: (
|
|
5269
|
+
raw: (_g = response.stop_reason) != null ? _g : void 0
|
|
4970
5270
|
},
|
|
4971
5271
|
usage: convertAnthropicUsage({ usage: response.usage }),
|
|
4972
5272
|
request: { body: args },
|
|
4973
5273
|
response: {
|
|
4974
|
-
id: (
|
|
4975
|
-
modelId: (
|
|
5274
|
+
id: (_h = response.id) != null ? _h : void 0,
|
|
5275
|
+
modelId: (_i = response.model) != null ? _i : void 0,
|
|
4976
5276
|
headers: responseHeaders,
|
|
4977
5277
|
body: rawResponse
|
|
4978
5278
|
},
|
|
@@ -4985,6 +5285,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4985
5285
|
stopSequence: (_a2 = response.stop_sequence) != null ? _a2 : null,
|
|
4986
5286
|
...stopDetails != null ? { stopDetails } : {},
|
|
4987
5287
|
...response.input_transformations != null ? { inputTransformations: response.input_transformations } : {},
|
|
5288
|
+
...response.safeguard_results != null ? { safeguardResults: response.safeguard_results } : {},
|
|
4988
5289
|
iterations: response.usage.iterations ? response.usage.iterations.map(
|
|
4989
5290
|
(iter) => ({
|
|
4990
5291
|
type: iter.type,
|
|
@@ -5071,6 +5372,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5071
5372
|
let stopSequence = null;
|
|
5072
5373
|
let stopDetails = void 0;
|
|
5073
5374
|
let inputTransformations;
|
|
5375
|
+
let safeguardResults;
|
|
5074
5376
|
let container = null;
|
|
5075
5377
|
let isJsonResponseFromTool = false;
|
|
5076
5378
|
let isMessageOpen = false;
|
|
@@ -5171,6 +5473,29 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5171
5473
|
type: "text-start",
|
|
5172
5474
|
id: String(value.index)
|
|
5173
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
|
+
});
|
|
5174
5499
|
} else {
|
|
5175
5500
|
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5176
5501
|
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
@@ -5570,6 +5895,25 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5570
5895
|
case "tool-call":
|
|
5571
5896
|
const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === "json";
|
|
5572
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
|
+
}
|
|
5573
5917
|
controller.enqueue({
|
|
5574
5918
|
type: "tool-input-end",
|
|
5575
5919
|
id: contentBlock.toolCallId
|
|
@@ -5598,10 +5942,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5598
5942
|
// tool was not explicitly provided. We therefore bypass the general validation by marking the
|
|
5599
5943
|
// tool as dynamic.
|
|
5600
5944
|
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
5601
|
-
...contentBlock.caller && {
|
|
5945
|
+
...(contentBlock.caller || contentBlock.toolset) && {
|
|
5602
5946
|
providerMetadata: {
|
|
5603
5947
|
anthropic: {
|
|
5604
|
-
|
|
5948
|
+
...contentBlock.toolset && {
|
|
5949
|
+
toolsetName: contentBlock.toolset.name
|
|
5950
|
+
},
|
|
5951
|
+
...contentBlock.caller && {
|
|
5952
|
+
caller: contentBlock.caller
|
|
5953
|
+
}
|
|
5605
5954
|
}
|
|
5606
5955
|
}
|
|
5607
5956
|
}
|
|
@@ -5680,6 +6029,10 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5680
6029
|
if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
|
|
5681
6030
|
return;
|
|
5682
6031
|
}
|
|
6032
|
+
if (contentBlock.toolset != null) {
|
|
6033
|
+
contentBlock.input += delta;
|
|
6034
|
+
return;
|
|
6035
|
+
}
|
|
5683
6036
|
if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
|
|
5684
6037
|
delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
|
|
5685
6038
|
}
|
|
@@ -5845,6 +6198,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5845
6198
|
if (value.input_transformations != null) {
|
|
5846
6199
|
inputTransformations = value.input_transformations;
|
|
5847
6200
|
}
|
|
6201
|
+
if (value.delta.safeguard_results != null) {
|
|
6202
|
+
safeguardResults = value.delta.safeguard_results;
|
|
6203
|
+
}
|
|
5848
6204
|
rawUsage = {
|
|
5849
6205
|
...rawUsage,
|
|
5850
6206
|
...value.usage
|
|
@@ -5859,6 +6215,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5859
6215
|
stopSequence,
|
|
5860
6216
|
...stopDetails != null ? { stopDetails } : {},
|
|
5861
6217
|
...inputTransformations != null ? { inputTransformations } : {},
|
|
6218
|
+
...safeguardResults != null ? { safeguardResults } : {},
|
|
5862
6219
|
iterations: usage.iterations ? usage.iterations.map(
|
|
5863
6220
|
(iter) => ({
|
|
5864
6221
|
type: iter.type,
|
|
@@ -5941,7 +6298,19 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5941
6298
|
}
|
|
5942
6299
|
};
|
|
5943
6300
|
function getModelCapabilities(modelId) {
|
|
5944
|
-
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")) {
|
|
5945
6314
|
return {
|
|
5946
6315
|
maxOutputTokens: 128e3,
|
|
5947
6316
|
supportsStructuredOutput: true,
|
|
@@ -5949,9 +6318,35 @@ function getModelCapabilities(modelId) {
|
|
|
5949
6318
|
rejectsSamplingParameters: true,
|
|
5950
6319
|
supportsXhighEffort: true,
|
|
5951
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,
|
|
5952
6347
|
isKnownModel: true
|
|
5953
6348
|
};
|
|
5954
|
-
} 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")) {
|
|
5955
6350
|
return {
|
|
5956
6351
|
maxOutputTokens: 128e3,
|
|
5957
6352
|
supportsStructuredOutput: true,
|
|
@@ -5959,6 +6354,8 @@ function getModelCapabilities(modelId) {
|
|
|
5959
6354
|
rejectsSamplingParameters: true,
|
|
5960
6355
|
supportsXhighEffort: true,
|
|
5961
6356
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6357
|
+
rejectsThinkingDisabled: false,
|
|
6358
|
+
rejectsForcedToolUse: false,
|
|
5962
6359
|
isKnownModel: true
|
|
5963
6360
|
};
|
|
5964
6361
|
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
@@ -5969,6 +6366,8 @@ function getModelCapabilities(modelId) {
|
|
|
5969
6366
|
rejectsSamplingParameters: false,
|
|
5970
6367
|
supportsXhighEffort: false,
|
|
5971
6368
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6369
|
+
rejectsThinkingDisabled: false,
|
|
6370
|
+
rejectsForcedToolUse: false,
|
|
5972
6371
|
isKnownModel: true
|
|
5973
6372
|
};
|
|
5974
6373
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
@@ -5979,6 +6378,8 @@ function getModelCapabilities(modelId) {
|
|
|
5979
6378
|
rejectsSamplingParameters: false,
|
|
5980
6379
|
supportsXhighEffort: false,
|
|
5981
6380
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6381
|
+
rejectsThinkingDisabled: false,
|
|
6382
|
+
rejectsForcedToolUse: false,
|
|
5982
6383
|
isKnownModel: true
|
|
5983
6384
|
};
|
|
5984
6385
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
@@ -5989,6 +6390,8 @@ function getModelCapabilities(modelId) {
|
|
|
5989
6390
|
rejectsSamplingParameters: false,
|
|
5990
6391
|
supportsXhighEffort: false,
|
|
5991
6392
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6393
|
+
rejectsThinkingDisabled: false,
|
|
6394
|
+
rejectsForcedToolUse: false,
|
|
5992
6395
|
isKnownModel: true
|
|
5993
6396
|
};
|
|
5994
6397
|
} else if (/claude-sonnet-4(?:-|@)/.test(modelId)) {
|
|
@@ -5999,6 +6402,8 @@ function getModelCapabilities(modelId) {
|
|
|
5999
6402
|
rejectsSamplingParameters: false,
|
|
6000
6403
|
supportsXhighEffort: false,
|
|
6001
6404
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6405
|
+
rejectsThinkingDisabled: false,
|
|
6406
|
+
rejectsForcedToolUse: false,
|
|
6002
6407
|
isKnownModel: true
|
|
6003
6408
|
};
|
|
6004
6409
|
} else if (/claude-opus-4(?:-|@)/.test(modelId)) {
|
|
@@ -6009,6 +6414,8 @@ function getModelCapabilities(modelId) {
|
|
|
6009
6414
|
rejectsSamplingParameters: false,
|
|
6010
6415
|
supportsXhighEffort: false,
|
|
6011
6416
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6417
|
+
rejectsThinkingDisabled: false,
|
|
6418
|
+
rejectsForcedToolUse: false,
|
|
6012
6419
|
isKnownModel: true
|
|
6013
6420
|
};
|
|
6014
6421
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
@@ -6019,6 +6426,8 @@ function getModelCapabilities(modelId) {
|
|
|
6019
6426
|
rejectsSamplingParameters: false,
|
|
6020
6427
|
supportsXhighEffort: false,
|
|
6021
6428
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6429
|
+
rejectsThinkingDisabled: false,
|
|
6430
|
+
rejectsForcedToolUse: false,
|
|
6022
6431
|
isKnownModel: true
|
|
6023
6432
|
};
|
|
6024
6433
|
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
@@ -6029,6 +6438,8 @@ function getModelCapabilities(modelId) {
|
|
|
6029
6438
|
rejectsSamplingParameters: false,
|
|
6030
6439
|
supportsXhighEffort: false,
|
|
6031
6440
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6441
|
+
rejectsThinkingDisabled: false,
|
|
6442
|
+
rejectsForcedToolUse: false,
|
|
6032
6443
|
isKnownModel: false
|
|
6033
6444
|
};
|
|
6034
6445
|
} else if (modelId.includes("claude-")) {
|
|
@@ -6039,6 +6450,8 @@ function getModelCapabilities(modelId) {
|
|
|
6039
6450
|
rejectsSamplingParameters: true,
|
|
6040
6451
|
supportsXhighEffort: true,
|
|
6041
6452
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6453
|
+
rejectsThinkingDisabled: false,
|
|
6454
|
+
rejectsForcedToolUse: false,
|
|
6042
6455
|
isKnownModel: false
|
|
6043
6456
|
};
|
|
6044
6457
|
} else {
|
|
@@ -6049,6 +6462,8 @@ function getModelCapabilities(modelId) {
|
|
|
6049
6462
|
rejectsSamplingParameters: false,
|
|
6050
6463
|
supportsXhighEffort: false,
|
|
6051
6464
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6465
|
+
rejectsThinkingDisabled: false,
|
|
6466
|
+
rejectsForcedToolUse: false,
|
|
6052
6467
|
isKnownModel: false
|
|
6053
6468
|
};
|
|
6054
6469
|
}
|
|
@@ -6073,8 +6488,10 @@ function hasDynamicFilteringWebToolWithoutCodeExecution(tools) {
|
|
|
6073
6488
|
}
|
|
6074
6489
|
function resolveAnthropicReasoningConfig({
|
|
6075
6490
|
reasoning,
|
|
6491
|
+
modelId,
|
|
6076
6492
|
supportsAdaptiveThinking,
|
|
6077
6493
|
supportsXhighEffort,
|
|
6494
|
+
rejectsThinkingDisabled,
|
|
6078
6495
|
maxOutputTokensForModel,
|
|
6079
6496
|
warnings
|
|
6080
6497
|
}) {
|
|
@@ -6082,6 +6499,14 @@ function resolveAnthropicReasoningConfig({
|
|
|
6082
6499
|
return void 0;
|
|
6083
6500
|
}
|
|
6084
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
|
+
}
|
|
6085
6510
|
return { thinking: { type: "disabled" } };
|
|
6086
6511
|
}
|
|
6087
6512
|
if (supportsAdaptiveThinking) {
|
|
@@ -6163,47 +6588,47 @@ import {
|
|
|
6163
6588
|
generateId as generateId2,
|
|
6164
6589
|
getFromApi,
|
|
6165
6590
|
isRecord as isRecord2,
|
|
6166
|
-
lazySchema as
|
|
6591
|
+
lazySchema as lazySchema17,
|
|
6167
6592
|
normalizeBatchRequestCounts,
|
|
6168
6593
|
normalizeHeaders,
|
|
6169
6594
|
parseProviderOptions as parseProviderOptions3,
|
|
6170
6595
|
postJsonToApi as postJsonToApi2,
|
|
6171
6596
|
resolve as resolve2,
|
|
6172
6597
|
safeValidateTypes,
|
|
6173
|
-
zodSchema as
|
|
6598
|
+
zodSchema as zodSchema17
|
|
6174
6599
|
} from "@ai-sdk/provider-utils";
|
|
6175
|
-
import { z as
|
|
6600
|
+
import { z as z18 } from "zod/v4";
|
|
6176
6601
|
var anthropicBatchRequestIdPattern = /^[A-Za-z0-9_-]{1,64}$/;
|
|
6177
6602
|
var anthropicBatchProviderOptionsSchema = anthropicLanguageModelOptions.pick({
|
|
6178
6603
|
anthropicBeta: true
|
|
6179
6604
|
});
|
|
6180
|
-
var anthropicBatchResponseZodSchema = () =>
|
|
6181
|
-
id:
|
|
6182
|
-
type:
|
|
6183
|
-
processing_status:
|
|
6184
|
-
request_counts:
|
|
6185
|
-
processing:
|
|
6186
|
-
succeeded:
|
|
6187
|
-
errored:
|
|
6188
|
-
canceled:
|
|
6189
|
-
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()
|
|
6190
6615
|
}),
|
|
6191
|
-
created_at:
|
|
6192
|
-
expires_at:
|
|
6193
|
-
archived_at:
|
|
6194
|
-
cancel_initiated_at:
|
|
6195
|
-
ended_at:
|
|
6196
|
-
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()
|
|
6197
6622
|
});
|
|
6198
|
-
var anthropicBatchResponseSchema =
|
|
6199
|
-
() =>
|
|
6623
|
+
var anthropicBatchResponseSchema = lazySchema17(
|
|
6624
|
+
() => zodSchema17(anthropicBatchResponseZodSchema())
|
|
6200
6625
|
);
|
|
6201
|
-
var anthropicBatchListResponseSchema =
|
|
6202
|
-
() =>
|
|
6203
|
-
|
|
6204
|
-
data:
|
|
6205
|
-
has_more:
|
|
6206
|
-
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()
|
|
6207
6632
|
})
|
|
6208
6633
|
)
|
|
6209
6634
|
);
|
|
@@ -6226,34 +6651,34 @@ var knownAnthropicBatchContentTypes = /* @__PURE__ */ new Set([
|
|
|
6226
6651
|
"web_fetch_tool_result",
|
|
6227
6652
|
"web_search_tool_result"
|
|
6228
6653
|
]);
|
|
6229
|
-
var anthropicBatchResultSchema =
|
|
6230
|
-
() =>
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
type:
|
|
6234
|
-
message:
|
|
6654
|
+
var anthropicBatchResultSchema = lazySchema17(
|
|
6655
|
+
() => zodSchema17(
|
|
6656
|
+
z18.discriminatedUnion("type", [
|
|
6657
|
+
z18.object({
|
|
6658
|
+
type: z18.literal("succeeded"),
|
|
6659
|
+
message: z18.unknown()
|
|
6235
6660
|
}),
|
|
6236
|
-
|
|
6237
|
-
type:
|
|
6238
|
-
error:
|
|
6239
|
-
type:
|
|
6240
|
-
error:
|
|
6241
|
-
type:
|
|
6242
|
-
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()
|
|
6243
6668
|
}),
|
|
6244
|
-
request_id:
|
|
6669
|
+
request_id: z18.string().nullish()
|
|
6245
6670
|
})
|
|
6246
6671
|
}),
|
|
6247
|
-
|
|
6248
|
-
|
|
6672
|
+
z18.object({ type: z18.literal("canceled") }),
|
|
6673
|
+
z18.object({ type: z18.literal("expired") })
|
|
6249
6674
|
])
|
|
6250
6675
|
)
|
|
6251
6676
|
);
|
|
6252
|
-
var anthropicBatchResultLineSchema =
|
|
6253
|
-
() =>
|
|
6254
|
-
|
|
6255
|
-
custom_id:
|
|
6256
|
-
result:
|
|
6677
|
+
var anthropicBatchResultLineSchema = lazySchema17(
|
|
6678
|
+
() => zodSchema17(
|
|
6679
|
+
z18.object({
|
|
6680
|
+
custom_id: z18.string(),
|
|
6681
|
+
result: z18.unknown()
|
|
6257
6682
|
})
|
|
6258
6683
|
)
|
|
6259
6684
|
);
|
|
@@ -7002,6 +7427,7 @@ function convertAnthropicMessageMetadata(response) {
|
|
|
7002
7427
|
stopSequence: (_a = response.stop_sequence) != null ? _a : null,
|
|
7003
7428
|
...stopDetails != null ? { stopDetails } : {},
|
|
7004
7429
|
...response.input_transformations != null ? { inputTransformations: response.input_transformations } : {},
|
|
7430
|
+
...response.safeguard_results != null ? { safeguardResults: response.safeguard_results } : {},
|
|
7005
7431
|
iterations: response.usage.iterations ? response.usage.iterations.map(
|
|
7006
7432
|
(iteration) => ({
|
|
7007
7433
|
type: iteration.type,
|
|
@@ -7064,20 +7490,20 @@ function mapAnthropicStopDetails2(stopDetails) {
|
|
|
7064
7490
|
|
|
7065
7491
|
// src/tool/bash_20241022.ts
|
|
7066
7492
|
import {
|
|
7067
|
-
createProviderDefinedToolFactory as
|
|
7068
|
-
lazySchema as
|
|
7069
|
-
zodSchema as
|
|
7493
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
|
|
7494
|
+
lazySchema as lazySchema18,
|
|
7495
|
+
zodSchema as zodSchema18
|
|
7070
7496
|
} from "@ai-sdk/provider-utils";
|
|
7071
|
-
import { z as
|
|
7072
|
-
var bash_20241022InputSchema =
|
|
7073
|
-
() =>
|
|
7074
|
-
|
|
7075
|
-
command:
|
|
7076
|
-
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()
|
|
7077
7503
|
})
|
|
7078
7504
|
)
|
|
7079
7505
|
);
|
|
7080
|
-
var bash_20241022_internal =
|
|
7506
|
+
var bash_20241022_internal = createProviderDefinedToolFactory3({
|
|
7081
7507
|
id: "anthropic.bash_20241022",
|
|
7082
7508
|
inputSchema: bash_20241022InputSchema
|
|
7083
7509
|
});
|
|
@@ -7105,20 +7531,20 @@ function bash_20241022(options = {}) {
|
|
|
7105
7531
|
|
|
7106
7532
|
// src/tool/bash_20250124.ts
|
|
7107
7533
|
import {
|
|
7108
|
-
createProviderDefinedToolFactory as
|
|
7109
|
-
lazySchema as
|
|
7110
|
-
zodSchema as
|
|
7534
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
|
|
7535
|
+
lazySchema as lazySchema19,
|
|
7536
|
+
zodSchema as zodSchema19
|
|
7111
7537
|
} from "@ai-sdk/provider-utils";
|
|
7112
|
-
import { z as
|
|
7113
|
-
var bash_20250124InputSchema =
|
|
7114
|
-
() =>
|
|
7115
|
-
|
|
7116
|
-
command:
|
|
7117
|
-
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()
|
|
7118
7544
|
})
|
|
7119
7545
|
)
|
|
7120
7546
|
);
|
|
7121
|
-
var bash_20250124_internal =
|
|
7547
|
+
var bash_20250124_internal = createProviderDefinedToolFactory4({
|
|
7122
7548
|
id: "anthropic.bash_20250124",
|
|
7123
7549
|
inputSchema: bash_20250124InputSchema
|
|
7124
7550
|
});
|
|
@@ -7146,15 +7572,15 @@ function bash_20250124(options = {}) {
|
|
|
7146
7572
|
|
|
7147
7573
|
// src/tool/computer_20241022.ts
|
|
7148
7574
|
import {
|
|
7149
|
-
createProviderDefinedToolFactory as
|
|
7150
|
-
lazySchema as
|
|
7151
|
-
zodSchema as
|
|
7575
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
|
|
7576
|
+
lazySchema as lazySchema20,
|
|
7577
|
+
zodSchema as zodSchema20
|
|
7152
7578
|
} from "@ai-sdk/provider-utils";
|
|
7153
|
-
import { z as
|
|
7154
|
-
var computer_20241022InputSchema =
|
|
7155
|
-
() =>
|
|
7156
|
-
|
|
7157
|
-
action:
|
|
7579
|
+
import { z as z21 } from "zod/v4";
|
|
7580
|
+
var computer_20241022InputSchema = lazySchema20(
|
|
7581
|
+
() => zodSchema20(
|
|
7582
|
+
z21.object({
|
|
7583
|
+
action: z21.enum([
|
|
7158
7584
|
"key",
|
|
7159
7585
|
"type",
|
|
7160
7586
|
"mouse_move",
|
|
@@ -7166,27 +7592,27 @@ var computer_20241022InputSchema = lazySchema19(
|
|
|
7166
7592
|
"screenshot",
|
|
7167
7593
|
"cursor_position"
|
|
7168
7594
|
]),
|
|
7169
|
-
coordinate:
|
|
7170
|
-
text:
|
|
7595
|
+
coordinate: z21.array(z21.number().int()).optional(),
|
|
7596
|
+
text: z21.string().optional()
|
|
7171
7597
|
})
|
|
7172
7598
|
)
|
|
7173
7599
|
);
|
|
7174
|
-
var computer_20241022 =
|
|
7600
|
+
var computer_20241022 = createProviderDefinedToolFactory5({
|
|
7175
7601
|
id: "anthropic.computer_20241022",
|
|
7176
7602
|
inputSchema: computer_20241022InputSchema
|
|
7177
7603
|
});
|
|
7178
7604
|
|
|
7179
7605
|
// src/tool/computer_20250124.ts
|
|
7180
7606
|
import {
|
|
7181
|
-
createProviderDefinedToolFactory as
|
|
7182
|
-
lazySchema as
|
|
7183
|
-
zodSchema as
|
|
7607
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
|
|
7608
|
+
lazySchema as lazySchema21,
|
|
7609
|
+
zodSchema as zodSchema21
|
|
7184
7610
|
} from "@ai-sdk/provider-utils";
|
|
7185
|
-
import { z as
|
|
7186
|
-
var computer_20250124InputSchema =
|
|
7187
|
-
() =>
|
|
7188
|
-
|
|
7189
|
-
action:
|
|
7611
|
+
import { z as z22 } from "zod/v4";
|
|
7612
|
+
var computer_20250124InputSchema = lazySchema21(
|
|
7613
|
+
() => zodSchema21(
|
|
7614
|
+
z22.object({
|
|
7615
|
+
action: z22.enum([
|
|
7190
7616
|
"key",
|
|
7191
7617
|
"hold_key",
|
|
7192
7618
|
"type",
|
|
@@ -7204,31 +7630,31 @@ var computer_20250124InputSchema = lazySchema20(
|
|
|
7204
7630
|
"wait",
|
|
7205
7631
|
"screenshot"
|
|
7206
7632
|
]),
|
|
7207
|
-
coordinate:
|
|
7208
|
-
duration:
|
|
7209
|
-
scroll_amount:
|
|
7210
|
-
scroll_direction:
|
|
7211
|
-
start_coordinate:
|
|
7212
|
-
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()
|
|
7213
7639
|
})
|
|
7214
7640
|
)
|
|
7215
7641
|
);
|
|
7216
|
-
var computer_20250124 =
|
|
7642
|
+
var computer_20250124 = createProviderDefinedToolFactory6({
|
|
7217
7643
|
id: "anthropic.computer_20250124",
|
|
7218
7644
|
inputSchema: computer_20250124InputSchema
|
|
7219
7645
|
});
|
|
7220
7646
|
|
|
7221
7647
|
// src/tool/computer_20251124.ts
|
|
7222
7648
|
import {
|
|
7223
|
-
createProviderDefinedToolFactory as
|
|
7224
|
-
lazySchema as
|
|
7225
|
-
zodSchema as
|
|
7649
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
|
|
7650
|
+
lazySchema as lazySchema22,
|
|
7651
|
+
zodSchema as zodSchema22
|
|
7226
7652
|
} from "@ai-sdk/provider-utils";
|
|
7227
|
-
import { z as
|
|
7228
|
-
var computer_20251124InputSchema =
|
|
7229
|
-
() =>
|
|
7230
|
-
|
|
7231
|
-
action:
|
|
7653
|
+
import { z as z23 } from "zod/v4";
|
|
7654
|
+
var computer_20251124InputSchema = lazySchema22(
|
|
7655
|
+
() => zodSchema22(
|
|
7656
|
+
z23.object({
|
|
7657
|
+
action: z23.enum([
|
|
7232
7658
|
"key",
|
|
7233
7659
|
"hold_key",
|
|
7234
7660
|
"type",
|
|
@@ -7247,109 +7673,83 @@ var computer_20251124InputSchema = lazySchema21(
|
|
|
7247
7673
|
"screenshot",
|
|
7248
7674
|
"zoom"
|
|
7249
7675
|
]),
|
|
7250
|
-
coordinate:
|
|
7251
|
-
duration:
|
|
7252
|
-
region:
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
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()
|
|
7257
7683
|
]).optional(),
|
|
7258
|
-
scroll_amount:
|
|
7259
|
-
scroll_direction:
|
|
7260
|
-
start_coordinate:
|
|
7261
|
-
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()
|
|
7262
7688
|
})
|
|
7263
7689
|
)
|
|
7264
7690
|
);
|
|
7265
|
-
var computer_20251124 =
|
|
7691
|
+
var computer_20251124 = createProviderDefinedToolFactory7({
|
|
7266
7692
|
id: "anthropic.computer_20251124",
|
|
7267
7693
|
inputSchema: computer_20251124InputSchema
|
|
7268
7694
|
});
|
|
7269
7695
|
|
|
7270
7696
|
// src/tool/memory_20250818.ts
|
|
7271
7697
|
import {
|
|
7272
|
-
createProviderDefinedToolFactory as
|
|
7273
|
-
lazySchema as
|
|
7274
|
-
zodSchema as
|
|
7698
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
7699
|
+
lazySchema as lazySchema23,
|
|
7700
|
+
zodSchema as zodSchema23
|
|
7275
7701
|
} from "@ai-sdk/provider-utils";
|
|
7276
|
-
import { z as
|
|
7277
|
-
var memory_20250818InputSchema =
|
|
7278
|
-
() =>
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
command:
|
|
7282
|
-
path:
|
|
7283
|
-
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()
|
|
7284
7710
|
}),
|
|
7285
|
-
|
|
7286
|
-
command:
|
|
7287
|
-
path:
|
|
7288
|
-
file_text:
|
|
7711
|
+
z24.object({
|
|
7712
|
+
command: z24.literal("create"),
|
|
7713
|
+
path: z24.string(),
|
|
7714
|
+
file_text: z24.string()
|
|
7289
7715
|
}),
|
|
7290
|
-
|
|
7291
|
-
command:
|
|
7292
|
-
path:
|
|
7293
|
-
old_str:
|
|
7294
|
-
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()
|
|
7295
7721
|
}),
|
|
7296
|
-
|
|
7297
|
-
command:
|
|
7298
|
-
path:
|
|
7299
|
-
insert_line:
|
|
7300
|
-
insert_text:
|
|
7722
|
+
z24.object({
|
|
7723
|
+
command: z24.literal("insert"),
|
|
7724
|
+
path: z24.string(),
|
|
7725
|
+
insert_line: z24.number(),
|
|
7726
|
+
insert_text: z24.string()
|
|
7301
7727
|
}),
|
|
7302
|
-
|
|
7303
|
-
command:
|
|
7304
|
-
path:
|
|
7728
|
+
z24.object({
|
|
7729
|
+
command: z24.literal("delete"),
|
|
7730
|
+
path: z24.string()
|
|
7305
7731
|
}),
|
|
7306
|
-
|
|
7307
|
-
command:
|
|
7308
|
-
old_path:
|
|
7309
|
-
new_path:
|
|
7732
|
+
z24.object({
|
|
7733
|
+
command: z24.literal("rename"),
|
|
7734
|
+
old_path: z24.string(),
|
|
7735
|
+
new_path: z24.string()
|
|
7310
7736
|
})
|
|
7311
7737
|
])
|
|
7312
7738
|
)
|
|
7313
7739
|
);
|
|
7314
|
-
var memory_20250818 =
|
|
7740
|
+
var memory_20250818 = createProviderDefinedToolFactory8({
|
|
7315
7741
|
id: "anthropic.memory_20250818",
|
|
7316
7742
|
inputSchema: memory_20250818InputSchema
|
|
7317
7743
|
});
|
|
7318
7744
|
|
|
7319
7745
|
// src/tool/text-editor_20241022.ts
|
|
7320
|
-
import {
|
|
7321
|
-
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
7322
|
-
lazySchema as lazySchema23,
|
|
7323
|
-
zodSchema as zodSchema23
|
|
7324
|
-
} from "@ai-sdk/provider-utils";
|
|
7325
|
-
import { z as z24 } from "zod/v4";
|
|
7326
|
-
var textEditor_20241022InputSchema = lazySchema23(
|
|
7327
|
-
() => zodSchema23(
|
|
7328
|
-
z24.object({
|
|
7329
|
-
command: z24.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
7330
|
-
path: z24.string(),
|
|
7331
|
-
file_text: z24.string().optional(),
|
|
7332
|
-
insert_line: z24.number().int().optional(),
|
|
7333
|
-
new_str: z24.string().optional(),
|
|
7334
|
-
insert_text: z24.string().optional(),
|
|
7335
|
-
old_str: z24.string().optional(),
|
|
7336
|
-
view_range: z24.array(z24.number().int()).optional()
|
|
7337
|
-
})
|
|
7338
|
-
)
|
|
7339
|
-
);
|
|
7340
|
-
var textEditor_20241022 = createProviderDefinedToolFactory8({
|
|
7341
|
-
id: "anthropic.text_editor_20241022",
|
|
7342
|
-
inputSchema: textEditor_20241022InputSchema
|
|
7343
|
-
});
|
|
7344
|
-
|
|
7345
|
-
// src/tool/text-editor_20250124.ts
|
|
7346
7746
|
import {
|
|
7347
7747
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
|
|
7348
7748
|
lazySchema as lazySchema24,
|
|
7349
7749
|
zodSchema as zodSchema24
|
|
7350
7750
|
} from "@ai-sdk/provider-utils";
|
|
7351
7751
|
import { z as z25 } from "zod/v4";
|
|
7352
|
-
var
|
|
7752
|
+
var textEditor_20241022InputSchema = lazySchema24(
|
|
7353
7753
|
() => zodSchema24(
|
|
7354
7754
|
z25.object({
|
|
7355
7755
|
command: z25.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -7363,22 +7763,22 @@ var textEditor_20250124InputSchema = lazySchema24(
|
|
|
7363
7763
|
})
|
|
7364
7764
|
)
|
|
7365
7765
|
);
|
|
7366
|
-
var
|
|
7367
|
-
id: "anthropic.
|
|
7368
|
-
inputSchema:
|
|
7766
|
+
var textEditor_20241022 = createProviderDefinedToolFactory9({
|
|
7767
|
+
id: "anthropic.text_editor_20241022",
|
|
7768
|
+
inputSchema: textEditor_20241022InputSchema
|
|
7369
7769
|
});
|
|
7370
7770
|
|
|
7371
|
-
// src/tool/text-
|
|
7771
|
+
// src/tool/text-editor_20250124.ts
|
|
7372
7772
|
import {
|
|
7373
7773
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory10,
|
|
7374
7774
|
lazySchema as lazySchema25,
|
|
7375
7775
|
zodSchema as zodSchema25
|
|
7376
7776
|
} from "@ai-sdk/provider-utils";
|
|
7377
7777
|
import { z as z26 } from "zod/v4";
|
|
7378
|
-
var
|
|
7778
|
+
var textEditor_20250124InputSchema = lazySchema25(
|
|
7379
7779
|
() => zodSchema25(
|
|
7380
7780
|
z26.object({
|
|
7381
|
-
command: z26.enum(["view", "create", "str_replace", "insert"]),
|
|
7781
|
+
command: z26.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
7382
7782
|
path: z26.string(),
|
|
7383
7783
|
file_text: z26.string().optional(),
|
|
7384
7784
|
insert_line: z26.number().int().optional(),
|
|
@@ -7389,40 +7789,66 @@ var textEditor_20250429InputSchema = lazySchema25(
|
|
|
7389
7789
|
})
|
|
7390
7790
|
)
|
|
7391
7791
|
);
|
|
7392
|
-
var
|
|
7393
|
-
id: "anthropic.
|
|
7394
|
-
inputSchema:
|
|
7792
|
+
var textEditor_20250124 = createProviderDefinedToolFactory10({
|
|
7793
|
+
id: "anthropic.text_editor_20250124",
|
|
7794
|
+
inputSchema: textEditor_20250124InputSchema
|
|
7395
7795
|
});
|
|
7396
7796
|
|
|
7397
|
-
// src/tool/
|
|
7797
|
+
// src/tool/text-editor_20250429.ts
|
|
7398
7798
|
import {
|
|
7399
|
-
|
|
7799
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory11,
|
|
7400
7800
|
lazySchema as lazySchema26,
|
|
7401
7801
|
zodSchema as zodSchema26
|
|
7402
7802
|
} from "@ai-sdk/provider-utils";
|
|
7403
7803
|
import { z as z27 } from "zod/v4";
|
|
7404
|
-
var
|
|
7804
|
+
var textEditor_20250429InputSchema = lazySchema26(
|
|
7405
7805
|
() => zodSchema26(
|
|
7406
|
-
z27.
|
|
7407
|
-
z27.
|
|
7408
|
-
|
|
7409
|
-
|
|
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()
|
|
7410
7836
|
})
|
|
7411
7837
|
)
|
|
7412
7838
|
)
|
|
7413
7839
|
);
|
|
7414
|
-
var toolSearchBm25_20251119InputSchema =
|
|
7415
|
-
() =>
|
|
7416
|
-
|
|
7840
|
+
var toolSearchBm25_20251119InputSchema = lazySchema27(
|
|
7841
|
+
() => zodSchema27(
|
|
7842
|
+
z28.object({
|
|
7417
7843
|
/**
|
|
7418
7844
|
* A natural language query to search for tools.
|
|
7419
7845
|
* Claude will use BM25 text search to find relevant tools.
|
|
7420
7846
|
*/
|
|
7421
|
-
query:
|
|
7847
|
+
query: z28.string(),
|
|
7422
7848
|
/**
|
|
7423
7849
|
* Maximum number of tools to return. Optional.
|
|
7424
7850
|
*/
|
|
7425
|
-
limit:
|
|
7851
|
+
limit: z28.number().optional()
|
|
7426
7852
|
})
|
|
7427
7853
|
)
|
|
7428
7854
|
);
|
|
@@ -7554,6 +7980,29 @@ var anthropicTools = {
|
|
|
7554
7980
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
7555
7981
|
*/
|
|
7556
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,
|
|
7557
8006
|
/**
|
|
7558
8007
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
7559
8008
|
* Claude can create, read, update, and delete files that persist between sessions,
|
|
@@ -7702,40 +8151,40 @@ import {
|
|
|
7702
8151
|
} from "@ai-sdk/provider-utils";
|
|
7703
8152
|
|
|
7704
8153
|
// src/skills/anthropic-skills-api.ts
|
|
7705
|
-
import { lazySchema as
|
|
7706
|
-
import { z as
|
|
7707
|
-
var anthropicSkillResponseSchema =
|
|
7708
|
-
() =>
|
|
7709
|
-
|
|
7710
|
-
id:
|
|
7711
|
-
display_title:
|
|
7712
|
-
name:
|
|
7713
|
-
description:
|
|
7714
|
-
latest_version:
|
|
7715
|
-
source:
|
|
7716
|
-
created_at:
|
|
7717
|
-
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()
|
|
7718
8167
|
})
|
|
7719
8168
|
)
|
|
7720
8169
|
);
|
|
7721
|
-
var anthropicSkillVersionListResponseSchema =
|
|
7722
|
-
() =>
|
|
7723
|
-
|
|
7724
|
-
data:
|
|
7725
|
-
|
|
7726
|
-
version:
|
|
8170
|
+
var anthropicSkillVersionListResponseSchema = lazySchema28(
|
|
8171
|
+
() => zodSchema28(
|
|
8172
|
+
z29.object({
|
|
8173
|
+
data: z29.array(
|
|
8174
|
+
z29.object({
|
|
8175
|
+
version: z29.string()
|
|
7727
8176
|
})
|
|
7728
8177
|
)
|
|
7729
8178
|
})
|
|
7730
8179
|
)
|
|
7731
8180
|
);
|
|
7732
|
-
var anthropicSkillVersionResponseSchema =
|
|
7733
|
-
() =>
|
|
7734
|
-
|
|
7735
|
-
type:
|
|
7736
|
-
skill_id:
|
|
7737
|
-
name:
|
|
7738
|
-
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()
|
|
7739
8188
|
})
|
|
7740
8189
|
)
|
|
7741
8190
|
);
|
|
@@ -7826,7 +8275,7 @@ var AnthropicSkills = class {
|
|
|
7826
8275
|
};
|
|
7827
8276
|
|
|
7828
8277
|
// src/version.ts
|
|
7829
|
-
var VERSION = true ? "4.0.
|
|
8278
|
+
var VERSION = true ? "4.0.60" : "0.0.0-test";
|
|
7830
8279
|
|
|
7831
8280
|
// src/anthropic-provider.ts
|
|
7832
8281
|
var ANTHROPIC_API_URL = "https://api.anthropic.com";
|