@mastra/server 0.0.0-commonjs-20250414101718 → 0.0.0-custom-instrumentation-20250626084921

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 (87) hide show
  1. package/README.md +48 -135
  2. package/dist/_tsup-dts-rollup.d.cts +544 -62
  3. package/dist/_tsup-dts-rollup.d.ts +544 -62
  4. package/dist/chunk-4DTDPTQC.cjs +332 -0
  5. package/dist/{chunk-4JINXASC.js → chunk-55DOQLP6.js} +5 -4
  6. package/dist/{chunk-QN4KF3BH.cjs → chunk-57CJTIPW.cjs} +2 -2
  7. package/dist/{chunk-ZLBRQFDD.cjs → chunk-64U3UDTH.cjs} +2 -2
  8. package/dist/chunk-75ZPJI57.cjs +9 -0
  9. package/dist/{chunk-CWSDZEZG.cjs → chunk-B4MQFJ7G.cjs} +18 -12
  10. package/dist/{chunk-DVPP5S6I.js → chunk-BFOA2QQY.js} +14 -8
  11. package/dist/{chunk-M56ECCHK.cjs → chunk-BNEY4P4P.cjs} +20 -19
  12. package/dist/{chunk-YANVFOYA.js → chunk-C7564HUT.js} +56 -34
  13. package/dist/{chunk-4C3EPMMF.cjs → chunk-CPPYMJX5.cjs} +31 -25
  14. package/dist/chunk-GHC4YV6R.js +504 -0
  15. package/dist/chunk-GKM45O24.cjs +278 -0
  16. package/dist/{chunk-L7XE5QTW.js → chunk-H5PTF3Y4.js} +1 -1
  17. package/dist/chunk-IMBY5XUG.cjs +86 -0
  18. package/dist/{chunk-3AHQ5RGN.js → chunk-M5ABIP7D.js} +1 -1
  19. package/dist/chunk-MLKGABMK.js +7 -0
  20. package/dist/chunk-MN6F4D5A.cjs +2004 -0
  21. package/dist/{chunk-OPP7H5TW.js → chunk-N2YBMSO2.js} +78 -63
  22. package/dist/{chunk-TRDNDNGQ.js → chunk-NYN7KFXL.js} +1 -7
  23. package/dist/{chunk-FV45V6WC.cjs → chunk-OCWPVYNI.cjs} +0 -7
  24. package/dist/chunk-OSZM4EAY.js +2001 -0
  25. package/dist/chunk-PMUATKV2.js +270 -0
  26. package/dist/chunk-QLG2PFHE.js +81 -0
  27. package/dist/{chunk-3RVHWGWO.js → chunk-R5VGYBV6.js} +36 -19
  28. package/dist/{chunk-2FJURXCL.cjs → chunk-RQ2Z56EC.cjs} +93 -55
  29. package/dist/chunk-SDPGVWQJ.cjs +512 -0
  30. package/dist/chunk-SOBBILUG.js +421 -0
  31. package/dist/chunk-TO5U6HW3.cjs +435 -0
  32. package/dist/chunk-VPNDC2DI.cjs +148 -0
  33. package/dist/chunk-WJY57THV.cjs +118 -0
  34. package/dist/{chunk-YNSGUC2O.js → chunk-XR7VJOOP.js} +14 -8
  35. package/dist/{chunk-RBQASTUP.js → chunk-XUIJ7WRT.js} +63 -25
  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 +200 -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 +193 -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 +21 -13
  71. package/dist/server/handlers/workflows.d.cts +4 -2
  72. package/dist/server/handlers/workflows.d.ts +4 -2
  73. package/dist/server/handlers/workflows.js +1 -1
  74. package/dist/server/handlers.cjs +33 -23
  75. package/dist/server/handlers.d.cts +2 -0
  76. package/dist/server/handlers.d.ts +2 -0
  77. package/dist/server/handlers.js +11 -9
  78. package/package.json +13 -12
  79. package/dist/chunk-3EJZQ6TQ.js +0 -49
  80. package/dist/chunk-67WTHYAV.js +0 -156
  81. package/dist/chunk-A7DF4ETD.cjs +0 -100
  82. package/dist/chunk-B64YROKU.cjs +0 -317
  83. package/dist/chunk-JLDXUWK7.cjs +0 -126
  84. package/dist/chunk-QH6XWSXP.cjs +0 -5579
  85. package/dist/chunk-SKBVVI24.cjs +0 -54
  86. package/dist/chunk-VK6FX47H.js +0 -5576
  87. package/dist/chunk-Z46X3YCB.cjs +0 -164
@@ -1,27 +1,73 @@
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
- import type { Container } from '@mastra/core/di';
5
6
  import { CoreMessage } from 'ai';
7
+ import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
8
+ import { DefaultEngineType } from '@mastra/core/workflows';
6
9
  import { EvalRow } from '@mastra/core/storage';
7
10
  import { GenerateObjectResult } from 'ai';
8
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';
9
20
  import type { Mastra } from '@mastra/core/mastra';
10
21
  import type { MastraMemory } from '@mastra/core/memory';
11
- import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core/memory';
22
+ import { MastraMessageV1 } from '@mastra/core/memory';
23
+ import type { Message } from '@mastra/core/a2a';
13
24
  import type { QueryResult } from '@mastra/core/vector';
14
25
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
26
+ import { ReadableStream as ReadableStream_3 } from 'stream/web';
27
+ import { RuntimeContext } from '@mastra/core/runtime-context';
28
+ import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
29
+ import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
15
30
  import { Step } from '@mastra/core/workflows';
16
- import { StepExecutionContext } from '@mastra/core/workflows';
17
- import { StepGraph } from '@mastra/core/workflows';
31
+ import { StepExecutionContext } from '@mastra/core/workflows/legacy';
32
+ import { StepGraph } from '@mastra/core/workflows/legacy';
33
+ import { StepResult } from '@mastra/core/workflows';
18
34
  import { StorageThreadType } from '@mastra/core/memory';
35
+ import { StreamEvent } from '@mastra/core/workflows';
36
+ import { Task } from '@mastra/core/a2a';
37
+ import { TaskAndHistory } from '@mastra/core/a2a';
38
+ import type { TaskContext } from '@mastra/core/a2a';
39
+ import type { TaskIdParams } from '@mastra/core/a2a';
40
+ import type { TaskQueryParams } from '@mastra/core/a2a';
41
+ import type { TaskSendParams } from '@mastra/core/a2a';
42
+ import type { TaskStatus } from '@mastra/core/a2a';
19
43
  import type { ToolAction } from '@mastra/core/tools';
44
+ import { UIMessage } from 'ai';
20
45
  import type { VercelTool } from '@mastra/core/tools';
46
+ import type { WatchEvent } from '@mastra/core/workflows';
21
47
  import type { Workflow } from '@mastra/core/workflows';
22
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
23
- import { WorkflowRunResult } from '@mastra/core/workflows';
48
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
49
+ import { WorkflowResult } from '@mastra/core/workflows';
24
50
  import type { WorkflowRuns } from '@mastra/core/storage';
51
+ import { ZodBoolean } from 'zod';
52
+ import { ZodEnum } from 'zod';
53
+ import { ZodNumber } from 'zod';
54
+ import { ZodObject } from 'zod';
55
+ import { ZodOptional } from 'zod';
56
+ import { ZodString } from 'zod';
57
+ import { ZodType } from 'zod';
58
+ import { ZodTypeAny } from 'zod';
59
+ import { ZodTypeDef } from 'zod';
60
+
61
+ export declare namespace a2a {
62
+ export {
63
+ getAgentCardByIdHandler,
64
+ handleTaskSend,
65
+ handleTaskGet,
66
+ handleTaskSendSubscribe,
67
+ handleTaskCancel,
68
+ getAgentExecutionHandler
69
+ }
70
+ }
25
71
 
26
72
  export declare namespace agents {
27
73
  export {
@@ -39,12 +85,18 @@ export declare interface ApiError extends Error {
39
85
  status?: number;
40
86
  }
41
87
 
88
+ export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
89
+
42
90
  declare type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
43
91
 
44
92
  export declare interface Context {
45
93
  mastra: Mastra;
46
94
  }
47
95
 
96
+ export declare function convertToCoreMessage(message: Message): CoreMessage_2;
97
+
98
+ export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
99
+
48
100
  export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
49
101
  index: CreateIndexRequest;
50
102
  }): Promise<{
@@ -57,23 +109,36 @@ declare interface CreateIndexRequest {
57
109
  metric?: 'cosine' | 'euclidean' | 'dotproduct';
58
110
  }
59
111
 
60
- export declare function createRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
112
+ export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
61
113
  runId: string;
62
114
  }>;
63
115
 
64
- export declare function createThreadHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
116
+ export declare function createSuccessResponse<T>(id: number | string | null, result: T): JSONRPCResponse<T>;
117
+
118
+ export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
119
+ task: Task;
120
+ userMessage: Message;
121
+ history: Message[];
122
+ activeCancellations: Set<string>;
123
+ }): TaskContext;
124
+
125
+ export declare function createThreadHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
65
126
  body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
66
127
  resourceId?: string;
67
128
  };
68
129
  }): Promise<StorageThreadType>;
69
130
 
131
+ export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
132
+ runId: string;
133
+ }>;
134
+
70
135
  export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
71
136
  indexName?: string;
72
137
  }): Promise<{
73
138
  success: boolean;
74
139
  }>;
75
140
 
76
- export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
141
+ export declare function deleteThreadHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<{
77
142
  result: string;
78
143
  }>;
79
144
 
@@ -87,25 +152,29 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
87
152
  metric: string | undefined;
88
153
  }>;
89
154
 
90
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
155
+ export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
91
156
  agentId?: string;
92
157
  data: any;
158
+ runtimeContext: RuntimeContext_2;
93
159
  }): Promise<any>;
94
160
 
95
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
161
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
162
  data?: unknown;
163
+ runtimeContext: RuntimeContext_2;
97
164
  }) => Promise<any>;
98
165
 
99
- export declare function generateHandler({ mastra, container, agentId, body, }: Context & {
100
- container: Container;
166
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
167
+ runtimeContext: RuntimeContext;
101
168
  agentId: string;
102
169
  body: GetBody<'generate'> & {
103
170
  resourceid?: string;
171
+ runtimeContext?: Record<string, unknown>;
104
172
  };
105
- }): Promise<GenerateTextResult<any, any>>;
173
+ abortSignal?: AbortSignal;
174
+ }): Promise<GenerateTextResult<any, unknown>>;
106
175
 
107
- export declare function generateHandler_alias_1({ mastra, container, networkId, body, }: NetworkContext & {
108
- container: Container;
176
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
177
+ runtimeContext: RuntimeContext;
109
178
  body: {
110
179
  messages?: Parameters<AgentNetwork['generate']>[0];
111
180
  } & Parameters<AgentNetwork['generate']>[1];
@@ -119,21 +188,71 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
119
188
  text?: string;
120
189
  speakerId?: string;
121
190
  };
191
+ }): Promise<NodeJS.ReadableStream>;
192
+
193
+ export declare function generateVNextNetworkHandler({ mastra, runtimeContext, networkId, body, }: NetworkContext_2 & {
194
+ runtimeContext: RuntimeContext;
195
+ body: {
196
+ message: string;
197
+ threadId?: string;
198
+ resourceId?: string;
199
+ };
122
200
  }): Promise<{
123
- audioData: Buffer<ArrayBuffer>;
201
+ task: string;
202
+ result: string;
203
+ resourceId: string;
204
+ resourceType: "none" | "tool" | "workflow" | "agent";
124
205
  }>;
125
206
 
126
- export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
207
+ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, isPlayground, }: Context & {
208
+ isPlayground?: boolean;
209
+ runtimeContext: RuntimeContext;
127
210
  agentId: string;
128
211
  }): Promise<{
129
212
  name: any;
130
213
  instructions: string;
131
214
  tools: any;
215
+ workflows: {};
132
216
  provider: string;
133
217
  modelId: string;
218
+ defaultGenerateOptions: any;
219
+ defaultStreamOptions: any;
134
220
  }>;
135
221
 
136
- export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
222
+ export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
223
+ runtimeContext: RuntimeContext;
224
+ agentId: keyof ReturnType<typeof mastra.getAgents>;
225
+ executionUrl?: string;
226
+ version?: string;
227
+ provider?: {
228
+ organization: string;
229
+ url: string;
230
+ };
231
+ }): Promise<AgentCard>;
232
+
233
+ export declare function getAgentExecutionHandler({ requestId, mastra, agentId, runtimeContext, method, params, taskStore, logger, }: Context & {
234
+ requestId: string;
235
+ runtimeContext: RuntimeContext;
236
+ agentId: string;
237
+ method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
238
+ params: TaskSendParams | TaskQueryParams | TaskIdParams;
239
+ taskStore?: InMemoryTaskStore;
240
+ logger?: IMastraLogger;
241
+ }): Promise<any>;
242
+
243
+ export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
244
+ runtimeContext: RuntimeContext;
245
+ }): Promise<Record<string, Omit<{
246
+ id: string;
247
+ name: any;
248
+ instructions: string;
249
+ tools: any;
250
+ workflows: {};
251
+ provider: string;
252
+ modelId: string;
253
+ defaultGenerateOptions: any;
254
+ defaultStreamOptions: any;
255
+ }, "id">>>;
137
256
 
138
257
  declare type GetBody<T extends keyof Agent & {
139
258
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
@@ -141,7 +260,8 @@ declare type GetBody<T extends keyof Agent & {
141
260
  messages: Parameters<Agent[T]>[0];
142
261
  } & Parameters<Agent[T]>[1];
143
262
 
144
- export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
263
+ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
264
+ runtimeContext: RuntimeContext;
145
265
  agentId: string;
146
266
  }): Promise<{
147
267
  id: string;
@@ -150,7 +270,37 @@ export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context &
150
270
  evals: EvalRow[];
151
271
  }>;
152
272
 
153
- export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
273
+ export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
274
+ stepGraph: StepGraph;
275
+ stepSubscriberGraph: Record<string, StepGraph>;
276
+ serializedStepGraph: StepGraph;
277
+ serializedStepSubscriberGraph: Record<string, StepGraph>;
278
+ name: string;
279
+ triggerSchema: string | undefined;
280
+ steps: any;
281
+ }>;
282
+
283
+ export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
284
+
285
+ export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
286
+ fromDate?: Date;
287
+ toDate?: Date;
288
+ limit?: number;
289
+ offset?: number;
290
+ resourceId?: string;
291
+ }): Promise<LegacyWorkflowRuns>;
292
+
293
+ export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
294
+
295
+ /**
296
+ * Get available listeners for an agent
297
+ */
298
+ export declare function getListenerHandler({ mastra, agentId }: VoiceContext): Promise<{
299
+ enabled: boolean;
300
+ }>;
301
+
302
+ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
303
+ runtimeContext: RuntimeContext;
154
304
  agentId: string;
155
305
  }): Promise<{
156
306
  id: string;
@@ -159,24 +309,38 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Contex
159
309
  evals: EvalRow[];
160
310
  }>;
161
311
 
162
- export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
312
+ export declare function getLogsByRunIdHandler({ mastra, runId, transportId, params, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId' | 'params'>): Promise<{
313
+ logs: BaseLogMessage[];
314
+ total: number;
315
+ page: number;
316
+ perPage: number;
317
+ hasMore: boolean;
318
+ }>;
163
319
 
164
- export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
320
+ export declare function getLogsHandler({ mastra, transportId, params, }: Pick<LogsContext, 'mastra' | 'transportId' | 'params'>): Promise<{
321
+ logs: BaseLogMessage[];
322
+ total: number;
323
+ page: number;
324
+ perPage: number;
325
+ hasMore: boolean;
326
+ }>;
165
327
 
166
328
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
167
329
  transports: string[];
168
330
  }>;
169
331
 
170
- export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
332
+ export declare function getMemoryStatusHandler({ mastra, agentId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'>): Promise<{
171
333
  result: boolean;
172
334
  }>;
173
335
 
174
- export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
336
+ export declare function getMessagesHandler({ mastra, agentId, threadId, limit, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
337
+ limit?: number;
338
+ }): Promise<{
175
339
  messages: CoreMessage[];
176
- uiMessages: Message[];
340
+ uiMessages: UIMessage[];
177
341
  }>;
178
342
 
179
- export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<NetworkContext, 'mastra' | 'networkId'>): Promise<{
343
+ export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
180
344
  id: string;
181
345
  name: string;
182
346
  instructions: string;
@@ -191,7 +355,7 @@ export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<Networ
191
355
  };
192
356
  }>;
193
357
 
194
- export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
358
+ export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
195
359
  id: string;
