@ai-sdk/anthropic 2.0.0-beta.3 → 2.0.0-beta.5

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
@@ -188,6 +188,13 @@ function prepareTools({
188
188
  type: "text_editor_20241022"
189
189
  });
190
190
  break;
191
+ case "anthropic.text_editor_20250429":
192
+ betas.add("computer-use-2025-01-24");
193
+ anthropicTools2.push({
194
+ name: "str_replace_based_edit_tool",
195
+ type: "text_editor_20250429"
196
+ });
197
+ break;
191
198
  case "anthropic.bash_20250124":
192
199
  betas.add("computer-use-2025-01-24");
193
200
  anthropicTools2.push({
@@ -934,11 +941,7 @@ var AnthropicMessagesLanguageModel = class {
934
941
  tool_choice: anthropicToolChoice
935
942
  },
936
943
  warnings: [...warnings, ...toolWarnings],
937
- betas: /* @__PURE__ */ new Set([
938
- "fine-grained-tool-streaming-2025-05-14",
939
- ...messagesBetas,
940
- ...toolsBetas
941
- ]),
944
+ betas: /* @__PURE__ */ new Set([...messagesBetas, ...toolsBetas]),
942
945
  usesJsonResponseTool: jsonResponseTool != null
943
946
  };
944
947
  }
@@ -1775,6 +1778,23 @@ var textEditor_20250124 = createProviderDefinedToolFactory6({
1775
1778
  })
1776
1779
  });
1777
1780
 
1781
+ // src/tool/text-editor_20250429.ts
1782
+ import { createProviderDefinedToolFactory as createProviderDefinedToolFactory7 } from "@ai-sdk/provider-utils";
1783
+ import { z as z11 } from "zod/v4";
1784
+ var textEditor_20250429 = createProviderDefinedToolFactory7({
1785
+ id: "anthropic.text_editor_20250429",
1786
+ name: "str_replace_based_edit_tool",
1787
+ inputSchema: z11.object({
1788
+ command: z11.enum(["view", "create", "str_replace", "insert"]),
1789
+ path: z11.string(),
1790
+ file_text: z11.string().optional(),
1791
+ insert_line: z11.number().int().optional(),
1792
+ new_str: z11.string().optional(),
1793
+ old_str: z11.string().optional(),
1794
+ view_range: z11.array(z11.number().int()).optional()
1795
+ })
1796
+ });
1797
+
1778
1798
  // src/anthropic-tools.ts
1779
1799
  var anthropicTools = {
1780
1800
  /**
@@ -1801,6 +1821,11 @@ var anthropicTools = {
1801
1821
  * Creates a tool for editing text. Must have name "str_replace_editor".
1802
1822
  */
1803
1823
  textEditor_20250124,
1824
+ /**
1825
+ * Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
1826
+ * Note: This version does not support the "undo_edit" command.
1827
+ */
1828
+ textEditor_20250429,
1804
1829
  /**
1805
1830
  * Creates a tool for executing actions on a computer. Must have name "computer".
1806
1831
  *