@straiffi/archon 1.7.0 → 1.7.2

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 (79) hide show
  1. package/dist/client/assets/{GitHubActionsDialog-B9_WJBOp.js → GitHubActionsDialog-DAD5REmY.js} +1 -1
  2. package/dist/client/assets/{TestsDialog-DKvbjH_M.js → TestsDialog-B5NVrroq.js} +1 -1
  3. package/dist/client/assets/{TicketChangesModal-C8rFoKjY.js → TicketChangesModal-By-_gTGd.js} +1 -1
  4. package/dist/client/assets/{architectureDiagram-3BPJPVTR-DXRSRLL9.js → architectureDiagram-3BPJPVTR-Do9nbC8v.js} +1 -1
  5. package/dist/client/assets/{blockDiagram-GPEHLZMM-D7EE6Dnv.js → blockDiagram-GPEHLZMM-DGGOLHF8.js} +1 -1
  6. package/dist/client/assets/{c4Diagram-AAUBKEIU-UhVzFafr.js → c4Diagram-AAUBKEIU-Bz7tQybs.js} +1 -1
  7. package/dist/client/assets/channel-Dd5Len0X.js +1 -0
  8. package/dist/client/assets/{chunk-2J33WTMH-obbfylVr.js → chunk-2J33WTMH-CJO-GmWJ.js} +1 -1
  9. package/dist/client/assets/{chunk-3OPIFGDE-DPVuS-uo.js → chunk-3OPIFGDE-DPAVagpC.js} +1 -1
  10. package/dist/client/assets/{chunk-5ZQYHXKU-Dsc03vy9.js → chunk-5ZQYHXKU-Cof75Mu7.js} +1 -1
  11. package/dist/client/assets/{chunk-727SXJPM-COE-iq_Z.js → chunk-727SXJPM-COuPqQ8_.js} +1 -1
  12. package/dist/client/assets/{chunk-AQP2D5EJ-DnbAdr8m.js → chunk-AQP2D5EJ-CFj5KabW.js} +1 -1
  13. package/dist/client/assets/{chunk-CSCIHK7Q-DbTzC_WS.js → chunk-CSCIHK7Q-C4M6w5cT.js} +1 -1
  14. package/dist/client/assets/{chunk-KSCS5N6A-xvviIayr.js → chunk-KSCS5N6A-ByaiwVue.js} +1 -1
  15. package/dist/client/assets/{chunk-L5ZTLDWV-DY4Q9Til.js → chunk-L5ZTLDWV-Cx5jeot9.js} +1 -1
  16. package/dist/client/assets/{chunk-LZXEDZCA-Bbeq2DZs.js → chunk-LZXEDZCA-DmGtztud.js} +2 -2
  17. package/dist/client/assets/{chunk-ND2GUHAM-CylX1p3K.js → chunk-ND2GUHAM-i3yuspqL.js} +1 -1
  18. package/dist/client/assets/{chunk-NZK2D7GU-BTcALpQq.js → chunk-NZK2D7GU-CQ4E_jP4.js} +1 -1
  19. package/dist/client/assets/{chunk-O5CBEL6O-Be_5dk2_.js → chunk-O5CBEL6O-D2g4VDCd.js} +1 -1
  20. package/dist/client/assets/{chunk-WU5MYG2G-DXPsSM4Q.js → chunk-WU5MYG2G-exIu-zQ2.js} +1 -1
  21. package/dist/client/assets/classDiagram-4FO5ZUOK-B7KUg6r8.js +1 -0
  22. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CQm-z5c4.js +1 -0
  23. package/dist/client/assets/{dagre-BM42HDAG-CABUW7xK.js → dagre-BM42HDAG-DvF75yLZ.js} +1 -1
  24. package/dist/client/assets/{diagram-2AECGRRQ-KvcNrpvf.js → diagram-2AECGRRQ-DFv0HxLL.js} +1 -1
  25. package/dist/client/assets/{diagram-5GNKFQAL-DQV6-I4e.js → diagram-5GNKFQAL-C_LRir0-.js} +1 -1
  26. package/dist/client/assets/{diagram-KO2AKTUF-DYDk9roD.js → diagram-KO2AKTUF-DGZxRDRy.js} +1 -1
  27. package/dist/client/assets/{diagram-LMA3HP47-Da-0u-HG.js → diagram-LMA3HP47-UXt0uti4.js} +1 -1
  28. package/dist/client/assets/{diagram-OG6HWLK6-CuD5eRBv.js → diagram-OG6HWLK6-CFbZS4n5.js} +1 -1
  29. package/dist/client/assets/{erDiagram-TEJ5UH35-BL5dBE-b.js → erDiagram-TEJ5UH35-CfAwZDdf.js} +1 -1
  30. package/dist/client/assets/{flowDiagram-I6XJVG4X-Bke5cWs7.js → flowDiagram-I6XJVG4X-Cdgi5z3n.js} +1 -1
  31. package/dist/client/assets/{ganttDiagram-6RSMTGT7-5OD-ayGn.js → ganttDiagram-6RSMTGT7-DOrkFkhu.js} +1 -1
  32. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-7Cf6FVfO.js → gitGraphDiagram-PVQCEYII-cEox0peD.js} +1 -1
  33. package/dist/client/assets/index-BHq6-Eir.js +270 -0
  34. package/dist/client/assets/index-BxTc5qQT.css +2 -0
  35. package/dist/client/assets/{infoDiagram-5YYISTIA-BchMN9V-.js → infoDiagram-5YYISTIA-gm51u2Nn.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-D6TchjQy.js → ishikawaDiagram-YF4QCWOH-CjnoOIja.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-JHISSGLW-CwEcoeX-.js → journeyDiagram-JHISSGLW-Dlg4DsiO.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-UN3LZRKU-S2V9CLGR.js → kanban-definition-UN3LZRKU-BU0XZaSd.js} +1 -1
  39. package/dist/client/assets/{line-DRheChzQ.js → line-Bert22-_.js} +1 -1
  40. package/dist/client/assets/{mermaid-parser.core-CN13XjLe.js → mermaid-parser.core-BvQSGDmL.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-JhdSpoF5.js → mermaid.core--qSAHJRj.js} +3 -3
  42. package/dist/client/assets/{mindmap-definition-RKZ34NQL-657TKwRB.js → mindmap-definition-RKZ34NQL-BgFIvWWD.js} +1 -1
  43. package/dist/client/assets/{pieDiagram-4H26LBE5-DJ8eQ94X.js → pieDiagram-4H26LBE5-DGcbXD0M.js} +1 -1
  44. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-GpYFqyb1.js → quadrantDiagram-W4KKPZXB-ClkBUeia.js} +1 -1
  45. package/dist/client/assets/{requirementDiagram-4Y6WPE33-COZFWgq1.js → requirementDiagram-4Y6WPE33-B8CwGToU.js} +1 -1
  46. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-BdCHyfcQ.js → sankeyDiagram-5OEKKPKP-DTk3jL6B.js} +1 -1
  47. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-DAh3Ogx0.js → sequenceDiagram-3UESZ5HK-BQVrcnKf.js} +1 -1
  48. package/dist/client/assets/{stateDiagram-AJRCARHV-Ck8Yie8_.js → stateDiagram-AJRCARHV-DD4yMZPB.js} +1 -1
  49. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-C8yO6POT.js +1 -0
  50. package/dist/client/assets/{timeline-definition-PNZ67QCA-kYr9DNtP.js → timeline-definition-PNZ67QCA-BnCBVqcd.js} +1 -1
  51. package/dist/client/assets/{vennDiagram-CIIHVFJN-CC_SlRiC.js → vennDiagram-CIIHVFJN-BDmLMNXS.js} +1 -1
  52. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CZ17ccSN.js → wardleyDiagram-YWT4CUSO-DSLuQiEv.js} +1 -1
  53. package/dist/client/assets/{xychartDiagram-2RQKCTM6-Blqaj-ci.js → xychartDiagram-2RQKCTM6-DAq_LA4r.js} +1 -1
  54. package/dist/client/index.html +2 -2
  55. package/dist/server/index.js +15 -3
  56. package/dist/server/index.js.map +1 -1
  57. package/dist/server/lib/agent.js +54 -6
  58. package/dist/server/lib/agent.js.map +1 -1
  59. package/dist/server/lib/buildOpenQuestions.js +8 -0
  60. package/dist/server/lib/buildOpenQuestions.js.map +1 -1
  61. package/dist/server/lib/shutdown.js +2 -2
  62. package/dist/server/lib/shutdown.js.map +1 -1
  63. package/dist/server/lib/ticketOpenQuestions.js +30 -14
  64. package/dist/server/lib/ticketOpenQuestions.js.map +1 -1
  65. package/dist/server/lib/ticketRunOperations.js +24 -1
  66. package/dist/server/lib/ticketRunOperations.js.map +1 -1
  67. package/dist/server/lib/tickets.js +5 -2
  68. package/dist/server/lib/tickets.js.map +1 -1
  69. package/dist/server/workers/followUp.js +27 -15
  70. package/dist/server/workers/followUp.js.map +1 -1
  71. package/dist/server/workers/review.js +65 -1
  72. package/dist/server/workers/review.js.map +1 -1
  73. package/package.json +1 -1
  74. package/dist/client/assets/channel-CNoEXkwa.js +0 -1
  75. package/dist/client/assets/classDiagram-4FO5ZUOK-BgmK8-LI.js +0 -1
  76. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-Dj5LqBjo.js +0 -1
  77. package/dist/client/assets/index-D8EniXuq.css +0 -2
  78. package/dist/client/assets/index-DXuxAAzf.js +0 -270
  79. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-B6zibRqD.js +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./chunk-BNv3lrIs.js";import{A as t,B as n,D as r,E as i,F as a,H as o,L as s,N as c,O as l,P as u,R as d,T as f,V as p,W as ee,b as m,c as h,d as g,f as _,k as te,l as v,p as ne,q as y,r as b,s as x,u as S,v as C,x as w,z as re}from"./index-DXuxAAzf.js";var T=e(y(),1),E=p(),D=`https://docs.github.com/en/actions`,O=5e3,k=(e,t)=>h.t(`common:githubActions.${e}`,t),A=e=>k(`status.${e}`),j=e=>e?k(`conclusion.${e}`):null,M=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`||e.conclusion===`timed_out`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e.conclusion===`cancelled`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e.status===`queued`?`border-violet-400/40 bg-violet-500/10 text-violet-200`:`border-border/70 bg-background/60 text-muted-foreground`,N=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`?`border-rose-400/30 bg-rose-500/10 text-rose-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border/70 bg-background/60 text-muted-foreground`,P=e=>{let t=e.run_started_at??e.created_at,n=e.updated_at;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=i-r;if(a<1e3)return`${a} ms`;let o=Math.floor(a/1e3),s=Math.floor(o/3600),c=Math.floor(o%3600/60),l=o%60;return s>0?`${s}h ${c}m ${l}s`:c>0?`${c}m ${l}s`:`${(a/1e3).toFixed(a>=1e4?0:1)} s`},F=e=>e.status===`completed`?j(e.conclusion)??k(`status.completed`):A(e.status),I=e=>{let t={};for(let n of e){if(n.type===`boolean`){t[n.name]=n.default===!0;continue}typeof n.default==`string`&&n.default!==``&&(t[n.name]=n.default)}return t},L=({workflow:e,inputsState:t,isSelected:n,onSelect:r})=>{let i=e.state===`active`,o=t?.dispatchable??!0,s=i&&o&&!t?.isLoading,c=e.path.split(`/`).pop();return(0,E.jsxs)(`div`,{className:a(`flex flex-col gap-3 rounded-2xl border px-4 py-3 transition-colors`,n?`border-sky-400/45 bg-sky-500/10`:`border-border/60 bg-background/20 hover:bg-accent/20`),children:[(0,E.jsx)(`p`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:e.name}),(0,E.jsx)(`p`,{className:`min-w-0 break-words text-[11px] text-muted-foreground`,children:c}),(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,E.jsx)(x,{variant:`outline`,className:a(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,i?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:`border-border/70 bg-background/60 text-muted-foreground`),children:k(i?`workflows.stateActive`:`workflows.stateDisabled`)}),(0,E.jsxs)(u,{type:`button`,variant:n?`secondary`:`outline`,size:`sm`,className:`h-8 gap-1.5 px-3 text-xs`,disabled:!s,"aria-label":k(`workflows.runAriaLabel`,{name:e.name}),title:!o&&t?k(`inputs.notDispatchable`):void 0,onClick:r,children:[t?.isLoading?(0,E.jsx)(w,{className:`h-3.5 w-3.5 animate-spin`}):(0,E.jsx)(m,{className:`h-3.5 w-3.5`}),(0,E.jsx)(`span`,{children:k(`actions.run`)})]})]})]})},R=({workflow:e,inputsState:t,refValue:n,onRefChange:r,values:a,onValueChange:o,isDispatching:s,onDispatch:c,onCancel:l})=>{let d=t.inputs.filter(e=>e.required&&!z(a[e.name],e)),p=t.dispatchable&&!t.isLoading&&!t.error&&n.trim()!==``&&d.length===0&&!s;return(0,E.jsxs)(`div`,{className:`space-y-4 rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`inputs.title`)}),(0,E.jsx)(`p`,{className:`mt-0.5 truncate text-sm font-medium text-foreground`,children:e.name})]}),(0,E.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":k(`actions.cancel`),onClick:l,children:(0,E.jsx)(v,{className:`h-4 w-4`})})]}),(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(f,{htmlFor:`github-actions-ref`,children:k(`inputs.refLabel`)}),(0,E.jsx)(i,{id:`github-actions-ref`,type:`text`,value:n,onChange:e=>{r(e.target.value)},placeholder:k(`inputs.refPlaceholder`),"aria-label":k(`inputs.refAriaLabel`)})]}),t.isLoading&&(0,E.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,E.jsx)(w,{className:`h-3.5 w-3.5 animate-spin`}),(0,E.jsx)(`span`,{children:k(`inputs.loading`)})]}),t.error&&(0,E.jsx)(`p`,{className:`text-xs text-rose-200`,children:t.error}),!t.dispatchable&&!t.isLoading&&!t.error&&(0,E.jsx)(`p`,{className:`text-xs text-amber-200`,children:k(`inputs.notDispatchable`)}),t.inputs.map(e=>(0,E.jsx)(B,{input:e,value:a[e.name],onChange:t=>{o(e.name,t)}},e.name)),d.length>0&&(0,E.jsx)(`p`,{className:`text-xs text-rose-200`,children:k(`inputs.requiredValidationError`)}),(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,E.jsx)(u,{type:`button`,variant:`ghost`,onClick:l,disabled:s,children:k(`actions.cancel`)}),(0,E.jsxs)(u,{type:`button`,variant:`success`,onClick:c,disabled:!p,children:[s?(0,E.jsx)(w,{className:`h-4 w-4 animate-spin`}):(0,E.jsx)(m,{className:`h-4 w-4`}),(0,E.jsx)(`span`,{children:k(`actions.dispatch`)})]})]})]})},z=(e,t)=>t.type===`boolean`?typeof e==`boolean`:typeof e==`string`&&e.trim()!==``,B=({input:e,value:t,onChange:n})=>{let r=`github-actions-input-${e.name}`;return(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsxs)(f,{htmlFor:r,className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{children:e.name}),e.required&&(0,E.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-rose-200/80`,children:k(`inputs.requiredLabel`)})]}),e.description&&(0,E.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.description}),V(e,r,t,n)]})},V=(e,t,n,r)=>{if(e.type===`boolean`){let i=typeof n==`boolean`?n:e.default===!0;return(0,E.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,E.jsx)(b,{id:t,checked:i,onCheckedChange:e=>{r(e)}}),(0,E.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:k(i?`inputs.booleanYes`:`inputs.booleanNo`)})]})}if(e.type===`choice`){let i=e.options??[],a=typeof n==`string`?n:typeof e.default==`string`?e.default:``;return(0,E.jsxs)(`select`,{id:t,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,value:a,onChange:e=>{r(e.target.value)},children:[a===``&&(0,E.jsx)(`option`,{value:``,children:k(`inputs.selectPlaceholder`)}),i.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]})}return(0,E.jsx)(i,{id:t,type:`text`,value:typeof n==`string`?n:typeof e.default==`string`?e.default:``,onChange:e=>{r(e.target.value)}})},H=({job:e})=>e.steps.length===0?null:(0,E.jsx)(`div`,{className:`mt-2 ml-4 space-y-1 border-l border-border/60 pl-4`,children:e.steps.map(t=>(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(x,{variant:`outline`,className:a(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,N(t)),children:t.status===`completed`?j(t.conclusion)??k(`status.completed`):A(t.status)}),(0,E.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:t.name})]},`${e.id}-${t.number}`))}),U=({run:e})=>{let t=P(e),n=F(e);return(0,E.jsxs)(`div`,{className:`rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`#${e.id}`}),(0,E.jsx)(x,{variant:`outline`,className:a(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,M(e)),children:n})]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[t&&(0,E.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t}),e.html_url&&(0,E.jsxs)(`a`,{href:e.html_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-sky-200 hover:text-sky-100`,children:[k(`actions.openOnGithub`),(0,E.jsx)(S,{className:`h-3 w-3`})]})]})]}),e.head_branch&&(0,E.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.head_branch}),e.jobs.map(e=>(0,E.jsxs)(`div`,{className:`mt-2`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(x,{variant:`outline`,className:a(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,M(e)),children:e.status===`completed`?j(e.conclusion)??k(`status.completed`):A(e.status)}),(0,E.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.name})]}),(0,E.jsx)(H,{job:e})]},e.id))]})},W=({tracked:e})=>{let t=e.state===`not_visible`?k(`runs.notVisible`):k(`runs.resolving`);return(0,E.jsxs)(`div`,{className:`flex items-center gap-2 rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,E.jsx)(w,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,E.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})},G=e=>({ref:e??`main`}),K=({projectId:e,defaultBranch:i,onClose:a})=>{let[f,p]=(0,T.useState)([]),[m,h]=(0,T.useState)(!0),[y,b]=(0,T.useState)(null),[x,A]=(0,T.useState)([]),[j,M]=(0,T.useState)([]),[N,P]=(0,T.useState)({}),[F,z]=(0,T.useState)(null),[B,V]=(0,T.useState)(!1),[H]=(0,T.useState)(()=>G(i)),K=(0,T.useRef)({}),q=(0,T.useRef)({}),J=(0,T.useRef)(null),Y=(0,T.useRef)(!1),X=(0,T.useCallback)(async t=>{P(e=>{let n=e[t.id];return n?.isLoading?e:{...e,[t.id]:{inputs:n?.inputs??[],dispatchable:n?.dispatchable??!0,isLoading:!0,error:null}}});try{let n=await d(e,t.id,t.path);return P(e=>({...e,[t.id]:{inputs:n.inputs,dispatchable:n.dispatchable,isLoading:!1,error:null}})),n}catch(e){return P(n=>({...n,[t.id]:{inputs:[],dispatchable:!0,isLoading:!1,error:e instanceof o?e.message:k(`workflows.loadError`)}})),null}},[e]),Z=(0,T.useCallback)(async()=>{h(!0),b(null);try{let t=await n(e);p(t.workflows),Promise.allSettled(t.workflows.map(e=>X(e)))}catch(e){b(e instanceof o?e.message:k(`workflows.loadError`))}finally{h(!1)}},[X,e]),Q=(0,T.useCallback)(async t=>{if(!Y.current){Y.current=!0;try{A((await re(e,t)).runs)}catch(e){ee(e)||console.warn(`[github-actions] unable to load runs`,e)}finally{Y.current=!1}}},[e]);(0,T.useEffect)(()=>{Z()},[Z]),(0,T.useEffect)(()=>{let e=new AbortController,t=()=>{document.visibilityState===`visible`&&Q(e.signal)};t();let n=window.setInterval(t,O),r=_(t);return()=>{e.abort(),window.clearInterval(n),r()}},[Q]);let ie=(0,T.useCallback)(async e=>{if(F?.workflow.id===e.id)return;J.current=e.id,z({workflow:e,ref:H.ref,values:{}});let t=N[e.id];if(t&&!t.isLoading&&!t.error){z(n=>!n||n.workflow.id!==e.id?n:{...n,values:I(t.inputs)});return}let n=await X(e);n&&z(t=>!t||t.workflow.id!==e.id?t:{...t,values:I(n.inputs)})},[H.ref,N,X,F]),ae=(0,T.useCallback)(async()=>{if(!F)return;let t=N[F.workflow.id];if(!t||!t.dispatchable)return;V(!0);let n={};for(let e of t.inputs){let t=F.values[e.name];e.type===`boolean`?n[e.name]=typeof t==`boolean`?t:e.default===!0:typeof t==`string`&&t!==``?n[e.name]=t:typeof e.default==`string`&&e.default!==``&&(n[e.name]=e.default)}try{await s(e,F.workflow.id,{ref:F.ref,inputs:n}),C.success(k(`messages.dispatched`)),z(null),Q()}catch(e){C.error(e instanceof o?e.message:k(`messages.dispatchError`))}finally{V(!1)}},[N,Q,e,F]);(0,T.useEffect)(()=>{let t=t=>{!t||t.project_id!==e||(M(e=>{let n=e.filter(e=>e.tracking_key!==t.tracking_key);return t.run?n:[...n,t]}),t.run&&A(e=>{let n=e.findIndex(e=>e.id===t.run.id);if(n===-1)return[t.run,...e];let r=[...e];return r[n]=t.run,r}))};return g.on(`github-actions:updated`,t),()=>{g.off(`github-actions:updated`,t)}},[e]),(0,T.useEffect)(()=>{let e=F?.workflow.id;!e||J.current!==e||(K.current[e]?.scrollIntoView({block:`nearest`}),q.current[e]?.scrollIntoView({block:`nearest`}),J.current=null)},[F?.workflow.id]);let $=(0,T.useMemo)(()=>[...x].sort((e,t)=>{let n=e.updated_at?Date.parse(e.updated_at):0;return(t.updated_at?Date.parse(t.updated_at):0)-n}),[x]);return(0,E.jsx)(r,{open:!0,onOpenChange:e=>{e||a()},children:(0,E.jsxs)(te,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-5xl`,onInteractOutside:e=>e.preventDefault(),children:[(0,E.jsx)(c,{className:`sr-only`,children:k(`dialog.srTitle`)}),(0,E.jsx)(t,{className:`sr-only`,children:k(`dialog.srDescription`)}),(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,E.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-violet-200`,children:(0,E.jsx)(ne,{className:`h-5 w-5`})}),(0,E.jsx)(`div`,{children:(0,E.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:k(`dialog.title`)})})]}),(0,E.jsx)(l,{asChild:!0,children:(0,E.jsx)(u,{type:`button`,"aria-label":k(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,E.jsx)(v,{className:`h-4 w-4`})})})]}),(0,E.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,E.jsxs)(`aside`,{"aria-label":k(`workflows.ariaLabel`),className:`flex min-h-0 flex-col gap-3 overflow-y-auto border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`workflows.title`)}),(0,E.jsx)(u,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>{Z(),Q()},children:k(`actions.refresh`)})]}),m&&(0,E.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-xs text-muted-foreground`,children:[(0,E.jsx)(w,{className:`h-3.5 w-3.5 animate-spin`}),(0,E.jsx)(`span`,{children:k(`workflows.loading`)})]}),y&&(0,E.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:y}),!m&&f.length===0&&!y&&(0,E.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:[(0,E.jsx)(`p`,{children:k(`workflows.empty`)}),(0,E.jsx)(`p`,{className:`mt-1`,children:k(`workflows.emptyHint`)}),(0,E.jsxs)(`a`,{href:D,target:`_blank`,rel:`noreferrer`,className:`mt-2 inline-flex items-center gap-1 text-xs text-sky-200 hover:text-sky-100`,children:[k(`workflows.docsLink`),(0,E.jsx)(S,{className:`h-3 w-3`})]})]}),(0,E.jsx)(`div`,{className:`space-y-2`,children:f.map(e=>{let t=F?.workflow.id===e.id;return(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(`div`,{ref:t=>{K.current[e.id]=t},children:(0,E.jsx)(L,{workflow:e,inputsState:N[e.id]??null,isSelected:t,onSelect:()=>{ie(e)}})}),t&&F&&(0,E.jsx)(`div`,{ref:t=>{q.current[e.id]=t},children:(0,E.jsx)(R,{workflow:e,inputsState:N[e.id]??{inputs:[],dispatchable:!0,isLoading:!1,error:null},refValue:F.ref,onRefChange:e=>{z(t=>t&&{...t,ref:e})},values:F.values,onValueChange:(e,t)=>{z(n=>n&&{...n,values:{...n.values,[e]:t}})},isDispatching:B,onDispatch:()=>{ae()},onCancel:()=>{z(null)}})})]},e.id)})})]}),(0,E.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-3 overflow-y-auto px-4 py-4`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`runs.title`)}),j.map(e=>(0,E.jsx)(W,{tracked:e},e.tracking_key)),$.map(e=>(0,E.jsx)(U,{run:e},e.id)),$.length===0&&j.length===0&&(0,E.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:k(`runs.empty`)})]})]})]})})};export{K as GitHubActionsDialog};
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{A as t,B as n,D as r,E as i,F as a,H as o,L as s,N as c,O as l,P as u,R as d,T as f,V as p,W as ee,b as m,c as h,d as g,f as _,k as te,l as v,p as ne,q as y,r as b,s as x,u as S,v as C,x as w,z as re}from"./index-BHq6-Eir.js";var T=e(y(),1),E=p(),D=`https://docs.github.com/en/actions`,O=5e3,k=(e,t)=>h.t(`common:githubActions.${e}`,t),A=e=>k(`status.${e}`),j=e=>e?k(`conclusion.${e}`):null,M=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`||e.conclusion===`timed_out`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e.conclusion===`cancelled`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e.status===`queued`?`border-violet-400/40 bg-violet-500/10 text-violet-200`:`border-border/70 bg-background/60 text-muted-foreground`,N=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`?`border-rose-400/30 bg-rose-500/10 text-rose-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border/70 bg-background/60 text-muted-foreground`,P=e=>{let t=e.run_started_at??e.created_at,n=e.updated_at;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=i-r;if(a<1e3)return`${a} ms`;let o=Math.floor(a/1e3),s=Math.floor(o/3600),c=Math.floor(o%3600/60),l=o%60;return s>0?`${s}h ${c}m ${l}s`:c>0?`${c}m ${l}s`:`${(a/1e3).toFixed(a>=1e4?0:1)} s`},F=e=>e.status===`completed`?j(e.conclusion)??k(`status.completed`):A(e.status),I=e=>{let t={};for(let n of e){if(n.type===`boolean`){t[n.name]=n.default===!0;continue}typeof n.default==`string`&&n.default!==``&&(t[n.name]=n.default)}return t},L=({workflow:e,inputsState:t,isSelected:n,onSelect:r})=>{let i=e.state===`active`,o=t?.dispatchable??!0,s=i&&o&&!t?.isLoading,c=e.path.split(`/`).pop();return(0,E.jsxs)(`div`,{className:a(`flex flex-col gap-3 rounded-2xl border px-4 py-3 transition-colors`,n?`border-sky-400/45 bg-sky-500/10`:`border-border/60 bg-background/20 hover:bg-accent/20`),children:[(0,E.jsx)(`p`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:e.name}),(0,E.jsx)(`p`,{className:`min-w-0 break-words text-[11px] text-muted-foreground`,children:c}),(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,E.jsx)(x,{variant:`outline`,className:a(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,i?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:`border-border/70 bg-background/60 text-muted-foreground`),children:k(i?`workflows.stateActive`:`workflows.stateDisabled`)}),(0,E.jsxs)(u,{type:`button`,variant:n?`secondary`:`outline`,size:`sm`,className:`h-8 gap-1.5 px-3 text-xs`,disabled:!s,"aria-label":k(`workflows.runAriaLabel`,{name:e.name}),title:!o&&t?k(`inputs.notDispatchable`):void 0,onClick:r,children:[t?.isLoading?(0,E.jsx)(w,{className:`h-3.5 w-3.5 animate-spin`}):(0,E.jsx)(m,{className:`h-3.5 w-3.5`}),(0,E.jsx)(`span`,{children:k(`actions.run`)})]})]})]})},R=({workflow:e,inputsState:t,refValue:n,onRefChange:r,values:a,onValueChange:o,isDispatching:s,onDispatch:c,onCancel:l})=>{let d=t.inputs.filter(e=>e.required&&!z(a[e.name],e)),p=t.dispatchable&&!t.isLoading&&!t.error&&n.trim()!==``&&d.length===0&&!s;return(0,E.jsxs)(`div`,{className:`space-y-4 rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`inputs.title`)}),(0,E.jsx)(`p`,{className:`mt-0.5 truncate text-sm font-medium text-foreground`,children:e.name})]}),(0,E.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":k(`actions.cancel`),onClick:l,children:(0,E.jsx)(v,{className:`h-4 w-4`})})]}),(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(f,{htmlFor:`github-actions-ref`,children:k(`inputs.refLabel`)}),(0,E.jsx)(i,{id:`github-actions-ref`,type:`text`,value:n,onChange:e=>{r(e.target.value)},placeholder:k(`inputs.refPlaceholder`),"aria-label":k(`inputs.refAriaLabel`)})]}),t.isLoading&&(0,E.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,E.jsx)(w,{className:`h-3.5 w-3.5 animate-spin`}),(0,E.jsx)(`span`,{children:k(`inputs.loading`)})]}),t.error&&(0,E.jsx)(`p`,{className:`text-xs text-rose-200`,children:t.error}),!t.dispatchable&&!t.isLoading&&!t.error&&(0,E.jsx)(`p`,{className:`text-xs text-amber-200`,children:k(`inputs.notDispatchable`)}),t.inputs.map(e=>(0,E.jsx)(B,{input:e,value:a[e.name],onChange:t=>{o(e.name,t)}},e.name)),d.length>0&&(0,E.jsx)(`p`,{className:`text-xs text-rose-200`,children:k(`inputs.requiredValidationError`)}),(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,E.jsx)(u,{type:`button`,variant:`ghost`,onClick:l,disabled:s,children:k(`actions.cancel`)}),(0,E.jsxs)(u,{type:`button`,variant:`success`,onClick:c,disabled:!p,children:[s?(0,E.jsx)(w,{className:`h-4 w-4 animate-spin`}):(0,E.jsx)(m,{className:`h-4 w-4`}),(0,E.jsx)(`span`,{children:k(`actions.dispatch`)})]})]})]})},z=(e,t)=>t.type===`boolean`?typeof e==`boolean`:typeof e==`string`&&e.trim()!==``,B=({input:e,value:t,onChange:n})=>{let r=`github-actions-input-${e.name}`;return(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsxs)(f,{htmlFor:r,className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{children:e.name}),e.required&&(0,E.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-rose-200/80`,children:k(`inputs.requiredLabel`)})]}),e.description&&(0,E.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.description}),V(e,r,t,n)]})},V=(e,t,n,r)=>{if(e.type===`boolean`){let i=typeof n==`boolean`?n:e.default===!0;return(0,E.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,E.jsx)(b,{id:t,checked:i,onCheckedChange:e=>{r(e)}}),(0,E.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:k(i?`inputs.booleanYes`:`inputs.booleanNo`)})]})}if(e.type===`choice`){let i=e.options??[],a=typeof n==`string`?n:typeof e.default==`string`?e.default:``;return(0,E.jsxs)(`select`,{id:t,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,value:a,onChange:e=>{r(e.target.value)},children:[a===``&&(0,E.jsx)(`option`,{value:``,children:k(`inputs.selectPlaceholder`)}),i.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]})}return(0,E.jsx)(i,{id:t,type:`text`,value:typeof n==`string`?n:typeof e.default==`string`?e.default:``,onChange:e=>{r(e.target.value)}})},H=({job:e})=>e.steps.length===0?null:(0,E.jsx)(`div`,{className:`mt-2 ml-4 space-y-1 border-l border-border/60 pl-4`,children:e.steps.map(t=>(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(x,{variant:`outline`,className:a(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,N(t)),children:t.status===`completed`?j(t.conclusion)??k(`status.completed`):A(t.status)}),(0,E.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:t.name})]},`${e.id}-${t.number}`))}),U=({run:e})=>{let t=P(e),n=F(e);return(0,E.jsxs)(`div`,{className:`rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`#${e.id}`}),(0,E.jsx)(x,{variant:`outline`,className:a(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,M(e)),children:n})]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[t&&(0,E.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t}),e.html_url&&(0,E.jsxs)(`a`,{href:e.html_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-sky-200 hover:text-sky-100`,children:[k(`actions.openOnGithub`),(0,E.jsx)(S,{className:`h-3 w-3`})]})]})]}),e.head_branch&&(0,E.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.head_branch}),e.jobs.map(e=>(0,E.jsxs)(`div`,{className:`mt-2`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(x,{variant:`outline`,className:a(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,M(e)),children:e.status===`completed`?j(e.conclusion)??k(`status.completed`):A(e.status)}),(0,E.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.name})]}),(0,E.jsx)(H,{job:e})]},e.id))]})},W=({tracked:e})=>{let t=e.state===`not_visible`?k(`runs.notVisible`):k(`runs.resolving`);return(0,E.jsxs)(`div`,{className:`flex items-center gap-2 rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,E.jsx)(w,{className:`h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,E.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})},G=e=>({ref:e??`main`}),K=({projectId:e,defaultBranch:i,onClose:a})=>{let[f,p]=(0,T.useState)([]),[m,h]=(0,T.useState)(!0),[y,b]=(0,T.useState)(null),[x,A]=(0,T.useState)([]),[j,M]=(0,T.useState)([]),[N,P]=(0,T.useState)({}),[F,z]=(0,T.useState)(null),[B,V]=(0,T.useState)(!1),[H]=(0,T.useState)(()=>G(i)),K=(0,T.useRef)({}),q=(0,T.useRef)({}),J=(0,T.useRef)(null),Y=(0,T.useRef)(!1),X=(0,T.useCallback)(async t=>{P(e=>{let n=e[t.id];return n?.isLoading?e:{...e,[t.id]:{inputs:n?.inputs??[],dispatchable:n?.dispatchable??!0,isLoading:!0,error:null}}});try{let n=await d(e,t.id,t.path);return P(e=>({...e,[t.id]:{inputs:n.inputs,dispatchable:n.dispatchable,isLoading:!1,error:null}})),n}catch(e){return P(n=>({...n,[t.id]:{inputs:[],dispatchable:!0,isLoading:!1,error:e instanceof o?e.message:k(`workflows.loadError`)}})),null}},[e]),Z=(0,T.useCallback)(async()=>{h(!0),b(null);try{let t=await n(e);p(t.workflows),Promise.allSettled(t.workflows.map(e=>X(e)))}catch(e){b(e instanceof o?e.message:k(`workflows.loadError`))}finally{h(!1)}},[X,e]),Q=(0,T.useCallback)(async t=>{if(!Y.current){Y.current=!0;try{A((await re(e,t)).runs)}catch(e){ee(e)||console.warn(`[github-actions] unable to load runs`,e)}finally{Y.current=!1}}},[e]);(0,T.useEffect)(()=>{Z()},[Z]),(0,T.useEffect)(()=>{let e=new AbortController,t=()=>{document.visibilityState===`visible`&&Q(e.signal)};t();let n=window.setInterval(t,O),r=_(t);return()=>{e.abort(),window.clearInterval(n),r()}},[Q]);let ie=(0,T.useCallback)(async e=>{if(F?.workflow.id===e.id)return;J.current=e.id,z({workflow:e,ref:H.ref,values:{}});let t=N[e.id];if(t&&!t.isLoading&&!t.error){z(n=>!n||n.workflow.id!==e.id?n:{...n,values:I(t.inputs)});return}let n=await X(e);n&&z(t=>!t||t.workflow.id!==e.id?t:{...t,values:I(n.inputs)})},[H.ref,N,X,F]),ae=(0,T.useCallback)(async()=>{if(!F)return;let t=N[F.workflow.id];if(!t||!t.dispatchable)return;V(!0);let n={};for(let e of t.inputs){let t=F.values[e.name];e.type===`boolean`?n[e.name]=typeof t==`boolean`?t:e.default===!0:typeof t==`string`&&t!==``?n[e.name]=t:typeof e.default==`string`&&e.default!==``&&(n[e.name]=e.default)}try{await s(e,F.workflow.id,{ref:F.ref,inputs:n}),C.success(k(`messages.dispatched`)),z(null),Q()}catch(e){C.error(e instanceof o?e.message:k(`messages.dispatchError`))}finally{V(!1)}},[N,Q,e,F]);(0,T.useEffect)(()=>{let t=t=>{!t||t.project_id!==e||(M(e=>{let n=e.filter(e=>e.tracking_key!==t.tracking_key);return t.run?n:[...n,t]}),t.run&&A(e=>{let n=e.findIndex(e=>e.id===t.run.id);if(n===-1)return[t.run,...e];let r=[...e];return r[n]=t.run,r}))};return g.on(`github-actions:updated`,t),()=>{g.off(`github-actions:updated`,t)}},[e]),(0,T.useEffect)(()=>{let e=F?.workflow.id;!e||J.current!==e||(K.current[e]?.scrollIntoView({block:`nearest`}),q.current[e]?.scrollIntoView({block:`nearest`}),J.current=null)},[F?.workflow.id]);let $=(0,T.useMemo)(()=>[...x].sort((e,t)=>{let n=e.updated_at?Date.parse(e.updated_at):0;return(t.updated_at?Date.parse(t.updated_at):0)-n}),[x]);return(0,E.jsx)(r,{open:!0,onOpenChange:e=>{e||a()},children:(0,E.jsxs)(te,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-5xl`,onInteractOutside:e=>e.preventDefault(),children:[(0,E.jsx)(c,{className:`sr-only`,children:k(`dialog.srTitle`)}),(0,E.jsx)(t,{className:`sr-only`,children:k(`dialog.srDescription`)}),(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,E.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-violet-200`,children:(0,E.jsx)(ne,{className:`h-5 w-5`})}),(0,E.jsx)(`div`,{children:(0,E.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:k(`dialog.title`)})})]}),(0,E.jsx)(l,{asChild:!0,children:(0,E.jsx)(u,{type:`button`,"aria-label":k(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,E.jsx)(v,{className:`h-4 w-4`})})})]}),(0,E.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,E.jsxs)(`aside`,{"aria-label":k(`workflows.ariaLabel`),className:`flex min-h-0 flex-col gap-3 overflow-y-auto border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`workflows.title`)}),(0,E.jsx)(u,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>{Z(),Q()},children:k(`actions.refresh`)})]}),m&&(0,E.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-xs text-muted-foreground`,children:[(0,E.jsx)(w,{className:`h-3.5 w-3.5 animate-spin`}),(0,E.jsx)(`span`,{children:k(`workflows.loading`)})]}),y&&(0,E.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:y}),!m&&f.length===0&&!y&&(0,E.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:[(0,E.jsx)(`p`,{children:k(`workflows.empty`)}),(0,E.jsx)(`p`,{className:`mt-1`,children:k(`workflows.emptyHint`)}),(0,E.jsxs)(`a`,{href:D,target:`_blank`,rel:`noreferrer`,className:`mt-2 inline-flex items-center gap-1 text-xs text-sky-200 hover:text-sky-100`,children:[k(`workflows.docsLink`),(0,E.jsx)(S,{className:`h-3 w-3`})]})]}),(0,E.jsx)(`div`,{className:`space-y-2`,children:f.map(e=>{let t=F?.workflow.id===e.id;return(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsx)(`div`,{ref:t=>{K.current[e.id]=t},children:(0,E.jsx)(L,{workflow:e,inputsState:N[e.id]??null,isSelected:t,onSelect:()=>{ie(e)}})}),t&&F&&(0,E.jsx)(`div`,{ref:t=>{q.current[e.id]=t},children:(0,E.jsx)(R,{workflow:e,inputsState:N[e.id]??{inputs:[],dispatchable:!0,isLoading:!1,error:null},refValue:F.ref,onRefChange:e=>{z(t=>t&&{...t,ref:e})},values:F.values,onValueChange:(e,t)=>{z(n=>n&&{...n,values:{...n.values,[e]:t}})},isDispatching:B,onDispatch:()=>{ae()},onCancel:()=>{z(null)}})})]},e.id)})})]}),(0,E.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-3 overflow-y-auto px-4 py-4`,children:[(0,E.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:k(`runs.title`)}),j.map(e=>(0,E.jsx)(W,{tracked:e},e.tracking_key)),$.map(e=>(0,E.jsx)(U,{run:e},e.id)),$.length===0&&j.length===0&&(0,E.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:k(`runs.empty`)})]})]})]})})};export{K as GitHubActionsDialog};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./chunk-BNv3lrIs.js";import{A as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,K as l,M as u,N as d,O as ee,P as f,S as p,U as m,V as h,_ as g,a as _,b as te,c as v,d as y,g as b,h as ne,i as x,j as S,k as C,l as re,m as w,o as T,q as E,s as D,w as O,x as k,y as ie}from"./index-DXuxAAzf.js";var A=e(E(),1),ae=(e,t)=>l(m(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),oe=(e,t)=>l(m(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),se=(e,t={})=>l(m(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),ce=(e,t)=>l(m(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),le=e=>l(m(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),ue=e=>o(m(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),j=h(),M=256*1024,N=24,P=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),F=(e,t)=>v.t(`common:testsDialog.${e}`,t),de=(e,t)=>{let n=`${e}${t}`;return n.length<=M?n:n.slice(-M)},I=e=>e.replace(P,``),fe=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=N,L=e=>{e.scrollTop=e.scrollHeight},pe=(e,t=!1)=>{L(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{L(e),t&&(r=window.requestAnimationFrame(()=>{L(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},me=e=>{if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;if(typeof t.id!=`string`||typeof t.name!=`string`||typeof t.command!=`string`)return[];let n=t.runner===`vitest`||t.runner===`jest`||t.runner===`unknown`?t.runner:`auto`;return[{id:t.id,name:t.name,command:t.command,runner:n,...typeof t.cwd==`string`&&t.cwd.trim()!==``?{cwd:t.cwd}:{}}]}):[]}catch{return[]}},R=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,he=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`},z=e=>{let t=e.split(`/`);return t[t.length-1]||e},B=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),V=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),H=(e,t)=>{let n=B(t);return n.length===0?e:e.flatMap(e=>{let t=z(e.path);if(V(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>V(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},U=e=>F(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ge=e=>e?.selection?e.selection.kind===`all`?F(`selection.allTests`):e.selection.kind===`case`?e.selection.name:z(e.selection.path):F(`selection.noRunYet`),W=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,G=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,_e=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,ve=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,K=({line:e,tone:t})=>(0,j.jsx)(`div`,{"data-tone":t,className:a(`whitespace-pre-wrap break-words`,G(t)),children:e===``?` `:e}),q=(0,A.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,j.jsxs)(`button`,{type:`button`,"aria-label":F(`caseRow.runAriaLabel`,{name:r}),title:r,className:a(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,n&&`bg-sky-500/10`),disabled:!e,onClick:()=>{i(t,r)},children:[(0,j.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,j.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));q.displayName=`TestCaseRow`;var J=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:o,onRunCase:s,onRunFile:c,onToggleFile:l})=>{let u=e===`file`&&n===i.path,d=e===`case`&&n===i.path;return(0,j.jsx)(x,{open:o,onOpenChange:e=>{l(i.path,e)},children:(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(T,{asChild:!0,children:(0,j.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":F(o?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:i.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(O,{className:a(`h-4 w-4 transition-transform`,o&&`rotate-180`)})})}),(0,j.jsx)(`button`,{type:`button`,"aria-label":F(`fileRow.runAriaLabel`,{path:i.path}),className:a(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(u||d)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{c(i.path)},children:(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,j.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,j.jsx)(p,{className:`h-3.5 w-3.5`})}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:z(i.path)}),(0,j.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,j.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:F(`fileRow.testCount`,{count:i.cases.length})})]})]})})]}),(0,j.jsx)(_,{children:(0,j.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,j.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:F(`fileRow.noNamedTests`)}):(0,j.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let o=e===`case`&&n===i.path&&t===a.name;return(0,j.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:o,name:a.name,onRunCase:s},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var ye=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:o,discovery:s,expandedFiles:c,fullSuiteOnlyNotice:l,isLoading:u,selectedCommandId:d,selectedCommandName:ee,sessionError:p,sessionStatus:m,shouldShowCommandSelector:h,onRunCase:_,onRunFile:te,onSelectCommand:v,onToggleFile:y})=>{let[x,S]=(0,A.useState)(``),C=(0,A.useMemo)(()=>H(s,x),[s,x]),T=(0,A.useMemo)(()=>C.reduce((e,t)=>e+t.cases.length,0),[C]),E=B(x).length>0;return(0,j.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,j.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[h&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:F(`scope.label`)}),(0,j.jsxs)(w,{children:[(0,j.jsx)(g,{asChild:!0,children:(0,j.jsxs)(f,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":F(`scope.selectedCommandAriaLabel`),disabled:r.length===0||m===`running`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:ee??F(`scope.selectTestScope`)}),(0,j.jsx)(O,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,j.jsx)(ne,{align:`start`,className:`w-72`,children:r.map(e=>(0,j.jsx)(b,{className:a(d===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{v(e.id)},children:(0,j.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),l&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:l}),(s.length>0||x.length>0)&&(0,j.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,j.jsx)(i,{type:`search`,value:x,onChange:e=>{S(e.target.value)},placeholder:F(`filter.placeholder`),"aria-label":F(`filter.ariaLabel`),className:`pr-10`}),x.length>0&&(0,j.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":F(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{S(``)},children:(0,j.jsx)(re,{className:`size-4`})})]}),!r.length&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:F(`discovery.noCommands`)}),p&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:p}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,j.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[F(`discovery.fileCount`,{count:C.length}),`, `,F(`discovery.caseCount`,{count:T})]})}),u&&(0,j.jsx)(k,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:s.length===0&&!u?(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:F(`discovery.noFilesDetected`)}):C.length===0?(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:F(`discovery.noFilterMatches`)}):C.map(r=>(0,j.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:o,file:r,isExpanded:E||(c[r.path]??!1),onRunCase:_,onRunFile:te,onToggleFile:y},r.path))})]})]})})});ye.displayName=`DiscoveryPane`;var be=(0,A.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:o,viewportRef:s,onScroll:c})=>{let l=(0,A.useMemo)(()=>t?I(t).replace(/\r\n/g,`
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{A as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,K as l,M as u,N as d,O as ee,P as f,S as p,U as m,V as h,_ as g,a as _,b as te,c as v,d as y,g as b,h as ne,i as x,j as S,k as C,l as re,m as w,o as T,q as E,s as D,w as O,x as k,y as ie}from"./index-BHq6-Eir.js";var A=e(E(),1),ae=(e,t)=>l(m(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),oe=(e,t)=>l(m(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),se=(e,t={})=>l(m(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),ce=(e,t)=>l(m(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),le=e=>l(m(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),ue=e=>o(m(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),j=h(),M=256*1024,N=24,P=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),F=(e,t)=>v.t(`common:testsDialog.${e}`,t),de=(e,t)=>{let n=`${e}${t}`;return n.length<=M?n:n.slice(-M)},I=e=>e.replace(P,``),fe=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=N,L=e=>{e.scrollTop=e.scrollHeight},pe=(e,t=!1)=>{L(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{L(e),t&&(r=window.requestAnimationFrame(()=>{L(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},me=e=>{if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;if(typeof t.id!=`string`||typeof t.name!=`string`||typeof t.command!=`string`)return[];let n=t.runner===`vitest`||t.runner===`jest`||t.runner===`unknown`?t.runner:`auto`;return[{id:t.id,name:t.name,command:t.command,runner:n,...typeof t.cwd==`string`&&t.cwd.trim()!==``?{cwd:t.cwd}:{}}]}):[]}catch{return[]}},R=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,he=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`},z=e=>{let t=e.split(`/`);return t[t.length-1]||e},B=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),V=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),H=(e,t)=>{let n=B(t);return n.length===0?e:e.flatMap(e=>{let t=z(e.path);if(V(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>V(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},U=e=>F(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ge=e=>e?.selection?e.selection.kind===`all`?F(`selection.allTests`):e.selection.kind===`case`?e.selection.name:z(e.selection.path):F(`selection.noRunYet`),W=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,G=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,_e=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,ve=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,K=({line:e,tone:t})=>(0,j.jsx)(`div`,{"data-tone":t,className:a(`whitespace-pre-wrap break-words`,G(t)),children:e===``?` `:e}),q=(0,A.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,j.jsxs)(`button`,{type:`button`,"aria-label":F(`caseRow.runAriaLabel`,{name:r}),title:r,className:a(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,n&&`bg-sky-500/10`),disabled:!e,onClick:()=>{i(t,r)},children:[(0,j.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,j.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));q.displayName=`TestCaseRow`;var J=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:o,onRunCase:s,onRunFile:c,onToggleFile:l})=>{let u=e===`file`&&n===i.path,d=e===`case`&&n===i.path;return(0,j.jsx)(x,{open:o,onOpenChange:e=>{l(i.path,e)},children:(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(T,{asChild:!0,children:(0,j.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":F(o?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:i.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(O,{className:a(`h-4 w-4 transition-transform`,o&&`rotate-180`)})})}),(0,j.jsx)(`button`,{type:`button`,"aria-label":F(`fileRow.runAriaLabel`,{path:i.path}),className:a(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(u||d)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{c(i.path)},children:(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,j.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,j.jsx)(p,{className:`h-3.5 w-3.5`})}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:z(i.path)}),(0,j.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,j.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:F(`fileRow.testCount`,{count:i.cases.length})})]})]})})]}),(0,j.jsx)(_,{children:(0,j.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,j.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:F(`fileRow.noNamedTests`)}):(0,j.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let o=e===`case`&&n===i.path&&t===a.name;return(0,j.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:o,name:a.name,onRunCase:s},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var ye=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:o,discovery:s,expandedFiles:c,fullSuiteOnlyNotice:l,isLoading:u,selectedCommandId:d,selectedCommandName:ee,sessionError:p,sessionStatus:m,shouldShowCommandSelector:h,onRunCase:_,onRunFile:te,onSelectCommand:v,onToggleFile:y})=>{let[x,S]=(0,A.useState)(``),C=(0,A.useMemo)(()=>H(s,x),[s,x]),T=(0,A.useMemo)(()=>C.reduce((e,t)=>e+t.cases.length,0),[C]),E=B(x).length>0;return(0,j.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,j.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[h&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:F(`scope.label`)}),(0,j.jsxs)(w,{children:[(0,j.jsx)(g,{asChild:!0,children:(0,j.jsxs)(f,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":F(`scope.selectedCommandAriaLabel`),disabled:r.length===0||m===`running`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:ee??F(`scope.selectTestScope`)}),(0,j.jsx)(O,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,j.jsx)(ne,{align:`start`,className:`w-72`,children:r.map(e=>(0,j.jsx)(b,{className:a(d===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{v(e.id)},children:(0,j.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),l&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:l}),(s.length>0||x.length>0)&&(0,j.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,j.jsx)(i,{type:`search`,value:x,onChange:e=>{S(e.target.value)},placeholder:F(`filter.placeholder`),"aria-label":F(`filter.ariaLabel`),className:`pr-10`}),x.length>0&&(0,j.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":F(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{S(``)},children:(0,j.jsx)(re,{className:`size-4`})})]}),!r.length&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:F(`discovery.noCommands`)}),p&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:p}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,j.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[F(`discovery.fileCount`,{count:C.length}),`, `,F(`discovery.caseCount`,{count:T})]})}),u&&(0,j.jsx)(k,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:s.length===0&&!u?(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:F(`discovery.noFilesDetected`)}):C.length===0?(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:F(`discovery.noFilterMatches`)}):C.map(r=>(0,j.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:o,file:r,isExpanded:E||(c[r.path]??!1),onRunCase:_,onRunFile:te,onToggleFile:y},r.path))})]})]})})});ye.displayName=`DiscoveryPane`;var be=(0,A.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:o,viewportRef:s,onScroll:c})=>{let l=(0,A.useMemo)(()=>t?I(t).replace(/\r\n/g,`
2
2
  `).replace(/\r/g,`
3
3
  `).split(`
4
4
  `).map(e=>({line:e,tone:W(e)})):[],[t]);return(0,j.jsx)(`section`,{className:`min-h-0 px-4 py-4`,children:(0,j.jsxs)(`div`,{className:`flex h-full flex-col gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,j.jsx)(`span`,{className:`font-medium text-foreground`,children:r}),i&&(0,j.jsx)(D,{variant:`outline`,className:a(`px-3 py-1 text-xs uppercase tracking-[0.2em]`,R(i)),children:U(i)}),o&&(0,j.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-xs font-medium uppercase tracking-[0.18em]`,children:[(0,j.jsxs)(`span`,{className:`text-rose-200`,children:[o.failed.count,` `,o.failed.label]}),(0,j.jsxs)(`span`,{className:`text-emerald-200`,children:[o.passed.count,` `,o.passed.label]})]}),e!=null&&(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:he(e)}),n&&(0,j.jsx)(D,{variant:`outline`,className:`border-amber-400/30 bg-amber-500/10 text-amber-200`,children:F(`output.trimmed`)})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-2xl border border-border/70 bg-[#0d1017]`,children:(0,j.jsx)(`div`,{ref:s,"aria-label":F(`output.ariaLabel`),className:`h-full overflow-auto px-4 py-4`,onScroll:c,children:(0,j.jsx)(`div`,{className:`font-mono text-xs leading-5`,children:l.length>0?l.map((e,t)=>(0,j.jsx)(K,{line:e.line,tone:e.tone},`${t}:${e.line}`)):(0,j.jsx)(`div`,{className:`text-slate-200`,children:F(`output.empty`)})})})})]})})});be.displayName=`OutputPane`;var xe=({testCommands:e,onClose:i,...a})=>{let o=a.scope,l=a.projectId,p=a.scope===`ticket`?a.ticketId:null,m=a.scope===`project`?a.targetKind:null,h=a.scope===`project`?a.targetBundleId:null,[g,_]=(0,A.useState)(e),[v,b]=(0,A.useState)(null),[ne,x]=(0,A.useState)([]),[w,T]=(0,A.useState)(``),[E,D]=(0,A.useState)({}),[O,k]=(0,A.useState)(!0),[M,N]=(0,A.useState)(!1),[P,I]=(0,A.useState)(!1),[L,R]=(0,A.useState)(null),[he,z]=(0,A.useState)(!1),[B,V]=(0,A.useState)(!1),H=(0,A.useRef)(null),U=(0,A.useRef)(!1),W=(0,A.useRef)(null),G=(0,A.useRef)(!0),K=(0,A.useRef)(null),q=(0,A.useRef)(null),J=v?.selection?.kind??null,xe=v?.selection?.kind===`all`?null:v?.selection?.path??null,Se=v?.selection?.kind===`case`?v.selection.name:null,Y=v?.id??null,X=v?.status??null,Z=(0,A.useMemo)(()=>g.find(e=>e.id===w)??null,[g,w]),Ce=(0,A.useMemo)(()=>{if(v?.summary?.failed_count==null&&v?.summary?.passed_count==null&&v?.summary?.failed_file_count==null&&v?.summary?.passed_file_count==null)return null;let e=v?.summary?.failed_count==null&&v?.summary?.passed_count==null;return{failed:X===`failed`&&v?.summary?.failed_count==null&&v?.summary?.failed_file_count!=null||e?{count:v?.summary?.failed_file_count??0,label:F(`summaryCounts.filesFailed`)}:{count:v?.summary?.failed_count??0,label:F(`summaryCounts.failed`)},passed:e?{count:v?.summary?.passed_file_count??0,label:F(`summaryCounts.filesPassed`)}:{count:v?.summary?.passed_count??v?.summary?.passed_file_count??0,label:F(`summaryCounts.passed`)}}},[v?.summary?.failed_count,v?.summary?.passed_count,v?.summary?.failed_file_count,v?.summary?.passed_file_count,X]),we=Z?.runner===`unknown`?F(`scope.fullSuiteOnlyNotice`):null,Te=!!(Z&&v?.status!==`running`&&!M&&!P),Ee=Te,De=Te&&B,Oe=g.length>1;(0,A.useEffect)(()=>{w||g.length===0||T(g[0]?.id??``)},[g,w]),(0,A.useEffect)(()=>{e.length>0&&_(t=>_e(t,e)?t:e)},[e]),(0,A.useEffect)(()=>{if(g.length>0||!l)return;let e=new AbortController;return c(e.signal).then(e=>{let t=e.find(e=>e.id===l);t&&_(e=>{let n=me(t.test_commands??null);return _e(e,n)?e:n})}).catch(()=>{}),()=>{e.abort()}},[g.length,l]),(0,A.useEffect)(()=>{let e=e=>{!e||e.id!==H.current||b(e)},t=e=>{!e||e.session_id!==H.current||b(t=>!t||t.id!==e.session_id?t:{...t,output:de(t.output,e.chunk),output_truncated:e.output_truncated})};return y.on(`test-session:updated`,e),y.on(`test-session:output`,t),()=>{y.off(`test-session:updated`,e),y.off(`test-session:output`,t)}},[]),(0,A.useEffect)(()=>{let e=W.current;if(!e){K.current=v?.output??null,q.current=v?.status??null;return}let t=K.current!==(v?.output??null),n=q.current!==`running`&&v?.status===`running`,r=q.current===`running`&&v?.status!==`running`;if(n&&(G.current=!0),n||t&&v?.status===`running`&&G.current||r&&G.current){let t=pe(e,r);return K.current=v?.output??null,q.current=v?.status??null,t}K.current=v?.output??null,q.current=v?.status??null},[v?.output,v?.status]),(0,A.useEffect)(()=>{let e=!1;return(async()=>{try{let t;if(o===`project`){if(!l)return;t=await ae(l,{target_kind:m??`repo_root`,target_bundle_id:h??null})}else t=await oe(p??``,l);if(e)return;H.current=t.id,b(t)}catch(t){e||R(t instanceof s?t.message:F(`messages.loadRunnerError`))}finally{!e&&H.current==null&&k(!1)}})(),()=>{e=!0}},[l,o,h,m,p]),(0,A.useEffect)(()=>{if(!v?.id){V(!1);return}if(g.length>0&&!w){V(!1);return}let e=new AbortController,t=!1;return k(!0),V(!1),se(v.id,{commandId:w||null,signal:e.signal}).then(e=>{t||(x(e.files),V(e.supports_granular_selection))}).catch(n=>{t||e.signal.aborted||R(n instanceof s?n.message:F(`messages.discoverError`))}).finally(()=>{t||k(!1)}),()=>{t=!0,e.abort()}},[g.length,w,v?.id]),(0,A.useEffect)(()=>()=>{let e=H.current;!e||U.current||(U.current=!0,ue(e).catch(()=>{}))},[]);let Q=(0,A.useCallback)(async e=>{if(!(!Y||X===`running`||!Z||M||P)){R(null),N(!0);try{b(await ce(Y,{command_id:Z.id,selection:e}))}catch(e){R(e instanceof s?e.message:F(`messages.startError`))}finally{N(!1)}}},[M,P,Z,Y,X]),ke=(0,A.useCallback)(async()=>{if(!(!Y||X!==`running`||P)){R(null),I(!0);try{b(await le(Y))}catch(e){R(e instanceof s?e.message:F(`messages.stopError`))}finally{I(!1)}}},[P,Y,X]),$=(0,A.useCallback)(()=>{let e=H.current;if(!e||U.current){i();return}U.current=!0,i(),ue(e).catch(()=>{})},[i]),Ae=(0,A.useCallback)(()=>{if(X===`running`){z(!0);return}$()},[$,X]),je=(0,A.useCallback)(()=>{let e=W.current;e&&(G.current=fe(e))},[]),Me=(0,A.useCallback)(e=>{T(e)},[]),Ne=(0,A.useCallback)((e,t)=>{D(n=>(n[e]??!1)===t?n:{...n,[e]:t})},[]),Pe=(0,A.useCallback)(e=>{Q({kind:`file`,path:e})},[Q]),Fe=(0,A.useCallback)((e,t)=>{Q({kind:`case`,path:e,name:t})},[Q]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(r,{open:!0,onOpenChange:e=>{e||Ae()},children:(0,j.jsxs)(C,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-7xl`,onInteractOutside:e=>e.preventDefault(),children:[(0,j.jsx)(d,{className:`sr-only`,children:F(`dialog.srTitle`)}),(0,j.jsx)(t,{className:`sr-only`,children:F(`dialog.srDescription`)}),(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-sky-200`,children:(0,j.jsx)(n,{className:`h-5 w-5`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:F(`dialog.title`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:v?.target_label??F(`dialog.preparingTarget`)})]})]})}),(0,j.jsx)(ee,{asChild:!0,children:(0,j.jsx)(f,{type:`button`,"aria-label":F(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(re,{className:`h-4 w-4`})})})]}),(0,j.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,j.jsx)(ye,{activeSelectionKind:J,activeSelectionName:Se,activeSelectionPath:xe,availableCommands:g,canRunGranular:De,discovery:ne,expandedFiles:E,fullSuiteOnlyNotice:we,isLoading:O,selectedCommandId:w,selectedCommandName:Z?.name??null,sessionError:L,sessionStatus:X,shouldShowCommandSelector:Oe,onRunCase:Fe,onRunFile:Pe,onSelectCommand:Me,onToggleFile:Ne}),(0,j.jsx)(be,{durationMs:v?.duration_ms??null,output:v?.output??``,outputTruncated:v?.output_truncated??!1,selectionLabel:ge(v),status:X,summaryCounts:Ce,viewportRef:W,onScroll:je})]}),(0,j.jsx)(S,{className:`border-t border-border/70 px-6 py-4 sm:flex-row sm:items-center sm:justify-end`,children:(0,j.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:v?.status===`running`?(0,j.jsxs)(f,{type:`button`,variant:`destructive`,className:ve,onClick:()=>{ke()},disabled:P,children:[(0,j.jsx)(ie,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{children:F(`actions.stop`)})]}):(0,j.jsxs)(f,{type:`button`,variant:`success`,className:ve,disabled:!Ee,onClick:()=>{Q({kind:`all`})},children:[(0,j.jsx)(te,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{children:F(`actions.run`)})]})})})]})}),(0,j.jsx)(r,{open:he,onOpenChange:z,children:(0,j.jsxs)(C,{showCloseButton:!1,overlayClassName:`z-[60] bg-black/60`,className:`z-[60] max-w-md rounded-2xl border border-border bg-card p-6 shadow-2xl`,children:[(0,j.jsxs)(u,{children:[(0,j.jsx)(d,{className:`text-sm font-semibold uppercase tracking-widest text-muted-foreground`,children:F(`closeConfirmation.title`)}),(0,j.jsx)(t,{className:`text-sm text-foreground whitespace-pre-line`,children:F(`closeConfirmation.description`)})]}),(0,j.jsxs)(S,{className:`sm:flex-row sm:justify-end`,children:[(0,j.jsx)(f,{type:`button`,variant:`ghost`,onClick:()=>z(!1),children:F(`closeConfirmation.keepRunning`)}),(0,j.jsx)(f,{type:`button`,variant:`destructive`,onClick:()=>{z(!1),$()},children:F(`closeConfirmation.stopAndClose`)})]})]})})]})};export{xe as TestsDialog};
@@ -1 +1 @@
1
- import{V as e,t}from"./index-DXuxAAzf.js";var n=e(),r=e=>{let r=e.scope===`project_root`?{scope:`project_root`}:{scope:`ticket`,ticketId:e.ticketId,onTicketUpdate:e.onTicketUpdate,onRequestTicketRefresh:e.onRequestTicketRefresh};return(0,n.jsx)(t,{...e,target:r,initialMode:`changes`,enabledModes:[`changes`]})};export{r as TicketChangesModal};
1
+ import{V as e,t}from"./index-BHq6-Eir.js";var n=e(),r=e=>{let r=e.scope===`project_root`?{scope:`project_root`}:{scope:`ticket`,ticketId:e.ticketId,onTicketUpdate:e.onTicketUpdate,onRequestTicketRefresh:e.onRequestTicketRefresh};return(0,n.jsx)(t,{...e,target:r,initialMode:`changes`,enabledModes:[`changes`]})};export{r as TicketChangesModal};