feat: add Apply Patch tool with patch input and diff view (#196)

* feat: add Apply Patch tool with patch input and diff view

Introduce Apply Patch tool with a patch input field and diff preview
Display target file path or file count for patch operations in tool UI
Update status label to show applying patch during execution

* fix: include apply_patch in editing tools detection
This commit is contained in:
Bohdan Triapitsyn
2026-01-22 19:09:07 +02:00
committed by GitHub
parent ef4d37df09
commit 87175566b9
6 changed files with 47 additions and 13 deletions
@@ -39,7 +39,7 @@ const getToolIcon = (toolName: string) => {
if (tool === 'image-preview') {
return <RiFileImageLine className={iconClass} />;
}
if (tool === 'edit' || tool === 'multiedit' || tool === 'str_replace' || tool === 'str_replace_based_edit_tool') {
if (tool === 'edit' || tool === 'multiedit' || tool === 'apply_patch' || tool === 'str_replace' || tool === 'str_replace_based_edit_tool') {
return <RiPencilAiLine className={iconClass} />;
}
if (tool === 'write' || tool === 'create' || tool === 'file_write') {
@@ -109,7 +109,8 @@ const ToolOutputDialog: React.FC<ToolOutputDialogProps> = ({ popup, onOpenChange
{popup.metadata?.input && typeof popup.metadata.input === 'object' &&
Object.keys(popup.metadata.input).length > 0 &&
popup.metadata?.tool !== 'todowrite' &&
popup.metadata?.tool !== 'todoread' ? (() => {
popup.metadata?.tool !== 'todoread' &&
popup.metadata?.tool !== 'apply_patch' ? (() => {
const meta = popup.metadata!;
const input = meta.input as Record<string, unknown>;