$ErrorActionPreference = "Stop" Set-StrictMode -Version Latest $RootDir = Split-Path -Parent $PSScriptRoot $TokenFile = Join-Path $RootDir ".secrets/app-server-token" $ListenUrl = if ($env:LETTA_LISTEN_URL) { $env:LETTA_LISTEN_URL } else { "ws://0.0.0.0:4500" } if (-not (Get-Command letta -ErrorAction SilentlyContinue)) { throw "Letta CLI is not installed. See https://docs.letta.com/self-hosting" } if (-not (Test-Path $TokenFile)) { throw "Missing $TokenFile. Run .\scripts\setup.ps1 first." } letta server ` --backend local ` --listen $ListenUrl ` --openai-api ` --ws-auth capability-token ` --ws-token-file $TokenFile