-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
554 lines (466 loc) · 23.7 KB
/
setup.ps1
File metadata and controls
554 lines (466 loc) · 23.7 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
# ═══════════════════════════════════════════════════════════════════════
# Enso Setup (Windows PowerShell)
# One command to set up a complete self-evolving AI sandbox.
#
# Usage: .\setup.ps1
# Or with pre-set values (non-interactive / testing):
# $env:ENSO_INSTALL_PATH="$HOME\Enso"; $env:ENSO_LLM_CHOICE="1"; .\setup.ps1
# ═══════════════════════════════════════════════════════════════════════
$ErrorActionPreference = "Stop"
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$EnsoDir = Join-Path $env:USERPROFILE ".enso"
$Port = 3001
# ── Helpers ────────────────────────────────────────────────────────────
function Show-Banner {
Write-Host ""
Write-Host " +=======================================+" -ForegroundColor Cyan
Write-Host " | Enso Setup |" -ForegroundColor Cyan
Write-Host " | AI sandbox that builds itself. |" -ForegroundColor Cyan
Write-Host " +=======================================+" -ForegroundColor Cyan
Write-Host ""
}
function Show-Step($msg) {
Write-Host ""
Write-Host "-- $msg ------------------------------------------" -ForegroundColor Yellow
Write-Host ""
}
function Show-Ok($msg) { Write-Host " OK $msg" -ForegroundColor Green }
function Show-Warn($msg) { Write-Host " !! $msg" -ForegroundColor DarkYellow }
function Show-Info($msg) { Write-Host " .. $msg" -ForegroundColor Gray }
function Prompt-WithDefault($prompt, $default, $envOverride) {
if ($envOverride) { return $envOverride }
$value = Read-Host " $prompt [$default]"
if ([string]::IsNullOrWhiteSpace($value)) { return $default }
return $value
}
function Prompt-Secret($prompt, $envOverride) {
if ($envOverride) { return $envOverride }
$value = Read-Host " $prompt"
return $value
}
function Prompt-YN($prompt, $default, $envOverride) {
if ($envOverride) { return $envOverride }
$value = Read-Host " $prompt [$default]"
if ([string]::IsNullOrWhiteSpace($value)) { return $default }
return $value
}
# ── Banner ─────────────────────────────────────────────────────────────
Show-Banner
# ═══════════════════════════════════════════════════════════════════════
# Step 1: Install Location
# ═══════════════════════════════════════════════════════════════════════
Show-Step "Step 1: Install Location"
Write-Host " Where do you want to install Enso?"
Write-Host " This is where the source code will live for self-evolution."
Write-Host ""
$DefaultPath = Join-Path $env:USERPROFILE "Enso"
$InstallPath = Prompt-WithDefault "Install path" $DefaultPath $env:ENSO_INSTALL_PATH
$SourceDir = $ScriptDir
$TargetDir = $InstallPath
$SourceReal = (Resolve-Path $SourceDir).Path
$TargetReal = if (Test-Path $TargetDir) { (Resolve-Path $TargetDir).Path } else { "" }
if ($SourceReal -ne $TargetReal) {
Write-Host " -> Copying source to $InstallPath..."
if (-not (Test-Path $TargetDir)) { New-Item -ItemType Directory -Path $TargetDir -Force | Out-Null }
robocopy $SourceDir $TargetDir /E /XD node_modules .git dist "android\app\build" .claude /NFL /NDL /NJH /NJS /NC /NS /NP | Out-Null
Set-Location $TargetDir
if (-not (Test-Path ".git")) {
Write-Host " -> Initializing git repository..."
git init -q
git add -A
git commit -q -m "Initial Enso setup"
}
Show-Ok "Source installed at $InstallPath"
} else {
Set-Location $TargetDir
Show-Ok "Already at install location: $InstallPath"
}
$RepoDir = (Get-Location).Path
$ServerDir = Join-Path $RepoDir "server"
$EnvFile = Join-Path $ServerDir ".env"
# ═══════════════════════════════════════════════════════════════════════
# Step 2: Prerequisites
# ═══════════════════════════════════════════════════════════════════════
Show-Step "Step 2: Prerequisites"
$nodeCmd = Get-Command node -ErrorAction SilentlyContinue
if (-not $nodeCmd) {
Write-Host " Node.js not found. Installing via winget..."
try {
winget install OpenJS.NodeJS.LTS --accept-package-agreements --accept-source-agreements
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
} catch {
Write-Host " X Failed. Install from https://nodejs.org/" -ForegroundColor Red
exit 1
}
}
$nodeMajor = [int](node -e "console.log(process.version.split('.')[0].slice(1))" | Out-String).Trim()
if ($nodeMajor -lt 22) {
Write-Host " X Node.js $nodeMajor found, 22+ required." -ForegroundColor Red
exit 1
}
Show-Ok "Node.js $(node --version)"
Write-Host " -> Installing dependencies..."
Push-Location $RepoDir
npm install --no-audit --no-fund 2>&1 | Select-Object -Last 1
Show-Ok "Dependencies installed"
# ═══════════════════════════════════════════════════════════════════════
# Step 3: Chat AI Model
# ═══════════════════════════════════════════════════════════════════════
Show-Step "Step 3: Chat AI Model"
Write-Host " Choose your primary chat AI:"
Write-Host ""
Write-Host " [1] Google Gemini -- free tier, recommended"
Write-Host " [2] OpenAI -- GPT-4o, GPT-4o Mini"
Write-Host " [3] Anthropic -- Claude Sonnet, Haiku"
Write-Host " [4] DeepSeek -- affordable reasoning"
Write-Host " [5] Ollama -- local, free, no API key"
Write-Host " [6] OpenRouter -- hundreds of models, one key"
Write-Host ""
$LlmChoice = Prompt-WithDefault "Choice" "1" $env:ENSO_LLM_CHOICE
switch ($LlmChoice) {
"1" { $LlmId="gemini"; $LlmName="Google Gemini"; $LlmEnv="GEMINI_API_KEY"; $LlmUrl="https://aistudio.google.com/apikey" }
"2" { $LlmId="openai"; $LlmName="OpenAI"; $LlmEnv="OPENAI_API_KEY"; $LlmUrl="https://platform.openai.com/api-keys" }
"3" { $LlmId="anthropic"; $LlmName="Anthropic"; $LlmEnv="ANTHROPIC_API_KEY"; $LlmUrl="https://console.anthropic.com/settings/keys" }
"4" { $LlmId="deepseek"; $LlmName="DeepSeek"; $LlmEnv="DEEPSEEK_API_KEY"; $LlmUrl="https://platform.deepseek.com/api_keys" }
"5" { $LlmId="ollama"; $LlmName="Ollama (Local)"; $LlmEnv=""; $LlmUrl="https://ollama.com" }
"6" { $LlmId="openrouter"; $LlmName="OpenRouter"; $LlmEnv="OPENROUTER_API_KEY"; $LlmUrl="https://openrouter.ai/keys" }
default { $LlmId="gemini"; $LlmName="Google Gemini"; $LlmEnv="GEMINI_API_KEY"; $LlmUrl="https://aistudio.google.com/apikey" }
}
$LlmKey = ""
if ($LlmEnv) {
Write-Host ""
Write-Host " Enter your $LlmName API key:"
Write-Host " (Get one at $LlmUrl)"
$envKey = if ($env:ENSO_GEMINI_KEY) { $env:ENSO_GEMINI_KEY } else { $env:ENSO_LLM_KEY }
$LlmKey = Prompt-Secret " Key: " $envKey
Write-Host ""
}
# Write providers.json
if (-not (Test-Path $EnsoDir)) { New-Item -ItemType Directory -Path $EnsoDir -Force | Out-Null }
if ($LlmKey) {
$providersPath = Join-Path $EnsoDir "providers.json"
$provEsc = $providersPath -replace '\\', '\\\\'
node -e @"
const fs = require('fs');
let cfg = {};
try { cfg = JSON.parse(fs.readFileSync('$provEsc', 'utf-8')); } catch {}
if (!cfg.apiKeys) cfg.apiKeys = {};
cfg.apiKeys['$LlmId'] = '$LlmKey';
fs.writeFileSync('$provEsc', JSON.stringify(cfg, null, 2) + '\n');
"@
}
# Write server/.env
$AccessToken = [guid]::NewGuid().ToString()
$MachineName = $env:COMPUTERNAME
if (Test-Path $EnvFile) {
$envContent = Get-Content $EnvFile -Raw
if ($envContent -match '(?m)^ENSO_ACCESS_TOKEN=(.+)$') {
$AccessToken = $Matches[1].Trim()
}
if ($LlmEnv -and $LlmKey -and $envContent -notmatch "(?m)^${LlmEnv}=") {
Add-Content -Path $EnvFile -Value "${LlmEnv}=${LlmKey}"
}
} else {
$lines = @()
if ($LlmEnv -and $LlmKey) { $lines += "${LlmEnv}=${LlmKey}" }
$lines += "ENSO_ACCESS_TOKEN=${AccessToken}"
$lines += "ENSO_MACHINE_NAME=${MachineName}"
Set-Content -Path $EnvFile -Value ($lines -join "`n") -Encoding UTF8
}
$envContent = Get-Content $EnvFile -Raw -ErrorAction SilentlyContinue
if ($envContent -match '(?m)^ENSO_ACCESS_TOKEN=(.+)$') {
$AccessToken = $Matches[1].Trim()
} elseif ($envContent -notmatch "ENSO_ACCESS_TOKEN") {
Add-Content -Path $EnvFile -Value "ENSO_ACCESS_TOKEN=${AccessToken}"
}
Show-Ok "Chat AI: $LlmName"
# ═══════════════════════════════════════════════════════════════════════
# Step 4: Service API Keys
# ═══════════════════════════════════════════════════════════════════════
Show-Step "Step 4: Service API Keys (optional)"
Write-Host " Brave Search enables web research in Enso."
Write-Host " Get a free key at: https://brave.com/search/api/"
Write-Host ""
$BraveKey = Prompt-Secret " Brave Search API key (Enter to skip): " $env:ENSO_BRAVE_KEY
Write-Host ""
if ($BraveKey) {
$apiKeysPath = Join-Path $EnsoDir "api-keys.json"
$akEsc = $apiKeysPath -replace '\\', '\\\\'
node -e @"
const fs = require('fs');
let keys = {};
try { keys = JSON.parse(fs.readFileSync('$akEsc', 'utf-8')); } catch {}
keys.brave = '$BraveKey';
fs.writeFileSync('$akEsc', JSON.stringify(keys, null, 2) + '\n');
"@
Show-Ok "Brave Search configured"
} else {
Show-Info "Skipped -- can be added later in Enso Settings"
}
Show-Info "More service keys available in Enso Settings"
# ═══════════════════════════════════════════════════════════════════════
# Step 5: Claude Code
# ═══════════════════════════════════════════════════════════════════════
Show-Step "Step 5: Claude Code (self-evolution engine)"
Write-Host " Claude Code powers /code, Build App, orchestration,"
Write-Host " and self-evolution sprints (/evolve)."
Write-Host ""
$ClaudeInstalled = $false
$claudeCmd = Get-Command claude -ErrorAction SilentlyContinue
if ($claudeCmd) {
$cv = claude --version 2>$null
Show-Ok "Claude Code already installed: $cv"
$ClaudeInstalled = $true
} else {
$installClaude = Prompt-YN "Install Claude Code CLI? (Y/n)" "Y" $env:ENSO_INSTALL_CLAUDE
if ($installClaude -match '^[Yy]$') {
Write-Host " -> Installing @anthropic-ai/claude-code..."
npm install -g @anthropic-ai/claude-code 2>&1 | Select-Object -Last 3
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
$claudeCmd = Get-Command claude -ErrorAction SilentlyContinue
if ($claudeCmd) {
Show-Ok "Claude Code installed"
$ClaudeInstalled = $true
} else {
Show-Warn "Claude not found in PATH after install"
}
} else {
Show-Info "Skipped -- install later: npm install -g @anthropic-ai/claude-code"
}
}
if ($ClaudeInstalled) {
try {
$authJson = claude auth status 2>$null | Out-String
$authObj = $authJson | ConvertFrom-Json
$loggedIn = $authObj.loggedIn
} catch { $loggedIn = $false }
if ($loggedIn) {
Show-Ok "Claude Code already authenticated"
} else {
Write-Host ""
Write-Host " How do you authenticate with Anthropic?"
Write-Host ""
Write-Host " [1] API Key -- pay-per-token"
Write-Host " [2] Subscription -- Claude Pro/Team/Max (opens browser)"
Write-Host " [3] Skip -- set up later"
Write-Host ""
$authChoice = Prompt-WithDefault "Choice" "2" $env:ENSO_CLAUDE_AUTH
switch ($authChoice) {
"1" {
$anthroKey = Prompt-Secret " Anthropic API key: " $env:ENSO_ANTHROPIC_KEY
if ($anthroKey) {
$current = Get-Content $EnvFile -Raw -ErrorAction SilentlyContinue
if ($current -match "(?m)^ANTHROPIC_API_KEY=") {
$current = $current -replace "(?m)^ANTHROPIC_API_KEY=.*", "ANTHROPIC_API_KEY=$anthroKey"
Set-Content -Path $EnvFile -Value $current -Encoding UTF8
} else {
Add-Content -Path $EnvFile -Value "ANTHROPIC_API_KEY=$anthroKey"
}
$env:ANTHROPIC_API_KEY = $anthroKey
Show-Ok "API key saved"
}
}
"2" {
Write-Host " -> Opening browser for OAuth login..."
claude auth login 2>&1
Show-Ok "Authentication flow completed"
}
default {
Show-Info "Skipped -- authenticate later: claude auth login"
}
}
}
}
# ═══════════════════════════════════════════════════════════════════════
# Step 6: Remote Access
# ═══════════════════════════════════════════════════════════════════════
Show-Step "Step 6: Remote Access"
Write-Host " Set up remote access via enso.net?"
Write-Host " Your Enso will be available at: <name>.enso.net"
Write-Host ""
$SetupTunnel = Prompt-YN "Set up remote access? (Y/n)" "Y" $env:ENSO_TUNNEL
$TunnelUrl = ""
$Specifier = ""
if ($SetupTunnel -match '^[Yy]$') {
$Suggested = ($env:COMPUTERNAME).ToLower() -replace '[^a-z0-9-]', '-' -replace '--+', '-' -replace '^-|-$', ''
if (-not $Suggested) { $Suggested = "my-enso" }
Write-Host " Choose your machine name:"
$Specifier = Prompt-WithDefault "Name" $Suggested $env:ENSO_TUNNEL_NAME
$RegistryUrl = if ($env:ENSO_REGISTRY_URL) { $env:ENSO_REGISTRY_URL } else { "http://localhost:$Port" }
Write-Host " -> Registering ${Specifier}.enso.net..."
try {
$body = @{ specifier = $Specifier; accessToken = $AccessToken } | ConvertTo-Json
$result = Invoke-RestMethod -Uri "$RegistryUrl/api/tunnel/register" -Method POST -ContentType "application/json" -Body $body -ErrorAction Stop
if ($result.tunnelToken) {
$TunnelUrl = $result.publicUrl
$cfCmd = Get-Command cloudflared -ErrorAction SilentlyContinue
if (-not $cfCmd) {
Write-Host " -> Installing cloudflared..."
winget install cloudflare.cloudflared --accept-package-agreements --accept-source-agreements 2>$null
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
}
$cfCmd = Get-Command cloudflared -ErrorAction SilentlyContinue
if ($cfCmd) {
Write-Host " -> Configuring tunnel..."
cloudflared service install $result.tunnelToken 2>$null
Show-Ok "Remote: $TunnelUrl"
} else {
Show-Warn "cloudflared not installed -- install manually: winget install cloudflare.cloudflared"
}
$current = Get-Content $EnvFile -Raw -ErrorAction SilentlyContinue
if ($current -notmatch "ENSO_TUNNEL_SPECIFIER") {
Add-Content -Path $EnvFile -Value "ENSO_TUNNEL_SPECIFIER=$Specifier"
Add-Content -Path $EnvFile -Value "ENSO_PUBLIC_URL=$TunnelUrl"
}
}
} catch {
Show-Warn "Tunnel registry not available -- skipped"
Show-Info "Set up later via SETUP.md"
if ((Get-Content $EnvFile -Raw -ErrorAction SilentlyContinue) -notmatch "ENSO_TUNNEL_SPECIFIER") {
Add-Content -Path $EnvFile -Value "ENSO_TUNNEL_SPECIFIER=$Specifier"
}
}
} else {
Show-Info "Skipped -- set up later via SETUP.md"
}
# ═══════════════════════════════════════════════════════════════════════
# Step 7: Build
# ═══════════════════════════════════════════════════════════════════════
Show-Step "Step 7: Build"
Write-Host " -> Building frontend..."
npm run build 2>&1 | Select-Object -Last 1
Show-Ok "Frontend built"
$ApkPath = Join-Path $RepoDir "android\app\build\outputs\apk\release\app-release.apk"
$ApkBuilt = $false
if (Test-Path (Join-Path $RepoDir "android")) {
$javaCmd = Get-Command java -ErrorAction SilentlyContinue
if ($javaCmd -or $env:JAVA_HOME) {
Write-Host ""
Write-Host " -> Building mobile app (APK)..."
npx cap sync android 2>&1 | Select-Object -Last 1
Push-Location (Join-Path $RepoDir "android")
try {
.\gradlew.bat assembleRelease 2>&1 | Select-Object -Last 3
if (Test-Path $ApkPath) {
$ApkSize = [math]::Round((Get-Item $ApkPath).Length / 1MB, 1)
Show-Ok "APK built: ${ApkSize} MB"
$ApkBuilt = $true
}
} catch {
Show-Warn "APK build failed -- build later: npm run android:build-apk"
}
Pop-Location
} else {
Write-Host ""
Show-Warn "Android build tools not found. Skipping APK."
Show-Info "Install JDK 17+ and Android SDK, then: npm run android:build-apk"
}
}
# ═══════════════════════════════════════════════════════════════════════
# Step 8: Start Server
# ═══════════════════════════════════════════════════════════════════════
Show-Step "Step 8: Start Server"
# CLI config
$CliJson = Join-Path $EnsoDir "cli.json"
$cliEsc = $CliJson -replace '\\', '\\\\'
node -e @"
const fs = require('fs');
const dir = '$($EnsoDir -replace '\\', '\\\\')';
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
fs.writeFileSync('$cliEsc', JSON.stringify({
server: 'http://localhost:$Port',
token: '$AccessToken'
}, null, 2));
"@
# Add bin to PATH
$BinDir = Join-Path $RepoDir "bin"
$CurrentPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
if ($CurrentPath -notlike "*$BinDir*") {
[System.Environment]::SetEnvironmentVariable("Path", "$CurrentPath;$BinDir", "User")
$env:Path = "$env:Path;$BinDir"
}
# Start guardian
Write-Host " -> Starting server (guardian-supervised)..."
$guardianLog = Join-Path $env:TEMP "enso-guardian.log"
$guardianErrLog = Join-Path $env:TEMP "enso-guardian-err.log"
Start-Process -FilePath "cmd.exe" `
-ArgumentList "/c", "npx tsx server/guardian.ts > `"$guardianLog`" 2> `"$guardianErrLog`"" `
-WorkingDirectory $RepoDir -WindowStyle Hidden
Write-Host -NoNewline " Waiting for server"
$ready = $false
for ($i = 1; $i -le 30; $i++) {
try {
$response = Invoke-RestMethod -Uri "http://localhost:$Port/health" -TimeoutSec 2 -ErrorAction Stop
if ($response.status -eq "ok") { $ready = $true; break }
} catch {}
Write-Host -NoNewline "."
Start-Sleep -Seconds 1
}
Write-Host ""
if ($ready) { Show-Ok "Server running on port $Port" }
else { Show-Warn "Server did not respond in 30s" }
# Watchdog
$watchdog = Join-Path $RepoDir "install-watchdog.ps1"
if (Test-Path $watchdog) {
try { & $watchdog; Show-Ok "Watchdog installed" } catch {}
}
# Setup info
$LanIps = node -e @"
const os = require('os');
const ips = [];
for (const ifaces of Object.values(os.networkInterfaces())) {
for (const i of ifaces || []) {
if (i.family === 'IPv4' && !i.internal) ips.push(i.address);
}
}
console.log(ips.join(','));
"@
$IpArray = $LanIps.Split(',') | Where-Object { $_ }
$PrimaryIp = if ($IpArray.Count -gt 0) { $IpArray[0] } else { "localhost" }
$setupJsonEsc = (Join-Path $EnsoDir "enso-setup.json") -replace '\\', '\\\\'
$repoDirEsc = $RepoDir -replace '\\', '\\\\'
node -e @"
const fs = require('fs');
fs.writeFileSync('$setupJsonEsc', JSON.stringify({
installPath: '$repoDirEsc',
accessToken: '$AccessToken',
machineName: '$MachineName',
port: $Port,
llmProvider: '$LlmId',
tunnelSpecifier: '$Specifier',
tunnelUrl: '$TunnelUrl',
apkBuilt: $($ApkBuilt.ToString().ToLower()),
lanAddresses: '$LanIps'.split(',').filter(Boolean),
installedAt: new Date().toISOString()
}, null, 2));
"@
# ═══════════════════════════════════════════════════════════════════════
# Summary
# ═══════════════════════════════════════════════════════════════════════
Write-Host ""
Write-Host "========================================================" -ForegroundColor Cyan
Write-Host " Enso is ready!" -ForegroundColor Cyan
Write-Host "========================================================" -ForegroundColor Cyan
Write-Host ""
Write-Host " Installed at: $RepoDir"
Write-Host " Chat AI: $LlmName"
if ($ClaudeInstalled) { Write-Host " Claude Code: Installed" -ForegroundColor Green }
else { Write-Host " Claude Code: Not installed" -ForegroundColor DarkYellow }
if ($TunnelUrl) { Write-Host " Remote: $TunnelUrl" }
Write-Host " Local: http://localhost:$Port"
if ($ApkBuilt) {
Write-Host ""
Write-Host " Install on phone:" -ForegroundColor White
$apkUrl = if ($TunnelUrl) { "$TunnelUrl/api/apk" } else { "http://${PrimaryIp}:${Port}/api/apk" }
Write-Host " Download: $apkUrl" -ForegroundColor Gray
$qrScript = Join-Path $RepoDir "scripts\qr-terminal.js"
if (Test-Path $qrScript) { try { node $qrScript $apkUrl } catch {} }
}
Write-Host ""
Write-Host " Get started:" -ForegroundColor White
Write-Host " - Open http://localhost:$Port" -ForegroundColor Gray
Write-Host " - Type /code hello -- test Claude Code" -ForegroundColor Gray
Write-Host " - Type /evolve -- self-evolution sprint" -ForegroundColor Gray
Write-Host " - CLI: enso chat `"Hello!`"" -ForegroundColor Gray
Write-Host ""
Pop-Location