@usine/server 0.5.1-next.329.g45bb9cb.1.1 → 0.5.1-next.330.g25728fa.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/web/assets/_agent-BmeUoIgN.js +1 -0
- package/dist/web/assets/_label-QcOyio8i.js +1 -0
- package/dist/web/assets/_loop-C8FPRS4o.js +1 -0
- package/dist/web/assets/{_name-OTaiAsxQ.js → _name-DKYl4pbN.js} +1 -1
- package/dist/web/assets/{_number-e7Qqz6sP.js → _number-B08o6_Mc.js} +1 -1
- package/dist/web/assets/{_number-T2PgqSow.js → _number-BX3NAfLr.js} +1 -1
- package/dist/web/assets/_number-DoggQLfl.js +1 -0
- package/dist/web/assets/{_project-DoVtW-8H.js → _project-BCPECtCv.js} +1 -1
- package/dist/web/assets/{_project-G_8LMZbV.js → _project-BbVbTBR-.js} +1 -1
- package/dist/web/assets/_project-DoggQLfl.js +1 -0
- package/dist/web/assets/{_run-CopuX642.js → _run-CBFham2t.js} +1 -1
- package/dist/web/assets/_run-DoggQLfl.js +1 -0
- package/dist/web/assets/{_worker-CnB8aB-F.js → _worker-Byt3D8N0.js} +1 -1
- package/dist/web/assets/{action-DLnjcb9H.js → action-CnJBcylx.js} +1 -1
- package/dist/web/assets/{actions-CDBaDyOF.js → actions-CVebv7VX.js} +1 -1
- package/dist/web/assets/{agents-mDOuIrwx.js → agents-1uoQQAKB.js} +1 -1
- package/dist/web/assets/agents-BFOIAmzn.js +1 -0
- package/dist/web/assets/api-_wVaJ3mw.js +335 -0
- package/dist/web/assets/{code-block-gqdVd2X_.js → code-block-BxiURrdR.js} +1 -1
- package/dist/web/assets/{drawer-BIP3U3vk.js → drawer-CsaVYv48.js} +1 -1
- package/dist/web/assets/{edit-and-retry-CMeOt3Df.js → edit-and-retry-DMtmkIrn.js} +1 -1
- package/dist/web/assets/{file-error-CqjXHwcR.js → file-error-BprnhwZ1.js} +1 -1
- package/dist/web/assets/{history-DcBYGGIR.js → history-C-vIB22Z.js} +1 -1
- package/dist/web/assets/{index-C4BBFDrw.js → index-Bnfkxo8V.js} +3 -3
- package/dist/web/assets/{label-badge-BhVy1gv4.js → label-badge-CY1GjBOb.js} +1 -1
- package/dist/web/assets/{labels-3AGuK5Pp.js → labels-LxIV1E_s.js} +1 -1
- package/dist/web/assets/{list-B9-XhiTd.js → list-Bqk74eQn.js} +1 -1
- package/dist/web/assets/loops-BTUQ9jWg.js +1 -0
- package/dist/web/assets/{members-Cxpb-dPt.js → members-wOOaGt0b.js} +1 -1
- package/dist/web/assets/{model-Bx9jBUNv.js → model-DASfGPZO.js} +1 -1
- package/dist/web/assets/{moves-DC5EM_e8.js → moves-tp1tistE.js} +1 -1
- package/dist/web/assets/{not-found-D4EedbGj.js → not-found-DL09nMmQ.js} +1 -1
- package/dist/web/assets/{outcome-D6hiGQAA.js → outcome-CS4eSPQF.js} +1 -1
- package/dist/web/assets/{overview-DKGL6LW9.js → overview-CguPX45J.js} +1 -1
- package/dist/web/assets/{page-LiZtJ7q6.js → page-DpBr9Xsm.js} +1 -1
- package/dist/web/assets/{projects-vGmA2vOj.js → projects-D63RE6Bb.js} +1 -1
- package/dist/web/assets/{queries-CgdAnlaK.js → queries-BbcxuosX.js} +1 -1
- package/dist/web/assets/{queries-DPnwjxcH.js → queries-CDrLXfWQ.js} +1 -1
- package/dist/web/assets/{queries-Drg1Az2O.js → queries-CRfrxdfM.js} +1 -1
- package/dist/web/assets/{queries-B4-YLPsS.js → queries-DGL6htnB.js} +1 -1
- package/dist/web/assets/{repositories-Dmb9Ubut.js → repositories-DU48txqj.js} +1 -1
- package/dist/web/assets/{repository-link-BnxEC9FC.js → repository-link-CkNtGosL.js} +1 -1
- package/dist/web/assets/route-DFtDndm8.js +1 -0
- package/dist/web/assets/route-DL0MI6v7.js +1 -0
- package/dist/web/assets/{route-status-B0Th9xlq.js → route-status-CmbS3jMw.js} +1 -1
- package/dist/web/assets/{routes-CPH3Xvvs.js → routes-CNidBFxL.js} +1 -1
- package/dist/web/assets/routes-DoggQLfl.js +1 -0
- package/dist/web/assets/{run-again-DFbjVEn3.js → run-again-nKv7W5_B.js} +1 -1
- package/dist/web/assets/{section-DkBkFpGt.js → section-BvzDfyI3.js} +1 -1
- package/dist/web/assets/section-D6y3qhNk.js +24 -0
- package/dist/web/assets/{section-CuYfDRlH.js → section-DFffczbG.js} +1 -1
- package/dist/web/assets/{settings-Dt7u63l0.js → settings-DP4byGBf.js} +1 -1
- package/dist/web/assets/{sign-in-R6G3Bj20.js → sign-in-Pt4K99Ss.js} +1 -1
- package/dist/web/assets/{slots-CmDPsVGX.js → slots-BrGY_pAb.js} +1 -1
- package/dist/web/assets/strings-D6bizAqq.js +1 -0
- package/dist/web/assets/{tasks-ATw0BeCj.js → tasks-Dh5z6X78.js} +1 -1
- package/dist/web/assets/tasks-DoggQLfl.js +1 -0
- package/dist/web/assets/{tokens-CqJhDxOw.js → tokens-BDsLd4p8.js} +1 -1
- package/dist/web/assets/{usage-CPhvz2A8.js → usage-BNQe0Iko.js} +1 -1
- package/dist/web/assets/{use-project-links-DeAFv-c5.js → use-project-links-B_TcQCMF.js} +1 -1
- package/dist/web/assets/{useTriggerFocusGuards-EmnnwfGx.js → useTriggerFocusGuards-VVhgPwg5.js} +1 -1
- package/dist/web/assets/{workers-5cLTZVn9.js → workers-B3e7LHbY.js} +1 -1
- package/dist/web/index.html +12 -12
- package/package.json +10 -10
- package/dist/web/assets/_agent-D6lYe62T.js +0 -1
- package/dist/web/assets/_label-BjHTRfgA.js +0 -1
- package/dist/web/assets/_loop-CtovyWGf.js +0 -1
- package/dist/web/assets/_number-CEYWEWNQ.js +0 -1
- package/dist/web/assets/_project-CEYWEWNQ.js +0 -1
- package/dist/web/assets/_run-CEYWEWNQ.js +0 -1
- package/dist/web/assets/agents-DCl0Ehkr.js +0 -1
- package/dist/web/assets/api-DhPASHUl.js +0 -335
- package/dist/web/assets/loops-DZGzV4ce.js +0 -1
- package/dist/web/assets/route-C2ZALuHm.js +0 -1
- package/dist/web/assets/route-CWAoDptJ.js +0 -1
- package/dist/web/assets/routes-CEYWEWNQ.js +0 -1
- package/dist/web/assets/section-D_SqVksR.js +0 -24
- package/dist/web/assets/strings-B4zsKcNR.js +0 -1
- package/dist/web/assets/tasks-CEYWEWNQ.js +0 -1
package/README.md
CHANGED
|
@@ -207,3 +207,7 @@ Loop checks at `/api/configuration/loops/check` validate integer CEL priorities.
|
|
|
207
207
|
`GET /api/openapi.json` publicly serves the generated OpenAPI 3.1 contract, including sign-in, members, and tokens. It describes request and response schemas and authentication requirements without reading instance state. See the [HTTP API reference](https://docs.usine.dev/reference/operator-api/) for endpoint descriptions and the downloadable document.
|
|
208
208
|
|
|
209
209
|
Route definitions and schema annotations generate the contract. Authentication handlers use the paths and request schemas in `src/auth/api.ts`; the server combines those definitions with `OperatorApi` in `src/openapi.ts`. After changing a contract, regenerate and commit `apps/docs/public/openapi.json` as described in the [docs README](../docs/README.md#operator-http-api-reference).
|
|
210
|
+
|
|
211
|
+
`POST /api/configuration/loops/check` validates conditional approval as a boolean
|
|
212
|
+
CEL expression in the trigger's environment. Approval diagnostics use the
|
|
213
|
+
`approval` field path. Run and overview responses include the saved decision.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./useSuspenseQuery-ajaZl96Y.js";import{n}from"./queries-CDrLXfWQ.js";import{d as r}from"./index-Bnfkxo8V.js";import{t as i}from"./agents-1uoQQAKB.js";var a=e(),o=()=>{let{agent:e}=r.useParams(),{data:o}=t(n());return(0,a.jsx)(i,{name:e,configuration:o})};export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{at as t,t as n}from"./section-D6y3qhNk.js";import{u as r}from"./index-Bnfkxo8V.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{D as t,E as n,a as r,at 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-D6y3qhNk.js";import{t as g}from"./useSuspenseQuery-ajaZl96Y.js";import{t as _}from"./link-3oQYoIpm.js";import{n as v,r as y}from"./list-Bqk74eQn.js";import{r as b}from"./strings-BIVdGoBr.js";import{t as x}from"./error-alert-Bq-SD6of.js";import{n as S}from"./queries-CDrLXfWQ.js";import{at as C,l as w,v as T}from"./index-Bnfkxo8V.js";import{t as E}from"./file-error-BprnhwZ1.js";import{t as D}from"./repository-link-CkNtGosL.js";var O=e(),k=({loop:e,configuration:t})=>{let i=t.projects.find(t=>e.name.startsWith(`${t.id}/`)),a=t.agents.find(({name:t})=>t===e.agent);return(0,O.jsxs)(r,{children:[i!==void 0&&(0,O.jsx)(o,{label:`Project`,children:(0,O.jsx)(_,{to:`/configuration/projects/$project`,params:{project:i.id},className:`text-primary hover:underline`,children:i.name})}),(0,O.jsxs)(o,{label:`Agent`,children:[(0,O.jsx)(_,{to:`/configuration/agents/$agent`,params:{agent:e.agent},className:`text-primary hover:underline`,children:e.agent}),a!==void 0&&(0,O.jsx)(`p`,{className:`mt-0.5 font-mono text-xs text-muted-foreground`,children:b(a)})]}),(0,O.jsx)(o,{label:`Repositories`,children:e.repositories.length===0?(0,O.jsx)(m,{children:`No registered repository matches the selector`}):(0,O.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.repositories.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsx)(D,{repository:e})},e))})}),(0,O.jsxs)(o,{label:`Approval`,children:[h(e.approval),e.approval!==`none`&&e.approval!==`required`&&(0,O.jsx)(`code`,{className:`block text-xs wrap-anywhere`,children:e.approval})]}),(0,O.jsxs)(o,{label:`Max cycles`,children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.maxCycles}),` `,(0,O.jsx)(m,{children:`runs per item before a reset`})]}),(0,O.jsx)(o,{label:`Permissions`,children:n[e.permissions]}),(0,O.jsx)(o,{label:`Priority`,children:e.priority===null?(0,O.jsx)(m,{children:`0; ties use lane order`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,O.jsx)(m,{children:`higher values go first; ties use lane order`})]})}),(0,O.jsx)(o,{label:`Step`,children:(0,O.jsx)(`code`,{className:`font-mono text-xs`,children:e.step})})]})},A=e=>[[`on`,e.stream],[`if`,e.condition],...e.cron===null?[]:[[`cron`,e.cron]],...e.timeZone===null?[]:[[`tz`,e.timeZone]]],j=({repos:e,tags:t})=>[...e===null?[]:[[`repos`,e.join(`, `)]],...t===null?[]:[[`tags`,t.join(`, `)]]],M=({loop:e,configuration:n,pause:r})=>{let i=s(e.prompt).length;return(0,O.jsxs)(O.Fragment,{children:[r?.isError===!0&&(0,O.jsx)(x,{message:r.error.message}),(0,O.jsxs)(c,{facts:(0,O.jsx)(k,{loop:e,configuration:n}),children:[(0,O.jsxs)(d,{title:`Trigger`,children:[(0,O.jsx)(l,{entries:A(e)}),e.undeclaredLabels.length>0&&(0,O.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,O.jsx)(C,{weight:`fill`,className:`mt-0.5 size-3 shrink-0 text-warning`}),(0,O.jsxs)(`span`,{children:[`Condition uses`,` `,e.undeclaredLabels.length===1?`an undeclared label`:`undeclared labels`,`:`,` `,e.undeclaredLabels.join(`, `),`. usine creates only the labels under`,` `,(0,O.jsx)(`code`,{children:`labels`}),` in `,(0,O.jsx)(`code`,{children:`usine.yaml`}),`.`]})]})]}),(0,O.jsx)(d,{title:`Selector`,children:e.selector===null?(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:`No selector: every registered repository`}):(0,O.jsx)(l,{entries:j(e.selector)})}),(0,O.jsx)(d,{title:`Prompt`,aside:i===0?`Same text for every run`:`${t(i,`outlined expression`)} filled in from each item`,children:(0,O.jsx)(u,{template:e.prompt})})]})]})},N=({name:e,configuration:t,pause:n})=>{let r=t.loops.find(t=>t.name===e);if(r!==void 0)return(0,O.jsx)(p,{entity:i(`loop`,e),title:r.name,marks:(0,O.jsx)(y,{paused:r.paused}),file:r.file,actions:n!==null&&(0,O.jsx)(v,{loop:r,pause:n,variant:`outline`}),children:(0,O.jsx)(M,{loop:r,configuration:t,pause:n})});let o=t.quarantinedLoops.find(t=>t.name===e);return o===void 0?(0,O.jsx)(p,{entity:i(`loop`,e),title:e,children:(0,O.jsxs)(f,{title:`Loop not found`,children:[`The configuration has no file `,(0,O.jsxs)(`code`,{children:[`loops/`,e,`.md`]}),`.`,` `,(0,O.jsx)(_,{to:`/configuration/loops`,className:`text-primary hover:underline`,children:`See all loops`}),`.`]})}):(0,O.jsx)(p,{entity:i(`loop`,e),title:o.name,marks:(0,O.jsx)(a,{}),file:o.file,children:(0,O.jsx)(E,{error:o.error,consequence:`No runs until the file loads.`})})},P=()=>{let{loop:e}=w.useParams(),{data:t}=g(S());return(0,O.jsx)(N,{name:e,configuration:t,pause:T()})};export{P as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{P as t,a as n,at as r,i,n as a,r as o,s,t as c,u as l}from"./section-
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{P as t,a as n,at as r,i,n as a,r as o,s,t as c,u as l}from"./section-D6y3qhNk.js";import{t as u}from"./useSuspenseQuery-ajaZl96Y.js";import{t as d}from"./link-3oQYoIpm.js";import{n as f}from"./queries-CDrLXfWQ.js";import{Y as p,a as m}from"./index-Bnfkxo8V.js";import{t as h}from"./label-badge-CY1GjBOb.js";var g=e(),_=({label:e})=>e.failure===null?e.onGitHub===!1?(0,g.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,g.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),v=({repository:e,project:r})=>(0,g.jsxs)(n,{children:[(0,g.jsx)(i,{label:t.project,children:r===void 0?(0,g.jsx)(l,{children:t.unassignedProject}):(0,g.jsx)(d,{to:`/configuration/projects/$project`,params:{project:r.id},className:`text-primary hover:underline`,children:r.name})}),r!==void 0&&(0,g.jsx)(i,{label:`Board`,children:(0,g.jsx)(d,{to:`/projects/$project`,params:{project:r.id},className:`text-primary hover:underline`,children:t.board})}),(0,g.jsx)(i,{label:`Tags`,children:e.tags.length===0?(0,g.jsx)(l,{children:`None`}):e.tags.join(`, `)}),(0,g.jsx)(i,{label:`Loops`,children:e.loops.length===0?(0,g.jsx)(l,{children:`Not selected by any loop`}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.loops.map(e=>(0,g.jsx)(`li`,{children:(0,g.jsx)(d,{to:`/configuration/loops/$loop`,params:{loop:e},className:`text-primary hover:underline`,children:e})},e))})})]}),y=({owner:e,name:t,configuration:n})=>{let i=`${e}/${t}`,u=n.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return u===void 0?(0,g.jsx)(c,{entity:r(`repository`,i),title:i,children:(0,g.jsxs)(s,{title:`Repository not registered`,children:[i,` is not under `,(0,g.jsx)(`code`,{children:`repos`}),` in `,(0,g.jsx)(`code`,{children:`usine.yaml`}),`.`,` `,(0,g.jsx)(d,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,g.jsx)(c,{entity:r(`repository`,u.name),title:u.name,leading:(0,g.jsx)(p,{repository:u.name,size:`title`}),children:(0,g.jsx)(a,{facts:(0,g.jsx)(v,{repository:u,project:n.projects.find(e=>e.includes(u.name))}),children:(0,g.jsx)(o,{title:`Labels usine creates`,aside:`From labels in usine.yaml`,children:u.declaredLabels.length===0?(0,g.jsxs)(`p`,{className:`text-muted-foreground`,children:[`No labels under `,(0,g.jsx)(`code`,{children:`labels`}),` in `,(0,g.jsx)(`code`,{children:`usine.yaml`}),`.`]}):(0,g.jsx)(`ul`,{className:`flex flex-col gap-2`,children:u.declaredLabels.map(e=>(0,g.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,g.jsx)(h,{name:e.name,label:e}),(0,g.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,g.jsx)(l,{children:`On GitHub`}):(0,g.jsx)(_,{label:e})})]},e.name))})})})})},b=()=>{let{owner:e,name:t}=m.useParams(),{data:n}=u(f());return(0,g.jsx)(y,{owner:e,name:t,configuration:n})};export{b as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./use-project-links-DeAFv-c5.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{n as a,t as o}from"./useNavigate-I5E4IRt2.js";import{t as s}from"./link-3oQYoIpm.js";import{r as c,t as l}from"./mark-lp0qzo_h.js";import{c as u,l as d,n as f,s as p,t as ee}from"./moves-DC5EM_e8.js";import{r as te}from"./native-select-BCc0nbNt.js";import{a as m,c as h,h as g,i as _,l as v,n as y,o as b,s as x,v as S}from"./actions-CDBaDyOF.js";import{r as C,t as w}from"./button-CzVqBv_O.js";import{l as ne,s as T}from"./useTriggerFocusGuards-EmnnwfGx.js";import{i as E}from"./context-8jHKzDOY.js";import{Dn as re,En as ie,Ln as ae,Pn as D,a as oe,wn as se}from"./api-DhPASHUl.js";import{o as O,s as ce,v as k}from"./strings-BIVdGoBr.js";import{D as A,F as le,I as ue,L as de,N as j,O as fe,P as M,i as N,n as pe,r as me}from"./overview-DKGL6LW9.js";import{a as he,n as ge,r as _e}from"./page-LiZtJ7q6.js";import{t as P}from"./error-alert-Bq-SD6of.js";import{A as F,D as I,F as ve,M as ye,N as be,O as xe,P as Se,R as Ce,j as we,k as Te,lt as Ee,n as De,t as Oe}from"./index-C4BBFDrw.js";import{t as ke}from"./pull-request-marks-_FfWkWIz.js";import{n as L,t as Ae}from"./status-badge-B2-vzEoZ.js";import{n as je,t as Me}from"./edit-and-retry-CMeOt3Df.js";import{a as Ne,i as R,n as z,o as B,r as V,t as H}from"./table-CKp2wE4u.js";import{t as U}from"./fill-cell-BtM3J7oO.js";import{t as Pe}from"./label-badge-BhVy1gv4.js";import{a as Fe,n as Ie,t as Le}from"./model-Bx9jBUNv.js";import{n as Re,t as ze}from"./run-again-DFbjVEn3.js";import{a as Be,i as W,n as G,r as K,t as q}from"./section-DkBkFpGt.js";import{t as Ve}from"./not-found-D4EedbGj.js";var J=n(),He=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)}`},Ue=({task:e})=>{let t=r(),n=new Map(e.runs.map(e=>[e.id,e])),i=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=n.get(e.runId),a=r===void 0?void 0:i.get(r.itemKey),o=He(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:[Ie(e.kind),a!==void 0&&(0,J.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,J.jsx)(l,{item:a,linked:!1})]})]})}),(0,J.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,J.jsx)(s,{...t.run(r.repository,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:o!==null&&(0,J.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(o.at)})})]},e.url)})})})})]})},We=({task:e,project:t,disabled:n})=>{let r=ee(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,o=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),s=o===void 0?void 0:r.moves.find(({itemKey:e})=>e===o.card.itemKey),l=o===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==o.lane.id),d=t.board.lanes.find(({id:e})=>e===s?.toLane)?.name??o?.lane.name??e.lane.name,m=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),_=o===void 0?a.labels:f(o.card,o.lane).filter(e=>s===void 0||!m.has(e)),y=new Map(t.labels.map(e=>[e.name,e])),S=!n&&!r.isPending&&s===void 0&&l.length>0;E(o!==void 0&&S?l.map(e=>({label:u(e.name),run:()=>r.moveItem(o.card,e)})):[]);let{origin:C,pullRequests:T}=ne(e.items);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(_e,{actionsBeside:`sm`,heading:(0,J.jsx)(Ce,{variant:`page`,item:ae(C),title:e.title}),facts:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ke,{pullRequests:T}),(0,J.jsx)(ge,{icon:Ee,title:`Lane`,children:(0,J.jsx)(`span`,{className:`text-foreground`,children:d})}),s!==void 0&&(0,J.jsx)(`span`,{role:`status`,children:p(s.phase)}),_.length>0&&(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:_.map(e=>(0,J.jsx)(Pe,{name:e,label:y.get(e)},e))}),e.needsYou&&(0,J.jsx)(Ae,{})]}),...o!==void 0&&S?{actions:(0,J.jsxs)(b,{children:[(0,J.jsxs)(g,{render:(0,J.jsx)(w,{variant:`outline`}),"aria-label":`Move ${c(a)} to another lane`,children:[`Move to`,(0,J.jsx)(te,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,J.jsx)(x,{align:`end`,className:`w-auto min-w-40`,children:(0,J.jsx)(h,{children:l.map(e=>(0,J.jsx)(v,{onClick:()=>r.moveItem(o.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,J.jsx)(P,{className:`max-w-3xl`,message:r.error.message})]})},Ge=({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)(l,{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)(d,{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=e(t(),1),X=({run:e})=>{let t=he(3e4);return D(Le(e,t),{onNone:()=>null,onSome:e=>(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:ce(e)})})},Ke=({run:e})=>D(Fe(e),{onNone:()=>null,onSome:e=>(0,J.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:A(e),children:[(0,J.jsx)(`span`,{className:`font-medium text-destructive`,children:fe(e)}),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:A(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)(l,{item:e,className:`relative z-10`})}),qe=(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:qe(e.attempts.length,`attempt`)}),(0,J.jsx)(X,{run:e}),(0,J.jsx)(Z,{run:e}),(0,J.jsx)(Q,{pullRequest:t})]}),Je=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ye=({run:e,onEdit:t,openRun:n,status:r})=>{let i=_(),a=m(),[o,s]=(0,Y.useState)(!1),c=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),l=()=>a.mutate(y(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,J.jsx)(`span`,{className:`text-needs-you`,children:ue}))},onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),u=e.attempts.at(-1),d=Je(e),f=u?.outcome?._tag===`Failed`&&u.outcome.failure._tag===`QuestionFailure`,p=[];return e.canApprove&&d!==`approve`&&p.push({label:M.approve,select:()=>c({action:`approve`})}),e.canRetry&&d!==`retry`&&p.push({label:M.retry,description:j(e.agentBrain),select:()=>c({action:`retry`})}),e.canRetry&&p.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(p.push({label:M.runAgain,select:l}),p.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&u!==void 0&&p.push({label:f?`Mark answered`:`Mark resolved`,select:()=>c({action:`resolveFailure`,attemptId:u.id})}),e.canCancel&&p.push({label:M.cancel,destructive:!0,select:()=>s(!0)}),E(i.isPending||a.isPending||o?[]:[...d===null?[]:[{label:M[d],select:()=>c({action:d})}],...p].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i.isPending&&i.variables!==void 0?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:le[i.variables.request.action]}):a.isPending?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:de}):(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[d!==null&&(0,J.jsx)(w,{variant:`outline`,size:`sm`,title:d===`retry`?j(e.agentBrain):void 0,onClick:()=>c({action:d}),children:M[d]}),p.length>0&&(0,J.jsxs)(b,{children:[(0,J.jsx)(g,{render:(0,J.jsx)(w,{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)(S,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,J.jsx)(x,{align:`end`,className:`w-auto min-w-44`,children:(0,J.jsx)(h,{children:p.map(({label:e,description:t,destructive:n,select:r})=>(0,J.jsx)(v,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,J.jsx)(xe,{open:o,onOpenChange:s,children:(0,J.jsxs)(we,{children:[(0,J.jsxs)(Se,{children:[(0,J.jsxs)(ve,{children:[`Cancel `,e.loop,`?`]}),(0,J.jsx)(ye,{children:`The run stops, including any attempt in progress.`})]}),(0,J.jsxs)(be,{children:[(0,J.jsx)(F,{children:M.keepRunning}),(0,J.jsx)(Te,{variant:`destructive`,onClick:()=>{s(!1),c({action:`cancel`})},children:M.confirmCancel})]})]})})]})},Xe=8,Ze=({run:e,item:t,pullRequest:n,openRun:i})=>{let a=r(),[o,c]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(B,{className:C(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,className:`ml-0.75`}),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:`ml-0.75 self-center sm:hidden`}),(0,J.jsx)(s,{"data-row-link":!0,...a.run(e.repository,e.id),className:C(`font-medium wrap-anywhere`,W),children:e.loop}),t!==null&&(0,J.jsx)(l,{item:t,className:`relative z-10 shrink-0`})]}),(0,J.jsx)(Ke,{run:e}),e.runAgain!==null&&(0,J.jsx)(ze,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,J.jsx)(Re,{approval:e.approval,className:`text-xs`}),(0,J.jsx)($,{run:e,pullRequest:n}),u!==null&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs`,children:u})]})}),(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)(Ye,{run:e,onEdit:c,openRun:i,status:d})})]}),o!==null&&je(e,o)&&(0,J.jsx)(B,{className:`hover:bg-transparent`,children:(0,J.jsx)(V,{colSpan:Xe,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,J.jsx)(Me,{run:e,intent:o,close:()=>c(null),openRun:i,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${o}`)})})]})},Qe=({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)(Ne,{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=ie(re(i.pullRequestUrl),t=>T(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,J.jsx)(Ze,{run:i,item:o===null||se(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},$e=({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})}),et=({repository:e,number:t})=>{let{data:n}=i(pe()),r=me(n.projects,e),s=a(),c=I(),l=i(De(e,t));if(l.error instanceof oe&&l.error.error===`BoardItemNotFoundError`)return(0,J.jsx)(Ve,{repository:e,number:String(t)});let u=l.isError&&(0,J.jsx)(P,{className:`max-w-3xl`,title:`Could not refresh the task`,message:l.error.message}),d=l.data;return d.number!==t&&r!==void 0?(0,J.jsx)(o,{to:`/projects/$project/tasks/$number`,params:{project:N(r),number:String(d.number)},search:t=>({...t,repository:e}),replace:!0}):(0,J.jsxs)($e,{children:[r!==void 0&&r.repositories.length>1&&(0,J.jsx)(Be,{repositories:r.repositories,value:e,onChange:e=>void s({to:`/projects/$project/tasks`,params:{project:N(r)},search:{repository:e}})}),u,r!==void 0&&(0,J.jsx)(We,{task:d,project:r,disabled:n._tag===`NeedsSetup`}),(0,J.jsx)(Qe,{task:d,openRun:c}),(0,J.jsx)(Ge,{task:d}),(0,J.jsx)(Ue,{task:d})]})},tt=()=>{let{repository:e,number:t}=Oe.useLoaderData();return(0,J.jsx)(et,{repository:e,number:t},`${e}#${t}`)};export{tt as component};
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./use-project-links-B_TcQCMF.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{n as a,t as o}from"./useNavigate-I5E4IRt2.js";import{t as s}from"./link-3oQYoIpm.js";import{r as c,t as l}from"./mark-lp0qzo_h.js";import{c as u,l as d,n as f,s as p,t as ee}from"./moves-tp1tistE.js";import{r as te}from"./native-select-BCc0nbNt.js";import{a as m,c as h,h as g,i as _,l as v,n as y,o as b,s as x,v as S}from"./actions-CVebv7VX.js";import{r as C,t as w}from"./button-CzVqBv_O.js";import{l as ne,s as T}from"./useTriggerFocusGuards-VVhgPwg5.js";import{i as E}from"./context-8jHKzDOY.js";import{Dn as re,En as ie,Ln as ae,Pn as D,a as oe,wn as se}from"./api-_wVaJ3mw.js";import{o as O,s as ce,v as k}from"./strings-BIVdGoBr.js";import{D as A,F as le,I as ue,L as de,N as j,O as fe,P as M,i as N,n as pe,r as me}from"./overview-CguPX45J.js";import{a as he,n as ge,r as _e}from"./page-DpBr9Xsm.js";import{t as P}from"./error-alert-Bq-SD6of.js";import{A as F,D as I,F as ve,M as ye,N as be,O as xe,P as Se,R as Ce,j as we,k as Te,lt as Ee,n as De,t as Oe}from"./index-Bnfkxo8V.js";import{t as ke}from"./pull-request-marks-_FfWkWIz.js";import{n as L,t as Ae}from"./status-badge-B2-vzEoZ.js";import{n as je,t as Me}from"./edit-and-retry-DMtmkIrn.js";import{a as Ne,i as R,n as z,o as B,r as V,t as H}from"./table-CKp2wE4u.js";import{t as U}from"./fill-cell-BtM3J7oO.js";import{t as Pe}from"./label-badge-CY1GjBOb.js";import{a as Fe,n as Ie,t as Le}from"./model-DASfGPZO.js";import{n as Re,t as ze}from"./run-again-nKv7W5_B.js";import{a as Be,i as W,n as G,r as K,t as q}from"./section-BvzDfyI3.js";import{t as Ve}from"./not-found-DL09nMmQ.js";var J=n(),He=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)}`},Ue=({task:e})=>{let t=r(),n=new Map(e.runs.map(e=>[e.id,e])),i=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=n.get(e.runId),a=r===void 0?void 0:i.get(r.itemKey),o=He(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:[Ie(e.kind),a!==void 0&&(0,J.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,J.jsx)(l,{item:a,linked:!1})]})]})}),(0,J.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,J.jsx)(s,{...t.run(r.repository,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:o!==null&&(0,J.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(o.at)})})]},e.url)})})})})]})},We=({task:e,project:t,disabled:n})=>{let r=ee(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,o=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),s=o===void 0?void 0:r.moves.find(({itemKey:e})=>e===o.card.itemKey),l=o===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==o.lane.id),d=t.board.lanes.find(({id:e})=>e===s?.toLane)?.name??o?.lane.name??e.lane.name,m=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),_=o===void 0?a.labels:f(o.card,o.lane).filter(e=>s===void 0||!m.has(e)),y=new Map(t.labels.map(e=>[e.name,e])),S=!n&&!r.isPending&&s===void 0&&l.length>0;E(o!==void 0&&S?l.map(e=>({label:u(e.name),run:()=>r.moveItem(o.card,e)})):[]);let{origin:C,pullRequests:T}=ne(e.items);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(_e,{actionsBeside:`sm`,heading:(0,J.jsx)(Ce,{variant:`page`,item:ae(C),title:e.title}),facts:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ke,{pullRequests:T}),(0,J.jsx)(ge,{icon:Ee,title:`Lane`,children:(0,J.jsx)(`span`,{className:`text-foreground`,children:d})}),s!==void 0&&(0,J.jsx)(`span`,{role:`status`,children:p(s.phase)}),_.length>0&&(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:_.map(e=>(0,J.jsx)(Pe,{name:e,label:y.get(e)},e))}),e.needsYou&&(0,J.jsx)(Ae,{})]}),...o!==void 0&&S?{actions:(0,J.jsxs)(b,{children:[(0,J.jsxs)(g,{render:(0,J.jsx)(w,{variant:`outline`}),"aria-label":`Move ${c(a)} to another lane`,children:[`Move to`,(0,J.jsx)(te,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,J.jsx)(x,{align:`end`,className:`w-auto min-w-40`,children:(0,J.jsx)(h,{children:l.map(e=>(0,J.jsx)(v,{onClick:()=>r.moveItem(o.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,J.jsx)(P,{className:`max-w-3xl`,message:r.error.message})]})},Ge=({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)(l,{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)(d,{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=e(t(),1),X=({run:e})=>{let t=he(3e4);return D(Le(e,t),{onNone:()=>null,onSome:e=>(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:ce(e)})})},Ke=({run:e})=>D(Fe(e),{onNone:()=>null,onSome:e=>(0,J.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:A(e),children:[(0,J.jsx)(`span`,{className:`font-medium text-destructive`,children:fe(e)}),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:A(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)(l,{item:e,className:`relative z-10`})}),qe=(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:qe(e.attempts.length,`attempt`)}),(0,J.jsx)(X,{run:e}),(0,J.jsx)(Z,{run:e}),(0,J.jsx)(Q,{pullRequest:t})]}),Je=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ye=({run:e,onEdit:t,openRun:n,status:r})=>{let i=_(),a=m(),[o,s]=(0,Y.useState)(!1),c=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),l=()=>a.mutate(y(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,J.jsx)(`span`,{className:`text-needs-you`,children:ue}))},onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),u=e.attempts.at(-1),d=Je(e),f=u?.outcome?._tag===`Failed`&&u.outcome.failure._tag===`QuestionFailure`,p=[];return e.canApprove&&d!==`approve`&&p.push({label:M.approve,select:()=>c({action:`approve`})}),e.canRetry&&d!==`retry`&&p.push({label:M.retry,description:j(e.agentBrain),select:()=>c({action:`retry`})}),e.canRetry&&p.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(p.push({label:M.runAgain,select:l}),p.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&u!==void 0&&p.push({label:f?`Mark answered`:`Mark resolved`,select:()=>c({action:`resolveFailure`,attemptId:u.id})}),e.canCancel&&p.push({label:M.cancel,destructive:!0,select:()=>s(!0)}),E(i.isPending||a.isPending||o?[]:[...d===null?[]:[{label:M[d],select:()=>c({action:d})}],...p].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i.isPending&&i.variables!==void 0?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:le[i.variables.request.action]}):a.isPending?(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:de}):(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[d!==null&&(0,J.jsx)(w,{variant:`outline`,size:`sm`,title:d===`retry`?j(e.agentBrain):void 0,onClick:()=>c({action:d}),children:M[d]}),p.length>0&&(0,J.jsxs)(b,{children:[(0,J.jsx)(g,{render:(0,J.jsx)(w,{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)(S,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,J.jsx)(x,{align:`end`,className:`w-auto min-w-44`,children:(0,J.jsx)(h,{children:p.map(({label:e,description:t,destructive:n,select:r})=>(0,J.jsx)(v,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,J.jsx)(xe,{open:o,onOpenChange:s,children:(0,J.jsxs)(we,{children:[(0,J.jsxs)(Se,{children:[(0,J.jsxs)(ve,{children:[`Cancel `,e.loop,`?`]}),(0,J.jsx)(ye,{children:`The run stops, including any attempt in progress.`})]}),(0,J.jsxs)(be,{children:[(0,J.jsx)(F,{children:M.keepRunning}),(0,J.jsx)(Te,{variant:`destructive`,onClick:()=>{s(!1),c({action:`cancel`})},children:M.confirmCancel})]})]})})]})},Xe=8,Ze=({run:e,item:t,pullRequest:n,openRun:i})=>{let a=r(),[o,c]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(null);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(B,{className:C(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,className:`ml-0.75`}),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:`ml-0.75 self-center sm:hidden`}),(0,J.jsx)(s,{"data-row-link":!0,...a.run(e.repository,e.id),className:C(`font-medium wrap-anywhere`,W),children:e.loop}),t!==null&&(0,J.jsx)(l,{item:t,className:`relative z-10 shrink-0`})]}),(0,J.jsx)(Ke,{run:e}),e.runAgain!==null&&(0,J.jsx)(ze,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,J.jsx)(Re,{approval:e.approval,className:`text-xs`}),(0,J.jsx)($,{run:e,pullRequest:n}),u!==null&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs`,children:u})]})}),(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)(Ye,{run:e,onEdit:c,openRun:i,status:d})})]}),o!==null&&je(e,o)&&(0,J.jsx)(B,{className:`hover:bg-transparent`,children:(0,J.jsx)(V,{colSpan:Xe,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,J.jsx)(Me,{run:e,intent:o,close:()=>c(null),openRun:i,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${o}`)})})]})},Qe=({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)(Ne,{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=ie(re(i.pullRequestUrl),t=>T(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,J.jsx)(Ze,{run:i,item:o===null||se(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},$e=({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})}),et=({repository:e,number:t})=>{let{data:n}=i(pe()),r=me(n.projects,e),s=a(),c=I(),l=i(De(e,t));if(l.error instanceof oe&&l.error.error===`BoardItemNotFoundError`)return(0,J.jsx)(Ve,{repository:e,number:String(t)});let u=l.isError&&(0,J.jsx)(P,{className:`max-w-3xl`,title:`Could not refresh the task`,message:l.error.message}),d=l.data;return d.number!==t&&r!==void 0?(0,J.jsx)(o,{to:`/projects/$project/tasks/$number`,params:{project:N(r),number:String(d.number)},search:t=>({...t,repository:e}),replace:!0}):(0,J.jsxs)($e,{children:[r!==void 0&&r.repositories.length>1&&(0,J.jsx)(Be,{repositories:r.repositories,value:e,onChange:e=>void s({to:`/projects/$project/tasks`,params:{project:N(r)},search:{repository:e}})}),u,r!==void 0&&(0,J.jsx)(We,{task:d,project:r,disabled:n._tag===`NeedsSetup`}),(0,J.jsx)(Qe,{task:d,openRun:c}),(0,J.jsx)(Ge,{task:d}),(0,J.jsx)(Ue,{task:d})]})},tt=()=>{let{repository:e,number:t}=Oe.useLoaderData();return(0,J.jsx)(et,{repository:e,number:t},`${e}#${t}`)};export{tt as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./index-Bnfkxo8V.js";import{n,t as r}from"./not-found-DL09nMmQ.js";var i=e(),a=()=>{let{repository:e}=t.useSearch(),{number:a}=t.useParams();return e===void 0?(0,i.jsx)(`p`,{children:n}):(0,i.jsx)(r,{repository:e,number:a})};export{a as notFoundComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-CmbS3jMw.js";var t=e;export{t as errorComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{c as r}from"./queries-Drg1Az2O.js";import{t as i}from"./use-project-links-DeAFv-c5.js";import{t as a}from"./useSuspenseQuery-ajaZl96Y.js";import{t as o}from"./link-3oQYoIpm.js";import{r as s,t as c}from"./mark-lp0qzo_h.js";import{a as l,i as u,l as d,n as f,o as p,r as m,s as h,t as g}from"./moves-DC5EM_e8.js";import{a as _,c as v,d as y,f as b,h as x,i as S,l as C,m as w,n as ee,o as te,p as T,s as ne,u as re,v as ie}from"./actions-CDBaDyOF.js";import{W as E,r as D,t as O}from"./button-CzVqBv_O.js";import{i as ae}from"./context-8jHKzDOY.js";import{it as oe}from"./api-DhPASHUl.js";import{c as k,v as A}from"./strings-BIVdGoBr.js";import{A as j,F as se,L as ce,N as M,P as N,a as le,i as P,k as ue,n as de}from"./overview-DKGL6LW9.js";import{a as F,i as fe}from"./page-LiZtJ7q6.js";import{t as I}from"./error-alert-Bq-SD6of.js";import{t as pe}from"./queries-CgdAnlaK.js";import{A as me,D as he,F as ge,M as _e,N as ve,O as ye,P as be,Y as L,j as xe,k as Se,o as Ce,w as R}from"./index-C4BBFDrw.js";import{n as z,r as we,t as Te}from"./status-badge-B2-vzEoZ.js";import{a as Ee,i as B,n as De,o as V,r as H,t as Oe}from"./table-CKp2wE4u.js";import{a as ke,c as Ae,d as U,f as je,g as Me,h as Ne,i as Pe,l as Fe,m as W,o as Ie,p as Le,r as Re,s as ze,t as Be}from"./sortable.esm-D-1SvrpE.js";import{t as G}from"./label-badge-BhVy1gv4.js";import{t as Ve}from"./action-DLnjcb9H.js";import{f as He,o as Ue,u as K}from"./model-Bx9jBUNv.js";import{n as We,t as Ge}from"./strings-B4zsKcNR.js";import{t as Ke}from"./project-not-found-BfK7XtjD.js";var q=e(t(),1),qe=new Map([[`bold`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`}))]]),Je=new Map([[`bold`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`}),q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`}))]]),J=q.forwardRef((e,t)=>q.createElement(E,{ref:t,...e,weights:qe}));J.displayName=`ArrowUpRightIcon`;var Y=q.forwardRef((e,t)=>q.createElement(E,{ref:t,...e,weights:Je}));Y.displayName=`ArrowsInLineHorizontalIcon`;var Ye=(e,t)=>e===`Running`?`Running since ${A(t)}`:e===`Failed`?`Failed at ${A(t)}`:j(t),Xe={above:!1,below:!1},Ze=()=>{let[e,t]=(0,q.useState)(Xe),n=(0,q.useRef)(null);return[(0,q.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]},X=n();function Z({className:e,size:t=`default`,...n}){return(0,X.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:D(`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 Qe({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`card-header`,className:D(`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 $e({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`card-title`,className:D(`text-lg font-semibold`,e),...t})}function et({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`card-description`,className:D(`text-sm text-muted-foreground`,e),...t})}function tt({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`card-content`,className:D(`px-(--card-spacing)`,e),...t})}var Q=3,nt=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(Q);return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,Q).map(e=>(0,X.jsx)(G,{name:e,label:t.get(e)},e)),n.length>0&&(0,X.jsxs)(R,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},rt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,it=({item:e,project:t})=>{let n=i();return(0,X.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,X.jsx)(o,{...t===void 0?{...n.task(e.repository,K(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:K(e)},search:{repository:e.repository}},draggable:!1,className:rt,children:(0,X.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},at=({failure:e,children:t})=>(0,X.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,X.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),ot=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,X.jsx)(O,{variant:`outline`,size:`xs`,className:`relative z-10`,title:M(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:N.retry}):null,st=({run:e})=>{let t=F(3e4),n=u(e);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,X.jsx)(z,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,X.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,X.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,X.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:Ye(e.state,n),children:k(n,t)}),(0,X.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]}),e.machineWait!==null&&(0,X.jsx)(`p`,{className:`text-xs break-words text-muted-foreground`,children:ue(e.machineWait)})]})},ct=({stalled:e,named:t,children:n})=>{let r=F(3e4),i=We(e,r);return(0,X.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,X.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,X.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},lt=e=>[`run-again`,`board-card`,e],ut=(e,t)=>{let n=lt(e),i=_({mutationKey:n,onClaimed:t}),a=r({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:a?.status===`pending`,data:a?.data,error:a?.error??null,send:e=>i.mutate(ee(e))}},$=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:u,progress:d})=>{let p=l(n),h=m(n),g=s?.error?.message??null,_=u?.error?.message??null,v=a!==null&&p!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===p.run.id,y=a===null||s===null?null:(0,X.jsx)(Ve,{stalled:a,readOnly:o,appearance:`card`}),b=n.needsYou&&!(h?.canApprove||h?.canResolveFailure)&&a===null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,X.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,X.jsx)(c,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,X.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(L,{repository:n.repository}),(0,X.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,X.jsx)(it,{item:n,project:e}),(0,X.jsx)(nt,{labels:f(n,r),catalog:i}),h!==null&&(0,X.jsx)(st,{run:h}),d!==null&&(0,X.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:d}),p!==null&&(0,X.jsx)(at,{failure:p,children:v&&a?.reason._tag===`SuppressedForOperator`?y:(0,X.jsx)(ot,{failure:p,action:s})}),a!==null&&!v&&(0,X.jsx)(ct,{stalled:a,named:(h===null||Ue(a)?.id!==h.id)&&!Ge(a),children:y}),u?.data?._tag===`CycleBlocked`&&(0,X.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),g!==null&&(0,X.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:g}),_!==null&&(0,X.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:_}),n.conflicting&&(0,X.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),b&&(0,X.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},dt=({runs:e,openRun:t})=>(0,X.jsxs)(b,{children:[(0,X.jsx)(w,{children:`Run history`}),(0,X.jsx)(T,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,X.jsxs)(C,{onClick:()=>t(e.id),children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(z,{state:e.state}),e.state]}),(0,X.jsx)(`time`,{dateTime:e.openedAt,title:j(e.openedAt),className:`font-mono tabular-nums`,children:k(e.openedAt)})]})]},e.id))})]}),ft=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:o})=>{let[l,u]=(0,q.useState)(!1),f=s(e),p=e.runs.filter(({id:e})=>e!==t?.id),m=e.run?.canRunAgain===!0?e.run:null,h=[{key:`links`,content:e.items.map(e=>(0,X.jsxs)(re,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,X.jsx)(c,{item:e,linked:!1}),` on GitHub`,(0,X.jsx)(d,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||p.length>0)&&h.push({key:`runs`,content:(0,X.jsxs)(X.Fragment,{children:[t!==null&&(0,X.jsx)(C,{onClick:()=>r(t.id),children:`Open run`}),p.length>0&&(0,X.jsx)(dt,{runs:p,openRun:r})]})});let g=i.isPending||a.isPending,_=m!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!g&&_&&h.push({key:`actions`,content:(0,X.jsxs)(X.Fragment,{children:[t?.canApprove&&(0,X.jsx)(C,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:N.approve}),t?.canRetry&&(0,X.jsx)(C,{title:M(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:N.retry}),m!==null&&(0,X.jsxs)(C,{onClick:()=>a.send(m),children:[N.runAgain,(0,X.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:m.loop})]}),t?.canCancel&&(0,X.jsx)(C,{variant:`destructive`,onClick:()=>u(!0),children:N.cancel})]})}),!n.disabled&&n.targets.length>0&&h.push({key:`move`,content:(0,X.jsxs)(b,{children:[(0,X.jsx)(w,{children:`Move to`}),(0,X.jsx)(T,{className:`min-w-40`,children:n.targets.map(t=>(0,X.jsx)(C,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(te,{children:[(0,X.jsx)(x,{render:(0,X.jsx)(O,{variant:`ghost`,size:`icon-sm`,className:D(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,o)}),"aria-label":`Actions for ${f}`,children:(0,X.jsx)(ie,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,X.jsx)(ne,{align:`end`,className:`w-auto min-w-48`,children:h.map(({key:e,content:t},n)=>(0,X.jsxs)(q.Fragment,{children:[n>0&&(0,X.jsx)(y,{}),(0,X.jsx)(v,{children:t})]},e))})]}),t!==null&&(0,X.jsx)(ye,{open:l,onOpenChange:u,children:(0,X.jsxs)(xe,{children:[(0,X.jsxs)(be,{children:[(0,X.jsxs)(ge,{children:[`Cancel `,t.loop,`?`]}),(0,X.jsxs)(_e,{children:[`The run on `,f,` stops, including any attempt in progress.`]})]}),(0,X.jsxs)(ve,{children:[(0,X.jsx)(me,{children:N.keepRunning}),(0,X.jsx)(Se,{variant:`destructive`,onClick:()=>{u(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:N.confirmCancel})]})]})})]})},pt=e=>D(`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`),mt=(e,t,n)=>e.isPending&&e.variables!==void 0?se[e.variables.request.action]:t.isPending?ce:n===void 0?null:h(n),ht=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:l,openRun:u})=>{let d=S(),f=ut(n.itemKey,u),{attributes:p,listeners:h,setNodeRef:g,setActivatorNodeRef:_,transform:v,transition:y,isDragging:b}=Pe({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,X.jsxs)(`div`,{ref:g,style:{transform:Me.Translate.toString(v),transition:y},className:D(`group/task relative`,b&&`opacity-40`),children:[(0,X.jsx)(Z,{ref:_,size:`sm`,className:D(pt(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&p,...a&&h,children:(0,X.jsx)($,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:l,action:d,again:f,progress:mt(d,f,o)})}),(0,X.jsx)(ft,{item:n,run:m(n),moves:s,openRun:u,action:d,again:f,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`})]})},gt=new Set([`Waiting`,`Queued`,`Running`]),_t=(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})=>gt.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]]})),vt=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),yt=({flow:e})=>{let t=e.loops.length>0;return(0,X.jsxs)(`p`,{"data-slot":`flow-arrow`,className:D(`-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: ${vt(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,X.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,X.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,X.jsxs)(q.Fragment,{children:[n>0&&`, `,e,t&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,X.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:D(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},bt=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&oe(e.state)),xt=({sources:e,catalog:t})=>(0,X.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,X.jsx)(`li`,{className:`flex`,children:`label`in e?(0,X.jsx)(G,{name:e.label,label:t.get(e.label)}):(0,X.jsx)(R,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),St=({lane:e,open:t})=>(0,X.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,X.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,X.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,X.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),Ct=({project:e,showRepository:t,lane:n,lanes:r,flow:i,catalog:a,targeted:o,pending:s,readOnly:c,moves:l,stallOf:u,openRun:d,onMove:f})=>{let m=bt(n),[h,g]=(0,q.useState)(m),_=n._tag===`WritableBoardLane`,{setNodeRef:v}=Le({id:n.id,disabled:!_||s}),y=r.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),b=n.items.length,[x,S]=Ze();return ae(m?[{label:p(n.name,h),run:()=>g(!h)}]:[]),m&&h?(0,X.jsx)(St,{lane:n,open:()=>g(!1)}):(0,X.jsxs)(`section`,{ref:v,"aria-label":`${n.name} lane`,className:D(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,o&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,X.jsxs)(`header`,{className:D(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!o&&`bg-background`),children:[(0,X.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,X.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:b})]}),i!==void 0&&(0,X.jsx)(yt,{flow:i}),m&&(0,X.jsx)(O,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${n.name}`,title:`Fold ${n.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>g(!0),children:(0,X.jsx)(Y,{"aria-hidden":`true`})})]}),(0,X.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,X.jsx)(xt,{sources:n.sources,catalog:a})})]}),(0,X.jsx)(`div`,{ref:x,"aria-label":`${n.name} cards`,tabIndex:S.above||S.below?0:void 0,className:D(`-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`,S.above&&`mask-t-from-[calc(100%-2.5rem)]`,S.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,X.jsxs)(Be,{items:n.items.map(({itemKey:e})=>e),strategy:ke,children:[b===0&&(0,X.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),n.items.map(r=>{let i=l.find(({itemKey:e})=>e===r.itemKey)?.phase,o=s||i!==void 0;return(0,X.jsx)(ht,{item:r,project:e,showRepository:t,lane:n,catalog:a,draggable:!o&&y.length>0,phase:i,moves:{targets:y,disabled:o,onMove:f},stall:u(r),readOnly:c,openRun:d},r.itemKey)})]})})]})},wt=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,X.jsx)(Z,{size:`sm`,className:D(pt(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,X.jsx)($,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),Tt=({runs:e,openRun:t})=>(0,X.jsxs)(Z,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,X.jsxs)(Qe,{children:[(0,X.jsx)($e,{children:`Runs without a card`}),(0,X.jsxs)(et,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,X.jsx)(tt,{children:(0,X.jsxs)(Oe,{children:[(0,X.jsx)(Ee,{children:(0,X.jsxs)(V,{children:[(0,X.jsx)(B,{children:`Loop`}),(0,X.jsx)(B,{children:`Agent`}),(0,X.jsx)(B,{children:`Item`}),(0,X.jsx)(B,{children:`State`}),(0,X.jsx)(B,{className:`w-0`})]})}),(0,X.jsx)(De,{children:e.map(e=>(0,X.jsxs)(V,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,X.jsx)(H,{className:`font-medium`,children:e.loop}),(0,X.jsx)(H,{children:e.agent}),(0,X.jsx)(H,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,X.jsx)(H,{children:(0,X.jsx)(we,{state:e.state})}),(0,X.jsx)(H,{className:`text-right`,children:(0,X.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,X.jsx)(J,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Et=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Dt=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ot=e=>{let t=U(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=U({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return je(e)},kt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Re(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}},At=(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}})},jt=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))},Mt=({project:e,loops:t,stalled:n,disabled:r,openRun:i})=>{let[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(null),{moves:l,moveItem:u,isPending:d,error:f}=g(e),p=jt(e),m=l.reduce(At,Et(e.board.lanes)),h=Ne(W(Fe,{activationConstraint:{distance:6}}),W(Ae,{coordinateGetter:kt(m)})),_=_t(m,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),v=m.reduce((e,t)=>e+t.items.length,0),y=e=>He(n,e),b=new Map(e.labels.map(e=>[e.name,e])),x=r||d,S=()=>{o(null),c(null)};return(0,X.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,X.jsx)(fe,{title:le(e),leading:(0,X.jsx)(L,{repository:e.repository,size:`title`}),counts:`${m.length} lane${m.length===1?``:`s`}, ${v} item${v===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,X.jsx)(Te,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,X.jsx)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:`Proposed lanes are read-only. Add lanes with labels in Configuration > Projects to enable moves.`}),e.board.failures.length>0&&(0,X.jsx)(I,{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{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{c as r}from"./queries-CRfrxdfM.js";import{t as i}from"./use-project-links-B_TcQCMF.js";import{t as a}from"./useSuspenseQuery-ajaZl96Y.js";import{t as o}from"./link-3oQYoIpm.js";import{r as s,t as c}from"./mark-lp0qzo_h.js";import{a as l,i as u,l as d,n as f,o as p,r as m,s as h,t as g}from"./moves-tp1tistE.js";import{a as _,c as v,d as y,f as b,h as x,i as S,l as C,m as w,n as ee,o as te,p as T,s as ne,u as re,v as ie}from"./actions-CVebv7VX.js";import{W as E,r as D,t as O}from"./button-CzVqBv_O.js";import{i as ae}from"./context-8jHKzDOY.js";import{it as oe}from"./api-_wVaJ3mw.js";import{c as k,v as A}from"./strings-BIVdGoBr.js";import{A as j,F as se,L as ce,N as M,P as N,a as le,i as P,k as ue,n as de}from"./overview-CguPX45J.js";import{a as F,i as fe}from"./page-DpBr9Xsm.js";import{t as I}from"./error-alert-Bq-SD6of.js";import{t as pe}from"./queries-BbcxuosX.js";import{A as me,D as he,F as ge,M as _e,N as ve,O as ye,P as be,Y as L,j as xe,k as Se,o as Ce,w as R}from"./index-Bnfkxo8V.js";import{n as z,r as we,t as Te}from"./status-badge-B2-vzEoZ.js";import{a as Ee,i as B,n as De,o as V,r as H,t as Oe}from"./table-CKp2wE4u.js";import{a as ke,c as Ae,d as U,f as je,g as Me,h as Ne,i as Pe,l as Fe,m as W,o as Ie,p as Le,r as Re,s as ze,t as Be}from"./sortable.esm-D-1SvrpE.js";import{t as G}from"./label-badge-CY1GjBOb.js";import{t as Ve}from"./action-CnJBcylx.js";import{f as He,o as Ue,u as K}from"./model-DASfGPZO.js";import{n as We,t as Ge}from"./strings-D6bizAqq.js";import{t as Ke}from"./project-not-found-BfK7XtjD.js";var q=e(t(),1),qe=new Map([[`bold`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`}))]]),Je=new Map([[`bold`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`}),q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`,q.createElement(q.Fragment,null,q.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`}))]]),J=q.forwardRef((e,t)=>q.createElement(E,{ref:t,...e,weights:qe}));J.displayName=`ArrowUpRightIcon`;var Y=q.forwardRef((e,t)=>q.createElement(E,{ref:t,...e,weights:Je}));Y.displayName=`ArrowsInLineHorizontalIcon`;var Ye=(e,t)=>e===`Running`?`Running since ${A(t)}`:e===`Failed`?`Failed at ${A(t)}`:j(t),Xe={above:!1,below:!1},Ze=()=>{let[e,t]=(0,q.useState)(Xe),n=(0,q.useRef)(null);return[(0,q.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]},X=n();function Z({className:e,size:t=`default`,...n}){return(0,X.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:D(`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 Qe({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`card-header`,className:D(`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 $e({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`card-title`,className:D(`text-lg font-semibold`,e),...t})}function et({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`card-description`,className:D(`text-sm text-muted-foreground`,e),...t})}function tt({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`card-content`,className:D(`px-(--card-spacing)`,e),...t})}var Q=3,nt=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(Q);return(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,Q).map(e=>(0,X.jsx)(G,{name:e,label:t.get(e)},e)),n.length>0&&(0,X.jsxs)(R,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},rt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,it=({item:e,project:t})=>{let n=i();return(0,X.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,X.jsx)(o,{...t===void 0?{...n.task(e.repository,K(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:K(e)},search:{repository:e.repository}},draggable:!1,className:rt,children:(0,X.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},at=({failure:e,children:t})=>(0,X.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,X.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),ot=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,X.jsx)(O,{variant:`outline`,size:`xs`,className:`relative z-10`,title:M(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:N.retry}):null,st=({run:e})=>{let t=F(3e4),n=u(e);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,X.jsx)(z,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,X.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,X.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,X.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:Ye(e.state,n),children:k(n,t)}),(0,X.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]}),e.machineWait!==null&&(0,X.jsx)(`p`,{className:`text-xs break-words text-muted-foreground`,children:ue(e.machineWait)})]})},ct=({stalled:e,named:t,children:n})=>{let r=F(3e4),i=We(e,r);return(0,X.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,X.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,X.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},lt=e=>[`run-again`,`board-card`,e],ut=(e,t)=>{let n=lt(e),i=_({mutationKey:n,onClaimed:t}),a=r({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:a?.status===`pending`,data:a?.data,error:a?.error??null,send:e=>i.mutate(ee(e))}},$=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:u,progress:d})=>{let p=l(n),h=m(n),g=s?.error?.message??null,_=u?.error?.message??null,v=a!==null&&p!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===p.run.id,y=a===null||s===null?null:(0,X.jsx)(Ve,{stalled:a,readOnly:o,appearance:`card`}),b=n.needsYou&&!(h?.canApprove||h?.canResolveFailure)&&a===null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,X.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,X.jsx)(c,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,X.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(L,{repository:n.repository}),(0,X.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,X.jsx)(it,{item:n,project:e}),(0,X.jsx)(nt,{labels:f(n,r),catalog:i}),h!==null&&(0,X.jsx)(st,{run:h}),d!==null&&(0,X.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:d}),p!==null&&(0,X.jsx)(at,{failure:p,children:v&&a?.reason._tag===`SuppressedForOperator`?y:(0,X.jsx)(ot,{failure:p,action:s})}),a!==null&&!v&&(0,X.jsx)(ct,{stalled:a,named:(h===null||Ue(a)?.id!==h.id)&&!Ge(a),children:y}),u?.data?._tag===`CycleBlocked`&&(0,X.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),g!==null&&(0,X.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:g}),_!==null&&(0,X.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:_}),n.conflicting&&(0,X.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),b&&(0,X.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},dt=({runs:e,openRun:t})=>(0,X.jsxs)(b,{children:[(0,X.jsx)(w,{children:`Run history`}),(0,X.jsx)(T,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,X.jsxs)(C,{onClick:()=>t(e.id),children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(z,{state:e.state}),e.state]}),(0,X.jsx)(`time`,{dateTime:e.openedAt,title:j(e.openedAt),className:`font-mono tabular-nums`,children:k(e.openedAt)})]})]},e.id))})]}),ft=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:o})=>{let[l,u]=(0,q.useState)(!1),f=s(e),p=e.runs.filter(({id:e})=>e!==t?.id),m=e.run?.canRunAgain===!0?e.run:null,h=[{key:`links`,content:e.items.map(e=>(0,X.jsxs)(re,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,X.jsx)(c,{item:e,linked:!1}),` on GitHub`,(0,X.jsx)(d,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||p.length>0)&&h.push({key:`runs`,content:(0,X.jsxs)(X.Fragment,{children:[t!==null&&(0,X.jsx)(C,{onClick:()=>r(t.id),children:`Open run`}),p.length>0&&(0,X.jsx)(dt,{runs:p,openRun:r})]})});let g=i.isPending||a.isPending,_=m!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!g&&_&&h.push({key:`actions`,content:(0,X.jsxs)(X.Fragment,{children:[t?.canApprove&&(0,X.jsx)(C,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:N.approve}),t?.canRetry&&(0,X.jsx)(C,{title:M(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:N.retry}),m!==null&&(0,X.jsxs)(C,{onClick:()=>a.send(m),children:[N.runAgain,(0,X.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:m.loop})]}),t?.canCancel&&(0,X.jsx)(C,{variant:`destructive`,onClick:()=>u(!0),children:N.cancel})]})}),!n.disabled&&n.targets.length>0&&h.push({key:`move`,content:(0,X.jsxs)(b,{children:[(0,X.jsx)(w,{children:`Move to`}),(0,X.jsx)(T,{className:`min-w-40`,children:n.targets.map(t=>(0,X.jsx)(C,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(te,{children:[(0,X.jsx)(x,{render:(0,X.jsx)(O,{variant:`ghost`,size:`icon-sm`,className:D(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,o)}),"aria-label":`Actions for ${f}`,children:(0,X.jsx)(ie,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,X.jsx)(ne,{align:`end`,className:`w-auto min-w-48`,children:h.map(({key:e,content:t},n)=>(0,X.jsxs)(q.Fragment,{children:[n>0&&(0,X.jsx)(y,{}),(0,X.jsx)(v,{children:t})]},e))})]}),t!==null&&(0,X.jsx)(ye,{open:l,onOpenChange:u,children:(0,X.jsxs)(xe,{children:[(0,X.jsxs)(be,{children:[(0,X.jsxs)(ge,{children:[`Cancel `,t.loop,`?`]}),(0,X.jsxs)(_e,{children:[`The run on `,f,` stops, including any attempt in progress.`]})]}),(0,X.jsxs)(ve,{children:[(0,X.jsx)(me,{children:N.keepRunning}),(0,X.jsx)(Se,{variant:`destructive`,onClick:()=>{u(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:N.confirmCancel})]})]})})]})},pt=e=>D(`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`),mt=(e,t,n)=>e.isPending&&e.variables!==void 0?se[e.variables.request.action]:t.isPending?ce:n===void 0?null:h(n),ht=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:l,openRun:u})=>{let d=S(),f=ut(n.itemKey,u),{attributes:p,listeners:h,setNodeRef:g,setActivatorNodeRef:_,transform:v,transition:y,isDragging:b}=Pe({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,X.jsxs)(`div`,{ref:g,style:{transform:Me.Translate.toString(v),transition:y},className:D(`group/task relative`,b&&`opacity-40`),children:[(0,X.jsx)(Z,{ref:_,size:`sm`,className:D(pt(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&p,...a&&h,children:(0,X.jsx)($,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:l,action:d,again:f,progress:mt(d,f,o)})}),(0,X.jsx)(ft,{item:n,run:m(n),moves:s,openRun:u,action:d,again:f,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`})]})},gt=new Set([`Waiting`,`Queued`,`Running`]),_t=(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})=>gt.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]]})),vt=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),yt=({flow:e})=>{let t=e.loops.length>0;return(0,X.jsxs)(`p`,{"data-slot":`flow-arrow`,className:D(`-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: ${vt(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,X.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,X.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,X.jsxs)(q.Fragment,{children:[n>0&&`, `,e,t&&(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,X.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:D(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,X.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},bt=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&oe(e.state)),xt=({sources:e,catalog:t})=>(0,X.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,X.jsx)(`li`,{className:`flex`,children:`label`in e?(0,X.jsx)(G,{name:e.label,label:t.get(e.label)}):(0,X.jsx)(R,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),St=({lane:e,open:t})=>(0,X.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,X.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,X.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,X.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),Ct=({project:e,showRepository:t,lane:n,lanes:r,flow:i,catalog:a,targeted:o,pending:s,readOnly:c,moves:l,stallOf:u,openRun:d,onMove:f})=>{let m=bt(n),[h,g]=(0,q.useState)(m),_=n._tag===`WritableBoardLane`,{setNodeRef:v}=Le({id:n.id,disabled:!_||s}),y=r.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),b=n.items.length,[x,S]=Ze();return ae(m?[{label:p(n.name,h),run:()=>g(!h)}]:[]),m&&h?(0,X.jsx)(St,{lane:n,open:()=>g(!1)}):(0,X.jsxs)(`section`,{ref:v,"aria-label":`${n.name} lane`,className:D(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,o&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,X.jsxs)(`header`,{className:D(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!o&&`bg-background`),children:[(0,X.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,X.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:b})]}),i!==void 0&&(0,X.jsx)(yt,{flow:i}),m&&(0,X.jsx)(O,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${n.name}`,title:`Fold ${n.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>g(!0),children:(0,X.jsx)(Y,{"aria-hidden":`true`})})]}),(0,X.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,X.jsx)(xt,{sources:n.sources,catalog:a})})]}),(0,X.jsx)(`div`,{ref:x,"aria-label":`${n.name} cards`,tabIndex:S.above||S.below?0:void 0,className:D(`-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`,S.above&&`mask-t-from-[calc(100%-2.5rem)]`,S.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,X.jsxs)(Be,{items:n.items.map(({itemKey:e})=>e),strategy:ke,children:[b===0&&(0,X.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),n.items.map(r=>{let i=l.find(({itemKey:e})=>e===r.itemKey)?.phase,o=s||i!==void 0;return(0,X.jsx)(ht,{item:r,project:e,showRepository:t,lane:n,catalog:a,draggable:!o&&y.length>0,phase:i,moves:{targets:y,disabled:o,onMove:f},stall:u(r),readOnly:c,openRun:d},r.itemKey)})]})})]})},wt=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,X.jsx)(Z,{size:`sm`,className:D(pt(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,X.jsx)($,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),Tt=({runs:e,openRun:t})=>(0,X.jsxs)(Z,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,X.jsxs)(Qe,{children:[(0,X.jsx)($e,{children:`Runs without a card`}),(0,X.jsxs)(et,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,X.jsx)(tt,{children:(0,X.jsxs)(Oe,{children:[(0,X.jsx)(Ee,{children:(0,X.jsxs)(V,{children:[(0,X.jsx)(B,{children:`Loop`}),(0,X.jsx)(B,{children:`Agent`}),(0,X.jsx)(B,{children:`Item`}),(0,X.jsx)(B,{children:`State`}),(0,X.jsx)(B,{className:`w-0`})]})}),(0,X.jsx)(De,{children:e.map(e=>(0,X.jsxs)(V,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,X.jsx)(H,{className:`font-medium`,children:e.loop}),(0,X.jsx)(H,{children:e.agent}),(0,X.jsx)(H,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,X.jsx)(H,{children:(0,X.jsx)(we,{state:e.state})}),(0,X.jsx)(H,{className:`text-right`,children:(0,X.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,X.jsx)(J,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Et=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Dt=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ot=e=>{let t=U(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=U({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return je(e)},kt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Re(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}},At=(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}})},jt=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))},Mt=({project:e,loops:t,stalled:n,disabled:r,openRun:i})=>{let[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(null),{moves:l,moveItem:u,isPending:d,error:f}=g(e),p=jt(e),m=l.reduce(At,Et(e.board.lanes)),h=Ne(W(Fe,{activationConstraint:{distance:6}}),W(Ae,{coordinateGetter:kt(m)})),_=_t(m,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),v=m.reduce((e,t)=>e+t.items.length,0),y=e=>He(n,e),b=new Map(e.labels.map(e=>[e.name,e])),x=r||d,S=()=>{o(null),c(null)};return(0,X.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,X.jsx)(fe,{title:le(e),leading:(0,X.jsx)(L,{repository:e.repository,size:`title`}),counts:`${m.length} lane${m.length===1?``:`s`}, ${v} item${v===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,X.jsx)(Te,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,X.jsx)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:`Proposed lanes are read-only. Add lanes with labels in Configuration > Projects to enable moves.`}),e.board.failures.length>0&&(0,X.jsx)(I,{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
|
`)}),f!==null&&(0,X.jsx)(I,{className:`mx-4 max-w-3xl md:mx-5`,message:f.message}),(0,X.jsxs)(Ie,{sensors:h,collisionDetection:Ot,onDragStart:({active:e})=>{let t=m.find(({items:t})=>t.some(({itemKey:t})=>t===e.id)),n=t?.items.find(({itemKey:t})=>t===e.id);o(t===void 0||n===void 0?null:{item:n,lane:t})},onDragOver:({over:e})=>c(e===null?null:Dt(e.id,m)?.id??null),onDragEnd:({over:e})=>{if(S(),e===null||a===null)return;let t=Dt(e.id,m);t!==void 0&&u(a.item,t)},onDragCancel:S,children:[(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain [container-type:size]`,"aria-label":`${le(e)} project board`,children:(0,X.jsxs)(`div`,{className:`flex w-max min-w-full flex-col gap-6 px-4 pb-4 md:px-5`,children:[(0,X.jsx)(`div`,{className:`flex h-[calc(100cqh-1rem)] min-h-80 shrink-0 gap-3`,children:m.map(t=>(0,X.jsx)(Ct,{project:P(e),showRepository:e.repositories.length>1,lane:t,lanes:m,flow:_.get(t.id),catalog:b,targeted:a!==null&&s===t.id&&t.id!==a.lane.id&&t._tag===`WritableBoardLane`,pending:x,readOnly:r,moves:l,stallOf:y,openRun:i,onMove:u},t.id))}),p.length>0&&(0,X.jsx)(Tt,{runs:p,openRun:i})]})}),(0,X.jsx)(ze,{children:a!==null&&(0,X.jsx)(wt,{item:a.item,project:P(e),showRepository:e.repositories.length>1,lane:a.lane,catalog:b,stall:y(a.item)})})]})]})},Nt=()=>{let{project:e}=Ce.useParams(),{data:t}=a(de()),n=a(pe()),r=he(),i=t.projects.find(t=>P(t)===e);return i===void 0?(0,X.jsx)(Ke,{}):(0,X.jsx)(Mt,{project:i,loops:t.loops,stalled:n.data.notMoving,disabled:t._tag===`NeedsSetup`,openRun:r})};export{Nt as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{P as t,at as n,r,s as i,t as a}from"./section-
|
|
1
|
+
import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{P as t,at as n,r,s as i,t as a}from"./section-D6y3qhNk.js";import{t as o}from"./useSuspenseQuery-ajaZl96Y.js";import{t as s}from"./link-3oQYoIpm.js";import{n as c}from"./queries-CDrLXfWQ.js";import{c as l}from"./index-Bnfkxo8V.js";import{t as u}from"./repository-link-CkNtGosL.js";var d=e(),f=({id:e,configuration:o})=>{let c=o.projects.find(t=>t.id===e);return(0,d.jsx)(a,{title:c?.name??e,entity:n(`project`,e),children:c===void 0?(0,d.jsx)(i,{title:t.missing,children:null}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(s,{to:`/projects/$project`,params:{project:e},className:`text-primary hover:underline`,children:t.board}),(0,d.jsx)(r,{title:t.repositories,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:c.repositories.map(e=>(0,d.jsx)(`li`,{children:(0,d.jsx)(u,{repository:e})},e))})}),(0,d.jsx)(r,{title:t.lanes,children:(0,d.jsx)(`ol`,{className:`space-y-2`,children:c.lanes.map(e=>(0,d.jsxs)(`li`,{className:`flex flex-wrap gap-2`,children:[(0,d.jsx)(`span`,{children:e.name}),(0,d.jsx)(`span`,{className:`text-muted-foreground`,children:e.sources.map(e=>`label`in e?e.label:e.state).join(`, `)})]},e.name))})})]})})},p=()=>{let{project:e}=l.useParams(),{data:t}=o(c());return(0,d.jsx)(f,{id:e,configuration:t})};export{p as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./route-status-CmbS3jMw.js";var t=e;export{t as errorComponent};
|