effect-io-ai

Package: @effect/ai-anthropic
Module: AnthropicTool

AnthropicTool.TextEditor_20250728

Defines the text editor tool for Claude 4 models.

Details

Uses Anthropic’s str_replace_based_edit_tool. max_characters can limit file-view output for this version.

Gotchas

This version does not support the undo_edit command.

Signature

declare const TextEditor_20250728: <Mode extends Tool.FailureMode | undefined = undefined>(args: { readonly max_characters?: number | undefined; readonly failureMode?: Mode | undefined; }) => Tool.ProviderDefined<"anthropic.text_editor_20250728", "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>

Source

Since v4.0.0