@mastra/inngest 0.0.0-toolOptionTypes-20250917085558 → 0.0.0-top-level-fix-20251211111608

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.
@@ -0,0 +1,86 @@
1
+ import type { PubSub } from '@mastra/core/events';
2
+ import type { Mastra } from '@mastra/core/mastra';
3
+ import { DefaultExecutionEngine } from '@mastra/core/workflows';
4
+ import type { ExecutionContext, Step, StepResult, ExecutionEngineOptions, TimeTravelExecutionParams } from '@mastra/core/workflows';
5
+ import type { Inngest, BaseContext } from 'inngest';
6
+ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
7
+ private inngestStep;
8
+ private inngestAttempts;
9
+ constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts: number | undefined, options: ExecutionEngineOptions);
10
+ /**
11
+ * Format errors with stack traces for better debugging in Inngest
12
+ */
13
+ protected formatResultError(error: Error | string | undefined, lastOutput: StepResult<any, any, any, any>): string;
14
+ /**
15
+ * Detect InngestWorkflow instances for special nested workflow handling
16
+ */
17
+ isNestedWorkflowStep(step: Step<any, any, any>): boolean;
18
+ /**
19
+ * Inngest requires requestContext serialization for memoization.
20
+ * When steps are replayed, the original function doesn't re-execute,
21
+ * so requestContext modifications must be captured and restored.
22
+ */
23
+ requiresDurableContextSerialization(): boolean;
24
+ /**
25
+ * Execute a step with retry logic for Inngest.
26
+ * Retries are handled via step-level retry (RetryAfterError thrown INSIDE step.run()).
27
+ * After retries exhausted, error propagates here and we return a failed result.
28
+ */
29
+ executeStepWithRetry<T>(stepId: string, runStep: () => Promise<T>, params: {
30
+ retries: number;
31
+ delay: number;
32
+ stepSpan?: any;
33
+ workflowId: string;
34
+ runId: string;
35
+ }): Promise<{
36
+ ok: true;
37
+ result: T;
38
+ } | {
39
+ ok: false;
40
+ error: {
41
+ status: 'failed';
42
+ error: string;
43
+ endedAt: number;
44
+ };
45
+ }>;
46
+ /**
47
+ * Use Inngest's sleep primitive for durability
48
+ */
49
+ executeSleepDuration(duration: number, sleepId: string, workflowId: string): Promise<void>;
50
+ /**
51
+ * Use Inngest's sleepUntil primitive for durability
52
+ */
53
+ executeSleepUntilDate(date: Date, sleepUntilId: string, workflowId: string): Promise<void>;
54
+ /**
55
+ * Wrap durable operations in Inngest step.run() for durability.
56
+ * If retryConfig is provided, throws RetryAfterError INSIDE step.run() to trigger
57
+ * Inngest's step-level retry mechanism (not function-level retry).
58
+ */
59
+ wrapDurableOperation<T>(operationId: string, operationFn: () => Promise<T>, retryConfig?: {
60
+ delay: number;
61
+ }): Promise<T>;
62
+ /**
63
+ * Provide Inngest step primitive in engine context
64
+ */
65
+ getEngineContext(): Record<string, any>;
66
+ /**
67
+ * Execute nested InngestWorkflow using inngestStep.invoke() for durability.
68
+ * This MUST be called directly (not inside step.run()) due to Inngest constraints.
69
+ */
70
+ executeWorkflowStep(params: {
71
+ step: Step<string, any, any>;
72
+ stepResults: Record<string, StepResult<any, any, any, any>>;
73
+ executionContext: ExecutionContext;
74
+ resume?: {
75
+ steps: string[];
76
+ resumePayload: any;
77
+ runId?: string;
78
+ };
79
+ timeTravel?: TimeTravelExecutionParams;
80
+ prevOutput: any;
81
+ inputData: any;
82
+ pubsub: PubSub;
83
+ startedAt: number;
84
+ }): Promise<StepResult<any, any, any, any> | null>;
85
+ }
86
+ //# sourceMappingURL=execution-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-engine.d.ts","sourceRoot":"","sources":["../src/execution-engine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAmC,MAAM,wBAAwB,CAAC;AACjG,OAAO,KAAK,EACV,gBAAgB,EAChB,IAAI,EACJ,UAAU,EAEV,sBAAsB,EACtB,yBAAyB,EAE1B,MAAM,wBAAwB,CAAC;A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