MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / latestTranscriptTimestamp

Function latestTranscriptTimestamp

tools/claw-launcher-ui/server.mjs:502–514  ·  view source on GitHub ↗
(transcript, fallback = Date.now())

Source from the content-addressed store, hash-verified

500}
501
502function latestTranscriptTimestamp(transcript, fallback = Date.now()) {
503 const timestamps = Array.isArray(transcript)
504 ? transcript
505 .map(entry => Date.parse(entry?.timestamp || ''))
506 .filter(value => Number.isFinite(value))
507 : []
508
509 if (timestamps.length === 0) {
510 return fallback
511 }
512
513 return Math.max(...timestamps)
514}
515
516function restampTranscriptEntries(entries, startAt) {
517 let cursor = Math.max(Number.isFinite(startAt) ? startAt : Date.now(), Date.now())

Callers 1

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected