Commit 2003e17
committed
feat(filesystem): add copy_file tool for efficient file/directory copying
Implements a new copy_file tool that addresses issue #1581 by providing an efficient way to copy files and directories without requiring read/write operations for large files.
## Changes:
- Add copy_file tool with support for both files and directories
- Use fs.copyFile for files (optimized for large files)
- Use fs.cp with recursive option for directories
- Include proper validation and error handling
- Update README documentation
## Implementation Details:
- Validates both source and destination paths are within allowed directories
- Checks if destination exists and fails appropriately
- Follows existing tool patterns for consistency
- Maintains security checks and path validation
Fixes #15811 parent 531c1fe commit 2003e17
2 files changed
+55
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
146 | 151 | | |
147 | 152 | | |
148 | 153 | | |
| |||
479 | 484 | | |
480 | 485 | | |
481 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
482 | 494 | | |
483 | 495 | | |
484 | 496 | | |
| |||
818 | 830 | | |
819 | 831 | | |
820 | 832 | | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
821 | 868 | | |
822 | 869 | | |
823 | 870 | | |
| |||
0 commit comments