@mastra/core 0.24.5 → 0.24.6

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 (277) hide show
  1. package/CHANGELOG.md +612 -0
  2. package/dist/agent/agent.d.ts +8 -6
  3. package/dist/agent/agent.d.ts.map +1 -1
  4. package/dist/agent/agent.types.d.ts +2 -0
  5. package/dist/agent/agent.types.d.ts.map +1 -1
  6. package/dist/agent/index.cjs +13 -13
  7. package/dist/agent/index.js +2 -2
  8. package/dist/agent/input-processor/index.cjs +6 -6
  9. package/dist/agent/input-processor/index.js +1 -1
  10. package/dist/agent/message-list/index.d.ts.map +1 -1
  11. package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
  12. package/dist/agent/test-utils.d.ts +4 -3
  13. package/dist/agent/test-utils.d.ts.map +1 -1
  14. package/dist/agent/utils.d.ts.map +1 -1
  15. package/dist/agent/workflows/prepare-stream/index.d.ts +4 -4
  16. package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
  17. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
  18. package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +4 -4
  19. package/dist/agent/workflows/prepare-stream/schema.d.ts +4 -4
  20. package/dist/agent/workflows/prepare-stream/stream-step.d.ts +8 -1
  21. package/dist/agent/workflows/prepare-stream/stream-step.d.ts.map +1 -1
  22. package/dist/ai-tracing/index.cjs +36 -36
  23. package/dist/ai-tracing/index.js +1 -1
  24. package/dist/chunk-3PSWNGBF.js +3 -0
  25. package/dist/{chunk-ZV5CC35D.js.map → chunk-3PSWNGBF.js.map} +1 -1
  26. package/dist/{chunk-XHKMGOON.cjs → chunk-42RUESSD.cjs} +204 -150
  27. package/dist/chunk-42RUESSD.cjs.map +1 -0
  28. package/dist/{chunk-UD7DS7OY.cjs → chunk-46XGIEXM.cjs} +4 -4
  29. package/dist/{chunk-UD7DS7OY.cjs.map → chunk-46XGIEXM.cjs.map} +1 -1
  30. package/dist/{chunk-HGNRQ3OG.js → chunk-5O52O25J.js} +15 -8
  31. package/dist/chunk-5O52O25J.js.map +1 -0
  32. package/dist/{chunk-OLERJ2OU.js → chunk-6D2K2CAA.js} +7 -5
  33. package/dist/chunk-6D2K2CAA.js.map +1 -0
  34. package/dist/chunk-6XCINXZ7.cjs +194 -0
  35. package/dist/chunk-6XCINXZ7.cjs.map +1 -0
  36. package/dist/chunk-BJ6XIEC6.js +13 -0
  37. package/dist/chunk-BJ6XIEC6.js.map +1 -0
  38. package/dist/chunk-BWYU7D33.js +192 -0
  39. package/dist/chunk-BWYU7D33.js.map +1 -0
  40. package/dist/{chunk-R7UDZZA5.cjs → chunk-CT2DMHGC.cjs} +8 -8
  41. package/dist/{chunk-R7UDZZA5.cjs.map → chunk-CT2DMHGC.cjs.map} +1 -1
  42. package/dist/{chunk-YSQE5IHK.cjs → chunk-CYEQK4PM.cjs} +10 -8
  43. package/dist/chunk-CYEQK4PM.cjs.map +1 -0
  44. package/dist/{chunk-FCJ5INK7.js → chunk-DHLW4AP7.js} +3 -3
  45. package/dist/{chunk-FCJ5INK7.js.map → chunk-DHLW4AP7.js.map} +1 -1
  46. package/dist/{chunk-4UOIJRD6.cjs → chunk-GZDIHQDK.cjs} +4 -4
  47. package/dist/{chunk-4UOIJRD6.cjs.map → chunk-GZDIHQDK.cjs.map} +1 -1
  48. package/dist/{chunk-WCHE6FJ7.js → chunk-HCCXJ5YJ.js} +111 -6
  49. package/dist/chunk-HCCXJ5YJ.js.map +1 -0
  50. package/dist/{chunk-34ZCWSUA.js → chunk-HSX2K7HB.js} +15 -14
  51. package/dist/chunk-HSX2K7HB.js.map +1 -0
  52. package/dist/{chunk-LZFCR2SE.cjs → chunk-IAJHRFO4.cjs} +4 -4
  53. package/dist/{chunk-LZFCR2SE.cjs.map → chunk-IAJHRFO4.cjs.map} +1 -1
  54. package/dist/{chunk-4HQPVSGA.cjs → chunk-ICF3MCIN.cjs} +64 -12
  55. package/dist/chunk-ICF3MCIN.cjs.map +1 -0
  56. package/dist/{chunk-N2DOZAFH.js → chunk-INOOZ2A2.js} +760 -508
  57. package/dist/chunk-INOOZ2A2.js.map +1 -0
  58. package/dist/{chunk-3JX2Y3WH.cjs → chunk-IWU4YSYT.cjs} +16 -15
  59. package/dist/chunk-IWU4YSYT.cjs.map +1 -0
  60. package/dist/{chunk-3KVI2HLS.cjs → chunk-KWF3J2Q4.cjs} +11 -11
  61. package/dist/{chunk-3KVI2HLS.cjs.map → chunk-KWF3J2Q4.cjs.map} +1 -1
  62. package/dist/{chunk-TEW3ODXX.js → chunk-LAQQETGP.js} +36 -34
  63. package/dist/chunk-LAQQETGP.js.map +1 -0
  64. package/dist/{chunk-EUNOQ7HN.js → chunk-MRSBLBQ5.js} +4 -4
  65. package/dist/{chunk-EUNOQ7HN.js.map → chunk-MRSBLBQ5.js.map} +1 -1
  66. package/dist/{chunk-LLSLFDO6.js → chunk-NRQC7DQW.js} +57 -5
  67. package/dist/chunk-NRQC7DQW.js.map +1 -0
  68. package/dist/{chunk-WBAXXG34.cjs → chunk-PAOBGBU7.cjs} +112 -5
  69. package/dist/chunk-PAOBGBU7.cjs.map +1 -0
  70. package/dist/chunk-PE3V7GUL.cjs +4 -0
  71. package/dist/{chunk-LJFJTTZQ.cjs.map → chunk-PE3V7GUL.cjs.map} +1 -1
  72. package/dist/{chunk-DOLSYVNJ.cjs → chunk-PIH5FBNQ.cjs} +12 -12
  73. package/dist/{chunk-DOLSYVNJ.cjs.map → chunk-PIH5FBNQ.cjs.map} +1 -1
  74. package/dist/{chunk-4SXWN3RR.js → chunk-Q6LWNLAJ.js} +203 -149
  75. package/dist/chunk-Q6LWNLAJ.js.map +1 -0
  76. package/dist/{chunk-SL7VKAQ3.js → chunk-R6XC4DV5.js} +7 -7
  77. package/dist/chunk-R6XC4DV5.js.map +1 -0
  78. package/dist/{chunk-WNFLWMEP.cjs → chunk-RJOVFHWN.cjs} +765 -511
  79. package/dist/chunk-RJOVFHWN.cjs.map +1 -0
  80. package/dist/chunk-UCPGYU55.cjs +15 -0
  81. package/dist/chunk-UCPGYU55.cjs.map +1 -0
  82. package/dist/{chunk-K7MEUZ3O.js → chunk-UWTYVVVZ.js} +3 -3
  83. package/dist/{chunk-K7MEUZ3O.js.map → chunk-UWTYVVVZ.js.map} +1 -1
  84. package/dist/{chunk-ZISECZZO.js → chunk-VHEA3YXS.js} +2 -2
  85. package/dist/chunk-VHEA3YXS.js.map +1 -0
  86. package/dist/chunk-VXHOOZSK.js +446 -0
  87. package/dist/chunk-VXHOOZSK.js.map +1 -0
  88. package/dist/{chunk-NUAURT4I.cjs → chunk-W4UVO3HL.cjs} +2 -2
  89. package/dist/chunk-W4UVO3HL.cjs.map +1 -0
  90. package/dist/{chunk-ZIHEKHUB.js → chunk-WIMFJ2BA.js} +3 -3
  91. package/dist/{chunk-ZIHEKHUB.js.map → chunk-WIMFJ2BA.js.map} +1 -1
  92. package/dist/{chunk-LRSB62Z6.cjs → chunk-X7F4CSGR.cjs} +15 -8
  93. package/dist/chunk-X7F4CSGR.cjs.map +1 -0
  94. package/dist/{chunk-WUFFST2N.cjs → chunk-XDMQQZNX.cjs} +70 -68
  95. package/dist/chunk-XDMQQZNX.cjs.map +1 -0
  96. package/dist/chunk-XWGHD4C7.cjs +450 -0
  97. package/dist/chunk-XWGHD4C7.cjs.map +1 -0
  98. package/dist/{chunk-FZXAPBVV.js → chunk-Z6QCWTTO.js} +3 -3
  99. package/dist/{chunk-FZXAPBVV.js.map → chunk-Z6QCWTTO.js.map} +1 -1
  100. package/dist/{chunk-GWACPQ56.js → chunk-ZIWN73GQ.js} +5 -5
  101. package/dist/{chunk-GWACPQ56.js.map → chunk-ZIWN73GQ.js.map} +1 -1
  102. package/dist/{chunk-IJRERAWQ.cjs → chunk-ZOYE65RA.cjs} +8 -8
  103. package/dist/chunk-ZOYE65RA.cjs.map +1 -0
  104. package/dist/index.cjs +75 -54
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.js +15 -10
  107. package/dist/index.js.map +1 -1
  108. package/dist/llm/index.cjs +24 -8
  109. package/dist/llm/index.d.ts +1 -0
  110. package/dist/llm/index.d.ts.map +1 -1
  111. package/dist/llm/index.js +5 -1
  112. package/dist/llm/model/gateways/base.d.ts +9 -4
  113. package/dist/llm/model/gateways/base.d.ts.map +1 -1
  114. package/dist/llm/model/gateways/index.d.ts +3 -1
  115. package/dist/llm/model/gateways/index.d.ts.map +1 -1
  116. package/dist/llm/model/gateways/models-dev.d.ts +3 -2
  117. package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
  118. package/dist/llm/model/gateways/netlify.d.ts +4 -3
  119. package/dist/llm/model/gateways/netlify.d.ts.map +1 -1
  120. package/dist/llm/model/model.d.ts.map +1 -1
  121. package/dist/llm/model/model.loop.d.ts +1 -1
  122. package/dist/llm/model/model.loop.d.ts.map +1 -1
  123. package/dist/llm/model/provider-registry.d.ts +11 -1
  124. package/dist/llm/model/provider-registry.d.ts.map +1 -1
  125. package/dist/llm/model/provider-types.generated.d.ts +324 -29
  126. package/dist/llm/model/registry-generator.d.ts +12 -0
  127. package/dist/llm/model/registry-generator.d.ts.map +1 -1
  128. package/dist/llm/model/resolve-model.d.ts.map +1 -1
  129. package/dist/llm/model/router.d.ts +6 -1
  130. package/dist/llm/model/router.d.ts.map +1 -1
  131. package/dist/loop/index.cjs +2 -2
  132. package/dist/loop/index.js +1 -1
  133. package/dist/loop/loop.d.ts.map +1 -1
  134. package/dist/loop/network/index.d.ts +6 -6
  135. package/dist/loop/network/index.d.ts.map +1 -1
  136. package/dist/loop/test-utils/generateText.d.ts.map +1 -1
  137. package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
  138. package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
  139. package/dist/loop/types.d.ts +8 -0
  140. package/dist/loop/types.d.ts.map +1 -1
  141. package/dist/loop/workflows/agentic-execution/index.d.ts +36 -36
  142. package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -1
  143. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +24 -24
  144. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  145. package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +12 -12
  146. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +1 -1
  147. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
  148. package/dist/loop/workflows/agentic-loop/index.d.ts +36 -36
  149. package/dist/loop/workflows/schema.d.ts +16 -16
  150. package/dist/mastra/index.cjs +2 -2
  151. package/dist/mastra/index.d.ts +23 -0
  152. package/dist/mastra/index.d.ts.map +1 -1
  153. package/dist/mastra/index.js +1 -1
  154. package/dist/memory/index.cjs +4 -4
  155. package/dist/memory/index.js +1 -1
  156. package/dist/memory/types.d.ts +3 -2
  157. package/dist/memory/types.d.ts.map +1 -1
  158. package/dist/models-dev-LJ4O6FNF.js +3 -0
  159. package/dist/{models-dev-BL5TAKE6.js.map → models-dev-LJ4O6FNF.js.map} +1 -1
  160. package/dist/models-dev-T2CXOEDH.cjs +12 -0
  161. package/dist/{models-dev-HZ3LZHPX.cjs.map → models-dev-T2CXOEDH.cjs.map} +1 -1
  162. package/dist/netlify-BAEMIQNH.cjs +12 -0
  163. package/dist/{netlify-TX6V7SJJ.cjs.map → netlify-BAEMIQNH.cjs.map} +1 -1
  164. package/dist/netlify-L7AZ74PV.js +3 -0
  165. package/dist/{netlify-VJXBII33.js.map → netlify-L7AZ74PV.js.map} +1 -1
  166. package/dist/processors/index.cjs +11 -11
  167. package/dist/processors/index.js +1 -1
  168. package/dist/provider-registry-RUDYHG7J.cjs +40 -0
  169. package/dist/provider-registry-RUDYHG7J.cjs.map +1 -0
  170. package/dist/provider-registry-THITZUJ7.js +3 -0
  171. package/dist/provider-registry-THITZUJ7.js.map +1 -0
  172. package/dist/provider-registry.json +705 -68
  173. package/dist/{registry-generator-6WVOHM2L.cjs → registry-generator-DL42NMBM.cjs} +23 -6
  174. package/dist/registry-generator-DL42NMBM.cjs.map +1 -0
  175. package/dist/{registry-generator-DXRSYYYT.js → registry-generator-I6S4ARS6.js} +23 -7
  176. package/dist/registry-generator-I6S4ARS6.js.map +1 -0
  177. package/dist/relevance/index.cjs +4 -4
  178. package/dist/relevance/index.js +1 -1
  179. package/dist/scores/index.cjs +9 -9
  180. package/dist/scores/index.js +2 -2
  181. package/dist/scores/scoreTraces/index.cjs +8 -8
  182. package/dist/scores/scoreTraces/index.js +3 -3
  183. package/dist/server/composite-auth.d.ts +9 -0
  184. package/dist/server/composite-auth.d.ts.map +1 -0
  185. package/dist/server/index.cjs +83 -1
  186. package/dist/server/index.cjs.map +1 -1
  187. package/dist/server/index.d.ts +3 -0
  188. package/dist/server/index.d.ts.map +1 -1
  189. package/dist/server/index.js +82 -2
  190. package/dist/server/index.js.map +1 -1
  191. package/dist/server/simple-auth.d.ts +32 -0
  192. package/dist/server/simple-auth.d.ts.map +1 -0
  193. package/dist/storage/index.cjs +3 -3
  194. package/dist/storage/index.js +1 -1
  195. package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
  196. package/dist/stream/base/output.d.ts.map +1 -1
  197. package/dist/stream/index.cjs +11 -11
  198. package/dist/stream/index.js +2 -2
  199. package/dist/stream/types.d.ts +7 -2
  200. package/dist/stream/types.d.ts.map +1 -1
  201. package/dist/test-utils/llm-mock.cjs +2 -2
  202. package/dist/test-utils/llm-mock.js +1 -1
  203. package/dist/tools/index.cjs +2 -2
  204. package/dist/tools/index.js +1 -1
  205. package/dist/tools/stream.d.ts +1 -0
  206. package/dist/tools/stream.d.ts.map +1 -1
  207. package/dist/utils.cjs +17 -17
  208. package/dist/utils.js +1 -1
  209. package/dist/vector/filter/index.cjs +7 -189
  210. package/dist/vector/filter/index.cjs.map +1 -1
  211. package/dist/vector/filter/index.js +1 -190
  212. package/dist/vector/filter/index.js.map +1 -1
  213. package/dist/vector/index.cjs +9 -4
  214. package/dist/vector/index.d.ts +1 -0
  215. package/dist/vector/index.d.ts.map +1 -1
  216. package/dist/vector/index.js +2 -1
  217. package/dist/vector/types.d.ts +86 -3
  218. package/dist/vector/types.d.ts.map +1 -1
  219. package/dist/vector/vector.d.ts +39 -2
  220. package/dist/vector/vector.d.ts.map +1 -1
  221. package/dist/voice/aisdk/index.d.ts +3 -0
  222. package/dist/voice/aisdk/index.d.ts.map +1 -0
  223. package/dist/voice/aisdk/speech.d.ts +23 -0
  224. package/dist/voice/aisdk/speech.d.ts.map +1 -0
  225. package/dist/voice/aisdk/transcription.d.ts +22 -0
  226. package/dist/voice/aisdk/transcription.d.ts.map +1 -0
  227. package/dist/voice/composite-voice.d.ts +3 -2
  228. package/dist/voice/composite-voice.d.ts.map +1 -1
  229. package/dist/voice/index.cjs +12 -4
  230. package/dist/voice/index.d.ts +1 -0
  231. package/dist/voice/index.d.ts.map +1 -1
  232. package/dist/voice/index.js +1 -1
  233. package/dist/workflows/evented/index.cjs +10 -10
  234. package/dist/workflows/evented/index.js +1 -1
  235. package/dist/workflows/index.cjs +14 -14
  236. package/dist/workflows/index.js +1 -1
  237. package/dist/workflows/legacy/index.cjs +22 -22
  238. package/dist/workflows/legacy/index.js +1 -1
  239. package/dist/workflows/legacy/machine.d.ts +1 -1
  240. package/dist/workflows/legacy/workflow-instance.d.ts +2 -2
  241. package/dist/workflows/utils.d.ts.map +1 -1
  242. package/dist/workflows/workflow.d.ts +2 -0
  243. package/dist/workflows/workflow.d.ts.map +1 -1
  244. package/package.json +7 -7
  245. package/src/llm/model/provider-types.generated.d.ts +324 -29
  246. package/dist/chunk-34ZCWSUA.js.map +0 -1
  247. package/dist/chunk-3JX2Y3WH.cjs.map +0 -1
  248. package/dist/chunk-4HQPVSGA.cjs.map +0 -1
  249. package/dist/chunk-4SXWN3RR.js.map +0 -1
  250. package/dist/chunk-HF3GZRFP.cjs +0 -9
  251. package/dist/chunk-HF3GZRFP.cjs.map +0 -1
  252. package/dist/chunk-HGNRQ3OG.js.map +0 -1
  253. package/dist/chunk-IJRERAWQ.cjs.map +0 -1
  254. package/dist/chunk-LJFJTTZQ.cjs +0 -4
  255. package/dist/chunk-LLSLFDO6.js.map +0 -1
  256. package/dist/chunk-LRSB62Z6.cjs.map +0 -1
  257. package/dist/chunk-N2DOZAFH.js.map +0 -1
  258. package/dist/chunk-NUAURT4I.cjs.map +0 -1
  259. package/dist/chunk-OLERJ2OU.js.map +0 -1
  260. package/dist/chunk-RKXWLG33.js +0 -7
  261. package/dist/chunk-RKXWLG33.js.map +0 -1
  262. package/dist/chunk-SL7VKAQ3.js.map +0 -1
  263. package/dist/chunk-TEW3ODXX.js.map +0 -1
  264. package/dist/chunk-WBAXXG34.cjs.map +0 -1
  265. package/dist/chunk-WCHE6FJ7.js.map +0 -1
  266. package/dist/chunk-WNFLWMEP.cjs.map +0 -1
  267. package/dist/chunk-WUFFST2N.cjs.map +0 -1
  268. package/dist/chunk-XHKMGOON.cjs.map +0 -1
  269. package/dist/chunk-YSQE5IHK.cjs.map +0 -1
  270. package/dist/chunk-ZISECZZO.js.map +0 -1
  271. package/dist/chunk-ZV5CC35D.js +0 -3
  272. package/dist/models-dev-BL5TAKE6.js +0 -3
  273. package/dist/models-dev-HZ3LZHPX.cjs +0 -12
  274. package/dist/netlify-TX6V7SJJ.cjs +0 -12
  275. package/dist/netlify-VJXBII33.js +0 -3
  276. package/dist/registry-generator-6WVOHM2L.cjs.map +0 -1
  277. package/dist/registry-generator-DXRSYYYT.js.map +0 -1
