()
| 93 | // ── Telemetry file stats ────────────────────────────────────────────────────── |
| 94 | |
| 95 | function readTelemetryFileStats() { |
| 96 | const agentRuns = readJsonl(path.join(TELEMETRY_DIR, 'agent-runs.jsonl')); |
| 97 | const hookTiming = readJsonl(path.join(TELEMETRY_DIR, 'hook-timing.jsonl')); |
| 98 | const today = todayPrefix(); |
| 99 | |
| 100 | const last_event = agentRuns.length > 0 |
| 101 | ? agentRuns[agentRuns.length - 1].timestamp |
| 102 | : null; |
| 103 | |
| 104 | const hook_fires_today = hookTiming.filter( |
| 105 | e => typeof e.timestamp === 'string' && e.timestamp.startsWith(today) |
| 106 | ).length; |
| 107 | |
| 108 | return { |
| 109 | last_event, |
| 110 | event_count: agentRuns.length, |
| 111 | hook_fires_today, |
| 112 | }; |
| 113 | } |
| 114 | |
| 115 | // ── Coordination stats ──────────────────────────────────────────────────────── |
| 116 |
no test coverage detected