declare const com: any; /** * Connection-reliability event counts since the last call, from the shared * Kotlin session core (ConnectionCounters.kt), which keeps them process-wide. */ export function drainConnectionCounters(): Record { const counts: Record = {}; const parsed = JSON.parse(String(com.faceclaw.app.ConnectionCounters.drain())) as Record; for (const [name, count] of Object.entries(parsed)) { if (typeof count === "number" && count > 0) counts[name] = count; } return counts; }