@mastra/server 0.0.0-revert-schema-20250416221206 → 0.0.0-separate-trace-data-from-component-20250501042644

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 (35) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +111 -30
  2. package/dist/_tsup-dts-rollup.d.ts +111 -30
  3. package/dist/{chunk-UE27Q3XD.cjs → chunk-4BIX6GMY.cjs} +59 -34
  4. package/dist/{chunk-A7DF4ETD.cjs → chunk-55HTWX4C.cjs} +2 -9
  5. package/dist/{chunk-UV4WTEH4.js → chunk-5JNVY6DU.js} +5 -5
  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-AELYAUEE.cjs +316 -0
  9. package/dist/{chunk-PDC4ZBQW.cjs → chunk-D3G23FP3.cjs} +9 -9
  10. package/dist/{chunk-B64YROKU.cjs → chunk-EVCC233P.cjs} +22 -18
  11. package/dist/chunk-JPB6RPGB.js +304 -0
  12. package/dist/{chunk-OPP7H5TW.js → chunk-M3YJLWTU.js} +16 -12
  13. package/dist/{chunk-VK6FX47H.js → chunk-OMN3UI6X.js} +38 -38
  14. package/dist/{chunk-3RVHWGWO.js → chunk-Q6SHQECN.js} +2 -9
  15. package/dist/{chunk-YANVFOYA.js → chunk-QJ3AHN64.js} +52 -31
  16. package/dist/{chunk-I6MBOQTH.js → chunk-Y3SV5XK4.js} +57 -32
  17. package/dist/server/handlers/agents.cjs +7 -7
  18. package/dist/server/handlers/agents.js +1 -1
  19. package/dist/server/handlers/network.cjs +5 -5
  20. package/dist/server/handlers/network.js +1 -1
  21. package/dist/server/handlers/tools.cjs +5 -5
  22. package/dist/server/handlers/tools.js +1 -1
  23. package/dist/server/handlers/vNextWorkflows.cjs +46 -0
  24. package/dist/server/handlers/vNextWorkflows.d.cts +10 -0
  25. package/dist/server/handlers/vNextWorkflows.d.ts +10 -0
  26. package/dist/server/handlers/vNextWorkflows.js +1 -0
  27. package/dist/server/handlers/voice.cjs +4 -4
  28. package/dist/server/handlers/voice.js +1 -1
  29. package/dist/server/handlers/workflows.cjs +11 -11
  30. package/dist/server/handlers/workflows.js +1 -1
  31. package/dist/server/handlers.cjs +15 -10
  32. package/dist/server/handlers.d.cts +1 -0
  33. package/dist/server/handlers.d.ts +1 -0
  34. package/dist/server/handlers.js +6 -5
  35. 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,27 +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, container, }: 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;
93
- container: Container;
104
+ runtimeContext: RuntimeContext;
94
105
  }): Promise<any>;
95
106
 
96
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, container, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
107
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
97
108
  data?: unknown;
98
- container: Container;
109
+ runtimeContext: RuntimeContext;
99
110
  }) => Promise<any>;
100
111
 
101
- export declare function generateHandler({ mastra, container, agentId, body, }: Context & {
102
- container: Container;
112
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
113
+ runtimeContext: RuntimeContext;
103
114
  agentId: string;
104
115
  body: GetBody<'generate'> & {
105
116
  resourceid?: string;
106
117
  };
107
118
  }): Promise<GenerateTextResult<any, any>>;
108
119
 
109
- export declare function generateHandler_alias_1({ mastra, container, networkId, body, }: NetworkContext & {
110
- container: Container;
120
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
121
+ runtimeContext: RuntimeContext;
111
122
  body: {
112
123
  messages?: Parameters<AgentNetwork['generate']>[0];
113
124
  } & Parameters<AgentNetwork['generate']>[1];
@@ -121,11 +132,10 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
121
132
  text?: string;
122
133
  speakerId?: string;
123
134
  };
124
- }): Promise<{
125
- audioData: Buffer<ArrayBuffer>;
126
- }>;
135
+ }): Promise<NodeJS.ReadableStream>;
127
136
 
128
- export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
137
+ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
138
+ runtimeContext: RuntimeContext;
129
139
  agentId: string;
130
140
  }): Promise<{
131
141
  name: any;
@@ -135,7 +145,9 @@ export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
135
145
  modelId: string;
136
146
  }>;
137
147
 
138
- export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
148
+ export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
149
+ runtimeContext: RuntimeContext;
150
+ }): Promise<any>;
139
151
 
