MCPcopy Create free account
hub / github.com/SethGammon/Citadel / readRecentActivity

Function readRecentActivity

scripts/dashboard.js:515–534  ·  view source on GitHub ↗
(projectRoot, limit, now)

Source from the content-addressed store, hash-verified

513 return entry.hook || entry.event || entry.type || entry.metric || 'event';
514}
515
516function readRecentActivity(projectRoot, limit, now) {
517 const telemetryDir = path.join(projectRoot, '.planning', 'telemetry');
518 const entries = [
519 ...tailJsonl(path.join(telemetryDir, 'hook-timing.jsonl'), 50),
520 ...tailJsonl(path.join(telemetryDir, 'audit.jsonl'), 50),
521 ...tailJsonl(path.join(telemetryDir, 'agent-runs.jsonl'), 50),
522 ...tailJsonl(path.join(telemetryDir, 'task-events.jsonl'), 50),
523 ];
524
525 return entries
526 .map((entry) => ({
527 timestamp: eventTimestamp(entry),
528 relative: relativeTime(eventTimestamp(entry), now),
529 name: eventName(entry),
530 description: describeTelemetry(entry),
531 raw: entry,
532 }))
533 .sort((left, right) => new Date(right.timestamp || 0).getTime() - new Date(left.timestamp || 0).getTime())
534 .slice(0, limit);
535}
536
537function readHookActivity(projectRoot, limit, now) {

Callers 1

collectDashboardFunction · 0.85

Calls 5

tailJsonlFunction · 0.85
eventTimestampFunction · 0.85
relativeTimeFunction · 0.85
eventNameFunction · 0.85
describeTelemetryFunction · 0.85

Tested by

no test coverage detected