@mastra/server 0.0.0-generate-message-id-20250512171942 → 0.0.0-http-transporter-20250702160118

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 (85) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +394 -128
  2. package/dist/_tsup-dts-rollup.d.ts +394 -128
  3. package/dist/{chunk-OCWPVYNI.cjs → chunk-2KZFMI6P.cjs} +1 -0
  4. package/dist/{chunk-VPNDC2DI.cjs → chunk-2SLFAFTR.cjs} +12 -12
  5. package/dist/chunk-4D66QEKC.js +81 -0
  6. package/dist/{chunk-EJO45KYT.js → chunk-5PQQ42EZ.js} +43 -43
  7. package/dist/{chunk-4YZ3U35L.cjs → chunk-7TP2LX5L.cjs} +18 -18
  8. package/dist/chunk-B2PAS2IB.cjs +514 -0
  9. package/dist/{chunk-Q6KMBIAN.js → chunk-BK4XT6EG.js} +93 -14
  10. package/dist/{chunk-57CJTIPW.cjs → chunk-CCGRCYWJ.cjs} +2 -2
  11. package/dist/{chunk-C7564HUT.js → chunk-CRCR3ZUK.js} +3 -3
  12. package/dist/{chunk-24EGIVT7.cjs → chunk-DN7K6FJK.cjs} +91 -54
  13. package/dist/{chunk-ZE5AAC4I.cjs → chunk-FRVBFMO2.cjs} +26 -36
  14. package/dist/{chunk-MHKNLNAN.cjs → chunk-G7KH752Y.cjs} +10 -7
  15. package/dist/{chunk-P6SCPDYW.js → chunk-GHC4YV6R.js} +5 -1
  16. package/dist/chunk-H7DMHBKY.js +498 -0
  17. package/dist/chunk-JMLYCXMK.cjs +332 -0
  18. package/dist/{chunk-HFWCEP5S.js → chunk-KHZKYUNR.js} +33 -10
  19. package/dist/{chunk-NYN7KFXL.js → chunk-LCM566I4.js} +1 -0
  20. package/dist/chunk-LF7P5PLR.js +14 -0
  21. package/dist/{chunk-YWLUOY3D.cjs → chunk-LI436ITD.cjs} +107 -69
  22. package/dist/{chunk-TJKLBTFB.js → chunk-LRCAAFUA.js} +10 -20
  23. package/dist/{chunk-3HQNCTZ2.cjs → chunk-LZ3VJXSO.cjs} +107 -28
  24. package/dist/{chunk-LIVAK2DM.js → chunk-MEGCYGBU.js} +108 -70
  25. package/dist/{chunk-X3ZDCS52.js → chunk-MKLYEKEF.js} +62 -25
  26. package/dist/chunk-PZQDCRPV.cjs +16 -0
  27. package/dist/chunk-QGX47B5D.cjs +86 -0
  28. package/dist/{chunk-OR3CIE2H.js → chunk-RG473F6Y.js} +7 -4
  29. package/dist/chunk-RHSWAXKB.cjs +118 -0
  30. package/dist/{chunk-H5PTF3Y4.js → chunk-RSEO4XPX.js} +1 -1
  31. package/dist/{chunk-5SN4U5AC.cjs → chunk-SDPGVWQJ.cjs} +5 -1
  32. package/dist/{chunk-IU5VO2I2.js → chunk-WNVFNNWN.js} +4 -4
  33. package/dist/server/handlers/a2a.cjs +7 -7
  34. package/dist/server/handlers/a2a.js +1 -1
  35. package/dist/server/handlers/agents.cjs +7 -7
  36. package/dist/server/handlers/agents.js +1 -1
  37. package/dist/server/handlers/error.cjs +2 -2
  38. package/dist/server/handlers/error.js +1 -1
  39. package/dist/server/handlers/legacyWorkflows.cjs +46 -0
  40. package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
  41. package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
  42. package/dist/server/handlers/legacyWorkflows.js +1 -0
  43. package/dist/server/handlers/logs.cjs +4 -4
  44. package/dist/server/handlers/logs.js +1 -1
  45. package/dist/server/handlers/memory.cjs +9 -9
  46. package/dist/server/handlers/memory.js +1 -1
  47. package/dist/server/handlers/network.cjs +5 -5
  48. package/dist/server/handlers/network.js +1 -1
  49. package/dist/server/handlers/telemetry.cjs +3 -3
  50. package/dist/server/handlers/telemetry.js +1 -1
  51. package/dist/server/handlers/tools.cjs +5 -5
  52. package/dist/server/handlers/tools.js +1 -1
  53. package/dist/server/handlers/utils.cjs +2 -2
  54. package/dist/server/handlers/utils.js +1 -1
  55. package/dist/server/handlers/vNextNetwork.cjs +218 -0
  56. package/dist/server/handlers/vNextNetwork.d.cts +6 -0
  57. package/dist/server/handlers/vNextNetwork.d.ts +6 -0
  58. package/dist/server/handlers/vNextNetwork.js +211 -0
  59. package/dist/server/handlers/vector.cjs +7 -7
  60. package/dist/server/handlers/vector.js +1 -1
  61. package/dist/server/handlers/voice.cjs +8 -4
  62. package/dist/server/handlers/voice.d.cts +1 -0
  63. package/dist/server/handlers/voice.d.ts +1 -0
  64. package/dist/server/handlers/voice.js +1 -1
  65. package/dist/server/handlers/workflows.cjs +29 -13
  66. package/dist/server/handlers/workflows.d.cts +6 -2
  67. package/dist/server/handlers/workflows.d.ts +6 -2
  68. package/dist/server/handlers/workflows.js +1 -1
  69. package/dist/server/handlers.cjs +28 -28
  70. package/dist/server/handlers.d.cts +1 -1
  71. package/dist/server/handlers.d.ts +1 -1
  72. package/dist/server/handlers.js +11 -11
  73. package/package.json +12 -13
  74. package/dist/chunk-64U3UDTH.cjs +0 -13
  75. package/dist/chunk-HWZVAG3H.js +0 -49
  76. package/dist/chunk-I2B73Y4I.cjs +0 -332
  77. package/dist/chunk-M5ABIP7D.js +0 -11
  78. package/dist/chunk-MIQYDLLM.js +0 -329
  79. package/dist/chunk-OGCNNUHF.cjs +0 -54
  80. package/dist/chunk-UCTEMO2Q.cjs +0 -341
  81. package/dist/chunk-YBVOQN4M.cjs +0 -94
  82. package/dist/server/handlers/vNextWorkflows.cjs +0 -46
  83. package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
  84. package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
  85. package/dist/server/handlers/vNextWorkflows.js +0 -1
