UNPKG

@mastra/core

Version:
83 lines • 3.08 kB
import type { StepFlowEntry, Workflow } from '../../index.js'; import type { Mastra } from '../../../mastra/index.js'; import type { StepExecutionParentWorkflow } from '../../../worker/types.js'; import type { SingleStepEntry } from '../../types.js'; /** * Whether a `workflow.end` paused the run. `workflowStatus` is the status `endWorkflow` ended * the run with; an event published by a process that predates it falls back to that process's own rule. */ export declare function endedPaused(endData: { workflowStatus?: string; perStep?: boolean; prevResult?: { status?: string; }; }, perStep?: boolean | undefined): boolean; export declare function getNestedWorkflow(mastra: Mastra, { workflowId, executionPath, parentWorkflow, runId }: StepExecutionParentWorkflow): Workflow | null; /** * Reduces a parent-workflow descriptor chain to the fields `getNestedWorkflow` * reads, so a step dispatched to another process doesn't carry the parents' * step results, inputs and step graphs. */ export declare function toStepExecutionParentWorkflow(parentWorkflow: StepExecutionParentWorkflow | undefined): StepExecutionParentWorkflow | undefined; /** * Resolves the single-step entry addressed by an execution path, or null when * the path doesn't land on a single-step-like entry. For `loop` / `foreach` * the body entry is returned. */ export declare function getStepEntry(workflow: Workflow, executionPath: number[]): SingleStepEntry | null; /** * Resolves the id of the entry addressed by an execution path, or null when the * path doesn't land on a single-step-like entry. For `loop` / `foreach` the id * of the body entry is returned. */ export declare function getStepId(workflow: Workflow, executionPath: number[]): string | null; export declare function isExecutableStep(step: StepFlowEntry<any>): step is { type: 'step'; step: import("../..").Step; } | { type: 'agent'; id: string; agentId: string; agent?: any; options?: any; } | { type: 'tool'; id: string; toolId: string; tool?: any; options?: any; } | { type: 'classifier'; id: string; classifierId: string; classifier?: any; options?: import("../..").SerializableClassifierStepOptions; } | { type: 'mapping'; id: string; description?: string; metadata?: import("../..").StepMetadata; mapConfig: import("../..").ExecuteFunction<any, any, any, any, any, any> | import("../..").MappingConfig; } | { type: 'loop'; id?: string; description?: string; metadata?: import("../..").StepMetadata; step: SingleStepEntry<any>; condition: import("../..").LoopConditionFunction<any, any, any, any, any, any>; serializedCondition: { id: string; fn: string; }; loopType: 'dowhile' | 'dountil'; predicate?: import("../..").Predicate; } | { type: 'foreach'; id?: string; description?: string; metadata?: import("../..").StepMetadata; step: SingleStepEntry<any>; opts: import("../..").ForeachOptions; }; //# sourceMappingURL=utils.d.ts.map