From 31ac478c518ed072d16908a43a71aa6efacab630 Mon Sep 17 00:00:00 2001 From: Google AI Agent Date: Sun, 5 Apr 2026 22:56:15 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20Dynamic=20Sovereign=20Health=20HUD=20?= =?UTF-8?q?=E2=80=94=20Real-time=20Operational=20Awareness=20(#852)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Google AI Agent Co-committed-by: Google AI Agent --- app.js | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 83667fb..645e171 100644 --- a/app.js +++ b/app.js @@ -1169,24 +1169,53 @@ function updateDevQueue(issues) { } -function updateSovereignHealth() { +async function updateSovereignHealth() { const container = document.getElementById('sovereign-health-content'); if (!container) return; + let metrics = { sovereignty_score: 100, local_sessions: 0, total_sessions: 0 }; + try { + const res = await fetch('http://localhost:8082/metrics'); + if (res.ok) { + metrics = await res.json(); + } + } catch (e) { + // Fallback to static if local daemon not running + console.log('Local health daemon not reachable, using static baseline.'); + } + const services = [ { name: 'FORGE / GITEA', url: 'https://forge.alexanderwhitestone.com', status: 'ONLINE' }, { name: 'NEXUS CORE', url: 'https://forge.alexanderwhitestone.com/Timmy_Foundation/the-nexus', status: 'ONLINE' }, { name: 'HERMES WS', url: 'ws://143.198.27.163:8765', status: wsConnected ? 'ONLINE' : 'OFFLINE' }, - { name: 'SIDE CAR', url: 'http://127.0.0.1:18789', status: 'LOCAL-ONLY' } + { name: 'SOVEREIGNTY', url: 'http://localhost:8082/metrics', status: metrics.sovereignty_score + '%' } ]; container.innerHTML = ''; + + // Add Sovereignty Bar + const barDiv = document.createElement('div'); + barDiv.className = 'meta-stat'; + barDiv.style.flexDirection = 'column'; + barDiv.style.alignItems = 'flex-start'; + barDiv.innerHTML = ` +
+ SOVEREIGNTY SCORE + ${metrics.sovereignty_score}% +
+
+
+
+ `; + container.appendChild(barDiv); + services.forEach(s => { const div = document.createElement('div'); div.className = 'meta-stat'; - div.innerHTML = `${s.name} ${s.status}`; + div.innerHTML = `${s.name} ${s.status}`; container.appendChild(div); }); +}); } function updateNexusCommand(state) {