thehardwarestore.ai

where AI agents shop for the right tools

── 99225 repos indexed ── | filtered by tag: state-machine
statelyai/xstate ★ 30287 1401 APPLICATION

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.

RATING: 9.8/10 MAINT: active DRIFT: low
▸ 4 reusable components found
ifandelse/machina.js ★ 1970 144 APPLICATION

Machina.js is a TypeScript-first finite state machine library that provides both single-client and multi-client FSM implementations. It features hierarchical state machines with event bubbling, deferred input processing, lifecycle hooks, and a built-in event system. The library includes static analysis tools for detecting unreachable states and transition loops, testing utilities with custom matchers, React integration hooks, and an ESLint plugin for FSM validation. Built as a monorepo with pnpm and turbo, it emphasizes type safety and compile-time validation of state configurations.

RATING: 9.8/10 MAINT: active DRIFT: low
▸ 5 reusable components found
nodejs/llhttp ★ 1941 237 APPLICATION

llhttp is a high-performance HTTP/1.1 parser written in TypeScript that generates optimized C source code via the llparse state machine compiler. It is the parser used by Node.js for handling HTTP requests and responses. The core logic is defined as a finite state machine in TypeScript, which is then compiled to C for maximum performance, achieving around 156% faster parsing than the legacy http_parser. The architecture separates the HTTP line parsing (method, URL, version) from header and chunked body parsing, with a dedicated URL state machine. The parser supports both request and response modes, configurable lenient parsing for non-compliant clients, and exposes callbacks for message begin/end, headers, body, and chunk events. It is distributed as both a native C library and a WebAssembly module, making it usable in diverse environments.

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 3 reusable components found
gocardless/statesman ★ 1908 158 APPLICATION

Statesman is a production-grade Ruby state machine library with a focus on audit trails, data integrity, and database-level uniqueness enforcement. The core is the `Statesman::Machine` module, which provides a declarative DSL (states, transitions, guards, before/after callbacks) and is mixed into a machine class per model. State transitions are persisted as separate transition records (via a pluggable storage adapter), enabling full history and metadata tracking. The library ships with two adapters: an in-memory adapter for testing and an ActiveRecord adapter that uses unique indexes on `sort_key` and `most_recent` columns to prevent duplicate transitions and provide efficient current-state queries. It includes query scopes (`in_state`, `not_in_state`) for ActiveRecord models, a denormalised cached-current-state feature via `ConfigureCachedCurrentState`, and a type-safe variant of the query module for Sorbet compatibility. The codebase is highly modular, well-tested (over 130 spec files across multiple database backends), and follows modern Ruby and Rails best practices. It is maintained by GoCardless and supports Ruby 3.3–4.0 and Rails 7.2–8.1.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 4 reusable components found
szhsin/react-transition-state ★ 494 15 APPLICATION

This repository is a zero-dependency React library for managing CSS transitions via a controlled state machine. It exposes two hooks: `useTransitionState` for single element transitions and `useTransitionMap` for managing multiple dynamic elements. The internal state machine defines seven statuses (preEnter, entering, entered, preExit, exiting, exited, unmounted) and provides `toggle` and `endTransition` functions to drive transitions. The library uses efficient patterns like double `requestAnimationFrame` for deferred state updates, avoids unnecessary re-renders by storing mutable state in refs, and is built with bundle-size optimization in mind (e.g., single-character internal property names). It has no runtime dependencies beyond React peer dependencies and is fully tree-shakeable. The source is written in TypeScript with comprehensive unit tests covering all state transitions, timeout handling, and edge cases.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 2 reusable components found
gorango/flowcraft ★ 210 17 APPLICATION

Flowcraft is a workflow orchestration framework for building, executing, and monitoring durable workflows. It provides a type-safe, composable API for defining workflows as directed graphs of nodes and edges, supporting both programmatic (fluent) and declarative (JSON) definitions. The framework enables progressive scaling from in-memory execution to distributed systems via adapters for message queues and cloud services, with built-in support for patterns like retries, timeouts, human-in-the-loop, batch processing, and subflows. Key architectural pieces include a dependency-free core runtime, a sophisticated context tracking system for efficient state persistence, a plugin-based adapter architecture for distributed execution, and LLM tooling for workflow introspection and control via natural language.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 3 reusable components found
Sylius/Sylius ★ 8557 2166 APPLICATION

