a11oy / console /assets /ActionRail-DfbX4tVc.js
betterwithage's picture
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
da2854c verified
Raw
History Blame
6.26 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,n as a,r as o,s,t as c}from"./ui-Ddu9t0Or.js";var l=e(t(),1),u=n(),d=[{id:`act-001`,op:`PORT_STANDBY`,priority:`urgent`,title:`Authorize 48h port standby for MV Cascade`,domain:`Maritime`,signal:`sig-001`,confidence:91,cost:`$14,200/day`,approver:`VP Operations`,rationale:`Cascade delay exceeds threshold. Alternative berth available at T+6h. Standby minimizes demurrage.`,counterfactual:`Without action: $58,000 estimated demurrage exposure at 120h delay.`},{id:`act-002`,op:`ESCALATE_MATTER`,priority:`high`,title:`Escalate Talbot discovery package to lead counsel`,domain:`Legal`,signal:`sig-002`,confidence:97,cost:`N/A`,approver:`General Counsel`,rationale:`3 key documents undelivered T-48h before deadline. Paralegal handoff insufficient.`,counterfactual:`Without action: potential default judgment risk, estimated $2.4M exposure.`},{id:`act-003`,op:`PIPELINE_FLAG`,priority:`medium`,title:`Flag 3 enterprise deals for VP review call`,domain:`Revenue`,signal:`sig-003`,confidence:85,cost:`N/A`,approver:`VP Revenue`,rationale:`Pipeline velocity drop is correlated with 3 stalled deals. Direct intervention has 73% success rate.`,counterfactual:`Without action: Q2 forecast miss estimated at $1.1M.`},{id:`act-004`,op:`PORTFOLIO_REVIEW`,priority:`low`,title:`Schedule Plano portfolio cap rate review`,domain:`Real Estate`,signal:`sig-004`,confidence:72,cost:`N/A`,approver:`Asset Manager`,rationale:`Cap rate compression of 18bps over 30 days warrants valuation reassessment.`,counterfactual:`Deferred review may delay Q3 rebalancing by 6-8 weeks.`}],f={urgent:`#f5f5f5`,high:`#c9b787`,medium:`#c9b787`,low:`#c9b787`};function p(){let[e,t]=(0,l.useState)({}),n=(e,n)=>t(t=>({...t,[e]:n})),p=Object.values(e).filter(e=>e===`approved`).length,m=d.length-Object.keys(e).length;return(0,u.jsxs)(r,{children:[(0,u.jsx)(i,{label:`ACTION RAIL`,title:`Recommended Actions`,subtitle:`A11oy's recommendation layer — every proposed action carries its rationale, confidence, counterfactual, and an explicit human approval gate.`,status:`LIVE`}),(0,u.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 mb-8`,children:[(0,u.jsx)(s,{label:`QUEUED ACTIONS`,value:String(m),sub:`Awaiting decision`,accent:`#c9b787`}),(0,u.jsx)(s,{label:`APPROVED TODAY`,value:String(8+p),sub:`Execution complete`,accent:`#c9b787`}),(0,u.jsx)(s,{label:`AVG CONFIDENCE`,value:`86%`,sub:`Recommendation score`,accent:`#c9b787`}),(0,u.jsx)(s,{label:`AUTO-RESOLVED`,value:`0`,sub:`Human approval required for all`,accent:`#8a8a8a`})]}),(0,u.jsx)(`div`,{className:`flex flex-col gap-4`,children:d.map(r=>{let i=e[r.id],s={approved:`#22c55e`,deferred:`#c9b787`,rejected:`#ef4444`};return(0,u.jsxs)(o,{style:{opacity:i===`rejected`?.7:1},children:[(0,u.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-3`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,u.jsx)(`span`,{className:`text-xs font-mono px-1.5 py-0.5 rounded`,style:{backgroundColor:`${f[r.priority]}20`,color:f[r.priority]},children:r.priority.toUpperCase()}),(0,u.jsx)(`span`,{className:`text-xs font-mono`,style:{color:`var(--color-a11oy-gold)`},children:r.op}),(0,u.jsx)(`span`,{className:`text-xs`,style:{color:`var(--color-a11oy-text-ghost)`},children:r.domain})]}),(0,u.jsx)(`h3`,{className:`text-sm font-semibold`,style:{color:`var(--color-a11oy-text)`},children:r.title})]}),(0,u.jsxs)(`div`,{className:`text-right flex-shrink-0`,children:[(0,u.jsxs)(`div`,{className:`text-xs font-mono`,style:{color:`#c9b787`},children:[r.confidence,`% confidence`]}),(0,u.jsxs)(`div`,{className:`text-xs mt-0.5`,style:{color:`var(--color-a11oy-text-ghost)`},children:[`via Signal `,r.signal]})]})]}),(0,u.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-3 mb-3`,children:[(0,u.jsxs)(`div`,{className:`p-3 rounded`,style:{backgroundColor:`var(--color-a11oy-deep)`,border:`1px solid var(--color-a11oy-border)`},children:[(0,u.jsx)(`div`,{className:`text-xs font-mono mb-1`,style:{color:`var(--color-a11oy-text-ghost)`},children:`RATIONALE`}),(0,u.jsx)(`div`,{className:`text-xs`,style:{color:`var(--color-a11oy-text-sub)`},children:r.rationale})]}),(0,u.jsxs)(`div`,{className:`p-3 rounded`,style:{backgroundColor:`rgba(245,245,245,0.04)`,border:`1px solid rgba(245,245,245,0.15)`},children:[(0,u.jsx)(`div`,{className:`text-xs font-mono mb-1`,style:{color:`#f5f5f5`},children:`COUNTERFACTUAL`}),(0,u.jsx)(`div`,{className:`text-xs`,style:{color:`var(--color-a11oy-text-sub)`},children:r.counterfactual})]})]}),i?(0,u.jsxs)(`div`,{className:`text-xs font-mono px-3 py-2 rounded flex items-center gap-2`,style:{backgroundColor:`${s[i]}12`,color:s[i],border:`1px solid ${s[i]}30`},children:[{approved:`✓ Approved — execution queued`,deferred:`⏸ Deferred`,rejected:`✕ Rejected`}[i],(0,u.jsx)(`button`,{onClick:()=>t(e=>{let t={...e};return delete t[r.id],t}),className:`ml-auto text-xs`,style:{color:`var(--color-a11oy-text-ghost)`,background:`none`,border:`none`,cursor:`pointer`},children:`Undo`})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a,{label:`Requires approval from: ${r.approver}`}),(0,u.jsxs)(`div`,{className:`flex gap-2 mt-2`,children:[(0,u.jsx)(c,{variant:`primary`,onClick:()=>n(r.id,`approved`),children:`Approve & Execute`}),(0,u.jsx)(c,{variant:`ghost`,onClick:()=>n(r.id,`deferred`),children:`Defer`}),(0,u.jsx)(c,{variant:`danger`,onClick:()=>n(r.id,`rejected`),children:`Reject`})]}),(0,u.jsxs)(`div`,{className:`text-xs mt-2`,style:{color:`var(--color-a11oy-text-ghost)`},children:[`No material action executes without human approval. Cost: `,r.cost]})]})]},r.id)})}),(0,u.jsxs)(`div`,{className:`mt-6 p-3 rounded-lg text-xs flex items-center gap-2`,style:{backgroundColor:`rgba(201,183,135,0.06)`,border:`1px solid rgba(201,183,135,0.15)`,color:`var(--color-a11oy-text-ghost)`},children:[(0,u.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 animate-pulse`,style:{backgroundColor:`#c9b787`}}),` Governed Environment — approval decisions are cryptographically signed and logged to the Proof Ledger.`]})]})}export{p as ActionRail};