@mastra/server 0.0.0-default-storage-virtual-file-20250410035748 → 0.0.0-expose-more-playground-ui-20250501175749

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 (44) hide show
  1. package/{LICENSE → LICENSE.md} +3 -1
  2. package/dist/_tsup-dts-rollup.d.cts +123 -33
  3. package/dist/_tsup-dts-rollup.d.ts +123 -33
  4. package/dist/{chunk-2JQC6JWP.js → chunk-3EJZQ6TQ.js} +4 -1
  5. package/dist/{chunk-GV52BII2.cjs → chunk-4BIX6GMY.cjs} +63 -34
  6. package/dist/{chunk-A7DF4ETD.cjs → chunk-55HTWX4C.cjs} +2 -9
  7. package/dist/{chunk-YNSGUC2O.js → chunk-5JNVY6DU.js} +8 -4
  8. package/dist/{chunk-QH6XWSXP.cjs → chunk-5SWCVTNL.cjs} +38 -38
  9. package/dist/{chunk-5JOF627H.cjs → chunk-5YGDYMRB.cjs} +54 -30
  10. package/dist/{chunk-CWSDZEZG.cjs → chunk-7IWQE76Z.cjs} +2 -2
  11. package/dist/chunk-AELYAUEE.cjs +316 -0
  12. package/dist/{chunk-4C3EPMMF.cjs → chunk-D3G23FP3.cjs} +12 -8
  13. package/dist/{chunk-X37I6GZT.cjs → chunk-EVCC233P.cjs} +29 -16
  14. package/dist/chunk-JPB6RPGB.js +304 -0
  15. package/dist/{chunk-ILW7XYNJ.js → chunk-M3YJLWTU.js} +23 -10
  16. package/dist/{chunk-VK6FX47H.js → chunk-OMN3UI6X.js} +38 -38
  17. package/dist/{chunk-3RVHWGWO.js → chunk-Q6SHQECN.js} +2 -9
  18. package/dist/{chunk-2YONKUWB.js → chunk-QJ3AHN64.js} +54 -30
  19. package/dist/{chunk-VB7KH62D.cjs → chunk-SKBVVI24.cjs} +4 -1
  20. package/dist/{chunk-DVPP5S6I.js → chunk-WTHDCRMY.js} +2 -2
  21. package/dist/{chunk-BMA2ORRT.js → chunk-Y3SV5XK4.js} +61 -32
  22. package/dist/server/handlers/agents.cjs +7 -7
  23. package/dist/server/handlers/agents.js +1 -1
  24. package/dist/server/handlers/logs.cjs +4 -4
  25. package/dist/server/handlers/logs.js +1 -1
  26. package/dist/server/handlers/network.cjs +5 -5
  27. package/dist/server/handlers/network.js +1 -1
  28. package/dist/server/handlers/telemetry.cjs +3 -3
  29. package/dist/server/handlers/telemetry.js +1 -1
  30. package/dist/server/handlers/tools.cjs +5 -5
  31. package/dist/server/handlers/tools.js +1 -1
  32. package/dist/server/handlers/vNextWorkflows.cjs +46 -0
  33. package/dist/server/handlers/vNextWorkflows.d.cts +10 -0
  34. package/dist/server/handlers/vNextWorkflows.d.ts +10 -0
  35. package/dist/server/handlers/vNextWorkflows.js +1 -0
  36. package/dist/server/handlers/voice.cjs +4 -4
  37. package/dist/server/handlers/voice.js +1 -1
  38. package/dist/server/handlers/workflows.cjs +11 -11
  39. package/dist/server/handlers/workflows.js +1 -1
  40. package/dist/server/handlers.cjs +19 -14
  41. package/dist/server/handlers.d.cts +1 -0
  42. package/dist/server/handlers.d.ts +1 -0
  43. package/dist/server/handlers.js +8 -7
  44. package/package.json +6 -6
@@ -1,4 +1,6 @@
1
- Elastic License 2.0 (ELv2)
1
+ # Elastic License 2.0 (ELv2)
2
+
3
+ Copyright (c) 2025 Mastra AI, Inc.
2
4
 
3
5
  **Acceptance**
4
6
  By using the software, you agree to all of the terms and conditions below.
@@ -1,27 +1,34 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
- import { BaseLogMessage } from '@mastra/core';
3
+ import type { BaseLogMessage } from '@mastra/core/logger';
4
4
  import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core';
5
+ import { EvalRow } from '@mastra/core/storage';
6
6
  import { GenerateObjectResult } from 'ai';
7
7
  import { GenerateTextResult } from 'ai';
8
8
  import type { Mastra } from '@mastra/core/mastra';
