@mastra/core 1.0.0-beta.14 → 1.0.0-beta.15

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 (349) hide show
  1. package/CHANGELOG.md +307 -0
  2. package/dist/agent/agent-legacy.d.ts.map +1 -1
  3. package/dist/agent/agent.d.ts.map +1 -1
  4. package/dist/agent/index.cjs +11 -11
  5. package/dist/agent/index.js +2 -2
  6. package/dist/agent/message-list/index.cjs +3 -3
  7. package/dist/agent/message-list/index.d.ts +1 -1
  8. package/dist/agent/message-list/index.d.ts.map +1 -1
  9. package/dist/agent/message-list/index.js +1 -1
  10. package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
  11. package/dist/agent/utils.d.ts.map +1 -1
  12. package/dist/{chunk-TDM43G4I.cjs → chunk-2OOMJRXZ.cjs} +9 -9
  13. package/dist/{chunk-TDM43G4I.cjs.map → chunk-2OOMJRXZ.cjs.map} +1 -1
  14. package/dist/chunk-37YWZMBX.js +27 -0
  15. package/dist/chunk-37YWZMBX.js.map +1 -0
  16. package/dist/{chunk-GBQXIVL6.js → chunk-3HDRO3GG.js} +790 -1206
  17. package/dist/chunk-3HDRO3GG.js.map +1 -0
  18. package/dist/{chunk-VZJOEGQA.js → chunk-4DFWV4IR.js} +2 -2
  19. package/dist/chunk-4DFWV4IR.js.map +1 -0
  20. package/dist/{chunk-373OC54J.js → chunk-4HP7CS6L.js} +7 -6
  21. package/dist/chunk-4HP7CS6L.js.map +1 -0
  22. package/dist/{chunk-4CMIJQF6.js → chunk-4J4M2Q5R.js} +14 -14
  23. package/dist/chunk-4J4M2Q5R.js.map +1 -0
  24. package/dist/{chunk-HWMMIRIF.cjs → chunk-4U7ZLI36.cjs} +3 -2
  25. package/dist/chunk-4U7ZLI36.cjs.map +1 -0
  26. package/dist/{chunk-Z55SJVEC.cjs → chunk-6HJFCSJ4.cjs} +7 -6
  27. package/dist/chunk-6HJFCSJ4.cjs.map +1 -0
  28. package/dist/{chunk-EGHGFLL3.cjs → chunk-AAX7ZOM7.cjs} +2 -2
  29. package/dist/chunk-AAX7ZOM7.cjs.map +1 -0
  30. package/dist/{chunk-SLBWA2F3.js → chunk-AR5CF3IN.js} +3 -3
  31. package/dist/{chunk-SLBWA2F3.js.map → chunk-AR5CF3IN.js.map} +1 -1
  32. package/dist/{chunk-QDVYP2T7.js → chunk-BAZHNX5P.js} +8 -8
  33. package/dist/{chunk-QDVYP2T7.js.map → chunk-BAZHNX5P.js.map} +1 -1
  34. package/dist/{chunk-O3ULBGV6.cjs → chunk-BC2VKOH4.cjs} +43 -21
  35. package/dist/chunk-BC2VKOH4.cjs.map +1 -0
  36. package/dist/{chunk-5UQ5TB6J.js → chunk-BCUKD2XG.js} +59 -19
  37. package/dist/chunk-BCUKD2XG.js.map +1 -0
  38. package/dist/{chunk-67LM2UCT.js → chunk-CBQ6WDUJ.js} +5 -5
  39. package/dist/{chunk-67LM2UCT.js.map → chunk-CBQ6WDUJ.js.map} +1 -1
  40. package/dist/chunk-CBVHOGXX.cjs +674 -0
  41. package/dist/chunk-CBVHOGXX.cjs.map +1 -0
  42. package/dist/{chunk-O5BQBZEF.cjs → chunk-CBY37FTP.cjs} +28 -28
  43. package/dist/{chunk-O5BQBZEF.cjs.map → chunk-CBY37FTP.cjs.map} +1 -1
  44. package/dist/{chunk-3IP3DZ7G.js → chunk-D2IFWD7A.js} +285 -124
  45. package/dist/chunk-D2IFWD7A.js.map +1 -0
  46. package/dist/{chunk-JAGQZZ43.cjs → chunk-DDK3URK2.cjs} +636 -313
  47. package/dist/chunk-DDK3URK2.cjs.map +1 -0
  48. package/dist/chunk-DRJTNGI4.cjs +263 -0
  49. package/dist/chunk-DRJTNGI4.cjs.map +1 -0
  50. package/dist/{chunk-72E3YF6A.cjs → chunk-EMLEZXTQ.cjs} +15 -12
  51. package/dist/chunk-EMLEZXTQ.cjs.map +1 -0
  52. package/dist/{chunk-YPLZDWG7.js → chunk-FJEVLHJT.js} +3 -2
  53. package/dist/chunk-FJEVLHJT.js.map +1 -0
  54. package/dist/{chunk-53SZJCBX.cjs → chunk-GXMJ5URG.cjs} +25 -25
  55. package/dist/{chunk-53SZJCBX.cjs.map → chunk-GXMJ5URG.cjs.map} +1 -1
  56. package/dist/chunk-H2NHG7QL.cjs +32 -0
  57. package/dist/chunk-H2NHG7QL.cjs.map +1 -0
  58. package/dist/chunk-HAYBGFPA.js +259 -0
  59. package/dist/chunk-HAYBGFPA.js.map +1 -0
  60. package/dist/{chunk-AYBJ5GAD.js → chunk-IHISDRFV.js} +124 -50
  61. package/dist/chunk-IHISDRFV.js.map +1 -0
  62. package/dist/{chunk-DBW6S25C.cjs → chunk-IRTICXRZ.cjs} +101 -61
  63. package/dist/chunk-IRTICXRZ.cjs.map +1 -0
  64. package/dist/{chunk-ETWAR2YE.cjs → chunk-LOV5NNGK.cjs} +811 -1235
  65. package/dist/chunk-LOV5NNGK.cjs.map +1 -0
  66. package/dist/{chunk-QF4MHFSU.js → chunk-NGWTSHNA.js} +470 -152
  67. package/dist/chunk-NGWTSHNA.js.map +1 -0
  68. package/dist/{chunk-72YCRTEX.cjs → chunk-O2CAMK4A.cjs} +13 -2
  69. package/dist/chunk-O2CAMK4A.cjs.map +1 -0
  70. package/dist/{chunk-GELVUDUY.js → chunk-O7M7DR4E.js} +3 -3
  71. package/dist/{chunk-GELVUDUY.js.map → chunk-O7M7DR4E.js.map} +1 -1
  72. package/dist/chunk-OTIGV7CL.js +10215 -0
  73. package/dist/chunk-OTIGV7CL.js.map +1 -0
  74. package/dist/{chunk-4AT6YQKZ.js → chunk-QXL3F3T2.js} +7 -4
  75. package/dist/chunk-QXL3F3T2.js.map +1 -0
  76. package/dist/{chunk-6CG7IY57.cjs → chunk-RA2CHJCY.cjs} +319 -158
  77. package/dist/chunk-RA2CHJCY.cjs.map +1 -0
  78. package/dist/chunk-RMV5HJM7.cjs +10237 -0
  79. package/dist/chunk-RMV5HJM7.cjs.map +1 -0
  80. package/dist/{chunk-FPDJ4XN6.cjs → chunk-S23TNDXG.cjs} +125 -51
  81. package/dist/chunk-S23TNDXG.cjs.map +1 -0
  82. package/dist/{chunk-OOUFPYSX.cjs → chunk-SSB4AVHU.cjs} +17 -17
  83. package/dist/{chunk-OOUFPYSX.cjs.map → chunk-SSB4AVHU.cjs.map} +1 -1
  84. package/dist/{chunk-TRUNX3AX.cjs → chunk-T2LVULCK.cjs} +31 -31
  85. package/dist/chunk-T2LVULCK.cjs.map +1 -0
  86. package/dist/{chunk-LDXKZYOV.js → chunk-XJB7J4UT.js} +30 -8
  87. package/dist/chunk-XJB7J4UT.js.map +1 -0
  88. package/dist/chunk-YV43YEZ6.js +598 -0
  89. package/dist/chunk-YV43YEZ6.js.map +1 -0
  90. package/dist/{chunk-Y36Y5MTD.js → chunk-ZGIVAQRI.js} +13 -3
  91. package/dist/chunk-ZGIVAQRI.js.map +1 -0
  92. package/dist/error/index.cjs +6 -6
  93. package/dist/error/index.d.ts +1 -0
  94. package/dist/error/index.d.ts.map +1 -1
  95. package/dist/error/index.js +1 -1
  96. package/dist/evals/index.cjs +49 -9
  97. package/dist/evals/index.js +2 -2
  98. package/dist/evals/scoreTraces/index.cjs +70 -22
  99. package/dist/evals/scoreTraces/index.cjs.map +1 -1
  100. package/dist/evals/scoreTraces/index.js +63 -15
  101. package/dist/evals/scoreTraces/index.js.map +1 -1
  102. package/dist/evals/scoreTraces/scoreTracesWorkflow.d.ts.map +1 -1
  103. package/dist/evals/scoreTraces/utils.d.ts.map +1 -1
  104. package/dist/evals/types.d.ts +568 -116
  105. package/dist/evals/types.d.ts.map +1 -1
  106. package/dist/index.cjs +2 -2
  107. package/dist/index.js +1 -1
  108. package/dist/integration/index.cjs +2 -2
  109. package/dist/integration/index.js +1 -1
  110. package/dist/llm/index.cjs +20 -20
  111. package/dist/llm/index.js +4 -4
  112. package/dist/llm/model/aisdk/v6/model.d.ts +1 -9
  113. package/dist/llm/model/aisdk/v6/model.d.ts.map +1 -1
  114. package/dist/llm/model/embedding-router.d.ts +1 -1
  115. package/dist/llm/model/model.d.ts.map +1 -1
  116. package/dist/llm/model/model.loop.d.ts.map +1 -1
  117. package/dist/llm/model/provider-options.d.ts +2 -1
  118. package/dist/llm/model/provider-options.d.ts.map +1 -1
  119. package/dist/llm/model/provider-types.generated.d.ts +42 -17
  120. package/dist/loop/index.cjs +2 -2
  121. package/dist/loop/index.js +1 -1
  122. package/dist/loop/network/index.d.ts +6 -6
  123. package/dist/loop/test-utils/MastraLanguageModelV3Mock.d.ts +1 -9
  124. package/dist/loop/test-utils/MastraLanguageModelV3Mock.d.ts.map +1 -1
  125. package/dist/loop/types.d.ts +5 -2
  126. package/dist/loop/types.d.ts.map +1 -1
  127. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  128. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
  129. package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
  130. package/dist/mastra/hooks.d.ts.map +1 -1
  131. package/dist/mastra/index.cjs +2 -2
  132. package/dist/mastra/index.d.ts +7 -2
  133. package/dist/mastra/index.d.ts.map +1 -1
  134. package/dist/mastra/index.js +1 -1
  135. package/dist/mcp/index.cjs +4 -4
  136. package/dist/mcp/index.js +1 -1
  137. package/dist/memory/index.cjs +26 -6
  138. package/dist/memory/index.d.ts +1 -0
  139. package/dist/memory/index.d.ts.map +1 -1
  140. package/dist/memory/index.js +1 -1
  141. package/dist/memory/memory.d.ts +9 -8
  142. package/dist/memory/memory.d.ts.map +1 -1
  143. package/dist/memory/mock.d.ts +2 -1
  144. package/dist/memory/mock.d.ts.map +1 -1
  145. package/dist/memory/types.d.ts +3 -4
  146. package/dist/memory/types.d.ts.map +1 -1
  147. package/dist/memory/working-memory-utils.d.ts +20 -0
  148. package/dist/memory/working-memory-utils.d.ts.map +1 -0
  149. package/dist/models-dev-26XLUKVK.cjs +12 -0
  150. package/dist/{models-dev-PPS7X4JM.cjs.map → models-dev-26XLUKVK.cjs.map} +1 -1
  151. package/dist/models-dev-HUFLQFPB.js +3 -0
  152. package/dist/{models-dev-E3WWI7VA.js.map → models-dev-HUFLQFPB.js.map} +1 -1
  153. package/dist/netlify-CUYK2MZ2.cjs +12 -0
  154. package/dist/{netlify-VZFM5UH3.cjs.map → netlify-CUYK2MZ2.cjs.map} +1 -1
  155. package/dist/netlify-J4QPOROO.js +3 -0
  156. package/dist/{netlify-TY656UYF.js.map → netlify-J4QPOROO.js.map} +1 -1
  157. package/dist/observability/index.cjs +14 -10
  158. package/dist/observability/index.js +1 -1
  159. package/dist/observability/types/tracing.d.ts +32 -19
  160. package/dist/observability/types/tracing.d.ts.map +1 -1
  161. package/dist/processors/index.cjs +37 -37
  162. package/dist/processors/index.d.ts +2 -0
  163. package/dist/processors/index.d.ts.map +1 -1
  164. package/dist/processors/index.js +1 -1
  165. package/dist/processors/memory/message-history.d.ts +7 -1
  166. package/dist/processors/memory/message-history.d.ts.map +1 -1
  167. package/dist/processors/processors/language-detector.d.ts.map +1 -1
  168. package/dist/processors/processors/moderation.d.ts.map +1 -1
  169. package/dist/processors/processors/pii-detector.d.ts.map +1 -1
  170. package/dist/processors/processors/prompt-injection-detector.d.ts.map +1 -1
  171. package/dist/processors/processors/token-limiter.d.ts +5 -2
  172. package/dist/processors/processors/token-limiter.d.ts.map +1 -1
  173. package/dist/processors/runner.d.ts +2 -0
  174. package/dist/processors/runner.d.ts.map +1 -1
  175. package/dist/provider-registry-6CIGRQVZ.js +3 -0
  176. package/dist/{provider-registry-NXVD764B.js.map → provider-registry-6CIGRQVZ.js.map} +1 -1
  177. package/dist/provider-registry-7O7FJ4BS.cjs +40 -0
  178. package/dist/{provider-registry-ZIWSEUQE.cjs.map → provider-registry-7O7FJ4BS.cjs.map} +1 -1
  179. package/dist/provider-registry.json +120 -46
  180. package/dist/relevance/index.cjs +3 -3
  181. package/dist/relevance/index.js +1 -1
  182. package/dist/server/index.cjs +5 -5
  183. package/dist/server/index.js +1 -1
  184. package/dist/storage/base.d.ts +40 -292
  185. package/dist/storage/base.d.ts.map +1 -1
  186. package/dist/storage/constants.cjs +60 -0
  187. package/dist/storage/constants.cjs.map +1 -0
  188. package/dist/storage/constants.d.ts +6 -1
  189. package/dist/storage/constants.d.ts.map +1 -1
  190. package/dist/storage/constants.js +3 -0
  191. package/dist/storage/constants.js.map +1 -0
  192. package/dist/storage/domains/agents/base.d.ts +2 -2
  193. package/dist/storage/domains/agents/base.d.ts.map +1 -1
  194. package/dist/storage/domains/agents/inmemory.d.ts +5 -4
  195. package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
  196. package/dist/storage/domains/base.d.ts +20 -0
  197. package/dist/storage/domains/base.d.ts.map +1 -0
  198. package/dist/storage/domains/index.d.ts +3 -0
  199. package/dist/storage/domains/index.d.ts.map +1 -1
  200. package/dist/storage/domains/inmemory-db.d.ts +57 -0
  201. package/dist/storage/domains/inmemory-db.d.ts.map +1 -0
  202. package/dist/storage/domains/memory/base.d.ts +2 -2
  203. package/dist/storage/domains/memory/base.d.ts.map +1 -1
  204. package/dist/storage/domains/memory/inmemory.d.ts +5 -13
  205. package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
  206. package/dist/storage/domains/observability/base.d.ts +24 -29
  207. package/dist/storage/domains/observability/base.d.ts.map +1 -1
  208. package/dist/storage/domains/observability/index.d.ts +1 -0
  209. package/dist/storage/domains/observability/index.d.ts.map +1 -1
  210. package/dist/storage/domains/observability/inmemory.d.ts +46 -35
  211. package/dist/storage/domains/observability/inmemory.d.ts.map +1 -1
  212. package/dist/storage/domains/observability/types.d.ts +2365 -0
  213. package/dist/storage/domains/observability/types.d.ts.map +1 -0
  214. package/dist/storage/domains/scores/base.d.ts +9 -20
  215. package/dist/storage/domains/scores/base.d.ts.map +1 -1
  216. package/dist/storage/domains/scores/inmemory.d.ts +11 -22
  217. package/dist/storage/domains/scores/inmemory.d.ts.map +1 -1
  218. package/dist/storage/domains/shared.d.ts +76 -0
  219. package/dist/storage/domains/shared.d.ts.map +1 -0
  220. package/dist/storage/domains/workflows/base.d.ts +4 -2
  221. package/dist/storage/domains/workflows/base.d.ts.map +1 -1
  222. package/dist/storage/domains/workflows/inmemory.d.ts +10 -9
  223. package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
  224. package/dist/storage/index.cjs +272 -59
  225. package/dist/storage/index.js +2 -1
  226. package/dist/storage/mock.d.ts +28 -174
  227. package/dist/storage/mock.d.ts.map +1 -1
  228. package/dist/storage/types.d.ts +39 -44
  229. package/dist/storage/types.d.ts.map +1 -1
  230. package/dist/storage/utils.d.ts +5 -0
  231. package/dist/storage/utils.d.ts.map +1 -1
  232. package/dist/stream/MastraAgentNetworkStream.d.ts +1 -1
  233. package/dist/stream/MastraAgentNetworkStream.d.ts.map +1 -1
  234. package/dist/stream/MastraWorkflowStream.d.ts +1 -1
  235. package/dist/stream/MastraWorkflowStream.d.ts.map +1 -1
  236. package/dist/stream/RunOutput.d.ts.map +1 -1
  237. package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
  238. package/dist/stream/base/output.d.ts.map +1 -1
  239. package/dist/stream/index.cjs +12 -12
  240. package/dist/stream/index.js +2 -2
  241. package/dist/stream/types.d.ts +3 -0
  242. package/dist/stream/types.d.ts.map +1 -1
  243. package/dist/test-utils/llm-mock.cjs +4 -4
  244. package/dist/test-utils/llm-mock.js +1 -1
  245. package/dist/tool-loop-agent/index.cjs +20 -0
  246. package/dist/tool-loop-agent/index.cjs.map +1 -0
  247. package/dist/tool-loop-agent/index.d.ts +36 -0
  248. package/dist/tool-loop-agent/index.d.ts.map +1 -0
  249. package/dist/tool-loop-agent/index.js +3 -0
  250. package/dist/tool-loop-agent/index.js.map +1 -0
  251. package/dist/tool-loop-agent/tool-loop-processor.d.ts +30 -0
  252. package/dist/tool-loop-agent/tool-loop-processor.d.ts.map +1 -0
  253. package/dist/tool-loop-agent/utils.d.ts +17 -0
  254. package/dist/tool-loop-agent/utils.d.ts.map +1 -0
  255. package/dist/tools/index.cjs +4 -4
  256. package/dist/tools/index.js +1 -1
  257. package/dist/tools/is-vercel-tool.cjs +2 -2
  258. package/dist/tools/is-vercel-tool.js +1 -1
  259. package/dist/tools/tool-builder/builder.d.ts.map +1 -1
  260. package/dist/tools/toolchecks.d.ts +1 -1
  261. package/dist/tools/toolchecks.d.ts.map +1 -1
  262. package/dist/tools/validation.d.ts +1 -1
  263. package/dist/tools/validation.d.ts.map +1 -1
  264. package/dist/utils/zod-utils.d.ts +34 -0
  265. package/dist/utils/zod-utils.d.ts.map +1 -0
  266. package/dist/utils.cjs +39 -22
  267. package/dist/utils.d.ts +1 -1
  268. package/dist/utils.d.ts.map +1 -1
  269. package/dist/utils.js +2 -1
  270. package/dist/vector/index.cjs +12 -5299
  271. package/dist/vector/index.cjs.map +1 -1
  272. package/dist/vector/index.js +3 -5274
  273. package/dist/vector/index.js.map +1 -1
  274. package/dist/vector/vector.d.ts +13 -3
  275. package/dist/vector/vector.d.ts.map +1 -1
  276. package/dist/voice/index.cjs +6 -6
  277. package/dist/voice/index.js +1 -1
  278. package/dist/workflows/default.d.ts +2 -0
  279. package/dist/workflows/default.d.ts.map +1 -1
  280. package/dist/workflows/evented/execution-engine.d.ts +1 -0
  281. package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
  282. package/dist/workflows/evented/index.cjs +10 -10
  283. package/dist/workflows/evented/index.js +1 -1
  284. package/dist/workflows/evented/step-executor.d.ts +1 -0
  285. package/dist/workflows/evented/step-executor.d.ts.map +1 -1
  286. package/dist/workflows/evented/workflow-event-processor/index.d.ts +5 -4
  287. package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
  288. package/dist/workflows/evented/workflow-event-processor/loop.d.ts +2 -2
  289. package/dist/workflows/evented/workflow-event-processor/loop.d.ts.map +1 -1
  290. package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
  291. package/dist/workflows/evented/workflow-event-processor/parallel.d.ts.map +1 -1
  292. package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
  293. package/dist/workflows/evented/workflow-event-processor/sleep.d.ts.map +1 -1
  294. package/dist/workflows/evented/workflow.d.ts +5 -2
  295. package/dist/workflows/evented/workflow.d.ts.map +1 -1
  296. package/dist/workflows/execution-engine.d.ts +1 -0
  297. package/dist/workflows/execution-engine.d.ts.map +1 -1
  298. package/dist/workflows/handlers/control-flow.d.ts +4 -0
  299. package/dist/workflows/handlers/control-flow.d.ts.map +1 -1
  300. package/dist/workflows/handlers/entry.d.ts +3 -2
  301. package/dist/workflows/handlers/entry.d.ts.map +1 -1
  302. package/dist/workflows/handlers/step.d.ts +1 -0
  303. package/dist/workflows/handlers/step.d.ts.map +1 -1
  304. package/dist/workflows/index.cjs +23 -23
  305. package/dist/workflows/index.js +1 -1
  306. package/dist/workflows/types.d.ts +23 -3
  307. package/dist/workflows/types.d.ts.map +1 -1
  308. package/dist/workflows/utils.d.ts +1 -0
  309. package/dist/workflows/utils.d.ts.map +1 -1
  310. package/dist/workflows/workflow.d.ts +22 -8
  311. package/dist/workflows/workflow.d.ts.map +1 -1
  312. package/package.json +16 -6
  313. package/src/llm/model/provider-types.generated.d.ts +42 -17
  314. package/storage/constants.d.ts +1 -0
  315. package/tool-loop-agent.d.ts +1 -0
  316. package/dist/chunk-373OC54J.js.map +0 -1
  317. package/dist/chunk-3IP3DZ7G.js.map +0 -1
  318. package/dist/chunk-4AT6YQKZ.js.map +0 -1
  319. package/dist/chunk-4CMIJQF6.js.map +0 -1
  320. package/dist/chunk-5UQ5TB6J.js.map +0 -1
  321. package/dist/chunk-6CG7IY57.cjs.map +0 -1
  322. package/dist/chunk-72E3YF6A.cjs.map +0 -1
  323. package/dist/chunk-72YCRTEX.cjs.map +0 -1
  324. package/dist/chunk-ADADLFDR.js +0 -42
  325. package/dist/chunk-ADADLFDR.js.map +0 -1
  326. package/dist/chunk-AYBJ5GAD.js.map +0 -1
  327. package/dist/chunk-DBW6S25C.cjs.map +0 -1
  328. package/dist/chunk-EGHGFLL3.cjs.map +0 -1
  329. package/dist/chunk-ETWAR2YE.cjs.map +0 -1
  330. package/dist/chunk-FPDJ4XN6.cjs.map +0 -1
  331. package/dist/chunk-GBQXIVL6.js.map +0 -1
  332. package/dist/chunk-HWMMIRIF.cjs.map +0 -1
  333. package/dist/chunk-JAGQZZ43.cjs.map +0 -1
  334. package/dist/chunk-LDXKZYOV.js.map +0 -1
  335. package/dist/chunk-O3ULBGV6.cjs.map +0 -1
  336. package/dist/chunk-QF4MHFSU.js.map +0 -1
  337. package/dist/chunk-T2VLUFGG.cjs +0 -47
  338. package/dist/chunk-T2VLUFGG.cjs.map +0 -1
  339. package/dist/chunk-TRUNX3AX.cjs.map +0 -1
  340. package/dist/chunk-VZJOEGQA.js.map +0 -1
  341. package/dist/chunk-Y36Y5MTD.js.map +0 -1
  342. package/dist/chunk-YPLZDWG7.js.map +0 -1
  343. package/dist/chunk-Z55SJVEC.cjs.map +0 -1
  344. package/dist/models-dev-E3WWI7VA.js +0 -3
  345. package/dist/models-dev-PPS7X4JM.cjs +0 -12
  346. package/dist/netlify-TY656UYF.js +0 -3
  347. package/dist/netlify-VZFM5UH3.cjs +0 -12
  348. package/dist/provider-registry-NXVD764B.js +0 -3
  349. package/dist/provider-registry-ZIWSEUQE.cjs +0 -40
