@ai-sdk/anthropic 3.0.0-beta.73 → 3.0.0-beta.75
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 +15 -0
- package/dist/index.d.mts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +423 -130
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +407 -106
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +63 -0
- package/dist/internal/index.d.ts +63 -0
- package/dist/internal/index.js +416 -123
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +406 -105
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -234,6 +234,26 @@ var anthropicMessagesResponseSchema = lazySchema2(
|
|
|
234
234
|
old_start: z2.number().nullable()
|
|
235
235
|
})
|
|
236
236
|
])
|
|
237
|
+
}),
|
|
238
|
+
// tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:
|
|
239
|
+
z2.object({
|
|
240
|
+
type: z2.literal("tool_search_tool_result"),
|
|
241
|
+
tool_use_id: z2.string(),
|
|
242
|
+
content: z2.union([
|
|
243
|
+
z2.object({
|
|
244
|
+
type: z2.literal("tool_search_tool_search_result"),
|
|
245
|
+
tool_references: z2.array(
|
|
246
|
+
z2.object({
|
|
247
|
+
type: z2.literal("tool_reference"),
|
|
248
|
+
tool_name: z2.string()
|
|
249
|
+
})
|
|
250
|
+
)
|
|
251
|
+
}),
|
|
252
|
+
z2.object({
|
|
253
|
+
type: z2.literal("tool_search_tool_result_error"),
|
|
254
|
+
error_code: z2.string()
|
|
255
|
+
})
|
|
256
|
+
])
|
|
237
257
|
})
|
|
238
258
|
])
|
|
239
259
|
),
|
|
@@ -435,6 +455,26 @@ var anthropicMessagesChunkSchema = lazySchema2(
|
|
|
435
455
|
old_start: z2.number().nullable()
|
|
436
456
|
})
|
|
437
457
|
])
|
|
458
|
+
}),
|
|
459
|
+
// tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:
|
|
460
|
+
z2.object({
|
|
461
|
+
type: z2.literal("tool_search_tool_result"),
|
|
462
|
+
tool_use_id: z2.string(),
|
|
463
|
+
content: z2.union([
|
|
464
|
+
z2.object({
|
|
465
|
+
type: z2.literal("tool_search_tool_search_result"),
|
|
466
|
+
tool_references: z2.array(
|
|
467
|
+
z2.object({
|
|
468
|
+
type: z2.literal("tool_reference"),
|
|
469
|
+
tool_name: z2.string()
|
|
470
|
+
})
|
|
471
|
+
)
|
|
472
|
+
}),
|
|
473
|
+
z2.object({
|
|
474
|
+
type: z2.literal("tool_search_tool_result_error"),
|
|
475
|
+
error_code: z2.string()
|
|
476
|
+
})
|
|
477
|
+
])
|
|
438
478
|
})
|
|
439
479
|
])
|
|
440
480
|
}),
|
|
@@ -850,6 +890,7 @@ async function prepareTools({
|
|
|
850
890
|
cacheControlValidator,
|
|
851
891
|
supportsStructuredOutput
|
|
852
892
|
}) {
|
|
893
|
+
var _a;
|
|
853
894
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
854
895
|
const toolWarnings = [];
|
|
855
896
|
const betas = /* @__PURE__ */ new Set();
|
|
@@ -865,13 +906,24 @@ async function prepareTools({
|
|
|
865
906
|
type: "tool definition",
|
|
866
907
|
canCache: true
|
|
867
908
|
});
|
|
909
|
+
const anthropicOptions = (_a = tool.providerOptions) == null ? void 0 : _a.anthropic;
|
|
910
|
+
const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;
|
|
868
911
|
anthropicTools2.push({
|
|
869
912
|
name: tool.name,
|
|
870
913
|
description: tool.description,
|
|
871
914
|
input_schema: tool.inputSchema,
|
|
872
915
|
cache_control: cacheControl,
|
|
873
|
-
...supportsStructuredOutput === true && tool.strict != null ? { strict: tool.strict } : {}
|
|
916
|
+
...supportsStructuredOutput === true && tool.strict != null ? { strict: tool.strict } : {},
|
|
917
|
+
...deferLoading != null ? { defer_loading: deferLoading } : {},
|
|
918
|
+
...tool.inputExamples != null ? {
|
|
919
|
+
input_examples: tool.inputExamples.map(
|
|
920
|
+
(example) => example.input
|
|
921
|
+
)
|
|
922
|
+
} : {}
|
|
874
923
|
});
|
|
924
|
+
if (tool.inputExamples != null) {
|
|
925
|
+
betas.add("advanced-tool-use-2025-11-20");
|
|
926
|
+
}
|
|
875
927
|
break;
|
|
876
928
|
}
|
|
877
929
|
case "provider": {
|
|
@@ -1017,6 +1069,22 @@ async function prepareTools({
|
|
|
1017
1069
|
});
|
|
1018
1070
|
break;
|
|
1019
1071
|
}
|
|
1072
|
+
case "anthropic.tool_search_regex_20251119": {
|
|
1073
|
+
betas.add("advanced-tool-use-2025-11-20");
|
|
1074
|
+
anthropicTools2.push({
|
|
1075
|
+
type: "tool_search_tool_regex_20251119",
|
|
1076
|
+
name: "tool_search_tool_regex"
|
|
1077
|
+
});
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
case "anthropic.tool_search_bm25_20251119": {
|
|
1081
|
+
betas.add("advanced-tool-use-2025-11-20");
|
|
1082
|
+
anthropicTools2.push({
|
|
1083
|
+
type: "tool_search_tool_bm25_20251119",
|
|
1084
|
+
name: "tool_search_tool_bm25"
|
|
1085
|
+
});
|
|
1086
|
+
break;
|
|
1087
|
+
}
|
|
1020
1088
|
default: {
|
|
1021
1089
|
toolWarnings.push({
|
|
1022
1090
|
type: "unsupported",
|
|
@@ -1224,6 +1292,53 @@ var codeExecution_20250825 = (args = {}) => {
|
|
|
1224
1292
|
return factory5(args);
|
|
1225
1293
|
};
|
|
1226
1294
|
|
|
1295
|
+
// src/tool/tool-search-regex_20251119.ts
|
|
1296
|
+
import {
|
|
1297
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
1298
|
+
lazySchema as lazySchema8,
|
|
1299
|
+
zodSchema as zodSchema8
|
|
1300
|
+
} from "@ai-sdk/provider-utils";
|
|
1301
|
+
import { z as z9 } from "zod/v4";
|
|
1302
|
+
var toolSearchRegex_20251119OutputSchema = lazySchema8(
|
|
1303
|
+
() => zodSchema8(
|
|
1304
|
+
z9.array(
|
|
1305
|
+
z9.object({
|
|
1306
|
+
type: z9.literal("tool_reference"),
|
|
1307
|
+
toolName: z9.string()
|
|
1308
|
+
})
|
|
1309
|
+
)
|
|
1310
|
+
)
|
|
1311
|
+
);
|
|
1312
|
+
var toolSearchRegex_20251119InputSchema = lazySchema8(
|
|
1313
|
+
() => zodSchema8(
|
|
1314
|
+
z9.object({
|
|
1315
|
+
/**
|
|
1316
|
+
* A regex pattern to search for tools.
|
|
1317
|
+
* Uses Python re.search() syntax. Maximum 200 characters.
|
|
1318
|
+
*
|
|
1319
|
+
* Examples:
|
|
1320
|
+
* - "weather" - matches tool names/descriptions containing "weather"
|
|
1321
|
+
* - "get_.*_data" - matches tools like get_user_data, get_weather_data
|
|
1322
|
+
* - "database.*query|query.*database" - OR patterns for flexibility
|
|
1323
|
+
* - "(?i)slack" - case-insensitive search
|
|
1324
|
+
*/
|
|
1325
|
+
pattern: z9.string(),
|
|
1326
|
+
/**
|
|
1327
|
+
* Maximum number of tools to return. Optional.
|
|
1328
|
+
*/
|
|
1329
|
+
limit: z9.number().optional()
|
|
1330
|
+
})
|
|
1331
|
+
)
|
|
1332
|
+
);
|
|
1333
|
+
var factory6 = createProviderToolFactoryWithOutputSchema5({
|
|
1334
|
+
id: "anthropic.tool_search_regex_20251119",
|
|
1335
|
+
inputSchema: toolSearchRegex_20251119InputSchema,
|
|
1336
|
+
outputSchema: toolSearchRegex_20251119OutputSchema
|
|
1337
|
+
});
|
|
1338
|
+
var toolSearchRegex_20251119 = (args = {}) => {
|
|
1339
|
+
return factory6(args);
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1227
1342
|
// src/convert-to-anthropic-messages-prompt.ts
|
|
1228
1343
|
function convertToString(data) {
|
|
1229
1344
|
if (typeof data === "string") {
|
|
@@ -1628,6 +1743,14 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1628
1743
|
input: part.input,
|
|
1629
1744
|
cache_control: cacheControl
|
|
1630
1745
|
});
|
|
1746
|
+
} else if (providerToolName === "tool_search_tool_regex" || providerToolName === "tool_search_tool_bm25") {
|
|
1747
|
+
anthropicContent.push({
|
|
1748
|
+
type: "server_tool_use",
|
|
1749
|
+
id: part.toolCallId,
|
|
1750
|
+
name: providerToolName,
|
|
1751
|
+
input: part.input,
|
|
1752
|
+
cache_control: cacheControl
|
|
1753
|
+
});
|
|
1631
1754
|
} else {
|
|
1632
1755
|
warnings.push({
|
|
1633
1756
|
type: "other",
|
|
@@ -1781,6 +1904,34 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1781
1904
|
});
|
|
1782
1905
|
break;
|
|
1783
1906
|
}
|
|
1907
|
+
if (providerToolName === "tool_search_tool_regex" || providerToolName === "tool_search_tool_bm25") {
|
|
1908
|
+
const output = part.output;
|
|
1909
|
+
if (output.type !== "json") {
|
|
1910
|
+
warnings.push({
|
|
1911
|
+
type: "other",
|
|
1912
|
+
message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`
|
|
1913
|
+
});
|
|
1914
|
+
break;
|
|
1915
|
+
}
|
|
1916
|
+
const toolSearchOutput = await validateTypes2({
|
|
1917
|
+
value: output.value,
|
|
1918
|
+
schema: toolSearchRegex_20251119OutputSchema
|
|
1919
|
+
});
|
|
1920
|
+
const toolReferences = toolSearchOutput.map((ref) => ({
|
|
1921
|
+
type: "tool_reference",
|
|
1922
|
+
tool_name: ref.toolName
|
|
1923
|
+
}));
|
|
1924
|
+
anthropicContent.push({
|
|
1925
|
+
type: "tool_search_tool_result",
|
|
1926
|
+
tool_use_id: part.toolCallId,
|
|
1927
|
+
content: {
|
|
1928
|
+
type: "tool_search_tool_search_result",
|
|
1929
|
+
tool_references: toolReferences
|
|
1930
|
+
},
|
|
1931
|
+
cache_control: cacheControl
|
|
1932
|
+
});
|
|
1933
|
+
break;
|
|
1934
|
+
}
|
|
1784
1935
|
warnings.push({
|
|
1785
1936
|
type: "other",
|
|
1786
1937
|
message: `provider executed tool result for tool ${part.toolName} is not supported`
|
|
@@ -2006,7 +2157,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2006
2157
|
"anthropic.bash_20250124": "bash",
|
|
2007
2158
|
"anthropic.memory_20250818": "memory",
|
|
2008
2159
|
"anthropic.web_search_20250305": "web_search",
|
|
2009
|
-
"anthropic.web_fetch_20250910": "web_fetch"
|
|
2160
|
+
"anthropic.web_fetch_20250910": "web_fetch",
|
|
2161
|
+
"anthropic.tool_search_regex_20251119": "tool_search_tool_regex",
|
|
2162
|
+
"anthropic.tool_search_bm25_20251119": "tool_search_tool_bm25"
|
|
2010
2163
|
}
|
|
2011
2164
|
});
|
|
2012
2165
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({
|
|
@@ -2330,6 +2483,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2330
2483
|
input: JSON.stringify(part.input),
|
|
2331
2484
|
providerExecuted: true
|
|
2332
2485
|
});
|
|
2486
|
+
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
2487
|
+
content.push({
|
|
2488
|
+
type: "tool-call",
|
|
2489
|
+
toolCallId: part.id,
|
|
2490
|
+
toolName: toolNameMapping.toCustomToolName(part.name),
|
|
2491
|
+
input: JSON.stringify(part.input),
|
|
2492
|
+
providerExecuted: true
|
|
2493
|
+
});
|
|
2333
2494
|
}
|
|
2334
2495
|
break;
|
|
2335
2496
|
}
|
|
@@ -2483,6 +2644,32 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2483
2644
|
});
|
|
2484
2645
|
break;
|
|
2485
2646
|
}
|
|
2647
|
+
// tool search tool results:
|
|
2648
|
+
case "tool_search_tool_result": {
|
|
2649
|
+
if (part.content.type === "tool_search_tool_search_result") {
|
|
2650
|
+
content.push({
|
|
2651
|
+
type: "tool-result",
|
|
2652
|
+
toolCallId: part.tool_use_id,
|
|
2653
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
2654
|
+
result: part.content.tool_references.map((ref) => ({
|
|
2655
|
+
type: ref.type,
|
|
2656
|
+
toolName: ref.tool_name
|
|
2657
|
+
}))
|
|
2658
|
+
});
|
|
2659
|
+
} else {
|
|
2660
|
+
content.push({
|
|
2661
|
+
type: "tool-result",
|
|
2662
|
+
toolCallId: part.tool_use_id,
|
|
2663
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
2664
|
+
isError: true,
|
|
2665
|
+
result: {
|
|
2666
|
+
type: "tool_search_tool_result_error",
|
|
2667
|
+
errorCode: part.content.error_code
|
|
2668
|
+
}
|
|
2669
|
+
});
|
|
2670
|
+
}
|
|
2671
|
+
break;
|
|
2672
|
+
}
|
|
2486
2673
|
}
|
|
2487
2674
|
}
|
|
2488
2675
|
return {
|
|
@@ -2673,6 +2860,25 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2673
2860
|
toolName: customToolName,
|
|
2674
2861
|
providerExecuted: true
|
|
2675
2862
|
});
|
|
2863
|
+
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
2864
|
+
const customToolName = toolNameMapping.toCustomToolName(
|
|
2865
|
+
part.name
|
|
2866
|
+
);
|
|
2867
|
+
contentBlocks[value.index] = {
|
|
2868
|
+
type: "tool-call",
|
|
2869
|
+
toolCallId: part.id,
|
|
2870
|
+
toolName: customToolName,
|
|
2871
|
+
input: "",
|
|
2872
|
+
providerExecuted: true,
|
|
2873
|
+
firstDelta: true,
|
|
2874
|
+
providerToolName: part.name
|
|
2875
|
+
};
|
|
2876
|
+
controller.enqueue({
|
|
2877
|
+
type: "tool-input-start",
|
|
2878
|
+
id: part.id,
|
|
2879
|
+
toolName: customToolName,
|
|
2880
|
+
providerExecuted: true
|
|
2881
|
+
});
|
|
2676
2882
|
}
|
|
2677
2883
|
return;
|
|
2678
2884
|
}
|
|
@@ -2796,6 +3002,32 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2796
3002
|
});
|
|
2797
3003
|
return;
|
|
2798
3004
|
}
|
|
3005
|
+
// tool search tool results:
|
|
3006
|
+
case "tool_search_tool_result": {
|
|
3007
|
+
if (part.content.type === "tool_search_tool_search_result") {
|
|
3008
|
+
controller.enqueue({
|
|
3009
|
+
type: "tool-result",
|
|
3010
|
+
toolCallId: part.tool_use_id,
|
|
3011
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
3012
|
+
result: part.content.tool_references.map((ref) => ({
|
|
3013
|
+
type: ref.type,
|
|
3014
|
+
toolName: ref.tool_name
|
|
3015
|
+
}))
|
|
3016
|
+
});
|
|
3017
|
+
} else {
|
|
3018
|
+
controller.enqueue({
|
|
3019
|
+
type: "tool-result",
|
|
3020
|
+
toolCallId: part.tool_use_id,
|
|
3021
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
3022
|
+
isError: true,
|
|
3023
|
+
result: {
|
|
3024
|
+
type: "tool_search_tool_result_error",
|
|
3025
|
+
errorCode: part.content.error_code
|
|
3026
|
+
}
|
|
3027
|
+
});
|
|
3028
|
+
}
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
2799
3031
|
case "mcp_tool_use": {
|
|
2800
3032
|
mcpToolCalls[part.id] = {
|
|
2801
3033
|
type: "tool-call",
|
|
@@ -3109,15 +3341,15 @@ function getModelCapabilities(modelId) {
|
|
|
3109
3341
|
// src/tool/bash_20241022.ts
|
|
3110
3342
|
import {
|
|
3111
3343
|
createProviderToolFactory as createProviderToolFactory2,
|
|
3112
|
-
lazySchema as
|
|
3113
|
-
zodSchema as
|
|
3344
|
+
lazySchema as lazySchema9,
|
|
3345
|
+
zodSchema as zodSchema9
|
|
3114
3346
|
} from "@ai-sdk/provider-utils";
|
|
3115
|
-
import { z as
|
|
3116
|
-
var bash_20241022InputSchema =
|
|
3117
|
-
() =>
|
|
3118
|
-
|
|
3119
|
-
command:
|
|
3120
|
-
restart:
|
|
3347
|
+
import { z as z10 } from "zod/v4";
|
|
3348
|
+
var bash_20241022InputSchema = lazySchema9(
|
|
3349
|
+
() => zodSchema9(
|
|
3350
|
+
z10.object({
|
|
3351
|
+
command: z10.string(),
|
|
3352
|
+
restart: z10.boolean().optional()
|
|
3121
3353
|
})
|
|
3122
3354
|
)
|
|
3123
3355
|
);
|
|
@@ -3129,15 +3361,15 @@ var bash_20241022 = createProviderToolFactory2({
|
|
|
3129
3361
|
// src/tool/bash_20250124.ts
|
|
3130
3362
|
import {
|
|
3131
3363
|
createProviderToolFactory as createProviderToolFactory3,
|
|
3132
|
-
lazySchema as
|
|
3133
|
-
zodSchema as
|
|
3364
|
+
lazySchema as lazySchema10,
|
|
3365
|
+
zodSchema as zodSchema10
|
|
3134
3366
|
} from "@ai-sdk/provider-utils";
|
|
3135
|
-
import { z as
|
|
3136
|
-
var bash_20250124InputSchema =
|
|
3137
|
-
() =>
|
|
3138
|
-
|
|
3139
|
-
command:
|
|
3140
|
-
restart:
|
|
3367
|
+
import { z as z11 } from "zod/v4";
|
|
3368
|
+
var bash_20250124InputSchema = lazySchema10(
|
|
3369
|
+
() => zodSchema10(
|
|
3370
|
+
z11.object({
|
|
3371
|
+
command: z11.string(),
|
|
3372
|
+
restart: z11.boolean().optional()
|
|
3141
3373
|
})
|
|
3142
3374
|
)
|
|
3143
3375
|
);
|
|
@@ -3149,14 +3381,14 @@ var bash_20250124 = createProviderToolFactory3({
|
|
|
3149
3381
|
// src/tool/computer_20241022.ts
|
|
3150
3382
|
import {
|
|
3151
3383
|
createProviderToolFactory as createProviderToolFactory4,
|
|
3152
|
-
lazySchema as
|
|
3153
|
-
zodSchema as
|
|
3384
|
+
lazySchema as lazySchema11,
|
|
3385
|
+
zodSchema as zodSchema11
|
|
3154
3386
|
} from "@ai-sdk/provider-utils";
|
|
3155
|
-
import { z as
|
|
3156
|
-
var computer_20241022InputSchema =
|
|
3157
|
-
() =>
|
|
3158
|
-
|
|
3159
|
-
action:
|
|
3387
|
+
import { z as z12 } from "zod/v4";
|
|
3388
|
+
var computer_20241022InputSchema = lazySchema11(
|
|
3389
|
+
() => zodSchema11(
|
|
3390
|
+
z12.object({
|
|
3391
|
+
action: z12.enum([
|
|
3160
3392
|
"key",
|
|
3161
3393
|
"type",
|
|
3162
3394
|
"mouse_move",
|
|
@@ -3168,8 +3400,8 @@ var computer_20241022InputSchema = lazySchema10(
|
|
|
3168
3400
|
"screenshot",
|
|
3169
3401
|
"cursor_position"
|
|
3170
3402
|
]),
|
|
3171
|
-
coordinate:
|
|
3172
|
-
text:
|
|
3403
|
+
coordinate: z12.array(z12.number().int()).optional(),
|
|
3404
|
+
text: z12.string().optional()
|
|
3173
3405
|
})
|
|
3174
3406
|
)
|
|
3175
3407
|
);
|
|
@@ -3181,14 +3413,14 @@ var computer_20241022 = createProviderToolFactory4({
|
|
|
3181
3413
|
// src/tool/computer_20250124.ts
|
|
3182
3414
|
import {
|
|
3183
3415
|
createProviderToolFactory as createProviderToolFactory5,
|
|
3184
|
-
lazySchema as
|
|
3185
|
-
zodSchema as
|
|
3416
|
+
lazySchema as lazySchema12,
|
|
3417
|
+
zodSchema as zodSchema12
|
|
3186
3418
|
} from "@ai-sdk/provider-utils";
|
|
3187
|
-
import { z as
|
|
3188
|
-
var computer_20250124InputSchema =
|
|
3189
|
-
() =>
|
|
3190
|
-
|
|
3191
|
-
action:
|
|
3419
|
+
import { z as z13 } from "zod/v4";
|
|
3420
|
+
var computer_20250124InputSchema = lazySchema12(
|
|
3421
|
+
() => zodSchema12(
|
|
3422
|
+
z13.object({
|
|
3423
|
+
action: z13.enum([
|
|
3192
3424
|
"key",
|
|
3193
3425
|
"hold_key",
|
|
3194
3426
|
"type",
|
|
@@ -3206,12 +3438,12 @@ var computer_20250124InputSchema = lazySchema11(
|
|
|
3206
3438
|
"wait",
|
|
3207
3439
|
"screenshot"
|
|
3208
3440
|
]),
|
|
3209
|
-
coordinate:
|
|
3210
|
-
duration:
|
|
3211
|
-
scroll_amount:
|
|
3212
|
-
scroll_direction:
|
|
3213
|
-
start_coordinate:
|
|
3214
|
-
text:
|
|
3441
|
+
coordinate: z13.tuple([z13.number().int(), z13.number().int()]).optional(),
|
|
3442
|
+
duration: z13.number().optional(),
|
|
3443
|
+
scroll_amount: z13.number().optional(),
|
|
3444
|
+
scroll_direction: z13.enum(["up", "down", "left", "right"]).optional(),
|
|
3445
|
+
start_coordinate: z13.tuple([z13.number().int(), z13.number().int()]).optional(),
|
|
3446
|
+
text: z13.string().optional()
|
|
3215
3447
|
})
|
|
3216
3448
|
)
|
|
3217
3449
|
);
|
|
@@ -3223,43 +3455,43 @@ var computer_20250124 = createProviderToolFactory5({
|
|
|
3223
3455
|
// src/tool/memory_20250818.ts
|
|
3224
3456
|
import {
|
|
3225
3457
|
createProviderToolFactory as createProviderToolFactory6,
|
|
3226
|
-
lazySchema as
|
|
3227
|
-
zodSchema as
|
|
3458
|
+
lazySchema as lazySchema13,
|
|
3459
|
+
zodSchema as zodSchema13
|
|
3228
3460
|
} from "@ai-sdk/provider-utils";
|
|
3229
|
-
import { z as
|
|
3230
|
-
var memory_20250818InputSchema =
|
|
3231
|
-
() =>
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
command:
|
|
3235
|
-
path:
|
|
3236
|
-
view_range:
|
|
3461
|
+
import { z as z14 } from "zod/v4";
|
|
3462
|
+
var memory_20250818InputSchema = lazySchema13(
|
|
3463
|
+
() => zodSchema13(
|
|
3464
|
+
z14.discriminatedUnion("command", [
|
|
3465
|
+
z14.object({
|
|
3466
|
+
command: z14.literal("view"),
|
|
3467
|
+
path: z14.string(),
|
|
3468
|
+
view_range: z14.tuple([z14.number(), z14.number()]).optional()
|
|
3237
3469
|
}),
|
|
3238
|
-
|
|
3239
|
-
command:
|
|
3240
|
-
path:
|
|
3241
|
-
file_text:
|
|
3470
|
+
z14.object({
|
|
3471
|
+
command: z14.literal("create"),
|
|
3472
|
+
path: z14.string(),
|
|
3473
|
+
file_text: z14.string()
|
|
3242
3474
|
}),
|
|
3243
|
-
|
|
3244
|
-
command:
|
|
3245
|
-
path:
|
|
3246
|
-
old_str:
|
|
3247
|
-
new_str:
|
|
3475
|
+
z14.object({
|
|
3476
|
+
command: z14.literal("str_replace"),
|
|
3477
|
+
path: z14.string(),
|
|
3478
|
+
old_str: z14.string(),
|
|
3479
|
+
new_str: z14.string()
|
|
3248
3480
|
}),
|
|
3249
|
-
|
|
3250
|
-
command:
|
|
3251
|
-
path:
|
|
3252
|
-
insert_line:
|
|
3253
|
-
insert_text:
|
|
3481
|
+
z14.object({
|
|
3482
|
+
command: z14.literal("insert"),
|
|
3483
|
+
path: z14.string(),
|
|
3484
|
+
insert_line: z14.number(),
|
|
3485
|
+
insert_text: z14.string()
|
|
3254
3486
|
}),
|
|
3255
|
-
|
|
3256
|
-
command:
|
|
3257
|
-
path:
|
|
3487
|
+
z14.object({
|
|
3488
|
+
command: z14.literal("delete"),
|
|
3489
|
+
path: z14.string()
|
|
3258
3490
|
}),
|
|
3259
|
-
|
|
3260
|
-
command:
|
|
3261
|
-
old_path:
|
|
3262
|
-
new_path:
|
|
3491
|
+
z14.object({
|
|
3492
|
+
command: z14.literal("rename"),
|
|
3493
|
+
old_path: z14.string(),
|
|
3494
|
+
new_path: z14.string()
|
|
3263
3495
|
})
|
|
3264
3496
|
])
|
|
3265
3497
|
)
|
|
@@ -3272,36 +3504,11 @@ var memory_20250818 = createProviderToolFactory6({
|
|
|
3272
3504
|
// src/tool/text-editor_20241022.ts
|
|
3273
3505
|
import {
|
|
3274
3506
|
createProviderToolFactory as createProviderToolFactory7,
|
|
3275
|
-
lazySchema as lazySchema13,
|
|
3276
|
-
zodSchema as zodSchema13
|
|
3277
|
-
} from "@ai-sdk/provider-utils";
|
|
3278
|
-
import { z as z14 } from "zod/v4";
|
|
3279
|
-
var textEditor_20241022InputSchema = lazySchema13(
|
|
3280
|
-
() => zodSchema13(
|
|
3281
|
-
z14.object({
|
|
3282
|
-
command: z14.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
3283
|
-
path: z14.string(),
|
|
3284
|
-
file_text: z14.string().optional(),
|
|
3285
|
-
insert_line: z14.number().int().optional(),
|
|
3286
|
-
new_str: z14.string().optional(),
|
|
3287
|
-
old_str: z14.string().optional(),
|
|
3288
|
-
view_range: z14.array(z14.number().int()).optional()
|
|
3289
|
-
})
|
|
3290
|
-
)
|
|
3291
|
-
);
|
|
3292
|
-
var textEditor_20241022 = createProviderToolFactory7({
|
|
3293
|
-
id: "anthropic.text_editor_20241022",
|
|
3294
|
-
inputSchema: textEditor_20241022InputSchema
|
|
3295
|
-
});
|
|
3296
|
-
|
|
3297
|
-
// src/tool/text-editor_20250124.ts
|
|
3298
|
-
import {
|
|
3299
|
-
createProviderToolFactory as createProviderToolFactory8,
|
|
3300
3507
|
lazySchema as lazySchema14,
|
|
3301
3508
|
zodSchema as zodSchema14
|
|
3302
3509
|
} from "@ai-sdk/provider-utils";
|
|
3303
3510
|
import { z as z15 } from "zod/v4";
|
|
3304
|
-
var
|
|
3511
|
+
var textEditor_20241022InputSchema = lazySchema14(
|
|
3305
3512
|
() => zodSchema14(
|
|
3306
3513
|
z15.object({
|
|
3307
3514
|
command: z15.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -3314,22 +3521,22 @@ var textEditor_20250124InputSchema = lazySchema14(
|
|
|
3314
3521
|
})
|
|
3315
3522
|
)
|
|
3316
3523
|
);
|
|
3317
|
-
var
|
|
3318
|
-
id: "anthropic.
|
|
3319
|
-
inputSchema:
|
|
3524
|
+
var textEditor_20241022 = createProviderToolFactory7({
|
|
3525
|
+
id: "anthropic.text_editor_20241022",
|
|
3526
|
+
inputSchema: textEditor_20241022InputSchema
|
|
3320
3527
|
});
|
|
3321
3528
|
|
|
3322
|
-
// src/tool/text-
|
|
3529
|
+
// src/tool/text-editor_20250124.ts
|
|
3323
3530
|
import {
|
|
3324
|
-
createProviderToolFactory as
|
|
3531
|
+
createProviderToolFactory as createProviderToolFactory8,
|
|
3325
3532
|
lazySchema as lazySchema15,
|
|
3326
3533
|
zodSchema as zodSchema15
|
|
3327
3534
|
} from "@ai-sdk/provider-utils";
|
|
3328
3535
|
import { z as z16 } from "zod/v4";
|
|
3329
|
-
var
|
|
3536
|
+
var textEditor_20250124InputSchema = lazySchema15(
|
|
3330
3537
|
() => zodSchema15(
|
|
3331
3538
|
z16.object({
|
|
3332
|
-
command: z16.enum(["view", "create", "str_replace", "insert"]),
|
|
3539
|
+
command: z16.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
3333
3540
|
path: z16.string(),
|
|
3334
3541
|
file_text: z16.string().optional(),
|
|
3335
3542
|
insert_line: z16.number().int().optional(),
|
|
@@ -3339,11 +3546,77 @@ var textEditor_20250429InputSchema = lazySchema15(
|
|
|
3339
3546
|
})
|
|
3340
3547
|
)
|
|
3341
3548
|
);
|
|
3549
|
+
var textEditor_20250124 = createProviderToolFactory8({
|
|
3550
|
+
id: "anthropic.text_editor_20250124",
|
|
3551
|
+
inputSchema: textEditor_20250124InputSchema
|
|
3552
|
+
});
|
|
3553
|
+
|
|
3554
|
+
// src/tool/text-editor_20250429.ts
|
|
3555
|
+
import {
|
|
3556
|
+
createProviderToolFactory as createProviderToolFactory9,
|
|
3557
|
+
lazySchema as lazySchema16,
|
|
3558
|
+
zodSchema as zodSchema16
|
|
3559
|
+
} from "@ai-sdk/provider-utils";
|
|
3560
|
+
import { z as z17 } from "zod/v4";
|
|
3561
|
+
var textEditor_20250429InputSchema = lazySchema16(
|
|
3562
|
+
() => zodSchema16(
|
|
3563
|
+
z17.object({
|
|
3564
|
+
command: z17.enum(["view", "create", "str_replace", "insert"]),
|
|
3565
|
+
path: z17.string(),
|
|
3566
|
+
file_text: z17.string().optional(),
|
|
3567
|
+
insert_line: z17.number().int().optional(),
|
|
3568
|
+
new_str: z17.string().optional(),
|
|
3569
|
+
old_str: z17.string().optional(),
|
|
3570
|
+
view_range: z17.array(z17.number().int()).optional()
|
|
3571
|
+
})
|
|
3572
|
+
)
|
|
3573
|
+
);
|
|
3342
3574
|
var textEditor_20250429 = createProviderToolFactory9({
|
|
3343
3575
|
id: "anthropic.text_editor_20250429",
|
|
3344
3576
|
inputSchema: textEditor_20250429InputSchema
|
|
3345
3577
|
});
|
|
3346
3578
|
|
|
3579
|
+
// src/tool/tool-search-bm25_20251119.ts
|
|
3580
|
+
import {
|
|
3581
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
3582
|
+
lazySchema as lazySchema17,
|
|
3583
|
+
zodSchema as zodSchema17
|
|
3584
|
+
} from "@ai-sdk/provider-utils";
|
|
3585
|
+
import { z as z18 } from "zod/v4";
|
|
3586
|
+
var toolSearchBm25_20251119OutputSchema = lazySchema17(
|
|
3587
|
+
() => zodSchema17(
|
|
3588
|
+
z18.array(
|
|
3589
|
+
z18.object({
|
|
3590
|
+
type: z18.literal("tool_reference"),
|
|
3591
|
+
toolName: z18.string()
|
|
3592
|
+
})
|
|
3593
|
+
)
|
|
3594
|
+
)
|
|
3595
|
+
);
|
|
3596
|
+
var toolSearchBm25_20251119InputSchema = lazySchema17(
|
|
3597
|
+
() => zodSchema17(
|
|
3598
|
+
z18.object({
|
|
3599
|
+
/**
|
|
3600
|
+
* A natural language query to search for tools.
|
|
3601
|
+
* Claude will use BM25 text search to find relevant tools.
|
|
3602
|
+
*/
|
|
3603
|
+
query: z18.string(),
|
|
3604
|
+
/**
|
|
3605
|
+
* Maximum number of tools to return. Optional.
|
|
3606
|
+
*/
|
|
3607
|
+
limit: z18.number().optional()
|
|
3608
|
+
})
|
|
3609
|
+
)
|
|
3610
|
+
);
|
|
3611
|
+
var factory7 = createProviderToolFactoryWithOutputSchema6({
|
|
3612
|
+
id: "anthropic.tool_search_bm25_20251119",
|
|
3613
|
+
inputSchema: toolSearchBm25_20251119InputSchema,
|
|
3614
|
+
outputSchema: toolSearchBm25_20251119OutputSchema
|
|
3615
|
+
});
|
|
3616
|
+
var toolSearchBm25_20251119 = (args = {}) => {
|
|
3617
|
+
return factory7(args);
|
|
3618
|
+
};
|
|
3619
|
+
|
|
3347
3620
|
// src/anthropic-tools.ts
|
|
3348
3621
|
var anthropicTools = {
|
|
3349
3622
|
/**
|
|
@@ -3467,7 +3740,35 @@ var anthropicTools = {
|
|
|
3467
3740
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
3468
3741
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
3469
3742
|
*/
|
|
3470
|
-
webSearch_20250305
|
|
3743
|
+
webSearch_20250305,
|
|
3744
|
+
/**
|
|
3745
|
+
* Creates a tool search tool that uses regex patterns to find tools.
|
|
3746
|
+
*
|
|
3747
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
3748
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
3749
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
3750
|
+
* catalog and loads only the tools it needs.
|
|
3751
|
+
*
|
|
3752
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
3753
|
+
* to mark them for deferred loading.
|
|
3754
|
+
*
|
|
3755
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
3756
|
+
*/
|
|
3757
|
+
toolSearchRegex_20251119,
|
|
3758
|
+
/**
|
|
3759
|
+
* Creates a tool search tool that uses BM25 (natural language) to find tools.
|
|
3760
|
+
*
|
|
3761
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
3762
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
3763
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
3764
|
+
* catalog and loads only the tools it needs.
|
|
3765
|
+
*
|
|
3766
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
3767
|
+
* to mark them for deferred loading.
|
|
3768
|
+
*
|
|
3769
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
3770
|
+
*/
|
|
3771
|
+
toolSearchBm25_20251119
|
|
3471
3772
|
};
|
|
3472
3773
|
export {
|
|
3473
3774
|
AnthropicMessagesLanguageModel,
|