140
152
  declare type GetBody<T extends keyof Agent & {
141
153
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
@@ -143,7 +155,8 @@ declare type GetBody<T extends keyof Agent & {
143
155
  messages: Parameters<Agent[T]>[0];
144
156
  } & Parameters<Agent[T]>[1];
145
157
 
146
- export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
158
+ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
159
+ runtimeContext: RuntimeContext;
147
160
  agentId: string;
148
161
  }): Promise<{
149
162
  id: string;
@@ -152,7 +165,8 @@ export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context &
152
165
  evals: EvalRow[];
153
166
  }>;
154
167
 
155
- export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
168
+ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
169
+ runtimeContext: RuntimeContext;
156
170
  agentId: string;
157
171
  }): Promise<{
158
172
  id: string;
@@ -178,7 +192,7 @@ export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<
178
192
  uiMessages: Message[];
179
193
  }>;
180
194
 
181
- 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<{
182
196
  id: string;
183
197
  name: string;
184
198
  instructions: string;
@@ -193,7 +207,7 @@ export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<Networ
193
207
  };
194
208
  }>;
195
209
 
196
- export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
210
+ export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
197
211
  id: string;
198
212
  name: string;
199
213
  instructions: string;
@@ -225,6 +239,20 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
225
239
 
226
240
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
227
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
+
228
256
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
229
257
  stepGraph: StepGraph;
230
258
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -350,6 +378,7 @@ export declare namespace network {
350
378
 
351
379
  declare interface NetworkContext extends Context {
352
380
  networkId?: string;
381
+ runtimeContext: RuntimeContext;
353
382
  }
354
383
 
355
384
  declare interface QueryRequest {
@@ -366,20 +395,38 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
366
395
 
367
396
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
368
397
 
369
- 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 & {
370
407
  body: {
371
408
  stepId: string;
372
409
  context: any;
373
410
  };
374
- container: Container;
411
+ runtimeContext: RuntimeContext;
375
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>;
376
413
 
377
- 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 & {
378
425
  body: {
379
426
  stepId: string;
380
427
  context: any;
381
428
  };
382
- container: Container;
429
+ runtimeContext: RuntimeContext;
383
430
  }): Promise<{
384
431
  message: string;
385
432
  }>;
@@ -392,14 +439,26 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
392
439
 
393
440
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
394
441
 
395
- 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'> & {
396
448
  triggerData?: unknown;
397
- container: Container;
449
+ runtimeContext: RuntimeContext;
398
450
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
399
451
 
400
- 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'> & {
401
460
  triggerData?: unknown;
402
- container: Container;
461
+ runtimeContext: RuntimeContext;
403
462
  }): Promise<{
404
463
  message: string;
405
464
  }>;
@@ -423,16 +482,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
423
482
  traceCount: number;
424
483
  }>;
425
484
 
426
- export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
427
- container: Container;
485
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
486
+ runtimeContext: RuntimeContext;
428
487
  agentId: string;
429
488
  body: GetBody<'stream'> & {
430
489
  resourceid?: string;
431
490
  };
432
491
  }): Promise<Response | undefined>;
433
492
 
434
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
435
- container: Container;
493
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
494
+ runtimeContext: RuntimeContext;
436
495
  body: {
437
496
  messages?: Parameters<AgentNetwork['stream']>[0];
438
497
  } & Parameters<AgentNetwork['stream']>[1];
@@ -536,6 +595,26 @@ declare interface VectorContext extends Context {
536
595
  vectorName?: string;
537
596
  }
538
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
+
539
618
  export declare namespace voice {
540
619
  export {
541
620
  getSpeakersHandler,
@@ -548,6 +627,8 @@ declare interface VoiceContext extends Context {
548
627
  agentId?: string;
549
628
  }
550
629
 
630
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
631
+
551
632
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
552
633
 
553
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,27 +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, container, }: 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;
93
- container: Container;
104
+ runtimeContext: RuntimeContext;
94
105
  }): Promise<any>;
95
106
 
96
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, container, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
107
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
97
108
  data?: unknown;
98
- container: Container;
109
+ runtimeContext: RuntimeContext;
99
110
  }) => Promise<any>;
100
111
 
101
- export declare function generateHandler({ mastra, container, agentId, body, }: Context & {
102
- container: Container;
112
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
113
+ runtimeContext: RuntimeContext;
103
114
  agentId: string;
104
115
  body: GetBody<'generate'> & {
105
116
  resourceid?: string;
106
117
  };
107
118
  }): Promise<GenerateTextResult<any, any>>;
108
119
 
