Dashboard · Gauges
Flow 60%
Signal 59%
Pulse 752
Stability 0.81
Mini-Charts silent
Trend A
Trend B
Index C
Index D
These are “boxes” – duplicate/move freely.
Energy Flow Monitor
Shows signal transfer balance between active rings.
Cognitive Drift Analyzer
Δ Drift Variance: 0.17
Lower = stable; higher = out-of-sync modules.
Sync History
> Session start: Engine-8 ready.
Mission Queue Board
| Mission | Status | Updated |
| Build → Foundation Sync | Active | Now |
| Campaign → Outreach | Queued | – |
Predictive Matrix Feed
> Awaiting system feedback …
AI Co-Pilot / Persona Switch
Switch focus area — all chat, insight, and vault searches reroute by persona.
ThreadVault silent Access
/* ====== UTILITIES ====== */
const AUTH="121141";
const $ = id => document.getElementById(id);
const log = t => { const e=$("reply"); e.textContent += "\\n" + (typeof t==='string'? t : JSON.stringify(t)); e.scrollTop=e.scrollHeight; };
async function jfetch(u,opts={}){ try{
const r = await fetch(u,Object.assign({headers:{'Content-Type':'application/json'},cache:'no-store'},opts));
if(!r.ok) throw new Error(r.status+' '+r.statusText);
const ct = r.headers.get('content-type')||'';
return ct.includes('application/json') ? await r.json() : await r.text();
} catch(e){ return {error:String(e)} }}
/* ====== HEALTH / TOOLBAR ====== */
$("bHealth").onclick = async()=> log("> health: "+await jfetch("http://127.0.0.1:8787/API/health.php"));
$("bPing").onclick = async()=> log("> ping: "+await jfetch("http://127.0.0.1:8787/API/ping.php"));
$("bRefresh").onclick= ()=>{ pullMetrics(); drawChart(); drawSchematic(); };
$("bSave").onclick = async()=>{
const payload={auth:AUTH,path:"/COMMAND_CENTER/LOGS/smart_water_marker.txt",content:"Galaxy marker "+new Date().toISOString()};
log("> save: "+JSON.stringify(await jfetch("http://127.0.0.1:8787/API/save.php",{method:"POST",body:JSON.stringify(payload)})));
/* ====== KPIS ====== */
function num(id,v){ const el=$(id); if(el) el.textContent = (v==null? "–" : Number(v).toFixed(2)); }
function pick(o,ks){ for(const k of ks){ if(o && o[k]!=null) return Number(o[k]); } return null; }
function applyK(m){ num("k_aw",m.awareness); num("k_fc",m.focus); num("k_df",m.drift); num("k_tr",m.trust); num("k_hm",m.harmony); }
async function pullMetrics(){
const r = await jfetch("http://127.0.0.1:8787/API/metrics_read.php");
if(r.error){ log("> metrics: "+r.error); return applyK({awareness:.82,focus:.77,drift:.21,trust:.81,harmony:.78}); }
let d = typeof r==="string" ? (JSON.parse(r)||{}) : r;
applyK({
awareness:pick(d,["awareness","A","Awareness"]),
focus:pick(d,["focus","F","Focus"]),
drift:pick(d,["drift","D","Drift"]),
trust:pick(d,["trust","T","Trust"]),
harmony:pick(d,["harmony","H","Harmony"])
/* ====== MISSION RING ====== */
$("bRing").onclick=async()=>{
const ring=$("ring").value;
const out=await jfetch("http://127.0.0.1:8787/API/ring_state.php",{method:"POST",body:JSON.stringify({active:ring,last_updated:new Date().toISOString()})});
$("ringStatus").textContent="Active: "+ring;
log({ring_set:out});
/* ====== TUNER ====== */
const T={sigma:1,beta:1,omega:1,mu:1,gamma:1,delta:1};
function bindT(k){ const s=$("s_"+k),v=$("v_"+k); const f=()=>{T[k]=Number(s.value); v.textContent=s.value; drawSchematic();}; s.addEventListener("input",f); f(); }
["sigma","beta","omega","mu","gamma","delta"].forEach(bindT);
$("bReset").onclick=()=>{ ["sigma","beta","omega","mu","gamma","delta"].forEach(k=>{ $("s_"+k).value="1.00";$("v_"+k).textContent="1.00";T[k]=1;}); drawSchematic(); };
$("bApply").onclick=async()=>{
const payload={auth:AUTH,path:"/COMMAND_CENTER/CONFIG/kronos_tuning.json",content:JSON.stringify({ts:new Date().toISOString(),tuner:T},null,2)};
log("> apply: "+JSON.stringify(await jfetch("http://127.0.0.1:8787/API/save.php",{method:"POST",body:JSON.stringify(payload)})));
$("bTune").onclick=async()=>{ log("> tuner: "+JSON.stringify(await jfetch("http://127.0.0.1:8787/API/run_tuner.php"))); drawChart(); };
/* ====== MEMORY & CHAT ====== */
$("bRemember").onclick=async()=>{ const text=$("memText").value.trim(); if(!text) return; log(await jfetch("http://127.0.0.1:8787/API/memory_remember.php",{method:"POST",body:JSON.stringify({text})})); };
$("bRecall").onclick =async()=>{ const text=$("memText").value.trim()||"status"; log(await jfetch("http://127.0.0.1:8787/API/memory_recall.php",{method:"POST",body:JSON.stringify({query:text,top_k:5})})); };
$("bSend").onclick =async()=>{
const txt=$("msg").value.trim(); if(!txt) return; $("reply").textContent+="\\n> You: "+txt;
try{ const out=await jfetch("http://127.0.0.1:8787/API/ai_speak.php",{method:"POST",body:JSON.stringify({auth:AUTH,prompt:txt,agent:"General Galaxy"})}); $("reply").textContent+="\\nGalaxy: "+(typeof out==='string'?out:JSON.stringify(out)); }
catch(e){ $("reply").textContent+="\\nGalaxy: ACK."; }
$("bClear").onclick=()=>{$("reply").textContent="> Cleared."};
/* mic upload */
let rec,chunks=[];
$("bRec").onclick=async()=>{
try{
const stream=await navigator.mediaDevices.getUserMedia({audio:true});
rec=new MediaRecorder(stream); chunks=[];
rec.ondataavailable=e=>chunks.push(e.data);
rec.onstop=async()=>{const b=new Blob(chunks,{type:'audio/webm'}); const fd=new FormData(); fd.append('auth','121141'); fd.append('file',b,'input.webm'); const r=await fetch('http://127.0.0.1:8787/API/audio_receive.php',{method:'POST',body:fd}); log("> audio: "+await r.text());};
rec.start(); log("> recording started");
}catch(e){ log("> mic error: "+e); }
$("bStop").onclick=()=>{ if(rec && rec.state!=='inactive'){ rec.stop(); log("> recording stopped"); } };
/* ====== ALIGNMENT CHART ====== */
async function drawChart(){
const r=await fetch("../../COMMAND_CENTER/LOGS/state_eval.json",{cache:"no-store"});
if(!r.ok){ log("> chart: cannot load state_eval.json ("+r.status+")"); return; }
const d=await r.json();
const ctx=$("chart").getContext('2d');
new Chart(ctx,{type:'bar',data:{labels:Object.keys(d.interactions),datasets:[{label:'Interaction Strength',data:Object.values(d.interactions),backgroundColor:'rgba(0,212,255,0.5)',borderColor:'#00d4ff',borderWidth:1}]},options:{scales:{x:{ticks:{display:false}},y:{beginAtZero:true}}}});
}catch(e){ log("> chart error: "+e); }
/* ====== GALAXY 2D SCHEMATIC (rings & connectors) ====== */
function drawSchematic(){
const c=$("schem"), ctx=c.getContext("2d"); const w=c.width=c.clientWidth, h=c.height=c.clientHeight, cx=w/2, cy=h/2;
ctx.clearRect(0,0,w,h);
// background glow
const g=ctx.createRadialGradient(cx,cy,10,cx,cy,Math.min(cx,cy)); g.addColorStop(0, "rgba(0,212,255,0.20)"); g.addColorStop(1, "rgba(0,0,0,0)"); ctx.fillStyle=g; ctx.beginPath(); ctx.arc(cx,cy,Math.min(cx,cy),0,Math.PI*2); ctx.fill();
const R1=60+40*T.sigma, R2=110+30*T.omega, R3=160+25*T.delta;
function ring(r,color,width){ ctx.strokeStyle=color; ctx.lineWidth=width; ctx.beginPath(); ctx.arc(cx,cy,r,0,Math.PI*2); ctx.stroke(); }
ring(R1,"#00d28a",2); ring(R2,"#ff5656",2); ring(R3,"#a55bff",2);
// connectors
ctx.strokeStyle="#00d4ff"; ctx.lineWidth=1.2;
const spokes = 12;
for(let i=0;i
{ pullMetrics(); drawChart(); drawSchematic(); };