/** * ConcurrencyManager — enforces global and per-model concurrency limits * for background tasks. Tasks that exceed the limit stay `pending` until * a running slot frees up. */ import type { BackgroundManager } from './manager'; export interface ConcurrencyLimits { maxConcurrent: number; perModelLimit: number; } export declare class ConcurrencyManager { private readonly bgManager; private readonly maxConcurrent; private readonly perModelLimit; constructor(bgManager: BackgroundManager, limits?: Partial); /** * Can a task with the given model start right now? * Checks both global running count and per-model running count. */ canStart(model: string): boolean; /** * Try to promote as many pending tasks to running as the limits allow. * Returns the IDs of tasks that should be started. */ drainPending(): string[]; /** Current utilisation snapshot. */ utilisation(): { running: number; pending: number; maxConcurrent: number; perModelLimit: number; }; } //# sourceMappingURL=concurrency.d.ts.map