@pat-lewczuk/cezar 0.1.4 → 0.1.5

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 (85) hide show
  1. package/README.md +124 -37
  2. package/dist/config.d.ts +46 -0
  3. package/dist/config.js +31 -0
  4. package/dist/config.js.map +1 -1
  5. package/dist/core/agent-runner.d.ts +16 -0
  6. package/dist/core/agent-runner.js +9 -0
  7. package/dist/core/agent-runner.js.map +1 -1
  8. package/dist/core/claude-cli-runner.d.ts +6 -0
  9. package/dist/core/claude-cli-runner.js +27 -43
  10. package/dist/core/claude-cli-runner.js.map +1 -1
  11. package/dist/core/codex-app-server-runner.js +42 -5
  12. package/dist/core/codex-app-server-runner.js.map +1 -1
  13. package/dist/core/opencode-server-runner.js +42 -5
  14. package/dist/core/opencode-server-runner.js.map +1 -1
  15. package/dist/git-worktree.d.ts +21 -0
  16. package/dist/git-worktree.js +48 -4
  17. package/dist/git-worktree.js.map +1 -1
  18. package/dist/handoff.d.ts +1 -1
  19. package/dist/handoff.js +2 -0
  20. package/dist/handoff.js.map +1 -1
  21. package/dist/index.js +34 -4
  22. package/dist/index.js.map +1 -1
  23. package/dist/runs/store.d.ts +82 -1
  24. package/dist/runs/store.js +57 -5
  25. package/dist/runs/store.js.map +1 -1
  26. package/dist/server/git.js +12 -1
  27. package/dist/server/git.js.map +1 -1
  28. package/dist/server/github.d.ts +8 -29
  29. package/dist/server/github.js +7 -139
  30. package/dist/server/github.js.map +1 -1
  31. package/dist/server/pr.d.ts +5 -20
  32. package/dist/server/pr.js +4 -95
  33. package/dist/server/pr.js.map +1 -1
  34. package/dist/server/server.d.ts +30 -1
  35. package/dist/server/server.js +448 -19
  36. package/dist/server/server.js.map +1 -1
  37. package/dist/workflows/run.d.ts +90 -0
  38. package/dist/workflows/run.js +412 -29
  39. package/dist/workflows/run.js.map +1 -1
  40. package/dist/workflows/types.d.ts +16 -16
  41. package/package.json +44 -6
  42. package/scripts/check-pack.mjs +46 -0
  43. package/scripts/dev.mjs +74 -0
  44. package/scripts/mock-claude.mjs +54 -2
  45. package/scripts/test-process-usage.mjs +47 -0
  46. package/web/dist/assets/{toaster-BS2E1bhz.js → centered-state-zgEVNWsj.js} +1 -1
  47. package/web/dist/assets/compare-variants-ChHCcSQX.js +1 -0
  48. package/web/dist/assets/dialog-DDRjj-uK.js +1 -0
  49. package/web/dist/assets/{diff-view-CctnJHWe.js → diff-view-CWRO0GMe.js} +1 -1
  50. package/web/dist/assets/dist-id2CeyV-.js +1 -0
  51. package/web/dist/assets/git-toolbar-C4jo602L.js +1 -0
  52. package/web/dist/assets/github-BOIzQFwE.js +1 -0
  53. package/web/dist/assets/index-Cv1pQs9U.js +11 -0
  54. package/web/dist/assets/repo-git-BuyJiqna.js +1 -0
  55. package/web/dist/assets/{run-diff-C7mfxj7f.js → run-diff-BocG6LVd.js} +1 -1
  56. package/web/dist/assets/run-header-CDKw22ek.js +1 -0
  57. package/web/dist/assets/skill-detail-CcFFKmGO.js +1 -0
  58. package/web/dist/assets/skills-Bc_4U3yq.js +1 -0
  59. package/web/dist/assets/tab-link-C77EP3i6.js +1 -0
  60. package/web/dist/assets/task-changes-DsDgN8-x.js +1 -0
  61. package/web/dist/assets/task-commits-Dve6Fozc.js +1 -0
  62. package/web/dist/assets/{task-files-FOAAz2FB.js → task-files-BDMc_z0B.js} +1 -1
  63. package/web/dist/assets/{task-thread-Bncxe8Os.js → task-thread-CmRuPj9H.js} +2 -2
  64. package/web/dist/assets/use-desktop-CyEWsxSU.js +3 -0
  65. package/web/dist/assets/{workflows-Dg2wQg6i.js → workflows-J3z3kYic.js} +1 -1
  66. package/web/dist/index.html +5 -5
  67. package/web/app/node_modules/.vite/vitest/ca84d1343b96baa8137c943ed1860e522cacb238/results.json +0 -1
  68. package/web/app/src/components/app-shell-container.tsx +0 -76
  69. package/web/app.js +0 -3428
  70. package/web/dist/assets/compare-variants-D6fPL9cS.js +0 -1
  71. package/web/dist/assets/dialog-BEgEWFDS.js +0 -1
  72. package/web/dist/assets/dist-CW7M_Jhs.js +0 -1
  73. package/web/dist/assets/git-toolbar-D8OPPqBP.js +0 -1
  74. package/web/dist/assets/github-BYIHwIJB.js +0 -1
  75. package/web/dist/assets/index-9qG98Orw.js +0 -11
  76. package/web/dist/assets/repo-git-XTqlVOl2.js +0 -1
  77. package/web/dist/assets/run-header-CfVeY3uM.js +0 -1
  78. package/web/dist/assets/skill-detail-C9cniyId.js +0 -1
  79. package/web/dist/assets/skills-DXgY1uXJ.js +0 -1
  80. package/web/dist/assets/tab-link-phWEqSBy.js +0 -1
  81. package/web/dist/assets/task-changes-DYwnPnTN.js +0 -1
  82. package/web/dist/assets/task-commits-DZzxEzbn.js +0 -1
  83. package/web/dist/assets/use-desktop-eHm2iTXX.js +0 -3
  84. package/web/index.html +0 -108
  85. package/web/style.css +0 -1767
