@mastra/inngest 0.0.0-error-handler-fix-20251020202607 → 0.0.0-extract-tool-ui-inp-playground-ui-20251023135343
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 +59 -3
- package/dist/index.cjs +202 -112
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +203 -113
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,73 @@
|
|
|
1
1
|
# @mastra/inngest
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-extract-tool-ui-inp-playground-ui-20251023135343
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
+
- Update peer dependencies to match core package version bump (0.22.1) ([#8649](https://github.com/mastra-ai/mastra/pull/8649))
|
|
8
|
+
|
|
9
|
+
- Update peer dependencies to match core package version bump (0.22.3) ([#9153](https://github.com/mastra-ai/mastra/pull/9153))
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 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))
|
|
14
|
+
|
|
15
|
+
`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`.
|
|
16
|
+
|
|
17
|
+
Here's an example migration:
|
|
18
|
+
|
|
19
|
+
```diff
|
|
20
|
+
const myStep = createStep({
|
|
21
|
+
// Rest of step...
|
|
22
|
+
- execute: async ({ runCount, ...params }) => {
|
|
23
|
+
+ execute: async ({ retryCount, ...params }) => {
|
|
24
|
+
// ... rest of your logic
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- Add tool call approval ([#8649](https://github.com/mastra-ai/mastra/pull/8649))
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`f743dbb`](https://github.com/mastra-ai/mastra/commit/f743dbb8b40d1627b5c10c0e6fc154f4ebb6e394), [`6c049d9`](https://github.com/mastra-ai/mastra/commit/6c049d94063fdcbd5b81c4912a2bf82a92c9cc0b), [`5df9cce`](https://github.com/mastra-ai/mastra/commit/5df9cce1a753438413f64c11eeef8f845745c2a8), [`2c4438b`](https://github.com/mastra-ai/mastra/commit/2c4438b87817ab7eed818c7990fef010475af1a3)]:
|
|
32
|
+
- @mastra/core@0.0.0-extract-tool-ui-inp-playground-ui-20251023135343
|
|
33
|
+
|
|
34
|
+
## 0.17.0
|
|
35
|
+
|
|
36
|
+
### Minor Changes
|
|
37
|
+
|
|
38
|
+
- Consolidate streamVNext logic into stream, move old stream function into streamLegacy ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
|
|
39
|
+
|
|
40
|
+
- Update peer dependencies to match core package version bump (0.22.0) ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
|
|
41
|
+
|
|
7
42
|
- Update peer dependencies to match core package version bump (0.21.2) ([#8941](https://github.com/mastra-ai/mastra/pull/8941))
|
|
8
43
|
|
|
9
44
|
### Patch Changes
|
|
10
45
|
|
|
46
|
+
- 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))
|
|
47
|
+
|
|
11
48
|
- Support for custom resume labels mapping to step to be resumed ([#8941](https://github.com/mastra-ai/mastra/pull/8941))
|
|
12
49
|
|
|
13
|
-
-
|
|
14
|
-
|
|
50
|
+
- Update peerdeps to 0.23.0-0 ([#9043](https://github.com/mastra-ai/mastra/pull/9043))
|
|
51
|
+
|
|
52
|
+
- 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)]:
|
|
53
|
+
- @mastra/core@0.22.0
|
|
54
|
+
|
|
55
|
+
## 0.17.0-alpha.1
|
|
56
|
+
|
|
57
|
+
### Minor Changes
|
|
58
|
+
|
|
59
|
+
- Consolidate streamVNext logic into stream, move old stream function into streamLegacy ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
|
|
60
|
+
|
|
61
|
+
- Update peer dependencies to match core package version bump (0.22.0) ([#9092](https://github.com/mastra-ai/mastra/pull/9092))
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- 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))
|
|
66
|
+
|
|
67
|
+
- Update peerdeps to 0.23.0-0 ([#9043](https://github.com/mastra-ai/mastra/pull/9043))
|
|
68
|
+
|
|
69
|
+
- 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)]:
|
|
70
|
+
- @mastra/core@0.22.0-alpha.1
|
|
15
71
|
|
|
16
72
|
## 0.17.0-alpha.0
|
|
17
73
|
|
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;
|
|
@@ -727,45 +781,55 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
727
781
|
if (fn) {
|
|
728
782
|
const stepCallId = crypto.randomUUID();
|
|
729
783
|
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(
|
|
784
|
+
return await fn(
|
|
785
|
+
workflows.createDeprecationProxy(
|
|
760
786
|
{
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
787
|
+
runId,
|
|
788
|
+
workflowId,
|
|
789
|
+
mastra: this.mastra,
|
|
790
|
+
runtimeContext,
|
|
791
|
+
inputData: prevOutput,
|
|
792
|
+
state: executionContext.state,
|
|
793
|
+
setState: (state) => {
|
|
794
|
+
executionContext.state = state;
|
|
795
|
+
},
|
|
796
|
+
runCount: -1,
|
|
797
|
+
retryCount: -1,
|
|
798
|
+
tracingContext: {
|
|
799
|
+
currentSpan: sleepSpan
|
|
800
|
+
},
|
|
801
|
+
getInitData: () => stepResults?.input,
|
|
802
|
+
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
803
|
+
// TODO: this function shouldn't have suspend probably?
|
|
804
|
+
suspend: async (_suspendPayload) => {
|
|
805
|
+
},
|
|
806
|
+
bail: () => {
|
|
807
|
+
},
|
|
808
|
+
abort: () => {
|
|
809
|
+
abortController?.abort();
|
|
810
|
+
},
|
|
811
|
+
[_constants.EMITTER_SYMBOL]: emitter,
|
|
812
|
+
// TODO: add streamVNext support
|
|
813
|
+
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
814
|
+
engine: { step: this.inngestStep },
|
|
815
|
+
abortSignal: abortController?.signal,
|
|
816
|
+
writer: new tools.ToolStream(
|
|
817
|
+
{
|
|
818
|
+
prefix: "workflow-step",
|
|
819
|
+
callId: stepCallId,
|
|
820
|
+
name: "sleep",
|
|
821
|
+
runId
|
|
822
|
+
},
|
|
823
|
+
writableStream
|
|
824
|
+
)
|
|
765
825
|
},
|
|
766
|
-
|
|
826
|
+
{
|
|
827
|
+
paramName: "runCount",
|
|
828
|
+
deprecationMessage: workflows.runCountDeprecationMessage,
|
|
829
|
+
logger: this.logger
|
|
830
|
+
}
|
|
767
831
|
)
|
|
768
|
-
|
|
832
|
+
);
|
|
769
833
|
});
|
|
770
834
|
sleepSpan?.update({
|
|
771
835
|
attributes: {
|
|
@@ -808,45 +872,55 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
808
872
|
if (fn) {
|
|
809
873
|
date = await this.inngestStep.run(`workflow.${workflowId}.sleepUntil.${entry.id}`, async () => {
|
|
810
874
|
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(
|
|
875
|
+
return await fn(
|
|
876
|
+
workflows.createDeprecationProxy(
|
|
841
877
|
{
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
878
|
+
runId,
|
|
879
|
+
workflowId,
|
|
880
|
+
mastra: this.mastra,
|
|
881
|
+
runtimeContext,
|
|
882
|
+
inputData: prevOutput,
|
|
883
|
+
state: executionContext.state,
|
|
884
|
+
setState: (state) => {
|
|
885
|
+
executionContext.state = state;
|
|
886
|
+
},
|
|
887
|
+
runCount: -1,
|
|
888
|
+
retryCount: -1,
|
|
889
|
+
tracingContext: {
|
|
890
|
+
currentSpan: sleepUntilSpan
|
|
891
|
+
},
|
|
892
|
+
getInitData: () => stepResults?.input,
|
|
893
|
+
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
894
|
+
// TODO: this function shouldn't have suspend probably?
|
|
895
|
+
suspend: async (_suspendPayload) => {
|
|
896
|
+
},
|
|
897
|
+
bail: () => {
|
|
898
|
+
},
|
|
899
|
+
abort: () => {
|
|
900
|
+
abortController?.abort();
|
|
901
|
+
},
|
|
902
|
+
[_constants.EMITTER_SYMBOL]: emitter,
|
|
903
|
+
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
904
|
+
// TODO: add streamVNext support
|
|
905
|
+
engine: { step: this.inngestStep },
|
|
906
|
+
abortSignal: abortController?.signal,
|
|
907
|
+
writer: new tools.ToolStream(
|
|
908
|
+
{
|
|
909
|
+
prefix: "workflow-step",
|
|
910
|
+
callId: stepCallId,
|
|
911
|
+
name: "sleep",
|
|
912
|
+
runId
|
|
913
|
+
},
|
|
914
|
+
writableStream
|
|
915
|
+
)
|
|
846
916
|
},
|
|
847
|
-
|
|
917
|
+
{
|
|
918
|
+
paramName: "runCount",
|
|
919
|
+
deprecationMessage: workflows.runCountDeprecationMessage,
|
|
920
|
+
logger: this.logger
|
|
921
|
+
}
|
|
848
922
|
)
|
|
849
|
-
|
|
923
|
+
);
|
|
850
924
|
});
|
|
851
925
|
if (date && !(date instanceof Date)) {
|
|
852
926
|
date = new Date(date);
|
|
@@ -1181,7 +1255,13 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1181
1255
|
suspend: async (suspendPayload, suspendOptions) => {
|
|
1182
1256
|
executionContext.suspendedPaths[step.id] = executionContext.executionPath;
|
|
1183
1257
|
if (suspendOptions?.resumeLabel) {
|
|
1184
|
-
|
|
1258
|
+
const resumeLabel = Array.isArray(suspendOptions.resumeLabel) ? suspendOptions.resumeLabel : [suspendOptions.resumeLabel];
|
|
1259
|
+
for (const label of resumeLabel) {
|
|
1260
|
+
executionContext.resumeLabels[label] = {
|
|
1261
|
+
stepId: step.id,
|
|
1262
|
+
foreachIndex: executionContext.foreachIndex
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1185
1265
|
}
|
|
1186
1266
|
suspended = { payload: suspendPayload };
|
|
1187
1267
|
},
|
|
@@ -1409,47 +1489,57 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
|
|
|
1409
1489
|
tracingPolicy: this.options?.tracingPolicy
|
|
1410
1490
|
});
|
|
1411
1491
|
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(
|
|
1492
|
+
const result = await cond(
|
|
1493
|
+
workflows.createDeprecationProxy(
|
|
1444
1494
|
{
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1495
|
+
runId,
|
|
1496
|
+
workflowId,
|
|
1497
|
+
mastra: this.mastra,
|
|
1498
|
+
runtimeContext,
|
|
1499
|
+
runCount: -1,
|
|
1500
|
+
retryCount: -1,
|
|
1501
|
+
inputData: prevOutput,
|
|
1502
|
+
state: executionContext.state,
|
|
1503
|
+
setState: (state) => {
|
|
1504
|
+
executionContext.state = state;
|
|
1505
|
+
},
|
|
1506
|
+
tracingContext: {
|
|
1507
|
+
currentSpan: evalSpan
|
|
1508
|
+
},
|
|
1509
|
+
getInitData: () => stepResults?.input,
|
|
1510
|
+
getStepResult: workflows.getStepResult.bind(this, stepResults),
|
|
1511
|
+
// TODO: this function shouldn't have suspend probably?
|
|
1512
|
+
suspend: async (_suspendPayload) => {
|
|
1513
|
+
},
|
|
1514
|
+
bail: () => {
|
|
1515
|
+
},
|
|
1516
|
+
abort: () => {
|
|
1517
|
+
abortController.abort();
|
|
1518
|
+
},
|
|
1519
|
+
[_constants.EMITTER_SYMBOL]: emitter,
|
|
1520
|
+
[_constants.STREAM_FORMAT_SYMBOL]: executionContext.format,
|
|
1521
|
+
// TODO: add streamVNext support
|
|
1522
|
+
engine: {
|
|
1523
|
+
step: this.inngestStep
|
|
1524
|
+
},
|
|
1525
|
+
abortSignal: abortController.signal,
|
|
1526
|
+
writer: new tools.ToolStream(
|
|
1527
|
+
{
|
|
1528
|
+
prefix: "workflow-step",
|
|
1529
|
+
callId: crypto.randomUUID(),
|
|
1530
|
+
name: "conditional",
|
|
1531
|
+
runId
|
|
1532
|
+
},
|
|
1533
|
+
writableStream
|
|
1534
|
+
)
|
|
1449
1535
|
},
|
|
1450
|
-
|
|
1536
|
+
{
|
|
1537
|
+
paramName: "runCount",
|
|
1538
|
+
deprecationMessage: workflows.runCountDeprecationMessage,
|
|
1539
|
+
logger: this.logger
|
|
1540
|
+
}
|
|
1451
1541
|
)
|
|
1452
|
-
|
|
1542
|
+
);
|
|
1453
1543
|
evalSpan?.end({
|
|
1454
1544
|
output: result,
|
|
1455
1545
|
attributes: {
|