@mastra/core 0.21.0-alpha.4 → 0.21.0

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/dist/agent/index.cjs +10 -10
  3. package/dist/agent/index.js +1 -1
  4. package/dist/agent/input-processor/index.cjs +6 -6
  5. package/dist/agent/input-processor/index.js +1 -1
  6. package/dist/{chunk-M5UZ5L2K.js → chunk-3Q5AADIA.js} +3 -3
  7. package/dist/{chunk-M5UZ5L2K.js.map → chunk-3Q5AADIA.js.map} +1 -1
  8. package/dist/{chunk-RUNIHHTE.cjs → chunk-AJQHJNNW.cjs} +4 -4
  9. package/dist/{chunk-RUNIHHTE.cjs.map → chunk-AJQHJNNW.cjs.map} +1 -1
  10. package/dist/{chunk-KPHSB5PY.cjs → chunk-AVKWVYFN.cjs} +9 -9
  11. package/dist/{chunk-KPHSB5PY.cjs.map → chunk-AVKWVYFN.cjs.map} +1 -1
  12. package/dist/{chunk-QH7ARYBH.cjs → chunk-BBNBATLR.cjs} +4 -4
  13. package/dist/{chunk-QH7ARYBH.cjs.map → chunk-BBNBATLR.cjs.map} +1 -1
  14. package/dist/{chunk-6DNMAUFF.cjs → chunk-HOPRWFM3.cjs} +12 -12
  15. package/dist/{chunk-6DNMAUFF.cjs.map → chunk-HOPRWFM3.cjs.map} +1 -1
  16. package/dist/{chunk-SSSO34FY.js → chunk-MUBNGSAO.js} +3 -3
  17. package/dist/{chunk-SSSO34FY.js.map → chunk-MUBNGSAO.js.map} +1 -1
  18. package/dist/{chunk-6RNCHW2T.js → chunk-R37WYGEC.js} +3 -3
  19. package/dist/{chunk-6RNCHW2T.js.map → chunk-R37WYGEC.js.map} +1 -1
  20. package/dist/{chunk-CFEX6REJ.js → chunk-T4MYULBA.js} +3 -3
  21. package/dist/{chunk-CFEX6REJ.js.map → chunk-T4MYULBA.js.map} +1 -1
  22. package/dist/{chunk-PKCDN5RQ.js → chunk-UMLRW5Y3.js} +3 -3
  23. package/dist/{chunk-PKCDN5RQ.js.map → chunk-UMLRW5Y3.js.map} +1 -1
  24. package/dist/{chunk-DY7TLQOJ.cjs → chunk-VLJO4NT4.cjs} +3 -3
  25. package/dist/{chunk-DY7TLQOJ.cjs.map → chunk-VLJO4NT4.cjs.map} +1 -1
  26. package/dist/index.cjs +19 -19
  27. package/dist/index.js +4 -4
  28. package/dist/loop/index.cjs +2 -2
  29. package/dist/loop/index.js +1 -1
  30. package/dist/mastra/index.cjs +2 -2
  31. package/dist/mastra/index.js +1 -1
  32. package/dist/processors/index.cjs +11 -11
  33. package/dist/processors/index.js +1 -1
  34. package/dist/relevance/index.cjs +4 -4
  35. package/dist/relevance/index.js +1 -1
  36. package/dist/scores/index.cjs +4 -4
  37. package/dist/scores/index.js +1 -1
  38. package/dist/scores/scoreTraces/index.cjs +3 -3
  39. package/dist/scores/scoreTraces/index.js +1 -1
  40. package/dist/stream/index.cjs +7 -7
  41. package/dist/stream/index.js +1 -1
  42. package/dist/workflows/evented/index.cjs +10 -10
  43. package/dist/workflows/evented/index.js +1 -1
  44. package/dist/workflows/index.cjs +12 -12
  45. package/dist/workflows/index.js +1 -1
  46. package/dist/workflows/legacy/index.cjs +22 -22
  47. package/dist/workflows/legacy/index.js +1 -1
  48. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,100 @@
1
1
  # @mastra/core
2
2
 
