- 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.
20 lines
510 B
Bash
Executable file
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)"
|