a11oy / console /assets /ApprovalQueue-BFR-wN6g.js
betterwithage's picture
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
da2854c verified
Raw
History Blame
12.3 kB
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}from"./ui-Ddu9t0Or.js";var s=e(t(),1),c=n(),l=`#c9b787`,u={Critical:`#ef4444`,High:`#f97316`,Medium:`#c9b787`,Low:`#8a8a8a`},d={Maritime:`#8a8a8a`,Legal:`#c9b787`,Revenue:`#c9b787`,Defense:`#f5f5f5`,Finance:`#c9b787`,"Real Estate":`#8a8a8a`},f=[{id:`aq-001`,title:`MV Cascade port standby authorization — 48h, $14,200/day`,domain:`Maritime`,agent:`Cascade Navigator`,agentRole:`Domain Specialist — Vessels Maritime`,risk:`High`,urgency:`T-2h deadline`,requestedAt:`2026-04-26T10:30:00Z`,why:`MV Cascade is 18h behind schedule due to Tanjung Pelepas congestion. Port standby avoids demurrage exposure of $42,000 by repositioning to anchorage. Three alternatives evaluated; standby is optimal.`,evidence:[`sig-001`,`ais-feed-cascade`,`pol-maritime-002`],estimatedImpact:`Avoids $42,000 demurrage · Cost: $14,200/day · ETA improvement: 18h`,requiresApprover:`VP Operations`,mirrorEvalScore:94,status:`pending`},{id:`aq-002`,title:`Talbot matter — escalate discovery to lead counsel and external co-counsel`,domain:`Legal`,agent:`Counsel Sentinel`,agentRole:`Domain Specialist — Prism Counsel`,risk:`Critical`,urgency:`T-48h court deadline`,requestedAt:`2026-04-26T08:00:00Z`,why:`Discovery deadline is T-48h. 340 documents outstanding in the Talbot matter. Production delay risk: adverse inference motion. Escalation to co-counsel is required to meet production schedule.`,evidence:[`sig-002`,`clio-matter-4421`,`pol-legal-003`],estimatedImpact:`Avoids adverse inference motion · Risk exposure: $2.1M settlement range`,requiresApprover:`General Counsel`,mirrorEvalScore:98,status:`pending`},{id:`aq-003`,title:`Pipeline intervention — engage 3 at-risk Q2 accounts with executive outreach`,domain:`Revenue`,agent:`Pipeline Oracle`,agentRole:`Domain Specialist — Lyte Revenue`,risk:`Medium`,urgency:`Next 72h window`,requestedAt:`2026-04-25T22:15:00Z`,why:`Three accounts (Meridian, Apex, NovaTech) show 85%+ churn probability based on engagement signals. Executive-level outreach has 3.2x conversion rate vs. standard rep cadence for this segment.`,evidence:[`sig-003`,`salesforce-opp-2234`,`pol-revenue-001`],estimatedImpact:`Revenue at risk: $840K ARR · Recovery probability: 65% with exec outreach`,requiresApprover:`VP Revenue`,mirrorEvalScore:88,status:`pending`},{id:`aq-004`,title:`Capex variance acknowledgment — Q1 $340K over budget in Tech Infrastructure`,domain:`Finance`,agent:`Fabric Watchdog`,agentRole:`System — A11oy Core`,risk:`Medium`,urgency:`Board reporting T-5d`,requestedAt:`2026-04-25T18:00:00Z`,why:`Q1 capex variance of $340K (8.2%) in Tech Infrastructure category exceeds the 5% policy threshold. Board packet requires acknowledgment before report generation. No corrective action required.`,evidence:[`sig-007`,`erp-q1-variance`,`pol-finance-001`],estimatedImpact:`Board compliance · No financial action required · Acknowledge only`,requiresApprover:`CFO Delegate`,mirrorEvalScore:99,status:`pending`},{id:`aq-005`,title:`Tier Omega property — authorize LOI submission at $28.5M`,domain:`Real Estate`,agent:`Terra Analyst`,agentRole:`Domain Specialist — Terra Real Estate`,risk:`High`,urgency:`Seller deadline T-24h`,requestedAt:`2026-04-25T14:30:00Z`,why:`Cap rate analysis shows 7.8% yield at $28.5M — above fund threshold of 7.2%. Seller deadline is 24h. Comps support valuation. LOI is non-binding but secures exclusivity.`,evidence:[`sig-006`,`costar-prop-88821`,`pol-terra-004`],estimatedImpact:`Secures exclusivity · Cap rate: 7.8% · Fund hurdle: 7.2% · Non-binding LOI`,requiresApprover:`Investment Committee Chair`,mirrorEvalScore:82,status:`pending`}],p=[`All`,`Maritime`,`Legal`,`Revenue`,`Finance`,`Real Estate`,`Defense`],m=[`All`,`Critical`,`High`,`Medium`,`Low`];function h(){let[e,t]=(0,s.useState)(`All`),[n,h]=(0,s.useState)(`All`),[g,_]=(0,s.useState)(`aq-001`),[v,y]=(0,s.useState)({}),[b,x]=(0,s.useState)({}),S=f.filter(t=>(e===`All`||t.domain===e)&&(n===`All`||t.risk===n)),C=S.filter(e=>!v[e.id]).length;function w(e,t){y(n=>({...n,[e]:t}))}let T={approved:`#22c55e`,rejected:`#ef4444`,escalated:`#f97316`,deferred:`#8a8a8a`,evidence_requested:`#c9b787`};return(0,c.jsxs)(r,{children:[(0,c.jsx)(i,{label:`HUMAN APPROVAL QUEUE`,title:`Pending Action Approvals`,subtitle:`Every material action proposed by A11oy operators awaits explicit human approval here. No action executes without your decision.`,status:`LIVE`}),(0,c.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8`,children:[(0,c.jsx)(o,{label:`PENDING DECISIONS`,value:C,sub:`awaiting approval`,accent:l}),(0,c.jsx)(o,{label:`CRITICAL RISK`,value:f.filter(e=>e.risk===`Critical`).length,sub:`highest priority`,accent:`#ef4444`}),(0,c.jsx)(o,{label:`APPROVED TODAY`,value:3,sub:`actions taken`,accent:l}),(0,c.jsx)(o,{label:`AVG EVAL SCORE`,value:`92%`,sub:`MirrorEval confidence`,accent:l})]}),(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-3 mb-6`,children:[(0,c.jsxs)(`div`,{className:`flex gap-1 flex-wrap`,children:[(0,c.jsx)(`span`,{className:`text-xs self-center font-mono mr-1`,style:{color:`var(--color-a11oy-text-ghost)`},children:`Domain:`}),p.map(n=>(0,c.jsx)(`button`,{onClick:()=>t(n),className:`text-xs px-2.5 py-1 rounded font-mono`,style:{backgroundColor:e===n?`rgba(201,183,135,0.15)`:`var(--color-a11oy-muted)`,color:e===n?l:`var(--color-a11oy-text-ghost)`,border:`1px solid ${e===n?`rgba(201,183,135,0.3)`:`transparent`}`,cursor:`pointer`},children:n},n))]}),(0,c.jsxs)(`div`,{className:`flex gap-1 flex-wrap`,children:[(0,c.jsx)(`span`,{className:`text-xs self-center font-mono mr-1`,style:{color:`var(--color-a11oy-text-ghost)`},children:`Risk:`}),m.map(e=>(0,c.jsx)(`button`,{onClick:()=>h(e),className:`text-xs px-2.5 py-1 rounded font-mono`,style:{backgroundColor:n===e?`${u[e]??`rgba(201,183,135,0.15)`}22`:`var(--color-a11oy-muted)`,color:n===e?u[e]??l:`var(--color-a11oy-text-ghost)`,border:`1px solid ${n===e?(u[e]??l)+`40`:`transparent`}`,cursor:`pointer`},children:e},e))]}),(0,c.jsxs)(`span`,{className:`text-xs self-center`,style:{color:`var(--color-a11oy-text-ghost)`},children:[S.length,` actions`]})]}),(0,c.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[S.map(e=>{let t=u[e.risk]??l,n=d[e.domain]??l,r=g===e.id,i=v[e.id],o=!!i;return(0,c.jsxs)(a,{style:{borderLeft:`3px solid ${t}`,opacity:o?.65:1},children:[(0,c.jsxs)(`div`,{className:`flex items-start justify-between gap-4 cursor-pointer`,onClick:()=>_(r?null:e.id),children:[(0,c.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 mb-1 flex-wrap`,children:[(0,c.jsxs)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded`,style:{backgroundColor:`${t}18`,color:t,border:`1px solid ${t}30`},children:[e.risk,` risk`]}),(0,c.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded`,style:{backgroundColor:`${n}12`,color:n},children:e.domain}),(0,c.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--color-a11oy-text-ghost)`},children:e.urgency}),o&&(0,c.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded`,style:{backgroundColor:`${T[i]??l}18`,color:T[i]??l},children:i.replace(/_/g,` `)})]}),(0,c.jsx)(`div`,{className:`text-sm font-semibold`,style:{color:`var(--color-a11oy-text)`},children:e.title}),(0,c.jsxs)(`div`,{className:`text-xs mt-1`,style:{color:`var(--color-a11oy-text-ghost)`},children:[`Requested by `,(0,c.jsx)(`span`,{style:{color:`var(--color-a11oy-text-sub)`},children:e.agent}),` · `,e.agentRole,` · MirrorEval: `,(0,c.jsxs)(`span`,{style:{color:l},children:[e.mirrorEvalScore,`%`]})]})]}),(0,c.jsxs)(`div`,{className:`text-xs font-mono flex-shrink-0 text-right`,style:{color:`var(--color-a11oy-text-ghost)`},children:[(0,c.jsxs)(`div`,{children:[`Approver: `,(0,c.jsx)(`span`,{style:{color:`var(--color-a11oy-text-sub)`},children:e.requiresApprover})]}),(0,c.jsx)(`div`,{className:`mt-0.5`,children:new Date(e.requestedAt).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`})})]})]}),r&&(0,c.jsxs)(`div`,{className:`mt-4 space-y-4 border-t pt-4`,style:{borderColor:`var(--color-a11oy-border)`},children:[(0,c.jsxs)(`div`,{className:`grid sm:grid-cols-2 gap-4`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`div`,{className:`text-xs font-mono mb-1.5`,style:{color:`var(--color-a11oy-text-ghost)`},children:`WHY THIS ACTION`}),(0,c.jsx)(`p`,{className:`text-xs leading-relaxed`,style:{color:`var(--color-a11oy-text-sub)`},children:e.why})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`div`,{className:`text-xs font-mono mb-1.5`,style:{color:`var(--color-a11oy-text-ghost)`},children:`ESTIMATED IMPACT`}),(0,c.jsx)(`div`,{className:`text-xs p-2.5 rounded`,style:{backgroundColor:`rgba(201,183,135,0.06)`,border:`1px solid rgba(201,183,135,0.15)`,color:l},children:e.estimatedImpact})]})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`div`,{className:`text-xs font-mono mb-1.5`,style:{color:`var(--color-a11oy-text-ghost)`},children:`EVIDENCE REFERENCES`}),(0,c.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.evidence.map(e=>(0,c.jsx)(`span`,{className:`text-xs font-mono px-2 py-1 rounded`,style:{backgroundColor:`var(--color-a11oy-deep)`,border:`1px solid var(--color-a11oy-border)`,color:`var(--color-a11oy-text-ghost)`},children:e},e))})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`div`,{className:`text-xs font-mono mb-1.5`,style:{color:`var(--color-a11oy-text-ghost)`},children:`OPERATOR NOTES (OPTIONAL)`}),(0,c.jsx)(`textarea`,{value:b[e.id]??``,onChange:t=>x(n=>({...n,[e.id]:t.target.value})),placeholder:`Add context, conditions, or modifications to your decision...`,className:`w-full text-xs px-3 py-2 rounded`,rows:2,style:{backgroundColor:`var(--color-a11oy-deep)`,border:`1px solid var(--color-a11oy-border)`,color:`var(--color-a11oy-text)`,resize:`vertical`,outline:`none`}})]}),o?(0,c.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,c.jsxs)(`span`,{className:`text-xs font-mono px-3 py-1.5 rounded`,style:{backgroundColor:`${T[i]}18`,color:T[i],border:`1px solid ${T[i]}30`},children:[`Decision recorded: `,i.replace(/_/g,` `)]}),(0,c.jsx)(`button`,{onClick:()=>w(e.id,null),className:`text-xs`,style:{color:`var(--color-a11oy-text-ghost)`,background:`none`,border:`none`,cursor:`pointer`},children:`Undo`})]}):(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,c.jsx)(`button`,{onClick:()=>w(e.id,`approved`),className:`text-xs px-4 py-2 rounded font-medium`,style:{backgroundColor:`rgba(34,197,94,0.12)`,color:`#22c55e`,border:`1px solid rgba(34,197,94,0.3)`,cursor:`pointer`},children:`✓ Approve`}),(0,c.jsx)(`button`,{onClick:()=>w(e.id,`rejected`),className:`text-xs px-4 py-2 rounded font-medium`,style:{backgroundColor:`rgba(239,68,68,0.1)`,color:`#ef4444`,border:`1px solid rgba(239,68,68,0.25)`,cursor:`pointer`},children:`✕ Reject`}),(0,c.jsx)(`button`,{onClick:()=>w(e.id,`evidence_requested`),className:`text-xs px-4 py-2 rounded font-medium`,style:{backgroundColor:`rgba(201,183,135,0.1)`,color:l,border:`1px solid rgba(201,183,135,0.2)`,cursor:`pointer`},children:`⊙ Request Evidence`}),(0,c.jsx)(`button`,{onClick:()=>w(e.id,`escalated`),className:`text-xs px-4 py-2 rounded font-medium`,style:{backgroundColor:`rgba(249,115,22,0.1)`,color:`#f97316`,border:`1px solid rgba(249,115,22,0.2)`,cursor:`pointer`},children:`↑ Escalate`}),(0,c.jsx)(`button`,{onClick:()=>w(e.id,`deferred`),className:`text-xs px-4 py-2 rounded font-medium`,style:{backgroundColor:`var(--color-a11oy-muted)`,color:`var(--color-a11oy-text-ghost)`,border:`1px solid var(--color-a11oy-border)`,cursor:`pointer`},children:`⏸ Defer`})]})]})]},e.id)}),S.length===0&&(0,c.jsx)(`div`,{className:`py-16 text-center text-sm`,style:{color:`var(--color-a11oy-text-ghost)`},children:`No pending actions match the current filters.`})]}),(0,c.jsx)(`div`,{className:`mt-6 p-3 rounded-lg text-xs`,style:{backgroundColor:`rgba(201,183,135,0.04)`,border:`1px solid rgba(201,183,135,0.12)`,color:`var(--color-a11oy-text-ghost)`},children:`Approval decisions are cryptographically signed, logged to the Proof Ledger, and trigger governed execution immediately.`})]})}export{h as ApprovalQueue};