Open
Description
Implement batch command for textEditor tool
Description
Currently, the textEditor tool only allows one edit command at a time (view, create, str_replace, insert, undo_edit). This leads to inefficient token usage when multiple small edits need to be made.
This issue proposes implementing a new batch
command that would allow multiple edit operations to be executed in sequence with a single tool invocation.
Implementation Details
- Add a new command
batch
to the enum of allowed commands - Define a new parameter
operations
that accepts an array of operations to execute - Each operation in the array would have the same structure as a single command (without the description field)
- Execute each operation in sequence, collecting results
- Return a combined result with success status and details of each operation
Changes Required
- Update the parameter schema in
textEditor.ts
to include the new command and parameter - Implement the batch command logic in the
execute
function - Add tests for the batch command functionality
- Update documentation
Benefits
- Improved token efficiency for multiple edit operations
- Reduced number of tool invocations needed for common tasks
- Better user experience for AI agents performing complex edits
Related to #387
Metadata
Metadata
Assignees
Labels
No labels