@echo off
setlocal
for %%I in ("%~dp0..") do set "PROJECT_DIR=%%~fI"
cd /d "%PROJECT_DIR%"

set "PYTHON_CMD="

if exist ".venv\Scripts\python.exe" (
  set "PYTHON_CMD=.venv\Scripts\python.exe"
) else (
  py -3.11 --version >nul 2>&1
  if not errorlevel 1 (
    set "PYTHON_CMD=py -3.11"
  )
)

if not defined PYTHON_CMD (
  python --version >nul 2>&1
  if not errorlevel 1 (
    set "PYTHON_CMD=python"
  )
)

if not defined PYTHON_CMD (
  echo Could not find Python. Please install Python 3.11+ first.
  exit /b 1
)

%PYTHON_CMD% scripts\reset_local_runtime_state.py
exit /b %errorlevel%
