@mastra/core 1.23.0-alpha.4 → 1.23.0-alpha.5

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 (219) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/agent/index.cjs +8 -8
  3. package/dist/agent/index.js +1 -1
  4. package/dist/base.cjs +2 -2
  5. package/dist/base.d.ts.map +1 -1
  6. package/dist/base.js +1 -1
  7. package/dist/browser/index.cjs +6 -6
  8. package/dist/browser/index.js +3 -3
  9. package/dist/bundler/index.cjs +2 -2
  10. package/dist/bundler/index.js +1 -1
  11. package/dist/cache/index.cjs +3 -3
  12. package/dist/cache/index.js +1 -1
  13. package/dist/channels/index.cjs +4 -4
  14. package/dist/channels/index.js +1 -1
  15. package/dist/{chunk-CIV5MFO6.cjs → chunk-25EDFTQD.cjs} +4 -4
  16. package/dist/{chunk-CIV5MFO6.cjs.map → chunk-25EDFTQD.cjs.map} +1 -1
  17. package/dist/{chunk-K6W2C7PA.js → chunk-3APK6ZID.js} +3 -3
  18. package/dist/{chunk-K6W2C7PA.js.map → chunk-3APK6ZID.js.map} +1 -1
  19. package/dist/{chunk-YRDMMXBW.cjs → chunk-47RKHZIP.cjs} +34 -2
  20. package/dist/chunk-47RKHZIP.cjs.map +1 -0
  21. package/dist/{chunk-JK5YBBUS.cjs → chunk-4W26D7S6.cjs} +13 -13
  22. package/dist/chunk-4W26D7S6.cjs.map +1 -0
  23. package/dist/{chunk-7273BIRR.js → chunk-6UQKQBIB.js} +3 -3
  24. package/dist/{chunk-7273BIRR.js.map → chunk-6UQKQBIB.js.map} +1 -1
  25. package/dist/{chunk-G5WUD7SF.js → chunk-72EQLBZY.js} +3 -3
  26. package/dist/{chunk-G5WUD7SF.js.map → chunk-72EQLBZY.js.map} +1 -1
  27. package/dist/{chunk-C3G6OQ52.cjs → chunk-7DONY7OL.cjs} +10 -11
  28. package/dist/chunk-7DONY7OL.cjs.map +1 -0
  29. package/dist/{chunk-HBO2PK7W.cjs → chunk-7GW2TQXP.cjs} +4 -3
  30. package/dist/chunk-7GW2TQXP.cjs.map +1 -0
  31. package/dist/{chunk-74IXDLKF.cjs → chunk-7STIIXEL.cjs} +3 -3
  32. package/dist/{chunk-74IXDLKF.cjs.map → chunk-7STIIXEL.cjs.map} +1 -1
  33. package/dist/{chunk-44P7C37G.js → chunk-BMS7MLQV.js} +31 -3
  34. package/dist/chunk-BMS7MLQV.js.map +1 -0
  35. package/dist/{chunk-GEI2HTYE.js → chunk-C77V6J36.js} +3 -3
  36. package/dist/{chunk-GEI2HTYE.js.map → chunk-C77V6J36.js.map} +1 -1
  37. package/dist/{chunk-ANFGVHG2.cjs → chunk-DAQ4JZQA.cjs} +4 -4
  38. package/dist/{chunk-ANFGVHG2.cjs.map → chunk-DAQ4JZQA.cjs.map} +1 -1
  39. package/dist/{chunk-M3LRSDLL.js → chunk-DBBWTK24.js} +4 -3
  40. package/dist/chunk-DBBWTK24.js.map +1 -0
  41. package/dist/{chunk-JSG6FULW.cjs → chunk-DO4JBKMT.cjs} +109 -110
  42. package/dist/chunk-DO4JBKMT.cjs.map +1 -0
  43. package/dist/{chunk-PGXL3YYH.js → chunk-EG3UGEUZ.js} +4 -4
  44. package/dist/{chunk-PGXL3YYH.js.map → chunk-EG3UGEUZ.js.map} +1 -1
  45. package/dist/{chunk-KRDAO5BB.js → chunk-EXORPYDN.js} +3 -3
  46. package/dist/{chunk-KRDAO5BB.js.map → chunk-EXORPYDN.js.map} +1 -1
  47. package/dist/{chunk-DKK77FIJ.cjs → chunk-FCQNDFEW.cjs} +7 -7
  48. package/dist/chunk-FCQNDFEW.cjs.map +1 -0
  49. package/dist/{chunk-SQXNHM6M.cjs → chunk-FSHOQBGF.cjs} +28 -28
  50. package/dist/{chunk-SQXNHM6M.cjs.map → chunk-FSHOQBGF.cjs.map} +1 -1
  51. package/dist/{chunk-3EXOZA2Y.js → chunk-HQXVBGBM.js} +3 -3
  52. package/dist/{chunk-3EXOZA2Y.js.map → chunk-HQXVBGBM.js.map} +1 -1
  53. package/dist/{chunk-UUVQS3OG.js → chunk-HWAEQSOO.js} +12 -12
  54. package/dist/{chunk-UUVQS3OG.js.map → chunk-HWAEQSOO.js.map} +1 -1
  55. package/dist/{chunk-OF675HEC.cjs → chunk-I4YMMVQ3.cjs} +4 -4
  56. package/dist/{chunk-OF675HEC.cjs.map → chunk-I4YMMVQ3.cjs.map} +1 -1
  57. package/dist/{chunk-C264FG5X.js → chunk-I6XSSR4Z.js} +8 -8
  58. package/dist/{chunk-C264FG5X.js.map → chunk-I6XSSR4Z.js.map} +1 -1
  59. package/dist/{chunk-JAAICSXU.cjs → chunk-JF3WPB75.cjs} +32 -32
  60. package/dist/{chunk-JAAICSXU.cjs.map → chunk-JF3WPB75.cjs.map} +1 -1
  61. package/dist/{chunk-R577LMHJ.cjs → chunk-JJFGNYVY.cjs} +7 -7
  62. package/dist/{chunk-R577LMHJ.cjs.map → chunk-JJFGNYVY.cjs.map} +1 -1
  63. package/dist/{chunk-MISEF5LK.js → chunk-JNXWDPCZ.js} +6 -6
  64. package/dist/chunk-JNXWDPCZ.js.map +1 -0
  65. package/dist/{chunk-AQUKI2MV.js → chunk-L2MCWEEX.js} +6 -6
  66. package/dist/{chunk-AQUKI2MV.js.map → chunk-L2MCWEEX.js.map} +1 -1
  67. package/dist/{chunk-6VIWRHC3.js → chunk-QIJFD7ZC.js} +5 -5
  68. package/dist/{chunk-6VIWRHC3.js.map → chunk-QIJFD7ZC.js.map} +1 -1
  69. package/dist/{chunk-7QI6WHSE.js → chunk-QRK2HWHI.js} +8 -8
  70. package/dist/{chunk-7QI6WHSE.js.map → chunk-QRK2HWHI.js.map} +1 -1
  71. package/dist/{chunk-KCVSVDQ2.js → chunk-QYQSXRFZ.js} +13 -14
  72. package/dist/chunk-QYQSXRFZ.js.map +1 -0
  73. package/dist/{chunk-T26CFBWF.cjs → chunk-RAD2NM47.cjs} +4 -4
  74. package/dist/{chunk-T26CFBWF.cjs.map → chunk-RAD2NM47.cjs.map} +1 -1
  75. package/dist/{chunk-NBOTSCZC.js → chunk-TG46FM6X.js} +4 -4
  76. package/dist/{chunk-NBOTSCZC.js.map → chunk-TG46FM6X.js.map} +1 -1
  77. package/dist/{chunk-Y67VWDR7.cjs → chunk-TKH2A57J.cjs} +185 -185
  78. package/dist/{chunk-Y67VWDR7.cjs.map → chunk-TKH2A57J.cjs.map} +1 -1
  79. package/dist/{chunk-DBN5B2LH.cjs → chunk-UENWRQLR.cjs} +18 -18
  80. package/dist/{chunk-DBN5B2LH.cjs.map → chunk-UENWRQLR.cjs.map} +1 -1
  81. package/dist/{chunk-ZOLIH66J.cjs → chunk-V7AX2MSJ.cjs} +20 -20
  82. package/dist/{chunk-ZOLIH66J.cjs.map → chunk-V7AX2MSJ.cjs.map} +1 -1
  83. package/dist/{chunk-Z2IR7J5I.js → chunk-VO6R5RZT.js} +8 -9
  84. package/dist/chunk-VO6R5RZT.js.map +1 -0
  85. package/dist/{chunk-DNW46JHP.js → chunk-WENZPAHS.js} +4 -4
  86. package/dist/chunk-WENZPAHS.js.map +1 -0
  87. package/dist/{chunk-HIC3WGQU.cjs → chunk-X6CDTXAM.cjs} +11 -11
  88. package/dist/{chunk-HIC3WGQU.cjs.map → chunk-X6CDTXAM.cjs.map} +1 -1
  89. package/dist/{chunk-CHY6AP6N.cjs → chunk-XFLQVMNH.cjs} +26 -26
  90. package/dist/{chunk-CHY6AP6N.cjs.map → chunk-XFLQVMNH.cjs.map} +1 -1
  91. package/dist/{chunk-OFABGAOY.cjs → chunk-XZCYFQ4N.cjs} +64 -65
  92. package/dist/chunk-XZCYFQ4N.cjs.map +1 -0
  93. package/dist/{chunk-LBL7GNPF.cjs → chunk-YR7XRMDN.cjs} +10 -10
  94. package/dist/{chunk-LBL7GNPF.cjs.map → chunk-YR7XRMDN.cjs.map} +1 -1
  95. package/dist/{chunk-XGUUUEE4.js → chunk-Z34TVGNZ.js} +4 -4
  96. package/dist/{chunk-XGUUUEE4.js.map → chunk-Z34TVGNZ.js.map} +1 -1
  97. package/dist/{chunk-EHBTASCW.js → chunk-Z63F3XHK.js} +5 -6
  98. package/dist/chunk-Z63F3XHK.js.map +1 -0
  99. package/dist/{chunk-KJDRVBAH.cjs → chunk-Z67JQNEH.cjs} +11 -11
  100. package/dist/{chunk-KJDRVBAH.cjs.map → chunk-Z67JQNEH.cjs.map} +1 -1
  101. package/dist/{chunk-QVTTP5HC.js → chunk-ZCBMZ24O.js} +3 -3
  102. package/dist/{chunk-QVTTP5HC.js.map → chunk-ZCBMZ24O.js.map} +1 -1
  103. package/dist/{chunk-NMO7ITAY.js → chunk-ZHYPWNWS.js} +5 -5
  104. package/dist/{chunk-NMO7ITAY.js.map → chunk-ZHYPWNWS.js.map} +1 -1
  105. package/dist/{chunk-B7JN64YW.cjs → chunk-ZUN5CMDY.cjs} +86 -86
  106. package/dist/{chunk-B7JN64YW.cjs.map → chunk-ZUN5CMDY.cjs.map} +1 -1
  107. package/dist/datasets/index.cjs +17 -17
  108. package/dist/datasets/index.js +2 -2
  109. package/dist/deployer/index.cjs +2 -2
  110. package/dist/deployer/index.js +1 -1
  111. package/dist/docs/SKILL.md +2 -2
  112. package/dist/docs/assets/SOURCE_MAP.json +499 -499
  113. package/dist/docs/references/reference-templates-overview.md +88 -14
  114. package/dist/evals/index.cjs +23 -23
  115. package/dist/evals/index.js +3 -3
  116. package/dist/evals/scoreTraces/index.cjs +7 -7
  117. package/dist/evals/scoreTraces/index.js +3 -3
  118. package/dist/harness/index.cjs +13 -13
  119. package/dist/harness/index.js +7 -7
  120. package/dist/index.cjs +2 -2
  121. package/dist/index.js +1 -1
  122. package/dist/llm/index.cjs +20 -20
  123. package/dist/llm/index.js +5 -5
  124. package/dist/logger/default-logger.d.ts +1 -1
  125. package/dist/logger/default-logger.d.ts.map +1 -1
  126. package/dist/logger/index.cjs +12 -12
  127. package/dist/logger/index.js +2 -2
  128. package/dist/loop/index.cjs +14 -14
  129. package/dist/loop/index.js +1 -1
  130. package/dist/mastra/index.cjs +2 -2
  131. package/dist/mastra/index.js +1 -1
  132. package/dist/mastra-O4WWP6N5.js +3 -0
  133. package/dist/{mastra-5WYO5ZWG.js.map → mastra-O4WWP6N5.js.map} +1 -1
  134. package/dist/mastra-VHS7LVQG.cjs +12 -0
  135. package/dist/{mastra-LIISVKXT.cjs.map → mastra-VHS7LVQG.cjs.map} +1 -1
  136. package/dist/mcp/index.cjs +4 -4
  137. package/dist/mcp/index.js +2 -2
  138. package/dist/memory/index.cjs +17 -17
  139. package/dist/memory/index.js +1 -1
  140. package/dist/models-dev-3IPTEPRM.cjs +12 -0
  141. package/dist/{models-dev-GD4LL56A.cjs.map → models-dev-3IPTEPRM.cjs.map} +1 -1
  142. package/dist/models-dev-4W7JQVWR.js +3 -0
  143. package/dist/{models-dev-CJ7IIPNG.js.map → models-dev-4W7JQVWR.js.map} +1 -1
  144. package/dist/netlify-FZBGNFDI.js +3 -0
  145. package/dist/{netlify-PMGHRONJ.js.map → netlify-FZBGNFDI.js.map} +1 -1
  146. package/dist/netlify-XT32D45G.cjs +12 -0
  147. package/dist/{netlify-6V7UBVTK.cjs.map → netlify-XT32D45G.cjs.map} +1 -1
  148. package/dist/observability/context-storage.cjs +28 -14
  149. package/dist/observability/context-storage.cjs.map +1 -1
  150. package/dist/observability/context-storage.d.ts.map +1 -1
  151. package/dist/observability/context-storage.js +28 -1
  152. package/dist/observability/context-storage.js.map +1 -1
  153. package/dist/observability/index.cjs +26 -10
  154. package/dist/observability/index.js +1 -1
  155. package/dist/observability/utils.d.ts +27 -0
  156. package/dist/observability/utils.d.ts.map +1 -1
  157. package/dist/processor-provider/index.cjs +10 -10
  158. package/dist/processor-provider/index.js +1 -1
  159. package/dist/processors/index.cjs +44 -44
  160. package/dist/processors/index.js +1 -1
  161. package/dist/provider-registry-AWL2JDVF.js +3 -0
  162. package/dist/{provider-registry-JV46DWD7.js.map → provider-registry-AWL2JDVF.js.map} +1 -1
  163. package/dist/provider-registry-X5PBSJ2G.cjs +40 -0
  164. package/dist/{provider-registry-U26G7C4O.cjs.map → provider-registry-X5PBSJ2G.cjs.map} +1 -1
  165. package/dist/relevance/index.cjs +3 -3
  166. package/dist/relevance/index.js +1 -1
  167. package/dist/server/index.cjs +5 -5
  168. package/dist/server/index.js +2 -2
  169. package/dist/storage/constants.cjs +56 -56
  170. package/dist/storage/constants.js +1 -1
  171. package/dist/storage/index.cjs +286 -286
  172. package/dist/storage/index.js +3 -3
  173. package/dist/stream/index.cjs +8 -8
  174. package/dist/stream/index.js +1 -1
  175. package/dist/test-utils/llm-mock.cjs +4 -4
  176. package/dist/test-utils/llm-mock.js +1 -1
  177. package/dist/tool-loop-agent/index.cjs +4 -4
  178. package/dist/tool-loop-agent/index.js +1 -1
  179. package/dist/tts/index.cjs +2 -2
  180. package/dist/tts/index.js +1 -1
  181. package/dist/utils.cjs +25 -25
  182. package/dist/utils.js +1 -1
  183. package/dist/vector/index.cjs +9 -9
  184. package/dist/vector/index.js +2 -2
  185. package/dist/voice/index.cjs +6 -6
  186. package/dist/voice/index.js +1 -1
  187. package/dist/workflows/evented/index.cjs +10 -10
  188. package/dist/workflows/evented/index.js +1 -1
  189. package/dist/workflows/index.cjs +24 -24
  190. package/dist/workflows/index.js +1 -1
  191. package/dist/workspace/index.cjs +68 -68
  192. package/dist/workspace/index.js +1 -1
  193. package/package.json +5 -5
  194. package/dist/chunk-2DKOLMVJ.js +0 -28
  195. package/dist/chunk-2DKOLMVJ.js.map +0 -1
  196. package/dist/chunk-44P7C37G.js.map +0 -1
  197. package/dist/chunk-C3G6OQ52.cjs.map +0 -1
  198. package/dist/chunk-D5FMOLQZ.cjs +0 -32
  199. package/dist/chunk-D5FMOLQZ.cjs.map +0 -1
  200. package/dist/chunk-DKK77FIJ.cjs.map +0 -1
  201. package/dist/chunk-DNW46JHP.js.map +0 -1
  202. package/dist/chunk-EHBTASCW.js.map +0 -1
  203. package/dist/chunk-HBO2PK7W.cjs.map +0 -1
  204. package/dist/chunk-JK5YBBUS.cjs.map +0 -1
  205. package/dist/chunk-JSG6FULW.cjs.map +0 -1
  206. package/dist/chunk-KCVSVDQ2.js.map +0 -1
  207. package/dist/chunk-M3LRSDLL.js.map +0 -1
  208. package/dist/chunk-MISEF5LK.js.map +0 -1
  209. package/dist/chunk-OFABGAOY.cjs.map +0 -1
  210. package/dist/chunk-YRDMMXBW.cjs.map +0 -1
  211. package/dist/chunk-Z2IR7J5I.js.map +0 -1
  212. package/dist/mastra-5WYO5ZWG.js +0 -3
  213. package/dist/mastra-LIISVKXT.cjs +0 -12
  214. package/dist/models-dev-CJ7IIPNG.js +0 -3
  215. package/dist/models-dev-GD4LL56A.cjs +0 -12
  216. package/dist/netlify-6V7UBVTK.cjs +0 -12
  217. package/dist/netlify-PMGHRONJ.js +0 -3
  218. package/dist/provider-registry-JV46DWD7.js +0 -3
  219. package/dist/provider-registry-U26G7C4O.cjs +0 -40
@@ -1,49 +1,49 @@
1
1
  'use strict';
2
2
 
3
- var chunkANFGVHG2_cjs = require('../chunk-ANFGVHG2.cjs');
4
- var chunkHBO2PK7W_cjs = require('../chunk-HBO2PK7W.cjs');
3
+ var chunkDAQ4JZQA_cjs = require('../chunk-DAQ4JZQA.cjs');
4
+ var chunk7GW2TQXP_cjs = require('../chunk-7GW2TQXP.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "DualLogger", {
9
9
  enumerable: true,
10
- get: function () { return chunkANFGVHG2_cjs.DualLogger; }
10
+ get: function () { return chunkDAQ4JZQA_cjs.DualLogger; }
11
11
  });
12
12
  Object.defineProperty(exports, "LoggerTransport", {
13
13
  enumerable: true,
14
- get: function () { return chunkANFGVHG2_cjs.LoggerTransport; }
14
+ get: function () { return chunkDAQ4JZQA_cjs.LoggerTransport; }
15
15
  });
16
16
  Object.defineProperty(exports, "MultiLogger", {
17
17
  enumerable: true,
18
- get: function () { return chunkANFGVHG2_cjs.MultiLogger; }
18
+ get: function () { return chunkDAQ4JZQA_cjs.MultiLogger; }
19
19
  });
