/** * Workflow factory functions. * * These live in their own module so they can statically import both the base * `Workflow` class and the evented `createWorkflow` factory without creating * an ESM init-time cycle. The cycle used to be: * * workflow.ts → agent/agent.ts → workflow.ts * * (workflow.ts needed the Agent class for instanceof checks, and agent.ts * needed createWorkflow from workflow.ts.) * * By keeping the Workflow class in `workflow.ts` and the factories here, * neither module needs to import the other's runtime dependencies. */ import type { InferPublicSchema, PublicSchema } from '../schema/index.js'; import type { Step } from './step.js'; import type { CreateWorkflowParams, DefaultEngineType, InferSchemaOutput } from './types.js'; import { Workflow } from './workflow.js'; /** * Create a workflow, auto-promoting to the evented engine when a `schedule` * is declared. */ export declare function createWorkflow = PublicSchema, TOutputSchema extends PublicSchema = PublicSchema, TStateSchema extends PublicSchema | undefined = undefined, TSteps extends Step[] = Step[], TRequestContextSchema extends PublicSchema | undefined = undefined>(params: CreateWorkflowParams): Workflow, InferPublicSchema, InferPublicSchema, InferPublicSchema, InferSchemaOutput>; /** * @internal Build a workflow on the evented execution engine. * * Used by internal code (agentic loop, prepare-stream) that always needs the * evented engine regardless of whether a schedule is declared. */ export declare function createEventedWorkflow = PublicSchema, TOutputSchema extends PublicSchema = PublicSchema, TStateSchema extends PublicSchema | undefined = undefined, TSteps extends Step[] = Step[], TRequestContextSchema extends PublicSchema | undefined = undefined>(params: CreateWorkflowParams): Workflow, InferPublicSchema, InferPublicSchema, InferPublicSchema, InferSchemaOutput>; export declare function cloneWorkflow[] = Step[], TPrevSchema = TInput>(workflow: Workflow, opts: { id: TWorkflowId; }): Workflow; //# sourceMappingURL=create.d.ts.map