ai-code-battle/cmd/acb-wasm/build.sh
jedarden f5d7553f98 Add Phase 7-9 features: evolution dashboard, WASM sandbox, enhanced replay
Phase 7 Evolution:
- Add live-export subcommand to acb-evolver for dashboard JSON generation
- Export programs, stats, and generation log to live.json

Phase 8 Enhanced Features:
- Add WASM game engine build (cmd/acb-wasm/) with JS bindings
- Add in-browser sandbox page with Monaco editor (web/src/pages/sandbox.ts)
- Add win probability computation (web/src/win-probability.ts)
- Add replay commentary generator (web/src/commentary.ts)
- Add clip maker for GIF/MP4 export (web/src/pages/clip-maker.ts)
- Add rivalry detection and pages (web/src/pages/rivalries.ts)
- Add replay feedback system (web/src/pages/feedback.ts)
- Add evolution dashboard page (web/src/pages/evolution.ts)

Phase 9 Platform Depth:
- Add predictions API (cmd/acb-api/predictions.go)
- Add series management API (cmd/acb-api/series.go)
- Add seasons API (cmd/acb-api/seasons.go)
- Add narrative generator for rivalries (cmd/acb-indexer/src/narrative.ts)

Engine Updates:
- Add debug field to move response schema
- Add match event timeline extraction
- Add replay enrichment fields

Web Updates:
- Update app.html navigation for new pages
- Add API client methods for predictions, series, seasons
- Export engine types for browser use

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 01:13:23 -04:00

46 lines
1.4 KiB
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Build the WASM engine and the six built-in bot WASM modules.
#
# Usage:
# ./cmd/acb-wasm/build.sh
#
# Outputs are written to web/public/wasm/:
# engine.wasm game engine with loadState/step/runMatch API
# wasm_exec.js Go WASM runtime shim (copied from GOROOT)
# bots/random.wasm Random strategy
# bots/gatherer.wasm Gatherer strategy
# bots/rusher.wasm Rusher strategy
# bots/guardian.wasm Guardian strategy
# bots/swarm.wasm Swarm strategy
# bots/hunter.wasm Hunter strategy
#
# The bot WASM files implement the ACB WASM bot interface:
# acbBot.init(configJSON) initialise for a new match
# acbBot.compute_moves(stateJSON) return movesJSON for the current turn
#
# Prerequisites: Go 1.21+ with WASM support.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
OUT="$REPO_ROOT/web/public/wasm"
mkdir -p "$OUT/bots"
echo "Building engine.wasm…"
GOOS=js GOARCH=wasm go build \
-o "$OUT/engine.wasm" \
./cmd/acb-wasm/
echo "Copying wasm_exec.js…"
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" "$OUT/"
echo "Building bot WASM modules…"
for bot in random gatherer rusher guardian swarm hunter; do
echo " → bots/${bot}.wasm"
GOOS=js GOARCH=wasm go build \
-o "$OUT/bots/${bot}.wasm" \
"./cmd/acb-wasm/botmain/${bot}/"
done
echo "Done. Outputs in $OUT"