9
- import type { Mastra as Mastra_2 } from '@mastra/core';
10
9
  import type { MastraMemory } from '@mastra/core/memory';
11
10
  import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core';
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';
15
- import { Step } from '@mastra/core';
16
- import { StepExecutionContext } from '@mastra/core';
17
- import { StepGraph } from '@mastra/core';
18
- import { StorageThreadType } from '@mastra/core';
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';
19
+ import { Step } from '@mastra/core/workflows';
20
+ import { StepExecutionContext } from '@mastra/core/workflows';
21
+ import { StepGraph } from '@mastra/core/workflows';
22
+ import { StorageThreadType } from '@mastra/core/memory';
19
23
  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
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
23
- import { WorkflowRunResult } from '@mastra/core';
24
- import { WorkflowRuns } from '@mastra/core';
26
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
27
+ import { WorkflowResult } from '@mastra/core/workflows/vNext';
28
+ import { WorkflowRunResult } from '@mastra/core/workflows';
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,23 +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, agentId, body, }: Context & {
112
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
113
+ runtimeContext: RuntimeContext;
100
114
  agentId: string;
101
115
  body: GetBody<'generate'> & {
102
116
  resourceid?: string;
103
117
  };
104
118
  }): Promise<GenerateTextResult<any, any>>;
105
119
 
106
- export declare function generateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
120
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
121
+ runtimeContext: RuntimeContext;
107
122
  body: {
108
123
  messages?: Parameters<AgentNetwork['generate']>[0];
109
124
  } & Parameters<AgentNetwork['generate']>[1];
@@ -117,11 +132,10 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
117
132
  text?: string;
118
133
  speakerId?: string;
119
134
  };
120
- }): Promise<{
121
- audioData: Buffer<ArrayBuffer>;
122
- }>;
135
+ }): Promise<NodeJS.ReadableStream>;
123
136
 
124
- export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
137
+ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
138
+ runtimeContext: RuntimeContext;
125
139
  agentId: string;
126
140
  }): Promise<{
127
141
  name: any;
@@ -131,7 +145,9 @@ export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
131
145
  modelId: string;
132
146
  }>;
133
147
 
134
- export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
148
+ export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
149
+ runtimeContext: RuntimeContext;
150
+ }): Promise<any>;
135
151
 
136
152
  declare type GetBody<T extends keyof Agent & {
137
153
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
@@ -139,7 +155,8 @@ declare type GetBody<T extends keyof Agent & {
139
155
  messages: Parameters<Agent[T]>[0];
140
156
  } & Parameters<Agent[T]>[1];
141
157
 
142
- export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
158
+ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
159
+ runtimeContext: RuntimeContext;
143
160
  agentId: string;
144
161
  }): Promise<{
145
162
  id: string;
@@ -148,7 +165,8 @@ export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context &
148
165
  evals: EvalRow[];
149
166
  }>;
150
167
 
151
- export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
168
+ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
169
+ runtimeContext: RuntimeContext;
152
170
  agentId: string;
153
171
  }): Promise<{
154
172
  id: string;
@@ -159,7 +177,7 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Contex
159
177
 
160
178
  export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
161
179
 
162
- export declare function getLogsHandler({ mastra, transportId }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
180
+ export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
163
181
 
164
182
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
165
183
  transports: string[];
@@ -174,7 +192,7 @@ export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<
174
192
  uiMessages: Message[];
175
193
  }>;
176
194
 
177
- 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<{
178
196
  id: string;
179
197
  name: string;
180
198
  instructions: string;
@@ -189,7 +207,7 @@ export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<Networ
189
207
  };
190
208
  }>;
191
209
 
192
- export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
210
+ export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
193
211
  id: string;
194
212
  name: string;
195
213
  instructions: string;
@@ -221,6 +239,20 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
221
239
 
222
240
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
223
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
+
224
256
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
225
257
  stepGraph: StepGraph;
226
258
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -346,6 +378,7 @@ export declare namespace network {
346
378
 
347
379
  declare interface NetworkContext extends Context {
348
380
  networkId?: string;
381
+ runtimeContext: RuntimeContext;
349
382
  }
350
383
 
351
384
  declare interface QueryRequest {
@@ -362,18 +395,38 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
362
395
 
363
396
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
364
397
 
365
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, }: 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 & {
366
407
  body: {
367
408
  stepId: string;
368
409
  context: any;
369
410
  };
411
+ runtimeContext: RuntimeContext;
370
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>;
371
413
 
372
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, }: 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 & {
373
425
  body: {
374
426
  stepId: string;
375
427
  context: any;
376
428
  };
429
+ runtimeContext: RuntimeContext;
377
430
  }): Promise<{
378
431
  message: string;
379
432
  }>;
@@ -386,12 +439,26 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
386
439
 
