mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3126] [MERGED] feat(turn-games): add chess as the second conversation-mode table game #5809
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5809
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3126
Author: @Romuromylus
Created: 7/2/2026
Status: ✅ Merged
Merged: 7/2/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/turn-games-chess📝 Commits (7)
62fe8d5feat(turn-games): add chess playable in conversation mode498e4fefix(client): guard board stores by gameType across the turn-game surface7519ef6fix(client): close game setup modals when a game starts underneath them5db006efix(client): unstick game setup modals left mounted after auto-close6f1f450refactor(turn-games): harden seat-ref resolver and drop dead chess field4093ac8fix(client): let game setup modals reopen after a finished game80ea8abfix(client): recover turn-game boards from patches dropped in background chats📊 Changes
28 files changed (+1734 additions, -34 deletions)
View changed files
📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+5 -0)📝
packages/client/src/components/chat/ChatSetupWizard.tsx(+1 -0)➕
packages/client/src/components/chat/ChessBoard.tsx(+424 -0)➕
packages/client/src/components/chat/ChessSetup.tsx(+148 -0)📝
packages/client/src/components/chat/ConversationInput.tsx(+8 -2)📝
packages/client/src/components/chat/ConversationView.tsx(+18 -7)📝
packages/client/src/components/chat/UnoSetup.tsx(+11 -1)📝
packages/client/src/components/ui/Modal.tsx(+13 -0)➕
packages/client/src/hooks/turn-game-keys.ts(+12 -0)➕
packages/client/src/hooks/use-chess.ts(+137 -0)📝
packages/client/src/hooks/use-generate.ts(+40 -4)📝
packages/client/src/hooks/use-uno.ts(+14 -10)📝
packages/client/src/lib/slash-commands.ts(+14 -0)➕
packages/client/src/stores/chess-game.store.ts(+36 -0)📝
packages/server/src/routes/generate.routes.ts(+61 -6)📝
packages/server/src/services/conversation/character-commands.ts(+16 -0)📝
packages/server/src/services/turn-games/turn-game-bot-runner.service.ts(+2 -2)📝
packages/shared/package.json(+1 -0)📝
packages/shared/scripts/generate-feature-registries.mjs(+1 -1)➕
packages/shared/src/features/turn-games/chess/engine.manifest.ts(+5 -0)...and 8 more files
📄 Description
Linked issue
Closes #
No pre-existing tracking issue. Happy to open a feature request for the record if maintainers want one linked.
Why this change
packages/shared/src/features/turn-games/<game>/implementingTurnGameEngine, plus a per-game client surface, with the server runner, REST routes, SSE, and persistence all staying game-agnostic. Chess is the first game built against that contract, so it doubles as a real test of whether the abstraction holds.[chess]conversation command wiring, which mirrors[uno]exactly.What changed
packages/shared/src/features/turn-games/chess/) implementingTurnGameEngine. Moves are SAN, validated bychess.js; the LLM proposes a move via a singlechess_movetool and the engine falls back to a deterministic legal move if the model stalls or proposes something illegal, so a game can never wedge.applyMovenever throws. Auto-draws (stalemate, insufficient material, threefold repetition, fifty-move) are detected from move history; there is no draw-offer handshake in this version (noted under scope below).chess.jsdependency added topackages/sharedonly. Server and client resolve it transitively through shared and never import it directly.[chess]conversation command, mirroring[uno]: server dispatch, a natural-language launcher, a/chessslash command, and a settings toggle. A character that includes[chess]takes the opposing seat; the system runs the board.ChessBoard(hand-authored inline SVG pieces, click-to-move, promotion picker, board flip when the human plays black, check / last-move highlights, captured-piece rows), aChessSetupmodal (pick one opponent, choose colour), a dedicated store, and ause-chesshook over the existing game-agnostic/turn-gamesREST surface.gameTypeso one game's view can never paint another's board; fix setup-modal lifecycle so a modal auto-closes when a game starts underneath it but can still be reopened for a rematch after a finished game; and recover a board when a state patch arrives while the chat is backgrounded (previously the board could get stuck on switch-back until resign or reload).Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm checkpasses (TypeScript + ESLint across all three packages). Local engine + runner tests pass: engine conformance is fuzzed against a freshchess.jsoracle, and the bot-runner path is pinned to confirm the legal-move list is injected into the model prompt. (Those tests are local-only and not part of this diff, matching how the UNO suite is kept.)/chesssetup modal, board render, click-to-move with legal-target dots.[chess]acceptance gate (only the agreeing character is seated).Docs and release impact
Scope / follow-ups
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.