@mastra/core 1.15.0-alpha.4 → 1.15.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 (107) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/agent/index.cjs +8 -8
  3. package/dist/agent/index.js +1 -1
  4. package/dist/{chunk-ZFVANSSN.cjs → chunk-2YN2UNSQ.cjs} +6 -6
  5. package/dist/{chunk-ZFVANSSN.cjs.map → chunk-2YN2UNSQ.cjs.map} +1 -1
  6. package/dist/{chunk-BJYSPRTD.js → chunk-3A2WQ6XL.js} +3 -3
  7. package/dist/{chunk-BJYSPRTD.js.map → chunk-3A2WQ6XL.js.map} +1 -1
  8. package/dist/{chunk-FRPV7F7E.cjs → chunk-5JO4UOHA.cjs} +185 -185
  9. package/dist/{chunk-FRPV7F7E.cjs.map → chunk-5JO4UOHA.cjs.map} +1 -1
  10. package/dist/{chunk-OY45D5N5.js → chunk-6JLJTBF7.js} +3 -3
  11. package/dist/chunk-6JLJTBF7.js.map +1 -0
  12. package/dist/{chunk-65K5KHEQ.cjs → chunk-BVFFFLMD.cjs} +7 -7
  13. package/dist/{chunk-65K5KHEQ.cjs.map → chunk-BVFFFLMD.cjs.map} +1 -1
  14. package/dist/{chunk-NI24OP2N.cjs → chunk-BXSSIONK.cjs} +12 -12
  15. package/dist/{chunk-NI24OP2N.cjs.map → chunk-BXSSIONK.cjs.map} +1 -1
  16. package/dist/{chunk-PDAZKZWB.cjs → chunk-EB6WWMRH.cjs} +3 -3
  17. package/dist/chunk-EB6WWMRH.cjs.map +1 -0
  18. package/dist/{chunk-GU6MTO2I.js → chunk-EHC3R2MJ.js} +3 -3
  19. package/dist/{chunk-GU6MTO2I.js.map → chunk-EHC3R2MJ.js.map} +1 -1
  20. package/dist/{chunk-CGQ7ENXU.js → chunk-H4QQ6U2N.js} +7 -7
  21. package/dist/{chunk-CGQ7ENXU.js.map → chunk-H4QQ6U2N.js.map} +1 -1
  22. package/dist/{chunk-NYOTRFJQ.js → chunk-JEAJVWXB.js} +10 -10
  23. package/dist/{chunk-NYOTRFJQ.js.map → chunk-JEAJVWXB.js.map} +1 -1
  24. package/dist/{chunk-DIMION2S.cjs → chunk-NI5Q26SA.cjs} +10 -10
  25. package/dist/{chunk-DIMION2S.cjs.map → chunk-NI5Q26SA.cjs.map} +1 -1
  26. package/dist/{chunk-W7I3FI2N.cjs → chunk-P2PWEGRW.cjs} +76 -76
  27. package/dist/{chunk-W7I3FI2N.cjs.map → chunk-P2PWEGRW.cjs.map} +1 -1
  28. package/dist/{chunk-ERY767HB.js → chunk-P4GCK6VL.js} +4 -4
  29. package/dist/{chunk-ERY767HB.js.map → chunk-P4GCK6VL.js.map} +1 -1
  30. package/dist/{chunk-ELXO2ZGY.cjs → chunk-PJTQ3KPM.cjs} +48 -48
  31. package/dist/{chunk-ELXO2ZGY.cjs.map → chunk-PJTQ3KPM.cjs.map} +1 -1
  32. package/dist/{chunk-XQHRNOOO.cjs → chunk-Q37F6PBO.cjs} +17 -17
  33. package/dist/{chunk-XQHRNOOO.cjs.map → chunk-Q37F6PBO.cjs.map} +1 -1
  34. package/dist/{chunk-LVA4AOT3.js → chunk-RTQZRDV7.js} +8 -4
  35. package/dist/chunk-RTQZRDV7.js.map +1 -0
  36. package/dist/{chunk-ALQKGV35.js → chunk-SEXK27FJ.js} +3 -3
  37. package/dist/{chunk-ALQKGV35.js.map → chunk-SEXK27FJ.js.map} +1 -1
  38. package/dist/{chunk-VZWFITNF.cjs → chunk-U37AM3YI.cjs} +5 -5
  39. package/dist/{chunk-VZWFITNF.cjs.map → chunk-U37AM3YI.cjs.map} +1 -1
  40. package/dist/{chunk-MJKEBUMM.js → chunk-WAPASC33.js} +4 -4
  41. package/dist/{chunk-MJKEBUMM.js.map → chunk-WAPASC33.js.map} +1 -1
  42. package/dist/{chunk-6EG7YHGD.js → chunk-WRHDZMKQ.js} +4 -4
  43. package/dist/{chunk-6EG7YHGD.js.map → chunk-WRHDZMKQ.js.map} +1 -1
  44. package/dist/{chunk-CK5R5ZNR.cjs → chunk-XIQD3JK4.cjs} +9 -5
  45. package/dist/chunk-XIQD3JK4.cjs.map +1 -0
  46. package/dist/{chunk-U3ZKCVTO.js → chunk-Z6IJWMIL.js} +4 -4
  47. package/dist/{chunk-U3ZKCVTO.js.map → chunk-Z6IJWMIL.js.map} +1 -1
  48. package/dist/datasets/index.cjs +11 -11
  49. package/dist/datasets/index.js +1 -1
  50. package/dist/docs/SKILL.md +1 -1
  51. package/dist/docs/assets/SOURCE_MAP.json +121 -121
  52. package/dist/evals/index.cjs +5 -5
  53. package/dist/evals/index.js +2 -2
  54. package/dist/evals/scoreTraces/index.cjs +3 -3
  55. package/dist/evals/scoreTraces/index.js +1 -1
  56. package/dist/harness/index.cjs +7 -7
  57. package/dist/harness/index.js +5 -5
  58. package/dist/index.cjs +2 -2
  59. package/dist/index.js +1 -1
  60. package/dist/llm/index.cjs +16 -16
  61. package/dist/llm/index.js +5 -5
  62. package/dist/llm/model/provider-types.generated.d.ts +2 -0
  63. package/dist/loop/index.cjs +14 -14
  64. package/dist/loop/index.js +1 -1
  65. package/dist/mastra/index.cjs +2 -2
  66. package/dist/mastra/index.js +1 -1
  67. package/dist/memory/index.cjs +14 -14
  68. package/dist/memory/index.js +1 -1
  69. package/dist/models-dev-MYQ5DG6M.js +3 -0
  70. package/dist/{models-dev-WCXTFBNF.js.map → models-dev-MYQ5DG6M.js.map} +1 -1
  71. package/dist/models-dev-U7CZOMQF.cjs +12 -0
  72. package/dist/{models-dev-DJ7R4TZH.cjs.map → models-dev-U7CZOMQF.cjs.map} +1 -1
  73. package/dist/netlify-GCMZMVMD.cjs +12 -0
  74. package/dist/{netlify-YEHOZHML.cjs.map → netlify-GCMZMVMD.cjs.map} +1 -1
  75. package/dist/netlify-MUGFMWEG.js +3 -0
  76. package/dist/{netlify-NMYNMNGY.js.map → netlify-MUGFMWEG.js.map} +1 -1
  77. package/dist/processor-provider/index.cjs +10 -10
  78. package/dist/processor-provider/index.js +1 -1
  79. package/dist/processors/index.cjs +42 -42
  80. package/dist/processors/index.js +1 -1
  81. package/dist/provider-registry-3BGGCZ2Y.js +3 -0
  82. package/dist/{provider-registry-S7PSD7QK.js.map → provider-registry-3BGGCZ2Y.js.map} +1 -1
  83. package/dist/provider-registry-QXHI4DMY.cjs +40 -0
  84. package/dist/{provider-registry-7QEVAVHF.cjs.map → provider-registry-QXHI4DMY.cjs.map} +1 -1
  85. package/dist/provider-registry.json +4 -0
  86. package/dist/relevance/index.cjs +3 -3
  87. package/dist/relevance/index.js +1 -1
  88. package/dist/stream/index.cjs +8 -8
  89. package/dist/stream/index.js +1 -1
  90. package/dist/tool-loop-agent/index.cjs +4 -4
  91. package/dist/tool-loop-agent/index.js +1 -1
  92. package/dist/workflows/evented/index.cjs +10 -10
  93. package/dist/workflows/evented/index.js +1 -1
  94. package/dist/workflows/index.cjs +24 -24
  95. package/dist/workflows/index.js +1 -1
  96. package/package.json +10 -10
  97. package/src/llm/model/provider-types.generated.d.ts +2 -0
  98. package/dist/chunk-CK5R5ZNR.cjs.map +0 -1
  99. package/dist/chunk-LVA4AOT3.js.map +0 -1
  100. package/dist/chunk-OY45D5N5.js.map +0 -1
  101. package/dist/chunk-PDAZKZWB.cjs.map +0 -1
  102. package/dist/models-dev-DJ7R4TZH.cjs +0 -12
  103. package/dist/models-dev-WCXTFBNF.js +0 -3
  104. package/dist/netlify-NMYNMNGY.js +0 -3
  105. package/dist/netlify-YEHOZHML.cjs +0 -12
  106. package/dist/provider-registry-7QEVAVHF.cjs +0 -40
  107. package/dist/provider-registry-S7PSD7QK.js +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,101 @@
