@mastra/server 0.0.0-separate-trace-data-from-component-20250501141108 → 0.0.0-support-d1-client-20250701191943

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 (91) hide show
  1. package/README.md +48 -135
  2. package/dist/_tsup-dts-rollup.d.cts +517 -103
  3. package/dist/_tsup-dts-rollup.d.ts +517 -103
  4. package/dist/{chunk-2FJURXCL.cjs → chunk-3DKDT264.cjs} +93 -55
  5. package/dist/{chunk-Y3SV5XK4.js → chunk-4QBIUKVY.js} +105 -16
  6. package/dist/{chunk-QN4KF3BH.cjs → chunk-57CJTIPW.cjs} +2 -2
  7. package/dist/chunk-7524QH7G.cjs +483 -0
  8. package/dist/chunk-75ZPJI57.cjs +9 -0
  9. package/dist/{chunk-M3YJLWTU.js → chunk-7GQJAMTA.js} +68 -57
  10. package/dist/chunk-BOXE6WSV.js +81 -0
  11. package/dist/{chunk-WTHDCRMY.js → chunk-BP24Z4WG.js} +12 -6
  12. package/dist/chunk-BWHGBV3K.cjs +278 -0
  13. package/dist/chunk-CNVDCLSY.cjs +86 -0
  14. package/dist/{chunk-5JNVY6DU.js → chunk-DFJUGWNU.js} +7 -5
  15. package/dist/{chunk-5YGDYMRB.cjs → chunk-DPRB3R7Y.cjs} +14 -13
  16. package/dist/{chunk-D3G23FP3.cjs → chunk-FGGMQCPP.cjs} +24 -22
  17. package/dist/{chunk-4JINXASC.js → chunk-FVMGZKFD.js} +5 -4
  18. package/dist/{chunk-Q6SHQECN.js → chunk-G37NVEDX.js} +34 -10
  19. package/dist/chunk-GHC4YV6R.js +504 -0
  20. package/dist/{chunk-L7XE5QTW.js → chunk-H5PTF3Y4.js} +1 -1
  21. package/dist/chunk-L3N7ST2Z.cjs +118 -0
  22. package/dist/chunk-LI436ITD.cjs +2042 -0
  23. package/dist/{chunk-RBQASTUP.js → chunk-LTJNMM2Y.js} +63 -25
  24. package/dist/chunk-MEGCYGBU.js +2039 -0
  25. package/dist/chunk-MLKGABMK.js +7 -0
  26. package/dist/{chunk-ZLBRQFDD.cjs → chunk-MTR2B27E.cjs} +3 -2
  27. package/dist/{chunk-TRDNDNGQ.js → chunk-NYN7KFXL.js} +1 -7
  28. package/dist/{chunk-FV45V6WC.cjs → chunk-OCWPVYNI.cjs} +0 -7
  29. package/dist/{chunk-3AHQ5RGN.js → chunk-QDOJJCS4.js} +3 -2
  30. package/dist/chunk-SDPGVWQJ.cjs +512 -0
  31. package/dist/chunk-TGZIR6AK.cjs +332 -0
  32. package/dist/{chunk-M56ECCHK.cjs → chunk-TVBPFPTN.cjs} +20 -19
  33. package/dist/{chunk-7IWQE76Z.cjs → chunk-ULFULEW4.cjs} +16 -10
  34. package/dist/{chunk-QJ3AHN64.js → chunk-VMXLEF54.js} +4 -3
  35. package/dist/chunk-Z5TH5F35.js +468 -0
  36. package/dist/server/handlers/a2a.cjs +30 -0
  37. package/dist/server/handlers/a2a.d.cts +6 -0
  38. package/dist/server/handlers/a2a.d.ts +6 -0
  39. package/dist/server/handlers/a2a.js +1 -0
  40. package/dist/server/handlers/agents.cjs +7 -7
  41. package/dist/server/handlers/agents.js +1 -1
  42. package/dist/server/handlers/error.cjs +2 -2
  43. package/dist/server/handlers/error.js +1 -1
  44. package/dist/server/handlers/legacyWorkflows.cjs +46 -0
  45. package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
  46. package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
  47. package/dist/server/handlers/legacyWorkflows.js +1 -0
  48. package/dist/server/handlers/logs.cjs +4 -4
  49. package/dist/server/handlers/logs.js +1 -1
  50. package/dist/server/handlers/memory.cjs +9 -9
  51. package/dist/server/handlers/memory.js +1 -1
  52. package/dist/server/handlers/network.cjs +5 -5
  53. package/dist/server/handlers/network.js +1 -1
  54. package/dist/server/handlers/telemetry.cjs +3 -3
  55. package/dist/server/handlers/telemetry.js +1 -1
  56. package/dist/server/handlers/tools.cjs +5 -5
  57. package/dist/server/handlers/tools.js +1 -1
  58. package/dist/server/handlers/utils.cjs +2 -2
  59. package/dist/server/handlers/utils.js +1 -1
  60. package/dist/server/handlers/vNextNetwork.cjs +218 -0
  61. package/dist/server/handlers/vNextNetwork.d.cts +6 -0
  62. package/dist/server/handlers/vNextNetwork.d.ts +6 -0
  63. package/dist/server/handlers/vNextNetwork.js +211 -0
  64. package/dist/server/handlers/vector.cjs +7 -7
  65. package/dist/server/handlers/vector.js +1 -1
  66. package/dist/server/handlers/voice.cjs +8 -4
  67. package/dist/server/handlers/voice.d.cts +1 -0
  68. package/dist/server/handlers/voice.d.ts +1 -0
  69. package/dist/server/handlers/voice.js +1 -1
  70. package/dist/server/handlers/workflows.cjs +25 -13
  71. package/dist/server/handlers/workflows.d.cts +5 -2
  72. package/dist/server/handlers/workflows.d.ts +5 -2
  73. package/dist/server/handlers/workflows.js +1 -1
  74. package/dist/server/handlers.cjs +32 -27
  75. package/dist/server/handlers.d.cts +2 -1
  76. package/dist/server/handlers.d.ts +2 -1
  77. package/dist/server/handlers.js +11 -10
  78. package/package.json +14 -13
  79. package/dist/chunk-3EJZQ6TQ.js +0 -49
  80. package/dist/chunk-4BIX6GMY.cjs +0 -189
  81. package/dist/chunk-55HTWX4C.cjs +0 -93
  82. package/dist/chunk-5SWCVTNL.cjs +0 -5579
  83. package/dist/chunk-AELYAUEE.cjs +0 -316
  84. package/dist/chunk-EVCC233P.cjs +0 -321
  85. package/dist/chunk-JPB6RPGB.js +0 -304
  86. package/dist/chunk-OMN3UI6X.js +0 -5576
  87. package/dist/chunk-SKBVVI24.cjs +0 -54
  88. package/dist/server/handlers/vNextWorkflows.cjs +0 -46
  89. package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
  90. package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
  91. package/dist/server/handlers/vNextWorkflows.js +0 -1
