@mastra/server 0.0.0-afterToolExecute-20250414225911 → 0.0.0-agui-20250501182100

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 (39) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +111 -28
  2. package/dist/_tsup-dts-rollup.d.ts +111 -28
  3. package/dist/{chunk-Z46X3YCB.cjs → chunk-4BIX6GMY.cjs} +61 -36
  4. package/dist/{chunk-A7DF4ETD.cjs → chunk-55HTWX4C.cjs} +2 -9
  5. package/dist/{chunk-YNSGUC2O.js → chunk-5JNVY6DU.js} +8 -4
  6. package/dist/{chunk-QH6XWSXP.cjs → chunk-5SWCVTNL.cjs} +38 -38
  7. package/dist/{chunk-JLDXUWK7.cjs → chunk-5YGDYMRB.cjs} +52 -31
  8. package/dist/{chunk-CWSDZEZG.cjs → chunk-7IWQE76Z.cjs} +2 -2
  9. package/dist/chunk-AELYAUEE.cjs +316 -0
  10. package/dist/{chunk-4C3EPMMF.cjs → chunk-D3G23FP3.cjs} +12 -8
  11. package/dist/{chunk-B64YROKU.cjs → chunk-EVCC233P.cjs} +22 -18
  12. package/dist/chunk-JPB6RPGB.js +304 -0
  13. package/dist/{chunk-OPP7H5TW.js → chunk-M3YJLWTU.js} +16 -12
  14. package/dist/{chunk-VK6FX47H.js → chunk-OMN3UI6X.js} +38 -38
  15. package/dist/{chunk-3RVHWGWO.js → chunk-Q6SHQECN.js} +2 -9
  16. package/dist/{chunk-YANVFOYA.js → chunk-QJ3AHN64.js} +52 -31
  17. package/dist/{chunk-DVPP5S6I.js → chunk-WTHDCRMY.js} +2 -2
  18. package/dist/{chunk-67WTHYAV.js → chunk-Y3SV5XK4.js} +59 -34
  19. package/dist/server/handlers/agents.cjs +7 -7
  20. package/dist/server/handlers/agents.js +1 -1
  21. package/dist/server/handlers/network.cjs +5 -5
  22. package/dist/server/handlers/network.js +1 -1
  23. package/dist/server/handlers/telemetry.cjs +3 -3
  24. package/dist/server/handlers/telemetry.js +1 -1
  25. package/dist/server/handlers/tools.cjs +5 -5
  26. package/dist/server/handlers/tools.js +1 -1
  27. package/dist/server/handlers/vNextWorkflows.cjs +46 -0
  28. package/dist/server/handlers/vNextWorkflows.d.cts +10 -0
  29. package/dist/server/handlers/vNextWorkflows.d.ts +10 -0
  30. package/dist/server/handlers/vNextWorkflows.js +1 -0
  31. package/dist/server/handlers/voice.cjs +4 -4
  32. package/dist/server/handlers/voice.js +1 -1
  33. package/dist/server/handlers/workflows.cjs +11 -11
  34. package/dist/server/handlers/workflows.js +1 -1
  35. package/dist/server/handlers.cjs +17 -12
  36. package/dist/server/handlers.d.cts +1 -0
  37. package/dist/server/handlers.d.ts +1 -0
  38. package/dist/server/handlers.js +7 -6
  39. package/package.json +5 -5
@@ -1,7 +1,6 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
3
  import type { BaseLogMessage } from '@mastra/core/logger';
4
- import type { Container } from '@mastra/core/di';
5
4
  import { CoreMessage } from 'ai';
6
5
  import { EvalRow } from '@mastra/core/storage';
7
6
  import { GenerateObjectResult } from 'ai';
@@ -10,8 +9,13 @@ import type { Mastra } from '@mastra/core/mastra';
10
9
  import type { MastraMemory } from '@mastra/core/memory';
11
10
  import { Message } from 'ai';
12
11
  import { MessageType } from '@mastra/core/memory';
12
+ import { NewStep } from '@mastra/core/workflows/vNext';
13
+ import type { NewWorkflow } from '@mastra/core/workflows/vNext';
13
14
  import type { QueryResult } from '@mastra/core/vector';
14
15
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
16
+ import type { RuntimeContext } from '@mastra/core/runtime-context';
17
+ import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
18
+ import { SerializedStepFlowEntry } from '@mastra/core/workflows/vNext';
15
19
  import { Step } from '@mastra/core/workflows';
16
20
  import { StepExecutionContext } from '@mastra/core/workflows';
17
21
  import { StepGraph } from '@mastra/core/workflows';
@@ -20,8 +24,11 @@ import type { ToolAction } from '@mastra/core/tools';
20
24
  import type { VercelTool } from '@mastra/core/tools';
21
25
  import type { Workflow } from '@mastra/core/workflows';
22
26
  import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
27
+ import { WorkflowResult } from '@mastra/core/workflows/vNext';
23
28
  import { WorkflowRunResult } from '@mastra/core/workflows';
24
29
  import type { WorkflowRuns } from '@mastra/core/storage';
30
+ import { ZodType } from 'zod';
31
+ import { ZodTypeDef } from 'zod';
25
32
 
26
33
  export declare namespace agents {
27
34
  export {
@@ -67,6 +74,10 @@ export declare function createThreadHandler({ mastra, agentId, body, }: Pick<Mem
67
74
  };
68
75
  }): Promise<StorageThreadType>;
69
76
 
77
+ export declare function createVNextWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
78
+ runId: string;
79
+ }>;
80
+
70
81
  export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
71
82
  indexName?: string;
72
83
  }): Promise<{
@@ -87,25 +98,27 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
87
98
  metric: string | undefined;
88
99
  }>;
89
100
 
90
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
101
+ export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
91
102
  agentId?: string;
92
103
  data: any;
104
+ runtimeContext: RuntimeContext;
93
105
  }): Promise<any>;
94
106
 
95
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
107
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
108
  data?: unknown;
109
+ runtimeContext: RuntimeContext;
97
110
  }) => Promise<any>;
98
111
 
99
- export declare function generateHandler({ mastra, container, agentId, body, }: Context & {
100
- container: Container;
112
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
113
+ runtimeContext: RuntimeContext;
101
114
  agentId: string;
102
115
  body: GetBody<'generate'> & {
103
116
  resourceid?: string;
104
117
  };
105
118
  }): Promise<GenerateTextResult<any, any>>;
106
119
 
107
- export declare function generateHandler_alias_1({ mastra, container, networkId, body, }: NetworkContext & {
108
- container: Container;
120
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
121
+ runtimeContext: RuntimeContext;
109
122
  body: {
110
123
  messages?: Parameters<AgentNetwork['generate']>[0];
111
124
  } & Parameters<AgentNetwork['generate']>[1];
@@ -119,11 +132,10 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
119
132
  text?: string;
120
133
  speakerId?: string;
121
134
  };
122
- }): Promise<{
123
- audioData: Buffer<ArrayBuffer>;
124
- }>;
135
+ }): Promise<NodeJS.ReadableStream>;
125
136
 
126
- export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
137
+ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
138
+ runtimeContext: RuntimeContext;
127
139
  agentId: string;
128
140
  }): Promise<{
129
141
  name: any;
@@ -133,7 +145,9 @@ export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
133
145
  modelId: string;
134
146
  }>;
135
147
 
136
- export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
148
+ export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
149
+ runtimeContext: RuntimeContext;
150
+ }): Promise<any>;
137
151
 
138
152
  declare type GetBody<T extends keyof Agent & {
139
153
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
@@ -141,7 +155,8 @@ declare type GetBody<T extends keyof Agent & {
141
155
  messages: Parameters<Agent[T]>[0];
142
156
  } & Parameters<Agent[T]>[1];
143
157
 
144
- export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
158
+ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
159
+ runtimeContext: RuntimeContext;
145
160
  agentId: string;
146
161
  }): Promise<{
147
162
  id: string;
@@ -150,7 +165,8 @@ export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context &
150
165
  evals: EvalRow[];
151
166
  }>;
152
167
 
153
- export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
168
+ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
169
+ runtimeContext: RuntimeContext;
154
170
  agentId: string;
155
171
  }): Promise<{
156
172
  id: string;
@@ -176,7 +192,7 @@ export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<
176
192
  uiMessages: Message[];
177
193
  }>;
178
194
 
179
- export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<NetworkContext, 'mastra' | 'networkId'>): Promise<{
195
+ export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
180
196
  id: string;
181
197
  name: string;
182
198
  instructions: string;
@@ -191,7 +207,7 @@ export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<Networ
191
207
  };
192
208
  }>;
193
209
 
194
- export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
210
+ export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
195
211
  id: string;
196
212
  name: string;
197
213
  instructions: string;
@@ -223,6 +239,20 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
223
239
 
224
240
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
225
241
 
242
+ export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<{
243
+ steps: any;
244
+ name: string | undefined;
245
+ stepGraph: SerializedStepFlowEntry[];
246
+ inputSchema: string | undefined;
247
+ outputSchema: string | undefined;
248
+ }>;
249
+
250
+ export declare function getVNextWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRun']>>;
251
+
252
+ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<WorkflowRuns>;
253
+
254
+ export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
255
+
226
256
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
227
257
  stepGraph: StepGraph;
228
258
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -348,6 +378,7 @@ export declare namespace network {
348
378
 
349
379
  declare interface NetworkContext extends Context {
350
380
  networkId?: string;
381
+ runtimeContext: RuntimeContext;
351
382
  }
352
383
 
353
384
  declare interface QueryRequest {
@@ -364,20 +395,38 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
364
395
 
365
396
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
366
397
 
367
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
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 & {
368
407
  body: {
369
408
  stepId: string;
370
409
  context: any;
371
410
  };
372
- container: Container;
411
+ runtimeContext: RuntimeContext;
373
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>;
374
413
 
375
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
414
+ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
415
+ body: {
416
+ step: string | string[];
417
+ resumeData?: unknown;
418
+ };
419
+ runtimeContext?: RuntimeContext_2;
420
+ }): Promise<{
421
+ message: string;
422
+ }>;
423
+
424
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
376
425
  body: {
377
426
  stepId: string;
378
427
  context: any;
379
428
  };
380
- container: Container;
429
+ runtimeContext: RuntimeContext;
381
430
  }): Promise<{
382
431
  message: string;
383
432
  }>;
@@ -390,14 +439,26 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
390
439
 
391
440
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
392
441
 
393
- export declare function startAsyncWorkflowHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
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>[]>>;
446
+
447
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
394
448
  triggerData?: unknown;
395
- container: Container;
449
+ runtimeContext: RuntimeContext;
396
450
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
397
451
 
398
- export declare function startWorkflowRunHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
452
+ export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
453
+ inputData?: unknown;
454
+ runtimeContext?: RuntimeContext_2;
455
+ }): Promise<{
456
+ message: string;
457
+ }>;
458
+
459
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
399
460
  triggerData?: unknown;
400
- container: Container;
461
+ runtimeContext: RuntimeContext;
401
462
  }): Promise<{
402
463
  message: string;
403
464
  }>;
@@ -421,16 +482,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
421
482
  traceCount: number;
422
483
  }>;
423
484
 
424
- export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
425
- container: Container;
485
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
486
+ runtimeContext: RuntimeContext;
426
487
  agentId: string;
427
488
  body: GetBody<'stream'> & {
428
489
  resourceid?: string;
429
490
  };
430
491
  }): Promise<Response | undefined>;
431
492
 
432
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
433
- container: Container;
493
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
494
+ runtimeContext: RuntimeContext;
434
495
  body: {
435
496
  messages?: Parameters<AgentNetwork['stream']>[0];
436
497
  } & Parameters<AgentNetwork['stream']>[1];
@@ -534,6 +595,26 @@ declare interface VectorContext extends Context {
534
595
  vectorName?: string;
535
596
  }
