@mastra/inngest 0.0.0-fix-model-router-machine-cache-20251021232825 → 0.0.0-fix-memory-search-fetch-20251027160505
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 +61 -3
- package/dist/index.cjs +203 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +204 -116
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
# @mastra/inngest
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-memory-search-fetch-20251027160505
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Removed old tracing code based on OpenTelemetry ([#9237](https://github.com/mastra-ai/mastra/pull/9237))
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- Update peer dependencies to match core package version bump (1.0.0) ([#9237](https://github.com/mastra-ai/mastra/pull/9237))
|
|
12
|
+
|
|
13
|
+
- Update peer dependencies to match core package version bump (0.22.1) ([#8649](https://github.com/mastra-ai/mastra/pull/8649))
|
|
14
|
+
|
|
15
|
+
- Update peer dependencies to match core package version bump (0.22.3) ([#9153](https://github.com/mastra-ai/mastra/pull/9153))
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Deprecate `runCount` parameter in favor of `retryCount` for better naming clarity. The name `runCount` was misleading as it doesn't represent the total number of times a step has run, but rather the number of retry attempts made for a step. ([#9153](https://github.com/mastra-ai/mastra/pull/9153))
|
|
20
|
+
|
|
21
|
+
`runCount` is available in `execute()` functions and methods that interact with the step execution. This also applies to condition functions and loop condition functions that use this parameter. If your code uses `runCount`, change the name to `retryCount`.
|
|
22
|
+
|
|
23
|
+
Here's an example migration:
|
|
24
|
+
|
|
25
|
+
```diff
|
|
26
|
+
const myStep = createStep({
|
|
27
|
+
// Rest of step...
|
|
28
|
+
- execute: async ({ runCount, ...params }) => {
|
|
29
|
+
+ execute: async ({ retryCount, ...params }) => {
|
|
30
|
+
// ... rest of your logic
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- Add tool call approval ([#8649](https://github.com/mastra-ai/mastra/pull/8649))
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [[`f743dbb`](https://github.com/mastra-ai/mastra/commit/f743dbb8b40d1627b5c10c0e6fc154f4ebb6e394), [`6c049d9`](https://github.com/mastra-ai/mastra/commit/6c049d94063fdcbd5b81c4912a2bf82a92c9cc0b), [`9e1911d`](https://github.com/mastra-ai/mastra/commit/9e1911db2b4db85e0e768c3f15e0d61e319869f6), [`ebac155`](https://github.com/mastra-ai/mastra/commit/ebac15564a590117db7078233f927a7e28a85106), [`9d819d5`](https://github.com/mastra-ai/mastra/commit/9d819d54b61481639f4008e4694791bddf187edd), [`5df9cce`](https://github.com/mastra-ai/mastra/commit/5df9cce1a753438413f64c11eeef8f845745c2a8), [`c576fc0`](https://github.com/mastra-ai/mastra/commit/c576fc0b100b2085afded91a37c97a0ea0ec09c7), [`57d157f`](https://github.com/mastra-ai/mastra/commit/57d157f0b163a95c3e6c9eae31bdb11d1bfc64f9), [`cfae733`](https://github.com/mastra-ai/mastra/commit/cfae73394f4920635e6c919c8e95ff9a0788e2e5), [`e3dfda7`](https://github.com/mastra-ai/mastra/commit/e3dfda7b11bf3b8c4bb55637028befb5f387fc74), [`f0f8f12`](https://github.com/mastra-ai/mastra/commit/f0f8f125c308f2d0fd36942ef652fd852df7522f), [`d36cfbb`](https://github.com/mastra-ai/mastra/commit/d36cfbbb6565ba5f827883cc9bb648eb14befdc1), [`53d927c`](https://github.com/mastra-ai/mastra/commit/53d927cc6f03bff33655b7e2b788da445a08731d), [`c7f1f7d`](https://github.com/mastra-ai/mastra/commit/c7f1f7d24f61f247f018cc2d1f33bf63212959a7), [`2c4438b`](https://github.com/mastra-ai/mastra/commit/2c4438b87817ab7eed818c7990fef010475af1a3), [`fa8409b`](https://github.com/mastra-ai/mastra/commit/fa8409bc39cfd8ba6643b9db5269b90b22e2a2f7), [`173c535`](https://github.com/mastra-ai/mastra/commit/173c535c0645b0da404fe09f003778f0b0d4e019)]:
|
|
38
|
+
- @mastra/core@0.0.0-fix-memory-search-fetch-20251027160505
|
|
39
|
+
|
|
40
|
+
## 0.17.0
|
|
4
41
|
|
|
5
42
|
### Minor Changes
|
|
6
43
|
|
|
44
|
+
- Consolidate streamVNext logic into stream, move old stream function into streamLegacy ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
|
|
45
|
+
|
|
46
|
+
- Update peer dependencies to match core package version bump (0.22.0) ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
|
|
47
|
+
|
|
7
48
|
- Update peer dependencies to match core package version bump (0.21.2) ([#8941](https://github.com/mastra-ai/mastra/pull/8941))
|
|
8
49
|
|
|
9
50
|
### Patch Changes
|
|
@@ -14,8 +55,25 @@
|
|
|
14
55
|
|
|
15
56
|
- Update peerdeps to 0.23.0-0 ([#9043](https://github.com/mastra-ai/mastra/pull/9043))
|
|
16
57
|
|
|
17
|
-
- Updated dependencies [[`c67ca32`](https://github.com/mastra-ai/mastra/commit/c67ca32e3c2cf69bfc146580770c720220ca44ac), [`efb5ed9`](https://github.com/mastra-ai/mastra/commit/efb5ed946ae7f410bc68c9430beb4b010afd25ec), [`dbc9e12`](https://github.com/mastra-ai/mastra/commit/dbc9e1216ba575ba59ead4afb727a01215f7de4f), [`99e41b9`](https://github.com/mastra-ai/mastra/commit/99e41b94957cdd25137d3ac12e94e8b21aa01b68), [`c28833c`](https://github.com/mastra-ai/mastra/commit/c28833c5b6d8e10eeffd7f7d39129d53b8bca240), [`ba201b8`](https://github.com/mastra-ai/mastra/commit/ba201b8f8feac4c72350f2dbd52c13c7297ba7b0), [`f053e89`](https://github.com/mastra-ai/mastra/commit/f053e89160dbd0bd3333fc3492f68231b5c7c349), [`4fc4136`](https://github.com/mastra-ai/mastra/commit/4fc413652866a8d2240694fddb2562e9edbb70df), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`d10baf5`](https://github.com/mastra-ai/mastra/commit/d10baf5a3c924f2a6654e23a3e318ed03f189b76), [`038c55a`](https://github.com/mastra-ai/mastra/commit/038c55a7090fc1b1513a966386d3072617f836ac), [`182f045`](https://github.com/mastra-ai/mastra/commit/182f0458f25bd70aa774e64fd923c8a483eddbf1), [`9a1a485`](https://github.com/mastra-ai/mastra/commit/9a1a4859b855e37239f652bf14b1ecd1029b8c4e), [`9257233`](https://github.com/mastra-ai/mastra/commit/9257233c4ffce09b2bedc2a9adbd70d7a83fa8e2), [`7620d2b`](https://github.com/mastra-ai/mastra/commit/7620d2bddeb4fae4c3c0a0b4e672969795fca11a), [`b2365f0`](https://github.com/mastra-ai/mastra/commit/b2365f038dd4c5f06400428b224af963f399ad50), [`0f1a4c9`](https://github.com/mastra-ai/mastra/commit/0f1a4c984fb4b104b2f0b63ba18c9fa77f567700), [`9029ba3`](https://github.com/mastra-ai/mastra/commit/9029ba34459c8859fed4c6b73efd8e2d0021e7ba), [`426cc56`](https://github.com/mastra-ai/mastra/commit/426cc561c85ae76a112ded2385532a91f9f9f074), [`00931fb`](https://github.com/mastra-ai/mastra/commit/00931fb1a21aa42c4fbc20c2c40dd62466b8fc8f), [`e473bfe`](https://github.com/mastra-ai/mastra/commit/e473bfe416c0b8e876973c2b6a6f13c394b7a93f), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`2db6160`](https://github.com/mastra-ai/mastra/commit/2db6160e2022ff8827c15d30157e684683b934b5), [`8aeea37`](https://github.com/mastra-ai/mastra/commit/8aeea37efdde347c635a67fed56794943b7f74ec), [`02fe153`](https://github.com/mastra-ai/mastra/commit/02fe15351d6021d214da48ec982a0e9e4150bcee), [`648e2ca`](https://github.com/mastra-ai/mastra/commit/648e2ca42da54838c6ccbdaadc6fadd808fa6b86), [`74567b3`](https://github.com/mastra-ai/mastra/commit/74567b3d237ae3915cd0bca3cf55fa0a64e4e4a4), [`b65c5e0`](https://github.com/mastra-ai/mastra/commit/b65c5e0fe6f3c390a9a8bbcf69304d972c3a4afb), [`15a1733`](https://github.com/mastra-ai/mastra/commit/15a1733074cee8bd37370e1af34cd818e89fa7ac), [`fc2a774`](https://github.com/mastra-ai/mastra/commit/fc2a77468981aaddc3e77f83f0c4ad4a4af140da), [`4e08933`](https://github.com/mastra-ai/mastra/commit/4e08933625464dfde178347af5b6278fcf34188e)]:
|
|
18
|
-
- @mastra/core@0.
|
|
58
|
+
- Updated dependencies [[`c67ca32`](https://github.com/mastra-ai/mastra/commit/c67ca32e3c2cf69bfc146580770c720220ca44ac), [`efb5ed9`](https://github.com/mastra-ai/mastra/commit/efb5ed946ae7f410bc68c9430beb4b010afd25ec), [`dbc9e12`](https://github.com/mastra-ai/mastra/commit/dbc9e1216ba575ba59ead4afb727a01215f7de4f), [`99e41b9`](https://github.com/mastra-ai/mastra/commit/99e41b94957cdd25137d3ac12e94e8b21aa01b68), [`c28833c`](https://github.com/mastra-ai/mastra/commit/c28833c5b6d8e10eeffd7f7d39129d53b8bca240), [`8ea07b4`](https://github.com/mastra-ai/mastra/commit/8ea07b4bdc73e4218437dbb6dcb0f4b23e745a44), [`ba201b8`](https://github.com/mastra-ai/mastra/commit/ba201b8f8feac4c72350f2dbd52c13c7297ba7b0), [`f053e89`](https://github.com/mastra-ai/mastra/commit/f053e89160dbd0bd3333fc3492f68231b5c7c349), [`4fc4136`](https://github.com/mastra-ai/mastra/commit/4fc413652866a8d2240694fddb2562e9edbb70df), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`d10baf5`](https://github.com/mastra-ai/mastra/commit/d10baf5a3c924f2a6654e23a3e318ed03f189b76), [`038c55a`](https://github.com/mastra-ai/mastra/commit/038c55a7090fc1b1513a966386d3072617f836ac), [`182f045`](https://github.com/mastra-ai/mastra/commit/182f0458f25bd70aa774e64fd923c8a483eddbf1), [`9a1a485`](https://github.com/mastra-ai/mastra/commit/9a1a4859b855e37239f652bf14b1ecd1029b8c4e), [`9257233`](https://github.com/mastra-ai/mastra/commit/9257233c4ffce09b2bedc2a9adbd70d7a83fa8e2), [`7620d2b`](https://github.com/mastra-ai/mastra/commit/7620d2bddeb4fae4c3c0a0b4e672969795fca11a), [`b2365f0`](https://github.com/mastra-ai/mastra/commit/b2365f038dd4c5f06400428b224af963f399ad50), [`0f1a4c9`](https://github.com/mastra-ai/mastra/commit/0f1a4c984fb4b104b2f0b63ba18c9fa77f567700), [`9029ba3`](https://github.com/mastra-ai/mastra/commit/9029ba34459c8859fed4c6b73efd8e2d0021e7ba), [`426cc56`](https://github.com/mastra-ai/mastra/commit/426cc561c85ae76a112ded2385532a91f9f9f074), [`00931fb`](https://github.com/mastra-ai/mastra/commit/00931fb1a21aa42c4fbc20c2c40dd62466b8fc8f), [`e473bfe`](https://github.com/mastra-ai/mastra/commit/e473bfe416c0b8e876973c2b6a6f13c394b7a93f), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`2db6160`](https://github.com/mastra-ai/mastra/commit/2db6160e2022ff8827c15d30157e684683b934b5), [`8aeea37`](https://github.com/mastra-ai/mastra/commit/8aeea37efdde347c635a67fed56794943b7f74ec), [`02fe153`](https://github.com/mastra-ai/mastra/commit/02fe15351d6021d214da48ec982a0e9e4150bcee), [`648e2ca`](https://github.com/mastra-ai/mastra/commit/648e2ca42da54838c6ccbdaadc6fadd808fa6b86), [`74567b3`](https://github.com/mastra-ai/mastra/commit/74567b3d237ae3915cd0bca3cf55fa0a64e4e4a4), [`b65c5e0`](https://github.com/mastra-ai/mastra/commit/b65c5e0fe6f3c390a9a8bbcf69304d972c3a4afb), [`15a1733`](https://github.com/mastra-ai/mastra/commit/15a1733074cee8bd37370e1af34cd818e89fa7ac), [`fc2a774`](https://github.com/mastra-ai/mastra/commit/fc2a77468981aaddc3e77f83f0c4ad4a4af140da), [`4e08933`](https://github.com/mastra-ai/mastra/commit/4e08933625464dfde178347af5b6278fcf34188e)]:
|
|
59
|
+
- @mastra/core@0.22.0
|
|
60
|
+
|
|
61
|
+
## 0.17.0-alpha.1
|
|
62
|
+
|
|
63
|
+
### Minor Changes
|
|
64
|
+
|
|
65
|
+
- Consolidate streamVNext logic into stream, move old stream function into streamLegacy ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
|
|
66
|
+
|
|
67
|
+
- Update peer dependencies to match core package version bump (0.22.0) ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated `watch` and `watchAsync` methods to use proper function overloads instead of generic conditional types, ensuring compatibility with the base Run class signatures. ([#9048](https://github.com/mastra-ai/mastra/pull/9048))
|
|
72
|
+
|
|
73
|
+
- Update peerdeps to 0.23.0-0 ([#9043](https://github.com/mastra-ai/mastra/pull/9043))
|
|
74
|
+
|
|
75
|
+
- Updated dependencies [[`efb5ed9`](https://github.com/mastra-ai/mastra/commit/efb5ed946ae7f410bc68c9430beb4b010afd25ec), [`8ea07b4`](https://github.com/mastra-ai/mastra/commit/8ea07b4bdc73e4218437dbb6dcb0f4b23e745a44), [`ba201b8`](https://github.com/mastra-ai/mastra/commit/ba201b8f8feac4c72350f2dbd52c13c7297ba7b0), [`4fc4136`](https://github.com/mastra-ai/mastra/commit/4fc413652866a8d2240694fddb2562e9edbb70df), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`d10baf5`](https://github.com/mastra-ai/mastra/commit/d10baf5a3c924f2a6654e23a3e318ed03f189b76), [`038c55a`](https://github.com/mastra-ai/mastra/commit/038c55a7090fc1b1513a966386d3072617f836ac), [`182f045`](https://github.com/mastra-ai/mastra/commit/182f0458f25bd70aa774e64fd923c8a483eddbf1), [`7620d2b`](https://github.com/mastra-ai/mastra/commit/7620d2bddeb4fae4c3c0a0b4e672969795fca11a), [`b2365f0`](https://github.com/mastra-ai/mastra/commit/b2365f038dd4c5f06400428b224af963f399ad50), [`9029ba3`](https://github.com/mastra-ai/mastra/commit/9029ba34459c8859fed4c6b73efd8e2d0021e7ba), [`426cc56`](https://github.com/mastra-ai/mastra/commit/426cc561c85ae76a112ded2385532a91f9f9f074), [`00931fb`](https://github.com/mastra-ai/mastra/commit/00931fb1a21aa42c4fbc20c2c40dd62466b8fc8f), [`e473bfe`](https://github.com/mastra-ai/mastra/commit/e473bfe416c0b8e876973c2b6a6f13c394b7a93f), [`b78e04d`](https://github.com/mastra-ai/mastra/commit/b78e04d935a16ecb1e59c5c96e564903527edddd), [`648e2ca`](https://github.com/mastra-ai/mastra/commit/648e2ca42da54838c6ccbdaadc6fadd808fa6b86), [`b65c5e0`](https://github.com/mastra-ai/mastra/commit/b65c5e0fe6f3c390a9a8bbcf69304d972c3a4afb)]:
|
|
76
|
+
- @mastra/core@0.22.0-alpha.1
|
|
19
77
|
|
|
20
78
|
## 0.17.0-alpha.0
|
|
21
79
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var crypto = require('crypto');
|
|
4
|
+
var web = require('stream/web');
|
|
4
5
|
var realtime = require('@inngest/realtime');
|
|
5
6
|
var aiTracing = require('@mastra/core/ai-tracing');
|
|
6
7
|
var di = require('@mastra/core/di');
|
|
8
|
+
var stream = require('@mastra/core/stream');
|
|
7
9
|
var tools = require('@mastra/core/tools');
|
|
8
10
|
var workflows = require('@mastra/core/workflows');
|
|
9
11
|
var _constants = require('@mastra/core/workflows/_constants');
|
|
@@ -226,7 +228,7 @@ var InngestRun = class extends workflows.Run {
|
|
|
226
228
|
});
|
|
227
229
|
};
|
|
228
230
|
}
|
|
229
|
-
|
|
231
|
+
streamLegacy({ inputData, runtimeContext } = {}) {
|
|
230
232
|
const { readable, writable } = new TransformStream();
|
|
231
233
|
const writer = writable.getWriter();
|
|
232
234
|
const unwatch = this.watch(async (event) => {
|
|
@@ -261,6 +263,58 @@ var InngestRun = class extends workflows.Run {
|
|
|
261
263
|
getWorkflowState: () => this.executionResults
|
|
262
264
|
};
|
|
263
265
|
}
|
|
266
|
+
stream({
|
|
267
|
+
inputData,
|
|
268
|
+
runtimeContext,
|
|
269
|
+
closeOnSuspend = true
|
|
270
|
+
} = {}) {
|
|
271
|
+
const self = this;
|
|
272
|
+
let streamOutput;
|
|
273
|
+
const stream$1 = new web.ReadableStream({
|
|
274
|
+
async start(controller) {
|
|
275
|
+
const unwatch = self.watch(async ({ type, from = ChunkFrom.WORKFLOW, payload }) => {
|
|
276
|
+
controller.enqueue({
|
|
277
|
+
type,
|
|
278
|
+
runId: self.runId,
|
|
279
|
+
from,
|
|
280
|
+
payload: {
|
|
281
|
+
stepName: payload.id,
|
|
282
|
+
...payload
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}, "watch-v2");
|
|
286
|
+
self.closeStreamAction = async () => {
|
|
287
|
+
unwatch();
|
|
288
|
+
try {
|
|
289
|
+
await controller.close();
|
|
290
|
+
} catch (err) {
|
|
291
|
+
console.error("Error closing stream:", err);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
const executionResultsPromise = self.start({
|
|
295
|
+
inputData,
|
|
296
|
+
runtimeContext
|
|
297
|
+
});
|
|
298
|
+
const executionResults = await executionResultsPromise;
|
|
299
|
+
if (closeOnSuspend) {
|
|
300
|
+
self.closeStreamAction?.().catch(() => {
|
|
301
|
+
});
|
|
302
|
+
} else if (executionResults.status !== "suspended") {
|
|
303
|
+
self.closeStreamAction?.().catch(() => {
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
if (streamOutput) {
|
|
307
|
+
streamOutput.updateResults(executionResults);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
streamOutput = new stream.WorkflowRunOutput({
|
|
312
|
+
runId: this.runId,
|
|
313
|
+
workflowId: this.workflowId,
|
|
314
|
+
stream: stream$1
|
|
315
|
+
});
|
|
316
|
+
return streamOutput;
|
|
317
|
+
}
|
|
264
318
|
};
|
|
265
319
|
var InngestWorkflow = class _InngestWorkflow extends workflows.Workflow {
|
|
266
320
|
#mastra;
|
|
@@ -641,7 +695,7 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
641
695
|
});
|
|
642
696
|
return result;
|
|
643
697
|
}
|
|
644
|
-
async fmtReturnValue(
|
|
698
|
+
async fmtReturnValue(emitter, stepResults, lastOutput, error) {
|
|
645
699
|
const base = {
|
|
646
700
|
status: lastOutput.status,
|
|
647
701
|
steps: stepResults
|
|
@@ -695,7 +749,6 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
695
749
|
});
|
|
696
750
|
base.suspended = suspendedStepIds;
|
|
697
751
|
}
|
|
698
|
-
executionSpan?.end();
|
|
699
752
|
return base;
|
|
700
753
|
}
|
|
701
754
|
// async executeSleep({ id, duration }: { id: string; duration: number }): Promise<void> {
|
|
@@ -727,45 +780,55 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
727
780
|
if (fn) {
|
|
728
781
|
const stepCallId = crypto.randomUUID();
|
|
729
782
|
duration = await this.inngestStep.run(`workflow.${workflowId}.sleep.${entry.id}`, async () => {
|
|
730
|
-
return await fn(
|
|
731
|
-
|
|
732
|
-
workflowId,
|
|
733
|
-
mastra: this.mastra,
|
|
734
|
-
runtimeContext,
|
|
735
|
-
inputData: prevOutput,
|
|
736
|
-
state: executionContext.state,
|
|
737
|
-
setState: (state) => {
|
|
738
|
-
executionContext.state = state;
|
|
739
|
-
},
|
|
740
|
-
runCount: -1,
|
|
741
|
-
tracingContext: {
|
|
742
|
-
currentSpan: sleepSpan
|
|
743
|
-
},
|
|
744
|
-
getInitData: () => stepResults?.input,
|
|
745
|
-
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
746
|
-
// TODO: this function shouldn't have suspend probably?
|
|
747
|
-
suspend: async (_suspendPayload) => {
|
|
748
|
-
},
|
|
749
|
-
bail: () => {
|
|
750
|
-
},
|
|
751
|
-
abort: () => {
|
|
752
|
-
abortController?.abort();
|
|
753
|
-
},
|
|
754
|
-
[_constants.EMITTER_SYMBOL]: emitter,
|
|
755
|
-
// TODO: add streamVNext support
|
|
756
|
-
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
757
|
-
engine: { step: this.inngestStep },
|
|
758
|
-
abortSignal: abortController?.signal,
|
|
759
|
-
writer: new tools.ToolStream(
|
|
783
|
+
return await fn(
|
|
784
|
+
workflows.createDeprecationProxy(
|
|
760
785
|
{
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
786
|
+
runId,
|
|
787
|
+
workflowId,
|
|
788
|
+
mastra: this.mastra,
|
|
789
|
+
runtimeContext,
|
|
790
|
+
inputData: prevOutput,
|
|
791
|
+
state: executionContext.state,
|
|
792
|
+
setState: (state) => {
|
|
793
|
+
executionContext.state = state;
|
|
794
|
+
},
|
|
795
|
+
runCount: -1,
|
|
796
|
+
retryCount: -1,
|
|
797
|
+
tracingContext: {
|
|
798
|
+
currentSpan: sleepSpan
|
|
799
|
+
},
|
|
800
|
+
getInitData: () => stepResults?.input,
|
|
801
|
+
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
802
|
+
// TODO: this function shouldn't have suspend probably?
|
|
803
|
+
suspend: async (_suspendPayload) => {
|
|
804
|
+
},
|
|
805
|
+
bail: () => {
|
|
806
|
+
},
|
|
807
|
+
abort: () => {
|
|
808
|
+
abortController?.abort();
|
|
809
|
+
},
|
|
810
|
+
[_constants.EMITTER_SYMBOL]: emitter,
|
|
811
|
+
// TODO: add streamVNext support
|
|
812
|
+
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
813
|
+
engine: { step: this.inngestStep },
|
|
814
|
+
abortSignal: abortController?.signal,
|
|
815
|
+
writer: new tools.ToolStream(
|
|
816
|
+
{
|
|
817
|
+
prefix: "workflow-step",
|
|
818
|
+
callId: stepCallId,
|
|
819
|
+
name: "sleep",
|
|
820
|
+
runId
|
|
821
|
+
},
|
|
822
|
+
writableStream
|
|
823
|
+
)
|
|
765
824
|
},
|
|
766
|
-
|
|
825
|
+
{
|
|
826
|
+
paramName: "runCount",
|
|
827
|
+
deprecationMessage: workflows.runCountDeprecationMessage,
|
|
828
|
+
logger: this.logger
|
|
829
|
+
}
|
|
767
830
|
)
|
|
768
|
-
|
|
831
|
+
);
|
|
769
832
|
});
|
|
770
833
|
sleepSpan?.update({
|
|
771
834
|
attributes: {
|
|
@@ -808,45 +871,55 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
808
871
|
if (fn) {
|
|
809
872
|
date = await this.inngestStep.run(`workflow.${workflowId}.sleepUntil.${entry.id}`, async () => {
|
|
810
873
|
const stepCallId = crypto.randomUUID();
|
|
811
|
-
return await fn(
|
|
812
|
-
|
|
813
|
-
workflowId,
|
|
814
|
-
mastra: this.mastra,
|
|
815
|
-
runtimeContext,
|
|
816
|
-
inputData: prevOutput,
|
|
817
|
-
state: executionContext.state,
|
|
818
|
-
setState: (state) => {
|
|
819
|
-
executionContext.state = state;
|
|
820
|
-
},
|
|
821
|
-
runCount: -1,
|
|
822
|
-
tracingContext: {
|
|
823
|
-
currentSpan: sleepUntilSpan
|
|
824
|
-
},
|
|
825
|
-
getInitData: () => stepResults?.input,
|
|
826
|
-
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
827
|
-
// TODO: this function shouldn't have suspend probably?
|
|
828
|
-
suspend: async (_suspendPayload) => {
|
|
829
|
-
},
|
|
830
|
-
bail: () => {
|
|
831
|
-
},
|
|
832
|
-
abort: () => {
|
|
833
|
-
abortController?.abort();
|
|
834
|
-
},
|
|
835
|
-
[_constants.EMITTER_SYMBOL]: emitter,
|
|
836
|
-
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
837
|
-
// TODO: add streamVNext support
|
|
838
|
-
engine: { step: this.inngestStep },
|
|
839
|
-
abortSignal: abortController?.signal,
|
|
840
|
-
writer: new tools.ToolStream(
|
|
874
|
+
return await fn(
|
|
875
|
+
workflows.createDeprecationProxy(
|
|
841
876
|
{
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
877
|
+
runId,
|
|
878
|
+
workflowId,
|
|
879
|
+
mastra: this.mastra,
|
|
880
|
+
runtimeContext,
|
|
881
|
+
inputData: prevOutput,
|
|
882
|
+
state: executionContext.state,
|
|
883
|
+
setState: (state) => {
|
|
884
|
+
executionContext.state = state;
|
|
885
|
+
},
|
|
886
|
+
runCount: -1,
|
|
887
|
+
retryCount: -1,
|
|
888
|
+
tracingContext: {
|
|
889
|
+
currentSpan: sleepUntilSpan
|
|
890
|
+
},
|
|
891
|
+
getInitData: () => stepResults?.input,
|
|
892
|
+
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
893
|
+
// TODO: this function shouldn't have suspend probably?
|
|
894
|
+
suspend: async (_suspendPayload) => {
|
|
895
|
+
},
|
|
896
|
+
bail: () => {
|
|
897
|
+
},
|
|
898
|
+
abort: () => {
|
|
899
|
+
abortController?.abort();
|
|
900
|
+
},
|
|
901
|
+
[_constants.EMITTER_SYMBOL]: emitter,
|
|
902
|
+
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
903
|
+
// TODO: add streamVNext support
|
|
904
|
+
engine: { step: this.inngestStep },
|
|
905
|
+
abortSignal: abortController?.signal,
|
|
906
|
+
writer: new tools.ToolStream(
|
|
907
|
+
{
|
|
908
|
+
prefix: "workflow-step",
|
|
909
|
+
callId: stepCallId,
|
|
910
|
+
name: "sleep",
|
|
911
|
+
runId
|
|
912
|
+
},
|
|
913
|
+
writableStream
|
|
914
|
+
)
|
|
846
915
|
},
|
|
847
|
-
|
|
916
|
+
{
|
|
917
|
+
paramName: "runCount",
|
|
918
|
+
deprecationMessage: workflows.runCountDeprecationMessage,
|
|
919
|
+
logger: this.logger
|
|
920
|
+
}
|
|
848
921
|
)
|
|
849
|
-
|
|
922
|
+
);
|
|
850
923
|
});
|
|
851
924
|
if (date && !(date instanceof Date)) {
|
|
852
925
|
date = new Date(date);
|
|
@@ -1181,7 +1254,13 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1181
1254
|
suspend: async (suspendPayload, suspendOptions) => {
|
|
1182
1255
|
executionContext.suspendedPaths[step.id] = executionContext.executionPath;
|
|
1183
1256
|
if (suspendOptions?.resumeLabel) {
|
|
1184
|
-
|
|
1257
|
+
const resumeLabel = Array.isArray(suspendOptions.resumeLabel) ? suspendOptions.resumeLabel : [suspendOptions.resumeLabel];
|
|
1258
|
+
for (const label of resumeLabel) {
|
|
1259
|
+
executionContext.resumeLabels[label] = {
|
|
1260
|
+
stepId: step.id,
|
|
1261
|
+
foreachIndex: executionContext.foreachIndex
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1185
1264
|
}
|
|
1186
1265
|
suspended = { payload: suspendPayload };
|
|
1187
1266
|
},
|
|
@@ -1409,47 +1488,57 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1409
1488
|
tracingPolicy: this.options?.tracingPolicy
|
|
1410
1489
|
});
|
|
1411
1490
|
try {
|
|
1412
|
-
const result = await cond(
|
|
1413
|
-
|
|
1414
|
-
workflowId,
|
|
1415
|
-
mastra: this.mastra,
|
|
1416
|
-
runtimeContext,
|
|
1417
|
-
runCount: -1,
|
|
1418
|
-
inputData: prevOutput,
|
|
1419
|
-
state: executionContext.state,
|
|
1420
|
-
setState: (state) => {
|
|
1421
|
-
executionContext.state = state;
|
|
1422
|
-
},
|
|
1423
|
-
tracingContext: {
|
|
1424
|
-
currentSpan: evalSpan
|
|
1425
|
-
},
|
|
1426
|
-
getInitData: () => stepResults?.input,
|
|
1427
|
-
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
1428
|
-
// TODO: this function shouldn't have suspend probably?
|
|
1429
|
-
suspend: async (_suspendPayload) => {
|
|
1430
|
-
},
|
|
1431
|
-
bail: () => {
|
|
1432
|
-
},
|
|
1433
|
-
abort: () => {
|
|
1434
|
-
abortController.abort();
|
|
1435
|
-
},
|
|
1436
|
-
[_constants.EMITTER_SYMBOL]: emitter,
|
|
1437
|
-
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
1438
|
-
// TODO: add streamVNext support
|
|
1439
|
-
engine: {
|
|
1440
|
-
step: this.inngestStep
|
|
1441
|
-
},
|
|
1442
|
-
abortSignal: abortController.signal,
|
|
1443
|
-
writer: new tools.ToolStream(
|
|
1491
|
+
const result = await cond(
|
|
1492
|
+
workflows.createDeprecationProxy(
|
|
1444
1493
|
{
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1494
|
+
runId,
|
|
1495
|
+
workflowId,
|
|
1496
|
+
mastra: this.mastra,
|
|
1497
|
+
runtimeContext,
|
|
1498
|
+
runCount: -1,
|
|
1499
|
+
retryCount: -1,
|
|
1500
|
+
inputData: prevOutput,
|
|
1501
|
+
state: executionContext.state,
|
|
1502
|
+
setState: (state) => {
|
|
1503
|
+
executionContext.state = state;
|
|
1504
|
+
},
|
|
1505
|
+
tracingContext: {
|
|
1506
|
+
currentSpan: evalSpan
|
|
1507
|
+
},
|
|
1508
|
+
getInitData: () => stepResults?.input,
|
|
1509
|
+
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
1510
|
+
// TODO: this function shouldn't have suspend probably?
|
|
1511
|
+
suspend: async (_suspendPayload) => {
|
|
1512
|
+
},
|
|
1513
|
+
bail: () => {
|
|
1514
|
+
},
|
|
1515
|
+
abort: () => {
|
|
1516
|
+
abortController.abort();
|
|
1517
|
+
},
|
|
1518
|
+
[_constants.EMITTER_SYMBOL]: emitter,
|
|
1519
|
+
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
1520
|
+
// TODO: add streamVNext support
|
|
1521
|
+
engine: {
|
|
1522
|
+
step: this.inngestStep
|
|
1523
|
+
},
|
|
1524
|
+
abortSignal: abortController.signal,
|
|
1525
|
+
writer: new tools.ToolStream(
|
|
1526
|
+
{
|
|
1527
|
+
prefix: "workflow-step",
|
|
1528
|
+
callId: crypto.randomUUID(),
|
|
1529
|
+
name: "conditional",
|
|
1530
|
+
runId
|
|
1531
|
+
},
|
|
1532
|
+
writableStream
|
|
1533
|
+
)
|
|
1449
1534
|
},
|
|
1450
|
-
|
|
1535
|
+
{
|
|
1536
|
+
paramName: "runCount",
|
|
1537
|
+
deprecationMessage: workflows.runCountDeprecationMessage,
|
|
1538
|
+
logger: this.logger
|
|
1539
|
+
}
|
|
1451
1540
|
)
|
|
1452
|
-
|
|
1541
|
+
);
|
|
1453
1542
|
evalSpan?.end({
|
|
1454
1543
|
output: result,
|
|
1455
1544
|
attributes: {
|
|
@@ -1493,7 +1582,6 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1493
1582
|
suspendedPaths: executionContext.suspendedPaths,
|
|
1494
1583
|
resumeLabels: executionContext.resumeLabels,
|
|
1495
1584
|
retryConfig: executionContext.retryConfig,
|
|
1496
|
-
executionSpan: executionContext.executionSpan,
|
|
1497
1585
|
state: executionContext.state
|
|
1498
1586
|
},
|
|
1499
1587
|
emitter,
|