import { EventEmitter } from 'node:events'; import { type ShellHandle, type ShellResult, type StartShellOptions } from './streamer.js'; export type ShellJobStatus = 'running' | 'completed' | 'failed' | 'killed'; export interface ShellJob { readonly id: string; readonly command: string; readonly pid: number | undefined; readonly startedAt: number; readonly mode: 'foreground' | 'background'; status: ShellJobStatus; result?: ShellResult; } export interface ShellJobRegistryEvents { complete: [job: ShellJob]; } export type StartJobOptions = Omit & { onChunk?: StartShellOptions['onChunk']; mode: 'foreground' | 'background'; }; export declare class ShellJobRegistry extends EventEmitter { private readonly jobs; private readonly handles; private readonly aborts; private counter; start(opts: StartJobOptions): { job: ShellJob; handle: ShellHandle; }; get(id: string): ShellJob | undefined; list(): readonly ShellJob[]; running(): readonly ShellJob[]; kill(id: string): boolean; killAll(): readonly ShellJob[]; runningCount(): number; private pruneHistory; }