import type { JsonValue } from '../control-plane';
import type { QueueExecutionContext, QueueOperationHandler } from '../queue';
import type { JobExecution, JobTarget, JobTrigger, ScheduledJob } from './model';
import { DurableOperationQueue } from '../queue';
import { JobStore } from './store';
export interface JobExecutorResult {
    ok: boolean;
    output?: Record<string, JsonValue>;
    stdout?: string;
    stderr?: string;
    retryable?: boolean;
}
export type JobExecutor = (job: ScheduledJob, target: JobTarget, context: QueueExecutionContext) => Promise<JobExecutorResult>;
export declare class JobService {
    readonly store: JobStore;
    readonly queue: DurableOperationQueue;
    constructor(store: JobStore, options?: {
        queue?: DurableOperationQueue;
    });
    enqueue(job: ScheduledJob, input: {
        trigger: JobTrigger;
        scheduledFor?: string;
        actorId?: string;
    }): JobExecution;
    tick(at?: Date): JobExecution[];
}
export declare function createJobQueueHandlers(input: {
    store: JobStore;
    executor: JobExecutor;
}): Record<string, QueueOperationHandler>;
