MCPcopy Create free account
hub / github.com/Noumena-Network/code / isNonCollapsibleToolUse

Function isNonCollapsibleToolUse

src/utils/collapseReadSearch.ts:372–396  ·  view source on GitHub ↗

* 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,
)

Source from the content-addressed store, hash-verified

370 * This includes tool uses like Edit, Write, etc.
371 */
372function 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
398function isPreToolHookSummary(
399 msg: RenderableMessage,

Callers 1

collapseReadSearchGroupsFunction · 0.85

Calls 1

isToolSearchOrReadFunction · 0.85

Tested by

no test coverage detected