#!/bin/bash
# Sales Prospector Status Check

echo "=== SALES PROSPECTOR STATUS ==="
echo "Checked: $(date)"
echo ""

# Check if running
if pgrep -f "sales-prospector/prospector.sh" > /dev/null; then
  echo "✅ Status: RUNNING"
  echo "PID: $(pgrep -f "sales-prospector/prospector.sh")"
else
  echo "❌ Status: NOT RUNNING"
fi

echo ""

# Show current state
echo "Current State:"
cat "/Users/claw/.openclaw/workspace/agents/sales-prospector/state/prospector-state.json" | jq .

echo ""

# Show today's log summary
echo "Today's Activity:"
LOG="/Users/claw/.openclaw/workspace/agents/sales-prospector/logs/prospector-$(date +%Y%m%d).log"
if [[ -f "$LOG" ]]; then
  echo "Current Metro: $(grep "Metro:" "$LOG" | tail -1 | sed 's/.*Metro: //')"
  echo "Total Starts: $(grep -c "=== Sales Prospector Started ===" "$LOG")"
  echo "Leads Found: $(grep -c "Pushed:" "$LOG")"
  echo "Last 5 activity lines:"
  tail -5 "$LOG"
else
  echo "No log file yet"
fi

echo ""
echo "=== End Status ==="
