@shmulikdav/solix 1.4.2 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{r as M,g as ff,j as T,R as df,O as Un,P as Bn,S as Oo,a as So,V as pf,b as hf,B as mf,N as hu,A as mu,W as vf,C as gf,c as De,d as Me,e as yf,L as xo,f as Sf,U as Sn,T as xf,h as Ef,D as Dn,M as rr,i as ir,k as Uo,Q as Bo,l as wf,m as Mf,n as Zi,o as kn,p as Qo,q as dt,s as Qr,t as Yt,u as nt,v as Tf,w as _f,x as Rf,F as vu,y as Bt,z as Ji,E as Pf,G as qi,H as hr,I as Yo,J as gu,K as yu,X as Cf,Y as cr,Z as If,_ as jn,$ as xe,a0 as Su,a1 as zf,a2 as xu,a3 as $i,a4 as ka,a5 as ko,a6 as Af,a7 as es,a8 as Lo,a9 as pe,aa as jo,ab as Eu,ac as Ln,ad as Df,ae as Nf,af as Of,ag as Uf,ah as Bf,ai as kf,aj as Lf,ak as jf,al as wu,am as Mu,an as Ff,ao as bf}from"./index-BUrmJuUb.js";var Tu={exports:{}},Fn={};/**
1
+ import{r as M,g as ff,j as T,R as df,O as Un,P as Bn,S as Oo,a as So,V as pf,b as hf,B as mf,N as hu,A as mu,W as vf,C as gf,c as De,d as Me,e as yf,L as xo,f as Sf,U as Sn,T as xf,h as Ef,D as Dn,M as rr,i as ir,k as Uo,Q as Bo,l as wf,m as Mf,n as Zi,o as kn,p as Qo,q as dt,s as Qr,t as Yt,u as nt,v as Tf,w as _f,x as Rf,F as vu,y as Bt,z as Ji,E as Pf,G as qi,H as hr,I as Yo,J as gu,K as yu,X as Cf,Y as cr,Z as If,_ as jn,$ as xe,a0 as Su,a1 as zf,a2 as xu,a3 as $i,a4 as ka,a5 as ko,a6 as Af,a7 as es,a8 as Lo,a9 as pe,aa as jo,ab as Eu,ac as Ln,ad as Df,ae as Nf,af as Of,ag as Uf,ah as Bf,ai as kf,aj as Lf,ak as jf,al as wu,am as Mu,an as Ff,ao as bf}from"./index-2P2elsQX.js";var Tu={exports:{}},Fn={};/**
2
2
  * @license React
3
3
  * react-reconciler-constants.production.min.js
4
4
  *
@@ -289,4 +289,4 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
289
289
  float fres = pow(max(0.0, dot(vNormal, vViewDir)), uPower);
290
290
  gl_FragColor = vec4(uColor * uIntensity, fres);
291
291
  }
292
- `}),[i,l,o]);return T.jsxs("mesh",{children:[T.jsx("sphereGeometry",{args:[n*1.18,32,32]}),T.jsx("primitive",{object:c,attach:"material"})]})}function bh({session:n}){const i=M.useRef(null),l=M.useRef(null),o=M.useRef(null),c=M.useRef(null),f=M.useRef(null),d=M.useMemo(()=>is(n.orbitSlot,n.id,n.projectId),[n.orbitSlot,n.id]),h=M.useMemo(()=>Kr(n.orbitSlot),[n.orbitSlot]),v=pe(N=>Df(N,n.id)),y=pe(N=>N.selectSession),p=pe(N=>N.selectAdvisor),m=pe(N=>n.advisorRole?Object.values(N.advisors).find($=>$.id===n.advisorRole)??null:null),x=pe(N=>N.selectedSessionId)===n.id,P=n.kind==="advisor",U=pe(N=>n.currentMissionId?N.missions[n.currentMissionId]:void 0),O=pe(N=>Object.values(N.pendingPermissions).filter($=>$.sessionId===n.id).length),R=M.useMemo(()=>Nf(n,U,O),[n,U,O]),C=R.score,z=.4+C/100*.8,H=M.useMemo(()=>new dt(P&&m?m.color:jo(n.model)),[P,m,n.model]),j=M.useRef(d),k=M.useRef(1);je((N,$)=>{const se=pe.getState(),Ne=se.motionEnabled,he=!!(se.selectedSessionId||se.selectedAdvisorId||se.selectedSkillId),_e=se.selectedSessionId===n.id||P&&se.selectedAdvisorId===n.advisorRole,Ee=he&&!_e?.25:1;k.current=Ln.lerp(k.current,Ee,.08);const B=k.current,K=Lh(n.status==="active",n.orbitSlot);Ne&&(j.current+=$*K*.3);const G=j.current,q=Math.cos(G)*h,ae=Math.sin(G)*h,ie=Math.sin(G*.5)*.4;i.current&&i.current.position.set(q,ie,ae);const ze=N.clock.getElapsedTime();if(l.current){Ne&&(l.current.rotation.y+=$*.4);const we=.55+n.contextUsagePct/100*.5,Oe=l.current.scale.x,Ke=Ln.lerp(Oe,we,.04);l.current.scale.set(Ke,Ke,Ke)}if(f.current){const we=Eu(n.status),Oe=new dt(we.color);f.current.emissive.lerp(Oe,.08),f.current.emissiveIntensity=Ln.lerp(f.current.emissiveIntensity,we.intensity*B,.06),f.current.opacity=B,f.current.transparent=B<.99}if(o.current){const we=n.contextUsagePct>=90,Oe=n.contextUsagePct>=80&&!we;if(n.status==="awaiting_permission"||n.status==="awaiting_input"||we||Oe){let Ze=.8,ot="#f59e0b";n.status==="awaiting_permission"?(Ze=1.5,ot="#ef4444"):n.status==="awaiting_input"?(Ze=.8,ot="#f59e0b"):we?(Ze=1.2,ot="#dc2626"):Oe&&(Ze=.6,ot="#fb923c");const Ue=.5+.5*Math.sin(ze*Math.PI*2*Ze),ue=o.current.material;ue.color.set(ot),ue.opacity=(.25+Ue*.5)*B,o.current.visible=!0;const Ge=1.4+Ue*.5;o.current.scale.set(Ge,Ge,Ge)}else o.current.visible=!1}c.current&&(c.current.visible=n.status==="plan_review",c.current.rotation.z+=$*.3)});const re=N=>{N.stopPropagation(),y(n.id),P&&m&&p(m.id)},X=.55,V=M.useMemo(()=>uu(n.id,18)*(Math.PI/180),[n.id]),F=M.useMemo(()=>uu(n.id+"-z",12)*(Math.PI/180),[n.id]);return T.jsxs("group",{ref:i,children:[T.jsx("group",{rotation:[V,0,F],children:T.jsxs("mesh",{ref:l,onClick:re,castShadow:!0,children:[T.jsx("sphereGeometry",{args:[X,32,32]}),T.jsx("meshStandardMaterial",{ref:f,color:H,emissive:H,emissiveIntensity:.06,roughness:.78,metalness:.12})]})}),T.jsx($u,{radius:X,color:P&&m?m.color:jo(n.model),intensity:z*(n.status==="active"?1.2:.9)}),T.jsxs("mesh",{ref:o,visible:!1,children:[T.jsx("sphereGeometry",{args:[X*1.4,24,24]}),T.jsx("meshBasicMaterial",{color:"#ef4444",transparent:!0,opacity:.4})]}),T.jsxs("mesh",{ref:c,visible:!1,rotation:[Math.PI/2.4,0,0],children:[T.jsx("ringGeometry",{args:[X*1.4,X*2,64]}),T.jsx("meshBasicMaterial",{color:"#a78bfa",transparent:!0,opacity:.5,side:2})]}),P&&T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[X*1.25,X*1.35,64]}),T.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.7,side:2})]}),v.map((N,$)=>T.jsx(Fh,{session:N,index:$,speed:jh()},N.id)),T.jsx(Jo,{center:!0,distanceFactor:10,style:{pointerEvents:"none",userSelect:"none"},position:[0,X+.4,0],children:T.jsxs("div",{className:`px-2 py-1 rounded text-[10px] whitespace-nowrap border ${x?"bg-solix-accent/20 border-solix-accent text-white":P?"bg-amber-500/10 border-amber-300/50 text-amber-100":"bg-black/50 border-white/10 text-slate-200"}`,children:[T.jsxs("div",{className:"font-semibold flex items-center gap-1",children:[P&&m&&T.jsx("span",{style:{color:m.color},children:m.glyph}),T.jsx("span",{children:n.name??(P&&m?`${m.codename} (pinned)`:n.id.slice(0,8))})]}),T.jsxs("div",{className:"opacity-70",title:Of[n.status]??void 0,children:[String(n.model)," · ",Uf(n.status),n.wrapperSocketPath&&T.jsx("span",{className:"ml-1.5 text-[9px] uppercase tracking-wide text-solix-accent",title:"Wrapped by `solix run` — UI prompts route to this terminal",children:"· wrapped"})]}),T.jsxs("div",{className:"opacity-70",title:R.reasons.length?R.reasons.join(" · "):"Stable, low context, no pending decisions",children:[T.jsx("span",{style:{color:Bf(C)},children:"♥"})," ","health ",C,R.reasons[0]&&T.jsxs("span",{className:"opacity-80",children:[" · ",R.reasons[0]]})]})]})})]})}function uu(n,i){let l=0;for(let c=0;c<n.length;c++)l=l*31+n.charCodeAt(c)|0;return((l>>>0)%1e3/1e3-.5)*i}function Hh({orbitSlot:n}){const i=Kr(n);return T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[i-.02,i+.02,128]}),T.jsx("meshBasicMaterial",{color:"#1e293b",transparent:!0,opacity:.35,side:2})]})}const Gh=1800;function Wh(n){switch(n){case"Bash":return"#94a3b8";case"Read":return"#60a5fa";case"Write":return"#34d399";case"Edit":case"MultiEdit":return"#fbbf24";case"Task":return"#a78bfa";default:return"#cbd5e1"}}function Vh({toolCallId:n,startX:i,startZ:l,color:o,receivedAt:c}){const f=M.useRef(null),d=M.useRef(null),h=M.useMemo(()=>{const v=Math.hypot(i,l)||1,y=i/v,p=l/v;return{nx:y,nz:p}},[i,l]);return je(()=>{const v=Date.now()-c,y=Math.min(1,v/Gh);if(f.current){const p=Ln.lerp(0,12,y);f.current.position.set(i+h.nx*p,Math.sin(y*Math.PI)*1.4,l+h.nz*p)}if(d.current){const p=d.current.material;p.opacity=1-y}}),T.jsx("group",{ref:f,children:T.jsxs("mesh",{ref:d,children:[T.jsx("sphereGeometry",{args:[.08,8,8]}),T.jsx("meshBasicMaterial",{color:o,transparent:!0,opacity:.9})]})})}function Qh(){const n=pe(l=>l.playback.active?l.playback.derivedToolCalls:l.recentToolCalls),i=pe(l=>l.playback.active?l.playback.derivedSessions:l.sessions);return T.jsx("group",{children:n.map(l=>{const o=i[l.sessionId];if(!o)return null;const c=Kr(o.orbitSlot),f=is(o.orbitSlot,o.id,o.projectId),d=(Date.now()-l.startedAt)/1e3,v=f+d*.18*.3,y=Math.cos(v)*c,p=Math.sin(v)*c;return T.jsx(Vh,{toolCallId:l.id,startX:y,startZ:p,color:Wh(l.tool),receivedAt:l.receivedAt},l.id)})})}const rs=3.3,On=.34,Yh={saturn:{body:"/textures/saturn.jpg",ring:"/textures/saturn_ring.png",ringInner:1.5,ringOuter:2.4,axialTilt:.45},mars:{body:"/textures/mars.jpg",axialTilt:.4},earth:{body:"/textures/earth.jpg",cloud:"/textures/earth_clouds.png",axialTilt:.41},jupiter:{body:"/textures/jupiter.jpg",axialTilt:.05},moon:{body:"/textures/moon.jpg",axialTilt:.1}};function Xh({advisor:n,index:i,total:l}){const o=M.useRef(null),c=M.useMemo(()=>i/Math.max(1,l)*Math.PI*2,[i,l]),f=pe(m=>m.selectAdvisor),d=pe(m=>m.selectedAdvisorId===n.id),h=M.useRef(c);je((m,E)=>{pe.getState().motionEnabled&&(h.current+=E*.18);const x=h.current;o.current&&o.current.position.set(Math.cos(x)*rs,0,Math.sin(x)*rs)});const v=M.useRef(1);je(()=>{const m=pe.getState(),E=!!(m.selectedSessionId||m.selectedAdvisorId||m.selectedSkillId),x=m.selectedAdvisorId===n.id||n.pinnedSessionId&&m.selectedSessionId===n.pinnedSessionId,P=E&&!x?.25:1;v.current=Ln.lerp(v.current,P,.08)});const y=m=>{m.stopPropagation(),f(n.id)},p=n.texturePack?Yh[n.texturePack]:void 0;return T.jsxs("group",{ref:o,children:[p?T.jsx(M.Suspense,{fallback:T.jsx(cu,{advisor:n,onClick:y,dimRef:v}),children:T.jsx(Kh,{advisor:n,pack:p,onClick:y,dimRef:v})}):T.jsx(cu,{advisor:n,onClick:y,dimRef:v}),T.jsx($u,{radius:On,color:n.color,intensity:n.pinned?1.4:.7,power:3.5}),T.jsx(Jo,{center:!0,distanceFactor:9,style:{pointerEvents:"none",userSelect:"none"},position:[0,On+.32,0],children:T.jsxs("div",{className:`px-1.5 py-0.5 rounded text-[9px] whitespace-nowrap border ${d?"bg-amber-400/20 border-amber-300 text-amber-100":"bg-black/60 border-white/10 text-amber-100/80"}`,children:[T.jsx("span",{className:"mr-1",children:n.glyph}),n.codename,n.pinned&&T.jsx("span",{className:"ml-1 text-amber-300",children:"●"})]})})]})}function Kh({advisor:n,pack:i,onClick:l,dimRef:o}){const c=M.useRef(null),f=M.useRef(null),d=M.useRef(null),h=M.useRef(null),v=M.useRef(null),y=M.useRef(null),p=en(kn,i.body),m=en(kn,i.cloud??"/textures/sun.jpg"),E=en(kn,i.ring??"/textures/sun.jpg");p.wrapS=es,p.wrapT=es,je((O,R)=>{pe.getState().motionEnabled&&(c.current&&(c.current.rotation.y+=R*.18),f.current&&(f.current.rotation.y+=R*.25),d.current&&(d.current.rotation.z+=R*.05));const z=o.current;h.current&&(h.current.opacity=z,h.current.transparent=z<.99),v.current&&(v.current.opacity=.55*z),y.current&&(y.current.opacity=.85*z)});const x=i.axialTilt??0,P=(i.ringInner??1.5)*On,U=(i.ringOuter??2.4)*On;return T.jsxs("group",{rotation:[x,0,0],children:[T.jsxs("mesh",{ref:c,onClick:l,children:[T.jsx("sphereGeometry",{args:[On,48,48]}),T.jsx("meshStandardMaterial",{ref:h,map:p,roughness:.85,metalness:.05,emissive:new dt(n.color),emissiveIntensity:n.pinned?.25:.1,transparent:!0,opacity:1})]}),i.cloud&&T.jsxs("mesh",{ref:f,children:[T.jsx("sphereGeometry",{args:[On*1.02,48,48]}),T.jsx("meshStandardMaterial",{ref:v,map:m,transparent:!0,opacity:.55,depthWrite:!1,roughness:1})]}),i.ring&&T.jsxs("mesh",{ref:d,rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[P,U,96]}),T.jsx("meshStandardMaterial",{ref:y,map:E,transparent:!0,opacity:.85,side:Dn,depthWrite:!1,roughness:1})]})]})}function cu({advisor:n,onClick:i,dimRef:l}){const o=M.useRef(null),c=M.useRef(null),f=M.useMemo(()=>new dt(n.color),[n.color]);return je((d,h)=>{if(pe.getState().motionEnabled&&o.current&&(o.current.rotation.y+=h*.4),c.current){const y=l.current,p=n.pinned?.6:.22;c.current.emissiveIntensity=Ln.lerp(c.current.emissiveIntensity,p*y,.05),c.current.opacity=y,c.current.transparent=y<.99}}),T.jsxs("mesh",{ref:o,onClick:i,children:[T.jsx("sphereGeometry",{args:[On,24,24]}),T.jsx("meshStandardMaterial",{ref:c,color:f,emissive:f,emissiveIntensity:.22,roughness:.55,metalness:.4,transparent:!0,opacity:1})]})}function Zh(){const n=pe(kf);return n.length?T.jsxs("group",{children:[T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[rs-.03,rs+.03,128]}),T.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.12,side:Dn})]}),n.map((i,l)=>T.jsx(Xh,{advisor:i,index:l,total:n.length},i.id))]}):null}const Jh=22,qh=1.6,$h=.2;function em(n){switch(n){case"anthropic":return new dt("#94a3b8");case"solix":return new dt("#a855f7");case"user":return new dt("#06b6d4");default:return new dt("#cbd5e1")}}const lr=new jf;function tm(){const n=pe(Lf),i=pe(v=>v.selectSkill),l=pe(v=>v.selectedSkillId),o=M.useRef(null),c=M.useMemo(()=>n.map((v,y)=>{const p=y/Math.max(1,n.length)*Math.PI*2,m=(v.id.charCodeAt(0)??0)%13/13-.5,E=Jh+m*qh,x=Math.sin(p*1.7+(v.id.charCodeAt(1)??0))*.3+Math.tan($h)*Math.sin(p)*.4,P=.18+v.id.length%5*.04,U=new Bo;return U.setFromAxisAngle(new De(1,.4,.1).normalize(),p*1.3),{angle:p,radius:E,y:x,size:P,rot:U,color:em(v.source),skill:v}}),[n]),f=M.useRef(0),d=M.useRef(0);if(je((v,y)=>{if(!o.current||!c.length)return;pe.getState().motionEnabled&&(f.current+=y*.04,d.current+=y*.8);const m=f.current,E=d.current;for(let x=0;x<c.length;x++){const P=c[x],U=P.angle+m;lr.position.set(Math.cos(U)*P.radius,P.y,Math.sin(U)*P.radius),lr.quaternion.copy(P.rot),lr.rotateY(E+x);const R=l===P.skill.id?P.size*1.6:P.size;lr.scale.set(R,R,R),lr.updateMatrix(),o.current.setMatrixAt(x,lr.matrix),o.current.setColorAt(x,P.color)}o.current.instanceMatrix.needsUpdate=!0,o.current.instanceColor&&(o.current.instanceColor.needsUpdate=!0)}),!c.length)return null;const h=v=>{v.stopPropagation();const y=v.instanceId;if(typeof y!="number")return;const p=c[y];p&&i(p.skill.id)};return T.jsxs("instancedMesh",{ref:o,args:[void 0,void 0,c.length],onClick:h,children:[T.jsx("icosahedronGeometry",{args:[1,0]}),T.jsx("meshStandardMaterial",{roughness:.85,metalness:.05})]})}function nm(){const n=pe(c=>c.projects),i=pe(wu),l=pe(Mu),o=M.useMemo(()=>{const c=[...i,...l],f=new Map;for(const d of c){const h=n[d.projectId];if(!h)continue;const v=f.get(h.id);v?v.sessions.push(d):f.set(h.id,{project:h,sessions:[d]})}return[...f.values()]},[i,l,n]);return o.length<2?T.jsx(T.Fragment,{}):T.jsx(T.Fragment,{children:o.map(({project:c,sessions:f})=>{const d=f.reduce((m,E)=>Math.max(m,E.orbitSlot),0),h=is(d,f[0].id,c.id),v=Kr(d)+1.2,y=Math.cos(h)*v,p=Math.sin(h)*v;return T.jsx(Jo,{position:[y,1.6,p],center:!0,distanceFactor:14,style:{pointerEvents:"none",userSelect:"none"},children:T.jsxs("div",{className:"px-2 py-1 rounded text-[9px] uppercase tracking-widest border border-solix-accent/30 bg-black/50 text-solix-accent/80 whitespace-nowrap",children:[c.name,T.jsxs("span",{className:"ml-1.5 text-slate-500",children:["· ",f.length]})]})},c.id)})})}const No=[{position:[-160,70,-110],size:240,hue:.92,saturation:.75,rotationSpeed:.008,driftAxis:[0,1,0]},{position:[150,-50,-130],size:280,hue:.74,saturation:.78,rotationSpeed:-.006,driftAxis:[1,0,0]},{position:[-30,-20,-260],size:360,hue:.5,saturation:.7,rotationSpeed:.004,driftAxis:[0,1,1]},{position:[60,130,-180],size:200,hue:.95,saturation:.85,rotationSpeed:.011,driftAxis:[1,.4,0]},{position:[200,80,-240],size:290,hue:.62,saturation:.7,rotationSpeed:-.005,driftAxis:[.5,1,0]},{position:[-130,-90,-200],size:220,hue:.08,saturation:.55,rotationSpeed:.007,driftAxis:[0,0,1]}];function rm(n,i){const o=document.createElement("canvas");o.width=256,o.height=256;const c=o.getContext("2d");if(!c)return new Lo(o);const f=n*360,d=`hsla(${f}, ${Math.round(i*100)}%, 60%, 0.85)`,h=`hsla(${f}, ${Math.round(i*100)}%, 45%, 0.35)`,v=`hsla(${f}, ${Math.round(i*100)}%, 25%, 0)`,y=c.createRadialGradient(256/2,256/2,0,256/2,256/2,256/2);y.addColorStop(0,d),y.addColorStop(.45,h),y.addColorStop(1,v),c.fillStyle=y,c.fillRect(0,0,256,256),c.globalCompositeOperation="destination-in";for(let m=0;m<60;m++){const E=Math.random()*256,x=Math.random()*256,P=30+Math.random()*70,U=.4+Math.random()*.6,O=c.createRadialGradient(E,x,0,E,x,P);O.addColorStop(0,`rgba(255,255,255,${U})`),O.addColorStop(1,"rgba(255,255,255,0)"),c.fillStyle=O,c.fillRect(0,0,256,256)}const p=new Lo(o);return p.needsUpdate=!0,p}function im(){const n=M.useRef(null),i=M.useRef([]),l=M.useMemo(()=>No.map(o=>typeof document>"u"?null:rm(o.hue,o.saturation)),[]);return je((o,c)=>{pe.getState().motionEnabled&&i.current.forEach((f,d)=>{if(!f)return;const h=No[d];f.material.rotation+=c*h.rotationSpeed;const v=performance.now()*1e-4;f.position.x=h.position[0]+Math.sin(v*(d+1))*6,f.position.y=h.position[1]+Math.cos(v*(d+1))*4})}),T.jsx("group",{ref:n,children:No.map((o,c)=>{const f=l[c];return f?T.jsx("sprite",{ref:d=>{i.current[c]=d},position:o.position,scale:[o.size,o.size,1],children:T.jsx("spriteMaterial",{map:f,transparent:!0,depthWrite:!1,blending:Qr,opacity:.55,toneMapped:!1})},c):null})})}const fu=3,du=12e3,sm=24e3,ec=1500;let om=1;function pu(n){const i=Math.random(),l=Math.random(),o=i*Math.PI*2,c=Math.acos(2*l-1);return new De(n*Math.sin(c)*Math.cos(o),n*Math.sin(c)*Math.sin(o),n*Math.cos(c))}function lm(){const[n,i]=M.useState([]);return M.useEffect(()=>{let l=!1,o=null;const c=()=>{if(l)return;const f=du+Math.random()*(sm-du);o=setTimeout(()=>{if(l)return;if(!pe.getState().motionEnabled){c();return}const d=pu(180),h=pu(1).multiplyScalar(60).add(d).normalize().multiplyScalar(180);i(v=>{const y=[...v,{id:om++,start:d,end:h,spawnedAt:performance.now()}];return y.length>fu?y.slice(y.length-fu):y}),c()},f)};return c(),()=>{l=!0,o&&clearTimeout(o)}},[]),je(()=>{const l=performance.now();i(o=>{const c=o.filter(f=>l-f.spawnedAt<ec+200);return c.length===o.length?o:c})}),T.jsx(T.Fragment,{children:n.map(l=>T.jsx(am,{spec:l},l.id))})}function am({spec:n}){const i=M.useRef(null),l=M.useRef(null);return je(()=>{const o=(performance.now()-n.spawnedAt)/ec;if(o>1)return;const c=o*o*(3-2*o),f=new De().lerpVectors(n.start,n.end,c);if(i.current){i.current.position.copy(f);const d=i.current.material;d.opacity=(1-o)*1}if(l.current){const d=Math.max(0,o-.08),h=new De().lerpVectors(n.start,n.end,d);l.current.position.copy(h),l.current.lookAt(f);const v=l.current.material;v.opacity=(1-o)*.5}}),T.jsxs(T.Fragment,{children:[T.jsxs("mesh",{ref:i,position:n.start,children:[T.jsx("sphereGeometry",{args:[1.4,8,8]}),T.jsx("meshBasicMaterial",{color:"#fff5cf",transparent:!0,opacity:0,toneMapped:!1,blending:Qr,depthWrite:!1})]}),T.jsxs("mesh",{ref:l,position:n.start,children:[T.jsx("coneGeometry",{args:[.8,14,6,1,!0]}),T.jsx("meshBasicMaterial",{color:"#fff5cf",transparent:!0,opacity:0,toneMapped:!1,blending:Qr,depthWrite:!1})]})]})}const tc=600,um=2.4;let cm=1;function fm(){const[n,i]=M.useState([]),l=M.useRef(null);return M.useEffect(()=>pe.subscribe(c=>{const f=c.selectedSessionId,d=l.current;if(f===d||(l.current=f,!f))return;const h=c.sessions[f];if(!h)return;const v=Kr(h.orbitSlot),y=is(h.orbitSlot,h.id,h.projectId),p=Math.cos(y)*v,m=Math.sin(y)*v;i(E=>[...E,{id:cm++,position:[p,0,m],spawnedAt:performance.now()}])}),[]),je(()=>{const o=performance.now();i(c=>{const f=c.filter(d=>o-d.spawnedAt<tc+50);return f.length===c.length?c:f})}),T.jsx(T.Fragment,{children:n.map(o=>T.jsx(dm,{spec:o},o.id))})}function dm({spec:n}){const i=M.useRef(null);return je(()=>{if(!i.current)return;const l=(performance.now()-n.spawnedAt)/tc;if(l>1){i.current.visible=!1;return}const c=(1-Math.pow(1-l,2))*um;i.current.scale.set(c,c,c);const f=i.current.material;f.opacity=(1-l)*.65}),T.jsxs("mesh",{ref:i,position:n.position,rotation:[-Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[.92,1,48]}),T.jsx("meshBasicMaterial",{color:"#a5b4fc",transparent:!0,opacity:.65,toneMapped:!1,depthWrite:!1})]})}const pm="/textures/milky_way.jpg";function Sm(){const n=pe(wu),i=pe(Mu),l=pe(h=>h.selectSession),o=pe(h=>h.selectAdvisor),c=pe(h=>h.selectSkill),f=[...n,...i],d=Array.from(new Set(f.map(h=>h.orbitSlot))).sort((h,v)=>h-v);return T.jsxs(Nd,{shadows:!1,camera:{position:[16,9,32],fov:55,near:.1,far:600},gl:{toneMapping:mu,toneMappingExposure:.85},onPointerMissed:()=>{l(null),o(null),c(null)},children:[T.jsx("color",{attach:"background",args:["#05060c"]}),T.jsx("fog",{attach:"fog",args:["#0a0d1f",140,500]}),T.jsx("ambientLight",{intensity:.12}),T.jsx(M.Suspense,{fallback:T.jsx(rp,{radius:180,depth:80,count:6e3,factor:4,saturation:.4,fade:!0,speed:0}),children:T.jsx(hm,{})}),T.jsx(im,{}),T.jsx(Dh,{}),T.jsx(lm,{}),T.jsx(Rh,{}),T.jsx(Zh,{}),T.jsx(tm,{}),d.map(h=>T.jsx(Hh,{orbitSlot:h},h)),f.map(h=>T.jsx(bh,{session:h},h.id)),T.jsx(Qh,{}),T.jsx(fm,{}),T.jsx(nm,{}),T.jsx(mm,{}),T.jsx(Eh,{multisampling:4,children:T.jsx(Th,{intensity:.85,luminanceThreshold:.7,luminanceSmoothing:.2,mipmapBlur:!0,radius:.55})})]})}function hm(){const n=M.useRef(null),i=qo(pm);return T.jsxs("mesh",{ref:n,scale:[-1,1,1],children:[T.jsx("sphereGeometry",{args:[400,48,32]}),T.jsx("meshBasicMaterial",{map:i,side:cr,toneMapped:!1})]})}function mm(){const n=M.useRef(null),{camera:i}=St();return M.useEffect(()=>(Ff(n.current,i),()=>bf()),[i]),T.jsx(ep,{ref:n,makeDefault:!0,enablePan:!0,enableZoom:!0,enableRotate:!0,minDistance:6,maxDistance:140,target:[0,0,0]})}export{Sm as Scene};
292
+ `}),[i,l,o]);return T.jsxs("mesh",{children:[T.jsx("sphereGeometry",{args:[n*1.18,32,32]}),T.jsx("primitive",{object:c,attach:"material"})]})}function bh({session:n}){const i=M.useRef(null),l=M.useRef(null),o=M.useRef(null),c=M.useRef(null),f=M.useRef(null),d=M.useMemo(()=>is(n.orbitSlot,n.id,n.projectId),[n.orbitSlot,n.id]),h=M.useMemo(()=>Kr(n.orbitSlot),[n.orbitSlot]),v=pe(N=>Df(N,n.id)),y=pe(N=>N.selectSession),p=pe(N=>N.selectAdvisor),m=pe(N=>n.advisorRole?Object.values(N.advisors).find($=>$.id===n.advisorRole)??null:null),x=pe(N=>N.selectedSessionId)===n.id,P=n.kind==="advisor",U=pe(N=>n.currentMissionId?N.missions[n.currentMissionId]:void 0),O=pe(N=>Object.values(N.pendingPermissions).filter($=>$.sessionId===n.id).length),R=M.useMemo(()=>Nf(n,U,O),[n,U,O]),C=R.score,z=.4+C/100*.8,H=M.useMemo(()=>new dt(P&&m?m.color:jo(n.model)),[P,m,n.model]),j=M.useRef(d),k=M.useRef(1);je((N,$)=>{const se=pe.getState(),Ne=se.motionEnabled,he=!!(se.selectedSessionId||se.selectedAdvisorId||se.selectedSkillId),_e=se.selectedSessionId===n.id||P&&se.selectedAdvisorId===n.advisorRole,Ee=he&&!_e?.25:1;k.current=Ln.lerp(k.current,Ee,.08);const B=k.current,K=Lh(n.status==="active",n.orbitSlot);Ne&&(j.current+=$*K*.3);const G=j.current,q=Math.cos(G)*h,ae=Math.sin(G)*h,ie=Math.sin(G*.5)*.4;i.current&&i.current.position.set(q,ie,ae);const ze=N.clock.getElapsedTime();if(l.current){Ne&&(l.current.rotation.y+=$*.4);const we=.55+n.contextUsagePct/100*.5,Oe=l.current.scale.x,Ke=Ln.lerp(Oe,we,.04);l.current.scale.set(Ke,Ke,Ke)}if(f.current){const we=Eu(n.status),Oe=new dt(we.color);f.current.emissive.lerp(Oe,.08),f.current.emissiveIntensity=Ln.lerp(f.current.emissiveIntensity,we.intensity*B,.06),f.current.opacity=B,f.current.transparent=B<.99}if(o.current){const we=n.contextUsagePct>=90,Oe=n.contextUsagePct>=80&&!we;if(n.status==="awaiting_permission"||n.status==="awaiting_input"||we||Oe){let Ze=.8,ot="#f59e0b";n.status==="awaiting_permission"?(Ze=1.5,ot="#ef4444"):n.status==="awaiting_input"?(Ze=.8,ot="#f59e0b"):we?(Ze=1.2,ot="#dc2626"):Oe&&(Ze=.6,ot="#fb923c");const Ue=.5+.5*Math.sin(ze*Math.PI*2*Ze),ue=o.current.material;ue.color.set(ot),ue.opacity=(.25+Ue*.5)*B,o.current.visible=!0;const Ge=1.4+Ue*.5;o.current.scale.set(Ge,Ge,Ge)}else o.current.visible=!1}c.current&&(c.current.visible=n.status==="plan_review",c.current.rotation.z+=$*.3)});const re=N=>{N.stopPropagation(),y(n.id),P&&m&&p(m.id)},X=.55,V=M.useMemo(()=>uu(n.id,18)*(Math.PI/180),[n.id]),F=M.useMemo(()=>uu(n.id+"-z",12)*(Math.PI/180),[n.id]);return T.jsxs("group",{ref:i,children:[T.jsx("group",{rotation:[V,0,F],children:T.jsxs("mesh",{ref:l,onClick:re,castShadow:!0,children:[T.jsx("sphereGeometry",{args:[X,32,32]}),T.jsx("meshStandardMaterial",{ref:f,color:H,emissive:H,emissiveIntensity:.06,roughness:.78,metalness:.12})]})}),T.jsx($u,{radius:X,color:P&&m?m.color:jo(n.model),intensity:z*(n.status==="active"?1.2:.9)}),T.jsxs("mesh",{ref:o,visible:!1,children:[T.jsx("sphereGeometry",{args:[X*1.4,24,24]}),T.jsx("meshBasicMaterial",{color:"#ef4444",transparent:!0,opacity:.4})]}),T.jsxs("mesh",{ref:c,visible:!1,rotation:[Math.PI/2.4,0,0],children:[T.jsx("ringGeometry",{args:[X*1.4,X*2,64]}),T.jsx("meshBasicMaterial",{color:"#a78bfa",transparent:!0,opacity:.5,side:2})]}),P&&T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[X*1.25,X*1.35,64]}),T.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.7,side:2})]}),v.map((N,$)=>T.jsx(Fh,{session:N,index:$,speed:jh()},N.id)),T.jsx(Jo,{center:!0,distanceFactor:10,style:{pointerEvents:"none",userSelect:"none"},position:[0,X+.4,0],children:T.jsxs("div",{className:`px-2 py-1 rounded text-[10px] whitespace-nowrap border ${x?"bg-solix-accent/20 border-solix-accent text-white":P?"bg-amber-500/10 border-amber-300/50 text-amber-100":"bg-black/50 border-white/10 text-slate-200"}`,children:[T.jsxs("div",{className:"font-semibold flex items-center gap-1",children:[P&&m&&T.jsx("span",{style:{color:m.color},children:m.glyph}),T.jsx("span",{children:n.name??(P&&m?`${m.codename} (pinned)`:n.id.slice(0,8))})]}),T.jsxs("div",{className:"opacity-70",title:Of[n.status]??void 0,children:[String(n.model)," · ",Uf(n.status),n.origin==="agentview"&&T.jsx("span",{className:"ml-1.5 text-[9px] uppercase tracking-wide text-cyan-300",title:"Background session managed by Anthropic's Agent View",children:"· agent"}),n.wrapperSocketPath&&T.jsx("span",{className:"ml-1.5 text-[9px] uppercase tracking-wide text-solix-accent",title:"Wrapped by `solix run` — UI prompts route to this terminal",children:"· wrapped"})]}),n.agentViewSummary&&T.jsx("div",{className:"opacity-80 italic text-[10px] max-w-[200px] truncate",title:n.agentViewSummary,children:n.agentViewSummary}),T.jsxs("div",{className:"opacity-70",title:R.reasons.length?R.reasons.join(" · "):"Stable, low context, no pending decisions",children:[T.jsx("span",{style:{color:Bf(C)},children:"♥"})," ","health ",C,R.reasons[0]&&T.jsxs("span",{className:"opacity-80",children:[" · ",R.reasons[0]]})]})]})})]})}function uu(n,i){let l=0;for(let c=0;c<n.length;c++)l=l*31+n.charCodeAt(c)|0;return((l>>>0)%1e3/1e3-.5)*i}function Hh({orbitSlot:n}){const i=Kr(n);return T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[i-.02,i+.02,128]}),T.jsx("meshBasicMaterial",{color:"#1e293b",transparent:!0,opacity:.35,side:2})]})}const Gh=1800;function Wh(n){switch(n){case"Bash":return"#94a3b8";case"Read":return"#60a5fa";case"Write":return"#34d399";case"Edit":case"MultiEdit":return"#fbbf24";case"Task":return"#a78bfa";default:return"#cbd5e1"}}function Vh({toolCallId:n,startX:i,startZ:l,color:o,receivedAt:c}){const f=M.useRef(null),d=M.useRef(null),h=M.useMemo(()=>{const v=Math.hypot(i,l)||1,y=i/v,p=l/v;return{nx:y,nz:p}},[i,l]);return je(()=>{const v=Date.now()-c,y=Math.min(1,v/Gh);if(f.current){const p=Ln.lerp(0,12,y);f.current.position.set(i+h.nx*p,Math.sin(y*Math.PI)*1.4,l+h.nz*p)}if(d.current){const p=d.current.material;p.opacity=1-y}}),T.jsx("group",{ref:f,children:T.jsxs("mesh",{ref:d,children:[T.jsx("sphereGeometry",{args:[.08,8,8]}),T.jsx("meshBasicMaterial",{color:o,transparent:!0,opacity:.9})]})})}function Qh(){const n=pe(l=>l.playback.active?l.playback.derivedToolCalls:l.recentToolCalls),i=pe(l=>l.playback.active?l.playback.derivedSessions:l.sessions);return T.jsx("group",{children:n.map(l=>{const o=i[l.sessionId];if(!o)return null;const c=Kr(o.orbitSlot),f=is(o.orbitSlot,o.id,o.projectId),d=(Date.now()-l.startedAt)/1e3,v=f+d*.18*.3,y=Math.cos(v)*c,p=Math.sin(v)*c;return T.jsx(Vh,{toolCallId:l.id,startX:y,startZ:p,color:Wh(l.tool),receivedAt:l.receivedAt},l.id)})})}const rs=3.3,On=.34,Yh={saturn:{body:"/textures/saturn.jpg",ring:"/textures/saturn_ring.png",ringInner:1.5,ringOuter:2.4,axialTilt:.45},mars:{body:"/textures/mars.jpg",axialTilt:.4},earth:{body:"/textures/earth.jpg",cloud:"/textures/earth_clouds.png",axialTilt:.41},jupiter:{body:"/textures/jupiter.jpg",axialTilt:.05},moon:{body:"/textures/moon.jpg",axialTilt:.1}};function Xh({advisor:n,index:i,total:l}){const o=M.useRef(null),c=M.useMemo(()=>i/Math.max(1,l)*Math.PI*2,[i,l]),f=pe(m=>m.selectAdvisor),d=pe(m=>m.selectedAdvisorId===n.id),h=M.useRef(c);je((m,E)=>{pe.getState().motionEnabled&&(h.current+=E*.18);const x=h.current;o.current&&o.current.position.set(Math.cos(x)*rs,0,Math.sin(x)*rs)});const v=M.useRef(1);je(()=>{const m=pe.getState(),E=!!(m.selectedSessionId||m.selectedAdvisorId||m.selectedSkillId),x=m.selectedAdvisorId===n.id||n.pinnedSessionId&&m.selectedSessionId===n.pinnedSessionId,P=E&&!x?.25:1;v.current=Ln.lerp(v.current,P,.08)});const y=m=>{m.stopPropagation(),f(n.id)},p=n.texturePack?Yh[n.texturePack]:void 0;return T.jsxs("group",{ref:o,children:[p?T.jsx(M.Suspense,{fallback:T.jsx(cu,{advisor:n,onClick:y,dimRef:v}),children:T.jsx(Kh,{advisor:n,pack:p,onClick:y,dimRef:v})}):T.jsx(cu,{advisor:n,onClick:y,dimRef:v}),T.jsx($u,{radius:On,color:n.color,intensity:n.pinned?1.4:.7,power:3.5}),T.jsx(Jo,{center:!0,distanceFactor:9,style:{pointerEvents:"none",userSelect:"none"},position:[0,On+.32,0],children:T.jsxs("div",{className:`px-1.5 py-0.5 rounded text-[9px] whitespace-nowrap border ${d?"bg-amber-400/20 border-amber-300 text-amber-100":"bg-black/60 border-white/10 text-amber-100/80"}`,children:[T.jsx("span",{className:"mr-1",children:n.glyph}),n.codename,n.pinned&&T.jsx("span",{className:"ml-1 text-amber-300",children:"●"})]})})]})}function Kh({advisor:n,pack:i,onClick:l,dimRef:o}){const c=M.useRef(null),f=M.useRef(null),d=M.useRef(null),h=M.useRef(null),v=M.useRef(null),y=M.useRef(null),p=en(kn,i.body),m=en(kn,i.cloud??"/textures/sun.jpg"),E=en(kn,i.ring??"/textures/sun.jpg");p.wrapS=es,p.wrapT=es,je((O,R)=>{pe.getState().motionEnabled&&(c.current&&(c.current.rotation.y+=R*.18),f.current&&(f.current.rotation.y+=R*.25),d.current&&(d.current.rotation.z+=R*.05));const z=o.current;h.current&&(h.current.opacity=z,h.current.transparent=z<.99),v.current&&(v.current.opacity=.55*z),y.current&&(y.current.opacity=.85*z)});const x=i.axialTilt??0,P=(i.ringInner??1.5)*On,U=(i.ringOuter??2.4)*On;return T.jsxs("group",{rotation:[x,0,0],children:[T.jsxs("mesh",{ref:c,onClick:l,children:[T.jsx("sphereGeometry",{args:[On,48,48]}),T.jsx("meshStandardMaterial",{ref:h,map:p,roughness:.85,metalness:.05,emissive:new dt(n.color),emissiveIntensity:n.pinned?.25:.1,transparent:!0,opacity:1})]}),i.cloud&&T.jsxs("mesh",{ref:f,children:[T.jsx("sphereGeometry",{args:[On*1.02,48,48]}),T.jsx("meshStandardMaterial",{ref:v,map:m,transparent:!0,opacity:.55,depthWrite:!1,roughness:1})]}),i.ring&&T.jsxs("mesh",{ref:d,rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[P,U,96]}),T.jsx("meshStandardMaterial",{ref:y,map:E,transparent:!0,opacity:.85,side:Dn,depthWrite:!1,roughness:1})]})]})}function cu({advisor:n,onClick:i,dimRef:l}){const o=M.useRef(null),c=M.useRef(null),f=M.useMemo(()=>new dt(n.color),[n.color]);return je((d,h)=>{if(pe.getState().motionEnabled&&o.current&&(o.current.rotation.y+=h*.4),c.current){const y=l.current,p=n.pinned?.6:.22;c.current.emissiveIntensity=Ln.lerp(c.current.emissiveIntensity,p*y,.05),c.current.opacity=y,c.current.transparent=y<.99}}),T.jsxs("mesh",{ref:o,onClick:i,children:[T.jsx("sphereGeometry",{args:[On,24,24]}),T.jsx("meshStandardMaterial",{ref:c,color:f,emissive:f,emissiveIntensity:.22,roughness:.55,metalness:.4,transparent:!0,opacity:1})]})}function Zh(){const n=pe(kf);return n.length?T.jsxs("group",{children:[T.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[rs-.03,rs+.03,128]}),T.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.12,side:Dn})]}),n.map((i,l)=>T.jsx(Xh,{advisor:i,index:l,total:n.length},i.id))]}):null}const Jh=22,qh=1.6,$h=.2;function em(n){switch(n){case"anthropic":return new dt("#94a3b8");case"solix":return new dt("#a855f7");case"user":return new dt("#06b6d4");default:return new dt("#cbd5e1")}}const lr=new jf;function tm(){const n=pe(Lf),i=pe(v=>v.selectSkill),l=pe(v=>v.selectedSkillId),o=M.useRef(null),c=M.useMemo(()=>n.map((v,y)=>{const p=y/Math.max(1,n.length)*Math.PI*2,m=(v.id.charCodeAt(0)??0)%13/13-.5,E=Jh+m*qh,x=Math.sin(p*1.7+(v.id.charCodeAt(1)??0))*.3+Math.tan($h)*Math.sin(p)*.4,P=.18+v.id.length%5*.04,U=new Bo;return U.setFromAxisAngle(new De(1,.4,.1).normalize(),p*1.3),{angle:p,radius:E,y:x,size:P,rot:U,color:em(v.source),skill:v}}),[n]),f=M.useRef(0),d=M.useRef(0);if(je((v,y)=>{if(!o.current||!c.length)return;pe.getState().motionEnabled&&(f.current+=y*.04,d.current+=y*.8);const m=f.current,E=d.current;for(let x=0;x<c.length;x++){const P=c[x],U=P.angle+m;lr.position.set(Math.cos(U)*P.radius,P.y,Math.sin(U)*P.radius),lr.quaternion.copy(P.rot),lr.rotateY(E+x);const R=l===P.skill.id?P.size*1.6:P.size;lr.scale.set(R,R,R),lr.updateMatrix(),o.current.setMatrixAt(x,lr.matrix),o.current.setColorAt(x,P.color)}o.current.instanceMatrix.needsUpdate=!0,o.current.instanceColor&&(o.current.instanceColor.needsUpdate=!0)}),!c.length)return null;const h=v=>{v.stopPropagation();const y=v.instanceId;if(typeof y!="number")return;const p=c[y];p&&i(p.skill.id)};return T.jsxs("instancedMesh",{ref:o,args:[void 0,void 0,c.length],onClick:h,children:[T.jsx("icosahedronGeometry",{args:[1,0]}),T.jsx("meshStandardMaterial",{roughness:.85,metalness:.05})]})}function nm(){const n=pe(c=>c.projects),i=pe(wu),l=pe(Mu),o=M.useMemo(()=>{const c=[...i,...l],f=new Map;for(const d of c){const h=n[d.projectId];if(!h)continue;const v=f.get(h.id);v?v.sessions.push(d):f.set(h.id,{project:h,sessions:[d]})}return[...f.values()]},[i,l,n]);return o.length<2?T.jsx(T.Fragment,{}):T.jsx(T.Fragment,{children:o.map(({project:c,sessions:f})=>{const d=f.reduce((m,E)=>Math.max(m,E.orbitSlot),0),h=is(d,f[0].id,c.id),v=Kr(d)+1.2,y=Math.cos(h)*v,p=Math.sin(h)*v;return T.jsx(Jo,{position:[y,1.6,p],center:!0,distanceFactor:14,style:{pointerEvents:"none",userSelect:"none"},children:T.jsxs("div",{className:"px-2 py-1 rounded text-[9px] uppercase tracking-widest border border-solix-accent/30 bg-black/50 text-solix-accent/80 whitespace-nowrap",children:[c.name,T.jsxs("span",{className:"ml-1.5 text-slate-500",children:["· ",f.length]})]})},c.id)})})}const No=[{position:[-160,70,-110],size:240,hue:.92,saturation:.75,rotationSpeed:.008,driftAxis:[0,1,0]},{position:[150,-50,-130],size:280,hue:.74,saturation:.78,rotationSpeed:-.006,driftAxis:[1,0,0]},{position:[-30,-20,-260],size:360,hue:.5,saturation:.7,rotationSpeed:.004,driftAxis:[0,1,1]},{position:[60,130,-180],size:200,hue:.95,saturation:.85,rotationSpeed:.011,driftAxis:[1,.4,0]},{position:[200,80,-240],size:290,hue:.62,saturation:.7,rotationSpeed:-.005,driftAxis:[.5,1,0]},{position:[-130,-90,-200],size:220,hue:.08,saturation:.55,rotationSpeed:.007,driftAxis:[0,0,1]}];function rm(n,i){const o=document.createElement("canvas");o.width=256,o.height=256;const c=o.getContext("2d");if(!c)return new Lo(o);const f=n*360,d=`hsla(${f}, ${Math.round(i*100)}%, 60%, 0.85)`,h=`hsla(${f}, ${Math.round(i*100)}%, 45%, 0.35)`,v=`hsla(${f}, ${Math.round(i*100)}%, 25%, 0)`,y=c.createRadialGradient(256/2,256/2,0,256/2,256/2,256/2);y.addColorStop(0,d),y.addColorStop(.45,h),y.addColorStop(1,v),c.fillStyle=y,c.fillRect(0,0,256,256),c.globalCompositeOperation="destination-in";for(let m=0;m<60;m++){const E=Math.random()*256,x=Math.random()*256,P=30+Math.random()*70,U=.4+Math.random()*.6,O=c.createRadialGradient(E,x,0,E,x,P);O.addColorStop(0,`rgba(255,255,255,${U})`),O.addColorStop(1,"rgba(255,255,255,0)"),c.fillStyle=O,c.fillRect(0,0,256,256)}const p=new Lo(o);return p.needsUpdate=!0,p}function im(){const n=M.useRef(null),i=M.useRef([]),l=M.useMemo(()=>No.map(o=>typeof document>"u"?null:rm(o.hue,o.saturation)),[]);return je((o,c)=>{pe.getState().motionEnabled&&i.current.forEach((f,d)=>{if(!f)return;const h=No[d];f.material.rotation+=c*h.rotationSpeed;const v=performance.now()*1e-4;f.position.x=h.position[0]+Math.sin(v*(d+1))*6,f.position.y=h.position[1]+Math.cos(v*(d+1))*4})}),T.jsx("group",{ref:n,children:No.map((o,c)=>{const f=l[c];return f?T.jsx("sprite",{ref:d=>{i.current[c]=d},position:o.position,scale:[o.size,o.size,1],children:T.jsx("spriteMaterial",{map:f,transparent:!0,depthWrite:!1,blending:Qr,opacity:.55,toneMapped:!1})},c):null})})}const fu=3,du=12e3,sm=24e3,ec=1500;let om=1;function pu(n){const i=Math.random(),l=Math.random(),o=i*Math.PI*2,c=Math.acos(2*l-1);return new De(n*Math.sin(c)*Math.cos(o),n*Math.sin(c)*Math.sin(o),n*Math.cos(c))}function lm(){const[n,i]=M.useState([]);return M.useEffect(()=>{let l=!1,o=null;const c=()=>{if(l)return;const f=du+Math.random()*(sm-du);o=setTimeout(()=>{if(l)return;if(!pe.getState().motionEnabled){c();return}const d=pu(180),h=pu(1).multiplyScalar(60).add(d).normalize().multiplyScalar(180);i(v=>{const y=[...v,{id:om++,start:d,end:h,spawnedAt:performance.now()}];return y.length>fu?y.slice(y.length-fu):y}),c()},f)};return c(),()=>{l=!0,o&&clearTimeout(o)}},[]),je(()=>{const l=performance.now();i(o=>{const c=o.filter(f=>l-f.spawnedAt<ec+200);return c.length===o.length?o:c})}),T.jsx(T.Fragment,{children:n.map(l=>T.jsx(am,{spec:l},l.id))})}function am({spec:n}){const i=M.useRef(null),l=M.useRef(null);return je(()=>{const o=(performance.now()-n.spawnedAt)/ec;if(o>1)return;const c=o*o*(3-2*o),f=new De().lerpVectors(n.start,n.end,c);if(i.current){i.current.position.copy(f);const d=i.current.material;d.opacity=(1-o)*1}if(l.current){const d=Math.max(0,o-.08),h=new De().lerpVectors(n.start,n.end,d);l.current.position.copy(h),l.current.lookAt(f);const v=l.current.material;v.opacity=(1-o)*.5}}),T.jsxs(T.Fragment,{children:[T.jsxs("mesh",{ref:i,position:n.start,children:[T.jsx("sphereGeometry",{args:[1.4,8,8]}),T.jsx("meshBasicMaterial",{color:"#fff5cf",transparent:!0,opacity:0,toneMapped:!1,blending:Qr,depthWrite:!1})]}),T.jsxs("mesh",{ref:l,position:n.start,children:[T.jsx("coneGeometry",{args:[.8,14,6,1,!0]}),T.jsx("meshBasicMaterial",{color:"#fff5cf",transparent:!0,opacity:0,toneMapped:!1,blending:Qr,depthWrite:!1})]})]})}const tc=600,um=2.4;let cm=1;function fm(){const[n,i]=M.useState([]),l=M.useRef(null);return M.useEffect(()=>pe.subscribe(c=>{const f=c.selectedSessionId,d=l.current;if(f===d||(l.current=f,!f))return;const h=c.sessions[f];if(!h)return;const v=Kr(h.orbitSlot),y=is(h.orbitSlot,h.id,h.projectId),p=Math.cos(y)*v,m=Math.sin(y)*v;i(E=>[...E,{id:cm++,position:[p,0,m],spawnedAt:performance.now()}])}),[]),je(()=>{const o=performance.now();i(c=>{const f=c.filter(d=>o-d.spawnedAt<tc+50);return f.length===c.length?c:f})}),T.jsx(T.Fragment,{children:n.map(o=>T.jsx(dm,{spec:o},o.id))})}function dm({spec:n}){const i=M.useRef(null);return je(()=>{if(!i.current)return;const l=(performance.now()-n.spawnedAt)/tc;if(l>1){i.current.visible=!1;return}const c=(1-Math.pow(1-l,2))*um;i.current.scale.set(c,c,c);const f=i.current.material;f.opacity=(1-l)*.65}),T.jsxs("mesh",{ref:i,position:n.position,rotation:[-Math.PI/2,0,0],children:[T.jsx("ringGeometry",{args:[.92,1,48]}),T.jsx("meshBasicMaterial",{color:"#a5b4fc",transparent:!0,opacity:.65,toneMapped:!1,depthWrite:!1})]})}const pm="/textures/milky_way.jpg";function Sm(){const n=pe(wu),i=pe(Mu),l=pe(h=>h.selectSession),o=pe(h=>h.selectAdvisor),c=pe(h=>h.selectSkill),f=[...n,...i],d=Array.from(new Set(f.map(h=>h.orbitSlot))).sort((h,v)=>h-v);return T.jsxs(Nd,{shadows:!1,camera:{position:[16,9,32],fov:55,near:.1,far:600},gl:{toneMapping:mu,toneMappingExposure:.85},onPointerMissed:()=>{l(null),o(null),c(null)},children:[T.jsx("color",{attach:"background",args:["#05060c"]}),T.jsx("fog",{attach:"fog",args:["#0a0d1f",140,500]}),T.jsx("ambientLight",{intensity:.12}),T.jsx(M.Suspense,{fallback:T.jsx(rp,{radius:180,depth:80,count:6e3,factor:4,saturation:.4,fade:!0,speed:0}),children:T.jsx(hm,{})}),T.jsx(im,{}),T.jsx(Dh,{}),T.jsx(lm,{}),T.jsx(Rh,{}),T.jsx(Zh,{}),T.jsx(tm,{}),d.map(h=>T.jsx(Hh,{orbitSlot:h},h)),f.map(h=>T.jsx(bh,{session:h},h.id)),T.jsx(Qh,{}),T.jsx(fm,{}),T.jsx(nm,{}),T.jsx(mm,{}),T.jsx(Eh,{multisampling:4,children:T.jsx(Th,{intensity:.85,luminanceThreshold:.7,luminanceSmoothing:.2,mipmapBlur:!0,radius:.55})})]})}function hm(){const n=M.useRef(null),i=qo(pm);return T.jsxs("mesh",{ref:n,scale:[-1,1,1],children:[T.jsx("sphereGeometry",{args:[400,48,32]}),T.jsx("meshBasicMaterial",{map:i,side:cr,toneMapped:!1})]})}function mm(){const n=M.useRef(null),{camera:i}=St();return M.useEffect(()=>(Ff(n.current,i),()=>bf()),[i]),T.jsx(ep,{ref:n,makeDefault:!0,enablePan:!0,enableZoom:!0,enableRotate:!0,minDistance:6,maxDistance:140,target:[0,0,0]})}export{Sm as Scene};
@@ -1 +1 @@
1
- import{a9 as n,r,j as s}from"./index-BUrmJuUb.js";const P=[1,4,16,64];function S({open:l,onClose:u}){const e=n(t=>t.playback),m=n(t=>t.enterPlayback),v=n(t=>t.exitPlayback),o=n(t=>t.setPlaybackTime),f=n(t=>t.setPlaybackSpeed),p=n(t=>t.setPlaybackPlaying),x=n(t=>t.setPlaybackLoading),[i,g]=r.useState(30);r.useEffect(()=>{if(!l||e.active&&e.events.length>0)return;x(!0);const t=Date.now()-i*60*1e3;fetch(`/api/timeline?sinceMs=${t}&untilMs=${Date.now()}`).then(a=>a.json()).then(a=>{if(a.events.length===0){x(!1),m([],Date.now()-6e4,Date.now());return}m(a.events,a.earliest,a.latest)}).catch(a=>{console.warn("[timeline] fetch failed",a),x(!1)})},[l,i]);const c=r.useRef(0);if(r.useEffect(()=>{if(!e.active||!e.playing)return;let t=0;const a=h=>{const N=c.current?h-c.current:16;c.current=h;const b=e.currentMs+N*e.speed;b>=e.latestMs?(o(e.latestMs),p(!1)):(o(b),t=requestAnimationFrame(a))};return t=requestAnimationFrame(a),()=>{cancelAnimationFrame(t),c.current=0}},[e.active,e.playing,e.speed,e.latestMs]),!l)return null;const j=()=>{v(),u()},y=Math.max(1,e.latestMs-e.earliestMs),k=e.active?(e.currentMs-e.earliestMs)/y*100:0,M=e.events.filter(t=>t.ts<=e.currentMs);return s.jsx("div",{className:"absolute bottom-0 inset-x-0 z-30 bg-solix-panel/95 backdrop-blur border-t border-solix-border",children:s.jsxs("div",{className:"px-4 py-3 max-w-6xl mx-auto",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs uppercase tracking-widest text-solix-accent",children:"▸ Playback"}),s.jsxs("span",{className:"text-[10px] text-slate-400",children:[e.events.length," events · last ",i," min"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{value:i,onChange:t=>g(parseInt(t.target.value,10)),className:"text-[10px] bg-black/40 border border-solix-border rounded px-1.5 py-0.5 text-slate-300",children:[s.jsx("option",{value:5,children:"5 min"}),s.jsx("option",{value:15,children:"15 min"}),s.jsx("option",{value:30,children:"30 min"}),s.jsx("option",{value:60,children:"1 hour"}),s.jsx("option",{value:180,children:"3 hours"})]}),s.jsx("button",{onClick:j,className:"text-slate-400 hover:text-slate-100 text-xs",children:"✕ Live"})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:()=>p(!e.playing),disabled:!e.active||e.events.length===0,className:"w-8 h-8 rounded-full bg-solix-accent/20 border border-solix-accent text-solix-accent text-sm hover:bg-solix-accent/30 disabled:opacity-40 flex items-center justify-center",children:e.playing?"⏸":"▶"}),s.jsxs("div",{className:"flex-1 relative",children:[s.jsx("input",{type:"range",min:e.earliestMs,max:e.latestMs,value:e.currentMs,onChange:t=>o(parseInt(t.target.value,10)),className:"w-full",disabled:!e.active}),s.jsx("div",{className:"absolute -top-1.5 h-0.5 bg-solix-accent/40 pointer-events-none",style:{left:0,width:`${k}%`}})]}),s.jsx("div",{className:"flex items-center gap-1",children:P.map(t=>s.jsxs("button",{onClick:()=>f(t),className:`text-[10px] px-1.5 py-0.5 rounded border ${e.speed===t?"bg-solix-accent/20 border-solix-accent text-solix-accent":"border-solix-border text-slate-400 hover:text-slate-200"}`,children:[t,"×"]},t))})]}),s.jsxs("div",{className:"mt-2 flex items-center justify-between text-[10px] text-slate-500 font-mono",children:[s.jsx("span",{children:d(e.earliestMs)}),s.jsxs("span",{className:"text-solix-accent",children:[d(e.currentMs)," · ",M.length," events"]}),s.jsx("span",{children:d(e.latestMs)})]}),e.loading&&s.jsx("div",{className:"text-center text-xs text-slate-500 italic mt-2",children:"Loading timeline…"}),!e.loading&&e.events.length===0&&e.active&&s.jsx("div",{className:"text-center text-xs text-slate-500 italic mt-2",children:"No events in this range. Try a longer window or run some agents first."})]})})}function d(l){return l?new Date(l).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"—"}export{S as TimelineDrawer};
1
+ import{a9 as n,r,j as s}from"./index-2P2elsQX.js";const P=[1,4,16,64];function S({open:l,onClose:u}){const e=n(t=>t.playback),m=n(t=>t.enterPlayback),v=n(t=>t.exitPlayback),o=n(t=>t.setPlaybackTime),f=n(t=>t.setPlaybackSpeed),p=n(t=>t.setPlaybackPlaying),x=n(t=>t.setPlaybackLoading),[i,g]=r.useState(30);r.useEffect(()=>{if(!l||e.active&&e.events.length>0)return;x(!0);const t=Date.now()-i*60*1e3;fetch(`/api/timeline?sinceMs=${t}&untilMs=${Date.now()}`).then(a=>a.json()).then(a=>{if(a.events.length===0){x(!1),m([],Date.now()-6e4,Date.now());return}m(a.events,a.earliest,a.latest)}).catch(a=>{console.warn("[timeline] fetch failed",a),x(!1)})},[l,i]);const c=r.useRef(0);if(r.useEffect(()=>{if(!e.active||!e.playing)return;let t=0;const a=h=>{const N=c.current?h-c.current:16;c.current=h;const b=e.currentMs+N*e.speed;b>=e.latestMs?(o(e.latestMs),p(!1)):(o(b),t=requestAnimationFrame(a))};return t=requestAnimationFrame(a),()=>{cancelAnimationFrame(t),c.current=0}},[e.active,e.playing,e.speed,e.latestMs]),!l)return null;const j=()=>{v(),u()},y=Math.max(1,e.latestMs-e.earliestMs),k=e.active?(e.currentMs-e.earliestMs)/y*100:0,M=e.events.filter(t=>t.ts<=e.currentMs);return s.jsx("div",{className:"absolute bottom-0 inset-x-0 z-30 bg-solix-panel/95 backdrop-blur border-t border-solix-border",children:s.jsxs("div",{className:"px-4 py-3 max-w-6xl mx-auto",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-xs uppercase tracking-widest text-solix-accent",children:"▸ Playback"}),s.jsxs("span",{className:"text-[10px] text-slate-400",children:[e.events.length," events · last ",i," min"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{value:i,onChange:t=>g(parseInt(t.target.value,10)),className:"text-[10px] bg-black/40 border border-solix-border rounded px-1.5 py-0.5 text-slate-300",children:[s.jsx("option",{value:5,children:"5 min"}),s.jsx("option",{value:15,children:"15 min"}),s.jsx("option",{value:30,children:"30 min"}),s.jsx("option",{value:60,children:"1 hour"}),s.jsx("option",{value:180,children:"3 hours"})]}),s.jsx("button",{onClick:j,className:"text-slate-400 hover:text-slate-100 text-xs",children:"✕ Live"})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:()=>p(!e.playing),disabled:!e.active||e.events.length===0,className:"w-8 h-8 rounded-full bg-solix-accent/20 border border-solix-accent text-solix-accent text-sm hover:bg-solix-accent/30 disabled:opacity-40 flex items-center justify-center",children:e.playing?"⏸":"▶"}),s.jsxs("div",{className:"flex-1 relative",children:[s.jsx("input",{type:"range",min:e.earliestMs,max:e.latestMs,value:e.currentMs,onChange:t=>o(parseInt(t.target.value,10)),className:"w-full",disabled:!e.active}),s.jsx("div",{className:"absolute -top-1.5 h-0.5 bg-solix-accent/40 pointer-events-none",style:{left:0,width:`${k}%`}})]}),s.jsx("div",{className:"flex items-center gap-1",children:P.map(t=>s.jsxs("button",{onClick:()=>f(t),className:`text-[10px] px-1.5 py-0.5 rounded border ${e.speed===t?"bg-solix-accent/20 border-solix-accent text-solix-accent":"border-solix-border text-slate-400 hover:text-slate-200"}`,children:[t,"×"]},t))})]}),s.jsxs("div",{className:"mt-2 flex items-center justify-between text-[10px] text-slate-500 font-mono",children:[s.jsx("span",{children:d(e.earliestMs)}),s.jsxs("span",{className:"text-solix-accent",children:[d(e.currentMs)," · ",M.length," events"]}),s.jsx("span",{children:d(e.latestMs)})]}),e.loading&&s.jsx("div",{className:"text-center text-xs text-slate-500 italic mt-2",children:"Loading timeline…"}),!e.loading&&e.events.length===0&&e.active&&s.jsx("div",{className:"text-center text-xs text-slate-500 italic mt-2",children:"No events in this range. Try a longer window or run some agents first."})]})})}function d(l){return l?new Date(l).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"—"}export{S as TimelineDrawer};