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