Replace the hand-rolled betting rules, side pots, showdown and hand
evaluator with the published @pokertools/engine and @pokertools/evaluator
libraries (MIT, pinned to 2.1.0).
- server/hand.js now wraps a PokerEngine per hand: it maps seats,
mirrors stacks, staggers the all-in runout, and pays host-chosen
winners on cash-only tables.
- server/cards.js and server/ai.js use the library evaluator.
- Out-of-turn folds go through the engine's stand; all-in hands stay
live when the player leaves; uncalled bets return to a leaver.
- The engine refuses some check-able folds that would leave a side pot
without eligible players; those now return a message (or check for
a leaving player) instead of crashing.
- BB must be greater than SB (engine requirement); Node >= 24.
- Tests rig cards via engine snapshots and cover the new edge cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Create screen: choose キャッシュオンリー (real cards, chips only), 友人戦
(server deals and settles) or CPU戦 (友人戦 plus 1–8 CPU players); replaces
the card toggle. The lobby shows each table's type
- Poker AI written from scratch (server/ai.js, no libraries): fast 7-card
evaluator (checked against bestHand), Monte Carlo equity, and decisions from
hand rank, pot odds, raise count, opponents and a per-CPU style (aggression,
bluff rate); continuation bets via the last aggressor. It never sees other
players' hole cards
- CPU seats: think time of 0.7–1.8s (faster when no human is left in the hand),
automatic rebuy, never the host, no new hand unless a human is playing,
re-think after pause
- Play UI: robot avatars and a "考えています…" status for CPU turns
- Tests for the evaluator, equity, legality of AI actions and CPU tables
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>