@mastra/server 0.0.0-support-d1-client-20250701191943 → 0.0.0-suspendRuntimeContextTypeFix-20250930142630

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 (326) hide show
  1. package/CHANGELOG.md +3812 -0
  2. package/LICENSE.md +11 -42
  3. package/README.md +0 -5
  4. package/dist/{chunk-H5PTF3Y4.js → chunk-4QCXUEAT.js} +11 -2
  5. package/dist/chunk-4QCXUEAT.js.map +1 -0
  6. package/dist/chunk-4RRMWXQ2.js +3522 -0
  7. package/dist/chunk-4RRMWXQ2.js.map +1 -0
  8. package/dist/chunk-52UP7DFT.cjs +130 -0
  9. package/dist/chunk-52UP7DFT.cjs.map +1 -0
  10. package/dist/chunk-5DP5XZH6.cjs +928 -0
  11. package/dist/chunk-5DP5XZH6.cjs.map +1 -0
  12. package/dist/chunk-66YYHFGF.js +761 -0
  13. package/dist/chunk-66YYHFGF.js.map +1 -0
  14. package/dist/chunk-6GMFZ5LK.js +2774 -0
  15. package/dist/chunk-6GMFZ5LK.js.map +1 -0
  16. package/dist/{chunk-GHC4YV6R.js → chunk-6IJWRJZE.js} +109 -136
  17. package/dist/chunk-6IJWRJZE.js.map +1 -0
  18. package/dist/chunk-743UIDHI.cjs +2013 -0
  19. package/dist/chunk-743UIDHI.cjs.map +1 -0
  20. package/dist/chunk-7ESQBAXS.cjs +18023 -0
  21. package/dist/chunk-7ESQBAXS.cjs.map +1 -0
  22. package/dist/{chunk-OCWPVYNI.cjs → chunk-7NADHFD2.cjs} +3 -0
  23. package/dist/chunk-7NADHFD2.cjs.map +1 -0
  24. package/dist/{chunk-BOXE6WSV.js → chunk-A3AL7EWJ.js} +5 -3
  25. package/dist/chunk-A3AL7EWJ.js.map +1 -0
  26. package/dist/chunk-AK2FXLLB.cjs +849 -0
  27. package/dist/chunk-AK2FXLLB.cjs.map +1 -0
  28. package/dist/chunk-BKCWZLEL.cjs +197 -0
  29. package/dist/chunk-BKCWZLEL.cjs.map +1 -0
  30. package/dist/chunk-BOVFMBXY.js +607 -0
  31. package/dist/chunk-BOVFMBXY.js.map +1 -0
  32. package/dist/{chunk-QDOJJCS4.js → chunk-CY4TP3FK.js} +6 -2
  33. package/dist/chunk-CY4TP3FK.js.map +1 -0
  34. package/dist/chunk-EMMSS5I5.cjs +37 -0
  35. package/dist/chunk-EMMSS5I5.cjs.map +1 -0
  36. package/dist/chunk-EMNGA4R4.js +845 -0
  37. package/dist/chunk-EMNGA4R4.js.map +1 -0
  38. package/dist/chunk-FALVL2VV.cjs +3525 -0
  39. package/dist/chunk-FALVL2VV.cjs.map +1 -0
  40. package/dist/chunk-FQNT7PI4.js +937 -0
  41. package/dist/chunk-FQNT7PI4.js.map +1 -0
  42. package/dist/chunk-G3PMV62Z.js +33 -0
  43. package/dist/chunk-G3PMV62Z.js.map +1 -0
  44. package/dist/chunk-G4PUALCE.cjs +28 -0
  45. package/dist/chunk-G4PUALCE.cjs.map +1 -0
  46. package/dist/chunk-GU4EWMZB.cjs +769 -0
  47. package/dist/chunk-GU4EWMZB.cjs.map +1 -0
  48. package/dist/chunk-HJQKWRKQ.cjs +764 -0
  49. package/dist/chunk-HJQKWRKQ.cjs.map +1 -0
  50. package/dist/{chunk-LI436ITD.cjs → chunk-HVBBFCDH.cjs} +1041 -762
  51. package/dist/chunk-HVBBFCDH.cjs.map +1 -0
  52. package/dist/chunk-HZJRQ5L3.cjs +1411 -0
  53. package/dist/chunk-HZJRQ5L3.cjs.map +1 -0
  54. package/dist/chunk-IGFMAZZ5.cjs +1150 -0
  55. package/dist/chunk-IGFMAZZ5.cjs.map +1 -0
  56. package/dist/chunk-IOQGI4ML.js +931 -0
  57. package/dist/chunk-IOQGI4ML.js.map +1 -0
  58. package/dist/chunk-JQ74G5IO.js +17987 -0
  59. package/dist/chunk-JQ74G5IO.js.map +1 -0
  60. package/dist/{chunk-G37NVEDX.js → chunk-JRDEOHAJ.js} +23 -13
  61. package/dist/chunk-JRDEOHAJ.js.map +1 -0
  62. package/dist/chunk-JSMP6GVP.cjs +595 -0
  63. package/dist/chunk-JSMP6GVP.cjs.map +1 -0
  64. package/dist/{chunk-DFJUGWNU.js → chunk-KM7EJKXV.js} +50 -12
  65. package/dist/chunk-KM7EJKXV.js.map +1 -0
  66. package/dist/{chunk-TGZIR6AK.cjs → chunk-KNGXRN26.cjs} +48 -45
  67. package/dist/chunk-KNGXRN26.cjs.map +1 -0
  68. package/dist/{chunk-BP24Z4WG.js → chunk-KV6VHX4V.js} +24 -5
  69. package/dist/chunk-KV6VHX4V.js.map +1 -0
  70. package/dist/chunk-LF2ZLOFP.js +767 -0
  71. package/dist/chunk-LF2ZLOFP.js.map +1 -0
  72. package/dist/chunk-LJFAAEU7.cjs +167 -0
  73. package/dist/chunk-LJFAAEU7.cjs.map +1 -0
  74. package/dist/chunk-LYPU75T6.js +1147 -0
  75. package/dist/chunk-LYPU75T6.js.map +1 -0
  76. package/dist/{chunk-NYN7KFXL.js → chunk-MMROOK5J.js} +3 -0
  77. package/dist/chunk-MMROOK5J.js.map +1 -0
  78. package/dist/{chunk-MEGCYGBU.js → chunk-N7F33WAD.js} +1013 -762
  79. package/dist/chunk-N7F33WAD.js.map +1 -0
  80. package/dist/chunk-NG5IVLEZ.js +1012 -0
  81. package/dist/chunk-NG5IVLEZ.js.map +1 -0
  82. package/dist/chunk-NLWACBE7.cjs +128 -0
  83. package/dist/chunk-NLWACBE7.cjs.map +1 -0
  84. package/dist/chunk-OGW6HHVI.js +1408 -0
  85. package/dist/chunk-OGW6HHVI.js.map +1 -0
  86. package/dist/{chunk-SDPGVWQJ.cjs → chunk-OPI3FZYH.cjs} +110 -137
  87. package/dist/chunk-OPI3FZYH.cjs.map +1 -0
  88. package/dist/chunk-OZLRIVC4.cjs +588 -0
  89. package/dist/chunk-OZLRIVC4.cjs.map +1 -0
  90. package/dist/chunk-P7CIEIJ3.js +925 -0
  91. package/dist/chunk-P7CIEIJ3.js.map +1 -0
  92. package/dist/chunk-P7RBMCBE.cjs +934 -0
  93. package/dist/chunk-P7RBMCBE.cjs.map +1 -0
  94. package/dist/chunk-PPYGWINI.cjs +2777 -0
  95. package/dist/chunk-PPYGWINI.cjs.map +1 -0
  96. package/dist/{chunk-ULFULEW4.cjs → chunk-PWTXZZTR.cjs} +28 -8
  97. package/dist/chunk-PWTXZZTR.cjs.map +1 -0
  98. package/dist/chunk-RCHEPTZZ.js +2006 -0
  99. package/dist/chunk-RCHEPTZZ.js.map +1 -0
  100. package/dist/chunk-RE4RPXT2.cjs +18 -0
  101. package/dist/chunk-RE4RPXT2.cjs.map +1 -0
  102. package/dist/chunk-SIGXR3JT.cjs +1043 -0
  103. package/dist/chunk-SIGXR3JT.cjs.map +1 -0
  104. package/dist/{chunk-CNVDCLSY.cjs → chunk-SPLSYTYW.cjs} +11 -9
  105. package/dist/chunk-SPLSYTYW.cjs.map +1 -0
  106. package/dist/chunk-SQY4T6EJ.js +571 -0
  107. package/dist/chunk-SQY4T6EJ.js.map +1 -0
  108. package/dist/chunk-SXENNNR7.cjs +625 -0
  109. package/dist/chunk-SXENNNR7.cjs.map +1 -0
  110. package/dist/{chunk-TVBPFPTN.cjs → chunk-T3TIA3O6.cjs} +20 -18
  111. package/dist/chunk-T3TIA3O6.cjs.map +1 -0
  112. package/dist/{chunk-7GQJAMTA.js → chunk-TTHEEIZ3.js} +13 -10
  113. package/dist/chunk-TTHEEIZ3.js.map +1 -0
  114. package/dist/chunk-TVSIG4JE.cjs +940 -0
  115. package/dist/chunk-TVSIG4JE.cjs.map +1 -0
  116. package/dist/chunk-VY4ENABS.cjs +135 -0
  117. package/dist/chunk-VY4ENABS.cjs.map +1 -0
  118. package/dist/{chunk-FVMGZKFD.js → chunk-WHN4VX55.js} +5 -3
  119. package/dist/chunk-WHN4VX55.js.map +1 -0
  120. package/dist/chunk-WUJLVNLU.js +124 -0
  121. package/dist/chunk-WUJLVNLU.js.map +1 -0
  122. package/dist/chunk-XJOYGRTN.js +189 -0
  123. package/dist/chunk-XJOYGRTN.js.map +1 -0
  124. package/dist/chunk-YWOK4F5A.js +131 -0
  125. package/dist/chunk-YWOK4F5A.js.map +1 -0
  126. package/dist/{chunk-Z5TH5F35.js → chunk-ZAYTLC6C.js} +188 -80
  127. package/dist/chunk-ZAYTLC6C.js.map +1 -0
  128. package/dist/dist-26HWEQY6.js +3 -0
  129. package/dist/dist-26HWEQY6.js.map +1 -0
  130. package/dist/dist-3A5DXB37.cjs +20 -0
  131. package/dist/dist-3A5DXB37.cjs.map +1 -0
  132. package/dist/dist-3SJKQJGY.cjs +16 -0
  133. package/dist/dist-3SJKQJGY.cjs.map +1 -0
  134. package/dist/dist-4ZQSPE5K.js +3 -0
  135. package/dist/dist-4ZQSPE5K.js.map +1 -0
  136. package/dist/dist-5W5QNRTD.js +3 -0
  137. package/dist/dist-5W5QNRTD.js.map +1 -0
  138. package/dist/dist-653SRMPL.js +3 -0
  139. package/dist/dist-653SRMPL.js.map +1 -0
  140. package/dist/dist-6U6EFC5C.cjs +16 -0
  141. package/dist/dist-6U6EFC5C.cjs.map +1 -0
  142. package/dist/dist-7IHNNYMF.cjs +16 -0
  143. package/dist/dist-7IHNNYMF.cjs.map +1 -0
  144. package/dist/dist-B5IPRF6W.js +3 -0
  145. package/dist/dist-B5IPRF6W.js.map +1 -0
  146. package/dist/dist-EOMYFT4Y.cjs +16 -0
  147. package/dist/dist-EOMYFT4Y.cjs.map +1 -0
  148. package/dist/dist-EZZMMMNT.cjs +16 -0
  149. package/dist/dist-EZZMMMNT.cjs.map +1 -0
  150. package/dist/dist-F2ET4MNO.cjs +16 -0
  151. package/dist/dist-F2ET4MNO.cjs.map +1 -0
  152. package/dist/dist-H64VX6DE.js +3 -0
  153. package/dist/dist-H64VX6DE.js.map +1 -0
  154. package/dist/dist-HY7RMLJQ.cjs +16 -0
  155. package/dist/dist-HY7RMLJQ.cjs.map +1 -0
  156. package/dist/dist-M6S4P3FJ.js +3 -0
  157. package/dist/dist-M6S4P3FJ.js.map +1 -0
  158. package/dist/dist-NR7QSCQT.js +3 -0
  159. package/dist/dist-NR7QSCQT.js.map +1 -0
  160. package/dist/dist-QLFMCMCX.js +3 -0
  161. package/dist/dist-QLFMCMCX.js.map +1 -0
  162. package/dist/dist-UY46BFRP.js +3 -0
  163. package/dist/dist-UY46BFRP.js.map +1 -0
  164. package/dist/dist-WCQDRTIV.cjs +16 -0
  165. package/dist/dist-WCQDRTIV.cjs.map +1 -0
  166. package/dist/dist-WKYB3LTJ.cjs +16 -0
  167. package/dist/dist-WKYB3LTJ.cjs.map +1 -0
  168. package/dist/index.cjs +6 -0
  169. package/dist/index.cjs.map +1 -0
  170. package/dist/index.d.ts +1 -0
  171. package/dist/index.d.ts.map +1 -0
  172. package/dist/index.js +5 -0
  173. package/dist/index.js.map +1 -0
  174. package/dist/server/a2a/protocol.d.ts +8 -0
  175. package/dist/server/a2a/protocol.d.ts.map +1 -0
  176. package/dist/server/a2a/store.cjs +25 -0
  177. package/dist/server/a2a/store.cjs.map +1 -0
  178. package/dist/server/a2a/store.d.ts +14 -0
  179. package/dist/server/a2a/store.d.ts.map +1 -0
  180. package/dist/server/a2a/store.js +23 -0
  181. package/dist/server/a2a/store.js.map +1 -0
  182. package/dist/server/a2a/tasks.d.ts +20 -0
  183. package/dist/server/a2a/tasks.d.ts.map +1 -0
  184. package/dist/server/handlers/a2a.cjs +13 -11
  185. package/dist/server/handlers/a2a.cjs.map +1 -0
  186. package/dist/server/handlers/a2a.d.ts +68 -6
  187. package/dist/server/handlers/a2a.d.ts.map +1 -0
  188. package/dist/server/handlers/a2a.js +3 -1
  189. package/dist/server/handlers/a2a.js.map +1 -0
  190. package/dist/server/handlers/agent-builder.cjs +68 -0
  191. package/dist/server/handlers/agent-builder.cjs.map +1 -0
  192. package/dist/server/handlers/agent-builder.d.ts +92 -0
  193. package/dist/server/handlers/agent-builder.d.ts.map +1 -0
  194. package/dist/server/handlers/agent-builder.js +3 -0
  195. package/dist/server/handlers/agent-builder.js.map +1 -0
  196. package/dist/server/handlers/agents.cjs +49 -7
  197. package/dist/server/handlers/agents.cjs.map +1 -0
  198. package/dist/server/handlers/agents.d.ts +185 -6
  199. package/dist/server/handlers/agents.d.ts.map +1 -0
  200. package/dist/server/handlers/agents.js +3 -1
  201. package/dist/server/handlers/agents.js.map +1 -0
  202. package/dist/server/handlers/error.cjs +4 -2
  203. package/dist/server/handlers/error.cjs.map +1 -0
  204. package/dist/server/handlers/error.d.ts +2 -1
  205. package/dist/server/handlers/error.d.ts.map +1 -0
  206. package/dist/server/handlers/error.js +3 -1
  207. package/dist/server/handlers/error.js.map +1 -0
  208. package/dist/server/handlers/legacyWorkflows.cjs +13 -11
  209. package/dist/server/handlers/legacyWorkflows.cjs.map +1 -0
  210. package/dist/server/handlers/legacyWorkflows.d.ts +59 -10
  211. package/dist/server/handlers/legacyWorkflows.d.ts.map +1 -0
  212. package/dist/server/handlers/legacyWorkflows.js +3 -1
  213. package/dist/server/handlers/legacyWorkflows.js.map +1 -0
  214. package/dist/server/handlers/logs.cjs +6 -4
  215. package/dist/server/handlers/logs.cjs.map +1 -0
  216. package/dist/server/handlers/logs.d.ts +34 -3
  217. package/dist/server/handlers/logs.d.ts.map +1 -0
  218. package/dist/server/handlers/logs.js +3 -1
  219. package/dist/server/handlers/logs.js.map +1 -0
  220. package/dist/server/handlers/memory.cjs +39 -9
  221. package/dist/server/handlers/memory.cjs.map +1 -0
  222. package/dist/server/handlers/memory.d.ts +118 -8
  223. package/dist/server/handlers/memory.d.ts.map +1 -0
  224. package/dist/server/handlers/memory.js +3 -1
  225. package/dist/server/handlers/memory.js.map +1 -0
  226. package/dist/server/handlers/observability.cjs +24 -0
  227. package/dist/server/handlers/observability.cjs.map +1 -0
  228. package/dist/server/handlers/observability.d.ts +49 -0
  229. package/dist/server/handlers/observability.d.ts.map +1 -0
  230. package/dist/server/handlers/observability.js +3 -0
  231. package/dist/server/handlers/observability.js.map +1 -0
  232. package/dist/server/handlers/scores.cjs +32 -0
  233. package/dist/server/handlers/scores.cjs.map +1 -0
  234. package/dist/server/handlers/scores.d.ts +251 -0
  235. package/dist/server/handlers/scores.d.ts.map +1 -0
  236. package/dist/server/handlers/scores.js +3 -0
  237. package/dist/server/handlers/scores.js.map +1 -0
  238. package/dist/server/handlers/telemetry.cjs +9 -3
  239. package/dist/server/handlers/telemetry.cjs.map +1 -0
  240. package/dist/server/handlers/telemetry.d.ts +33 -2
  241. package/dist/server/handlers/telemetry.d.ts.map +1 -0
  242. package/dist/server/handlers/telemetry.js +3 -1
  243. package/dist/server/handlers/telemetry.js.map +1 -0
  244. package/dist/server/handlers/tools.cjs +11 -5
  245. package/dist/server/handlers/tools.cjs.map +1 -0
  246. package/dist/server/handlers/tools.d.ts +25 -4
  247. package/dist/server/handlers/tools.d.ts.map +1 -0
  248. package/dist/server/handlers/tools.js +3 -1
  249. package/dist/server/handlers/tools.js.map +1 -0
  250. package/dist/server/handlers/utils.cjs +8 -2
  251. package/dist/server/handlers/utils.cjs.map +1 -0
  252. package/dist/server/handlers/utils.d.ts +8 -1
  253. package/dist/server/handlers/utils.d.ts.map +1 -0
  254. package/dist/server/handlers/utils.js +3 -1
  255. package/dist/server/handlers/utils.js.map +1 -0
  256. package/dist/server/handlers/vNextNetwork.cjs +26 -24
  257. package/dist/server/handlers/vNextNetwork.cjs.map +1 -0
  258. package/dist/server/handlers/vNextNetwork.d.ts +246 -6
  259. package/dist/server/handlers/vNextNetwork.d.ts.map +1 -0
  260. package/dist/server/handlers/vNextNetwork.js +11 -9
  261. package/dist/server/handlers/vNextNetwork.js.map +1 -0
  262. package/dist/server/handlers/vector.cjs +9 -7
  263. package/dist/server/handlers/vector.cjs.map +1 -0
  264. package/dist/server/handlers/vector.d.ts +51 -6
  265. package/dist/server/handlers/vector.d.ts.map +1 -0
  266. package/dist/server/handlers/vector.js +3 -1
  267. package/dist/server/handlers/vector.js.map +1 -0
  268. package/dist/server/handlers/voice.cjs +7 -5
  269. package/dist/server/handlers/voice.cjs.map +1 -0
  270. package/dist/server/handlers/voice.d.ts +41 -4
  271. package/dist/server/handlers/voice.d.ts.map +1 -0
  272. package/dist/server/handlers/voice.js +3 -1
  273. package/dist/server/handlers/voice.js.map +1 -0
  274. package/dist/server/handlers/workflows.cjs +32 -14
  275. package/dist/server/handlers/workflows.cjs.map +1 -0
  276. package/dist/server/handlers/workflows.d.ts +87 -13
  277. package/dist/server/handlers/workflows.d.ts.map +1 -0
  278. package/dist/server/handlers/workflows.js +3 -1
  279. package/dist/server/handlers/workflows.js.map +1 -0
  280. package/dist/server/handlers.cjs +44 -32
  281. package/dist/server/handlers.cjs.map +1 -0
  282. package/dist/server/handlers.d.ts +14 -11
  283. package/dist/server/handlers.d.ts.map +1 -0
  284. package/dist/server/handlers.js +15 -11
  285. package/dist/server/handlers.js.map +1 -0
  286. package/dist/server/http-exception.d.ts +87 -0
  287. package/dist/server/http-exception.d.ts.map +1 -0
  288. package/dist/server/types.d.ts +10 -0
  289. package/dist/server/types.d.ts.map +1 -0
  290. package/dist/server/utils.d.ts +44 -0
  291. package/dist/server/utils.d.ts.map +1 -0
  292. package/package.json +46 -15
  293. package/dist/_tsup-dts-rollup.d.cts +0 -1068
  294. package/dist/_tsup-dts-rollup.d.ts +0 -1068
  295. package/dist/chunk-3DKDT264.cjs +0 -251
  296. package/dist/chunk-4QBIUKVY.js +0 -270
  297. package/dist/chunk-57CJTIPW.cjs +0 -18
  298. package/dist/chunk-7524QH7G.cjs +0 -483
  299. package/dist/chunk-75ZPJI57.cjs +0 -9
  300. package/dist/chunk-BWHGBV3K.cjs +0 -278
  301. package/dist/chunk-DPRB3R7Y.cjs +0 -148
  302. package/dist/chunk-FGGMQCPP.cjs +0 -128
  303. package/dist/chunk-L3N7ST2Z.cjs +0 -118
  304. package/dist/chunk-LTJNMM2Y.js +0 -241
  305. package/dist/chunk-MLKGABMK.js +0 -7
  306. package/dist/chunk-MTR2B27E.cjs +0 -14
  307. package/dist/chunk-VMXLEF54.js +0 -142
  308. package/dist/index.d.cts +0 -1
  309. package/dist/server/handlers/a2a.d.cts +0 -6
  310. package/dist/server/handlers/agents.d.cts +0 -6
  311. package/dist/server/handlers/error.d.cts +0 -1
  312. package/dist/server/handlers/legacyWorkflows.d.cts +0 -10
  313. package/dist/server/handlers/logs.d.cts +0 -3
  314. package/dist/server/handlers/memory.d.cts +0 -8
  315. package/dist/server/handlers/network.cjs +0 -22
  316. package/dist/server/handlers/network.d.cts +0 -4
  317. package/dist/server/handlers/network.d.ts +0 -4
  318. package/dist/server/handlers/network.js +0 -1
  319. package/dist/server/handlers/telemetry.d.cts +0 -2
  320. package/dist/server/handlers/tools.d.cts +0 -4
  321. package/dist/server/handlers/utils.d.cts +0 -1
  322. package/dist/server/handlers/vNextNetwork.d.cts +0 -6
  323. package/dist/server/handlers/vector.d.cts +0 -6
  324. package/dist/server/handlers/voice.d.cts +0 -4
  325. package/dist/server/handlers/workflows.d.cts +0 -13
  326. package/dist/server/handlers.d.cts +0 -11
