@mastra/inngest 0.0.4-alpha.0 → 0.1.0-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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/inngest@0.0.4-alpha.0 build /home/runner/work/mastra/mastra/workflows/inngest
2
+ > @mastra/inngest@0.1.0-alpha.1 build /home/runner/work/mastra/mastra/workflows/inngest
3
3
  > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 7001ms
9
+ TSC ⚡️ Build success in 7157ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/workflows/inngest/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/workflows/inngest/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 6565ms
16
+ DTS ⚡️ Build success in 6033ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 22.03 KB
21
- ESM ⚡️ Build success in 407ms
22
- CJS dist/index.cjs 22.14 KB
23
- CJS ⚡️ Build success in 408ms
20
+ ESM dist/index.js 22.01 KB
21
+ ESM ⚡️ Build success in 304ms
22
+ CJS dist/index.cjs 22.15 KB
23
+ CJS ⚡️ Build success in 304ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @mastra/inngest
2
2
 
3
+ ## 0.1.0-alpha.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 83da932: Move @mastra/core to peerdeps
8
+
9
+ ### Patch Changes
10
+
11
+ - b3a3d63: BREAKING: Make vnext workflow the default worklow, and old workflow legacy_workflow
12
+ - Updated dependencies [b3a3d63]
13
+ - Updated dependencies [344f453]
14
+ - Updated dependencies [0a3ae6d]
15
+ - Updated dependencies [95911be]
16
+ - Updated dependencies [5eb5a99]
17
+ - Updated dependencies [7e632c5]
18
+ - Updated dependencies [1e9fbfa]
19
+ - Updated dependencies [b2ae5aa]
20
+ - Updated dependencies [a7292b0]
21
+ - Updated dependencies [0dcb9f0]
22
+ - @mastra/core@0.10.0-alpha.1
23
+
3
24
  ## 0.0.4-alpha.0
4
25
 
5
26
  ### Patch Changes
@@ -1,37 +1,37 @@
1
1
  import type { BaseContext } from 'inngest';
2
2
  import { ClientOptions } from 'inngest';
3
- import { cloneStep } from '@mastra/core/workflows/vNext';
4
- import { createStep } from '@mastra/core/workflows/vNext';
5
- import { DefaultExecutionEngine } from '@mastra/core/workflows/vNext';
6
- import type { ExecuteFunction } from '@mastra/core/workflows/vNext';
7
- import type { ExecutionContext } from '@mastra/core/workflows/vNext';
8
- import type { ExecutionEngine } from '@mastra/core/workflows/vNext';
9
- import type { ExecutionGraph } from '@mastra/core/workflows/vNext';
3
+ import { cloneStep } from '@mastra/core/workflows';
4
+ import { createStep } from '@mastra/core/workflows';
5
+ import { DefaultExecutionEngine } from '@mastra/core/workflows';
6
+ import type { ExecuteFunction } from '@mastra/core/workflows';
7
+ import type { ExecutionContext } from '@mastra/core/workflows';
8
+ import type { ExecutionEngine } from '@mastra/core/workflows';
9
+ import type { ExecutionGraph } from '@mastra/core/workflows';
10
10
  import { Handler } from 'inngest';
11
11
  import type { Inngest } from 'inngest';
12
12
  import { InngestFunction } from 'inngest';
13
13
  import { InngestMiddleware } from 'inngest';
14
14
  import type { Mastra } from '@mastra/core';
15
- import type { NewStep } from '@mastra/core/workflows/vNext';
16
- import { NewWorkflow } from '@mastra/core/workflows/vNext';
17
- import type { NewWorkflowConfig } from '@mastra/core/workflows/vNext';
18
- import { Run } from '@mastra/core/workflows/vNext';
15
+ import { Run } from '@mastra/core/workflows';
19
16
  import { RuntimeContext } from '@mastra/core/di';
20
17
  import { serve as serve_2 } from 'inngest/hono';
21
18
  import type { Span } from '@opentelemetry/api';
22
- import type { StepFlowEntry } from '@mastra/core/workflows/vNext';
23
- import type { StepResult } from '@mastra/core/workflows/vNext';
24
- import type { VNextWorkflowRun } from '@mastra/core';
25
- import type { VNextWorkflowRuns } from '@mastra/core';
26
- import type { WorkflowResult } from '@mastra/core/workflows/vNext';
19
+ import type { Step } from '@mastra/core/workflows';
20
+ import type { StepFlowEntry } from '@mastra/core/workflows';
21
+ import type { StepResult } from '@mastra/core/workflows';
22
+ import { Workflow } from '@mastra/core/workflows';
23
+ import type { WorkflowConfig } from '@mastra/core/workflows';
24
+ import type { WorkflowResult } from '@mastra/core/workflows';
25
+ import type { WorkflowRun } from '@mastra/core';
26
+ import type { WorkflowRuns } from '@mastra/core';
27
27
  import type { z } from 'zod';
28
28
 
29
- declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends NewStep<string, any, any, any, any>[] = NewStep<string, any, any, any, any>[]>(workflow: InngestWorkflow<TSteps, string, TInput, TOutput>, opts: {
29
+ declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[]>(workflow: InngestWorkflow<TSteps, string, TInput, TOutput>, opts: {
30
30
  id: TWorkflowId;
31
31
  }): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput>;
32
32
 
33
33
  export declare function init(inngest: Inngest): {
34
- createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>[]>(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
34
+ createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any>[] = Step<string, any, any, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
35
35
  createStep: typeof createStep;
36
36
  cloneStep: typeof cloneStep;
37
37
  cloneWorkflow: typeof cloneWorkflow;
@@ -47,7 +47,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
47
47
  superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
48
48
  workflowId: string;
49
49
  runId: string;
50
- step: NewStep<string, any, any>;
50
+ step: Step<string, any, any>;
51
51
  stepResults: Record<string, StepResult<any>>;
52
52
  executionContext: ExecutionContext;
53
53
  resume?: {
@@ -61,7 +61,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
61
61
  runtimeContext: RuntimeContext;
62
62
  }): Promise<StepResult<any>>;
63
63
  executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
64
- step: NewStep<string, any, any>;
64
+ step: Step<string, any, any>;
65
65
  stepResults: Record<string, StepResult<any>>;
66
66
  executionContext: {
67
67
  workflowId: string;
@@ -115,7 +115,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
115
115
  }): Promise<StepResult<any>>;
116
116
  }
117
117
 
118
- export declare class InngestRun<TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TSteps, TInput, TOutput> {
118
+ export declare class InngestRun<TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TSteps, TInput, TOutput> {
119
119
  #private;
120
120
  private inngest;
121
121
  constructor(params: {
@@ -138,25 +138,25 @@ export declare class InngestRun<TSteps extends NewStep<string, any, any>[] = New
138
138
  }): Promise<WorkflowResult<TOutput, TSteps>>;
139
139
  resume<TResumeSchema extends z.ZodType<any>>(params: {
140
140
  resumeData?: z.infer<TResumeSchema>;
141
- step: NewStep<string, any, any, TResumeSchema, any> | [...NewStep<string, any, any, any, any>[], NewStep<string, any, any, TResumeSchema, any>] | string | string[];
141
+ step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
142
142
  runtimeContext?: RuntimeContext;
143
143
  }): Promise<WorkflowResult<TOutput, TSteps>>;
144
144
  watch(cb: (event: any) => void): () => void;
145
145
  }
146
146
 
147
- export declare class InngestWorkflow<TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends NewWorkflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
147
+ export declare class InngestWorkflow<TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
148
148
  #private;
149
149
  inngest: Inngest;
150
150
  private function;
151
- constructor(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
151
+ constructor(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
152
152
  getWorkflowRuns(args?: {
153
153
  fromDate?: Date;
154
154
  toDate?: Date;
155
155
  limit?: number;
156
156
  offset?: number;
157
157
  resourceId?: string;
158
- }): Promise<VNextWorkflowRuns>;
159
- getWorkflowRunById(runId: string): Promise<VNextWorkflowRun | null>;
158
+ }): Promise<WorkflowRuns>;
159
+ getWorkflowRunById(runId: string): Promise<WorkflowRun | null>;
160
160
  __registerMastra(mastra: Mastra): void;
161
161
  createRun(options?: {
162
162
  runId?: string;
@@ -1,37 +1,37 @@
1
1
  import type { BaseContext } from 'inngest';
2
2
  import { ClientOptions } from 'inngest';
3
- import { cloneStep } from '@mastra/core/workflows/vNext';
4
- import { createStep } from '@mastra/core/workflows/vNext';
5
- import { DefaultExecutionEngine } from '@mastra/core/workflows/vNext';
6
- import type { ExecuteFunction } from '@mastra/core/workflows/vNext';
7
- import type { ExecutionContext } from '@mastra/core/workflows/vNext';
8
- import type { ExecutionEngine } from '@mastra/core/workflows/vNext';
9
- import type { ExecutionGraph } from '@mastra/core/workflows/vNext';
3
+ import { cloneStep } from '@mastra/core/workflows';
4
+ import { createStep } from '@mastra/core/workflows';
5
+ import { DefaultExecutionEngine } from '@mastra/core/workflows';
6
+ import type { ExecuteFunction } from '@mastra/core/workflows';
7
+ import type { ExecutionContext } from '@mastra/core/workflows';
8
+ import type { ExecutionEngine } from '@mastra/core/workflows';
9
+ import type { ExecutionGraph } from '@mastra/core/workflows';
10
10
  import { Handler } from 'inngest';
11
11
  import type { Inngest } from 'inngest';
12
12
  import { InngestFunction } from 'inngest';
13
13
  import { InngestMiddleware } from 'inngest';
14
14
  import type { Mastra } from '@mastra/core';
15
- import type { NewStep } from '@mastra/core/workflows/vNext';
16
- import { NewWorkflow } from '@mastra/core/workflows/vNext';
17
- import type { NewWorkflowConfig } from '@mastra/core/workflows/vNext';
18
- import { Run } from '@mastra/core/workflows/vNext';
15
+ import { Run } from '@mastra/core/workflows';
19
16
  import { RuntimeContext } from '@mastra/core/di';
20
17
  import { serve as serve_2 } from 'inngest/hono';
21
18
  import type { Span } from '@opentelemetry/api';
22
- import type { StepFlowEntry } from '@mastra/core/workflows/vNext';
23
- import type { StepResult } from '@mastra/core/workflows/vNext';
24
- import type { VNextWorkflowRun } from '@mastra/core';
25
- import type { VNextWorkflowRuns } from '@mastra/core';
26
- import type { WorkflowResult } from '@mastra/core/workflows/vNext';
19
+ import type { Step } from '@mastra/core/workflows';
20
+ import type { StepFlowEntry } from '@mastra/core/workflows';
21
+ import type { StepResult } from '@mastra/core/workflows';
22
+ import { Workflow } from '@mastra/core/workflows';
23
+ import type { WorkflowConfig } from '@mastra/core/workflows';
24
+ import type { WorkflowResult } from '@mastra/core/workflows';
25
+ import type { WorkflowRun } from '@mastra/core';
26
+ import type { WorkflowRuns } from '@mastra/core';
27
27
  import type { z } from 'zod';
28
28
 
29
- declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends NewStep<string, any, any, any, any>[] = NewStep<string, any, any, any, any>[]>(workflow: InngestWorkflow<TSteps, string, TInput, TOutput>, opts: {
29
+ declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[]>(workflow: InngestWorkflow<TSteps, string, TInput, TOutput>, opts: {
30
30
  id: TWorkflowId;
31
31
  }): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput>;
32
32
 
33
33
  export declare function init(inngest: Inngest): {
34
- createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>[]>(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
34
+ createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any>[] = Step<string, any, any, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
35
35
  createStep: typeof createStep;
36
36
  cloneStep: typeof cloneStep;
37
37
  cloneWorkflow: typeof cloneWorkflow;
@@ -47,7 +47,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
47
47
  superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
48
48
  workflowId: string;
49
49
  runId: string;
50
- step: NewStep<string, any, any>;
50
+ step: Step<string, any, any>;
51
51
  stepResults: Record<string, StepResult<any>>;
52
52
  executionContext: ExecutionContext;
53
53
  resume?: {
@@ -61,7 +61,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
61
61
  runtimeContext: RuntimeContext;
62
62
  }): Promise<StepResult<any>>;
63
63
  executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
64
- step: NewStep<string, any, any>;
64
+ step: Step<string, any, any>;
65
65
  stepResults: Record<string, StepResult<any>>;
66
66
  executionContext: {
67
67
  workflowId: string;
@@ -115,7 +115,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
115
115
  }): Promise<StepResult<any>>;
116
116
  }
117
117
 
118
- export declare class InngestRun<TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TSteps, TInput, TOutput> {
118
+ export declare class InngestRun<TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>> extends Run<TSteps, TInput, TOutput> {
119
119
  #private;
120
120
  private inngest;
121
121
  constructor(params: {
@@ -138,25 +138,25 @@ export declare class InngestRun<TSteps extends NewStep<string, any, any>[] = New
138
138
  }): Promise<WorkflowResult<TOutput, TSteps>>;
139
139
  resume<TResumeSchema extends z.ZodType<any>>(params: {
140
140
  resumeData?: z.infer<TResumeSchema>;
141
- step: NewStep<string, any, any, TResumeSchema, any> | [...NewStep<string, any, any, any, any>[], NewStep<string, any, any, TResumeSchema, any>] | string | string[];
141
+ step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
142
142
  runtimeContext?: RuntimeContext;
143
143
  }): Promise<WorkflowResult<TOutput, TSteps>>;
144
144
  watch(cb: (event: any) => void): () => void;
145
145
  }
146
146
 
147
- export declare class InngestWorkflow<TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends NewWorkflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
147
+ export declare class InngestWorkflow<TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
148
148
  #private;
149
149
  inngest: Inngest;
150
150
  private function;
151
- constructor(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
151
+ constructor(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
152
152
  getWorkflowRuns(args?: {
153
153
  fromDate?: Date;
154
154
  toDate?: Date;
155
155
  limit?: number;
156
156
  offset?: number;
157
157
  resourceId?: string;
158
- }): Promise<VNextWorkflowRuns>;
159
- getWorkflowRunById(runId: string): Promise<VNextWorkflowRun | null>;
158
+ }): Promise<WorkflowRuns>;
159
+ getWorkflowRunById(runId: string): Promise<WorkflowRun | null>;
160
160
  __registerMastra(mastra: Mastra): void;
161
161
  createRun(options?: {
162
162
  runId?: string;
package/dist/index.cjs CHANGED
@@ -3,12 +3,12 @@
3
3
  var crypto = require('crypto');
4
4
  var realtime = require('@inngest/realtime');
5
5
  var di = require('@mastra/core/di');
6
- var vNext = require('@mastra/core/workflows/vNext');
6
+ var workflows = require('@mastra/core/workflows');
7
7
  var hono = require('inngest/hono');
8
8
 
9
9
  // src/index.ts
10
10
  function serve({ mastra, inngest }) {
11
- const wfs = mastra.vnext_getWorkflows();
11
+ const wfs = mastra.getWorkflows();
12
12
  const functions = Object.values(wfs).flatMap((wf) => {
13
13
  if (wf instanceof InngestWorkflow) {
14
14
  wf.__registerMastra(mastra);
@@ -21,7 +21,7 @@ function serve({ mastra, inngest }) {
21
21
  functions
22
22
  });
23
23
  }
24
- var InngestRun = class extends vNext.Run {
24
+ var InngestRun = class extends workflows.Run {
25
25
  inngest;
26
26
  #mastra;
27
27
  constructor(params, inngest) {
@@ -137,7 +137,7 @@ var InngestRun = class extends vNext.Run {
137
137
  };
138
138
  }
139
139
  };
140
- var InngestWorkflow = class _InngestWorkflow extends vNext.NewWorkflow {
140
+ var InngestWorkflow = class _InngestWorkflow extends workflows.Workflow {
141
141
  #mastra;
142
142
  inngest;
143
143
  function;
@@ -283,12 +283,12 @@ function init(inngest) {
283
283
  createWorkflow(params) {
284
284
  return new InngestWorkflow(params, inngest);
285
285
  },
286
- createStep: vNext.createStep,
287
- cloneStep: vNext.cloneStep,
286
+ createStep: workflows.createStep,
287
+ cloneStep: workflows.cloneStep,
288
288
  cloneWorkflow
289
289
  };
290
290
  }
291
- var InngestExecutionEngine = class extends vNext.DefaultExecutionEngine {
291
+ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
292
292
  inngestStep;
293
293
  inngestAttempts;
294
294
  constructor(mastra, inngestStep, inngestAttempts = 0) {
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { randomUUID } from 'crypto';
2
2
  import { subscribe } from '@inngest/realtime';
3
3
  import { RuntimeContext } from '@mastra/core/di';
4
- import { Run, NewWorkflow, cloneStep, createStep, DefaultExecutionEngine } from '@mastra/core/workflows/vNext';
4
+ import { Run, Workflow, cloneStep, createStep, DefaultExecutionEngine } from '@mastra/core/workflows';
5
5
  import { serve as serve$1 } from 'inngest/hono';
6
6
 
7
7
  // src/index.ts
8
8
  function serve({ mastra, inngest }) {
9
- const wfs = mastra.vnext_getWorkflows();
9
+ const wfs = mastra.getWorkflows();
10
10
  const functions = Object.values(wfs).flatMap((wf) => {
11
11
  if (wf instanceof InngestWorkflow) {
12
12
  wf.__registerMastra(mastra);
@@ -135,7 +135,7 @@ var InngestRun = class extends Run {
135
135
  };
136
136
  }
137
137
  };
138
- var InngestWorkflow = class _InngestWorkflow extends NewWorkflow {
138
+ var InngestWorkflow = class _InngestWorkflow extends Workflow {
139
139
  #mastra;
140
140
  inngest;
141
141
  function;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/inngest",
3
- "version": "0.0.4-alpha.0",
3
+ "version": "0.1.0-alpha.1",
4
4
  "description": "Mastra Inngest integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,8 +22,7 @@
22
22
  "@inngest/realtime": "^0.3.1",
23
23
  "inngest": "^3.35.1",
24
24
  "zod": "^3.24.2",
25
- "@opentelemetry/api": "^1.9.0",
26
- "@mastra/core": "^0.9.5-alpha.0"
25
+ "@opentelemetry/api": "^1.9.0"
27
26
  },
28
27
  "devDependencies": {
29
28
  "@ai-sdk/openai": "^1.3.22",
@@ -38,8 +37,12 @@
38
37
  "tsup": "^8.4.0",
39
38
  "typescript": "^5.8.2",
40
39
  "vitest": "^2.1.9",
40
+ "@mastra/deployer": "0.4.0-alpha.1",
41
41
  "@internal/lint": "0.0.5",
42
- "@mastra/deployer": "0.3.5-alpha.0"
42
+ "@mastra/core": "0.10.0-alpha.1"
43
+ },
44
+ "peerDependencies": {
45
+ "@mastra/core": "^0.9.4"
43
46
  },
44
47
  "scripts": {
45
48
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
package/src/index.ts CHANGED
@@ -1,27 +1,26 @@
1
1
  import { randomUUID } from 'crypto';
2
2
  import { subscribe } from '@inngest/realtime';
3
- import type { Mastra, VNextWorkflowRun, VNextWorkflowRuns } from '@mastra/core';
3
+ import type { Mastra, WorkflowRun, WorkflowRuns } from '@mastra/core';
4
4
  import { RuntimeContext } from '@mastra/core/di';
5
- import { NewWorkflow, createStep, Run, DefaultExecutionEngine, cloneStep } from '@mastra/core/workflows/vNext';
5
+ import { Workflow, createStep, Run, DefaultExecutionEngine, cloneStep } from '@mastra/core/workflows';
6
6
  import type {
7
7
  ExecuteFunction,
8
8
  ExecutionContext,
9
9
  ExecutionEngine,
10
10
  ExecutionGraph,
11
- NewStep,
12
- NewStep as Step,
13
- NewWorkflowConfig,
11
+ Step,
12
+ WorkflowConfig,
14
13
  StepFlowEntry,
15
14
  StepResult,
16
15
  WorkflowResult,
17
- } from '@mastra/core/workflows/vNext';
16
+ } from '@mastra/core/workflows';
18
17
  import type { Span } from '@opentelemetry/api';
19
18
  import type { Inngest, BaseContext } from 'inngest';
20
19
  import { serve as inngestServe } from 'inngest/hono';
21
20
  import type { z } from 'zod';
22
21
 
23
22
  export function serve({ mastra, inngest }: { mastra: Mastra; inngest: Inngest }): ReturnType<typeof inngestServe> {
24
- const wfs = mastra.vnext_getWorkflows();
23
+ const wfs = mastra.getWorkflows();
25
24
  const functions = Object.values(wfs).flatMap(wf => {
26
25
  if (wf instanceof InngestWorkflow) {
27
26
  wf.__registerMastra(mastra);
@@ -36,7 +35,7 @@ export function serve({ mastra, inngest }: { mastra: Mastra; inngest: Inngest })
36
35
  }
37
36
 
38
37
  export class InngestRun<
39
- TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[],
38
+ TSteps extends Step<string, any, any>[] = Step<string, any, any>[],
40
39
  TInput extends z.ZodType<any> = z.ZodType<any>,
41
40
  TOutput extends z.ZodType<any> = z.ZodType<any>,
42
41
  > extends Run<TSteps, TInput, TOutput> {
@@ -196,18 +195,18 @@ export class InngestRun<
196
195
  }
197
196
 
198
197
  export class InngestWorkflow<
199
- TSteps extends NewStep<string, any, any>[] = NewStep<string, any, any>[],
198
+ TSteps extends Step<string, any, any>[] = Step<string, any, any>[],
200
199
  TWorkflowId extends string = string,
201
200
  TInput extends z.ZodType<any> = z.ZodType<any>,
202
201
  TOutput extends z.ZodType<any> = z.ZodType<any>,
203
202
  TPrevSchema extends z.ZodType<any> = TInput,
204
- > extends NewWorkflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
203
+ > extends Workflow<TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
205
204
  #mastra: Mastra;
206
205
  public inngest: Inngest;
207
206
 
208
207
  private function: ReturnType<Inngest['createFunction']> | undefined;
209
208
 
210
- constructor(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest) {
209
+ constructor(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest) {
211
210
  super(params);
212
211
  this.#mastra = params.mastra!;
213
212
  this.inngest = inngest;
@@ -226,22 +225,20 @@ export class InngestWorkflow<
226
225
  return { runs: [], total: 0 };
227
226
  }
228
227
 
229
- return storage.getWorkflowRuns({ workflowName: this.id, ...(args ?? {}) }) as unknown as VNextWorkflowRuns;
228
+ return storage.getWorkflowRuns({ workflowName: this.id, ...(args ?? {}) }) as unknown as WorkflowRuns;
230
229
  }
231
230
 
232
- async getWorkflowRunById(runId: string): Promise<VNextWorkflowRun | null> {
231
+ async getWorkflowRunById(runId: string): Promise<WorkflowRun | null> {
233
232
  const storage = this.#mastra?.getStorage();
234
233
  if (!storage) {
235
234
  this.logger.debug('Cannot get workflow runs. Mastra engine is not initialized');
236
235
  return null;
237
236
  }
238
- const run = (await storage.getWorkflowRunById({ runId, workflowName: this.id })) as unknown as VNextWorkflowRun;
237
+ const run = (await storage.getWorkflowRunById({ runId, workflowName: this.id })) as unknown as WorkflowRun;
239
238
 
240
239
  return (
241
240
  run ??
242
- (this.runs.get(runId)
243
- ? ({ ...this.runs.get(runId), workflowName: this.id } as unknown as VNextWorkflowRun)
244
- : null)
241
+ (this.runs.get(runId) ? ({ ...this.runs.get(runId), workflowName: this.id } as unknown as WorkflowRun) : null)
245
242
  );
246
243
  }
247
244
 
@@ -396,7 +393,7 @@ export function init(inngest: Inngest) {
396
393
  TInput extends z.ZodType<any> = z.ZodType<any>,
397
394
  TOutput extends z.ZodType<any> = z.ZodType<any>,
398
395
  TSteps extends Step<string, any, any>[] = Step<string, any, any>[],
399
- >(params: NewWorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>) {
396
+ >(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>) {
400
397
  return new InngestWorkflow(params, inngest);
401
398
  },
402
399
  createStep,