@usine/server 0.4.1-next.271.g56e79a7 → 0.4.1-next.272.g460d50b
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/dist/web/assets/_agent-Cw6Z7PzB.js +1 -0
- package/dist/web/assets/{_label-B2hIQTiP.js → _label-fBgFxqQu.js} +1 -1
- package/dist/web/assets/{_loop-DvEDblaI.js → _loop-BaVDLXdq.js} +1 -1
- package/dist/web/assets/{_name-z-THY2_h.js → _name-BoaroXx6.js} +1 -1
- package/dist/web/assets/_name-CG4NWmDX.js +1 -0
- package/dist/web/assets/_name-Cgv7dq8J.js +1 -0
- package/dist/web/assets/{_name-DXMuBR5m.js → _name-DjOsR1wa.js} +1 -1
- package/dist/web/assets/{_number-DPBp5g17.js → _number-B6kcfPyE.js} +1 -1
- package/dist/web/assets/_number-Cgv7dq8J.js +1 -0
- package/dist/web/assets/{_number-DdeVk37S.js → _number-DpApgqPz.js} +1 -1
- package/dist/web/assets/{_run-CdbRrREt.js → _run-CWA7U7XL.js} +1 -1
- package/dist/web/assets/_run-Cgv7dq8J.js +1 -0
- package/dist/web/assets/{_worker-Kb3E2cex.js → _worker-CNb5sBQ9.js} +1 -1
- package/dist/web/assets/{action-BbYQzHVY.js → action-D2OJs-sY.js} +1 -1
- package/dist/web/assets/{agents-ySzr8fy8.js → agents-wpEFn7pf.js} +1 -1
- package/dist/web/assets/{agents-aKrqbR-m.js → agents-xos6B13a.js} +1 -1
- package/dist/web/assets/{code-block-CjNdHwJz.js → code-block-B2d_uzFL.js} +1 -1
- package/dist/web/assets/{collapsible-iYmFtriP.js → collapsible-3pEMAhq9.js} +1 -1
- package/dist/web/assets/{drawer-jppXFu1P.js → drawer-B-F_fcAf.js} +1 -1
- package/dist/web/assets/{dropdown-menu-CFZLqcex.js → dropdown-menu-C-3ehl95.js} +1 -1
- package/dist/web/assets/{edit-and-retry-DE8DjLVA.js → edit-and-retry-DePAvp50.js} +1 -1
- package/dist/web/assets/{error-alert-BVIxPJFU.js → error-alert-BnIKdDdf.js} +1 -1
- package/dist/web/assets/{file-error-DhZlb2_Y.js → file-error-DuuMTaIr.js} +1 -1
- package/dist/web/assets/{heading-D62nMA3C.js → heading-DrqeC647.js} +1 -1
- package/dist/web/assets/{history-DkNNnV6Y.js → history-BE5iMHPw.js} +1 -1
- package/dist/web/assets/{identity-DlGZ_gKf.js → identity-DBp5VWom.js} +1 -1
- package/dist/web/assets/{index-BdDPka5v.js → index-BokhrH13.js} +3 -3
- package/dist/web/assets/{label-badge-d6omX3Kx.js → label-badge-D96gAMUo.js} +1 -1
- package/dist/web/assets/{labels-B7V9VhjQ.js → labels-TeUqSRg3.js} +1 -1
- package/dist/web/assets/{list-CMj9dgxo.js → list-Cmi9aVAO.js} +1 -1
- package/dist/web/assets/{loops-w6ia_oEU.js → loops-rW8iunYa.js} +1 -1
- package/dist/web/assets/{mark-B8EExm_5.js → mark-Ce_Qn2iu.js} +1 -1
- package/dist/web/assets/{model-0V8C6gKN.js → model-DBl1SZtu.js} +1 -1
- package/dist/web/assets/{moves-B2I_hBZb.js → moves-1Jmz4a60.js} +1 -1
- package/dist/web/assets/{not-found-hL2Tp5vW.js → not-found-c4c84AV-.js} +1 -1
- package/dist/web/assets/{outcome-xmjRsDh1.js → outcome-_-lQG-vg.js} +1 -1
- package/dist/web/assets/overview-DvY74mSl.js +1 -0
- package/dist/web/assets/{page-BLxt7Xfg.js → page-DPqWAN9v.js} +1 -1
- package/dist/web/assets/{pull-request-marks-BIB-F5Bo.js → pull-request-marks-CjsCWxyi.js} +1 -1
- package/dist/web/assets/{repositories-DhkeCOwR.js → repositories-kzdWS-2A.js} +1 -1
- package/dist/web/assets/route-8p3R_NBi.js +1 -0
- package/dist/web/assets/route-BgseOYSN.js +1 -0
- package/dist/web/assets/routes-Cgv7dq8J.js +1 -0
- package/dist/web/assets/{routes-BHwcH9Lh.js → routes-D1Zrcs_K.js} +1 -1
- package/dist/web/assets/{run-again-DSDtftlB.js → run-again-BO19VxAH.js} +1 -1
- package/dist/web/assets/{section-D4djNiAN.js → section-DRfN9XCr.js} +1 -1
- package/dist/web/assets/{section-BP8TxDno.js → section-vDVxGGWA.js} +1 -1
- package/dist/web/assets/{settings-0NNJ2XzL.js → settings-TQ9q1r1D.js} +1 -1
- package/dist/web/assets/{sortable.esm-JyniDt4R.js → sortable.esm-bQYOlGOK.js} +1 -1
- package/dist/web/assets/strings-CKWfinsy.js +311 -0
- package/dist/web/assets/{strings-Bs2WdZYo.js → strings-DqXLM1F0.js} +1 -1
- package/dist/web/assets/tasks-Cgv7dq8J.js +1 -0
- package/dist/web/assets/{tasks-x2oa1Rt3.js → tasks-DB2baTNI.js} +1 -1
- package/dist/web/assets/{usage-C27cuo6g.js → usage-UFmAbcyy.js} +1 -1
- package/dist/web/assets/{useAnchoredPopupScrollLock-DEVFEHhP.js → useAnchoredPopupScrollLock-DjGUmQYV.js} +1 -1
- package/dist/web/assets/{usePositioner-BeAdUrxb.js → usePositioner-C6rcS3NK.js} +1 -1
- package/dist/web/assets/{useScrollLock-77tiYKUD.js → useScrollLock-D5EuDOcC.js} +1 -1
- package/dist/web/assets/{workers-jjiTPmGP.js → workers-BY6cxpO-.js} +1 -1
- package/dist/web/index.html +9 -9
- package/package.json +9 -9
- package/dist/web/assets/_agent-_6-dDU4o.js +0 -1
- package/dist/web/assets/_name-CGGRdFfK.js +0 -1
- package/dist/web/assets/_name-Jq31XnPR.js +0 -1
- package/dist/web/assets/_number-Jq31XnPR.js +0 -1
- package/dist/web/assets/_run-Jq31XnPR.js +0 -1
- package/dist/web/assets/overview-BixI1Gdc.js +0 -1
- package/dist/web/assets/route-D0B3Tsri.js +0 -1
- package/dist/web/assets/route-NFcp08tu.js +0 -1
- package/dist/web/assets/routes-Jq31XnPR.js +0 -1
- package/dist/web/assets/strings-BeaABxX0.js +0 -311
- package/dist/web/assets/tasks-Jq31XnPR.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{T as t,jt as n,u as r}from"./index-BokhrH13.js";import{t as i}from"./agents-xos6B13a.js";var a=e(),o=()=>{let{agent:e}=r.useParams(),{data:o}=n(t());return(0,a.jsx)(i,{name:e,configuration:o})};export{o as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{Y as t,t as n}from"./section-
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{Y as t,t as n}from"./section-DRfN9XCr.js";import{l as r}from"./index-BokhrH13.js";var i=e(),a=()=>{let{label:e}=r.useParams();return(0,i.jsx)(n,{title:e,entity:t(`label`,e),children:null})};export{a as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t,E as n,Y as r,a as i,c as a,i as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h}from"./section-
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t,E as n,Y as r,a as i,c as a,i as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h}from"./section-DRfN9XCr.js";import{t as g}from"./error-alert-BnIKdDdf.js";import{t as _}from"./link-C7GfYrMt.js";import{n as v,r as y}from"./list-Cmi9aVAO.js";import{Pt as b,n as x}from"./strings-CKWfinsy.js";import{Ct as S,T as C,c as w,jt as T,p as E,vt as D}from"./index-BokhrH13.js";import{t as O}from"./file-error-DuuMTaIr.js";var k=e(),A=({repository:e})=>{let{owner:t,name:n}=b(e);return(0,k.jsxs)(_,{to:`/configuration/repositories/$owner/$name`,params:{owner:t,name:n},className:`flex w-fit items-center gap-2 text-primary hover:underline`,children:[(0,k.jsx)(D,{repository:e}),e]})},j=({loop:e,configuration:t})=>{let r=t.agents.find(({name:t})=>t===e.agent);return(0,k.jsxs)(i,{children:[(0,k.jsxs)(o,{label:`Agent`,children:[(0,k.jsx)(_,{to:`/configuration/agents/$agent`,params:{agent:e.agent},className:`text-primary hover:underline`,children:e.agent}),r!==void 0&&(0,k.jsx)(`p`,{className:`mt-0.5 font-mono text-xs text-muted-foreground`,children:x(r)})]}),(0,k.jsx)(o,{label:`Repositories`,children:e.repositories.length===0?(0,k.jsx)(m,{children:`No registered repository matches the selector`}):(0,k.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.repositories.map(e=>(0,k.jsx)(`li`,{children:(0,k.jsx)(A,{repository:e})},e))})}),(0,k.jsx)(o,{label:`Approval`,children:h[e.approval]}),(0,k.jsxs)(o,{label:`Max cycles`,children:[(0,k.jsx)(`span`,{className:`tabular-nums`,children:e.maxCycles}),` `,(0,k.jsx)(m,{children:`runs per item before a reset`})]}),(0,k.jsx)(o,{label:`Permissions`,children:n[e.permissions]}),(0,k.jsx)(o,{label:`Priority`,children:e.priority===null?(0,k.jsx)(m,{children:`None; runs wait in lane order`}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,k.jsx)(m,{children:`queued ahead of runs in lane order`})]})}),(0,k.jsx)(o,{label:`Step`,children:(0,k.jsx)(`code`,{className:`font-mono text-xs`,children:e.step})})]})},M=e=>[[`on`,e.stream],[`if`,e.condition],...e.cron===null?[]:[[`cron`,e.cron]],...e.timeZone===null?[]:[[`tz`,e.timeZone]]],N=({repos:e,tags:t})=>[...e===null?[]:[[`repos`,e.join(`, `)]],...t===null?[]:[[`tags`,t.join(`, `)]]],P=({loop:e,configuration:n,pause:r})=>{let i=s(e.prompt).length;return(0,k.jsxs)(k.Fragment,{children:[r?.isError===!0&&(0,k.jsx)(g,{message:r.error.message}),(0,k.jsxs)(c,{facts:(0,k.jsx)(j,{loop:e,configuration:n}),children:[(0,k.jsxs)(d,{title:`Trigger`,children:[(0,k.jsx)(l,{entries:M(e)}),e.undeclaredLabels.length>0&&(0,k.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,k.jsx)(S,{weight:`fill`,className:`mt-0.5 size-3 shrink-0 text-warning`}),(0,k.jsxs)(`span`,{children:[`Condition uses`,` `,e.undeclaredLabels.length===1?`an undeclared label`:`undeclared labels`,`:`,` `,e.undeclaredLabels.join(`, `),`. usine creates only the labels under`,` `,(0,k.jsx)(`code`,{children:`labels`}),` in `,(0,k.jsx)(`code`,{children:`usine.yaml`}),`.`]})]})]}),(0,k.jsx)(d,{title:`Selector`,children:e.selector===null?(0,k.jsx)(`p`,{className:`text-muted-foreground`,children:`No selector: every registered repository`}):(0,k.jsx)(l,{entries:N(e.selector)})}),(0,k.jsx)(d,{title:`Prompt`,aside:i===0?`Same text for every run`:`${t(i,`outlined expression`)} filled in from each item`,children:(0,k.jsx)(u,{template:e.prompt})})]})]})},F=({name:e,configuration:t,pause:n})=>{let i=t.loops.find(t=>t.name===e);if(i!==void 0)return(0,k.jsx)(p,{entity:r(`loop`,e),title:i.name,marks:(0,k.jsx)(y,{paused:i.paused}),file:i.file,actions:n!==null&&(0,k.jsx)(v,{loop:i,pause:n,variant:`outline`}),children:(0,k.jsx)(P,{loop:i,configuration:t,pause:n})});let o=t.quarantinedLoops.find(t=>t.name===e);return o===void 0?(0,k.jsx)(p,{entity:r(`loop`,e),title:e,children:(0,k.jsxs)(f,{title:`Loop not found`,children:[`The configuration has no file `,(0,k.jsxs)(`code`,{children:[`loops/`,e,`.md`]}),`.`,` `,(0,k.jsx)(_,{to:`/configuration/loops`,className:`text-primary hover:underline`,children:`See all loops`}),`.`]})}):(0,k.jsx)(p,{entity:r(`loop`,e),title:o.name,marks:(0,k.jsx)(a,{}),file:o.file,children:(0,k.jsx)(O,{error:o.error,consequence:`No runs until the file loads.`})})},I=()=>{let{loop:e}=w.useParams(),{data:t}=T(C());return(0,k.jsx)(F,{name:e,configuration:t,pause:E()})};export{I as component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{a as r,i}from"./page-BLxt7Xfg.js";import{t as a}from"./error-alert-BVIxPJFU.js";import{r as o,t as s}from"./mark-B8EExm_5.js";import{C as c,b as l,g as u,n as d,r as f,x as p,y as m}from"./overview-BixI1Gdc.js";import{t as h}from"./link-C7GfYrMt.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as ee}from"./moves-B2I_hBZb.js";import{a as S,c as C,d as te,i as w,l as T,n as ne,o as re,r as ie,s as E,t as D,u as ae}from"./dropdown-menu-CFZLqcex.js";import{D as O,W as k,t as A}from"./button-4rhhIcK8.js";import{f as j,ft as oe,s as M}from"./strings-BeaABxX0.js";import{At as se,B as ce,F as le,H as ue,I as de,L as fe,M as pe,N as me,P as he,R as ge,V as _e,a as ve,j as ye,jt as N,vt as P,z as be}from"./index-BdDPka5v.js";import{t as F}from"./use-now-vNgLntlV.js";import{n as I,r as xe,t as Se}from"./status-badge-CLPsMXtK.js";import{a as Ce,i as L,n as we,o as R,r as z,t as Te}from"./table-hbKjhjeL.js";import{a as Ee,c as De,d as B,f as Oe,g as ke,h as Ae,i as je,l as Me,m as V,o as Ne,p as Pe,r as Fe,s as Ie,t as Le}from"./sortable.esm-JyniDt4R.js";import{n as H,t as U}from"./label-badge-d6omX3Kx.js";import{t as Re}from"./action-BbYQzHVY.js";import{f as ze,o as Be,u as Ve}from"./model-0V8C6gKN.js";import{n as He,t as Ue}from"./strings-Bs2WdZYo.js";import{t as We}from"./project-not-found-CutZoVCI.js";var W=n(e(),1),Ge=new Map([[`bold`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),W.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),Ke=new Map([[`bold`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),W.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),G=W.forwardRef((e,t)=>W.createElement(k,{ref:t,...e,weights:Ge}));G.displayName=`ArrowUpRightIcon`;var K=W.forwardRef((e,t)=>W.createElement(k,{ref:t,...e,weights:Ke}));K.displayName=`ArrowsInLineHorizontalIcon`;var qe={above:!1,below:!1},Je=()=>{let[e,t]=(0,W.useState)(qe),n=(0,W.useRef)(null);return[(0,W.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},q=t();function J({className:e,size:t=`default`,...n}){return(0,q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:O(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Ye({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-header`,className:O(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Xe({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-title`,className:O(`text-lg font-semibold`,e),...t})}function Ze({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-description`,className:O(`text-sm text-muted-foreground`,e),...t})}function Qe({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-content`,className:O(`px-(--card-spacing)`,e),...t})}var $e=(e,t)=>e===`Running`?`Running since ${j(t)}`:e===`Failed`?`Failed at ${j(t)}`:u(t),Y=3,et=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(Y);return(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,Y).map(e=>(0,q.jsx)(U,{name:e,label:t.get(e)},e)),n.length>0&&(0,q.jsxs)(H,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},tt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,nt=({item:e,repository:t})=>(0,q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,q.jsx)(h,{to:`/projects/$owner/$name/tasks/$number`,params:{...f(t),number:Ve(e)},draggable:!1,className:tt,children:(0,q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})}),rt=({failure:e,children:t})=>(0,q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),it=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,q.jsx)(A,{variant:`outline`,size:`xs`,className:`relative z-10`,title:m(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:l.retry}):null,at=({run:e})=>{let t=F(3e4),n=g(e);return(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,q.jsx)(I,{state:e.state,className:`mr-0.5`}),(0,q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:$e(e.state,n),children:M(n,t)}),(0,q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]})},ot=({stalled:e,named:t,children:n})=>{let r=F(3e4),i=He(e,r);return(0,q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},st=e=>[`run-again`,`board-card`,e],ct=(e,t)=>{let n=st(e),r=me({mutationKey:n,onClaimed:t}),i=se({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(ye(e))}},X=({item:e,lane:t,catalog:n,repository:r,stall:i,readOnly:a,action:o,again:c,progress:l})=>{let u=y(e),d=_(e),f=o?.error?.message??null,p=c?.error?.message??null,m=i!==null&&u!==null&&(i.reason._tag===`RunFailed`||i.reason._tag===`SuppressedForOperator`)&&i.reason.run.id===u.run.id,h=i===null||o===null?null:(0,q.jsx)(Re,{stalled:i,readOnly:a,appearance:`card`}),g=e.needsYou&&!(d?.canApprove||d?.canResolveFailure)&&i===null;return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:e.items.map(e=>(0,q.jsx)(s,{item:e,className:`relative z-10`},e.itemKey))}),(0,q.jsx)(nt,{item:e,repository:r}),(0,q.jsx)(et,{labels:b(e,t),catalog:n}),d!==null&&(0,q.jsx)(at,{run:d}),l!==null&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,q.jsx)(rt,{failure:u,children:m&&i?.reason._tag===`SuppressedForOperator`?h:(0,q.jsx)(it,{failure:u,action:o})}),i!==null&&!m&&(0,q.jsx)(ot,{stalled:i,named:(d===null||Be(i)?.id!==d.id)&&!Ue(i),children:h}),c?.data?._tag===`CycleBlocked`&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),f!==null&&(0,q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),p!==null&&(0,q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),e.conflicting&&(0,q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),g&&(0,q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},lt=({runs:e,openRun:t})=>(0,q.jsxs)(E,{children:[(0,q.jsx)(T,{children:`Run history`}),(0,q.jsx)(C,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,q.jsxs)(w,{onClick:()=>t(e.id),children:[(0,q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(I,{state:e.state}),e.state]}),(0,q.jsx)(`time`,{dateTime:e.openedAt,title:u(e.openedAt),className:`font-mono tabular-nums`,children:M(e.openedAt)})]})]},e.id))})]}),ut=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:c})=>{let[u,d]=(0,W.useState)(!1),f=o(e),p=e.runs.filter(({id:e})=>e!==t?.id),h=e.run?.canRunAgain===!0?e.run:null,g=[{key:`links`,content:e.items.map(e=>(0,q.jsxs)(S,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,q.jsx)(s,{item:e,linked:!1}),` on GitHub`,(0,q.jsx)(x,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||p.length>0)&&g.push({key:`runs`,content:(0,q.jsxs)(q.Fragment,{children:[t!==null&&(0,q.jsx)(w,{onClick:()=>r(t.id),children:`Open run`}),p.length>0&&(0,q.jsx)(lt,{runs:p,openRun:r})]})});let _=i.isPending||a.isPending,v=h!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!_&&v&&g.push({key:`actions`,content:(0,q.jsxs)(q.Fragment,{children:[t?.canApprove&&(0,q.jsx)(w,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:l.approve}),t?.canRetry&&(0,q.jsx)(w,{title:m(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:l.retry}),h!==null&&(0,q.jsxs)(w,{onClick:()=>a.send(h),children:[l.runAgain,(0,q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:h.loop})]}),t?.canCancel&&(0,q.jsx)(w,{variant:`destructive`,onClick:()=>d(!0),children:l.cancel})]})}),!n.disabled&&n.targets.length>0&&g.push({key:`move`,content:(0,q.jsxs)(E,{children:[(0,q.jsx)(T,{children:`Move to`}),(0,q.jsx)(C,{className:`min-w-40`,children:n.targets.map(t=>(0,q.jsx)(w,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(D,{children:[(0,q.jsx)(ae,{render:(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,className:O(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,c)}),"aria-label":`Actions for ${f}`,children:(0,q.jsx)(te,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(ne,{align:`end`,className:`w-auto min-w-48`,children:g.map(({key:e,content:t},n)=>(0,q.jsxs)(W.Fragment,{children:[n>0&&(0,q.jsx)(re,{}),(0,q.jsx)(ie,{children:t})]},e))})]}),t!==null&&(0,q.jsx)(le,{open:u,onOpenChange:d,children:(0,q.jsxs)(ge,{children:[(0,q.jsxs)(_e,{children:[(0,q.jsxs)(ue,{children:[`Cancel `,t.loop,`?`]}),(0,q.jsxs)(be,{children:[`The run on `,f,` stops, including any attempt in progress.`]})]}),(0,q.jsxs)(ce,{children:[(0,q.jsx)(fe,{children:l.keepRunning}),(0,q.jsx)(de,{variant:`destructive`,onClick:()=>{d(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:l.confirmCancel})]})]})})]})},Z=e=>O(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),dt=(e,t,n)=>e.isPending&&e.variables!==void 0?p[e.variables.request.action]:t.isPending?c:n===void 0?null:v(n),ft=({item:e,lane:t,catalog:n,draggable:r,phase:i,moves:a,stall:o,readOnly:s,openRun:c,repository:l})=>{let u=pe(),d=ct(e.itemKey,c),{attributes:f,listeners:p,setNodeRef:m,setActivatorNodeRef:h,transform:g,transition:v,isDragging:y}=je({id:e.itemKey,disabled:{draggable:!r,droppable:t._tag!==`WritableBoardLane`}});return(0,q.jsxs)(`div`,{ref:m,style:{transform:ke.Translate.toString(g),transition:v},className:O(`group/task relative`,y&&`opacity-40`),children:[(0,q.jsx)(J,{ref:h,size:`sm`,className:O(Z(e.needsYou),r&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...r&&f,...r&&p,children:(0,q.jsx)(X,{item:e,lane:t,catalog:n,repository:l,stall:o,readOnly:s,action:u,again:d,progress:dt(u,d,i)})}),(0,q.jsx)(ut,{item:e,run:_(e),moves:a,openRun:c,action:u,again:d,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},pt=new Set([`Waiting`,`Queued`,`Running`]),mt=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(({runs:e})=>e.filter(({state:e,loop:t})=>pt.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),ht=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),gt=({flow:e})=>{let t=e.loops.length>0;return(0,q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:O(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${ht(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,q.jsxs)(W.Fragment,{children:[n>0&&`, `,e,t&&(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:O(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},_t=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&oe(e.state)),vt=({sources:e,catalog:t})=>(0,q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,q.jsx)(U,{name:e.label,label:t.get(e.label)}):(0,q.jsx)(H,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),yt=({lane:e,open:t})=>(0,q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),bt=({lane:e,lanes:t,flow:n,catalog:r,targeted:i,pending:a,readOnly:o,moves:s,stallOf:c,openRun:l,onMove:u,repository:d})=>{let f=_t(e),[p,m]=(0,W.useState)(f),h=e._tag===`WritableBoardLane`,{setNodeRef:g}=Pe({id:e.id,disabled:!h||a}),_=t.filter(t=>t._tag===`WritableBoardLane`&&t.id!==e.id),v=e.items.length,[y,b]=Je();return f&&p?(0,q.jsx)(yt,{lane:e,open:()=>m(!1)}):(0,q.jsxs)(`section`,{ref:g,"aria-label":`${e.name} lane`,className:O(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,i&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,q.jsxs)(`header`,{className:O(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!i&&`bg-background`),children:[(0,q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:v})]}),n!==void 0&&(0,q.jsx)(gt,{flow:n}),f&&(0,q.jsx)(A,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${e.name}`,title:`Fold ${e.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>m(!0),children:(0,q.jsx)(K,{"aria-hidden":`true`})})]}),(0,q.jsx)(`div`,{className:`min-h-5`,children:e.sources.length>0&&(0,q.jsx)(vt,{sources:e.sources,catalog:r})})]}),(0,q.jsx)(`div`,{ref:y,"aria-label":`${e.name} cards`,tabIndex:b.above||b.below?0:void 0,className:O(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,b.above&&`mask-t-from-[calc(100%-2.5rem)]`,b.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,q.jsxs)(Le,{items:e.items.map(({itemKey:e})=>e),strategy:Ee,children:[v===0&&(0,q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),e.items.map(t=>{let n=s.find(({itemKey:e})=>e===t.itemKey)?.phase,i=a||n!==void 0;return(0,q.jsx)(ft,{item:t,lane:e,catalog:r,draggable:!i&&_.length>0,phase:n,moves:{targets:_,disabled:i,onMove:u},stall:c(t),readOnly:o,openRun:l,repository:d},t.itemKey)})]})})]})},Q=({item:e,lane:t,catalog:n,repository:r,stall:i})=>(0,q.jsx)(J,{size:`sm`,className:O(Z(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,q.jsx)(X,{item:e,lane:t,catalog:n,repository:r,stall:i,readOnly:!0,action:null,again:null,progress:null})}),xt=({runs:e,openRun:t})=>(0,q.jsxs)(J,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,q.jsxs)(Ye,{children:[(0,q.jsx)(Xe,{children:`Runs without a card`}),(0,q.jsxs)(Ze,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,q.jsx)(Qe,{children:(0,q.jsxs)(Te,{children:[(0,q.jsx)(Ce,{children:(0,q.jsxs)(R,{children:[(0,q.jsx)(L,{children:`Loop`}),(0,q.jsx)(L,{children:`Agent`}),(0,q.jsx)(L,{children:`Item`}),(0,q.jsx)(L,{children:`State`}),(0,q.jsx)(L,{className:`w-0`})]})}),(0,q.jsx)(we,{children:e.map(e=>(0,q.jsxs)(R,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,q.jsx)(z,{className:`font-medium`,children:e.loop}),(0,q.jsx)(z,{children:e.agent}),(0,q.jsx)(z,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,q.jsx)(z,{children:(0,q.jsx)(xe,{state:e.state})}),(0,q.jsx)(z,{className:`text-right`,children:(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,q.jsx)(G,{"aria-hidden":`true`})})})]},e.id))})]})})]}),St=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],$=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ct=e=>{let t=B(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=B({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return Oe(e)},wt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Fe(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},Tt=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey);return e.id===t.toLane?{...e,items:[i,...n]}:{...e,items:n}})},Et=e=>{let t=new Set(e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},Dt=({project:e,loops:t,stalled:n,disabled:r,openRun:o})=>{let[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(null),{moves:d,moveItem:f,isPending:p,error:m}=ee(e),h=Et(e),g=d.reduce(Tt,St(e.board.lanes)),_=Ae(V(Me,{activationConstraint:{distance:6}}),V(De,{coordinateGetter:wt(g)})),v=mt(g,t),y=g.reduce((e,t)=>e+t.items.length,0),b=e=>ze(n,e),x=new Map(e.labels.map(e=>[e.name,e])),S=r||p,C=()=>{c(null),u(null)};return(0,q.jsxs)(`div`,{className:`flex min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,q.jsx)(i,{title:e.repository,leading:(0,q.jsx)(P,{repository:e.repository,size:`title`}),counts:`${g.length} lane${g.length===1?``:`s`}, ${y} item${y===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,q.jsx)(Se,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,q.jsxs)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:[`Proposed lanes are read-only. To enable moves, add lanes with labels for this project under `,(0,q.jsx)(`code`,{children:`repos[].lanes`}),` in `,(0,q.jsx)(`code`,{children:`usine.yaml`}),`, then reload the configuration from Configuration > Loops.`]}),e.board.failures.length>0&&(0,q.jsx)(a,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{a as r,i}from"./page-DPqWAN9v.js";import{t as a}from"./error-alert-BnIKdDdf.js";import{r as o,t as s}from"./mark-Ce_Qn2iu.js";import{C as c,b as l,g as u,n as d,r as f,x as p,y as m}from"./overview-DvY74mSl.js";import{t as h}from"./link-C7GfYrMt.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as ee}from"./moves-1Jmz4a60.js";import{a as S,c as C,d as te,i as w,l as T,n as ne,o as re,r as ie,s as E,t as D,u as ae}from"./dropdown-menu-C-3ehl95.js";import{D as O,W as k,t as A}from"./button-4rhhIcK8.js";import{f as j,ft as oe,s as M}from"./strings-CKWfinsy.js";import{At as se,B as ce,F as le,H as ue,I as de,L as fe,M as pe,N as me,P as he,R as ge,V as _e,a as ve,j as ye,jt as N,vt as P,z as be}from"./index-BokhrH13.js";import{t as F}from"./use-now-vNgLntlV.js";import{n as I,r as xe,t as Se}from"./status-badge-CLPsMXtK.js";import{a as Ce,i as L,n as we,o as R,r as z,t as Te}from"./table-hbKjhjeL.js";import{a as Ee,c as De,d as B,f as Oe,g as ke,h as Ae,i as je,l as Me,m as V,o as Ne,p as Pe,r as Fe,s as Ie,t as Le}from"./sortable.esm-bQYOlGOK.js";import{n as H,t as U}from"./label-badge-D96gAMUo.js";import{t as Re}from"./action-D2OJs-sY.js";import{f as ze,o as Be,u as Ve}from"./model-DBl1SZtu.js";import{n as He,t as Ue}from"./strings-DqXLM1F0.js";import{t as We}from"./project-not-found-CutZoVCI.js";var W=n(e(),1),Ge=new Map([[`bold`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),W.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),Ke=new Map([[`bold`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),W.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),G=W.forwardRef((e,t)=>W.createElement(k,{ref:t,...e,weights:Ge}));G.displayName=`ArrowUpRightIcon`;var K=W.forwardRef((e,t)=>W.createElement(k,{ref:t,...e,weights:Ke}));K.displayName=`ArrowsInLineHorizontalIcon`;var qe={above:!1,below:!1},Je=()=>{let[e,t]=(0,W.useState)(qe),n=(0,W.useRef)(null);return[(0,W.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},q=t();function J({className:e,size:t=`default`,...n}){return(0,q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:O(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Ye({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-header`,className:O(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Xe({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-title`,className:O(`text-lg font-semibold`,e),...t})}function Ze({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-description`,className:O(`text-sm text-muted-foreground`,e),...t})}function Qe({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-content`,className:O(`px-(--card-spacing)`,e),...t})}var $e=(e,t)=>e===`Running`?`Running since ${j(t)}`:e===`Failed`?`Failed at ${j(t)}`:u(t),Y=3,et=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(Y);return(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,Y).map(e=>(0,q.jsx)(U,{name:e,label:t.get(e)},e)),n.length>0&&(0,q.jsxs)(H,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},tt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,nt=({item:e,repository:t})=>(0,q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,q.jsx)(h,{to:`/projects/$owner/$name/tasks/$number`,params:{...f(t),number:Ve(e)},draggable:!1,className:tt,children:(0,q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})}),rt=({failure:e,children:t})=>(0,q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),it=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,q.jsx)(A,{variant:`outline`,size:`xs`,className:`relative z-10`,title:m(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:l.retry}):null,at=({run:e})=>{let t=F(3e4),n=g(e);return(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,q.jsx)(I,{state:e.state,className:`mr-0.5`}),(0,q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:$e(e.state,n),children:M(n,t)}),(0,q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]})},ot=({stalled:e,named:t,children:n})=>{let r=F(3e4),i=He(e,r);return(0,q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},st=e=>[`run-again`,`board-card`,e],ct=(e,t)=>{let n=st(e),r=me({mutationKey:n,onClaimed:t}),i=se({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(ye(e))}},X=({item:e,lane:t,catalog:n,repository:r,stall:i,readOnly:a,action:o,again:c,progress:l})=>{let u=y(e),d=_(e),f=o?.error?.message??null,p=c?.error?.message??null,m=i!==null&&u!==null&&(i.reason._tag===`RunFailed`||i.reason._tag===`SuppressedForOperator`)&&i.reason.run.id===u.run.id,h=i===null||o===null?null:(0,q.jsx)(Re,{stalled:i,readOnly:a,appearance:`card`}),g=e.needsYou&&!(d?.canApprove||d?.canResolveFailure)&&i===null;return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:e.items.map(e=>(0,q.jsx)(s,{item:e,className:`relative z-10`},e.itemKey))}),(0,q.jsx)(nt,{item:e,repository:r}),(0,q.jsx)(et,{labels:b(e,t),catalog:n}),d!==null&&(0,q.jsx)(at,{run:d}),l!==null&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,q.jsx)(rt,{failure:u,children:m&&i?.reason._tag===`SuppressedForOperator`?h:(0,q.jsx)(it,{failure:u,action:o})}),i!==null&&!m&&(0,q.jsx)(ot,{stalled:i,named:(d===null||Be(i)?.id!==d.id)&&!Ue(i),children:h}),c?.data?._tag===`CycleBlocked`&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),f!==null&&(0,q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),p!==null&&(0,q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),e.conflicting&&(0,q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),g&&(0,q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},lt=({runs:e,openRun:t})=>(0,q.jsxs)(E,{children:[(0,q.jsx)(T,{children:`Run history`}),(0,q.jsx)(C,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,q.jsxs)(w,{onClick:()=>t(e.id),children:[(0,q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(I,{state:e.state}),e.state]}),(0,q.jsx)(`time`,{dateTime:e.openedAt,title:u(e.openedAt),className:`font-mono tabular-nums`,children:M(e.openedAt)})]})]},e.id))})]}),ut=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:c})=>{let[u,d]=(0,W.useState)(!1),f=o(e),p=e.runs.filter(({id:e})=>e!==t?.id),h=e.run?.canRunAgain===!0?e.run:null,g=[{key:`links`,content:e.items.map(e=>(0,q.jsxs)(S,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,q.jsx)(s,{item:e,linked:!1}),` on GitHub`,(0,q.jsx)(x,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||p.length>0)&&g.push({key:`runs`,content:(0,q.jsxs)(q.Fragment,{children:[t!==null&&(0,q.jsx)(w,{onClick:()=>r(t.id),children:`Open run`}),p.length>0&&(0,q.jsx)(lt,{runs:p,openRun:r})]})});let _=i.isPending||a.isPending,v=h!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!_&&v&&g.push({key:`actions`,content:(0,q.jsxs)(q.Fragment,{children:[t?.canApprove&&(0,q.jsx)(w,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:l.approve}),t?.canRetry&&(0,q.jsx)(w,{title:m(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:l.retry}),h!==null&&(0,q.jsxs)(w,{onClick:()=>a.send(h),children:[l.runAgain,(0,q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:h.loop})]}),t?.canCancel&&(0,q.jsx)(w,{variant:`destructive`,onClick:()=>d(!0),children:l.cancel})]})}),!n.disabled&&n.targets.length>0&&g.push({key:`move`,content:(0,q.jsxs)(E,{children:[(0,q.jsx)(T,{children:`Move to`}),(0,q.jsx)(C,{className:`min-w-40`,children:n.targets.map(t=>(0,q.jsx)(w,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(D,{children:[(0,q.jsx)(ae,{render:(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,className:O(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,c)}),"aria-label":`Actions for ${f}`,children:(0,q.jsx)(te,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(ne,{align:`end`,className:`w-auto min-w-48`,children:g.map(({key:e,content:t},n)=>(0,q.jsxs)(W.Fragment,{children:[n>0&&(0,q.jsx)(re,{}),(0,q.jsx)(ie,{children:t})]},e))})]}),t!==null&&(0,q.jsx)(le,{open:u,onOpenChange:d,children:(0,q.jsxs)(ge,{children:[(0,q.jsxs)(_e,{children:[(0,q.jsxs)(ue,{children:[`Cancel `,t.loop,`?`]}),(0,q.jsxs)(be,{children:[`The run on `,f,` stops, including any attempt in progress.`]})]}),(0,q.jsxs)(ce,{children:[(0,q.jsx)(fe,{children:l.keepRunning}),(0,q.jsx)(de,{variant:`destructive`,onClick:()=>{d(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:l.confirmCancel})]})]})})]})},Z=e=>O(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),dt=(e,t,n)=>e.isPending&&e.variables!==void 0?p[e.variables.request.action]:t.isPending?c:n===void 0?null:v(n),ft=({item:e,lane:t,catalog:n,draggable:r,phase:i,moves:a,stall:o,readOnly:s,openRun:c,repository:l})=>{let u=pe(),d=ct(e.itemKey,c),{attributes:f,listeners:p,setNodeRef:m,setActivatorNodeRef:h,transform:g,transition:v,isDragging:y}=je({id:e.itemKey,disabled:{draggable:!r,droppable:t._tag!==`WritableBoardLane`}});return(0,q.jsxs)(`div`,{ref:m,style:{transform:ke.Translate.toString(g),transition:v},className:O(`group/task relative`,y&&`opacity-40`),children:[(0,q.jsx)(J,{ref:h,size:`sm`,className:O(Z(e.needsYou),r&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...r&&f,...r&&p,children:(0,q.jsx)(X,{item:e,lane:t,catalog:n,repository:l,stall:o,readOnly:s,action:u,again:d,progress:dt(u,d,i)})}),(0,q.jsx)(ut,{item:e,run:_(e),moves:a,openRun:c,action:u,again:d,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},pt=new Set([`Waiting`,`Queued`,`Running`]),mt=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(({runs:e})=>e.filter(({state:e,loop:t})=>pt.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),ht=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),gt=({flow:e})=>{let t=e.loops.length>0;return(0,q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:O(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${ht(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,q.jsxs)(W.Fragment,{children:[n>0&&`, `,e,t&&(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:O(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},_t=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&oe(e.state)),vt=({sources:e,catalog:t})=>(0,q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,q.jsx)(U,{name:e.label,label:t.get(e.label)}):(0,q.jsx)(H,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),yt=({lane:e,open:t})=>(0,q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),bt=({lane:e,lanes:t,flow:n,catalog:r,targeted:i,pending:a,readOnly:o,moves:s,stallOf:c,openRun:l,onMove:u,repository:d})=>{let f=_t(e),[p,m]=(0,W.useState)(f),h=e._tag===`WritableBoardLane`,{setNodeRef:g}=Pe({id:e.id,disabled:!h||a}),_=t.filter(t=>t._tag===`WritableBoardLane`&&t.id!==e.id),v=e.items.length,[y,b]=Je();return f&&p?(0,q.jsx)(yt,{lane:e,open:()=>m(!1)}):(0,q.jsxs)(`section`,{ref:g,"aria-label":`${e.name} lane`,className:O(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,i&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,q.jsxs)(`header`,{className:O(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!i&&`bg-background`),children:[(0,q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:v})]}),n!==void 0&&(0,q.jsx)(gt,{flow:n}),f&&(0,q.jsx)(A,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${e.name}`,title:`Fold ${e.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>m(!0),children:(0,q.jsx)(K,{"aria-hidden":`true`})})]}),(0,q.jsx)(`div`,{className:`min-h-5`,children:e.sources.length>0&&(0,q.jsx)(vt,{sources:e.sources,catalog:r})})]}),(0,q.jsx)(`div`,{ref:y,"aria-label":`${e.name} cards`,tabIndex:b.above||b.below?0:void 0,className:O(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,b.above&&`mask-t-from-[calc(100%-2.5rem)]`,b.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,q.jsxs)(Le,{items:e.items.map(({itemKey:e})=>e),strategy:Ee,children:[v===0&&(0,q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),e.items.map(t=>{let n=s.find(({itemKey:e})=>e===t.itemKey)?.phase,i=a||n!==void 0;return(0,q.jsx)(ft,{item:t,lane:e,catalog:r,draggable:!i&&_.length>0,phase:n,moves:{targets:_,disabled:i,onMove:u},stall:c(t),readOnly:o,openRun:l,repository:d},t.itemKey)})]})})]})},Q=({item:e,lane:t,catalog:n,repository:r,stall:i})=>(0,q.jsx)(J,{size:`sm`,className:O(Z(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,q.jsx)(X,{item:e,lane:t,catalog:n,repository:r,stall:i,readOnly:!0,action:null,again:null,progress:null})}),xt=({runs:e,openRun:t})=>(0,q.jsxs)(J,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,q.jsxs)(Ye,{children:[(0,q.jsx)(Xe,{children:`Runs without a card`}),(0,q.jsxs)(Ze,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,q.jsx)(Qe,{children:(0,q.jsxs)(Te,{children:[(0,q.jsx)(Ce,{children:(0,q.jsxs)(R,{children:[(0,q.jsx)(L,{children:`Loop`}),(0,q.jsx)(L,{children:`Agent`}),(0,q.jsx)(L,{children:`Item`}),(0,q.jsx)(L,{children:`State`}),(0,q.jsx)(L,{className:`w-0`})]})}),(0,q.jsx)(we,{children:e.map(e=>(0,q.jsxs)(R,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,q.jsx)(z,{className:`font-medium`,children:e.loop}),(0,q.jsx)(z,{children:e.agent}),(0,q.jsx)(z,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,q.jsx)(z,{children:(0,q.jsx)(xe,{state:e.state})}),(0,q.jsx)(z,{className:`text-right`,children:(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,q.jsx)(G,{"aria-hidden":`true`})})})]},e.id))})]})})]}),St=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],$=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ct=e=>{let t=B(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=B({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return Oe(e)},wt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Fe(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},Tt=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey);return e.id===t.toLane?{...e,items:[i,...n]}:{...e,items:n}})},Et=e=>{let t=new Set(e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},Dt=({project:e,loops:t,stalled:n,disabled:r,openRun:o})=>{let[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(null),{moves:d,moveItem:f,isPending:p,error:m}=ee(e),h=Et(e),g=d.reduce(Tt,St(e.board.lanes)),_=Ae(V(Me,{activationConstraint:{distance:6}}),V(De,{coordinateGetter:wt(g)})),v=mt(g,t),y=g.reduce((e,t)=>e+t.items.length,0),b=e=>ze(n,e),x=new Map(e.labels.map(e=>[e.name,e])),S=r||p,C=()=>{c(null),u(null)};return(0,q.jsxs)(`div`,{className:`flex min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,q.jsx)(i,{title:e.repository,leading:(0,q.jsx)(P,{repository:e.repository,size:`title`}),counts:`${g.length} lane${g.length===1?``:`s`}, ${y} item${y===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,q.jsx)(Se,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,q.jsxs)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:[`Proposed lanes are read-only. To enable moves, add lanes with labels for this project under `,(0,q.jsx)(`code`,{children:`repos[].lanes`}),` in `,(0,q.jsx)(`code`,{children:`usine.yaml`}),`, then reload the configuration from Configuration > Loops.`]}),e.board.failures.length>0&&(0,q.jsx)(a,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
|
|
2
2
|
`)}),m!==null&&(0,q.jsx)(a,{className:`mx-4 max-w-3xl md:mx-5`,message:m.message}),(0,q.jsxs)(Ne,{sensors:_,collisionDetection:Ct,onDragStart:({active:e})=>{let t=g.find(({items:t})=>t.some(({itemKey:t})=>t===e.id)),n=t?.items.find(({itemKey:t})=>t===e.id);c(t===void 0||n===void 0?null:{item:n,lane:t})},onDragOver:({over:e})=>u(e===null?null:$(e.id,g)?.id??null),onDragEnd:({over:e})=>{if(C(),e===null||s===null)return;let t=$(e.id,g);t!==void 0&&f(s.item,t)},onDragCancel:C,children:[(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain [container-type:size]`,"aria-label":`${e.repository} project board`,children:(0,q.jsxs)(`div`,{className:`flex w-max min-w-full flex-col gap-6 px-4 pb-4 md:px-5`,children:[(0,q.jsx)(`div`,{className:`flex h-[calc(100cqh-1rem)] min-h-80 shrink-0 gap-3`,children:g.map(t=>(0,q.jsx)(bt,{lane:t,lanes:g,flow:v.get(t.id),catalog:x,targeted:s!==null&&l===t.id&&t.id!==s.lane.id&&t._tag===`WritableBoardLane`,pending:S,readOnly:r,moves:d,stallOf:b,openRun:o,onMove:f,repository:e.repository},t.id))}),h.length>0&&(0,q.jsx)(xt,{runs:h,openRun:o})]})}),(0,q.jsx)(Ie,{children:s!==null&&(0,q.jsx)(Q,{item:s.item,lane:s.lane,catalog:x,repository:e.repository,stall:b(s.item)})})]})]})},Ot=()=>{let{repository:e}=ve.useParams(),{data:t}=N(d()),n=N(r()),i=he(),a=t.projects.find(t=>t.repository===e);return a===void 0?(0,q.jsx)(We,{}):(0,q.jsx)(Dt,{project:a,loops:t.loops,stalled:n.data.notMoving,disabled:t._tag===`NeedsSetup`,openRun:i})};export{Ot as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{kt as t}from"./index-BokhrH13.js";var n=e(),r=()=>(0,n.jsx)(t,{});export{r as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e}from"./index-BokhrH13.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{Y as t,a as n,i as r,n as i,r as a,s as o,t as s,u as c}from"./section-
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{Y as t,a as n,i as r,n as i,r as a,s as o,t as s,u as c}from"./section-DRfN9XCr.js";import{r as l}from"./overview-DvY74mSl.js";import{t as u}from"./link-C7GfYrMt.js";import{T as d,jt as f,o as p,vt as m}from"./index-BokhrH13.js";import{a as h,i as g,n as _,o as v,r as y,t as b}from"./table-hbKjhjeL.js";import{t as x}from"./fill-cell-CjksmixH.js";import{n as S,t as C}from"./label-badge-D96gAMUo.js";import{t as w}from"./repositories-D4wYJfa_.js";var T=e(),E=({label:e})=>e.failure===null?e.onGitHub===!1?(0,T.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,T.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),D=({source:e})=>e._tag===`Label`?(0,T.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,T.jsx)(C,{name:e.label.name,label:e.label}),(0,T.jsx)(`span`,{className:`text-xs`,children:(0,T.jsx)(E,{label:e.label})})]}):(0,T.jsx)(S,{variant:`outline`,className:`text-muted-foreground`,children:e.state}),O=({repository:e})=>(0,T.jsx)(`div`,{className:`-mx-2`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(h,{children:(0,T.jsxs)(v,{className:`hover:bg-transparent`,children:[(0,T.jsx)(g,{className:`text-right`,children:`#`}),(0,T.jsx)(g,{children:`Lane`}),(0,T.jsx)(g,{children:`Items with`})]})}),(0,T.jsx)(_,{children:e.lanes.map((e,t)=>(0,T.jsxs)(v,{className:`hover:bg-transparent`,children:[(0,T.jsx)(y,{className:`py-3 text-right align-top font-mono text-xs text-muted-foreground tabular-nums`,children:t+1}),(0,T.jsx)(y,{className:`py-3 align-top font-medium`,children:e.name}),(0,T.jsx)(x,{className:`py-3 whitespace-normal`,children:(0,T.jsx)(`ul`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:e.sources.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsx)(D,{source:e})},e._tag===`Label`?e.label.name:e.state))})})]},e.name))})]})}),k=({repository:e})=>(0,T.jsxs)(n,{children:[(0,T.jsx)(r,{label:`Board`,children:(0,T.jsx)(u,{to:`/projects/$owner/$name`,params:l(e.name),className:`text-primary hover:underline`,children:`Open the board`})}),(0,T.jsx)(r,{label:`Tags`,children:e.tags.length===0?(0,T.jsx)(c,{children:`None`}):e.tags.join(`, `)}),(0,T.jsx)(r,{label:`Loops`,children:e.loops.length===0?(0,T.jsx)(c,{children:`Not selected by any loop`}):(0,T.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.loops.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsx)(u,{to:`/configuration/loops/$loop`,params:{loop:e},className:`text-primary hover:underline`,children:e})},e))})})]}),A=({owner:e,name:n,configuration:r})=>{let l=`${e}/${n}`,d=r.repositories.find(e=>e.name.toLowerCase()===l.toLowerCase());return d===void 0?(0,T.jsx)(s,{entity:t(`repository`,l),title:l,children:(0,T.jsxs)(o,{title:`Repository not registered`,children:[l,` is not under `,(0,T.jsx)(`code`,{children:`repos`}),` in `,(0,T.jsx)(`code`,{children:`usine.yaml`}),`.`,` `,(0,T.jsx)(u,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,T.jsx)(s,{entity:t(`repository`,d.name),title:d.name,leading:(0,T.jsx)(m,{repository:d.name,size:`title`}),children:(0,T.jsxs)(i,{facts:(0,T.jsx)(k,{repository:d}),children:[(0,T.jsxs)(a,{title:`Lanes`,aside:d.lanes.length===0?void 0:`In board order, as listed in repos[].lanes`,children:[[...d.declaredLabels,...w(d)].some(({onGitHub:e})=>e===null)&&(0,T.jsx)(`p`,{className:`text-muted-foreground`,children:`Labels not polled yet. Whether each label is on GitHub shows after the first poll.`}),d.lanes.length===0?(0,T.jsxs)(`p`,{className:`max-w-[72ch] text-muted-foreground`,children:[(0,T.jsx)(`code`,{children:`usine.yaml`}),` has no lanes for this repository. The board shows lanes proposed from the repository labels, and cards cannot be moved. To move cards, add lanes under `,(0,T.jsx)(`code`,{children:`repos[].lanes`}),`.`]}):(0,T.jsx)(O,{repository:d})]}),(0,T.jsx)(a,{title:`Labels usine creates`,aside:`From labels in usine.yaml`,children:d.declaredLabels.length===0?(0,T.jsxs)(`p`,{className:`text-muted-foreground`,children:[`No labels under `,(0,T.jsx)(`code`,{children:`labels`}),` in `,(0,T.jsx)(`code`,{children:`usine.yaml`}),`.`]}):(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:d.declaredLabels.map(e=>(0,T.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,T.jsx)(C,{name:e.name,label:e}),(0,T.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,T.jsx)(c,{children:`On GitHub`}):(0,T.jsx)(E,{label:e})})]},e.name))})})]})})},j=()=>{let{owner:e,name:t}=p.useParams(),{data:n}=f(d());return(0,T.jsx)(A,{owner:e,name:t,configuration:n})};export{j as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{t}from"./index-
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{t}from"./index-BokhrH13.js";import{t as n}from"./not-found-c4c84AV-.js";var r=e(),i=()=>{let{repository:e,number:i}=t.useParams();return(0,r.jsx)(n,{repository:e,number:i})};export{i as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e}from"./index-BokhrH13.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{n as r,r as i}from"./page-BLxt7Xfg.js";import{t as a}from"./error-alert-BVIxPJFU.js";import{r as o,t as s}from"./mark-B8EExm_5.js";import{C as c,S as l,b as u,h as d,m as f,n as p,r as m,x as h,y as g}from"./overview-BixI1Gdc.js";import{t as _}from"./useNavigate-AT5VkfZa.js";import{t as v}from"./link-C7GfYrMt.js";import{n as ee,r as te,s as y,t as ne}from"./moves-B2I_hBZb.js";import{a as re}from"./native-select-BzF8xUnx.js";import{d as ie,i as b,n as x,r as S,t as C,u as w}from"./dropdown-menu-CFZLqcex.js";import{D as T,t as E}from"./button-4rhhIcK8.js";import{In as ae,Kn as D,Rn as oe,S as se,Yn as ce,a as O,f as k,o as le,zn as ue}from"./strings-BeaABxX0.js";import{a as de,r as fe}from"./identity-DlGZ_gKf.js";import{B as pe,F as me,H as he,I as ge,L as _e,M as ve,N as ye,P as A,R as j,Tt as M,V as N,j as P,jt as F,n as be,t as I,z as xe}from"./index-BdDPka5v.js";import{t as Se}from"./use-now-vNgLntlV.js";import{t as Ce}from"./heading-D62nMA3C.js";import{t as we}from"./pull-request-marks-BIB-F5Bo.js";import{n as L,t as Te}from"./status-badge-CLPsMXtK.js";import{n as Ee,t as De}from"./edit-and-retry-DE8DjLVA.js";import{a as Oe,i as R,n as z,o as B,r as V,t as H}from"./table-hbKjhjeL.js";import{t as U}from"./fill-cell-CjksmixH.js";import{t as ke}from"./label-badge-d6omX3Kx.js";import{a as Ae,n as je,t as Me}from"./model-0V8C6gKN.js";import{n as Ne,t as Pe}from"./run-again-DSDtftlB.js";import{t as Fe}from"./not-found-hL2Tp5vW.js";import{i as W,n as G,r as K,t as q}from"./section-BwxXJ9H0.js";var J=t(),Ie=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${k(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${k(e.postedAt)}`},Le=({task:e})=>{let t=new Map(e.runs.map(e=>[e.id,e])),n=new Map(e.items.map(e=>[e.itemKey,e]));return(0,J.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,J.jsx)(q,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,J.jsx)(z,{className:`border-t`,children:e.comments.map(e=>{let r=t.get(e.runId),i=r===void 0?void 0:n.get(r.itemKey),a=Ie(e);return(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${W}`,children:[je(e.kind),i!==void 0&&(0,J.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,J.jsx)(s,{item:i,linked:!1})]})]})}),(0,J.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,J.jsx)(v,{to:`/projects/$owner/$name/runs/$run`,params:{...m(r.repository),run:r.id},className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:r.loop})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:a!==null&&(0,J.jsx)(`time`,{dateTime:a.at,title:a.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(a.at)})})]},e.url)})})})})]})},Re=({task:e,project:t,disabled:n})=>{let s=ne(t),[c]=e.items,l=e.items.find(({itemKey:t})=>t===e.current)??c,u=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),d=u===void 0?void 0:s.moves.find(({itemKey:e})=>e===u.card.itemKey),f=u===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==u.lane.id),p=t.board.lanes.find(({id:e})=>e===d?.toLane)?.name??u?.lane.name??e.lane.name,m=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),h=u===void 0?l.labels:te(u.card,u.lane).filter(e=>d===void 0||!m.has(e)),g=new Map(t.labels.map(e=>[e.name,e])),_=!n&&!s.isPending&&d===void 0&&f.length>0,{origin:v,pullRequests:y}=de(e.items);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(i,{actionsBeside:`sm`,heading:(0,J.jsx)(Ce,{variant:`page`,item:ce(v),title:e.title}),facts:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(we,{pullRequests:y}),(0,J.jsx)(r,{icon:M,title:`Lane`,children:(0,J.jsx)(`span`,{className:`text-foreground`,children:p})}),d!==void 0&&(0,J.jsx)(`span`,{role:`status`,children:ee(d.phase)}),h.length>0&&(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:h.map(e=>(0,J.jsx)(ke,{name:e,label:g.get(e)},e))}),e.needsYou&&(0,J.jsx)(Te,{})]}),...u!==void 0&&_?{actions:(0,J.jsxs)(C,{children:[(0,J.jsxs)(w,{render:(0,J.jsx)(E,{variant:`outline`}),"aria-label":`Move ${o(l)} to another lane`,children:[`Move to`,(0,J.jsx)(re,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,J.jsx)(x,{align:`end`,className:`w-auto min-w-40`,children:(0,J.jsx)(S,{children:f.map(e=>(0,J.jsx)(b,{onClick:()=>s.moveItem(u.card,e),children:e.name},e.id))})})]})}:{}}),s.error!==null&&(0,J.jsx)(a,{className:`max-w-3xl`,message:s.error.message})]})},ze=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,J.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,J.jsx)(q,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,J.jsx)(z,{className:`border-t`,children:t.map(e=>(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(V,{className:`w-0 py-3`,children:(0,J.jsx)(s,{item:e,linked:!1})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${W}`,children:[e.title,(0,J.jsx)(y,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,J.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},Y=n(e(),1),X=({run:e})=>{let t=Se(3e4);return D(Me(e,t),{onNone:()=>null,onSome:e=>(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:le(e)})})},Be=({run:e})=>D(Ae(e),{onNone:()=>null,onSome:e=>(0,J.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:f(e),children:[(0,J.jsx)(`span`,{className:`font-medium text-destructive`,children:d(e)}),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:f(e)})]})}),Z=({run:e})=>(0,J.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${k(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:O(e.openedAt)}),Q=({pullRequest:e})=>D(e,{onNone:()=>null,onSome:e=>(0,J.jsx)(s,{item:e,className:`relative z-10`})}),Ve=(e,t)=>`${e} ${t}${e===1?``:`s`}`,$=({run:e,pullRequest:t})=>(0,J.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,J.jsx)(`span`,{children:e.agent}),(0,J.jsx)(`span`,{children:Ve(e.attempts.length,`attempt`)}),(0,J.jsx)(X,{run:e}),(0,J.jsx)(Z,{run:e}),(0,J.jsx)(Q,{pullRequest:t})]}),He=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ue=({run:e,onEdit:t,openRun:n,status:r})=>{let i=ve(),a=ye(),[o,s]=(0,Y.useState)(!1);if(i.isPending&&i.variables!==void 0)return(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:h[i.variables.request.action]});if(a.isPending)return(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:c});let d=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),f=()=>a.mutate(P(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,J.jsx)(`span`,{className:`text-needs-you`,children:l}))},onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),p=e.attempts.at(-1),m=He(e),_=p?.outcome?._tag===`Failed`&&p.outcome.failure._tag===`QuestionFailure`,v=[];return e.canApprove&&m!==`approve`&&v.push({label:u.approve,select:()=>d({action:`approve`})}),e.canRetry&&m!==`retry`&&v.push({label:u.retry,description:g(e.agentBrain),select:()=>d({action:`retry`})}),e.canRetry&&v.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(v.push({label:u.runAgain,select:f}),v.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&p!==void 0&&v.push({label:_?`Mark answered`:`Mark resolved`,select:()=>d({action:`resolveFailure`,attemptId:p.id})}),e.canCancel&&v.push({label:u.cancel,destructive:!0,select:()=>s(!0)}),(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[m!==null&&(0,J.jsx)(E,{variant:`outline`,size:`sm`,title:m===`retry`?g(e.agentBrain):void 0,onClick:()=>d({action:m}),children:u[m]}),v.length>0&&(0,J.jsxs)(C,{children:[(0,J.jsx)(w,{render:(0,J.jsx)(E,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${O(e.openedAt)}`,children:(0,J.jsx)(ie,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,J.jsx)(x,{align:`end`,className:`w-auto min-w-44`,children:(0,J.jsx)(S,{children:v.map(({label:e,description:t,destructive:n,select:r})=>(0,J.jsx)(b,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,J.jsx)(me,{open:o,onOpenChange:s,children:(0,J.jsxs)(j,{children:[(0,J.jsxs)(N,{children:[(0,J.jsxs)(he,{children:[`Cancel `,e.loop,`?`]}),(0,J.jsx)(xe,{children:`The run stops, including any attempt in progress.`})]}),(0,J.jsxs)(pe,{children:[(0,J.jsx)(_e,{children:u.keepRunning}),(0,J.jsx)(ge,{variant:`destructive`,onClick:()=>{s(!1),d({action:`cancel`})},children:u.confirmCancel})]})]})})]})},We=8,Ge=({run:e,item:t,pullRequest:n,openRun:r})=>{let[i,a]=(0,Y.useState)(null),[o,c]=(0,Y.useState)(null);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(B,{className:T(K,`[&>td]:align-top`),children:[(0,J.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,J.jsx)(L,{state:e.state}),e.state]})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,J.jsx)(L,{state:e.state,className:`self-center sm:hidden`}),(0,J.jsx)(v,{"data-row-link":!0,to:`/projects/$owner/$name/runs/$run`,params:{...m(e.repository),run:e.id},className:T(`font-medium wrap-anywhere`,W),children:e.loop}),t!==null&&(0,J.jsx)(s,{item:t,className:`relative z-10 shrink-0`})]}),(0,J.jsx)(Be,{run:e}),e.runAgain!==null&&(0,J.jsx)(Pe,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,J.jsx)(Ne,{approval:e.approval,className:`text-xs`}),(0,J.jsx)($,{run:e,pullRequest:n}),o!==null&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs`,children:o})]})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,J.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,J.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,J.jsx)(X,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Z,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Q,{pullRequest:n})}),(0,J.jsx)(V,{className:`py-2.5`,children:(0,J.jsx)(Ue,{run:e,onEdit:a,openRun:r,status:c})})]}),i!==null&&Ee(e,i)&&(0,J.jsx)(B,{className:`hover:bg-transparent`,children:(0,J.jsx)(V,{colSpan:We,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,J.jsx)(De,{run:e,intent:i,close:()=>a(null),openRun:r,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${i}`)})})]})},Ke=({task:e,openRun:t})=>{let n=new Map(e.items.map(e=>[e.itemKey,e])),r=e.items.length>1;return(0,J.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,J.jsx)(q,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsxs)(H,{children:[(0,J.jsx)(Oe,{children:(0,J.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,J.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,J.jsx)(R,{children:`Run`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,J.jsx)(R,{children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,J.jsx)(z,{children:e.runs.map(i=>{let a=oe(ue(i.pullRequestUrl),t=>fe(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,J.jsx)(Ge,{run:i,item:o===null||ae(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},qe=({children:e})=>(0,J.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,J.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),Je=({repository:e,number:t})=>{let{data:n}=F(p()),r=n.projects.find(t=>t.repository===e),i=A(),o=F(be(e,t));if(o.error instanceof se&&o.error.error===`BoardItemNotFoundError`)return(0,J.jsx)(Fe,{repository:e,number:String(t)});let s=o.isError&&(0,J.jsx)(a,{className:`max-w-3xl`,title:`Could not refresh the task`,message:o.error.message}),c=o.data;return c.number===t?(0,J.jsxs)(qe,{children:[s,r!==void 0&&(0,J.jsx)(Re,{task:c,project:r,disabled:n._tag===`NeedsSetup`}),(0,J.jsx)(Ke,{task:c,openRun:i}),(0,J.jsx)(ze,{task:c}),(0,J.jsx)(Le,{task:c})]}):(0,J.jsx)(_,{to:`/projects/$owner/$name/tasks/$number`,params:{...m(e),number:String(c.number)},search:e=>e,replace:!0})},Ye=()=>{let{repository:e}=I.useParams(),{number:t}=I.useLoaderData();return(0,J.jsx)(Je,{repository:e,number:t},`${e}#${t}`)};export{Ye as component};
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{n as r,r as i}from"./page-DPqWAN9v.js";import{t as a}from"./error-alert-BnIKdDdf.js";import{r as o,t as s}from"./mark-Ce_Qn2iu.js";import{C as c,S as l,b as u,h as d,m as f,n as p,r as m,x as h,y as g}from"./overview-DvY74mSl.js";import{t as _}from"./useNavigate-AT5VkfZa.js";import{t as v}from"./link-C7GfYrMt.js";import{n as ee,r as te,s as y,t as ne}from"./moves-1Jmz4a60.js";import{a as re}from"./native-select-BzF8xUnx.js";import{d as ie,i as b,n as x,r as S,t as C,u as w}from"./dropdown-menu-C-3ehl95.js";import{D as T,t as E}from"./button-4rhhIcK8.js";import{In as ae,Kn as D,Rn as oe,S as se,Yn as ce,a as O,f as k,o as le,zn as ue}from"./strings-CKWfinsy.js";import{a as de,r as fe}from"./identity-DBp5VWom.js";import{B as pe,F as me,H as he,I as ge,L as _e,M as ve,N as ye,P as A,R as j,Tt as M,V as N,j as P,jt as F,n as be,t as I,z as xe}from"./index-BokhrH13.js";import{t as Se}from"./use-now-vNgLntlV.js";import{t as Ce}from"./heading-DrqeC647.js";import{t as we}from"./pull-request-marks-CjsCWxyi.js";import{n as L,t as Te}from"./status-badge-CLPsMXtK.js";import{n as Ee,t as De}from"./edit-and-retry-DePAvp50.js";import{a as Oe,i as R,n as z,o as B,r as V,t as H}from"./table-hbKjhjeL.js";import{t as U}from"./fill-cell-CjksmixH.js";import{t as ke}from"./label-badge-D96gAMUo.js";import{a as Ae,n as je,t as Me}from"./model-DBl1SZtu.js";import{n as Ne,t as Pe}from"./run-again-BO19VxAH.js";import{t as Fe}from"./not-found-c4c84AV-.js";import{i as W,n as G,r as K,t as q}from"./section-BwxXJ9H0.js";var J=t(),Ie=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${k(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${k(e.postedAt)}`},Le=({task:e})=>{let t=new Map(e.runs.map(e=>[e.id,e])),n=new Map(e.items.map(e=>[e.itemKey,e]));return(0,J.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,J.jsx)(q,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,J.jsx)(z,{className:`border-t`,children:e.comments.map(e=>{let r=t.get(e.runId),i=r===void 0?void 0:n.get(r.itemKey),a=Ie(e);return(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${W}`,children:[je(e.kind),i!==void 0&&(0,J.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,J.jsx)(s,{item:i,linked:!1})]})]})}),(0,J.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,J.jsx)(v,{to:`/projects/$owner/$name/runs/$run`,params:{...m(r.repository),run:r.id},className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:r.loop})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:a!==null&&(0,J.jsx)(`time`,{dateTime:a.at,title:a.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(a.at)})})]},e.url)})})})})]})},Re=({task:e,project:t,disabled:n})=>{let s=ne(t),[c]=e.items,l=e.items.find(({itemKey:t})=>t===e.current)??c,u=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),d=u===void 0?void 0:s.moves.find(({itemKey:e})=>e===u.card.itemKey),f=u===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==u.lane.id),p=t.board.lanes.find(({id:e})=>e===d?.toLane)?.name??u?.lane.name??e.lane.name,m=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),h=u===void 0?l.labels:te(u.card,u.lane).filter(e=>d===void 0||!m.has(e)),g=new Map(t.labels.map(e=>[e.name,e])),_=!n&&!s.isPending&&d===void 0&&f.length>0,{origin:v,pullRequests:y}=de(e.items);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(i,{actionsBeside:`sm`,heading:(0,J.jsx)(Ce,{variant:`page`,item:ce(v),title:e.title}),facts:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(we,{pullRequests:y}),(0,J.jsx)(r,{icon:M,title:`Lane`,children:(0,J.jsx)(`span`,{className:`text-foreground`,children:p})}),d!==void 0&&(0,J.jsx)(`span`,{role:`status`,children:ee(d.phase)}),h.length>0&&(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:h.map(e=>(0,J.jsx)(ke,{name:e,label:g.get(e)},e))}),e.needsYou&&(0,J.jsx)(Te,{})]}),...u!==void 0&&_?{actions:(0,J.jsxs)(C,{children:[(0,J.jsxs)(w,{render:(0,J.jsx)(E,{variant:`outline`}),"aria-label":`Move ${o(l)} to another lane`,children:[`Move to`,(0,J.jsx)(re,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,J.jsx)(x,{align:`end`,className:`w-auto min-w-40`,children:(0,J.jsx)(S,{children:f.map(e=>(0,J.jsx)(b,{onClick:()=>s.moveItem(u.card,e),children:e.name},e.id))})})]})}:{}}),s.error!==null&&(0,J.jsx)(a,{className:`max-w-3xl`,message:s.error.message})]})},ze=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,J.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,J.jsx)(q,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,J.jsx)(z,{className:`border-t`,children:t.map(e=>(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(V,{className:`w-0 py-3`,children:(0,J.jsx)(s,{item:e,linked:!1})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${W}`,children:[e.title,(0,J.jsx)(y,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,J.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},Y=n(e(),1),X=({run:e})=>{let t=Se(3e4);return D(Me(e,t),{onNone:()=>null,onSome:e=>(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:le(e)})})},Be=({run:e})=>D(Ae(e),{onNone:()=>null,onSome:e=>(0,J.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:f(e),children:[(0,J.jsx)(`span`,{className:`font-medium text-destructive`,children:d(e)}),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:f(e)})]})}),Z=({run:e})=>(0,J.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${k(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:O(e.openedAt)}),Q=({pullRequest:e})=>D(e,{onNone:()=>null,onSome:e=>(0,J.jsx)(s,{item:e,className:`relative z-10`})}),Ve=(e,t)=>`${e} ${t}${e===1?``:`s`}`,$=({run:e,pullRequest:t})=>(0,J.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,J.jsx)(`span`,{children:e.agent}),(0,J.jsx)(`span`,{children:Ve(e.attempts.length,`attempt`)}),(0,J.jsx)(X,{run:e}),(0,J.jsx)(Z,{run:e}),(0,J.jsx)(Q,{pullRequest:t})]}),He=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ue=({run:e,onEdit:t,openRun:n,status:r})=>{let i=ve(),a=ye(),[o,s]=(0,Y.useState)(!1);if(i.isPending&&i.variables!==void 0)return(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:h[i.variables.request.action]});if(a.isPending)return(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:c});let d=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),f=()=>a.mutate(P(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,J.jsx)(`span`,{className:`text-needs-you`,children:l}))},onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),p=e.attempts.at(-1),m=He(e),_=p?.outcome?._tag===`Failed`&&p.outcome.failure._tag===`QuestionFailure`,v=[];return e.canApprove&&m!==`approve`&&v.push({label:u.approve,select:()=>d({action:`approve`})}),e.canRetry&&m!==`retry`&&v.push({label:u.retry,description:g(e.agentBrain),select:()=>d({action:`retry`})}),e.canRetry&&v.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(v.push({label:u.runAgain,select:f}),v.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&p!==void 0&&v.push({label:_?`Mark answered`:`Mark resolved`,select:()=>d({action:`resolveFailure`,attemptId:p.id})}),e.canCancel&&v.push({label:u.cancel,destructive:!0,select:()=>s(!0)}),(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[m!==null&&(0,J.jsx)(E,{variant:`outline`,size:`sm`,title:m===`retry`?g(e.agentBrain):void 0,onClick:()=>d({action:m}),children:u[m]}),v.length>0&&(0,J.jsxs)(C,{children:[(0,J.jsx)(w,{render:(0,J.jsx)(E,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${O(e.openedAt)}`,children:(0,J.jsx)(ie,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,J.jsx)(x,{align:`end`,className:`w-auto min-w-44`,children:(0,J.jsx)(S,{children:v.map(({label:e,description:t,destructive:n,select:r})=>(0,J.jsx)(b,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,J.jsx)(me,{open:o,onOpenChange:s,children:(0,J.jsxs)(j,{children:[(0,J.jsxs)(N,{children:[(0,J.jsxs)(he,{children:[`Cancel `,e.loop,`?`]}),(0,J.jsx)(xe,{children:`The run stops, including any attempt in progress.`})]}),(0,J.jsxs)(pe,{children:[(0,J.jsx)(_e,{children:u.keepRunning}),(0,J.jsx)(ge,{variant:`destructive`,onClick:()=>{s(!1),d({action:`cancel`})},children:u.confirmCancel})]})]})})]})},We=8,Ge=({run:e,item:t,pullRequest:n,openRun:r})=>{let[i,a]=(0,Y.useState)(null),[o,c]=(0,Y.useState)(null);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(B,{className:T(K,`[&>td]:align-top`),children:[(0,J.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,J.jsx)(L,{state:e.state}),e.state]})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,J.jsx)(L,{state:e.state,className:`self-center sm:hidden`}),(0,J.jsx)(v,{"data-row-link":!0,to:`/projects/$owner/$name/runs/$run`,params:{...m(e.repository),run:e.id},className:T(`font-medium wrap-anywhere`,W),children:e.loop}),t!==null&&(0,J.jsx)(s,{item:t,className:`relative z-10 shrink-0`})]}),(0,J.jsx)(Be,{run:e}),e.runAgain!==null&&(0,J.jsx)(Pe,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,J.jsx)(Ne,{approval:e.approval,className:`text-xs`}),(0,J.jsx)($,{run:e,pullRequest:n}),o!==null&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs`,children:o})]})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,J.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,J.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,J.jsx)(X,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Z,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Q,{pullRequest:n})}),(0,J.jsx)(V,{className:`py-2.5`,children:(0,J.jsx)(Ue,{run:e,onEdit:a,openRun:r,status:c})})]}),i!==null&&Ee(e,i)&&(0,J.jsx)(B,{className:`hover:bg-transparent`,children:(0,J.jsx)(V,{colSpan:We,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,J.jsx)(De,{run:e,intent:i,close:()=>a(null),openRun:r,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${i}`)})})]})},Ke=({task:e,openRun:t})=>{let n=new Map(e.items.map(e=>[e.itemKey,e])),r=e.items.length>1;return(0,J.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,J.jsx)(q,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsxs)(H,{children:[(0,J.jsx)(Oe,{children:(0,J.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,J.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,J.jsx)(R,{children:`Run`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,J.jsx)(R,{children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,J.jsx)(z,{children:e.runs.map(i=>{let a=oe(ue(i.pullRequestUrl),t=>fe(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,J.jsx)(Ge,{run:i,item:o===null||ae(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},qe=({children:e})=>(0,J.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,J.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),Je=({repository:e,number:t})=>{let{data:n}=F(p()),r=n.projects.find(t=>t.repository===e),i=A(),o=F(be(e,t));if(o.error instanceof se&&o.error.error===`BoardItemNotFoundError`)return(0,J.jsx)(Fe,{repository:e,number:String(t)});let s=o.isError&&(0,J.jsx)(a,{className:`max-w-3xl`,title:`Could not refresh the task`,message:o.error.message}),c=o.data;return c.number===t?(0,J.jsxs)(qe,{children:[s,r!==void 0&&(0,J.jsx)(Re,{task:c,project:r,disabled:n._tag===`NeedsSetup`}),(0,J.jsx)(Ke,{task:c,openRun:i}),(0,J.jsx)(ze,{task:c}),(0,J.jsx)(Le,{task:c})]}):(0,J.jsx)(_,{to:`/projects/$owner/$name/tasks/$number`,params:{...m(e),number:String(c.number)},search:e=>e,replace:!0})},Ye=()=>{let{repository:e}=I.useParams(),{number:t}=I.useLoaderData();return(0,J.jsx)(Je,{repository:e,number:t},`${e}#${t}`)};export{Ye as component};
|