@@ -1,1068 +0,0 @@
1
- import type { Agent } from '@mastra/core/agent';
2
- import type { AgentCard } from '@mastra/core/a2a';
3
- import type { AgentNetwork } from '@mastra/core/network';
4
- import type { Artifact } from '@mastra/core/a2a';
5
- import type { BaseLogMessage } from '@mastra/core/logger';
6
- import { CoreMessage } from 'ai';
7
- import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
8
- import { DefaultEngineType } from '@mastra/core/workflows';
9
- import { EvalRow } from '@mastra/core/storage';
10
- import { GenerateObjectResult } from 'ai';
11
- import { GenerateTextResult } from 'ai';
12
- import type { IMastraLogger } from '@mastra/core/logger';
13
- import type { JSONRPCError } from '@mastra/core/a2a';
14
- import { JSONRPCResponse } from '@mastra/core/a2a';
15
- import { LegacyStep } from '@mastra/core/workflows/legacy';
16
- import type { LegacyWorkflow } from '@mastra/core/workflows/legacy';
17
- import { LegacyWorkflowRunResult } from '@mastra/core/workflows/legacy';
18
- import type { LegacyWorkflowRuns } from '@mastra/core/storage';
19
- import type { LogLevel } from '@mastra/core/logger';
20
- import type { Mastra } from '@mastra/core/mastra';
21
- import type { MastraError } from '@mastra/core/error';
22
- import type { MastraMemory } from '@mastra/core/memory';
23
- import { MastraMessageV1 } from '@mastra/core/memory';
24
- import type { Message } from '@mastra/core/a2a';
25
- import type { QueryResult } from '@mastra/core/vector';
26
- import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
27
- import { ReadableStream as ReadableStream_3 } from 'stream/web';
28
- import { RuntimeContext } from '@mastra/core/runtime-context';
29
- import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
30
- import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
31
- import { Step } from '@mastra/core/workflows';
32
- import { StepExecutionContext } from '@mastra/core/workflows/legacy';
33
- import { StepGraph } from '@mastra/core/workflows/legacy';
34
- import { StepResult } from '@mastra/core/workflows';
35
- import { StorageThreadType } from '@mastra/core/memory';
36
- import { StreamEvent } from '@mastra/core/workflows';
37
- import { Task } from '@mastra/core/a2a';
38
- import { TaskAndHistory } from '@mastra/core/a2a';
39
- import type { TaskContext } from '@mastra/core/a2a';
40
- import type { TaskIdParams } from '@mastra/core/a2a';
41
- import type { TaskQueryParams } from '@mastra/core/a2a';
42
- import type { TaskSendParams } from '@mastra/core/a2a';
43
- import type { TaskStatus } from '@mastra/core/a2a';
44
- import type { ToolAction } from '@mastra/core/tools';
45
- import { UIMessage } from 'ai';
46
- import type { VercelTool } from '@mastra/core/tools';
47
- import type { WatchEvent } from '@mastra/core/workflows';
48
- import type { Workflow } from '@mastra/core/workflows';
49
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
50
- import { WorkflowResult } from '@mastra/core/workflows';
51
- import type { WorkflowRuns } from '@mastra/core/storage';
52
- import { ZodBoolean } from 'zod';
53
- import { ZodEnum } from 'zod';
54
- import { ZodNumber } from 'zod';
55
- import { ZodObject } from 'zod';
56
- import { ZodOptional } from 'zod';
57
- import { ZodString } from 'zod';
58
- import { ZodType } from 'zod';
59
- import { ZodTypeAny } from 'zod';
60
- import { ZodTypeDef } from 'zod';
61
-
62
- export declare namespace a2a {
63
- export {
64
- getAgentCardByIdHandler,
65
- handleTaskSend,
66
- handleTaskGet,
67
- handleTaskSendSubscribe,
68
- handleTaskCancel,
69
- getAgentExecutionHandler
70
- }
71
- }
72
-
73
- export declare namespace agents {
74
- export {
75
- getAgentsHandler,
76
- getAgentByIdHandler,
77
- getEvalsByAgentIdHandler,
78
- getLiveEvalsByAgentIdHandler,
79
- generateHandler,
80
- streamGenerateHandler
81
- }
82
- }
83
-
84
- export declare interface ApiError extends MastraError {
85
- message: string;
86
- status?: number;
87
- }
88
-
89
- export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
90
-
91
- export declare function cancelWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
92
- message: string;
93
- }>;
94
-
95
- declare type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
96
-
97
- export declare interface Context {
98
- mastra: Mastra;
99
- }
100
-
101
- export declare function convertToCoreMessage(message: Message): CoreMessage_2;
102
-
103
- export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
104
-
105
- export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
106
- index: CreateIndexRequest;
107
- }): Promise<{
108
- success: boolean;
109
- }>;
110
-
111
- declare interface CreateIndexRequest {
112
- indexName: string;
113
- dimension: number;
114
- metric?: 'cosine' | 'euclidean' | 'dotproduct';
115
- }
116
-
117
- export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
118
- runId: string;
119
- }>;
120
-
121
- export declare function createSuccessResponse<T>(id: number | string | null, result: T): JSONRPCResponse<T>;
122
-
123
- export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
124
- task: Task;
125
- userMessage: Message;
126
- history: Message[];
127
- activeCancellations: Set<string>;
128
- }): TaskContext;
129
-
130
- export declare function createThreadHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
131
- body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
132
- resourceId?: string;
133
- };
134
- }): Promise<StorageThreadType>;
135
-
136
- export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
137
- runId: string;
138
- }>;
139
-
140
- export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
141
- indexName?: string;
142
- }): Promise<{
143
- success: boolean;
144
- }>;
145
-
146
- export declare function deleteThreadHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<{
147
- result: string;
148
- }>;
149
-
150
- declare type DeprecatedStatusCode = 305 | 306;
151
-
152
- export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
153
- indexName?: string;
154
- }): Promise<{
155
- dimension: number;
156
- count: number;
157
- metric: string | undefined;
158
- }>;
159
-
160
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
161
- agentId?: string;
162
- data: any;
163
- runtimeContext: RuntimeContext_2;
164
- }): Promise<any>;
165
-
166
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
167
- data?: unknown;
168
- runtimeContext: RuntimeContext_2;
169
- }) => Promise<any>;
170
-
171
- export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
172
- runtimeContext: RuntimeContext;
173
- agentId: string;
174
- body: GetBody<'generate'> & {
175
- resourceid?: string;
176
- runtimeContext?: Record<string, unknown>;
177
- };
178
- abortSignal?: AbortSignal;
179
- }): Promise<GenerateTextResult<any, unknown>>;
180
-
181
- export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
182
- runtimeContext: RuntimeContext;
183
- body: {
184
- messages?: Parameters<AgentNetwork['generate']>[0];
185
- } & Parameters<AgentNetwork['generate']>[1];
186
- }): Promise<GenerateObjectResult<any>>;
187
-
188
- /**
189
- * Generate speech from text
190
- */
191
- export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
192
- body?: {
193
- text?: string;
194
- speakerId?: string;
195
- };
196
- }): Promise<NodeJS.ReadableStream>;
197
-
198
- export declare function generateVNextNetworkHandler({ mastra, runtimeContext, networkId, body, }: NetworkContext_2 & {
199
- runtimeContext: RuntimeContext;
200
- body: {
201
- message: string;
202
- threadId?: string;
203
- resourceId?: string;
204
- };
205
- }): Promise<{
206
- task: string;
207
- result: string;
208
- resourceId: string;
209
- resourceType: "none" | "tool" | "workflow" | "agent";
210
- }>;
211
-
212
- export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, isPlayground, }: Context & {
213
- isPlayground?: boolean;
214
- runtimeContext: RuntimeContext;
215
- agentId: string;
216
- }): Promise<{
217
- name: any;
218
- instructions: string;
219
- tools: any;
220
- workflows: {};
221
- provider: string;
222
- modelId: string;
223
- defaultGenerateOptions: any;
224
- defaultStreamOptions: any;
225
- }>;
226
-
227
- export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
228
- runtimeContext: RuntimeContext;
229
- agentId: keyof ReturnType<typeof mastra.getAgents>;
230
- executionUrl?: string;
231
- version?: string;
232
- provider?: {
233
- organization: string;
234
- url: string;
235
- };
236
- }): Promise<AgentCard>;
237
-
238
- export declare function getAgentExecutionHandler({ requestId, mastra, agentId, runtimeContext, method, params, taskStore, logger, }: Context & {
239
- requestId: string;
240
- runtimeContext: RuntimeContext;
241
- agentId: string;
242
- method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
243
- params: TaskSendParams | TaskQueryParams | TaskIdParams;
244
- taskStore?: InMemoryTaskStore;
245
- logger?: IMastraLogger;
246
- }): Promise<any>;
247
-
248
- export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
249
- runtimeContext: RuntimeContext;
250
- }): Promise<Record<string, Omit<{
251
- id: string;
252
- name: any;
253
- instructions: string;
254
- tools: any;
255
- workflows: {};
256
- provider: string;
257
- modelId: string;
258
- defaultGenerateOptions: any;
259
- defaultStreamOptions: any;
260
- }, "id">>>;
261
-
262
- declare type GetBody<T extends keyof Agent & {
263
- [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
264
- }[keyof Agent]> = {
265
- messages: Parameters<Agent[T]>[0];
266
- } & Parameters<Agent[T]>[1];
267
-
268
- export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
269
- runtimeContext: RuntimeContext;
270
- agentId: string;
271
- }): Promise<{
272
- id: string;
273
- name: any;
274
- instructions: string;
275
- evals: EvalRow[];
276
- }>;
277
-
278
- export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
279
- stepGraph: StepGraph;
280
- stepSubscriberGraph: Record<string, StepGraph>;
281
- serializedStepGraph: StepGraph;
282
- serializedStepSubscriberGraph: Record<string, StepGraph>;
283
- name: string;
284
- triggerSchema: string | undefined;
285
- steps: any;
286
- }>;
287
-
288
- export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
289
-
290
- export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
291
- fromDate?: Date;
292
- toDate?: Date;
293
- limit?: number;
294
- offset?: number;
295
- resourceId?: string;
296
- }): Promise<LegacyWorkflowRuns>;
297
-
298
- export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
299
-
300
- /**
301
- * Get available listeners for an agent
302
- */
303
- export declare function getListenerHandler({ mastra, agentId }: VoiceContext): Promise<{
304
- enabled: boolean;
305
- }>;
306
-
307
- export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
308
- runtimeContext: RuntimeContext;
309
- agentId: string;
310
- }): Promise<{
311
- id: string;
312
- name: any;
313
- instructions: string;
314
- evals: EvalRow[];
315
- }>;
316
-
317
- export declare function getLogsByRunIdHandler({ mastra, runId, transportId, params, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId' | 'params'>): Promise<{
318
- logs: BaseLogMessage[];
319
- total: number;
320
- page: number;
321
- perPage: number;
322
- hasMore: boolean;
323
- }>;
324
-
325
- export declare function getLogsHandler({ mastra, transportId, params, }: Pick<LogsContext, 'mastra' | 'transportId' | 'params'>): Promise<{
326
- logs: BaseLogMessage[];
327
- total: number;
328
- page: number;
329
- perPage: number;
330
- hasMore: boolean;
331
- }>;
332
-
333
- export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
334
- transports: string[];
335
- }>;
336
-
337
- export declare function getMemoryStatusHandler({ mastra, agentId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'>): Promise<{
338
- result: boolean;
339
- }>;
340
-
341
- export declare function getMessagesHandler({ mastra, agentId, threadId, limit, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
342
- limit?: number;
343
- }): Promise<{
344
- messages: CoreMessage[];
345
- uiMessages: UIMessage[];
346
- }>;
347
-
348
- export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
349
- id: string;
350
- name: string;
351
- instructions: string;
352
- agents: {
353
- name: string;
354
- provider: string;
355
- modelId: string;
356
- }[];
357
- routingModel: {
358
- provider: string;
359
- modelId: string;
360
- };
361
- }>;
362
-
363
- export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
364
- id: string;
365
- name: string;
366
- instructions: string;
367
- agents: {
368
- name: string;
369
- provider: string;
370
- modelId: string;
371
- }[];
372
- routingModel: {
373
- provider: string;
374
- modelId: string;
375
- };
376
- }[]>;
377
-
378
- /**
379
- * Get available speakers for an agent
380
- */
381
- export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): Promise<{
382
- voiceId: string;
383
- }[]>;
384
-
385
- export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
386
-
387
- export declare function getThreadByIdHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType>;
388
-
389
- export declare function getThreadsHandler({ mastra, agentId, resourceId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType[]>;
390
-
391
- export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
392
-
393
- export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
394
-
395
- export declare function getVNextNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
396
- id: string;
397
- name: string;
398
- instructions: string;
399
- agents: {
400
- name: string;
401
- provider: string;
402
- modelId: string;
403
- }[];
404
- workflows: {
405
- name: string | undefined;
406
- description: string | undefined;
407
- inputSchema: string | undefined;
408
- outputSchema: string | undefined;
409
- }[];
410
- tools: {
411
- id: string;
412
- description: string;
413
- }[];
414
- routingModel: {
415
- provider: string;
416
- modelId: string;
417
- };
418
- }>;
419
-
420
- export declare function getVNextNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'runtimeContext'>): Promise<{
421
- id: string;
422
- name: string;
423
- instructions: string;
424
- tools: {
425
- id: string;
426
- description: string;
427
- }[];
428
- agents: {
429
- name: string;
430
- provider: string;
431
- modelId: string;
432
- }[];
433
- workflows: {
434
- name: string | undefined;
435
- description: string | undefined;
436
- inputSchema: string | undefined;
437
- outputSchema: string | undefined;
438
- }[];
439
- routingModel: {
440
- provider: string;
441
- modelId: string;
442
- };
443
- }[]>;
444
-
445
- export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
446
- steps: Record<string, SerializedStep>;
447
- allSteps: Record<string, SerializedStep>;
448
- name: string | undefined;
449
- description: string | undefined;
450
- stepGraph: SerializedStepFlowEntry[];
451
- inputSchema: string | undefined;
452
- outputSchema: string | undefined;
453
- }>;
454
-
455
- export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
456
-
457
- export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
458
-
459
- export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
460
- fromDate?: Date;
461
- toDate?: Date;
462
- limit?: number;
463
- offset?: number;
464
- resourceId?: string;
465
- }): Promise<WorkflowRuns>;
466
-
467
- export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
468
-
469
- export declare function handleError(error: unknown, defaultMessage: string): never;
470
-
471
- export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId, logger, }: {
472
- requestId: string;
473
- taskStore: InMemoryTaskStore;
474
- agentId: string;
475
- taskId: string;
476
- logger?: IMastraLogger;
477
- }): Promise<JSONRPCResponse<Task, unknown>>;
478
-
479
- export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
480
- requestId: string;
481
- taskStore: InMemoryTaskStore;
482
- agentId: string;
483
- taskId: string;
484
- }): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
485
-
486
- export declare function handleTaskSend({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
487
- requestId: string;
488
- params: TaskSendParams;
489
- taskStore: InMemoryTaskStore;
490
- agent: Agent;
491
- agentId: string;
492
- logger?: IMastraLogger;
493
- runtimeContext: RuntimeContext;
494
- }): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
495
-
496
- export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
497
- requestId: string;
498
- params: TaskSendParams;
499
- taskStore: InMemoryTaskStore;
500
- agent: Agent;
501
- agentId: string;
502
- logger?: IMastraLogger;
503
- runtimeContext: RuntimeContext;
504
- }): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
505
- state: string;
506
- message: {
507
- role: string;
508
- parts: {
509
- type: string;
510
- text: string;
511
- }[];
512
- };
513
- }, unknown>, void, unknown>;
514
-
515
- /**
516
- * `HTTPException` must be used when a fatal error such as authentication failure occurs.
517
- *
518
- * @see {@link https://hono.dev/docs/api/exception}
519
- *
520
- * @param {StatusCode} status - status code of HTTPException
521
- * @param {HTTPExceptionOptions} options - options of HTTPException
522
- * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
523
- * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
524
- * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
525
- *
526
- * @example
527
- * ```ts
528
- * import { HTTPException } from 'hono/http-exception'
529
- *
530
- * // ...
531
- *
532
- * app.post('/auth', async (c, next) => {
533
- * // authentication
534
- * if (authorized === false) {
535
- * throw new HTTPException(401, { message: 'Custom error message' })
536
- * }
537
- * await next()
538
- * })
539
- * ```
540
- */
541
- export declare class HTTPException extends Error {
542
- readonly res?: Response;
543
- readonly status: StatusCode;
544
- /**
545
- * Creates an instance of `HTTPException`.
546
- * @param status - HTTP status code for the exception. Defaults to 500.
547
- * @param options - Additional options for the exception.
548
- */
549
- constructor(status?: StatusCode, options?: HTTPExceptionOptions);
550
- /**
551
- * Returns the response object associated with the exception.
552
- * If a response object is not provided, a new response is created with the error message and status code.
553
- * @returns The response object.
554
- */
555
- getResponse(): Response;
556
- }
557
-
558
- /**
559
- * Options for creating an `HTTPException`.
560
- * @property res - Optional response object to use.
561
- * @property message - Optional custom error message.
562
- * @property cause - Optional cause of the error.
563
- */
564
- declare type HTTPExceptionOptions = {
565
- res?: Response;
566
- message?: string;
567
- cause?: unknown;
568
- };
569
-
570
- /**
571
- * @module
572
- * This module provides the `HTTPException` class.
573
- */
574
- declare type InfoStatusCode = 100 | 101 | 102 | 103;
575
-
576
- export declare class InMemoryTaskStore {
577
- private store;
578
- activeCancellations: Set<string>;
579
- load({ agentId, taskId }: {
580
- agentId: string;
581
- taskId: string;
582
- }): Promise<TaskAndHistory | null>;
583
- save({ agentId, data }: {
584
- agentId: string;
585
- data: TaskAndHistory;
586
- }): Promise<void>;
587
- }
588
-
589
- export declare namespace legacyWorkflows {
590
- export {
591
- getLegacyWorkflowsHandler,
592
- getLegacyWorkflowByIdHandler,
593
- startAsyncLegacyWorkflowHandler,
594
- getLegacyWorkflowRunHandler,
595
- createLegacyWorkflowRunHandler,
596
- startLegacyWorkflowRunHandler,
597
- watchLegacyWorkflowHandler,
598
- resumeAsyncLegacyWorkflowHandler,
599
- resumeLegacyWorkflowHandler,
600
- getLegacyWorkflowRunsHandler
601
- }
602
- }
603
-
604
- export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
605
-
606
- export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
607
- agentId: string;
608
- taskId: string;
609
- taskStore: InMemoryTaskStore;
610
- message: Message;
611
- sessionId?: string | null;
612
- metadata?: Record<string, unknown> | null;
613
- logger?: IMastraLogger;
614
- }): Promise<TaskAndHistory>;
615
-
616
- export declare namespace logs {
617
- export {
618
- getLogsHandler,
619
- getLogsByRunIdHandler,
620
- getLogTransports
621
- }
622
- }
623
-
624
- declare type LogsContext = {
625
- mastra: Mastra;
626
- transportId?: string;
627
- runId?: string;
628
- params?: {
629
- fromDate?: Date;
630
- toDate?: Date;
631
- logLevel?: LogLevel;
632
- filters?: string | string[];
633
- page?: number;
634
- perPage?: number;
635
- };
636
- };
637
-
638
- export declare function loopStreamVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
639
- runtimeContext: RuntimeContext;
640
- body: {
641
- message: string;
642
- threadId?: string;
643
- resourceId?: string;
644
- maxIterations?: number;
645
- };
646
- }): Promise<{
647
- stream: ReadableStream_3<StreamEvent>;
648
- getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
649
- task: ZodString;
650
- resourceId: ZodString;
651
- resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
652
- prompt: ZodString;
653
- result: ZodString;
654
- isComplete: ZodOptional<ZodBoolean>;
655
- completionReason: ZodOptional<ZodString>;
656
- iteration: ZodNumber;
657
- }, "strip", ZodTypeAny, {
658
- prompt: string;
659
- resourceId: string;
660
- result: string;
661
- task: string;
662
- resourceType: "none" | "tool" | "workflow" | "agent";
663
- iteration: number;
664
- isComplete?: boolean | undefined;
665
- completionReason?: string | undefined;
666
- }, {
667
- prompt: string;
668
- resourceId: string;
669
- result: string;
670
- task: string;
671
- resourceType: "none" | "tool" | "workflow" | "agent";
672
- iteration: number;
673
- isComplete?: boolean | undefined;
674
- completionReason?: string | undefined;
675
- }>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
676
- }>;
677
-
678
- export declare function loopVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
679
- runtimeContext: RuntimeContext;
680
- body: {
681
- message: string;
682
- };
683
- }): Promise<{
684
- status: "success";
685
- result: {
686
- text: string;
687
- iteration: number;
688
- };
689
- steps: {
690
- [x: string]: StepResult<any, any, any, any> | StepResult<unknown, unknown, unknown, unknown>;
691
- };
692
- }>;
693
-
694
- export declare namespace memory {
695
- export {
696
- getMemoryStatusHandler,
697
- getThreadsHandler,
698
- getThreadByIdHandler,
699
- saveMessagesHandler,
700
- createThreadHandler,
701
- updateThreadHandler,
702
- deleteThreadHandler,
703
- getMessagesHandler
704
- }
705
- }
706
-
707
- declare interface MemoryContext extends Context {
708
- agentId?: string;
709
- resourceId?: string;
710
- threadId?: string;
711
- networkId?: string;
712
- runtimeContext?: RuntimeContext_2;
713
- }
714
-
715
- export declare namespace network {
716
- export {
717
- getNetworksHandler,
718
- getNetworkByIdHandler,
719
- generateHandler_alias_1 as generateHandler,
720
- streamGenerateHandler_alias_1 as streamGenerateHandler
721
- }
722
- }
723
-
724
- declare interface NetworkContext extends Context {
725
- networkId?: string;
726
- runtimeContext: RuntimeContext;
727
- }
728
-
729
- declare interface NetworkContext_2 extends Context {
730
- networkId?: string;
731
- runtimeContext: RuntimeContext;
732
- }
733
-
734
- export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
735
-
736
- declare interface QueryRequest {
737
- indexName: string;
738
- queryVector: number[];
739
- topK?: number;
740
- filter?: Record<string, any>;
741
- includeVector?: boolean;
742
- }
743
-
744
- export declare function queryVectors({ mastra, vectorName, query, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
745
- query: QueryRequest;
746
- }): Promise<QueryResult[]>;
747
-
748
- declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
749
-
750
- export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
751
- body: {
752
- stepId: string;
753
- context: any;
754
- };
755
- runtimeContext: RuntimeContext;
756
- }): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
757
-
758
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
759
- body: {
760
- step: string | string[];
761
- resumeData?: unknown;
762
- };
763
- runtimeContext?: RuntimeContext_2;
764
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
765
-
766
- export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
767
- body: {
768
- stepId: string;
769
- context: any;
770
- };
771
- runtimeContext: RuntimeContext;
772
- }): Promise<{
773
- message: string;
774
- }>;
775
-
776
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
777
- body: {
778
- step: string | string[];
779
- resumeData?: unknown;
780
- };
781
- runtimeContext?: RuntimeContext_2;
782
- }): Promise<{
783
- message: string;
784
- }>;
785
-
786
- export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
787
- body: {
788
- messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
789
- };
790
- }): Promise<MastraMessageV1[]>;
791
-
792
- declare type SerializedStep = {
793
- id: string;
794
- description: string;
795
- inputSchema: string | undefined;
796
- outputSchema: string | undefined;
797
- resumeSchema: string | undefined;
798
- suspendSchema: string | undefined;
799
- };
800
-
801
- declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
802
-
803
- export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
804
- triggerData?: unknown;
805
- runtimeContext: RuntimeContext;
806
- }): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
807
-
808
- export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
809
- inputData?: unknown;
810
- runtimeContext?: RuntimeContext_2;
811
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
812
-
813
- export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
814
- triggerData?: unknown;
815
- runtimeContext: RuntimeContext;
816
- }): Promise<{
817
- message: string;
818
- }>;
819
-
820
- export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
821
- inputData?: unknown;
822
- runtimeContext?: RuntimeContext_2;
823
- }): Promise<{
824
- message: string;
825
- }>;
826
-
827
- /**
828
- * If you want to use an unofficial status, use `UnofficialStatusCode`.
829
- */
830
- export declare type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode;
831
-
832
- export declare function storeTelemetryHandler({ mastra, body }: Context & {
833
- body: {
834
- resourceSpans: any[];
835
- };
836
- }): Promise<{
837
- status: string;
838
- message: string;
839
- error: any;
840
- } | {
841
- status: string;
842
- message: string;
843
- traceCount?: undefined;
844
- } | {
845
- status: string;
846
- message: string;
847
- traceCount: number;
848
- }>;
849
-
850
- export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
851
- runtimeContext: RuntimeContext;
852
- agentId: string;
853
- body: GetBody<'stream'> & {
854
- resourceid?: string;
855
- runtimeContext?: string;
856
- };
857
- abortSignal?: AbortSignal;
858
- }): Promise<Response | undefined>;
859
-
860
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
861
- runtimeContext: RuntimeContext;
862
- body: {
863
- messages?: Parameters<AgentNetwork['stream']>[0];
864
- } & Parameters<AgentNetwork['stream']>[1];
865
- }): Promise<Response>;
866
-
867
- export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
868
- runtimeContext: RuntimeContext;
869
- body: {
870
- message: string;
871
- threadId?: string;
872
- resourceId?: string;
873
- };
874
- }): Promise<{
875
- stream: ReadableStream_3<StreamEvent>;
876
- getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
877
- task: ZodString;
878
- resourceId: ZodString;
879
- resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
880
- prompt: ZodString;
881
- result: ZodString;
882
- isComplete: ZodOptional<ZodBoolean>;
883
- completionReason: ZodOptional<ZodString>;
884
- iteration: ZodNumber;
885
- threadId: ZodOptional<ZodString>;
886
- threadResourceId: ZodOptional<ZodString>;
887
- isOneOff: ZodBoolean;
888
- }, "strip", ZodTypeAny, {
889
- prompt: string;
890
- resourceId: string;
891
- result: string;
892
- task: string;
893
- resourceType: "none" | "tool" | "workflow" | "agent";
894
- iteration: number;
895
- isOneOff: boolean;
896
- threadId?: string | undefined;
897
- threadResourceId?: string | undefined;
898
- isComplete?: boolean | undefined;
899
- completionReason?: string | undefined;
900
- }, {
901
- prompt: string;
902
- resourceId: string;
903
- result: string;
904
- task: string;
905
- resourceType: "none" | "tool" | "workflow" | "agent";
906
- iteration: number;
907
- isOneOff: boolean;
908
- threadId?: string | undefined;
909
- threadResourceId?: string | undefined;
910
- isComplete?: boolean | undefined;
911
- completionReason?: string | undefined;
912
- }>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
913
- }>;
914
-
915
- export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
916
- inputData?: unknown;
917
- runtimeContext?: RuntimeContext_2;
918
- }): Promise<{
919
- stream: ReadableStream_2<StreamEvent>;
920
- getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
921
- }>;
922
-
923
- declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
924
-
925
- export declare namespace telemetry {
926
- export {
927
- getTelemetryHandler,
928
- storeTelemetryHandler
929
- }
930
- }
931
-
932
- declare interface TelemetryContext extends Context {
933
- body?: {
934
- name?: string;
935
- scope?: string;
936
- page?: number;
937
- perPage?: number;
938
- attribute?: string | string[];
939
- fromDate?: Date;
940
- toDate?: Date;
941
- };
942
- }
943
-
944
- export declare namespace tools {
945
- export {
946
- getToolsHandler,
947
- getToolByIdHandler,
948
- executeToolHandler,
949
- executeAgentToolHandler
950
- }
951
- }
952
-
953
- declare interface ToolsContext extends Context {
954
- tools?: Record<string, ToolAction | VercelTool>;
955
- toolId?: string;
956
- runId?: string;
957
- }
958
-
959
- /**
960
- * Transcribe speech to text
961
- */
962
- export declare function transcribeSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
963
- body?: {
964
- audioData?: Buffer;
965
- options?: Parameters<NonNullable<Agent['voice']>['listen']>[1];
966
- };
967
- }): Promise<{
968
- text: string | void | NodeJS.ReadableStream;
969
- }>;
970
-
971
- /**
972
- * @deprecated
973
- * Use `UnofficialStatusCode` instead.
974
- */
975
- export declare type UnOfficalStatusCode = UnofficialStatusCode;
976
-
977
- /**
978
- * `UnofficialStatusCode` can be used to specify an unofficial status code.
979
- * @example
980
- *
981
- * ```ts
982
- * app.get('/unknown', (c) => {
983
- * return c.text("Unknown Error", 520 as UnofficialStatusCode)
984
- * })
985
- * ```
986
- */
987
- export declare type UnofficialStatusCode = -1;
988
-
989
- export declare function updateThreadHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
990
- body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
991
- }): Promise<StorageThreadType>;
992
-
993
- declare interface UpsertRequest {
994
- indexName: string;
995
- vectors: number[][];
996
- metadata?: Record<string, any>[];
997
- ids?: string[];
998
- }
999
-
1000
- export declare function upsertVectors({ mastra, vectorName, index }: VectorContext & {
1001
- index: UpsertRequest;
1002
- }): Promise<{
1003
- ids: string[];
1004
- }>;
1005
-
1006
- export declare function validateBody(body: Record<string, unknown>): void;
1007
-
1008
- export declare namespace vector {
1009
- export {
1010
- upsertVectors,
1011
- createIndex,
1012
- queryVectors,
1013
- listIndexes,
1014
- describeIndex,
1015
- deleteIndex
1016
- }
1017
- }
1018
-
1019
- declare interface VectorContext extends Context {
1020
- vectorName?: string;
1021
- }
1022
-
1023
- export declare namespace voice {
1024
- export {
1025
- getSpeakersHandler,
1026
- generateSpeechHandler,
1027
- transcribeSpeechHandler,
1028
- getListenerHandler
1029
- }
1030
- }
1031
-
1032
- declare interface VoiceContext extends Context {
1033
- agentId?: string;
1034
- }
1035
-
1036
- export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
1037
-
1038
- export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
1039
-
1040
- declare interface WorkflowContext extends Context {
1041
- workflowId?: string;
1042
- runId?: string;
1043
- }
1044
-
1045
- declare interface WorkflowContext_3 extends Context {
1046
- workflowId?: string;
1047
- runId?: string;
1048
- }
1049
-
1050
- export declare namespace workflows {
1051
- export {
1052
- getWorkflowsHandler,
1053
- getWorkflowByIdHandler,
1054
- getWorkflowRunByIdHandler,
1055
- getWorkflowRunExecutionResultHandler,
1056
- createWorkflowRunHandler,
1057
- startAsyncWorkflowHandler,
1058
- startWorkflowRunHandler,
1059
- watchWorkflowHandler,
1060
- streamWorkflowHandler,
1061
- resumeAsyncWorkflowHandler,
1062
- resumeWorkflowHandler,
1063
- getWorkflowRunsHandler,
1064
- cancelWorkflowRunHandler
1065
- }
1066
- }
1067
-
1068
- export { }