/** * The evals runner: discover `*.eval.ts` / `evals/*.ts` files, run each eval * through its scorer pipeline against the *real* agent loop, score, and report. * * It is the engine behind `agent-native eval` — when used as a CI deploy gate * the CLI exits non-zero if any eval scores below its threshold. * * Two layers: * - `scoreEval` / `runEvals` — pure orchestration over an `AgentRunner` and * a list of evals. Fully unit-testable with an injected runner (no model). * - `discoverEvalFiles` / `loadEvals` — filesystem discovery + dynamic import * of author-written eval modules. * * Results are also (best-effort) written to the observability eval store so a * dashboard can surface CI eval history next to production run evals. */ import type { ActionEntry } from "../agent/production-agent.js"; import type { AgentRunner } from "./agent-runner.js"; import type { Eval, EvalResultRow, EvalRunReport } from "./types.js"; /** Run a single eval: invoke the agent, then score with each scorer. */ export declare function scoreEval(evalCase: Eval, runner: AgentRunner, opts?: { thresholdOverride?: number; }): Promise; /** Run a batch of evals against one runner and aggregate a report. */ export declare function runEvals(evals: Eval[], runner: AgentRunner, opts?: { thresholdOverride?: number; persist?: boolean; }): Promise; /** * Walk `root` for eval files. Matches two conventions: * - any `**\/*.eval.ts` (co-located with code), and * - any `*.ts` directly inside an `evals/` directory. * `pattern` further filters by substring of the relative path. */ export declare function discoverEvalFiles(root: string, pattern?: string): Promise; /** Discover and import all eval files under `root`, returning their evals. */ export declare function loadEvals(root: string, pattern?: string): Promise<{ files: string[]; evals: Eval[]; }>; export interface RunEvalSuiteOptions { /** App root to discover eval files + actions under. Defaults to cwd. */ cwd?: string; /** Substring filter on the eval file path. */ pattern?: string; /** Global threshold override (wins over per-eval thresholds). */ thresholdOverride?: number; /** App actions to expose to the agent. Auto-discovered when omitted. */ actions?: Record; /** System prompt for runs. */ systemPrompt?: string; /** Write results to the observability eval store (default true). */ persist?: boolean; /** Pre-built runner (tests inject this to avoid touching engine/loop). */ runner?: AgentRunner; /** Pre-loaded evals (tests inject this to skip filesystem discovery). */ evals?: Eval[]; } /** * End-to-end: load evals, build a runner, score, report. The CLI wraps this * and maps `report.failed > 0` to a non-zero exit code (the CI gate). */ export declare function runEvalSuite(opts?: RunEvalSuiteOptions): Promise<{ report: EvalRunReport; files: string[]; }>; //# sourceMappingURL=runner.d.ts.map