param([switch]$Check, [switch]$Once, [string]$Instruction, [switch]$NoPrompt) $ErrorActionPreference = 'Stop' Set-Location $PSScriptRoot $pythonCommand = Get-Command python -ErrorAction SilentlyContinue $bundledPython = Join-Path $env:USERPROFILE '.cache/codex-runtimes/codex-primary-runtime/dependencies/python/python.exe' $runArgs = @('astra.py') if ($Check) { $runArgs += '--check' } if ($Once) { $runArgs += '--once' } if ($Instruction) { $runArgs += @('--instruction', $Instruction) } if ($NoPrompt) { $runArgs += '--no-prompt' } if ($pythonCommand) { & $pythonCommand.Source @runArgs } elseif (Test-Path -LiteralPath $bundledPython) { & $bundledPython @runArgs } elseif (Get-Command uv -ErrorAction SilentlyContinue) { & uv run --python 3.12 python @runArgs } else { throw 'Install Python 3.11+ or uv, then run this script again.' } exit $LASTEXITCODE