@mastra/server 0.0.0-default-storage-virtual-file-20250410035748 → 0.0.0-dynamic-model-router-20251009204130

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 (277) hide show
  1. package/CHANGELOG.md +3969 -0
  2. package/LICENSE.md +15 -0
  3. package/README.md +45 -137
  4. package/dist/chunk-2PLXW4ZX.cjs +2777 -0
  5. package/dist/chunk-2PLXW4ZX.cjs.map +1 -0
  6. package/dist/chunk-2S4IMB6E.cjs +130 -0
  7. package/dist/chunk-2S4IMB6E.cjs.map +1 -0
  8. package/dist/chunk-3Q7FKRVX.cjs +682 -0
  9. package/dist/chunk-3Q7FKRVX.cjs.map +1 -0
  10. package/dist/chunk-3SNGNFUJ.cjs +128 -0
  11. package/dist/chunk-3SNGNFUJ.cjs.map +1 -0
  12. package/dist/{chunk-L7XE5QTW.js → chunk-4QCXUEAT.js} +11 -2
  13. package/dist/chunk-4QCXUEAT.js.map +1 -0
  14. package/dist/chunk-5BNQIYQN.js +189 -0
  15. package/dist/chunk-5BNQIYQN.js.map +1 -0
  16. package/dist/{chunk-DVPP5S6I.js → chunk-67GYDFSB.js} +35 -10
  17. package/dist/chunk-67GYDFSB.js.map +1 -0
  18. package/dist/{chunk-CWSDZEZG.cjs → chunk-6ZR275MD.cjs} +39 -13
  19. package/dist/chunk-6ZR275MD.cjs.map +1 -0
  20. package/dist/{chunk-FV45V6WC.cjs → chunk-7NADHFD2.cjs} +3 -7
  21. package/dist/chunk-7NADHFD2.cjs.map +1 -0
  22. package/dist/chunk-ABRFV4XP.js +83 -0
  23. package/dist/chunk-ABRFV4XP.js.map +1 -0
  24. package/dist/{chunk-YNSGUC2O.js → chunk-AHB4JCIQ.js} +58 -14
  25. package/dist/chunk-AHB4JCIQ.js.map +1 -0
  26. package/dist/chunk-BATEJLED.js +124 -0
  27. package/dist/chunk-BATEJLED.js.map +1 -0
  28. package/dist/chunk-CY4TP3FK.js +16 -0
  29. package/dist/chunk-CY4TP3FK.js.map +1 -0
  30. package/dist/chunk-DB63UMTV.js +660 -0
  31. package/dist/chunk-DB63UMTV.js.map +1 -0
  32. package/dist/{chunk-M56ECCHK.cjs → chunk-EP3JQDPD.cjs} +22 -19
  33. package/dist/chunk-EP3JQDPD.cjs.map +1 -0
  34. package/dist/chunk-FZNS32WJ.js +46 -0
  35. package/dist/chunk-FZNS32WJ.js.map +1 -0
  36. package/dist/chunk-G4PUALCE.cjs +28 -0
  37. package/dist/chunk-G4PUALCE.cjs.map +1 -0
  38. package/dist/chunk-GU4EWMZB.cjs +769 -0
  39. package/dist/chunk-GU4EWMZB.cjs.map +1 -0
  40. package/dist/chunk-HKW2536J.js +17477 -0
  41. package/dist/chunk-HKW2536J.js.map +1 -0
  42. package/dist/chunk-HPXAM2PG.js +477 -0
  43. package/dist/chunk-HPXAM2PG.js.map +1 -0
  44. package/dist/chunk-I3C4ODGV.cjs +335 -0
  45. package/dist/chunk-I3C4ODGV.cjs.map +1 -0
  46. package/dist/chunk-KJJA7GPJ.cjs +17513 -0
  47. package/dist/chunk-KJJA7GPJ.cjs.map +1 -0
  48. package/dist/chunk-LF2ZLOFP.js +767 -0
  49. package/dist/chunk-LF2ZLOFP.js.map +1 -0
  50. package/dist/{chunk-ILW7XYNJ.js → chunk-LLUOPR3J.js} +99 -72
  51. package/dist/chunk-LLUOPR3J.js.map +1 -0
  52. package/dist/chunk-LNT5N7XW.cjs +197 -0
  53. package/dist/chunk-LNT5N7XW.cjs.map +1 -0
  54. package/dist/chunk-LPM6BBAX.cjs +1043 -0
  55. package/dist/chunk-LPM6BBAX.cjs.map +1 -0
  56. package/dist/chunk-LV66LYKV.js +662 -0
  57. package/dist/chunk-LV66LYKV.js.map +1 -0
  58. package/dist/{chunk-TRDNDNGQ.js → chunk-MMROOK5J.js} +4 -7
  59. package/dist/chunk-MMROOK5J.js.map +1 -0
  60. package/dist/chunk-MQDBNHBT.cjs +680 -0
  61. package/dist/chunk-MQDBNHBT.cjs.map +1 -0
  62. package/dist/{chunk-4JINXASC.js → chunk-MYR4PVGN.js} +7 -4
  63. package/dist/chunk-MYR4PVGN.js.map +1 -0
  64. package/dist/chunk-O7I5CWRX.cjs +44 -0
  65. package/dist/chunk-O7I5CWRX.cjs.map +1 -0
  66. package/dist/chunk-OYL5TBJW.cjs +48 -0
  67. package/dist/chunk-OYL5TBJW.cjs.map +1 -0
  68. package/dist/chunk-PR4QN5HX.js +39 -0
  69. package/dist/chunk-PR4QN5HX.js.map +1 -0
  70. package/dist/{chunk-3RVHWGWO.js → chunk-QQXMIP6C.js} +49 -22
  71. package/dist/chunk-QQXMIP6C.js.map +1 -0
  72. package/dist/chunk-RE4RPXT2.cjs +18 -0
  73. package/dist/chunk-RE4RPXT2.cjs.map +1 -0
  74. package/dist/chunk-RQK4FQUD.js +1012 -0
  75. package/dist/chunk-RQK4FQUD.js.map +1 -0
  76. package/dist/chunk-SIW6CYO3.js +254 -0
  77. package/dist/chunk-SIW6CYO3.js.map +1 -0
  78. package/dist/chunk-TOP25AIO.cjs +485 -0
  79. package/dist/chunk-TOP25AIO.cjs.map +1 -0
  80. package/dist/chunk-TRGAMKHX.cjs +167 -0
  81. package/dist/chunk-TRGAMKHX.cjs.map +1 -0
  82. package/dist/chunk-VY4ENABS.cjs +135 -0
  83. package/dist/chunk-VY4ENABS.cjs.map +1 -0
  84. package/dist/chunk-WHABYJRY.js +551 -0
  85. package/dist/chunk-WHABYJRY.js.map +1 -0
  86. package/dist/chunk-XN74I6VW.cjs +88 -0
  87. package/dist/chunk-XN74I6VW.cjs.map +1 -0
  88. package/dist/chunk-XVPBGW6Y.cjs +256 -0
  89. package/dist/chunk-XVPBGW6Y.cjs.map +1 -0
  90. package/dist/chunk-YJU744I4.cjs +568 -0
  91. package/dist/chunk-YJU744I4.cjs.map +1 -0
  92. package/dist/chunk-YWOK4F5A.js +131 -0
  93. package/dist/chunk-YWOK4F5A.js.map +1 -0
  94. package/dist/chunk-ZULZ2752.js +2774 -0
  95. package/dist/chunk-ZULZ2752.js.map +1 -0
  96. package/dist/dist-4MVGNSRL.cjs +1150 -0
  97. package/dist/dist-4MVGNSRL.cjs.map +1 -0
  98. package/dist/dist-FZYCV3VB.cjs +940 -0
  99. package/dist/dist-FZYCV3VB.cjs.map +1 -0
  100. package/dist/dist-G2BYZJOC.cjs +928 -0
  101. package/dist/dist-G2BYZJOC.cjs.map +1 -0
  102. package/dist/dist-P4MXBQ3U.cjs +16 -0
  103. package/dist/dist-P4MXBQ3U.cjs.map +1 -0
  104. package/dist/dist-PQZUVLPC.js +937 -0
  105. package/dist/dist-PQZUVLPC.js.map +1 -0
  106. package/dist/dist-R7WYX6LC.js +925 -0
  107. package/dist/dist-R7WYX6LC.js.map +1 -0
  108. package/dist/dist-RFMYFILX.cjs +764 -0
  109. package/dist/dist-RFMYFILX.cjs.map +1 -0
  110. package/dist/dist-X7XR3M3Z.js +1147 -0
  111. package/dist/dist-X7XR3M3Z.js.map +1 -0
  112. package/dist/dist-XVBSOGFK.js +761 -0
  113. package/dist/dist-XVBSOGFK.js.map +1 -0
  114. package/dist/dist-YREX2TJT.js +3 -0
  115. package/dist/dist-YREX2TJT.js.map +1 -0
  116. package/dist/index.cjs +6 -0
  117. package/dist/index.cjs.map +1 -0
  118. package/dist/index.d.ts +1 -0
  119. package/dist/index.d.ts.map +1 -0
  120. package/dist/index.js +5 -0
  121. package/dist/index.js.map +1 -0
  122. package/dist/server/a2a/protocol.d.ts +8 -0
  123. package/dist/server/a2a/protocol.d.ts.map +1 -0
  124. package/dist/server/a2a/store.cjs +25 -0
  125. package/dist/server/a2a/store.cjs.map +1 -0
  126. package/dist/server/a2a/store.d.ts +14 -0
  127. package/dist/server/a2a/store.d.ts.map +1 -0
  128. package/dist/server/a2a/store.js +23 -0
  129. package/dist/server/a2a/store.js.map +1 -0
  130. package/dist/server/a2a/tasks.d.ts +20 -0
  131. package/dist/server/a2a/tasks.d.ts.map +1 -0
  132. package/dist/server/handlers/a2a.cjs +32 -0
  133. package/dist/server/handlers/a2a.cjs.map +1 -0
  134. package/dist/server/handlers/a2a.d.ts +68 -0
  135. package/dist/server/handlers/a2a.d.ts.map +1 -0
  136. package/dist/server/handlers/a2a.js +3 -0
  137. package/dist/server/handlers/a2a.js.map +1 -0
  138. package/dist/server/handlers/agent-builder.cjs +68 -0
  139. package/dist/server/handlers/agent-builder.cjs.map +1 -0
  140. package/dist/server/handlers/agent-builder.d.ts +94 -0
  141. package/dist/server/handlers/agent-builder.d.ts.map +1 -0
  142. package/dist/server/handlers/agent-builder.js +3 -0
  143. package/dist/server/handlers/agent-builder.js.map +1 -0
  144. package/dist/server/handlers/agents.cjs +57 -7
  145. package/dist/server/handlers/agents.cjs.map +1 -0
  146. package/dist/server/handlers/agents.d.ts +204 -6
  147. package/dist/server/handlers/agents.d.ts.map +1 -0
  148. package/dist/server/handlers/agents.js +3 -1
  149. package/dist/server/handlers/agents.js.map +1 -0
  150. package/dist/server/handlers/error.cjs +4 -2
  151. package/dist/server/handlers/error.cjs.map +1 -0
  152. package/dist/server/handlers/error.d.ts +2 -1
  153. package/dist/server/handlers/error.d.ts.map +1 -0
  154. package/dist/server/handlers/error.js +3 -1
  155. package/dist/server/handlers/error.js.map +1 -0
  156. package/dist/server/handlers/legacyWorkflows.cjs +48 -0
  157. package/dist/server/handlers/legacyWorkflows.cjs.map +1 -0
  158. package/dist/server/handlers/legacyWorkflows.d.ts +59 -0
  159. package/dist/server/handlers/legacyWorkflows.d.ts.map +1 -0
  160. package/dist/server/handlers/legacyWorkflows.js +3 -0
  161. package/dist/server/handlers/legacyWorkflows.js.map +1 -0
  162. package/dist/server/handlers/logs.cjs +6 -4
  163. package/dist/server/handlers/logs.cjs.map +1 -0
  164. package/dist/server/handlers/logs.d.ts +34 -3
  165. package/dist/server/handlers/logs.d.ts.map +1 -0
  166. package/dist/server/handlers/logs.js +3 -1
  167. package/dist/server/handlers/logs.js.map +1 -0
  168. package/dist/server/handlers/memory.cjs +39 -9
  169. package/dist/server/handlers/memory.cjs.map +1 -0
  170. package/dist/server/handlers/memory.d.ts +117 -8
  171. package/dist/server/handlers/memory.d.ts.map +1 -0
  172. package/dist/server/handlers/memory.js +3 -1
  173. package/dist/server/handlers/memory.js.map +1 -0
  174. package/dist/server/handlers/observability.cjs +24 -0
  175. package/dist/server/handlers/observability.cjs.map +1 -0
  176. package/dist/server/handlers/observability.d.ts +49 -0
  177. package/dist/server/handlers/observability.d.ts.map +1 -0
  178. package/dist/server/handlers/observability.js +3 -0
  179. package/dist/server/handlers/observability.js.map +1 -0
  180. package/dist/server/handlers/scores.cjs +32 -0
  181. package/dist/server/handlers/scores.cjs.map +1 -0
  182. package/dist/server/handlers/scores.d.ts +251 -0
  183. package/dist/server/handlers/scores.d.ts.map +1 -0
  184. package/dist/server/handlers/scores.js +3 -0
  185. package/dist/server/handlers/scores.js.map +1 -0
  186. package/dist/server/handlers/telemetry.cjs +9 -3
  187. package/dist/server/handlers/telemetry.cjs.map +1 -0
  188. package/dist/server/handlers/telemetry.d.ts +33 -2
  189. package/dist/server/handlers/telemetry.d.ts.map +1 -0
  190. package/dist/server/handlers/telemetry.js +3 -1
  191. package/dist/server/handlers/telemetry.js.map +1 -0
  192. package/dist/server/handlers/tools.cjs +11 -5
  193. package/dist/server/handlers/tools.cjs.map +1 -0
  194. package/dist/server/handlers/tools.d.ts +25 -4
  195. package/dist/server/handlers/tools.d.ts.map +1 -0
  196. package/dist/server/handlers/tools.js +3 -1
  197. package/dist/server/handlers/tools.js.map +1 -0
  198. package/dist/server/handlers/utils.cjs +8 -2
  199. package/dist/server/handlers/utils.cjs.map +1 -0
  200. package/dist/server/handlers/utils.d.ts +8 -1
  201. package/dist/server/handlers/utils.d.ts.map +1 -0
  202. package/dist/server/handlers/utils.js +3 -1
  203. package/dist/server/handlers/utils.js.map +1 -0
  204. package/dist/server/handlers/vector.cjs +9 -7
  205. package/dist/server/handlers/vector.cjs.map +1 -0
  206. package/dist/server/handlers/vector.d.ts +51 -6
  207. package/dist/server/handlers/vector.d.ts.map +1 -0
  208. package/dist/server/handlers/vector.js +3 -1
  209. package/dist/server/handlers/vector.js.map +1 -0
  210. package/dist/server/handlers/voice.cjs +10 -4
  211. package/dist/server/handlers/voice.cjs.map +1 -0
  212. package/dist/server/handlers/voice.d.ts +41 -3
  213. package/dist/server/handlers/voice.d.ts.map +1 -0
  214. package/dist/server/handlers/voice.js +3 -1
  215. package/dist/server/handlers/voice.js.map +1 -0
  216. package/dist/server/handlers/workflows.cjs +47 -13
  217. package/dist/server/handlers/workflows.cjs.map +1 -0
  218. package/dist/server/handlers/workflows.d.ts +91 -10
  219. package/dist/server/handlers/workflows.d.ts.map +1 -0
  220. package/dist/server/handlers/workflows.js +3 -1
  221. package/dist/server/handlers/workflows.js.map +1 -0
  222. package/dist/server/handlers.cjs +49 -27
  223. package/dist/server/handlers.cjs.map +1 -0
  224. package/dist/server/handlers.d.ts +14 -9
  225. package/dist/server/handlers.d.ts.map +1 -0
  226. package/dist/server/handlers.js +15 -9
  227. package/dist/server/handlers.js.map +1 -0
  228. package/dist/server/http-exception.d.ts +87 -0
  229. package/dist/server/http-exception.d.ts.map +1 -0
  230. package/dist/server/types.d.ts +10 -0
  231. package/dist/server/types.d.ts.map +1 -0
  232. package/dist/server/utils.d.ts +44 -0
  233. package/dist/server/utils.d.ts.map +1 -0
  234. package/dist/token-53CFGXUO.cjs +64 -0
  235. package/dist/token-53CFGXUO.cjs.map +1 -0
  236. package/dist/token-WAEKDUVY.js +62 -0
  237. package/dist/token-WAEKDUVY.js.map +1 -0
  238. package/dist/token-util-LY37VCIN.js +7 -0
  239. package/dist/token-util-LY37VCIN.js.map +1 -0
  240. package/dist/token-util-S4A355II.cjs +9 -0
  241. package/dist/token-util-S4A355II.cjs.map +1 -0
  242. package/package.json +43 -19
  243. package/LICENSE +0 -44
  244. package/dist/_tsup-dts-rollup.d.cts +0 -564
  245. package/dist/_tsup-dts-rollup.d.ts +0 -564
  246. package/dist/chunk-2FJURXCL.cjs +0 -213
  247. package/dist/chunk-2JQC6JWP.js +0 -46
  248. package/dist/chunk-2YONKUWB.js +0 -117
  249. package/dist/chunk-3AHQ5RGN.js +0 -11
  250. package/dist/chunk-4C3EPMMF.cjs +0 -122
  251. package/dist/chunk-5JOF627H.cjs +0 -123
  252. package/dist/chunk-A7DF4ETD.cjs +0 -100
  253. package/dist/chunk-BMA2ORRT.js +0 -152
  254. package/dist/chunk-GV52BII2.cjs +0 -160
  255. package/dist/chunk-QH6XWSXP.cjs +0 -5579
  256. package/dist/chunk-QN4KF3BH.cjs +0 -18
  257. package/dist/chunk-RBQASTUP.js +0 -203
  258. package/dist/chunk-VB7KH62D.cjs +0 -51
  259. package/dist/chunk-VK6FX47H.js +0 -5576
  260. package/dist/chunk-X37I6GZT.cjs +0 -308
  261. package/dist/chunk-ZLBRQFDD.cjs +0 -13
  262. package/dist/index.d.cts +0 -1
  263. package/dist/server/handlers/agents.d.cts +0 -6
  264. package/dist/server/handlers/error.d.cts +0 -1
  265. package/dist/server/handlers/logs.d.cts +0 -3
  266. package/dist/server/handlers/memory.d.cts +0 -8
  267. package/dist/server/handlers/network.cjs +0 -22
  268. package/dist/server/handlers/network.d.cts +0 -4
  269. package/dist/server/handlers/network.d.ts +0 -4
  270. package/dist/server/handlers/network.js +0 -1
  271. package/dist/server/handlers/telemetry.d.cts +0 -2
  272. package/dist/server/handlers/tools.d.cts +0 -4
  273. package/dist/server/handlers/utils.d.cts +0 -1
  274. package/dist/server/handlers/vector.d.cts +0 -6
  275. package/dist/server/handlers/voice.d.cts +0 -3
  276. package/dist/server/handlers/workflows.d.cts +0 -10
  277. package/dist/server/handlers.d.cts +0 -9
