import type { SwarmAgentDef } from "./types.js"; import type { ONIConfig } from "../types.js"; export declare class BatchError extends Error { /** Per-input results for fulfilled promises */ readonly results: (S | undefined)[]; /** Per-input errors for rejected promises (undefined for fulfilled) */ readonly errors: (unknown | undefined)[]; constructor(settled: PromiseSettledResult[]); } type PoolStrategy = "round-robin" | "least-busy" | "random"; export declare class AgentPool> { private slots; private strategy; private rrIndex; private _pendingRemoval; private _retryTimers; private _disposed; private _retryResolvers; private static readonly PRIORITY_ORDER; private queue; private maxQueueDepth; constructor(agents: SwarmAgentDef[], opts?: { strategy?: PoolStrategy; maxQueueDepth?: number; }); dispose(): void; invoke(input: Partial, config?: ONIConfig, priority?: string): Promise; /** Run N inputs across the pool in parallel. * Returns S[] when all inputs succeed. * Throws BatchError (with .results and .errors) when any input fails. */ batch(inputs: Partial[], config?: ONIConfig): Promise; stats(): Array<{ agentId: string; activeTasks: number; totalRuns: number; }>; queueDepth(): number; slotCount(): number; /** Add new agent slots to the pool at runtime. */ addSlots(agents: SwarmAgentDef[]): void; /** Remove agent slots by ID. Slots with active tasks are skipped. Cannot remove the last agent. */ removeSlots(agentIds: string[]): void; private pickSlot; private runOnSlot; } export {}; //# sourceMappingURL=pool.d.ts.map