@@ -5,28 +5,35 @@ import type { Artifact } from '@mastra/core/a2a';
5
5
  import type { BaseLogMessage } from '@mastra/core/logger';
6
6
  import { CoreMessage } from 'ai';
7
7
  import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
8
+ import { DefaultEngineType } from '@mastra/core/workflows';
8
9
  import { EvalRow } from '@mastra/core/storage';
9
10
  import { GenerateObjectResult } from 'ai';
10
11
  import { GenerateTextResult } from 'ai';
12
+ import type { IMastraLogger } from '@mastra/core/logger';
11
13
  import type { JSONRPCError } from '@mastra/core/a2a';
12
14
  import { JSONRPCResponse } from '@mastra/core/a2a';
13
- import type { Logger } from '@mastra/core/logger';
15
+ import { LegacyStep } from '@mastra/core/workflows/legacy';
16
+ import type { LegacyWorkflow } from '@mastra/core/workflows/legacy';
17
+ import { LegacyWorkflowRunResult } from '@mastra/core/workflows/legacy';
18
+ import type { LegacyWorkflowRuns } from '@mastra/core/storage';
19
+ import type { LogLevel } from '@mastra/core/logger';
14
20
  import type { Mastra } from '@mastra/core/mastra';
21
+ import type { MastraError } from '@mastra/core/error';
15
22
  import type { MastraMemory } from '@mastra/core/memory';
16
- import { Message } from 'ai';
17
- import type { Message as Message_2 } from '@mastra/core/a2a';
18
- import { MessageType } from '@mastra/core/memory';
19
- import { NewStep } from '@mastra/core/workflows/vNext';
20
- import type { NewWorkflow } from '@mastra/core/workflows/vNext';
23
+ import { MastraMessageV1 } from '@mastra/core/memory';
24
+ import type { Message } from '@mastra/core/a2a';
21
25
  import type { QueryResult } from '@mastra/core/vector';
22
26
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
27
+ import { ReadableStream as ReadableStream_3 } from 'stream/web';
23
28
  import { RuntimeContext } from '@mastra/core/runtime-context';
24
- import { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
25
- import type { SerializedStepFlowEntry } from '@mastra/core/workflows/vNext';
29
+ import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
30
+ import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
26
31
  import { Step } from '@mastra/core/workflows';
27
- import { StepExecutionContext } from '@mastra/core/workflows';
28
- import { StepGraph } from '@mastra/core/workflows';
32
+ import { StepExecutionContext } from '@mastra/core/workflows/legacy';
33
+ import { StepGraph } from '@mastra/core/workflows/legacy';
34
+ import { StepResult } from '@mastra/core/workflows';
29
35
  import { StorageThreadType } from '@mastra/core/memory';
36
+ import { StreamEvent } from '@mastra/core/workflows';
30
37
  import { Task } from '@mastra/core/a2a';
31
38
  import { TaskAndHistory } from '@mastra/core/a2a';
32
39
  import type { TaskContext } from '@mastra/core/a2a';
@@ -35,13 +42,21 @@ import type { TaskQueryParams } from '@mastra/core/a2a';
35
42
  import type { TaskSendParams } from '@mastra/core/a2a';
36
43
  import type { TaskStatus } from '@mastra/core/a2a';
37
44
  import type { ToolAction } from '@mastra/core/tools';
45
+ import { UIMessage } from 'ai';
38
46
  import type { VercelTool } from '@mastra/core/tools';
47
+ import type { WatchEvent } from '@mastra/core/workflows';
39
48
  import type { Workflow } from '@mastra/core/workflows';
40
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
41
- import { WorkflowResult } from '@mastra/core/workflows/vNext';
42
- import { WorkflowRunResult } from '@mastra/core/workflows';
49
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
50
+ import { WorkflowResult } from '@mastra/core/workflows';
43
51
  import type { WorkflowRuns } from '@mastra/core/storage';
52
+ import { ZodBoolean } from 'zod';
53
+ import { ZodEnum } from 'zod';
54
+ import { ZodNumber } from 'zod';
55
+ import { ZodObject } from 'zod';
56
+ import { ZodOptional } from 'zod';
57
+ import { ZodString } from 'zod';
44
58
  import { ZodType } from 'zod';
59
+ import { ZodTypeAny } from 'zod';
45
60
  import { ZodTypeDef } from 'zod';
46
61
 
47
62
  export declare namespace a2a {
@@ -66,20 +81,24 @@ export declare namespace agents {
66
81
  }
67
82
  }
68
83
 
69
- export declare interface ApiError extends Error {
84
+ export declare interface ApiError extends MastraError {
70
85
  message: string;
71
86
  status?: number;
72
87
  }
73
88
 
74
89
  export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
75
90
 
91
+ export declare function cancelWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
92
+ message: string;
93
+ }>;
94
+
76
95
  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;
77
96
 
78
97
  export declare interface Context {
79
98
  mastra: Mastra;
80
99
  }
81
100
 
82
- export declare function convertToCoreMessage(message: Message_2): CoreMessage_2;
101
+ export declare function convertToCoreMessage(message: Message): CoreMessage_2;
83
102
 
84
103
  export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
85
104
 
@@ -95,7 +114,7 @@ declare interface CreateIndexRequest {
95
114
  metric?: 'cosine' | 'euclidean' | 'dotproduct';
96
115
  }
97
116
 
98
- export declare function createRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
117
+ export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
99
118
  runId: string;
100
119
  }>;
101
120
 
@@ -103,18 +122,18 @@ export declare function createSuccessResponse<T>(id: number | string | null, res
103
122
 
104
123
  export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
105
124
  task: Task;
106
- userMessage: Message_2;
107
- history: Message_2[];
125
+ userMessage: Message;
126
+ history: Message[];
108
127
  activeCancellations: Set<string>;
109
128
  }): TaskContext;
110
129
 
111
- export declare function createThreadHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
130
+ export declare function createThreadHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
112
131
  body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
113
132
  resourceId?: string;
114
133
  };
115
134
  }): Promise<StorageThreadType>;
116
135
 
117
- export declare function createVNextWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
136
+ export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
118
137
  runId: string;
119
138
  }>;
120
139
 
@@ -124,7 +143,7 @@ export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<Vec
124
143
  success: boolean;
125
144
  }>;
126
145
 
127
- export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
146
+ export declare function deleteThreadHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<{
128
147
  result: string;
129
148
  }>;
130
149
 
@@ -138,27 +157,26 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
138
157
  metric: string | undefined;
139
158
  }>;
140
159
 
141
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, runtimeContextFromRequest, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
160
+ export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
142
161
  agentId?: string;
143
162
  data: any;
144
163
  runtimeContext: RuntimeContext_2;
145
- runtimeContextFromRequest: Record<string, unknown>;
146
164
  }): Promise<any>;
147
165
 
148
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, runtimeContextFromRequest, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
166
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
149
167
  data?: unknown;
150
168
  runtimeContext: RuntimeContext_2;
151
- runtimeContextFromRequest: Record<string, unknown>;
152
169
  }) => Promise<any>;
153
170
 
154
- export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
171
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
155
172
  runtimeContext: RuntimeContext;
156
173
  agentId: string;
157
174
  body: GetBody<'generate'> & {
158
175
  resourceid?: string;
159
176
  runtimeContext?: Record<string, unknown>;
160
177
  };
161
- }): Promise<GenerateTextResult<any, any>>;
178
+ abortSignal?: AbortSignal;
179
+ }): Promise<GenerateTextResult<any, unknown>>;
162
180
 
