* 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)
| 2428 | * Tool uses are displayed as grouped/collapsed UI elements, not as standalone messages. |
| 2429 | */ |
| 2430 | function hasVisibleAssistantContent(message: TranscriptMessage): boolean { |
| 2431 | if (message.type !== 'assistant') return false |
| 2432 | |
| 2433 | const content = message.message?.content |
| 2434 | if (!content || !Array.isArray(content)) return false |
| 2435 | |
| 2436 | // Check for text block (not just tool_use/thinking blocks) |
| 2437 | return content.some( |
| 2438 | block => |
| 2439 | block.type === 'text' && |
| 2440 | typeof block.text === 'string' && |
| 2441 | block.text.trim().length > 0, |
| 2442 | ) |
| 2443 | } |
| 2444 | |
| 2445 | /** |
| 2446 | * Counts visible messages that would appear as conversation turns in the UI. |
no outgoing calls
no test coverage detected