/** * Fixture I/O for `pnpm rudder ai:eval --record` / `--replay` (#A5 * Phase 4). Each case writes one JSON file under * `evals/__fixtures__//.json` carrying the assistant * turns from a real provider run, normalized into the * {@link AiFakeStep} shape so `--replay` can re-feed them via * `AiFake.respondWithSequence` for zero-API regression tests. * * The fixture format is versioned. Bumping `version` forces a * re-record on stale fixtures rather than silently mis-replaying. */ import type { AgentResponse } from '../types.js'; import type { AiFakeStep } from '../fake.js'; /** Fixture format. Bump `version` when the shape changes incompatibly. */ export interface EvalFixture { version: 1; suite: string; case: string; input: string; recordedAt: string; steps: AiFakeStep[]; } /** * Convert an `AgentResponse` into the assistant-turn `AiFakeStep[]` * sequence that `AiFake.respondWithSequence` expects. * * - Drops user/tool turns — those are framework-generated during a * replayed run, not provider output. * - Multi-modal assistant content collapses to its concatenated text * parts (the fake's transport is text-only; image/document parts * wouldn't replay meaningfully). * - `toolCalls` carry through verbatim so multi-step tool loops * replay deterministically. */ export declare function stepsFromResponse(response: AgentResponse): AiFakeStep[]; /** * Default fixtures directory: `/evals/__fixtures__`. Override * via the CLI handler's options for tests / non-standard layouts. */ export declare function defaultFixturesDir(cwd: string): string; /** * Filesystem-safe slug for `/` segments. Letters, * digits, dot, dash, underscore pass through; everything else * collapses to `-`. Multiple consecutive `-` collapse to one. * * Pure function; tested directly so suite/case rename diffs stay * predictable across editors. */ export declare function slugify(s: string): string; export declare function fixturePath(dir: string, suite: string, caseName: string): string; /** * Read a fixture file. Returns `null` when the fixture is missing * (replay falls back to running normally with a clear stderr line). * * Throws on parse / version errors — corruption is not a passing * case and silently ignoring it would mask real regressions. */ export declare function readFixture(dir: string, suite: string, caseName: string): Promise; /** * Write a fixture, creating intermediate directories as needed. * Pretty-printed (2-space) so PR diffs remain readable when the * model output evolves. */ export declare function writeFixture(dir: string, suite: string, caseName: string, payload: Omit): Promise; //# sourceMappingURL=fixtures.d.ts.map