/** * Live deep-health probe result for an agent (from * `vibecontrolsAgentHealthProbes`). When present, this overrides the * persisted `isActive` flag because that flag only flips when the * agent explicitly deregisters — a dead cloudflared tunnel keeps * `isActive=true` and `tunnelStatus='CONNECTED'` indefinitely, which * is exactly the failure mode that lets users hit "create session" * against an unreachable agent. */ export interface AgentHealthProbe { agentId: string; healthy: boolean; errorMessage?: string | null; } export type DerivedAgentStatus = 'ACTIVE' | 'STOPPED' | 'OFFLINE' | 'DEGRADED' | 'REGISTERING'; export declare function deriveAgentStatus(agent: { id?: string; isActive: boolean; metadata?: Record | null; }, probesById?: Map, opts?: { /** * When true, the probe query has not yet returned data for this * mount cycle. Without this flag, sidenav-navigating-back to the * agents page briefly shows ACTIVE because Apollo returns * `data: undefined` during the in-flight refetch — the previous * page's DEGRADED badge regresses to green for ~1s before the * fresh probe arrives. When `probesLoading=true` we treat unknown * agents as REGISTERING (yellow) instead of optimistically green. */ probesLoading?: boolean; }): DerivedAgentStatus; /** * True when the agent is in a state where session start can succeed. * Used to gate the "Start session" / "Open terminal" buttons so users * don't hit "Failed to start terminal" against an obviously dead agent. */ export declare function isAgentReadyForSession(agent: { id?: string; isActive: boolean; metadata?: Record | null; }, probesById?: Map): boolean;