@mastra/server 0.0.0-remove-cloud-span-transform-20250425214156 → 0.0.0-scorers-api-v2-20250801171841

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