163
181
  export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
164
182
  runtimeContext: RuntimeContext;
@@ -177,15 +195,33 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
177
195
  };
178
196
  }): Promise<NodeJS.ReadableStream>;
179
197
 
180
- export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
198
+ export declare function generateVNextNetworkHandler({ mastra, runtimeContext, networkId, body, }: NetworkContext_2 & {
199
+ runtimeContext: RuntimeContext;
200
+ body: {
201
+ message: string;
202
+ threadId?: string;
203
+ resourceId?: string;
204
+ };
205
+ }): Promise<{
206
+ task: string;
207
+ result: string;
208
+ resourceId: string;
209
+ resourceType: "none" | "tool" | "workflow" | "agent";
210
+ }>;
211
+
212
+ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, isPlayground, }: Context & {
213
+ isPlayground?: boolean;
181
214
  runtimeContext: RuntimeContext;
182
215
  agentId: string;
183
216
  }): Promise<{
184
217
  name: any;
185
218
  instructions: string;
186
219
  tools: any;
220
+ workflows: {};
187
221
  provider: string;
188
222
  modelId: string;
223
+ defaultGenerateOptions: any;
224
+ defaultStreamOptions: any;
189
225
  }>;
190
226
 
191
227
  export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
@@ -206,12 +242,22 @@ export declare function getAgentExecutionHandler({ requestId, mastra, agentId, r
206
242
  method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
207
243
  params: TaskSendParams | TaskQueryParams | TaskIdParams;
208
244
  taskStore?: InMemoryTaskStore;
209
- logger?: Logger;
245
+ logger?: IMastraLogger;
210
246
  }): Promise<any>;
211
247
 
212
248
  export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
213
249
  runtimeContext: RuntimeContext;
214
- }): Promise<any>;
250
+ }): Promise<Record<string, Omit<{
251
+ id: string;
252
+ name: any;
253
+ instructions: string;
254
+ tools: any;
255
+ workflows: {};
256
+ provider: string;
257
+ modelId: string;
258
+ defaultGenerateOptions: any;
259
+ defaultStreamOptions: any;
260
+ }, "id">>>;
215
261
 
216
262
  declare type GetBody<T extends keyof Agent & {
217
263
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
@@ -229,6 +275,35 @@ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agent
229
275
  evals: EvalRow[];
230
276
  }>;
231
277
 
278
+ export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
279
+ stepGraph: StepGraph;
280
+ stepSubscriberGraph: Record<string, StepGraph>;
281
+ serializedStepGraph: StepGraph;
282
+ serializedStepSubscriberGraph: Record<string, StepGraph>;
283
+ name: string;
284
+ triggerSchema: string | undefined;
285
+ steps: any;
286
+ }>;
287
+
288
+ export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
289
+
290
+ export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
291
+ fromDate?: Date;
292
+ toDate?: Date;
293
+ limit?: number;
294
+ offset?: number;
295
+ resourceId?: string;
296
+ }): Promise<LegacyWorkflowRuns>;
297
+
298
+ export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
299
+
300
+ /**
301
+ * Get available listeners for an agent
302
+ */
303
+ export declare function getListenerHandler({ mastra, agentId }: VoiceContext): Promise<{
304
+ enabled: boolean;
305
+ }>;
306
+
232
307
  export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
233
308
  runtimeContext: RuntimeContext;
234
309
  agentId: string;
@@ -239,21 +314,35 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, a
239
314
  evals: EvalRow[];
240
315
  }>;
241
316
 
242
- export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
317
+ export declare function getLogsByRunIdHandler({ mastra, runId, transportId, params, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId' | 'params'>): Promise<{
318
+ logs: BaseLogMessage[];
319
+ total: number;
320
+ page: number;
321
+ perPage: number;
322
+ hasMore: boolean;
323
+ }>;
243
324
 
244
- export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
325
+ export declare function getLogsHandler({ mastra, transportId, params, }: Pick<LogsContext, 'mastra' | 'transportId' | 'params'>): Promise<{
326
+ logs: BaseLogMessage[];
327
+ total: number;
328
+ page: number;
329
+ perPage: number;
330
+ hasMore: boolean;
331
+ }>;
245
332
 
246
333
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
247
334
  transports: string[];
248
335
  }>;
249
336
 
