#!/bin/bash
# RedFlag Agent Build Script
# Builds agent binary (public key fetched from server at runtime)

set -e

echo "[INFO] [build] RedFlag Agent Build"
echo "================================="

# Build agent
echo "[INFO] [build] Building agent..."
cd aggregator-agent

go build \
    -o redflag-agent \
    ./cmd/agent

cd ..

echo "[INFO] [build] Agent build complete!"
echo "   Binary: aggregator-agent/redflag-agent"
echo ""
echo "[INFO] [build] Note: Agent will fetch the server's public key automatically at startup"
