@mastra/core 1.18.0-alpha.0 → 1.18.0-alpha.1
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 +25 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/{chunk-3ECYXW43.cjs → chunk-2U4M4SGY.cjs} +16 -16
- package/dist/{chunk-3ECYXW43.cjs.map → chunk-2U4M4SGY.cjs.map} +1 -1
- package/dist/{chunk-JEEYINIB.js → chunk-3NMSFQPY.js} +4 -4
- package/dist/{chunk-JEEYINIB.js.map → chunk-3NMSFQPY.js.map} +1 -1
- package/dist/{chunk-7CDFI4GW.cjs → chunk-3O73Q6M2.cjs} +76 -76
- package/dist/{chunk-7CDFI4GW.cjs.map → chunk-3O73Q6M2.cjs.map} +1 -1
- package/dist/{chunk-ZOPIN73X.js → chunk-3U4ZNZIF.js} +4 -4
- package/dist/{chunk-ZOPIN73X.js.map → chunk-3U4ZNZIF.js.map} +1 -1
- package/dist/{chunk-QVQ3PGG2.cjs → chunk-7IDACSBM.cjs} +206 -2
- package/dist/chunk-7IDACSBM.cjs.map +1 -0
- package/dist/{chunk-YFYB3Q5L.js → chunk-A2Z26HFR.js} +9 -9
- package/dist/{chunk-YFYB3Q5L.js.map → chunk-A2Z26HFR.js.map} +1 -1
- package/dist/{chunk-AIYWGXK7.js → chunk-BYJDWJCX.js} +3 -3
- package/dist/{chunk-AIYWGXK7.js.map → chunk-BYJDWJCX.js.map} +1 -1
- package/dist/{chunk-F7YLMJSQ.js → chunk-D4DCPE5Y.js} +4 -4
- package/dist/{chunk-F7YLMJSQ.js.map → chunk-D4DCPE5Y.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-3LH5QX5F.cjs → chunk-G62XEVSI.cjs} +3 -3
- package/dist/{chunk-3LH5QX5F.cjs.map → chunk-G62XEVSI.cjs.map} +1 -1
- package/dist/{chunk-BHVF4Z5D.cjs → chunk-GFBH7Q4W.cjs} +13 -13
- package/dist/{chunk-BHVF4Z5D.cjs.map → chunk-GFBH7Q4W.cjs.map} +1 -1
- package/dist/{chunk-3DDJ33AU.js → chunk-HEHK7LXS.js} +4 -4
- package/dist/{chunk-3DDJ33AU.js.map → chunk-HEHK7LXS.js.map} +1 -1
- package/dist/{chunk-TG4U3K3I.cjs → chunk-JFPVUKPB.cjs} +50 -50
- package/dist/{chunk-TG4U3K3I.cjs.map → chunk-JFPVUKPB.cjs.map} +1 -1
- package/dist/{chunk-AIEKKCJ7.js → chunk-K22Q6XPG.js} +3 -3
- package/dist/{chunk-AIEKKCJ7.js.map → chunk-K22Q6XPG.js.map} +1 -1
- package/dist/{chunk-V54LY5HR.cjs → chunk-KL2IRBNK.cjs} +6107 -5697
- package/dist/chunk-KL2IRBNK.cjs.map +1 -0
- package/dist/{chunk-DV7FIKOO.cjs → chunk-MSDZQ4DW.cjs} +10 -10
- package/dist/{chunk-DV7FIKOO.cjs.map → chunk-MSDZQ4DW.cjs.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-SLG7AUBK.cjs → chunk-PQWEJELD.cjs} +6 -6
- package/dist/{chunk-SLG7AUBK.cjs.map → chunk-PQWEJELD.cjs.map} +1 -1
- package/dist/{chunk-P2C4NFMY.js → chunk-RB2QRGRV.js} +4 -4
- package/dist/{chunk-P2C4NFMY.js.map → chunk-RB2QRGRV.js.map} +1 -1
- package/dist/{chunk-BIB2LCIR.js → chunk-TKKBZUWD.js} +6106 -5696
- package/dist/chunk-TKKBZUWD.js.map +1 -0
- package/dist/{chunk-AEIPJW4F.cjs → chunk-UEZU2TA2.cjs} +185 -185
- package/dist/{chunk-AEIPJW4F.cjs.map → chunk-UEZU2TA2.cjs.map} +1 -1
- package/dist/{chunk-DL4A7URO.cjs → chunk-UPCNNWXW.cjs} +236 -20
- package/dist/chunk-UPCNNWXW.cjs.map +1 -0
- package/dist/{chunk-KMVGT2JI.js → chunk-UQ2HAEHL.js} +233 -17
- package/dist/chunk-UQ2HAEHL.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-YXNO6AHV.js → chunk-WYFCQAHY.js} +7 -7
- package/dist/{chunk-YXNO6AHV.js.map → chunk-WYFCQAHY.js.map} +1 -1
- package/dist/{chunk-A5JHKGFY.cjs → chunk-Z3VUDCXI.cjs} +7 -7
- package/dist/{chunk-A5JHKGFY.cjs.map → chunk-Z3VUDCXI.cjs.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +2 -1
- 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.md +1 -0
- 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-3U6ICCNW.js +3 -0
- package/dist/{models-dev-JEMMVJFN.js.map → models-dev-3U6ICCNW.js.map} +1 -1
- package/dist/models-dev-BJHT4GXA.cjs +12 -0
- package/dist/{models-dev-MU7QGI4O.cjs.map → models-dev-BJHT4GXA.cjs.map} +1 -1
- package/dist/netlify-DE3IXMT2.js +3 -0
- package/dist/{netlify-BROEKRZF.js.map → netlify-DE3IXMT2.js.map} +1 -1
- package/dist/netlify-UARJYMCW.cjs +12 -0
- package/dist/{netlify-GOEIG6IC.cjs.map → netlify-UARJYMCW.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-65CPGTUU.cjs +40 -0
- package/dist/{provider-registry-CKFMYEBK.cjs.map → provider-registry-65CPGTUU.cjs.map} +1 -1
- package/dist/provider-registry-EQAT7FXK.js +3 -0
- package/dist/{provider-registry-P7EMCVJI.js.map → provider-registry-EQAT7FXK.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-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/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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
+
## 1.18.0-alpha.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **Trajectory evaluation**: Added trajectory types and trace-based extraction for evaluating agent and workflow execution paths. ([#14697](https://github.com/mastra-ai/mastra/pull/14697))
|
|
8
|
+
|
|
9
|
+
`TrajectoryStep` models each step in an execution as a typed object — tool calls, model generations, agent runs, workflow steps, and control flow nodes each have their own variant with relevant properties (e.g., `toolArgs`/`toolResult` for tool calls, `modelId`/`promptTokens` for model generations). Steps can be nested via `children` to represent hierarchical execution.
|
|
10
|
+
|
|
11
|
+
`TrajectoryExpectation` lets you define what a good trajectory looks like — expected steps, ordering, step/token/duration budgets, blacklisted tools, and retry thresholds. `ExpectedStep` provides a simple way to define expected steps by name and optional stepType, with support for nested expectations via `children` to set different evaluation rules at each level of the hierarchy.
|
|
12
|
+
|
|
13
|
+
**Trace-based extraction:** `extractTrajectoryFromTrace()` builds hierarchical trajectories from observability trace spans. The `runEvals` pipeline automatically uses this when storage is configured, capturing the full execution tree including nested agent runs and tool calls. Falls back to `extractTrajectory` (agents) or `extractWorkflowTrajectory` (workflows) when storage is unavailable.
|
|
14
|
+
|
|
15
|
+
**Pipeline:** `expectedTrajectory` flows from dataset items through `runEvals` to trajectory scorers. Added `trajectory` key to both `AgentScorerConfig` and `WorkflowScorerConfig`.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Add `getReviewSummary()` to experiments storage for aggregating review status counts ([#14649](https://github.com/mastra-ai/mastra/pull/14649))
|
|
20
|
+
|
|
21
|
+
Query experiment results grouped by experiment ID, returning counts of `needs-review`, `reviewed`, and `complete` items in a single query instead of fetching all results client-side.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
const summary = await storage.experiments.getReviewSummary();
|
|
25
|
+
// [{ experimentId: 'exp-1', needsReview: 3, reviewed: 5, complete: 2, total: 10 }, ...]
|
|
26
|
+
```
|
|
27
|
+
|
|
3
28
|
## 1.18.0-alpha.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
package/dist/agent/index.cjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkGFBH7Q4W_cjs = require('../chunk-GFBH7Q4W.cjs');
|
|
4
4
|
var chunkANLO4VM2_cjs = require('../chunk-ANLO4VM2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Agent", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkGFBH7Q4W_cjs.Agent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TripWire", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkGFBH7Q4W_cjs.TripWire; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "isSupportedLanguageModel", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkGFBH7Q4W_cjs.isSupportedLanguageModel; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "resolveThreadIdFromArgs", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkGFBH7Q4W_cjs.resolveThreadIdFromArgs; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "supportedLanguageModelSpecifications", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkGFBH7Q4W_cjs.supportedLanguageModelSpecifications; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "tryGenerateWithJsonFallback", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkGFBH7Q4W_cjs.tryGenerateWithJsonFallback; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "tryStreamWithJsonFallback", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkGFBH7Q4W_cjs.tryStreamWithJsonFallback; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "MessageList", {
|
|
37
37
|
enumerable: true,
|
package/dist/agent/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Agent, TripWire, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-
|
|
1
|
+
export { Agent, TripWire, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-3U4ZNZIF.js';
|
|
2
2
|
export { MessageList, TypeDetector, aiV5ModelMessageToV2PromptMessage, convertMessages } from '../chunk-SLZ3WO42.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkJFPVUKPB_cjs = require('./chunk-JFPVUKPB.cjs');
|
|
4
|
+
var chunkZ3VUDCXI_cjs = require('./chunk-Z3VUDCXI.cjs');
|
|
5
|
+
var chunkPQWEJELD_cjs = require('./chunk-PQWEJELD.cjs');
|
|
6
|
+
var chunkUPCNNWXW_cjs = require('./chunk-UPCNNWXW.cjs');
|
|
7
|
+
var chunkGFBH7Q4W_cjs = require('./chunk-GFBH7Q4W.cjs');
|
|
8
8
|
var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
|
|
9
9
|
var chunk6BJ7XHRH_cjs = require('./chunk-6BJ7XHRH.cjs');
|
|
10
|
+
var chunk2VD5OGOT_cjs = require('./chunk-2VD5OGOT.cjs');
|
|
10
11
|
var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
|
|
11
12
|
var chunkG5HKDGNT_cjs = require('./chunk-G5HKDGNT.cjs');
|
|
12
13
|
var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
|
|
13
|
-
var chunk2VD5OGOT_cjs = require('./chunk-2VD5OGOT.cjs');
|
|
14
14
|
var chunk7XAECHYL_cjs = require('./chunk-7XAECHYL.cjs');
|
|
15
15
|
var crypto = require('crypto');
|
|
16
16
|
|
|
@@ -67,7 +67,7 @@ var Mastra = class {
|
|
|
67
67
|
}
|
|
68
68
|
get datasets() {
|
|
69
69
|
if (!this.#datasets) {
|
|
70
|
-
this.#datasets = new
|
|
70
|
+
this.#datasets = new chunkPQWEJELD_cjs.DatasetsManager(this);
|
|
71
71
|
}
|
|
72
72
|
return this.#datasets;
|
|
73
73
|
}
|
|
@@ -243,7 +243,7 @@ var Mastra = class {
|
|
|
243
243
|
this.#events[topic] = config?.events?.[topic] ?? [];
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
const workflowEventProcessor = new
|
|
246
|
+
const workflowEventProcessor = new chunkJFPVUKPB_cjs.WorkflowEventProcessor({ mastra: this });
|
|
247
247
|
const workflowEventCb = async (event, cb) => {
|
|
248
248
|
try {
|
|
249
249
|
await workflowEventProcessor.process(event, cb);
|
|
@@ -271,7 +271,7 @@ var Mastra = class {
|
|
|
271
271
|
this.#idGenerator = config?.idGenerator;
|
|
272
272
|
let storage = config?.storage;
|
|
273
273
|
if (storage) {
|
|
274
|
-
storage =
|
|
274
|
+
storage = chunkGFBH7Q4W_cjs.augmentWithInit(storage);
|
|
275
275
|
}
|
|
276
276
|
if (config?.observability) {
|
|
277
277
|
if (typeof config.observability.getDefaultInstance === "function") {
|
|
@@ -374,7 +374,7 @@ var Mastra = class {
|
|
|
374
374
|
if (config?.server) {
|
|
375
375
|
this.#server = config.server;
|
|
376
376
|
}
|
|
377
|
-
chunkMR7ZWBL6_cjs.registerHook("onScorerRun" /* ON_SCORER_RUN */,
|
|
377
|
+
chunkMR7ZWBL6_cjs.registerHook("onScorerRun" /* ON_SCORER_RUN */, chunkUPCNNWXW_cjs.createOnScorerHook(this));
|
|
378
378
|
this.#observability.setMastraContext({ mastra: this });
|
|
379
379
|
this.setLogger({ logger });
|
|
380
380
|
}
|
|
@@ -518,8 +518,8 @@ var Mastra = class {
|
|
|
518
518
|
throw createUndefinedPrimitiveError("agent", agent, key);
|
|
519
519
|
}
|
|
520
520
|
let mastraAgent;
|
|
521
|
-
if (
|
|
522
|
-
mastraAgent =
|
|
521
|
+
if (chunkZ3VUDCXI_cjs.isToolLoopAgentLike(agent)) {
|
|
522
|
+
mastraAgent = chunkZ3VUDCXI_cjs.toolLoopAgentToMastraAgent(agent, { fallbackName: key });
|
|
523
523
|
} else {
|
|
524
524
|
mastraAgent = agent;
|
|
525
525
|
}
|
|
@@ -1863,7 +1863,7 @@ var Mastra = class {
|
|
|
1863
1863
|
* ```
|
|
1864
1864
|
*/
|
|
1865
1865
|
setStorage(storage) {
|
|
1866
|
-
this.#storage =
|
|
1866
|
+
this.#storage = chunkGFBH7Q4W_cjs.augmentWithInit(storage);
|
|
1867
1867
|
}
|
|
1868
1868
|
setLogger({ logger }) {
|
|
1869
1869
|
this.#logger = logger;
|
|
@@ -2556,7 +2556,7 @@ var Mastra = class {
|
|
|
2556
2556
|
if (process.env.MASTRA_DEV !== "true" && process.env.MASTRA_DEV !== "1") {
|
|
2557
2557
|
return;
|
|
2558
2558
|
}
|
|
2559
|
-
import('./provider-registry-
|
|
2559
|
+
import('./provider-registry-65CPGTUU.cjs').then(async ({ GatewayRegistry }) => {
|
|
2560
2560
|
const registry = GatewayRegistry.getInstance();
|
|
2561
2561
|
const customGateways = Object.values(this.#gateways || {});
|
|
2562
2562
|
registry.registerCustomGateways(customGateways);
|
|
@@ -2610,5 +2610,5 @@ var Mastra = class {
|
|
|
2610
2610
|
};
|
|
2611
2611
|
|
|
2612
2612
|
exports.Mastra = Mastra;
|
|
2613
|
-
//# sourceMappingURL=chunk-
|
|
2614
|
-
//# sourceMappingURL=chunk-
|
|
2613
|
+
//# sourceMappingURL=chunk-2U4M4SGY.cjs.map
|
|
2614
|
+
//# sourceMappingURL=chunk-2U4M4SGY.cjs.map
|