import { type ProofUri, type ProvingJob, type ProvingJobId, type ProvingJobSettledResult, type ProvingJobStatus, type ProvingRequestType } from '@aztec/circuit-types';
import { type ConfigMappingsType } from '@aztec/foundation/config';
import { z } from 'zod';
export declare const ProverBrokerConfig: z.ZodObject<{
    /** If starting a prover broker locally, the max number of retries per proving job */
    proverBrokerJobMaxRetries: z.ZodNumber;
    /** If starting a prover broker locally, the time after which a job times out and gets assigned to a different agent */
    proverBrokerJobTimeoutMs: z.ZodNumber;
    /** If starting a prover broker locally, the interval the broker checks for timed out jobs */
    proverBrokerPollIntervalMs: z.ZodNumber;
    /** If starting a prover broker locally, the directory to store broker data */
    proverBrokerDataDirectory: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    proverBrokerJobMaxRetries: number;
    proverBrokerJobTimeoutMs: number;
    proverBrokerPollIntervalMs: number;
    proverBrokerDataDirectory?: string | undefined;
}, {
    proverBrokerJobMaxRetries: number;
    proverBrokerJobTimeoutMs: number;
    proverBrokerPollIntervalMs: number;
    proverBrokerDataDirectory?: string | undefined;
}>;
export type ProverBrokerConfig = z.infer<typeof ProverBrokerConfig>;
export declare const proverBrokerConfigMappings: ConfigMappingsType<ProverBrokerConfig>;
/**
 * An interface for the proving orchestrator. The producer uses this to enqueue jobs for agents
 */
export interface ProvingJobProducer {
    /**
     * Enqueues a proving job
     * @param job - The job to enqueue
     */
    enqueueProvingJob(job: ProvingJob): Promise<void>;
    /**
     * Cancels a proving job.
     * @param id - The ID of the job to cancel
     */
    cancelProvingJob(id: ProvingJobId): Promise<void>;
    /**
     * Cleans up after a job has completed. Throws if the job is in-progress
     * @param id - The ID of the job to cancel
     */
    cleanUpProvingJobState(id: ProvingJobId): Promise<void>;
    /**
     * Returns the current status fof the proving job
     * @param id - The ID of the job to get the status of
     */
    getProvingJobStatus(id: ProvingJobId): Promise<ProvingJobStatus>;
    /**
     * Waits for the job to settle and returns to the result
     * @param id - The ID of the job to get the status of
     */
    waitForJobToSettle(id: ProvingJobId): Promise<ProvingJobSettledResult>;
}
export type ProvingJobFilter = {
    allowList: ProvingRequestType[];
};
export type GetProvingJobResponse = {
    job: ProvingJob;
    time: number;
};
/**
 * An interface for proving agents to request jobs and report results
 */
export interface ProvingJobConsumer {
    /**
     * Gets a proving job to work on
     * @param filter - Optional filter for the type of job to get
     */
    getProvingJob(filter?: ProvingJobFilter): Promise<GetProvingJobResponse | undefined>;
    /**
     * Marks a proving job as successful
     * @param id - The ID of the job to report success for
     * @param result - The result of the job
     */
    reportProvingJobSuccess(id: ProvingJobId, result: ProofUri): Promise<void>;
    /**
     * Marks a proving job as errored
     * @param id - The ID of the job to report an error for
     * @param err - The error that occurred while processing the job
     * @param retry - Whether to retry the job
     */
    reportProvingJobError(id: ProvingJobId, err: string, retry?: boolean): Promise<void>;
    /**
     * Sends a heartbeat to the broker to indicate that the agent is still working on the given proving job
     * @param id - The ID of the job to report progress for
     * @param startedAt - The unix epoch when the job was started
     * @param filter - Optional filter for the type of job to get
     */
    reportProvingJobProgress(id: ProvingJobId, startedAt: number, filter?: ProvingJobFilter): Promise<GetProvingJobResponse | undefined>;
}
export interface ProvingJobBroker extends ProvingJobProducer, ProvingJobConsumer {
}
//# sourceMappingURL=prover-broker.d.ts.map