109
- export declare function generateHandler_alias_1({ mastra, container, networkId, body, }: NetworkContext & {
110
- container: Container;
120
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
121
+ runtimeContext: RuntimeContext;
111
122
  body: {
112
123
  messages?: Parameters<AgentNetwork['generate']>[0];
113
124
  } & Parameters<AgentNetwork['generate']>[1];
@@ -121,11 +132,10 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
121
132
  text?: string;
122
133
  speakerId?: string;
123
134
  };
124
- }): Promise<{
125
- audioData: Buffer<ArrayBuffer>;
126
- }>;
135
+ }): Promise<NodeJS.ReadableStream>;
127
136
 
128
- export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
137
+ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
138
+ runtimeContext: RuntimeContext;
129
139
  agentId: string;
130
140
  }): Promise<{
131
141
  name: any;
@@ -135,7 +145,9 @@ export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
135
145
  modelId: string;
136
146
  }>;
137
147
 
138
- export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
148
+ export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
149
+ runtimeContext: RuntimeContext;
150
+ }): Promise<any>;
139
151
 
140
152
  declare type GetBody<T extends keyof Agent & {
141
153
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
@@ -143,7 +155,8 @@ declare type GetBody<T extends keyof Agent & {
143
155
  messages: Parameters<Agent[T]>[0];
144
156
  } & Parameters<Agent[T]>[1];
145
157
 
146
- export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
158
+ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
159
+ runtimeContext: RuntimeContext;
147
160
  agentId: string;
148
161
  }): Promise<{
149
162
  id: string;
@@ -152,7 +165,8 @@ export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context &
152
165
  evals: EvalRow[];
153
166
  }>;
154
167
 
155
- export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
168
+ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
169
+ runtimeContext: RuntimeContext;
156
170
  agentId: string;
157
171
  }): Promise<{
158
172
  id: string;
@@ -178,7 +192,7 @@ export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<
178
192
  uiMessages: Message[];
179
193
  }>;
180
194
 
181
- 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<{
182
196
  id: string;
183
197
  name: string;
184
198
  instructions: string;
@@ -193,7 +207,7 @@ export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<Networ
193
207
  };
194
208
  }>;
195
209
 
196
- export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
210
+ export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
197
211
  id: string;
198
212
  name: string;
199
213
  instructions: string;
@@ -225,6 +239,20 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
225
239
 
226
240
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
227
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
+
228
256
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
229
257
  stepGraph: StepGraph;
230
258
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -350,6 +378,7 @@ export declare namespace network {
350
378
 
351
379
  declare interface NetworkContext extends Context {
352
380
  networkId?: string;
381
+ runtimeContext: RuntimeContext;
353
382
  }
354
383
 
355
384
  declare interface QueryRequest {
@@ -366,20 +395,38 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
366
395
 
367
396
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
368
397
 
369
- 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 & {
370
407
  body: {
371
408
  stepId: string;
372
409
  context: any;
373
410
  };
374
- container: Container;
411
+ runtimeContext: RuntimeContext;
375
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>;
376
413
 
377
- 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 & {
378
425
  body: {
379
426
  stepId: string;
380
427
  context: any;
381
428
  };
382
- container: Container;
429
+ runtimeContext: RuntimeContext;
383
430
  }): Promise<{
384
431
  message: string;
385
432
  }>;
@@ -392,14 +439,26 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
392
439
 
393
440
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
394
441
 
395
- 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'> & {
396
448
  triggerData?: unknown;
397
- container: Container;
449
+ runtimeContext: RuntimeContext;
398
450
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
399
451
 
400
- 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'> & {
401
460
  triggerData?: unknown;
402
- container: Container;
461
+ runtimeContext: RuntimeContext;
403
462
  }): Promise<{
404
463
  message: string;
405
464
  }>;
@@ -423,16 +482,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
423
482
  traceCount: number;
424
483
  }>;
425
484
 
426
- export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
427
- container: Container;
485
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
486
+ runtimeContext: RuntimeContext;
428
487
  agentId: string;
429
488
  body: GetBody<'stream'> & {
430
489
  resourceid?: string;
431
490
  };
432
491
  }): Promise<Response | undefined>;
433
492
 
434
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
435
- container: Container;
493
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
494
+ runtimeContext: RuntimeContext;
436
495
  body: {
437
496
  messages?: Parameters<AgentNetwork['stream']>[0];
438
497
  } & Parameters<AgentNetwork['stream']>[1];
@@ -536,6 +595,26 @@ declare interface VectorContext extends Context {
536
595
  vectorName?: string;
537
596
  }
538
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
+
539
618
  export declare namespace voice {
540
619
  export {
541
620
  getSpeakersHandler,
@@ -548,6 +627,8 @@ declare interface VoiceContext extends Context {
548
627
  agentId?: string;
549
628
  }
550
629
 
630
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
631
+
551
632
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
552
633
 
553
634
  declare interface WorkflowContext extends Context {