@@ -1,35 +1,75 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
+ import type { AgentCard } from '@mastra/core/a2a';
2
3
  import type { AgentNetwork } from '@mastra/core/network';
4
+ import type { Artifact } from '@mastra/core/a2a';
3
5
  import type { BaseLogMessage } from '@mastra/core/logger';
4
6
  import { CoreMessage } from 'ai';
7
+ import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
8
+ import { DefaultEngineType } from '@mastra/core/workflows';
5
9
  import { EvalRow } from '@mastra/core/storage';
6
10
  import { GenerateObjectResult } from 'ai';
7
11
  import { GenerateTextResult } from 'ai';
12
+ import type { IMastraLogger } from '@mastra/core/logger';
13
+ import type { JSONRPCError } from '@mastra/core/a2a';
14
+ import { JSONRPCResponse } from '@mastra/core/a2a';
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';
8
20
  import type { Mastra } from '@mastra/core/mastra';
21
+ import type { MastraError } from '@mastra/core/error';
9
22
  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';
23
+ import { MastraMessageV1 } from '@mastra/core/memory';
24
+ import type { Message } from '@mastra/core/a2a';
14
25
  import type { QueryResult } from '@mastra/core/vector';
15
26
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
16
- import type { RuntimeContext } from '@mastra/core/runtime-context';
27
+ import { ReadableStream as ReadableStream_3 } from 'stream/web';
28
+ import { RuntimeContext } from '@mastra/core/runtime-context';
17
29
  import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
