@mastra/server 0.0.0-mcp-server-deploy-20250507160341 → 0.0.0-memory-system-message-error-20250813233316

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 (226) hide show
  1. package/LICENSE.md +11 -42
  2. package/README.md +48 -135
  3. package/dist/{chunk-5YGDYMRB.cjs → chunk-4CEZIJWJ.cjs} +16 -13
  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-Q6SHQECN.js → chunk-HWHKM67I.js} +36 -10
  30. package/dist/chunk-HWHKM67I.js.map +1 -0
  31. package/dist/{chunk-AMVOS7YB.cjs → chunk-ILCWPBYQ.cjs} +14 -8
  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-D3G23FP3.cjs → chunk-O4I563YW.cjs} +26 -22
  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-BPL2CBLV.js → chunk-SQ7KKIH3.js} +10 -4
  62. package/dist/chunk-SQ7KKIH3.js.map +1 -0
  63. package/dist/{chunk-3XTEV33Q.js → chunk-UVOSITKU.js} +61 -56
  64. package/dist/chunk-UVOSITKU.js.map +1 -0
  65. package/dist/{chunk-QJ3AHN64.js → chunk-Y3J45CVZ.js} +6 -3
  66. package/dist/chunk-Y3J45CVZ.js.map +1 -0
  67. package/dist/{chunk-5JNVY6DU.js → chunk-YS66MFDY.js} +9 -5
  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 -12
  72. package/dist/index.cjs.map +1 -0
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.d.ts.map +1 -0
  75. package/dist/index.js +3 -1
  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 +42 -30
  178. package/dist/server/handlers.cjs.map +1 -0
  179. package/dist/server/handlers.d.ts +13 -10
  180. package/dist/server/handlers.d.ts.map +1 -0
  181. package/dist/server/handlers.js +14 -10
  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/dist/_tsup-dts-rollup.d.cts +0 -748
  189. package/dist/_tsup-dts-rollup.d.ts +0 -748
  190. package/dist/chunk-2FJURXCL.cjs +0 -213
  191. package/dist/chunk-3AHQ5RGN.js +0 -11
  192. package/dist/chunk-3EJZQ6TQ.js +0 -49
  193. package/dist/chunk-4BIX6GMY.cjs +0 -189
  194. package/dist/chunk-55HTWX4C.cjs +0 -93
  195. package/dist/chunk-5SWCVTNL.cjs +0 -5579
  196. package/dist/chunk-74DLDQTQ.cjs +0 -36
  197. package/dist/chunk-CHFORQ7J.cjs +0 -329
  198. package/dist/chunk-FOXHTOQZ.cjs +0 -324
  199. package/dist/chunk-HAA5T7JL.js +0 -33
  200. package/dist/chunk-IQTNZSFP.js +0 -312
  201. package/dist/chunk-OMN3UI6X.js +0 -5576
  202. package/dist/chunk-RBQASTUP.js +0 -203
  203. package/dist/chunk-SKBVVI24.cjs +0 -54
  204. package/dist/chunk-Y3SV5XK4.js +0 -181
  205. package/dist/chunk-ZLBRQFDD.cjs +0 -13
  206. package/dist/index.d.cts +0 -2
  207. package/dist/server/handlers/agents.d.cts +0 -6
  208. package/dist/server/handlers/error.d.cts +0 -1
  209. package/dist/server/handlers/logs.d.cts +0 -3
  210. package/dist/server/handlers/mcp.cjs +0 -14
  211. package/dist/server/handlers/mcp.d.cts +0 -2
  212. package/dist/server/handlers/mcp.d.ts +0 -2
  213. package/dist/server/handlers/mcp.js +0 -1
  214. package/dist/server/handlers/memory.d.cts +0 -8
  215. package/dist/server/handlers/network.d.cts +0 -4
  216. package/dist/server/handlers/telemetry.d.cts +0 -2
  217. package/dist/server/handlers/tools.d.cts +0 -4
  218. package/dist/server/handlers/utils.d.cts +0 -1
  219. package/dist/server/handlers/vNextWorkflows.cjs +0 -46
  220. package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
  221. package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
  222. package/dist/server/handlers/vNextWorkflows.js +0 -1
  223. package/dist/server/handlers/vector.d.cts +0 -6
  224. package/dist/server/handlers/voice.d.cts +0 -3
  225. package/dist/server/handlers/workflows.d.cts +0 -10
  226. package/dist/server/handlers.d.cts +0 -10