387
440
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
388
441
 
389
- export declare function startAsyncWorkflowHandler({ mastra, 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'> & {
390
448
  triggerData?: unknown;
449
+ runtimeContext: RuntimeContext;
391
450
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
392
451
 
393
- export declare function startWorkflowRunHandler({ mastra, 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'> & {
394
460
  triggerData?: unknown;
461
+ runtimeContext: RuntimeContext;
395
462
  }): Promise<{
396
463
  message: string;
397
464
  }>;
@@ -415,14 +482,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
415
482
  traceCount: number;
416
483
  }>;
417
484
 
418
- export declare function streamGenerateHandler({ mastra, agentId, body, }: Context & {
485
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
486
+ runtimeContext: RuntimeContext;
419
487
  agentId: string;
420
488
  body: GetBody<'stream'> & {
421
489
  resourceid?: string;
422
490
  };
423
491
  }): Promise<Response | undefined>;
424
492
 
425
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
493
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
494
+ runtimeContext: RuntimeContext;
426
495
  body: {
427
496
  messages?: Parameters<AgentNetwork['stream']>[0];
428
497
  } & Parameters<AgentNetwork['stream']>[1];
@@ -526,6 +595,26 @@ declare interface VectorContext extends Context {
526
595
  vectorName?: string;
527
596
  }
528
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
+
529
618
  export declare namespace voice {
530
619
  export {
531
620
  getSpeakersHandler,
@@ -538,10 +627,11 @@ declare interface VoiceContext extends Context {
538
627
  agentId?: string;
539
628
  }
540
629
 
630
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
631
+
541
632
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
542
633
 
543
- declare interface WorkflowContext {
544
- mastra: Mastra_2;
634
+ declare interface WorkflowContext extends Context {
545
635
  workflowId?: string;
546
636
  runId?: string;
547
637
  }
@@ -1,27 +1,34 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
- import { BaseLogMessage } from '@mastra/core';
3
+ import type { BaseLogMessage } from '@mastra/core/logger';
4
4
  import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core';
5
+ import { EvalRow } from '@mastra/core/storage';
6
6
  import { GenerateObjectResult } from 'ai';
7
7
  import { GenerateTextResult } from 'ai';
8
8
  import type { Mastra } from '@mastra/core/mastra';
9
- import type { Mastra as Mastra_2 } from '@mastra/core';
10
9
  import type { MastraMemory } from '@mastra/core/memory';
11
10
  import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core';
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';
15
- import { Step } from '@mastra/core';
16
- import { StepExecutionContext } from '@mastra/core';
17
- import { StepGraph } from '@mastra/core';
18
- import { StorageThreadType } from '@mastra/core';
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';
19
+ import { Step } from '@mastra/core/workflows';
20
+ import { StepExecutionContext } from '@mastra/core/workflows';
21
+ import { StepGraph } from '@mastra/core/workflows';
22
+ import { StorageThreadType } from '@mastra/core/memory';
19
23
  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
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
23
- import { WorkflowRunResult } from '@mastra/core';
24
- import { WorkflowRuns } from '@mastra/core';
26
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
27
+ import { WorkflowResult } from '@mastra/core/workflows/vNext';
28
+ import { WorkflowRunResult } from '@mastra/core/workflows';
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,23 +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, agentId, body, }: Context & {
112
+ export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
113
+ runtimeContext: RuntimeContext;
100
114
  agentId: string;
101
115
  body: GetBody<'generate'> & {
102
116
  resourceid?: string;
103
117
  };
104
118
  }): Promise<GenerateTextResult<any, any>>;
105
119
 
106
- export declare function generateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
120
+ export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
121
+ runtimeContext: RuntimeContext;
107
122
  body: {
108
123
  messages?: Parameters<AgentNetwork['generate']>[0];
109
124
  } & Parameters<AgentNetwork['generate']>[1];
@@ -117,11 +132,10 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
117
132
  text?: string;
118
133
  speakerId?: string;
119
134
  };
120
- }): Promise<{
121
- audioData: Buffer<ArrayBuffer>;
122
- }>;
135
+ }): Promise<NodeJS.ReadableStream>;
123
136
 
124
- export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
137
+ export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, }: Context & {
138
+ runtimeContext: RuntimeContext;
125
139
  agentId: string;
126
140
  }): Promise<{
127
141
  name: any;
@@ -131,7 +145,9 @@ export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
131
145
  modelId: string;
132
146
  }>;
133
147
 
134
- export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
148
+ export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
149
+ runtimeContext: RuntimeContext;
150
+ }): Promise<any>;
135
151
 
