build_all_agents.sh
1 #!/bin/bash 2 3 # ECHO - Build All Agents 4 # 5 # This script rebuilds all 9 ECHO agent escripts. 6 # Run this after making code changes to any agent. 7 # 8 # Usage: 9 # ./scripts/build_all_agents.sh 10 11 set -e 12 13 ECHO_ROOT="/Users/pranav/Documents/echo" 14 15 # Color output 16 GREEN='\033[0;32m' 17 RED='\033[0;31m' 18 YELLOW='\033[1;33m' 19 NC='\033[0m' # No Color 20 21 echo "================================================================================" 22 echo "ECHO - Building All Agents" 23 echo "================================================================================" 24 echo "" 25 26 # Agent list 27 AGENTS=( 28 "ceo" 29 "cto" 30 "chro" 31 "operations_head" 32 "product_manager" 33 "senior_architect" 34 "uiux_engineer" 35 "senior_developer" 36 "test_lead" 37 ) 38 39 cd "$ECHO_ROOT" 40 41 # First, rebuild shared library 42 echo -e "${YELLOW}⧗ Building shared library...${NC}" 43 cd apps/echo_shared 44 mix deps.get > /dev/null 2>&1 45 mix compile > /dev/null 2>&1 46 echo -e "${GREEN}✓ Shared library built${NC}" 47 echo "" 48 49 cd "$ECHO_ROOT" 50 51 # Now build each agent 52 for agent in "${AGENTS[@]}"; do 53 echo -e "${YELLOW}⧗ Building $agent...${NC}" 54 55 cd "apps/$agent" 56 57 # Clean old caches to avoid corruption 58 rm -rf _build deps > /dev/null 2>&1 59 60 # Get fresh dependencies 61 mix deps.get > /dev/null 2>&1 62 63 # Build escript 64 if mix escript.build 2>&1 | grep -q "Generated escript"; then 65 echo -e "${GREEN}✓ $agent built successfully${NC}" 66 else 67 echo -e "${RED}✗ $agent build failed${NC}" 68 exit 1 69 fi 70 71 cd "$ECHO_ROOT" 72 echo "" 73 done 74 75 echo "================================================================================" 76 echo -e "${GREEN}All 9 agents built successfully!${NC}" 77 echo "================================================================================" 78 echo "" 79 echo "Next steps:" 80 echo " 1. Start agents: ./scripts/run_day1_with_agents.sh" 81 echo " 2. Run orchestrator: cd shared && mix run ../scripts/orchestrate_real_agents.exs" 82 echo ""