File size: 6,187 Bytes
da2854c
1
import{o as e}from"./chunk-CMxvf4Kt.js";import{t}from"./react-DrNXigiH.js";import{C as n}from"./index-Caa1r77e.js";import{t as r}from"./layout-BtJ5ShnN.js";import{c as i,p as a,r as o,s,u as c}from"./ui-Ddu9t0Or.js";import{i as l,n as u,o as d,p as f}from"./darpaResilience-BCGYbNoq.js";var p=e(t(),1),m=n(),h={surface:`rgba(255,255,255,0.025)`,border:`rgba(255,255,255,0.08)`,text:`#f5f5f5`,dim:`#8a8a8a`,muted:`#5e5e5e`,accent:`#c9b787`},g={sovereign:`#ef4444`,classified:`#f59e0b`,confidential:`#3b82f6`,internal:`#10b981`,public:`#8a8a8a`},_={"air-gapped":`AIR-GAPPED`,"egress-filtered":`EGRESS FILTERED`,"full-mesh":`FULL MESH`,"read-only-external":`READ-ONLY EXT`};function v(){let[e,t]=(0,p.useState)(null),n=e?u.filter(t=>t.securityLevel===e):u,v=u.filter(e=>e.enclaveStatus===`active`).length,y=u.reduce((e,t)=>e+t.isolationScore,0)/u.length,b=new Set(u.flatMap(e=>e.agents)).size,x=l.find(e=>e.id===`ssith`);return(0,m.jsxs)(r,{children:[(0,m.jsx)(i,{label:`DARPA RESILIENCE · v${d}`,title:`Capability Compartments`,subtitle:`SSITH/CHERI-inspired — capability-based isolation with memory-safe bounds, zero-trust compartmentalization, and enclave security.`,status:`LIVE`}),(0,m.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6`,children:[(0,m.jsx)(s,{label:`ACTIVE ENCLAVES`,value:`${v}/${u.length}`,sub:`compartments live`,accent:h.accent}),(0,m.jsx)(s,{label:`ISOLATION SCORE`,value:f(y),sub:`mean enclave isolation`,accent:h.accent}),(0,m.jsx)(s,{label:`AGENTS GOVERNED`,value:b.toString(),sub:`across all compartments`,accent:h.accent}),(0,m.jsx)(s,{label:`SECURITY LEVELS`,value:`5`,sub:`sovereign → public`,accent:h.accent})]}),(0,m.jsxs)(o,{className:`mb-6 p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,m.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full`,style:{backgroundColor:h.accent}}),(0,m.jsx)(`span`,{className:`text-xs font-mono`,style:{color:h.dim},children:`DARPA PROGRAM REFERENCE`})]}),(0,m.jsx)(`div`,{className:`text-sm mb-1`,style:{color:h.text},children:x.fullName}),(0,m.jsxs)(`div`,{className:`text-xs`,style:{color:h.dim},children:[`Office: `,x.office,` · GitHub: `,(0,m.jsx)(`span`,{style:{color:h.accent},children:x.github})]}),(0,m.jsx)(`div`,{className:`text-xs mt-2`,style:{color:h.muted},children:x.innovation})]}),(0,m.jsx)(c,{children:`Security Levels`}),(0,m.jsx)(`div`,{className:`flex gap-2 mb-6 flex-wrap`,children:Object.entries(g).map(([n,r])=>{let i=u.filter(e=>e.securityLevel===n).length;return(0,m.jsxs)(`button`,{onClick:()=>t(e===n?null:n),className:`px-3 py-1.5 rounded text-xs font-mono uppercase transition-all`,style:{backgroundColor:e===n?r+`22`:h.surface,border:`1px solid ${e===n?r:h.border}`,color:e===n?r:h.dim},children:[n,` (`,i,`)`]},n)})}),(0,m.jsx)(c,{children:`Enclave Registry`}),(0,m.jsx)(`div`,{className:`space-y-4 mb-8`,children:n.map(e=>(0,m.jsxs)(o,{className:`p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between mb-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,m.jsx)(`span`,{className:`text-xs font-mono`,style:{color:h.dim},children:e.id}),(0,m.jsx)(`span`,{className:`text-xs font-mono px-2 py-0.5 rounded`,style:{backgroundColor:g[e.securityLevel]+`15`,color:g[e.securityLevel]},children:e.securityLevel.toUpperCase()}),(0,m.jsx)(a,{status:e.enclaveStatus===`active`?`ok`:`info`,label:e.enclaveStatus.toUpperCase()})]}),(0,m.jsx)(`div`,{className:`text-sm font-medium`,style:{color:h.text},children:e.name})]}),(0,m.jsxs)(`div`,{className:`text-right`,children:[(0,m.jsx)(`div`,{className:`text-lg font-mono font-bold`,style:{color:h.accent},children:f(e.isolationScore)}),(0,m.jsx)(`div`,{className:`text-xs`,style:{color:h.dim},children:`isolation`})]})]}),(0,m.jsxs)(`div`,{className:`p-3 rounded mb-3`,style:{backgroundColor:`rgba(201,183,135,0.05)`,border:`1px solid ${h.border}`},children:[(0,m.jsx)(`div`,{className:`text-xs font-mono mb-2`,style:{color:h.dim},children:`CHERI CAPABILITY BOUNDS`}),(0,m.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-xs`,style:{color:h.dim},children:`Base`}),(0,m.jsx)(`div`,{className:`text-xs font-mono`,style:{color:h.accent},children:e.cheriBounds.base})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-xs`,style:{color:h.dim},children:`Length`}),(0,m.jsx)(`div`,{className:`text-xs font-mono`,style:{color:h.text},children:e.cheriBounds.length})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-xs`,style:{color:h.dim},children:`Permissions`}),(0,m.jsx)(`div`,{className:`flex gap-1 flex-wrap`,children:e.cheriBounds.permissions.map(e=>(0,m.jsx)(`span`,{className:`text-xs font-mono px-1 py-0.5 rounded`,style:{backgroundColor:h.surface,border:`1px solid ${h.border}`,color:h.accent,fontSize:`10px`},children:e},e))})]})]})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-xs mb-1`,style:{color:h.dim},children:`Agents`}),(0,m.jsx)(`div`,{className:`flex gap-1 flex-wrap`,children:e.agents.map(e=>(0,m.jsx)(`span`,{className:`text-xs font-mono px-1 py-0.5 rounded`,style:{backgroundColor:h.surface,color:h.text,fontSize:`10px`},children:e},e))})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-xs mb-1`,style:{color:h.dim},children:`Tools`}),(0,m.jsx)(`div`,{className:`flex gap-1 flex-wrap`,children:e.tools.map(e=>(0,m.jsx)(`span`,{className:`text-xs font-mono px-1 py-0.5 rounded`,style:{backgroundColor:h.surface,color:h.text,fontSize:`10px`},children:e},e))})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-xs`,style:{color:h.dim},children:`Network Policy`}),(0,m.jsx)(`div`,{className:`text-xs font-mono mt-1`,style:{color:e.networkPolicy===`air-gapped`?`#ef4444`:h.accent},children:_[e.networkPolicy]})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`text-xs`,style:{color:h.dim},children:`Last Pen Test`}),(0,m.jsx)(`div`,{className:`text-sm font-mono`,style:{color:h.text},children:e.lastPenTest})]})]})]},e.id))})]})}export{v as CapabilityCompartments};