* 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, behavior?: CollapseBehavior, )
| 370 | * This includes tool uses like Edit, Write, etc. |
| 371 | */ |
| 372 | function isNonCollapsibleToolUse( |
| 373 | msg: RenderableMessage, |
| 374 | tools: Tools, |
| 375 | behavior?: CollapseBehavior, |
| 376 | ): boolean { |
| 377 | if (msg.type === 'assistant') { |
| 378 | const content = msg.message.content[0] |
| 379 | if ( |
| 380 | content?.type === 'tool_use' && |
| 381 | !isToolSearchOrRead(content.name, content.input, tools, behavior) |
| 382 | ) { |
| 383 | return true |
| 384 | } |
| 385 | } |
| 386 | if (msg.type === 'grouped_tool_use') { |
| 387 | const firstContent = msg.messages[0]?.message.content[0] |
| 388 | if ( |
| 389 | firstContent?.type === 'tool_use' && |
| 390 | !isToolSearchOrRead(msg.toolName, firstContent.input, tools, behavior) |
| 391 | ) { |
| 392 | return true |
| 393 | } |
| 394 | } |
| 395 | return false |
| 396 | } |
| 397 | |
| 398 | function isPreToolHookSummary( |
| 399 | msg: RenderableMessage, |
no test coverage detected