package/LICENSE DELETED
@@ -1,44 +0,0 @@
1
- Elastic License 2.0 (ELv2)
2
-
3
- **Acceptance**
4
- By using the software, you agree to all of the terms and conditions below.
5
-
6
- **Copyright License**
7
- The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
8
-
9
- **Limitations**
10
- You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
11
-
12
- You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
13
-
14
- You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
15
-
16
- **Patents**
17
- The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
18
-
19
- **Notices**
20
- You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
21
-
22
- If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
23
-
24
- **No Other Rights**
25
- These terms do not imply any licenses other than those expressly granted in these terms.
26
-
27
- **Termination**
28
- If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
29
-
30
- **No Liability**
31
- As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
32
-
33
- **Definitions**
34
- The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
35
-
36
- _you_ refers to the individual or entity agreeing to these terms.
37
-
38
- _your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
39
-
40
- _your licenses_ are all the licenses granted to you for the software under these terms.
41
-
42
- _use_ means anything you do with the software requiring one of your licenses.
43
-
44
- _trademark_ means trademarks, service marks, and similar rights.
@@ -1,564 +0,0 @@
1
- import type { Agent } from '@mastra/core/agent';
2
- import type { AgentNetwork } from '@mastra/core/network';
3
- import { BaseLogMessage } from '@mastra/core';
4
- import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core';
6
- import { GenerateObjectResult } from 'ai';
7
- import { GenerateTextResult } from 'ai';
8
- import type { Mastra } from '@mastra/core/mastra';
9
- import type { Mastra as Mastra_2 } from '@mastra/core';
10
- import type { MastraMemory } from '@mastra/core/memory';
11
- import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core';
13
- import type { QueryResult } from '@mastra/core/vector';
14
- import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
15
- import { Step } from '@mastra/core';
16
- import { StepExecutionContext } from '@mastra/core';
17
- import { StepGraph } from '@mastra/core';
18
- import { StorageThreadType } from '@mastra/core';
19
- import type { ToolAction } from '@mastra/core/tools';
20
- import type { VercelTool } from '@mastra/core/tools';
21
- import type { Workflow } from '@mastra/core/workflows';
22
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
23
- import { WorkflowRunResult } from '@mastra/core';
24
- import { WorkflowRuns } from '@mastra/core';
25
-
26
- export declare namespace agents {
27
- export {
28
- getAgentsHandler,
29
- getAgentByIdHandler,
30
- getEvalsByAgentIdHandler,
31
- getLiveEvalsByAgentIdHandler,
32
- generateHandler,
33
- streamGenerateHandler
34
- }
35
- }
36
-
37
- export declare interface ApiError extends Error {
38
- message: string;
39
- status?: number;
40
- }
41
-
42
- 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;
43
-
44
- export declare interface Context {
45
- mastra: Mastra;
46
- }
47
-
48
- export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
49
- index: CreateIndexRequest;
50
- }): Promise<{
51
- success: boolean;
52
- }>;
53
-
54
- declare interface CreateIndexRequest {
55
- indexName: string;
56
- dimension: number;
57
- metric?: 'cosine' | 'euclidean' | 'dotproduct';
58
- }
59
-
60
- export declare function createRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
61
- runId: string;
62
- }>;
63
-
64
- export declare function createThreadHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
65
- body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
66
- resourceId?: string;
67
- };
68
- }): Promise<StorageThreadType>;
69
-
70
- export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
71
- indexName?: string;
72
- }): Promise<{
73
- success: boolean;
74
- }>;
75
-
76
- export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
77
- result: string;
78
- }>;
79
-
80
- declare type DeprecatedStatusCode = 305 | 306;
81
-
82
- export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
83
- indexName?: string;
84
- }): Promise<{
85
- dimension: number;
86
- count: number;
87
- metric: string | undefined;
88
- }>;
89
-
90
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
91
- agentId?: string;
92
- data: any;
93
- }): Promise<any>;
94
-
95
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
- data?: unknown;
97
- }) => Promise<any>;
98
-
99
- export declare function generateHandler({ mastra, agentId, body, }: Context & {
100
- agentId: string;
101
- body: GetBody<'generate'> & {
102
- resourceid?: string;
103
- };
104
- }): Promise<GenerateTextResult<any, any>>;
105
-
106
- export declare function generateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
107
- body: {
108
- messages?: Parameters<AgentNetwork['generate']>[0];
109
- } & Parameters<AgentNetwork['generate']>[1];
110
- }): Promise<GenerateObjectResult<any>>;
111
-
112
- /**
113
- * Generate speech from text
114
- */
115
- export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
116
- body?: {
117
- text?: string;
118
- speakerId?: string;
119
- };
120
- }): Promise<{
121
- audioData: Buffer<ArrayBuffer>;
122
- }>;
123
-
124
- export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
125
- agentId: string;
126
- }): Promise<{
127
- name: any;
128
- instructions: string;
129
- tools: any;
130
- provider: string;
131
- modelId: string;
132
- }>;
133
-
134
- export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
135
-
136
- declare type GetBody<T extends keyof Agent & {
137
- [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
138
- }[keyof Agent]> = {
139
- messages: Parameters<Agent[T]>[0];
140
- } & Parameters<Agent[T]>[1];
141
-
142
- export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
143
- agentId: string;
144
- }): Promise<{
145
- id: string;
146
- name: any;
147
- instructions: string;
148
- evals: EvalRow[];
149
- }>;
150
-
151
- export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
152
- agentId: string;
153
- }): Promise<{
154
- id: string;
155
- name: any;
156
- instructions: string;
157
- evals: EvalRow[];
158
- }>;
159
-
160
- export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
161
-
162
- export declare function getLogsHandler({ mastra, transportId }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
163
-
164
- export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
165
- transports: string[];
166
- }>;
167
-
168
- export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
169
- result: boolean;
170
- }>;
171
-
172
- export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
173
- messages: CoreMessage[];
174
- uiMessages: Message[];
175
- }>;
176
-
177
- export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<NetworkContext, 'mastra' | 'networkId'>): Promise<{
178
- id: string;
179
- name: string;
180
- instructions: string;
181
- agents: {
182
- name: string;
183
- provider: string;
184
- modelId: string;
185
- }[];
186
- routingModel: {
187
- provider: string;
188
- modelId: string;
189
- };
190
- }>;
191
-
192
- export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
193
- id: string;
194
- name: string;
195
- instructions: string;
196
- agents: {
197
- name: string;
198
- provider: string;
199
- modelId: string;
200
- }[];
201
- routingModel: {
202
- provider: string;
203
- modelId: string;
204
- };
205
- }[]>;
206
-
207
- /**
208
- * Get available speakers for an agent
209
- */
210
- export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): Promise<{
211
- voiceId: string;
212
- }[]>;
213
-
214
- export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
215
-
216
- export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
217
-
218
- export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
219
-
220
- export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
221
-
222
- export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
223
-
224
- export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
225
- stepGraph: StepGraph;
226
- stepSubscriberGraph: Record<string, StepGraph>;
227
- serializedStepGraph: StepGraph;
228
- serializedStepSubscriberGraph: Record<string, StepGraph>;
229
- name: string;
230
- triggerSchema: string | undefined;
231
- steps: any;
232
- }>;
233
-
234
- export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
235
-
236
- export declare function getWorkflowRunsHandler({ mastra, workflowId }: WorkflowContext): Promise<WorkflowRuns>;
237
-
238
- export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
239
-
240
- export declare function handleError(error: unknown, defaultMessage: string): never;
241
-
242
- /**
243
- * `HTTPException` must be used when a fatal error such as authentication failure occurs.
244
- *
245
- * @see {@link https://hono.dev/docs/api/exception}
246
- *
247
- * @param {StatusCode} status - status code of HTTPException
248
- * @param {HTTPExceptionOptions} options - options of HTTPException
249
- * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
250
- * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
251
- * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
252
- *
253
- * @example
254
- * ```ts
255
- * import { HTTPException } from 'hono/http-exception'
256
- *
257
- * // ...
258
- *
259
- * app.post('/auth', async (c, next) => {
260
- * // authentication
261
- * if (authorized === false) {
262
- * throw new HTTPException(401, { message: 'Custom error message' })
263
- * }
264
- * await next()
265
- * })
266
- * ```
267
- */
268
- export declare class HTTPException extends Error {
269
- readonly res?: Response;
270
- readonly status: StatusCode;
271
- /**
272
- * Creates an instance of `HTTPException`.
273
- * @param status - HTTP status code for the exception. Defaults to 500.
274
- * @param options - Additional options for the exception.
275
- */
276
- constructor(status?: StatusCode, options?: HTTPExceptionOptions);
277
- /**
278
- * Returns the response object associated with the exception.
279
- * If a response object is not provided, a new response is created with the error message and status code.
280
- * @returns The response object.
281
- */
282
- getResponse(): Response;
283
- }
284
-
285
- /**
286
- * Options for creating an `HTTPException`.
287
- * @property res - Optional response object to use.
288
- * @property message - Optional custom error message.
289
- * @property cause - Optional cause of the error.
290
- */
291
- declare type HTTPExceptionOptions = {
292
- res?: Response;
293
- message?: string;
294
- cause?: unknown;
295
- };
296
-
297
- /**
298
- * @module
299
- * This module provides the `HTTPException` class.
300
- */
301
- declare type InfoStatusCode = 100 | 101 | 102 | 103;
302
-
303
- export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
304
-
305
- export declare namespace logs {
306
- export {
307
- getLogsHandler,
308
- getLogsByRunIdHandler,
309
- getLogTransports
310
- }
311
- }
312
-
313
- declare type LogsContext = {
314
- mastra: Mastra;
315
- transportId?: string;
316
- runId?: string;
317
- };
318
-
319
- export declare namespace memory {
320
- export {
321
- getMemoryStatusHandler,
322
- getThreadsHandler,
323
- getThreadByIdHandler,
324
- saveMessagesHandler,
325
- createThreadHandler,
326
- updateThreadHandler,
327
- deleteThreadHandler,
328
- getMessagesHandler
329
- }
330
- }
331
-
332
- declare interface MemoryContext extends Context {
333
- agentId?: string;
334
- resourceId?: string;
335
- threadId?: string;
336
- }
337
-
338
- export declare namespace network {
339
- export {
340
- getNetworksHandler,
341
- getNetworkByIdHandler,
342
- generateHandler_alias_1 as generateHandler,
343
- streamGenerateHandler_alias_1 as streamGenerateHandler
344
- }
345
- }
346
-
347
- declare interface NetworkContext extends Context {
348
- networkId?: string;
349
- }
350
-
351
- declare interface QueryRequest {
352
- indexName: string;
353
- queryVector: number[];
354
- topK?: number;
355
- filter?: Record<string, any>;
356
- includeVector?: boolean;
357
- }
358
-
359
- export declare function queryVectors({ mastra, vectorName, query, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
360
- query: QueryRequest;
361
- }): Promise<QueryResult[]>;
362
-
363
- declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
364
-
365
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
366
- body: {
367
- stepId: string;
368
- context: any;
369
- };
370
- }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
371
-
372
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
373
- body: {
374
- stepId: string;
375
- context: any;
376
- };
377
- }): Promise<{
378
- message: string;
379
- }>;
380
-
381
- export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
382
- body: {
383
- messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
384
- };
385
- }): Promise<MessageType[]>;
386
-
387
- declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
388
-
389
- export declare function startAsyncWorkflowHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
390
- triggerData?: unknown;
391
- }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
392
-
393
- export declare function startWorkflowRunHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
394
- triggerData?: unknown;
395
- }): Promise<{
396
- message: string;
397
- }>;
398
-
399
- /**
400
- * If you want to use an unofficial status, use `UnofficialStatusCode`.
401
- */
402
- export declare type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode;
403
-
404
- export declare function storeTelemetryHandler({ mastra, body }: Context & {
405
- body: {
406
- resourceSpans: any[];
407
- };
408
- }): Promise<{
409
- status: string;
410
- message: string;
411
- error: any;
412
- } | {
413
- status: string;
414
- message: string;
415
- traceCount: number;
416
- }>;
417
-
418
- export declare function streamGenerateHandler({ mastra, agentId, body, }: Context & {
419
- agentId: string;
420
- body: GetBody<'stream'> & {
421
- resourceid?: string;
422
- };
423
- }): Promise<Response | undefined>;
424
-
425
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
426
- body: {
427
- messages?: Parameters<AgentNetwork['stream']>[0];
428
- } & Parameters<AgentNetwork['stream']>[1];
429
- }): Promise<Response>;
430
-
431
- declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
432
-
433
- export declare namespace telemetry {
434
- export {
435
- getTelemetryHandler,
436
- storeTelemetryHandler
437
- }
438
- }
439
-
440
- declare interface TelemetryContext extends Context {
441
- body?: {
442
- name?: string;
443
- scope?: string;
444
- page?: number;
445
- perPage?: number;
446
- attribute?: string | string[];
447
- };
448
- }
449
-
450
- export declare namespace tools {
451
- export {
452
- getToolsHandler,
453
- getToolByIdHandler,
454
- executeToolHandler,
455
- executeAgentToolHandler
456
- }
457
- }
458
-
459
- declare interface ToolsContext extends Context {
460
- tools?: Record<string, ToolAction | VercelTool>;
461
- toolId?: string;
462
- runId?: string;
463
- }
464
-
465
- /**
466
- * Transcribe speech to text
467
- */
468
- export declare function transcribeSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
469
- body?: {
470
- audioData?: Buffer;
471
- options?: Parameters<NonNullable<Agent['voice']>['listen']>[1];
472
- };
473
- }): Promise<{
474
- text: string | void | NodeJS.ReadableStream;
475
- }>;
476
-
477
- /**
478
- * @deprecated
479
- * Use `UnofficialStatusCode` instead.
480
- */
481
- export declare type UnOfficalStatusCode = UnofficialStatusCode;
482
-
483
- /**
484
- * `UnofficialStatusCode` can be used to specify an unofficial status code.
485
- * @example
486
- *
487
- * ```ts
488
- * app.get('/unknown', (c) => {
489
- * return c.text("Unknown Error", 520 as UnofficialStatusCode)
490
- * })
491
- * ```
492
- */
493
- export declare type UnofficialStatusCode = -1;
494
-
495
- export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
496
- body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
497
- }): Promise<StorageThreadType>;
498
-
499
- declare interface UpsertRequest {
500
- indexName: string;
501
- vectors: number[][];
502
- metadata?: Record<string, any>[];
503
- ids?: string[];
504
- }
505
-
506
- export declare function upsertVectors({ mastra, vectorName, index }: VectorContext & {
507
- index: UpsertRequest;
508
- }): Promise<{
509
- ids: string[];
510
- }>;
511
-
512
- export declare function validateBody(body: Record<string, unknown>): void;
513
-
514
- export declare namespace vector {
515
- export {
516
- upsertVectors,
517
- createIndex,
518
- queryVectors,
519
- listIndexes,
520
- describeIndex,
521
- deleteIndex
522
- }
523
- }
524
-
525
- declare interface VectorContext extends Context {
526
- vectorName?: string;
527
- }
528
-
529
- export declare namespace voice {
530
- export {
531
- getSpeakersHandler,
532
- generateSpeechHandler,
533
- transcribeSpeechHandler
534
- }
535
- }
536
-
537
- declare interface VoiceContext extends Context {
538
- agentId?: string;
539
- }
540
-
541
- export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
542
-
543
- declare interface WorkflowContext {
544
- mastra: Mastra_2;
545
- workflowId?: string;
546
- runId?: string;
547
- }
548
-
549
- export declare namespace workflows {
550
- export {
551
- getWorkflowsHandler,
552
- getWorkflowByIdHandler,
553
- startAsyncWorkflowHandler,
554
- getWorkflowRunHandler,
555
- createRunHandler,
556
- startWorkflowRunHandler,
557
- watchWorkflowHandler,
558
- resumeAsyncWorkflowHandler,
559
- resumeWorkflowHandler,
560
- getWorkflowRunsHandler
561
- }
562
- }
563
-
564
- export { }