import{a as v,f as l,t as pe}from"../chunks/wmwKEafM.js";import{p as He,H as Je,s as m,t as w,a as Le,d as k,g as s,c as t,e as i,r as e,G as _,f as Pe,u as j}from"../chunks/DleE0ac1.js";import{d as We,a as X,s as u}from"../chunks/8PSwG_AU.js";import{i as p}from"../chunks/BHs8FnOA.js";import{e as Z,i as ee}from"../chunks/BsRos8Kb.js";import{s as be}from"../chunks/BK028jHP.js";import{s as fe}from"../chunks/D6n3ggvw.js";import{s as Be,a as te}from"../chunks/M1z6VHZC.js";import{a as T}from"../chunks/BcuCGYSa.js";import{m as Ue,a as Ye,i as qe}from"../chunks/kVvujbiQ.js";var Qe=l(' Running...',1),Xe=l('
Processed
'),Ze=l('
Decayed
'),et=l('
Embedded
'),tt=l('
'),st=l(' Dreaming...',1),at=l('
'),rt=l('
Insights Discovered:
',1),dt=l('
Connections found:
'),it=l('
Memories replayed:
'),ot=l('
'),nt=l('
'),vt=l('
'),lt=l('

Retention Distribution

'),ct=l('
'),xt=l(`

Settings & System

Memories
Avg Retention
WebSocket
v2.0
Vestige

Cognitive Operations

FSRS-6 Consolidation
Apply spaced-repetition decay, regenerate embeddings, run maintenance
Memory Dream Cycle
Replay memories, discover hidden connections, synthesize insights

Keyboard Shortcuts

About

V
Vestige v2.0 "Cognitive Leap"
Your AI's long-term memory system
29 cognitive modules
FSRS-6 spaced repetition
Nomic Embed v1.5 (256d)
Jina Reranker v1 Turbo
USearch HNSW (20x FAISS)
Local-first, zero cloud
Built with Rust + Axum + SvelteKit 2 + Svelte 5 + Three.js + Tailwind CSS 4
`);function kt(ge,_e){He(_e,!0);const ye=()=>te(Ue,"$memoryCount",N),K=()=>te(Ye,"$avgRetention",N),se=()=>te(qe,"$isConnected",N),[N,he]=Be();let E=k(!1),A=k(!1),y=k(null),b=k(null),we=k(null),$=k(null),ae=k(!0),ke=k(null);Je(()=>{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(ke,o,!0),m($,c,!0)}finally{m(ae,!1)}}async function Se(){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 V=xt(),z=t(V),Re=i(t(z),2);e(z);var H=i(z,2),J=t(H),re=t(J),$e=t(re,!0);e(re),_(2),e(J);var L=i(J,2),P=t(L),Ae=t(P);e(P),_(2),e(L);var de=i(L,2),ie=t(de),oe=t(ie),ne=i(oe,2),De=t(ne,!0);e(ne),e(ie),_(2),e(de),_(2),e(H);var W=i(H,2),B=i(t(W),2),U=t(B),I=i(t(U),2),Ge=t(I);{var Fe=a=>{var o=Qe();_(),v(a,o)},Me=a=>{var o=pe("Consolidate");v(a,o)};p(Ge,a=>{s(E)?a(Fe):a(Me,!1)})}e(I),e(U);var je=i(U,2);{var Te=a=>{var o=tt(),c=t(o),f=t(c);{var S=d=>{var r=Xe(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).processed)),v(d,r)};p(f,d=>{s(y).processed!==void 0&&d(S)})}var g=i(f,2);{var h=d=>{var r=Ze(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).decayed)),v(d,r)};p(g,d=>{s(y).decayed!==void 0&&d(h)})}var C=i(g,2);{var G=d=>{var r=et(),n=t(r),x=t(n,!0);e(n),_(2),e(r),w(()=>u(x,s(y).embedded)),v(d,r)};p(C,d=>{s(y).embedded!==void 0&&d(G)})}e(c),e(o),v(a,o)};p(je,a=>{s(y)&&a(Te)})}e(B);var ve=i(B,2),Y=t(ve),D=i(t(Y),2),Ee=t(D);{var Oe=a=>{var o=st();_(),v(a,o)},Ie=a=>{var o=pe("Dream");v(a,o)};p(Ee,a=>{s(A)?a(Oe):a(Ie,!1)})}e(D),e(Y);var Ke=i(Y,2);{var Ne=a=>{var o=ot(),c=t(o);{var f=d=>{var r=rt(),n=i(Pe(r),2);Z(n,17,()=>s(b).insights,ee,(x,F)=>{var R=at(),M=t(R,!0);e(R),w(q=>u(M,q),[()=>typeof s(F)=="string"?s(F):JSON.stringify(s(F))]),v(x,R)}),v(d,r)},S=j(()=>s(b).insights&&Array.isArray(s(b).insights));p(c,d=>{s(S)&&d(f)})}var g=i(c,2);{var h=d=>{var r=dt(),n=i(t(r)),x=t(n,!0);e(n),e(r),w(()=>u(x,s(b).connections_found)),v(d,r)};p(g,d=>{s(b).connections_found!==void 0&&d(h)})}var C=i(g,2);{var G=d=>{var r=it(),n=i(t(r)),x=t(n,!0);e(n),e(r),w(()=>u(x,s(b).memories_replayed)),v(d,r)};p(C,d=>{s(b).memories_replayed!==void 0&&d(G)})}e(o),v(a,o)};p(Ke,a=>{s(b)&&a(Ne)})}e(ve),e(W);var le=i(W,2);{var Ve=a=>{var o=lt(),c=i(t(o),2),f=t(c);{var S=h=>{var C=vt();Z(C,21,()=>s($).buckets,ee,(G,d,r)=>{const n=j(()=>Math.max(...s($).buckets.map(Q=>Q.count),1)),x=j(()=>s(d).count/s(n)*100),F=j(()=>r<2?"#ef4444":r<4?"#f59e0b":r<7?"#6366f1":"#10b981");var R=nt(),M=t(R),q=t(M,!0);e(M);var ue=i(M,2),ze=i(ue,2);ze.textContent=`${r*10}%`,e(R),w(Q=>{u(q,s(d).count),fe(ue,`height: ${Q??""}%; background: ${s(F)??""}; opacity: 0.7`)},[()=>Math.max(s(x),2)]),v(G,R)}),e(C),v(h,C)},g=j(()=>s($).buckets&&Array.isArray(s($).buckets));p(f,h=>{s(g)&&h(S)})}e(c),e(o),v(a,o)};p(le,a=>{s($)&&a(Ve)})}var ce=i(le,2),xe=i(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(),f=t(c),S=t(f,!0);e(f);var g=i(f,2),h=t(g,!0);e(g),e(c),w(()=>{u(S,o.key),u(h,o.desc)}),v(a,c)}),e(me),e(xe),e(ce),_(2),e(V),w(a=>{u($e,ye()),fe(P,`color: ${K()>.7?"#10b981":K()>.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(De,se()?"Online":"Offline"),I.disabled=s(E),D.disabled=s(A),be(D,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":""}`)},[()=>(K()*100).toFixed(1)]),X("click",Re,O),X("click",I,Se),X("click",D,Ce),v(ge,V),Le(),he()}We(["click"]);export{kt as component};