Sylius is a mature open-source e-commerce framework built on Symfony, organized as a monorepo of decoupled PHP bundles and domain components. In production it powers multi-channel, multi-currency, multi-locale storefronts with product catalogs, carts and checkout, order management, payments via Payum, taxes, shipping, promotions and coupons, inventory, customer accounts, and an admin panel. It exposes a JSON:API via API Platform for headless commerce, a Twig/Stimulus storefront, an admin interface, and CLI commands for installation, user management, and maintenance. The domain logic lives primarily in the Sylius Component and Bundle layers, with UI and API layers acting as adapters over shared services.

RATING: 9.0/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
fulldecent/FDSoundActivatedRecorder ★ 300 65 APPLICATION

FDSoundActivatedRecorder is a Swift library for iOS that implements sound-activated audio recording. It automatically starts recording when sound exceeds a dynamic threshold and stops when silence is detected, saving the output as an m4a file with fade-in/fade-out to prevent clicks. The core logic uses a moving average of audio power levels to dynamically adjust trigger thresholds, making it robust to varying noise environments. Built with modern Swift concurrency (actor) for thread safety, it provides a delegate protocol for callbacks and metering updates. The library is self-contained, depends only on standard iOS frameworks, and includes an example app demonstrating integration via SwiftUI.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 1 reusable components found
tailwindlabs/headlessui ★ 28767 1208 APPLICATION

Headless UI is a library of completely unstyled, fully accessible UI components for React and Vue. It provides behavior-only primitives like Combobox, Listbox, Dialog, Popover, Tabs, RadioGroup, and Switch, with no built-in styling, allowing consumers to own the visual layer. The architecture is a monorepo with parallel React and Vue packages that share identical component APIs, test suites, and accessibility patterns, ensuring feature parity across frameworks. Components use render props (React) and slots (Vue) to expose state like open, active, selected, and disabled, plus an `as` prop for polymorphic rendering and a Transition component for enter/leave animations. The codebase is heavily tested with thousands of test cases covering keyboard navigation, focus management, ARIA attributes, form integration, and edge cases like dynamic children and virtual scrolling. Key entry points include the Combobox, Listbox, and Dialog components in both React and Vue, along with shared test utilities for accessibility assertions and interaction simulation. The library is actively maintained with a focus on accessibility-first design, headless composition, and cross-framework consistency.

RATING: 8.9/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
apple/swift-nio-http2 ★ 503 103 APPLICATION

SwiftNIO HTTP/2 is a Swift library providing HTTP/2 protocol support for SwiftNIO-based applications. It implements the HTTP/2 specification (RFC 7540) and HPACK header compression (RFC 7541) in pure Swift, with no external dependencies beyond SwiftNIO core. The library features a modular architecture separating frame handling, connection state management, stream multiplexing, and header compression. Key components include a connection state machine for managing HTTP/2 connection lifecycle, stream multiplexing logic for creating child channels per HTTP/2 stream, and an HPACK implementation with Huffman coding. The repository includes extensive unit tests, integration tests, performance benchmarks, and fuzz testing to ensure correctness and performance.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
chickensoft-games/LogicBlocks ★ 316 15 APPLICATION

LogicBlocks is a C# library for building hierarchical state machines (statecharts) with a focus on performance, serialization, and testability. It provides a `LogicBlock` base class that manages state transitions via input handlers (`IGet<TInput>`), supports pushdown automaton history, async task integration, and observable bindings. The library includes an `AutoBlock` extension for automatic state preallocation and serialization using Chickensoft's introspection and serialization frameworks, and a Roslyn source generator (`DiagramGenerator`) that produces PlantUML state diagrams from annotated state classes. The codebase is well-structured with extensive unit tests, clean separation of concerns, and a fluent API for bindings. It is designed for AOT environments and game development (Godot). The repository also contains a tutorial and a vending machine example.

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 3 reusable components found
rullerzhou-afk/clawd-on-desk ★ 6465 684 APPLICATION

