@mastra/server 0.0.0-share-agent-metadata-with-cloud-20250718123411 → 0.0.0-span-scorring-test-20251124132129

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 (353) hide show
  1. package/CHANGELOG.md +4910 -0
  2. package/README.md +1 -6
  3. package/dist/chunk-2NW6POYK.cjs +89 -0
  4. package/dist/chunk-2NW6POYK.cjs.map +1 -0
  5. package/dist/chunk-2PLXW4ZX.cjs +2777 -0
  6. package/dist/chunk-2PLXW4ZX.cjs.map +1 -0
  7. package/dist/chunk-35NT4TMQ.cjs +201 -0
  8. package/dist/chunk-35NT4TMQ.cjs.map +1 -0
  9. package/dist/chunk-3R5EV3HV.js +664 -0
  10. package/dist/chunk-3R5EV3HV.js.map +1 -0
  11. package/dist/chunk-4ECGVOJZ.cjs +678 -0
  12. package/dist/chunk-4ECGVOJZ.cjs.map +1 -0
  13. package/dist/chunk-5PONYNYP.cjs +125 -0
  14. package/dist/chunk-5PONYNYP.cjs.map +1 -0
  15. package/dist/chunk-5W4RPVTK.cjs +49 -0
  16. package/dist/chunk-5W4RPVTK.cjs.map +1 -0
  17. package/dist/{chunk-2KZFMI6P.cjs → chunk-64ITUOXI.cjs} +2 -0
  18. package/dist/chunk-64ITUOXI.cjs.map +1 -0
  19. package/dist/chunk-6BISSAIF.js +23494 -0
  20. package/dist/chunk-6BISSAIF.js.map +1 -0
  21. package/dist/chunk-6DTV6NEW.js +116 -0
  22. package/dist/chunk-6DTV6NEW.js.map +1 -0
  23. package/dist/{chunk-LCM566I4.js → chunk-6QWQZI4Q.js} +2 -0
  24. package/dist/chunk-6QWQZI4Q.js.map +1 -0
  25. package/dist/chunk-AEO6IHLK.cjs +368 -0
  26. package/dist/chunk-AEO6IHLK.cjs.map +1 -0
  27. package/dist/chunk-ASZUOBKV.js +310 -0
  28. package/dist/chunk-ASZUOBKV.js.map +1 -0
  29. package/dist/chunk-ECIVTQ4E.js +354 -0
  30. package/dist/chunk-ECIVTQ4E.js.map +1 -0
  31. package/dist/chunk-FAQICBMH.js +164 -0
  32. package/dist/chunk-FAQICBMH.js.map +1 -0
  33. package/dist/chunk-FXDZLX2Y.js +192 -0
  34. package/dist/chunk-FXDZLX2Y.js.map +1 -0
  35. package/dist/chunk-G7BPNX2V.js +130 -0
  36. package/dist/chunk-G7BPNX2V.js.map +1 -0
  37. package/dist/chunk-GU4EWMZB.cjs +769 -0
  38. package/dist/chunk-GU4EWMZB.cjs.map +1 -0
  39. package/dist/chunk-I5VZ5SKG.js +328 -0
  40. package/dist/chunk-I5VZ5SKG.js.map +1 -0
  41. package/dist/chunk-ICANWSEW.js +204 -0
  42. package/dist/chunk-ICANWSEW.js.map +1 -0
  43. package/dist/chunk-KB5NSROG.cjs +211 -0
  44. package/dist/chunk-KB5NSROG.cjs.map +1 -0
  45. package/dist/chunk-LF2ZLOFP.js +767 -0
  46. package/dist/chunk-LF2ZLOFP.js.map +1 -0
  47. package/dist/chunk-LPM6BBAX.cjs +1043 -0
  48. package/dist/chunk-LPM6BBAX.cjs.map +1 -0
  49. package/dist/chunk-MWQQRVQC.cjs +259 -0
  50. package/dist/chunk-MWQQRVQC.cjs.map +1 -0
  51. package/dist/chunk-NDFAQBQD.cjs +792 -0
  52. package/dist/chunk-NDFAQBQD.cjs.map +1 -0
  53. package/dist/chunk-O7I5CWRX.cjs +44 -0
  54. package/dist/chunk-O7I5CWRX.cjs.map +1 -0
  55. package/dist/chunk-PKRHEXX7.js +74 -0
  56. package/dist/chunk-PKRHEXX7.js.map +1 -0
  57. package/dist/chunk-PR4QN5HX.js +39 -0
  58. package/dist/chunk-PR4QN5HX.js.map +1 -0
  59. package/dist/chunk-QGWCNTG6.cjs +797 -0
  60. package/dist/chunk-QGWCNTG6.cjs.map +1 -0
  61. package/dist/chunk-QU6N55W6.cjs +256 -0
  62. package/dist/chunk-QU6N55W6.cjs.map +1 -0
  63. package/dist/chunk-R4M3BSUG.js +226 -0
  64. package/dist/chunk-R4M3BSUG.js.map +1 -0
  65. package/dist/chunk-RQK4FQUD.js +1012 -0
  66. package/dist/chunk-RQK4FQUD.js.map +1 -0
  67. package/dist/chunk-SHWNNZBL.js +254 -0
  68. package/dist/chunk-SHWNNZBL.js.map +1 -0
  69. package/dist/chunk-TBVUN4XN.cjs +23536 -0
  70. package/dist/chunk-TBVUN4XN.cjs.map +1 -0
  71. package/dist/chunk-TOCYBDP2.js +46 -0
  72. package/dist/chunk-TOCYBDP2.js.map +1 -0
  73. package/dist/chunk-UJNHKFBR.cjs +167 -0
  74. package/dist/chunk-UJNHKFBR.cjs.map +1 -0
  75. package/dist/chunk-UOFV2ZCI.js +878 -0
  76. package/dist/chunk-UOFV2ZCI.js.map +1 -0
  77. package/dist/{chunk-LF7P5PLR.js → chunk-UXGQZUYZ.js} +3 -1
  78. package/dist/chunk-UXGQZUYZ.js.map +1 -0
  79. package/dist/chunk-UZ6CYAOG.cjs +134 -0
  80. package/dist/chunk-UZ6CYAOG.cjs.map +1 -0
  81. package/dist/{chunk-PZQDCRPV.cjs → chunk-V5WWQN7P.cjs} +4 -2
  82. package/dist/chunk-V5WWQN7P.cjs.map +1 -0
  83. package/dist/chunk-VQAT5HX6.js +756 -0
  84. package/dist/chunk-VQAT5HX6.js.map +1 -0
  85. package/dist/chunk-X6C7BUWN.cjs +48 -0
  86. package/dist/chunk-X6C7BUWN.cjs.map +1 -0
  87. package/dist/chunk-XWGAT2DA.js +44 -0
  88. package/dist/chunk-XWGAT2DA.js.map +1 -0
  89. package/dist/chunk-YJ3VDL3Z.cjs +346 -0
  90. package/dist/chunk-YJ3VDL3Z.cjs.map +1 -0
  91. package/dist/chunk-Z36N2OQA.cjs +907 -0
  92. package/dist/chunk-Z36N2OQA.cjs.map +1 -0
  93. package/dist/chunk-ZLRTFRL4.js +773 -0
  94. package/dist/chunk-ZLRTFRL4.js.map +1 -0
  95. package/dist/chunk-ZODCSH2W.cjs +322 -0
  96. package/dist/chunk-ZODCSH2W.cjs.map +1 -0
  97. package/dist/chunk-ZULZ2752.js +2774 -0
  98. package/dist/chunk-ZULZ2752.js.map +1 -0
  99. package/dist/dist-4MVGNSRL.cjs +1150 -0
  100. package/dist/dist-4MVGNSRL.cjs.map +1 -0
  101. package/dist/dist-FZYCV3VB.cjs +940 -0
  102. package/dist/dist-FZYCV3VB.cjs.map +1 -0
  103. package/dist/dist-G2BYZJOC.cjs +928 -0
  104. package/dist/dist-G2BYZJOC.cjs.map +1 -0
  105. package/dist/dist-P4MXBQ3U.cjs +16 -0
  106. package/dist/dist-P4MXBQ3U.cjs.map +1 -0
  107. package/dist/dist-PQZUVLPC.js +937 -0
  108. package/dist/dist-PQZUVLPC.js.map +1 -0
  109. package/dist/dist-R7WYX6LC.js +925 -0
  110. package/dist/dist-R7WYX6LC.js.map +1 -0
  111. package/dist/dist-RFMYFILX.cjs +764 -0
  112. package/dist/dist-RFMYFILX.cjs.map +1 -0
  113. package/dist/dist-X7XR3M3Z.js +1147 -0
  114. package/dist/dist-X7XR3M3Z.js.map +1 -0
  115. package/dist/dist-XVBSOGFK.js +761 -0
  116. package/dist/dist-XVBSOGFK.js.map +1 -0
  117. package/dist/dist-YREX2TJT.js +3 -0
  118. package/dist/dist-YREX2TJT.js.map +1 -0
  119. package/dist/index.cjs +6 -0
  120. package/dist/index.cjs.map +1 -0
  121. package/dist/index.d.ts +1 -0
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +5 -0
  124. package/dist/index.js.map +1 -0
  125. package/dist/server/a2a/protocol.d.ts +8 -0
  126. package/dist/server/a2a/protocol.d.ts.map +1 -0
  127. package/dist/server/a2a/store.cjs +25 -0
  128. package/dist/server/a2a/store.cjs.map +1 -0
  129. package/dist/server/a2a/store.d.ts +14 -0
  130. package/dist/server/a2a/store.d.ts.map +1 -0
  131. package/dist/server/a2a/store.js +23 -0
  132. package/dist/server/a2a/store.js.map +1 -0
  133. package/dist/server/a2a/tasks.d.ts +20 -0
  134. package/dist/server/a2a/tasks.d.ts.map +1 -0
  135. package/dist/server/handlers/a2a.cjs +21 -11
  136. package/dist/server/handlers/a2a.cjs.map +1 -0
  137. package/dist/server/handlers/a2a.d.ts +550 -6
  138. package/dist/server/handlers/a2a.d.ts.map +1 -0
  139. package/dist/server/handlers/a2a.js +3 -1
  140. package/dist/server/handlers/a2a.js.map +1 -0
  141. package/dist/server/handlers/agent-builder.cjs +80 -0
  142. package/dist/server/handlers/agent-builder.cjs.map +1 -0
  143. package/dist/server/handlers/agent-builder.d.ts +602 -0
  144. package/dist/server/handlers/agent-builder.d.ts.map +1 -0
  145. package/dist/server/handlers/agent-builder.js +3 -0
  146. package/dist/server/handlers/agent-builder.js.map +1 -0
  147. package/dist/server/handlers/agents.cjs +79 -13
  148. package/dist/server/handlers/agents.cjs.map +1 -0
  149. package/dist/server/handlers/agents.d.ts +3337 -6
  150. package/dist/server/handlers/agents.d.ts.map +1 -0
  151. package/dist/server/handlers/agents.js +3 -1
  152. package/dist/server/handlers/agents.js.map +1 -0
  153. package/dist/server/handlers/error.cjs +4 -2
  154. package/dist/server/handlers/error.cjs.map +1 -0
  155. package/dist/server/handlers/error.d.ts +2 -1
  156. package/dist/server/handlers/error.d.ts.map +1 -0
  157. package/dist/server/handlers/error.js +3 -1
  158. package/dist/server/handlers/error.js.map +1 -0
  159. package/dist/server/handlers/logs.cjs +9 -7
  160. package/dist/server/handlers/logs.cjs.map +1 -0
  161. package/dist/server/handlers/logs.d.ts +142 -3
  162. package/dist/server/handlers/logs.d.ts.map +1 -0
  163. package/dist/server/handlers/logs.js +3 -1
  164. package/dist/server/handlers/logs.js.map +1 -0
  165. package/dist/server/handlers/memory.cjs +75 -21
  166. package/dist/server/handlers/memory.cjs.map +1 -0
  167. package/dist/server/handlers/memory.d.ts +949 -10
  168. package/dist/server/handlers/memory.d.ts.map +1 -0
  169. package/dist/server/handlers/memory.js +3 -1
  170. package/dist/server/handlers/memory.js.map +1 -0
  171. package/dist/server/handlers/observability.cjs +40 -0
  172. package/dist/server/handlers/observability.cjs.map +1 -0
  173. package/dist/server/handlers/observability.d.ts +156 -0
  174. package/dist/server/handlers/observability.d.ts.map +1 -0
  175. package/dist/server/handlers/observability.js +3 -0
  176. package/dist/server/handlers/observability.js.map +1 -0
  177. package/dist/server/handlers/scores.cjs +32 -0
  178. package/dist/server/handlers/scores.cjs.map +1 -0
  179. package/dist/server/handlers/scores.d.ts +121 -0
  180. package/dist/server/handlers/scores.d.ts.map +1 -0
  181. package/dist/server/handlers/scores.js +3 -0
  182. package/dist/server/handlers/scores.js.map +1 -0
  183. package/dist/server/handlers/test-utils.cjs +15 -0
  184. package/dist/server/handlers/test-utils.cjs.map +1 -0
  185. package/dist/server/handlers/test-utils.d.ts +6 -0
  186. package/dist/server/handlers/test-utils.d.ts.map +1 -0
  187. package/dist/server/handlers/test-utils.js +13 -0
  188. package/dist/server/handlers/test-utils.js.map +1 -0
  189. package/dist/server/handlers/tools.cjs +15 -9
  190. package/dist/server/handlers/tools.cjs.map +1 -0
  191. package/dist/server/handlers/tools.d.ts +71 -4
  192. package/dist/server/handlers/tools.d.ts.map +1 -0
  193. package/dist/server/handlers/tools.js +3 -1
  194. package/dist/server/handlers/tools.js.map +1 -0
  195. package/dist/server/handlers/utils.cjs +16 -2
  196. package/dist/server/handlers/utils.cjs.map +1 -0
  197. package/dist/server/handlers/utils.d.ts +13 -1
  198. package/dist/server/handlers/utils.d.ts.map +1 -0
  199. package/dist/server/handlers/utils.js +3 -1
  200. package/dist/server/handlers/utils.js.map +1 -0
  201. package/dist/server/handlers/vector.cjs +33 -7
  202. package/dist/server/handlers/vector.cjs.map +1 -0
  203. package/dist/server/handlers/vector.d.ts +135 -6
  204. package/dist/server/handlers/vector.d.ts.map +1 -0
  205. package/dist/server/handlers/vector.js +3 -1
  206. package/dist/server/handlers/vector.js.map +1 -0
  207. package/dist/server/handlers/voice.cjs +23 -9
  208. package/dist/server/handlers/voice.cjs.map +1 -0
  209. package/dist/server/handlers/voice.d.ts +82 -4
  210. package/dist/server/handlers/voice.d.ts.map +1 -0
  211. package/dist/server/handlers/voice.js +3 -1
  212. package/dist/server/handlers/voice.js.map +1 -0
  213. package/dist/server/handlers/workflows.cjs +47 -29
  214. package/dist/server/handlers/workflows.cjs.map +1 -0
  215. package/dist/server/handlers/workflows.d.ts +611 -14
  216. package/dist/server/handlers/workflows.d.ts.map +1 -0
  217. package/dist/server/handlers/workflows.js +3 -1
  218. package/dist/server/handlers/workflows.js.map +1 -0
  219. package/dist/server/handlers.cjs +33 -31
  220. package/dist/server/handlers.cjs.map +1 -0
  221. package/dist/server/handlers.d.ts +12 -11
  222. package/dist/server/handlers.d.ts.map +1 -0
  223. package/dist/server/handlers.js +13 -11
  224. package/dist/server/handlers.js.map +1 -0
  225. package/dist/server/http-exception.d.ts +82 -0
  226. package/dist/server/http-exception.d.ts.map +1 -0
  227. package/dist/server/schemas/a2a.d.ts +786 -0
  228. package/dist/server/schemas/a2a.d.ts.map +1 -0
  229. package/dist/server/schemas/agent-builder.d.ts +195 -0
  230. package/dist/server/schemas/agent-builder.d.ts.map +1 -0
  231. package/dist/server/schemas/agents.d.ts +1375 -0
  232. package/dist/server/schemas/agents.d.ts.map +1 -0
  233. package/dist/server/schemas/common.d.ts +165 -0
  234. package/dist/server/schemas/common.d.ts.map +1 -0
  235. package/dist/server/schemas/logs.d.ts +124 -0
  236. package/dist/server/schemas/logs.d.ts.map +1 -0
  237. package/dist/server/schemas/memory.d.ts +998 -0
  238. package/dist/server/schemas/memory.d.ts.map +1 -0
  239. package/dist/server/schemas/observability.d.ts +402 -0
  240. package/dist/server/schemas/observability.d.ts.map +1 -0
  241. package/dist/server/schemas/scores.d.ts +259 -0
  242. package/dist/server/schemas/scores.d.ts.map +1 -0
  243. package/dist/server/schemas/vectors.d.ts +107 -0
  244. package/dist/server/schemas/vectors.d.ts.map +1 -0
  245. package/dist/server/schemas/workflows.d.ts +505 -0
  246. package/dist/server/schemas/workflows.d.ts.map +1 -0
  247. package/dist/server/server-adapter/index.cjs +323 -0
  248. package/dist/server/server-adapter/index.cjs.map +1 -0
  249. package/dist/server/server-adapter/index.d.ts +52 -0
  250. package/dist/server/server-adapter/index.d.ts.map +1 -0
  251. package/dist/server/server-adapter/index.js +309 -0
  252. package/dist/server/server-adapter/index.js.map +1 -0
  253. package/dist/server/server-adapter/openapi-utils.d.ts +59 -0
  254. package/dist/server/server-adapter/openapi-utils.d.ts.map +1 -0
  255. package/dist/server/server-adapter/routes/a2a.d.ts +3 -0
  256. package/dist/server/server-adapter/routes/a2a.d.ts.map +1 -0
  257. package/dist/server/server-adapter/routes/agent-builder.d.ts +3 -0
  258. package/dist/server/server-adapter/routes/agent-builder.d.ts.map +1 -0
  259. package/dist/server/server-adapter/routes/agents.d.ts +3 -0
  260. package/dist/server/server-adapter/routes/agents.d.ts.map +1 -0
  261. package/dist/server/server-adapter/routes/index.d.ts +41 -0
  262. package/dist/server/server-adapter/routes/index.d.ts.map +1 -0
  263. package/dist/server/server-adapter/routes/legacy.d.ts +7 -0
  264. package/dist/server/server-adapter/routes/legacy.d.ts.map +1 -0
  265. package/dist/server/server-adapter/routes/logs.d.ts +3 -0
  266. package/dist/server/server-adapter/routes/logs.d.ts.map +1 -0
  267. package/dist/server/server-adapter/routes/memory.d.ts +3 -0
  268. package/dist/server/server-adapter/routes/memory.d.ts.map +1 -0
  269. package/dist/server/server-adapter/routes/observability.d.ts +3 -0
  270. package/dist/server/server-adapter/routes/observability.d.ts.map +1 -0
  271. package/dist/server/server-adapter/routes/route-builder.d.ts +52 -0
  272. package/dist/server/server-adapter/routes/route-builder.d.ts.map +1 -0
  273. package/dist/server/server-adapter/routes/scorers.d.ts +3 -0
  274. package/dist/server/server-adapter/routes/scorers.d.ts.map +1 -0
  275. package/dist/server/server-adapter/routes/stream-types.d.ts +10 -0
  276. package/dist/server/server-adapter/routes/stream-types.d.ts.map +1 -0
  277. package/dist/server/server-adapter/routes/tools.d.ts +3 -0
  278. package/dist/server/server-adapter/routes/tools.d.ts.map +1 -0
  279. package/dist/server/server-adapter/routes/vectors.d.ts +3 -0
  280. package/dist/server/server-adapter/routes/vectors.d.ts.map +1 -0
  281. package/dist/server/server-adapter/routes/workflows.d.ts +3 -0
  282. package/dist/server/server-adapter/routes/workflows.d.ts.map +1 -0
  283. package/dist/server/types.d.ts +10 -0
  284. package/dist/server/types.d.ts.map +1 -0
  285. package/dist/server/utils.d.ts +45 -0
  286. package/dist/server/utils.d.ts.map +1 -0
  287. package/dist/token-375W3LEI.cjs +64 -0
  288. package/dist/token-375W3LEI.cjs.map +1 -0
  289. package/dist/token-C3IMNCC4.js +62 -0
  290. package/dist/token-C3IMNCC4.js.map +1 -0
  291. package/dist/token-util-CV3RRG6K.cjs +9 -0
  292. package/dist/token-util-CV3RRG6K.cjs.map +1 -0
  293. package/dist/token-util-E5QO2RCL.js +7 -0
  294. package/dist/token-util-E5QO2RCL.js.map +1 -0
  295. package/package.json +57 -16
  296. package/dist/_tsup-dts-rollup.d.cts +0 -1107
  297. package/dist/_tsup-dts-rollup.d.ts +0 -1107
  298. package/dist/chunk-2SLFAFTR.cjs +0 -148
  299. package/dist/chunk-3CNDE7QY.cjs +0 -308
  300. package/dist/chunk-4D66QEKC.js +0 -81
  301. package/dist/chunk-5PQQ42EZ.js +0 -320
  302. package/dist/chunk-75ZPJI57.cjs +0 -9
  303. package/dist/chunk-7TP2LX5L.cjs +0 -129
  304. package/dist/chunk-B2PAS2IB.cjs +0 -514
  305. package/dist/chunk-BK4XT6EG.js +0 -270
  306. package/dist/chunk-CCGRCYWJ.cjs +0 -18
  307. package/dist/chunk-CRCR3ZUK.js +0 -142
  308. package/dist/chunk-FRVBFMO2.cjs +0 -128
  309. package/dist/chunk-G7KH752Y.cjs +0 -145
  310. package/dist/chunk-GHC4YV6R.js +0 -504
  311. package/dist/chunk-H7DMHBKY.js +0 -498
  312. package/dist/chunk-JMLYCXMK.cjs +0 -332
  313. package/dist/chunk-KHZKYUNR.js +0 -112
  314. package/dist/chunk-KOHWJYJT.js +0 -296
  315. package/dist/chunk-LI436ITD.cjs +0 -2042
  316. package/dist/chunk-LRCAAFUA.js +0 -122
  317. package/dist/chunk-LZ3VJXSO.cjs +0 -278
  318. package/dist/chunk-MEGCYGBU.js +0 -2039
  319. package/dist/chunk-MLKGABMK.js +0 -7
  320. package/dist/chunk-QGX47B5D.cjs +0 -86
  321. package/dist/chunk-RG473F6Y.js +0 -141
  322. package/dist/chunk-RHSWAXKB.cjs +0 -118
  323. package/dist/chunk-RSEO4XPX.js +0 -16
  324. package/dist/chunk-SDPGVWQJ.cjs +0 -512
  325. package/dist/chunk-WNVFNNWN.js +0 -121
  326. package/dist/index.d.cts +0 -1
  327. package/dist/server/handlers/a2a.d.cts +0 -6
  328. package/dist/server/handlers/agents.d.cts +0 -6
  329. package/dist/server/handlers/error.d.cts +0 -1
  330. package/dist/server/handlers/legacyWorkflows.cjs +0 -46
  331. package/dist/server/handlers/legacyWorkflows.d.cts +0 -10
  332. package/dist/server/handlers/legacyWorkflows.d.ts +0 -10
  333. package/dist/server/handlers/legacyWorkflows.js +0 -1
  334. package/dist/server/handlers/logs.d.cts +0 -3
  335. package/dist/server/handlers/memory.d.cts +0 -10
  336. package/dist/server/handlers/network.cjs +0 -22
  337. package/dist/server/handlers/network.d.cts +0 -4
  338. package/dist/server/handlers/network.d.ts +0 -4
  339. package/dist/server/handlers/network.js +0 -1
  340. package/dist/server/handlers/telemetry.cjs +0 -14
  341. package/dist/server/handlers/telemetry.d.cts +0 -2
  342. package/dist/server/handlers/telemetry.d.ts +0 -2
  343. package/dist/server/handlers/telemetry.js +0 -1
  344. package/dist/server/handlers/tools.d.cts +0 -4
  345. package/dist/server/handlers/utils.d.cts +0 -1
  346. package/dist/server/handlers/vNextNetwork.cjs +0 -218
  347. package/dist/server/handlers/vNextNetwork.d.cts +0 -6
  348. package/dist/server/handlers/vNextNetwork.d.ts +0 -6
  349. package/dist/server/handlers/vNextNetwork.js +0 -211
  350. package/dist/server/handlers/vector.d.cts +0 -6
  351. package/dist/server/handlers/voice.d.cts +0 -4
  352. package/dist/server/handlers/workflows.d.cts +0 -14
  353. package/dist/server/handlers.d.cts +0 -11
