@echo off
setlocal enabledelayedexpansion
set DIR=%~dp0
set PYTHONPATH=%DIR%orchestrator;%PYTHONPATH%

where python >nul 2>nul
if %errorlevel% neq 0 (
    set PYTHON_CMD=py -3
) else (
    set PYTHON_CMD=python
)

if "%1"=="--help" goto help
if "%1"=="-h" goto help
if "%1"=="--version" goto version
if "%1"=="-v" goto version

%PYTHON_CMD% "%DIR%orchestrator\orchestrator.py" %*
goto end

:version
echo zoth-studio 2.6.0 (Windows x86_64)
goto end

:help
echo Zoth Studio v2.6.0 (Local-First AI Stack - Windows)
echo Usage:
echo   zoth                  Start operator deck on http://127.0.0.1:8484/
echo   zoth serve            Start dashboard server
echo   zoth list             List registered AI tools
echo   zoth run ^<tool^>       Execute local agent tool
echo   zoth doctor           Run dependency and health audit
goto end

:end
