* Checks if an assistant message has visible text content (not just tool_use blocks). * Tool uses are displayed as grouped/collapsed UI elements, not as standalone messages.
(message: TranscriptMessage)
| 2590 | * Tool uses are displayed as grouped/collapsed UI elements, not as standalone messages. |
| 2591 | */ |
| 2592 | function hasVisibleAssistantContent(message: TranscriptMessage): boolean { |
| 2593 | if (message.type !== 'assistant') return false |
| 2594 | |
| 2595 | const content = message.message?.content |
| 2596 | if (!content || !Array.isArray(content)) return false |
| 2597 | |
| 2598 | // Check for text block (not just tool_use/thinking blocks) |
| 2599 | return content.some( |
| 2600 | block => |
| 2601 | block.type === 'text' && |
| 2602 | typeof block.text === 'string' && |
| 2603 | block.text.trim().length > 0, |
| 2604 | ) |
| 2605 | } |
| 2606 | |
| 2607 | /** |
| 2608 | * Counts visible messages that would appear as conversation turns in the UI. |
no outgoing calls
no test coverage detected