250
- export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
337
+ export declare function getMemoryStatusHandler({ mastra, agentId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'>): Promise<{
251
338
  result: boolean;
252
339
  }>;
253
340
 
254
- export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
341
+ export declare function getMessagesHandler({ mastra, agentId, threadId, limit, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
342
+ limit?: number;
343
+ }): Promise<{
255
344
  messages: CoreMessage[];
256
- uiMessages: Message[];
345
+ uiMessages: UIMessage[];
257
346
  }>;
258
347
 
259
348
  export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
@@ -295,47 +384,79 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
295
384
 
296
385
  export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
297
386
 
298
- export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
387
+ export declare function getThreadByIdHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType>;
299
388
 
300
- export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
389
+ export declare function getThreadsHandler({ mastra, agentId, resourceId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType[]>;
301
390
 
302
391
  export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
303
392
 
304
393
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
305
394
 
306
- export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<{
307
- steps: SerializedStep[];
395
+ export declare function getVNextNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
396
+ id: string;
397
+ name: string;
398
+ instructions: string;
399
+ agents: {
400
+ name: string;
401
+ provider: string;
402
+ modelId: string;
403
+ }[];
404
+ workflows: {
405
+ name: string | undefined;
406
+ description: string | undefined;
407
+ inputSchema: string | undefined;
408
+ outputSchema: string | undefined;
409
+ }[];
410
+ tools: {
411
+ id: string;
412
+ description: string;
413
+ }[];
414
+ routingModel: {
415
+ provider: string;
416
+ modelId: string;
417
+ };
418
+ }>;
419
+
420
+ export declare function getVNextNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'runtimeContext'>): Promise<{
421
+ id: string;
422
+ name: string;
423
+ instructions: string;
424
+ tools: {
425
+ id: string;
426
+ description: string;
427
+ }[];
428
+ agents: {
429
+ name: string;
430
+ provider: string;
431
+ modelId: string;
432
+ }[];
433
+ workflows: {
434
+ name: string | undefined;
435
+ description: string | undefined;
436
+ inputSchema: string | undefined;
437
+ outputSchema: string | undefined;
438
+ }[];
439
+ routingModel: {
440
+ provider: string;
441
+ modelId: string;
442
+ };
443
+ }[]>;
444
+
445
+ export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
446
+ steps: Record<string, SerializedStep>;
447
+ allSteps: Record<string, SerializedStep>;
308
448
  name: string | undefined;
449
+ description: string | undefined;
309
450
  stepGraph: SerializedStepFlowEntry[];
310
451
  inputSchema: string | undefined;
311
452
  outputSchema: string | undefined;
312
453
  }>;
313
454
 
314
- export declare function getVNextWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRunById']>>;
315
-
316
- export declare function getVNextWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: VNextWorkflowContext & {
317
- fromDate?: Date;
318
- toDate?: Date;
319
- limit?: number;
320
- offset?: number;
321
- resourceId?: string;
322
- }): Promise<WorkflowRuns>;
323
-
324
- export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
325
-
326
- export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
327
- stepGraph: StepGraph;
328
- stepSubscriberGraph: Record<string, StepGraph>;
329
- serializedStepGraph: StepGraph;
330
- serializedStepSubscriberGraph: Record<string, StepGraph>;
331
- name: string;
332
- triggerSchema: string | undefined;
333
- steps: any;
334
- }>;
455
+ export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
335
456
 
336
- export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
457
+ export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
337
458
 
338
- export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
459
+ export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
339
460
  fromDate?: Date;
340
461
  toDate?: Date;
341
462
  limit?: number;
@@ -343,7 +464,7 @@ export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, t
343
464
  resourceId?: string;
344
465
  }): Promise<WorkflowRuns>;
345
466
 
346
- export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
467
+ export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
347
468
 
348
469
  export declare function handleError(error: unknown, defaultMessage: string): never;
349
470
 
@@ -352,7 +473,7 @@ export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId
352
473
  taskStore: InMemoryTaskStore;
353
474
  agentId: string;
354
475
  taskId: string;
355
- logger?: Logger;
476
+ logger?: IMastraLogger;
356
477
  }): Promise<JSONRPCResponse<Task, unknown>>;
357
478
 
358
479
  export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
@@ -362,21 +483,23 @@ export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }
362
483
  taskId: string;
363
484
  }): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
364
485
 
365
- export declare function handleTaskSend({ requestId, params, taskStore, agent, logger, runtimeContext, }: {
486
+ export declare function handleTaskSend({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
366
487
  requestId: string;
367
488
  params: TaskSendParams;
368
489
  taskStore: InMemoryTaskStore;
369
490
  agent: Agent;
370
- logger?: Logger;
491
+ agentId: string;
492
+ logger?: IMastraLogger;
371
493
  runtimeContext: RuntimeContext;
372
494
  }): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
373
495
 
374
- export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, logger, runtimeContext, }: {
496
+ export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
375
497
  requestId: string;
376
498
  params: TaskSendParams;
377
499
  taskStore: InMemoryTaskStore;
378
500
  agent: Agent;
379
- logger?: Logger;
501
+ agentId: string;
502
+ logger?: IMastraLogger;
380
503
  runtimeContext: RuntimeContext;
381
504
  }): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
