@useorgx/openclaw-plugin 0.7.11 → 0.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -122
- package/dashboard/dist/assets/0RUEVzJa.js +1 -0
- package/dashboard/dist/assets/0RUEVzJa.js.br +0 -0
- package/dashboard/dist/assets/0RUEVzJa.js.gz +0 -0
- package/dashboard/dist/assets/3TtV4moZ.js +1 -0
- package/dashboard/dist/assets/3TtV4moZ.js.br +0 -0
- package/dashboard/dist/assets/3TtV4moZ.js.gz +0 -0
- package/dashboard/dist/assets/3VwNyxUf.js +1 -0
- package/dashboard/dist/assets/3VwNyxUf.js.br +0 -0
- package/dashboard/dist/assets/3VwNyxUf.js.gz +0 -0
- package/dashboard/dist/assets/{beHYBbh6.js → 7DhYqBrM.js} +2 -2
- package/dashboard/dist/assets/7DhYqBrM.js.br +0 -0
- package/dashboard/dist/assets/7DhYqBrM.js.gz +0 -0
- package/dashboard/dist/assets/{tcEHYcbW.js → BCudUvwg.js} +1 -1
- package/dashboard/dist/assets/BCudUvwg.js.br +0 -0
- package/dashboard/dist/assets/BCudUvwg.js.gz +0 -0
- package/dashboard/dist/assets/BV0BcV1u.js +53 -0
- package/dashboard/dist/assets/BV0BcV1u.js.br +0 -0
- package/dashboard/dist/assets/BV0BcV1u.js.gz +0 -0
- package/dashboard/dist/assets/BVvffj0x.js +1 -0
- package/dashboard/dist/assets/BVvffj0x.js.br +0 -0
- package/dashboard/dist/assets/BVvffj0x.js.gz +0 -0
- package/dashboard/dist/assets/BiOgVMED.js +1 -0
- package/dashboard/dist/assets/BiOgVMED.js.br +0 -0
- package/dashboard/dist/assets/BiOgVMED.js.gz +0 -0
- package/dashboard/dist/assets/BjK42gtU.js +1 -0
- package/dashboard/dist/assets/BjK42gtU.js.br +0 -0
- package/dashboard/dist/assets/BjK42gtU.js.gz +0 -0
- package/dashboard/dist/assets/C-MOJWHs.js +1 -0
- package/dashboard/dist/assets/C-MOJWHs.js.br +0 -0
- package/dashboard/dist/assets/C-MOJWHs.js.gz +0 -0
- package/dashboard/dist/assets/{CD-q5mdP.js → C91KLKit.js} +1 -1
- package/dashboard/dist/assets/C91KLKit.js.br +0 -0
- package/dashboard/dist/assets/C91KLKit.js.gz +0 -0
- package/dashboard/dist/assets/{AqVoI3SF.js → C9fvfXmS.js} +1 -1
- package/dashboard/dist/assets/C9fvfXmS.js.br +0 -0
- package/dashboard/dist/assets/C9fvfXmS.js.gz +0 -0
- package/dashboard/dist/assets/CFZ4Swr5.js +1 -0
- package/dashboard/dist/assets/CFZ4Swr5.js.br +0 -0
- package/dashboard/dist/assets/CFZ4Swr5.js.gz +0 -0
- package/dashboard/dist/assets/{DCP-C7fn.js → CGj8kRhg.js} +1 -1
- package/dashboard/dist/assets/CGj8kRhg.js.br +0 -0
- package/dashboard/dist/assets/CGj8kRhg.js.gz +0 -0
- package/dashboard/dist/assets/CJjEAGFN.js +1 -0
- package/dashboard/dist/assets/CJjEAGFN.js.br +0 -0
- package/dashboard/dist/assets/CJjEAGFN.js.gz +0 -0
- package/dashboard/dist/assets/CKrH5fYO.js +1 -0
- package/dashboard/dist/assets/CKrH5fYO.js.br +0 -0
- package/dashboard/dist/assets/CKrH5fYO.js.gz +0 -0
- package/dashboard/dist/assets/CMTTPXch.js +1 -0
- package/dashboard/dist/assets/CMTTPXch.js.br +0 -0
- package/dashboard/dist/assets/CMTTPXch.js.gz +0 -0
- package/dashboard/dist/assets/CSlBSRyv.js +1 -0
- package/dashboard/dist/assets/CSlBSRyv.js.br +0 -0
- package/dashboard/dist/assets/CSlBSRyv.js.gz +0 -0
- package/dashboard/dist/assets/CnPC783_.js +1 -0
- package/dashboard/dist/assets/CnPC783_.js.br +0 -0
- package/dashboard/dist/assets/CnPC783_.js.gz +0 -0
- package/dashboard/dist/assets/Ctw95IkC.js +1 -0
- package/dashboard/dist/assets/Ctw95IkC.js.br +0 -0
- package/dashboard/dist/assets/Ctw95IkC.js.gz +0 -0
- package/dashboard/dist/assets/DHz-aQPw.js +1 -0
- package/dashboard/dist/assets/DHz-aQPw.js.br +0 -0
- package/dashboard/dist/assets/DHz-aQPw.js.gz +0 -0
- package/dashboard/dist/assets/DNX2foSJ.css +1 -0
- package/dashboard/dist/assets/DNX2foSJ.css.br +0 -0
- package/dashboard/dist/assets/DNX2foSJ.css.gz +0 -0
- package/dashboard/dist/assets/Dj2k1r16.js +8 -0
- package/dashboard/dist/assets/Dj2k1r16.js.br +0 -0
- package/dashboard/dist/assets/Dj2k1r16.js.gz +0 -0
- package/dashboard/dist/assets/DxUw4FMR.js +212 -0
- package/dashboard/dist/assets/DxUw4FMR.js.br +0 -0
- package/dashboard/dist/assets/DxUw4FMR.js.gz +0 -0
- package/dashboard/dist/assets/T2NFtzAv.js +1 -0
- package/dashboard/dist/assets/T2NFtzAv.js.br +0 -0
- package/dashboard/dist/assets/T2NFtzAv.js.gz +0 -0
- package/dashboard/dist/assets/cX2e-TLi.js +1 -0
- package/dashboard/dist/assets/cX2e-TLi.js.br +0 -0
- package/dashboard/dist/assets/cX2e-TLi.js.gz +0 -0
- package/dashboard/dist/assets/eeHXe_OQ.js +9 -0
- package/dashboard/dist/assets/eeHXe_OQ.js.br +0 -0
- package/dashboard/dist/assets/eeHXe_OQ.js.gz +0 -0
- package/dashboard/dist/assets/{Du1wfrXa.js → gZr_xKlA.js} +2 -2
- package/dashboard/dist/assets/gZr_xKlA.js.br +0 -0
- package/dashboard/dist/assets/gZr_xKlA.js.gz +0 -0
- package/dashboard/dist/brand/control-tower.png +0 -0
- package/dashboard/dist/brand/design-codex.png +0 -0
- package/dashboard/dist/brand/engineering-autopilot.png +0 -0
- package/dashboard/dist/brand/launch-captain.png +0 -0
- package/dashboard/dist/brand/orgx-logo.png +0 -0
- package/dashboard/dist/brand/pipeline-intelligence.png +0 -0
- package/dashboard/dist/brand/product-orchestrator.png +0 -0
- package/dashboard/dist/brand/xandy-orchestrator.png +0 -0
- package/dashboard/dist/index.html +8 -6
- package/dashboard/dist/index.html.br +0 -0
- package/dashboard/dist/index.html.gz +0 -0
- package/dist/hash-utils.d.ts +1 -0
- package/dist/hash-utils.js +4 -0
- package/dist/http/helpers/auto-continue-engine.js +124 -67
- package/dist/http/helpers/autopilot-slice-utils.js +112 -66
- package/dist/http/helpers/hash-utils.d.ts +1 -1
- package/dist/http/helpers/hash-utils.js +1 -1
- package/dist/http/helpers/mission-control.js +5 -2
- package/dist/http/helpers/queue-constants.d.ts +37 -0
- package/dist/http/helpers/queue-constants.js +34 -0
- package/dist/http/helpers/slice-experience-v2.js +2 -5
- package/dist/http/helpers/slice-run-projections.js +2 -5
- package/dist/http/helpers/workspace-scope.js +4 -3
- package/dist/http/index.js +101 -60
- package/dist/http/routes/chat.js +1 -21
- package/dist/http/routes/live-snapshot.js +4 -23
- package/dist/http/routes/mission-control-actions.js +2 -18
- package/dist/http/routes/mission-control-read.js +4 -107
- package/dist/lib/type-coercion.d.ts +10 -0
- package/dist/lib/type-coercion.js +82 -0
- package/dist/mcp-http-handler.js +14 -2
- package/dist/openclaw.plugin.json +1 -1
- package/dist/services/experiment-randomization.js +9 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -2
- package/dashboard/dist/assets/AqVoI3SF.js.br +0 -0
- package/dashboard/dist/assets/AqVoI3SF.js.gz +0 -0
- package/dashboard/dist/assets/BC4WvnHJ.js +0 -1
- package/dashboard/dist/assets/BC4WvnHJ.js.br +0 -0
- package/dashboard/dist/assets/BC4WvnHJ.js.gz +0 -0
- package/dashboard/dist/assets/BG5mwTkg.js +0 -1
- package/dashboard/dist/assets/BG5mwTkg.js.br +0 -0
- package/dashboard/dist/assets/BG5mwTkg.js.gz +0 -0
- package/dashboard/dist/assets/BJgZIVUQ.js +0 -53
- package/dashboard/dist/assets/BJgZIVUQ.js.br +0 -0
- package/dashboard/dist/assets/BJgZIVUQ.js.gz +0 -0
- package/dashboard/dist/assets/BNh-XYPV.js +0 -1
- package/dashboard/dist/assets/BNh-XYPV.js.br +0 -0
- package/dashboard/dist/assets/BNh-XYPV.js.gz +0 -0
- package/dashboard/dist/assets/BTAEErUY.js +0 -1
- package/dashboard/dist/assets/BTAEErUY.js.br +0 -0
- package/dashboard/dist/assets/BTAEErUY.js.gz +0 -0
- package/dashboard/dist/assets/BepW_590.js +0 -1
- package/dashboard/dist/assets/BepW_590.js.br +0 -0
- package/dashboard/dist/assets/BepW_590.js.gz +0 -0
- package/dashboard/dist/assets/BerAfzjq.js +0 -1
- package/dashboard/dist/assets/BerAfzjq.js.br +0 -0
- package/dashboard/dist/assets/BerAfzjq.js.gz +0 -0
- package/dashboard/dist/assets/Bp3N-QL5.js +0 -212
- package/dashboard/dist/assets/Bp3N-QL5.js.br +0 -0
- package/dashboard/dist/assets/Bp3N-QL5.js.gz +0 -0
- package/dashboard/dist/assets/C-KIc3Wc.js +0 -1
- package/dashboard/dist/assets/C-KIc3Wc.js.br +0 -0
- package/dashboard/dist/assets/C-KIc3Wc.js.gz +0 -0
- package/dashboard/dist/assets/C3dZRz9P.css +0 -1
- package/dashboard/dist/assets/C3dZRz9P.css.br +0 -0
- package/dashboard/dist/assets/C3dZRz9P.css.gz +0 -0
- package/dashboard/dist/assets/CD-q5mdP.js.br +0 -0
- package/dashboard/dist/assets/CD-q5mdP.js.gz +0 -0
- package/dashboard/dist/assets/CL_wXqR7.js +0 -1
- package/dashboard/dist/assets/CL_wXqR7.js.br +0 -0
- package/dashboard/dist/assets/CL_wXqR7.js.gz +0 -0
- package/dashboard/dist/assets/CdvjC9G9.js +0 -1
- package/dashboard/dist/assets/CdvjC9G9.js.br +0 -0
- package/dashboard/dist/assets/CdvjC9G9.js.gz +0 -0
- package/dashboard/dist/assets/Ck2agw-s.js +0 -1
- package/dashboard/dist/assets/Ck2agw-s.js.br +0 -0
- package/dashboard/dist/assets/Ck2agw-s.js.gz +0 -0
- package/dashboard/dist/assets/CxQ08qFN.js +0 -9
- package/dashboard/dist/assets/CxQ08qFN.js.br +0 -0
- package/dashboard/dist/assets/CxQ08qFN.js.gz +0 -0
- package/dashboard/dist/assets/D2CH1H6k.js +0 -1
- package/dashboard/dist/assets/D2CH1H6k.js.br +0 -0
- package/dashboard/dist/assets/D2CH1H6k.js.gz +0 -0
- package/dashboard/dist/assets/D9esz7jd.js +0 -1
- package/dashboard/dist/assets/D9esz7jd.js.br +0 -0
- package/dashboard/dist/assets/D9esz7jd.js.gz +0 -0
- package/dashboard/dist/assets/DCP-C7fn.js.br +0 -0
- package/dashboard/dist/assets/DCP-C7fn.js.gz +0 -0
- package/dashboard/dist/assets/DJASCd69.js +0 -1
- package/dashboard/dist/assets/DJASCd69.js.br +0 -0
- package/dashboard/dist/assets/DJASCd69.js.gz +0 -0
- package/dashboard/dist/assets/Dm9AybAp.js +0 -1
- package/dashboard/dist/assets/Dm9AybAp.js.br +0 -0
- package/dashboard/dist/assets/Dm9AybAp.js.gz +0 -0
- package/dashboard/dist/assets/Du1wfrXa.js.br +0 -0
- package/dashboard/dist/assets/Du1wfrXa.js.gz +0 -0
- package/dashboard/dist/assets/beHYBbh6.js.br +0 -0
- package/dashboard/dist/assets/beHYBbh6.js.gz +0 -0
- package/dashboard/dist/assets/cNrhgGc1.js +0 -8
- package/dashboard/dist/assets/cNrhgGc1.js.br +0 -0
- package/dashboard/dist/assets/cNrhgGc1.js.gz +0 -0
- package/dashboard/dist/assets/tcEHYcbW.js.br +0 -0
- package/dashboard/dist/assets/tcEHYcbW.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as w,j as e}from"./cNrhgGc1.js";import{D as T,F as N,N as ye,P as we,B as S,O as qe,e as Z,Q as ze,R as je,r as q,S as Pe,C as Fe,M as Oe}from"./Bp3N-QL5.js";import{u as Ve}from"./AqVoI3SF.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";import"./CxQ08qFN.js";const Ge=/^[0-9a-f-]{20,}$/i,Ke=new Set(["running","active","queued","pending","in_progress","working","planning","handoff","review"]),Qe=new Set(["agent execution failed","execution failed","run failed","failed"]);function y(n){return typeof n=="string"&&n.trim().length>0}function le(n){return(n??"").trim().toLowerCase()}function Xe(n){return(n??"").trim().replace(/\s+/g," ").toLowerCase()}function He(n){return Qe.has(Xe(n))}function z(n,t=3){return n.length<=t?n.join(", "):`${n.slice(0,t).join(", ")} +${n.length-t} more`}function P(n,t){const b=[],o=m=>{if(typeof m!="string")return;const j=m.trim();j&&(b.some(B=>B.toLowerCase()===j.toLowerCase())||b.push(j))};if(Array.isArray(n))for(const m of n)o(m);return o(t??null),b}function Je(n){if(n.runId&&n.runId.trim().length>0)return n.runId.trim();const t=n.metadata;if(!t)return null;const b=["slice_run_id","sliceRunId","runId","run_id","correlation_id","correlationId","sessionId","session_id","agentRunId"];for(const o of b){const m=t[o];if(typeof m=="string"&&m.trim().length>0)return m.trim()}return null}function Ye(n){const t=le(n.status);if(t==="blocked"||t==="failed"||t==="completed"||t==="cancelled")return t;const b=le(n.phase);if(b==="blocked")return"blocked";if(b==="handoff")return"handoff";if(b==="completed")return"completed";if(b==="review")return"review";const o=le(n.state);return o==="error"?"failed":o==="stopped"?"paused":o==="stale"?"queued":Ke.has(t)?t:n.blockers.length>0?"blocked":t||"unknown"}function Ze(n,t,b){var m;const o=[((m=n.blockerDiagnostics)==null?void 0:m.reason)??null,n.blockerReason??null,...n.blockers,t==="blocked"||t==="failed"||t==="handoff"?b:null].map(j=>typeof j=="string"?j.trim():"").filter(j=>j.length>0);return o.length>0?o.find(B=>!He(B))??o[0]:t==="handoff"?"Waiting for handoff acceptance by the next agent.":t==="blocked"?"Blocked without an explicit reason from runtime.":t==="failed"?"Run failed without explicit error details.":null}function De(n){return n==="completed"?"border-lime/25 bg-lime/[0.08] text-lime":n==="needs_attention"?"border-amber-400/30 bg-amber-400/10 text-amber-200":n==="failed"?"border-red-400/30 bg-red-500/10 text-red-200":n==="in_progress"?"border-teal-400/30 bg-teal-400/10 text-teal-200":"border-strong bg-white/[0.04] text-secondary"}const dt=w.memo(function({session:t,activity:b,initiatives:o=[],sliceRuns:m=[],onOpenActivityItem:j,onContinueHighestPriority:B,onDispatchSession:F,onPauseSession:O,onResumeSession:V,onCancelSession:G,onCreateCheckpoint:K,onRollbackSession:Q,onStartInitiative:et,onStartWorkstream:tt,initialInterventionDraft:k=null,onSubmitIntervention:ie}){var he,be,ge;const[x,de]=w.useState(null),[X,C]=w.useState(null),[L,oe]=w.useState(!1),[D,W]=w.useState(""),{enqueue:ce,ToastRenderer:ve}=Ve();w.useEffect(()=>{if(!t){W("");return}if(k!=null&&k.text){W(k.text);return}W("")},[k==null?void 0:k.text,t==null?void 0:t.id]);const M=w.useMemo(()=>{var d,g,f,i,u;if(!t)return new Set;const r=new Set;return(d=t.runId)!=null&&d.trim()&&r.add(t.runId.trim()),(g=t.id)!=null&&g.trim()&&r.add(t.id.trim()),(u=(i=(f=t.blockerDiagnostics)==null?void 0:f.context)==null?void 0:i.sliceRunId)!=null&&u.trim()&&r.add(t.blockerDiagnostics.context.sliceRunId.trim()),r},[t]),A=w.useMemo(()=>t?M.size===0?[]:b.filter(r=>{const d=Je(r);return!!(d&&M.has(d))}).sort((r,d)=>Date.parse(d.timestamp)-Date.parse(r.timestamp)).slice(0,12):[],[b,t,M]),s=w.useMemo(()=>{var f,i;if(!t||!Array.isArray(m)||m.length===0)return null;const r=((f=t.initiativeId)==null?void 0:f.trim())??"",d=((i=t.workstreamId)==null?void 0:i.trim())??"",g=m.filter(u=>{var ne,fe;const I=((ne=u.sliceRunId)==null?void 0:ne.trim())??"",E=((fe=u.runId)==null?void 0:fe.trim())??"";if(I&&M.has(I)||E&&M.has(E))return!0;if(!d||!P(u.workstreamIds,u.workstreamId).includes(d))return!1;if(!r)return!0;const Y=P(u.initiativeIds,u.initiativeId);return!(Y.length>0&&!Y.includes(r))});return g.length===0?null:[...g].sort((u,I)=>{const E=Date.parse(u.updatedAt??u.lastEventAt??u.startedAt??""),ae=Date.parse(I.updatedAt??I.lastEventAt??I.startedAt??""),Y=Number.isFinite(E)?E:0;return(Number.isFinite(ae)?ae:0)-Y})[0]},[t,M,m]),ee=w.useMemo(()=>{var f;if(!t)return[];const r=[],d=t.initiativeId??t.groupId;if(d){const i=o.find(u=>u.id===d);i?r.push({label:"Initiative",value:i.name}):t.groupLabel&&t.groupLabel.trim().length>0?r.push({label:"Initiative",value:t.groupLabel}):T(d)&&r.push({label:"Initiative",value:N(d)})}if(t.workstreamId){let i=null;for(const u of o){const I=(f=u.workstreams)==null?void 0:f.find(E=>E.id===t.workstreamId);if(I){i=I.name;break}}!i&&T(t.workstreamId)?i=N(t.workstreamId):!i&&!Ge.test(t.workstreamId)&&(i=t.workstreamId),i&&r.push({label:"Workstream",value:i})}const g=t.phase??null;if(g){const i=String(g);r.push({label:"Milestone",value:T(i)?N(i):i})}return t.title&&r.push({label:"Task",value:t.title}),r},[o,t]),R=w.useMemo(()=>{var f,i;if(!t)return null;const r=((f=A[0])==null?void 0:f.summary)??((i=A[0])==null?void 0:i.description)??null,g=t.lastEventSummary??r??null;return g&&g.trim().length>0?g.trim():null},[A,t]),ue=w.useMemo(()=>{var r;return t?ye(t.agentName,t.title,t.lastEventSummary,R,(r=A[0])==null?void 0:r.metadata):ye()},[A,t,R]),_=async(r,d,g)=>{if(!(!g||x)){de(r),C(null);try{await g(),C(`${d} requested.`)}catch(f){C(f instanceof Error?f.message:`${d} failed.`)}finally{de(null)}}};if(!t)return e.jsxs(we,{className:"flex h-full min-h-0 flex-col overflow-hidden card-enter",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-subtle px-4 py-3.5",children:[e.jsx("h2",{className:"text-heading font-semibold text-white",children:"Session Detail"}),e.jsx("button",{onClick:()=>oe(r=>!r),className:"text-muted transition-colors hover:text-primary","aria-label":L?"Expand session detail":"Collapse session detail",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:S("transition-transform",L?"-rotate-90":"rotate-0"),children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx("div",{className:S("transition-all",L?"max-h-0 overflow-hidden":"min-h-0 flex-1"),children:e.jsxs("div",{className:"h-full min-h-0 space-y-2 overflow-y-auto p-4 text-body text-secondary",children:[e.jsx("p",{children:"Select a session to inspect summary, breadcrumbs, blockers, and recent messages."}),e.jsx("button",{onClick:()=>_("continue-priority","Continue highest priority",B),disabled:!B||!!x,className:"rounded-md border border-strong bg-white/[0.04] px-3 py-1.5 text-caption text-primary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:x==="continue-priority"?"Dispatching…":"Continue highest priority"}),X&&e.jsx("p",{className:"text-caption text-secondary",children:X})]})})]});const U=t.progress===null?null:Math.round(t.progress),v=Ye(t),p=A[0]??null,te=(s==null?void 0:s.blockingDecisionCount)??0,Ne=Math.max(0,((s==null?void 0:s.decisionCount)??0)-te),c=qe({sessionStatus:t.status,sessionPhase:t.phase??null,sessionState:t.state??null,sliceStatus:(s==null?void 0:s.status)??null,activityType:(p==null?void 0:p.type)??null,activityStatus:(typeof(p==null?void 0:p.state)=="string"&&p.state.trim().length>0?p.state:null)??(typeof(p==null?void 0:p.phase)=="string"&&p.phase.trim().length>0?p.phase:null)??(s==null?void 0:s.runtimeState)??null,stopReason:t.blockerReason??((he=t.blockerDiagnostics)==null?void 0:he.reason)??((s==null?void 0:s.status)==="failed"?"error":null),decisionRequired:((p==null?void 0:p.decisionRequired)??!1)||te>0,blockingDecisionCount:te,nonBlockingDecisionCount:Ne,blockerCount:t.blockers.length,blockerReason:t.blockerReason??((be=t.blockerDiagnostics)==null?void 0:be.reason)??null}),re=Ze(t,v,R),ke=v==="handoff"?"Handoff":v==="blocked"?"Blocker reason":v==="failed"?"Failure reason":"Status note",Ie=c.status==="in_progress"&&["running","active","queued","pending","working","in_progress","planning","review"].includes(v),Ce=c.status==="needs_attention"&&["paused","blocked","queued","pending"].includes(v),Ae=!["completed","archived","cancelled"].includes(v),Re=!["archived","cancelled"].includes(v),Te=c.label,Se=De(c.status),me=["running","active","working","in_progress","planning","review"].includes(v),_e=c.status!=="in_progress"&&!me,Ee=c.tone==="critical"?Z.red:c.tone==="warning"?Z.amber:c.tone==="positive"?Z.lime:Z.teal,Be=U!==null&&U>=100&&c.status!=="completed"?"Terminal state":"Progress",Le=c.tone==="critical"?"border-red-400/25 bg-red-500/10":c.tone==="warning"?"border-amber-400/25 bg-amber-500/10":c.tone==="positive"?"border-lime/22 bg-lime/[0.08]":"border-subtle bg-white/[0.02]",a=t.blockerDiagnostics??null,l=(a==null?void 0:a.context)??null,se=[y(a==null?void 0:a.source)?`Source: ${a.source.trim()}`:null,y(a==null?void 0:a.errorCode)?`Code: ${a.errorCode.trim()}`:null,y(a==null?void 0:a.errorCategory)?`Category: ${a.errorCategory.trim()}`:null,(a==null?void 0:a.retryable)===!0?"Retryable: yes":(a==null?void 0:a.retryable)===!1?"Retryable: no":null].filter(r=>!!r),h=[];l&&(Array.isArray(l.initiativeIds)&&l.initiativeIds.length>0?h.push({label:"Initiatives",value:z(l.initiativeIds.map(r=>T(r)?N(r):r),4)}):y(l.initiativeId)&&h.push({label:"Initiative",value:ze("Initiative",l.initiativeId.trim())}),y(l.workstreamTitle)?h.push({label:"Workstream",value:l.workstreamTitle.trim()}):Array.isArray(l.workstreamIds)&&l.workstreamIds.length>0?h.push({label:"Workstreams",value:z(l.workstreamIds,4)}):y(l.workstreamId)&&h.push({label:"Workstream",value:l.workstreamId.trim()}),y(l.sliceRunId)&&h.push({label:"Slice run",value:N(l.sliceRunId.trim())}),y(l.parallelMode)&&h.push({label:"Mode",value:l.parallelMode.trim().toUpperCase()}),Array.isArray(l.taskIds)&&l.taskIds.length>0&&h.push({label:"Tasks",value:z(l.taskIds.map(r=>T(r)?N(r):r))}),Array.isArray(l.milestoneIds)&&l.milestoneIds.length>0&&h.push({label:"Milestones",value:z(l.milestoneIds.map(r=>T(r)?N(r):r))}),Array.isArray(l.iwmtIds)&&l.iwmtIds.length>0?h.push({label:"Scope IDs",value:z(l.iwmtIds.map(r=>T(r)?N(r):r),4)}):y(l.iwmtId)&&h.push({label:"Scope ID",value:T(l.iwmtId.trim())?N(l.iwmtId.trim()):l.iwmtId.trim()}),y(l.logPath)&&h.push({label:"Log path",value:je(l.logPath.trim())}),y(l.outputPath)&&h.push({label:"Output path",value:je(l.outputPath.trim())}));const xe=(v==="blocked"||v==="failed")&&!!(a&&(y(a.reason)||se.length>0||h.length>0||Array.isArray(a.suggestedActions)&&a.suggestedActions.length>0)),H=y(re)?re:null,Me=H!==null&&!(R&&(H===R||R.includes(H)))&&!xe,Ue=w.useCallback(()=>{!G||!t||(C("Session will be cancelled…"),ce({message:`Cancelled "${t.title}"`,onCommit:async()=>{try{await G(t),C("Session cancelled.")}catch(r){C(r instanceof Error?r.message:"Cancel failed.")}},onUndo:()=>{C(null)}}))},[G,t,ce]),We=[{label:"Started",value:t.startedAt?q(t.startedAt):"—"},{label:"Updated",value:t.updatedAt?q(t.updatedAt):"—"},...t.eta?[{label:"ETA",value:t.eta}]:[],...t.checkpointCount?[{label:"Checkpoints",value:String(t.checkpointCount)}]:[]],pe=s?s.status.replace(/_/g," "):null,$=P(s==null?void 0:s.initiativeIds,(s==null?void 0:s.initiativeId)??null),J=P(s==null?void 0:s.workstreamIds,(s==null?void 0:s.workstreamId)??null);P(s==null?void 0:s.iwmtIds,(s==null?void 0:s.iwmtId)??null);const $e=$[0]?((ge=o.find(r=>r.id===$[0]))==null?void 0:ge.name)??$[0]:null;return e.jsxs(we,{className:"flex h-full min-h-0 flex-col overflow-hidden card-enter",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-subtle px-4 py-3.5",children:[e.jsx("h2",{className:"text-heading font-semibold text-white",children:"Session Detail"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:S("chip text-caption uppercase tracking-[0.14em]",Se),children:Te}),e.jsx("button",{onClick:()=>oe(r=>!r),className:"text-muted transition-colors hover:text-primary","aria-label":L?"Expand session detail":"Collapse session detail",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:S("transition-transform",L?"-rotate-90":"rotate-0"),children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),e.jsx("div",{className:S("transition-all",L?"max-h-0 overflow-hidden":"min-h-0 flex-1"),children:e.jsxs("div",{className:"h-full min-h-0 space-y-4 overflow-y-auto p-4",children:[e.jsxs("div",{className:"rounded-xl border border-subtle bg-white/[0.02] p-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Pe,{provider:ue.id,size:"sm"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-body font-semibold text-white",children:Fe(t.title)}),e.jsxs("p",{className:"mt-1 text-caption text-secondary",children:[t.agentName??"OrgX"," · ",ue.label]})]})]}),ee.length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"mb-1 text-micro uppercase tracking-[0.16em] text-muted",children:"Context"}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",children:ee.map((r,d)=>e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{className:"rounded-full border border-strong bg-white/[0.02] px-2 py-0.5 text-secondary",children:r.value}),d<ee.length-1&&e.jsx("span",{className:"text-caption text-muted",children:"›"})]},`${r.label}-${r.value}`))})]}),R&&e.jsxs("div",{className:"mt-3 rounded-lg border border-subtle bg-white/[0.02] px-3 py-2",children:[e.jsx("p",{className:"mb-1 text-micro uppercase tracking-[0.16em] text-muted",children:"Summary"}),e.jsx(Oe,{text:R,mode:"block"})]}),e.jsxs("div",{className:S("mt-3 rounded-lg border px-3 py-2",Le),children:[e.jsx("p",{className:"mb-1 text-micro uppercase tracking-[0.16em] text-muted",children:c.label}),e.jsx("p",{className:"text-body text-secondary",children:c.sentence}),c.nextAction&&e.jsxs("p",{className:"mt-1 text-caption text-secondary",children:["Next: ",c.nextAction]})]}),Me&&e.jsxs("div",{className:"mt-3 rounded-lg border border-subtle bg-white/[0.02] px-3 py-2",children:[e.jsx("p",{className:"mb-1 text-micro uppercase tracking-[0.16em] text-muted",children:ke}),e.jsx("p",{className:"text-body text-secondary",children:H})]}),xe&&e.jsxs("div",{className:"mt-3 rounded-lg border border-red-500/25 bg-red-500/10 px-3 py-2.5",children:[e.jsx("p",{className:"mb-1 text-micro uppercase tracking-[0.16em] text-red-200/75",children:"Why blocked"}),e.jsx("p",{className:"text-body text-red-100/90",children:(a==null?void 0:a.reason)??re??"Runtime marked this run as blocked without details."}),se.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:se.map(r=>e.jsx("span",{className:"rounded-full border border-red-300/25 bg-red-500/10 px-2 py-0.5 text-micro text-red-100/85",children:r},r))}),h.length>0&&e.jsxs("div",{className:"mt-2 rounded-md border border-red-300/20 bg-black/15 p-2.5",children:[e.jsx("p",{className:"mb-1 text-micro uppercase tracking-[0.14em] text-red-200/65",children:"Associated context"}),e.jsx("dl",{className:"grid grid-cols-1 gap-1.5 text-caption text-red-100/85",children:h.map(r=>e.jsxs("div",{className:"grid grid-cols-[86px_1fr] gap-2",children:[e.jsx("dt",{className:"text-red-200/70",children:r.label}),e.jsx("dd",{className:"break-all text-red-50/95",children:r.value})]},r.label))})]}),Array.isArray(a==null?void 0:a.suggestedActions)&&a.suggestedActions.length>0&&e.jsxs("div",{className:"mt-2",children:[e.jsx("p",{className:"mb-1 text-micro uppercase tracking-[0.14em] text-red-200/65",children:"Suggested actions"}),e.jsx("ul",{className:"space-y-1 text-caption text-red-100/85",children:a.suggestedActions.map(r=>e.jsxs("li",{children:["• ",r]},r))})]}),y(a==null?void 0:a.eventTimestamp)&&e.jsxs("p",{className:"mt-2 text-micro text-red-200/60",children:["Last blocker event: ",new Date(a.eventTimestamp).toLocaleString()," ·"," ",q(a.eventTimestamp)]})]})]}),s&&e.jsxs("div",{className:"rounded-xl border border-subtle bg-white/[0.02] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("h3",{className:"text-caption uppercase tracking-[0.12em] text-secondary",children:"Slice scope"}),pe?e.jsx("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.03] px-2 py-0.5 text-micro font-semibold uppercase tracking-[0.08em] text-secondary",children:pe}):null]}),s.statusExplainer?e.jsx("p",{className:"mt-2 text-caption text-secondary",children:s.statusExplainer}):null,e.jsxs("dl",{className:"mt-2 grid grid-cols-2 gap-2 text-caption text-secondary",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-muted",children:"Initiative"}),e.jsx("dd",{className:"text-body font-semibold text-white",children:$e??"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-muted",children:"Workstream"}),e.jsx("dd",{className:"text-body font-semibold text-white",children:s.workstreamTitle??(J[0]?N(J[0]):"—")})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-muted",children:"Run"}),e.jsx("dd",{className:"break-all text-body font-semibold text-white",children:N(s.runId??s.sliceRunId)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-muted",children:"Updated"}),e.jsx("dd",{className:"text-body font-semibold text-white",children:s.updatedAt?q(s.updatedAt):"—"})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-1.5 text-micro",children:[e.jsxs("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.03] px-2 py-0.5 text-secondary",children:["Tasks ",s.taskIds.length]}),e.jsxs("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.03] px-2 py-0.5 text-secondary",children:["Milestones ",s.milestoneIds.length]}),e.jsxs("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.03] px-2 py-0.5 text-secondary",children:["Artifacts ",s.artifactCount]}),e.jsxs("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.03] px-2 py-0.5 text-secondary",children:["Needs input ",s.blockingDecisionCount]}),$.length>1?e.jsxs("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.03] px-2 py-0.5 text-secondary",children:["+",$.length-1," initiatives"]}):null,J.length>1?e.jsxs("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.03] px-2 py-0.5 text-secondary",children:["+",J.length-1," workstreams"]}):null]}),s.taskIds.length>0?e.jsxs("p",{className:"mt-2 text-micro text-secondary",children:["Tasks: ",s.taskIds.length]}):null]}),e.jsxs("div",{className:"rounded-xl border border-subtle bg-white/[0.02] p-3",children:[U!==null&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-caption text-secondary",children:[e.jsx("span",{children:Be}),e.jsxs("span",{className:"text-primary",children:[U,"%"]})]}),e.jsx("div",{className:"h-2 rounded-full bg-white/[0.08]",children:e.jsx("div",{className:S("h-2 rounded-full transition-all duration-500",me&&"live-pulse"),style:{width:`${U}%`,background:Ee}})})]}),e.jsx("dl",{className:S("grid grid-cols-2 gap-3 text-caption text-secondary",U!==null?"mt-3":""),children:We.map(r=>e.jsxs("div",{children:[e.jsx("dt",{className:"text-muted",children:r.label}),e.jsx("dd",{className:"text-body font-semibold text-white",children:r.value})]},r.label))})]}),e.jsxs("div",{className:"rounded-xl border border-subtle bg-white/[0.02] p-3",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{onClick:()=>_("dispatch-session","Session started",()=>F==null?void 0:F(t)),disabled:!F||!!x||!_e,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-2 text-caption font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:x==="dispatch-session"?"Starting…":c.status==="completed"?"Restart":"Start"}),Ie&&e.jsx("button",{onClick:()=>_("pause-session","Session paused",()=>O==null?void 0:O(t)),disabled:!O||!!x,className:"rounded-md border border-strong bg-white/[0.02] px-3 py-2 text-caption text-secondary transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-45",children:x==="pause-session"?"Pausing…":"Pause"}),Ce&&e.jsx("button",{onClick:()=>_("resume-session","Session resumed",()=>V==null?void 0:V(t)),disabled:!V||!!x,className:"rounded-md border border-strong bg-white/[0.02] px-3 py-2 text-caption text-secondary transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-45",children:x==="resume-session"?"Resuming…":"Resume"}),e.jsx("button",{onClick:()=>_("checkpoint-session","Progress saved",()=>K==null?void 0:K(t)),disabled:!K||!!x,className:"rounded-md border border-strong bg-white/[0.02] px-3 py-2 text-caption text-secondary transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-45",children:x==="checkpoint-session"?"Saving…":"Save progress"}),Re&&e.jsx("button",{onClick:()=>_("rollback-session","Undo requested",()=>Q==null?void 0:Q(t)),disabled:!Q||!!x,className:"rounded-md border border-strong bg-white/[0.02] px-3 py-2 text-caption text-secondary transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-45",children:x==="rollback-session"?"Undoing…":"Undo last step"})]}),ie&&e.jsxs("div",{className:"mt-3 rounded-lg border border-white/[0.08] bg-black/[0.18] px-3 py-2.5",children:[e.jsx("p",{className:"mb-2 text-micro uppercase tracking-[0.16em] text-muted",children:"Intervene"}),e.jsx("textarea",{value:D,onChange:r=>W(r.target.value),placeholder:"Share guidance for this run...",className:"min-h-[84px] w-full resize-y rounded-lg border border-white/[0.10] bg-white/[0.03] px-3 py-2 text-body text-bright outline-none placeholder:text-faint focus:border-white/20"}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-micro text-secondary",children:"Visible to agents and collaborators."}),e.jsx("button",{type:"button",onClick:()=>{const r=D.trim();if(!r){C("Intervention note cannot be empty.");return}_("intervene-note","Intervention sent",async()=>{await ie({session:t,workstreamId:(k==null?void 0:k.workstreamId)??t.workstreamId??null,text:r}),W("")})},disabled:!!x||D.trim().length===0,className:"rounded-md border border-strong bg-white/[0.03] px-3 py-1.5 text-caption font-semibold text-primary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:x==="intervene-note"?"Sending…":"Send intervention"})]})]}),Ae&&G&&e.jsx("div",{className:"mt-3 border-t border-subtle pt-3",children:e.jsx("button",{onClick:Ue,disabled:!!x,className:"text-caption text-secondary transition-colors hover:text-red-300 disabled:opacity-45",children:"Cancel session…"})})]}),X&&e.jsx("p",{className:"rounded-md border border-white/[0.08] bg-white/[0.02] px-2.5 py-1.5 text-caption text-secondary",children:X}),t.blockers.length>0&&e.jsxs("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3",children:[e.jsx("h3",{className:"mb-1 text-caption uppercase tracking-[0.12em] text-red-200/70",children:"Blockers"}),e.jsx("ul",{className:"space-y-1 text-body text-red-100/90",children:t.blockers.map(r=>e.jsxs("li",{children:["• ",r]},r))})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"mb-2 text-caption uppercase tracking-[0.16em] text-secondary",children:"Recent Messages"}),A.length===0&&e.jsx("p",{className:"text-body text-secondary",children:"No recent messages for this run."}),e.jsx("div",{className:"space-y-2",children:A.map(r=>e.jsxs("article",{className:"rounded-lg border border-subtle bg-white/[0.02] px-2.5 py-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 flex-1 text-caption text-bright",children:r.title}),j&&e.jsx("button",{type:"button",onClick:()=>j(r),className:"flex-shrink-0 rounded-full border border-strong bg-white/[0.03] px-2.5 py-0.5 text-micro font-semibold text-secondary transition-colors hover:bg-white/[0.08] hover:text-primary",children:"Open"})]}),(r.summary||r.description)&&e.jsx("p",{className:"mt-0.5 line-clamp-2 text-caption text-secondary",children:r.summary??r.description}),e.jsxs("p",{className:"mt-1 text-micro text-muted",children:[new Date(r.timestamp).toLocaleString()," · ",q(r.timestamp)]})]},r.id))})]})]})}),e.jsx(ve,{})]})});export{dt as SessionInspector};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e}from"./cNrhgGc1.js";import{E as ee,e as C,y as Ie,$ as Z,r as qe,a0 as Pe,a1 as Fe,M as Le,h as De,P as Be,B as je}from"./Bp3N-QL5.js";import{E as We}from"./CD-q5mdP.js";import{A as Ee,m as ce,u as Oe}from"./CxQ08qFN.js";import{u as ze}from"./AqVoI3SF.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";const Ue={pr:"⎋",file:"◇",artifact:"▪",log:"▸",decision:"◈"};function Ke(l){return l>=.8?"#BFFF00":l>=.5?"#F5B700":"#FF6B88"}function Xe(l){const t=l.match(/https?:\/\/\S+/);return t?t[0]:null}function Je({evidenceType:l,title:t,summary:p,sourceUrl:m,confidence:f,payload:w,icon:T,label:b,onOpenTerminal:j}){const[v,B]=o.useState(!1),W=t??b??null,I=l??(T?T.toUpperCase():null),g=T?Ue[T]:null,J=T==="pr"&&b?Xe(b):null;return e.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-start gap-2.5 cursor-pointer",onClick:()=>B(h=>!h),children:[(I||g)&&e.jsxs("span",{className:"mt-0.5 flex-shrink-0 rounded bg-white/[0.06] px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-secondary",children:[g?e.jsx("span",{className:"mr-1",children:g}):null,I]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[W&&e.jsx("p",{className:"text-body font-medium text-primary",children:m?e.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-[#D8FFA1] hover:underline",onClick:h=>h.stopPropagation(),children:W}):J?e.jsx("a",{href:J,target:"_blank",rel:"noopener noreferrer",className:"text-[#D8FFA1] hover:underline",onClick:h=>h.stopPropagation(),children:W}):W}),p&&e.jsx("p",{className:`mt-0.5 text-caption text-secondary ${v?"":"line-clamp-2"}`,children:p})]}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`mt-1 flex-shrink-0 text-muted transition-transform ${v?"rotate-180":""}`,children:e.jsx("path",{d:"m6 9 6 6 6-6"})})]}),f!=null&&e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-white/[0.06]",children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.round(f*100)}%`,backgroundColor:Ke(f)}})}),e.jsxs("span",{className:"text-micro text-muted tabular-nums",children:[Math.round(f*100),"%"]})]}),e.jsx(Ee,{children:v&&e.jsx(ce.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:e.jsxs("div",{className:"mt-2 space-y-2",children:[T==="log"&&j&&e.jsxs("button",{type:"button",onClick:h=>{h.stopPropagation(),j()},className:"inline-flex items-center gap-1.5 rounded-lg border border-white/[0.12] bg-white/[0.04] px-3 py-1.5 text-caption font-semibold text-primary transition-colors hover:bg-white/[0.08]",children:[e.jsx("span",{className:"font-mono text-micro",children:">_"}),"Open in terminal"]}),w&&Object.keys(w).length>0&&e.jsx("pre",{className:"max-h-40 overflow-auto rounded-lg bg-black/40 p-2.5 text-micro text-secondary font-mono",children:JSON.stringify(w,null,2)})]})})})]})}function Ve({segments:l}){return l.length===0?null:e.jsx("nav",{className:"flex items-center gap-1.5 min-w-0 text-caption text-secondary",children:l.map((t,p)=>e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[p>0&&e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"flex-shrink-0 text-faint",children:e.jsx("path",{d:"m9 18 6-6-6-6"})}),t.icon&&e.jsx(ee,{type:t.icon,size:11,className:"flex-shrink-0 opacity-80"}),t.onClick?e.jsx("button",{type:"button",onClick:t.onClick,className:"truncate transition-colors hover:text-primary",children:t.label}):e.jsx("span",{className:"truncate",children:t.label})]},p))})}const he={label:"Retry this workstream",description:"Re-run with the same configuration. Recommended if this was a transient issue.",impliedStatus:"approved"},X={label:"Skip and continue",description:"Mark as accepted and move to the next workstream.",impliedStatus:"approved"},Ze=[{test:/Worker exited without structured output.*?code=(\S+?),\s*signal=(\S+?)\)/i,headline:"Agent work stopped unexpectedly",explain:(l,t)=>{const p=t[1]==="null"?"none":t[1],m=t[2]==="null"?"none":t[2];return`The agent process exited before producing results. Exit code: ${p}. Signal: ${m}. This usually means the worker was terminated externally or ran out of resources.`},severity:"critical",options:[he,{label:"Retry with more resources",description:"Increase token budget before re-running.",impliedStatus:"approved"},X],extractDetails:(l,t)=>({exitCode:t[1]==="null"?void 0:t[1],signal:t[2]==="null"?void 0:t[2]})},{test:/MCP handshake failed(?:\s+for\s+(\S+))?/i,headline:"Agent couldn't connect to tools",explain:(l,t)=>`The agent failed to connect to its tool server${t[1]?` (${t[1]})`:""}. This typically means the MCP server is unreachable or took too long to respond.`,severity:"critical",options:[he,{label:"Check MCP server",description:"Investigate the tool server connection before retrying.",impliedStatus:"approved"},X],extractDetails:(l,t)=>({server:t[1]||void 0})},{test:/(?:Slice|Autopilot slice) timed out after (\d+)/i,headline:"Agent ran out of time",explain:(l,t)=>{const p=Math.round(parseInt(t[1],10)/6e4);return`The agent exceeded its ${p>0?`${p}-minute`:`${t[1]}ms`} time limit. Consider breaking the work into smaller steps or increasing the time budget.`},severity:"warning",options:[{label:"Retry with more time",description:"Increase the timeout before re-running.",impliedStatus:"approved"},{label:"Break into smaller tasks",description:"Split the workstream into smaller pieces that fit the time budget.",impliedStatus:"approved"},X],extractDetails:(l,t)=>({elapsedMs:t[1]})},{test:/(?:Slice|Autopilot slice) stalled/i,headline:"Agent stopped making progress",explain:()=>"The agent stopped producing output. It may be stuck in a loop, waiting on an unresponsive resource, or unable to proceed with the current approach.",severity:"warning",options:[he,{label:"Review logs",description:"Check the session logs to understand why the agent stalled.",impliedStatus:"approved"},X]},{test:/blocked.*?(?:needs|requires?) intervention/i,headline:"Agent needs your help to continue",explain:()=>"The agent reached a point where it cannot proceed without human guidance. This may be a question about requirements, a permission needed, or an ambiguity.",severity:"warning",options:[{label:"Review blocker",description:"Look at what the agent needs and provide guidance.",impliedStatus:"approved"},{label:"Provide guidance",description:"Add a note with instructions for the agent.",impliedStatus:"approved"},X]},{test:/completed.*?(?:without|no) (?:verifiable )?(?:outcomes?|artifacts?)/i,headline:"Agent finished but produced no outputs",explain:()=>"The agent reported completion but produced no artifacts or status updates. The work may have been done informally, or the agent could not find actionable work.",severity:"info",options:[{label:"Accept as-is",description:"The work was done informally or no output was needed.",impliedStatus:"approved"},{label:"Retry with stronger output requirements",description:"Re-run and require the agent to produce structured artifacts.",impliedStatus:"approved"},X]},{test:/Spawn guard denied/i,headline:"Agent dispatch was blocked by safety check",explain:()=>"The system's safety checks prevented this agent from starting. This is typically due to capacity limits or quality gate requirements.",severity:"warning",options:[{label:"Approve exception",description:"Override the safety check and allow dispatch.",impliedStatus:"approved"},{label:"Investigate quality gate",description:"Review what safety check failed before proceeding.",impliedStatus:"approved"},X]},{test:/code=(\d+)/i,headline:"Agent encountered an error",explain:(l,t)=>`The agent process exited with error code ${t[1]}. Reviewing the session logs will show what operation failed.`,severity:"critical",options:[he,{label:"Review error logs",description:"Check session logs to understand the error before retrying.",impliedStatus:"approved"},X],extractDetails:(l,t)=>({exitCode:t[1]})}];function Ge(l){var p;const t=l.context||l.title||"";for(const m of Ze){const f=t.match(m.test);if(f)return{headline:m.headline,explanation:m.explain(t,f),structuredDetails:((p=m.extractDetails)==null?void 0:p.call(m,t,f))??{},suggestedOptions:m.options,severity:m.severity}}return l.decisionType==="autopilot_failure"?{headline:"Agent work needs attention",explanation:t||"An issue occurred during autopilot execution that requires review.",structuredDetails:{},suggestedOptions:[he,X],severity:"warning"}:{headline:l.title||"Decision needed",explanation:t||"Review the details and choose an action.",structuredDetails:{},suggestedOptions:[],severity:"info"}}function Qe(l){return l.map((t,p)=>({id:`suggested-${p}`,label:t.label,description:t.description,impliedStatus:t.impliedStatus,actionType:null,requiresNote:!1}))}function Ye(l,t){var b;if(!t||!l.workstreamId||!t.nodes.find(j=>j.id===l.workstreamId&&j.entityType==="workstream"))return null;const m=new Set(t.edges.filter(j=>j.source===l.workstreamId).map(j=>j.target)),f=[];for(const j of m){const v=t.nodes.find(B=>B.id===j);v&&f.push({id:v.id,title:v.title,taskCount:((b=v.children)==null?void 0:b.length)??0,status:v.status})}if(f.length===0)return null;const w=f.reduce((j,v)=>j+v.taskCount,0),T=f.some(j=>t.edges.some(v=>v.source===j.id));return{blockedWorkstreams:f,totalBlockedTasks:w,criticalPath:T}}function He(l){const t=l.blockedWorkstreams.length,p=l.blockedWorkstreams.map(m=>m.title);return t===1?`Resolving this unblocks 1 downstream workstream: ${p[0]}.`:t<=3?`Resolving this unblocks ${t} downstream workstreams: ${p.join(", ")}.`:`Resolving this unblocks ${t} downstream workstreams including ${p[0]} and ${p[1]}.`}const _e=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent);function et(l){try{return JSON.stringify(l,null,2)}catch{return null}}function Re(l){if(typeof l!="string")return null;const t=l.trim().toLowerCase();return t==="rejected"?"declined":t==="approved"||t==="declined"||t==="cancelled"?t:null}function ve(l,t){return!l||l.trim().length===0?t:De(l.trim())||t}function tt(l){switch(l){case"spawn_guard_blocked":return"Spawn Guard";case"autopilot_failure":return"Autopilot Failure";case"budget_exceeded":return"Budget Exceeded";case"scope_change":return"Scope Change";case"conflict_resolution":return"Conflict Resolution";case"approval_required":return"Approval Required";case"review_required":return"Review Required";case"permission_request":return"Permission Request";default:return l.replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}}function rt(l){const t=l.toLowerCase();return t==="critical"||t==="p0"?C.red:t==="high"||t==="p1"?C.amber:t==="medium"||t==="p2"?C.iris:"rgba(255,255,255,0.5)"}function st({open:l,decision:t,onClose:p,onApprove:m,onReject:f,initiativeTitle:w,workstreamTitle:T,onNavigate:b,currentIndex:j,totalCount:v,onFocusRunId:B,graph:W}){const[I,g]=o.useState("idle"),[J,h]=o.useState(null),[q,P]=o.useState(null),[A,de]=o.useState(""),[O,z]=o.useState(!1),[Ne,te]=o.useState(!1),[fe,ge]=o.useState(!1),re=o.useRef(null),R=o.useRef(),y=o.useRef(p);y.current=p,o.useEffect(()=>{if(l){g("idle"),h(null);const n=(t==null?void 0:t.selectedOptionId)??(t!=null&&t.options&&t.options.length===1?t.options[0].id:null);P(n),de(""),z(!1),te(!1),ge(!1)}return()=>{R.current&&clearTimeout(R.current)}},[l,t==null?void 0:t.id]);const D=t==null?void 0:t.metadata,se=o.useMemo(()=>{if(!D)return[];const n=D,a=n.decision_options??n.options??n.actions??null;if(!Array.isArray(a))return[];const N=[],K=new Set;for(let _=0;_<a.length;_+=1){const V=a[_];if(typeof V=="string"){const c=V.trim();if(!c)continue;const d=`option-${_+1}`;if(K.has(d))continue;K.add(d),N.push({id:d,label:c,description:null,impliedStatus:null,actionType:null,requiresNote:!1});continue}if(!V||typeof V!="object")continue;const r=V,i=typeof r.id=="string"&&r.id.trim()||typeof r.option_id=="string"&&r.option_id.trim()||typeof r.action_id=="string"&&r.action_id.trim()||`option-${_+1}`;if(K.has(i))continue;const s=typeof r.label=="string"&&r.label.trim()||typeof r.title=="string"&&r.title.trim()||typeof r.name=="string"&&r.name.trim()||typeof r.action=="string"&&r.action.trim()||null;s&&(K.add(i),N.push({id:i,label:s,description:typeof r.description=="string"?r.description:null,impliedStatus:Re(r.implied_status)??Re(r.status),actionType:typeof r.action_type=="string"&&r.action_type||typeof r.type=="string"&&r.type||null,requiresNote:r.requires_note===!0||r.requiresNote===!0||r.note_required===!0}))}return N.slice(0,12)},[D]),k=o.useMemo(()=>t?Ge(t):null,[t==null?void 0:t.context,t==null?void 0:t.title,t==null?void 0:t.decisionType]),E=o.useMemo(()=>t?Ye(t,W??null):null,[t==null?void 0:t.workstreamId,t==null?void 0:t.initiativeId,W]),G=((t==null?void 0:t.waitingMinutes)??0)>1440,u=o.useMemo(()=>t!=null&&t.options&&t.options.length>0?t.options:se.length>0?se:k&&k.suggestedOptions.length>0?Qe(k.suggestedOptions):[],[t==null?void 0:t.options,se,k]),x=o.useMemo(()=>u.find(n=>n.id===q)??null,[u,q]),$=o.useMemo(()=>{const n=((t==null?void 0:t.context)??"").trim();if(n)return n;if(!D)return"";const a=D,N=(typeof a.summary=="string"?a.summary:null)??(typeof a.description=="string"?a.description:null)??"";return String(N??"").trim()},[t==null?void 0:t.context,D]),Q=o.useMemo(()=>{const n=(t==null?void 0:t.waitingMinutes)??0;return n>=15?C.red:n>=5?C.amber:C.teal},[t==null?void 0:t.waitingMinutes]),Se=o.useCallback(async()=>{if(!t)return;const n=et({decision:t,metadata:D});if(n)try{await navigator.clipboard.writeText(n),te(!0),setTimeout(()=>te(!1),2e3)}catch{}},[t,D]),U=o.useCallback(()=>{const n=A.trim(),a=x==null?void 0:x.id;if(!(!n&&!a))return{note:n.length>0?n:void 0,optionId:a??void 0}},[A,x]),ne=o.useCallback(async()=>{if(!t||!m)return;if(u.length>0&&!x){h("Select an option before approving this decision.");return}if(x!=null&&x.requiresNote&&A.trim().length===0){h("A note is required for the selected option."),z(!0),requestAnimationFrame(()=>{var a;return(a=re.current)==null?void 0:a.focus()});return}let n=!1;if(g(a=>a==="approving"||a==="rejecting"?a:(n=!0,"approving")),!!n){h(null);try{const a=await m(t.id,U());a.failed>0?(g("error"),h(ve(a.firstError,"Approval failed. Please try again."))):(g("success"),R.current=setTimeout(()=>y.current(),800))}catch(a){g("error");const N=a instanceof Error?a.message:"";h(ve(N,"Approval failed."))}}},[U,t,A,m,u.length,x]),ue=o.useCallback(async()=>{if(!t||!f)return;if(u.length>0&&!x){h("Select an option before rejecting this decision.");return}if(x!=null&&x.requiresNote&&A.trim().length===0){h("A note is required for the selected option."),z(!0),requestAnimationFrame(()=>{var a;return(a=re.current)==null?void 0:a.focus()});return}let n=!1;if(g(a=>a==="approving"||a==="rejecting"?a:(n=!0,"rejecting")),!!n){h(null);try{const a=await f(t.id,U());a.failed>0?(g("error"),h(ve(a.firstError,"Rejection failed. Please try again."))):(g("rejected"),R.current=setTimeout(()=>y.current(),800))}catch(a){g("error");const N=a instanceof Error?a.message:"";h(ve(N,"Rejection failed."))}}},[U,t,A,f,u.length,x]);if(o.useEffect(()=>{if(!l)return;const n=a=>{var K;if((a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault(),ne();return}const N=(K=a.target)==null?void 0:K.tagName;if(!(N==="INPUT"||N==="TEXTAREA"))switch(a.key){case"j":a.preventDefault(),b==null||b(1);break;case"k":a.preventDefault(),b==null||b(-1);break;case"a":a.preventDefault(),ne();break;case"r":a.preventDefault(),ue();break;case"n":a.preventDefault(),z(_=>!_),O||requestAnimationFrame(()=>{var _;return(_=re.current)==null?void 0:_.focus()});break}};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[l,ne,ue,b,O]),!l||!t)return null;const pe=I==="approving"||I==="rejecting",be=I==="success"||I==="rejected",Y=(t.status??"pending").toLowerCase(),ie=!Y.includes("approved")&&!Y.includes("resolved")&&!Y.includes("rejected")&&!Y.includes("declined")&&!Y.includes("cancelled"),M=u.length>0&&!x,Ce=(x==null?void 0:x.requiresNote)===!0&&A.trim().length===0,H=pe||M||Ce,me=t.evidenceRefs??[],Ae=me.length>0,ye=t.recommendedAction??null,S=t.decisionType??null,ae=t.priority??null,le=t.occurrenceCount??null,F=t.sourceRunId??null,oe=[];w&&oe.push({label:w,icon:"initiative"}),T&&oe.push({label:T,icon:"workstream"});const xe=[["ID",t.id],["Type",t.decisionType],["Dedupe key",t.dedupeKey],["Source system",t.sourceSystem],["Conflict source",t.conflictSource],["Agent ID",t.agentId],["Source run",t.sourceRunId],["Source session",t.sourceSessionId],["Source stream",t.sourceStreamId]].filter(([,n])=>n!=null);if(be){const n=I==="success",a=n?C.lime:C.red;return e.jsx(Ie,{open:l,onClose:p,maxWidth:"max-w-xl",fitContent:!0,children:e.jsxs("div",{className:"flex flex-col items-center justify-center px-8 py-12",children:[e.jsx("div",{className:"mb-4 flex h-16 w-16 items-center justify-center rounded-full",style:{backgroundColor:`${a}18`,border:`1.5px solid ${a}40`},children:n?e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}):e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6L6 18"}),e.jsx("path",{d:"M6 6l12 12"})]})}),e.jsx("p",{className:"text-heading font-semibold text-white",children:n?"Approved":"Rejected"}),e.jsx("p",{className:"mt-1 text-body text-secondary",children:t.title})]})})}return e.jsx(Ie,{open:l,onClose:p,maxWidth:"max-w-xl",children:e.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col",style:G?{boxShadow:`inset 0 0 0 1px ${C.amber}30`,borderRadius:"inherit"}:void 0,children:[e.jsx("div",{className:"h-[2px] w-full flex-shrink-0",style:{background:`linear-gradient(90deg, ${Q}60, ${Q}20, transparent)`}}),b&&e.jsxs("div",{className:"flex items-center justify-between px-6 pt-3 pb-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>b(-1),className:"rounded p-1 text-muted hover:text-secondary hover:bg-white/[0.06] transition-colors",title:"Previous (k)",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"m15 18-6-6 6-6"})})}),e.jsx("button",{type:"button",onClick:()=>b(1),className:"rounded p-1 text-muted hover:text-secondary hover:bg-white/[0.06] transition-colors",title:"Next (j)",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"m9 18 6-6-6-6"})})}),j!=null&&v!=null&&e.jsxs("span",{className:"text-micro text-muted tabular-nums",children:[j+1," of ",v,e.jsx("span",{className:"ml-1 hidden sm:inline",children:"· Longest waiting first"})]})]}),e.jsx("button",{type:"button",onClick:p,"aria-label":"Close",className:"rounded p-1 text-muted hover:text-secondary hover:bg-white/[0.06] transition-colors",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),oe.length>0&&e.jsx("div",{className:"px-6 pt-2",children:e.jsx(Ve,{segments:oe})}),e.jsxs("div",{className:"flex items-start justify-between gap-3 px-6 pt-4 pb-4",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${Q}14`,border:`1px solid ${Q}30`},children:e.jsx(ee,{type:"decision",size:14})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-title font-medium leading-tight text-white mb-2",children:t.title||"Decision Required"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-body text-secondary",children:[e.jsx("span",{children:t.agentName||"OrgX Autopilot"}),e.jsx("span",{className:"text-white/[0.15]",children:"|"}),e.jsx("span",{className:G?"font-semibold text-red-300":"",children:Z(t.waitingMinutes).text}),S&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-white/[0.15]",children:"|"}),e.jsx("span",{className:"text-primary",children:tt(S)})]}),ae&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-white/[0.15]",children:"|"}),e.jsx("span",{className:"font-medium",style:{color:rt(ae)},children:ae})]})]}),le!=null&&le>1&&e.jsxs("p",{className:"mt-2 text-caption text-muted",children:["Seen ",le," times",t.firstSeenAt&&e.jsxs(e.Fragment,{children:[" · first ",qe(t.firstSeenAt)]}),t.lastSeenAt&&e.jsxs(e.Fragment,{children:[" · last ",qe(t.lastSeenAt)]})]})]})]})}),!b&&e.jsx("button",{type:"button",onClick:p,"aria-label":"Close",className:"mt-0.5 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg text-muted transition-colors hover:bg-white/[0.06] hover:text-white",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6L6 18"}),e.jsx("path",{d:"M6 6l12 12"})]})})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pb-4",children:[(t.initiativeId||t.workstreamId)&&e.jsx("div",{className:"mb-4",children:e.jsx(Pe,{nodes:Fe({initiativeId:t.initiativeId,initiativeTitle:w,workstreamId:t.workstreamId,workstreamTitle:T,agentName:t.agentName,agentId:t.agentId}),activeId:t.workstreamId,compact:!0})}),ye&&e.jsxs("div",{className:"mb-4 rounded-xl border border-cyan-300/[0.28] bg-cyan-500/[0.12] px-4 py-3",children:[e.jsx("p",{className:"text-micro font-semibold uppercase tracking-wider text-cyan-200 mb-1",children:"Recommended"}),e.jsx("p",{className:"text-body text-cyan-100",children:ye})]}),Ae&&e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"mb-2 px-1 text-micro font-semibold uppercase tracking-wider text-muted",children:"Evidence"}),e.jsx("div",{className:"space-y-1.5",children:me.map((n,a)=>e.jsx(Je,{evidenceType:n.evidenceType,title:n.title,summary:n.summary,sourceUrl:n.sourceUrl,confidence:n.confidence,payload:n.payload},a))})]}),G&&e.jsx("div",{className:"mb-4 rounded-xl border border-amber-400/[0.3] bg-amber-500/[0.08] px-4 py-3",children:e.jsxs("p",{className:"text-body text-amber-200",children:["This decision has been waiting"," ",e.jsx("span",{className:"font-semibold text-amber-100",children:Z(t.waitingMinutes).text}),". Downstream work is paused."]})}),k&&k.headline!==t.title?e.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] px-4 py-3",children:[e.jsx("p",{className:"text-micro font-semibold uppercase tracking-wider text-muted mb-2",children:"What happened"}),e.jsx("p",{className:"text-body text-primary leading-relaxed",children:k.explanation}),Object.keys(k.structuredDetails).length>0&&e.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1 text-caption text-secondary",children:Object.entries(k.structuredDetails).filter(([,n])=>n!=null).map(([n,a])=>e.jsxs("span",{children:[n.replace(/([A-Z])/g," $1").replace(/^./,N=>N.toUpperCase()),": ",a]},n))})]}):$?e.jsx("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] px-4 py-3",children:e.jsx(Le,{text:$,mode:"block"})}):e.jsx("p",{className:"px-1 text-body text-muted italic",children:"No additional context provided."}),u.length>0&&e.jsxs("div",{className:"mt-8",children:[e.jsx("p",{className:"mb-3 px-1 text-[11px] font-semibold uppercase tracking-widest text-muted",children:"Options"}),e.jsx("div",{className:"space-y-1 relative",children:u.map(n=>{const a=q===n.id;return e.jsxs("button",{type:"button",onClick:()=>{P(a?null:n.id),n.requiresNote&&z(!0)},disabled:pe,className:"group relative flex w-full items-start gap-4 px-4 py-4 text-left focus:outline-none",children:[a&&e.jsx(ce.div,{layoutId:"decision-option-bg",className:"absolute inset-0 rounded-xl",style:{backgroundColor:`${C.lime}12`},transition:{type:"spring",stiffness:400,damping:25}}),!a&&e.jsx("div",{className:"absolute inset-0 rounded-xl opacity-0 transition-opacity group-hover:bg-white/[0.03]"}),e.jsx("div",{className:"relative mt-0.5 flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full border-[1.5px] transition-colors",style:{borderColor:a?C.lime:"rgba(255,255,255,0.2)"},children:e.jsx(Ee,{children:a&&e.jsx(ce.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{type:"spring",stiffness:500,damping:30},className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:C.lime}})})}),e.jsxs("div",{className:"relative min-w-0 flex-1",children:[e.jsx("span",{className:`block text-[15px] ${a?"font-medium text-white":"text-primary"}`,children:n.label}),n.description&&e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-secondary",children:n.description}),n.requiresNote&&e.jsx("p",{className:"mt-1.5 text-[11px] font-medium uppercase tracking-wider text-amber-400",children:"Note required"})]})]},n.id)})})]}),ie&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("button",{type:"button",onClick:()=>{z(n=>!n),O||requestAnimationFrame(()=>{var n;return(n=re.current)==null?void 0:n.focus()})},className:"flex w-full items-center gap-2 px-1 text-caption text-secondary transition-colors hover:text-white",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"transition-transform",style:{transform:O?"rotate(90deg)":"rotate(0deg)"},children:e.jsx("polyline",{points:"9 18 15 12 9 6"})}),x!=null&&x.requiresNote?"Add required note":"Add a note"]}),O&&e.jsxs("div",{className:"mt-2",children:[e.jsx("textarea",{ref:re,value:A,onChange:n=>de(n.target.value),disabled:pe,placeholder:"Optional context for this decision...",rows:3,className:"w-full resize-none rounded-xl border border-white/[0.08] bg-white/[0.03] px-4 py-3 text-body text-primary placeholder-white/30 outline-none transition-colors focus:border-white/[0.16] focus:bg-white/[0.04]"}),(x==null?void 0:x.requiresNote)&&A.trim().length===0&&e.jsx("p",{className:"mt-2 text-caption text-amber-300",children:"This option requires a note before submission."})]})]}),E&&e.jsxs("div",{className:"mt-6 rounded-xl border border-white/[0.06] bg-white/[0.02] px-4 py-3",children:[e.jsx("p",{className:"text-micro font-semibold uppercase tracking-wider text-muted mb-2",children:"Impact"}),e.jsx("p",{className:"text-body text-primary leading-relaxed",children:He(E)}),E.blockedWorkstreams.length>0&&e.jsx("ul",{className:"mt-2 space-y-1 text-caption text-secondary",children:E.blockedWorkstreams.map(n=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-block h-1 w-1 rounded-full bg-amber-400 flex-shrink-0"}),n.title,n.status==="blocked"&&e.jsx("span",{className:"text-amber-400 text-micro",children:"(blocked)"})]},n.id))})]}),F&&B&&e.jsx("div",{className:"mt-4",children:e.jsxs("button",{type:"button",onClick:()=>B(F),className:"inline-flex items-center gap-1.5 text-caption text-[#D8FFA1] transition-colors hover:text-white",children:[e.jsx(ee,{type:"session",size:12}),"View source run"]})}),e.jsx("div",{className:"mt-4 border-t border-white/[0.06] pt-4",children:e.jsx(We,{entityType:"decision",entityId:t.id})}),xe.length>0&&e.jsxs("div",{className:"mt-4 border-t border-white/[0.06] pt-2",children:[e.jsxs("button",{type:"button",onClick:()=>ge(n=>!n),className:"flex w-full items-center justify-between text-micro font-semibold uppercase tracking-wider text-muted hover:text-secondary transition-colors",children:[e.jsx("span",{children:"Technical details"}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`transition-transform ${fe?"rotate-180":""}`,children:e.jsx("path",{d:"m6 9 6 6 6-6"})})]}),fe&&e.jsx("div",{className:"mt-2 space-y-0.5",children:xe.map(([n,a])=>e.jsxs("div",{className:"flex gap-2 text-micro",children:[e.jsx("span",{className:"text-muted w-28 flex-shrink-0",children:n}),e.jsx("span",{className:"text-secondary truncate",children:a})]},n))})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-x-3 gap-y-1 text-micro text-muted opacity-60",children:[b&&e.jsx("span",{children:"j/k nav"}),e.jsx("span",{children:"a approve"}),e.jsx("span",{children:"r reject"}),e.jsx("span",{children:"n note"}),e.jsxs("span",{children:[_e?"⌘":"Ctrl","+Enter approve"]}),e.jsx("span",{children:"esc close"})]})]}),J&&e.jsxs("div",{className:"flex items-center gap-2 border-t border-white/[0.06] px-6 py-3",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:C.red,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),e.jsx("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]}),e.jsx("p",{className:"text-caption text-red-300",children:J})]}),ie&&e.jsx("div",{className:"relative mt-auto border-t border-white/[0.04] bg-black/60 px-6 py-5 backdrop-blur-xl",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[f&&e.jsx(ce.button,{whileTap:{scale:.97},type:"button",onClick:ue,disabled:H,className:"rounded-lg px-4 py-2 text-[14px] font-medium text-secondary transition-colors hover:text-red-400 disabled:opacity-40 focus:outline-none",children:I==="rejecting"?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-block h-3 w-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent"}),"Rejecting"]}):"Reject"}),e.jsx("button",{type:"button",onClick:Se,className:"rounded-lg px-2 py-2 text-[13px] text-muted transition-colors hover:text-secondary focus:outline-none",title:"Copy decision as JSON",children:Ne?"Copied":"Copy JSON"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"hidden text-[13px] text-muted sm:block",children:[_e?"⌘":"Ctrl","+Enter"]}),e.jsx(ce.button,{whileTap:!m||H?void 0:{scale:.97},type:"button",onClick:ne,disabled:!m||H,"data-modal-autofocus":"true",className:"rounded-lg px-6 py-2.5 text-[14px] font-semibold transition-all focus:outline-none",style:{backgroundColor:!m||H?"rgba(255,255,255,0.06)":C.lime,color:!m||H?"rgba(255,255,255,0.4)":"#000"},children:I==="approving"?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-block h-3 w-3 animate-spin rounded-full border-[1.5px] border-black/40 border-t-black"}),"Approving"]}):"Approve"})]})]})})]})})}const Me=40;function ke(l,t){return!l||l.trim().length===0?t:De(l.trim())||t}function Te(l,t,p){const m=l==="approve"?`Approval failed for ${t} decision${t===1?"":"s"}.`:`Rejection failed for ${t} decision${t===1?"":"s"}.`;return ke(p,m)}function nt(l,t){return`${l}_${t}`}const pt=o.memo(function({decisions:t,focusDecisionId:p=null,onFocusDecisionHandled:m,onApproveDecision:f,onRejectDecision:w,onApproveAll:T,onBulkDecisionAction:b,mutationState:j,showHeader:v=!0,panelStyle:B="card",className:W}){var V;const I=Oe(),[g,J]=o.useState(!1),[h,q]=o.useState(new Set),[P,A]=o.useState(new Set),[de,O]=o.useState(new Set),{enqueue:z,ToastRenderer:Ne}=ze(),[te,fe]=o.useState("approve_selected"),[ge,re]=o.useState(""),[R,y]=o.useState(null),[D,se]=o.useState(Me),[k,E]=o.useState(null),G=o.useRef(null),u=o.useMemo(()=>{const r=new Set;return[...t].filter(i=>r.has(i.id)?!1:(r.add(i.id),!0)).sort((i,s)=>{if(i.waitingMinutes!==s.waitingMinutes)return s.waitingMinutes-i.waitingMinutes;const c=Date.parse(i.requestedAt??i.updatedAt??""),d=Date.parse(s.requestedAt??s.updatedAt??""),L=Number.isFinite(c)?c:0;return(Number.isFinite(d)?d:0)-L})},[t]);o.useEffect(()=>{A(r=>{const i=new Set(u.map(c=>c.id)),s=new Set;for(const c of r)i.has(c)&&s.add(c);return s})},[u]);const x=P.size,$=o.useMemo(()=>u.filter(r=>!de.has(r.id)).slice(0,D),[u,D,de]),Q=o.useMemo(()=>{if($.length===0)return!1;for(const r of $)if(!P.has(r.id))return!1;return!0},[P,$]),Se=o.useMemo(()=>k?u.find(r=>r.id===k)??null:null,[k,u]),U=o.useMemo(()=>k?u.findIndex(r=>r.id===k):-1,[k,u]),ne=o.useCallback(r=>{const i=U+r;i>=0&&i<u.length&&E(u[i].id)},[U,u]),ue=async(r,i)=>{y(null),q(c=>{const d=new Set(c);return d.add(r),d});const s=await f(r,i);return s.failed>0?y(Te("approve",s.failed,s.firstError)):s.updated>0&&y("Decision approved. Changes synced."),q(c=>{const d=new Set(c);return d.delete(r),d}),s},pe=w?async(r,i)=>{y(null),q(c=>{const d=new Set(c);return d.add(r),d});const s=await w(r,i);return s.failed>0?y(Te("reject",s.failed,s.firstError)):s.updated>0&&y("Decision rejected. Changes synced."),q(c=>{const d=new Set(c);return d.delete(r),d}),s}:void 0;o.useEffect(()=>{se(r=>u.length===0?0:Math.min(Math.max(Me,r),u.length))},[u.length]),o.useEffect(()=>{const r=(p??"").trim();if(!r){G.current=null;return}G.current===r||!u.some(s=>s.id===r)||(G.current=r,E(r),m==null||m(r))},[p,m,u]);const be=r=>{A(i=>{const s=new Set(i);return s.has(r)?s.delete(r):s.add(r),s})},Y=()=>{A(r=>{if($.length===0)return r;const i=new Set(r),s=Q;for(const c of $)s?i.delete(c.id):i.add(c.id);return i})},ie=o.useMemo(()=>{const r=u.map(s=>s.id).filter(s=>P.has(s)),i=$.map(s=>s.id);return[{id:"approve_selected",label:`Approve selected (${r.length})`,action:"approve",ids:r},{id:"reject_selected",label:`Reject selected (${r.length})`,action:"reject",ids:r,hidden:!w},{id:"approve_visible",label:`Approve visible (${i.length})`,action:"approve",ids:i},{id:"reject_visible",label:`Reject visible (${i.length})`,action:"reject",ids:i,hidden:!w}].filter(s=>!s.hidden)},[w,P,u,$]),M=o.useMemo(()=>ie.find(r=>r.id===te)??ie[0]??null,[te,ie]),Ce=async(r,i,s)=>{if(r.length===0)return{updated:0,failed:0};if(i==="approve"&&r.length===u.length&&!s)return T();let c=0,d=0,L;for(const $e of r)try{const we=i==="approve"?await f($e,s?{note:s}:void 0):w?await w($e,s?{note:s}:void 0):{updated:0,failed:1};c+=we.updated,d+=we.failed,!L&&we.firstError&&(L=we.firstError)}catch{d+=1}return{updated:c,failed:d,firstError:L}},H=async()=>{if(!M||g)return;const r=M.ids;if(r.length===0){y("No decisions selected for this action.");return}y(null),J(!0),q(new Set(r));const i=ge.trim();try{const s=b?await b(r,M.action,i.length>0?i:void 0):await Ce(r,M.action,i.length>0?i:void 0),c=M.action==="approve"?"Approved":"Rejected";if(s.failed>0){const d=`${c} ${s.updated}; ${s.failed} failed.`,L=ke(s.firstError,d);y(L===d?d:`${d} ${L}`)}else s.updated>0?y(`${c} ${s.updated} decision${s.updated===1?"":"s"}.`):y("No decisions were updated.");A(new Set)}catch(s){const c=s instanceof Error?s.message:"";y(ke(c,"Bulk decision action failed."))}finally{J(!1),q(new Set)}},me=async r=>{if(!(h.has(r)||g)){y(null),q(i=>{const s=new Set(i);return s.add(r),s});try{const i=await f(r);i.failed>0?y(Te("approve",i.failed,i.firstError)):i.updated>0&&y("Decision approved.")}catch(i){const s=i instanceof Error?i.message:"";y(ke(s,"Decision approval failed."))}finally{q(i=>{const s=new Set(i);return s.delete(r),s}),A(i=>{if(!i.has(r))return i;const s=new Set(i);return s.delete(r),s})}}},Ae=o.useCallback(r=>{h.has(r.id)||g||(O(i=>new Set(i).add(r.id)),z({message:`Approved '${r.title.length>40?r.title.slice(0,40)+"…":r.title}'`,onUndo:()=>{O(i=>{const s=new Set(i);return s.delete(r.id),s})},onCommit:()=>{O(i=>{const s=new Set(i);return s.delete(r.id),s}),f(r.id).catch(()=>{y("Approval failed. Try again from the decision panel.")})}}))},[h,g,z,f]);o.useEffect(()=>{if(!R)return;const r=window.setTimeout(()=>y(null),5200);return()=>window.clearTimeout(r)},[R]);const ye=R!==null&&!R.toLowerCase().includes("fail"),S=g||h.size>0,ae=Math.max(h.size,g?x:0),le=S?`Applying ${ae} decision action${ae===1?"":"s"}…`:R??null,F=S?"processing":R?ye?"success":"warning":"idle",oe=!I&&$.length<=32,xe=M!==null&&M.ids.length>0&&!g,n=u.length;(V=u[0])==null||V.waitingMinutes;const a=M!=null&&M.id.includes("visible")?"visible":"selected",N=(M==null?void 0:M.action)??"approve",K=le!==null||F!=="idle",_=B==="card"?Be:"div";return e.jsxs(_,{className:je("flex h-full min-h-0 flex-col",B==="card"&&"card-enter",W),children:[e.jsx(st,{open:k!==null,decision:Se,onClose:()=>E(null),onApprove:ue,onReject:pe,onNavigate:ne,currentIndex:U>=0?U:void 0,totalCount:u.length}),v?e.jsxs("div",{className:"space-y-2.5 border-b border-subtle px-4 py-3.5",children:[e.jsx("div",{className:"flex items-start justify-between gap-3",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"inline-flex items-center gap-2 text-heading font-semibold text-white",children:[e.jsx(ee,{type:"decision",size:14}),"Decisions"]}),e.jsx("p",{className:"mt-0.5 text-caption text-secondary",children:n>0?`${n} decision${n===1?"":"s"} need${n===1?"s":""} your input`:"All clear — no decisions pending"})]})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.length>0&&e.jsx("button",{onClick:Y,disabled:S,className:"control-pill h-8 flex-shrink-0 px-3 text-caption font-semibold disabled:opacity-45",children:Q?"Clear all":"Select all"}),x>0&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:H,disabled:!xe||S,"data-state":xe?"active":"idle",className:"control-pill h-8 flex-shrink-0 px-3 text-caption font-semibold disabled:opacity-45",children:g?"Approving…":`Approve ${x} selected`}),w&&e.jsx("button",{type:"button",onClick:()=>fe(nt("reject",a)),disabled:S,"data-state":N==="reject"?"active":"idle",className:je("control-pill h-8 px-2.5 text-caption font-semibold disabled:opacity-45",N==="reject"&&"border-amber-300/35 bg-amber-400/[0.12] text-amber-100"),children:"Reject"})]})]}),K?e.jsxs("div",{"aria-live":"polite",className:je("flex min-h-[32px] items-center gap-2 rounded-lg border px-2.5 py-1.5 text-caption transition-colors",F==="processing"?"border-amber-300/25 bg-amber-400/[0.08] text-amber-100":F==="success"?"border-lime/30 bg-lime/10 text-lime":F==="warning"?"border-red-400/25 bg-red-500/[0.08] text-red-100":"border-strong bg-white/[0.02] text-secondary"),children:[F==="processing"?e.jsx("span",{"aria-hidden":!0,className:"h-3.5 w-3.5 rounded-full border-2 border-amber-200/45 border-t-transparent animate-spin"}):F==="success"?e.jsx(ee,{type:"decision",size:12,className:"opacity-90"}):F==="warning"?e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-90",children:[e.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),e.jsx("line",{x1:"12",x2:"12",y1:"9",y2:"13"}),e.jsx("line",{x1:"12",x2:"12.01",y1:"17",y2:"17"})]}):e.jsx("span",{"aria-hidden":!0,className:"h-1.5 w-1.5 rounded-full bg-white/35"}),e.jsx("span",{className:"min-w-0 truncate",children:le})]}):null]}):null,e.jsxs("div",{className:je("min-h-0 flex-1 space-y-2 overflow-y-auto",v?"p-3":"p-0"),children:[u.length===0&&e.jsx("div",{className:"flex flex-col items-center gap-2.5 rounded-xl border border-subtle bg-white/[0.02] p-4 text-center",children:S?e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,className:"h-5 w-5 rounded-full border-2 border-amber-200/45 border-t-transparent animate-spin"}),e.jsx("p",{className:"text-body text-secondary",children:"Finalizing decision updates…"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-faint",children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),e.jsx("p",{className:"text-body text-secondary",children:"No pending decisions. All clear."})]})}),oe?e.jsx(Ee,{mode:"popLayout",children:$.map((r,i)=>{const s=h.has(r.id),c=P.has(r.id);return e.jsx(ce.article,{role:"button",tabIndex:0,onClick:()=>E(r.id),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),E(r.id))},drag:!S&&!s?"x":!1,dragConstraints:{left:0,right:0},dragElastic:.3,onDragEnd:(d,L)=>{L.offset.x>120&&Ae(r)},initial:g?{opacity:0,x:300}:{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,x:0,scale:1},exit:{opacity:0,x:300,scale:.95},transition:{duration:.25,ease:[.22,1,.36,1],...g?{delay:i*.04}:{}},layout:!0,className:"rounded-xl border bg-white/[0.03] px-3 py-2.5 transition-[border-color,box-shadow] cv-auto",style:{borderColor:c?`${C.lime}50`:"rgba(255, 255, 255, 0.1)",boxShadow:c?"0 0 0 1px rgba(191, 255, 0, 0.14)":"none"},children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("input",{type:"checkbox",checked:c,onChange:()=>be(r.id),disabled:s||S,onClick:d=>d.stopPropagation(),className:"mt-0.5 h-4 w-4 rounded border-white/20 bg-black/40 text-lime focus:ring-lime/40"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"flex min-w-0 items-start gap-1.5 text-body font-medium text-white",title:r.title,children:[e.jsx(ee,{type:"decision",size:12,className:"mt-[3px] flex-shrink-0 opacity-90"}),e.jsx("span",{className:"line-clamp-2",children:r.title})]}),r.context&&e.jsx("p",{className:"mt-1 line-clamp-2 text-caption text-secondary",title:r.context,children:r.context}),e.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[e.jsxs("p",{className:`min-w-0 truncate text-micro ${(()=>{const d=Z(r.waitingMinutes);return d.tone==="urgent"?"text-red-400":d.tone==="attention"?"text-amber-400":"text-muted"})()}`,title:`${r.agentName??"OrgX Autopilot"} · ${Z(r.waitingMinutes).text}`,children:[r.agentName??"OrgX Autopilot"," · ",Z(r.waitingMinutes).text]}),e.jsx("button",{onClick:d=>{d.stopPropagation(),me(r.id)},disabled:s||S,className:"flex-shrink-0 rounded-md border border-lime/25 bg-lime/10 px-2.5 py-1 text-micro font-semibold text-lime transition-colors hover:bg-lime/20 disabled:cursor-not-allowed disabled:border-white/10 disabled:bg-white/[0.08] disabled:text-secondary",children:s?"Approving…":"Approve"}),w&&e.jsx("button",{onClick:d=>{d.stopPropagation(),E(r.id)},disabled:s||S,className:"flex-shrink-0 rounded-md border border-white/[0.08] bg-white/[0.03] px-2.5 py-1 text-micro font-semibold text-secondary transition-colors hover:border-red-400/30 hover:bg-red-400/[0.08] hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-40",children:"Reject"})]})]})})]})},r.id)})}):e.jsx(e.Fragment,{children:$.map(r=>{const i=h.has(r.id),s=P.has(r.id);return e.jsx("article",{role:"button",tabIndex:0,onClick:()=>E(r.id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),E(r.id))},className:"rounded-xl border bg-white/[0.03] px-3 py-2.5 transition-[border-color,box-shadow] cv-auto",style:{borderColor:s?`${C.lime}50`:"rgba(255, 255, 255, 0.1)",boxShadow:s?"0 0 0 1px rgba(191, 255, 0, 0.14)":"none"},children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("input",{type:"checkbox",checked:s,onChange:()=>be(r.id),disabled:i||S,onClick:c=>c.stopPropagation(),className:"mt-0.5 h-4 w-4 rounded border-white/20 bg-black/40 text-lime focus:ring-lime/40"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"flex min-w-0 items-start gap-1.5 text-body font-medium text-white",title:r.title,children:[e.jsx(ee,{type:"decision",size:12,className:"mt-[3px] flex-shrink-0 opacity-90"}),e.jsx("span",{className:"line-clamp-2",children:r.title})]}),r.context&&e.jsx("p",{className:"mt-1 line-clamp-2 text-caption text-secondary",title:r.context,children:r.context}),e.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[e.jsxs("p",{className:`min-w-0 truncate text-micro ${(()=>{const c=Z(r.waitingMinutes);return c.tone==="urgent"?"text-red-400":c.tone==="attention"?"text-amber-400":"text-muted"})()}`,title:`${r.agentName??"OrgX Autopilot"} · ${Z(r.waitingMinutes).text}`,children:[r.agentName??"OrgX Autopilot"," · ",Z(r.waitingMinutes).text]}),e.jsx("button",{onClick:c=>{c.stopPropagation(),me(r.id)},disabled:i||S,className:"flex-shrink-0 rounded-md border border-lime/25 bg-lime/10 px-2.5 py-1 text-micro font-semibold text-lime transition-colors hover:bg-lime/20 disabled:cursor-not-allowed disabled:border-white/10 disabled:bg-white/[0.08] disabled:text-secondary",children:i?"Approving…":"Approve"}),w&&e.jsx("button",{onClick:c=>{c.stopPropagation(),E(r.id)},disabled:i||S,className:"flex-shrink-0 rounded-md border border-white/[0.08] bg-white/[0.03] px-2.5 py-1 text-micro font-semibold text-secondary transition-colors hover:border-red-400/30 hover:bg-red-400/[0.08] hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-40",children:"Reject"})]})]})})]})},r.id)})}),$.length<u.length&&e.jsxs("button",{onClick:()=>se(r=>Math.min(u.length,r+Me)),className:"w-full rounded-xl border border-white/[0.08] bg-white/[0.02] px-3 py-2 text-caption text-secondary transition-colors hover:bg-white/[0.05]",children:["Load more (",u.length-$.length," remaining)"]})]}),e.jsx(Ne,{})]})});export{pt as DecisionQueue};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|