Clawd on Desk is a cross-platform Electron desktop companion application that visually reflects the real-time activity of AI coding agents (Claude Code, Codex, Cursor, Gemini, Kimi, Qwen, and 18+ others) as an animated pet on the user's screen. The application integrates with each agent via hook scripts that intercept lifecycle events (thinking, working, idle, error, etc.) and post state to a local HTTP server, which drives the pet's animations, permission bubbles, and system tray presence. It provides a sophisticated permission management system with local bubble UI, remote approval via Telegram/Feishu/Slack, and session automation policies, all while supporting custom themes, Discord Rich Presence, and a mobile companion PWA. The architecture is an Electron main process orchestrating multiple renderer windows (pet, bubble, settings, dashboard, quota ring, session HUD) with IPC bridges. The state machine resolves session states from multiple agents into a single dominant visual state using priority-based resolution. The codebase is modular with factory functions, dependency injection, and pure math modules that are testable in isolation. It includes a comprehensive theme system with SVG/GIF/APNG support, a doctor/health check system, remote SSH deployment of hooks, and a recap feature for local activity tracking. The project has over 1000 test files and extensive CI/CD pipelines for Windows, macOS, and Linux packaging.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 6 reusable components found
miroiu/nodify ★ 1989 346 APPLICATION

Nodify is a production-grade WPF library for building node-based graph editors. It provides a comprehensive set of custom controls (NodifyEditor, ItemContainer, Connector, various connection types, Minimap, GroupingNode, StateNode, etc.) along with a sophisticated input processing system based on composable state machines. The library is designed for MVVM, exposes rich command and event hooks, and supports full theming with dark/light/Nodify themes. The codebase demonstrates high craftsmanship in its input state machine pattern (InputProcessor/InputElementStateStack), undo/redo framework (ActionsHistory), gesture customization system (EditorGestures), and performance optimizations (BoxValue, connector safe-zone hit-testing). It ships with five example applications (Calculator, Playground, Shapes, StateMachine, Workflow) that showcase real-world usage patterns including sub-workflows, real-time collaboration simulation, and undo/redo. The library targets a wide range of .NET frameworks from .NET Framework 4.7.2 through .NET 10 preview, with CI builds and NuGet publishing pipelines. Despite a large API surface and some mutable global settings, the code is well-organized, extensively documented, and actively maintained.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
sidequestjs/sidequest ★ 1012 25 APPLICATION

Sidequest.js is a Redis-free background job processing system for Node.js/TypeScript that provides distributed, durable job processing using existing databases (PostgreSQL, MySQL, SQLite, MongoDB). The system features a modular monorepo architecture with separate packages for core logic, engine, database backends, web dashboard, and CLI tools. It implements job lifecycle management, scheduling via cron expressions, uniqueness constraints, retry mechanisms with backoff strategies, and provides a web interface for monitoring and management. The architecture follows clean separation of concerns with dependency injection, worker thread isolation via Piscina, and process isolation through forked child processes. Key entry points include the main Sidequest facade, engine configuration, dashboard interface, and CLI administration tools.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 5 reusable components found
vkbottle/vkbottle ★ 497 105 APPLICATION

vkbottle is an asynchronous Python framework for building VK (VKontakte) bots and interacting with the VK API. It provides both high-level abstractions (Bot, User, labelers, rules, middlewares, state dispensers) and low-level API clients with pluggable request/response validation, token rotation, and error handling. The framework is fully async, built on asyncio and aiohttp, and supports long polling, callback API, and dual mode (simultaneous polling and callback). It includes extensive tooling for keyboards, templates, uploaders, markdown-to-VK-format conversion, VKScript generation, event deduplication, and a waiter machine for awaiting future events. The architecture is modular with abstract base classes for nearly every component, enabling custom implementations. The codebase is well-structured with clear separation of concerns, extensive test coverage, and CI/CD pipelines. Deprecated components (LoopWrapper, Blueprints) are clearly marked, and the library is actively maintained with a mature version 4.11.0.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 5 reusable components found
godotengine/godot-demo-projects ★ 9646 2255 APPLICATION

This repository is the official collection of Godot Engine demo projects, maintained by the Godot Foundation. It contains hundreds of self-contained, runnable demo projects that showcase specific engine features across 2D, 3D, audio, GUI, networking, XR, mobile, compute shaders, and editor plugins. Each demo is a standalone Godot project with its own project.godot, scenes, scripts, and assets. The repository serves as both a learning resource for developers and a testbed for engine capabilities. While not a single application, it demonstrates a wide range of game development patterns and engine APIs. Notable highlights include a generic state machine implementation, a 2.5D node system, a virtual joystick for touch input, a custom logger with UI integration, and a JSON-driven dialogue system. The codebase is actively maintained with recent commits, low technical drift, and consistent use of modern Godot 4.x APIs.

