mirror of
https://github.com/samvallad33/vestige.git
synced 2026-05-02 04:12:36 +02:00
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>
2 lines
9.9 KiB
JavaScript
2 lines
9.9 KiB
JavaScript
import"../chunks/Bzak7iHL.js";import{o as ze}from"../chunks/BycUxjt3.js";import{p as Je,t as w,a as Le,g as s,d as t,e as d,s as S,h as m,r as e,G as _,f as We,u as j}from"../chunks/DEYVqDYQ.js";import{d as Be,a as X,s as u}from"../chunks/ZM2C7QQX.js";import{i as p}from"../chunks/CpubbTHs.js";import{e as Z,i as ee}from"../chunks/CiJhRXcr.js";import{a as v,f as l,t as pe}from"../chunks/D5-kFxsM.js";import{s as be}from"../chunks/zt9hmg4X.js";import{s as ge}from"../chunks/B9t3YtL9.js";import{s as He,a as te}from"../chunks/DUZi1B8N.js";import{a as T}from"../chunks/BcuCGYSa.js";import{m as Ue,a as Ye,i as qe}from"../chunks/DmEsXEQB.js";var Qe=l('<span class="w-3 h-3 border border-warning/50 border-t-warning rounded-full animate-spin"></span> Running...',1),Xe=l('<div><div class="text-lg text-text font-semibold"> </div> <div class="text-[10px] text-muted">Processed</div></div>'),Ze=l('<div><div class="text-lg text-decay font-semibold"> </div> <div class="text-[10px] text-muted">Decayed</div></div>'),et=l('<div><div class="text-lg text-synapse-glow font-semibold"> </div> <div class="text-[10px] text-muted">Embedded</div></div>'),tt=l('<div class="bg-deep/50 p-3 rounded-lg border border-subtle/10"><div class="grid grid-cols-3 gap-3 text-center"><!> <!> <!></div></div>'),st=l('<span class="w-3 h-3 border border-dream/50 border-t-dream rounded-full animate-spin"></span> Dreaming...',1),at=l('<div class="text-xs text-dim bg-dream/5 border border-dream/10 rounded p-2"> </div>'),rt=l('<div class="text-xs text-bright font-medium">Insights Discovered:</div> <!>',1),it=l('<div class="text-xs text-dim">Connections found: <span class="text-dream-glow"> </span></div>'),dt=l('<div class="text-xs text-dim">Memories replayed: <span class="text-text"> </span></div>'),ot=l('<div class="bg-deep/50 p-3 rounded-lg border border-subtle/10 space-y-2"><!> <!> <!></div>'),nt=l('<div class="flex-1 flex flex-col items-center gap-1"><div class="text-[9px] text-muted"> </div> <div class="w-full rounded-t transition-all duration-500"></div> <div class="text-[9px] text-muted"></div></div>'),vt=l('<div class="flex items-end gap-1 h-32"></div>'),lt=l('<section class="space-y-4"><h2 class="text-sm text-bright font-semibold flex items-center gap-2"><span class="text-recall">◫</span> Retention Distribution</h2> <div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg"><!></div></section>'),ct=l('<div class="flex items-center gap-2 py-1"><kbd class="px-1.5 py-0.5 bg-deep rounded text-[10px] font-mono text-muted min-w-[2rem] text-center"> </kbd> <span class="text-dim"> </span></div>'),xt=l(`<div class="p-6 max-w-4xl mx-auto space-y-8"><div class="flex items-center justify-between"><h1 class="text-xl text-bright font-semibold">Settings & System</h1> <button class="text-xs text-dim hover:text-text transition">Refresh</button></div> <div class="grid grid-cols-2 md:grid-cols-4 gap-3"><div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg text-center"><div class="text-2xl text-bright font-bold"> </div> <div class="text-xs text-dim mt-1">Memories</div></div> <div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg text-center"><div class="text-2xl font-bold"> </div> <div class="text-xs text-dim mt-1">Avg Retention</div></div> <div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg text-center"><div class="text-2xl text-bright font-bold flex items-center justify-center gap-2"><div></div> <span class="text-sm"> </span></div> <div class="text-xs text-dim mt-1">WebSocket</div></div> <div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg text-center"><div class="text-2xl text-synapse-glow font-bold">v2.0</div> <div class="text-xs text-dim mt-1">Vestige</div></div></div> <section class="space-y-4"><h2 class="text-sm text-bright font-semibold flex items-center gap-2"><span class="text-dream">◈</span> Cognitive Operations</h2> <div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg space-y-3"><div class="flex items-center justify-between"><div><div class="text-sm text-text font-medium">FSRS-6 Consolidation</div> <div class="text-xs text-dim">Apply spaced-repetition decay, regenerate embeddings, run maintenance</div></div> <button class="px-4 py-2 bg-warning/20 border border-warning/40 text-warning text-sm rounded-lg hover:bg-warning/30 transition disabled:opacity-50 flex items-center gap-2"><!></button></div> <!></div> <div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg space-y-3"><div class="flex items-center justify-between"><div><div class="text-sm text-text font-medium">Memory Dream Cycle</div> <div class="text-xs text-dim">Replay memories, discover hidden connections, synthesize insights</div></div> <button><!></button></div> <!></div></section> <!> <section class="space-y-4"><h2 class="text-sm text-bright font-semibold flex items-center gap-2"><span class="text-synapse">⌨</span> Keyboard Shortcuts</h2> <div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg"><div class="grid grid-cols-2 gap-2 text-xs"></div></div></section> <section class="space-y-4"><h2 class="text-sm text-bright font-semibold flex items-center gap-2"><span class="text-memory">◎</span> About</h2> <div class="p-4 bg-surface/30 border border-subtle/20 rounded-lg space-y-3"><div class="flex items-center gap-4"><div class="w-12 h-12 rounded-xl bg-gradient-to-br from-dream to-synapse flex items-center justify-center text-bright text-xl font-bold shadow-lg shadow-synapse/20">V</div> <div><div class="text-sm text-bright font-semibold">Vestige v2.0 "Cognitive Leap"</div> <div class="text-xs text-dim">Your AI's long-term memory system</div></div></div> <div class="grid grid-cols-2 gap-2 text-xs text-dim pt-2 border-t border-subtle/10"><div>29 cognitive modules</div> <div>FSRS-6 spaced repetition</div> <div>Nomic Embed v1.5 (256d)</div> <div>Jina Reranker v1 Turbo</div> <div>USearch HNSW (20x FAISS)</div> <div>Local-first, zero cloud</div></div> <div class="text-[10px] text-muted pt-1">Built with Rust + Axum + SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4</div></div></section></div>`);function Ct(fe,_e){Je(_e,!0);const ye=()=>te(Ue,"$memoryCount",K),I=()=>te(Ye,"$avgRetention",K),se=()=>te(qe,"$isConnected",K),[K,he]=He();let E=S(!1),A=S(!1),y=S(null),b=S(null),we=S(null),$=S(null),ae=S(!0),Se=S(null);ze(()=>{O()});async function O(){m(ae,!0);try{const[a,o,c]=await Promise.all([T.stats().catch(()=>null),T.health().catch(()=>null),T.retentionDistribution().catch(()=>null)]);m(we,a,!0),m(Se,o,!0),m($,c,!0)}finally{m(ae,!1)}}async function ke(){m(E,!0),m(y,null);try{m(y,await T.consolidate(),!0),await O()}catch{}finally{m(E,!1)}}async function Ce(){m(A,!0),m(b,null);try{m(b,await T.dream(),!0),await O()}catch{}finally{m(A,!1)}}var N=xt(),V=t(N),Re=d(t(V),2);e(V);var z=d(V,2),J=t(z),re=t(J),$e=t(re,!0);e(re),_(2),e(J);var L=d(J,2),W=t(L),Ae=t(W);e(W),_(2),e(L);var ie=d(L,2),de=t(ie),oe=t(de),ne=d(oe,2),Ge=t(ne,!0);e(ne),e(de),_(2),e(ie),_(2),e(z);var B=d(z,2),H=d(t(B),2),U=t(H),P=d(t(U),2),De=t(P);{var Me=a=>{var o=Qe();_(),v(a,o)},Fe=a=>{var o=pe("Consolidate");v(a,o)};p(De,a=>{s(E)?a(Me):a(Fe,!1)})}e(P),e(U);var je=d(U,2);{var Te=a=>{var o=tt(),c=t(o),g=t(c);{var k=i=>{var r=Xe(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).nodesProcessed)),v(i,r)};p(g,i=>{s(y).nodesProcessed!==void 0&&i(k)})}var f=d(g,2);{var h=i=>{var r=Ze(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).decayApplied)),v(i,r)};p(f,i=>{s(y).decayApplied!==void 0&&i(h)})}var C=d(f,2);{var D=i=>{var r=et(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).embeddingsGenerated)),v(i,r)};p(C,i=>{s(y).embeddingsGenerated!==void 0&&i(D)})}e(c),e(o),v(a,o)};p(je,a=>{s(y)&&a(Te)})}e(H);var ve=d(H,2),Y=t(ve),G=d(t(Y),2),Ee=t(G);{var Oe=a=>{var o=st();_(),v(a,o)},Pe=a=>{var o=pe("Dream");v(a,o)};p(Ee,a=>{s(A)?a(Oe):a(Pe,!1)})}e(G),e(Y);var Ie=d(Y,2);{var Ke=a=>{var o=ot(),c=t(o);{var g=i=>{var r=rt(),n=d(We(r),2);Z(n,17,()=>s(b).insights,ee,(x,M)=>{var R=at(),F=t(R,!0);e(R),w(q=>u(F,q),[()=>typeof s(M)=="string"?s(M):JSON.stringify(s(M))]),v(x,R)}),v(i,r)},k=j(()=>s(b).insights&&Array.isArray(s(b).insights));p(c,i=>{s(k)&&i(g)})}var f=d(c,2);{var h=i=>{var r=it(),n=d(t(r)),x=t(n,!0);e(n),e(r),w(()=>u(x,s(b).connections_found)),v(i,r)};p(f,i=>{s(b).connections_found!==void 0&&i(h)})}var C=d(f,2);{var D=i=>{var r=dt(),n=d(t(r)),x=t(n,!0);e(n),e(r),w(()=>u(x,s(b).memories_replayed)),v(i,r)};p(C,i=>{s(b).memories_replayed!==void 0&&i(D)})}e(o),v(a,o)};p(Ie,a=>{s(b)&&a(Ke)})}e(ve),e(B);var le=d(B,2);{var Ne=a=>{var o=lt(),c=d(t(o),2),g=t(c);{var k=h=>{var C=vt();Z(C,21,()=>s($).distribution,ee,(D,i,r)=>{const n=j(()=>Math.max(...s($).distribution.map(Q=>Q.count),1)),x=j(()=>s(i).count/s(n)*100),M=j(()=>r<2?"#ef4444":r<4?"#f59e0b":r<7?"#6366f1":"#10b981");var R=nt(),F=t(R),q=t(F,!0);e(F);var ue=d(F,2),Ve=d(ue,2);Ve.textContent=`${r*10}%`,e(R),w(Q=>{u(q,s(i).count),ge(ue,`height: ${Q??""}%; background: ${s(M)??""}; opacity: 0.7`)},[()=>Math.max(s(x),2)]),v(D,R)}),e(C),v(h,C)},f=j(()=>s($).distribution&&Array.isArray(s($).distribution));p(g,h=>{s(f)&&h(k)})}e(c),e(o),v(a,o)};p(le,a=>{s($)&&a(Ne)})}var ce=d(le,2),xe=d(t(ce),2),me=t(xe);Z(me,20,()=>[{key:"⌘ K",desc:"Command palette"},{key:"/",desc:"Focus search"},{key:"G",desc:"Go to Graph"},{key:"M",desc:"Go to Memories"},{key:"T",desc:"Go to Timeline"},{key:"F",desc:"Go to Feed"},{key:"E",desc:"Go to Explore"},{key:"S",desc:"Go to Stats"}],ee,(a,o)=>{var c=ct(),g=t(c),k=t(g,!0);e(g);var f=d(g,2),h=t(f,!0);e(f),e(c),w(()=>{u(k,o.key),u(h,o.desc)}),v(a,c)}),e(me),e(xe),e(ce),_(2),e(N),w(a=>{u($e,ye()),ge(W,`color: ${I()>.7?"#10b981":I()>.4?"#f59e0b":"#ef4444"}`),u(Ae,`${a??""}%`),be(oe,1,`w-2.5 h-2.5 rounded-full ${se()?"bg-recall animate-pulse-glow":"bg-decay"}`),u(Ge,se()?"Online":"Offline"),P.disabled=s(E),G.disabled=s(A),be(G,1,`px-4 py-2 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-lg hover:bg-dream/30 transition disabled:opacity-50 flex items-center gap-2
|
|
${s(A)?"glow-dream animate-pulse-glow":""}`)},[()=>(I()*100).toFixed(1)]),X("click",Re,O),X("click",P,ke),X("click",G,Ce),v(fe,N),Le(),he()}Be(["click"]);export{Ct as component};
|