@mastra/inngest 0.0.0-http-transporter-20250702160118 → 0.0.0-memory-system-message-error-20250813233316
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 +271 -2
- package/LICENSE.md +11 -42
- package/dist/index.cjs +146 -8
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +282 -7
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +147 -9
- package/dist/index.js.map +1 -0
- package/docker-compose.yaml +1 -1
- package/package.json +13 -12
- package/src/index.test.ts +703 -18
- package/src/index.ts +201 -3
- package/tsconfig.build.json +9 -0
- package/tsconfig.json +1 -1
- package/tsup.config.ts +17 -0
- package/dist/_tsup-dts-rollup.d.cts +0 -265
- package/dist/_tsup-dts-rollup.d.ts +0 -265
- package/dist/index.d.cts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,281 @@
|
|
|
1
1
|
# @mastra/inngest
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-memory-system-message-error-20250813233316
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [49281f5]
|
|
8
|
+
- Updated dependencies [2256977]
|
|
9
|
+
- Updated dependencies [c597dc5]
|
|
10
|
+
- Updated dependencies [a6841fa]
|
|
11
|
+
- Updated dependencies [c30bca8]
|
|
12
|
+
- Updated dependencies [83d180b]
|
|
13
|
+
- Updated dependencies [3b5fec7]
|
|
14
|
+
- @mastra/core@0.0.0-memory-system-message-error-20250813233316
|
|
15
|
+
|
|
16
|
+
## 0.11.9
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
21
|
+
- Updated dependencies [cb36de0]
|
|
22
|
+
- Updated dependencies [d0496e6]
|
|
23
|
+
- Updated dependencies [a82b851]
|
|
24
|
+
- Updated dependencies [ea0c5f2]
|
|
25
|
+
- Updated dependencies [41a0a0e]
|
|
26
|
+
- Updated dependencies [2871020]
|
|
27
|
+
- Updated dependencies [94f4812]
|
|
28
|
+
- Updated dependencies [e202b82]
|
|
29
|
+
- Updated dependencies [e00f6a0]
|
|
30
|
+
- Updated dependencies [4a406ec]
|
|
31
|
+
- Updated dependencies [b0e43c1]
|
|
32
|
+
- Updated dependencies [5d377e5]
|
|
33
|
+
- Updated dependencies [1fb812e]
|
|
34
|
+
- Updated dependencies [35c5798]
|
|
35
|
+
- @mastra/core@0.13.0
|
|
36
|
+
|
|
37
|
+
## 0.11.9-alpha.0
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 4a406ec: fixes TypeScript declaration file imports to ensure proper ESM compatibility
|
|
42
|
+
- Updated dependencies [cb36de0]
|
|
43
|
+
- Updated dependencies [a82b851]
|
|
44
|
+
- Updated dependencies [41a0a0e]
|
|
45
|
+
- Updated dependencies [2871020]
|
|
46
|
+
- Updated dependencies [4a406ec]
|
|
47
|
+
- Updated dependencies [5d377e5]
|
|
48
|
+
- @mastra/core@0.13.0-alpha.2
|
|
49
|
+
|
|
50
|
+
## 0.11.8
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- 7257912: dependencies updates:
|
|
55
|
+
- Updated dependency [`inngest@^3.40.1` ↗︎](https://www.npmjs.com/package/inngest/v/3.40.1) (from `^3.40.0`, in `dependencies`)
|
|
56
|
+
- Updated dependencies [33dcb07]
|
|
57
|
+
- Updated dependencies [d0d9500]
|
|
58
|
+
- Updated dependencies [d30b1a0]
|
|
59
|
+
- Updated dependencies [bff87f7]
|
|
60
|
+
- Updated dependencies [b4a8df0]
|
|
61
|
+
- @mastra/core@0.12.1
|
|
62
|
+
|
|
63
|
+
## 0.11.8-alpha.0
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- 7257912: dependencies updates:
|
|
68
|
+
- Updated dependency [`inngest@^3.40.1` ↗︎](https://www.npmjs.com/package/inngest/v/3.40.1) (from `^3.40.0`, in `dependencies`)
|
|
69
|
+
- Updated dependencies [33dcb07]
|
|
70
|
+
- Updated dependencies [d30b1a0]
|
|
71
|
+
- Updated dependencies [bff87f7]
|
|
72
|
+
- Updated dependencies [b4a8df0]
|
|
73
|
+
- @mastra/core@0.12.1-alpha.0
|
|
74
|
+
|
|
75
|
+
## 0.11.7
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- f42c4c2: update peer deps for packages to latest core range
|
|
80
|
+
- Updated dependencies [510e2c8]
|
|
81
|
+
- Updated dependencies [2f72fb2]
|
|
82
|
+
- Updated dependencies [27cc97a]
|
|
83
|
+
- Updated dependencies [3f89307]
|
|
84
|
+
- Updated dependencies [9eda7d4]
|
|
85
|
+
- Updated dependencies [9d49408]
|
|
86
|
+
- Updated dependencies [41daa63]
|
|
87
|
+
- Updated dependencies [ad0a58b]
|
|
88
|
+
- Updated dependencies [254a36b]
|
|
89
|
+
- Updated dependencies [2ecf658]
|
|
90
|
+
- Updated dependencies [7a7754f]
|
|
91
|
+
- Updated dependencies [fc92d80]
|
|
92
|
+
- Updated dependencies [e0f73c6]
|
|
93
|
+
- Updated dependencies [0b89602]
|
|
94
|
+
- Updated dependencies [4d37822]
|
|
95
|
+
- Updated dependencies [23a6a7c]
|
|
96
|
+
- Updated dependencies [cda801d]
|
|
97
|
+
- Updated dependencies [a77c823]
|
|
98
|
+
- Updated dependencies [ff9c125]
|
|
99
|
+
- Updated dependencies [09bca64]
|
|
100
|
+
- Updated dependencies [b8efbb9]
|
|
101
|
+
- Updated dependencies [71466e7]
|
|
102
|
+
- Updated dependencies [0c99fbe]
|
|
103
|
+
- @mastra/core@0.12.0
|
|
104
|
+
|
|
105
|
+
## 0.11.7-alpha.0
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- f42c4c2: update peer deps for packages to latest core range
|
|
110
|
+
- @mastra/core@0.12.0-alpha.5
|
|
111
|
+
|
|
112
|
+
## 0.11.6
|
|
113
|
+
|
|
114
|
+
### Patch Changes
|
|
115
|
+
|
|
116
|
+
- ce088f5: Update all peerdeps to latest core
|
|
117
|
+
- @mastra/core@0.11.1
|
|
118
|
+
|
|
119
|
+
## 0.11.5
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- a723d69: Pass workflowId through
|
|
124
|
+
- Updated dependencies [f248d53]
|
|
125
|
+
- Updated dependencies [2affc57]
|
|
126
|
+
- Updated dependencies [66e13e3]
|
|
127
|
+
- Updated dependencies [edd9482]
|
|
128
|
+
- Updated dependencies [18344d7]
|
|
129
|
+
- Updated dependencies [9d372c2]
|
|
130
|
+
- Updated dependencies [40c2525]
|
|
131
|
+
- Updated dependencies [e473f27]
|
|
132
|
+
- Updated dependencies [032cb66]
|
|
133
|
+
- Updated dependencies [703ac71]
|
|
134
|
+
- Updated dependencies [a723d69]
|
|
135
|
+
- Updated dependencies [7827943]
|
|
136
|
+
- Updated dependencies [5889a31]
|
|
137
|
+
- Updated dependencies [bf1e7e7]
|
|
138
|
+
- Updated dependencies [65e3395]
|
|
139
|
+
- Updated dependencies [4933192]
|
|
140
|
+
- Updated dependencies [d1c77a4]
|
|
141
|
+
- Updated dependencies [bea9dd1]
|
|
142
|
+
- Updated dependencies [dcd4802]
|
|
143
|
+
- Updated dependencies [cbddd18]
|
|
144
|
+
- Updated dependencies [7ba91fa]
|
|
145
|
+
- @mastra/core@0.11.0
|
|
146
|
+
|
|
147
|
+
## 0.11.5-alpha.0
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- a723d69: Pass workflowId through
|
|
152
|
+
- Updated dependencies [f248d53]
|
|
153
|
+
- Updated dependencies [2affc57]
|
|
154
|
+
- Updated dependencies [66e13e3]
|
|
155
|
+
- Updated dependencies [edd9482]
|
|
156
|
+
- Updated dependencies [18344d7]
|
|
157
|
+
- Updated dependencies [9d372c2]
|
|
158
|
+
- Updated dependencies [40c2525]
|
|
159
|
+
- Updated dependencies [e473f27]
|
|
160
|
+
- Updated dependencies [032cb66]
|
|
161
|
+
- Updated dependencies [703ac71]
|
|
162
|
+
- Updated dependencies [a723d69]
|
|
163
|
+
- Updated dependencies [5889a31]
|
|
164
|
+
- Updated dependencies [65e3395]
|
|
165
|
+
- Updated dependencies [4933192]
|
|
166
|
+
- Updated dependencies [d1c77a4]
|
|
167
|
+
- Updated dependencies [bea9dd1]
|
|
168
|
+
- Updated dependencies [dcd4802]
|
|
169
|
+
- Updated dependencies [7ba91fa]
|
|
170
|
+
- @mastra/core@0.11.0-alpha.2
|
|
171
|
+
|
|
172
|
+
## 0.11.4
|
|
173
|
+
|
|
174
|
+
### Patch Changes
|
|
175
|
+
|
|
176
|
+
- 0b56518: Ensure removed runtimeContext values are not saved in snapshot
|
|
177
|
+
- Updated dependencies [0b56518]
|
|
178
|
+
- Updated dependencies [db5cc15]
|
|
179
|
+
- Updated dependencies [2ba5b76]
|
|
180
|
+
- Updated dependencies [5237998]
|
|
181
|
+
- Updated dependencies [c3a30de]
|
|
182
|
+
- Updated dependencies [37c1acd]
|
|
183
|
+
- Updated dependencies [1aa60b1]
|
|
184
|
+
- Updated dependencies [89ec9d4]
|
|
185
|
+
- Updated dependencies [cf3a184]
|
|
186
|
+
- Updated dependencies [d6bfd60]
|
|
187
|
+
- Updated dependencies [626b0f4]
|
|
188
|
+
- Updated dependencies [c22a91f]
|
|
189
|
+
- Updated dependencies [f7403ab]
|
|
190
|
+
- Updated dependencies [6c89d7f]
|
|
191
|
+
- @mastra/core@0.10.15
|
|
192
|
+
|
|
193
|
+
## 0.11.4-alpha.0
|
|
194
|
+
|
|
195
|
+
### Patch Changes
|
|
196
|
+
|
|
197
|
+
- 0b56518: Ensure removed runtimeContext values are not saved in snapshot
|
|
198
|
+
- Updated dependencies [0b56518]
|
|
199
|
+
- Updated dependencies [2ba5b76]
|
|
200
|
+
- Updated dependencies [c3a30de]
|
|
201
|
+
- Updated dependencies [cf3a184]
|
|
202
|
+
- Updated dependencies [d6bfd60]
|
|
203
|
+
- @mastra/core@0.10.15-alpha.1
|
|
204
|
+
|
|
205
|
+
## 0.11.3
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- 515488a: dependencies updates:
|
|
210
|
+
- Updated dependency [`inngest@^3.39.2` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.2) (from `^3.39.1`, in `dependencies`)
|
|
211
|
+
- defb5ae: dependencies updates:
|
|
212
|
+
- Updated dependency [`inngest@^3.40.0` ↗︎](https://www.npmjs.com/package/inngest/v/3.40.0) (from `^3.39.2`, in `dependencies`)
|
|
213
|
+
- b790fd1: Ability to pass a function to .sleep()/.sleepUntil()
|
|
214
|
+
- c1cceea: Bump peerdeps of @matra/core
|
|
215
|
+
- Updated dependencies [2873c7f]
|
|
216
|
+
- Updated dependencies [1c1c6a1]
|
|
217
|
+
- Updated dependencies [f8ce2cc]
|
|
218
|
+
- Updated dependencies [8c846b6]
|
|
219
|
+
- Updated dependencies [c7bbf1e]
|
|
220
|
+
- Updated dependencies [8722d53]
|
|
221
|
+
- Updated dependencies [565cc0c]
|
|
222
|
+
- Updated dependencies [b790fd1]
|
|
223
|
+
- Updated dependencies [132027f]
|
|
224
|
+
- Updated dependencies [0c85311]
|
|
225
|
+
- Updated dependencies [d7ed04d]
|
|
226
|
+
- Updated dependencies [cb16baf]
|
|
227
|
+
- Updated dependencies [f36e4f1]
|
|
228
|
+
- Updated dependencies [7f6e403]
|
|
229
|
+
- @mastra/core@0.10.11
|
|
230
|
+
|
|
231
|
+
## 0.11.3-alpha.3
|
|
232
|
+
|
|
233
|
+
### Patch Changes
|
|
234
|
+
|
|
235
|
+
- c1cceea: Bump peerdeps of @matra/core
|
|
236
|
+
- @mastra/core@0.10.11-alpha.4
|
|
237
|
+
|
|
238
|
+
## 0.11.3-alpha.2
|
|
239
|
+
|
|
240
|
+
### Patch Changes
|
|
241
|
+
|
|
242
|
+
- defb5ae: dependencies updates:
|
|
243
|
+
- Updated dependency [`inngest@^3.40.0` ↗︎](https://www.npmjs.com/package/inngest/v/3.40.0) (from `^3.39.2`, in `dependencies`)
|
|
244
|
+
- Updated dependencies [c7bbf1e]
|
|
245
|
+
- Updated dependencies [8722d53]
|
|
246
|
+
- Updated dependencies [132027f]
|
|
247
|
+
- Updated dependencies [0c85311]
|
|
248
|
+
- Updated dependencies [cb16baf]
|
|
249
|
+
- @mastra/core@0.10.11-alpha.3
|
|
250
|
+
|
|
251
|
+
## 0.11.3-alpha.1
|
|
252
|
+
|
|
253
|
+
### Patch Changes
|
|
254
|
+
|
|
255
|
+
- 515488a: dependencies updates:
|
|
256
|
+
- Updated dependency [`inngest@^3.39.2` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.2) (from `^3.39.1`, in `dependencies`)
|
|
257
|
+
- Updated dependencies [7f6e403]
|
|
258
|
+
- @mastra/core@0.10.11-alpha.1
|
|
259
|
+
|
|
260
|
+
## 0.11.3-alpha.0
|
|
261
|
+
|
|
262
|
+
### Patch Changes
|
|
263
|
+
|
|
264
|
+
- b790fd1: Ability to pass a function to .sleep()/.sleepUntil()
|
|
265
|
+
- Updated dependencies [f8ce2cc]
|
|
266
|
+
- Updated dependencies [8c846b6]
|
|
267
|
+
- Updated dependencies [b790fd1]
|
|
268
|
+
- Updated dependencies [d7ed04d]
|
|
269
|
+
- Updated dependencies [f36e4f1]
|
|
270
|
+
- @mastra/core@0.10.11-alpha.0
|
|
271
|
+
|
|
272
|
+
## 0.11.2
|
|
4
273
|
|
|
5
274
|
### Patch Changes
|
|
6
275
|
|
|
7
276
|
- 48d9738: Fix inngest sleep stream events
|
|
8
277
|
- Updated dependencies [4d3fbdf]
|
|
9
|
-
- @mastra/core@0.
|
|
278
|
+
- @mastra/core@0.10.10
|
|
10
279
|
|
|
11
280
|
## 0.11.2-alpha.0
|
|
12
281
|
|
package/LICENSE.md
CHANGED
|
@@ -1,46 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Apache License 2.0
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025
|
|
3
|
+
Copyright (c) 2025 Kepler Software, Inc.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
|
|
17
|
-
|
|
18
|
-
**Patents**
|
|
19
|
-
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
20
|
-
|
|
21
|
-
**Notices**
|
|
22
|
-
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
|
|
23
|
-
|
|
24
|
-
If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
|
|
25
|
-
|
|
26
|
-
**No Other Rights**
|
|
27
|
-
These terms do not imply any licenses other than those expressly granted in these terms.
|
|
28
|
-
|
|
29
|
-
**Termination**
|
|
30
|
-
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
|
|
31
|
-
|
|
32
|
-
**No Liability**
|
|
33
|
-
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
|
|
34
|
-
|
|
35
|
-
**Definitions**
|
|
36
|
-
The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
|
|
37
|
-
|
|
38
|
-
_you_ refers to the individual or entity agreeing to these terms.
|
|
39
|
-
|
|
40
|
-
_your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
41
|
-
|
|
42
|
-
_your licenses_ are all the licenses granted to you for the software under these terms.
|
|
43
|
-
|
|
44
|
-
_use_ means anything you do with the software requiring one of your licenses.
|
|
45
|
-
|
|
46
|
-
_trademark_ means trademarks, service marks, and similar rights.
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
package/dist/index.cjs
CHANGED
|
@@ -155,6 +155,7 @@ var InngestRun = class extends workflows.Run {
|
|
|
155
155
|
data: {
|
|
156
156
|
inputData: params.resumeData,
|
|
157
157
|
runId: this.runId,
|
|
158
|
+
workflowId: this.workflowId,
|
|
158
159
|
stepResults: snapshot?.context,
|
|
159
160
|
resume: {
|
|
160
161
|
steps,
|
|
@@ -650,7 +651,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
650
651
|
prevOutput,
|
|
651
652
|
emitter,
|
|
652
653
|
abortController,
|
|
653
|
-
runtimeContext
|
|
654
|
+
runtimeContext,
|
|
655
|
+
writableStream
|
|
654
656
|
}) {
|
|
655
657
|
return super.executeStep({
|
|
656
658
|
workflowId,
|
|
@@ -662,11 +664,131 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
662
664
|
prevOutput,
|
|
663
665
|
emitter,
|
|
664
666
|
abortController,
|
|
665
|
-
runtimeContext
|
|
667
|
+
runtimeContext,
|
|
668
|
+
writableStream
|
|
666
669
|
});
|
|
667
670
|
}
|
|
668
|
-
async executeSleep({ id, duration }) {
|
|
669
|
-
|
|
671
|
+
// async executeSleep({ id, duration }: { id: string; duration: number }): Promise<void> {
|
|
672
|
+
// await this.inngestStep.sleep(id, duration);
|
|
673
|
+
// }
|
|
674
|
+
async executeSleep({
|
|
675
|
+
workflowId,
|
|
676
|
+
runId,
|
|
677
|
+
entry,
|
|
678
|
+
prevOutput,
|
|
679
|
+
stepResults,
|
|
680
|
+
emitter,
|
|
681
|
+
abortController,
|
|
682
|
+
runtimeContext,
|
|
683
|
+
writableStream
|
|
684
|
+
}) {
|
|
685
|
+
let { duration, fn } = entry;
|
|
686
|
+
if (fn) {
|
|
687
|
+
const stepCallId = crypto.randomUUID();
|
|
688
|
+
duration = await this.inngestStep.run(`workflow.${workflowId}.sleep.${entry.id}`, async () => {
|
|
689
|
+
return await fn({
|
|
690
|
+
runId,
|
|
691
|
+
workflowId,
|
|
692
|
+
mastra: this.mastra,
|
|
693
|
+
runtimeContext,
|
|
694
|
+
inputData: prevOutput,
|
|
695
|
+
runCount: -1,
|
|
696
|
+
getInitData: () => stepResults?.input,
|
|
697
|
+
getStepResult: (step) => {
|
|
698
|
+
if (!step?.id) {
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
const result = stepResults[step.id];
|
|
702
|
+
if (result?.status === "success") {
|
|
703
|
+
return result.output;
|
|
704
|
+
}
|
|
705
|
+
return null;
|
|
706
|
+
},
|
|
707
|
+
// TODO: this function shouldn't have suspend probably?
|
|
708
|
+
suspend: async (_suspendPayload) => {
|
|
709
|
+
},
|
|
710
|
+
bail: () => {
|
|
711
|
+
},
|
|
712
|
+
abort: () => {
|
|
713
|
+
abortController?.abort();
|
|
714
|
+
},
|
|
715
|
+
[_constants.EMITTER_SYMBOL]: emitter,
|
|
716
|
+
engine: { step: this.inngestStep },
|
|
717
|
+
abortSignal: abortController?.signal,
|
|
718
|
+
writer: new tools.ToolStream(
|
|
719
|
+
{
|
|
720
|
+
prefix: "step",
|
|
721
|
+
callId: stepCallId,
|
|
722
|
+
name: "sleep",
|
|
723
|
+
runId
|
|
724
|
+
},
|
|
725
|
+
writableStream
|
|
726
|
+
)
|
|
727
|
+
});
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
await this.inngestStep.sleep(entry.id, !duration || duration < 0 ? 0 : duration);
|
|
731
|
+
}
|
|
732
|
+
async executeSleepUntil({
|
|
733
|
+
workflowId,
|
|
734
|
+
runId,
|
|
735
|
+
entry,
|
|
736
|
+
prevOutput,
|
|
737
|
+
stepResults,
|
|
738
|
+
emitter,
|
|
739
|
+
abortController,
|
|
740
|
+
runtimeContext,
|
|
741
|
+
writableStream
|
|
742
|
+
}) {
|
|
743
|
+
let { date, fn } = entry;
|
|
744
|
+
if (fn) {
|
|
745
|
+
date = await this.inngestStep.run(`workflow.${workflowId}.sleepUntil.${entry.id}`, async () => {
|
|
746
|
+
const stepCallId = crypto.randomUUID();
|
|
747
|
+
return await fn({
|
|
748
|
+
runId,
|
|
749
|
+
workflowId,
|
|
750
|
+
mastra: this.mastra,
|
|
751
|
+
runtimeContext,
|
|
752
|
+
inputData: prevOutput,
|
|
753
|
+
runCount: -1,
|
|
754
|
+
getInitData: () => stepResults?.input,
|
|
755
|
+
getStepResult: (step) => {
|
|
756
|
+
if (!step?.id) {
|
|
757
|
+
return null;
|
|
758
|
+
}
|
|
759
|
+
const result = stepResults[step.id];
|
|
760
|
+
if (result?.status === "success") {
|
|
761
|
+
return result.output;
|
|
762
|
+
}
|
|
763
|
+
return null;
|
|
764
|
+
},
|
|
765
|
+
// TODO: this function shouldn't have suspend probably?
|
|
766
|
+
suspend: async (_suspendPayload) => {
|
|
767
|
+
},
|
|
768
|
+
bail: () => {
|
|
769
|
+
},
|
|
770
|
+
abort: () => {
|
|
771
|
+
abortController?.abort();
|
|
772
|
+
},
|
|
773
|
+
[_constants.EMITTER_SYMBOL]: emitter,
|
|
774
|
+
engine: { step: this.inngestStep },
|
|
775
|
+
abortSignal: abortController?.signal,
|
|
776
|
+
writer: new tools.ToolStream(
|
|
777
|
+
{
|
|
778
|
+
prefix: "step",
|
|
779
|
+
callId: stepCallId,
|
|
780
|
+
name: "sleep",
|
|
781
|
+
runId
|
|
782
|
+
},
|
|
783
|
+
writableStream
|
|
784
|
+
)
|
|
785
|
+
});
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
if (!(date instanceof Date)) {
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
await this.inngestStep.sleepUntil(entry.id, date);
|
|
670
792
|
}
|
|
671
793
|
async executeWaitForEvent({ event, timeout }) {
|
|
672
794
|
const eventData = await this.inngestStep.waitForEvent(`user-event-${event}`, {
|
|
@@ -686,7 +808,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
686
808
|
prevOutput,
|
|
687
809
|
emitter,
|
|
688
810
|
abortController,
|
|
689
|
-
runtimeContext
|
|
811
|
+
runtimeContext,
|
|
812
|
+
writableStream
|
|
690
813
|
}) {
|
|
691
814
|
const startedAt = await this.inngestStep.run(
|
|
692
815
|
`workflow.${executionContext.workflowId}.run.${executionContext.runId}.step.${step.id}.running_ev`,
|
|
@@ -905,6 +1028,7 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
905
1028
|
runId: executionContext.runId,
|
|
906
1029
|
mastra: this.mastra,
|
|
907
1030
|
runtimeContext,
|
|
1031
|
+
writableStream,
|
|
908
1032
|
inputData: prevOutput,
|
|
909
1033
|
resumeData: resume?.steps[0] === step.id ? resume?.resumePayload : void 0,
|
|
910
1034
|
getInitData: () => stepResults?.input,
|
|
@@ -1064,7 +1188,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1064
1188
|
executionContext,
|
|
1065
1189
|
emitter,
|
|
1066
1190
|
abortController,
|
|
1067
|
-
runtimeContext
|
|
1191
|
+
runtimeContext,
|
|
1192
|
+
writableStream
|
|
1068
1193
|
}) {
|
|
1069
1194
|
let execResults;
|
|
1070
1195
|
const truthyIndexes = (await Promise.all(
|
|
@@ -1073,6 +1198,7 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1073
1198
|
try {
|
|
1074
1199
|
const result = await cond({
|
|
1075
1200
|
runId,
|
|
1201
|
+
workflowId,
|
|
1076
1202
|
mastra: this.mastra,
|
|
1077
1203
|
runtimeContext,
|
|
1078
1204
|
runCount: -1,
|
|
@@ -1100,7 +1226,16 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1100
1226
|
engine: {
|
|
1101
1227
|
step: this.inngestStep
|
|
1102
1228
|
},
|
|
1103
|
-
abortSignal: abortController.signal
|
|
1229
|
+
abortSignal: abortController.signal,
|
|
1230
|
+
writer: new tools.ToolStream(
|
|
1231
|
+
{
|
|
1232
|
+
prefix: "step",
|
|
1233
|
+
callId: crypto.randomUUID(),
|
|
1234
|
+
name: "conditional",
|
|
1235
|
+
runId
|
|
1236
|
+
},
|
|
1237
|
+
writableStream
|
|
1238
|
+
)
|
|
1104
1239
|
});
|
|
1105
1240
|
return result ? index : null;
|
|
1106
1241
|
} catch (e) {
|
|
@@ -1130,7 +1265,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1130
1265
|
},
|
|
1131
1266
|
emitter,
|
|
1132
1267
|
abortController,
|
|
1133
|
-
runtimeContext
|
|
1268
|
+
runtimeContext,
|
|
1269
|
+
writableStream
|
|
1134
1270
|
})
|
|
1135
1271
|
)
|
|
1136
1272
|
);
|
|
@@ -1161,3 +1297,5 @@ exports.InngestWorkflow = InngestWorkflow;
|
|
|
1161
1297
|
exports.createStep = createStep;
|
|
1162
1298
|
exports.init = init;
|
|
1163
1299
|
exports.serve = serve;
|
|
1300
|
+
//# sourceMappingURL=index.cjs.map
|
|
1301
|
+
//# sourceMappingURL=index.cjs.map
|