@@ -1,148 +1,148 @@
1
1
  'use strict';
2
2
 
3
- var chunkLZFCR2SE_cjs = require('../chunk-LZFCR2SE.cjs');
3
+ var chunkIAJHRFO4_cjs = require('../chunk-IAJHRFO4.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "AISpanType", {
8
8
  enumerable: true,
9
- get: function () { return chunkLZFCR2SE_cjs.AISpanType; }
9
+ get: function () { return chunkIAJHRFO4_cjs.AISpanType; }
10
10
  });
11
11
  Object.defineProperty(exports, "AITracingEventType", {
12
12
  enumerable: true,
13
- get: function () { return chunkLZFCR2SE_cjs.AITracingEventType; }
13
+ get: function () { return chunkIAJHRFO4_cjs.AITracingEventType; }
14
14
  });
15
15
  Object.defineProperty(exports, "BaseAISpan", {
16
16
  enumerable: true,
17
- get: function () { return chunkLZFCR2SE_cjs.BaseAISpan; }
17
+ get: function () { return chunkIAJHRFO4_cjs.BaseAISpan; }
18
18
  });
19
19
  Object.defineProperty(exports, "BaseAITracing", {
20
20
  enumerable: true,
21
- get: function () { return chunkLZFCR2SE_cjs.BaseAITracing; }
21
+ get: function () { return chunkIAJHRFO4_cjs.BaseAITracing; }
22
22
  });
