/** * Fan prompts across adapters, partial-failure tolerant (M6). * * One adapter's total failure never kills the run - it is moved to * `skippedEngines` with a reason. An adapter that answers only SOME prompts is * reported separately in `partialEngines` with its real counts, so a score * resting on a thinner sample is never presented as full confidence (rule #6). * Per-provider concurrency is bounded; per-call cost is recorded into an * optional CostGuard. */ import { type CostGuard } from '../costs.js'; import type { EngineAnswer, EngineId, PartialEngine } from '../types.js'; import type { AskMode, EngineAdapter } from './adapter.js'; export interface SkippedEngine { engine: EngineId; reason: string; } export interface AskAllResult { answers: EngineAnswer[]; skippedEngines: SkippedEngine[]; /** * Engines that answered some but not all prompts. Total failure lands in * {@link AskAllResult.skippedEngines} instead - the two are separate signals. */ partialEngines: PartialEngine[]; } export interface AskAllOptions { mode?: AskMode; guard?: CostGuard; /** Max concurrent requests per provider (default 4). */ concurrency?: number; /** * Called once per individual engine call as it settles (ok, error, or * capped), for progress reporting. Pure side-channel - never affects results. */ onAnswered?: () => void; } /** * Safety factor applied to the reservation for a call whose engine has not yet * reported a real cost. * * `--max-cost` cannot be a perfect guarantee: a call's cost is unknowable until * it returns, and money already spent cannot be refused. What CAN be bounded is * the blind window - the first call per engine. Sized from live measurement * (2026-07-20): with corrected token assumptions, real first calls landed at up * to ~1.3x their reservation, so 1.5 covers the observed spread with a little * room. Over-reserving is cheap because `settle` returns the unused hold as * soon as the call completes; it costs a little parallelism near the cap, not * budget. */ export declare const UNMEASURED_CALL_MARGIN = 1.5; export declare function askAll(prompts: string[], adapters: EngineAdapter[], opts?: AskAllOptions): Promise;