@shmulikdav/solix 1.9.2 → 1.10.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.
- package/dist/index.js +10 -2
- package/dist/web/assets/CrewPanel-DtihGk3R.js +1 -0
- package/dist/web/assets/{GalaxyPanel-De7wiIUu.js → GalaxyPanel-CdPijHA4.js} +1 -1
- package/dist/web/assets/{Scene-BBqSunvy.js → Scene-D50tNcep.js} +35 -35
- package/dist/web/assets/{TimelineDrawer-ir15gAsB.js → TimelineDrawer-BfnNVtiR.js} +1 -1
- package/dist/web/assets/WorkspacePanel-DSD8Z7ji.js +1 -0
- package/dist/web/assets/{index-B7iNHKuu.js → index-ClXfIDav.js} +31 -31
- package/dist/web/assets/index-DwYWrIM8.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/CrewPanel-B3iYTtoI.js +0 -1
- package/dist/web/assets/index-BBrwq4bN.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aj as n,r,j as s}from"./index-ClXfIDav.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aj as x,aF as g,r as m,j as e}from"./index-ClXfIDav.js";const u=l=>`$${l.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`,v=l=>Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}).format(l);function r({label:l,value:a,hint:s}){return e.jsxs("div",{className:"rounded-lg border border-solix-border bg-black/20 p-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-slate-400",children:l}),e.jsx("div",{className:"mt-1 text-xl font-semibold tabular-nums text-slate-100",children:a}),s?e.jsx("div",{className:"text-[11px] text-slate-500 mt-0.5",children:s}):null]})}function o({n:l,label:a,color:s}){return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${s}`}),e.jsx("span",{className:"tabular-nums font-medium text-slate-200",children:l}),e.jsx("span",{className:"text-slate-500",children:a})]})}function f({open:l,onClose:a}){const s=x(g),p=x(t=>t.selectSession),[c,d]=m.useState(null);if(m.useEffect(()=>{if(!l)return;let t=!1;return Promise.all([fetch("/api/audit?kind=permission_approved").then(i=>i.ok?i.json():Promise.resolve([])),fetch("/api/audit?kind=permission_denied").then(i=>i.ok?i.json():Promise.resolve([]))]).then(([i,j])=>{t||d(i.length+j.length)}).catch(()=>{t||d(null)}),()=>{t=!0}},[l]),!l)return null;const n=s.missions,h=[["done",n.completed],["failed",n.failed],["active",n.active],["cancelled",n.cancelled]];return e.jsxs("div",{className:"absolute top-16 right-0 bottom-0 w-full sm:w-[480px] bg-solix-panel border-l border-solix-border backdrop-blur-md flex flex-col z-30",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-solix-border flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-solix-accent",children:"Mission Control"}),e.jsx("div",{className:"text-lg font-semibold",children:"Your workspace"}),e.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[s.sessionCount," sessions · ",s.projectCount," projects ·"," ",s.advisorCount," advisors · ",s.skillCount," skills"]})]}),e.jsx("button",{onClick:a,className:"text-slate-400 hover:text-slate-100",children:"✕"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(r,{label:"Total spend",value:u(s.totalSpendUsd)}),e.jsx(r,{label:"Total tokens",value:v(s.totalTokens)}),e.jsx(r,{label:"Cost / mission",value:u(s.costPerCompletedMission),hint:`${s.completedMissions} completed`}),e.jsx(r,{label:"Interventions",value:c===null?"—":String(c),hint:`${s.pendingPermissions} pending now`})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-slate-500 mb-2",children:"Status"}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsx(o,{n:s.activeCount,label:"active",color:"bg-solix-ok"}),e.jsx(o,{n:s.attentionCount,label:"need you",color:"bg-solix-danger"}),e.jsx(o,{n:s.idleCount,label:"idle",color:"bg-slate-600"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-slate-500 mb-2",children:"Missions"}),e.jsx("div",{className:"grid grid-cols-4 gap-2 text-center",children:h.map(([t,i])=>e.jsxs("div",{className:"rounded border border-solix-border bg-black/20 py-2",children:[e.jsx("div",{className:"text-lg font-semibold tabular-nums",children:i}),e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:t})]},t))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-slate-500 mb-2",children:"Context pressure"}),e.jsxs("div",{className:"text-sm text-slate-300 tabular-nums",children:["avg ",Math.round(s.contextAvgPct),"% · max"," ",e.jsxs("span",{className:s.contextMaxPct>=85?"text-solix-danger font-medium":"",children:[Math.round(s.contextMaxPct),"%"]}),s.contextMaxPct>=85?e.jsxs("span",{className:"text-solix-danger",children:[" ","— an agent is near its limit"]}):null]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-slate-500 mb-2",children:["Needs you (",s.needsYou.length,")"]}),s.needsYou.length===0?e.jsx("div",{className:"text-sm text-slate-500",children:"Nothing waiting — the fleet is running itself."}):e.jsx("div",{className:"space-y-1.5",children:s.needsYou.map(t=>e.jsx("button",{onClick:()=>p(t.id),className:"w-full text-left rounded border border-solix-danger/40 bg-solix-danger/5 px-3 py-2 hover:bg-solix-danger/10",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-slate-100 truncate",children:t.name??t.id.slice(0,8)}),e.jsx("span",{className:"text-[11px] uppercase tracking-wide text-solix-danger whitespace-nowrap",children:t.status.replace(/_/g," ")})]})},t.id))})]})]})]})}export{f as WorkspacePanel};
|