No description
Each room owns a ChessEngine wrapped in a GameSession; only the server calls insert/retract/fireRules and all EntityIds are minted server-side. GameSessionRegistry keys sessions by room code so two rooms cannot observe or collide with each other's working-memory state. GameSession.applyMove validates algebraic inputs, finds the matching legal move via ChessEngine.findMove, applies it, and returns a fact- level diff (inserted/retracted) plus the new turn and terminal state. Terminal states are sticky: further moves after checkmate/draw return GAME_OVER rather than silently mutating a dead session. Exposes @paratype/chess's headless surface (ChessEngine, coord helpers, schema types) via a new package entry point; the React app continues to import concrete modules directly. |
||
|---|---|---|
| .github/workflows | ||
| .sisyphus | ||
| docs | ||
| packages | ||
| scripts | ||
| .gitignore | ||
| eslint.config.js | ||
| lefthook.yml | ||
| LICENSE | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.base.json | ||
| tsconfig.json | ||
| vitest.workspace.ts | ||
@paratype
A Doorenbos-style Rete II rules engine for TypeScript games, with an authoritative WebSocket chess demo.
Packages
packages/rete— Rete II engine corepackages/chess— Browser chess demo (React + Vite)packages/server— Authoritative Bun WebSocket server
Docs
- SPEC.md — Engine specification
- PHASES.md — Development phases & perf budgets
- RULES.md — Chess rule presets
- PROTOCOL.md — WebSocket message protocol
Getting Started
bun install && bun run check