20
20
  Object.defineProperty(exports, "createCustomTransport", {
21
21
  enumerable: true,
22
- get: function () { return chunkANFGVHG2_cjs.createCustomTransport; }
22
+ get: function () { return chunkDAQ4JZQA_cjs.createCustomTransport; }
23
23
  });
24
24
  Object.defineProperty(exports, "noopLogger", {
25
25
  enumerable: true,
26
- get: function () { return chunkANFGVHG2_cjs.noopLogger; }
26
+ get: function () { return chunkDAQ4JZQA_cjs.noopLogger; }
27
27
  });
28
28
  Object.defineProperty(exports, "ConsoleLogger", {
29
29
  enumerable: true,
30
- get: function () { return chunkHBO2PK7W_cjs.ConsoleLogger; }
30
+ get: function () { return chunk7GW2TQXP_cjs.ConsoleLogger; }
31
31
  });
32
32
  Object.defineProperty(exports, "LogLevel", {
33
33
  enumerable: true,
34
- get: function () { return chunkHBO2PK7W_cjs.LogLevel; }
34
+ get: function () { return chunk7GW2TQXP_cjs.LogLevel; }
35
35
  });
36
36
  Object.defineProperty(exports, "MastraLogger", {
37
37
  enumerable: true,
38
- get: function () { return chunkHBO2PK7W_cjs.MastraLogger; }
38
+ get: function () { return chunk7GW2TQXP_cjs.MastraLogger; }
39
39
  });
40
40
  Object.defineProperty(exports, "RegisteredLogger", {
41
41
  enumerable: true,
42
- get: function () { return chunkHBO2PK7W_cjs.RegisteredLogger; }
42
+ get: function () { return chunk7GW2TQXP_cjs.RegisteredLogger; }
43
43
  });
44
44
  Object.defineProperty(exports, "createLogger", {
45
45
  enumerable: true,
46
- get: function () { return chunkHBO2PK7W_cjs.createLogger; }
46
+ get: function () { return chunk7GW2TQXP_cjs.createLogger; }
47
47
  });
48
48
  //# sourceMappingURL=index.cjs.map
49
49
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- export { DualLogger, LoggerTransport, MultiLogger, createCustomTransport, noopLogger } from '../chunk-GEI2HTYE.js';
2
- export { ConsoleLogger, LogLevel, MastraLogger, RegisteredLogger, createLogger } from '../chunk-M3LRSDLL.js';
1
+ export { DualLogger, LoggerTransport, MultiLogger, createCustomTransport, noopLogger } from '../chunk-C77V6J36.js';
2
+ export { ConsoleLogger, LogLevel, MastraLogger, RegisteredLogger, createLogger } from '../chunk-DBBWTK24.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,60 +1,60 @@
1
1
  'use strict';