@@ -1,22 +1,13 @@
1
- import type { MastraMessageContentV2, MastraDBMessage } from '../agent/index.js';
2
1
  import { MastraBase } from '../base.js';
3
- import type { ScoreRowData, ScoringSource, ValidatedSaveScorePayload } from '../evals/index.js';
4
- import type { StorageThreadType } from '../memory/types.js';
5
- import type { TracingStorageStrategy } from '../observability/index.js';
6
- import type { StepResult, WorkflowRunState } from '../workflows/types.js';
7
- import type { TABLE_NAMES } from './constants.js';
8
- import type { AgentsStorage, ScoresStorage, StoreOperations, WorkflowsStorage, MemoryStorage, ObservabilityStorage } from './domains/index.js';
9
- import type { PaginationInfo, StorageColumn, StorageResourceType, StoragePagination, WorkflowRun, WorkflowRuns, SpanRecord, TraceRecord, TracesPaginatedArg, CreateIndexOptions, IndexInfo, StorageIndexStats, UpdateSpanRecord, CreateSpanRecord, StorageListMessagesInput, StorageListMessagesOutput, StorageListWorkflowRunsInput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput, StorageAgentType, StorageCreateAgentInput, StorageUpdateAgentInput, StorageListAgentsInput, StorageListAgentsOutput, UpdateWorkflowStateOptions } from './types.js';
2
+ import type { AgentsStorage, ScoresStorage, WorkflowsStorage, MemoryStorage, ObservabilityStorage } from './domains/index.js';
3
+ import type { StorageSupports } from './types.js';
10
4
  export type StorageDomains = {
11
- operations: StoreOperations;
12
5
  workflows: WorkflowsStorage;
13
6
  scores: ScoresStorage;
14
7
  memory: MemoryStorage;
15
8
  observability?: ObservabilityStorage;
16
9
  agents?: AgentsStorage;
17
10
  };
