@mastra/server 0.0.0-extend-clickhouse-20250418135620 → 0.0.0-fix-message-embedding-20250506021742

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 (37) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +126 -31
  2. package/dist/_tsup-dts-rollup.d.ts +126 -31
  3. package/dist/{chunk-4B7OUZXW.js → chunk-3XTEV33Q.js} +25 -13
  4. package/dist/{chunk-4WJ5GHRG.cjs → chunk-4BIX6GMY.cjs} +56 -31
  5. package/dist/{chunk-A7DF4ETD.cjs → chunk-55HTWX4C.cjs} +2 -9
  6. package/dist/{chunk-XISBMH56.js → chunk-5JNVY6DU.js} +4 -4
  7. package/dist/{chunk-JLDXUWK7.cjs → chunk-5YGDYMRB.cjs} +52 -31
  8. package/dist/{chunk-7IWQE76Z.cjs → chunk-AMVOS7YB.cjs} +4 -2
  9. package/dist/{chunk-WTHDCRMY.js → chunk-BPL2CBLV.js} +4 -2
  10. package/dist/{chunk-RNU4JMLM.cjs → chunk-CHFORQ7J.cjs} +25 -13
  11. package/dist/{chunk-HABV7TZK.cjs → chunk-D3G23FP3.cjs} +4 -4
  12. package/dist/chunk-FOXHTOQZ.cjs +324 -0
  13. package/dist/chunk-IQTNZSFP.js +312 -0
  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-TFFNX7FI.js → chunk-Y3SV5XK4.js} +56 -31
  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/telemetry.cjs +3 -3
  22. package/dist/server/handlers/telemetry.js +1 -1
  23. package/dist/server/handlers/tools.cjs +5 -5
  24. package/dist/server/handlers/tools.js +1 -1
  25. package/dist/server/handlers/vNextWorkflows.cjs +46 -0
  26. package/dist/server/handlers/vNextWorkflows.d.cts +10 -0
  27. package/dist/server/handlers/vNextWorkflows.d.ts +10 -0
  28. package/dist/server/handlers/vNextWorkflows.js +1 -0
  29. package/dist/server/handlers/voice.cjs +4 -4
  30. package/dist/server/handlers/voice.js +1 -1
  31. package/dist/server/handlers/workflows.cjs +11 -11
  32. package/dist/server/handlers/workflows.js +1 -1
  33. package/dist/server/handlers.cjs +17 -12
  34. package/dist/server/handlers.d.cts +1 -0
  35. package/dist/server/handlers.d.ts +1 -0
  36. package/dist/server/handlers.js +7 -6
  37. 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,26 @@ 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, fromDate, toDate, limit, offset, resourceId, }: VNextWorkflowContext & {
253
+ fromDate?: Date;
254
+ toDate?: Date;
255
+ limit?: number;
256
+ offset?: number;
257
+ resourceId?: string;
258
+ }): Promise<WorkflowRuns>;
259
+
260
+ export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
261
+
228
262
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
229
263
  stepGraph: StepGraph;
230
264
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -237,7 +271,13 @@ export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowC
237
271
 
238
272
  export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
239
273
 
240
- export declare function getWorkflowRunsHandler({ mastra, workflowId }: WorkflowContext): Promise<WorkflowRuns>;
274
+ export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
275
+ fromDate?: Date;
276
+ toDate?: Date;
277
+ limit?: number;
278
+ offset?: number;
279
+ resourceId?: string;
280
+ }): Promise<WorkflowRuns>;
241
281
 
242
282
  export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
243
283
 
@@ -350,6 +390,7 @@ export declare namespace network {
350
390
 
351
391
  declare interface NetworkContext extends Context {
352
392
  networkId?: string;
393
+ runtimeContext: RuntimeContext;
353
394
  }
354
395
 
355
396
  declare interface QueryRequest {
@@ -366,20 +407,38 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
366
407
 
367
408
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
368
409
 
369
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
410
+ export declare function resumeAsyncVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
411
+ body: {
412
+ step: string | string[];
413
+ resumeData?: unknown;
414
+ };
415
+ runtimeContext?: RuntimeContext_2;
416
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
417
+
418
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
370
419
  body: {
371
420
  stepId: string;
372
421
  context: any;
373
422
  };
374
- container: Container;
423
+ runtimeContext: RuntimeContext;
375
424
  }): 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
425
 
