feat(v2.0.5): Intentional Amnesia — active forgetting via top-down inhibitory control

First AI memory system to model forgetting as a neuroscience-grounded
PROCESS rather than passive decay. Adds the `suppress` MCP tool (#24),
Rac1 cascade worker, migration V10, and dashboard forgetting indicators.

Based on:
- Anderson, Hanslmayr & Quaegebeur (2025), Nat Rev Neurosci — right
  lateral PFC as the domain-general inhibitory controller; SIF
  compounds with each stopping attempt.
- Cervantes-Sandoval et al. (2020), Front Cell Neurosci PMC7477079 —
  Rac1 GTPase as the active synaptic destabilization mechanism.

What's new:
* `suppress` MCP tool — each call compounds `suppression_count` and
  subtracts a `0.15 × count` penalty (saturating at 80%) from
  retrieval scores during hybrid search. Distinct from delete
  (removes) and demote (one-shot).
* Rac1 cascade worker — background sweep piggybacks the 6h
  consolidation loop, walks `memory_connections` edges from
  recently-suppressed seeds, applies attenuated FSRS decay to
  co-activated neighbors. You don't just forget Jake — you fade
  the café, the roommate, the birthday.
* 24h labile window — reversible via `suppress({id, reverse: true})`
  within 24 hours. Matches Nader reconsolidation semantics.
* Migration V10 — additive-only (`suppression_count`, `suppressed_at`
  + partial indices). All v2.0.x DBs upgrade seamlessly on first launch.
* Dashboard: `ForgettingIndicator.svelte` pulses when suppressions
  are active. 3D graph nodes dim to 20% opacity when suppressed.
  New WebSocket events: `MemorySuppressed`, `MemoryUnsuppressed`,
  `Rac1CascadeSwept`. Heartbeat carries `suppressed_count`.
* Search pipeline: SIF penalty inserted into the accessibility stage
  so it stacks on top of passive FSRS decay.
* Tool count bumped 23 → 24. Cognitive modules 29 → 30.

Memories persist — they are INHIBITED, not erased. `memory.get(id)`
returns full content through any number of suppressions. The 24h
labile window is a grace period for regret.

Also fixes issue #31 (dashboard graph view buggy) as a companion UI
bug discovered during the v2.0.5 audit cycle:

* Root cause: node glow `SpriteMaterial` had no `map`, so
  `THREE.Sprite` rendered as a solid-coloured 1×1 plane. Additive
  blending + `UnrealBloomPass(0.8, 0.4, 0.85)` amplified the square
  edges into hard-edged glowing cubes.
* Fix: shared 128×128 radial-gradient `CanvasTexture` singleton used
  as the sprite map. Retuned bloom to `(0.55, 0.6, 0.2)`. Halved fog
  density (0.008 → 0.0035). Edges bumped from dark navy `0x4a4a7a`
  to brand violet `0x8b5cf6` with higher opacity. Added explicit
  `scene.background` and a 2000-point starfield for depth.
* 21 regression tests added in `ui-fixes.test.ts` locking every
  invariant in (shared texture singleton, depthWrite:false, scale
  ×6, bloom magic numbers via source regex, starfield presence).

Tests: 1,284 Rust (+47) + 171 Vitest (+21) = 1,455 total, 0 failed
Clippy: clean across all targets, zero warnings
Release binary: 22.6MB, `cargo build --release -p vestige-mcp` green
Versions: workspace aligned at 2.0.5 across all 6 crates/packages

Closes #31
This commit is contained in:
Sam Valladares 2026-04-14 17:30:30 -05:00
parent 95bde93b49
commit 8178beb961
359 changed files with 8277 additions and 3416 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
import"../chunks/Bzak7iHL.js";import{i as h}from"../chunks/D1BK9eoQ.js";import{p as g,f as d,t as l,a as v,d as _,e as s,r as o}from"../chunks/BBD-8XME.js";import{s as p}from"../chunks/DNn3Nckx.js";import{a as x,f as $}from"../chunks/CKcqngaU.js";import{p as m}from"../chunks/BeSd-T80.js";import{s as k}from"../chunks/cIQD_rb4.js";const b={get error(){return m.error},get status(){return m.status}};k.updated.check;const i=b;var E=$("<h1> </h1> <p> </p>",1);function C(f,n){g(n,!1),h();var t=E(),r=d(t),c=s(r,!0);o(r);var a=_(r,2),u=s(a,!0);o(a),l(()=>{var e;p(c,i.status),p(u,(e=i.error)==null?void 0:e.message)}),x(f,t),v()}export{C as component};

View file

@ -0,0 +1 @@
import"../chunks/Bzak7iHL.js";import"../chunks/D_N1HvA5.js";import{p as h,f as g,t as d,a as l,d as v,e as s,r as o}from"../chunks/nyjtQ1Ok.js";import{s as p}from"../chunks/C4L78yoI.js";import{a as _,f as x}from"../chunks/B0IenmM-.js";import{i as $}from"../chunks/Ck7jSX2P.js";import{p as m}from"../chunks/urMNLRPv.js";import{s as k}from"../chunks/DwA4GIGc.js";const b={get error(){return m.error},get status(){return m.status}};k.updated.check;const i=b;var E=x("<h1> </h1> <p> </p>",1);function D(f,n){h(n,!1),$();var t=E(),r=g(t),c=s(r,!0);o(r);var a=v(r,2),u=s(a,!0);o(a),d(()=>{var e;p(c,i.status),p(u,(e=i.error)==null?void 0:e.message)}),_(f,t),l()}export{D as component};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
import"../chunks/Bzak7iHL.js";import{o as pe}from"../chunks/DUC-ssvh.js";import{p as ce,s as b,c as me,g as e,a as _e,d as i,e as a,h as c,r as t,t as g}from"../chunks/BBD-8XME.js";import{d as ue,a as K,s as m}from"../chunks/DNn3Nckx.js";import{i as M}from"../chunks/RaRNNC-y.js";import{e as h,i as P}from"../chunks/C5a--lgk.js";import{a as l,f as v}from"../chunks/CKcqngaU.js";import{s as Q}from"../chunks/DBfx-YTU.js";import{b as xe}from"../chunks/C-QujEl6.js";import{a as fe}from"../chunks/BcuCGYSa.js";import{N as U}from"../chunks/CZ45jJaw.js";var be=v('<div class="h-16 glass-subtle rounded-xl animate-pulse"></div>'),ge=v('<div class="space-y-4"></div>'),he=v('<div class="text-center py-20 text-dim"><p>No memories in the selected time range.</p></div>'),ye=v('<div class="w-2 h-2 rounded-full"></div>'),we=v('<span class="text-xs text-muted"> </span>'),ke=v('<div class="flex items-start gap-2 text-sm"><div class="w-2 h-2 mt-1.5 rounded-full flex-shrink-0"></div> <div class="flex-1 min-w-0"><span class="text-dim line-clamp-1"> </span></div> <span class="text-xs text-muted flex-shrink-0"> </span></div>'),Te=v('<div class="mt-3 pt-3 border-t border-synapse/10 space-y-2"></div>'),je=v('<div class="relative pl-14"><div class="absolute left-4 top-3 w-5 h-5 rounded-full border-2 border-synapse bg-void flex items-center justify-center"><div class="w-2 h-2 rounded-full bg-synapse"></div></div> <button class="w-full text-left p-4 glass-subtle rounded-xl hover:bg-white/[0.03] transition-all"><div class="flex items-center justify-between"><div><span class="text-sm text-bright font-medium"> </span> <span class="text-xs text-dim ml-2"> </span></div> <div class="flex gap-1"><!> <!></div></div> <!></button></div>'),Ae=v('<div class="relative"><div class="absolute left-6 top-0 bottom-0 w-px bg-synapse/15"></div> <div class="space-y-4"></div></div>'),Ne=v('<div class="p-6 max-w-4xl mx-auto space-y-6"><div class="flex items-center justify-between"><h1 class="text-xl text-bright font-semibold">Timeline</h1> <select class="px-3 py-2 bg-white/[0.03] border border-synapse/10 rounded-xl text-dim text-sm focus:outline-none backdrop-blur-sm"><option>7 days</option><option>14 days</option><option>30 days</option><option>90 days</option></select></div> <!></div>');function Re(V,W){ce(W,!0);let _=b(me([])),y=b(!0),w=b(14),k=b(null);pe(()=>R());async function R(){c(y,!0);try{const s=await fe.timeline(e(w),500);c(_,s.timeline,!0)}catch{c(_,[],!0)}finally{c(y,!1)}}var T=Ne(),j=a(T),u=i(a(j),2),A=a(u);A.value=A.__value=7;var N=i(A);N.value=N.__value=14;var O=i(N);O.value=O.__value=30;var Y=i(O);Y.value=Y.__value=90,t(u),t(j);var X=i(j,2);{var Z=s=>{var d=ge();h(d,20,()=>Array(7),P,(x,f)=>{var r=be();l(x,r)}),t(d),l(s,d)},ee=s=>{var d=he();l(s,d)},te=s=>{var d=Ae(),x=i(a(d),2);h(x,21,()=>e(_),f=>f.date,(f,r)=>{var S=je(),B=i(a(S),2),D=a(B),E=a(D),$=a(E),ae=a($,!0);t($);var q=i($,2),se=a(q);t(q),t(E);var z=i(E,2),G=a(z);h(G,17,()=>e(r).memories.slice(0,10),P,(n,o)=>{var p=ye();g(()=>Q(p,`background: ${(U[e(o).nodeType]||"#8B95A5")??""}; opacity: ${.3+e(o).retentionStrength*.7}`)),l(n,p)});var ie=i(G,2);{var re=n=>{var o=we(),p=a(o);t(o),g(()=>m(p,`+${e(r).memories.length-10}`)),l(n,o)};M(ie,n=>{e(r).memories.length>10&&n(re)})}t(z),t(D);var oe=i(D,2);{var le=n=>{var o=Te();h(o,21,()=>e(r).memories,P,(p,C)=>{var F=ke(),H=a(F),L=i(H,2),I=a(L),ve=a(I,!0);t(I),t(L);var J=i(L,2),de=a(J);t(J),t(F),g(ne=>{Q(H,`background: ${(U[e(C).nodeType]||"#8B95A5")??""}`),m(ve,e(C).content),m(de,`${ne??""}%`)},[()=>(e(C).retentionStrength*100).toFixed(0)]),l(p,F)}),t(o),l(n,o)};M(oe,n=>{e(k)===e(r).date&&n(le)})}t(B),t(S),g(()=>{m(ae,e(r).date),m(se,`${e(r).count??""} memories`)}),K("click",B,()=>c(k,e(k)===e(r).date?null:e(r).date,!0)),l(f,S)}),t(x),t(d),l(s,d)};M(X,s=>{e(y)?s(Z):e(_).length===0?s(ee,1):s(te,!1)})}t(T),K("change",u,R),xe(u,()=>e(w),s=>c(w,s)),l(V,T),_e()}ue(["change","click"]);export{Re as component};
import"../chunks/Bzak7iHL.js";import{o as pe}from"../chunks/DeTA_5mp.js";import{p as ce,s as b,c as me,g as e,a as _e,d as i,e as a,h as c,r as t,t as g}from"../chunks/nyjtQ1Ok.js";import{d as ue,a as K,s as m}from"../chunks/C4L78yoI.js";import{i as M}from"../chunks/B17metm1.js";import{e as h,i as P}from"../chunks/BilMa3tw.js";import{a as l,f as v}from"../chunks/B0IenmM-.js";import{s as Q}from"../chunks/D2QmVWrb.js";import{b as xe}from"../chunks/J2LZW-kP.js";import{a as fe}from"../chunks/BcuCGYSa.js";import{N as U}from"../chunks/BNytumrp.js";var be=v('<div class="h-16 glass-subtle rounded-xl animate-pulse"></div>'),ge=v('<div class="space-y-4"></div>'),he=v('<div class="text-center py-20 text-dim"><p>No memories in the selected time range.</p></div>'),ye=v('<div class="w-2 h-2 rounded-full"></div>'),we=v('<span class="text-xs text-muted"> </span>'),ke=v('<div class="flex items-start gap-2 text-sm"><div class="w-2 h-2 mt-1.5 rounded-full flex-shrink-0"></div> <div class="flex-1 min-w-0"><span class="text-dim line-clamp-1"> </span></div> <span class="text-xs text-muted flex-shrink-0"> </span></div>'),Te=v('<div class="mt-3 pt-3 border-t border-synapse/10 space-y-2"></div>'),je=v('<div class="relative pl-14"><div class="absolute left-4 top-3 w-5 h-5 rounded-full border-2 border-synapse bg-void flex items-center justify-center"><div class="w-2 h-2 rounded-full bg-synapse"></div></div> <button class="w-full text-left p-4 glass-subtle rounded-xl hover:bg-white/[0.03] transition-all"><div class="flex items-center justify-between"><div><span class="text-sm text-bright font-medium"> </span> <span class="text-xs text-dim ml-2"> </span></div> <div class="flex gap-1"><!> <!></div></div> <!></button></div>'),Ae=v('<div class="relative"><div class="absolute left-6 top-0 bottom-0 w-px bg-synapse/15"></div> <div class="space-y-4"></div></div>'),Ne=v('<div class="p-6 max-w-4xl mx-auto space-y-6"><div class="flex items-center justify-between"><h1 class="text-xl text-bright font-semibold">Timeline</h1> <select class="px-3 py-2 bg-white/[0.03] border border-synapse/10 rounded-xl text-dim text-sm focus:outline-none backdrop-blur-sm"><option>7 days</option><option>14 days</option><option>30 days</option><option>90 days</option></select></div> <!></div>');function Re(V,W){ce(W,!0);let _=b(me([])),y=b(!0),w=b(14),k=b(null);pe(()=>R());async function R(){c(y,!0);try{const s=await fe.timeline(e(w),500);c(_,s.timeline,!0)}catch{c(_,[],!0)}finally{c(y,!1)}}var T=Ne(),j=a(T),u=i(a(j),2),A=a(u);A.value=A.__value=7;var N=i(A);N.value=N.__value=14;var O=i(N);O.value=O.__value=30;var Y=i(O);Y.value=Y.__value=90,t(u),t(j);var X=i(j,2);{var Z=s=>{var d=ge();h(d,20,()=>Array(7),P,(x,f)=>{var r=be();l(x,r)}),t(d),l(s,d)},ee=s=>{var d=he();l(s,d)},te=s=>{var d=Ae(),x=i(a(d),2);h(x,21,()=>e(_),f=>f.date,(f,r)=>{var S=je(),B=i(a(S),2),D=a(B),E=a(D),$=a(E),ae=a($,!0);t($);var q=i($,2),se=a(q);t(q),t(E);var z=i(E,2),G=a(z);h(G,17,()=>e(r).memories.slice(0,10),P,(n,o)=>{var p=ye();g(()=>Q(p,`background: ${(U[e(o).nodeType]||"#8B95A5")??""}; opacity: ${.3+e(o).retentionStrength*.7}`)),l(n,p)});var ie=i(G,2);{var re=n=>{var o=we(),p=a(o);t(o),g(()=>m(p,`+${e(r).memories.length-10}`)),l(n,o)};M(ie,n=>{e(r).memories.length>10&&n(re)})}t(z),t(D);var oe=i(D,2);{var le=n=>{var o=Te();h(o,21,()=>e(r).memories,P,(p,C)=>{var F=ke(),H=a(F),L=i(H,2),I=a(L),ve=a(I,!0);t(I),t(L);var J=i(L,2),de=a(J);t(J),t(F),g(ne=>{Q(H,`background: ${(U[e(C).nodeType]||"#8B95A5")??""}`),m(ve,e(C).content),m(de,`${ne??""}%`)},[()=>(e(C).retentionStrength*100).toFixed(0)]),l(p,F)}),t(o),l(n,o)};M(oe,n=>{e(k)===e(r).date&&n(le)})}t(B),t(S),g(()=>{m(ae,e(r).date),m(se,`${e(r).count??""} memories`)}),K("click",B,()=>c(k,e(k)===e(r).date?null:e(r).date,!0)),l(f,S)}),t(x),t(d),l(s,d)};M(X,s=>{e(y)?s(Z):e(_).length===0?s(ee,1):s(te,!1)})}t(T),K("change",u,R),xe(u,()=>e(w),s=>c(w,s)),l(V,T),_e()}ue(["change","click"]);export{Re as component};

View file

@ -1 +0,0 @@
import"../chunks/Bzak7iHL.js";import{f as m}from"../chunks/BBD-8XME.js";import{c as n,a as p}from"../chunks/CKcqngaU.js";import{s as i}from"../chunks/DZuEJlJ5.js";function d(r,t){var o=n(),a=m(o);i(a,()=>t.children),p(r,o)}export{d as component};

View file

@ -0,0 +1 @@
import"../chunks/Bzak7iHL.js";import{f as m}from"../chunks/nyjtQ1Ok.js";import{c as n,a as p}from"../chunks/B0IenmM-.js";import{s as i}from"../chunks/Ckx7gB9J.js";function d(r,t){var o=n(),a=m(o);i(a,()=>t.children),p(r,o)}export{d as component};

View file

@ -0,0 +1 @@
import"../chunks/Bzak7iHL.js";import"../chunks/D_N1HvA5.js";import{o as p}from"../chunks/DeTA_5mp.js";import{p as r,a as t}from"../chunks/nyjtQ1Ok.js";import{i as a}from"../chunks/Ck7jSX2P.js";import{g as m}from"../chunks/DwA4GIGc.js";function u(i,o){r(o,!1),p(()=>m("/graph",{replaceState:!0})),a(),t()}export{u as component};

View file

@ -1 +0,0 @@
import"../chunks/Bzak7iHL.js";import{i as p}from"../chunks/D1BK9eoQ.js";import{o as r}from"../chunks/DUC-ssvh.js";import{p as t,a}from"../chunks/BBD-8XME.js";import{g as m}from"../chunks/cIQD_rb4.js";function g(i,o){t(o,!1),r(()=>m("/graph",{replaceState:!0})),p(),a()}export{g as component};

View file

@ -1,4 +1,4 @@
import"../chunks/Bzak7iHL.js";import{p as ze,s as I,c as Ae,g as e,a as Pe,d as a,e as r,h as b,r as t,i as Qe,t as y,f as ge,u as se,j as qe}from"../chunks/BBD-8XME.js";import{d as Be,a as q,s as o}from"../chunks/DNn3Nckx.js";import{a as c,f as m,c as De}from"../chunks/CKcqngaU.js";import{i as k}from"../chunks/RaRNNC-y.js";import{e as ie,i as ne}from"../chunks/C5a--lgk.js";import{r as ye}from"../chunks/BVZqxpRe.js";import{s as oe}from"../chunks/CBWLjDtu.js";import{s as Ke}from"../chunks/DBfx-YTU.js";import{b as de}from"../chunks/BxfT1SOA.js";import{a as X}from"../chunks/BcuCGYSa.js";var Re=m('<button><span class="text-xl"> </span> <span class="font-medium"> </span> <span class="text-[10px] text-muted text-center"> </span></button>'),Ue=m('<div class="p-3 glass rounded-xl !border-synapse/20"><div class="text-[10px] text-synapse-glow mb-1 uppercase tracking-wider">Source</div> <p class="text-sm text-text"> </p> <div class="flex gap-2 mt-1.5 text-[10px] text-muted"><span> </span> <span> </span></div></div>'),Ve=m('<div class="p-3 glass rounded-xl !border-dream/20"><div class="text-[10px] text-dream-glow mb-1 uppercase tracking-wider">Target</div> <p class="text-sm text-text"> </p> <div class="flex gap-2 mt-1.5 text-[10px] text-muted"><span> </span> <span> </span></div></div>'),Ge=m(`<div class="space-y-3"><span class="text-xs text-dim font-medium">Target Memory <span class="text-muted"> </span></span> <div class="flex gap-2"><input type="text" placeholder="Search for the target memory..." class="flex-1 px-4 py-2.5 bg-white/[0.03] border border-synapse/10 rounded-xl text-text text-sm
import"../chunks/Bzak7iHL.js";import{p as ze,s as I,c as Ae,g as e,a as Pe,d as a,e as r,h as b,r as t,i as Qe,t as y,f as ge,u as se,j as qe}from"../chunks/nyjtQ1Ok.js";import{d as Be,a as q,s as o}from"../chunks/C4L78yoI.js";import{a as c,f as m,c as De}from"../chunks/B0IenmM-.js";import{i as k}from"../chunks/B17metm1.js";import{e as ie,i as ne}from"../chunks/BilMa3tw.js";import{r as ye}from"../chunks/BBOOwRwQ.js";import{s as oe}from"../chunks/BgOFZ9jq.js";import{s as Ke}from"../chunks/D2QmVWrb.js";import{b as de}from"../chunks/BOVu8he9.js";import{a as X}from"../chunks/BcuCGYSa.js";var Re=m('<button><span class="text-xl"> </span> <span class="font-medium"> </span> <span class="text-[10px] text-muted text-center"> </span></button>'),Ue=m('<div class="p-3 glass rounded-xl !border-synapse/20"><div class="text-[10px] text-synapse-glow mb-1 uppercase tracking-wider">Source</div> <p class="text-sm text-text"> </p> <div class="flex gap-2 mt-1.5 text-[10px] text-muted"><span> </span> <span> </span></div></div>'),Ve=m('<div class="p-3 glass rounded-xl !border-dream/20"><div class="text-[10px] text-dream-glow mb-1 uppercase tracking-wider">Target</div> <p class="text-sm text-text"> </p> <div class="flex gap-2 mt-1.5 text-[10px] text-muted"><span> </span> <span> </span></div></div>'),Ge=m(`<div class="space-y-3"><span class="text-xs text-dim font-medium">Target Memory <span class="text-muted"> </span></span> <div class="flex gap-2"><input type="text" placeholder="Search for the target memory..." class="flex-1 px-4 py-2.5 bg-white/[0.03] border border-synapse/10 rounded-xl text-text text-sm
placeholder:text-muted focus:outline-none focus:border-dream/40 transition backdrop-blur-sm"/> <button class="px-4 py-2.5 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-xl hover:bg-dream/30 transition">Find</button></div></div> <!>`,1),He=m('<div class="text-center py-8 text-dim"><div class="text-lg animate-pulse mb-2">◎</div> <p> </p></div>'),Je=m('<span class="px-1.5 py-0.5 bg-white/[0.04] rounded"> </span>'),Le=m("<span> </span>"),We=m("<span> </span>"),Xe=m("<span> </span>"),Ye=m('<span class="text-synapse-glow"> </span>'),Ze=m('<div class="p-3 glass-subtle rounded-xl flex items-start gap-3 hover:bg-white/[0.03] transition"><div class="w-6 h-6 rounded-full bg-synapse/15 text-synapse-glow text-xs flex items-center justify-center flex-shrink-0 mt-0.5"></div> <div class="flex-1 min-w-0"><p class="text-sm text-text line-clamp-2"> </p> <div class="flex flex-wrap gap-3 mt-1.5 text-xs text-muted"><!> <!> <!> <!> <!></div></div></div>'),et=m('<div class="space-y-4"><div class="flex items-center justify-between"><h2 class="text-sm text-bright font-semibold"> </h2></div> <div class="space-y-2"></div></div>'),tt=m('<div class="text-center py-8 text-dim"><div class="text-3xl mb-3 opacity-20"></div> <p>No connections found for this query.</p></div>'),rt=m('<div><div class="text-xs text-dim mb-1.5 capitalize"> </div> <div class="h-2 bg-deep rounded-full overflow-hidden"><div></div></div> <div class="text-xs text-muted mt-1"> </div></div>'),at=m('<div class="grid grid-cols-4 gap-3"></div>'),st=m('<div class="mt-4 p-4 glass rounded-xl"><div class="flex items-center gap-3 mb-4"><span class="text-3xl text-bright font-bold"> </span> <span> </span></div> <!></div>'),it=m(`<div class="p-6 max-w-5xl mx-auto space-y-8"><h1 class="text-xl text-bright font-semibold">Explore Connections</h1> <div class="grid grid-cols-3 gap-2"></div> <div class="space-y-3"><span class="text-xs text-dim font-medium">Source Memory</span> <div class="flex gap-2"><input type="text" placeholder="Search for a memory to explore from..." class="flex-1 px-4 py-2.5 bg-white/[0.03] border border-synapse/10 rounded-xl text-text text-sm
placeholder:text-muted focus:outline-none focus:border-synapse/40 transition backdrop-blur-sm"/> <button class="px-4 py-2.5 bg-synapse/20 border border-synapse/40 text-synapse-glow text-sm rounded-xl hover:bg-synapse/30 transition">Find</button></div></div> <!> <!> <!> <div class="pt-8 border-t border-synapse/10"><h2 class="text-lg text-bright font-semibold mb-4">Importance Scorer</h2> <p class="text-xs text-muted mb-3">4-channel neuroscience scoring: novelty, arousal, reward, attention</p> <textarea placeholder="Paste any text to score its importance..." class="w-full h-24 px-4 py-3 bg-white/[0.03] border border-synapse/10 rounded-xl text-text text-sm
placeholder:text-muted resize-none focus:outline-none focus:border-synapse/40 transition backdrop-blur-sm"></textarea> <button class="mt-2 px-4 py-2 bg-dream/20 border border-dream/40 text-dream-glow text-sm rounded-xl hover:bg-dream/30 transition">Score</button> <!></div></div>`);function ft(he,we){ze(we,!0);let V=I(""),G=I(""),F=I(null),C=I(null),B=I(Ae([])),$=I("associations"),O=I(!1),H=I(""),D=I(null);const le={associations:{icon:"",desc:"Spreading activation find related memories via graph traversal"},chains:{icon:"",desc:"Build reasoning path from source to target memory"},bridges:{icon:"",desc:"Find connecting memories between two concepts"}};async function ve(){if(e(V).trim()){b(O,!0);try{const s=await X.search(e(V),1);s.results.length>0&&(b(F,s.results[0],!0),await Y())}catch{}finally{b(O,!1)}}}async function pe(){if(e(G).trim()){b(O,!0);try{const s=await X.search(e(G),1);s.results.length>0&&(b(C,s.results[0],!0),e(F)&&await Y())}catch{}finally{b(O,!1)}}}async function Y(){if(e(F)){b(O,!0);try{const s=(e($)==="chains"||e($)==="bridges")&&e(C)?e(C).id:void 0,i=await X.explore(e(F).id,e($),s);b(B,i.results||i.nodes||i.chain||i.bridges||[],!0)}catch{b(B,[],!0)}finally{b(O,!1)}}}async function ke(){e(H).trim()&&b(D,await X.importance(e(H)),!0)}function Se(s){b($,s,!0),e(F)&&Y()}var Z=it(),ee=a(r(Z),2);ie(ee,20,()=>["associations","chains","bridges"],ne,(s,i)=>{var d=Re(),_=r(d),h=r(_,!0);t(_);var f=a(_,2),p=r(f,!0);t(f);var n=a(f,2),g=r(n,!0);t(n),t(d),y(w=>{oe(d,1,`flex flex-col items-center gap-1 p-3 rounded-xl text-sm transition

View file

@ -1,8 +1,8 @@
import"../chunks/Bzak7iHL.js";import{i as oe}from"../chunks/D1BK9eoQ.js";import{p as ee,ah as ie,g as e,h as M,e as o,d,r as s,f as ne,t as $,a as te,s as K,u as X,C as Z}from"../chunks/BBD-8XME.js";import{s as x,d as de,a as ce}from"../chunks/DNn3Nckx.js";import{a as l,f as m}from"../chunks/CKcqngaU.js";import{i as w}from"../chunks/RaRNNC-y.js";import{e as re,i as ae}from"../chunks/C5a--lgk.js";import{s as C}from"../chunks/DBfx-YTU.js";import{s as le,a as me}from"../chunks/BexJutgU.js";import{w as ve,e as ue}from"../chunks/CruZBLYW.js";import{E as O}from"../chunks/CZ45jJaw.js";import{s as pe}from"../chunks/BVZqxpRe.js";import{s as fe}from"../chunks/CBWLjDtu.js";import{p as Q}from"../chunks/CzkEqL6J.js";var xe=m('<span class="text-[10px] text-recall"> </span>'),_e=m('<div class="h-px flex-shrink-0 w-2 mt-[-12px] transition-all duration-300"></div>'),ge=m('<div class="flex flex-col items-center gap-1 flex-1 min-w-0"><div> </div> <span class="text-[8px] truncate w-full text-center transition-colors duration-300"> </span></div> <!>',1),he=m('<div class="h-full rounded-full transition-all ease-out"></div>'),ye=m('<div class="flex items-center gap-2 pt-1 animate-fade-in svelte-1n9p0vm"><div class="w-1.5 h-1.5 rounded-full bg-recall animate-pulse-glow"></div> <span class="text-[10px] text-dim"> </span></div>'),$e=m('<div class="glass-subtle rounded-xl p-4 space-y-3"><div class="flex items-center justify-between"><span class="text-[10px] text-synapse-glow uppercase tracking-wider font-medium">Cognitive Search Pipeline</span> <!></div> <div class="flex items-center gap-0.5"></div> <div class="h-1 bg-white/[0.03] rounded-full overflow-hidden"><!></div> <!></div>');function be(q,F){ee(F,!0);let S=Q(F,"resultCount",3,0),j=Q(F,"durationMs",3,0),I=Q(F,"active",3,!1);const p=[{name:"Overfetch",icon:"◎",color:"#818CF8",desc:"Pull 3x results from hybrid search"},{name:"Rerank",icon:"⟿",color:"#00A8FF",desc:"Re-score by relevance quality"},{name:"Temporal",icon:"◷",color:"#00D4FF",desc:"Recent memories get recency bonus"},{name:"Access",icon:"◇",color:"#00FFD1",desc:"FSRS-6 retention threshold filter"},{name:"Context",icon:"◬",color:"#FFB800",desc:"Encoding specificity matching"},{name:"Compete",icon:"⬡",color:"#FF3CAC",desc:"Retrieval-induced forgetting"},{name:"Activate",icon:"◈",color:"#9D00FF",desc:"Spreading activation cascade"}];let _=K(-1),g=K(!1),u=K(!1);ie(()=>{I()&&!e(g)&&P()});function P(){M(g,!0),M(_,-1),M(u,!1);const t=Math.max(1500,(j()||50)*2),a=t/(p.length+1);p.forEach((i,v)=>{setTimeout(()=>{M(_,v,!0)},a*(v+1))}),setTimeout(()=>{M(u,!0),M(g,!1)},t)}var D=$e(),b=o(D),L=d(o(b),2);{var V=t=>{var a=xe(),i=o(a);s(a),$(()=>x(i,`${S()??""} results in ${j()??""}ms`)),l(t,a)};w(L,t=>{e(u)&&t(V)})}s(b);var A=d(b,2);re(A,21,()=>p,ae,(t,a,i)=>{const v=X(()=>i<=e(_)),E=X(()=>i===e(_)&&e(g));var k=ge(),h=ne(k),y=o(h),J=o(y,!0);s(y);var R=d(y,2),T=o(R,!0);s(R),s(h);var U=d(h,2);{var W=B=>{var c=_e();$(()=>C(c,`background: ${i<e(_)?p[i+1].color+"60":"rgba(255,255,255,0.06)"}`)),l(B,c)};w(U,B=>{i<p.length-1&&B(W)})}$(()=>{fe(y,1,`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-all duration-300
import"../chunks/Bzak7iHL.js";import"../chunks/D_N1HvA5.js";import{p as ee,m as oe,g as e,h as M,e as o,d,r as s,f as ie,t as $,a as te,s as K,u as X,L as Z}from"../chunks/nyjtQ1Ok.js";import{s as x,d as ne,a as de}from"../chunks/C4L78yoI.js";import{a as l,f as m}from"../chunks/B0IenmM-.js";import{i as w}from"../chunks/B17metm1.js";import{e as re,i as ae}from"../chunks/BilMa3tw.js";import{s as C}from"../chunks/D2QmVWrb.js";import{i as ce}from"../chunks/Ck7jSX2P.js";import{s as le,a as me}from"../chunks/C3ZC25l2.js";import{w as ve,e as ue}from"../chunks/B6fk3AxI.js";import{E as L}from"../chunks/BNytumrp.js";import{s as pe}from"../chunks/BBOOwRwQ.js";import{s as fe}from"../chunks/BgOFZ9jq.js";import{p as Q}from"../chunks/BPtVz5jm.js";var xe=m('<span class="text-[10px] text-recall"> </span>'),_e=m('<div class="h-px flex-shrink-0 w-2 mt-[-12px] transition-all duration-300"></div>'),ge=m('<div class="flex flex-col items-center gap-1 flex-1 min-w-0"><div> </div> <span class="text-[8px] truncate w-full text-center transition-colors duration-300"> </span></div> <!>',1),he=m('<div class="h-full rounded-full transition-all ease-out"></div>'),ye=m('<div class="flex items-center gap-2 pt-1 animate-fade-in svelte-1n9p0vm"><div class="w-1.5 h-1.5 rounded-full bg-recall animate-pulse-glow"></div> <span class="text-[10px] text-dim"> </span></div>'),$e=m('<div class="glass-subtle rounded-xl p-4 space-y-3"><div class="flex items-center justify-between"><span class="text-[10px] text-synapse-glow uppercase tracking-wider font-medium">Cognitive Search Pipeline</span> <!></div> <div class="flex items-center gap-0.5"></div> <div class="h-1 bg-white/[0.03] rounded-full overflow-hidden"><!></div> <!></div>');function be(O,F){ee(F,!0);let S=Q(F,"resultCount",3,0),j=Q(F,"durationMs",3,0),q=Q(F,"active",3,!1);const p=[{name:"Overfetch",icon:"◎",color:"#818CF8",desc:"Pull 3x results from hybrid search"},{name:"Rerank",icon:"⟿",color:"#00A8FF",desc:"Re-score by relevance quality"},{name:"Temporal",icon:"◷",color:"#00D4FF",desc:"Recent memories get recency bonus"},{name:"Access",icon:"◇",color:"#00FFD1",desc:"FSRS-6 retention threshold filter"},{name:"Context",icon:"◬",color:"#FFB800",desc:"Encoding specificity matching"},{name:"Compete",icon:"⬡",color:"#FF3CAC",desc:"Retrieval-induced forgetting"},{name:"Activate",icon:"◈",color:"#9D00FF",desc:"Spreading activation cascade"}];let _=K(-1),g=K(!1),u=K(!1);oe(()=>{q()&&!e(g)&&P()});function P(){M(g,!0),M(_,-1),M(u,!1);const t=Math.max(1500,(j()||50)*2),a=t/(p.length+1);p.forEach((i,v)=>{setTimeout(()=>{M(_,v,!0)},a*(v+1))}),setTimeout(()=>{M(u,!0),M(g,!1)},t)}var D=$e(),b=o(D),I=d(o(b),2);{var V=t=>{var a=xe(),i=o(a);s(a),$(()=>x(i,`${S()??""} results in ${j()??""}ms`)),l(t,a)};w(I,t=>{e(u)&&t(V)})}s(b);var A=d(b,2);re(A,21,()=>p,ae,(t,a,i)=>{const v=X(()=>i<=e(_)),E=X(()=>i===e(_)&&e(g));var k=ge(),h=ie(k),y=o(h),J=o(y,!0);s(y);var R=d(y,2),T=o(R,!0);s(R),s(h);var U=d(h,2);{var W=B=>{var c=_e();$(()=>C(c,`background: ${i<e(_)?p[i+1].color+"60":"rgba(255,255,255,0.06)"}`)),l(B,c)};w(U,B=>{i<p.length-1&&B(W)})}$(()=>{fe(y,1,`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-all duration-300
${e(E)?"scale-125":""}`),C(y,`background: ${e(v)?e(a).color+"25":"rgba(255,255,255,0.03)"};
border: 1.5px solid ${(e(v)?e(a).color:"rgba(255,255,255,0.06)")??""};
color: ${(e(v)?e(a).color:"#4a4a7a")??""};
box-shadow: ${e(E)?"0 0 12px "+e(a).color+"40":"none"}`),pe(y,"title",e(a).desc),x(J,e(a).icon),C(R,`color: ${(e(v)?e(a).color:"#4a4a7a")??""}`),x(T,e(a).name)}),l(t,k)}),s(A);var N=d(A,2),z=o(N);{var n=t=>{var a=he();$(i=>C(a,`width: ${i??""}%;
background: linear-gradient(90deg, #818CF8, #00FFD1, #9D00FF);
transition-duration: ${e(g)?"300ms":"500ms"}`),[()=>e(u)?"100":((e(_)+1)/p.length*100).toFixed(0)]),l(t,a)};w(z,t=>{(e(g)||e(u))&&t(n)})}s(N);var r=d(N,2);{var H=t=>{var a=ye(),i=d(o(a),2),v=o(i);s(i),s(a),$(()=>x(v,`Pipeline complete: ${S()??""} memories surfaced from ${p.length??""}-stage cognitive cascade`)),l(t,a)};w(r,t=>{e(u)&&t(H)})}s(D),l(q,D),te()}var we=m('<div class="text-center py-20 text-dim"><div class="text-4xl mb-4">◉</div> <p>Waiting for cognitive events...</p> <p class="text-sm text-muted mt-2">Events appear here in real-time as Vestige thinks.</p></div>'),Ce=m('<span class="text-xs text-muted"> </span>'),Fe=m('<div class="mt-2"><!></div>'),Se=m(`<div class="flex items-start gap-3 p-3 glass-subtle rounded-xl
hover:bg-white/[0.03] transition-all duration-200"><div class="w-6 h-6 rounded flex items-center justify-center text-xs flex-shrink-0"> </div> <div class="flex-1 min-w-0"><div class="flex items-center gap-2 mb-0.5"><span class="text-xs font-medium"> </span> <!></div> <p class="text-sm text-dim"> </p> <!></div></div>`),De=m('<div class="space-y-2"></div>'),ke=m('<div class="p-6 max-w-4xl mx-auto space-y-6"><div class="flex items-center justify-between"><h1 class="text-xl text-bright font-semibold">Live Feed</h1> <div class="flex gap-3"><span class="text-dim text-sm"> </span> <button class="text-xs text-muted hover:text-text transition">Clear</button></div></div> <!></div>');function ze(q,F){ee(F,!1);const S=()=>me(ue,"$eventFeed",j),[j,I]=le();function p(n){return new Date(n).toLocaleTimeString()}function _(n){return{MemoryCreated:"+",MemoryUpdated:"~",MemoryDeleted:"×",MemoryPromoted:"",MemoryDemoted:"",SearchPerformed:"",DreamStarted:"",DreamProgress:"",DreamCompleted:"",ConsolidationStarted:"",ConsolidationCompleted:"",RetentionDecayed:"",ConnectionDiscovered:"",ActivationSpread:"",ImportanceScored:"",Heartbeat:""}[n]||"·"}function g(n){const r=n.data;switch(n.type){case"MemoryCreated":return`New ${r.node_type}: "${String(r.content_preview).slice(0,60)}..."`;case"SearchPerformed":return`Searched "${r.query}" → ${r.result_count} results (${r.duration_ms}ms)`;case"DreamStarted":return`Dream started with ${r.memory_count} memories`;case"DreamCompleted":return`Dream complete: ${r.connections_found} connections, ${r.insights_generated} insights (${r.duration_ms}ms)`;case"ConsolidationStarted":return"Consolidation cycle started";case"ConsolidationCompleted":return`Consolidated ${r.nodes_processed} nodes, ${r.decay_applied} decayed (${r.duration_ms}ms)`;case"ConnectionDiscovered":return`Connection: ${String(r.connection_type)} (weight: ${Number(r.weight).toFixed(2)})`;case"ImportanceScored":return`Scored ${Number(r.composite_score).toFixed(2)}: "${String(r.content_preview).slice(0,50)}..."`;case"MemoryPromoted":return`Promoted → ${(Number(r.new_retention)*100).toFixed(0)}% retention`;case"MemoryDemoted":return`Demoted → ${(Number(r.new_retention)*100).toFixed(0)}% retention`;default:return JSON.stringify(r).slice(0,100)}}oe();var u=ke(),P=o(u),D=d(o(P),2),b=o(D),L=o(b);s(b);var V=d(b,2);s(D),s(P);var A=d(P,2);{var N=n=>{var r=we();l(n,r)},z=n=>{var r=De();re(r,5,S,ae,(H,t)=>{var a=Se(),i=o(a),v=o(i,!0);s(i);var E=d(i,2),k=o(E),h=o(k),y=o(h,!0);s(h);var J=d(h,2);{var R=c=>{var f=Ce(),Y=o(f,!0);s(f),$(G=>x(Y,G),[()=>p(String(e(t).data.timestamp))]),l(c,f)};w(J,c=>{e(t).data.timestamp&&c(R)})}s(k);var T=d(k,2),U=o(T,!0);s(T);var W=d(T,2);{var B=c=>{var f=Fe(),Y=o(f);{let G=Z(()=>Number(e(t).data.result_count)||0),se=Z(()=>Number(e(t).data.duration_ms)||0);be(Y,{get resultCount(){return e(G)},get durationMs(){return e(se)},active:!0})}s(f),l(c,f)};w(W,c=>{e(t).type==="SearchPerformed"&&c(B)})}s(E),s(a),$((c,f)=>{C(a,`border-left: 3px solid ${(O[e(t).type]||"#8B95A5")??""}`),C(i,`background: ${(O[e(t).type]||"#8B95A5")??""}15; color: ${(O[e(t).type]||"#8B95A5")??""}`),x(v,c),C(h,`color: ${(O[e(t).type]||"#8B95A5")??""}`),x(y,e(t).type),x(U,f)},[()=>_(e(t).type),()=>g(e(t))]),l(H,a)}),s(r),l(n,r)};w(A,n=>{S().length===0?n(N):n(z,!1)})}s(u),$(()=>x(L,`${S().length??""} events`)),ce("click",V,()=>ve.clearEvents()),l(q,u),te(),I()}de(["click"]);export{ze as component};
transition-duration: ${e(g)?"300ms":"500ms"}`),[()=>e(u)?"100":((e(_)+1)/p.length*100).toFixed(0)]),l(t,a)};w(z,t=>{(e(g)||e(u))&&t(n)})}s(N);var r=d(N,2);{var H=t=>{var a=ye(),i=d(o(a),2),v=o(i);s(i),s(a),$(()=>x(v,`Pipeline complete: ${S()??""} memories surfaced from ${p.length??""}-stage cognitive cascade`)),l(t,a)};w(r,t=>{e(u)&&t(H)})}s(D),l(O,D),te()}var we=m('<div class="text-center py-20 text-dim"><div class="text-4xl mb-4">◉</div> <p>Waiting for cognitive events...</p> <p class="text-sm text-muted mt-2">Events appear here in real-time as Vestige thinks.</p></div>'),Ce=m('<span class="text-xs text-muted"> </span>'),Fe=m('<div class="mt-2"><!></div>'),Se=m(`<div class="flex items-start gap-3 p-3 glass-subtle rounded-xl
hover:bg-white/[0.03] transition-all duration-200"><div class="w-6 h-6 rounded flex items-center justify-center text-xs flex-shrink-0"> </div> <div class="flex-1 min-w-0"><div class="flex items-center gap-2 mb-0.5"><span class="text-xs font-medium"> </span> <!></div> <p class="text-sm text-dim"> </p> <!></div></div>`),De=m('<div class="space-y-2"></div>'),ke=m('<div class="p-6 max-w-4xl mx-auto space-y-6"><div class="flex items-center justify-between"><h1 class="text-xl text-bright font-semibold">Live Feed</h1> <div class="flex gap-3"><span class="text-dim text-sm"> </span> <button class="text-xs text-muted hover:text-text transition">Clear</button></div></div> <!></div>');function He(O,F){ee(F,!1);const S=()=>me(ue,"$eventFeed",j),[j,q]=le();function p(n){return new Date(n).toLocaleTimeString()}function _(n){return{MemoryCreated:"+",MemoryUpdated:"~",MemoryDeleted:"×",MemoryPromoted:"",MemoryDemoted:"",SearchPerformed:"",DreamStarted:"",DreamProgress:"",DreamCompleted:"",ConsolidationStarted:"",ConsolidationCompleted:"",RetentionDecayed:"",ConnectionDiscovered:"",ActivationSpread:"",ImportanceScored:"",Heartbeat:""}[n]||"·"}function g(n){const r=n.data;switch(n.type){case"MemoryCreated":return`New ${r.node_type}: "${String(r.content_preview).slice(0,60)}..."`;case"SearchPerformed":return`Searched "${r.query}" → ${r.result_count} results (${r.duration_ms}ms)`;case"DreamStarted":return`Dream started with ${r.memory_count} memories`;case"DreamCompleted":return`Dream complete: ${r.connections_found} connections, ${r.insights_generated} insights (${r.duration_ms}ms)`;case"ConsolidationStarted":return"Consolidation cycle started";case"ConsolidationCompleted":return`Consolidated ${r.nodes_processed} nodes, ${r.decay_applied} decayed (${r.duration_ms}ms)`;case"ConnectionDiscovered":return`Connection: ${String(r.connection_type)} (weight: ${Number(r.weight).toFixed(2)})`;case"ImportanceScored":return`Scored ${Number(r.composite_score).toFixed(2)}: "${String(r.content_preview).slice(0,50)}..."`;case"MemoryPromoted":return`Promoted → ${(Number(r.new_retention)*100).toFixed(0)}% retention`;case"MemoryDemoted":return`Demoted → ${(Number(r.new_retention)*100).toFixed(0)}% retention`;default:return JSON.stringify(r).slice(0,100)}}ce();var u=ke(),P=o(u),D=d(o(P),2),b=o(D),I=o(b);s(b);var V=d(b,2);s(D),s(P);var A=d(P,2);{var N=n=>{var r=we();l(n,r)},z=n=>{var r=De();re(r,5,S,ae,(H,t)=>{var a=Se(),i=o(a),v=o(i,!0);s(i);var E=d(i,2),k=o(E),h=o(k),y=o(h,!0);s(h);var J=d(h,2);{var R=c=>{var f=Ce(),Y=o(f,!0);s(f),$(G=>x(Y,G),[()=>p(String(e(t).data.timestamp))]),l(c,f)};w(J,c=>{e(t).data.timestamp&&c(R)})}s(k);var T=d(k,2),U=o(T,!0);s(T);var W=d(T,2);{var B=c=>{var f=Fe(),Y=o(f);{let G=Z(()=>Number(e(t).data.result_count)||0),se=Z(()=>Number(e(t).data.duration_ms)||0);be(Y,{get resultCount(){return e(G)},get durationMs(){return e(se)},active:!0})}s(f),l(c,f)};w(W,c=>{e(t).type==="SearchPerformed"&&c(B)})}s(E),s(a),$((c,f)=>{C(a,`border-left: 3px solid ${(L[e(t).type]||"#8B95A5")??""}`),C(i,`background: ${(L[e(t).type]||"#8B95A5")??""}15; color: ${(L[e(t).type]||"#8B95A5")??""}`),x(v,c),C(h,`color: ${(L[e(t).type]||"#8B95A5")??""}`),x(y,e(t).type),x(U,f)},[()=>_(e(t).type),()=>g(e(t))]),l(H,a)}),s(r),l(n,r)};w(A,n=>{S().length===0?n(N):n(z,!1)})}s(u),$(()=>x(I,`${S().length??""} events`)),de("click",V,()=>ve.clearEvents()),l(O,u),te(),q()}ne(["click"]);export{He as component};

View file

@ -1,4 +1,4 @@
import"../chunks/Bzak7iHL.js";import{o as qe}from"../chunks/DUC-ssvh.js";import{p as Be,s as b,c as Qe,t as E,g as e,a as Ye,d as t,e as s,h as u,r as a}from"../chunks/BBD-8XME.js";import{d as ze,a as p,s as v}from"../chunks/DNn3Nckx.js";import{i as ce}from"../chunks/RaRNNC-y.js";import{e as Z,i as ue}from"../chunks/C5a--lgk.js";import{a as _,f as g}from"../chunks/CKcqngaU.js";import{r as xe}from"../chunks/BVZqxpRe.js";import{s as Ge}from"../chunks/CBWLjDtu.js";import{s as _e}from"../chunks/DBfx-YTU.js";import{b as fe}from"../chunks/BxfT1SOA.js";import{b as He}from"../chunks/C-QujEl6.js";import{a as f}from"../chunks/BcuCGYSa.js";import{N as Ie}from"../chunks/CZ45jJaw.js";var Je=g('<div class="h-24 glass-subtle rounded-xl animate-pulse"></div>'),Ke=g('<div class="grid gap-3"></div>'),Ue=g('<span class="text-xs px-1.5 py-0.5 bg-white/[0.04] rounded text-muted"> </span>'),Ve=g('<div class="mt-4 pt-4 border-t border-synapse/10 space-y-3"><p class="text-sm text-text whitespace-pre-wrap"> </p> <div class="grid grid-cols-3 gap-3 text-xs text-dim"><div> </div> <div> </div> <div> </div></div> <div class="flex gap-2"><span role="button" tabindex="0" class="px-3 py-1.5 bg-recall/20 text-recall text-xs rounded-lg hover:bg-recall/30 cursor-pointer select-none">Promote</span> <span role="button" tabindex="0" class="px-3 py-1.5 bg-decay/20 text-decay text-xs rounded-lg hover:bg-decay/30 cursor-pointer select-none">Demote</span> <span role="button" tabindex="0" class="px-3 py-1.5 bg-decay/10 text-decay/60 text-xs rounded-lg hover:bg-decay/20 ml-auto cursor-pointer select-none">Delete</span></div></div>'),We=g('<button><div class="flex items-start justify-between gap-4"><div class="flex-1 min-w-0"><div class="flex items-center gap-2 mb-2"><span class="w-2 h-2 rounded-full"></span> <span class="text-xs text-dim"> </span> <!></div> <p class="text-sm text-text leading-relaxed line-clamp-2"> </p></div> <div class="flex flex-col items-end gap-1 flex-shrink-0"><div class="w-12 h-1.5 bg-deep rounded-full overflow-hidden"><div class="h-full rounded-full"></div></div> <span class="text-xs text-muted"> </span></div></div> <!></button>'),Xe=g('<div class="grid gap-3"></div>'),Ze=g(`<div class="p-6 max-w-6xl mx-auto space-y-6"><div class="flex items-center justify-between"><h1 class="text-xl text-bright font-semibold">Memories</h1> <span class="text-dim text-sm"> </span></div> <div class="flex gap-3 flex-wrap"><input type="text" placeholder="Search memories..." class="flex-1 min-w-64 px-4 py-2.5 bg-white/[0.03] border border-synapse/10 rounded-xl text-text text-sm
import"../chunks/Bzak7iHL.js";import{o as qe}from"../chunks/DeTA_5mp.js";import{p as Be,s as b,c as Qe,t as E,g as e,a as Ye,d as t,e as s,h as u,r as a}from"../chunks/nyjtQ1Ok.js";import{d as ze,a as p,s as v}from"../chunks/C4L78yoI.js";import{i as ce}from"../chunks/B17metm1.js";import{e as Z,i as ue}from"../chunks/BilMa3tw.js";import{a as _,f as g}from"../chunks/B0IenmM-.js";import{r as xe}from"../chunks/BBOOwRwQ.js";import{s as Ge}from"../chunks/BgOFZ9jq.js";import{s as _e}from"../chunks/D2QmVWrb.js";import{b as fe}from"../chunks/BOVu8he9.js";import{b as He}from"../chunks/J2LZW-kP.js";import{a as f}from"../chunks/BcuCGYSa.js";import{N as Ie}from"../chunks/BNytumrp.js";var Je=g('<div class="h-24 glass-subtle rounded-xl animate-pulse"></div>'),Ke=g('<div class="grid gap-3"></div>'),Ue=g('<span class="text-xs px-1.5 py-0.5 bg-white/[0.04] rounded text-muted"> </span>'),Ve=g('<div class="mt-4 pt-4 border-t border-synapse/10 space-y-3"><p class="text-sm text-text whitespace-pre-wrap"> </p> <div class="grid grid-cols-3 gap-3 text-xs text-dim"><div> </div> <div> </div> <div> </div></div> <div class="flex gap-2"><span role="button" tabindex="0" class="px-3 py-1.5 bg-recall/20 text-recall text-xs rounded-lg hover:bg-recall/30 cursor-pointer select-none">Promote</span> <span role="button" tabindex="0" class="px-3 py-1.5 bg-decay/20 text-decay text-xs rounded-lg hover:bg-decay/30 cursor-pointer select-none">Demote</span> <span role="button" tabindex="0" class="px-3 py-1.5 bg-decay/10 text-decay/60 text-xs rounded-lg hover:bg-decay/20 ml-auto cursor-pointer select-none">Delete</span></div></div>'),We=g('<button><div class="flex items-start justify-between gap-4"><div class="flex-1 min-w-0"><div class="flex items-center gap-2 mb-2"><span class="w-2 h-2 rounded-full"></span> <span class="text-xs text-dim"> </span> <!></div> <p class="text-sm text-text leading-relaxed line-clamp-2"> </p></div> <div class="flex flex-col items-end gap-1 flex-shrink-0"><div class="w-12 h-1.5 bg-deep rounded-full overflow-hidden"><div class="h-full rounded-full"></div></div> <span class="text-xs text-muted"> </span></div></div> <!></button>'),Xe=g('<div class="grid gap-3"></div>'),Ze=g(`<div class="p-6 max-w-6xl mx-auto space-y-6"><div class="flex items-center justify-between"><h1 class="text-xl text-bright font-semibold">Memories</h1> <span class="text-dim text-sm"> </span></div> <div class="flex gap-3 flex-wrap"><input type="text" placeholder="Search memories..." class="flex-1 min-w-64 px-4 py-2.5 bg-white/[0.03] border border-synapse/10 rounded-xl text-text text-sm
placeholder:text-muted focus:outline-none focus:border-synapse/40 focus:ring-1 focus:ring-synapse/20 transition backdrop-blur-sm"/> <select class="px-3 py-2.5 bg-white/[0.03] border border-synapse/10 rounded-xl text-dim text-sm focus:outline-none backdrop-blur-sm"><option>All types</option><option>Fact</option><option>Concept</option><option>Event</option><option>Person</option><option>Place</option><option>Note</option><option>Pattern</option><option>Decision</option></select> <div class="flex items-center gap-2 text-xs text-dim"><span>Min retention:</span> <input type="range" min="0" max="1" step="0.1" class="w-24 accent-synapse"/> <span> </span></div></div> <!></div>`);function xt(ge,me){Be(me,!0);let k=b(Qe([])),P=b(""),S=b(""),be="",h=b(0),F=b(!0),T=b(null),ee;qe(()=>m());async function m(){u(F,!0);try{const i={};e(P)&&(i.q=e(P)),e(S)&&(i.node_type=e(S)),e(h)>0&&(i.min_retention=String(e(h)));const c=await f.memories.list(i);u(k,c.memories,!0)}catch{u(k,[],!0)}finally{u(F,!1)}}function he(){clearTimeout(ee),ee=setTimeout(m,300)}function ye(i){return i>.7?"#10b981":i>.4?"#f59e0b":"#ef4444"}var M=Ze(),A=s(M),te=t(s(A),2),we=s(te);a(te),a(A);var C=t(A,2),$=s(C);xe($);var y=t($,2),N=s(y);N.value=N.__value="";var O=t(N);O.value=O.__value="fact";var R=t(O);R.value=R.__value="concept";var j=t(R);j.value=j.__value="event";var L=t(j);L.value=L.__value="person";var q=t(L);q.value=q.__value="place";var B=t(q);B.value=B.__value="note";var Q=t(B);Q.value=Q.__value="pattern";var ae=t(Q);ae.value=ae.__value="decision",a(y);var se=t(y,2),D=t(s(se),2);xe(D);var ie=t(D,2),ke=s(ie);a(ie),a(se),a(C);var Pe=t(C,2);{var Se=i=>{var c=Ke();Z(c,20,()=>Array(8),ue,(w,o)=>{var x=Je();_(w,x)}),a(c),_(i,c)},Te=i=>{var c=Xe();Z(c,21,()=>e(k),w=>w.id,(w,o)=>{var x=We(),Y=s(x),z=s(Y),G=s(z),oe=s(G),H=t(oe,2),$e=s(H,!0);a(H);var De=t(H,2);Z(De,17,()=>e(o).tags.slice(0,3),ue,(n,l)=>{var d=Ue(),J=s(d,!0);a(d),E(()=>v(J,e(l))),_(n,d)}),a(G);var re=t(G,2),Ee=s(re,!0);a(re),a(z);var ne=t(z,2),I=s(ne),Fe=s(I);a(I);var le=t(I,2),Me=s(le);a(le),a(ne),a(Y);var Ae=t(Y,2);{var Ce=n=>{var l=Ve(),d=s(l),J=s(d,!0);a(d);var K=t(d,2),U=s(K),Ne=s(U);a(U);var V=t(U,2),Oe=s(V);a(V);var de=t(V,2),Re=s(de);a(de),a(K);var pe=t(K,2),W=s(pe),X=t(W,2),ve=t(X,2);a(pe),a(l),E((r,je,Le)=>{v(J,e(o).content),v(Ne,`Storage: ${r??""}%`),v(Oe,`Retrieval: ${je??""}%`),v(Re,`Created: ${Le??""}`)},[()=>(e(o).storageStrength*100).toFixed(1),()=>(e(o).retrievalStrength*100).toFixed(1),()=>new Date(e(o).createdAt).toLocaleDateString()]),p("click",W,r=>{r.stopPropagation(),f.memories.promote(e(o).id)}),p("keydown",W,r=>{r.key==="Enter"&&(r.stopPropagation(),f.memories.promote(e(o).id))}),p("click",X,r=>{r.stopPropagation(),f.memories.demote(e(o).id)}),p("keydown",X,r=>{r.key==="Enter"&&(r.stopPropagation(),f.memories.demote(e(o).id))}),p("click",ve,async r=>{r.stopPropagation(),await f.memories.delete(e(o).id),m()}),p("keydown",ve,async r=>{r.key==="Enter"&&(r.stopPropagation(),await f.memories.delete(e(o).id),m())}),_(n,l)};ce(Ae,n=>{var l;((l=e(T))==null?void 0:l.id)===e(o).id&&n(Ce)})}a(x),E((n,l)=>{var d;Ge(x,1,`text-left p-4 glass-subtle rounded-xl hover:bg-white/[0.04]
transition-all duration-200 group
${((d=e(T))==null?void 0:d.id)===e(o).id?"!border-synapse/40 glow-synapse":""}`),_e(oe,`background: ${(Ie[e(o).nodeType]||"#8B95A5")??""}`),v($e,e(o).nodeType),v(Ee,e(o).content),_e(Fe,`width: ${e(o).retentionStrength*100}%; background: ${n??""}`),v(Me,`${l??""}%`)},[()=>ye(e(o).retentionStrength),()=>(e(o).retentionStrength*100).toFixed(0)]),p("click",x,()=>{var n;return u(T,((n=e(T))==null?void 0:n.id)===e(o).id?null:e(o),!0)}),_(w,x)}),a(c),_(i,c)};ce(Pe,i=>{e(F)?i(Se):i(Te,!1)})}a(M),E(i=>{v(we,`${e(k).length??""} results`),v(ke,`${i??""}%`)},[()=>(e(h)*100).toFixed(0)]),p("input",$,he),fe($,()=>e(P),i=>u(P,i)),p("change",y,m),He(y,()=>e(S),i=>u(S,i)),p("change",D,m),fe(D,()=>e(h),i=>u(h,i)),_(ge,M),Ye()}ze(["input","change","click","keydown"]);export{xt as component};