18
- export declare function ensureDate(date: Date | string | undefined): Date | undefined;
19
- export declare function serializeDate(date: Date | string | undefined): string | undefined;
20
11
  /**
21
12
  * Normalizes perPage input for pagination queries.
22
13
  *
@@ -38,6 +29,27 @@ export declare function calculatePagination(page: number, perPageInput: number |
38
29
  offset: number;
39
30
  perPage: number | false;
40
31
  };
32
+ /**
33
+ * Base class for all Mastra storage adapters.
34
+ *
35
+ * Storage adapters provide persistence for various domains (memory, workflows, scores, observability, agents).
36
+ * All domain-specific operations should be accessed through `getStore()`:
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * // Access memory domain
41
+ * const memory = await storage.getStore('memory');
42
+ * await memory?.saveThread({ thread });
43
+ *
44
+ * // Access workflows domain
45
+ * const workflows = await storage.getStore('workflows');
46
+ * await workflows?.persistWorkflowSnapshot({ workflowName, runId, snapshot });
47
+ *
48
+ * // Access observability domain
49
+ * const observability = await storage.getStore('observability');
50
+ * await observability?.createSpan(span);
51
+ * ```
52
+ */
41
53
  export declare abstract class MastraStorage extends MastraBase {
42
54
  protected hasInitialized: null | Promise<boolean>;
43
55
  protected shouldCacheInit: boolean;
@@ -68,290 +80,26 @@ export declare abstract class MastraStorage extends MastraBase {
68
80
  name: string;
69
81
  disableInit?: boolean;
70
82
  });
