@echo off
setlocal

set "SCRIPT_DIR=%~dp0"
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
set "PI_CODING_AGENT_DIR=%SCRIPT_DIR%\.pi\agent"
set "PI_CLI_DIST=%SCRIPT_DIR%\packages\coding-agent\dist\cli.js"

if not exist "%PI_CLI_DIST%" (
    echo Build output not found: %PI_CLI_DIST% >&2
    echo Run from repo root: npm run build >&2
    exit /b 1
)

node "%PI_CLI_DIST%" %*
