@mastra/core 0.24.6 → 0.24.7-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.
Files changed (180) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/agent/index.cjs +13 -13
  3. package/dist/agent/index.js +2 -2
  4. package/dist/agent/input-processor/index.cjs +6 -6
  5. package/dist/agent/input-processor/index.js +1 -1
  6. package/dist/agent/message-list/index.d.ts.map +1 -1
  7. package/dist/ai-tracing/index.cjs +36 -36
  8. package/dist/ai-tracing/index.js +1 -1
  9. package/dist/{chunk-XWGHD4C7.cjs → chunk-22DLIF7L.cjs} +5 -5
  10. package/dist/{chunk-XWGHD4C7.cjs.map → chunk-22DLIF7L.cjs.map} +1 -1
  11. package/dist/{chunk-PAOBGBU7.cjs → chunk-3IDFSGG3.cjs} +4 -4
  12. package/dist/{chunk-PAOBGBU7.cjs.map → chunk-3IDFSGG3.cjs.map} +1 -1
  13. package/dist/{chunk-42RUESSD.cjs → chunk-4YYPQOP7.cjs} +9 -4
  14. package/dist/{chunk-42RUESSD.cjs.map → chunk-4YYPQOP7.cjs.map} +1 -1
  15. package/dist/{chunk-AQGLVU53.cjs → chunk-5PSD3IKG.cjs} +19 -6
  16. package/dist/chunk-5PSD3IKG.cjs.map +1 -0
  17. package/dist/{chunk-LAQQETGP.js → chunk-5UWR4YYL.js} +33 -28
  18. package/dist/chunk-5UWR4YYL.js.map +1 -0
  19. package/dist/{chunk-RJOVFHWN.cjs → chunk-6DFSLVVY.cjs} +34 -7
  20. package/dist/chunk-6DFSLVVY.cjs.map +1 -0
  21. package/dist/{chunk-6D2K2CAA.js → chunk-6VB52TJV.js} +3 -3
  22. package/dist/{chunk-6D2K2CAA.js.map → chunk-6VB52TJV.js.map} +1 -1
  23. package/dist/{chunk-VXHOOZSK.js → chunk-72F4RGK7.js} +3 -3
  24. package/dist/{chunk-VXHOOZSK.js.map → chunk-72F4RGK7.js.map} +1 -1
  25. package/dist/{chunk-XDMQQZNX.cjs → chunk-AHQOJZT2.cjs} +74 -66
  26. package/dist/chunk-AHQOJZT2.cjs.map +1 -0
  27. package/dist/{chunk-JVV5LREI.js → chunk-BKBVQTOH.js} +2 -2
  28. package/dist/chunk-BKBVQTOH.js.map +1 -0
  29. package/dist/{chunk-DMBN72QF.cjs → chunk-DISETAP2.cjs} +4 -4
  30. package/dist/{chunk-DMBN72QF.cjs.map → chunk-DISETAP2.cjs.map} +1 -1
  31. package/dist/{chunk-BLUDYAPI.js → chunk-DSUKMFZY.js} +19 -6
  32. package/dist/chunk-DSUKMFZY.js.map +1 -0
  33. package/dist/{chunk-NRQC7DQW.js → chunk-DYJA57WK.js} +55 -7
  34. package/dist/chunk-DYJA57WK.js.map +1 -0
  35. package/dist/{chunk-Q6LWNLAJ.js → chunk-GIK7MM2K.js} +8 -3
  36. package/dist/{chunk-Q6LWNLAJ.js.map → chunk-GIK7MM2K.js.map} +1 -1
  37. package/dist/{chunk-DHLW4AP7.js → chunk-GOEAJJED.js} +3 -3
  38. package/dist/{chunk-DHLW4AP7.js.map → chunk-GOEAJJED.js.map} +1 -1
  39. package/dist/{chunk-GZDIHQDK.cjs → chunk-GWA56ELO.cjs} +4 -4
  40. package/dist/{chunk-GZDIHQDK.cjs.map → chunk-GWA56ELO.cjs.map} +1 -1
  41. package/dist/{chunk-CT2DMHGC.cjs → chunk-ICICKWAG.cjs} +8 -8
  42. package/dist/{chunk-CT2DMHGC.cjs.map → chunk-ICICKWAG.cjs.map} +1 -1
  43. package/dist/{chunk-Z6QCWTTO.js → chunk-KQGP7VMN.js} +145 -19
  44. package/dist/chunk-KQGP7VMN.js.map +1 -0
  45. package/dist/{chunk-INOOZ2A2.js → chunk-PHSTPDWR.js} +33 -6
  46. package/dist/chunk-PHSTPDWR.js.map +1 -0
  47. package/dist/{chunk-WIMFJ2BA.js → chunk-PPAIPZ6C.js} +51 -13
  48. package/dist/chunk-PPAIPZ6C.js.map +1 -0
  49. package/dist/{chunk-UWTYVVVZ.js → chunk-RLYWCJQ6.js} +3 -3
  50. package/dist/{chunk-UWTYVVVZ.js.map → chunk-RLYWCJQ6.js.map} +1 -1
  51. package/dist/{chunk-HCCXJ5YJ.js → chunk-RP4YCZP7.js} +3 -3
  52. package/dist/{chunk-HCCXJ5YJ.js.map → chunk-RP4YCZP7.js.map} +1 -1
  53. package/dist/{chunk-CYEQK4PM.cjs → chunk-RQPGIUUA.cjs} +6 -6
  54. package/dist/{chunk-CYEQK4PM.cjs.map → chunk-RQPGIUUA.cjs.map} +1 -1
  55. package/dist/{chunk-46XGIEXM.cjs → chunk-RWPKCFZT.cjs} +4 -4
  56. package/dist/{chunk-46XGIEXM.cjs.map → chunk-RWPKCFZT.cjs.map} +1 -1
  57. package/dist/{chunk-KWF3J2Q4.cjs → chunk-SJ3PJ5D6.cjs} +11 -11
  58. package/dist/{chunk-KWF3J2Q4.cjs.map → chunk-SJ3PJ5D6.cjs.map} +1 -1
  59. package/dist/{chunk-ICF3MCIN.cjs → chunk-TR5CDVHO.cjs} +65 -17
  60. package/dist/chunk-TR5CDVHO.cjs.map +1 -0
  61. package/dist/{chunk-PIH5FBNQ.cjs → chunk-U57JN7JY.cjs} +154 -28
  62. package/dist/chunk-U57JN7JY.cjs.map +1 -0
  63. package/dist/{chunk-NPNGPMT2.js → chunk-V2IMZSNO.js} +3 -3
  64. package/dist/{chunk-NPNGPMT2.js.map → chunk-V2IMZSNO.js.map} +1 -1
  65. package/dist/{chunk-IAJHRFO4.cjs → chunk-YPYLWTZI.cjs} +60 -21
  66. package/dist/chunk-YPYLWTZI.cjs.map +1 -0
  67. package/dist/{chunk-ZIWN73GQ.js → chunk-Z6ZIJYKK.js} +5 -5
  68. package/dist/{chunk-ZIWN73GQ.js.map → chunk-Z6ZIJYKK.js.map} +1 -1
  69. package/dist/{chunk-MRSBLBQ5.js → chunk-ZOQ6Q5Q3.js} +4 -4
  70. package/dist/{chunk-MRSBLBQ5.js.map → chunk-ZOQ6Q5Q3.js.map} +1 -1
  71. package/dist/{chunk-TX4TTPYJ.cjs → chunk-ZZ2DSE2G.cjs} +2 -2
  72. package/dist/chunk-ZZ2DSE2G.cjs.map +1 -0
  73. package/dist/index.cjs +96 -64
  74. package/dist/index.js +13 -13
  75. package/dist/llm/index.cjs +8 -8
  76. package/dist/llm/index.js +2 -2
  77. package/dist/llm/model/provider-registry.d.ts.map +1 -1
  78. package/dist/loop/index.cjs +2 -2
  79. package/dist/loop/index.js +1 -1
  80. package/dist/loop/workflows/stream.d.ts +1 -1
  81. package/dist/loop/workflows/stream.d.ts.map +1 -1
  82. package/dist/mastra/index.cjs +2 -2
  83. package/dist/mastra/index.d.ts +3 -1
  84. package/dist/mastra/index.d.ts.map +1 -1
  85. package/dist/mastra/index.js +1 -1
  86. package/dist/memory/index.cjs +4 -4
  87. package/dist/memory/index.js +1 -1
  88. package/dist/processors/index.cjs +11 -11
  89. package/dist/processors/index.js +1 -1
  90. package/dist/provider-registry-254GJGUL.cjs +40 -0
  91. package/dist/{provider-registry-RUDYHG7J.cjs.map → provider-registry-254GJGUL.cjs.map} +1 -1
  92. package/dist/provider-registry-7BUYRBGO.js +3 -0
  93. package/dist/{provider-registry-THITZUJ7.js.map → provider-registry-7BUYRBGO.js.map} +1 -1
  94. package/dist/relevance/index.cjs +4 -4
  95. package/dist/relevance/index.js +1 -1
  96. package/dist/scores/index.cjs +9 -9
  97. package/dist/scores/index.js +2 -2
  98. package/dist/scores/scoreTraces/index.cjs +8 -8
  99. package/dist/scores/scoreTraces/index.js +3 -3
  100. package/dist/server/index.cjs +25 -36
  101. package/dist/server/index.cjs.map +1 -1
  102. package/dist/server/index.js +24 -35
  103. package/dist/server/index.js.map +1 -1
  104. package/dist/server/simple-auth.d.ts +13 -18
  105. package/dist/server/simple-auth.d.ts.map +1 -1
  106. package/dist/storage/base.d.ts +2 -9
  107. package/dist/storage/base.d.ts.map +1 -1
  108. package/dist/storage/domains/workflows/base.d.ts +2 -9
  109. package/dist/storage/domains/workflows/base.d.ts.map +1 -1
  110. package/dist/storage/domains/workflows/inmemory.d.ts +2 -9
  111. package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
  112. package/dist/storage/index.cjs +31 -10
  113. package/dist/storage/index.cjs.map +1 -1
  114. package/dist/storage/index.js +25 -4
  115. package/dist/storage/index.js.map +1 -1
  116. package/dist/storage/types.d.ts +10 -1
  117. package/dist/storage/types.d.ts.map +1 -1
  118. package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
  119. package/dist/stream/index.cjs +11 -11
  120. package/dist/stream/index.js +2 -2
  121. package/dist/telemetry/index.cjs +7 -7
  122. package/dist/telemetry/index.js +1 -1
  123. package/dist/telemetry/telemetry.decorators.d.ts.map +1 -1
  124. package/dist/test-utils/llm-mock.cjs +2 -2
  125. package/dist/test-utils/llm-mock.js +1 -1
  126. package/dist/tts/index.cjs +2 -2
  127. package/dist/tts/index.js +1 -1
  128. package/dist/utils.cjs +37 -17
  129. package/dist/utils.d.ts +32 -0
  130. package/dist/utils.d.ts.map +1 -1
  131. package/dist/utils.js +1 -1
  132. package/dist/voice/index.cjs +6 -6
  133. package/dist/voice/index.js +1 -1
  134. package/dist/workflows/default.d.ts +26 -8
  135. package/dist/workflows/default.d.ts.map +1 -1
  136. package/dist/workflows/evented/execution-engine.d.ts +5 -1
  137. package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
  138. package/dist/workflows/evented/index.cjs +10 -10
  139. package/dist/workflows/evented/index.js +1 -1
  140. package/dist/workflows/evented/workflow-event-processor/index.d.ts +5 -4
  141. package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
  142. package/dist/workflows/evented/workflow-event-processor/loop.d.ts +1 -1
  143. package/dist/workflows/evented/workflow-event-processor/loop.d.ts.map +1 -1
  144. package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
  145. package/dist/workflows/evented/workflow-event-processor/parallel.d.ts.map +1 -1
  146. package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
  147. package/dist/workflows/evented/workflow-event-processor/sleep.d.ts.map +1 -1
  148. package/dist/workflows/evented/workflow.d.ts +2 -1
  149. package/dist/workflows/evented/workflow.d.ts.map +1 -1
  150. package/dist/workflows/execution-engine.d.ts +5 -3
  151. package/dist/workflows/execution-engine.d.ts.map +1 -1
  152. package/dist/workflows/index.cjs +26 -14
  153. package/dist/workflows/index.js +1 -1
  154. package/dist/workflows/legacy/index.cjs +22 -22
  155. package/dist/workflows/legacy/index.js +1 -1
  156. package/dist/workflows/step.d.ts +1 -0
  157. package/dist/workflows/step.d.ts.map +1 -1
  158. package/dist/workflows/types.d.ts +51 -1
  159. package/dist/workflows/types.d.ts.map +1 -1
  160. package/dist/workflows/utils.d.ts +20 -0
  161. package/dist/workflows/utils.d.ts.map +1 -1
  162. package/dist/workflows/workflow.d.ts +98 -12
  163. package/dist/workflows/workflow.d.ts.map +1 -1
  164. package/package.json +5 -5
  165. package/dist/chunk-AQGLVU53.cjs.map +0 -1
  166. package/dist/chunk-BLUDYAPI.js.map +0 -1
  167. package/dist/chunk-IAJHRFO4.cjs.map +0 -1
  168. package/dist/chunk-ICF3MCIN.cjs.map +0 -1
  169. package/dist/chunk-INOOZ2A2.js.map +0 -1
  170. package/dist/chunk-JVV5LREI.js.map +0 -1
  171. package/dist/chunk-LAQQETGP.js.map +0 -1
  172. package/dist/chunk-NRQC7DQW.js.map +0 -1
  173. package/dist/chunk-PIH5FBNQ.cjs.map +0 -1
  174. package/dist/chunk-RJOVFHWN.cjs.map +0 -1
  175. package/dist/chunk-TX4TTPYJ.cjs.map +0 -1
  176. package/dist/chunk-WIMFJ2BA.js.map +0 -1
  177. package/dist/chunk-XDMQQZNX.cjs.map +0 -1
  178. package/dist/chunk-Z6QCWTTO.js.map +0 -1
  179. package/dist/provider-registry-RUDYHG7J.cjs +0 -40
  180. package/dist/provider-registry-THITZUJ7.js +0 -3