71
- get supports(): {
72
- selectByIncludeResourceScope: boolean;
73
- resourceWorkingMemory: boolean;
74
- hasColumn: boolean;
75
- createTable: boolean;
76
- deleteMessages: boolean;
77
- observabilityInstance?: boolean;
78
- indexManagement?: boolean;
79
- listScoresBySpan?: boolean;
80
- agents?: boolean;
81
- };
82
- protected ensureDate(date: Date | string | undefined): Date | undefined;
83
- protected serializeDate(date: Date | string | undefined): string | undefined;
84
- abstract createTable({ tableName }: {
85
- tableName: TABLE_NAMES;
86
- schema: Record<string, StorageColumn>;
87
- }): Promise<void>;
88
- abstract clearTable({ tableName }: {
89
- tableName: TABLE_NAMES;
90
- }): Promise<void>;
91
- abstract dropTable({ tableName }: {
92
- tableName: TABLE_NAMES;
93
- }): Promise<void>;
94
- abstract alterTable(args: {
95
- tableName: TABLE_NAMES;
96
- schema: Record<string, StorageColumn>;
97
- ifNotExists: string[];
98
- }): Promise<void>;
99
- abstract insert({ tableName, record }: {
100
- tableName: TABLE_NAMES;
101
- record: Record<string, any>;
102
- }): Promise<void>;
103
- abstract batchInsert({ tableName, records, }: {
104
- tableName: TABLE_NAMES;
105
- records: Record<string, any>[];
106
- }): Promise<void>;
107
- abstract load<R>({ tableName, keys }: {
108
- tableName: TABLE_NAMES;
109
- keys: Record<string, any>;
110
- }): Promise<R | null>;
111
- abstract getThreadById({ threadId }: {
112
- threadId: string;
113
- }): Promise<StorageThreadType | null>;
114
- abstract saveThread({ thread }: {
115
- thread: StorageThreadType;
116
- }): Promise<StorageThreadType>;
117
- abstract updateThread({ id, title, metadata, }: {
118
- id: string;
119
- title: string;
120
- metadata: Record<string, unknown>;
121
- }): Promise<StorageThreadType>;
122
- abstract deleteThread({ threadId }: {
123
- threadId: string;
124
- }): Promise<void>;
125
- getResourceById(_: {
126
- resourceId: string;
127
- }): Promise<StorageResourceType | null>;
128
- saveResource(_: {
129
- resource: StorageResourceType;
130
- }): Promise<StorageResourceType>;
131
- updateResource(_: {
132
- resourceId: string;
133
- workingMemory?: string;
134
- metadata?: Record<string, unknown>;
135
- }): Promise<StorageResourceType>;
136
- abstract saveMessages(args: {
137
- messages: MastraDBMessage[];
138
- }): Promise<{
139
- messages: MastraDBMessage[];
140
- }>;
141
- listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
142
- listWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
143
- listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
144
- listMessagesById({ messageIds }: {
145
- messageIds: string[];
146
- }): Promise<{
147
- messages: MastraDBMessage[];
148
- }>;
149
- abstract updateMessages(args: {
150
- messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
151
- id: string;
152
- content?: Partial<MastraMessageContentV2>;
153
- })[];
154
- }): Promise<MastraDBMessage[]>;
155
- deleteMessages(_messageIds: string[]): Promise<void>;
156
- init(): Promise<void>;
157
- persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
158
- workflowName: string;
159
- runId: string;
160
- resourceId?: string;
161
- snapshot: WorkflowRunState;
162
- }): Promise<void>;
163
- abstract updateWorkflowResults({ workflowName, runId, stepId, result, }: {
164
- workflowName: string;
165
- runId: string;
166
- stepId: string;
167
- result: StepResult<any, any, any, any>;
168
- requestContext: Record<string, any>;
169
- }): Promise<Record<string, StepResult<any, any, any, any>>>;
170
- abstract updateWorkflowState({ workflowName, runId, opts, }: {
171
- workflowName: string;
172
- runId: string;
173
- opts: UpdateWorkflowStateOptions;
174
- }): Promise<WorkflowRunState | undefined>;
175
- loadWorkflowSnapshot({ workflowName, runId, }: {
176
- workflowName: string;
177
- runId: string;
178
- }): Promise<WorkflowRunState | null>;
179
- /**
180
- * SCORERS
181
- */
182
- abstract getScoreById({ id }: {
183
- id: string;
184
- }): Promise<ScoreRowData | null>;
185
- abstract saveScore(score: ValidatedSaveScorePayload): Promise<{
186
- score: ScoreRowData;
187
- }>;
188
- abstract listScoresByScorerId({ scorerId, source, entityId, entityType, pagination, }: {
189
- scorerId: string;
190
- pagination: StoragePagination;
191
- entityId?: string;
192
- entityType?: string;
193
- source?: ScoringSource;
194
- }): Promise<{
195
- pagination: PaginationInfo;
196
- scores: ScoreRowData[];
197
- }>;
198
- abstract listScoresByRunId({ runId, pagination, }: {
199
- runId: string;
200
- pagination: StoragePagination;
201
- }): Promise<{
202
- pagination: PaginationInfo;
203
- scores: ScoreRowData[];
204
- }>;
205
- abstract listScoresByEntityId({ entityId, entityType, pagination, }: {
206
- pagination: StoragePagination;
207
- entityId: string;
208
- entityType: string;
209
- }): Promise<{
210
- pagination: PaginationInfo;
211
- scores: ScoreRowData[];
212
- }>;
213
- listScoresBySpan({ traceId, spanId, pagination: _pagination, }: {
214
- traceId: string;
215
- spanId: string;
216
- pagination: StoragePagination;
217
- }): Promise<{
218
- pagination: PaginationInfo;
219
- scores: ScoreRowData[];
220
- }>;
221
- abstract getWorkflowRunById(args: {
222
- runId: string;
223
- workflowName?: string;
224
- }): Promise<WorkflowRun | null>;
225
- abstract deleteWorkflowRunById(args: {
226
- runId: string;
227
- workflowName: string;
228
- }): Promise<void>;
229
- /**
230
- * OBSERVABILITY
231
- */
232
- /**
233
- * Provides hints for tracing strategy selection by the DefaultExporter.
234
- * Storage adapters can override this to specify their preferred and supported strategies.
235
- */
236
- get tracingStrategy(): {
237
- preferred: TracingStorageStrategy;
238
- supported: TracingStorageStrategy[];
239
- };
240
- /**
241
- * Creates a single Span record in the storage provider.
242
- */
243
- createSpan(span: CreateSpanRecord): Promise<void>;
244
- /**
245
- * Updates a single Span with partial data. Primarily used for realtime trace creation.
246
- */
247
- updateSpan(params: {
248
- spanId: string;
249
- traceId: string;
250
- updates: Partial<UpdateSpanRecord>;
251
- }): Promise<void>;
252
- /**
253
- * Retrieves a single trace with all its associated spans.
254
- */
255
- getTrace(traceId: string): Promise<TraceRecord | null>;
256
- /**
257
- * Retrieves a paginated list of traces with optional filtering.
258
- */
259
- getTracesPaginated(args: TracesPaginatedArg): Promise<{
260
- pagination: PaginationInfo;
261
- spans: SpanRecord[];
262
- }>;
263
- /**
264
- * Creates multiple Spans in a single batch.
265
- */
266
- batchCreateSpans(args: {
267
- records: CreateSpanRecord[];
268
- }): Promise<void>;
269
- /**
270
- * Updates multiple Spans in a single batch.
271
- */
272
- batchUpdateSpans(args: {
273
- records: {
274
- traceId: string;
275
- spanId: string;
276
- updates: Partial<UpdateSpanRecord>;
277
- }[];
278
- }): Promise<void>;
83
+ get supports(): StorageSupports;
279
84
  /**
280
- * Deletes multiple traces and all their associated spans in a single batch operation.
281
- */
282
- batchDeleteTraces(args: {
283
- traceIds: string[];
284
- }): Promise<void>;
285
- /**
286
- * DATABASE INDEX MANAGEMENT
287
- * These methods delegate to the operations store for index management.
288
- * Storage adapters that support indexes should implement these in their operations class.
289
- */
290
- /**
291
- * Creates a database index on specified columns
292
- * @throws {MastraError} if not supported by the storage adapter
293
- */
294
- createIndex(options: CreateIndexOptions): Promise<void>;
295
- /**
296
- * Drops a database index by name
297
- * @throws {MastraError} if not supported by the storage adapter
298
- */
299
- dropIndex(indexName: string): Promise<void>;
300
- /**
301
- * Lists database indexes for a table or all tables
302
- * @throws {MastraError} if not supported by the storage adapter
303
- */
304
- listIndexes(tableName?: string): Promise<IndexInfo[]>;
305
- /**
306
- * Gets detailed statistics for a specific index
307
- * @throws {MastraError} if not supported by the storage adapter
308
- */
309
- describeIndex(indexName: string): Promise<StorageIndexStats>;
310
- /**
311
- * AGENTS STORAGE
312
- * These methods delegate to the agents store for agent CRUD operations.
313
- * This enables dynamic creation of agents via Mastra Studio.
314
- */
315
- /**
316
- * Retrieves an agent by its unique identifier.
317
- * @param id - The unique identifier of the agent
318
- * @returns The agent if found, null otherwise
319
- * @throws {MastraError} if not supported by the storage adapter
320
- */
321
- getAgentById({ id }: {
322
- id: string;
323
- }): Promise<StorageAgentType | null>;
324
- /**
325
- * Creates a new agent in storage.
326
- * @param agent - The agent data to create
327
- * @returns The created agent with timestamps
328
- * @throws {MastraError} if not supported by the storage adapter
329
- */
330
- createAgent({ agent }: {
331
- agent: StorageCreateAgentInput;
332
- }): Promise<StorageAgentType>;
333
- /**
334
- * Updates an existing agent in storage.
335
- * @param id - The unique identifier of the agent to update
336
- * @param updates - The fields to update
337
- * @returns The updated agent
338
- * @throws {MastraError} if not supported by the storage adapter
339
- */
340
- updateAgent(args: StorageUpdateAgentInput): Promise<StorageAgentType>;
341
- /**
342
- * Deletes an agent from storage.
343
- * @param id - The unique identifier of the agent to delete
344
- * @throws {MastraError} if not supported by the storage adapter
85
+ * Get a domain-specific storage interface.
86
+ *
87
+ * @param storeName - The name of the domain to access ('memory', 'workflows', 'scores', 'observability', 'agents')
88
+ * @returns The domain storage interface, or undefined if not available
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * const memory = await storage.getStore('memory');
93
+ * if (memory) {
94
+ * await memory.saveThread({ thread });
95
+ * }
96
+ * ```
345
97
  */
