@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/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.74" : "0.0.0-test";
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,12 +921,15 @@ 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
931
  ...supportsStructuredOutput === true && tool.strict != null ? { strict: tool.strict } : {},
932
+ ...deferLoading != null ? { defer_loading: deferLoading } : {},
889
933
  ...tool.inputExamples != null ? {
890
934
  input_examples: tool.inputExamples.map(
891
935
  (example) => example.input
@@ -1040,6 +1084,22 @@ async function prepareTools({
1040
1084
  });
1041
1085
  break;
1042
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
+ }
1043
1103
  default: {
1044
1104
  toolWarnings.push({
1045
1105
  type: "unsupported",
@@ -1247,6 +1307,53 @@ var codeExecution_20250825 = (args = {}) => {
1247
1307
  return factory5(args);
1248
1308
  };
1249
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
+
1250
1357
  // src/convert-to-anthropic-messages-prompt.ts
1251
1358
  function convertToString(data) {
1252
1359
  if (typeof data === "string") {
@@ -1651,6 +1758,14 @@ async function convertToAnthropicMessagesPrompt({
1651
1758
  input: part.input,
1652
1759
  cache_control: cacheControl
1653
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
+ });
1654
1769
  } else {
1655
1770
  warnings.push({
1656
1771
  type: "other",
@@ -1804,6 +1919,34 @@ async function convertToAnthropicMessagesPrompt({
1804
1919
  });
1805
1920
  break;
1806
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
+ }
1807
1950
  warnings.push({
1808
1951
  type: "other",
1809
1952
  message: `provider executed tool result for tool ${part.toolName} is not supported`
@@ -2029,7 +2172,9 @@ var AnthropicMessagesLanguageModel = class {
2029
2172
  "anthropic.bash_20250124": "bash",
2030
2173
  "anthropic.memory_20250818": "memory",
2031
2174
  "anthropic.web_search_20250305": "web_search",
2032
- "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"
2033
2178
  }
2034
2179
  });
2035
2180
  const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({
@@ -2353,6 +2498,14 @@ var AnthropicMessagesLanguageModel = class {
2353
2498
  input: JSON.stringify(part.input),
2354
2499
  providerExecuted: true
2355
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
+ });
2356
2509
  }
2357
2510
  break;
2358
2511
  }
@@ -2506,6 +2659,32 @@ var AnthropicMessagesLanguageModel = class {
2506
2659
  });
2507
2660
  break;
2508
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
+ }
2509
2688
  }
2510
2689
  }
2511
2690
  return {
@@ -2696,6 +2875,25 @@ var AnthropicMessagesLanguageModel = class {
2696
2875
  toolName: customToolName,
2697
2876
  providerExecuted: true
2698
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
+ });
2699
2897
  }
2700
2898
  return;
2701
2899
  }
@@ -2819,6 +3017,32 @@ var AnthropicMessagesLanguageModel = class {
2819
3017
  });
2820
3018
  return;
