mirror of
https://github.com/samvallad33/vestige.git
synced 2026-05-29 19:35:15 +02:00
6 lines
26 KiB
JavaScript
6 lines
26 KiB
JavaScript
|
|
import"../chunks/Bzak7iHL.js";import{o as Nt}from"../chunks/CNjeV5xa.js";import{p as We,e as s,g as e,d as a,r as t,n as Fe,t as w,a as Ke,u as Z,s as ce,c as Tt,y as Ft,h as D,bc as jt,f as rt}from"../chunks/CvjSAYrz.js";import{s as v,d as Lt,a as Ge}from"../chunks/FzvEaXMa.js";import{i as O}from"../chunks/ciN1mm2W.js";import{e as re,i as ye}from"../chunks/DTnG8poT.js";import{a as f,f as _,b as ct}from"../chunks/BsvCUYx-.js";import{h as Dt}from"../chunks/DObx9JW_.js";import{s as K,r as Ot}from"../chunks/CNfQDikv.js";import{s as b}from"../chunks/Bhad70Ss.js";import{b as It}from"../chunks/CVpUe0w3.js";import{b as it}from"../chunks/D3XWCg9-.js";import{a as Mt}from"../chunks/DNjM5a-l.js";import{s as ut}from"../chunks/DPl3NjBv.js";import{p as ie}from"../chunks/B_YDQCB6.js";import{N as zt}from"../chunks/DzfRjky4.js";var $t=_('<div class="connector svelte-9hm057"></div>'),Bt=_('<div class="stage glass-subtle rounded-xl p-3 flex items-start gap-3 relative svelte-9hm057"><!> <div class="stage-orb flex-shrink-0 svelte-9hm057"><span class="text-xs text-synapse-glow svelte-9hm057"> </span></div> <div class="flex-1 min-w-0 svelte-9hm057"><div class="flex items-center gap-2 mb-0.5 svelte-9hm057"><span class="text-[10px] font-mono text-muted svelte-9hm057"> </span> <span class="text-sm text-bright font-medium svelte-9hm057"> </span></div> <p class="text-xs text-dim leading-snug svelte-9hm057"> </p></div> <span class="stage-pulse svelte-9hm057" aria-hidden="true"></span></div>'),Gt=_("<div></div>");function lt(l,o){We(o,!0);let V=ie(o,"intent",3,"Synthesis"),$=ie(o,"memoriesAnalyzed",3,0),R=ie(o,"evidenceCount",3,0),i=ie(o,"contradictionCount",3,0),B=ie(o,"supersededCount",3,0),E=ie(o,"running",3,!1),G=ie(o,"stageHints",19,()=>({}));const I=[{key:"broad",icon:"◎",label:"Broad Retrieval",base:"Hybrid BM25 + semantic (3x overfetch) then cross-encoder rerank"},{key:"spreading",icon:"⟿",label:"Spreading Activation",base:"Collins & Loftus — expand via graph edges to surface what search missed"},{key:"fsrs",icon:"▲",label:"FSRS Trust Scoring",base:"retention × stability × reps ÷ lapses — which memories have earned trust"},{key:"intent",icon:"◆",label:"Intent Classification",base:"FactCheck / Timeline / RootCause / Comparison / Synthesis"},{key:"supersession",icon:"↗",label:"Temporal Supersession",base:"Newer high-trust memories replace older ones on the same fact"},{key:"contradiction",icon:"⚡",label:"Contradiction Analysis",base:"Only flag conflicts between memories where BOTH have trust > 0.3"},{key:"relation",icon:"⬡",label:"Relation Assessment",base:"Per pair: Supports / Contradicts / Supersedes / Irrelevant"},{key:"template",icon:"❖",label:"Template Reasoning",base:"Build the natural-language reasoning chain you validate"}],Y=Z(()=>({broad:$()?`Analyzed ${$()} memories · ${R()} survived ranking`:void 0,intent:V()?`Classified as ${V()}`:void 0,supersession:B()?`${B()} outdated memor${B()===1?"y":"ies"} superseded`:void 0,contradiction:i()?`${i()} real conflict${i()===1?"":"s"} between trusted memories`:"No conflicts between trusted memories"}));function Q(M,z){return G()[M]??e(Y)[M]??z}var P=Gt();let ue;re(P,23,()=>I,M=>M.key,(M,z,H)=>{var A=Bt(),U=s(A);{var le=n=>{var p=$t();w(()=>b(p,`animation-delay: ${e(H)*140+120}ms;`)),f(n,p)};O(U,n=>{e(H)<I.length-1&&n(le)})}var J=a(U,2),ee=s(J),te=s(ee,!0);t(ee),t(J);var se=a(J,2),ae=s(se),ne=s(ae),pe=s(ne);t(ne);var ve=a(ne,2),me=s(ve,!0);t(ve),t(ae);var xe=a(ae,2),r=s(xe,!0);t(xe),t(se),Fe(2),t(A),w(n=>{b(A,`animation-delay: ${e(H)*140}ms;`),b(J,`animation-delay: ${e(H)*140}ms;`),v(te,e(z).icon),v(pe,`0${e(H)+1}`),v(me,e(z).label),v(r,n)},[()=>Q(e(z).key,e(z).base)]),f(M,A)}),t(P),w(()=>ue=ut(P,1,"reasoning-chain space-y-2 svelte-9hm057",null,ue,{running:E()})),f(l,P),Ke()}const Pt="#10b981",Ht="#f59e0b",He="#ef4444",vt="#8B95A5",ot={primary:{label:"Primary",accent:"synapse",icon:"◈"},supporting:{label:"Supporting",accent:"recall",icon:"◇"},contradicting:{label:"Contradicting",accent:"decay",icon:"⚠"},superseded:{label:"Superseded",accent:"muted",icon:"⊘"}};func
|
|||
|
|
contradiction → relations → chain. Zero LLM calls, 100% local.</p></div>`),fs=_(`<div class="p-6 max-w-6xl mx-auto space-y-8 svelte-q2v96u"><div class="space-y-2 svelte-q2v96u"><div class="flex items-center gap-3 svelte-q2v96u"><span class="text-2xl text-dream-glow svelte-q2v96u">❖</span> <h1 class="text-xl text-bright font-semibold svelte-q2v96u">Reasoning Theater</h1> <span class="px-2 py-0.5 rounded bg-dream/15 border border-dream/30 text-[10px] text-dream-glow uppercase tracking-wider svelte-q2v96u">deep_reference</span></div> <p class="text-xs text-dim max-w-2xl svelte-q2v96u">Watch Vestige reason. Your query runs the 8-stage cognitive pipeline — broad retrieval,
|
|||
|
|
spreading activation, FSRS trust scoring, intent classification, supersession, contradiction
|
|||
|
|
analysis, relation assessment, template reasoning — and returns a pre-built answer with
|
|||
|
|
trust-scored evidence.</p></div> <div class="glass-panel rounded-2xl p-5 space-y-4 svelte-q2v96u"><div class="flex items-center gap-3 svelte-q2v96u"><span class="text-lg text-synapse-glow svelte-q2v96u">◎</span> <input type="text" placeholder="Ask your memory anything..." class="flex-1 bg-transparent text-bright text-lg placeholder:text-muted focus:outline-none font-mono svelte-q2v96u"/> <kbd class="hidden sm:inline-flex items-center gap-1 px-2 py-1 rounded bg-white/[0.04] border border-synapse/15 text-[10px] text-dim font-mono svelte-q2v96u"><span class="svelte-q2v96u">⌘</span>K</kbd> <button class="px-4 py-2 rounded-xl bg-synapse/20 border border-synapse/40 text-synapse-glow text-sm hover:bg-synapse/30 transition disabled:opacity-40 disabled:cursor-not-allowed svelte-q2v96u"> </button></div> <!></div> <!> <!> <!> <!></div>`);function Ls(l,o){We(o,!0);async function V(r){var qe,Ee,we;const n=await Mt.deepReference(r,20),k=(Array.isArray(n.evidence)?n.evidence:[]).map(c=>{const T=typeof c.trust=="number"?c.trust:0,ke=T>1?T/100:T,Se=c.role||"supporting";return{id:String(c.id??""),trust:Math.max(0,Math.min(1,ke)),date:String(c.date??""),role:Se,preview:String(c.preview??""),nodeType:c.node_type?String(c.node_type):c.nodeType?String(c.nodeType):void 0}}),x=n.recommended,N={answer_preview:String((x==null?void 0:x.answer_preview)??((qe=k[0])==null?void 0:qe.preview)??""),memory_id:String((x==null?void 0:x.memory_id)??((Ee=k[0])==null?void 0:Ee.id)??""),trust_score:(()=>{var T;const c=x==null?void 0:x.trust_score;return typeof c=="number"?c>1?c/100:c:((T=k[0])==null?void 0:T.trust)??0})(),date:String((x==null?void 0:x.date)??((we=k[0])==null?void 0:we.date)??"")},ge=(Array.isArray(n.contradictions)?n.contradictions:[]).map(c=>({a_id:String(c.a_id??""),b_id:String(c.b_id??""),summary:String(c.summary??c.reason??"Trust-weighted conflict between high-FSRS memories.")})),he=(Array.isArray(n.superseded)?n.superseded:[]).map(c=>({old_id:String(c.old_id??""),new_id:String(c.new_id??N.memory_id??""),reason:String(c.reason??"Superseded by newer memory with higher FSRS trust.")})),fe=(Array.isArray(n.evolution)?n.evolution:[]).map(c=>({date:String(c.date??""),summary:String(c.summary??c.preview??""),trust:(()=>{const T=c.trust;return typeof T=="number"?T>1?T/100:T:0})()})),je=Array.isArray(n.related_insights)?n.related_insights:[],oe=typeof n.confidence=="number"?n.confidence:0,de=oe>1?Math.round(oe):Math.round(oe*100),Le=String(n.intent??"Synthesis"),Re=String(n.reasoning??n.guidance??""),be=typeof n.memoriesAnalyzed=="number"?n.memoriesAnalyzed:k.length;return{intent:Le,reasoning:Re,recommended:N,evidence:k,contradictions:ge,superseded:he,evolution:fe,related_insights:je,confidence:de,memoriesAnalyzed:be}}let $=ce(""),R=ce(!1),i=ce(null),B=ce(null),E=ce(null),G=ce(null),I=ce(Tt([]));async function Y(){const r=e($).trim();if(!(!r||e(R))){D(R,!0),D(B,null),D(i,null),D(I,[],!0);try{D(i,await V(r),!0),requestAnimationFrame(()=>requestAnimationFrame(Q))}catch(n){D(B,n instanceof Error?n.message:"Unknown error",!0)}finally{D(R,!1)}}}function Q(){if(!e(i)||!e(G)||e(i).contradictions.length===0){D(I,[],!0);return}const r=e(G).getBoundingClientRect(),n=[];for(const p of e(i).contradictions){const k=e(G).querySelector(`[data-evidence-id="${p.a_id}"]`),x=e(G).querySelector(`[data-evidence-id="${p.b_id}"]`);if(!k||!x)continue;const N=k.getBoundingClientRect(),W=x.getBoundingClientRect();n.push({x1:N.left-r.left+N.width/2,y1:N.top-r.top+N.height/2,x2:W.left-r.left+W.width/2,y2:W.top-r.top+W.height/2})}D(I,n,!0)}function P(r){var n,p;(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),(n=e(E))==null||n.focus(),(p=e(E))==null||p.select())}Nt(()=>{var r;return(r=e(E))==null||r.focus(),window.addEventListener("keydown",P),window.addEventListener("resize",Q),()=>{window.removeEventListener("keydown",P),window.removeEventListener("resize",Q)}});const ue=["What port does the dev server use?","Should I enable prefix caching with vLLM?","Why did the AIMO3 submission score 36/50?","How does FSRS-6 trust scoring work?"];var M=fs();
|