(card: ToolResultCard)
| 491 | } |
| 492 | |
| 493 | function getToolDisplay(card: ToolResultCard): ToolDisplay { |
| 494 | const label = getToolLabel(card); |
| 495 | |
| 496 | switch (card.tool) { |
| 497 | case "open_workspace": |
| 498 | return { icon: folderIcon(), title: "Workspace", label, tone: "workspace" }; |
| 499 | case "read_file": |
| 500 | case "read": |
| 501 | return { icon: fileIcon(), title: "Read File", label, tone: "read" }; |
| 502 | case "write_file": |
| 503 | case "write": |
| 504 | return { icon: filePlusIcon(), title: "Write File", label, tone: "write" }; |
| 505 | case "edit_file": |
| 506 | case "edit": |
| 507 | return { icon: editIcon(), title: "Edit File", label, tone: "edit" }; |
| 508 | case "apply_patch": |
| 509 | return { icon: editIcon(), title: "Apply Patch", label, tone: "edit" }; |
| 510 | case "grep_files": |
| 511 | case "grep": |
| 512 | return { icon: searchIcon(), title: "Grep", label, tone: "search" }; |
| 513 | case "find_files": |
| 514 | case "glob": |
| 515 | return { icon: filesIcon(), title: "Glob", label, tone: "search" }; |
| 516 | case "list_directory": |
| 517 | case "ls": |
| 518 | return { icon: listIcon(), title: "List Directory", label, tone: "directory" }; |
| 519 | case "run_shell": |
| 520 | case "bash": |
| 521 | return { icon: terminalIcon(), title: "Bash", label, tone: "shell" }; |
| 522 | case "exec_command": |
| 523 | return { icon: terminalIcon(), title: "Exec Command", label, tone: "shell" }; |
| 524 | case "write_stdin": |
| 525 | return { icon: terminalIcon(), title: "Process Session", label, tone: "shell" }; |
| 526 | case "show_changes": |
| 527 | return { icon: reviewIcon(), title: "Show Changes", label, tone: "review" }; |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | function getToolLabel(card: ToolResultCard): string { |
| 532 | if (isShellTool(card.tool)) { |
no test coverage detected