@mastra/inngest 0.0.0-add-runtime-context-to-openai-realtime-20250516201052 → 0.0.0-ai-v5-20250625173645
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 +290 -2
- package/dist/_tsup-dts-rollup.d.cts +127 -56
- package/dist/_tsup-dts-rollup.d.ts +127 -56
- package/dist/index.cjs +362 -47
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +359 -45
- package/package.json +20 -16
- package/src/index.test.ts +4576 -3254
- package/src/index.ts +593 -89
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,305 @@
|
|
|
1
1
|
# @mastra/inngest
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-ai-v5-20250625173645
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 66858d4: AI SDK v5 beta
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 9d52b17: Fix inngest workflows streaming and add step metadata
|
|
12
|
+
- 4fb0cc2: Type safe variable mapping
|
|
13
|
+
- Updated dependencies [d1baedb]
|
|
14
|
+
- Updated dependencies [d8f2d19]
|
|
15
|
+
- Updated dependencies [4d21bf2]
|
|
16
|
+
- Updated dependencies [9d52b17]
|
|
17
|
+
- Updated dependencies [2097952]
|
|
18
|
+
- Updated dependencies [66858d4]
|
|
19
|
+
- Updated dependencies [4fb0cc2]
|
|
20
|
+
- Updated dependencies [d2a7a31]
|
|
21
|
+
- Updated dependencies [8ba1b51]
|
|
22
|
+
- Updated dependencies [0e17048]
|
|
23
|
+
- @mastra/core@0.0.0-ai-v5-20250625173645
|
|
24
|
+
|
|
25
|
+
## 0.10.6-alpha.1
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- 4fb0cc2: Type safe variable mapping
|
|
30
|
+
- Updated dependencies [d1baedb]
|
|
31
|
+
- Updated dependencies [4d21bf2]
|
|
32
|
+
- Updated dependencies [2097952]
|
|
33
|
+
- Updated dependencies [4fb0cc2]
|
|
34
|
+
- Updated dependencies [d2a7a31]
|
|
35
|
+
- Updated dependencies [0e17048]
|
|
36
|
+
- @mastra/core@0.10.7-alpha.1
|
|
37
|
+
|
|
38
|
+
## 0.10.6-alpha.0
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- 9d52b17: Fix inngest workflows streaming and add step metadata
|
|
43
|
+
- Updated dependencies [d8f2d19]
|
|
44
|
+
- Updated dependencies [9d52b17]
|
|
45
|
+
- Updated dependencies [8ba1b51]
|
|
46
|
+
- @mastra/core@0.10.7-alpha.0
|
|
47
|
+
|
|
48
|
+
## 0.10.5
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 63f6b7d: dependencies updates:
|
|
53
|
+
- Updated dependency [`inngest@^3.39.1` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.1) (from `^3.35.1`, in `dependencies`)
|
|
54
|
+
- Updated dependency [`zod@^3.25.57` ↗︎](https://www.npmjs.com/package/zod/v/3.25.57) (from `^3.25.56`, in `dependencies`)
|
|
55
|
+
- ee9af57: Add api for polling run execution result and get run by id
|
|
56
|
+
- Updated dependencies [63f6b7d]
|
|
57
|
+
- Updated dependencies [12a95fc]
|
|
58
|
+
- Updated dependencies [4b0f8a6]
|
|
59
|
+
- Updated dependencies [51264a5]
|
|
60
|
+
- Updated dependencies [8e6f677]
|
|
61
|
+
- Updated dependencies [d70c420]
|
|
62
|
+
- Updated dependencies [ee9af57]
|
|
63
|
+
- Updated dependencies [36f1c36]
|
|
64
|
+
- Updated dependencies [2a16996]
|
|
65
|
+
- Updated dependencies [10d352e]
|
|
66
|
+
- Updated dependencies [9589624]
|
|
67
|
+
- Updated dependencies [53d3c37]
|
|
68
|
+
- Updated dependencies [751c894]
|
|
69
|
+
- Updated dependencies [577ce3a]
|
|
70
|
+
- Updated dependencies [9260b3a]
|
|
71
|
+
- @mastra/core@0.10.6
|
|
72
|
+
|
|
73
|
+
## 0.10.5-alpha.1
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- ee9af57: Add api for polling run execution result and get run by id
|
|
78
|
+
- Updated dependencies [ee9af57]
|
|
79
|
+
- Updated dependencies [751c894]
|
|
80
|
+
- Updated dependencies [577ce3a]
|
|
81
|
+
- Updated dependencies [9260b3a]
|
|
82
|
+
- @mastra/core@0.10.6-alpha.1
|
|
83
|
+
|
|
84
|
+
## 0.10.5-alpha.0
|
|
85
|
+
|
|
86
|
+
### Patch Changes
|
|
87
|
+
|
|
88
|
+
- 63f6b7d: dependencies updates:
|
|
89
|
+
- Updated dependency [`inngest@^3.39.1` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.1) (from `^3.35.1`, in `dependencies`)
|
|
90
|
+
- Updated dependency [`zod@^3.25.57` ↗︎](https://www.npmjs.com/package/zod/v/3.25.57) (from `^3.25.56`, in `dependencies`)
|
|
91
|
+
- Updated dependencies [63f6b7d]
|
|
92
|
+
- Updated dependencies [36f1c36]
|
|
93
|
+
- Updated dependencies [10d352e]
|
|
94
|
+
- Updated dependencies [53d3c37]
|
|
95
|
+
- @mastra/core@0.10.6-alpha.0
|
|
96
|
+
|
|
97
|
+
## 0.10.4
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- 13c97f9: Save run status, result and error in storage snapshot
|
|
102
|
+
- Updated dependencies [13c97f9]
|
|
103
|
+
- @mastra/core@0.10.5
|
|
104
|
+
|
|
105
|
+
## 0.10.3
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- 1ccccff: dependencies updates:
|
|
110
|
+
- Updated dependency [`zod@^3.25.56` ↗︎](https://www.npmjs.com/package/zod/v/3.25.56) (from `^3.24.2`, in `dependencies`)
|
|
111
|
+
- 1ccccff: dependencies updates:
|
|
112
|
+
- Updated dependency [`zod@^3.25.56` ↗︎](https://www.npmjs.com/package/zod/v/3.25.56) (from `^3.24.2`, in `dependencies`)
|
|
113
|
+
- Updated dependencies [d1ed912]
|
|
114
|
+
- Updated dependencies [f6fd25f]
|
|
115
|
+
- Updated dependencies [dffb67b]
|
|
116
|
+
- Updated dependencies [f1f1f1b]
|
|
117
|
+
- Updated dependencies [925ab94]
|
|
118
|
+
- Updated dependencies [f9816ae]
|
|
119
|
+
- Updated dependencies [82090c1]
|
|
120
|
+
- Updated dependencies [1b443fd]
|
|
121
|
+
- Updated dependencies [ce97900]
|
|
122
|
+
- Updated dependencies [f1309d3]
|
|
123
|
+
- Updated dependencies [14a2566]
|
|
124
|
+
- Updated dependencies [f7f8293]
|
|
125
|
+
- Updated dependencies [48eddb9]
|
|
126
|
+
- @mastra/core@0.10.4
|
|
127
|
+
|
|
128
|
+
## 0.10.3-alpha.0
|
|
129
|
+
|
|
130
|
+
### Patch Changes
|
|
131
|
+
|
|
132
|
+
- 1ccccff: dependencies updates:
|
|
133
|
+
- Updated dependency [`zod@^3.25.56` ↗︎](https://www.npmjs.com/package/zod/v/3.25.56) (from `^3.24.2`, in `dependencies`)
|
|
134
|
+
- 1ccccff: dependencies updates:
|
|
135
|
+
- Updated dependency [`zod@^3.25.56` ↗︎](https://www.npmjs.com/package/zod/v/3.25.56) (from `^3.24.2`, in `dependencies`)
|
|
136
|
+
- Updated dependencies [f6fd25f]
|
|
137
|
+
- Updated dependencies [dffb67b]
|
|
138
|
+
- Updated dependencies [f1309d3]
|
|
139
|
+
- Updated dependencies [f7f8293]
|
|
140
|
+
- @mastra/core@0.10.4-alpha.1
|
|
141
|
+
|
|
142
|
+
## 0.10.2
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- 195c428: Add runId to step execute fn
|
|
147
|
+
- 12b7002: Add serializedStepGraph to workflow run snapshot in storage
|
|
148
|
+
- f0d559f: Fix peerdeps for alpha channel
|
|
149
|
+
- 1ee6894: inngest production url fix
|
|
150
|
+
- Updated dependencies [ee77e78]
|
|
151
|
+
- Updated dependencies [592a2db]
|
|
152
|
+
- Updated dependencies [e5dc18d]
|
|
153
|
+
- Updated dependencies [ab5adbe]
|
|
154
|
+
- Updated dependencies [1e8bb40]
|
|
155
|
+
- Updated dependencies [1b5fc55]
|
|
156
|
+
- Updated dependencies [195c428]
|
|
157
|
+
- Updated dependencies [f73e11b]
|
|
158
|
+
- Updated dependencies [37643b8]
|
|
159
|
+
- Updated dependencies [99fd6cf]
|
|
160
|
+
- Updated dependencies [c5bf1ce]
|
|
161
|
+
- Updated dependencies [add596e]
|
|
162
|
+
- Updated dependencies [8dc94d8]
|
|
163
|
+
- Updated dependencies [ecebbeb]
|
|
164
|
+
- Updated dependencies [79d5145]
|
|
165
|
+
- Updated dependencies [12b7002]
|
|
166
|
+
- Updated dependencies [2901125]
|
|
167
|
+
- @mastra/core@0.10.2
|
|
168
|
+
|
|
169
|
+
## 0.10.2-alpha.3
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- 1ee6894: inngest production url fix
|
|
174
|
+
- Updated dependencies [1b5fc55]
|
|
175
|
+
- Updated dependencies [add596e]
|
|
176
|
+
- Updated dependencies [ecebbeb]
|
|
177
|
+
- @mastra/core@0.10.2-alpha.5
|
|
178
|
+
|
|
179
|
+
## 0.10.2-alpha.2
|
|
180
|
+
|
|
181
|
+
### Patch Changes
|
|
182
|
+
|
|
183
|
+
- 12b7002: Add serializedStepGraph to workflow run snapshot in storage
|
|
184
|
+
- Updated dependencies [c5bf1ce]
|
|
185
|
+
- Updated dependencies [12b7002]
|
|
186
|
+
- @mastra/core@0.10.2-alpha.4
|
|
187
|
+
|
|
188
|
+
## 0.10.2-alpha.1
|
|
189
|
+
|
|
190
|
+
### Patch Changes
|
|
191
|
+
|
|
192
|
+
- 195c428: Add runId to step execute fn
|
|
193
|
+
- Updated dependencies [ab5adbe]
|
|
194
|
+
- Updated dependencies [195c428]
|
|
195
|
+
- Updated dependencies [f73e11b]
|
|
196
|
+
- @mastra/core@0.10.2-alpha.3
|
|
197
|
+
|
|
198
|
+
## 0.10.2-alpha.0
|
|
199
|
+
|
|
200
|
+
### Patch Changes
|
|
201
|
+
|
|
202
|
+
- f0d559f: Fix peerdeps for alpha channel
|
|
203
|
+
- Updated dependencies [1e8bb40]
|
|
204
|
+
- @mastra/core@0.10.2-alpha.2
|
|
205
|
+
|
|
206
|
+
## 0.10.1
|
|
207
|
+
|
|
208
|
+
### Patch Changes
|
|
209
|
+
|
|
210
|
+
- 200d0da: Return payload data, start time, end time, resume time and suspend time for each step in workflow state
|
|
211
|
+
Return error stack for failed workflow runs
|
|
212
|
+
- 5343f93: Move emitter to symbol to make private
|
|
213
|
+
- Updated dependencies [d70b807]
|
|
214
|
+
- Updated dependencies [6d16390]
|
|
215
|
+
- Updated dependencies [1e4a421]
|
|
216
|
+
- Updated dependencies [200d0da]
|
|
217
|
+
- Updated dependencies [bf5f17b]
|
|
218
|
+
- Updated dependencies [5343f93]
|
|
219
|
+
- Updated dependencies [38aee50]
|
|
220
|
+
- Updated dependencies [5c41100]
|
|
221
|
+
- Updated dependencies [d6a759b]
|
|
222
|
+
- Updated dependencies [6015bdf]
|
|
223
|
+
- @mastra/core@0.10.1
|
|
224
|
+
|
|
225
|
+
## 0.10.1-alpha.0
|
|
226
|
+
|
|
227
|
+
### Patch Changes
|
|
228
|
+
|
|
229
|
+
- 200d0da: Return payload data, start time, end time, resume time and suspend time for each step in workflow state
|
|
230
|
+
Return error stack for failed workflow runs
|
|
231
|
+
- 5343f93: Move emitter to symbol to make private
|
|
232
|
+
- Updated dependencies [200d0da]
|
|
233
|
+
- Updated dependencies [bf5f17b]
|
|
234
|
+
- Updated dependencies [5343f93]
|
|
235
|
+
- Updated dependencies [38aee50]
|
|
236
|
+
- Updated dependencies [5c41100]
|
|
237
|
+
- Updated dependencies [d6a759b]
|
|
238
|
+
- @mastra/core@0.10.1-alpha.1
|
|
239
|
+
|
|
240
|
+
## 0.10.0
|
|
241
|
+
|
|
242
|
+
### Minor Changes
|
|
243
|
+
|
|
244
|
+
- 83da932: Move @mastra/core to peerdeps
|
|
245
|
+
|
|
246
|
+
### Patch Changes
|
|
247
|
+
|
|
248
|
+
- b3a3d63: BREAKING: Make vnext workflow the default worklow, and old workflow legacy_workflow
|
|
249
|
+
- e4172d9: Update getWorkflowRuns type for inngest workflow
|
|
250
|
+
- Updated dependencies [b3a3d63]
|
|
251
|
+
- Updated dependencies [344f453]
|
|
252
|
+
- Updated dependencies [0a3ae6d]
|
|
253
|
+
- Updated dependencies [95911be]
|
|
254
|
+
- Updated dependencies [f53a6ac]
|
|
255
|
+
- Updated dependencies [5eb5a99]
|
|
256
|
+
- Updated dependencies [7e632c5]
|
|
257
|
+
- Updated dependencies [1e9fbfa]
|
|
258
|
+
- Updated dependencies [eabdcd9]
|
|
259
|
+
- Updated dependencies [90be034]
|
|
260
|
+
- Updated dependencies [99f050a]
|
|
261
|
+
- Updated dependencies [d0ee3c6]
|
|
262
|
+
- Updated dependencies [b2ae5aa]
|
|
263
|
+
- Updated dependencies [23f258c]
|
|
264
|
+
- Updated dependencies [a7292b0]
|
|
265
|
+
- Updated dependencies [0dcb9f0]
|
|
266
|
+
- Updated dependencies [2672a05]
|
|
267
|
+
- @mastra/core@0.10.0
|
|
268
|
+
|
|
269
|
+
## 0.1.0-alpha.1
|
|
270
|
+
|
|
271
|
+
### Minor Changes
|
|
272
|
+
|
|
273
|
+
- 83da932: Move @mastra/core to peerdeps
|
|
274
|
+
|
|
275
|
+
### Patch Changes
|
|
276
|
+
|
|
277
|
+
- b3a3d63: BREAKING: Make vnext workflow the default worklow, and old workflow legacy_workflow
|
|
278
|
+
- Updated dependencies [b3a3d63]
|
|
279
|
+
- Updated dependencies [344f453]
|
|
280
|
+
- Updated dependencies [0a3ae6d]
|
|
281
|
+
- Updated dependencies [95911be]
|
|
282
|
+
- Updated dependencies [5eb5a99]
|
|
283
|
+
- Updated dependencies [7e632c5]
|
|
284
|
+
- Updated dependencies [1e9fbfa]
|
|
285
|
+
- Updated dependencies [b2ae5aa]
|
|
286
|
+
- Updated dependencies [a7292b0]
|
|
287
|
+
- Updated dependencies [0dcb9f0]
|
|
288
|
+
- @mastra/core@0.10.0-alpha.1
|
|
289
|
+
|
|
290
|
+
## 0.0.4-alpha.0
|
|
4
291
|
|
|
5
292
|
### Patch Changes
|
|
6
293
|
|
|
7
294
|
- e4172d9: Update getWorkflowRuns type for inngest workflow
|
|
8
295
|
- Updated dependencies [f53a6ac]
|
|
9
296
|
- Updated dependencies [eabdcd9]
|
|
297
|
+
- Updated dependencies [90be034]
|
|
10
298
|
- Updated dependencies [99f050a]
|
|
11
299
|
- Updated dependencies [d0ee3c6]
|
|
12
300
|
- Updated dependencies [23f258c]
|
|
13
301
|
- Updated dependencies [2672a05]
|
|
14
|
-
- @mastra/core@0.
|
|
302
|
+
- @mastra/core@0.9.5-alpha.0
|
|
15
303
|
|
|
16
304
|
## 0.0.3
|
|
17
305
|
|
|
@@ -1,68 +1,122 @@
|
|
|
1
|
+
import type { Agent } from '@mastra/core';
|
|
1
2
|
import type { BaseContext } from 'inngest';
|
|
2
3
|
import { ClientOptions } from 'inngest';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type { ExecutionGraph } from '@mastra/core/workflows/vNext';
|
|
4
|
+
import { DefaultExecutionEngine } from '@mastra/core/workflows';
|
|
5
|
+
import type { Emitter } 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
|
|
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';
|
|
17
|
+
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
20
18
|
import { serve as serve_2 } from 'inngest/hono';
|
|
21
19
|
import type { Span } from '@opentelemetry/api';
|
|
22
|
-
import type {
|
|
23
|
-
import type {
|
|
24
|
-
import type {
|
|
25
|
-
import type {
|
|
26
|
-
import
|
|
27
|
-
import type {
|
|
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 type { StreamEvent } from '@mastra/core/workflows';
|
|
24
|
+
import { Tool } from '@mastra/core/tools';
|
|
25
|
+
import type { ToolExecutionContext } from '@mastra/core';
|
|
26
|
+
import type { WatchEvent } from '@mastra/core/workflows';
|
|
27
|
+
import { Workflow } from '@mastra/core/workflows';
|
|
28
|
+
import type { WorkflowConfig } from '@mastra/core/workflows';
|
|
29
|
+
import type { WorkflowResult } from '@mastra/core/workflows';
|
|
30
|
+
import type { WorkflowRun } from '@mastra/core';
|
|
31
|
+
import type { WorkflowRuns } from '@mastra/core';
|
|
32
|
+
import { z } from 'zod';
|
|
28
33
|
|
|
29
|
-
declare function
|
|
30
|
-
id:
|
|
31
|
-
|
|
34
|
+
export declare function createStep<TStepId extends string, TStepInput extends z.ZodType<any>, TStepOutput extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(params: {
|
|
35
|
+
id: TStepId;
|
|
36
|
+
description?: string;
|
|
37
|
+
inputSchema: TStepInput;
|
|
38
|
+
outputSchema: TStepOutput;
|
|
39
|
+
resumeSchema?: TResumeSchema;
|
|
40
|
+
suspendSchema?: TSuspendSchema;
|
|
41
|
+
execute: ExecuteFunction<z.infer<TStepInput>, z.infer<TStepOutput>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, InngestEngineType>;
|
|
42
|
+
}): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, InngestEngineType>;
|
|
43
|
+
|
|
44
|
+
export declare function createStep<TStepId extends string, TStepInput extends z.ZodObject<{
|
|
45
|
+
prompt: z.ZodString;
|
|
46
|
+
}>, TStepOutput extends z.ZodObject<{
|
|
47
|
+
text: z.ZodString;
|
|
48
|
+
}>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(agent: Agent<TStepId, any, any>): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, InngestEngineType>;
|
|
49
|
+
|
|
50
|
+
export declare function createStep<TSchemaIn extends z.ZodType<any>, TSchemaOut extends z.ZodType<any>, TContext extends ToolExecutionContext<TSchemaIn>>(tool: Tool<TSchemaIn, TSchemaOut, TContext> & {
|
|
51
|
+
inputSchema: TSchemaIn;
|
|
52
|
+
outputSchema: TSchemaOut;
|
|
53
|
+
execute: (context: TContext) => Promise<any>;
|
|
54
|
+
}): Step<string, TSchemaIn, TSchemaOut, z.ZodType<any>, z.ZodType<any>, InngestEngineType>;
|
|
32
55
|
|
|
33
56
|
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
|
|
57
|
+
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, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): InngestWorkflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TInput>;
|
|
35
58
|
createStep: typeof createStep;
|
|
36
|
-
cloneStep:
|
|
37
|
-
|
|
59
|
+
cloneStep<TStepId extends string>(step: Step<string, any, any, any, any, InngestEngineType>, opts: {
|
|
60
|
+
id: TStepId;
|
|
61
|
+
}): Step<TStepId, any, any, any, any, InngestEngineType>;
|
|
62
|
+
cloneWorkflow<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, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[], TPrevSchema extends z.ZodType<any> = TInput>(workflow: Workflow<InngestEngineType, TSteps, string, TInput, TOutput, TPrevSchema>, opts: {
|
|
63
|
+
id: TWorkflowId;
|
|
64
|
+
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema>;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export declare type InngestEngineType = {
|
|
68
|
+
step: any;
|
|
38
69
|
};
|
|
39
70
|
|
|
40
71
|
export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
41
72
|
private inngestStep;
|
|
42
73
|
private inngestAttempts;
|
|
43
74
|
constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
75
|
+
execute<TInput, TOutput>(params: {
|
|
76
|
+
workflowId: string;
|
|
77
|
+
runId: string;
|
|
78
|
+
graph: ExecutionGraph;
|
|
79
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
80
|
+
input?: TInput;
|
|
81
|
+
resume?: {
|
|
82
|
+
steps: string[];
|
|
83
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
84
|
+
resumePayload: any;
|
|
85
|
+
resumePath: number[];
|
|
86
|
+
};
|
|
87
|
+
emitter: Emitter;
|
|
88
|
+
retryConfig?: {
|
|
89
|
+
attempts?: number;
|
|
90
|
+
delay?: number;
|
|
91
|
+
};
|
|
92
|
+
runtimeContext: RuntimeContext;
|
|
93
|
+
}): Promise<TOutput>;
|
|
94
|
+
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: Emitter, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
47
95
|
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
48
96
|
workflowId: string;
|
|
49
97
|
runId: string;
|
|
50
|
-
step:
|
|
51
|
-
stepResults: Record<string, StepResult<any>>;
|
|
98
|
+
step: Step<string, any, any>;
|
|
99
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
52
100
|
executionContext: ExecutionContext;
|
|
53
101
|
resume?: {
|
|
54
102
|
steps: string[];
|
|
55
103
|
resumePayload: any;
|
|
56
104
|
};
|
|
57
105
|
prevOutput: any;
|
|
58
|
-
emitter:
|
|
59
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
60
|
-
};
|
|
106
|
+
emitter: Emitter;
|
|
61
107
|
runtimeContext: RuntimeContext;
|
|
62
|
-
}): Promise<StepResult<any>>;
|
|
108
|
+
}): Promise<StepResult<any, any, any, any>>;
|
|
109
|
+
executeSleep({ id, duration }: {
|
|
110
|
+
id: string;
|
|
111
|
+
duration: number;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
executeWaitForEvent({ event, timeout }: {
|
|
114
|
+
event: string;
|
|
115
|
+
timeout?: number;
|
|
116
|
+
}): Promise<any>;
|
|
63
117
|
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
64
|
-
step:
|
|
65
|
-
stepResults: Record<string, StepResult<any>>;
|
|
118
|
+
step: Step<string, any, any>;
|
|
119
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
66
120
|
executionContext: {
|
|
67
121
|
workflowId: string;
|
|
68
122
|
runId: string;
|
|
@@ -79,50 +133,53 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
79
133
|
runId?: string;
|
|
80
134
|
};
|
|
81
135
|
prevOutput: any;
|
|
82
|
-
emitter:
|
|
83
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
84
|
-
};
|
|
136
|
+
emitter: Emitter;
|
|
85
137
|
runtimeContext: RuntimeContext;
|
|
86
|
-
}): Promise<StepResult<any>>;
|
|
87
|
-
persistStepUpdate({ workflowId, runId, stepResults, executionContext, }: {
|
|
138
|
+
}): Promise<StepResult<any, any, any, any>>;
|
|
139
|
+
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
|
|
88
140
|
workflowId: string;
|
|
89
141
|
runId: string;
|
|
90
|
-
stepResults: Record<string, StepResult<any>>;
|
|
142
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
143
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
91
144
|
executionContext: ExecutionContext;
|
|
145
|
+
workflowStatus: 'success' | 'failed' | 'suspended' | 'running';
|
|
146
|
+
result?: Record<string, any>;
|
|
147
|
+
error?: string | Error;
|
|
92
148
|
}): Promise<void>;
|
|
93
|
-
executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, resume, executionContext, emitter, runtimeContext, }: {
|
|
149
|
+
executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, runtimeContext, }: {
|
|
94
150
|
workflowId: string;
|
|
95
151
|
runId: string;
|
|
96
152
|
entry: {
|
|
97
153
|
type: 'conditional';
|
|
98
154
|
steps: StepFlowEntry[];
|
|
99
|
-
conditions: ExecuteFunction<any, any, any, any>[];
|
|
155
|
+
conditions: ExecuteFunction<any, any, any, any, InngestEngineType>[];
|
|
100
156
|
};
|
|
101
157
|
prevStep: StepFlowEntry;
|
|
158
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
102
159
|
prevOutput: any;
|
|
103
|
-
stepResults: Record<string, StepResult<any>>;
|
|
160
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
104
161
|
resume?: {
|
|
105
162
|
steps: string[];
|
|
106
|
-
stepResults: Record<string, StepResult<any>>;
|
|
163
|
+
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
107
164
|
resumePayload: any;
|
|
108
165
|
resumePath: number[];
|
|
109
166
|
};
|
|
110
167
|
executionContext: ExecutionContext;
|
|
111
|
-
emitter:
|
|
112
|
-
emit: (event: string, data: any) => Promise<void>;
|
|
113
|
-
};
|
|
168
|
+
emitter: Emitter;
|
|
114
169
|
runtimeContext: RuntimeContext;
|
|
115
|
-
}): Promise<StepResult<any>>;
|
|
170
|
+
}): Promise<StepResult<any, any, any, any>>;
|
|
116
171
|
}
|
|
117
172
|
|
|
118
|
-
export declare class InngestRun<TSteps extends
|
|
173
|
+
export declare class InngestRun<TEngineType = InngestEngineType, 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<TEngineType, TSteps, TInput, TOutput> {
|
|
119
174
|
#private;
|
|
120
175
|
private inngest;
|
|
176
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
121
177
|
constructor(params: {
|
|
122
178
|
workflowId: string;
|
|
123
179
|
runId: string;
|
|
124
180
|
executionEngine: ExecutionEngine;
|
|
125
181
|
executionGraph: ExecutionGraph;
|
|
182
|
+
serializedStepGraph: SerializedStepFlowEntry[];
|
|
126
183
|
mastra?: Mastra;
|
|
127
184
|
retryConfig?: {
|
|
128
185
|
attempts?: number;
|
|
@@ -132,35 +189,49 @@ export declare class InngestRun<TSteps extends NewStep<string, any, any>[] = New
|
|
|
132
189
|
}, inngest: Inngest);
|
|
133
190
|
getRuns(eventId: string): Promise<any>;
|
|
134
191
|
getRunOutput(eventId: string): Promise<any>;
|
|
192
|
+
sendEvent(event: string, data: any): Promise<void>;
|
|
135
193
|
start({ inputData, }: {
|
|
136
194
|
inputData?: z.infer<TInput>;
|
|
137
195
|
runtimeContext?: RuntimeContext;
|
|
138
196
|
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
139
197
|
resume<TResumeSchema extends z.ZodType<any>>(params: {
|
|
140
198
|
resumeData?: z.infer<TResumeSchema>;
|
|
141
|
-
step:
|
|
199
|
+
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
200
|
+
runtimeContext?: RuntimeContext;
|
|
201
|
+
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
202
|
+
_resume<TResumeSchema extends z.ZodType<any>>(params: {
|
|
203
|
+
resumeData?: z.infer<TResumeSchema>;
|
|
204
|
+
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
142
205
|
runtimeContext?: RuntimeContext;
|
|
143
206
|
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
144
|
-
watch(cb: (event:
|
|
207
|
+
watch(cb: (event: WatchEvent) => void, type?: 'watch' | 'watch-v2'): () => void;
|
|
208
|
+
stream({ inputData, runtimeContext }?: {
|
|
209
|
+
inputData?: z.infer<TInput>;
|
|
210
|
+
runtimeContext?: RuntimeContext;
|
|
211
|
+
}): {
|
|
212
|
+
stream: ReadableStream<StreamEvent>;
|
|
213
|
+
getWorkflowState: () => Promise<WorkflowResult<TOutput, TSteps>>;
|
|
214
|
+
};
|
|
145
215
|
}
|
|
146
216
|
|
|
147
|
-
export declare class InngestWorkflow<TSteps extends
|
|
217
|
+
export declare class InngestWorkflow<TEngineType = InngestEngineType, 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<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
|
|
148
218
|
#private;
|
|
149
219
|
inngest: Inngest;
|
|
150
220
|
private function;
|
|
151
|
-
constructor(params:
|
|
221
|
+
constructor(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>, inngest: Inngest);
|
|
152
222
|
getWorkflowRuns(args?: {
|
|
153
223
|
fromDate?: Date;
|
|
154
224
|
toDate?: Date;
|
|
155
225
|
limit?: number;
|
|
156
226
|
offset?: number;
|
|
157
227
|
resourceId?: string;
|
|
158
|
-
}): Promise<
|
|
159
|
-
getWorkflowRunById(runId: string): Promise<
|
|
228
|
+
}): Promise<WorkflowRuns>;
|
|
229
|
+
getWorkflowRunById(runId: string): Promise<WorkflowRun | null>;
|
|
230
|
+
getWorkflowRunExecutionResult(runId: string): Promise<WatchEvent['payload']['workflowState'] | null>;
|
|
160
231
|
__registerMastra(mastra: Mastra): void;
|
|
161
232
|
createRun(options?: {
|
|
162
233
|
runId?: string;
|
|
163
|
-
}): Run<TSteps, TInput, TOutput>;
|
|
234
|
+
}): Run<TEngineType, TSteps, TInput, TOutput>;
|
|
164
235
|
getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
165
236
|
cron: string;
|
|
166
237
|
} & Partial<Record<"event" | "if", never>>] | [{
|