Commit Graph

21 Commits

Author SHA1 Message Date
40c919fc64 feat: add viewer voting on user answers with leaderboard scoring
Viewers can now vote for their favourite audience answers during the
30-second voting window. Votes are persisted to the DB at round end
and aggregated as SUM(votes) in the JUGADORES leaderboard.

- db.ts: add persistUserAnswerVotes(); switch getPlayerScores() to SUM(votes)
- game.ts: add userAnswerVotes to RoundState; persist votes before saveRound
- server.ts: add userAnswerVoters map + /api/vote/respuesta endpoint
- frontend.tsx: add userAnswerVotes type; vote state/handler in App; ▲ buttons in Arena
- frontend.css: flex layout for user-answer rows; user-vote-btn styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 18:26:09 +01:00
f9a8e2544f feat: users answer alongside AI instead of proposing questions
- Core mechanic change: users now submit answers to the live prompt,
  competing alongside AI models; answers broadcast to all viewers
- New pricing (no time limit, pure count-based, refillable):
  0,99€ = 10 resp · 9,99€ = 300 resp · 19,99€ = 1000 resp
- DB: new user_answers table; submitUserAnswer() atomically validates
  credit, inserts answer, decrements budget; JUGADORES leaderboard
  now scores by user_answers count
- server: /api/respuesta/enviar endpoint; credit activation sets
  expires_at 10 years out (effectively no expiry); answers injected
  into live round state and broadcast via WebSocket
- frontend: ProposeAnswer widget shows current prompt, textarea active
  during answering phase, tracks per-round submission state;
  Arena shows Respuestas del público section live

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 12:09:53 +01:00
2fac92356d feat: footer, auto-pause on no viewers, and Redsys question submissions
- Footer: add site-footer with one-liner + Cloud Host branding linking to cloudhost.es (mobile only, hidden on desktop)
- Auto-pause: game pauses automatically after AUTOPAUSE_DELAY_MS (default 60s) with no viewers connected; auto-resumes when first viewer connects; shows "Esperando espectadores…" in the UI
- Redsys: new /pregunta page lets viewers pay 1€ via Redsys to submit a fill-in question; submitted questions are used as prompts in the next round instead of AI generation; new redsys.ts implements HMAC_SHA256_V1 signing (3DES key derivation + HMAC-SHA256); notification endpoint at /api/redsys/notificacion handles server-to-server confirmation
- db.ts: questions table with createPendingQuestion / markQuestionPaid / getNextPendingQuestion / markQuestionUsed
- .env.sample: added AUTOPAUSE_DELAY_MS, PUBLIC_URL, REDSYS_* vars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 14:03:30 +01:00
2abea42c18 feat: convert to argument.es — Spanish, vote buttons, Docker
- Translate all ~430 prompts to Spanish with cultural adaptations
- Translate all UI strings (frontend, admin, history, broadcast)
- Translate AI system prompts; models now respond in Spanish
- Replace Twitch/Fossabot viewer voting with in-site vote buttons
- Add POST /api/vote endpoint (IP-based, supports vote switching)
- Vote buttons appear during voting phase with active state highlight
- Rename project to argument.es throughout (package.json, cookie, DB)
- Add docker-compose.yml with SQLite volume mount
- Add .env.sample documenting all required and optional vars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 13:09:00 +01:00
Theo Browne
ccaa86b4a6 send on transitions 2026-02-22 21:50:01 -08:00
Theo Browne
79f9dab7fb new layout for model rankings 2026-02-22 18:44:49 -08:00
Theo Browne
845065ac8f voting why not lol 2026-02-22 17:22:59 -08:00
Theo Browne
c01f3ff076 cleanup events + limits + more logs 2026-02-22 16:23:46 -08:00
Theo Browne
5fbdee5ecc reasoning 2026-02-22 05:23:46 -08:00
Theo Browne
54c45f6028 reset fix 2026-02-22 04:32:41 -08:00
Theo Browne
dc9ac4e7c8 admin and higher limits 2026-02-22 01:20:19 -08:00
Theo Browne
73e2d6382e fix quote wrapper 2026-02-20 05:34:04 -08:00
Theo Browne
0f653c79bb title fix, more randomized 2026-02-20 05:26:20 -08:00
Theo Browne
77f68d440c logo, fix db loading 2026-02-20 04:49:40 -08:00
Theo Browne
593ad125ff Pause 2026-02-20 04:26:14 -08:00
Theo Browne
1bfd3450c7 More cleanup and also bulk testing 2026-02-20 03:49:57 -08:00
Theo Browne
6b4ed5fcb3 minimax 2026-02-20 02:52:39 -08:00
Theo Browne
104eb8e73e game progress 2026-02-20 02:49:19 -08:00
Theo Browne
6bd3718cad better 2026-02-20 00:28:48 -08:00
Theo Browne
53f0543e99 infinite slop 2026-02-19 23:51:56 -08:00
Theo Browne
bca390ae75 web version 2026-02-19 22:46:41 -08:00