feat(cli): Add proper display for deleteFile tool#4977
Conversation
🦋 Changeset detectedLatest commit: eeb6c03 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR adds proper display support for the
The implementation follows existing patterns in the codebase and includes comprehensive test coverage. Files Reviewed (9 files)
Highlights✅ Good test coverage - Tests cover single file deletion, directory deletion with stats, edge cases (empty/undefined path, zero stats), and warning indicators ✅ Follows existing patterns - Component structure matches other tool message components (ToolReadFileMessage, ToolNewFileCreatedMessage, etc.) ✅ Proper TypeScript types - Added ✅ User-friendly display - Shows relevant information in a compact format with proper pluralization ("1 file" vs "5 files") |
RSO
left a comment
There was a problem hiding this comment.
Feels like we need a space in between the icon and the text
|
@RSO this is just a bug in my own terminal emulation :) . Not a CLI issue. |
Summary
Fixes the CLI displaying "⚙ Unknown tool: deleteFile" when the
deleteFiletool is used. Now properly displays file/directory deletion with a dedicated component.Changes
New Component
ToolDeleteFileMessage.tsx- Displays delete operations with:🗑️ Delete(filename)for single files🗑️ Delete(dirname) ⎿ 5 files, 2 dirsfor directories⚠warning indicator for paths outside workspaceSupporting Changes
ToolRouter.tsx- Added case handler fordeleteFiletoolutils.ts- Added 🗑️ icon mapping fordeleteFiletypes.ts- AddedDeleteFileStatsinterface andstatsproperty toToolDataindex.ts- Export new componentTests
getToolIcon("deleteFile")Before
After
or for directories: