import type { ControllerStore } from "./store.js"; import type { AnyControllerDefinition, ControllerDefinition, ControllerResource, ControllerResourceRef } from "./types.js"; import { ControllerWorkflowCoordinator, type ControllerWorkflowScheduler } from "./workflows.js"; export type ControllerManagerOptions = { store: ControllerStore; controllers: AnyControllerDefinition[]; workflowScheduler?: ControllerWorkflowScheduler; maxConcurrent?: number; controllerConcurrency?: Record; defaultTimeoutMs?: number; leaseMs?: number; pollIntervalMs?: number; baseBackoffMs?: number; maxBackoffMs?: number; jitterRatio?: number; now?: () => Date; random?: () => number; }; export declare class ControllerManager { readonly store: ControllerStore; private readonly definitions; private readonly workflowCoordinator; private readonly maxConcurrent; private readonly controllerConcurrency; private readonly defaultTimeoutMs; private readonly leaseMs; private readonly pollIntervalMs; private readonly baseBackoffMs; private readonly maxBackoffMs; private readonly jitterRatio; private readonly now; private readonly random; private readonly activeByController; private readonly activeReconciles; private runAbort; private workerTasks; constructor(options: ControllerManagerOptions); putResource(definition: ControllerDefinition, key: string, spec: TSpec): ControllerResource; putResourceByName(controller: string, key: string, spec: unknown): ControllerResource; requestDeletion(ref: ControllerResourceRef): ControllerResource; enqueue(ref: ControllerResourceRef, afterMs?: number): void; start(): void; stop(): Promise; runOne(): Promise; runUntilIdle(maxReconciles?: number): Promise; get workflowRequests(): ControllerWorkflowCoordinator; private workerLoop; private claimNext; private eligibleControllers; private processClaim; private reconcileClaim; private callReconciler; private finishSuccessfulClaim; private finishFailedClaim; private backoffMs; private readyQueueExists; private recordEvent; }