# GEMA-0 APEX - pierwszy test (Windows) # Uruchom z root repo: powershell -ExecutionPolicy Bypass -File tools\first-test.ps1 $ErrorActionPreference = 'Stop' $Root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path) Set-Location $Root Write-Host '' Write-Host '=== GEMA-0 APEX - pierwszy test ===' -ForegroundColor Cyan Write-Host "Katalog: $Root" Write-Host '' try { $nodeVer = node -v Write-Host "Node.js: $nodeVer" } catch { Write-Host 'Blad: brak Node.js (wymagane >= 18). https://nodejs.org/' -ForegroundColor Red exit 1 } if (-not (Test-Path '.env')) { Copy-Item '.env.example' '.env' Write-Host 'Utworzono .env z .env.example (GEMINI_API_KEY opcjonalny)' -ForegroundColor Yellow } if (-not (Test-Path 'node_modules')) { Write-Host 'Instalacja npm install...' -ForegroundColor Yellow npm install if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } } Write-Host '' Write-Host 'Uruchamiam npm run test:first ...' -ForegroundColor Cyan Write-Host '' npm run test:first $code = $LASTEXITCODE Write-Host '' if ($code -eq 0) { Write-Host 'OK. Nastepny krok: npm start -> http://127.0.0.1:7878/api/status' -ForegroundColor Green } else { Write-Host 'Test nie przeszedl. Sprawdz log powyzej.' -ForegroundColor Red } exit $code