generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 396
Open
Labels
RFCRequest for Comment on a new featureRequest for Comment on a new featureenhancementNew feature or requestNew feature or requestrustPull requests that update Rust codePull requests that update Rust code
Description
Overview
This issue tracks the implementation of the batch file operations feature as proposed in RFC PR #1772.
Feature Description
Enhance the fs_read and fs_write tools to support batch operations on multiple files in a single call, with the ability to perform multiple edits per file, maintain line number integrity through proper edit ordering, and perform search/replace operations across files in a folder using wildcard patterns with sed-like syntax.
Implementation Phases
The implementation will be broken down into three distinct phases:
Phase 1: fs_read Batch Operations
- Add the
pathsparameter to fs_read - Implement batch processing logic for multiple files
- Update the response format to include content_hash and last_modified timestamp
- Add comprehensive error handling for batch operations
- Add tests for the new functionality
Phase 2: Pattern Replacement for fs_write
- Add the
pattern_replacecommand to fs_write - Integrate the sd crate for sed-like functionality
- Implement file pattern matching with glob/globset
- Add support for recursive directory traversal
- Add tests for pattern replacement functionality
Phase 3: Multi-File Operations for fs_write
- Add the
fileEditsparameter to fs_write - Implement edit ordering logic for maintaining line number integrity
- Add the
replace_linescommand with content hash verification for safety - Update the response format to handle multiple file results with detailed error reporting
- Add tests for multi-file operations and multiple edits per file
Dependencies
- Approval of RFC PR Batch File Operations for fs_read and fs_write #1772
- Addition of the sd crate as a dependency
- Addition of glob/globset for file pattern matching
Acceptance Criteria
- All phases implemented and tested
- Documentation updated to reflect new functionality
- Examples provided for common use cases
- Performance impact assessed and optimized
🤖 Assisted by Amazon Q Developer
Metadata
Metadata
Assignees
Labels
RFCRequest for Comment on a new featureRequest for Comment on a new featureenhancementNew feature or requestNew feature or requestrustPull requests that update Rust codePull requests that update Rust code