export type WorkerJobType = 'classify_task' | 'extract_tasks' | 'summarise_notes' | 'summarise_weekly' | 'compress_memory' | 'scan_logs' | 'detect_failures' | 'generate_reminder' | 'refresh_summary' | 'validate_json' | 'expire_promises' | 'custom';
export type WorkerJobStatus = 'pending' | 'running' | 'completed' | 'failed';
export interface WorkerJob {
    job_id: string;
    job_type: WorkerJobType;
    service_id?: string;
    model_id?: string;
    input: unknown;
    output?: unknown;
    status: WorkerJobStatus;
    error?: string;
    created_at: string;
    started_at?: string;
    completed_at?: string;
}
export interface WorkerJobResult {
    job_id: string;
    status: 'completed' | 'failed';
    output?: unknown;
    error?: string;
    duration_ms: number;
}
export type WorkerExecutor = (job: WorkerJob) => Promise<unknown>;
export declare class WorkerQueue {
    private queue;
    private completed;
    private executors;
    private maxCompleted;
    constructor(maxCompleted?: number);
    /** Register an executor for a job type. */
    registerExecutor(jobType: WorkerJobType, executor: WorkerExecutor): void;
    /** Enqueue a new job. */
    enqueue(jobType: WorkerJobType, input: unknown, options?: {
        service_id?: string;
        model_id?: string;
    }): WorkerJob;
    /** Process the next pending job. Returns result or null if queue is empty. */
    processNext(): Promise<WorkerJobResult | null>;
    /** Process all pending jobs. */
    processAll(): Promise<WorkerJobResult[]>;
    /** Get the number of pending jobs. */
    pendingCount(): number;
    /** List pending jobs. */
    pending(): WorkerJob[];
    /** List completed jobs (recent history). */
    history(): WorkerJob[];
    /** Get a job by ID. */
    getJob(jobId: string): WorkerJob | undefined;
    /** Clear all pending jobs. */
    clear(): number;
    private moveToCompleted;
    /** Save queue state to a JSON file. */
    saveToDisk(filePath: string): Promise<void>;
    /** Load queue state from a JSON file. Does not overwrite registered executors. */
    loadFromDisk(filePath: string): Promise<{
        loaded: number;
        errors: string[];
    }>;
    /** Append a completed job to a JSONL log file for auditability. */
    appendToLog(logPath: string, job: WorkerJob): Promise<void>;
}
export interface WorkerQueueSnapshot {
    version: 1;
    saved_at: string;
    pending: WorkerJob[];
    completed: WorkerJob[];
}
//# sourceMappingURL=workerQueue.d.ts.map