@@ -1 +0,0 @@
1
- import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{A as r,D as i,Dt as a,Ft as o,G as s,Lt as c,Pt as l,Z as u,_t as d,a as f,n as p,r as m,zt as h}from"./toaster-BS2E1bhz.js";import{t as g}from"./utils-rQGbOrwc.js";import{n as _}from"./loader-circle-BV3DO9mE.js";import{t as v}from"./search-x-CoCyl7zT.js";import{i as y,n as b,r as x,t as S}from"./run-diff-C7mfxj7f.js";import{t as C}from"./markdown-CR_HLGTs.js";import{B as w,F as T,O as E,Q as D,R as O,_ as k,b as A,g as j,h as M,i as N,m as P,n as F,ot as I,t as L,v as R,x as z,y as B}from"./index-9qG98Orw.js";var V=t(n(),1),H=e();function U(){let{groupId:e}=o(),t=r(e),n=h();if((0,V.useEffect)(()=>{e&&n.invalidateQueries({queryKey:i.groups.detail(e)})},[n,e,(s().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,H.jsx)(E,{});if(t.isError){let e=t.error instanceof u&&t.error.status===404;return(0,H.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,H.jsx)(m,{icon:e?(0,H.jsx)(v,{}):(0,H.jsx)(D,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,H.jsx)(f,{asChild:!0,variant:`outline`,children:(0,H.jsx)(a,{to:`/`,children:`Back to tasks`})})})})}return(0,H.jsx)(W,{groupId:e,variants:t.data.runs})}function W({groupId:e,variants:t}){let n=l(),r=h(),[a,o]=(0,V.useState)(null),s=t.every(e=>L.has(e.status)),u=t[0]?T(t[0]):``,f=c({mutationFn:t=>d(e,t),onSuccess:(t,a)=>{r.invalidateQueries({queryKey:i.runs.all}),r.invalidateQueries({queryKey:i.groups.detail(e)}),n(`/tasks/${t.winner?.id??a}`)},onError:e=>p(e.message,{tone:`danger`})});return(0,H.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,H.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,H.jsx)(D,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,title:u,children:u})]}),(0,H.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,H.jsx)(`div`,{"data-slot":`compare-columns`,className:g(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,H.jsx)(G,{variant:e,allTerminal:s,pickPending:f.isPending,onPick:()=>o(e)},e.id))}),(0,H.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,H.jsx)(K,{variant:e},e.id))}),(0,H.jsx)(P,{open:a!==null,onOpenChange:e=>!e&&o(null),children:(0,H.jsxs)(k,{children:[(0,H.jsxs)(A,{children:[(0,H.jsxs)(z,{children:[`Pick variant `,a?.variant,`?`]}),(0,H.jsxs)(R,{children:[`Variant `,a?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,H.jsxs)(B,{children:[(0,H.jsx)(j,{children:`Keep comparing`}),(0,H.jsxs)(M,{"data-slot":`confirm-pick`,onClick:()=>{a&&f.mutate(a.id),o(null)},children:[(0,H.jsx)(_,{"aria-hidden":`true`}),`Pick variant `,a?.variant]})]})]})})]})}function G({variant:e,allTerminal:t,pickPending:n,onPick:r}){let i=w(e),a=F(e.costUsd);return(0,H.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,H.jsx)(N,{dot:i.tone,pulse:i.pulse,children:i.label}),(0,H.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] text-soft-foreground tabular-nums`,children:[O(e.tokensUsed),a?` · ${a}`:``]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,H.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,H.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,H.jsx)(C,{children:e.handoffExcerpt})}):(0,H.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,H.jsxs)(f,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,H.jsx)(_,{"aria-hidden":`true`}),`Pick this one`]})]})}function K({variant:e}){let[t,n]=(0,V.useState)(!1);return(0,H.jsxs)(b,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,H.jsxs)(y,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,H.jsx)(I,{className:g(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,H.jsx)(x,{children:(0,H.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,H.jsx)(S,{runId:e.id})})})]})}export{U as CompareVariantsRoute};
@@ -1 +0,0 @@
1
- import{a as e,o as t}from"./bundle-mjs-DLPpRFyl.js";import{a as n}from"./toaster-BS2E1bhz.js";import{t as r}from"./utils-rQGbOrwc.js";import{t as i}from"./x-Br_jIDBw.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-CW7M_Jhs.js";t();var f=e();function p({...e}){return(0,f.jsx)(d,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(c,{"data-slot":`dialog-portal`,...e})}function h({...e}){return(0,f.jsx)(s,{"data-slot":`dialog-close`,...e})}function g({className:e,...t}){return(0,f.jsx)(a,{"data-slot":`dialog-overlay`,className:r(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function _({className:e,children:t,showCloseButton:n=!0,...a}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(g,{}),(0,f.jsxs)(l,{"data-slot":`dialog-content`,className:r(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...a,children:[t,n&&(0,f.jsxs)(s,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(i,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function v({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:r(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function y({className:e,showCloseButton:t=!1,children:i,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...a,children:[i,t&&(0,f.jsx)(s,{asChild:!0,children:(0,f.jsx)(n,{variant:`outline`,children:`Close`})})]})}function b({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:r(`text-lg leading-none font-semibold`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:r(`text-sm text-muted-foreground`,e),...t})}export{y as a,x as i,h as n,v as o,_ as r,b as s,p as t};
@@ -1 +0,0 @@
1
- import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{C as r,T as i,_ as a,b as o,c as s,d as c,f as l,g as u,h as d,l as f,p,s as m,u as h,x as g,y as _}from"./toaster-BS2E1bhz.js";var v=t(n(),1),y=e(),b=`Dialog`,[x,S]=o(b),[C,w]=x(b),T=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,c=v.useRef(null),l=v.useRef(null),[u,f]=a({prop:r,defaultProp:i??!1,onChange:o,caller:b});return(0,y.jsx)(C,{scope:t,triggerRef:c,contentRef:l,contentId:d(),titleId:d(),descriptionId:d(),open:u,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};T.displayName=b;var E=`DialogTrigger`,D=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=w(E,n),o=i(t,a.triggerRef);return(0,y.jsx)(g.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":q(a.open),...r,ref:o,onClick:_(e.onClick,a.onOpenToggle)})});D.displayName=E;var O=`DialogPortal`,[k,A]=x(O,{forceMount:void 0}),j=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=w(O,t);return(0,y.jsx)(k,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,y.jsx)(u,{present:n||a.open,children:(0,y.jsx)(h,{asChild:!0,container:i,children:e})}))})};j.displayName=O;var M=`DialogOverlay`,N=v.forwardRef((e,t)=>{let n=A(M,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(M,e.__scopeDialog);return a.modal?(0,y.jsx)(u,{present:r||a.open,children:(0,y.jsx)(F,{...i,ref:t})}):null});N.displayName=M;var P=r(`DialogOverlay.RemoveScroll`),F=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=w(M,n),o=i(t,p());return(0,y.jsx)(s,{as:P,allowPinchZoom:!0,shards:[a.contentRef],children:(0,y.jsx)(g.div,{"data-state":q(a.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})}),I=`DialogContent`,L=v.forwardRef((e,t)=>{let n=A(I,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(I,e.__scopeDialog);return(0,y.jsx)(u,{present:r||a.open,children:a.modal?(0,y.jsx)(R,{...i,ref:t}):(0,y.jsx)(z,{...i,ref:t})})});L.displayName=I;var R=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(null),a=i(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return m(e)},[]),(0,y.jsx)(B,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:_(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:_(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:_(e.onFocusOutside,e=>e.preventDefault())})}),z=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),B=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=w(I,n);return f(),(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(c,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(l,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":q(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),V=`DialogTitle`,H=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(V,n);return(0,y.jsx)(g.h2,{id:i.titleId,...r,ref:t})});H.displayName=V;var U=`DialogDescription`,W=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(U,n);return(0,y.jsx)(g.p,{id:i.descriptionId,...r,ref:t})});W.displayName=U;var G=`DialogClose`,K=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(G,n);return(0,y.jsx)(g.button,{type:`button`,...r,ref:t,onClick:_(e.onClick,()=>i.onOpenChange(!1))})});K.displayName=G;function q(e){return e?`open`:`closed`}export{N as a,D as c,W as i,S as l,K as n,j as o,L as r,H as s,T as t};
@@ -1 +0,0 @@
1
- import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{a as r}from"./toaster-BS2E1bhz.js";import{n as i,t as a}from"./utils-rQGbOrwc.js";import{t as o}from"./ellipsis-vertical-DJPAfccS.js";import{n as s}from"./tab-link-phWEqSBy.js";import{n as c,t as l}from"./folder-RbRLfIX-.js";import{a as u,i as d,r as f}from"./use-desktop-eHm2iTXX.js";import{t as p}from"./git-pull-request-DJkAMT0f.js";import{t as m}from"./square-terminal-B6PZX4Qp.js";import{t as h}from"./upload-Bp7hQxll.js";import{A as g,N as _,P as v,j as y,k as b,ot as x}from"./index-9qG98Orw.js";var S=i(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),C=t(n(),1),w=e();function T({root:e,selected:t,onSelect:n}){return(0,w.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,w.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,w.jsx)(D,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,w.jsx)(k,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function E({adds:e,dels:t}){return(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,w.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,w.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function D({dir:e,depth:t,selected:n,onSelect:r}){let[i,o]=(0,C.useState)(!0);return(0,w.jsxs)(`li`,{children:[(0,w.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":i?`open`:`closed`,"aria-expanded":i,onClick:()=>o(e=>!e),className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,w.jsx)(x,{"aria-hidden":`true`,className:a(`size-3.5 shrink-0 transition-transform`,i&&`rotate-90`)}),(0,w.jsx)(l,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,w.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,w.jsx)(E,{adds:e.adds,dels:e.dels})]}),i?(0,w.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,w.jsx)(D,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,w.jsx)(k,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var O={added:`text-success`,deleted:`text-danger`};function k({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,w.jsx)(`li`,{children:(0,w.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:a(`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,w.jsx)(c,{"aria-hidden":`true`,className:a(`size-3.5 shrink-0`,O[e.status])}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,w.jsx)(E,{adds:e.adds,dels:e.dels})]})})}function A(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function j(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(j)}}var M=(e,t)=>e.name.localeCompare(t.name);function N(e){let t=A(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=A(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(M),e.files.sort(M)};return i(t),{...t,dirs:t.dirs.map(j)}}function P({bar:e,branch:t,stat:n,mode:i,wrap:a,onModeChange:s,onWrapChange:c,onAction:l}){return(0,w.jsxs)(`div`,{"data-slot":`git-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[t?(0,w.jsx)(f,{branch:t}):null,n?(0,w.jsx)(L,{stat:n}):null,(0,w.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,w.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,w.jsx)(d,{mode:i,wrap:a,onModeChange:s,onWrapChange:c})}),e.secondary.map(e=>(0,w.jsx)(I,{action:e,variant:`outline`,onAction:l},e.id)),(0,w.jsx)(I,{action:e.primary,variant:`primary`,onAction:l}),e.menu.length>0?(0,w.jsxs)(b,{children:[(0,w.jsx)(_,{asChild:!0,children:(0,w.jsx)(r,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,w.jsx)(o,{"aria-hidden":`true`})})}),(0,w.jsx)(g,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,w.jsxs)(y,{disabled:!e.enabled,title:e.reason,onSelect:()=>l(e.id),children:[F[e.id],e.label]},e.id))})]}):null]})]})}var F={commit:(0,w.jsx)(u,{"aria-hidden":`true`}),push:(0,w.jsx)(h,{"aria-hidden":`true`}),"create-pr":(0,w.jsx)(p,{"aria-hidden":`true`}),"view-pr":(0,w.jsx)(s,{"aria-hidden":`true`}),"open-terminal":(0,w.jsx)(m,{"aria-hidden":`true`})};function I({action:e,variant:t,onAction:n}){return e.id===`view-pr`&&e.href?(0,w.jsx)(r,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,w.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[F[e.id],e.label]})}):(0,w.jsxs)(r,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[F[e.id],e.label]})}function L({stat:e}){return(0,w.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,w.jsx)(v,{stat:{adds:R(e.adds),dels:R(e.dels),files:e.files}})})}function R(e){let[t,n]=(0,C.useState)(e),r=(0,C.useRef)(e);return(0,C.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{S as a,T as i,P as n,N as r,L as t};
@@ -1 +0,0 @@
1
- import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{D as r,Dt as i,Ft as a,Lt as o,X as s,a as c,it as l,k as u,n as d,q as f,r as p,ut as m,zt as h}from"./toaster-BS2E1bhz.js";import{n as g,t as _}from"./utils-rQGbOrwc.js";import{t as v}from"./arrow-left-BE957rJs.js";import{i as y,n as b}from"./skill-detail-C9cniyId.js";import{n as x}from"./loader-circle-BV3DO9mE.js";import{n as S,t as C}from"./tab-link-phWEqSBy.js";import{t as w}from"./git-pull-request-DJkAMT0f.js";import{t as ee}from"./refresh-cw-DCa-Rlwz.js";import{t as te}from"./triangle-alert-6su4Js5O.js";import{t as T}from"./x-Br_jIDBw.js";import{r as E}from"./skills-ynuO5oCr.js";import{t as D}from"./markdown-CR_HLGTs.js";import{D as ne,E as O,G as k,H as A,J as re,K as j,T as M,U as N,V as P,W as F,X as I,Y as L,Z as ie,c as R,et as z,it as B,st as V,w as H,z as U}from"./index-9qG98Orw.js";var W=g(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),ae=g(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),G=t(n(),1);function K(e,t=[]){let n=`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`;return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=`\n\nUse these skills where relevant: ${t.join(`, `)}.`),n}function oe(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function se(e,t,n,r){let i=r?.trim();return t?{workflow:t,task:i||K(e,n)}:n.length?{steps:oe(n),task:i||K(e)}:{workflow:`quick-task`,task:i||K(e)}}function ce(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function le(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body}`.toLowerCase().includes(n))}function q(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}var J=e();function ue({item:e,workflows:t,skills:n,workflow:a,onWorkflowChange:s,selectedSkills:u,onSkillsChange:f,queuedRunId:p,onQueued:m}){let g=h(),_=u.filter(e=>n.some(t=>t.name===e)),[v,b]=(0,G.useState)(``),S=o({mutationFn:()=>l(se(e,a,_,v)),onSuccess:t=>{let n=`runs`in t?t.runs[0]:t;n&&m(e.url,n.id),g.invalidateQueries({queryKey:r.runs.all})},onError:e=>d(e.message,{tone:`danger`})}),C=e=>f(u.includes(e)?u.filter(t=>t!==e):[...u,e]);return(0,J.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,J.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:[(0,J.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 text-violet`}),`Hand this to the agent`]}),(0,J.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(de,{workflows:t,value:a,onChange:s}),(0,J.jsx)(fe,{skills:n,selected:u,onToggle:C})]}),u.length>0?(0,J.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:u.map(e=>(0,J.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>C(e),title:`Remove this skill`,className:`inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-px font-mono text-[11px] font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,J.jsx)(T,{"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,J.jsx)(R,{"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,value:v,onChange:e=>b(e.target.value),placeholder:`Add instructions for the agent… (empty uses the default "${e.kind===`pr`?`Address`:`Fix`} #${e.number}" prompt)`,className:`mt-3 min-h-20 text-[13px]`}),(0,J.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2.5`,children:[(0,J.jsxs)(c,{variant:`contrast`,"data-action":`gh-run`,disabled:S.isPending,onClick:()=>S.mutate(),children:[(0,J.jsx)(z,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,e.kind===`pr`?`PR`:`issue`]}),p?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,J.jsx)(x,{"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,J.jsx)(i,{to:`/tasks/${p}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-violet hover:underline`,children:`View task →`})]}):null]})]})}var Y=`inline-flex h-[26px] items-center gap-1.5 rounded-full border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`;function de({workflows:e,value:t,onChange:n}){let[r,i]=(0,G.useState)(!1);return(0,J.jsxs)(H,{open:r,onOpenChange:i,children:[(0,J.jsx)(O,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:_(Y,t&&`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[(0,J.jsx)(L,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,J.jsx)(`span`,{className:`max-w-44 truncate`,children:t??`workflow`}),(0,J.jsx)(V,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,J.jsx)(M,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{placeholder:`search workflows…`}),(0,J.jsxs)(j,{"data-slot":`gh-workflow-menu`,className:`max-h-64`,children:[(0,J.jsx)(A,{children:`Nothing matches.`}),(0,J.jsx)(N,{children:e.map(e=>{let r=t===e.name;return(0,J.jsxs)(k,{value:`workflow ${e.name}`,keywords:e.description?[e.description]:void 0,"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),i(!1)},children:[(0,J.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,J.jsx)(x,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.name)})})]})]})})]})}function fe({skills:e,selected:t,onToggle:n}){let[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),s=e.filter(E),c=e.filter(e=>!E(e)),l=(e,r)=>{let i=t.includes(e.name);return(0,J.jsxs)(k,{value:`skill ${e.name} ${e.path}`,keywords:e.description?[e.description]:void 0,"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":i?`true`:void 0,onSelect:()=>n(e.name),children:[(0,J.jsx)(`span`,{className:_(`shrink-0 font-mono text-xs`,r&&`font-semibold`),children:e.name}),e.description?(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,J.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),o(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,J.jsx)(B,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,J.jsx)(x,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.path)};return e.length===0?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(b,{skill:a,onClose:()=>o(null)}),(0,J.jsxs)(H,{open:r,onOpenChange:i,children:[(0,J.jsx)(O,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:_(Y,t.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,J.jsx)(I,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),`skills`,t.length>0?` · ${t.length}`:``,(0,J.jsx)(V,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,J.jsx)(M,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{placeholder:`search skills…`}),(0,J.jsxs)(j,{"data-slot":`gh-skill-menu`,className:`max-h-64`,children:[(0,J.jsx)(A,{children:`Nothing matches.`}),s.length>0?(0,J.jsx)(N,{heading:`Project skills`,children:s.map(e=>l(e,!0))}):null,c.length>0?(0,J.jsx)(N,{heading:`Global`,children:c.map(e=>l(e,!1))}):null]})]})})]})]})}var pe=30,X=1e3;function me({view:e}){let{n:t}=a(),n=u(),i=u({limit:X},n.data?.available===!0),l=i.data?.available?i.data:n.data,g=i.data?.available===!0,v=h(),y=o({mutationFn:()=>m({refresh:!0}),onSuccess:e=>{v.setQueryData(r.github({}),e),v.invalidateQueries({queryKey:r.github({limit:X})})},onError:e=>d(e.message,{tone:`danger`})}),b=s(),x=f(),[S,T]=(0,G.useState)(null),[E,D]=(0,G.useState)([]),[O,k]=(0,G.useState)(new Map),[A,j]=(0,G.useState)(``),[M,N]=(0,G.useState)([]);if(!l)return n.isError?(0,J.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,J.jsx)(p,{icon:(0,J.jsx)(te,{}),tone:`danger`,title:`Could not load GitHub`,subtitle:n.error.message})}):(0,J.jsx)(ne,{});if(!l.available)return(0,J.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,J.jsx)(p,{icon:(0,J.jsx)(re,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:l.reason??`unknown reason`,actions:(0,J.jsx)(c,{variant:`outline`,"data-action":`gh-retry`,disabled:y.isPending,onClick:()=>y.mutate(),children:`Try again`}),children:(0,J.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,J.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,J.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in cezar works without it.`]})})});let P=e===`issues`?l.issues:l.prs,F=l.labelColors??{},I=ce(P),L=le(P,{query:A,labels:M}),R=A.trim()!==``||M.length>0,z=t===void 0?null:Number.parseInt(t,10),B=z===null?L[0]??null:P.find(e=>e.number===z)??null,V=e===`issues`?`/github`:`/github/prs`;return(0,J.jsxs)(`div`,{"data-route":`github`,className:`flex h-full min-h-0 items-stretch`,children:[(0,J.jsxs)(`section`,{"data-slot":`gh-list`,className:_(`w-full min-h-0 flex-col overflow-y-auto overscroll-contain border-border md:flex md:w-[360px] md:shrink-0 md:border-r`,t===void 0?`flex`:`hidden`),children:[(0,J.jsxs)(`header`,{"data-slot":`gh-header`,className:`sticky top-0 z-10 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,J.jsx)(`h1`,{className:`text-lg font-semibold`,children:`GitHub`}),l.repo?(0,J.jsx)(`span`,{"data-slot":`gh-repo`,className:`min-w-0 truncate font-mono text-[11px] text-soft-foreground`,children:l.repo}):null,(0,J.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:y.isPending,onClick:()=>y.mutate(),className:`ml-auto flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-px text-[10px] font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,J.jsx)(ee,{"aria-hidden":`true`,className:_(`size-[9px]`,y.isPending&&`motion-safe:animate-spin`)}),l.syncedAt?`synced ${U(l.syncedAt)} ago`:`refresh`]})]}),(0,J.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,J.jsxs)(C,{to:`/github`,active:e===`issues`,children:[`Issues · `,Z(l.issues.length,g)]}),(0,J.jsxs)(C,{to:`/github/prs`,active:e===`prs`,children:[`Pull requests · `,Z(l.prs.length,g)]})]}),(0,J.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 pb-3`,children:[(0,J.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,J.jsx)(ie,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,J.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:`Search #id, title, author…`,value:A,onChange:e=>j(e.target.value),className:`w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,J.jsx)(he,{options:I,colors:F,selected:M,onChange:N})]})]}),L.length===0?(0,J.jsx)(`p`,{className:`px-4 py-4 text-sm text-soft-foreground`,children:R?`No ${e===`issues`?`issues`:`pull requests`} match your filter.`:`No open ${e===`issues`?`issues`:`pull requests`}.`}):(0,J.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-0.5 px-2 py-2`,children:L.map(t=>(0,J.jsx)(Q,{item:t,view:e,colors:F,active:B?.url===t.url,queued:O.has(t.url)},t.url))})]}),(0,J.jsx)(`section`,{"data-slot":`gh-detail`,className:_(`min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain`,t===void 0?`hidden md:flex`:`flex`),children:B?(0,J.jsx)(ge,{item:B,listPath:V,colors:F,children:(0,J.jsx)(ue,{item:B,workflows:b.data?.workflows??[],skills:x.data??[],workflow:S,onWorkflowChange:T,selectedSkills:E,onSkillsChange:D,queuedRunId:O.get(B.url)??null,onQueued:(e,t)=>k(n=>new Map(n).set(e,t))},B.url)}):(0,J.jsx)(p,{icon:e===`issues`?(0,J.jsx)(W,{}):(0,J.jsx)(w,{}),tone:`neutral`,heading:`h2`,title:z===null?`Nothing selected`:`Not in the open list`,subtitle:z===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${z} is not among the open ${e===`issues`?`issues`:`pull requests`} — it may be closed, or still outside the fetched batch.`})})]})}function Z(e,t){return`${e}${!t&&e>=pe?`+`:``}`}function Q({item:e,view:t,colors:n,active:r,queued:a}){let o=e.kind===`issue`?W:w;return(0,J.jsx)(`li`,{children:(0,J.jsxs)(i,{to:`${t===`issues`?`/github/issues`:`/github/prs`}/${e.number}`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,K(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},"data-slot":`gh-row`,"data-number":e.number,"aria-current":r?`page`:void 0,title:`Drag into the composer to prefill a task`,className:_(`flex flex-col gap-1 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,r&&`bg-muted`),children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(o,{"aria-hidden":`true`,className:_(`size-3.5 shrink-0`,e.kind===`issue`?`text-success`:`text-violet`)}),(0,J.jsx)(`span`,{className:_(`min-w-0 truncate text-[13px] font-medium`,r&&`font-semibold`),children:e.title})]}),(0,J.jsxs)(`span`,{className:`flex items-center gap-2 pl-[22px] font-mono text-[10.5px] text-muted-foreground`,children:[(0,J.jsxs)(`span`,{children:[`#`,e.number]}),(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:e.author}),(0,J.jsx)(`span`,{children:U(e.createdAt)}),a?(0,J.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-violet`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,J.jsx)($,{label:e,color:n[e]},e))}):null]})})}function he({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,G.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,J.jsxs)(H,{open:i,onOpenChange:a,children:[(0,J.jsx)(O,{asChild:!0,children:(0,J.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:_(`flex shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-primary/60 text-foreground`),children:[(0,J.jsx)(ae,{"aria-hidden":`true`,className:`size-3.5`}),n.length>0?`Labels · ${n.length}`:`Labels`]})}),(0,J.jsx)(M,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{placeholder:`Filter labels…`}),(0,J.jsxs)(j,{className:`max-h-64`,children:[(0,J.jsx)(A,{children:`No labels.`}),n.length>0?(0,J.jsxs)(k,{value:`__clear__`,onSelect:()=>r([]),className:`text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,J.jsxs)(k,{value:e,onSelect:()=>o(e),children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:q(t[e])}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,J.jsx)(x,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e)})]})]})})]})}function $({label:e,color:t}){return(0,J.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:q(t),className:`rounded-full border px-1.5 py-px text-[10px] font-medium`,children:e})}function ge({item:e,listPath:t,colors:n,children:r}){let a=e.kind===`pr`?`pull request`:`issue`,o=e.kind===`pr`&&!!(e.additions||e.deletions);return(0,J.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,J.jsxs)(i,{to:t,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,J.jsx)(v,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),(0,J.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[10.5px] text-soft-foreground`,children:[(0,J.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,J.jsx)(`span`,{children:a}),`·`,(0,J.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,J.jsxs)(`span`,{children:[U(e.createdAt),` ago`]}),e.comments?(0,J.jsxs)(J.Fragment,{children:[`·`,(0,J.jsxs)(`span`,{children:[e.comments,` comments`]})]}):null,o?(0,J.jsxs)(J.Fragment,{children:[`·`,(0,J.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,J.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,J.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions??0]})]})]}):null,`·`,(0,J.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,J.jsx)(S,{"aria-hidden":`true`,className:`size-2.5`})]})]}),(0,J.jsx)(`h2`,{className:`mt-2 text-xl leading-snug font-semibold`,children:e.title}),e.labels.length>0||e.checks?(0,J.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,J.jsx)($,{label:e,color:n[e]},e)),e.checks?(0,J.jsx)(_e,{checks:e.checks}):null]}):null,(0,J.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:e.body?(0,J.jsx)(D,{children:e.body}):(0,J.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),r]})}function _e({checks:e}){return(0,J.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:_(`text-[11px] font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:e===`passing`?`✓ checks passing`:e===`failing`?`✗ checks failing`:`○ checks pending`})}export{me as GithubRoute};