import type { FabricShellJobHandle, FabricShellJobStore } from "./shell-jobs.js"; type ProgramJob = FabricShellJobHandle & { stop(reason?: string): boolean; }; export interface FabricProgramRunOptions { code: string; description?: string; cwd?: string; /** Pi's tool signal. It cancels the program only while the program is in the foreground. */ parentSignal?: AbortSignal; jobs: () => FabricShellJobStore | undefined; } export type FabricProgramRace = { detached: false; value: T; } | { detached: true; job: ProgramJob; elapsedMs: number; }; /** * One `fabric_exec` program that can leave its tool call and keep running as a * session task. The program always runs on this run's own signal; Pi's tool * signal reaches it only until it is detached. */ export declare class FabricProgramRun { #private; readonly owner: FabricProgramTasks; readonly options: FabricProgramRunOptions; constructor(owner: FabricProgramTasks, options: FabricProgramRunOptions); get signal(): AbortSignal; get job(): ProgramJob | undefined; get waiting(): boolean; /** Moves the program into the session task store; false when it cannot leave. */ detach(): boolean; /** Mirrors changed progress into the task's output once detached. */ progress(text: string | undefined): void; /** Settles with the program, or earlier when it is detached. */ race(work: Promise): Promise>; /** Records the program's final model-facing text and ends the task. */ complete(text: string, success: boolean): Promise; } /** The foreground programs that the Ctrl+B chord can still detach. */ export declare class FabricProgramTasks { #private; begin(options: FabricProgramRunOptions): FabricProgramRun; release(run: FabricProgramRun): void; waiting(): number; detachWaiting(): number; } export {}; //# sourceMappingURL=program-tasks.d.ts.map