2
2
 
3
- var chunkJSG6FULW_cjs = require('../chunk-JSG6FULW.cjs');
3
+ var chunkDO4JBKMT_cjs = require('../chunk-DO4JBKMT.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createScorer", {
8
8
  enumerable: true,
9
- get: function () { return chunkJSG6FULW_cjs.createScorer; }
9
+ get: function () { return chunkDO4JBKMT_cjs.createScorer; }
10
10
  });
11
11
  Object.defineProperty(exports, "formatCheckFeedback", {
12
12
  enumerable: true,
13
- get: function () { return chunkJSG6FULW_cjs.formatCheckFeedback; }
13
+ get: function () { return chunkDO4JBKMT_cjs.formatCheckFeedback; }
14
14
  });
15
15
  Object.defineProperty(exports, "formatCompletionFeedback", {
16
16
  enumerable: true,
17
- get: function () { return chunkJSG6FULW_cjs.formatCompletionFeedback; }
17
+ get: function () { return chunkDO4JBKMT_cjs.formatCompletionFeedback; }
18
18
  });
19
19
  Object.defineProperty(exports, "formatStreamCompletionFeedback", {
20
20
  enumerable: true,
21
- get: function () { return chunkJSG6FULW_cjs.formatStreamCompletionFeedback; }
21
+ get: function () { return chunkDO4JBKMT_cjs.formatStreamCompletionFeedback; }
22
22
  });
23
23
  Object.defineProperty(exports, "formatValidationFeedback", {
24
24
  enumerable: true,
25
- get: function () { return chunkJSG6FULW_cjs.formatValidationFeedback; }
25
+ get: function () { return chunkDO4JBKMT_cjs.formatValidationFeedback; }
26
26
  });
27
27
  Object.defineProperty(exports, "generateFinalResult", {
28
28
  enumerable: true,
29
- get: function () { return chunkJSG6FULW_cjs.generateFinalResult; }
29
+ get: function () { return chunkDO4JBKMT_cjs.generateFinalResult; }
30
30
  });
31
31
  Object.defineProperty(exports, "generateStructuredFinalResult", {
32
32
  enumerable: true,
33
- get: function () { return chunkJSG6FULW_cjs.generateStructuredFinalResult; }
33
+ get: function () { return chunkDO4JBKMT_cjs.generateStructuredFinalResult; }
34
34
  });
35
35
  Object.defineProperty(exports, "loop", {
36
36
  enumerable: true,
37
- get: function () { return chunkJSG6FULW_cjs.loop; }
37
+ get: function () { return chunkDO4JBKMT_cjs.loop; }
38
38
  });
39
39
  Object.defineProperty(exports, "runChecks", {
40
40
  enumerable: true,
41
- get: function () { return chunkJSG6FULW_cjs.runChecks; }
41
+ get: function () { return chunkDO4JBKMT_cjs.runChecks; }
42
42
  });
43
43
  Object.defineProperty(exports, "runCompletionScorers", {
44
44
  enumerable: true,
45
- get: function () { return chunkJSG6FULW_cjs.runCompletionScorers; }
45
+ get: function () { return chunkDO4JBKMT_cjs.runCompletionScorers; }
46
46
  });
47
47
  Object.defineProperty(exports, "runDefaultCompletionCheck", {
48
48
  enumerable: true,
49
- get: function () { return chunkJSG6FULW_cjs.runDefaultCompletionCheck; }
49
+ get: function () { return chunkDO4JBKMT_cjs.runDefaultCompletionCheck; }
50
50
  });
51
51
  Object.defineProperty(exports, "runStreamCompletionScorers", {
52
52
  enumerable: true,
53
- get: function () { return chunkJSG6FULW_cjs.runStreamCompletionScorers; }
53
+ get: function () { return chunkDO4JBKMT_cjs.runStreamCompletionScorers; }
54
54
  });
55
55
  Object.defineProperty(exports, "runValidation", {
56
56
  enumerable: true,
57
- get: function () { return chunkJSG6FULW_cjs.runValidation; }
57
+ get: function () { return chunkDO4JBKMT_cjs.runValidation; }
58
58
  });
59
59
  //# sourceMappingURL=index.cjs.map
60
60
  //# sourceMappingURL=index.cjs.map
@@ -1,3 +1,3 @@
1
- export { createScorer, formatCheckFeedback, formatCompletionFeedback, formatStreamCompletionFeedback, formatValidationFeedback, generateFinalResult, generateStructuredFinalResult, loop, runChecks, runCompletionScorers, runDefaultCompletionCheck, runStreamCompletionScorers, runValidation } from '../chunk-KCVSVDQ2.js';
1
+ export { createScorer, formatCheckFeedback, formatCompletionFeedback, formatStreamCompletionFeedback, formatValidationFeedback, generateFinalResult, generateStructuredFinalResult, loop, runChecks, runCompletionScorers, runDefaultCompletionCheck, runStreamCompletionScorers, runValidation } from '../chunk-QYQSXRFZ.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkCHY6AP6N_cjs = require('../chunk-CHY6AP6N.cjs');
3
+ var chunkXFLQVMNH_cjs = require('../chunk-XFLQVMNH.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Mastra", {
8
8
  enumerable: true,
9
- get: function () { return chunkCHY6AP6N_cjs.Mastra; }
9
+ get: function () { return chunkXFLQVMNH_cjs.Mastra; }
10
10
  });
11
11
  //# sourceMappingURL=index.cjs.map
12
12
  //# sourceMappingURL=index.cjs.map
@@ -1,3 +1,3 @@
1
- export { Mastra } from '../chunk-UUVQS3OG.js';
1
+ export { Mastra } from '../chunk-HWAEQSOO.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ export { MastraGateway } from './chunk-I6XSSR4Z.js';
2
+ //# sourceMappingURL=mastra-O4WWP6N5.js.map
3
+ //# sourceMappingURL=mastra-O4WWP6N5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"mastra-5WYO5ZWG.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"mastra-O4WWP6N5.js"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkV7AX2MSJ_cjs = require('./chunk-V7AX2MSJ.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "MastraGateway", {
8
+ enumerable: true,
9
+ get: function () { return chunkV7AX2MSJ_cjs.MastraGateway; }
10
+ });
11
+ //# sourceMappingURL=mastra-VHS7LVQG.cjs.map
12
+ //# sourceMappingURL=mastra-VHS7LVQG.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"mastra-LIISVKXT.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"mastra-VHS7LVQG.cjs"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk4U7ZLI36_cjs = require('../chunk-4U7ZLI36.cjs');
4
- var chunkDKK77FIJ_cjs = require('../chunk-DKK77FIJ.cjs');
5
- var chunkHBO2PK7W_cjs = require('../chunk-HBO2PK7W.cjs');
4
+ var chunkFCQNDFEW_cjs = require('../chunk-FCQNDFEW.cjs');
5
+ var chunk7GW2TQXP_cjs = require('../chunk-7GW2TQXP.cjs');
6
6
  var crypto = require('crypto');
7
7
  var slugify = require('@sindresorhus/slugify');
8
8
 
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
10
 
11
11
  var slugify__default = /*#__PURE__*/_interopDefault(slugify);
12
12
 
