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

Function trackReceivedMessageUuid

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

Source from the content-addressed store, hash-verified

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

Callers 1

runHeadlessStreamingFunction · 0.85

Calls 3

deleteMethod · 0.80
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected