import { D as DriveOptions, a as DriveResult } from '../../drive-loop-C0XIs2TB.js'; export { b as DEFAULT_MAX_ROUNDS, c as DriveCtxArg, d as DriveNoHandlerError, e as DriveRoundsExceededError, f as DriveTraceEntry, g as driveTraceOf } from '../../drive-loop-C0XIs2TB.js'; import { b as Cmd, c as Sub, M as Machine, I as Interpret } from '../../core-sEWVgnpI.js'; import '../../runtime-types-f231H8Gq.js'; import '@standard-schema/spec'; /** * Drive `machine` from `initial` through `msg` against the REAL interpret * `handlers`, feeding every settle Msg back until the machine goes quiet, and * hand back the settled state together with the whole history. * * `handlers` is the same table a host hands `run` as its `interpret` (e.g. * a jev knob's `resilient_run` handler), so the test drives the real interpreter and * mocks only the port beneath it. * * One round is: fold every pending Msg, then await a handler for every Cmd * those folds emitted. A Msg a handler returns — or fires through its injected * `dispatch` — is pending for the next round. A machine that emits no Cmd for * its seed Msg therefore settles in ONE round and never awaits a handler at * all. Subs are not run. * * A `Cmd.define`d Cmd's handler is held to the engine's contract (ADR 0021): * its outcome is minted into `_ok` / `_err`, and a `_ok` / `_err` it builds and * dispatches itself is refused, failing the drive with `OutcomeContractError` * exactly where `run` would report it (#304). A settle it minted through * `cmdEdgeOf(ctx)` passes. * * The `ctx` handed to each handler is `opts.ctx` augmented with a NO-OP `emit`, * so a handler that emits to a `Port` runs without a live runtime; nothing here * observes ports. Supply your own `emit` on `ctx` to capture them. * * @throws {DriveRoundsExceededError} when the machine is still emitting work * after `opts.maxRounds` rounds. It never returns a half-driven state. * @throws whatever a handler rejects with, unchanged — annotated with the * partial trace, readable via `driveTraceOf`. */ declare function drive(machine: Machine, initial: S, msg: M, handlers: Interpret, ...[opts]: Record extends DriveOptions ? [opts?: DriveOptions] : [opts: DriveOptions]): Promise>; export { DriveOptions, DriveResult, drive };