Establishes the foundation for creating Arvo-compatible state machines.
Designed for synchronous state machine orchestrations in Arvo's event-driven architecture.
Builds upon XState with Arvo-specific constraints to enforce predictable state transitions.
param: { actions?: { [K in string | number | symbol]: ActionFunction<TContext, { [K in string | number | symbol]: InferEmittableEventsFromVersionedArvoContract<TServiceContracts[K]> }[keyof TServiceContracts], { [K in string | number | symbol]: InferEmittableEventsFromVersionedArvoContract<TServiceContracts[K]> }[keyof TServiceContracts], TActions[K], never, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, never, { [K in string | number | symbol]: EnqueueArvoEventActionParam<input<(...)[(...)]["accepts"]["schema"]>, TServiceContracts[K]["accepts"]["type"], Record<string, | null | string | number | boolean>> }[keyof TServiceContracts]> }; contracts: { self: TSelfContract; services: TServiceContracts; }; guards?: { [K in string | number | symbol]: ((args: { context: TContext; event: { [K in string | number | symbol]: InferEmittableEventsFromVersionedArvoContract<TServiceContracts[K]> }[keyof TServiceContracts]; }, params: TGuards[K]) => boolean) }; schemas?: unknown; types?: Omit<SetupTypes<TContext, { [K in string | number | symbol]: InferEmittableEventsFromVersionedArvoContract<TServiceContracts[K]> }[keyof TServiceContracts], {}, TTag, InferZodSchema<TSelfContract["accepts"]["schema"]>, { [K in string]: InferArvoEvent<ArvoEvent<InferZodSchema<(...)[(...)]>, Record<string, any>, K>> }[`arvo.orc.${ExtractOrchestratorType<TSelfContract["accepts"]["type"]>}.done`]["data"], { [K in string | number | symbol]: EnqueueArvoEventActionParam<input<(...)[(...)]["accepts"]["schema"]>, TServiceContracts[K]["accepts"]["type"], Record<string, | null | string | number | boolean>> }[keyof TServiceContracts], TMeta>, | "output" | "emitted" | "input" | "children">; }
Optionalactions?: { [K in string | number | symbol]: ActionFunction<TContext, { [K in string | number | symbol]: InferEmittableEventsFromVersionedArvoContract<TServiceContracts[K]> }[keyof TServiceContracts], { [K in string | number | symbol]: InferEmittableEventsFromVersionedArvoContract<TServiceContracts[K]> }[keyof TServiceContracts], TActions[K], never, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, never, { [K in string | number | symbol]: EnqueueArvoEventActionParam<input<(...)[(...)]["accepts"]["schema"]>, TServiceContracts[K]["accepts"]["type"], Record<string, | null | string | number | boolean>> }[keyof TServiceContracts]> }
Named action implementations that can be referenced throughout the machine.
Actions perform side effects like data transformations, context updates,
and event emissions. Each action receives the current context and event,
along with any parameters defined in its type.
Service contracts defining the event interfaces for external services.
Each service specifies the events it accepts and emits, enabling
type-safe communication between the machine and its dependencies.
Optionalguards?: { [K in string | number | symbol]: ((args: { context: TContext; event: { [K in string | number | symbol]: InferEmittableEventsFromVersionedArvoContract<TServiceContracts[K]> }[keyof TServiceContracts]; }, params: TGuards[K]) => boolean) }
Named guard implementations that control conditional state transitions.
Guards are boolean functions that determine whether a transition should occur
based on the current context and event. They enable dynamic flow control
without side effects.
Optionaltypes?: Omit<SetupTypes<TContext, { [K in string | number | symbol]: InferEmittableEventsFromVersionedArvoContract<TServiceContracts[K]> }[keyof TServiceContracts], {}, TTag, InferZodSchema<TSelfContract["accepts"]["schema"]>, { [K in string]: InferArvoEvent<ArvoEvent<InferZodSchema<(...)[(...)]>, Record<string, any>, K>> }[`arvo.orc.${ExtractOrchestratorType<TSelfContract["accepts"]["type"]>}.done`]["data"], { [K in string | number | symbol]: EnqueueArvoEventActionParam<input<(...)[(...)]["accepts"]["schema"]>, TServiceContracts[K]["accepts"]["type"], Record<string, | null | string | number | boolean>> }[keyof TServiceContracts], TMeta>, | "output" | "emitted" | "input" | "children">
Type definitions for the machine's internal structure.
Specifies the shape of context and other variables used throughout
the machine's lifecycle. These types enable full type inference and safety.
Creates an Arvo-compatible state machine with the specified configuration.
Constructs a fully-typed state machine that orchestrates event-driven workflows
using the contracts and types defined in setup. The machine enforces synchronous
execution and validates configuration against Arvo constraints.
Establishes the foundation for creating Arvo-compatible state machines.
Designed for synchronous state machine orchestrations in Arvo's event-driven architecture. Builds upon XState with Arvo-specific constraints to enforce predictable state transitions.