import { type StateFileSystem } from "./fs.js";
export type JobStatus = "pending" | "running" | "exited" | "killed" | "lost";
export interface JobEntry {
    id: string;
    env_id: string;
    env_kind: string;
    tool: string;
    argv: string[];
    cwd: string;
    started_at: string;
    status: JobStatus;
    exit_code?: number;
    exited_at?: string;
    log_file?: string;
    reattach_context?: Record<string, unknown>;
}
export interface JobListFilter {
    env_id?: string;
    env_kind?: string;
    tool?: string;
    status?: JobStatus;
}
export interface JobRegistry {
    get(id: string): Promise<JobEntry | null>;
    put(entry: JobEntry): Promise<void>;
    update(id: string, patch: Partial<JobEntry>): Promise<JobEntry | null>;
    list(filter?: JobListFilter): Promise<JobEntry[]>;
    remove(id: string): Promise<void>;
}
export declare function createJobRegistry(homeDir: string, fs?: StateFileSystem): JobRegistry;
export type { StateFileSystem } from "./fs.js";