382
505
  state: string;
@@ -437,11 +560,13 @@ export declare class HTTPException extends Error {
437
560
  * @property res - Optional response object to use.
438
561
  * @property message - Optional custom error message.
439
562
  * @property cause - Optional cause of the error.
563
+ * @property stack - Optional stack trace for the error.
440
564
  */
441
565
  declare type HTTPExceptionOptions = {
442
566
  res?: Response;
443
567
  message?: string;
444
568
  cause?: unknown;
569
+ stack?: string;
445
570
  };
446
571
 
447
572
  /**
@@ -463,16 +588,31 @@ export declare class InMemoryTaskStore {
463
588
  }): Promise<void>;
464
589
  }
465
590
 
591
+ export declare namespace legacyWorkflows {
592
+ export {
593
+ getLegacyWorkflowsHandler,
594
+ getLegacyWorkflowByIdHandler,
595
+ startAsyncLegacyWorkflowHandler,
596
+ getLegacyWorkflowRunHandler,
597
+ createLegacyWorkflowRunHandler,
598
+ startLegacyWorkflowRunHandler,
599
+ watchLegacyWorkflowHandler,
600
+ resumeAsyncLegacyWorkflowHandler,
601
+ resumeLegacyWorkflowHandler,
602
+ getLegacyWorkflowRunsHandler
603
+ }
604
+ }
605
+
466
606
  export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
467
607
 
468
608
  export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
469
609
  agentId: string;
470
610
  taskId: string;
471
611
  taskStore: InMemoryTaskStore;
472
- message: Message_2;
612
+ message: Message;
473
613
  sessionId?: string | null;
474
614
  metadata?: Record<string, unknown> | null;
475
- logger?: Logger;
615
+ logger?: IMastraLogger;
476
616
  }): Promise<TaskAndHistory>;
477
617
 
478
618
  export declare namespace logs {
@@ -487,8 +627,72 @@ declare type LogsContext = {
487
627
  mastra: Mastra;
488
628
  transportId?: string;
489
629
  runId?: string;
630
+ params?: {
631
+ fromDate?: Date;
632
+ toDate?: Date;
633
+ logLevel?: LogLevel;
634
+ filters?: string | string[];
635
+ page?: number;
636
+ perPage?: number;
637
+ };
490
638
  };
491
639
 
640
+ export declare function loopStreamVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
641
+ runtimeContext: RuntimeContext;
642
+ body: {
643
+ message: string;
644
+ threadId?: string;
645
+ resourceId?: string;
646
+ maxIterations?: number;
647
+ };
648
+ }): Promise<{
649
+ stream: ReadableStream_3<StreamEvent>;
650
+ getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
651
+ task: ZodString;
652
+ resourceId: ZodString;
653
+ resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
654
+ prompt: ZodString;
655
+ result: ZodString;
656
+ isComplete: ZodOptional<ZodBoolean>;
657
+ completionReason: ZodOptional<ZodString>;
658
+ iteration: ZodNumber;
659
+ }, "strip", ZodTypeAny, {
660
+ prompt: string;
661
+ resourceId: string;
662
+ result: string;
663
+ task: string;
664
+ resourceType: "none" | "tool" | "workflow" | "agent";
665
+ iteration: number;
666
+ isComplete?: boolean | undefined;
667
+ completionReason?: string | undefined;
668
+ }, {
669
+ prompt: string;
670
+ resourceId: string;
671
+ result: string;
672
+ task: string;
673
+ resourceType: "none" | "tool" | "workflow" | "agent";
674
+ iteration: number;
675
+ isComplete?: boolean | undefined;
676
+ completionReason?: string | undefined;
677
+ }>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
678
+ }>;
679
+
680
+ export declare function loopVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
681
+ runtimeContext: RuntimeContext;
682
+ body: {
683
+ message: string;
684
+ };
685
+ }): Promise<{
686
+ status: "success";
687
+ result: {
688
+ text: string;
689
+ iteration: number;
690
+ };
691
+ steps: {
692
+ [x: string]: StepResult<any, any, any, any> | StepResult<unknown, unknown, unknown, unknown>;
693
+ };
694
+ }>;
695
+
492
696
  export declare namespace memory {
493
697
  export {
494
698
  getMemoryStatusHandler,
@@ -506,6 +710,8 @@ declare interface MemoryContext extends Context {
506
710
  agentId?: string;
507
711
  resourceId?: string;
508
712
  threadId?: string;
713
+ networkId?: string;
714
+ runtimeContext?: RuntimeContext_2;
509
715
  }
510
716
 
511
717
  export declare namespace network {
@@ -522,7 +728,12 @@ declare interface NetworkContext extends Context {
522
728
  runtimeContext: RuntimeContext;
523
729
  }
524
730
 
525
- export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: Logger): JSONRPCResponse<null, unknown>;
731
+ declare interface NetworkContext_2 extends Context {
732
+ networkId?: string;
733
+ runtimeContext: RuntimeContext;
734
+ }
735
+
736
+ export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
526
737
 
527
738
  declare interface QueryRequest {
528
739
  indexName: string;
@@ -538,24 +749,33 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
538
749
 
539
750
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
540
751
 
541
- export declare function resumeAsyncVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, runtimeContextFromRequest, }: VNextWorkflowContext & {
752
+ export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
753
+ body: {
754
+ stepId: string;
755
+ context: any;
756
+ };
757
+ runtimeContext: RuntimeContext;
758
+ }): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
759
+
760
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
542
761
  body: {
543
762
  step: string | string[];
544
763
  resumeData?: unknown;
545
764
  };
546
765
  runtimeContext?: RuntimeContext_2;
547
- runtimeContextFromRequest?: Record<string, unknown>;
548
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
766
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
549
767
 
550
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
768
+ export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
551
769
  body: {
552
770
  stepId: string;
553
771
  context: any;
554
772
  };
555
773
  runtimeContext: RuntimeContext;
556
- }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
774
+ }): Promise<{
775
+ message: string;
776
+ }>;
557
777
 
558
- export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
778
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
559
779
  body: {
560
780
  step: string | string[];
561
781
  resumeData?: unknown;
@@ -565,22 +785,19 @@ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId,
565
785
  message: string;
566
786
  }>;
567
787
 
568
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
788
+ export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
569
789
  body: {
570
- stepId: string;
571
- context: any;
790
+ messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
572
791
  };
573
- runtimeContext: RuntimeContext;
792
+ }): Promise<MastraMessageV1[]>;
793
+
794
+ export declare function sendWorkflowRunEventHandler({ mastra, workflowId, runId, event, data, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
795
+ event: string;
796
+ data: unknown;
574
797
  }): Promise<{
575
798
  message: string;
576
799
  }>;
577
800
 
578
- export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
579
- body: {
580
- messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
581
- };
582
- }): Promise<MessageType[]>;
583
-
584
801
  declare type SerializedStep = {
585
802
  id: string;
586
803
  description: string;
@@ -592,28 +809,26 @@ declare type SerializedStep = {
592
809
 
593
810
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
594
811
 
595
- export declare function startAsyncVNextWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, runtimeContextFromRequest, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
596
- inputData?: unknown;
597
- runtimeContext?: RuntimeContext_2;
598
- runtimeContextFromRequest?: Record<string, unknown>;
599
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
600
-
601
- export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
812
+ export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
602
813
  triggerData?: unknown;
603
814
  runtimeContext: RuntimeContext;
604
- }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
815
+ }): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
605
816
 
606
- export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, runtimeContextFromRequest, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
817
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
607
818
  inputData?: unknown;
608
819
  runtimeContext?: RuntimeContext_2;
609
- runtimeContextFromRequest?: Record<string, unknown>;
820
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
821
+
822
+ export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
823
+ triggerData?: unknown;
824
+ runtimeContext: RuntimeContext;
610
825
  }): Promise<{
611
826
  message: string;
612
827
  }>;
613
828
 
614
- export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
615
- triggerData?: unknown;
616
- runtimeContext: RuntimeContext;
829
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
830
+ inputData?: unknown;
831
+ runtimeContext?: RuntimeContext_2;
617
832
  }): Promise<{
618
833
  message: string;
619
834
  }>;
@@ -631,19 +846,24 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
631
846
  status: string;
632
847
  message: string;
633
848
  error: any;
849
+ } | {
850
+ status: string;
851
+ message: string;
852
+ traceCount?: undefined;
634
853
  } | {
635
854
  status: string;
636
855
  message: string;
637
856
  traceCount: number;
638
857
  }>;
639
858
 
640
- export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
859
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
641
860
  runtimeContext: RuntimeContext;
642
861
  agentId: string;
643
862
  body: GetBody<'stream'> & {
644
863
  resourceid?: string;
645
864
  runtimeContext?: string;
646
865
  };
866
+ abortSignal?: AbortSignal;
647
867
  }): Promise<Response | undefined>;
648
868
 
649
869
  export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
@@ -653,6 +873,62 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
653
873
  } & Parameters<AgentNetwork['stream']>[1];
654
874
  }): Promise<Response>;
655
875
 
876
+ export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
877
+ runtimeContext: RuntimeContext;
878
+ body: {
879
+ message: string;
880
+ threadId?: string;
881
+ resourceId?: string;
882
+ };
883
+ }): Promise<{
884
+ stream: ReadableStream_3<StreamEvent>;
885
+ getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
886
+ task: ZodString;
887
+ resourceId: ZodString;
888
+ resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
889
+ prompt: ZodString;
890
+ result: ZodString;
891
+ isComplete: ZodOptional<ZodBoolean>;
892
+ completionReason: ZodOptional<ZodString>;
893
+ iteration: ZodNumber;
894
+ threadId: ZodOptional<ZodString>;
895
+ threadResourceId: ZodOptional<ZodString>;
896
+ isOneOff: ZodBoolean;
897
+ }, "strip", ZodTypeAny, {
898
+ prompt: string;
899
+ resourceId: string;
900
+ result: string;
901
+ task: string;
902
+ resourceType: "none" | "tool" | "workflow" | "agent";
903
+ iteration: number;
904
+ isOneOff: boolean;
905
+ threadId?: string | undefined;
906
+ threadResourceId?: string | undefined;
907
+ isComplete?: boolean | undefined;
908
+ completionReason?: string | undefined;
909
+ }, {
910
+ prompt: string;
911
+ resourceId: string;
912
+ result: string;
913
+ task: string;
914
+ resourceType: "none" | "tool" | "workflow" | "agent";
915
+ iteration: number;
916
+ isOneOff: boolean;
917
+ threadId?: string | undefined;
918
+ threadResourceId?: string | undefined;
919
+ isComplete?: boolean | undefined;
920
+ completionReason?: string | undefined;
921
+ }>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
922
+ }>;
923
+
924
+ export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
925
+ inputData?: unknown;
926
+ runtimeContext?: RuntimeContext_2;
927
+ }): Promise<{
928
+ stream: ReadableStream_2<StreamEvent>;
929
+ getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
930
+ }>;
931
+
656
932
  declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
657
933
 
658
934
  export declare namespace telemetry {
@@ -719,7 +995,7 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
719
995
  */
720
996
  export declare type UnofficialStatusCode = -1;
721
997
 
722
- export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
998
+ export declare function updateThreadHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
723
999
  body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
724
1000
  }): Promise<StorageThreadType>;
