import{r as b,k as e}from"./index-BVfpSx5Q.js";import{L as G}from"./layout-NiehYZnq.js";import{P as H,K as d,S as m,V as B,C as N,c as C}from"./ui-DGkmnhL-.js";import{d as k}from"./workcells-CX1pJNAx.js";import{b as F,d as W,a as $}from"./hooks-B5MrA7_i.js";import{A as U}from"./complianceFabric-CIzuJFiy.js";import{R as O,f as z}from"./generateCategoricalChart-C3RFeikY.js";import{a as K,L as q}from"./LineChart-60khDhjR.js";import{b as _,a as X,P as J,R as Y}from"./RadarChart-CeXpz6rP.js";import"./types-CcGq3kAE.js";import"./YAxis-BcKAP-pG.js";const a="#c9b787",E=["Critical","High","Medium","Low"],y={Critical:"#ef4444",High:"#f97316",Medium:"#c9b787",Low:"#22c55e"},c=[{id:"op-cascade",name:"Cascade Navigator",role:"Domain Specialist — Vessels Maritime",vertical:"vessels-maritime",type:"domain-specialist",status:"active",trustScore:97,riskClassification:"High",model:"gpt-4o → claude-3.5-sonnet",humanOwner:{name:"Sarah Chen",title:"VP Operations",initials:"SC"},tasksToday:12,pendingTasks:3,avgLatencyMs:840,costPerCallUSD:.012,permissions:{read:["AIS vessel data","Port authority API","Voyage plans","Demurrage contracts"],write:["Voyage plan updates","Port standby requests"],execute:["ETA calculation","Route optimization","Cost analysis"],approve:[]},assignedTools:["api-caller","data-analyzer","risk-scorer","evidence-packager"],skills:["ETA Monitoring","Port Cost Analysis","Demurrage Calc","Route Optimization"],lastAction:"Recommended port standby — awaiting VP approval",activityTimeline:[{time:"10:30",action:"ETA recalculated — 18h delay detected"},{time:"10:32",action:"Port standby cost analysis completed"},{time:"10:34",action:"Action brief submitted for VP approval"},{time:"08:15",action:"Route optimization run — 3 alternatives evaluated"}],perfHistory:[88,91,89,94,92,95,97],evalDimensions:{groundedness:.96,actionSafety:.94,policyCompliance:.98,hallucinationRisk:.97,proofCompleteness:.95}},{id:"op-counsel",name:"Counsel Sentinel",role:"Domain Specialist — Prism Counsel",vertical:"prism-counsel",type:"domain-specialist",status:"active",trustScore:99,riskClassification:"Critical",model:"claude-3.5-sonnet",humanOwner:{name:"Patricia Mwangi",title:"General Counsel",initials:"PM"},tasksToday:8,pendingTasks:2,avgLatencyMs:640,costPerCallUSD:.008,permissions:{read:["Matter records","Deadline calendars","Document repositories","Client communications"],write:["Matter status updates","Task assignments"],execute:["Deadline analysis","Risk scoring","Document review"],approve:[]},assignedTools:["document-reader","risk-scorer","evidence-packager","approval-gateway"],skills:["Deadline Tracking","Document Status","Matter Monitoring","Risk Scoring"],lastAction:"Flagged Talbot discovery risk — escalation requested",activityTimeline:[{time:"08:00",action:"Talbot discovery deadline T-48h alert generated"},{time:"08:05",action:"Document gap analysis: 340 items outstanding"},{time:"08:10",action:"Escalation to General Counsel submitted"},{time:"06:30",action:"Daily matter health check completed"}],perfHistory:[96,97,98,97,99,98,99],evalDimensions:{groundedness:.99,actionSafety:.98,policyCompliance:.99,hallucinationRisk:.99,proofCompleteness:.98}},{id:"op-pipeline",name:"Pipeline Oracle",role:"Domain Specialist — Lyte Revenue",vertical:"lyte-revenue",type:"domain-specialist",status:"active",trustScore:91,riskClassification:"Medium",model:"gpt-4o",humanOwner:{name:"James Okafor",title:"VP Revenue",initials:"JO"},tasksToday:21,pendingTasks:4,avgLatencyMs:820,costPerCallUSD:.015,permissions:{read:["CRM opportunities","Pipeline data","Customer health scores","Engagement metrics"],write:["CRM activity updates","Opportunity stage changes"],execute:["Pipeline analysis","Deal scoring","Forecast modeling","Churn prediction"],approve:[]},assignedTools:["crm-query","data-analyzer","risk-scorer","email-sender"],skills:["Pipeline Analysis","Deal Scoring","Forecast Modeling","CRM Monitoring"],lastAction:"Identified 3 at-risk accounts — executive outreach recommended",activityTimeline:[{time:"09:15",action:"Churn risk model ran — 3 accounts flagged ≥85%"},{time:"09:20",action:"Executive outreach brief prepared"},{time:"09:25",action:"Action submitted for VP Revenue approval"},{time:"07:00",action:"Daily pipeline velocity report generated"}],perfHistory:[82,85,88,86,90,89,91],evalDimensions:{groundedness:.9,actionSafety:.92,policyCompliance:.94,hallucinationRisk:.88,proofCompleteness:.91}},{id:"op-guardian",name:"Guardian",role:"Domain Specialist — Aegis Defense",vertical:"aegis-defense",type:"domain-specialist",status:"active",trustScore:99,riskClassification:"Critical",model:"claude-3.5-sonnet (air-gapped)",humanOwner:{name:"Marcus Steel",title:"CISO",initials:"MS"},tasksToday:6,pendingTasks:1,avgLatencyMs:980,costPerCallUSD:.009,permissions:{read:["Threat intelligence feeds","SIEM events","Firewall logs","Vulnerability scans"],write:["Threat registry updates","Firewall rule proposals"],execute:["Threat analysis","Posture assessment","Incident triage","Perimeter hardening"],approve:["Tier escalations up to HIGH"]},assignedTools:["api-caller","risk-scorer","evidence-packager","proof-issuer"],skills:["Threat Intelligence","Posture Assessment","Incident Triage","Perimeter Hardening"],lastAction:"TG-Ember escalated to ORANGE — perimeter hardened automatically",activityTimeline:[{time:"18:55",action:"TG-Ember threat actor elevated to ORANGE"},{time:"18:55",action:"14 new firewall block rules applied automatically"},{time:"18:56",action:"CISO notified — perimeter scan initiated"},{time:"18:56",action:"Verification complete — surface reduced 22%"}],perfHistory:[95,97,98,97,99,98,99],evalDimensions:{groundedness:.99,actionSafety:.99,policyCompliance:.99,hallucinationRisk:.99,proofCompleteness:.98}},{id:"op-terra",name:"Terra Analyst",role:"Domain Specialist — Terra Real Estate",vertical:"terra-real-estate",type:"domain-specialist",status:"active",trustScore:88,riskClassification:"Medium",model:"gpt-4o",humanOwner:{name:"Elena Vasquez",title:"Portfolio Manager",initials:"EV"},tasksToday:9,pendingTasks:0,avgLatencyMs:760,costPerCallUSD:.011,permissions:{read:["CoStar data","Portfolio holdings","Valuation models","Market comps"],write:["Valuation model updates","LOI draft proposals"],execute:["Cap rate analysis","Portfolio valuation","Comp analysis","Risk modeling"],approve:[]},assignedTools:["api-caller","data-analyzer","pdf-generator","evidence-packager"],skills:["Cap Rate Tracking","Portfolio Analysis","Valuation Modeling","Comp Analysis"],lastAction:"Cap rate compression signal — Westfield portfolio valuation updated",activityTimeline:[{time:"16:40",action:"Cap rate compression signal detected — 28bps shift"},{time:"16:42",action:"Westfield portfolio valuation model updated"},{time:"16:45",action:"LOI analysis prepared — Tier Omega property"},{time:"14:00",action:"Daily portfolio health check completed"}],perfHistory:[80,83,85,84,87,86,88],evalDimensions:{groundedness:.88,actionSafety:.9,policyCompliance:.89,hallucinationRisk:.87,proofCompleteness:.88}},{id:"op-watchdog",name:"Fabric Watchdog",role:"System Agent — A11oy Core",vertical:"alloy-core",type:"system",status:"active",trustScore:100,riskClassification:"Low",model:"internal",humanOwner:{name:"Platform Team",title:"Engineering",initials:"PT"},tasksToday:144,pendingTasks:0,avgLatencyMs:12,costPerCallUSD:0,permissions:{read:["All fabric layer metrics","Health endpoints","Proof ledger hashes","Layer latencies"],write:[],execute:["Health probes","Proof verification","Layer monitoring","Latency tracking"],approve:[]},assignedTools:["api-caller","proof-issuer","mirror-eval-runner"],skills:["Mesh Health","Layer Monitoring","Proof Verification","Latency Tracking"],lastAction:"All 7 fabric layers nominal — scheduled verification complete",activityTimeline:[{time:"10:00",action:"Layer health check — all 7 nominal"},{time:"09:00",action:"Proof ledger integrity verified — 0 anomalies"},{time:"08:00",action:"Layer health check — all 7 nominal"},{time:"07:00",action:"Daily latency baseline established"}],perfHistory:[100,100,100,100,100,100,100],evalDimensions:{groundedness:1,actionSafety:1,policyCompliance:1,hallucinationRisk:1,proofCompleteness:1}}],L={"lyte-revenue":"#c9b787","vessels-maritime":"#8a8a8a","terra-real-estate":"#c9b787","aegis-defense":"#f5f5f5","prism-counsel":"#8a8a8a","carlota-jo":"#c9b787","alloy-core":"#5e5e5e"},Q=["groundedness","actionSafety","policyCompliance","hallucinationRisk","proofCompleteness"],Z={groundedness:"Grounded",actionSafety:"Action Safety",policyCompliance:"Policy",hallucinationRisk:"Hallucination",proofCompleteness:"Proof"},ee=[{from:"Pipeline Oracle",to:"Counsel Sentinel",reason:"At-risk contract review",vertical:"prism-counsel"},{from:"Cascade Navigator",to:"Terra Analyst",reason:"Port-adjacent asset impact",vertical:"terra-real-estate"},{from:"Guardian",to:"Fabric Watchdog",reason:"Perimeter change verification",vertical:"alloy-core"}];function se({dims:x}){const p=Q.map(i=>({dimension:Z[i],score:Math.round(x[i]*100)}));return e.jsx(O,{width:"100%",height:180,children:e.jsxs(_,{data:p,margin:{top:8,right:20,bottom:8,left:20},children:[e.jsx(X,{stroke:"rgba(255,255,255,0.08)"}),e.jsx(J,{dataKey:"dimension",tick:{fill:"#5e5e5e",fontSize:9,fontFamily:"ui-monospace, monospace"}}),e.jsx(Y,{dataKey:"score",stroke:a,fill:a,fillOpacity:.15,strokeWidth:1.5})]})})}function oe({data:x}){const p=x.map((i,h)=>({i:h,v:i}));return e.jsx(O,{width:"100%",height:36,children:e.jsxs(K,{data:p,margin:{top:2,right:2,bottom:2,left:2},children:[e.jsx(q,{type:"monotone",dataKey:"v",stroke:a,strokeWidth:1.5,dot:!1}),e.jsx(z,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid rgba(255,255,255,0.08)",borderRadius:4,fontSize:10},formatter:i=>[`${i}`,"Trust"],labelFormatter:()=>""})]})})}function S({type:x,items:p}){const h={read:"#8a8a8a",write:"#c9b787",execute:"#b08d52",approve:"#f97316"}[x]??"#5e5e5e";return p.length===0?null:e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"text-xs font-mono mb-1",style:{color:h},children:[x.toUpperCase()," (",p.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:p.map(v=>e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:`${h}10`,color:h,border:`1px solid ${h}20`},children:v},v))})]})}function ue(){const[x,p]=b.useState(null),[i,h]=b.useState("All"),[v,D]=b.useState("All"),{data:n}=F(),{data:j}=W({limit:30}),{data:T}=$({limit:20}),r=!!n,M=c.filter(s=>(i==="All"||s.riskClassification===i)&&(v==="All"||s.type===v)),t=c.find(s=>s.id===x),A=b.useMemo(()=>r&&j.length>0?j.filter(s=>s.status==="running"||s.status==="pending"):k.filter(s=>s.status==="running"),[r,j]),w=b.useMemo(()=>r&&j.length>0?j.filter(s=>s.status==="failed"):k.filter(s=>s.status==="error"),[r,j]),P=b.useMemo(()=>r?n.pendingApprovals:k.filter(s=>s.requiresApproval&&s.status==="running").length,[r,n]),I=Math.round(c.reduce((s,o)=>s+o.trustScore,0)/c.length),V=r?n.totalRuns:c.reduce((s,o)=>s+o.tasksToday,0);return e.jsxs(G,{children:[e.jsx(H,{label:"AGENT REGISTRY",title:"Operator Agent Registry",subtitle:"Full registry of every agent with explicit permissions, assigned tools, risk classification, human ownership, and live performance tracking.",status:"LIVE"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 mb-8",children:[e.jsx(d,{label:"REGISTERED AGENTS",value:c.length,sub:"all active",accent:a}),e.jsx(d,{label:"CRITICAL RISK",value:c.filter(s=>s.riskClassification==="Critical").length,sub:"highest oversight",accent:"#ef4444"}),e.jsx(d,{label:r?"ACTIVE WORKFLOWS":"ACTIVE WORKCELLS",value:A.length,sub:"running now",accent:a}),e.jsx(d,{label:"AVG TRUST",value:I,sub:"out of 100",accent:a}),e.jsx(d,{label:r?"TOTAL RUNS":"TASKS TODAY",value:V,sub:r?"workflow runs":"across all agents",accent:a}),e.jsx(d,{label:"PENDING GATES",value:P,sub:"approval needed",accent:"#8a8a8a"})]}),r&&n&&e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6",children:[e.jsx(d,{label:"SUCCESS RATE",value:`${Math.round(n.successRate*100)}%`,sub:"workflow completion",accent:"#c9b787"}),e.jsx(d,{label:"AVG DURATION",value:n.avgDurationMs?`${Math.round(n.avgDurationMs/1e3)}s`:"—",sub:"per run",accent:"#c9b787"}),e.jsx(d,{label:"TOTAL WORKFLOWS",value:n.totalWorkflows,sub:"defined",accent:"#c9b787"}),e.jsx(d,{label:"RUNNING NOW",value:n.runningRuns,sub:"active runs",accent:"#c9b787"})]}),e.jsxs("div",{className:"flex gap-2 mb-6 flex-wrap",children:[["All",...E].map(s=>e.jsx("button",{onClick:()=>h(s),className:"text-xs px-2.5 py-1 rounded font-mono",style:{backgroundColor:i===s?`${y[s]??a}18`:"var(--color-a11oy-muted)",color:i===s?y[s]??a:"var(--color-a11oy-text-ghost)",border:`1px solid ${i===s?(y[s]??a)+"30":"transparent"}`,cursor:"pointer"},children:s},s)),["All","domain-specialist","system"].map(s=>e.jsx("button",{onClick:()=>D(s),className:"text-xs px-2.5 py-1 rounded font-mono",style:{backgroundColor:v===s?"rgba(201,183,135,0.12)":"var(--color-a11oy-muted)",color:v===s?a:"var(--color-a11oy-text-ghost)",border:`1px solid ${v===s?"rgba(201,183,135,0.25)":"transparent"}`,cursor:"pointer"},children:s},s))]}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs(m,{children:["Agent Registry (",M.length,")"]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:M.map(s=>{const o=y[s.riskClassification],l=L[s.vertical]??"#5e5e5e",u=x===s.id;return e.jsxs("div",{className:"rounded-xl border cursor-pointer transition-all p-4",onClick:()=>p(u?null:s.id),style:{backgroundColor:u?"rgba(201,183,135,0.03)":"var(--color-a11oy-card)",borderColor:u?a:"var(--color-a11oy-border)",borderLeft:`3px solid ${o}`},children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold mb-0.5",style:{color:"var(--color-a11oy-text)"},children:s.name}),e.jsx("div",{className:"text-xs",style:{color:"var(--color-a11oy-text-ghost)"},children:s.role})]}),e.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{backgroundColor:`${o}15`,color:o,border:`1px solid ${o}30`},children:s.riskClassification})]}),e.jsxs("div",{className:"flex items-center justify-between mb-3 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",style:{backgroundColor:`${l}18`,color:l,border:`1px solid ${l}30`,fontSize:8},children:s.humanOwner.initials}),e.jsx("div",{style:{color:"var(--color-a11oy-text-ghost)"},children:s.humanOwner.name})]}),e.jsxs("span",{className:"font-mono",style:{color:a},children:["Trust: ",s.trustScore]})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx(oe,{data:s.perfHistory}),e.jsx("div",{className:"text-xs text-right",style:{color:"var(--color-a11oy-text-ghost)"},children:"7-day trust trend"})]}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:s.assignedTools.map(f=>e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-mono",style:{backgroundColor:"var(--color-a11oy-muted)",color:"var(--color-a11oy-text-ghost)"},children:f},f))}),e.jsx("div",{className:"text-xs border-t pt-2 mt-2",style:{borderColor:"var(--color-a11oy-border)",color:"var(--color-a11oy-text-ghost)"},children:e.jsxs("span",{style:{color:"var(--color-a11oy-text-sub)"},children:[s.lastAction.slice(0,58),s.lastAction.length>58?"…":""]})}),e.jsxs("div",{className:"flex justify-between text-xs mt-2",style:{color:"var(--color-a11oy-text-ghost)"},children:[e.jsxs("span",{children:[s.tasksToday," tasks today"]}),e.jsxs("span",{children:[s.avgLatencyMs,"ms avg"]}),s.costPerCallUSD>0&&e.jsxs("span",{children:["$",s.costPerCallUSD.toFixed(3),"/call"]})]})]},s.id)})}),e.jsx(m,{children:"MirrorEval Scores"}),e.jsx("div",{className:"rounded-lg border overflow-hidden",style:{borderColor:"var(--color-a11oy-border)"},children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsx("tr",{style:{backgroundColor:"var(--color-a11oy-deep)"},children:["Workcell","Verdict","Score","Evaluator","Flags"].map(s=>e.jsx("th",{className:"text-left px-3 py-2 font-mono uppercase tracking-wide",style:{color:"var(--color-a11oy-text-ghost)",fontSize:"10px"},children:s},s))})}),e.jsx("tbody",{children:k.slice(0,10).map((s,o)=>e.jsxs("tr",{style:{backgroundColor:o%2===0?"var(--color-a11oy-card)":"var(--color-a11oy-deep)",borderBottom:"1px solid var(--color-a11oy-border)"},children:[e.jsx("td",{className:"px-3 py-2 max-w-xs",children:e.jsx("div",{className:"truncate",style:{color:"var(--color-a11oy-text)"},children:s.name})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(B,{verdict:s.mirrorEvalResult.verdict})}),e.jsxs("td",{className:"px-3 py-2 font-mono",style:{color:"#c9b787"},children:[Math.round(s.mirrorEvalResult.score*100),"%"]}),e.jsx("td",{className:"px-3 py-2 font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:s.mirrorEvalResult.evaluatorModel}),e.jsx("td",{className:"px-3 py-2",style:{color:(s.mirrorEvalResult.flags.length>0,"#c9b787")},children:s.mirrorEvalResult.flags.length>0?s.mirrorEvalResult.flags[0]:"—"})]},s.id))})]})}),r&&T.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs(m,{children:["Recent Audit Activity (",T.length,")"]}),e.jsx("div",{className:"rounded-lg border overflow-hidden",style:{borderColor:"var(--color-a11oy-border)"},children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsx("tr",{style:{backgroundColor:"var(--color-a11oy-deep)"},children:["Action","Entity","Actor","Time"].map(s=>e.jsx("th",{className:"text-left px-3 py-2 font-mono uppercase tracking-wide",style:{color:"var(--color-a11oy-text-ghost)",fontSize:"10px"},children:s},s))})}),e.jsx("tbody",{children:T.slice(0,10).map((s,o)=>{var l;return e.jsxs("tr",{style:{backgroundColor:o%2===0?"var(--color-a11oy-card)":"var(--color-a11oy-deep)",borderBottom:"1px solid var(--color-a11oy-border)"},children:[e.jsx("td",{className:"px-3 py-2 font-mono",style:{color:"#c9b787"},children:s.action}),e.jsxs("td",{className:"px-3 py-2",style:{color:"var(--color-a11oy-text)"},children:[s.entityType,":",(l=s.entityId)==null?void 0:l.slice(0,8)]}),e.jsx("td",{className:"px-3 py-2",style:{color:"var(--color-a11oy-text-ghost)"},children:s.actorType}),e.jsx("td",{className:"px-3 py-2 font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:(()=>{try{const u=new Date(s.createdAt),f=Date.now()-u.getTime(),g=Math.round(f/36e5);return g<1?`${Math.round(f/6e4)}m ago`:g<24?`${g}h ago`:`${Math.round(g/24)}d ago`}catch{return s.createdAt}})()})]},s.id)})})]})})]})]}),e.jsxs("div",{className:"flex flex-col gap-6",children:[t?e.jsxs(N,{children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-3",style:{color:"var(--color-a11oy-text-ghost)"},children:"AGENT DETAIL"}),e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center font-bold text-xs",style:{backgroundColor:`${y[t.riskClassification]}18`,color:y[t.riskClassification]},children:t.humanOwner.initials}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--color-a11oy-text)"},children:t.name}),e.jsxs("div",{className:"text-xs",style:{color:"var(--color-a11oy-text-ghost)"},children:["Owner: ",t.humanOwner.name," · ",t.humanOwner.title]})]})]}),e.jsxs("div",{className:"text-xs mt-2 mb-3 font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:["Model: ",t.model]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-mono mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"EXPLICIT PERMISSIONS"}),e.jsx(S,{type:"read",items:t.permissions.read}),e.jsx(S,{type:"write",items:t.permissions.write}),e.jsx(S,{type:"execute",items:t.permissions.execute}),t.permissions.approve.length>0&&e.jsx(S,{type:"approve",items:t.permissions.approve})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-mono mb-1",style:{color:"var(--color-a11oy-text-ghost)"},children:"EVAL RADAR (5 dimensions)"}),e.jsx(se,{dims:t.evalDimensions})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-mono mb-1.5",style:{color:"var(--color-a11oy-text-ghost)"},children:"ACTIVITY TIMELINE"}),e.jsx("div",{className:"space-y-2",children:t.activityTimeline.map((s,o)=>e.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[e.jsx("span",{className:"font-mono flex-shrink-0",style:{color:a},children:s.time}),e.jsx("span",{style:{color:"var(--color-a11oy-text-sub)"},children:s.action})]},o))})]}),e.jsxs("div",{className:"text-xs p-2.5 rounded",style:{backgroundColor:"rgba(201,183,135,0.06)",border:"1px solid rgba(201,183,135,0.15)",color:"var(--color-a11oy-text-ghost)"},children:["All material actions from this agent require human approval by ",e.jsx("span",{style:{color:a},children:t.humanOwner.name})]}),(()=>{const s=U.find(o=>o.agentId===t.id||o.agentName.toLowerCase().replace(/\s+/g,"-")===t.id||o.agentName===t.name);return s?e.jsxs("div",{className:"mt-4 pt-4",style:{borderTop:"1px solid var(--color-a11oy-border)"},children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-3",style:{color:"var(--color-a11oy-text-ghost)"},children:"AGENT-BOM"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-3",children:[e.jsxs("div",{className:"p-2 rounded",style:{backgroundColor:"var(--color-a11oy-deep)",border:"1px solid var(--color-a11oy-border)"},children:[e.jsx("div",{className:"font-mono text-xs",style:{color:"var(--color-a11oy-text-ghost)",fontSize:9},children:"MODEL"}),e.jsx("div",{className:"text-xs font-medium",style:{color:a},children:s.modelProvider}),e.jsx("div",{className:"text-xs font-mono truncate",style:{color:"var(--color-a11oy-text-ghost)",fontSize:9},children:s.modelSnapshot})]}),e.jsxs("div",{className:"p-2 rounded",style:{backgroundColor:"var(--color-a11oy-deep)",border:"1px solid var(--color-a11oy-border)"},children:[e.jsx("div",{className:"font-mono text-xs",style:{color:"var(--color-a11oy-text-ghost)",fontSize:9},children:"CONSTITUTION"}),e.jsx("div",{className:"text-xs font-medium",style:{color:a},children:s.constitutionVersion}),e.jsx("div",{className:"text-xs font-mono truncate",style:{color:"var(--color-a11oy-text-ghost)",fontSize:9},children:s.constitutionHash})]})]}),e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"font-mono text-xs mb-1",style:{color:"var(--color-a11oy-text-ghost)",fontSize:9},children:["TOOLS (",s.toolManifest.length,")"]}),s.toolManifest.slice(0,4).map(o=>e.jsxs("div",{className:"flex justify-between text-xs py-0.5",style:{borderBottom:"1px solid var(--color-a11oy-border)"},children:[e.jsx("span",{style:{color:"var(--color-a11oy-text-sub)"},children:o.name}),e.jsx("span",{className:"font-mono",style:{color:"var(--color-a11oy-text-ghost)",fontSize:9},children:o.version})]},o.name))]}),e.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[e.jsxs("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:["BOM v",s.bomVersion]}),e.jsx("span",{className:"font-mono",style:{color:a,fontSize:9},children:"CycloneDX ML-BOM v1.7"})]}),e.jsx("button",{className:"w-full text-xs font-medium py-1.5 rounded transition-all",style:{backgroundColor:"rgba(201,183,135,0.08)",color:a,border:"1px solid rgba(201,183,135,0.2)",cursor:"pointer"},onClick:o=>{o.stopPropagation();const l={bomFormat:"CycloneDX",specVersion:"1.7",serialNumber:`urn:uuid:${s.agentId}`,version:parseInt(s.bomVersion),metadata:{timestamp:new Date().toISOString(),component:{type:"machine-learning-model",name:s.agentName,version:s.constitutionVersion}},components:[{type:"machine-learning-model",name:s.modelSnapshot,publisher:s.modelProvider,hashes:[{alg:"SHA-256",content:s.modelHash}]},...s.toolManifest.map(R=>({type:"library",name:R.name,version:R.version,hashes:[{alg:"SHA-256",content:R.hash}]}))]},u=new Blob([JSON.stringify(l,null,2)],{type:"application/json"}),f=URL.createObjectURL(u),g=document.createElement("a");g.href=f,g.download=`agent-bom-${s.agentId}-${new Date().toISOString().split("T")[0]}.json`,g.click(),URL.revokeObjectURL(f)},children:"Export CycloneDX BOM"})]}):null})()]}):e.jsxs(N,{children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-3",style:{color:"var(--color-a11oy-text-ghost)"},children:"RISK DISTRIBUTION"}),E.map(s=>{const o=c.filter(l=>l.riskClassification===s).length;return e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[e.jsx("span",{style:{color:y[s]},children:s}),e.jsx("span",{className:"font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:o})]}),e.jsx(C,{value:o,max:c.length,color:y[s]})]},s)}),e.jsx("div",{className:"mt-4 text-xs",style:{color:"var(--color-a11oy-text-ghost)"},children:"Select an agent to view full permissions, radar scores, and activity timeline."})]}),e.jsxs("div",{children:[e.jsxs(m,{children:[r?"Active Workflows":"Active Workcells"," (",A.length,")"]}),e.jsx("div",{className:"flex flex-col gap-2",children:A.slice(0,8).map(s=>{const o="name"in s?s.name:"",l=("description"in s?s.description:null)??("objective"in s?s.objective:""),u="requiresApproval"in s?s.requiresApproval:!1;return e.jsxs(N,{className:"text-xs",children:[e.jsx("div",{className:"font-medium truncate mb-0.5",style:{color:"var(--color-a11oy-text)"},children:o}),e.jsx("div",{className:"truncate",style:{color:"var(--color-a11oy-text-ghost)"},children:l}),u&&e.jsx("div",{className:"mt-1 text-xs font-mono",style:{color:"#8a8a8a"},children:"⚬ approval pending"})]},s.id)})})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Handoff Map"}),e.jsx("div",{className:"flex flex-col gap-2",children:ee.map((s,o)=>{const l=L[s.vertical]??"#5e5e5e";return e.jsx("div",{className:"text-xs flex items-center gap-2",children:e.jsxs("div",{className:"flex-1 px-2 py-1.5 rounded",style:{backgroundColor:"var(--color-a11oy-card)",border:"1px solid var(--color-a11oy-border)"},children:[e.jsx("span",{style:{color:"var(--color-a11oy-text)"},children:s.from}),e.jsx("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:" → "}),e.jsx("span",{style:{color:l},children:s.to})]})},o)})})]}),r&&n&&n.workflowsByStatus.length>0&&e.jsxs("div",{children:[e.jsx(m,{children:"Workflow Distribution"}),e.jsx("div",{className:"flex flex-col gap-2",children:n.workflowsByStatus.map(s=>{const o=s.status==="completed"?"#c9b787":s.status==="failed"?"#f5f5f5":s.status==="running"?"#c9b787":"#8a8a8a";return e.jsxs("div",{className:"flex items-center justify-between text-xs px-2 py-1.5 rounded",style:{backgroundColor:"var(--color-a11oy-card)",border:"1px solid var(--color-a11oy-border)"},children:[e.jsx("span",{className:"font-mono uppercase",style:{color:o},children:s.status}),e.jsx("span",{className:"font-mono font-semibold",style:{color:o},children:s.count})]},s.status)})})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Memory Health"}),e.jsx(N,{className:"text-xs",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:"Short-term"}),e.jsx("span",{className:"font-mono",style:{color:"#c9b787"},children:"84 KB / 512 KB"})]}),e.jsx(C,{value:84,max:512,color:"#c9b787"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:"Long-term"}),e.jsx("span",{className:"font-mono",style:{color:"#c9b787"},children:"1.2 MB / 10 MB"})]}),e.jsx(C,{value:1200,max:1e4,color:"#c9b787"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:"Proof cache"}),e.jsx("span",{className:"font-mono",style:{color:"#8a8a8a"},children:"342 KB / 1 MB"})]}),e.jsx(C,{value:342,max:1e3,color:"#8a8a8a"})]})]})})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Cost & Latency"}),e.jsx(N,{className:"text-xs",children:e.jsx("div",{className:"flex flex-col gap-2",children:c.map(s=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate",style:{color:"var(--color-a11oy-text-sub)"},children:s.name}),e.jsxs("div",{className:"flex items-center gap-3 font-mono flex-shrink-0",children:[e.jsxs("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:[s.avgLatencyMs,"ms"]}),e.jsxs("span",{style:{color:"#b08d52"},children:["$",s.costPerCallUSD.toFixed(3)]})]})]},s.id))})})]}),w.length>0&&e.jsxs("div",{children:[e.jsx(m,{children:"Failure Replay Queue"}),e.jsx("div",{className:"flex flex-col gap-2",children:w.map(s=>{const o="name"in s?s.name:"";return e.jsxs(N,{className:"text-xs",children:[e.jsx("div",{className:"font-medium mb-0.5",style:{color:"#f5f5f5"},children:o}),e.jsxs("div",{style:{color:"var(--color-a11oy-text-ghost)"},children:["Status: ",r?"failed":"error"," — replay available"]})]},s.id)})})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Trust Scores"}),e.jsx("div",{className:"flex flex-col gap-2",children:c.map(s=>e.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[e.jsx("span",{className:"truncate flex-1",style:{color:"var(--color-a11oy-text-sub)"},children:s.name}),e.jsx(C,{value:s.trustScore,max:100,color:y[s.riskClassification]}),e.jsx("span",{className:"font-mono flex-shrink-0",style:{color:a,width:28,textAlign:"right"},children:s.trustScore})]},s.id))})]})]})]})]})}export{ue as Agents};