@mastra/inngest 0.0.0-taofeeqInngest-20250603090617 → 0.0.0-testing-cloud-studios-20260114234039
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.
- package/CHANGELOG.md +2500 -2
- package/LICENSE.md +11 -42
- package/dist/execution-engine.d.ts +121 -0
- package/dist/execution-engine.d.ts.map +1 -0
- package/dist/index.cjs +1422 -565
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +57 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1418 -564
- package/dist/index.js.map +1 -0
- package/dist/pubsub.d.ts +56 -0
- package/dist/pubsub.d.ts.map +1 -0
- package/dist/run.d.ts +164 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/serve.d.ts +13 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/workflow.d.ts +53 -0
- package/dist/workflow.d.ts.map +1 -0
- package/package.json +43 -23
- package/dist/_tsup-dts-rollup.d.cts +0 -199
- package/dist/_tsup-dts-rollup.d.ts +0 -199
- package/dist/index.d.cts +0 -5
- package/docker-compose.yaml +0 -10
- package/eslint.config.js +0 -6
- package/src/index.test.ts +0 -5430
- package/src/index.ts +0 -971
- package/tsconfig.json +0 -5
- package/vitest.config.ts +0 -8
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Mastra } from '@mastra/core/mastra';
|
|
2
|
+
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
3
|
+
import { Workflow } from '@mastra/core/workflows';
|
|
4
|
+
import type { Step, StepFlowEntry, Run } from '@mastra/core/workflows';
|
|
5
|
+
import type { Inngest } from 'inngest';
|
|
6
|
+
import type { z } from 'zod';
|
|
7
|
+
import type { InngestEngineType, InngestWorkflowConfig } from './types.js';
|
|
8
|
+
export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TState extends z.ZodObject<any> = z.ZodObject<any>, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TEngineType, TSteps, TWorkflowId, TState, TInput, TOutput, TPrevSchema> {
|
|
9
|
+
#private;
|
|
10
|
+
inngest: Inngest;
|
|
11
|
+
private function;
|
|
12
|
+
private cronFunction;
|
|
13
|
+
private readonly flowControlConfig?;
|
|
14
|
+
private readonly cronConfig?;
|
|
15
|
+
constructor(params: InngestWorkflowConfig<TWorkflowId, TState, TInput, TOutput, TSteps>, inngest: Inngest);
|
|
16
|
+
listWorkflowRuns(args?: {
|
|
17
|
+
fromDate?: Date;
|
|
18
|
+
toDate?: Date;
|
|
19
|
+
perPage?: number | false;
|
|
20
|
+
page?: number;
|
|
21
|
+
resourceId?: string;
|
|
22
|
+
}): Promise<WorkflowRuns>;
|
|
23
|
+
__registerMastra(mastra: Mastra): void;
|
|
24
|
+
createRun(options?: {
|
|
25
|
+
runId?: string;
|
|
26
|
+
resourceId?: string;
|
|
27
|
+
}): Promise<Run<TEngineType, TSteps, TState, TInput, TOutput>>;
|
|
28
|
+
private createCronFunction;
|
|
29
|
+
getFunction(): import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, import("inngest").InngestFunction.Trigger<string>[] | [{
|
|
30
|
+
cron: string;
|
|
31
|
+
} & Partial<Record<"event" | "if", never>>] | [{
|
|
32
|
+
event: string;
|
|
33
|
+
if?: string;
|
|
34
|
+
} & Partial<Record<"cron", never>>], import("inngest").Handler.Any>, "triggers">, import("inngest").Handler.Any, import("inngest").Handler.Any, Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, import("inngest").InngestFunction.Trigger<string>[] | [{
|
|
35
|
+
cron: string;
|
|
36
|
+
} & Partial<Record<"event" | "if", never>>] | [{
|
|
37
|
+
event: string;
|
|
38
|
+
if?: string;
|
|
39
|
+
} & Partial<Record<"cron", never>>]>;
|
|
40
|
+
getNestedFunctions(steps: StepFlowEntry[]): ReturnType<Inngest['createFunction']>[];
|
|
41
|
+
getFunctions(): import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, import("inngest").InngestFunction.Trigger<string>[] | [{
|
|
42
|
+
cron: string;
|
|
43
|
+
} & Partial<Record<"event" | "if", never>>] | [{
|
|
44
|
+
event: string;
|
|
45
|
+
if?: string;
|
|
46
|
+
} & Partial<Record<"cron", never>>], import("inngest").Handler.Any>, "triggers">, import("inngest").Handler.Any, import("inngest").Handler.Any, Inngest<import("inngest").ClientOptions>, import("inngest").InngestMiddleware.Stack, import("inngest").InngestFunction.Trigger<string>[] | [{
|
|
47
|
+
cron: string;
|
|
48
|
+
} & Partial<Record<"event" | "if", never>>] | [{
|
|
49
|
+
event: string;
|
|
50
|
+
if?: string;
|
|
51
|
+
} & Partial<Record<"cron", never>>]>[];
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EACV,IAAI,EAEJ,aAAa,EAGb,GAAG,EACJ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,OAAO,KAAK,EACV,iBAAiB,EAGjB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,qBAAa,eAAe,CAC1B,WAAW,GAAG,iBAAiB,EAC/B,MAAM,SAAS,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EAClE,WAAW,SAAS,MAAM,GAAG,MAAM,EACnC,MAAM,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAClD,MAAM,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAC9C,OAAO,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAC/C,WAAW,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAC3C,SAAQ,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC;;IAEjF,OAAO,EAAE,OAAO,CAAC;IAExB,OAAO,CAAC,QAAQ,CAAoD;IACpE,OAAO,CAAC,YAAY,CAAoD;IACxE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAA2B;IAC9D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAwC;gBAExD,MAAM,EAAE,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO;IAsBnG,gBAAgB,CAAC,IAAI,CAAC,EAAE;QAC5B,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,MAAM,CAAC,EAAE,IAAI,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;IAcD,gBAAgB,CAAC,MAAM,EAAE,MAAM;IAwBzB,SAAS,CAAC,OAAO,CAAC,EAAE;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAkE9D,OAAO,CAAC,kBAAkB;IAwB1B,WAAW;;;;;;;;;;;IA2GX,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE;IAenF,YAAY;;;;;;;;;;;CAOb"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/inngest",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-testing-cloud-studios-20260114234039",
|
|
4
4
|
"description": "Mastra Inngest integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"CHANGELOG.md"
|
|
11
|
+
],
|
|
8
12
|
"exports": {
|
|
9
13
|
".": {
|
|
10
14
|
"import": {
|
|
@@ -12,42 +16,58 @@
|
|
|
12
16
|
"default": "./dist/index.js"
|
|
13
17
|
},
|
|
14
18
|
"require": {
|
|
15
|
-
"types": "./dist/index.d.
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
16
20
|
"default": "./dist/index.cjs"
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
"./package.json": "./package.json"
|
|
20
24
|
},
|
|
21
25
|
"dependencies": {
|
|
22
|
-
"@inngest/realtime": "^0.
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"@opentelemetry/api": "^1.9.0"
|
|
26
|
+
"@inngest/realtime": "^0.4.5",
|
|
27
|
+
"@opentelemetry/api": "^1.9.0",
|
|
28
|
+
"inngest": "^3.44.3"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
|
-
"@ai-sdk/openai": "^1.3.
|
|
29
|
-
"@hono/node-server": "^1.
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
31
|
+
"@ai-sdk/openai": "^1.3.24",
|
|
32
|
+
"@hono/node-server": "^1.19.6",
|
|
33
|
+
"@types/node": "22.13.17",
|
|
34
|
+
"@vitest/coverage-v8": "4.0.12",
|
|
35
|
+
"@vitest/ui": "4.0.12",
|
|
36
|
+
"ai": "^4.3.19",
|
|
37
|
+
"eslint": "^9.37.0",
|
|
38
|
+
"execa": "^9.6.0",
|
|
35
39
|
"get-port": "7.1.0",
|
|
36
|
-
"hono": "^4.
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"@internal/lint": "0.0.0-
|
|
42
|
-
"@
|
|
40
|
+
"hono": "^4.11.3",
|
|
41
|
+
"inngest-cli": "^1.12.1",
|
|
42
|
+
"tsup": "^8.5.0",
|
|
43
|
+
"typescript": "^5.9.3",
|
|
44
|
+
"vitest": "4.0.16",
|
|
45
|
+
"@internal/lint": "0.0.0-testing-cloud-studios-20260114234039",
|
|
46
|
+
"@internal/types-builder": "0.0.0-testing-cloud-studios-20260114234039",
|
|
47
|
+
"@mastra/core": "0.0.0-testing-cloud-studios-20260114234039",
|
|
48
|
+
"@mastra/deployer": "0.0.0-testing-cloud-studios-20260114234039",
|
|
49
|
+
"@mastra/libsql": "0.0.0-testing-cloud-studios-20260114234039"
|
|
43
50
|
},
|
|
44
51
|
"peerDependencies": {
|
|
45
|
-
"
|
|
52
|
+
"zod": "^3.25.0 || ^4.0.0",
|
|
53
|
+
"@mastra/core": "0.0.0-testing-cloud-studios-20260114234039"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://mastra.ai",
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/mastra-ai/mastra.git",
|
|
59
|
+
"directory": "workflows/inngest"
|
|
60
|
+
},
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
63
|
+
},
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=22.13.0"
|
|
46
66
|
},
|
|
47
67
|
"scripts": {
|
|
48
|
-
"build": "tsup
|
|
68
|
+
"build": "tsup --silent --config tsup.config.ts",
|
|
49
69
|
"build:watch": "pnpm build --watch",
|
|
50
|
-
"test": "vitest run",
|
|
70
|
+
"test": "docker-compose up -d && vitest run --no-isolate --retry=1 && docker-compose down",
|
|
51
71
|
"lint": "eslint ."
|
|
52
72
|
}
|
|
53
73
|
}
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import type { BaseContext } from 'inngest';
|
|
2
|
-
import { ClientOptions } from 'inngest';
|
|
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
|
-
import { Handler } from 'inngest';
|
|
11
|
-
import type { Inngest } from 'inngest';
|
|
12
|
-
import { InngestFunction } from 'inngest';
|
|
13
|
-
import { InngestMiddleware } from 'inngest';
|
|
14
|
-
import type { Mastra } from '@mastra/core';
|
|
15
|
-
import { Run } from '@mastra/core/workflows';
|
|
16
|
-
import { RuntimeContext } from '@mastra/core/di';
|
|
17
|
-
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
18
|
-
import { serve as serve_2 } from 'inngest/hono';
|
|
19
|
-
import type { Span } from '@opentelemetry/api';
|
|
20
|
-
import type { Step } from '@mastra/core/workflows';
|
|
21
|
-
import type { StepFlowEntry } from '@mastra/core/workflows';
|
|
22
|
-
import type { StepResult } from '@mastra/core/workflows';
|
|
23
|
-
import { Workflow } from '@mastra/core/workflows';
|
|
24
|
-
import type { WorkflowConfig } from '@mastra/core/workflows';
|
|
25
|
-
import type { WorkflowResult } from '@mastra/core/workflows';
|
|
26
|
-
import type { WorkflowRun } from '@mastra/core';
|
|
27
|
-
import type { WorkflowRuns } from '@mastra/core';
|
|
28
|
-
import type { z } from 'zod';
|
|
29
|
-
|
|
30
|
-
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: {
|
|
31
|
-
id: TWorkflowId;
|
|
32
|
-
}): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput>;
|
|
33
|
-
|
|
34
|
-
export declare function init(inngest: Inngest): {
|
|
35
|
-
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>;
|
|
36
|
-
createStep: typeof createStep;
|
|
37
|
-
cloneStep: typeof cloneStep;
|
|
38
|
-
cloneWorkflow: typeof cloneWorkflow;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
42
|
-
private inngestStep;
|
|
43
|
-
private inngestAttempts;
|
|
44
|
-
constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
|
|
45
|
-
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: {
|
|
46
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
47
|
-
}, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
48
|
-
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
49
|
-
workflowId: string;
|
|
50
|
-
runId: string;
|
|
51
|
-
step: Step<string, any, any>;
|
|
52
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
53
|
-
executionContext: ExecutionContext;
|
|
54
|
-
resume?: {
|
|
55
|
-
steps: string[];
|
|
56
|
-
resumePayload: any;
|
|
57
|
-
};
|
|
58
|
-
prevOutput: any;
|
|
59
|
-
emitter: {
|
|
60
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
61
|
-
};
|
|
62
|
-
runtimeContext: RuntimeContext;
|
|
63
|
-
}): Promise<StepResult<any, any, any, any>>;
|
|
64
|
-
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
65
|
-
step: Step<string, any, any>;
|
|
66
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
67
|
-
executionContext: {
|
|
68
|
-
workflowId: string;
|
|
69
|
-
runId: string;
|
|
70
|
-
executionPath: number[];
|
|
71
|
-
suspendedPaths: Record<string, number[]>;
|
|
72
|
-
retryConfig: {
|
|
73
|
-
attempts: number;
|
|
74
|
-
delay: number;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
resume?: {
|
|
78
|
-
steps: string[];
|
|
79
|
-
resumePayload: any;
|
|
80
|
-
runId?: string;
|
|
81
|
-
};
|
|
82
|
-
prevOutput: any;
|
|
83
|
-
emitter: {
|
|
84
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
85
|
-
};
|
|
86
|
-
runtimeContext: RuntimeContext;
|
|
87
|
-
}): Promise<StepResult<any, any, any, any>>;
|
|
88
|
-
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, }: {
|
|
89
|
-
workflowId: string;
|
|
90
|
-
runId: string;
|
|
91
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
92
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
93
|
-
executionContext: ExecutionContext;
|
|
94
|
-
}): Promise<void>;
|
|
95
|
-
executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, runtimeContext, }: {
|
|
96
|
-
workflowId: string;
|
|
97
|
-
runId: string;
|
|
98
|
-
entry: {
|
|
99
|
-
type: 'conditional';
|
|
100
|
-
steps: StepFlowEntry[];
|
|
101
|
-
conditions: ExecuteFunction<any, any, any, any>[];
|
|
102
|
-
};
|
|
103
|
-
prevStep: StepFlowEntry;
|
|
104
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
105
|
-
prevOutput: any;
|
|
106
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
107
|
-
resume?: {
|
|
108
|
-
steps: string[];
|
|
109
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
110
|
-
resumePayload: any;
|
|
111
|
-
resumePath: number[];
|
|
112
|
-
};
|
|
113
|
-
executionContext: ExecutionContext;
|
|
114
|
-
emitter: {
|
|
115
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
116
|
-
};
|
|
117
|
-
runtimeContext: RuntimeContext;
|
|
118
|
-
}): Promise<StepResult<any, any, any, any>>;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
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> {
|
|
122
|
-
#private;
|
|
123
|
-
private inngest;
|
|
124
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
125
|
-
constructor(params: {
|
|
126
|
-
workflowId: string;
|
|
127
|
-
runId: string;
|
|
128
|
-
executionEngine: ExecutionEngine;
|
|
129
|
-
executionGraph: ExecutionGraph;
|
|
130
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
131
|
-
mastra?: Mastra;
|
|
132
|
-
retryConfig?: {
|
|
133
|
-
attempts?: number;
|
|
134
|
-
delay?: number;
|
|
135
|
-
};
|
|
136
|
-
cleanup?: () => void;
|
|
137
|
-
}, inngest: Inngest);
|
|
138
|
-
getRuns(eventId: string): Promise<any>;
|
|
139
|
-
getRunOutput(eventId: string): Promise<any>;
|
|
140
|
-
start({ inputData, }: {
|
|
141
|
-
inputData?: z.infer<TInput>;
|
|
142
|
-
runtimeContext?: RuntimeContext;
|
|
143
|
-
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
144
|
-
resume<TResumeSchema extends z.ZodType<any>>(params: {
|
|
145
|
-
resumeData?: z.infer<TResumeSchema>;
|
|
146
|
-
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
147
|
-
runtimeContext?: RuntimeContext;
|
|
148
|
-
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
149
|
-
watch(cb: (event: any) => void): () => void;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
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> {
|
|
153
|
-
#private;
|
|
154
|
-
inngest: Inngest;
|
|
155
|
-
private function;
|
|
156
|
-
constructor(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
|
|
157
|
-
getWorkflowRuns(args?: {
|
|
158
|
-
fromDate?: Date;
|
|
159
|
-
toDate?: Date;
|
|
160
|
-
limit?: number;
|
|
161
|
-
offset?: number;
|
|
162
|
-
resourceId?: string;
|
|
163
|
-
}): Promise<WorkflowRuns>;
|
|
164
|
-
getWorkflowRunById(runId: string): Promise<WorkflowRun | null>;
|
|
165
|
-
__registerMastra(mastra: Mastra): void;
|
|
166
|
-
createRun(options?: {
|
|
167
|
-
runId?: string;
|
|
168
|
-
}): Run<TSteps, TInput, TOutput>;
|
|
169
|
-
getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
170
|
-
cron: string;
|
|
171
|
-
} & Partial<Record<"event" | "if", never>>] | [{
|
|
172
|
-
event: string;
|
|
173
|
-
if?: string;
|
|
174
|
-
} & Partial<Record<"cron", never>>], Handler.Any>, "triggers">, Handler.Any, Handler.Any, Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
175
|
-
cron: string;
|
|
176
|
-
} & Partial<Record<"event" | "if", never>>] | [{
|
|
177
|
-
event: string;
|
|
178
|
-
if?: string;
|
|
179
|
-
} & Partial<Record<"cron", never>>]>;
|
|
180
|
-
getNestedFunctions(steps: StepFlowEntry[]): ReturnType<Inngest['createFunction']>[];
|
|
181
|
-
getFunctions(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
182
|
-
cron: string;
|
|
183
|
-
} & Partial<Record<"event" | "if", never>>] | [{
|
|
184
|
-
event: string;
|
|
185
|
-
if?: string;
|
|
186
|
-
} & Partial<Record<"cron", never>>], Handler.Any>, "triggers">, Handler.Any, Handler.Any, Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
187
|
-
cron: string;
|
|
188
|
-
} & Partial<Record<"event" | "if", never>>] | [{
|
|
189
|
-
event: string;
|
|
190
|
-
if?: string;
|
|
191
|
-
} & Partial<Record<"cron", never>>]>[];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export declare function serve({ mastra, inngest }: {
|
|
195
|
-
mastra: Mastra;
|
|
196
|
-
inngest: Inngest;
|
|
197
|
-
}): ReturnType<typeof serve_2>;
|
|
198
|
-
|
|
199
|
-
export { }
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import type { BaseContext } from 'inngest';
|
|
2
|
-
import { ClientOptions } from 'inngest';
|
|
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
|
-
import { Handler } from 'inngest';
|
|
11
|
-
import type { Inngest } from 'inngest';
|
|
12
|
-
import { InngestFunction } from 'inngest';
|
|
13
|
-
import { InngestMiddleware } from 'inngest';
|
|
14
|
-
import type { Mastra } from '@mastra/core';
|
|
15
|
-
import { Run } from '@mastra/core/workflows';
|
|
16
|
-
import { RuntimeContext } from '@mastra/core/di';
|
|
17
|
-
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
18
|
-
import { serve as serve_2 } from 'inngest/hono';
|
|
19
|
-
import type { Span } from '@opentelemetry/api';
|
|
20
|
-
import type { Step } from '@mastra/core/workflows';
|
|
21
|
-
import type { StepFlowEntry } from '@mastra/core/workflows';
|
|
22
|
-
import type { StepResult } from '@mastra/core/workflows';
|
|
23
|
-
import { Workflow } from '@mastra/core/workflows';
|
|
24
|
-
import type { WorkflowConfig } from '@mastra/core/workflows';
|
|
25
|
-
import type { WorkflowResult } from '@mastra/core/workflows';
|
|
26
|
-
import type { WorkflowRun } from '@mastra/core';
|
|
27
|
-
import type { WorkflowRuns } from '@mastra/core';
|
|
28
|
-
import type { z } from 'zod';
|
|
29
|
-
|
|
30
|
-
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: {
|
|
31
|
-
id: TWorkflowId;
|
|
32
|
-
}): InngestWorkflow<TSteps, TWorkflowId, TInput, TOutput>;
|
|
33
|
-
|
|
34
|
-
export declare function init(inngest: Inngest): {
|
|
35
|
-
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>;
|
|
36
|
-
createStep: typeof createStep;
|
|
37
|
-
cloneStep: typeof cloneStep;
|
|
38
|
-
cloneWorkflow: typeof cloneWorkflow;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
42
|
-
private inngestStep;
|
|
43
|
-
private inngestAttempts;
|
|
44
|
-
constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
|
|
45
|
-
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: {
|
|
46
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
47
|
-
}, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
48
|
-
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
49
|
-
workflowId: string;
|
|
50
|
-
runId: string;
|
|
51
|
-
step: Step<string, any, any>;
|
|
52
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
53
|
-
executionContext: ExecutionContext;
|
|
54
|
-
resume?: {
|
|
55
|
-
steps: string[];
|
|
56
|
-
resumePayload: any;
|
|
57
|
-
};
|
|
58
|
-
prevOutput: any;
|
|
59
|
-
emitter: {
|
|
60
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
61
|
-
};
|
|
62
|
-
runtimeContext: RuntimeContext;
|
|
63
|
-
}): Promise<StepResult<any, any, any, any>>;
|
|
64
|
-
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
65
|
-
step: Step<string, any, any>;
|
|
66
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
67
|
-
executionContext: {
|
|
68
|
-
workflowId: string;
|
|
69
|
-
runId: string;
|
|
70
|
-
executionPath: number[];
|
|
71
|
-
suspendedPaths: Record<string, number[]>;
|
|
72
|
-
retryConfig: {
|
|
73
|
-
attempts: number;
|
|
74
|
-
delay: number;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
resume?: {
|
|
78
|
-
steps: string[];
|
|
79
|
-
resumePayload: any;
|
|
80
|
-
runId?: string;
|
|
81
|
-
};
|
|
82
|
-
prevOutput: any;
|
|
83
|
-
emitter: {
|
|
84
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
85
|
-
};
|
|
86
|
-
runtimeContext: RuntimeContext;
|
|
87
|
-
}): Promise<StepResult<any, any, any, any>>;
|
|
88
|
-
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, }: {
|
|
89
|
-
workflowId: string;
|
|
90
|
-
runId: string;
|
|
91
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
92
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
93
|
-
executionContext: ExecutionContext;
|
|
94
|
-
}): Promise<void>;
|
|
95
|
-
executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, runtimeContext, }: {
|
|
96
|
-
workflowId: string;
|
|
97
|
-
runId: string;
|
|
98
|
-
entry: {
|
|
99
|
-
type: 'conditional';
|
|
100
|
-
steps: StepFlowEntry[];
|
|
101
|
-
conditions: ExecuteFunction<any, any, any, any>[];
|
|
102
|
-
};
|
|
103
|
-
prevStep: StepFlowEntry;
|
|
104
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
105
|
-
prevOutput: any;
|
|
106
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
107
|
-
resume?: {
|
|
108
|
-
steps: string[];
|
|
109
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
110
|
-
resumePayload: any;
|
|
111
|
-
resumePath: number[];
|
|
112
|
-
};
|
|
113
|
-
executionContext: ExecutionContext;
|
|
114
|
-
emitter: {
|
|
115
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
116
|
-
};
|
|
117
|
-
runtimeContext: RuntimeContext;
|
|
118
|
-
}): Promise<StepResult<any, any, any, any>>;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
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> {
|
|
122
|
-
#private;
|
|
123
|
-
private inngest;
|
|
124
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
125
|
-
constructor(params: {
|
|
126
|
-
workflowId: string;
|
|
127
|
-
runId: string;
|
|
128
|
-
executionEngine: ExecutionEngine;
|
|
129
|
-
executionGraph: ExecutionGraph;
|
|
130
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
131
|
-
mastra?: Mastra;
|
|
132
|
-
retryConfig?: {
|
|
133
|
-
attempts?: number;
|
|
134
|
-
delay?: number;
|
|
135
|
-
};
|
|
136
|
-
cleanup?: () => void;
|
|
137
|
-
}, inngest: Inngest);
|
|
138
|
-
getRuns(eventId: string): Promise<any>;
|
|
139
|
-
getRunOutput(eventId: string): Promise<any>;
|
|
140
|
-
start({ inputData, }: {
|
|
141
|
-
inputData?: z.infer<TInput>;
|
|
142
|
-
runtimeContext?: RuntimeContext;
|
|
143
|
-
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
144
|
-
resume<TResumeSchema extends z.ZodType<any>>(params: {
|
|
145
|
-
resumeData?: z.infer<TResumeSchema>;
|
|
146
|
-
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
147
|
-
runtimeContext?: RuntimeContext;
|
|
148
|
-
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
149
|
-
watch(cb: (event: any) => void): () => void;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
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> {
|
|
153
|
-
#private;
|
|
154
|
-
inngest: Inngest;
|
|
155
|
-
private function;
|
|
156
|
-
constructor(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
|
|
157
|
-
getWorkflowRuns(args?: {
|
|
158
|
-
fromDate?: Date;
|
|
159
|
-
toDate?: Date;
|
|
160
|
-
limit?: number;
|
|
161
|
-
offset?: number;
|
|
162
|
-
resourceId?: string;
|
|
163
|
-
}): Promise<WorkflowRuns>;
|
|
164
|
-
getWorkflowRunById(runId: string): Promise<WorkflowRun | null>;
|
|
165
|
-
__registerMastra(mastra: Mastra): void;
|
|
166
|
-
createRun(options?: {
|
|
167
|
-
runId?: string;
|
|
168
|
-
}): Run<TSteps, TInput, TOutput>;
|
|
169
|
-
getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
170
|
-
cron: string;
|
|
171
|
-
} & Partial<Record<"event" | "if", never>>] | [{
|
|
172
|
-
event: string;
|
|
173
|
-
if?: string;
|
|
174
|
-
} & Partial<Record<"cron", never>>], Handler.Any>, "triggers">, Handler.Any, Handler.Any, Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
175
|
-
cron: string;
|
|
176
|
-
} & Partial<Record<"event" | "if", never>>] | [{
|
|
177
|
-
event: string;
|
|
178
|
-
if?: string;
|
|
179
|
-
} & Partial<Record<"cron", never>>]>;
|
|
180
|
-
getNestedFunctions(steps: StepFlowEntry[]): ReturnType<Inngest['createFunction']>[];
|
|
181
|
-
getFunctions(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
182
|
-
cron: string;
|
|
183
|
-
} & Partial<Record<"event" | "if", never>>] | [{
|
|
184
|
-
event: string;
|
|
185
|
-
if?: string;
|
|
186
|
-
} & Partial<Record<"cron", never>>], Handler.Any>, "triggers">, Handler.Any, Handler.Any, Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
187
|
-
cron: string;
|
|
188
|
-
} & Partial<Record<"event" | "if", never>>] | [{
|
|
189
|
-
event: string;
|
|
190
|
-
if?: string;
|
|
191
|
-
} & Partial<Record<"cron", never>>]>[];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export declare function serve({ mastra, inngest }: {
|
|
195
|
-
mastra: Mastra;
|
|
196
|
-
inngest: Inngest;
|
|
197
|
-
}): ReturnType<typeof serve_2>;
|
|
198
|
-
|
|
199
|
-
export { }
|
package/dist/index.d.cts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { serve } from './_tsup-dts-rollup.cjs';
|
|
2
|
-
export { init } from './_tsup-dts-rollup.cjs';
|
|
3
|
-
export { InngestRun } from './_tsup-dts-rollup.cjs';
|
|
4
|
-
export { InngestWorkflow } from './_tsup-dts-rollup.cjs';
|
|
5
|
-
export { InngestExecutionEngine } from './_tsup-dts-rollup.cjs';
|
package/docker-compose.yaml
DELETED
package/eslint.config.js
DELETED