/** * Composite reporter — fans every {@link PlanReporter} event to a list * of inner reporters with per-reporter serialization. * * **Per-reporter mutex.** Each inner reporter has its own awaiter * chain. Calls to one reporter don't block calls to a sibling, but * multiple events for the same reporter are serialized so reporters * don't need their own internal mutexes. * * **Event ordering.** Each `onX` method awaits all inner reporters * before resolving, so callers see "fully fanned out" semantics. A * slow reporter delays the composite's resolution but does not delay * other reporters' visibility of subsequent events (each reporter * advances independently down its own queue). * * **Errors are isolated.** If an inner reporter throws, the * composite logs to stderr and continues. A single broken reporter * does not stop the others or the run. */ import type { PlanReporter, PlanRunStartContext, RunArtifacts, RunCompletionStatus } from "./plan-reporter.js"; import type { EvalSummary, RunSummary, ScopedDiagnostic, TrialPhase, TrialPhaseDetail, TrialResult, TrialWorkItem } from "../pipeline/plan.js"; export declare class CompositeEvalReporter implements PlanReporter { private readonly slots; /** Count of reporter callback errors swallowed by {@link fanOut} across the * run. Reporters are isolated (a throw never fails the run); this counter * gives the CLI a way to surface a single end-of-run summary warning so the * swallowed errors are visible without breaking isolation. */ private erroredCount; constructor(reporters: PlanReporter[]); /** Add a reporter after construction (used by the CLI to layer on * late-bound output reporters once option parsing decides paths). An * optional `name` captures a stable identity for error attribution — * supplied for plugin reporters (plain object literals) whose * `constructor.name` is the useless `"Object"`. */ add(reporter: PlanReporter, name?: string): void; /** Number of reporter callback errors isolated (swallowed) so far. The CLI * reads this at the end of a run to emit a single summary warning when * reporter errors occurred, without altering the run's exit code. */ get erroredReporterCount(): number; /** Remove a previously-added reporter. Used to "seal" a reporter (or a * nested composite of plugin reporters) immediately after delivering its * terminal `onRunComplete` on the cancel/failure cleanup path, so no * late `onDiagnostics` fans out to it AFTER its terminal frame — upholding * the "onRunComplete is the last event" half of the lifecycle contract. * A no-op if the reporter is not currently attached. */ remove(reporter: PlanReporter): void; /** Await every currently-enqueued per-reporter callback to drain. A caller * that delivers a terminal `onRunComplete` out-of-band (the cancel/failure * cleanup path, which bypasses the normal {@link onRunComplete} fan-out) * awaits this first so any in-flight `onTrialResult` settles BEFORE the * terminal frame — preserving the "onRunComplete strictly after the last * onTrialResult" guarantee. Snapshots the tails at call time; callbacks * enqueued after this resolves are not awaited. */ settle(): Promise; onRunStart(ctx: PlanRunStartContext): Promise; onTrialStart(item: TrialWorkItem): Promise; onTrialResult(event: { item: TrialWorkItem; result: TrialResult; }): Promise; onTrialPhase(itemId: string, phase: TrialPhase, detail?: TrialPhaseDetail): Promise; onDiagnostics(diagnostics: ScopedDiagnostic[]): Promise; onEvalComplete(summary: EvalSummary): Promise; onRunComplete(summary: RunSummary, artifacts: RunArtifacts, status?: RunCompletionStatus): Promise; private fanOut; } //# sourceMappingURL=composite.d.ts.map