@xmachines/docs 1.0.0-beta.9 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (551) hide show
  1. package/README.md +137 -7
  2. package/api/@xmachines/play/README.md +160 -38
  3. package/api/@xmachines/play/classes/NonNullableError.md +189 -0
  4. package/api/@xmachines/play/classes/PlayError.md +251 -0
  5. package/api/@xmachines/play/functions/assertNonNullable.md +56 -0
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +6 -6
  7. package/api/@xmachines/play-actor/README.md +141 -160
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +96 -126
  9. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +40 -0
  10. package/api/@xmachines/play-actor/functions/toAtomState.md +33 -0
  11. package/api/@xmachines/play-actor/functions/typedSpec.md +54 -0
  12. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +46 -0
  13. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +33 -0
  14. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +28 -0
  15. package/api/@xmachines/play-actor/interfaces/Routable.md +6 -21
  16. package/api/@xmachines/play-actor/interfaces/Viewable.md +12 -6
  17. package/api/@xmachines/play-dom/README.md +384 -0
  18. package/api/@xmachines/play-dom/classes/PlayRenderer.md +115 -0
  19. package/api/@xmachines/play-dom/functions/createPlayUI.md +28 -0
  20. package/api/@xmachines/play-dom/functions/createRenderer.md +44 -0
  21. package/api/@xmachines/play-dom/functions/defineRegistry.md +26 -0
  22. package/api/@xmachines/play-dom/functions/renderSpec.md +67 -0
  23. package/api/@xmachines/play-dom/interfaces/ComponentContext.md +23 -0
  24. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +34 -0
  25. package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +17 -0
  26. package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +28 -0
  27. package/api/@xmachines/play-dom/interfaces/EventHandle.md +15 -0
  28. package/api/@xmachines/play-dom/interfaces/MountOptions.md +18 -0
  29. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +30 -0
  30. package/api/@xmachines/play-dom/interfaces/RenderSpecOptions.md +26 -0
  31. package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +32 -0
  32. package/api/@xmachines/play-dom/type-aliases/ActionFn.md +46 -0
  33. package/api/@xmachines/play-dom/type-aliases/Actions.md +18 -0
  34. package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +114 -0
  35. package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +25 -0
  36. package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +26 -0
  37. package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +15 -0
  38. package/api/@xmachines/play-dom/type-aliases/ConfirmHandler.md +44 -0
  39. package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +39 -0
  40. package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +20 -0
  41. package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +9 -0
  42. package/api/@xmachines/play-dom/type-aliases/DomSchema.md +9 -0
  43. package/api/@xmachines/play-dom/type-aliases/MountFn.md +27 -0
  44. package/api/@xmachines/play-dom/type-aliases/RenderErrorHandler.md +23 -0
  45. package/api/@xmachines/play-dom/type-aliases/SetState.md +30 -0
  46. package/api/@xmachines/play-dom/variables/schema.md +62 -0
  47. package/api/@xmachines/play-dom-router/README.md +271 -0
  48. package/api/@xmachines/play-dom-router/functions/connectRouter.md +43 -0
  49. package/api/@xmachines/{play-router → play-dom-router}/functions/createBrowserHistory.md +10 -2
  50. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +39 -0
  51. package/api/@xmachines/play-dom-router/functions/createRouter.md +54 -0
  52. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +176 -0
  53. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +69 -0
  54. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +15 -0
  55. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +129 -0
  56. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +68 -0
  57. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +54 -0
  58. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +121 -0
  59. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +13 -0
  60. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +27 -0
  61. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +104 -0
  62. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +28 -0
  63. package/api/@xmachines/play-react/README.md +185 -334
  64. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +46 -42
  65. package/api/@xmachines/play-react/functions/ActionProvider.md +21 -0
  66. package/api/@xmachines/play-react/functions/JSONUIProvider.md +21 -0
  67. package/api/@xmachines/play-react/functions/Renderer.md +21 -0
  68. package/api/@xmachines/play-react/functions/StateProvider.md +27 -0
  69. package/api/@xmachines/play-react/functions/ValidationProvider.md +21 -0
  70. package/api/@xmachines/play-react/functions/VisibilityProvider.md +21 -0
  71. package/api/@xmachines/play-react/functions/defineRegistry.md +49 -0
  72. package/api/@xmachines/play-react/functions/useActor.md +13 -0
  73. package/api/@xmachines/play-react/functions/useBoundProp.md +45 -0
  74. package/api/@xmachines/play-react/functions/usePlayView.md +32 -0
  75. package/api/@xmachines/play-react/functions/useSignalEffect.md +29 -20
  76. package/api/@xmachines/play-react/interfaces/ActionProviderProps.md +15 -0
  77. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +27 -0
  78. package/api/@xmachines/play-react/interfaces/ComponentContext.md +37 -0
  79. package/api/@xmachines/play-react/interfaces/JSONUIProviderProps.md +22 -0
  80. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
  81. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -6
  82. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +26 -0
  83. package/api/@xmachines/play-react/interfaces/RendererProps.md +17 -0
  84. package/api/@xmachines/play-react/interfaces/StateProviderProps.md +16 -0
  85. package/api/@xmachines/play-react/interfaces/ValidationProviderProps.md +14 -0
  86. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +20 -0
  87. package/api/@xmachines/play-react/interfaces/VisibilityProviderProps.md +13 -0
  88. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -0
  89. package/api/@xmachines/play-react/type-aliases/ComponentFn.md +36 -0
  90. package/api/@xmachines/play-react/type-aliases/RenderErrorHandler.md +23 -0
  91. package/api/@xmachines/play-react/variables/ActorProvider.md +33 -0
  92. package/api/@xmachines/play-react/variables/PlayRenderer.md +6 -56
  93. package/api/@xmachines/play-react/variables/PlayUIProvider.md +43 -0
  94. package/api/@xmachines/play-react-router/README.md +130 -114
  95. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +19 -242
  96. package/api/@xmachines/play-react-router/classes/RouteMap.md +48 -36
  97. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +45 -0
  98. package/api/@xmachines/play-react-router/functions/createRouteMap.md +39 -0
  99. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +23 -12
  100. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +68 -0
  101. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +22 -12
  102. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +32 -0
  103. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +25 -9
  104. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +13 -0
  105. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +19 -9
  106. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +8 -8
  107. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
  108. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +32 -0
  109. package/api/@xmachines/play-router/README.md +285 -355
  110. package/api/@xmachines/play-router/classes/RouteMap.md +149 -0
  111. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +21 -221
  112. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +32 -0
  113. package/api/@xmachines/play-router/functions/buildRouteTree.md +12 -2
  114. package/api/@xmachines/play-router/functions/createRouteMap.md +22 -36
  115. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +46 -0
  116. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +14 -7
  117. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +10 -46
  118. package/api/@xmachines/play-router/functions/extractQuery.md +22 -0
  119. package/api/@xmachines/play-router/functions/extractRouteParams.md +54 -0
  120. package/api/@xmachines/play-router/functions/findRouteById.md +2 -2
  121. package/api/@xmachines/play-router/functions/findRouteByPath.md +2 -2
  122. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +2 -2
  123. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +2 -2
  124. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +43 -0
  125. package/api/@xmachines/play-router/functions/isRouteReachable.md +38 -0
  126. package/api/@xmachines/play-router/functions/machineToGraph.md +19 -0
  127. package/api/@xmachines/play-router/functions/routeExists.md +2 -2
  128. package/api/@xmachines/play-router/functions/sanitizePathname.md +40 -0
  129. package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -9
  130. package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
  131. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +13 -0
  132. package/api/@xmachines/play-router/interfaces/LocationLike.md +27 -0
  133. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +17 -0
  134. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +17 -0
  135. package/api/@xmachines/play-router/interfaces/PlayActor.md +68 -0
  136. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +22 -12
  137. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +17 -0
  138. package/api/@xmachines/play-router/interfaces/RoutableActor.md +64 -0
  139. package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
  140. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +13 -0
  141. package/api/@xmachines/play-router/interfaces/RouteMapping.md +27 -0
  142. package/api/@xmachines/play-router/interfaces/RouteMatch.md +12 -0
  143. package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
  144. package/api/@xmachines/play-router/interfaces/RouteObject.md +5 -5
  145. package/api/@xmachines/play-router/interfaces/RouteTree.md +8 -7
  146. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +55 -0
  147. package/api/@xmachines/play-router/interfaces/RouterBridge.md +8 -8
  148. package/api/@xmachines/play-router/interfaces/WindowLike.md +65 -0
  149. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +20 -0
  150. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
  151. package/api/@xmachines/play-signals/README.md +116 -65
  152. package/api/@xmachines/play-signals/functions/watchSignal.md +42 -0
  153. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +7 -5
  154. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +3 -3
  155. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +7 -5
  156. package/api/@xmachines/play-signals/interfaces/SignalState.md +4 -4
  157. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +5 -5
  158. package/api/@xmachines/play-signals/namespaces/Signal/README.md +1 -1
  159. package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +7 -7
  160. package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +8 -8
  161. package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +7 -7
  162. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +1 -1
  163. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +9 -9
  164. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +2 -2
  165. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +2 -2
  166. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +2 -2
  167. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +2 -2
  168. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +2 -2
  169. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +2 -2
  170. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +2 -2
  171. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +2 -2
  172. package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +2 -2
  173. package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +2 -2
  174. package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +2 -2
  175. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +2 -2
  176. package/api/@xmachines/play-solid/README.md +196 -234
  177. package/api/@xmachines/play-solid/functions/ActionProvider.md +19 -0
  178. package/api/@xmachines/play-solid/functions/JSONUIProvider.md +21 -0
  179. package/api/@xmachines/play-solid/functions/Renderer.md +21 -0
  180. package/api/@xmachines/play-solid/functions/StateProvider.md +19 -0
  181. package/api/@xmachines/play-solid/functions/ValidationProvider.md +19 -0
  182. package/api/@xmachines/play-solid/functions/VisibilityProvider.md +20 -0
  183. package/api/@xmachines/play-solid/functions/defineRegistry.md +49 -0
  184. package/api/@xmachines/play-solid/functions/useAction.md +24 -0
  185. package/api/@xmachines/play-solid/functions/useActions.md +13 -0
  186. package/api/@xmachines/play-solid/functions/useActor.md +13 -0
  187. package/api/@xmachines/play-solid/functions/useBoundProp.md +45 -0
  188. package/api/@xmachines/play-solid/functions/useFieldValidation.md +29 -0
  189. package/api/@xmachines/play-solid/functions/useIsVisible.md +19 -0
  190. package/api/@xmachines/play-solid/functions/useOptionalValidation.md +13 -0
  191. package/api/@xmachines/play-solid/functions/usePlayView.md +30 -0
  192. package/api/@xmachines/play-solid/functions/useStateBinding.md +25 -0
  193. package/api/@xmachines/play-solid/functions/useStateStore.md +13 -0
  194. package/api/@xmachines/play-solid/functions/useStateValue.md +25 -0
  195. package/api/@xmachines/play-solid/functions/useVisibility.md +13 -0
  196. package/api/@xmachines/play-solid/interfaces/ActionProviderProps.md +12 -0
  197. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +30 -0
  198. package/api/@xmachines/play-solid/interfaces/ComponentContext.md +37 -0
  199. package/api/@xmachines/play-solid/interfaces/DefineRegistryResult.md +15 -0
  200. package/api/@xmachines/play-solid/interfaces/JSONUIProviderProps.md +22 -0
  201. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +26 -0
  202. package/api/@xmachines/play-solid/interfaces/RendererProps.md +17 -0
  203. package/api/@xmachines/play-solid/interfaces/StateProviderProps.md +13 -0
  204. package/api/@xmachines/play-solid/interfaces/ValidationProviderProps.md +11 -0
  205. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +21 -0
  206. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -0
  207. package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +36 -0
  208. package/api/@xmachines/play-solid/type-aliases/ComponentRegistry.md +11 -0
  209. package/api/@xmachines/play-solid/type-aliases/RenderErrorHandler.md +23 -0
  210. package/api/@xmachines/play-solid/type-aliases/SetState.md +21 -0
  211. package/api/@xmachines/play-solid/type-aliases/VisibilityProviderProps.md +9 -0
  212. package/api/@xmachines/play-solid/variables/ActorContext.md +13 -0
  213. package/api/@xmachines/play-solid/variables/ActorProvider.md +27 -0
  214. package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -62
  215. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +26 -0
  216. package/api/@xmachines/play-solid-router/README.md +153 -562
  217. package/api/@xmachines/play-solid-router/classes/RouteMap.md +31 -32
  218. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +27 -242
  219. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +44 -0
  220. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +18 -11
  221. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +89 -119
  222. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +68 -0
  223. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +22 -12
  224. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +30 -0
  225. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +25 -9
  226. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +13 -0
  227. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +20 -7
  228. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +8 -8
  229. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +34 -0
  230. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +8 -4
  231. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +22 -19
  232. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +52 -0
  233. package/api/@xmachines/play-svelte/README.md +269 -0
  234. package/api/@xmachines/play-svelte/functions/defineRegistry.md +31 -0
  235. package/api/@xmachines/play-svelte/functions/getActorContext.md +21 -0
  236. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +19 -0
  237. package/api/@xmachines/play-svelte/functions/setActorContext.md +19 -0
  238. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +44 -0
  239. package/api/@xmachines/play-svelte/interfaces/BaseComponentProps.md +29 -0
  240. package/api/@xmachines/play-svelte/interfaces/ComponentContext.md +29 -0
  241. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +24 -0
  242. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +43 -0
  243. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +24 -0
  244. package/api/@xmachines/play-svelte/type-aliases/ActionFn.md +30 -0
  245. package/api/@xmachines/play-svelte/type-aliases/Actions.md +17 -0
  246. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -0
  247. package/api/@xmachines/play-svelte/type-aliases/ComponentFn.md +18 -0
  248. package/api/@xmachines/play-svelte/type-aliases/JSONUIProviderProps.md +7 -0
  249. package/api/@xmachines/play-svelte/type-aliases/PlayRenderer.md +9 -0
  250. package/api/@xmachines/play-svelte/type-aliases/RenderErrorHandler.md +23 -0
  251. package/api/@xmachines/play-svelte/type-aliases/SetState.md +21 -0
  252. package/api/@xmachines/play-svelte/variables/PlayRenderer.md +9 -0
  253. package/api/@xmachines/play-svelte-spa-router/README.md +205 -0
  254. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +149 -0
  255. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +32 -0
  256. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +39 -0
  257. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +17 -0
  258. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +129 -0
  259. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +13 -0
  260. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +27 -0
  261. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +104 -0
  262. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +65 -0
  263. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +9 -0
  264. package/api/@xmachines/play-sveltekit-router/README.md +211 -0
  265. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +149 -0
  266. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +32 -0
  267. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +39 -0
  268. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +13 -0
  269. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +27 -0
  270. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +129 -0
  271. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +13 -0
  272. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +27 -0
  273. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +104 -0
  274. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +9 -0
  275. package/api/@xmachines/play-tanstack-react-router/README.md +155 -126
  276. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +48 -36
  277. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +31 -252
  278. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +45 -0
  279. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +22 -36
  280. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +23 -12
  281. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +28 -0
  282. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +68 -0
  283. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +22 -12
  284. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +32 -0
  285. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +25 -9
  286. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +13 -0
  287. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +19 -9
  288. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +6 -6
  289. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +8 -8
  290. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
  291. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +2 -2
  292. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +40 -18
  293. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +34 -0
  294. package/api/@xmachines/play-tanstack-router/README.md +58 -0
  295. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +131 -0
  296. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +57 -0
  297. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +100 -0
  298. package/api/@xmachines/play-tanstack-solid-router/README.md +215 -175
  299. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +31 -32
  300. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +121 -0
  301. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +44 -0
  302. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +18 -11
  303. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +68 -0
  304. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +22 -12
  305. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +31 -0
  306. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +23 -9
  307. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +13 -0
  308. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +14 -10
  309. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +8 -8
  310. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
  311. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +8 -4
  312. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +3 -3
  313. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +40 -18
  314. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +33 -0
  315. package/api/@xmachines/play-vue/README.md +192 -210
  316. package/api/@xmachines/play-vue/functions/defineRegistry.md +32 -0
  317. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +28 -0
  318. package/api/@xmachines/play-vue/functions/useActor.md +13 -0
  319. package/api/@xmachines/play-vue/functions/useBoundProp.md +45 -0
  320. package/api/@xmachines/play-vue/interfaces/ActionProviderProps.md +12 -0
  321. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +25 -0
  322. package/api/@xmachines/play-vue/interfaces/ComponentContext.md +37 -0
  323. package/api/@xmachines/play-vue/interfaces/DefineRegistryResult.md +15 -0
  324. package/api/@xmachines/play-vue/interfaces/JSONUIProviderProps.md +21 -0
  325. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +24 -0
  326. package/api/@xmachines/play-vue/interfaces/RendererProps.md +17 -0
  327. package/api/@xmachines/play-vue/interfaces/StateProviderProps.md +15 -0
  328. package/api/@xmachines/play-vue/interfaces/ValidationProviderProps.md +11 -0
  329. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +21 -0
  330. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +5 -0
  331. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -0
  332. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +16 -0
  333. package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +35 -0
  334. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +15 -0
  335. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +22 -0
  336. package/api/@xmachines/play-vue/type-aliases/RenderErrorHandler.md +23 -0
  337. package/api/@xmachines/play-vue/variables/ActionProvider.md +64 -0
  338. package/api/@xmachines/play-vue/variables/JSONUIProvider.md +105 -0
  339. package/api/@xmachines/play-vue/variables/PlayRenderer.md +2 -2
  340. package/api/@xmachines/play-vue/variables/Renderer.md +88 -0
  341. package/api/@xmachines/play-vue/variables/StateProvider.md +79 -0
  342. package/api/@xmachines/play-vue/variables/ValidationProvider.md +55 -0
  343. package/api/@xmachines/play-vue/variables/VisibilityProvider.md +40 -0
  344. package/api/@xmachines/play-vue-router/README.md +173 -487
  345. package/api/@xmachines/play-vue-router/classes/RouteMap.md +56 -116
  346. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +23 -271
  347. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +26 -6
  348. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +68 -0
  349. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +22 -12
  350. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +13 -0
  351. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +20 -8
  352. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +8 -8
  353. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +8 -4
  354. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +12 -6
  355. package/api/@xmachines/play-xstate/README.md +234 -340
  356. package/api/@xmachines/play-xstate/classes/PlayerActor.md +166 -195
  357. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +31 -20
  358. package/api/@xmachines/play-xstate/functions/composeGuards.md +24 -18
  359. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +17 -17
  360. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +38 -0
  361. package/api/@xmachines/play-xstate/functions/createRoutedMachine.md +87 -0
  362. package/api/@xmachines/play-xstate/functions/definePlayer.md +14 -63
  363. package/api/@xmachines/play-xstate/functions/deriveRoute.md +3 -3
  364. package/api/@xmachines/play-xstate/functions/eventMatches.md +2 -2
  365. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +46 -12
  366. package/api/@xmachines/play-xstate/functions/hasContext.md +2 -2
  367. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +2 -2
  368. package/api/@xmachines/play-xstate/functions/negateGuard.md +16 -16
  369. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +10 -14
  370. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +22 -0
  371. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +12 -13
  372. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -13
  373. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +17 -0
  374. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +27 -6
  375. package/api/@xmachines/play-xstate/type-aliases/Guard.md +2 -2
  376. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +3 -3
  377. package/api/@xmachines/play-xstate/type-aliases/PlayRoutePayload.md +30 -0
  378. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +10 -9
  379. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +22 -5
  380. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +9 -0
  381. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +34 -6
  382. package/api/@xmachines/play-xstate/type-aliases/SetupLike.md +33 -0
  383. package/api/@xmachines/play-xstate/type-aliases/WithOptional.md +31 -0
  384. package/api/@xmachines/play-xstate/variables/emptyEventSchema.md +37 -0
  385. package/api/@xmachines/play-xstate/variables/playMetaSchema.md +40 -0
  386. package/api/@xmachines/play-xstate/variables/playRouteEventSchema.md +9 -0
  387. package/api/@xmachines/shared/README.md +95 -295
  388. package/api/@xmachines/shared/vite-aliases/README.md +11 -0
  389. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +38 -0
  390. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +27 -0
  391. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +30 -0
  392. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +42 -0
  393. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +33 -0
  394. package/api/@xmachines/shared/vitest/README.md +12 -0
  395. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +42 -0
  396. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +34 -0
  397. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +16 -0
  398. package/api/README.md +6 -7
  399. package/api/llms.txt +72 -23
  400. package/contributing/README.md +10 -0
  401. package/contributing/architecture.md +602 -0
  402. package/contributing/configuration.md +368 -0
  403. package/contributing/deployment.md +312 -0
  404. package/contributing/development.md +464 -0
  405. package/contributing/testing.md +453 -0
  406. package/examples/@xmachines/play-dom-demo/README.md +181 -0
  407. package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +24 -0
  408. package/examples/@xmachines/play-dom-demo/functions/initShell.md +24 -0
  409. package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +9 -0
  410. package/examples/@xmachines/play-dom-demo/variables/About.md +12 -0
  411. package/examples/@xmachines/play-dom-demo/variables/Contact.md +12 -0
  412. package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +13 -0
  413. package/examples/@xmachines/play-dom-demo/variables/Home.md +13 -0
  414. package/examples/@xmachines/play-dom-demo/variables/Login.md +13 -0
  415. package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +16 -0
  416. package/examples/@xmachines/play-dom-demo/variables/Navigation.md +13 -0
  417. package/examples/@xmachines/play-dom-demo/variables/Overview.md +13 -0
  418. package/examples/@xmachines/play-dom-demo/variables/Profile.md +13 -0
  419. package/examples/@xmachines/play-dom-demo/variables/Settings.md +13 -0
  420. package/examples/@xmachines/play-dom-demo/variables/Stats.md +13 -0
  421. package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +172 -0
  422. package/examples/@xmachines/play-dom-router-demo/README.md +145 -0
  423. package/examples/@xmachines/play-react-demo/README.md +187 -0
  424. package/examples/@xmachines/play-react-demo/functions/App.md +13 -0
  425. package/examples/@xmachines/play-react-demo/functions/DebugPanel.md +20 -0
  426. package/examples/@xmachines/play-react-demo/functions/HeaderNav.md +20 -0
  427. package/examples/@xmachines/play-react-demo/functions/Shell.md +22 -0
  428. package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +9 -0
  429. package/examples/@xmachines/play-react-demo/variables/About.md +14 -0
  430. package/examples/@xmachines/play-react-demo/variables/Contact.md +14 -0
  431. package/examples/@xmachines/play-react-demo/variables/Dashboard.md +15 -0
  432. package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +15 -0
  433. package/examples/@xmachines/play-react-demo/variables/Home.md +14 -0
  434. package/examples/@xmachines/play-react-demo/variables/Login.md +16 -0
  435. package/examples/@xmachines/play-react-demo/variables/NavBar.md +16 -0
  436. package/examples/@xmachines/play-react-demo/variables/NavBarView.md +15 -0
  437. package/examples/@xmachines/play-react-demo/variables/Navigation.md +14 -0
  438. package/examples/@xmachines/play-react-demo/variables/Overview.md +14 -0
  439. package/examples/@xmachines/play-react-demo/variables/Profile.md +14 -0
  440. package/examples/@xmachines/play-react-demo/variables/Settings.md +14 -0
  441. package/examples/@xmachines/play-react-demo/variables/Shell.md +18 -0
  442. package/examples/@xmachines/play-react-demo/variables/Stats.md +14 -0
  443. package/examples/@xmachines/play-react-demo/variables/authCatalog.md +172 -0
  444. package/examples/@xmachines/play-react-router-demo/README.md +151 -0
  445. package/examples/@xmachines/play-solid-demo/README.md +187 -0
  446. package/examples/@xmachines/play-solid-demo/functions/App.md +13 -0
  447. package/examples/@xmachines/play-solid-demo/functions/DebugPanel.md +20 -0
  448. package/examples/@xmachines/play-solid-demo/functions/HeaderNav.md +20 -0
  449. package/examples/@xmachines/play-solid-demo/functions/Shell.md +22 -0
  450. package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +9 -0
  451. package/examples/@xmachines/play-solid-demo/variables/About.md +9 -0
  452. package/examples/@xmachines/play-solid-demo/variables/Contact.md +9 -0
  453. package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +9 -0
  454. package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +15 -0
  455. package/examples/@xmachines/play-solid-demo/variables/Home.md +9 -0
  456. package/examples/@xmachines/play-solid-demo/variables/Login.md +9 -0
  457. package/examples/@xmachines/play-solid-demo/variables/NavBar.md +11 -0
  458. package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +15 -0
  459. package/examples/@xmachines/play-solid-demo/variables/Navigation.md +9 -0
  460. package/examples/@xmachines/play-solid-demo/variables/Overview.md +9 -0
  461. package/examples/@xmachines/play-solid-demo/variables/Profile.md +9 -0
  462. package/examples/@xmachines/play-solid-demo/variables/Settings.md +9 -0
  463. package/examples/@xmachines/play-solid-demo/variables/Shell.md +17 -0
  464. package/examples/@xmachines/play-solid-demo/variables/Stats.md +9 -0
  465. package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +172 -0
  466. package/examples/@xmachines/play-solid-router-demo/README.md +137 -0
  467. package/examples/@xmachines/play-svelte-demo/README.md +143 -0
  468. package/examples/@xmachines/play-svelte-demo/type-aliases/App.md +9 -0
  469. package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +9 -0
  470. package/examples/@xmachines/play-svelte-demo/variables/App.md +9 -0
  471. package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +172 -0
  472. package/examples/@xmachines/play-svelte-spa-router-demo/README.md +129 -0
  473. package/examples/@xmachines/play-sveltekit-router-demo/README.md +133 -0
  474. package/examples/@xmachines/play-tanstack-react-router-demo/README.md +156 -0
  475. package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +139 -0
  476. package/examples/@xmachines/play-vue-demo/README.md +183 -0
  477. package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +9 -0
  478. package/examples/@xmachines/play-vue-demo/variables/App.md +9 -0
  479. package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +172 -0
  480. package/examples/@xmachines/play-vue-router-demo/README.md +139 -0
  481. package/examples/README.md +78 -30
  482. package/examples/basic-state-machine.md +73 -31
  483. package/examples/form-validation.md +267 -115
  484. package/examples/multi-router-integration.md +314 -194
  485. package/examples/routing-patterns.md +260 -187
  486. package/examples/traffic-light.md +96 -58
  487. package/guides/README.md +9 -21
  488. package/guides/actor-model.md +180 -0
  489. package/guides/getting-started.md +630 -137
  490. package/guides/signals.md +166 -0
  491. package/guides/state-machines.md +300 -0
  492. package/package.json +18 -7
  493. package/rfc/broker.md +100 -0
  494. package/rfc/browser.md +44 -0
  495. package/rfc/cli.md +118 -0
  496. package/rfc/git.md +61 -0
  497. package/rfc/mcp.md +43 -0
  498. package/rfc/node.md +36 -0
  499. package/rfc/play.md +472 -0
  500. package/rfc/rest.md +102 -0
  501. package/rfc/run.md +159 -0
  502. package/rfc/streams.md +168 -0
  503. package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +0 -17
  504. package/api/@xmachines/play-catalog/README.md +0 -331
  505. package/api/@xmachines/play-catalog/functions/defineCatalog.md +0 -98
  506. package/api/@xmachines/play-catalog/functions/defineComponents.md +0 -134
  507. package/api/@xmachines/play-catalog/type-aliases/Catalog.md +0 -48
  508. package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +0 -20
  509. package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +0 -65
  510. package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +0 -17
  511. package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +0 -15
  512. package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +0 -19
  513. package/api/@xmachines/play-react-router-demo/README.md +0 -137
  514. package/api/@xmachines/play-router/classes/BaseRouteMap.md +0 -142
  515. package/api/@xmachines/play-router/functions/connectRouter.md +0 -67
  516. package/api/@xmachines/play-router/functions/crawlMachine.md +0 -92
  517. package/api/@xmachines/play-router/functions/createRouter.md +0 -76
  518. package/api/@xmachines/play-router/functions/extractRoute.md +0 -45
  519. package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +0 -27
  520. package/api/@xmachines/play-router/interfaces/BrowserHistory.md +0 -172
  521. package/api/@xmachines/play-router/interfaces/BrowserWindow.md +0 -69
  522. package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +0 -13
  523. package/api/@xmachines/play-router/interfaces/RouteMap.md +0 -56
  524. package/api/@xmachines/play-router/interfaces/StateVisit.md +0 -15
  525. package/api/@xmachines/play-router/interfaces/VanillaRouter.md +0 -28
  526. package/api/@xmachines/play-router-demo/README.md +0 -137
  527. package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +0 -15
  528. package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +0 -19
  529. package/api/@xmachines/play-solid-router-demo/README.md +0 -127
  530. package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +0 -19
  531. package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +0 -38
  532. package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +0 -33
  533. package/api/@xmachines/play-tanstack-react-router/variables/extractMachineRoutes.md +0 -64
  534. package/api/@xmachines/play-tanstack-react-router-demo/README.md +0 -126
  535. package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +0 -343
  536. package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +0 -19
  537. package/api/@xmachines/play-tanstack-solid-router-demo/README.md +0 -126
  538. package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +0 -14
  539. package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +0 -201
  540. package/api/@xmachines/play-vue-router-demo/README.md +0 -133
  541. package/api/@xmachines/play-xstate/functions/mergeViewProps.md +0 -26
  542. package/api/@xmachines/play-xstate/functions/stateMatches.md +0 -25
  543. package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +0 -39
  544. package/api/@xmachines/play-xstate/functions/validateViewProps.md +0 -80
  545. package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +0 -16
  546. package/api/@xmachines/play-xstate/type-aliases/Catalog.md +0 -21
  547. package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +0 -17
  548. package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +0 -35
  549. package/api/@xmachines/shared/functions/defineXmVitestConfig.md +0 -29
  550. package/api/@xmachines/shared/functions/xmAliases.md +0 -24
  551. package/guides/installation.md +0 -323
@@ -1,223 +1,716 @@
1
+ <!-- generated-by: gsd-doc-writer -->
2
+
1
3
  # Getting Started
2
4
 
3
- Welcome to XMachines! This guide will help you understand what XMachines is and get you up and running with your first state machine.
5
+ This guide serves two audiences:
6
+
7
+ 1. **Contributors** setting up the XMachines JS monorepo for development.
8
+ 2. **Application developers** installing XMachines packages into their own project.
9
+
10
+ Jump to the section that applies to you:
11
+
12
+ - [Contributor Setup](#contributor-setup) — Clone, install, build, and test the monorepo
13
+ - [Application Developer Quickstart](#application-developer-quickstart) — Install packages, define a machine, connect router and renderer
14
+
15
+ ---
16
+
17
+ ## Contributor Setup
18
+
19
+ ### Prerequisites
20
+
21
+ You need the following installed before cloning the repository:
22
+
23
+ | Requirement | Version | Notes |
24
+ | ----------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- |
25
+ | Node.js | `>= 22.0.0` | Specified in all `package.json` `engines` fields |
26
+ | pnpm | via corepack | Enable with `corepack enable`; the version is pinned by the `packageManager` field. The project uses pnpm workspaces. |
27
+ | Git | any recent version | Conventional commit format is enforced by CI |
28
+
29
+ No global TypeScript install is needed — it is installed as a dev dependency via `pnpm install --frozen-lockfile`.
30
+
31
+ > **Node.js version manager tip:** If you manage multiple Node versions with `nvm` or `fnm`, install and activate Node 22 before proceeding.
32
+
33
+ ### Installation Steps
34
+
35
+ #### 1. Clone the repository
36
+
37
+ ```bash
38
+ git clone git@gitlab.com:xmachin-es/xmachines-js.git
39
+ cd xmachines-js
40
+ ```
41
+
42
+ #### 2. Install dependencies
43
+
44
+ Always use `pnpm install --frozen-lockfile` (not `pnpm install`) to respect the lockfile exactly:
45
+
46
+ ```bash
47
+ corepack enable
48
+ pnpm install --frozen-lockfile
49
+ ```
50
+
51
+ This installs the exact versions recorded in the lockfile for all workspace packages.
4
52
 
5
- ## What is XMachines?
53
+ #### 3. Build all packages
6
54
 
7
- XMachines is a TypeScript implementation of the Universal Player Architecture—a state machine library that strictly separates business logic from infrastructure. It enables logic-driven applications where state machines control routing, views, and navigation through standardized TC39 Signals.
55
+ ```bash
56
+ pnpm run build
57
+ ```
58
+
59
+ The root `tsc --build` command uses TypeScript project references to compile all packages in correct dependency order. Build outputs go to each package's `dist/` directory (gitignored).
60
+
61
+ ### First Run
62
+
63
+ Verify your setup is working end-to-end:
64
+
65
+ ```bash
66
+ pnpm test
67
+ ```
8
68
 
9
- At its core, XMachines is built on the actor model, following the principle that **business logic must be the single source of truth** for navigation, state, and UI structure. Infrastructure reflects actor state—it never decides.
69
+ All tests should pass on a freshly cloned and built repository. If they do, your environment is correctly configured.
10
70
 
11
- Unlike traditional frameworks where your logic adapts to the framework, XMachines inverts this relationship. Your state machines own the application behavior, and the infrastructure (routers, view renderers, React components) passively observes and reflects the current state through signals. This results in complete runtime agnosticism—your logic has zero framework dependencies.
71
+ ### Dev Container (Optional)
12
72
 
13
- ## Why XMachines?
73
+ A fully configured dev container is provided at `.devcontainer/`. It uses Docker Compose with a Node 22 Bookworm base image and includes Docker-outside-of-Docker, Claude Code, and OpenCode pre-installed.
14
74
 
15
- **Type Safety with TypeScript**
75
+ **VS Code:** Open the repository and choose **Reopen in Container** when prompted.
16
76
 
17
- - Full type inference from state machine catalog through to components
18
- - Catch navigation errors and state bugs at compile time
19
- - Zod validation for UI schemas and state structures
77
+ **CLI:**
20
78
 
21
- **Predictable State Management**
79
+ ```bash
80
+ pnpm run devcontainer:up
81
+ ```
22
82
 
23
- - State machines make application behavior explicit and testable
24
- - Actor model ensures clear message passing patterns
25
- - Guard enforcement prevents invalid state transitions
83
+ To customize the container, copy the sample env file:
26
84
 
27
- **Platform Flexibility**
85
+ ```bash
86
+ cp .devcontainer/.env.sample .devcontainer/.env
87
+ ```
28
88
 
29
- - Runtime-agnostic core packages work in browser, Node, or Deno
30
- - Choose only the packages you need for your platform
31
- - Framework integrations (React, TanStack Router) are optional adapters
89
+ Available variables:
32
90
 
33
- **Modular Architecture**
91
+ | Variable | Default | Description |
92
+ | ----------------------------- | ------- | -------------------------------------------------- |
93
+ | `OPENCODE_EXPERIMENTAL_OXFMT` | `false` | Enables experimental oxfmt inside the opencode UI |
94
+ | `OPENCODE_PORT_MAPPING` | `4096` | Docker port mapping for the opencode web interface |
34
95
 
35
- - 8 focused packages that work together seamlessly
36
- - `@xmachines/play` foundation works with any infrastructure
37
- - Mix and match adapters based on your stack
96
+ ### Common Setup Issues (Monorepo)
97
+
98
+ #### Tests fail with `Cannot find module` errors
99
+
100
+ The test suite relies on TypeScript path aliases that resolve to source files. If aliases are not resolving:
101
+
102
+ 1. Run `pnpm run build` first — some packages need their `dist/` present even in development.
103
+ 2. Confirm your package's `vitest.config.ts` uses `defineXmVitestConfig` from `@xmachines/shared/vitest`, which automatically configures the `@xmachines/*` path aliases.
104
+
105
+ #### TypeScript errors about missing types after adding a dependency
106
+
107
+ Run `pnpm install --frozen-lockfile` again to ensure all types are installed. If you added a workspace-local dependency, also add the correct `references` entry in the package's `tsconfig.base.json`.
108
+
109
+ #### Lint errors about import extensions
110
+
111
+ All TypeScript imports must end with `.js`, even for `.ts` source files:
112
+
113
+ ```typescript
114
+ // ✅ Correct
115
+ import { PlayError } from "./errors.js";
116
+
117
+ // ❌ Wrong — will fail at runtime
118
+ import { PlayError } from "./errors";
119
+ ```
38
120
 
39
- ## Quick Start
121
+ Your editor's auto-import may omit the extension — fix it manually or configure the editor to add `.js` automatically.
122
+
123
+ #### Build is slow after `git clean`
124
+
125
+ TypeScript incremental builds depend on `.tsbuildinfo` files. After a full clean, these are gone and the initial build will be slower. This is expected.
126
+
127
+ ### Next Steps (Contributors)
128
+
129
+ Once your setup is verified, continue with:
130
+
131
+ - **[Architecture](../contributing/architecture.md)** — System design, layers, invariants, and data flow
132
+ - **[Contributing](../../../CONTRIBUTING.md)** — Coding standards, branch conventions, and PR process
133
+ - **[Development](../contributing/development.md)** — Full development lifecycle: build commands, adding packages, commit conventions
134
+ - **[Testing](../contributing/testing.md)** — Vitest setup, test conventions, coverage thresholds, browser tests
135
+ - **[packages/docs/rfc/](../rfc/)** — RFC specifications (read the relevant RFC before implementing any feature)
136
+
137
+ ---
138
+
139
+ ## Application Developer Quickstart
140
+
141
+ This section covers installing XMachines packages into your own application and wiring together a state machine, router adapter, and view renderer.
142
+
143
+ ### Prerequisites
144
+
145
+ - **Node.js** `>= 22.0.0`
146
+ - **pnpm** via corepack (`corepack enable`)
147
+ - **TypeScript** `>= 5.7` (strict mode recommended)
148
+ - **XState** `v6` (required peer dependency for [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md))
149
+
150
+ All packages are ES modules (`"type": "module"`). Use `.js` extensions in all TypeScript imports.
40
151
 
41
152
  ### Installation
42
153
 
43
- First, install XMachines packages. See the complete [Installation →](installation.md) guide for all package managers and environments.
154
+ #### Step 1: Install the core packages
155
+
156
+ Every XMachines application needs these three packages plus XState:
157
+
158
+ ```bash
159
+ pnpm add xstate @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals
160
+ ```
161
+
162
+ | Package | Role |
163
+ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
164
+ | `xstate` | XState v6 state machine engine (peer dependency) |
165
+ | [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md) | [`definePlayer()`](../api/@xmachines/play-xstate/functions/definePlayer.md), [`PlayerActor`](../api/@xmachines/play-xstate/classes/PlayerActor.md), routing helpers |
166
+ | [`@xmachines/play-actor`](../api/@xmachines/play-actor/README.md) | Abstract actor base class and interface types |
167
+ | [`@xmachines/play-signals`](../api/@xmachines/play-signals/README.md) | TC39 Signals polyfill (`Signal.State`, `Signal.Computed`, [`watchSignal`](../api/@xmachines/play-signals/functions/watchSignal.md)) |
168
+
169
+ #### Step 2: Install a router adapter (pick one)
44
170
 
45
171
  ```bash
46
- npm install @xmachines/play @xmachines/play-xstate
172
+ # Provider pattern (framework-integrated routers)
173
+ pnpm add @xmachines/play-tanstack-react-router # TanStack Router (React)
174
+ pnpm add @xmachines/play-tanstack-solid-router # TanStack Router (SolidJS)
175
+ pnpm add @xmachines/play-react-router # React Router v7
176
+ pnpm add @xmachines/play-vue-router # Vue Router 4.x/5.x
177
+ pnpm add @xmachines/play-solid-router # SolidJS Router
178
+
179
+ # connectRouter pattern (framework-agnostic)
180
+ pnpm add @xmachines/play-dom-router # Vanilla DOM (Browser History API)
181
+ pnpm add @xmachines/play-sveltekit-router # SvelteKit
182
+ pnpm add @xmachines/play-svelte-spa-router # Svelte SPA Router
47
183
  ```
48
184
 
49
- ### Import and Create Your First Machine
185
+ #### Step 3: Install a view renderer (pick one)
186
+
187
+ ```bash
188
+ pnpm add @xmachines/play-react # React 18/19
189
+ pnpm add @xmachines/play-vue # Vue 3
190
+ pnpm add @xmachines/play-solid # SolidJS
191
+ pnpm add @xmachines/play-svelte # Svelte 5
192
+ pnpm add @xmachines/play-dom # Vanilla DOM
193
+ ```
194
+
195
+ ---
196
+
197
+ ### Core Actor (No Router, No Renderer)
198
+
199
+ The minimum viable XMachines actor — no framework dependencies:
50
200
 
51
201
  ```typescript
52
- import { createMachine } from "@xmachines/play-xstate";
202
+ import { setup, types } from "xstate";
203
+ import { definePlayer, emptyEventSchema } from "@xmachines/play-xstate";
204
+
205
+ // 1. Declare schemas with setup() — the XState v6 typed entry point
206
+ const appSetup = setup({
207
+ schemas: {
208
+ context: types<{ count: number }>(),
209
+ events: {
210
+ toggle: emptyEventSchema,
211
+ },
212
+ },
213
+ });
53
214
 
54
- // Define a simple traffic light machine
55
- const trafficLightMachine = createMachine({
56
- id: "trafficLight",
57
- initial: "red",
215
+ // 2. Create the machine using setup().createMachine()
216
+ const machine = appSetup.createMachine({
217
+ id: "app",
218
+ initial: "off",
219
+ context: { count: 0 },
58
220
  states: {
59
- red: {
60
- on: { TIMER: "green" },
61
- },
62
- green: {
63
- on: { TIMER: "yellow" },
221
+ off: {
222
+ on: {
223
+ toggle: ({ context }) => ({
224
+ target: "on",
225
+ context: { count: context.count + 1 },
226
+ }),
227
+ },
64
228
  },
65
- yellow: {
66
- on: { TIMER: "red" },
229
+ on: {
230
+ on: {
231
+ toggle: ({ context }) => ({
232
+ target: "off",
233
+ context: { count: context.count + 1 },
234
+ }),
235
+ },
67
236
  },
68
237
  },
69
238
  });
239
+
240
+ // 3. Create a player factory
241
+ const createPlayer = definePlayer({ machine });
242
+
243
+ // 4. Create and start an actor
244
+ const actor = createPlayer();
245
+ actor.start();
246
+
247
+ // 5. Read state
248
+ console.log(actor.getSnapshot().value); // "off"
249
+ console.log(actor.state.get().value); // "off" (TC39 Signal)
250
+
251
+ // 6. Send events — the machine's guards decide all transitions
252
+ actor.send({ type: "toggle" });
253
+ console.log(actor.getSnapshot().value); // "on"
254
+
255
+ // 7. Cleanup
256
+ actor.stop();
70
257
  ```
71
258
 
72
- ### Create an Actor and Transition States
259
+ **Key rules:**
260
+
261
+ - Always use `setup({ schemas })` before `createMachine` — never bare `createMachine` from xstate.
262
+ - Update context by returning a shallow `context` patch from the transition function — there is no `assign` action.
263
+ - Call `actor.start()` before sending events.
264
+ - Call `actor.stop()` when done to clean up signal subscriptions.
265
+
266
+ ---
267
+
268
+ ### Adding Routing
269
+
270
+ State machines control navigation through `meta.route` on states and `play.route` events. The router is passive infrastructure that observes `actor.currentRoute`.
271
+
272
+ #### Define a routable machine with `formatPlayRouteTransitions`
273
+
274
+ `createRoutedMachine` wires routing up from `id` + `meta.route` state pairs (via [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md)): each routed state gets a native XState v6 `route: {}` config, and one root `play.route` forwarder navigates those targets in a single atomic transition, patching `params`/`query` into context:
73
275
 
74
276
  ```typescript
75
- import { createActor } from "@xmachines/play-actor";
277
+ import { setup, types } from "xstate";
278
+ import {
279
+ createRoutedMachine,
280
+ definePlayer,
281
+ emptyEventSchema,
282
+ playMetaSchema,
283
+ playRouteEventSchema,
284
+ } from "@xmachines/play-xstate";
285
+
286
+ const appSetup = setup({
287
+ schemas: {
288
+ // params and query are REQUIRED for routed machines
289
+ context: types<{
290
+ isAuthenticated: boolean;
291
+ params: Record<string, string>;
292
+ query: Record<string, string>;
293
+ }>(),
294
+ events: {
295
+ "play.route": playRouteEventSchema,
296
+ "auth.login": types<{ username: string }>(),
297
+ "auth.logout": emptyEventSchema,
298
+ },
299
+ // meta.route on state nodes needs a declared meta schema
300
+ meta: playMetaSchema,
301
+ },
302
+ });
76
303
 
77
- // Instantiate the machine as an actor
78
- const actor = createActor(trafficLightMachine);
304
+ // createRoutedMachine(appSetup) has the same signature as appSetup.createMachine
305
+ const appMachine = createRoutedMachine(appSetup)({
306
+ id: "app",
307
+ initial: "home",
308
+ context: { isAuthenticated: false, params: {}, query: {} },
309
+ states: {
310
+ home: { id: "home", meta: { route: "/" } },
311
+ about: { id: "about", meta: { route: "/about" } },
312
+ login: { id: "login", meta: { route: "/login" } },
313
+ dashboard: {
314
+ id: "dashboard",
315
+ meta: { route: "/dashboard" },
316
+ // always transition: redirect to /login if not authenticated
317
+ always: ({ context }) => {
318
+ if (context.isAuthenticated) return;
319
+ return { target: "login" };
320
+ },
321
+ },
322
+ profile: { id: "profile", meta: { route: "/profile/:username" } },
323
+ },
324
+ on: {
325
+ "auth.login": ({ context }) => {
326
+ if (context.isAuthenticated) return;
327
+ return {
328
+ target: ".dashboard",
329
+ context: { isAuthenticated: true },
330
+ };
331
+ },
332
+ "auth.logout": ({ context }) => {
333
+ if (!context.isAuthenticated) return;
334
+ return {
335
+ target: ".home",
336
+ context: { isAuthenticated: false },
337
+ };
338
+ },
339
+ },
340
+ });
79
341
 
80
- // Start the actor
342
+ const createPlayer = definePlayer({ machine: appMachine });
343
+ const actor = createPlayer();
81
344
  actor.start();
82
345
 
83
- // Check initial state
84
- console.log(actor.getSnapshot().value); // "red"
346
+ // Read the current route via TC39 Signal
347
+ console.log(actor.currentRoute.get()); // "/"
348
+
349
+ // Navigate — actor guards validate the transition
350
+ actor.send({ type: "play.route", to: "#about" });
351
+ console.log(actor.currentRoute.get()); // "/about"
352
+
353
+ // Attempt a protected route — always transition redirects to login
354
+ actor.send({ type: "play.route", to: "#dashboard" });
355
+ console.log(actor.getSnapshot().value); // "login" (redirect fired)
85
356
 
86
- // Send events to transition states
87
- actor.send({ type: "TIMER" });
88
- console.log(actor.getSnapshot().value); // "green"
357
+ // Navigate with params
358
+ actor.send({ type: "auth.login", username: "alice" });
359
+ actor.send({ type: "play.route", to: "#profile", params: { username: "alice" } });
360
+ console.log(actor.currentRoute.get()); // "/profile/alice"
89
361
 
90
- actor.send({ type: "TIMER" });
91
- console.log(actor.getSnapshot().value); // "yellow"
362
+ actor.stop();
92
363
  ```
93
364
 
94
- ### Observe State Changes with Signals
365
+ **Routing rules:**
95
366
 
96
- ```typescript
97
- import { signal, computed } from "@xmachines/play-signals";
367
+ - Every routable state **must** have an `id` — [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md) throws `MissingStateIdError` if absent.
368
+ - Send `play.route` events with `to: "#stateId"` — always use the `id` field prefixed with `#`, never raw URL paths.
369
+ - The machine context **must** include `params: Record<string, string>` and `query: Record<string, string>`.
370
+ - Use `always` transitions (function form, with an early-return guard) to protect states from direct URL access — these fire even on browser back/forward.
98
371
 
99
- // Create a signal to track actor state
100
- const currentState = signal(actor.getSnapshot().value);
372
+ ---
101
373
 
102
- // Subscribe to actor changes
103
- actor.subscribe((snapshot) => {
104
- currentState.value = snapshot.value;
105
- });
374
+ ### Connecting a Router Adapter
375
+
376
+ Router adapters synchronize `actor.currentRoute` with the browser URL bidirectionally. There are two integration patterns:
377
+
378
+ #### Pattern 1: Provider pattern (React, Vue, SolidJS)
379
+
380
+ Used with framework-integrated routers like TanStack Router. All three props (`actor`, `router`, `routeMap`) **must be stable references** — construct them outside JSX or memoize them.
106
381
 
107
- // Create computed values
108
- const canProceed = computed(() => currentState.value === "green");
382
+ ```tsx
383
+ // React + TanStack Router example
384
+ import { useMemo, useEffect } from "react";
385
+ import { createRouter, createRootRoute } from "@tanstack/react-router";
386
+ import {
387
+ PlayRouterProvider,
388
+ extractMachineRoutes,
389
+ createRouteMapFromTree,
390
+ } from "@xmachines/play-tanstack-react-router";
109
391
 
110
- console.log(canProceed.value); // true when light is green
392
+ // Build OUTSIDE of JSX — must be stable references
393
+ const routeTree = extractMachineRoutes(appMachine);
394
+ const routeMap = createRouteMapFromTree(routeTree);
395
+ const router = createRouter({ routeTree: createRootRoute() });
396
+
397
+ // Actor also created outside the component (or memoized inside)
398
+ const actor = createPlayer();
399
+ actor.start();
400
+
401
+ export function App() {
402
+ return (
403
+ <PlayRouterProvider
404
+ actor={actor}
405
+ router={router}
406
+ routeMap={routeMap}
407
+ renderer={(currentActor, currentRouter) => (
408
+ // Your shell/layout component here
409
+ <Shell actor={currentActor} />
410
+ )}
411
+ />
412
+ );
413
+ }
111
414
  ```
112
415
 
113
- ## Your First Machine: Toggle Example
416
+ #### Pattern 2: `connectRouter` pattern (Vanilla DOM, SvelteKit, Svelte)
114
417
 
115
- Here's a complete working example that demonstrates the core concepts:
418
+ Used with framework-agnostic or server-rendered routers. `connectRouter` handles bidirectional sync: `actor.currentRoute` signal → browser URL, and browser URL changes → `play.route` events sent to the actor.
116
419
 
117
420
  ```typescript
118
- import { createMachine } from "@xmachines/play-xstate";
119
- import { createActor } from "@xmachines/play-actor";
120
- import { signal } from "@xmachines/play-signals";
121
-
122
- // Define the machine configuration
123
- const toggleMachine = createMachine(
124
- {
125
- id: "toggle",
126
- initial: "inactive",
127
- context: {
128
- count: 0,
421
+ import { createBrowserHistory, createRouter, connectRouter } from "@xmachines/play-dom-router";
422
+ import { extractMachineRoutes, createRouteMapFromTree } from "@xmachines/play-router";
423
+
424
+ const routeTree = extractMachineRoutes(appMachine);
425
+ const routeMap = createRouteMapFromTree(routeTree);
426
+ const history = createBrowserHistory({ window });
427
+ const router = createRouter({ routeTree, history });
428
+
429
+ const actor = createPlayer();
430
+ actor.start();
431
+
432
+ const disconnectRouter = connectRouter({ actor, router, routeMap });
433
+
434
+ // Cleanup on unload
435
+ window.addEventListener("beforeunload", () => {
436
+ disconnectRouter();
437
+ router.destroy();
438
+ actor.stop();
439
+ });
440
+ ```
441
+
442
+ ---
443
+
444
+ ### Connecting a View Renderer
445
+
446
+ View renderers map `meta.view` specs from your machine states to real UI components. Each framework package exports a `defineRegistry` function that binds components and actions to a catalog.
447
+
448
+ #### React
449
+
450
+ ```tsx
451
+ import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-react";
452
+ import { defineCatalog } from "@xmachines/json-render-core";
453
+ import { schema } from "@xmachines/play-react";
454
+ import { z } from "zod";
455
+
456
+ const catalog = defineCatalog(schema, {
457
+ components: {
458
+ Home: { props: z.object({ title: z.string() }) },
459
+ Login: { props: z.object({}) },
460
+ },
461
+ actions: {
462
+ login: { params: z.object({ username: z.string() }) },
463
+ logout: {},
464
+ },
465
+ });
466
+
467
+ const registryResult = defineRegistry(catalog, {
468
+ components: {
469
+ Home: ({ props }) => <section>{props.title}</section>,
470
+ Login: ({ on }) => <button onClick={() => on("submit").emit()}>Log in</button>,
471
+ },
472
+ actions: {
473
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
474
+ logout: async () => actor.send({ type: "auth.logout" }),
475
+ },
476
+ });
477
+
478
+ function App() {
479
+ return (
480
+ <PlayUIProvider actor={actor} registryResult={registryResult}>
481
+ <PlayRenderer />
482
+ </PlayUIProvider>
483
+ );
484
+ }
485
+ ```
486
+
487
+ #### Vue 3
488
+
489
+ ```html
490
+ <!-- App.vue -->
491
+ <template>
492
+ <PlayUIProvider :actor="actor" :registry-result="registryResult">
493
+ <PlayRenderer />
494
+ </PlayUIProvider>
495
+ </template>
496
+
497
+ <script setup lang="ts">
498
+ import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-vue";
499
+ import { defineCatalog } from "@xmachines/json-render-core";
500
+ import { schema } from "@xmachines/play-vue";
501
+ import { z } from "zod";
502
+
503
+ const catalog = defineCatalog(schema, {
504
+ components: {
505
+ Home: { props: z.object({ title: z.string() }) },
506
+ Login: { props: z.object({}) },
129
507
  },
130
- states: {
131
- inactive: {
132
- on: {
133
- TOGGLE: {
134
- target: "active",
135
- actions: "incrementCount",
136
- },
137
- },
138
- },
139
- active: {
140
- on: {
141
- TOGGLE: {
142
- target: "inactive",
143
- actions: "incrementCount",
144
- },
145
- },
146
- },
508
+ actions: {
509
+ login: { params: z.object({ username: z.string() }) },
510
+ logout: {},
511
+ },
512
+ });
513
+
514
+ const registryResult = defineRegistry(catalog, {
515
+ components: {
516
+ Home: { template: `<section>{{ props.title }}</section>` },
517
+ Login: { template: `<button @click="on('submit').emit()">Log in</button>` },
147
518
  },
148
- },
149
- {
150
519
  actions: {
151
- incrementCount: ({ context }) => ({
152
- count: context.count + 1,
153
- }),
520
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
521
+ logout: async () => actor.send({ type: "auth.logout" }),
154
522
  },
523
+ });
524
+ </script>
525
+ ```
526
+
527
+ #### SolidJS
528
+
529
+ ```tsx
530
+ import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-solid";
531
+ import { defineCatalog } from "@xmachines/json-render-core";
532
+ import { schema } from "@xmachines/play-solid";
533
+ import { z } from "zod";
534
+
535
+ const catalog = defineCatalog(schema, {
536
+ components: {
537
+ Home: { props: z.object({ title: z.string() }) },
538
+ Login: { props: z.object({}) },
155
539
  },
156
- );
540
+ actions: {
541
+ login: { params: z.object({ username: z.string() }) },
542
+ logout: {},
543
+ },
544
+ });
157
545
 
158
- // Create and start the actor
159
- const toggleActor = createActor(toggleMachine);
160
- toggleActor.start();
546
+ const registryResult = defineRegistry(catalog, {
547
+ components: {
548
+ Home: ({ props }) => <section>{props.title}</section>,
549
+ Login: ({ on }) => <button onClick={() => on("submit").emit()}>Log in</button>,
550
+ },
551
+ actions: {
552
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
553
+ logout: async () => actor.send({ type: "auth.logout" }),
554
+ },
555
+ });
556
+
557
+ function App() {
558
+ return (
559
+ <PlayUIProvider actor={actor} registryResult={registryResult}>
560
+ <PlayRenderer />
561
+ </PlayUIProvider>
562
+ );
563
+ }
564
+ ```
161
565
 
162
- // Bind to a signal for reactive updates
163
- const state = signal(toggleActor.getSnapshot());
566
+ #### Vanilla DOM
164
567
 
165
- toggleActor.subscribe((snapshot) => {
166
- state.value = snapshot;
568
+ ```typescript
569
+ import { createPlayUI, defineRegistry, schema } from "@xmachines/play-dom";
570
+ import { defineCatalog } from "@xmachines/json-render-core";
571
+ import { z } from "zod";
572
+ import type { ComponentFn } from "@xmachines/play-dom";
573
+
574
+ const catalog = defineCatalog(schema, {
575
+ components: {
576
+ Home: { props: z.object({ title: z.string() }) },
577
+ Login: { props: z.object({}) },
578
+ },
579
+ actions: {
580
+ login: { params: z.object({ username: z.string() }) },
581
+ logout: {},
582
+ },
167
583
  });
168
584
 
169
- // Use the machine
170
- toggleActor.send({ type: "TOGGLE" });
171
- console.log(state.value.value); // "active"
172
- console.log(state.value.context.count); // 1
585
+ const Home: ComponentFn<typeof catalog, "Home"> = ({ props }) => {
586
+ const el = document.createElement("section");
587
+ el.textContent = props.title;
588
+ return el;
589
+ };
590
+
591
+ const Login: ComponentFn<typeof catalog, "Login"> = ({ on }) => {
592
+ const el = document.createElement("div");
593
+ const btn = document.createElement("button");
594
+ btn.textContent = "Log in";
595
+ btn.addEventListener("click", () => on("submit").emit());
596
+ el.append(btn);
597
+ return el;
598
+ };
599
+
600
+ const registryResult = defineRegistry(catalog, {
601
+ components: { Home, Login },
602
+ actions: {
603
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
604
+ logout: async () => actor.send({ type: "auth.logout" }),
605
+ },
606
+ });
173
607
 
174
- toggleActor.send({ type: "TOGGLE" });
175
- console.log(state.value.value); // "inactive"
176
- console.log(state.value.context.count); // 2
608
+ const mount = createPlayUI(registryResult);
609
+ const disconnect = mount(actor, document.getElementById("app")!);
610
+
611
+ window.addEventListener("beforeunload", () => disconnect());
177
612
  ```
178
613
 
179
- ### Understanding the Parts
614
+ ---
180
615
 
181
- **States**: Discrete modes your application can be in (`inactive`, `active`)
616
+ ### Common Setup Issues (Application Developers)
182
617
 
183
- **Events**: Messages that trigger transitions (`TOGGLE`)
618
+ #### Missing `params` / `query` in context
184
619
 
185
- **Transitions**: Rules that define which events move between which states (`on: { TOGGLE: 'active' }`)
620
+ **Error:** `MissingQueryContextError` at runtime when using [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md).
186
621
 
187
- **Context**: Extended state data that persists across transitions (`count: 0`)
622
+ **Fix:** Add `params` and `query` fields to your machine context schema and initial value:
188
623
 
189
- **Actions**: Side effects or context updates executed during transitions (`incrementCount`)
624
+ ```typescript
625
+ context: types<{
626
+ params: Record<string, string>;
627
+ query: Record<string, string>;
628
+ // ...other fields
629
+ }>()
630
+ // and initialize them:
631
+ context: { params: {}, query: {}, /* ...other fields */ }
632
+ ```
190
633
 
191
- **Actor**: Runtime instance of a machine that processes events and emits state changes
634
+ #### Missing `id` on routable states
192
635
 
193
- **Signals**: Reactive primitives (TC39 Signals) that enable infrastructure to observe state changes without coupling
636
+ **Error:** `MissingStateIdError: State "home" has meta.route "/" but no id`.
194
637
 
195
- ## Next Steps
638
+ **Fix:** Every state with `meta.route` must declare an explicit `id`:
639
+
640
+ ```typescript
641
+ // ❌ Missing id
642
+ home: { meta: { route: "/" } }
643
+
644
+ // ✅ Correct
645
+ home: { id: "home", meta: { route: "/" } }
646
+ ```
647
+
648
+ #### Actor sends events before `start()`
649
+
650
+ **Symptom:** Events are silently dropped; state never changes.
651
+
652
+ **Fix:** Always call `actor.start()` before `actor.send()`:
653
+
654
+ ```typescript
655
+ const actor = createPlayer();
656
+ actor.start(); // required before any send()
657
+ actor.send({ type: "toggle" });
658
+ ```
196
659
 
197
- Now that you understand the basics, explore these resources:
660
+ #### `routeMap` or `actor` recreated on every render (React/SolidJS)
198
661
 
199
- **Core Documentation**
662
+ **Symptom:** The router bridge disconnects and reconnects on every render.
200
663
 
201
- - [Core Concepts](/docs/api/guides/core-concepts) - Deep dive into architecture and patterns
202
- - [Package Overview](/docs/api/guides/package-overview) - Choose the right packages for your needs
203
- - [API Reference](/docs/api/xmachines/play/readme) - Detailed API documentation
664
+ **Fix:** Construct stable references outside JSX or memoize them:
204
665
 
205
- **Platform Guides**
666
+ ```typescript
667
+ // ✅ Built outside the component
668
+ const routeTree = extractMachineRoutes(appMachine);
669
+ const routeMap = createRouteMapFromTree(routeTree);
206
670
 
207
- - [React Integration](/docs/api/xmachines/play-react/readme) - Use XMachines with React
208
- - [Router Integration](/docs/api/xmachines/play-tanstack-react-router/readme) - Logic-driven routing with TanStack Router
209
- - [UI Schemas](/docs/api/xmachines/play-ui/readme) - Define UI structure from state
671
+ // Or memoized inside the component (React)
672
+ const routeMap = useMemo(() => createRouteMapFromTree(routeTree), [routeTree]);
673
+ ```
210
674
 
211
- **Examples**
675
+ #### Wrong Node.js version
212
676
 
213
- - [Examples Directory](/examples) - More code examples and usage patterns
214
- - Working dashboard demo (coming soon)
677
+ **Error:** `SyntaxError: Cannot use import statement in a module` or TC39 Signals not available.
215
678
 
216
- **Architecture**
679
+ **Fix:** Use Node.js `>= 22.0.0`. Check with:
217
680
 
218
- - [RFC Specification](/rfc) - Complete architectural specification
219
- - [Architecture Docs](/architecture) - System design and technical decisions
681
+ ```bash
682
+ node --version
683
+ ```
220
684
 
221
685
  ---
222
686
 
223
- **Ready to install?** → [Installation Guide](installation.md)
687
+ ## Key Concepts Reference
688
+
689
+ | Term | Description |
690
+ | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
691
+ | `setup({ schemas })` | XState v6 entry point — declares schemas (via `types<T>()`) for context, events, input, and state meta |
692
+ | [`definePlayer({ machine })`](../api/@xmachines/play-xstate/functions/definePlayer.md) | Creates a factory that produces [`PlayerActor`](../api/@xmachines/play-xstate/classes/PlayerActor.md) instances |
693
+ | `actor.start()` | Activates the machine — always call before sending events |
694
+ | `actor.send({ type })` | Sends an event; machine guards decide whether a transition occurs |
695
+ | `actor.getSnapshot()` | Synchronous read of current state and context |
696
+ | `actor.state` | `Signal.State<Snapshot>` — TC39 Signal for reactive state observation |
697
+ | `actor.currentRoute` | `Signal.Computed<string \| null>` — resolved URL from active state's `meta.route` |
698
+ | `actor.currentView` | `Signal.State<PlaySpec \| null>` — view spec from active state's `meta.view` |
699
+ | `createRoutedMachine(setup)` | Setup-typed `createMachine` that wires `id` + `meta.route` state pairs to native routing |
700
+ | [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md) | Underlying transform — native `route: {}` configs plus one root `play.route` forwarder |
701
+ | `play.route` event | Navigation event — `to: "#stateId"`, optional `params`, `query` |
702
+ | `always` transition | Protects states — fires on entry before any event, even on direct URL access |
703
+ | [`extractMachineRoutes`](../api/@xmachines/play-router/functions/extractMachineRoutes.md) | Extracts a `RouteTree` from a state machine — used by framework-integrated router adapters |
704
+ | [`createRouteMapFromTree`](../api/@xmachines/play-router/functions/createRouteMapFromTree.md) | Builds a `RouteMap` from a `RouteTree` for bidirectional state ID ↔ URL lookups |
705
+ | [`connectRouter`](../api/@xmachines/play-dom-router/functions/connectRouter.md) | Connects a vanilla DOM router to an actor — returns a disconnect cleanup function |
706
+ | [`PlayRouterProvider`](../api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md) | React component that connects a `PlayerActor` to TanStack React Router |
707
+
708
+ ---
709
+
710
+ ## Next Steps
711
+
712
+ - **[Architecture](../contributing/architecture.md)** — System design, layers, invariants, and data flow
713
+ - **[Play RFC](../rfc/play.md)** — Complete architectural specification
714
+ - **[API Reference](../api/README.md)** — Auto-generated API docs for all packages
715
+ - **[Examples](../examples/)** — Basic state machine, form validation, routing pattern demos
716
+ - **[Contributing](../../../CONTRIBUTING.md)** — Coding standards, branch conventions, and PR process (contributors)