import type { CoreMessage, CoreSystemMessage } from '../_types/@internal_ai-sdk-v4/dist/index.js';
import { z } from 'zod/v4';
import type { MastraDBMessage } from '../agent/index.js';
import type { ObservabilityContext } from '../observability/index.js';
import type { SpanRecord } from '../storage/domains/observability/tracing.js';
import type { StepResult } from '../workflows/types.js';
export type ScoringSamplingConfig = {
    type: 'none';
} | {
    type: 'ratio';
    rate: number;
};
export declare const scoringSourceSchema: z.ZodEnum<{
    LIVE: "LIVE";
    TEST: "TEST";
}>;
export type ScoringSource = z.infer<typeof scoringSourceSchema>;
export declare const scoringEntityTypeSchema: z.ZodEnum<{
    [x: string]: string;
}>;
export type ScoringEntityType = z.infer<typeof scoringEntityTypeSchema>;
export declare const scoringPromptsSchema: z.ZodObject<{
    description: z.ZodString;
    prompt: z.ZodString;
}, z.core.$strip>;
export type ScoringPrompts = z.infer<typeof scoringPromptsSchema>;
export declare const scoringInputSchema: z.ZodObject<{
    runId: z.ZodOptional<z.ZodString>;
    input: z.ZodOptional<z.ZodUnknown>;
    output: z.ZodUnknown;
    additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
export type ScoringInput = z.infer<typeof scoringInputSchema> & Partial<ObservabilityContext>;
export declare const scoringHookInputSchema: z.ZodObject<{
    runId: z.ZodOptional<z.ZodString>;
    scorer: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    input: z.ZodUnknown;
    output: z.ZodUnknown;
    metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    source: z.ZodEnum<{
        LIVE: "LIVE";
        TEST: "TEST";
    }>;
    entity: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    entityType: z.ZodEnum<{
        [x: string]: string;
    }>;
    requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    structuredOutput: z.ZodOptional<z.ZodBoolean>;
    traceId: z.ZodOptional<z.ZodString>;
    spanId: z.ZodOptional<z.ZodString>;
    resourceId: z.ZodOptional<z.ZodString>;
    threadId: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ScoringHookInput = z.infer<typeof scoringHookInputSchema> & Partial<ObservabilityContext>;
export declare const scoringExtractStepResultSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
export type ScoringExtractStepResult = z.infer<typeof scoringExtractStepResultSchema>;
export declare const scoringValueSchema: z.ZodNumber;
export declare const scoreResultSchema: z.ZodObject<{
    result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    score: z.ZodNumber;
    prompt: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ScoringAnalyzeStepResult = z.infer<typeof scoreResultSchema>;
export declare const scoringInputWithExtractStepResultSchema: z.ZodObject<{
    input: z.ZodOptional<z.ZodUnknown>;
    output: z.ZodUnknown;
    additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    runId: z.ZodString;
    extractStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    extractPrompt: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ScoringInputWithExtractStepResult<TExtract = any> = Omit<z.infer<typeof scoringInputWithExtractStepResultSchema>, 'extractStepResult'> & {
    extractStepResult?: TExtract;
} & Partial<ObservabilityContext>;
export declare const scoringInputWithExtractStepResultAndAnalyzeStepResultSchema: z.ZodObject<{
    input: z.ZodOptional<z.ZodUnknown>;
    output: z.ZodUnknown;
    additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    runId: z.ZodString;
    extractStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    extractPrompt: z.ZodOptional<z.ZodString>;
    score: z.ZodNumber;
    analyzeStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    analyzePrompt: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ScoringInputWithExtractStepResultAndAnalyzeStepResult<TExtract = any, TScore = any> = Omit<z.infer<typeof scoringInputWithExtractStepResultAndAnalyzeStepResultSchema>, 'extractStepResult' | 'analyzeStepResult'> & {
    extractStepResult?: TExtract;
    analyzeStepResult?: TScore;
} & Partial<ObservabilityContext>;
export declare const scoringInputWithExtractStepResultAndScoreAndReasonSchema: z.ZodObject<{
    input: z.ZodOptional<z.ZodUnknown>;
    output: z.ZodUnknown;
    additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    runId: z.ZodString;
    extractStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    extractPrompt: z.ZodOptional<z.ZodString>;
    score: z.ZodNumber;
    analyzeStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    analyzePrompt: z.ZodOptional<z.ZodString>;
    reason: z.ZodOptional<z.ZodString>;
    reasonPrompt: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ScoringInputWithExtractStepResultAndScoreAndReason = z.infer<typeof scoringInputWithExtractStepResultAndScoreAndReasonSchema> & Partial<ObservabilityContext>;
export declare const scoreRowDataSchema: z.ZodObject<{
    createdAt: z.ZodDate;
    updatedAt: z.ZodNullable<z.ZodDate>;
    id: z.ZodString;
    scorerId: z.ZodString;
    entityId: z.ZodString;
    runId: z.ZodString;
    input: z.ZodOptional<z.ZodUnknown>;
    output: z.ZodUnknown;
    additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    extractStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    extractPrompt: z.ZodOptional<z.ZodString>;
    score: z.ZodNumber;
    analyzeStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    analyzePrompt: z.ZodOptional<z.ZodString>;
    reason: z.ZodOptional<z.ZodString>;
    reasonPrompt: z.ZodOptional<z.ZodString>;
    scorer: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    source: z.ZodEnum<{
        LIVE: "LIVE";
        TEST: "TEST";
    }>;
    entity: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    entityType: z.ZodOptional<z.ZodEnum<{
        [x: string]: string;
    }>>;
    structuredOutput: z.ZodOptional<z.ZodBoolean>;
    traceId: z.ZodOptional<z.ZodString>;
    spanId: z.ZodOptional<z.ZodString>;
    resourceId: z.ZodOptional<z.ZodString>;
    threadId: z.ZodOptional<z.ZodString>;
    preprocessStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    preprocessPrompt: z.ZodOptional<z.ZodString>;
    generateScorePrompt: z.ZodOptional<z.ZodString>;
    generateReasonPrompt: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ScoreRowData = z.infer<typeof scoreRowDataSchema>;
export declare const saveScorePayloadSchema: z.ZodObject<{
    runId: z.ZodString;
    score: z.ZodNumber;
    input: z.ZodOptional<z.ZodUnknown>;
    threadId: z.ZodOptional<z.ZodString>;
    resourceId: z.ZodOptional<z.ZodString>;
    metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    source: z.ZodEnum<{
        LIVE: "LIVE";
        TEST: "TEST";
    }>;
    output: z.ZodUnknown;
    traceId: z.ZodOptional<z.ZodString>;
    spanId: z.ZodOptional<z.ZodString>;
    requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    entityType: z.ZodOptional<z.ZodEnum<{
        [x: string]: string;
    }>>;
    entityId: z.ZodString;
    additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    extractStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    analyzeStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    scorer: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    entity: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    preprocessStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    scorerId: z.ZodString;
    extractPrompt: z.ZodOptional<z.ZodString>;
    analyzePrompt: z.ZodOptional<z.ZodString>;
    reason: z.ZodOptional<z.ZodString>;
    reasonPrompt: z.ZodOptional<z.ZodString>;
    structuredOutput: z.ZodOptional<z.ZodBoolean>;
    preprocessPrompt: z.ZodOptional<z.ZodString>;
    generateScorePrompt: z.ZodOptional<z.ZodString>;
    generateReasonPrompt: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type SaveScorePayload = z.infer<typeof saveScorePayloadSchema>;
export declare const listScoresResponseSchema: z.ZodObject<{
    pagination: z.ZodObject<{
        total: z.ZodNumber;
        page: z.ZodNumber;
        perPage: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>;
        hasMore: z.ZodBoolean;
    }, z.core.$strip>;
    scores: z.ZodArray<z.ZodObject<{
        createdAt: z.ZodDate;
        updatedAt: z.ZodNullable<z.ZodDate>;
        id: z.ZodString;
        scorerId: z.ZodString;
        entityId: z.ZodString;
        runId: z.ZodString;
        input: z.ZodOptional<z.ZodUnknown>;
        output: z.ZodUnknown;
        additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        extractStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        extractPrompt: z.ZodOptional<z.ZodString>;
        score: z.ZodNumber;
        analyzeStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        analyzePrompt: z.ZodOptional<z.ZodString>;
        reason: z.ZodOptional<z.ZodString>;
        reasonPrompt: z.ZodOptional<z.ZodString>;
        scorer: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        source: z.ZodEnum<{
            LIVE: "LIVE";
            TEST: "TEST";
        }>;
        entity: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        entityType: z.ZodOptional<z.ZodEnum<{
            [x: string]: string;
        }>>;
        structuredOutput: z.ZodOptional<z.ZodBoolean>;
        traceId: z.ZodOptional<z.ZodString>;
        spanId: z.ZodOptional<z.ZodString>;
        resourceId: z.ZodOptional<z.ZodString>;
        threadId: z.ZodOptional<z.ZodString>;
        preprocessStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        preprocessPrompt: z.ZodOptional<z.ZodString>;
        generateScorePrompt: z.ZodOptional<z.ZodString>;
        generateReasonPrompt: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>;
export type ListScoresResponse = z.infer<typeof listScoresResponseSchema>;
export type ExtractionStepFn = (input: ScoringInput) => Promise<Record<string, any>>;
export type AnalyzeStepFn = (input: ScoringInputWithExtractStepResult) => Promise<ScoringAnalyzeStepResult>;
export type ReasonStepFn = (input: ScoringInputWithExtractStepResultAndAnalyzeStepResult) => Promise<{
    reason: string;
    reasonPrompt?: string;
} | null>;
export type ScorerOptions = {
    name: string;
    description: string;
    extract?: ExtractionStepFn;
    analyze: AnalyzeStepFn;
    reason?: ReasonStepFn;
    metadata?: Record<string, any>;
    isLLMScorer?: boolean;
};
export type ScorerRunInputForAgent = {
    inputMessages: MastraDBMessage[];
    rememberedMessages: MastraDBMessage[];
    systemMessages: CoreMessage[];
    taggedSystemMessages: Record<string, CoreSystemMessage[]>;
};
export type ScorerRunOutputForAgent = MastraDBMessage[];
/**
 * Base properties shared by all trajectory step types.
 */
export type TrajectoryStepBase = {
    /** Name of the tool called, model used, or step executed */
    name: string;
    /** Duration of this step in milliseconds */
    durationMs?: number;
    /** Additional metadata about this step */
    metadata?: Record<string, unknown>;
    /** Nested child steps (e.g., tool calls inside a workflow step, or steps inside an agent run) */
    children?: TrajectoryStep[];
};
export type ToolCallStep = TrajectoryStepBase & {
    stepType: 'tool_call';
    /** Arguments passed to the tool */
    toolArgs?: Record<string, unknown>;
    /** Result returned by the tool */
    toolResult?: Record<string, unknown>;
    /** Whether the tool call succeeded */
    success?: boolean;
};
export type McpToolCallStep = TrajectoryStepBase & {
    stepType: 'mcp_tool_call';
    /** Arguments passed to the MCP tool */
    toolArgs?: Record<string, unknown>;
    /** Result returned by the MCP tool */
    toolResult?: Record<string, unknown>;
    /** The MCP server that handled this tool call */
    mcpServer?: string;
    /** Whether the tool call succeeded */
    success?: boolean;
};
export type ModelGenerationStep = TrajectoryStepBase & {
    stepType: 'model_generation';
    /** The model ID used for generation */
    modelId?: string;
    /** Number of prompt tokens consumed */
    promptTokens?: number;
    /** Number of completion tokens generated */
    completionTokens?: number;
    /** Reason the generation finished (e.g., 'stop', 'tool-calls') */
    finishReason?: string;
};
export type AgentRunStep = TrajectoryStepBase & {
    stepType: 'agent_run';
    /** The ID of the agent that was run */
    agentId?: string;
};
export type WorkflowStepStep = TrajectoryStepBase & {
    stepType: 'workflow_step';
    /** The step ID within the workflow */
    stepId?: string;
    /** Status of the step (e.g., 'success', 'failed', 'suspended') */
    status?: string;
    /** Output data from the step */
    output?: Record<string, unknown>;
};
export type WorkflowRunStep = TrajectoryStepBase & {
    stepType: 'workflow_run';
    /** The ID of the workflow that was run */
    workflowId?: string;
    /** Status of the workflow run */
    status?: string;
};
export type WorkflowConditionalStep = TrajectoryStepBase & {
    stepType: 'workflow_conditional';
    /** Number of conditions evaluated */
    conditionCount?: number;
    /** Steps selected by the conditional */
    selectedSteps?: string[];
};
export type WorkflowParallelStep = TrajectoryStepBase & {
    stepType: 'workflow_parallel';
    /** Number of parallel branches */
    branchCount?: number;
    /** Steps that ran in parallel */
    parallelSteps?: string[];
};
export type WorkflowLoopStep = TrajectoryStepBase & {
    stepType: 'workflow_loop';
    /** Type of loop (e.g., 'dowhile', 'dountil') */
    loopType?: string;
    /** Total number of iterations executed */
    totalIterations?: number;
};
export type WorkflowSleepStep = TrajectoryStepBase & {
    stepType: 'workflow_sleep';
    /** Sleep duration in milliseconds */
    sleepDurationMs?: number;
    /** Type of sleep */
    sleepType?: string;
};
export type WorkflowWaitEventStep = TrajectoryStepBase & {
    stepType: 'workflow_wait_event';
    /** Name of the event being waited on */
    eventName?: string;
    /** Whether the event was received */
    eventReceived?: boolean;
};
export type ProcessorRunStep = TrajectoryStepBase & {
    stepType: 'processor_run';
    /** The ID of the processor that was run */
    processorId?: string;
};
/**
 * A single step in an agent's or workflow's trajectory.
 * Discriminated union on `stepType` — each variant carries properties specific
 * to that kind of action.
 */
export type TrajectoryStep = ToolCallStep | McpToolCallStep | ModelGenerationStep | AgentRunStep | WorkflowStepStep | WorkflowRunStep | WorkflowConditionalStep | WorkflowParallelStep | WorkflowLoopStep | WorkflowSleepStep | WorkflowWaitEventStep | ProcessorRunStep;
/**
 * The type of action taken in a trajectory step.
 * Derived from the discriminated union for convenience.
 */
export type TrajectoryStepType = TrajectoryStep['stepType'];
/**
 * A complete trajectory: the ordered sequence of steps an agent or workflow took
 * to go from input to output.
 */
export type Trajectory = {
    /** Ordered list of steps taken */
    steps: TrajectoryStep[];
    /** Total duration of the full trajectory in milliseconds */
    totalDurationMs?: number;
    /** The raw agent output messages, preserved for scorers that need text context */
    rawOutput?: ScorerRunOutputForAgent;
    /** The raw workflow result, preserved for scorers that need workflow-specific data */
    rawWorkflowResult?: {
        stepResults: Record<string, StepResult<any, any, any, any>>;
        stepExecutionPath?: string[];
    };
};
/**
 * Configuration for trajectory comparison behavior.
 */
export type TrajectoryComparisonOptions = {
    /**
     * How to compare step ordering.
     * - 'strict': exact match (same steps, same order, no extras)
     * - 'relaxed': subsequence match (extra steps OK, order matters)
     * - 'unordered': just check presence (don't care about order)
     * @default 'relaxed'
     */
    ordering?: 'strict' | 'relaxed' | 'unordered';
    /**
     * Whether to allow repeated steps in the trajectory.
     * When false, repeated steps (loops) are penalized.
     * @default true
     */
    allowRepeatedSteps?: boolean;
};
/**
 * Discriminated union mirroring `TrajectoryStep` — specify a `stepType` for autocomplete
 * on that variant's fields (e.g., `toolArgs` for `tool_call`). All variant-specific fields
 * are optional; only specified fields are used for comparison.
 *
 * Omit `stepType` to match any step by name only.
 *
 * @example
 * ```ts
 * // Match any step named 'search'
 * { name: 'search' }
 *
 * // Match a tool_call with specific args (autocomplete for toolArgs, toolResult, success)
 * { name: 'search', stepType: 'tool_call', toolArgs: { query: 'weather' } }
 *
 * // Match an agent run with nested expectations for its children
 * {
 *   name: 'researchAgent',
 *   stepType: 'agent_run',
 *   children: {
 *     ordering: 'unordered',
 *     steps: [
 *       { name: 'search', stepType: 'tool_call' },
 *       { name: 'summarize', stepType: 'tool_call' },
 *     ],
 *   },
 * }
 * ```
 */
/**
 * Utility type: derive an expected-step variant from an actual TrajectoryStep variant.
 *
 * - Keeps `name` and `stepType` required (for discriminant narrowing)
 * - Makes all other variant-specific fields optional
 * - Drops `durationMs` and `metadata` (not useful for expectations)
 * - Replaces `children: TrajectoryStep[]` with `children: TrajectoryExpectation`
 */
type ToExpected<T extends TrajectoryStep> = Pick<T, 'name' | 'stepType'> & Partial<Omit<T, 'name' | 'stepType' | 'children' | 'durationMs' | 'metadata'>> & {
    /** Nested trajectory expectation for this step's children */
    children?: TrajectoryExpectation;
};
/**
 * Expected step with no specific `stepType` — matches any step by name only.
 * Use this when you don't care about the step type, just the name.
 */
type ExpectedGenericStep = {
    /** Step name to match (tool name, agent ID, workflow step name, etc.) */
    name: string;
    /** Must be omitted for generic matching */
    stepType?: undefined;
    /** Nested trajectory expectation for this step's children */
    children?: TrajectoryExpectation;
};
/**
 * A step expectation for trajectory evaluation.
 *
 * Discriminated union derived from `TrajectoryStep` — when you specify a `stepType`,
 * you get autocomplete for that variant's fields (e.g., `toolArgs` for `tool_call`).
 * Omit `stepType` to match any step by name only.
 *
 * @example
 * ```ts
 * // Name-only matching (any step type)
 * { name: 'search' }
 *
 * // Type-narrowed with autocomplete for toolArgs, toolResult, success
 * { name: 'search', stepType: 'tool_call', toolArgs: { query: 'weather' } }
 *
 * // Nested expectations for a sub-agent
 * {
 *   name: 'research-agent',
 *   stepType: 'agent_run',
 *   children: {
 *     ordering: 'unordered',
 *     steps: [
 *       { name: 'search', stepType: 'tool_call' },
 *       { name: 'summarize', stepType: 'tool_call' },
 *     ],
 *   },
 * }
 * ```
 */
export type ExpectedStep = ToExpected<ToolCallStep> | ToExpected<McpToolCallStep> | ToExpected<ModelGenerationStep> | ToExpected<AgentRunStep> | ToExpected<WorkflowStepStep> | ToExpected<WorkflowRunStep> | ToExpected<WorkflowConditionalStep> | ToExpected<WorkflowParallelStep> | ToExpected<WorkflowLoopStep> | ToExpected<WorkflowSleepStep> | ToExpected<WorkflowWaitEventStep> | ToExpected<ProcessorRunStep> | ExpectedGenericStep;
/**
 * Full trajectory expectation config for the unified trajectory scorer.
 * Can be set as constructor defaults (agent-level) or per dataset item (prompt-specific).
 * Per-item values override constructor defaults.
 */
export type TrajectoryExpectation = {
    /** Expected steps for accuracy checking */
    steps?: ExpectedStep[];
    /**
     * How to compare step ordering.
     * - 'strict': exact match (same steps, same order, no extras)
     * - 'relaxed': subsequence match (extra steps OK, order matters)
     * - 'unordered': just check presence (don't care about order)
     * @default 'relaxed'
     */
    ordering?: 'strict' | 'relaxed' | 'unordered';
    /** Whether to allow repeated steps in accuracy evaluation. @default true */
    allowRepeatedSteps?: boolean;
    /** Maximum number of steps allowed */
    maxSteps?: number;
    /** Maximum total tokens across all model_generation steps */
    maxTotalTokens?: number;
    /** Maximum total duration in milliseconds */
    maxTotalDurationMs?: number;
    /** Whether to penalize redundant calls (same tool + same args consecutively). @default true */
    noRedundantCalls?: boolean;
    /** Tool names that should never appear in the trajectory */
    blacklistedTools?: string[];
    /** Tool name sequences that should never appear (contiguous subsequences) */
    blacklistedSequences?: string[][];
    /** Maximum acceptable retries per tool before penalizing. @default 2 */
    maxRetriesPerTool?: number;
};
/**
 * Extracts a Trajectory from agent output messages by walking through
 * tool invocations.
 *
 * This is called automatically by `runEvals` when using `AgentScorerConfig.trajectory`
 * scorers — trajectory scorers receive a pre-extracted `Trajectory` as their `output`
 * instead of raw `MastraDBMessage[]`.
 *
 * @param output - The raw agent output messages
 * @returns A Trajectory with ToolCallStep entries extracted from tool invocations
 */
export declare function extractTrajectory(output: ScorerRunOutputForAgent): Trajectory;
/**
 * Extracts a Trajectory from workflow step results.
 *
 * Converts the `stepResults` record (and optional `stepExecutionPath` ordering)
 * into a flat list of `WorkflowStepStep` entries. Each step captures its status,
 * output, and timing.
 *
 * This is called automatically by `runEvals` when using `WorkflowScorerConfig.trajectory`
 * scorers.
 *
 * @param stepResults - The workflow step results record
 * @param stepExecutionPath - Optional ordered list of step IDs for execution ordering
 * @returns A Trajectory with WorkflowStepStep entries
 */
export declare function extractWorkflowTrajectory(stepResults: Record<string, StepResult<any, any, any, any>>, stepExecutionPath?: string[]): Trajectory;
/**
 * Extracts a hierarchical Trajectory from trace spans (as returned by the
 * observability store's `getTrace()`).
 *
 * Builds a parent-child tree from `parentSpanId` references, then recursively
 * converts each span to the appropriate `TrajectoryStep` discriminated union
 * type with nested `children`.
 *
 * Noise spans (`generic`, `model_step`, `model_chunk`, `workflow_conditional_eval`)
 * are automatically skipped.
 *
 * This is used by `runEvals` when storage is available to produce richer,
 * hierarchical trajectories that include nested agent runs, tool calls, and
 * model generations inside workflow or agent steps.
 *
 * @param spans - Flat array of span records from `getTrace().spans`
 * @param rootSpanId - Optional span ID to use as root. If omitted, spans with
 *   no parent are used as roots.
 * @returns A Trajectory with hierarchical TrajectoryStep entries
 *
 * @example
 * ```ts
 * const trace = await observabilityStore.getTrace({ traceId });
 * const trajectory = extractTrajectoryFromTrace(trace.spans, workflowSpanId);
 * ```
 */
export declare function extractTrajectoryFromTrace(spans: SpanRecord[], rootSpanId?: string): Trajectory;
export {};
//# sourceMappingURL=types.d.ts.map