@mastra/server 2.0.0 → 2.0.1-alpha.1

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.
@@ -9,19 +9,26 @@ import type { Mastra } from '@mastra/core/mastra';
9
9
  import type { MastraMemory } from '@mastra/core/memory';
10
10
  import { Message } from 'ai';
11
11
  import { MessageType } from '@mastra/core/memory';
12
+ import { NewStep } from '@mastra/core/workflows/vNext';
13
+ import type { NewWorkflow } from '@mastra/core/workflows/vNext';
12
14
  import type { QueryResult } from '@mastra/core/vector';
13
15
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
14
- import type { RuntimeContext } from '@mastra/core/di';
16
+ import type { RuntimeContext } from '@mastra/core/runtime-context';
17
+ import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
15
18
  import { Step } from '@mastra/core/workflows';
16
19
  import { StepExecutionContext } from '@mastra/core/workflows';
20
+ import { StepFlowEntry } from '@mastra/core/workflows/vNext';
17
21
  import { StepGraph } from '@mastra/core/workflows';
18
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
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<{
@@ -121,9 +132,7 @@ 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
137
  export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
129
138
  agentId: string;
@@ -225,6 +234,20 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
225
234
 
226
235
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
227
236
 
237
+ export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<{
238
+ steps: any;
239
+ name: string | undefined;
240
+ stepGraph: StepFlowEntry[];
241
+ inputSchema: string | undefined;
242
+ outputSchema: string | undefined;
243
+ }>;
244
+
245
+ export declare function getVNextWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRun']>>;
246
+
247
+ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<WorkflowRuns>;
248
+
249
+ export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
250
+
228
251
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
229
252
  stepGraph: StepGraph;
230
253
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -366,6 +389,14 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
366
389
 
367
390
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
368
391
 
392
+ export declare function resumeAsyncVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
393
+ body: {
394
+ step: string | string[];
395
+ resumeData?: unknown;
396
+ };
397
+ runtimeContext?: RuntimeContext_2;
398
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, ZodType<any, ZodTypeDef, any>, ZodType<any, ZodTypeDef, any>>[]>>;
399
+
369
400
  export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
370
401
  body: {
371
402
  stepId: string;
@@ -374,6 +405,16 @@ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId,
374
405
  runtimeContext: RuntimeContext;
375
406
  }): 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
407
 
408
+ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
409
+ body: {
410
+ step: string | string[];
411
+ resumeData?: unknown;
412
+ };
413
+ runtimeContext?: RuntimeContext_2;
414
+ }): Promise<{
415
+ message: string;
416
+ }>;
417
+
377
418
  export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
378
419
  body: {
379
420
  stepId: string;
@@ -392,11 +433,23 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
392
433
 
393
434
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
394
435
 
436
+ export declare function startAsyncVNextWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
437
+ inputData?: unknown;
438
+ runtimeContext?: RuntimeContext_2;
439
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, ZodType<any, ZodTypeDef, any>, ZodType<any, ZodTypeDef, any>>[]>>;
440
+
395
441
  export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
396
442
  triggerData?: unknown;
397
443
  runtimeContext: RuntimeContext;
398
444
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
399
445
 
446
+ export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
447
+ inputData?: unknown;
448
+ runtimeContext?: RuntimeContext_2;
449
+ }): Promise<{
450
+ message: string;
451
+ }>;
452
+
400
453
  export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
401
454
  triggerData?: unknown;
402
455
  runtimeContext: RuntimeContext;
@@ -536,6 +589,26 @@ declare interface VectorContext extends Context {
536
589
  vectorName?: string;
537
590
  }
538
591
 
592
+ declare interface VNextWorkflowContext extends Context {
593
+ workflowId?: string;
594
+ runId?: string;
595
+ }
596
+
597
+ export declare namespace vNextWorkflows {
598
+ export {
599
+ getVNextWorkflowsHandler,
600
+ getVNextWorkflowByIdHandler,
601
+ getVNextWorkflowRunHandler,
602
+ createVNextWorkflowRunHandler,
603
+ startAsyncVNextWorkflowHandler,
604
+ startVNextWorkflowRunHandler,
605
+ watchVNextWorkflowHandler,
606
+ resumeAsyncVNextWorkflowHandler,
607
+ resumeVNextWorkflowHandler,
608
+ getVNextWorkflowRunsHandler
609
+ }
610
+ }
611
+
539
612
  export declare namespace voice {
540
613
  export {
541
614
  getSpeakersHandler,
@@ -548,6 +621,8 @@ declare interface VoiceContext extends Context {
548
621
  agentId?: string;
549
622
  }
550
623
 
624
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
625
+
551
626
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
552
627
 
553
628
  declare interface WorkflowContext extends Context {
@@ -9,19 +9,26 @@ import type { Mastra } from '@mastra/core/mastra';
9
9
  import type { MastraMemory } from '@mastra/core/memory';
10
10
  import { Message } from 'ai';
11
11
  import { MessageType } from '@mastra/core/memory';
12
+ import { NewStep } from '@mastra/core/workflows/vNext';
13
+ import type { NewWorkflow } from '@mastra/core/workflows/vNext';
12
14
  import type { QueryResult } from '@mastra/core/vector';
13
15
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
14
- import type { RuntimeContext } from '@mastra/core/di';
16
+ import type { RuntimeContext } from '@mastra/core/runtime-context';
17
+ import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
15
18
  import { Step } from '@mastra/core/workflows';
16
19
  import { StepExecutionContext } from '@mastra/core/workflows';
20
+ import { StepFlowEntry } from '@mastra/core/workflows/vNext';
17
21
  import { StepGraph } from '@mastra/core/workflows';
18
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
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<{
@@ -121,9 +132,7 @@ 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
137
  export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
129
138
  agentId: string;
@@ -225,6 +234,20 @@ export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext,
225
234
 
226
235
  export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
227
236
 
237
+ export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<{
238
+ steps: any;
239
+ name: string | undefined;
240
+ stepGraph: StepFlowEntry[];
241
+ inputSchema: string | undefined;
242
+ outputSchema: string | undefined;
243
+ }>;
244
+
245
+ export declare function getVNextWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRun']>>;
246
+
247
+ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<WorkflowRuns>;
248
+
249
+ export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
250
+
228
251
  export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
229
252
  stepGraph: StepGraph;
230
253
  stepSubscriberGraph: Record<string, StepGraph>;
@@ -366,6 +389,14 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
366
389
 
367
390
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
368
391
 
392
+ export declare function resumeAsyncVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
393
+ body: {
394
+ step: string | string[];
395
+ resumeData?: unknown;
396
+ };
397
+ runtimeContext?: RuntimeContext_2;
398
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, ZodType<any, ZodTypeDef, any>, ZodType<any, ZodTypeDef, any>>[]>>;
399
+
369
400
  export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
370
401
  body: {
371
402
  stepId: string;
@@ -374,6 +405,16 @@ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId,
374
405
  runtimeContext: RuntimeContext;
375
406
  }): 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
407
 
408
+ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: VNextWorkflowContext & {
409
+ body: {
410
+ step: string | string[];
411
+ resumeData?: unknown;
412
+ };
413
+ runtimeContext?: RuntimeContext_2;
414
+ }): Promise<{
415
+ message: string;
416
+ }>;
417
+
377
418
  export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
378
419
  body: {
379
420
  stepId: string;
@@ -392,11 +433,23 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
392
433
 
393
434
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
394
435
 
436
+ export declare function startAsyncVNextWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
437
+ inputData?: unknown;
438
+ runtimeContext?: RuntimeContext_2;
439
+ }): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, ZodType<any, ZodTypeDef, any>, ZodType<any, ZodTypeDef, any>>[]>>;
440
+
395
441
  export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
396
442
  triggerData?: unknown;
397
443
  runtimeContext: RuntimeContext;
398
444
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
399
445
 
446
+ export declare function startVNextWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
447
+ inputData?: unknown;
448
+ runtimeContext?: RuntimeContext_2;
449
+ }): Promise<{
450
+ message: string;
451
+ }>;
452
+
400
453
  export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
401
454
  triggerData?: unknown;
402
455
  runtimeContext: RuntimeContext;
@@ -536,6 +589,26 @@ declare interface VectorContext extends Context {
536
589
  vectorName?: string;
537
590
  }
538
591
 
