@useorgx/openclaw-plugin 0.4.9 → 0.7.0
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 +35 -0
- package/dashboard/dist/assets/BJgZIVUQ.js +53 -0
- package/dashboard/dist/assets/BJgZIVUQ.js.br +0 -0
- package/dashboard/dist/assets/BJgZIVUQ.js.gz +0 -0
- package/dashboard/dist/assets/BXWDRGm-.js +1 -0
- package/dashboard/dist/assets/BXWDRGm-.js.br +0 -0
- package/dashboard/dist/assets/BXWDRGm-.js.gz +0 -0
- package/dashboard/dist/assets/BgOYB78t.js +4 -0
- package/dashboard/dist/assets/BgOYB78t.js.br +0 -0
- package/dashboard/dist/assets/BgOYB78t.js.gz +0 -0
- package/dashboard/dist/assets/C-KIc3Wc.js.br +0 -0
- package/dashboard/dist/assets/C-KIc3Wc.js.gz +0 -0
- package/dashboard/dist/assets/CE38zU4U.js +1 -0
- package/dashboard/dist/assets/CE38zU4U.js.br +0 -0
- package/dashboard/dist/assets/CE38zU4U.js.gz +0 -0
- package/dashboard/dist/assets/CFGKRAzG.js +1 -0
- package/dashboard/dist/assets/CFGKRAzG.js.br +0 -0
- package/dashboard/dist/assets/CFGKRAzG.js.gz +0 -0
- package/dashboard/dist/assets/CGGR2GZh.js +1 -0
- package/dashboard/dist/assets/CGGR2GZh.js.br +0 -0
- package/dashboard/dist/assets/CGGR2GZh.js.gz +0 -0
- package/dashboard/dist/assets/CL_wXqR7.js +1 -0
- package/dashboard/dist/assets/CL_wXqR7.js.br +0 -0
- package/dashboard/dist/assets/CL_wXqR7.js.gz +0 -0
- package/dashboard/dist/assets/CPFiTmlw.js +8 -0
- package/dashboard/dist/assets/CPFiTmlw.js.br +0 -0
- package/dashboard/dist/assets/CPFiTmlw.js.gz +0 -0
- package/dashboard/dist/assets/CZZTvkQZ.js +1 -0
- package/dashboard/dist/assets/CZZTvkQZ.js.br +0 -0
- package/dashboard/dist/assets/CZZTvkQZ.js.gz +0 -0
- package/dashboard/dist/assets/{CpJsfbXo.js → CxQ08qFN.js} +2 -2
- package/dashboard/dist/assets/CxQ08qFN.js.br +0 -0
- package/dashboard/dist/assets/CxQ08qFN.js.gz +0 -0
- package/dashboard/dist/assets/D-bf6hEI.js +213 -0
- package/dashboard/dist/assets/D-bf6hEI.js.br +0 -0
- package/dashboard/dist/assets/D-bf6hEI.js.gz +0 -0
- package/dashboard/dist/assets/DG6y9wJI.js +2 -0
- package/dashboard/dist/assets/DG6y9wJI.js.br +0 -0
- package/dashboard/dist/assets/DG6y9wJI.js.gz +0 -0
- package/dashboard/dist/assets/DNxKz-GV.js +1 -0
- package/dashboard/dist/assets/DNxKz-GV.js.br +0 -0
- package/dashboard/dist/assets/DNxKz-GV.js.gz +0 -0
- package/dashboard/dist/assets/DW_rKUic.js +11 -0
- package/dashboard/dist/assets/DW_rKUic.js.br +0 -0
- package/dashboard/dist/assets/DW_rKUic.js.gz +0 -0
- package/dashboard/dist/assets/DbNoijHm.js +1 -0
- package/dashboard/dist/assets/DbNoijHm.js.br +0 -0
- package/dashboard/dist/assets/DbNoijHm.js.gz +0 -0
- package/dashboard/dist/assets/DjcdE6jC.js +2 -0
- package/dashboard/dist/assets/DjcdE6jC.js.br +0 -0
- package/dashboard/dist/assets/DjcdE6jC.js.gz +0 -0
- package/dashboard/dist/assets/FZYuCDnt.js +1 -0
- package/dashboard/dist/assets/FZYuCDnt.js.br +0 -0
- package/dashboard/dist/assets/FZYuCDnt.js.gz +0 -0
- package/dashboard/dist/assets/PAUiij_z.js +1 -0
- package/dashboard/dist/assets/PAUiij_z.js.br +0 -0
- package/dashboard/dist/assets/PAUiij_z.js.gz +0 -0
- package/dashboard/dist/assets/cNrhgGc1.js +8 -0
- package/dashboard/dist/assets/cNrhgGc1.js.br +0 -0
- package/dashboard/dist/assets/cNrhgGc1.js.gz +0 -0
- package/dashboard/dist/assets/h5biQs2I.css +1 -0
- package/dashboard/dist/assets/h5biQs2I.css.br +0 -0
- package/dashboard/dist/assets/h5biQs2I.css.gz +0 -0
- package/dashboard/dist/assets/ic2FaMnh.js +1 -0
- package/dashboard/dist/assets/ic2FaMnh.js.br +0 -0
- package/dashboard/dist/assets/ic2FaMnh.js.gz +0 -0
- package/dashboard/dist/assets/nByHNHoW.js +1 -0
- package/dashboard/dist/assets/nByHNHoW.js.br +0 -0
- package/dashboard/dist/assets/nByHNHoW.js.gz +0 -0
- package/dashboard/dist/assets/qm8xLgv-.css +1 -0
- package/dashboard/dist/assets/qm8xLgv-.css.br +0 -0
- package/dashboard/dist/assets/qm8xLgv-.css.gz +0 -0
- package/dashboard/dist/assets/tS9mbYZi.js +1 -0
- package/dashboard/dist/assets/tS9mbYZi.js.br +0 -0
- package/dashboard/dist/assets/tS9mbYZi.js.gz +0 -0
- package/dashboard/dist/brand/anthropic-mark.svg.br +0 -0
- package/dashboard/dist/brand/anthropic-mark.svg.gz +0 -0
- package/dashboard/dist/brand/openai-mark.svg.br +0 -0
- package/dashboard/dist/brand/openai-mark.svg.gz +0 -0
- package/dashboard/dist/brand/openclaw-mark.svg.br +0 -0
- package/dashboard/dist/brand/openclaw-mark.svg.gz +0 -0
- package/dashboard/dist/brand/xandy-orchestrator.png +0 -0
- package/dashboard/dist/index.html +7 -5
- package/dashboard/dist/index.html.br +0 -0
- package/dashboard/dist/index.html.gz +0 -0
- package/dist/activity-actor-fields.js +26 -4
- package/dist/activity-store.js +34 -8
- package/dist/agent-context-store.js +79 -17
- package/dist/agent-run-store.js +44 -3
- package/dist/agent-suite.d.ts +9 -0
- package/dist/agent-suite.js +149 -9
- package/dist/artifacts/artifact-domain-schemas.d.ts +66 -0
- package/dist/artifacts/artifact-domain-schemas.js +357 -0
- package/dist/artifacts/register-artifact.d.ts +4 -3
- package/dist/artifacts/register-artifact.js +170 -57
- package/dist/chat-store.d.ts +157 -0
- package/dist/chat-store.js +586 -0
- package/dist/cli/orgx.js +11 -0
- package/dist/contracts/client.d.ts +43 -3
- package/dist/contracts/client.js +159 -30
- package/dist/contracts/retro-schema.d.ts +81 -0
- package/dist/contracts/retro-schema.js +80 -0
- package/dist/contracts/shared-types.d.ts +159 -0
- package/dist/contracts/shared-types.js +177 -1
- package/dist/contracts/skill-pack-schema.d.ts +192 -0
- package/dist/contracts/skill-pack-schema.js +180 -0
- package/dist/contracts/types.d.ts +227 -2
- package/dist/entities/auto-assignment.js +43 -17
- package/dist/event-sanitization.d.ts +11 -0
- package/dist/event-sanitization.js +113 -0
- package/dist/fs-utils.js +13 -1
- package/dist/gateway-watchdog.d.ts +5 -0
- package/dist/gateway-watchdog.js +50 -0
- package/dist/hooks/post-reporting-event.mjs +1 -5
- package/dist/http/helpers/activity-headline.js +13 -132
- package/dist/http/helpers/auto-continue-engine.d.ts +198 -10
- package/dist/http/helpers/auto-continue-engine.js +2531 -186
- package/dist/http/helpers/autopilot-operations.d.ts +19 -0
- package/dist/http/helpers/autopilot-operations.js +182 -31
- package/dist/http/helpers/autopilot-runtime.d.ts +1 -0
- package/dist/http/helpers/autopilot-runtime.js +308 -20
- package/dist/http/helpers/autopilot-slice-utils.d.ts +18 -0
- package/dist/http/helpers/autopilot-slice-utils.js +516 -93
- package/dist/http/helpers/decision-mapper.d.ts +40 -0
- package/dist/http/helpers/decision-mapper.js +223 -7
- package/dist/http/helpers/dispatch-lifecycle.d.ts +19 -2
- package/dist/http/helpers/dispatch-lifecycle.js +242 -37
- package/dist/http/helpers/kickoff-context.js +74 -0
- package/dist/http/helpers/llm-client.d.ts +47 -0
- package/dist/http/helpers/llm-client.js +256 -0
- package/dist/http/helpers/mission-control.d.ts +102 -3
- package/dist/http/helpers/mission-control.js +498 -9
- package/dist/http/helpers/sentinel-catalog.d.ts +23 -0
- package/dist/http/helpers/sentinel-catalog.js +193 -0
- package/dist/http/helpers/session-classification.d.ts +9 -0
- package/dist/http/helpers/session-classification.js +564 -0
- package/dist/http/helpers/slice-experience-v2.d.ts +137 -0
- package/dist/http/helpers/slice-experience-v2.js +677 -0
- package/dist/http/helpers/slice-run-projections.d.ts +72 -0
- package/dist/http/helpers/slice-run-projections.js +860 -0
- package/dist/http/helpers/triage-mapper.d.ts +43 -0
- package/dist/http/helpers/triage-mapper.js +549 -0
- package/dist/http/helpers/value-utils.js +7 -2
- package/dist/http/helpers/workspace-scope.d.ts +15 -0
- package/dist/http/helpers/workspace-scope.js +170 -0
- package/dist/http/index.js +1354 -97
- package/dist/http/routes/agent-suite.d.ts +9 -0
- package/dist/http/routes/agent-suite.js +207 -8
- package/dist/http/routes/agents-catalog.js +64 -19
- package/dist/http/routes/chat.d.ts +19 -0
- package/dist/http/routes/chat.js +522 -0
- package/dist/http/routes/decision-actions.d.ts +8 -1
- package/dist/http/routes/decision-actions.js +42 -5
- package/dist/http/routes/dispatch-gateway-envelope.d.ts +25 -0
- package/dist/http/routes/dispatch-gateway-envelope.js +26 -0
- package/dist/http/routes/entities.d.ts +16 -0
- package/dist/http/routes/entities.js +294 -6
- package/dist/http/routes/live-legacy.d.ts +5 -0
- package/dist/http/routes/live-legacy.js +23 -509
- package/dist/http/routes/live-misc.d.ts +12 -0
- package/dist/http/routes/live-misc.js +251 -31
- package/dist/http/routes/live-snapshot.d.ts +48 -2
- package/dist/http/routes/live-snapshot.js +638 -19
- package/dist/http/routes/live-terminal.d.ts +11 -0
- package/dist/http/routes/live-terminal.js +261 -0
- package/dist/http/routes/live-triage.d.ts +61 -0
- package/dist/http/routes/live-triage.js +248 -0
- package/dist/http/routes/mission-control-actions.d.ts +49 -1
- package/dist/http/routes/mission-control-actions.js +1334 -84
- package/dist/http/routes/mission-control-read.d.ts +48 -3
- package/dist/http/routes/mission-control-read.js +1593 -20
- package/dist/http/routes/realtime-orchestrator.d.ts +10 -0
- package/dist/http/routes/realtime-orchestrator.js +74 -0
- package/dist/http/routes/run-control.d.ts +5 -2
- package/dist/http/routes/run-control.js +10 -0
- package/dist/http/routes/sentinels-catalog.d.ts +7 -0
- package/dist/http/routes/sentinels-catalog.js +24 -0
- package/dist/http/routes/summary.js +10 -3
- package/dist/http/routes/usage.d.ts +24 -0
- package/dist/http/routes/usage.js +362 -0
- package/dist/http/routes/work-artifacts.js +28 -9
- package/dist/index.js +165 -27
- package/dist/local-openclaw.js +29 -6
- package/dist/mcp-client-setup.js +3 -3
- package/dist/mcp-http-handler.js +33 -59
- package/dist/next-up-queue-store.d.ts +16 -1
- package/dist/next-up-queue-store.js +89 -7
- package/dist/outbox.d.ts +5 -0
- package/dist/outbox.js +113 -9
- package/dist/paths.js +24 -5
- package/dist/reporting/rollups.d.ts +53 -0
- package/dist/reporting/rollups.js +148 -0
- package/dist/retro/domain-templates.d.ts +45 -0
- package/dist/retro/domain-templates.js +297 -0
- package/dist/retro/quality-rubric.d.ts +33 -0
- package/dist/retro/quality-rubric.js +213 -0
- package/dist/runtime-cleanup.d.ts +18 -0
- package/dist/runtime-cleanup.js +87 -0
- package/dist/services/background.d.ts +11 -0
- package/dist/services/background.js +22 -0
- package/dist/services/experiment-randomization.d.ts +21 -0
- package/dist/services/experiment-randomization.js +63 -0
- package/dist/skill-pack-state.d.ts +36 -5
- package/dist/skill-pack-state.js +273 -29
- package/dist/sync/local-agent-telemetry.d.ts +13 -0
- package/dist/sync/local-agent-telemetry.js +128 -0
- package/dist/sync/outbox-replay.js +131 -24
- package/dist/team-context-store.d.ts +23 -0
- package/dist/team-context-store.js +116 -0
- package/dist/telemetry/posthog.js +4 -2
- package/dist/tools/core-tools.d.ts +10 -14
- package/dist/tools/core-tools.js +1289 -24
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -0
- package/dist/worker-supervisor.js +23 -0
- package/package.json +14 -4
- package/dashboard/dist/assets/B3ziCA02.js +0 -8
- package/dashboard/dist/assets/B5NEElEI.css +0 -1
- package/dashboard/dist/assets/BhapSNAs.js +0 -215
- package/dashboard/dist/assets/iFdvE7lx.js +0 -1
- package/dashboard/dist/assets/jRJsmpYM.js +0 -1
- package/dashboard/dist/assets/sAhvFnpk.js +0 -4
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as w,j as e}from"./cNrhgGc1.js";import{y as T,z as N,F as ye,P as we,w as S,G as qe,d as Z,H as ze,J as je,K as q,L as Pe,x as Fe,M as Oe}from"./D-bf6hEI.js";import{u as Ve}from"./CFGKRAzG.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"]),He=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 Je(n){return(n??"").trim().replace(/\s+/g," ").toLowerCase()}function Xe(n){return He.has(Je(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(L=>L.toLowerCase()===j.toLowerCase())||b.push(j))};if(Array.isArray(n))for(const m of n)o(m);return o(t??null),b}function Qe(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(L=>!Xe(L))??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:L,onDispatchSession:F,onPauseSession:O,onResumeSession:V,onCancelSession:G,onCreateCheckpoint:K,onRollbackSession:H,onStartInitiative:et,onStartWorkstream:tt,initialInterventionDraft:k=null,onSubmitIntervention:ie}){var he,be,ge;const[x,de]=w.useState(null),[J,A]=w.useState(null),[M,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 B=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]),C=w.useMemo(()=>t?B.size===0?[]:b.filter(r=>{const d=Qe(r);return!!(d&&B.has(d))}).sort((r,d)=>Date.parse(d.timestamp)-Date.parse(r.timestamp)).slice(0,12):[],[b,t,B]),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&&B.has(I)||E&&B.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,B,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=C[0])==null?void 0:f.summary)??((i=C[0])==null?void 0:i.description)??null,g=t.lastEventSummary??r??null;return g&&g.trim().length>0?g.trim():null},[C,t]),ue=w.useMemo(()=>{var r;return t?ye(t.agentName,t.title,t.lastEventSummary,R,(r=C[0])==null?void 0:r.metadata):ye()},[C,t,R]),_=async(r,d,g)=>{if(!(!g||x)){de(r),A(null);try{await g(),A(`${d} requested.`)}catch(f){A(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":M?"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",M?"-rotate-90":"rotate-0"),children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),e.jsx("div",{className:S("transition-all",M?"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",L),disabled:!L||!!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"}),J&&e.jsx("p",{className:"text-caption text-secondary",children:J})]})})]});const U=t.progress===null?null:Math.round(t.progress),v=Ye(t),p=C[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),Ae=c.status==="needs_attention"&&["paused","blocked","queued","pending"].includes(v),Ce=!["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,Le=U!==null&&U>=100&&c.status!=="completed"?"Terminal state":"Progress",Me=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)),X=y(re)?re:null,Be=X!==null&&!(R&&(X===R||R.includes(X)))&&!xe,Ue=w.useCallback(()=>{!G||!t||(A("Session will be cancelled…"),ce({message:`Cancelled "${t.title}"`,onCommit:async()=>{try{await G(t),A("Session cancelled.")}catch(r){A(r instanceof Error?r.message:"Cancel failed.")}},onUndo:()=>{A(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),Q=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":M?"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",M?"-rotate-90":"rotate-0"),children:e.jsx("path",{d:"m6 9 6 6 6-6"})})})]})]}),e.jsx("div",{className:S("transition-all",M?"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",Me),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]})]}),Be&&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:X})]}),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??(Q[0]?N(Q[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,Q.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:["+",Q.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:Le}),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"}),Ae&&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",()=>H==null?void 0:H(t)),disabled:!H||!!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){A("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"})]})]}),Ce&&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…"})})]}),J&&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:J}),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"}),C.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:C.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
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as p,j as e}from"./cNrhgGc1.js";import{r as D,E as W,d as x,K}from"./D-bf6hEI.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";import"./CxQ08qFN.js";const q={blocked:0,failed:1,running:2,active:2,queued:3,in_progress:3,pending:4,paused:5,cancelled:6,completed:7,archived:8};function Q(n){if(!n)return 0;const b=Date.parse(n);return Number.isFinite(b)?b:0}function F(n){return Q(n.updatedAt??n.lastEventAt??n.startedAt)}function Y(n,b){const i=q[(n.status??"").toLowerCase()]??99,y=q[(b.status??"").toLowerCase()]??99;return i!==y?i-y:F(b)-F(n)}function G(n,b){const i=n.trim().toLowerCase();return i==="failed"?x.red:i==="blocked"||b>0?x.red:i==="running"||i==="active"||i==="in_progress"?x.lime:i==="queued"||i==="pending"?x.amber:i==="completed"?x.teal:x.textMuted}function H(n){switch(n){case"active":return{title:"Active Sessions",subtitle:"Running and queued work across agents."};case"blocked":return{title:"Blocked Sessions",subtitle:"Work that needs attention before it can proceed."};case"failed":return{title:"Failed Sessions",subtitle:"Runs that exited with an error and may need a retry."};default:return{title:"Sessions",subtitle:"All sessions visible to this dashboard."}}}function J(n,b){var j;const i=(b.status??"").toLowerCase(),y=((j=b.blockers)==null?void 0:j.length)??0;return n==="active"?["running","active","queued","pending","in_progress"].includes(i):n==="blocked"?i==="blocked"||y>0:n==="failed"?i==="failed":!0}function se({open:n,onClose:b,mode:i,sessions:y,onOpenSession:j,onRunAction:A,onRefetch:L,onSetNotice:v}){const{title:I,subtitle:P}=H(i),[S,_]=p.useState(""),[w,B]=p.useState(new Set),[d,k]=p.useState(null),[M,h]=p.useState(null),[N,C]=p.useState(null);p.useEffect(()=>{n&&(h(null),C(null))},[n]);const f=p.useMemo(()=>y.filter(t=>J(i,t)),[i,y]),g=p.useMemo(()=>{const t={};for(const o of f){const a=(o.status??"unknown").toLowerCase();t[a]=(t[a]??0)+1}const r=f.filter(o=>{var a;return(o.status??"").toLowerCase()==="blocked"||(((a=o.blockers)==null?void 0:a.length)??0)>0}).length,s=f.filter(o=>(o.status??"").toLowerCase()==="failed").length,l=f.filter(o=>["running","active","queued","pending","in_progress"].includes((o.status??"").toLowerCase())).length;return{total:f.length,active:l,blocked:r,failed:s,byStatus:t}},[f]),u=p.useMemo(()=>{const t=S.trim().toLowerCase(),r=[...f].sort(Y);return t?r.filter(s=>[s.title,s.agentName,s.agentId,s.runId,s.lastEventSummary].filter(Boolean).join(" ").toLowerCase().includes(t)):r},[S,f]);p.useEffect(()=>{n&&B(t=>{const r=new Set(u.map(l=>l.id)),s=new Set;for(const l of t)r.has(l)&&s.add(l);return s})},[u,n]);const m=w.size,T=u.length>0&&u.every(t=>w.has(t.id)),R=()=>{d||B(t=>u.length===0?t:T?new Set:new Set(u.map(r=>r.id)))},U=t=>{d||B(r=>{const s=new Set(r);return s.has(t)?s.delete(t):s.add(t),s})},O=async()=>{if(m===0||d)return;const t=[];for(const s of u){if(!w.has(s.id))continue;const l=s.blockers??[];if(l.length!==0){t.push(`- ${s.title} (${l.length} blocker${l.length===1?"":"s"})`);for(const o of l)t.push(` - ${o}`)}}const r=t.length>0?t.join(`
|
|
2
|
+
`):"No blockers found for selected sessions.";try{await navigator.clipboard.writeText(r),h("Copied blockers to clipboard.")}catch{h("Copy failed (clipboard unavailable).")}},$=async t=>{if(m===0||d)return;if(t==="cancel"){C({text:""});return}const r=u.filter(a=>w.has(a.id));h(null),k({action:t,processed:0,total:r.length});let s=0;const l=[];for(const a of r)try{await A(a,t)}catch(c){s+=1;const E=c instanceof Error?c.message:"unknown error";l.push(`${a.title||a.runId}: ${E}`)}finally{k(c=>c&&{...c,processed:Math.min(c.total,c.processed+1)})}const o=r.length-s;if(k(null),s>0){const a=l.length>0?` — ${l[0]}${l.length>1?` (+${l.length-1} more)`:""}`:"";h(`${t} finished: ${o} ok, ${s} failed.${a}`)}else h(`${t} finished: ${o} session${o===1?"":"s"}.`);try{await L()}catch{}t==="resume"?v(`Bulk resume requested: ${o} ok${s?`, ${s} failed`:""}.`):t==="pause"?v(`Bulk pause requested: ${o} ok${s?`, ${s} failed`:""}.`):t==="complete"&&v(`Bulk mark completed requested: ${o} ok${s?`, ${s} failed`:""}.`)},z=async()=>{if(!N||d||N.text.trim().toUpperCase()!=="CANCEL")return;const t=u.filter(a=>w.has(a.id));h(null),k({action:"cancel",processed:0,total:t.length}),C(null);let r=0;const s=[];for(const a of t)try{await A(a,"cancel")}catch(c){r+=1;const E=c instanceof Error?c.message:"unknown error";s.push(`${a.title||a.runId}: ${E}`)}finally{k(c=>c&&{...c,processed:Math.min(c.total,c.processed+1)})}const l=t.length-r;k(null);const o=s.length>0?` — ${s[0]}${s.length>1?` (+${s.length-1} more)`:""}`:"";h(`cancel finished: ${l} ok${r?`, ${r} failed`:""}.${o}`),v(`Bulk cancel requested: ${l} ok${r?`, ${r} failed`:""}.`);try{await L()}catch{}};return e.jsx(D,{open:n,onClose:b,maxWidth:"max-w-4xl",children:e.jsxs("div",{className:"flex h-full w-full flex-col",children:[e.jsxs("div",{className:"border-b border-subtle px-5 pt-5 pb-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"inline-flex items-center gap-2 text-heading font-semibold text-white",children:[e.jsx(W,{type:"session",size:14}),e.jsx("span",{className:"truncate",children:I}),e.jsx("span",{className:"rounded-full border border-strong bg-white/[0.04] px-2 py-0.5 text-caption font-semibold text-primary",children:g.total})]}),e.jsx("p",{className:"mt-1 text-body leading-relaxed text-secondary",children:P}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:x.teal}}),"Total ",e.jsx("span",{className:"font-semibold text-white",children:g.total})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:g.active>0?x.lime:x.textMuted}}),"Active ",e.jsx("span",{className:"font-semibold text-white",children:g.active})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:g.blocked>0?x.red:x.textMuted}}),"Blocked ",e.jsx("span",{className:"font-semibold text-white",children:g.blocked})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:g.failed>0?x.red:x.textMuted}}),"Failed ",e.jsx("span",{className:"font-semibold text-white",children:g.failed})]})]})]}),e.jsx("button",{type:"button",onClick:b,className:"rounded-md border border-strong bg-white/[0.03] px-2.5 py-1.5 text-caption text-primary transition-colors hover:bg-white/[0.08]","aria-label":"Close bulk modal",children:"Close"})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"sr-only",htmlFor:"bulk-sessions-search",children:"Search sessions"}),e.jsx("input",{id:"bulk-sessions-search",value:S,onChange:t=>_(t.target.value),placeholder:"Search title, agent, run id…","data-modal-autofocus":"true",className:"w-full rounded-lg border border-strong bg-black/25 px-3 py-2 text-body text-white placeholder:text-muted focus:outline-none focus:ring-1 focus:ring-[#BFFF00]/35"})]}),e.jsx("button",{type:"button",onClick:R,disabled:u.length===0||!!d,className:"rounded-lg border border-strong bg-white/[0.03] px-3 py-2 text-caption text-primary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:T?"Clear all":`Select all (${u.length})`})]}),M&&e.jsx("div",{className:"mt-3 rounded-xl border border-white/[0.08] bg-white/[0.02] px-3 py-2 text-body text-secondary",children:M}),N&&e.jsxs("div",{className:"mt-3 rounded-xl border border-red-400/25 bg-red-500/[0.06] px-3 py-2.5",children:[e.jsxs("p",{className:"text-body font-semibold text-red-200",children:["Cancel ",m," session",m===1?"":"s","?"]}),e.jsxs("p",{className:"mt-1 text-caption text-red-200/70",children:["This is destructive. Type ",e.jsx("span",{className:"font-semibold",children:"CANCEL"})," to confirm."]}),e.jsxs("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx("input",{value:N.text,onChange:t=>C({text:t.target.value}),placeholder:"CANCEL",className:"flex-1 rounded-lg border border-red-300/25 bg-black/30 px-3 py-2 text-body text-white placeholder:text-muted focus:outline-none focus:ring-1 focus:ring-red-300/40"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>C(null),className:"rounded-lg border border-strong bg-white/[0.03] px-3 py-2 text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Back"}),e.jsx("button",{type:"button",onClick:z,disabled:N.text.trim().toUpperCase()!=="CANCEL",className:"rounded-lg border border-red-300/25 bg-red-500/15 px-3 py-2 text-caption font-semibold text-red-200 transition-colors hover:bg-red-500/20 disabled:opacity-45",children:"Confirm cancel"})]})]})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-4",children:u.length===0?e.jsx("div",{className:"rounded-xl border border-subtle bg-white/[0.02] p-4 text-body text-secondary",children:"No sessions match this view."}):e.jsx("div",{className:"space-y-2",children:u.map(t=>{const r=w.has(t.id),s=t.blockers??[],l=G(t.status??"",s.length),o=t.updatedAt??t.lastEventAt??t.startedAt,a=[(t.agentName??t.agentId??"").trim()||"Unknown agent",(t.status??"unknown").toLowerCase(),o?K(o):null].filter(Boolean);return e.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.02] px-3 py-2.5 transition-colors hover:bg-white/[0.04]",style:{borderColor:r?`${x.lime}40`:"rgba(255,255,255,0.08)"},children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:()=>U(t.id),disabled:!!d,className:"mt-0.5 h-4 w-4 rounded border-white/20 bg-black/40 text-lime focus:ring-lime/40","aria-label":`Select session ${t.title}`}),e.jsx("button",{type:"button",onClick:()=>j(t),disabled:!!d,className:"min-w-0 flex-1 text-left",title:"Open session inspector",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-body font-medium text-white",children:t.title}),e.jsx("p",{className:"mt-0.5 text-caption text-secondary",children:a.join(" · ")}),t.lastEventSummary&&e.jsx("p",{className:"mt-1 line-clamp-2 text-caption text-secondary",children:t.lastEventSummary}),s.length>0&&e.jsxs("p",{className:"mt-1 text-micro text-red-200/80",children:[s.length," blocker",s.length===1?"":"s"," · ",s[0]]})]}),e.jsx("span",{className:"shrink-0 rounded-full border px-2 py-0.5 text-micro font-semibold uppercase tracking-[0.08em]",style:{borderColor:`${l}30`,backgroundColor:`${l}14`,color:l},children:(t.status??"unknown").toUpperCase()})]})})]})},t.id)})})}),e.jsxs("div",{className:"flex flex-col gap-2 border-t border-subtle px-5 py-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-caption text-secondary",children:[d?e.jsxs("span",{children:[d.action," ",d.processed,"/",d.total]}):e.jsx("span",{children:m>0?`${m} selected`:"No selection"}),i==="blocked"&&e.jsx("button",{type:"button",onClick:O,disabled:m===0||!!d,className:"rounded-md border border-strong bg-white/[0.03] px-2.5 py-1.5 text-caption text-secondary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:"Copy blockers"})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{const t=u.find(r=>w.has(r.id))??null;t&&j(t)},disabled:m!==1||!!d,className:"rounded-md border border-strong bg-white/[0.03] px-3 py-1.5 text-caption text-primary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:"Open inspector"}),e.jsx("button",{type:"button",onClick:()=>void $("resume"),disabled:m===0||!!d,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-1.5 text-caption font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:"Resume selected"}),e.jsx("button",{type:"button",onClick:()=>void $("complete"),disabled:m===0||!!d,className:"rounded-md border border-teal/25 bg-teal/10 px-3 py-1.5 text-caption font-semibold text-teal transition-colors hover:bg-teal/20 disabled:opacity-45",children:"Mark completed"}),e.jsx("button",{type:"button",onClick:()=>void $("pause"),disabled:m===0||!!d,className:"rounded-md border border-strong bg-white/[0.03] px-3 py-1.5 text-caption text-primary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:"Pause selected"}),e.jsx("button",{type:"button",onClick:()=>void $("cancel"),disabled:m===0||!!d,className:"rounded-md border border-red-300/25 bg-red-500/10 px-3 py-1.5 text-caption font-semibold text-red-200 transition-colors hover:bg-red-500/15 disabled:opacity-45",children:"Cancel selected"})]})]})]})})}export{se as BulkSessionsModal};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as x}from"./cNrhgGc1.js";import{E as te,G as de,$ as ue,r as xe,A as me,R as pe,x as w,a0 as he,a1 as ke,Y as be,K as P,_ as ge,d as l}from"./D-bf6hEI.js";import{E as fe}from"./DNxKz-GV.js";import{A as je,m as h}from"./CxQ08qFN.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";function ve({breadcrumbs:s,typeBadge:n,onClose:c,footer:N,children:I}){return e.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-subtle px-5 py-3 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 text-body text-secondary",children:[s.map((b,g)=>e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[g>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"})}),b.onClick?e.jsx("button",{type:"button",onClick:b.onClick,className:`truncate transition-colors hover:text-primary ${g===s.length-1?"text-primary font-medium":""}`,children:b.label}):e.jsx("span",{className:`truncate ${g===s.length-1?"text-primary font-medium":""}`,children:b.label})]},g)),n&&e.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.04] px-2 py-0.5 text-micro uppercase tracking-[0.06em] text-secondary",children:[n.icon&&e.jsx(te,{type:n.icon,size:11,className:"opacity-90"}),n.label]})]}),e.jsx("button",{type:"button",onClick:c,"aria-label":"Close detail",className:"inline-flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-full border border-strong bg-white/[0.03] text-primary transition-colors hover:bg-white/[0.08] hover:text-white",children:e.jsxs("svg",{width:"15",height:"15",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.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:I}),N&&e.jsx("div",{className:"flex-shrink-0 border-t border-subtle px-5 py-3 sm:px-6",children:N})]})}function ye(s){switch(s){case"running":return{background:`linear-gradient(to right, ${l.lime}, ${l.teal})`};case"blocked":return{background:`linear-gradient(to right, ${l.red}, ${l.amber})`};case"idle":return{background:`linear-gradient(to right, ${l.iris}99, transparent)`};default:return{background:`linear-gradient(to right, ${l.lime}B3, ${l.teal}66)`}}}function G(s){switch(s){case"running":return l.lime;case"blocked":return l.red;case"idle":return l.iris;case"queued":return l.teal;default:return l.amber}}function Y(s,n){return n?"Scope Under Review":s==="completed"?"Completed Scope":s==="running"?"Current Work":s==="blocked"?"Blocked Work":"Next Work"}function we(s){const n=s.sliceScope==="task"?"task":s.sliceScope==="milestone"?"milestone slice":"workstream slice",c=typeof s.sliceTaskCount=="number"&&s.sliceTaskCount>0?`${s.sliceTaskCount} ${s.sliceTaskCount===1?"task":"tasks"}`:null;return s.queueState==="running"?c?`Execution is in progress across ${c} in this ${n}.`:"Execution is in progress. Task detail will appear when scheduler state updates.":s.queueState==="blocked"?s.blockReason?s.blockReason:"Work is blocked pending a dependency or decision.":s.queueState==="queued"?c?`Queued with ${c} ready in this ${n}.`:"Queued at workstream scope. Task detail appears after dispatch.":s.queueState==="completed"?"Work is completed. No pending queued tasks.":"Work is idle and ready to start."}function K(s){return s===0?l.red:s===1?l.amber:s===2?l.iris:"rgba(255,255,255,0.5)"}function Q(s){return s===0?"P0":s===1?"P1":s===2?"P2":s===3?"P3":""}function Ne(s){switch(s){case"high":return{filled:5,color:l.lime};case"medium":return{filled:3,color:l.amber};case"low":return{filled:1,color:l.red};default:return{filled:0,color:l.iris}}}async function Ie(s){const n={};if(s.runId&&(n.runId=s.runId),s.sliceRunId&&(n.sliceRunId=s.sliceRunId),s.sessionId&&(n.sessionId=s.sessionId),Object.keys(n).length===0)throw new Error("No run identifier available for terminal open.");const c=await fetch("/orgx/api/live/terminal/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!c.ok){const N=await c.json().catch(()=>({}));throw new Error(N.error??`Terminal open failed (${c.status})`)}}const Ce={hidden:{opacity:0,y:-4},visible:s=>({opacity:1,y:0,transition:{duration:.28,delay:s*.04,ease:[.16,1,.3,1]}}),exit:{opacity:0,transition:{duration:.18}}},j={hidden:{opacity:0,y:8},visible:s=>({opacity:1,y:0,transition:{duration:.22,delay:s*.04,ease:pe.easingStandard}}),exit:{opacity:0,transition:{duration:.18}}};function ee(s){var N,I,b,g,C,T,S,F;if(s.source==="queue"){const{item:a,linkedSliceRun:o}=s;return{initiativeId:a.initiativeId,initiativeTitle:w(a.initiativeTitle),initiativeStatus:a.initiativeStatus,workstreamId:a.workstreamId,workstreamTitle:w(a.workstreamTitle),workstreamStatus:a.workstreamStatus,nextTaskTitle:a.nextTaskTitle?w(a.nextTaskTitle):null,nextTaskPriority:a.nextTaskPriority,nextTaskDueAt:a.nextTaskDueAt,agentId:a.runnerAgentId,agentName:a.runnerAgentName,agentSource:a.runnerSource,queueState:a.queueState,blockReason:a.blockReason?w(a.blockReason):null,sliceScope:a.sliceScope??null,sliceTaskCount:typeof a.sliceTaskCount=="number"&&Number.isFinite(a.sliceTaskCount)?Math.max(0,Math.floor(a.sliceTaskCount)):((N=a.sliceTaskIds)==null?void 0:N.length)??null,autoContinue:a.autoContinue,sliceRun:o,sessionId:null,runId:(o==null?void 0:o.runId)??null}}if(s.source==="in_progress"){const{row:a,sliceRun:o}=s;return{initiativeId:a.initiativeId,initiativeTitle:a.initiativeTitle?w(a.initiativeTitle):null,initiativeStatus:null,workstreamId:a.workstreamId,workstreamTitle:a.workstreamTitle?w(a.workstreamTitle):a.title,workstreamStatus:a.status,nextTaskTitle:null,nextTaskPriority:null,nextTaskDueAt:null,agentId:((I=a.session)==null?void 0:I.agentId)??null,agentName:((b=a.session)==null?void 0:b.agentName)??"OrgX",agentSource:null,queueState:a.status==="running"?"running":"queued",blockReason:null,sliceScope:(o==null?void 0:o.scope)??null,sliceTaskCount:typeof((g=o==null?void 0:o.scopeProgress)==null?void 0:g.totalTasks)=="number"?Math.max(0,Math.floor(o.scopeProgress.totalTasks-o.scopeProgress.completedTasks)):((C=o==null?void 0:o.taskIds)==null?void 0:C.length)??null,autoContinue:null,sliceRun:o,sessionId:((T=a.session)==null?void 0:T.id)??null,runId:a.runId}}const{sliceRun:n}=s,c=n.sourceClient?n.sourceClient.charAt(0).toUpperCase()+n.sourceClient.slice(1):"OrgX";return{initiativeId:n.initiativeId,initiativeTitle:null,initiativeStatus:null,workstreamId:n.workstreamId,workstreamTitle:n.workstreamTitle?w(n.workstreamTitle):"Work slice",workstreamStatus:n.status,nextTaskTitle:null,nextTaskPriority:null,nextTaskDueAt:null,agentId:null,agentName:c,agentSource:n.sourceClient,queueState:n.status==="needs_review"?"completed":"blocked",blockReason:n.status==="failed"&&n.statusExplainer||null,sliceScope:n.scope??null,sliceTaskCount:typeof((S=n.scopeProgress)==null?void 0:S.totalTasks)=="number"?Math.max(0,Math.floor(n.scopeProgress.totalTasks-n.scopeProgress.completedTasks)):((F=n.taskIds)==null?void 0:F.length)??null,autoContinue:null,sliceRun:n,sessionId:null,runId:n.runId}}function v(){return e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-white/[0.06] to-transparent"})}function Ee({target:s,onClose:n,onPlayWorkstream:c,onStartAutoContinue:N,onMoveWorkstream:I,onRemoveFromQueue:b,onOpenSession:g,onFocusRunId:C,onOpenInitiative:T,onReviewActivity:S,onOpenDecisions:F,onAcceptSlice:a,onRejectSlice:o}){var H,Z;const $=s!==null,[ie,_]=x.useState(!1),[W,L]=x.useState(null),[u,A]=x.useState(null),[E,q]=x.useState(""),[B,y]=x.useState(null),U=x.useRef(null),M=x.useCallback(r=>{if(s&&(r.metaKey||r.ctrlKey)&&r.key==="Enter"){r.preventDefault();const d=ee(s);d.initiativeId&&d.workstreamId&&(c==null||c(d.initiativeId,d.workstreamId,d.agentId??void 0))}},[s,c]);if(x.useEffect(()=>{if($)return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[$,M]),x.useEffect(()=>{$||(L(null),_(!1),A(null),q(""),y(null))},[$]),x.useEffect(()=>{u&&requestAnimationFrame(()=>{var r;(r=U.current)==null||r.focus()})},[u]),!s)return null;const i=ee(s),t=i.sliceRun,m=de({sessionStatus:i.queueState,sessionPhase:i.workstreamStatus,sliceStatus:(t==null?void 0:t.status)??i.workstreamStatus,activityStatus:(t==null?void 0:t.runtimeState)??i.workstreamStatus??i.queueState,stopReason:i.queueState==="blocked"?"blocked":null,decisionRequired:((t==null?void 0:t.blockingDecisionCount)??0)>0,blockingDecisionCount:(t==null?void 0:t.blockingDecisionCount)??0,nonBlockingDecisionCount:Math.max(0,((t==null?void 0:t.decisionCount)??0)-((t==null?void 0:t.blockingDecisionCount)??0)),blockerCount:i.blockReason?1:0,blockerReason:i.blockReason}),se=m.status==="completed"?"text-lime border-lime/30 bg-lime/[0.12]":m.status==="failed"?"text-red-200 border-red-400/30 bg-red-500/[0.12]":m.status==="needs_attention"?"text-amber-200 border-amber-400/30 bg-amber-500/[0.12]":m.status==="in_progress"?"text-teal-200 border-teal-400/30 bg-teal-500/[0.12]":"text-secondary border-white/[0.14] bg-white/[0.04]",ne=m.tone==="critical"?"border-red-400/24 bg-red-500/[0.08]":m.tone==="warning"?"border-amber-400/24 bg-amber-500/[0.08]":m.tone==="positive"?"border-lime/24 bg-lime/[0.08]":"border-subtle bg-white/[0.02]",ae=[...i.initiativeTitle?[{label:i.initiativeTitle,onClick:i.initiativeId?()=>T==null?void 0:T(i.initiativeId):void 0}]:[],{label:i.workstreamTitle}],J=m.status==="in_progress",re=!!(i.initiativeId&&i.workstreamId&&!J),V=m.nextAction??(s.source==="needs_input"&&t?t.primaryAction==="resolve_decision"?"Resolve decision":t.primaryAction==="open_artifact"?"Open result":"Review activity":null),oe=x.useCallback(async r=>{try{L(null),_(!0),await Ie(r)}catch(d){L(d instanceof Error?d.message:"Unable to open terminal")}finally{_(!1)}},[]),X=x.useMemo(()=>i.sessionId?{sessionId:i.sessionId,runId:i.runId,sliceRunId:(t==null?void 0:t.sliceRunId)??null}:t!=null&&t.runId||t!=null&&t.sliceRunId?{runId:t.runId??null,sliceRunId:t.sliceRunId??null}:i.runId?{runId:i.runId,sliceRunId:(t==null?void 0:t.sliceRunId)??null}:null,[i.sessionId,i.runId,t]),le=X!==null,O=x.useMemo(()=>ue({initiativeId:i.initiativeId,initiativeTitle:i.initiativeTitle,workstreamId:i.workstreamId,workstreamTitle:i.workstreamTitle,taskIds:t==null?void 0:t.taskIds,milestoneIds:t==null?void 0:t.milestoneIds,scopeProgress:(t==null?void 0:t.scopeProgress)??null,status:(t==null?void 0:t.status)??i.queueState,agentName:i.agentName,agentId:i.agentId}),[i.initiativeId,i.initiativeTitle,i.workstreamId,i.workstreamTitle,t,i.queueState,i.agentName,i.agentId]),D=s.source==="needs_input"&&(t==null?void 0:t.status)==="needs_review",z=x.useCallback(async()=>{if(!t||!u)return;const r=E.trim(),d=t.runId??t.sliceRunId;if(u==="accept")try{y("Accepting…");const p=r?`Accepted: ${r}`:"Accepted from dashboard",k=await fetch(`/orgx/api/runs/${encodeURIComponent(d)}/actions/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:p})});if(!k.ok){const R=await k.json().catch(()=>null);y(`Error: ${(R==null?void 0:R.error)??(R==null?void 0:R.message)??k.status}`);return}y("Accepted!");try{a==null||a(t,r||void 0)}catch{}setTimeout(()=>n(),600)}catch(p){y(`Failed: ${p instanceof Error?p.message:"network error"}`)}else if(u==="reject"&&r)try{y("Sending feedback…");const p=await fetch(`/orgx/api/entities/run/${encodeURIComponent(d)}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:r,commentType:"review_feedback",severity:"warn",tags:["changes_requested"]})});if(!p.ok){const k=await p.json().catch(()=>null);y(`Error: ${(k==null?void 0:k.error)??(k==null?void 0:k.message)??p.status}`);return}y("Feedback sent!");try{o==null||o(t,r)}catch{}A(null),q("")}catch(p){y(`Failed: ${p instanceof Error?p.message:"network error"}`)}},[t,u,E,a,o,n]),ce=e.jsxs("div",{className:"space-y-2",children:[B&&e.jsx("div",{className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11px] font-medium ${B.startsWith("Error")||B.startsWith("Failed")?"bg-[#FF6B88]/10 text-[#FF6B88]":B.includes("…")?"bg-white/[0.04] text-white/60 animate-pulse":"bg-[#BFFF00]/10 text-[#BFFF00]"}`,children:B}),e.jsx(je,{children:u&&e.jsx(h.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsxs("div",{className:"pb-2",children:[e.jsx("textarea",{ref:U,value:E,onChange:r=>q(r.target.value),onKeyDown:r=>{(r.metaKey||r.ctrlKey)&&r.key==="Enter"&&(r.preventDefault(),z()),r.key==="Escape"&&(r.preventDefault(),A(null),q(""))},placeholder:u==="accept"?"Optional note...":"What needs to change?",className:"w-full resize-none rounded-lg border border-white/[0.08] bg-white/[0.03] px-3 py-2 text-[13px] text-white/80 outline-none placeholder:text-white/25 focus:border-white/15 transition-colors",rows:2}),e.jsxs("div",{className:"mt-1.5 flex items-center justify-between",children:[e.jsx("button",{type:"button",onClick:()=>{A(null),q("")},className:"text-[11px] text-white/30 transition-colors hover:text-white/50",children:"Cancel"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-white/20",children:u==="reject"&&!E.trim()?"Note required":"⌘Enter to confirm"}),e.jsx("button",{type:"button",onClick:z,disabled:u==="reject"&&!E.trim(),className:`inline-flex h-7 items-center gap-1 rounded-md px-3 text-[11px] font-semibold transition-colors disabled:opacity-30 ${u==="accept"?"bg-[#BFFF00]/12 text-[#BFFF00] hover:bg-[#BFFF00]/20":"bg-[#FF6B88]/12 text-[#FF6B88] hover:bg-[#FF6B88]/20"}`,children:u==="accept"?"Confirm accept":"Request changes"})]})]})]})})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[s.source==="queue"&&i.initiativeId&&i.workstreamId&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>{b==null||b(i.initiativeId,i.workstreamId),n()},className:"rounded-md px-2.5 py-1.5 text-[12px] font-medium text-[#FF6B88]/70 transition-colors hover:bg-[#FF6B88]/[0.08] hover:text-[#FF6B88]",children:"Remove"}),e.jsx("button",{type:"button",onClick:()=>I==null?void 0:I(i.initiativeId,i.workstreamId,"top"),className:"rounded-md px-2.5 py-1.5 text-[12px] font-medium text-white/35 transition-colors hover:bg-white/[0.04] hover:text-white/60",children:"Move top"})]}),s.source==="in_progress"&&i.sessionId&&e.jsx("button",{type:"button",onClick:()=>{g==null||g(i.sessionId),n()},className:"rounded-md px-2.5 py-1.5 text-[12px] font-medium text-white/35 transition-colors hover:bg-white/[0.04] hover:text-white/60",children:"Open session"}),s.source==="needs_input"&&t&&t.primaryAction==="resolve_decision"&&e.jsx("button",{type:"button",onClick:()=>{F==null||F(),n()},className:"rounded-md px-2.5 py-1.5 text-[12px] font-medium text-[#0AD4C4]/70 transition-colors hover:bg-[#0AD4C4]/[0.08] hover:text-[#0AD4C4]",children:"Resolve decision"}),s.source==="needs_input"&&t&&e.jsx("button",{type:"button",onClick:()=>{S==null||S(t),n()},className:"rounded-md px-2.5 py-1.5 text-[12px] font-medium text-white/35 transition-colors hover:bg-white/[0.04] hover:text-white/60",children:"Review"}),i.runId&&e.jsx("button",{type:"button",onClick:()=>{C==null||C(i.runId),n()},className:"rounded-md px-2.5 py-1.5 text-[12px] font-medium text-white/35 transition-colors hover:bg-white/[0.04] hover:text-white/60",children:"Timeline"}),le&&e.jsx("button",{type:"button",onClick:()=>void oe(X),disabled:ie,className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-white/30 transition-colors hover:bg-white/[0.04] hover:text-white/50 disabled:opacity-40",title:"Open in terminal",children:e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"4 17 10 11 4 5"}),e.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})})]}),e.jsx("div",{className:"flex-1"}),D&&o&&e.jsx("button",{type:"button",onClick:()=>A(u==="reject"?null:"reject"),className:`rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors ${u==="reject"?"bg-[#FF6B88]/12 text-[#FF6B88]":"text-white/35 hover:bg-white/[0.04] hover:text-white/60"}`,children:"Request changes"}),D&&a&&e.jsxs("button",{type:"button",onClick:()=>{u==="accept"?z():A("accept")},className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-[#BFFF00]/12 px-4 text-[12px] font-semibold text-[#BFFF00] transition-colors hover:bg-[#BFFF00]/20",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Accept"]}),re&&e.jsxs("button",{type:"button","data-modal-autofocus":"true",onClick:()=>{c==null||c(i.initiativeId,i.workstreamId,i.agentId??void 0),n()},className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-[#BFFF00]/12 px-4 text-[12px] font-semibold text-[#BFFF00] transition-colors hover:bg-[#BFFF00]/20",title:"Start (\\u2318 Enter)",children:[e.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:"h-3.5 w-3.5",children:e.jsx("path",{d:"M7 5.4v9.2c0 .7.75 1.15 1.38.83l7.6-4.6a.95.95 0 0 0 0-1.62l-7.6-4.64A.95.95 0 0 0 7 5.4Z",fill:"currentColor"})}),m.status==="completed"?"Restart":m.status==="needs_attention"?"Retry":"Start"]})]})]});let f=0;return e.jsx(xe,{open:$,onClose:n,maxWidth:"max-w-xl",children:e.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[e.jsx("div",{className:"h-[2px] flex-shrink-0 rounded-t-2xl",style:ye(i.queueState),"aria-hidden":!0}),e.jsx(ve,{breadcrumbs:ae,onClose:n,footer:ce,children:e.jsxs("div",{className:"px-6 py-5 space-y-5",children:[e.jsxs(h.div,{variants:Ce,initial:"hidden",animate:"visible",exit:"exit",custom:f++,className:"flex items-start gap-3",children:[e.jsx(me,{name:i.agentName??"OrgX",hint:i.agentSource??i.agentId,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[20px] font-semibold leading-snug text-white",children:i.workstreamTitle}),i.initiativeTitle&&e.jsx("p",{className:"mt-0.5 text-[10px] uppercase tracking-[0.1em] text-muted",children:i.initiativeTitle}),e.jsx("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:e.jsxs("span",{className:`inline-flex items-center rounded-full border px-2 py-[1px] text-micro font-semibold uppercase tracking-[0.06em] ${se}`,children:[e.jsxs("span",{className:"relative mr-1.5 inline-block h-1.5 w-1.5",children:[e.jsx("span",{className:"absolute inset-0 rounded-full",style:{backgroundColor:G(i.queueState)}}),J&&e.jsx(h.span,{className:"absolute inset-0 rounded-full",style:{backgroundColor:G(i.queueState)},animate:{opacity:[1,.3,1],scale:[1,1.6,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}})]}),m.label]})})]})]}),e.jsx(v,{}),s.source==="needs_input"&&t?e.jsxs(e.Fragment,{children:[e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,className:`rounded-xl border px-4 py-3 ${ne}`,children:[e.jsx("p",{className:"section-kicker",children:"What to do now"}),e.jsx("p",{className:"mt-1 text-body text-primary",children:m.sentence}),t.artifactCount>0?e.jsxs("p",{className:"mt-1 text-caption text-secondary",children:[t.artifactCount," artifact",t.artifactCount===1?"":"s"," ready for review."]}):null,t.blockingDecisionCount>0?e.jsxs("p",{className:"mt-1 text-caption text-secondary",children:[t.blockingDecisionCount," blocking decision",t.blockingDecisionCount===1?"":"s"," waiting."]}):null,V?e.jsxs("p",{className:"mt-1 text-caption text-secondary",children:["Recommended action: ",V]}):null]}),t.statusExplainer&&t.statusExplainer!==i.blockReason&&e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,children:[e.jsx("p",{className:"section-kicker",children:"What happened"}),e.jsx("p",{className:"mt-1 text-body text-secondary leading-relaxed",children:w(t.statusExplainer)})]}),t.lastEventSummary&&e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,children:[e.jsx("p",{className:"section-kicker",children:"Last activity"}),e.jsx("p",{className:"mt-1 text-caption text-white/50 leading-relaxed",children:w(t.lastEventSummary)})]}),e.jsx(v,{})]}):null,(i.blockReason||i.autoContinue||i.agentSource&&i.agentSource!=="assigned")&&e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,className:"space-y-2",children:[i.blockReason&&e.jsxs("div",{className:"rounded-lg border border-red-400/24 bg-red-500/[0.08] px-2.5 py-1.5 text-caption text-red-100/85",children:[e.jsx("p",{className:"mb-0.5 text-micro font-semibold uppercase tracking-[0.08em] text-red-200/70",children:"Why blocked"}),i.blockReason]}),i.autoContinue&&e.jsxs("div",{className:"flex items-center gap-2 text-caption text-secondary",children:[e.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,className:"h-3.5 w-3.5 flex-shrink-0 text-[#0AD4C4]",children:e.jsx("path",{d:"M6.1 13.25C4.25 13.25 2.8 11.8 2.8 10s1.45-3.25 3.3-3.25c3.15 0 4.35 6.5 8.05 6.5 1.85 0 3.3-1.45 3.3-3.25s-1.45-3.25-3.3-3.25c-3.7 0-4.9 6.5-8.05 6.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsxs("span",{children:["Auto-continue: ",e.jsx("span",{className:"text-primary capitalize",children:i.autoContinue.status}),i.autoContinue.laneState&&e.jsxs("span",{className:"text-muted",children:[" · ",he(i.autoContinue.laneState)]})]})]}),((H=i.autoContinue)==null?void 0:H.laneBlockedReason)&&e.jsx("p",{className:"text-micro text-red-100/75",children:i.autoContinue.laneBlockedReason}),((Z=i.autoContinue)==null?void 0:Z.stopReason)&&e.jsx("p",{className:"text-micro text-amber-100/75",children:ke(i.autoContinue.stopReason)})]}),O.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,className:"space-y-2",children:[e.jsx("p",{className:"section-kicker",children:Y(i.queueState,D)}),e.jsx(be,{nodes:O,activeId:i.workstreamId}),!D&&(i.nextTaskPriority!==null||i.nextTaskDueAt)&&e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.nextTaskPriority!==null&&Q(i.nextTaskPriority)&&e.jsx("span",{className:"inline-flex rounded-full border px-2 py-[1px] text-micro font-semibold",style:{color:K(i.nextTaskPriority),borderColor:`${K(i.nextTaskPriority)}33`,backgroundColor:`${K(i.nextTaskPriority)}14`},children:Q(i.nextTaskPriority)}),i.nextTaskDueAt&&e.jsxs("span",{className:"text-micro text-secondary",children:["Due ",P(i.nextTaskDueAt)]})]})]})]}),O.length===0&&(i.sliceTaskCount!==null||i.sliceScope)&&e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,className:"space-y-2",children:[e.jsx("p",{className:"section-kicker",children:Y(i.queueState,D)}),e.jsx("p",{className:"text-body text-secondary",children:we({queueState:i.queueState,blockReason:i.blockReason,sliceScope:i.sliceScope,sliceTaskCount:i.sliceTaskCount})})]})]}),t&&(t.startedAt||t.updatedAt||t.completedAt||t.failedAt)&&e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"section-kicker",children:"Timeline"}),t.scope&&t.scope!=="task"&&e.jsx(ge,{tone:t.scope==="milestone"?"cyan":"lime",children:t.scope}),t.confidence&&e.jsx("div",{className:"flex items-center gap-1 ml-auto",title:`Confidence: ${t.confidence}`,children:Array.from({length:5},(r,d)=>{const{filled:p,color:k}=Ne(t.confidence);return e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full",style:{backgroundColor:d<p?k:"rgba(255,255,255,0.1)"}},d)})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[t.startedAt&&e.jsxs("div",{children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Started"}),e.jsx("p",{className:"mt-0.5 text-caption text-primary",children:P(t.startedAt)})]}),t.completedAt?e.jsxs("div",{children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Completed"}),e.jsx("p",{className:"mt-0.5 text-caption text-primary",children:P(t.completedAt)})]}):t.failedAt?e.jsxs("div",{children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Failed"}),e.jsx("p",{className:"mt-0.5 text-caption text-red-100",children:P(t.failedAt)})]}):t.updatedAt&&t.updatedAt!==t.startedAt?e.jsxs("div",{children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Updated"}),e.jsx("p",{className:"mt-0.5 text-caption text-primary",children:P(t.updatedAt)})]}):null]})]})]}),t&&t.artifactCount>0&&t.artifacts.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,className:"space-y-2",children:[e.jsxs("p",{className:"section-kicker",children:["Artifacts ",e.jsx("span",{className:"text-muted tabular-nums",children:t.artifactCount})]}),e.jsx("div",{className:"space-y-1",children:t.artifacts.map((r,d)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-2 py-1.5 transition-colors hover:bg-white/[0.04]",children:[e.jsx(te,{type:r.type==="pull_request"?"session":"workstream",size:13,className:"flex-shrink-0 opacity-75"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-caption text-primary",children:r.title}),r.url&&e.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0 text-micro text-secondary transition-colors hover:text-white",title:"Open artifact",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})})]},r.id??d))})]})]}),t&&t.decisionCount>0&&e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("p",{className:"section-kicker",children:["Decisions ",e.jsx("span",{className:"text-muted tabular-nums",children:t.decisionCount})]}),t.blockingDecisionCount>0&&e.jsxs("span",{className:"inline-flex rounded-full border px-1.5 py-[0.5px] text-micro font-semibold tabular-nums",style:{color:l.red,borderColor:`${l.red}33`,backgroundColor:`${l.red}14`},children:[t.blockingDecisionCount," blocking"]})]}),t.decisionOptions.length>0&&e.jsx("div",{className:"space-y-1.5",children:t.decisionOptions.slice(0,4).map(r=>e.jsxs("div",{className:"rounded-lg border border-white/[0.06] bg-white/[0.02] px-3 py-2",children:[e.jsx("p",{className:"text-caption font-semibold text-primary",children:r.label}),r.description&&e.jsx("p",{className:"mt-0.5 text-micro leading-snug text-secondary",children:r.description})]},r.id))})]})]}),t&&(t.sliceRunId||t.runId)&&e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:f++,children:[e.jsx("p",{className:"section-kicker mb-2",children:"Notes"}),e.jsx(fe,{entityType:"run",entityId:t.runId??t.sliceRunId,variant:"inline"})]})]}),t&&(t.sourceClient||t.runtimeState||t.correlationId||t.runId)&&e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"flex cursor-pointer select-none items-center gap-1.5 py-1 text-micro uppercase tracking-[0.08em] text-muted transition-colors hover:text-secondary",children:[e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"transition-transform group-open:rotate-90",children:e.jsx("path",{d:"m9 18 6-6-6-6"})}),"Technical details"]}),e.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-x-4 gap-y-2",children:[t.sourceClient&&e.jsxs("div",{children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Source"}),e.jsx("p",{className:"mt-0.5 font-mono text-caption text-primary",children:t.sourceClient})]}),t.runtimeState&&e.jsxs("div",{children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Runtime State"}),e.jsx("p",{className:"mt-0.5 font-mono text-caption text-primary",children:t.runtimeState})]}),t.runId&&e.jsxs("div",{className:"col-span-2",children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Run ID"}),e.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(t.runId)},className:"mt-0.5 font-mono text-caption text-primary transition-colors hover:text-white",title:"Click to copy",children:t.runId})]}),t.correlationId&&t.correlationId!==t.runId&&e.jsxs("div",{className:"col-span-2",children:[e.jsx("p",{className:"text-micro uppercase tracking-[0.08em] text-muted",children:"Correlation ID"}),e.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(t.correlationId)},className:"mt-0.5 font-mono text-caption text-primary transition-colors hover:text-white",title:"Click to copy",children:t.correlationId})]})]})]})]}),W?e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsx("p",{className:"text-caption text-red-200/80",children:W})]}):null]})})]})})}export{Ee as SliceDetailModal};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,j as e}from"./cNrhgGc1.js";import{d as l,r as p,E as h,W as u}from"./D-bf6hEI.js";import{DecisionQueue as b}from"./CZZTvkQZ.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";import"./CxQ08qFN.js";import"./DNxKz-GV.js";import"./CFGKRAzG.js";function C({open:n,onClose:a,decisions:t,onApproveDecision:i,onRejectDecision:d,onApproveAll:m,onBulkDecisionAction:x}){const r=o.useMemo(()=>t.length>0?Math.max(0,...t.map(c=>c.waitingMinutes)):0,[t]),s=o.useMemo(()=>t.length>=20||r>=15?l.red:t.length>0?l.amber:l.textMuted,[t.length,r]);return e.jsx(p,{open:n,onClose:a,maxWidth:"max-w-3xl",children:e.jsxs("div",{className:"flex h-full w-full flex-col",children:[e.jsx("div",{className:"border-b border-subtle px-5 pt-5 pb-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"inline-flex items-center gap-2 text-heading font-semibold text-white",children:[e.jsx(h,{type:"decision",size:14}),e.jsx("span",{className:"truncate",children:"Decisions"}),e.jsx("span",{className:"rounded-full border px-2 py-0.5 text-caption font-semibold",style:{borderColor:`${s}30`,backgroundColor:`${s}14`,color:s},children:t.length})]}),e.jsx("p",{className:"mt-1 text-body leading-relaxed text-secondary",children:"Bulk review and resolve pending decisions."}),t.length>0&&e.jsxs("p",{className:"mt-2 text-caption text-secondary",children:["Oldest: ",e.jsxs("span",{className:"font-semibold text-white",children:[u(r)," ago"]})]})]}),e.jsx("button",{type:"button",onClick:a,className:"rounded-md border border-strong bg-white/[0.03] px-2.5 py-1.5 text-caption text-primary transition-colors hover:bg-white/[0.08]","aria-label":"Close decisions modal",children:"Close"})]})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden p-4",children:e.jsx(b,{decisions:t,onApproveDecision:i,onRejectDecision:d,onApproveAll:m,onBulkDecisionAction:x})})]})})}export{C as BulkDecisionsModal};
|
|
Binary file
|
|
Binary file
|