Minimal infinite hex tic tac toe.
Credit to @webgoatguy on Youtube: https://www.youtube.com/watch?v=Ob6QINTMIOA
- Frontend: plain TypeScript + canvas
- Runtime: Cloudflare Workers
- State: Durable Objects
- Async compute: Cloudflare Queues
- Remote inference: Modal
- Rules engine: Rust compiled to WebAssembly (
engine/)
- Local play mode with chess clocks
- Create a room
- Join with a 6 digit code
- Play against browser bots (
sprout,seal,ambrosia,hydra,orca) - Play against remote Kraken on Modal
- Anonymous sessions with token-based reconnect
- Infinite hex canvas with pan
- Polling-based room sync
npm install
npm run devThen open the Wrangler URL shown in the terminal.
GET /api/v1/bots returns a bot catalog. Each entry includes:
namelabeldescriptionexecution(browserorremote)versionavailableofflineCapable
The Worker exposes session-agnostic compute primitives:
POST /api/v1/compute/best-movePOST /api/v1/compute/best-move/jobsPOST /api/v1/compute/evalPOST /api/v1/compute/eval/jobsGET /api/v1/compute/jobs/:id
Server-side compute is Kraken-only. Browser bots run in the client.
POST /api/v1/sessions/privatePOST /api/v1/sessions/botPOST /api/v1/sessions/joinGET /api/v1/sessions/:id/statePOST /api/v1/sessions/:id/moves
Move writes use compare-and-set semantics with basePositionId.
- Create the Modal secret:
TOKEN=$(openssl rand -hex 32)
uvx modal secret create six-tac-kraken-auth MODAL_BOT_TOKEN="$TOKEN"- Deploy Modal:
npm run deploy:modal- Set Worker secrets:
wrangler secret put BOT_SERVICE_URL
wrangler secret put MODAL_BOT_TOKEN- Deploy the Worker:
npm run deploy- Browser bots are computed locally and submit through the same session move API as human players.
- Remote bot turns and async evals are modeled as compute jobs backed by Durable Objects and Cloudflare Queues.
- Session staleness is based on
positionId, not a turn counter. - Static assets are built into
public/.