ai-code-battle/scripts/build-wasm.sh
jedarden 00069b1870 feat(acb-api): implement bot registration, job coordination, and replay endpoints per plan §12 Phase 4
- POST /api/register: bot registration with URL + shared secret validation
- GET /api/job: worker polls for next pending match job (authenticated)
- POST /api/job/:id/result: worker submits match result (winner, replay JSON)
- GET /api/replay/🆔 serve replay JSON from R2 warm cache (falls back to B2)
- GET /api/bot/🆔 bot profile JSON (rating, elo, record, metadata)
- GET /api/bots: leaderboard snapshot with pagination
- POST /api/ui-feedback: accept Agentation UI feedback

Authentication via Bearer token (worker API key). Shared secrets encrypted
with AES-256-GCM using ACB_ENCRYPTION_KEY.
2026-04-21 08:58:42 -04:00

20 lines
510 B
Bash
Executable file

#!/bin/bash
# Build the Go game engine as WebAssembly for the browser sandbox.
# Outputs: web/public/wasm/engine.wasm
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
WASM_DIR="$PROJECT_ROOT/web/public/wasm"
GO_WASM="$WASM_DIR/engine.wasm"
mkdir -p "$WASM_DIR"
echo "Building Go WASM engine..."
cd "$PROJECT_ROOT"
GOOS=js GOARCH=wasm go build -o "$GO_WASM" ./cmd/acb-wasm
WASM_SIZE=$(du -h "$GO_WASM" | cut -f1)
echo "Built $GO_WASM ($WASM_SIZE)"