MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getToolUseIDs

Function getToolUseIDs

source code/utils/messages.ts:1463–1476  ·  view source on GitHub ↗
(
  normalizedMessages: NormalizedMessage[],
)

Source from the content-addressed store, hash-verified

1461}
1462
1463export function getToolUseIDs(
1464 normalizedMessages: NormalizedMessage[],
1465): Set<string> {
1466 return new Set(
1467 normalizedMessages
1468 .filter(
1469 (_): _ is NormalizedAssistantMessage<BetaToolUseBlock> =>
1470 _.type === 'assistant' &&
1471 Array.isArray(_.message.content) &&
1472 _.message.content[0]?.type === 'tool_use',
1473 )
1474 .map(_ => _.message.content[0].id),
1475 )
1476}
1477
1478/**
1479 * Reorders messages so that attachments bubble up until they hit either:

Callers 1

MessagesImplFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected