@wjarka/cezarion 0.18.0-dev.6703 → 0.18.0-dev.6739
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/web/dist/assets/{activity-motion-DhLXb8Pt.js → activity-motion-DMp6Uo_E.js} +1 -1
- package/web/dist/assets/{activity-route-CpwAMYLn.js → activity-route-D04JxCzp.js} +1 -1
- package/web/dist/assets/agent-accounts-C48RdN3o.js +18 -0
- package/web/dist/assets/{commit-diff-panel-B1KZl0GP.js → commit-diff-panel-Din879JP.js} +1 -1
- package/web/dist/assets/{diff-Ci-qd1lU.js → diff-Btt23N3M.js} +2 -2
- package/web/dist/assets/{diff-view-CWZElKoD.js → diff-view-CfWaBIJu.js} +1 -1
- package/web/dist/assets/{file-preview-CoWRr13R.js → file-preview-DcznUbkx.js} +1 -1
- package/web/dist/assets/{git-toolbar-BYIni94R.js → git-toolbar-DUnmDIe8.js} +1 -1
- package/web/dist/assets/github-C6OOf2Jp.js +1 -0
- package/web/dist/assets/{global-activity-route-DLEwsMA7.js → global-activity-route-ko4iBoc3.js} +1 -1
- package/web/dist/assets/index-C3YyGC-J.js +17 -0
- package/web/dist/assets/preview-pane-connected-gIoE5-9m.js +3 -0
- package/web/dist/assets/{prompt-template-menu-BZTz2mIG.js → prompt-template-menu-C3d8Xkvo.js} +1 -1
- package/web/dist/assets/{reference-chip-Ht4xX9-k.js → reference-chip-BliLpdSz.js} +1 -1
- package/web/dist/assets/{repo-git-CzVLCWig.js → repo-git-DGrhzyWR.js} +1 -1
- package/web/dist/assets/{report-reader-iTBkUgg-.js → report-reader-C2yXiPa9.js} +1 -1
- package/web/dist/assets/{reports-BJF1Cl3C.js → reports-mmONzYgk.js} +1 -1
- package/web/dist/assets/{run-header-BxB6gyt1.js → run-header-Cin11tct.js} +1 -1
- package/web/dist/assets/{skills-DvgHKWgK.js → skills-N0vkndca.js} +1 -1
- package/web/dist/assets/{task-changes-CStxhLFG.js → task-changes-BhvqWHW7.js} +1 -1
- package/web/dist/assets/{task-commits-DhpOAdOf.js → task-commits-RGVmBirX.js} +1 -1
- package/web/dist/assets/{task-files-COmKUUfN.js → task-files-B-W_PC8S.js} +1 -1
- package/web/dist/assets/{task-github-item-BNLeAz58.js → task-github-item-csNEiMBa.js} +1 -1
- package/web/dist/assets/task-thread-B23Uq5iQ.js +9 -0
- package/web/dist/assets/thread-state-DeDb0lsY.js +4 -0
- package/web/dist/assets/use-desktop-jIeTPw3K.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-CIysCyMM.js +1 -0
- package/web/dist/assets/{workflows-CN8uKYnY.js → workflows-k0YtC-LB.js} +1 -1
- package/web/dist/index.html +5 -5
- package/web/dist/assets/agent-accounts-Bc0LJ4SB.js +0 -18
- package/web/dist/assets/github-CAPNq5vY.js +0 -1
- package/web/dist/assets/index-CpwAOct4.js +0 -17
- package/web/dist/assets/preview-pane-connected-CGw_9VuF.js +0 -3
- package/web/dist/assets/task-thread-DjSFvEQe.js +0 -9
- package/web/dist/assets/thread-state-B5tTsVNm.js +0 -4
- package/web/dist/assets/use-desktop-BPWIJ0Kw.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-Ce6QW2j_.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-DGwhwRuD.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Ln as o,Mn as s,Rn as c,Un as l,rr as u}from"./project-scope-context-BBVJVcJp.js";import{M as d}from"./live-protocol-aMLJJ0MQ.js";import"./queries-Be8VyHam.js";import{t as f}from"./createLucideIcon-BHp8sXmF.js";import{a as ee,d as p,h as te,i as ne,l as re,m as ie,n as ae,o as oe,p as m,r as se,t as ce,u as h}from"./es2015-DTn4s5Lh.js";import{_ as g,b as le,v as ue,x as _,y as de}from"./dropdown-menu-DPrTX-zi.js";import"./attention-BF8NA1XM.js";function fe(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 pe=f(`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,me]=ie(b,[_]),S=_(),[he,C]=x(b),w=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)(le,{...s,children:(0,y.jsx)(he,{scope:t,contentId:re(),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})})};w.displayName=b;var ge=`PopoverAnchor`,_e=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})});_e.displayName=ge;var ve=`PopoverTrigger`,ye=v.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=C(ve,r),o=S(r),s=n(t,a.triggerRef),c=(0,y.jsx)(te.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":A(a.open),...i,ref:s,onClick:m(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,y.jsx)(g,{asChild:!0,...o,children:c})});ye.displayName=ve;var T=`PopoverPortal`,[be,xe]=x(T,{forceMount:void 0}),Se=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=C(T,t);return(0,y.jsx)(be,{scope:t,forceMount:n,children:(0,y.jsx)(h,{present:n||a.open,children:(0,y.jsx)(ne,{asChild:!0,container:i,children:r})})})};Se.displayName=T;var E=`PopoverContent`,D=v.forwardRef((e,t)=>{let n=xe(E,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=C(E,e.__scopePopover);return(0,y.jsx)(h,{present:r||a.open,children:a.modal?(0,y.jsx)(we,{...i,ref:t}):(0,y.jsx)(Te,{...i,ref:t})})});D.displayName=E;var Ce=t(`PopoverContent.RemoveScroll`),we=v.forwardRef((e,t)=>{let r=C(E,e.__scopePopover),i=v.useRef(null),a=n(t,i),o=v.useRef(!1);return v.useEffect(()=>{let e=i.current;if(e)return ce(e)},[]),(0,y.jsx)(ae,{as:Ce,allowPinchZoom:!0,children:(0,y.jsx)(O,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:m(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:m(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Te=v.forwardRef((e,t)=>{let n=C(E,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(O,{...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()}})}),O=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,f=C(E,n),p=S(n);return se(),(0,y.jsx)(ee,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(oe,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,y.jsx)(de,{"data-state":A(f.open),role:`dialog`,id:f.contentId,...p,...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)`}})})})}),k=`PopoverClose`,Ee=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=C(k,n);return(0,y.jsx)(te.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})});Ee.displayName=k;var De=`PopoverArrow`,Oe=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=S(n);return(0,y.jsx)(ue,{...i,...r,ref:t})});Oe.displayName=De;function A(e){return e?`open`:`closed`}var ke=w,Ae=_e,je=ye,Me=Se,Ne=D,Pe=new Set([`queued`,`running`,`waiting`]);function Fe(e){return Pe.has(e)}function j(e){return u(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function Ie(e){return j(e)&&e.status!==`queued`}function M(e,t,n){return e.archived||!(e.status===`done`||e.status===`failed`||e.status===`cancelled`)||e.delegation?.role===`worker`||n!==void 0&&l(e)!==n?!1:t===`unpinned`?!e.pinned:t!==`pinned`||e.pinned===!0}var Le=[`done`,`failed`];function N(e){return e.archived||u(e)||!Le.includes(e.status)?!1:e.finishedAt!==void 0}function Re(e){let t=e.finishedAt;return t===void 0||!N(e)?!1:e.seenAt===void 0||e.seenAt<t}var P=[`Needs you`,`Finished`,`Working`,`Archived`],ze={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},Be=3,F=e=>u(e)?Be:ze[e.status]??9;function Ve(e){let t=e=>s[o(e).bucket];return[...e].sort((e,n)=>t(e)-t(n)||F(e)-F(n))[0]}function He(e,t){return t===`archived`?`Archived`:c(e)?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function I(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function L(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 Ue(e,t){return t!==void 0&&L(e).ref===t}function R(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 We(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=F(e)-F(n);if(r!==0)return r;if(u(e)&&u(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 z(e){return e.delegation?.role===`worker`}function Ge(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!z(n)?e:n.delegation?.parentRunId??e}function Ke(e,t,n=R(e)){let r=We(e,t).filter(e=>!z(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(He(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return P.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function qe(e,t={}){let n=typeof t==`number`?{overall:t}:d(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 Je(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 Ye(e){let t=0,n=0,r=0;for(let i of e)if(!z(i)){if(i.archived){n+=1;continue}t+=1,c(i)&&(r+=1)}return{active:t,archived:n,waiting:r}}function Xe(e,t){let n=t===`automations`;return e.filter(e=>!e.archived&&l(e)===n)}var B={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},V=Object.keys(B),Ze=`section`;function Qe(e,t){return`/?origin=${t===`automations`?`automations`:`direct`}&${Ze}=${B[e]}`}function $e(e){return V.find(t=>B[t]===e)??null}function et(e){let t={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let n of e){if(z(n)||n.archived)continue;let e=+!!c(n);l(n)?(t.automations+=1,t.automationsWaiting+=e):(t.active+=1,t.activeWaiting+=e)}return t}function H(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function tt(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=H(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(H(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function nt(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:H(e)}:{top:0,bottom:0}}function rt(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 it(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(nt(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function at(){let[e,t]=(0,v.useState)({top:0,bottom:0});return(0,v.useEffect)(()=>it(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function ot(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=document.documentElement;return tt(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var st=new Set([``,`text`,`search`,`email`,`url`,`tel`,`password`,`number`]);function ct(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.tagName?.toUpperCase();return n===`TEXTAREA`?!0:n===`INPUT`?st.has((t.type??``).toLowerCase()):t.isContentEditable===!0}var U=new WeakMap;function lt(e){let t=U.get(e),n=t&&t.width===e.innerWidth?Math.max(t.height,e.innerHeight):e.innerHeight;return U.set(e,{width:e.innerWidth,height:n}),n-e.innerHeight}function ut(e){let t=lt(e),n=e.visualViewport?.scale??1;return Math.abs(n-1)<.05&&H(e)>80||t>80&&ct(e.document?.activeElement)}function dt(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=window,n=()=>t(ut(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 ft(e){let t=/\/(\d+)\/?$/.exec(e.trim()),n=t?Number(t[1]):NaN;return Number.isInteger(n)&&n>0?n:null}function pt(e){let t=new Set;for(let n of[e.pullRequestUrl,e.referencedPullRequestUrl,e.referencedIssueUrl]){let e=n?ft(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 mt=[{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:pt},{id:`shownReferences`,kind:`reference`,scopes:[`shown`],source:`reader`,numbers:(e,t)=>t.references?.()??[]}];function ht(e){return e.trim().toLowerCase().split(/\s+/).filter(e=>e!==``)}function gt(e,t){return t&&e.automationId!==void 0?t.get(e.automationId)??e.automationId:void 0}function _t(e,t){let n=t.scope??`stored`,r=t.scope===`shown`?t.extras:{automation:gt(e,t.automationNames)},i=[],a=[],o=[],s={text:i,identifier:a,link:o},c=[];for(let t of mt)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 W(e,t,n={}){let r=ht(t);if(r.length===0)return!1;let{prose:i,ids:a,links:o,references:s}=_t(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 vt=new Set([`running`,`waiting`]);function G(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 yt(e){return e===void 0?``:`$${e>=10?e.toFixed(0):e.toFixed(2)}`}function bt(e,t=new Date){if(!u(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 xt(e){return e.steps?fe({workflow:e.workflow,steps:e.steps}):e.workflowLabel??e.workflow}function St(e,t,n=()=>``){let r=e.filter(e=>!z(e));return t.trim()?r.filter(e=>W(e,t,{scope:`shown`,extras:{displayTitle:I(e),automation:n(e),references:()=>K(e)}})):[...r]}function K(e){return Y(e).map(e=>e.number)}function q(e,t){return e.filter(e=>M(e,t)).length}function Ct(e){return q(e)}function wt(e){return J(e)[0]??e.pullRequests?.find(e=>e.url)?.url}function J(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 Tt(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.issueNumber??e.markerRefs?.issue;if(!(!n||!t))return`${t}/issues/${n}`}function Et(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 Y(e,t,n=e.projectId){let r=J(e),i=e.markerRefs?.pr,a=[...i===void 0||[...r,...(e.pullRequests??[]).flatMap(e=>e.url?[e.url]:[])].some(e=>Z(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:Tt(e,t)},{kind:`Issue`,number:e.issueNumber}],o=new Set,s=[];for(let e of a){let r=e.url?Number(Z(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??Dt(e.kind,r,t),a={kind:e.kind,number:r,...i?{url:i}:n===void 0?{}:{projectId:n}},c=Et(a);o.has(c)||(o.add(c),s.push(a))}return s}function Dt(e,t,n){if(n)return`${n}/${e===`PR`?`pull`:`issues`}/${t}`}function Ot(e){return Y(e)[0]}function X(e,t){if(!e.url)return!0;if(!t)return!1;let n=kt(t);return n!==void 0&&kt(e.url)===n}function kt(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 At(e,t){let n=[];for(let r of Y(e,t)){if(!X(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 jt(e,t,n,r){if(X(n,r))return`/p/${e}/tasks/${t}/${n.kind===`PR`?`pr`:`issue`}/${n.number}`}function Z(e){return/\/(\d+)\/?(?:[?#].*)?$/.exec(e)?.[1]??null}function Mt(e,t){let n=vt.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:G(n.rssBytes),kind:`live`}};let r=G(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 Q=v.createContext(null);function Nt({...e}){let t=v.useRef(!1);return(0,y.jsx)(Q,{value:t,children:(0,y.jsx)(ke,{"data-slot":`popover`,...e})})}function Pt({onPointerDownCapture:e,onKeyDownCapture:t,...n}){let r=v.useContext(Q);return(0,y.jsx)(je,{"data-slot":`popover-trigger`,...n,onPointerDownCapture:t=>{r&&(r.current=t.pointerType===`touch`),e?.(t)},onKeyDownCapture:e=>{r&&(r.current=!1),t?.(e)}})}function Ft({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:i,onOpenAutoFocus:a,...o}){let s=at(),c=v.useContext(Q);return(0,y.jsx)(Me,{children:(0,y.jsx)(Ne,{"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:rt(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 It({...e}){return(0,y.jsx)(Ae,{"data-slot":`popover-anchor`,...e})}var $=`(min-width: 48rem)`;function Lt(){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($),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}export{V as A,Qe as B,Mt as C,dt as D,ot as E,Ve as F,Je as G,et as H,$e as I,Fe as J,N as K,R as L,Ke as M,z as N,P as O,Ye as P,pe as Q,Ue as R,Y as S,W as T,Xe as U,Ge as V,L as W,M as X,Ie as Y,Re as Z,Tt as _,Ft as a,wt as b,Ct as c,X as d,Z as f,q as g,K as h,It as i,qe as j,Ze as k,yt as l,bt as m,Lt as n,Pt as o,Et as p,j as q,Nt as r,St as s,$ as t,G as u,jt as v,xt as w,Ot as x,At as y,I 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-DGwhwRuD.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{C as o,Ur as s,en as c,nt as l,r as u,rt as d,yr as f,zt as p}from"./project-scope-context-BBVJVcJp.js";import{$ as m,At as h,Lt as g,M as _,Nt as v,O as y,P as b,Qt as x,h as S,n as C,nt as w,wt as T}from"./queries-Be8VyHam.js";import{t as E}from"./useQuery-C1xFF0nd.js";import{Q as D,a as O,o as k,r as A}from"./use-desktop-BPWIJ0Kw.js";import{n as j}from"./toaster-CoMJoQvk.js";import{A as M,Z as ee,_ as N,b as P,ct as F,d as I,ft as te,h as L,l as R,mt as ne,ot as re,r as ie,rt as ae,u as oe,ut as se}from"./design-icons-DmYTv2r1.js";import{t as ce}from"./eye-B8okNWXU.js";import{a as le,i as z}from"./format-BNCkW110.js";import{t as ue}from"./message-square-B-MD-8rD.js";import{t as de}from"./play-CmVAj_fu.js";import{a as fe,i as pe,o as me,r as he,s as ge,t as _e}from"./dialog-B7p5oc5r.js";import{d as B,t as ve,y as V}from"./prompt-template-menu-BZTz2mIG.js";import{t as H}from"./project-router-oKsNlPN6.js";import{B as ye,E as be,I as xe,L as U,M as Se,O as Ce,P as we,R as Te,S as Ee,T as De,a as Oe,b as ke,f as Ae,h as je,i as Me,l as Ne,m as Pe,n as Fe,p as Ie,r as W,s as Le,t as Re,u as ze,w as Be,x as Ve,z as He}from"./agent-accounts-Bc0LJ4SB.js";import{d as Ue,f as We,i as Ge,s as Ke,t as qe,u as Je}from"./skills-DFBiAuJG.js";import{$ as Ye,F as Xe,L as Ze,X as Qe,Y as $e,pn as et}from"./index-CpwAOct4.js";import{t as tt}from"./diff-Ci-qd1lU.js";import{t as nt}from"./tab-link-Buy1fRFO.js";var G=e(i(),1),K=a(),rt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function q({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,K.jsx)(R,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:r(t,`text-success`)}):e===`failing`?(0,K.jsx)(N,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:r(t,`text-danger`)}):e===`pending`?(0,K.jsx)(le,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:r(t,`animate-spin text-warning`)}):(0,K.jsx)(L,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:r(t,`text-soft-foreground`)})}function it(e){return e?.available?e.mergeState:null}function at(e,t){return e&&t?.methods.includes(e)?e:t?.defaultMethod??t?.methods[0]??null}function ot(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 st(e){return e===`approved`||e===`not-required`?`passing`:e===`unknown`?`unknown`:`failing`}function ct(e){return e===`mergeable`?`passing`:e===`conflicting`?`failing`:`unknown`}function lt(e){return e===`conflicting`?`present`:e===`mergeable`?`none`:`unknown`}function ut(e){return e===!0?` · required`:e===null?` · requiredness unknown`:``}function dt(e){return e?.available===!1?e.reason:`GitHub could not load merge requirements.`}function ft(e,t,n){return!!(e&&(t.canMerge||t.canOverride&&n))}function J(e){return e?rt[e]:`Merge`}function pt(e){return e===`conflicting`?`true`:void 0}function mt({check:e}){return(0,K.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(q,{state:e.state}),(0,K.jsxs)(`span`,{children:[e.name,` · `,e.state,ut(e.required)]})]}),e.url&&t(e.url)?(0,K.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]})}function ht({reason:e}){return(0,K.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,K.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:e})]})}function gt({state:e,selectedMethod:t,overrideRules:i,mergeEnabled:a,refreshPending:o,onRefresh:s,onRunAgent:c,onConfirm:l,onMethodChange:u,onOverrideChange:d}){let f=ot(e),p=st(e.reviewDecision),m=ct(e.mergeable);return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e.canMerge?(0,K.jsx)(R,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,K.jsx)(F,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`h3`,{className:`font-semibold`,children:f}),(0,K.jsxs)(n,{type:`button`,variant:`ghost`,size:`sm`,disabled:o,onClick:s,children:[(0,K.jsx)(ee,{size:16,"aria-hidden":`true`,className:r(`size-3.5`,o&&`animate-spin`)}),`Refresh`]})]}),(0,K.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[e.headRef,` (`,e.headSha.slice(0,7),`) → `,e.baseRef]}),(0,K.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(q,{state:p}),(0,K.jsxs)(`span`,{children:[`Reviews: `,e.reviewDecision.replaceAll(`-`,` `)]})]}),(0,K.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(q,{state:m}),(0,K.jsxs)(`span`,{children:[`Conflicts: `,lt(e.mergeable)]})]}),e.checks.length===0?(0,K.jsx)(`li`,{children:`No checks configured`}):e.checks.map(e=>(0,K.jsx)(mt,{check:e},e.name)),e.blockers.map(e=>(0,K.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),e.mergeable===`conflicting`&&c?(0,K.jsx)(n,{className:`mt-4`,onClick:c,children:`Run agent on this PR`}):null,e.canOverride?(0,K.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,K.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>d(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,K.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,K.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,K.jsxs)(`div`,{className:`mt-4 flex flex-col flex-wrap gap-2 sm:flex-row`,children:[(0,K.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,K.jsx)(`option`,{value:e,children:rt[e]},e))}),(0,K.jsx)(n,{disabled:!a,onClick:l,children:J(t)})]}):null]})]})}function _t({number:e,state:t,selectedMethod:r,confirming:i,overrideRules:a,mergePending:o,mergeError:s,onOpenChange:c,onMerge:l}){return(0,K.jsx)(_e,{open:i,onOpenChange:c,children:(0,K.jsxs)(he,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,K.jsxs)(me,{children:[(0,K.jsxs)(ge,{children:[J(r),` pull request #`,e,`?`]}),(0,K.jsx)(pe,{asChild:!0,children:(0,K.jsxs)(`div`,{children:[(0,K.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,K.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,K.jsx)(`p`,{className:`text-sm text-danger`,children:s.message}):null,(0,K.jsxs)(fe,{children:[(0,K.jsx)(n,{variant:`outline`,disabled:o,onClick:()=>c(!1),children:`Cancel`}),(0,K.jsx)(n,{disabled:o,onClick:l,children:o?`Merging…`:J(r)})]})]})})}function vt({number:e,onRunAgent:t}){let n=s(),r=w(),i=E({queryKey:C.githubMergeState(e),queryFn:({signal:t})=>d(e,{},{signal:t}),retry:!1}),a=it(i.data),[o,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(!1),[f,m]=(0,G.useState)(!1),h=x({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`})}),g=at(o,a),_=()=>({mergeState:C.githubMergeState(e),list:C.githubPages(50),comments:C.githubComments(`pr`,e),item:C.githubItem(`pr`,e),refStatus:r===void 0?void 0:C.githubRefStatusOf(r)}),v=x({mutationFn:t=>{if(!a||!g)throw Error(`No merge method is available.`);return p(e,{method:g,expectedHeadSha:a.headSha,...f&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:(t,r)=>{u(!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,K.jsx)(V,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`}):a?(0,K.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":a.eligibility,"data-conflicting":pt(a.mergeable),"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,K.jsx)(gt,{state:a,selectedMethod:g,overrideRules:f,mergeEnabled:ft(g,a,f),refreshPending:h.isPending,onRefresh:()=>h.mutate(C.githubMergeState(e)),onRunAgent:t,onConfirm:()=>u(!0),onMethodChange:c,onOverrideChange:m}),(0,K.jsx)(_t,{number:e,state:a,selectedMethod:g,confirming:l,overrideRules:f,mergePending:v.isPending,mergeError:v.error,onOpenChange:u,onMerge:()=>v.mutate(_())})]}):(0,K.jsx)(ht,{reason:dt(i.data)})}function yt(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 bt(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 xt(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 Y(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 St({label:e,color:t,plain:n=!1}){return(0,K.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:Y(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 Ct(e){return e===`pr`?`pull request`:`issue`}function wt(e,t,n){return e===`pr`&&!!(t||n)}function Tt({backLink:e}){return e?(0,K.jsxs)(H,{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,K.jsx)(ie,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}):null}function Et({item:e,kindWord:n,commentCount:r,hasDiffStat:i,additions:a,deletions:o}){return(0,K.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,K.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,K.jsx)(`span`,{children:n}),`·`,(0,K.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,K.jsxs)(`span`,{children:[z(e.createdAt),` ago`]}),r?(0,K.jsxs)(K.Fragment,{children:[`·`,(0,K.jsx)(qt,{count:r})]}):null,i?(0,K.jsxs)(K.Fragment,{children:[`·`,(0,K.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,K.jsxs)(`span`,{className:`text-success`,children:[`+`,a??0]}),` `,(0,K.jsxs)(`span`,{className:`text-danger`,children:[`−`,o??0]})]})]}):null,`·`,t(e.url)?(0,K.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,K.jsx)(D,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,K.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]})}function Dt({item:e,subNav:t,changes:n}){return e.kind===`pr`?t?(0,K.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,K.jsx)(nt,{to:B(`prs`,t.filter,e.number),active:!n,children:`Conversation`}),(0,K.jsx)(nt,{to:B(`prs`,t.filter,e.number,`/changes`),active:n,children:`Changes`})]}):(0,K.jsx)(H,{to:B(`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 Ot({item:e,colors:t,checks:n}){return e.labels.length>0||n?(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,K.jsx)(St,{label:e,color:t[e]},e)),n?(0,K.jsx)(Jt,{checks:n,url:e.url}):null]}):null}function kt({item:e,colors:t,body:n}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:n?(0,K.jsx)(Ze,{children:n}):(0,K.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,K.jsx)(Mt,{item:e,colors:t})]})}function At({item:e,colors:t,checks:n,comments:r,backLink:i,subNav:a,onRunAgent:o,afterHeading:s,children:c}){let l=a?.changes??!1,u=Ct(e.kind),d=y(e.kind,e.number,!l).data?.detail,f=d?.body??e.body,p=d?.additions??e.additions,m=d?.deletions??e.deletions,h=wt(e.kind,p,m),g=r??e.comments;return(0,K.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,K.jsx)(Tt,{backLink:i}),(0,K.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,K.jsxs)(`h2`,{className:`mb-4 text-[22px] leading-snug font-normal`,children:[`#`,e.number,` `,e.title]}):null,(0,K.jsx)(Et,{item:e,kindWord:u,commentCount:g,hasDiffStat:h,additions:p,deletions:m}),e.kind===`pr`?null:(0,K.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-normal`,children:e.title}),s,(0,K.jsx)(Dt,{item:e,subNav:a,changes:l}),(0,K.jsx)(Ot,{item:e,colors:t,checks:n}),l&&e.kind===`pr`?(0,K.jsx)(jt,{item:e}):(0,K.jsx)(kt,{item:e,colors:t,body:f})]}),e.kind===`pr`?(0,K.jsx)(vt,{number:e.number,onRunAgent:o}):null,c]})}function jt({item:e}){let i=s(),a=_(e.number),[o,c]=(0,G.useState)(``),[u,d]=(0,G.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,G.useEffect)(()=>{p.length>0&&!p.some(e=>e.path===u)&&d(p[0].path)},[f?.available?f.headSha:``,o]);let h=async()=>{let t=f?.available?f.headSha:null,n=C.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,K.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(a.isError||!f)return(0,K.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!f.available)return(0,K.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:f.reason});let g=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,K.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsxs)(`strong`,{children:[f.files.length,` changed files`]}),(0,K.jsxs)(`span`,{className:`text-success`,children:[`+`,f.additions]}),(0,K.jsxs)(`span`,{className:`text-danger`,children:[`−`,f.deletions]}),(0,K.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:f.headSha,children:[`head `,f.headSha.slice(0,8)]}),(0,K.jsx)(n,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void h(),children:`Refresh`})]}),f.truncated?(0,K.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,K.jsx)(`a`,{href:v,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,K.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,K.jsxs)(`aside`,{className:`min-w-0`,children:[(0,K.jsx)(`input`,{"aria-label":`Filter changed files`,value:o,onChange:e=>c(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,K.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,K.jsx)(`option`,{children:e.path},e.path))}),(0,K.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:p.map(e=>(0,K.jsx)(`li`,{children:(0,K.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,K.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,K.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,K.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,K.jsx)(et,{})}),(0,K.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,K.jsx)(I,{size:16})})]}),p.length===0?(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(tt,{files:g.filter(e=>e.path===u),wrap:!0,className:`min-w-0`}),y&&!y.patch?(0,K.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,y.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Mt({item:e,colors:t}){let n=y(e.kind,e.number),r=n.data,i=(0,G.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(Nt(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,K.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,K.jsx)(V,{className:`mb-3 h-3 w-24`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsx)(V,{className:`h-14 w-full`}),(0,K.jsx)(V,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,K.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,K.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,K.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,K.jsx)(D,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,K.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,K.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,K.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Pt(i).map(e=>e.group===`commits`?(0,K.jsx)(Ft,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,K.jsx)(Gt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,K.jsx)(It,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,K.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,K.jsx)(D,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Nt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Pt(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 Ft({commits:e,colors:t}){let[n,r]=(0,G.useState)(!1),i=e[0]?.actor??`?`;return n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,K.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,K.jsx)(`span`,{"aria-hidden":`true`,children:X.committed}),(0,K.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,K.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,K.jsx)(It,{event:e,colors:t},e.id))]}):(0,K.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,K.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,K.jsx)(`span`,{"aria-hidden":`true`,children:X.committed}),(0,K.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,K.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,K.jsx)(`span`,{className:`shrink-0`,children:z(e[e.length-1].createdAt)})]})})}var X={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function It({event:e,colors:t}){return(0,K.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,K.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:X[e.kind]}),(0,K.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,K.jsx)(Ht,{event:e,colors:t}),(0,K.jsx)(`span`,{className:`shrink-0`,children:z(e.createdAt)}),e.url?(0,K.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,K.jsx)(D,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Lt({event:e}){return(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,K.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,K.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,K.jsx)(Ut,{checks:e.checks})]})}function Rt({event:e,colors:t}){return(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,K.jsx)(`span`,{"data-slot":`gh-event-label`,style:Y(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,K.jsx)(`span`,{className:`shrink-0`,children:`label`})]})}function zt({event:e}){return(0,K.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]})}function Bt({event:e}){return(0,K.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}var Vt={committed:e=>(0,K.jsx)(Lt,{event:e}),labeled:(e,t)=>(0,K.jsx)(Rt,{event:e,colors:t}),unlabeled:(e,t)=>(0,K.jsx)(Rt,{event:e,colors:t}),assigned:e=>(0,K.jsx)(zt,{event:e}),unassigned:e=>(0,K.jsx)(zt,{event:e}),merged:()=>(0,K.jsx)(`span`,{children:`merged this`}),closed:()=>(0,K.jsx)(`span`,{children:`closed this`}),reopened:()=>(0,K.jsx)(`span`,{children:`reopened this`}),head_ref_force_pushed:()=>(0,K.jsx)(`span`,{children:`force-pushed`}),renamed:e=>(0,K.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]}),"cross-referenced":e=>(0,K.jsx)(Bt,{event:e})};function Ht({event:e,colors:t}){return Vt[e.kind]?.(e,t)??null}function Ut({checks:e}){return e?(0,K.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:r(`shrink-0`,Q[e]),children:Z[e]}):null}var Wt={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 Gt({comment:e}){let t=e.reviewState?Wt[e.reviewState]:null;return(0,K.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,K.jsx)(Kt,{url:e.avatarUrl,login:e.author}),(0,K.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,K.jsx)(`span`,{children:z(e.createdAt)}),t?(0,K.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,K.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,K.jsx)(D,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,K.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,K.jsx)(Ze,{children:e.body}):(0,K.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function Kt({url:e,login:t}){let[n,r]=(0,G.useState)(!1);return e&&!n?(0,K.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,K.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 Z={passing:`✓`,failing:`✗`,pending:`○`},Q={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function qt({count:e}){return e?(0,K.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,K.jsx)(ue,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Jt({checks:e,url:t}){let n=r(`text-[11px] font-medium`,Q[e],t&&`hover:underline`),i=`${Z[e]} checks ${e}`;return t?(0,K.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:i}):(0,K.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:i})}function Yt({checks:e}){return(0,K.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`,Q[e]),children:Z[e]})}function $(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function Xt(e,t=[]){let n=$(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=Zt(t)),n}function Zt(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function Qt(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 $t(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 en(e,t,n){let r=(n??``).trim();if(!r)return Xt(e,t);let i=$(e),a=r.startsWith(i)?i+Qt(r.slice(i.length),e):Qt(r,e),o=$t(a,e)?a:`${i}\n\n${a}`;return t.length?o+Zt(t):o}function tn(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 nn(e,t,n,r,i={}){return t?{...i,workflow:t,task:en(e,n,r)}:n.length?{...i,steps:tn(n),task:en(e,[],r)}:{...i,workflow:`quick-task`,task:en(e,[],r)}}function rn(e){let t=m(),n=S(),r=f(t.data),i=n.data?.defaultRunner,a=be(e.runner,r,i??r[0]??`claude`),o=T(a),s=n.data?.modelsLocked===!0,{accounts:c,repoAccount:l}=Fe(),u=c.some(t=>t.provider===a&&t.id===e.account)?e.account:null,d=De(s?null:e.model,a,n.data?.defaultModels,o.data),p=ke(a,d,o.data);return{runner:a,runnerExplicit:e.runner!==null,model:d,effort:s?``:Be(e.effort,p),effortOptions:p,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 an(e){return{runner:Ce(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 on(e){return{...an(e),...e.account?{agentProfile:e.account}:{}}}function sn({pick:e,onChange:t,disabled:n=!1,accounts:r=!1,layout:i}){let a=(0,G.useRef)(null),o=(0,G.useRef)(null),[s,c]=(0,G.useState)(()=>typeof window<`u`&&window.innerWidth<=767);(0,G.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,G.useLayoutEffect)(()=>{let e=o.current;o.current=null,e&&e.isConnected&&document.activeElement!==e&&e.focus()},[s]);let l=rn(e),{runner:u,model:d,effort:f,effortOptions:p,runners:m,canRun:h,modelsLocked:g}=l,_=S(),v=T(u),y=Ee(u,v.data,[e.model,_.data?.defaultModels?.[u]]),b=n||!h,x=r?l.accounts:[],C=m.length>1||m.some(e=>Re(x,e))?(0,K.jsx)(Oe,{icon:(0,K.jsx)(re,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:m,value:u,accounts:x,account:r?l.account:null,repoAccount:r?l.repoAccount:void 0,disabled:b,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,w=(0,K.jsx)(W,{icon:(0,K.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:b,readOnly:g===!0,disabledHint:g?`Model selection is locked to native coding-agent settings.`:void 0,onPick:n=>{let r=ke(u,n,v.data);t({...e,model:n,effort:e.effort===null?null:Be(e.effort,r)})},options:y.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:Ve(u,v.data,v.isError,v.isFetching)},`model`),E=(0,K.jsx)(W,{icon:(0,K.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:b,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,K.jsx)(`div`,{ref:a,"data-slot":`engine-row-box`,children:(0,K.jsx)(`div`,{"data-slot":`engine-row`,className:`engine-row`,role:`group`,"aria-label":`Agent settings`,children:(0,K.jsx)(Me,{children:s?[C,E,w]:[C,w,E]})})}):(0,K.jsxs)(Me,{children:[C,w,E]})}var cn={workflow:null,skills:[]},ln=`cez-followup-selection`;function un(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 dn(){try{let e=localStorage.getItem(ln);return e?un(JSON.parse(e)):{...cn}}catch{return{...cn}}}function fn(e){try{localStorage.setItem(ln,JSON.stringify(e))}catch{}}var pn=`cez-followup-prompt:`;function mn(e){try{return localStorage.getItem(pn+e)??``}catch{return``}}function hn(e,t){try{t===``?localStorage.removeItem(pn+e):localStorage.setItem(pn+e,t)}catch{}}function gn({item:e,workflows:r,skills:i,workflow:a,onWorkflowChange:l,selectedSkills:u,onSkillsChange:d,engine:f,onEngineChange:p,queuedRunId:m,onQueued:h}){let g=s(),_=v(),y=b().data?.capabilities.automations===!0,S=e.kind===`pr`?`PR`:`issue`,w=u.filter(e=>i.some(t=>t.name===e)),[T]=(0,G.useState)(()=>$(e)),[E,D]=(0,G.useState)(()=>mn(e.url)||T),O=rn(f),k=(0,G.useRef)(null),A=(0,G.useRef)(null);(0,G.useEffect)(()=>{hn(e.url,E===T?``:E)},[e.url,E,T]);let M=(0,G.useMemo)(()=>je(Ae(_.data?.promptTemplates),{automations:y}),[_.data?.promptTemplates,y]),ee=e=>{let t=k.current,n=Pe({prompt:E,base:T,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:A.current}),r=ze(E,n,e);D(r.text),A.current=r.caret,requestAnimationFrame(()=>{k.current?.focus(),k.current?.setSelectionRange(r.caret,r.caret)})},N=Ne(M,w),P=(0,G.useRef)(E);P.current=E;let F=(0,G.useRef)(``);(0,G.useEffect)(()=>{let e=Ie(P.current,F.current,N,T);F.current=e.applied,e.text!==P.current&&D(e.text)},[N,T]);let I=x({mutationFn:async()=>O.canRun?o(nn(e,a,w,E,on(O))):null,onSuccess:t=>{if(t===null)return;let n=t;n&&h(e.url,n.id),j(`Added to the queue — ${S} #${e.number}`),w.length>0&&_.data!==void 0&&c({skillUsage:w.reduce((e,t)=>qe(e,t),_.data.skillUsage)}).then(()=>g.invalidateQueries({queryKey:C.uiState})).catch(()=>{}),hn(e.url,``),D(T),F.current=``,g.invalidateQueries({queryKey:C.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())},L=e=>d(u.includes(e)?u.filter(t=>t!==e):[...u,e]);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,K.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,K.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,K.jsx)(`span`,{children:`Instructions for the agent`}),(0,K.jsx)(Ye,{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,K.jsx)(ve,{templates:M,onInsert:ee}),(0,K.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,K.jsxs)(`div`,{className:`gh-field`,children:[(0,K.jsx)(`span`,{children:`Workflow`}),(0,K.jsx)(_n,{workflows:r,value:a,onChange:l})]}),(0,K.jsxs)(`div`,{className:`gh-field`,children:[(0,K.jsx)(`span`,{children:`Skills · select one or more`}),(0,K.jsx)(yn,{skills:i,skillUsage:_.data?.skillUsage,selected:w,onToggle:L})]}),w.length>0?(0,K.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:w.map(e=>(0,K.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>L(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,K.jsx)(ne,{size:16,"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,K.jsx)(sn,{layout:`row`,pick:f,onChange:p,disabled:I.isPending||!O.canRun,accounts:!0}),(0,K.jsxs)(`div`,{className:`gh-field`,children:[(0,K.jsx)(`span`,{children:`Account`}),(0,K.jsx)(vn,{resolved:O,disabled:I.isPending||!O.canRun,onPick:e=>p({...f,account:e})})]}),!O.providerPending&&!O.canRun?(0,K.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,K.jsx)(H,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,K.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,K.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[t(e.url)?(0,K.jsx)(n,{asChild:!0,variant:`outline`,children:(0,K.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,K.jsxs)(n,{variant:`primary`,"data-action":`gh-run`,disabled:I.isPending||!O.canRun,onClick:()=>I.mutate(),children:[(0,K.jsx)(de,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,S]}),(0,K.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()}),m?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,K.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,K.jsx)(H,{to:`/tasks/${m}`,"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,G.useState)(!1),[o,s]=(0,G.useState)(``),c=(0,G.useRef)(null),l=Ue(e,o);return(0,K.jsxs)(A,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,K.jsx)(k,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:r(Le,t&&`border-foreground/60 font-mono text-[11px] font-semibold text-foreground`),children:[(0,K.jsx)(te,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,K.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,K.jsx)(oe,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,K.jsx)(O,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,K.jsxs)(we,{shouldFilter:!1,children:[(0,K.jsx)(Te,{placeholder:`search workflows…`,value:o,onValueChange:s,onInput:()=>c.current?.scrollTo(0,0)}),(0,K.jsxs)(ye,{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,K.jsx)(xe,{children:`Nothing matches.`}):null,(0,K.jsx)(U,{children:l.map(e=>{let r=t===e.name;return(0,K.jsxs)(He,{value:`workflow ${e.name}`,keywords:We(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),a(!1)},children:[(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,K.jsx)(R,{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:Se,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,desc:e.configDir}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,K.jsx)(W,{icon:(0,K.jsx)(se,{"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,G.useState)(!1),[s,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(null),d=(0,G.useRef)(null),{mostUsed:f,project:p,global:m,ranked:h}=Je(e,s,t),g=(e,t)=>{let a=n.includes(e.name);return(0,K.jsxs)(He,{value:`skill ${e.name} ${e.path}`,keywords:We(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,K.jsx)(`span`,{className:r(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,K.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,K.jsx)(ce,{"aria-hidden":`true`,className:`size-3.5`})}),a?(0,K.jsx)(R,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e.path)};return e.length===0?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Xe,{skill:l,onClose:()=>u(null)}),(0,K.jsxs)(A,{open:a,onOpenChange:e=>{o(e),e||c(``)},children:[(0,K.jsx)(k,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:r(Le,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,K.jsx)(ae,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,K.jsx)(oe,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,K.jsx)(O,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,K.jsxs)(we,{shouldFilter:!1,children:[(0,K.jsx)(Te,{placeholder:`search skills…`,value:s,onValueChange:c,onInput:()=>d.current?.scrollTo(0,0)}),(0,K.jsxs)(ye,{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,K.jsx)(xe,{children:`Nothing matches.`}):null,h?h.length>0?(0,K.jsx)(U,{children:h.map(e=>g(e,Ge(e)))}):null:(0,K.jsxs)(K.Fragment,{children:[f.length>0?(0,K.jsx)(U,{heading:`Most used`,children:f.map(e=>g(e,Ge(e)))}):null,p.length>0?(0,K.jsx)(U,{heading:`Project skills`,children:p.map(e=>g(e,!0))}):null,m.length>0?(0,K.jsx)(U,{heading:`Global`,children:m.map(e=>g(e,!1))}):null]})]})]})})]})]})}var bn=new WeakMap;function xn(){let e=dn(),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)&&fn({workflow:t.workflow,skills:[...t.selectedSkills]}),n.forEach(e=>e())}}}function Sn(){let e=s(),{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,c=(0,G.useSyncExternalStore)(a,i,i),l=g(),d=h(),f=v(),p=l.data?.workflows;(0,G.useEffect)(()=>{p&&c.workflow!==null&&!p.some(e=>e.name===c.workflow)&&o({workflow:null})},[o,p,c.workflow]);let m=(0,G.useMemo)(()=>Ke(d.data??[],f.data?.skillUsage),[d.data,f.data?.skillUsage]);return{...c,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{qt as a,Pt as c,Y as d,xt as f,Yt as i,yt as l,gn as n,At as o,Xt as r,St as s,Sn as t,bt as u};
|