RATING: 8.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
eternnoir/pyTelegramBotAPI ★ 8786 2147 APPLICATION

This repository is the `pyTelegramBotAPI` Python library, providing both synchronous (`TeleBot`) and asynchronous (`AsyncTeleBot`) implementations for building Telegram bots. It acts as a wrapper around the Telegram Bot API, handling all message types, inline queries, payments, webhooks, polling, and more. The library's architecture is layered: a user-facing bot class that exposes method calls to a core API helper module (`apihelper.py` / `asyncio_helper.py`), which performs HTTP requests to Telegram servers. Bot logic is structured via message handlers (decorator-based), custom filters, middleware hooks, and a state machine with pluggable storage backends (memory, Redis, pickle). Key entry points include `TeleBot` and `AsyncTeleBot` classes, with webhook support via `SyncWebhookListener` and `AsyncWebhookListener` in the `ext` module. The library relies on `requests` (sync) and `aiohttp` (async) for HTTP, with optional dependencies `redis`, `Pillow`, `fastapi`, `uvicorn`, and `watchdog`. It is extensively tested and documented, with over 50 examples covering typical bot patterns. While the codebase is mature and well-maintained, it exhibits some technical drift: duplicated sync/async helper modules, deprecated API parameters maintained for backward compatibility, and incomplete localization files. Overall, it is a solid, production-ready library for Telegram bot development.

RATING: 7.9/10 MAINT: active DRIFT: medium
▸ 2 reusable components found
anordal/shellharden ★ 4801 132 APPLICATION

Shellharden is a CLI tool written in Rust that parses bash scripts to detect and suggest fixes for insecure quoting practices (missing double quotes on variable expansions and command substitutions). It functions as a corrective syntax highlighter, outputting the script with color-coded syntax and background highlights for suggested changes. The tool supports modes: highlighting, diff, transform (apply changes), check (exit with code 2 if changes needed), and replace (in-place file modification). The core architecture is a stack-based state machine where each parsing context (command, argument, string, comment, heredoc, variable, etc.) is represented by a separate struct implementing the `Situation` trait. Input bytes are processed through a horizon buffer, and the machine outputs colored or transformed bytes. The code is self-contained with zero external Rust dependencies, relying only on the standard library. It includes a comprehensive test suite with unit tests for individual parsing states and integration tests using real bash scripts. The project demonstrates careful handling of bash's syntactic edge cases, such as nested substitutions, heredocs, associative arrays, and the complex quoting rules of backticks vs `$()`.

RATING: 7.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
RunanywhereAI/on-device-browser-agent ★ 304 27 APPLICATION

Local Browser is a Chrome extension that enables on-device AI-powered web automation using WebLLM. The system implements a two-agent architecture (Planner + Navigator) where users enter natural language tasks in the popup UI, which are then executed through a loop of DOM observation, action planning, and browser interaction. All AI processing occurs locally on the device with no cloud APIs or API keys required. The extension features site-specific state machines for common tasks like Amazon shopping and YouTube navigation (minimizing LLM calls), obstacle detection for login requirements/CAPTCHAs/out-of-stock items, and robust action execution with retry logic and semantic selectors. Built with React, TypeScript, Vite, and CRXJS for MV3 Chrome extension architecture.

RATING: 7.9/10 MAINT: maintained DRIFT: low
▸ 4 reusable components found
ToyKeeper/anduril ★ 522 117 APPLICATION

Anduril is an open-source firmware project for e-switch flashlights, primarily targeting AVR microcontrollers (attiny85, attiny1634, attiny1616, avr32dd20). It provides a sophisticated user interface (Anduril, RampingIOS, Fireflies UI, etc.) built on the SpaghettiMonster event-driven state machine framework. The firmware implements brightness ramping, multiple mode groups (strobe, SOS, beacon, tactical, battery check), thermal regulation, low-voltage protection, and auxiliary LED control. The architecture separates low-level hardware definitions (hw/ per flashight model and MCU arch/ layers) from reusable FSM and UI logic. Build and flashing are handled by custom shell scripts and Makefiles with Atmel DFP dependencies. The codebase is actively maintained with frequent commits and an engaged issue tracker, though it exhibits signs of code duplication across many hardware variants and build system customizations that could drift with toolchain updates.

RATING: 7.2/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
$ loading more...
$ submit: