#Requires -RunAsAdministrator
$ErrorActionPreference = "Stop"
. (Join-Path $PSScriptRoot "_env.ps1")
$env:CLAUDE_PROXY_NOPAUSE = "1"

Write-Host "CPC Bootstrap..." -ForegroundColor Cyan
Write-Host ("  Home: " + $ProductHome)

$sb = Find-CpcSingBoxExe
if (-not $sb) { throw "sing-box missing - run Install-Product.ps1 first" }
$py = Find-CpcPython
if (-not $py) { throw "Python not found" }
Write-Host ("  sing-box: " + $sb) -ForegroundColor Green
Write-Host ("  python:   " + $py) -ForegroundColor Green

& (Join-Path $ProductHome "Install-SotaCaptureWatcher.ps1")

$mon = Join-Path $ProductHome "Install-NetMonitor.ps1"
if (Test-Path $mon) { & $mon }

Write-Host ""
Write-Host "Bootstrap OK. Дальше: Sota Connect→Disconnect, затем Старт в приложении." -ForegroundColor Green
if (-not $env:CLAUDE_PROXY_KEEP_PAUSE) { }
elseif (-not $env:CLAUDE_PROXY_NOPAUSE) { Pause }