136
152
  declare type GetBody<T extends keyof Agent & {
137
153
  [K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
@@ -139,7 +155,8 @@ declare type GetBody<T extends keyof Agent & {
139
155
  messages: Parameters<Agent[T]>[0];
140
156
  } & Parameters<Agent[T]>[1];
141
157
 
142
- export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
158
+ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
159
+ runtimeContext: RuntimeContext;
143
160
  agentId: string;
144
161
  }): Promise<{
145
162
  id: string;
@@ -148,7 +165,8 @@ export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context &
148
165
  evals: EvalRow[];
149
166
  }>;
150
167
 
151
- export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
168
+ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
169
+ runtimeContext: RuntimeContext;
152
170
  agentId: string;
153
171
  }): Promise<{
154
172
  id: string;
@@ -159,7 +177,7 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Contex
159
177
 
160
178
  export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
161
179
 
162
- export declare function getLogsHandler({ mastra, transportId }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
180
+ export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
163
181
 
164
182
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
165
183
  transports: string[];
@@ -174,7 +192,7 @@ export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<
174
192
  uiMessages: Message[];
175
193
  }>;
176
194
 
177
- 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<{
178
196
  id: string;
179
197
  name: string;
180
198
  instructions: string;
@@ -189,7 +207,7 @@ export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<Networ
189
207
  };
190
208
  }>;
191
209
 
192
- export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
210
+ export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
193
211
  id: string;
194
212
  name: string;
195
213
  instructions: string;
@@ -221,6 +239,20 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
221
239
 
222
240
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
223
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
+
224
256
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
225
257
  stepGraph: StepGraph;
226
258
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -346,6 +378,7 @@ export declare namespace network {
346
378
 
347
379
  declare interface NetworkContext extends Context {
348
380
  networkId?: string;
381
+ runtimeContext: RuntimeContext;
349
382
  }
350
383
 
351
384
  declare interface QueryRequest {
@@ -362,18 +395,38 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
362
395
 
363
396
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
364
397
 
365
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, }: 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 & {
366
407
  body: {
367
408
  stepId: string;
368
409
  context: any;
369
410
  };
411
+ runtimeContext: RuntimeContext;
370
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>;
371
413
 
372
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, }: 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 & {
373
425
  body: {
374
426
  stepId: string;
375
427
  context: any;
376
428
  };
429
+ runtimeContext: RuntimeContext;
377
430
  }): Promise<{
378
431
  message: string;
379
432
  }>;
@@ -386,12 +439,26 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
386
439
 
387
440
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
388
441
 
389
- export declare function startAsyncWorkflowHandler({ mastra, 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'> & {
390
448
  triggerData?: unknown;
449
+ runtimeContext: RuntimeContext;
391
450
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
392
451
 
393
- export declare function startWorkflowRunHandler({ mastra, 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'> & {
394
460
  triggerData?: unknown;
461
+ runtimeContext: RuntimeContext;
395
462
  }): Promise<{
396
463
  message: string;
397
464
  }>;
@@ -415,14 +482,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
415
482
  traceCount: number;
416
483
  }>;
417
484
 
418
- export declare function streamGenerateHandler({ mastra, agentId, body, }: Context & {
485
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
486
+ runtimeContext: RuntimeContext;
419
487
  agentId: string;
420
488
  body: GetBody<'stream'> & {
421
489
  resourceid?: string;
422
490
  };
423
491
  }): Promise<Response | undefined>;
424
492
 
425
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
493
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
494
+ runtimeContext: RuntimeContext;
426
495
  body: {
427
496
  messages?: Parameters<AgentNetwork['stream']>[0];
428
497
  } & Parameters<AgentNetwork['stream']>[1];
@@ -526,6 +595,26 @@ declare interface VectorContext extends Context {
526
595
  vectorName?: string;
527
596
  }
528
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
+
529
618
  export declare namespace voice {
530
619
  export {
531
620
  getSpeakersHandler,
@@ -538,10 +627,11 @@ declare interface VoiceContext extends Context {
538
627
  agentId?: string;
539
628
  }
540
629
 
630
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
631
+
541
632
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
542
633
 
543
- declare interface WorkflowContext {
544
- mastra: Mastra_2;
634
+ declare interface WorkflowContext extends Context {
545
635
  workflowId?: string;
546
636
  runId?: string;
547
637
  }
@@ -9,7 +9,10 @@ __export(logs_exports, {
9
9
  getLogsByRunIdHandler: () => getLogsByRunIdHandler,
10
10
  getLogsHandler: () => getLogsHandler
11
11
  });
12
- async function getLogsHandler({ mastra, transportId }) {
12
+ async function getLogsHandler({
13
+ mastra,
14
+ transportId
15
+ }) {
13
16
  try {
14
17
  validateBody({ transportId });
15
18
  const logs = await mastra.getLogs(transportId);