@@ -5,7 +5,7 @@ import { isVercelTool, validateToolInput } from './chunk-WM4RO23J.js';
5
5
  import { MastraBase } from './chunk-VQASQG5D.js';
6
6
  import { ConsoleLogger, LogLevel, RegisteredLogger } from './chunk-UXG7PYML.js';
7
7
  import { createHash } from 'crypto';
8
- import jsonSchemaToZod from 'json-schema-to-zod';
8
+ import { jsonSchemaToZod } from '@mastra/schema-compat/json-to-zod';
9
9
  import { z } from 'zod';
10
10
  import { convertZodSchemaToAISDKSchema, OpenAIReasoningSchemaCompatLayer, OpenAISchemaCompatLayer, GoogleSchemaCompatLayer, AnthropicSchemaCompatLayer, DeepSeekSchemaCompatLayer, MetaSchemaCompatLayer, applyCompatLayer } from '@mastra/schema-compat';
11
11
  import { TransformStream } from 'stream/web';
@@ -996,6 +996,44 @@ async function fetchWithRetry(url, options = {}, maxRetries = 3) {
996
996
  }
997
997
  throw lastError || new Error("Request failed after multiple retry attempts");
998
998
  }
999
+ function omitKeys(obj, keysToOmit) {
1000
+ return Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToOmit.includes(key)));
1001
+ }
1002
+ function selectFields(obj, fields) {
1003
+ if (!obj || typeof obj !== "object") {
1004
+ return obj;
1005
+ }
1006
+ const result = {};
1007
+ for (const field of fields) {
1008
+ const value = getNestedValue(obj, field);
1009
+ if (value !== void 0) {
1010
+ setNestedValue(result, field, value);
1011
+ }
1012
+ }
1013
+ return result;
1014
+ }
1015
+ function getNestedValue(obj, path) {
1016
+ return path.split(".").reduce((current, key) => {
1017
+ return current && typeof current === "object" ? current[key] : void 0;
1018
+ }, obj);
1019
+ }
1020
+ function setNestedValue(obj, path, value) {
1021
+ const keys = path.split(".");
1022
+ const lastKey = keys.pop();
1023
+ if (!lastKey) {
1024
+ return;
1025
+ }
1026
+ const target = keys.reduce((current, key) => {
1027
+ if (!current[key] || typeof current[key] !== "object") {
1028
+ current[key] = {};
1029
+ }
1030
+ return current[key];
1031
+ }, obj);
1032
+ target[lastKey] = value;
1033
+ }
1034
+ var removeUndefinedValues = (obj) => {
1035
+ return Object.fromEntries(Object.entries(obj).filter(([_, value]) => value !== void 0));
1036
+ };
999
1037
 
