MCPcopy Create free account
hub / github.com/Waishnav/devspace / getToolDisplay

Function getToolDisplay

src/ui/workspace-app.tsx:493–529  ·  view source on GitHub ↗
(card: ToolResultCard)

Source from the content-addressed store, hash-verified

491}
492
493function 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
531function getToolLabel(card: ToolResultCard): string {
532 if (isShellTool(card.tool)) {

Callers 1

renderFunction · 0.85

Calls 10

getToolLabelFunction · 0.85
folderIconFunction · 0.85
fileIconFunction · 0.85
filePlusIconFunction · 0.85
editIconFunction · 0.85
searchIconFunction · 0.85
filesIconFunction · 0.85
listIconFunction · 0.85
terminalIconFunction · 0.85
reviewIconFunction · 0.85

Tested by

no test coverage detected