@useorgx/openclaw-plugin 0.7.20 → 0.7.24
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/dashboard/dist/assets/B6VftyY6.js +1 -0
- package/dashboard/dist/assets/B6VftyY6.js.br +0 -0
- package/dashboard/dist/assets/B6VftyY6.js.gz +0 -0
- package/dashboard/dist/assets/{Dm0CfDGr.js → BANQdlC4.js} +1 -1
- package/dashboard/dist/assets/BANQdlC4.js.br +0 -0
- package/dashboard/dist/assets/BANQdlC4.js.gz +0 -0
- package/dashboard/dist/assets/{_zpQCpjm.js → BPL4CL3c.js} +1 -1
- package/dashboard/dist/assets/BPL4CL3c.js.br +0 -0
- package/dashboard/dist/assets/BPL4CL3c.js.gz +0 -0
- package/dashboard/dist/assets/{DXVs61e1.js → BZCkOZ20.js} +1 -1
- package/dashboard/dist/assets/BZCkOZ20.js.br +0 -0
- package/dashboard/dist/assets/BZCkOZ20.js.gz +0 -0
- package/dashboard/dist/assets/{BYb6DARX.js → B_LdOJUa.js} +1 -1
- package/dashboard/dist/assets/B_LdOJUa.js.br +0 -0
- package/dashboard/dist/assets/B_LdOJUa.js.gz +0 -0
- package/dashboard/dist/assets/Bfp-wdwb.css +1 -0
- package/dashboard/dist/assets/Bfp-wdwb.css.br +0 -0
- package/dashboard/dist/assets/Bfp-wdwb.css.gz +0 -0
- package/dashboard/dist/assets/{DibzNd0I.js → BvFcH_Iy.js} +1 -1
- package/dashboard/dist/assets/BvFcH_Iy.js.br +0 -0
- package/dashboard/dist/assets/BvFcH_Iy.js.gz +0 -0
- package/dashboard/dist/assets/By0MIBj_.js +1 -0
- package/dashboard/dist/assets/By0MIBj_.js.br +0 -0
- package/dashboard/dist/assets/By0MIBj_.js.gz +0 -0
- package/dashboard/dist/assets/C0i7ABUU.js +212 -0
- package/dashboard/dist/assets/C0i7ABUU.js.br +0 -0
- package/dashboard/dist/assets/C0i7ABUU.js.gz +0 -0
- package/dashboard/dist/assets/CFB0MM7j.js +1 -0
- package/dashboard/dist/assets/CFB0MM7j.js.br +0 -0
- package/dashboard/dist/assets/CFB0MM7j.js.gz +0 -0
- package/dashboard/dist/assets/CQSRb1yu.js +1 -0
- package/dashboard/dist/assets/CQSRb1yu.js.br +0 -0
- package/dashboard/dist/assets/CQSRb1yu.js.gz +0 -0
- package/dashboard/dist/assets/{wa4jJQK9.js → CUoQoSm-.js} +1 -1
- package/dashboard/dist/assets/CUoQoSm-.js.br +0 -0
- package/dashboard/dist/assets/CUoQoSm-.js.gz +0 -0
- package/dashboard/dist/assets/Ckd1R1iE.js +1 -0
- package/dashboard/dist/assets/Ckd1R1iE.js.br +0 -0
- package/dashboard/dist/assets/Ckd1R1iE.js.gz +0 -0
- package/dashboard/dist/assets/{BGY6oI8h.js → CqRNb2EL.js} +1 -1
- package/dashboard/dist/assets/CqRNb2EL.js.br +0 -0
- package/dashboard/dist/assets/CqRNb2EL.js.gz +0 -0
- package/dashboard/dist/assets/{DAr4MfFk.js → DClUc9rw.js} +1 -1
- package/dashboard/dist/assets/DClUc9rw.js.br +0 -0
- package/dashboard/dist/assets/DClUc9rw.js.gz +0 -0
- package/dashboard/dist/assets/DF2PMTwT.js +1 -0
- package/dashboard/dist/assets/DF2PMTwT.js.br +0 -0
- package/dashboard/dist/assets/DF2PMTwT.js.gz +0 -0
- package/dashboard/dist/assets/{B014hrCe.js → DJYl7gyA.js} +2 -2
- package/dashboard/dist/assets/DJYl7gyA.js.br +0 -0
- package/dashboard/dist/assets/DJYl7gyA.js.gz +0 -0
- package/dashboard/dist/assets/{BoDhb8_y.js → DZtNMX0t.js} +2 -2
- package/dashboard/dist/assets/DZtNMX0t.js.br +0 -0
- package/dashboard/dist/assets/DZtNMX0t.js.gz +0 -0
- package/dashboard/dist/assets/DlEa8PI0.js +1 -0
- package/dashboard/dist/assets/DlEa8PI0.js.br +0 -0
- package/dashboard/dist/assets/DlEa8PI0.js.gz +0 -0
- package/dashboard/dist/assets/M4QxcXjh.js +1 -0
- package/dashboard/dist/assets/M4QxcXjh.js.br +0 -0
- package/dashboard/dist/assets/M4QxcXjh.js.gz +0 -0
- package/dashboard/dist/assets/{CV0sWMbv.js → MrW1ixGx.js} +1 -1
- package/dashboard/dist/assets/MrW1ixGx.js.br +0 -0
- package/dashboard/dist/assets/MrW1ixGx.js.gz +0 -0
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/index.html.br +0 -0
- package/dashboard/dist/index.html.gz +0 -0
- package/dist/activity-store.js +68 -8
- package/dist/agent-run-store.js +162 -24
- package/dist/cli/orgx.d.ts +3 -0
- package/dist/config/resolution.d.ts +7 -0
- package/dist/config/resolution.js +13 -5
- package/dist/contracts/onboarding-state.d.ts +2 -0
- package/dist/contracts/onboarding-state.js +23 -0
- package/dist/contracts/shared-types.d.ts +45 -0
- package/dist/http/helpers/auto-continue-engine.d.ts +23 -0
- package/dist/http/helpers/auto-continue-engine.js +468 -85
- package/dist/http/helpers/autopilot-runtime.js +5 -1
- package/dist/http/helpers/autopilot-slice-utils.js +25 -1
- package/dist/http/helpers/decision-mapper.d.ts +1 -0
- package/dist/http/helpers/decision-mapper.js +19 -2
- package/dist/http/helpers/dispatch-lifecycle.js +3 -0
- package/dist/http/helpers/mission-control.d.ts +1 -0
- package/dist/http/helpers/mission-control.js +5 -2
- package/dist/http/helpers/slice-run-projections.d.ts +27 -0
- package/dist/http/helpers/slice-run-projections.js +198 -10
- package/dist/http/helpers/triage-mapper.js +499 -6
- package/dist/http/helpers/value-utils.d.ts +1 -0
- package/dist/http/helpers/value-utils.js +17 -0
- package/dist/http/index.d.ts +1 -0
- package/dist/http/index.js +179 -46
- package/dist/http/router.js +64 -9
- package/dist/http/routes/live-legacy.d.ts +19 -2
- package/dist/http/routes/live-legacy.js +110 -27
- package/dist/http/routes/live-snapshot.d.ts +16 -2
- package/dist/http/routes/live-snapshot.js +169 -25
- package/dist/http/routes/live-triage.js +6 -1
- package/dist/http/routes/mission-control-actions.d.ts +9 -0
- package/dist/http/routes/mission-control-actions.js +185 -7
- package/dist/http/routes/mission-control-read.d.ts +13 -0
- package/dist/http/routes/mission-control-read.js +100 -219
- package/dist/http/routes/onboarding.d.ts +1 -0
- package/dist/http/routes/onboarding.js +17 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +199 -123
- package/dist/outbox.d.ts +0 -2
- package/dist/outbox.js +259 -148
- package/dist/reporting/rollups.js +18 -11
- package/dist/runtime-instance-store.js +212 -58
- package/dist/stores/materialized-snapshot-store.d.ts +18 -0
- package/dist/stores/materialized-snapshot-store.js +91 -0
- package/dist/stores/sqlite-state.d.ts +6 -0
- package/dist/stores/sqlite-state.js +330 -0
- package/package.json +5 -1
- package/dashboard/dist/assets/B014hrCe.js.br +0 -0
- package/dashboard/dist/assets/B014hrCe.js.gz +0 -0
- package/dashboard/dist/assets/BCudUvwg.js +0 -1
- package/dashboard/dist/assets/BCudUvwg.js.br +0 -0
- package/dashboard/dist/assets/BCudUvwg.js.gz +0 -0
- package/dashboard/dist/assets/BGY6oI8h.js.br +0 -0
- package/dashboard/dist/assets/BGY6oI8h.js.gz +0 -0
- package/dashboard/dist/assets/BJI1Iy5v.css +0 -1
- package/dashboard/dist/assets/BJI1Iy5v.css.br +0 -0
- package/dashboard/dist/assets/BJI1Iy5v.css.gz +0 -0
- package/dashboard/dist/assets/BUvcp_7V.js +0 -1
- package/dashboard/dist/assets/BUvcp_7V.js.br +0 -0
- package/dashboard/dist/assets/BUvcp_7V.js.gz +0 -0
- package/dashboard/dist/assets/BV2Tf8S2.js +0 -212
- package/dashboard/dist/assets/BV2Tf8S2.js.br +0 -0
- package/dashboard/dist/assets/BV2Tf8S2.js.gz +0 -0
- package/dashboard/dist/assets/BYb6DARX.js.br +0 -0
- package/dashboard/dist/assets/BYb6DARX.js.gz +0 -0
- package/dashboard/dist/assets/BoDhb8_y.js.br +0 -0
- package/dashboard/dist/assets/BoDhb8_y.js.gz +0 -0
- package/dashboard/dist/assets/Bqk_l0k6.js +0 -1
- package/dashboard/dist/assets/Bqk_l0k6.js.br +0 -0
- package/dashboard/dist/assets/Bqk_l0k6.js.gz +0 -0
- package/dashboard/dist/assets/C-MOJWHs.js +0 -1
- package/dashboard/dist/assets/C-MOJWHs.js.br +0 -0
- package/dashboard/dist/assets/C-MOJWHs.js.gz +0 -0
- package/dashboard/dist/assets/CV0sWMbv.js.br +0 -0
- package/dashboard/dist/assets/CV0sWMbv.js.gz +0 -0
- package/dashboard/dist/assets/CaAkScfa.js +0 -1
- package/dashboard/dist/assets/CaAkScfa.js.br +0 -0
- package/dashboard/dist/assets/CaAkScfa.js.gz +0 -0
- package/dashboard/dist/assets/Ck5KlsPN.js +0 -1
- package/dashboard/dist/assets/Ck5KlsPN.js.br +0 -0
- package/dashboard/dist/assets/Ck5KlsPN.js.gz +0 -0
- package/dashboard/dist/assets/D2G51wQm.js +0 -1
- package/dashboard/dist/assets/D2G51wQm.js.br +0 -0
- package/dashboard/dist/assets/D2G51wQm.js.gz +0 -0
- package/dashboard/dist/assets/DAr4MfFk.js.br +0 -0
- package/dashboard/dist/assets/DAr4MfFk.js.gz +0 -0
- package/dashboard/dist/assets/DXVs61e1.js.br +0 -0
- package/dashboard/dist/assets/DXVs61e1.js.gz +0 -0
- package/dashboard/dist/assets/DibzNd0I.js.br +0 -0
- package/dashboard/dist/assets/DibzNd0I.js.gz +0 -0
- package/dashboard/dist/assets/Dm0CfDGr.js.br +0 -0
- package/dashboard/dist/assets/Dm0CfDGr.js.gz +0 -0
- package/dashboard/dist/assets/_zpQCpjm.js.br +0 -0
- package/dashboard/dist/assets/_zpQCpjm.js.gz +0 -0
- package/dashboard/dist/assets/uNGpYMSH.js +0 -1
- package/dashboard/dist/assets/uNGpYMSH.js.br +0 -0
- package/dashboard/dist/assets/uNGpYMSH.js.gz +0 -0
- package/dashboard/dist/assets/wa4jJQK9.js.br +0 -0
- package/dashboard/dist/assets/wa4jJQK9.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as b}from"./Dj2k1r16.js";import{a7 as ke,f as p,Q as ye,a8 as ne,a9 as ve,z as je,aa as we,A as Ne,n as Ie,D as A,ab as Te,ac as Ce,ad as Se,w as F,E as ae,T as Ae}from"./C0i7ABUU.js";import{E as Re}from"./CqRNb2EL.js";import{m as h,A as De}from"./eeHXe_OQ.js";import{M as $e}from"./By0MIBj_.js";import{f as Ee,g as re,w as le}from"./CUoQoSm-.js";import"./DMKyYAtD.js";import"./cX2e-TLi.js";import"./BjK42gtU.js";import"./BV0BcV1u.js";function Fe(n){if(!n)return{label:"artifact",color:"rgba(255,255,255,0.4)"};const s=n.toLowerCase();return s.includes("code")||s.includes("pr")||s.includes("pull_request")||s.includes("commit")?{label:"code",color:p.lime}:s.includes("doc")||s.includes("spec")||s.includes("document")||s.includes("proposal")?{label:"doc",color:p.teal}:s.includes("design")||s.includes("a11y")||s.includes("accessibility")?{label:"design",color:p.iris}:s.includes("test")||s.includes("experiment")?{label:"test",color:p.cyan}:s.includes("config")||s.includes("decision")||s.includes("routing")||s.includes("runbook")||s.includes("incident")?{label:"config",color:p.amber}:s.includes("marketing")||s.includes("qualification")||s.includes("sales")?{label:s.includes("marketing")?"marketing":"sales",color:p.teal}:{label:n.slice(0,12),color:"rgba(255,255,255,0.5)"}}function qe({artifacts:n,onOpenArtifact:s,className:o}){return n.length===0?null:e.jsxs("div",{className:o,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"section-kicker font-semibold",children:"Artifacts"}),e.jsx("span",{className:"chip text-micro",children:n.length})]}),e.jsx(h.div,{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",initial:"hidden",animate:"visible",variants:{visible:{transition:{staggerChildren:.04}}},children:n.map((x,v)=>{const g=Fe(x.type);return e.jsxs(h.button,{type:"button",onClick:()=>s==null?void 0:s(x),className:"subsection-shell rounded-xl px-3.5 py-3 text-left hover-lift",variants:ke,custom:v,children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-[0.08em]",style:{color:g.color,backgroundColor:`${g.color}18`,border:`1px solid ${g.color}30`},children:g.label})}),e.jsx("p",{className:"mt-1.5 text-body font-medium text-white truncate",children:x.title})]},x.id??`artifact-${v}`)})})]})}function z(n){return n.toLowerCase().trim().replace(/\.\s*$/,"").replace(/\s+/g," ")}function _e(n){var N,I,T;const s=new Set,o=((N=n.statusExplainer)==null?void 0:N.trim())||null;o&&s.add(z(o));const x=((I=n.summary)==null?void 0:I.trim())||null,v=x!=null&&!s.has(z(x));x&&s.add(z(x));const g=((T=n.lastEventSummary)==null?void 0:T.trim())||null,R=g!=null&&!s.has(z(g));return{outcome:o,whatHappened:v?x:null,lastActivity:R?g:null}}function Be(n){const s=[];if(n.lifecycleState==="completed"&&n.artifactCount===0)s.push("Completed but produced no artifacts."),s.push("This may indicate the agent finished analysis without outputting structured results."),n.statusExplainer&&s.push(n.statusExplainer);else if(n.lifecycleState==="completed"&&n.artifactCount>0){s.push(`Completed with ${n.artifactCount} artifact${n.artifactCount>1?"s":""}.`);const o=n.artifacts??[];for(const x of o.slice(0,3))s.push(`· ${x.title} (${x.type})`);o.length>3&&s.push(`· and ${o.length-3} more`)}else n.lifecycleState==="failed"?(s.push("Failed during execution."),n.statusExplainer&&s.push(n.statusExplainer)):n.lifecycleState==="awaiting_input"&&(s.push("Waiting for input before continuing."),n.statusExplainer&&s.push(n.statusExplainer));return s.length>0?s.join(" "):null}const Pe=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent);function q(n){return n===0?p.red:n===1?p.amber:n===2?p.iris:"rgba(255,255,255,0.5)"}function O(n){return n===0?"P0":n===1?"P1":n===2?"P2":n===3?"P3":""}function Le(n){switch(n){case"high":return{filled:5,color:p.lime};case"medium":return{filled:3,color:p.amber};case"low":return{filled:1,color:p.red};default:return{filled:0,color:p.iris}}}async function Me(n){const s={};if(n.runId&&(s.runId=n.runId),n.sliceRunId&&(s.sliceRunId=n.sliceRunId),n.sessionId&&(s.sessionId=n.sessionId),Object.keys(s).length===0)throw new Error("No run identifier available for terminal open.");const o=await fetch("/orgx/api/live/terminal/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok){const x=await o.json().catch(()=>({}));throw new Error(x.error??`Terminal open failed (${o.status})`)}}const ze={hidden:{opacity:0,y:-4},visible:n=>({opacity:1,y:0,transition:{duration:.28,delay:n*.04,ease:[.16,1,.3,1]}}),exit:{opacity:0,transition:{duration:.18}}},j={hidden:{opacity:0,y:8},visible:n=>({opacity:1,y:0,transition:{duration:.22,delay:n*.04,ease:Ie.easingStandard}}),exit:{opacity:0,transition:{duration:.18}}};function oe(n){var v,g,R,N,I,T,$,D;if(n.source==="queue"){const{item:r,linkedSliceRun:m}=n;return{initiativeId:r.initiativeId,initiativeTitle:A(r.initiativeTitle),initiativeStatus:r.initiativeStatus,workstreamId:r.workstreamId,workstreamTitle:A(r.workstreamTitle),workstreamStatus:r.workstreamStatus,nextTaskTitle:r.nextTaskTitle?A(r.nextTaskTitle):null,nextTaskPriority:r.nextTaskPriority,nextTaskDueAt:r.nextTaskDueAt,agentId:r.runnerAgentId,agentName:r.runnerAgentName,agentSource:r.runnerSource,queueState:r.queueState,blockReason:r.blockReason?A(r.blockReason):null,sliceScope:r.sliceScope??null,sliceTaskCount:typeof r.sliceTaskCount=="number"&&Number.isFinite(r.sliceTaskCount)?Math.max(0,Math.floor(r.sliceTaskCount)):((v=r.sliceTaskIds)==null?void 0:v.length)??null,autoContinue:r.autoContinue,canStartNow:typeof r.canStartNow=="boolean"?r.canStartNow:null,startReasonLabel:r.startReasonLabel??null,milestoneBreakdown:r.milestoneBreakdown??null,sliceRun:m,sessionId:null,runId:(m==null?void 0:m.runId)??null}}if(n.source==="in_progress"){const{row:r,sliceRun:m}=n;return{initiativeId:r.initiativeId,initiativeTitle:r.initiativeTitle?A(r.initiativeTitle):null,initiativeStatus:null,workstreamId:r.workstreamId,workstreamTitle:r.workstreamTitle?A(r.workstreamTitle):r.title,workstreamStatus:r.status,nextTaskTitle:null,nextTaskPriority:null,nextTaskDueAt:null,agentId:((g=r.session)==null?void 0:g.agentId)??null,agentName:((R=r.session)==null?void 0:R.agentName)??"OrgX",agentSource:null,queueState:r.status==="running"?"running":"queued",blockReason:null,sliceScope:(m==null?void 0:m.scope)??null,sliceTaskCount:typeof((N=m==null?void 0:m.scopeProgress)==null?void 0:N.totalTasks)=="number"?Math.max(0,Math.floor(m.scopeProgress.totalTasks-m.scopeProgress.completedTasks)):((I=m==null?void 0:m.taskIds)==null?void 0:I.length)??null,autoContinue:null,canStartNow:null,startReasonLabel:null,milestoneBreakdown:null,sliceRun:m,sessionId:((T=r.session)==null?void 0:T.id)??null,runId:r.runId}}const{sliceRun:s}=n,o=Array.isArray(s.blockers)&&s.blockers.length>0?s.blockers[0]:null,x=s.sourceClient?s.sourceClient.charAt(0).toUpperCase()+s.sourceClient.slice(1):"OrgX";return{initiativeId:s.initiativeId,initiativeTitle:null,initiativeStatus:null,workstreamId:s.workstreamId,workstreamTitle:s.workstreamTitle?A(s.workstreamTitle):"Work slice",workstreamStatus:s.status,nextTaskTitle:null,nextTaskPriority:null,nextTaskDueAt:null,agentId:null,agentName:x,agentSource:s.sourceClient,queueState:s.status==="needs_review"?"completed":"blocked",blockReason:(o==null?void 0:o.reason)??(s.status==="failed"&&s.statusExplainer||null),sliceScope:s.scope??null,sliceTaskCount:typeof(($=s.scopeProgress)==null?void 0:$.totalTasks)=="number"?Math.max(0,Math.floor(s.scopeProgress.totalTasks-s.scopeProgress.completedTasks)):((D=s.taskIds)==null?void 0:D.length)??null,autoContinue:null,canStartNow:null,startReasonLabel:null,milestoneBreakdown:null,sliceRun:s,sessionId:null,runId:s.runId}}function S(){return e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-white/[0.06] to-transparent"})}function Qe({target:n,onClose:s,onPlayWorkstream:o,onStartAutoContinue:x,onMoveWorkstream:v,onRemoveFromQueue:g,onOpenSession:R,onFocusRunId:N,onOpenInitiative:I,onReviewActivity:T,onOpenDecisions:$,onAcceptSlice:D,onRejectSlice:r,initiatives:m=[]}){var te,ie,se;const _=n!==null,[ce,K]=b.useState(!1),[Oe,H]=b.useState(null),[f,E]=b.useState(null),[B,P]=b.useState(""),[L,C]=b.useState(null),G=b.useRef(null),U=b.useCallback(a=>{if(n&&(a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault();const l=oe(n),c=l.initiativeId,d=l.workstreamId;c&&d&&(n.source!=="queue"||l.canStartNow!==!1)&&c&&d&&(o==null||o(c,d,l.agentId??void 0))}},[n,o]);b.useEffect(()=>{if(_)return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[_,U]),b.useEffect(()=>{_||(H(null),K(!1),E(null),P(""),C(null))},[_]),b.useEffect(()=>{f&&requestAnimationFrame(()=>{var a;(a=G.current)==null||a.focus()})},[f]);const de=b.useMemo(()=>{const a=new Map;for(const l of m)l.id&&a.set(l.id,l.name??l.id);return a},[m]);if(!n)return null;const i=oe(n);!i.initiativeTitle&&i.initiativeId&&(i.initiativeTitle=de.get(i.initiativeId)??null);const t=i.sliceRun,k=ye({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}),ue=k.status==="completed"?"text-lime border-lime/30 bg-lime/[0.12]":k.status==="failed"?"text-red-200 border-red-400/30 bg-red-500/[0.12]":k.status==="needs_attention"?"text-amber-200 border-amber-400/30 bg-amber-500/[0.12]":k.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]",me=k.tone==="critical"?"border-red-400/24 bg-red-500/[0.08]":k.tone==="warning"?"border-amber-400/24 bg-amber-500/[0.08]":k.tone==="positive"?"border-lime/24 bg-lime/[0.08]":"border-subtle bg-white/[0.02]",xe=[...i.initiativeTitle?[{label:i.initiativeTitle,onClick:i.initiativeId?()=>I==null?void 0:I(i.initiativeId):void 0}]:[],{label:i.workstreamTitle}],Z=k.status==="in_progress",pe=!!(i.initiativeId&&i.workstreamId&&!Z&&(n.source!=="queue"||i.canStartNow!==!1)),W=k.status==="completed"?"Restart":k.status==="needs_attention"?"Retry":"Start",he=n.source==="queue"&&typeof i.startReasonLabel=="string"&&i.startReasonLabel.trim().length>0?i.startReasonLabel.trim():W,Y=k.nextAction??(n.source==="needs_input"&&t?t.primaryAction==="resolve_decision"?"Resolve decision":t.primaryAction==="open_artifact"?"Open result":"Review activity":null),V=(()=>{const a=(t==null?void 0:t.primaryAction)??null;return!a||a==="none"?null:a==="resolve_decision"?"resolve_decision":a==="open_artifact"||a==="review_output"?"review":a==="retry_slice"?"start":null})(),Q="ring-1 ring-lime/40 shadow-[0_0_8px_rgba(191,255,0,0.15)]",ge=b.useCallback(async a=>{try{H(null),K(!0),await Me(a)}catch(l){H(l instanceof Error?l.message:"Unable to open terminal")}finally{K(!1)}},[]),ee=b.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]),fe=ee!==null,J=b.useMemo(()=>t!=null&&t.scopeProgress?ne({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.scopeProgress,status:(t==null?void 0:t.status)??i.queueState,agentName:i.agentName,agentId:i.agentId}):i.milestoneBreakdown&&i.milestoneBreakdown.length>0?ve(i.milestoneBreakdown):ne({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: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,i.milestoneBreakdown]),M=n.source==="needs_input"&&(t==null?void 0:t.status)==="needs_review",X=b.useCallback(async()=>{if(!t||!f)return;const a=B.trim(),l=t.runId??t.sliceRunId;if(f==="accept")try{C("Accepting…");const c=a?`Accepted: ${a}`:"Accepted from dashboard",d=await fetch(`/orgx/api/runs/${encodeURIComponent(l)}/actions/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:c})});if(!d.ok){const w=await d.json().catch(()=>null);C(`Error: ${(w==null?void 0:w.error)??(w==null?void 0:w.message)??d.status}`);return}C("Accepted!");try{D==null||D(t,a||void 0)}catch{}setTimeout(()=>s(),600)}catch(c){C(`Failed: ${c instanceof Error?c.message:"network error"}`)}else if(f==="reject"&&a)try{C("Sending feedback…");const c=await fetch(`/orgx/api/entities/run/${encodeURIComponent(l)}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:a,commentType:"review_feedback",severity:"warn",tags:["changes_requested"]})});if(!c.ok){const d=await c.json().catch(()=>null);C(`Error: ${(d==null?void 0:d.error)??(d==null?void 0:d.message)??c.status}`);return}C("Feedback sent!");try{r==null||r(t,a)}catch{}E(null),P("")}catch(c){C(`Failed: ${c instanceof Error?c.message:"network error"}`)}},[t,f,B,D,r,s]),be=e.jsxs("div",{className:"space-y-2",children:[L&&e.jsx("div",{className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11px] font-medium ${L.startsWith("Error")||L.startsWith("Failed")?"bg-[#FF6B88]/10 text-[#FF6B88]":L.includes("…")?"bg-white/[0.04] text-white/60 animate-pulse":"bg-lime/10 text-lime"}`,children:L}),e.jsx(De,{children:f&&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:G,value:B,onChange:a=>P(a.target.value),onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&(a.preventDefault(),X()),a.key==="Escape"&&(a.preventDefault(),E(null),P(""))},placeholder:f==="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:()=>{E(null),P("")},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-micro text-white/20",children:f==="reject"&&!B.trim()?"Note required":"⌘Enter to confirm"}),e.jsx("button",{type:"button",onClick:X,disabled:f==="reject"&&!B.trim(),className:`inline-flex h-7 items-center gap-1 rounded-md px-3 text-[11px] font-semibold transition-colors disabled:opacity-30 ${f==="accept"?"bg-lime/12 text-lime hover:bg-lime/20":"bg-[#FF6B88]/12 text-[#FF6B88] hover:bg-[#FF6B88]/20"}`,children:f==="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:[n.source==="queue"&&i.initiativeId&&i.workstreamId&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>{g==null||g(i.initiativeId,i.workstreamId),s()},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:()=>v==null?void 0:v(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"})]}),n.source==="in_progress"&&i.sessionId&&e.jsx("button",{type:"button",onClick:()=>{R==null||R(i.sessionId),s()},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"}),n.source==="needs_input"&&t&&t.primaryAction==="resolve_decision"&&e.jsx("button",{type:"button",onClick:()=>{$==null||$(),s()},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] ${V==="resolve_decision"?Q:""}`,children:"Resolve decision"}),n.source==="needs_input"&&t&&e.jsx("button",{type:"button",onClick:()=>{T==null||T(t),s()},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 ${V==="review"?Q:""}`,children:"Review"}),i.runId&&e.jsx("button",{type:"button",onClick:()=>{N==null||N(i.runId),s()},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"})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[M&&r&&e.jsx("button",{type:"button",onClick:()=>E(f==="reject"?null:"reject"),className:`rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors ${f==="reject"?"bg-[#FF6B88]/12 text-[#FF6B88]":"text-white/35 hover:bg-white/[0.04] hover:text-white/60"}`,children:"Request changes"}),M&&D&&e.jsxs("button",{type:"button",onClick:()=>{f==="accept"?X():E("accept")},className:"inline-flex h-8 items-center gap-1.5 rounded-lg bg-lime/12 px-4 text-[12px] font-semibold text-lime transition-colors hover:bg-lime/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"]}),pe&&e.jsxs("button",{type:"button","data-modal-autofocus":"true",onClick:()=>{o==null||o(i.initiativeId,i.workstreamId,i.agentId??void 0),s()},className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-lime/25 bg-lime/10 px-4 text-[12px] font-semibold text-lime transition-colors hover:bg-lime/20 ${V==="start"?"ring-1 ring-lime/50 shadow-[0_0_10px_rgba(191,255,0,0.2)]":""}`,title:`${he} (${Pe?"⌘":"Ctrl"} 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"})}),W]}),fe&&e.jsx("button",{type:"button",onClick:()=>void ge(ee),disabled:ce,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"})]})})]})]})]});let y=0;return e.jsx(je,{open:_,onClose:s,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:Ee(i.queueState),"aria-hidden":!0}),e.jsx(we,{breadcrumbs:xe,onClose:s,footer:be,children:e.jsxs("div",{className:"px-6 py-5 space-y-5",children:[e.jsxs(h.div,{variants:ze,initial:"hidden",animate:"visible",exit:"exit",custom:y++,className:"flex items-start gap-3",children:[e.jsx(Ne,{name:i.agentName??"OrgX",hint:i.agentSource??i.agentId,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"text-display font-medium leading-none text-white truncate",children:i.workstreamTitle}),i.initiativeTitle&&e.jsx("p",{className:"mt-1 text-micro uppercase tracking-[0.08em] text-muted",children:i.initiativeTitle}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[e.jsxs("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-micro font-semibold uppercase tracking-[0.08em] ${ue}`,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:re(i.queueState)}}),Z&&e.jsx(h.span,{className:"absolute inset-0 rounded-full",style:{backgroundColor:re(i.queueState)},animate:{opacity:[1,.3,1],scale:[1,1.6,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}})]}),k.label]}),(t==null?void 0:t.confidence)&&e.jsx("span",{className:`chip text-[9px] font-semibold ${t.confidence==="high"?"border-lime/30 bg-lime/[0.12] text-lime":t.confidence==="medium"?"border-[#F5B700]/30 bg-[#F5B700]/[0.12] text-[#FFE7A8]":"border-white/[0.12] bg-white/[0.05] text-white/60"}`,children:t.confidence})]}),(t==null?void 0:t.statusExplainer)&&n.source!=="needs_input"&&e.jsx("p",{className:"mt-2 text-body text-secondary",children:t.statusExplainer})]})]}),t&&e.jsx($e,{metrics:[...t.startedAt?[{label:"Duration",value:(()=>{const a=t.completedAt??t.failedAt??t.updatedAt??new Date().toISOString(),l=Date.parse(a)-Date.parse(t.startedAt);return l<6e4?`${Math.round(l/1e3)}s`:l<36e5?`${Math.round(l/6e4)}m`:`${(l/36e5).toFixed(1)}h`})()}]:[],...t.artifactCount>0?[{label:"Artifacts",value:t.artifactCount,color:p.teal}]:[],...t.decisionCount>0?[{label:"Decisions",value:t.decisionCount,color:p.amber}]:[]],className:"pb-4 border-b border-white/[0.04]"}),t&&t.artifacts.length>0&&e.jsx(qe,{artifacts:t.artifacts}),e.jsx(S,{}),n.source==="needs_input"&&t?(()=>{const a=_e({statusExplainer:t.statusExplainer,summary:i.blockReason,lastEventSummary:t.lastEventSummary}),c=Be({lifecycleState:t.status,artifactCount:t.artifactCount,artifacts:t.artifacts.map(u=>({title:u.title,type:u.type??"unknown"})),statusExplainer:t.statusExplainer,confidence:t.confidence})??a.outcome,d=Array.isArray(t.blockers)?t.blockers:[],w=Array.isArray(t.pendingDecisions)?t.pendingDecisions:[];return e.jsxs(e.Fragment,{children:[e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,className:`rounded-xl border px-4 py-3 ${me}`,children:[e.jsx("p",{className:"section-kicker",children:"What to do now"}),e.jsx("p",{className:"mt-1 text-body text-primary",children:k.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,Y?e.jsxs("p",{className:"mt-1 text-caption text-lime/70 flex items-center gap-1",children:[e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Recommended action: ",Y]}):null]}),(d.length>0||w.length>0)&&e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,className:"space-y-2",children:[e.jsx("p",{className:"section-kicker",children:"Intervention brief"}),d.slice(0,3).map(u=>e.jsxs("div",{className:`rounded-lg border px-3 py-2 ${u.severity==="error"?"border-red-400/24 bg-red-500/[0.08]":u.severity==="warn"?"border-amber-300/20 bg-amber-500/[0.08]":"border-white/[0.10] bg-white/[0.03]"}`,children:[e.jsx("p",{className:"text-caption font-semibold text-primary",children:u.reason}),(u.waitingOn||u.requiredAction)&&e.jsxs("p",{className:"mt-1 text-micro text-secondary",children:[u.waitingOn?`Waiting on: ${u.waitingOn}`:null,u.waitingOn&&u.requiredAction?" · ":null,u.requiredAction?`Required action: ${u.requiredAction}`:null]})]},u.id)),w.slice(0,2).map(u=>e.jsxs("div",{className:"rounded-lg border border-amber-300/16 bg-amber-500/[0.06] px-3 py-2",children:[e.jsx("p",{className:"text-caption font-semibold text-primary",children:u.title}),u.summary&&e.jsx("p",{className:"mt-1 text-micro text-secondary leading-relaxed",children:u.summary}),u.recommendedAction&&e.jsxs("p",{className:"mt-1 text-micro text-amber-100/80",children:["Recommended: ",u.recommendedAction]})]},u.id))]}),c&&e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,children:[e.jsx("p",{className:"section-kicker",children:"Outcome"}),e.jsx("p",{className:"mt-1 text-body text-secondary leading-relaxed",children:A(c)})]}),a.lastActivity&&e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,children:[e.jsx("p",{className:"section-kicker",children:"Last activity"}),e.jsx("p",{className:"mt-1 text-caption text-white/50 leading-relaxed",children:A(a.lastActivity)})]}),e.jsx(S,{})]})})():null,(i.blockReason||i.autoContinue||i.agentSource&&i.agentSource!=="assigned")&&e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,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:[" · ",Te(i.autoContinue.laneState)]})]})]}),((te=i.autoContinue)==null?void 0:te.laneBlockedReason)&&e.jsx("p",{className:"text-micro text-red-100/75",children:i.autoContinue.laneBlockedReason}),((ie=i.autoContinue)==null?void 0:ie.stopReason)&&e.jsx("p",{className:"text-micro text-amber-100/75",children:Ce(i.autoContinue.stopReason)})]}),J.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,className:"space-y-2",children:[e.jsx("p",{className:"section-kicker",children:le(i.queueState,M)}),e.jsx(Se,{nodes:J}),e.jsxs("div",{className:"flex items-center gap-2",children:[i.nextTaskPriority!==null&&O(i.nextTaskPriority)&&e.jsx("span",{className:"inline-flex rounded-full border px-2 py-0.5 text-micro font-semibold",style:{color:q(i.nextTaskPriority),borderColor:`${q(i.nextTaskPriority)}33`,backgroundColor:`${q(i.nextTaskPriority)}14`},children:O(i.nextTaskPriority)}),i.nextTaskDueAt&&e.jsxs("span",{className:"text-micro text-secondary",children:["Due ",F(i.nextTaskDueAt)]})]})]})]}),J.length===0&&(i.nextTaskTitle||i.sliceTaskCount!==null||i.sliceScope)&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,className:"space-y-2",children:[e.jsx("p",{className:"section-kicker",children:le(i.queueState,M)}),i.nextTaskTitle&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ae,{type:"task",size:14,className:"mt-[2px] flex-shrink-0 opacity-80"}),e.jsx("p",{className:"text-body font-semibold leading-snug text-white",children:i.nextTaskTitle})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[i.sliceScope?e.jsxs("span",{className:"inline-flex rounded-full border border-strong bg-white/[0.03] px-2 py-0.5 text-micro uppercase tracking-[0.08em] text-secondary",children:[i.sliceScope," slice"]}):null,typeof i.sliceTaskCount=="number"?e.jsxs("span",{className:"inline-flex rounded-full border border-strong bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[i.sliceTaskCount," ",i.sliceTaskCount===1?"task":"tasks"," in scope"]}):null,i.nextTaskPriority!==null&&O(i.nextTaskPriority)&&e.jsx("span",{className:"inline-flex rounded-full border px-2 py-0.5 text-micro font-semibold",style:{color:q(i.nextTaskPriority),borderColor:`${q(i.nextTaskPriority)}33`,backgroundColor:`${q(i.nextTaskPriority)}14`},children:O(i.nextTaskPriority)}),i.nextTaskDueAt&&e.jsxs("span",{className:"text-micro text-secondary",children:["Due ",F(i.nextTaskDueAt)]})]})]})]}),t&&(t.startedAt||t.updatedAt||t.completedAt||t.failedAt)&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,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(Ae,{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},(a,l)=>{const{filled:c,color:d}=Le(t.confidence);return e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full",style:{backgroundColor:l<c?d:"rgba(255,255,255,0.1)"}},l)})})]}),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:F(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:F(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:F(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:F(t.updatedAt)})]}):null]})]})]}),t&&t.artifactCount>0&&t.artifacts.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,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((a,l)=>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(ae,{type:a.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:a.title}),a.url&&e.jsx("a",{href:a.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"})]})})]},a.id??l))})]})]}),t&&(t.decisionCount>0||(((se=t.pendingDecisions)==null?void 0:se.length)??0)>0)&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,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:p.red,borderColor:`${p.red}33`,backgroundColor:`${p.red}14`},children:[t.blockingDecisionCount," blocking"]})]}),Array.isArray(t.pendingDecisions)&&t.pendingDecisions.length>0&&e.jsx("div",{className:"space-y-2",children:t.pendingDecisions.slice(0,4).map(a=>{var l,c;return e.jsxs("div",{className:"rounded-lg border border-white/[0.08] bg-white/[0.03] px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"text-caption font-semibold text-primary",children:a.title}),e.jsx("span",{className:`inline-flex rounded-full border px-1.5 py-[0.5px] text-micro font-semibold ${a.blocking?"border-red-400/30 bg-red-500/[0.12] text-red-100":"border-amber-300/25 bg-amber-400/[0.10] text-amber-100"}`,children:a.blocking?"Blocking":"Advisory"})]}),a.summary&&e.jsx("p",{className:"mt-1 text-micro leading-relaxed text-secondary",children:a.summary}),(a.recommendedAction||(((l=a.options)==null?void 0:l.length)??0)>0)&&e.jsxs("div",{className:"mt-1.5 space-y-1",children:[a.recommendedAction&&e.jsxs("p",{className:"text-micro text-lime/75",children:["Recommended: ",a.recommendedAction]}),(((c=a.options)==null?void 0:c.length)??0)>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.options.slice(0,3).map(d=>e.jsx("span",{className:"rounded-full border border-white/[0.12] bg-white/[0.04] px-2 py-0.5 text-micro text-secondary",children:d.label},`${a.id}:${d.id}`))})]})]},a.id)})}),t.decisionOptions.length>0&&e.jsx("div",{className:"space-y-1.5",children:t.decisionOptions.slice(0,4).map(a=>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:a.label}),a.description&&e.jsx("p",{className:"mt-0.5 text-micro leading-snug text-secondary",children:a.description})]},a.id))})]})]}),t&&(t.sliceRunId||t.runId)&&e.jsxs(e.Fragment,{children:[e.jsx(S,{}),e.jsxs(h.div,{variants:j,initial:"hidden",animate:"visible",exit:"exit",custom:y++,children:[e.jsx("p",{className:"section-kicker mb-2",children:"Notes"}),e.jsx(Re,{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(S,{}),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})]})]})]})]})]})})]})})}export{Qe as SliceDetailModal};
|
|
Binary file
|
|
Binary file
|