Skip to content

@ue-too/being / index / extractMachineGraph

Function: extractMachineGraph() ​

extractMachineGraph(machine): MachineGraph

Defined in: introspect.ts:60

Extracts a machine's states and transitions as a directed graph.

Parameters ​

machine ​

StateMachine<any, any, any, any>

Returns ​

MachineGraph

Remarks ​

Reads only the machine's public surface (possibleStates, each state's eventReactions, eventGuards, and eventPreconditions) — the machine's behavior is untouched. Per state and event, emits one edge to the reaction's defaultTargetState (or a self-loop when it has none), plus one guard-labeled edge per eventGuards mapping; every edge carries the event's declared preconditions, if any.