@ai-sdk/anthropic 3.0.52 → 3.0.54
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 +98 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.js +635 -400
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +620 -376
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +100 -2
- package/dist/internal/index.d.ts +100 -2
- package/dist/internal/index.js +628 -393
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +619 -375
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-messages-api.ts +61 -2
- package/src/anthropic-messages-language-model.ts +64 -1
- package/src/anthropic-prepare-tools.ts +37 -0
- package/src/anthropic-tools.ts +23 -0
- package/src/convert-to-anthropic-messages-prompt.ts +8 -1
- package/src/tool/web-fetch-20260209.ts +145 -0
- package/src/tool/web-search_20260209.ts +136 -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.54" : "0.0.0-test";
|
|
16
16
|
|
|
17
17
|
// src/anthropic-messages-language-model.ts
|
|
18
18
|
import {
|
|
@@ -131,7 +131,16 @@ var anthropicMessagesResponseSchema = lazySchema2(
|
|
|
131
131
|
type: z2.literal("server_tool_use"),
|
|
132
132
|
id: z2.string(),
|
|
133
133
|
name: z2.string(),
|
|
134
|
-
input: z2.record(z2.string(), z2.unknown()).nullish()
|
|
134
|
+
input: z2.record(z2.string(), z2.unknown()).nullish(),
|
|
135
|
+
caller: z2.union([
|
|
136
|
+
z2.object({
|
|
137
|
+
type: z2.literal("code_execution_20260120"),
|
|
138
|
+
tool_id: z2.string()
|
|
139
|
+
}),
|
|
140
|
+
z2.object({
|
|
141
|
+
type: z2.literal("direct")
|
|
142
|
+
})
|
|
143
|
+
]).optional()
|
|
135
144
|
}),
|
|
136
145
|
z2.object({
|
|
137
146
|
type: z2.literal("mcp_tool_use"),
|
|
@@ -219,6 +228,18 @@ var anthropicMessagesResponseSchema = lazySchema2(
|
|
|
219
228
|
})
|
|
220
229
|
).optional().default([])
|
|
221
230
|
}),
|
|
231
|
+
z2.object({
|
|
232
|
+
type: z2.literal("encrypted_code_execution_result"),
|
|
233
|
+
encrypted_stdout: z2.string(),
|
|
234
|
+
stderr: z2.string(),
|
|
235
|
+
return_code: z2.number(),
|
|
236
|
+
content: z2.array(
|
|
237
|
+
z2.object({
|
|
238
|
+
type: z2.literal("code_execution_output"),
|
|
239
|
+
file_id: z2.string()
|
|
240
|
+
})
|
|
241
|
+
).optional().default([])
|
|
242
|
+
}),
|
|
222
243
|
z2.object({
|
|
223
244
|
type: z2.literal("code_execution_tool_result_error"),
|
|
224
245
|
error_code: z2.string()
|
|
@@ -441,7 +462,16 @@ var anthropicMessagesChunkSchema = lazySchema2(
|
|
|
441
462
|
type: z2.literal("server_tool_use"),
|
|
442
463
|
id: z2.string(),
|
|
443
464
|
name: z2.string(),
|
|
444
|
-
input: z2.record(z2.string(), z2.unknown()).nullish()
|
|
465
|
+
input: z2.record(z2.string(), z2.unknown()).nullish(),
|
|
466
|
+
caller: z2.union([
|
|
467
|
+
z2.object({
|
|
468
|
+
type: z2.literal("code_execution_20260120"),
|
|
469
|
+
tool_id: z2.string()
|
|
470
|
+
}),
|
|
471
|
+
z2.object({
|
|
472
|
+
type: z2.literal("direct")
|
|
473
|
+
})
|
|
474
|
+
]).optional()
|
|
445
475
|
}),
|
|
446
476
|
z2.object({
|
|
447
477
|
type: z2.literal("mcp_tool_use"),
|
|
@@ -529,6 +559,18 @@ var anthropicMessagesChunkSchema = lazySchema2(
|
|
|
529
559
|
})
|
|
530
560
|
).optional().default([])
|
|
531
561
|
}),
|
|
562
|
+
z2.object({
|
|
563
|
+
type: z2.literal("encrypted_code_execution_result"),
|
|
564
|
+
encrypted_stdout: z2.string(),
|
|
565
|
+
stderr: z2.string(),
|
|
566
|
+
return_code: z2.number(),
|
|
567
|
+
content: z2.array(
|
|
568
|
+
z2.object({
|
|
569
|
+
type: z2.literal("code_execution_output"),
|
|
570
|
+
file_id: z2.string()
|
|
571
|
+
})
|
|
572
|
+
).optional().default([])
|
|
573
|
+
}),
|
|
532
574
|
z2.object({
|
|
533
575
|
type: z2.literal("code_execution_tool_result_error"),
|
|
534
576
|
error_code: z2.string()
|
|
@@ -1000,14 +1042,14 @@ var textEditor_20250728 = (args = {}) => {
|
|
|
1000
1042
|
return factory(args);
|
|
1001
1043
|
};
|
|
1002
1044
|
|
|
1003
|
-
// src/tool/web-
|
|
1045
|
+
// src/tool/web-search_20260209.ts
|
|
1004
1046
|
import {
|
|
1005
1047
|
createProviderToolFactoryWithOutputSchema,
|
|
1006
1048
|
lazySchema as lazySchema4,
|
|
1007
1049
|
zodSchema as zodSchema4
|
|
1008
1050
|
} from "@ai-sdk/provider-utils";
|
|
1009
1051
|
import { z as z5 } from "zod/v4";
|
|
1010
|
-
var
|
|
1052
|
+
var webSearch_20260209ArgsSchema = lazySchema4(
|
|
1011
1053
|
() => zodSchema4(
|
|
1012
1054
|
z5.object({
|
|
1013
1055
|
maxUses: z5.number().optional(),
|
|
@@ -1023,7 +1065,7 @@ var webSearch_20250305ArgsSchema = lazySchema4(
|
|
|
1023
1065
|
})
|
|
1024
1066
|
)
|
|
1025
1067
|
);
|
|
1026
|
-
var
|
|
1068
|
+
var webSearch_20260209OutputSchema = lazySchema4(
|
|
1027
1069
|
() => zodSchema4(
|
|
1028
1070
|
z5.array(
|
|
1029
1071
|
z5.object({
|
|
@@ -1036,7 +1078,7 @@ var webSearch_20250305OutputSchema = lazySchema4(
|
|
|
1036
1078
|
)
|
|
1037
1079
|
)
|
|
1038
1080
|
);
|
|
1039
|
-
var
|
|
1081
|
+
var webSearch_20260209InputSchema = lazySchema4(
|
|
1040
1082
|
() => zodSchema4(
|
|
1041
1083
|
z5.object({
|
|
1042
1084
|
query: z5.string()
|
|
@@ -1044,74 +1086,188 @@ var webSearch_20250305InputSchema = lazySchema4(
|
|
|
1044
1086
|
)
|
|
1045
1087
|
);
|
|
1046
1088
|
var factory2 = createProviderToolFactoryWithOutputSchema({
|
|
1047
|
-
id: "anthropic.
|
|
1048
|
-
inputSchema:
|
|
1049
|
-
outputSchema:
|
|
1089
|
+
id: "anthropic.web_search_20260209",
|
|
1090
|
+
inputSchema: webSearch_20260209InputSchema,
|
|
1091
|
+
outputSchema: webSearch_20260209OutputSchema,
|
|
1050
1092
|
supportsDeferredResults: true
|
|
1051
1093
|
});
|
|
1052
|
-
var
|
|
1094
|
+
var webSearch_20260209 = (args = {}) => {
|
|
1053
1095
|
return factory2(args);
|
|
1054
1096
|
};
|
|
1055
1097
|
|
|
1056
|
-
// src/tool/web-
|
|
1098
|
+
// src/tool/web-search_20250305.ts
|
|
1057
1099
|
import {
|
|
1058
1100
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
1059
1101
|
lazySchema as lazySchema5,
|
|
1060
1102
|
zodSchema as zodSchema5
|
|
1061
1103
|
} from "@ai-sdk/provider-utils";
|
|
1062
1104
|
import { z as z6 } from "zod/v4";
|
|
1063
|
-
var
|
|
1105
|
+
var webSearch_20250305ArgsSchema = lazySchema5(
|
|
1064
1106
|
() => zodSchema5(
|
|
1065
1107
|
z6.object({
|
|
1066
1108
|
maxUses: z6.number().optional(),
|
|
1067
1109
|
allowedDomains: z6.array(z6.string()).optional(),
|
|
1068
1110
|
blockedDomains: z6.array(z6.string()).optional(),
|
|
1069
|
-
|
|
1070
|
-
|
|
1111
|
+
userLocation: z6.object({
|
|
1112
|
+
type: z6.literal("approximate"),
|
|
1113
|
+
city: z6.string().optional(),
|
|
1114
|
+
region: z6.string().optional(),
|
|
1115
|
+
country: z6.string().optional(),
|
|
1116
|
+
timezone: z6.string().optional()
|
|
1117
|
+
}).optional()
|
|
1071
1118
|
})
|
|
1072
1119
|
)
|
|
1073
1120
|
);
|
|
1074
|
-
var
|
|
1121
|
+
var webSearch_20250305OutputSchema = lazySchema5(
|
|
1075
1122
|
() => zodSchema5(
|
|
1076
|
-
z6.
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
content: z6.object({
|
|
1080
|
-
type: z6.literal("document"),
|
|
1123
|
+
z6.array(
|
|
1124
|
+
z6.object({
|
|
1125
|
+
url: z6.string(),
|
|
1081
1126
|
title: z6.string().nullable(),
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1127
|
+
pageAge: z6.string().nullable(),
|
|
1128
|
+
encryptedContent: z6.string(),
|
|
1129
|
+
type: z6.literal("web_search_result")
|
|
1130
|
+
})
|
|
1131
|
+
)
|
|
1132
|
+
)
|
|
1133
|
+
);
|
|
1134
|
+
var webSearch_20250305InputSchema = lazySchema5(
|
|
1135
|
+
() => zodSchema5(
|
|
1136
|
+
z6.object({
|
|
1137
|
+
query: z6.string()
|
|
1138
|
+
})
|
|
1139
|
+
)
|
|
1140
|
+
);
|
|
1141
|
+
var factory3 = createProviderToolFactoryWithOutputSchema2({
|
|
1142
|
+
id: "anthropic.web_search_20250305",
|
|
1143
|
+
inputSchema: webSearch_20250305InputSchema,
|
|
1144
|
+
outputSchema: webSearch_20250305OutputSchema,
|
|
1145
|
+
supportsDeferredResults: true
|
|
1146
|
+
});
|
|
1147
|
+
var webSearch_20250305 = (args = {}) => {
|
|
1148
|
+
return factory3(args);
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1151
|
+
// src/tool/web-fetch-20260209.ts
|
|
1152
|
+
import {
|
|
1153
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
1154
|
+
lazySchema as lazySchema6,
|
|
1155
|
+
zodSchema as zodSchema6
|
|
1156
|
+
} from "@ai-sdk/provider-utils";
|
|
1157
|
+
import { z as z7 } from "zod/v4";
|
|
1158
|
+
var webFetch_20260209ArgsSchema = lazySchema6(
|
|
1159
|
+
() => zodSchema6(
|
|
1160
|
+
z7.object({
|
|
1161
|
+
maxUses: z7.number().optional(),
|
|
1162
|
+
allowedDomains: z7.array(z7.string()).optional(),
|
|
1163
|
+
blockedDomains: z7.array(z7.string()).optional(),
|
|
1164
|
+
citations: z7.object({ enabled: z7.boolean() }).optional(),
|
|
1165
|
+
maxContentTokens: z7.number().optional()
|
|
1166
|
+
})
|
|
1167
|
+
)
|
|
1168
|
+
);
|
|
1169
|
+
var webFetch_20260209OutputSchema = lazySchema6(
|
|
1170
|
+
() => zodSchema6(
|
|
1171
|
+
z7.object({
|
|
1172
|
+
type: z7.literal("web_fetch_result"),
|
|
1173
|
+
url: z7.string(),
|
|
1174
|
+
content: z7.object({
|
|
1175
|
+
type: z7.literal("document"),
|
|
1176
|
+
title: z7.string().nullable(),
|
|
1177
|
+
citations: z7.object({ enabled: z7.boolean() }).optional(),
|
|
1178
|
+
source: z7.union([
|
|
1179
|
+
z7.object({
|
|
1180
|
+
type: z7.literal("base64"),
|
|
1181
|
+
mediaType: z7.literal("application/pdf"),
|
|
1182
|
+
data: z7.string()
|
|
1088
1183
|
}),
|
|
1089
|
-
|
|
1090
|
-
type:
|
|
1091
|
-
mediaType:
|
|
1092
|
-
data:
|
|
1184
|
+
z7.object({
|
|
1185
|
+
type: z7.literal("text"),
|
|
1186
|
+
mediaType: z7.literal("text/plain"),
|
|
1187
|
+
data: z7.string()
|
|
1093
1188
|
})
|
|
1094
1189
|
])
|
|
1095
1190
|
}),
|
|
1096
|
-
retrievedAt:
|
|
1191
|
+
retrievedAt: z7.string().nullable()
|
|
1097
1192
|
})
|
|
1098
1193
|
)
|
|
1099
1194
|
);
|
|
1100
|
-
var
|
|
1101
|
-
() =>
|
|
1102
|
-
|
|
1103
|
-
url:
|
|
1195
|
+
var webFetch_20260209InputSchema = lazySchema6(
|
|
1196
|
+
() => zodSchema6(
|
|
1197
|
+
z7.object({
|
|
1198
|
+
url: z7.string()
|
|
1104
1199
|
})
|
|
1105
1200
|
)
|
|
1106
1201
|
);
|
|
1107
|
-
var
|
|
1202
|
+
var factory4 = createProviderToolFactoryWithOutputSchema3({
|
|
1203
|
+
id: "anthropic.web_fetch_20260209",
|
|
1204
|
+
inputSchema: webFetch_20260209InputSchema,
|
|
1205
|
+
outputSchema: webFetch_20260209OutputSchema,
|
|
1206
|
+
supportsDeferredResults: true
|
|
1207
|
+
});
|
|
1208
|
+
var webFetch_20260209 = (args = {}) => {
|
|
1209
|
+
return factory4(args);
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1212
|
+
// src/tool/web-fetch-20250910.ts
|
|
1213
|
+
import {
|
|
1214
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
1215
|
+
lazySchema as lazySchema7,
|
|
1216
|
+
zodSchema as zodSchema7
|
|
1217
|
+
} from "@ai-sdk/provider-utils";
|
|
1218
|
+
import { z as z8 } from "zod/v4";
|
|
1219
|
+
var webFetch_20250910ArgsSchema = lazySchema7(
|
|
1220
|
+
() => zodSchema7(
|
|
1221
|
+
z8.object({
|
|
1222
|
+
maxUses: z8.number().optional(),
|
|
1223
|
+
allowedDomains: z8.array(z8.string()).optional(),
|
|
1224
|
+
blockedDomains: z8.array(z8.string()).optional(),
|
|
1225
|
+
citations: z8.object({ enabled: z8.boolean() }).optional(),
|
|
1226
|
+
maxContentTokens: z8.number().optional()
|
|
1227
|
+
})
|
|
1228
|
+
)
|
|
1229
|
+
);
|
|
1230
|
+
var webFetch_20250910OutputSchema = lazySchema7(
|
|
1231
|
+
() => zodSchema7(
|
|
1232
|
+
z8.object({
|
|
1233
|
+
type: z8.literal("web_fetch_result"),
|
|
1234
|
+
url: z8.string(),
|
|
1235
|
+
content: z8.object({
|
|
1236
|
+
type: z8.literal("document"),
|
|
1237
|
+
title: z8.string().nullable(),
|
|
1238
|
+
citations: z8.object({ enabled: z8.boolean() }).optional(),
|
|
1239
|
+
source: z8.union([
|
|
1240
|
+
z8.object({
|
|
1241
|
+
type: z8.literal("base64"),
|
|
1242
|
+
mediaType: z8.literal("application/pdf"),
|
|
1243
|
+
data: z8.string()
|
|
1244
|
+
}),
|
|
1245
|
+
z8.object({
|
|
1246
|
+
type: z8.literal("text"),
|
|
1247
|
+
mediaType: z8.literal("text/plain"),
|
|
1248
|
+
data: z8.string()
|
|
1249
|
+
})
|
|
1250
|
+
])
|
|
1251
|
+
}),
|
|
1252
|
+
retrievedAt: z8.string().nullable()
|
|
1253
|
+
})
|
|
1254
|
+
)
|
|
1255
|
+
);
|
|
1256
|
+
var webFetch_20250910InputSchema = lazySchema7(
|
|
1257
|
+
() => zodSchema7(
|
|
1258
|
+
z8.object({
|
|
1259
|
+
url: z8.string()
|
|
1260
|
+
})
|
|
1261
|
+
)
|
|
1262
|
+
);
|
|
1263
|
+
var factory5 = createProviderToolFactoryWithOutputSchema4({
|
|
1108
1264
|
id: "anthropic.web_fetch_20250910",
|
|
1109
1265
|
inputSchema: webFetch_20250910InputSchema,
|
|
1110
1266
|
outputSchema: webFetch_20250910OutputSchema,
|
|
1111
1267
|
supportsDeferredResults: true
|
|
1112
1268
|
});
|
|
1113
1269
|
var webFetch_20250910 = (args = {}) => {
|
|
1114
|
-
return
|
|
1270
|
+
return factory5(args);
|
|
1115
1271
|
};
|
|
1116
1272
|
|
|
1117
1273
|
// src/anthropic-prepare-tools.ts
|
|
@@ -1311,6 +1467,24 @@ async function prepareTools({
|
|
|
1311
1467
|
});
|
|
1312
1468
|
break;
|
|
1313
1469
|
}
|
|
1470
|
+
case "anthropic.web_fetch_20260209": {
|
|
1471
|
+
betas.add("code-execution-web-tools-2026-02-09");
|
|
1472
|
+
const args = await validateTypes({
|
|
1473
|
+
value: tool.args,
|
|
1474
|
+
schema: webFetch_20260209ArgsSchema
|
|
1475
|
+
});
|
|
1476
|
+
anthropicTools2.push({
|
|
1477
|
+
type: "web_fetch_20260209",
|
|
1478
|
+
name: "web_fetch",
|
|
1479
|
+
max_uses: args.maxUses,
|
|
1480
|
+
allowed_domains: args.allowedDomains,
|
|
1481
|
+
blocked_domains: args.blockedDomains,
|
|
1482
|
+
citations: args.citations,
|
|
1483
|
+
max_content_tokens: args.maxContentTokens,
|
|
1484
|
+
cache_control: void 0
|
|
1485
|
+
});
|
|
1486
|
+
break;
|
|
1487
|
+
}
|
|
1314
1488
|
case "anthropic.web_search_20250305": {
|
|
1315
1489
|
const args = await validateTypes({
|
|
1316
1490
|
value: tool.args,
|
|
@@ -1327,6 +1501,23 @@ async function prepareTools({
|
|
|
1327
1501
|
});
|
|
1328
1502
|
break;
|
|
1329
1503
|
}
|
|
1504
|
+
case "anthropic.web_search_20260209": {
|
|
1505
|
+
betas.add("code-execution-web-tools-2026-02-09");
|
|
1506
|
+
const args = await validateTypes({
|
|
1507
|
+
value: tool.args,
|
|
1508
|
+
schema: webSearch_20260209ArgsSchema
|
|
1509
|
+
});
|
|
1510
|
+
anthropicTools2.push({
|
|
1511
|
+
type: "web_search_20260209",
|
|
1512
|
+
name: "web_search",
|
|
1513
|
+
max_uses: args.maxUses,
|
|
1514
|
+
allowed_domains: args.allowedDomains,
|
|
1515
|
+
blocked_domains: args.blockedDomains,
|
|
1516
|
+
user_location: args.userLocation,
|
|
1517
|
+
cache_control: void 0
|
|
1518
|
+
});
|
|
1519
|
+
break;
|
|
1520
|
+
}
|
|
1330
1521
|
case "anthropic.tool_search_regex_20251119": {
|
|
1331
1522
|
betas.add("advanced-tool-use-2025-11-20");
|
|
1332
1523
|
anthropicTools2.push({
|
|
@@ -1459,6 +1650,7 @@ import {
|
|
|
1459
1650
|
UnsupportedFunctionalityError as UnsupportedFunctionalityError2
|
|
1460
1651
|
} from "@ai-sdk/provider";
|
|
1461
1652
|
import {
|
|
1653
|
+
convertBase64ToUint8Array,
|
|
1462
1654
|
convertToBase64,
|
|
1463
1655
|
parseProviderOptions,
|
|
1464
1656
|
validateTypes as validateTypes2,
|
|
@@ -1467,144 +1659,144 @@ import {
|
|
|
1467
1659
|
|
|
1468
1660
|
// src/tool/code-execution_20250522.ts
|
|
1469
1661
|
import {
|
|
1470
|
-
createProviderToolFactoryWithOutputSchema as
|
|
1471
|
-
lazySchema as
|
|
1472
|
-
zodSchema as
|
|
1662
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
1663
|
+
lazySchema as lazySchema8,
|
|
1664
|
+
zodSchema as zodSchema8
|
|
1473
1665
|
} from "@ai-sdk/provider-utils";
|
|
1474
|
-
import { z as
|
|
1475
|
-
var codeExecution_20250522OutputSchema =
|
|
1476
|
-
() =>
|
|
1477
|
-
|
|
1478
|
-
type:
|
|
1479
|
-
stdout:
|
|
1480
|
-
stderr:
|
|
1481
|
-
return_code:
|
|
1482
|
-
content:
|
|
1483
|
-
|
|
1484
|
-
type:
|
|
1485
|
-
file_id:
|
|
1666
|
+
import { z as z9 } from "zod/v4";
|
|
1667
|
+
var codeExecution_20250522OutputSchema = lazySchema8(
|
|
1668
|
+
() => zodSchema8(
|
|
1669
|
+
z9.object({
|
|
1670
|
+
type: z9.literal("code_execution_result"),
|
|
1671
|
+
stdout: z9.string(),
|
|
1672
|
+
stderr: z9.string(),
|
|
1673
|
+
return_code: z9.number(),
|
|
1674
|
+
content: z9.array(
|
|
1675
|
+
z9.object({
|
|
1676
|
+
type: z9.literal("code_execution_output"),
|
|
1677
|
+
file_id: z9.string()
|
|
1486
1678
|
})
|
|
1487
1679
|
).optional().default([])
|
|
1488
1680
|
})
|
|
1489
1681
|
)
|
|
1490
1682
|
);
|
|
1491
|
-
var codeExecution_20250522InputSchema =
|
|
1492
|
-
() =>
|
|
1493
|
-
|
|
1494
|
-
code:
|
|
1683
|
+
var codeExecution_20250522InputSchema = lazySchema8(
|
|
1684
|
+
() => zodSchema8(
|
|
1685
|
+
z9.object({
|
|
1686
|
+
code: z9.string()
|
|
1495
1687
|
})
|
|
1496
1688
|
)
|
|
1497
1689
|
);
|
|
1498
|
-
var
|
|
1690
|
+
var factory6 = createProviderToolFactoryWithOutputSchema5({
|
|
1499
1691
|
id: "anthropic.code_execution_20250522",
|
|
1500
1692
|
inputSchema: codeExecution_20250522InputSchema,
|
|
1501
1693
|
outputSchema: codeExecution_20250522OutputSchema
|
|
1502
1694
|
});
|
|
1503
1695
|
var codeExecution_20250522 = (args = {}) => {
|
|
1504
|
-
return
|
|
1696
|
+
return factory6(args);
|
|
1505
1697
|
};
|
|
1506
1698
|
|
|
1507
1699
|
// src/tool/code-execution_20250825.ts
|
|
1508
1700
|
import {
|
|
1509
|
-
createProviderToolFactoryWithOutputSchema as
|
|
1510
|
-
lazySchema as
|
|
1511
|
-
zodSchema as
|
|
1701
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
1702
|
+
lazySchema as lazySchema9,
|
|
1703
|
+
zodSchema as zodSchema9
|
|
1512
1704
|
} from "@ai-sdk/provider-utils";
|
|
1513
|
-
import { z as
|
|
1514
|
-
var codeExecution_20250825OutputSchema =
|
|
1515
|
-
() =>
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
type:
|
|
1519
|
-
stdout:
|
|
1520
|
-
stderr:
|
|
1521
|
-
return_code:
|
|
1522
|
-
content:
|
|
1523
|
-
|
|
1524
|
-
type:
|
|
1525
|
-
file_id:
|
|
1705
|
+
import { z as z10 } from "zod/v4";
|
|
1706
|
+
var codeExecution_20250825OutputSchema = lazySchema9(
|
|
1707
|
+
() => zodSchema9(
|
|
1708
|
+
z10.discriminatedUnion("type", [
|
|
1709
|
+
z10.object({
|
|
1710
|
+
type: z10.literal("code_execution_result"),
|
|
1711
|
+
stdout: z10.string(),
|
|
1712
|
+
stderr: z10.string(),
|
|
1713
|
+
return_code: z10.number(),
|
|
1714
|
+
content: z10.array(
|
|
1715
|
+
z10.object({
|
|
1716
|
+
type: z10.literal("code_execution_output"),
|
|
1717
|
+
file_id: z10.string()
|
|
1526
1718
|
})
|
|
1527
1719
|
).optional().default([])
|
|
1528
1720
|
}),
|
|
1529
|
-
|
|
1530
|
-
type:
|
|
1531
|
-
content:
|
|
1532
|
-
|
|
1533
|
-
type:
|
|
1534
|
-
file_id:
|
|
1721
|
+
z10.object({
|
|
1722
|
+
type: z10.literal("bash_code_execution_result"),
|
|
1723
|
+
content: z10.array(
|
|
1724
|
+
z10.object({
|
|
1725
|
+
type: z10.literal("bash_code_execution_output"),
|
|
1726
|
+
file_id: z10.string()
|
|
1535
1727
|
})
|
|
1536
1728
|
),
|
|
1537
|
-
stdout:
|
|
1538
|
-
stderr:
|
|
1539
|
-
return_code:
|
|
1729
|
+
stdout: z10.string(),
|
|
1730
|
+
stderr: z10.string(),
|
|
1731
|
+
return_code: z10.number()
|
|
1540
1732
|
}),
|
|
1541
|
-
|
|
1542
|
-
type:
|
|
1543
|
-
error_code:
|
|
1733
|
+
z10.object({
|
|
1734
|
+
type: z10.literal("bash_code_execution_tool_result_error"),
|
|
1735
|
+
error_code: z10.string()
|
|
1544
1736
|
}),
|
|
1545
|
-
|
|
1546
|
-
type:
|
|
1547
|
-
error_code:
|
|
1737
|
+
z10.object({
|
|
1738
|
+
type: z10.literal("text_editor_code_execution_tool_result_error"),
|
|
1739
|
+
error_code: z10.string()
|
|
1548
1740
|
}),
|
|
1549
|
-
|
|
1550
|
-
type:
|
|
1551
|
-
content:
|
|
1552
|
-
file_type:
|
|
1553
|
-
num_lines:
|
|
1554
|
-
start_line:
|
|
1555
|
-
total_lines:
|
|
1741
|
+
z10.object({
|
|
1742
|
+
type: z10.literal("text_editor_code_execution_view_result"),
|
|
1743
|
+
content: z10.string(),
|
|
1744
|
+
file_type: z10.string(),
|
|
1745
|
+
num_lines: z10.number().nullable(),
|
|
1746
|
+
start_line: z10.number().nullable(),
|
|
1747
|
+
total_lines: z10.number().nullable()
|
|
1556
1748
|
}),
|
|
1557
|
-
|
|
1558
|
-
type:
|
|
1559
|
-
is_file_update:
|
|
1749
|
+
z10.object({
|
|
1750
|
+
type: z10.literal("text_editor_code_execution_create_result"),
|
|
1751
|
+
is_file_update: z10.boolean()
|
|
1560
1752
|
}),
|
|
1561
|
-
|
|
1562
|
-
type:
|
|
1563
|
-
lines:
|
|
1564
|
-
new_lines:
|
|
1565
|
-
new_start:
|
|
1566
|
-
old_lines:
|
|
1567
|
-
old_start:
|
|
1753
|
+
z10.object({
|
|
1754
|
+
type: z10.literal("text_editor_code_execution_str_replace_result"),
|
|
1755
|
+
lines: z10.array(z10.string()).nullable(),
|
|
1756
|
+
new_lines: z10.number().nullable(),
|
|
1757
|
+
new_start: z10.number().nullable(),
|
|
1758
|
+
old_lines: z10.number().nullable(),
|
|
1759
|
+
old_start: z10.number().nullable()
|
|
1568
1760
|
})
|
|
1569
1761
|
])
|
|
1570
1762
|
)
|
|
1571
1763
|
);
|
|
1572
|
-
var codeExecution_20250825InputSchema =
|
|
1573
|
-
() =>
|
|
1574
|
-
|
|
1764
|
+
var codeExecution_20250825InputSchema = lazySchema9(
|
|
1765
|
+
() => zodSchema9(
|
|
1766
|
+
z10.discriminatedUnion("type", [
|
|
1575
1767
|
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
1576
|
-
|
|
1577
|
-
type:
|
|
1578
|
-
code:
|
|
1768
|
+
z10.object({
|
|
1769
|
+
type: z10.literal("programmatic-tool-call"),
|
|
1770
|
+
code: z10.string()
|
|
1579
1771
|
}),
|
|
1580
|
-
|
|
1581
|
-
type:
|
|
1582
|
-
command:
|
|
1772
|
+
z10.object({
|
|
1773
|
+
type: z10.literal("bash_code_execution"),
|
|
1774
|
+
command: z10.string()
|
|
1583
1775
|
}),
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
type:
|
|
1587
|
-
command:
|
|
1588
|
-
path:
|
|
1776
|
+
z10.discriminatedUnion("command", [
|
|
1777
|
+
z10.object({
|
|
1778
|
+
type: z10.literal("text_editor_code_execution"),
|
|
1779
|
+
command: z10.literal("view"),
|
|
1780
|
+
path: z10.string()
|
|
1589
1781
|
}),
|
|
1590
|
-
|
|
1591
|
-
type:
|
|
1592
|
-
command:
|
|
1593
|
-
path:
|
|
1594
|
-
file_text:
|
|
1782
|
+
z10.object({
|
|
1783
|
+
type: z10.literal("text_editor_code_execution"),
|
|
1784
|
+
command: z10.literal("create"),
|
|
1785
|
+
path: z10.string(),
|
|
1786
|
+
file_text: z10.string().nullish()
|
|
1595
1787
|
}),
|
|
1596
|
-
|
|
1597
|
-
type:
|
|
1598
|
-
command:
|
|
1599
|
-
path:
|
|
1600
|
-
old_str:
|
|
1601
|
-
new_str:
|
|
1788
|
+
z10.object({
|
|
1789
|
+
type: z10.literal("text_editor_code_execution"),
|
|
1790
|
+
command: z10.literal("str_replace"),
|
|
1791
|
+
path: z10.string(),
|
|
1792
|
+
old_str: z10.string(),
|
|
1793
|
+
new_str: z10.string()
|
|
1602
1794
|
})
|
|
1603
1795
|
])
|
|
1604
1796
|
])
|
|
1605
1797
|
)
|
|
1606
1798
|
);
|
|
1607
|
-
var
|
|
1799
|
+
var factory7 = createProviderToolFactoryWithOutputSchema6({
|
|
1608
1800
|
id: "anthropic.code_execution_20250825",
|
|
1609
1801
|
inputSchema: codeExecution_20250825InputSchema,
|
|
1610
1802
|
outputSchema: codeExecution_20250825OutputSchema,
|
|
@@ -1614,29 +1806,29 @@ var factory5 = createProviderToolFactoryWithOutputSchema4({
|
|
|
1614
1806
|
supportsDeferredResults: true
|
|
1615
1807
|
});
|
|
1616
1808
|
var codeExecution_20250825 = (args = {}) => {
|
|
1617
|
-
return
|
|
1809
|
+
return factory7(args);
|
|
1618
1810
|
};
|
|
1619
1811
|
|
|
1620
1812
|
// src/tool/tool-search-regex_20251119.ts
|
|
1621
1813
|
import {
|
|
1622
|
-
createProviderToolFactoryWithOutputSchema as
|
|
1623
|
-
lazySchema as
|
|
1624
|
-
zodSchema as
|
|
1814
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,
|
|
1815
|
+
lazySchema as lazySchema10,
|
|
1816
|
+
zodSchema as zodSchema10
|
|
1625
1817
|
} from "@ai-sdk/provider-utils";
|
|
1626
|
-
import { z as
|
|
1627
|
-
var toolSearchRegex_20251119OutputSchema =
|
|
1628
|
-
() =>
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
type:
|
|
1632
|
-
toolName:
|
|
1818
|
+
import { z as z11 } from "zod/v4";
|
|
1819
|
+
var toolSearchRegex_20251119OutputSchema = lazySchema10(
|
|
1820
|
+
() => zodSchema10(
|
|
1821
|
+
z11.array(
|
|
1822
|
+
z11.object({
|
|
1823
|
+
type: z11.literal("tool_reference"),
|
|
1824
|
+
toolName: z11.string()
|
|
1633
1825
|
})
|
|
1634
1826
|
)
|
|
1635
1827
|
)
|
|
1636
1828
|
);
|
|
1637
|
-
var toolSearchRegex_20251119InputSchema =
|
|
1638
|
-
() =>
|
|
1639
|
-
|
|
1829
|
+
var toolSearchRegex_20251119InputSchema = lazySchema10(
|
|
1830
|
+
() => zodSchema10(
|
|
1831
|
+
z11.object({
|
|
1640
1832
|
/**
|
|
1641
1833
|
* A regex pattern to search for tools.
|
|
1642
1834
|
* Uses Python re.search() syntax. Maximum 200 characters.
|
|
@@ -1647,28 +1839,28 @@ var toolSearchRegex_20251119InputSchema = lazySchema8(
|
|
|
1647
1839
|
* - "database.*query|query.*database" - OR patterns for flexibility
|
|
1648
1840
|
* - "(?i)slack" - case-insensitive search
|
|
1649
1841
|
*/
|
|
1650
|
-
pattern:
|
|
1842
|
+
pattern: z11.string(),
|
|
1651
1843
|
/**
|
|
1652
1844
|
* Maximum number of tools to return. Optional.
|
|
1653
1845
|
*/
|
|
1654
|
-
limit:
|
|
1846
|
+
limit: z11.number().optional()
|
|
1655
1847
|
})
|
|
1656
1848
|
)
|
|
1657
1849
|
);
|
|
1658
|
-
var
|
|
1850
|
+
var factory8 = createProviderToolFactoryWithOutputSchema7({
|
|
1659
1851
|
id: "anthropic.tool_search_regex_20251119",
|
|
1660
1852
|
inputSchema: toolSearchRegex_20251119InputSchema,
|
|
1661
1853
|
outputSchema: toolSearchRegex_20251119OutputSchema,
|
|
1662
1854
|
supportsDeferredResults: true
|
|
1663
1855
|
});
|
|
1664
1856
|
var toolSearchRegex_20251119 = (args = {}) => {
|
|
1665
|
-
return
|
|
1857
|
+
return factory8(args);
|
|
1666
1858
|
};
|
|
1667
1859
|
|
|
1668
1860
|
// src/convert-to-anthropic-messages-prompt.ts
|
|
1669
1861
|
function convertToString(data) {
|
|
1670
1862
|
if (typeof data === "string") {
|
|
1671
|
-
return
|
|
1863
|
+
return new TextDecoder().decode(convertBase64ToUint8Array(data));
|
|
1672
1864
|
}
|
|
1673
1865
|
if (data instanceof Uint8Array) {
|
|
1674
1866
|
return new TextDecoder().decode(data);
|
|
@@ -2654,7 +2846,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2654
2846
|
"anthropic.bash_20250124": "bash",
|
|
2655
2847
|
"anthropic.memory_20250818": "memory",
|
|
2656
2848
|
"anthropic.web_search_20250305": "web_search",
|
|
2849
|
+
"anthropic.web_search_20260209": "web_search",
|
|
2657
2850
|
"anthropic.web_fetch_20250910": "web_fetch",
|
|
2851
|
+
"anthropic.web_fetch_20260209": "web_fetch",
|
|
2658
2852
|
"anthropic.tool_search_regex_20251119": "tool_search_tool_regex",
|
|
2659
2853
|
"anthropic.tool_search_bm25_20251119": "tool_search_tool_bm25"
|
|
2660
2854
|
}
|
|
@@ -2986,6 +3180,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2986
3180
|
const citationDocuments = [
|
|
2987
3181
|
...this.extractCitationDocuments(options.prompt)
|
|
2988
3182
|
];
|
|
3183
|
+
const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(
|
|
3184
|
+
args.tools
|
|
3185
|
+
);
|
|
2989
3186
|
const {
|
|
2990
3187
|
responseHeaders,
|
|
2991
3188
|
value: response,
|
|
@@ -3107,7 +3304,10 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3107
3304
|
toolCallId: part.id,
|
|
3108
3305
|
toolName: toolNameMapping.toCustomToolName(part.name),
|
|
3109
3306
|
input: JSON.stringify(inputToSerialize),
|
|
3110
|
-
providerExecuted: true
|
|
3307
|
+
providerExecuted: true,
|
|
3308
|
+
// We want this 'code_execution' tool call to be allowed even if the tool is not explicitly provided.
|
|
3309
|
+
// Since the validation generally bypasses dynamic tools, we mark this specific tool as dynamic.
|
|
3310
|
+
...markCodeExecutionDynamic && part.name === "code_execution" ? { dynamic: true } : {}
|
|
3111
3311
|
});
|
|
3112
3312
|
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
3113
3313
|
serverToolCalls[part.id] = part.name;
|
|
@@ -3390,6 +3590,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3390
3590
|
const citationDocuments = [
|
|
3391
3591
|
...this.extractCitationDocuments(options.prompt)
|
|
3392
3592
|
];
|
|
3593
|
+
const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(
|
|
3594
|
+
body.tools
|
|
3595
|
+
);
|
|
3393
3596
|
const url = this.buildRequestUrl(true);
|
|
3394
3597
|
const { responseHeaders, value: response } = await postJsonToApi({
|
|
3395
3598
|
url,
|
|
@@ -3539,12 +3742,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3539
3742
|
].includes(part.name)) {
|
|
3540
3743
|
const providerToolName = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? "code_execution" : part.name;
|
|
3541
3744
|
const customToolName = toolNameMapping.toCustomToolName(providerToolName);
|
|
3745
|
+
const finalInput = part.input != null && typeof part.input === "object" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : "";
|
|
3542
3746
|
contentBlocks[value.index] = {
|
|
3543
3747
|
type: "tool-call",
|
|
3544
3748
|
toolCallId: part.id,
|
|
3545
3749
|
toolName: customToolName,
|
|
3546
|
-
input:
|
|
3750
|
+
input: finalInput,
|
|
3547
3751
|
providerExecuted: true,
|
|
3752
|
+
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
3548
3753
|
firstDelta: true,
|
|
3549
3754
|
providerToolName: part.name
|
|
3550
3755
|
};
|
|
@@ -3552,7 +3757,8 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3552
3757
|
type: "tool-input-start",
|
|
3553
3758
|
id: part.id,
|
|
3554
3759
|
toolName: customToolName,
|
|
3555
|
-
providerExecuted: true
|
|
3760
|
+
providerExecuted: true,
|
|
3761
|
+
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {}
|
|
3556
3762
|
});
|
|
3557
3763
|
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
3558
3764
|
serverToolCalls[part.id] = part.name;
|
|
@@ -3826,6 +4032,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3826
4032
|
toolName: contentBlock.toolName,
|
|
3827
4033
|
input: finalInput,
|
|
3828
4034
|
providerExecuted: contentBlock.providerExecuted,
|
|
4035
|
+
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
3829
4036
|
...contentBlock.caller && {
|
|
3830
4037
|
providerMetadata: {
|
|
3831
4038
|
anthropic: {
|
|
@@ -4171,6 +4378,24 @@ function getModelCapabilities(modelId) {
|
|
|
4171
4378
|
};
|
|
4172
4379
|
}
|
|
4173
4380
|
}
|
|
4381
|
+
function hasWebTool20260209WithoutCodeExecution(tools) {
|
|
4382
|
+
if (!tools) {
|
|
4383
|
+
return false;
|
|
4384
|
+
}
|
|
4385
|
+
let hasWebTool20260209 = false;
|
|
4386
|
+
let hasCodeExecutionTool = false;
|
|
4387
|
+
for (const tool of tools) {
|
|
4388
|
+
if ("type" in tool && (tool.type === "web_fetch_20260209" || tool.type === "web_search_20260209")) {
|
|
4389
|
+
hasWebTool20260209 = true;
|
|
4390
|
+
continue;
|
|
4391
|
+
}
|
|
4392
|
+
if (tool.name === "code_execution") {
|
|
4393
|
+
hasCodeExecutionTool = true;
|
|
4394
|
+
break;
|
|
4395
|
+
}
|
|
4396
|
+
}
|
|
4397
|
+
return hasWebTool20260209 && !hasCodeExecutionTool;
|
|
4398
|
+
}
|
|
4174
4399
|
function mapAnthropicResponseContextManagement(contextManagement) {
|
|
4175
4400
|
return contextManagement ? {
|
|
4176
4401
|
appliedEdits: contextManagement.applied_edits.map((edit) => {
|
|
@@ -4200,15 +4425,15 @@ function mapAnthropicResponseContextManagement(contextManagement) {
|
|
|
4200
4425
|
// src/tool/bash_20241022.ts
|
|
4201
4426
|
import {
|
|
4202
4427
|
createProviderToolFactory as createProviderToolFactory2,
|
|
4203
|
-
lazySchema as
|
|
4204
|
-
zodSchema as
|
|
4428
|
+
lazySchema as lazySchema11,
|
|
4429
|
+
zodSchema as zodSchema11
|
|
4205
4430
|
} from "@ai-sdk/provider-utils";
|
|
4206
|
-
import { z as
|
|
4207
|
-
var bash_20241022InputSchema =
|
|
4208
|
-
() =>
|
|
4209
|
-
|
|
4210
|
-
command:
|
|
4211
|
-
restart:
|
|
4431
|
+
import { z as z12 } from "zod/v4";
|
|
4432
|
+
var bash_20241022InputSchema = lazySchema11(
|
|
4433
|
+
() => zodSchema11(
|
|
4434
|
+
z12.object({
|
|
4435
|
+
command: z12.string(),
|
|
4436
|
+
restart: z12.boolean().optional()
|
|
4212
4437
|
})
|
|
4213
4438
|
)
|
|
4214
4439
|
);
|
|
@@ -4220,15 +4445,15 @@ var bash_20241022 = createProviderToolFactory2({
|
|
|
4220
4445
|
// src/tool/bash_20250124.ts
|
|
4221
4446
|
import {
|
|
4222
4447
|
createProviderToolFactory as createProviderToolFactory3,
|
|
4223
|
-
lazySchema as
|
|
4224
|
-
zodSchema as
|
|
4448
|
+
lazySchema as lazySchema12,
|
|
4449
|
+
zodSchema as zodSchema12
|
|
4225
4450
|
} from "@ai-sdk/provider-utils";
|
|
4226
|
-
import { z as
|
|
4227
|
-
var bash_20250124InputSchema =
|
|
4228
|
-
() =>
|
|
4229
|
-
|
|
4230
|
-
command:
|
|
4231
|
-
restart:
|
|
4451
|
+
import { z as z13 } from "zod/v4";
|
|
4452
|
+
var bash_20250124InputSchema = lazySchema12(
|
|
4453
|
+
() => zodSchema12(
|
|
4454
|
+
z13.object({
|
|
4455
|
+
command: z13.string(),
|
|
4456
|
+
restart: z13.boolean().optional()
|
|
4232
4457
|
})
|
|
4233
4458
|
)
|
|
4234
4459
|
);
|
|
@@ -4239,124 +4464,124 @@ var bash_20250124 = createProviderToolFactory3({
|
|
|
4239
4464
|
|
|
4240
4465
|
// src/tool/code-execution_20260120.ts
|
|
4241
4466
|
import {
|
|
4242
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4243
|
-
lazySchema as
|
|
4244
|
-
zodSchema as
|
|
4467
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,
|
|
4468
|
+
lazySchema as lazySchema13,
|
|
4469
|
+
zodSchema as zodSchema13
|
|
4245
4470
|
} from "@ai-sdk/provider-utils";
|
|
4246
|
-
import { z as
|
|
4247
|
-
var codeExecution_20260120OutputSchema =
|
|
4248
|
-
() =>
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
type:
|
|
4252
|
-
stdout:
|
|
4253
|
-
stderr:
|
|
4254
|
-
return_code:
|
|
4255
|
-
content:
|
|
4256
|
-
|
|
4257
|
-
type:
|
|
4258
|
-
file_id:
|
|
4471
|
+
import { z as z14 } from "zod/v4";
|
|
4472
|
+
var codeExecution_20260120OutputSchema = lazySchema13(
|
|
4473
|
+
() => zodSchema13(
|
|
4474
|
+
z14.discriminatedUnion("type", [
|
|
4475
|
+
z14.object({
|
|
4476
|
+
type: z14.literal("code_execution_result"),
|
|
4477
|
+
stdout: z14.string(),
|
|
4478
|
+
stderr: z14.string(),
|
|
4479
|
+
return_code: z14.number(),
|
|
4480
|
+
content: z14.array(
|
|
4481
|
+
z14.object({
|
|
4482
|
+
type: z14.literal("code_execution_output"),
|
|
4483
|
+
file_id: z14.string()
|
|
4259
4484
|
})
|
|
4260
4485
|
).optional().default([])
|
|
4261
4486
|
}),
|
|
4262
|
-
|
|
4263
|
-
type:
|
|
4264
|
-
content:
|
|
4265
|
-
|
|
4266
|
-
type:
|
|
4267
|
-
file_id:
|
|
4487
|
+
z14.object({
|
|
4488
|
+
type: z14.literal("bash_code_execution_result"),
|
|
4489
|
+
content: z14.array(
|
|
4490
|
+
z14.object({
|
|
4491
|
+
type: z14.literal("bash_code_execution_output"),
|
|
4492
|
+
file_id: z14.string()
|
|
4268
4493
|
})
|
|
4269
4494
|
),
|
|
4270
|
-
stdout:
|
|
4271
|
-
stderr:
|
|
4272
|
-
return_code:
|
|
4495
|
+
stdout: z14.string(),
|
|
4496
|
+
stderr: z14.string(),
|
|
4497
|
+
return_code: z14.number()
|
|
4273
4498
|
}),
|
|
4274
|
-
|
|
4275
|
-
type:
|
|
4276
|
-
error_code:
|
|
4499
|
+
z14.object({
|
|
4500
|
+
type: z14.literal("bash_code_execution_tool_result_error"),
|
|
4501
|
+
error_code: z14.string()
|
|
4277
4502
|
}),
|
|
4278
|
-
|
|
4279
|
-
type:
|
|
4280
|
-
error_code:
|
|
4503
|
+
z14.object({
|
|
4504
|
+
type: z14.literal("text_editor_code_execution_tool_result_error"),
|
|
4505
|
+
error_code: z14.string()
|
|
4281
4506
|
}),
|
|
4282
|
-
|
|
4283
|
-
type:
|
|
4284
|
-
content:
|
|
4285
|
-
file_type:
|
|
4286
|
-
num_lines:
|
|
4287
|
-
start_line:
|
|
4288
|
-
total_lines:
|
|
4507
|
+
z14.object({
|
|
4508
|
+
type: z14.literal("text_editor_code_execution_view_result"),
|
|
4509
|
+
content: z14.string(),
|
|
4510
|
+
file_type: z14.string(),
|
|
4511
|
+
num_lines: z14.number().nullable(),
|
|
4512
|
+
start_line: z14.number().nullable(),
|
|
4513
|
+
total_lines: z14.number().nullable()
|
|
4289
4514
|
}),
|
|
4290
|
-
|
|
4291
|
-
type:
|
|
4292
|
-
is_file_update:
|
|
4515
|
+
z14.object({
|
|
4516
|
+
type: z14.literal("text_editor_code_execution_create_result"),
|
|
4517
|
+
is_file_update: z14.boolean()
|
|
4293
4518
|
}),
|
|
4294
|
-
|
|
4295
|
-
type:
|
|
4296
|
-
lines:
|
|
4297
|
-
new_lines:
|
|
4298
|
-
new_start:
|
|
4299
|
-
old_lines:
|
|
4300
|
-
old_start:
|
|
4519
|
+
z14.object({
|
|
4520
|
+
type: z14.literal("text_editor_code_execution_str_replace_result"),
|
|
4521
|
+
lines: z14.array(z14.string()).nullable(),
|
|
4522
|
+
new_lines: z14.number().nullable(),
|
|
4523
|
+
new_start: z14.number().nullable(),
|
|
4524
|
+
old_lines: z14.number().nullable(),
|
|
4525
|
+
old_start: z14.number().nullable()
|
|
4301
4526
|
})
|
|
4302
4527
|
])
|
|
4303
4528
|
)
|
|
4304
4529
|
);
|
|
4305
|
-
var codeExecution_20260120InputSchema =
|
|
4306
|
-
() =>
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
type:
|
|
4310
|
-
code:
|
|
4530
|
+
var codeExecution_20260120InputSchema = lazySchema13(
|
|
4531
|
+
() => zodSchema13(
|
|
4532
|
+
z14.discriminatedUnion("type", [
|
|
4533
|
+
z14.object({
|
|
4534
|
+
type: z14.literal("programmatic-tool-call"),
|
|
4535
|
+
code: z14.string()
|
|
4311
4536
|
}),
|
|
4312
|
-
|
|
4313
|
-
type:
|
|
4314
|
-
command:
|
|
4537
|
+
z14.object({
|
|
4538
|
+
type: z14.literal("bash_code_execution"),
|
|
4539
|
+
command: z14.string()
|
|
4315
4540
|
}),
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
type:
|
|
4319
|
-
command:
|
|
4320
|
-
path:
|
|
4541
|
+
z14.discriminatedUnion("command", [
|
|
4542
|
+
z14.object({
|
|
4543
|
+
type: z14.literal("text_editor_code_execution"),
|
|
4544
|
+
command: z14.literal("view"),
|
|
4545
|
+
path: z14.string()
|
|
4321
4546
|
}),
|
|
4322
|
-
|
|
4323
|
-
type:
|
|
4324
|
-
command:
|
|
4325
|
-
path:
|
|
4326
|
-
file_text:
|
|
4547
|
+
z14.object({
|
|
4548
|
+
type: z14.literal("text_editor_code_execution"),
|
|
4549
|
+
command: z14.literal("create"),
|
|
4550
|
+
path: z14.string(),
|
|
4551
|
+
file_text: z14.string().nullish()
|
|
4327
4552
|
}),
|
|
4328
|
-
|
|
4329
|
-
type:
|
|
4330
|
-
command:
|
|
4331
|
-
path:
|
|
4332
|
-
old_str:
|
|
4333
|
-
new_str:
|
|
4553
|
+
z14.object({
|
|
4554
|
+
type: z14.literal("text_editor_code_execution"),
|
|
4555
|
+
command: z14.literal("str_replace"),
|
|
4556
|
+
path: z14.string(),
|
|
4557
|
+
old_str: z14.string(),
|
|
4558
|
+
new_str: z14.string()
|
|
4334
4559
|
})
|
|
4335
4560
|
])
|
|
4336
4561
|
])
|
|
4337
4562
|
)
|
|
4338
4563
|
);
|
|
4339
|
-
var
|
|
4564
|
+
var factory9 = createProviderToolFactoryWithOutputSchema8({
|
|
4340
4565
|
id: "anthropic.code_execution_20260120",
|
|
4341
4566
|
inputSchema: codeExecution_20260120InputSchema,
|
|
4342
4567
|
outputSchema: codeExecution_20260120OutputSchema,
|
|
4343
4568
|
supportsDeferredResults: true
|
|
4344
4569
|
});
|
|
4345
4570
|
var codeExecution_20260120 = (args = {}) => {
|
|
4346
|
-
return
|
|
4571
|
+
return factory9(args);
|
|
4347
4572
|
};
|
|
4348
4573
|
|
|
4349
4574
|
// src/tool/computer_20241022.ts
|
|
4350
4575
|
import {
|
|
4351
4576
|
createProviderToolFactory as createProviderToolFactory4,
|
|
4352
|
-
lazySchema as
|
|
4353
|
-
zodSchema as
|
|
4577
|
+
lazySchema as lazySchema14,
|
|
4578
|
+
zodSchema as zodSchema14
|
|
4354
4579
|
} from "@ai-sdk/provider-utils";
|
|
4355
|
-
import { z as
|
|
4356
|
-
var computer_20241022InputSchema =
|
|
4357
|
-
() =>
|
|
4358
|
-
|
|
4359
|
-
action:
|
|
4580
|
+
import { z as z15 } from "zod/v4";
|
|
4581
|
+
var computer_20241022InputSchema = lazySchema14(
|
|
4582
|
+
() => zodSchema14(
|
|
4583
|
+
z15.object({
|
|
4584
|
+
action: z15.enum([
|
|
4360
4585
|
"key",
|
|
4361
4586
|
"type",
|
|
4362
4587
|
"mouse_move",
|
|
@@ -4368,8 +4593,8 @@ var computer_20241022InputSchema = lazySchema12(
|
|
|
4368
4593
|
"screenshot",
|
|
4369
4594
|
"cursor_position"
|
|
4370
4595
|
]),
|
|
4371
|
-
coordinate:
|
|
4372
|
-
text:
|
|
4596
|
+
coordinate: z15.array(z15.number().int()).optional(),
|
|
4597
|
+
text: z15.string().optional()
|
|
4373
4598
|
})
|
|
4374
4599
|
)
|
|
4375
4600
|
);
|
|
@@ -4381,14 +4606,14 @@ var computer_20241022 = createProviderToolFactory4({
|
|
|
4381
4606
|
// src/tool/computer_20250124.ts
|
|
4382
4607
|
import {
|
|
4383
4608
|
createProviderToolFactory as createProviderToolFactory5,
|
|
4384
|
-
lazySchema as
|
|
4385
|
-
zodSchema as
|
|
4609
|
+
lazySchema as lazySchema15,
|
|
4610
|
+
zodSchema as zodSchema15
|
|
4386
4611
|
} from "@ai-sdk/provider-utils";
|
|
4387
|
-
import { z as
|
|
4388
|
-
var computer_20250124InputSchema =
|
|
4389
|
-
() =>
|
|
4390
|
-
|
|
4391
|
-
action:
|
|
4612
|
+
import { z as z16 } from "zod/v4";
|
|
4613
|
+
var computer_20250124InputSchema = lazySchema15(
|
|
4614
|
+
() => zodSchema15(
|
|
4615
|
+
z16.object({
|
|
4616
|
+
action: z16.enum([
|
|
4392
4617
|
"key",
|
|
4393
4618
|
"hold_key",
|
|
4394
4619
|
"type",
|
|
@@ -4406,12 +4631,12 @@ var computer_20250124InputSchema = lazySchema13(
|
|
|
4406
4631
|
"wait",
|
|
4407
4632
|
"screenshot"
|
|
4408
4633
|
]),
|
|
4409
|
-
coordinate:
|
|
4410
|
-
duration:
|
|
4411
|
-
scroll_amount:
|
|
4412
|
-
scroll_direction:
|
|
4413
|
-
start_coordinate:
|
|
4414
|
-
text:
|
|
4634
|
+
coordinate: z16.tuple([z16.number().int(), z16.number().int()]).optional(),
|
|
4635
|
+
duration: z16.number().optional(),
|
|
4636
|
+
scroll_amount: z16.number().optional(),
|
|
4637
|
+
scroll_direction: z16.enum(["up", "down", "left", "right"]).optional(),
|
|
4638
|
+
start_coordinate: z16.tuple([z16.number().int(), z16.number().int()]).optional(),
|
|
4639
|
+
text: z16.string().optional()
|
|
4415
4640
|
})
|
|
4416
4641
|
)
|
|
4417
4642
|
);
|
|
@@ -4423,14 +4648,14 @@ var computer_20250124 = createProviderToolFactory5({
|
|
|
4423
4648
|
// src/tool/computer_20251124.ts
|
|
4424
4649
|
import {
|
|
4425
4650
|
createProviderToolFactory as createProviderToolFactory6,
|
|
4426
|
-
lazySchema as
|
|
4427
|
-
zodSchema as
|
|
4651
|
+
lazySchema as lazySchema16,
|
|
4652
|
+
zodSchema as zodSchema16
|
|
4428
4653
|
} from "@ai-sdk/provider-utils";
|
|
4429
|
-
import { z as
|
|
4430
|
-
var computer_20251124InputSchema =
|
|
4431
|
-
() =>
|
|
4432
|
-
|
|
4433
|
-
action:
|
|
4654
|
+
import { z as z17 } from "zod/v4";
|
|
4655
|
+
var computer_20251124InputSchema = lazySchema16(
|
|
4656
|
+
() => zodSchema16(
|
|
4657
|
+
z17.object({
|
|
4658
|
+
action: z17.enum([
|
|
4434
4659
|
"key",
|
|
4435
4660
|
"hold_key",
|
|
4436
4661
|
"type",
|
|
@@ -4449,18 +4674,18 @@ var computer_20251124InputSchema = lazySchema14(
|
|
|
4449
4674
|
"screenshot",
|
|
4450
4675
|
"zoom"
|
|
4451
4676
|
]),
|
|
4452
|
-
coordinate:
|
|
4453
|
-
duration:
|
|
4454
|
-
region:
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4677
|
+
coordinate: z17.tuple([z17.number().int(), z17.number().int()]).optional(),
|
|
4678
|
+
duration: z17.number().optional(),
|
|
4679
|
+
region: z17.tuple([
|
|
4680
|
+
z17.number().int(),
|
|
4681
|
+
z17.number().int(),
|
|
4682
|
+
z17.number().int(),
|
|
4683
|
+
z17.number().int()
|
|
4459
4684
|
]).optional(),
|
|
4460
|
-
scroll_amount:
|
|
4461
|
-
scroll_direction:
|
|
4462
|
-
start_coordinate:
|
|
4463
|
-
text:
|
|
4685
|
+
scroll_amount: z17.number().optional(),
|
|
4686
|
+
scroll_direction: z17.enum(["up", "down", "left", "right"]).optional(),
|
|
4687
|
+
start_coordinate: z17.tuple([z17.number().int(), z17.number().int()]).optional(),
|
|
4688
|
+
text: z17.string().optional()
|
|
4464
4689
|
})
|
|
4465
4690
|
)
|
|
4466
4691
|
);
|
|
@@ -4472,43 +4697,43 @@ var computer_20251124 = createProviderToolFactory6({
|
|
|
4472
4697
|
// src/tool/memory_20250818.ts
|
|
4473
4698
|
import {
|
|
4474
4699
|
createProviderToolFactory as createProviderToolFactory7,
|
|
4475
|
-
lazySchema as
|
|
4476
|
-
zodSchema as
|
|
4700
|
+
lazySchema as lazySchema17,
|
|
4701
|
+
zodSchema as zodSchema17
|
|
4477
4702
|
} from "@ai-sdk/provider-utils";
|
|
4478
|
-
import { z as
|
|
4479
|
-
var memory_20250818InputSchema =
|
|
4480
|
-
() =>
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
command:
|
|
4484
|
-
path:
|
|
4485
|
-
view_range:
|
|
4703
|
+
import { z as z18 } from "zod/v4";
|
|
4704
|
+
var memory_20250818InputSchema = lazySchema17(
|
|
4705
|
+
() => zodSchema17(
|
|
4706
|
+
z18.discriminatedUnion("command", [
|
|
4707
|
+
z18.object({
|
|
4708
|
+
command: z18.literal("view"),
|
|
4709
|
+
path: z18.string(),
|
|
4710
|
+
view_range: z18.tuple([z18.number(), z18.number()]).optional()
|
|
4486
4711
|
}),
|
|
4487
|
-
|
|
4488
|
-
command:
|
|
4489
|
-
path:
|
|
4490
|
-
file_text:
|
|
4712
|
+
z18.object({
|
|
4713
|
+
command: z18.literal("create"),
|
|
4714
|
+
path: z18.string(),
|
|
4715
|
+
file_text: z18.string()
|
|
4491
4716
|
}),
|
|
4492
|
-
|
|
4493
|
-
command:
|
|
4494
|
-
path:
|
|
4495
|
-
old_str:
|
|
4496
|
-
new_str:
|
|
4717
|
+
z18.object({
|
|
4718
|
+
command: z18.literal("str_replace"),
|
|
4719
|
+
path: z18.string(),
|
|
4720
|
+
old_str: z18.string(),
|
|
4721
|
+
new_str: z18.string()
|
|
4497
4722
|
}),
|
|
4498
|
-
|
|
4499
|
-
command:
|
|
4500
|
-
path:
|
|
4501
|
-
insert_line:
|
|
4502
|
-
insert_text:
|
|
4723
|
+
z18.object({
|
|
4724
|
+
command: z18.literal("insert"),
|
|
4725
|
+
path: z18.string(),
|
|
4726
|
+
insert_line: z18.number(),
|
|
4727
|
+
insert_text: z18.string()
|
|
4503
4728
|
}),
|
|
4504
|
-
|
|
4505
|
-
command:
|
|
4506
|
-
path:
|
|
4729
|
+
z18.object({
|
|
4730
|
+
command: z18.literal("delete"),
|
|
4731
|
+
path: z18.string()
|
|
4507
4732
|
}),
|
|
4508
|
-
|
|
4509
|
-
command:
|
|
4510
|
-
old_path:
|
|
4511
|
-
new_path:
|
|
4733
|
+
z18.object({
|
|
4734
|
+
command: z18.literal("rename"),
|
|
4735
|
+
old_path: z18.string(),
|
|
4736
|
+
new_path: z18.string()
|
|
4512
4737
|
})
|
|
4513
4738
|
])
|
|
4514
4739
|
)
|
|
@@ -4521,21 +4746,21 @@ var memory_20250818 = createProviderToolFactory7({
|
|
|
4521
4746
|
// src/tool/text-editor_20241022.ts
|
|
4522
4747
|
import {
|
|
4523
4748
|
createProviderToolFactory as createProviderToolFactory8,
|
|
4524
|
-
lazySchema as
|
|
4525
|
-
zodSchema as
|
|
4749
|
+
lazySchema as lazySchema18,
|
|
4750
|
+
zodSchema as zodSchema18
|
|
4526
4751
|
} from "@ai-sdk/provider-utils";
|
|
4527
|
-
import { z as
|
|
4528
|
-
var textEditor_20241022InputSchema =
|
|
4529
|
-
() =>
|
|
4530
|
-
|
|
4531
|
-
command:
|
|
4532
|
-
path:
|
|
4533
|
-
file_text:
|
|
4534
|
-
insert_line:
|
|
4535
|
-
new_str:
|
|
4536
|
-
insert_text:
|
|
4537
|
-
old_str:
|
|
4538
|
-
view_range:
|
|
4752
|
+
import { z as z19 } from "zod/v4";
|
|
4753
|
+
var textEditor_20241022InputSchema = lazySchema18(
|
|
4754
|
+
() => zodSchema18(
|
|
4755
|
+
z19.object({
|
|
4756
|
+
command: z19.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
4757
|
+
path: z19.string(),
|
|
4758
|
+
file_text: z19.string().optional(),
|
|
4759
|
+
insert_line: z19.number().int().optional(),
|
|
4760
|
+
new_str: z19.string().optional(),
|
|
4761
|
+
insert_text: z19.string().optional(),
|
|
4762
|
+
old_str: z19.string().optional(),
|
|
4763
|
+
view_range: z19.array(z19.number().int()).optional()
|
|
4539
4764
|
})
|
|
4540
4765
|
)
|
|
4541
4766
|
);
|
|
@@ -4547,21 +4772,21 @@ var textEditor_20241022 = createProviderToolFactory8({
|
|
|
4547
4772
|
// src/tool/text-editor_20250124.ts
|
|
4548
4773
|
import {
|
|
4549
4774
|
createProviderToolFactory as createProviderToolFactory9,
|
|
4550
|
-
lazySchema as
|
|
4551
|
-
zodSchema as
|
|
4775
|
+
lazySchema as lazySchema19,
|
|
4776
|
+
zodSchema as zodSchema19
|
|
4552
4777
|
} from "@ai-sdk/provider-utils";
|
|
4553
|
-
import { z as
|
|
4554
|
-
var textEditor_20250124InputSchema =
|
|
4555
|
-
() =>
|
|
4556
|
-
|
|
4557
|
-
command:
|
|
4558
|
-
path:
|
|
4559
|
-
file_text:
|
|
4560
|
-
insert_line:
|
|
4561
|
-
new_str:
|
|
4562
|
-
insert_text:
|
|
4563
|
-
old_str:
|
|
4564
|
-
view_range:
|
|
4778
|
+
import { z as z20 } from "zod/v4";
|
|
4779
|
+
var textEditor_20250124InputSchema = lazySchema19(
|
|
4780
|
+
() => zodSchema19(
|
|
4781
|
+
z20.object({
|
|
4782
|
+
command: z20.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
4783
|
+
path: z20.string(),
|
|
4784
|
+
file_text: z20.string().optional(),
|
|
4785
|
+
insert_line: z20.number().int().optional(),
|
|
4786
|
+
new_str: z20.string().optional(),
|
|
4787
|
+
insert_text: z20.string().optional(),
|
|
4788
|
+
old_str: z20.string().optional(),
|
|
4789
|
+
view_range: z20.array(z20.number().int()).optional()
|
|
4565
4790
|
})
|
|
4566
4791
|
)
|
|
4567
4792
|
);
|
|
@@ -4573,21 +4798,21 @@ var textEditor_20250124 = createProviderToolFactory9({
|
|
|
4573
4798
|
// src/tool/text-editor_20250429.ts
|
|
4574
4799
|
import {
|
|
4575
4800
|
createProviderToolFactory as createProviderToolFactory10,
|
|
4576
|
-
lazySchema as
|
|
4577
|
-
zodSchema as
|
|
4801
|
+
lazySchema as lazySchema20,
|
|
4802
|
+
zodSchema as zodSchema20
|
|
4578
4803
|
} from "@ai-sdk/provider-utils";
|
|
4579
|
-
import { z as
|
|
4580
|
-
var textEditor_20250429InputSchema =
|
|
4581
|
-
() =>
|
|
4582
|
-
|
|
4583
|
-
command:
|
|
4584
|
-
path:
|
|
4585
|
-
file_text:
|
|
4586
|
-
insert_line:
|
|
4587
|
-
new_str:
|
|
4588
|
-
insert_text:
|
|
4589
|
-
old_str:
|
|
4590
|
-
view_range:
|
|
4804
|
+
import { z as z21 } from "zod/v4";
|
|
4805
|
+
var textEditor_20250429InputSchema = lazySchema20(
|
|
4806
|
+
() => zodSchema20(
|
|
4807
|
+
z21.object({
|
|
4808
|
+
command: z21.enum(["view", "create", "str_replace", "insert"]),
|
|
4809
|
+
path: z21.string(),
|
|
4810
|
+
file_text: z21.string().optional(),
|
|
4811
|
+
insert_line: z21.number().int().optional(),
|
|
4812
|
+
new_str: z21.string().optional(),
|
|
4813
|
+
insert_text: z21.string().optional(),
|
|
4814
|
+
old_str: z21.string().optional(),
|
|
4815
|
+
view_range: z21.array(z21.number().int()).optional()
|
|
4591
4816
|
})
|
|
4592
4817
|
)
|
|
4593
4818
|
);
|
|
@@ -4598,44 +4823,44 @@ var textEditor_20250429 = createProviderToolFactory10({
|
|
|
4598
4823
|
|
|
4599
4824
|
// src/tool/tool-search-bm25_20251119.ts
|
|
4600
4825
|
import {
|
|
4601
|
-
createProviderToolFactoryWithOutputSchema as
|
|
4602
|
-
lazySchema as
|
|
4603
|
-
zodSchema as
|
|
4826
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,
|
|
4827
|
+
lazySchema as lazySchema21,
|
|
4828
|
+
zodSchema as zodSchema21
|
|
4604
4829
|
} from "@ai-sdk/provider-utils";
|
|
4605
|
-
import { z as
|
|
4606
|
-
var toolSearchBm25_20251119OutputSchema =
|
|
4607
|
-
() =>
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
type:
|
|
4611
|
-
toolName:
|
|
4830
|
+
import { z as z22 } from "zod/v4";
|
|
4831
|
+
var toolSearchBm25_20251119OutputSchema = lazySchema21(
|
|
4832
|
+
() => zodSchema21(
|
|
4833
|
+
z22.array(
|
|
4834
|
+
z22.object({
|
|
4835
|
+
type: z22.literal("tool_reference"),
|
|
4836
|
+
toolName: z22.string()
|
|
4612
4837
|
})
|
|
4613
4838
|
)
|
|
4614
4839
|
)
|
|
4615
4840
|
);
|
|
4616
|
-
var toolSearchBm25_20251119InputSchema =
|
|
4617
|
-
() =>
|
|
4618
|
-
|
|
4841
|
+
var toolSearchBm25_20251119InputSchema = lazySchema21(
|
|
4842
|
+
() => zodSchema21(
|
|
4843
|
+
z22.object({
|
|
4619
4844
|
/**
|
|
4620
4845
|
* A natural language query to search for tools.
|
|
4621
4846
|
* Claude will use BM25 text search to find relevant tools.
|
|
4622
4847
|
*/
|
|
4623
|
-
query:
|
|
4848
|
+
query: z22.string(),
|
|
4624
4849
|
/**
|
|
4625
4850
|
* Maximum number of tools to return. Optional.
|
|
4626
4851
|
*/
|
|
4627
|
-
limit:
|
|
4852
|
+
limit: z22.number().optional()
|
|
4628
4853
|
})
|
|
4629
4854
|
)
|
|
4630
4855
|
);
|
|
4631
|
-
var
|
|
4856
|
+
var factory10 = createProviderToolFactoryWithOutputSchema9({
|
|
4632
4857
|
id: "anthropic.tool_search_bm25_20251119",
|
|
4633
4858
|
inputSchema: toolSearchBm25_20251119InputSchema,
|
|
4634
4859
|
outputSchema: toolSearchBm25_20251119OutputSchema,
|
|
4635
4860
|
supportsDeferredResults: true
|
|
4636
4861
|
});
|
|
4637
4862
|
var toolSearchBm25_20251119 = (args = {}) => {
|
|
4638
|
-
return
|
|
4863
|
+
return factory10(args);
|
|
4639
4864
|
};
|
|
4640
4865
|
|
|
4641
4866
|
// src/anthropic-tools.ts
|
|
@@ -4782,6 +5007,16 @@ var anthropicTools = {
|
|
|
4782
5007
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
4783
5008
|
*/
|
|
4784
5009
|
webFetch_20250910,
|
|
5010
|
+
/**
|
|
5011
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
5012
|
+
*
|
|
5013
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
5014
|
+
* @param allowedDomains - Only fetch from these domains
|
|
5015
|
+
* @param blockedDomains - Never fetch from these domains
|
|
5016
|
+
* @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
|
|
5017
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
5018
|
+
*/
|
|
5019
|
+
webFetch_20260209,
|
|
4785
5020
|
/**
|
|
4786
5021
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
4787
5022
|
*
|
|
@@ -4791,6 +5026,15 @@ var anthropicTools = {
|
|
|
4791
5026
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
4792
5027
|
*/
|
|
4793
5028
|
webSearch_20250305,
|
|
5029
|
+
/**
|
|
5030
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
5031
|
+
*
|
|
5032
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
5033
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
5034
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
5035
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
5036
|
+
*/
|
|
5037
|
+
webSearch_20260209,
|
|
4794
5038
|
/**
|
|
4795
5039
|
* Creates a tool search tool that uses regex patterns to find tools.
|
|
4796
5040
|
*
|