@mastra/server 0.0.0-default-storage-virtual-file-20250410035748 → 0.0.0-experimental-agent-builder-20250815195917

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 (216) hide show
  1. package/LICENSE.md +15 -0
  2. package/README.md +48 -135
  3. package/dist/chunk-4CEZIJWJ.cjs +150 -0
  4. package/dist/chunk-4CEZIJWJ.cjs.map +1 -0
  5. package/dist/chunk-4MQU6AJN.js +83 -0
  6. package/dist/chunk-4MQU6AJN.js.map +1 -0
  7. package/dist/{chunk-QN4KF3BH.cjs → chunk-4QSNRCOT.cjs} +4 -2
  8. package/dist/chunk-4QSNRCOT.cjs.map +1 -0
  9. package/dist/chunk-4US5W7PH.cjs +120 -0
  10. package/dist/chunk-4US5W7PH.cjs.map +1 -0
  11. package/dist/chunk-5AKR33BI.js +333 -0
  12. package/dist/chunk-5AKR33BI.js.map +1 -0
  13. package/dist/chunk-7FHF55WA.js +2041 -0
  14. package/dist/chunk-7FHF55WA.js.map +1 -0
  15. package/dist/{chunk-FV45V6WC.cjs → chunk-7NADHFD2.cjs} +3 -7
  16. package/dist/chunk-7NADHFD2.cjs.map +1 -0
  17. package/dist/chunk-BED2O446.cjs +88 -0
  18. package/dist/chunk-BED2O446.cjs.map +1 -0
  19. package/dist/chunk-BUOJL3MN.js +529 -0
  20. package/dist/chunk-BUOJL3MN.js.map +1 -0
  21. package/dist/chunk-CY4TP3FK.js +16 -0
  22. package/dist/chunk-CY4TP3FK.js.map +1 -0
  23. package/dist/chunk-EBNIUZRY.cjs +344 -0
  24. package/dist/chunk-EBNIUZRY.cjs.map +1 -0
  25. package/dist/{chunk-4JINXASC.js → chunk-G7NVCO5M.js} +7 -4
  26. package/dist/chunk-G7NVCO5M.js.map +1 -0
  27. package/dist/chunk-GX25CWC7.cjs +588 -0
  28. package/dist/chunk-GX25CWC7.cjs.map +1 -0
  29. package/dist/{chunk-3RVHWGWO.js → chunk-HWHKM67I.js} +38 -19
  30. package/dist/chunk-HWHKM67I.js.map +1 -0
  31. package/dist/{chunk-CWSDZEZG.cjs → chunk-ILCWPBYQ.cjs} +20 -12
  32. package/dist/chunk-ILCWPBYQ.cjs.map +1 -0
  33. package/dist/chunk-JGVY3KWV.cjs +334 -0
  34. package/dist/chunk-JGVY3KWV.cjs.map +1 -0
  35. package/dist/chunk-JNWFG7JP.js +476 -0
  36. package/dist/chunk-JNWFG7JP.js.map +1 -0
  37. package/dist/chunk-KXNFZXLG.cjs +484 -0
  38. package/dist/chunk-KXNFZXLG.cjs.map +1 -0
  39. package/dist/chunk-L7YG7WQH.js +151 -0
  40. package/dist/chunk-L7YG7WQH.js.map +1 -0
  41. package/dist/chunk-LRUH33B4.cjs +2044 -0
  42. package/dist/chunk-LRUH33B4.cjs.map +1 -0
  43. package/dist/{chunk-TRDNDNGQ.js → chunk-MMROOK5J.js} +4 -7
  44. package/dist/chunk-MMROOK5J.js.map +1 -0
  45. package/dist/{chunk-M56ECCHK.cjs → chunk-NCS2OXX6.cjs} +22 -19
  46. package/dist/chunk-NCS2OXX6.cjs.map +1 -0
  47. package/dist/{chunk-4C3EPMMF.cjs → chunk-O4I563YW.cjs} +33 -25
  48. package/dist/chunk-O4I563YW.cjs.map +1 -0
  49. package/dist/{chunk-L7XE5QTW.js → chunk-OW4FX5TS.js} +3 -1
  50. package/dist/chunk-OW4FX5TS.js.map +1 -0
  51. package/dist/chunk-PZ5AY32C.js +9 -0
  52. package/dist/chunk-PZ5AY32C.js.map +1 -0
  53. package/dist/chunk-Q7SFCCGT.cjs +11 -0
  54. package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
  55. package/dist/chunk-RE4RPXT2.cjs +18 -0
  56. package/dist/chunk-RE4RPXT2.cjs.map +1 -0
  57. package/dist/chunk-RQQNZZAI.cjs +159 -0
  58. package/dist/chunk-RQQNZZAI.cjs.map +1 -0
  59. package/dist/chunk-S37KCGOR.cjs +546 -0
  60. package/dist/chunk-S37KCGOR.cjs.map +1 -0
  61. package/dist/{chunk-DVPP5S6I.js → chunk-SQ7KKIH3.js} +16 -8
  62. package/dist/chunk-SQ7KKIH3.js.map +1 -0
  63. package/dist/{chunk-ILW7XYNJ.js → chunk-UVOSITKU.js} +92 -66
  64. package/dist/chunk-UVOSITKU.js.map +1 -0
  65. package/dist/{chunk-2YONKUWB.js → chunk-Y3J45CVZ.js} +60 -33
  66. package/dist/chunk-Y3J45CVZ.js.map +1 -0
  67. package/dist/{chunk-YNSGUC2O.js → chunk-YS66MFDY.js} +16 -8
  68. package/dist/chunk-YS66MFDY.js.map +1 -0
  69. package/dist/chunk-ZKJZQN24.js +571 -0
  70. package/dist/chunk-ZKJZQN24.js.map +1 -0
  71. package/dist/index.cjs +2 -0
  72. package/dist/index.cjs.map +1 -0
  73. package/dist/index.d.ts +1 -0
  74. package/dist/index.d.ts.map +1 -0
  75. package/dist/index.js +2 -0
  76. package/dist/index.js.map +1 -0
  77. package/dist/server/a2a/protocol.d.ts +8 -0
  78. package/dist/server/a2a/protocol.d.ts.map +1 -0
  79. package/dist/server/a2a/store.cjs +25 -0
  80. package/dist/server/a2a/store.cjs.map +1 -0
  81. package/dist/server/a2a/store.d.ts +14 -0
  82. package/dist/server/a2a/store.d.ts.map +1 -0
  83. package/dist/server/a2a/store.js +23 -0
  84. package/dist/server/a2a/store.js.map +1 -0
  85. package/dist/server/a2a/tasks.d.ts +20 -0
  86. package/dist/server/a2a/tasks.d.ts.map +1 -0
  87. package/dist/server/handlers/a2a.cjs +32 -0
  88. package/dist/server/handlers/a2a.cjs.map +1 -0
  89. package/dist/server/handlers/a2a.d.ts +68 -0
  90. package/dist/server/handlers/a2a.d.ts.map +1 -0
  91. package/dist/server/handlers/a2a.js +3 -0
  92. package/dist/server/handlers/a2a.js.map +1 -0
  93. package/dist/server/handlers/agents.cjs +21 -7
  94. package/dist/server/handlers/agents.cjs.map +1 -0
  95. package/dist/server/handlers/agents.d.ts +90 -6
  96. package/dist/server/handlers/agents.d.ts.map +1 -0
  97. package/dist/server/handlers/agents.js +3 -1
  98. package/dist/server/handlers/agents.js.map +1 -0
  99. package/dist/server/handlers/error.cjs +4 -2
  100. package/dist/server/handlers/error.cjs.map +1 -0
  101. package/dist/server/handlers/error.d.ts +2 -1
  102. package/dist/server/handlers/error.d.ts.map +1 -0
  103. package/dist/server/handlers/error.js +3 -1
  104. package/dist/server/handlers/error.js.map +1 -0
  105. package/dist/server/handlers/legacyWorkflows.cjs +48 -0
  106. package/dist/server/handlers/legacyWorkflows.cjs.map +1 -0
  107. package/dist/server/handlers/legacyWorkflows.d.ts +59 -0
  108. package/dist/server/handlers/legacyWorkflows.d.ts.map +1 -0
  109. package/dist/server/handlers/legacyWorkflows.js +3 -0
  110. package/dist/server/handlers/legacyWorkflows.js.map +1 -0
  111. package/dist/server/handlers/logs.cjs +6 -4
  112. package/dist/server/handlers/logs.cjs.map +1 -0
  113. package/dist/server/handlers/logs.d.ts +34 -3
  114. package/dist/server/handlers/logs.d.ts.map +1 -0
  115. package/dist/server/handlers/logs.js +3 -1
  116. package/dist/server/handlers/logs.js.map +1 -0
  117. package/dist/server/handlers/memory.cjs +39 -9
  118. package/dist/server/handlers/memory.cjs.map +1 -0
  119. package/dist/server/handlers/memory.d.ts +119 -8
  120. package/dist/server/handlers/memory.d.ts.map +1 -0
  121. package/dist/server/handlers/memory.js +3 -1
  122. package/dist/server/handlers/memory.js.map +1 -0
  123. package/dist/server/handlers/network.cjs +7 -5
  124. package/dist/server/handlers/network.cjs.map +1 -0
  125. package/dist/server/handlers/network.d.ts +50 -4
  126. package/dist/server/handlers/network.d.ts.map +1 -0
  127. package/dist/server/handlers/network.js +3 -1
  128. package/dist/server/handlers/network.js.map +1 -0
  129. package/dist/server/handlers/scores.cjs +32 -0
  130. package/dist/server/handlers/scores.cjs.map +1 -0
  131. package/dist/server/handlers/scores.d.ts +49 -0
  132. package/dist/server/handlers/scores.d.ts.map +1 -0
  133. package/dist/server/handlers/scores.js +3 -0
  134. package/dist/server/handlers/scores.js.map +1 -0
  135. package/dist/server/handlers/telemetry.cjs +5 -3
  136. package/dist/server/handlers/telemetry.cjs.map +1 -0
  137. package/dist/server/handlers/telemetry.d.ts +32 -2
  138. package/dist/server/handlers/telemetry.d.ts.map +1 -0
  139. package/dist/server/handlers/telemetry.js +3 -1
  140. package/dist/server/handlers/telemetry.js.map +1 -0
  141. package/dist/server/handlers/tools.cjs +7 -5
  142. package/dist/server/handlers/tools.cjs.map +1 -0
  143. package/dist/server/handlers/tools.d.ts +21 -4
  144. package/dist/server/handlers/tools.d.ts.map +1 -0
  145. package/dist/server/handlers/tools.js +3 -1
  146. package/dist/server/handlers/tools.js.map +1 -0
  147. package/dist/server/handlers/utils.cjs +4 -2
  148. package/dist/server/handlers/utils.cjs.map +1 -0
  149. package/dist/server/handlers/utils.d.ts +2 -1
  150. package/dist/server/handlers/utils.d.ts.map +1 -0
  151. package/dist/server/handlers/utils.js +3 -1
  152. package/dist/server/handlers/utils.js.map +1 -0
  153. package/dist/server/handlers/vNextNetwork.cjs +220 -0
  154. package/dist/server/handlers/vNextNetwork.cjs.map +1 -0
  155. package/dist/server/handlers/vNextNetwork.d.ts +179 -0
  156. package/dist/server/handlers/vNextNetwork.d.ts.map +1 -0
  157. package/dist/server/handlers/vNextNetwork.js +213 -0
  158. package/dist/server/handlers/vNextNetwork.js.map +1 -0
  159. package/dist/server/handlers/vector.cjs +9 -7
  160. package/dist/server/handlers/vector.cjs.map +1 -0
  161. package/dist/server/handlers/vector.d.ts +51 -6
  162. package/dist/server/handlers/vector.d.ts.map +1 -0
  163. package/dist/server/handlers/vector.js +3 -1
  164. package/dist/server/handlers/vector.js.map +1 -0
  165. package/dist/server/handlers/voice.cjs +10 -4
  166. package/dist/server/handlers/voice.cjs.map +1 -0
  167. package/dist/server/handlers/voice.d.ts +39 -3
  168. package/dist/server/handlers/voice.d.ts.map +1 -0
  169. package/dist/server/handlers/voice.js +3 -1
  170. package/dist/server/handlers/voice.js.map +1 -0
  171. package/dist/server/handlers/workflows.cjs +35 -13
  172. package/dist/server/handlers/workflows.cjs.map +1 -0
  173. package/dist/server/handlers/workflows.d.ts +88 -10
  174. package/dist/server/handlers/workflows.d.ts.map +1 -0
  175. package/dist/server/handlers/workflows.js +3 -1
  176. package/dist/server/handlers/workflows.js.map +1 -0
  177. package/dist/server/handlers.cjs +44 -27
  178. package/dist/server/handlers.cjs.map +1 -0
  179. package/dist/server/handlers.d.ts +13 -9
  180. package/dist/server/handlers.d.ts.map +1 -0
  181. package/dist/server/handlers.js +14 -9
  182. package/dist/server/handlers.js.map +1 -0
  183. package/dist/server/http-exception.d.ts +87 -0
  184. package/dist/server/http-exception.d.ts.map +1 -0
  185. package/dist/server/types.d.ts +10 -0
  186. package/dist/server/types.d.ts.map +1 -0
  187. package/package.json +31 -18
  188. package/LICENSE +0 -44
  189. package/dist/_tsup-dts-rollup.d.cts +0 -564
  190. package/dist/_tsup-dts-rollup.d.ts +0 -564
  191. package/dist/chunk-2FJURXCL.cjs +0 -213
  192. package/dist/chunk-2JQC6JWP.js +0 -46
  193. package/dist/chunk-3AHQ5RGN.js +0 -11
  194. package/dist/chunk-5JOF627H.cjs +0 -123
  195. package/dist/chunk-A7DF4ETD.cjs +0 -100
  196. package/dist/chunk-BMA2ORRT.js +0 -152
  197. package/dist/chunk-GV52BII2.cjs +0 -160
  198. package/dist/chunk-QH6XWSXP.cjs +0 -5579
  199. package/dist/chunk-RBQASTUP.js +0 -203
  200. package/dist/chunk-VB7KH62D.cjs +0 -51
  201. package/dist/chunk-VK6FX47H.js +0 -5576
  202. package/dist/chunk-X37I6GZT.cjs +0 -308
  203. package/dist/chunk-ZLBRQFDD.cjs +0 -13
  204. package/dist/index.d.cts +0 -1
  205. package/dist/server/handlers/agents.d.cts +0 -6
  206. package/dist/server/handlers/error.d.cts +0 -1
  207. package/dist/server/handlers/logs.d.cts +0 -3
  208. package/dist/server/handlers/memory.d.cts +0 -8
  209. package/dist/server/handlers/network.d.cts +0 -4
  210. package/dist/server/handlers/telemetry.d.cts +0 -2
  211. package/dist/server/handlers/tools.d.cts +0 -4
  212. package/dist/server/handlers/utils.d.cts +0 -1
  213. package/dist/server/handlers/vector.d.cts +0 -6
  214. package/dist/server/handlers/voice.d.cts +0 -3
  215. package/dist/server/handlers/workflows.d.cts +0 -10
  216. package/dist/server/handlers.d.cts +0 -9
@@ -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 { }