#!/bin/bash
# Script to help find where the gateway code is located

echo "Looking for gateway code..."
echo ""

# Check common locations
LOCATIONS=(
    "$HOME/4Runr-AI-Agent-OS"
    "$HOME/4runr/gateway"
    "/opt/4runr/gateway"
    "/opt/4Runr-AI-Agent-OS"
    "$(pwd)/4Runr-AI-Agent-OS"
    "$(pwd)"
)

for loc in "${LOCATIONS[@]}"; do
    if [ -d "$loc/apps/gateway" ] && [ -f "$loc/apps/gateway/test-all-phases.sh" ]; then
        echo "✓ Found gateway at: $loc"
        echo "  Test script: $loc/apps/gateway/test-all-phases.sh"
        echo ""
        echo "To run tests:"
        echo "  cd $loc/apps/gateway"
        echo "  bash test-all-phases.sh"
        exit 0
    fi
done

echo "Gateway not found in common locations."
echo ""
echo "Current directory: $(pwd)"
echo "Current repo: $(basename $(git rev-parse --show-toplevel 2>/dev/null || echo 'not a git repo'))"
echo ""
echo "Please navigate to the 4Runr-AI-Agent-OS repository and run:"
echo "  cd apps/gateway"
echo "  bash test-all-phases.sh"