1
1
  # @mastra/core
2
2
 
3
+ ## 1.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `server.studioHost`, `server.studioProtocol`, and `server.studioPort` options for Studio in cloud deployments ([#12899](https://github.com/mastra-ai/mastra/pull/12899))
8
+
9
+ When deploying to cloud environments (e.g., Google Cloud Run), `server.host` must be `0.0.0.0` for the container to accept traffic, and the internal port often differs from the external one (e.g., 8080 internally vs 443 externally). Studio needs the actual public domain, protocol, and port to make API calls from the browser. These new options decouple the server bind configuration from the Studio API URL.
10
+
11
+ ```typescript
12
+ export const mastra = new Mastra({
13
+ server: {
14
+ host: '0.0.0.0',
15
+ port: 8080,
16
+ studioHost: 'my-app.run.app',
17
+ studioProtocol: 'https',
18
+ studioPort: 443,
19
+ },
20
+ });
21
+ ```
22
+
23
+ All three options are optional and fall back to existing behavior when not set.
24
+
25
+ - Added filesystem-level optimistic concurrency for file writes. When `expectedMtime` is provided in `WriteOptions`, the write will be rejected with a `StaleFileError` if the file was modified externally since it was last read. This provides defense-in-depth against external modifications (e.g., LSP-based editors) that occur between the tool-level mtime check and the actual write. ([#14354](https://github.com/mastra-ai/mastra/pull/14354))
26
+
27
+ **New `expectedMtime` option on `WriteOptions`**
28
+
29
+ Any caller of `filesystem.writeFile()` can now opt into optimistic concurrency:
30
+
31
+ ```ts
32
+ // Read a file and capture its mtime
33
+ const stat = await filesystem.stat('config.json');
34
+ const content = await filesystem.readFile('config.json');
35
+
36
+ // Later, write with mtime guard — fails if file changed externally
37
+ await filesystem.writeFile('config.json', newContent, {
38
+ overwrite: true,
39
+ expectedMtime: stat.modifiedAt,
40
+ });
41
+ ```
42
+
43
+ If the file was modified between the read and write, a `StaleFileError` is thrown instead of silently overwriting.
44
+
45
+ **Automatic mtime pass-through for workspace tools**
46
+
47
+ When `requireReadBeforeWrite` is enabled, the `edit_file`, `write_file`, and `ast_edit` tools now automatically pass the recorded mtime through to the filesystem layer, providing a second line of defense beyond the existing tool-level read tracker check.
48
+
49
+ ### Patch Changes
50
+
51
+ - Update provider registry and model documentation with latest models and providers ([`cb611a1`](https://github.com/mastra-ai/mastra/commit/cb611a1e89a4f4cf74c97b57e0c27bb56f2eceb5))
52
+
53
+ - Added experimental retrieval-mode recall tooling for observational memory. ([#14437](https://github.com/mastra-ai/mastra/pull/14437))
54
+
55
+ When `observationalMemory.retrieval` is enabled with `scope: 'thread'`, observation groups store colon-delimited message ranges (`startId:endId`) pointing back to the raw messages they were derived from. A `recall` tool is registered that lets agents retrieve those source messages via cursor-based pagination.
56
+
57
+ The recall tool supports:
58
+ - **Detail levels**: `detail: 'low'` (default) returns truncated text with part indices; `detail: 'high'` returns full content clamped to one part per call with continuation hints
59
+ - **Part-level fetch**: `partIndex` targets a single message part at full detail
60
+ - **Pagination flags**: `hasNextPage` and `hasPrevPage` in results
61
+ - **Token limiting**: results are capped at a token budget with `truncated` and `tokenOffset` reporting
62
+ - **Smart range detection**: passing a range as a cursor returns a helpful hint explaining how to extract individual IDs
63
+
64
+ - Fixed agent.stream() so the returned spanId matches the top-level agent run span instead of the nested model span. ([#14447](https://github.com/mastra-ai/mastra/pull/14447))
65
+
66
+ - Fixed deserializeRequestContext to return an actual RequestContext instance instead of a Map, preventing crashes during Inngest durable execution replay with observability enabled. ([#14442](https://github.com/mastra-ai/mastra/pull/14442))
67
+
68
+ - Fixed trace context propagation in evented workflow steps and processors. Operations started inside those steps now appear under the correct parent in distributed traces. ([#14455](https://github.com/mastra-ai/mastra/pull/14455))
69
+
70
+ - Fix OTEL context propagation in workflow step execution. Wrapping `step.execute()` in `executeWithContext` ensures auto-instrumented code inside a step (e.g. AI SDK spans) is correctly nested under the workflow step span rather than appearing as siblings. ([#13755](https://github.com/mastra-ai/mastra/pull/13755))
71
+
72
+ - Added opt-in Observational Memory thread titles. ([#14436](https://github.com/mastra-ai/mastra/pull/14436))
73
+
74
+ When enabled, the Observer suggests a short thread title and updates it as the conversation topic changes. Harness consumers can detect these updates via the new `om_thread_title_updated` event.
75
+
76
+ **Example**
77
+
78
+ ```ts
79
+ const memory = new Memory({
80
+ options: {
81
+ observationalMemory: {
82
+ observation: {
83
+ threadTitle: true,
84
+ },
85
+ },
86
+ },
87
+ });
88
+ ```
89
+
90
+ - Added version query parameters to GET /api/agents/:agentId endpoint. Code-defined agents can now be resolved with specific stored config versions using ?status=draft (latest, default), ?status=published (active version), or ?versionId=<id> (specific version). ([#14156](https://github.com/mastra-ai/mastra/pull/14156))
91
+
92
+ - Fixed generation span output to include tool call data, enabling PostHog's LLM Analytics Tools tab to extract and display tool usage ([#14383](https://github.com/mastra-ai/mastra/pull/14383))
93
+
94
+ - Fixed a bug where workflow-based processor execution would pass null stream parts to subsequent processors. When a processor's processOutputStream returns null (e.g., a guardrail filtering a part), the next processor in the chain would receive null as the part, causing potential errors. The null guard now matches the inline processor path behavior, skipping processors when the part is null. ([#14514](https://github.com/mastra-ai/mastra/pull/14514))
95
+
96
+ - Updated dependencies [[`b71bce1`](https://github.com/mastra-ai/mastra/commit/b71bce144912ed33f76c52a94e594988a649c3e1), [`cd7b568`](https://github.com/mastra-ai/mastra/commit/cd7b568fe427b1b4838abe744fa5367a47539db3)]:
97
+ - @mastra/schema-compat@1.2.6
98
+
3
99
  ## 1.15.0-alpha.4
4
100
 
5
101
  ### Patch Changes
@@ -1,37 +1,37 @@
1
1
  'use strict';
2
2
 
3
- var chunkNI24OP2N_cjs = require('../chunk-NI24OP2N.cjs');
3
+ var chunkBXSSIONK_cjs = require('../chunk-BXSSIONK.cjs');
4
4
  var chunkO6O5MD7Q_cjs = require('../chunk-O6O5MD7Q.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Agent", {
9
9
  enumerable: true,
10
- get: function () { return chunkNI24OP2N_cjs.Agent; }
10
+ get: function () { return chunkBXSSIONK_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "TripWire", {
13
13
  enumerable: true,
14
- get: function () { return chunkNI24OP2N_cjs.TripWire; }
14
+ get: function () { return chunkBXSSIONK_cjs.TripWire; }
15
15
  });
16
16
  Object.defineProperty(exports, "isSupportedLanguageModel", {
17
17
  enumerable: true,
18
- get: function () { return chunkNI24OP2N_cjs.isSupportedLanguageModel; }
18
+ get: function () { return chunkBXSSIONK_cjs.isSupportedLanguageModel; }
19
19
  });
20
20
  Object.defineProperty(exports, "resolveThreadIdFromArgs", {
21
21
  enumerable: true,
22
- get: function () { return chunkNI24OP2N_cjs.resolveThreadIdFromArgs; }
22
+ get: function () { return chunkBXSSIONK_cjs.resolveThreadIdFromArgs; }
23
23
  });
24
24
  Object.defineProperty(exports, "supportedLanguageModelSpecifications", {
25
25
  enumerable: true,
26
- get: function () { return chunkNI24OP2N_cjs.supportedLanguageModelSpecifications; }
26
+ get: function () { return chunkBXSSIONK_cjs.supportedLanguageModelSpecifications; }
27
27
  });
28
28
  Object.defineProperty(exports, "tryGenerateWithJsonFallback", {
29
29
  enumerable: true,
30
- get: function () { return chunkNI24OP2N_cjs.tryGenerateWithJsonFallback; }
30
+ get: function () { return chunkBXSSIONK_cjs.tryGenerateWithJsonFallback; }
31
31
  });
32
32
  Object.defineProperty(exports, "tryStreamWithJsonFallback", {
33
33
  enumerable: true,
34
- get: function () { return chunkNI24OP2N_cjs.tryStreamWithJsonFallback; }
34
+ get: function () { return chunkBXSSIONK_cjs.tryStreamWithJsonFallback; }
35
35
  });
36
36
  Object.defineProperty(exports, "MessageList", {
37
37
  enumerable: true,
@@ -1,4 +1,4 @@
1
- export { Agent, TripWire, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-ERY767HB.js';
1
+ export { Agent, TripWire, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-P4GCK6VL.js';
2
2
  export { MessageList, TypeDetector, aiV5ModelMessageToV2PromptMessage, convertMessages } from '../chunk-YPJ5V2S5.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkVZWFITNF_cjs = require('./chunk-VZWFITNF.cjs');
4
- var chunkNI24OP2N_cjs = require('./chunk-NI24OP2N.cjs');
3
+ var chunkU37AM3YI_cjs = require('./chunk-U37AM3YI.cjs');
4
+ var chunkBXSSIONK_cjs = require('./chunk-BXSSIONK.cjs');
5
5
  var chunk5WBEMKE2_cjs = require('./chunk-5WBEMKE2.cjs');
6
6
  var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
7
7
  var schemaCompat = require('@mastra/schema-compat');
@@ -97,7 +97,7 @@ async function executeAgent(agent, item, signal, requestContext) {
97
97
  const model = await agent.getModel();
98
98
  const input = item.input;
99
99
  const reqCtx = requestContext ? new chunk5WBEMKE2_cjs.RequestContext(Object.entries(requestContext)) : void 0;
100
- const rawResult = chunkNI24OP2N_cjs.isSupportedLanguageModel(model) ? await agent.generate(input, {
100
+ const rawResult = chunkBXSSIONK_cjs.isSupportedLanguageModel(model) ? await agent.generate(input, {
101
101
  scorers: {},
102
102
  returnScorerData: true,
103
103
  abortSignal: signal,
@@ -193,7 +193,7 @@ async function runScorersForItem(scorers, item, output, storage, runId, targetTy
193
193
  const { result, promptMetadata } = await runScorerSafe(scorer, item, output, scorerInput, scorerOutput);
194
194
  if (storage && result.score !== null) {
195
195
  try {
196
- await chunkVZWFITNF_cjs.validateAndSaveScore(storage, {
196
+ await chunkU37AM3YI_cjs.validateAndSaveScore(storage, {
197
197
  scorerId: scorer.id,
198
198
  score: result.score,
199
199
  reason: result.reason ?? void 0,
@@ -1315,5 +1315,5 @@ exports.isRegression = isRegression;
1315
1315
  exports.resolveScorers = resolveScorers;
1316
1316
  exports.runExperiment = runExperiment;
1317
1317
  exports.runScorersForItem = runScorersForItem;
1318
- //# sourceMappingURL=chunk-ZFVANSSN.cjs.map
1319
- //# sourceMappingURL=chunk-ZFVANSSN.cjs.map
1318
+ //# sourceMappingURL=chunk-2YN2UNSQ.cjs.map
1319
+ //# sourceMappingURL=chunk-2YN2UNSQ.cjs.map