Type Alias: EngineEvent {#type-alias-engineevent}
EngineEvent = {
run:Run;type:"run:start"; } | {durationMs:number;run:Run;type:"run:complete"; } | {durationMs:number;error:string;run:Run;type:"run:error"; } | {attempt:number;error:string;run:Run;type:"run:retry"; } | {error:string;run:Run;type:"run:dead"; } | {childRuns:Run[];resumedRun:Run;type:"run:resume"; } | {durationMs:number;effectKey:string;runId:string;type:"effect:complete"; } | {durationMs:number;effectKey:string;error:string;runId:string;type:"effect:error"; } | {effectKey:string;runId:string;type:"effect:replay"; } | {run:Run;type:"lease:reclaim"; } | {context:string;error:unknown;type:"internal:error"; }
Discriminated union of all engine lifecycle events emitted via EngineOptions.onEvent.
run:start, run claimed by dispatcher and about to execute.run:complete, handler returned{ success: true }.durationMsis current-attempt execution time.run:error, run reached errored state (handler threw, returned{ success: false }, or failed validation).durationMsis current-attempt execution time (0 if no handler ran).run:retry, handler threw but retries remain; run returns to idle.run:dead, retry budget exhausted; always followed byrun:error.run:resume, a deferred run was resumed, creating child runs.effect:complete, durable effect executed successfully.durationMsis effect function wall-clock time.effect:error, durable effect threw.durationMsis time until the throw.effect:replay, durable effect replayed from store (no re-execution).lease:reclaim, a stale lease was reclaimed (one event per run).internal:error, an internal error was caught that would otherwise be swallowed.