536
597
 
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
+
537
618
  export declare namespace voice {
538
619
  export {
539
620
  getSpeakersHandler,
@@ -546,6 +627,8 @@ declare interface VoiceContext extends Context {
546
627
  agentId?: string;
547
628
  }
548
629
 
630
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
631
+
549
632
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
550
633
 
551
634
  declare interface WorkflowContext extends Context {
@@ -1,7 +1,6 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
3
  import type { BaseLogMessage } from '@mastra/core/logger';
4
- import type { Container } from '@mastra/core/di';
5
4
  import { CoreMessage } from 'ai';
6
5
  import { EvalRow } from '@mastra/core/storage';
7
6
  import { GenerateObjectResult } from 'ai';
@@ -10,8 +9,13 @@ import type { Mastra } from '@mastra/core/mastra';
10
9
  import type { MastraMemory } from '@mastra/core/memory';
11
10
  import { Message } from 'ai';
12
11
  import { MessageType } from '@mastra/core/memory';
12
+ import { NewStep } from '@mastra/core/workflows/vNext';
13
+ import type { NewWorkflow } from '@mastra/core/workflows/vNext';
13
14
  import type { QueryResult } from '@mastra/core/vector';
14
15
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
16
+ import type { RuntimeContext } from '@mastra/core/runtime-context';
17
+ import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
18
+ import { SerializedStepFlowEntry } from '@mastra/core/workflows/vNext';
15
19
  import { Step } from '@mastra/core/workflows';
16
20
  import { StepExecutionContext } from '@mastra/core/workflows';
17
21
  import { StepGraph } from '@mastra/core/workflows';
@@ -20,8 +24,11 @@ import type { ToolAction } from '@mastra/core/tools';
20
24
  import type { VercelTool } from '@mastra/core/tools';
21
25
  import type { Workflow } from '@mastra/core/workflows';
22
26
  import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
27
+ import { WorkflowResult } from '@mastra/core/workflows/vNext';
23
28
  import { WorkflowRunResult } from '@mastra/core/workflows';
24
29
  import type { WorkflowRuns } from '@mastra/core/storage';
30
+ import { ZodType } from 'zod';
31
+ import { ZodTypeDef } from 'zod';
25
32
 
26
33
  export declare namespace agents {
27
34
  export {
@@ -67,6 +74,10 @@ export declare function createThreadHandler({ mastra, agentId, body, }: Pick<Mem
67
74
  };
68
75
  }): Promise<StorageThreadType>;
69
76
 
77
+ export declare function createVNextWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
78
+ runId: string;
79
+ }>;
80
+
70
81
  export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
71
82
  indexName?: string;
72
83
  }): Promise<{
@@ -87,25 +98,27 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
87
98
  metric: string | undefined;
88
99
  }>;
89
100
 
90
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
101
+ export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
91
102
  agentId?: string;
92
103
  data: any;
104
+ runtimeContext: RuntimeContext;
93
105
  }): Promise<any>;
94
106
 
95
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
107
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
108
  data?: unknown;
109
+ runtimeContext: RuntimeContext;
97
110
  }) => Promise<any>;
98
111
 
99
- export declare function generateHandler({ mastra, container, agentId, body, }: Context & {
100
- container: Container;
112
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
113
+ runtimeContext: RuntimeContext;
101
114
  agentId: string;
102
115
  body: GetBody<'generate'> & {
103
116
  resourceid?: string;
104
117
  };
105
118
  }): Promise<GenerateTextResult<any, any>>;
106
119
 
107
- export declare function generateHandler_alias_1({ mastra, container, networkId, body, }: NetworkContext & {
108
- container: Container;
120
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
121
+ runtimeContext: RuntimeContext;
109
122
  body: {
110
123
  messages?: Parameters<AgentNetwork['generate']>[0];
111
124
  } & Parameters<AgentNetwork['generate']>[1];
@@ -119,11 +132,10 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
119
132
  text?: string;
120
133
  speakerId?: string;
121
134
  };
122
- }): Promise<{
123
- audioData: Buffer<ArrayBuffer>;
124
- }>;
135
+ }): Promise<NodeJS.ReadableStream>;
125
136
 
126
- export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
137
+ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
138
+ runtimeContext: RuntimeContext;
127
139
  agentId: string;
128
140
  }): Promise<{
129
141
  name: any;
@@ -133,7 +145,9 @@ export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
133
145
  modelId: string;
134
146
  }>;
135
147
 
136
- export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
148
+ export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
149
+ runtimeContext: RuntimeContext;
150
+ }): Promise<any>;
137
151
 
138
152
  declare type GetBody<T extends keyof Agent & {
139
153
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
@@ -141,7 +155,8 @@ declare type GetBody<T extends keyof Agent & {
141
155
  messages: Parameters<Agent[T]>[0];
142
156
  } & Parameters<Agent[T]>[1];
143
157
 
144
- export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
158
+ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
159
+ runtimeContext: RuntimeContext;
145
160
  agentId: string;
146
161
  }): Promise<{
147
162
  id: string;
@@ -150,7 +165,8 @@ export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context &
150
165
  evals: EvalRow[];
151
166
  }>;