346
- deleteAgent({ id }: {
347
- id: string;
348
- }): Promise<void>;
98
+ getStore<K extends keyof StorageDomains>(storeName: K): Promise<StorageDomains[K] | undefined>;
349
99
  /**
350
- * Lists all agents with optional pagination.
351
- * @param args - Pagination and ordering options
352
- * @returns Paginated list of agents
353
- * @throws {MastraError} if not supported by the storage adapter
100
+ * Initialize all domain stores.
101
+ * This creates necessary tables, indexes, and performs any required migrations.
354
102
  */
355
- listAgents(args?: StorageListAgentsInput): Promise<StorageListAgentsOutput>;
103
+ init(): Promise<void>;
356
104
  }
357
105
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/storage/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,yBAAyB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ty(exports, "AGENTS_SCHEMA", {
8
+ enumerable: true,
9
+ get: function () { return chunkCBVHOGXX_cjs.AGENTS_SCHEMA; }
10
+ });
11
+ Object.defineProperty(exports, "OLD_SPAN_SCHEMA", {
12
+ enumerable: true,
13
+ get: function () { return chunkCBVHOGXX_cjs.OLD_SPAN_SCHEMA; }
14
+ });
15
+ Object.defineProperty(exports, "SCORERS_SCHEMA", {
16
+ enumerable: true,
17
+ get: function () { return chunkCBVHOGXX_cjs.SCORERS_SCHEMA; }
18
+ });
19
+ Object.defineProperty(exports, "SPAN_SCHEMA", {
20
+ enumerable: true,
21
+ get: function () { return chunkCBVHOGXX_cjs.SPAN_SCHEMA; }
22
+ });
23
+ Object.defineProperty(exports, "TABLE_AGENTS", {
24
+ enumerable: true,
25
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_AGENTS; }
26
+ });
27
+ Object.defineProperty(exports, "TABLE_MESSAGES", {
28
+ enumerable: true,
29
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_MESSAGES; }
30
+ });
31
+ Object.defineProperty(exports, "TABLE_RESOURCES", {
32
+ enumerable: true,
33
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_RESOURCES; }
34
+ });
35
+ Object.defineProperty(exports, "TABLE_SCHEMAS", {
36
+ enumerable: true,
37
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_SCHEMAS; }
38
+ });
39
+ Object.defineProperty(exports, "TABLE_SCORERS", {
40
+ enumerable: true,
41
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_SCORERS; }
42
+ });
43
+ Object.defineProperty(exports, "TABLE_SPANS", {
44
+ enumerable: true,
45
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_SPANS; }
46
+ });
47
+ Object.defineProperty(exports, "TABLE_THREADS", {
48
+ enumerable: true,
49
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_THREADS; }
50
+ });
51
+ Object.defineProperty(exports, "TABLE_TRACES", {
52
+ enumerable: true,
53
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_TRACES; }
54
+ });
55
+ Object.defineProperty(exports, "TABLE_WORKFLOW_SNAPSHOT", {
56
+ enumerable: true,
57
+ get: function () { return chunkCBVHOGXX_cjs.TABLE_WORKFLOW_SNAPSHOT; }
58
+ });
59
+ //# sourceMappingURL=constants.cjs.map
60
+ //# sourceMappingURL=constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"constants.cjs"}
@@ -9,7 +9,12 @@ export declare const TABLE_SPANS = "mastra_ai_spans";
9
9
  export declare const TABLE_AGENTS = "mastra_agents";
