Function: extractMachineRoutes()
API / @xmachines/play-router / extractMachineRoutes
function extractMachineRoutes(machine): RouteTree;Defined in: extract-routes.ts:93
Extract complete route tree from state machine graph
Converts the XState machine to a @statelyai/graph Graph via machineToGraph(), then walks graph nodes to extract route metadata, validate route references, and build a hierarchical RouteTree. The graph is attached to the returned RouteTree for downstream transition-aware queries.
Parameters
| Parameter | Type | Description |
|---|---|---|
machine | AnyStateMachine | XState v5 state machine |
Returns
Route tree with root, byStateId map, byPath map, and graph