No description
Wires the starting-layout picker into the lobby UI. Users can now:
- Pick a premade (Classic / Dunsany / Monster / Pawns-Only / Horde /
Knightmate / Chess960 / Empty) from the Host Game section.
- Paste a shareable link (?layoutId=dunsany or ?fen=<encoded>) to
pre-select a layout when arriving at the lobby.
- See the selected layout's name as a purple badge on the game view
header next to the room code (hidden for Classic, the default).
Components:
- ui/LayoutPicker.tsx: dropdown reading LAYOUT_REGISTRY. Chess960
re-seeds on each selection. Custom... entry can be wired to the
editor modal in Phase E.
- ui/Lobby.tsx: LayoutPicker above Create Room, URL-param reader
for ?layoutId / ?fen / ?name (validated via validateLayout —
malformed links silently fall back to Classic).
- ui/GameView.tsx: new LayoutBadge (inline) reads sessionStorage
'layout-name' written by Lobby on create/join.
Networking:
- net/types.ts: LayoutRequest discriminated union, PiecePlacementWire,
ResolvedLayoutWire added; RoomCreate/RoomCreated/RoomJoined
payloads now carry optional 'layout' fields mirroring the server.
- net/lobby-request.ts: OneShotRoomResult returns the resolved
layout from room.created / room.joined when the server echoes it.
Persistence:
- persist/autosave.ts: keyed-by-layout storage slots
(paratype-chess:v2:autosave:${layoutId}). One-time migration moves
the legacy v1 key into the classic slot so existing FIDE saves
survive. New clearAllAutoSaves wipes every layout slot; used by
Lobby when starting a fresh game.
1011 tests passing; bun run check clean. Manual smoke pending.
|
||
|---|---|---|
| .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