/** * Reporter registry — holds the {@link PlanReporter} instances contributed * by `--reporter-plugin` packages. * * Unlike the executor/grader/eval-provider registries, reporters are NOT * keyed by a unique name: a reporter is a behavioral sink, and registering * the same kind of reporter twice (e.g. two logging reporters pointed at * different streams) is legitimate. The registry is therefore an ordered, * append-only list with no conflict detection. Registration order is * preserved so plugins fan out in the order the user listed them on the * command line. */ import type { RegisterFn } from "../utils/plugin-loader.js"; import type { PlanReporter } from "./plan-reporter.js"; /** Required {@link PlanReporter} methods — the ones declared WITHOUT `?` on * the interface. A reporter missing either is malformed: it would throw * `r.onTrialResult is not a function` per-event deep inside the composite's * fan-out. Validating up front turns that into a clear, immediate failure. */ export declare const REQUIRED_REPORTER_METHODS: readonly ["onTrialResult", "onRunComplete"]; /** * Assert `reporter` is a usable {@link PlanReporter}: a non-null object that * implements every {@link REQUIRED_REPORTER_METHODS} entry. * * This is the single, specifier-agnostic shape check shared by every * registration path. It is deliberately GENERIC (no plugin specifier in the * message) so it can guard programmatic callers as well as plugin discovery; * the plugin loader wraps the thrown error with the offending specifier so * plugin authors still get an attributable, actionable message. * * The explicit null/non-object guard matters: `null["onTrialResult"]` throws a * raw `TypeError: Cannot read properties of null` — `typeof` only shields * undeclared *variables*, never property access — so without this guard a * `register(null)` / `register(undefined)` (or a primitive) would surface a * confusing generic TypeError instead of this clear message. */ export declare function assertValidReporter(reporter: unknown): asserts reporter is PlanReporter; /** Append-only collection of plugin-contributed reporters. */ export interface ReporterRegistry { /** Add a reporter to the run's fan-out. */ register(reporter: PlanReporter): void; /** All registered reporters, in registration order. */ getAll(): PlanReporter[]; } /** Create an empty {@link ReporterRegistry}. */ export declare function createReporterRegistry(): ReporterRegistry; /** Every reporter plugin package exports a `registerReporters(registry)` function. */ export interface ReporterPluginEntry { registerReporters: RegisterFn; } //# sourceMappingURL=registry.d.ts.map