@echo off
echo [DEBUG] LAUNCHER STARTED
echo [DEBUG] CWD: %CD%
echo [DEBUG] Python Path (expected relative): ..\python\python.exe

REM Read stdin to a file to verify data input (optional debugging)
REM python.exe might be in different relative path depending on where this bat is run
REM We assume this bat is in runtime/app/src/core/
REM So python is in ../../../python/python.exe

set PYTHON_EXE=..\..\..\python\python.exe

if exist "%PYTHON_EXE%" (
    echo [DEBUG] Found Python at %PYTHON_EXE%
) else (
    echo [ERROR] Python NOT found at %PYTHON_EXE%
    echo [ERROR] Listing relative directories:
    dir ..\..\..\
    pause
    exit /b 1
)

echo [DEBUG] Launching script: transcribe_worker.py
"%PYTHON_EXE%" transcribe_worker.py
if %ERRORLEVEL% NEQ 0 (
    echo [ERROR] Python script failed with code %ERRORLEVEL%
    pause
) else (
    echo [SUCCESS] Script finished.
    pause
)
