feat: v3 — fight loop, expanded challenges, FightPage ownership guard

- Add fight-loop CLI for automated mock fights with elo-based matchmaking
- Expand challenge types, scoring narrations, arenas, and mock bot pool
- FightPage "Fight again" buttons now only show for your own bot
- FightViewer async scene init, live fight polling with round counter
- Extract mock answers into separate answers module

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-06 23:44:40 +00:00
co-authored by Claude Opus 4.6
parent 47d20fbe66
commit 2c0323d5fb
14 changed files with 2669 additions and 996 deletions
+23
View File
@@ -0,0 +1,23 @@
import './db/index.js'
import { startFightLoop } from './engine/fight-loop.js'
const args = process.argv.slice(2)
const maxFights = parseInt(args.find(a => a.startsWith('--max='))?.split('=')[1] || '0') || Infinity
const intervalMs = parseInt(args.find(a => a.startsWith('--interval='))?.split('=')[1] || '0') || 8000
const style = (args.find(a => a.startsWith('--style='))?.split('=')[1] || 'mixed') as 'random' | 'elo_close' | 'mixed'
console.log('[botfights] fight loop CLI')
console.log(` max fights: ${maxFights === Infinity ? 'unlimited' : maxFights}`)
console.log(` interval: ${intervalMs}ms`)
console.log(` style: ${style}`)
console.log('')
startFightLoop({ maxFights, intervalMs, matchmakingStyle: style })
.then(() => {
console.log('[botfights] fight loop finished')
process.exit(0)
})
.catch((err) => {
console.error('[botfights] fight loop error:', err)
process.exit(1)
})