import type { GraderFn, Run, RunMode, Trial } from "../config/types.js"; /** * Plugin interface for extending agent-eval-kit. * Plugins are plain objects — no classes, no inheritance. * * Plugins contribute: * - Custom graders (same GraderFn signature as built-in graders) * - Lifecycle hooks (beforeRun, afterTrial, afterRun) * * Register via: defineConfig({ plugins: [myPlugin] }) */ export interface EvalPlugin { readonly name: string; readonly version: string; /** Custom graders contributed by this plugin. Keyed by grader name. */ readonly graders?: Readonly> | undefined; /** Lifecycle hooks. All hooks are sequential (called in plugin registration order). */ readonly hooks?: PluginHooks | undefined; } export interface PluginHooks { /** * Called before a suite run begins. * Use for setup: logging, telemetry start, resource initialization. */ readonly beforeRun?: (context: BeforeRunContext) => Promise; /** * Called after each trial completes. * Use for streaming progress, live updates, incremental logging. * Must not throw — errors are logged and swallowed to avoid breaking the pipeline. */ readonly afterTrial?: (trial: Trial, context: AfterTrialContext) => Promise; /** * Called after the entire run completes (including aborted runs). * Use for cleanup: telemetry end, resource disposal, summary notifications. * Must not throw — errors are logged and swallowed to avoid breaking the pipeline. */ readonly afterRun?: (run: Run) => Promise; } /** Context passed to the `beforeRun` hook. Contains suite metadata for setup and logging. */ export interface BeforeRunContext { readonly suiteId: string; readonly mode: RunMode; readonly caseCount: number; readonly trialCount: number; } /** Context passed to the `afterTrial` hook. Provides progress tracking counters for live display. */ export interface AfterTrialContext { readonly suiteId: string; readonly completedCount: number; readonly totalCount: number; } //# sourceMappingURL=types.d.ts.map