18
- import { SerializedStepFlowEntry } from '@mastra/core/workflows/vNext';
30
+ import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
19
31
  import { Step } from '@mastra/core/workflows';
20
- import { StepExecutionContext } from '@mastra/core/workflows';
21
- 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';
22
35
  import { StorageThreadType } from '@mastra/core/memory';
36
+ import { StreamEvent } from '@mastra/core/workflows';
37
+ import { Task } from '@mastra/core/a2a';
38
+ import { TaskAndHistory } from '@mastra/core/a2a';
39
+ import type { TaskContext } from '@mastra/core/a2a';
40
+ import type { TaskIdParams } from '@mastra/core/a2a';
41
+ import type { TaskQueryParams } from '@mastra/core/a2a';
42
+ import type { TaskSendParams } from '@mastra/core/a2a';
43
+ import type { TaskStatus } from '@mastra/core/a2a';
23
44
  import type { ToolAction } from '@mastra/core/tools';
45
+ import { UIMessage } from 'ai';
24
46
  import type { VercelTool } from '@mastra/core/tools';
47
+ import type { WatchEvent } from '@mastra/core/workflows';
25
48
  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';
49
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
50
+ import { WorkflowResult } from '@mastra/core/workflows';
29
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';
30
58
  import { ZodType } from 'zod';
59
+ import { ZodTypeAny } from 'zod';
31
60
  import { ZodTypeDef } from 'zod';
32
61
 
62
+ export declare namespace a2a {
63
+ export {
64
+ getAgentCardByIdHandler,
65
+ handleTaskSend,
66
+ handleTaskGet,
67
+ handleTaskSendSubscribe,
68
+ handleTaskCancel,
69
+ getAgentExecutionHandler
70
+ }
71
+ }
72
+
33
73
  export declare namespace agents {
34
74
  export {
35
75
  getAgentsHandler,
@@ -41,17 +81,27 @@ export declare namespace agents {
41
81
  }
42
82
  }
43
83
 
44
- export declare interface ApiError extends Error {
84
+ export declare interface ApiError extends MastraError {
45
85
  message: string;
46
86
  status?: number;
47
87
  }
48
88
 
89
+ export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
90
+
91
+ export declare function cancelWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
92
+ message: string;
93
+ }>;
94
+
49
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;
50
96
 
51
97
  export declare interface Context {
52
98
  mastra: Mastra;
53
99
  }
54
100
 
101
+ export declare function convertToCoreMessage(message: Message): CoreMessage_2;
102
+
103
+ export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
104
+
55
105
  export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
56
106
  index: CreateIndexRequest;
57
107
  }): Promise<{
@@ -64,17 +114,26 @@ declare interface CreateIndexRequest {
64
114
  metric?: 'cosine' | 'euclidean' | 'dotproduct';
65
115
  }
66
116
 
67
- 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<{
68
118
  runId: string;
69
119
  }>;
70
120
 
71
- export declare function createThreadHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
121
+ export declare function createSuccessResponse<T>(id: number | string | null, result: T): JSONRPCResponse<T>;
122
+
123
+ export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
124
+ task: Task;
125
+ userMessage: Message;
126
+ history: Message[];
127
+ activeCancellations: Set<string>;
128
+ }): TaskContext;
129
+
130
+ export declare function createThreadHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
72
131
  body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
73
132
  resourceId?: string;
74
133
  };
75
134
  }): Promise<StorageThreadType>;
76
135
 
77
- 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<{
78
137
  runId: string;
79
138
  }>;
80
139
 
@@ -84,7 +143,7 @@ export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<Vec
84
143
  success: boolean;
85
144
  }>;
86
145
 
87
- 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<{
88
147
  result: string;
89
148
  }>;
90
149
 
@@ -101,21 +160,23 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
101
160
  export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
102
161
  agentId?: string;