196
360
  name: string;
197
361
  instructions: string;
@@ -215,32 +379,125 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
215
379
 
216
380
  export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
217
381
 
218
- export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
382
+ export declare function getThreadByIdHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType>;
219
383
 
220
- export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
384
+ export declare function getThreadsHandler({ mastra, agentId, resourceId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType[]>;
221
385
 
222
386
  export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
223
387
 
224
388
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
225
389
 
226
- export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
227
- stepGraph: StepGraph;
228
- stepSubscriberGraph: Record<string, StepGraph>;
229
- serializedStepGraph: StepGraph;
230
- serializedStepSubscriberGraph: Record<string, StepGraph>;
390
+ export declare function getVNextNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
391
+ id: string;
231
392
  name: string;
232
- triggerSchema: string | undefined;
233
- steps: any;
393
+ instructions: string;
394
+ agents: {
395
+ name: string;
396
+ provider: string;
397
+ modelId: string;
398
+ }[];
399
+ workflows: {
400
+ name: string | undefined;
401
+ description: string | undefined;
402
+ inputSchema: string | undefined;
403
+ outputSchema: string | undefined;
404
+ }[];
405
+ routingModel: {
406
+ provider: string;
407
+ modelId: string;
408
+ };
409
+ }>;
410
+
411
+ export declare function getVNextNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'runtimeContext'>): Promise<{
412
+ id: string;
413
+ name: string;
414
+ instructions: string;
415
+ agents: {
416
+ name: string;
417
+ provider: string;
418
+ modelId: string;
419
+ }[];
420
+ workflows: {
421
+ name: string | undefined;
422
+ description: string | undefined;
423
+ inputSchema: string | undefined;
424
+ outputSchema: string | undefined;
425
+ }[];
426
+ routingModel: {
427
+ provider: string;
428
+ modelId: string;
429
+ };
430
+ }[]>;
431
+
432
+ export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
433
+ steps: SerializedStep[];
434
+ name: string | undefined;
435
+ description: string | undefined;
436
+ stepGraph: SerializedStepFlowEntry[];
437
+ inputSchema: string | undefined;
438
+ outputSchema: string | undefined;
234
439
  }>;
235
440
 
236
- export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
441
+ export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
237
442
 
238
- export declare function getWorkflowRunsHandler({ mastra, workflowId }: WorkflowContext): Promise<WorkflowRuns>;
443
+ export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
444
+
445
+ export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
446
+ fromDate?: Date;
447
+ toDate?: Date;
448
+ limit?: number;
449
+ offset?: number;
450
+ resourceId?: string;
451
+ }): Promise<WorkflowRuns>;
239
452
 
240
- export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
453
+ export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
241
454
 
242
455
  export declare function handleError(error: unknown, defaultMessage: string): never;
243
456
 
457
+ export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId, logger, }: {
458
+ requestId: string;
459
+ taskStore: InMemoryTaskStore;
460
+ agentId: string;
461
+ taskId: string;
462
+ logger?: IMastraLogger;
463
+ }): Promise<JSONRPCResponse<Task, unknown>>;
464
+
465
+ export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
466
+ requestId: string;
467
+ taskStore: InMemoryTaskStore;
468
+ agentId: string;
469
+ taskId: string;
470
+ }): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
471
+
472
+ export declare function handleTaskSend({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
473
+ requestId: string;
474
+ params: TaskSendParams;
475
+ taskStore: InMemoryTaskStore;
476
+ agent: Agent;
477
+ agentId: string;
478
+ logger?: IMastraLogger;
479
+ runtimeContext: RuntimeContext;
480
+ }): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
481
+
482
+ export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
483
+ requestId: string;
484
+ params: TaskSendParams;
485
+ taskStore: InMemoryTaskStore;
486
+ agent: Agent;
487
+ agentId: string;
488
+ logger?: IMastraLogger;
489
+ runtimeContext: RuntimeContext;
490
+ }): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
491
+ state: string;
492
+ message: {
493
+ role: string;
494
+ parts: {
495
+ type: string;
496
+ text: string;
497
+ }[];
498
+ };
499
+ }, unknown>, void, unknown>;
500
+
244
501
  /**
245
502
  * `HTTPException` must be used when a fatal error such as authentication failure occurs.
246
503
  *
@@ -302,8 +559,46 @@ declare type HTTPExceptionOptions = {
302
559
  */
303
560
  declare type InfoStatusCode = 100 | 101 | 102 | 103;
304
561
 
562
+ export declare class InMemoryTaskStore {
563
+ private store;
564
+ activeCancellations: Set<string>;
565
+ load({ agentId, taskId }: {
566
+ agentId: string;
567
+ taskId: string;
568
+ }): Promise<TaskAndHistory | null>;
569
+ save({ agentId, data }: {
570
+ agentId: string;
571
+ data: TaskAndHistory;
572
+ }): Promise<void>;
573
+ }
574
+
575
+ export declare namespace legacyWorkflows {
576
+ export {
577
+ getLegacyWorkflowsHandler,
578
+ getLegacyWorkflowByIdHandler,
579
+ startAsyncLegacyWorkflowHandler,
580
+ getLegacyWorkflowRunHandler,
581
+ createLegacyWorkflowRunHandler,
582
+ startLegacyWorkflowRunHandler,
583
+ watchLegacyWorkflowHandler,
584
+ resumeAsyncLegacyWorkflowHandler,
585
+ resumeLegacyWorkflowHandler,
586
+ getLegacyWorkflowRunsHandler
587
+ }
588
+ }
589
+
305
590
  export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
306
591
 
592
+ export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
593
+ agentId: string;
594
+ taskId: string;
595
+ taskStore: InMemoryTaskStore;
596
+ message: Message;
597
+ sessionId?: string | null;
598
+ metadata?: Record<string, unknown> | null;
599
+ logger?: IMastraLogger;
600
+ }): Promise<TaskAndHistory>;
601
+
307
602
  export declare namespace logs {
308
603
  export {
309
604
  getLogsHandler,
@@ -316,8 +611,72 @@ declare type LogsContext = {
316
611
  mastra: Mastra;
317
612
  transportId?: string;
318
613
  runId?: string;
614
+ params?: {
615
+ fromDate?: Date;
616
+ toDate?: Date;
617
+ logLevel?: LogLevel;
618
+ filters?: string | string[];
619
+ page?: number;
620
+ perPage?: number;
621
+ };
319
622
  };
320
623
 
624
+ export declare function loopStreamVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
625
+ runtimeContext: RuntimeContext;
626
+ body: {
627
+ message: string;
628
+ threadId?: string;
629
+ resourceId?: string;
630
+ maxIterations?: number;
631
+ };
632
+ }): Promise<{
633
+ stream: ReadableStream_3<StreamEvent>;
634
+ getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
635
+ task: ZodString;
636
+ resourceId: ZodString;
637
+ resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
638
+ prompt: ZodString;
639
+ result: ZodString;
640
+ isComplete: ZodOptional<ZodBoolean>;
641
+ completionReason: ZodOptional<ZodString>;
642
+ iteration: ZodNumber;
643
+ }, "strip", ZodTypeAny, {
644
+ prompt: string;
645
+ resourceId: string;
646
+ result: string;
647
+ task: string;
648
+ resourceType: "none" | "tool" | "workflow" | "agent";
649
+ iteration: number;
650
+ isComplete?: boolean | undefined;
651
+ completionReason?: string | undefined;
652
+ }, {
653
+ prompt: string;
654
+ resourceId: string;
655
+ result: string;
656
+ task: string;
657
+ resourceType: "none" | "tool" | "workflow" | "agent";
658
+ iteration: number;
659
+ isComplete?: boolean | undefined;
660
+ completionReason?: string | undefined;
661
+ }>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
662
+ }>;
663
+
664
+ export declare function loopVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
665
+ runtimeContext: RuntimeContext;
666
+ body: {
667
+ message: string;
668
+ };
669
+ }): Promise<{
670
+ status: "success";
671
+ result: {
672
+ text: string;
673
+ iteration: number;
674
+ };
675
+ steps: {
676
+ [x: string]: StepResult<any, any, any, any> | StepResult<unknown, unknown, unknown, unknown>;
677
+ };
678
+ }>;
679
+
321
680
  export declare namespace memory {
322
681
  export {
323
682
  getMemoryStatusHandler,
@@ -335,6 +694,8 @@ declare interface MemoryContext extends Context {
335
694
  agentId?: string;
336
695
  resourceId?: string;
337
696
  threadId?: string;
697
+ networkId?: string;
698
+ runtimeContext?: RuntimeContext_2;
338
699
  }
339
700
 
340
701
  export declare namespace network {
@@ -348,8 +709,16 @@ export declare namespace network {
348
709
 
349
710
  declare interface NetworkContext extends Context {
350
711
  networkId?: string;
712
+ runtimeContext: RuntimeContext;
351
713
  }
352
714
 
715
+ declare interface NetworkContext_2 extends Context {
716
+ networkId?: string;
717
+ runtimeContext: RuntimeContext;
718
+ }
719
+
720
+ export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
721
+
353
722
  declare interface QueryRequest {
354
723
  indexName: string;
355
724
  queryVector: number[];
@@ -364,40 +733,79 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
364
733
 
365
734
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
366
735
 
367
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
736
+ export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
368
737
  body: {
369
738
  stepId: string;
370
739
  context: any;
371
740
  };
372
- container: Container;
373
- }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
741
+ runtimeContext: RuntimeContext;
742
+ }): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
743
+
744
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
745
+ body: {
746
+ step: string | string[];
747
+ resumeData?: unknown;
748
+ };
749
+ runtimeContext?: RuntimeContext_2;
750
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
374
751
 
375
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
752
+ export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
376
753
  body: {
377
754
  stepId: string;
378
755
  context: any;
379
756
  };
380
- container: Container;
757
+ runtimeContext: RuntimeContext;
758
+ }): Promise<{
759
+ message: string;
760
+ }>;
761
+
762
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
763
+ body: {
764
+ step: string | string[];
765
+ resumeData?: unknown;
766
+ };
767
+ runtimeContext?: RuntimeContext_2;
381
768
  }): Promise<{
382
769
  message: string;
383
770
  }>;
