import { type LoadCouncilConfigOptions } from "./config.js"; import type { CouncilDeps, CouncilRunResult, CouncilTaskSpec } from "./types.js"; export type ProgressCallback = (message: string) => void; /** * Run `worker` over `items` with at most `limit` in flight. The slot is released * in a finally block so a rejected/errored worker frees its slot too (otherwise * a rejection would deadlock the queue for subsequent items). Results preserve * input order. Worker rejections are reflected as rejected result promises, so * callers should make `worker` non-throwing (we do). */ export declare function runWithConcurrency(items: T[], limit: number, worker: (item: T, index: number) => Promise): Promise; export interface RunCouncilOptions extends LoadCouncilConfigOptions { onProgress?: ProgressCallback; } /** * Fan a question out to the council, parse + classify each member, then * synthesize from survivors. Degrades gracefully: drops timed-out / unavailable / * errored / unparseable members and synthesizes from the rest; fails only if * fewer than `minSurvivors` survive. */ export declare function runCouncil(spec: CouncilTaskSpec, deps: CouncilDeps, options?: RunCouncilOptions): Promise;