10
10
  export type TABLE_NAMES = typeof TABLE_WORKFLOW_SNAPSHOT | typeof TABLE_MESSAGES | typeof TABLE_THREADS | typeof TABLE_TRACES | typeof TABLE_RESOURCES | typeof TABLE_SCORERS | typeof TABLE_SPANS | typeof TABLE_AGENTS;
11
11
  export declare const SCORERS_SCHEMA: Record<string, StorageColumn>;
12
- export declare const SPAN_SCHEMA: Record<string, StorageColumn>;
12
+ export declare const SPAN_SCHEMA: Record<"error" | "runId" | "source" | "input" | "output" | "name" | "createdAt" | "updatedAt" | "metadata" | "entityType" | "traceId" | "spanId" | "resourceId" | "threadId" | "entityId" | "links" | "endedAt" | "startedAt" | "spanType" | "isEvent" | "parentSpanId" | "attributes" | "entityName" | "userId" | "organizationId" | "sessionId" | "requestId" | "environment" | "serviceName" | "scope" | "tags", StorageColumn>;
13
+ /**
14
+ * @deprecated Use SPAN_SCHEMA instead. This legacy schema is retained only for migration purposes.
15
+ * @internal
16
+ */
17
+ export declare const OLD_SPAN_SCHEMA: Record<string, StorageColumn>;
13
18
  export declare const AGENTS_SCHEMA: Record<string, StorageColumn>;
