Havenstone · Smart-Water / Galaxy Control · Engine-8
Awareness
Focus
Drift
Trust
Harmony
Mission Ring: idle

General Galaxy · Avatar

> Ready.

Galaxy Schematic

Smart Parameter Tuner Σ β Ω μ γ Δ

v=1.00
v=1.00
v=1.00
v=1.00
v=1.00
v=1.00

Alignment Map

Source: /COMMAND_CENTER/LOGS/state_eval.json

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

MissionStatusUpdated
Build → Foundation SyncActiveNow
Campaign → OutreachQueued

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

> Vault idle.

Knowledge Pool silent / Co-Pilot Board

> Board ready.

Layout Manager

Drag any box; click Save to persist. Layout stored in /COMMAND_CENTER/CONFIG/layout.json /* allow drag */ .box { position:relative; } .draggable { position:absolute; cursor:move; } .grid-surface { position:relative; } // --- mark boxes draggable --- (function initDraggable(){ // select top-level boxes inside .grid only (leave header/KPIs static) const grid = document.querySelector('.grid'); if(!grid) return; grid.classList.add('grid-surface'); const boxes = grid.querySelectorAll(':scope > .col-left .box, :scope > .col-center .box, :scope > .col-right .box'); let z=10; boxes.forEach((b,i)=>{ b.dataset.boxid = b.dataset.boxid || ('box_'+(i+1)); }); })(); let dragging=null, offsetX=0, offsetY=0; function startDrag(e){ const el = e.currentTarget; dragging = el; const r = el.getBoundingClientRect(); offsetX = e.clientX - r.left; offsetY = e.clientY - r.top; el.style.zIndex = 1000; function onDrag(e){ if(!dragging) return; const grid = document.querySelector('.grid-surface'); const gr = grid.getBoundingClientRect(); const x = e.clientX - gr.left - offsetX; const y = e.clientY - gr.top - offsetY; // snap 10px const sx = Math.round(x/10)*10, sy = Math.round(y/10)*10; dragging.style.left = sx+'px'; dragging.style.top = sy+'px'; function endDrag(){ if(dragging){ dragging.style.zIndex=10; dragging=null; }} // apply handlers (function wireDrag(){ boxes.forEach(b=>{ // add draggable class if we decide to float position b.classList.add('draggable'); b.addEventListener('mousedown', startDrag); }); document.addEventListener('mousemove', onDrag); document.addEventListener('mouseup', endDrag); // load saved layout async function layoutLoad(){ const res = await jfetch("http://127.0.0.1:8787/API/layout_load.php"); if(res && res.positions){ const grid = document.querySelector('.grid-surface'); res.positions.forEach(p=>{ const el = grid.querySelector(`[data-boxid="${p.id}"]`); if(el){ el.style.position='absolute'; el.style.left = p.x+'px'; el.style.top = p.y+'px'; } }); log("> layout loaded"); } else { log("> layout: none or failed"); } // save current positions async function layoutSave(){ const positions = []; const r = b.getBoundingClientRect(); const gr = grid.getBoundingClientRect(); const x = Math.round((r.left - gr.left)); const y = Math.round((r.top - gr.top)); positions.push({id:b.dataset.boxid,x,y}); const payload = {auth:"121141",positions}; const out = await jfetch("http://127.0.0.1:8787/API/layout_save.php",{method:"POST",body:JSON.stringify(payload)}); log("> layout saved " + JSON.stringify(out)); $("bLayoutSave").onclick = layoutSave; $("bLayoutLoad").onclick = layoutLoad; // auto-load on boot after first render setTimeout(layoutLoad, 400);
/* ====== 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(); };