vestige/apps/dashboard/build/_app/immutable/nodes/0.DZQ2ZPtV.js
Sam Valladares ec2af6e71b fix: comprehensive audit fixes for dashboard and backend
Backend:
- Emit WebSocket events from REST delete/promote/demote handlers
- Emit DreamStarted/ConsolidationStarted from MCP tool dispatch
- Add path validation in backup_to() for defense-in-depth

Dashboard:
- Fix ConnectionDiscovered field names (source_id/target_id)
- Fix $effect → onMount in settings (prevents infinite loop)
- Fix $derived → $derived.by in RetentionCurve
- Fix field name mismatches in settings (nodesProcessed, etc.)
- Fix nested <button> → <span role="button"> in memories
- Fix unhandled Promise rejection in stats consolidation
- Add missing EVENT_TYPE_COLORS entries
- Add Three.js resource disposal and event listener cleanup
- Eliminate duplicate root page, redirect to /graph
- Update nav links and keyboard shortcuts to /graph

All 734+ tests passing, 22MB binary, zero build warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 15:50:47 -06:00

3 lines
7.7 KiB
JavaScript

import"../chunks/Bzak7iHL.js";import{o as Ee}from"../chunks/BycUxjt3.js";import{p as Me,f as Ke,t as K,a as Le,h as d,g as s,d as a,e as i,r as t,s as oe,u as z,G as Te}from"../chunks/DEYVqDYQ.js";import{d as qe,a as h,s as u}from"../chunks/ZM2C7QQX.js";import{i as ie}from"../chunks/CpubbTHs.js";import{e as H,i as V}from"../chunks/CiJhRXcr.js";import{a as _,f as y}from"../chunks/D5-kFxsM.js";import{s as Fe}from"../chunks/DngRZTwo.js";import{s as le,r as Se,b as Ae}from"../chunks/Bew31VOg.js";import{s as W}from"../chunks/zt9hmg4X.js";import{b as Ne}from"../chunks/BbhZG17W.js";import{s as De,a as L}from"../chunks/DUZi1B8N.js";import{s as Ge,g as de,b as O}from"../chunks/B-yQpXHS.js";import{w as ce,a as je,i as Re,m as ze}from"../chunks/DmEsXEQB.js";const He=()=>{const m=Ge;return{page:{subscribe:m.page.subscribe},navigating:{subscribe:m.navigating.subscribe},updated:m.updated}},Ve={subscribe(m){return He().page.subscribe(m)}};var We=y('<a><span class="text-base w-5 text-center"> </span> <span class="hidden lg:block"> </span> <span class="hidden lg:block ml-auto text-[10px] text-muted/50 font-mono"> </span></a>'),Oe=y('<a><span class="text-lg"> </span> <span class="text-[9px]"> </span></a>'),Qe=y('<button class="w-full flex items-center gap-3 px-4 py-2.5 text-sm text-dim hover:text-text hover:bg-surface/40 transition"><span class="text-base w-5 text-center"> </span> <span> </span> <span class="ml-auto text-[10px] text-muted/50 font-mono hidden md:block"> </span></button>'),Be=y('<div class="px-4 py-6 text-center text-sm text-muted">No matches</div>'),Je=y('<div class="fixed inset-0 z-50 flex items-start justify-center pt-[10vh] md:pt-[15vh] px-4 bg-void/60 backdrop-blur-sm"><div class="w-full max-w-lg bg-abyss border border-subtle/40 rounded-xl shadow-2xl shadow-synapse/10 overflow-hidden"><div class="flex items-center gap-3 px-4 py-3 border-b border-subtle/20"><span class="text-synapse text-sm">◎</span> <input type="text" placeholder="Navigate to..." class="flex-1 bg-transparent text-text text-sm placeholder:text-muted focus:outline-none"/> <span class="text-[10px] text-muted font-mono bg-surface/40 px-1.5 py-0.5 rounded">esc</span></div> <div class="max-h-72 overflow-y-auto py-1"><!> <!></div></div></div>'),Ue=y('<div class="flex flex-col md:flex-row h-screen overflow-hidden bg-void"><nav class="hidden md:flex w-16 lg:w-56 flex-shrink-0 bg-abyss border-r border-subtle/30 flex-col"><a href="/graph" class="flex items-center gap-3 px-4 py-5 border-b border-subtle/20"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-dream to-synapse flex items-center justify-center text-bright text-sm font-bold">V</div> <span class="hidden lg:block text-sm font-semibold text-bright tracking-wide">VESTIGE</span></a> <div class="flex-1 py-3 flex flex-col gap-1 px-2"></div> <div class="px-2 pb-2"><button class="w-full flex items-center gap-2 px-3 py-2 rounded-lg text-xs text-muted hover:text-dim hover:bg-surface/50 transition border border-subtle/20"><span class="text-[10px] font-mono bg-surface/60 px-1.5 py-0.5 rounded">⌘K</span> <span class="hidden lg:block">Command</span></button></div> <div class="px-3 py-4 border-t border-subtle/20 space-y-2"><div class="flex items-center gap-2 text-xs"><div></div> <span class="hidden lg:block text-dim"> </span></div> <div class="hidden lg:block text-xs text-muted"><div> </div> <div> </div></div></div></nav> <main class="flex-1 overflow-y-auto pb-16 md:pb-0"><div class="animate-page-in svelte-12qhfyh"><!></div></main> <nav class="md:hidden fixed bottom-0 inset-x-0 bg-abyss/95 backdrop-blur-xl border-t border-subtle/30 z-40 safe-bottom svelte-12qhfyh"><div class="flex items-center justify-around px-2 py-1"><!> <button class="flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg text-muted min-w-[3.5rem]"><span class="text-lg">⋯</span> <span class="text-[9px]">More</span></button></div></nav></div> <!>',1);function dt(m,T){Me(T,!0);const Q=()=>L(Ve,"$page",k),B=()=>L(Re,"$isConnected",k),pe=()=>L(ze,"$memoryCount",k),ve=()=>L(je,"$avgRetention",k),[k,ue]=De();let c=oe(!1),x=oe(""),p;Ee(()=>{ce.connect();function r(e){if((e.metaKey||e.ctrlKey)&&e.key==="k"){e.preventDefault(),d(c,!s(c)),d(x,""),s(c)&&requestAnimationFrame(()=>p==null?void 0:p.focus());return}if(e.key==="Escape"&&s(c)){d(c,!1);return}if(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;if(e.key==="/"){e.preventDefault();const l=document.querySelector('input[type="text"]');l==null||l.focus();return}const n={g:"/graph",m:"/memories",t:"/timeline",f:"/feed",e:"/explore",i:"/intentions",s:"/stats"}[e.key.toLowerCase()];n&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),de(`${O}${n}`))}return window.addEventListener("keydown",r),()=>{ce.disconnect(),window.removeEventListener("keydown",r)}});const $=[{href:"/graph",label:"Graph",icon:"◎",shortcut:"G"},{href:"/memories",label:"Memories",icon:"◈",shortcut:"M"},{href:"/timeline",label:"Timeline",icon:"◷",shortcut:"T"},{href:"/feed",label:"Feed",icon:"◉",shortcut:"F"},{href:"/explore",label:"Explore",icon:"◬",shortcut:"E"},{href:"/intentions",label:"Intentions",icon:"◇",shortcut:"I"},{href:"/stats",label:"Stats",icon:"◫",shortcut:"S"},{href:"/settings",label:"Settings",icon:"⚙",shortcut:","}],fe=$.slice(0,5);function J(r,e){const v=e.startsWith(O)?e.slice(O.length)||"/":e;return r==="/graph"?v==="/"||v==="/graph":v.startsWith(r)}let C=z(()=>s(x)?$.filter(r=>r.label.toLowerCase().includes(s(x).toLowerCase())):$);function U(r){d(c,!1),d(x,""),de(r)}var X=Ue(),q=Ke(X),F=a(q),S=i(a(F),2);H(S,21,()=>$,V,(r,e)=>{const v=z(()=>J(s(e).href,Q().url.pathname));var n=We(),l=a(n),b=a(l,!0);t(l);var f=i(l,2),w=a(f,!0);t(f);var E=i(f,2),o=a(E,!0);t(E),t(n),K(()=>{le(n,"href",s(e).href),W(n,1,`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 text-sm
${s(v)?"bg-synapse/15 text-synapse-glow border border-synapse/30 shadow-[0_0_12px_rgba(99,102,241,0.15)]":"text-dim hover:text-text hover:bg-surface border border-transparent"}`),u(b,s(e).icon),u(w,s(e).label),u(o,s(e).shortcut)}),_(r,n)}),t(S);var A=i(S,2),xe=a(A);t(A);var Y=i(A,2),N=a(Y),Z=a(N),P=i(Z,2),me=a(P,!0);t(P),t(N);var I=i(N,2),D=a(I),be=a(D);t(D);var ee=i(D,2),ge=a(ee);t(ee),t(I),t(Y),t(F);var G=i(F,2),te=a(G),he=a(te);Fe(he,()=>T.children),t(te),t(G);var ae=i(G,2),se=a(ae),re=a(se);H(re,17,()=>fe,V,(r,e)=>{const v=z(()=>J(s(e).href,Q().url.pathname));var n=Oe(),l=a(n),b=a(l,!0);t(l);var f=i(l,2),w=a(f,!0);t(f),t(n),K(()=>{le(n,"href",s(e).href),W(n,1,`flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg transition-all min-w-[3.5rem]
${s(v)?"text-synapse-glow":"text-muted"}`),u(b,s(e).icon),u(w,s(e).label)}),_(r,n)});var _e=i(re,2);t(se),t(ae),t(q);var ye=i(q,2);{var we=r=>{var e=Je(),v=a(e),n=a(v),l=i(a(n),2);Se(l),Ne(l,o=>p=o,()=>p),Te(2),t(n);var b=i(n,2),f=a(b);H(f,17,()=>s(C),V,(o,g)=>{var M=Qe(),j=a(M),ke=a(j,!0);t(j);var R=i(j,2),$e=a(R,!0);t(R);var ne=i(R,2),Ce=a(ne,!0);t(ne),t(M),K(()=>{u(ke,s(g).icon),u($e,s(g).label),u(Ce,s(g).shortcut)}),h("click",M,()=>U(s(g).href)),_(o,M)});var w=i(f,2);{var E=o=>{var g=Be();_(o,g)};ie(w,o=>{s(C).length===0&&o(E)})}t(b),t(v),t(e),h("keydown",e,o=>{o.key==="Escape"&&d(c,!1)}),h("click",e,o=>{o.target===o.currentTarget&&d(c,!1)}),h("keydown",l,o=>{o.key==="Enter"&&s(C).length>0&&U(s(C)[0].href)}),Ae(l,()=>s(x),o=>d(x,o)),_(r,e)};ie(ye,r=>{s(c)&&r(we)})}K(r=>{W(Z,1,`w-2 h-2 rounded-full ${B()?"bg-recall animate-pulse-glow":"bg-decay"}`),u(me,B()?"Connected":"Offline"),u(be,`${pe()??""} memories`),u(ge,`${r??""}% retention`)},[()=>(ve()*100).toFixed(0)]),h("click",xe,()=>{d(c,!0),d(x,""),requestAnimationFrame(()=>p==null?void 0:p.focus())}),h("click",_e,()=>{d(c,!0),d(x,""),requestAnimationFrame(()=>p==null?void 0:p.focus())}),_(m,X),Le(),ue()}qe(["click","keydown"]);export{dt as component};