diff --git a/README.md b/README.md index 816f5f3..27c0b3b 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,19 @@ ctx task "Audit ./my_project for concurrency race conditions and output to audit cat error.log | grep "Timeout" | ctx task "Explain this failure cascade" ``` + +### Show HN demo loop + +For a dynamic local-vault demo that does not require an LLM key, run: + +```bash +python3 scripts/show_hn_serendipity_demo.py +cat Professional/show-hn-serendipity-brief.md +``` + +For the full CoreTex loop with your provider configured, see +[`docs/ShowHN-Serendipity-Demo.md`](docs/ShowHN-Serendipity-Demo.md). + --- ## 🚀 Installation (Zero-Debt & Frictionless) @@ -51,13 +64,24 @@ For a non-interactive runtime choice, use `./setup.sh --local` or `./setup.sh -- *Note: The script automatically evaluates your localized package manager (`apt`, `dnf`, `yum`, `pacman`, `apk`, or `brew`) to resolve missing system dependencies like `curl`, `unzip`, and `file`.* ### 🔷 Windows (PowerShell) -To bypass native Windows script execution restrictions safely without modifying your global system security profile, execute the script via this process-isolated command: +CoreTex local setup requires Python 3.12+. If Python is missing, or Windows is routing `python` to the Microsoft Store alias, install Python first and reopen PowerShell: + +```powershell +winget install Python.Python.3.12 +``` + +Then run setup through a process-local execution-policy bypass: + ```powershell powershell -ExecutionPolicy Bypass -File .\setup.ps1 -Check # optional preflight diagnostics -powershell -ExecutionPolicy Bypass -File .\setup.ps1 # interactive setup +powershell -ExecutionPolicy Bypass -File .\setup.ps1 -Local # pure local setup ``` -For a non-interactive runtime choice, use `-Local` or `-Docker`. +For Docker setup, start Docker Desktop first, then run: + +```powershell +powershell -ExecutionPolicy Bypass -File .\setup.ps1 -Docker +``` ### 🛡️ Enterprise API Gateways & Proxies CoreTex OS natively supports routing your LLM traffic through enterprise API Gateways (like **Cloudflare AI Gateway**, **Portkey**, or **Helicone**) to centralize observability, rate-limiting, and cost tracking. diff --git a/System/tests/test_windows_setup_guidance.py b/System/tests/test_windows_setup_guidance.py new file mode 100644 index 0000000..85326c9 --- /dev/null +++ b/System/tests/test_windows_setup_guidance.py @@ -0,0 +1,17 @@ +from pathlib import Path + + +def test_windows_setup_detects_python_launcher_versions(): + text = Path("setup.ps1").read_text(encoding="utf-8") + assert "Resolve-PythonCandidate" in text + assert '"-3.12"' in text + assert '"-3.13"' in text + assert '"-3.14"' in text + assert "Microsoft\\WindowsApps\\python.exe" in text + + +def test_windows_setup_error_names_winget_fix(): + text = Path("setup.ps1").read_text(encoding="utf-8") + assert "winget install Python.Python.3.12" in text + assert ".\\setup.ps1 -Local" in text + assert "start Docker Desktop" in text diff --git a/setup.ps1 b/setup.ps1 index 832d136..0e39170 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -37,18 +37,36 @@ function Test-CommandAvailable { return $null -ne (Get-Command $Name -ErrorAction SilentlyContinue) } -function Test-PythonVersionAvailable { - $PythonCmd = Get-Command python -ErrorAction SilentlyContinue - if ($null -eq $PythonCmd) { $PythonCmd = Get-Command py -ErrorAction SilentlyContinue } - if ($null -eq $PythonCmd) { return $false } - +function Resolve-PythonCandidate { $Script = "import sys; need=tuple(map(int, '$CoreTexMinPython'.split('.'))); raise SystemExit(0 if sys.version_info[:2] >= need else 1)" - if ($PythonCmd.Name -eq "py.exe" -or $PythonCmd.Name -eq "py") { - & py -3 -c $Script >$null 2>&1 - } else { - & $PythonCmd.Source -c $Script >$null 2>&1 + $Candidates = @() + + foreach ($CommandName in @("python", "python3", "py")) { + $Cmd = Get-Command $CommandName -ErrorAction SilentlyContinue + if ($null -ne $Cmd) { $Candidates += $Cmd.Source } } - return $LASTEXITCODE -eq 0 + + $WindowsAppsPython = Join-Path $env:LOCALAPPDATA "Microsoft\WindowsApps\python.exe" + foreach ($Candidate in $Candidates) { + if ([string]::IsNullOrEmpty($Candidate)) { continue } + if ($Candidate -eq $WindowsAppsPython) { continue } + & $Candidate -c $Script >$null 2>&1 + if ($LASTEXITCODE -eq 0) { return @{ Command = $Candidate; LauncherArgs = @() } } + } + + $PyLauncher = Get-Command py -ErrorAction SilentlyContinue + if ($null -ne $PyLauncher) { + foreach ($VersionArg in @("-3.14", "-3.13", "-3.12", "-3")) { + & py $VersionArg -c $Script >$null 2>&1 + if ($LASTEXITCODE -eq 0) { return @{ Command = $PyLauncher.Source; LauncherArgs = @($VersionArg) } } + } + } + + return $null +} + +function Test-PythonVersionAvailable { + return $null -ne (Resolve-PythonCandidate) } function Show-NextSteps { @@ -207,7 +225,7 @@ if ($Check) { } Write-Host "Select your preferred deployment architecture:" -ForegroundColor White -Write-Host " [1] Pure Local (Requires uv and Python 3.12+)" +Write-Host " [1] Pure Local (Requires uv and Python ${CoreTexMinPython}+)" if ($DockerAvailable -and $DockerComposeAvailable) { Write-Host " [2] Isolated Container (Requires Docker - ZERO host dependencies)" } else { @@ -256,10 +274,12 @@ if ($DeployChoice -eq "2") { Write-Host "`n[*] Initializing Pure Local Environment..." -ForegroundColor Cyan -if (-not (Test-PythonVersionAvailable)) { - Write-Error "Python ${CoreTexMinPython}+ is required for local setup. Install Python ${CoreTexMinPython}+ or run .\setup.ps1 -Docker." +$PythonCandidate = Resolve-PythonCandidate +if ($null -eq $PythonCandidate) { + Write-Error "Python ${CoreTexMinPython}+ is required for local setup. On Windows, install it with: winget install Python.Python.3.12 ; then reopen PowerShell and run .\setup.ps1 -Local. Or start Docker Desktop and run .\setup.ps1 -Docker." exit 1 } +Write-Host "[+] Python ${CoreTexMinPython}+ detected at $($PythonCandidate.Command)" -ForegroundColor Green $UvBin = Install-UvRuntime Install-DenoRuntime