@mastra/inngest 0.0.0-scorers-ui-refactored-20250916094952 → 0.0.0-scorers-logs-20251208093427

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