MCPcopy Create free account
hub / github.com/codeaashu/claude-code / trackReceivedMessageUuid

Function trackReceivedMessageUuid

src/cli/print.ts:398–415  ·  view source on GitHub ↗
(uuid: UUID)

Source from the content-addressed store, hash-verified

396const receivedMessageUuidsOrder: UUID[] = []
397
398function trackReceivedMessageUuid(uuid: UUID): boolean {
399 if (receivedMessageUuids.has(uuid)) {
400 return false // duplicate
401 }
402 receivedMessageUuids.add(uuid)
403 receivedMessageUuidsOrder.push(uuid)
404 // Evict oldest entries when at capacity
405 if (receivedMessageUuidsOrder.length > MAX_RECEIVED_UUIDS) {
406 const toEvict = receivedMessageUuidsOrder.splice(
407 0,
408 receivedMessageUuidsOrder.length - MAX_RECEIVED_UUIDS,
409 )
410 for (const old of toEvict) {
411 receivedMessageUuids.delete(old)
412 }
413 }
414 return true // new UUID
415}
416
417type PromptValue = string | ContentBlockParam[]
418

Callers 1

runHeadlessStreamingFunction · 0.85

Calls 5

spliceMethod · 0.80
deleteMethod · 0.65
hasMethod · 0.45
addMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected