import type { EvalVerdict, GateResult, RunEvalsResult, ThresholdConfig, TurnResult } from '@mastra/core/evals'; /** Per-threshold-scorer result, as reported in `RunEvalsResult.thresholdResults`. */ export type EvalThresholdResult = { id: string; passed: boolean; averageScore: number; threshold: ThresholdConfig; }; /** * Serializable projection of a `RunEvalsResult` stored in `task.meta.mastraEval`. * * This is the contract between the test worker (which runs `runEvals`) and the * `MastraEvalsReporter` running in the main process. It intentionally excludes * raw agent/workflow payloads: `task.meta` is structured-cloned from worker to * main, so only lightweight, serializable data belongs here. */ export type MastraEvalMeta = { /** * Average score per scorer id across all data items. Categorized scorer * configs are flattened into dot-separated keys (e.g. `agent.my-scorer`, * `steps.step-1.my-scorer`). */ scores: Record; /** Number of data items evaluated. */ totalItems: number; /** Present when gates or threshold-bearing scorers were provided. */ verdict?: EvalVerdict; /** Per-gate results (averaged across all data items). */ gateResults?: GateResult[]; /** Per-threshold-scorer results (averaged across all data items). */ thresholdResults?: EvalThresholdResult[]; /** Per-turn assertion results, present when data items use `turns`. */ turnResults?: TurnResult[]; }; declare module 'vitest' { interface TaskMeta { mastraEval?: MastraEvalMeta; } } /** * Projects a `RunEvalsResult` into the serializable `MastraEvalMeta` shape * stored in `task.meta.mastraEval`. */ export declare function toEvalMeta(result: RunEvalsResult): MastraEvalMeta; //# sourceMappingURL=meta.d.ts.map