/** * Live-agent registry — which sessions are running RIGHT NOW, and where. * * Session JSONL on disk can't distinguish a live session from a dead one; * this registry can: one small JSON per session under ~/.blockrun/agents/, * refreshed on every state change, with pid-based reconciliation (the same * liveness model as the task subsystem). The panel's Agents tab reads it * to render the fleet; serve's AgentHost and the CLI loop both write it. */ import type { AgentRunState } from '../events/types.js'; export interface LiveAgentRecord { sessionId: string; pid: number; state: AgentRunState; label: string; model: string; /** Which process type hosts the loop — panel can only drive 'serve' agents. */ host: 'serve' | 'cli'; startedAt: number; updatedAt: number; /** Count of approvals parked waiting for a human. */ pendingApprovals?: number; } export declare function liveAgentsDir(): string; export declare function writeLiveAgent(record: LiveAgentRecord): void; export declare function removeLiveAgent(sessionId: string): void; /** * All records, with dead-pid reconciliation: a record whose process is gone * flips to 'failed' if it claimed to be running (crash without cleanup), and * terminal records older than a day are pruned. */ export declare function readLiveAgents(): LiveAgentRecord[];