import type { JobStateStore } from './job-state-store.js'; export interface WrapInput { jobId: string; role: 'prd' | 'rd' | 'qa' | 'ui' | 'txt' | 'sc' | 'agent'; prompt: string; budgetMb?: number; } export interface DispatchResult { batchId: string; } export interface DispatchOpts { budgetMb: number; jobScope: true; batchId: string; } export type DispatchFn = (role: string, prompt: string, opts: DispatchOpts) => Promise; export interface WrapOutput { batchId: string; requiresCleanup: true; } export declare class SubAgentJobWrapper { private readonly store; private readonly dispatch; private readonly dispatchedBatches; constructor(store: JobStateStore, dispatch: DispatchFn); wrap(input: WrapInput): Promise; canCheckpointDone(jobId: string, batchId: string): boolean; cleanup(input: CleanupInput): Promise; } export interface CleanupInput { jobId: string; batchId: string; force: boolean; /** * On-disk ledger context, supplied by the CLI. Omitted by same-process * callers, which keep the in-memory map above as their pending set. */ projectRoot?: string; sessionId?: string; } export interface CleanupResult { cleaned: boolean; cleanedRecords: string[]; skipped: { recordPath: string; reason: string; }[]; }