import{r as b,k as e}from"./index-BVfpSx5Q.js";import{L as T}from"./layout-NiehYZnq.js";import{P as N,K as d,S as x,C as m,c as j}from"./ui-DGkmnhL-.js";const s="#c9b787",f={sovereign:{color:"#22c55e",label:"SOVEREIGN",range:"900-1000"},trusted:{color:s,label:"TRUSTED",range:"700-899"},provisional:{color:"#f97316",label:"PROVISIONAL",range:"500-699"},restricted:{color:"#ef4444",label:"RESTRICTED",range:"200-499"},untrusted:{color:"#7f1d1d",label:"UNTRUSTED",range:"0-199"}},c=[{id:"aid-cascade",name:"Cascade Navigator",spiffeUri:"spiffe://a11oy.szl/agents/cascade-navigator",certFingerprint:"SHA256:9f:3a:b2:c1:d4:e5:f6:a7:b8:c9:d1:e2:f3:a4:b5:c6",certIssued:"2026-03-01T00:00:00Z",certExpires:"2027-03-01T00:00:00Z",trustScore:970,trustTier:"sovereign",behaviorBaseline:94.2,currentBehavior:96.8,driftPct:.4,driftStatus:"stable",capabilities:["eta-monitoring","port-cost-analysis","route-optimization","demurrage-calc"],permissions:[{action:"read:vessel-data",scope:"all-vessels",granted:!0},{action:"write:voyage-plan",scope:"assigned-vessels",granted:!0},{action:"execute:port-standby",scope:"with-approval",granted:!0},{action:"read:financial-data",scope:"maritime-only",granted:!0},{action:"execute:trade",scope:"any",granted:!1}],vertical:"vessels-maritime",riskClassification:"High",lastActivity:"2026-04-25T10:34:00Z"},{id:"aid-counsel",name:"Counsel Sentinel",spiffeUri:"spiffe://a11oy.szl/agents/counsel-sentinel",certFingerprint:"SHA256:a1:b2:c3:d4:e5:f6:a7:b8:c9:d1:e2:f3:a4:b5:c6:d7",certIssued:"2026-02-15T00:00:00Z",certExpires:"2027-02-15T00:00:00Z",trustScore:990,trustTier:"sovereign",behaviorBaseline:97.4,currentBehavior:98.1,driftPct:.2,driftStatus:"stable",capabilities:["deadline-tracking","doc-review","matter-monitoring","risk-scoring"],permissions:[{action:"read:matter-records",scope:"all-matters",granted:!0},{action:"write:matter-status",scope:"assigned-matters",granted:!0},{action:"execute:escalation",scope:"with-approval",granted:!0},{action:"read:privileged-docs",scope:"with-privilege-gate",granted:!0},{action:"execute:filing",scope:"any",granted:!1}],vertical:"prism-counsel",riskClassification:"Critical",lastActivity:"2026-04-25T08:10:00Z"},{id:"aid-guardian",name:"Guardian",spiffeUri:"spiffe://a11oy.szl/agents/guardian",certFingerprint:"SHA256:b2:c3:d4:e5:f6:a7:b8:c9:d1:e2:f3:a4:b5:c6:d7:e8",certIssued:"2026-01-01T00:00:00Z",certExpires:"2027-01-01T00:00:00Z",trustScore:990,trustTier:"sovereign",behaviorBaseline:98.1,currentBehavior:99,driftPct:.1,driftStatus:"stable",capabilities:["threat-intel","posture-assessment","incident-triage","perimeter-hardening"],permissions:[{action:"read:threat-feeds",scope:"all-sources",granted:!0},{action:"write:firewall-rules",scope:"perimeter-only",granted:!0},{action:"execute:auto-escalate",scope:"up-to-HIGH",granted:!0},{action:"execute:isolate-host",scope:"with-ciso-approval",granted:!0},{action:"read:classified",scope:"any",granted:!1}],vertical:"aegis-defense",riskClassification:"Critical",lastActivity:"2026-04-25T18:56:00Z"},{id:"aid-pipeline",name:"Pipeline Oracle",spiffeUri:"spiffe://a11oy.szl/agents/pipeline-oracle",certFingerprint:"SHA256:c3:d4:e5:f6:a7:b8:c9:d1:e2:f3:a4:b5:c6:d7:e8:f9",certIssued:"2026-03-15T00:00:00Z",certExpires:"2027-03-15T00:00:00Z",trustScore:910,trustTier:"sovereign",behaviorBaseline:88.6,currentBehavior:91.2,driftPct:1.8,driftStatus:"watch",capabilities:["pipeline-analysis","deal-scoring","forecast-modeling","churn-prediction"],permissions:[{action:"read:crm-data",scope:"all-accounts",granted:!0},{action:"write:crm-activity",scope:"assigned-accounts",granted:!0},{action:"execute:outreach",scope:"with-approval",granted:!0},{action:"execute:deal-close",scope:"any",granted:!1},{action:"write:bulk-email",scope:"any",granted:!1}],vertical:"lyte-revenue",riskClassification:"Medium",lastActivity:"2026-04-25T09:25:00Z"},{id:"aid-terra",name:"Terra Analyst",spiffeUri:"spiffe://a11oy.szl/agents/terra-analyst",certFingerprint:"SHA256:d4:e5:f6:a7:b8:c9:d1:e2:f3:a4:b5:c6:d7:e8:f9:a1",certIssued:"2026-04-01T00:00:00Z",certExpires:"2027-04-01T00:00:00Z",trustScore:880,trustTier:"trusted",behaviorBaseline:85,currentBehavior:88.4,driftPct:2.8,driftStatus:"watch",capabilities:["cap-rate-tracking","portfolio-analysis","valuation-modeling","comp-analysis"],permissions:[{action:"read:property-data",scope:"portfolio-only",granted:!0},{action:"write:valuation-model",scope:"assigned-portfolios",granted:!0},{action:"execute:loi-draft",scope:"with-approval",granted:!0},{action:"execute:acquisition",scope:"any",granted:!1}],vertical:"terra-real-estate",riskClassification:"Medium",lastActivity:"2026-04-25T16:45:00Z"},{id:"aid-watchdog",name:"Fabric Watchdog",spiffeUri:"spiffe://a11oy.szl/agents/fabric-watchdog",certFingerprint:"SHA256:e5:f6:a7:b8:c9:d1:e2:f3:a4:b5:c6:d7:e8:f9:a1:b2",certIssued:"2026-01-01T00:00:00Z",certExpires:"2027-01-01T00:00:00Z",trustScore:1e3,trustTier:"sovereign",behaviorBaseline:100,currentBehavior:100,driftPct:0,driftStatus:"stable",capabilities:["health-probe","proof-verification","layer-monitoring","latency-tracking"],permissions:[{action:"read:all-metrics",scope:"fabric-layers",granted:!0},{action:"execute:health-check",scope:"all-layers",granted:!0},{action:"write:any",scope:"any",granted:!1}],vertical:"alloy-core",riskClassification:"Low",lastActivity:"2026-04-26T10:00:00Z"}],w={Critical:"#ef4444",High:"#f97316",Medium:s,Low:"#22c55e"},u={stable:"#22c55e",watch:"#f97316",drift:"#ef4444"},g=[{from:"aid-cascade",to:"aid-guardian",relation:"sanctions-verification",strength:.95},{from:"aid-cascade",to:"aid-counsel",relation:"demurrage-clause-interp",strength:.88},{from:"aid-counsel",to:"aid-guardian",relation:"privilege-gate-review",strength:.82},{from:"aid-pipeline",to:"aid-counsel",relation:"contract-review",strength:.78},{from:"aid-pipeline",to:"aid-terra",relation:"cross-vertical-pipeline",strength:.72},{from:"aid-terra",to:"aid-cascade",relation:"port-adjacent-asset-impact",strength:.65},{from:"aid-watchdog",to:"aid-cascade",relation:"health-monitoring",strength:.99},{from:"aid-watchdog",to:"aid-guardian",relation:"health-monitoring",strength:.99},{from:"aid-watchdog",to:"aid-counsel",relation:"health-monitoring",strength:.99},{from:"aid-watchdog",to:"aid-pipeline",relation:"health-monitoring",strength:.97},{from:"aid-watchdog",to:"aid-terra",relation:"health-monitoring",strength:.97},{from:"aid-guardian",to:"aid-cascade",relation:"threat-intel-feed",strength:.91}],y={"aid-watchdog":{x:340,y:40},"aid-cascade":{x:120,y:140},"aid-guardian":{x:540,y:140},"aid-counsel":{x:340,y:200},"aid-pipeline":{x:120,y:300},"aid-terra":{x:540,y:300}};function C(){const[h,v]=b.useState(null),[p,S]=b.useState("registry"),o=c.find(t=>t.id===h);return e.jsxs(T,{children:[e.jsx(N,{label:"AGENT IDENTITY REGISTRY",title:"Cryptographic Agent Identity",subtitle:"Every A11oy agent has a cryptographic identity (SPIFFE URI + X.509 certificate), behavioral trust score, drift detection, and explicit authorization matrix.",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",value:c.length,sub:"agents",accent:s}),e.jsx(d,{label:"SOVEREIGN",value:c.filter(t=>t.trustTier==="sovereign").length,sub:"900+ trust",accent:"#22c55e"}),e.jsx(d,{label:"AVG TRUST",value:Math.round(c.reduce((t,r)=>t+r.trustScore,0)/c.length),sub:"out of 1000",accent:s}),e.jsx(d,{label:"CERTS VALID",value:`${c.length}/${c.length}`,sub:"all current",accent:"#22c55e"}),e.jsx(d,{label:"DRIFT ALERTS",value:c.filter(t=>t.driftStatus!=="stable").length,sub:"watching",accent:"#f97316"}),e.jsx(d,{label:"ZERO BYPASS",value:"0",sub:"no identity spoofing",accent:s})]}),e.jsx("div",{className:"flex gap-1 mb-6",children:["registry","topology"].map(t=>e.jsx("button",{onClick:()=>S(t),className:"px-4 py-2 rounded-lg text-[10px] font-mono uppercase tracking-widest transition-all",style:{backgroundColor:p===t?`${s}18`:"transparent",color:p===t?s:"var(--color-a11oy-text-ghost)",border:`1px solid ${p===t?`${s}30`:"transparent"}`},children:t==="registry"?"Identity Registry":"Trust Topology"},t))}),p==="topology"&&e.jsxs(e.Fragment,{children:[e.jsx(x,{children:"Trust Topology Graph"}),e.jsxs(m,{className:"mb-6",children:[e.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest mb-3",style:{color:s},children:"AGENT TRUST RELATIONSHIPS"}),e.jsxs("svg",{viewBox:"0 0 680 360",className:"w-full",style:{maxHeight:400},children:[g.map((t,r)=>{const a=y[t.from],l=y[t.to];if(!a||!l)return null;const i=.15+t.strength*.45,n=t.relation==="health-monitoring";return e.jsx("line",{x1:a.x,y1:a.y,x2:l.x,y2:l.y,stroke:n?"#22c55e":s,strokeWidth:n?1:1.5,strokeOpacity:i,strokeDasharray:n?"4 4":"none"},r)}),c.map(t=>{const r=y[t.id];if(!r)return null;const a=f[t.trustTier],l=h===t.id,i=t.trustTier==="sovereign"?22:18;return e.jsxs("g",{onClick:()=>v(l?null:t.id),style:{cursor:"pointer"},children:[e.jsx("circle",{cx:r.x,cy:r.y,r:i+4,fill:`${a.color}08`,stroke:`${a.color}20`,strokeWidth:l?2:0}),e.jsx("circle",{cx:r.x,cy:r.y,r:i,fill:"#0a0a0a",stroke:a.color,strokeWidth:l?2.5:1.5}),e.jsx("text",{x:r.x,y:r.y-4,textAnchor:"middle",fill:a.color,fontSize:8,fontFamily:"ui-monospace, monospace",fontWeight:700,children:t.trustScore}),e.jsx("text",{x:r.x,y:r.y+7,textAnchor:"middle",fill:"#8a8a8a",fontSize:6,fontFamily:"ui-monospace, monospace",children:a.label}),e.jsx("text",{x:r.x,y:r.y+i+14,textAnchor:"middle",fill:"#f5f5f5",fontSize:9,fontFamily:"ui-sans-serif, system-ui, sans-serif",fontWeight:600,children:t.name}),e.jsx("text",{x:r.x,y:r.y+i+26,textAnchor:"middle",fill:"#5e5e5e",fontSize:7,fontFamily:"ui-monospace, monospace",children:t.vertical})]},t.id)})]})]}),e.jsxs(x,{children:["Trust Edges (",g.length,")"]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-3 mb-6",children:g.filter(t=>t.relation!=="health-monitoring").map((t,r)=>{const a=c.find(i=>i.id===t.from),l=c.find(i=>i.id===t.to);return e.jsxs(m,{children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs mb-1",children:[e.jsx("span",{className:"font-semibold",style:{color:s},children:a==null?void 0:a.name}),e.jsx("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:"→"}),e.jsx("span",{className:"font-semibold",style:{color:s},children:l==null?void 0:l.name})]}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:t.relation}),e.jsxs("span",{className:"font-mono",style:{color:t.strength>=.85?"#22c55e":t.strength>=.7?s:"#f97316"},children:["strength: ",Math.round(t.strength*100),"%"]})]}),e.jsx("div",{className:"mt-1.5 h-1 rounded-full overflow-hidden",style:{backgroundColor:"var(--color-a11oy-muted)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${t.strength*100}%`,backgroundColor:t.strength>=.85?"#22c55e":t.strength>=.7?s:"#f97316"}})})]},r)})})]}),p==="registry"&&e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs(x,{children:["Identity Registry (",c.length,")"]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:c.map(t=>{const r=f[t.trustTier],a=w[t.riskClassification],l=u[t.driftStatus],i=h===t.id;return e.jsxs("div",{className:"rounded-xl border p-4 cursor-pointer transition-all",onClick:()=>v(i?null:t.id),style:{backgroundColor:i?"rgba(201,183,135,0.03)":"var(--color-a11oy-card)",borderColor:i?s:"var(--color-a11oy-border)",borderLeft:`3px solid ${a}`},children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--color-a11oy-text)"},children:t.name}),e.jsx("div",{className:"text-[9px] font-mono truncate",style:{color:"var(--color-a11oy-text-ghost)",maxWidth:200},children:t.spiffeUri})]}),e.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{color:r.color,backgroundColor:`${r.color}15`},children:r.label})]}),e.jsxs("div",{className:"flex items-center justify-between mb-2 text-xs",children:[e.jsxs("span",{className:"font-mono font-bold",style:{color:r.color},children:["Trust: ",t.trustScore]}),e.jsxs("span",{className:"font-mono",style:{color:l},children:["drift: ",t.driftPct,"%"]})]}),e.jsx(j,{value:t.trustScore,max:1e3,color:r.color}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:t.capabilities.slice(0,3).map(n=>e.jsx("span",{className:"text-[9px] px-1 py-0.5 rounded font-mono",style:{backgroundColor:"var(--color-a11oy-muted)",color:"var(--color-a11oy-text-ghost)"},children:n},n))})]},t.id)})})]}),e.jsx("div",{children:o?e.jsxs(e.Fragment,{children:[e.jsxs(x,{children:["Identity Detail — ",o.name]}),e.jsx(m,{children:e.jsxs("div",{className:"space-y-4 text-xs",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-mono mb-1",style:{color:"var(--color-a11oy-text-ghost)"},children:"SPIFFE URI"}),e.jsx("div",{className:"font-mono px-2 py-1.5 rounded",style:{backgroundColor:"var(--color-a11oy-deep)",border:"1px solid var(--color-a11oy-border)",color:s,wordBreak:"break-all"},children:o.spiffeUri})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-mono mb-1",style:{color:"var(--color-a11oy-text-ghost)"},children:"CERT FINGERPRINT"}),e.jsx("div",{className:"font-mono px-2 py-1.5 rounded",style:{backgroundColor:"var(--color-a11oy-deep)",border:"1px solid var(--color-a11oy-border)",color:"var(--color-a11oy-text-ghost)",wordBreak:"break-all",fontSize:10},children:o.certFingerprint})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-mono mb-1",style:{color:"var(--color-a11oy-text-ghost)"},children:"ISSUED"}),e.jsx("div",{style:{color:"var(--color-a11oy-text-sub)"},children:new Date(o.certIssued).toLocaleDateString()})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-mono mb-1",style:{color:"var(--color-a11oy-text-ghost)"},children:"EXPIRES"}),e.jsx("div",{style:{color:"var(--color-a11oy-text-sub)"},children:new Date(o.certExpires).toLocaleDateString()})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-mono mb-1",style:{color:"var(--color-a11oy-text-ghost)"},children:"BEHAVIORAL DRIFT"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:["Baseline: ",o.behaviorBaseline,"%"]}),e.jsxs("span",{style:{color:"var(--color-a11oy-text-ghost)"},children:["Current: ",o.currentBehavior,"%"]})]}),e.jsx(j,{value:o.currentBehavior,max:100,color:u[o.driftStatus]})]}),e.jsx("span",{className:"font-mono px-1.5 py-0.5 rounded",style:{color:u[o.driftStatus],backgroundColor:`${u[o.driftStatus]}15`},children:o.driftStatus})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-mono mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"AUTHORIZATION MATRIX"}),e.jsx("div",{className:"space-y-1",children:o.permissions.map((t,r)=>e.jsxs("div",{className:"flex items-center justify-between py-1 px-2 rounded",style:{backgroundColor:"var(--color-a11oy-deep)"},children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-mono",style:{color:t.granted?"#22c55e":"#ef4444"},children:t.granted?"✓":"✗"}),e.jsx("span",{className:"ml-2",style:{color:"var(--color-a11oy-text-sub)"},children:t.action})]}),e.jsx("span",{className:"font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:t.scope})]},r))})]})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(x,{children:"Trust Tier Definitions"}),e.jsxs(m,{children:[e.jsx("div",{className:"space-y-3 text-xs",children:Object.entries(f).map(([t,r])=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r.color}}),e.jsx("span",{className:"font-mono",style:{color:r.color},children:r.label})]}),e.jsx("span",{className:"font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:r.range})]},t))}),e.jsx("div",{className:"mt-4 p-2 rounded text-xs",style:{backgroundColor:"rgba(201,183,135,0.06)",border:"1px solid rgba(201,183,135,0.15)",color:"var(--color-a11oy-text-ghost)"},children:"Trust scores are computed from behavioral consistency, proof completion rate, policy compliance, and drift metrics. Scores below 500 trigger automatic capability restriction."})]})]})})]}),e.jsxs("div",{className:"mt-6 p-3 rounded-lg text-xs flex items-center gap-2",style:{backgroundColor:"rgba(201,183,135,0.06)",border:"1px solid rgba(201,183,135,0.15)",color:"var(--color-a11oy-text-ghost)"},children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--color-a11oy-blue)] flex-shrink-0"})," Agent identities are SPIFFE-compliant (X.509 SVIDs) with mTLS enforcement. No agent operates without a valid, non-expired certificate."]})]})}export{C as AgentIdentityRegistry};