384
771
 
385
- export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
772
+ export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
386
773
  body: {
387
774
  messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
388
775
  };
389
- }): Promise<MessageType[]>;
776
+ }): Promise<MastraMessageV1[]>;
777
+
778
+ declare type SerializedStep = {
779
+ id: string;
780
+ description: string;
781
+ inputSchema: string | undefined;
782
+ outputSchema: string | undefined;
783
+ resumeSchema: string | undefined;
784
+ suspendSchema: string | undefined;
785
+ };
390
786
 
391
787
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
392
788
 
393
- export declare function startAsyncWorkflowHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
789
+ export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
394
790
  triggerData?: unknown;
395
- container: Container;
396
- }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
791
+ runtimeContext: RuntimeContext;
792
+ }): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
397
793
 
398
- export declare function startWorkflowRunHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
794
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
795
+ inputData?: unknown;
796
+ runtimeContext?: RuntimeContext_2;
797
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
798
+
799
+ export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
399
800
  triggerData?: unknown;
400
- container: Container;
801
+ runtimeContext: RuntimeContext;
802
+ }): Promise<{
803
+ message: string;
804
+ }>;
805
+
806
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
807
+ inputData?: unknown;
808
+ runtimeContext?: RuntimeContext_2;
401
809
  }): Promise<{
402
810
  message: string;
403
811
  }>;
@@ -415,27 +823,89 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
415
823
  status: string;
416
824
  message: string;
417
825
  error: any;
826
+ } | {
827
+ status: string;
828
+ message: string;
829
+ traceCount?: undefined;
418
830
  } | {
419
831
  status: string;
420
832
  message: string;
421
833
  traceCount: number;
422
834
  }>;
423
835
 
424
- export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
425
- container: Container;
836
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
837
+ runtimeContext: RuntimeContext;
426
838
  agentId: string;
427
839
  body: GetBody<'stream'> & {
428
840
  resourceid?: string;
841
+ runtimeContext?: string;
429
842
  };
843
+ abortSignal?: AbortSignal;
430
844
  }): Promise<Response | undefined>;
431
845
 
432
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
433
- container: Container;
846
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
847
+ runtimeContext: RuntimeContext;
434
848
  body: {
435
849
  messages?: Parameters<AgentNetwork['stream']>[0];
436
850
  } & Parameters<AgentNetwork['stream']>[1];
437
851
  }): Promise<Response>;
438
852
 
