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<any, any, any, any> | string)[]): MastraScorer<any, any, any, any>[];
export declare const EXPERIMENT_ITEM_SCORER_NOT_FOUND = "EXPERIMENT_ITEM_SCORER_NOT_FOUND";
type ResolvedScorer = MastraScorer<any, any, any, any>;
export interface ItemScorerResolution {
    scorers: ResolvedScorer[];
    missingIds: string[];
}
/**
 * Create a run-scoped resolver for item scorer IDs. Resolutions, including misses,
 * are cached so concurrent items hydrate a stored scorer at most once per run.
 */
export declare function createItemScorerResolver(mastra: Mastra): (scorerIds: string[]) => Promise<ItemScorerResolution>;
/**
 * 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<string, StepResult<any, any, any, any>>;
    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.
 *
 * `persistScores: false` suppresses score writes while leaving `storage` usable
 * for reads. The two are deliberately separate parameters: `storage` is also the
 * source for trajectory extraction, so nulling it to stop writes would silently
 * downgrade trajectory scorers to the raw-message fallback.
 */
export declare function runScorersForItem(scorers: MastraScorer<any, any, any, any>[], item: {
    input: unknown;
    groundTruth?: unknown;
    metadata?: Record<string, unknown>;
}, output: unknown, storage: MastraCompositeStore | null, runId: string, targetType: TargetType, targetId: string, itemId: string, scorerInput?: ScorerRunInputForAgent, scorerOutput?: ScorerRunOutputForAgent, traceId?: string, workflowData?: WorkflowScorerData, persistScores?: boolean): Promise<ScorerResult[]>;
/**
 * Resolve step-scoped scorers from a `Record<stepId, (MastraScorer | string)[]>`.
 * 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, (MastraScorer<any, any, any, any> | string)[]>): Record<string, MastraScorer<any, any, any, any>[]>;
/**
 * 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<string, MastraScorer<any, any, any, any>[]>, item: {
    input: unknown;
    groundTruth?: unknown;
    metadata?: Record<string, unknown>;
}, workflowData: WorkflowScorerData | undefined, storage: MastraCompositeStore | null, runId: string, targetType: TargetType, targetId: string, itemId: string, traceId?: string, persistScores?: boolean): Promise<ScorerResult[]>;
export {};
//# sourceMappingURL=scorer.d.ts.map