592
+ declare interface VNextWorkflowContext extends Context {
593
+ workflowId?: string;
594
+ runId?: string;
595
+ }
596
+
597
+ export declare namespace vNextWorkflows {
598
+ export {
599
+ getVNextWorkflowsHandler,
600
+ getVNextWorkflowByIdHandler,
601
+ getVNextWorkflowRunHandler,
602
+ createVNextWorkflowRunHandler,
603
+ startAsyncVNextWorkflowHandler,
604
+ startVNextWorkflowRunHandler,
605
+ watchVNextWorkflowHandler,
606
+ resumeAsyncVNextWorkflowHandler,
607
+ resumeVNextWorkflowHandler,
608
+ getVNextWorkflowRunsHandler
609
+ }
610
+ }
611
+
539
612
  export declare namespace voice {
540
613
  export {
541
614
  getSpeakersHandler,
@@ -548,6 +621,8 @@ declare interface VoiceContext extends Context {
548
621
  agentId?: string;
549
622
  }
550
623
 
624
+ export declare function watchVNextWorkflowHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
625
+
551
626
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
552
627
 
553
628
  declare interface WorkflowContext extends Context {
@@ -53,12 +53,7 @@ async function generateSpeechHandler({
53
53
  if (!audioStream) {
54
54
  throw new chunkFV45V6WC_cjs.HTTPException(500, { message: "Failed to generate speech" });
55
55
  }
56
- const chunks = [];
57
- for await (const chunk of audioStream) {
58
- chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
59
- }
60
- const audioData = Buffer.concat(chunks);
61
- return { audioData };
56
+ return audioStream;
62
57
  } catch (error) {
63
58
  return chunkZLBRQFDD_cjs.handleError(error, "Error generating speech");
64
59
  }
@@ -0,0 +1,297 @@
1
+ import { stringify, esm_default } from './chunk-OMN3UI6X.js';
2
+ import { handleError } from './chunk-3AHQ5RGN.js';
3
+ import { __export, HTTPException } from './chunk-TRDNDNGQ.js';
4
+ import { ReadableStream } from 'node:stream/web';
5
+
6
+ // src/server/handlers/vNextWorkflows.ts
7
+ var vNextWorkflows_exports = {};
8
+ __export(vNextWorkflows_exports, {
9
+ createVNextWorkflowRunHandler: () => createVNextWorkflowRunHandler,
10
+ getVNextWorkflowByIdHandler: () => getVNextWorkflowByIdHandler,
11
+ getVNextWorkflowRunHandler: () => getVNextWorkflowRunHandler,
12
+ getVNextWorkflowRunsHandler: () => getVNextWorkflowRunsHandler,
13
+ getVNextWorkflowsHandler: () => getVNextWorkflowsHandler,
14
+ resumeAsyncVNextWorkflowHandler: () => resumeAsyncVNextWorkflowHandler,
15
+ resumeVNextWorkflowHandler: () => resumeVNextWorkflowHandler,
16
+ startAsyncVNextWorkflowHandler: () => startAsyncVNextWorkflowHandler,
17
+ startVNextWorkflowRunHandler: () => startVNextWorkflowRunHandler,
18
+ watchVNextWorkflowHandler: () => watchVNextWorkflowHandler
19
+ });
20
+ async function getVNextWorkflowsHandler({ mastra }) {
21
+ try {
22
+ const workflows = mastra.vnext_getWorkflows({ serialized: false });
23
+ const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
24
+ acc[key] = {
25
+ name: workflow.name,
26
+ steps: Object.entries(workflow.steps).reduce((acc2, [key2, step]) => {
27
+ acc2[key2] = {
28
+ ...step,
29
+ inputSchema: step.inputSchema ? stringify(esm_default(step.inputSchema)) : void 0,
30
+ outputSchema: step.outputSchema ? stringify(esm_default(step.outputSchema)) : void 0
31
+ };
32
+ return acc2;
33
+ }, {}),
34
+ stepGraph: workflow.stepGraph,
35
+ inputSchema: workflow.inputSchema ? stringify(esm_default(workflow.inputSchema)) : void 0,
36
+ outputSchema: workflow.outputSchema ? stringify(esm_default(workflow.outputSchema)) : void 0
37
+ };
38
+ return acc;
39
+ }, {});
40
+ return _workflows;
41
+ } catch (error) {
42
+ throw new HTTPException(500, { message: error?.message || "Error getting workflows" });
43
+ }
44
+ }
45
+ async function getVNextWorkflowByIdHandler({ mastra, workflowId }) {
46
+ try {
47
+ if (!workflowId) {
48
+ throw new HTTPException(400, { message: "Workflow ID is required" });
49
+ }
50
+ const workflow = mastra.vnext_getWorkflow(workflowId);
51
+ if (!workflow) {
52
+ throw new HTTPException(404, { message: "Workflow not found" });
53
+ }
54
+ return {
55
+ steps: Object.entries(workflow.steps).reduce((acc, [key, step]) => {
56
+ acc[key] = {
57
+ ...step,
58
+ inputSchema: step.inputSchema ? stringify(esm_default(step.inputSchema)) : void 0,
59
+ outputSchema: step.outputSchema ? stringify(esm_default(step.outputSchema)) : void 0
60
+ };
61
+ return acc;
62
+ }, {}),
63
+ name: workflow.name,
64
+ stepGraph: workflow.stepGraph,
65
+ inputSchema: workflow.inputSchema ? stringify(esm_default(workflow.inputSchema)) : void 0,
66
+ outputSchema: workflow.outputSchema ? stringify(esm_default(workflow.outputSchema)) : void 0
67
+ };
68
+ } catch (error) {
69
+ throw new HTTPException(500, { message: error?.message || "Error getting workflow" });
70
+ }
71
+ }
72
+ async function getVNextWorkflowRunHandler({
73
+ mastra,
74
+ workflowId,
75
+ runId
76
+ }) {
77
+ try {
78
+ if (!workflowId) {
79
+ throw new HTTPException(400, { message: "Workflow ID is required" });
80
+ }
81
+ if (!runId) {
82
+ throw new HTTPException(400, { message: "Run ID is required" });
83
+ }
84
+ const workflow = mastra.vnext_getWorkflow(workflowId);
85
+ if (!workflow) {
86
+ throw new HTTPException(404, { message: "Workflow not found" });
87
+ }
88
+ const run = await workflow.getWorkflowRun(runId);
89
+ if (!run) {
90
+ throw new HTTPException(404, { message: "Workflow run not found" });
91
+ }
92
+ return run;
93
+ } catch (error) {
94
+ throw new HTTPException(500, { message: error?.message || "Error getting workflow run" });
95
+ }
96
+ }
97
+ async function createVNextWorkflowRunHandler({
98
+ mastra,
99
+ workflowId,
100
+ runId: prevRunId
101
+ }) {
102
+ try {
103
+ if (!workflowId) {
104
+ throw new HTTPException(400, { message: "Workflow ID is required" });
105
+ }
106
+ const workflow = mastra.vnext_getWorkflow(workflowId);
107
+ if (!workflow) {
108
+ throw new HTTPException(404, { message: "Workflow not found" });
109
+ }
110
+ const run = workflow.createRun({ runId: prevRunId });
111
+ return { runId: run.runId };
112
+ } catch (error) {
113
+ throw new HTTPException(500, { message: error?.message || "Error creating workflow run" });
114
+ }
115
+ }
116
+ async function startAsyncVNextWorkflowHandler({
117
+ mastra,
118
+ runtimeContext,
119
+ workflowId,
120
+ runId,
121
+ inputData
122
+ }) {
123
+ try {
124
+ if (!workflowId) {
125
+ throw new HTTPException(400, { message: "Workflow ID is required" });
126
+ }
127
+ const workflow = mastra.vnext_getWorkflow(workflowId);
128
+ if (!workflow) {
129
+ throw new HTTPException(404, { message: "Workflow not found" });
130
+ }
131
+ const _run = workflow.createRun({ runId });
132
+ const result = await _run.start({
133
+ inputData,
134
+ runtimeContext
135
+ });
136
+ return result;
137
+ } catch (error) {
138
+ throw new HTTPException(500, { message: error?.message || "Error executing workflow" });
139
+ }
140
+ }
141
+ async function startVNextWorkflowRunHandler({
142
+ mastra,
143
+ runtimeContext,
144
+ workflowId,
145
+ runId,
146
+ inputData
147
+ }) {
148
+ try {
149
+ if (!workflowId) {
150
+ throw new HTTPException(400, { message: "Workflow ID is required" });
151
+ }
152
+ if (!runId) {
153
+ throw new HTTPException(400, { message: "runId required to start run" });
154
+ }
155
+ const workflow = mastra.vnext_getWorkflow(workflowId);
156
+ const run = await workflow.getWorkflowRun(runId);
157
+ if (!run) {
158
+ throw new HTTPException(404, { message: "Workflow run not found" });
159
+ }
160
+ const _run = workflow.createRun({ runId });
161
+ await _run.start({
162
+ inputData,
163
+ runtimeContext
164
+ });
165
+ return { message: "Workflow run started" };
166
+ } catch (e) {
167
+ return handleError(e, "Error starting workflow run");
168
+ }
169
+ }
170
+ async function watchVNextWorkflowHandler({
171
+ mastra,
172
+ workflowId,
173
+ runId
174
+ }) {
175
+ try {
176
+ if (!workflowId) {
177
+ throw new HTTPException(400, { message: "Workflow ID is required" });
178
+ }
179
+ if (!runId) {
180
+ throw new HTTPException(400, { message: "runId required to watch workflow" });
181
+ }
182
+ const workflow = mastra.vnext_getWorkflow(workflowId);
183
+ const run = await workflow.getWorkflowRun(runId);
184
+ if (!run) {
185
+ throw new HTTPException(404, { message: "Workflow run not found" });
186
+ }
187
+ const _run = workflow.createRun({ runId });
188
+ let unwatch;
189
+ let asyncRef = null;
190
+ const stream = new ReadableStream({
191
+ start(controller) {
192
+ unwatch = _run.watch(({ type, payload, eventTimestamp }) => {
193
+ controller.enqueue(JSON.stringify({ type, payload, eventTimestamp, runId }));
194
+ if (asyncRef) {
195
+ clearImmediate(asyncRef);
196
+ asyncRef = null;
197
+ }
198
+ asyncRef = setImmediate(async () => {
199
+ const runDone = payload.workflowState.status !== "running";
200
+ if (runDone) {
201
+ controller.close();
202
+ }
203
+ });
204
+ });
205
+ },
206
+ cancel() {
207
+ unwatch?.();
208
+ }
209
+ });
210
+ return stream;
211
+ } catch (error) {
212
+ return handleError(error, "Error watching workflow");
213
+ }
214
+ }
215
+ async function resumeAsyncVNextWorkflowHandler({
216
+ mastra,
217
+ workflowId,
218
+ runId,
219
+ body,
220
+ runtimeContext
221
+ }) {
222
+ try {
223
+ if (!workflowId) {
224
+ throw new HTTPException(400, { message: "Workflow ID is required" });
225
+ }
226
+ if (!runId) {
227
+ throw new HTTPException(400, { message: "runId required to resume workflow" });
228
+ }
229
+ if (!body.step) {
230
+ throw new HTTPException(400, { message: "step required to resume workflow" });
231
+ }
232
+ const workflow = mastra.vnext_getWorkflow(workflowId);
233
+ const run = await workflow.getWorkflowRun(runId);
234
+ if (!run) {
235
+ throw new HTTPException(404, { message: "Workflow run not found" });
236
+ }
237
+ const _run = workflow.createRun({ runId });
238
+ const result = await _run.resume({
239
+ step: body.step,
240
+ resumeData: body.resumeData,
241
+ runtimeContext
242
+ });
243
+ return result;
244
+ } catch (error) {
245
+ return handleError(error, "Error resuming workflow step");
246
+ }
247
+ }
248
+ async function resumeVNextWorkflowHandler({
249
+ mastra,
250
+ workflowId,
251
+ runId,
252
+ body,
253
+ runtimeContext
254
+ }) {
255
+ try {
256
+ if (!workflowId) {
257
+ throw new HTTPException(400, { message: "Workflow ID is required" });
258
+ }
259
+ if (!runId) {
260
+ throw new HTTPException(400, { message: "runId required to resume workflow" });
261
+ }
262
+ if (!body.step) {
263
+ throw new HTTPException(400, { message: "step required to resume workflow" });
264
+ }
265
+ const workflow = mastra.vnext_getWorkflow(workflowId);
266
+ const run = await workflow.getWorkflowRun(runId);
267
+ if (!run) {
268
+ throw new HTTPException(404, { message: "Workflow run not found" });
269
+ }
270
+ const _run = workflow.createRun({ runId });
271
+ await _run.resume({
272
+ step: body.step,
273
+ resumeData: body.resumeData,
274
+ runtimeContext
275
+ });
276
+ return { message: "Workflow run resumed" };
277
+ } catch (error) {
278
+ return handleError(error, "Error resuming workflow");
279
+ }
280
+ }
281
+ async function getVNextWorkflowRunsHandler({ mastra, workflowId }) {
282
+ try {
283
+ if (!workflowId) {
284
+ throw new HTTPException(400, { message: "Workflow ID is required" });
285
+ }
286
+ const workflow = mastra.vnext_getWorkflow(workflowId);
287
+ const workflowRuns = await workflow.getWorkflowRuns() || {
288
+ runs: [],
289
+ total: 0
290
+ };
291
+ return workflowRuns;
292
+ } catch (error) {
293
+ return handleError(error, "Error getting workflow runs");
294
+ }
295
+ }
296
+
297
+ export { createVNextWorkflowRunHandler, getVNextWorkflowByIdHandler, getVNextWorkflowRunHandler, getVNextWorkflowRunsHandler, getVNextWorkflowsHandler, resumeAsyncVNextWorkflowHandler, resumeVNextWorkflowHandler, startAsyncVNextWorkflowHandler, startVNextWorkflowRunHandler, vNextWorkflows_exports, watchVNextWorkflowHandler };
@@ -51,12 +51,7 @@ async function generateSpeechHandler({
51
51
  if (!audioStream) {
52
52
  throw new HTTPException(500, { message: "Failed to generate speech" });
53
53
  }
54
- const chunks = [];
55
- for await (const chunk of audioStream) {
56
- chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
57
- }
58
- const audioData = Buffer.concat(chunks);
59
- return { audioData };
54
+ return audioStream;
60
55
  } catch (error) {
61
56
  return handleError(error, "Error generating speech");
62
57
  }
@@ -0,0 +1,309 @@
1
+ 'use strict';
2
+
3
+ var chunk5SWCVTNL_cjs = require('./chunk-5SWCVTNL.cjs');
4
+ var chunkZLBRQFDD_cjs = require('./chunk-ZLBRQFDD.cjs');
5
+ var chunkFV45V6WC_cjs = require('./chunk-FV45V6WC.cjs');
6
+ var web = require('stream/web');
7
+
8
+ // src/server/handlers/vNextWorkflows.ts
9
+ var vNextWorkflows_exports = {};
10
+ chunkFV45V6WC_cjs.__export(vNextWorkflows_exports, {
11
+ createVNextWorkflowRunHandler: () => createVNextWorkflowRunHandler,
12
+ getVNextWorkflowByIdHandler: () => getVNextWorkflowByIdHandler,
13
+ getVNextWorkflowRunHandler: () => getVNextWorkflowRunHandler,
14
+ getVNextWorkflowRunsHandler: () => getVNextWorkflowRunsHandler,
15
+ getVNextWorkflowsHandler: () => getVNextWorkflowsHandler,
16
+ resumeAsyncVNextWorkflowHandler: () => resumeAsyncVNextWorkflowHandler,
17
+ resumeVNextWorkflowHandler: () => resumeVNextWorkflowHandler,
18
+ startAsyncVNextWorkflowHandler: () => startAsyncVNextWorkflowHandler,
19
+ startVNextWorkflowRunHandler: () => startVNextWorkflowRunHandler,
20
+ watchVNextWorkflowHandler: () => watchVNextWorkflowHandler
21
+ });
22
+ async function getVNextWorkflowsHandler({ mastra }) {
23
+ try {
24
+ const workflows = mastra.vnext_getWorkflows({ serialized: false });
25
+ const _workflows = Object.entries(workflows).reduce((acc, [key, workflow]) => {
26
+ acc[key] = {
27
+ name: workflow.name,
28
+ steps: Object.entries(workflow.steps).reduce((acc2, [key2, step]) => {
29
+ acc2[key2] = {
30
+ ...step,
31
+ inputSchema: step.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(step.inputSchema)) : void 0,
32
+ outputSchema: step.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(step.outputSchema)) : void 0
33
+ };
34
+ return acc2;
35
+ }, {}),
36
+ stepGraph: workflow.stepGraph,
37
+ inputSchema: workflow.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(workflow.inputSchema)) : void 0,
38
+ outputSchema: workflow.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(workflow.outputSchema)) : void 0
39
+ };
40
+ return acc;
41
+ }, {});
42
+ return _workflows;
43
+ } catch (error) {
44
+ throw new chunkFV45V6WC_cjs.HTTPException(500, { message: error?.message || "Error getting workflows" });
45
+ }
46
+ }
47
+ async function getVNextWorkflowByIdHandler({ mastra, workflowId }) {
48
+ try {
49
+ if (!workflowId) {
50
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
51
+ }
52
+ const workflow = mastra.vnext_getWorkflow(workflowId);
53
+ if (!workflow) {
54
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow not found" });
55
+ }
56
+ return {
57
+ steps: Object.entries(workflow.steps).reduce((acc, [key, step]) => {
58
+ acc[key] = {
59
+ ...step,
60
+ inputSchema: step.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(step.inputSchema)) : void 0,
61
+ outputSchema: step.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(step.outputSchema)) : void 0
62
+ };
63
+ return acc;
64
+ }, {}),
65
+ name: workflow.name,
66
+ stepGraph: workflow.stepGraph,
67
+ inputSchema: workflow.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(workflow.inputSchema)) : void 0,
68
+ outputSchema: workflow.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(workflow.outputSchema)) : void 0
69
+ };
70
+ } catch (error) {
71
+ throw new chunkFV45V6WC_cjs.HTTPException(500, { message: error?.message || "Error getting workflow" });
72
+ }
73
+ }
74
+ async function getVNextWorkflowRunHandler({
75
+ mastra,
76
+ workflowId,
77
+ runId
78
+ }) {
79
+ try {
80
+ if (!workflowId) {
81
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
82
+ }
83
+ if (!runId) {
84
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Run ID is required" });
85
+ }
86
+ const workflow = mastra.vnext_getWorkflow(workflowId);
87
+ if (!workflow) {
88
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow not found" });
89
+ }
90
+ const run = await workflow.getWorkflowRun(runId);
91
+ if (!run) {
92
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow run not found" });
93
+ }
94
+ return run;
95
+ } catch (error) {
96
+ throw new chunkFV45V6WC_cjs.HTTPException(500, { message: error?.message || "Error getting workflow run" });
97
+ }
98
+ }
99
+ async function createVNextWorkflowRunHandler({
100
+ mastra,
101
+ workflowId,
102
+ runId: prevRunId
103
+ }) {
104
+ try {
105
+ if (!workflowId) {
106
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
107
+ }
108
+ const workflow = mastra.vnext_getWorkflow(workflowId);
109
+ if (!workflow) {
110
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow not found" });
111
+ }
112
+ const run = workflow.createRun({ runId: prevRunId });
113
+ return { runId: run.runId };
114
+ } catch (error) {
115
+ throw new chunkFV45V6WC_cjs.HTTPException(500, { message: error?.message || "Error creating workflow run" });
116
+ }
117
+ }
118
+ async function startAsyncVNextWorkflowHandler({
119
+ mastra,
120
+ runtimeContext,
121
+ workflowId,
122
+ runId,
123
+ inputData
124
+ }) {
125
+ try {
126
+ if (!workflowId) {
127
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
128
+ }
129
+ const workflow = mastra.vnext_getWorkflow(workflowId);
130
+ if (!workflow) {
131
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow not found" });
132
+ }
133
+ const _run = workflow.createRun({ runId });
134
+ const result = await _run.start({
135
+ inputData,
136
+ runtimeContext
137
+ });
138
+ return result;
139
+ } catch (error) {
140
+ throw new chunkFV45V6WC_cjs.HTTPException(500, { message: error?.message || "Error executing workflow" });
141
+ }
142
+ }
143
+ async function startVNextWorkflowRunHandler({
144
+ mastra,
145
+ runtimeContext,
146
+ workflowId,
147
+ runId,
148
+ inputData
149
+ }) {
150
+ try {
151
+ if (!workflowId) {
152
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
153
+ }
154
+ if (!runId) {
155
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "runId required to start run" });
156
+ }
157
+ const workflow = mastra.vnext_getWorkflow(workflowId);
158
+ const run = await workflow.getWorkflowRun(runId);
159
+ if (!run) {
160
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow run not found" });
161
+ }
162
+ const _run = workflow.createRun({ runId });
163
+ await _run.start({
164
+ inputData,
165
+ runtimeContext
166
+ });
167
+ return { message: "Workflow run started" };
168
+ } catch (e) {
169
+ return chunkZLBRQFDD_cjs.handleError(e, "Error starting workflow run");
170
+ }
171
+ }
172
+ async function watchVNextWorkflowHandler({
173
+ mastra,
174
+ workflowId,
175
+ runId
176
+ }) {
177
+ try {
178
+ if (!workflowId) {
179
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
180
+ }
181
+ if (!runId) {
182
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "runId required to watch workflow" });
183
+ }
184
+ const workflow = mastra.vnext_getWorkflow(workflowId);
185
+ const run = await workflow.getWorkflowRun(runId);
186
+ if (!run) {
187
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow run not found" });
188
+ }
189
+ const _run = workflow.createRun({ runId });
190
+ let unwatch;
191
+ let asyncRef = null;
192
+ const stream = new web.ReadableStream({
193
+ start(controller) {
194
+ unwatch = _run.watch(({ type, payload, eventTimestamp }) => {
195
+ controller.enqueue(JSON.stringify({ type, payload, eventTimestamp, runId }));
196
+ if (asyncRef) {
197
+ clearImmediate(asyncRef);
198
+ asyncRef = null;
199
+ }
200
+ asyncRef = setImmediate(async () => {
201
+ const runDone = payload.workflowState.status !== "running";
202
+ if (runDone) {
203
+ controller.close();
204
+ }
205
+ });
206
+ });
207
+ },
208
+ cancel() {
209
+ unwatch?.();
210
+ }
211
+ });
212
+ return stream;
213
+ } catch (error) {
214
+ return chunkZLBRQFDD_cjs.handleError(error, "Error watching workflow");
215
+ }
216
+ }
217
+ async function resumeAsyncVNextWorkflowHandler({
218
+ mastra,
219
+ workflowId,
220
+ runId,
221
+ body,
222
+ runtimeContext
223
+ }) {
224
+ try {
225
+ if (!workflowId) {
226
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
227
+ }
228
+ if (!runId) {
229
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "runId required to resume workflow" });
230
+ }
231
+ if (!body.step) {
232
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "step required to resume workflow" });
233
+ }
234
+ const workflow = mastra.vnext_getWorkflow(workflowId);
235
+ const run = await workflow.getWorkflowRun(runId);
236
+ if (!run) {
237
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow run not found" });
238
+ }
239
+ const _run = workflow.createRun({ runId });
240
+ const result = await _run.resume({
241
+ step: body.step,
242
+ resumeData: body.resumeData,
243
+ runtimeContext
244
+ });
245
+ return result;
246
+ } catch (error) {
247
+ return chunkZLBRQFDD_cjs.handleError(error, "Error resuming workflow step");
248
+ }
249
+ }
250
+ async function resumeVNextWorkflowHandler({
251
+ mastra,
252
+ workflowId,
253
+ runId,
254
+ body,
255
+ runtimeContext
256
+ }) {
257
+ try {
258
+ if (!workflowId) {
259
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
260
+ }
261
+ if (!runId) {
262
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "runId required to resume workflow" });
263
+ }
264
+ if (!body.step) {
265
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "step required to resume workflow" });
266
+ }
267
+ const workflow = mastra.vnext_getWorkflow(workflowId);
268
+ const run = await workflow.getWorkflowRun(runId);
269
+ if (!run) {
270
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: "Workflow run not found" });
271
+ }
272
+ const _run = workflow.createRun({ runId });
273
+ await _run.resume({
274
+ step: body.step,
275
+ resumeData: body.resumeData,
276
+ runtimeContext
277
+ });
278
+ return { message: "Workflow run resumed" };
279
+ } catch (error) {
280
+ return chunkZLBRQFDD_cjs.handleError(error, "Error resuming workflow");
281
+ }
282
+ }
283
+ async function getVNextWorkflowRunsHandler({ mastra, workflowId }) {
284
+ try {
285
+ if (!workflowId) {
286
+ throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
287
+ }
288
+ const workflow = mastra.vnext_getWorkflow(workflowId);
289
+ const workflowRuns = await workflow.getWorkflowRuns() || {
290
+ runs: [],
291
+ total: 0
292
+ };
293
+ return workflowRuns;
294
+ } catch (error) {
295
+ return chunkZLBRQFDD_cjs.handleError(error, "Error getting workflow runs");
296
+ }
297
+ }
298
+
299
+ exports.createVNextWorkflowRunHandler = createVNextWorkflowRunHandler;
300
+ exports.getVNextWorkflowByIdHandler = getVNextWorkflowByIdHandler;
301
+ exports.getVNextWorkflowRunHandler = getVNextWorkflowRunHandler;
302
+ exports.getVNextWorkflowRunsHandler = getVNextWorkflowRunsHandler;
303
+ exports.getVNextWorkflowsHandler = getVNextWorkflowsHandler;
304
+ exports.resumeAsyncVNextWorkflowHandler = resumeAsyncVNextWorkflowHandler;
305
+ exports.resumeVNextWorkflowHandler = resumeVNextWorkflowHandler;
306
+ exports.startAsyncVNextWorkflowHandler = startAsyncVNextWorkflowHandler;
307
+ exports.startVNextWorkflowRunHandler = startVNextWorkflowRunHandler;
308
+ exports.vNextWorkflows_exports = vNextWorkflows_exports;
309
+ exports.watchVNextWorkflowHandler = watchVNextWorkflowHandler;
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var chunkZHNKYTNS_cjs = require('../../chunk-ZHNKYTNS.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "createVNextWorkflowRunHandler", {
8
+ enumerable: true,
9
+ get: function () { return chunkZHNKYTNS_cjs.createVNextWorkflowRunHandler; }
10
+ });
11
+ Object.defineProperty(exports, "getVNextWorkflowByIdHandler", {
12
+ enumerable: true,
13
+ get: function () { return chunkZHNKYTNS_cjs.getVNextWorkflowByIdHandler; }
14
+ });
15
+ Object.defineProperty(exports, "getVNextWorkflowRunHandler", {
16
+ enumerable: true,
17
+ get: function () { return chunkZHNKYTNS_cjs.getVNextWorkflowRunHandler; }
18
+ });
19
+ Object.defineProperty(exports, "getVNextWorkflowRunsHandler", {
20
+ enumerable: true,
21
+ get: function () { return chunkZHNKYTNS_cjs.getVNextWorkflowRunsHandler; }
22
+ });
23
+ Object.defineProperty(exports, "getVNextWorkflowsHandler", {
24
+ enumerable: true,
25
+ get: function () { return chunkZHNKYTNS_cjs.getVNextWorkflowsHandler; }
26
+ });
27
+ Object.defineProperty(exports, "resumeAsyncVNextWorkflowHandler", {
28
+ enumerable: true,
29
+ get: function () { return chunkZHNKYTNS_cjs.resumeAsyncVNextWorkflowHandler; }
30
+ });
31
+ Object.defineProperty(exports, "resumeVNextWorkflowHandler", {
32
+ enumerable: true,
33
+ get: function () { return chunkZHNKYTNS_cjs.resumeVNextWorkflowHandler; }
34
+ });
35
+ Object.defineProperty(exports, "startAsyncVNextWorkflowHandler", {
36
+ enumerable: true,
37
+ get: function () { return chunkZHNKYTNS_cjs.startAsyncVNextWorkflowHandler; }
38
+ });
39
+ Object.defineProperty(exports, "startVNextWorkflowRunHandler", {
40
+ enumerable: true,
41
+ get: function () { return chunkZHNKYTNS_cjs.startVNextWorkflowRunHandler; }
42
+ });
43
+ Object.defineProperty(exports, "watchVNextWorkflowHandler", {
44
+ enumerable: true,
45
+ get: function () { return chunkZHNKYTNS_cjs.watchVNextWorkflowHandler; }
46
+ });
@@ -0,0 +1,10 @@
1
+ export { getVNextWorkflowsHandler } from '../../_tsup-dts-rollup.cjs';
2
+ export { getVNextWorkflowByIdHandler } from '../../_tsup-dts-rollup.cjs';
3
+ export { getVNextWorkflowRunHandler } from '../../_tsup-dts-rollup.cjs';
4
+ export { createVNextWorkflowRunHandler } from '../../_tsup-dts-rollup.cjs';
5
+ export { startAsyncVNextWorkflowHandler } from '../../_tsup-dts-rollup.cjs';
6
+ export { startVNextWorkflowRunHandler } from '../../_tsup-dts-rollup.cjs';
7
+ export { watchVNextWorkflowHandler } from '../../_tsup-dts-rollup.cjs';
8
+ export { resumeAsyncVNextWorkflowHandler } from '../../_tsup-dts-rollup.cjs';
9
+ export { resumeVNextWorkflowHandler } from '../../_tsup-dts-rollup.cjs';
10
+ export { getVNextWorkflowRunsHandler } from '../../_tsup-dts-rollup.cjs';
@@ -0,0 +1,10 @@
1
+ export { getVNextWorkflowsHandler } from '../../_tsup-dts-rollup.js';
2
+ export { getVNextWorkflowByIdHandler } from '../../_tsup-dts-rollup.js';
3
+ export { getVNextWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
4
+ export { createVNextWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
5
+ export { startAsyncVNextWorkflowHandler } from '../../_tsup-dts-rollup.js';
6
+ export { startVNextWorkflowRunHandler } from '../../_tsup-dts-rollup.js';
7
+ export { watchVNextWorkflowHandler } from '../../_tsup-dts-rollup.js';
8
+ export { resumeAsyncVNextWorkflowHandler } from '../../_tsup-dts-rollup.js';
9
+ export { resumeVNextWorkflowHandler } from '../../_tsup-dts-rollup.js';
10
+ export { getVNextWorkflowRunsHandler } from '../../_tsup-dts-rollup.js';
@@ -0,0 +1 @@
1
+ export { createVNextWorkflowRunHandler, getVNextWorkflowByIdHandler, getVNextWorkflowRunHandler, getVNextWorkflowRunsHandler, getVNextWorkflowsHandler, resumeAsyncVNextWorkflowHandler, resumeVNextWorkflowHandler, startAsyncVNextWorkflowHandler, startVNextWorkflowRunHandler, watchVNextWorkflowHandler } from '../../chunk-B66WVPGJ.js';
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkCWUJ6DED_cjs = require('../../chunk-CWUJ6DED.cjs');
3
+ var chunk55HTWX4C_cjs = require('../../chunk-55HTWX4C.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "generateSpeechHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunkCWUJ6DED_cjs.generateSpeechHandler; }
9
+ get: function () { return chunk55HTWX4C_cjs.generateSpeechHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getSpeakersHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunkCWUJ6DED_cjs.getSpeakersHandler; }
13
+ get: function () { return chunk55HTWX4C_cjs.getSpeakersHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "transcribeSpeechHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunkCWUJ6DED_cjs.transcribeSpeechHandler; }
17
+ get: function () { return chunk55HTWX4C_cjs.transcribeSpeechHandler; }
18
18
  });
@@ -1 +1 @@
1
- export { generateSpeechHandler, getSpeakersHandler, transcribeSpeechHandler } from '../../chunk-YE2P6K2L.js';
1
+ export { generateSpeechHandler, getSpeakersHandler, transcribeSpeechHandler } from '../../chunk-Q6SHQECN.js';
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkD3G23FP3_cjs = require('../chunk-D3G23FP3.cjs');
4
+ var chunkZHNKYTNS_cjs = require('../chunk-ZHNKYTNS.cjs');
4
5
  var chunkM56ECCHK_cjs = require('../chunk-M56ECCHK.cjs');
5
- var chunkCWUJ6DED_cjs = require('../chunk-CWUJ6DED.cjs');
6
+ var chunk55HTWX4C_cjs = require('../chunk-55HTWX4C.cjs');
6
7
  var chunkTZK63M5N_cjs = require('../chunk-TZK63M5N.cjs');
7
8
  var chunkHCOPJZ4A_cjs = require('../chunk-HCOPJZ4A.cjs');
8
9
  var chunkSKBVVI24_cjs = require('../chunk-SKBVVI24.cjs');
@@ -16,13 +17,17 @@ Object.defineProperty(exports, "tools", {
16
17
  enumerable: true,
17
18
  get: function () { return chunkD3G23FP3_cjs.tools_exports; }
18
19
  });
20
+ Object.defineProperty(exports, "vNextWorkflows", {
21
+ enumerable: true,
22
+ get: function () { return chunkZHNKYTNS_cjs.vNextWorkflows_exports; }
23
+ });
19
24
  Object.defineProperty(exports, "vector", {
20
25
  enumerable: true,
21
26
  get: function () { return chunkM56ECCHK_cjs.vector_exports; }
22
27
  });
23
28
  Object.defineProperty(exports, "voice", {
24
29
  enumerable: true,
25
- get: function () { return chunkCWUJ6DED_cjs.voice_exports; }
30
+ get: function () { return chunk55HTWX4C_cjs.voice_exports; }
26
31
  });
27
32
  Object.defineProperty(exports, "workflows", {
28
33
  enumerable: true,
@@ -5,5 +5,6 @@ export { network } from '../_tsup-dts-rollup.cjs';
5
5
  export { telemetry } from '../_tsup-dts-rollup.cjs';
6
6
  export { tools } from '../_tsup-dts-rollup.cjs';
7
7
  export { workflows } from '../_tsup-dts-rollup.cjs';
8
+ export { vNextWorkflows } from '../_tsup-dts-rollup.cjs';
8
9
  export { vector } from '../_tsup-dts-rollup.cjs';
9
10
  export { voice } from '../_tsup-dts-rollup.cjs';
@@ -5,5 +5,6 @@ export { network } from '../_tsup-dts-rollup.js';
5
5
  export { telemetry } from '../_tsup-dts-rollup.js';
6
6
  export { tools } from '../_tsup-dts-rollup.js';
7
7
  export { workflows } from '../_tsup-dts-rollup.js';
8
+ export { vNextWorkflows } from '../_tsup-dts-rollup.js';
8
9
  export { vector } from '../_tsup-dts-rollup.js';
9
10
  export { voice } from '../_tsup-dts-rollup.js';
@@ -1,6 +1,7 @@
1
1
  export { tools_exports as tools } from '../chunk-5JNVY6DU.js';
2
+ export { vNextWorkflows_exports as vNextWorkflows } from '../chunk-B66WVPGJ.js';
2
3
  export { vector_exports as vector } from '../chunk-4JINXASC.js';
3
- export { voice_exports as voice } from '../chunk-YE2P6K2L.js';
4
+ export { voice_exports as voice } from '../chunk-Q6SHQECN.js';
4
5
  export { workflows_exports as workflows } from '../chunk-LFOBHRFO.js';
5
6
  export { agents_exports as agents } from '../chunk-R4J7XQYU.js';
6
7
  export { logs_exports as logs } from '../chunk-3EJZQ6TQ.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/server",
3
- "version": "2.0.0",
3
+ "version": "2.0.1-alpha.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -46,7 +46,7 @@
46
46
  "license": "Elastic-2.0",
47
47
  "dependencies": {},
48
48
  "peerDependencies": {
49
- "@mastra/core": "^0.9.0"
49
+ "@mastra/core": "^0.9.1-alpha.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@ai-sdk/openai": "^1.3.2",
@@ -58,8 +58,8 @@
58
58
  "typescript": "^5.8.2",
59
59
  "vitest": "^2.1.9",
60
60
  "zod-to-json-schema": "^3.24.3",
61
- "@mastra/core": "0.9.0",
62
- "@internal/lint": "0.0.2"
61
+ "@internal/lint": "0.0.2",
62
+ "@mastra/core": "0.9.1-alpha.1"
63
63
  },
64
64
  "scripts": {
65
65
  "build": "tsup src/index.ts src/server/handlers.ts src/server/handlers/*.ts !src/server/handlers/*.test.ts --format esm,cjs --clean --experimental-dts --treeshake=smallest --splitting",