@mastra/server 0.0.0-cli-debug-20250611094457 → 0.0.0-client-js-listmessages-agentid-fix-20251119175531

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