import type { OutputAccumulator } from "./tools/output-accumulator.js"; export type BashJobStatus = "running" | "exited" | "killed"; export interface BashJob { /** Short unique id returned to the agent. */ id: string; /** Process id of the detached shell (undefined if spawn failed). */ pid: number | undefined; command: string; cwd: string; status: BashJobStatus; exitCode: number | null; startedAt: number; endedAt: number | undefined; /** Temp file that always receives the full (unsanitized) output. */ fullOutputPath: string; /** Bounded accumulator used to render status tails. */ output: OutputAccumulator; /** Kills the process tree backing this job. */ kill: () => void; } /** * Session-scoped registry of background bash jobs. * * The registry is intentionally not a module-level singleton: a single CLI * process can host many agent sessions (server/agent-bridge), so each session * creates and owns its own registry. `bash`, `bash_status`, and `bash_kill` * must share the same instance in order to refer to the same jobs. */ export declare class BashJobRegistry { private readonly jobs; create(input: { id?: string; pid?: number; command: string; cwd: string; output: OutputAccumulator; fullOutputPath: string; kill: () => void; }): BashJob; get(id: string): BashJob | undefined; markExited(id: string, exitCode: number | null): void; markKilled(id: string): void; /** Kill a job by id. Returns false when the job does not exist. */ kill(id: string): boolean; /** Kill every tracked job. Used on session shutdown. */ killAll(): void; } //# sourceMappingURL=bash-jobs.d.ts.map