@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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as f}from"./Dj2k1r16.js";import{a4 as he,e as u,O as fe,a5 as te,a6 as ge,y as be,a7 as ke,A as ve,m as ye,C as T,a8 as je,a9 as we,aa as Ne,v as E,E as ie,S as Ie}from"./BV2Tf8S2.js";import{E as Ce}from"./BGY6oI8h.js";import{m as g,A as Te}from"./eeHXe_OQ.js";import{M as Fe}from"./BCudUvwg.js";import{f as Se,g as se,w as ne}from"./wa4jJQK9.js";import"./DMKyYAtD.js";import"./cX2e-TLi.js";import"./BjK42gtU.js";import"./BV0BcV1u.js";function Ae(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:u.lime}:s.includes("doc")||s.includes("spec")||s.includes("document")||s.includes("proposal")?{label:"doc",color:u.teal}:s.includes("design")||s.includes("a11y")||s.includes("accessibility")?{label:"design",color:u.iris}:s.includes("test")||s.includes("experiment")?{label:"test",color:u.cyan}:s.includes("config")||s.includes("decision")||s.includes("routing")||s.includes("runbook")||s.includes("incident")?{label:"config",color:u.amber}:s.includes("marketing")||s.includes("qualification")||s.includes("sales")?{label:s.includes("marketing")?"marketing":"sales",color:u.teal}:{label:n.slice(0,12),color:"rgba(255,255,255,0.5)"}}function Be({artifacts:n,onOpenArtifact:s,className:l}){return n.length===0?null:e.jsxs("div",{className:l,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(g.div,{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",initial:"hidden",animate:"visible",variants:{visible:{transition:{staggerChildren:.04}}},children:n.map((d,k)=>{const x=Ae(d.type);return e.jsxs(g.button,{type:"button",onClick:()=>s==null?void 0:s(d),className:"subsection-shell rounded-xl px-3.5 py-3 text-left hover-lift",variants:he,custom:k,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-widest",style:{color:x.color,backgroundColor:`${x.color}18`,border:`1px solid ${x.color}30`},children:x.label})}),e.jsx("p",{className:"mt-1.5 text-body font-medium text-white truncate",children:d.title})]},d.id??`artifact-${k}`)})})]})}function M(n){return n.toLowerCase().trim().replace(/\.\s*$/,"").replace(/\s+/g," ")}function Ee(n){var j,w,N;const s=new Set,l=((j=n.statusExplainer)==null?void 0:j.trim())||null;l&&s.add(M(l));const d=((w=n.summary)==null?void 0:w.trim())||null,k=d!=null&&!s.has(M(d));d&&s.add(M(d));const x=((N=n.lastEventSummary)==null?void 0:N.trim())||null,F=x!=null&&!s.has(M(x));return{outcome:l,whatHappened:k?d:null,lastActivity:F?x:null}}function De(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 l=n.artifacts??[];for(const d of l.slice(0,3))s.push(`· ${d.title} (${d.type})`);l.length>3&&s.push(`· and ${l.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}function D(n){return n===0?u.red:n===1?u.amber:n===2?u.iris:"rgba(255,255,255,0.5)"}function L(n){return n===0?"P0":n===1?"P1":n===2?"P2":n===3?"P3":""}function Re(n){switch(n){case"high":return{filled:5,color:u.lime};case"medium":return{filled:3,color:u.amber};case"low":return{filled:1,color:u.red};default:return{filled:0,color:u.iris}}}async function $e(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 l=await fetch("/orgx/api/live/terminal/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!l.ok){const d=await l.json().catch(()=>({}));throw new Error(d.error??`Terminal open failed (${l.status})`)}}const _e={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}}},y={hidden:{opacity:0,y:8},visible:n=>({opacity:1,y:0,transition:{duration:.22,delay:n*.04,ease:ye.easingStandard}}),exit:{opacity:0,transition:{duration:.18}}};function ae(n){var d,k,x,F,j,w,N,S;if(n.source==="queue"){const{item:r,linkedSliceRun:c}=n;return{initiativeId:r.initiativeId,initiativeTitle:T(r.initiativeTitle),initiativeStatus:r.initiativeStatus,workstreamId:r.workstreamId,workstreamTitle:T(r.workstreamTitle),workstreamStatus:r.workstreamStatus,nextTaskTitle:r.nextTaskTitle?T(r.nextTaskTitle):null,nextTaskPriority:r.nextTaskPriority,nextTaskDueAt:r.nextTaskDueAt,agentId:r.runnerAgentId,agentName:r.runnerAgentName,agentSource:r.runnerSource,queueState:r.queueState,blockReason:r.blockReason?T(r.blockReason):null,sliceScope:r.sliceScope??null,sliceTaskCount:typeof r.sliceTaskCount=="number"&&Number.isFinite(r.sliceTaskCount)?Math.max(0,Math.floor(r.sliceTaskCount)):((d=r.sliceTaskIds)==null?void 0:d.length)??null,autoContinue:r.autoContinue,milestoneBreakdown:r.milestoneBreakdown??null,sliceRun:c,sessionId:null,runId:(c==null?void 0:c.runId)??null}}if(n.source==="in_progress"){const{row:r,sliceRun:c}=n;return{initiativeId:r.initiativeId,initiativeTitle:r.initiativeTitle?T(r.initiativeTitle):null,initiativeStatus:null,workstreamId:r.workstreamId,workstreamTitle:r.workstreamTitle?T(r.workstreamTitle):r.title,workstreamStatus:r.status,nextTaskTitle:null,nextTaskPriority:null,nextTaskDueAt:null,agentId:((k=r.session)==null?void 0:k.agentId)??null,agentName:((x=r.session)==null?void 0:x.agentName)??"OrgX",agentSource:null,queueState:r.status==="running"?"running":"queued",blockReason:null,sliceScope:(c==null?void 0:c.scope)??null,sliceTaskCount:typeof((F=c==null?void 0:c.scopeProgress)==null?void 0:F.totalTasks)=="number"?Math.max(0,Math.floor(c.scopeProgress.totalTasks-c.scopeProgress.completedTasks)):((j=c==null?void 0:c.taskIds)==null?void 0:j.length)??null,autoContinue:null,milestoneBreakdown:null,sliceRun:c,sessionId:((w=r.session)==null?void 0:w.id)??null,runId:r.runId}}const{sliceRun:s}=n,l=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?T(s.workstreamTitle):"Work slice",workstreamStatus:s.status,nextTaskTitle:null,nextTaskPriority:null,nextTaskDueAt:null,agentId:null,agentName:l,agentSource:s.sourceClient,queueState:s.status==="needs_review"?"completed":"blocked",blockReason:s.status==="failed"&&s.statusExplainer||null,sliceScope:s.scope??null,sliceTaskCount:typeof((N=s.scopeProgress)==null?void 0:N.totalTasks)=="number"?Math.max(0,Math.floor(s.scopeProgress.totalTasks-s.scopeProgress.completedTasks)):((S=s.taskIds)==null?void 0:S.length)??null,autoContinue:null,milestoneBreakdown:null,sliceRun:s,sessionId:null,runId:s.runId}}function C(){return e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-white/[0.06] to-transparent"})}function Xe({target:n,onClose:s,onPlayWorkstream:l,onStartAutoContinue:d,onMoveWorkstream:k,onRemoveFromQueue:x,onOpenSession:F,onFocusRunId:j,onOpenInitiative:w,onReviewActivity:N,onOpenDecisions:S,onAcceptSlice:r,onRejectSlice:c,initiatives:J=[]}){var Q,ee;const R=n!==null,[re,z]=f.useState(!1),[qe,O]=f.useState(null),[p,A]=f.useState(null),[$,_]=f.useState(""),[q,I]=f.useState(null),X=f.useRef(null),K=f.useCallback(a=>{if(n&&(a.metaKey||a.ctrlKey)&&a.key==="Enter"){a.preventDefault();const o=ae(n);o.initiativeId&&o.workstreamId&&(l==null||l(o.initiativeId,o.workstreamId,o.agentId??void 0))}},[n,l]);f.useEffect(()=>{if(R)return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[R,K]),f.useEffect(()=>{R||(O(null),z(!1),A(null),_(""),I(null))},[R]),f.useEffect(()=>{p&&requestAnimationFrame(()=>{var a;(a=X.current)==null||a.focus()})},[p]);const oe=f.useMemo(()=>{const a=new Map;for(const o of J)o.id&&a.set(o.id,o.name??o.id);return a},[J]);if(!n)return null;const i=ae(n);!i.initiativeTitle&&i.initiativeId&&(i.initiativeTitle=oe.get(i.initiativeId)??null);const t=i.sliceRun,b=fe({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}),le=b.status==="completed"?"text-lime border-lime/30 bg-lime/[0.12]":b.status==="failed"?"text-red-200 border-red-400/30 bg-red-500/[0.12]":b.status==="needs_attention"?"text-amber-200 border-amber-400/30 bg-amber-500/[0.12]":b.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]",ce=b.tone==="critical"?"border-red-400/24 bg-red-500/[0.08]":b.tone==="warning"?"border-amber-400/24 bg-amber-500/[0.08]":b.tone==="positive"?"border-lime/24 bg-lime/[0.08]":"border-subtle bg-white/[0.02]",de=[...i.initiativeTitle?[{label:i.initiativeTitle,onClick:i.initiativeId?()=>w==null?void 0:w(i.initiativeId):void 0}]:[],{label:i.workstreamTitle}],G=b.status==="in_progress",ue=!!(i.initiativeId&&i.workstreamId&&!G),Z=b.nextAction??(n.source==="needs_input"&&t?t.primaryAction==="resolve_decision"?"Resolve decision":t.primaryAction==="open_artifact"?"Open result":"Review activity":null),H=(()=>{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})(),W="ring-1 ring-[#BFFF00]/40 shadow-[0_0_8px_rgba(191,255,0,0.15)]",me=f.useCallback(async a=>{try{O(null),z(!0),await $e(a)}catch(o){O(o instanceof Error?o.message:"Unable to open terminal")}finally{z(!1)}},[]),Y=f.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]),xe=Y!==null,U=f.useMemo(()=>t!=null&&t.scopeProgress?te({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?ge(i.milestoneBreakdown):te({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]),P=n.source==="needs_input"&&(t==null?void 0:t.status)==="needs_review",V=f.useCallback(async()=>{if(!t||!p)return;const a=$.trim(),o=t.runId??t.sliceRunId;if(p==="accept")try{I("Accepting…");const m=a?`Accepted: ${a}`:"Accepted from dashboard",h=await fetch(`/orgx/api/runs/${encodeURIComponent(o)}/actions/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:m})});if(!h.ok){const B=await h.json().catch(()=>null);I(`Error: ${(B==null?void 0:B.error)??(B==null?void 0:B.message)??h.status}`);return}I("Accepted!");try{r==null||r(t,a||void 0)}catch{}setTimeout(()=>s(),600)}catch(m){I(`Failed: ${m instanceof Error?m.message:"network error"}`)}else if(p==="reject"&&a)try{I("Sending feedback…");const m=await fetch(`/orgx/api/entities/run/${encodeURIComponent(o)}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:a,commentType:"review_feedback",severity:"warn",tags:["changes_requested"]})});if(!m.ok){const h=await m.json().catch(()=>null);I(`Error: ${(h==null?void 0:h.error)??(h==null?void 0:h.message)??m.status}`);return}I("Feedback sent!");try{c==null||c(t,a)}catch{}A(null),_("")}catch(m){I(`Failed: ${m instanceof Error?m.message:"network error"}`)}},[t,p,$,r,c,s]),pe=e.jsxs("div",{className:"space-y-2",children:[q&&e.jsx("div",{className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11px] font-medium ${q.startsWith("Error")||q.startsWith("Failed")?"bg-[#FF6B88]/10 text-[#FF6B88]":q.includes("…")?"bg-white/[0.04] text-white/60 animate-pulse":"bg-[#BFFF00]/10 text-[#BFFF00]"}`,children:q}),e.jsx(Te,{children:p&&e.jsx(g.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:X,value:$,onChange:a=>_(a.target.value),onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&(a.preventDefault(),V()),a.key==="Escape"&&(a.preventDefault(),A(null),_(""))},placeholder:p==="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),_("")},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:p==="reject"&&!$.trim()?"Note required":"⌘Enter to confirm"}),e.jsx("button",{type:"button",onClick:V,disabled:p==="reject"&&!$.trim(),className:`inline-flex h-7 items-center gap-1 rounded-md px-3 text-[11px] font-semibold transition-colors disabled:opacity-30 ${p==="accept"?"bg-[#BFFF00]/12 text-[#BFFF00] hover:bg-[#BFFF00]/20":"bg-[#FF6B88]/12 text-[#FF6B88] hover:bg-[#FF6B88]/20"}`,children:p==="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:()=>{x==null||x(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:()=>k==null?void 0:k(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:()=>{F==null||F(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:()=>{S==null||S(),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] ${H==="resolve_decision"?W:""}`,children:"Resolve decision"}),n.source==="needs_input"&&t&&e.jsx("button",{type:"button",onClick:()=>{N==null||N(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 ${H==="review"?W:""}`,children:"Review"}),i.runId&&e.jsx("button",{type:"button",onClick:()=>{j==null||j(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:[P&&c&&e.jsx("button",{type:"button",onClick:()=>A(p==="reject"?null:"reject"),className:`rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors ${p==="reject"?"bg-[#FF6B88]/12 text-[#FF6B88]":"text-white/35 hover:bg-white/[0.04] hover:text-white/60"}`,children:"Request changes"}),P&&r&&e.jsxs("button",{type:"button",onClick:()=>{p==="accept"?V():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"]}),ue&&e.jsxs("button",{type:"button","data-modal-autofocus":"true",onClick:()=>{l==null||l(i.initiativeId,i.workstreamId,i.agentId??void 0),s()},className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-[#BFFF00]/25 bg-[#BFFF00]/10 px-4 text-[12px] font-semibold text-[#E1FFB2] transition-colors hover:bg-[#BFFF00]/20 ${H==="start"?"ring-1 ring-[#BFFF00]/50 shadow-[0_0_10px_rgba(191,255,0,0.2)]":""}`,title:"Start (⌘ 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"})}),b.status==="completed"?"Restart":b.status==="needs_attention"?"Retry":"Start"]}),xe&&e.jsx("button",{type:"button",onClick:()=>void me(Y),disabled:re,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 v=0;return e.jsx(be,{open:R,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:Se(i.queueState),"aria-hidden":!0}),e.jsx(ke,{breadcrumbs:de,onClose:s,footer:pe,children:e.jsxs("div",{className:"px-6 py-5 space-y-5",children:[e.jsxs(g.div,{variants:_e,initial:"hidden",animate:"visible",exit:"exit",custom:v++,className:"flex items-start gap-3",children:[e.jsx(ve,{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-[28px] font-medium leading-none text-white truncate",children:i.workstreamTitle}),i.initiativeTitle&&e.jsx("p",{className:"mt-1 text-[10px] uppercase tracking-[0.1em] 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-[1px] text-micro font-semibold uppercase tracking-widest ${le}`,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:se(i.queueState)}}),G&&e.jsx(g.span,{className:"absolute inset-0 rounded-full",style:{backgroundColor:se(i.queueState)},animate:{opacity:[1,.3,1],scale:[1,1.6,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}})]}),b.label]}),(t==null?void 0:t.confidence)&&e.jsx("span",{className:`chip text-[9px] font-semibold ${t.confidence==="high"?"border-[#BFFF00]/30 bg-[#BFFF00]/[0.12] text-[#d8ffa1]":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(Fe,{metrics:[...t.startedAt?[{label:"Duration",value:(()=>{const a=t.completedAt??t.failedAt??t.updatedAt??new Date().toISOString(),o=Date.parse(a)-Date.parse(t.startedAt);return o<6e4?`${Math.round(o/1e3)}s`:o<36e5?`${Math.round(o/6e4)}m`:`${(o/36e5).toFixed(1)}h`})()}]:[],...t.artifactCount>0?[{label:"Artifacts",value:t.artifactCount,color:u.teal}]:[],...t.decisionCount>0?[{label:"Decisions",value:t.decisionCount,color:u.amber}]:[]],className:"pb-4 border-b border-white/[0.04]"}),t&&t.artifacts.length>0&&e.jsx(Be,{artifacts:t.artifacts}),e.jsx(C,{}),n.source==="needs_input"&&t?(()=>{const a=Ee({statusExplainer:t.statusExplainer,summary:i.blockReason,lastEventSummary:t.lastEventSummary}),m=De({lifecycleState:t.status,artifactCount:t.artifactCount,artifacts:t.artifacts.map(h=>({title:h.title,type:h.type??"unknown"})),statusExplainer:t.statusExplainer,confidence:t.confidence})??a.outcome;return e.jsxs(e.Fragment,{children:[e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,className:`rounded-xl border px-4 py-3 ${ce}`,children:[e.jsx("p",{className:"section-kicker",children:"What to do now"}),e.jsx("p",{className:"mt-1 text-body text-primary",children:b.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,Z?e.jsxs("p",{className:"mt-1 text-caption text-[#BFFF00]/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: ",Z]}):null]}),m&&e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,children:[e.jsx("p",{className:"section-kicker",children:"Outcome"}),e.jsx("p",{className:"mt-1 text-body text-secondary leading-relaxed",children:T(m)})]}),a.lastActivity&&e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,children:[e.jsx("p",{className:"section-kicker",children:"Last activity"}),e.jsx("p",{className:"mt-1 text-caption text-white/50 leading-relaxed",children:T(a.lastActivity)})]}),e.jsx(C,{})]})})():null,(i.blockReason||i.autoContinue||i.agentSource&&i.agentSource!=="assigned")&&e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,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:[" · ",je(i.autoContinue.laneState)]})]})]}),((Q=i.autoContinue)==null?void 0:Q.laneBlockedReason)&&e.jsx("p",{className:"text-micro text-red-100/75",children:i.autoContinue.laneBlockedReason}),((ee=i.autoContinue)==null?void 0:ee.stopReason)&&e.jsx("p",{className:"text-micro text-amber-100/75",children:we(i.autoContinue.stopReason)})]}),U.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(C,{}),e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,className:"space-y-2",children:[e.jsx("p",{className:"section-kicker",children:ne(i.queueState,P)}),e.jsx(Ne,{nodes:U}),e.jsxs("div",{className:"flex items-center gap-2",children:[i.nextTaskPriority!==null&&L(i.nextTaskPriority)&&e.jsx("span",{className:"inline-flex rounded-full border px-2 py-[1px] text-micro font-semibold",style:{color:D(i.nextTaskPriority),borderColor:`${D(i.nextTaskPriority)}33`,backgroundColor:`${D(i.nextTaskPriority)}14`},children:L(i.nextTaskPriority)}),i.nextTaskDueAt&&e.jsxs("span",{className:"text-micro text-secondary",children:["Due ",E(i.nextTaskDueAt)]})]})]})]}),U.length===0&&(i.nextTaskTitle||i.sliceTaskCount!==null||i.sliceScope)&&e.jsxs(e.Fragment,{children:[e.jsx(C,{}),e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,className:"space-y-2",children:[e.jsx("p",{className:"section-kicker",children:ne(i.queueState,P)}),i.nextTaskTitle&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ie,{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-[1px] 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-[1px] text-micro text-secondary",children:[i.sliceTaskCount," ",i.sliceTaskCount===1?"task":"tasks"," in scope"]}):null,i.nextTaskPriority!==null&&L(i.nextTaskPriority)&&e.jsx("span",{className:"inline-flex rounded-full border px-2 py-[1px] text-micro font-semibold",style:{color:D(i.nextTaskPriority),borderColor:`${D(i.nextTaskPriority)}33`,backgroundColor:`${D(i.nextTaskPriority)}14`},children:L(i.nextTaskPriority)}),i.nextTaskDueAt&&e.jsxs("span",{className:"text-micro text-secondary",children:["Due ",E(i.nextTaskDueAt)]})]})]})]}),t&&(t.startedAt||t.updatedAt||t.completedAt||t.failedAt)&&e.jsxs(e.Fragment,{children:[e.jsx(C,{}),e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,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(Ie,{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,o)=>{const{filled:m,color:h}=Re(t.confidence);return e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full",style:{backgroundColor:o<m?h:"rgba(255,255,255,0.1)"}},o)})})]}),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:E(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:E(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:E(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:E(t.updatedAt)})]}):null]})]})]}),t&&t.artifactCount>0&&t.artifacts.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(C,{}),e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,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,o)=>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(ie,{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??o))})]})]}),t&&t.decisionCount>0&&e.jsxs(e.Fragment,{children:[e.jsx(C,{}),e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,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:u.red,borderColor:`${u.red}33`,backgroundColor:`${u.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(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(C,{}),e.jsxs(g.div,{variants:y,initial:"hidden",animate:"visible",exit:"exit",custom:v++,children:[e.jsx("p",{className:"section-kicker mb-2",children:"Notes"}),e.jsx(Ce,{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(C,{}),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{Xe as SliceDetailModal};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e}from"./Dj2k1r16.js";import{A as j,m as y}from"./eeHXe_OQ.js";function w(t){switch(t){case"decision_required":return"Decision required";case"blocked_intervention":return"Blocked — needs intervention";case"review_required":return"Review required";case"failure_diagnostic":return"Failure diagnostic";default:return t}}function f(t){switch(t){case"critical":return"#FF6B6B";case"high":return"#F5B700";case"medium":return"#0AD4C4";default:return"#8B8FA3"}}function b({children:t}){return e.jsx("h4",{className:"text-micro font-semibold uppercase tracking-wider text-muted mb-1.5",children:t})}function v({item:t}){const s=t.proofBundle;return s.artifactRefs.length>0||s.fileChanges.length>0||s.prRefs.length>0||s.logRefs.length>0||s.decisionRefs.length>0?e.jsxs("div",{children:[e.jsx(b,{children:"Proof"}),e.jsxs("div",{className:"space-y-1",children:[s.prRefs.map((r,n)=>e.jsx(x,{icon:"pr",label:r},`pr-${n}`)),s.fileChanges.map((r,n)=>e.jsx(x,{icon:"file",label:r},`file-${n}`)),s.artifactRefs.map((r,n)=>e.jsx(x,{icon:"artifact",label:r},`art-${n}`)),s.logRefs.map((r,n)=>e.jsx(x,{icon:"log",label:r},`log-${n}`)),s.decisionRefs.map((r,n)=>e.jsx(x,{icon:"decision",label:r},`dec-${n}`))]})]}):null}function x({icon:t,label:s}){const i=t==="pr"?"⎇":t==="file"?"◇":t==="log"?"▸":t==="decision"?"◈":"▪";return e.jsxs("div",{className:"flex items-center gap-2 rounded bg-white/[0.03] px-2 py-1 text-caption text-secondary",children:[e.jsx("span",{className:"text-muted flex-shrink-0 w-4 text-center",children:i}),e.jsx("span",{className:"truncate",children:s})]})}function k({item:t}){const{impact:s}=t;return s.initiativeCount===0&&s.workstreamCount===0&&s.downstreamBlockedCount===0?null:e.jsxs("div",{children:[e.jsx(b,{children:"Impact if ignored"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.initiativeCount>0&&e.jsx(h,{label:`${s.initiativeCount} initiative${s.initiativeCount>1?"s":""}`}),s.workstreamCount>0&&e.jsx(h,{label:`${s.workstreamCount} workstream${s.workstreamCount>1?"s":""}`}),s.downstreamBlockedCount>0&&e.jsx(h,{label:`${s.downstreamBlockedCount} blocked downstream`,tone:"red"})]})]})}function h({label:t,tone:s="amber"}){const i=s==="red"?"bg-[#FF6B6B]/14":"bg-[#F5B700]/14",r=s==="red"?"text-[#FFA8A8]":"text-[#FFE7A8]";return e.jsx("span",{className:`rounded-full px-2 py-0.5 text-micro font-medium ${i} ${r}`,children:t})}function g({triageAction:t,onPerform:s,isActing:i}){const[r,n]=d.useState(!1),[l,p]=d.useState(""),o=t.action==="approve"||t.action==="autofix",c=t.action==="dismiss",a=o?"bg-[#0AD4C4]/20 text-[#7AEDE5] hover:bg-[#0AD4C4]/30":c?"bg-[#FF6B6B]/14 text-[#FFA8A8] hover:bg-[#FF6B6B]/20":"bg-white/[0.08] text-secondary hover:bg-white/[0.12]";return t.available?t.requiresNote&&r?e.jsxs("div",{className:"flex flex-col gap-1.5 w-full",children:[e.jsx("textarea",{value:l,onChange:u=>p(u.target.value),placeholder:"Add a note...",className:"w-full rounded-lg border border-subtle bg-white/[0.04] px-2.5 py-1.5 text-caption text-primary placeholder:text-muted resize-none",rows:2}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("button",{type:"button",onClick:()=>s(t.action,l),disabled:i,className:`rounded-lg px-3 py-1 text-caption font-medium transition-colors disabled:opacity-40 ${a}`,children:"Confirm"}),e.jsx("button",{type:"button",onClick:()=>n(!1),className:"text-caption text-muted hover:text-secondary",children:"Cancel"})]})]}):e.jsxs("button",{type:"button",onClick:()=>{t.requiresNote?n(!0):s(t.action)},disabled:i,className:`rounded-lg px-3 py-1.5 text-caption font-medium transition-colors disabled:opacity-40 ${a}`,title:t.consequences,children:[e.jsx("span",{children:t.label}),e.jsxs("span",{className:"ml-1 text-micro opacity-60",children:["— ",t.consequences]})]}):e.jsx("button",{type:"button",disabled:!0,className:"rounded-lg px-3 py-1.5 text-caption font-medium opacity-30 bg-white/[0.06] text-muted cursor-not-allowed",title:"Not available",children:t.label})}function C({item:t}){const[s,i]=d.useState(!1),r=[["ID",t.id],["Kind",t.kind],["Dedupe key",t.dedupeKey],["Source system",t.sourceSystem],["Conflict source",t.conflictSource],["Agent ID",t.agentId],["Source decision",t.sourceDecisionId],["Source activity",t.sourceActivityId],["First seen",t.firstSeenAt],["Last seen",t.lastSeenAt],["Created",t.createdAt]].filter(([,n])=>n!=null);return e.jsxs("div",{className:"border-t border-subtle pt-2",children:[e.jsxs("button",{type:"button",onClick:()=>i(n=>!n),className:"flex w-full items-center justify-between text-micro font-semibold uppercase tracking-wider text-muted hover:text-secondary transition-colors",children:[e.jsx("span",{children:"Technical details"}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`transition-transform ${s?"rotate-180":""}`,children:e.jsx("path",{d:"m6 9 6 6 6-6"})})]}),s&&e.jsx("div",{className:"mt-2 space-y-0.5",children:r.map(([n,l])=>e.jsxs("div",{className:"flex gap-2 text-micro",children:[e.jsx("span",{className:"text-muted w-28 flex-shrink-0",children:n}),e.jsx("span",{className:"text-secondary truncate",children:l})]},n))})]})}function D({item:t,actions:s,onClose:i,onNavigate:r,currentIndex:n,totalCount:l}){const p=d.useRef(null);d.useEffect(()=>{if(!t)return;const c=a=>{var m;const u=(m=a.target)==null?void 0:m.tagName;if(!(u==="INPUT"||u==="TEXTAREA"))switch(a.key){case"j":case"ArrowRight":a.preventDefault(),r==null||r(1);break;case"k":case"ArrowLeft":a.preventDefault(),r==null||r(-1);break;case"a":a.preventDefault(),o("approve");break;case"d":a.preventDefault(),o("dismiss");break;case"r":a.preventDefault(),o("retry");break;case"s":a.preventDefault(),o("snooze");break;case"Escape":a.preventDefault(),i();break}};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[t,r,i]);const o=d.useCallback(async(c,a)=>{if(t)try{await s.performAction(t.id,c,{note:a}),r==null||r(1)}catch{}},[t,s,r]);return t?e.jsx(j,{mode:"wait",children:e.jsxs(y.div,{ref:p,initial:{opacity:0,x:44,scale:.985},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:-44,scale:.985},transition:{duration:.28},className:"flex h-full min-h-0 flex-col overflow-y-auto px-5 pb-5 pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[r&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>r(-1),className:"rounded p-1 text-muted hover:text-secondary hover:bg-white/[0.06] transition-colors",title:"Previous (k)",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"m15 18-6-6 6-6"})})}),e.jsx("button",{type:"button",onClick:()=>r(1),className:"rounded p-1 text-muted hover:text-secondary hover:bg-white/[0.06] transition-colors",title:"Next (j)",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"m9 18 6-6-6-6"})})})]}),n!=null&&l!=null&&e.jsxs("span",{className:"text-micro text-muted tabular-nums",children:[n+1," of ",l]})]}),e.jsx("button",{type:"button",onClick:i,className:"rounded p-1 text-muted hover:text-secondary hover:bg-white/[0.06] transition-colors",title:"Close (Esc)",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),(t.initiativeTitle||t.workstreamTitle)&&e.jsx("p",{className:"text-micro text-muted mb-1",children:[t.initiativeTitle,t.workstreamTitle,t.taskTitle].filter(Boolean).join(" › ")}),e.jsxs("div",{className:"mb-4 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"text-heading font-semibold text-primary",children:t.title}),e.jsx("span",{className:"flex-shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",style:{backgroundColor:`${f(t.severity)}20`,color:f(t.severity)},children:w(t.kind)})]}),e.jsxs("div",{className:"flex items-center gap-2 text-caption text-secondary",children:[t.agentId&&e.jsx("span",{className:"rounded bg-white/[0.06] px-1.5 py-0.5 text-micro font-medium text-secondary",children:t.agentId}),t.occurrenceCount>1&&e.jsxs("span",{className:"text-micro text-muted",children:["x",t.occurrenceCount," occurrences"]})]}),e.jsx("p",{className:"text-body text-secondary leading-relaxed",children:t.summary})]}),e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-white/[0.06] to-transparent mb-4"}),e.jsx("div",{className:"space-y-4 mb-4",children:e.jsx(v,{item:t})}),e.jsx("div",{className:"mb-4",children:e.jsx(k,{item:t})}),e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"space-y-1.5",children:t.actionContract.map(c=>e.jsx(g,{triageAction:c,onPerform:o,isActing:s.isActing},c.action))}),t.recommendedAction&&e.jsxs("p",{className:"mt-2 text-micro text-[#7AEDE5]",children:["Recommended: ",t.recommendedAction]})]}),e.jsx(C,{item:t}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-x-3 gap-y-1 text-micro text-muted opacity-60",children:[e.jsx("span",{children:"j/k nav"}),e.jsx("span",{children:"a approve"}),e.jsx("span",{children:"d dismiss"}),e.jsx("span",{children:"r retry"}),e.jsx("span",{children:"s snooze"}),e.jsx("span",{children:"esc close"})]})]},t.id)}):null}export{D as TriageDetailModal};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|