@@ -1,748 +0,0 @@
1
- import type { Agent } from '@mastra/core/agent';
2
- import type { AgentNetwork } from '@mastra/core/network';
3
- import type { BaseLogMessage } from '@mastra/core/logger';
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';
9
- import type { Mastra as Mastra_2 } from '@mastra/core/mastra';
10
- import type { MastraMemory } from '@mastra/core/memory';
11
- import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core';
13
- import { NewStep } from '@mastra/core/workflows/vNext';
14
- import type { NewWorkflow } from '@mastra/core/workflows/vNext';
15
- import type { QueryResult } from '@mastra/core/vector';
16
- import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
17
- import type { RuntimeContext } from '@mastra/core/runtime-context';
18
- import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
19
- import { SerializedStepFlowEntry } from '@mastra/core/workflows/vNext';
20
- import { Step } from '@mastra/core';
21
- import { StepExecutionContext } from '@mastra/core';
22
- import { StepGraph } from '@mastra/core';
23
- import { StorageThreadType } from '@mastra/core';
24
- import type { ToolAction } from '@mastra/core/tools';
25
- import type { VercelTool } from '@mastra/core/tools';
26
- import type { Workflow } from '@mastra/core/workflows';
27
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
28
- import { WorkflowResult } from '@mastra/core/workflows/vNext';
29
- import { WorkflowRunResult } from '@mastra/core';
30
- import type { WorkflowRuns } from '@mastra/core/storage';
31
- import { ZodType } from 'zod';
32
- import { ZodTypeDef } from 'zod';
33
-
34
- export declare namespace agents {
35
- export {
36
- getAgentsHandler,
37
- getAgentByIdHandler,
38
- getEvalsByAgentIdHandler,
39
- getLiveEvalsByAgentIdHandler,
40
- generateHandler,
41
- streamGenerateHandler
42
- }
43
- }
44
-
45
- export declare interface ApiError extends Error {
46
- message: string;
47
- status?: number;
48
- }
49
-
50
- 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;
51
-
52
- export declare interface Context {
53
- mastra: Mastra_2;
54
- }
55
-
56
- export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
57
- index: CreateIndexRequest;
58
- }): Promise<{
59
- success: boolean;
60
- }>;
61
-
62
- declare interface CreateIndexRequest {
63
- indexName: string;
64
- dimension: number;
65
- metric?: 'cosine' | 'euclidean' | 'dotproduct';
66
- }
67
-
68
- export declare function createRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
69
- runId: string;
70
- }>;
71
-
72
- export declare function createThreadHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
73
- body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
74
- resourceId?: string;
75
- };
76
- }): Promise<StorageThreadType>;
77
-
78
- export declare function createVNextWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
79
- runId: string;
80
- }>;
81
-
82
- export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
83
- indexName?: string;
84
- }): Promise<{
85
- success: boolean;
86
- }>;
87
-
88
- export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
89
- result: string;
90
- }>;
91
-
92
- declare type DeprecatedStatusCode = 305 | 306;
93
-
94
- export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
95
- indexName?: string;
96
- }): Promise<{
97
- dimension: number;
98
- count: number;
99
- metric: string | undefined;
100
- }>;
101
-
102
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
103
- agentId?: string;
104
- data: any;
105
- runtimeContext: RuntimeContext;
106
- }): Promise<any>;
107
-
108
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
109
- data?: unknown;
110
- runtimeContext: RuntimeContext;
111
- }) => Promise<any>;
112
-
113
- export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
114
- runtimeContext: RuntimeContext;
115
- agentId: string;
116
- body: GetBody<'generate'> & {
117
- resourceid?: string;
118
- };
119
- }): Promise<GenerateTextResult<any, any>>;
120
-
121
- export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
122
- runtimeContext: RuntimeContext;
123
- body: {
124
- messages?: Parameters<AgentNetwork['generate']>[0];
125
- } & Parameters<AgentNetwork['generate']>[1];
126
- }): Promise<GenerateObjectResult<any>>;
127
-
128
- /**
129
- * Generate speech from text
130
- */
131
- export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
132
- body?: {
133
- text?: string;
134
- speakerId?: string;
135
- };
136
- }): Promise<NodeJS.ReadableStream>;
137
-
138
- export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
139
- runtimeContext: RuntimeContext;
140
- agentId: string;
141
- }): Promise<{
142
- name: any;
143
- instructions: string;
144
- tools: any;
145
- provider: string;
146
- modelId: string;
147
- }>;
148
-
149
- export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
150
- runtimeContext: RuntimeContext;
151
- }): Promise<any>;
152
-
153
- declare type GetBody<T extends keyof Agent & {
154
- [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
155
- }[keyof Agent]> = {
156
- messages: Parameters<Agent[T]>[0];
157
- } & Parameters<Agent[T]>[1];
158
-
159
- export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
160
- runtimeContext: RuntimeContext;
161
- agentId: string;
162
- }): Promise<{
163
- id: string;
164
- name: any;
165
- instructions: string;
166
- evals: EvalRow[];
167
- }>;
168
-
169
- export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
170
- runtimeContext: RuntimeContext;
171
- agentId: string;
172
- }): Promise<{
173
- id: string;
174
- name: any;
175
- instructions: string;
176
- evals: EvalRow[];
177
- }>;
178
-
179
- export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
180
-
181
- export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
182
-
183
- export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
184
- transports: string[];
185
- }>;
186
-
187
- /**
188
- * Handler for GET /api/mcp/servers/:serverId
189
- * Returns details about a specific MCP server
190
- */
191
- declare const getMcpServerHandler: ({ mastra, serverId }: {
192
- mastra: Mastra;
193
- serverId: string;
194
- }) => Promise<{
195
- id: string;
196
- name: string;
197
- version: string;
198
- tools: {
199
- name: string;
200
- description: any;
201
- parameters: any;
202
- }[];
203
- }>;
204
- export { getMcpServerHandler }
205
- export { getMcpServerHandler as getMcpServerHandler_alias_2 }
206
-
207
- /**
208
- * Handler for GET /api/mcp/servers/:serverId
209
- * Returns details about a specific MCP server
210
- */
211
- export declare const getMcpServerHandler_alias_1: ({ mastra, serverId }: {
212
- mastra: Mastra;
213
- serverId: string;
214
- }) => Promise<{
215
- error: string;
216
- status: number;
217
- id?: undefined;
218
- name?: undefined;
219
- version?: undefined;
220
- tools?: undefined;
221
- } | {
222
- id: string;
223
- name: string;
224
- version: string;
225
- tools: {
226
- name: string;
227
- description: string | undefined;
228
- inputSchema: string | undefined;
229
- }[];
230
- error?: undefined;
231
- status?: undefined;
232
- }>;
233
-
234
- /**
235
- * Handler for GET /api/mcp/servers
236
- * Lists all MCP servers registered on the Mastra instance
237
- */
238
- declare const getMcpServersHandler: ({ mastra }: {
239
- mastra: Mastra;
240
- }) => Promise<{
241
- servers: {
242
- id: string;
243
- name: string;
244
- version: string;
245
- tools: number;
246
- }[];
247
- }>;
248
- export { getMcpServersHandler }
249
- export { getMcpServersHandler as getMcpServersHandler_alias_2 }
250
-
251
- /**
252
- * Handler for GET /api/mcp/servers
253
- * Lists all MCP servers registered on the Mastra instance
254
- */
255
- export declare const getMcpServersHandler_alias_1: ({ mastra }: {
256
- mastra: Mastra;
257
- }) => Promise<{
258
- servers: {
259
- id: string;
260
- name: string;
261
- version: string;
262
- tools: number;
263
- }[];
264
- }>;
265
-
266
- export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
267
- result: boolean;
268
- }>;
269
-
270
- export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
271
- messages: CoreMessage[];
272
- uiMessages: Message[];
273
- }>;
274
-
275
- export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
276
- id: string;
277
- name: string;
278
- instructions: string;
279
- agents: {
280
- name: string;
281
- provider: string;
282
- modelId: string;
283
- }[];
284
- routingModel: {
285
- provider: string;
286
- modelId: string;
287
- };
288
- }>;
289
-
290
- export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
291
- id: string;
292
- name: string;
293
- instructions: string;
294
- agents: {
295
- name: string;
296
- provider: string;
297
- modelId: string;
298
- }[];
299
- routingModel: {
300
- provider: string;
301
- modelId: string;
302
- };
303
- }[]>;
304
-
305
- /**
306
- * Get available speakers for an agent
307
- */
308
- export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): Promise<{
309
- voiceId: string;
310
- }[]>;
311
-
312
- export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
313
-
314
- export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
315
-
316
- export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
317
-
318
- export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
319
-
320
- export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
321
-
322
- export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<{
323
- steps: any;
324
- name: string | undefined;
325
- stepGraph: SerializedStepFlowEntry[];
326
- inputSchema: string | undefined;
327
- outputSchema: string | undefined;
328
- }>;
329
-
330
- export declare function getVNextWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRun']>>;
331
-
332
- export declare function getVNextWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: VNextWorkflowContext & {
333
- fromDate?: Date;
334
- toDate?: Date;
335
- limit?: number;
336
- offset?: number;
337
- resourceId?: string;
338
- }): Promise<WorkflowRuns>;
339
-
340
- export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
341
-
342
- export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
343
- stepGraph: StepGraph;
344
- stepSubscriberGraph: Record<string, StepGraph>;
345
- serializedStepGraph: StepGraph;
346
- serializedStepSubscriberGraph: Record<string, StepGraph>;
347
- name: string;
348
- triggerSchema: string | undefined;
349
- steps: any;
350
- }>;
351
-
352
- export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
353
-
354
- export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
355
- fromDate?: Date;
356
- toDate?: Date;
357
- limit?: number;
358
- offset?: number;
359
- resourceId?: string;
360
- }): Promise<WorkflowRuns>;
361
-
362
- export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
363
-
364
- export declare function handleError(error: unknown, defaultMessage: string): never;
365
-
366
- /**
367
- * `HTTPException` must be used when a fatal error such as authentication failure occurs.
368
- *
369
- * @see {@link https://hono.dev/docs/api/exception}
370
- *
371
- * @param {StatusCode} status - status code of HTTPException
372
- * @param {HTTPExceptionOptions} options - options of HTTPException
373
- * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
374
- * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
375
- * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
376
- *
377
- * @example
378
- * ```ts
379
- * import { HTTPException } from 'hono/http-exception'
380
- *
381
- * // ...
382
- *
383
- * app.post('/auth', async (c, next) => {
384
- * // authentication
385
- * if (authorized === false) {
386
- * throw new HTTPException(401, { message: 'Custom error message' })
387
- * }
388
- * await next()
389
- * })
390
- * ```
391
- */
392
- export declare class HTTPException extends Error {
393
- readonly res?: Response;
394
- readonly status: StatusCode;
395
- /**
396
- * Creates an instance of `HTTPException`.
397
- * @param status - HTTP status code for the exception. Defaults to 500.
398
- * @param options - Additional options for the exception.
399
- */
400
- constructor(status?: StatusCode, options?: HTTPExceptionOptions);
401
- /**
402
- * Returns the response object associated with the exception.
403
- * If a response object is not provided, a new response is created with the error message and status code.
404
- * @returns The response object.
405
- */
406
- getResponse(): Response;
407
- }
408
-
409
- /**
410
- * Options for creating an `HTTPException`.
411
- * @property res - Optional response object to use.
412
- * @property message - Optional custom error message.
413
- * @property cause - Optional cause of the error.
414
- */
415
- declare type HTTPExceptionOptions = {
416
- res?: Response;
417
- message?: string;
418
- cause?: unknown;
419
- };
420
-
421
- /**
422
- * @module
423
- * This module provides the `HTTPException` class.
424
- */
425
- declare type InfoStatusCode = 100 | 101 | 102 | 103;
426
-
427
- export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
428
-
429
- export declare namespace logs {
430
- export {
431
- getLogsHandler,
432
- getLogsByRunIdHandler,
433
- getLogTransports
434
- }
435
- }
436
-
437
- declare type LogsContext = {
438
- mastra: Mastra_2;
439
- transportId?: string;
440
- runId?: string;
441
- };
442
-
443
- export declare namespace memory {
444
- export {
445
- getMemoryStatusHandler,
446
- getThreadsHandler,
447
- getThreadByIdHandler,
448
- saveMessagesHandler,
449
- createThreadHandler,
450
- updateThreadHandler,
451
- deleteThreadHandler,
452
- getMessagesHandler
453
- }
454
- }
455
-
456
- declare interface MemoryContext extends Context {
457
- agentId?: string;
458
- resourceId?: string;
459
- threadId?: string;
460
- }
461
-
462
- export declare namespace network {
463
- export {
464
- getNetworksHandler,
465
- getNetworkByIdHandler,
466
- generateHandler_alias_1 as generateHandler,
467
- streamGenerateHandler_alias_1 as streamGenerateHandler
468
- }
469
- }
470
-
471
- declare interface NetworkContext extends Context {
472
- networkId?: string;
473
- runtimeContext: RuntimeContext;
474
- }
475
-
476
- declare interface QueryRequest {
477
- indexName: string;
478
- queryVector: number[];
479
- topK?: number;
480
- filter?: Record<string, any>;
481
- includeVector?: boolean;
482
- }
483
-
484
- export declare function queryVectors({ mastra, vectorName, query, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
485
- query: QueryRequest;
486
- }): Promise<QueryResult[]>;
487
-
488
- declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
489
-
490
- export declare function resumeAsyncVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
491
- body: {
492
- step: string | string[];
493
- resumeData?: unknown;
494
- };
495
- runtimeContext?: RuntimeContext_2;
496
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
497
-
498
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
499
- body: {
500
- stepId: string;
501
- context: any;
502
- };
503
- runtimeContext: RuntimeContext;
504
- }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
505
-
506
- export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
507
- body: {
508
- step: string | string[];
509
- resumeData?: unknown;
510
- };
511
- runtimeContext?: RuntimeContext_2;
512
- }): Promise<{
513
- message: string;
514
- }>;
515
-
516
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
517
- body: {
518
- stepId: string;
519
- context: any;
520
- };
521
- runtimeContext: RuntimeContext;
522
- }): Promise<{
523
- message: string;
524
- }>;
525
-
526
- export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
527
- body: {
528
- messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
529
- };
530
- }): Promise<MessageType[]>;
531
-
532
- declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
533
-
534
- export declare function startAsyncVNextWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
535
- inputData?: unknown;
536
- runtimeContext?: RuntimeContext_2;
537
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
538
-
539
- export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
540
- triggerData?: unknown;
541
- runtimeContext: RuntimeContext;
542
- }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
543
-
544
- export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
545
- inputData?: unknown;
546
- runtimeContext?: RuntimeContext_2;
547
- }): Promise<{
548
- message: string;
549
- }>;
550
-
551
- export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
552
- triggerData?: unknown;
553
- runtimeContext: RuntimeContext;
554
- }): Promise<{
555
- message: string;
556
- }>;
557
-
558
- /**
559
- * If you want to use an unofficial status, use `UnofficialStatusCode`.
560
- */
561
- export declare type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode;
562
-
563
- export declare function storeTelemetryHandler({ mastra, body }: Context & {
564
- body: {
565
- resourceSpans: any[];
566
- };
567
- }): Promise<{
568
- status: string;
569
- message: string;
570
- error: any;
571
- } | {
572
- status: string;
573
- message: string;
574
- traceCount: number;
575
- }>;
576
-
577
- export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
578
- runtimeContext: RuntimeContext;
579
- agentId: string;
580
- body: GetBody<'stream'> & {
581
- resourceid?: string;
582
- };
583
- }): Promise<Response | undefined>;
584
-
585
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
586
- runtimeContext: RuntimeContext;
587
- body: {
588
- messages?: Parameters<AgentNetwork['stream']>[0];
589
- } & Parameters<AgentNetwork['stream']>[1];
590
- }): Promise<Response>;
591
-
592
- declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
593
-
594
- export declare namespace telemetry {
595
- export {
596
- getTelemetryHandler,
597
- storeTelemetryHandler
598
- }
599
- }
600
-
601
- declare interface TelemetryContext extends Context {
602
- body?: {
603
- name?: string;
604
- scope?: string;
605
- page?: number;
606
- perPage?: number;
607
- attribute?: string | string[];
608
- fromDate?: Date;
609
- toDate?: Date;
610
- };
611
- }
612
-
613
- export declare namespace tools {
614
- export {
615
- getToolsHandler,
616
- getToolByIdHandler,
617
- executeToolHandler,
618
- executeAgentToolHandler
619
- }
620
- }
621
-
622
- declare interface ToolsContext extends Context {
623
- tools?: Record<string, ToolAction | VercelTool>;
624
- toolId?: string;
625
- runId?: string;
626
- }
627
-
628
- /**
629
- * Transcribe speech to text
630
- */
631
- export declare function transcribeSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
632
- body?: {
633
- audioData?: Buffer;
634
- options?: Parameters<NonNullable<Agent['voice']>['listen']>[1];
635
- };
636
- }): Promise<{
637
- text: string | void | NodeJS.ReadableStream;
638
- }>;
639
-
640
- /**
641
- * @deprecated
642
- * Use `UnofficialStatusCode` instead.
643
- */
644
- export declare type UnOfficalStatusCode = UnofficialStatusCode;
645
-
646
- /**
647
- * `UnofficialStatusCode` can be used to specify an unofficial status code.
648
- * @example
649
- *
650
- * ```ts
651
- * app.get('/unknown', (c) => {
652
- * return c.text("Unknown Error", 520 as UnofficialStatusCode)
653
- * })
654
- * ```
655
- */
656
- export declare type UnofficialStatusCode = -1;
657
-
658
- export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
659
- body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
660
- }): Promise<StorageThreadType>;
661
-
662
- declare interface UpsertRequest {
663
- indexName: string;
664
- vectors: number[][];
665
- metadata?: Record<string, any>[];
666
- ids?: string[];
667
- }
668
-
669
- export declare function upsertVectors({ mastra, vectorName, index }: VectorContext & {
670
- index: UpsertRequest;
671
- }): Promise<{
672
- ids: string[];
673
- }>;
674
-
675
- export declare function validateBody(body: Record<string, unknown>): void;
676
-
677
- export declare namespace vector {
678
- export {
679
- upsertVectors,
680
- createIndex,
681
- queryVectors,
682
- listIndexes,
683
- describeIndex,
684
- deleteIndex
685
- }
686
- }
687
-
688
- declare interface VectorContext extends Context {
689
- vectorName?: string;
690
- }
691
-
692
- declare interface VNextWorkflowContext extends Context {
693
- workflowId?: string;
694
- runId?: string;
695
- }
696
-
697
- export declare namespace vNextWorkflows {
698
- export {
699
- getVNextWorkflowsHandler,
700
- getVNextWorkflowByIdHandler,
701
- getVNextWorkflowRunHandler,
702
- createVNextWorkflowRunHandler,
703
- startAsyncVNextWorkflowHandler,
704
- startVNextWorkflowRunHandler,
705
- watchVNextWorkflowHandler,
706
- resumeAsyncVNextWorkflowHandler,
707
- resumeVNextWorkflowHandler,
708
- getVNextWorkflowRunsHandler
709
- }
710
- }
711
-
712
- export declare namespace voice {
713
- export {
714
- getSpeakersHandler,
715
- generateSpeechHandler,
716
- transcribeSpeechHandler
717
- }
718
- }
719
-
720
- declare interface VoiceContext extends Context {
721
- agentId?: string;
722
- }
723
-
724
- export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
725
-
726
- export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
727
-
728
- declare interface WorkflowContext extends Context {
729
- workflowId?: string;
730
- runId?: string;
731
- }
732
-
733
- export declare namespace workflows {
734
- export {
735
- getWorkflowsHandler,
736
- getWorkflowByIdHandler,
737
- startAsyncWorkflowHandler,
738
- getWorkflowRunHandler,
739
- createRunHandler,
740
- startWorkflowRunHandler,
741
- watchWorkflowHandler,
742
- resumeAsyncWorkflowHandler,
743
- resumeWorkflowHandler,
744
- getWorkflowRunsHandler
745
- }
746
- }
747
-
748
- export { }