import { ModuleRef } from '@nestjs/core';
import { ConnectionOptions } from 'bullmq';
import { DrizzleClient } from '../../types/drizzle.js';
import { I as IJobOrchestrator } from '../../../job-orchestrator.protocol-DubMVbm9.js';
import { IJobStepService } from './job-step-service.protocol.js';
import 'drizzle-orm/node-postgres';
import '../events/event-bus.protocol.js';
import './job-orchestration.schema.js';
import 'drizzle-orm/pg-core';
import 'drizzle-orm';
import '@nestjs/common';
import '../events/event-registry.js';

/**
 * Options for a single per-pool BullMQ worker.
 */
interface BullMQJobWorkerOptions {
    /** Logical pool name (matches `job_run.pool`). */
    pool: string;
    /** Fully-resolved BullMQ queue name to consume. */
    queueName: string;
    /** Max concurrent in-flight processors. */
    concurrency: number;
    /** ioredis-compatible connection. */
    connection: ConnectionOptions;
}
declare class BullMQJobWorker {
    private readonly db;
    private readonly orchestrator;
    private readonly stepService;
    private readonly options;
    private readonly moduleRef;
    private readonly logger;
    private worker;
    constructor(db: DrizzleClient, orchestrator: IJobOrchestrator, stepService: IJobStepService, options: BullMQJobWorkerOptions, moduleRef: ModuleRef);
    onModuleInit(): Promise<void>;
    onModuleDestroy(): Promise<void>;
    /**
     * Process one BullMQ job. Returns the handler output (stored by BullMQ as
     * the job return value AND written to `job_run.output`). Throws on handler
     * failure so BullMQ applies the retry policy.
     */
    private process;
    private markFailed;
    private makeStepFn;
    private makeSpawnFn;
}

export { BullMQJobWorker, type BullMQJobWorkerOptions };