152
167
 
153
- export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
168
+ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
169
+ runtimeContext: RuntimeContext;
154
170
  agentId: string;
155
171
  }): Promise<{
156
172
  id: string;
@@ -176,7 +192,7 @@ export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<
176
192
  uiMessages: Message[];
177
193
  }>;
178
194
 
179
- export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<NetworkContext, 'mastra' | 'networkId'>): Promise<{
195
+ export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
180
196
  id: string;
181
197
  name: string;
182
198
  instructions: string;
@@ -191,7 +207,7 @@ export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<Networ
191
207
  };
192
208
  }>;
193
209
 
194
- export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
210
+ export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
195
211
  id: string;
196
212
  name: string;
197
213
  instructions: string;
@@ -223,6 +239,20 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
223
239
 
224
240
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
225
241
 
242
+ export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<{
243
+ steps: any;
244
+ name: string | undefined;
245
+ stepGraph: SerializedStepFlowEntry[];
246
+ inputSchema: string | undefined;
247
+ outputSchema: string | undefined;
248
+ }>;
249
+
250
+ export declare function getVNextWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRun']>>;
251
+
252
+ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<WorkflowRuns>;
253
+
254
+ export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
255
+
226
256
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
227
257
  stepGraph: StepGraph;
228
258
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -348,6 +378,7 @@ export declare namespace network {
348
378
 
349
379
  declare interface NetworkContext extends Context {
350
380
  networkId?: string;
381
+ runtimeContext: RuntimeContext;
351
382
  }
352
383
 
353
384
  declare interface QueryRequest {
@@ -364,20 +395,38 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
364
395
 
365
396
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
366
397
 
367
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
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 & {
368
407
  body: {
369
408
  stepId: string;
370
409
  context: any;
371
410
  };
372
- container: Container;
411
+ runtimeContext: RuntimeContext;
373
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>;
374
413
 
375
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
414
+ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
415
+ body: {
416
+ step: string | string[];
417
+ resumeData?: unknown;
418
+ };
419
+ runtimeContext?: RuntimeContext_2;
420
+ }): Promise<{
421
+ message: string;
422
+ }>;
423
+
424
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
376
425
  body: {
377
426
  stepId: string;
378
427
  context: any;
379
428
  };
380
- container: Container;
429
+ runtimeContext: RuntimeContext;
381
430
  }): Promise<{
382
431
  message: string;
383
432
  }>;
@@ -390,14 +439,26 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
390
439
 
391
440
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
392
441
 
393
- export declare function startAsyncWorkflowHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
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>[]>>;
446
+
447
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
394
448
  triggerData?: unknown;
395
- container: Container;
449
+ runtimeContext: RuntimeContext;
396
450
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
397
451
 
398
- export declare function startWorkflowRunHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
452
+ export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
453
+ inputData?: unknown;
454
+ runtimeContext?: RuntimeContext_2;
455
+ }): Promise<{
456
+ message: string;
457
+ }>;
458
+
459
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
399
460
  triggerData?: unknown;
400
- container: Container;
461
+ runtimeContext: RuntimeContext;
401
462
  }): Promise<{
402
463
  message: string;
403
464
  }>;
@@ -421,16 +482,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
421
482
  traceCount: number;
422
483
  }>;
423
484
 
424
- export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
425
- container: Container;
485
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
486
+ runtimeContext: RuntimeContext;
426
487
  agentId: string;
427
488
  body: GetBody<'stream'> & {
428
489
  resourceid?: string;
429
490
  };
430
491
  }): Promise<Response | undefined>;
431
492
 
432
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
433
- container: Container;
493
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
494
+ runtimeContext: RuntimeContext;
434
495
  body: {
435
496
  messages?: Parameters<AgentNetwork['stream']>[0];
436
497
  } & Parameters<AgentNetwork['stream']>[1];
@@ -534,6 +595,26 @@ declare interface VectorContext extends Context {
534
595
  vectorName?: string;
535
596
  }
536
597
 
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
+
537
618
  export declare namespace voice {
538
619
  export {
539
620
  getSpeakersHandler,
@@ -546,6 +627,8 @@ declare interface VoiceContext extends Context {
546
627
  agentId?: string;
547
628
  }
548
629
 
630
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
631
+
549
632
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
550
633
 
551
634
  declare interface WorkflowContext extends Context {