23
23
  Object.defineProperty(exports, "BaseExporter", {
24
24
  enumerable: true,
25
- get: function () { return chunkLZFCR2SE_cjs.BaseExporter; }
25
+ get: function () { return chunkIAJHRFO4_cjs.BaseExporter; }
26
26
  });
27
27
  Object.defineProperty(exports, "CloudExporter", {
28
28
  enumerable: true,
29
- get: function () { return chunkLZFCR2SE_cjs.CloudExporter; }
29
+ get: function () { return chunkIAJHRFO4_cjs.CloudExporter; }
30
30
  });
31
31
  Object.defineProperty(exports, "ConsoleExporter", {
32
32
  enumerable: true,
33
- get: function () { return chunkLZFCR2SE_cjs.ConsoleExporter; }
33
+ get: function () { return chunkIAJHRFO4_cjs.ConsoleExporter; }
34
34
  });
35
35
  Object.defineProperty(exports, "DefaultAISpan", {
36
36
  enumerable: true,
37
- get: function () { return chunkLZFCR2SE_cjs.DefaultAISpan; }
37
+ get: function () { return chunkIAJHRFO4_cjs.DefaultAISpan; }
38
38
  });
39
39
  Object.defineProperty(exports, "DefaultAITracing", {
40
40
  enumerable: true,
41
- get: function () { return chunkLZFCR2SE_cjs.DefaultAITracing; }
41
+ get: function () { return chunkIAJHRFO4_cjs.DefaultAITracing; }
42
42
  });
