@mastra/server 0.0.0-generate-message-id-20250512171942 → 0.0.0-gl-test-20250917080133

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