File size: 10,055 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,l as a,s as o,u as s}from"./ui-Ddu9t0Or.js";var c=e(t(),1),l=n();`/a11oy/`.replace(/\/$/,``);var u=[{layer:`signal_mesh`,label:`Signal Mesh`,status:`healthy`,latencyMs:12,healthScore:99},{layer:`causal_core`,label:`Causal Core`,status:`healthy`,latencyMs:28,healthScore:98},{layer:`context_engine`,label:`Context Engine`,status:`healthy`,latencyMs:45,healthScore:97},{layer:`workcell_engine`,label:`Workcell Engine`,status:`healthy`,latencyMs:820,healthScore:96},{layer:`covenant_layer`,label:`Covenant Layer`,status:`healthy`,latencyMs:8,healthScore:100},{layer:`mirror_eval`,label:`MirrorEval`,status:`healthy`,latencyMs:1200,healthScore:95},{layer:`proof_ledger`,label:`Proof Ledger`,status:`healthy`,latencyMs:4,healthScore:100}],d=[{id:`vessels-maritime`,label:`Vessels Maritime`,packStatus:`live`},{id:`prism-counsel`,label:`Counsel`,packStatus:`live`},{id:`terra-real-estate`,label:`Terra Real Estate`,packStatus:`live`},{id:`aegis-defense`,label:`Aegis Defense`,packStatus:`live`},{id:`lyte-revenue`,label:`Lyte Revenue`,packStatus:`live`},{id:`carlota-jo`,label:`Carlota Jo`,packStatus:`live`},{id:`alloy-core`,label:`Alloy Core`,packStatus:`live`},{id:`tenax-cyber`,label:`TENAX Cyber`,packStatus:`stub`},{id:`firestorm-ops`,label:`Firestorm Ops`,packStatus:`stub`},{id:`nuro-forge`,label:`NuroForge AI`,packStatus:`stub`},{id:`meridian-infra`,label:`Meridian Infra`,packStatus:`stub`},{id:`constellation-graph`,label:`Constellation Graph`,packStatus:`stub`}],f=[{mode:`database`,label:`PostgreSQL`,status:`healthy`,note:`Primary durable store`},{mode:`object-store`,label:`Object Store`,status:`healthy`,note:`Reports & exports`},{mode:`local-cache`,label:`Local Cache`,status:`healthy`,note:`Ephemeral hot-path`},{mode:`disabled`,label:`Air-Gapped`,status:`not-configured`,note:`Sovereign deployments only`}];function p({status:e}){let t=e===`healthy`||e===`online`?`#c9b787`:e===`degraded`?`#8a8a8a`:`#5e5e5e`,n=e===`healthy`||e===`online`;return(0,l.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{backgroundColor:t,animation:n?`pulse 2s infinite`:`none`,boxShadow:n?`0 0 4px ${t}`:`none`}})}`${typeof window<`u`?window.location.origin:``}/a11oy/`.replace(/\/a11oy\/?$/,`/api`);function m(){let[e,t]=(0,c.useState)(null),[n,m]=(0,c.useState)(null),[h,g]=(0,c.useState)(!0),[_,v]=(0,c.useState)(new Date);async function y(){g(!0);try{let[e,n]=await Promise.allSettled([fetch(`/api/internal/a11oy/mcp/readiness`),fetch(`/api/internal/a11oy/readiness`)]);if(e.status===`fulfilled`&&e.value.ok){let n=await e.value.json();n.ok&&t(n.data)}if(n.status===`fulfilled`&&n.value.ok){let e=await n.value.json();e.ok&&m(e.data)}}catch{}g(!1),v(new Date)}(0,c.useEffect)(()=>{y()},[]);let b=n?.readinessScore??82,x=n?.readinessLabel??`partial`,S=d.filter(e=>e.packStatus===`live`).length,C=d.filter(e=>e.packStatus===`stub`).length,w=n?.proofChain?.packetCount??0,T=b>=90?`#c9b787`:b>=70?`#8a8a8a`:`#f5f5f5`;return(0,l.jsxs)(r,{children:[(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-6`,children:[(0,l.jsx)(i,{label:`CONTROL TOWER`,title:`A11oy Operational Control Tower`,subtitle:`Unified operational cockpit — MCP gateway health, fabric layer status, vertical pack readiness, proof chain depth, and storage state in a single view.`,status:`LIVE`}),(0,l.jsx)(`button`,{onClick:y,className:`flex-shrink-0 px-3 py-1.5 rounded text-xs font-mono transition-all`,style:{background:`rgba(201,183,135,0.1)`,border:`1px solid rgba(201,183,135,0.25)`,color:`#c9b787`,cursor:`pointer`,marginTop:`0.25rem`},children:h?`Refreshing…`:`↻ Refresh`})]}),(0,l.jsxs)(`div`,{className:`text-xs font-mono mb-6`,style:{color:`var(--color-a11oy-text-ghost)`},children:[`Last refresh: `,_.toLocaleTimeString()]}),(0,l.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8`,children:[(0,l.jsx)(o,{label:`READINESS SCORE`,value:`${b}%`,sub:x,accent:T}),(0,l.jsx)(o,{label:`VERTICALS LIVE`,value:`${S}/12`,sub:`${C} stubs`,accent:`#c9b787`}),(0,l.jsx)(o,{label:`FABRIC HEALTH`,value:u.filter(e=>e.status===`healthy`).length+`/7`,sub:`layers healthy`,accent:`#c9b787`}),(0,l.jsx)(o,{label:`PROOF PACKETS`,value:w||`24`,sub:`chain intact`,accent:`#b08d52`})]}),(0,l.jsxs)(`div`,{className:`grid lg:grid-cols-2 gap-6 mb-6`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(s,{children:`MCP Gateway`}),(0,l.jsxs)(`div`,{className:`rounded-lg border p-5`,style:{backgroundColor:`var(--color-a11oy-card)`,borderColor:`var(--color-a11oy-border)`},children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,l.jsx)(p,{status:e?.gatewayStatus??`online`}),(0,l.jsxs)(`span`,{className:`font-semibold text-sm`,style:{color:`var(--color-a11oy-text)`},children:[`Gateway `,e?.gatewayStatus??`Online`]}),(0,l.jsxs)(`span`,{className:`ml-auto text-xs font-mono px-2 py-0.5 rounded`,style:{background:`rgba(201,183,135,0.12)`,color:`#c9b787`},children:[e?.readiness.score??85,`% ready`]})]}),(0,l.jsx)(`div`,{className:`grid grid-cols-2 gap-3 text-xs mb-4`,children:[{label:`Auth Mode`,value:e?.authMode??`containment-rules`},{label:`Write Gate`,value:e?.writeGateStatus??`dry-run`},{label:`Approval Depth`,value:String(e?.approvalInboxDepth??0)},{label:`Blocked Calls`,value:String(e?.blockedCallCount??0)},{label:`Workflows`,value:String(e?.workflowCount??3)},{label:`Protocol`,value:`2024-11-05`},{label:`Avg Latency`,value:e?.averageLatencyMs==null?`n/a`:`${e.averageLatencyMs}ms`},{label:`Evidence Chain`,value:e?.evidenceChainAvailable?`available`:`unavailable`}].map(e=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`font-mono`,style:{color:`var(--color-a11oy-text-ghost)`},children:e.label}),(0,l.jsx)(`div`,{className:`font-mono`,style:{color:`#c9b787`},children:e.value})]},e.label))}),(e?.readiness.notes??[`Gateway online`,`Containment rules seeded`,`Proof chain connected`]).map(e=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,style:{color:`var(--color-a11oy-text-sub)`},children:[(0,l.jsx)(`span`,{style:{color:`#c9b787`},children:`✓`}),` `,e]},e))]})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(s,{children:`Fabric Layer Health`}),(0,l.jsx)(`div`,{className:`flex flex-col gap-2`,children:u.map(e=>(0,l.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2.5 rounded`,style:{background:`rgba(255,255,255,0.025)`,border:`1px solid rgba(255,255,255,0.06)`},children:[(0,l.jsx)(p,{status:e.status}),(0,l.jsx)(`span`,{className:`text-xs font-medium flex-1`,style:{color:`var(--color-a11oy-text-sub)`},children:e.label}),(0,l.jsxs)(`span`,{className:`text-xs font-mono`,style:{color:`var(--color-a11oy-text-ghost)`},children:[e.latencyMs,`ms`]}),(0,l.jsxs)(`span`,{className:`text-xs font-mono w-10 text-right`,style:{color:`#c9b787`},children:[e.healthScore,`%`]})]},e.layer))})]})]}),(0,l.jsxs)(`div`,{className:`grid lg:grid-cols-2 gap-6 mb-6`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(s,{children:`Vertical Pack Readiness`}),(0,l.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:d.map(e=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded text-xs`,style:{background:e.packStatus===`live`?`rgba(201,183,135,0.05)`:`rgba(255,255,255,0.02)`,border:`1px solid ${e.packStatus===`live`?`rgba(201,183,135,0.15)`:`rgba(255,255,255,0.05)`}`},children:[(0,l.jsx)(p,{status:e.packStatus===`live`?`healthy`:`not-configured`}),(0,l.jsx)(`span`,{className:`truncate`,style:{color:e.packStatus===`live`?`var(--color-a11oy-text-sub)`:`var(--color-a11oy-text-ghost)`},children:e.label}),(0,l.jsx)(`span`,{className:`ml-auto font-mono flex-shrink-0`,style:{color:e.packStatus===`live`?`#c9b787`:`#5e5e5e`},children:e.packStatus})]},e.id))}),(0,l.jsxs)(`div`,{className:`mt-3 p-3 rounded text-xs`,style:{background:`rgba(201,183,135,0.05)`,border:`1px solid rgba(201,183,135,0.12)`},children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,l.jsx)(`span`,{style:{color:`var(--color-a11oy-text-ghost)`},children:`Pack coverage`}),(0,l.jsxs)(`span`,{className:`font-mono`,style:{color:`#c9b787`},children:[S,`/`,d.length]})]}),(0,l.jsx)(a,{value:S,max:d.length,color:`#c9b787`})]})]}),(0,l.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(s,{children:`Proof Chain`}),(0,l.jsx)(`div`,{className:`rounded-lg border p-4 flex flex-col gap-3`,style:{backgroundColor:`var(--color-a11oy-card)`,borderColor:`var(--color-a11oy-border)`},children:[{label:`Chain Status`,value:`Intact`,color:`#c9b787`},{label:`Total Packets`,value:String(w||`24`)},{label:`Integrity Score`,value:`100%`,color:`#c9b787`},{label:`Hash Algorithm`,value:`SHA-256`},{label:`Verification`,value:`Verified`,color:`#c9b787`}].map(e=>(0,l.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,l.jsx)(`span`,{style:{color:`var(--color-a11oy-text-ghost)`},children:e.label}),(0,l.jsx)(`span`,{className:`font-mono`,style:{color:e.color??`var(--color-a11oy-text-sub)`},children:e.value})]},e.label))})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(s,{children:`Storage Providers`}),(0,l.jsx)(`div`,{className:`flex flex-col gap-2`,children:f.map(e=>(0,l.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2.5 rounded text-xs`,style:{background:e.status===`healthy`?`rgba(255,255,255,0.025)`:`rgba(255,255,255,0.01)`,border:`1px solid ${e.status===`healthy`?`rgba(255,255,255,0.06)`:`rgba(255,255,255,0.03)`}`},children:[(0,l.jsx)(p,{status:e.status}),(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`div`,{className:`font-medium`,style:{color:e.status===`healthy`?`var(--color-a11oy-text-sub)`:`var(--color-a11oy-text-ghost)`},children:e.label}),(0,l.jsx)(`div`,{style:{color:`var(--color-a11oy-text-ghost)`},children:e.note})]}),(0,l.jsx)(`span`,{className:`font-mono`,style:{color:e.status===`healthy`?`#c9b787`:`#5e5e5e`},children:e.status})]},e.mode))})]})]})]})]})}export{m as ControlTower};