@mastra/core 1.15.0-alpha.2 → 1.15.0-alpha.3

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 (120) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/agent/index.cjs +8 -8
  3. package/dist/agent/index.js +1 -1
  4. package/dist/{chunk-MHTWFVXK.js → chunk-3QVIGF2C.js} +3 -3
  5. package/dist/{chunk-MHTWFVXK.js.map → chunk-3QVIGF2C.js.map} +1 -1
  6. package/dist/{chunk-ORHPD25N.cjs → chunk-4HBFSEH5.cjs} +7 -7
  7. package/dist/{chunk-ORHPD25N.cjs.map → chunk-4HBFSEH5.cjs.map} +1 -1
  8. package/dist/{chunk-Q64Z437G.cjs → chunk-5TR3QHRW.cjs} +15 -15
  9. package/dist/{chunk-Q64Z437G.cjs.map → chunk-5TR3QHRW.cjs.map} +1 -1
  10. package/dist/{chunk-OX63O3QG.cjs → chunk-6H4DIT5W.cjs} +5 -5
  11. package/dist/{chunk-OX63O3QG.cjs.map → chunk-6H4DIT5W.cjs.map} +1 -1
  12. package/dist/{chunk-4YKZNIK6.js → chunk-6OM5P63S.js} +4 -4
  13. package/dist/{chunk-4YKZNIK6.js.map → chunk-6OM5P63S.js.map} +1 -1
  14. package/dist/{chunk-YV5UMIRV.cjs → chunk-7FCDSKDP.cjs} +3 -3
  15. package/dist/{chunk-YV5UMIRV.cjs.map → chunk-7FCDSKDP.cjs.map} +1 -1
  16. package/dist/{chunk-7BM5LQHF.cjs → chunk-A5IWSJLJ.cjs} +75 -75
  17. package/dist/{chunk-7BM5LQHF.cjs.map → chunk-A5IWSJLJ.cjs.map} +1 -1
  18. package/dist/{chunk-KCZ3R5SF.js → chunk-AVLD4VHQ.js} +3 -3
  19. package/dist/{chunk-KCZ3R5SF.js.map → chunk-AVLD4VHQ.js.map} +1 -1
  20. package/dist/{chunk-ECAVJWAH.js → chunk-B5M72XCG.js} +4 -4
  21. package/dist/{chunk-ECAVJWAH.js.map → chunk-B5M72XCG.js.map} +1 -1
  22. package/dist/{chunk-X4RVX77L.cjs → chunk-BAUAKBM6.cjs} +185 -185
  23. package/dist/{chunk-X4RVX77L.cjs.map → chunk-BAUAKBM6.cjs.map} +1 -1
  24. package/dist/{chunk-ASVFCNLS.js → chunk-CJHZXD3U.js} +6 -6
  25. package/dist/{chunk-ASVFCNLS.js.map → chunk-CJHZXD3U.js.map} +1 -1
  26. package/dist/{chunk-NWC75FLU.cjs → chunk-CTFO2ENI.cjs} +53 -20
  27. package/dist/chunk-CTFO2ENI.cjs.map +1 -0
  28. package/dist/{chunk-EFYYAFWD.cjs → chunk-DYFEJA5J.cjs} +17 -17
  29. package/dist/{chunk-EFYYAFWD.cjs.map → chunk-DYFEJA5J.cjs.map} +1 -1
  30. package/dist/{chunk-SHQKQEG2.js → chunk-JEF7ZU43.js} +50 -18
  31. package/dist/chunk-JEF7ZU43.js.map +1 -0
  32. package/dist/{chunk-M5BDH7B4.cjs → chunk-K5NREJ7B.cjs} +6 -6
  33. package/dist/{chunk-M5BDH7B4.cjs.map → chunk-K5NREJ7B.cjs.map} +1 -1
  34. package/dist/{chunk-FNOAF2SZ.js → chunk-K6EF74Q4.js} +3 -3
  35. package/dist/{chunk-FNOAF2SZ.js.map → chunk-K6EF74Q4.js.map} +1 -1
  36. package/dist/{chunk-CTJLKJMO.js → chunk-M4AJQGAW.js} +5 -5
  37. package/dist/{chunk-CTJLKJMO.js.map → chunk-M4AJQGAW.js.map} +1 -1
  38. package/dist/{chunk-Z76WT6W3.js → chunk-MFB7BS3L.js} +4 -4
  39. package/dist/{chunk-Z76WT6W3.js.map → chunk-MFB7BS3L.js.map} +1 -1
  40. package/dist/{chunk-EAWVRIHS.js → chunk-O5KUYSYB.js} +3 -3
  41. package/dist/{chunk-EAWVRIHS.js.map → chunk-O5KUYSYB.js.map} +1 -1
  42. package/dist/{chunk-NWPRZZ2K.cjs → chunk-OFY7LQSG.cjs} +48 -48
  43. package/dist/{chunk-NWPRZZ2K.cjs.map → chunk-OFY7LQSG.cjs.map} +1 -1
  44. package/dist/{chunk-JIBMK2QP.js → chunk-SVHGG25E.js} +8 -8
  45. package/dist/{chunk-JIBMK2QP.js.map → chunk-SVHGG25E.js.map} +1 -1
  46. package/dist/{chunk-TJB7IK7N.cjs → chunk-TRLOXCPX.cjs} +5 -5
  47. package/dist/{chunk-TJB7IK7N.cjs.map → chunk-TRLOXCPX.cjs.map} +1 -1
  48. package/dist/{chunk-HIZDAENF.js → chunk-VPN66PYF.js} +3 -3
  49. package/dist/{chunk-HIZDAENF.js.map → chunk-VPN66PYF.js.map} +1 -1
  50. package/dist/{chunk-RFZB2PQE.cjs → chunk-XOBYVWML.cjs} +9 -9
  51. package/dist/{chunk-RFZB2PQE.cjs.map → chunk-XOBYVWML.cjs.map} +1 -1
  52. package/dist/datasets/index.cjs +11 -11
  53. package/dist/datasets/index.js +1 -1
  54. package/dist/docs/SKILL.md +1 -1
  55. package/dist/docs/assets/SOURCE_MAP.json +119 -119
  56. package/dist/docs/references/docs-workspace-overview.md +15 -0
  57. package/dist/docs/references/reference-workspace-filesystem.md +2 -0
  58. package/dist/docs/references/reference-workspace-local-filesystem.md +2 -0
  59. package/dist/evals/index.cjs +5 -5
  60. package/dist/evals/index.js +2 -2
  61. package/dist/evals/scoreTraces/index.cjs +3 -3
  62. package/dist/evals/scoreTraces/index.js +1 -1
  63. package/dist/harness/index.cjs +11 -11
  64. package/dist/harness/index.js +6 -6
  65. package/dist/index.cjs +2 -2
  66. package/dist/index.js +1 -1
  67. package/dist/llm/index.cjs +16 -16
  68. package/dist/llm/index.js +5 -5
  69. package/dist/loop/index.cjs +14 -14
  70. package/dist/loop/index.js +1 -1
  71. package/dist/mastra/index.cjs +2 -2
  72. package/dist/mastra/index.js +1 -1
  73. package/dist/memory/index.cjs +14 -14
  74. package/dist/memory/index.js +1 -1
  75. package/dist/models-dev-KSUL2WSE.js +3 -0
  76. package/dist/{models-dev-E6FRPGHV.js.map → models-dev-KSUL2WSE.js.map} +1 -1
  77. package/dist/models-dev-N3BB7QC6.cjs +12 -0
  78. package/dist/{models-dev-WIROJ2IM.cjs.map → models-dev-N3BB7QC6.cjs.map} +1 -1
  79. package/dist/netlify-5FZZLF2V.cjs +12 -0
  80. package/dist/{netlify-7IRBQ2BY.cjs.map → netlify-5FZZLF2V.cjs.map} +1 -1
  81. package/dist/netlify-YHUBX5AX.js +3 -0
  82. package/dist/{netlify-OAGRP6WY.js.map → netlify-YHUBX5AX.js.map} +1 -1
  83. package/dist/processor-provider/index.cjs +10 -10
  84. package/dist/processor-provider/index.js +1 -1
  85. package/dist/processors/index.cjs +42 -42
  86. package/dist/processors/index.js +1 -1
  87. package/dist/provider-registry-52PKE45P.js +3 -0
  88. package/dist/{provider-registry-2MHU2NP6.js.map → provider-registry-52PKE45P.js.map} +1 -1
  89. package/dist/provider-registry-YH7WKSYN.cjs +40 -0
  90. package/dist/{provider-registry-FINEGQHE.cjs.map → provider-registry-YH7WKSYN.cjs.map} +1 -1
  91. package/dist/relevance/index.cjs +3 -3
  92. package/dist/relevance/index.js +1 -1
  93. package/dist/stream/index.cjs +8 -8
  94. package/dist/stream/index.js +1 -1
  95. package/dist/tool-loop-agent/index.cjs +4 -4
  96. package/dist/tool-loop-agent/index.js +1 -1
  97. package/dist/workflows/evented/index.cjs +10 -10
  98. package/dist/workflows/evented/index.js +1 -1
  99. package/dist/workflows/index.cjs +24 -24
  100. package/dist/workflows/index.js +1 -1
  101. package/dist/workspace/errors.d.ts +5 -0
  102. package/dist/workspace/errors.d.ts.map +1 -1
  103. package/dist/workspace/filesystem/filesystem.d.ts +6 -0
  104. package/dist/workspace/filesystem/filesystem.d.ts.map +1 -1
  105. package/dist/workspace/filesystem/local-filesystem.d.ts.map +1 -1
  106. package/dist/workspace/index.cjs +71 -67
  107. package/dist/workspace/index.js +1 -1
  108. package/dist/workspace/tools/ast-edit.d.ts.map +1 -1
  109. package/dist/workspace/tools/edit-file.d.ts.map +1 -1
  110. package/dist/workspace/tools/tools.d.ts.map +1 -1
  111. package/dist/workspace/tools/write-file.d.ts.map +1 -1
  112. package/package.json +5 -5
  113. package/dist/chunk-NWC75FLU.cjs.map +0 -1
  114. package/dist/chunk-SHQKQEG2.js.map +0 -1
  115. package/dist/models-dev-E6FRPGHV.js +0 -3
  116. package/dist/models-dev-WIROJ2IM.cjs +0 -12
  117. package/dist/netlify-7IRBQ2BY.cjs +0 -12
  118. package/dist/netlify-OAGRP6WY.js +0 -3
  119. package/dist/provider-registry-2MHU2NP6.js +0 -3
  120. package/dist/provider-registry-FINEGQHE.cjs +0 -40
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @mastra/core
2
2
 
