@mastra/core 1.18.0-alpha.0 → 1.18.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/{chunk-YXNO6AHV.js → chunk-45M6KUQZ.js} +7 -7
- package/dist/{chunk-YXNO6AHV.js.map → chunk-45M6KUQZ.js.map} +1 -1
- package/dist/{chunk-AEIPJW4F.cjs → chunk-4KGTZPYF.cjs} +185 -185
- package/dist/{chunk-AEIPJW4F.cjs.map → chunk-4KGTZPYF.cjs.map} +1 -1
- package/dist/{chunk-DL4A7URO.cjs → chunk-5AVTFQEP.cjs} +236 -20
- package/dist/chunk-5AVTFQEP.cjs.map +1 -0
- package/dist/{chunk-DV7FIKOO.cjs → chunk-6WVZQBYQ.cjs} +10 -10
- package/dist/{chunk-DV7FIKOO.cjs.map → chunk-6WVZQBYQ.cjs.map} +1 -1
- package/dist/{chunk-QVQ3PGG2.cjs → chunk-7IDACSBM.cjs} +206 -2
- package/dist/chunk-7IDACSBM.cjs.map +1 -0
- package/dist/{chunk-V54LY5HR.cjs → chunk-DQYOFNZ7.cjs} +6107 -5697
- package/dist/chunk-DQYOFNZ7.cjs.map +1 -0
- package/dist/{chunk-F7YLMJSQ.js → chunk-E6XNM5ES.js} +4 -4
- package/dist/{chunk-F7YLMJSQ.js.map → chunk-E6XNM5ES.js.map} +1 -1
- package/dist/{chunk-CYQ2TNSK.js → chunk-EYM6DWKD.js} +18 -3
- package/dist/{chunk-CYQ2TNSK.js.map → chunk-EYM6DWKD.js.map} +1 -1
- package/dist/{chunk-3ECYXW43.cjs → chunk-H5O522FY.cjs} +16 -16
- package/dist/{chunk-3ECYXW43.cjs.map → chunk-H5O522FY.cjs.map} +1 -1
- package/dist/{chunk-BIB2LCIR.js → chunk-IOCCTQYZ.js} +6106 -5696
- package/dist/chunk-IOCCTQYZ.js.map +1 -0
- package/dist/{chunk-KMVGT2JI.js → chunk-JEWTRDRI.js} +233 -17
- package/dist/chunk-JEWTRDRI.js.map +1 -0
- package/dist/{chunk-AIYWGXK7.js → chunk-L53NRDFU.js} +3 -3
- package/dist/{chunk-AIYWGXK7.js.map → chunk-L53NRDFU.js.map} +1 -1
- package/dist/{chunk-SLG7AUBK.cjs → chunk-LUONHWL6.cjs} +6 -6
- package/dist/{chunk-SLG7AUBK.cjs.map → chunk-LUONHWL6.cjs.map} +1 -1
- package/dist/{chunk-3DDJ33AU.js → chunk-M5CZCWWW.js} +4 -4
- package/dist/{chunk-3DDJ33AU.js.map → chunk-M5CZCWWW.js.map} +1 -1
- package/dist/{chunk-3H34KWBU.cjs → chunk-PK3X5KIF.cjs} +24 -9
- package/dist/{chunk-3H34KWBU.cjs.map → chunk-PK3X5KIF.cjs.map} +1 -1
- package/dist/{chunk-AIEKKCJ7.js → chunk-QR2Z4WQ7.js} +3 -3
- package/dist/{chunk-AIEKKCJ7.js.map → chunk-QR2Z4WQ7.js.map} +1 -1
- package/dist/{chunk-TG4U3K3I.cjs → chunk-T2CILERS.cjs} +50 -50
- package/dist/{chunk-TG4U3K3I.cjs.map → chunk-T2CILERS.cjs.map} +1 -1
- package/dist/{chunk-P2C4NFMY.js → chunk-URN2SKVG.js} +4 -4
- package/dist/{chunk-P2C4NFMY.js.map → chunk-URN2SKVG.js.map} +1 -1
- package/dist/{chunk-BHVF4Z5D.cjs → chunk-VAVK4KJI.cjs} +28 -28
- package/dist/chunk-VAVK4KJI.cjs.map +1 -0
- package/dist/{chunk-ZOPIN73X.js → chunk-VF3CL3JV.js} +19 -19
- package/dist/chunk-VF3CL3JV.js.map +1 -0
- package/dist/{chunk-AGEYVARR.js → chunk-VMKNS3YO.js} +204 -3
- package/dist/chunk-VMKNS3YO.js.map +1 -0
- package/dist/{chunk-A5JHKGFY.cjs → chunk-WPDB2VAM.cjs} +7 -7
- package/dist/{chunk-A5JHKGFY.cjs.map → chunk-WPDB2VAM.cjs.map} +1 -1
- package/dist/{chunk-YFYB3Q5L.js → chunk-WVTVBWOQ.js} +9 -9
- package/dist/{chunk-YFYB3Q5L.js.map → chunk-WVTVBWOQ.js.map} +1 -1
- package/dist/{chunk-3LH5QX5F.cjs → chunk-XRZNAZRP.cjs} +3 -3
- package/dist/{chunk-3LH5QX5F.cjs.map → chunk-XRZNAZRP.cjs.map} +1 -1
- package/dist/{chunk-7CDFI4GW.cjs → chunk-YEKQKMCU.cjs} +76 -76
- package/dist/{chunk-7CDFI4GW.cjs.map → chunk-YEKQKMCU.cjs.map} +1 -1
- package/dist/{chunk-JEEYINIB.js → chunk-YN3FI4AD.js} +4 -4
- package/dist/{chunk-JEEYINIB.js.map → chunk-YN3FI4AD.js.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +2 -3
- package/dist/docs/assets/SOURCE_MAP.json +349 -334
- package/dist/docs/references/reference-evals-run-evals.md +78 -3
- package/dist/docs/references/reference-evals-scorer-utils.md +184 -0
- package/dist/docs/references/reference-evals-trajectory-accuracy.md +613 -0
- package/dist/docs/references/reference-logging-pino-logger.md +58 -0
- package/dist/docs/references/reference.md +1 -2
- package/dist/evals/base.d.ts +8 -2
- package/dist/evals/base.d.ts.map +1 -1
- package/dist/evals/index.cjs +32 -20
- package/dist/evals/index.js +3 -3
- package/dist/evals/run/index.d.ts +28 -1
- package/dist/evals/run/index.d.ts.map +1 -1
- package/dist/evals/run/scorerAccumulator.d.ts +4 -1
- package/dist/evals/run/scorerAccumulator.d.ts.map +1 -1
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/evals/types.d.ts +305 -10
- package/dist/evals/types.d.ts.map +1 -1
- package/dist/harness/index.cjs +7 -7
- package/dist/harness/index.js +5 -5
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +16 -16
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/provider-types.generated.d.ts +2444 -2243
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts +3 -3
- package/dist/loop/types.d.ts +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-GLFQVCT4.cjs +12 -0
- package/dist/{models-dev-MU7QGI4O.cjs.map → models-dev-GLFQVCT4.cjs.map} +1 -1
- package/dist/models-dev-WSLKK6FO.js +3 -0
- package/dist/{models-dev-JEMMVJFN.js.map → models-dev-WSLKK6FO.js.map} +1 -1
- package/dist/netlify-SNTN56QS.js +3 -0
- package/dist/{netlify-BROEKRZF.js.map → netlify-SNTN56QS.js.map} +1 -1
- package/dist/netlify-VFRYJYBK.cjs +12 -0
- package/dist/{netlify-GOEIG6IC.cjs.map → netlify-VFRYJYBK.cjs.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +44 -44
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-L6KDLMFM.cjs +40 -0
- package/dist/{provider-registry-CKFMYEBK.cjs.map → provider-registry-L6KDLMFM.cjs.map} +1 -1
- package/dist/provider-registry-LEXW2E53.js +3 -0
- package/dist/{provider-registry-P7EMCVJI.js.map → provider-registry-LEXW2E53.js.map} +1 -1
- package/dist/provider-registry.json +6102 -5692
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/constants.cjs +56 -56
- package/dist/storage/constants.d.ts +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/experiments/base.d.ts +2 -1
- package/dist/storage/domains/experiments/base.d.ts.map +1 -1
- package/dist/storage/domains/experiments/inmemory.d.ts +2 -1
- package/dist/storage/domains/experiments/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/tracing.d.ts +45 -45
- package/dist/storage/index.cjs +160 -160
- package/dist/storage/index.js +2 -2
- package/dist/storage/types.d.ts +12 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts +1 -1
- package/dist/stream/index.cjs +8 -8
- package/dist/stream/index.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/vector/index.cjs +7 -7
- package/dist/vector/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +24 -24
- package/dist/workflows/index.js +1 -1
- package/package.json +5 -5
- package/src/llm/model/provider-types.generated.d.ts +2444 -2243
- package/dist/chunk-AGEYVARR.js.map +0 -1
- package/dist/chunk-BHVF4Z5D.cjs.map +0 -1
- package/dist/chunk-BIB2LCIR.js.map +0 -1
- package/dist/chunk-DL4A7URO.cjs.map +0 -1
- package/dist/chunk-KMVGT2JI.js.map +0 -1
- package/dist/chunk-QVQ3PGG2.cjs.map +0 -1
- package/dist/chunk-V54LY5HR.cjs.map +0 -1
- package/dist/chunk-ZOPIN73X.js.map +0 -1
- package/dist/docs/references/reference-core-getStoredAgentById.md +0 -87
- package/dist/docs/references/reference-core-listStoredAgents.md +0 -91
- package/dist/models-dev-JEMMVJFN.js +0 -3
- package/dist/models-dev-MU7QGI4O.cjs +0 -12
- package/dist/netlify-BROEKRZF.js +0 -3
- package/dist/netlify-GOEIG6IC.cjs +0 -12
- package/dist/provider-registry-CKFMYEBK.cjs +0 -40
- package/dist/provider-registry-P7EMCVJI.js +0 -3
package/dist/evals/types.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { CoreMessage, CoreSystemMessage } from '../_types/@internal_ai-sdk-
|
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
import type { MastraDBMessage } from '../agent/index.js';
|
|
4
4
|
import type { ObservabilityContext } from '../observability/index.js';
|
|
5
|
+
import type { SpanRecord } from '../storage/domains/observability/tracing.js';
|
|
6
|
+
import type { StepResult } from '../workflows/types.js';
|
|
5
7
|
export type ScoringSamplingConfig = {
|
|
6
8
|
type: 'none';
|
|
7
9
|
} | {
|
|
@@ -156,25 +158,25 @@ export declare const saveScorePayloadSchema: z.ZodObject<{
|
|
|
156
158
|
TEST: "TEST";
|
|
157
159
|
}>;
|
|
158
160
|
output: z.ZodUnknown;
|
|
159
|
-
|
|
161
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
162
|
+
spanId: z.ZodOptional<z.ZodString>;
|
|
160
163
|
requestContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
161
|
-
scorer: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
162
|
-
entity: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
163
164
|
entityType: z.ZodOptional<z.ZodEnum<{
|
|
164
165
|
[x: string]: string;
|
|
165
166
|
}>>;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
spanId: z.ZodOptional<z.ZodString>;
|
|
167
|
+
entityId: z.ZodString;
|
|
168
|
+
additionalContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
169
169
|
extractStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
170
|
-
extractPrompt: z.ZodOptional<z.ZodString>;
|
|
171
170
|
analyzeStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
171
|
+
scorer: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
172
|
+
entity: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
173
|
+
preprocessStepResult: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
174
|
+
scorerId: z.ZodString;
|
|
175
|
+
extractPrompt: z.ZodOptional<z.ZodString>;
|
|
172
176
|
analyzePrompt: z.ZodOptional<z.ZodString>;
|
|
173
177
|
reason: z.ZodOptional<z.ZodString>;
|
|
174
178
|
reasonPrompt: z.ZodOptional<z.ZodString>;
|
|
175
|
-
|
|
176
|
-
scorerId: z.ZodString;
|
|
177
|
-
entityId: z.ZodString;
|
|
179
|
+
structuredOutput: z.ZodOptional<z.ZodBoolean>;
|
|
178
180
|
preprocessPrompt: z.ZodOptional<z.ZodString>;
|
|
179
181
|
generateScorePrompt: z.ZodOptional<z.ZodString>;
|
|
180
182
|
generateReasonPrompt: z.ZodOptional<z.ZodString>;
|
|
@@ -249,4 +251,297 @@ export type ScorerRunInputForAgent = {
|
|
|
249
251
|
taggedSystemMessages: Record<string, CoreSystemMessage[]>;
|
|
250
252
|
};
|
|
251
253
|
export type ScorerRunOutputForAgent = MastraDBMessage[];
|
|
254
|
+
/**
|
|
255
|
+
* Base properties shared by all trajectory step types.
|
|
256
|
+
*/
|
|
257
|
+
export type TrajectoryStepBase = {
|
|
258
|
+
/** Name of the tool called, model used, or step executed */
|
|
259
|
+
name: string;
|
|
260
|
+
/** Duration of this step in milliseconds */
|
|
261
|
+
durationMs?: number;
|
|
262
|
+
/** Additional metadata about this step */
|
|
263
|
+
metadata?: Record<string, unknown>;
|
|
264
|
+
/** Nested child steps (e.g., tool calls inside a workflow step, or steps inside an agent run) */
|
|
265
|
+
children?: TrajectoryStep[];
|
|
266
|
+
};
|
|
267
|
+
export type ToolCallStep = TrajectoryStepBase & {
|
|
268
|
+
stepType: 'tool_call';
|
|
269
|
+
/** Arguments passed to the tool */
|
|
270
|
+
toolArgs?: Record<string, unknown>;
|
|
271
|
+
/** Result returned by the tool */
|
|
272
|
+
toolResult?: Record<string, unknown>;
|
|
273
|
+
/** Whether the tool call succeeded */
|
|
274
|
+
success?: boolean;
|
|
275
|
+
};
|
|
276
|
+
export type McpToolCallStep = TrajectoryStepBase & {
|
|
277
|
+
stepType: 'mcp_tool_call';
|
|
278
|
+
/** Arguments passed to the MCP tool */
|
|
279
|
+
toolArgs?: Record<string, unknown>;
|
|
280
|
+
/** Result returned by the MCP tool */
|
|
281
|
+
toolResult?: Record<string, unknown>;
|
|
282
|
+
/** The MCP server that handled this tool call */
|
|
283
|
+
mcpServer?: string;
|
|
284
|
+
/** Whether the tool call succeeded */
|
|
285
|
+
success?: boolean;
|
|
286
|
+
};
|
|
287
|
+
export type ModelGenerationStep = TrajectoryStepBase & {
|
|
288
|
+
stepType: 'model_generation';
|
|
289
|
+
/** The model ID used for generation */
|
|
290
|
+
modelId?: string;
|
|
291
|
+
/** Number of prompt tokens consumed */
|
|
292
|
+
promptTokens?: number;
|
|
293
|
+
/** Number of completion tokens generated */
|
|
294
|
+
completionTokens?: number;
|
|
295
|
+
/** Reason the generation finished (e.g., 'stop', 'tool-calls') */
|
|
296
|
+
finishReason?: string;
|
|
297
|
+
};
|
|
298
|
+
export type AgentRunStep = TrajectoryStepBase & {
|
|
299
|
+
stepType: 'agent_run';
|
|
300
|
+
/** The ID of the agent that was run */
|
|
301
|
+
agentId?: string;
|
|
302
|
+
};
|
|
303
|
+
export type WorkflowStepStep = TrajectoryStepBase & {
|
|
304
|
+
stepType: 'workflow_step';
|
|
305
|
+
/** The step ID within the workflow */
|
|
306
|
+
stepId?: string;
|
|
307
|
+
/** Status of the step (e.g., 'success', 'failed', 'suspended') */
|
|
308
|
+
status?: string;
|
|
309
|
+
/** Output data from the step */
|
|
310
|
+
output?: Record<string, unknown>;
|
|
311
|
+
};
|
|
312
|
+
export type WorkflowRunStep = TrajectoryStepBase & {
|
|
313
|
+
stepType: 'workflow_run';
|
|
314
|
+
/** The ID of the workflow that was run */
|
|
315
|
+
workflowId?: string;
|
|
316
|
+
/** Status of the workflow run */
|
|
317
|
+
status?: string;
|
|
318
|
+
};
|
|
319
|
+
export type WorkflowConditionalStep = TrajectoryStepBase & {
|
|
320
|
+
stepType: 'workflow_conditional';
|
|
321
|
+
/** Number of conditions evaluated */
|
|
322
|
+
conditionCount?: number;
|
|
323
|
+
/** Steps selected by the conditional */
|
|
324
|
+
selectedSteps?: string[];
|
|
325
|
+
};
|
|
326
|
+
export type WorkflowParallelStep = TrajectoryStepBase & {
|
|
327
|
+
stepType: 'workflow_parallel';
|
|
328
|
+
/** Number of parallel branches */
|
|
329
|
+
branchCount?: number;
|
|
330
|
+
/** Steps that ran in parallel */
|
|
331
|
+
parallelSteps?: string[];
|
|
332
|
+
};
|
|
333
|
+
export type WorkflowLoopStep = TrajectoryStepBase & {
|
|
334
|
+
stepType: 'workflow_loop';
|
|
335
|
+
/** Type of loop (e.g., 'dowhile', 'dountil') */
|
|
336
|
+
loopType?: string;
|
|
337
|
+
/** Total number of iterations executed */
|
|
338
|
+
totalIterations?: number;
|
|
339
|
+
};
|
|
340
|
+
export type WorkflowSleepStep = TrajectoryStepBase & {
|
|
341
|
+
stepType: 'workflow_sleep';
|
|
342
|
+
/** Sleep duration in milliseconds */
|
|
343
|
+
sleepDurationMs?: number;
|
|
344
|
+
/** Type of sleep */
|
|
345
|
+
sleepType?: string;
|
|
346
|
+
};
|
|
347
|
+
export type WorkflowWaitEventStep = TrajectoryStepBase & {
|
|
348
|
+
stepType: 'workflow_wait_event';
|
|
349
|
+
/** Name of the event being waited on */
|
|
350
|
+
eventName?: string;
|
|
351
|
+
/** Whether the event was received */
|
|
352
|
+
eventReceived?: boolean;
|
|
353
|
+
};
|
|
354
|
+
export type ProcessorRunStep = TrajectoryStepBase & {
|
|
355
|
+
stepType: 'processor_run';
|
|
356
|
+
/** The ID of the processor that was run */
|
|
357
|
+
processorId?: string;
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* A single step in an agent's or workflow's trajectory.
|
|
361
|
+
* Discriminated union on `stepType` — each variant carries properties specific
|
|
362
|
+
* to that kind of action.
|
|
363
|
+
*/
|
|
364
|
+
export type TrajectoryStep = ToolCallStep | McpToolCallStep | ModelGenerationStep | AgentRunStep | WorkflowStepStep | WorkflowRunStep | WorkflowConditionalStep | WorkflowParallelStep | WorkflowLoopStep | WorkflowSleepStep | WorkflowWaitEventStep | ProcessorRunStep;
|
|
365
|
+
/**
|
|
366
|
+
* The type of action taken in a trajectory step.
|
|
367
|
+
* Derived from the discriminated union for convenience.
|
|
368
|
+
*/
|
|
369
|
+
export type TrajectoryStepType = TrajectoryStep['stepType'];
|
|
370
|
+
/**
|
|
371
|
+
* A complete trajectory: the ordered sequence of steps an agent or workflow took
|
|
372
|
+
* to go from input to output.
|
|
373
|
+
*/
|
|
374
|
+
export type Trajectory = {
|
|
375
|
+
/** Ordered list of steps taken */
|
|
376
|
+
steps: TrajectoryStep[];
|
|
377
|
+
/** Total duration of the full trajectory in milliseconds */
|
|
378
|
+
totalDurationMs?: number;
|
|
379
|
+
/** The raw agent output messages, preserved for scorers that need text context */
|
|
380
|
+
rawOutput?: ScorerRunOutputForAgent;
|
|
381
|
+
/** The raw workflow result, preserved for scorers that need workflow-specific data */
|
|
382
|
+
rawWorkflowResult?: {
|
|
383
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
384
|
+
stepExecutionPath?: string[];
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* Configuration for trajectory comparison behavior.
|
|
389
|
+
*/
|
|
390
|
+
export type TrajectoryComparisonOptions = {
|
|
391
|
+
/**
|
|
392
|
+
* How to compare step ordering.
|
|
393
|
+
* - 'strict': exact match (same steps, same order, no extras)
|
|
394
|
+
* - 'relaxed': subsequence match (extra steps OK, order matters)
|
|
395
|
+
* - 'unordered': just check presence (don't care about order)
|
|
396
|
+
* @default 'relaxed'
|
|
397
|
+
*/
|
|
398
|
+
ordering?: 'strict' | 'relaxed' | 'unordered';
|
|
399
|
+
/**
|
|
400
|
+
* Whether to require exact match of the trajectory (same steps in same order, no extra steps).
|
|
401
|
+
* When false, allows additional steps as long as expected steps appear in order.
|
|
402
|
+
* @default false
|
|
403
|
+
* @deprecated Use `ordering: 'strict'` instead
|
|
404
|
+
*/
|
|
405
|
+
strictOrder?: boolean;
|
|
406
|
+
/**
|
|
407
|
+
* Whether to compare step-specific data (e.g., toolArgs/toolResult for tool_call steps).
|
|
408
|
+
* @default false
|
|
409
|
+
*/
|
|
410
|
+
compareStepData?: boolean;
|
|
411
|
+
/**
|
|
412
|
+
* Whether to allow repeated steps in the trajectory.
|
|
413
|
+
* When false, repeated steps (loops) are penalized.
|
|
414
|
+
* @default true
|
|
415
|
+
*/
|
|
416
|
+
allowRepeatedSteps?: boolean;
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* A lightweight step matcher for trajectory expectations.
|
|
420
|
+
* Simpler than `TrajectoryStep` — just specify `name` and optionally `stepType` and `data`.
|
|
421
|
+
*
|
|
422
|
+
* @example
|
|
423
|
+
* ```ts
|
|
424
|
+
* // Match any step named 'search'
|
|
425
|
+
* { name: 'search' }
|
|
426
|
+
*
|
|
427
|
+
* // Match a tool_call named 'search' with specific args
|
|
428
|
+
* { name: 'search', stepType: 'tool_call', data: { query: 'weather' } }
|
|
429
|
+
*
|
|
430
|
+
* // Match an agent run with nested expectations for its children
|
|
431
|
+
* {
|
|
432
|
+
* name: 'researchAgent',
|
|
433
|
+
* stepType: 'agent_run',
|
|
434
|
+
* children: {
|
|
435
|
+
* ordering: 'unordered',
|
|
436
|
+
* steps: [
|
|
437
|
+
* { name: 'search', stepType: 'tool_call' },
|
|
438
|
+
* { name: 'summarize', stepType: 'tool_call' },
|
|
439
|
+
* ],
|
|
440
|
+
* },
|
|
441
|
+
* }
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
export type ExpectedStep = {
|
|
445
|
+
/** Step name to match (tool name, agent ID, workflow step name, etc.) */
|
|
446
|
+
name: string;
|
|
447
|
+
/** Step type to match. If omitted, matches any step type with the given name */
|
|
448
|
+
stepType?: TrajectoryStepType;
|
|
449
|
+
/** Expected step-specific data (toolArgs for tool_call, output for workflow_step, etc.) */
|
|
450
|
+
data?: Record<string, unknown>;
|
|
451
|
+
/**
|
|
452
|
+
* Nested trajectory expectation for this step's children.
|
|
453
|
+
* Overrides the parent config for evaluating this step's children.
|
|
454
|
+
* e.g., require strict ordering for the parent agent but unordered for a sub-agent.
|
|
455
|
+
*/
|
|
456
|
+
children?: TrajectoryExpectation;
|
|
457
|
+
};
|
|
458
|
+
/**
|
|
459
|
+
* Full trajectory expectation config for the unified trajectory scorer.
|
|
460
|
+
* Can be set as constructor defaults (agent-level) or per dataset item (prompt-specific).
|
|
461
|
+
* Per-item values override constructor defaults.
|
|
462
|
+
*/
|
|
463
|
+
export type TrajectoryExpectation = {
|
|
464
|
+
/** Expected steps for accuracy checking */
|
|
465
|
+
steps?: ExpectedStep[];
|
|
466
|
+
/**
|
|
467
|
+
* How to compare step ordering.
|
|
468
|
+
* - 'strict': exact match (same steps, same order, no extras)
|
|
469
|
+
* - 'relaxed': subsequence match (extra steps OK, order matters)
|
|
470
|
+
* - 'unordered': just check presence (don't care about order)
|
|
471
|
+
* @default 'relaxed'
|
|
472
|
+
*/
|
|
473
|
+
ordering?: 'strict' | 'relaxed' | 'unordered';
|
|
474
|
+
/** Whether to compare step-specific data (toolArgs/toolResult, output, etc.) */
|
|
475
|
+
compareStepData?: boolean;
|
|
476
|
+
/** Whether to allow repeated steps in accuracy evaluation. @default true */
|
|
477
|
+
allowRepeatedSteps?: boolean;
|
|
478
|
+
/** Maximum number of steps allowed */
|
|
479
|
+
maxSteps?: number;
|
|
480
|
+
/** Maximum total tokens across all model_generation steps */
|
|
481
|
+
maxTotalTokens?: number;
|
|
482
|
+
/** Maximum total duration in milliseconds */
|
|
483
|
+
maxTotalDurationMs?: number;
|
|
484
|
+
/** Whether to penalize redundant calls (same tool + same args consecutively). @default true */
|
|
485
|
+
noRedundantCalls?: boolean;
|
|
486
|
+
/** Tool names that should never appear in the trajectory */
|
|
487
|
+
blacklistedTools?: string[];
|
|
488
|
+
/** Tool name sequences that should never appear (contiguous subsequences) */
|
|
489
|
+
blacklistedSequences?: string[][];
|
|
490
|
+
/** Maximum acceptable retries per tool before penalizing. @default 2 */
|
|
491
|
+
maxRetriesPerTool?: number;
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* Extracts a Trajectory from agent output messages by walking through
|
|
495
|
+
* tool invocations.
|
|
496
|
+
*
|
|
497
|
+
* This is called automatically by `runEvals` when using `AgentScorerConfig.trajectory`
|
|
498
|
+
* scorers — trajectory scorers receive a pre-extracted `Trajectory` as their `output`
|
|
499
|
+
* instead of raw `MastraDBMessage[]`.
|
|
500
|
+
*
|
|
501
|
+
* @param output - The raw agent output messages
|
|
502
|
+
* @returns A Trajectory with ToolCallStep entries extracted from tool invocations
|
|
503
|
+
*/
|
|
504
|
+
export declare function extractTrajectory(output: ScorerRunOutputForAgent): Trajectory;
|
|
505
|
+
/**
|
|
506
|
+
* Extracts a Trajectory from workflow step results.
|
|
507
|
+
*
|
|
508
|
+
* Converts the `stepResults` record (and optional `stepExecutionPath` ordering)
|
|
509
|
+
* into a flat list of `WorkflowStepStep` entries. Each step captures its status,
|
|
510
|
+
* output, and timing.
|
|
511
|
+
*
|
|
512
|
+
* This is called automatically by `runEvals` when using `WorkflowScorerConfig.trajectory`
|
|
513
|
+
* scorers.
|
|
514
|
+
*
|
|
515
|
+
* @param stepResults - The workflow step results record
|
|
516
|
+
* @param stepExecutionPath - Optional ordered list of step IDs for execution ordering
|
|
517
|
+
* @returns A Trajectory with WorkflowStepStep entries
|
|
518
|
+
*/
|
|
519
|
+
export declare function extractWorkflowTrajectory(stepResults: Record<string, StepResult<any, any, any, any>>, stepExecutionPath?: string[]): Trajectory;
|
|
520
|
+
/**
|
|
521
|
+
* Extracts a hierarchical Trajectory from trace spans (as returned by the
|
|
522
|
+
* observability store's `getTrace()`).
|
|
523
|
+
*
|
|
524
|
+
* Builds a parent-child tree from `parentSpanId` references, then recursively
|
|
525
|
+
* converts each span to the appropriate `TrajectoryStep` discriminated union
|
|
526
|
+
* type with nested `children`.
|
|
527
|
+
*
|
|
528
|
+
* Noise spans (`generic`, `model_step`, `model_chunk`, `workflow_conditional_eval`)
|
|
529
|
+
* are automatically skipped.
|
|
530
|
+
*
|
|
531
|
+
* This is used by `runEvals` when storage is available to produce richer,
|
|
532
|
+
* hierarchical trajectories that include nested agent runs, tool calls, and
|
|
533
|
+
* model generations inside workflow or agent steps.
|
|
534
|
+
*
|
|
535
|
+
* @param spans - Flat array of span records from `getTrace().spans`
|
|
536
|
+
* @param rootSpanId - Optional span ID to use as root. If omitted, spans with
|
|
537
|
+
* no parent are used as roots.
|
|
538
|
+
* @returns A Trajectory with hierarchical TrajectoryStep entries
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```ts
|
|
542
|
+
* const trace = await observabilityStore.getTrace({ traceId });
|
|
543
|
+
* const trajectory = extractTrajectoryFromTrace(trace.spans, workflowSpanId);
|
|
544
|
+
* ```
|
|
545
|
+
*/
|
|
546
|
+
export declare function extractTrajectoryFromTrace(spans: SpanRecord[], rootSpanId?: string): Trajectory;
|
|
252
547
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/evals/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/evals/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAk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BAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,UAAU,CAoC7E;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAC3D,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAC3B,UAAU,CAsDZ;AA6ID;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAiE/F"}
|
package/dist/harness/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkH5O522FY_cjs = require('../chunk-H5O522FY.cjs');
|
|
4
|
+
var chunkVAVK4KJI_cjs = require('../chunk-VAVK4KJI.cjs');
|
|
5
5
|
var chunkQVVWKMFM_cjs = require('../chunk-QVVWKMFM.cjs');
|
|
6
6
|
var chunkK4NN2KQQ_cjs = require('../chunk-K4NN2KQQ.cjs');
|
|
7
7
|
var chunkXB4FLS7A_cjs = require('../chunk-XB4FLS7A.cjs');
|
|
@@ -312,7 +312,7 @@ Use this tool when:
|
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
314
|
const workspace = context?.workspace;
|
|
315
|
-
const subagent = new
|
|
315
|
+
const subagent = new chunkVAVK4KJI_cjs.Agent({
|
|
316
316
|
id: `subagent-${definition.id}`,
|
|
317
317
|
name: `${definition.name} Subagent`,
|
|
318
318
|
instructions: definition.instructions,
|
|
@@ -561,7 +561,7 @@ var Harness = class {
|
|
|
561
561
|
*/
|
|
562
562
|
async init() {
|
|
563
563
|
if (this.config.storage) {
|
|
564
|
-
this.#internalMastra = new
|
|
564
|
+
this.#internalMastra = new chunkH5O522FY_cjs.Mastra({ logger: false, storage: this.config.storage });
|
|
565
565
|
await this.#internalMastra.getStorage().init();
|
|
566
566
|
}
|
|
567
567
|
if (this.config.workspace && !this.workspaceInitialized && !this.workspaceFn) {
|
|
@@ -813,7 +813,7 @@ var Harness = class {
|
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
815
|
try {
|
|
816
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
816
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-L6KDLMFM.cjs');
|
|
817
817
|
const registry = PROVIDER_REGISTRY;
|
|
818
818
|
const providerConfig = registry[provider];
|
|
819
819
|
const envVars = providerConfig?.apiKeyEnvVar;
|
|
@@ -833,7 +833,7 @@ var Harness = class {
|
|
|
833
833
|
*/
|
|
834
834
|
async listAvailableModels() {
|
|
835
835
|
try {
|
|
836
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
836
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-L6KDLMFM.cjs');
|
|
837
837
|
if (!PROVIDER_REGISTRY) return [];
|
|
838
838
|
const registry = PROVIDER_REGISTRY;
|
|
839
839
|
const providers = Object.keys(registry);
|
|
@@ -892,7 +892,7 @@ var Harness = class {
|
|
|
892
892
|
}
|
|
893
893
|
async getProviderApiKeyEnvVar(provider) {
|
|
894
894
|
try {
|
|
895
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
895
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-L6KDLMFM.cjs');
|
|
896
896
|
const registry = PROVIDER_REGISTRY;
|
|
897
897
|
const envVars = registry[provider]?.apiKeyEnvVar;
|
|
898
898
|
return Array.isArray(envVars) ? envVars[0] : envVars;
|
package/dist/harness/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Mastra } from '../chunk-
|
|
2
|
-
import { Agent } from '../chunk-
|
|
1
|
+
import { Mastra } from '../chunk-WVTVBWOQ.js';
|
|
2
|
+
import { Agent } from '../chunk-VF3CL3JV.js';
|
|
3
3
|
import { Workspace, createWorkspaceTools } from '../chunk-ABA3KD3X.js';
|
|
4
4
|
import { createTool } from '../chunk-GRMC2OYN.js';
|
|
5
5
|
import { toStandardSchema } from '../chunk-6SRTDZ7S.js';
|
|
@@ -811,7 +811,7 @@ var Harness = class {
|
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
813
|
try {
|
|
814
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
814
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-LEXW2E53.js');
|
|
815
815
|
const registry = PROVIDER_REGISTRY;
|
|
816
816
|
const providerConfig = registry[provider];
|
|
817
817
|
const envVars = providerConfig?.apiKeyEnvVar;
|
|
@@ -831,7 +831,7 @@ var Harness = class {
|
|
|
831
831
|
*/
|
|
832
832
|
async listAvailableModels() {
|
|
833
833
|
try {
|
|
834
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
834
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-LEXW2E53.js');
|
|
835
835
|
if (!PROVIDER_REGISTRY) return [];
|
|
836
836
|
const registry = PROVIDER_REGISTRY;
|
|
837
837
|
const providers = Object.keys(registry);
|
|
@@ -890,7 +890,7 @@ var Harness = class {
|
|
|
890
890
|
}
|
|
891
891
|
async getProviderApiKeyEnvVar(provider) {
|
|
892
892
|
try {
|
|
893
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
893
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-LEXW2E53.js');
|
|
894
894
|
const registry = PROVIDER_REGISTRY;
|
|
895
895
|
const envVars = registry[provider]?.apiKeyEnvVar;
|
|
896
896
|
return Array.isArray(envVars) ? envVars[0] : envVars;
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkH5O522FY_cjs = require('./chunk-H5O522FY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Mastra", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkH5O522FY_cjs.Mastra; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
package/dist/llm/index.cjs
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkYEKQKMCU_cjs = require('../chunk-YEKQKMCU.cjs');
|
|
4
|
+
var chunk4KGTZPYF_cjs = require('../chunk-4KGTZPYF.cjs');
|
|
5
|
+
var chunk6WVZQBYQ_cjs = require('../chunk-6WVZQBYQ.cjs');
|
|
6
|
+
var chunkXRZNAZRP_cjs = require('../chunk-XRZNAZRP.cjs');
|
|
7
|
+
var chunkDQYOFNZ7_cjs = require('../chunk-DQYOFNZ7.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "AzureOpenAIGateway", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkYEKQKMCU_cjs.AzureOpenAIGateway; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "EMBEDDING_MODELS", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkYEKQKMCU_cjs.EMBEDDING_MODELS; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "ModelRouterEmbeddingModel", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkYEKQKMCU_cjs.ModelRouterEmbeddingModel; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "ModelRouterLanguageModel", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkYEKQKMCU_cjs.ModelRouterLanguageModel; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "resolveModelConfig", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkYEKQKMCU_cjs.resolveModelConfig; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "ModelsDevGateway", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunk4KGTZPYF_cjs.ModelsDevGateway; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "NetlifyGateway", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunk6WVZQBYQ_cjs.NetlifyGateway; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "MastraModelGateway", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkXRZNAZRP_cjs.MastraModelGateway; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "PROVIDER_REGISTRY", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkDQYOFNZ7_cjs.PROVIDER_REGISTRY; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "getProviderConfig", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkDQYOFNZ7_cjs.getProviderConfig; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "parseModelString", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkDQYOFNZ7_cjs.parseModelString; }
|
|
54
54
|
});
|
|
55
55
|
//# sourceMappingURL=index.cjs.map
|
|
56
56
|
//# sourceMappingURL=index.cjs.map
|
package/dist/llm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { AzureOpenAIGateway, EMBEDDING_MODELS, ModelRouterEmbeddingModel, ModelRouterLanguageModel, resolveModelConfig } from '../chunk-
|
|
2
|
-
export { ModelsDevGateway } from '../chunk-
|
|
3
|
-
export { NetlifyGateway } from '../chunk-
|
|
4
|
-
export { MastraModelGateway } from '../chunk-
|
|
5
|
-
export { PROVIDER_REGISTRY, getProviderConfig, parseModelString } from '../chunk-
|
|
1
|
+
export { AzureOpenAIGateway, EMBEDDING_MODELS, ModelRouterEmbeddingModel, ModelRouterLanguageModel, resolveModelConfig } from '../chunk-45M6KUQZ.js';
|
|
2
|
+
export { ModelsDevGateway } from '../chunk-L53NRDFU.js';
|
|
3
|
+
export { NetlifyGateway } from '../chunk-E6XNM5ES.js';
|
|
4
|
+
export { MastraModelGateway } from '../chunk-QR2Z4WQ7.js';
|
|
5
|
+
export { PROVIDER_REGISTRY, getProviderConfig, parseModelString } from '../chunk-IOCCTQYZ.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|