agi-farm 1.2.5 → 1.3.3
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/dashboard-dist/assets/Agents-Bovx0mKi.js +1 -0
- package/dashboard-dist/assets/Alerts-TfW5ABV3.js +1 -0
- package/dashboard-dist/assets/Approvals-DjkmjBWA.js +1 -0
- package/dashboard-dist/assets/{Broadcast-i_oNaV_l.js → Broadcast-DsLcKkuU.js} +1 -1
- package/dashboard-dist/assets/Budget-DbFU1nzj.js +1 -0
- package/dashboard-dist/assets/Comms-CKh5xUB7.js +4 -0
- package/dashboard-dist/assets/{Crons-CAzkm2a1.js → Crons-DTFPlfOv.js} +1 -1
- package/dashboard-dist/assets/{HITL-BNQCsqP8.js → HITL-C9ecN_-W.js} +1 -1
- package/dashboard-dist/assets/Jobs-Cf9UYZmJ.js +1 -0
- package/dashboard-dist/assets/Knowledge-Cy_ZdY_G.js +1 -0
- package/dashboard-dist/assets/Overview-Boc7TOlC.js +2 -0
- package/dashboard-dist/assets/Projects-CT2nZTrB.js +2 -0
- package/dashboard-dist/assets/RD-Bwj8sxyi.js +1 -0
- package/dashboard-dist/assets/Tasks-Dcjhiktm.js +1 -0
- package/dashboard-dist/assets/Velocity-CKlz5-iP.js +1 -0
- package/dashboard-dist/assets/charts-C5TghfcA.js +36 -0
- package/dashboard-dist/assets/index-Bjt1AMWV.js +2 -0
- package/dashboard-dist/assets/index-Dz5_3d0J.css +1 -0
- package/dashboard-dist/index.html +2 -2
- package/openclaw.plugin.json +2 -2
- package/package.json +1 -1
- package/scripts/setup.js +38 -0
- package/scripts/status.js +23 -1
- package/server/dashboard.js +460 -3
- package/server/services/feature-flags.js +14 -6
- package/server/services/intake.js +153 -0
- package/server/services/jobs.js +12 -2
- package/server/services/projects.js +166 -0
- package/server/services/tasks.js +163 -0
- package/server/services/timeline.js +71 -0
- package/dashboard-dist/assets/Agents-CydB8cBc.js +0 -1
- package/dashboard-dist/assets/Alerts-ChDOowdj.js +0 -1
- package/dashboard-dist/assets/Approvals-CTRwtSyW.js +0 -1
- package/dashboard-dist/assets/Budget-D8f3izqR.js +0 -1
- package/dashboard-dist/assets/Comms--p3LCcSm.js +0 -4
- package/dashboard-dist/assets/Jobs-C4mv1RaH.js +0 -1
- package/dashboard-dist/assets/Knowledge-hFyeo3xe.js +0 -1
- package/dashboard-dist/assets/Overview-OVGZf4_H.js +0 -2
- package/dashboard-dist/assets/Projects-BBOHTOLq.js +0 -2
- package/dashboard-dist/assets/RD-DRBHxZUS.js +0 -1
- package/dashboard-dist/assets/Tasks-DRoPjbjW.js +0 -1
- package/dashboard-dist/assets/Velocity-C1jcs0W8.js +0 -1
- package/dashboard-dist/assets/charts-BhPBsBGB.js +0 -36
- package/dashboard-dist/assets/index-BRfU2jhh.js +0 -2
- package/dashboard-dist/assets/index-DaVmOqH2.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as h,a4 as e}from"./vendor-5MxLWm27.js";import{a as R}from"./index-Bjt1AMWV.js";import{L as w}from"./LastUpdated-BVeFtHFH.js";function A({minutes:t}){const n=t??999,s=n<5?"var(--green)":n<15?"var(--amber)":"var(--red)",i=n<999?`${n}m ago`:"STALE",o=Math.max(0,Math.min(100,100-n/60*100));return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,color:"var(--muted)",marginBottom:4,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsx("span",{children:"PULSE_SIGNAL"}),e.jsx("span",{style:{color:s},children:i})]}),e.jsx("div",{style:{height:4,background:"rgba(255,255,255,0.04)",borderRadius:2,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${o}%`,background:s,boxShadow:`0 0 8px ${s}44`,borderRadius:2,transition:"width 1s ease"}})})]})}function T({active:t,total:n,size:s=36}){const i=n>0?t/n*100:0,o=i>80?"var(--red)":i>40?"var(--amber)":"var(--cyan)",l=(s-6)/2,d=2*Math.PI*l,c=d*(i/100);return e.jsxs("div",{style:{position:"relative",width:s,height:s,flexShrink:0},children:[e.jsxs("svg",{width:s,height:s,style:{transform:"rotate(-90deg)",filter:`drop-shadow(0 0 4px ${o}33)`},children:[e.jsx("circle",{cx:s/2,cy:s/2,r:l,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:5}),e.jsx("circle",{cx:s/2,cy:s/2,r:l,fill:"none",stroke:o,strokeWidth:5,strokeDasharray:`${c} ${d}`,strokeLinecap:"round",style:{transition:"stroke-dasharray 0.8s ease"}})]}),e.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:9,fontWeight:900,color:o,fontFamily:"JetBrains Mono, monospace"},children:t})]})}function L({task:t}){if(!t)return e.jsx("div",{style:{padding:"8px 12px",background:"rgba(255,255,255,0.01)",borderRadius:8,border:"1px dashed rgba(255,255,255,0.05)",fontSize:10,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:"STATUS: IDLE // AWAITING_DIRECTIVE"});const n=(t.sla?.priority||t.priority||"").toUpperCase(),s=n==="P1"?"var(--red)":n==="P2"?"var(--amber)":"var(--cyan)";return e.jsxs("div",{style:{padding:"8px 12px",background:"rgba(0,240,255,0.03)",borderRadius:8,border:"1px solid rgba(0,240,255,0.12)"},children:[e.jsx("div",{style:{fontSize:8,color:"var(--cyan)",fontWeight:800,fontFamily:"JetBrains Mono, monospace",marginBottom:4},children:"▶ ACTIVE_CYCLE"}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n&&e.jsx("span",{style:{fontSize:8,padding:"2px 6px",borderRadius:3,background:`${s}15`,color:s,border:`1px solid ${s}44`,fontWeight:800},children:n}),e.jsx("span",{style:{fontSize:11,fontWeight:700,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.title})]}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",marginTop:4,fontFamily:"JetBrains Mono, monospace"},children:t.id})]})}function N({tasks:t}){const[n,s]=h.useState(!1);if(!t.length)return null;const i={complete:"var(--green)",failed:"var(--red)",blocked:"var(--amber)"};return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>s(o=>!o),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",fontSize:9,fontFamily:"JetBrains Mono, monospace",fontWeight:700,padding:0,display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{color:n?"var(--cyan)":"var(--muted)",transition:"color 0.2s"},children:n?"▾":"▸"}),"RECENT_CYCLES [",t.length,"]"]}),n&&e.jsx("div",{style:{marginTop:8,display:"flex",flexDirection:"column",gap:4},children:t.map(o=>{const l=i[o.status]||"var(--muted)";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",background:"rgba(255,255,255,0.01)",borderRadius:6,borderLeft:`2px solid ${l}`},children:[e.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:l,boxShadow:`0 0 4px ${l}`,flexShrink:0}}),e.jsx("span",{style:{flex:1,fontSize:10,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.title}),e.jsx("span",{style:{fontSize:9,color:l,fontWeight:800,fontFamily:"JetBrains Mono, monospace"},children:o.status.toUpperCase()})]},o.id)})})]})}function F({data:t,lastUpdated:n,toast:s}){const{agents:i=[],tasks:o=[],cache_age_seconds:l}=t||{},d=l??null,[c,f]=h.useState(""),[g,b]=h.useState("all"),v=i.filter(r=>{const x=c.toLowerCase(),y=!c||(r.name||"").toLowerCase().includes(x)||(r.id||"").toLowerCase().includes(x)||(r.role||"").toLowerCase().includes(x),j=g==="all"||r.status===g;return y&&j}),u=i.filter(r=>r.status==="active"||r.status==="busy").length,p=i.filter(r=>r.status==="error").length,m=i.filter(r=>r.status==="available").length;return e.jsxs("div",{className:"fade-in",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:20,gap:12,flexWrap:"wrap"},children:[e.jsx("input",{className:"input-base",placeholder:"FILTER NEURAL SIGNATURES...",value:c,onChange:r=>f(r.target.value),style:{flex:"0 1 220px",background:"rgba(0,0,0,0.2)",border:"1px solid var(--border)",fontFamily:"JetBrains Mono, monospace",fontSize:10}}),e.jsxs("select",{value:g,onChange:r=>b(r.target.value),style:{background:"rgba(0,0,0,0.2)",border:"1px solid var(--border)",color:"var(--text)",borderRadius:6,padding:"5px 10px",fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsx("option",{value:"all",children:"ALL_STATUS"}),e.jsx("option",{value:"active",children:"ACTIVE"}),e.jsx("option",{value:"available",children:"AVAILABLE"}),e.jsx("option",{value:"busy",children:"BUSY"}),e.jsx("option",{value:"error",children:"ERROR"})]}),e.jsxs("div",{style:{display:"flex",gap:10,fontSize:9,fontFamily:"JetBrains Mono, monospace",fontWeight:800},children:[e.jsxs("span",{style:{color:"var(--cyan)"},children:["◈ ",u," ACTIVE"]}),e.jsxs("span",{style:{color:"var(--muted)"},children:["○ ",m," IDLE"]}),p>0&&e.jsxs("span",{style:{color:"var(--red)",animation:"pulse 1.5s infinite"},children:["⚠ ",p," ERROR"]})]}),d!=null&&e.jsxs("span",{style:{fontSize:9,color:d>25?"var(--amber)":"var(--muted)",fontFamily:"monospace"},children:["[CACHE: ",d,"s]"]}),e.jsx("div",{style:{marginLeft:"auto"},children:e.jsx(w,{ts:n})})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(330px,1fr))",gap:18},children:v.map((r,x)=>e.jsx(M,{agent:r,tasks:o,toast:s,index:x},r.id))})]})}function M({agent:t,tasks:n,toast:s,index:i}){const[o,l]=h.useState(!1),[d,c]=h.useState(""),[f,g]=h.useState(!1),b={active:"dot-active",available:"dot-available",busy:"dot-busy",error:"dot-error"}[t.status]||"dot-offline",v={active:"badge-active",available:"badge-available",busy:"badge-busy",error:"badge-error"}[t.status]||"badge-offline",u=t.credibility??1,p=n.filter(a=>a.assigned_to===t.id),m=p.find(a=>a.status==="in-progress"),r=p.filter(a=>["complete","failed","blocked"].includes(a.status)).slice(-3).reverse(),x=p.filter(a=>["in-progress","blocked","needs_human_decision"].includes(a.status)).length,y=p.length,j=t.status==="error",k=p.some(a=>a.status==="needs_human_decision"),E=j?"rgba(255,42,85,0.5)":k?"rgba(181,53,255,0.4)":m?"rgba(0,240,255,0.15)":"var(--border)",I=async()=>{if(d.trim()){g(!0);try{await R(`/api/comms/${t.id}/send`,{message:d.trim()}),s(`Transmission sent to ${t.name}`,"success"),c(""),l(!1)}catch(a){s(a.message,"error")}g(!1)}};return e.jsxs("div",{className:"card fade-in",style:{animationDelay:`${i*.04}s`,display:"flex",flexDirection:"column",gap:14,borderColor:E,padding:20},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[e.jsx("div",{style:{width:48,height:48,borderRadius:"50%",background:"rgba(181,83,255,0.05)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:24,border:`1px solid ${E}`,boxShadow:"inset 0 0 15px rgba(181,83,255,0.1)",flexShrink:0},children:t.emoji||"🤖"}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontWeight:900,fontSize:15,color:"var(--text)",fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.02em"},children:t.name.toUpperCase()}),e.jsxs("div",{style:{fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontWeight:700,marginTop:2},children:[t.role," // ",t.id]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:6},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{className:`dot ${b}`,style:{width:6,height:6}}),e.jsx("span",{className:`badge ${v}`,children:t.status})]}),t.inbox_count>0&&e.jsxs("div",{style:{fontSize:9,color:"var(--purple)",fontWeight:800,animation:"pulse 2s infinite"},children:["📬 ",t.inbox_count]})]}),e.jsx(T,{active:x,total:Math.max(y,1)})]}),e.jsx(L,{task:m}),k&&e.jsx("div",{style:{padding:"6px 10px",background:"rgba(181,53,255,0.08)",border:"1px solid rgba(181,53,255,0.3)",borderRadius:6,fontSize:9,fontWeight:800,color:"var(--purple)",fontFamily:"JetBrains Mono, monospace"},children:"🚨 HITL_DECISION_REQUIRED // AWAITING_HUMAN_GATE"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},children:[e.jsx(C,{label:"SUCCESS",value:t.tasks_completed??0,color:"var(--green)"}),e.jsx(C,{label:"FAILURE",value:t.tasks_failed??0,color:"var(--red)"}),e.jsx(C,{label:"QUALITY",value:(t.quality_score||0).toFixed(1),color:"var(--amber)"})]}),e.jsxs("div",{style:{background:"rgba(0,0,0,0.2)",padding:"10px 12px",borderRadius:10,border:"1px solid var(--border)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,fontWeight:700,color:"var(--muted)",marginBottom:6,fontFamily:"JetBrains Mono, monospace"},children:[e.jsx("span",{children:"NEURAL_CREDIBILITY"}),e.jsxs("span",{style:{color:"var(--text)"},children:[(u*100).toFixed(0),"%"]})]}),e.jsx("div",{style:{height:6,display:"flex",gap:2},children:[...Array(10)].map((a,S)=>e.jsx("div",{style:{flex:1,height:"100%",borderRadius:1,background:S/10<u?"var(--cyan)":"rgba(255,255,255,0.03)",boxShadow:S/10<u?"0 0 5px var(--cyan)":"none"}},S))})]}),e.jsx(A,{minutes:t.heartbeat_age_minutes}),e.jsxs("div",{style:{fontSize:10,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",lineHeight:1.6},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{children:"MODEL:"}),e.jsx("span",{style:{color:"var(--cyan)"},children:t.model||"—"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{children:"ASSIGNED:"}),e.jsxs("span",{children:[y," CYCLES"]})]})]}),t.specializations?.length>0&&e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:5},children:t.specializations.map(a=>e.jsx("span",{style:{fontSize:8,fontWeight:700,padding:"3px 7px",background:"rgba(0,240,255,0.03)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.1)",borderRadius:4,textTransform:"uppercase"},children:a},a))}),e.jsx(N,{tasks:r}),e.jsx("div",{style:{marginTop:"auto",paddingTop:12,borderTop:"1px solid var(--border)"},children:o?e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("input",{className:"input-base",style:{flex:1,background:"rgba(0,0,0,0.3)"},placeholder:"SEND TRANSMISSION...",value:d,onChange:a=>c(a.target.value),onKeyDown:a=>a.key==="Enter"&&I(),maxLength:2e3}),e.jsx("button",{className:"btn-primary",onClick:I,disabled:f||!d.trim(),children:f?"...":"SEND"}),e.jsx("button",{className:"input-base",style:{cursor:"pointer",padding:"6px 12px",background:"rgba(255,255,255,0.05)"},onClick:()=>l(!1),children:"✕"})]}):e.jsx("button",{className:"btn-primary",style:{width:"100%",background:"rgba(255,255,255,0.03)",border:"1px solid var(--border)",color:"var(--muted)",letterSpacing:"0.05em",fontSize:10},onClick:()=>l(!0),children:"OPEN TRANSMISSION CHANNEL"})})]})}function C({label:t,value:n,color:s="var(--text)"}){return e.jsxs("div",{style:{textAlign:"center",padding:"10px 8px",background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.04)",borderRadius:10},children:[e.jsx("div",{className:"section-title",style:{fontSize:8,marginBottom:5,letterSpacing:"0.1em"},children:t}),e.jsx("div",{style:{fontSize:18,fontWeight:800,color:s,fontFamily:"Rajdhani, sans-serif"},children:n})]})}export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as f,a4 as r}from"./vendor-5MxLWm27.js";import{L as j}from"./LastUpdated-BVeFtHFH.js";const h={critical:"var(--red)",high:"var(--red)",medium:"var(--amber)",low:"var(--muted)"},y={hitl:"🚨",sla_breach:"⏰",agent_error:"🔴",cron_error:"⚙️",blocked:"🚫"},g={hitl:"HITL",sla_breach:"SLA",agent_error:"Agent",cron_error:"Cron",blocked:"Blocked"};function S(n){if(!n)return"";try{const s=Math.round((Date.now()-new Date(n))/6e4);return s<1?"just now":s<60?`${s}m ago`:`${Math.round(s/60)}h ago`}catch{return""}}function _({data:n,lastUpdated:s}){const{alerts:o=[],agents:u=[]}=n||{},[a,p]=f.useState(new Set),[t,v]=f.useState("all"),x=o.filter(e=>!a.has(e.id)),m=x.filter(e=>t==="all"||e.type===t),b=["all",...new Set(o.map(e=>e.type))],d={critical:0,high:0,medium:0,low:0};return x.forEach(e=>{d[e.severity]!==void 0&&d[e.severity]++}),r.jsxs("div",{className:"fade-in",style:{display:"grid",gap:14},children:[r.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:10},children:Object.entries(d).map(([e,i])=>r.jsxs("div",{className:"card",style:{textAlign:"center"},children:[r.jsx("div",{className:"section-title",style:{textTransform:"capitalize"},children:e}),r.jsx("div",{style:{fontSize:22,fontWeight:700,color:i?h[e]:"var(--muted)"},children:i})]},e))}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[b.map(e=>r.jsxs("button",{onClick:()=>v(e),style:{background:t===e?"rgba(0,229,255,.15)":"var(--surface)",border:`1px solid ${t===e?"rgba(0,229,255,.4)":"var(--border)"}`,color:t===e?"var(--cyan)":"var(--muted)",padding:"4px 12px",borderRadius:4,fontSize:11,cursor:"pointer",fontFamily:"inherit"},children:[y[e]||""," ",g[e]||e]},e)),a.size>0&&r.jsxs("button",{onClick:()=>p(new Set),style:{marginLeft:"auto",background:"none",border:"1px solid var(--border)",color:"var(--muted)",padding:"4px 10px",borderRadius:4,fontSize:11,cursor:"pointer",fontFamily:"inherit"},children:["↺ Restore ",a.size," dismissed"]}),r.jsx(j,{ts:s})]}),m.length===0&&r.jsxs("div",{className:"card",style:{color:"var(--green)",fontSize:13},children:["✅ ",o.length===0?"No alerts — all systems nominal.":"All alerts dismissed for this session."]}),m.map(e=>{const i=h[e.severity]||"var(--muted)",l=u.find(c=>c.id===e.agent_id);return r.jsxs("div",{style:{background:"var(--bg2)",borderRadius:8,border:`1px solid ${i}44`,boxShadow:`0 0 12px ${i}0d`,display:"flex",gap:14,padding:"14px 16px",alignItems:"flex-start"},children:[r.jsx("span",{style:{fontSize:22,flexShrink:0},children:y[e.type]||"⚠️"}),r.jsxs("div",{style:{flex:1,minWidth:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"},children:[r.jsx("span",{style:{fontWeight:700,fontSize:13},children:e.title}),r.jsx("span",{style:{fontSize:10,padding:"1px 6px",borderRadius:3,fontWeight:700,textTransform:"uppercase",color:i,background:`${i}18`,border:`1px solid ${i}44`},children:e.severity})]}),e.detail&&r.jsx("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5,marginBottom:4},children:e.detail}),r.jsxs("div",{style:{fontSize:10,color:"var(--muted)",display:"flex",gap:10},children:[l&&r.jsxs("span",{children:[l.emoji," ",l.name]}),r.jsx("span",{children:g[e.type]}),r.jsx("span",{children:S(e.ts)}),e.task_id&&r.jsx("span",{style:{color:"var(--cyan)"},children:e.task_id}),e.cron_id&&r.jsxs("span",{style:{color:"var(--cyan)",fontFamily:"monospace",fontSize:9},children:[e.cron_id.slice(0,8),"…"]})]})]}),r.jsx("button",{onClick:()=>p(c=>new Set([...c,e.id])),title:"Dismiss alert",style:{background:"none",border:"1px solid var(--border)",color:"var(--muted)",padding:"3px 8px",borderRadius:4,cursor:"pointer",fontSize:10,fontFamily:"inherit",flexShrink:0},children:"✕"})]},e.id)})]})}export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as v,a4 as r}from"./vendor-5MxLWm27.js";import{L as x}from"./LastUpdated-BVeFtHFH.js";import{g as u,h}from"./index-Bjt1AMWV.js";function b({data:t,lastUpdated:i}){const{approvals:n=[],featureFlags:o={}}=t||{},[s,l]=v.useState({});if(!o.approvals)return r.jsx("div",{className:"card",children:"Approvals feature is disabled. Enable `featureApprovals` in plugin config."});const a=n.filter(e=>e.status==="pending");async function d(e){try{await u(e,s[e]||"")}catch{}}async function p(e){try{await h(e,s[e]||"")}catch{}}return r.jsxs("div",{className:"fade-in",style:{display:"grid",gap:14},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[r.jsxs("div",{className:"section-title",style:{marginBottom:0},children:["Approvals (",a.length," pending)"]}),r.jsx(x,{ts:i})]}),a.length===0&&r.jsx("div",{className:"card",style:{color:"var(--muted)"},children:"No pending approvals."}),a.map(e=>r.jsxs("div",{className:"card",style:{display:"grid",gap:8},children:[r.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[r.jsx("span",{style:{fontWeight:700},children:e.action}),r.jsx("span",{className:"badge badge-hitl",children:"pending"}),r.jsx("span",{style:{color:"var(--muted)",fontSize:10},children:e.id})]}),r.jsxs("div",{style:{color:"var(--muted)",fontSize:12},children:["Job: ",e.jobId]}),r.jsxs("div",{style:{color:"var(--muted)",fontSize:12},children:["Reason: ",e.note||"approval required"]}),r.jsx("input",{value:s[e.id]||"",onChange:c=>l(g=>({...g,[e.id]:c.target.value})),placeholder:"Optional note",style:{width:"100%",background:"var(--bg3)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)",padding:"8px 10px",fontFamily:"inherit"}}),r.jsxs("div",{style:{display:"flex",gap:8},children:[r.jsx("button",{onClick:()=>d(e.id),style:{background:"rgba(0,230,118,.1)",border:"1px solid rgba(0,230,118,.35)",color:"var(--green)",borderRadius:5,padding:"5px 10px",cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"Approve"}),r.jsx("button",{onClick:()=>p(e.id),style:{background:"rgba(255,23,68,.1)",border:"1px solid rgba(255,23,68,.35)",color:"var(--red)",borderRadius:5,padding:"5px 10px",cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"Reject"})]})]},e.id))]})}export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as n,a4 as t}from"./vendor-5MxLWm27.js";import{a as m}from"./index-
|
|
1
|
+
import{r as n,a4 as t}from"./vendor-5MxLWm27.js";import{a as m}from"./index-Bjt1AMWV.js";function v({data:a,toast:e}){const{broadcast:s=""}=a,i=n.useRef(null);n.useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[s]);const[o,l]=n.useState(""),[c,d]=n.useState(!1),u=async()=>{if(o.trim()){d(!0);try{await m("/api/broadcast",{message:o.trim()}),e("Broadcast posted","success"),l("")}catch(r){e(r.message,"error")}d(!1)}},p=(s||"").split(`
|
|
2
2
|
`);return t.jsxs("div",{className:"fade-in",children:[t.jsxs("div",{style:{display:"flex",gap:8,marginBottom:10},children:[t.jsx("input",{className:"input-base",style:{flex:1},placeholder:"Post a broadcast message...",value:o,onChange:r=>l(r.target.value),onKeyDown:r=>r.key==="Enter"&&u(),maxLength:2e3}),t.jsx("button",{className:"btn-primary",onClick:u,disabled:c||!o.trim(),children:c?"Posting...":"Post"})]}),t.jsxs("div",{style:{background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:8,padding:16,fontFamily:"JetBrains Mono, monospace",fontSize:12,height:"calc(100vh - 160px)",overflowY:"auto"},ref:i,children:[p.length===0||s.trim()===""?t.jsx("span",{style:{color:"var(--muted)"},children:"No broadcasts yet."}):p.map((r,f)=>t.jsx(g,{line:r},f)),t.jsx("div",{style:{height:8}})]})]})}function g({line:a}){const e=a.toLowerCase();let s="var(--text)";return e.includes("[critical]")||e.includes("🔴")?s="var(--red)":e.includes("[blocked]")||e.includes("⚠")?s="var(--amber)":e.includes("[hitl]")||e.includes("🚨")?s="var(--purple)":e.includes("[done]")||e.includes("✅")?s="var(--green)":a.startsWith("#")?s="var(--cyan)":a.startsWith("---")?s="rgba(84,110,122,.5)":(e.includes("task_id:")||e.includes("from:"))&&(s="var(--muted)"),t.jsx("div",{style:{color:s,padding:"1px 0",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:a||" "})}export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e}from"./vendor-5MxLWm27.js";import{L as v}from"./LastUpdated-BVeFtHFH.js";import{R as u,B as S,X as T,Y as _,T as I,d as N,f as w}from"./charts-C5TghfcA.js";function R({data:c,lastUpdated:p}){const{budget:i={}}=c||{},t=i.limits||{},s=i.current||{},n=i.alerts||{},a=i.per_agent||{},f=i.per_model||{},h=i.notes||null,y=i.last_updated||null,j=[{label:"DAILY_QUOTA",spent:s.daily_usd??0,limit:t.daily_usd??0,threshold:n.daily_threshold_pct??70},{label:"WEEKLY_QUOTA",spent:s.weekly_usd??0,limit:t.weekly_usd??0,threshold:n.weekly_threshold_pct??70},{label:"MONTHLY_QUOTA",spent:s.monthly_usd??0,limit:t.monthly_usd??0,threshold:80}];return e.jsxs("div",{className:"fade-in",style:{display:"grid",gap:16},children:[h&&e.jsxs("div",{className:"card shadow-glow",style:{padding:"12px 20px",background:"rgba(255,214,0,0.03)",border:"1px solid var(--amber)",display:"flex",alignItems:"center",gap:16},children:[e.jsx("span",{style:{fontSize:20,textShadow:"0 0 10px var(--amber)"},children:"⚠"}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{className:"section-title",style:{fontSize:9,color:"var(--amber)",marginBottom:2},children:"FISCAL_INTERRUPT_TRIGGERED"}),e.jsx("div",{style:{fontSize:13,color:"var(--text)",fontWeight:600},children:h})]}),y&&e.jsxs("div",{style:{textAlign:"right",fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:["SOURCE_SYNC: ",new Date(y).toLocaleString().toUpperCase()]}),e.jsx("div",{style:{marginLeft:16},children:e.jsx(v,{ts:p})})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:16},children:j.map(({label:o,spent:r,limit:x,threshold:l})=>{const d=x>0?Math.min(100,r/x*100):0,b=d>=l,m=d>l?"var(--red)":d>l*.8?"var(--amber)":"var(--cyan)";return e.jsxs("div",{className:"card shadow-glow",style:{border:`1px solid ${b?"var(--red)":"var(--border)"}`},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:12,alignItems:"center"},children:[e.jsx("span",{className:"section-title",style:{fontSize:9,marginBottom:0},children:o}),e.jsx("div",{style:{textAlign:"right"},children:e.jsxs("div",{style:{fontSize:16,fontWeight:900,color:m,fontFamily:"Rajdhani, sans-serif"},children:["$",r.toFixed(2)," ",e.jsxs("span",{style:{fontSize:10,color:"var(--muted)"},children:["/ $",x]})]})})]}),e.jsxs("div",{className:"progress-track",style:{height:10,position:"relative",background:"rgba(255,255,255,0.02)"},children:[e.jsx("div",{className:"progress-fill",style:{width:`${d}%`,background:m,boxShadow:`0 0 10px ${m}66`}}),e.jsx("div",{style:{position:"absolute",top:-4,bottom:-4,left:`${l}%`,width:2,background:"var(--amber)",boxShadow:"0 0 8px var(--amber)",opacity:.8}})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,fontSize:9,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsxs("span",{style:{color:"var(--muted)"},children:["UTILIZATION: ",d.toFixed(1),"%"]}),e.jsxs("span",{style:{color:"var(--amber)"},children:["LIMITER: ",l,"%"]})]})]},o)})}),Object.keys(a).length>0&&e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-title",style:{fontSize:9},children:"RESOURCE_COST_DISTRIBUTION_MATRIX"}),e.jsx("div",{style:{height:Math.max(240,Object.keys(a).length*40),marginTop:16},children:e.jsx(u,{width:"100%",height:"100%",children:e.jsxs(S,{data:Object.entries(a).map(([o,r])=>({name:o.toUpperCase(),spent:typeof r=="object"?r.spent??0:r})).sort((o,r)=>r.spent-o.spent),layout:"vertical",margin:{left:100,right:30,top:0,bottom:0},children:[e.jsx(T,{type:"number",hide:!0}),e.jsx(_,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,tick:{fill:"var(--muted)",fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:700},width:90}),e.jsx(I,{cursor:{fill:"rgba(255,255,255,0.02)"},contentStyle:{background:"#080810",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"JetBrains Mono, monospace"},formatter:o=>[`$${o.toFixed(3)} USD`,"RESOURCE_CONSUMPTION"]}),e.jsx(N,{dataKey:"spent",radius:[0,4,4,0],barSize:16,children:Object.entries(a).map(([o],r)=>e.jsx(w,{fill:`hsl(${180+r*25}, 100%, 50%)`,fillOpacity:.8},o))})]})})})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[e.jsx(g,{title:"AGENTIC_CONSUMPTION_MATRIX",data:a}),e.jsx(g,{title:"MODEL_KERNEL_COST_MATRIX",data:f})]})]})}function g({title:c,data:p}){const i=Object.entries(p).sort(([,t],[,s])=>{const n=typeof t=="object"?t.spent??0:t;return(typeof s=="object"?s.spent??0:s)-n});return e.jsxs("div",{className:"card",style:{padding:0,overflow:"hidden"},children:[e.jsx("div",{style:{background:"rgba(255,255,255,0.02)",padding:"12px 16px",borderBottom:"1px solid var(--border)"},children:e.jsx("div",{className:"section-title",style:{fontSize:9,marginBottom:0},children:c})}),i.length===0?e.jsx("div",{style:{padding:24,textAlign:"center",color:"var(--muted)",fontSize:10},children:"DATA_INDEX_NULL"}):e.jsxs("table",{style:{width:"100%",fontSize:11,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"rgba(0,0,0,0.1)",borderBottom:"1px solid var(--border)"},children:["IDENTIFIER","EXPENDITURE","CYCLES"].map(t=>e.jsx("th",{style:{textAlign:t==="IDENTIFIER"?"left":"right",padding:"10px 16px",color:"var(--muted)",fontSize:8,fontWeight:800,letterSpacing:"0.1em"},children:t},t))})}),e.jsx("tbody",{children:i.map(([t,s])=>{const n=typeof s=="object"?s.spent??0:s,a=typeof s=="object"?s.calls??"--":"--";return e.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.02)"},className:"task-row-hover",children:[e.jsx("td",{style:{padding:"12px 16px",fontSize:10,fontWeight:700,color:"var(--text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:160},children:t.toUpperCase()}),e.jsxs("td",{style:{padding:"12px 16px",textAlign:"right",color:"var(--cyan)",fontWeight:800,fontFamily:"JetBrains Mono, monospace"},children:["$",n.toFixed(3)]}),e.jsx("td",{style:{padding:"12px 16px",textAlign:"right",color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontSize:10},children:a})]},t)})})]})]})}export{R as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as g,a4 as e}from"./vendor-5MxLWm27.js";import{a as w}from"./index-Bjt1AMWV.js";import{L as C}from"./LastUpdated-BVeFtHFH.js";function I({content:n,label:p,color:d}){if(!n||n.trim()===""||n.trim()===`# ${p}
|
|
2
|
+
|
|
3
|
+
_No messages._`)return e.jsxs("div",{style:{color:"var(--muted)",fontSize:11,padding:"60px 0",textAlign:"center",border:"1px dashed var(--border)",borderRadius:8,marginTop:16},children:[e.jsx("div",{style:{fontSize:24,marginBottom:12,opacity:.3},children:"📡"}),e.jsx("div",{style:{letterSpacing:"0.1em",fontWeight:700},children:"FEED_SILENT // NO ACTIVE SIGNALS"})]});const l=(n||"").split(`
|
|
4
|
+
`);return e.jsx("div",{style:{fontFamily:"JetBrains Mono, monospace",fontSize:11,lineHeight:1.8,maxHeight:500,overflowY:"auto",padding:20,background:"rgba(0,0,0,0.2)",borderRadius:8,border:"1px solid var(--border)"},children:l.map((a,i)=>{let r="rgba(255,255,255,0.7)",s=400,c="none";return a.startsWith("# ")||a.startsWith("## ")?(r=d,s=800,c=`0 0 10px ${d}44`):a.startsWith("---")?r="rgba(255,255,255,0.05)":a.startsWith("- ")?r="var(--muted)":a.startsWith("**")&&(r="var(--text)",s=600),e.jsxs("div",{style:{color:r,fontWeight:s,textShadow:c,padding:"2px 0",borderBottom:a.startsWith("---")?"1px solid rgba(255,255,255,0.05)":"none",display:"flex",gap:12},children:[e.jsx("span",{style:{width:24,color:"rgba(255,255,255,0.05)",textAlign:"right",userSelect:"none"},children:i+1}),e.jsx("span",{children:a||" "})]},i)})})}function A({data:n,lastUpdated:p,toast:d}){const{comms:l={},agents:a=[]}=n||{},[i,r]=g.useState(a[0]?.id||null),[s,c]=g.useState("inbox"),[x,h]=g.useState(""),[b,f]=g.useState(!1),v=async()=>{if(!(!x.trim()||!i)){f(!0);try{await w(`/api/comms/${i}/send`,{message:x.trim()}),d("Signal frequencies locked and transmitted","success"),h("")}catch(t){d(t.message,"error")}f(!1)}},S=l[i]||{inbox:"",outbox:""},m=a.find(t=>t.id===i),u=t=>(t?.match(/^## /gm)||[]).length;return e.jsxs("div",{className:"fade-in",style:{display:"grid",gridTemplateColumns:"260px 1fr",gap:20,minHeight:600},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsx("div",{className:"section-title",style:{fontSize:9},children:"NEURAL FREQUENCIES"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:a.map(t=>{const y=l[t.id]||{},j=u(y.inbox),N=u(y.outbox),o=i===t.id;return e.jsxs("button",{onClick:()=>r(t.id),style:{background:o?"rgba(0, 240, 255, 0.08)":"rgba(255,255,255,0.02)",border:`1px solid ${o?"rgba(0, 240, 255, 0.3)":"var(--border)"}`,borderRadius:8,padding:"12px 14px",cursor:"pointer",textAlign:"left",display:"flex",alignItems:"center",gap:12,transition:"all 0.2s",boxShadow:o?"0 0 15px rgba(0, 240, 255, 0.05)":"none"},className:"task-row-hover",children:[e.jsx("span",{style:{fontSize:24,filter:o?"drop-shadow(0 0 5px var(--cyan))":"grayscale(0.5)"},children:t.emoji}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:13,fontWeight:800,color:o?"var(--cyan)":"var(--text)",fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.02em"},children:t.name.toUpperCase()}),e.jsxs("div",{style:{fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",marginTop:2},children:["IN:",j," // OUT:",N]})]}),o&&e.jsx("div",{className:"status-dot",style:{background:"var(--cyan)",boxShadow:"0 0 8px var(--cyan)"}})]},t.id)})})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 20px",background:"rgba(255,255,255,0.03)",borderRadius:10,border:"1px solid var(--border)"},children:[e.jsx("span",{style:{fontSize:24},children:m?.emoji}),e.jsx("span",{style:{fontWeight:800,fontSize:16,color:"var(--cyan)",fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.05em"},children:m?.name.toUpperCase()})]}),e.jsx("div",{style:{display:"flex",gap:8,background:"rgba(0,0,0,0.2)",padding:4,borderRadius:8,border:"1px solid var(--border)"},children:["inbox","outbox"].map(t=>e.jsx("button",{onClick:()=>c(t),style:{background:s===t?"rgba(0,240,255,0.1)":"transparent",border:"none",color:s===t?"var(--cyan)":"var(--muted)",padding:"6px 16px",borderRadius:6,fontSize:10,cursor:"pointer",fontWeight:800,textTransform:"uppercase",letterSpacing:"0.1em",transition:"all 0.2s",fontFamily:"Rajdhani, sans-serif"},children:t==="inbox"?"📥 DOWNLINK":"📤 UPLINK"},t))}),e.jsx("div",{style:{marginLeft:"auto"},children:e.jsx(C,{ts:p})})]}),e.jsxs("div",{className:"card shadow-glow",style:{flex:1,padding:0,overflow:"hidden",minHeight:400},children:[e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",padding:"8px 16px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:s==="inbox"?"var(--cyan)":"var(--green)",boxShadow:`0 0 8px ${s==="inbox"?"var(--cyan)":"var(--green)"}`}}),e.jsxs("span",{style:{fontSize:9,fontWeight:800,color:"var(--muted)",letterSpacing:"0.1em"},children:["DECODING_",s.toUpperCase(),"_STREAM.EXE"]})]}),e.jsx(I,{content:S[s],label:s==="inbox"?"Inbox":"Outbox",color:s==="inbox"?"var(--cyan)":"var(--green)"})]}),i&&e.jsxs("div",{className:"card shadow-glow",style:{display:"flex",gap:12,alignItems:"flex-end",border:"1px solid var(--border-h)"},children:[e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{className:"section-title",style:{fontSize:9,marginBottom:8},children:["ENCRYPT MESSAGE FOR ",m?.name.toUpperCase()]}),e.jsx("textarea",{className:"input-base",placeholder:"AUTHORIZE SIGNAL TRANSMISSION...",value:x,onChange:t=>h(t.target.value),style:{width:"100%",minHeight:80,resize:"none",background:"rgba(0,0,0,0.2)",fontSize:12,padding:12},maxLength:2e3})]}),e.jsx("button",{className:"btn-primary",style:{height:80,width:120,fontSize:13},onClick:v,disabled:b||!x.trim(),children:b?"TX...":"TRANSMIT"})]})]})]})}export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,a4 as r}from"./vendor-5MxLWm27.js";import{L as b}from"./LastUpdated-BVeFtHFH.js";import{a as m}from"./index-
|
|
1
|
+
import{r as x,a4 as r}from"./vendor-5MxLWm27.js";import{L as b}from"./LastUpdated-BVeFtHFH.js";import{a as m}from"./index-Bjt1AMWV.js";function _(e){return e?e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.round(e/6e4)}m ${Math.round(e%6e4/1e3)}s`:"—"}function v(e){return e==null?"—":e<0?"overdue":e<60?`${e}s`:e<3600?`${Math.round(e/60)}m`:`${Math.round(e/3600)}h`}function S(e){return e==null?"—":e<60?`${e}s ago`:e<3600?`${Math.round(e/60)}m ago`:`${Math.round(e/3600)}h ago`}function j({status:e,errors:o}){return o>=3?r.jsx("span",{className:"dot dot-error",title:`${o} consecutive errors`}):e==="error"?r.jsx("span",{className:"dot dot-error"}):e==="running"?r.jsx("span",{className:"dot dot-active"}):e==="ok"?r.jsx("span",{className:"dot dot-available"}):r.jsx("span",{className:"dot dot-offline"})}function k({job:e,agents:o,onTrigger:s,onToggle:f}){const[a,c]=x.useState(!1),[l,u]=x.useState(!1),[i,g]=x.useState(e.enabled!==!1),d=o.find(p=>p.id===e.agentId),t=e._consecutive_errors||0,n=t>=3||e._status==="error";async function h(){c(!0),await m(`/api/cron/${e.id}/trigger`),s?.(e.id),setTimeout(()=>c(!1),2e3)}async function y(){u(!0);const p=await m(`/api/cron/${e.id}/toggle`);p.ok&&g(p.enabled),u(!1),f?.(e.id,p.enabled)}return r.jsxs(r.Fragment,{children:[r.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,.03)",background:n?"rgba(255,23,68,.03)":"transparent",opacity:i?1:.5},children:[r.jsx("td",{style:{padding:"8px 12px"},children:r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[r.jsx(j,{status:e._status,errors:t}),r.jsxs("div",{children:[r.jsx("div",{style:{fontSize:12,fontWeight:t>=3?700:400,color:n?"var(--red)":"var(--text)"},children:e.name}),e.description&&r.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:e.description.slice(0,60)})]})]})}),r.jsx("td",{style:{padding:"8px 12px",fontSize:11},children:d?r.jsxs("span",{children:[d.emoji," ",d.name]}):r.jsx("span",{style:{color:"var(--muted)"},children:e.agentId})}),r.jsx("td",{style:{padding:"8px 12px",fontSize:10,color:"var(--muted)",fontFamily:"monospace"},children:e.schedule?.kind==="every"?`every ${Math.round((e.schedule.everyMs||0)/6e4)}m`:e.schedule?.cronExpression||e.schedule?.kind||"—"}),r.jsx("td",{style:{padding:"8px 12px",fontSize:11,color:v(e._next_run_sec)==="overdue"?"var(--red)":"var(--muted)"},children:v(e._next_run_sec)}),r.jsx("td",{style:{padding:"8px 12px",fontSize:11,color:"var(--muted)"},children:S(e._last_run_sec)}),r.jsx("td",{style:{padding:"8px 12px",fontSize:11,color:"var(--muted)"},children:_(e._duration_ms)}),r.jsxs("td",{style:{padding:"8px 12px"},children:[n&&r.jsxs("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:3,fontWeight:700,background:"rgba(255,23,68,.15)",color:"var(--red)",border:"1px solid rgba(255,23,68,.3)"},children:[t,"× err"]}),!n&&e._status==="ok"&&r.jsx("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:3,background:"rgba(0,230,118,.1)",color:"var(--green)",border:"1px solid rgba(0,230,118,.25)"},children:"ok"})]}),r.jsx("td",{style:{padding:"8px 12px"},children:r.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[r.jsx("button",{onClick:h,disabled:a,title:"Trigger now",style:{background:"rgba(0,229,255,.1)",border:"1px solid rgba(0,229,255,.3)",color:"var(--cyan)",padding:"3px 8px",borderRadius:4,cursor:a?"not-allowed":"pointer",fontSize:10,fontFamily:"inherit"},children:a?"...":"▶ Run"}),r.jsx("button",{onClick:y,disabled:l,title:i?"Disable":"Enable",style:{background:i?"rgba(255,214,0,.08)":"rgba(0,230,118,.08)",border:`1px solid ${i?"rgba(255,214,0,.3)":"rgba(0,230,118,.3)"}`,color:i?"var(--amber)":"var(--green)",padding:"3px 8px",borderRadius:4,cursor:l?"not-allowed":"pointer",fontSize:10,fontFamily:"inherit"},children:l?"...":i?"⏸ Off":"▶ On"})]})})]}),n&&e._last_error&&r.jsx("tr",{style:{background:"rgba(255,23,68,.04)"},children:r.jsxs("td",{colSpan:8,style:{padding:"4px 12px 8px 40px",fontSize:10,color:"var(--red)",fontFamily:"monospace"},children:["↳ ",e._last_error]})})]})}function w({data:e,lastUpdated:o}){const{crons:s=[],agents:f=[]}=e||{},[a,c]=x.useState("all"),l=s.filter(t=>(t._consecutive_errors||0)>=3||t._status==="error"),u=s.filter(t=>t._status==="running"),i=s.filter(t=>t.enabled===!1),g=s.filter(t=>a==="error"?(t._consecutive_errors||0)>=3||t._status==="error":a==="running"?t._status==="running":a==="disabled"?t.enabled===!1:!0),d={};return g.forEach(t=>{const n=t.agentId||"unknown";d[n]||(d[n]=[]),d[n].push(t)}),r.jsxs("div",{className:"fade-in",style:{display:"grid",gap:14},children:[r.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:10},children:[["Total",s.length,"var(--muted)"],["Erroring",l.length,l.length?"var(--red)":"var(--muted)"],["Running",u.length,u.length?"var(--cyan)":"var(--muted)"],["Disabled",i.length,i.length?"var(--amber)":"var(--muted)"]].map(([t,n,h])=>r.jsxs("div",{className:"card",style:{textAlign:"center",cursor:"pointer"},onClick:()=>c(t.toLowerCase()),children:[r.jsx("div",{className:"section-title",children:t}),r.jsx("div",{style:{fontSize:22,fontWeight:700,color:h},children:n})]},t))}),r.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[["all","error","running","disabled"].map(t=>r.jsx("button",{onClick:()=>c(t),style:{background:a===t?"rgba(0,229,255,.15)":"var(--surface)",border:`1px solid ${a===t?"rgba(0,229,255,.4)":"var(--border)"}`,color:a===t?"var(--cyan)":"var(--muted)",padding:"4px 12px",borderRadius:4,fontSize:11,cursor:"pointer",fontFamily:"inherit"},children:t},t)),r.jsx(b,{ts:o})]}),r.jsx("div",{className:"card",style:{padding:0,overflow:"hidden"},children:r.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[r.jsx("thead",{children:r.jsx("tr",{style:{background:"var(--bg3)",borderBottom:"1px solid var(--border)"},children:["Job","Agent","Schedule","Next","Last Run","Duration","Status","Actions"].map(t=>r.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontSize:10,color:"var(--muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:".05em"},children:t},t))})}),r.jsxs("tbody",{children:[g.length===0&&r.jsx("tr",{children:r.jsx("td",{colSpan:8,style:{padding:"20px",color:"var(--muted)",textAlign:"center"},children:"No cron jobs match filter"})}),g.map(t=>r.jsx(k,{job:t,agents:f},t.id))]})]})})]})}export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as g,a4 as e}from"./vendor-5MxLWm27.js";import{L as h}from"./LastUpdated-BVeFtHFH.js";import{a as f}from"./index-
|
|
1
|
+
import{r as g,a4 as e}from"./vendor-5MxLWm27.js";import{L as h}from"./LastUpdated-BVeFtHFH.js";import{a as f}from"./index-Bjt1AMWV.js";function v(t){if(!t)return"—";try{const i=Math.round((Date.now()-new Date(t))/6e4);return i<1?"just now":i<60?`${i}m ago`:i<1440?`${Math.round(i/60)}h ago`:`${Math.round(i/1440)}d ago`}catch{return t}}function m({task:t,agents:i,onAction:p}){const[c,a]=g.useState(""),[n,r]=g.useState(null),l=i.find(s=>s.id===t.assigned_to),o=v(t.created_at),d=(t.sla?.priority||t.priority||"").toUpperCase();async function x(s){r(s);try{await f(`/api/hitl/${t.id}/${s}`,{note:c||void 0}),p(t.id,s)}catch(u){console.error(u)}r(null)}return e.jsxs("div",{style:{background:"var(--bg2)",border:"1px solid rgba(224,64,251,.35)",borderRadius:10,padding:18,display:"grid",gap:14,boxShadow:"0 0 20px rgba(224,64,251,.08)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[e.jsx("span",{style:{fontSize:28},children:"🚨"}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontWeight:700,fontSize:15},children:t.title}),e.jsx("span",{style:{fontSize:10,fontFamily:"monospace",color:"var(--muted)"},children:t.id}),d&&e.jsx("span",{className:d==="P1"?"p1":d==="P2"?"p2":"p3",children:d})]}),e.jsxs("div",{style:{fontSize:11,color:"var(--muted)"},children:[l&&e.jsxs("span",{children:[l.emoji," ",l.name," · "]}),"Waiting ",e.jsx("span",{style:{color:"var(--amber)",fontWeight:600},children:o}),t.sla?.deadline&&e.jsxs("span",{children:[" · Due ",new Date(t.sla.deadline).toLocaleString()]})]})]})]}),e.jsxs("div",{style:{padding:"12px 14px",background:"rgba(224,64,251,.08)",border:"1px solid rgba(224,64,251,.25)",borderRadius:7},children:[e.jsx("div",{style:{fontSize:10,color:"var(--purple)",fontWeight:700,textTransform:"uppercase",letterSpacing:".06em",marginBottom:6},children:"Decision Required"}),e.jsx("div",{style:{fontSize:13,color:"var(--text)",lineHeight:1.6},children:t.hitl_reason||"Human decision required before proceeding."})]}),t.description&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:".05em",marginBottom:4},children:"Context"}),e.jsx("div",{style:{fontSize:12,color:"var(--text)",lineHeight:1.6},children:t.description})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--muted)",marginBottom:6},children:"Optional note (sent to agent)"}),e.jsx("input",{value:c,onChange:s=>a(s.target.value),placeholder:"Add context for the agent...",style:{width:"100%",background:"var(--bg3)",border:"1px solid var(--border)",borderRadius:5,padding:"8px 10px",fontSize:12,color:"var(--text)",fontFamily:"inherit",outline:"none",boxSizing:"border-box"}})]}),e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("button",{onClick:()=>x("approve"),disabled:!!n,style:{flex:1,padding:"10px",background:"rgba(0,230,118,.15)",border:"1px solid rgba(0,230,118,.4)",color:"var(--green)",borderRadius:6,cursor:n?"not-allowed":"pointer",fontFamily:"inherit",fontSize:13,fontWeight:700,transition:"all .15s"},children:n==="approve"?"...":"✅ Approve — Continue"}),e.jsx("button",{onClick:()=>x("reject"),disabled:!!n,style:{flex:1,padding:"10px",background:"rgba(255,23,68,.1)",border:"1px solid rgba(255,23,68,.35)",color:"var(--red)",borderRadius:6,cursor:n?"not-allowed":"pointer",fontFamily:"inherit",fontSize:13,fontWeight:700,transition:"all .15s"},children:n==="reject"?"...":"❌ Reject — Block Task"})]})]})}function S({data:t,lastUpdated:i}){const{hitl_tasks:p=[],agents:c=[]}=t||{},[a,n]=g.useState(new Set),r=p.filter(o=>!a.has(o.id));function l(o){n(d=>new Set([...d,o]))}return e.jsxs("div",{className:"fade-in",style:{display:"grid",gap:14},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700,color:r.length?"var(--red)":"var(--green)"},children:r.length?`🚨 ${r.length} decision${r.length>1?"s":""} awaiting your input`:"✅ No pending HITL decisions"}),e.jsx(h,{ts:i})]}),r.length===0&&e.jsx("div",{className:"card",style:{color:"var(--muted)",fontSize:13},children:"All clear — no human decisions required right now. Agents are running autonomously."}),r.map(o=>e.jsx(m,{task:o,agents:c,onAction:l},o.id)),a.size>0&&e.jsxs("div",{style:{padding:"10px 14px",background:"rgba(0,230,118,.06)",border:"1px solid rgba(0,230,118,.2)",borderRadius:6,fontSize:12,color:"var(--green)"},children:["✅ ",a.size," decision",a.size>1?"s":""," resolved this session — agents notified via task status update."]})]})}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,a4 as e}from"./vendor-5MxLWm27.js";import{L as k}from"./LastUpdated-BVeFtHFH.js";import{d as C,f as J,r as N}from"./index-Bjt1AMWV.js";function R({step:a}){const i=a.status==="complete"?"var(--green)":a.status==="running"?"var(--cyan)":a.status==="failed"?"var(--red)":a.status==="blocked"?"var(--amber)":"var(--muted)";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:11,padding:"3px 0"},children:[e.jsx("span",{style:{color:i},children:"●"}),e.jsx("span",{style:{minWidth:70},children:a.kind}),e.jsx("span",{style:{color:"var(--muted)"},children:a.status}),e.jsxs("span",{style:{color:"var(--muted)"},children:["attempt ",a.attempt||0,"/",a.maxAttempts||2]})]})}function F({data:a,lastUpdated:i}){const{jobs:l=[],featureFlags:b={}}=a||{},[n,o]=s.useState(""),[c,h]=s.useState("P2"),[p,u]=s.useState(""),[g,x]=s.useState(!1),[m,y]=s.useState(""),v=!b.jobs,d=s.useMemo(()=>[...l].sort((t,r)=>new Date(r.createdAt)-new Date(t.createdAt)),[l]);async function f(t){if(t.preventDefault(),!!n.trim()){x(!0),y("");try{await C({intent:n.trim(),priority:c,tags:p.split(",").map(r=>r.trim()).filter(Boolean)}),o(""),u("")}catch(r){y(r.message||"create_failed")}x(!1)}}async function j(t){try{await J(t)}catch{}}async function S(t){try{await N(t)}catch{}}return v?e.jsx("div",{className:"card",children:"Jobs feature is disabled. Enable `featureJobs` in plugin config."}):e.jsxs("div",{className:"fade-in",style:{display:"grid",gap:14},children:[e.jsxs("form",{onSubmit:f,className:"card",style:{display:"grid",gap:10},children:[e.jsx("div",{className:"section-title",children:"Create Job"}),e.jsx("input",{value:n,onChange:t=>o(t.target.value),placeholder:"High-level intent...",style:{width:"100%",background:"var(--bg3)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)",padding:"8px 10px",fontFamily:"inherit"}}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr auto",gap:10},children:[e.jsxs("select",{value:c,onChange:t=>h(t.target.value),style:{background:"var(--bg3)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)",padding:"8px"},children:[e.jsx("option",{value:"P1",children:"P1"}),e.jsx("option",{value:"P2",children:"P2"}),e.jsx("option",{value:"P3",children:"P3"})]}),e.jsx("input",{value:p,onChange:t=>u(t.target.value),placeholder:"tags (comma separated)",style:{width:"100%",background:"var(--bg3)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)",padding:"8px 10px",fontFamily:"inherit"}}),e.jsx("button",{type:"submit",disabled:g,style:{background:"rgba(0,229,255,.15)",border:"1px solid rgba(0,229,255,.4)",color:"var(--cyan)",borderRadius:6,padding:"8px 12px",cursor:"pointer"},children:g?"...":"Create"})]}),m&&e.jsx("div",{style:{color:"var(--red)",fontSize:11},children:m})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxs("div",{className:"section-title",style:{marginBottom:0},children:["Jobs (",d.length,")"]}),e.jsx(k,{ts:i})]}),d.length===0&&e.jsx("div",{className:"card",style:{color:"var(--muted)"},children:"No jobs yet."}),d.map(t=>e.jsxs("div",{className:"card",style:{display:"grid",gap:8},children:[e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[e.jsx("span",{style:{fontWeight:700},children:t.title}),e.jsx("span",{className:"badge badge-pending",style:{textTransform:"none"},children:t.status}),e.jsx("span",{style:{color:"var(--muted)",fontSize:10},children:t.id}),e.jsx("span",{style:{marginLeft:"auto",color:"var(--muted)",fontSize:11},children:new Date(t.createdAt).toLocaleString()})]}),e.jsx("div",{style:{color:"var(--muted)",fontSize:12},children:t.intent}),e.jsx("div",{style:{display:"grid",gap:2},children:(t.steps||[]).map(r=>e.jsx(R,{step:r},r.id))}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>j(t.id),disabled:["complete","failed","cancelled","blocked"].includes(t.status),style:{background:"rgba(255,23,68,.1)",border:"1px solid rgba(255,23,68,.35)",color:"var(--red)",borderRadius:5,padding:"5px 10px",cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"Cancel"}),e.jsx("button",{onClick:()=>S(t.id),disabled:!["failed","blocked"].includes(t.status),style:{background:"rgba(0,230,118,.1)",border:"1px solid rgba(0,230,118,.35)",color:"var(--green)",borderRadius:5,padding:"5px 10px",cursor:"pointer",fontFamily:"inherit",fontSize:11},children:"Retry"})]})]},t.id))]})}export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,a4 as a}from"./vendor-5MxLWm27.js";import{a as w,i as T}from"./index-Bjt1AMWV.js";import{L as I}from"./LastUpdated-BVeFtHFH.js";function A({data:f,lastUpdated:y,toast:p}){const{shared_knowledge:i=[],agents:v=[]}=f||{},[g,j]=n.useState(""),[o,b]=n.useState("all"),[N,x]=n.useState(!1),[t,c]=n.useState({title:"",content:"",category:"general",tags:""}),[m,h]=n.useState(!1),S=async()=>{if(t.content.trim()){h(!0);try{const e={...t,tags:t.tags?t.tags.split(",").map(s=>s.trim()).filter(Boolean):[]};await w("/api/knowledge",e),p("Neural integration successful","success"),x(!1),c({title:"",content:"",category:"general",tags:""})}catch(e){p(e.message,"error")}h(!1)}},E=async e=>{if(confirm("Purge this neural entry?"))try{await T(`/api/knowledge/${e}`),p("Entry purged from archive","success")}catch(s){p(s.message,"error")}},C=n.useMemo(()=>{const e=new Set(i.map(s=>s.category||"general"));return["all",...Array.from(e).sort()]},[i]),u=n.useMemo(()=>i.filter(e=>{const s=o==="all"||(e.category||"general")===o,d=g.toLowerCase(),l=!d||(e.content||e.summary||"").toLowerCase().includes(d)||(e.title||"").toLowerCase().includes(d)||(e.tags||[]).some(r=>r.toLowerCase().includes(d));return s&&l}),[i,g,o]);return a.jsxs("div",{className:"fade-in",style:{display:"grid",gap:16},children:[a.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",flexWrap:"wrap"},children:[a.jsx("input",{className:"input-base",value:g,onChange:e=>j(e.target.value),placeholder:"QUERY NEURAL ARCHIVE...",style:{flex:1,minWidth:260,background:"rgba(0,0,0,0.2)",height:38}}),a.jsx("div",{style:{display:"flex",gap:6},children:C.map(e=>a.jsx("button",{onClick:()=>b(e),style:{background:o===e?"rgba(0,240,255,0.1)":"rgba(255,255,255,0.03)",border:`1px solid ${o===e?"rgba(0,240,255,0.4)":"var(--border)"}`,color:o===e?"var(--cyan)":"var(--muted)",padding:"6px 14px",borderRadius:6,fontSize:10,cursor:"pointer",fontFamily:"Rajdhani, sans-serif",fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",transition:"all 0.2s"},children:e},e))}),a.jsx("button",{className:"btn-primary",style:{height:38},onClick:()=>x(e=>!e),children:"+ NEW ARCHIVE ENTRY"}),a.jsx("div",{style:{marginLeft:"auto"},children:a.jsx(I,{ts:y})})]}),N&&a.jsxs("div",{className:"card shadow-glow",style:{display:"grid",gap:10,border:"1px solid var(--border-h)"},children:[a.jsx("div",{className:"section-title",children:"INTEGRATE NEW NEURAL NODE"}),a.jsx("input",{className:"input-base",placeholder:"ENTRY TITLE (OPTIONAL)",value:t.title,onChange:e=>c(s=>({...s,title:e.target.value}))}),a.jsx("textarea",{className:"input-base",placeholder:"CORE CONTENT / INSIGHT *",value:t.content,onChange:e=>c(s=>({...s,content:e.target.value})),style:{minHeight:100,resize:"vertical",fontFamily:"JetBrains Mono, monospace"},maxLength:5e3}),a.jsxs("div",{style:{display:"flex",gap:10},children:[a.jsx("input",{className:"input-base",placeholder:"CATEGORY",value:t.category,onChange:e=>c(s=>({...s,category:e.target.value})),style:{flex:1}}),a.jsx("input",{className:"input-base",placeholder:"TAGS (SIGMA, DELTA...)",value:t.tags,onChange:e=>c(s=>({...s,tags:e.target.value})),style:{flex:2}})]}),a.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"flex-end",marginTop:8},children:[a.jsx("button",{className:"btn-primary",onClick:S,disabled:m||!t.content.trim(),children:m?"PROCESSING...":"INITIALIZE UPLOAD"}),a.jsx("button",{className:"input-base",style:{cursor:"pointer",border:"1px solid transparent"},onClick:()=>x(!1),children:"ABORT"})]})]}),a.jsxs("div",{style:{fontSize:9,color:"var(--muted)",fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.1em"},children:["INDEXED: ",u.length," / ",i.length," NODES",i.length===0&&" | SYSTEM SYMBOLIC SYNTHESIS PENDING"]}),a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(400px, 1fr))",gap:16},children:u.map((e,s)=>{const d=v.find(r=>r.id===e.added_by||r.id===e.author),l=e.confidence??.85;return a.jsxs("div",{className:"card fade-in",style:{animationDelay:`${s*.05}s`,display:"flex",flexDirection:"column"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,marginBottom:12},children:[a.jsxs("div",{style:{flex:1},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[a.jsx("span",{className:"badge badge-active",style:{fontSize:8},children:e.category||"GENERAL"}),e.title&&a.jsx("div",{style:{fontWeight:800,fontSize:14,color:"var(--text)",letterSpacing:"-0.01em"},children:e.title})]}),a.jsx("div",{style:{fontSize:13,color:"var(--text)",lineHeight:1.6,background:"rgba(0,0,0,0.15)",padding:12,borderRadius:8,border:"1px solid rgba(255,255,255,0.02)"},children:e.content||e.summary||e.insight||"—"})]}),e.id&&a.jsx("button",{className:"btn-danger",style:{opacity:.3},onClick:r=>{r.stopPropagation(),E(e.id)},children:"×"})]}),e.tags?.length>0&&a.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:16},children:e.tags.map(r=>a.jsx("span",{style:{fontSize:9,fontWeight:700,padding:"2px 8px",background:"rgba(181, 53, 255, 0.03)",color:"var(--purple)",border:"1px solid rgba(181, 53, 255, 0.15)",borderRadius:4,textTransform:"uppercase"},children:r},r))}),a.jsxs("div",{style:{marginTop:"auto",paddingTop:12,borderTop:"1px solid var(--border)",display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[a.jsxs("div",{style:{fontSize:10,color:"var(--muted)",display:"flex",flexDirection:"column",gap:4,fontFamily:"JetBrains Mono, monospace"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[a.jsx("span",{children:"AUTHOR:"}),a.jsx("span",{style:{color:"var(--cyan)"},children:d?.name.toUpperCase()||"SYSTEM"})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[a.jsx("span",{children:"SIG:"}),a.jsx("span",{children:e.source_task||"—"})]})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,fontWeight:700,color:"var(--muted)"},children:[a.jsx("span",{children:"CONFIDENCE"}),a.jsxs("span",{style:{color:l>.9?"var(--green)":"var(--amber)"},children:[(l*100).toFixed(0),"%"]})]}),a.jsx("div",{className:"progress-track",style:{height:4},children:a.jsx("div",{className:"progress-fill",style:{width:`${l*100}%`,background:l>.9?"var(--green)":"var(--amber)",boxShadow:l>.9?"0 0 8px var(--green)":"0 0 6px var(--amber)"}})})]})]})]},e.id||s)})})]})}export{A as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a4 as e}from"./vendor-5MxLWm27.js";import{L as O}from"./LastUpdated-BVeFtHFH.js";function j(s){const g=(s._risks||[]).filter(n=>!n.resolved),o=s._progress_pct??0,r=s.target_completion?Math.ceil((new Date(s.target_completion)-Date.now())/864e5):999,i=s._task_counts||{};return g.some(n=>n.severity==="critical")||(i.blocked||0)>2||r<-3?"critical":g.length>1||(i.hitl||0)>0||r<0||o<30?"at-risk":"healthy"}const z={healthy:"var(--green)","at-risk":"var(--amber)",critical:"var(--red)"},A={healthy:"◈","at-risk":"⚠",critical:"🚨"};function M(s,g,o){const r=g.filter(l=>(s.task_ids||[]).includes(l.id)),i=r.filter(l=>l.status==="complete").length,n=r.length,c=(s.team||[]).map(l=>o.find(h=>h.id===l)).filter(Boolean),m=s.milestones||[];return{...s,_task_counts:{total:n,done:i,active:r.filter(l=>l.status==="in-progress").length,blocked:r.filter(l=>l.status==="blocked").length,hitl:r.filter(l=>l.status==="needs_human_decision").length},_milestone_counts:{total:m.length,done:m.filter(l=>l.status==="complete").length},_progress_pct:n>0?Math.round(i/n*100):0,_risks:s._risks||[],_team_agents:c,_active_tasks:r.filter(l=>l.status==="in-progress")}}function W(s){return s?Math.ceil((new Date(s)-Date.now())/864e5):null}function D({project:s}){const g=j(s),o=z[g],r=s._progress_pct??0,i=s._task_counts||{},n=s._milestone_counts||{},c=W(s.target_completion),m=c==null?null:c<0?`${Math.abs(c)}d OVERDUE`:c===0?"DUE TODAY":`${c}d LEFT`,l=c==null?"var(--muted)":c<0?"var(--red)":c<=3?"var(--amber)":"var(--muted)";return e.jsxs("div",{className:"card shadow-glow",style:{padding:0,overflow:"hidden",border:`1px solid ${o}33`,background:"rgba(8,8,16,0.7)",transition:"all 0.2s"},children:[e.jsx("div",{style:{height:3,background:`linear-gradient(90deg, ${o}, transparent)`}}),e.jsxs("div",{style:{padding:"16px 20px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,marginBottom:12},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[e.jsx("span",{style:{fontSize:12,color:o,textShadow:`0 0 8px ${o}`},children:A[g]}),e.jsx("span",{style:{fontWeight:900,fontSize:15,fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.03em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.name.toUpperCase()})]}),e.jsxs("div",{style:{fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:[s.id," // STATUS:",s.status?.toUpperCase(),m&&e.jsxs("span",{style:{color:l,marginLeft:10},children:["⏱ ",m]})]})]}),e.jsxs("span",{style:{fontSize:20,fontWeight:900,color:o,fontFamily:"Rajdhani, sans-serif",flexShrink:0},children:[r,"%"]})]}),e.jsx("div",{style:{height:5,background:"rgba(255,255,255,0.04)",borderRadius:3,overflow:"hidden",marginBottom:12},children:e.jsx("div",{style:{height:"100%",width:`${r}%`,background:r===100?"var(--green)":`linear-gradient(90deg, ${o}, ${o}88)`,borderRadius:3,boxShadow:`0 0 10px ${o}44`,transition:"width 1s ease"}})}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:6,marginBottom:12},children:[[i.done??0,i.total??0,"TASKS","var(--cyan)"],[n.done??0,n.total??0,"PHASES","var(--green)"],[i.active??0,null,"ACTIVE","var(--amber)"],[i.blocked??0,null,"BLOCKED",i.blocked?"var(--red)":"var(--muted)"]].map(([h,x,a,v])=>e.jsxs("div",{style:{textAlign:"center",padding:"6px 4px",background:"rgba(255,255,255,0.02)",borderRadius:6,border:"1px solid rgba(255,255,255,0.04)"},children:[e.jsx("div",{style:{fontSize:11,fontWeight:900,color:v,fontFamily:"Rajdhani, sans-serif"},children:x!=null?`${h}/${x}`:h}),e.jsx("div",{style:{fontSize:7,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:a})]},a))}),s._active_tasks?.length>0&&e.jsx("div",{style:{marginBottom:12},children:s._active_tasks.slice(0,2).map(h=>e.jsxs("div",{style:{fontSize:10,color:"var(--cyan)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"3px 0",borderBottom:"1px solid rgba(255,255,255,0.03)",fontFamily:"JetBrains Mono, monospace"},children:["▶ ",h.title]},h.id))}),s._team_agents?.length>0&&e.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[e.jsx("span",{style:{fontSize:8,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontWeight:700,marginRight:4},children:"TEAM:"}),s._team_agents.slice(0,6).map(h=>e.jsx("span",{title:h.name,style:{fontSize:14,width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",cursor:"default"},children:h.emoji||"🤖"},h.id)),s._team_agents.length>6&&e.jsxs("span",{style:{fontSize:9,color:"var(--muted)"},children:["+",s._team_agents.length-6]})]})]})]})}function J({agent:s,tasks:g,projects:o}){const r=g.filter(a=>a.assigned_to===s.id),i=r.find(a=>a.status==="in-progress"),n=r.find(a=>a.status==="needs_human_decision"),c=s.heartbeat_age_minutes??999,m=i?o.find(a=>(a.task_ids||[]).includes(i.id)||(a.team||[]).includes(s.id)):null,l={active:"var(--green)",available:"var(--cyan)",busy:"var(--amber)",error:"var(--red)"}[s.status]||"var(--muted)",h=c<5?"var(--green)":c<15?"var(--amber)":"var(--red)",x=n?"3px solid var(--purple)":i?"3px solid var(--cyan)":s.status==="error"?"3px solid var(--red)":"3px solid transparent";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"7px 12px",borderRadius:8,borderLeft:x,background:n?"rgba(181,53,255,0.04)":i?"rgba(0,240,255,0.02)":"rgba(255,255,255,0.01)",border:`1px solid ${n?"rgba(181,53,255,0.15)":i?"rgba(0,240,255,0.08)":"rgba(255,255,255,0.03)"}`,borderLeftWidth:3,transition:"all 0.2s"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0},children:[e.jsx("span",{style:{fontSize:16},children:s.emoji||"🤖"}),e.jsx("span",{style:{position:"absolute",bottom:-1,right:-3,width:6,height:6,borderRadius:"50%",background:l,border:"1px solid var(--bg)",boxShadow:`0 0 4px ${l}`}})]}),e.jsxs("div",{style:{minWidth:80,flexShrink:0},children:[e.jsx("div",{style:{fontSize:11,fontWeight:800,color:"var(--text)",fontFamily:"Rajdhani, sans-serif"},children:s.name.toUpperCase()}),m&&e.jsxs("div",{style:{fontSize:8,color:"var(--amber)",fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:["📂 ",m.name.toUpperCase().slice(0,14)]})]}),e.jsx("div",{style:{flex:1,minWidth:0},children:n?e.jsxs("div",{style:{fontSize:10,color:"var(--purple)",fontWeight:700,fontFamily:"JetBrains Mono, monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["🚨 HITL: ",n.title]}):i?e.jsxs("div",{style:{fontSize:10,color:"var(--cyan)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"JetBrains Mono, monospace"},children:["▶ ",i.title]}):e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:"IDLE"})}),e.jsxs("div",{style:{textAlign:"center",flexShrink:0,minWidth:36},children:[e.jsx("div",{style:{fontSize:12,fontWeight:900,color:"var(--green)",fontFamily:"Rajdhani, sans-serif"},children:s.tasks_completed??0}),e.jsx("div",{style:{fontSize:7,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:"DONE"})]}),e.jsx("div",{style:{flexShrink:0,fontSize:10,fontWeight:800,color:h,fontFamily:"JetBrains Mono, monospace",minWidth:32,textAlign:"right"},children:c<999?`${c}m`:"—"}),s.inbox_count>0&&e.jsxs("div",{style:{fontSize:9,color:"var(--purple)",fontWeight:800,animation:"pulse 2s infinite"},children:["📬",s.inbox_count]})]})}function U({data:s,lastUpdated:g}){const{agents:o=[],tasks:r=[],task_counts:i={},sla_at_risk:n=[],projects:c=[],budget:m={},broadcast:l="",crons:h=[],alerts:x=[]}=s||{},a=c.map(t=>M(t,r,o)),v=a.filter(t=>["active","ACTIVE"].includes(t.status)),w=a.filter(t=>!["active","ACTIVE"].includes(t.status)),B=a.filter(t=>j(t)==="critical").length,R=a.filter(t=>j(t)==="at-risk").length,E=a.filter(t=>j(t)==="healthy").length,I=a.reduce((t,d)=>t+(d._task_counts?.total||0),0),L=a.reduce((t,d)=>t+(d._task_counts?.done||0),0),b=h.filter(t=>(t._consecutive_errors||0)>=3).length,k=x.filter(t=>t.severity==="critical").length,N=m.limits||{},S=(m.current||{}).daily_usd??0,y=N.daily_usd??1,T=m.alerts?.daily_threshold_pct??70,C=(l||"").split(`
|
|
2
|
+
`).filter(t=>t.trim()).slice(-4),F=[...o].sort((t,d)=>{const p=f=>{const _=r.filter(u=>u.assigned_to===f.id);return _.some(u=>u.status==="needs_human_decision")?0:_.some(u=>u.status==="in-progress")?1:f.status==="error"?2:3};return p(t)-p(d)});return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:20},children:[k>0&&e.jsxs("div",{style:{padding:"10px 16px",background:"rgba(255,42,85,.1)",border:"1px solid rgba(255,42,85,.4)",borderRadius:8,display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:18,animation:"pulse 1.5s infinite"},children:"🚨"}),e.jsxs("span",{style:{fontSize:13,color:"var(--red)",fontWeight:600},children:[k," critical alert",k>1?"s":""," require attention"]}),e.jsx("span",{style:{fontSize:12,color:"var(--muted)",marginLeft:"auto"},children:"→ Alerts tab"})]}),e.jsxs("div",{className:"card shadow-glow",style:{padding:0,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"18px 24px 16px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:16,background:"rgba(255,255,255,0.01)"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:18,fontWeight:900,fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.05em"},children:"PROJECT COMMAND BOARD"}),e.jsxs("div",{style:{fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",marginTop:2},children:[a.length," TOTAL // ",v.length," ACTIVE // ",L,"/",I," CYCLES COMPLETE"]})]}),e.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:16,alignItems:"center"},children:[[[E,"HEALTHY","var(--green)"],[R,"AT RISK","var(--amber)"],[B,"CRITICAL","var(--red)"]].map(([t,d,p])=>t>0&&e.jsxs("div",{style:{textAlign:"center"},children:[e.jsx("div",{style:{fontSize:18,fontWeight:900,color:p,fontFamily:"Rajdhani, sans-serif",lineHeight:1},children:t}),e.jsx("div",{style:{fontSize:8,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:d})]},d)),e.jsx(O,{ts:g})]})]}),e.jsx("div",{style:{padding:"16px 24px"},children:v.length===0&&w.length===0?e.jsx("div",{style:{padding:60,textAlign:"center",color:"var(--muted)",fontSize:12,fontFamily:"JetBrains Mono, monospace"},children:"NO_PROJECTS // RUN SPRINT_PLANNING TO INITIALIZE"}):e.jsxs(e.Fragment,{children:[v.length>0&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:14},children:v.map(t=>e.jsx(D,{project:t},t.id))}),w.length>0&&e.jsxs("div",{style:{marginTop:16,paddingTop:16,borderTop:"1px solid var(--border)"},children:[e.jsx("div",{style:{fontSize:8,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontWeight:800,marginBottom:10},children:"OTHER_PROJECTS"}),e.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:w.map(t=>{const d=j(t),p=z[d];return e.jsxs("div",{style:{padding:"6px 14px",borderRadius:20,background:"rgba(255,255,255,0.02)",border:`1px solid ${p}22`,display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontSize:10,color:p},children:A[d]}),e.jsx("span",{style:{fontSize:11,fontWeight:700,fontFamily:"Rajdhani, sans-serif"},children:t.name.toUpperCase()}),e.jsx("span",{style:{fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:t.status}),e.jsxs("span",{style:{fontSize:10,fontWeight:800,color:"var(--cyan)",fontFamily:"JetBrains Mono, monospace"},children:[t._progress_pct,"%"]})]},t.id)})})]})]})})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr 1fr",gap:16},children:[e.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",justifyContent:"center"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsx("span",{className:"section-title",style:{marginBottom:0},children:"GLOBAL RESOURCE SPEND"}),e.jsxs("span",{style:{fontSize:14,fontWeight:700},children:["$",S.toFixed(2)," ",e.jsxs("span",{style:{color:"var(--muted)",fontWeight:400,fontSize:11},children:["/ $",y]})]})]}),e.jsxs("div",{className:"progress-track",style:{position:"relative",height:8},children:[e.jsx("div",{className:"progress-fill",style:{width:`${Math.min(100,S/y*100)}%`,background:S/y>T/100?"var(--red)":"linear-gradient(90deg, var(--cyan), var(--purple))",borderRadius:"0 4px 4px 0"}}),e.jsx("div",{style:{position:"absolute",top:-3,bottom:-3,left:`${T}%`,width:2,background:"var(--amber)",boxShadow:"0 0 8px var(--amber)",zIndex:2}})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:"var(--muted)",marginTop:8},children:[e.jsxs("span",{children:[(S/y*100).toFixed(1),"% utilized"]}),e.jsxs("span",{children:["Limit: $",y," USD"]})]})]}),e.jsxs("div",{className:"card",style:{borderColor:n.length>0?"rgba(255,42,85,.4)":"var(--border)"},children:[e.jsxs("div",{className:"section-title",style:{color:n.length>0?"var(--red)":"var(--muted)",display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{children:n.length>0?"⚠ SLA At Risk":"✅ SLA Status"}),e.jsx("span",{children:n.length})]}),e.jsx("div",{style:{marginTop:8},children:n.length===0?e.jsx("div",{style:{color:"var(--muted)",fontSize:12},children:"All tasks on schedule."}):n.slice(0,3).map(t=>e.jsxs("div",{style:{fontSize:10,color:"var(--red)",padding:"4px 0",borderBottom:"1px solid rgba(255,255,255,0.03)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["⏰ ",t.title]},t.id))})]}),e.jsxs("div",{className:"card",style:{borderColor:b?"rgba(255,184,0,.4)":"var(--border)"},children:[e.jsx("div",{className:"section-title",children:"SYSTEM HEALTH"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11},children:[e.jsx("span",{style:{color:"var(--muted)"},children:"Crons"}),e.jsx("span",{style:{color:b?"var(--amber)":"var(--green)",fontWeight:700},children:b?`${b} erroring`:"All healthy"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11},children:[e.jsx("span",{style:{color:"var(--muted)"},children:"HITL Gates"}),e.jsx("span",{style:{color:i.needs_human_decision>0?"var(--purple)":"var(--muted)",fontWeight:700},children:i.needs_human_decision??0})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11},children:[e.jsx("span",{style:{color:"var(--muted)"},children:"Blocked Tasks"}),e.jsx("span",{style:{color:i.blocked>0?"var(--red)":"var(--muted)",fontWeight:700},children:i.blocked??0})]})]})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.4fr 1fr",gap:16},children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:e.jsxs("div",{children:[e.jsx("div",{className:"section-title",style:{marginBottom:2},children:"AGENT ACTIVITY"}),e.jsxs("div",{style:{fontSize:8,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:[o.filter(t=>r.some(d=>d.assigned_to===t.id&&d.status==="in-progress")).length," ACTIVE // ",o.length," TOTAL"]})]})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5},children:[F.map((t,d)=>e.jsx(J,{agent:t,tasks:r,projects:c,index:d},t.id)),o.length===0&&e.jsx("div",{style:{color:"var(--muted)",fontSize:11,padding:"20px 0",textAlign:"center",fontFamily:"JetBrains Mono, monospace"},children:"NO_AGENTS_ONLINE"})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{className:"card",style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{className:"section-title",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{children:"LIVE BROADCAST"}),e.jsx("span",{className:"dot dot-active",style:{width:6,height:6}})]}),e.jsx("div",{style:{flex:1,marginTop:10,display:"flex",flexDirection:"column",gap:5,background:"rgba(0,0,0,0.3)",padding:"12px 14px",borderRadius:8,border:"1px solid var(--border)",fontFamily:"JetBrains Mono, monospace"},children:C.length===0?e.jsx("div",{style:{color:"var(--muted)",fontSize:11},children:"Awaiting transmission..."}):C.map((t,d)=>{const p=t.toLowerCase(),f=p.includes("[critical]")?"var(--red)":p.includes("[blocked]")?"var(--amber)":p.includes("[hitl]")?"var(--purple)":p.includes("[done]")?"var(--green)":"var(--text)";return e.jsxs("div",{style:{color:f,fontSize:10,lineHeight:1.6,wordBreak:"break-word"},children:[e.jsx("span",{style:{color:"rgba(255,255,255,0.2)",marginRight:8},children:new Date().toLocaleTimeString([],{hour12:!1,hour:"2-digit",minute:"2-digit"})}),t]},d)})})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-title",children:"RECENT CYCLES"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2,marginTop:8},children:r.slice(-6).reverse().map(t=>{const d=(t.status||"").toLowerCase().replace(/ /g,"-"),p={complete:"badge-complete",pending:"badge-pending","in-progress":"badge-in-progress",failed:"badge-failed",needs_human_decision:"badge-hitl",blocked:"badge-blocked"}[d]||"badge-pending",f=o.find(_=>_.id===t.assigned_to);return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 0",borderBottom:"1px solid rgba(255,255,255,.04)"},children:[f&&e.jsx("span",{style:{fontSize:12},children:f.emoji}),e.jsx("span",{style:{flex:1,fontSize:10,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--muted)"},children:t.title||"—"}),e.jsx("span",{className:`badge ${p}`,style:{fontSize:8},children:t.status})]},t.id)})})]})]})]})]})}export{U as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as y,a4 as e}from"./vendor-5MxLWm27.js";import{L as oe}from"./LastUpdated-BVeFtHFH.js";import{l as le,s as de,p as ce,e as pe,u as ge,b as he}from"./index-Bjt1AMWV.js";import{R as F,L as xe,C as me,X as U,Y as P,T as q,a as Q,b as Y,c as ue,B as Z,d as A}from"./charts-C5TghfcA.js";const J={active:"var(--cyan)",complete:"var(--green)",paused:"var(--amber)",archived:"var(--muted)",pending:"var(--muted)"},fe={critical:"var(--red)",high:"var(--red)",medium:"var(--amber)",low:"var(--muted)"},ye={blocked:"🚫",hitl_pending:"🚨",overdue:"⏰",agent_error:"🔴",sla_breach:"💥"},ve={task_complete:"✅",task_failed:"❌",decision:"🧠",risk:"⚠️",milestone:"🏁"},W={green:"var(--green)",amber:"var(--amber)",red:"var(--red)"};function z(t){if(!t)return"—";try{const a=Math.round((Date.now()-new Date(t))/6e4);return a<1?"just now":a<60?`${a}m ago`:a<1440?`${Math.round(a/60)}h ago`:`${Math.round(a/1440)}d ago`}catch{return t}}function ee(t,a){if(!t)return null;try{const r=Math.ceil((new Date(t)-Date.now())/864e5);return a?{label:new Date(t).toLocaleDateString(),color:"var(--muted)"}:r<0?{label:`${Math.abs(r)}d overdue`,color:"var(--red)"}:r===0?{label:"due today",color:"var(--amber)"}:r===1?{label:"due tomorrow",color:"var(--amber)"}:{label:`in ${r}d`,color:"var(--muted)"}}catch{return{label:t,color:"var(--muted)"}}}function B(t){const a=(t._risks||[]).filter(d=>!d.resolved),r=t._progress_pct??0,o=t.target_completion?Math.ceil((new Date(t.target_completion)-Date.now())/864e5):999,i=t._task_counts||{};return a.some(d=>d.severity==="critical")||(i.blocked||0)>2||o<-3?"red":a.length>1||(i.hitl||0)>0||o<0||r<30?"amber":"green"}function je(t,a){const r=t._task_counts||{},o=[`# ${t.name}`,`**Status**: ${t.status} | **Progress**: ${t._progress_pct??0}% | **Health**: ${B(t).toUpperCase()}`,`**Owner**: ${a.find(l=>l.id===t.owner)?.name||t.owner}`,t.target_completion?`**Target**: ${new Date(t.target_completion).toLocaleDateString()}`:"",`**Tasks**: ${r.done||0}/${r.total||0} done`,"","## Description",t.description||"—","","## Milestones",...(t.milestones||[]).map(l=>`- [${l.status==="complete"?"x":" "}] **${l.title}** (${l.status})`),"","## Risks",...(t._risks||[]).filter(l=>!l.resolved).map(l=>`- 🚨 [${l.severity}] ${l.description}`),"","## Decisions",...(t.decisions||[]).map(l=>`- 🧠 **${l.decision}**`),"",`_Exported ${new Date().toLocaleString()}_`],i=new Blob([o.join(`
|
|
2
|
+
`)],{type:"text/markdown"}),d=URL.createObjectURL(i),g=document.createElement("a");g.href=d,g.download=`${t.id}.md`,g.click(),URL.revokeObjectURL(d)}function I({label:t,color:a,size:r=9}){return e.jsx("span",{style:{fontSize:r,padding:"2px 8px",borderRadius:4,fontWeight:800,textTransform:"uppercase",letterSpacing:"0.08em",color:a,background:`${a}11`,border:`1px solid ${a}44`,fontFamily:"JetBrains Mono, monospace",boxShadow:`0 0 10px ${a}11`},children:t})}function te({pct:t,size:a=56,color:r="var(--cyan)"}){const o=(a-10)/2,i=2*Math.PI*o,d=i*(t/100);return e.jsxs("svg",{width:a,height:a,style:{transform:"rotate(-90deg)",flexShrink:0,filter:`drop-shadow(0 0 5px ${r}33)`},children:[e.jsx("circle",{cx:a/2,cy:a/2,r:o,fill:"none",stroke:"rgba(255,255,255,.03)",strokeWidth:8}),e.jsx("circle",{cx:a/2,cy:a/2,r:o,fill:"none",stroke:r,strokeWidth:8,strokeDasharray:`${d} ${i}`,strokeLinecap:"round",style:{transition:"stroke-dasharray .8s cubic-bezier(0.4, 0, 0.2, 1)"}}),e.jsxs("text",{x:a/2,y:a/2,textAnchor:"middle",dominantBaseline:"middle",style:{fontSize:a*.2,fontWeight:900,fill:r,transform:"rotate(90deg)",transformOrigin:`${a/2}px ${a/2}px`,fontFamily:"Rajdhani, sans-serif"},children:[t,"%"]})]})}function $({agentId:t,agents:a,isOwner:r}){const o=a.find(i=>i.id===t);return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:9,padding:"3px 10px",borderRadius:6,background:r?"rgba(0,240,255,0.06)":"rgba(255,255,255,0.02)",border:`1px solid ${r?"rgba(0,240,255,0.3)":"var(--border)"}`,color:r?"var(--cyan)":"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsx("span",{style:{fontSize:14},children:o?.emoji||"🤖"}),e.jsx("span",{children:(o?.name||t).toUpperCase()}),r&&e.jsx("span",{style:{color:"var(--amber)",marginLeft:2},children:"◈"})]})}function ae({health:t}){return e.jsx("span",{title:`Health: ${t}`,style:{display:"inline-block",width:10,height:10,borderRadius:"50%",background:W[t],flexShrink:0,boxShadow:`0 0 6px ${W[t]}`}})}function re({iso:t}){const a=ee(t,!1);return a?e.jsxs("span",{style:{fontSize:10,color:a.color,fontWeight:600},children:["⏱ ",a.label]}):null}function be({project:t}){const a=t.milestones||[];if(!a.length)return e.jsx("div",{style:{fontSize:11,color:"var(--muted)",padding:20,textAlign:"center",border:"1px dashed var(--border)",borderRadius:8},children:"SIGNAL_LOSS // NO MILESTONES DEFINED"});const r=new Date(t.created_at||Date.now()),o=new Date(t.target_completion||Date.now()+30*864e5),i=Math.max(1,o-r),d=Math.max(0,Math.min(100,(Date.now()-r)/i*100)),g={complete:"var(--green)","in-progress":"var(--cyan)",pending:"rgba(255,255,255,0.05)",blocked:"var(--red)"};return e.jsxs("div",{style:{position:"relative",paddingTop:12},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:9,color:"var(--muted)",marginBottom:10,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsxs("span",{children:["[ T_START: ",r.toLocaleDateString().toUpperCase()," ]"]}),e.jsx("span",{style:{color:"var(--amber)",textShadow:"0 0 8px var(--amber)"},children:"[ MISSION_DAY_NOW ]"}),e.jsxs("span",{children:["[ T_END: ",o.toLocaleDateString().toUpperCase()," ]"]})]}),e.jsxs("div",{style:{position:"relative",background:"rgba(0,0,0,0.2)",borderRadius:8,padding:"16px 0",border:"1px solid var(--border)"},children:[e.jsx("div",{style:{position:"absolute",left:`${d}%`,top:0,bottom:0,width:1,background:"var(--amber)",boxShadow:"0 0 10px var(--amber)",zIndex:2,opacity:.8}}),a.map(l=>{const u=l.due?new Date(l.due):o,h=Math.max(4,Math.min(100,(u-r)/i*100)),c=l.status==="complete";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8,padding:"0 16px"},children:[e.jsx("div",{style:{fontSize:10,color:c?"var(--muted)":"var(--text)",width:160,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:700,fontFamily:"JetBrains Mono, monospace"},title:l.title.toUpperCase(),children:l.title.toUpperCase()}),e.jsx("div",{style:{flex:1,position:"relative",height:12,background:"rgba(255,255,255,0.02)",borderRadius:3},children:e.jsx("div",{style:{position:"absolute",left:0,width:`${h}%`,height:"100%",borderRadius:3,background:g[l.status]||"rgba(255,255,255,0.05)",boxShadow:!c&&l.status!=="pending"?`0 0 12px ${g[l.status]}44`:"none",transition:"width 1s cubic-bezier(0.4, 0, 0.2, 1)"}})}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",width:60,flexShrink:0,textAlign:"right",fontFamily:"JetBrains Mono, monospace"},children:l.due?new Date(l.due).toLocaleDateString("en",{month:"short",day:"numeric"}).toUpperCase():"--"})]},l.id)})]})]})}function Se({project:t,tasks:a}){const r=a.filter(c=>(t.task_ids||[]).includes(c.id)),o=r.length;if(!o)return e.jsx("div",{style:{fontSize:11,color:"var(--muted)",padding:20,textAlign:"center",border:"1px dashed var(--border)",borderRadius:8},children:"INDEX_EMPTY // NO TASKS LINKED"});const i=new Date(t.created_at||Date.now()),d=new Date(t.target_completion||Date.now()+7*864e5),g=Math.max(1,Math.ceil((d-i)/864e5)),l=r.filter(c=>c.completed_at).map(c=>Math.max(0,Math.ceil((new Date(c.completed_at)-i)/864e5))).sort((c,v)=>c-v),u=Math.ceil((Date.now()-i)/864e5),h=Array.from({length:g+1},(c,v)=>({day:v,ideal:Math.round(o-o/g*v),actual:v<=u?o-l.filter(f=>f<=v).length:void 0}));return e.jsx(F,{width:"100%",height:220,children:e.jsxs(xe,{data:h,margin:{top:10,right:30,left:0,bottom:10},children:[e.jsx(me,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.03)",vertical:!1}),e.jsx(U,{dataKey:"day",axisLine:!1,tickLine:!1,tick:{fontSize:9,fill:"var(--muted)",fontFamily:"JetBrains Mono, monospace"}}),e.jsx(P,{axisLine:!1,tickLine:!1,tick:{fontSize:9,fill:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},orientation:"right"}),e.jsx(q,{contentStyle:{background:"rgba(8,8,16,0.9)",border:"1px solid var(--border)",borderRadius:8,fontSize:10,fontFamily:"JetBrains Mono, monospace"},itemStyle:{padding:"2px 0"}}),e.jsx(Q,{verticalAlign:"top",height:36,iconType:"circle",wrapperStyle:{fontSize:9,fontFamily:"JetBrains Mono, monospace",letterSpacing:"0.05em"}}),e.jsx(Y,{type:"monotone",dataKey:"ideal",stroke:"rgba(255,255,255,0.1)",strokeDasharray:"5 5",dot:!1,name:"IDEAL_TRAJECTORY",strokeWidth:1}),e.jsx(Y,{type:"monotone",dataKey:"actual",stroke:"var(--cyan)",strokeWidth:3,dot:{r:2,fill:"var(--cyan)"},name:"REAL_VELOCITY"}),e.jsx(ue,{x:u,stroke:"var(--amber)",strokeDasharray:"3 3",label:{position:"top",value:"NOW",fill:"var(--amber)",fontSize:8,fontWeight:900}})]})})}function _e({project:t}){const a=t.budget?.allocated_usd||0,r=t.budget?.spent_usd||0,o=Math.max(0,a-r),i=a?Math.round(r/a*100):0,d=[{name:"BUDGET_INDEX",Spent:r,Remaining:o}],g=i>90?"var(--red)":i>75?"var(--amber)":"var(--cyan)";return e.jsxs("div",{className:"card shadow-glow",style:{background:"rgba(0,0,0,0.2)",padding:16},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:10,alignItems:"flex-end"},children:[e.jsxs("div",{children:[e.jsx("div",{className:"section-title",style:{fontSize:9,marginBottom:4},children:"RESOURCE_EXPENDITURE"}),e.jsxs("div",{style:{fontSize:18,fontWeight:900,color:g,fontFamily:"Rajdhani, sans-serif"},children:["$",r.toFixed(2)," ",e.jsxs("span",{style:{fontSize:11,color:"var(--muted)",fontWeight:600},children:["/ $",a.toFixed(2)]})]})]}),e.jsxs("div",{style:{textAlign:"right"},children:[e.jsx("div",{style:{fontSize:8,color:"var(--muted)",fontWeight:800,marginBottom:2},children:"UTILIZATION"}),e.jsxs("div",{style:{fontSize:14,fontWeight:900,color:g,fontFamily:"JetBrains Mono, monospace"},children:[i,"%"]})]})]}),e.jsx(F,{width:"100%",height:24,children:e.jsxs(Z,{data:d,layout:"vertical",margin:{top:0,right:0,left:0,bottom:0},children:[e.jsx(U,{type:"number",hide:!0,domain:[0,a||1]}),e.jsx(P,{type:"category",dataKey:"name",hide:!0}),e.jsx(A,{dataKey:"Spent",stackId:"a",fill:g,radius:[4,0,0,4],boxShadow:`0 0 10px ${g}33`}),e.jsx(A,{dataKey:"Remaining",stackId:"a",fill:"rgba(255,255,255,0.03)",radius:[0,4,4,0]})]})}),i>80&&e.jsxs("div",{style:{marginTop:12,padding:"4px 8px",background:"rgba(255,23,68,0.1)",border:"1px solid var(--red)",borderRadius:4,display:"flex",gap:6,alignItems:"center"},children:[e.jsx("span",{style:{fontSize:12},children:"🚨"}),e.jsx("span",{style:{fontSize:9,fontWeight:800,color:"var(--red)",letterSpacing:"0.05em"},children:"CRITICAL_THRESHOLD_BREACHED // REDUCE_CYCLES"})]})]})}function ke({project:t,tasks:a,agents:r}){const o=a.filter(d=>(t.task_ids||[]).includes(d.id)),i=(t.team||[]).map(d=>{const g=r.find(u=>u.id===d)||{},l=o.filter(u=>u.assigned_to===d);return{name:(g.name||d).toUpperCase(),Open:l.filter(u=>!["complete","failed"].includes(u.status)).length,Done:l.filter(u=>u.status==="complete").length,Blocked:l.filter(u=>["blocked","needs_human_decision"].includes(u.status)).length}}).filter(d=>d.Open+d.Done+d.Blocked>0);return i.length?e.jsx(F,{width:"100%",height:Math.max(120,i.length*44),children:e.jsxs(Z,{data:i,layout:"vertical",margin:{top:0,right:30,left:20,bottom:0},children:[e.jsx(U,{type:"number",hide:!0}),e.jsx(P,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,tick:{fontSize:9,fill:"var(--text)",fontFamily:"JetBrains Mono, monospace",fontWeight:800},width:100}),e.jsx(q,{contentStyle:{background:"rgba(8,8,16,0.9)",border:"1px solid var(--border)",borderRadius:8,fontSize:10,fontFamily:"JetBrains Mono, monospace"}}),e.jsx(Q,{verticalAlign:"top",height:36,iconType:"circle",wrapperStyle:{fontSize:9,fontFamily:"JetBrains Mono, monospace"}}),e.jsx(A,{dataKey:"Done",fill:"var(--green)",stackId:"a",barSize:12}),e.jsx(A,{dataKey:"Open",fill:"var(--cyan)",stackId:"a"}),e.jsx(A,{dataKey:"Blocked",fill:"var(--red)",stackId:"a",radius:[0,3,3,0]})]})}):e.jsx("div",{style:{fontSize:11,color:"var(--muted)",padding:20,textAlign:"center",border:"1px dashed var(--border)",borderRadius:8},children:"NO_TEAM_METRICS"})}function Ce({project:t,okrs:a}){if(!a?.objectives?.length)return e.jsx("div",{style:{fontSize:11,color:"var(--muted)",padding:20,textAlign:"center",border:"1px dashed var(--border)",borderRadius:8},children:"OKR_DATABASE_OFFLINE"});const r=a.objectives.filter(o=>(t.okr_ids||[]).includes(o.id)||(t.tags||[]).some(i=>o.objective.toLowerCase().includes(i.toLowerCase())));return r.length?e.jsx("div",{style:{display:"grid",gap:12},children:r.map(o=>e.jsxs("div",{className:"card shadow-glow",style:{padding:"12px 16px",background:"rgba(255,255,255,0.01)"},children:[e.jsxs("div",{style:{fontSize:11,fontWeight:800,color:"var(--amber)",marginBottom:10,letterSpacing:"0.05em"},children:["🎯 ",o.objective.toUpperCase()]}),(o.key_results||[]).map(i=>{const d=i.target?Math.min(100,Math.round(i.current/i.target*100)):0,g=d>=100?"var(--green)":d>=50?"var(--cyan)":"var(--amber)";return e.jsxs("div",{style:{marginBottom:8},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:5,fontSize:9,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsx("span",{style:{color:"var(--muted)"},children:i.result.toUpperCase()}),e.jsxs("span",{style:{color:g},children:[i.current," / ",i.target," ",i.unit.toUpperCase()]})]}),e.jsx("div",{className:"progress-track",style:{height:4,background:"rgba(255,255,255,0.03)"},children:e.jsx("div",{className:"progress-fill",style:{width:`${d}%`,background:g,height:4,boxShadow:`0 0 6px ${g}44`}})})]},i.id)})]},o.id))}):e.jsx("div",{style:{fontSize:11,color:"var(--muted)",padding:20,textAlign:"center"},children:"NO_OKR_LINKAGE_DETECTED"})}function G({ms:t,agents:a}){const r=ee(t.due,t.status==="complete"),o=a.find(l=>l.id===t.assigned_to),i={complete:"◈","in-progress":"◎",pending:"○",blocked:"⊠"}[t.status]||"○",d=J[t.status]||"var(--muted)",g=t.status==="complete";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 0",borderBottom:"1px solid rgba(255,255,255,0.03)",opacity:g?.6:1,transition:"all 0.2s"},className:"task-row-hover",children:[e.jsx("span",{style:{fontSize:12,flexShrink:0,color:d,textShadow:g?"none":`0 0 8px ${d}`},children:i}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:700,color:g?"var(--muted)":"var(--text)",fontFamily:"JetBrains Mono, monospace"},children:t.title.toUpperCase()}),e.jsxs("div",{style:{fontSize:9,color:"var(--muted)",marginTop:4,display:"flex",gap:12,fontFamily:"JetBrains Mono, monospace",fontWeight:600},children:[o&&e.jsxs("span",{children:["[ OP: ",o.name.toUpperCase()," ]"]}),(t.task_ids||[]).length>0&&e.jsxs("span",{children:["[ ",t.task_ids.length," CYCLES ]"]}),t.auto_complete&&e.jsx("span",{style:{color:"var(--cyan)"},children:"[ FLASH_SYNC ]"})]})]}),r&&e.jsx("span",{style:{fontSize:9,color:r.color,flexShrink:0,fontFamily:"JetBrains Mono, monospace",fontWeight:800},children:r.label.toUpperCase()}),e.jsx(I,{label:t.status,color:d,size:8})]})}function X({risk:t,agents:a}){const r=fe[t.severity]||"var(--muted)",o=a.find(i=>i.id===t.detected_by);return e.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 14px",marginBottom:10,borderRadius:8,background:`${r}08`,border:`1px solid ${r}33`,boxShadow:`0 0 15px ${r}05`},children:[e.jsx("span",{style:{fontSize:16,flexShrink:0},children:ye[t.type]||"⚠️"}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:11,color:"var(--text)",fontWeight:700,marginBottom:4,fontFamily:"JetBrains Mono, monospace"},children:t.description.toUpperCase()}),e.jsxs("div",{style:{fontSize:9,color:"var(--muted)",display:"flex",gap:12,fontFamily:"JetBrains Mono, monospace",fontWeight:600},children:[o&&e.jsxs("span",{children:["[ SENTINEL: ",o.name.toUpperCase()," ]"]}),e.jsxs("span",{children:["[ T_DETECTION: ",z(t.detected_at).toUpperCase()," ]"]})]})]}),e.jsx(I,{label:t.severity,color:r,size:8})]})}function V({item:t,agents:a}){const r=a.find(o=>o.id===t.agent);return e.jsxs("div",{style:{display:"flex",gap:12,padding:"8px 0",borderBottom:"1px solid rgba(255,255,255,0.03)"},className:"task-row-hover",children:[e.jsx("span",{style:{fontSize:12,flexShrink:0,opacity:.6},children:ve[t.type]||"•"}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:11,color:"var(--text)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"JetBrains Mono, monospace",fontWeight:600},children:t.text.toUpperCase()}),e.jsxs("div",{style:{fontSize:9,color:"var(--muted)",marginTop:4,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[r&&e.jsxs("span",{children:["[ ",r.name.toUpperCase()," ]"]}),e.jsx("span",{style:{color:"rgba(255,255,255,0.1)",margin:"0 6px"},children:"//"}),e.jsx("span",{children:z(t.ts).toUpperCase()})]})]})]})}function we({sessions:t,agents:a}){return t?.length?e.jsxs("table",{style:{width:"100%",fontSize:11,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{borderBottom:"1px solid var(--border)"},children:["Task","Agent","Proc ID","Status","Completed"].map(r=>e.jsx("th",{style:{textAlign:"left",padding:"4px 8px",fontSize:10,color:"var(--muted)",fontWeight:600},children:r},r))})}),e.jsx("tbody",{children:t.map((r,o)=>{const i=a.find(l=>l.id===r.assigned_to),d=(r.status||"").toLowerCase().replace(/ /g,"-"),g={complete:"badge-complete",failed:"badge-failed","in-progress":"badge-in-progress"}[d]||"badge-pending";return e.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,.03)"},children:[e.jsx("td",{style:{padding:"5px 8px",color:"var(--cyan)",fontFamily:"monospace",fontSize:10},children:r.task_id}),e.jsx("td",{style:{padding:"5px 8px"},children:i?`${i.emoji} ${i.name}`:r.assigned_to}),e.jsx("td",{style:{padding:"5px 8px",color:"var(--muted)",fontFamily:"monospace",fontSize:10},children:r.proc_id||"—"}),e.jsx("td",{style:{padding:"5px 8px"},children:e.jsx("span",{className:`badge ${g}`,children:r.status})}),e.jsx("td",{style:{padding:"5px 8px",color:"var(--muted)"},children:r.completed_at?z(r.completed_at):"—"})]},o)})})]}):e.jsx("div",{style:{fontSize:11,color:"var(--muted)"},children:"No sessions recorded yet."})}function Te({tasks:t,projectTaskIds:a,agents:r}){const[o,i]=y.useState(null),d=t.filter(l=>a.includes(l.id)),g=[{key:"pending",label:"Pending",color:"var(--muted)"},{key:"in-progress",label:"In Progress",color:"var(--cyan)"},{key:"needs_human_decision",label:"🚨 HITL",color:"var(--purple)"},{key:"blocked",label:"Blocked",color:"var(--red)"},{key:"complete",label:"Complete",color:"var(--green)"},{key:"failed",label:"Failed",color:"var(--red)"}];return d.length?e.jsx("div",{style:{display:"grid",gap:12},children:g.map(l=>{const u=d.filter(h=>h.status===l.key);return u.length?e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:10,fontWeight:600,color:l.color,textTransform:"uppercase",letterSpacing:".06em",marginBottom:6},children:[l.label," (",u.length,")"]}),u.map(h=>{const c=o===h.id,v=r.find(E=>E.id===h.assigned_to),f=(h.sla?.priority||h.priority||"").toUpperCase();return e.jsxs("div",{onClick:()=>i(c?null:h.id),style:{marginBottom:6,padding:"8px 10px",background:"var(--surface)",border:`1px solid ${c?"rgba(0,229,255,.3)":"var(--border)"}`,borderRadius:6,cursor:"pointer"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontSize:10,color:"var(--muted)",fontFamily:"monospace",minWidth:50},children:h.id}),e.jsx("span",{style:{flex:1,fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.title}),f&&e.jsx("span",{className:f==="P1"?"p1":f==="P2"?"p2":"p3",children:f}),v&&e.jsx("span",{style:{fontSize:11},children:v.emoji}),e.jsx("span",{style:{fontSize:10,color:"var(--muted)"},children:c?"▲":"▼"})]}),c&&e.jsxs("div",{style:{marginTop:10,display:"grid",gap:8},children:[h.hitl_reason&&e.jsxs("div",{style:{padding:"6px 10px",background:"rgba(224,64,251,.08)",border:"1px solid rgba(224,64,251,.25)",borderRadius:5,fontSize:11,color:"var(--purple)"},children:["🚨 ",h.hitl_reason]}),h.description&&e.jsx("div",{style:{fontSize:11,color:"var(--muted)",lineHeight:1.5},children:h.description}),h.output&&e.jsxs("div",{style:{fontSize:11,color:"var(--text)",lineHeight:1.5,padding:"6px 10px",background:"rgba(0,230,118,.04)",border:"1px solid rgba(0,230,118,.15)",borderRadius:5},children:["✅ ",h.output]}),e.jsxs("div",{style:{display:"flex",gap:16,fontSize:10,color:"var(--muted)",flexWrap:"wrap"},children:[h.proc_id&&e.jsxs("span",{children:["Proc: ",e.jsx("span",{style:{color:"var(--cyan)"},children:h.proc_id})]}),h.completed_at&&e.jsxs("span",{children:["Done: ",new Date(h.completed_at).toLocaleString()]})]})]})]},h.id)})]},l.key):null})}):e.jsx("div",{style:{fontSize:11,color:"var(--muted)"},children:"No tasks linked yet."})}function Ee({project:t,agents:a,selected:r,onClick:o}){const i=t._task_counts||{},d=t._milestone_counts||{},g=t._progress_pct??0,l=(t._risks||[]).filter(c=>!c.resolved),u=B(t),h=r?"var(--cyan)":l.length?"var(--red)":"var(--border)";return e.jsxs("div",{onClick:o,className:"card shadow-glow",style:{cursor:"pointer",transition:"all .2s cubic-bezier(0.4, 0, 0.2, 1)",borderColor:h,background:r?"rgba(0,240,255,0.03)":"rgba(255,255,255,0.01)",padding:0,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:18},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,marginBottom:16},children:[e.jsx(te,{pct:g,size:64,color:g===100?"var(--green)":l.length?"var(--red)":"var(--cyan)"}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6,flexWrap:"wrap"},children:[e.jsx(ae,{health:u}),e.jsx("span",{style:{fontWeight:900,fontSize:14,color:r?"var(--cyan)":"var(--text)",fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.02em"},children:t.name.toUpperCase()})]}),e.jsxs("div",{style:{fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[t.id," // STAT:",t.status.toUpperCase()]})]})]}),e.jsx("div",{style:{fontSize:11,color:"var(--muted)",lineHeight:1.6,marginBottom:16,height:36,overflow:"hidden"},children:t.description}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:8,marginBottom:16},children:[["CYCLES",`${i.done||0}/${i.total||0}`,"var(--cyan)"],["PHASES",`${d.done||0}/${d.total||0}`,"var(--green)"],["SIG_Q",t._quality_score?`◈${t._quality_score}`:"--","var(--amber)"],["VEL",t._velocity??"--","var(--muted)"]].map(([c,v,f])=>e.jsxs("div",{style:{textAlign:"center",padding:"8px 4px",background:"rgba(255,255,255,0.02)",borderRadius:6,border:"1px solid var(--border)"},children:[e.jsx("div",{style:{fontSize:8,color:"var(--muted)",fontWeight:800,marginBottom:4,letterSpacing:"0.05em"},children:c}),e.jsx("div",{style:{fontSize:11,fontWeight:800,color:f,fontFamily:"JetBrains Mono, monospace"},children:v})]},c))}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[e.jsx($,{agentId:t.owner,agents:a,isOwner:!0}),e.jsx("div",{style:{marginLeft:"auto",display:"flex",gap:10,alignItems:"center"},children:e.jsx(re,{iso:t.target_completion})})]})]}),l.length>0&&e.jsxs("div",{style:{padding:"8px 16px",background:"rgba(255,23,68,0.08)",borderTop:"1px solid rgba(255,23,68,0.2)",fontSize:9,color:"var(--red)",fontWeight:800,fontFamily:"JetBrains Mono, monospace"},children:["🚨 CRITICAL_ALERT: ",l.length," ACTIVE_RISKS_DETECTED"]})]})}const Ne=["Overview","Milestones","Gantt","Tasks","Burndown","Risks","Team","Workload","Budget","OKRs","Activity","Sessions","Decisions"];function Ie({project:t,agents:a,tasks:r,okrs:o,onClose:i,onReplan:d,onExecute:g,onSaveBudget:l,onSaveOkr:u,lastUpdated:h}){const[c,v]=y.useState("Overview"),[f,E]=y.useState({allocated_usd:t.budget?.allocated_usd??0,spent_usd:t.budget?.spent_usd??0,forecast_usd:t.budget?.forecast_usd??0,alert_threshold:t.budget?.alert_threshold??.8}),[j,D]=y.useState({objective_id:t.okr_refs?.objective_id||"",kr_ids:(t.okr_refs?.kr_ids||[]).join(",")}),b=t._task_counts||{},k=t._milestone_counts||{},N=t._progress_pct??0,C=(t._risks||[]).filter(n=>!n.resolved),m=B(t),S=N===100?"var(--green)":C.length?"var(--red)":"var(--cyan)";return e.jsxs("div",{className:"card shadow-glow",style:{padding:0,overflow:"hidden",border:`1px solid ${S}44`,marginBottom:24,background:"rgba(8,8,16,0.6)"},children:[e.jsxs("div",{style:{padding:"24px 30px",background:"rgba(255,255,255,0.02)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:24},children:[e.jsx(te,{pct:N,size:100,color:S}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8,flexWrap:"wrap"},children:[e.jsx(ae,{health:m}),e.jsx("span",{style:{fontSize:24,fontWeight:900,fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.05em",color:"var(--text)"},children:t.name.toUpperCase()}),e.jsx(I,{label:t.status,color:J[t.status]||"var(--muted)"}),t.priority_weight&&e.jsx(I,{label:`PRIORITY_${t.priority_weight}`,color:"var(--amber)"}),e.jsx(I,{label:`${m.toUpperCase()}_HEALTH`,color:W[m]})]}),e.jsx("div",{style:{fontSize:13,color:"var(--muted)",lineHeight:1.6,marginBottom:12,maxWidth:800},children:t.description}),e.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",alignItems:"center"},children:[e.jsx($,{agentId:t.owner,agents:a,isOwner:!0}),t.target_completion&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:700,color:"var(--muted)"},children:[e.jsx("span",{style:{color:"var(--cyan)"},children:"T_DEADLINE:"}),e.jsx(re,{iso:t.target_completion})]}),e.jsx("div",{style:{display:"flex",gap:8},children:(t.tags||[]).map(n=>e.jsx(I,{label:n,color:"var(--cyan)",size:8},n))})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("button",{className:"btn-primary",onClick:()=>g?.(t.id),style:{padding:"8px 16px",fontSize:10},children:"EXECUTE_NOW"}),e.jsx("button",{className:"btn-primary",onClick:()=>d?.(t.id),style:{padding:"8px 16px",fontSize:10,background:"rgba(255,255,255,0.05)",border:"1px solid var(--border)"},children:"REPLAN"}),e.jsx("button",{className:"btn-primary",onClick:()=>je(t,a),style:{padding:"8px 16px",fontSize:10},children:"DOWNLOAD_INTEL"}),e.jsx("button",{className:"btn-primary",onClick:i,style:{padding:"8px 16px",fontSize:10,background:"rgba(255,255,255,0.05)",border:"1px solid var(--border)"},children:"CLOSE_MATRIX"}),e.jsx(oe,{ts:h})]})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",borderBottom:"1px solid var(--border)",background:"rgba(0,0,0,0.2)"},children:[["CYCLES_SYNC",`${b.done||0}/${b.total||0}`,"var(--cyan)"],["ACTIVE",b.active||0,"var(--amber)"],["BLOCKED",b.blocked||0,b.blocked?"var(--red)":"var(--muted)"],["HITL_GATE",b.hitl||0,b.hitl?"var(--purple)":"var(--muted)"],["PHASES",`${k.done||0}/${k.total||0}`,"var(--green)"],["QUAL_INDEX",t._quality_score?`◈${t._quality_score}`:"--","var(--amber)"],["VELOCITY",t._velocity??"--","var(--muted)"],["FISCAL_BURN",`$${t.budget?.spent_usd??0}`,"var(--cyan)"]].map(([n,x,w])=>e.jsxs("div",{style:{textAlign:"center",padding:"16px 8px",borderRight:"1px solid var(--border)"},children:[e.jsx("div",{style:{fontSize:8,color:"var(--muted)",marginBottom:6,fontWeight:800,letterSpacing:"0.1em"},children:n}),e.jsx("div",{style:{fontSize:15,fontWeight:900,color:w,fontFamily:"JetBrains Mono, monospace"},children:x})]},n))}),e.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border)",background:"rgba(255,255,255,0.02)",overflowX:"auto",padding:"0 20px",gap:4},children:Ne.map(n=>{const x=n==="Risks"&&C.length?C.length:n==="Tasks"&&b.total?b.total:n==="Milestones"&&k.total?k.total:null,w=c===n;return e.jsxs("button",{onClick:()=>v(n),style:{background:"none",border:"none",cursor:"pointer",padding:"14px 16px",fontSize:10,fontFamily:"Rajdhani, sans-serif",fontWeight:800,whiteSpace:"nowrap",color:w?"var(--cyan)":"var(--muted)",borderBottom:w?"2px solid var(--cyan)":"2px solid transparent",letterSpacing:"0.1em",transition:"all 0.2s"},children:[n.toUpperCase(),x?` [${x}]`:""]},n)})}),e.jsxs("div",{style:{padding:30,minHeight:400},children:[c==="Overview"&&e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:30},children:[e.jsxs("div",{children:[e.jsx("div",{className:"section-title",style:{fontSize:9},children:"MISSION_PHASE_PROGRESS"}),e.jsx("div",{className:"progress-track",style:{height:6,marginBottom:16},children:e.jsx("div",{className:"progress-fill",style:{width:`${k.total?Math.round(k.done/k.total*100):0}%`,background:"var(--green)",boxShadow:"0 0 8px var(--green)44"}})}),e.jsx("div",{style:{display:"flex",flexDirection:"column"},children:(t.milestones||[]).slice(0,5).map(n=>e.jsx(G,{ms:n,agents:a},n.id))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"section-title",style:{fontSize:9},children:"REALTIME_TRANSMISSION_FEED"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[(t._activity||[]).slice(0,8).map((n,x)=>e.jsx(V,{item:n,agents:a},x)),(!t._activity||t._activity.length===0)&&e.jsx("div",{style:{fontSize:11,color:"var(--muted)",padding:20,textAlign:"center"},children:"FEED_SILENT"})]})]}),C.length>0&&e.jsxs("div",{style:{gridColumn:"1/-1"},children:[e.jsx("div",{className:"section-title",style:{color:"var(--red)",fontSize:9},children:"THREAT_MATRIX"}),C.slice(0,3).map(n=>e.jsx(X,{risk:n,agents:a},n.id))]})]}),c==="Milestones"&&e.jsx("div",{style:{maxWidth:800,margin:"0 auto"},children:(t.milestones||[]).map(n=>e.jsx(G,{ms:n,agents:a},n.id))}),c==="Gantt"&&e.jsx(be,{project:t}),c==="Tasks"&&e.jsx(Te,{tasks:r,projectTaskIds:t.task_ids||[],agents:a}),c==="Burndown"&&e.jsx(Se,{project:t,tasks:r}),c==="Risks"&&e.jsx("div",{style:{maxWidth:800,margin:"0 auto"},children:C.length===0?e.jsx("div",{style:{padding:60,textAlign:"center",color:"var(--green)",fontWeight:800},children:"THREAT_LEVEL_ZERO // ALL_SYSTEMS_OPTIMAL"}):C.map(n=>e.jsx(X,{risk:n,agents:a},n.id))}),c==="Team"&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(240px,1fr))",gap:16},children:(t.team||[]).map(n=>{const x=a.find(O=>O.id===n),w=n===t.owner;return e.jsxs("div",{className:"card shadow-glow",style:{borderColor:w?"var(--cyan)":"var(--border)",background:"rgba(255,255,255,0.02)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:16},children:[e.jsx("span",{style:{fontSize:28},children:x?.emoji||"🤖"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:900,fontSize:13,fontFamily:"Rajdhani, sans-serif"},children:x?.name.toUpperCase()||n}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontWeight:700},children:x?.role?.toUpperCase()||"OPERATIVE"})]}),w&&e.jsx(I,{label:"REDACTED",color:"var(--amber)",size:7})]}),e.jsxs("div",{style:{display:"flex",gap:6},children:[e.jsxs("div",{style:{flex:1,textAlign:"center",background:"rgba(0,0,0,0.2)",padding:"10px",borderRadius:8,border:"1px solid var(--border)"},children:[e.jsx("div",{style:{fontSize:8,color:"var(--muted)",marginBottom:4},children:"CYCLES"}),e.jsx("div",{style:{fontWeight:900,color:"var(--cyan)",fontSize:13,fontFamily:"JetBrains Mono, monospace"},children:x?.tasks_completed||0})]}),e.jsxs("div",{style:{flex:1,textAlign:"center",background:"rgba(0,0,0,0.2)",padding:"10px",borderRadius:8,border:"1px solid var(--border)"},children:[e.jsx("div",{style:{fontSize:8,color:"var(--muted)",marginBottom:4},children:"QUALITY"}),e.jsxs("div",{style:{fontWeight:900,color:"var(--amber)",fontSize:13,fontFamily:"JetBrains Mono, monospace"},children:["◈",(x?.avg_quality||0).toFixed(1)]})]})]})]},n)})}),c==="Workload"&&e.jsx(ke,{project:t,tasks:r,agents:a}),c==="Budget"&&e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:18},children:[e.jsx(_e,{project:t}),e.jsxs("div",{className:"card",style:{background:"rgba(0,0,0,0.2)"},children:[e.jsx("div",{className:"section-title",style:{fontSize:9,marginBottom:12},children:"BUDGET_CONTROL"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("input",{className:"input-base",type:"number",placeholder:"Allocated USD",value:f.allocated_usd,onChange:n=>E(x=>({...x,allocated_usd:Number(n.target.value||0)}))}),e.jsx("input",{className:"input-base",type:"number",placeholder:"Spent USD",value:f.spent_usd,onChange:n=>E(x=>({...x,spent_usd:Number(n.target.value||0)}))}),e.jsx("input",{className:"input-base",type:"number",placeholder:"Forecast USD",value:f.forecast_usd,onChange:n=>E(x=>({...x,forecast_usd:Number(n.target.value||0)}))}),e.jsx("input",{className:"input-base",type:"number",step:"0.01",placeholder:"Alert threshold (0-1)",value:f.alert_threshold,onChange:n=>E(x=>({...x,alert_threshold:Number(n.target.value||.8)}))}),e.jsx("button",{className:"btn-primary",onClick:()=>l?.(t.id,f),children:"SAVE_BUDGET"})]})]})]}),c==="OKRs"&&e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:18},children:[e.jsx(Ce,{project:t,okrs:o}),e.jsxs("div",{className:"card",style:{background:"rgba(0,0,0,0.2)"},children:[e.jsx("div",{className:"section-title",style:{fontSize:9,marginBottom:12},children:"OKR_LINK_CONTROL"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("input",{className:"input-base",placeholder:"Objective ID",value:j.objective_id,onChange:n=>D(x=>({...x,objective_id:n.target.value}))}),e.jsx("input",{className:"input-base",placeholder:"KR IDs (comma-separated)",value:j.kr_ids,onChange:n=>D(x=>({...x,kr_ids:n.target.value}))}),e.jsx("button",{className:"btn-primary",onClick:()=>u?.(t.id,{objective_id:j.objective_id||null,kr_ids:j.kr_ids.split(",").map(n=>n.trim()).filter(Boolean)}),children:"SAVE_OKR_LINKS"})]})]})]}),c==="Activity"&&e.jsx("div",{style:{maxWidth:800,margin:"0 auto"},children:(t._activity||[]).map((n,x)=>e.jsx(V,{item:n,agents:a},x))}),c==="Sessions"&&e.jsx(we,{sessions:t._sessions,agents:a}),c==="Decisions"&&e.jsx("div",{style:{display:"grid",gap:16},children:(t.decisions||[]).map(n=>(a.find(x=>x.id===n.decided_by),e.jsxs("div",{className:"card shadow-glow",style:{padding:20},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:12},children:[e.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:"var(--purple)",boxShadow:"0 0 8px var(--purple)"}}),e.jsx("span",{style:{flex:1,fontWeight:900,fontSize:14,fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.05em"},children:n.decision.toUpperCase()}),e.jsx("span",{style:{fontSize:9,color:"var(--muted)",fontWeight:700,fontFamily:"JetBrains Mono, monospace"},children:z(n.decided_at).toUpperCase()})]}),n.rationale&&e.jsx("div",{style:{fontSize:11,color:"var(--muted)",lineHeight:1.6,padding:"12px 16px",background:"rgba(255,255,255,0.01)",borderRadius:8,borderLeft:"2px solid var(--purple)",marginBottom:12},children:n.rationale}),e.jsxs("div",{style:{display:"flex",gap:20},children:[e.jsx($,{agentId:n.decided_by,agents:a}),n.task_id&&e.jsxs("span",{style:{fontSize:9,fontWeight:800,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:["ASSOCIATED_CYCLE: ",e.jsx("span",{style:{color:"var(--cyan)"},children:n.task_id})]})]})]},n.id)))})]})]})}function Be({filters:t,setFilters:a,sortBy:r,setSortBy:o}){return e.jsxs("div",{className:"card shadow-glow",style:{display:"flex",gap:12,padding:"14px 20px",marginBottom:24,alignItems:"center",flexWrap:"wrap",background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.05)"},children:[e.jsxs("div",{style:{position:"relative",flex:1,minWidth:200},children:[e.jsx("span",{style:{position:"absolute",left:14,top:"50%",transform:"translateY(-50%)",opacity:.4,fontSize:12},children:"🔍"}),e.jsx("input",{placeholder:"SEARCH_PROJECT_NEXUS...",className:"search-input",value:t.search,onChange:i=>a({...t,search:i.target.value}),style:{width:"100%",padding:"10px 14px 10px 40px",background:"rgba(0,0,0,0.2)",fontFamily:"JetBrains Mono, monospace",fontSize:11,letterSpacing:"0.05em"}})]}),e.jsxs("select",{className:"btn-secondary",value:t.status,onChange:i=>a({...t,status:i.target.value}),style:{padding:"8px 14px",fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsx("option",{value:"all",children:"ALL_STATUS"}),Object.keys(J).map(i=>e.jsx("option",{value:i,children:i.toUpperCase()},i))]}),e.jsxs("select",{className:"btn-secondary",value:t.health,onChange:i=>a({...t,health:i.target.value}),style:{padding:"8px 14px",fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsx("option",{value:"all",children:"ALL_HEALTH"}),e.jsx("option",{value:"healthy",children:"HEALTHY_ONLY"}),e.jsx("option",{value:"at-risk",children:"AT_RISK_ONLY"}),e.jsx("option",{value:"critical",children:"CRITICAL_ONLY"})]}),e.jsx("div",{style:{height:20,width:1,background:"rgba(255,255,255,0.1)",margin:"0 8px"}}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontWeight:800,fontFamily:"JetBrains Mono, monospace"},children:"SORT_BY:"}),e.jsxs("select",{className:"btn-secondary",value:r,onChange:i=>o(i.target.value),style:{padding:"8px 14px",fontSize:10,fontFamily:"JetBrains Mono, monospace",fontWeight:700},children:[e.jsx("option",{value:"name",children:"IDENTIFIER"}),e.jsx("option",{value:"progress",children:"PROGRESS_INDEX"}),e.jsx("option",{value:"deadline",children:"DEADLINE_T"}),e.jsx("option",{value:"health",children:"HEALTH_SCORE"}),e.jsx("option",{value:"priority",children:"PRIORITY_WT"})]})]})}function ze({data:t,lastUpdated:a,toast:r}){const{agents:o=[],tasks:i=[],okrs:d={}}=t||{},[g,l]=y.useState([]),[u,h]=y.useState(null),[c,v]=y.useState(!0),[f,E]=y.useState({status:"all",search:"",health:"all"}),[j,D]=y.useState("priority"),[b,k]=y.useState(!1),[N,C]=y.useState(null),[m,S]=y.useState({title:"",intent:"",description:"",priority:"P2",tags:"",project_hint:"",deadline:"",budget_usd:""}),n=y.useCallback(async()=>{try{const s=await le();l(s.projects||[])}catch{l([])}finally{v(!1)}},[]);y.useEffect(()=>{n()},[n]);const x=async()=>{if(!(!m.intent.trim()&&!m.title.trim())){k(!0);try{const s=await de({title:m.title||m.intent,intent:m.intent||m.title,description:m.description,priority:m.priority,tags:m.tags.split(",").map(p=>p.trim()).filter(Boolean),project_hint:m.project_hint||void 0,constraints:{deadline:m.deadline||void 0,budget_usd:m.budget_usd?Number(m.budget_usd):void 0}});C(s),await n(),S({title:"",intent:"",description:"",priority:"P2",tags:"",project_hint:"",deadline:"",budget_usd:""}),r?.(`Routed to ${s.decision==="create_new"?"new":"existing"} project: ${s.projectId}`,"success")}catch(s){r?.(s.message||"intake_failed","error")}finally{k(!1)}}},w=async s=>{try{await ce(s),await n(),r?.("Project plan updated","success")}catch(p){r?.(p.message||"project_replan_failed","error")}},O=async s=>{try{await pe(s),await n(),r?.("Execution launched","success")}catch(p){r?.(p.message||"project_execute_failed","error")}},ne=async(s,p)=>{try{await ge(s,p),await n(),r?.("Budget updated","success")}catch(T){r?.(T.message||"budget_update_failed","error")}},ie=async(s,p)=>{try{await he(s,p),await n(),r?.("OKR links updated","success")}catch(T){r?.(T.message||"okr_update_failed","error")}},R=y.useMemo(()=>g.map(s=>{const p=i.filter(_=>(s.task_ids||[]).includes(_.id)),T=p.filter(_=>_.status==="complete").length,M=p.length,K=s.milestones||[],se=K.filter(_=>_.status==="complete").length;return{...s,_task_counts:{total:M,done:T,active:p.filter(_=>_.status==="in-progress").length,blocked:p.filter(_=>_.status==="blocked").length,hitl:p.filter(_=>_.status==="needs_human_decision").length},_milestone_counts:{total:K.length,done:se},_progress_pct:M>0?Math.round(T/M*100):0,_risks:s._risks||[],_activity:s._activity||[]}}),[g,i]),H=y.useMemo(()=>R.filter(s=>!(f.status!=="all"&&s.status!==f.status||f.health!=="all"&&B(s)!==f.health||f.search&&!s.name.toLowerCase().includes(f.search.toLowerCase())&&!s.description.toLowerCase().includes(f.search.toLowerCase()))).sort((s,p)=>{if(j==="name")return s.name.localeCompare(p.name);if(j==="progress")return(p._progress_pct||0)-(s._progress_pct||0);if(j==="deadline")return new Date(s.target_completion||"9999")-new Date(p.target_completion||"9999");if(j==="health"){const T={healthy:0,"at-risk":1,critical:2};return T[B(p)]-T[B(s)]}return j==="priority"?(p.priority_weight||0)-(s.priority_weight||0):0}),[R,f,j]),L=R.find(s=>s.id===u);return c?e.jsxs("div",{style:{padding:40,textAlign:"center"},children:[e.jsx("div",{className:"loading-spinner",style:{margin:"0 auto 20px"}}),e.jsx("div",{style:{fontSize:12,color:"var(--cyan)",fontWeight:800,fontFamily:"JetBrains Mono, monospace",letterSpacing:"0.2em"},children:"SYNCHRONIZING_STRATEGIC_DATABASE..."})]}):e.jsxs("div",{style:{padding:"20px 0"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",marginBottom:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{margin:0,fontSize:28,fontWeight:900,fontFamily:"Rajdhani, sans-serif",letterSpacing:"0.05em"},children:"STRATEGIC_COMMAND"}),e.jsxs("div",{style:{fontSize:10,color:"var(--muted)",marginTop:4,fontFamily:"JetBrains Mono, monospace"},children:["PROJECT_NEXUS_v4.2 // TOTAL_NODES: ",R.length]})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("div",{className:"stat-v",style:{textAlign:"right"},children:[e.jsx("div",{className:"stat-l",children:"AVG_HEALTH"}),e.jsx("div",{className:"stat-n",style:{color:"var(--green)"},children:"OPTIMAL"})]}),e.jsxs("div",{className:"stat-v",style:{textAlign:"right"},children:[e.jsx("div",{className:"stat-l",children:"ACTIVE_PHASES"}),e.jsx("div",{className:"stat-n",children:R.filter(s=>s.status==="active").length})]})]})]}),e.jsxs("div",{className:"card shadow-glow",style:{marginBottom:24,padding:18,borderColor:"rgba(0,240,255,0.2)",background:"rgba(0,240,255,0.03)"},children:[e.jsx("div",{style:{fontSize:10,color:"var(--cyan)",fontWeight:800,letterSpacing:"0.1em",marginBottom:10},children:"AUTONOMOUS_TASK_INTAKE"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 3fr 1fr 1fr",gap:10},children:[e.jsx("input",{className:"input-base",placeholder:"Task title",value:m.title,onChange:s=>S(p=>({...p,title:s.target.value}))}),e.jsx("input",{className:"input-base",placeholder:"Intent (required)",value:m.intent,onChange:s=>S(p=>({...p,intent:s.target.value}))}),e.jsxs("select",{className:"input-base",value:m.priority,onChange:s=>S(p=>({...p,priority:s.target.value})),children:[e.jsx("option",{value:"P1",children:"P1"}),e.jsx("option",{value:"P2",children:"P2"}),e.jsx("option",{value:"P3",children:"P3"})]}),e.jsx("input",{className:"input-base",placeholder:"Project hint (optional)",value:m.project_hint,onChange:s=>S(p=>({...p,project_hint:s.target.value}))})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"3fr 2fr 1fr 1fr auto",gap:10,marginTop:10},children:[e.jsx("input",{className:"input-base",placeholder:"Description",value:m.description,onChange:s=>S(p=>({...p,description:s.target.value}))}),e.jsx("input",{className:"input-base",placeholder:"Tags (comma-separated)",value:m.tags,onChange:s=>S(p=>({...p,tags:s.target.value}))}),e.jsx("input",{className:"input-base",type:"date",value:m.deadline,onChange:s=>S(p=>({...p,deadline:s.target.value}))}),e.jsx("input",{className:"input-base",type:"number",placeholder:"Budget USD",value:m.budget_usd,onChange:s=>S(p=>({...p,budget_usd:s.target.value}))}),e.jsx("button",{className:"btn-primary",onClick:x,disabled:b||!m.intent.trim()&&!m.title.trim(),children:b?"ROUTING...":"SUBMIT"})]}),N&&e.jsxs("div",{style:{marginTop:10,fontSize:10,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:["DECISION: ",e.jsx("span",{style:{color:"var(--cyan)"},children:N.decision})," · PROJECT: ",e.jsx("span",{style:{color:"var(--green)"},children:N.projectId})," · JOB: ",e.jsx("span",{style:{color:"var(--amber)"},children:N.jobId})]})]}),e.jsx(Be,{filters:f,setFilters:E,sortBy:j,setSortBy:D}),L&&e.jsx(Ie,{project:L,agents:o,tasks:i,okrs:d,lastUpdated:a,onReplan:w,onExecute:O,onSaveBudget:ne,onSaveOkr:ie,onClose:()=>h(null)}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(360px, 1fr))",gap:20,opacity:L?.3:1,transition:"opacity 0.3s",pointerEvents:L?"none":"auto"},children:[H.map(s=>e.jsx(Ee,{project:s,agents:o,selected:u===s.id,onClick:()=>h(s.id)},s.id)),H.length===0&&e.jsxs("div",{style:{gridColumn:"1/-1",padding:100,textAlign:"center",color:"var(--muted)",border:"1px dashed var(--border)",borderRadius:12},children:[e.jsx("div",{style:{fontSize:32,marginBottom:16},children:"🛰️"}),e.jsx("div",{style:{fontSize:12,fontWeight:800,fontFamily:"JetBrains Mono, monospace"},children:"SIGNAL_VOID // NO_MATCHING_PROJECTS_FOUND"})]})]})]})}export{ze as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e}from"./vendor-5MxLWm27.js";function h({data:l}){const{experiments:i=[],backlog:a=[]}=l||{},d=l?.benchmarks||{},c=d?.evaluations||[],p=d?.last_run;return e.jsxs("div",{className:"fade-in",style:{display:"grid",gap:16},children:[e.jsxs("div",{className:"card shadow-glow",style:{border:"1px solid var(--cyan-glow)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:16},children:[e.jsx("div",{className:"section-title",style:{marginBottom:0},children:"NEURAL EXPERIMENTATION LAB"}),e.jsxs("span",{style:{marginLeft:"auto",fontSize:10,color:"var(--cyan)",fontFamily:"JetBrains Mono, monospace",fontWeight:800},children:["ACTIVE_CYCLES: ",i.length]})]}),i.length===0?e.jsxs("div",{style:{padding:"40px 0",textAlign:"center",color:"var(--muted)",border:"1px dashed var(--border)",borderRadius:8},children:[e.jsx("div",{style:{fontSize:24,marginBottom:8,opacity:.5},children:"🧪"}),e.jsx("div",{style:{fontSize:10,letterSpacing:"0.1em"},children:"LABORATORY_IDLE // NO ACTIVE HYPOTHESES"})]}):e.jsx("div",{style:{overflow:"hidden",borderRadius:8,border:"1px solid var(--border)"},children:e.jsxs("table",{style:{width:"100%",fontSize:11,borderCollapse:"collapse",background:"rgba(0,0,0,0.2)"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"rgba(255,255,255,0.03)",borderBottom:"1px solid var(--border)"},children:["VECTOR_ID","HYPOTHESIS","COGNITION_STATE","INITIALIZED","OUTCOME"].map(t=>e.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontSize:9,color:"var(--muted)",fontWeight:800,letterSpacing:"0.05em"},children:t},t))})}),e.jsx("tbody",{children:i.map((t,o)=>{const r=(t.status||"").toLowerCase(),s=r==="complete"?"var(--green)":r==="running"?"var(--cyan)":r==="failed"?"var(--red)":"var(--muted)";return e.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.02)"},className:"task-row-hover",children:[e.jsx("td",{style:{padding:"12px 14px",color:"var(--cyan)",fontFamily:"JetBrains Mono, monospace",fontSize:10},children:t.id||"--"}),e.jsx("td",{style:{padding:"12px 14px"},children:e.jsx("div",{style:{fontWeight:600,color:"var(--text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},children:t.title||t.hypothesis||"—"})}),e.jsx("td",{style:{padding:"12px 14px"},children:e.jsxs("span",{className:"badge",style:{fontSize:9,color:s,background:`${s}11`,border:`1px solid ${s}33`,display:"inline-flex",alignItems:"center",gap:4},children:[r==="running"&&e.jsx("div",{className:"status-dot",style:{background:s,boxShadow:`0 0 8px ${s}`}}),t.status?.toUpperCase()]})}),e.jsx("td",{style:{padding:"12px 14px",color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:t.started_at?new Date(t.started_at).toLocaleDateString():"--"}),e.jsx("td",{style:{padding:"12px 14px"},children:e.jsx("div",{style:{color:"var(--muted)",fontSize:10,fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:200},children:t.result||t.outcome||"--"})})]},t.id||o)})})]})})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.2fr 1fr",gap:16},children:[e.jsxs("div",{className:"card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:16},children:[e.jsx("span",{className:"section-title",style:{marginBottom:0},children:"KINETIC PERFORMANCE MATRIX"}),p&&e.jsxs("span",{style:{fontSize:9,color:"var(--muted)",marginLeft:"auto",fontFamily:"JetBrains Mono, monospace"},children:["SYNC: ",new Date(p).toLocaleDateString()]})]}),c.length===0?e.jsx("div",{style:{padding:"30px 0",textAlign:"center",color:"var(--muted)",fontSize:10},children:"MATRIX_EMPTY // NO DATA POINTS"}):e.jsx("div",{style:{overflow:"hidden",borderRadius:8,border:"1px solid var(--border)"},children:e.jsxs("table",{style:{width:"100%",fontSize:11,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"rgba(255,255,255,0.03)",borderBottom:"1px solid var(--border)"},children:["MODEL_KERNEL","RATING","LATENCY","LOG"].map(t=>e.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontSize:9,color:"var(--muted)",fontWeight:800},children:t},t))})}),e.jsx("tbody",{children:c.map((t,o)=>e.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,.02)"},children:[e.jsx("td",{style:{padding:"10px 14px",fontFamily:"JetBrains Mono, monospace",fontSize:10,color:"var(--cyan)"},children:t.model}),e.jsx("td",{style:{padding:"10px 14px"},children:e.jsxs("span",{style:{color:"var(--amber)",fontWeight:800,fontSize:13,textShadow:"0 0 10px rgba(255,214,0,0.3)"},children:["★",(t.score??0).toFixed(2)]})}),e.jsx("td",{style:{padding:"10px 14px",color:"var(--purple)",fontFamily:"JetBrains Mono, monospace",fontWeight:600},children:t.latency_ms?`${t.latency_ms}MS`:"--"}),e.jsx("td",{style:{padding:"10px 14px",color:"var(--muted)",fontSize:9},children:t.notes||"--"})]},o))})]})})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-title",children:"NEURAL EVOLUTION PIPELINE"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:a.length===0?e.jsx("div",{style:{padding:"30px 0",textAlign:"center",color:"var(--muted)",fontSize:10},children:"PIPELINE_CLEAR"}):a.slice(0,15).map((t,o)=>{const r=(t.priority||"").toUpperCase(),s=r==="HIGH"?"P1":r==="MEDIUM"?"P2":r==="LOW"?"P3":r,n=t.status==="done";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",background:n?"rgba(0,255,157,0.02)":"rgba(255,255,255,0.01)",border:"1px solid rgba(255,255,255,0.03)",borderRadius:6,opacity:n?.6:1,transition:"all 0.2s"},className:"task-row-hover",children:[e.jsx("span",{className:`pri-tag ${s.toLowerCase()}`,style:{fontSize:8,fontWeight:900,width:20,textAlign:"center"},children:s}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.title||t.description}),e.jsx("div",{style:{fontSize:8,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em",marginTop:2},children:t.category||"GENERAL_EVO"})]}),n?e.jsx("span",{style:{color:"var(--green)",fontSize:12,fontWeight:900},children:"✓"}):e.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:"var(--border)"}})]},t.id||o)})})]})]})]})}export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,a4 as e}from"./vendor-5MxLWm27.js";import{c as U}from"./index-Bjt1AMWV.js";import{L as B}from"./LastUpdated-BVeFtHFH.js";const W=["all","pending","in-progress","complete","failed","blocked","🚨 hitl"],b=25;function F(t=1e4){const[i,c]=d.useState(0);return d.useEffect(()=>{const n=setInterval(()=>c(l=>l+1),t);return()=>clearInterval(n)},[t]),i}function $({deadline:t}){if(F(1e4),!t)return e.jsx("span",{style:{color:"var(--muted)",fontSize:10},children:"[NO LIMIT]"});try{const i=new Date(t),c=Math.round((i-Date.now())/6e4),n=Math.abs(c),l=c<0,r=l?"var(--red)":c<60?"var(--amber)":"var(--muted)",x=n<60?`${l?"-":""}${n}M`:n<1440?`${l?"-":""}${Math.round(n/60)}H`:i.toLocaleDateString();return e.jsxs("span",{title:i.toLocaleString(),style:{color:r,fontSize:10,fontWeight:l?800:600,fontFamily:"JetBrains Mono, monospace"},children:[x,l?" !!":""]})}catch{return e.jsx("span",{style:{color:"var(--muted)",fontSize:10},children:t})}}function J({task:t,expanded:i,onToggle:c}){const n=(t.sla?.priority||t.priority||"P3").toUpperCase(),l=(t.status||"").toLowerCase().replace(/ /g,"-"),r={complete:"badge-complete",pending:"badge-pending","in-progress":"badge-in-progress",failed:"badge-failed",needs_human_decision:"badge-hitl",blocked:"badge-blocked"}[l]||"badge-pending",x=t.status==="needs_human_decision";return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:c,style:{borderBottom:i?"none":"1px solid rgba(255,255,255,.02)",background:x?"rgba(255,42,85,0.03)":"transparent",cursor:"pointer",transition:"background 0.2s"},className:"task-row-hover",children:[e.jsx("td",{style:{padding:"12px 14px",color:"var(--cyan)",fontFamily:"JetBrains Mono, monospace",fontSize:10,opacity:.8},children:t.id||"—"}),e.jsx("td",{style:{padding:"12px 14px"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[x&&e.jsx("span",{style:{textShadow:"0 0 8px var(--red)"},children:"🚨"}),e.jsx("span",{style:{fontWeight:600,color:"var(--text)",fontSize:13,letterSpacing:"-0.01em"},children:t.title||"—"})]})}),e.jsx("td",{style:{padding:"12px 14px"},children:e.jsx("span",{style:{fontSize:11,color:"var(--muted)",fontWeight:600},children:t.assigned_to||"--"})}),e.jsx("td",{style:{padding:"12px 14px"},children:e.jsx("span",{className:`pri-tag ${n.toLowerCase()}`,style:{fontSize:9,fontWeight:900,padding:"2px 6px",borderRadius:4,background:n==="P1"?"rgba(255,42,85,0.1)":"rgba(255,255,255,0.05)",color:n==="P1"?"var(--red)":"var(--muted)",border:`1px solid ${n==="P1"?"rgba(255,42,85,0.2)":"rgba(255,255,255,0.05)"}`},children:n})}),e.jsx("td",{style:{padding:"12px 14px"},children:e.jsx("span",{className:`badge ${r}`,style:{fontSize:9},children:t.status?.toUpperCase()||"—"})}),e.jsx("td",{style:{padding:"12px 14px"},children:e.jsx($,{deadline:t.sla?.deadline||t.sla?.target})}),e.jsx("td",{style:{padding:"12px 14px",color:"var(--muted)",fontSize:10,textAlign:"center"},children:i?"△":"▽"})]}),i&&e.jsx("tr",{style:{background:"rgba(0,0,0,0.2)",borderBottom:"1px solid var(--border)"},children:e.jsx("td",{colSpan:7,style:{padding:"20px 24px"},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.5fr 1fr",gap:24},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.hitl_reason&&e.jsxs("div",{className:"card shadow-glow",style:{border:"1px solid var(--red)",background:"rgba(255,42,85,0.03)"},children:[e.jsx("div",{className:"section-title",style:{color:"var(--red)",fontSize:9},children:"NEURAL INTERVENTION REQUIRED"}),e.jsx("div",{style:{fontSize:13,color:"var(--text)",fontWeight:600},children:t.hitl_reason})]}),e.jsxs("div",{children:[e.jsx("div",{className:"section-title",style:{fontSize:9},children:"MISSION DESCRIPTION"}),e.jsx("div",{style:{fontSize:13,color:"var(--text)",lineHeight:1.6,background:"rgba(255,255,255,0.02)",padding:14,borderRadius:8},children:t.description||"No detailed log provided for this node."})]}),t.output&&e.jsxs("div",{children:[e.jsx("div",{className:"section-title",style:{fontSize:9,color:"var(--green)"},children:"MISSION OUTPUT"}),e.jsx("div",{style:{fontSize:12,color:"var(--green)",lineHeight:1.6,padding:14,borderRadius:8,background:"rgba(0,255,157,0.02)",border:"1px solid rgba(0,255,157,0.1)",fontFamily:"JetBrains Mono, monospace"},children:t.output})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{className:"card",style:{background:"rgba(255,255,255,0.01)",border:"1px solid var(--border)"},children:[e.jsx("div",{className:"section-title",style:{fontSize:9},children:"METADATA MATRIX"}),e.jsxs("div",{style:{display:"grid",gap:10,fontSize:11,fontFamily:"JetBrains Mono, monospace"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{style:{color:"var(--muted)"},children:"TYPE:"}),e.jsx("span",{style:{color:"var(--cyan)"},children:t.type?.toUpperCase()})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{style:{color:"var(--muted)"},children:"PROC_ID:"}),e.jsx("span",{style:{color:"var(--cyan)"},children:t.proc_id||"LOCAL"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{style:{color:"var(--muted)"},children:"CREATED:"}),e.jsx("span",{children:new Date(t.created_at).toLocaleString()})]}),t.completed_at&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{style:{color:"var(--muted)"},children:"RESOLVED:"}),e.jsx("span",{style:{color:"var(--green)"},children:new Date(t.completed_at).toLocaleString()})]})]})]}),t.depends_on?.length>0&&e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-title",style:{fontSize:9},children:"DEPENDENCIES"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:t.depends_on.map(p=>e.jsx("span",{style:{fontSize:9,padding:"2px 8px",background:"rgba(0,240,255,0.05)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.1)",borderRadius:4},children:p},p))})]})]})]})})})]})}function Y({data:t,lastUpdated:i,toast:c}){const{tasks:n=[],agents:l=[]}=t||{},[r,x]=d.useState("all"),[p,h]=d.useState(0),[w,j]=d.useState(null),[m,O]=d.useState(""),[u,P]=d.useState(null),[f,S]=d.useState("asc"),[z,v]=d.useState(!1),[o,g]=d.useState({id:"",title:"",description:"",priority:"P2",assigned_to:"",type:"dev"}),[N,I]=d.useState(!1),L=s=>{u===s?S(a=>a==="asc"?"desc":"asc"):(P(s),S("asc"))},D=async()=>{if(!(!o.id||!o.title)){I(!0);try{await U(o),c("Mission objective initialized","success"),v(!1),g({id:"",title:"",description:"",priority:"P2",assigned_to:"",type:"dev"})}catch(s){c(s.message,"error")}I(!1)}},C=n.filter(s=>{if(r==="🚨 hitl"?s.status!=="needs_human_decision":r!=="all"&&s.status!==r)return!1;if(!m)return!0;const a=m.toLowerCase();return(s.id||"").toLowerCase().includes(a)||(s.title||"").toLowerCase().includes(a)||(s.assigned_to||"").toLowerCase().includes(a)}),E=u?[...C].sort((s,a)=>{const R=(s[u]||"").toString().toLowerCase(),k=(a[u]||"").toString().toLowerCase();return f==="asc"?R.localeCompare(k):k.localeCompare(R)}):C,y=Math.ceil(E.length/b),T=E.slice(p*b,(p+1)*b),M=s=>j(a=>a===s?null:s),_=s=>{x(s),h(0),j(null)},A=s=>s==="🚨 hitl"?n.filter(a=>a.status==="needs_human_decision").length:n.filter(a=>a.status===s).length;return e.jsxs("div",{className:"fade-in",style:{display:"grid",gap:16},children:[e.jsxs("div",{style:{display:"flex",gap:10,marginBottom:4,flexWrap:"wrap",alignItems:"center"},children:[e.jsx("input",{className:"input-base",placeholder:"QUERY MISSIONS...",value:m,onChange:s=>{O(s.target.value),h(0)},style:{flex:"0 1 220px",background:"rgba(0,0,0,0.2)"}}),e.jsx("div",{style:{display:"flex",gap:6},children:W.map(s=>e.jsxs("button",{onClick:()=>_(s),style:{background:r===s?"rgba(0, 240, 255, 0.1)":"rgba(255,255,255,0.03)",border:`1px solid ${r===s?"rgba(0, 240, 255, 0.4)":"var(--border)"}`,color:r===s?"var(--cyan)":"var(--muted)",padding:"6px 14px",borderRadius:6,fontSize:10,cursor:"pointer",fontFamily:"Rajdhani, sans-serif",fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",transition:"all 0.2s",boxShadow:r===s?"0 0 15px rgba(0, 240, 255, 0.1)":"none"},children:[s.replace("🚨 ",""),s!=="all"&&e.jsx("span",{style:{opacity:.6,marginLeft:6},children:A(s)})]},s))}),e.jsx("button",{className:"btn-primary",style:{height:36,marginLeft:"auto"},onClick:()=>v(s=>!s),children:"+ NEW MISSION"}),e.jsx("div",{style:{marginLeft:10},children:e.jsx(B,{ts:i})})]}),z&&e.jsxs("div",{className:"card shadow-glow",style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:10,border:"1px solid var(--border-h)"},children:[e.jsx("div",{className:"section-title",style:{gridColumn:"span 3"},children:"INITIALIZE MISSION PARAMETERS"}),e.jsx("input",{className:"input-base",placeholder:"TASK ID *",value:o.id,onChange:s=>g(a=>({...a,id:s.target.value}))}),e.jsx("input",{className:"input-base",placeholder:"OBJECTIVE TITLE *",value:o.title,onChange:s=>g(a=>({...a,title:s.target.value})),style:{gridColumn:"span 2"}}),e.jsx("textarea",{className:"input-base",placeholder:"MISSION DESCRIPTION",value:o.description,onChange:s=>g(a=>({...a,description:s.target.value})),style:{gridColumn:"span 3",minHeight:60}}),e.jsxs("select",{className:"input-base",value:o.priority,onChange:s=>g(a=>({...a,priority:s.target.value})),style:{cursor:"pointer"},children:[e.jsx("option",{value:"P1",children:"PRIORITY P1"}),e.jsx("option",{value:"P2",children:"PRIORITY P2"}),e.jsx("option",{value:"P3",children:"PRIORITY P3"})]}),e.jsxs("select",{className:"input-base",value:o.assigned_to,onChange:s=>g(a=>({...a,assigned_to:s.target.value})),style:{cursor:"pointer"},children:[e.jsx("option",{value:"",children:"NODE ASSIGNMENT..."}),l.map(s=>e.jsxs("option",{value:s.id,children:[s.emoji," ",s.name.toUpperCase()]},s.id))]}),e.jsxs("select",{className:"input-base",value:o.type,onChange:s=>g(a=>({...a,type:s.target.value})),style:{cursor:"pointer"},children:[e.jsx("option",{value:"dev",children:"DEV"}),e.jsx("option",{value:"research",children:"RESEARCH"}),e.jsx("option",{value:"review",children:"REVIEW"}),e.jsx("option",{value:"ops",children:"OPS"})]}),e.jsxs("div",{style:{gridColumn:"span 3",display:"flex",gap:10,justifyContent:"flex-end",marginTop:8},children:[e.jsx("button",{className:"btn-primary",onClick:D,disabled:N||!o.id||!o.title,children:N?"PROCESSING...":"INITIALIZE MISSION"}),e.jsx("button",{className:"input-base",style:{cursor:"pointer",border:"none"},onClick:()=>v(!1),children:"ABORT"})]})]}),e.jsx("div",{className:"card",style:{padding:0,overflow:"hidden",background:"transparent"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"rgba(255,255,255,0.03)",borderBottom:"1px solid var(--border)"},children:[["id","ID"],["title","OBJECTIVE"],["assigned_to","NODE"],["priority","PRI"],["status","STATUS"],[null,"TTL"],[null,""]].map(([s,a])=>e.jsxs("th",{onClick:s?()=>L(s):void 0,style:{padding:"12px 14px",textAlign:"left",fontSize:9,color:u===s?"var(--cyan)":"var(--muted)",fontWeight:800,textTransform:"uppercase",letterSpacing:"0.1em",cursor:s?"pointer":"default",userSelect:"none"},children:[a,u===s?f==="asc"?" △":" ▽":""]},a))})}),e.jsxs("tbody",{children:[T.length===0&&e.jsx("tr",{children:e.jsxs("td",{colSpan:7,style:{padding:"80px 12px",color:"var(--muted)",textAlign:"center"},children:[e.jsx("div",{style:{fontSize:32,marginBottom:16,opacity:.5},children:"📋"}),e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--text)",letterSpacing:"0.05em"},children:"MISSION INDEX NULL"}),e.jsx("div",{style:{fontSize:10,marginTop:8,opacity:.6,fontFamily:"JetBrains Mono, monospace"},children:r==="all"?"NO ACTIVE TASKS IN CURRENT CONTEXT.":`QUERY RETURNED ZERO NODES FOR STATUS: ${r.replace("🚨 ","").toUpperCase()}.`})]})}),T.map(s=>e.jsx(J,{task:s,expanded:w===s.id,onToggle:()=>M(s.id)},s.id))]})]})}),y>1&&e.jsxs("div",{style:{display:"flex",gap:12,marginTop:8,alignItems:"center",justifyContent:"center"},children:[e.jsx("button",{className:"btn-primary",onClick:()=>h(s=>Math.max(0,s-1)),disabled:p===0,style:{padding:"6px 16px",background:"rgba(255,255,255,0.03)",border:"1px solid var(--border)",fontSize:10},children:"PREV_PAGE"}),e.jsxs("div",{style:{fontSize:10,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",fontWeight:600},children:["SEGMENT ",p+1," // ",y]}),e.jsx("button",{className:"btn-primary",onClick:()=>h(s=>Math.min(y-1,s+1)),disabled:p===y-1,style:{padding:"6px 16px",background:"rgba(255,255,255,0.03)",border:"1px solid var(--border)",fontSize:10},children:"NEXT_PAGE"})]})]})}export{Y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e}from"./vendor-5MxLWm27.js";import{L as I}from"./LastUpdated-BVeFtHFH.js";import{R as r,B as C,C as k,X as m,Y as x,T as c,a as L,d as n,P as T,e as _,f as S,A as K,g as B,S as U,Z as w,h as W}from"./charts-C5TghfcA.js";const R=["#00f0ff","#b535ff","#00ff9d","#ff2a55","#ffb800","#ff6d00","#1de9b6"],o={background:"rgba(7, 7, 12, 0.95)",backdropFilter:"blur(8px)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:8,fontSize:10,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",color:"#fff",fontFamily:"JetBrains Mono, monospace"};function q({data:E,lastUpdated:N}){const{velocity:h={},tasks:p=[],agents:y=[]}=E||{},D=h?.daily||[],i=h?.weekly_summary||{},O=h?.metrics||{},b=(()=>{const t=[];for(let s=6;s>=0;s--){const a=new Date;a.setDate(a.getDate()-s);const d=a.toISOString().split("T")[0],l=D.find(f=>f.date===d)||{};t.push({name:a.toLocaleDateString("en-US",{weekday:"short"}).toUpperCase(),completed:l.tasks_completed||0,failed:l.tasks_failed||0,quality:l.avg_quality??0})}return t})(),g={};p.forEach(t=>{const s=t.type||"other";g[s]=(g[s]||0)+1});const j=Object.entries(g).map(([t,s])=>({name:t,value:s})),v=i.tasks_completed>0?i.tasks_completed/(i.tasks_completed+i.tasks_failed)*100:0,u=y.filter(t=>p.filter(a=>a.assigned_to===t.id).length>0||t.tasks_completed>0).map(t=>{const s=p.filter(a=>a.assigned_to===t.id);return{name:(t.name||t.id).toUpperCase().slice(0,10),emoji:t.emoji||"🤖",done:s.filter(a=>a.status==="complete").length,active:s.filter(a=>a.status==="in-progress").length,blocked:s.filter(a=>["blocked","needs_human_decision"].includes(a.status)).length,failed:s.filter(a=>a.status==="failed").length,quality:t.quality_score||0,total:t.tasks_completed||0}}).sort((t,s)=>s.done+s.active-(t.done+t.active)),A=y.filter(t=>t.tasks_completed>0||t.quality_score>0).map(t=>({x:t.tasks_completed||0,y:t.quality_score||0,name:t.name,emoji:t.emoji||"🤖",z:40})),z=[...y].sort((t,s)=>(s.tasks_completed||0)-(t.tasks_completed||0)).slice(0,6);return e.jsxs("div",{className:"fade-in",style:{display:"grid",gap:16},children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5,1fr)",gap:12},children:[["THROUGHPUT",i.tasks_completed??0,"var(--green)"],["FAILURE PKT",i.tasks_failed??0,"var(--red)"],["AVG QUALITY",(i.avg_quality??0).toFixed(2),"var(--amber)"],["SLA BREACH",i.sla_breaches??0,"var(--purple)"],["VELOCITY/DAY",(O.throughput_rate_tasks_per_day??0).toFixed(1),"var(--cyan)"]].map(([t,s,a])=>e.jsxs("div",{className:"card",style:{textAlign:"center",padding:"16px 12px"},children:[e.jsx("div",{className:"section-title",style:{fontSize:8,letterSpacing:"0.15em"},children:t}),e.jsx("div",{style:{fontSize:24,fontWeight:800,color:a,fontFamily:"Rajdhani, sans-serif"},children:s})]},t))}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:16},children:[e.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:20},children:[e.jsx("span",{className:"section-title",style:{marginBottom:0},children:"NEURAL THROUGHPUT (7D)"}),e.jsx("div",{style:{marginLeft:"auto"},children:e.jsx(I,{ts:N})})]}),e.jsx(r,{width:"100%",height:240,children:e.jsxs(C,{data:b,margin:{top:10,right:0,left:-25,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"colorComplete",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"var(--cyan)",stopOpacity:.8}),e.jsx("stop",{offset:"95%",stopColor:"var(--cyan)",stopOpacity:.2})]}),e.jsxs("linearGradient",{id:"colorFailed",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"var(--red)",stopOpacity:.8}),e.jsx("stop",{offset:"95%",stopColor:"var(--red)",stopOpacity:.2})]})]}),e.jsx(k,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,.03)",vertical:!1}),e.jsx(m,{dataKey:"name",tick:{fill:"var(--muted)",fontSize:9,fontWeight:600},axisLine:!1,tickLine:!1}),e.jsx(x,{tick:{fill:"var(--muted)",fontSize:9},axisLine:!1,tickLine:!1}),e.jsx(c,{contentStyle:o,cursor:{fill:"rgba(255,255,255,0.02)"}}),e.jsx(L,{iconType:"circle",wrapperStyle:{fontSize:10,paddingTop:10}}),e.jsx(n,{dataKey:"completed",fill:"url(#colorComplete)",name:"COMPLETED",radius:[4,4,0,0]}),e.jsx(n,{dataKey:"failed",fill:"url(#colorFailed)",name:"FAILED",radius:[4,4,0,0]})]})})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{className:"card",style:{textAlign:"center",flex:1},children:[e.jsx("div",{className:"section-title",children:"MISSION SUCCESS RATE"}),e.jsxs("div",{style:{position:"relative",marginTop:10},children:[e.jsx(r,{width:"100%",height:150,children:e.jsxs(T,{children:[e.jsxs(_,{data:[{name:"Success",value:v},{name:"Remaining",value:100-v}],cx:"50%",cy:"50%",innerRadius:52,outerRadius:70,startAngle:225,endAngle:-45,paddingAngle:0,dataKey:"value",children:[e.jsx(S,{fill:"url(#gaugeGradient)"}),e.jsx(S,{fill:"rgba(255,255,255,0.03)",stroke:"none"})]}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:"gaugeGradient",x1:"0",y1:"0",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--cyan)"}),e.jsx("stop",{offset:"100%",stopColor:"var(--green)"})]})})]})}),e.jsxs("div",{style:{position:"absolute",top:"55%",left:"50%",transform:"translate(-50%, -50%)",fontSize:28,fontWeight:800,color:"var(--text)",fontFamily:"Rajdhani, sans-serif"},children:[v.toFixed(0),"%"]})]})]}),e.jsxs("div",{className:"card",style:{flex:1},children:[e.jsx("div",{className:"section-title",children:"WORKLOAD DISTRIBUTION"}),j.length===0?e.jsx("div",{style:{color:"var(--muted)",fontSize:10,textAlign:"center",padding:20},children:"NO DATA"}):e.jsx(r,{width:"100%",height:140,children:e.jsxs(T,{children:[e.jsx(_,{data:j,cx:"50%",cy:"50%",innerRadius:40,outerRadius:60,dataKey:"value",nameKey:"name",paddingAngle:4,children:j.map((t,s)=>e.jsx(S,{fill:R[s%R.length],stroke:"rgba(0,0,0,0.5)",strokeWidth:2},s))}),e.jsx(c,{contentStyle:o})]})})]})]})]}),u.length>0&&e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-title",style:{marginBottom:16},children:"AGENT WORKLOAD BREAKDOWN // STACKED_CYCLES"}),e.jsx(r,{width:"100%",height:Math.max(140,u.length*38),children:e.jsxs(C,{data:u,layout:"vertical",margin:{top:0,right:30,left:10,bottom:0},children:[e.jsx(m,{type:"number",hide:!0}),e.jsx(x,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,tick:{fontSize:9,fill:"var(--text)",fontFamily:"JetBrains Mono, monospace",fontWeight:800},width:90}),e.jsx(c,{contentStyle:o}),e.jsx(L,{verticalAlign:"top",height:32,iconType:"circle",wrapperStyle:{fontSize:9,fontFamily:"JetBrains Mono, monospace"}}),e.jsx(n,{dataKey:"done",stackId:"a",fill:"var(--green)",name:"DONE",barSize:14}),e.jsx(n,{dataKey:"active",stackId:"a",fill:"var(--cyan)",name:"ACTIVE"}),e.jsx(n,{dataKey:"blocked",stackId:"a",fill:"var(--purple)",name:"BLOCKED/HITL"}),e.jsx(n,{dataKey:"failed",stackId:"a",fill:"var(--red)",name:"FAILED",radius:[0,4,4,0]})]})})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-title",children:"NEURAL QUALITY GRADIENT (7D)"}),e.jsx(r,{width:"100%",height:210,children:e.jsxs(K,{data:b,margin:{top:10,right:10,left:-25,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"colorQual",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"var(--amber)",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"var(--amber)",stopOpacity:0})]})}),e.jsx(k,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,.03)",vertical:!1}),e.jsx(m,{dataKey:"name",tick:{fill:"var(--muted)",fontSize:9},axisLine:!1,tickLine:!1}),e.jsx(x,{domain:[0,5],tick:{fill:"var(--muted)",fontSize:9},axisLine:!1,tickLine:!1}),e.jsx(c,{contentStyle:o}),e.jsx(B,{type:"monotone",dataKey:"quality",stroke:"var(--amber)",strokeWidth:3,fillOpacity:1,fill:"url(#colorQual)"})]})})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-title",children:"ELITE NODES // PERFORMANCE INDEX"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:0,marginTop:10},children:z.map((t,s)=>{const a=(t.tasks_completed||0)+(t.tasks_failed||0),d=a>0?((t.tasks_failed||0)/a*100).toFixed(0):0,l=t.heartbeat_age_minutes??999,f=l<5?"var(--green)":l<15?"var(--amber)":"var(--red)",F=s===0?"var(--amber)":s===1?"rgba(255,255,255,0.5)":s===2?"#b87333":"var(--muted)";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 0",borderBottom:"1px solid rgba(255,255,255,0.03)"},children:[e.jsx("div",{style:{fontSize:12,fontWeight:900,color:F,width:20,fontFamily:"Rajdhani, sans-serif"},children:s===0?"👑":`0${s+1}`}),e.jsx("div",{style:{width:26,height:26,borderRadius:"50%",background:"rgba(255,255,255,0.03)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14},children:t.emoji}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:12,fontWeight:700,fontFamily:"Rajdhani, sans-serif"},children:t.name}),e.jsxs("div",{style:{fontSize:8,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace"},children:[t.role?.toUpperCase()||"AGENT"," // FAIL: ",d,"%"]})]}),e.jsxs("div",{style:{textAlign:"center",minWidth:36},children:[e.jsx("div",{style:{fontSize:13,fontWeight:900,color:"var(--cyan)",fontFamily:"Rajdhani, sans-serif"},children:t.tasks_completed}),e.jsx("div",{style:{fontSize:7,color:"var(--muted)"},children:"CYCLES"})]}),e.jsxs("div",{style:{textAlign:"center",minWidth:36},children:[e.jsx("div",{style:{fontSize:13,fontWeight:900,color:"var(--amber)",fontFamily:"Rajdhani, sans-serif"},children:(t.quality_score||0).toFixed(1)}),e.jsx("div",{style:{fontSize:7,color:"var(--muted)"},children:"QUAL"})]}),e.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:f,boxShadow:`0 0 6px ${f}`},title:`Heartbeat: ${l}m ago`})]},t.id)})})]})]}),A.length>1&&e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"section-title",style:{marginBottom:4},children:"THROUGHPUT vs QUALITY // AGENT_PERFORMANCE_SCATTER"}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontFamily:"JetBrains Mono, monospace",marginBottom:16},children:"X: tasks completed · Y: quality score · High-right = elite performers"}),e.jsx(r,{width:"100%",height:200,children:e.jsxs(U,{margin:{top:10,right:30,left:-10,bottom:10},children:[e.jsx(k,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.03)"}),e.jsx(m,{type:"number",dataKey:"x",name:"Throughput",axisLine:!1,tickLine:!1,tick:{fill:"var(--muted)",fontSize:9,fontFamily:"JetBrains Mono, monospace"},label:{value:"TASKS DONE",position:"insideBottomRight",offset:-10,fill:"var(--muted)",fontSize:8}}),e.jsx(x,{type:"number",dataKey:"y",name:"Quality",domain:[0,5],axisLine:!1,tickLine:!1,tick:{fill:"var(--muted)",fontSize:9,fontFamily:"JetBrains Mono, monospace"},label:{value:"QUALITY",angle:-90,position:"insideLeft",fill:"var(--muted)",fontSize:8}}),e.jsx(w,{type:"number",dataKey:"z",range:[60,200]}),e.jsx(c,{contentStyle:o,content:({payload:t})=>{if(!t?.length)return null;const s=t[0]?.payload;return e.jsxs("div",{style:{...o,padding:"8px 12px"},children:[e.jsxs("div",{style:{fontWeight:800,marginBottom:4},children:[s?.emoji," ",s?.name]}),e.jsxs("div",{style:{color:"var(--cyan)"},children:["CYCLES: ",s?.x]}),e.jsxs("div",{style:{color:"var(--amber)"},children:["QUALITY: ",s?.y.toFixed(2)]})]})}}),e.jsx(W,{data:A,fill:"var(--cyan)",opacity:.8,shape:t=>{const{cx:s,cy:a,payload:d}=t;return e.jsxs("g",{children:[e.jsx("circle",{cx:s,cy:a,r:8,fill:"rgba(0,240,255,0.15)",stroke:"var(--cyan)",strokeWidth:1.5}),e.jsx("text",{x:s,y:a+4,textAnchor:"middle",fontSize:10,fill:"white",children:d.emoji})]})}})]})})]})]})}export{q as default};
|