@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
50 lines • 2.09 kB
TypeScript
import type { Agent } from '../../agent/index.js';
import type { MastraScorer } from '../../evals/base.js';
import type { ScorerRunInputForAgent, ScorerRunOutputForAgent } from '../../evals/types.js';
import type { VersionOverrides } from '../../mastra/types.js';
import type { TargetType } from '../../storage/types.js';
import type { StepResult, Workflow } from '../../workflows/index.js';
/**
* Target types supported for dataset execution.
* Agent and Workflow are Phase 2; scorer and processor are Phase 4.
*/
export type Target = Agent | Workflow | MastraScorer<any, any, any, any>;
/**
* Result from executing a target against a dataset item.
*/
export interface ExecutionResult {
/** Output from the target (null if failed) */
output: unknown;
/** Structured error if execution failed */
error: {
message: string;
stack?: string;
code?: string;
} | null;
/** Trace ID from agent/workflow execution (null for scorers or errors) */
traceId: string | null;
/** Root span ID from agent/workflow execution (null when not traced) */
spanId?: string | null;
/** Structured input for scorers (extracted from agent scoring data) */
scorerInput?: ScorerRunInputForAgent;
/** Structured output for scorers (extracted from agent scoring data) */
scorerOutput?: ScorerRunOutputForAgent;
/** Per-step results from a workflow run, keyed by step ID */
stepResults?: Record<string, StepResult<any, any, any, any>>;
/** Order in which workflow steps actually executed */
stepExecutionPath?: string[];
}
/**
* Execute a dataset item against a target (agent, workflow, scorer, processor).
* Phase 2: agent/workflow. Phase 4: scorer. Processor deferred.
*/
export declare function executeTarget(target: Target, targetType: TargetType, item: {
input: unknown;
groundTruth?: unknown;
}, options?: {
signal?: AbortSignal;
requestContext?: Record<string, unknown>;
experimentId?: string;
versions?: VersionOverrides;
}): Promise<ExecutionResult>;
//# sourceMappingURL=executor.d.ts.map