$ account statelyai
XState is a production-grade TypeScript library for creating, interpreting, and executing finite state machines and statecharts, based on the SCXML standard and the actor model. The repository is a monorepo (pnpm workspaces) containing the core `xstate` package, the lighter `@xstate/store` for event-sourced state management, and framework-specific bindings for React, Vue, Svelte, Solid, Preact, and Angular. It also includes `xstate-inspect` for debugging, `xstate-immer` for Immer integration, a graph analysis module for model-based testing, and many example applications and templates. The core engine provides `createMachine`, `createActor`, `setup()` for type-safe machine definitions, built-in actions (assign, sendTo, raise, etc.), guard combinators, and actor logic factories (`fromPromise`, `fromCallback`, `fromObservable`). The store sub-package offers atoms, source atoms, and composable extensions like persist and undo/redo. The codebase demonstrates high craftsmanship with extensive TypeScript type inference, well-encapsulated modules, and comprehensive test coverage. It is actively maintained with continuous CI/CD and version management via changesets.