103
162
  data: any;
104
- runtimeContext: RuntimeContext;
163
+ runtimeContext: RuntimeContext_2;
105
164
  }): Promise<any>;
106
165
 
107
166
  export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
108
167
  data?: unknown;
109
- runtimeContext: RuntimeContext;
168
+ runtimeContext: RuntimeContext_2;
110
169
  }) => Promise<any>;
111
170
 
112
- export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
171
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
113
172
  runtimeContext: RuntimeContext;
114
173
  agentId: string;
115
174
  body: GetBody<'generate'> & {
116
175
  resourceid?: string;
176
+ runtimeContext?: Record<string, unknown>;
117
177
  };
118
- }): Promise<GenerateTextResult<any, any>>;
178
+ abortSignal?: AbortSignal;
179
+ }): Promise<GenerateTextResult<any, unknown>>;
119
180
 
120
181
  export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
121
182
  runtimeContext: RuntimeContext;
@@ -134,21 +195,70 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
134
195
  };
135
196
  }): Promise<NodeJS.ReadableStream>;
136
197
 
137
- 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;
138
214
  runtimeContext: RuntimeContext;
139
215
  agentId: string;
140
216
  }): Promise<{
141
217
  name: any;
142
218
  instructions: string;
143
219
  tools: any;
220
+ workflows: {};
144
221
  provider: string;
145
222
  modelId: string;
223
+ defaultGenerateOptions: any;
224
+ defaultStreamOptions: any;
146
225
  }>;
147
226
 
148
- export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
227
+ export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
228
+ runtimeContext: RuntimeContext;
229
+ agentId: keyof ReturnType<typeof mastra.getAgents>;
230
+ executionUrl?: string;
231
+ version?: string;
232
+ provider?: {
233
+ organization: string;
234
+ url: string;
235
+ };
236
+ }): Promise<AgentCard>;
237
+
238
+ export declare function getAgentExecutionHandler({ requestId, mastra, agentId, runtimeContext, method, params, taskStore, logger, }: Context & {
239
+ requestId: string;
149
240
  runtimeContext: RuntimeContext;
241
+ agentId: string;
242
+ method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
243
+ params: TaskSendParams | TaskQueryParams | TaskIdParams;
244
+ taskStore?: InMemoryTaskStore;
245
+ logger?: IMastraLogger;
150
246
  }): Promise<any>;
151
247
 
248
+ export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
249
+ runtimeContext: RuntimeContext;
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">>>;
261
+
152
262
  declare type GetBody<T extends keyof Agent & {
153
263
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
154
264
  }[keyof Agent]> = {
@@ -165,6 +275,35 @@ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agent
165
275
  evals: EvalRow[];
166
276
  }>;
167
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
+
168
307
  export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
169
308
  runtimeContext: RuntimeContext;
170
309
  agentId: string;
@@ -175,21 +314,35 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, a
175
314
  evals: EvalRow[];
176
315
  }>;
177
316
 
178
- 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
+ }>;
179
324
 
180
- 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
+ }>;
181
332
 
182
333
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
183
334
  transports: string[];
184
335
  }>;
185
336
 
186
- 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<{
187
338
  result: boolean;
188
339
  }>;
189
340
 
190
- 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<{
191
344
  messages: CoreMessage[];
192
- uiMessages: Message[];
345
+ uiMessages: UIMessage[];
193
346
  }>;
194
347
 
195
348
  export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
@@ -231,45 +384,133 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
231
384
 
232
385
  export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
233
386
 
234
- 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>;
235
388
 
236
- 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[]>;
237
390
 
238
391
  export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
239
392
 
240
393
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
241
394
 
242
- export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<{
243
- steps: any;
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>;
244
448
  name: string | undefined;
449
+ description: string | undefined;
245
450
  stepGraph: SerializedStepFlowEntry[];
246
451
  inputSchema: string | undefined;
247
452
  outputSchema: string | undefined;
248
453
  }>;
249
454
 
250
- export declare function getVNextWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRun']>>;
455
+ export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
251
456
 
252
- export declare function getVNextWorkflowRunsHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<WorkflowRuns>;
457
+ export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
253
458
 
