/** * Core runtime abstraction — the 4 primitives any durable execution engine must provide. * * Every engine adapter (Restate, Temporal, etc.) implements this interface. * The WorkflowContext builds all higher-level constructs (step dispatch, * control flow, policy cascade) on top of these 4 operations. */ export interface DurableRuntime { /** Unique identifier for the current workflow execution. */ readonly executionId: string; /** * Execute a function durably — memoized on replay. * The engine guarantees at-most-once execution for a given key. */ run(key: string, fn: () => T | Promise, options?: DurableRunOptions): Promise; /** Durable sleep — survives process restarts. */ sleep(ms: number): Promise; /** Durable promise — for human-in-the-loop and external signal patterns. */ promise(name: string): DurablePromiseHandle; } export interface DurableRunOptions { /** Opaque, engine-native options (e.g., Restate RunOptions, Temporal ActivityOptions). */ readonly engineOptions?: unknown; } export interface DurablePromiseHandle { /** Wait for the promise to be resolved, with optional timeout. */ get(timeoutMs?: number): Promise; /** Resolve the promise from outside the workflow (e.g., human task completion). */ resolve(value: T): Promise; } //# sourceMappingURL=runtime-adapter.d.ts.map