@echo off
:: WEVAL Sentinel Agent — One-Click Launcher
:: Downloads latest agent and starts it
echo ============================================
echo   WEVAL SENTINEL AGENT — Auto-Install
echo ============================================
echo.

set DIR=C:\Users\Yace\Desktop\CLAUDE
if not exist "%DIR%" mkdir "%DIR%"

echo [1/3] Downloading latest agent...
powershell -Command "Invoke-WebRequest -Uri 'https://weval-consulting.com/products/weval-sentinel-agent.ps1' -OutFile '%DIR%\sentinel-agent.ps1' -UseBasicParsing"

echo [2/3] Setting up auto-start...
schtasks /Create /TN "WEVAL Sentinel" /TR "powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File %DIR%\sentinel-agent.ps1" /SC ONLOGON /RL HIGHEST /F >nul 2>&1

echo [3/3] Starting agent...
start /min powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "%DIR%\sentinel-agent.ps1"

echo.
echo ✓ Agent started! Window can be closed.
echo   Heartbeat every 60s / Poll every 30s
echo   Auto-restart via watchdog every 5 min
timeout /t 5