@@ -1,498 +0,0 @@
1
- import { stringify, esm_default } from './chunk-MEGCYGBU.js';
2
- import { handleError } from './chunk-LF7P5PLR.js';
3
- import { HTTPException } from './chunk-LCM566I4.js';
4
- import { __export } from './chunk-MLKGABMK.js';
5
- import { ReadableStream } from 'stream/web';
6
-
7
- // src/server/handlers/workflows.ts
8
- var workflows_exports = {};
9
- __export(workflows_exports, {
10
- cancelWorkflowRunHandler: () => cancelWorkflowRunHandler,
11
- createWorkflowRunHandler: () => createWorkflowRunHandler,
12
- getWorkflowByIdHandler: () => getWorkflowByIdHandler,
13
- getWorkflowRunByIdHandler: () => getWorkflowRunByIdHandler,
14
- getWorkflowRunExecutionResultHandler: () => getWorkflowRunExecutionResultHandler,
15
- getWorkflowRunsHandler: () => getWorkflowRunsHandler,
16
- getWorkflowsHandler: () => getWorkflowsHandler,
17
- resumeAsyncWorkflowHandler: () => resumeAsyncWorkflowHandler,
18
- resumeWorkflowHandler: () => resumeWorkflowHandler,
19
- sendWorkflowRunEventHandler: () => sendWorkflowRunEventHandler,
20
- startAsyncWorkflowHandler: () => startAsyncWorkflowHandler,
21
- startWorkflowRunHandler: () => startWorkflowRunHandler,
22
- streamWorkflowHandler: () => streamWorkflowHandler,
23
- watchWorkflowHandler: () => watchWorkflowHandler
24
- });
25
- function getSteps(steps, path) {
26
- return Object.entries(steps).reduce((acc, [key, step]) => {
27
- const fullKey = path ? `${path}.${key}` : key;
28
- acc[fullKey] = {
29
- id: step.id,
30
- description: step.description,
31
- inputSchema: step.inputSchema ? stringify(esm_default(step.inputSchema)) : void 0,
32
- outputSchema: step.outputSchema ? stringify(esm_default(step.outputSchema)) : void 0,
33
- resumeSchema: step.resumeSchema ? stringify(esm_default(step.resumeSchema)) : void 0,
34
- suspendSchema: step.suspendSchema ? stringify(esm_default(step.suspendSchema)) : void 0,
35
- isWorkflow: step.component === "WORKFLOW"
36
- };
37
- if (step.component === "WORKFLOW" && step.steps) {
38
- const nestedSteps = getSteps(step.steps, fullKey) || {};
39
- acc = { ...acc, ...nestedSteps };
40
- }
41
- return acc;
42
- }, {});
43
- }
44
- async function getWorkflowsHandler({ mastra }) {
45
- try {
46
- const workflows = mastra.getWorkflows({ serialized: false });
47
- const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
48
- acc[key] = {
49
- name: workflow.name,
50
- description: workflow.description,
51
- steps: Object.entries(workflow.steps).reduce((acc2, [key2, step]) => {
52
- acc2[key2] = {
53
- id: step.id,
54
- description: step.description,
55
- inputSchema: step.inputSchema ? stringify(esm_default(step.inputSchema)) : void 0,
56
- outputSchema: step.outputSchema ? stringify(esm_default(step.outputSchema)) : void 0,
57
- resumeSchema: step.resumeSchema ? stringify(esm_default(step.resumeSchema)) : void 0,
58
- suspendSchema: step.suspendSchema ? stringify(esm_default(step.suspendSchema)) : void 0
59
- };
60
- return acc2;
61
- }, {}),
62
- allSteps: getSteps(workflow.steps) || {},
63
- stepGraph: workflow.serializedStepGraph,
64
- inputSchema: workflow.inputSchema ? stringify(esm_default(workflow.inputSchema)) : void 0,
65
- outputSchema: workflow.outputSchema ? stringify(esm_default(workflow.outputSchema)) : void 0
66
- };
67
- return acc;
68
- }, {});
69
- return _workflows;
70
- } catch (error) {
71
- return handleError(error, "Error getting workflows");
72
- }
73
- }
74
- async function getWorkflowsFromSystem({ mastra, workflowId }) {
75
- const logger = mastra.getLogger();
76
- if (!workflowId) {
77
- throw new HTTPException(400, { message: "Workflow ID is required" });
78
- }
79
- let workflow;
80
- try {
81
- workflow = mastra.getWorkflow(workflowId);
82
- } catch (error) {
83
- logger.debug("Error getting workflow, searching agents for workflow", error);
84
- }
85
- if (!workflow) {
86
- logger.debug("Workflow not found, searching agents for workflow", { workflowId });
87
- const agents = mastra.getAgents();
88
- if (Object.keys(agents || {}).length) {
89
- for (const [_, agent] of Object.entries(agents)) {
90
- try {
91
- const workflows = await agent.getWorkflows();
92
- if (workflows[workflowId]) {
93
- workflow = workflows[workflowId];
94
- break;
95
- }
96
- break;
97
- } catch (error) {
98
- logger.debug("Error getting workflow from agent", error);
99
- }
100
- }
101
- }
102
- }
103
- if (!workflow) {
104
- throw new HTTPException(404, { message: "Workflow not found" });
105
- }
106
- return { workflow };
107
- }
108
- async function getWorkflowByIdHandler({ mastra, workflowId }) {
109
- try {
110
- if (!workflowId) {
111
- throw new HTTPException(400, { message: "Workflow ID is required" });
112
- }
113
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
114
- if (!workflow) {
115
- throw new HTTPException(404, { message: "Workflow not found" });
116
- }
117
- return {
118
- steps: Object.entries(workflow.steps).reduce((acc, [key, step]) => {
119
- acc[key] = {
120
- id: step.id,
121
- description: step.description,
122
- inputSchema: step.inputSchema ? stringify(esm_default(step.inputSchema)) : void 0,
123
- outputSchema: step.outputSchema ? stringify(esm_default(step.outputSchema)) : void 0,
124
- resumeSchema: step.resumeSchema ? stringify(esm_default(step.resumeSchema)) : void 0,
125
- suspendSchema: step.suspendSchema ? stringify(esm_default(step.suspendSchema)) : void 0
126
- };
127
- return acc;
128
- }, {}),
129
- allSteps: getSteps(workflow.steps) || {},
130
- name: workflow.name,
131
- description: workflow.description,
132
- stepGraph: workflow.serializedStepGraph,
133
- inputSchema: workflow.inputSchema ? stringify(esm_default(workflow.inputSchema)) : void 0,
134
- outputSchema: workflow.outputSchema ? stringify(esm_default(workflow.outputSchema)) : void 0
135
- };
136
- } catch (error) {
137
- return handleError(error, "Error getting workflow");
138
- }
139
- }
140
- async function getWorkflowRunByIdHandler({
141
- mastra,
142
- workflowId,
143
- runId
144
- }) {
145
- try {
146
- if (!workflowId) {
147
- throw new HTTPException(400, { message: "Workflow ID is required" });
148
- }
149
- if (!runId) {
150
- throw new HTTPException(400, { message: "Run ID is required" });
151
- }
152
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
153
- if (!workflow) {
154
- throw new HTTPException(404, { message: "Workflow not found" });
155
- }
156
- const run = await workflow.getWorkflowRunById(runId);
157
- if (!run) {
158
- throw new HTTPException(404, { message: "Workflow run not found" });
159
- }
160
- return run;
161
- } catch (error) {
162
- return handleError(error, "Error getting workflow run");
163
- }
164
- }
165
- async function getWorkflowRunExecutionResultHandler({
166
- mastra,
167
- workflowId,
168
- runId
169
- }) {
170
- try {
171
- if (!workflowId) {
172
- throw new HTTPException(400, { message: "Workflow ID is required" });
173
- }
174
- if (!runId) {
175
- throw new HTTPException(400, { message: "Run ID is required" });
176
- }
177
- const workflow = mastra.getWorkflow(workflowId);
178
- if (!workflow) {
179
- throw new HTTPException(404, { message: "Workflow not found" });
180
- }
181
- const executionResult = await workflow.getWorkflowRunExecutionResult(runId);
182
- if (!executionResult) {
183
- throw new HTTPException(404, { message: "Workflow run execution result not found" });
184
- }
185
- return executionResult;
186
- } catch (error) {
187
- return handleError(error, "Error getting workflow run execution result");
188
- }
189
- }
190
- async function createWorkflowRunHandler({
191
- mastra,
192
- workflowId,
193
- runId: prevRunId
194
- }) {
195
- try {
196
- if (!workflowId) {
197
- throw new HTTPException(400, { message: "Workflow ID is required" });
198
- }
199
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
200
- if (!workflow) {
201
- throw new HTTPException(404, { message: "Workflow not found" });
202
- }
203
- const run = await workflow.createRunAsync({ runId: prevRunId });
204
- return { runId: run.runId };
205
- } catch (error) {
206
- return handleError(error, "Error creating workflow run");
207
- }
208
- }
209
- async function startAsyncWorkflowHandler({
210
- mastra,
211
- runtimeContext,
212
- workflowId,
213
- runId,
214
- inputData
215
- }) {
216
- try {
217
- if (!workflowId) {
218
- throw new HTTPException(400, { message: "Workflow ID is required" });
219
- }
220
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
221
- if (!workflow) {
222
- throw new HTTPException(404, { message: "Workflow not found" });
223
- }
224
- const _run = await workflow.createRunAsync({ runId });
225
- const result = await _run.start({
226
- inputData,
227
- runtimeContext
228
- });
229
- return result;
230
- } catch (error) {
231
- return handleError(error, "Error starting async workflow");
232
- }
233
- }
234
- async function startWorkflowRunHandler({
235
- mastra,
236
- runtimeContext,
237
- workflowId,
238
- runId,
239
- inputData
240
- }) {
241
- try {
242
- if (!workflowId) {
243
- throw new HTTPException(400, { message: "Workflow ID is required" });
244
- }
245
- if (!runId) {
246
- throw new HTTPException(400, { message: "runId required to start run" });
247
- }
248
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
249
- if (!workflow) {
250
- throw new HTTPException(404, { message: "Workflow not found" });
251
- }
252
- const run = await workflow.getWorkflowRunById(runId);
253
- if (!run) {
254
- throw new HTTPException(404, { message: "Workflow run not found" });
255
- }
256
- const _run = await workflow.createRunAsync({ runId });
257
- void _run.start({
258
- inputData,
259
- runtimeContext
260
- });
261
- return { message: "Workflow run started" };
262
- } catch (e) {
263
- return handleError(e, "Error starting workflow run");
264
- }
265
- }
266
- async function watchWorkflowHandler({
267
- mastra,
268
- workflowId,
269
- runId
270
- }) {
271
- try {
272
- if (!workflowId) {
273
- throw new HTTPException(400, { message: "Workflow ID is required" });
274
- }
275
- if (!runId) {
276
- throw new HTTPException(400, { message: "runId required to watch workflow" });
277
- }
278
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
279
- if (!workflow) {
280
- throw new HTTPException(404, { message: "Workflow not found" });
281
- }
282
- const run = await workflow.getWorkflowRunById(runId);
283
- if (!run) {
284
- throw new HTTPException(404, { message: "Workflow run not found" });
285
- }
286
- const _run = await workflow.createRunAsync({ runId });
287
- let unwatch;
288
- let asyncRef = null;
289
- const stream = new ReadableStream({
290
- start(controller) {
291
- unwatch = _run.watch(({ type, payload, eventTimestamp }) => {
292
- controller.enqueue(JSON.stringify({ type, payload, eventTimestamp, runId }));
293
- if (asyncRef) {
294
- clearImmediate(asyncRef);
295
- asyncRef = null;
296
- }
297
- asyncRef = setImmediate(async () => {
298
- const runDone = payload.workflowState.status !== "running";
299
- if (runDone) {
300
- controller.close();
301
- unwatch?.();
302
- }
303
- });
304
- });
305
- },
306
- cancel() {
307
- unwatch?.();
308
- }
309
- });
310
- return stream;
311
- } catch (error) {
312
- return handleError(error, "Error watching workflow");
313
- }
314
- }
315
- async function streamWorkflowHandler({
316
- mastra,
317
- runtimeContext,
318
- workflowId,
319
- runId,
320
- inputData
321
- }) {
322
- try {
323
- if (!workflowId) {
324
- throw new HTTPException(400, { message: "Workflow ID is required" });
325
- }
326
- if (!runId) {
327
- throw new HTTPException(400, { message: "runId required to resume workflow" });
328
- }
329
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
330
- if (!workflow) {
331
- throw new HTTPException(404, { message: "Workflow not found" });
332
- }
333
- const run = await workflow.createRunAsync({ runId });
334
- const result = run.stream({
335
- inputData,
336
- runtimeContext
337
- });
338
- return result;
339
- } catch (error) {
340
- return handleError(error, "Error executing workflow");
341
- }
342
- }
343
- async function resumeAsyncWorkflowHandler({
344
- mastra,
345
- workflowId,
346
- runId,
347
- body,
348
- runtimeContext
349
- }) {
350
- try {
351
- if (!workflowId) {
352
- throw new HTTPException(400, { message: "Workflow ID is required" });
353
- }
354
- if (!runId) {
355
- throw new HTTPException(400, { message: "runId required to resume workflow" });
356
- }
357
- if (!body.step) {
358
- throw new HTTPException(400, { message: "step required to resume workflow" });
359
- }
360
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
361
- if (!workflow) {
362
- throw new HTTPException(404, { message: "Workflow not found" });
363
- }
364
- const run = await workflow.getWorkflowRunById(runId);
365
- if (!run) {
366
- throw new HTTPException(404, { message: "Workflow run not found" });
367
- }
368
- const _run = await workflow.createRunAsync({ runId });
369
- const result = await _run.resume({
370
- step: body.step,
371
- resumeData: body.resumeData,
372
- runtimeContext
373
- });
374
- return result;
375
- } catch (error) {
376
- return handleError(error, "Error resuming workflow step");
377
- }
378
- }
379
- async function resumeWorkflowHandler({
380
- mastra,
381
- workflowId,
382
- runId,
383
- body,
384
- runtimeContext
385
- }) {
386
- try {
387
- if (!workflowId) {
388
- throw new HTTPException(400, { message: "Workflow ID is required" });
389
- }
390
- if (!runId) {
391
- throw new HTTPException(400, { message: "runId required to resume workflow" });
392
- }
393
- if (!body.step) {
394
- throw new HTTPException(400, { message: "step required to resume workflow" });
395
- }
396
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
397
- if (!workflow) {
398
- throw new HTTPException(404, { message: "Workflow not found" });
399
- }
400
- const run = await workflow.getWorkflowRunById(runId);
401
- if (!run) {
402
- throw new HTTPException(404, { message: "Workflow run not found" });
403
- }
404
- const _run = await workflow.createRunAsync({ runId });
405
- void _run.resume({
406
- step: body.step,
407
- resumeData: body.resumeData,
408
- runtimeContext
409
- });
410
- return { message: "Workflow run resumed" };
411
- } catch (error) {
412
- return handleError(error, "Error resuming workflow");
413
- }
414
- }
415
- async function getWorkflowRunsHandler({
416
- mastra,
417
- workflowId,
418
- fromDate,
419
- toDate,
420
- limit,
421
- offset,
422
- resourceId
423
- }) {
424
- try {
425
- if (!workflowId) {
426
- throw new HTTPException(400, { message: "Workflow ID is required" });
427
- }
428
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
429
- if (!workflow) {
430
- throw new HTTPException(404, { message: "Workflow not found" });
431
- }
432
- const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
433
- runs: [],
434
- total: 0
435
- };
436
- return workflowRuns;
437
- } catch (error) {
438
- return handleError(error, "Error getting workflow runs");
439
- }
440
- }
441
- async function cancelWorkflowRunHandler({
442
- mastra,
443
- workflowId,
444
- runId
445
- }) {
446
- try {
447
- if (!workflowId) {
448
- throw new HTTPException(400, { message: "Workflow ID is required" });
449
- }
450
- if (!runId) {
451
- throw new HTTPException(400, { message: "runId required to cancel workflow run" });
452
- }
453
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
454
- if (!workflow) {
455
- throw new HTTPException(404, { message: "Workflow not found" });
456
- }
457
- const run = await workflow.getWorkflowRunById(runId);
458
- if (!run) {
459
- throw new HTTPException(404, { message: "Workflow run not found" });
460
- }
461
- const _run = await workflow.createRunAsync({ runId });
462
- await _run.cancel();
463
- return { message: "Workflow run cancelled" };
464
- } catch (error) {
465
- return handleError(error, "Error canceling workflow run");
466
- }
467
- }
468
- async function sendWorkflowRunEventHandler({
469
- mastra,
470
- workflowId,
471
- runId,
472
- event,
473
- data
474
- }) {
475
- try {
476
- if (!workflowId) {
477
- throw new HTTPException(400, { message: "Workflow ID is required" });
478
- }
479
- if (!runId) {
480
- throw new HTTPException(400, { message: "runId required to send workflow run event" });
481
- }
482
- const { workflow } = await getWorkflowsFromSystem({ mastra, workflowId });
483
- if (!workflow) {
484
- throw new HTTPException(404, { message: "Workflow not found" });
485
- }
486
- const run = await workflow.getWorkflowRunById(runId);
487
- if (!run) {
488
- throw new HTTPException(404, { message: "Workflow run not found" });
489
- }
490
- const _run = await workflow.createRunAsync({ runId });
491
- await _run.sendEvent(event, data);
492
- return { message: "Workflow run event sent" };
493
- } catch (error) {
494
- return handleError(error, "Error sending workflow run event");
495
- }
496
- }
497
-
498
- export { cancelWorkflowRunHandler, createWorkflowRunHandler, getWorkflowByIdHandler, getWorkflowRunByIdHandler, getWorkflowRunExecutionResultHandler, getWorkflowRunsHandler, getWorkflowsHandler, resumeAsyncWorkflowHandler, resumeWorkflowHandler, sendWorkflowRunEventHandler, startAsyncWorkflowHandler, startWorkflowRunHandler, streamWorkflowHandler, watchWorkflowHandler, workflows_exports };