(card: ToolResultCard)
| 529 | } |
| 530 | |
| 531 | function getToolLabel(card: ToolResultCard): string { |
| 532 | if (isShellTool(card.tool)) { |
| 533 | return String(card.summary?.command ?? card.summary?.sessionId ?? card.path ?? card.tool); |
| 534 | } |
| 535 | if (isReviewTool(card.tool)) { |
| 536 | const count = Number(card.summary?.files ?? card.files?.length ?? 0); |
| 537 | return count === 0 ? "No changes since last review" : `${count} changed ${count === 1 ? "file" : "files"}`; |
| 538 | } |
| 539 | if (card.path) return card.path; |
| 540 | if (card.root) return card.root; |
| 541 | if (isSearchTool(card.tool)) { |
| 542 | return String(card.summary?.pattern ?? card.tool); |
| 543 | } |
| 544 | |
| 545 | return card.tool; |
| 546 | } |
| 547 | |
| 548 | function toolNameFromMeta(result: CallToolResult): ToolName | undefined { |
| 549 | const meta = result._meta as Record<string, unknown> | undefined; |
no test coverage detected