14
19
  export declare const TABLE_SCHEMAS: Record<TABLE_NAMES, Record<string, StorageColumn>>;
15
20
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/storage/constants.ts"],"names":[],"mappings":"AA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mB,CAAC;AAC9C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAE5C,MAAM,MAAM,WAAW,GACnB,OAAO,uBAAuB,GAC9B,OAAO,cAAc,GACrB,OAAO,aAAa,GACpB,OAAO,YAAY,GACnB,OAAO,eAAe,GACtB,OAAO,aAAa,GACpB,OAAO,WAAW,GAClB,OAAO,YAAY,CAAC;AAExB,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAoCxD,CAAC;AAEF,eAAO,MAAM,WAAW,oaAAuC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAmBzD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAiBvD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CA8D5E,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { AGENTS_SCHEMA, OLD_SPAN_SCHEMA, SCORERS_SCHEMA, SPAN_SCHEMA, TABLE_AGENTS, TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCHEMAS, TABLE_SCORERS, TABLE_SPANS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT } from '../chunk-YV43YEZ6.js';
2
+ //# sourceMappingURL=constants.js.map
3
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"constants.js"}
@@ -1,6 +1,6 @@
1
- import { MastraBase } from '../../../base.js';
2
1
  import type { StorageAgentType, StorageCreateAgentInput, StorageUpdateAgentInput, StorageListAgentsInput, StorageListAgentsOutput, StorageOrderBy, ThreadOrderBy, ThreadSortDirection } from '../../types.js';
