@ai-sdk/anthropic 3.0.0-beta.74 → 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 +6 -0
- package/dist/index.d.mts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +414 -129
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +398 -105
- 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 +407 -122
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +397 -104
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
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,12 +906,15 @@ 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
916
|
...supportsStructuredOutput === true && tool.strict != null ? { strict: tool.strict } : {},
|
|
917
|
+
...deferLoading != null ? { defer_loading: deferLoading } : {},
|
|
874
918
|
...tool.inputExamples != null ? {
|
|
875
919
|
input_examples: tool.inputExamples.map(
|
|
876
920
|
(example) => example.input
|
|
@@ -1025,6 +1069,22 @@ async function prepareTools({
|
|
|
1025
1069
|
});
|
|
1026
1070
|
break;
|
|
1027
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
|
+
}
|
|
1028
1088
|
default: {
|
|
1029
1089
|
toolWarnings.push({
|
|
1030
1090
|
type: "unsupported",
|
|
@@ -1232,6 +1292,53 @@ var codeExecution_20250825 = (args = {}) => {
|
|
|
1232
1292
|
return factory5(args);
|
|
1233
1293
|
};
|
|
1234
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
|
+
|
|
1235
1342
|
// src/convert-to-anthropic-messages-prompt.ts
|
|
1236
1343
|
function convertToString(data) {
|
|
1237
1344
|
if (typeof data === "string") {
|
|
@@ -1636,6 +1743,14 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1636
1743
|
input: part.input,
|
|
1637
1744
|
cache_control: cacheControl
|
|
1638
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
|
+
});
|
|
1639
1754
|
} else {
|
|
1640
1755
|
warnings.push({
|
|
1641
1756
|
type: "other",
|
|
@@ -1789,6 +1904,34 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1789
1904
|
});
|
|
1790
1905
|
break;
|
|
1791
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
|
+
}
|
|
1792
1935
|
warnings.push({
|
|
1793
1936
|
type: "other",
|
|
1794
1937
|
message: `provider executed tool result for tool ${part.toolName} is not supported`
|
|
@@ -2014,7 +2157,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2014
2157
|
"anthropic.bash_20250124": "bash",
|
|
2015
2158
|
"anthropic.memory_20250818": "memory",
|
|
2016
2159
|
"anthropic.web_search_20250305": "web_search",
|
|
2017
|
-
"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"
|
|
2018
2163
|
}
|
|
2019
2164
|
});
|
|
2020
2165
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({
|
|
@@ -2338,6 +2483,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2338
2483
|
input: JSON.stringify(part.input),
|
|
2339
2484
|
providerExecuted: true
|
|
2340
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
|
+
});
|
|
2341
2494
|
}
|
|
2342
2495
|
break;
|
|
2343
2496
|
}
|
|
@@ -2491,6 +2644,32 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2491
2644
|
});
|
|
2492
2645
|
break;
|
|
2493
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
|
+
}
|
|
2494
2673
|
}
|
|
2495
2674
|
}
|
|
2496
2675
|
return {
|
|
@@ -2681,6 +2860,25 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2681
2860
|
toolName: customToolName,
|
|
2682
2861
|
providerExecuted: true
|
|
2683
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
|
+
});
|
|
2684
2882
|
}
|
|
2685
2883
|
return;
|
|
2686
2884
|
}
|
|
@@ -2804,6 +3002,32 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2804
3002
|
});
|
|
2805
3003
|
return;
|
|
2806
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
|
+
}
|
|
2807
3031
|
case "mcp_tool_use": {
|
|
2808
3032
|
mcpToolCalls[part.id] = {
|
|
2809
3033
|
type: "tool-call",
|
|
@@ -3117,15 +3341,15 @@ function getModelCapabilities(modelId) {
|
|
|
3117
3341
|
// src/tool/bash_20241022.ts
|
|
3118
3342
|
import {
|
|
3119
3343
|
createProviderToolFactory as createProviderToolFactory2,
|
|
3120
|
-
lazySchema as
|
|
3121
|
-
zodSchema as
|
|
3344
|
+
lazySchema as lazySchema9,
|
|
3345
|
+
zodSchema as zodSchema9
|
|
3122
3346
|
} from "@ai-sdk/provider-utils";
|
|
3123
|
-
import { z as
|
|
3124
|
-
var bash_20241022InputSchema =
|
|
3125
|
-
() =>
|
|
3126
|
-
|
|
3127
|
-
command:
|
|
3128
|
-
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()
|
|
3129
3353
|
})
|
|
3130
3354
|
)
|
|
3131
3355
|
);
|
|
@@ -3137,15 +3361,15 @@ var bash_20241022 = createProviderToolFactory2({
|
|
|
3137
3361
|
// src/tool/bash_20250124.ts
|
|
3138
3362
|
import {
|
|
3139
3363
|
createProviderToolFactory as createProviderToolFactory3,
|
|
3140
|
-
lazySchema as
|
|
3141
|
-
zodSchema as
|
|
3364
|
+
lazySchema as lazySchema10,
|
|
3365
|
+
zodSchema as zodSchema10
|
|
3142
3366
|
} from "@ai-sdk/provider-utils";
|
|
3143
|
-
import { z as
|
|
3144
|
-
var bash_20250124InputSchema =
|
|
3145
|
-
() =>
|
|
3146
|
-
|
|
3147
|
-
command:
|
|
3148
|
-
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()
|
|
3149
3373
|
})
|
|
3150
3374
|
)
|
|
3151
3375
|
);
|
|
@@ -3157,14 +3381,14 @@ var bash_20250124 = createProviderToolFactory3({
|
|
|
3157
3381
|
// src/tool/computer_20241022.ts
|
|
3158
3382
|
import {
|
|
3159
3383
|
createProviderToolFactory as createProviderToolFactory4,
|
|
3160
|
-
lazySchema as
|
|
3161
|
-
zodSchema as
|
|
3384
|
+
lazySchema as lazySchema11,
|
|
3385
|
+
zodSchema as zodSchema11
|
|
3162
3386
|
} from "@ai-sdk/provider-utils";
|
|
3163
|
-
import { z as
|
|
3164
|
-
var computer_20241022InputSchema =
|
|
3165
|
-
() =>
|
|
3166
|
-
|
|
3167
|
-
action:
|
|
3387
|
+
import { z as z12 } from "zod/v4";
|
|
3388
|
+
var computer_20241022InputSchema = lazySchema11(
|
|
3389
|
+
() => zodSchema11(
|
|
3390
|
+
z12.object({
|
|
3391
|
+
action: z12.enum([
|
|
3168
3392
|
"key",
|
|
3169
3393
|
"type",
|
|
3170
3394
|
"mouse_move",
|
|
@@ -3176,8 +3400,8 @@ var computer_20241022InputSchema = lazySchema10(
|
|
|
3176
3400
|
"screenshot",
|
|
3177
3401
|
"cursor_position"
|
|
3178
3402
|
]),
|
|
3179
|
-
coordinate:
|
|
3180
|
-
text:
|
|
3403
|
+
coordinate: z12.array(z12.number().int()).optional(),
|
|
3404
|
+
text: z12.string().optional()
|
|
3181
3405
|
})
|
|
3182
3406
|
)
|
|
3183
3407
|
);
|
|
@@ -3189,14 +3413,14 @@ var computer_20241022 = createProviderToolFactory4({
|
|
|
3189
3413
|
// src/tool/computer_20250124.ts
|
|
3190
3414
|
import {
|
|
3191
3415
|
createProviderToolFactory as createProviderToolFactory5,
|
|
3192
|
-
lazySchema as
|
|
3193
|
-
zodSchema as
|
|
3416
|
+
lazySchema as lazySchema12,
|
|
3417
|
+
zodSchema as zodSchema12
|
|
3194
3418
|
} from "@ai-sdk/provider-utils";
|
|
3195
|
-
import { z as
|
|
3196
|
-
var computer_20250124InputSchema =
|
|
3197
|
-
() =>
|
|
3198
|
-
|
|
3199
|
-
action:
|
|
3419
|
+
import { z as z13 } from "zod/v4";
|
|
3420
|
+
var computer_20250124InputSchema = lazySchema12(
|
|
3421
|
+
() => zodSchema12(
|
|
3422
|
+
z13.object({
|
|
3423
|
+
action: z13.enum([
|
|
3200
3424
|
"key",
|
|
3201
3425
|
"hold_key",
|
|
3202
3426
|
"type",
|
|
@@ -3214,12 +3438,12 @@ var computer_20250124InputSchema = lazySchema11(
|
|
|
3214
3438
|
"wait",
|
|
3215
3439
|
"screenshot"
|
|
3216
3440
|
]),
|
|
3217
|
-
coordinate:
|
|
3218
|
-
duration:
|
|
3219
|
-
scroll_amount:
|
|
3220
|
-
scroll_direction:
|
|
3221
|
-
start_coordinate:
|
|
3222
|
-
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()
|
|
3223
3447
|
})
|
|
3224
3448
|
)
|
|
3225
3449
|
);
|
|
@@ -3231,43 +3455,43 @@ var computer_20250124 = createProviderToolFactory5({
|
|
|
3231
3455
|
// src/tool/memory_20250818.ts
|
|
3232
3456
|
import {
|
|
3233
3457
|
createProviderToolFactory as createProviderToolFactory6,
|
|
3234
|
-
lazySchema as
|
|
3235
|
-
zodSchema as
|
|
3458
|
+
lazySchema as lazySchema13,
|
|
3459
|
+
zodSchema as zodSchema13
|
|
3236
3460
|
} from "@ai-sdk/provider-utils";
|
|
3237
|
-
import { z as
|
|
3238
|
-
var memory_20250818InputSchema =
|
|
3239
|
-
() =>
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
command:
|
|
3243
|
-
path:
|
|
3244
|
-
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()
|
|
3245
3469
|
}),
|
|
3246
|
-
|
|
3247
|
-
command:
|
|
3248
|
-
path:
|
|
3249
|
-
file_text:
|
|
3470
|
+
z14.object({
|
|
3471
|
+
command: z14.literal("create"),
|
|
3472
|
+
path: z14.string(),
|
|
3473
|
+
file_text: z14.string()
|
|
3250
3474
|
}),
|
|
3251
|
-
|
|
3252
|
-
command:
|
|
3253
|
-
path:
|
|
3254
|
-
old_str:
|
|
3255
|
-
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()
|
|
3256
3480
|
}),
|
|
3257
|
-
|
|
3258
|
-
command:
|
|
3259
|
-
path:
|
|
3260
|
-
insert_line:
|
|
3261
|
-
insert_text:
|
|
3481
|
+
z14.object({
|
|
3482
|
+
command: z14.literal("insert"),
|
|
3483
|
+
path: z14.string(),
|
|
3484
|
+
insert_line: z14.number(),
|
|
3485
|
+
insert_text: z14.string()
|
|
3262
3486
|
}),
|
|
3263
|
-
|
|
3264
|
-
command:
|
|
3265
|
-
path:
|
|
3487
|
+
z14.object({
|
|
3488
|
+
command: z14.literal("delete"),
|
|
3489
|
+
path: z14.string()
|
|
3266
3490
|
}),
|
|
3267
|
-
|
|
3268
|
-
command:
|
|
3269
|
-
old_path:
|
|
3270
|
-
new_path:
|
|
3491
|
+
z14.object({
|
|
3492
|
+
command: z14.literal("rename"),
|
|
3493
|
+
old_path: z14.string(),
|
|
3494
|
+
new_path: z14.string()
|
|
3271
3495
|
})
|
|
3272
3496
|
])
|
|
3273
3497
|
)
|
|
@@ -3280,36 +3504,11 @@ var memory_20250818 = createProviderToolFactory6({
|
|
|
3280
3504
|
// src/tool/text-editor_20241022.ts
|
|
3281
3505
|
import {
|
|
3282
3506
|
createProviderToolFactory as createProviderToolFactory7,
|
|
3283
|
-
lazySchema as lazySchema13,
|
|
3284
|
-
zodSchema as zodSchema13
|
|
3285
|
-
} from "@ai-sdk/provider-utils";
|
|
3286
|
-
import { z as z14 } from "zod/v4";
|
|
3287
|
-
var textEditor_20241022InputSchema = lazySchema13(
|
|
3288
|
-
() => zodSchema13(
|
|
3289
|
-
z14.object({
|
|
3290
|
-
command: z14.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
3291
|
-
path: z14.string(),
|
|
3292
|
-
file_text: z14.string().optional(),
|
|
3293
|
-
insert_line: z14.number().int().optional(),
|
|
3294
|
-
new_str: z14.string().optional(),
|
|
3295
|
-
old_str: z14.string().optional(),
|
|
3296
|
-
view_range: z14.array(z14.number().int()).optional()
|
|
3297
|
-
})
|
|
3298
|
-
)
|
|
3299
|
-
);
|
|
3300
|
-
var textEditor_20241022 = createProviderToolFactory7({
|
|
3301
|
-
id: "anthropic.text_editor_20241022",
|
|
3302
|
-
inputSchema: textEditor_20241022InputSchema
|
|
3303
|
-
});
|
|
3304
|
-
|
|
3305
|
-
// src/tool/text-editor_20250124.ts
|
|
3306
|
-
import {
|
|
3307
|
-
createProviderToolFactory as createProviderToolFactory8,
|
|
3308
3507
|
lazySchema as lazySchema14,
|
|
3309
3508
|
zodSchema as zodSchema14
|
|
3310
3509
|
} from "@ai-sdk/provider-utils";
|
|
3311
3510
|
import { z as z15 } from "zod/v4";
|
|
3312
|
-
var
|
|
3511
|
+
var textEditor_20241022InputSchema = lazySchema14(
|
|
3313
3512
|
() => zodSchema14(
|
|
3314
3513
|
z15.object({
|
|
3315
3514
|
command: z15.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -3322,22 +3521,22 @@ var textEditor_20250124InputSchema = lazySchema14(
|
|
|
3322
3521
|
})
|
|
3323
3522
|
)
|
|
3324
3523
|
);
|
|
3325
|
-
var
|
|
3326
|
-
id: "anthropic.
|
|
3327
|
-
inputSchema:
|
|
3524
|
+
var textEditor_20241022 = createProviderToolFactory7({
|
|
3525
|
+
id: "anthropic.text_editor_20241022",
|
|
3526
|
+
inputSchema: textEditor_20241022InputSchema
|
|
3328
3527
|
});
|
|
3329
3528
|
|
|
3330
|
-
// src/tool/text-
|
|
3529
|
+
// src/tool/text-editor_20250124.ts
|
|
3331
3530
|
import {
|
|
3332
|
-
createProviderToolFactory as
|
|
3531
|
+
createProviderToolFactory as createProviderToolFactory8,
|
|
3333
3532
|
lazySchema as lazySchema15,
|
|
3334
3533
|
zodSchema as zodSchema15
|
|
3335
3534
|
} from "@ai-sdk/provider-utils";
|
|
3336
3535
|
import { z as z16 } from "zod/v4";
|
|
3337
|
-
var
|
|
3536
|
+
var textEditor_20250124InputSchema = lazySchema15(
|
|
3338
3537
|
() => zodSchema15(
|
|
3339
3538
|
z16.object({
|
|
3340
|
-
command: z16.enum(["view", "create", "str_replace", "insert"]),
|
|
3539
|
+
command: z16.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
3341
3540
|
path: z16.string(),
|
|
3342
3541
|
file_text: z16.string().optional(),
|
|
3343
3542
|
insert_line: z16.number().int().optional(),
|
|
@@ -3347,11 +3546,77 @@ var textEditor_20250429InputSchema = lazySchema15(
|
|
|
3347
3546
|
})
|
|
3348
3547
|
)
|
|
3349
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
|
+
);
|
|
3350
3574
|
var textEditor_20250429 = createProviderToolFactory9({
|
|
3351
3575
|
id: "anthropic.text_editor_20250429",
|
|
3352
3576
|
inputSchema: textEditor_20250429InputSchema
|
|
3353
3577
|
});
|
|
3354
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
|
+
|
|
3355
3620
|
// src/anthropic-tools.ts
|
|
3356
3621
|
var anthropicTools = {
|
|
3357
3622
|
/**
|
|
@@ -3475,7 +3740,35 @@ var anthropicTools = {
|
|
|
3475
3740
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
3476
3741
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
3477
3742
|
*/
|
|
3478
|
-
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
|
|
3479
3772
|
};
|
|
3480
3773
|
export {
|
|
3481
3774
|
AnthropicMessagesLanguageModel,
|