43
43
  Object.defineProperty(exports, "DefaultExporter", {
44
44
  enumerable: true,
45
- get: function () { return chunkLZFCR2SE_cjs.DefaultExporter; }
45
+ get: function () { return chunkIAJHRFO4_cjs.DefaultExporter; }
46
46
  });
47
47
  Object.defineProperty(exports, "InternalSpans", {
48
48
  enumerable: true,
49
- get: function () { return chunkLZFCR2SE_cjs.InternalSpans; }
49
+ get: function () { return chunkIAJHRFO4_cjs.InternalSpans; }
50
50
  });
51
51
  Object.defineProperty(exports, "ModelSpanTracker", {
52
52
  enumerable: true,
53
- get: function () { return chunkLZFCR2SE_cjs.ModelSpanTracker; }
53
+ get: function () { return chunkIAJHRFO4_cjs.ModelSpanTracker; }
54
54
  });
55
55
  Object.defineProperty(exports, "NoOpAISpan", {
56
56
  enumerable: true,
57
- get: function () { return chunkLZFCR2SE_cjs.NoOpAISpan; }
57
+ get: function () { return chunkIAJHRFO4_cjs.NoOpAISpan; }
58
58
  });
59
59
  Object.defineProperty(exports, "SamplingStrategyType", {
60
60
  enumerable: true,
61
- get: function () { return chunkLZFCR2SE_cjs.SamplingStrategyType; }
61
+ get: function () { return chunkIAJHRFO4_cjs.SamplingStrategyType; }
62
62
  });
63
63
  Object.defineProperty(exports, "SensitiveDataFilter", {
64
64
  enumerable: true,
65
- get: function () { return chunkLZFCR2SE_cjs.SensitiveDataFilter; }
65
+ get: function () { return chunkIAJHRFO4_cjs.SensitiveDataFilter; }
66
66
  });
67
67
  Object.defineProperty(exports, "clearAITracingRegistry", {
68
68
  enumerable: true,
69
- get: function () { return chunkLZFCR2SE_cjs.clearAITracingRegistry; }
69
+ get: function () { return chunkIAJHRFO4_cjs.clearAITracingRegistry; }
70
70
  });
71
71
  Object.defineProperty(exports, "deepClean", {
72
72
  enumerable: true,
73
- get: function () { return chunkLZFCR2SE_cjs.deepClean; }
73
+ get: function () { return chunkIAJHRFO4_cjs.deepClean; }
74
74
  });