725
1001
 
@@ -753,31 +1029,12 @@ declare interface VectorContext extends Context {
753
1029
  vectorName?: string;
754
1030
  }
755
1031
 
756
- declare interface VNextWorkflowContext extends Context {
757
- workflowId?: string;
758
- runId?: string;
759
- }
760
-
761
- export declare namespace vNextWorkflows {
762
- export {
763
- getVNextWorkflowsHandler,
764
- getVNextWorkflowByIdHandler,
765
- getVNextWorkflowRunByIdHandler,
766
- createVNextWorkflowRunHandler,
767
- startAsyncVNextWorkflowHandler,
768
- startVNextWorkflowRunHandler,
769
- watchVNextWorkflowHandler,
770
- resumeAsyncVNextWorkflowHandler,
771
- resumeVNextWorkflowHandler,
772
- getVNextWorkflowRunsHandler
773
- }
774
- }
775
-
776
1032
  export declare namespace voice {
777
1033
  export {
778
1034
  getSpeakersHandler,
779
1035
  generateSpeechHandler,
780
- transcribeSpeechHandler
1036
+ transcribeSpeechHandler,
1037
+ getListenerHandler
781
1038
  }
782
1039
  }
783
1040
 
@@ -785,27 +1042,36 @@ declare interface VoiceContext extends Context {
785
1042
  agentId?: string;
786
1043
  }
