* Get all tool use IDs from a single message (handles grouped tool uses).
(msg: RenderableMessage)
| 479 | * Get all tool use IDs from a single message (handles grouped tool uses). |
| 480 | */ |
| 481 | function getToolUseIdsFromMessage(msg: RenderableMessage): string[] { |
| 482 | if (msg.type === 'assistant') { |
| 483 | const content = msg.message.content[0] |
| 484 | if (content?.type === 'tool_use') { |
| 485 | return [content.id] |
| 486 | } |
| 487 | } |
| 488 | if (msg.type === 'grouped_tool_use') { |
| 489 | return msg.messages |
| 490 | .map(m => { |
| 491 | const content = m.message.content[0] |
| 492 | return content.type === 'tool_use' ? content.id : '' |
| 493 | }) |
| 494 | .filter(Boolean) |
| 495 | } |
| 496 | return [] |
| 497 | } |
| 498 | |
| 499 | /** |
| 500 | * Get all tool use IDs from a collapsed read/search group. |
no outgoing calls
no test coverage detected