@ai-sdk/anthropic 3.0.119 → 3.0.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +834 -458
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +826 -446
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +74 -2
- package/dist/internal/index.d.ts +74 -2
- package/dist/internal/index.js +827 -451
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +825 -445
- package/dist/internal/index.mjs.map +1 -1
- package/docs/05-anthropic.mdx +125 -14
- package/package.json +1 -1
- package/src/anthropic-messages-api.ts +23 -0
- package/src/anthropic-messages-language-model.ts +264 -6
- package/src/anthropic-messages-options.ts +12 -2
- package/src/anthropic-prepare-tools.ts +76 -0
- package/src/anthropic-tools.ts +25 -0
- package/src/convert-to-anthropic-messages-prompt.ts +77 -1
- package/src/tool/computer-toolset_20260801.ts +165 -0
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "@ai-sdk/provider-utils";
|
|
13
13
|
|
|
14
14
|
// src/version.ts
|
|
15
|
-
var VERSION = true ? "3.0.
|
|
15
|
+
var VERSION = true ? "3.0.120" : "0.0.0-test";
|
|
16
16
|
|
|
17
17
|
// src/anthropic-messages-language-model.ts
|
|
18
18
|
import {
|
|
@@ -142,7 +142,9 @@ var anthropicMessagesResponseSchema = lazySchema2(
|
|
|
142
142
|
name: z2.string(),
|
|
143
143
|
input: z2.unknown(),
|
|
144
144
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
145
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
145
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
146
|
+
// Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
|
|
147
|
+
toolset_name: z2.string().nullish()
|
|
146
148
|
}),
|
|
147
149
|
z2.object({
|
|
148
150
|
type: z2.literal("server_tool_use"),
|
|
@@ -443,7 +445,8 @@ var anthropicMessagesChunkSchema = lazySchema2(
|
|
|
443
445
|
id: z2.string(),
|
|
444
446
|
name: z2.string(),
|
|
445
447
|
input: z2.unknown(),
|
|
446
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
448
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
449
|
+
toolset_name: z2.string().nullish()
|
|
447
450
|
})
|
|
448
451
|
])
|
|
449
452
|
).nullish(),
|
|
@@ -474,7 +477,9 @@ var anthropicMessagesChunkSchema = lazySchema2(
|
|
|
474
477
|
// Programmatic tool calling: input may be present directly for deferred tool calls
|
|
475
478
|
input: z2.record(z2.string(), z2.unknown()).optional(),
|
|
476
479
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
477
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
480
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
481
|
+
// Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
|
|
482
|
+
toolset_name: z2.string().nullish()
|
|
478
483
|
}),
|
|
479
484
|
z2.object({
|
|
480
485
|
type: z2.literal("redacted_thinking"),
|
|
@@ -885,7 +890,7 @@ var anthropicSystemMessageProviderOptions = z3.object({
|
|
|
885
890
|
* Overrides the effort level for the turn following this
|
|
886
891
|
* mid-conversation system message.
|
|
887
892
|
*
|
|
888
|
-
* Requires the `mid-conversation-
|
|
893
|
+
* Requires the `mid-conversation-output-config-2026-07-01` beta,
|
|
889
894
|
* which is added automatically.
|
|
890
895
|
*/
|
|
891
896
|
effort: z3.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
@@ -939,6 +944,11 @@ var anthropicLanguageModelOptions = z3.object({
|
|
|
939
944
|
*
|
|
940
945
|
* When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
|
|
941
946
|
* Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
|
|
947
|
+
*
|
|
948
|
+
* Models that always use adaptive thinking (e.g. `claude-opus-5-5`,
|
|
949
|
+
* `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
|
|
950
|
+
* provider drops the unsupported setting, emits a warning, and sends an
|
|
951
|
+
* adaptive thinking request. Use `effort` to control how much they think.
|
|
942
952
|
*/
|
|
943
953
|
thinking: z3.union([
|
|
944
954
|
z3.discriminatedUnion("type", [
|
|
@@ -1045,7 +1055,11 @@ var anthropicLanguageModelOptions = z3.object({
|
|
|
1045
1055
|
*/
|
|
1046
1056
|
toolStreaming: z3.boolean().optional(),
|
|
1047
1057
|
/**
|
|
1048
|
-
*
|
|
1058
|
+
* Controls how much effort the model spends on thinking, text responses,
|
|
1059
|
+
* and tool calls. On models that always use adaptive thinking
|
|
1060
|
+
* (e.g. `claude-opus-5-5`), effort is the main lever for latency and cost.
|
|
1061
|
+
*
|
|
1062
|
+
* The API default is `high` for most models and `medium` for `claude-opus-5-5`.
|
|
1049
1063
|
*/
|
|
1050
1064
|
effort: z3.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
1051
1065
|
/**
|
|
@@ -1256,103 +1270,114 @@ var advisor_20260301 = (args) => {
|
|
|
1256
1270
|
return factory(args);
|
|
1257
1271
|
};
|
|
1258
1272
|
|
|
1259
|
-
// src/tool/
|
|
1273
|
+
// src/tool/computer-toolset_20260801.ts
|
|
1260
1274
|
import {
|
|
1261
1275
|
createProviderToolFactory,
|
|
1262
1276
|
lazySchema as lazySchema4,
|
|
1263
1277
|
zodSchema as zodSchema4
|
|
1264
1278
|
} from "@ai-sdk/provider-utils";
|
|
1265
1279
|
import { z as z5 } from "zod/v4";
|
|
1266
|
-
var
|
|
1280
|
+
var computerToolset_20260801Members = [
|
|
1281
|
+
"screenshot",
|
|
1282
|
+
"zoom",
|
|
1283
|
+
"left_click",
|
|
1284
|
+
"right_click",
|
|
1285
|
+
"middle_click",
|
|
1286
|
+
"double_click",
|
|
1287
|
+
"triple_click",
|
|
1288
|
+
"left_click_drag",
|
|
1289
|
+
"mouse_move",
|
|
1290
|
+
"left_mouse_down",
|
|
1291
|
+
"left_mouse_up",
|
|
1292
|
+
"cursor_position",
|
|
1293
|
+
"scroll",
|
|
1294
|
+
"type",
|
|
1295
|
+
"key",
|
|
1296
|
+
"hold_key",
|
|
1297
|
+
"wait"
|
|
1298
|
+
];
|
|
1299
|
+
var computerToolset_20260801InputSchema = lazySchema4(
|
|
1267
1300
|
() => zodSchema4(
|
|
1268
1301
|
z5.object({
|
|
1269
|
-
|
|
1302
|
+
action: z5.enum(computerToolset_20260801Members),
|
|
1303
|
+
coordinate: z5.tuple([z5.number().int(), z5.number().int()]).optional(),
|
|
1304
|
+
duration: z5.number().optional(),
|
|
1305
|
+
region: z5.tuple([
|
|
1306
|
+
z5.number().int(),
|
|
1307
|
+
z5.number().int(),
|
|
1308
|
+
z5.number().int(),
|
|
1309
|
+
z5.number().int()
|
|
1310
|
+
]).optional(),
|
|
1311
|
+
repeat: z5.number().int().optional(),
|
|
1312
|
+
scroll_amount: z5.number().optional(),
|
|
1313
|
+
scroll_direction: z5.enum(["up", "down", "left", "right"]).optional(),
|
|
1314
|
+
start_coordinate: z5.tuple([z5.number().int(), z5.number().int()]).optional(),
|
|
1315
|
+
text: z5.string().optional()
|
|
1270
1316
|
})
|
|
1271
1317
|
)
|
|
1272
1318
|
);
|
|
1273
|
-
var
|
|
1319
|
+
var computerToolset_20260801ArgsSchema = lazySchema4(
|
|
1274
1320
|
() => zodSchema4(
|
|
1275
1321
|
z5.object({
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
view_range: z5.array(z5.number().int()).optional()
|
|
1322
|
+
configs: z5.partialRecord(
|
|
1323
|
+
z5.enum(computerToolset_20260801Members),
|
|
1324
|
+
z5.object({
|
|
1325
|
+
enabled: z5.boolean().optional(),
|
|
1326
|
+
deferLoading: z5.boolean().optional()
|
|
1327
|
+
})
|
|
1328
|
+
).optional()
|
|
1284
1329
|
})
|
|
1285
1330
|
)
|
|
1286
1331
|
);
|
|
1287
|
-
var
|
|
1288
|
-
id: "anthropic.
|
|
1289
|
-
inputSchema:
|
|
1332
|
+
var computerToolset_20260801 = createProviderToolFactory({
|
|
1333
|
+
id: "anthropic.computer_toolset_20260801",
|
|
1334
|
+
inputSchema: computerToolset_20260801InputSchema
|
|
1290
1335
|
});
|
|
1291
|
-
var textEditor_20250728 = (args = {}) => {
|
|
1292
|
-
return factory2(args);
|
|
1293
|
-
};
|
|
1294
1336
|
|
|
1295
|
-
// src/tool/
|
|
1337
|
+
// src/tool/text-editor_20250728.ts
|
|
1296
1338
|
import {
|
|
1297
|
-
|
|
1339
|
+
createProviderToolFactory as createProviderToolFactory2,
|
|
1298
1340
|
lazySchema as lazySchema5,
|
|
1299
1341
|
zodSchema as zodSchema5
|
|
1300
1342
|
} from "@ai-sdk/provider-utils";
|
|
1301
1343
|
import { z as z6 } from "zod/v4";
|
|
1302
|
-
var
|
|
1344
|
+
var textEditor_20250728ArgsSchema = lazySchema5(
|
|
1303
1345
|
() => zodSchema5(
|
|
1304
1346
|
z6.object({
|
|
1305
|
-
|
|
1306
|
-
allowedDomains: z6.array(z6.string()).optional(),
|
|
1307
|
-
blockedDomains: z6.array(z6.string()).optional(),
|
|
1308
|
-
userLocation: z6.object({
|
|
1309
|
-
type: z6.literal("approximate"),
|
|
1310
|
-
city: z6.string().optional(),
|
|
1311
|
-
region: z6.string().optional(),
|
|
1312
|
-
country: z6.string().optional(),
|
|
1313
|
-
timezone: z6.string().optional()
|
|
1314
|
-
}).optional()
|
|
1347
|
+
maxCharacters: z6.number().optional()
|
|
1315
1348
|
})
|
|
1316
1349
|
)
|
|
1317
1350
|
);
|
|
1318
|
-
var
|
|
1319
|
-
() => zodSchema5(
|
|
1320
|
-
z6.array(
|
|
1321
|
-
z6.object({
|
|
1322
|
-
url: z6.string(),
|
|
1323
|
-
title: z6.string().nullable(),
|
|
1324
|
-
pageAge: z6.string().nullable(),
|
|
1325
|
-
encryptedContent: z6.string(),
|
|
1326
|
-
type: z6.literal("web_search_result")
|
|
1327
|
-
})
|
|
1328
|
-
)
|
|
1329
|
-
)
|
|
1330
|
-
);
|
|
1331
|
-
var webSearch_20260209InputSchema = lazySchema5(
|
|
1351
|
+
var textEditor_20250728InputSchema = lazySchema5(
|
|
1332
1352
|
() => zodSchema5(
|
|
1333
1353
|
z6.object({
|
|
1334
|
-
|
|
1354
|
+
command: z6.enum(["view", "create", "str_replace", "insert"]),
|
|
1355
|
+
path: z6.string(),
|
|
1356
|
+
file_text: z6.string().optional(),
|
|
1357
|
+
insert_line: z6.number().int().optional(),
|
|
1358
|
+
new_str: z6.string().optional(),
|
|
1359
|
+
insert_text: z6.string().optional(),
|
|
1360
|
+
old_str: z6.string().optional(),
|
|
1361
|
+
view_range: z6.array(z6.number().int()).optional()
|
|
1335
1362
|
})
|
|
1336
1363
|
)
|
|
1337
1364
|
);
|
|
1338
|
-
var
|
|
1339
|
-
id: "anthropic.
|
|
1340
|
-
inputSchema:
|
|
1341
|
-
outputSchema: webSearch_20260209OutputSchema,
|
|
1342
|
-
supportsDeferredResults: true
|
|
1365
|
+
var factory2 = createProviderToolFactory2({
|
|
1366
|
+
id: "anthropic.text_editor_20250728",
|
|
1367
|
+
inputSchema: textEditor_20250728InputSchema
|
|
1343
1368
|
});
|
|
1344
|
-
var
|
|
1345
|
-
return
|
|
1369
|
+
var textEditor_20250728 = (args = {}) => {
|
|
1370
|
+
return factory2(args);
|
|
1346
1371
|
};
|
|
1347
1372
|
|
|
1348
|
-
// src/tool/web-
|
|
1373
|
+
// src/tool/web-search_20260209.ts
|
|
1349
1374
|
import {
|
|
1350
|
-
createProviderToolFactoryWithOutputSchema as
|
|
1375
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
1351
1376
|
lazySchema as lazySchema6,
|
|
1352
1377
|
zodSchema as zodSchema6
|
|
1353
1378
|
} from "@ai-sdk/provider-utils";
|
|
1354
1379
|
import { z as z7 } from "zod/v4";
|
|
1355
|
-
var
|
|
1380
|
+
var webSearch_20260209ArgsSchema = lazySchema6(
|
|
1356
1381
|
() => zodSchema6(
|
|
1357
1382
|
z7.object({
|
|
1358
1383
|
maxUses: z7.number().optional(),
|
|
@@ -1368,7 +1393,7 @@ var webSearch_20250305ArgsSchema = lazySchema6(
|
|
|
1368
1393
|
})
|
|
1369
1394
|
)
|
|
1370
1395
|
);
|
|
1371
|
-
var
|
|
1396
|
+
var webSearch_20260209OutputSchema = lazySchema6(
|
|
1372
1397
|
() => zodSchema6(
|
|
1373
1398
|
z7.array(
|
|
1374
1399
|
z7.object({
|
|
@@ -1381,92 +1406,84 @@ var webSearch_20250305OutputSchema = lazySchema6(
|
|
|
1381
1406
|
)
|
|
1382
1407
|
)
|
|
1383
1408
|
);
|
|
1384
|
-
var
|
|
1409
|
+
var webSearch_20260209InputSchema = lazySchema6(
|
|
1385
1410
|
() => zodSchema6(
|
|
1386
1411
|
z7.object({
|
|
1387
1412
|
query: z7.string()
|
|
1388
1413
|
})
|
|
1389
1414
|
)
|
|
1390
1415
|
);
|
|
1391
|
-
var
|
|
1392
|
-
id: "anthropic.
|
|
1393
|
-
inputSchema:
|
|
1394
|
-
outputSchema:
|
|
1416
|
+
var factory3 = createProviderToolFactoryWithOutputSchema2({
|
|
1417
|
+
id: "anthropic.web_search_20260209",
|
|
1418
|
+
inputSchema: webSearch_20260209InputSchema,
|
|
1419
|
+
outputSchema: webSearch_20260209OutputSchema,
|
|
1395
1420
|
supportsDeferredResults: true
|
|
1396
1421
|
});
|
|
1397
|
-
var
|
|
1398
|
-
return
|
|
1422
|
+
var webSearch_20260209 = (args = {}) => {
|
|
1423
|
+
return factory3(args);
|
|
1399
1424
|
};
|
|
1400
1425
|
|
|
1401
|
-
// src/tool/web-
|
|
1426
|
+
// src/tool/web-search_20250305.ts
|
|
1402
1427
|
import {
|
|
1403
|
-
createProviderToolFactoryWithOutputSchema as
|
|
1428
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
1404
1429
|
lazySchema as lazySchema7,
|
|
1405
1430
|
zodSchema as zodSchema7
|
|
1406
1431
|
} from "@ai-sdk/provider-utils";
|
|
1407
1432
|
import { z as z8 } from "zod/v4";
|
|
1408
|
-
var
|
|
1433
|
+
var webSearch_20250305ArgsSchema = lazySchema7(
|
|
1409
1434
|
() => zodSchema7(
|
|
1410
1435
|
z8.object({
|
|
1411
1436
|
maxUses: z8.number().optional(),
|
|
1412
1437
|
allowedDomains: z8.array(z8.string()).optional(),
|
|
1413
1438
|
blockedDomains: z8.array(z8.string()).optional(),
|
|
1414
|
-
|
|
1415
|
-
|
|
1439
|
+
userLocation: z8.object({
|
|
1440
|
+
type: z8.literal("approximate"),
|
|
1441
|
+
city: z8.string().optional(),
|
|
1442
|
+
region: z8.string().optional(),
|
|
1443
|
+
country: z8.string().optional(),
|
|
1444
|
+
timezone: z8.string().optional()
|
|
1445
|
+
}).optional()
|
|
1416
1446
|
})
|
|
1417
1447
|
)
|
|
1418
1448
|
);
|
|
1419
|
-
var
|
|
1449
|
+
var webSearch_20250305OutputSchema = lazySchema7(
|
|
1420
1450
|
() => zodSchema7(
|
|
1421
|
-
z8.
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
content: z8.object({
|
|
1425
|
-
type: z8.literal("document"),
|
|
1451
|
+
z8.array(
|
|
1452
|
+
z8.object({
|
|
1453
|
+
url: z8.string(),
|
|
1426
1454
|
title: z8.string().nullable(),
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
data: z8.string()
|
|
1433
|
-
}),
|
|
1434
|
-
z8.object({
|
|
1435
|
-
type: z8.literal("text"),
|
|
1436
|
-
mediaType: z8.literal("text/plain"),
|
|
1437
|
-
data: z8.string()
|
|
1438
|
-
})
|
|
1439
|
-
])
|
|
1440
|
-
}),
|
|
1441
|
-
retrievedAt: z8.string().nullable()
|
|
1442
|
-
})
|
|
1455
|
+
pageAge: z8.string().nullable(),
|
|
1456
|
+
encryptedContent: z8.string(),
|
|
1457
|
+
type: z8.literal("web_search_result")
|
|
1458
|
+
})
|
|
1459
|
+
)
|
|
1443
1460
|
)
|
|
1444
1461
|
);
|
|
1445
|
-
var
|
|
1462
|
+
var webSearch_20250305InputSchema = lazySchema7(
|
|
1446
1463
|
() => zodSchema7(
|
|
1447
1464
|
z8.object({
|
|
1448
|
-
|
|
1465
|
+
query: z8.string()
|
|
1449
1466
|
})
|
|
1450
1467
|
)
|
|
1451
1468
|
);
|
|
1452
|
-
var
|
|
1453
|
-
id: "anthropic.
|
|
1454
|
-
inputSchema:
|
|
1455
|
-
outputSchema:
|
|
1469
|
+
var factory4 = createProviderToolFactoryWithOutputSchema3({
|
|
1470
|
+
id: "anthropic.web_search_20250305",
|
|
1471
|
+
inputSchema: webSearch_20250305InputSchema,
|
|
1472
|
+
outputSchema: webSearch_20250305OutputSchema,
|
|
1456
1473
|
supportsDeferredResults: true
|
|
1457
1474
|
});
|
|
1458
|
-
var
|
|
1459
|
-
return
|
|
1475
|
+
var webSearch_20250305 = (args = {}) => {
|
|
1476
|
+
return factory4(args);
|
|
1460
1477
|
};
|
|
1461
1478
|
|
|
1462
|
-
// src/tool/web-fetch-
|
|
1479
|
+
// src/tool/web-fetch-20260209.ts
|
|
1463
1480
|
import {
|
|
1464
|
-
createProviderToolFactoryWithOutputSchema as
|
|
1481
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
1465
1482
|
lazySchema as lazySchema8,
|
|
1466
1483
|
zodSchema as zodSchema8
|
|
1467
1484
|
} from "@ai-sdk/provider-utils";
|
|
1468
1485
|
import { z as z9 } from "zod/v4";
|
|
1469
|
-
var
|
|
1486
|
+
var webFetch_20260209ArgsSchema = lazySchema8(
|
|
1470
1487
|
() => zodSchema8(
|
|
1471
1488
|
z9.object({
|
|
1472
1489
|
maxUses: z9.number().optional(),
|
|
@@ -1477,7 +1494,7 @@ var webFetch_20250910ArgsSchema = lazySchema8(
|
|
|
1477
1494
|
})
|
|
1478
1495
|
)
|
|
1479
1496
|
);
|
|
1480
|
-
var
|
|
1497
|
+
var webFetch_20260209OutputSchema = lazySchema8(
|
|
1481
1498
|
() => zodSchema8(
|
|
1482
1499
|
z9.object({
|
|
1483
1500
|
type: z9.literal("web_fetch_result"),
|
|
@@ -1503,13 +1520,74 @@ var webFetch_20250910OutputSchema = lazySchema8(
|
|
|
1503
1520
|
})
|
|
1504
1521
|
)
|
|
1505
1522
|
);
|
|
1506
|
-
var
|
|
1523
|
+
var webFetch_20260209InputSchema = lazySchema8(
|
|
1507
1524
|
() => zodSchema8(
|
|
1508
1525
|
z9.object({
|
|
1509
1526
|
url: z9.string()
|
|
1510
1527
|
})
|
|
1511
1528
|
)
|
|
1512
1529
|
);
|
|
1530
|
+
var factory5 = createProviderToolFactoryWithOutputSchema4({
|
|
1531
|
+
id: "anthropic.web_fetch_20260209",
|
|
1532
|
+
inputSchema: webFetch_20260209InputSchema,
|
|
1533
|
+
outputSchema: webFetch_20260209OutputSchema,
|
|
1534
|
+
supportsDeferredResults: true
|
|
1535
|
+
});
|
|
1536
|
+
var webFetch_20260209 = (args = {}) => {
|
|
1537
|
+
return factory5(args);
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
// src/tool/web-fetch-20250910.ts
|
|
1541
|
+
import {
|
|
1542
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
1543
|
+
lazySchema as lazySchema9,
|
|
1544
|
+
zodSchema as zodSchema9
|
|
1545
|
+
} from "@ai-sdk/provider-utils";
|
|
1546
|
+
import { z as z10 } from "zod/v4";
|
|
1547
|
+
var webFetch_20250910ArgsSchema = lazySchema9(
|
|
1548
|
+
() => zodSchema9(
|
|
1549
|
+
z10.object({
|
|
1550
|
+
maxUses: z10.number().optional(),
|
|
1551
|
+
allowedDomains: z10.array(z10.string()).optional(),
|
|
1552
|
+
blockedDomains: z10.array(z10.string()).optional(),
|
|
1553
|
+
citations: z10.object({ enabled: z10.boolean() }).optional(),
|
|
1554
|
+
maxContentTokens: z10.number().optional()
|
|
1555
|
+
})
|
|
1556
|
+
)
|
|
1557
|
+
);
|
|
1558
|
+
var webFetch_20250910OutputSchema = lazySchema9(
|
|
1559
|
+
() => zodSchema9(
|
|
1560
|
+
z10.object({
|
|
1561
|
+
type: z10.literal("web_fetch_result"),
|
|
1562
|
+
url: z10.string(),
|
|
1563
|
+
content: z10.object({
|
|
1564
|
+
type: z10.literal("document"),
|
|
1565
|
+
title: z10.string().nullable(),
|
|
1566
|
+
citations: z10.object({ enabled: z10.boolean() }).optional(),
|
|
1567
|
+
source: z10.union([
|
|
1568
|
+
z10.object({
|
|
1569
|
+
type: z10.literal("base64"),
|
|
1570
|
+
mediaType: z10.literal("application/pdf"),
|
|
1571
|
+
data: z10.string()
|
|
1572
|
+
}),
|
|
1573
|
+
z10.object({
|
|
1574
|
+
type: z10.literal("text"),
|
|
1575
|
+
mediaType: z10.literal("text/plain"),
|
|
1576
|
+
data: z10.string()
|
|
1577
|
+
})
|
|
1578
|
+
])
|
|
1579
|
+
}),
|
|
1580
|
+
retrievedAt: z10.string().nullable()
|
|
1581
|
+
})
|
|
1582
|
+
)
|
|
1583
|
+
);
|
|
1584
|
+
var webFetch_20250910InputSchema = lazySchema9(
|
|
1585
|
+
() => zodSchema9(
|
|
1586
|
+
z10.object({
|
|
1587
|
+
url: z10.string()
|
|
1588
|
+
})
|
|
1589
|
+
)
|
|
1590
|
+
);
|
|
1513
1591
|
var factory6 = createProviderToolFactoryWithOutputSchema5({
|
|
1514
1592
|
id: "anthropic.web_fetch_20250910",
|
|
1515
1593
|
inputSchema: webFetch_20250910InputSchema,
|
|
@@ -1529,7 +1607,8 @@ async function prepareTools({
|
|
|
1529
1607
|
cacheControlValidator,
|
|
1530
1608
|
supportsStructuredOutput,
|
|
1531
1609
|
supportsStrictTools,
|
|
1532
|
-
defaultEagerInputStreaming = false
|
|
1610
|
+
defaultEagerInputStreaming = false,
|
|
1611
|
+
rejectsForcedToolUse = false
|
|
1533
1612
|
}) {
|
|
1534
1613
|
var _a, _b;
|
|
1535
1614
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
@@ -1632,6 +1711,31 @@ async function prepareTools({
|
|
|
1632
1711
|
});
|
|
1633
1712
|
break;
|
|
1634
1713
|
}
|
|
1714
|
+
case "anthropic.computer_toolset_20260801": {
|
|
1715
|
+
const args = await validateTypes({
|
|
1716
|
+
value: tool.args,
|
|
1717
|
+
schema: computerToolset_20260801ArgsSchema
|
|
1718
|
+
});
|
|
1719
|
+
const configs = args.configs != null ? Object.fromEntries(
|
|
1720
|
+
Object.entries(args.configs).map(([member, config]) => [
|
|
1721
|
+
member,
|
|
1722
|
+
{
|
|
1723
|
+
...(config == null ? void 0 : config.enabled) != null && {
|
|
1724
|
+
enabled: config.enabled
|
|
1725
|
+
},
|
|
1726
|
+
...(config == null ? void 0 : config.deferLoading) != null && {
|
|
1727
|
+
defer_loading: config.deferLoading
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
])
|
|
1731
|
+
) : void 0;
|
|
1732
|
+
anthropicTools2.push({
|
|
1733
|
+
type: "computer_toolset_20260801",
|
|
1734
|
+
...configs != null && { configs },
|
|
1735
|
+
cache_control: void 0
|
|
1736
|
+
});
|
|
1737
|
+
break;
|
|
1738
|
+
}
|
|
1635
1739
|
case "anthropic.computer_20241022": {
|
|
1636
1740
|
betas.add("computer-use-2024-10-22");
|
|
1637
1741
|
anthropicTools2.push({
|
|
@@ -1848,6 +1952,22 @@ async function prepareTools({
|
|
|
1848
1952
|
betas
|
|
1849
1953
|
};
|
|
1850
1954
|
case "required":
|
|
1955
|
+
if (rejectsForcedToolUse) {
|
|
1956
|
+
toolWarnings.push({
|
|
1957
|
+
type: "unsupported",
|
|
1958
|
+
feature: "toolChoice",
|
|
1959
|
+
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.`
|
|
1960
|
+
});
|
|
1961
|
+
return {
|
|
1962
|
+
tools: anthropicTools2,
|
|
1963
|
+
toolChoice: {
|
|
1964
|
+
type: "auto",
|
|
1965
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
1966
|
+
},
|
|
1967
|
+
toolWarnings,
|
|
1968
|
+
betas
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1851
1971
|
return {
|
|
1852
1972
|
tools: anthropicTools2,
|
|
1853
1973
|
toolChoice: {
|
|
@@ -1860,6 +1980,24 @@ async function prepareTools({
|
|
|
1860
1980
|
case "none":
|
|
1861
1981
|
return { tools: void 0, toolChoice: void 0, toolWarnings, betas };
|
|
1862
1982
|
case "tool":
|
|
1983
|
+
if (rejectsForcedToolUse) {
|
|
1984
|
+
toolWarnings.push({
|
|
1985
|
+
type: "unsupported",
|
|
1986
|
+
feature: "toolChoice",
|
|
1987
|
+
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.`
|
|
1988
|
+
});
|
|
1989
|
+
return {
|
|
1990
|
+
tools: anthropicTools2.filter(
|
|
1991
|
+
(tool) => "name" in tool && tool.name === toolChoice.toolName
|
|
1992
|
+
),
|
|
1993
|
+
toolChoice: {
|
|
1994
|
+
type: "auto",
|
|
1995
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
1996
|
+
},
|
|
1997
|
+
toolWarnings,
|
|
1998
|
+
betas
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
1863
2001
|
return {
|
|
1864
2002
|
tools: anthropicTools2,
|
|
1865
2003
|
toolChoice: {
|
|
@@ -1948,30 +2086,30 @@ import {
|
|
|
1948
2086
|
// src/tool/code-execution_20250522.ts
|
|
1949
2087
|
import {
|
|
1950
2088
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
1951
|
-
lazySchema as
|
|
1952
|
-
zodSchema as
|
|
2089
|
+
lazySchema as lazySchema10,
|
|
2090
|
+
zodSchema as zodSchema10
|
|
1953
2091
|
} from "@ai-sdk/provider-utils";
|
|
1954
|
-
import { z as
|
|
1955
|
-
var codeExecution_20250522OutputSchema =
|
|
1956
|
-
() =>
|
|
1957
|
-
|
|
1958
|
-
type:
|
|
1959
|
-
stdout:
|
|
1960
|
-
stderr:
|
|
1961
|
-
return_code:
|
|
1962
|
-
content:
|
|
1963
|
-
|
|
1964
|
-
type:
|
|
1965
|
-
file_id:
|
|
2092
|
+
import { z as z11 } from "zod/v4";
|
|
2093
|
+
var codeExecution_20250522OutputSchema = lazySchema10(
|
|
2094
|
+
() => zodSchema10(
|
|
2095
|
+
z11.object({
|
|
2096
|
+
type: z11.literal("code_execution_result"),
|
|
2097
|
+
stdout: z11.string(),
|
|
2098
|
+
stderr: z11.string(),
|
|
2099
|
+
return_code: z11.number(),
|
|
2100
|
+
content: z11.array(
|
|
2101
|
+
z11.object({
|
|
2102
|
+
type: z11.literal("code_execution_output"),
|
|
2103
|
+
file_id: z11.string()
|
|
1966
2104
|
})
|
|
1967
2105
|
).optional().default([])
|
|
1968
2106
|
})
|
|
1969
2107
|
)
|
|
1970
2108
|
);
|
|
1971
|
-
var codeExecution_20250522InputSchema =
|
|
1972
|
-
() =>
|
|
1973
|
-
|
|
1974
|
-
code:
|
|
2109
|
+
var codeExecution_20250522InputSchema = lazySchema10(
|
|
2110
|
+
() => zodSchema10(
|
|
2111
|
+
z11.object({
|
|
2112
|
+
code: z11.string()
|
|
1975
2113
|
})
|
|
1976
2114
|
)
|
|
1977
2115
|
);
|
|
@@ -1987,124 +2125,11 @@ var codeExecution_20250522 = (args = {}) => {
|
|
|
1987
2125
|
// src/tool/code-execution_20250825.ts
|
|
1988
2126
|
import {
|
|
1989
2127
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
1990
|
-
lazySchema as lazySchema10,
|
|
1991
|
-
zodSchema as zodSchema10
|
|
1992
|
-
} from "@ai-sdk/provider-utils";
|
|
1993
|
-
import { z as z11 } from "zod/v4";
|
|
1994
|
-
var codeExecution_20250825OutputSchema = lazySchema10(
|
|
1995
|
-
() => zodSchema10(
|
|
1996
|
-
z11.discriminatedUnion("type", [
|
|
1997
|
-
z11.object({
|
|
1998
|
-
type: z11.literal("code_execution_result"),
|
|
1999
|
-
stdout: z11.string(),
|
|
2000
|
-
stderr: z11.string(),
|
|
2001
|
-
return_code: z11.number(),
|
|
2002
|
-
content: z11.array(
|
|
2003
|
-
z11.object({
|
|
2004
|
-
type: z11.literal("code_execution_output"),
|
|
2005
|
-
file_id: z11.string()
|
|
2006
|
-
})
|
|
2007
|
-
).optional().default([])
|
|
2008
|
-
}),
|
|
2009
|
-
z11.object({
|
|
2010
|
-
type: z11.literal("bash_code_execution_result"),
|
|
2011
|
-
content: z11.array(
|
|
2012
|
-
z11.object({
|
|
2013
|
-
type: z11.literal("bash_code_execution_output"),
|
|
2014
|
-
file_id: z11.string()
|
|
2015
|
-
})
|
|
2016
|
-
),
|
|
2017
|
-
stdout: z11.string(),
|
|
2018
|
-
stderr: z11.string(),
|
|
2019
|
-
return_code: z11.number()
|
|
2020
|
-
}),
|
|
2021
|
-
z11.object({
|
|
2022
|
-
type: z11.literal("bash_code_execution_tool_result_error"),
|
|
2023
|
-
error_code: z11.string()
|
|
2024
|
-
}),
|
|
2025
|
-
z11.object({
|
|
2026
|
-
type: z11.literal("text_editor_code_execution_tool_result_error"),
|
|
2027
|
-
error_code: z11.string()
|
|
2028
|
-
}),
|
|
2029
|
-
z11.object({
|
|
2030
|
-
type: z11.literal("text_editor_code_execution_view_result"),
|
|
2031
|
-
content: z11.string(),
|
|
2032
|
-
file_type: z11.string(),
|
|
2033
|
-
num_lines: z11.number().nullable(),
|
|
2034
|
-
start_line: z11.number().nullable(),
|
|
2035
|
-
total_lines: z11.number().nullable()
|
|
2036
|
-
}),
|
|
2037
|
-
z11.object({
|
|
2038
|
-
type: z11.literal("text_editor_code_execution_create_result"),
|
|
2039
|
-
is_file_update: z11.boolean()
|
|
2040
|
-
}),
|
|
2041
|
-
z11.object({
|
|
2042
|
-
type: z11.literal("text_editor_code_execution_str_replace_result"),
|
|
2043
|
-
lines: z11.array(z11.string()).nullable(),
|
|
2044
|
-
new_lines: z11.number().nullable(),
|
|
2045
|
-
new_start: z11.number().nullable(),
|
|
2046
|
-
old_lines: z11.number().nullable(),
|
|
2047
|
-
old_start: z11.number().nullable()
|
|
2048
|
-
})
|
|
2049
|
-
])
|
|
2050
|
-
)
|
|
2051
|
-
);
|
|
2052
|
-
var codeExecution_20250825InputSchema = lazySchema10(
|
|
2053
|
-
() => zodSchema10(
|
|
2054
|
-
z11.discriminatedUnion("type", [
|
|
2055
|
-
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2056
|
-
z11.object({
|
|
2057
|
-
type: z11.literal("programmatic-tool-call"),
|
|
2058
|
-
code: z11.string()
|
|
2059
|
-
}),
|
|
2060
|
-
z11.object({
|
|
2061
|
-
type: z11.literal("bash_code_execution"),
|
|
2062
|
-
command: z11.string()
|
|
2063
|
-
}),
|
|
2064
|
-
z11.discriminatedUnion("command", [
|
|
2065
|
-
z11.object({
|
|
2066
|
-
type: z11.literal("text_editor_code_execution"),
|
|
2067
|
-
command: z11.literal("view"),
|
|
2068
|
-
path: z11.string()
|
|
2069
|
-
}),
|
|
2070
|
-
z11.object({
|
|
2071
|
-
type: z11.literal("text_editor_code_execution"),
|
|
2072
|
-
command: z11.literal("create"),
|
|
2073
|
-
path: z11.string(),
|
|
2074
|
-
file_text: z11.string().nullish()
|
|
2075
|
-
}),
|
|
2076
|
-
z11.object({
|
|
2077
|
-
type: z11.literal("text_editor_code_execution"),
|
|
2078
|
-
command: z11.literal("str_replace"),
|
|
2079
|
-
path: z11.string(),
|
|
2080
|
-
old_str: z11.string(),
|
|
2081
|
-
new_str: z11.string()
|
|
2082
|
-
})
|
|
2083
|
-
])
|
|
2084
|
-
])
|
|
2085
|
-
)
|
|
2086
|
-
);
|
|
2087
|
-
var factory8 = createProviderToolFactoryWithOutputSchema7({
|
|
2088
|
-
id: "anthropic.code_execution_20250825",
|
|
2089
|
-
inputSchema: codeExecution_20250825InputSchema,
|
|
2090
|
-
outputSchema: codeExecution_20250825OutputSchema,
|
|
2091
|
-
// Programmatic tool calling: tool results may be deferred to a later turn
|
|
2092
|
-
// when code execution triggers a client-executed tool that needs to be
|
|
2093
|
-
// resolved before the code execution result can be returned.
|
|
2094
|
-
supportsDeferredResults: true
|
|
2095
|
-
});
|
|
2096
|
-
var codeExecution_20250825 = (args = {}) => {
|
|
2097
|
-
return factory8(args);
|
|
2098
|
-
};
|
|
2099
|
-
|
|
2100
|
-
// src/tool/code-execution_20260120.ts
|
|
2101
|
-
import {
|
|
2102
|
-
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
2103
2128
|
lazySchema as lazySchema11,
|
|
2104
2129
|
zodSchema as zodSchema11
|
|
2105
2130
|
} from "@ai-sdk/provider-utils";
|
|
2106
2131
|
import { z as z12 } from "zod/v4";
|
|
2107
|
-
var
|
|
2132
|
+
var codeExecution_20250825OutputSchema = lazySchema11(
|
|
2108
2133
|
() => zodSchema11(
|
|
2109
2134
|
z12.discriminatedUnion("type", [
|
|
2110
2135
|
z12.object({
|
|
@@ -2119,18 +2144,6 @@ var codeExecution_20260120OutputSchema = lazySchema11(
|
|
|
2119
2144
|
})
|
|
2120
2145
|
).optional().default([])
|
|
2121
2146
|
}),
|
|
2122
|
-
z12.object({
|
|
2123
|
-
type: z12.literal("encrypted_code_execution_result"),
|
|
2124
|
-
encrypted_stdout: z12.string(),
|
|
2125
|
-
stderr: z12.string(),
|
|
2126
|
-
return_code: z12.number(),
|
|
2127
|
-
content: z12.array(
|
|
2128
|
-
z12.object({
|
|
2129
|
-
type: z12.literal("code_execution_output"),
|
|
2130
|
-
file_id: z12.string()
|
|
2131
|
-
})
|
|
2132
|
-
).optional().default([])
|
|
2133
|
-
}),
|
|
2134
2147
|
z12.object({
|
|
2135
2148
|
type: z12.literal("bash_code_execution_result"),
|
|
2136
2149
|
content: z12.array(
|
|
@@ -2174,9 +2187,10 @@ var codeExecution_20260120OutputSchema = lazySchema11(
|
|
|
2174
2187
|
])
|
|
2175
2188
|
)
|
|
2176
2189
|
);
|
|
2177
|
-
var
|
|
2190
|
+
var codeExecution_20250825InputSchema = lazySchema11(
|
|
2178
2191
|
() => zodSchema11(
|
|
2179
2192
|
z12.discriminatedUnion("type", [
|
|
2193
|
+
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2180
2194
|
z12.object({
|
|
2181
2195
|
type: z12.literal("programmatic-tool-call"),
|
|
2182
2196
|
code: z12.string()
|
|
@@ -2191,18 +2205,142 @@ var codeExecution_20260120InputSchema = lazySchema11(
|
|
|
2191
2205
|
command: z12.literal("view"),
|
|
2192
2206
|
path: z12.string()
|
|
2193
2207
|
}),
|
|
2194
|
-
z12.object({
|
|
2195
|
-
type: z12.literal("text_editor_code_execution"),
|
|
2196
|
-
command: z12.literal("create"),
|
|
2197
|
-
path: z12.string(),
|
|
2198
|
-
file_text: z12.string().nullish()
|
|
2208
|
+
z12.object({
|
|
2209
|
+
type: z12.literal("text_editor_code_execution"),
|
|
2210
|
+
command: z12.literal("create"),
|
|
2211
|
+
path: z12.string(),
|
|
2212
|
+
file_text: z12.string().nullish()
|
|
2213
|
+
}),
|
|
2214
|
+
z12.object({
|
|
2215
|
+
type: z12.literal("text_editor_code_execution"),
|
|
2216
|
+
command: z12.literal("str_replace"),
|
|
2217
|
+
path: z12.string(),
|
|
2218
|
+
old_str: z12.string(),
|
|
2219
|
+
new_str: z12.string()
|
|
2220
|
+
})
|
|
2221
|
+
])
|
|
2222
|
+
])
|
|
2223
|
+
)
|
|
2224
|
+
);
|
|
2225
|
+
var factory8 = createProviderToolFactoryWithOutputSchema7({
|
|
2226
|
+
id: "anthropic.code_execution_20250825",
|
|
2227
|
+
inputSchema: codeExecution_20250825InputSchema,
|
|
2228
|
+
outputSchema: codeExecution_20250825OutputSchema,
|
|
2229
|
+
// Programmatic tool calling: tool results may be deferred to a later turn
|
|
2230
|
+
// when code execution triggers a client-executed tool that needs to be
|
|
2231
|
+
// resolved before the code execution result can be returned.
|
|
2232
|
+
supportsDeferredResults: true
|
|
2233
|
+
});
|
|
2234
|
+
var codeExecution_20250825 = (args = {}) => {
|
|
2235
|
+
return factory8(args);
|
|
2236
|
+
};
|
|
2237
|
+
|
|
2238
|
+
// src/tool/code-execution_20260120.ts
|
|
2239
|
+
import {
|
|
2240
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
2241
|
+
lazySchema as lazySchema12,
|
|
2242
|
+
zodSchema as zodSchema12
|
|
2243
|
+
} from "@ai-sdk/provider-utils";
|
|
2244
|
+
import { z as z13 } from "zod/v4";
|
|
2245
|
+
var codeExecution_20260120OutputSchema = lazySchema12(
|
|
2246
|
+
() => zodSchema12(
|
|
2247
|
+
z13.discriminatedUnion("type", [
|
|
2248
|
+
z13.object({
|
|
2249
|
+
type: z13.literal("code_execution_result"),
|
|
2250
|
+
stdout: z13.string(),
|
|
2251
|
+
stderr: z13.string(),
|
|
2252
|
+
return_code: z13.number(),
|
|
2253
|
+
content: z13.array(
|
|
2254
|
+
z13.object({
|
|
2255
|
+
type: z13.literal("code_execution_output"),
|
|
2256
|
+
file_id: z13.string()
|
|
2257
|
+
})
|
|
2258
|
+
).optional().default([])
|
|
2259
|
+
}),
|
|
2260
|
+
z13.object({
|
|
2261
|
+
type: z13.literal("encrypted_code_execution_result"),
|
|
2262
|
+
encrypted_stdout: z13.string(),
|
|
2263
|
+
stderr: z13.string(),
|
|
2264
|
+
return_code: z13.number(),
|
|
2265
|
+
content: z13.array(
|
|
2266
|
+
z13.object({
|
|
2267
|
+
type: z13.literal("code_execution_output"),
|
|
2268
|
+
file_id: z13.string()
|
|
2269
|
+
})
|
|
2270
|
+
).optional().default([])
|
|
2271
|
+
}),
|
|
2272
|
+
z13.object({
|
|
2273
|
+
type: z13.literal("bash_code_execution_result"),
|
|
2274
|
+
content: z13.array(
|
|
2275
|
+
z13.object({
|
|
2276
|
+
type: z13.literal("bash_code_execution_output"),
|
|
2277
|
+
file_id: z13.string()
|
|
2278
|
+
})
|
|
2279
|
+
),
|
|
2280
|
+
stdout: z13.string(),
|
|
2281
|
+
stderr: z13.string(),
|
|
2282
|
+
return_code: z13.number()
|
|
2283
|
+
}),
|
|
2284
|
+
z13.object({
|
|
2285
|
+
type: z13.literal("bash_code_execution_tool_result_error"),
|
|
2286
|
+
error_code: z13.string()
|
|
2287
|
+
}),
|
|
2288
|
+
z13.object({
|
|
2289
|
+
type: z13.literal("text_editor_code_execution_tool_result_error"),
|
|
2290
|
+
error_code: z13.string()
|
|
2291
|
+
}),
|
|
2292
|
+
z13.object({
|
|
2293
|
+
type: z13.literal("text_editor_code_execution_view_result"),
|
|
2294
|
+
content: z13.string(),
|
|
2295
|
+
file_type: z13.string(),
|
|
2296
|
+
num_lines: z13.number().nullable(),
|
|
2297
|
+
start_line: z13.number().nullable(),
|
|
2298
|
+
total_lines: z13.number().nullable()
|
|
2299
|
+
}),
|
|
2300
|
+
z13.object({
|
|
2301
|
+
type: z13.literal("text_editor_code_execution_create_result"),
|
|
2302
|
+
is_file_update: z13.boolean()
|
|
2303
|
+
}),
|
|
2304
|
+
z13.object({
|
|
2305
|
+
type: z13.literal("text_editor_code_execution_str_replace_result"),
|
|
2306
|
+
lines: z13.array(z13.string()).nullable(),
|
|
2307
|
+
new_lines: z13.number().nullable(),
|
|
2308
|
+
new_start: z13.number().nullable(),
|
|
2309
|
+
old_lines: z13.number().nullable(),
|
|
2310
|
+
old_start: z13.number().nullable()
|
|
2311
|
+
})
|
|
2312
|
+
])
|
|
2313
|
+
)
|
|
2314
|
+
);
|
|
2315
|
+
var codeExecution_20260120InputSchema = lazySchema12(
|
|
2316
|
+
() => zodSchema12(
|
|
2317
|
+
z13.discriminatedUnion("type", [
|
|
2318
|
+
z13.object({
|
|
2319
|
+
type: z13.literal("programmatic-tool-call"),
|
|
2320
|
+
code: z13.string()
|
|
2321
|
+
}),
|
|
2322
|
+
z13.object({
|
|
2323
|
+
type: z13.literal("bash_code_execution"),
|
|
2324
|
+
command: z13.string()
|
|
2325
|
+
}),
|
|
2326
|
+
z13.discriminatedUnion("command", [
|
|
2327
|
+
z13.object({
|
|
2328
|
+
type: z13.literal("text_editor_code_execution"),
|
|
2329
|
+
command: z13.literal("view"),
|
|
2330
|
+
path: z13.string()
|
|
2331
|
+
}),
|
|
2332
|
+
z13.object({
|
|
2333
|
+
type: z13.literal("text_editor_code_execution"),
|
|
2334
|
+
command: z13.literal("create"),
|
|
2335
|
+
path: z13.string(),
|
|
2336
|
+
file_text: z13.string().nullish()
|
|
2199
2337
|
}),
|
|
2200
|
-
|
|
2201
|
-
type:
|
|
2202
|
-
command:
|
|
2203
|
-
path:
|
|
2204
|
-
old_str:
|
|
2205
|
-
new_str:
|
|
2338
|
+
z13.object({
|
|
2339
|
+
type: z13.literal("text_editor_code_execution"),
|
|
2340
|
+
command: z13.literal("str_replace"),
|
|
2341
|
+
path: z13.string(),
|
|
2342
|
+
old_str: z13.string(),
|
|
2343
|
+
new_str: z13.string()
|
|
2206
2344
|
})
|
|
2207
2345
|
])
|
|
2208
2346
|
])
|
|
@@ -2221,23 +2359,23 @@ var codeExecution_20260120 = (args = {}) => {
|
|
|
2221
2359
|
// src/tool/tool-search-regex_20251119.ts
|
|
2222
2360
|
import {
|
|
2223
2361
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
2224
|
-
lazySchema as
|
|
2225
|
-
zodSchema as
|
|
2362
|
+
lazySchema as lazySchema13,
|
|
2363
|
+
zodSchema as zodSchema13
|
|
2226
2364
|
} from "@ai-sdk/provider-utils";
|
|
2227
|
-
import { z as
|
|
2228
|
-
var toolSearchRegex_20251119OutputSchema =
|
|
2229
|
-
() =>
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
type:
|
|
2233
|
-
toolName:
|
|
2365
|
+
import { z as z14 } from "zod/v4";
|
|
2366
|
+
var toolSearchRegex_20251119OutputSchema = lazySchema13(
|
|
2367
|
+
() => zodSchema13(
|
|
2368
|
+
z14.array(
|
|
2369
|
+
z14.object({
|
|
2370
|
+
type: z14.literal("tool_reference"),
|
|
2371
|
+
toolName: z14.string()
|
|
2234
2372
|
})
|
|
2235
2373
|
)
|
|
2236
2374
|
)
|
|
2237
2375
|
);
|
|
2238
|
-
var toolSearchRegex_20251119InputSchema =
|
|
2239
|
-
() =>
|
|
2240
|
-
|
|
2376
|
+
var toolSearchRegex_20251119InputSchema = lazySchema13(
|
|
2377
|
+
() => zodSchema13(
|
|
2378
|
+
z14.object({
|
|
2241
2379
|
/**
|
|
2242
2380
|
* A regex pattern to search for tools.
|
|
2243
2381
|
* Uses Python re.search() syntax. Maximum 200 characters.
|
|
@@ -2248,11 +2386,11 @@ var toolSearchRegex_20251119InputSchema = lazySchema12(
|
|
|
2248
2386
|
* - "database.*query|query.*database" - OR patterns for flexibility
|
|
2249
2387
|
* - "(?i)slack" - case-insensitive search
|
|
2250
2388
|
*/
|
|
2251
|
-
pattern:
|
|
2389
|
+
pattern: z14.string(),
|
|
2252
2390
|
/**
|
|
2253
2391
|
* Maximum number of tools to return. Optional.
|
|
2254
2392
|
*/
|
|
2255
|
-
limit:
|
|
2393
|
+
limit: z14.number().optional()
|
|
2256
2394
|
})
|
|
2257
2395
|
)
|
|
2258
2396
|
);
|
|
@@ -2312,7 +2450,8 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2312
2450
|
sendReasoning,
|
|
2313
2451
|
warnings,
|
|
2314
2452
|
cacheControlValidator,
|
|
2315
|
-
toolNameMapping
|
|
2453
|
+
toolNameMapping,
|
|
2454
|
+
toolsetNames = {}
|
|
2316
2455
|
}) {
|
|
2317
2456
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
2318
2457
|
const betas = /* @__PURE__ */ new Set();
|
|
@@ -2415,7 +2554,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2415
2554
|
betas.add("mid-conversation-system-clear-at-2026-08-21");
|
|
2416
2555
|
}
|
|
2417
2556
|
if (systemMessages.some((message) => message.output_config != null)) {
|
|
2418
|
-
betas.add("mid-conversation-
|
|
2557
|
+
betas.add("mid-conversation-output-config-2026-07-01");
|
|
2419
2558
|
}
|
|
2420
2559
|
}
|
|
2421
2560
|
break;
|
|
@@ -2634,9 +2773,15 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2634
2773
|
contentValue = JSON.stringify(output.value);
|
|
2635
2774
|
break;
|
|
2636
2775
|
}
|
|
2776
|
+
const toolsetName = getAnthropicToolsetName({
|
|
2777
|
+
toolName: part.toolName,
|
|
2778
|
+
providerOptions: part.providerOptions,
|
|
2779
|
+
toolsetNames
|
|
2780
|
+
});
|
|
2637
2781
|
anthropicContent.push({
|
|
2638
2782
|
type: "tool_result",
|
|
2639
2783
|
tool_use_id: part.toolCallId,
|
|
2784
|
+
...toolsetName != null && { toolset_name: toolsetName },
|
|
2640
2785
|
content: contentValue,
|
|
2641
2786
|
is_error: output.type === "error-text" || output.type === "error-json" ? true : void 0,
|
|
2642
2787
|
cache_control: cacheControl
|
|
@@ -2834,6 +2979,31 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2834
2979
|
}
|
|
2835
2980
|
break;
|
|
2836
2981
|
}
|
|
2982
|
+
const toolsetName = getAnthropicToolsetName({
|
|
2983
|
+
toolName: part.toolName,
|
|
2984
|
+
providerOptions: part.providerOptions,
|
|
2985
|
+
toolsetNames
|
|
2986
|
+
});
|
|
2987
|
+
if (toolsetName != null) {
|
|
2988
|
+
const { action, ...memberInput } = typeof part.input === "object" && part.input !== null && !Array.isArray(part.input) ? part.input : {};
|
|
2989
|
+
if (typeof action !== "string") {
|
|
2990
|
+
warnings.push({
|
|
2991
|
+
type: "other",
|
|
2992
|
+
message: `toolset tool call for tool ${part.toolName} is missing the action`
|
|
2993
|
+
});
|
|
2994
|
+
break;
|
|
2995
|
+
}
|
|
2996
|
+
anthropicContent.push({
|
|
2997
|
+
type: "tool_use",
|
|
2998
|
+
id: part.toolCallId,
|
|
2999
|
+
name: action,
|
|
3000
|
+
toolset_name: toolsetName,
|
|
3001
|
+
input: memberInput,
|
|
3002
|
+
...caller && { caller },
|
|
3003
|
+
cache_control: cacheControl
|
|
3004
|
+
});
|
|
3005
|
+
break;
|
|
3006
|
+
}
|
|
2837
3007
|
anthropicContent.push({
|
|
2838
3008
|
type: "tool_use",
|
|
2839
3009
|
id: part.toolCallId,
|
|
@@ -3251,6 +3421,19 @@ function moveToolUseBlocksToEnd(content) {
|
|
|
3251
3421
|
flushSegment();
|
|
3252
3422
|
return result;
|
|
3253
3423
|
}
|
|
3424
|
+
function getAnthropicToolsetName({
|
|
3425
|
+
toolName,
|
|
3426
|
+
providerOptions,
|
|
3427
|
+
toolsetNames
|
|
3428
|
+
}) {
|
|
3429
|
+
var _a;
|
|
3430
|
+
const fromTools = toolsetNames[toolName];
|
|
3431
|
+
if (fromTools != null) {
|
|
3432
|
+
return fromTools;
|
|
3433
|
+
}
|
|
3434
|
+
const fromMetadata = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.toolsetName;
|
|
3435
|
+
return typeof fromMetadata === "string" ? fromMetadata : void 0;
|
|
3436
|
+
}
|
|
3254
3437
|
function getAnthropicCaller(providerOptions) {
|
|
3255
3438
|
var _a;
|
|
3256
3439
|
const caller = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.caller;
|
|
@@ -3488,6 +3671,24 @@ function getAnthropicCallerMetadata(caller) {
|
|
|
3488
3671
|
const callerInfo = getAnthropicCallerInfo(caller);
|
|
3489
3672
|
return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
|
|
3490
3673
|
}
|
|
3674
|
+
function getAnthropicToolsetNames(tools) {
|
|
3675
|
+
const toolsetNames = {};
|
|
3676
|
+
for (const tool of tools != null ? tools : []) {
|
|
3677
|
+
if (tool.type === "provider" && tool.id === "anthropic.computer_toolset_20260801") {
|
|
3678
|
+
toolsetNames[tool.name] = "computer";
|
|
3679
|
+
}
|
|
3680
|
+
}
|
|
3681
|
+
return toolsetNames;
|
|
3682
|
+
}
|
|
3683
|
+
function toToolsetMemberInput({
|
|
3684
|
+
memberName,
|
|
3685
|
+
input
|
|
3686
|
+
}) {
|
|
3687
|
+
return {
|
|
3688
|
+
action: memberName,
|
|
3689
|
+
...typeof input === "object" && input !== null && !Array.isArray(input) ? input : {}
|
|
3690
|
+
};
|
|
3691
|
+
}
|
|
3491
3692
|
var AnthropicMessagesLanguageModel = class {
|
|
3492
3693
|
constructor(modelId, config) {
|
|
3493
3694
|
this.specificationVersion = "v3";
|
|
@@ -3589,6 +3790,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3589
3790
|
supportsStructuredOutput: modelSupportsStructuredOutput,
|
|
3590
3791
|
rejectsSamplingParameters,
|
|
3591
3792
|
rejectsThinkingDisabledAboveHighEffort,
|
|
3793
|
+
rejectsThinkingDisabled,
|
|
3794
|
+
rejectsForcedToolUse,
|
|
3592
3795
|
isKnownModel
|
|
3593
3796
|
} = getModelCapabilities(this.modelId);
|
|
3594
3797
|
if (!isKnownModel && maxOutputTokens == null) {
|
|
@@ -3628,7 +3831,15 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3628
3831
|
const supportsStructuredOutput = ((_a = this.config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
3629
3832
|
const supportsStrictTools = ((_b = this.config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
3630
3833
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
3631
|
-
|
|
3834
|
+
let useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
3835
|
+
if (!useStructuredOutput && rejectsForcedToolUse && supportsStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
|
|
3836
|
+
warnings.push({
|
|
3837
|
+
type: "unsupported",
|
|
3838
|
+
feature: "providerOptions.anthropic.structuredOutputMode",
|
|
3839
|
+
details: `structuredOutputMode 'jsonTool' is not supported by ${this.modelId} because it rejects forced tool use. Using 'outputFormat' instead.`
|
|
3840
|
+
});
|
|
3841
|
+
useStructuredOutput = true;
|
|
3842
|
+
}
|
|
3632
3843
|
const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
3633
3844
|
type: "function",
|
|
3634
3845
|
name: "json",
|
|
@@ -3652,6 +3863,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3652
3863
|
"anthropic.code_execution_20260120": "code_execution",
|
|
3653
3864
|
"anthropic.computer_20241022": "computer",
|
|
3654
3865
|
"anthropic.computer_20250124": "computer",
|
|
3866
|
+
"anthropic.computer_20251124": "computer",
|
|
3867
|
+
"anthropic.computer_toolset_20260801": "computer",
|
|
3655
3868
|
"anthropic.text_editor_20241022": "str_replace_editor",
|
|
3656
3869
|
"anthropic.text_editor_20250124": "str_replace_editor",
|
|
3657
3870
|
"anthropic.text_editor_20250429": "str_replace_based_edit_tool",
|
|
@@ -3668,13 +3881,34 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3668
3881
|
"anthropic.advisor_20260301": "advisor"
|
|
3669
3882
|
}
|
|
3670
3883
|
});
|
|
3884
|
+
const toolsetNames = getAnthropicToolsetNames(tools);
|
|
3671
3885
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({
|
|
3672
3886
|
prompt,
|
|
3673
3887
|
sendReasoning: (_d = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _d : true,
|
|
3674
3888
|
warnings,
|
|
3675
3889
|
cacheControlValidator,
|
|
3676
|
-
toolNameMapping
|
|
3890
|
+
toolNameMapping,
|
|
3891
|
+
toolsetNames
|
|
3677
3892
|
});
|
|
3893
|
+
if (rejectsThinkingDisabled && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null) {
|
|
3894
|
+
const requestedThinking = anthropicOptions.thinking;
|
|
3895
|
+
const requestedType = "type" in requestedThinking ? requestedThinking.type : void 0;
|
|
3896
|
+
if (requestedType === "disabled") {
|
|
3897
|
+
warnings.push({
|
|
3898
|
+
type: "unsupported",
|
|
3899
|
+
feature: "providerOptions.anthropic.thinking",
|
|
3900
|
+
details: `thinking cannot be disabled for ${this.modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
|
|
3901
|
+
});
|
|
3902
|
+
anthropicOptions.thinking = void 0;
|
|
3903
|
+
} else if (requestedType === "enabled") {
|
|
3904
|
+
warnings.push({
|
|
3905
|
+
type: "unsupported",
|
|
3906
|
+
feature: "providerOptions.anthropic.thinking",
|
|
3907
|
+
details: `budget-based thinking is not supported by ${this.modelId}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`
|
|
3908
|
+
});
|
|
3909
|
+
anthropicOptions.thinking = { type: "adaptive" };
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3678
3912
|
const thinking = anthropicOptions == null ? void 0 : anthropicOptions.thinking;
|
|
3679
3913
|
const thinkingType = thinking != null && "type" in thinking ? thinking.type : void 0;
|
|
3680
3914
|
if (rejectsThinkingDisabledAboveHighEffort && thinkingType === "disabled" && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
@@ -3946,7 +4180,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3946
4180
|
cacheControlValidator,
|
|
3947
4181
|
supportsStructuredOutput: false,
|
|
3948
4182
|
supportsStrictTools,
|
|
3949
|
-
defaultEagerInputStreaming
|
|
4183
|
+
defaultEagerInputStreaming,
|
|
4184
|
+
rejectsForcedToolUse
|
|
3950
4185
|
} : {
|
|
3951
4186
|
tools: tools != null ? tools : [],
|
|
3952
4187
|
toolChoice,
|
|
@@ -3954,7 +4189,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3954
4189
|
cacheControlValidator,
|
|
3955
4190
|
supportsStructuredOutput,
|
|
3956
4191
|
supportsStrictTools,
|
|
3957
|
-
defaultEagerInputStreaming
|
|
4192
|
+
defaultEagerInputStreaming,
|
|
4193
|
+
rejectsForcedToolUse
|
|
3958
4194
|
}
|
|
3959
4195
|
);
|
|
3960
4196
|
const cacheWarnings = cacheControlValidator.getWarnings();
|
|
@@ -4033,7 +4269,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4033
4269
|
});
|
|
4034
4270
|
}
|
|
4035
4271
|
async doGenerate(options) {
|
|
4036
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4272
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
4037
4273
|
const {
|
|
4038
4274
|
args,
|
|
4039
4275
|
warnings,
|
|
@@ -4149,6 +4385,24 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4149
4385
|
type: "text",
|
|
4150
4386
|
text: JSON.stringify(part.input)
|
|
4151
4387
|
});
|
|
4388
|
+
} else if (part.toolset_name != null) {
|
|
4389
|
+
content.push({
|
|
4390
|
+
type: "tool-call",
|
|
4391
|
+
toolCallId: part.id,
|
|
4392
|
+
toolName: toolNameMapping.toCustomToolName(part.toolset_name),
|
|
4393
|
+
input: JSON.stringify(
|
|
4394
|
+
toToolsetMemberInput({
|
|
4395
|
+
memberName: part.name,
|
|
4396
|
+
input: part.input
|
|
4397
|
+
})
|
|
4398
|
+
),
|
|
4399
|
+
providerMetadata: {
|
|
4400
|
+
anthropic: {
|
|
4401
|
+
toolsetName: part.toolset_name,
|
|
4402
|
+
...(_b = getAnthropicCallerMetadata(part.caller).providerMetadata) == null ? void 0 : _b.anthropic
|
|
4403
|
+
}
|
|
4404
|
+
}
|
|
4405
|
+
});
|
|
4152
4406
|
} else {
|
|
4153
4407
|
content.push({
|
|
4154
4408
|
type: "tool-call",
|
|
@@ -4246,7 +4500,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4246
4500
|
case "web_fetch_tool_result": {
|
|
4247
4501
|
if (part.content.type === "web_fetch_result") {
|
|
4248
4502
|
citationDocuments.push({
|
|
4249
|
-
title: (
|
|
4503
|
+
title: (_c = part.content.content.title) != null ? _c : part.content.url,
|
|
4250
4504
|
mediaType: part.content.content.source.media_type
|
|
4251
4505
|
});
|
|
4252
4506
|
content.push({
|
|
@@ -4312,7 +4566,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4312
4566
|
title: result.title,
|
|
4313
4567
|
providerMetadata: {
|
|
4314
4568
|
anthropic: {
|
|
4315
|
-
pageAge: (
|
|
4569
|
+
pageAge: (_d = result.page_age) != null ? _d : null
|
|
4316
4570
|
}
|
|
4317
4571
|
}
|
|
4318
4572
|
});
|
|
@@ -4344,7 +4598,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4344
4598
|
stdout: part.content.stdout,
|
|
4345
4599
|
stderr: part.content.stderr,
|
|
4346
4600
|
return_code: part.content.return_code,
|
|
4347
|
-
content: (
|
|
4601
|
+
content: (_e = part.content.content) != null ? _e : []
|
|
4348
4602
|
}
|
|
4349
4603
|
});
|
|
4350
4604
|
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
@@ -4357,7 +4611,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4357
4611
|
encrypted_stdout: part.content.encrypted_stdout,
|
|
4358
4612
|
stderr: part.content.stderr,
|
|
4359
4613
|
return_code: part.content.return_code,
|
|
4360
|
-
content: (
|
|
4614
|
+
content: (_f = part.content.content) != null ? _f : []
|
|
4361
4615
|
}
|
|
4362
4616
|
});
|
|
4363
4617
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
@@ -4479,13 +4733,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4479
4733
|
finishReason: response.stop_reason,
|
|
4480
4734
|
isJsonResponseFromTool
|
|
4481
4735
|
}),
|
|
4482
|
-
raw: (
|
|
4736
|
+
raw: (_g = response.stop_reason) != null ? _g : void 0
|
|
4483
4737
|
},
|
|
4484
4738
|
usage: convertAnthropicMessagesUsage({ usage: response.usage }),
|
|
4485
4739
|
request: { body: args },
|
|
4486
4740
|
response: {
|
|
4487
|
-
id: (
|
|
4488
|
-
modelId: (
|
|
4741
|
+
id: (_h = response.id) != null ? _h : void 0,
|
|
4742
|
+
modelId: (_i = response.model) != null ? _i : void 0,
|
|
4489
4743
|
headers: responseHeaders,
|
|
4490
4744
|
body: rawResponse
|
|
4491
4745
|
},
|
|
@@ -4689,6 +4943,29 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
4689
4943
|
type: "text-start",
|
|
4690
4944
|
id: String(value.index)
|
|
4691
4945
|
});
|
|
4946
|
+
} else if (part.toolset_name != null) {
|
|
4947
|
+
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
4948
|
+
const customToolName = toolNameMapping.toCustomToolName(
|
|
4949
|
+
part.toolset_name
|
|
4950
|
+
);
|
|
4951
|
+
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
4952
|
+
contentBlocks[value.index] = {
|
|
4953
|
+
type: "tool-call",
|
|
4954
|
+
toolCallId: part.id,
|
|
4955
|
+
toolName: customToolName,
|
|
4956
|
+
input: hasNonEmptyInput ? JSON.stringify(part.input) : "",
|
|
4957
|
+
firstDelta: true,
|
|
4958
|
+
toolset: {
|
|
4959
|
+
name: part.toolset_name,
|
|
4960
|
+
memberName: part.name
|
|
4961
|
+
},
|
|
4962
|
+
...callerInfo && { caller: callerInfo }
|
|
4963
|
+
};
|
|
4964
|
+
controller.enqueue({
|
|
4965
|
+
type: "tool-input-start",
|
|
4966
|
+
id: part.id,
|
|
4967
|
+
toolName: customToolName
|
|
4968
|
+
});
|
|
4692
4969
|
} else {
|
|
4693
4970
|
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
4694
4971
|
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
@@ -5082,6 +5359,25 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
5082
5359
|
case "tool-call":
|
|
5083
5360
|
const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === "json";
|
|
5084
5361
|
if (!isJsonResponseTool) {
|
|
5362
|
+
if (contentBlock.toolset != null) {
|
|
5363
|
+
let memberInput = {};
|
|
5364
|
+
try {
|
|
5365
|
+
memberInput = contentBlock.input === "" ? {} : secureJsonParse2(contentBlock.input);
|
|
5366
|
+
} catch (e) {
|
|
5367
|
+
memberInput = void 0;
|
|
5368
|
+
}
|
|
5369
|
+
contentBlock.input = memberInput === void 0 ? contentBlock.input : JSON.stringify(
|
|
5370
|
+
toToolsetMemberInput({
|
|
5371
|
+
memberName: contentBlock.toolset.memberName,
|
|
5372
|
+
input: memberInput
|
|
5373
|
+
})
|
|
5374
|
+
);
|
|
5375
|
+
controller.enqueue({
|
|
5376
|
+
type: "tool-input-delta",
|
|
5377
|
+
id: contentBlock.toolCallId,
|
|
5378
|
+
delta: contentBlock.input
|
|
5379
|
+
});
|
|
5380
|
+
}
|
|
5085
5381
|
controller.enqueue({
|
|
5086
5382
|
type: "tool-input-end",
|
|
5087
5383
|
id: contentBlock.toolCallId
|
|
@@ -5110,10 +5406,15 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
5110
5406
|
// tool was not explicitly provided. We therefore bypass the general validation by marking the
|
|
5111
5407
|
// tool as dynamic.
|
|
5112
5408
|
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
5113
|
-
...contentBlock.caller && {
|
|
5409
|
+
...(contentBlock.caller || contentBlock.toolset) && {
|
|
5114
5410
|
providerMetadata: {
|
|
5115
5411
|
anthropic: {
|
|
5116
|
-
|
|
5412
|
+
...contentBlock.toolset && {
|
|
5413
|
+
toolsetName: contentBlock.toolset.name
|
|
5414
|
+
},
|
|
5415
|
+
...contentBlock.caller && {
|
|
5416
|
+
caller: contentBlock.caller
|
|
5417
|
+
}
|
|
5117
5418
|
}
|
|
5118
5419
|
}
|
|
5119
5420
|
}
|
|
@@ -5192,6 +5493,10 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
5192
5493
|
if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
|
|
5193
5494
|
return;
|
|
5194
5495
|
}
|
|
5496
|
+
if (contentBlock.toolset != null) {
|
|
5497
|
+
contentBlock.input += delta;
|
|
5498
|
+
return;
|
|
5499
|
+
}
|
|
5195
5500
|
if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
|
|
5196
5501
|
delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
|
|
5197
5502
|
}
|
|
@@ -5450,20 +5755,54 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
5450
5755
|
}
|
|
5451
5756
|
};
|
|
5452
5757
|
function getModelCapabilities(modelId) {
|
|
5453
|
-
if (modelId.includes("claude-opus-5")) {
|
|
5758
|
+
if (modelId.includes("claude-opus-5-5")) {
|
|
5759
|
+
return {
|
|
5760
|
+
maxOutputTokens: 128e3,
|
|
5761
|
+
supportsStructuredOutput: true,
|
|
5762
|
+
rejectsSamplingParameters: true,
|
|
5763
|
+
rejectsThinkingDisabledAboveHighEffort: true,
|
|
5764
|
+
rejectsThinkingDisabled: true,
|
|
5765
|
+
rejectsForcedToolUse: true,
|
|
5766
|
+
isKnownModel: true
|
|
5767
|
+
};
|
|
5768
|
+
} else if (modelId.includes("claude-opus-5")) {
|
|
5454
5769
|
return {
|
|
5455
5770
|
maxOutputTokens: 128e3,
|
|
5456
5771
|
supportsStructuredOutput: true,
|
|
5457
5772
|
rejectsSamplingParameters: true,
|
|
5458
5773
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
5774
|
+
rejectsThinkingDisabled: false,
|
|
5775
|
+
rejectsForcedToolUse: false,
|
|
5776
|
+
isKnownModel: true
|
|
5777
|
+
};
|
|
5778
|
+
} else if (modelId.includes("claude-fable-5-1")) {
|
|
5779
|
+
return {
|
|
5780
|
+
maxOutputTokens: 128e3,
|
|
5781
|
+
supportsStructuredOutput: true,
|
|
5782
|
+
rejectsSamplingParameters: true,
|
|
5783
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5784
|
+
rejectsThinkingDisabled: true,
|
|
5785
|
+
rejectsForcedToolUse: true,
|
|
5786
|
+
isKnownModel: true
|
|
5787
|
+
};
|
|
5788
|
+
} else if (modelId.includes("claude-fable-5")) {
|
|
5789
|
+
return {
|
|
5790
|
+
maxOutputTokens: 128e3,
|
|
5791
|
+
supportsStructuredOutput: true,
|
|
5792
|
+
rejectsSamplingParameters: true,
|
|
5793
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5794
|
+
rejectsThinkingDisabled: true,
|
|
5795
|
+
rejectsForcedToolUse: false,
|
|
5459
5796
|
isKnownModel: true
|
|
5460
5797
|
};
|
|
5461
|
-
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-
|
|
5798
|
+
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) {
|
|
5462
5799
|
return {
|
|
5463
5800
|
maxOutputTokens: 128e3,
|
|
5464
5801
|
supportsStructuredOutput: true,
|
|
5465
5802
|
rejectsSamplingParameters: true,
|
|
5466
5803
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5804
|
+
rejectsThinkingDisabled: false,
|
|
5805
|
+
rejectsForcedToolUse: false,
|
|
5467
5806
|
isKnownModel: true
|
|
5468
5807
|
};
|
|
5469
5808
|
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
@@ -5472,6 +5811,8 @@ function getModelCapabilities(modelId) {
|
|
|
5472
5811
|
supportsStructuredOutput: true,
|
|
5473
5812
|
rejectsSamplingParameters: false,
|
|
5474
5813
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5814
|
+
rejectsThinkingDisabled: false,
|
|
5815
|
+
rejectsForcedToolUse: false,
|
|
5475
5816
|
isKnownModel: true
|
|
5476
5817
|
};
|
|
5477
5818
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
@@ -5480,6 +5821,8 @@ function getModelCapabilities(modelId) {
|
|
|
5480
5821
|
supportsStructuredOutput: true,
|
|
5481
5822
|
rejectsSamplingParameters: false,
|
|
5482
5823
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5824
|
+
rejectsThinkingDisabled: false,
|
|
5825
|
+
rejectsForcedToolUse: false,
|
|
5483
5826
|
isKnownModel: true
|
|
5484
5827
|
};
|
|
5485
5828
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
@@ -5488,6 +5831,8 @@ function getModelCapabilities(modelId) {
|
|
|
5488
5831
|
supportsStructuredOutput: true,
|
|
5489
5832
|
rejectsSamplingParameters: false,
|
|
5490
5833
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5834
|
+
rejectsThinkingDisabled: false,
|
|
5835
|
+
rejectsForcedToolUse: false,
|
|
5491
5836
|
isKnownModel: true
|
|
5492
5837
|
};
|
|
5493
5838
|
} else if (modelId.includes("claude-sonnet-4-")) {
|
|
@@ -5496,6 +5841,8 @@ function getModelCapabilities(modelId) {
|
|
|
5496
5841
|
supportsStructuredOutput: false,
|
|
5497
5842
|
rejectsSamplingParameters: false,
|
|
5498
5843
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5844
|
+
rejectsThinkingDisabled: false,
|
|
5845
|
+
rejectsForcedToolUse: false,
|
|
5499
5846
|
isKnownModel: true
|
|
5500
5847
|
};
|
|
5501
5848
|
} else if (modelId.includes("claude-opus-4-")) {
|
|
@@ -5504,6 +5851,8 @@ function getModelCapabilities(modelId) {
|
|
|
5504
5851
|
supportsStructuredOutput: false,
|
|
5505
5852
|
rejectsSamplingParameters: false,
|
|
5506
5853
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5854
|
+
rejectsThinkingDisabled: false,
|
|
5855
|
+
rejectsForcedToolUse: false,
|
|
5507
5856
|
isKnownModel: true
|
|
5508
5857
|
};
|
|
5509
5858
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
@@ -5512,6 +5861,8 @@ function getModelCapabilities(modelId) {
|
|
|
5512
5861
|
supportsStructuredOutput: false,
|
|
5513
5862
|
rejectsSamplingParameters: false,
|
|
5514
5863
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5864
|
+
rejectsThinkingDisabled: false,
|
|
5865
|
+
rejectsForcedToolUse: false,
|
|
5515
5866
|
isKnownModel: true
|
|
5516
5867
|
};
|
|
5517
5868
|
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
@@ -5520,6 +5871,8 @@ function getModelCapabilities(modelId) {
|
|
|
5520
5871
|
supportsStructuredOutput: false,
|
|
5521
5872
|
rejectsSamplingParameters: false,
|
|
5522
5873
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5874
|
+
rejectsThinkingDisabled: false,
|
|
5875
|
+
rejectsForcedToolUse: false,
|
|
5523
5876
|
isKnownModel: false
|
|
5524
5877
|
};
|
|
5525
5878
|
} else if (modelId.includes("claude-")) {
|
|
@@ -5528,6 +5881,8 @@ function getModelCapabilities(modelId) {
|
|
|
5528
5881
|
supportsStructuredOutput: true,
|
|
5529
5882
|
rejectsSamplingParameters: true,
|
|
5530
5883
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
5884
|
+
rejectsThinkingDisabled: false,
|
|
5885
|
+
rejectsForcedToolUse: false,
|
|
5531
5886
|
isKnownModel: false
|
|
5532
5887
|
};
|
|
5533
5888
|
} else {
|
|
@@ -5536,6 +5891,8 @@ function getModelCapabilities(modelId) {
|
|
|
5536
5891
|
supportsStructuredOutput: false,
|
|
5537
5892
|
rejectsSamplingParameters: false,
|
|
5538
5893
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5894
|
+
rejectsThinkingDisabled: false,
|
|
5895
|
+
rejectsForcedToolUse: false,
|
|
5539
5896
|
isKnownModel: false
|
|
5540
5897
|
};
|
|
5541
5898
|
}
|
|
@@ -5551,7 +5908,7 @@ function hasWebTool20260209WithoutCodeExecution(tools) {
|
|
|
5551
5908
|
hasWebTool20260209 = true;
|
|
5552
5909
|
continue;
|
|
5553
5910
|
}
|
|
5554
|
-
if (tool.name === "code_execution") {
|
|
5911
|
+
if ("name" in tool && tool.name === "code_execution") {
|
|
5555
5912
|
hasCodeExecutionTool = true;
|
|
5556
5913
|
break;
|
|
5557
5914
|
}
|
|
@@ -5596,33 +5953,13 @@ function mapAnthropicStopDetails(stopDetails) {
|
|
|
5596
5953
|
}
|
|
5597
5954
|
|
|
5598
5955
|
// src/tool/bash_20241022.ts
|
|
5599
|
-
import {
|
|
5600
|
-
createProviderToolFactory as createProviderToolFactory2,
|
|
5601
|
-
lazySchema as lazySchema13,
|
|
5602
|
-
zodSchema as zodSchema13
|
|
5603
|
-
} from "@ai-sdk/provider-utils";
|
|
5604
|
-
import { z as z14 } from "zod/v4";
|
|
5605
|
-
var bash_20241022InputSchema = lazySchema13(
|
|
5606
|
-
() => zodSchema13(
|
|
5607
|
-
z14.object({
|
|
5608
|
-
command: z14.string(),
|
|
5609
|
-
restart: z14.boolean().optional()
|
|
5610
|
-
})
|
|
5611
|
-
)
|
|
5612
|
-
);
|
|
5613
|
-
var bash_20241022 = createProviderToolFactory2({
|
|
5614
|
-
id: "anthropic.bash_20241022",
|
|
5615
|
-
inputSchema: bash_20241022InputSchema
|
|
5616
|
-
});
|
|
5617
|
-
|
|
5618
|
-
// src/tool/bash_20250124.ts
|
|
5619
5956
|
import {
|
|
5620
5957
|
createProviderToolFactory as createProviderToolFactory3,
|
|
5621
5958
|
lazySchema as lazySchema14,
|
|
5622
5959
|
zodSchema as zodSchema14
|
|
5623
5960
|
} from "@ai-sdk/provider-utils";
|
|
5624
5961
|
import { z as z15 } from "zod/v4";
|
|
5625
|
-
var
|
|
5962
|
+
var bash_20241022InputSchema = lazySchema14(
|
|
5626
5963
|
() => zodSchema14(
|
|
5627
5964
|
z15.object({
|
|
5628
5965
|
command: z15.string(),
|
|
@@ -5630,22 +5967,42 @@ var bash_20250124InputSchema = lazySchema14(
|
|
|
5630
5967
|
})
|
|
5631
5968
|
)
|
|
5632
5969
|
);
|
|
5633
|
-
var
|
|
5634
|
-
id: "anthropic.
|
|
5635
|
-
inputSchema:
|
|
5970
|
+
var bash_20241022 = createProviderToolFactory3({
|
|
5971
|
+
id: "anthropic.bash_20241022",
|
|
5972
|
+
inputSchema: bash_20241022InputSchema
|
|
5636
5973
|
});
|
|
5637
5974
|
|
|
5638
|
-
// src/tool/
|
|
5975
|
+
// src/tool/bash_20250124.ts
|
|
5639
5976
|
import {
|
|
5640
5977
|
createProviderToolFactory as createProviderToolFactory4,
|
|
5641
5978
|
lazySchema as lazySchema15,
|
|
5642
5979
|
zodSchema as zodSchema15
|
|
5643
5980
|
} from "@ai-sdk/provider-utils";
|
|
5644
5981
|
import { z as z16 } from "zod/v4";
|
|
5645
|
-
var
|
|
5982
|
+
var bash_20250124InputSchema = lazySchema15(
|
|
5646
5983
|
() => zodSchema15(
|
|
5647
5984
|
z16.object({
|
|
5648
|
-
|
|
5985
|
+
command: z16.string(),
|
|
5986
|
+
restart: z16.boolean().optional()
|
|
5987
|
+
})
|
|
5988
|
+
)
|
|
5989
|
+
);
|
|
5990
|
+
var bash_20250124 = createProviderToolFactory4({
|
|
5991
|
+
id: "anthropic.bash_20250124",
|
|
5992
|
+
inputSchema: bash_20250124InputSchema
|
|
5993
|
+
});
|
|
5994
|
+
|
|
5995
|
+
// src/tool/computer_20241022.ts
|
|
5996
|
+
import {
|
|
5997
|
+
createProviderToolFactory as createProviderToolFactory5,
|
|
5998
|
+
lazySchema as lazySchema16,
|
|
5999
|
+
zodSchema as zodSchema16
|
|
6000
|
+
} from "@ai-sdk/provider-utils";
|
|
6001
|
+
import { z as z17 } from "zod/v4";
|
|
6002
|
+
var computer_20241022InputSchema = lazySchema16(
|
|
6003
|
+
() => zodSchema16(
|
|
6004
|
+
z17.object({
|
|
6005
|
+
action: z17.enum([
|
|
5649
6006
|
"key",
|
|
5650
6007
|
"type",
|
|
5651
6008
|
"mouse_move",
|
|
@@ -5657,27 +6014,27 @@ var computer_20241022InputSchema = lazySchema15(
|
|
|
5657
6014
|
"screenshot",
|
|
5658
6015
|
"cursor_position"
|
|
5659
6016
|
]),
|
|
5660
|
-
coordinate:
|
|
5661
|
-
text:
|
|
6017
|
+
coordinate: z17.array(z17.number().int()).optional(),
|
|
6018
|
+
text: z17.string().optional()
|
|
5662
6019
|
})
|
|
5663
6020
|
)
|
|
5664
6021
|
);
|
|
5665
|
-
var computer_20241022 =
|
|
6022
|
+
var computer_20241022 = createProviderToolFactory5({
|
|
5666
6023
|
id: "anthropic.computer_20241022",
|
|
5667
6024
|
inputSchema: computer_20241022InputSchema
|
|
5668
6025
|
});
|
|
5669
6026
|
|
|
5670
6027
|
// src/tool/computer_20250124.ts
|
|
5671
6028
|
import {
|
|
5672
|
-
createProviderToolFactory as
|
|
5673
|
-
lazySchema as
|
|
5674
|
-
zodSchema as
|
|
6029
|
+
createProviderToolFactory as createProviderToolFactory6,
|
|
6030
|
+
lazySchema as lazySchema17,
|
|
6031
|
+
zodSchema as zodSchema17
|
|
5675
6032
|
} from "@ai-sdk/provider-utils";
|
|
5676
|
-
import { z as
|
|
5677
|
-
var computer_20250124InputSchema =
|
|
5678
|
-
() =>
|
|
5679
|
-
|
|
5680
|
-
action:
|
|
6033
|
+
import { z as z18 } from "zod/v4";
|
|
6034
|
+
var computer_20250124InputSchema = lazySchema17(
|
|
6035
|
+
() => zodSchema17(
|
|
6036
|
+
z18.object({
|
|
6037
|
+
action: z18.enum([
|
|
5681
6038
|
"key",
|
|
5682
6039
|
"hold_key",
|
|
5683
6040
|
"type",
|
|
@@ -5695,31 +6052,31 @@ var computer_20250124InputSchema = lazySchema16(
|
|
|
5695
6052
|
"wait",
|
|
5696
6053
|
"screenshot"
|
|
5697
6054
|
]),
|
|
5698
|
-
coordinate:
|
|
5699
|
-
duration:
|
|
5700
|
-
scroll_amount:
|
|
5701
|
-
scroll_direction:
|
|
5702
|
-
start_coordinate:
|
|
5703
|
-
text:
|
|
6055
|
+
coordinate: z18.tuple([z18.number().int(), z18.number().int()]).optional(),
|
|
6056
|
+
duration: z18.number().optional(),
|
|
6057
|
+
scroll_amount: z18.number().optional(),
|
|
6058
|
+
scroll_direction: z18.enum(["up", "down", "left", "right"]).optional(),
|
|
6059
|
+
start_coordinate: z18.tuple([z18.number().int(), z18.number().int()]).optional(),
|
|
6060
|
+
text: z18.string().optional()
|
|
5704
6061
|
})
|
|
5705
6062
|
)
|
|
5706
6063
|
);
|
|
5707
|
-
var computer_20250124 =
|
|
6064
|
+
var computer_20250124 = createProviderToolFactory6({
|
|
5708
6065
|
id: "anthropic.computer_20250124",
|
|
5709
6066
|
inputSchema: computer_20250124InputSchema
|
|
5710
6067
|
});
|
|
5711
6068
|
|
|
5712
6069
|
// src/tool/computer_20251124.ts
|
|
5713
6070
|
import {
|
|
5714
|
-
createProviderToolFactory as
|
|
5715
|
-
lazySchema as
|
|
5716
|
-
zodSchema as
|
|
6071
|
+
createProviderToolFactory as createProviderToolFactory7,
|
|
6072
|
+
lazySchema as lazySchema18,
|
|
6073
|
+
zodSchema as zodSchema18
|
|
5717
6074
|
} from "@ai-sdk/provider-utils";
|
|
5718
|
-
import { z as
|
|
5719
|
-
var computer_20251124InputSchema =
|
|
5720
|
-
() =>
|
|
5721
|
-
|
|
5722
|
-
action:
|
|
6075
|
+
import { z as z19 } from "zod/v4";
|
|
6076
|
+
var computer_20251124InputSchema = lazySchema18(
|
|
6077
|
+
() => zodSchema18(
|
|
6078
|
+
z19.object({
|
|
6079
|
+
action: z19.enum([
|
|
5723
6080
|
"key",
|
|
5724
6081
|
"hold_key",
|
|
5725
6082
|
"type",
|
|
@@ -5738,109 +6095,83 @@ var computer_20251124InputSchema = lazySchema17(
|
|
|
5738
6095
|
"screenshot",
|
|
5739
6096
|
"zoom"
|
|
5740
6097
|
]),
|
|
5741
|
-
coordinate:
|
|
5742
|
-
duration:
|
|
5743
|
-
region:
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
6098
|
+
coordinate: z19.tuple([z19.number().int(), z19.number().int()]).optional(),
|
|
6099
|
+
duration: z19.number().optional(),
|
|
6100
|
+
region: z19.tuple([
|
|
6101
|
+
z19.number().int(),
|
|
6102
|
+
z19.number().int(),
|
|
6103
|
+
z19.number().int(),
|
|
6104
|
+
z19.number().int()
|
|
5748
6105
|
]).optional(),
|
|
5749
|
-
scroll_amount:
|
|
5750
|
-
scroll_direction:
|
|
5751
|
-
start_coordinate:
|
|
5752
|
-
text:
|
|
6106
|
+
scroll_amount: z19.number().optional(),
|
|
6107
|
+
scroll_direction: z19.enum(["up", "down", "left", "right"]).optional(),
|
|
6108
|
+
start_coordinate: z19.tuple([z19.number().int(), z19.number().int()]).optional(),
|
|
6109
|
+
text: z19.string().optional()
|
|
5753
6110
|
})
|
|
5754
6111
|
)
|
|
5755
6112
|
);
|
|
5756
|
-
var computer_20251124 =
|
|
6113
|
+
var computer_20251124 = createProviderToolFactory7({
|
|
5757
6114
|
id: "anthropic.computer_20251124",
|
|
5758
6115
|
inputSchema: computer_20251124InputSchema
|
|
5759
6116
|
});
|
|
5760
6117
|
|
|
5761
6118
|
// src/tool/memory_20250818.ts
|
|
5762
6119
|
import {
|
|
5763
|
-
createProviderToolFactory as
|
|
5764
|
-
lazySchema as
|
|
5765
|
-
zodSchema as
|
|
6120
|
+
createProviderToolFactory as createProviderToolFactory8,
|
|
6121
|
+
lazySchema as lazySchema19,
|
|
6122
|
+
zodSchema as zodSchema19
|
|
5766
6123
|
} from "@ai-sdk/provider-utils";
|
|
5767
|
-
import { z as
|
|
5768
|
-
var memory_20250818InputSchema =
|
|
5769
|
-
() =>
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
command:
|
|
5773
|
-
path:
|
|
5774
|
-
view_range:
|
|
6124
|
+
import { z as z20 } from "zod/v4";
|
|
6125
|
+
var memory_20250818InputSchema = lazySchema19(
|
|
6126
|
+
() => zodSchema19(
|
|
6127
|
+
z20.discriminatedUnion("command", [
|
|
6128
|
+
z20.object({
|
|
6129
|
+
command: z20.literal("view"),
|
|
6130
|
+
path: z20.string(),
|
|
6131
|
+
view_range: z20.tuple([z20.number(), z20.number()]).optional()
|
|
5775
6132
|
}),
|
|
5776
|
-
|
|
5777
|
-
command:
|
|
5778
|
-
path:
|
|
5779
|
-
file_text:
|
|
6133
|
+
z20.object({
|
|
6134
|
+
command: z20.literal("create"),
|
|
6135
|
+
path: z20.string(),
|
|
6136
|
+
file_text: z20.string()
|
|
5780
6137
|
}),
|
|
5781
|
-
|
|
5782
|
-
command:
|
|
5783
|
-
path:
|
|
5784
|
-
old_str:
|
|
5785
|
-
new_str:
|
|
6138
|
+
z20.object({
|
|
6139
|
+
command: z20.literal("str_replace"),
|
|
6140
|
+
path: z20.string(),
|
|
6141
|
+
old_str: z20.string(),
|
|
6142
|
+
new_str: z20.string()
|
|
5786
6143
|
}),
|
|
5787
|
-
|
|
5788
|
-
command:
|
|
5789
|
-
path:
|
|
5790
|
-
insert_line:
|
|
5791
|
-
insert_text:
|
|
6144
|
+
z20.object({
|
|
6145
|
+
command: z20.literal("insert"),
|
|
6146
|
+
path: z20.string(),
|
|
6147
|
+
insert_line: z20.number(),
|
|
6148
|
+
insert_text: z20.string()
|
|
5792
6149
|
}),
|
|
5793
|
-
|
|
5794
|
-
command:
|
|
5795
|
-
path:
|
|
6150
|
+
z20.object({
|
|
6151
|
+
command: z20.literal("delete"),
|
|
6152
|
+
path: z20.string()
|
|
5796
6153
|
}),
|
|
5797
|
-
|
|
5798
|
-
command:
|
|
5799
|
-
old_path:
|
|
5800
|
-
new_path:
|
|
6154
|
+
z20.object({
|
|
6155
|
+
command: z20.literal("rename"),
|
|
6156
|
+
old_path: z20.string(),
|
|
6157
|
+
new_path: z20.string()
|
|
5801
6158
|
})
|
|
5802
6159
|
])
|
|
5803
6160
|
)
|
|
5804
6161
|
);
|
|
5805
|
-
var memory_20250818 =
|
|
6162
|
+
var memory_20250818 = createProviderToolFactory8({
|
|
5806
6163
|
id: "anthropic.memory_20250818",
|
|
5807
6164
|
inputSchema: memory_20250818InputSchema
|
|
5808
6165
|
});
|
|
5809
6166
|
|
|
5810
6167
|
// src/tool/text-editor_20241022.ts
|
|
5811
|
-
import {
|
|
5812
|
-
createProviderToolFactory as createProviderToolFactory8,
|
|
5813
|
-
lazySchema as lazySchema19,
|
|
5814
|
-
zodSchema as zodSchema19
|
|
5815
|
-
} from "@ai-sdk/provider-utils";
|
|
5816
|
-
import { z as z20 } from "zod/v4";
|
|
5817
|
-
var textEditor_20241022InputSchema = lazySchema19(
|
|
5818
|
-
() => zodSchema19(
|
|
5819
|
-
z20.object({
|
|
5820
|
-
command: z20.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
5821
|
-
path: z20.string(),
|
|
5822
|
-
file_text: z20.string().optional(),
|
|
5823
|
-
insert_line: z20.number().int().optional(),
|
|
5824
|
-
new_str: z20.string().optional(),
|
|
5825
|
-
insert_text: z20.string().optional(),
|
|
5826
|
-
old_str: z20.string().optional(),
|
|
5827
|
-
view_range: z20.array(z20.number().int()).optional()
|
|
5828
|
-
})
|
|
5829
|
-
)
|
|
5830
|
-
);
|
|
5831
|
-
var textEditor_20241022 = createProviderToolFactory8({
|
|
5832
|
-
id: "anthropic.text_editor_20241022",
|
|
5833
|
-
inputSchema: textEditor_20241022InputSchema
|
|
5834
|
-
});
|
|
5835
|
-
|
|
5836
|
-
// src/tool/text-editor_20250124.ts
|
|
5837
6168
|
import {
|
|
5838
6169
|
createProviderToolFactory as createProviderToolFactory9,
|
|
5839
6170
|
lazySchema as lazySchema20,
|
|
5840
6171
|
zodSchema as zodSchema20
|
|
5841
6172
|
} from "@ai-sdk/provider-utils";
|
|
5842
6173
|
import { z as z21 } from "zod/v4";
|
|
5843
|
-
var
|
|
6174
|
+
var textEditor_20241022InputSchema = lazySchema20(
|
|
5844
6175
|
() => zodSchema20(
|
|
5845
6176
|
z21.object({
|
|
5846
6177
|
command: z21.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -5854,22 +6185,22 @@ var textEditor_20250124InputSchema = lazySchema20(
|
|
|
5854
6185
|
})
|
|
5855
6186
|
)
|
|
5856
6187
|
);
|
|
5857
|
-
var
|
|
5858
|
-
id: "anthropic.
|
|
5859
|
-
inputSchema:
|
|
6188
|
+
var textEditor_20241022 = createProviderToolFactory9({
|
|
6189
|
+
id: "anthropic.text_editor_20241022",
|
|
6190
|
+
inputSchema: textEditor_20241022InputSchema
|
|
5860
6191
|
});
|
|
5861
6192
|
|
|
5862
|
-
// src/tool/text-
|
|
6193
|
+
// src/tool/text-editor_20250124.ts
|
|
5863
6194
|
import {
|
|
5864
6195
|
createProviderToolFactory as createProviderToolFactory10,
|
|
5865
6196
|
lazySchema as lazySchema21,
|
|
5866
6197
|
zodSchema as zodSchema21
|
|
5867
6198
|
} from "@ai-sdk/provider-utils";
|
|
5868
6199
|
import { z as z22 } from "zod/v4";
|
|
5869
|
-
var
|
|
6200
|
+
var textEditor_20250124InputSchema = lazySchema21(
|
|
5870
6201
|
() => zodSchema21(
|
|
5871
6202
|
z22.object({
|
|
5872
|
-
command: z22.enum(["view", "create", "str_replace", "insert"]),
|
|
6203
|
+
command: z22.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
5873
6204
|
path: z22.string(),
|
|
5874
6205
|
file_text: z22.string().optional(),
|
|
5875
6206
|
insert_line: z22.number().int().optional(),
|
|
@@ -5880,40 +6211,66 @@ var textEditor_20250429InputSchema = lazySchema21(
|
|
|
5880
6211
|
})
|
|
5881
6212
|
)
|
|
5882
6213
|
);
|
|
5883
|
-
var
|
|
5884
|
-
id: "anthropic.
|
|
5885
|
-
inputSchema:
|
|
6214
|
+
var textEditor_20250124 = createProviderToolFactory10({
|
|
6215
|
+
id: "anthropic.text_editor_20250124",
|
|
6216
|
+
inputSchema: textEditor_20250124InputSchema
|
|
5886
6217
|
});
|
|
5887
6218
|
|
|
5888
|
-
// src/tool/
|
|
6219
|
+
// src/tool/text-editor_20250429.ts
|
|
5889
6220
|
import {
|
|
5890
|
-
|
|
6221
|
+
createProviderToolFactory as createProviderToolFactory11,
|
|
5891
6222
|
lazySchema as lazySchema22,
|
|
5892
6223
|
zodSchema as zodSchema22
|
|
5893
6224
|
} from "@ai-sdk/provider-utils";
|
|
5894
6225
|
import { z as z23 } from "zod/v4";
|
|
5895
|
-
var
|
|
6226
|
+
var textEditor_20250429InputSchema = lazySchema22(
|
|
5896
6227
|
() => zodSchema22(
|
|
5897
|
-
z23.
|
|
5898
|
-
z23.
|
|
5899
|
-
|
|
5900
|
-
|
|
6228
|
+
z23.object({
|
|
6229
|
+
command: z23.enum(["view", "create", "str_replace", "insert"]),
|
|
6230
|
+
path: z23.string(),
|
|
6231
|
+
file_text: z23.string().optional(),
|
|
6232
|
+
insert_line: z23.number().int().optional(),
|
|
6233
|
+
new_str: z23.string().optional(),
|
|
6234
|
+
insert_text: z23.string().optional(),
|
|
6235
|
+
old_str: z23.string().optional(),
|
|
6236
|
+
view_range: z23.array(z23.number().int()).optional()
|
|
6237
|
+
})
|
|
6238
|
+
)
|
|
6239
|
+
);
|
|
6240
|
+
var textEditor_20250429 = createProviderToolFactory11({
|
|
6241
|
+
id: "anthropic.text_editor_20250429",
|
|
6242
|
+
inputSchema: textEditor_20250429InputSchema
|
|
6243
|
+
});
|
|
6244
|
+
|
|
6245
|
+
// src/tool/tool-search-bm25_20251119.ts
|
|
6246
|
+
import {
|
|
6247
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,
|
|
6248
|
+
lazySchema as lazySchema23,
|
|
6249
|
+
zodSchema as zodSchema23
|
|
6250
|
+
} from "@ai-sdk/provider-utils";
|
|
6251
|
+
import { z as z24 } from "zod/v4";
|
|
6252
|
+
var toolSearchBm25_20251119OutputSchema = lazySchema23(
|
|
6253
|
+
() => zodSchema23(
|
|
6254
|
+
z24.array(
|
|
6255
|
+
z24.object({
|
|
6256
|
+
type: z24.literal("tool_reference"),
|
|
6257
|
+
toolName: z24.string()
|
|
5901
6258
|
})
|
|
5902
6259
|
)
|
|
5903
6260
|
)
|
|
5904
6261
|
);
|
|
5905
|
-
var toolSearchBm25_20251119InputSchema =
|
|
5906
|
-
() =>
|
|
5907
|
-
|
|
6262
|
+
var toolSearchBm25_20251119InputSchema = lazySchema23(
|
|
6263
|
+
() => zodSchema23(
|
|
6264
|
+
z24.object({
|
|
5908
6265
|
/**
|
|
5909
6266
|
* A natural language query to search for tools.
|
|
5910
6267
|
* Claude will use BM25 text search to find relevant tools.
|
|
5911
6268
|
*/
|
|
5912
|
-
query:
|
|
6269
|
+
query: z24.string(),
|
|
5913
6270
|
/**
|
|
5914
6271
|
* Maximum number of tools to return. Optional.
|
|
5915
6272
|
*/
|
|
5916
|
-
limit:
|
|
6273
|
+
limit: z24.number().optional()
|
|
5917
6274
|
})
|
|
5918
6275
|
)
|
|
5919
6276
|
);
|
|
@@ -6043,6 +6400,29 @@ var anthropicTools = {
|
|
|
6043
6400
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
6044
6401
|
*/
|
|
6045
6402
|
computer_20251124,
|
|
6403
|
+
/**
|
|
6404
|
+
* The computer toolset lets Claude control a computer through screenshots,
|
|
6405
|
+
* mouse, and keyboard. It replaces the versioned computer tools
|
|
6406
|
+
* (`computer_20251124` and earlier) on newer models.
|
|
6407
|
+
*
|
|
6408
|
+
* The API returns each computer action as its own `tool_use` block with
|
|
6409
|
+
* `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
|
|
6410
|
+
* and exposes the member name as `action`, so `execute` receives the same
|
|
6411
|
+
* input shape as the older computer tools. Claude may return several actions
|
|
6412
|
+
* in one turn.
|
|
6413
|
+
*
|
|
6414
|
+
* Coordinates are always in the pixel space of the screenshots you return;
|
|
6415
|
+
* there are no display size parameters. Zoom is enabled by default.
|
|
6416
|
+
*
|
|
6417
|
+
* Does not require a beta header.
|
|
6418
|
+
*
|
|
6419
|
+
* Supported models: Claude Opus 5.5 (required; older computer tool types
|
|
6420
|
+
* are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
|
|
6421
|
+
*
|
|
6422
|
+
* @param configs - Per-member settings keyed by member name, e.g.
|
|
6423
|
+
* `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
|
|
6424
|
+
*/
|
|
6425
|
+
computerToolset_20260801,
|
|
6046
6426
|
/**
|
|
6047
6427
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
6048
6428
|
* Claude can create, read, update, and delete files that persist between sessions,
|