3
+ ## 0.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Standardize model configuration across all Mastra components ([#8626](https://github.com/mastra-ai/mastra/pull/8626))
8
+
9
+ All model configuration points now accept the same flexible `MastraModelConfig` type as the `Agent` class:
10
+ - **Scorers**: Judge models now support magic strings, config objects, and dynamic functions
11
+ - **Input/Output Processors**: ModerationProcessor and PIIDetector accept flexible model configs
12
+ - **Relevance Scorers**: MastraAgentRelevanceScorer supports all model config types
13
+
14
+ This change provides:
15
+ - Consistent API across all components
16
+ - Support for magic strings (e.g., `"openai/gpt-4o"`)
17
+ - Support for OpenAI-compatible configs with custom URLs
18
+ - Support for dynamic model resolution functions
19
+ - Full backward compatibility with existing code
20
+
21
+ Example:
22
+
23
+ ```typescript
24
+ // All of these now work everywhere models are accepted
25
+ const scorer = createScorer({
26
+ judge: { model: 'openai/gpt-4o' }, // Magic string
27
+ });
28
+
29
+ const processor = new ModerationProcessor({
30
+ model: { id: 'custom/model', url: 'https://...' }, // Custom config
31
+ });
32
+
33
+ const relevanceScorer = new MastraAgentRelevanceScorer(
34
+ async ctx => ctx.getModel(), // Dynamic function
35
+ );
36
+ ```
37
+
38
+ - support model router in structured output and client-js ([#8686](https://github.com/mastra-ai/mastra/pull/8686))
39
+
40
+ - Update structuredOutput to use response format by default with an opt in to json prompt injection. ([#8557](https://github.com/mastra-ai/mastra/pull/8557))
41
+ Replaced internal usage of output with structuredOutput.
42
+
43
+ - Standardize model configuration across all components to support flexible model resolution ([#8626](https://github.com/mastra-ai/mastra/pull/8626))
44
+
45
+ All model configuration points now accept `MastraModelConfig`, enabling consistent model specification across:
46
+ - Scorers (`createScorer` and all built-in scorers)
47
+ - Input/Output Processors (`ModerationProcessor`, `PIIDetector`)
48
+ - Relevance Scorers (`MastraAgentRelevanceScorer`)
49
+
50
+ **Supported formats:**
51
+ - Magic strings: `'openai/gpt-4o-mini'`
52
+ - Config objects: `{ id: 'openai/gpt-4o-mini' }` or `{ providerId: 'openai', modelId: 'gpt-4o-mini' }`
53
+ - Custom endpoints: `{ id: 'custom/model', url: 'https://...', apiKey: '...' }`
54
+ - Dynamic resolution: `(ctx) => 'openai/gpt-4o-mini'`
55
+
56
+ This change provides a unified model configuration experience matching the `Agent` class, making it easier to switch models and use custom providers across all Mastra components.
57
+
58
+ ### Patch Changes
59
+
60
+ - Fix aisdk format in workflow breaking stream ([#8716](https://github.com/mastra-ai/mastra/pull/8716))
61
+
62
+ - fix: preserve providerOptions through message list conversions ([#8837](https://github.com/mastra-ai/mastra/pull/8837))
63
+
64
+ - improve error propagation in agent stream failures ([#8733](https://github.com/mastra-ai/mastra/pull/8733))
65
+
66
+ - prevent duplicate deprecation warning logs and deprecate modelSettings.abortSignal in favor of top-level abortSignal ([#8840](https://github.com/mastra-ai/mastra/pull/8840))
67
+
68
+ - Removed logging of massive model objects in tool failures ([#8839](https://github.com/mastra-ai/mastra/pull/8839))
69
+
70
+ - Create unified Sidebar component to use on Playground and Cloud ([#8655](https://github.com/mastra-ai/mastra/pull/8655))
71
+
72
+ - Added tracing of input & output processors (this includes using structuredOutput) ([#8623](https://github.com/mastra-ai/mastra/pull/8623))
73
+
74
+ - ai-sdk workflow route, agent network route ([#8672](https://github.com/mastra-ai/mastra/pull/8672))
75
+
76
+ - Handle maxRetries in agent.generate/stream properly. Add deprecation warning to top level abortSignal in AgentExecuteOptions as that property is duplicated inside of modelSettings as well. ([#8729](https://github.com/mastra-ai/mastra/pull/8729))
77
+
78
+ - Include span id and trace id when running live scorers ([#8842](https://github.com/mastra-ai/mastra/pull/8842))
79
+
80
+ - Added deprecation warnings for stream and observeStream. We will switch the implementation to streamVNext/observeStreamVNext in the future. ([#8701](https://github.com/mastra-ai/mastra/pull/8701))
81
+
82
+ - Add div wrapper around entity tables to fix table vertical position ([#8758](https://github.com/mastra-ai/mastra/pull/8758))
83
+
84
+ - Customize AITraces type to seamlessly work on Cloud too ([#8759](https://github.com/mastra-ai/mastra/pull/8759))
85
+
86
+ - Refactor EntryList component and Scorer and Observability pages ([#8652](https://github.com/mastra-ai/mastra/pull/8652))
87
+
88
+ - Add support for exporting scores for external observability providers ([#8335](https://github.com/mastra-ai/mastra/pull/8335))
89
+
90
+ - Stream finalResult from network loop ([#8795](https://github.com/mastra-ai/mastra/pull/8795))
91
+
92
+ - Fix broken `generateTitle` behaviour #8726, make `generateTitle: true` default memory setting ([#8800](https://github.com/mastra-ai/mastra/pull/8800))
93
+
94
+ - Improve README ([#8819](https://github.com/mastra-ai/mastra/pull/8819))
95
+
96
+ - nested ai-sdk workflows and networks streaming support ([#8614](https://github.com/mastra-ai/mastra/pull/8614))
97
+
3
98
  ## 0.21.0-alpha.4
4
99
 
5
100
  ### Patch Changes
@@ -1,45 +1,45 @@
1
1
  'use strict';
2
2
 
3
- var chunkDY7TLQOJ_cjs = require('../chunk-DY7TLQOJ.cjs');
3
+ var chunkVLJO4NT4_cjs = require('../chunk-VLJO4NT4.cjs');
4
4
  var chunkG4GBV44L_cjs = require('../chunk-G4GBV44L.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Agent", {
9
9
  enumerable: true,
10
- get: function () { return chunkDY7TLQOJ_cjs.Agent; }
10
+ get: function () { return chunkVLJO4NT4_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "LanguageDetectorInputProcessor", {
13
13
  enumerable: true,
14
- get: function () { return chunkDY7TLQOJ_cjs.LanguageDetectorInputProcessor; }
14
+ get: function () { return chunkVLJO4NT4_cjs.LanguageDetectorInputProcessor; }
15
15
  });
16
16
  Object.defineProperty(exports, "ModerationInputProcessor", {
17
17
  enumerable: true,
18
- get: function () { return chunkDY7TLQOJ_cjs.ModerationInputProcessor; }
18
+ get: function () { return chunkVLJO4NT4_cjs.ModerationInputProcessor; }
19
19
  });
20
20
  Object.defineProperty(exports, "PIIDetectorInputProcessor", {
21
21
  enumerable: true,
22
- get: function () { return chunkDY7TLQOJ_cjs.PIIDetectorInputProcessor; }
22
+ get: function () { return chunkVLJO4NT4_cjs.PIIDetectorInputProcessor; }
23
23
  });
24
24
  Object.defineProperty(exports, "PromptInjectionDetectorInputProcessor", {
25
25
  enumerable: true,
26
- get: function () { return chunkDY7TLQOJ_cjs.PromptInjectionDetectorInputProcessor; }
26
+ get: function () { return chunkVLJO4NT4_cjs.PromptInjectionDetectorInputProcessor; }
27
27
  });
28
28
  Object.defineProperty(exports, "TripWire", {
29
29
  enumerable: true,
30
- get: function () { return chunkDY7TLQOJ_cjs.TripWire; }
30
+ get: function () { return chunkVLJO4NT4_cjs.TripWire; }
31
31
  });
32
32
  Object.defineProperty(exports, "UnicodeNormalizerInputProcessor", {
33
33
  enumerable: true,
34
- get: function () { return chunkDY7TLQOJ_cjs.UnicodeNormalizerInputProcessor; }
34
+ get: function () { return chunkVLJO4NT4_cjs.UnicodeNormalizerInputProcessor; }
35
35
  });
36
36
  Object.defineProperty(exports, "tryGenerateWithJsonFallback", {
37
37
  enumerable: true,
38
- get: function () { return chunkDY7TLQOJ_cjs.tryGenerateWithJsonFallback; }
38
+ get: function () { return chunkVLJO4NT4_cjs.tryGenerateWithJsonFallback; }
39
39
  });
40
40
  Object.defineProperty(exports, "tryStreamWithJsonFallback", {
41
41
  enumerable: true,
42
- get: function () { return chunkDY7TLQOJ_cjs.tryStreamWithJsonFallback; }
42
+ get: function () { return chunkVLJO4NT4_cjs.tryStreamWithJsonFallback; }
43
43
  });
44
44
  Object.defineProperty(exports, "MessageList", {
45
45
  enumerable: true,
@@ -1,4 +1,4 @@
1
- export { Agent, LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, TripWire, UnicodeNormalizerInputProcessor, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-PKCDN5RQ.js';
1
+ export { Agent, LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, TripWire, UnicodeNormalizerInputProcessor, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-UMLRW5Y3.js';
2
2
  export { MessageList, convertMessages } from '../chunk-2KES233Q.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,28 +1,28 @@
1
1
  'use strict';
2
2
 
3
- var chunkDY7TLQOJ_cjs = require('../../chunk-DY7TLQOJ.cjs');
3
+ var chunkVLJO4NT4_cjs = require('../../chunk-VLJO4NT4.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "LanguageDetectorInputProcessor", {
8
8
  enumerable: true,
9
- get: function () { return chunkDY7TLQOJ_cjs.LanguageDetectorInputProcessor; }
9
+ get: function () { return chunkVLJO4NT4_cjs.LanguageDetectorInputProcessor; }
10
10
  });
11
11
  Object.defineProperty(exports, "ModerationInputProcessor", {
12
12
  enumerable: true,
13
- get: function () { return chunkDY7TLQOJ_cjs.ModerationInputProcessor; }
13
+ get: function () { return chunkVLJO4NT4_cjs.ModerationInputProcessor; }
14
14
  });
15
15
  Object.defineProperty(exports, "PIIDetectorInputProcessor", {
16
16
  enumerable: true,
17
- get: function () { return chunkDY7TLQOJ_cjs.PIIDetectorInputProcessor; }
17
+ get: function () { return chunkVLJO4NT4_cjs.PIIDetectorInputProcessor; }
18
18
  });
19
19
  Object.defineProperty(exports, "PromptInjectionDetectorInputProcessor", {
20
20
  enumerable: true,
21
- get: function () { return chunkDY7TLQOJ_cjs.PromptInjectionDetectorInputProcessor; }
21
+ get: function () { return chunkVLJO4NT4_cjs.PromptInjectionDetectorInputProcessor; }
22
22
  });
23
23
  Object.defineProperty(exports, "UnicodeNormalizerInputProcessor", {
24
24
  enumerable: true,
25
- get: function () { return chunkDY7TLQOJ_cjs.UnicodeNormalizerInputProcessor; }
25
+ get: function () { return chunkVLJO4NT4_cjs.UnicodeNormalizerInputProcessor; }
26
26
  });
27
27
  //# sourceMappingURL=index.cjs.map
28
28
  //# sourceMappingURL=index.cjs.map
@@ -1,3 +1,3 @@
1
- export { LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, UnicodeNormalizerInputProcessor } from '../../chunk-PKCDN5RQ.js';
1
+ export { LanguageDetectorInputProcessor, ModerationInputProcessor, PIIDetectorInputProcessor, PromptInjectionDetectorInputProcessor, UnicodeNormalizerInputProcessor } from '../../chunk-UMLRW5Y3.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { WorkflowEventProcessor } from './chunk-6RNCHW2T.js';
1
+ import { WorkflowEventProcessor } from './chunk-R37WYGEC.js';
2
2
  import { saveScorePayloadSchema } from './chunk-U5JW6KRX.js';
3
3
  import { augmentWithInit } from './chunk-436FFEF6.js';
4
4
  import { PubSub } from './chunk-BVUMKER5.js';
@@ -1644,5 +1644,5 @@ Mastra = /*@__PURE__*/(_ => {
1644
1644
  })();
1645
1645
 
1646
1646
  export { Mastra };
1647
- //# sourceMappingURL=chunk-M5UZ5L2K.js.map
1648
- //# sourceMappingURL=chunk-M5UZ5L2K.js.map
1647
+ //# sourceMappingURL=chunk-3Q5AADIA.js.map
1648
+ //# sourceMappingURL=chunk-3Q5AADIA.js.map