(msg: RenderableMessage, streamingToolUseIDs: Set<string>)
| 297 | return c.type === "text"; |
| 298 | } |
| 299 | export function isMessageStreaming(msg: RenderableMessage, streamingToolUseIDs: Set<string>): boolean { |
| 300 | if (msg.type === 'grouped_tool_use') { |
| 301 | return msg.messages.some(m => { |
| 302 | const content = (m.message.content as ContentBlockLike[])[0]; |
| 303 | return content?.type === 'tool_use' && streamingToolUseIDs.has(content.id!); |
| 304 | }); |
| 305 | } |
| 306 | if (msg.type === 'collapsed_read_search') { |
| 307 | const toolIds = getToolUseIdsFromCollapsedGroup(msg); |
| 308 | return toolIds.some(id => streamingToolUseIDs.has(id)); |
| 309 | } |
| 310 | const toolUseID = getToolUseID(msg); |
| 311 | return !!toolUseID && streamingToolUseIDs.has(toolUseID); |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * Checks if all tools in a message are resolved. |
no test coverage detected