File size: 2,334 Bytes
5d07399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Start Symbolic Recursive Engine agent stack
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $PSScriptRoot

# Load .env
$envFile = Join-Path $Root ".env"
if (Test-Path $envFile) {
    Get-Content $envFile | ForEach-Object {
        if ($_ -match '^([^#=]+)=(.*)$') {
            $k = $Matches[1].Trim()
            $v = $Matches[2].Trim()
            if (-not [string]::IsNullOrEmpty($v)) { Set-Item -Path "env:$k" -Value $v }
        }
    }
}

if (-not $env:GATEWAY_URL) { $env:GATEWAY_URL = "http://localhost:3000" }
if (-not $env:GATEWAY_TOKEN) { $env:GATEWAY_TOKEN = "pilot-console-primary-jwt-fallback-x992z" }
$env:PYTHONPATH = $Root

Write-Host "=== Symbolic Recursive Engine Agent ===" -ForegroundColor Cyan

# SRC API (chat + REST tools)
Write-Host "Starting SRC API :8080 ..."
Start-Process pwsh -ArgumentList @(
    "-NoExit", "-Command",
    "Set-Location '$Root'; `$env:PYTHONPATH='$Root'; python -m uvicorn symbolic_recursion.server:app --host 0.0.0.0 --port 8080"
) -WindowStyle Minimized

Start-Sleep -Seconds 3

# MCP HTTP server (agent-to-agent on :8090)
Write-Host "Starting MCP server :8090 ..."
Start-Process pwsh -ArgumentList @(
    "-NoExit", "-Command",
    "Set-Location '$Root'; `$env:PYTHONPATH='$Root'; python -m symbolic_recursion.mcp.server --http --port 8090"
) -WindowStyle Minimized

Write-Host ""
Write-Host "Agent live:" -ForegroundColor Green
Write-Host "  Chat UI:     http://localhost:8080/chat"
Write-Host "  Dashboard:   http://localhost:8080/dashboard"
Write-Host "  MCP (HTTP):  http://localhost:8090/mcp"
Write-Host "  MCP (stdio): python -m symbolic_recursion.mcp.server"
Write-Host "  HF Space:    https://dontelightfoot-symbolic-recursive-engine.hf.space"
Write-Host ""
Write-Host "Grok MCP: src-coherence enabled in ~/.grok/config.toml - restart Grok to load."
Write-Host ""
if ($env:TELEGRAM_BOT_TOKEN) {
    Write-Host "Starting Telegram bot..."
    Start-Process pwsh -ArgumentList @(
        "-NoExit", "-Command",
        "Set-Location '$Root'; `$env:PYTHONPATH='$Root'; python -m symbolic_recursion.bots.telegram"
    ) -WindowStyle Minimized
    Write-Host "  Telegram: polling (message @BotFather bot)"
} else {
    Write-Host "  Telegram: set TELEGRAM_BOT_TOKEN in .env to enable"
}
Write-Host "  Slack: POST /api/slack/events (needs public URL + SLACK_BOT_TOKEN)"