Package: @effect/ai-anthropic
Module: AnthropicTool
Defines the text editor tool for Claude 4 models using Anthropic’s str_replace_based_edit_tool.
When to use
Use when you need the 2025-04-29 Claude 4 str_replace_based_edit_tool
version.
Details
Requires the “computer-use-2025-01-24” beta header.
Gotchas
This version does not support the undo_edit command.
See
TextEditor_20250124 for the previous str_replace_editor versionTextEditor_20250728 for the later Claude 4 text editor versionSignature
declare const TextEditor_20250429: <Mode extends Tool.FailureMode | undefined = undefined>(args: { readonly max_characters?: number | undefined; readonly failureMode?: Mode | undefined; }) => Tool.ProviderDefined<"anthropic.text_editor_20250429", "AnthropicTextEditor", { readonly args: Schema.Struct<{ readonly max_characters: Schema.optional<Schema.Int>; }>; readonly parameters: Schema.Union<readonly [Schema.Struct<{ readonly command: Schema.Literal<"view">; readonly path: Schema.String; readonly view_range: Schema.optionalKey<Schema.Tuple<readonly [Schema.Int, Schema.Int]>>; }>, Schema.Struct<{ readonly command: Schema.Literal<"create">; readonly path: Schema.String; readonly file_text: Schema.String; }>, Schema.Struct<{ readonly command: Schema.Literal<"str_replace">; readonly path: Schema.String; readonly old_str: Schema.String; readonly new_str: Schema.String; }>, Schema.Struct<{ readonly command: Schema.Literal<"insert">; readonly path: Schema.String; readonly insert_line: Schema.Int; readonly new_str: Schema.String; }>]>; readonly success: Schema.String; readonly failure: Schema.Never; readonly failureMode: Mode extends undefined ? "error" : Mode; }, true>
Since v4.0.0