a11oy / console /assets /AgentOrchestration-e_GKDiIa.js
betterwithage's picture
sync(space): full source mirror — resolve all GitHub<->Space drift (CTO)
a6a5d8e verified
Raw
History Blame
18.3 kB
import{r as u,k as e}from"./index-BVfpSx5Q.js";import{L as j}from"./layout-NiehYZnq.js";import{P as b,K as n,S as d,C as m}from"./ui-DGkmnhL-.js";const s={surface:"rgba(255,255,255,0.025)",border:"rgba(255,255,255,0.08)",text:"#f5f5f5",dim:"#8a8a8a",muted:"#5e5e5e",accent:"#c9b787"},l=[{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"]}],x=[{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}],i={model:"gpt-realtime-1.5",audio:{input:{format:"pcm16",transcription:"gpt-4o-mini-transcribe",turnDetection:"semantic_vad"},output:{voice:"ash"}},features:["Semantic VAD","Interrupt handling","Multi-agent handoff","Tool execution mid-stream","Governed transcription","Sentiment routing"]};function S(){const[c,g]=u.useState(null),[a,h]=u.useState("agents"),f=x.reduce((t,r)=>t+r.count,0),v=p.reduce((t,r)=>t+r.triggers,0),y=p.reduce((t,r)=>t+r.blocks,0),o=l.find(t=>t.id===c);return e.jsxs(j,{children:[e.jsx(b,{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"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 mb-8",children:[e.jsx(n,{label:"ACTIVE AGENTS",value:l.length,sub:"registered",accent:s.accent}),e.jsx(n,{label:"HANDOFFS TODAY",value:f,sub:"routed",accent:s.accent}),e.jsx(n,{label:"GUARDRAIL CHECKS",value:v.toLocaleString(),sub:"triggered",accent:s.dim}),e.jsx(n,{label:"BLOCKS",value:y,sub:"prevented",accent:s.text}),e.jsx(n,{label:"AVG TRUST",value:Math.round(l.reduce((t,r)=>t+r.trust,0)/l.length),sub:"score",accent:s.accent}),e.jsx(n,{label:"MODELS",value:"4",sub:"active",accent:s.dim})]}),e.jsx("div",{className:"flex gap-1 mb-6",children:["agents","handoffs","guardrails","realtime"].map(t=>e.jsx("button",{onClick:()=>h(t),className:"px-4 py-2 text-[10px] font-mono uppercase tracking-widest rounded-md transition-all",style:{background:a===t?"rgba(201,183,135,0.1)":"transparent",color:a===t?s.accent:s.muted,border:`1px solid ${a===t?"rgba(201,183,135,0.2)":"transparent"}`},children:t},t))}),a==="agents"&&e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsx("div",{className:"lg:col-span-2 space-y-2",children:l.map(t=>e.jsx("button",{onClick:()=>g(t.id),className:"w-full text-left rounded-lg p-4 transition-all",style:{background:c===t.id?"rgba(201,183,135,0.05)":s.surface,border:`1px solid ${c===t.id?"rgba(201,183,135,0.2)":s.border}`},children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:s.accent}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:s.text},children:t.name}),e.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:{background:"rgba(255,255,255,0.04)",color:s.dim},children:t.role})]}),e.jsxs("div",{className:"text-[10px] font-mono mt-0.5",style:{color:s.dim},children:[t.vertical," · ",t.model," · Trust: ",t.trust]})]}),e.jsxs("div",{className:"text-[10px] font-mono",style:{color:s.accent},children:[t.tools.length," tools"]})]})},t.id))}),e.jsx("div",{children:o?e.jsxs("div",{className:"rounded-lg p-5 sticky top-4",style:{background:s.surface,border:`1px solid ${s.border}`},children:[e.jsx("div",{className:"text-sm font-medium mb-1",style:{color:s.text},children:o.name}),e.jsxs("div",{className:"text-[10px] font-mono mb-4",style:{color:s.dim},children:[o.role," · ",o.vertical]}),e.jsx("div",{className:"text-[9px] font-mono uppercase tracking-wider mb-1.5",style:{color:s.muted},children:"Instructions"}),e.jsx("p",{className:"text-[11px] leading-relaxed mb-4",style:{color:s.dim},children:o.instructions}),e.jsx("div",{className:"text-[9px] font-mono uppercase tracking-wider mb-1.5",style:{color:s.muted},children:"Model"}),e.jsx("p",{className:"text-[11px] font-mono mb-4",style:{color:s.accent},children:o.model}),e.jsxs("div",{className:"text-[9px] font-mono uppercase tracking-wider mb-1.5",style:{color:s.muted},children:["Tools (",o.tools.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-4",children:o.tools.map(t=>e.jsx("span",{className:"text-[9px] font-mono px-2 py-0.5 rounded",style:{background:"rgba(201,183,135,0.08)",color:s.accent,border:"1px solid rgba(201,183,135,0.12)"},children:t},t))}),e.jsx("div",{className:"text-[9px] font-mono uppercase tracking-wider mb-1.5",style:{color:s.muted},children:"Guardrails"}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-4",children:o.guardrails.map(t=>e.jsx("span",{className:"text-[9px] font-mono px-2 py-0.5 rounded",style:{background:"rgba(255,255,255,0.04)",color:s.dim,border:`1px solid ${s.border}`},children:t},t))}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mt-4 pt-4",style:{borderTop:`1px solid ${s.border}`},children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[9px] font-mono",style:{color:s.muted},children:"Trust Score"}),e.jsx("div",{className:"text-lg font-bold font-mono",style:{color:s.accent},children:o.trust})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[9px] font-mono",style:{color:s.muted},children:"Handoffs"}),e.jsx("div",{className:"text-lg font-bold font-mono",style:{color:s.text},children:o.handoffs})]})]})]}):e.jsx("div",{className:"rounded-lg p-8 text-center",style:{background:s.surface,border:`1px solid ${s.border}`},children:e.jsx("div",{className:"text-xs",style:{color:s.muted},children:"Select an agent to inspect"})})})]}),a==="handoffs"&&e.jsxs(e.Fragment,{children:[e.jsx(d,{children:"Handoff Protocol"}),e.jsx("p",{className:"text-xs mb-4",style:{color:s.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."}),e.jsx("div",{className:"space-y-2 mb-8",children:x.map((t,r)=>e.jsxs("div",{className:"rounded-lg p-4 flex items-center gap-4",style:{background:s.surface,border:`1px solid ${s.border}`},children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-[200px]",children:[e.jsx("span",{className:"text-[11px] font-mono font-medium",style:{color:s.text},children:t.from}),e.jsx("span",{className:"text-[10px]",style:{color:s.accent},children:"→"}),e.jsx("span",{className:"text-[11px] font-mono font-medium",style:{color:s.accent},children:t.to})]}),e.jsx("div",{className:"flex-1 text-[10px]",style:{color:s.dim},children:t.trigger}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-[11px] font-mono font-bold",style:{color:s.text},children:t.count}),e.jsxs("div",{className:"text-[9px] font-mono",style:{color:s.muted},children:[t.avgMs,"ms"]})]})]},r))}),e.jsxs(m,{children:[e.jsx("div",{className:"text-[9px] font-mono uppercase tracking-wider mb-3",style:{color:s.muted},children:"Handoff Architecture"}),e.jsxs("div",{className:"font-mono text-[11px] space-y-1",style:{color:s.dim},children:[e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"1."})," Source agent determines handoff trigger condition"]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"2."})," Conversation history + tool state serialized"]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"3."})," Proof hash generated for the transfer"]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"4."})," Target agent receives full context + proof chain"]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"5."})," Target agent validates proof, begins processing"]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"6."})," Original agent enters dormant state (resumable)"]})]})]})]}),a==="guardrails"&&e.jsxs(e.Fragment,{children:[e.jsx(d,{children:"Guardrail Registry"}),e.jsx("p",{className:"text-xs mb-4",style:{color:s.dim},children:"Input guardrails validate before the agent processes. Output guardrails validate before results are returned. System guardrails enforce infrastructure constraints."}),e.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:`1px solid ${s.border}`},children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"rgba(255,255,255,0.02)"},children:["Guardrail","Type","Scope","Triggers","Blocks","Description"].map(t=>e.jsx("th",{className:"text-left px-4 py-2.5 font-mono text-[9px] uppercase tracking-wider",style:{color:s.muted,borderBottom:`1px solid ${s.border}`},children:t},t))})}),e.jsx("tbody",{children:p.map(t=>e.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[e.jsx("td",{className:"px-4 py-2.5 font-mono font-medium",style:{color:s.text},children:t.name}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded",style:{background:t.type==="input"?"rgba(201,183,135,0.08)":t.type==="output"?"rgba(138,138,138,0.1)":"rgba(255,255,255,0.04)",color:t.type==="input"?s.accent:t.type==="output"?s.dim:s.muted},children:t.type})}),e.jsx("td",{className:"px-4 py-2.5 font-mono",style:{color:s.dim},children:t.scope}),e.jsx("td",{className:"px-4 py-2.5 font-mono",style:{color:s.accent},children:t.triggers.toLocaleString()}),e.jsx("td",{className:"px-4 py-2.5 font-mono",style:{color:t.blocks>0?s.text:s.muted},children:t.blocks}),e.jsx("td",{className:"px-4 py-2.5",style:{color:s.dim,maxWidth:300},children:t.desc})]},t.name))})]})})]}),a==="realtime"&&e.jsxs(e.Fragment,{children:[e.jsx(d,{children:"Realtime Voice Sessions"}),e.jsx("p",{className:"text-xs mb-6",style:{color:s.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."}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[e.jsxs(m,{children:[e.jsx("div",{className:"text-[9px] font-mono uppercase tracking-wider mb-3",style:{color:s.muted},children:"Session Configuration"}),e.jsxs("div",{className:"font-mono text-[11px] space-y-2",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{style:{color:s.dim},children:"Model"}),e.jsx("span",{style:{color:s.accent},children:i.model})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{style:{color:s.dim},children:"Input Format"}),e.jsx("span",{style:{color:s.text},children:i.audio.input.format})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{style:{color:s.dim},children:"Transcription"}),e.jsx("span",{style:{color:s.text},children:i.audio.input.transcription})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{style:{color:s.dim},children:"Turn Detection"}),e.jsx("span",{style:{color:s.accent},children:i.audio.input.turnDetection})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{style:{color:s.dim},children:"Noise Reduction"}),e.jsx("span",{style:{color:s.accent},children:"enabled"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{style:{color:s.dim},children:"Output Voice"}),e.jsx("span",{style:{color:s.text},children:i.audio.output.voice})]})]})]}),e.jsxs(m,{children:[e.jsx("div",{className:"text-[9px] font-mono uppercase tracking-wider mb-3",style:{color:s.muted},children:"Realtime Capabilities"}),e.jsx("div",{className:"space-y-2",children:i.features.map(t=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:s.accent}}),e.jsx("span",{className:"text-[11px]",style:{color:s.text},children:t})]},t))})]})]}),e.jsxs("div",{className:"mt-6 rounded-lg p-5",style:{background:"#050505",border:`1px solid ${s.border}`},children:[e.jsx("div",{className:"text-[9px] font-mono uppercase tracking-wider mb-3",style:{color:s.muted},children:"Live Session Transcript — Demo"}),e.jsxs("div",{className:"font-mono text-[11px] space-y-2",children:[e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"USER"})," ",e.jsx("span",{style:{color:s.dim},children:`"What's the status of the Horizon Star vessel?"`})]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.muted},children:"VOICE"})," ",e.jsx("span",{style:{color:s.dim},children:"→ Routing to Cascade Navigator (maritime context detected)"})]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"HANDOFF"})," ",e.jsx("span",{style:{color:s.dim},children:"Voice Interface → Cascade Navigator [120ms]"})]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.text},children:"CASCADE"})," ",e.jsx("span",{style:{color:s.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."'})]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.accent},children:"USER"})," ",e.jsx("span",{style:{color:s.dim},children:'"Any sanctions risk?"'})]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.muted},children:"GUARDRAIL"})," ",e.jsx("span",{style:{color:s.dim},children:"sanctions_check triggered — screening entity"})]}),e.jsxs("div",{children:[e.jsx("span",{style:{color:s.text},children:"CASCADE"})," ",e.jsx("span",{style:{color:s.dim},children:'"Horizon Star — clean. No OFAC, EU, or UN matches. Last screened 4 hours ago."'})]})]})]})]})]})}export{S as AgentOrchestration};