@echo off
setlocal EnableExtensions
set "LOG=%TEMP%\hermes-touch-strixg18-install-h3.log"
call :main > "%LOG%" 2>&1
exit /b %ERRORLEVEL%

:main
echo === HERMES H3 START %DATE% %TIME% ===
hostname
whoami
set "PY=%LOCALAPPDATA%\Programs\Python\Python312\python.exe"
if not exist "%PY%" set "PY=C:\Python312\python.exe"
if not exist "%PY%" (
  echo [ERROR] Python missing.
  exit /b 2
)
set "GITBIN=%ProgramFiles%\Git\cmd"
if exist "%GITBIN%\git.exe" set "PATH=%GITBIN%;%PATH%"
if exist "%ProgramFiles%\Git\bin\git.exe" set "PATH=%ProgramFiles%\Git\bin;%PATH%"
echo [INFO] Python:
"%PY%" --version
echo [INFO] Git:
where git
git --version
"%PY%" -m pip install --upgrade pipx
"%PY%" -m pipx install --force git+https://github.com/NousResearch/hermes-agent.git
set "HERMES_EXE=%USERPROFILE%\.local\bin\hermes.exe"
if not exist "%HERMES_EXE%" (
  echo [ERROR] Hermes exe not found at %HERMES_EXE%
  dir "%USERPROFILE%\.local" /s /b
  exit /b 3
)
"%HERMES_EXE%" --version
"%HERMES_EXE%" doctor
"%HERMES_EXE%" skills list
echo === HERMES H3 DONE %DATE% %TIME% ===
exit /b 0
