@ai-sdk/anthropic 3.0.0-beta.23 → 3.0.0-beta.25

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.
@@ -233,6 +233,42 @@ declare const anthropicTools: {
233
233
  displayHeightPx: number;
234
234
  displayNumber?: number;
235
235
  }>;
236
+ /**
237
+ * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
238
+ * Claude can create, read, update, and delete files that persist between sessions,
239
+ * allowing it to build knowledge over time without keeping everything in the context window.
240
+ * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
241
+ *
242
+ * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
243
+ *
244
+ * Tool name must be `memory`.
245
+ */
246
+ memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
247
+ command: "view";
248
+ path: string;
249
+ view_range?: [number, number];
250
+ } | {
251
+ command: "create";
252
+ path: string;
253
+ file_text: string;
254
+ } | {
255
+ command: "str_replace";
256
+ path: string;
257
+ old_str: string;
258
+ new_str: string;
259
+ } | {
260
+ command: "insert";
261
+ path: string;
262
+ insert_line: number;
263
+ insert_text: string;
264
+ } | {
265
+ command: "delete";
266
+ path: string;
267
+ } | {
268
+ command: "rename";
269
+ old_path: string;
270
+ new_path: string;
271
+ }, {}>;
236
272
  /**
237
273
  * Claude can use an Anthropic-defined text editor tool to view and modify text files,
238
274
  * helping you debug, fix, and improve your code or other text documents. This allows Claude
@@ -455,6 +491,9 @@ type AnthropicTool = {
455
491
  } | {
456
492
  name: string;
457
493
  type: 'bash_20250124' | 'bash_20241022';
494
+ } | {
495
+ name: string;
496
+ type: 'memory_20250818';
458
497
  } | {
459
498
  type: 'web_fetch_20250910';
460
499
  name: string;
@@ -233,6 +233,42 @@ declare const anthropicTools: {
233
233
  displayHeightPx: number;
234
234
  displayNumber?: number;
235
235
  }>;
236
+ /**
237
+ * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
238
+ * Claude can create, read, update, and delete files that persist between sessions,
239
+ * allowing it to build knowledge over time without keeping everything in the context window.
240
+ * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
241
+ *
242
+ * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
243
+ *
244
+ * Tool name must be `memory`.
245
+ */
246
+ memory_20250818: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
247
+ command: "view";
248
+ path: string;
249
+ view_range?: [number, number];
250
+ } | {
251
+ command: "create";
252
+ path: string;
253
+ file_text: string;
254
+ } | {
255
+ command: "str_replace";
256
+ path: string;
257
+ old_str: string;
258
+ new_str: string;
259
+ } | {
260
+ command: "insert";
261
+ path: string;
262
+ insert_line: number;
263
+ insert_text: string;
264
+ } | {
265
+ command: "delete";
266
+ path: string;
267
+ } | {
268
+ command: "rename";
269
+ old_path: string;
270
+ new_path: string;
271
+ }, {}>;
236
272
  /**
237
273
  * Claude can use an Anthropic-defined text editor tool to view and modify text files,
238
274
  * helping you debug, fix, and improve your code or other text documents. This allows Claude
@@ -455,6 +491,9 @@ type AnthropicTool = {
455
491
  } | {
456
492
  name: string;
457
493
  type: 'bash_20250124' | 'bash_20241022';
494
+ } | {
495
+ name: string;
496
+ type: 'memory_20250818';
458
497
  } | {
459
498
  type: 'web_fetch_20250910';
460
499
  name: string;
@@ -807,6 +807,14 @@ async function prepareTools({
807
807
  });
808
808
  break;
809
809
  }
810
+ case "anthropic.memory_20250818": {
811
+ betas.add("context-management-2025-06-27");
812
+ anthropicTools2.push({
813
+ name: "memory",
814
+ type: "memory_20250818"
815
+ });
816
+ break;
817
+ }
810
818
  case "anthropic.web_fetch_20250910": {
811
819
  betas.add("web-fetch-2025-09-10");
812
820
  const args = await (0, import_provider_utils7.validateTypes)({
@@ -2621,32 +2629,56 @@ var computer_20250124 = (0, import_provider_utils15.createProviderDefinedToolFac
2621
2629
  inputSchema: computer_20250124InputSchema
2622
2630
  });
2623
2631
 
2624
- // src/tool/text-editor_20241022.ts
2632
+ // src/tool/memory_20250818.ts
2625
2633
  var import_provider_utils16 = require("@ai-sdk/provider-utils");
2626
2634
  var import_v413 = require("zod/v4");
2627
- var textEditor_20241022InputSchema = (0, import_provider_utils16.lazySchema)(
2635
+ var memory_20250818InputSchema = (0, import_provider_utils16.lazySchema)(
2628
2636
  () => (0, import_provider_utils16.zodSchema)(
2629
- import_v413.z.object({
2630
- command: import_v413.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2631
- path: import_v413.z.string(),
2632
- file_text: import_v413.z.string().optional(),
2633
- insert_line: import_v413.z.number().int().optional(),
2634
- new_str: import_v413.z.string().optional(),
2635
- old_str: import_v413.z.string().optional(),
2636
- view_range: import_v413.z.array(import_v413.z.number().int()).optional()
2637
- })
2637
+ import_v413.z.discriminatedUnion("command", [
2638
+ import_v413.z.object({
2639
+ command: import_v413.z.literal("view"),
2640
+ path: import_v413.z.string(),
2641
+ view_range: import_v413.z.tuple([import_v413.z.number(), import_v413.z.number()]).optional()
2642
+ }),
2643
+ import_v413.z.object({
2644
+ command: import_v413.z.literal("create"),
2645
+ path: import_v413.z.string(),
2646
+ file_text: import_v413.z.string()
2647
+ }),
2648
+ import_v413.z.object({
2649
+ command: import_v413.z.literal("str_replace"),
2650
+ path: import_v413.z.string(),
2651
+ old_str: import_v413.z.string(),
2652
+ new_str: import_v413.z.string()
2653
+ }),
2654
+ import_v413.z.object({
2655
+ command: import_v413.z.literal("insert"),
2656
+ path: import_v413.z.string(),
2657
+ insert_line: import_v413.z.number(),
2658
+ insert_text: import_v413.z.string()
2659
+ }),
2660
+ import_v413.z.object({
2661
+ command: import_v413.z.literal("delete"),
2662
+ path: import_v413.z.string()
2663
+ }),
2664
+ import_v413.z.object({
2665
+ command: import_v413.z.literal("rename"),
2666
+ old_path: import_v413.z.string(),
2667
+ new_path: import_v413.z.string()
2668
+ })
2669
+ ])
2638
2670
  )
2639
2671
  );
2640
- var textEditor_20241022 = (0, import_provider_utils16.createProviderDefinedToolFactory)({
2641
- id: "anthropic.text_editor_20241022",
2642
- name: "str_replace_editor",
2643
- inputSchema: textEditor_20241022InputSchema
2672
+ var memory_20250818 = (0, import_provider_utils16.createProviderDefinedToolFactory)({
2673
+ id: "anthropic.memory_20250818",
2674
+ name: "memory",
2675
+ inputSchema: memory_20250818InputSchema
2644
2676
  });
2645
2677
 
2646
- // src/tool/text-editor_20250124.ts
2678
+ // src/tool/text-editor_20241022.ts
2647
2679
  var import_provider_utils17 = require("@ai-sdk/provider-utils");
2648
2680
  var import_v414 = require("zod/v4");
2649
- var textEditor_20250124InputSchema = (0, import_provider_utils17.lazySchema)(
2681
+ var textEditor_20241022InputSchema = (0, import_provider_utils17.lazySchema)(
2650
2682
  () => (0, import_provider_utils17.zodSchema)(
2651
2683
  import_v414.z.object({
2652
2684
  command: import_v414.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
@@ -2659,19 +2691,19 @@ var textEditor_20250124InputSchema = (0, import_provider_utils17.lazySchema)(
2659
2691
  })
2660
2692
  )
2661
2693
  );
2662
- var textEditor_20250124 = (0, import_provider_utils17.createProviderDefinedToolFactory)({
2663
- id: "anthropic.text_editor_20250124",
2694
+ var textEditor_20241022 = (0, import_provider_utils17.createProviderDefinedToolFactory)({
2695
+ id: "anthropic.text_editor_20241022",
2664
2696
  name: "str_replace_editor",
2665
- inputSchema: textEditor_20250124InputSchema
2697
+ inputSchema: textEditor_20241022InputSchema
2666
2698
  });
2667
2699
 
2668
- // src/tool/text-editor_20250429.ts
2700
+ // src/tool/text-editor_20250124.ts
2669
2701
  var import_provider_utils18 = require("@ai-sdk/provider-utils");
2670
2702
  var import_v415 = require("zod/v4");
2671
- var textEditor_20250429InputSchema = (0, import_provider_utils18.lazySchema)(
2703
+ var textEditor_20250124InputSchema = (0, import_provider_utils18.lazySchema)(
2672
2704
  () => (0, import_provider_utils18.zodSchema)(
2673
2705
  import_v415.z.object({
2674
- command: import_v415.z.enum(["view", "create", "str_replace", "insert"]),
2706
+ command: import_v415.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
2675
2707
  path: import_v415.z.string(),
2676
2708
  file_text: import_v415.z.string().optional(),
2677
2709
  insert_line: import_v415.z.number().int().optional(),
@@ -2681,7 +2713,29 @@ var textEditor_20250429InputSchema = (0, import_provider_utils18.lazySchema)(
2681
2713
  })
2682
2714
  )
2683
2715
  );
2684
- var textEditor_20250429 = (0, import_provider_utils18.createProviderDefinedToolFactory)({
2716
+ var textEditor_20250124 = (0, import_provider_utils18.createProviderDefinedToolFactory)({
2717
+ id: "anthropic.text_editor_20250124",
2718
+ name: "str_replace_editor",
2719
+ inputSchema: textEditor_20250124InputSchema
2720
+ });
2721
+
2722
+ // src/tool/text-editor_20250429.ts
2723
+ var import_provider_utils19 = require("@ai-sdk/provider-utils");
2724
+ var import_v416 = require("zod/v4");
2725
+ var textEditor_20250429InputSchema = (0, import_provider_utils19.lazySchema)(
2726
+ () => (0, import_provider_utils19.zodSchema)(
2727
+ import_v416.z.object({
2728
+ command: import_v416.z.enum(["view", "create", "str_replace", "insert"]),
2729
+ path: import_v416.z.string(),
2730
+ file_text: import_v416.z.string().optional(),
2731
+ insert_line: import_v416.z.number().int().optional(),
2732
+ new_str: import_v416.z.string().optional(),
2733
+ old_str: import_v416.z.string().optional(),
2734
+ view_range: import_v416.z.array(import_v416.z.number().int()).optional()
2735
+ })
2736
+ )
2737
+ );
2738
+ var textEditor_20250429 = (0, import_provider_utils19.createProviderDefinedToolFactory)({
2685
2739
  id: "anthropic.text_editor_20250429",
2686
2740
  name: "str_replace_based_edit_tool",
2687
2741
  inputSchema: textEditor_20250429InputSchema
@@ -2757,6 +2811,17 @@ var anthropicTools = {
2757
2811
  * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
2758
2812
  */
2759
2813
  computer_20250124,
2814
+ /**
2815
+ * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
2816
+ * Claude can create, read, update, and delete files that persist between sessions,
2817
+ * allowing it to build knowledge over time without keeping everything in the context window.
2818
+ * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.
2819
+ *
2820
+ * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.
2821
+ *
2822
+ * Tool name must be `memory`.
2823
+ */
2824
+ memory_20250818,
2760
2825
  /**
2761
2826
  * Claude can use an Anthropic-defined text editor tool to view and modify text files,
2762
2827
  * helping you debug, fix, and improve your code or other text documents. This allows Claude