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