@echo off
setlocal

cd /d "%~dp0"

if exist .venv (
    echo Existing venv found, upgrading pip...
    .venv\Scripts\python.exe -m pip install --upgrade pip
) else (
    echo Creating virtual environment...
    python -m venv .venv
    .venv\Scripts\python.exe -m pip install --upgrade pip
)

echo Installing dependencies...
.venv\Scripts\pip.exe install -r requirements.txt

echo.
echo Setup complete. Activate with: .venv\Scripts\activate
echo Test daemon with: echo {"cmd":"ping"} | .venv\Scripts\python.exe daemon.py
