/** * Leaper Agent – Process Registry * Track running background processes, manage lifecycle, cleanup on exit. */ import type { ToolDefinition } from './registry.js'; export type ProcessStatus = 'running' | 'finished' | 'failed' | 'killed'; export interface ProcessSession { pid: number; id: string; cmd: string; args: string[]; cwd: string; status: ProcessStatus; exit_code?: number; started_at: string; finished_at?: string; stdout_buf: string; stderr_buf: string; tags: string[]; } export interface SpawnOptions { cmd: string; args?: string[]; cwd?: string; env?: Record; tags?: string[]; stdin_data?: string; } export interface ProcessRegistryState { sessions: Record; } export declare class ProcessRegistry { private sessions; private children; private newId; private appendBuf; spawn(opts: SpawnOptions): ProcessSession; poll(id: string): ProcessSession | null; log(id: string, stream?: 'stdout' | 'stderr' | 'both', tail?: number): string; kill(id: string, signal?: NodeJS.Signals): boolean; writeStdin(id: string, data: string): boolean; listAll(): ProcessSession[]; listRunning(): ProcessSession[]; remove(id: string): boolean; saveCheckpoint(): void; loadCheckpoint(): void; cleanupAll(): void; } export declare const globalRegistry: ProcessRegistry; export declare const processRegistryTool: ToolDefinition; //# sourceMappingURL=process-registry.d.ts.map