@mastra/server 0.0.0-inject-middleware-20250528222017 → 0.0.0-interpolate-reporter-url-20250910180021

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 (329) hide show
  1. package/CHANGELOG.md +3569 -0
  2. package/LICENSE.md +11 -42
  3. package/dist/{chunk-5SN4U5AC.cjs → chunk-3THIIWWW.cjs} +113 -137
  4. package/dist/chunk-3THIIWWW.cjs.map +1 -0
  5. package/dist/{chunk-H5PTF3Y4.js → chunk-4QCXUEAT.js} +11 -2
  6. package/dist/chunk-4QCXUEAT.js.map +1 -0
  7. package/dist/chunk-4RRMWXQ2.js +3522 -0
  8. package/dist/chunk-4RRMWXQ2.js.map +1 -0
  9. package/dist/chunk-5DP5XZH6.cjs +928 -0
  10. package/dist/chunk-5DP5XZH6.cjs.map +1 -0
  11. package/dist/{chunk-P6SCPDYW.js → chunk-5QUKZCEF.js} +112 -136
  12. package/dist/chunk-5QUKZCEF.js.map +1 -0
  13. package/dist/chunk-66YYHFGF.js +761 -0
  14. package/dist/chunk-66YYHFGF.js.map +1 -0
  15. package/dist/chunk-6GMFZ5LK.js +2774 -0
  16. package/dist/chunk-6GMFZ5LK.js.map +1 -0
  17. package/dist/chunk-6LUKYSWE.cjs +610 -0
  18. package/dist/chunk-6LUKYSWE.cjs.map +1 -0
  19. package/dist/chunk-743UIDHI.cjs +2013 -0
  20. package/dist/chunk-743UIDHI.cjs.map +1 -0
  21. package/dist/{chunk-OCWPVYNI.cjs → chunk-7NADHFD2.cjs} +3 -0
  22. package/dist/chunk-7NADHFD2.cjs.map +1 -0
  23. package/dist/chunk-7QEJ5QG5.js +151 -0
  24. package/dist/chunk-7QEJ5QG5.js.map +1 -0
  25. package/dist/chunk-A3AL7EWJ.js +83 -0
  26. package/dist/chunk-A3AL7EWJ.js.map +1 -0
  27. package/dist/{chunk-HFWCEP5S.js → chunk-A75S4TDD.js} +36 -11
  28. package/dist/chunk-A75S4TDD.js.map +1 -0
  29. package/dist/chunk-AK2FXLLB.cjs +849 -0
  30. package/dist/chunk-AK2FXLLB.cjs.map +1 -0
  31. package/dist/chunk-B2V3PUB7.js +591 -0
  32. package/dist/chunk-B2V3PUB7.js.map +1 -0
  33. package/dist/chunk-CY4TP3FK.js +16 -0
  34. package/dist/chunk-CY4TP3FK.js.map +1 -0
  35. package/dist/chunk-EMMSS5I5.cjs +37 -0
  36. package/dist/chunk-EMMSS5I5.cjs.map +1 -0
  37. package/dist/chunk-EMNGA4R4.js +845 -0
  38. package/dist/chunk-EMNGA4R4.js.map +1 -0
  39. package/dist/chunk-FALVL2VV.cjs +3525 -0
  40. package/dist/chunk-FALVL2VV.cjs.map +1 -0
  41. package/dist/chunk-FQNT7PI4.js +937 -0
  42. package/dist/chunk-FQNT7PI4.js.map +1 -0
  43. package/dist/chunk-G3PMV62Z.js +33 -0
  44. package/dist/chunk-G3PMV62Z.js.map +1 -0
  45. package/dist/chunk-G4PUALCE.cjs +28 -0
  46. package/dist/chunk-G4PUALCE.cjs.map +1 -0
  47. package/dist/chunk-GU4EWMZB.cjs +769 -0
  48. package/dist/chunk-GU4EWMZB.cjs.map +1 -0
  49. package/dist/chunk-GUI3CROV.cjs +159 -0
  50. package/dist/chunk-GUI3CROV.cjs.map +1 -0
  51. package/dist/chunk-HJQKWRKQ.cjs +764 -0
  52. package/dist/chunk-HJQKWRKQ.cjs.map +1 -0
  53. package/dist/{chunk-YWLUOY3D.cjs → chunk-HVBBFCDH.cjs} +1110 -793
  54. package/dist/chunk-HVBBFCDH.cjs.map +1 -0
  55. package/dist/chunk-HZJRQ5L3.cjs +1411 -0
  56. package/dist/chunk-HZJRQ5L3.cjs.map +1 -0
  57. package/dist/chunk-IGFMAZZ5.cjs +1150 -0
  58. package/dist/chunk-IGFMAZZ5.cjs.map +1 -0
  59. package/dist/chunk-IOQGI4ML.js +931 -0
  60. package/dist/chunk-IOQGI4ML.js.map +1 -0
  61. package/dist/{chunk-VPNDC2DI.cjs → chunk-IY34NOLA.cjs} +16 -14
  62. package/dist/chunk-IY34NOLA.cjs.map +1 -0
  63. package/dist/chunk-J7BPKKOG.cjs +163 -0
  64. package/dist/chunk-J7BPKKOG.cjs.map +1 -0
  65. package/dist/{chunk-YIOVBYZH.cjs → chunk-KNGXRN26.cjs} +48 -45
  66. package/dist/chunk-KNGXRN26.cjs.map +1 -0
  67. package/dist/{chunk-OR3CIE2H.js → chunk-KV6VHX4V.js} +29 -7
  68. package/dist/chunk-KV6VHX4V.js.map +1 -0
  69. package/dist/chunk-L265APUD.cjs +69 -0
  70. package/dist/chunk-L265APUD.cjs.map +1 -0
  71. package/dist/chunk-LF2ZLOFP.js +767 -0
  72. package/dist/chunk-LF2ZLOFP.js.map +1 -0
  73. package/dist/chunk-LYPU75T6.js +1147 -0
  74. package/dist/chunk-LYPU75T6.js.map +1 -0
  75. package/dist/chunk-M2YFWHSB.js +455 -0
  76. package/dist/chunk-M2YFWHSB.js.map +1 -0
  77. package/dist/chunk-MLGHQDZZ.js +15671 -0
  78. package/dist/chunk-MLGHQDZZ.js.map +1 -0
  79. package/dist/{chunk-NYN7KFXL.js → chunk-MMROOK5J.js} +3 -0
  80. package/dist/chunk-MMROOK5J.js.map +1 -0
  81. package/dist/{chunk-LIVAK2DM.js → chunk-N7F33WAD.js} +1083 -794
  82. package/dist/chunk-N7F33WAD.js.map +1 -0
  83. package/dist/chunk-NG5IVLEZ.js +1012 -0
  84. package/dist/chunk-NG5IVLEZ.js.map +1 -0
  85. package/dist/chunk-OGW6HHVI.js +1408 -0
  86. package/dist/chunk-OGW6HHVI.js.map +1 -0
  87. package/dist/chunk-OZLRIVC4.cjs +588 -0
  88. package/dist/chunk-OZLRIVC4.cjs.map +1 -0
  89. package/dist/chunk-P7CIEIJ3.js +925 -0
  90. package/dist/chunk-P7CIEIJ3.js.map +1 -0
  91. package/dist/chunk-P7RBMCBE.cjs +934 -0
  92. package/dist/chunk-P7RBMCBE.cjs.map +1 -0
  93. package/dist/chunk-PPYGWINI.cjs +2777 -0
  94. package/dist/chunk-PPYGWINI.cjs.map +1 -0
  95. package/dist/{chunk-MHKNLNAN.cjs → chunk-PWTXZZTR.cjs} +33 -10
  96. package/dist/chunk-PWTXZZTR.cjs.map +1 -0
  97. package/dist/chunk-R7NOGUZG.js +65 -0
  98. package/dist/chunk-R7NOGUZG.js.map +1 -0
  99. package/dist/chunk-RCHEPTZZ.js +2006 -0
  100. package/dist/chunk-RCHEPTZZ.js.map +1 -0
  101. package/dist/chunk-RE4RPXT2.cjs +18 -0
  102. package/dist/chunk-RE4RPXT2.cjs.map +1 -0
  103. package/dist/chunk-RW2D3G4K.cjs +470 -0
  104. package/dist/chunk-RW2D3G4K.cjs.map +1 -0
  105. package/dist/chunk-SIGXR3JT.cjs +1043 -0
  106. package/dist/chunk-SIGXR3JT.cjs.map +1 -0
  107. package/dist/chunk-SPLSYTYW.cjs +88 -0
  108. package/dist/chunk-SPLSYTYW.cjs.map +1 -0
  109. package/dist/chunk-SQY4T6EJ.js +571 -0
  110. package/dist/chunk-SQY4T6EJ.js.map +1 -0
  111. package/dist/{chunk-TJKLBTFB.js → chunk-SYRRSBGL.js} +51 -27
  112. package/dist/chunk-SYRRSBGL.js.map +1 -0
  113. package/dist/{chunk-BNEY4P4P.cjs → chunk-T3TIA3O6.cjs} +20 -18
  114. package/dist/chunk-T3TIA3O6.cjs.map +1 -0
  115. package/dist/{chunk-W7VCKPAD.js → chunk-TTHEEIZ3.js} +19 -16
  116. package/dist/chunk-TTHEEIZ3.js.map +1 -0
  117. package/dist/chunk-TVSIG4JE.cjs +940 -0
  118. package/dist/chunk-TVSIG4JE.cjs.map +1 -0
  119. package/dist/{chunk-C7564HUT.js → chunk-U46VIX2V.js} +6 -4
  120. package/dist/chunk-U46VIX2V.js.map +1 -0
  121. package/dist/{chunk-55DOQLP6.js → chunk-WHN4VX55.js} +5 -3
  122. package/dist/chunk-WHN4VX55.js.map +1 -0
  123. package/dist/chunk-WZC6CIVD.cjs +120 -0
  124. package/dist/chunk-WZC6CIVD.cjs.map +1 -0
  125. package/dist/chunk-YITREQVN.cjs +15707 -0
  126. package/dist/chunk-YITREQVN.cjs.map +1 -0
  127. package/dist/dist-26HWEQY6.js +3 -0
  128. package/dist/dist-26HWEQY6.js.map +1 -0
  129. package/dist/dist-3A5DXB37.cjs +20 -0
  130. package/dist/dist-3A5DXB37.cjs.map +1 -0
  131. package/dist/dist-3SJKQJGY.cjs +16 -0
  132. package/dist/dist-3SJKQJGY.cjs.map +1 -0
  133. package/dist/dist-4ZQSPE5K.js +3 -0
  134. package/dist/dist-4ZQSPE5K.js.map +1 -0
  135. package/dist/dist-5W5QNRTD.js +3 -0
  136. package/dist/dist-5W5QNRTD.js.map +1 -0
  137. package/dist/dist-653SRMPL.js +3 -0
  138. package/dist/dist-653SRMPL.js.map +1 -0
  139. package/dist/dist-6U6EFC5C.cjs +16 -0
  140. package/dist/dist-6U6EFC5C.cjs.map +1 -0
  141. package/dist/dist-7IHNNYMF.cjs +16 -0
  142. package/dist/dist-7IHNNYMF.cjs.map +1 -0
  143. package/dist/dist-B5IPRF6W.js +3 -0
  144. package/dist/dist-B5IPRF6W.js.map +1 -0
  145. package/dist/dist-EOMYFT4Y.cjs +16 -0
  146. package/dist/dist-EOMYFT4Y.cjs.map +1 -0
  147. package/dist/dist-EZZMMMNT.cjs +16 -0
  148. package/dist/dist-EZZMMMNT.cjs.map +1 -0
  149. package/dist/dist-F2ET4MNO.cjs +16 -0
  150. package/dist/dist-F2ET4MNO.cjs.map +1 -0
  151. package/dist/dist-H64VX6DE.js +3 -0
  152. package/dist/dist-H64VX6DE.js.map +1 -0
  153. package/dist/dist-HY7RMLJQ.cjs +16 -0
  154. package/dist/dist-HY7RMLJQ.cjs.map +1 -0
  155. package/dist/dist-M6S4P3FJ.js +3 -0
  156. package/dist/dist-M6S4P3FJ.js.map +1 -0
  157. package/dist/dist-NR7QSCQT.js +3 -0
  158. package/dist/dist-NR7QSCQT.js.map +1 -0
  159. package/dist/dist-QLFMCMCX.js +3 -0
  160. package/dist/dist-QLFMCMCX.js.map +1 -0
  161. package/dist/dist-UY46BFRP.js +3 -0
  162. package/dist/dist-UY46BFRP.js.map +1 -0
  163. package/dist/dist-WCQDRTIV.cjs +16 -0
  164. package/dist/dist-WCQDRTIV.cjs.map +1 -0
  165. package/dist/dist-WKYB3LTJ.cjs +16 -0
  166. package/dist/dist-WKYB3LTJ.cjs.map +1 -0
  167. package/dist/index.cjs +2 -0
  168. package/dist/index.cjs.map +1 -0
  169. package/dist/index.d.ts +1 -0
  170. package/dist/index.d.ts.map +1 -0
  171. package/dist/index.js +2 -0
  172. package/dist/index.js.map +1 -0
  173. package/dist/server/a2a/protocol.d.ts +8 -0
  174. package/dist/server/a2a/protocol.d.ts.map +1 -0
  175. package/dist/server/a2a/store.cjs +25 -0
  176. package/dist/server/a2a/store.cjs.map +1 -0
  177. package/dist/server/a2a/store.d.ts +14 -0
  178. package/dist/server/a2a/store.d.ts.map +1 -0
  179. package/dist/server/a2a/store.js +23 -0
  180. package/dist/server/a2a/store.js.map +1 -0
  181. package/dist/server/a2a/tasks.d.ts +20 -0
  182. package/dist/server/a2a/tasks.d.ts.map +1 -0
  183. package/dist/server/handlers/a2a.cjs +13 -11
  184. package/dist/server/handlers/a2a.cjs.map +1 -0
  185. package/dist/server/handlers/a2a.d.ts +68 -6
  186. package/dist/server/handlers/a2a.d.ts.map +1 -0
  187. package/dist/server/handlers/a2a.js +3 -1
  188. package/dist/server/handlers/a2a.js.map +1 -0
  189. package/dist/server/handlers/agent-builder.cjs +68 -0
  190. package/dist/server/handlers/agent-builder.cjs.map +1 -0
  191. package/dist/server/handlers/agent-builder.d.ts +87 -0
  192. package/dist/server/handlers/agent-builder.d.ts.map +1 -0
  193. package/dist/server/handlers/agent-builder.js +3 -0
  194. package/dist/server/handlers/agent-builder.js.map +1 -0
  195. package/dist/server/handlers/agents.cjs +37 -7
  196. package/dist/server/handlers/agents.cjs.map +1 -0
  197. package/dist/server/handlers/agents.d.ts +129 -6
  198. package/dist/server/handlers/agents.d.ts.map +1 -0
  199. package/dist/server/handlers/agents.js +3 -1
  200. package/dist/server/handlers/agents.js.map +1 -0
  201. package/dist/server/handlers/error.cjs +4 -2
  202. package/dist/server/handlers/error.cjs.map +1 -0
  203. package/dist/server/handlers/error.d.ts +2 -1
  204. package/dist/server/handlers/error.d.ts.map +1 -0
  205. package/dist/server/handlers/error.js +3 -1
  206. package/dist/server/handlers/error.js.map +1 -0
  207. package/dist/server/handlers/legacyWorkflows.cjs +13 -11
  208. package/dist/server/handlers/legacyWorkflows.cjs.map +1 -0
  209. package/dist/server/handlers/legacyWorkflows.d.ts +59 -10
  210. package/dist/server/handlers/legacyWorkflows.d.ts.map +1 -0
  211. package/dist/server/handlers/legacyWorkflows.js +3 -1
  212. package/dist/server/handlers/legacyWorkflows.js.map +1 -0
  213. package/dist/server/handlers/logs.cjs +6 -4
  214. package/dist/server/handlers/logs.cjs.map +1 -0
  215. package/dist/server/handlers/logs.d.ts +34 -3
  216. package/dist/server/handlers/logs.d.ts.map +1 -0
  217. package/dist/server/handlers/logs.js +3 -1
  218. package/dist/server/handlers/logs.js.map +1 -0
  219. package/dist/server/handlers/memory.cjs +39 -9
  220. package/dist/server/handlers/memory.cjs.map +1 -0
  221. package/dist/server/handlers/memory.d.ts +118 -8
  222. package/dist/server/handlers/memory.d.ts.map +1 -0
  223. package/dist/server/handlers/memory.js +3 -1
  224. package/dist/server/handlers/memory.js.map +1 -0
  225. package/dist/server/handlers/network.cjs +7 -5
  226. package/dist/server/handlers/network.cjs.map +1 -0
  227. package/dist/server/handlers/network.d.ts +50 -4
  228. package/dist/server/handlers/network.d.ts.map +1 -0
  229. package/dist/server/handlers/network.js +3 -1
  230. package/dist/server/handlers/network.js.map +1 -0
  231. package/dist/server/handlers/observability.cjs +16 -0
  232. package/dist/server/handlers/observability.cjs.map +1 -0
  233. package/dist/server/handlers/observability.d.ts +23 -0
  234. package/dist/server/handlers/observability.d.ts.map +1 -0
  235. package/dist/server/handlers/observability.js +3 -0
  236. package/dist/server/handlers/observability.js.map +1 -0
  237. package/dist/server/handlers/scores.cjs +32 -0
  238. package/dist/server/handlers/scores.cjs.map +1 -0
  239. package/dist/server/handlers/scores.d.ts +49 -0
  240. package/dist/server/handlers/scores.d.ts.map +1 -0
  241. package/dist/server/handlers/scores.js +3 -0
  242. package/dist/server/handlers/scores.js.map +1 -0
  243. package/dist/server/handlers/telemetry.cjs +9 -3
  244. package/dist/server/handlers/telemetry.cjs.map +1 -0
  245. package/dist/server/handlers/telemetry.d.ts +33 -2
  246. package/dist/server/handlers/telemetry.d.ts.map +1 -0
  247. package/dist/server/handlers/telemetry.js +3 -1
  248. package/dist/server/handlers/telemetry.js.map +1 -0
  249. package/dist/server/handlers/tools.cjs +11 -5
  250. package/dist/server/handlers/tools.cjs.map +1 -0
  251. package/dist/server/handlers/tools.d.ts +25 -4
  252. package/dist/server/handlers/tools.d.ts.map +1 -0
  253. package/dist/server/handlers/tools.js +3 -1
  254. package/dist/server/handlers/tools.js.map +1 -0
  255. package/dist/server/handlers/utils.cjs +8 -2
  256. package/dist/server/handlers/utils.cjs.map +1 -0
  257. package/dist/server/handlers/utils.d.ts +8 -1
  258. package/dist/server/handlers/utils.d.ts.map +1 -0
  259. package/dist/server/handlers/utils.js +3 -1
  260. package/dist/server/handlers/utils.js.map +1 -0
  261. package/dist/server/handlers/vNextNetwork.cjs +220 -0
  262. package/dist/server/handlers/vNextNetwork.cjs.map +1 -0
  263. package/dist/server/handlers/vNextNetwork.d.ts +179 -0
  264. package/dist/server/handlers/vNextNetwork.d.ts.map +1 -0
  265. package/dist/server/handlers/vNextNetwork.js +213 -0
  266. package/dist/server/handlers/vNextNetwork.js.map +1 -0
  267. package/dist/server/handlers/vector.cjs +9 -7
  268. package/dist/server/handlers/vector.cjs.map +1 -0
  269. package/dist/server/handlers/vector.d.ts +51 -6
  270. package/dist/server/handlers/vector.d.ts.map +1 -0
  271. package/dist/server/handlers/vector.js +3 -1
  272. package/dist/server/handlers/vector.js.map +1 -0
  273. package/dist/server/handlers/voice.cjs +10 -4
  274. package/dist/server/handlers/voice.cjs.map +1 -0
  275. package/dist/server/handlers/voice.d.ts +39 -3
  276. package/dist/server/handlers/voice.d.ts.map +1 -0
  277. package/dist/server/handlers/voice.js +3 -1
  278. package/dist/server/handlers/voice.js.map +1 -0
  279. package/dist/server/handlers/workflows.cjs +30 -12
  280. package/dist/server/handlers/workflows.cjs.map +1 -0
  281. package/dist/server/handlers/workflows.d.ts +73 -11
  282. package/dist/server/handlers/workflows.d.ts.map +1 -0
  283. package/dist/server/handlers/workflows.js +3 -1
  284. package/dist/server/handlers/workflows.js.map +1 -0
  285. package/dist/server/handlers.cjs +49 -32
  286. package/dist/server/handlers.cjs.map +1 -0
  287. package/dist/server/handlers.d.ts +15 -11
  288. package/dist/server/handlers.d.ts.map +1 -0
  289. package/dist/server/handlers.js +16 -11
  290. package/dist/server/handlers.js.map +1 -0
  291. package/dist/server/http-exception.d.ts +87 -0
  292. package/dist/server/http-exception.d.ts.map +1 -0
  293. package/dist/server/types.d.ts +10 -0
  294. package/dist/server/types.d.ts.map +1 -0
  295. package/dist/server/utils.d.ts +42 -0
  296. package/dist/server/utils.d.ts.map +1 -0
  297. package/package.json +51 -21
  298. package/dist/_tsup-dts-rollup.d.cts +0 -830
  299. package/dist/_tsup-dts-rollup.d.ts +0 -830
  300. package/dist/chunk-57CJTIPW.cjs +0 -18
  301. package/dist/chunk-64U3UDTH.cjs +0 -13
  302. package/dist/chunk-75ZPJI57.cjs +0 -9
  303. package/dist/chunk-A3KDUGS7.cjs +0 -239
  304. package/dist/chunk-DJJIUEL2.js +0 -211
  305. package/dist/chunk-DQLE3DVM.js +0 -49
  306. package/dist/chunk-J3PKLB3A.js +0 -231
  307. package/dist/chunk-KUNQFY2W.js +0 -365
  308. package/dist/chunk-M5ABIP7D.js +0 -11
  309. package/dist/chunk-MLKGABMK.js +0 -7
  310. package/dist/chunk-MMO2HDM6.cjs +0 -378
  311. package/dist/chunk-NEOOQUKW.cjs +0 -54
  312. package/dist/chunk-Y7UWRW5X.cjs +0 -221
  313. package/dist/chunk-YBVOQN4M.cjs +0 -94
  314. package/dist/chunk-ZE5AAC4I.cjs +0 -138
  315. package/dist/index.d.cts +0 -1
  316. package/dist/server/handlers/a2a.d.cts +0 -6
  317. package/dist/server/handlers/agents.d.cts +0 -6
  318. package/dist/server/handlers/error.d.cts +0 -1
  319. package/dist/server/handlers/legacyWorkflows.d.cts +0 -10
  320. package/dist/server/handlers/logs.d.cts +0 -3
  321. package/dist/server/handlers/memory.d.cts +0 -8
  322. package/dist/server/handlers/network.d.cts +0 -4
  323. package/dist/server/handlers/telemetry.d.cts +0 -2
  324. package/dist/server/handlers/tools.d.cts +0 -4
  325. package/dist/server/handlers/utils.d.cts +0 -1
  326. package/dist/server/handlers/vector.d.cts +0 -6
  327. package/dist/server/handlers/voice.d.cts +0 -3
  328. package/dist/server/handlers/workflows.d.cts +0 -11
  329. package/dist/server/handlers.d.cts +0 -11
