/** * src/agent/heartbeat.ts * * Pillar A — Heartbeat + session resume. * * Exports `startHeartbeat(intervalMs)` which returns a session ID and a * JSONL writer that appends heartbeat records to * `.harness/traces/heartbeat.jsonl`. Each record carries: * session_id, started_at, last_heartbeat_at, status * * Status transitions: running → idle → done | failed */ export type SessionStatus = "running" | "idle" | "failed" | "done"; export interface HeartbeatRecord { session_id: string; started_at: string; last_heartbeat_at: string; status: SessionStatus; } /** Returns the path to the heartbeat log, resolved from repo root. */ export declare function heartbeatPath(repoRoot: string): string; /** * Start a heartbeat ticker. * * @param intervalMs — milliseconds between heartbeat writes (default 30_000) * @param repoRoot — repository root (default process.cwd()) * @returns {{ sessionId: string, stop: () => void }} */ export declare function startHeartbeat(intervalMs?: number, repoRoot?: string): { sessionId: string; stop: () => void; }; /** * Mark a session as failed in the heartbeat log. * Reads the original started_at from the JSONL file if available. */ export declare function failHeartbeat(sessionId: string, repoRoot?: string): void; /** * Mark a session as done. * Reads the original started_at from the JSONL file if available. */ export declare function stopHeartbeat(sessionId: string, repoRoot?: string): void; //# sourceMappingURL=heartbeat.d.ts.map