254
- export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
459
+ export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
460
+ fromDate?: Date;
461
+ toDate?: Date;
462
+ limit?: number;
463
+ offset?: number;
464
+ resourceId?: string;
465
+ }): Promise<WorkflowRuns>;
255
466
 
256
- export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
257
- stepGraph: StepGraph;
258
- stepSubscriberGraph: Record<string, StepGraph>;
259
- serializedStepGraph: StepGraph;
260
- serializedStepSubscriberGraph: Record<string, StepGraph>;
261
- name: string;
262
- triggerSchema: string | undefined;
263
- steps: any;
264
- }>;
467
+ export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
265
468
 
266
- export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
469
+ export declare function handleError(error: unknown, defaultMessage: string): never;
267
470
 
268
- export declare function getWorkflowRunsHandler({ mastra, workflowId }: WorkflowContext): Promise<WorkflowRuns>;
471
+ export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId, logger, }: {
472
+ requestId: string;
473
+ taskStore: InMemoryTaskStore;
474
+ agentId: string;
475
+ taskId: string;
476
+ logger?: IMastraLogger;
477
+ }): Promise<JSONRPCResponse<Task, unknown>>;
269
478
 
270
- export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
479
+ export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
480
+ requestId: string;
481
+ taskStore: InMemoryTaskStore;
482
+ agentId: string;
483
+ taskId: string;
484
+ }): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
485
+
486
+ export declare function handleTaskSend({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
487
+ requestId: string;
488
+ params: TaskSendParams;
489
+ taskStore: InMemoryTaskStore;
490
+ agent: Agent;
491
+ agentId: string;
492
+ logger?: IMastraLogger;
493
+ runtimeContext: RuntimeContext;
494
+ }): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
271
495
 
272
- export declare function handleError(error: unknown, defaultMessage: string): never;
496
+ export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
497
+ requestId: string;
498
+ params: TaskSendParams;
499
+ taskStore: InMemoryTaskStore;
500
+ agent: Agent;
501
+ agentId: string;
502
+ logger?: IMastraLogger;
503
+ runtimeContext: RuntimeContext;
504
+ }): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
505
+ state: string;
506
+ message: {
507
+ role: string;
508
+ parts: {
509
+ type: string;
510
+ text: string;
511
+ }[];
512
+ };
513
+ }, unknown>, void, unknown>;
273
514
 
274
515
  /**
275
516
  * `HTTPException` must be used when a fatal error such as authentication failure occurs.
@@ -332,8 +573,46 @@ declare type HTTPExceptionOptions = {
332
573
  */
333
574
  declare type InfoStatusCode = 100 | 101 | 102 | 103;
334
575
 
576
+ export declare class InMemoryTaskStore {
577
+ private store;
578
+ activeCancellations: Set<string>;
579
+ load({ agentId, taskId }: {
580
+ agentId: string;
581
+ taskId: string;
582
+ }): Promise<TaskAndHistory | null>;
583
+ save({ agentId, data }: {
584
+ agentId: string;
585
+ data: TaskAndHistory;
586
+ }): Promise<void>;
587
+ }
588
+
589
+ export declare namespace legacyWorkflows {
590
+ export {
591
+ getLegacyWorkflowsHandler,
592
+ getLegacyWorkflowByIdHandler,
593
+ startAsyncLegacyWorkflowHandler,
594
+ getLegacyWorkflowRunHandler,
595
+ createLegacyWorkflowRunHandler,
596
+ startLegacyWorkflowRunHandler,
597
+ watchLegacyWorkflowHandler,
598
+ resumeAsyncLegacyWorkflowHandler,
599
+ resumeLegacyWorkflowHandler,
600
+ getLegacyWorkflowRunsHandler
601
+ }
602
+ }
603
+
335
604
  export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
336
605
 
