/** * Collect-then-suspend execution driver (P0.3). * * Runs a workflow function against a WorkflowContext without awaiting it to * completion: durable-step methods park on never-settling promises and * register commands on the context, so a `Promise.all` fan-out registers every * branch's first step before the workflow yields. This driver drains the * microtask queue until either the workflow settles or no new durable actions * register for one tick, then reports the outcome. * * Used by the Worker for real task execution and exported for tests. */ import type { WorkflowCommand } from '../types.js'; import type { WorkflowContext } from './workflow-context.js'; export type WorkflowExecutionOutcome = { status: 'completed'; result: unknown; } | { status: 'failed'; error: unknown; } | { status: 'suspended'; commands: WorkflowCommand[]; } /** Quiescent with nothing durable pending — the workflow is awaiting * something the server can never resolve (e.g. a bare setTimeout). */ | { status: 'stalled'; }; export declare function executeWorkflowSlice(ctx: WorkflowContext, run: () => Promise): Promise;