1000
1038
  // src/ai-tracing/exporters/cloud.ts
1001
1039
  var CloudExporter = class extends BaseExporter {
@@ -2044,28 +2082,28 @@ function setupAITracing(config) {
2044
2082
  }
2045
2083
 
2046
2084
  // src/ai-tracing/utils.ts
2047
- function omitKeys(obj, keysToOmit) {
2085
+ function omitKeys2(obj, keysToOmit) {
2048
2086
  return Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToOmit.includes(key)));
2049
2087
  }
2050
- function selectFields(obj, fields) {
2088
+ function selectFields2(obj, fields) {
2051
2089
  if (!obj || typeof obj !== "object") {
2052
2090
  return obj;
2053
2091
  }
2054
2092
  const result = {};
2055
2093
  for (const field of fields) {
2056
- const value = getNestedValue(obj, field);
2094
+ const value = getNestedValue2(obj, field);
2057
2095
  if (value !== void 0) {
2058
- setNestedValue(result, field, value);
2096
+ setNestedValue2(result, field, value);
2059
2097
  }
2060
2098
  }
2061
2099
  return result;
2062
2100
  }
2063
- function getNestedValue(obj, path) {
2101
+ function getNestedValue2(obj, path) {
2064
2102
  return path.split(".").reduce((current, key) => {
2065
2103
  return current && typeof current === "object" ? current[key] : void 0;
2066
2104
  }, obj);
2067
2105
  }
2068
- function setNestedValue(obj, path, value) {
2106
+ function setNestedValue2(obj, path, value) {
2069
2107
  const keys = path.split(".");
2070
2108
  const lastKey = keys.pop();
2071
2109
  if (!lastKey) {
@@ -2315,12 +2353,12 @@ var BaseAITracing = class extends MastraBase {
2315
2353
  if (value !== void 0) {
2316
2354
  if (parts.length > 1) {
2317
2355
  const nestedPath = parts.slice(1).join(".");
2318
- const nestedValue = getNestedValue(value, nestedPath);
2356
+ const nestedValue = getNestedValue2(value, nestedPath);
2319
2357
  if (nestedValue !== void 0) {
2320
- setNestedValue(result, key, nestedValue);
2358
+ setNestedValue2(result, key, nestedValue);
2321
2359
  }
2322
2360
  } else {
2323
- setNestedValue(result, key, value);
2361
+ setNestedValue2(result, key, value);
2324
2362
  }
2325
2363
  }
2326
2364
  }
@@ -2875,6 +2913,6 @@ var ModelSpanTracker = class {
2875
2913
  }
2876
2914
  };
2877
2915
 
2878
- export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, BaseExporter, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, ModelSpanTracker, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, checkEvalStorageFields, clearAITracingRegistry, createMastraProxy, deepClean, deepMerge, delay, ensureToolProperties, fetchWithRetry, generateEmptyFromSchema, getAITracing, getAllAITracing, getDefaultAITracing, getNestedValue, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isCoreMessage, isMastra, isUiMessage, isZodType, makeCoreTool, makeCoreToolV5, maskStreamTags, omitKeys, parseFieldKey, parseSqlIdentifier, registerAITracing, resolveSerializedZodOutput, selectFields, setNestedValue, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra };
2879
- //# sourceMappingURL=chunk-WIMFJ2BA.js.map
2880
- //# sourceMappingURL=chunk-WIMFJ2BA.js.map
2916
+ export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, BaseExporter, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, ModelSpanTracker, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, checkEvalStorageFields, clearAITracingRegistry, createMastraProxy, deepClean, deepMerge, delay, ensureToolProperties, fetchWithRetry, generateEmptyFromSchema, getAITracing, getAllAITracing, getDefaultAITracing, getNestedValue2 as getNestedValue, getNestedValue as getNestedValue2, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isCoreMessage, isMastra, isUiMessage, isZodType, makeCoreTool, makeCoreToolV5, maskStreamTags, omitKeys2 as omitKeys, omitKeys as omitKeys2, parseFieldKey, parseSqlIdentifier, registerAITracing, removeUndefinedValues, resolveSerializedZodOutput, selectFields2 as selectFields, selectFields as selectFields2, setNestedValue2 as setNestedValue, setNestedValue as setNestedValue2, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra };
2917
+ //# sourceMappingURL=chunk-PPAIPZ6C.js.map
2918
+ //# sourceMappingURL=chunk-PPAIPZ6C.js.map