2821
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
+ }
2822
3046
  case "mcp_tool_use": {
2823
3047
  mcpToolCalls[part.id] = {
2824
3048
  type: "tool-call",
@@ -3132,15 +3356,15 @@ function getModelCapabilities(modelId) {
3132
3356
  // src/tool/bash_20241022.ts
3133
3357
  import {
3134
3358
  createProviderToolFactory as createProviderToolFactory2,
3135
- lazySchema as lazySchema8,
3136
- zodSchema as zodSchema8
3359
+ lazySchema as lazySchema9,
3360
+ zodSchema as zodSchema9
3137
3361
  } from "@ai-sdk/provider-utils";
3138
- import { z as z9 } from "zod/v4";
3139
- var bash_20241022InputSchema = lazySchema8(
3140
- () => zodSchema8(
3141
- z9.object({
3142
- command: z9.string(),
3143
- restart: z9.boolean().optional()
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()
3144
3368
  })
3145
3369
  )
3146
3370
  );
@@ -3152,15 +3376,15 @@ var bash_20241022 = createProviderToolFactory2({
3152
3376
  // src/tool/bash_20250124.ts
3153
3377
  import {
3154
3378
  createProviderToolFactory as createProviderToolFactory3,
3155
- lazySchema as lazySchema9,
3156
- zodSchema as zodSchema9
3379
+ lazySchema as lazySchema10,
3380
+ zodSchema as zodSchema10
3157
3381
  } from "@ai-sdk/provider-utils";
3158
- import { z as z10 } from "zod/v4";
3159
- var bash_20250124InputSchema = lazySchema9(
3160
- () => zodSchema9(
3161
- z10.object({
3162
- command: z10.string(),
3163
- restart: z10.boolean().optional()
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()
3164
3388
  })
3165
3389
  )
3166
3390
  );
@@ -3172,14 +3396,14 @@ var bash_20250124 = createProviderToolFactory3({
3172
3396
  // src/tool/computer_20241022.ts
3173
3397
  import {
3174
3398
  createProviderToolFactory as createProviderToolFactory4,
3175
- lazySchema as lazySchema10,
3176
- zodSchema as zodSchema10
3399
+ lazySchema as lazySchema11,
3400
+ zodSchema as zodSchema11
3177
3401
  } from "@ai-sdk/provider-utils";
3178
- import { z as z11 } from "zod/v4";
3179
- var computer_20241022InputSchema = lazySchema10(
3180
- () => zodSchema10(
3181
- z11.object({
3182
- action: z11.enum([
3402
+ import { z as z12 } from "zod/v4";
3403
+ var computer_20241022InputSchema = lazySchema11(
3404
+ () => zodSchema11(
3405
+ z12.object({
3406
+ action: z12.enum([
3183
3407
  "key",
3184
3408
  "type",
3185
3409
  "mouse_move",
@@ -3191,8 +3415,8 @@ var computer_20241022InputSchema = lazySchema10(
3191
3415
  "screenshot",
3192
3416
  "cursor_position"
3193
3417
  ]),
3194
- coordinate: z11.array(z11.number().int()).optional(),
3195
- text: z11.string().optional()
3418
+ coordinate: z12.array(z12.number().int()).optional(),
3419
+ text: z12.string().optional()
3196
3420
  })
3197
3421
  )
3198
3422
  );
@@ -3204,14 +3428,14 @@ var computer_20241022 = createProviderToolFactory4({
3204
3428
  // src/tool/computer_20250124.ts
3205
3429
  import {
3206
3430
  createProviderToolFactory as createProviderToolFactory5,
3207
- lazySchema as lazySchema11,
3208
- zodSchema as zodSchema11
3431
+ lazySchema as lazySchema12,
3432
+ zodSchema as zodSchema12
3209
3433
  } from "@ai-sdk/provider-utils";
3210
- import { z as z12 } from "zod/v4";
3211
- var computer_20250124InputSchema = lazySchema11(
3212
- () => zodSchema11(
3213
- z12.object({
3214
- action: z12.enum([
3434
+ import { z as z13 } from "zod/v4";
3435
+ var computer_20250124InputSchema = lazySchema12(
3436
+ () => zodSchema12(
3437
+ z13.object({
3438
+ action: z13.enum([
3215
3439
  "key",
3216
3440
  "hold_key",
3217
3441
  "type",
@@ -3229,12 +3453,12 @@ var computer_20250124InputSchema = lazySchema11(
3229
3453
  "wait",
3230
3454
  "screenshot"
3231
3455
  ]),
3232
- coordinate: z12.tuple([z12.number().int(), z12.number().int()]).optional(),
3233
- duration: z12.number().optional(),
3234
- scroll_amount: z12.number().optional(),
3235
- scroll_direction: z12.enum(["up", "down", "left", "right"]).optional(),
3236
- start_coordinate: z12.tuple([z12.number().int(), z12.number().int()]).optional(),
3237
- text: z12.string().optional()
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()
3238
3462
  })
3239
3463
  )
3240
3464
  );
@@ -3246,43 +3470,43 @@ var computer_20250124 = createProviderToolFactory5({
3246
3470
  // src/tool/memory_20250818.ts
3247
3471
  import {
3248
3472
  createProviderToolFactory as createProviderToolFactory6,
3249
- lazySchema as lazySchema12,
3250
- zodSchema as zodSchema12
3473
+ lazySchema as lazySchema13,
3474
+ zodSchema as zodSchema13
3251
3475
  } from "@ai-sdk/provider-utils";
3252
- import { z as z13 } from "zod/v4";
3253
- var memory_20250818InputSchema = lazySchema12(
3254
- () => zodSchema12(
3255
- z13.discriminatedUnion("command", [
3256
- z13.object({
3257
- command: z13.literal("view"),
3258
- path: z13.string(),
3259
- view_range: z13.tuple([z13.number(), z13.number()]).optional()
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()
3260
3484
  }),
3261
- z13.object({
3262
- command: z13.literal("create"),
3263
- path: z13.string(),
3264
- file_text: z13.string()
3485
+ z14.object({
3486
+ command: z14.literal("create"),
3487
+ path: z14.string(),
3488
+ file_text: z14.string()
3265
3489
  }),
3266
- z13.object({
3267
- command: z13.literal("str_replace"),
3268
- path: z13.string(),
3269
- old_str: z13.string(),
3270
- new_str: z13.string()
3490
+ z14.object({
3491
+ command: z14.literal("str_replace"),
3492
+ path: z14.string(),
3493
+ old_str: z14.string(),
3494
+ new_str: z14.string()
3271
3495
  }),
3272
- z13.object({
3273
- command: z13.literal("insert"),
3274
- path: z13.string(),
3275
- insert_line: z13.number(),
3276
- insert_text: z13.string()
3496
+ z14.object({
3497
+ command: z14.literal("insert"),
3498
+ path: z14.string(),
3499
+ insert_line: z14.number(),
3500
+ insert_text: z14.string()
3277
3501
  }),
3278
- z13.object({
3279
- command: z13.literal("delete"),
3280
- path: z13.string()
3502
+ z14.object({
3503
+ command: z14.literal("delete"),
3504
+ path: z14.string()
3281
3505
  }),
3282
- z13.object({
3283
- command: z13.literal("rename"),
3284
- old_path: z13.string(),
3285
- new_path: z13.string()
3506
+ z14.object({
3507
+ command: z14.literal("rename"),
3508
+ old_path: z14.string(),
3509
+ new_path: z14.string()
3286
3510
  })
3287
3511
  ])
3288
3512
  )
@@ -3295,36 +3519,11 @@ var memory_20250818 = createProviderToolFactory6({
3295
3519
  // src/tool/text-editor_20241022.ts
3296
3520
  import {
3297
3521
  createProviderToolFactory as createProviderToolFactory7,
3298
- lazySchema as lazySchema13,
3299
- zodSchema as zodSchema13
3300
- } from "@ai-sdk/provider-utils";
3301
- import { z as z14 } from "zod/v4";
3302
- var textEditor_20241022InputSchema = lazySchema13(
3303
- () => zodSchema13(
3304
- z14.object({
3305
- command: z14.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
3306
- path: z14.string(),
3307
- file_text: z14.string().optional(),
3308
- insert_line: z14.number().int().optional(),
3309
- new_str: z14.string().optional(),
3310
- old_str: z14.string().optional(),
3311
- view_range: z14.array(z14.number().int()).optional()
3312
- })
3313
- )
3314
- );
3315
- var textEditor_20241022 = createProviderToolFactory7({
3316
- id: "anthropic.text_editor_20241022",
3317
- inputSchema: textEditor_20241022InputSchema
3318
- });
3319
-
3320
- // src/tool/text-editor_20250124.ts
3321
- import {
3322
- createProviderToolFactory as createProviderToolFactory8,
3323
3522
  lazySchema as lazySchema14,
3324
3523
  zodSchema as zodSchema14
3325
3524
  } from "@ai-sdk/provider-utils";
3326
3525
  import { z as z15 } from "zod/v4";
3327
- var textEditor_20250124InputSchema = lazySchema14(
3526
+ var textEditor_20241022InputSchema = lazySchema14(
3328
3527
  () => zodSchema14(
3329
3528
  z15.object({
3330
3529
  command: z15.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
@@ -3337,22 +3536,22 @@ var textEditor_20250124InputSchema = lazySchema14(
3337
3536
  })
3338
3537
  )
3339
3538
  );
3340
- var textEditor_20250124 = createProviderToolFactory8({
3341
- id: "anthropic.text_editor_20250124",
3342
- inputSchema: textEditor_20250124InputSchema
3539
+ var textEditor_20241022 = createProviderToolFactory7({
3540
+ id: "anthropic.text_editor_20241022",
3541
+ inputSchema: textEditor_20241022InputSchema
3343
3542
  });
3344
3543
 
3345
- // src/tool/text-editor_20250429.ts
3544
+ // src/tool/text-editor_20250124.ts
3346
3545
  import {
3347
- createProviderToolFactory as createProviderToolFactory9,
3546
+ createProviderToolFactory as createProviderToolFactory8,
3348
3547
  lazySchema as lazySchema15,
3349
3548
  zodSchema as zodSchema15
3350
3549
  } from "@ai-sdk/provider-utils";
3351
3550
  import { z as z16 } from "zod/v4";
3352
- var textEditor_20250429InputSchema = lazySchema15(
3551
+ var textEditor_20250124InputSchema = lazySchema15(
3353
3552
  () => zodSchema15(
3354
3553
  z16.object({
3355
- command: z16.enum(["view", "create", "str_replace", "insert"]),
3554
+ command: z16.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
3356
3555
  path: z16.string(),
3357
3556
  file_text: z16.string().optional(),
3358
3557
  insert_line: z16.number().int().optional(),
@@ -3362,11 +3561,77 @@ var textEditor_20250429InputSchema = lazySchema15(
3362
3561
  })
3363
3562
  )
3364
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
+ );
3365
3589
  var textEditor_20250429 = createProviderToolFactory9({
3366
3590
  id: "anthropic.text_editor_20250429",
3367
3591
  inputSchema: textEditor_20250429InputSchema
3368
3592
  });
3369
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
+
3370
3635
  // src/anthropic-tools.ts
3371
3636
  var anthropicTools = {
3372
3637
  /**
@@ -3490,7 +3755,35 @@ var anthropicTools = {
3490
3755
  * @param blockedDomains - Optional list of domains that Claude should avoid when searching.
3491
3756
  * @param userLocation - Optional user location information to provide geographically relevant search results.
3492
3757
  */
3493
- 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
3494
3787
  };
3495
3788
 
3496
3789
  // src/anthropic-provider.ts