13
- var MCPServerBase = class extends chunkDKK77FIJ_cjs.MastraBase {
13
+ var MCPServerBase = class extends chunkFCQNDFEW_cjs.MastraBase {
14
14
  /** Tracks if the server ID has been definitively set. */
15
15
  idWasSet = false;
16
16
  /** The display name of the MCP server. */
@@ -123,7 +123,7 @@ var MCPServerBase = class extends chunkDKK77FIJ_cjs.MastraBase {
123
123
  * @param config Configuration options for the MCP server, including metadata.
124
124
  */
125
125
  constructor(config) {
126
- super({ component: chunkHBO2PK7W_cjs.RegisteredLogger.MCP_SERVER, name: config.name });
126
+ super({ component: chunk7GW2TQXP_cjs.RegisteredLogger.MCP_SERVER, name: config.name });
127
127
  this.name = config.name;
128
128
  this.version = config.version;
129
129
  if (config.id) {
package/dist/mcp/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { MastraError } from '../chunk-FJEVLHJT.js';
2
- import { MastraBase } from '../chunk-DNW46JHP.js';
3
- import { RegisteredLogger } from '../chunk-M3LRSDLL.js';
2
+ import { MastraBase } from '../chunk-WENZPAHS.js';
3
+ import { RegisteredLogger } from '../chunk-DBBWTK24.js';
4
4
  import { randomUUID } from 'crypto';
5
5
  import slugify from '@sindresorhus/slugify';
6
6
 
@@ -1,72 +1,72 @@
1
1
  'use strict';
2
2
 
3
- var chunkJSG6FULW_cjs = require('../chunk-JSG6FULW.cjs');
3
+ var chunkDO4JBKMT_cjs = require('../chunk-DO4JBKMT.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "MastraMemory", {
8
8
  enumerable: true,
9
- get: function () { return chunkJSG6FULW_cjs.MastraMemory; }
9
+ get: function () { return chunkDO4JBKMT_cjs.MastraMemory; }
10
10
  });
11
11
  Object.defineProperty(exports, "MemoryProcessor", {
12
12
  enumerable: true,
13
- get: function () { return chunkJSG6FULW_cjs.MemoryProcessor; }
13
+ get: function () { return chunkDO4JBKMT_cjs.MemoryProcessor; }
14
14
  });
15
15
  Object.defineProperty(exports, "MockMemory", {
16
16
  enumerable: true,
17
- get: function () { return chunkJSG6FULW_cjs.MockMemory; }
17
+ get: function () { return chunkDO4JBKMT_cjs.MockMemory; }
18
18
  });
19
19
  Object.defineProperty(exports, "SYSTEM_REMINDER_END_TAG", {
20
20
  enumerable: true,
21
- get: function () { return chunkJSG6FULW_cjs.SYSTEM_REMINDER_END_TAG; }
21
+ get: function () { return chunkDO4JBKMT_cjs.SYSTEM_REMINDER_END_TAG; }
22
22
  });
23
23
  Object.defineProperty(exports, "SYSTEM_REMINDER_START_TAG", {
24
24
  enumerable: true,
25
- get: function () { return chunkJSG6FULW_cjs.SYSTEM_REMINDER_START_TAG; }
25
+ get: function () { return chunkDO4JBKMT_cjs.SYSTEM_REMINDER_START_TAG; }
26
26
  });
27
27
  Object.defineProperty(exports, "WORKING_MEMORY_END_TAG", {
28
28
  enumerable: true,
29
- get: function () { return chunkJSG6FULW_cjs.WORKING_MEMORY_END_TAG; }
29
+ get: function () { return chunkDO4JBKMT_cjs.WORKING_MEMORY_END_TAG; }
30
30
  });
31
31
  Object.defineProperty(exports, "WORKING_MEMORY_START_TAG", {
32
32
  enumerable: true,
33
- get: function () { return chunkJSG6FULW_cjs.WORKING_MEMORY_START_TAG; }
33
+ get: function () { return chunkDO4JBKMT_cjs.WORKING_MEMORY_START_TAG; }
34
34
  });
35
35
  Object.defineProperty(exports, "extractWorkingMemoryContent", {
36
36
  enumerable: true,
37
- get: function () { return chunkJSG6FULW_cjs.extractWorkingMemoryContent; }
37
+ get: function () { return chunkDO4JBKMT_cjs.extractWorkingMemoryContent; }
38
38
  });
39
39
  Object.defineProperty(exports, "extractWorkingMemoryTags", {
40
40
  enumerable: true,
41
- get: function () { return chunkJSG6FULW_cjs.extractWorkingMemoryTags; }
41
+ get: function () { return chunkDO4JBKMT_cjs.extractWorkingMemoryTags; }
42
42
  });
43
43
  Object.defineProperty(exports, "getThreadOMMetadata", {
44
44
  enumerable: true,
45
- get: function () { return chunkJSG6FULW_cjs.getThreadOMMetadata; }
45
+ get: function () { return chunkDO4JBKMT_cjs.getThreadOMMetadata; }
46
46
  });
47
47
  Object.defineProperty(exports, "isObservationalMemoryEnabled", {
48
48
  enumerable: true,
49
- get: function () { return chunkJSG6FULW_cjs.isObservationalMemoryEnabled; }
49
+ get: function () { return chunkDO4JBKMT_cjs.isObservationalMemoryEnabled; }
50
50
  });
51
51
  Object.defineProperty(exports, "memoryDefaultOptions", {
52
52
  enumerable: true,
53
- get: function () { return chunkJSG6FULW_cjs.memoryDefaultOptions; }
53
+ get: function () { return chunkDO4JBKMT_cjs.memoryDefaultOptions; }
54
54
  });
55
55
  Object.defineProperty(exports, "parseMemoryRequestContext", {
56
56
  enumerable: true,
57
- get: function () { return chunkJSG6FULW_cjs.parseMemoryRequestContext; }
57
+ get: function () { return chunkDO4JBKMT_cjs.parseMemoryRequestContext; }
58
58
  });
59
59
  Object.defineProperty(exports, "removeSystemReminderTags", {
60
60
  enumerable: true,
61
- get: function () { return chunkJSG6FULW_cjs.removeSystemReminderTags; }
61
+ get: function () { return chunkDO4JBKMT_cjs.removeSystemReminderTags; }
62
62
  });
63
63
  Object.defineProperty(exports, "removeWorkingMemoryTags", {
64
64
  enumerable: true,
65
- get: function () { return chunkJSG6FULW_cjs.removeWorkingMemoryTags; }
65
+ get: function () { return chunkDO4JBKMT_cjs.removeWorkingMemoryTags; }
66
66
  });
67
67
  Object.defineProperty(exports, "setThreadOMMetadata", {
68
68
  enumerable: true,
69
- get: function () { return chunkJSG6FULW_cjs.setThreadOMMetadata; }
69
+ get: function () { return chunkDO4JBKMT_cjs.setThreadOMMetadata; }
70
70
  });
71
71
  //# sourceMappingURL=index.cjs.map
72
72
  //# sourceMappingURL=index.cjs.map
@@ -1,3 +1,3 @@
1
- export { MastraMemory, MemoryProcessor, MockMemory, SYSTEM_REMINDER_END_TAG, SYSTEM_REMINDER_START_TAG, WORKING_MEMORY_END_TAG, WORKING_MEMORY_START_TAG, extractWorkingMemoryContent, extractWorkingMemoryTags, getThreadOMMetadata, isObservationalMemoryEnabled, memoryDefaultOptions, parseMemoryRequestContext, removeSystemReminderTags, removeWorkingMemoryTags, setThreadOMMetadata } from '../chunk-KCVSVDQ2.js';
1
+ export { MastraMemory, MemoryProcessor, MockMemory, SYSTEM_REMINDER_END_TAG, SYSTEM_REMINDER_START_TAG, WORKING_MEMORY_END_TAG, WORKING_MEMORY_START_TAG, extractWorkingMemoryContent, extractWorkingMemoryTags, getThreadOMMetadata, isObservationalMemoryEnabled, memoryDefaultOptions, parseMemoryRequestContext, removeSystemReminderTags, removeWorkingMemoryTags, setThreadOMMetadata } from '../chunk-QYQSXRFZ.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkTKH2A57J_cjs = require('./chunk-TKH2A57J.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "ModelsDevGateway", {
8
+ enumerable: true,
9
+ get: function () { return chunkTKH2A57J_cjs.ModelsDevGateway; }
10
+ });
11
+ //# sourceMappingURL=models-dev-3IPTEPRM.cjs.map
12
+ //# sourceMappingURL=models-dev-3IPTEPRM.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"models-dev-GD4LL56A.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"models-dev-3IPTEPRM.cjs"}
@@ -0,0 +1,3 @@
1
+ export { ModelsDevGateway } from './chunk-6UQKQBIB.js';
2
+ //# sourceMappingURL=models-dev-4W7JQVWR.js.map
3
+ //# sourceMappingURL=models-dev-4W7JQVWR.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"models-dev-CJ7IIPNG.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"models-dev-4W7JQVWR.js"}
@@ -0,0 +1,3 @@
1
+ export { NetlifyGateway } from './chunk-TG46FM6X.js';
2
+ //# sourceMappingURL=netlify-FZBGNFDI.js.map
3
+ //# sourceMappingURL=netlify-FZBGNFDI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"netlify-PMGHRONJ.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"netlify-FZBGNFDI.js"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkZ67JQNEH_cjs = require('./chunk-Z67JQNEH.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "NetlifyGateway", {
8
+ enumerable: true,
9
+ get: function () { return chunkZ67JQNEH_cjs.NetlifyGateway; }
10
+ });
11
+ //# sourceMappingURL=netlify-XT32D45G.cjs.map
12
+ //# sourceMappingURL=netlify-XT32D45G.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"netlify-6V7UBVTK.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"netlify-XT32D45G.cjs"}
@@ -1,20 +1,34 @@
1
1
  'use strict';
2
2
 
3
- var chunkD5FMOLQZ_cjs = require('../chunk-D5FMOLQZ.cjs');
3
+ var chunk47RKHZIP_cjs = require('../chunk-47RKHZIP.cjs');
4
+ var async_hooks = require('async_hooks');
4
5
 
6
+ var spanContextStorage = new async_hooks.AsyncLocalStorage();
7
+ function getCurrentSpan() {
8
+ return spanContextStorage.getStore();
9
+ }
10
+ chunk47RKHZIP_cjs.setCurrentSpanResolver(getCurrentSpan);
11
+ chunk47RKHZIP_cjs.setExecuteWithContext(executeWithContext);
12
+ chunk47RKHZIP_cjs.setExecuteWithContextSync(executeWithContextSync);
13
+ async function executeWithContext(params) {
14
+ const { span, fn } = params;
15
+ const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;
16
+ if (span?.executeInContext) {
17
+ return span.executeInContext(wrappedFn);
18
+ }
19
+ return wrappedFn();
20
+ }
21
+ function executeWithContextSync(params) {
22
+ const { span, fn } = params;
23
+ const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;
24
+ if (span?.executeInContextSync) {
25
+ return span.executeInContextSync(wrappedFn);
26
+ }
27
+ return wrappedFn();
28
+ }
5
29
 
6
-
7
- Object.defineProperty(exports, "executeWithContext", {
8
- enumerable: true,
9
- get: function () { return chunkD5FMOLQZ_cjs.executeWithContext; }
10
- });
11
- Object.defineProperty(exports, "executeWithContextSync", {
12
- enumerable: true,
13
- get: function () { return chunkD5FMOLQZ_cjs.executeWithContextSync; }
14
- });
15
- Object.defineProperty(exports, "getCurrentSpan", {
16
- enumerable: true,
17
- get: function () { return chunkD5FMOLQZ_cjs.getCurrentSpan; }
18
- });
30
+ exports.executeWithContext = executeWithContext;
31
+ exports.executeWithContextSync = executeWithContextSync;
32
+ exports.getCurrentSpan = getCurrentSpan;
19
33
  //# sourceMappingURL=context-storage.cjs.map
20
34
  //# sourceMappingURL=context-storage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"context-storage.cjs"}
1
+ {"version":3,"sources":["../../src/observability/context-storage.ts"],"names":["AsyncLocalStorage","setCurrentSpanResolver","setExecuteWithContext","setExecuteWithContextSync"],"mappings":";;;;;AAUA,IAAM,kBAAA,GAAqB,IAAIA,6BAAA,EAA2B;AAMnD,SAAS,cAAA,GAAsC;AACpD,EAAA,OAAO,mBAAmB,QAAA,EAAS;AACrC;AAEAC,wCAAA,CAAuB,cAAc,CAAA;AACrCC,uCAAA,CAAsB,kBAAkB,CAAA;AACxCC,2CAAA,CAA0B,sBAAsB,CAAA;AAqBhD,eAAsB,mBAAsB,MAAA,EAA8D;AACxG,EAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAG,GAAI,MAAA;AAGrB,EAAA,MAAM,YAAY,IAAA,GAAO,MAAM,mBAAmB,GAAA,CAAI,IAAA,EAAM,EAAE,CAAA,GAAI,EAAA;AAElE,EAAA,IAAI,MAAM,gBAAA,EAAkB;AAC1B,IAAA,OAAO,IAAA,CAAK,iBAAiB,SAAS,CAAA;AAAA,EACxC;AAEA,EAAA,OAAO,SAAA,EAAU;AACnB;AAqBO,SAAS,uBAA0B,MAAA,EAA4C;AACpF,EAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAG,GAAI,MAAA;AAGrB,EAAA,MAAM,YAAY,IAAA,GAAO,MAAM,mBAAmB,GAAA,CAAI,IAAA,EAAM,EAAE,CAAA,GAAI,EAAA;AAElE,EAAA,IAAI,MAAM,oBAAA,EAAsB;AAC9B,IAAA,OAAO,IAAA,CAAK,qBAAqB,SAAS,CAAA;AAAA,EAC5C;AAEA,EAAA,OAAO,SAAA,EAAU;AACnB","file":"context-storage.cjs","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { AnySpan } from './types';\nimport { setCurrentSpanResolver, setExecuteWithContext, setExecuteWithContextSync } from './utils';\n\n/**\n * Ambient storage for the current span. Populated by executeWithContext/executeWithContextSync\n * so that infrastructure code (e.g. DualLogger) can resolve the active span without\n * being passed it explicitly.\n */\nconst spanContextStorage = new AsyncLocalStorage<AnySpan>();\n\n/**\n * Returns the current span from AsyncLocalStorage, if one is active.\n * Used by DualLogger to forward logs to a span-correlated loggerVNext.\n */\nexport function getCurrentSpan(): AnySpan | undefined {\n return spanContextStorage.getStore();\n}\n\nsetCurrentSpanResolver(getCurrentSpan);\nsetExecuteWithContext(executeWithContext);\nsetExecuteWithContextSync(executeWithContextSync);\n\n/**\n * Execute an async function within the span's tracing context if available.\n * Falls back to direct execution if no span exists.\n *\n * When a bridge is configured, this enables auto-instrumented operations\n * (HTTP requests, database queries, etc.) to be properly nested under the\n * current span in the external tracing system.\n *\n * @param span - The span to use as context (or undefined to execute without context)\n * @param fn - The async function to execute\n * @returns The result of the function execution\n *\n * @example\n * ```typescript\n * const result = await executeWithContext(llmSpan, async () =>\n * model.generateText(args)\n * );\n * ```\n */\nexport async function executeWithContext<T>(params: { span?: AnySpan; fn: () => Promise<T> }): Promise<T> {\n const { span, fn } = params;\n\n // Wrap fn so the span is available via getCurrentSpan() inside the async context.\n const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;\n\n if (span?.executeInContext) {\n return span.executeInContext(wrappedFn);\n }\n\n return wrappedFn();\n}\n\n/**\n * Execute a synchronous function within the span's tracing context if available.\n * Falls back to direct execution if no span exists.\n *\n * When a bridge is configured, this enables auto-instrumented operations\n * (HTTP requests, database queries, etc.) to be properly nested under the\n * current span in the external tracing system.\n *\n * @param span - The span to use as context (or undefined to execute without context)\n * @param fn - The synchronous function to execute\n * @returns The result of the function execution\n *\n * @example\n * ```typescript\n * const result = executeWithContextSync(llmSpan, () =>\n * model.streamText(args)\n * );\n * ```\n */\nexport function executeWithContextSync<T>(params: { span?: AnySpan; fn: () => T }): T {\n const { span, fn } = params;\n\n // Wrap fn so the span is available via getCurrentSpan() inside the sync context.\n const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;\n\n if (span?.executeInContextSync) {\n return span.executeInContextSync(wrappedFn);\n }\n\n return wrappedFn();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"context-storage.d.ts","sourceRoot":"","sources":["../../src/observability/context-storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAUvC;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,GAAG,SAAS,CAEpD;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAWxG;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,CAWpF"}
1
+ {"version":3,"file":"context-storage.d.ts","sourceRoot":"","sources":["../../src/observability/context-storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAUvC;;;GAGG;AACH,wBAAgB,cAAc,IAAI,OAAO,GAAG,SAAS,CAEpD;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAWxG;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,CAWpF"}
@@ -1,3 +1,30 @@
1
- export { executeWithContext, executeWithContextSync, getCurrentSpan } from '../chunk-2DKOLMVJ.js';
1
+ import { setCurrentSpanResolver, setExecuteWithContext, setExecuteWithContextSync } from '../chunk-BMS7MLQV.js';
2
+ import { AsyncLocalStorage } from 'async_hooks';
3
+
4
+ var spanContextStorage = new AsyncLocalStorage();
5
+ function getCurrentSpan() {
6
+ return spanContextStorage.getStore();
7
+ }
8
+ setCurrentSpanResolver(getCurrentSpan);
9
+ setExecuteWithContext(executeWithContext);
10
+ setExecuteWithContextSync(executeWithContextSync);
11
+ async function executeWithContext(params) {
12
+ const { span, fn } = params;
13
+ const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;
14
+ if (span?.executeInContext) {
15
+ return span.executeInContext(wrappedFn);
16
+ }
17
+ return wrappedFn();
18
+ }
19
+ function executeWithContextSync(params) {
20
+ const { span, fn } = params;
21
+ const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;
22
+ if (span?.executeInContextSync) {
23
+ return span.executeInContextSync(wrappedFn);
24
+ }
25
+ return wrappedFn();
26
+ }
27
+
28
+ export { executeWithContext, executeWithContextSync, getCurrentSpan };
2
29
  //# sourceMappingURL=context-storage.js.map
3
30
  //# sourceMappingURL=context-storage.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"context-storage.js"}
1
+ {"version":3,"sources":["../../src/observability/context-storage.ts"],"names":[],"mappings":";;;AAUA,IAAM,kBAAA,GAAqB,IAAI,iBAAA,EAA2B;AAMnD,SAAS,cAAA,GAAsC;AACpD,EAAA,OAAO,mBAAmB,QAAA,EAAS;AACrC;AAEA,sBAAA,CAAuB,cAAc,CAAA;AACrC,qBAAA,CAAsB,kBAAkB,CAAA;AACxC,yBAAA,CAA0B,sBAAsB,CAAA;AAqBhD,eAAsB,mBAAsB,MAAA,EAA8D;AACxG,EAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAG,GAAI,MAAA;AAGrB,EAAA,MAAM,YAAY,IAAA,GAAO,MAAM,mBAAmB,GAAA,CAAI,IAAA,EAAM,EAAE,CAAA,GAAI,EAAA;AAElE,EAAA,IAAI,MAAM,gBAAA,EAAkB;AAC1B,IAAA,OAAO,IAAA,CAAK,iBAAiB,SAAS,CAAA;AAAA,EACxC;AAEA,EAAA,OAAO,SAAA,EAAU;AACnB;AAqBO,SAAS,uBAA0B,MAAA,EAA4C;AACpF,EAAA,MAAM,EAAE,IAAA,EAAM,EAAA,EAAG,GAAI,MAAA;AAGrB,EAAA,MAAM,YAAY,IAAA,GAAO,MAAM,mBAAmB,GAAA,CAAI,IAAA,EAAM,EAAE,CAAA,GAAI,EAAA;AAElE,EAAA,IAAI,MAAM,oBAAA,EAAsB;AAC9B,IAAA,OAAO,IAAA,CAAK,qBAAqB,SAAS,CAAA;AAAA,EAC5C;AAEA,EAAA,OAAO,SAAA,EAAU;AACnB","file":"context-storage.js","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { AnySpan } from './types';\nimport { setCurrentSpanResolver, setExecuteWithContext, setExecuteWithContextSync } from './utils';\n\n/**\n * Ambient storage for the current span. Populated by executeWithContext/executeWithContextSync\n * so that infrastructure code (e.g. DualLogger) can resolve the active span without\n * being passed it explicitly.\n */\nconst spanContextStorage = new AsyncLocalStorage<AnySpan>();\n\n/**\n * Returns the current span from AsyncLocalStorage, if one is active.\n * Used by DualLogger to forward logs to a span-correlated loggerVNext.\n */\nexport function getCurrentSpan(): AnySpan | undefined {\n return spanContextStorage.getStore();\n}\n\nsetCurrentSpanResolver(getCurrentSpan);\nsetExecuteWithContext(executeWithContext);\nsetExecuteWithContextSync(executeWithContextSync);\n\n/**\n * Execute an async function within the span's tracing context if available.\n * Falls back to direct execution if no span exists.\n *\n * When a bridge is configured, this enables auto-instrumented operations\n * (HTTP requests, database queries, etc.) to be properly nested under the\n * current span in the external tracing system.\n *\n * @param span - The span to use as context (or undefined to execute without context)\n * @param fn - The async function to execute\n * @returns The result of the function execution\n *\n * @example\n * ```typescript\n * const result = await executeWithContext(llmSpan, async () =>\n * model.generateText(args)\n * );\n * ```\n */\nexport async function executeWithContext<T>(params: { span?: AnySpan; fn: () => Promise<T> }): Promise<T> {\n const { span, fn } = params;\n\n // Wrap fn so the span is available via getCurrentSpan() inside the async context.\n const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;\n\n if (span?.executeInContext) {\n return span.executeInContext(wrappedFn);\n }\n\n return wrappedFn();\n}\n\n/**\n * Execute a synchronous function within the span's tracing context if available.\n * Falls back to direct execution if no span exists.\n *\n * When a bridge is configured, this enables auto-instrumented operations\n * (HTTP requests, database queries, etc.) to be properly nested under the\n * current span in the external tracing system.\n *\n * @param span - The span to use as context (or undefined to execute without context)\n * @param fn - The synchronous function to execute\n * @returns The result of the function execution\n *\n * @example\n * ```typescript\n * const result = executeWithContextSync(llmSpan, () =>\n * model.streamText(args)\n * );\n * ```\n */\nexport function executeWithContextSync<T>(params: { span?: AnySpan; fn: () => T }): T {\n const { span, fn } = params;\n\n // Wrap fn so the span is available via getCurrentSpan() inside the sync context.\n const wrappedFn = span ? () => spanContextStorage.run(span, fn) : fn;\n\n if (span?.executeInContextSync) {\n return span.executeInContextSync(wrappedFn);\n }\n\n return wrappedFn();\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkB4OOPFD3_cjs = require('../chunk-B4OOPFD3.cjs');
4
- var chunkYRDMMXBW_cjs = require('../chunk-YRDMMXBW.cjs');
4
+ var chunk47RKHZIP_cjs = require('../chunk-47RKHZIP.cjs');
5
5
 
6
6
 
7
7
 
@@ -43,39 +43,55 @@ Object.defineProperty(exports, "wrapMastra", {
43
43
  });
44
44
  Object.defineProperty(exports, "EntityType", {
45
45
  enumerable: true,
46
- get: function () { return chunkYRDMMXBW_cjs.EntityType; }
46
+ get: function () { return chunk47RKHZIP_cjs.EntityType; }
47
47
  });
48
48
  Object.defineProperty(exports, "InternalSpans", {
49
49
  enumerable: true,
50
- get: function () { return chunkYRDMMXBW_cjs.InternalSpans; }
50
+ get: function () { return chunk47RKHZIP_cjs.InternalSpans; }
51
51
  });
52
52
  Object.defineProperty(exports, "SpanType", {
53
53
  enumerable: true,
54
- get: function () { return chunkYRDMMXBW_cjs.SpanType; }
54
+ get: function () { return chunk47RKHZIP_cjs.SpanType; }
55
55
  });
56
56
  Object.defineProperty(exports, "TracingEventType", {
57
57
  enumerable: true,
58
- get: function () { return chunkYRDMMXBW_cjs.TracingEventType; }
58
+ get: function () { return chunk47RKHZIP_cjs.TracingEventType; }
59
+ });
60
+ Object.defineProperty(exports, "executeWithContext", {
61
+ enumerable: true,
62
+ get: function () { return chunk47RKHZIP_cjs.executeWithContext; }
63
+ });
64
+ Object.defineProperty(exports, "executeWithContextSync", {
65
+ enumerable: true,
66
+ get: function () { return chunk47RKHZIP_cjs.executeWithContextSync; }
59
67
  });
60
68
  Object.defineProperty(exports, "getEntityTypeForSpan", {
61
69
  enumerable: true,
62
- get: function () { return chunkYRDMMXBW_cjs.getEntityTypeForSpan; }
70
+ get: function () { return chunk47RKHZIP_cjs.getEntityTypeForSpan; }
63
71
  });
64
72
  Object.defineProperty(exports, "getOrCreateSpan", {
65
73
  enumerable: true,
66
- get: function () { return chunkYRDMMXBW_cjs.getOrCreateSpan; }
74
+ get: function () { return chunk47RKHZIP_cjs.getOrCreateSpan; }
67
75
  });
68
76
  Object.defineProperty(exports, "getRootExportSpan", {
69
77
  enumerable: true,
70
- get: function () { return chunkYRDMMXBW_cjs.getRootExportSpan; }
78
+ get: function () { return chunk47RKHZIP_cjs.getRootExportSpan; }
71
79
  });
72
80
  Object.defineProperty(exports, "resolveCurrentSpan", {
73
81
  enumerable: true,
74
- get: function () { return chunkYRDMMXBW_cjs.resolveCurrentSpan; }
82
+ get: function () { return chunk47RKHZIP_cjs.resolveCurrentSpan; }
75
83
  });
76
84
  Object.defineProperty(exports, "setCurrentSpanResolver", {
77
85
  enumerable: true,
78
- get: function () { return chunkYRDMMXBW_cjs.setCurrentSpanResolver; }
86
+ get: function () { return chunk47RKHZIP_cjs.setCurrentSpanResolver; }
87
+ });
88
+ Object.defineProperty(exports, "setExecuteWithContext", {
89
+ enumerable: true,
90
+ get: function () { return chunk47RKHZIP_cjs.setExecuteWithContext; }
91
+ });
92
+ Object.defineProperty(exports, "setExecuteWithContextSync", {
93
+ enumerable: true,
94
+ get: function () { return chunk47RKHZIP_cjs.setExecuteWithContextSync; }
79
95
  });
80
96
  //# sourceMappingURL=index.cjs.map
81
97
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
1
  export { DEFAULT_BLOCKED_LABELS, NoOpObservability, SamplingStrategyType, createObservabilityContext, noOpLoggerContext, noOpMetricsContext, noOpTracingContext, resolveObservabilityContext, wrapMastra } from '../chunk-ZHMULBPD.js';
2
- export { EntityType, InternalSpans, SpanType, TracingEventType, getEntityTypeForSpan, getOrCreateSpan, getRootExportSpan, resolveCurrentSpan, setCurrentSpanResolver } from '../chunk-44P7C37G.js';
2
+ export { EntityType, InternalSpans, SpanType, TracingEventType, executeWithContext, executeWithContextSync, getEntityTypeForSpan, getOrCreateSpan, getRootExportSpan, resolveCurrentSpan, setCurrentSpanResolver, setExecuteWithContext, setExecuteWithContextSync } from '../chunk-BMS7MLQV.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -9,6 +9,32 @@ import { EntityType, SpanType } from './types/index.js';
9
9
  import type { Span, GetOrCreateSpanOptions, AnySpan } from './types/index.js';
10
10
  export declare function setCurrentSpanResolver(resolver: (() => AnySpan | undefined) | undefined): void;
11
11
  export declare function resolveCurrentSpan(): AnySpan | undefined;
12
+ type ExecuteWithContextFn = <T>(params: {
13
+ span?: AnySpan;
14
+ fn: () => Promise<T>;
15
+ }) => Promise<T>;
16
+ type ExecuteWithContextSyncFn = <T>(params: {
17
+ span?: AnySpan;
18
+ fn: () => T;
19
+ }) => T;
20
+ export declare function setExecuteWithContext(impl: ExecuteWithContextFn): void;
21
+ export declare function setExecuteWithContextSync(impl: ExecuteWithContextSyncFn): void;
22
+ /**
23
+ * Execute an async function within a span's tracing context.
24
+ * Falls back to direct execution if no context-storage implementation is registered or no span exists.
25
+ */
26
+ export declare function executeWithContext<T>(params: {
27
+ span?: AnySpan;
28
+ fn: () => Promise<T>;
29
+ }): Promise<T>;
30
+ /**
31
+ * Execute a sync function within a span's tracing context.
32
+ * Falls back to direct execution if no context-storage implementation is registered or no span exists.
33
+ */
34
+ export declare function executeWithContextSync<T>(params: {
35
+ span?: AnySpan;
36
+ fn: () => T;
37
+ }): T;
12
38
  /**
13
39
  * Creates or gets a child span from existing tracing context or starts a new trace.
14
40
  * This helper consolidates the common pattern of creating spans that can either be:
@@ -36,4 +62,5 @@ export declare function getEntityTypeForSpan(span: {
36
62
  entityType?: string | null;
37
63
  spanType?: SpanType | string | null;
38
64
  }): EntityType | undefined;
65
+ export {};
39
66
  //# sourceMappingURL=utils.d.ts.map