75
75
  Object.defineProperty(exports, "getAITracing", {
76
76
  enumerable: true,
77
- get: function () { return chunkLZFCR2SE_cjs.getAITracing; }
77
+ get: function () { return chunkIAJHRFO4_cjs.getAITracing; }
78
78
  });
79
79
  Object.defineProperty(exports, "getAllAITracing", {
80
80
  enumerable: true,
81
- get: function () { return chunkLZFCR2SE_cjs.getAllAITracing; }
81
+ get: function () { return chunkIAJHRFO4_cjs.getAllAITracing; }
82
82
  });
83
83
  Object.defineProperty(exports, "getDefaultAITracing", {
84
84
  enumerable: true,
85
- get: function () { return chunkLZFCR2SE_cjs.getDefaultAITracing; }
85
+ get: function () { return chunkIAJHRFO4_cjs.getDefaultAITracing; }
86
86
  });
87
87
  Object.defineProperty(exports, "getNestedValue", {
88
88
  enumerable: true,
89
- get: function () { return chunkLZFCR2SE_cjs.getNestedValue; }
89
+ get: function () { return chunkIAJHRFO4_cjs.getNestedValue; }
90
90
  });
91
91
  Object.defineProperty(exports, "getOrCreateSpan", {
92
92
  enumerable: true,
93
- get: function () { return chunkLZFCR2SE_cjs.getOrCreateSpan; }
93
+ get: function () { return chunkIAJHRFO4_cjs.getOrCreateSpan; }
94
94
  });
95
95
  Object.defineProperty(exports, "getSelectedAITracing", {
96
96
  enumerable: true,
97
- get: function () { return chunkLZFCR2SE_cjs.getSelectedAITracing; }
97
+ get: function () { return chunkIAJHRFO4_cjs.getSelectedAITracing; }
98
98
  });
99
99
  Object.defineProperty(exports, "getValidTraceId", {
100
100
  enumerable: true,
101
- get: function () { return chunkLZFCR2SE_cjs.getValidTraceId; }
101
+ get: function () { return chunkIAJHRFO4_cjs.getValidTraceId; }
102
102
  });
103
103
  Object.defineProperty(exports, "hasAITracing", {
104
104
  enumerable: true,
105
- get: function () { return chunkLZFCR2SE_cjs.hasAITracing; }
105
+ get: function () { return chunkIAJHRFO4_cjs.hasAITracing; }
106
106
  });
107
107
  Object.defineProperty(exports, "isMastra", {
108
108
  enumerable: true,
109
- get: function () { return chunkLZFCR2SE_cjs.isMastra; }
109
+ get: function () { return chunkIAJHRFO4_cjs.isMastra; }
110
110
  });
111
111
  Object.defineProperty(exports, "omitKeys", {
112
112
  enumerable: true,
113
- get: function () { return chunkLZFCR2SE_cjs.omitKeys; }
113
+ get: function () { return chunkIAJHRFO4_cjs.omitKeys; }
114
114
  });
115
115
  Object.defineProperty(exports, "registerAITracing", {
116
116
  enumerable: true,
117
- get: function () { return chunkLZFCR2SE_cjs.registerAITracing; }
117
+ get: function () { return chunkIAJHRFO4_cjs.registerAITracing; }
118
118
  });
119
119
  Object.defineProperty(exports, "selectFields", {
120
120
  enumerable: true,
121
- get: function () { return chunkLZFCR2SE_cjs.selectFields; }
121
+ get: function () { return chunkIAJHRFO4_cjs.selectFields; }
122
122
  });
123
123
  Object.defineProperty(exports, "setNestedValue", {
124
124
  enumerable: true,
125
- get: function () { return chunkLZFCR2SE_cjs.setNestedValue; }
125
+ get: function () { return chunkIAJHRFO4_cjs.setNestedValue; }
126
126
  });
127
127
  Object.defineProperty(exports, "setSelector", {
128
128
  enumerable: true,
129
- get: function () { return chunkLZFCR2SE_cjs.setSelector; }
129
+ get: function () { return chunkIAJHRFO4_cjs.setSelector; }
130
130
  });
131
131
  Object.defineProperty(exports, "setupAITracing", {
132
132
  enumerable: true,
133
- get: function () { return chunkLZFCR2SE_cjs.setupAITracing; }
133
+ get: function () { return chunkIAJHRFO4_cjs.setupAITracing; }
134
134
  });
135
135
  Object.defineProperty(exports, "shutdownAITracingRegistry", {
136
136
  enumerable: true,
137
- get: function () { return chunkLZFCR2SE_cjs.shutdownAITracingRegistry; }
137
+ get: function () { return chunkIAJHRFO4_cjs.shutdownAITracingRegistry; }
138
138
  });
139
139
  Object.defineProperty(exports, "unregisterAITracing", {
140
140
  enumerable: true,
141
- get: function () { return chunkLZFCR2SE_cjs.unregisterAITracing; }
141
+ get: function () { return chunkIAJHRFO4_cjs.unregisterAITracing; }
142
142
  });
143
143
  Object.defineProperty(exports, "wrapMastra", {
144
144
  enumerable: true,
145
- get: function () { return chunkLZFCR2SE_cjs.wrapMastra; }
145
+ get: function () { return chunkIAJHRFO4_cjs.wrapMastra; }
146
146
  });
147
147
  //# sourceMappingURL=index.cjs.map
148
148
  //# sourceMappingURL=index.cjs.map
@@ -1,3 +1,3 @@
1
- export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, BaseExporter, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, ModelSpanTracker, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, clearAITracingRegistry, deepClean, getAITracing, getAllAITracing, getDefaultAITracing, getNestedValue, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isMastra, omitKeys, registerAITracing, selectFields, setNestedValue, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra } from '../chunk-ZIHEKHUB.js';
1
+ export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, BaseExporter, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, ModelSpanTracker, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, clearAITracingRegistry, deepClean, getAITracing, getAllAITracing, getDefaultAITracing, getNestedValue, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isMastra, omitKeys, registerAITracing, selectFields, setNestedValue, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra } from '../chunk-WIMFJ2BA.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=chunk-3PSWNGBF.js.map
3
+ //# sourceMappingURL=chunk-3PSWNGBF.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-ZV5CC35D.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-3PSWNGBF.js"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkLZFCR2SE_cjs = require('./chunk-LZFCR2SE.cjs');
3
+ var chunkIAJHRFO4_cjs = require('./chunk-IAJHRFO4.cjs');
4
4
  var chunk5NTO7S5I_cjs = require('./chunk-5NTO7S5I.cjs');
5
5
  var providerUtilsV5 = require('@ai-sdk/provider-utils-v5');
