@usine/server 0.4.1-next.312.g8cd2d1c → 0.4.1-next.313.g78b1a94

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.
Files changed (74) hide show
  1. package/dist/web/assets/_agent-vu6ORmA2.js +1 -0
  2. package/dist/web/assets/_label-Cgu5KQzM.js +1 -0
  3. package/dist/web/assets/{_loop-CsRBgGBH.js → _loop-Sj9FjgEz.js} +1 -1
  4. package/dist/web/assets/{_name-_Ri5OBXg.js → _name-Cmz6UGEa.js} +1 -1
  5. package/dist/web/assets/_number-BXQWBC6G.js +1 -0
  6. package/dist/web/assets/{_number-CRC8azRH.js → _number-C_72slOa.js} +1 -1
  7. package/dist/web/assets/{_number-DjPm2qoI.js → _number-DxxtMx03.js} +1 -1
  8. package/dist/web/assets/_project-BXQWBC6G.js +1 -0
  9. package/dist/web/assets/{_project-DRugT2zE.js → _project-DpGJdVbX.js} +1 -1
  10. package/dist/web/assets/{_project-a5ldbK8h.js → _project-r_g0BPg2.js} +1 -1
  11. package/dist/web/assets/_run-BXQWBC6G.js +1 -0
  12. package/dist/web/assets/{_run-7LNnUjcP.js → _run-DFlcuvoK.js} +1 -1
  13. package/dist/web/assets/{_worker-CBoXczuF.js → _worker-CQ-m6gJq.js} +1 -1
  14. package/dist/web/assets/{action-CUtKF6cz.js → action-DKG5mFTX.js} +1 -1
  15. package/dist/web/assets/{actions-CGSyN7cc.js → actions-BJyy4rAU.js} +1 -1
  16. package/dist/web/assets/{agents-Vz6-R-Ka.js → agents-DMdO8F29.js} +1 -1
  17. package/dist/web/assets/agents-vkKc1qIL.js +1 -0
  18. package/dist/web/assets/{api-DKkXYbSU.js → api-bysg7thy.js} +4 -4
  19. package/dist/web/assets/{code-block-Bi6j7xDQ.js → code-block-BtP0gYlC.js} +1 -1
  20. package/dist/web/assets/{drawer-sEzbtXSu.js → drawer-CVTIz726.js} +1 -1
  21. package/dist/web/assets/{edit-and-retry-Vphni8UJ.js → edit-and-retry-KmaBIHAA.js} +1 -1
  22. package/dist/web/assets/{file-error-Da5DiacI.js → file-error-BLolfW1d.js} +1 -1
  23. package/dist/web/assets/{history-sksM-eRT.js → history-CUZ8T6DR.js} +1 -1
  24. package/dist/web/assets/{index-s2nPwRk7.js → index-Bx-WMd7h.js} +3 -3
  25. package/dist/web/assets/{label-badge-Cnf1YK3o.js → label-badge-3j5QARbS.js} +1 -1
  26. package/dist/web/assets/{labels-CDtSqBG-.js → labels-Cx06bn2e.js} +1 -1
  27. package/dist/web/assets/{list-goJ8RHPN.js → list-DfV2n9qC.js} +1 -1
  28. package/dist/web/assets/loops-CwPOzEw5.js +1 -0
  29. package/dist/web/assets/{members-BSODXFhL.js → members-0lCXqnez.js} +1 -1
  30. package/dist/web/assets/{model-BNyVjWar.js → model-ByB1UBiE.js} +1 -1
  31. package/dist/web/assets/{moves-BuOhBtpj.js → moves-CE5aPDYo.js} +1 -1
  32. package/dist/web/assets/{not-found-rG3Xb9vc.js → not-found-BGEbu9Ud.js} +1 -1
  33. package/dist/web/assets/{outcome-j60wLl2R.js → outcome-C4dheUkl.js} +1 -1
  34. package/dist/web/assets/{overview-Cp6rRu05.js → overview-DttgspDg.js} +1 -1
  35. package/dist/web/assets/{page-BWEsHzht.js → page-BEg2Aata.js} +1 -1
  36. package/dist/web/assets/{projects-B5t0KMRN.js → projects-DNPzOofc.js} +1 -1
  37. package/dist/web/assets/{queries-0ZyDsXTD.js → queries-BWmBLMiv.js} +1 -1
  38. package/dist/web/assets/{queries-CRgQPqQj.js → queries-BpHhbtsC.js} +1 -1
  39. package/dist/web/assets/{queries-C1SujlpL.js → queries-EA5CUqp7.js} +1 -1
  40. package/dist/web/assets/{queries-D-uofdf5.js → queries-Nsnn_12T.js} +1 -1
  41. package/dist/web/assets/{repositories-B3i7ZzmV.js → repositories-C_oUx1Ih.js} +1 -1
  42. package/dist/web/assets/{repository-link-C611-quq.js → repository-link-BcZaWb8n.js} +1 -1
  43. package/dist/web/assets/route-Bvlaj2XK.js +1 -0
  44. package/dist/web/assets/route-CMZcNHpi.js +1 -0
  45. package/dist/web/assets/{route-status-B-jofGgl.js → route-status-Cd8uO1qX.js} +1 -1
  46. package/dist/web/assets/routes-BXQWBC6G.js +1 -0
  47. package/dist/web/assets/{routes-BcmHZHbD.js → routes-DaHaPxoB.js} +1 -1
  48. package/dist/web/assets/{run-again-B7QmklEQ.js → run-again-BnbqgCR0.js} +1 -1
  49. package/dist/web/assets/{section-BUBxP2Wi.js → section-ARyFgEzY.js} +1 -1
  50. package/dist/web/assets/{section-t8XbBLHM.js → section-ZLNoAhVC.js} +1 -1
  51. package/dist/web/assets/{section-C8IBNoJA.js → section-g5u_j_Nn.js} +1 -1
  52. package/dist/web/assets/{settings-B8XUfgUq.js → settings-CvxfZ_Rb.js} +1 -1
  53. package/dist/web/assets/{sign-in-BmrnOxtZ.js → sign-in-DXVxarSx.js} +1 -1
  54. package/dist/web/assets/{strings-DusJwajC.js → strings-m0J9z5wt.js} +1 -1
  55. package/dist/web/assets/tasks-BXQWBC6G.js +1 -0
  56. package/dist/web/assets/{tasks-M7pLiNq6.js → tasks-DG9-sOjB.js} +1 -1
  57. package/dist/web/assets/{tokens-DVStD47s.js → tokens-CU87Riee.js} +1 -1
  58. package/dist/web/assets/{usage-C9w51z2s.js → usage-C7EgS5LD.js} +1 -1
  59. package/dist/web/assets/{use-project-links-YQDjqdhN.js → use-project-links-Fu48JLi4.js} +1 -1
  60. package/dist/web/assets/{useTriggerFocusGuards-BjDsGd09.js → useTriggerFocusGuards-BaIe8KF9.js} +1 -1
  61. package/dist/web/assets/{workers-u5rmt50I.js → workers-D-2_EW-D.js} +1 -1
  62. package/dist/web/index.html +12 -12
  63. package/package.json +9 -9
  64. package/dist/web/assets/_agent-BalSUpo8.js +0 -1
  65. package/dist/web/assets/_label-CKa_5ZwI.js +0 -1
  66. package/dist/web/assets/_number-BtXSlhke.js +0 -1
  67. package/dist/web/assets/_project-BtXSlhke.js +0 -1
  68. package/dist/web/assets/_run-BtXSlhke.js +0 -1
  69. package/dist/web/assets/agents-CeaKq-VZ.js +0 -1
  70. package/dist/web/assets/loops-BHrQssBM.js +0 -1
  71. package/dist/web/assets/route-DlZz6URL.js +0 -1
  72. package/dist/web/assets/route-M1J8FzeG.js +0 -1
  73. package/dist/web/assets/routes-BtXSlhke.js +0 -1
  74. package/dist/web/assets/tasks-BtXSlhke.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./useSuspenseQuery-ajaZl96Y.js";import{n}from"./queries-EA5CUqp7.js";import{d as r}from"./index-Bx-WMd7h.js";import{t as i}from"./agents-DMdO8F29.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{Z as t,t as n}from"./section-g5u_j_Nn.js";import{u as r}from"./index-Bx-WMd7h.js";var i=e(),a=()=>{let{label:e}=r.useParams();return(0,i.jsx)(n,{title:e,entity:t(`label`,e),children:null})};export{a as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{D as t,E as n,Z as r,a as i,c as a,i as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h}from"./section-C8IBNoJA.js";import{t as g}from"./useSuspenseQuery-ajaZl96Y.js";import{t as _}from"./link-CXTzqBsX.js";import{n as v,r as y}from"./list-goJ8RHPN.js";import{r as b}from"./strings-BIVdGoBr.js";import{t as x}from"./error-alert-BOLTerP9.js";import{n as S}from"./queries-C1SujlpL.js";import{at as C,l as w,v as T}from"./index-s2nPwRk7.js";import{t as E}from"./file-error-Da5DiacI.js";import{t as D}from"./repository-link-C611-quq.js";var O=e(),k=({loop:e,configuration:t})=>{let r=t.projects.find(t=>e.name.startsWith(`${t.id}/`)),a=t.agents.find(({name:t})=>t===e.agent);return(0,O.jsxs)(i,{children:[r!==void 0&&(0,O.jsx)(o,{label:`Project`,children:(0,O.jsx)(_,{to:`/configuration/projects/$project`,params:{project:r.id},className:`text-primary hover:underline`,children:r.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.jsx)(o,{label:`Approval`,children:h[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:`None; runs wait in lane order`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,O.jsx)(m,{children:`queued ahead of runs in 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 i=t.loops.find(t=>t.name===e);if(i!==void 0)return(0,O.jsx)(p,{entity:r(`loop`,e),title:i.name,marks:(0,O.jsx)(y,{paused:i.paused}),file:i.file,actions:n!==null&&(0,O.jsx)(v,{loop:i,pause:n,variant:`outline`}),children:(0,O.jsx)(M,{loop:i,configuration:t,pause:n})});let o=t.quarantinedLoops.find(t=>t.name===e);return o===void 0?(0,O.jsx)(p,{entity:r(`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:r(`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
+ import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{D as t,E as n,Z as r,a as i,c as a,i as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h}from"./section-g5u_j_Nn.js";import{t as g}from"./useSuspenseQuery-ajaZl96Y.js";import{t as _}from"./link-CXTzqBsX.js";import{n as v,r as y}from"./list-DfV2n9qC.js";import{r as b}from"./strings-BIVdGoBr.js";import{t as x}from"./error-alert-BOLTerP9.js";import{n as S}from"./queries-EA5CUqp7.js";import{at as C,l as w,v as T}from"./index-Bx-WMd7h.js";import{t as E}from"./file-error-BLolfW1d.js";import{t as D}from"./repository-link-BcZaWb8n.js";var O=e(),k=({loop:e,configuration:t})=>{let r=t.projects.find(t=>e.name.startsWith(`${t.id}/`)),a=t.agents.find(({name:t})=>t===e.agent);return(0,O.jsxs)(i,{children:[r!==void 0&&(0,O.jsx)(o,{label:`Project`,children:(0,O.jsx)(_,{to:`/configuration/projects/$project`,params:{project:r.id},className:`text-primary hover:underline`,children:r.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.jsx)(o,{label:`Approval`,children:h[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:`None; runs wait in lane order`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,O.jsx)(m,{children:`queued ahead of runs in 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 i=t.loops.find(t=>t.name===e);if(i!==void 0)return(0,O.jsx)(p,{entity:r(`loop`,e),title:i.name,marks:(0,O.jsx)(y,{paused:i.paused}),file:i.file,actions:n!==null&&(0,O.jsx)(v,{loop:i,pause:n,variant:`outline`}),children:(0,O.jsx)(M,{loop:i,configuration:t,pause:n})});let o=t.quarantinedLoops.find(t=>t.name===e);return o===void 0?(0,O.jsx)(p,{entity:r(`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:r(`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{A as t,Z as n,a as r,i,n as a,r as o,s,t as c,u as l}from"./section-C8IBNoJA.js";import{t as u}from"./useSuspenseQuery-ajaZl96Y.js";import{t as d}from"./link-CXTzqBsX.js";import{n as f}from"./queries-C1SujlpL.js";import{Y as p,a as m}from"./index-s2nPwRk7.js";import{t as h}from"./label-badge-Cnf1YK3o.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:n})=>(0,g.jsxs)(r,{children:[(0,g.jsx)(i,{label:t.project,children:n===void 0?(0,g.jsx)(l,{children:t.unassignedProject}):(0,g.jsx)(d,{to:`/configuration/projects/$project`,params:{project:n.id},className:`text-primary hover:underline`,children:n.name})}),n!==void 0&&(0,g.jsx)(i,{label:`Board`,children:(0,g.jsx)(d,{to:`/projects/$project`,params:{project:n.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:r})=>{let i=`${e}/${t}`,u=r.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return u===void 0?(0,g.jsx)(c,{entity:n(`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:n(`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:r.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
+ import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,Z as n,a as r,i,n as a,r as o,s,t as c,u as l}from"./section-g5u_j_Nn.js";import{t as u}from"./useSuspenseQuery-ajaZl96Y.js";import{t as d}from"./link-CXTzqBsX.js";import{n as f}from"./queries-EA5CUqp7.js";import{Y as p,a as m}from"./index-Bx-WMd7h.js";import{t as h}from"./label-badge-3j5QARbS.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:n})=>(0,g.jsxs)(r,{children:[(0,g.jsx)(i,{label:t.project,children:n===void 0?(0,g.jsx)(l,{children:t.unassignedProject}):(0,g.jsx)(d,{to:`/configuration/projects/$project`,params:{project:n.id},className:`text-primary hover:underline`,children:n.name})}),n!==void 0&&(0,g.jsx)(i,{label:`Board`,children:(0,g.jsx)(d,{to:`/projects/$project`,params:{project:n.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:r})=>{let i=`${e}/${t}`,u=r.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return u===void 0?(0,g.jsx)(c,{entity:n(`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:n(`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:r.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};
@@ -0,0 +1 @@
1
+ import{t as e}from"./route-status-Cd8uO1qX.js";var t=e;export{t as errorComponent};
@@ -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-YQDjqdhN.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,c as o,h as s,i as c,l,n as u,o as d,s as f,v as p}from"./actions-CGSyN7cc.js";import{n as m,t as h}from"./useNavigate-I5E4IRt2.js";import{t as g}from"./link-CXTzqBsX.js";import{r as _,t as v}from"./mark-Bcl_OnGe.js";import{c as y,l as b,n as x,s as S,t as ee}from"./moves-BuOhBtpj.js";import{r as te}from"./native-select-B1ICB22h.js";import{r as C,t as w}from"./button-C-mC9M4I.js";import{l as ne,s as T}from"./useTriggerFocusGuards-BjDsGd09.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-DKkXYbSU.js";import{o as O,s as ce,v as k}from"./strings-BIVdGoBr.js";import{D as le,E as A,F as ue,M as j,N as de,P as fe,i as M,j as N,n as pe,r as me}from"./overview-Cp6rRu05.js";import{a as he,n as ge,r as _e}from"./page-BWEsHzht.js";import{t as P}from"./error-alert-BOLTerP9.js";import{A as F,F as I,I 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-s2nPwRk7.js";import{t as ke}from"./pull-request-marks-DIYk7AMY.js";import{n as L,t as Ae}from"./status-badge-DINlptKX.js";import{n as je,t as Me}from"./edit-and-retry-Vphni8UJ.js";import{a as Ne,i as R,n as z,o as B,r as V,t as H}from"./table-D3--FtAd.js";import{t as U}from"./fill-cell-5J3dwnZY.js";import{t as W}from"./label-badge-Cnf1YK3o.js";import{a as Pe,n as Fe,t as Ie}from"./model-BNyVjWar.js";import{n as Le,t as Re}from"./run-again-B7QmklEQ.js";import{a as ze,i as G,n as K,r as q,t as J}from"./section-t8XbBLHM.js";import{t as Be}from"./not-found-rG3Xb9vc.js";var Y=n(),Ve=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)}`},He=({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,Y.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,Y.jsx)(J,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,Y.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=Ve(e);return(0,Y.jsxs)(B,{className:q,children:[(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${G}`,children:[Fe(e.kind),a!==void 0&&(0,Y.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,Y.jsx)(v,{item:a,linked:!1})]})]})}),(0,Y.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,Y.jsx)(g,{...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,Y.jsx)(V,{className:`py-3 text-right`,children:o!==null&&(0,Y.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(o.at)})})]},e.url)})})})})]})},Ue=({task:e,project:t,disabled:n})=>{let r=ee(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,c=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),u=c===void 0?void 0:r.moves.find(({itemKey:e})=>e===c.card.itemKey),p=c===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==c.lane.id),m=t.board.lanes.find(({id:e})=>e===u?.toLane)?.name??c?.lane.name??e.lane.name,h=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),g=c===void 0?a.labels:x(c.card,c.lane).filter(e=>u===void 0||!h.has(e)),v=new Map(t.labels.map(e=>[e.name,e])),b=!n&&!r.isPending&&u===void 0&&p.length>0;E(c!==void 0&&b?p.map(e=>({label:y(e.name),run:()=>r.moveItem(c.card,e)})):[]);let{origin:C,pullRequests:T}=ne(e.items);return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsx)(_e,{actionsBeside:`sm`,heading:(0,Y.jsx)(Ce,{variant:`page`,item:ae(C),title:e.title}),facts:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ke,{pullRequests:T}),(0,Y.jsx)(ge,{icon:Ee,title:`Lane`,children:(0,Y.jsx)(`span`,{className:`text-foreground`,children:m})}),u!==void 0&&(0,Y.jsx)(`span`,{role:`status`,children:S(u.phase)}),g.length>0&&(0,Y.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:g.map(e=>(0,Y.jsx)(W,{name:e,label:v.get(e)},e))}),e.needsYou&&(0,Y.jsx)(Ae,{})]}),...c!==void 0&&b?{actions:(0,Y.jsxs)(d,{children:[(0,Y.jsxs)(s,{render:(0,Y.jsx)(w,{variant:`outline`}),"aria-label":`Move ${_(a)} to another lane`,children:[`Move to`,(0,Y.jsx)(te,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,Y.jsx)(f,{align:`end`,className:`w-auto min-w-40`,children:(0,Y.jsx)(o,{children:p.map(e=>(0,Y.jsx)(l,{onClick:()=>r.moveItem(c.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,Y.jsx)(P,{className:`max-w-3xl`,message:r.error.message})]})},We=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,Y.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,Y.jsx)(J,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,Y.jsx)(z,{className:`border-t`,children:t.map(e=>(0,Y.jsxs)(B,{className:q,children:[(0,Y.jsx)(V,{className:`w-0 py-3`,children:(0,Y.jsx)(v,{item:e,linked:!1})}),(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${G}`,children:[e.title,(0,Y.jsx)(b,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,Y.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,Y.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},X=e(t(),1),Z=({run:e})=>{let t=he(3e4);return D(Ie(e,t),{onNone:()=>null,onSome:e=>(0,Y.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:ce(e)})})},Ge=({run:e})=>D(Pe(e),{onNone:()=>null,onSome:e=>(0,Y.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:A(e),children:[(0,Y.jsx)(`span`,{className:`font-medium text-destructive`,children:le(e)}),` `,(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:A(e)})]})}),Q=({run:e})=>(0,Y.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${k(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:O(e.openedAt)}),$=({pullRequest:e})=>D(e,{onNone:()=>null,onSome:e=>(0,Y.jsx)(v,{item:e,className:`relative z-10`})}),Ke=(e,t)=>`${e} ${t}${e===1?``:`s`}`,qe=({run:e,pullRequest:t})=>(0,Y.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,Y.jsx)(`span`,{children:e.agent}),(0,Y.jsx)(`span`,{children:Ke(e.attempts.length,`attempt`)}),(0,Y.jsx)(Z,{run:e}),(0,Y.jsx)(Q,{run:e}),(0,Y.jsx)($,{pullRequest:t})]}),Je=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ye=({run:e,onEdit:t,openRun:n,status:r})=>{let i=c(),m=a(),[h,g]=(0,X.useState)(!1),_=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,Y.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),v=()=>m.mutate(u(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,Y.jsx)(`span`,{className:`text-needs-you`,children:fe}))},onError:e=>r((0,Y.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),y=e.attempts.at(-1),b=Je(e),x=y?.outcome?._tag===`Failed`&&y.outcome.failure._tag===`QuestionFailure`,S=[];return e.canApprove&&b!==`approve`&&S.push({label:j.approve,select:()=>_({action:`approve`})}),e.canRetry&&b!==`retry`&&S.push({label:j.retry,description:N(e.agentBrain),select:()=>_({action:`retry`})}),e.canRetry&&S.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(S.push({label:j.runAgain,select:v}),S.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&y!==void 0&&S.push({label:x?`Mark answered`:`Mark resolved`,select:()=>_({action:`resolveFailure`,attemptId:y.id})}),e.canCancel&&S.push({label:j.cancel,destructive:!0,select:()=>g(!0)}),E(i.isPending||m.isPending||h?[]:[...b===null?[]:[{label:j[b],select:()=>_({action:b})}],...S].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i.isPending&&i.variables!==void 0?(0,Y.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:de[i.variables.request.action]}):m.isPending?(0,Y.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:ue}):(0,Y.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[b!==null&&(0,Y.jsx)(w,{variant:`outline`,size:`sm`,title:b===`retry`?N(e.agentBrain):void 0,onClick:()=>_({action:b}),children:j[b]}),S.length>0&&(0,Y.jsxs)(d,{children:[(0,Y.jsx)(s,{render:(0,Y.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,Y.jsx)(p,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Y.jsx)(f,{align:`end`,className:`w-auto min-w-44`,children:(0,Y.jsx)(o,{children:S.map(({label:e,description:t,destructive:n,select:r})=>(0,Y.jsx)(l,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,Y.jsx)(Te,{open:h,onOpenChange:g,children:(0,Y.jsxs)(ye,{children:[(0,Y.jsxs)(I,{children:[(0,Y.jsxs)(ve,{children:[`Cancel `,e.loop,`?`]}),(0,Y.jsx)(be,{children:`The run stops, including any attempt in progress.`})]}),(0,Y.jsxs)(Se,{children:[(0,Y.jsx)(we,{children:j.keepRunning}),(0,Y.jsx)(F,{variant:`destructive`,onClick:()=>{g(!1),_({action:`cancel`})},children:j.confirmCancel})]})]})})]})},Xe=8,Ze=({run:e,item:t,pullRequest:n,openRun:i})=>{let a=r(),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(null);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(B,{className:C(q,`[&>td]:align-top`),children:[(0,Y.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,Y.jsx)(L,{state:e.state,className:`ml-0.75`}),e.state]})}),(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Y.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Y.jsx)(L,{state:e.state,className:`ml-0.75 self-center sm:hidden`}),(0,Y.jsx)(g,{"data-row-link":!0,...a.run(e.repository,e.id),className:C(`font-medium wrap-anywhere`,G),children:e.loop}),t!==null&&(0,Y.jsx)(v,{item:t,className:`relative z-10 shrink-0`})]}),(0,Y.jsx)(Ge,{run:e}),e.runAgain!==null&&(0,Y.jsx)(Re,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,Y.jsx)(Le,{approval:e.approval,className:`text-xs`}),(0,Y.jsx)(qe,{run:e,pullRequest:n}),c!==null&&(0,Y.jsx)(`p`,{role:`status`,className:`text-xs`,children:c})]})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,Y.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,Y.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,Y.jsx)(Z,{run:e})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,Y.jsx)(Q,{run:e})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,Y.jsx)($,{pullRequest:n})}),(0,Y.jsx)(V,{className:`py-2.5`,children:(0,Y.jsx)(Ye,{run:e,onEdit:s,openRun:i,status:l})})]}),o!==null&&je(e,o)&&(0,Y.jsx)(B,{className:`hover:bg-transparent`,children:(0,Y.jsx)(V,{colSpan:Xe,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,Y.jsx)(Me,{run:e,intent:o,close:()=>s(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,Y.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,Y.jsx)(J,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsxs)(H,{children:[(0,Y.jsx)(Ne,{children:(0,Y.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,Y.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,Y.jsx)(R,{children:`Run`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,Y.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,Y.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,Y.jsx)(R,{children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,Y.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,Y.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,Y.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,Y.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),a=m(),o=xe(),s=i(De(e,t));if(s.error instanceof oe&&s.error.error===`BoardItemNotFoundError`)return(0,Y.jsx)(Be,{repository:e,number:String(t)});let c=s.isError&&(0,Y.jsx)(P,{className:`max-w-3xl`,title:`Could not refresh the task`,message:s.error.message}),l=s.data;return l.number!==t&&r!==void 0?(0,Y.jsx)(h,{to:`/projects/$project/tasks/$number`,params:{project:M(r),number:String(l.number)},search:t=>({...t,repository:e}),replace:!0}):(0,Y.jsxs)($e,{children:[r!==void 0&&r.repositories.length>1&&(0,Y.jsx)(ze,{repositories:r.repositories,value:e,onChange:e=>void a({to:`/projects/$project/tasks`,params:{project:M(r)},search:{repository:e}})}),c,r!==void 0&&(0,Y.jsx)(Ue,{task:l,project:r,disabled:n._tag===`NeedsSetup`}),(0,Y.jsx)(Qe,{task:l,openRun:o}),(0,Y.jsx)(We,{task:l}),(0,Y.jsx)(He,{task:l})]})},tt=()=>{let{repository:e,number:t}=Oe.useLoaderData();return(0,Y.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-Fu48JLi4.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,c as o,h as s,i as c,l,n as u,o as d,s as f,v as p}from"./actions-BJyy4rAU.js";import{n as m,t as h}from"./useNavigate-I5E4IRt2.js";import{t as g}from"./link-CXTzqBsX.js";import{r as _,t as v}from"./mark-Bcl_OnGe.js";import{c as y,l as b,n as x,s as S,t as ee}from"./moves-CE5aPDYo.js";import{r as te}from"./native-select-B1ICB22h.js";import{r as C,t as w}from"./button-C-mC9M4I.js";import{l as ne,s as T}from"./useTriggerFocusGuards-BaIe8KF9.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-bysg7thy.js";import{o as O,s as ce,v as k}from"./strings-BIVdGoBr.js";import{D as le,E as A,F as ue,M as j,N as de,P as fe,i as M,j as N,n as pe,r as me}from"./overview-DttgspDg.js";import{a as he,n as ge,r as _e}from"./page-BEg2Aata.js";import{t as P}from"./error-alert-BOLTerP9.js";import{A as F,F as I,I 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-Bx-WMd7h.js";import{t as ke}from"./pull-request-marks-DIYk7AMY.js";import{n as L,t as Ae}from"./status-badge-DINlptKX.js";import{n as je,t as Me}from"./edit-and-retry-KmaBIHAA.js";import{a as Ne,i as R,n as z,o as B,r as V,t as H}from"./table-D3--FtAd.js";import{t as U}from"./fill-cell-5J3dwnZY.js";import{t as W}from"./label-badge-3j5QARbS.js";import{a as Pe,n as Fe,t as Ie}from"./model-ByB1UBiE.js";import{n as Le,t as Re}from"./run-again-BnbqgCR0.js";import{a as ze,i as G,n as K,r as q,t as J}from"./section-ZLNoAhVC.js";import{t as Be}from"./not-found-BGEbu9Ud.js";var Y=n(),Ve=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)}`},He=({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,Y.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,Y.jsx)(J,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,Y.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=Ve(e);return(0,Y.jsxs)(B,{className:q,children:[(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${G}`,children:[Fe(e.kind),a!==void 0&&(0,Y.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,Y.jsx)(v,{item:a,linked:!1})]})]})}),(0,Y.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,Y.jsx)(g,{...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,Y.jsx)(V,{className:`py-3 text-right`,children:o!==null&&(0,Y.jsx)(`time`,{dateTime:o.at,title:o.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:O(o.at)})})]},e.url)})})})})]})},Ue=({task:e,project:t,disabled:n})=>{let r=ee(t),[i]=e.items,a=e.items.find(({itemKey:t})=>t===e.current)??i,c=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),u=c===void 0?void 0:r.moves.find(({itemKey:e})=>e===c.card.itemKey),p=c===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==c.lane.id),m=t.board.lanes.find(({id:e})=>e===u?.toLane)?.name??c?.lane.name??e.lane.name,h=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),g=c===void 0?a.labels:x(c.card,c.lane).filter(e=>u===void 0||!h.has(e)),v=new Map(t.labels.map(e=>[e.name,e])),b=!n&&!r.isPending&&u===void 0&&p.length>0;E(c!==void 0&&b?p.map(e=>({label:y(e.name),run:()=>r.moveItem(c.card,e)})):[]);let{origin:C,pullRequests:T}=ne(e.items);return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsx)(_e,{actionsBeside:`sm`,heading:(0,Y.jsx)(Ce,{variant:`page`,item:ae(C),title:e.title}),facts:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ke,{pullRequests:T}),(0,Y.jsx)(ge,{icon:Ee,title:`Lane`,children:(0,Y.jsx)(`span`,{className:`text-foreground`,children:m})}),u!==void 0&&(0,Y.jsx)(`span`,{role:`status`,children:S(u.phase)}),g.length>0&&(0,Y.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:g.map(e=>(0,Y.jsx)(W,{name:e,label:v.get(e)},e))}),e.needsYou&&(0,Y.jsx)(Ae,{})]}),...c!==void 0&&b?{actions:(0,Y.jsxs)(d,{children:[(0,Y.jsxs)(s,{render:(0,Y.jsx)(w,{variant:`outline`}),"aria-label":`Move ${_(a)} to another lane`,children:[`Move to`,(0,Y.jsx)(te,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,Y.jsx)(f,{align:`end`,className:`w-auto min-w-40`,children:(0,Y.jsx)(o,{children:p.map(e=>(0,Y.jsx)(l,{onClick:()=>r.moveItem(c.card,e),children:e.name},e.id))})})]})}:{}}),r.error!==null&&(0,Y.jsx)(P,{className:`max-w-3xl`,message:r.error.message})]})},We=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,Y.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,Y.jsx)(J,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,Y.jsx)(z,{className:`border-t`,children:t.map(e=>(0,Y.jsxs)(B,{className:q,children:[(0,Y.jsx)(V,{className:`w-0 py-3`,children:(0,Y.jsx)(v,{item:e,linked:!1})}),(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${G}`,children:[e.title,(0,Y.jsx)(b,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,Y.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,Y.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},X=e(t(),1),Z=({run:e})=>{let t=he(3e4);return D(Ie(e,t),{onNone:()=>null,onSome:e=>(0,Y.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:ce(e)})})},Ge=({run:e})=>D(Pe(e),{onNone:()=>null,onSome:e=>(0,Y.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:A(e),children:[(0,Y.jsx)(`span`,{className:`font-medium text-destructive`,children:le(e)}),` `,(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:A(e)})]})}),Q=({run:e})=>(0,Y.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${k(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:O(e.openedAt)}),$=({pullRequest:e})=>D(e,{onNone:()=>null,onSome:e=>(0,Y.jsx)(v,{item:e,className:`relative z-10`})}),Ke=(e,t)=>`${e} ${t}${e===1?``:`s`}`,qe=({run:e,pullRequest:t})=>(0,Y.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,Y.jsx)(`span`,{children:e.agent}),(0,Y.jsx)(`span`,{children:Ke(e.attempts.length,`attempt`)}),(0,Y.jsx)(Z,{run:e}),(0,Y.jsx)(Q,{run:e}),(0,Y.jsx)($,{pullRequest:t})]}),Je=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ye=({run:e,onEdit:t,openRun:n,status:r})=>{let i=c(),m=a(),[h,g]=(0,X.useState)(!1),_=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,Y.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),v=()=>m.mutate(u(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,Y.jsx)(`span`,{className:`text-needs-you`,children:fe}))},onError:e=>r((0,Y.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),y=e.attempts.at(-1),b=Je(e),x=y?.outcome?._tag===`Failed`&&y.outcome.failure._tag===`QuestionFailure`,S=[];return e.canApprove&&b!==`approve`&&S.push({label:j.approve,select:()=>_({action:`approve`})}),e.canRetry&&b!==`retry`&&S.push({label:j.retry,description:N(e.agentBrain),select:()=>_({action:`retry`})}),e.canRetry&&S.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(S.push({label:j.runAgain,select:v}),S.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&y!==void 0&&S.push({label:x?`Mark answered`:`Mark resolved`,select:()=>_({action:`resolveFailure`,attemptId:y.id})}),e.canCancel&&S.push({label:j.cancel,destructive:!0,select:()=>g(!0)}),E(i.isPending||m.isPending||h?[]:[...b===null?[]:[{label:j[b],select:()=>_({action:b})}],...S].map(({label:t,select:n})=>({label:`${t} · ${e.loop} · ${e.id.slice(0,8)}`,run:n}))),i.isPending&&i.variables!==void 0?(0,Y.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:de[i.variables.request.action]}):m.isPending?(0,Y.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:ue}):(0,Y.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[b!==null&&(0,Y.jsx)(w,{variant:`outline`,size:`sm`,title:b===`retry`?N(e.agentBrain):void 0,onClick:()=>_({action:b}),children:j[b]}),S.length>0&&(0,Y.jsxs)(d,{children:[(0,Y.jsx)(s,{render:(0,Y.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,Y.jsx)(p,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Y.jsx)(f,{align:`end`,className:`w-auto min-w-44`,children:(0,Y.jsx)(o,{children:S.map(({label:e,description:t,destructive:n,select:r})=>(0,Y.jsx)(l,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,Y.jsx)(Te,{open:h,onOpenChange:g,children:(0,Y.jsxs)(ye,{children:[(0,Y.jsxs)(I,{children:[(0,Y.jsxs)(ve,{children:[`Cancel `,e.loop,`?`]}),(0,Y.jsx)(be,{children:`The run stops, including any attempt in progress.`})]}),(0,Y.jsxs)(Se,{children:[(0,Y.jsx)(we,{children:j.keepRunning}),(0,Y.jsx)(F,{variant:`destructive`,onClick:()=>{g(!1),_({action:`cancel`})},children:j.confirmCancel})]})]})})]})},Xe=8,Ze=({run:e,item:t,pullRequest:n,openRun:i})=>{let a=r(),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(null);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(B,{className:C(q,`[&>td]:align-top`),children:[(0,Y.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,Y.jsx)(L,{state:e.state,className:`ml-0.75`}),e.state]})}),(0,Y.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Y.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Y.jsx)(L,{state:e.state,className:`ml-0.75 self-center sm:hidden`}),(0,Y.jsx)(g,{"data-row-link":!0,...a.run(e.repository,e.id),className:C(`font-medium wrap-anywhere`,G),children:e.loop}),t!==null&&(0,Y.jsx)(v,{item:t,className:`relative z-10 shrink-0`})]}),(0,Y.jsx)(Ge,{run:e}),e.runAgain!==null&&(0,Y.jsx)(Re,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,Y.jsx)(Le,{approval:e.approval,className:`text-xs`}),(0,Y.jsx)(qe,{run:e,pullRequest:n}),c!==null&&(0,Y.jsx)(`p`,{role:`status`,className:`text-xs`,children:c})]})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,Y.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,Y.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,Y.jsx)(Z,{run:e})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,Y.jsx)(Q,{run:e})}),(0,Y.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,Y.jsx)($,{pullRequest:n})}),(0,Y.jsx)(V,{className:`py-2.5`,children:(0,Y.jsx)(Ye,{run:e,onEdit:s,openRun:i,status:l})})]}),o!==null&&je(e,o)&&(0,Y.jsx)(B,{className:`hover:bg-transparent`,children:(0,Y.jsx)(V,{colSpan:Xe,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,Y.jsx)(Me,{run:e,intent:o,close:()=>s(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,Y.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,Y.jsx)(K,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,Y.jsx)(J,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,Y.jsx)(`div`,{className:`-mx-2`,children:(0,Y.jsxs)(H,{children:[(0,Y.jsx)(Ne,{children:(0,Y.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,Y.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,Y.jsx)(R,{children:`Run`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,Y.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,Y.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,Y.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,Y.jsx)(R,{children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,Y.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,Y.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,Y.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,Y.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),a=m(),o=xe(),s=i(De(e,t));if(s.error instanceof oe&&s.error.error===`BoardItemNotFoundError`)return(0,Y.jsx)(Be,{repository:e,number:String(t)});let c=s.isError&&(0,Y.jsx)(P,{className:`max-w-3xl`,title:`Could not refresh the task`,message:s.error.message}),l=s.data;return l.number!==t&&r!==void 0?(0,Y.jsx)(h,{to:`/projects/$project/tasks/$number`,params:{project:M(r),number:String(l.number)},search:t=>({...t,repository:e}),replace:!0}):(0,Y.jsxs)($e,{children:[r!==void 0&&r.repositories.length>1&&(0,Y.jsx)(ze,{repositories:r.repositories,value:e,onChange:e=>void a({to:`/projects/$project/tasks`,params:{project:M(r)},search:{repository:e}})}),c,r!==void 0&&(0,Y.jsx)(Ue,{task:l,project:r,disabled:n._tag===`NeedsSetup`}),(0,Y.jsx)(Qe,{task:l,openRun:o}),(0,Y.jsx)(We,{task:l}),(0,Y.jsx)(He,{task:l})]})},tt=()=>{let{repository:e,number:t}=Oe.useLoaderData();return(0,Y.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-s2nPwRk7.js";import{n,t as r}from"./not-found-rG3Xb9vc.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};
1
+ import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{t}from"./index-Bx-WMd7h.js";import{n,t as r}from"./not-found-BGEbu9Ud.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-Cd8uO1qX.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{t as r}from"./use-project-links-YQDjqdhN.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,b as o,c as s,d as c,f as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,s as _,u as v,v as y}from"./actions-CGSyN7cc.js";import{t as b}from"./link-CXTzqBsX.js";import{r as x,t as S}from"./mark-Bcl_OnGe.js";import{a as C,i as w,l as ee,n as T,o as E,r as D,s as te,t as ne}from"./moves-BuOhBtpj.js";import{W as O,r as k,t as A}from"./button-C-mC9M4I.js";import{i as re}from"./context-8jHKzDOY.js";import{X as ie}from"./api-DKkXYbSU.js";import{c as ae,v as j}from"./strings-BIVdGoBr.js";import{F as oe,M,N as se,O as N,a as P,i as F,j as I,n as ce}from"./overview-Cp6rRu05.js";import{a as L,i as le}from"./page-BWEsHzht.js";import{t as R}from"./error-alert-BOLTerP9.js";import{t as ue}from"./queries-0ZyDsXTD.js";import{A as de,F as fe,I as pe,M as me,N as he,O as ge,P as _e,Y as z,j as ve,k as ye,o as be,w as B}from"./index-s2nPwRk7.js";import{n as V,r as xe,t as Se}from"./status-badge-DINlptKX.js";import{a as Ce,i as H,n as we,o as U,r as W,t as Te}from"./table-D3--FtAd.js";import{a as Ee,c as De,d as G,f as Oe,g as ke,h as Ae,i as je,l as Me,m as K,o as Ne,p as Pe,r as Fe,s as Ie,t as Le}from"./sortable.esm-Z2V3kAIY.js";import{t as q}from"./label-badge-Cnf1YK3o.js";import{t as Re}from"./action-CUtKF6cz.js";import{f as ze,o as Be,u as J}from"./model-BNyVjWar.js";import{n as Ve,t as He}from"./strings-DusJwajC.js";import{t as Ue}from"./project-not-found-DrMlF8K5.js";var Y=e(t(),1),We=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`}))]]),Ge=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`}),Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`}))]]),X=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:We}));X.displayName=`ArrowUpRightIcon`;var Z=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:Ge}));Z.displayName=`ArrowsInLineHorizontalIcon`;var Ke=(e,t)=>e===`Running`?`Running since ${j(t)}`:e===`Failed`?`Failed at ${j(t)}`:N(t),qe={above:!1,below:!1},Je=()=>{let[e,t]=(0,Y.useState)(qe),n=(0,Y.useRef)(null);return[(0,Y.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},Q=n();function $({className:e,size:t=`default`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:k(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Ye({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-header`,className:k(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Xe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-title`,className:k(`text-lg font-semibold`,e),...t})}function Ze({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-description`,className:k(`text-sm text-muted-foreground`,e),...t})}function Qe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-(--card-spacing)`,e),...t})}var $e=3,et=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice($e);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,$e).map(e=>(0,Q.jsx)(q,{name:e,label:t.get(e)},e)),n.length>0&&(0,Q.jsxs)(B,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},tt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,nt=({item:e,project:t})=>{let n=r();return(0,Q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,Q.jsx)(b,{...t===void 0?{...n.task(e.repository,J(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:J(e)},search:{repository:e.repository}},draggable:!1,className:tt,children:(0,Q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},rt=({failure:e,children:t})=>(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),it=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,Q.jsx)(A,{variant:`outline`,size:`xs`,className:`relative z-10`,title:I(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:M.retry}):null,at=({run:e})=>{let t=L(3e4),n=w(e);return(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,Q.jsx)(V,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,Q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,Q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,Q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:Ke(e.state,n),children:ae(n,t)}),(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]})},ot=({stalled:e,named:t,children:n})=>{let r=L(3e4),i=Ve(e,r);return(0,Q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,Q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},st=e=>[`run-again`,`board-card`,e],ct=(e,t)=>{let n=st(e),r=a({mutationKey:n,onClaimed:t}),i=o({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(m(e))}},lt=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:c,progress:l})=>{let u=C(n),d=D(n),f=s?.error?.message??null,p=c?.error?.message??null,m=a!==null&&u!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===u.run.id,h=a===null||s===null?null:(0,Q.jsx)(Re,{stalled:a,readOnly:o,appearance:`card`}),g=n.needsYou&&!(d?.canApprove||d?.canResolveFailure)&&a===null;return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,Q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,Q.jsx)(S,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(z,{repository:n.repository}),(0,Q.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,Q.jsx)(nt,{item:n,project:e}),(0,Q.jsx)(et,{labels:T(n,r),catalog:i}),d!==null&&(0,Q.jsx)(at,{run:d}),l!==null&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,Q.jsx)(rt,{failure:u,children:m&&a?.reason._tag===`SuppressedForOperator`?h:(0,Q.jsx)(it,{failure:u,action:s})}),a!==null&&!m&&(0,Q.jsx)(ot,{stalled:a,named:(d===null||Be(a)?.id!==d.id)&&!He(a),children:h}),c?.data?._tag===`CycleBlocked`&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),f!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),p!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),n.conflicting&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),g&&(0,Q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},ut=({runs:e,openRun:t})=>(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Run history`}),(0,Q.jsx)(g,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,Q.jsxs)(f,{onClick:()=>t(e.id),children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,Q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(V,{state:e.state}),e.state]}),(0,Q.jsx)(`time`,{dateTime:e.openedAt,title:N(e.openedAt),className:`font-mono tabular-nums`,children:ae(e.openedAt)})]})]},e.id))})]}),dt=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:o})=>{let[d,m]=(0,Y.useState)(!1),b=x(e),C=e.runs.filter(({id:e})=>e!==t?.id),w=e.run?.canRunAgain===!0?e.run:null,T=[{key:`links`,content:e.items.map(e=>(0,Q.jsxs)(v,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,Q.jsx)(S,{item:e,linked:!1}),` on GitHub`,(0,Q.jsx)(ee,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||C.length>0)&&T.push({key:`runs`,content:(0,Q.jsxs)(Q.Fragment,{children:[t!==null&&(0,Q.jsx)(f,{onClick:()=>r(t.id),children:`Open run`}),C.length>0&&(0,Q.jsx)(ut,{runs:C,openRun:r})]})});let E=i.isPending||a.isPending,D=w!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!E&&D&&T.push({key:`actions`,content:(0,Q.jsxs)(Q.Fragment,{children:[t?.canApprove&&(0,Q.jsx)(f,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:M.approve}),t?.canRetry&&(0,Q.jsx)(f,{title:I(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:M.retry}),w!==null&&(0,Q.jsxs)(f,{onClick:()=>a.send(w),children:[M.runAgain,(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:w.loop})]}),t?.canCancel&&(0,Q.jsx)(f,{variant:`destructive`,onClick:()=>m(!0),children:M.cancel})]})}),!n.disabled&&n.targets.length>0&&T.push({key:`move`,content:(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Move to`}),(0,Q.jsx)(g,{className:`min-w-40`,children:n.targets.map(t=>(0,Q.jsx)(f,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(h,{children:[(0,Q.jsx)(u,{render:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,className:k(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,o)}),"aria-label":`Actions for ${b}`,children:(0,Q.jsx)(y,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(_,{align:`end`,className:`w-auto min-w-48`,children:T.map(({key:e,content:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&(0,Q.jsx)(c,{}),(0,Q.jsx)(s,{children:t})]},e))})]}),t!==null&&(0,Q.jsx)(ye,{open:d,onOpenChange:m,children:(0,Q.jsxs)(me,{children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(pe,{children:[`Cancel `,t.loop,`?`]}),(0,Q.jsxs)(he,{children:[`The run on `,b,` stops, including any attempt in progress.`]})]}),(0,Q.jsxs)(_e,{children:[(0,Q.jsx)(ve,{children:M.keepRunning}),(0,Q.jsx)(de,{variant:`destructive`,onClick:()=>{m(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:M.confirmCancel})]})]})})]})},ft=e=>k(`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`),pt=(e,t,n)=>e.isPending&&e.variables!==void 0?se[e.variables.request.action]:t.isPending?oe:n===void 0?null:te(n),mt=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:l,openRun:u})=>{let f=d(),p=ct(n.itemKey,u),{attributes:m,listeners:h,setNodeRef:g,setActivatorNodeRef:_,transform:v,transition:y,isDragging:b}=je({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,Q.jsxs)(`div`,{ref:g,style:{transform:ke.Translate.toString(v),transition:y},className:k(`group/task relative`,b&&`opacity-40`),children:[(0,Q.jsx)($,{ref:_,size:`sm`,className:k(ft(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&m,...a&&h,children:(0,Q.jsx)(lt,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:l,action:f,again:p,progress:pt(f,p,o)})}),(0,Q.jsx)(dt,{item:n,run:D(n),moves:s,openRun:u,action:f,again:p,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`})]})},ht=new Set([`Waiting`,`Queued`,`Running`]),gt=(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})=>ht.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]]})),_t=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),vt=({flow:e})=>{let t=e.loops.length>0;return(0,Q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:k(`-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: ${_t(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,Q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&`, `,e,t&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:k(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},yt=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&ie(e.state)),bt=({sources:e,catalog:t})=>(0,Q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,Q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,Q.jsx)(q,{name:e.label,label:t.get(e.label)}):(0,Q.jsx)(B,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),xt=({lane:e,open:t})=>(0,Q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,Q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,Q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),St=({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 p=yt(n),[m,h]=(0,Y.useState)(p),g=n._tag===`WritableBoardLane`,{setNodeRef:_}=Pe({id:n.id,disabled:!g||s}),v=r.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),y=n.items.length,[b,x]=Je();return re(p?[{label:E(n.name,m),run:()=>h(!m)}]:[]),p&&m?(0,Q.jsx)(xt,{lane:n,open:()=>h(!1)}):(0,Q.jsxs)(`section`,{ref:_,"aria-label":`${n.name} lane`,className:k(`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,Q.jsxs)(`header`,{className:k(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!o&&`bg-background`),children:[(0,Q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:y})]}),i!==void 0&&(0,Q.jsx)(vt,{flow:i}),p&&(0,Q.jsx)(A,{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:()=>h(!0),children:(0,Q.jsx)(Z,{"aria-hidden":`true`})})]}),(0,Q.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,Q.jsx)(bt,{sources:n.sources,catalog:a})})]}),(0,Q.jsx)(`div`,{ref:b,"aria-label":`${n.name} cards`,tabIndex:x.above||x.below?0:void 0,className:k(`-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`,x.above&&`mask-t-from-[calc(100%-2.5rem)]`,x.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,Q.jsxs)(Le,{items:n.items.map(({itemKey:e})=>e),strategy:Ee,children:[y===0&&(0,Q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),n.items.map(r=>{let i=l.find(({itemKey:e})=>e===r.itemKey)?.phase,o=s||i!==void 0;return(0,Q.jsx)(mt,{item:r,project:e,showRepository:t,lane:n,catalog:a,draggable:!o&&v.length>0,phase:i,moves:{targets:v,disabled:o,onMove:f},stall:u(r),readOnly:c,openRun:d},r.itemKey)})]})})]})},Ct=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,Q.jsx)($,{size:`sm`,className:k(ft(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,Q.jsx)(lt,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),wt=({runs:e,openRun:t})=>(0,Q.jsxs)($,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,Q.jsxs)(Ye,{children:[(0,Q.jsx)(Xe,{children:`Runs without a card`}),(0,Q.jsxs)(Ze,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,Q.jsx)(Qe,{children:(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(Ce,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)(H,{children:`Loop`}),(0,Q.jsx)(H,{children:`Agent`}),(0,Q.jsx)(H,{children:`Item`}),(0,Q.jsx)(H,{children:`State`}),(0,Q.jsx)(H,{className:`w-0`})]})}),(0,Q.jsx)(we,{children:e.map(e=>(0,Q.jsxs)(U,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,Q.jsx)(W,{className:`font-medium`,children:e.loop}),(0,Q.jsx)(W,{children:e.agent}),(0,Q.jsx)(W,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,Q.jsx)(W,{children:(0,Q.jsx)(xe,{state:e.state})}),(0,Q.jsx)(W,{className:`text-right`,children:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,Q.jsx)(X,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Tt=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Et=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Dt=e=>{let t=G(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=G({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return Oe(e)},Ot=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Fe(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},kt=(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}})},At=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))},jt=({project:e,loops:t,stalled:n,disabled:r,openRun:i})=>{let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),{moves:l,moveItem:u,isPending:d,error:f}=ne(e),p=At(e),m=l.reduce(kt,Tt(e.board.lanes)),h=Ae(K(Me,{activationConstraint:{distance:6}}),K(De,{coordinateGetter:Ot(m)})),g=gt(m,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),_=m.reduce((e,t)=>e+t.items.length,0),v=e=>ze(n,e),y=new Map(e.labels.map(e=>[e.name,e])),b=r||d,x=()=>{o(null),c(null)};return(0,Q.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,Q.jsx)(le,{title:P(e),leading:(0,Q.jsx)(z,{repository:e.repository,size:`title`}),counts:`${m.length} lane${m.length===1?``:`s`}, ${_} item${_===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,Q.jsx)(Se,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,Q.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,Q.jsx)(R,{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{t as r}from"./use-project-links-Fu48JLi4.js";import{t as i}from"./useSuspenseQuery-ajaZl96Y.js";import{a,b as o,c as s,d as c,f as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,s as _,u as v,v as y}from"./actions-BJyy4rAU.js";import{t as b}from"./link-CXTzqBsX.js";import{r as x,t as S}from"./mark-Bcl_OnGe.js";import{a as C,i as w,l as ee,n as T,o as E,r as D,s as te,t as ne}from"./moves-CE5aPDYo.js";import{W as O,r as k,t as A}from"./button-C-mC9M4I.js";import{i as re}from"./context-8jHKzDOY.js";import{X as ie}from"./api-bysg7thy.js";import{c as ae,v as j}from"./strings-BIVdGoBr.js";import{F as oe,M,N as se,O as N,a as P,i as F,j as I,n as ce}from"./overview-DttgspDg.js";import{a as L,i as le}from"./page-BEg2Aata.js";import{t as R}from"./error-alert-BOLTerP9.js";import{t as ue}from"./queries-BWmBLMiv.js";import{A as de,F as fe,I as pe,M as me,N as he,O as ge,P as _e,Y as z,j as ve,k as ye,o as be,w as B}from"./index-Bx-WMd7h.js";import{n as V,r as xe,t as Se}from"./status-badge-DINlptKX.js";import{a as Ce,i as H,n as we,o as U,r as W,t as Te}from"./table-D3--FtAd.js";import{a as Ee,c as De,d as G,f as Oe,g as ke,h as Ae,i as je,l as Me,m as K,o as Ne,p as Pe,r as Fe,s as Ie,t as Le}from"./sortable.esm-Z2V3kAIY.js";import{t as q}from"./label-badge-3j5QARbS.js";import{t as Re}from"./action-DKG5mFTX.js";import{f as ze,o as Be,u as J}from"./model-ByB1UBiE.js";import{n as Ve,t as He}from"./strings-m0J9z5wt.js";import{t as Ue}from"./project-not-found-DrMlF8K5.js";var Y=e(t(),1),We=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`}))]]),Ge=new Map([[`bold`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`}),Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`,Y.createElement(Y.Fragment,null,Y.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`}))]]),X=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:We}));X.displayName=`ArrowUpRightIcon`;var Z=Y.forwardRef((e,t)=>Y.createElement(O,{ref:t,...e,weights:Ge}));Z.displayName=`ArrowsInLineHorizontalIcon`;var Ke=(e,t)=>e===`Running`?`Running since ${j(t)}`:e===`Failed`?`Failed at ${j(t)}`:N(t),qe={above:!1,below:!1},Je=()=>{let[e,t]=(0,Y.useState)(qe),n=(0,Y.useRef)(null);return[(0,Y.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},Q=n();function $({className:e,size:t=`default`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:k(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Ye({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-header`,className:k(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Xe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-title`,className:k(`text-lg font-semibold`,e),...t})}function Ze({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-description`,className:k(`text-sm text-muted-foreground`,e),...t})}function Qe({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-(--card-spacing)`,e),...t})}var $e=3,et=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice($e);return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,$e).map(e=>(0,Q.jsx)(q,{name:e,label:t.get(e)},e)),n.length>0&&(0,Q.jsxs)(B,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},tt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,nt=({item:e,project:t})=>{let n=r();return(0,Q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,Q.jsx)(b,{...t===void 0?{...n.task(e.repository,J(e))}:{to:`/projects/$project/tasks/$number`,params:{project:t,number:J(e)},search:{repository:e.repository}},draggable:!1,className:tt,children:(0,Q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})})},rt=({failure:e,children:t})=>(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),it=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,Q.jsx)(A,{variant:`outline`,size:`xs`,className:`relative z-10`,title:I(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:M.retry}):null,at=({run:e})=>{let t=L(3e4),n=w(e);return(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,Q.jsx)(V,{state:e.state,className:`mr-0.5 ml-0.75`}),(0,Q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,Q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,Q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:Ke(e.state,n),children:ae(n,t)}),(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]})},ot=({stalled:e,named:t,children:n})=>{let r=L(3e4),i=Ve(e,r);return(0,Q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,Q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},st=e=>[`run-again`,`board-card`,e],ct=(e,t)=>{let n=st(e),r=a({mutationKey:n,onClaimed:t}),i=o({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(m(e))}},lt=({project:e,showRepository:t,item:n,lane:r,catalog:i,stall:a,readOnly:o,action:s,again:c,progress:l})=>{let u=C(n),d=D(n),f=s?.error?.message??null,p=c?.error?.message??null,m=a!==null&&u!==null&&(a.reason._tag===`RunFailed`||a.reason._tag===`SuppressedForOperator`)&&a.reason.run.id===u.run.id,h=a===null||s===null?null:(0,Q.jsx)(Re,{stalled:a,readOnly:o,appearance:`card`}),g=n.needsYou&&!(d?.canApprove||d?.canResolveFailure)&&a===null;return(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,Q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:n.items.map(e=>(0,Q.jsx)(S,{item:e,className:`relative z-10`},e.itemKey))}),t&&(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(z,{repository:n.repository}),(0,Q.jsx)(`span`,{className:`truncate`,children:n.repository})]}),(0,Q.jsx)(nt,{item:n,project:e}),(0,Q.jsx)(et,{labels:T(n,r),catalog:i}),d!==null&&(0,Q.jsx)(at,{run:d}),l!==null&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:l}),u!==null&&(0,Q.jsx)(rt,{failure:u,children:m&&a?.reason._tag===`SuppressedForOperator`?h:(0,Q.jsx)(it,{failure:u,action:s})}),a!==null&&!m&&(0,Q.jsx)(ot,{stalled:a,named:(d===null||Be(a)?.id!==d.id)&&!He(a),children:h}),c?.data?._tag===`CycleBlocked`&&(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),f!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),p!==null&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:p}),n.conflicting&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),g&&(0,Q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},ut=({runs:e,openRun:t})=>(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Run history`}),(0,Q.jsx)(g,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,Q.jsxs)(f,{onClick:()=>t(e.id),children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,Q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(V,{state:e.state}),e.state]}),(0,Q.jsx)(`time`,{dateTime:e.openedAt,title:N(e.openedAt),className:`font-mono tabular-nums`,children:ae(e.openedAt)})]})]},e.id))})]}),dt=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:o})=>{let[d,m]=(0,Y.useState)(!1),b=x(e),C=e.runs.filter(({id:e})=>e!==t?.id),w=e.run?.canRunAgain===!0?e.run:null,T=[{key:`links`,content:e.items.map(e=>(0,Q.jsxs)(v,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,Q.jsx)(S,{item:e,linked:!1}),` on GitHub`,(0,Q.jsx)(ee,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||C.length>0)&&T.push({key:`runs`,content:(0,Q.jsxs)(Q.Fragment,{children:[t!==null&&(0,Q.jsx)(f,{onClick:()=>r(t.id),children:`Open run`}),C.length>0&&(0,Q.jsx)(ut,{runs:C,openRun:r})]})});let E=i.isPending||a.isPending,D=w!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!E&&D&&T.push({key:`actions`,content:(0,Q.jsxs)(Q.Fragment,{children:[t?.canApprove&&(0,Q.jsx)(f,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:M.approve}),t?.canRetry&&(0,Q.jsx)(f,{title:I(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:M.retry}),w!==null&&(0,Q.jsxs)(f,{onClick:()=>a.send(w),children:[M.runAgain,(0,Q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:w.loop})]}),t?.canCancel&&(0,Q.jsx)(f,{variant:`destructive`,onClick:()=>m(!0),children:M.cancel})]})}),!n.disabled&&n.targets.length>0&&T.push({key:`move`,content:(0,Q.jsxs)(l,{children:[(0,Q.jsx)(p,{children:`Move to`}),(0,Q.jsx)(g,{className:`min-w-40`,children:n.targets.map(t=>(0,Q.jsx)(f,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(h,{children:[(0,Q.jsx)(u,{render:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,className:k(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,o)}),"aria-label":`Actions for ${b}`,children:(0,Q.jsx)(y,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(_,{align:`end`,className:`w-auto min-w-48`,children:T.map(({key:e,content:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&(0,Q.jsx)(c,{}),(0,Q.jsx)(s,{children:t})]},e))})]}),t!==null&&(0,Q.jsx)(ye,{open:d,onOpenChange:m,children:(0,Q.jsxs)(me,{children:[(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(pe,{children:[`Cancel `,t.loop,`?`]}),(0,Q.jsxs)(he,{children:[`The run on `,b,` stops, including any attempt in progress.`]})]}),(0,Q.jsxs)(_e,{children:[(0,Q.jsx)(ve,{children:M.keepRunning}),(0,Q.jsx)(de,{variant:`destructive`,onClick:()=>{m(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:M.confirmCancel})]})]})})]})},ft=e=>k(`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`),pt=(e,t,n)=>e.isPending&&e.variables!==void 0?se[e.variables.request.action]:t.isPending?oe:n===void 0?null:te(n),mt=({project:e,showRepository:t,item:n,lane:r,catalog:i,draggable:a,phase:o,moves:s,stall:c,readOnly:l,openRun:u})=>{let f=d(),p=ct(n.itemKey,u),{attributes:m,listeners:h,setNodeRef:g,setActivatorNodeRef:_,transform:v,transition:y,isDragging:b}=je({id:n.itemKey,disabled:{draggable:!a,droppable:r._tag!==`WritableBoardLane`}});return(0,Q.jsxs)(`div`,{ref:g,style:{transform:ke.Translate.toString(v),transition:y},className:k(`group/task relative`,b&&`opacity-40`),children:[(0,Q.jsx)($,{ref:_,size:`sm`,className:k(ft(n.needsYou),a&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...a&&m,...a&&h,children:(0,Q.jsx)(lt,{project:e,showRepository:t,item:n,lane:r,catalog:i,stall:c,readOnly:l,action:f,again:p,progress:pt(f,p,o)})}),(0,Q.jsx)(dt,{item:n,run:D(n),moves:s,openRun:u,action:f,again:p,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`})]})},ht=new Set([`Waiting`,`Queued`,`Running`]),gt=(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})=>ht.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]]})),_t=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),vt=({flow:e})=>{let t=e.loops.length>0;return(0,Q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:k(`-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: ${_t(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,Q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,Q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,Q.jsxs)(Y.Fragment,{children:[n>0&&`, `,e,t&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:k(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,Q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},yt=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&ie(e.state)),bt=({sources:e,catalog:t})=>(0,Q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,Q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,Q.jsx)(q,{name:e.label,label:t.get(e.label)}):(0,Q.jsx)(B,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),xt=({lane:e,open:t})=>(0,Q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,Q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,Q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),St=({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 p=yt(n),[m,h]=(0,Y.useState)(p),g=n._tag===`WritableBoardLane`,{setNodeRef:_}=Pe({id:n.id,disabled:!g||s}),v=r.filter(e=>e._tag===`WritableBoardLane`&&e.id!==n.id),y=n.items.length,[b,x]=Je();return re(p?[{label:E(n.name,m),run:()=>h(!m)}]:[]),p&&m?(0,Q.jsx)(xt,{lane:n,open:()=>h(!1)}):(0,Q.jsxs)(`section`,{ref:_,"aria-label":`${n.name} lane`,className:k(`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,Q.jsxs)(`header`,{className:k(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!o&&`bg-background`),children:[(0,Q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:n.name}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:y})]}),i!==void 0&&(0,Q.jsx)(vt,{flow:i}),p&&(0,Q.jsx)(A,{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:()=>h(!0),children:(0,Q.jsx)(Z,{"aria-hidden":`true`})})]}),(0,Q.jsx)(`div`,{className:`min-h-5`,children:n.sources.length>0&&(0,Q.jsx)(bt,{sources:n.sources,catalog:a})})]}),(0,Q.jsx)(`div`,{ref:b,"aria-label":`${n.name} cards`,tabIndex:x.above||x.below?0:void 0,className:k(`-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`,x.above&&`mask-t-from-[calc(100%-2.5rem)]`,x.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,Q.jsxs)(Le,{items:n.items.map(({itemKey:e})=>e),strategy:Ee,children:[y===0&&(0,Q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),n.items.map(r=>{let i=l.find(({itemKey:e})=>e===r.itemKey)?.phase,o=s||i!==void 0;return(0,Q.jsx)(mt,{item:r,project:e,showRepository:t,lane:n,catalog:a,draggable:!o&&v.length>0,phase:i,moves:{targets:v,disabled:o,onMove:f},stall:u(r),readOnly:c,openRun:d},r.itemKey)})]})})]})},Ct=({item:e,lane:t,catalog:n,stall:r,project:i,showRepository:a})=>(0,Q.jsx)($,{size:`sm`,className:k(ft(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,Q.jsx)(lt,{project:i,showRepository:a,item:e,lane:t,catalog:n,stall:r,readOnly:!0,action:null,again:null,progress:null})}),wt=({runs:e,openRun:t})=>(0,Q.jsxs)($,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,Q.jsxs)(Ye,{children:[(0,Q.jsx)(Xe,{children:`Runs without a card`}),(0,Q.jsxs)(Ze,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,Q.jsx)(Qe,{children:(0,Q.jsxs)(Te,{children:[(0,Q.jsx)(Ce,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)(H,{children:`Loop`}),(0,Q.jsx)(H,{children:`Agent`}),(0,Q.jsx)(H,{children:`Item`}),(0,Q.jsx)(H,{children:`State`}),(0,Q.jsx)(H,{className:`w-0`})]})}),(0,Q.jsx)(we,{children:e.map(e=>(0,Q.jsxs)(U,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,Q.jsx)(W,{className:`font-medium`,children:e.loop}),(0,Q.jsx)(W,{children:e.agent}),(0,Q.jsx)(W,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,Q.jsx)(W,{children:(0,Q.jsx)(xe,{state:e.state})}),(0,Q.jsx)(W,{className:`text-right`,children:(0,Q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,Q.jsx)(X,{"aria-hidden":`true`})})})]},e.id))})]})})]}),Tt=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],Et=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Dt=e=>{let t=G(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=G({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return Oe(e)},Ot=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Fe(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},kt=(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}})},At=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))},jt=({project:e,loops:t,stalled:n,disabled:r,openRun:i})=>{let[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),{moves:l,moveItem:u,isPending:d,error:f}=ne(e),p=At(e),m=l.reduce(kt,Tt(e.board.lanes)),h=Ae(K(Me,{activationConstraint:{distance:6}}),K(De,{coordinateGetter:Ot(m)})),g=gt(m,e.id===void 0?t:t.filter(t=>t.name.startsWith(`${e.id}/`))),_=m.reduce((e,t)=>e+t.items.length,0),v=e=>ze(n,e),y=new Map(e.labels.map(e=>[e.name,e])),b=r||d,x=()=>{o(null),c(null)};return(0,Q.jsxs)(`div`,{className:`flex min-w-0 min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,Q.jsx)(le,{title:P(e),leading:(0,Q.jsx)(z,{repository:e.repository,size:`title`}),counts:`${m.length} lane${m.length===1?``:`s`}, ${_} item${_===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,Q.jsx)(Se,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,Q.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,Q.jsx)(R,{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,Q.jsx)(R,{className:`mx-4 max-w-3xl md:mx-5`,message:f.message}),(0,Q.jsxs)(Ne,{sensors:h,collisionDetection:Dt,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:Et(e.id,m)?.id??null),onDragEnd:({over:e})=>{if(x(),e===null||a===null)return;let t=Et(e.id,m);t!==void 0&&u(a.item,t)},onDragCancel:x,children:[(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain [container-type:size]`,"aria-label":`${P(e)} project board`,children:(0,Q.jsxs)(`div`,{className:`flex w-max min-w-full flex-col gap-6 px-4 pb-4 md:px-5`,children:[(0,Q.jsx)(`div`,{className:`flex h-[calc(100cqh-1rem)] min-h-80 shrink-0 gap-3`,children:m.map(t=>(0,Q.jsx)(St,{project:F(e),showRepository:e.repositories.length>1,lane:t,lanes:m,flow:g.get(t.id),catalog:y,targeted:a!==null&&s===t.id&&t.id!==a.lane.id&&t._tag===`WritableBoardLane`,pending:b,readOnly:r,moves:l,stallOf:v,openRun:i,onMove:u},t.id))}),p.length>0&&(0,Q.jsx)(wt,{runs:p,openRun:i})]})}),(0,Q.jsx)(Ie,{children:a!==null&&(0,Q.jsx)(Ct,{item:a.item,project:F(e),showRepository:e.repositories.length>1,lane:a.lane,catalog:y,stall:v(a.item)})})]})]})},Mt=()=>{let{project:e}=be.useParams(),{data:t}=i(ce()),n=i(ue()),r=ge(),a=t.projects.find(t=>F(t)===e);return a===void 0?(0,Q.jsx)(Ue,{}):(0,Q.jsx)(jt,{project:a,loops:t.loops,stalled:n.data.notMoving,disabled:t._tag===`NeedsSetup`,openRun:r})};export{Mt as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,Z as n,r,s as i,t as a}from"./section-C8IBNoJA.js";import{t as o}from"./useSuspenseQuery-ajaZl96Y.js";import{t as s}from"./link-CXTzqBsX.js";import{n as c}from"./queries-C1SujlpL.js";import{c as l}from"./index-s2nPwRk7.js";import{t as u}from"./repository-link-C611-quq.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};
1
+ import{t as e}from"./jsx-runtime-Wy9s6hX0.js";import{A as t,Z as n,r,s as i,t as a}from"./section-g5u_j_Nn.js";import{t as o}from"./useSuspenseQuery-ajaZl96Y.js";import{t as s}from"./link-CXTzqBsX.js";import{n as c}from"./queries-EA5CUqp7.js";import{c as l}from"./index-Bx-WMd7h.js";import{t as u}from"./repository-link-BcZaWb8n.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-Cd8uO1qX.js";var t=e;export{t as errorComponent};