@echo off
REM RHA Wrapper - one-click local launcher (Windows).
REM Prerequisite: Node.js 20+ (https://nodejs.org). Everything else self-installs.
cd /d "%~dp0"

where node >nul 2>nul
if errorlevel 1 (
  echo RHA needs Node.js 20+ - install it from https://nodejs.org and run this again.
  pause
  exit /b 1
)

if not exist node_modules (
  echo First launch - installing dependencies ^(one time^)...
  call npm install --no-audit --no-fund
)

if not exist web\dist (
  call npm run build:web
)

echo Starting RHA on http://localhost:4100 ...
start "" http://localhost:4100/landing.html
call npm run dev
