@mastra/server 0.0.0-llamaindex-switch-core-20250424001624 → 0.0.0-main-test-20251105183450

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