377
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
426
+ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
427
+ body: {
428
+ step: string | string[];
429
+ resumeData?: unknown;
430
+ };
431
+ runtimeContext?: RuntimeContext_2;
432
+ }): Promise<{
433
+ message: string;
434
+ }>;
435
+
436
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
378
437
  body: {
379
438
  stepId: string;
380
439
  context: any;
381
440
  };
382
- container: Container;
441
+ runtimeContext: RuntimeContext;
383
442
  }): Promise<{
384
443
  message: string;
385
444
  }>;
@@ -392,14 +451,26 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
392
451
 
393
452
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
394
453
 
395
- export declare function startAsyncWorkflowHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
454
+ export declare function startAsyncVNextWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
455
+ inputData?: unknown;
456
+ runtimeContext?: RuntimeContext_2;
457
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
458
+
459
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
396
460
  triggerData?: unknown;
397
- container: Container;
461
+ runtimeContext: RuntimeContext;
398
462
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
399
463
 
400
- export declare function startWorkflowRunHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
464
+ export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
465
+ inputData?: unknown;
466
+ runtimeContext?: RuntimeContext_2;
467
+ }): Promise<{
468
+ message: string;
469
+ }>;
470
+
471
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
401
472
  triggerData?: unknown;
402
- container: Container;
473
+ runtimeContext: RuntimeContext;
403
474
  }): Promise<{
404
475
  message: string;
405
476
  }>;
@@ -423,16 +494,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
423
494
  traceCount: number;
424
495
  }>;
425
496
 
426
- export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
427
- container: Container;
497
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
498
+ runtimeContext: RuntimeContext;
428
499
  agentId: string;
429
500
  body: GetBody<'stream'> & {
430
501
  resourceid?: string;
431
502
  };
432
503
  }): Promise<Response | undefined>;
433
504
 
434
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
435
- container: Container;
505
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
506
+ runtimeContext: RuntimeContext;
436
507
  body: {
437
508
  messages?: Parameters<AgentNetwork['stream']>[0];
438
509
  } & Parameters<AgentNetwork['stream']>[1];
@@ -454,6 +525,8 @@ declare interface TelemetryContext extends Context {
454
525
  page?: number;
455
526
  perPage?: number;
456
527
  attribute?: string | string[];
528
+ fromDate?: Date;
529
+ toDate?: Date;
457
530
  };
458
531
  }
459
532
 
@@ -536,6 +609,26 @@ declare interface VectorContext extends Context {
536
609
  vectorName?: string;
537
610
  }
538
611
 
612
+ declare interface VNextWorkflowContext extends Context {
613
+ workflowId?: string;
614
+ runId?: string;
615
+ }
616
+
617
+ export declare namespace vNextWorkflows {
618
+ export {
619
+ getVNextWorkflowsHandler,
620
+ getVNextWorkflowByIdHandler,
621
+ getVNextWorkflowRunHandler,
622
+ createVNextWorkflowRunHandler,
623
+ startAsyncVNextWorkflowHandler,
624
+ startVNextWorkflowRunHandler,
625
+ watchVNextWorkflowHandler,
626
+ resumeAsyncVNextWorkflowHandler,
627
+ resumeVNextWorkflowHandler,
628
+ getVNextWorkflowRunsHandler
629
+ }
630
+ }
631
+
539
632
  export declare namespace voice {
540
633
  export {
541
634
  getSpeakersHandler,
@@ -548,6 +641,8 @@ declare interface VoiceContext extends Context {
548
641
  agentId?: string;
549
642
  }
550
643
 
644
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
645
+
551
646
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
552
647
 
553
648
  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,26 @@ 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, fromDate, toDate, limit, offset, resourceId, }: VNextWorkflowContext & {
253
+ fromDate?: Date;
254
+ toDate?: Date;
255
+ limit?: number;
256
+ offset?: number;
257
+ resourceId?: string;
258
+ }): Promise<WorkflowRuns>;
259
+
260
+ export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
261
+
228
262
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
229
263
  stepGraph: StepGraph;
230
264
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -237,7 +271,13 @@ export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowC
237
271
 
238
272
  export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
239
273
 
240
- export declare function getWorkflowRunsHandler({ mastra, workflowId }: WorkflowContext): Promise<WorkflowRuns>;
274
+ export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
275
+ fromDate?: Date;
276
+ toDate?: Date;
277
+ limit?: number;
278
+ offset?: number;
279
+ resourceId?: string;
280
+ }): Promise<WorkflowRuns>;
241
281
 
242
282
  export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
243
283
 