853
+ export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
854
+ runtimeContext: RuntimeContext;
855
+ body: {
856
+ message: string;
857
+ threadId?: string;
858
+ resourceId?: string;
859
+ };
860
+ }): Promise<{
861
+ stream: ReadableStream_3<StreamEvent>;
862
+ getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
863
+ task: ZodString;
864
+ resourceId: ZodString;
865
+ resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
866
+ prompt: ZodString;
867
+ result: ZodString;
868
+ isComplete: ZodOptional<ZodBoolean>;
869
+ completionReason: ZodOptional<ZodString>;
870
+ iteration: ZodNumber;
871
+ threadId: ZodOptional<ZodString>;
872
+ threadResourceId: ZodOptional<ZodString>;
873
+ isOneOff: ZodBoolean;
874
+ }, "strip", ZodTypeAny, {
875
+ prompt: string;
876
+ resourceId: string;
877
+ result: string;
878
+ task: string;
879
+ resourceType: "none" | "tool" | "workflow" | "agent";
880
+ iteration: number;
881
+ isOneOff: boolean;
882
+ threadId?: string | undefined;
883
+ threadResourceId?: string | undefined;
884
+ isComplete?: boolean | undefined;
885
+ completionReason?: string | undefined;
886
+ }, {
887
+ prompt: string;
888
+ resourceId: string;
889
+ result: string;
890
+ task: string;
891
+ resourceType: "none" | "tool" | "workflow" | "agent";
892
+ iteration: number;
893
+ isOneOff: boolean;
894
+ threadId?: string | undefined;
895
+ threadResourceId?: string | undefined;
896
+ isComplete?: boolean | undefined;
897
+ completionReason?: string | undefined;
898
+ }>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
899
+ }>;
900
+
901
+ export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
902
+ inputData?: unknown;
903
+ runtimeContext?: RuntimeContext_2;
904
+ }): Promise<{
905
+ stream: ReadableStream_2<StreamEvent>;
906
+ getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
907
+ }>;
908
+
439
909
  declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
440
910
 
441
911
  export declare namespace telemetry {
@@ -452,6 +922,8 @@ declare interface TelemetryContext extends Context {
452
922
  page?: number;
453
923
  perPage?: number;
454
924
  attribute?: string | string[];
925
+ fromDate?: Date;
926
+ toDate?: Date;
455
927
  };
456
928
  }
457
929
 
@@ -500,7 +972,7 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
500
972
  */
501
973
  export declare type UnofficialStatusCode = -1;
502
974
 
503
- export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
975
+ export declare function updateThreadHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
504
976
  body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
505
977
  }): Promise<StorageThreadType>;
506
978
 
@@ -538,7 +1010,8 @@ export declare namespace voice {
538
1010
  export {
539
1011
  getSpeakersHandler,
540
1012
  generateSpeechHandler,
541
- transcribeSpeechHandler
1013
+ transcribeSpeechHandler,
1014
+ getListenerHandler
542
1015
  }
543
1016
  }
544
1017
 
@@ -546,22 +1019,31 @@ declare interface VoiceContext extends Context {
546
1019
  agentId?: string;
547
1020
  }
548
1021
 
549
- export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
1022
+ export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
1023
+
1024
+ export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
550
1025
 
551
1026
  declare interface WorkflowContext extends Context {
552
1027
  workflowId?: string;
553
1028
  runId?: string;
554
1029
  }
555
1030
 
1031
+ declare interface WorkflowContext_3 extends Context {
1032
+ workflowId?: string;
1033
+ runId?: string;
1034
+ }
1035
+
556
1036
  export declare namespace workflows {
557
1037
  export {
558
1038
  getWorkflowsHandler,
559
1039
  getWorkflowByIdHandler,
1040
+ getWorkflowRunByIdHandler,
1041
+ getWorkflowRunExecutionResultHandler,
1042
+ createWorkflowRunHandler,
560
1043
  startAsyncWorkflowHandler,
561
- getWorkflowRunHandler,
562
- createRunHandler,
563
1044
  startWorkflowRunHandler,
564
1045
  watchWorkflowHandler,
1046
+ streamWorkflowHandler,
565
1047
  resumeAsyncWorkflowHandler,
566
1048
  resumeWorkflowHandler,
567
1049
  getWorkflowRunsHandler