787
1044
 
788
- export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
1045
+ export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
789
1046
 
790
- export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
1047
+ export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
791
1048
 
792
1049
  declare interface WorkflowContext extends Context {
793
1050
  workflowId?: string;
794
1051
  runId?: string;
795
1052
  }
796
1053
 
1054
+ declare interface WorkflowContext_3 extends Context {
1055
+ workflowId?: string;
1056
+ runId?: string;
1057
+ }
1058
+
797
1059
  export declare namespace workflows {
798
1060
  export {
799
1061
  getWorkflowsHandler,
800
1062
  getWorkflowByIdHandler,
1063
+ getWorkflowRunByIdHandler,
1064
+ getWorkflowRunExecutionResultHandler,
1065
+ createWorkflowRunHandler,
801
1066
  startAsyncWorkflowHandler,
802
- getWorkflowRunHandler,
803
- createRunHandler,
804
1067
  startWorkflowRunHandler,
805
1068
  watchWorkflowHandler,
1069
+ streamWorkflowHandler,
806
1070
  resumeAsyncWorkflowHandler,
807
1071
  resumeWorkflowHandler,
808
- getWorkflowRunsHandler
1072
+ getWorkflowRunsHandler,
1073
+ cancelWorkflowRunHandler,
1074
+ sendWorkflowRunEventHandler
809
1075
  }
810
1076
  }
811
1077