langchain.js
    Preparing search index...

    Interface TextEditor20250728Options

    Options for the text editor tool (Claude 4.x version).

    interface TextEditor20250728Options {
        execute?: (
            args:
                | { command: "view"; path: string; view_range?: [number, number] }
                | {
                    command: "str_replace";
                    new_str: string;
                    old_str: string;
                    path: string;
                }
                | { command: "create"; file_text: string; path: string }
                | {
                    command: "insert";
                    insert_line: number;
                    new_str: string;
                    path: string;
                },
        ) => string
        | Promise<string>;
        maxCharacters?: number;
    }
    Index

    Properties

    execute?: (
        args:
            | { command: "view"; path: string; view_range?: [number, number] }
            | {
                command: "str_replace";
                new_str: string;
                old_str: string;
                path: string;
            }
            | { command: "create"; file_text: string; path: string }
            | {
                command: "insert";
                insert_line: number;
                new_str: string;
                path: string;
            },
    ) => string
    | Promise<string>

    Optional execute function that handles text editor command execution. This function receives the command input and should return the result.

    maxCharacters?: number

    Optional maximum characters to return when viewing files. If the file content exceeds this limit, it will be truncated.