/* global React, HashBadge, AttestationStatePill, ReasonCodeChip, LatencyBudgetMeter, MerkleProofTree, TimelineAxis, ThresholdGateIndicator, PartyAttestationRow, Spark */ const { useEffect: useEffectAK, useRef: useRefAK, useState: useStateAK } = React; const SIGNER_STATUS_POLL_INTERVAL_MS = 5000; const SIGNER_STATUS_TIMEOUT_MS = 3000; /* ========================================================= SHARED SHELL — global nav, tier indicator, signer status ========================================================= */ function AppShell({ active, tier = "enterprise", role = "operator", children, onNav, onTierChange, onRoleChange, onCmdK, onSignerClick }) { const surfaces = [ { id: "fraud", label: "Fraud Decision Audit", kbd: "1" }, { id: "sca", label: "SCA / 3DS Attestation", kbd: "2" }, { id: "orch", label: "Orchestration Audit", kbd: "3" }, { id: "settle", label: "Settlement Gate", kbd: "4" }, { id: "flow", label: "Dispute → CE 3.0 Flow", kbd: "5" }, ]; return (
{/* top bar — identity + signer + tier */}
ANIMA/KERNEL
{tier === "enterprise" && }
{/* nav */}
{surfaces.map(s => { const isActive = active === s.id; return ( ); })}
⌘K command · ? shortcuts · / search
{/* body */}
{children}
{/* status bar */}
kernel v2.4.1 · c=24 p50 2.1ms · p99 26.4ms 1,204 attest/s PCI SCOPE ● zero {tier === "enterprise" && HSM ● nominal} region · us-east-1 · shard 03/16 uptime 312d 04:18
); } function Dot() { return ·; } function Divider() { return ; } function LogoMark() { return ( ); } function SignerStatus({ tier, onClick }) { const isLoadingRef = useRefAK(false); const [stats, setStats] = useStateAK({ loaded: false, aigovReady: false, fintechReady: false, aigovSigner: "", fintechSigner: "", }); useEffectAK(() => { let active = true; let timeoutId = null; let controller = null; const load = async () => { if (isLoadingRef.current) { return; } isLoadingRef.current = true; controller = new AbortController(); timeoutId = window.setTimeout(() => controller.abort(), SIGNER_STATUS_TIMEOUT_MS); try { const [aigovRes, fintechRes] = await Promise.all([ fetch("/admin/aigov/attest/stats", { signal: controller.signal }), fetch("/admin/fintech/attest/stats", { signal: controller.signal }), ]); window.clearTimeout(timeoutId); timeoutId = null; const [aigovStats, fintechStats] = await Promise.all([ aigovRes.ok ? aigovRes.json() : Promise.resolve(null), fintechRes.ok ? fintechRes.json() : Promise.resolve(null), ]); if (!active) { return; } setStats({ loaded: true, aigovReady: !!(aigovStats && aigovStats.signer_ready), fintechReady: !!(fintechStats && (fintechStats.ready || fintechStats.signer_ready)), aigovSigner: (aigovStats && aigovStats.signer) || "", fintechSigner: (fintechStats && fintechStats.signer) || "", }); } catch (err) { if (!active) { return; } console.error("[SignerStatus] Failed to load attestation stats:", err); setStats({ loaded: true, aigovReady: false, fintechReady: false, aigovSigner: "", fintechSigner: "", }); } finally { if (timeoutId !== null) { window.clearTimeout(timeoutId); timeoutId = null; } isLoadingRef.current = false; } }; load(); const timer = window.setInterval(load, SIGNER_STATUS_POLL_INTERVAL_MS); return () => { active = false; if (controller) { controller.abort(); } if (timeoutId !== null) { window.clearTimeout(timeoutId); } window.clearInterval(timer); }; }, []); const liveReady = stats.aigovReady || stats.fintechReady; const signerValue = stats.aigovSigner || stats.fintechSigner; const statusLabel = liveReady ? "\u25cf live" : (stats.loaded ? "\u25cf unavailable" : "\u25cf checking"); const statusColor = liveReady ? "var(--ak-state-finalized-fg)" : (stats.loaded ? "var(--ak-state-signed-fg)" : "var(--ak-fg-2)"); return (
signer {statusLabel} {signerValue ? : (tier !== "starter" && no signer)}
); } function DomainSeparator() { return (
eip-712 domain anima.kernel@2 · chain 1
); } function LedgerMode() { return (
ledger sync · lag 0.3ms
); } function TierPicker({ tier, onChange }) { const tiers = ["starter", "pro", "enterprise"]; return (
{tiers.map(t => ( ))}
); } function RolePicker({ role, onChange }) { const roles = ["operator", "auditor"]; return (
{roles.map(r => ( ))}
); } function ThemeToggle() { return ( ); } Object.assign(window, { AppShell }); /* ========================================================= APP MENU — hamburger dropdown linking to all pages ========================================================= */ function AppMenu() { const [open, setOpen] = React.useState(false); const ref = React.useRef(null); React.useEffect(() => { if (!open) return; const close = e => { if (ref.current && !ref.current.contains(e.target)) setOpen(false); }; document.addEventListener("mousedown", close); return () => document.removeEventListener("mousedown", close); }, [open]); const links = [ { label: "Landing Page", href: "Landing Page.html", icon: "◈" }, { label: "Operator Console", href: "Anima Kernel — Operator Console.html", icon: "◆", active: true }, { label: "Test Suite (Payments)", href: "Test Suite.html", icon: "⬡" }, { label: "Business Presentation", href: "Business Presentation.html",icon: "▸" }, { label: "Investor Deck", href: "Investor Deck.html", icon: "◇" }, { label: "Company Profile", href: "Company Profile.html", icon: "◎" }, { label: "— Government —", href: "Government Landing.html", icon: "▣" }, { label: "Gov Test Suite", href: "Government Test Suite.html", icon: "⬡" }, { label: "Appeal-Replay Sim", href: "Appeal-Replay Simulator.html", icon: "▸" }, { label: "— Healthcare —", href: "Healthcare Landing.html", icon: "▣" }, { label: "Health Test Suite", href: "Healthcare Test Suite.html", icon: "⬡" }, { label: "PHI Boundary Sim", href: "PHI Boundary Simulator.html", icon: "▸" }, { label: "— Cross-cutting —", href: "Regulatory Compliance Hub.html", icon: "▣" }, { label: "Compliance Hub", href: "Regulatory Compliance Hub.html", icon: "◎" }, { label: "Architecture", href: "Architecture Diagram.html", icon: "◇" }, { label: "Sovereign Config", href: "Sovereign Configurator.html", icon: "◇" }, { label: "Partner Program", href: "Partner Program.html", icon: "◎" }, { label: "Sign out", href: "Login.html", icon: "←" }, ]; return (
{open && (
navigate
{links.map((l, i) => ( { if (!l.active) e.currentTarget.style.background = "var(--ak-bg-2)"; }} onMouseOut={e => { if (!l.active) e.currentTarget.style.background = "transparent"; }} > {l.icon} {l.label} ))}
)}
); }