@mastra/inngest 0.0.0-add-runtime-context-to-openai-realtime-20250516201052

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/dist/index.js ADDED
@@ -0,0 +1,729 @@
1
+ import { randomUUID } from 'crypto';
2
+ import { subscribe } from '@inngest/realtime';
3
+ import { RuntimeContext } from '@mastra/core/di';
4
+ import { Run, NewWorkflow, cloneStep, createStep, DefaultExecutionEngine } from '@mastra/core/workflows/vNext';
5
+ import { serve as serve$1 } from 'inngest/hono';
6
+
7
+ // src/index.ts
8
+ function serve({ mastra, inngest }) {
9
+ const wfs = mastra.vnext_getWorkflows();
10
+ const functions = Object.values(wfs).flatMap((wf) => {
11
+ if (wf instanceof InngestWorkflow) {
12
+ wf.__registerMastra(mastra);
13
+ return wf.getFunctions();
14
+ }
15
+ return [];
16
+ });
17
+ return serve$1({
18
+ client: inngest,
19
+ functions
20
+ });
21
+ }
22
+ var InngestRun = class extends Run {
23
+ inngest;
24
+ #mastra;
25
+ constructor(params, inngest) {
26
+ super(params);
27
+ this.inngest = inngest;
28
+ this.#mastra = params.mastra;
29
+ }
30
+ async getRuns(eventId) {
31
+ const response = await fetch(`${this.inngest.apiBaseUrl}/v1/events/${eventId}/runs`, {
32
+ headers: {
33
+ Authorization: `Bearer ${process.env.INNGEST_SIGNING_KEY}`
34
+ }
35
+ });
36
+ const json = await response.json();
37
+ return json.data;
38
+ }
39
+ async getRunOutput(eventId) {
40
+ let runs = await this.getRuns(eventId);
41
+ while (runs?.[0]?.status !== "Completed") {
42
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
43
+ runs = await this.getRuns(eventId);
44
+ if (runs?.[0]?.status === "Failed" || runs?.[0]?.status === "Cancelled") {
45
+ throw new Error(`Function run ${runs?.[0]?.status}`);
46
+ }
47
+ }
48
+ return runs?.[0];
49
+ }
50
+ async start({
51
+ inputData
52
+ }) {
53
+ await this.#mastra.getStorage()?.persistWorkflowSnapshot({
54
+ workflowName: this.workflowId,
55
+ runId: this.runId,
56
+ snapshot: {
57
+ runId: this.runId,
58
+ value: {},
59
+ context: {},
60
+ activePaths: [],
61
+ suspendedPaths: {},
62
+ timestamp: Date.now()
63
+ }
64
+ });
65
+ const eventOutput = await this.inngest.send({
66
+ name: `workflow.${this.workflowId}`,
67
+ data: {
68
+ inputData,
69
+ runId: this.runId
70
+ }
71
+ });
72
+ const eventId = eventOutput.ids[0];
73
+ if (!eventId) {
74
+ throw new Error("Event ID is not set");
75
+ }
76
+ const runOutput = await this.getRunOutput(eventId);
77
+ const result = runOutput?.output?.result;
78
+ if (result.status === "failed") {
79
+ result.error = new Error(result.error);
80
+ }
81
+ this.cleanup?.();
82
+ return result;
83
+ }
84
+ async resume(params) {
85
+ const steps = (Array.isArray(params.step) ? params.step : [params.step]).map(
86
+ (step) => typeof step === "string" ? step : step?.id
87
+ );
88
+ const snapshot = await this.#mastra?.storage?.loadWorkflowSnapshot({
89
+ workflowName: this.workflowId,
90
+ runId: this.runId
91
+ });
92
+ const eventOutput = await this.inngest.send({
93
+ name: `workflow.${this.workflowId}`,
94
+ data: {
95
+ inputData: params.resumeData,
96
+ runId: this.runId,
97
+ stepResults: snapshot?.context,
98
+ resume: {
99
+ steps,
100
+ stepResults: snapshot?.context,
101
+ resumePayload: params.resumeData,
102
+ // @ts-ignore
103
+ resumePath: snapshot?.suspendedPaths?.[steps?.[0]]
104
+ }
105
+ }
106
+ });
107
+ const eventId = eventOutput.ids[0];
108
+ if (!eventId) {
109
+ throw new Error("Event ID is not set");
110
+ }
111
+ const runOutput = await this.getRunOutput(eventId);
112
+ const result = runOutput?.output?.result;
113
+ if (result.status === "failed") {
114
+ result.error = new Error(result.error);
115
+ }
116
+ return result;
117
+ }
118
+ watch(cb) {
119
+ const streamPromise = subscribe(
120
+ {
121
+ channel: `workflow:${this.workflowId}:${this.runId}`,
122
+ topics: ["watch"],
123
+ app: this.inngest
124
+ },
125
+ (message) => {
126
+ cb(message.data);
127
+ }
128
+ );
129
+ return () => {
130
+ streamPromise.then((stream) => {
131
+ stream.cancel();
132
+ }).catch((err) => {
133
+ console.error(err);
134
+ });
135
+ };
136
+ }
137
+ };
138
+ var InngestWorkflow = class _InngestWorkflow extends NewWorkflow {
139
+ #mastra;
140
+ inngest;
141
+ function;
142
+ constructor(params, inngest) {
143
+ super(params);
144
+ this.#mastra = params.mastra;
145
+ this.inngest = inngest;
146
+ }
147
+ async getWorkflowRuns(args) {
148
+ const storage = this.#mastra?.getStorage();
149
+ if (!storage) {
150
+ this.logger.debug("Cannot get workflow runs. Mastra engine is not initialized");
151
+ return { runs: [], total: 0 };
152
+ }
153
+ return storage.getWorkflowRuns({ workflowName: this.id, ...args ?? {} });
154
+ }
155
+ async getWorkflowRunById(runId) {
156
+ const storage = this.#mastra?.getStorage();
157
+ if (!storage) {
158
+ this.logger.debug("Cannot get workflow runs. Mastra engine is not initialized");
159
+ return null;
160
+ }
161
+ const run = await storage.getWorkflowRunById({ runId, workflowName: this.id });
162
+ return run ?? (this.runs.get(runId) ? { ...this.runs.get(runId), workflowName: this.id } : null);
163
+ }
164
+ __registerMastra(mastra) {
165
+ this.#mastra = mastra;
166
+ this.executionEngine.__registerMastra(mastra);
167
+ const updateNested = (step) => {
168
+ if ((step.type === "step" || step.type === "loop" || step.type === "foreach") && step.step instanceof _InngestWorkflow) {
169
+ step.step.__registerMastra(mastra);
170
+ } else if (step.type === "parallel" || step.type === "conditional") {
171
+ for (const subStep of step.steps) {
172
+ updateNested(subStep);
173
+ }
174
+ }
175
+ };
176
+ if (this.executionGraph.steps.length) {
177
+ for (const step of this.executionGraph.steps) {
178
+ updateNested(step);
179
+ }
180
+ }
181
+ }
182
+ createRun(options) {
183
+ const runIdToUse = options?.runId || randomUUID();
184
+ const run = this.runs.get(runIdToUse) ?? new InngestRun(
185
+ {
186
+ workflowId: this.id,
187
+ runId: runIdToUse,
188
+ executionEngine: this.executionEngine,
189
+ executionGraph: this.executionGraph,
190
+ mastra: this.#mastra,
191
+ retryConfig: this.retryConfig,
192
+ cleanup: () => this.runs.delete(runIdToUse)
193
+ },
194
+ this.inngest
195
+ );
196
+ this.runs.set(runIdToUse, run);
197
+ return run;
198
+ }
199
+ getFunction() {
200
+ if (this.function) {
201
+ return this.function;
202
+ }
203
+ this.function = this.inngest.createFunction(
204
+ // @ts-ignore
205
+ { id: `workflow.${this.id}`, retries: this.retryConfig?.attempts ?? 0 },
206
+ { event: `workflow.${this.id}` },
207
+ async ({ event, step, attempt, publish }) => {
208
+ let { inputData, runId, resume } = event.data;
209
+ if (!runId) {
210
+ runId = await step.run(`workflow.${this.id}.runIdGen`, async () => {
211
+ return randomUUID();
212
+ });
213
+ }
214
+ const emitter = {
215
+ emit: async (event2, data) => {
216
+ if (!publish) {
217
+ return;
218
+ }
219
+ try {
220
+ await publish({
221
+ channel: `workflow:${this.id}:${runId}`,
222
+ topic: "watch",
223
+ data
224
+ });
225
+ } catch (err) {
226
+ this.logger.error("Error emitting event: " + (err?.stack ?? err?.message ?? err));
227
+ }
228
+ }
229
+ };
230
+ const engine = new InngestExecutionEngine(this.#mastra, step, attempt);
231
+ const result = await engine.execute({
232
+ workflowId: this.id,
233
+ runId,
234
+ graph: this.executionGraph,
235
+ input: inputData,
236
+ emitter,
237
+ retryConfig: this.retryConfig,
238
+ runtimeContext: new RuntimeContext(),
239
+ // TODO
240
+ resume
241
+ });
242
+ return { result, runId };
243
+ }
244
+ );
245
+ return this.function;
246
+ }
247
+ getNestedFunctions(steps) {
248
+ return steps.flatMap((step) => {
249
+ if (step.type === "step" || step.type === "loop" || step.type === "foreach") {
250
+ if (step.step instanceof _InngestWorkflow) {
251
+ return [step.step.getFunction(), ...step.step.getNestedFunctions(step.step.executionGraph.steps)];
252
+ }
253
+ return [];
254
+ } else if (step.type === "parallel" || step.type === "conditional") {
255
+ return this.getNestedFunctions(step.steps);
256
+ }
257
+ return [];
258
+ });
259
+ }
260
+ getFunctions() {
261
+ return [this.getFunction(), ...this.getNestedFunctions(this.executionGraph.steps)];
262
+ }
263
+ };
264
+ function cloneWorkflow(workflow, opts) {
265
+ const wf = new InngestWorkflow(
266
+ {
267
+ id: opts.id,
268
+ inputSchema: workflow.inputSchema,
269
+ outputSchema: workflow.outputSchema,
270
+ steps: workflow.stepDefs,
271
+ mastra: workflow.mastra
272
+ },
273
+ workflow.inngest
274
+ );
275
+ wf.setStepFlow(workflow.stepGraph);
276
+ wf.commit();
277
+ return wf;
278
+ }
279
+ function init(inngest) {
280
+ return {
281
+ createWorkflow(params) {
282
+ return new InngestWorkflow(params, inngest);
283
+ },
284
+ createStep,
285
+ cloneStep,
286
+ cloneWorkflow
287
+ };
288
+ }
289
+ var InngestExecutionEngine = class extends DefaultExecutionEngine {
290
+ inngestStep;
291
+ inngestAttempts;
292
+ constructor(mastra, inngestStep, inngestAttempts = 0) {
293
+ super({ mastra });
294
+ this.inngestStep = inngestStep;
295
+ this.inngestAttempts = inngestAttempts;
296
+ }
297
+ async fmtReturnValue(executionSpan, emitter, stepResults, lastOutput, error) {
298
+ const base = {
299
+ status: lastOutput.status,
300
+ steps: stepResults
301
+ };
302
+ if (lastOutput.status === "success") {
303
+ await emitter.emit("watch", {
304
+ type: "watch",
305
+ payload: {
306
+ workflowState: {
307
+ status: lastOutput.status,
308
+ steps: stepResults,
309
+ result: lastOutput.output
310
+ }
311
+ },
312
+ eventTimestamp: Date.now()
313
+ });
314
+ base.result = lastOutput.output;
315
+ } else if (lastOutput.status === "failed") {
316
+ base.error = error instanceof Error ? error?.stack ?? error.message : lastOutput?.error instanceof Error ? lastOutput.error.message : lastOutput.error ?? error ?? "Unknown error";
317
+ await emitter.emit("watch", {
318
+ type: "watch",
319
+ payload: {
320
+ workflowState: {
321
+ status: lastOutput.status,
322
+ steps: stepResults,
323
+ result: null,
324
+ error: base.error
325
+ }
326
+ },
327
+ eventTimestamp: Date.now()
328
+ });
329
+ } else if (lastOutput.status === "suspended") {
330
+ await emitter.emit("watch", {
331
+ type: "watch",
332
+ payload: {
333
+ workflowState: {
334
+ status: lastOutput.status,
335
+ steps: stepResults,
336
+ result: null,
337
+ error: null
338
+ }
339
+ },
340
+ eventTimestamp: Date.now()
341
+ });
342
+ const suspendedStepIds = Object.entries(stepResults).flatMap(([stepId, stepResult]) => {
343
+ if (stepResult?.status === "suspended") {
344
+ const nestedPath = stepResult?.payload?.__workflow_meta?.path;
345
+ return nestedPath ? [[stepId, ...nestedPath]] : [[stepId]];
346
+ }
347
+ return [];
348
+ });
349
+ base.suspended = suspendedStepIds;
350
+ }
351
+ executionSpan?.end();
352
+ return base;
353
+ }
354
+ async superExecuteStep({
355
+ workflowId,
356
+ runId,
357
+ step,
358
+ stepResults,
359
+ executionContext,
360
+ resume,
361
+ prevOutput,
362
+ emitter,
363
+ runtimeContext
364
+ }) {
365
+ return super.executeStep({
366
+ workflowId,
367
+ runId,
368
+ step,
369
+ stepResults,
370
+ executionContext,
371
+ resume,
372
+ prevOutput,
373
+ emitter,
374
+ runtimeContext
375
+ });
376
+ }
377
+ async executeStep({
378
+ step,
379
+ stepResults,
380
+ executionContext,
381
+ resume,
382
+ prevOutput,
383
+ emitter,
384
+ runtimeContext
385
+ }) {
386
+ await this.inngestStep.run(
387
+ `workflow.${executionContext.workflowId}.run.${executionContext.runId}.step.${step.id}.running_ev`,
388
+ async () => {
389
+ await emitter.emit("watch", {
390
+ type: "watch",
391
+ payload: {
392
+ currentStep: {
393
+ id: step.id,
394
+ status: "running"
395
+ },
396
+ workflowState: {
397
+ status: "running",
398
+ steps: {
399
+ ...stepResults,
400
+ [step.id]: {
401
+ status: "running"
402
+ }
403
+ },
404
+ result: null,
405
+ error: null
406
+ }
407
+ },
408
+ eventTimestamp: Date.now()
409
+ });
410
+ }
411
+ );
412
+ if (step instanceof InngestWorkflow) {
413
+ const isResume = !!resume?.steps?.length;
414
+ let result;
415
+ let runId;
416
+ if (isResume) {
417
+ runId = stepResults[resume?.steps?.[0]]?.payload?.__workflow_meta?.runId ?? randomUUID();
418
+ const snapshot = await this.mastra?.getStorage()?.loadWorkflowSnapshot({
419
+ workflowName: step.id,
420
+ runId
421
+ });
422
+ const invokeResp = await this.inngestStep.invoke(`workflow.${executionContext.workflowId}.step.${step.id}`, {
423
+ function: step.getFunction(),
424
+ data: {
425
+ inputData: prevOutput,
426
+ runId,
427
+ resume: {
428
+ runId,
429
+ steps: resume.steps.slice(1),
430
+ stepResults: snapshot?.context,
431
+ resumePayload: resume.resumePayload,
432
+ // @ts-ignore
433
+ resumePath: snapshot?.suspendedPaths?.[resume.steps?.[1]]
434
+ }
435
+ }
436
+ });
437
+ result = invokeResp.result;
438
+ runId = invokeResp.runId;
439
+ } else {
440
+ const invokeResp = await this.inngestStep.invoke(`workflow.${executionContext.workflowId}.step.${step.id}`, {
441
+ function: step.getFunction(),
442
+ data: {
443
+ inputData: prevOutput
444
+ }
445
+ });
446
+ result = invokeResp.result;
447
+ runId = invokeResp.runId;
448
+ }
449
+ const res = await this.inngestStep.run(
450
+ `workflow.${executionContext.workflowId}.step.${step.id}.nestedwf-results`,
451
+ async () => {
452
+ if (result.status === "failed") {
453
+ await emitter.emit("watch", {
454
+ type: "watch",
455
+ payload: {
456
+ currentStep: {
457
+ id: step.id,
458
+ status: "failed",
459
+ error: result?.error
460
+ },
461
+ workflowState: {
462
+ status: "running",
463
+ steps: stepResults,
464
+ result: null,
465
+ error: null
466
+ }
467
+ },
468
+ eventTimestamp: Date.now()
469
+ });
470
+ return { executionContext, result: { status: "failed", error: result?.error } };
471
+ } else if (result.status === "suspended") {
472
+ const suspendedSteps = Object.entries(result.steps).filter(([_stepName, stepResult]) => {
473
+ const stepRes2 = stepResult;
474
+ return stepRes2?.status === "suspended";
475
+ });
476
+ for (const [stepName, stepResult] of suspendedSteps) {
477
+ const suspendPath = [stepName, ...stepResult?.payload?.__workflow_meta?.path ?? []];
478
+ executionContext.suspendedPaths[step.id] = executionContext.executionPath;
479
+ await emitter.emit("watch", {
480
+ type: "watch",
481
+ payload: {
482
+ currentStep: {
483
+ id: step.id,
484
+ status: "suspended",
485
+ payload: { ...stepResult?.payload, __workflow_meta: { runId, path: suspendPath } }
486
+ },
487
+ workflowState: {
488
+ status: "running",
489
+ steps: stepResults,
490
+ result: null,
491
+ error: null
492
+ }
493
+ },
494
+ eventTimestamp: Date.now()
495
+ });
496
+ return {
497
+ executionContext,
498
+ result: {
499
+ status: "suspended",
500
+ payload: { ...stepResult?.payload, __workflow_meta: { runId, path: suspendPath } }
501
+ }
502
+ };
503
+ }
504
+ await emitter.emit("watch", {
505
+ type: "watch",
506
+ payload: {
507
+ currentStep: {
508
+ id: step.id,
509
+ status: "suspended",
510
+ payload: {}
511
+ },
512
+ workflowState: {
513
+ status: "running",
514
+ steps: stepResults,
515
+ result: null,
516
+ error: null
517
+ }
518
+ },
519
+ eventTimestamp: Date.now()
520
+ });
521
+ return {
522
+ executionContext,
523
+ result: {
524
+ status: "suspended",
525
+ payload: {}
526
+ }
527
+ };
528
+ }
529
+ await emitter.emit("watch", {
530
+ type: "watch",
531
+ payload: {
532
+ currentStep: {
533
+ id: step.id,
534
+ status: "success",
535
+ output: result?.result
536
+ },
537
+ workflowState: {
538
+ status: "running",
539
+ steps: stepResults,
540
+ result: null,
541
+ error: null
542
+ }
543
+ },
544
+ eventTimestamp: Date.now()
545
+ });
546
+ return { executionContext, result: { status: "success", output: result?.result } };
547
+ }
548
+ );
549
+ Object.assign(executionContext, res.executionContext);
550
+ return res.result;
551
+ }
552
+ const stepRes = await this.inngestStep.run(`workflow.${executionContext.workflowId}.step.${step.id}`, async () => {
553
+ let execResults;
554
+ let suspended;
555
+ try {
556
+ const result = await step.execute({
557
+ mastra: this.mastra,
558
+ runtimeContext,
559
+ inputData: prevOutput,
560
+ resumeData: resume?.steps[0] === step.id ? resume?.resumePayload : void 0,
561
+ getInitData: () => stepResults?.input,
562
+ getStepResult: (step2) => {
563
+ const result2 = stepResults[step2.id];
564
+ if (result2?.status === "success") {
565
+ return result2.output;
566
+ }
567
+ return null;
568
+ },
569
+ suspend: async (suspendPayload) => {
570
+ executionContext.suspendedPaths[step.id] = executionContext.executionPath;
571
+ suspended = { payload: suspendPayload };
572
+ },
573
+ resume: {
574
+ steps: resume?.steps?.slice(1) || [],
575
+ resumePayload: resume?.resumePayload,
576
+ // @ts-ignore
577
+ runId: stepResults[step.id]?.payload?.__workflow_meta?.runId
578
+ },
579
+ emitter
580
+ });
581
+ execResults = { status: "success", output: result };
582
+ } catch (e) {
583
+ execResults = { status: "failed", error: e instanceof Error ? e.message : String(e) };
584
+ }
585
+ if (suspended) {
586
+ execResults = { status: "suspended", payload: suspended.payload };
587
+ }
588
+ if (execResults.status === "failed") {
589
+ if (executionContext.retryConfig.attempts > 0 && this.inngestAttempts < executionContext.retryConfig.attempts) {
590
+ throw execResults.error;
591
+ }
592
+ }
593
+ await emitter.emit("watch", {
594
+ type: "watch",
595
+ payload: {
596
+ currentStep: {
597
+ id: step.id,
598
+ status: execResults.status,
599
+ output: execResults.output
600
+ },
601
+ workflowState: {
602
+ status: "running",
603
+ steps: stepResults,
604
+ result: null,
605
+ error: null
606
+ }
607
+ },
608
+ eventTimestamp: Date.now()
609
+ });
610
+ return { result: execResults, executionContext, stepResults };
611
+ });
612
+ Object.assign(executionContext.suspendedPaths, stepRes.executionContext.suspendedPaths);
613
+ Object.assign(stepResults, stepRes.stepResults);
614
+ return stepRes.result;
615
+ }
616
+ async persistStepUpdate({
617
+ workflowId,
618
+ runId,
619
+ stepResults,
620
+ executionContext
621
+ }) {
622
+ await this.inngestStep.run(
623
+ `workflow.${workflowId}.run.${runId}.path.${JSON.stringify(executionContext.executionPath)}.stepUpdate`,
624
+ async () => {
625
+ await this.mastra?.getStorage()?.persistWorkflowSnapshot({
626
+ workflowName: workflowId,
627
+ runId,
628
+ snapshot: {
629
+ runId,
630
+ value: {},
631
+ context: stepResults,
632
+ activePaths: [],
633
+ suspendedPaths: executionContext.suspendedPaths,
634
+ // @ts-ignore
635
+ timestamp: Date.now()
636
+ }
637
+ });
638
+ }
639
+ );
640
+ }
641
+ async executeConditional({
642
+ workflowId,
643
+ runId,
644
+ entry,
645
+ prevOutput,
646
+ prevStep,
647
+ stepResults,
648
+ resume,
649
+ executionContext,
650
+ emitter,
651
+ runtimeContext
652
+ }) {
653
+ let execResults;
654
+ const truthyIndexes = (await Promise.all(
655
+ entry.conditions.map(
656
+ (cond, index) => this.inngestStep.run(`workflow.${workflowId}.conditional.${index}`, async () => {
657
+ try {
658
+ const result = await cond({
659
+ mastra: this.mastra,
660
+ runtimeContext,
661
+ inputData: prevOutput,
662
+ getInitData: () => stepResults?.input,
663
+ getStepResult: (step) => {
664
+ if (!step?.id) {
665
+ return null;
666
+ }
667
+ const result2 = stepResults[step.id];
668
+ if (result2?.status === "success") {
669
+ return result2.output;
670
+ }
671
+ return null;
672
+ },
673
+ // TODO: this function shouldn't have suspend probably?
674
+ suspend: async (_suspendPayload) => {
675
+ },
676
+ emitter
677
+ });
678
+ return result ? index : null;
679
+ } catch (e) {
680
+ return null;
681
+ }
682
+ })
683
+ )
684
+ )).filter((index) => index !== null);
685
+ const stepsToRun = entry.steps.filter((_, index) => truthyIndexes.includes(index));
686
+ const results = await Promise.all(
687
+ stepsToRun.map(
688
+ (step, index) => this.executeEntry({
689
+ workflowId,
690
+ runId,
691
+ entry: step,
692
+ prevStep,
693
+ stepResults,
694
+ resume,
695
+ executionContext: {
696
+ workflowId,
697
+ runId,
698
+ executionPath: [...executionContext.executionPath, index],
699
+ suspendedPaths: executionContext.suspendedPaths,
700
+ retryConfig: executionContext.retryConfig,
701
+ executionSpan: executionContext.executionSpan
702
+ },
703
+ emitter,
704
+ runtimeContext
705
+ })
706
+ )
707
+ );
708
+ const hasFailed = results.find((result) => result.status === "failed");
709
+ const hasSuspended = results.find((result) => result.status === "suspended");
710
+ if (hasFailed) {
711
+ execResults = { status: "failed", error: hasFailed.error };
712
+ } else if (hasSuspended) {
713
+ execResults = { status: "suspended", payload: hasSuspended.payload };
714
+ } else {
715
+ execResults = {
716
+ status: "success",
717
+ output: results.reduce((acc, result, index) => {
718
+ if (result.status === "success") {
719
+ acc[stepsToRun[index].step.id] = result.output;
720
+ }
721
+ return acc;
722
+ }, {})
723
+ };
724
+ }
725
+ return execResults;
726
+ }
727
+ };
728
+
729
+ export { InngestExecutionEngine, InngestRun, InngestWorkflow, init, serve };