@wjarka/cezarion 0.18.0-dev.6468 → 0.18.0-dev.6472

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 (60) hide show
  1. package/package.json +2 -2
  2. package/web/dist/assets/activity-motion-CSe8gVgw.js +2 -0
  3. package/web/dist/assets/{activity-route-su3KawLr.js → activity-route-DURvhLQf.js} +1 -1
  4. package/web/dist/assets/agent-accounts-BrFoXDpa.js +18 -0
  5. package/web/dist/assets/attention-BeBfNOUJ.js +1 -0
  6. package/web/dist/assets/{cez-idle-xv7f96fc.js → cez-idle-TVRD1sce.js} +1 -1
  7. package/web/dist/assets/{commit-diff-panel-DmhrguZk.js → commit-diff-panel-BbM4GEgm.js} +1 -1
  8. package/web/dist/assets/{diff-DDwr1gUX.js → diff-DgAd6acp.js} +2 -2
  9. package/web/dist/assets/{diff-view-BNL7l7Vp.js → diff-view--NwKwseV.js} +3 -3
  10. package/web/dist/assets/{file-preview-Cm1jWwBy.js → file-preview-B36xoAJ8.js} +1 -1
  11. package/web/dist/assets/git-toolbar-Db0h7gTI.js +1 -0
  12. package/web/dist/assets/{github-wWGhoE3O.js → github-CA0qpTLt.js} +1 -1
  13. package/web/dist/assets/{global-activity-route-DpQr_eU9.js → global-activity-route-DRc_wjkF.js} +1 -1
  14. package/web/dist/assets/index-De7eAZ5M.js +17 -0
  15. package/web/dist/assets/index-Dps0ABGp.css +1 -0
  16. package/web/dist/assets/{live-protocol-DjH6ZQwI.js → live-protocol-aMLJJ0MQ.js} +1 -1
  17. package/web/dist/assets/preview-pane-connected-CU_lEf11.js +3 -0
  18. package/web/dist/assets/{project-router-uJ3SkX70.js → project-router-ir-bfT5a.js} +1 -1
  19. package/web/dist/assets/project-scope-context-BSdXJd3m.js +4 -0
  20. package/web/dist/assets/{prompt-template-menu-D5T9W-K3.js → prompt-template-menu-BJlLqUsI.js} +1 -1
  21. package/web/dist/assets/queries-BXo4WfX0.js +1 -0
  22. package/web/dist/assets/{reference-chip-AZWOlSRV.js → reference-chip-pp1FgLpK.js} +1 -1
  23. package/web/dist/assets/{repo-git-DJPSn50o.js → repo-git-BOfsABl4.js} +1 -1
  24. package/web/dist/assets/{report-reader-kzlovTso.js → report-reader-C_r69KvS.js} +1 -1
  25. package/web/dist/assets/reports-CWIvS-PA.js +1 -0
  26. package/web/dist/assets/run-header-CSEAFAfa.js +2 -0
  27. package/web/dist/assets/skills-jwrn7yXY.js +1 -0
  28. package/web/dist/assets/{tab-link-h4IjTsRH.js → tab-link-92W6MWDZ.js} +1 -1
  29. package/web/dist/assets/{task-changes-Db3dmYAT.js → task-changes-EalDx6wh.js} +1 -1
  30. package/web/dist/assets/{task-commits-D4HdW5xE.js → task-commits-ZWjrQSnF.js} +1 -1
  31. package/web/dist/assets/{task-files-sdaEBCfr.js → task-files-Cg-INsaD.js} +1 -1
  32. package/web/dist/assets/task-github-item-B8yO5uo1.js +1 -0
  33. package/web/dist/assets/task-thread-Bs6ZnRXz.js +9 -0
  34. package/web/dist/assets/{thread-state-hhRCETQT.js → thread-state-DBalnt7M.js} +1 -1
  35. package/web/dist/assets/use-desktop-BYMCVpyw.js +1 -0
  36. package/web/dist/assets/use-hand-to-agent-state-Bhmmem1E.js +1 -0
  37. package/web/dist/assets/{useInfiniteQuery-BcY0ra-k.js → useInfiniteQuery-C22IahAC.js} +1 -1
  38. package/web/dist/assets/useQuery-C0rYnV6X.js +1 -0
  39. package/web/dist/assets/{workflows-DRO8PcD-.js → workflows-BRhGKY_0.js} +2 -2
  40. package/web/dist/assets/ws-D9whCwIN.js +1 -0
  41. package/web/dist/index.html +15 -15
  42. package/web/dist/live-worker.js +1 -1
  43. package/web/dist/assets/activity-motion-BeswQRe1.js +0 -2
  44. package/web/dist/assets/agent-accounts-DseqHuGY.js +0 -18
  45. package/web/dist/assets/attention-DlfFfWoj.js +0 -1
  46. package/web/dist/assets/git-toolbar-Dya9briW.js +0 -1
  47. package/web/dist/assets/index-DS1HIBHa.css +0 -1
  48. package/web/dist/assets/index-DYx21hr3.js +0 -17
  49. package/web/dist/assets/preview-pane-connected-DSStovll.js +0 -3
  50. package/web/dist/assets/project-scope-context-X6-LgbYE.js +0 -4
  51. package/web/dist/assets/queries-00V5jnAV.js +0 -1
  52. package/web/dist/assets/reports-Ds7nog_M.js +0 -1
  53. package/web/dist/assets/run-header-skVwUvR-.js +0 -2
  54. package/web/dist/assets/skills-BJPLRZL5.js +0 -1
  55. package/web/dist/assets/task-github-item-DyZdbhco.js +0 -1
  56. package/web/dist/assets/task-thread-QKAKHYiJ.js +0 -9
  57. package/web/dist/assets/use-desktop-C3yCutND.js +0 -1
  58. package/web/dist/assets/use-hand-to-agent-state-wGtVosbN.js +0 -1
  59. package/web/dist/assets/useQuery-C96hAjNV.js +0 -1
  60. package/web/dist/assets/ws-BD6s7UXb.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,s as n,u as r}from"./button-Czdi8NqC.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Bn as o,Fn as s,Wn as c,ar as l}from"./project-scope-context-X6-LgbYE.js";import{N as u}from"./live-protocol-DjH6ZQwI.js";import"./queries-00V5jnAV.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{a as f,d as p,h as m,i as ee,l as te,m as ne,n as re,o as ie,p as h,r as ae,t as oe,u as se}from"./es2015-DnySZnV4.js";import{_ as g,b as ce,v as le,x as _,y as ue}from"./dropdown-menu-BN2BI4R1.js";import"./attention-DlfFfWoj.js";function de(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=(e.steps??[]).find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}var fe=d(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),v=e(i(),1),y=a(),b=`Popover`,[x,pe]=ne(b,[_]),S=_(),[me,C]=x(b),he=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=S(t),c=v.useRef(null),[l,u]=v.useState(!1),[d,f]=p({prop:r,defaultProp:i??!1,onChange:a,caller:b});return(0,y.jsx)(ce,{...s,children:(0,y.jsx)(me,{scope:t,contentId:te(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:o,children:n})})};he.displayName=b;var ge=`PopoverAnchor`,w=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=C(ge,n),a=S(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(o(),()=>s()),[o,s]),(0,y.jsx)(g,{...a,...r,ref:t})});w.displayName=ge;var T=`PopoverTrigger`,E=v.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=C(T,r),o=S(r),s=n(t,a.triggerRef),c=(0,y.jsx)(m.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":j(a.open),...i,ref:s,onClick:h(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,y.jsx)(g,{asChild:!0,...o,children:c})});E.displayName=T;var D=`PopoverPortal`,[_e,ve]=x(D,{forceMount:void 0}),O=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=C(D,t);return(0,y.jsx)(_e,{scope:t,forceMount:n,children:(0,y.jsx)(se,{present:n||a.open,children:(0,y.jsx)(ee,{asChild:!0,container:i,children:r})})})};O.displayName=D;var k=`PopoverContent`,ye=v.forwardRef((e,t)=>{let n=ve(k,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=C(k,e.__scopePopover);return(0,y.jsx)(se,{present:r||a.open,children:a.modal?(0,y.jsx)(xe,{...i,ref:t}):(0,y.jsx)(Se,{...i,ref:t})})});ye.displayName=k;var be=t(`PopoverContent.RemoveScroll`),xe=v.forwardRef((e,t)=>{let r=C(k,e.__scopePopover),i=v.useRef(null),a=n(t,i),o=v.useRef(!1);return v.useEffect(()=>{let e=i.current;if(e)return oe(e)},[]),(0,y.jsx)(re,{as:be,allowPinchZoom:!0,children:(0,y.jsx)(Ce,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Se=v.forwardRef((e,t)=>{let n=C(k,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(Ce,{...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()}})}),Ce=v.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,p=C(k,n),m=S(n);return ae(),(0,y.jsx)(f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(ie,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,y.jsx)(ue,{"data-state":j(p.open),role:`dialog`,id:p.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),A=`PopoverClose`,we=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=C(A,n);return(0,y.jsx)(m.button,{type:`button`,...r,ref:t,onClick:h(e.onClick,()=>i.onOpenChange(!1))})});we.displayName=A;var Te=`PopoverArrow`,Ee=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=S(n);return(0,y.jsx)(le,{...i,...r,ref:t})});Ee.displayName=Te;function j(e){return e?`open`:`closed`}var De=he,Oe=w,ke=E,Ae=O,je=ye,Me=new Set([`queued`,`running`,`waiting`]);function Ne(e){return Me.has(e)}function M(e){return l(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function Pe(e){return M(e)&&e.status!==`queued`}function N(e,t,n){return e.archived||!(e.status===`done`||e.status===`failed`||e.status===`cancelled`)||e.delegation?.role===`worker`||n!==void 0&&c(e)!==n?!1:t===`unpinned`?!e.pinned:t!==`pinned`||e.pinned===!0}var Fe=[`done`,`failed`];function P(e){return e.archived||l(e)||!Fe.includes(e.status)?!1:e.finishedAt!==void 0}function Ie(e){let t=e.finishedAt;return t===void 0||!P(e)?!1:e.seenAt===void 0||e.seenAt<t}var F=[`Needs you`,`Finished`,`Working`,`Archived`],Le={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},Re=3,I=e=>l(e)?Re:Le[e.status]??9;function ze(e){let t=e=>s[o(e).bucket];return[...e].sort((e,n)=>t(e)-t(n)||I(e)-I(n))[0]}function L(e,t){return t===`archived`?`Archived`:o(e).bucket===`waiting`?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function R(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function z(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function Be(e,t){return t!==void 0&&z(e).ref===t}function B(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function V(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=I(e)-I(n);if(r!==0)return r;if(l(e)&&l(n)){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):n.createdAt.localeCompare(e.createdAt)})}function H(e){return e.delegation?.role===`worker`}function Ve(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!H(n)?e:n.delegation?.parentRunId??e}function He(e,t,n=B(e)){let r=V(e,t).filter(e=>!H(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(L(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return F.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function Ue(e,t={}){let n=typeof t==`number`?{overall:t}:u(t),r={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},i=[],a=n.overall===void 0?10:n.overall??1/0;for(let t of e){let e=t.label===`Archived`?1/0:n[r[t.label]]??1/0,o=t.rows.filter(n=>{let r=n.run.pinned;return t.label!==`Archived`&&r?!0:a<=0||e<=0?!1:(--a,--e,!0)});o.length&&i.push({label:t.label,rows:o})}return i}function We(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function Ge(e){let t=0,n=0,r=0;for(let i of e)if(!H(i)){if(i.archived){n+=1;continue}t+=1,o(i).bucket===`waiting`&&(r+=1)}return{active:t,archived:n,waiting:r}}function Ke(e,t){let n=t===`automations`;return e.filter(e=>!e.archived&&c(e)===n)}var U={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},W=Object.keys(U),qe=`section`;function Je(e,t){return`/?origin=${t===`automations`?`automations`:`direct`}&${qe}=${U[e]}`}function Ye(e){return W.find(t=>U[t]===e)??null}function Xe(e){let t={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let n of e){if(H(n)||n.archived)continue;let e=+(o(n).bucket===`waiting`);c(n)?(t.automations+=1,t.automationsWaiting+=e):(t.active+=1,t.activeWaiting+=e)}return t}function G(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function Ze(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=G(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(G(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function Qe(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:G(e)}:{top:0,bottom:0}}function $e(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function et(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(Qe(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function tt(){let[e,t]=(0,v.useState)({top:0,bottom:0});return(0,v.useEffect)(()=>et(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function nt(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=document.documentElement;return Ze(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var rt=new Set([``,`text`,`search`,`email`,`url`,`tel`,`password`,`number`]);function it(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.tagName?.toUpperCase();return n===`TEXTAREA`?!0:n===`INPUT`?rt.has((t.type??``).toLowerCase()):t.isContentEditable===!0}var K=new WeakMap;function at(e){let t=K.get(e),n=t&&t.width===e.innerWidth?Math.max(t.height,e.innerHeight):e.innerHeight;return K.set(e,{width:e.innerWidth,height:n}),n-e.innerHeight}function ot(e){let t=at(e),n=e.visualViewport?.scale??1;return Math.abs(n-1)<.05&&G(e)>80||t>80&&it(e.document?.activeElement)}function st(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=window,n=()=>t(ot(e));n();let r=e.visualViewport;return r?.addEventListener(`resize`,n),r?.addEventListener(`scroll`,n),window.addEventListener(`resize`,n),document.addEventListener(`focusin`,n),document.addEventListener(`focusout`,n),()=>{r?.removeEventListener(`resize`,n),r?.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n),document.removeEventListener(`focusin`,n),document.removeEventListener(`focusout`,n)}},[]),e}function ct(e){let t=/\/(\d+)\/?$/.exec(e.trim()),n=t?Number(t[1]):NaN;return Number.isInteger(n)&&n>0?n:null}function lt(e){let t=new Set;for(let n of[e.pullRequestUrl,e.referencedPullRequestUrl,e.referencedIssueUrl]){let e=n?ct(n):null;e!==null&&t.add(e)}for(let n of[e.prNumber,e.issueNumber,e.markerRefs?.pr,e.markerRefs?.issue])typeof n==`number`&&Number.isInteger(n)&&n>0&&t.add(n);for(let n of e.pullRequests??[])t.add(n.number);return[...t]}var ut=[{id:`title`,kind:`text`,scopes:[`stored`],source:`summary`,texts:e=>[e.title]},{id:`titleSummary`,kind:`text`,scopes:[`stored`],source:`summary`,texts:e=>[e.titleSummary]},{id:`displayTitle`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>[t.displayTitle]},{id:`branch`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.branch]},{id:`workflow`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.workflow]},{id:`workflowLabel`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.workflowLabel]},{id:`automation`,kind:`text`,scopes:[`stored`,`shown`],source:`reader`,texts:(e,t)=>[t.automation],universe:e=>[...e.automationNames?.values()??[]]},{id:`projectName`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>[t.projectName]},{id:`tags`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>t.tags??[]},{id:`id`,kind:`identifier`,scopes:[`stored`],source:`summary`,texts:e=>[e.id]},{id:`urls`,kind:`link`,scopes:[`stored`],source:`summary`,texts:e=>[e.pullRequestUrl,e.referencedPullRequestUrl,e.referencedIssueUrl,...(e.pullRequests??[]).map(e=>e.url)]},{id:`heldReferences`,kind:`reference`,scopes:[`stored`],source:`summary`,numbers:lt},{id:`shownReferences`,kind:`reference`,scopes:[`shown`],source:`reader`,numbers:(e,t)=>t.references?.()??[]}];function dt(e){return e.trim().toLowerCase().split(/\s+/).filter(e=>e!==``)}function ft(e,t){return t&&e.automationId!==void 0?t.get(e.automationId)??e.automationId:void 0}function pt(e,t){let n=t.scope??`stored`,r=t.scope===`shown`?t.extras:{automation:ft(e,t.automationNames)},i=[],a=[],o=[],s={text:i,identifier:a,link:o},c=[];for(let t of ut)if(t.scopes.includes(n)){if(t.kind===`reference`){c.push(()=>t.numbers(e,r));continue}for(let n of t.texts(e,r))typeof n==`string`&&s[t.kind].push(n.toLowerCase())}let l;return{prose:i,ids:a,links:o,references:()=>l??=new Set(c.flatMap(e=>e().map(String)))}}function q(e,t,n={}){let r=dt(t);if(r.length===0)return!1;let{prose:i,ids:a,links:o,references:s}=pt(e,n);return r.every(e=>{if(i.some(t=>t.includes(e)))return!0;let t=e.replace(/^#/,``);return/^\d+$/.test(t)?s().has(String(Number(t)))||a.some(e=>e.startsWith(t)):a.some(t=>t.includes(e))||o.some(t=>t.includes(e))})}var mt=new Set([`running`,`waiting`]);function J(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function ht(e){return e===void 0?``:`$${e>=10?e.toFixed(0):e.toFixed(2)}`}function gt(e,t=new Date){if(!l(e))return;let n=new Date(e.autoResumeAt);if(!Number.isFinite(n.getTime()))return;let r=n.toDateString()===t.toDateString(),i=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n);return{label:r?i:`${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(n)} ${i}`,title:`Resumes automatically at ${new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n)}`}}function _t(e){return e.steps?de({workflow:e.workflow,steps:e.steps}):e.workflowLabel??e.workflow}function vt(e,t,n=()=>``){let r=e.filter(e=>!H(e));return t.trim()?r.filter(e=>q(e,t,{scope:`shown`,extras:{displayTitle:R(e),automation:n(e),references:()=>Y(e)}})):[...r]}function Y(e){return X(e).map(e=>e.number)}function yt(e,t){return e.filter(e=>N(e,t)).length}function bt(e){return yt(e)}function xt(e){return St(e)[0]??e.pullRequests?.find(e=>e.url)?.url}function St(e){let t=[];return e.pullRequestUrl&&t.push(e.pullRequestUrl),!(e.markerRefs?.issue!==void 0&&e.markerRefs?.pr===void 0)&&e.referencedPullRequestUrl&&t.push(e.referencedPullRequestUrl),t}function Ct(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.issueNumber??e.markerRefs?.issue;if(!(!n||!t))return`${t}/issues/${n}`}function wt(e){let t=`${e.kind}#${e.number}`;if(!e.url)return`${t}@project:${e.projectId??`default`}`;try{let n=new URL(e.url),r=n.pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`);return`${t}@${n.host.toLowerCase()}/${r.toLowerCase()}`}catch{return`${t}@${e.url}`}}function X(e,t,n=e.projectId){let r=St(e),i=e.markerRefs?.pr,a=[...i===void 0||[...r,...(e.pullRequests??[]).flatMap(e=>e.url?[e.url]:[])].some(e=>Q(e)===String(i))?[]:[{kind:`PR`,number:i}],...r.map(e=>({kind:`PR`,url:e})),{kind:`PR`,number:e.prNumber},...(e.pullRequests??[]).map(e=>({kind:`PR`,number:e.number,...e.url?{url:e.url}:{},authoritative:!0})),{kind:`Issue`,url:Ct(e,t)},{kind:`Issue`,number:e.issueNumber}],o=new Set,s=[];for(let e of a){let r=e.url?Number(Q(e.url)):e.number;if(!r||!Number.isInteger(r)||!e.url&&!e.authoritative&&s.some(t=>t.url&&t.kind===e.kind&&t.number===r))continue;let i=e.url??Tt(e.kind,r,t),a={kind:e.kind,number:r,...i?{url:i}:n===void 0?{}:{projectId:n}},c=wt(a);o.has(c)||(o.add(c),s.push(a))}return s}function Tt(e,t,n){if(n)return`${n}/${e===`PR`?`pull`:`issues`}/${t}`}function Et(e){return X(e)[0]}function Z(e,t){if(!e.url)return!0;if(!t)return!1;let n=Dt(t);return n!==void 0&&Dt(e.url)===n}function Dt(e){try{let t=new URL(e),[n,r]=t.pathname.split(`/`).filter(Boolean);return n&&r?`${t.host}/${n}/${r}`.toLowerCase():void 0}catch{return}}function Ot(e,t){let n=[];for(let r of X(e,t)){if(!Z(r,t))continue;let e=r.kind===`PR`?`pr`:`issue`;n.some(t=>t.kind===e&&t.number===r.number)||n.push({kind:e,number:r.number})}return n}function kt(e,t,n,r){if(Z(n,r))return`/p/${e}/tasks/${t}/${n.kind===`PR`?`pr`:`issue`}/${n.number}`}function Q(e){return/\/(\d+)\/?(?:[?#].*)?$/.exec(e)?.[1]??null}function At(e,t){let n=mt.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:J(n.rssBytes),kind:`live`}};let r=J(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}var $=v.createContext(null);function jt({...e}){let t=v.useRef(!1);return(0,y.jsx)($,{value:t,children:(0,y.jsx)(De,{"data-slot":`popover`,...e})})}function Mt({onPointerDownCapture:e,onKeyDownCapture:t,...n}){let r=v.useContext($);return(0,y.jsx)(ke,{"data-slot":`popover-trigger`,...n,onPointerDownCapture:t=>{r&&(r.current=t.pointerType===`touch`),e?.(t)},onKeyDownCapture:e=>{r&&(r.current=!1),t?.(e)}})}function Nt({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:i,onOpenAutoFocus:a,...o}){let s=tt(),c=v.useContext($);return(0,y.jsx)(Ae,{children:(0,y.jsx)(je,{"data-slot":`popover-content`,align:t,sideOffset:n,onOpenAutoFocus:e=>{let t=c?.current;if(c&&(c.current=!1),a?.(e),e.defaultPrevented||!t)return;let n=e.target;n instanceof HTMLElement&&n.querySelector(`[cmdk-input]`)&&(e.preventDefault(),n.focus({preventScroll:!0}))},collisionPadding:$e(s,i),className:r(`z-50 w-72 max-w-(--radix-popover-content-available-width) [overflow-wrap:anywhere] origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...o})})}function Pt({...e}){return(0,y.jsx)(Oe,{"data-slot":`popover-anchor`,...e})}var Ft=`(min-width: 48rem)`;function It(){let[e,t]=(0,v.useState)(()=>typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 48rem)`).matches);return(0,v.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(Ft),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}export{Ie as $,W as A,R as B,At as C,st as D,nt as E,Ge as F,V as G,Ve as H,ze as I,P as J,z as K,Ye as L,Ue as M,He as N,F as O,H as P,N as Q,B as R,X as S,q as T,Xe as U,Je as V,Ke as W,Ne as X,M as Y,Pe as Z,Ct as _,Nt as a,xt as b,bt as c,Z as d,fe as et,Q as f,yt as g,Y as h,Pt as i,L as j,qe as k,ht as l,gt as m,It as n,Mt as o,wt as p,We as q,jt as r,vt as s,Ft as t,J as u,kt as v,_t as w,Et as x,Ot as y,Be as z};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,t as n,u as r}from"./button-Czdi8NqC.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Bt as o,C as s,Gr as c,nt as l,r as u,rt as d,tn as f,xr as p}from"./project-scope-context-X6-LgbYE.js";import{$t as m,M as h,O as g,P as _,Pt as v,Rt as y,Tt as b,et as x,h as S,jt as C,n as w,rt as T}from"./queries-00V5jnAV.js";import{t as E}from"./useQuery-C96hAjNV.js";import{a as D,et as O,o as k,r as A}from"./use-desktop-C3yCutND.js";import{n as j}from"./toaster-2NK3PogQ.js";import{A as M,Z as ee,_ as N,b as P,ct as F,d as I,ft as te,h as ne,l as L,mt as re,ot as ie,r as ae,rt as oe,u as se,ut as ce}from"./design-icons-DmYTv2r1.js";import{t as le}from"./eye-B8okNWXU.js";import{a as ue,i as R}from"./format-BNCkW110.js";import{t as de}from"./message-square-B-MD-8rD.js";import{t as fe}from"./play-CmVAj_fu.js";import{a as pe,i as me,o as he,r as ge,s as _e,t as ve}from"./dialog-CkU56ywj.js";import{d as z,t as ye,y as B}from"./prompt-template-menu-D5T9W-K3.js";import{t as V}from"./project-router-uJ3SkX70.js";import{B as be,E as xe,I as Se,L as H,M as Ce,O as we,P as Te,R as Ee,S as De,T as Oe,a as ke,b as Ae,f as je,h as Me,i as Ne,l as Pe,m as Fe,n as Ie,p as Le,r as U,s as Re,t as ze,u as Be,w as Ve,x as He,z as Ue}from"./agent-accounts-DseqHuGY.js";import{d as We,f as Ge,i as Ke,s as qe,t as Je,u as Ye}from"./skills-DFBiAuJG.js";import{F as Xe,L as Ze,X as Qe,Y as $e,et,hn as tt}from"./index-DYx21hr3.js";import{t as nt}from"./diff-DDwr1gUX.js";import{t as rt}from"./tab-link-h4IjTsRH.js";var W=e(i(),1),G=a(),it={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function K({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,G.jsx)(L,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:r(t,`text-success`)}):e===`failing`?(0,G.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:r(t,`text-danger`)}):e===`pending`?(0,G.jsx)(ue,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:r(t,`animate-spin text-warning`)}):(0,G.jsx)(ne,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:r(t,`text-soft-foreground`)})}function at(e){return e?.available?e.mergeState:null}function ot(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function st(e){return e.state===`merged`?`Merged`:e.state===`closed`?`Closed`:e.isDraft?`Draft`:e.mergeable===`conflicting`?`Conflicts must be resolved`:e.canMerge?`Ready to merge`:e.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`}function ct(e){return e===`approved`||e===`not-required`?`passing`:e===`unknown`?`unknown`:`failing`}function lt(e){return e===`mergeable`?`passing`:e===`conflicting`?`failing`:`unknown`}function ut(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function dt(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function ft(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function pt(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function q(e){return e?it[e]:`Merge`}function mt(e){return e===`conflicting`?`true`:void 0}function ht({check:e}){return(0,G.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(K,{state:e.state}),(0,G.jsxs)(`span`,{children:[e.name,` · `,e.state,dt(e.required)]})]}),e.url&&t(e.url)?(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function gt({reason:e}){return(0,G.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,G.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function _t({state:e,selectedMethod:t,overrideRules:i,mergeEnabled:a,refreshPending:o,onRefresh:s,onRunAgent:c,onConfirm:l,onMethodChange:u,onOverrideChange:d}){let f=st(e),p=ct(e.reviewDecision),m=lt(e.mergeable);return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,G.jsx)(L,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,G.jsx)(F,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:f}),(0,G.jsxs)(n,{type:`button`,variant:`ghost`,size:`sm`,disabled:o,onClick:s,children:[(0,G.jsx)(ee,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,o&&`animate-spin`)}),`Refresh`]})]}),(0,G.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[e.headRef,` (`,e.headSha.slice(0,7),`) → `,e.baseRef]}),(0,G.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,G.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(K,{state:p}),(0,G.jsxs)(`span`,{children:[`Reviews: `,e.reviewDecision.replaceAll(`-`,` `)]})]}),(0,G.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(K,{state:m}),(0,G.jsxs)(`span`,{children:[`Conflicts: `,ut(e.mergeable)]})]}),e.checks.length===0?(0,G.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,G.jsx)(ht,{check:e},e.name)),e.blockers.map(e=>(0,G.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&c?(0,G.jsx)(n,{className:`mt-4`,onClick:c,children:`Run agent on this PR`}):null,e.canOverride?(0,G.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>d(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,G.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,e.eligibility===`unknown`?(0,G.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,e.state===`open`&&e.methods.length>0?(0,G.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,G.jsx)(`select`,{"aria-label":`Merge method`,value:t??``,onChange:e=>u(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:e.methods.map(e=>(0,G.jsx)(`option`,{value:e,children:it[e]},e))}),(0,G.jsx)(n,{disabled:!a,onClick:l,children:q(t)})]}):null]})]})}function vt({number:e,state:t,selectedMethod:r,confirming:i,overrideRules:a,mergePending:o,mergeError:s,onOpenChange:c,onMerge:l}){return(0,G.jsx)(ve,{open:i,onOpenChange:c,children:(0,G.jsxs)(ge,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,G.jsxs)(he,{children:[(0,G.jsxs)(_e,{children:[q(r),` pull request #`,e,`?`]}),(0,G.jsx)(me,{asChild:!0,children:(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`p`,{children:[`This will merge “`,t.title,`” into `,t.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),a&&t.canOverride?(0,G.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-warning`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),s?(0,G.jsx)(`p`,{className:`text-sm text-danger`,children:s.message}):null,(0,G.jsxs)(pe,{children:[(0,G.jsx)(n,{variant:`outline`,disabled:o,onClick:()=>c(!1),children:`Cancel`}),(0,G.jsx)(n,{disabled:o,onClick:l,children:o?`Merging…`:q(r)})]})]})})}function yt({number:e,onRunAgent:t}){let n=c(),r=T(),i=E({queryKey:w.githubMergeState(e),queryFn:({signal:t})=>d(e,{},{signal:t}),retry:!1}),a=at(i.data),[s,l]=(0,W.useState)(null),[u,f]=(0,W.useState)(!1),[p,h]=(0,W.useState)(!1),g=m({mutationFn:t=>d(e,{refresh:!0}),onSuccess:(e,t)=>n.setQueryData(t,e),onError:e=>j(e instanceof Error?e.message:String(e),{tone:`danger`})}),_=ot(s,a),v=()=>({mergeState:w.githubMergeState(e),list:w.githubPages(50),comments:w.githubComments(`pr`,e),item:w.githubItem(`pr`,e),refStatus:r===void 0?void 0:w.githubRefStatusOf(r)}),y=m({mutationFn:t=>{if(!a||!_)throw Error(`No merge method is available.`);return o(e,{method:_,expectedHeadSha:a.headSha,...p&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{f(!1),j(`Pull request #${e} merged`),n.invalidateQueries({queryKey:r.mergeState}),n.invalidateQueries({queryKey:r.list}),n.invalidateQueries({queryKey:r.comments}),n.invalidateQueries({queryKey:r.item}),r.refStatus&&n.invalidateQueries({queryKey:r.refStatus})},onError:(e,t)=>{j(e instanceof Error?e.message:String(e),{tone:`danger`}),n.invalidateQueries({queryKey:t.mergeState})}});return i.isPending?(0,G.jsx)(B,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,G.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":mt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,G.jsx)(_t,{state:a,selectedMethod:_,overrideRules:p,mergeEnabled:pt(_,a,p),refreshPending:g.isPending,onRefresh:()=>g.mutate(w.githubMergeState(e)),onRunAgent:t,onConfirm:()=>f(!0),onMethodChange:l,onOverrideChange:h}),(0,G.jsx)(vt,{number:e,state:a,selectedMethod:_,confirming:u,overrideRules:p,mergePending:y.isPending,mergeError:y.error,onOpenChange:f,onMerge:()=>y.mutate(v())})]}):(0,G.jsx)(gt,{reason:ft(i.data)})}function bt(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 xt(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))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.author!==void 0&&e.author.toLowerCase()!==t.author.toLowerCase()||t.includeNumbers&&!t.includeNumbers.has(e.number)||t.excludeNumbers?.has(e.number)||t.projectId&&e.projectIds!==void 0&&!e.projectIds.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body??``}`.toLowerCase().includes(n))}function St(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function J(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))`}}function Ct({label:e,color:t,plain:n=!1}){return(0,G.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:J(t),className:n?`text-[11px] font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[12px] font-medium`,children:e})}function wt(e){return e===`pr`?`pull request`:`issue`}function Tt(e,t,n){return e===`pr`&&!!(t||n)}function Et({backLink:e}){return e?(0,G.jsxs)(V,{to:e.to,"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,G.jsx)(ae,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}function Dt({item:e,kindWord:n,commentCount:r,hasDiffStat:i,additions:a,deletions:o}){return(0,G.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,G.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,G.jsx)(`span`,{children:n}),`·`,(0,G.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,G.jsxs)(`span`,{children:[R(e.createdAt),` ago`]}),r?(0,G.jsxs)(G.Fragment,{children:[`·`,(0,G.jsx)(Jt,{count:r})]}):null,i?(0,G.jsxs)(G.Fragment,{children:[`·`,(0,G.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,G.jsxs)(`span`,{className:`text-success`,children:[`+`,a??0]}),` `,(0,G.jsxs)(`span`,{className:`text-danger`,children:[`−`,o??0]})]})]}):null,`·`,t(e.url)?(0,G.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,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,G.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function Ot({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,G.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,G.jsx)(rt,{to:z(`prs`,t.filter,e.number),active:!n,children:`Conversation`}),(0,G.jsx)(rt,{to:z(`prs`,t.filter,e.number,`/changes`),active:n,children:`Changes`})]}):(0,G.jsx)(V,{to:z(`prs`,null,e.number,`/changes`),"data-slot":`gh-files-changed`,className:`mt-3 inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Files changed`}):null}function kt({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,G.jsx)(Ct,{label:e,color:t[e]},e)),n?(0,G.jsx)(Yt,{checks:n,url:e.url}):null]}):null}function At({item:e,colors:t,body:n}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:n?(0,G.jsx)(Ze,{children:n}):(0,G.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,G.jsx)(Nt,{item:e,colors:t})]})}function jt({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,children:c}){let l=a?.changes??!1,u=wt(e.kind),d=g(e.kind,e.number,!l).data?.detail,f=d?.body??e.body,p=d?.additions??e.additions,m=d?.deletions??e.deletions,h=Tt(e.kind,p,m),_=r??e.comments;return(0,G.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,G.jsx)(Et,{backLink:i}),(0,G.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,G.jsxs)(`h2`,{className:`mb-4 text-[22px] leading-snug font-normal`,children:[`#`,e.number,` `,e.title]}):null,(0,G.jsx)(Dt,{item:e,kindWord:u,commentCount:_,hasDiffStat:h,additions:p,deletions:m}),e.kind===`pr`?null:(0,G.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-normal`,children:e.title}),s,(0,G.jsx)(Ot,{item:e,subNav:a,changes:l}),(0,G.jsx)(kt,{item:e,colors:t,checks:n}),l&&e.kind===`pr`?(0,G.jsx)(Mt,{item:e}):(0,G.jsx)(At,{item:e,colors:t,body:f})]}),e.kind===`pr`?(0,G.jsx)(yt,{number:e.number,onRunAgent:o}):null,c]})}function Mt({item:e}){let i=c(),a=h(e.number),[o,s]=(0,W.useState)(``),[u,d]=(0,W.useState)(null),f=a.data,p=f?.available?f.files.filter(e=>e.path.toLowerCase().includes(o.toLowerCase())):[],m=p.findIndex(e=>e.path===u);(0,W.useEffect)(()=>{p.length>0&&!p.some(e=>e.path===u)&&d(p[0].path)},[f?.available?f.headSha:``,o]);let g=async()=>{let t=f?.available?f.headSha:null,n=w.githubPrChanges(e.number),r=await l(e.number,{refresh:!0});i.setQueryData(n,r),r.available&&t&&t!==r.headSha&&(d(r.files[0]?.path??null),j(`The reviewed revision changed.`))};if(a.isPending)return(0,G.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(a.isError||!f)return(0,G.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!f.available)return(0,G.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:f.reason});let _=p.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),v=t(e.url)?`${e.url}/files`:null,y=p.find(e=>e.path===u);return(0,G.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,G.jsxs)(`strong`,{children:[f.files.length,` changed files`]}),(0,G.jsxs)(`span`,{className:`text-success`,children:[`+`,f.additions]}),(0,G.jsxs)(`span`,{className:`text-danger`,children:[`−`,f.deletions]}),(0,G.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:f.headSha,children:[`head `,f.headSha.slice(0,8)]}),(0,G.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void g(),children:`Refresh`})]}),f.truncated?(0,G.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[f.reason??`This response is incomplete.`,` `,v?(0,G.jsx)(`a`,{href:v,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,G.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,G.jsxs)(`aside`,{className:`min-w-0`,children:[(0,G.jsx)(`input`,{"aria-label":`Filter changed files`,value:o,onChange:e=>s(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,G.jsx)(`select`,{"aria-label":`Select changed file`,value:u??``,onChange:e=>d(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:p.map(e=>(0,G.jsx)(`option`,{children:e.path},e.path))}),(0,G.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:p.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>d(e.path),className:r(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,u===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,G.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,G.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,G.jsx)(n,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:m<=0,onClick:()=>d(p[m-1]?.path??null),children:(0,G.jsx)(tt,{})}),(0,G.jsx)(n,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:m<0||m>=p.length-1,onClick:()=>d(p[m+1]?.path??null),children:(0,G.jsx)(I,{size:16})})]}),p.length===0?(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(nt,{files:_.filter(e=>e.path===u),wrap:!0,className:`min-w-0`}),y&&!y.patch?(0,G.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,y.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Nt({item:e,colors:t}){let n=g(e.kind,e.number),r=n.data,i=(0,W.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(Pt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,G.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,G.jsx)(B,{className:`mb-3 h-3 w-24`}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(B,{className:`h-14 w-full`}),(0,G.jsx)(B,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,G.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,G.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,G.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,G.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,G.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Ft(i).map(e=>e.group===`commits`?(0,G.jsx)(It,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,G.jsx)(Kt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,G.jsx)(Lt,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,G.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Pt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Ft(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function It({commits:e,colors:t}){let[n,r]=(0,W.useState)(!1),i=e[0]?.actor??`?`;return n?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:Y.committed}),(0,G.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,G.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,G.jsx)(Lt,{event:e,colors:t},e.id))]}):(0,G.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:Y.committed}),(0,G.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,G.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,G.jsx)(`span`,{className:`shrink-0`,children:R(e[e.length-1].createdAt)})]})})}var Y={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Lt({event:e,colors:t}){return(0,G.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:r(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Y[e.kind]}),(0,G.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,G.jsx)(Ut,{event:e,colors:t}),(0,G.jsx)(`span`,{className:`shrink-0`,children:R(e.createdAt)}),e.url?(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Rt({event:e}){return(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,G.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,G.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,G.jsx)(Wt,{checks:e.checks})]})}function zt({event:e,colors:t}){return(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,G.jsx)(`span`,{"data-slot":`gh-event-label`,style:J(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[12px]`,children:e.label.name}):null,(0,G.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function Bt({event:e}){return(0,G.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Vt({event:e}){return(0,G.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Ht={committed:e=>(0,G.jsx)(Rt,{event:e}),labeled:(e,t)=>(0,G.jsx)(zt,{event:e,colors:t}),unlabeled:(e,t)=>(0,G.jsx)(zt,{event:e,colors:t}),assigned:e=>(0,G.jsx)(Bt,{event:e}),unassigned:e=>(0,G.jsx)(Bt,{event:e}),merged:()=>(0,G.jsx)(`span`,{children:`merged this`}),closed:()=>(0,G.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,G.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,G.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,G.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,G.jsx)(Vt,{event:e})};function Ut({event:e,colors:t}){return Ht[e.kind]?.(e,t)??null}function Wt({checks:e}){return e?(0,G.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:r(`shrink-0`,Z[e]),children:X[e]}):null}var Gt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Kt({comment:e}){let t=e.reviewState?Gt[e.reviewState]:null;return(0,G.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,G.jsx)(qt,{url:e.avatarUrl,login:e.author}),(0,G.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,G.jsx)(`span`,{children:R(e.createdAt)}),t?(0,G.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:r(`rounded-full border px-1.5 py-px font-sans text-[12px] font-medium`,t.tone),children:t.label}):null,(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,G.jsx)(O,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,G.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,G.jsx)(Ze,{children:e.body}):(0,G.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function qt({url:e,login:t}){let[n,r]=(0,W.useState)(!1);return e&&!n?(0,G.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,G.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var X={passing:`✓`,failing:`✗`,pending:`○`},Z={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Jt({count:e}){return e?(0,G.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,G.jsx)(de,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Yt({checks:e,url:t}){let n=r(`text-[11px] font-medium`,Z[e],t&&`hover:underline`),i=`${X[e]} checks ${e}`;return t?(0,G.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:i}):(0,G.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:i})}function Xt({checks:e}){return(0,G.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:r(`shrink-0 font-sans text-[11px] font-semibold`,Z[e]),children:X[e]})}function Zt(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function Qt(e,t=[]){let n=Zt(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=$t(t)),n}function $t(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function en(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function tn(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function Q(e,t,n){let r=(n??``).trim();if(!r)return Qt(e,t);let i=Zt(e),a=r.startsWith(i)?i+en(r.slice(i.length),e):en(r,e),o=tn(a,e)?a:`${i}\n\n${a}`;return t.length?o+$t(t):o}function nn(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 rn(e,t,n,r,i={}){return t?{...i,workflow:t,task:Q(e,n,r)}:n.length?{...i,steps:nn(n),task:Q(e,[],r)}:{...i,workflow:`quick-task`,task:Q(e,[],r)}}function an(e){let t=x(),n=S(),r=p(t.data),i=n.data?.defaultRunner,a=xe(e.runner,r,i??r[0]??`claude`),o=b(a),s=n.data?.modelsLocked===!0,{accounts:c,repoAccount:l}=Ie(),u=c.some(t=>t.provider===a&&t.id===e.account)?e.account:null,d=Oe(s?null:e.model,a,n.data?.defaultModels,o.data),f=Ae(a,d,o.data);return{runner:a,runnerExplicit:e.runner!==null,model:d,effort:s?``:Ve(e.effort,f),effortOptions:f,runners:r,defaultRunner:i,canRun:t.isSuccess&&r.length>0,modelsLocked:s,providerPending:t.isPending,providerError:t.isError,accounts:c,account:u,repoAccount:l}}function on(e){return{runner:we(e.runner,e.defaultRunner,e.runnerExplicit),model:e.modelsLocked?void 0:e.model||void 0,effort:e.modelsLocked?void 0:e.effort||void 0}}function sn(e){return{...on(e),...e.account?{agentProfile:e.account}:{}}}function cn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,W.useRef)(null),o=(0,W.useRef)(null),[s,c]=(0,W.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,W.useLayoutEffect)(()=>{let e=a.current;if(i!==`row`||!e)return;let t=()=>{let t=window.innerWidth<=767||e.getBoundingClientRect().width<550,n=document.activeElement;o.current=n instanceof HTMLElement&&e.contains(n)?n:null,c(t)};t();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[i]),(0,W.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let l=an(e),{runner:u,model:d,effort:f,effortOptions:p,runners:m,canRun:h,modelsLocked:g}=l,_=S(),v=b(u),y=De(u,v.data,[e.model,_.data?.defaultModels?.[u]]),x=n||!h,C=r?l.accounts:[],w=m.length>1||m.some(e=>ze(C,e))?(0,G.jsx)(ke,{icon:(0,G.jsx)(ie,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:m,value:u,accounts:C,account:r?l.account:null,repoAccount:r?l.repoAccount:void 0,disabled:x,onPick:(n,i)=>t(r?{runner:n,account:i,model:n===u?e.model:null,effort:e.effort}:{runner:n,account:null,model:null,effort:e.effort})},`runner`):null,T=(0,G.jsx)(U,{icon:(0,G.jsx)(P,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`model-pill`,ariaLabel:`Model`,label:d===``?`Default`:y.find(e=>e.id===d).label,value:d,disabled:x,readOnly:g===!0,disabledHint:g?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=Ae(u,n,v.data);t({...e,model:n,effort:e.effort===null?null:Ve(e.effort,r)})},options:y.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:He(u,v.data,v.isError,v.isFetching)},`model`),E=(0,G.jsx)(U,{icon:(0,G.jsx)(M,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`effort-pill`,ariaLabel:`Effort`,label:p.find(e=>e.value===f)?.label??`auto`,value:f,disabled:x,readOnly:g===!0,disabledHint:g?`Effort selection is locked to native coding-agent settings.`:void 0,onPick:n=>t({...e,effort:n}),options:p.map(e=>({value:e.value,label:e.label,desc:e.desc}))},`effort`);return i===`row`?(0,G.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,G.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,G.jsx)(Ne,{children:s?[w,E,T]:[w,T,E]})})}):(0,G.jsxs)(Ne,{children:[w,T,E]})}var ln={workflow:null,skills:[]},un=`cez-followup-selection`;function dn(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.filter(e=>typeof e==`string`):[]}}function fn(){try{let e=localStorage.getItem(un);return e?dn(JSON.parse(e)):{...ln}}catch{return{...ln}}}function pn(e){try{localStorage.setItem(un,JSON.stringify(e))}catch{}}var $=`cez-followup-prompt:`;function mn(e){try{return localStorage.getItem($+e)??``}catch{return``}}function hn(e,t){try{t===``?localStorage.removeItem($+e):localStorage.setItem($+e,t)}catch{}}function gn({item:e,workflows:r,skills:i,workflow:a,onWorkflowChange:o,selectedSkills:l,onSkillsChange:u,engine:d,onEngineChange:p,queuedRunId:h,onQueued:g}){let y=c(),b=v(),x=_().data?.capabilities.automations===!0,S=e.kind===`pr`?`PR`:`issue`,C=l.filter(e=>i.some(t=>t.name===e)),[T]=(0,W.useState)(()=>Zt(e)),[E,D]=(0,W.useState)(()=>mn(e.url)||T),O=an(d),k=(0,W.useRef)(null),A=(0,W.useRef)(null);(0,W.useEffect)(()=>{hn(e.url,E===T?``:E)},[e.url,E,T]);let M=(0,W.useMemo)(()=>Me(je(b.data?.promptTemplates),{automations:x}),[b.data?.promptTemplates,x]),ee=e=>{let t=k.current,n=Fe({prompt:E,base:T,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:A.current}),r=Be(E,n,e);D(r.text),A.current=r.caret,requestAnimationFrame(()=>{k.current?.focus(),k.current?.setSelectionRange(r.caret,r.caret)})},N=Pe(M,C),P=(0,W.useRef)(E);P.current=E;let F=(0,W.useRef)(``);(0,W.useEffect)(()=>{let e=Le(P.current,F.current,N,T);F.current=e.applied,e.text!==P.current&&D(e.text)},[N,T]);let I=m({mutationFn:async()=>O.canRun?s(rn(e,a,C,E,sn(O))):null,onSuccess:t=>{if(t===null)return;let n=t;n&&g(e.url,n.id),j(`Added to the queue — ${S} #${e.number}`),C.length>0&&b.data!==void 0&&f({skillUsage:C.reduce((e,t)=>Je(e,t),b.data.skillUsage)}).then(()=>y.invalidateQueries({queryKey:w.uiState})).catch(()=>{}),hn(e.url,``),D(T),F.current=``,y.invalidateQueries({queryKey:w.runs.all})},onError:e=>j(e.message,{tone:`danger`})}),te=e=>{$e({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!I.isPending&&O.canRun&&I.mutate())},ne=e=>u(l.includes(e)?l.filter(t=>t!==e):[...l,e]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,G.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,G.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,G.jsx)(`span`,{children:`Instructions for the agent`}),(0,G.jsx)(et,{ref:k,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:E,onChange:e=>D(e.target.value),onSelect:e=>{A.current=e.currentTarget.selectionStart},onKeyDown:te,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,G.jsx)(ye,{templates:M,onInsert:ee}),(0,G.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,G.jsxs)(`div`,{className:`gh-field`,children:[(0,G.jsx)(`span`,{children:`Workflow`}),(0,G.jsx)(_n,{workflows:r,value:a,onChange:o})]}),(0,G.jsxs)(`div`,{className:`gh-field`,children:[(0,G.jsx)(`span`,{children:`Skills · select one or more`}),(0,G.jsx)(yn,{skills:i,skillUsage:b.data?.skillUsage,selected:C,onToggle:ne})]}),C.length>0?(0,G.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:C.map(e=>(0,G.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>ne(e),title:`Remove this skill`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,G.jsx)(re,{size:16,"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,G.jsx)(cn,{layout:`row`,pick:d,onChange:p,disabled:I.isPending||!O.canRun,accounts:!0}),(0,G.jsxs)(`div`,{className:`gh-field`,children:[(0,G.jsx)(`span`,{children:`Account`}),(0,G.jsx)(vn,{resolved:O,disabled:I.isPending||!O.canRun,onPick:e=>p({...d,account:e})})]}),!O.providerPending&&!O.canRun?(0,G.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[O.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,G.jsx)(V,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,G.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,G.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[t(e.url)?(0,G.jsx)(n,{asChild:!0,variant:`outline`,children:(0,G.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,G.jsxs)(n,{variant:`primary`,"data-action":`gh-run`,disabled:I.isPending||!O.canRun,onClick:()=>I.mutate(),children:[(0,G.jsx)(fe,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,S]}),(0,G.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[11px] font-medium text-muted-foreground`,children:Qe()}),h?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,G.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,G.jsx)(V,{to:`/tasks/${h}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function _n({workflows:e,value:t,onChange:n}){let[i,a]=(0,W.useState)(!1),[o,s]=(0,W.useState)(``),c=(0,W.useRef)(null),l=We(e,o);return(0,G.jsxs)(A,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,G.jsx)(k,{asChild:!0,children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(Re,t&&`border-foreground/60 font-mono text-[11px] font-semibold text-foreground`),children:[(0,G.jsx)(te,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,G.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,G.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,G.jsx)(D,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,G.jsxs)(Te,{shouldFilter:!1,children:[(0,G.jsx)(Ee,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,G.jsxs)(be,{ref:c,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[l.length===0?(0,G.jsx)(Se,{children:`Nothing matches.`}):null,(0,G.jsx)(H,{children:l.map(e=>{let r=t===e.name;return(0,G.jsxs)(Ue,{value:`workflow ${e.name}`,keywords:Ge(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,G.jsx)(L,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function vn({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:Ce,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,desc:e.configDir}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,G.jsx)(U,{icon:(0,G.jsx)(ce,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function yn({skills:e,skillUsage:t,selected:n,onToggle:i}){let[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(``),[l,u]=(0,W.useState)(null),d=(0,W.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=Ye(e,s,t),g=(e,t)=>{let a=n.includes(e.name);return(0,G.jsxs)(Ue,{value:`skill ${e.name} ${e.path}`,keywords:Ge(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":a?`true`:void 0,onSelect:()=>i(e.name),children:[(0,G.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,G.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,G.jsx)(le,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,G.jsx)(L,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e.path)};return e.length===0?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xe,{skill:l,onClose:()=>u(null)}),(0,G.jsxs)(A,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,G.jsx)(k,{asChild:!0,children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:r(Re,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,G.jsx)(oe,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,G.jsx)(se,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,G.jsx)(D,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,G.jsxs)(Te,{shouldFilter:!1,children:[(0,G.jsx)(Ee,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,G.jsxs)(be,{ref:d,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(h?h.length===0:f.length===0&&p.length===0&&m.length===0)?(0,G.jsx)(Se,{children:`Nothing matches.`}):null,h?h.length>0?(0,G.jsx)(H,{children:h.map(e=>g(e,Ke(e)))}):null:(0,G.jsxs)(G.Fragment,{children:[f.length>0?(0,G.jsx)(H,{heading:`Most used`,children:f.map(e=>g(e,Ke(e)))}):null,p.length>0?(0,G.jsx)(H,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,G.jsx)(H,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var bn=new WeakMap;function xn(){let e=fn(),t={workflow:e.workflow,selectedSkills:e.skills,engine:{runner:null,model:null,effort:null,account:null},queued:new Map},n=new Set;return{snapshot:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),update:e=>{t={...t,...e},(e.workflow!==void 0||e.selectedSkills!==void 0)&&pn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function Sn(){let e=c(),{projectId:t}=u(),n=bn.get(e);n||bn.set(e,n=new Map);let r=n.get(t);r||n.set(t,r=xn());let{snapshot:i,subscribe:a,update:o}=r,s=(0,W.useSyncExternalStore)(a,i,i),l=y(),d=C(),f=v(),p=l.data?.workflows;(0,W.useEffect)(()=>{p&&s.workflow!==null&&!p.some(e=>e.name===s.workflow)&&o({workflow:null})},[o,p,s.workflow]);let m=(0,W.useMemo)(()=>qe(d.data??[],f.data?.skillUsage),[d.data,f.data?.skillUsage]);return{...s,workflows:l,skillList:m,setWorkflow:e=>o({workflow:e}),setSelectedSkills:e=>o({selectedSkills:e}),setEngine:e=>o({engine:e}),onQueued:(e,t)=>o({queued:new Map(i().queued).set(e,t)})}}export{Jt as a,Ft as c,J as d,St as f,Xt as i,bt as l,gn as n,jt as o,Qt as r,Ct as s,Sn as t,xt as u};
@@ -1 +0,0 @@
1
- import{Fr as e,Kr as t}from"./project-scope-context-X6-LgbYE.js";function n(n,r){return e(n,t,r)}export{n as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{Gr as n,kr as r}from"./project-scope-context-X6-LgbYE.js";import{i}from"./live-protocol-DjH6ZQwI.js";var a=e(t(),1);function o(e,t){if(!i(e.path))throw Error(`unsupported shared read`);let n=new URL(e.path,`http://cezar.invalid`);return n.searchParams.sort(),r({kind:`read`,path:`${n.pathname}${n.search}`,intervalMs:e.intervalMs},{value:t})}function s(e,t,r,i){let s=n(),c=JSON.stringify(t),l=(0,a.useMemo)(()=>JSON.parse(c),[c]);(0,a.useEffect)(()=>{if(!e||r===!1)return;let t=!0,n=o({path:e,intervalMs:r},(e,n)=>{n||s.cancelQueries({queryKey:l,exact:!0}).then(()=>{t&&s.setQueryData(l,i?i(e,s):e)})});return()=>{t=!1,n()}},[s,e,l,r,i])}function c(e,t){return r({kind:`topic`,topic:e},{value:t})}export{o as n,s as r,c as t};