6
6
  var crypto = require('crypto');
@@ -233,14 +233,150 @@ function convertImageFilePart(part, downloadedAssets) {
233
233
  }
234
234
  }
235
235
  }
236
+ zod.z.union([
237
+ zod.z.string(),
238
+ zod.z.instanceof(Uint8Array),
239
+ zod.z.instanceof(ArrayBuffer),
240
+ zod.z.custom(
241
+ // Buffer might not be available in some environments such as CloudFlare:
242
+ (value) => globalThis.Buffer?.isBuffer(value) ?? false,
243
+ { message: "Must be a Buffer" }
244
+ )
245
+ ]);
246
+ function convertDataContentToBase64String(content) {
247
+ if (typeof content === "string") {
248
+ return content;
249
+ }
250
+ if (content instanceof ArrayBuffer) {
251
+ return providerUtils.convertUint8ArrayToBase64(new Uint8Array(content));
252
+ }
253
+ return providerUtils.convertUint8ArrayToBase64(content);
254
+ }
255
+
256
+ // src/agent/message-list/prompt/image-utils.ts
257
+ function parseDataUri(dataUri) {
258
+ if (!dataUri.startsWith("data:")) {
259
+ return {
260
+ isDataUri: false,
261
+ base64Content: dataUri
262
+ };
263
+ }
264
+ const base64Index = dataUri.indexOf(",");
265
+ if (base64Index === -1) {
266
+ return {
267
+ isDataUri: true,
268
+ base64Content: dataUri
269
+ };
270
+ }
271
+ const header = dataUri.substring(5, base64Index);
272
+ const base64Content = dataUri.substring(base64Index + 1);
273
+ const semicolonIndex = header.indexOf(";");
274
+ const mimeType = semicolonIndex !== -1 ? header.substring(0, semicolonIndex) : header;
275
+ return {
276
+ isDataUri: true,
277
+ mimeType: mimeType || void 0,
278
+ base64Content
279
+ };
280
+ }
281
+ function createDataUri(base64Content, mimeType = "application/octet-stream") {
282
+ if (base64Content.startsWith("data:")) {
283
+ return base64Content;
284
+ }
285
+ return `data:${mimeType};base64,${base64Content}`;
286
+ }
287
+ function imageContentToString(image, fallbackMimeType) {
288
+ if (typeof image === "string") {
289
+ return image;
290
+ }
291
+ if (image instanceof URL) {
292
+ return image.toString();
293
+ }
294
+ if (image instanceof Uint8Array || image instanceof ArrayBuffer || globalThis.Buffer && Buffer.isBuffer(image)) {
295
+ const base64 = convertDataContentToBase64String(image);
296
+ if (fallbackMimeType && !base64.startsWith("data:")) {
297
+ return `data:${fallbackMimeType};base64,${base64}`;
298
+ }
299
+ return base64;
300
+ }
301
+ return String(image);
302
+ }
303
+ function imageContentToDataUri(image, mimeType = "image/png") {
304
+ const imageStr = imageContentToString(image, mimeType);
305
+ if (imageStr.startsWith("data:")) {
306
+ return imageStr;
307
+ }
308
+ if (imageStr.startsWith("http://") || imageStr.startsWith("https://")) {
309
+ return imageStr;
310
+ }
311
+ return `data:${mimeType};base64,${imageStr}`;
312
+ }
313
+ function getImageCacheKey(image) {
314
+ if (image instanceof URL) {
315
+ return image.toString();
316
+ }
317
+ if (typeof image === "string") {
318
+ return image.length;
319
+ }
320
+ if (image instanceof Uint8Array) {
321
+ return image.byteLength;
322
+ }
323
+ if (image instanceof ArrayBuffer) {
324
+ return image.byteLength;
325
+ }
326
+ return image;
327
+ }
328
+ function isValidUrl(str) {
329
+ try {
330
+ new URL(str);
331
+ return true;
332
+ } catch {
333
+ if (str.startsWith("//")) {
334
+ try {
335
+ new URL(`https:${str}`);
336
+ return true;
337
+ } catch {
338
+ return false;
339
+ }
340
+ }
341
+ return false;
342
+ }
343
+ }
344
+ function categorizeFileData(data, fallbackMimeType) {
345
+ const parsed = parseDataUri(data);
346
+ const mimeType = parsed.isDataUri && parsed.mimeType ? parsed.mimeType : fallbackMimeType;
347
+ if (parsed.isDataUri) {
348
+ return {
349
+ type: "dataUri",
350
+ mimeType,
351
+ data
352
+ };
353
+ }
354
+ if (isValidUrl(data)) {
355
+ return {
356
+ type: "url",
357
+ mimeType,
358
+ data
359
+ };
360
+ }
361
+ return {
362
+ type: "raw",
363
+ mimeType,
364
+ data
365
+ };
366
+ }
236
367
 
237
368
  // src/agent/message-list/prompt/attachments-to-parts.ts
