@mastra/core
Version:
39 lines • 1.95 kB
TypeScript
import type { StepFlowEntry, StepResult } from '../../index.js';
import type { PubSub } from '../../../events/index.js';
import type { RunStorage } from '../../run-storage.js';
import type { StepExecutor } from '../step-executor.js';
import type { ProcessorArgs } from '.';
declare const FOREACH_QUEUED = "__mastra_foreach_queued__";
export declare function isQueuedForeachIteration(value: unknown): value is {
[FOREACH_QUEUED]: true;
nestedRunId?: string;
};
export declare function evaluateLoopCondition(args: Omit<ProcessorArgs, 'workflow'>, step: Extract<StepFlowEntry, {
type: 'loop';
}>, stepExecutor: StepExecutor, stepResult: StepResult<any, any, any, any>): Promise<boolean>;
/** The loop step's result when its condition throws. */
export declare function failedLoopStep(result: StepResult<any, any, any, any>, error: Error): StepResult<any, any, any, any>;
export declare function processWorkflowLoop({ workflowId, prevResult, runId, executionPath, stepResults, activeStepsPath, resumeSteps, resumeData, parentWorkflow, requestContext, actor, retryCount, perStep, state, outputOptions, }: ProcessorArgs, { pubsub, runStorage, stepExecutor, step, stepResult, savedCondition, replayedIterationCount, }: {
pubsub: PubSub;
runStorage: RunStorage;
stepExecutor: StepExecutor;
step: Extract<StepFlowEntry, {
type: 'loop';
}>;
stepResult: StepResult<any, any, any, any>;
savedCondition?: boolean;
/**
* The count already stored for this completion by an earlier delivery's `loopAgain`. A replay
* must report the same count instead of advancing it a second time.
*/
replayedIterationCount?: number;
}): Promise<void>;
export declare function processWorkflowForEach(args: ProcessorArgs, deps: {
pubsub: PubSub;
runStorage: RunStorage;
step: Extract<StepFlowEntry, {
type: 'foreach';
}>;
}): Promise<void>;
export {};
//# sourceMappingURL=loop.d.ts.map