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,r as a,s as o,u as s}from"./ui-Ddu9t0Or.js";var c=e(t(),1),l=n(),u={bg:`#0a0a0a`,surface:`rgba(255,255,255,0.025)`,border:`rgba(255,255,255,0.08)`,text:`#f5f5f5`,dim:`#8a8a8a`,muted:`#5e5e5e`,accent:`#c9b787`},d=[{id:`ag-cascade`,name:`Cascade Navigator`,role:`Domain Specialist`,vertical:`Maritime`,model:`claude-sonnet-4`,status:`active`,trust:97,handoffs:12,tools:[`eta_calc`,`port_cost`,`route_opt`,`weather_api`],instructions:`Monitor fleet positions, calculate ETAs, flag anomalies. Escalate sanctions risk to Guardian.`,guardrails:[`sanctions_check`,`cost_threshold`]},{id:`ag-guardian`,name:`Guardian`,role:`Domain Specialist`,vertical:`Defense`,model:`claude-sonnet-4`,status:`active`,trust:99,handoffs:8,tools:[`threat_intel`,`posture_assess`,`incident_triage`,`stix_parser`],instructions:`Continuous threat posture assessment. Autonomous triage for severity < P2. Human-in-the-loop for P1+.`,guardrails:[`classification_gate`,`air_gap_verify`]},{id:`ag-counsel`,name:`Counsel Sentinel`,role:`Domain Specialist`,vertical:`Legal`,model:`gpt-4o`,status:`active`,trust:99,handoffs:5,tools:[`deadline_track`,`doc_review`,`risk_score`,`obligation_graph`],instructions:`Track matter deadlines, flag risk. Never generate legal advice — surface evidence and recommend human review.`,guardrails:[`legal_advice_block`,`privilege_check`]},{id:`ag-oracle`,name:`Pipeline Oracle`,role:`Domain Specialist`,vertical:`Revenue`,model:`gpt-4o`,status:`active`,trust:91,handoffs:14,tools:[`pipeline_analysis`,`deal_score`,`forecast_model`,`crm_sync`],instructions:`Score deals, forecast revenue, identify at-risk pipeline. Handoff to Counsel for contract review.`,guardrails:[`revenue_disclosure`,`forecast_confidence`]},{id:`ag-terra`,name:`Terra Analyst`,role:`Domain Specialist`,vertical:`Real Estate`,model:`gpt-4o`,status:`active`,trust:88,handoffs:6,tools:[`cap_rate`,`portfolio_analysis`,`valuation_model`,`market_comp`],instructions:`Track portfolio metrics, run valuations, detect market signals. Escalate large transactions.`,guardrails:[`valuation_bounds`,`transaction_limit`]},{id:`ag-fabric`,name:`Fabric Watchdog`,role:`System`,vertical:`Core`,model:`internal`,status:`active`,trust:100,handoffs:0,tools:[`mesh_health`,`layer_monitor`,`proof_verify`,`latency_track`],instructions:`Monitor all 7 fabric layers. Auto-remediate latency spikes. Alert on proof chain violations.`,guardrails:[`uptime_sla`,`proof_integrity`]},{id:`ag-mirror`,name:`MirrorEval`,role:`Evaluator`,vertical:`Core`,model:`claude-sonnet-4`,status:`active`,trust:98,handoffs:3,tools:[`eval_run`,`bias_detect`,`drift_score`,`benchmark`],instructions:`Continuously evaluate agent outputs for quality, bias, and drift. Flag degradation > 2σ.`,guardrails:[`eval_independence`,`score_calibration`]},{id:`ag-voice`,name:`Voice Interface`,role:`Realtime`,vertical:`Core`,model:`gpt-realtime-1.5`,status:`active`,trust:94,handoffs:7,tools:[`voice_session`,`transcript`,`sentiment_detect`,`handoff_route`],instructions:`Low-latency voice sessions. Semantic VAD. Route to domain specialist via handoff protocol.`,guardrails:[`pii_redaction`,`recording_consent`]}],f=[{from:`Voice Interface`,to:`Cascade Navigator`,trigger:`User mentions vessel or maritime`,count:47,avgMs:120},{from:`Voice Interface`,to:`Guardian`,trigger:`User mentions threat or security`,count:23,avgMs:95},{from:`Cascade Navigator`,to:`Counsel Sentinel`,trigger:`Sanctions flag on vessel`,count:8,avgMs:340},{from:`Pipeline Oracle`,to:`Counsel Sentinel`,trigger:`Contract review needed`,count:12,avgMs:180},{from:`Guardian`,to:`Fabric Watchdog`,trigger:`Infrastructure threat detected`,count:3,avgMs:45},{from:`Terra Analyst`,to:`Pipeline Oracle`,trigger:`Portfolio transaction > $5M`,count:5,avgMs:210},{from:`Any Agent`,to:`MirrorEval`,trigger:`Output confidence < 0.7`,count:31,avgMs:67},{from:`MirrorEval`,to:`Human Approver`,trigger:`Bias or drift detected`,count:4,avgMs:0}],p=[{name:`sanctions_check`,type:`input`,scope:`Maritime`,desc:`Screen entity names against OFAC/EU sanctions lists before processing`,triggers:847,blocks:12},{name:`classification_gate`,type:`input`,scope:`Defense`,desc:`Verify clearance level before exposing threat intelligence`,triggers:2103,blocks:0},{name:`legal_advice_block`,type:`output`,scope:`Legal`,desc:`Prevent generation of direct legal advice — surface evidence only`,triggers:1247,blocks:89},{name:`pii_redaction`,type:`output`,scope:`All`,desc:`Redact personally identifiable information from agent outputs`,triggers:4892,blocks:234},{name:`revenue_disclosure`,type:`output`,scope:`Revenue`,desc:`Prevent forward-looking revenue statements without disclaimer`,triggers:891,blocks:34},{name:`proof_integrity`,type:`system`,scope:`Core`,desc:`Verify proof chain hash before committing any agent action`,triggers:12847,blocks:0},{name:`cost_threshold`,type:`system`,scope:`All`,desc:`Halt agent if session cost exceeds $5.00 without approval`,triggers:203,blocks:7},{name:`eval_independence`,type:`system`,scope:`Core`,desc:`Ensure MirrorEval never evaluates its own outputs`,triggers:3201,blocks:0}],m={model:`gpt-realtime-1.5`,audio:{input:{format:`pcm16`,transcription:`gpt-4o-mini-transcribe`,turnDetection:`semantic_vad`,noiseReduction:!0},output:{format:`pcm16`,voice:`ash`}},features:[`Semantic VAD`,`Interrupt handling`,`Multi-agent handoff`,`Tool execution mid-stream`,`Governed transcription`,`Sentiment routing`]};function h(){let[e,t]=(0,c.useState)(null),[n,h]=(0,c.useState)(`agents`),g=f.reduce((e,t)=>e+t.count,0),_=p.reduce((e,t)=>e+t.triggers,0),v=p.reduce((e,t)=>e+t.blocks,0),y=d.find(t=>t.id===e);return(0,l.jsxs)(r,{children:[(0,l.jsx)(i,{label:`MULTI-AGENT ORCHESTRATION`,title:`Agent Orchestration`,subtitle:`OpenAI Agents SDK patterns — handoffs, guardrails, tool routing, realtime voice, and human-in-the-loop — governed by the a11oy proof chain.`,status:`LIVE`}),(0,l.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 mb-8`,children:[(0,l.jsx)(o,{label:`ACTIVE AGENTS`,value:d.length,sub:`registered`,accent:u.accent}),(0,l.jsx)(o,{label:`HANDOFFS TODAY`,value:g,sub:`routed`,accent:u.accent}),(0,l.jsx)(o,{label:`GUARDRAIL CHECKS`,value:_.toLocaleString(),sub:`triggered`,accent:u.dim}),(0,l.jsx)(o,{label:`BLOCKS`,value:v,sub:`prevented`,accent:u.text}),(0,l.jsx)(o,{label:`AVG TRUST`,value:Math.round(d.reduce((e,t)=>e+t.trust,0)/d.length),sub:`score`,accent:u.accent}),(0,l.jsx)(o,{label:`MODELS`,value:`4`,sub:`active`,accent:u.dim})]}),(0,l.jsx)(`div`,{className:`flex gap-1 mb-6`,children:[`agents`,`handoffs`,`guardrails`,`realtime`].map(e=>(0,l.jsx)(`button`,{onClick:()=>h(e),className:`px-4 py-2 text-[10px] font-mono uppercase tracking-widest rounded-md transition-all`,style:{background:n===e?`rgba(201,183,135,0.1)`:`transparent`,color:n===e?u.accent:u.muted,border:`1px solid ${n===e?`rgba(201,183,135,0.2)`:`transparent`}`},children:e},e))}),n===`agents`&&(0,l.jsxs)(`div`,{className:`grid lg:grid-cols-3 gap-6`,children:[(0,l.jsx)(`div`,{className:`lg:col-span-2 space-y-2`,children:d.map(n=>(0,l.jsx)(`button`,{onClick:()=>t(n.id),className:`w-full text-left rounded-lg p-4 transition-all`,style:{background:e===n.id?`rgba(201,183,135,0.05)`:u.surface,border:`1px solid ${e===n.id?`rgba(201,183,135,0.2)`:u.border}`},children:(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsx)(`div`,{className:`w-2 h-2 rounded-full`,style:{background:u.accent}}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-xs font-medium`,style:{color:u.text},children:n.name}),(0,l.jsx)(`span`,{className:`text-[9px] font-mono px-1.5 py-0.5 rounded`,style:{background:`rgba(255,255,255,0.04)`,color:u.dim},children:n.role})]}),(0,l.jsxs)(`div`,{className:`text-[10px] font-mono mt-0.5`,style:{color:u.dim},children:[n.vertical,` · `,n.model,` · Trust: `,n.trust]})]}),(0,l.jsxs)(`div`,{className:`text-[10px] font-mono`,style:{color:u.accent},children:[n.tools.length,` tools`]})]})},n.id))}),(0,l.jsx)(`div`,{children:y?(0,l.jsxs)(`div`,{className:`rounded-lg p-5 sticky top-4`,style:{background:u.surface,border:`1px solid ${u.border}`},children:[(0,l.jsx)(`div`,{className:`text-sm font-medium mb-1`,style:{color:u.text},children:y.name}),(0,l.jsxs)(`div`,{className:`text-[10px] font-mono mb-4`,style:{color:u.dim},children:[y.role,` · `,y.vertical]}),(0,l.jsx)(`div`,{className:`text-[9px] font-mono uppercase tracking-wider mb-1.5`,style:{color:u.muted},children:`Instructions`}),(0,l.jsx)(`p`,{className:`text-[11px] leading-relaxed mb-4`,style:{color:u.dim},children:y.instructions}),(0,l.jsx)(`div`,{className:`text-[9px] font-mono uppercase tracking-wider mb-1.5`,style:{color:u.muted},children:`Model`}),(0,l.jsx)(`p`,{className:`text-[11px] font-mono mb-4`,style:{color:u.accent},children:y.model}),(0,l.jsxs)(`div`,{className:`text-[9px] font-mono uppercase tracking-wider mb-1.5`,style:{color:u.muted},children:[`Tools (`,y.tools.length,`)`]}),(0,l.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-4`,children:y.tools.map(e=>(0,l.jsx)(`span`,{className:`text-[9px] font-mono px-2 py-0.5 rounded`,style:{background:`rgba(201,183,135,0.08)`,color:u.accent,border:`1px solid rgba(201,183,135,0.12)`},children:e},e))}),(0,l.jsx)(`div`,{className:`text-[9px] font-mono uppercase tracking-wider mb-1.5`,style:{color:u.muted},children:`Guardrails`}),(0,l.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-4`,children:y.guardrails.map(e=>(0,l.jsx)(`span`,{className:`text-[9px] font-mono px-2 py-0.5 rounded`,style:{background:`rgba(255,255,255,0.04)`,color:u.dim,border:`1px solid ${u.border}`},children:e},e))}),(0,l.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 mt-4 pt-4`,style:{borderTop:`1px solid ${u.border}`},children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`text-[9px] font-mono`,style:{color:u.muted},children:`Trust Score`}),(0,l.jsx)(`div`,{className:`text-lg font-bold font-mono`,style:{color:u.accent},children:y.trust})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`text-[9px] font-mono`,style:{color:u.muted},children:`Handoffs`}),(0,l.jsx)(`div`,{className:`text-lg font-bold font-mono`,style:{color:u.text},children:y.handoffs})]})]})]}):(0,l.jsx)(`div`,{className:`rounded-lg p-8 text-center`,style:{background:u.surface,border:`1px solid ${u.border}`},children:(0,l.jsx)(`div`,{className:`text-xs`,style:{color:u.muted},children:`Select an agent to inspect`})})})]}),n===`handoffs`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{children:`Handoff Protocol`}),(0,l.jsx)(`p`,{className:`text-xs mb-4`,style:{color:u.dim},children:`When an agent determines a conversation should be routed to a specialist, it executes a governed handoff — the full context, tool state, and proof chain transfer atomically.`}),(0,l.jsx)(`div`,{className:`space-y-2 mb-8`,children:f.map((e,t)=>(0,l.jsxs)(`div`,{className:`rounded-lg p-4 flex items-center gap-4`,style:{background:u.surface,border:`1px solid ${u.border}`},children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 min-w-[200px]`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-mono font-medium`,style:{color:u.text},children:e.from}),(0,l.jsx)(`span`,{className:`text-[10px]`,style:{color:u.accent},children:`→`}),(0,l.jsx)(`span`,{className:`text-[11px] font-mono font-medium`,style:{color:u.accent},children:e.to})]}),(0,l.jsx)(`div`,{className:`flex-1 text-[10px]`,style:{color:u.dim},children:e.trigger}),(0,l.jsxs)(`div`,{className:`text-right`,children:[(0,l.jsx)(`div`,{className:`text-[11px] font-mono font-bold`,style:{color:u.text},children:e.count}),(0,l.jsxs)(`div`,{className:`text-[9px] font-mono`,style:{color:u.muted},children:[e.avgMs,`ms`]})]})]},t))}),(0,l.jsxs)(a,{children:[(0,l.jsx)(`div`,{className:`text-[9px] font-mono uppercase tracking-wider mb-3`,style:{color:u.muted},children:`Handoff Architecture`}),(0,l.jsxs)(`div`,{className:`font-mono text-[11px] space-y-1`,style:{color:u.dim},children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`1.`}),` Source agent determines handoff trigger condition`]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`2.`}),` Conversation history + tool state serialized`]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`3.`}),` Proof hash generated for the transfer`]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`4.`}),` Target agent receives full context + proof chain`]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`5.`}),` Target agent validates proof, begins processing`]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`6.`}),` Original agent enters dormant state (resumable)`]})]})]})]}),n===`guardrails`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{children:`Guardrail Registry`}),(0,l.jsx)(`p`,{className:`text-xs mb-4`,style:{color:u.dim},children:`Input guardrails validate before the agent processes. Output guardrails validate before results are returned. System guardrails enforce infrastructure constraints.`}),(0,l.jsx)(`div`,{className:`rounded-lg overflow-hidden`,style:{border:`1px solid ${u.border}`},children:(0,l.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsx)(`tr`,{style:{background:`rgba(255,255,255,0.02)`},children:[`Guardrail`,`Type`,`Scope`,`Triggers`,`Blocks`,`Description`].map(e=>(0,l.jsx)(`th`,{className:`text-left px-4 py-2.5 font-mono text-[9px] uppercase tracking-wider`,style:{color:u.muted,borderBottom:`1px solid ${u.border}`},children:e},e))})}),(0,l.jsx)(`tbody`,{children:p.map(e=>(0,l.jsxs)(`tr`,{style:{borderBottom:`1px solid rgba(255,255,255,0.04)`},children:[(0,l.jsx)(`td`,{className:`px-4 py-2.5 font-mono font-medium`,style:{color:u.text},children:e.name}),(0,l.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,l.jsx)(`span`,{className:`text-[9px] font-mono px-1.5 py-0.5 rounded`,style:{background:e.type===`input`?`rgba(201,183,135,0.08)`:e.type===`output`?`rgba(138,138,138,0.1)`:`rgba(255,255,255,0.04)`,color:e.type===`input`?u.accent:e.type===`output`?u.dim:u.muted},children:e.type})}),(0,l.jsx)(`td`,{className:`px-4 py-2.5 font-mono`,style:{color:u.dim},children:e.scope}),(0,l.jsx)(`td`,{className:`px-4 py-2.5 font-mono`,style:{color:u.accent},children:e.triggers.toLocaleString()}),(0,l.jsx)(`td`,{className:`px-4 py-2.5 font-mono`,style:{color:e.blocks>0?u.text:u.muted},children:e.blocks}),(0,l.jsx)(`td`,{className:`px-4 py-2.5`,style:{color:u.dim,maxWidth:300},children:e.desc})]},e.name))})]})})]}),n===`realtime`&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s,{children:`Realtime Voice Sessions`}),(0,l.jsx)(`p`,{className:`text-xs mb-6`,style:{color:u.dim},children:`Low-latency voice sessions with semantic turn detection, mid-stream tool execution, and governed multi-agent handoffs. Built on the OpenAI Realtime API.`}),(0,l.jsxs)(`div`,{className:`grid lg:grid-cols-2 gap-6`,children:[(0,l.jsxs)(a,{children:[(0,l.jsx)(`div`,{className:`text-[9px] font-mono uppercase tracking-wider mb-3`,style:{color:u.muted},children:`Session Configuration`}),(0,l.jsxs)(`div`,{className:`font-mono text-[11px] space-y-2`,children:[(0,l.jsxs)(`div`,{className:`flex justify-between`,children:[(0,l.jsx)(`span`,{style:{color:u.dim},children:`Model`}),(0,l.jsx)(`span`,{style:{color:u.accent},children:m.model})]}),(0,l.jsxs)(`div`,{className:`flex justify-between`,children:[(0,l.jsx)(`span`,{style:{color:u.dim},children:`Input Format`}),(0,l.jsx)(`span`,{style:{color:u.text},children:m.audio.input.format})]}),(0,l.jsxs)(`div`,{className:`flex justify-between`,children:[(0,l.jsx)(`span`,{style:{color:u.dim},children:`Transcription`}),(0,l.jsx)(`span`,{style:{color:u.text},children:m.audio.input.transcription})]}),(0,l.jsxs)(`div`,{className:`flex justify-between`,children:[(0,l.jsx)(`span`,{style:{color:u.dim},children:`Turn Detection`}),(0,l.jsx)(`span`,{style:{color:u.accent},children:m.audio.input.turnDetection})]}),(0,l.jsxs)(`div`,{className:`flex justify-between`,children:[(0,l.jsx)(`span`,{style:{color:u.dim},children:`Noise Reduction`}),(0,l.jsx)(`span`,{style:{color:u.accent},children:`enabled`})]}),(0,l.jsxs)(`div`,{className:`flex justify-between`,children:[(0,l.jsx)(`span`,{style:{color:u.dim},children:`Output Voice`}),(0,l.jsx)(`span`,{style:{color:u.text},children:m.audio.output.voice})]})]})]}),(0,l.jsxs)(a,{children:[(0,l.jsx)(`div`,{className:`text-[9px] font-mono uppercase tracking-wider mb-3`,style:{color:u.muted},children:`Realtime Capabilities`}),(0,l.jsx)(`div`,{className:`space-y-2`,children:m.features.map(e=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full`,style:{background:u.accent}}),(0,l.jsx)(`span`,{className:`text-[11px]`,style:{color:u.text},children:e})]},e))})]})]}),(0,l.jsxs)(`div`,{className:`mt-6 rounded-lg p-5`,style:{background:`#050505`,border:`1px solid ${u.border}`},children:[(0,l.jsx)(`div`,{className:`text-[9px] font-mono uppercase tracking-wider mb-3`,style:{color:u.muted},children:`Live Session Transcript — Demo`}),(0,l.jsxs)(`div`,{className:`font-mono text-[11px] space-y-2`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`USER`}),` `,(0,l.jsx)(`span`,{style:{color:u.dim},children:`"What's the status of the Horizon Star vessel?"`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.muted},children:`VOICE`}),` `,(0,l.jsx)(`span`,{style:{color:u.dim},children:`→ Routing to Cascade Navigator (maritime context detected)`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`HANDOFF`}),` `,(0,l.jsx)(`span`,{style:{color:u.dim},children:`Voice Interface → Cascade Navigator [120ms]`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.text},children:`CASCADE`}),` `,(0,l.jsx)(`span`,{style:{color:u.dim},children:`"The Horizon Star is currently 42 nautical miles southwest of Singapore, ETA to Port Klang is 14 hours. No anomalies detected. Fuel consumption is 2% below baseline."`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.accent},children:`USER`}),` `,(0,l.jsx)(`span`,{style:{color:u.dim},children:`"Any sanctions risk?"`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.muted},children:`GUARDRAIL`}),` `,(0,l.jsx)(`span`,{style:{color:u.dim},children:`sanctions_check triggered — screening entity`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:u.text},children:`CASCADE`}),` `,(0,l.jsx)(`span`,{style:{color:u.dim},children:`"Horizon Star — clean. No OFAC, EU, or UN matches. Last screened 4 hours ago."`})]})]})]})]})]})}export{h as AgentOrchestration};