3
+ ## 1.15.0-alpha.3
4
+
5
+ ### Minor Changes
6
+
7
+ - 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))
8
+
9
+ **New `expectedMtime` option on `WriteOptions`**
10
+
11
+ Any caller of `filesystem.writeFile()` can now opt into optimistic concurrency:
12
+
13
+ ```ts
14
+ // Read a file and capture its mtime
15
+ const stat = await filesystem.stat('config.json');
16
+ const content = await filesystem.readFile('config.json');
17
+
18
+ // Later, write with mtime guard — fails if file changed externally
19
+ await filesystem.writeFile('config.json', newContent, {
20
+ overwrite: true,
21
+ expectedMtime: stat.modifiedAt,
22
+ });
23
+ ```
24
+
25
+ If the file was modified between the read and write, a `StaleFileError` is thrown instead of silently overwriting.
26
+
27
+ **Automatic mtime pass-through for workspace tools**
28
+
29
+ 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.
30
+
3
31
  ## 1.15.0-alpha.2
4
32
 
5
33
  ### Patch Changes
@@ -1,37 +1,37 @@
1
1
  'use strict';
2
2
 
3
- var chunkEFYYAFWD_cjs = require('../chunk-EFYYAFWD.cjs');
3
+ var chunkDYFEJA5J_cjs = require('../chunk-DYFEJA5J.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 chunkEFYYAFWD_cjs.Agent; }
10
+ get: function () { return chunkDYFEJA5J_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "TripWire", {
13
13
  enumerable: true,
14
- get: function () { return chunkEFYYAFWD_cjs.TripWire; }
14
+ get: function () { return chunkDYFEJA5J_cjs.TripWire; }
15
15
  });
16
16
  Object.defineProperty(exports, "isSupportedLanguageModel", {
17
17
  enumerable: true,
18
- get: function () { return chunkEFYYAFWD_cjs.isSupportedLanguageModel; }
18
+ get: function () { return chunkDYFEJA5J_cjs.isSupportedLanguageModel; }
19
19
  });
20
20
  Object.defineProperty(exports, "resolveThreadIdFromArgs", {
21
21
  enumerable: true,
22
- get: function () { return chunkEFYYAFWD_cjs.resolveThreadIdFromArgs; }
22
+ get: function () { return chunkDYFEJA5J_cjs.resolveThreadIdFromArgs; }
23
23
  });
24
24
  Object.defineProperty(exports, "supportedLanguageModelSpecifications", {
25
25
  enumerable: true,
26
- get: function () { return chunkEFYYAFWD_cjs.supportedLanguageModelSpecifications; }
26
+ get: function () { return chunkDYFEJA5J_cjs.supportedLanguageModelSpecifications; }
27
27
  });
28
28
  Object.defineProperty(exports, "tryGenerateWithJsonFallback", {
29
29
  enumerable: true,
30
- get: function () { return chunkEFYYAFWD_cjs.tryGenerateWithJsonFallback; }
30
+ get: function () { return chunkDYFEJA5J_cjs.tryGenerateWithJsonFallback; }
31
31
  });
32
32
  Object.defineProperty(exports, "tryStreamWithJsonFallback", {
33
33
  enumerable: true,
34
- get: function () { return chunkEFYYAFWD_cjs.tryStreamWithJsonFallback; }
34
+ get: function () { return chunkDYFEJA5J_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-CTJLKJMO.js';
1
+ export { Agent, TripWire, isSupportedLanguageModel, resolveThreadIdFromArgs, supportedLanguageModelSpecifications, tryGenerateWithJsonFallback, tryStreamWithJsonFallback } from '../chunk-M4AJQGAW.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,4 +1,4 @@
1
- import { validateStepInput, createDeprecationProxy, validateStepSuspendData, getStepResult, runCountDeprecationMessage, TripWire, createTimeTravelExecutionParams, validateStepResumeData, Workflow, isSupportedLanguageModel, ProcessorState, ProcessorStepOutputSchema, ProcessorStepSchema, Run, WorkflowRunOutput, ExecutionEngine, cleanStepResult, hydrateSerializedStepErrors, Agent, ProcessorRunner, forwardAgentStreamChunk } from './chunk-CTJLKJMO.js';
1
+ import { validateStepInput, createDeprecationProxy, validateStepSuspendData, getStepResult, runCountDeprecationMessage, TripWire, createTimeTravelExecutionParams, validateStepResumeData, Workflow, isSupportedLanguageModel, ProcessorState, ProcessorStepOutputSchema, ProcessorStepSchema, Run, WorkflowRunOutput, ExecutionEngine, cleanStepResult, hydrateSerializedStepErrors, Agent, ProcessorRunner, forwardAgentStreamChunk } from './chunk-M4AJQGAW.js';
2
2
  import { STREAM_FORMAT_SYMBOL, PUBSUB_SYMBOL } from './chunk-2QXNHEDL.js';
3
3
  import { createPendingMarker } from './chunk-Y6DV2OT2.js';
4
4
  import { MessageList } from './chunk-YPJ5V2S5.js';
@@ -4619,5 +4619,5 @@ var EventedExecutionEngine = class extends ExecutionEngine {
4619
4619
  };
4620
4620
 
4621
4621
  export { EventedExecutionEngine, EventedRun, EventedWorkflow, StepExecutor, WorkflowEventProcessor, cloneStep, cloneWorkflow, createStep, createWorkflow };
4622
- //# sourceMappingURL=chunk-MHTWFVXK.js.map
4623
- //# sourceMappingURL=chunk-MHTWFVXK.js.map
4622
+ //# sourceMappingURL=chunk-3QVIGF2C.js.map
4623
+ //# sourceMappingURL=chunk-3QVIGF2C.js.map