import type { MastraScorer } from '../../evals/base.js'; import type { ScorerRunInputForAgent, ScorerRunOutputForAgent } from '../../evals/types.js'; import type { Mastra } from '../../mastra/index.js'; import type { MastraCompositeStore } from '../../storage/base.js'; import type { TargetType } from '../../storage/types.js'; import type { StepResult } from '../../workflows/index.js'; import type { ScorerResult } from './types.js'; /** * Resolve scorers from mixed array of instances and string IDs. * String IDs are looked up from Mastra's scorer registry. */ export declare function resolveScorers(mastra: Mastra, scorers?: (MastraScorer | string)[]): MastraScorer[]; /** * Workflow-specific data forwarded to scorers so they can inspect step-level * input/output and the executed step path. Surfaced via `targetMetadata` on * the scorer run so existing scorer signatures stay unchanged. */ export interface WorkflowScorerData { stepResults?: Record>; stepExecutionPath?: string[]; spanId?: string | null; } /** * Run all scorers for a single item result. * Errors are isolated per scorer - one failing scorer doesn't affect others. * Trajectory scorers (scorer.type === 'trajectory') receive a pre-extracted * Trajectory as their output, mirroring the dispatch runEvals performs. */ export declare function runScorersForItem(scorers: MastraScorer[], item: { input: unknown; groundTruth?: unknown; metadata?: Record; }, output: unknown, storage: MastraCompositeStore | null, runId: string, targetType: TargetType, targetId: string, itemId: string, scorerInput?: ScorerRunInputForAgent, scorerOutput?: ScorerRunOutputForAgent, traceId?: string, workflowData?: WorkflowScorerData): Promise; /** * Resolve step-scoped scorers from a `Record`. * String IDs are looked up from Mastra's scorer registry; missing IDs are skipped * with a warning (matching `resolveScorers`). */ export declare function resolveStepScorers(mastra: Mastra, stepsConfig?: Record | string)[]>): Record[]>; /** * Run step-scoped scorers for a single workflow item. Mirrors the per-step * dispatch in `runEvals`: each scorer runs against `stepResult.payload` and * `stepResult.output`, with `targetScope: 'span'` and * `targetEntityType: WORKFLOW_STEP`. The returned `ScorerResult` carries the * originating `stepId` so callers can disambiguate per-step results in the * flat `scores` array. Steps whose result is missing or did not succeed * surface as an error `ScorerResult` rather than disappearing silently. * * Errors are isolated per scorer (consistent with `runScorersForItem`); a * failing scorer produces a `ScorerResult` with `error` set, not a throw. */ export declare function runStepScorersForItem(stepScorers: Record[]>, item: { input: unknown; groundTruth?: unknown; metadata?: Record; }, workflowData: WorkflowScorerData | undefined, storage: MastraCompositeStore | null, runId: string, targetType: TargetType, targetId: string, itemId: string, traceId?: string): Promise; //# sourceMappingURL=scorer.d.ts.map