/**
 * Warm pool manager for pre-provisioned idle agents.
 *
 * Tracks idle agents per label set, handles idle timeout expiry,
 * and triggers replenishment when a warm agent is consumed.
 * Uses callback pattern to avoid circular dependencies with ScalerManager.
 */
export interface WarmPoolCallbacks {
    /** Request the ScalerManager to spawn a new agent for the given label set */
    onSpawnRequest: (labelSet: string[], backendName: string) => Promise<void>;
    /** Request the ScalerManager to destroy an idle agent */
    onDestroyRequest: (managedId: string, backendName: string) => Promise<void>;
}
export declare class WarmPoolManager {
    private readonly callbacks;
    /** Pools of idle agents keyed by normalized label set string */
    private readonly pools;
    /** Configuration per normalized label set */
    private readonly configs;
    /** Periodic idle check interval */
    private idleCheckInterval;
    constructor(callbacks: WarmPoolCallbacks);
    /**
     * Configure the warm pool for a label set.
     * Called during ScalerManager initialization based on YAML config.
     */
    configure(normalizedLabels: string, backendName: string, config: {
        size: number;
        idleTimeoutSeconds: number;
        labels: string[];
    }): void;
    /**
     * Add an agent to the warm pool.
     * Called when a freshly spawned warm pool agent has registered but has no job.
     */
    addIdleAgent(normalizedLabels: string, managedId: string, backendName: string): void;
    /**
     * Consume an agent from the warm pool for the given label set.
     * Returns the managedId (FIFO order) or null if pool is empty.
     * After consuming, schedules replenishment on next tick.
     */
    consumeAgent(normalizedLabels: string): string | null;
    /**
     * Check if pool is below configured size and request spawns for the deficit.
     */
    replenish(normalizedLabels: string): void;
    /**
     * Start periodic idle check (every 30 seconds).
     * Destroys agents that have been idle past their timeout.
     */
    start(): void;
    /**
     * Stop the periodic idle check interval.
     */
    stop(): void;
    /**
     * Return current warm pool count for a label set.
     */
    getPoolSize(normalizedLabels: string): number;
    /**
     * Return total warm agents across all pools.
     */
    getTotalPoolSize(): number;
    /**
     * Update configs. Drain excess agents from pools that shrunk.
     * Does NOT remove agents from pools whose config was removed --
     * let idle timeout handle that gracefully.
     */
    reload(newConfigs: Map<string, {
        backendName: string;
        size: number;
        idleTimeoutSeconds: number;
        labels: string[];
    }>): void;
    /**
     * Check for idle agents past their timeout and destroy them.
     * Exposed for testing.
     */
    checkIdleTimeouts(): void;
}
//# sourceMappingURL=warm-pool.d.ts.map