diff --git a/relay/playbooks/app-state-grab.ps1 b/relay/playbooks/app-state-grab.ps1 new file mode 100644 index 00000000..2b284606 --- /dev/null +++ b/relay/playbooks/app-state-grab.ps1 @@ -0,0 +1,15 @@ +# Igneum playbook: copy the installed app's live state and chain feed (two GETs) back through the relay, so a capture +# of the dashboard can be rendered elsewhere from this machine's real numbers. Read-only: never pauses, resumes or +# quits anything (the standing rule of 5 October 2026). +# Queue: packaging/ota/publish-jobs.sh add --kind run --target 1ccfe586 --script relay/playbooks/app-state-grab.ps1 --title "app state grab" +$ErrorActionPreference = 'Continue' +$urlFile = Join-Path $env:LOCALAPPDATA 'igneum\app\app.url' +if (-not (Test-Path $urlFile)) { Write-Host "ERROR: $urlFile missing (is the app running?)"; exit 2 } +$url = (Get-Content $urlFile -Raw).Trim() +$out = Join-Path $env:TEMP 'igneum-state'; New-Item -ItemType Directory -Force -Path $out | Out-Null +foreach ($pair in @(@('api/state', 'state.json'), @('api/live?window=120', 'live.json'))) { + $dest = Join-Path $out $pair[1] + try { Invoke-WebRequest -UseBasicParsing -Uri ($url + $pair[0]) -TimeoutSec 15 -OutFile $dest; Write-Host "RESULT file=$($pair[1]) bytes=$((Get-Item $dest).Length)"; & $env:RELAY_SEND -TaskId ([long]$env:RELAY_TASK_ID) -Title ("app " + $pair[1]) $dest } + catch { Write-Host "RESULT file=$($pair[1]) failed: $($_.Exception.Message)" } +} +exit 0