@@ -1,830 +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 { EvalRow } from '@mastra/core/storage';
9
- import { GenerateObjectResult } from 'ai';
10
- import { GenerateTextResult } from 'ai';
11
- import type { IMastraLogger } from '@mastra/core/logger';
12
- import type { JSONRPCError } from '@mastra/core/a2a';
13
- import { JSONRPCResponse } from '@mastra/core/a2a';
14
- import { LegacyStep } from '@mastra/core/workflows/legacy';
15
- import type { LegacyWorkflow } from '@mastra/core/workflows/legacy';
16
- import { LegacyWorkflowRunResult } from '@mastra/core/workflows/legacy';
17
- import type { LegacyWorkflowRuns } from '@mastra/core/storage';
18
- import type { Mastra } from '@mastra/core/mastra';
19
- import type { MastraMemory } from '@mastra/core/memory';
20
- import { Message } from 'ai';
21
- import type { Message as Message_2 } from '@mastra/core/a2a';
22
- import { MessageType } from '@mastra/core/memory';
23
- import type { QueryResult } from '@mastra/core/vector';
24
- import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
25
- import { RuntimeContext } from '@mastra/core/runtime-context';
26
- import { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
27
- import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
28
- import { Step } from '@mastra/core/workflows';
29
- import { StepExecutionContext } from '@mastra/core/workflows/legacy';
30
- import { StepGraph } from '@mastra/core/workflows/legacy';
31
- import { StorageThreadType } from '@mastra/core/memory';
32
- import { Task } from '@mastra/core/a2a';
33
- import { TaskAndHistory } from '@mastra/core/a2a';
34
- import type { TaskContext } from '@mastra/core/a2a';
35
- import type { TaskIdParams } from '@mastra/core/a2a';
36
- import type { TaskQueryParams } from '@mastra/core/a2a';
37
- import type { TaskSendParams } from '@mastra/core/a2a';
38
- import type { TaskStatus } from '@mastra/core/a2a';
39
- import type { ToolAction } from '@mastra/core/tools';
40
- import type { VercelTool } from '@mastra/core/tools';
41
- import { WatchEvent } from '@mastra/core/workflows';
42
- import type { Workflow } from '@mastra/core/workflows';
43
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
44
- import { WorkflowResult } from '@mastra/core/workflows';
45
- import type { WorkflowRuns } from '@mastra/core/storage';
46
- import { ZodType } from 'zod';
47
- import { ZodTypeDef } from 'zod';
48
-
49
- export declare namespace a2a {
50
- export {
51
- getAgentCardByIdHandler,
52
- handleTaskSend,
53
- handleTaskGet,
54
- handleTaskSendSubscribe,
55
- handleTaskCancel,
56
- getAgentExecutionHandler
57
- }
58
- }
59
-
60
- export declare namespace agents {
61
- export {
62
- getAgentsHandler,
63
- getAgentByIdHandler,
64
- getEvalsByAgentIdHandler,
65
- getLiveEvalsByAgentIdHandler,
66
- generateHandler,
67
- streamGenerateHandler
68
- }
69
- }
70
-
71
- export declare interface ApiError extends Error {
72
- message: string;
73
- status?: number;
74
- }
75
-
76
- export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
77
-
78
- 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;
79
-
80
- export declare interface Context {
81
- mastra: Mastra;
82
- }
83
-
84
- export declare function convertToCoreMessage(message: Message_2): CoreMessage_2;
85
-
86
- export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
87
-
88
- export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
89
- index: CreateIndexRequest;
90
- }): Promise<{
91
- success: boolean;
92
- }>;
93
-
94
- declare interface CreateIndexRequest {
95
- indexName: string;
96
- dimension: number;
97
- metric?: 'cosine' | 'euclidean' | 'dotproduct';
98
- }
99
-
100
- export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
101
- runId: string;
102
- }>;
103
-
104
- export declare function createSuccessResponse<T>(id: number | string | null, result: T): JSONRPCResponse<T>;
105
-
106
- export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
107
- task: Task;
108
- userMessage: Message_2;
109
- history: Message_2[];
110
- activeCancellations: Set<string>;
111
- }): TaskContext;
112
-
113
- export declare function createThreadHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
114
- body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
115
- resourceId?: string;
116
- };
117
- }): Promise<StorageThreadType>;
118
-
119
- export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
120
- runId: string;
121
- }>;
122
-
123
- export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
124
- indexName?: string;
125
- }): Promise<{
126
- success: boolean;
127
- }>;
128
-
129
- export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
130
- result: string;
131
- }>;
132
-
133
- declare type DeprecatedStatusCode = 305 | 306;
134
-
135
- export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
136
- indexName?: string;
137
- }): Promise<{
138
- dimension: number;
139
- count: number;
140
- metric: string | undefined;
141
- }>;
142
-
143
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, runtimeContextFromRequest, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
144
- agentId?: string;
145
- data: any;
146
- runtimeContext: RuntimeContext_2;
147
- runtimeContextFromRequest: Record<string, unknown>;
148
- }): Promise<any>;
149
-
150
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, runtimeContextFromRequest, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
151
- data?: unknown;
152
- runtimeContext: RuntimeContext_2;
153
- runtimeContextFromRequest: Record<string, unknown>;
154
- }) => Promise<any>;
155
-
156
- export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
157
- runtimeContext: RuntimeContext;
158
- agentId: string;
159
- body: GetBody<'generate'> & {
160
- resourceid?: string;
161
- runtimeContext?: Record<string, unknown>;
162
- };
163
- }): Promise<GenerateTextResult<any, any>>;
164
-
165
- export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
166
- runtimeContext: RuntimeContext;
167
- body: {
168
- messages?: Parameters<AgentNetwork['generate']>[0];
169
- } & Parameters<AgentNetwork['generate']>[1];
170
- }): Promise<GenerateObjectResult<any>>;
171
-
172
- /**
173
- * Generate speech from text
174
- */
175
- export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
176
- body?: {
177
- text?: string;
178
- speakerId?: string;
179
- };
180
- }): Promise<NodeJS.ReadableStream>;
181
-
182
- export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
183
- runtimeContext: RuntimeContext;
184
- agentId: string;
185
- }): Promise<{
186
- name: any;
187
- instructions: string;
188
- tools: any;
189
- workflows: {};
190
- provider: string;
191
- modelId: string;
192
- defaultGenerateOptions: any;
193
- defaultStreamOptions: any;
194
- }>;
195
-
196
- export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
197
- runtimeContext: RuntimeContext;
198
- agentId: keyof ReturnType<typeof mastra.getAgents>;
199
- executionUrl?: string;
200
- version?: string;
201
- provider?: {
202
- organization: string;
203
- url: string;
204
- };
205
- }): Promise<AgentCard>;
206
-
207
- export declare function getAgentExecutionHandler({ requestId, mastra, agentId, runtimeContext, method, params, taskStore, logger, }: Context & {
208
- requestId: string;
209
- runtimeContext: RuntimeContext;
210
- agentId: string;
211
- method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
212
- params: TaskSendParams | TaskQueryParams | TaskIdParams;
213
- taskStore?: InMemoryTaskStore;
214
- logger?: IMastraLogger;
215
- }): Promise<any>;
216
-
217
- export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
218
- runtimeContext: RuntimeContext;
219
- }): Promise<any>;
220
-
221
- declare type GetBody<T extends keyof Agent & {
222
- [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
223
- }[keyof Agent]> = {
224
- messages: Parameters<Agent[T]>[0];
225
- } & Parameters<Agent[T]>[1];
226
-
227
- export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
228
- runtimeContext: RuntimeContext;
229
- agentId: string;
230
- }): Promise<{
231
- id: string;
232
- name: any;
233
- instructions: string;
234
- evals: EvalRow[];
235
- }>;
236
-
237
- export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
238
- stepGraph: StepGraph;
239
- stepSubscriberGraph: Record<string, StepGraph>;
240
- serializedStepGraph: StepGraph;
241
- serializedStepSubscriberGraph: Record<string, StepGraph>;
242
- name: string;
243
- triggerSchema: string | undefined;
244
- steps: any;
245
- }>;
246
-
247
- export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
248
-
249
- export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
250
- fromDate?: Date;
251
- toDate?: Date;
252
- limit?: number;
253
- offset?: number;
254
- resourceId?: string;
255
- }): Promise<LegacyWorkflowRuns>;
256
-
257
- export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
258
-
259
- export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
260
- runtimeContext: RuntimeContext;
261
- agentId: string;
262
- }): Promise<{
263
- id: string;
264
- name: any;
265
- instructions: string;
266
- evals: EvalRow[];
267
- }>;
268
-
269
- export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<any[]>;
270
-
271
- export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
272
-
273
- export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
274
- transports: string[];
275
- }>;
276
-
277
- export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
278
- result: boolean;
279
- }>;
280
-
281
- export declare function getMessagesHandler({ mastra, agentId, threadId, limit, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
282
- limit?: number;
283
- }): Promise<{
284
- messages: CoreMessage[];
285
- uiMessages: Message[];
286
- }>;
287
-
288
- export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
289
- id: string;
290
- name: string;
291
- instructions: string;
292
- agents: {
293
- name: string;
294
- provider: string;
295
- modelId: string;
296
- }[];
297
- routingModel: {
298
- provider: string;
299
- modelId: string;
300
- };
301
- }>;
302
-
303
- export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
304
- id: string;
305
- name: string;
306
- instructions: string;
307
- agents: {
308
- name: string;
309
- provider: string;
310
- modelId: string;
311
- }[];
312
- routingModel: {
313
- provider: string;
314
- modelId: string;
315
- };
316
- }[]>;
317
-
318
- /**
319
- * Get available speakers for an agent
320
- */
321
- export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): Promise<{
322
- voiceId: string;
323
- }[]>;
324
-
325
- export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
326
-
327
- export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
328
-
329
- export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
330
-
331
- export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
332
-
333
- export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
334
-
335
- export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
336
- steps: SerializedStep[];
337
- name: string | undefined;
338
- description: string | undefined;
339
- stepGraph: SerializedStepFlowEntry[];
340
- inputSchema: string | undefined;
341
- outputSchema: string | undefined;
342
- }>;
343
-
344
- export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
345
-
346
- export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
347
- fromDate?: Date;
348
- toDate?: Date;
349
- limit?: number;
350
- offset?: number;
351
- resourceId?: string;
352
- }): Promise<WorkflowRuns>;
353
-
354
- export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
355
-
356
- export declare function handleError(error: unknown, defaultMessage: string): never;
357
-
358
- export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId, logger, }: {
359
- requestId: string;
360
- taskStore: InMemoryTaskStore;
361
- agentId: string;
362
- taskId: string;
363
- logger?: IMastraLogger;
364
- }): Promise<JSONRPCResponse<Task, unknown>>;
365
-
366
- export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
367
- requestId: string;
368
- taskStore: InMemoryTaskStore;
369
- agentId: string;
370
- taskId: string;
371
- }): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
372
-
373
- export declare function handleTaskSend({ requestId, params, taskStore, agent, logger, runtimeContext, }: {
374
- requestId: string;
375
- params: TaskSendParams;
376
- taskStore: InMemoryTaskStore;
377
- agent: Agent;
378
- logger?: IMastraLogger;
379
- runtimeContext: RuntimeContext;
380
- }): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
381
-
382
- export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, logger, runtimeContext, }: {
383
- requestId: string;
384
- params: TaskSendParams;
385
- taskStore: InMemoryTaskStore;
386
- agent: Agent;
387
- logger?: IMastraLogger;
388
- runtimeContext: RuntimeContext;
389
- }): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
390
- state: string;
391
- message: {
392
- role: string;
393
- parts: {
394
- type: string;
395
- text: string;
396
- }[];
397
- };
398
- }, unknown>, void, unknown>;
399
-
400
- /**
401
- * `HTTPException` must be used when a fatal error such as authentication failure occurs.
402
- *
403
- * @see {@link https://hono.dev/docs/api/exception}
404
- *
405
- * @param {StatusCode} status - status code of HTTPException
406
- * @param {HTTPExceptionOptions} options - options of HTTPException
407
- * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
408
- * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
409
- * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
410
- *
411
- * @example
412
- * ```ts
413
- * import { HTTPException } from 'hono/http-exception'
414
- *
415
- * // ...
416
- *
417
- * app.post('/auth', async (c, next) => {
418
- * // authentication
419
- * if (authorized === false) {
420
- * throw new HTTPException(401, { message: 'Custom error message' })
421
- * }
422
- * await next()
423
- * })
424
- * ```
425
- */
426
- export declare class HTTPException extends Error {
427
- readonly res?: Response;
428
- readonly status: StatusCode;
429
- /**
430
- * Creates an instance of `HTTPException`.
431
- * @param status - HTTP status code for the exception. Defaults to 500.
432
- * @param options - Additional options for the exception.
433
- */
434
- constructor(status?: StatusCode, options?: HTTPExceptionOptions);
435
- /**
436
- * Returns the response object associated with the exception.
437
- * If a response object is not provided, a new response is created with the error message and status code.
438
- * @returns The response object.
439
- */
440
- getResponse(): Response;
441
- }
442
-
443
- /**
444
- * Options for creating an `HTTPException`.
445
- * @property res - Optional response object to use.
446
- * @property message - Optional custom error message.
447
- * @property cause - Optional cause of the error.
448
- */
449
- declare type HTTPExceptionOptions = {
450
- res?: Response;
451
- message?: string;
452
- cause?: unknown;
453
- };
454
-
455
- /**
456
- * @module
457
- * This module provides the `HTTPException` class.
458
- */
459
- declare type InfoStatusCode = 100 | 101 | 102 | 103;
460
-
461
- export declare class InMemoryTaskStore {
462
- private store;
463
- activeCancellations: Set<string>;
464
- load({ agentId, taskId }: {
465
- agentId: string;
466
- taskId: string;
467
- }): Promise<TaskAndHistory | null>;
468
- save({ agentId, data }: {
469
- agentId: string;
470
- data: TaskAndHistory;
471
- }): Promise<void>;
472
- }
473
-
474
- export declare namespace legacyWorkflows {
475
- export {
476
- getLegacyWorkflowsHandler,
477
- getLegacyWorkflowByIdHandler,
478
- startAsyncLegacyWorkflowHandler,
479
- getLegacyWorkflowRunHandler,
480
- createLegacyWorkflowRunHandler,
481
- startLegacyWorkflowRunHandler,
482
- watchLegacyWorkflowHandler,
483
- resumeAsyncLegacyWorkflowHandler,
484
- resumeLegacyWorkflowHandler,
485
- getLegacyWorkflowRunsHandler
486
- }
487
- }
488
-
489
- export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
490
-
491
- export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
492
- agentId: string;
493
- taskId: string;
494
- taskStore: InMemoryTaskStore;
495
- message: Message_2;
496
- sessionId?: string | null;
497
- metadata?: Record<string, unknown> | null;
498
- logger?: IMastraLogger;
499
- }): Promise<TaskAndHistory>;
500
-
501
- export declare namespace logs {
502
- export {
503
- getLogsHandler,
504
- getLogsByRunIdHandler,
505
- getLogTransports
506
- }
507
- }
508
-
509
- declare type LogsContext = {
510
- mastra: Mastra;
511
- transportId?: string;
512
- runId?: string;
513
- };
514
-
515
- export declare namespace memory {
516
- export {
517
- getMemoryStatusHandler,
518
- getThreadsHandler,
519
- getThreadByIdHandler,
520
- saveMessagesHandler,
521
- createThreadHandler,
522
- updateThreadHandler,
523
- deleteThreadHandler,
524
- getMessagesHandler
525
- }
526
- }
527
-
528
- declare interface MemoryContext extends Context {
529
- agentId?: string;
530
- resourceId?: string;
531
- threadId?: string;
532
- }
533
-
534
- export declare namespace network {
535
- export {
536
- getNetworksHandler,
537
- getNetworkByIdHandler,
538
- generateHandler_alias_1 as generateHandler,
539
- streamGenerateHandler_alias_1 as streamGenerateHandler
540
- }
541
- }
542
-
543
- declare interface NetworkContext extends Context {
544
- networkId?: string;
545
- runtimeContext: RuntimeContext;
546
- }
547
-
548
- export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
549
-
550
- declare interface QueryRequest {
551
- indexName: string;
552
- queryVector: number[];
553
- topK?: number;
554
- filter?: Record<string, any>;
555
- includeVector?: boolean;
556
- }
557
-
558
- export declare function queryVectors({ mastra, vectorName, query, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
559
- query: QueryRequest;
560
- }): Promise<QueryResult[]>;
561
-
562
- declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
563
-
564
- export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
565
- body: {
566
- stepId: string;
567
- context: any;
568
- };
569
- runtimeContext: RuntimeContext;
570
- }): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
571
-
572
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, runtimeContextFromRequest, }: WorkflowContext_3 & {
573
- body: {
574
- step: string | string[];
575
- resumeData?: unknown;
576
- };
577
- runtimeContext?: RuntimeContext_2;
578
- runtimeContextFromRequest?: Record<string, unknown>;
579
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any>[]>>;
580
-
581
- export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
582
- body: {
583
- stepId: string;
584
- context: any;
585
- };
586
- runtimeContext: RuntimeContext;
587
- }): Promise<{
588
- message: string;
589
- }>;
590
-
591
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
592
- body: {
593
- step: string | string[];
594
- resumeData?: unknown;
595
- };
596
- runtimeContext?: RuntimeContext_2;
597
- }): Promise<{
598
- message: string;
599
- }>;
600
-
601
- export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
602
- body: {
603
- messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
604
- };
605
- }): Promise<MessageType[]>;
606
-
607
- declare type SerializedStep = {
608
- id: string;
609
- description: string;
610
- inputSchema: string | undefined;
611
- outputSchema: string | undefined;
612
- resumeSchema: string | undefined;
613
- suspendSchema: string | undefined;
614
- };
615
-
616
- declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
617
-
618
- export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
619
- triggerData?: unknown;
620
- runtimeContext: RuntimeContext;
621
- }): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
622
-
623
- export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, runtimeContextFromRequest, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
624
- inputData?: unknown;
625
- runtimeContext?: RuntimeContext_2;
626
- runtimeContextFromRequest?: Record<string, unknown>;
627
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any>[]>>;
628
-
629
- export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
630
- triggerData?: unknown;
631
- runtimeContext: RuntimeContext;
632
- }): Promise<{
633
- message: string;
634
- }>;
635
-
636
- export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, runtimeContextFromRequest, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
637
- inputData?: unknown;
638
- runtimeContext?: RuntimeContext_2;
639
- runtimeContextFromRequest?: Record<string, unknown>;
640
- }): Promise<{
641
- message: string;
642
- }>;
643
-
644
- /**
645
- * If you want to use an unofficial status, use `UnofficialStatusCode`.
646
- */
647
- export declare type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode;
648
-
649
- export declare function storeTelemetryHandler({ mastra, body }: Context & {
650
- body: {
651
- resourceSpans: any[];
652
- };
653
- }): Promise<{
654
- status: string;
655
- message: string;
656
- error: any;
657
- } | {
658
- status: string;
659
- message: string;
660
- traceCount: number;
661
- }>;
662
-
663
- export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
664
- runtimeContext: RuntimeContext;
665
- agentId: string;
666
- body: GetBody<'stream'> & {
667
- resourceid?: string;
668
- runtimeContext?: string;
669
- };
670
- }): Promise<Response | undefined>;
671
-
672
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
673
- runtimeContext: RuntimeContext;
674
- body: {
675
- messages?: Parameters<AgentNetwork['stream']>[0];
676
- } & Parameters<AgentNetwork['stream']>[1];
677
- }): Promise<Response>;
678
-
679
- export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, runtimeContextFromRequest, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
680
- inputData?: unknown;
681
- runtimeContext?: RuntimeContext_2;
682
- runtimeContextFromRequest?: Record<string, unknown>;
683
- }): {
684
- stream: globalThis.ReadableStream<WatchEvent>;
685
- getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any>[]>>;
686
- };
687
-
688
- declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
689
-
690
- export declare namespace telemetry {
691
- export {
692
- getTelemetryHandler,
693
- storeTelemetryHandler
694
- }
695
- }
696
-
697
- declare interface TelemetryContext extends Context {
698
- body?: {
699
- name?: string;
700
- scope?: string;
701
- page?: number;
702
- perPage?: number;
703
- attribute?: string | string[];
704
- fromDate?: Date;
705
- toDate?: Date;
706
- };
707
- }
708
-
709
- export declare namespace tools {
710
- export {
711
- getToolsHandler,
712
- getToolByIdHandler,
713
- executeToolHandler,
714
- executeAgentToolHandler
715
- }
716
- }
717
-
718
- declare interface ToolsContext extends Context {
719
- tools?: Record<string, ToolAction | VercelTool>;
720
- toolId?: string;
721
- runId?: string;
722
- }
723
-
724
- /**
725
- * Transcribe speech to text
726
- */
727
- export declare function transcribeSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
728
- body?: {
729
- audioData?: Buffer;
730
- options?: Parameters<NonNullable<Agent['voice']>['listen']>[1];
731
- };
732
- }): Promise<{
733
- text: string | void | NodeJS.ReadableStream;
734
- }>;
735
-
736
- /**
737
- * @deprecated
738
- * Use `UnofficialStatusCode` instead.
739
- */
740
- export declare type UnOfficalStatusCode = UnofficialStatusCode;
741
-
742
- /**
743
- * `UnofficialStatusCode` can be used to specify an unofficial status code.
744
- * @example
745
- *
746
- * ```ts
747
- * app.get('/unknown', (c) => {
748
- * return c.text("Unknown Error", 520 as UnofficialStatusCode)
749
- * })
750
- * ```
751
- */
752
- export declare type UnofficialStatusCode = -1;
753
-
754
- export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
755
- body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
756
- }): Promise<StorageThreadType>;
757
-
758
- declare interface UpsertRequest {
759
- indexName: string;
760
- vectors: number[][];
761
- metadata?: Record<string, any>[];
762
- ids?: string[];
763
- }
764
-
765
- export declare function upsertVectors({ mastra, vectorName, index }: VectorContext & {
766
- index: UpsertRequest;
767
- }): Promise<{
768
- ids: string[];
769
- }>;
770
-
771
- export declare function validateBody(body: Record<string, unknown>): void;
772
-
773
- export declare namespace vector {
774
- export {
775
- upsertVectors,
776
- createIndex,
777
- queryVectors,
778
- listIndexes,
779
- describeIndex,
780
- deleteIndex
781
- }
782
- }
783
-
784
- declare interface VectorContext extends Context {
785
- vectorName?: string;
786
- }
787
-
788
- export declare namespace voice {
789
- export {
790
- getSpeakersHandler,
791
- generateSpeechHandler,
792
- transcribeSpeechHandler
793
- }
794
- }
795
-
796
- declare interface VoiceContext extends Context {
797
- agentId?: string;
798
- }
799
-
800
- export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
801
-
802
- export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
803
-
804
- declare interface WorkflowContext extends Context {
805
- workflowId?: string;
806
- runId?: string;
807
- }
808
-
809
- declare interface WorkflowContext_3 extends Context {
810
- workflowId?: string;
811
- runId?: string;
812
- }
813
-
814
- export declare namespace workflows {
815
- export {
816
- getWorkflowsHandler,
817
- getWorkflowByIdHandler,
818
- getWorkflowRunByIdHandler,
819
- createWorkflowRunHandler,
820
- startAsyncWorkflowHandler,
821
- startWorkflowRunHandler,
822
- watchWorkflowHandler,
823
- streamWorkflowHandler,
824
- resumeAsyncWorkflowHandler,
825
- resumeWorkflowHandler,
826
- getWorkflowRunsHandler
827
- }
828
- }
829
-
830
- export { }