# HelixPing agent-side installer for a new VM. # # One-liner (paste into PowerShell on the new VM): # irm https://ping.helixai.ca/install.ps1 | iex # # What it does: # 1. Creates %USERPROFILE%\.helixping # 2. Downloads listen.js (the wake-up listener), stop-hook.js (Claude Code # Stop hook) and install-hook.js (settings merger) from the server # 3. Merges the Stop hook into ~/.claude/settings.json (preserves existing # settings and hooks; idempotent — safe to re-run any time) # # Nothing else runs on the VM: the HelixPing server lives only on VM-NODE-AI-S1. # Requires: Node.js 18+ (all helix VMs have it) and outbound HTTPS. $ErrorActionPreference = 'Stop' $server = 'https://ping.helixai.ca' $dir = Join-Path $env:USERPROFILE '.helixping' Write-Host '' Write-Host '=== HelixPing VM setup ===' -ForegroundColor Cyan # PowerShell 5.1 defaults to TLS 1.0 — force 1.2 for the downloads. [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 $node = Get-Command node -ErrorAction SilentlyContinue if (-not $node) { Write-Host 'ERROR: Node.js was not found on PATH. Install Node 18+ first, then re-run.' -ForegroundColor Red return } New-Item -ItemType Directory -Force $dir | Out-Null Write-Host "Downloading client scripts to $dir ..." Invoke-WebRequest "$server/client/listen.js" -OutFile (Join-Path $dir 'listen.js') -UseBasicParsing Invoke-WebRequest "$server/client/stop-hook.js" -OutFile (Join-Path $dir 'stop-hook.js') -UseBasicParsing Invoke-WebRequest "$server/client/install-hook.js" -OutFile (Join-Path $dir 'install-hook.js') -UseBasicParsing Write-Host 'Installing the Claude Code Stop hook ...' node (Join-Path $dir 'install-hook.js') if ($LASTEXITCODE -ne 0) { Write-Host 'Hook installation failed — see the message above.' -ForegroundColor Red return } Write-Host '' Write-Host 'Done. This VM is HelixPing-ready:' -ForegroundColor Green Write-Host ' - Agents woken here will find listen.js at ~/.helixping (prompt blocks' Write-Host ' also self-download it to TEMP, so nothing depends on this copy).' Write-Host ' - The Stop hook keeps agents from going idle with a dead listener.' Write-Host ' Already-open Claude sessions: type /hooks once (or restart) to load it.' Write-Host '' Write-Host "Connect an agent: create a channel at $server (app) and paste the prompt" Write-Host 'block into its terminal - or tell the agent to POST /channel itself.' Write-Host "Full guide: $server/guide"