@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/internal/index.js
CHANGED
|
@@ -141,6 +141,20 @@ var anthropicStopDetailsSchema = z3.object({
|
|
|
141
141
|
explanation: z3.string().nullish(),
|
|
142
142
|
recommended_model: z3.string().nullish()
|
|
143
143
|
});
|
|
144
|
+
var anthropicSafeguardResultSchema = z3.object({
|
|
145
|
+
type: z3.string(),
|
|
146
|
+
status: z3.object({
|
|
147
|
+
type: z3.string(),
|
|
148
|
+
tool_uses: z3.record(
|
|
149
|
+
z3.string(),
|
|
150
|
+
z3.object({
|
|
151
|
+
type: z3.string(),
|
|
152
|
+
outcome: z3.string().nullish(),
|
|
153
|
+
explanation: z3.string().nullish()
|
|
154
|
+
})
|
|
155
|
+
).nullish()
|
|
156
|
+
})
|
|
157
|
+
});
|
|
144
158
|
var anthropicToolCallCallerSchema = z3.union([
|
|
145
159
|
z3.object({
|
|
146
160
|
type: z3.literal("code_execution_20250825"),
|
|
@@ -251,7 +265,9 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
251
265
|
name: z3.string(),
|
|
252
266
|
input: z3.unknown(),
|
|
253
267
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
254
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
268
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
269
|
+
// Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
|
|
270
|
+
toolset_name: z3.string().nullish()
|
|
255
271
|
}),
|
|
256
272
|
z3.object({
|
|
257
273
|
type: z3.literal("server_tool_use"),
|
|
@@ -474,6 +490,7 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
474
490
|
stop_sequence: z3.string().nullish(),
|
|
475
491
|
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
476
492
|
input_transformations: z3.array(anthropicInputTransformationSchema).nullish(),
|
|
493
|
+
safeguard_results: z3.array(anthropicSafeguardResultSchema).nullish(),
|
|
477
494
|
usage: z3.looseObject({
|
|
478
495
|
input_tokens: z3.number(),
|
|
479
496
|
output_tokens: z3.number(),
|
|
@@ -553,7 +570,8 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
553
570
|
id: z3.string(),
|
|
554
571
|
name: z3.string(),
|
|
555
572
|
input: z3.unknown(),
|
|
556
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
573
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
574
|
+
toolset_name: z3.string().nullish()
|
|
557
575
|
})
|
|
558
576
|
])
|
|
559
577
|
).nullish(),
|
|
@@ -584,7 +602,9 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
584
602
|
// Programmatic tool calling: input may be present directly for deferred tool calls
|
|
585
603
|
input: z3.record(z3.string(), z3.unknown()).optional(),
|
|
586
604
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
587
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
605
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
606
|
+
// Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
|
|
607
|
+
toolset_name: z3.string().nullish()
|
|
588
608
|
}),
|
|
589
609
|
z3.object({
|
|
590
610
|
type: z3.literal("redacted_thinking"),
|
|
@@ -857,6 +877,7 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
857
877
|
stop_reason: z3.string().nullish(),
|
|
858
878
|
stop_sequence: z3.string().nullish(),
|
|
859
879
|
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
880
|
+
safeguard_results: z3.array(anthropicSafeguardResultSchema).nullish(),
|
|
860
881
|
container: z3.object({
|
|
861
882
|
expires_at: z3.string(),
|
|
862
883
|
id: z3.string(),
|
|
@@ -976,8 +997,8 @@ var anthropicSystemMessageProviderOptions = z4.object({
|
|
|
976
997
|
clearAt: z4.literal("next_user_message").optional(),
|
|
977
998
|
/**
|
|
978
999
|
* Sets the model effort for the turn that follows this mid-conversation
|
|
979
|
-
* system message. The required `mid-conversation-
|
|
980
|
-
* is added automatically.
|
|
1000
|
+
* system message. The required `mid-conversation-output-config-2026-07-01`
|
|
1001
|
+
* beta is added automatically.
|
|
981
1002
|
*/
|
|
982
1003
|
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
983
1004
|
/**
|
|
@@ -1027,6 +1048,11 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1027
1048
|
*
|
|
1028
1049
|
* When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
|
|
1029
1050
|
* Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
|
|
1051
|
+
*
|
|
1052
|
+
* Models that always use adaptive thinking (e.g. `claude-opus-5-5`,
|
|
1053
|
+
* `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
|
|
1054
|
+
* provider drops the unsupported setting, emits a warning, and sends an
|
|
1055
|
+
* adaptive thinking request. Use `effort` to control how much they think.
|
|
1030
1056
|
*/
|
|
1031
1057
|
thinking: z4.union([
|
|
1032
1058
|
z4.discriminatedUnion("type", [
|
|
@@ -1139,7 +1165,11 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1139
1165
|
*/
|
|
1140
1166
|
toolStreaming: z4.boolean().optional(),
|
|
1141
1167
|
/**
|
|
1142
|
-
*
|
|
1168
|
+
* Controls how much effort the model spends on thinking, text responses,
|
|
1169
|
+
* and tool calls. On models that always use adaptive thinking
|
|
1170
|
+
* (e.g. `claude-opus-5-5`), effort is the main lever for latency and cost.
|
|
1171
|
+
*
|
|
1172
|
+
* The API default is `high` for most models and `medium` for `claude-opus-5-5`.
|
|
1143
1173
|
*/
|
|
1144
1174
|
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
1145
1175
|
/**
|
|
@@ -1205,6 +1235,22 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1205
1235
|
* Allow a provider to receive the full `betas` set if it needs it.
|
|
1206
1236
|
*/
|
|
1207
1237
|
anthropicBeta: z4.array(z4.string()).optional(),
|
|
1238
|
+
/**
|
|
1239
|
+
* Server-side safeguards to run as part of the request.
|
|
1240
|
+
*
|
|
1241
|
+
* `dangerous_tool_use` asks the API to classify every `tool_use` block in
|
|
1242
|
+
* the response for dangerous actions (the check Claude Code's auto mode
|
|
1243
|
+
* relies on). The per-call verdicts are returned in
|
|
1244
|
+
* `providerMetadata.anthropic.safeguardResults`, keyed by tool call id.
|
|
1245
|
+
* `classifierContext` is passed through to the API as `classifier_context`.
|
|
1246
|
+
* The `dangerous-tool-use-2026-09-03` beta is added automatically.
|
|
1247
|
+
*/
|
|
1248
|
+
safeguards: z4.array(
|
|
1249
|
+
z4.object({
|
|
1250
|
+
type: z4.literal("dangerous_tool_use"),
|
|
1251
|
+
classifierContext: z4.record(z4.string(), z4.unknown()).optional()
|
|
1252
|
+
})
|
|
1253
|
+
).optional(),
|
|
1208
1254
|
contextManagement: z4.object({
|
|
1209
1255
|
edits: z4.array(
|
|
1210
1256
|
z4.discriminatedUnion("type", [
|
|
@@ -1355,104 +1401,114 @@ var advisor_20260301 = (args) => {
|
|
|
1355
1401
|
return factory(args);
|
|
1356
1402
|
};
|
|
1357
1403
|
|
|
1358
|
-
// src/tool/
|
|
1404
|
+
// src/tool/computer-toolset_20260801.ts
|
|
1359
1405
|
import {
|
|
1360
1406
|
createProviderDefinedToolFactory,
|
|
1361
1407
|
lazySchema as lazySchema5,
|
|
1362
1408
|
zodSchema as zodSchema5
|
|
1363
1409
|
} from "@ai-sdk/provider-utils";
|
|
1364
1410
|
import { z as z6 } from "zod/v4";
|
|
1365
|
-
var
|
|
1411
|
+
var computerToolset_20260801Members = [
|
|
1412
|
+
"screenshot",
|
|
1413
|
+
"zoom",
|
|
1414
|
+
"left_click",
|
|
1415
|
+
"right_click",
|
|
1416
|
+
"middle_click",
|
|
1417
|
+
"double_click",
|
|
1418
|
+
"triple_click",
|
|
1419
|
+
"left_click_drag",
|
|
1420
|
+
"mouse_move",
|
|
1421
|
+
"left_mouse_down",
|
|
1422
|
+
"left_mouse_up",
|
|
1423
|
+
"cursor_position",
|
|
1424
|
+
"scroll",
|
|
1425
|
+
"type",
|
|
1426
|
+
"key",
|
|
1427
|
+
"hold_key",
|
|
1428
|
+
"wait"
|
|
1429
|
+
];
|
|
1430
|
+
var computerToolset_20260801InputSchema = lazySchema5(
|
|
1366
1431
|
() => zodSchema5(
|
|
1367
1432
|
z6.object({
|
|
1368
|
-
|
|
1433
|
+
action: z6.enum(computerToolset_20260801Members),
|
|
1434
|
+
coordinate: z6.tuple([z6.number().int(), z6.number().int()]).optional(),
|
|
1435
|
+
duration: z6.number().optional(),
|
|
1436
|
+
region: z6.tuple([
|
|
1437
|
+
z6.number().int(),
|
|
1438
|
+
z6.number().int(),
|
|
1439
|
+
z6.number().int(),
|
|
1440
|
+
z6.number().int()
|
|
1441
|
+
]).optional(),
|
|
1442
|
+
repeat: z6.number().int().optional(),
|
|
1443
|
+
scroll_amount: z6.number().optional(),
|
|
1444
|
+
scroll_direction: z6.enum(["up", "down", "left", "right"]).optional(),
|
|
1445
|
+
start_coordinate: z6.tuple([z6.number().int(), z6.number().int()]).optional(),
|
|
1446
|
+
text: z6.string().optional()
|
|
1369
1447
|
})
|
|
1370
1448
|
)
|
|
1371
1449
|
);
|
|
1372
|
-
var
|
|
1450
|
+
var computerToolset_20260801ArgsSchema = lazySchema5(
|
|
1373
1451
|
() => zodSchema5(
|
|
1374
1452
|
z6.object({
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
view_range: z6.array(z6.number().int()).optional()
|
|
1453
|
+
configs: z6.partialRecord(
|
|
1454
|
+
z6.enum(computerToolset_20260801Members),
|
|
1455
|
+
z6.object({
|
|
1456
|
+
enabled: z6.boolean().optional(),
|
|
1457
|
+
deferLoading: z6.boolean().optional()
|
|
1458
|
+
})
|
|
1459
|
+
).optional()
|
|
1383
1460
|
})
|
|
1384
1461
|
)
|
|
1385
1462
|
);
|
|
1386
|
-
var
|
|
1387
|
-
id: "anthropic.
|
|
1388
|
-
inputSchema:
|
|
1463
|
+
var computerToolset_20260801 = createProviderDefinedToolFactory({
|
|
1464
|
+
id: "anthropic.computer_toolset_20260801",
|
|
1465
|
+
inputSchema: computerToolset_20260801InputSchema
|
|
1389
1466
|
});
|
|
1390
|
-
var textEditor_20250728 = (args = {}) => {
|
|
1391
|
-
return factory2(args);
|
|
1392
|
-
};
|
|
1393
1467
|
|
|
1394
|
-
// src/tool/
|
|
1468
|
+
// src/tool/text-editor_20250728.ts
|
|
1395
1469
|
import {
|
|
1396
|
-
|
|
1470
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
|
|
1397
1471
|
lazySchema as lazySchema6,
|
|
1398
1472
|
zodSchema as zodSchema6
|
|
1399
1473
|
} from "@ai-sdk/provider-utils";
|
|
1400
1474
|
import { z as z7 } from "zod/v4";
|
|
1401
|
-
var
|
|
1475
|
+
var textEditor_20250728ArgsSchema = lazySchema6(
|
|
1402
1476
|
() => zodSchema6(
|
|
1403
1477
|
z7.object({
|
|
1404
|
-
|
|
1405
|
-
allowedDomains: z7.array(z7.string()).optional(),
|
|
1406
|
-
blockedDomains: z7.array(z7.string()).optional(),
|
|
1407
|
-
userLocation: z7.object({
|
|
1408
|
-
type: z7.literal("approximate"),
|
|
1409
|
-
city: z7.string().optional(),
|
|
1410
|
-
region: z7.string().optional(),
|
|
1411
|
-
country: z7.string().optional(),
|
|
1412
|
-
timezone: z7.string().optional()
|
|
1413
|
-
}).optional(),
|
|
1414
|
-
responseInclusion: z7.enum(["full", "excluded"]).optional()
|
|
1478
|
+
maxCharacters: z7.number().optional()
|
|
1415
1479
|
})
|
|
1416
1480
|
)
|
|
1417
1481
|
);
|
|
1418
|
-
var
|
|
1419
|
-
() => zodSchema6(
|
|
1420
|
-
z7.array(
|
|
1421
|
-
z7.object({
|
|
1422
|
-
url: z7.string(),
|
|
1423
|
-
title: z7.string().nullable(),
|
|
1424
|
-
pageAge: z7.string().nullable(),
|
|
1425
|
-
encryptedContent: z7.string(),
|
|
1426
|
-
type: z7.literal("web_search_result")
|
|
1427
|
-
})
|
|
1428
|
-
)
|
|
1429
|
-
)
|
|
1430
|
-
);
|
|
1431
|
-
var webSearch_20260318InputSchema = lazySchema6(
|
|
1482
|
+
var textEditor_20250728InputSchema = lazySchema6(
|
|
1432
1483
|
() => zodSchema6(
|
|
1433
1484
|
z7.object({
|
|
1434
|
-
|
|
1485
|
+
command: z7.enum(["view", "create", "str_replace", "insert"]),
|
|
1486
|
+
path: z7.string(),
|
|
1487
|
+
file_text: z7.string().optional(),
|
|
1488
|
+
insert_line: z7.number().int().optional(),
|
|
1489
|
+
new_str: z7.string().optional(),
|
|
1490
|
+
insert_text: z7.string().optional(),
|
|
1491
|
+
old_str: z7.string().optional(),
|
|
1492
|
+
view_range: z7.array(z7.number().int()).optional()
|
|
1435
1493
|
})
|
|
1436
1494
|
)
|
|
1437
1495
|
);
|
|
1438
|
-
var
|
|
1439
|
-
id: "anthropic.
|
|
1440
|
-
inputSchema:
|
|
1441
|
-
outputSchema: webSearch_20260318OutputSchema,
|
|
1442
|
-
supportsDeferredResults: true
|
|
1496
|
+
var factory2 = createProviderDefinedToolFactory2({
|
|
1497
|
+
id: "anthropic.text_editor_20250728",
|
|
1498
|
+
inputSchema: textEditor_20250728InputSchema
|
|
1443
1499
|
});
|
|
1444
|
-
var
|
|
1445
|
-
return
|
|
1500
|
+
var textEditor_20250728 = (args = {}) => {
|
|
1501
|
+
return factory2(args);
|
|
1446
1502
|
};
|
|
1447
1503
|
|
|
1448
|
-
// src/tool/web-
|
|
1504
|
+
// src/tool/web-search_20260318.ts
|
|
1449
1505
|
import {
|
|
1450
|
-
createProviderExecutedToolFactory as
|
|
1506
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
|
|
1451
1507
|
lazySchema as lazySchema7,
|
|
1452
1508
|
zodSchema as zodSchema7
|
|
1453
1509
|
} from "@ai-sdk/provider-utils";
|
|
1454
1510
|
import { z as z8 } from "zod/v4";
|
|
1455
|
-
var
|
|
1511
|
+
var webSearch_20260318ArgsSchema = lazySchema7(
|
|
1456
1512
|
() => zodSchema7(
|
|
1457
1513
|
z8.object({
|
|
1458
1514
|
maxUses: z8.number().optional(),
|
|
@@ -1464,11 +1520,12 @@ var webSearch_20260209ArgsSchema = lazySchema7(
|
|
|
1464
1520
|
region: z8.string().optional(),
|
|
1465
1521
|
country: z8.string().optional(),
|
|
1466
1522
|
timezone: z8.string().optional()
|
|
1467
|
-
}).optional()
|
|
1523
|
+
}).optional(),
|
|
1524
|
+
responseInclusion: z8.enum(["full", "excluded"]).optional()
|
|
1468
1525
|
})
|
|
1469
1526
|
)
|
|
1470
1527
|
);
|
|
1471
|
-
var
|
|
1528
|
+
var webSearch_20260318OutputSchema = lazySchema7(
|
|
1472
1529
|
() => zodSchema7(
|
|
1473
1530
|
z8.array(
|
|
1474
1531
|
z8.object({
|
|
@@ -1481,31 +1538,31 @@ var webSearch_20260209OutputSchema = lazySchema7(
|
|
|
1481
1538
|
)
|
|
1482
1539
|
)
|
|
1483
1540
|
);
|
|
1484
|
-
var
|
|
1541
|
+
var webSearch_20260318InputSchema = lazySchema7(
|
|
1485
1542
|
() => zodSchema7(
|
|
1486
1543
|
z8.object({
|
|
1487
1544
|
query: z8.string()
|
|
1488
1545
|
})
|
|
1489
1546
|
)
|
|
1490
1547
|
);
|
|
1491
|
-
var
|
|
1492
|
-
id: "anthropic.
|
|
1493
|
-
inputSchema:
|
|
1494
|
-
outputSchema:
|
|
1548
|
+
var factory3 = createProviderExecutedToolFactory2({
|
|
1549
|
+
id: "anthropic.web_search_20260318",
|
|
1550
|
+
inputSchema: webSearch_20260318InputSchema,
|
|
1551
|
+
outputSchema: webSearch_20260318OutputSchema,
|
|
1495
1552
|
supportsDeferredResults: true
|
|
1496
1553
|
});
|
|
1497
|
-
var
|
|
1498
|
-
return
|
|
1554
|
+
var webSearch_20260318 = (args = {}) => {
|
|
1555
|
+
return factory3(args);
|
|
1499
1556
|
};
|
|
1500
1557
|
|
|
1501
|
-
// src/tool/web-
|
|
1558
|
+
// src/tool/web-search_20260209.ts
|
|
1502
1559
|
import {
|
|
1503
|
-
createProviderExecutedToolFactory as
|
|
1560
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
|
|
1504
1561
|
lazySchema as lazySchema8,
|
|
1505
1562
|
zodSchema as zodSchema8
|
|
1506
1563
|
} from "@ai-sdk/provider-utils";
|
|
1507
1564
|
import { z as z9 } from "zod/v4";
|
|
1508
|
-
var
|
|
1565
|
+
var webSearch_20260209ArgsSchema = lazySchema8(
|
|
1509
1566
|
() => zodSchema8(
|
|
1510
1567
|
z9.object({
|
|
1511
1568
|
maxUses: z9.number().optional(),
|
|
@@ -1521,7 +1578,7 @@ var webSearch_20250305ArgsSchema = lazySchema8(
|
|
|
1521
1578
|
})
|
|
1522
1579
|
)
|
|
1523
1580
|
);
|
|
1524
|
-
var
|
|
1581
|
+
var webSearch_20260209OutputSchema = lazySchema8(
|
|
1525
1582
|
() => zodSchema8(
|
|
1526
1583
|
z9.array(
|
|
1527
1584
|
z9.object({
|
|
@@ -1534,105 +1591,97 @@ var webSearch_20250305OutputSchema = lazySchema8(
|
|
|
1534
1591
|
)
|
|
1535
1592
|
)
|
|
1536
1593
|
);
|
|
1537
|
-
var
|
|
1594
|
+
var webSearch_20260209InputSchema = lazySchema8(
|
|
1538
1595
|
() => zodSchema8(
|
|
1539
1596
|
z9.object({
|
|
1540
1597
|
query: z9.string()
|
|
1541
1598
|
})
|
|
1542
1599
|
)
|
|
1543
1600
|
);
|
|
1544
|
-
var
|
|
1545
|
-
id: "anthropic.
|
|
1546
|
-
inputSchema:
|
|
1547
|
-
outputSchema:
|
|
1601
|
+
var factory4 = createProviderExecutedToolFactory3({
|
|
1602
|
+
id: "anthropic.web_search_20260209",
|
|
1603
|
+
inputSchema: webSearch_20260209InputSchema,
|
|
1604
|
+
outputSchema: webSearch_20260209OutputSchema,
|
|
1548
1605
|
supportsDeferredResults: true
|
|
1549
1606
|
});
|
|
1550
|
-
var
|
|
1551
|
-
return
|
|
1607
|
+
var webSearch_20260209 = (args = {}) => {
|
|
1608
|
+
return factory4(args);
|
|
1552
1609
|
};
|
|
1553
1610
|
|
|
1554
|
-
// src/tool/web-
|
|
1611
|
+
// src/tool/web-search_20250305.ts
|
|
1555
1612
|
import {
|
|
1556
|
-
createProviderExecutedToolFactory as
|
|
1613
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
|
|
1557
1614
|
lazySchema as lazySchema9,
|
|
1558
1615
|
zodSchema as zodSchema9
|
|
1559
1616
|
} from "@ai-sdk/provider-utils";
|
|
1560
1617
|
import { z as z10 } from "zod/v4";
|
|
1561
|
-
var
|
|
1618
|
+
var webSearch_20250305ArgsSchema = lazySchema9(
|
|
1562
1619
|
() => zodSchema9(
|
|
1563
1620
|
z10.object({
|
|
1564
1621
|
maxUses: z10.number().optional(),
|
|
1565
1622
|
allowedDomains: z10.array(z10.string()).optional(),
|
|
1566
1623
|
blockedDomains: z10.array(z10.string()).optional(),
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1624
|
+
userLocation: z10.object({
|
|
1625
|
+
type: z10.literal("approximate"),
|
|
1626
|
+
city: z10.string().optional(),
|
|
1627
|
+
region: z10.string().optional(),
|
|
1628
|
+
country: z10.string().optional(),
|
|
1629
|
+
timezone: z10.string().optional()
|
|
1630
|
+
}).optional()
|
|
1571
1631
|
})
|
|
1572
1632
|
)
|
|
1573
1633
|
);
|
|
1574
|
-
var
|
|
1634
|
+
var webSearch_20250305OutputSchema = lazySchema9(
|
|
1575
1635
|
() => zodSchema9(
|
|
1576
|
-
z10.
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
content: z10.object({
|
|
1580
|
-
type: z10.literal("document"),
|
|
1636
|
+
z10.array(
|
|
1637
|
+
z10.object({
|
|
1638
|
+
url: z10.string(),
|
|
1581
1639
|
title: z10.string().nullable(),
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
data: z10.string()
|
|
1588
|
-
}),
|
|
1589
|
-
z10.object({
|
|
1590
|
-
type: z10.literal("text"),
|
|
1591
|
-
mediaType: z10.literal("text/plain"),
|
|
1592
|
-
data: z10.string()
|
|
1593
|
-
})
|
|
1594
|
-
])
|
|
1595
|
-
}),
|
|
1596
|
-
retrievedAt: z10.string().nullable()
|
|
1597
|
-
})
|
|
1640
|
+
pageAge: z10.string().nullable(),
|
|
1641
|
+
encryptedContent: z10.string(),
|
|
1642
|
+
type: z10.literal("web_search_result")
|
|
1643
|
+
})
|
|
1644
|
+
)
|
|
1598
1645
|
)
|
|
1599
1646
|
);
|
|
1600
|
-
var
|
|
1647
|
+
var webSearch_20250305InputSchema = lazySchema9(
|
|
1601
1648
|
() => zodSchema9(
|
|
1602
1649
|
z10.object({
|
|
1603
|
-
|
|
1650
|
+
query: z10.string()
|
|
1604
1651
|
})
|
|
1605
1652
|
)
|
|
1606
1653
|
);
|
|
1607
|
-
var
|
|
1608
|
-
id: "anthropic.
|
|
1609
|
-
inputSchema:
|
|
1610
|
-
outputSchema:
|
|
1654
|
+
var factory5 = createProviderExecutedToolFactory4({
|
|
1655
|
+
id: "anthropic.web_search_20250305",
|
|
1656
|
+
inputSchema: webSearch_20250305InputSchema,
|
|
1657
|
+
outputSchema: webSearch_20250305OutputSchema,
|
|
1611
1658
|
supportsDeferredResults: true
|
|
1612
1659
|
});
|
|
1613
|
-
var
|
|
1614
|
-
return
|
|
1660
|
+
var webSearch_20250305 = (args = {}) => {
|
|
1661
|
+
return factory5(args);
|
|
1615
1662
|
};
|
|
1616
1663
|
|
|
1617
|
-
// src/tool/web-fetch-
|
|
1664
|
+
// src/tool/web-fetch-20260318.ts
|
|
1618
1665
|
import {
|
|
1619
|
-
createProviderExecutedToolFactory as
|
|
1666
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
1620
1667
|
lazySchema as lazySchema10,
|
|
1621
1668
|
zodSchema as zodSchema10
|
|
1622
1669
|
} from "@ai-sdk/provider-utils";
|
|
1623
1670
|
import { z as z11 } from "zod/v4";
|
|
1624
|
-
var
|
|
1671
|
+
var webFetch_20260318ArgsSchema = lazySchema10(
|
|
1625
1672
|
() => zodSchema10(
|
|
1626
1673
|
z11.object({
|
|
1627
1674
|
maxUses: z11.number().optional(),
|
|
1628
1675
|
allowedDomains: z11.array(z11.string()).optional(),
|
|
1629
1676
|
blockedDomains: z11.array(z11.string()).optional(),
|
|
1630
1677
|
citations: z11.object({ enabled: z11.boolean() }).optional(),
|
|
1631
|
-
maxContentTokens: z11.number().optional()
|
|
1678
|
+
maxContentTokens: z11.number().optional(),
|
|
1679
|
+
useCache: z11.boolean().optional(),
|
|
1680
|
+
responseInclusion: z11.enum(["full", "excluded"]).optional()
|
|
1632
1681
|
})
|
|
1633
1682
|
)
|
|
1634
1683
|
);
|
|
1635
|
-
var
|
|
1684
|
+
var webFetch_20260318OutputSchema = lazySchema10(
|
|
1636
1685
|
() => zodSchema10(
|
|
1637
1686
|
z11.object({
|
|
1638
1687
|
type: z11.literal("web_fetch_result"),
|
|
@@ -1658,31 +1707,31 @@ var webFetch_20260209OutputSchema = lazySchema10(
|
|
|
1658
1707
|
})
|
|
1659
1708
|
)
|
|
1660
1709
|
);
|
|
1661
|
-
var
|
|
1710
|
+
var webFetch_20260318InputSchema = lazySchema10(
|
|
1662
1711
|
() => zodSchema10(
|
|
1663
1712
|
z11.object({
|
|
1664
1713
|
url: z11.string()
|
|
1665
1714
|
})
|
|
1666
1715
|
)
|
|
1667
1716
|
);
|
|
1668
|
-
var
|
|
1669
|
-
id: "anthropic.
|
|
1670
|
-
inputSchema:
|
|
1671
|
-
outputSchema:
|
|
1717
|
+
var factory6 = createProviderExecutedToolFactory5({
|
|
1718
|
+
id: "anthropic.web_fetch_20260318",
|
|
1719
|
+
inputSchema: webFetch_20260318InputSchema,
|
|
1720
|
+
outputSchema: webFetch_20260318OutputSchema,
|
|
1672
1721
|
supportsDeferredResults: true
|
|
1673
1722
|
});
|
|
1674
|
-
var
|
|
1675
|
-
return
|
|
1723
|
+
var webFetch_20260318 = (args = {}) => {
|
|
1724
|
+
return factory6(args);
|
|
1676
1725
|
};
|
|
1677
1726
|
|
|
1678
|
-
// src/tool/web-fetch-
|
|
1727
|
+
// src/tool/web-fetch-20260209.ts
|
|
1679
1728
|
import {
|
|
1680
|
-
createProviderExecutedToolFactory as
|
|
1729
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
|
|
1681
1730
|
lazySchema as lazySchema11,
|
|
1682
1731
|
zodSchema as zodSchema11
|
|
1683
1732
|
} from "@ai-sdk/provider-utils";
|
|
1684
1733
|
import { z as z12 } from "zod/v4";
|
|
1685
|
-
var
|
|
1734
|
+
var webFetch_20260209ArgsSchema = lazySchema11(
|
|
1686
1735
|
() => zodSchema11(
|
|
1687
1736
|
z12.object({
|
|
1688
1737
|
maxUses: z12.number().optional(),
|
|
@@ -1693,7 +1742,7 @@ var webFetch_20250910ArgsSchema = lazySchema11(
|
|
|
1693
1742
|
})
|
|
1694
1743
|
)
|
|
1695
1744
|
);
|
|
1696
|
-
var
|
|
1745
|
+
var webFetch_20260209OutputSchema = lazySchema11(
|
|
1697
1746
|
() => zodSchema11(
|
|
1698
1747
|
z12.object({
|
|
1699
1748
|
type: z12.literal("web_fetch_result"),
|
|
@@ -1719,13 +1768,74 @@ var webFetch_20250910OutputSchema = lazySchema11(
|
|
|
1719
1768
|
})
|
|
1720
1769
|
)
|
|
1721
1770
|
);
|
|
1722
|
-
var
|
|
1771
|
+
var webFetch_20260209InputSchema = lazySchema11(
|
|
1723
1772
|
() => zodSchema11(
|
|
1724
1773
|
z12.object({
|
|
1725
1774
|
url: z12.string()
|
|
1726
1775
|
})
|
|
1727
1776
|
)
|
|
1728
1777
|
);
|
|
1778
|
+
var factory7 = createProviderExecutedToolFactory6({
|
|
1779
|
+
id: "anthropic.web_fetch_20260209",
|
|
1780
|
+
inputSchema: webFetch_20260209InputSchema,
|
|
1781
|
+
outputSchema: webFetch_20260209OutputSchema,
|
|
1782
|
+
supportsDeferredResults: true
|
|
1783
|
+
});
|
|
1784
|
+
var webFetch_20260209 = (args = {}) => {
|
|
1785
|
+
return factory7(args);
|
|
1786
|
+
};
|
|
1787
|
+
|
|
1788
|
+
// src/tool/web-fetch-20250910.ts
|
|
1789
|
+
import {
|
|
1790
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
|
|
1791
|
+
lazySchema as lazySchema12,
|
|
1792
|
+
zodSchema as zodSchema12
|
|
1793
|
+
} from "@ai-sdk/provider-utils";
|
|
1794
|
+
import { z as z13 } from "zod/v4";
|
|
1795
|
+
var webFetch_20250910ArgsSchema = lazySchema12(
|
|
1796
|
+
() => zodSchema12(
|
|
1797
|
+
z13.object({
|
|
1798
|
+
maxUses: z13.number().optional(),
|
|
1799
|
+
allowedDomains: z13.array(z13.string()).optional(),
|
|
1800
|
+
blockedDomains: z13.array(z13.string()).optional(),
|
|
1801
|
+
citations: z13.object({ enabled: z13.boolean() }).optional(),
|
|
1802
|
+
maxContentTokens: z13.number().optional()
|
|
1803
|
+
})
|
|
1804
|
+
)
|
|
1805
|
+
);
|
|
1806
|
+
var webFetch_20250910OutputSchema = lazySchema12(
|
|
1807
|
+
() => zodSchema12(
|
|
1808
|
+
z13.object({
|
|
1809
|
+
type: z13.literal("web_fetch_result"),
|
|
1810
|
+
url: z13.string(),
|
|
1811
|
+
content: z13.object({
|
|
1812
|
+
type: z13.literal("document"),
|
|
1813
|
+
title: z13.string().nullable(),
|
|
1814
|
+
citations: z13.object({ enabled: z13.boolean() }).optional(),
|
|
1815
|
+
source: z13.union([
|
|
1816
|
+
z13.object({
|
|
1817
|
+
type: z13.literal("base64"),
|
|
1818
|
+
mediaType: z13.literal("application/pdf"),
|
|
1819
|
+
data: z13.string()
|
|
1820
|
+
}),
|
|
1821
|
+
z13.object({
|
|
1822
|
+
type: z13.literal("text"),
|
|
1823
|
+
mediaType: z13.literal("text/plain"),
|
|
1824
|
+
data: z13.string()
|
|
1825
|
+
})
|
|
1826
|
+
])
|
|
1827
|
+
}),
|
|
1828
|
+
retrievedAt: z13.string().nullable()
|
|
1829
|
+
})
|
|
1830
|
+
)
|
|
1831
|
+
);
|
|
1832
|
+
var webFetch_20250910InputSchema = lazySchema12(
|
|
1833
|
+
() => zodSchema12(
|
|
1834
|
+
z13.object({
|
|
1835
|
+
url: z13.string()
|
|
1836
|
+
})
|
|
1837
|
+
)
|
|
1838
|
+
);
|
|
1729
1839
|
var factory8 = createProviderExecutedToolFactory7({
|
|
1730
1840
|
id: "anthropic.web_fetch_20250910",
|
|
1731
1841
|
inputSchema: webFetch_20250910InputSchema,
|
|
@@ -1745,7 +1855,8 @@ async function prepareTools({
|
|
|
1745
1855
|
cacheControlValidator,
|
|
1746
1856
|
supportsStructuredOutput,
|
|
1747
1857
|
supportsStrictTools,
|
|
1748
|
-
defaultEagerInputStreaming = false
|
|
1858
|
+
defaultEagerInputStreaming = false,
|
|
1859
|
+
rejectsForcedToolUse = false
|
|
1749
1860
|
}) {
|
|
1750
1861
|
var _a, _b;
|
|
1751
1862
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
@@ -1848,6 +1959,31 @@ async function prepareTools({
|
|
|
1848
1959
|
});
|
|
1849
1960
|
break;
|
|
1850
1961
|
}
|
|
1962
|
+
case "anthropic.computer_toolset_20260801": {
|
|
1963
|
+
const args = await validateTypes({
|
|
1964
|
+
value: tool.args,
|
|
1965
|
+
schema: computerToolset_20260801ArgsSchema
|
|
1966
|
+
});
|
|
1967
|
+
const configs = args.configs != null ? Object.fromEntries(
|
|
1968
|
+
Object.entries(args.configs).map(([member, config]) => [
|
|
1969
|
+
member,
|
|
1970
|
+
{
|
|
1971
|
+
...(config == null ? void 0 : config.enabled) != null && {
|
|
1972
|
+
enabled: config.enabled
|
|
1973
|
+
},
|
|
1974
|
+
...(config == null ? void 0 : config.deferLoading) != null && {
|
|
1975
|
+
defer_loading: config.deferLoading
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
])
|
|
1979
|
+
) : void 0;
|
|
1980
|
+
anthropicTools2.push({
|
|
1981
|
+
type: "computer_toolset_20260801",
|
|
1982
|
+
...configs != null && { configs },
|
|
1983
|
+
cache_control: void 0
|
|
1984
|
+
});
|
|
1985
|
+
break;
|
|
1986
|
+
}
|
|
1851
1987
|
case "anthropic.computer_20241022": {
|
|
1852
1988
|
betas.add("computer-use-2024-10-22");
|
|
1853
1989
|
anthropicTools2.push({
|
|
@@ -2103,6 +2239,22 @@ async function prepareTools({
|
|
|
2103
2239
|
betas
|
|
2104
2240
|
};
|
|
2105
2241
|
case "required":
|
|
2242
|
+
if (rejectsForcedToolUse) {
|
|
2243
|
+
toolWarnings.push({
|
|
2244
|
+
type: "unsupported",
|
|
2245
|
+
feature: "toolChoice",
|
|
2246
|
+
details: `toolChoice 'required' is not supported by this model because it rejects forced tool use. Using 'auto' instead. Instruct the model to use a tool in the prompt and verify that a tool call was made.`
|
|
2247
|
+
});
|
|
2248
|
+
return {
|
|
2249
|
+
tools: anthropicTools2,
|
|
2250
|
+
toolChoice: {
|
|
2251
|
+
type: "auto",
|
|
2252
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
2253
|
+
},
|
|
2254
|
+
toolWarnings,
|
|
2255
|
+
betas
|
|
2256
|
+
};
|
|
2257
|
+
}
|
|
2106
2258
|
return {
|
|
2107
2259
|
tools: anthropicTools2,
|
|
2108
2260
|
toolChoice: {
|
|
@@ -2115,6 +2267,24 @@ async function prepareTools({
|
|
|
2115
2267
|
case "none":
|
|
2116
2268
|
return { tools: void 0, toolChoice: void 0, toolWarnings, betas };
|
|
2117
2269
|
case "tool":
|
|
2270
|
+
if (rejectsForcedToolUse) {
|
|
2271
|
+
toolWarnings.push({
|
|
2272
|
+
type: "unsupported",
|
|
2273
|
+
feature: "toolChoice",
|
|
2274
|
+
details: `toolChoice 'tool' is not supported by this model because it rejects forced tool use. Only the '${toolChoice.toolName}' tool is sent with 'auto' tool choice. Instruct the model to use the tool in the prompt and verify that a tool call was made.`
|
|
2275
|
+
});
|
|
2276
|
+
return {
|
|
2277
|
+
tools: anthropicTools2.filter(
|
|
2278
|
+
(tool) => "name" in tool && tool.name === toolChoice.toolName
|
|
2279
|
+
),
|
|
2280
|
+
toolChoice: {
|
|
2281
|
+
type: "auto",
|
|
2282
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
2283
|
+
},
|
|
2284
|
+
toolWarnings,
|
|
2285
|
+
betas
|
|
2286
|
+
};
|
|
2287
|
+
}
|
|
2118
2288
|
return {
|
|
2119
2289
|
tools: anthropicTools2,
|
|
2120
2290
|
toolChoice: {
|
|
@@ -2205,30 +2375,30 @@ import {
|
|
|
2205
2375
|
// src/tool/code-execution_20250522.ts
|
|
2206
2376
|
import {
|
|
2207
2377
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory8,
|
|
2208
|
-
lazySchema as
|
|
2209
|
-
zodSchema as
|
|
2378
|
+
lazySchema as lazySchema13,
|
|
2379
|
+
zodSchema as zodSchema13
|
|
2210
2380
|
} from "@ai-sdk/provider-utils";
|
|
2211
|
-
import { z as
|
|
2212
|
-
var codeExecution_20250522OutputSchema =
|
|
2213
|
-
() =>
|
|
2214
|
-
|
|
2215
|
-
type:
|
|
2216
|
-
stdout:
|
|
2217
|
-
stderr:
|
|
2218
|
-
return_code:
|
|
2219
|
-
content:
|
|
2220
|
-
|
|
2221
|
-
type:
|
|
2222
|
-
file_id:
|
|
2381
|
+
import { z as z14 } from "zod/v4";
|
|
2382
|
+
var codeExecution_20250522OutputSchema = lazySchema13(
|
|
2383
|
+
() => zodSchema13(
|
|
2384
|
+
z14.object({
|
|
2385
|
+
type: z14.literal("code_execution_result"),
|
|
2386
|
+
stdout: z14.string(),
|
|
2387
|
+
stderr: z14.string(),
|
|
2388
|
+
return_code: z14.number(),
|
|
2389
|
+
content: z14.array(
|
|
2390
|
+
z14.object({
|
|
2391
|
+
type: z14.literal("code_execution_output"),
|
|
2392
|
+
file_id: z14.string()
|
|
2223
2393
|
})
|
|
2224
2394
|
).optional().default([])
|
|
2225
2395
|
})
|
|
2226
2396
|
)
|
|
2227
2397
|
);
|
|
2228
|
-
var codeExecution_20250522InputSchema =
|
|
2229
|
-
() =>
|
|
2230
|
-
|
|
2231
|
-
code:
|
|
2398
|
+
var codeExecution_20250522InputSchema = lazySchema13(
|
|
2399
|
+
() => zodSchema13(
|
|
2400
|
+
z14.object({
|
|
2401
|
+
code: z14.string()
|
|
2232
2402
|
})
|
|
2233
2403
|
)
|
|
2234
2404
|
);
|
|
@@ -2245,143 +2415,11 @@ var codeExecution_20250522 = (args = {}) => {
|
|
|
2245
2415
|
import {
|
|
2246
2416
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory9,
|
|
2247
2417
|
experimental_toolCaller,
|
|
2248
|
-
lazySchema as lazySchema13,
|
|
2249
|
-
zodSchema as zodSchema13
|
|
2250
|
-
} from "@ai-sdk/provider-utils";
|
|
2251
|
-
import { z as z14 } from "zod/v4";
|
|
2252
|
-
var codeExecution_20250825OutputSchema = lazySchema13(
|
|
2253
|
-
() => zodSchema13(
|
|
2254
|
-
z14.discriminatedUnion("type", [
|
|
2255
|
-
z14.object({
|
|
2256
|
-
type: z14.literal("code_execution_result"),
|
|
2257
|
-
stdout: z14.string(),
|
|
2258
|
-
stderr: z14.string(),
|
|
2259
|
-
return_code: z14.number(),
|
|
2260
|
-
content: z14.array(
|
|
2261
|
-
z14.object({
|
|
2262
|
-
type: z14.literal("code_execution_output"),
|
|
2263
|
-
file_id: z14.string()
|
|
2264
|
-
})
|
|
2265
|
-
).optional().default([])
|
|
2266
|
-
}),
|
|
2267
|
-
z14.object({
|
|
2268
|
-
type: z14.literal("bash_code_execution_result"),
|
|
2269
|
-
content: z14.array(
|
|
2270
|
-
z14.object({
|
|
2271
|
-
type: z14.literal("bash_code_execution_output"),
|
|
2272
|
-
file_id: z14.string()
|
|
2273
|
-
})
|
|
2274
|
-
),
|
|
2275
|
-
stdout: z14.string(),
|
|
2276
|
-
stderr: z14.string(),
|
|
2277
|
-
return_code: z14.number()
|
|
2278
|
-
}),
|
|
2279
|
-
z14.object({
|
|
2280
|
-
type: z14.literal("bash_code_execution_tool_result_error"),
|
|
2281
|
-
error_code: z14.string()
|
|
2282
|
-
}),
|
|
2283
|
-
z14.object({
|
|
2284
|
-
type: z14.literal("text_editor_code_execution_tool_result_error"),
|
|
2285
|
-
error_code: z14.string()
|
|
2286
|
-
}),
|
|
2287
|
-
z14.object({
|
|
2288
|
-
type: z14.literal("text_editor_code_execution_view_result"),
|
|
2289
|
-
content: z14.string(),
|
|
2290
|
-
file_type: z14.string(),
|
|
2291
|
-
num_lines: z14.number().nullable(),
|
|
2292
|
-
start_line: z14.number().nullable(),
|
|
2293
|
-
total_lines: z14.number().nullable()
|
|
2294
|
-
}),
|
|
2295
|
-
z14.object({
|
|
2296
|
-
type: z14.literal("text_editor_code_execution_create_result"),
|
|
2297
|
-
is_file_update: z14.boolean()
|
|
2298
|
-
}),
|
|
2299
|
-
z14.object({
|
|
2300
|
-
type: z14.literal("text_editor_code_execution_str_replace_result"),
|
|
2301
|
-
lines: z14.array(z14.string()).nullable(),
|
|
2302
|
-
new_lines: z14.number().nullable(),
|
|
2303
|
-
new_start: z14.number().nullable(),
|
|
2304
|
-
old_lines: z14.number().nullable(),
|
|
2305
|
-
old_start: z14.number().nullable()
|
|
2306
|
-
})
|
|
2307
|
-
])
|
|
2308
|
-
)
|
|
2309
|
-
);
|
|
2310
|
-
var codeExecution_20250825InputSchema = lazySchema13(
|
|
2311
|
-
() => zodSchema13(
|
|
2312
|
-
z14.discriminatedUnion("type", [
|
|
2313
|
-
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2314
|
-
z14.object({
|
|
2315
|
-
type: z14.literal("programmatic-tool-call"),
|
|
2316
|
-
code: z14.string()
|
|
2317
|
-
}),
|
|
2318
|
-
z14.object({
|
|
2319
|
-
type: z14.literal("bash_code_execution"),
|
|
2320
|
-
command: z14.string()
|
|
2321
|
-
}),
|
|
2322
|
-
z14.discriminatedUnion("command", [
|
|
2323
|
-
z14.object({
|
|
2324
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2325
|
-
command: z14.literal("view"),
|
|
2326
|
-
path: z14.string()
|
|
2327
|
-
}),
|
|
2328
|
-
z14.object({
|
|
2329
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2330
|
-
command: z14.literal("create"),
|
|
2331
|
-
path: z14.string(),
|
|
2332
|
-
file_text: z14.string().nullish()
|
|
2333
|
-
}),
|
|
2334
|
-
z14.object({
|
|
2335
|
-
type: z14.literal("text_editor_code_execution"),
|
|
2336
|
-
command: z14.literal("str_replace"),
|
|
2337
|
-
path: z14.string(),
|
|
2338
|
-
old_str: z14.string(),
|
|
2339
|
-
new_str: z14.string()
|
|
2340
|
-
})
|
|
2341
|
-
])
|
|
2342
|
-
])
|
|
2343
|
-
)
|
|
2344
|
-
);
|
|
2345
|
-
var factory10 = createProviderExecutedToolFactory9({
|
|
2346
|
-
id: "anthropic.code_execution_20250825",
|
|
2347
|
-
inputSchema: codeExecution_20250825InputSchema,
|
|
2348
|
-
outputSchema: codeExecution_20250825OutputSchema,
|
|
2349
|
-
// Programmatic tool calling: tool results may be deferred to a later turn
|
|
2350
|
-
// when code execution triggers a client-executed tool that needs to be
|
|
2351
|
-
// resolved before the code execution result can be returned.
|
|
2352
|
-
supportsDeferredResults: true
|
|
2353
|
-
});
|
|
2354
|
-
var codeExecution_20250825 = (args = {}) => {
|
|
2355
|
-
return experimental_toolCaller(factory10(args), {
|
|
2356
|
-
type: "provider",
|
|
2357
|
-
prepareProviderOptions: (providerOptions) => {
|
|
2358
|
-
var _a;
|
|
2359
|
-
const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
|
|
2360
|
-
return {
|
|
2361
|
-
...providerOptions,
|
|
2362
|
-
anthropic: {
|
|
2363
|
-
...anthropicOptions,
|
|
2364
|
-
allowedCallers: [
|
|
2365
|
-
.../* @__PURE__ */ new Set([
|
|
2366
|
-
...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
|
|
2367
|
-
"code_execution_20250825"
|
|
2368
|
-
])
|
|
2369
|
-
]
|
|
2370
|
-
}
|
|
2371
|
-
};
|
|
2372
|
-
}
|
|
2373
|
-
});
|
|
2374
|
-
};
|
|
2375
|
-
|
|
2376
|
-
// src/tool/code-execution_20260120.ts
|
|
2377
|
-
import {
|
|
2378
|
-
createProviderExecutedToolFactory as createProviderExecutedToolFactory10,
|
|
2379
|
-
experimental_toolCaller as experimental_toolCaller2,
|
|
2380
2418
|
lazySchema as lazySchema14,
|
|
2381
2419
|
zodSchema as zodSchema14
|
|
2382
2420
|
} from "@ai-sdk/provider-utils";
|
|
2383
2421
|
import { z as z15 } from "zod/v4";
|
|
2384
|
-
var
|
|
2422
|
+
var codeExecution_20250825OutputSchema = lazySchema14(
|
|
2385
2423
|
() => zodSchema14(
|
|
2386
2424
|
z15.discriminatedUnion("type", [
|
|
2387
2425
|
z15.object({
|
|
@@ -2396,18 +2434,6 @@ var codeExecution_20260120OutputSchema = lazySchema14(
|
|
|
2396
2434
|
})
|
|
2397
2435
|
).optional().default([])
|
|
2398
2436
|
}),
|
|
2399
|
-
z15.object({
|
|
2400
|
-
type: z15.literal("encrypted_code_execution_result"),
|
|
2401
|
-
encrypted_stdout: z15.string(),
|
|
2402
|
-
stderr: z15.string(),
|
|
2403
|
-
return_code: z15.number(),
|
|
2404
|
-
content: z15.array(
|
|
2405
|
-
z15.object({
|
|
2406
|
-
type: z15.literal("code_execution_output"),
|
|
2407
|
-
file_id: z15.string()
|
|
2408
|
-
})
|
|
2409
|
-
).optional().default([])
|
|
2410
|
-
}),
|
|
2411
2437
|
z15.object({
|
|
2412
2438
|
type: z15.literal("bash_code_execution_result"),
|
|
2413
2439
|
content: z15.array(
|
|
@@ -2451,9 +2477,10 @@ var codeExecution_20260120OutputSchema = lazySchema14(
|
|
|
2451
2477
|
])
|
|
2452
2478
|
)
|
|
2453
2479
|
);
|
|
2454
|
-
var
|
|
2480
|
+
var codeExecution_20250825InputSchema = lazySchema14(
|
|
2455
2481
|
() => zodSchema14(
|
|
2456
2482
|
z15.discriminatedUnion("type", [
|
|
2483
|
+
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2457
2484
|
z15.object({
|
|
2458
2485
|
type: z15.literal("programmatic-tool-call"),
|
|
2459
2486
|
code: z15.string()
|
|
@@ -2485,6 +2512,149 @@ var codeExecution_20260120InputSchema = lazySchema14(
|
|
|
2485
2512
|
])
|
|
2486
2513
|
)
|
|
2487
2514
|
);
|
|
2515
|
+
var factory10 = createProviderExecutedToolFactory9({
|
|
2516
|
+
id: "anthropic.code_execution_20250825",
|
|
2517
|
+
inputSchema: codeExecution_20250825InputSchema,
|
|
2518
|
+
outputSchema: codeExecution_20250825OutputSchema,
|
|
2519
|
+
// Programmatic tool calling: tool results may be deferred to a later turn
|
|
2520
|
+
// when code execution triggers a client-executed tool that needs to be
|
|
2521
|
+
// resolved before the code execution result can be returned.
|
|
2522
|
+
supportsDeferredResults: true
|
|
2523
|
+
});
|
|
2524
|
+
var codeExecution_20250825 = (args = {}) => {
|
|
2525
|
+
return experimental_toolCaller(factory10(args), {
|
|
2526
|
+
type: "provider",
|
|
2527
|
+
prepareProviderOptions: (providerOptions) => {
|
|
2528
|
+
var _a;
|
|
2529
|
+
const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
|
|
2530
|
+
return {
|
|
2531
|
+
...providerOptions,
|
|
2532
|
+
anthropic: {
|
|
2533
|
+
...anthropicOptions,
|
|
2534
|
+
allowedCallers: [
|
|
2535
|
+
.../* @__PURE__ */ new Set([
|
|
2536
|
+
...(_a = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers) != null ? _a : [],
|
|
2537
|
+
"code_execution_20250825"
|
|
2538
|
+
])
|
|
2539
|
+
]
|
|
2540
|
+
}
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
});
|
|
2544
|
+
};
|
|
2545
|
+
|
|
2546
|
+
// src/tool/code-execution_20260120.ts
|
|
2547
|
+
import {
|
|
2548
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory10,
|
|
2549
|
+
experimental_toolCaller as experimental_toolCaller2,
|
|
2550
|
+
lazySchema as lazySchema15,
|
|
2551
|
+
zodSchema as zodSchema15
|
|
2552
|
+
} from "@ai-sdk/provider-utils";
|
|
2553
|
+
import { z as z16 } from "zod/v4";
|
|
2554
|
+
var codeExecution_20260120OutputSchema = lazySchema15(
|
|
2555
|
+
() => zodSchema15(
|
|
2556
|
+
z16.discriminatedUnion("type", [
|
|
2557
|
+
z16.object({
|
|
2558
|
+
type: z16.literal("code_execution_result"),
|
|
2559
|
+
stdout: z16.string(),
|
|
2560
|
+
stderr: z16.string(),
|
|
2561
|
+
return_code: z16.number(),
|
|
2562
|
+
content: z16.array(
|
|
2563
|
+
z16.object({
|
|
2564
|
+
type: z16.literal("code_execution_output"),
|
|
2565
|
+
file_id: z16.string()
|
|
2566
|
+
})
|
|
2567
|
+
).optional().default([])
|
|
2568
|
+
}),
|
|
2569
|
+
z16.object({
|
|
2570
|
+
type: z16.literal("encrypted_code_execution_result"),
|
|
2571
|
+
encrypted_stdout: z16.string(),
|
|
2572
|
+
stderr: z16.string(),
|
|
2573
|
+
return_code: z16.number(),
|
|
2574
|
+
content: z16.array(
|
|
2575
|
+
z16.object({
|
|
2576
|
+
type: z16.literal("code_execution_output"),
|
|
2577
|
+
file_id: z16.string()
|
|
2578
|
+
})
|
|
2579
|
+
).optional().default([])
|
|
2580
|
+
}),
|
|
2581
|
+
z16.object({
|
|
2582
|
+
type: z16.literal("bash_code_execution_result"),
|
|
2583
|
+
content: z16.array(
|
|
2584
|
+
z16.object({
|
|
2585
|
+
type: z16.literal("bash_code_execution_output"),
|
|
2586
|
+
file_id: z16.string()
|
|
2587
|
+
})
|
|
2588
|
+
),
|
|
2589
|
+
stdout: z16.string(),
|
|
2590
|
+
stderr: z16.string(),
|
|
2591
|
+
return_code: z16.number()
|
|
2592
|
+
}),
|
|
2593
|
+
z16.object({
|
|
2594
|
+
type: z16.literal("bash_code_execution_tool_result_error"),
|
|
2595
|
+
error_code: z16.string()
|
|
2596
|
+
}),
|
|
2597
|
+
z16.object({
|
|
2598
|
+
type: z16.literal("text_editor_code_execution_tool_result_error"),
|
|
2599
|
+
error_code: z16.string()
|
|
2600
|
+
}),
|
|
2601
|
+
z16.object({
|
|
2602
|
+
type: z16.literal("text_editor_code_execution_view_result"),
|
|
2603
|
+
content: z16.string(),
|
|
2604
|
+
file_type: z16.string(),
|
|
2605
|
+
num_lines: z16.number().nullable(),
|
|
2606
|
+
start_line: z16.number().nullable(),
|
|
2607
|
+
total_lines: z16.number().nullable()
|
|
2608
|
+
}),
|
|
2609
|
+
z16.object({
|
|
2610
|
+
type: z16.literal("text_editor_code_execution_create_result"),
|
|
2611
|
+
is_file_update: z16.boolean()
|
|
2612
|
+
}),
|
|
2613
|
+
z16.object({
|
|
2614
|
+
type: z16.literal("text_editor_code_execution_str_replace_result"),
|
|
2615
|
+
lines: z16.array(z16.string()).nullable(),
|
|
2616
|
+
new_lines: z16.number().nullable(),
|
|
2617
|
+
new_start: z16.number().nullable(),
|
|
2618
|
+
old_lines: z16.number().nullable(),
|
|
2619
|
+
old_start: z16.number().nullable()
|
|
2620
|
+
})
|
|
2621
|
+
])
|
|
2622
|
+
)
|
|
2623
|
+
);
|
|
2624
|
+
var codeExecution_20260120InputSchema = lazySchema15(
|
|
2625
|
+
() => zodSchema15(
|
|
2626
|
+
z16.discriminatedUnion("type", [
|
|
2627
|
+
z16.object({
|
|
2628
|
+
type: z16.literal("programmatic-tool-call"),
|
|
2629
|
+
code: z16.string()
|
|
2630
|
+
}),
|
|
2631
|
+
z16.object({
|
|
2632
|
+
type: z16.literal("bash_code_execution"),
|
|
2633
|
+
command: z16.string()
|
|
2634
|
+
}),
|
|
2635
|
+
z16.discriminatedUnion("command", [
|
|
2636
|
+
z16.object({
|
|
2637
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2638
|
+
command: z16.literal("view"),
|
|
2639
|
+
path: z16.string()
|
|
2640
|
+
}),
|
|
2641
|
+
z16.object({
|
|
2642
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2643
|
+
command: z16.literal("create"),
|
|
2644
|
+
path: z16.string(),
|
|
2645
|
+
file_text: z16.string().nullish()
|
|
2646
|
+
}),
|
|
2647
|
+
z16.object({
|
|
2648
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2649
|
+
command: z16.literal("str_replace"),
|
|
2650
|
+
path: z16.string(),
|
|
2651
|
+
old_str: z16.string(),
|
|
2652
|
+
new_str: z16.string()
|
|
2653
|
+
})
|
|
2654
|
+
])
|
|
2655
|
+
])
|
|
2656
|
+
)
|
|
2657
|
+
);
|
|
2488
2658
|
var factory11 = createProviderExecutedToolFactory10({
|
|
2489
2659
|
id: "anthropic.code_execution_20260120",
|
|
2490
2660
|
inputSchema: codeExecution_20260120InputSchema,
|
|
@@ -2516,23 +2686,23 @@ var codeExecution_20260120 = (args = {}) => {
|
|
|
2516
2686
|
// src/tool/tool-search-regex_20251119.ts
|
|
2517
2687
|
import {
|
|
2518
2688
|
createProviderExecutedToolFactory as createProviderExecutedToolFactory11,
|
|
2519
|
-
lazySchema as
|
|
2520
|
-
zodSchema as
|
|
2689
|
+
lazySchema as lazySchema16,
|
|
2690
|
+
zodSchema as zodSchema16
|
|
2521
2691
|
} from "@ai-sdk/provider-utils";
|
|
2522
|
-
import { z as
|
|
2523
|
-
var toolSearchRegex_20251119OutputSchema =
|
|
2524
|
-
() =>
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
type:
|
|
2528
|
-
toolName:
|
|
2692
|
+
import { z as z17 } from "zod/v4";
|
|
2693
|
+
var toolSearchRegex_20251119OutputSchema = lazySchema16(
|
|
2694
|
+
() => zodSchema16(
|
|
2695
|
+
z17.array(
|
|
2696
|
+
z17.object({
|
|
2697
|
+
type: z17.literal("tool_reference"),
|
|
2698
|
+
toolName: z17.string()
|
|
2529
2699
|
})
|
|
2530
2700
|
)
|
|
2531
2701
|
)
|
|
2532
2702
|
);
|
|
2533
|
-
var toolSearchRegex_20251119InputSchema =
|
|
2534
|
-
() =>
|
|
2535
|
-
|
|
2703
|
+
var toolSearchRegex_20251119InputSchema = lazySchema16(
|
|
2704
|
+
() => zodSchema16(
|
|
2705
|
+
z17.object({
|
|
2536
2706
|
/**
|
|
2537
2707
|
* A regex pattern to search for tools.
|
|
2538
2708
|
* Uses Python re.search() syntax. Maximum 200 characters.
|
|
@@ -2543,11 +2713,11 @@ var toolSearchRegex_20251119InputSchema = lazySchema15(
|
|
|
2543
2713
|
* - "database.*query|query.*database" - OR patterns for flexibility
|
|
2544
2714
|
* - "(?i)slack" - case-insensitive search
|
|
2545
2715
|
*/
|
|
2546
|
-
pattern:
|
|
2716
|
+
pattern: z17.string(),
|
|
2547
2717
|
/**
|
|
2548
2718
|
* Maximum number of tools to return. Optional.
|
|
2549
2719
|
*/
|
|
2550
|
-
limit:
|
|
2720
|
+
limit: z17.number().optional()
|
|
2551
2721
|
})
|
|
2552
2722
|
)
|
|
2553
2723
|
);
|
|
@@ -2588,7 +2758,8 @@ async function convertToAnthropicPrompt({
|
|
|
2588
2758
|
sendReasoning,
|
|
2589
2759
|
warnings,
|
|
2590
2760
|
cacheControlValidator,
|
|
2591
|
-
toolNameMapping
|
|
2761
|
+
toolNameMapping,
|
|
2762
|
+
toolsetNames = {}
|
|
2592
2763
|
}) {
|
|
2593
2764
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2594
2765
|
const betas = /* @__PURE__ */ new Set();
|
|
@@ -2711,7 +2882,7 @@ async function convertToAnthropicPrompt({
|
|
|
2711
2882
|
betas.add("mid-conversation-system-clear-at-2026-08-21");
|
|
2712
2883
|
}
|
|
2713
2884
|
if (message.effort != null) {
|
|
2714
|
-
betas.add("mid-conversation-
|
|
2885
|
+
betas.add("mid-conversation-output-config-2026-07-01");
|
|
2715
2886
|
}
|
|
2716
2887
|
}
|
|
2717
2888
|
}
|
|
@@ -3011,9 +3182,15 @@ async function convertToAnthropicPrompt({
|
|
|
3011
3182
|
contentValue = JSON.stringify(output.value);
|
|
3012
3183
|
break;
|
|
3013
3184
|
}
|
|
3185
|
+
const toolsetName = getAnthropicToolsetName({
|
|
3186
|
+
toolName: part.toolName,
|
|
3187
|
+
providerOptions: part.providerOptions,
|
|
3188
|
+
toolsetNames
|
|
3189
|
+
});
|
|
3014
3190
|
anthropicContent.push({
|
|
3015
3191
|
type: "tool_result",
|
|
3016
3192
|
tool_use_id: part.toolCallId,
|
|
3193
|
+
...toolsetName != null && { toolset_name: toolsetName },
|
|
3017
3194
|
content: contentValue,
|
|
3018
3195
|
is_error: output.type === "error-text" || output.type === "error-json" ? true : void 0,
|
|
3019
3196
|
cache_control: cacheControl
|
|
@@ -3211,6 +3388,33 @@ async function convertToAnthropicPrompt({
|
|
|
3211
3388
|
}
|
|
3212
3389
|
break;
|
|
3213
3390
|
}
|
|
3391
|
+
const toolsetName = getAnthropicToolsetName({
|
|
3392
|
+
toolName: part.toolName,
|
|
3393
|
+
providerOptions: part.providerOptions,
|
|
3394
|
+
toolsetNames
|
|
3395
|
+
});
|
|
3396
|
+
if (toolsetName != null) {
|
|
3397
|
+
const { action, ...memberInput } = toAnthropicToolInput(
|
|
3398
|
+
part.input
|
|
3399
|
+
);
|
|
3400
|
+
if (typeof action !== "string") {
|
|
3401
|
+
warnings.push({
|
|
3402
|
+
type: "other",
|
|
3403
|
+
message: `toolset tool call for tool ${part.toolName} is missing the action`
|
|
3404
|
+
});
|
|
3405
|
+
break;
|
|
3406
|
+
}
|
|
3407
|
+
anthropicContent.push({
|
|
3408
|
+
type: "tool_use",
|
|
3409
|
+
id: part.toolCallId,
|
|
3410
|
+
name: action,
|
|
3411
|
+
toolset_name: toolsetName,
|
|
3412
|
+
input: memberInput,
|
|
3413
|
+
...caller && { caller },
|
|
3414
|
+
cache_control: cacheControl
|
|
3415
|
+
});
|
|
3416
|
+
break;
|
|
3417
|
+
}
|
|
3214
3418
|
anthropicContent.push({
|
|
3215
3419
|
type: "tool_use",
|
|
3216
3420
|
id: part.toolCallId,
|
|
@@ -3634,6 +3838,19 @@ function moveToolUseBlocksToEnd(content) {
|
|
|
3634
3838
|
flushSegment();
|
|
3635
3839
|
return result;
|
|
3636
3840
|
}
|
|
3841
|
+
function getAnthropicToolsetName({
|
|
3842
|
+
toolName,
|
|
3843
|
+
providerOptions,
|
|
3844
|
+
toolsetNames
|
|
3845
|
+
}) {
|
|
3846
|
+
var _a;
|
|
3847
|
+
const fromTools = toolsetNames[toolName];
|
|
3848
|
+
if (fromTools != null) {
|
|
3849
|
+
return fromTools;
|
|
3850
|
+
}
|
|
3851
|
+
const fromMetadata = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.toolsetName;
|
|
3852
|
+
return typeof fromMetadata === "string" ? fromMetadata : void 0;
|
|
3853
|
+
}
|
|
3637
3854
|
function getAnthropicCaller(providerOptions) {
|
|
3638
3855
|
var _a;
|
|
3639
3856
|
const caller = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.caller;
|
|
@@ -3907,6 +4124,24 @@ function getAnthropicCallerMetadata(caller) {
|
|
|
3907
4124
|
const callerInfo = getAnthropicCallerInfo(caller);
|
|
3908
4125
|
return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
|
|
3909
4126
|
}
|
|
4127
|
+
function getAnthropicToolsetNames(tools) {
|
|
4128
|
+
const toolsetNames = {};
|
|
4129
|
+
for (const tool of tools != null ? tools : []) {
|
|
4130
|
+
if (tool.type === "provider" && tool.id === "anthropic.computer_toolset_20260801") {
|
|
4131
|
+
toolsetNames[tool.name] = "computer";
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
return toolsetNames;
|
|
4135
|
+
}
|
|
4136
|
+
function toToolsetMemberInput({
|
|
4137
|
+
memberName,
|
|
4138
|
+
input
|
|
4139
|
+
}) {
|
|
4140
|
+
return {
|
|
4141
|
+
action: memberName,
|
|
4142
|
+
...typeof input === "object" && input !== null && !Array.isArray(input) ? input : {}
|
|
4143
|
+
};
|
|
4144
|
+
}
|
|
3910
4145
|
function getProviderOptionsName(provider) {
|
|
3911
4146
|
const dotIndex = provider.indexOf(".");
|
|
3912
4147
|
return dotIndex === -1 ? provider : provider.substring(0, dotIndex);
|
|
@@ -4019,6 +4254,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4019
4254
|
rejectsSamplingParameters,
|
|
4020
4255
|
supportsXhighEffort,
|
|
4021
4256
|
rejectsThinkingDisabledAboveHighEffort,
|
|
4257
|
+
rejectsThinkingDisabled,
|
|
4258
|
+
rejectsForcedToolUse,
|
|
4022
4259
|
isKnownModel
|
|
4023
4260
|
} = getModelCapabilities(modelId);
|
|
4024
4261
|
if (!isKnownModel && maxOutputTokens == null) {
|
|
@@ -4058,7 +4295,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4058
4295
|
const supportsStructuredOutput = ((_a = config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
4059
4296
|
const supportsStrictTools = ((_b = config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
4060
4297
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
4061
|
-
|
|
4298
|
+
let useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
4299
|
+
if (!useStructuredOutput && rejectsForcedToolUse && supportsStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
|
|
4300
|
+
warnings.push({
|
|
4301
|
+
type: "unsupported",
|
|
4302
|
+
feature: "providerOptions.anthropic.structuredOutputMode",
|
|
4303
|
+
details: `structuredOutputMode 'jsonTool' is not supported by ${modelId} because it rejects forced tool use. Using 'outputFormat' instead.`
|
|
4304
|
+
});
|
|
4305
|
+
useStructuredOutput = true;
|
|
4306
|
+
}
|
|
4062
4307
|
const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
4063
4308
|
type: "function",
|
|
4064
4309
|
name: "json",
|
|
@@ -4082,6 +4327,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4082
4327
|
"anthropic.code_execution_20260120": "code_execution",
|
|
4083
4328
|
"anthropic.computer_20241022": "computer",
|
|
4084
4329
|
"anthropic.computer_20250124": "computer",
|
|
4330
|
+
"anthropic.computer_20251124": "computer",
|
|
4331
|
+
"anthropic.computer_toolset_20260801": "computer",
|
|
4085
4332
|
"anthropic.text_editor_20241022": "str_replace_editor",
|
|
4086
4333
|
"anthropic.text_editor_20250124": "str_replace_editor",
|
|
4087
4334
|
"anthropic.text_editor_20250429": "str_replace_based_edit_tool",
|
|
@@ -4100,18 +4347,22 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4100
4347
|
"anthropic.advisor_20260301": "advisor"
|
|
4101
4348
|
}
|
|
4102
4349
|
});
|
|
4350
|
+
const toolsetNames = getAnthropicToolsetNames(tools);
|
|
4103
4351
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicPrompt({
|
|
4104
4352
|
prompt,
|
|
4105
4353
|
sendReasoning: (_d = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _d : true,
|
|
4106
4354
|
warnings,
|
|
4107
4355
|
cacheControlValidator,
|
|
4108
|
-
toolNameMapping
|
|
4356
|
+
toolNameMapping,
|
|
4357
|
+
toolsetNames
|
|
4109
4358
|
});
|
|
4110
4359
|
if (isCustomReasoning(reasoning) && (anthropicOptions == null ? void 0 : anthropicOptions.effort) == null) {
|
|
4111
4360
|
const reasoningConfig = resolveAnthropicReasoningConfig({
|
|
4112
4361
|
reasoning,
|
|
4362
|
+
modelId,
|
|
4113
4363
|
supportsAdaptiveThinking,
|
|
4114
4364
|
supportsXhighEffort,
|
|
4365
|
+
rejectsThinkingDisabled,
|
|
4115
4366
|
maxOutputTokensForModel,
|
|
4116
4367
|
warnings
|
|
4117
4368
|
});
|
|
@@ -4124,6 +4375,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4124
4375
|
}
|
|
4125
4376
|
}
|
|
4126
4377
|
}
|
|
4378
|
+
if (rejectsThinkingDisabled && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null) {
|
|
4379
|
+
const thinking = anthropicOptions.thinking;
|
|
4380
|
+
if (thinking.type === "disabled") {
|
|
4381
|
+
warnings.push({
|
|
4382
|
+
type: "unsupported",
|
|
4383
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4384
|
+
details: `thinking cannot be disabled for ${modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
|
|
4385
|
+
});
|
|
4386
|
+
anthropicOptions.thinking = void 0;
|
|
4387
|
+
} else if (thinking.type === "enabled") {
|
|
4388
|
+
warnings.push({
|
|
4389
|
+
type: "unsupported",
|
|
4390
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4391
|
+
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.`
|
|
4392
|
+
});
|
|
4393
|
+
anthropicOptions.thinking = { type: "adaptive" };
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4127
4396
|
if (rejectsThinkingDisabledAboveHighEffort && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.type) === "disabled" && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
4128
4397
|
warnings.push({
|
|
4129
4398
|
type: "unsupported",
|
|
@@ -4237,6 +4506,14 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4237
4506
|
// prompt:
|
|
4238
4507
|
system: messagesPrompt.system,
|
|
4239
4508
|
messages: messagesPrompt.messages,
|
|
4509
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.safeguards) && anthropicOptions.safeguards.length > 0 && {
|
|
4510
|
+
safeguards: anthropicOptions.safeguards.map((safeguard) => ({
|
|
4511
|
+
type: safeguard.type,
|
|
4512
|
+
...safeguard.classifierContext !== void 0 && {
|
|
4513
|
+
classifier_context: safeguard.classifierContext
|
|
4514
|
+
}
|
|
4515
|
+
}))
|
|
4516
|
+
},
|
|
4240
4517
|
...contextManagement && {
|
|
4241
4518
|
context_management: {
|
|
4242
4519
|
edits: contextManagement.edits.map((edit) => {
|
|
@@ -4349,6 +4626,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4349
4626
|
if ((anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0) {
|
|
4350
4627
|
betas.add("mcp-client-2025-04-04");
|
|
4351
4628
|
}
|
|
4629
|
+
if ((anthropicOptions == null ? void 0 : anthropicOptions.safeguards) && anthropicOptions.safeguards.length > 0) {
|
|
4630
|
+
betas.add("dangerous-tool-use-2026-09-03");
|
|
4631
|
+
}
|
|
4352
4632
|
if (contextManagement) {
|
|
4353
4633
|
betas.add("context-management-2025-06-27");
|
|
4354
4634
|
if (contextManagement.edits.some((e) => e.type === "compact_20260112")) {
|
|
@@ -4399,7 +4679,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4399
4679
|
cacheControlValidator,
|
|
4400
4680
|
supportsStructuredOutput: false,
|
|
4401
4681
|
supportsStrictTools,
|
|
4402
|
-
defaultEagerInputStreaming
|
|
4682
|
+
defaultEagerInputStreaming,
|
|
4683
|
+
rejectsForcedToolUse
|
|
4403
4684
|
} : {
|
|
4404
4685
|
tools: tools != null ? tools : [],
|
|
4405
4686
|
toolChoice,
|
|
@@ -4407,7 +4688,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4407
4688
|
cacheControlValidator,
|
|
4408
4689
|
supportsStructuredOutput,
|
|
4409
4690
|
supportsStrictTools,
|
|
4410
|
-
defaultEagerInputStreaming
|
|
4691
|
+
defaultEagerInputStreaming,
|
|
4692
|
+
rejectsForcedToolUse
|
|
4411
4693
|
}
|
|
4412
4694
|
);
|
|
4413
4695
|
const cacheWarnings = cacheControlValidator.getWarnings();
|
|
@@ -4493,7 +4775,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4493
4775
|
});
|
|
4494
4776
|
}
|
|
4495
4777
|
async doGenerate(options) {
|
|
4496
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4778
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
4497
4779
|
const {
|
|
4498
4780
|
args,
|
|
4499
4781
|
warnings,
|
|
@@ -4615,6 +4897,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4615
4897
|
type: "text",
|
|
4616
4898
|
text: JSON.stringify(part.input)
|
|
4617
4899
|
});
|
|
4900
|
+
} else if (part.toolset_name != null) {
|
|
4901
|
+
content.push({
|
|
4902
|
+
type: "tool-call",
|
|
4903
|
+
toolCallId: part.id,
|
|
4904
|
+
toolName: toolNameMapping.toCustomToolName(part.toolset_name),
|
|
4905
|
+
input: JSON.stringify(
|
|
4906
|
+
toToolsetMemberInput({
|
|
4907
|
+
memberName: part.name,
|
|
4908
|
+
input: part.input
|
|
4909
|
+
})
|
|
4910
|
+
),
|
|
4911
|
+
providerMetadata: {
|
|
4912
|
+
anthropic: {
|
|
4913
|
+
toolsetName: part.toolset_name,
|
|
4914
|
+
...(_b = getAnthropicCallerMetadata(part.caller).providerMetadata) == null ? void 0 : _b.anthropic
|
|
4915
|
+
}
|
|
4916
|
+
}
|
|
4917
|
+
});
|
|
4618
4918
|
} else {
|
|
4619
4919
|
content.push({
|
|
4620
4920
|
type: "tool-call",
|
|
@@ -4712,7 +5012,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4712
5012
|
case "web_fetch_tool_result": {
|
|
4713
5013
|
if (part.content.type === "web_fetch_result") {
|
|
4714
5014
|
citationDocuments.push({
|
|
4715
|
-
title: (
|
|
5015
|
+
title: (_c = part.content.content.title) != null ? _c : part.content.url,
|
|
4716
5016
|
mediaType: part.content.content.source.media_type
|
|
4717
5017
|
});
|
|
4718
5018
|
content.push({
|
|
@@ -4778,7 +5078,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4778
5078
|
...result.title != null ? { title: result.title } : {},
|
|
4779
5079
|
providerMetadata: {
|
|
4780
5080
|
anthropic: {
|
|
4781
|
-
pageAge: (
|
|
5081
|
+
pageAge: (_d = result.page_age) != null ? _d : null
|
|
4782
5082
|
}
|
|
4783
5083
|
}
|
|
4784
5084
|
});
|
|
@@ -4810,7 +5110,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4810
5110
|
stdout: part.content.stdout,
|
|
4811
5111
|
stderr: part.content.stderr,
|
|
4812
5112
|
return_code: part.content.return_code,
|
|
4813
|
-
content: (
|
|
5113
|
+
content: (_e = part.content.content) != null ? _e : []
|
|
4814
5114
|
}
|
|
4815
5115
|
});
|
|
4816
5116
|
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
@@ -4823,7 +5123,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4823
5123
|
encrypted_stdout: part.content.encrypted_stdout,
|
|
4824
5124
|
stderr: part.content.stderr,
|
|
4825
5125
|
return_code: part.content.return_code,
|
|
4826
|
-
content: (
|
|
5126
|
+
content: (_f = part.content.content) != null ? _f : []
|
|
4827
5127
|
}
|
|
4828
5128
|
});
|
|
4829
5129
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
@@ -4951,13 +5251,13 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4951
5251
|
finishReason: response.stop_reason,
|
|
4952
5252
|
isJsonResponseFromTool
|
|
4953
5253
|
}),
|
|
4954
|
-
raw: (
|
|
5254
|
+
raw: (_g = response.stop_reason) != null ? _g : void 0
|
|
4955
5255
|
},
|
|
4956
5256
|
usage: convertAnthropicUsage({ usage: response.usage }),
|
|
4957
5257
|
request: { body: args },
|
|
4958
5258
|
response: {
|
|
4959
|
-
id: (
|
|
4960
|
-
modelId: (
|
|
5259
|
+
id: (_h = response.id) != null ? _h : void 0,
|
|
5260
|
+
modelId: (_i = response.model) != null ? _i : void 0,
|
|
4961
5261
|
headers: responseHeaders,
|
|
4962
5262
|
body: rawResponse
|
|
4963
5263
|
},
|
|
@@ -4970,6 +5270,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4970
5270
|
stopSequence: (_a2 = response.stop_sequence) != null ? _a2 : null,
|
|
4971
5271
|
...stopDetails != null ? { stopDetails } : {},
|
|
4972
5272
|
...response.input_transformations != null ? { inputTransformations: response.input_transformations } : {},
|
|
5273
|
+
...response.safeguard_results != null ? { safeguardResults: response.safeguard_results } : {},
|
|
4973
5274
|
iterations: response.usage.iterations ? response.usage.iterations.map(
|
|
4974
5275
|
(iter) => ({
|
|
4975
5276
|
type: iter.type,
|
|
@@ -5056,6 +5357,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5056
5357
|
let stopSequence = null;
|
|
5057
5358
|
let stopDetails = void 0;
|
|
5058
5359
|
let inputTransformations;
|
|
5360
|
+
let safeguardResults;
|
|
5059
5361
|
let container = null;
|
|
5060
5362
|
let isJsonResponseFromTool = false;
|
|
5061
5363
|
let isMessageOpen = false;
|
|
@@ -5156,6 +5458,29 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5156
5458
|
type: "text-start",
|
|
5157
5459
|
id: String(value.index)
|
|
5158
5460
|
});
|
|
5461
|
+
} else if (part.toolset_name != null) {
|
|
5462
|
+
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5463
|
+
const customToolName = toolNameMapping.toCustomToolName(
|
|
5464
|
+
part.toolset_name
|
|
5465
|
+
);
|
|
5466
|
+
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
5467
|
+
contentBlocks[value.index] = {
|
|
5468
|
+
type: "tool-call",
|
|
5469
|
+
toolCallId: part.id,
|
|
5470
|
+
toolName: customToolName,
|
|
5471
|
+
input: hasNonEmptyInput ? JSON.stringify(part.input) : "",
|
|
5472
|
+
firstDelta: true,
|
|
5473
|
+
toolset: {
|
|
5474
|
+
name: part.toolset_name,
|
|
5475
|
+
memberName: part.name
|
|
5476
|
+
},
|
|
5477
|
+
...callerInfo && { caller: callerInfo }
|
|
5478
|
+
};
|
|
5479
|
+
controller.enqueue({
|
|
5480
|
+
type: "tool-input-start",
|
|
5481
|
+
id: part.id,
|
|
5482
|
+
toolName: customToolName
|
|
5483
|
+
});
|
|
5159
5484
|
} else {
|
|
5160
5485
|
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5161
5486
|
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
@@ -5555,6 +5880,25 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5555
5880
|
case "tool-call":
|
|
5556
5881
|
const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === "json";
|
|
5557
5882
|
if (!isJsonResponseTool) {
|
|
5883
|
+
if (contentBlock.toolset != null) {
|
|
5884
|
+
let memberInput = {};
|
|
5885
|
+
try {
|
|
5886
|
+
memberInput = contentBlock.input === "" ? {} : secureJsonParse2(contentBlock.input);
|
|
5887
|
+
} catch (e) {
|
|
5888
|
+
memberInput = void 0;
|
|
5889
|
+
}
|
|
5890
|
+
contentBlock.input = memberInput === void 0 ? contentBlock.input : JSON.stringify(
|
|
5891
|
+
toToolsetMemberInput({
|
|
5892
|
+
memberName: contentBlock.toolset.memberName,
|
|
5893
|
+
input: memberInput
|
|
5894
|
+
})
|
|
5895
|
+
);
|
|
5896
|
+
controller.enqueue({
|
|
5897
|
+
type: "tool-input-delta",
|
|
5898
|
+
id: contentBlock.toolCallId,
|
|
5899
|
+
delta: contentBlock.input
|
|
5900
|
+
});
|
|
5901
|
+
}
|
|
5558
5902
|
controller.enqueue({
|
|
5559
5903
|
type: "tool-input-end",
|
|
5560
5904
|
id: contentBlock.toolCallId
|
|
@@ -5583,10 +5927,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5583
5927
|
// tool was not explicitly provided. We therefore bypass the general validation by marking the
|
|
5584
5928
|
// tool as dynamic.
|
|
5585
5929
|
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
5586
|
-
...contentBlock.caller && {
|
|
5930
|
+
...(contentBlock.caller || contentBlock.toolset) && {
|
|
5587
5931
|
providerMetadata: {
|
|
5588
5932
|
anthropic: {
|
|
5589
|
-
|
|
5933
|
+
...contentBlock.toolset && {
|
|
5934
|
+
toolsetName: contentBlock.toolset.name
|
|
5935
|
+
},
|
|
5936
|
+
...contentBlock.caller && {
|
|
5937
|
+
caller: contentBlock.caller
|
|
5938
|
+
}
|
|
5590
5939
|
}
|
|
5591
5940
|
}
|
|
5592
5941
|
}
|
|
@@ -5665,6 +6014,10 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5665
6014
|
if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
|
|
5666
6015
|
return;
|
|
5667
6016
|
}
|
|
6017
|
+
if (contentBlock.toolset != null) {
|
|
6018
|
+
contentBlock.input += delta;
|
|
6019
|
+
return;
|
|
6020
|
+
}
|
|
5668
6021
|
if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
|
|
5669
6022
|
delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
|
|
5670
6023
|
}
|
|
@@ -5830,6 +6183,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5830
6183
|
if (value.input_transformations != null) {
|
|
5831
6184
|
inputTransformations = value.input_transformations;
|
|
5832
6185
|
}
|
|
6186
|
+
if (value.delta.safeguard_results != null) {
|
|
6187
|
+
safeguardResults = value.delta.safeguard_results;
|
|
6188
|
+
}
|
|
5833
6189
|
rawUsage = {
|
|
5834
6190
|
...rawUsage,
|
|
5835
6191
|
...value.usage
|
|
@@ -5844,6 +6200,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5844
6200
|
stopSequence,
|
|
5845
6201
|
...stopDetails != null ? { stopDetails } : {},
|
|
5846
6202
|
...inputTransformations != null ? { inputTransformations } : {},
|
|
6203
|
+
...safeguardResults != null ? { safeguardResults } : {},
|
|
5847
6204
|
iterations: usage.iterations ? usage.iterations.map(
|
|
5848
6205
|
(iter) => ({
|
|
5849
6206
|
type: iter.type,
|
|
@@ -5926,7 +6283,19 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5926
6283
|
}
|
|
5927
6284
|
};
|
|
5928
6285
|
function getModelCapabilities(modelId) {
|
|
5929
|
-
if (modelId.includes("claude-opus-5")) {
|
|
6286
|
+
if (modelId.includes("claude-opus-5-5")) {
|
|
6287
|
+
return {
|
|
6288
|
+
maxOutputTokens: 128e3,
|
|
6289
|
+
supportsStructuredOutput: true,
|
|
6290
|
+
supportsAdaptiveThinking: true,
|
|
6291
|
+
rejectsSamplingParameters: true,
|
|
6292
|
+
supportsXhighEffort: true,
|
|
6293
|
+
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6294
|
+
rejectsThinkingDisabled: true,
|
|
6295
|
+
rejectsForcedToolUse: true,
|
|
6296
|
+
isKnownModel: true
|
|
6297
|
+
};
|
|
6298
|
+
} else if (modelId.includes("claude-opus-5")) {
|
|
5930
6299
|
return {
|
|
5931
6300
|
maxOutputTokens: 128e3,
|
|
5932
6301
|
supportsStructuredOutput: true,
|
|
@@ -5934,9 +6303,35 @@ function getModelCapabilities(modelId) {
|
|
|
5934
6303
|
rejectsSamplingParameters: true,
|
|
5935
6304
|
supportsXhighEffort: true,
|
|
5936
6305
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6306
|
+
rejectsThinkingDisabled: false,
|
|
6307
|
+
rejectsForcedToolUse: false,
|
|
6308
|
+
isKnownModel: true
|
|
6309
|
+
};
|
|
6310
|
+
} else if (modelId.includes("claude-fable-5-1")) {
|
|
6311
|
+
return {
|
|
6312
|
+
maxOutputTokens: 128e3,
|
|
6313
|
+
supportsStructuredOutput: true,
|
|
6314
|
+
supportsAdaptiveThinking: true,
|
|
6315
|
+
rejectsSamplingParameters: true,
|
|
6316
|
+
supportsXhighEffort: true,
|
|
6317
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6318
|
+
rejectsThinkingDisabled: true,
|
|
6319
|
+
rejectsForcedToolUse: true,
|
|
6320
|
+
isKnownModel: true
|
|
6321
|
+
};
|
|
6322
|
+
} else if (modelId.includes("claude-fable-5")) {
|
|
6323
|
+
return {
|
|
6324
|
+
maxOutputTokens: 128e3,
|
|
6325
|
+
supportsStructuredOutput: true,
|
|
6326
|
+
supportsAdaptiveThinking: true,
|
|
6327
|
+
rejectsSamplingParameters: true,
|
|
6328
|
+
supportsXhighEffort: true,
|
|
6329
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6330
|
+
rejectsThinkingDisabled: true,
|
|
6331
|
+
rejectsForcedToolUse: false,
|
|
5937
6332
|
isKnownModel: true
|
|
5938
6333
|
};
|
|
5939
|
-
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-
|
|
6334
|
+
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) {
|
|
5940
6335
|
return {
|
|
5941
6336
|
maxOutputTokens: 128e3,
|
|
5942
6337
|
supportsStructuredOutput: true,
|
|
@@ -5944,6 +6339,8 @@ function getModelCapabilities(modelId) {
|
|
|
5944
6339
|
rejectsSamplingParameters: true,
|
|
5945
6340
|
supportsXhighEffort: true,
|
|
5946
6341
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6342
|
+
rejectsThinkingDisabled: false,
|
|
6343
|
+
rejectsForcedToolUse: false,
|
|
5947
6344
|
isKnownModel: true
|
|
5948
6345
|
};
|
|
5949
6346
|
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
@@ -5954,6 +6351,8 @@ function getModelCapabilities(modelId) {
|
|
|
5954
6351
|
rejectsSamplingParameters: false,
|
|
5955
6352
|
supportsXhighEffort: false,
|
|
5956
6353
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6354
|
+
rejectsThinkingDisabled: false,
|
|
6355
|
+
rejectsForcedToolUse: false,
|
|
5957
6356
|
isKnownModel: true
|
|
5958
6357
|
};
|
|
5959
6358
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
@@ -5964,6 +6363,8 @@ function getModelCapabilities(modelId) {
|
|
|
5964
6363
|
rejectsSamplingParameters: false,
|
|
5965
6364
|
supportsXhighEffort: false,
|
|
5966
6365
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6366
|
+
rejectsThinkingDisabled: false,
|
|
6367
|
+
rejectsForcedToolUse: false,
|
|
5967
6368
|
isKnownModel: true
|
|
5968
6369
|
};
|
|
5969
6370
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
@@ -5974,6 +6375,8 @@ function getModelCapabilities(modelId) {
|
|
|
5974
6375
|
rejectsSamplingParameters: false,
|
|
5975
6376
|
supportsXhighEffort: false,
|
|
5976
6377
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6378
|
+
rejectsThinkingDisabled: false,
|
|
6379
|
+
rejectsForcedToolUse: false,
|
|
5977
6380
|
isKnownModel: true
|
|
5978
6381
|
};
|
|
5979
6382
|
} else if (/claude-sonnet-4(?:-|@)/.test(modelId)) {
|
|
@@ -5984,6 +6387,8 @@ function getModelCapabilities(modelId) {
|
|
|
5984
6387
|
rejectsSamplingParameters: false,
|
|
5985
6388
|
supportsXhighEffort: false,
|
|
5986
6389
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6390
|
+
rejectsThinkingDisabled: false,
|
|
6391
|
+
rejectsForcedToolUse: false,
|
|
5987
6392
|
isKnownModel: true
|
|
5988
6393
|
};
|
|
5989
6394
|
} else if (/claude-opus-4(?:-|@)/.test(modelId)) {
|
|
@@ -5994,6 +6399,8 @@ function getModelCapabilities(modelId) {
|
|
|
5994
6399
|
rejectsSamplingParameters: false,
|
|
5995
6400
|
supportsXhighEffort: false,
|
|
5996
6401
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6402
|
+
rejectsThinkingDisabled: false,
|
|
6403
|
+
rejectsForcedToolUse: false,
|
|
5997
6404
|
isKnownModel: true
|
|
5998
6405
|
};
|
|
5999
6406
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
@@ -6004,6 +6411,8 @@ function getModelCapabilities(modelId) {
|
|
|
6004
6411
|
rejectsSamplingParameters: false,
|
|
6005
6412
|
supportsXhighEffort: false,
|
|
6006
6413
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6414
|
+
rejectsThinkingDisabled: false,
|
|
6415
|
+
rejectsForcedToolUse: false,
|
|
6007
6416
|
isKnownModel: true
|
|
6008
6417
|
};
|
|
6009
6418
|
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
@@ -6014,6 +6423,8 @@ function getModelCapabilities(modelId) {
|
|
|
6014
6423
|
rejectsSamplingParameters: false,
|
|
6015
6424
|
supportsXhighEffort: false,
|
|
6016
6425
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6426
|
+
rejectsThinkingDisabled: false,
|
|
6427
|
+
rejectsForcedToolUse: false,
|
|
6017
6428
|
isKnownModel: false
|
|
6018
6429
|
};
|
|
6019
6430
|
} else if (modelId.includes("claude-")) {
|
|
@@ -6024,6 +6435,8 @@ function getModelCapabilities(modelId) {
|
|
|
6024
6435
|
rejectsSamplingParameters: true,
|
|
6025
6436
|
supportsXhighEffort: true,
|
|
6026
6437
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6438
|
+
rejectsThinkingDisabled: false,
|
|
6439
|
+
rejectsForcedToolUse: false,
|
|
6027
6440
|
isKnownModel: false
|
|
6028
6441
|
};
|
|
6029
6442
|
} else {
|
|
@@ -6034,6 +6447,8 @@ function getModelCapabilities(modelId) {
|
|
|
6034
6447
|
rejectsSamplingParameters: false,
|
|
6035
6448
|
supportsXhighEffort: false,
|
|
6036
6449
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6450
|
+
rejectsThinkingDisabled: false,
|
|
6451
|
+
rejectsForcedToolUse: false,
|
|
6037
6452
|
isKnownModel: false
|
|
6038
6453
|
};
|
|
6039
6454
|
}
|
|
@@ -6058,8 +6473,10 @@ function hasDynamicFilteringWebToolWithoutCodeExecution(tools) {
|
|
|
6058
6473
|
}
|
|
6059
6474
|
function resolveAnthropicReasoningConfig({
|
|
6060
6475
|
reasoning,
|
|
6476
|
+
modelId,
|
|
6061
6477
|
supportsAdaptiveThinking,
|
|
6062
6478
|
supportsXhighEffort,
|
|
6479
|
+
rejectsThinkingDisabled,
|
|
6063
6480
|
maxOutputTokensForModel,
|
|
6064
6481
|
warnings
|
|
6065
6482
|
}) {
|
|
@@ -6067,6 +6484,14 @@ function resolveAnthropicReasoningConfig({
|
|
|
6067
6484
|
return void 0;
|
|
6068
6485
|
}
|
|
6069
6486
|
if (reasoning === "none") {
|
|
6487
|
+
if (rejectsThinkingDisabled) {
|
|
6488
|
+
warnings.push({
|
|
6489
|
+
type: "compatibility",
|
|
6490
|
+
feature: "reasoning",
|
|
6491
|
+
details: `reasoning 'none' is not supported by ${modelId}; it always uses adaptive thinking. Using effort 'low' to minimize thinking instead.`
|
|
6492
|
+
});
|
|
6493
|
+
return { effort: "low" };
|
|
6494
|
+
}
|
|
6070
6495
|
return { thinking: { type: "disabled" } };
|
|
6071
6496
|
}
|
|
6072
6497
|
if (supportsAdaptiveThinking) {
|
|
@@ -6136,20 +6561,20 @@ function mapAnthropicStopDetails(stopDetails) {
|
|
|
6136
6561
|
|
|
6137
6562
|
// src/tool/bash_20241022.ts
|
|
6138
6563
|
import {
|
|
6139
|
-
createProviderDefinedToolFactory as
|
|
6140
|
-
lazySchema as
|
|
6141
|
-
zodSchema as
|
|
6564
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
|
|
6565
|
+
lazySchema as lazySchema17,
|
|
6566
|
+
zodSchema as zodSchema17
|
|
6142
6567
|
} from "@ai-sdk/provider-utils";
|
|
6143
|
-
import { z as
|
|
6144
|
-
var bash_20241022InputSchema =
|
|
6145
|
-
() =>
|
|
6146
|
-
|
|
6147
|
-
command:
|
|
6148
|
-
restart:
|
|
6568
|
+
import { z as z18 } from "zod/v4";
|
|
6569
|
+
var bash_20241022InputSchema = lazySchema17(
|
|
6570
|
+
() => zodSchema17(
|
|
6571
|
+
z18.object({
|
|
6572
|
+
command: z18.string(),
|
|
6573
|
+
restart: z18.boolean().optional()
|
|
6149
6574
|
})
|
|
6150
6575
|
)
|
|
6151
6576
|
);
|
|
6152
|
-
var bash_20241022_internal =
|
|
6577
|
+
var bash_20241022_internal = createProviderDefinedToolFactory3({
|
|
6153
6578
|
id: "anthropic.bash_20241022",
|
|
6154
6579
|
inputSchema: bash_20241022InputSchema
|
|
6155
6580
|
});
|
|
@@ -6177,20 +6602,20 @@ function bash_20241022(options = {}) {
|
|
|
6177
6602
|
|
|
6178
6603
|
// src/tool/bash_20250124.ts
|
|
6179
6604
|
import {
|
|
6180
|
-
createProviderDefinedToolFactory as
|
|
6181
|
-
lazySchema as
|
|
6182
|
-
zodSchema as
|
|
6605
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
|
|
6606
|
+
lazySchema as lazySchema18,
|
|
6607
|
+
zodSchema as zodSchema18
|
|
6183
6608
|
} from "@ai-sdk/provider-utils";
|
|
6184
|
-
import { z as
|
|
6185
|
-
var bash_20250124InputSchema =
|
|
6186
|
-
() =>
|
|
6187
|
-
|
|
6188
|
-
command:
|
|
6189
|
-
restart:
|
|
6609
|
+
import { z as z19 } from "zod/v4";
|
|
6610
|
+
var bash_20250124InputSchema = lazySchema18(
|
|
6611
|
+
() => zodSchema18(
|
|
6612
|
+
z19.object({
|
|
6613
|
+
command: z19.string(),
|
|
6614
|
+
restart: z19.boolean().optional()
|
|
6190
6615
|
})
|
|
6191
6616
|
)
|
|
6192
6617
|
);
|
|
6193
|
-
var bash_20250124_internal =
|
|
6618
|
+
var bash_20250124_internal = createProviderDefinedToolFactory4({
|
|
6194
6619
|
id: "anthropic.bash_20250124",
|
|
6195
6620
|
inputSchema: bash_20250124InputSchema
|
|
6196
6621
|
});
|
|
@@ -6218,15 +6643,15 @@ function bash_20250124(options = {}) {
|
|
|
6218
6643
|
|
|
6219
6644
|
// src/tool/computer_20241022.ts
|
|
6220
6645
|
import {
|
|
6221
|
-
createProviderDefinedToolFactory as
|
|
6222
|
-
lazySchema as
|
|
6223
|
-
zodSchema as
|
|
6646
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
|
|
6647
|
+
lazySchema as lazySchema19,
|
|
6648
|
+
zodSchema as zodSchema19
|
|
6224
6649
|
} from "@ai-sdk/provider-utils";
|
|
6225
|
-
import { z as
|
|
6226
|
-
var computer_20241022InputSchema =
|
|
6227
|
-
() =>
|
|
6228
|
-
|
|
6229
|
-
action:
|
|
6650
|
+
import { z as z20 } from "zod/v4";
|
|
6651
|
+
var computer_20241022InputSchema = lazySchema19(
|
|
6652
|
+
() => zodSchema19(
|
|
6653
|
+
z20.object({
|
|
6654
|
+
action: z20.enum([
|
|
6230
6655
|
"key",
|
|
6231
6656
|
"type",
|
|
6232
6657
|
"mouse_move",
|
|
@@ -6238,27 +6663,27 @@ var computer_20241022InputSchema = lazySchema18(
|
|
|
6238
6663
|
"screenshot",
|
|
6239
6664
|
"cursor_position"
|
|
6240
6665
|
]),
|
|
6241
|
-
coordinate:
|
|
6242
|
-
text:
|
|
6666
|
+
coordinate: z20.array(z20.number().int()).optional(),
|
|
6667
|
+
text: z20.string().optional()
|
|
6243
6668
|
})
|
|
6244
6669
|
)
|
|
6245
6670
|
);
|
|
6246
|
-
var computer_20241022 =
|
|
6671
|
+
var computer_20241022 = createProviderDefinedToolFactory5({
|
|
6247
6672
|
id: "anthropic.computer_20241022",
|
|
6248
6673
|
inputSchema: computer_20241022InputSchema
|
|
6249
6674
|
});
|
|
6250
6675
|
|
|
6251
6676
|
// src/tool/computer_20250124.ts
|
|
6252
6677
|
import {
|
|
6253
|
-
createProviderDefinedToolFactory as
|
|
6254
|
-
lazySchema as
|
|
6255
|
-
zodSchema as
|
|
6678
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
|
|
6679
|
+
lazySchema as lazySchema20,
|
|
6680
|
+
zodSchema as zodSchema20
|
|
6256
6681
|
} from "@ai-sdk/provider-utils";
|
|
6257
|
-
import { z as
|
|
6258
|
-
var computer_20250124InputSchema =
|
|
6259
|
-
() =>
|
|
6260
|
-
|
|
6261
|
-
action:
|
|
6682
|
+
import { z as z21 } from "zod/v4";
|
|
6683
|
+
var computer_20250124InputSchema = lazySchema20(
|
|
6684
|
+
() => zodSchema20(
|
|
6685
|
+
z21.object({
|
|
6686
|
+
action: z21.enum([
|
|
6262
6687
|
"key",
|
|
6263
6688
|
"hold_key",
|
|
6264
6689
|
"type",
|
|
@@ -6276,31 +6701,31 @@ var computer_20250124InputSchema = lazySchema19(
|
|
|
6276
6701
|
"wait",
|
|
6277
6702
|
"screenshot"
|
|
6278
6703
|
]),
|
|
6279
|
-
coordinate:
|
|
6280
|
-
duration:
|
|
6281
|
-
scroll_amount:
|
|
6282
|
-
scroll_direction:
|
|
6283
|
-
start_coordinate:
|
|
6284
|
-
text:
|
|
6704
|
+
coordinate: z21.tuple([z21.number().int(), z21.number().int()]).optional(),
|
|
6705
|
+
duration: z21.number().optional(),
|
|
6706
|
+
scroll_amount: z21.number().optional(),
|
|
6707
|
+
scroll_direction: z21.enum(["up", "down", "left", "right"]).optional(),
|
|
6708
|
+
start_coordinate: z21.tuple([z21.number().int(), z21.number().int()]).optional(),
|
|
6709
|
+
text: z21.string().optional()
|
|
6285
6710
|
})
|
|
6286
6711
|
)
|
|
6287
6712
|
);
|
|
6288
|
-
var computer_20250124 =
|
|
6713
|
+
var computer_20250124 = createProviderDefinedToolFactory6({
|
|
6289
6714
|
id: "anthropic.computer_20250124",
|
|
6290
6715
|
inputSchema: computer_20250124InputSchema
|
|
6291
6716
|
});
|
|
6292
6717
|
|
|
6293
6718
|
// src/tool/computer_20251124.ts
|
|
6294
6719
|
import {
|
|
6295
|
-
createProviderDefinedToolFactory as
|
|
6296
|
-
lazySchema as
|
|
6297
|
-
zodSchema as
|
|
6720
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
|
|
6721
|
+
lazySchema as lazySchema21,
|
|
6722
|
+
zodSchema as zodSchema21
|
|
6298
6723
|
} from "@ai-sdk/provider-utils";
|
|
6299
|
-
import { z as
|
|
6300
|
-
var computer_20251124InputSchema =
|
|
6301
|
-
() =>
|
|
6302
|
-
|
|
6303
|
-
action:
|
|
6724
|
+
import { z as z22 } from "zod/v4";
|
|
6725
|
+
var computer_20251124InputSchema = lazySchema21(
|
|
6726
|
+
() => zodSchema21(
|
|
6727
|
+
z22.object({
|
|
6728
|
+
action: z22.enum([
|
|
6304
6729
|
"key",
|
|
6305
6730
|
"hold_key",
|
|
6306
6731
|
"type",
|
|
@@ -6319,109 +6744,83 @@ var computer_20251124InputSchema = lazySchema20(
|
|
|
6319
6744
|
"screenshot",
|
|
6320
6745
|
"zoom"
|
|
6321
6746
|
]),
|
|
6322
|
-
coordinate:
|
|
6323
|
-
duration:
|
|
6324
|
-
region:
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6747
|
+
coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
|
|
6748
|
+
duration: z22.number().optional(),
|
|
6749
|
+
region: z22.tuple([
|
|
6750
|
+
z22.number().int(),
|
|
6751
|
+
z22.number().int(),
|
|
6752
|
+
z22.number().int(),
|
|
6753
|
+
z22.number().int()
|
|
6329
6754
|
]).optional(),
|
|
6330
|
-
scroll_amount:
|
|
6331
|
-
scroll_direction:
|
|
6332
|
-
start_coordinate:
|
|
6333
|
-
text:
|
|
6755
|
+
scroll_amount: z22.number().optional(),
|
|
6756
|
+
scroll_direction: z22.enum(["up", "down", "left", "right"]).optional(),
|
|
6757
|
+
start_coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
|
|
6758
|
+
text: z22.string().optional()
|
|
6334
6759
|
})
|
|
6335
6760
|
)
|
|
6336
6761
|
);
|
|
6337
|
-
var computer_20251124 =
|
|
6762
|
+
var computer_20251124 = createProviderDefinedToolFactory7({
|
|
6338
6763
|
id: "anthropic.computer_20251124",
|
|
6339
6764
|
inputSchema: computer_20251124InputSchema
|
|
6340
6765
|
});
|
|
6341
6766
|
|
|
6342
6767
|
// src/tool/memory_20250818.ts
|
|
6343
6768
|
import {
|
|
6344
|
-
createProviderDefinedToolFactory as
|
|
6345
|
-
lazySchema as
|
|
6346
|
-
zodSchema as
|
|
6769
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
6770
|
+
lazySchema as lazySchema22,
|
|
6771
|
+
zodSchema as zodSchema22
|
|
6347
6772
|
} from "@ai-sdk/provider-utils";
|
|
6348
|
-
import { z as
|
|
6349
|
-
var memory_20250818InputSchema =
|
|
6350
|
-
() =>
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
command:
|
|
6354
|
-
path:
|
|
6355
|
-
view_range:
|
|
6773
|
+
import { z as z23 } from "zod/v4";
|
|
6774
|
+
var memory_20250818InputSchema = lazySchema22(
|
|
6775
|
+
() => zodSchema22(
|
|
6776
|
+
z23.discriminatedUnion("command", [
|
|
6777
|
+
z23.object({
|
|
6778
|
+
command: z23.literal("view"),
|
|
6779
|
+
path: z23.string(),
|
|
6780
|
+
view_range: z23.tuple([z23.number(), z23.number()]).optional()
|
|
6356
6781
|
}),
|
|
6357
|
-
|
|
6358
|
-
command:
|
|
6359
|
-
path:
|
|
6360
|
-
file_text:
|
|
6782
|
+
z23.object({
|
|
6783
|
+
command: z23.literal("create"),
|
|
6784
|
+
path: z23.string(),
|
|
6785
|
+
file_text: z23.string()
|
|
6361
6786
|
}),
|
|
6362
|
-
|
|
6363
|
-
command:
|
|
6364
|
-
path:
|
|
6365
|
-
old_str:
|
|
6366
|
-
new_str:
|
|
6787
|
+
z23.object({
|
|
6788
|
+
command: z23.literal("str_replace"),
|
|
6789
|
+
path: z23.string(),
|
|
6790
|
+
old_str: z23.string(),
|
|
6791
|
+
new_str: z23.string()
|
|
6367
6792
|
}),
|
|
6368
|
-
|
|
6369
|
-
command:
|
|
6370
|
-
path:
|
|
6371
|
-
insert_line:
|
|
6372
|
-
insert_text:
|
|
6793
|
+
z23.object({
|
|
6794
|
+
command: z23.literal("insert"),
|
|
6795
|
+
path: z23.string(),
|
|
6796
|
+
insert_line: z23.number(),
|
|
6797
|
+
insert_text: z23.string()
|
|
6373
6798
|
}),
|
|
6374
|
-
|
|
6375
|
-
command:
|
|
6376
|
-
path:
|
|
6799
|
+
z23.object({
|
|
6800
|
+
command: z23.literal("delete"),
|
|
6801
|
+
path: z23.string()
|
|
6377
6802
|
}),
|
|
6378
|
-
|
|
6379
|
-
command:
|
|
6380
|
-
old_path:
|
|
6381
|
-
new_path:
|
|
6803
|
+
z23.object({
|
|
6804
|
+
command: z23.literal("rename"),
|
|
6805
|
+
old_path: z23.string(),
|
|
6806
|
+
new_path: z23.string()
|
|
6382
6807
|
})
|
|
6383
6808
|
])
|
|
6384
6809
|
)
|
|
6385
6810
|
);
|
|
6386
|
-
var memory_20250818 =
|
|
6811
|
+
var memory_20250818 = createProviderDefinedToolFactory8({
|
|
6387
6812
|
id: "anthropic.memory_20250818",
|
|
6388
6813
|
inputSchema: memory_20250818InputSchema
|
|
6389
6814
|
});
|
|
6390
6815
|
|
|
6391
6816
|
// src/tool/text-editor_20241022.ts
|
|
6392
|
-
import {
|
|
6393
|
-
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
6394
|
-
lazySchema as lazySchema22,
|
|
6395
|
-
zodSchema as zodSchema22
|
|
6396
|
-
} from "@ai-sdk/provider-utils";
|
|
6397
|
-
import { z as z23 } from "zod/v4";
|
|
6398
|
-
var textEditor_20241022InputSchema = lazySchema22(
|
|
6399
|
-
() => zodSchema22(
|
|
6400
|
-
z23.object({
|
|
6401
|
-
command: z23.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
6402
|
-
path: z23.string(),
|
|
6403
|
-
file_text: z23.string().optional(),
|
|
6404
|
-
insert_line: z23.number().int().optional(),
|
|
6405
|
-
new_str: z23.string().optional(),
|
|
6406
|
-
insert_text: z23.string().optional(),
|
|
6407
|
-
old_str: z23.string().optional(),
|
|
6408
|
-
view_range: z23.array(z23.number().int()).optional()
|
|
6409
|
-
})
|
|
6410
|
-
)
|
|
6411
|
-
);
|
|
6412
|
-
var textEditor_20241022 = createProviderDefinedToolFactory8({
|
|
6413
|
-
id: "anthropic.text_editor_20241022",
|
|
6414
|
-
inputSchema: textEditor_20241022InputSchema
|
|
6415
|
-
});
|
|
6416
|
-
|
|
6417
|
-
// src/tool/text-editor_20250124.ts
|
|
6418
6817
|
import {
|
|
6419
6818
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
|
|
6420
6819
|
lazySchema as lazySchema23,
|
|
6421
6820
|
zodSchema as zodSchema23
|
|
6422
6821
|
} from "@ai-sdk/provider-utils";
|
|
6423
6822
|
import { z as z24 } from "zod/v4";
|
|
6424
|
-
var
|
|
6823
|
+
var textEditor_20241022InputSchema = lazySchema23(
|
|
6425
6824
|
() => zodSchema23(
|
|
6426
6825
|
z24.object({
|
|
6427
6826
|
command: z24.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -6435,22 +6834,22 @@ var textEditor_20250124InputSchema = lazySchema23(
|
|
|
6435
6834
|
})
|
|
6436
6835
|
)
|
|
6437
6836
|
);
|
|
6438
|
-
var
|
|
6439
|
-
id: "anthropic.
|
|
6440
|
-
inputSchema:
|
|
6837
|
+
var textEditor_20241022 = createProviderDefinedToolFactory9({
|
|
6838
|
+
id: "anthropic.text_editor_20241022",
|
|
6839
|
+
inputSchema: textEditor_20241022InputSchema
|
|
6441
6840
|
});
|
|
6442
6841
|
|
|
6443
|
-
// src/tool/text-
|
|
6842
|
+
// src/tool/text-editor_20250124.ts
|
|
6444
6843
|
import {
|
|
6445
6844
|
createProviderDefinedToolFactory as createProviderDefinedToolFactory10,
|
|
6446
6845
|
lazySchema as lazySchema24,
|
|
6447
6846
|
zodSchema as zodSchema24
|
|
6448
6847
|
} from "@ai-sdk/provider-utils";
|
|
6449
6848
|
import { z as z25 } from "zod/v4";
|
|
6450
|
-
var
|
|
6849
|
+
var textEditor_20250124InputSchema = lazySchema24(
|
|
6451
6850
|
() => zodSchema24(
|
|
6452
6851
|
z25.object({
|
|
6453
|
-
command: z25.enum(["view", "create", "str_replace", "insert"]),
|
|
6852
|
+
command: z25.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
6454
6853
|
path: z25.string(),
|
|
6455
6854
|
file_text: z25.string().optional(),
|
|
6456
6855
|
insert_line: z25.number().int().optional(),
|
|
@@ -6461,40 +6860,66 @@ var textEditor_20250429InputSchema = lazySchema24(
|
|
|
6461
6860
|
})
|
|
6462
6861
|
)
|
|
6463
6862
|
);
|
|
6464
|
-
var
|
|
6465
|
-
id: "anthropic.
|
|
6466
|
-
inputSchema:
|
|
6863
|
+
var textEditor_20250124 = createProviderDefinedToolFactory10({
|
|
6864
|
+
id: "anthropic.text_editor_20250124",
|
|
6865
|
+
inputSchema: textEditor_20250124InputSchema
|
|
6467
6866
|
});
|
|
6468
6867
|
|
|
6469
|
-
// src/tool/
|
|
6868
|
+
// src/tool/text-editor_20250429.ts
|
|
6470
6869
|
import {
|
|
6471
|
-
|
|
6870
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory11,
|
|
6472
6871
|
lazySchema as lazySchema25,
|
|
6473
6872
|
zodSchema as zodSchema25
|
|
6474
6873
|
} from "@ai-sdk/provider-utils";
|
|
6475
6874
|
import { z as z26 } from "zod/v4";
|
|
6476
|
-
var
|
|
6875
|
+
var textEditor_20250429InputSchema = lazySchema25(
|
|
6477
6876
|
() => zodSchema25(
|
|
6478
|
-
z26.
|
|
6479
|
-
z26.
|
|
6480
|
-
|
|
6481
|
-
|
|
6877
|
+
z26.object({
|
|
6878
|
+
command: z26.enum(["view", "create", "str_replace", "insert"]),
|
|
6879
|
+
path: z26.string(),
|
|
6880
|
+
file_text: z26.string().optional(),
|
|
6881
|
+
insert_line: z26.number().int().optional(),
|
|
6882
|
+
new_str: z26.string().optional(),
|
|
6883
|
+
insert_text: z26.string().optional(),
|
|
6884
|
+
old_str: z26.string().optional(),
|
|
6885
|
+
view_range: z26.array(z26.number().int()).optional()
|
|
6886
|
+
})
|
|
6887
|
+
)
|
|
6888
|
+
);
|
|
6889
|
+
var textEditor_20250429 = createProviderDefinedToolFactory11({
|
|
6890
|
+
id: "anthropic.text_editor_20250429",
|
|
6891
|
+
inputSchema: textEditor_20250429InputSchema
|
|
6892
|
+
});
|
|
6893
|
+
|
|
6894
|
+
// src/tool/tool-search-bm25_20251119.ts
|
|
6895
|
+
import {
|
|
6896
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory12,
|
|
6897
|
+
lazySchema as lazySchema26,
|
|
6898
|
+
zodSchema as zodSchema26
|
|
6899
|
+
} from "@ai-sdk/provider-utils";
|
|
6900
|
+
import { z as z27 } from "zod/v4";
|
|
6901
|
+
var toolSearchBm25_20251119OutputSchema = lazySchema26(
|
|
6902
|
+
() => zodSchema26(
|
|
6903
|
+
z27.array(
|
|
6904
|
+
z27.object({
|
|
6905
|
+
type: z27.literal("tool_reference"),
|
|
6906
|
+
toolName: z27.string()
|
|
6482
6907
|
})
|
|
6483
6908
|
)
|
|
6484
6909
|
)
|
|
6485
6910
|
);
|
|
6486
|
-
var toolSearchBm25_20251119InputSchema =
|
|
6487
|
-
() =>
|
|
6488
|
-
|
|
6911
|
+
var toolSearchBm25_20251119InputSchema = lazySchema26(
|
|
6912
|
+
() => zodSchema26(
|
|
6913
|
+
z27.object({
|
|
6489
6914
|
/**
|
|
6490
6915
|
* A natural language query to search for tools.
|
|
6491
6916
|
* Claude will use BM25 text search to find relevant tools.
|
|
6492
6917
|
*/
|
|
6493
|
-
query:
|
|
6918
|
+
query: z27.string(),
|
|
6494
6919
|
/**
|
|
6495
6920
|
* Maximum number of tools to return. Optional.
|
|
6496
6921
|
*/
|
|
6497
|
-
limit:
|
|
6922
|
+
limit: z27.number().optional()
|
|
6498
6923
|
})
|
|
6499
6924
|
)
|
|
6500
6925
|
);
|
|
@@ -6626,6 +7051,29 @@ var anthropicTools = {
|
|
|
6626
7051
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
6627
7052
|
*/
|
|
6628
7053
|
computer_20251124,
|
|
7054
|
+
/**
|
|
7055
|
+
* The computer toolset lets Claude control a computer through screenshots,
|
|
7056
|
+
* mouse, and keyboard. It replaces the versioned computer tools
|
|
7057
|
+
* (`computer_20251124` and earlier) on newer models.
|
|
7058
|
+
*
|
|
7059
|
+
* The API returns each computer action as its own `tool_use` block with
|
|
7060
|
+
* `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
|
|
7061
|
+
* and exposes the member name as `action`, so `execute` receives the same
|
|
7062
|
+
* input shape as the older computer tools. Claude may return several actions
|
|
7063
|
+
* in one turn.
|
|
7064
|
+
*
|
|
7065
|
+
* Coordinates are always in the pixel space of the screenshots you return;
|
|
7066
|
+
* there are no display size parameters. Zoom is enabled by default.
|
|
7067
|
+
*
|
|
7068
|
+
* Does not require a beta header.
|
|
7069
|
+
*
|
|
7070
|
+
* Supported models: Claude Opus 5.5 (required; older computer tool types
|
|
7071
|
+
* are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
|
|
7072
|
+
*
|
|
7073
|
+
* @param configs - Per-member settings keyed by member name, e.g.
|
|
7074
|
+
* `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
|
|
7075
|
+
*/
|
|
7076
|
+
computerToolset_20260801,
|
|
6629
7077
|
/**
|
|
6630
7078
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
6631
7079
|
* Claude can create, read, update, and delete files that persist between sessions,
|
|
@@ -6774,40 +7222,40 @@ import {
|
|
|
6774
7222
|
} from "@ai-sdk/provider-utils";
|
|
6775
7223
|
|
|
6776
7224
|
// src/skills/anthropic-skills-api.ts
|
|
6777
|
-
import { lazySchema as
|
|
6778
|
-
import { z as
|
|
6779
|
-
var anthropicSkillResponseSchema =
|
|
6780
|
-
() =>
|
|
6781
|
-
|
|
6782
|
-
id:
|
|
6783
|
-
display_title:
|
|
6784
|
-
name:
|
|
6785
|
-
description:
|
|
6786
|
-
latest_version:
|
|
6787
|
-
source:
|
|
6788
|
-
created_at:
|
|
6789
|
-
updated_at:
|
|
7225
|
+
import { lazySchema as lazySchema27, zodSchema as zodSchema27 } from "@ai-sdk/provider-utils";
|
|
7226
|
+
import { z as z28 } from "zod/v4";
|
|
7227
|
+
var anthropicSkillResponseSchema = lazySchema27(
|
|
7228
|
+
() => zodSchema27(
|
|
7229
|
+
z28.object({
|
|
7230
|
+
id: z28.string(),
|
|
7231
|
+
display_title: z28.string().nullish(),
|
|
7232
|
+
name: z28.string().nullish(),
|
|
7233
|
+
description: z28.string().nullish(),
|
|
7234
|
+
latest_version: z28.string().nullish(),
|
|
7235
|
+
source: z28.string(),
|
|
7236
|
+
created_at: z28.string(),
|
|
7237
|
+
updated_at: z28.string()
|
|
6790
7238
|
})
|
|
6791
7239
|
)
|
|
6792
7240
|
);
|
|
6793
|
-
var anthropicSkillVersionListResponseSchema =
|
|
6794
|
-
() =>
|
|
6795
|
-
|
|
6796
|
-
data:
|
|
6797
|
-
|
|
6798
|
-
version:
|
|
7241
|
+
var anthropicSkillVersionListResponseSchema = lazySchema27(
|
|
7242
|
+
() => zodSchema27(
|
|
7243
|
+
z28.object({
|
|
7244
|
+
data: z28.array(
|
|
7245
|
+
z28.object({
|
|
7246
|
+
version: z28.string()
|
|
6799
7247
|
})
|
|
6800
7248
|
)
|
|
6801
7249
|
})
|
|
6802
7250
|
)
|
|
6803
7251
|
);
|
|
6804
|
-
var anthropicSkillVersionResponseSchema =
|
|
6805
|
-
() =>
|
|
6806
|
-
|
|
6807
|
-
type:
|
|
6808
|
-
skill_id:
|
|
6809
|
-
name:
|
|
6810
|
-
description:
|
|
7252
|
+
var anthropicSkillVersionResponseSchema = lazySchema27(
|
|
7253
|
+
() => zodSchema27(
|
|
7254
|
+
z28.object({
|
|
7255
|
+
type: z28.string(),
|
|
7256
|
+
skill_id: z28.string(),
|
|
7257
|
+
name: z28.string().nullish(),
|
|
7258
|
+
description: z28.string().nullish()
|
|
6811
7259
|
})
|
|
6812
7260
|
)
|
|
6813
7261
|
);
|