export interface DebugPacket { id: number; ts: number; phase: 'start' | 'end'; method: string; url: string; path: string; status?: number; ms?: number; txnId?: string; eventId?: string; req?: string; res?: string; error?: string; } let nextId = 0; export function recordPacket(packet: Omit) { const full: DebugPacket = { id: nextId, ...packet }; nextId += 1; // Web and mobile builds have no electron bridge, so nothing is recorded there window.electron?.debug?.send(full); }