238
369
  function attachmentsToParts(attachments) {
239
370
  const parts = [];
240
371
  for (const attachment of attachments) {
372
+ const categorized = categorizeFileData(attachment.url, attachment.contentType);
373
+ let urlString = attachment.url;
374
+ if (categorized.type === "raw") {
375
+ urlString = createDataUri(attachment.url, attachment.contentType || "application/octet-stream");
376
+ }
241
377
  let url;
242
378
  try {
243
- url = new URL(attachment.url);
379
+ url = new URL(urlString);
244
380
  } catch {
245
381
  throw new Error(`Invalid URL: ${attachment.url}`);
246
382
  }
@@ -265,13 +401,13 @@ function attachmentsToParts(attachments) {
265
401
  if (attachment.contentType?.startsWith("image/")) {
266
402
  parts.push({
267
403
  type: "image",
268
- image: attachment.url,
404
+ image: urlString,
269
405
  mimeType: attachment.contentType
270
406
  });
271
407
  } else if (attachment.contentType?.startsWith("text/")) {
272
408
  parts.push({
273
409
  type: "file",
274
- data: attachment.url,
410
+ data: urlString,
275
411
  mimeType: attachment.contentType
276
412
  });
277
413
  } else {
@@ -280,7 +416,7 @@ function attachmentsToParts(attachments) {
280
416
  }
281
417
  parts.push({
282
418
  type: "file",
283
- data: attachment.url,
419
+ data: urlString,
284
420
  mimeType: attachment.contentType
285
421
  });
286
422
  }
@@ -591,29 +727,10 @@ function convertToV1Messages(messages) {
591
727
  }
592
728
  return v1Messages;
593
729
  }
594
- zod.z.union([
595
- zod.z.string(),
596
- zod.z.instanceof(Uint8Array),
597
- zod.z.instanceof(ArrayBuffer),
598
- zod.z.custom(
599
- // Buffer might not be available in some environments such as CloudFlare:
600
- (value) => globalThis.Buffer?.isBuffer(value) ?? false,
601
- { message: "Must be a Buffer" }
602
- )
603
- ]);
604
- function convertDataContentToBase64String(content) {
605
- if (typeof content === "string") {
606
- return content;
607
- }
608
- if (content instanceof ArrayBuffer) {
609
- return providerUtils.convertUint8ArrayToBase64(new Uint8Array(content));
610
- }
611
- return providerUtils.convertUint8ArrayToBase64(content);
612
- }
613
730
  var downloadFromUrl = async ({ url, downloadRetries }) => {
614
731
  const urlText = url.toString();
615
732
  try {
616
- const response = await chunkLZFCR2SE_cjs.fetchWithRetry(
733
+ const response = await chunkIAJHRFO4_cjs.fetchWithRetry(
617
734
  urlText,
618
735
  {
619
736
  method: "GET"
@@ -692,118 +809,6 @@ async function downloadAssetsFromMessages({
692
809
  return Object.fromEntries(downloadFileList);
693
810
  }
694
811
 
695
- // src/agent/message-list/prompt/image-utils.ts
696
- function parseDataUri(dataUri) {
697
- if (!dataUri.startsWith("data:")) {
698
- return {
699
- isDataUri: false,
700
- base64Content: dataUri
701
- };
702
- }
703
- const base64Index = dataUri.indexOf(",");
704
- if (base64Index === -1) {
705
- return {
706
- isDataUri: true,
707
- base64Content: dataUri
708
- };
709
- }
710
- const header = dataUri.substring(5, base64Index);
711
- const base64Content = dataUri.substring(base64Index + 1);
712
- const semicolonIndex = header.indexOf(";");
713
- const mimeType = semicolonIndex !== -1 ? header.substring(0, semicolonIndex) : header;
714
- return {
715
- isDataUri: true,
716
- mimeType: mimeType || void 0,
717
- base64Content
718
- };
719
- }
720
- function createDataUri(base64Content, mimeType = "application/octet-stream") {
721
- if (base64Content.startsWith("data:")) {
722
- return base64Content;
723
- }
724
- return `data:${mimeType};base64,${base64Content}`;
725
- }
726
- function imageContentToString(image, fallbackMimeType) {
727
- if (typeof image === "string") {
728
- return image;
729
- }
730
- if (image instanceof URL) {
731
- return image.toString();
732
- }
733
- if (image instanceof Uint8Array || image instanceof ArrayBuffer || globalThis.Buffer && Buffer.isBuffer(image)) {
734
- const base64 = convertDataContentToBase64String(image);
735
- if (fallbackMimeType && !base64.startsWith("data:")) {
736
- return `data:${fallbackMimeType};base64,${base64}`;
737
- }
738
- return base64;
739
- }
740
- return String(image);
741
- }
742
- function imageContentToDataUri(image, mimeType = "image/png") {
743
- const imageStr = imageContentToString(image, mimeType);
744
- if (imageStr.startsWith("data:")) {
745
- return imageStr;
746
- }
747
- if (imageStr.startsWith("http://") || imageStr.startsWith("https://")) {
748
- return imageStr;
749
- }
750
- return `data:${mimeType};base64,${imageStr}`;
751
- }
752
- function getImageCacheKey(image) {
753
- if (image instanceof URL) {
754
- return image.toString();
755
- }
756
- if (typeof image === "string") {
757
- return image.length;
758
- }
759
- if (image instanceof Uint8Array) {
760
- return image.byteLength;
761
- }
762
- if (image instanceof ArrayBuffer) {
763
- return image.byteLength;
764
- }
765
- return image;
766
- }
767
- function isValidUrl(str) {
768
- try {
769
- new URL(str);
770
- return true;
771
- } catch {
772
- if (str.startsWith("//")) {
773
- try {
774
- new URL(`https:${str}`);
775
- return true;
776
- } catch {
777
- return false;
778
- }
779
- }
780
- return false;
781
- }
782
- }
783
- function categorizeFileData(data, fallbackMimeType) {
784
- const parsed = parseDataUri(data);
785
- const mimeType = parsed.isDataUri && parsed.mimeType ? parsed.mimeType : fallbackMimeType;
786
- if (parsed.isDataUri) {
787
- return {
788
- type: "dataUri",
789
- mimeType,
790
- data
791
- };
792
- }
793
- if (isValidUrl(data)) {
794
- return {
795
- type: "url",
796
- mimeType,
797
- data
798
- };
799
- }
800
- return {
801
- type: "raw",
802
- mimeType,
803
- data
804
- };
805
- }
806
-
807
812
  // src/agent/message-list/utils/ai-v5/gemini-compatibility.ts
808
813
  function ensureGeminiCompatibleMessages(messages) {
809
814
  const result = [...messages];
@@ -1385,9 +1390,20 @@ var MessageList = class _MessageList {
1385
1390
  if (m.content.parts.length) {
1386
1391
  for (const part of m.content.parts) {
1387
1392
  if (part.type === `file`) {
1393
+ let normalizedUrl;
1394
+ if (typeof part.data === "string") {
1395
+ const categorized = categorizeFileData(part.data, part.mimeType);
1396
+ if (categorized.type === "raw") {
1397
+ normalizedUrl = createDataUri(part.data, part.mimeType || "application/octet-stream");
1398
+ } else {
1399
+ normalizedUrl = part.data;
1400
+ }
1401
+ } else {
1402
+ normalizedUrl = part.data;
1403
+ }
1388
1404
  experimentalAttachments.push({
1389
1405
  contentType: part.mimeType,
1390
- url: part.data
1406
+ url: normalizedUrl
1391
1407
  });
1392
1408
  } else if (part.type === "tool-invocation" && (part.toolInvocation.state === "call" || part.toolInvocation.state === "partial-call")) {
1393
1409
  continue;
@@ -2033,6 +2049,12 @@ var MessageList = class _MessageList {
2033
2049
  if (toolInvocations.length) content.toolInvocations = toolInvocations;
2034
2050
  if (typeof coreMessage.content === `string`) content.content = coreMessage.content;
2035
2051
  if (experimentalAttachments.length) content.experimental_attachments = experimentalAttachments;
2052
+ if (coreMessage.providerOptions) {
2053
+ content.providerMetadata = coreMessage.providerOptions;
2054
+ }
2055
+ if ("metadata" in coreMessage && coreMessage.metadata !== null && coreMessage.metadata !== void 0) {
2056
+ content.metadata = coreMessage.metadata;
2057
+ }
2036
2058
  return {
2037
2059
  id,
2038
2060
  role: _MessageList.getRole(coreMessage),
@@ -2265,9 +2287,23 @@ var MessageList = class _MessageList {
2265
2287
  if (role === `tool` || role === `assistant`) {
2266
2288
  throw new Error(incompatibleMessage);
2267
2289
  }
2290
+ let processedImage;
2291
+ if (part.image instanceof URL || part.image instanceof Uint8Array) {
2292
+ processedImage = part.image;
2293
+ } else if (Buffer.isBuffer(part.image) || part.image instanceof ArrayBuffer) {
2294
+ processedImage = new Uint8Array(part.image);
2295
+ } else {
2296
+ const categorized = categorizeFileData(part.image, part.mimeType);
2297
+ if (categorized.type === "raw") {
2298
+ const dataUri = createDataUri(part.image, part.mimeType || "image/png");
2299
+ processedImage = new URL(dataUri);
2300
+ } else {
2301
+ processedImage = new URL(part.image);
2302
+ }
2303
+ }
2268
2304
  roleContent[role].push({
2269
2305
  ...part,
2270
- image: part.image instanceof URL || part.image instanceof Uint8Array ? part.image : Buffer.isBuffer(part.image) || part.image instanceof ArrayBuffer ? new Uint8Array(part.image) : new URL(part.image)
2306
+ image: processedImage
2271
2307
  });
2272
2308
  break;
2273
2309
  }
@@ -2483,15 +2519,17 @@ var MessageList = class _MessageList {
2483
2519
  type: "file",
2484
2520
  mimeType: p.mediaType,
2485
2521
  data: fileDataSource,
2486
- providerMetadata: p.providerMetadata
2522
+ ...p.providerMetadata ? { providerMetadata: p.providerMetadata } : {}
2487
2523
  };
2488
2524
  }
2489
2525
  case "reasoning":
2490
- if (p.text === "") return null;
2526
+ if (p.text === "" && !p.providerMetadata) return null;
2491
2527
  return {
2492
2528
  type: "reasoning",
2493
- reasoning: p.text,
2494
- details: [{ type: "text", text: p.text }],
2529
+ // Keep reasoning field empty to match the format used in llm-execution-step
2530
+ // This ensures cache keys match for deduplication when merging assistant messages
2531
+ reasoning: "",
2532
+ details: p.text ? [{ type: "text", text: p.text }] : [],
2495
2533
  providerMetadata: p.providerMetadata
2496
2534
  };
2497
2535
  case "source-url":
@@ -2635,7 +2673,7 @@ var MessageList = class _MessageList {
2635
2673
  if (c.type === `text`) return p + c.text;
2636
2674
  return p;
2637
2675
  }, "") ?? "");
2638
- if (text || part.details?.length) {
2676
+ if (text || part.details?.length || part.providerMetadata) {
2639
2677
  parts.push({
2640
2678
  type: "reasoning",
2641
2679
  text: text || "",
@@ -2651,7 +2689,7 @@ var MessageList = class _MessageList {
2651
2689
  type: "file",
2652
2690
  url: part.data,
2653
2691
  mediaType: categorized.mimeType || "image/png",
2654
- providerMetadata: part.providerMetadata
2692
+ ...part.providerMetadata ? { providerMetadata: part.providerMetadata } : {}
2655
2693
  });
2656
2694
  fileUrls.add(part.data);
2657
2695
  } else {
@@ -2682,7 +2720,7 @@ var MessageList = class _MessageList {
2682
2720
  url: dataUri,
2683
2721
  // Use url field with data URI
2684
2722
  mediaType: finalMimeType,
2685
- providerMetadata: part.providerMetadata
2723
+ ...part.providerMetadata ? { providerMetadata: part.providerMetadata } : {}
2686
2724
  });
2687
2725
  }
2688
2726
  fileUrls.add(part.data);
@@ -2733,7 +2771,16 @@ var MessageList = class _MessageList {
2733
2771
  if (uiPart && "callProviderMetadata" in uiPart && uiPart.callProviderMetadata) {
2734
2772
  return {
2735
2773
  ...part,
2736
- providerMetadata: uiPart.callProviderMetadata
2774
+ providerOptions: uiPart.callProviderMetadata
2775
+ };
2776
+ }
2777
+ }
2778
+ if (part.type === "reasoning") {
2779
+ const uiPart = uiMsg?.parts[partIndex];
2780
+ if (uiPart && "providerMetadata" in uiPart && uiPart.providerMetadata) {
2781
+ return {
2782
+ ...part,
2783
+ providerOptions: uiPart.providerMetadata
2737
2784
  };
2738
2785
  }
2739
2786
  }
@@ -2786,8 +2833,9 @@ var MessageList = class _MessageList {
2786
2833
  return msgs;
2787
2834
  }
2788
2835
  static mastraMessageV3ToAIV5UIMessage(m) {
2836
+ const { __originalContent, ...cleanMetadata } = m.content.metadata || {};
2789
2837
  const metadata = {
2790
- ...m.content.metadata || {}
2838
+ ...cleanMetadata
2791
2839
  };
2792
2840
  if (m.createdAt) metadata.createdAt = m.createdAt;
2793
2841
  if (m.threadId) metadata.threadId = m.threadId;
@@ -3007,6 +3055,12 @@ var MessageList = class _MessageList {
3007
3055
  format: 3,
3008
3056
  parts
3009
3057
  };
3058
+ if ("metadata" in coreMessage && coreMessage.metadata !== null && coreMessage.metadata !== void 0) {
3059
+ content.metadata = {
3060
+ ...content.metadata || {},
3061
+ ...coreMessage.metadata
3062
+ };
3063
+ }
3010
3064
  if (coreMessage.content) {
3011
3065
  content.metadata = {
3012
3066
  ...content.metadata || {},
@@ -3145,5 +3199,5 @@ exports.DefaultGeneratedFile = DefaultGeneratedFile;
3145
3199
  exports.DefaultGeneratedFileWithType = DefaultGeneratedFileWithType;
3146
3200
  exports.MessageList = MessageList;
3147
3201
  exports.convertMessages = convertMessages;
3148
- //# sourceMappingURL=chunk-XHKMGOON.cjs.map
3149
- //# sourceMappingURL=chunk-XHKMGOON.cjs.map
3202
+ //# sourceMappingURL=chunk-42RUESSD.cjs.map
3203
+ //# sourceMappingURL=chunk-42RUESSD.cjs.map