@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/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "@ai-sdk/provider-utils";
|
|
12
12
|
|
|
13
13
|
// src/version.ts
|
|
14
|
-
var VERSION = true ? "3.0.0-beta.
|
|
14
|
+
var VERSION = true ? "3.0.0-beta.75" : "0.0.0-test";
|
|
15
15
|
|
|
16
16
|
// src/anthropic-messages-language-model.ts
|
|
17
17
|
import {
|
|
@@ -249,6 +249,26 @@ var anthropicMessagesResponseSchema = lazySchema2(
|
|
|
249
249
|
old_start: z2.number().nullable()
|
|
250
250
|
})
|
|
251
251
|
])
|
|
252
|
+
}),
|
|
253
|
+
// tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:
|
|
254
|
+
z2.object({
|
|
255
|
+
type: z2.literal("tool_search_tool_result"),
|
|
256
|
+
tool_use_id: z2.string(),
|
|
257
|
+
content: z2.union([
|
|
258
|
+
z2.object({
|
|
259
|
+
type: z2.literal("tool_search_tool_search_result"),
|
|
260
|
+
tool_references: z2.array(
|
|
261
|
+
z2.object({
|
|
262
|
+
type: z2.literal("tool_reference"),
|
|
263
|
+
tool_name: z2.string()
|
|
264
|
+
})
|
|
265
|
+
)
|
|
266
|
+
}),
|
|
267
|
+
z2.object({
|
|
268
|
+
type: z2.literal("tool_search_tool_result_error"),
|
|
269
|
+
error_code: z2.string()
|
|
270
|
+
})
|
|
271
|
+
])
|
|
252
272
|
})
|
|
253
273
|
])
|
|
254
274
|
),
|
|
@@ -450,6 +470,26 @@ var anthropicMessagesChunkSchema = lazySchema2(
|
|
|
450
470
|
old_start: z2.number().nullable()
|
|
451
471
|
})
|
|
452
472
|
])
|
|
473
|
+
}),
|
|
474
|
+
// tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:
|
|
475
|
+
z2.object({
|
|
476
|
+
type: z2.literal("tool_search_tool_result"),
|
|
477
|
+
tool_use_id: z2.string(),
|
|
478
|
+
content: z2.union([
|
|
479
|
+
z2.object({
|
|
480
|
+
type: z2.literal("tool_search_tool_search_result"),
|
|
481
|
+
tool_references: z2.array(
|
|
482
|
+
z2.object({
|
|
483
|
+
type: z2.literal("tool_reference"),
|
|
484
|
+
tool_name: z2.string()
|
|
485
|
+
})
|
|
486
|
+
)
|
|
487
|
+
}),
|
|
488
|
+
z2.object({
|
|
489
|
+
type: z2.literal("tool_search_tool_result_error"),
|
|
490
|
+
error_code: z2.string()
|
|
491
|
+
})
|
|
492
|
+
])
|
|
453
493
|
})
|
|
454
494
|
])
|
|
455
495
|
}),
|
|
@@ -865,6 +905,7 @@ async function prepareTools({
|
|
|
865
905
|
cacheControlValidator,
|
|
866
906
|
supportsStructuredOutput
|
|
867
907
|
}) {
|
|
908
|
+
var _a;
|
|
868
909
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
869
910
|
const toolWarnings = [];
|
|
870
911
|
const betas = /* @__PURE__ */ new Set();
|
|
@@ -880,13 +921,24 @@ async function prepareTools({
|
|
|
880
921
|
type: "tool definition",
|
|
881
922
|
canCache: true
|
|
882
923
|
});
|
|
924
|
+
const anthropicOptions = (_a = tool.providerOptions) == null ? void 0 : _a.anthropic;
|
|
925
|
+
const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;
|
|
883
926
|
anthropicTools2.push({
|
|
884
927
|
name: tool.name,
|
|
885
928
|
description: tool.description,
|
|
886
929
|
input_schema: tool.inputSchema,
|
|
887
930
|
cache_control: cacheControl,
|
|
888
|
-
...supportsStructuredOutput === true && tool.strict != null ? { strict: tool.strict } : {}
|
|
931
|
+
...supportsStructuredOutput === true && tool.strict != null ? { strict: tool.strict } : {},
|
|
932
|
+
...deferLoading != null ? { defer_loading: deferLoading } : {},
|
|
933
|
+
...tool.inputExamples != null ? {
|
|
934
|
+
input_examples: tool.inputExamples.map(
|
|
935
|
+
(example) => example.input
|
|
936
|
+
)
|
|
937
|
+
} : {}
|
|
889
938
|
});
|
|
939
|
+
if (tool.inputExamples != null) {
|
|
940
|
+
betas.add("advanced-tool-use-2025-11-20");
|
|
941
|
+
}
|
|
890
942
|
break;
|
|
891
943
|
}
|
|
892
944
|
case "provider": {
|
|
@@ -1032,6 +1084,22 @@ async function prepareTools({
|
|
|
1032
1084
|
});
|
|
1033
1085
|
break;
|
|
1034
1086
|
}
|
|
1087
|
+
case "anthropic.tool_search_regex_20251119": {
|
|
1088
|
+
betas.add("advanced-tool-use-2025-11-20");
|
|
1089
|
+
anthropicTools2.push({
|
|
1090
|
+
type: "tool_search_tool_regex_20251119",
|
|
1091
|
+
name: "tool_search_tool_regex"
|
|
1092
|
+
});
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
case "anthropic.tool_search_bm25_20251119": {
|
|
1096
|
+
betas.add("advanced-tool-use-2025-11-20");
|
|
1097
|
+
anthropicTools2.push({
|
|
1098
|
+
type: "tool_search_tool_bm25_20251119",
|
|
1099
|
+
name: "tool_search_tool_bm25"
|
|
1100
|
+
});
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1035
1103
|
default: {
|
|
1036
1104
|
toolWarnings.push({
|
|
1037
1105
|
type: "unsupported",
|
|
@@ -1239,6 +1307,53 @@ var codeExecution_20250825 = (args = {}) => {
|
|
|
1239
1307
|
return factory5(args);
|
|
1240
1308
|
};
|
|
1241
1309
|
|
|
1310
|
+
// src/tool/tool-search-regex_20251119.ts
|
|
1311
|
+
import {
|
|
1312
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,
|
|
1313
|
+
lazySchema as lazySchema8,
|
|
1314
|
+
zodSchema as zodSchema8
|
|
1315
|
+
} from "@ai-sdk/provider-utils";
|
|
1316
|
+
import { z as z9 } from "zod/v4";
|
|
1317
|
+
var toolSearchRegex_20251119OutputSchema = lazySchema8(
|
|
1318
|
+
() => zodSchema8(
|
|
1319
|
+
z9.array(
|
|
1320
|
+
z9.object({
|
|
1321
|
+
type: z9.literal("tool_reference"),
|
|
1322
|
+
toolName: z9.string()
|
|
1323
|
+
})
|
|
1324
|
+
)
|
|
1325
|
+
)
|
|
1326
|
+
);
|
|
1327
|
+
var toolSearchRegex_20251119InputSchema = lazySchema8(
|
|
1328
|
+
() => zodSchema8(
|
|
1329
|
+
z9.object({
|
|
1330
|
+
/**
|
|
1331
|
+
* A regex pattern to search for tools.
|
|
1332
|
+
* Uses Python re.search() syntax. Maximum 200 characters.
|
|
1333
|
+
*
|
|
1334
|
+
* Examples:
|
|
1335
|
+
* - "weather" - matches tool names/descriptions containing "weather"
|
|
1336
|
+
* - "get_.*_data" - matches tools like get_user_data, get_weather_data
|
|
1337
|
+
* - "database.*query|query.*database" - OR patterns for flexibility
|
|
1338
|
+
* - "(?i)slack" - case-insensitive search
|
|
1339
|
+
*/
|
|
1340
|
+
pattern: z9.string(),
|
|
1341
|
+
/**
|
|
1342
|
+
* Maximum number of tools to return. Optional.
|
|
1343
|
+
*/
|
|
1344
|
+
limit: z9.number().optional()
|
|
1345
|
+
})
|
|
1346
|
+
)
|
|
1347
|
+
);
|
|
1348
|
+
var factory6 = createProviderToolFactoryWithOutputSchema5({
|
|
1349
|
+
id: "anthropic.tool_search_regex_20251119",
|
|
1350
|
+
inputSchema: toolSearchRegex_20251119InputSchema,
|
|
1351
|
+
outputSchema: toolSearchRegex_20251119OutputSchema
|
|
1352
|
+
});
|
|
1353
|
+
var toolSearchRegex_20251119 = (args = {}) => {
|
|
1354
|
+
return factory6(args);
|
|
1355
|
+
};
|
|
1356
|
+
|
|
1242
1357
|
// src/convert-to-anthropic-messages-prompt.ts
|
|
1243
1358
|
function convertToString(data) {
|
|
1244
1359
|
if (typeof data === "string") {
|
|
@@ -1643,6 +1758,14 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1643
1758
|
input: part.input,
|
|
1644
1759
|
cache_control: cacheControl
|
|
1645
1760
|
});
|
|
1761
|
+
} else if (providerToolName === "tool_search_tool_regex" || providerToolName === "tool_search_tool_bm25") {
|
|
1762
|
+
anthropicContent.push({
|
|
1763
|
+
type: "server_tool_use",
|
|
1764
|
+
id: part.toolCallId,
|
|
1765
|
+
name: providerToolName,
|
|
1766
|
+
input: part.input,
|
|
1767
|
+
cache_control: cacheControl
|
|
1768
|
+
});
|
|
1646
1769
|
} else {
|
|
1647
1770
|
warnings.push({
|
|
1648
1771
|
type: "other",
|
|
@@ -1796,6 +1919,34 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1796
1919
|
});
|
|
1797
1920
|
break;
|
|
1798
1921
|
}
|
|
1922
|
+
if (providerToolName === "tool_search_tool_regex" || providerToolName === "tool_search_tool_bm25") {
|
|
1923
|
+
const output = part.output;
|
|
1924
|
+
if (output.type !== "json") {
|
|
1925
|
+
warnings.push({
|
|
1926
|
+
type: "other",
|
|
1927
|
+
message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`
|
|
1928
|
+
});
|
|
1929
|
+
break;
|
|
1930
|
+
}
|
|
1931
|
+
const toolSearchOutput = await validateTypes2({
|
|
1932
|
+
value: output.value,
|
|
1933
|
+
schema: toolSearchRegex_20251119OutputSchema
|
|
1934
|
+
});
|
|
1935
|
+
const toolReferences = toolSearchOutput.map((ref) => ({
|
|
1936
|
+
type: "tool_reference",
|
|
1937
|
+
tool_name: ref.toolName
|
|
1938
|
+
}));
|
|
1939
|
+
anthropicContent.push({
|
|
1940
|
+
type: "tool_search_tool_result",
|
|
1941
|
+
tool_use_id: part.toolCallId,
|
|
1942
|
+
content: {
|
|
1943
|
+
type: "tool_search_tool_search_result",
|
|
1944
|
+
tool_references: toolReferences
|
|
1945
|
+
},
|
|
1946
|
+
cache_control: cacheControl
|
|
1947
|
+
});
|
|
1948
|
+
break;
|
|
1949
|
+
}
|
|
1799
1950
|
warnings.push({
|
|
1800
1951
|
type: "other",
|
|
1801
1952
|
message: `provider executed tool result for tool ${part.toolName} is not supported`
|
|
@@ -2021,7 +2172,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2021
2172
|
"anthropic.bash_20250124": "bash",
|
|
2022
2173
|
"anthropic.memory_20250818": "memory",
|
|
2023
2174
|
"anthropic.web_search_20250305": "web_search",
|
|
2024
|
-
"anthropic.web_fetch_20250910": "web_fetch"
|
|
2175
|
+
"anthropic.web_fetch_20250910": "web_fetch",
|
|
2176
|
+
"anthropic.tool_search_regex_20251119": "tool_search_tool_regex",
|
|
2177
|
+
"anthropic.tool_search_bm25_20251119": "tool_search_tool_bm25"
|
|
2025
2178
|
}
|
|
2026
2179
|
});
|
|
2027
2180
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({
|
|
@@ -2345,6 +2498,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2345
2498
|
input: JSON.stringify(part.input),
|
|
2346
2499
|
providerExecuted: true
|
|
2347
2500
|
});
|
|
2501
|
+
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
2502
|
+
content.push({
|
|
2503
|
+
type: "tool-call",
|
|
2504
|
+
toolCallId: part.id,
|
|
2505
|
+
toolName: toolNameMapping.toCustomToolName(part.name),
|
|
2506
|
+
input: JSON.stringify(part.input),
|
|
2507
|
+
providerExecuted: true
|
|
2508
|
+
});
|
|
2348
2509
|
}
|
|
2349
2510
|
break;
|
|
2350
2511
|
}
|
|
@@ -2498,6 +2659,32 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2498
2659
|
});
|
|
2499
2660
|
break;
|
|
2500
2661
|
}
|
|
2662
|
+
// tool search tool results:
|
|
2663
|
+
case "tool_search_tool_result": {
|
|
2664
|
+
if (part.content.type === "tool_search_tool_search_result") {
|
|
2665
|
+
content.push({
|
|
2666
|
+
type: "tool-result",
|
|
2667
|
+
toolCallId: part.tool_use_id,
|
|
2668
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
2669
|
+
result: part.content.tool_references.map((ref) => ({
|
|
2670
|
+
type: ref.type,
|
|
2671
|
+
toolName: ref.tool_name
|
|
2672
|
+
}))
|
|
2673
|
+
});
|
|
2674
|
+
} else {
|
|
2675
|
+
content.push({
|
|
2676
|
+
type: "tool-result",
|
|
2677
|
+
toolCallId: part.tool_use_id,
|
|
2678
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
2679
|
+
isError: true,
|
|
2680
|
+
result: {
|
|
2681
|
+
type: "tool_search_tool_result_error",
|
|
2682
|
+
errorCode: part.content.error_code
|
|
2683
|
+
}
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2686
|
+
break;
|
|
2687
|
+
}
|
|
2501
2688
|
}
|
|
2502
2689
|
}
|
|
2503
2690
|
return {
|
|
@@ -2688,6 +2875,25 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2688
2875
|
toolName: customToolName,
|
|
2689
2876
|
providerExecuted: true
|
|
2690
2877
|
});
|
|
2878
|
+
} else if (part.name === "tool_search_tool_regex" || part.name === "tool_search_tool_bm25") {
|
|
2879
|
+
const customToolName = toolNameMapping.toCustomToolName(
|
|
2880
|
+
part.name
|
|
2881
|
+
);
|
|
2882
|
+
contentBlocks[value.index] = {
|
|
2883
|
+
type: "tool-call",
|
|
2884
|
+
toolCallId: part.id,
|
|
2885
|
+
toolName: customToolName,
|
|
2886
|
+
input: "",
|
|
2887
|
+
providerExecuted: true,
|
|
2888
|
+
firstDelta: true,
|
|
2889
|
+
providerToolName: part.name
|
|
2890
|
+
};
|
|
2891
|
+
controller.enqueue({
|
|
2892
|
+
type: "tool-input-start",
|
|
2893
|
+
id: part.id,
|
|
2894
|
+
toolName: customToolName,
|
|
2895
|
+
providerExecuted: true
|
|
2896
|
+
});
|
|
2691
2897
|
}
|
|
2692
2898
|
return;
|
|
2693
2899
|
}
|
|
@@ -2811,6 +3017,32 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2811
3017
|
});
|
|
2812
3018
|
return;
|
|
2813
3019
|
}
|
|
3020
|
+
// tool search tool results:
|
|
3021
|
+
case "tool_search_tool_result": {
|
|
3022
|
+
if (part.content.type === "tool_search_tool_search_result") {
|
|
3023
|
+
controller.enqueue({
|
|
3024
|
+
type: "tool-result",
|
|
3025
|
+
toolCallId: part.tool_use_id,
|
|
3026
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
3027
|
+
result: part.content.tool_references.map((ref) => ({
|
|
3028
|
+
type: ref.type,
|
|
3029
|
+
toolName: ref.tool_name
|
|
3030
|
+
}))
|
|
3031
|
+
});
|
|
3032
|
+
} else {
|
|
3033
|
+
controller.enqueue({
|
|
3034
|
+
type: "tool-result",
|
|
3035
|
+
toolCallId: part.tool_use_id,
|
|
3036
|
+
toolName: toolNameMapping.toCustomToolName("tool_search"),
|
|
3037
|
+
isError: true,
|
|
3038
|
+
result: {
|
|
3039
|
+
type: "tool_search_tool_result_error",
|
|
3040
|
+
errorCode: part.content.error_code
|
|
3041
|
+
}
|
|
3042
|
+
});
|
|
3043
|
+
}
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
2814
3046
|
case "mcp_tool_use": {
|
|
2815
3047
|
mcpToolCalls[part.id] = {
|
|
2816
3048
|
type: "tool-call",
|
|
@@ -3124,15 +3356,15 @@ function getModelCapabilities(modelId) {
|
|
|
3124
3356
|
// src/tool/bash_20241022.ts
|
|
3125
3357
|
import {
|
|
3126
3358
|
createProviderToolFactory as createProviderToolFactory2,
|
|
3127
|
-
lazySchema as
|
|
3128
|
-
zodSchema as
|
|
3359
|
+
lazySchema as lazySchema9,
|
|
3360
|
+
zodSchema as zodSchema9
|
|
3129
3361
|
} from "@ai-sdk/provider-utils";
|
|
3130
|
-
import { z as
|
|
3131
|
-
var bash_20241022InputSchema =
|
|
3132
|
-
() =>
|
|
3133
|
-
|
|
3134
|
-
command:
|
|
3135
|
-
restart:
|
|
3362
|
+
import { z as z10 } from "zod/v4";
|
|
3363
|
+
var bash_20241022InputSchema = lazySchema9(
|
|
3364
|
+
() => zodSchema9(
|
|
3365
|
+
z10.object({
|
|
3366
|
+
command: z10.string(),
|
|
3367
|
+
restart: z10.boolean().optional()
|
|
3136
3368
|
})
|
|
3137
3369
|
)
|
|
3138
3370
|
);
|
|
@@ -3144,15 +3376,15 @@ var bash_20241022 = createProviderToolFactory2({
|
|
|
3144
3376
|
// src/tool/bash_20250124.ts
|
|
3145
3377
|
import {
|
|
3146
3378
|
createProviderToolFactory as createProviderToolFactory3,
|
|
3147
|
-
lazySchema as
|
|
3148
|
-
zodSchema as
|
|
3379
|
+
lazySchema as lazySchema10,
|
|
3380
|
+
zodSchema as zodSchema10
|
|
3149
3381
|
} from "@ai-sdk/provider-utils";
|
|
3150
|
-
import { z as
|
|
3151
|
-
var bash_20250124InputSchema =
|
|
3152
|
-
() =>
|
|
3153
|
-
|
|
3154
|
-
command:
|
|
3155
|
-
restart:
|
|
3382
|
+
import { z as z11 } from "zod/v4";
|
|
3383
|
+
var bash_20250124InputSchema = lazySchema10(
|
|
3384
|
+
() => zodSchema10(
|
|
3385
|
+
z11.object({
|
|
3386
|
+
command: z11.string(),
|
|
3387
|
+
restart: z11.boolean().optional()
|
|
3156
3388
|
})
|
|
3157
3389
|
)
|
|
3158
3390
|
);
|
|
@@ -3164,14 +3396,14 @@ var bash_20250124 = createProviderToolFactory3({
|
|
|
3164
3396
|
// src/tool/computer_20241022.ts
|
|
3165
3397
|
import {
|
|
3166
3398
|
createProviderToolFactory as createProviderToolFactory4,
|
|
3167
|
-
lazySchema as
|
|
3168
|
-
zodSchema as
|
|
3399
|
+
lazySchema as lazySchema11,
|
|
3400
|
+
zodSchema as zodSchema11
|
|
3169
3401
|
} from "@ai-sdk/provider-utils";
|
|
3170
|
-
import { z as
|
|
3171
|
-
var computer_20241022InputSchema =
|
|
3172
|
-
() =>
|
|
3173
|
-
|
|
3174
|
-
action:
|
|
3402
|
+
import { z as z12 } from "zod/v4";
|
|
3403
|
+
var computer_20241022InputSchema = lazySchema11(
|
|
3404
|
+
() => zodSchema11(
|
|
3405
|
+
z12.object({
|
|
3406
|
+
action: z12.enum([
|
|
3175
3407
|
"key",
|
|
3176
3408
|
"type",
|
|
3177
3409
|
"mouse_move",
|
|
@@ -3183,8 +3415,8 @@ var computer_20241022InputSchema = lazySchema10(
|
|
|
3183
3415
|
"screenshot",
|
|
3184
3416
|
"cursor_position"
|
|
3185
3417
|
]),
|
|
3186
|
-
coordinate:
|
|
3187
|
-
text:
|
|
3418
|
+
coordinate: z12.array(z12.number().int()).optional(),
|
|
3419
|
+
text: z12.string().optional()
|
|
3188
3420
|
})
|
|
3189
3421
|
)
|
|
3190
3422
|
);
|
|
@@ -3196,14 +3428,14 @@ var computer_20241022 = createProviderToolFactory4({
|
|
|
3196
3428
|
// src/tool/computer_20250124.ts
|
|
3197
3429
|
import {
|
|
3198
3430
|
createProviderToolFactory as createProviderToolFactory5,
|
|
3199
|
-
lazySchema as
|
|
3200
|
-
zodSchema as
|
|
3431
|
+
lazySchema as lazySchema12,
|
|
3432
|
+
zodSchema as zodSchema12
|
|
3201
3433
|
} from "@ai-sdk/provider-utils";
|
|
3202
|
-
import { z as
|
|
3203
|
-
var computer_20250124InputSchema =
|
|
3204
|
-
() =>
|
|
3205
|
-
|
|
3206
|
-
action:
|
|
3434
|
+
import { z as z13 } from "zod/v4";
|
|
3435
|
+
var computer_20250124InputSchema = lazySchema12(
|
|
3436
|
+
() => zodSchema12(
|
|
3437
|
+
z13.object({
|
|
3438
|
+
action: z13.enum([
|
|
3207
3439
|
"key",
|
|
3208
3440
|
"hold_key",
|
|
3209
3441
|
"type",
|
|
@@ -3221,12 +3453,12 @@ var computer_20250124InputSchema = lazySchema11(
|
|
|
3221
3453
|
"wait",
|
|
3222
3454
|
"screenshot"
|
|
3223
3455
|
]),
|
|
3224
|
-
coordinate:
|
|
3225
|
-
duration:
|
|
3226
|
-
scroll_amount:
|
|
3227
|
-
scroll_direction:
|
|
3228
|
-
start_coordinate:
|
|
3229
|
-
text:
|
|
3456
|
+
coordinate: z13.tuple([z13.number().int(), z13.number().int()]).optional(),
|
|
3457
|
+
duration: z13.number().optional(),
|
|
3458
|
+
scroll_amount: z13.number().optional(),
|
|
3459
|
+
scroll_direction: z13.enum(["up", "down", "left", "right"]).optional(),
|
|
3460
|
+
start_coordinate: z13.tuple([z13.number().int(), z13.number().int()]).optional(),
|
|
3461
|
+
text: z13.string().optional()
|
|
3230
3462
|
})
|
|
3231
3463
|
)
|
|
3232
3464
|
);
|
|
@@ -3238,43 +3470,43 @@ var computer_20250124 = createProviderToolFactory5({
|
|
|
3238
3470
|
// src/tool/memory_20250818.ts
|
|
3239
3471
|
import {
|
|
3240
3472
|
createProviderToolFactory as createProviderToolFactory6,
|
|
3241
|
-
lazySchema as
|
|
3242
|
-
zodSchema as
|
|
3473
|
+
lazySchema as lazySchema13,
|
|
3474
|
+
zodSchema as zodSchema13
|
|
3243
3475
|
} from "@ai-sdk/provider-utils";
|
|
3244
|
-
import { z as
|
|
3245
|
-
var memory_20250818InputSchema =
|
|
3246
|
-
() =>
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
command:
|
|
3250
|
-
path:
|
|
3251
|
-
view_range:
|
|
3476
|
+
import { z as z14 } from "zod/v4";
|
|
3477
|
+
var memory_20250818InputSchema = lazySchema13(
|
|
3478
|
+
() => zodSchema13(
|
|
3479
|
+
z14.discriminatedUnion("command", [
|
|
3480
|
+
z14.object({
|
|
3481
|
+
command: z14.literal("view"),
|
|
3482
|
+
path: z14.string(),
|
|
3483
|
+
view_range: z14.tuple([z14.number(), z14.number()]).optional()
|
|
3252
3484
|
}),
|
|
3253
|
-
|
|
3254
|
-
command:
|
|
3255
|
-
path:
|
|
3256
|
-
file_text:
|
|
3485
|
+
z14.object({
|
|
3486
|
+
command: z14.literal("create"),
|
|
3487
|
+
path: z14.string(),
|
|
3488
|
+
file_text: z14.string()
|
|
3257
3489
|
}),
|
|
3258
|
-
|
|
3259
|
-
command:
|
|
3260
|
-
path:
|
|
3261
|
-
old_str:
|
|
3262
|
-
new_str:
|
|
3490
|
+
z14.object({
|
|
3491
|
+
command: z14.literal("str_replace"),
|
|
3492
|
+
path: z14.string(),
|
|
3493
|
+
old_str: z14.string(),
|
|
3494
|
+
new_str: z14.string()
|
|
3263
3495
|
}),
|
|
3264
|
-
|
|
3265
|
-
command:
|
|
3266
|
-
path:
|
|
3267
|
-
insert_line:
|
|
3268
|
-
insert_text:
|
|
3496
|
+
z14.object({
|
|
3497
|
+
command: z14.literal("insert"),
|
|
3498
|
+
path: z14.string(),
|
|
3499
|
+
insert_line: z14.number(),
|
|
3500
|
+
insert_text: z14.string()
|
|
3269
3501
|
}),
|
|
3270
|
-
|
|
3271
|
-
command:
|
|
3272
|
-
path:
|
|
3502
|
+
z14.object({
|
|
3503
|
+
command: z14.literal("delete"),
|
|
3504
|
+
path: z14.string()
|
|
3273
3505
|
}),
|
|
3274
|
-
|
|
3275
|
-
command:
|
|
3276
|
-
old_path:
|
|
3277
|
-
new_path:
|
|
3506
|
+
z14.object({
|
|
3507
|
+
command: z14.literal("rename"),
|
|
3508
|
+
old_path: z14.string(),
|
|
3509
|
+
new_path: z14.string()
|
|
3278
3510
|
})
|
|
3279
3511
|
])
|
|
3280
3512
|
)
|
|
@@ -3287,36 +3519,11 @@ var memory_20250818 = createProviderToolFactory6({
|
|
|
3287
3519
|
// src/tool/text-editor_20241022.ts
|
|
3288
3520
|
import {
|
|
3289
3521
|
createProviderToolFactory as createProviderToolFactory7,
|
|
3290
|
-
lazySchema as lazySchema13,
|
|
3291
|
-
zodSchema as zodSchema13
|
|
3292
|
-
} from "@ai-sdk/provider-utils";
|
|
3293
|
-
import { z as z14 } from "zod/v4";
|
|
3294
|
-
var textEditor_20241022InputSchema = lazySchema13(
|
|
3295
|
-
() => zodSchema13(
|
|
3296
|
-
z14.object({
|
|
3297
|
-
command: z14.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
3298
|
-
path: z14.string(),
|
|
3299
|
-
file_text: z14.string().optional(),
|
|
3300
|
-
insert_line: z14.number().int().optional(),
|
|
3301
|
-
new_str: z14.string().optional(),
|
|
3302
|
-
old_str: z14.string().optional(),
|
|
3303
|
-
view_range: z14.array(z14.number().int()).optional()
|
|
3304
|
-
})
|
|
3305
|
-
)
|
|
3306
|
-
);
|
|
3307
|
-
var textEditor_20241022 = createProviderToolFactory7({
|
|
3308
|
-
id: "anthropic.text_editor_20241022",
|
|
3309
|
-
inputSchema: textEditor_20241022InputSchema
|
|
3310
|
-
});
|
|
3311
|
-
|
|
3312
|
-
// src/tool/text-editor_20250124.ts
|
|
3313
|
-
import {
|
|
3314
|
-
createProviderToolFactory as createProviderToolFactory8,
|
|
3315
3522
|
lazySchema as lazySchema14,
|
|
3316
3523
|
zodSchema as zodSchema14
|
|
3317
3524
|
} from "@ai-sdk/provider-utils";
|
|
3318
3525
|
import { z as z15 } from "zod/v4";
|
|
3319
|
-
var
|
|
3526
|
+
var textEditor_20241022InputSchema = lazySchema14(
|
|
3320
3527
|
() => zodSchema14(
|
|
3321
3528
|
z15.object({
|
|
3322
3529
|
command: z15.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
@@ -3329,22 +3536,22 @@ var textEditor_20250124InputSchema = lazySchema14(
|
|
|
3329
3536
|
})
|
|
3330
3537
|
)
|
|
3331
3538
|
);
|
|
3332
|
-
var
|
|
3333
|
-
id: "anthropic.
|
|
3334
|
-
inputSchema:
|
|
3539
|
+
var textEditor_20241022 = createProviderToolFactory7({
|
|
3540
|
+
id: "anthropic.text_editor_20241022",
|
|
3541
|
+
inputSchema: textEditor_20241022InputSchema
|
|
3335
3542
|
});
|
|
3336
3543
|
|
|
3337
|
-
// src/tool/text-
|
|
3544
|
+
// src/tool/text-editor_20250124.ts
|
|
3338
3545
|
import {
|
|
3339
|
-
createProviderToolFactory as
|
|
3546
|
+
createProviderToolFactory as createProviderToolFactory8,
|
|
3340
3547
|
lazySchema as lazySchema15,
|
|
3341
3548
|
zodSchema as zodSchema15
|
|
3342
3549
|
} from "@ai-sdk/provider-utils";
|
|
3343
3550
|
import { z as z16 } from "zod/v4";
|
|
3344
|
-
var
|
|
3551
|
+
var textEditor_20250124InputSchema = lazySchema15(
|
|
3345
3552
|
() => zodSchema15(
|
|
3346
3553
|
z16.object({
|
|
3347
|
-
command: z16.enum(["view", "create", "str_replace", "insert"]),
|
|
3554
|
+
command: z16.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
3348
3555
|
path: z16.string(),
|
|
3349
3556
|
file_text: z16.string().optional(),
|
|
3350
3557
|
insert_line: z16.number().int().optional(),
|
|
@@ -3354,11 +3561,77 @@ var textEditor_20250429InputSchema = lazySchema15(
|
|
|
3354
3561
|
})
|
|
3355
3562
|
)
|
|
3356
3563
|
);
|
|
3564
|
+
var textEditor_20250124 = createProviderToolFactory8({
|
|
3565
|
+
id: "anthropic.text_editor_20250124",
|
|
3566
|
+
inputSchema: textEditor_20250124InputSchema
|
|
3567
|
+
});
|
|
3568
|
+
|
|
3569
|
+
// src/tool/text-editor_20250429.ts
|
|
3570
|
+
import {
|
|
3571
|
+
createProviderToolFactory as createProviderToolFactory9,
|
|
3572
|
+
lazySchema as lazySchema16,
|
|
3573
|
+
zodSchema as zodSchema16
|
|
3574
|
+
} from "@ai-sdk/provider-utils";
|
|
3575
|
+
import { z as z17 } from "zod/v4";
|
|
3576
|
+
var textEditor_20250429InputSchema = lazySchema16(
|
|
3577
|
+
() => zodSchema16(
|
|
3578
|
+
z17.object({
|
|
3579
|
+
command: z17.enum(["view", "create", "str_replace", "insert"]),
|
|
3580
|
+
path: z17.string(),
|
|
3581
|
+
file_text: z17.string().optional(),
|
|
3582
|
+
insert_line: z17.number().int().optional(),
|
|
3583
|
+
new_str: z17.string().optional(),
|
|
3584
|
+
old_str: z17.string().optional(),
|
|
3585
|
+
view_range: z17.array(z17.number().int()).optional()
|
|
3586
|
+
})
|
|
3587
|
+
)
|
|
3588
|
+
);
|
|
3357
3589
|
var textEditor_20250429 = createProviderToolFactory9({
|
|
3358
3590
|
id: "anthropic.text_editor_20250429",
|
|
3359
3591
|
inputSchema: textEditor_20250429InputSchema
|
|
3360
3592
|
});
|
|
3361
3593
|
|
|
3594
|
+
// src/tool/tool-search-bm25_20251119.ts
|
|
3595
|
+
import {
|
|
3596
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,
|
|
3597
|
+
lazySchema as lazySchema17,
|
|
3598
|
+
zodSchema as zodSchema17
|
|
3599
|
+
} from "@ai-sdk/provider-utils";
|
|
3600
|
+
import { z as z18 } from "zod/v4";
|
|
3601
|
+
var toolSearchBm25_20251119OutputSchema = lazySchema17(
|
|
3602
|
+
() => zodSchema17(
|
|
3603
|
+
z18.array(
|
|
3604
|
+
z18.object({
|
|
3605
|
+
type: z18.literal("tool_reference"),
|
|
3606
|
+
toolName: z18.string()
|
|
3607
|
+
})
|
|
3608
|
+
)
|
|
3609
|
+
)
|
|
3610
|
+
);
|
|
3611
|
+
var toolSearchBm25_20251119InputSchema = lazySchema17(
|
|
3612
|
+
() => zodSchema17(
|
|
3613
|
+
z18.object({
|
|
3614
|
+
/**
|
|
3615
|
+
* A natural language query to search for tools.
|
|
3616
|
+
* Claude will use BM25 text search to find relevant tools.
|
|
3617
|
+
*/
|
|
3618
|
+
query: z18.string(),
|
|
3619
|
+
/**
|
|
3620
|
+
* Maximum number of tools to return. Optional.
|
|
3621
|
+
*/
|
|
3622
|
+
limit: z18.number().optional()
|
|
3623
|
+
})
|
|
3624
|
+
)
|
|
3625
|
+
);
|
|
3626
|
+
var factory7 = createProviderToolFactoryWithOutputSchema6({
|
|
3627
|
+
id: "anthropic.tool_search_bm25_20251119",
|
|
3628
|
+
inputSchema: toolSearchBm25_20251119InputSchema,
|
|
3629
|
+
outputSchema: toolSearchBm25_20251119OutputSchema
|
|
3630
|
+
});
|
|
3631
|
+
var toolSearchBm25_20251119 = (args = {}) => {
|
|
3632
|
+
return factory7(args);
|
|
3633
|
+
};
|
|
3634
|
+
|
|
3362
3635
|
// src/anthropic-tools.ts
|
|
3363
3636
|
var anthropicTools = {
|
|
3364
3637
|
/**
|
|
@@ -3482,7 +3755,35 @@ var anthropicTools = {
|
|
|
3482
3755
|
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
3483
3756
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
3484
3757
|
*/
|
|
3485
|
-
webSearch_20250305
|
|
3758
|
+
webSearch_20250305,
|
|
3759
|
+
/**
|
|
3760
|
+
* Creates a tool search tool that uses regex patterns to find tools.
|
|
3761
|
+
*
|
|
3762
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
3763
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
3764
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
3765
|
+
* catalog and loads only the tools it needs.
|
|
3766
|
+
*
|
|
3767
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
3768
|
+
* to mark them for deferred loading.
|
|
3769
|
+
*
|
|
3770
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
3771
|
+
*/
|
|
3772
|
+
toolSearchRegex_20251119,
|
|
3773
|
+
/**
|
|
3774
|
+
* Creates a tool search tool that uses BM25 (natural language) to find tools.
|
|
3775
|
+
*
|
|
3776
|
+
* The tool search tool enables Claude to work with hundreds or thousands of tools
|
|
3777
|
+
* by dynamically discovering and loading them on-demand. Instead of loading all
|
|
3778
|
+
* tool definitions into the context window upfront, Claude searches your tool
|
|
3779
|
+
* catalog and loads only the tools it needs.
|
|
3780
|
+
*
|
|
3781
|
+
* Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools
|
|
3782
|
+
* to mark them for deferred loading.
|
|
3783
|
+
*
|
|
3784
|
+
* Supported models: Claude Opus 4.5, Claude Sonnet 4.5
|
|
3785
|
+
*/
|
|
3786
|
+
toolSearchBm25_20251119
|
|
3486
3787
|
};
|
|
3487
3788
|
|
|
3488
3789
|
// src/anthropic-provider.ts
|