ding ding ding: https://dm.chillidonut.com/

Tom McKenzie 55a4a3c132 Enforce hand state invariants 1 lună în urmă
client 3f49228ad8 Adopt safe lit-html rendering 1 lună în urmă
docs 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă
drizzle 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă
public 3f49228ad8 Adopt safe lit-html rendering 1 lună în urmă
scripts 55a4a3c132 Enforce hand state invariants 1 lună în urmă
src 55a4a3c132 Enforce hand state invariants 1 lună în urmă
tests 55a4a3c132 Enforce hand state invariants 1 lună în urmă
.dev.vars.example 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă
.gitignore 3f49228ad8 Adopt safe lit-html rendering 1 lună în urmă
.prettierignore 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă
.prettierrc 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă
README.md 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă
drizzle.config.ts 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă
package.json 55a4a3c132 Enforce hand state invariants 1 lună în urmă
pnpm-lock.yaml 3f49228ad8 Adopt safe lit-html rendering 1 lună în urmă
tsconfig.json 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă
wrangler.toml 6642db7375 Loop prototype: Hono + Better Auth + D1, Hand DO with live Jev odds and the lever, mobile client, spec and day-one learnings 1 lună în urmă

README.md

Plan Maker 2000 (decision-maker-2000) — loop prototype

Spec: docs/spec.md (exported from the Claude Doc, which is the editable source). Learnings: docs/blog/.

Hono + Better Auth (phone OTP + anonymous) + D1/Drizzle + one Durable Object per hand + Jev (TypeSafe System One) for live odds and the lever.

Dev loop

npm install
cp .dev.vars.example .dev.vars        # then paste TYPESAFE_API_KEY + BETTER_AUTH_SECRET
npm run db:migrate:dev                 # local D1 (miniflare)
npm run dev                            # http://localhost:8787  — OTP codes print to this console

Open / on two phones on the same LAN (or wrangler dev --ip 0.0.0.0), "Jump in" with a name, create a hand, open /h/<id> on the other phone.

Scripts

  • npm run dev — wrangler dev, local D1 + DO, hot reload
  • npm run cf-typegen — regenerate worker-configuration.d.ts after editing wrangler.toml
  • npm run auth:update then npm run db:generate — after changing Better Auth plugins
  • npm run db:migrate:dev / :prod
  • npm run deploy — wrangler deploy (first time: wrangler d1 create pm2000-db, paste id into wrangler.toml, wrangler secret put TYPESAFE_API_KEY, wrangler secret put BETTER_AUTH_SECRET)
  • Preview deploys: npx wrangler versions upload gives a preview URL without touching prod

Where things are

  • src/hand.ts — the Hand DO: state, WebSocket fan-out, chips/veto/lock, debounced Jev odds, the lever (seeded sample), rounds
  • src/jev.ts — typed Jev client
  • src/dealer.ts — human-authored dealer line bank; Jev picks by tag
  • src/auth/index.ts — phone OTP (console in dev, Twilio when OTP_MODE=twilio) + anonymous
  • public/index.html — mobile client: felt table, chip stacks, live odds bars, lever, reels reveal with near-miss, rounds
  • wrangler.toml [vars].PICK_INSTRUCTIONS — the "semi-decision-makery" dial. Edit and hot-reload.

Driving it from the CLI

scripts/drive.sh runs a full two-member hand against a running dev server (sign-in, chips, veto, lock, pull, again, accept) and prints odds, winner, reel order and dealer line.

Not here yet

Options agent (screenshot intake / "More options" regen — the client prompts for labels), tables, ledger, rubber-banding, expiry alarms, run structure.