606
+ export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
607
+ agentId: string;
608
+ taskId: string;
609
+ taskStore: InMemoryTaskStore;
610
+ message: Message;
611
+ sessionId?: string | null;
612
+ metadata?: Record<string, unknown> | null;
613
+ logger?: IMastraLogger;
614
+ }): Promise<TaskAndHistory>;
615
+
337
616
  export declare namespace logs {
338
617
  export {
339
618
  getLogsHandler,
@@ -346,8 +625,72 @@ declare type LogsContext = {
346
625
  mastra: Mastra;
347
626
  transportId?: string;
348
627
  runId?: string;
628
+ params?: {
629
+ fromDate?: Date;
630
+ toDate?: Date;
631
+ logLevel?: LogLevel;
632
+ filters?: string | string[];
633
+ page?: number;
634
+ perPage?: number;
635
+ };
349
636
  };
350
637
 
638
+ export declare function loopStreamVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
639
+ runtimeContext: RuntimeContext;
640
+ body: {
641
+ message: string;
642
+ threadId?: string;
643
+ resourceId?: string;
644
+ maxIterations?: number;
645
+ };
646
+ }): Promise<{
647
+ stream: ReadableStream_3<StreamEvent>;
648
+ getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
649
+ task: ZodString;
650
+ resourceId: ZodString;
651
+ resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
652
+ prompt: ZodString;
653
+ result: ZodString;
654
+ isComplete: ZodOptional<ZodBoolean>;
655
+ completionReason: ZodOptional<ZodString>;
656
+ iteration: ZodNumber;
657
+ }, "strip", ZodTypeAny, {
658
+ prompt: string;
659
+ resourceId: string;
660
+ result: string;
661
+ task: string;
662
+ resourceType: "none" | "tool" | "workflow" | "agent";
663
+ iteration: number;
664
+ isComplete?: boolean | undefined;
665
+ completionReason?: string | undefined;
666
+ }, {
667
+ prompt: string;
668
+ resourceId: string;
669
+ result: string;
670
+ task: string;
671
+ resourceType: "none" | "tool" | "workflow" | "agent";
672
+ iteration: number;
673
+ isComplete?: boolean | undefined;
674
+ completionReason?: string | undefined;
675
+ }>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
676
+ }>;
677
+
678
+ export declare function loopVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
679
+ runtimeContext: RuntimeContext;
680
+ body: {
681
+ message: string;
682
+ };
683
+ }): Promise<{
684
+ status: "success";
685
+ result: {
686
+ text: string;
687
+ iteration: number;
688
+ };
689
+ steps: {
690
+ [x: string]: StepResult<any, any, any, any> | StepResult<unknown, unknown, unknown, unknown>;
691
+ };
692
+ }>;
693
+
351
694
  export declare namespace memory {
352
695
  export {
353
696
  getMemoryStatusHandler,
@@ -365,6 +708,8 @@ declare interface MemoryContext extends Context {
365
708
  agentId?: string;
366
709
  resourceId?: string;
367
710
  threadId?: string;
711
+ networkId?: string;
712
+ runtimeContext?: RuntimeContext_2;
368
713
  }
369
714
 
370
715
  export declare namespace network {
@@ -381,6 +726,13 @@ declare interface NetworkContext extends Context {
381
726
  runtimeContext: RuntimeContext;
382
727
  }
383
728
 
729
+ declare interface NetworkContext_2 extends Context {
730
+ networkId?: string;
731
+ runtimeContext: RuntimeContext;
732
+ }
733
+
734
+ export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
735
+
384
736
  declare interface QueryRequest {
385
737
  indexName: string;
386
738
  queryVector: number[];
@@ -395,33 +747,23 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
395
747
 
396
748
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
397
749
 
398
- export declare function resumeAsyncVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
399
- body: {
400
- step: string | string[];
401
- resumeData?: unknown;
402
- };
403
- runtimeContext?: RuntimeContext_2;
404
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
405
-
406
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
750
+ export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
407
751
  body: {
408
752
  stepId: string;
409
753
  context: any;
410
754
  };
411
755
  runtimeContext: RuntimeContext;
412
- }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
756
+ }): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
413
757
 
414
- export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
758
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
415
759
  body: {
416
760
  step: string | string[];
417
761
  resumeData?: unknown;
418
762
  };
419
763
  runtimeContext?: RuntimeContext_2;
420
- }): Promise<{
421
- message: string;
422
- }>;
764
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
423
765
 
424
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
766
+ export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
425
767
  body: {
426
768
  stepId: string;
427
769
  context: any;
@@ -431,34 +773,53 @@ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body,
431
773
  message: string;
432
774
  }>;
433
775
 
434
- export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
776
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
777
+ body: {
778
+ step: string | string[];
779
+ resumeData?: unknown;
780
+ };
781
+ runtimeContext?: RuntimeContext_2;
782
+ }): Promise<{
783
+ message: string;
784
+ }>;
785
+
786
+ export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
435
787
  body: {
436
788
  messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
437
789
  };
438
- }): Promise<MessageType[]>;
790
+ }): Promise<MastraMessageV1[]>;
439
791
 
440
- declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
792
+ declare type SerializedStep = {
793
+ id: string;
794
+ description: string;
795
+ inputSchema: string | undefined;
796
+ outputSchema: string | undefined;
797
+ resumeSchema: string | undefined;
798
+ suspendSchema: string | undefined;
799
+ };
441
800
 
442
- export declare function startAsyncVNextWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
443
- inputData?: unknown;
444
- runtimeContext?: RuntimeContext_2;
445
- }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
801
+ declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
446
802
 
447
- export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
803
+ export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
448
804
  triggerData?: unknown;
449
805
  runtimeContext: RuntimeContext;
450
- }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
806
+ }): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
451
807
 
452
- export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
808
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
453
809
  inputData?: unknown;
454
810
  runtimeContext?: RuntimeContext_2;
811
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
812
+
813
+ export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
814
+ triggerData?: unknown;
815
+ runtimeContext: RuntimeContext;
455
816
  }): Promise<{
456
817
  message: string;
457
818
  }>;
458
819
 
459
- export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
460
- triggerData?: unknown;
461
- runtimeContext: RuntimeContext;
820
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
821
+ inputData?: unknown;
822
+ runtimeContext?: RuntimeContext_2;
462
823
  }): Promise<{
463
824
  message: string;
464
825
  }>;
@@ -476,18 +837,24 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
476
837
  status: string;
477
838
  message: string;
478
839
  error: any;
840
+ } | {
841
+ status: string;
842
+ message: string;
843
+ traceCount?: undefined;
479
844
  } | {
480
845
  status: string;
481
846
  message: string;
482
847
  traceCount: number;
483
848
  }>;
484
849
 
485
- export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
850
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
486
851
  runtimeContext: RuntimeContext;
487
852
  agentId: string;
488
853
  body: GetBody<'stream'> & {
489
854
  resourceid?: string;
855
+ runtimeContext?: string;
490
856
  };
857
+ abortSignal?: AbortSignal;
491
858
  }): Promise<Response | undefined>;
492
859
 
493
860
  export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
@@ -497,6 +864,62 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
497
864
  } & Parameters<AgentNetwork['stream']>[1];
498
865
  }): Promise<Response>;
499
866
 
867
+ export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
868
+ runtimeContext: RuntimeContext;
869
+ body: {
870
+ message: string;
871
+ threadId?: string;
872
+ resourceId?: string;
873
+ };
874
+ }): Promise<{
875
+ stream: ReadableStream_3<StreamEvent>;
876
+ getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
877
+ task: ZodString;
878
+ resourceId: ZodString;
879
+ resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
880
+ prompt: ZodString;
881
+ result: ZodString;
882
+ isComplete: ZodOptional<ZodBoolean>;
883
+ completionReason: ZodOptional<ZodString>;
884
+ iteration: ZodNumber;
885
+ threadId: ZodOptional<ZodString>;
886
+ threadResourceId: ZodOptional<ZodString>;
887
+ isOneOff: ZodBoolean;
888
+ }, "strip", ZodTypeAny, {
889
+ prompt: string;
890
+ resourceId: string;
891
+ result: string;
892
+ task: string;
893
+ resourceType: "none" | "tool" | "workflow" | "agent";
894
+ iteration: number;
895
+ isOneOff: boolean;
896
+ threadId?: string | undefined;
897
+ threadResourceId?: string | undefined;
898
+ isComplete?: boolean | undefined;
899
+ completionReason?: string | undefined;
900
+ }, {
901
+ prompt: string;
902
+ resourceId: string;
903
+ result: string;
904
+ task: string;
905
+ resourceType: "none" | "tool" | "workflow" | "agent";
906
+ iteration: number;
907
+ isOneOff: boolean;
908
+ threadId?: string | undefined;
909
+ threadResourceId?: string | undefined;
910
+ isComplete?: boolean | undefined;
911
+ completionReason?: string | undefined;
912
+ }>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
913
+ }>;
914
+
915
+ export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
916
+ inputData?: unknown;
917
+ runtimeContext?: RuntimeContext_2;
918
+ }): Promise<{
919
+ stream: ReadableStream_2<StreamEvent>;
920
+ getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
921
+ }>;
922
+
500
923
  declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
501
924
 
502
925
  export declare namespace telemetry {
@@ -513,6 +936,8 @@ declare interface TelemetryContext extends Context {
513
936
  page?: number;
514
937
  perPage?: number;
515
938
  attribute?: string | string[];
939
+ fromDate?: Date;
940
+ toDate?: Date;
516
941
  };
517
942
  }
518
943
 
@@ -561,7 +986,7 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
561
986
  */
562
987
  export declare type UnofficialStatusCode = -1;
563
988
 
564
- export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
989
+ export declare function updateThreadHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
565
990
  body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
566
991
  }): Promise<StorageThreadType>;
567
992
 
@@ -595,31 +1020,12 @@ declare interface VectorContext extends Context {
595
1020
  vectorName?: string;
596
1021
  }
597
1022
 
598
- declare interface VNextWorkflowContext extends Context {
599
- workflowId?: string;
600
- runId?: string;
601
- }
602
-
603
- export declare namespace vNextWorkflows {
604
- export {
605
- getVNextWorkflowsHandler,
606
- getVNextWorkflowByIdHandler,
607
- getVNextWorkflowRunHandler,
608
- createVNextWorkflowRunHandler,
609
- startAsyncVNextWorkflowHandler,
610
- startVNextWorkflowRunHandler,
611
- watchVNextWorkflowHandler,
612
- resumeAsyncVNextWorkflowHandler,
613
- resumeVNextWorkflowHandler,
614
- getVNextWorkflowRunsHandler
615
- }
616
- }
617
-
618
1023
  export declare namespace voice {
619
1024
  export {
620
1025
  getSpeakersHandler,
621
1026
  generateSpeechHandler,
622
- transcribeSpeechHandler
1027
+ transcribeSpeechHandler,
1028
+ getListenerHandler
623
1029
  }
624
1030
  }
625
1031
 
@@ -627,27 +1033,35 @@ declare interface VoiceContext extends Context {
627
1033
  agentId?: string;
628
1034
  }
629
1035
 
630
- export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
1036
+ export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
631
1037
 
632
- export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
1038
+ export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
633
1039
 
634
1040
  declare interface WorkflowContext extends Context {
635
1041
  workflowId?: string;
636
1042
  runId?: string;
637
1043
  }
638
1044
 
1045
+ declare interface WorkflowContext_3 extends Context {
1046
+ workflowId?: string;
1047
+ runId?: string;
1048
+ }
1049
+
639
1050
  export declare namespace workflows {
640
1051
  export {
641
1052
  getWorkflowsHandler,
642
1053
  getWorkflowByIdHandler,
1054
+ getWorkflowRunByIdHandler,
1055
+ getWorkflowRunExecutionResultHandler,
1056
+ createWorkflowRunHandler,
643
1057
  startAsyncWorkflowHandler,
644
- getWorkflowRunHandler,
645
- createRunHandler,
646
1058
  startWorkflowRunHandler,
647
1059
  watchWorkflowHandler,
1060
+ streamWorkflowHandler,
648
1061
  resumeAsyncWorkflowHandler,
649
1062
  resumeWorkflowHandler,
650
- getWorkflowRunsHandler
1063
+ getWorkflowRunsHandler,
1064
+ cancelWorkflowRunHandler
651
1065
  }
652
1066
  }
653
1067