import type { JsonValue } from "../state/json.js"; import type { WorkflowDefinitionSnapshot, WorkflowRunState, WorkflowStepRecord, WorkflowTraceEventDraft } from "./types.js"; /** Worker proposals carry one change, never a replacement run projection. */ export type WorkflowTransition = { event: WorkflowTraceEventDraft; } & ({ kind: "startAttempt"; startedAt: string; } | { kind: "finishAttempt"; step: WorkflowStepRecord; } | { kind: "setTimeout"; timeoutMs: number | null; } | { kind: "resume"; attemptId?: string; } | { kind: "pause"; } | { kind: "resumeInteraction"; } | { kind: "waitForInput"; requestId: string; requestKind: "checkpoint" | "decision"; contract: JsonValue; } | { kind: "finish"; status: "completed" | "failed" | "timed_out" | "cancelled"; error?: string; finalOutput?: unknown; } | { kind: "record"; }); /** Translate engine-local state into the narrow proposal for this event. */ export declare function executionTransition(state: WorkflowRunState, event: WorkflowTraceEventDraft): WorkflowTransition; /** Apply a validated transition to a projection read by the durable owner. */ export declare function applyExecutionTransition(current: WorkflowRunState, definition: WorkflowDefinitionSnapshot, transition: WorkflowTransition, now: string): WorkflowRunState;