/** * AgentRegistry — Discovery, health monitoring, and file-based persistence * for multi-Claude agent instances. * * Each agent registers with an ID, role, PID, and port. * The registry persists to .memoire/agents/ and evicts stale agents * after 30s without a heartbeat. */ import { EventEmitter } from "events"; import type { AgentRegistryEntry, AgentRole } from "../plugin/shared/contracts.js"; export declare class AgentRegistry extends EventEmitter { private agents; private agentsDir; private healthTimer; private evicting; constructor(memoireDir: string); /** Load all persisted agent entries from disk. */ load(): Promise; /** Start the health check timer. */ startHealthCheck(): void; /** Stop the health check timer. */ stopHealthCheck(): void; /** Register a new agent. */ register(entry: AgentRegistryEntry): Promise; /** Deregister an agent by ID. */ deregister(agentId: string): Promise; /** Update an agent's heartbeat timestamp. */ heartbeat(agentId: string): boolean; /** Mark an agent as busy (executing a task). */ markBusy(agentId: string): void; /** Mark an agent as online (idle, ready for tasks). */ markOnline(agentId: string): void; /** Get an available agent for a given role. */ getAvailableAgent(role: AgentRole): AgentRegistryEntry | null; /** Get all registered agents. */ getAll(): AgentRegistryEntry[]; /** Get a specific agent by ID. */ get(agentId: string): AgentRegistryEntry | null; /** Get agents matching a role. */ getByRole(role: AgentRole): AgentRegistryEntry[]; /** Get count of online agents. */ get onlineCount(): number; /** Evict agents with stale heartbeats. Guarded against concurrent execution. */ private evictStale; private isProcessAlive; private persistEntry; private removeFile; }