3
- export declare abstract class AgentsStorage extends MastraBase {
2
+ import { StorageDomain } from '../base.js';
3
+ export declare abstract class AgentsStorage extends StorageDomain {
4
4
  constructor();
5
5
  /**
6
6
  * Retrieves an agent by its unique identifier.
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/agents/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,8BAAsB,aAAc,SAAQ,UAAU;;IAQpD;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAE/E;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,uBAAuB,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAE9F;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAE5F;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3D;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAEpF;;OAEG;IACH,SAAS,CAAC,YAAY,CACpB,OAAO,CAAC,EAAE,cAAc,EACxB,gBAAgB,GAAE,mBAA4B,GAC7C;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,SAAS,EAAE,mBAAmB,CAAA;KAAE;CAO5D"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/agents/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,8BAAsB,aAAc,SAAQ,aAAa;;IAQvD;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAE/E;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,uBAAuB,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAE9F;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAE5F;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3D;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAEpF;;OAEG;IACH,SAAS,CAAC,YAAY,CACpB,OAAO,CAAC,EAAE,cAAc,EACxB,gBAAgB,GAAE,mBAA4B,GAC7C;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,SAAS,EAAE,mBAAmB,CAAA;KAAE;CAO5D"}
@@ -1,11 +1,12 @@
1
1
  import type { StorageAgentType, StorageCreateAgentInput, StorageUpdateAgentInput, StorageListAgentsInput, StorageListAgentsOutput } from '../../types.js';
2
+ import type { InMemoryDB } from '../inmemory-db.js';
2
3
  import { AgentsStorage } from './base.js';
3
- export type InMemoryAgents = Map<string, StorageAgentType>;
4
4
  export declare class InMemoryAgentsStorage extends AgentsStorage {
5
- private collection;
6
- constructor({ collection }: {
7
- collection: InMemoryAgents;
5
+ private db;
6
+ constructor({ db }: {
7
+ db: InMemoryDB;
8
8
  });
9
+ dangerouslyClearAll(): Promise<void>;
9
10
  getAgentById({ id }: {
10
11
  id: string;
11
12
  }): Promise<StorageAgentType | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"inmemory.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/agents/inmemory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EAGxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE3D,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,OAAO,CAAC,UAAU,CAAiB;gBAEvB,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,cAAc,CAAA;KAAE;IAKpD,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAgBtE,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,uBAAuB,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkBrF,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkCnF,WAAW,CAAC,EAAE,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AC,UAAU;CAYnB"}
@@ -0,0 +1,20 @@
1
+ import { MastraBase } from '../../base.js';
2
+ /**
3
+ * Base class for all storage domains.
4
+ * Provides common interface for initialization and data clearing.
5
+ */
6
+ export declare abstract class StorageDomain extends MastraBase {
7
+ /**
8
+ * Initialize the storage domain.
9
+ * This should create any necessary tables/collections.
10
+ * Default implementation is a no-op - override in adapters that need initialization.
11
+ */
12
+ init(): Promise<void>;
13
+ /**
14
+ * Clears all data from this storage domain.
15
+ * This is a destructive operation - use with caution.
16
+ * Primarily used for testing.
17
+ */
18
+ abstract dangerouslyClearAll(): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;;GAGG;AACH,8BAAsB,aAAc,SAAQ,UAAU;IACpD;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;CAC9C"}
@@ -1,7 +1,10 @@
1
+ export * from './base.js';
1
2
  export * from './agents/index.js';
2
3
  export * from './scores/index.js';
3
4
  export * from './observability/index.js';
4
5
  export * from './operations/index.js';
5
6
  export * from './workflows/index.js';
6
7
  export * from './memory/index.js';
8
+ export * from './inmemory-db.js';
9
+ export * from './shared.js';
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,57 @@
1
+ import type { StorageThreadType } from '../../memory/types.js';
2
+ import type { StorageAgentType, StorageMessageType, StorageResourceType, StorageWorkflowRun } from '../types.js';
3
+ import type { TraceEntry } from './observability/index.js';
4
+ /**
5
+ * InMemoryDB is a thin database layer for in-memory storage.
6
+ * It holds all the Maps that store data, similar to how a real database
7
+ * connection (pg-promise client, libsql client) is shared across domains.
8
+ *
9
+ * Each domain receives a reference to this db and operates on the relevant Maps.
10
+ */
11
+ export declare class InMemoryDB {
12
+ readonly threads: Map<string, StorageThreadType>;
13
+ readonly messages: Map<string, StorageMessageType>;
14
+ readonly resources: Map<string, StorageResourceType>;
15
+ readonly workflows: Map<string, StorageWorkflowRun>;
16
+ readonly scores: Map<string, {
17
+ runId: string;
18
+ source: "LIVE" | "TEST";
19
+ id: string;
20
+ createdAt: Date;
21
+ updatedAt: Date | null;
22
+ scorer: Record<string, unknown>;
23
+ entity: Record<string, unknown>;
24
+ score: number;
25
+ scorerId: string;
26
+ entityId: string;
27
+ input?: unknown;
28
+ output?: unknown;
29
+ additionalContext?: Record<string, unknown> | undefined;
30
+ requestContext?: Record<string, unknown> | undefined;
31
+ metadata?: Record<string, unknown> | undefined;
32
+ entityType?: string | undefined;
33
+ structuredOutput?: boolean | undefined;
34
+ traceId?: string | undefined;
35
+ spanId?: string | undefined;
36
+ resourceId?: string | undefined;
37
+ threadId?: string | undefined;
38
+ extractStepResult?: Record<string, unknown> | undefined;
39
+ extractPrompt?: string | undefined;
40
+ analyzeStepResult?: Record<string, unknown> | undefined;
41
+ analyzePrompt?: string | undefined;
42
+ reason?: string | undefined;
43
+ reasonPrompt?: string | undefined;
44
+ preprocessStepResult?: Record<string, unknown> | undefined;
45
+ preprocessPrompt?: string | undefined;
46
+ generateScorePrompt?: string | undefined;
47
+ generateReasonPrompt?: string | undefined;
48
+ }>;
49
+ readonly traces: Map<string, TraceEntry>;
50
+ readonly agents: Map<string, StorageAgentType>;
51
+ /**
52
+ * Clears all data from all collections.
53
+ * Useful for testing.
54
+ */
55
+ clear(): void;
56
+ }
57
+ //# sourceMappingURL=inmemory-db.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inmemory-db.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/inmemory-db.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;;GAMG;AACH,qBAAa,UAAU;IACrB,QAAQ,CAAC,OAAO,iCAAwC;IACxD,QAAQ,CAAC,QAAQ,kCAAyC;IAC1D,QAAQ,CAAC,SAAS,mCAA0C;IAC5D,QAAQ,CAAC,SAAS,kCAAyC;IAC3D,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAmC;IAClD,QAAQ,CAAC,MAAM,0BAAiC;IAChD,QAAQ,CAAC,MAAM,gCAAuC;IAEtD;;;OAGG;IACH,KAAK,IAAI,IAAI;CASd"}
@@ -1,8 +1,8 @@
1
1
  import type { MastraMessageContentV2 } from '../../../agent/index.js';
2
- import { MastraBase } from '../../../base.js';
3
2
  import type { MastraDBMessage, StorageThreadType } from '../../../memory/types.js';
4
3
  import type { StorageResourceType, ThreadOrderBy, ThreadSortDirection, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput, StorageOrderBy } from '../../types.js';
5
- export declare abstract class MemoryStorage extends MastraBase {
4
+ import { StorageDomain } from '../base.js';
5
+ export declare abstract class MemoryStorage extends StorageDomain {
6
6
  constructor();
7
7
  abstract getThreadById({ threadId }: {
8
8
  threadId: string;