@@ -350,6 +390,7 @@ export declare namespace network {
350
390
 
351
391
  declare interface NetworkContext extends Context {
352
392
  networkId?: string;
393
+ runtimeContext: RuntimeContext;
353
394
  }
354
395
 
355
396
  declare interface QueryRequest {
@@ -366,20 +407,38 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
366
407
 
367
408
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
368
409
 
369
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
410
+ export declare function resumeAsyncVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
411
+ body: {
412
+ step: string | string[];
413
+ resumeData?: unknown;
414
+ };
415
+ runtimeContext?: RuntimeContext_2;
416
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
417
+
418
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
370
419
  body: {
371
420
  stepId: string;
372
421
  context: any;
373
422
  };
374
- container: Container;
423
+ runtimeContext: RuntimeContext;
375
424
  }): 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
425
 
377
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
426
+ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
427
+ body: {
428
+ step: string | string[];
429
+ resumeData?: unknown;
430
+ };
431
+ runtimeContext?: RuntimeContext_2;
432
+ }): Promise<{
433
+ message: string;
434
+ }>;
435
+
436
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
378
437
  body: {
379
438
  stepId: string;
380
439
  context: any;
381
440
  };
382
- container: Container;
441
+ runtimeContext: RuntimeContext;
383
442
  }): Promise<{
384
443
  message: string;
385
444
  }>;
@@ -392,14 +451,26 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
392
451
 
393
452
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
394
453
 
395
- export declare function startAsyncWorkflowHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
454
+ export declare function startAsyncVNextWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
455
+ inputData?: unknown;
456
+ runtimeContext?: RuntimeContext_2;
457
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
458
+
459
+ export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
396
460
  triggerData?: unknown;
397
- container: Container;
461
+ runtimeContext: RuntimeContext;
398
462
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
399
463
 
400
- export declare function startWorkflowRunHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
464
+ export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
465
+ inputData?: unknown;
466
+ runtimeContext?: RuntimeContext_2;
467
+ }): Promise<{
468
+ message: string;
469
+ }>;
470
+
471
+ export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
401
472
  triggerData?: unknown;
402
- container: Container;
473
+ runtimeContext: RuntimeContext;
403
474
  }): Promise<{
404
475
  message: string;
405
476
  }>;
@@ -423,16 +494,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
423
494
  traceCount: number;
424
495
  }>;
425
496
 
426
- export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
427
- container: Container;
497
+ export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
498
+ runtimeContext: RuntimeContext;
428
499
  agentId: string;
429
500
  body: GetBody<'stream'> & {
430
501
  resourceid?: string;
431
502
  };
432
503
  }): Promise<Response | undefined>;
433
504
 
434
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
435
- container: Container;
505
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
506
+ runtimeContext: RuntimeContext;
436
507
  body: {
437
508
  messages?: Parameters<AgentNetwork['stream']>[0];
438
509
  } & Parameters<AgentNetwork['stream']>[1];
@@ -454,6 +525,8 @@ declare interface TelemetryContext extends Context {
454
525
  page?: number;
455
526
  perPage?: number;
456
527
  attribute?: string | string[];
528
+ fromDate?: Date;
529
+ toDate?: Date;
457
530
  };
458
531
  }
459
532
 
@@ -536,6 +609,26 @@ declare interface VectorContext extends Context {
536
609
  vectorName?: string;
537
610
  }
538
611
 
612
+ declare interface VNextWorkflowContext extends Context {
613
+ workflowId?: string;
614
+ runId?: string;
615
+ }
616
+
617
+ export declare namespace vNextWorkflows {
618
+ export {
619
+ getVNextWorkflowsHandler,
620
+ getVNextWorkflowByIdHandler,
621
+ getVNextWorkflowRunHandler,
622
+ createVNextWorkflowRunHandler,
623
+ startAsyncVNextWorkflowHandler,
624
+ startVNextWorkflowRunHandler,
625
+ watchVNextWorkflowHandler,
626
+ resumeAsyncVNextWorkflowHandler,
627
+ resumeVNextWorkflowHandler,
628
+ getVNextWorkflowRunsHandler
629
+ }
630
+ }
631
+
539
632
  export declare namespace voice {
540
633
  export {
541
634
  getSpeakersHandler,
@@ -548,6 +641,8 @@ declare interface VoiceContext extends Context {
548
641
  agentId?: string;
549
642
  }
550
643
 
644
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
645
+
551
646
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
552
647
 
553
648
  declare interface WorkflowContext extends Context {