export type ProcessState = 'creating' | 'running' | 'stopping' | 'orphaned' | 'terminated' | 'unknown'; export interface HealthStatus { cpu: number; memoryMB: number; status: string; } export interface ProcessRecord { agentId: string; sessionId: string; pid: number; mode: 'sdk'; state: ProcessState; workspacePath: string; command: string; createdAt: string; lastHeartbeat?: string; healthStatus?: HealthStatus; orphanedAt?: string; metadata?: Record; } export interface PersistedSessionInput { agentId: string; sessionId: string; pid?: number; workspacePath?: string; command?: string; mode?: 'sdk'; } export declare function getProcessRegistryFile(): string; export declare class ProcessRegistry { private static instance; private readonly records; private readonly pidToAgentId; private constructor(); static getInstance(): ProcessRegistry; private persist; private mutate; register(record: Omit): Promise; update(agentId: string, updates: Partial): Promise; get(agentId: string): ProcessRecord | undefined; getByPid(pid: number): ProcessRecord | undefined; getAll(): ProcessRecord[]; getByState(state: ProcessState): ProcessRecord[]; isManaged(agentId: string): boolean; isManagedByPid(pid: number): boolean; markOrphaned(agentId: string): Promise; markTerminated(agentId: string): Promise; remove(agentId: string): Promise; updateHeartbeat(agentId: string): Promise; updateHealth(agentId: string, health: HealthStatus): Promise; rebuildFromPersisted(sessions: PersistedSessionInput[]): Promise; exportState(): ProcessRecord[]; getStats(): Record; clear(): Promise; } export declare function getProcessRegistry(): ProcessRegistry; export declare function loadPersistedProcessRegistry(): Promise; export declare function savePersistedProcessRegistry(records: ProcessRecord[]): Promise;