diff --git a/src/cli/components/ApprovalDialogRich.tsx b/src/cli/components/ApprovalDialogRich.tsx index 11a4e17..f23fcc1 100644 --- a/src/cli/components/ApprovalDialogRich.tsx +++ b/src/cli/components/ApprovalDialogRich.tsx @@ -71,7 +71,13 @@ const DynamicPreview: React.FC = ({ }) => { const t = toolName.toLowerCase(); - if (t === "bash" || t === "shell_command" || t === "run_shell_command") { + if ( + t === "bash" || + t === "shell_command" || + t === "shellcommand" || + t === "run_shell_command" || + t === "runshellcommand" + ) { const cmdVal = parsedArgs?.command; const cmd = typeof cmdVal === "string" ? cmdVal : toolArgs || "(no arguments)"; @@ -105,7 +111,13 @@ const DynamicPreview: React.FC = ({ ); } - if (t === "ls" || t === "list_dir" || t === "list_directory") { + if ( + t === "ls" || + t === "list_dir" || + t === "listdir" || + t === "list_directory" || + t === "listdirectory" + ) { const pathVal = parsedArgs?.path || parsedArgs?.target_directory || parsedArgs?.dir_path; const path = typeof pathVal === "string" ? pathVal : "(current directory)"; @@ -123,7 +135,7 @@ const DynamicPreview: React.FC = ({ ); } - if (t === "read" || t === "read_file") { + if (t === "read" || t === "read_file" || t === "readfile") { const pathVal = parsedArgs?.file_path || parsedArgs?.target_file; const path = typeof pathVal === "string" ? pathVal : "(no file specified)"; const offsetVal = parsedArgs?.offset; @@ -143,7 +155,13 @@ const DynamicPreview: React.FC = ({ ); } - if (t === "grep" || t === "grep_files" || t === "search_file_content") { + if ( + t === "grep" || + t === "grep_files" || + t === "grepfiles" || + t === "search_file_content" || + t === "searchfilecontent" + ) { const patternVal = parsedArgs?.pattern; const pattern = typeof patternVal === "string" ? patternVal : "(no pattern)"; @@ -164,7 +182,7 @@ const DynamicPreview: React.FC = ({ ); } - if (t === "apply_patch") { + if (t === "apply_patch" || t === "applypatch") { const inputVal = parsedArgs?.input; const patchPreview = typeof inputVal === "string" && inputVal.length > 100 @@ -181,7 +199,7 @@ const DynamicPreview: React.FC = ({ ); } - if (t === "update_plan") { + if (t === "update_plan" || t === "updateplan") { const planVal = parsedArgs?.plan; const explanationVal = parsedArgs?.explanation; @@ -240,7 +258,8 @@ const DynamicPreview: React.FC = ({ t === "edit" || t === "multiedit" || t === "replace" || - t === "write_file") && + t === "write_file" || + t === "writefile") && parsedArgs ) { try { @@ -250,7 +269,7 @@ const DynamicPreview: React.FC = ({ if (precomputedDiff) { return ( - {t === "write" || t === "write_file" ? ( + {t === "write" || t === "write_file" || t === "writefile" ? ( = ({ } // Fallback to non-precomputed rendering - if (t === "write" || t === "write_file") { + if (t === "write" || t === "write_file" || t === "writefile") { return ( { else if (displayName === "SearchFileContent") displayName = "Grep"; else if (displayName === "WriteTodos") displayName = "TODO"; else if (displayName === "ReadManyFiles") displayName = "Read Multiple"; + // Additional tools + else if (displayName === "Replace" || displayName === "replace") + displayName = "Edit"; + else if (displayName === "WriteFile" || displayName === "write_file") + displayName = "Write"; + else if (displayName === "KillBash") displayName = "Kill Shell"; + else if (displayName === "BashOutput") displayName = "Shell Output"; + else if (displayName === "MultiEdit") displayName = "Edit"; // Format arguments for display using the old formatting logic const formatted = formatArgsDisplay(argsText);