* Check if a message is a non-collapsible tool use that should break a group. * This includes tool uses like Edit, Write, etc.
( msg: RenderableMessage, tools: Tools, )
| 343 | * This includes tool uses like Edit, Write, etc. |
| 344 | */ |
| 345 | function isNonCollapsibleToolUse( |
| 346 | msg: RenderableMessage, |
| 347 | tools: Tools, |
| 348 | ): boolean { |
| 349 | if (msg.type === 'assistant') { |
| 350 | const content = msg.message.content[0] |
| 351 | if ( |
| 352 | content?.type === 'tool_use' && |
| 353 | !isToolSearchOrRead(content.name, content.input, tools) |
| 354 | ) { |
| 355 | return true |
| 356 | } |
| 357 | } |
| 358 | if (msg.type === 'grouped_tool_use') { |
| 359 | const firstContent = msg.messages[0]?.message.content[0] |
| 360 | if ( |
| 361 | firstContent?.type === 'tool_use' && |
| 362 | !isToolSearchOrRead(msg.toolName, firstContent.input, tools) |
| 363 | ) { |
| 364 | return true |
| 365 | } |
| 366 | } |
| 367 | return false |
| 368 | } |
| 369 | |
| 370 | function isPreToolHookSummary( |
| 371 | msg: RenderableMessage, |
no test coverage detected