import { DrizzleClient } from '../../types/drizzle.js';
import { I as IJobOrchestrator, i as JobRun } from '../../../job-orchestrator.protocol-DubMVbm9.js';
import { IJobRunService, ListForScopeOptions, CancelForScopeOptions, RescheduleForScopeOptions, PoolStatusCount, JobRunFailure, ListJobRunsQuery, JobRunPage } from './job-run-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';

declare class DrizzleJobRunService implements IJobRunService {
    private readonly db;
    private readonly orchestrator;
    private readonly multiTenant;
    constructor(db: DrizzleClient, orchestrator: IJobOrchestrator, multiTenant: boolean);
    /**
     * JOB-8 — produce the tenant WHERE fragment (or `null` to opt out).
     * Returns `null` when multi-tenancy is off (caller skips the predicate).
     * Throws `MissingTenantIdError` when on + `undefined`.
     * When on + explicit `null`, filters `tenant_id IS NULL`.
     */
    private tenantCondition;
    listForScope(entityType: string, entityId: string, opts?: ListForScopeOptions): Promise<JobRun[]>;
    cancelForScope(entityType: string, entityId: string, opts?: CancelForScopeOptions): Promise<void>;
    rescheduleForScope(entityType: string, entityId: string, newRunAt: Date, opts?: RescheduleForScopeOptions): Promise<void>;
    countByPoolAndStatus(tenantId?: string | null): Promise<PoolStatusCount[]>;
    listRecentFailed(limit: number, tenantId?: string | null): Promise<JobRunFailure[]>;
    listJobRuns(query?: ListJobRunsQuery): Promise<JobRunPage>;
    /**
     * Internal helper used by cascade paths (not on the public protocol).
     * Exposed as a public method on the concrete class so infrastructure
     * code (cascade tests, debug tools) can call it without a cast.
     */
    findByRootRunId(rootRunId: string): Promise<JobRun[]>;
}

export { DrizzleJobRunService };
