@wjarka/cezarion 0.18.0-dev.8134 → 0.18.0-dev.8145
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/accounts-section-CZzEOP8R.js +1 -0
- package/web/dist/assets/{activity-motion-D80Uv4-Z.js → activity-motion-Jmq2_2yL.js} +1 -1
- package/web/dist/assets/{activity-route-DVT8IWTR.js → activity-route-SFwjSBCp.js} +1 -1
- package/web/dist/assets/{agent-config-section-BbwkJunW.js → agent-config-section-BumcXk5K.js} +2 -2
- package/web/dist/assets/agent-defaults-section-VUhgYmuN.js +1 -0
- package/web/dist/assets/{appearance-B6YBsmTo.js → appearance-CpDAS_Ul.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-Bx1bEmI8.js → archive-on-merge-field-DlkEGuaI.js} +1 -1
- package/web/dist/assets/automations-route-BwDLBy9v.js +1 -0
- package/web/dist/assets/{commit-diff-panel-DKUnniap.js → commit-diff-panel-DE6af9SI.js} +1 -1
- package/web/dist/assets/diff-DKigJrIK.js +3 -0
- package/web/dist/assets/{diff-view-D_bjQyDl.js → diff-view-BV41OEIW.js} +1 -1
- package/web/dist/assets/{file-preview-glEH09z8.js → file-preview-CXXKcpBz.js} +1 -1
- package/web/dist/assets/{folder-browser-G_9ZgDjg.js → folder-browser-zsT1W215.js} +1 -1
- package/web/dist/assets/{git-toolbar-CTsmGICA.js → git-toolbar-DM1Z5LRO.js} +1 -1
- package/web/dist/assets/github-Z2_nA6EI.js +1 -0
- package/web/dist/assets/{global-activity-route-BP_Z7HNc.js → global-activity-route-DcQEMY2A.js} +1 -1
- package/web/dist/assets/index-jtycbyRq.js +21 -0
- package/web/dist/assets/{label-BWld23ke.js → label-9ElpAxAO.js} +1 -1
- package/web/dist/assets/{markdown-CT65TA_B.js → markdown-BDx7WnW8.js} +1 -1
- package/web/dist/assets/{notifications-section-DuSzYLwP.js → notifications-section-CjgS2_uZ.js} +1 -1
- package/web/dist/assets/open-in-menu-jthe8d7_.js +1 -0
- package/web/dist/assets/{preview-pane-connected-DHmgDHId.js → preview-pane-connected-BdpApHW4.js} +1 -1
- package/web/dist/assets/{project-location-BM-6wMI3.js → project-location-Do0zCjuE.js} +1 -1
- package/web/dist/assets/{projects-section-Dr0xJWTm.js → projects-section-B94Rc_Ig.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-COKMgKMw.js → prompt-templates-section-Bm4SvXEV.js} +1 -1
- package/web/dist/assets/queries-DfxoqDBz.js +1 -0
- package/web/dist/assets/{reference-chip-DTKtEtWv.js → reference-chip-B9Cnr6jR.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-BV_sPAXc.js → remote-settings-notice-DXgS_yXZ.js} +1 -1
- package/web/dist/assets/{repo-git-BgXC4opq.js → repo-git-C99FduHG.js} +1 -1
- package/web/dist/assets/{report-reader-CtHvvSln.js → report-reader-BjVZrGCz.js} +1 -1
- package/web/dist/assets/{reports-CdbDUzkK.js → reports-DnQPedky.js} +1 -1
- package/web/dist/assets/{resources-section-C8KZ4hre.js → resources-section-DVi14Dy4.js} +1 -1
- package/web/dist/assets/run-header-CCO4OIcD.js +2 -0
- package/web/dist/assets/settings-agent-picker-DjvmMcxd.js +1 -0
- package/web/dist/assets/{settings-shell-DnYRfclU.js → settings-shell-BGvilCiB.js} +1 -1
- package/web/dist/assets/{sidebar-section-CCg4QGtg.js → sidebar-section-BR6GFKTd.js} +1 -1
- package/web/dist/assets/skills-BjtkIMxL.js +1 -0
- package/web/dist/assets/{task-changes-DWPWp6ZV.js → task-changes-B8siIdj_.js} +1 -1
- package/web/dist/assets/{task-commits-D576LERH.js → task-commits-CGYaXoYl.js} +1 -1
- package/web/dist/assets/{task-files-1EjplVVb.js → task-files-HaulqF8i.js} +1 -1
- package/web/dist/assets/{task-github-item-BubKlTej.js → task-github-item-DumSw4lZ.js} +1 -1
- package/web/dist/assets/{task-groups-D4RYW5I_.js → task-groups-BWeTwWTP.js} +1 -1
- package/web/dist/assets/task-thread-CeJ8GbmR.js +9 -0
- package/web/dist/assets/{tasks-table-DTNcYbbN.js → tasks-table-DS9DShj0.js} +1 -1
- package/web/dist/assets/{thread-state-BiS8rKQ-.js → thread-state-BeRGkUTA.js} +1 -1
- package/web/dist/assets/use-hand-to-agent-state-DAmqctoU.js +1 -0
- package/web/dist/assets/{workflows-DbuTPPz7.js → workflows-bPgltsoh.js} +1 -1
- package/web/dist/assets/{workspace-tools-DPnEZoDL.js → workspace-tools-Clb89tgJ.js} +1 -1
- package/web/dist/assets/{worktrees-section-Vr8s9cio.js → worktrees-section-DdChlr21.js} +1 -1
- package/web/dist/index.html +8 -9
- package/web/dist/assets/accounts-section-BkKQ8sVH.js +0 -1
- package/web/dist/assets/agent-defaults-section-BLNTIZT_.js +0 -1
- package/web/dist/assets/automations-route-BOcGwfd4.js +0 -1
- package/web/dist/assets/diff-DUbLBjbg.js +0 -3
- package/web/dist/assets/github-BqW9PaQO.js +0 -1
- package/web/dist/assets/index-DXIRYobS.js +0 -21
- package/web/dist/assets/open-in-menu-D03osLGE.js +0 -1
- package/web/dist/assets/queries-yuG-mM6_.js +0 -1
- package/web/dist/assets/run-header-RQYKdIMw.js +0 -2
- package/web/dist/assets/runners-CDw7wLfd.js +0 -1
- package/web/dist/assets/settings-agent-picker-3uuSf9LK.js +0 -1
- package/web/dist/assets/skills-L01dfEnP.js +0 -1
- package/web/dist/assets/task-thread-yWACZZAo.js +0 -9
- package/web/dist/assets/use-hand-to-agent-state-BFx3SZia.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t,s as n}from"./runners-CDw7wLfd.js";import{t as r}from"./createLucideIcon-BHp8sXmF.js";import{t as i}from"./bot-TkDIw4y-.js";import{t as a}from"./external-link-BE6y205O.js";import{t as o}from"./folder-o-AvL3y3.js";import{n as s,t as c}from"./smartphone-Lr8Ug2z_.js";import{t as l}from"./square-terminal-B6RYYieR.js";import{t as u}from"./button-BQ2y4XRB.js";import{i as d,l as f,p,r as m,t as h}from"./dropdown-menu-4e2iKSMT.js";import{t as g}from"./own-lookup-DS54wXvD.js";var _=r(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),v=r(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),y=r(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),b=r(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),x=r(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),S=r(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),C=r(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),w=r(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),T=r(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),E=r(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),D=r(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),O=r(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),k=r(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),A=r(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),j=r(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),M=e(),N={folder:o,terminal:l,vscode:y,cursor:E,zed:j,windsurf:A,sublime:S,idea:x,pycharm:T,webstorm:s,goland:O,rubymine:C,phpstorm:v,clion:b,rider:_,"android-studio":c,xcode:w,warp:D,bot:i,sparkles:k};function P(e,n){let r=F(e.id);return g(N,r===void 0?e.icon:t(n,r)?.icon)??a}function F(e){let t=e.startsWith(`cli:`)?e.slice(4):``;return t===``?void 0:t}function I({choices:e,onPick:t,label:r=`Open in…`,title:i,triggerVariant:o=`ghost`,disabled:s=!1,leading:c,trailing:l,slot:g,className:_}){let v=n().data;return(0,M.jsxs)(h,{children:[(0,M.jsx)(p,{asChild:!0,children:(0,M.jsxs)(u,{variant:o,size:`sm`,title:i,disabled:s,"data-slot":g,className:_,children:[(0,M.jsx)(a,{"aria-hidden":`true`}),r]})}),(0,M.jsxs)(m,{align:`end`,children:[c,c&&e.length>0?(0,M.jsx)(f,{}):null,e.map(({target:e,suffix:n,title:r})=>{let i=P(e,v);return(0,M.jsxs)(d,{"data-target":e.id,title:r,onSelect:()=>t(e.id),children:[(0,M.jsx)(i,{"aria-hidden":`true`}),e.label,n??``]},e.id)}),l]})]})}export{F as n,P as r,I 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{c as n,o as r}from"./utils-DSMR_WLb.js";import{n as i,t as a}from"./live-refetch-CZb2VOyu.js";import{$ as o,$r as s,$t as c,Ai as l,At as u,B as d,Bt as f,Ct as p,Di as m,Dt as h,Ei as g,Et as _,F as v,Fr as ee,Gt as te,I as ne,In as re,Ir as ie,J as ae,K as oe,L as se,Nr as ce,Ot as le,P as ue,Pt as de,Q as fe,Qt as pe,R as me,Si as he,St as ge,Tt as _e,V as ve,Vr as ye,Vt as be,W as xe,X as Se,Y as Ce,Z as we,_ as Te,_i as Ee,_n as De,_r as Oe,_t as ke,ai as Ae,at as je,b as Me,bn as Ne,c as Pe,ci as y,cn as Fe,ct as Ie,dt as Le,ei as Re,en as ze,et as Be,f as Ve,fr as He,ft as Ue,g as We,gt as Ge,hn as Ke,ht as qe,i as Je,ii as Ye,in as Xe,it as Ze,j as Qe,kt as $e,li as et,ln as tt,lt as nt,m as rt,mi as it,mn as at,mt as ot,ni as st,nn as ct,nt as lt,oi as ut,ot as dt,pi as ft,pn as pt,pt as mt,q as ht,r as gt,ri as _t,rt as vt,sn as yt,st as bt,ti as xt,tn as St,un as Ct,ut as wt,v as Tt,vt as Et,wi as Dt,wt as Ot,x as kt,yi as At,yn as jt,yt as Mt,z as Nt}from"./project-scope-context-Dgq8_2JZ.js";import{A as Pt,B as b,F as x,H as S,I as C,N as w,P as T,W as E,Z as D,j as O,z as k}from"./live-protocol-BXzu6cSE.js";import{t as Ft}from"./useInfiniteQuery-BnyaEFle.js";import{t as A}from"./useQuery-BUslvRIM.js";import{n as It,r as j,t as Lt}from"./ws-Bal5BUy2.js";import{n as Rt}from"./toaster-Bo5vCbz-.js";var zt=class extends ft{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Bt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=it({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),D.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Bt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Vt=class extends l{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),g(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Ee(t.mutationKey)!==Ee(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Bt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){D.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Ht(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function Ut(e,t,n){let r=e.slice(0);return r[t]=n,r}var Wt=class extends l{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,D.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!g(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ht(e,n).forEach(e=>{e.destroy()}),Ht(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Dt(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new et(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=Ut(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&D.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},M=e(t(),1);function N({queries:e,...t},n){let r=y(n),i=ut(),a=Ae(),o=M.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{s(e);let t=r.getQueryCache().get(e.queryHash);st(e,a,t)}),Ye(a);let[c]=M.useState(()=>new Wt(r,o,t)),[l,u,d]=c.getOptimisticResult(o,t.combine),f=!i&&t.subscribed!==!1;M.useSyncExternalStore(M.useCallback(e=>f?c.subscribe(D.batchCalls(e)):he,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),M.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);let p=l.some((e,t)=>xt(o[t],e))?l.flatMap((e,t)=>{let n=o[t];return n&&xt(n,e)?Re(n,new et(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=o[t];return n&&_t({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m?.error)throw m.error;return u(d())}function P(e,t){let n=y(t),[r]=M.useState(()=>new Vt(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);let i=M.useSyncExternalStore(M.useCallback(e=>r.subscribe(D.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=M.useCallback((e,t)=>{r.mutate(e,t).catch(he)},[r]);if(i.error&&m(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function F(e={}){let t=e.projectId??n();return{projectId:t,cacheScope:e.cacheScope??(e.boot?`default`:t)}}function I(e,t={}){return{...F(t),runId:e}}function Gt(e,t=!0,n=!1,r){return A({queryKey:[F({projectId:e,boot:n}).cacheScope,`runs`,`list`],queryFn:({signal:t})=>Ot(F({projectId:e,boot:n}),{signal:t}),enabled:t,...r?{select:r}:{},placeholderData:(t,r)=>n&&r?.queryKey[0]===e?t:void 0})}function L(e,t,n=`active`){return e.invalidateQueries({queryKey:t===void 0?[`workspace`,`models`]:Z.models(t),refetchType:n})}function Kt(e,t=!0,n){return A({...qt(e,n),enabled:t})}var qt=(e,t)=>({queryKey:Z.models(e,t),queryFn:({signal:n})=>re(e,{signal:n},t),staleTime:300*1e3});function Jt(e,t=!0){let n=N({queries:e.map(e=>({...qt(e),enabled:t}))});return Object.fromEntries(e.map((e,t)=>[e,n[t]]))}var R=[`workspace`,`runs-index`],z=e=>[e.cacheScope,`runs`,`list`],B=e=>[e.cacheScope,`runs`,`detail`,e.runId],V=e=>typeof e==`function`?e():e;function Yt(e){let{seenAt:t,...n}=e;return n}function Xt(e,t){let n=Yt(e);return t.seenAt===void 0?n:{...n,seenAt:t.seenAt}}function Zt(e,t,n){return t?{...e,seenAt:n}:Yt(e)}function Qt(e){let t=()=>{e.invalidateQueries({queryKey:R})};function r(r,i){if(r===`index`)return t();let a=typeof i==`function`?i():i;if(r===`indexed`){t(),e.invalidateQueries({queryKey:[n(),`runs`]}),e.invalidateQueries({queryKey:[a.projectId,`runs`,`list`]});return}if(r===`runs`)return e.invalidateQueries({queryKey:[a.cacheScope,`runs`]});let o=ie(),s=[a.projectId,a.cacheScope],c=o!==void 0&&s.some(e=>e===o||e==="default")?[o,`default`]:[],l=new Set([...s,...c,n()]);return Promise.all([...l].map(t=>e.invalidateQueries({queryKey:[t,`runs`]}))).then(()=>void 0)}async function i(n,r){await e.cancelQueries({queryKey:z(V(n))}),await e.cancelQueries({queryKey:B(V(n))});let i=e.getQueryData(z(V(n))),a=e.getQueryData(B(V(n))),o=V(n).runId,s=new Date().toISOString();return e.setQueryData(z(V(n)),e=>e?.map(e=>e.id===o?Zt(e,r,s):e)),e.setQueryData(B(V(n)),e=>e&&Zt(e,r,s)),{id:o,prevList:i,prevDetail:a,rollback(){if(!r){i&&e.setQueryData(z(V(n)),i),a&&e.setQueryData(B(V(n)),a);return}let t=i?.find(e=>e.id===o);t&&e.setQueryData(z(V(n)),e=>e?.map(e=>e.id===o?Xt(e,t):e)),a&&e.setQueryData(B(V(n)),e=>e&&Xt(e,a))},settle(i){let a=e=>e.id===(r?o:i.id)?Zt(e,r,i.seenAt):e;e.setQueryData(z(V(n)),e=>e?.map(a));let s={...V(n),runId:r?o:i.id};e.setQueryData(B(s),e=>e?a(e):i),t()}}}async function a(t,n){await e.cancelQueries({queryKey:R});let i=e.getQueryData(R),a=n();return e.setQueryData(R,e=>e===void 0?e:{...e,runs:e.runs.map(e=>e.projectId===t.projectId&&e.id===t.runId?a(e):e)}),{previous:i,rollback(){i&&e.setQueryData(R,i)},settle(){r(`indexed`,t)}}}return{patchRead:i,patchIndex:a,invalidateAfter:r}}function H(){let e=y();return(0,M.useMemo)(()=>Qt(e),[e])}function $t(e,t){return JSON.stringify([e,t])}function en(e){return e.type===`run`?e.run.id:e.id}function U(e,t){return{...e,runs:t}}function tn(e,t){let n=0;for(let r of e)r.projectId===t&&r.archived&&(n+=1);return n}var nn=class{runs;copied=!1;positions=new Map;constructor(e){this.runs=e,this.reindex()}reindex(){this.positions.clear(),this.runs.forEach((e,t)=>this.positions.set($t(e.projectId,e.id),t))}at(e,t){return this.positions.get($t(e,t))??-1}mutable(){return this.copied||=(this.runs=[...this.runs],!0),this.runs}replace(e,t){return this.mutable()[e]=t,this.runs}remove(e){return this.mutable().splice(e,1),this.reindex(),this.runs}insert(e){let t=this.runs.findIndex(t=>(t.createdAt??``).localeCompare(e.createdAt)<0);return this.mutable().splice(t<0?this.runs.length:t,0,e),this.reindex(),this.runs}};function rn(e,t,n){let r=new nn(e.runs),i=e,a=!1;for(let e of t)if(e.type===`usage`)i=un(i,e.project,e.usage,r);else{let t=sn(i,e.change,n,r);i=t.index,a||=t.reconcile}return{index:i,reconcile:a}}function an(e,t,n){return n?n.has(t):e.runs.some(e=>e.projectId===t)}function on(e,t,n){return sn(e,t,n,new nn(e.runs))}function sn(e,t,n,r){let{project:i}=t,a=r.at(i,en(t)),o=a>=0?e.runs[a]:void 0,s=e.truncated.includes(i);if(t.type===`deleted`)return o?{index:U(e,r.remove(a)),reconcile:s&&o.archived}:{index:e,reconcile:!1};let{run:c}=t;if(c.delegation?.role===`worker`)return o?{index:U(e,r.remove(a)),reconcile:!1}:{index:e,reconcile:!1};if(!o&&!an(e,i,n))return{index:e,reconcile:!0};let l=Dt(o,{projectId:i,...c});if(o){if(l===o)return{index:e,reconcile:!1};let t=r.replace(a,l),n=o.archived!==l.archived&&(s||tn(t,i)>e.perProjectLimit);return{index:U(e,t),reconcile:n}}if(s)return ln(e,l,r);let u=r.insert(l);return{index:U(e,u),reconcile:l.archived&&tn(u,i)>e.perProjectLimit}}function cn(e,t){let n;for(let r of e)r.projectId===t&&r.archived&&(n===void 0||r.createdAt<n)&&(n=r.createdAt);return n}function ln(e,t,n){let r=cn(e.runs,t.projectId),i=r!==void 0&&t.createdAt>r;return t.archived&&!i?{index:e,reconcile:!1}:{index:U(e,n.insert(t)),reconcile:t.archived||r===void 0||t.createdAt<r}}function un(e,t,n,r){let i=!1;return e.runs.forEach((e,a)=>{if(e.projectId!==t)return;let o=n[e.id];if(o){let t=Dt(e.usage,o);if(t===e.usage)return;r.replace(a,{...e,usage:t})}else{if(e.usage===void 0)return;let{usage:t,...n}=e;r.replace(a,n)}i=!0}),i?U(e,r.runs):e}function dn(e,t){let n=e.runs.filter(e=>e.projectId!==t),r=e.truncated.filter(e=>e!==t),i=Object.prototype.hasOwnProperty.call(e.referenceStatuses,t);if(n.length===e.runs.length&&r.length===e.truncated.length&&!i)return e;let a={...e.referenceStatuses};return delete a[t],{...e,runs:n,truncated:r,referenceStatuses:a}}function fn(){return{stream:void 0,lastStream:void 0,mismatch:void 0,floor:void 0,changes:new Map}}function pn(e,t,n){if(e.lastStream===t)e.floor=Math.max(e.floor??n,n);else{for(let[n,r]of e.changes)r.generation!==t&&e.changes.delete(n);e.floor=n}e.stream=t,e.lastStream=t,e.mismatch=void 0}function mn(e){e.stream=void 0}function hn(e,t,n=!1){let r=e.stream;if(r===void 0)return!1;(e.floor===void 0||n)&&(e.floor=t.seq-1);let i=JSON.stringify([r,t.project,en(t)]),a=e.changes.get(i);return(!a||a.seq<t.seq)&&e.changes.set(i,{...t,generation:r}),!0}function gn(e,t){for(let[n,r]of e.changes)r.project===t&&e.changes.delete(n)}function _n(e){return typeof e.generation==`string`&&typeof e.eventSeq==`number`}function vn(e,t,n){if(!_n(t))return{index:t,reconcile:!1};let{generation:r,eventSeq:i}=t;if(e.stream!==void 0&&e.stream!==r){let n=e.mismatch!==r;return e.mismatch=r,{index:t,reconcile:n}}let a=e.lastStream===r&&e.floor!==void 0,o=a&&i<e.floor,s=t,c=o,l=[...e.changes.entries()].filter(([,e])=>e.generation===r),u=l.map(([,e])=>e).filter(e=>e.seq>i).sort((e,t)=>e.seq-t.seq);for(let e of u){let t=on(s,e,n);s=t.index,c||=t.reconcile}for(let[t,n]of l)n.seq<=i&&e.changes.delete(t);return a&&!o&&(e.floor=i),{index:s,reconcile:c}}var W=[`workspace`,`runs-index`],yn=[`workspace`,`projects`],bn=6e4,xn=100,Sn=new WeakMap;function Cn(e){let t=Sn.get(e);return t||(t=On(e),Sn.set(e,t)),t}function wn(e,t){return typeof e!=`object`||!e||!Array.isArray(e.runs)?e:Cn(t).merge(e)}function Tn(e){let t=e.getQueryData(yn)?.projects;return t?new Set(t.map(e=>e.id)):void 0}function En(e,t,n){if(!(!e||typeof e.eventSeq!=`number`||typeof t.eventSeq!=`number`))return e.generation===t.generation?t.eventSeq<e.eventSeq?e:void 0:n!==void 0&&e.generation===n&&t.generation!==n?e:void 0}function Dn(e,t){return t.type===`run-summary`?{type:`run`,project:e,seq:t.seq,run:t.summary}:{type:`deleted`,project:e,seq:t.seq,id:t.id}}function On(e){let t=fn(),n=[],r,i,a,o,s=!1,c=-1/0,l=new Set,u=!1,d,f=!1,p=()=>{if(!u){if(u=!0,d?.()){f=!0;return}_({hold:!0})}},m=t=>{c=Date.now(),e.setQueryData(W,t)},h=()=>e.getQueryData(W),g=()=>{clearTimeout(a),a=void 0;let t=e.getQueryCache().find({queryKey:W,exact:!0}),n=(t!==void 0&&t.state.data===void 0&&t.state.fetchStatus!==`idle`?e.cancelQueries({queryKey:W,exact:!0}).then(()=>e.invalidateQueries({queryKey:W})):e.invalidateQueries({queryKey:W})).catch(()=>void 0).finally(()=>{o===n&&(o=void 0,s&&(s=!1,g()))});return o=n,n},_=(e={})=>o?(s=!0,o):e.hold?(a??=setTimeout(()=>{g()},400),Promise.resolve()):g(),v=()=>{r!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(r),r=void 0,clearTimeout(i),i=void 0;let t=n;n=[];let a=h();if(!a||t.length===0)return;let o=Tn(e),{index:s,reconcile:c}=rn(a,t.filter(e=>e.generation===a.generation?e.type===`usage`?!l.has(e.project):!l.has(e.change.project)&&e.change.seq>a.eventSeq:!1),o);s!==a&&m(s),c&&_({hold:!0})},ee=()=>{if(i!==void 0)return;let e=c+250-Date.now();if(e>0){i=setTimeout(v,e);return}i=setTimeout(v,xn),typeof requestAnimationFrame==`function`&&(r=requestAnimationFrame(v))};return{ready(e,n){pn(t,e,n),u=!1,f&&(f=!1,_({hold:!0}))},detach(){mn(t)},run(e,r,i=!1){if(l.has(e))return;let a=Dn(e,r);if(!hn(t,a,i)){p();return}n.push({type:`change`,change:a,generation:t.stream}),ee()},usage(e,r){if(!l.has(e)){if(t.stream===void 0){p();return}n.push({type:`usage`,project:e,usage:r,generation:t.stream}),ee()}},dropProject(e){l.add(e),gn(t,e),n=n.filter(t=>(t.type===`change`?t.change.project:t.project)!==e);let r=h();if(!r)return;let i=dn(r,e);i!==r&&m(i)},setUnknownGenerationHandler(e){d=e},restoreProject(e){l.delete(e)},merge(n){let r=h(),i=vn(t,n,Tn(e));for(let e of l)i.index=dn(i.index,e);return i.reconcile&&queueMicrotask(()=>{_({hold:!0})}),En(r,n,t.stream)??i.index},reconcile:_,flush:v,stop(){r!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(r),r=void 0,clearTimeout(i),i=void 0,clearTimeout(a),a=void 0,n=[],s=!1}}}var kn={draft:{label:`Draft`,hint:`the author has not marked it ready for review`,tone:`neutral`},"review-required":{label:`Waiting for review`,hint:`checks are fine, no one has reviewed it yet`,tone:`info`},"changes-requested":{label:`Changes requested`,hint:`a reviewer asked for edits before this can merge`,tone:`danger`},"checks-pending":{label:`Checks running`,hint:`CI has not finished on the latest commit`,tone:`pending`},"checks-failing":{label:`Checks failing`,hint:`CI is red on the latest commit`,tone:`danger`},ready:{label:`Ready to merge`,hint:`open, checks pass, nothing is waiting on a reviewer`,tone:`success`},merged:{label:`Merged`,hint:`this landed on its base branch`,tone:`merged`},closed:{label:`Closed`,hint:`closed without merging — the work did not land`,tone:`danger`},open:{label:`Open`,hint:`still open on the tracker`,tone:`success`},completed:{label:`Closed as completed`,hint:`the issue was resolved`,tone:`accent`},"not-planned":{label:`Closed as not planned`,hint:`the issue was declined — nothing shipped for it`,tone:`neutral`}},An={label:`Merge conflicts`,hint:`this branch no longer merges cleanly into its base — rebase or merge the base in`,tone:`conflict`};function jn(e){return typeof e==`string`&&Object.hasOwn(kn,e)}function Mn(e){return e!==void 0&&jn(e)?kn[e]:void 0}var Nn=`cez.reference-statuses.v1`,Pn=`cez.reference-conflicts.v1`,G=new Map(Rn()),Fn=1e3;function In(e,t){if(G.get(e)!==t){for(G.delete(e),G.set(e,t);G.size>Fn;){let e=G.keys().next().value;if(e===void 0)break;G.delete(e)}Vn()}}var K=new Set(zn());function Ln(e,t){if(K.has(e)!==t){if(t)for(K.add(e);K.size>Fn;){let e=K.values().next().value;if(e===void 0)break;K.delete(e)}else K.delete(e);Vn()}}function Rn(){try{let e=globalThis.sessionStorage?.getItem(Nn);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`&&jn(e[1])):[]}catch{return[]}}function zn(){try{let e=globalThis.sessionStorage?.getItem(Pn);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}var Bn;function Vn(){Bn===void 0&&(Bn=setTimeout(()=>{Bn=void 0;try{globalThis.sessionStorage?.setItem(Nn,JSON.stringify([...G])),globalThis.sessionStorage?.setItem(Pn,JSON.stringify([...K]))}catch{}},250))}var q=e=>`${e.projectId}\u0000${e.kind}#${e.number}`;function Hn(e,t){return{...e?{status:e}:{},...t?{conflicting:!0}:{}}}function Un(e){return[...e.prs.map(t=>({projectId:e.projectId,kind:`PR`,number:t})),...e.issues.map(t=>({projectId:e.projectId,kind:`Issue`,number:t}))]}function Wn(e,t,n,r,i,a){let o=r.prs[n.number]??r.issues[n.number];if(!o){e.set(t,{state:`unknown`,...i?{status:i}:{}});return}let s=r.conflicts?r.conflicts.includes(n.number):void 0;In(t,o),s!==void 0&&Ln(t,s),e.set(t,{state:`ready`,status:o,...s??a?{conflicting:!0}:{}})}function Gn(e,t,n){let r=q(t),i=G.get(r),a=K.has(r)?!0:void 0,o=n.data;if(o?.available){Wn(e,r,t,o,i,a);return}if(o){e.set(r,{state:`unavailable`,reason:o.reason,...Hn(i,a)});return}if(n.isError){e.set(r,{state:`unavailable`,reason:n.error instanceof Error?n.error.message:void 0,...Hn(i,a)});return}e.set(r,{state:`loading`,...Hn(i,a)})}function Kn(e,t){let n=new Map;return t.forEach((t,r)=>{let i=e[r];if(i)for(let e of Un(i))Gn(n,e,t)}),n}async function qn(e,t=!1){return Ke(await Ve.api.v1.p[`:projectId`].runs[`:id`][`worker-destroy`].$post({param:{projectId:n(),id:encodeURIComponent(e)},query:{},json:t?{discardWork:!0}:{}}),yt(e,`/worker-destroy`))}var Jn=O([`passing`,`failing`,`pending`]).nullable(),J=b({kind:O([`issue`,`pr`]),number:k(),title:E(),author:E(),createdAt:E(),labels:w(E()),body:E().optional(),url:E(),comments:k(),assignees:w(E()).optional(),projectIds:w(E()).optional(),isDraft:T().optional(),additions:k().optional(),deletions:k().optional(),checks:Jn.optional()});x(`available`,[b({available:C(!0),item:J.nullable(),labelColors:S(E(),E()).optional()}),b({available:C(!1),reason:E()})]),b({kind:O([`issue`,`pr`]),number:Pt().int().positive().safe()});var Yn=b({id:E(),title:E(),url:E()});b({available:T(),reason:E().optional(),repo:E().optional(),syncedAt:E().optional(),issues:w(J),prs:w(J),labelColors:S(E(),E()).optional(),viewerLogin:E().optional(),projects:w(Yn).optional(),projectsReason:E().optional(),projectsState:O([`refreshing`,`ready`,`unavailable`]).optional(),projectsGeneration:E().optional(),issuesTotal:k().int().nonnegative().optional(),prsTotal:k().int().nonnegative().optional(),issuesNextCursor:E().nullable().optional(),prsNextCursor:E().nullable().optional(),commentsDeferred:C(!0).optional()});var Xn=E().min(1).max(2e3).optional();b({limit:E().optional(),refresh:E().optional(),issuesCursor:Xn,prsCursor:Xn,issuesDone:C(`1`).optional(),prsDone:C(`1`).optional()}).superRefine((e,t)=>{e.issuesDone&&e.issuesCursor&&t.addIssue({code:`custom`,message:`issuesDone and issuesCursor are exclusive`}),e.prsDone&&e.prsCursor&&t.addIssue({code:`custom`,message:`prsDone and prsCursor are exclusive`}),e.issuesDone&&e.prsDone&&t.addIssue({code:`custom`,message:`both sides are done; there is no page to ask for`})}),b({kind:O([`issue`,`pr`]),numbers:E().regex(/^[1-9]\d{0,15}(,[1-9]\d{0,15})*$/).refine(e=>{let t=e.split(`,`);return t.length<=100&&t.every(e=>Number.isSafeInteger(Number(e)))},{message:`at most 100 safe positive integers`}),refresh:C(`1`).optional()}),x(`available`,[b({available:C(!0),counts:S(k(),k().int().nonnegative())}),b({available:C(!1),reason:E()})]),x(`available`,[b({available:C(!0),checks:S(k(),Jn)}),b({available:C(!1),reason:E()})]),b({kind:O([`issue`,`pr`]),q:E().trim().min(1).max(256),limit:Pt().int().positive().max(50).optional()}),b({available:T(),projectsReason:E().optional(),reason:E().optional(),items:w(J),truncated:T().optional(),labelColors:S(E(),E()).optional()});var Zn=k().nullable();x(`available`,[b({available:C(!0),prs:S(k(),He),issues:S(k(),He),conflicts:w(k()).optional(),recheckAfterMs:Zn}),b({available:C(!1),reason:E(),recheckAfterMs:Zn})]);var Qn=b({id:k(),author:E(),avatarUrl:E().optional(),createdAt:E(),body:E(),kind:O([`comment`,`review`]),reviewState:O([`approved`,`changes_requested`,`commented`,`dismissed`]).optional(),url:E()}),$n=O([`committed`,`labeled`,`unlabeled`,`assigned`,`unassigned`,`merged`,`closed`,`reopened`,`head_ref_force_pushed`,`cross-referenced`,`renamed`]),er=b({id:E(),kind:$n,actor:E(),avatarUrl:E().optional(),createdAt:E(),url:E().optional(),sha:E().optional(),message:E().optional(),checks:Jn.optional(),label:b({name:E(),color:E().optional()}).optional(),subject:E().optional(),refNumber:k().optional(),refTitle:E().optional(),refIsPr:T().optional()});b({available:T(),reason:E().optional(),comments:w(Qn),truncated:T().optional(),events:w(er).optional(),detail:b({body:E(),additions:k().int().nonnegative().optional(),deletions:k().int().nonnegative().optional()}).optional()});var tr=O([`merge`,`squash`,`rebase`]),nr=b({name:E(),state:O([`passing`,`failing`,`pending`,`unknown`]),required:T().nullable(),url:E().optional()}),rr=b({number:k(),title:E(),url:E(),state:O([`open`,`closed`,`merged`]),isDraft:T(),headRef:E(),baseRef:E(),headSha:E(),mergeable:O([`mergeable`,`conflicting`,`unknown`]),reviewDecision:O([`approved`,`changes-requested`,`review-required`,`not-required`,`unknown`]),checks:w(nr),methods:w(tr),defaultMethod:tr.nullable(),eligibility:O([`ready`,`blocked`,`pending`,`unauthorized`,`terminal`,`unknown`]),blockers:w(b({code:E(),message:E()})),canMerge:T(),canOverride:T()});x(`available`,[b({available:C(!0),mergeState:rr}),b({available:C(!1),reason:E()})]),b({merged:C(!0),number:k(),url:E(),method:tr,mergeCommitSha:E().optional()});var ir=b({path:E(),previousPath:E().optional(),status:O([`added`,`modified`,`removed`,`renamed`,`copied`,`changed`]),additions:k(),deletions:k(),patch:E().optional(),patchUnavailableReason:O([`binary`,`too-large`,`not-provided`]).optional(),truncated:T().optional()});x(`available`,[b({available:C(!0),number:k(),headSha:E(),files:w(ir),additions:k(),deletions:k(),truncated:T(),reason:E().optional()}),b({available:C(!1),reason:E()})]),b({generation:E().uuid()}),x(`state`,[b({generation:E().uuid(),state:C(`ready`),projects:w(Yn),membership:S(E(),w(E()))}),b({generation:E().uuid(),state:C(`unavailable`),reason:E()})]);function ar(e){if(!e)return;let t=e.trim().replace(/\/+$/,``),n=/^(?:https?|ssh|git|git\+ssh):\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/.exec(t),r=n?null:/^(?:[^@/:]+@)?([^:/]+):(.+)$/.exec(t),i=n??r;if(!i)return;let[,a,o]=i;if(!o||a?.toLowerCase()!==`github.com`)return;let s=o.replace(/\.git$/i,``).split(`/`).filter(Boolean),c=s[s.length-2],l=s[s.length-1];return c&&l?`https://github.com/${c}/${l}`:void 0}function or(e){let t=new Map;for(let n of e)for(let e of n.tags??[]){let n=e.toLowerCase();t.has(n)||t.set(n,e)}return[...t.values()].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}function sr(e,t,n,r=8){let i=n.trim().toLowerCase(),a=new Set(t.map(e=>e.toLowerCase())),o=e.filter(e=>{let t=e.toLowerCase();return a.has(t)?!1:i===``||t.includes(i)&&t!==i});return i===``?o.slice(0,r):o.sort((e,t)=>Number(t.toLowerCase().startsWith(i))-Number(e.toLowerCase().startsWith(i))||e.localeCompare(t,void 0,{sensitivity:`base`})).slice(0,r)}function cr(e){let t=new Map;for(let n of e){let e=n.trim();if(!e)continue;let r=e.toLowerCase();t.has(r)||t.set(r,e)}return[...t.values()].sort((e,t)=>e.localeCompare(t,void 0,{sensitivity:`base`}))}function lr(e){if(!e.available)return;let t=e.issuesNextCursor,n=e.prsNextCursor;if(!(t===void 0&&n===void 0)&&!(!t&&!n))return{...t?{issuesCursor:t}:{issuesDone:!0},...n?{prsCursor:n}:{prsDone:!0}}}function ur(e,t){return e?(t===`issues`?e.issuesNextCursor:e.prsNextCursor)==null:!1}function dr(e,t,n){for(let r of e)t.has(r.number)||(t.add(r.number),n.push(r))}function fr(e){let t=e[0];if(!t)return;let n=e[e.length-1],r=[],i=[],a=new Set,o=new Set,s={};for(let t of e){dr(t.issues,a,r),dr(t.prs,o,i);for(let[e,n]of Object.entries(t.labelColors??{}))s[e]??=n}let c=e.find(e=>e.projects)?.projects,l=e.map(e=>e.projectsState),u=e.find(e=>e.projectsState===`unavailable`),d=l.includes(`refreshing`)?`refreshing`:u?`unavailable`:l.some(e=>e===`ready`)?`ready`:void 0,{projectsGeneration:f,projectsReason:p,...m}=t;return{...m,issues:r,prs:i,...Object.keys(s).length>0?{labelColors:s}:{},...c?{projects:c}:{},...d?{projectsState:d}:{},...d===`unavailable`&&u?.projectsReason?{projectsReason:u.projectsReason}:{},...`issuesNextCursor`in n?{issuesNextCursor:n.issuesNextCursor}:{},...`prsNextCursor`in n?{prsNextCursor:n.prsNextCursor}:{}}}var Y=e=>e.map(e=>e.number).join(`,`);function pr(e,t){let n=e[0];if(e.length>1&&n&&(Y(n.issues)!==Y(t.issues)||Y(n.prs)!==Y(t.prs)||n.issuesTotal!==t.issuesTotal||n.prsTotal!==t.prsTotal))return`refetch`;let r=t;if(n&&t.available&&t.projectsState===`refreshing`&&n.repo===t.repo){let e=new Map(n.issues.map(e=>[e.number,e.projectIds]));r={...t,issues:t.issues.map(t=>{let n=e.get(t.number);return t.projectIds===void 0&&n!==void 0?{...t,projectIds:n}:t})}}return[r,...e.slice(1)]}function mr(e,t,r=!0){let i=hi(),a=$(),o=e??i.data?.defaultRunner??`claude`,s=a.data?.capabilities?.localHandoff===!1?null:t,c=n(),l=A({queryKey:X.runnerSkills(o,s),queryFn:({signal:e})=>p(o,s,{signal:e,projectId:c}),enabled:r&&(e!==void 0||!i.isPending)&&(!t||!a.isPending),retry:!1});return{...l,runner:o,account:s,data:l.data?.skills,list:l.data,unchecked:l.isError||!l.data||l.data.source===`unavailable`}}var X={get health(){return[n(),`health`]},runs:{get all(){return[n(),`runs`]},relationships:e=>[n(),`runs`,`relationships`,e],list:(e=n())=>[e,`runs`,`list`],archived:e=>[n(),`runs`,`archived`,e],detail:(e,t=n())=>[t,`runs`,`detail`,e],diff:e=>[n(),`runs`,`diff`,e],changes:e=>[n(),`runs`,`changes`,e],file:(e,t)=>[n(),`runs`,`files`,e,t],handoff:e=>[n(),`runs`,`handoff`,e],commits:e=>[n(),`runs`,`commits`,e],commit:(e,t)=>[n(),`runs`,`commit`,e,t]},get workflows(){return[n(),`workflows`]},runnerSkills:(e,t)=>[n(),`runner-skills`,e,t??null],get repo(){return[n(),`repo`]},get repoChanges(){return[n(),`repo`,`changes`]},repoCommit:e=>[n(),`repo`,`commit`,e],get repoBranches(){return[n(),`repo`,`branches`]},get uiState(){return[n(),`ui-state`]},get config(){return[n(),`config`]},get agentConfig(){return[n(),`agent-config`]},agentConfigFile:e=>[n(),`agent-config`,`file`,e],get worktrees(){return[n(),`worktrees`]},github:(e={})=>[n(),`github`,e.limit??null],githubPages:e=>[n(),`github`,`pages`,e],githubPagesHead:e=>[n(),`github`,`pages-head`,e],githubCommentCounts:(e,t)=>[n(),`github`,`comment-counts`,e,[...t].sort((e,t)=>e-t).join(`,`)],githubChecks:e=>[n(),`github`,`checks`,[...e].sort((e,t)=>e-t).join(`,`)],githubSearch:(e,t)=>[n(),`github`,`search`,e,t],githubRefStatus:(e,t,n)=>[e,`github`,`ref-status`,[...t].sort((e,t)=>e-t).join(`,`),[...n].sort((e,t)=>e-t).join(`,`)],githubComments:(e,t)=>[n(),`github`,`comments`,e,t],githubItem:(e,t)=>[n(),`github`,`item`,e,t],githubRefStatusOf:e=>[e,`github`,`ref-status`],githubPrChanges:e=>[n(),`github`,`pr-changes`,e],githubMergeState:e=>[n(),`github`,`merge-state`,e],get openTargets(){return[n(),`open-targets`]}},Z={models:(e,t)=>t&&t!=="default"?[`workspace`,`models`,e,t]:[`workspace`,`models`,e],providerStatus:[`workspace`,`providers`,`status`],projects:[`workspace`,`projects`],githubOwners:[`workspace`,`github-owners`],runsIndex:W,runsSearch:e=>[`workspace`,`runs-search`,e],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],agentProfiles:[`workspace`,`agent-profiles`],agentAccountStatus:e=>[`workspace`,`agent-profiles`,`status`,e],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:(e,t=!1)=>[...Z.fsBrowseRoot,e,t]};function hr(){let e=y();return A({queryKey:Z.providerStatus,queryFn:async({signal:t})=>{let n=e.getQueryData(Z.providerStatus),r=await Ie(!1,{signal:t});return Oe(n,e.getQueryData(Z.providerStatus),r)},staleTime:5*6e4,refetchInterval:a(!1),refetchOnWindowFocus:!0})}function gr(){let e=y();return P({mutationFn:()=>Ie(!0),onMutate:()=>e.getQueryData(Z.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(Z.providerStatus,e=>Oe(r,e,t)),L(e)}})}function _r(){let e=y();return P({mutationFn:({provider:e,authFailureId:t})=>Xe(e,t),onMutate:()=>e.getQueryData(Z.providerStatus),onSuccess:(t,n,r)=>{e.setQueryData(Z.providerStatus,e=>Oe(r,e,t,n.authFailureId)),L(e,n.provider)}})}function vr(e={}){return A({queryKey:Z.projects,queryFn:({signal:e})=>bt({signal:e}),...e})}function yr(e,t=!1){return A({queryKey:Z.fsBrowse(e,t),queryFn:({signal:n})=>Pe(e??void 0,{signal:n,showHidden:t}),retry:!1})}function br(){let e=y();return P({mutationFn:e=>pe(e),onSuccess:()=>e.invalidateQueries({queryKey:Z.projects})})}function xr(){let e=y();return P({mutationFn:e=>ze(e),retry:!1,onSuccess:()=>{e.invalidateQueries({queryKey:Z.projects})}})}function Sr(){let e=y();return P({mutationFn:e=>{let{id:t,...n}=e;return jt(t,n)},retry:!1,onMutate:async({id:t,...n})=>{await e.cancelQueries({queryKey:Z.projects});let r=e.getQueryData(Z.projects);return e.setQueryData(Z.projects,e=>e===void 0?e:{...e,projects:e.projects.map(e=>e.id===t?Cr(e,n):e)}),{previous:r}},onError:(t,n,r)=>{r?.previous&&e.setQueryData(Z.projects,r.previous)},onSuccess:({project:t})=>{e.setQueryData(Z.projects,e=>e===void 0?e:{...e,projects:e.projects.map(e=>e.id===t.id?t:e)})},onSettled:()=>e.invalidateQueries({queryKey:Z.projects})})}function Cr(e,t){let{maxParallel:n,tags:r,...i}=e,a={...i},o=`maxParallel`in t?t.maxParallel:e.maxParallel;o!=null&&(a.maxParallel=o);let s=`tags`in t&&t.tags!==void 0?t.tags:e.tags,c=s==null?[]:cr(s);if(c.length>0&&(a.tags=c),`webhook`in t&&t.webhook!==void 0)if(t.webhook===null)delete a.webhook;else{let n=t.webhook.token===void 0?e.webhook?.tokenSet??!1:t.webhook.token!==``;a.webhook={url:t.webhook.url,tokenSet:n}}return a}function wr(e){let t=y();return P({mutationFn:e,retry:!1,onSuccess:({project:e})=>{t.setQueryData(Z.projects,t=>t===void 0?t:{...t,projects:t.projects.map(t=>t.id===e.id?e:t)})},onSettled:()=>t.invalidateQueries({queryKey:Z.projects})})}function Tr(){return wr(e=>{let{projectId:t,...n}=e;return kt(t,n)})}function Er(){return wr(e=>{let{projectId:t,webhookId:n,...r}=e;return Ne(t,n,r)})}function Dr(){return wr(({projectId:e,webhookId:t})=>St(e,t))}function Or(){return P({mutationFn:({projectId:e,webhookId:t})=>at(e,t),retry:!1})}function kr(e){let t=y();return P({mutationFn:t=>de(e,t),retry:!1,onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all})})}function Q(e){let t=y();return P({mutationFn:e,retry:!1,onSuccess:async()=>{await Promise.all([t.invalidateQueries({queryKey:Z.agentProfiles}),t.invalidateQueries({queryKey:Z.projects}),t.invalidateQueries({predicate:({queryKey:e})=>e[1]===`runner-skills`}),L(t)])}})}function Ar(){return Q(e=>Tt(e))}function jr(){return Q(e=>{let{id:t,...n}=e;return De(t,n)})}function Mr(){return Q(e=>c(e))}function Nr(){return Q(e=>tt(e))}function Pr(e,t){return A({queryKey:Z.agentAccountStatus(e),queryFn:({signal:t})=>ue(e,{signal:t}),enabled:t,staleTime:6e4,retry:!1})}function Fr(){let e=y();return P({mutationFn:({provider:e,profileId:t})=>We(e,t),retry:!1,onSuccess:async(t,{provider:n})=>{await Promise.all([e.invalidateQueries({queryKey:Z.agentProfiles}),e.invalidateQueries({queryKey:Z.providerStatus}),L(e,n,`none`)])}})}function Ir(){let e=y();return P({mutationFn:e=>ue(e,{refresh:!0}),retry:!1,onSuccess:(t,n)=>{e.setQueryData(Z.agentAccountStatus(n),t),e.invalidateQueries({queryKey:Z.agentProfiles}),L(e,t.status.provider)}})}function Lr(){let e=y();return P({mutationFn:e=>rt(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Z.projects})})}function Rr(){let e=y();return P({mutationFn:e=>Me(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:Z.projects})})}function zr({enabled:e}){return A({queryKey:Z.githubOwners,queryFn:({signal:e})=>o({signal:e}),enabled:e,staleTime:6e4,retry:!1})}function Br(){let e=y();(0,M.useEffect)(()=>{let t,n=()=>{let n=e.getQueryData(X.health);n&&(ee({bootProject:n.bootProject??`default`,apiBase:r()}),t??=Lt(`health`,t=>{e.setQueryData(X.health,t)}))};n();let i=e.getQueryCache().subscribe(n);return()=>{i(),t?.(),ye()}},[e])}function $(){return A({queryKey:X.health,queryFn:({signal:e})=>je({signal:e})})}function Vr(e,t){let n=$().data,r=vr(t).data?.projects,i=gt(),a=e??i.projectId,o=a??n?.bootProject,s=o===void 0?void 0:r?.find(e=>e.id===o);return s?.repoUrl?s.repoUrl:a===null||a===n?.bootProject?ar(n?.repo?.remote):void 0}function Hr(){return A({queryKey:X.openTargets,queryFn:({signal:e})=>dt({signal:e}),staleTime:5*6e4})}function Ur(){return A({queryKey:X.runs.list(),queryFn:({signal:e})=>Ot(F(),{signal:e})})}function Wr(e,t){return Ft({queryKey:X.runs.archived(e),enabled:t,initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>me({before:t,limit:200,q:e},{signal:n}),getNextPageParam:e=>e.nextCursor??void 0,placeholderData:(e,t)=>t?.queryKey[0]===n()?e:void 0})}function Gr(e){let t=e.trim();return A({queryKey:Z.runsSearch(t),queryFn:({signal:e})=>Fe(t,{signal:e}),enabled:t.length>=2,placeholderData:At,staleTime:1e4})}function Kr(e=!0,t=bn,n){let r=Cn(y());return j(`/api/v1/workspace/runs-index`,Z.runsIndex,a(e?t:!1),wn),A({queryKey:Z.runsIndex,queryFn:({signal:e})=>_e({signal:e}).then(r.merge),enabled:e,...n?{select:n}:{},staleTime:3e4,refetchInterval:!1})}function qr(e){let t=y();return P({mutationFn:({workerId:e,discardWork:t=!1})=>qn(e,t),onSettled:()=>t.invalidateQueries({queryKey:X.runs.relationships(e)})})}function Jr(e,t={}){return A({queryKey:X.runs.relationships(e),queryFn:({signal:t})=>ge(e,{signal:t}),enabled:t.enabled??!0})}function Yr(e){return A({queryKey:X.runs.detail(e??``),queryFn:({signal:t})=>mt(I(e),{signal:t}),enabled:!!e})}function Xr(e,t,n=!0){return A({queryKey:[e??`default`,`runs`,`detail`,t??``],queryFn:({signal:n})=>mt(I(t,{projectId:e}),{signal:n}),enabled:n&&!!e&&!!t})}function Zr(e){return A({queryKey:X.runs.diff(e??``),queryFn:({signal:t})=>ke(e,{signal:t}),enabled:!!e})}function Qr(e,t=!1){return j(e?`/api/v1/p/${n()}/runs/${encodeURIComponent(e)}/changes`:void 0,X.runs.changes(e??``),a(t?4e3:!1)),A({queryKey:X.runs.changes(e??``),queryFn:({signal:t})=>ot(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:!1,refetchOnWindowFocus:!0,staleTime:0})}function $r(e,t){return A({queryKey:X.runs.file(e??``,t??``),queryFn:({signal:n})=>Et(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function ei(e,t){return A({queryKey:[n(),`runs`,`file-link`,e,t],queryFn:({signal:n})=>ht(e,t,{signal:n}),enabled:t!==null,retry:!1})}function ti(e,t){return A({queryKey:[n(),`runs`,`artifact`,e,t],queryFn:({signal:n})=>Nt(e,t,{signal:n}),enabled:t!==null,retry:!1})}function ni(e,t){return A({queryKey:[n(),`runs`,`artifact-metadata`,e,t],queryFn:({signal:n})=>d(e,t,{signal:n}),enabled:t!==null,retry:!1})}function ri(e){return A({queryKey:[n(),`runs`,`artifacts`,e],queryFn:({signal:t})=>ve(e,{signal:t}),retry:!1,staleTime:0,refetchOnWindowFocus:!0})}function ii(e,t=!1){return j(e?`/api/v1/p/${n()}/runs/${encodeURIComponent(e)}/commits`:void 0,X.runs.commits(e??``),a(t?5e3:!1)),A({queryKey:X.runs.commits(e??``),queryFn:({signal:t})=>Ge(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:!1})}function ai(e,t){return A({queryKey:X.runs.commit(e??``,t??``),queryFn:({signal:n})=>qe(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function oi(e,t=!0){return A({queryKey:X.runs.handoff(e??``),queryFn:({signal:t})=>Mt(I(e),{signal:t}),enabled:!!e&&t})}function si(e,t,n){return A({queryKey:e===void 0?X.runs.handoff(t):[e,`runs`,`handoff`,t],queryFn:({signal:n})=>Mt(I(t,{projectId:e}),{signal:n}),enabled:n,staleTime:15e3})}function ci(e,t){let r=[...new Set(e)],i=N({queries:r.map(e=>({queryKey:[e??n(),`automations`,`names`],queryFn:({signal:t})=>xe({signal:t,archived:`include`,...e===void 0?{}:{projectId:e}}),enabled:t,staleTime:6e4,retry:!1}))}),a=i.map(e=>e.data);return(0,M.useMemo)(()=>{let e=new Map;return a.forEach((t,n)=>{if(t?.available)for(let i of t.automations)e.set(JSON.stringify([r[n]??null,i.id]),i.name)}),(t,n)=>e.get(JSON.stringify([t??null,n]))},[JSON.stringify([r,i.map(e=>e.dataUpdatedAt)])])}function li(){return A({queryKey:X.workflows,queryFn:({signal:e})=>h({signal:e})})}function ui(){return A({queryKey:X.repo,queryFn:({signal:e})=>nt({signal:e})})}function di(e){return A({queryKey:[e,`repo`],queryFn:({signal:t})=>nt({signal:t},e)})}function fi(){return A({queryKey:X.repoBranches,queryFn:({signal:e})=>wt({signal:e})})}function pi(){return A({queryKey:X.repoChanges,queryFn:({signal:e})=>Le({signal:e}),retry:!1})}function mi(e){return A({queryKey:X.repoCommit(e??``),queryFn:({signal:t})=>Ue(e,{signal:t}),enabled:!!e,retry:!1})}function hi(){return A({queryKey:X.config,queryFn:({signal:e})=>oe({signal:e})})}function gi(){return A({queryKey:X.worktrees,queryFn:({signal:e})=>u({signal:e})})}function _i(e){return A({queryKey:[e,`worktrees`],queryFn:({signal:t})=>u({signal:t},e),staleTime:0})}function vi(e,t=!0,n=!1){return A({queryKey:[F({projectId:e,boot:n}).cacheScope,`ui-state`],queryFn:({signal:t})=>_({signal:t},e),select:e=>e.sidebarLimits===void 0?e:{...e,sidebarLimits:ce(e.sidebarLimits)},enabled:t})}function yi(){return vi(n())}function bi(){return A({queryKey:X.agentConfig,queryFn:({signal:e})=>v({signal:e})})}function xi(e){return A({queryKey:X.agentConfigFile(e??``),queryFn:({signal:t})=>ne(e,{signal:t}),enabled:e!==null})}function Si(e){let t=y(),n=X.agentConfig,r=X.agentConfigFile(e);return P({mutationFn:t=>te(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function Ci(){return A({queryKey:Z.uiState,queryFn:({signal:e})=>$e({signal:e})})}function wi(){return A({queryKey:Z.config,queryFn:({signal:e})=>le({signal:e})})}function Ti(){return A({queryKey:Z.agentProfiles,queryFn:({signal:e})=>se({signal:e})})}function Ei(e){let t=y();return P({mutationFn:t=>f(e,t),onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all})})}function Di(e){let t=H(),n=e?.projectId,r=e?.cacheScope,i=P({mutationFn:e=>pt(e,!0),onMutate:e=>t.patchRead(e,!0),onError:(e,t,n)=>n?.rollback(),onSuccess:(e,t,n)=>n?.settle(e)}),a=(0,M.useCallback)(e=>({...I(e,{projectId:n,cacheScope:r}),id:e}),[n,r]),o=(0,M.useCallback)(e=>({onSuccess:(t,n,r,i)=>e?.onSuccess?.(t,n.id,r,i),onError:(t,n,r,i)=>e?.onError?.(t,n.id,r,i),onSettled:(t,n,r,i,a)=>e?.onSettled?.(t,n,r.id,i,a)}),[]),{mutate:s,mutateAsync:c}=i,l=(0,M.useCallback)((e,t)=>s(a(e),o(t)),[s,a,o]),u=(0,M.useCallback)((e,t)=>c(a(e),o(t)),[c,a,o]);return{...i,variables:i.variables?.id,mutate:l,mutateAsync:u}}function Oi(){let e=H();return P({mutationFn:e=>pt(I(e),!1),onMutate:t=>e.patchRead(()=>I(t),!1),onError:(e,t,n)=>n?.rollback(),onSuccess:(e,t,n)=>n?.settle(e)})}function ki(e){let t=H();return P({mutationFn:({id:t,pinned:n})=>be(I(t,e),n),onError:e=>Rt(`Could not update pin. ${e.message} Please retry.`,{tone:`danger`}),onMutate:()=>e??F(),onSuccess:(e,n,r)=>t.invalidateAfter(`runs`,r)})}function Ai(e,t){let n=H();return P({mutationFn:n=>Ct(I(e,{projectId:t}),n),onMutate:()=>F({projectId:t}),onSuccess:(e,t,r)=>n.invalidateAfter(`send`,r),onError:(e,t,r)=>{e instanceof Je&&e.status===409&&r&&n.invalidateAfter(`send`,r)}})}function ji(e,t){let n=H();return P({mutationFn:(n={})=>Te(I(e,{projectId:t}),n),onMutate:()=>F({projectId:t}),onSuccess:(e,t,r)=>n.invalidateAfter(`continue`,r)})}function Mi(e){let t=y();return P({mutationFn:({msgId:t,message:n})=>Qe(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all})})}function Ni(e){let t=y();return P({mutationFn:t=>ct(e,t),onSuccess:()=>t.invalidateQueries({queryKey:X.runs.all})})}function Pi(e={},t=!0){let r=y(),i=X.github(e);j(`/api/v1/p/${n()}/github${e.limit===void 0?``:`?limit=${e.limit}`}`,i,a(t?6e4:!1));let o=A({queryKey:X.github(e),queryFn:({signal:t})=>ae({limit:e.limit},{signal:t}),enabled:t,staleTime:6e4,refetchInterval:!1,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0}),s=o.data?.projectsGeneration,c=A({queryKey:[...i,`projects`,s],queryFn:({signal:e})=>lt(s,{signal:e}),enabled:t&&o.data?.projectsState===`refreshing`&&!!s,staleTime:1/0,retry:!1});return(0,M.useEffect)(()=>{!s||!c.data&&!c.error||r.setQueryData(i,e=>{if(!e||e.projectsGeneration!==s||e.projectsState!==`refreshing`)return e;let t=c.data;return t?.generation&&t.generation!==s?e:t?.state===`ready`?{...e,projectsState:`ready`,projects:t.projects,issues:e.issues.map(e=>({...e,projectIds:t.membership?.[e.number]??[]}))}:{...e,projectsState:`unavailable`,projectsReason:t?.reason??`Project boards unavailable. Refresh to try again.`}})},[r,s,c.data,c.error,i]),o}var Fi=class extends Error{};function Ii(e,t,n){return{queryKey:e,initialPageParam:{},queryFn:async({pageParam:e,signal:r})=>{let i=await ae({limit:t,...e,...n?{projectId:n}:{}},{signal:r});if(!i.available&&Object.keys(e).length>0)throw new Fi(i.reason??`GitHub is unavailable.`);return i},getNextPageParam:e=>lr(e),retry:(e,t)=>!(t instanceof Fi)&&!(t instanceof Je&&t.status>=400&&t.status<500)&&e<1,staleTime:6e4,refetchOnWindowFocus:!0}}function Li(e=50,t=!0){let r=y(),i=X.githubPages(e),o=X.githubPagesHead(e);j(`/api/v1/p/${n()}/github?limit=${e}`,o,a(t?6e4:!1));let s=Ft({...Ii(i,e),enabled:t,refetchInterval:!1,refetchIntervalInBackground:!1}),c=A({queryKey:o,queryFn:({signal:t})=>ae({limit:e},{signal:t}),enabled:!1,staleTime:1/0}),{refetch:l}=s;(0,M.useEffect)(()=>{if(!c.data)return;let e=r.getQueryData(i);if(!e||e.pages.length===0)return;let t=pr(e.pages,c.data);t===`refetch`?l():r.setQueryData(i,{...e,pages:t})},[r,c.dataUpdatedAt,l]);let u=(s.data?.pages??[]).flatMap(e=>e.projectsState===`refreshing`&&e.projectsGeneration?[e.projectsGeneration]:[]),d=N({queries:u.map(e=>({queryKey:[...i,`projects`,e],queryFn:({signal:t})=>lt(e,{signal:t}),enabled:t,staleTime:1/0,retry:!1}))});return(0,M.useEffect)(()=>{d.forEach((e,t)=>{let n=u[t];!n||!e.data&&!e.error||r.setQueryData(i,t=>{if(!t)return t;let r=!1,i=t.pages.map(t=>{if(t.projectsGeneration!==n||t.projectsState!==`refreshing`)return t;let i=e.data;return i?.generation&&i.generation!==n?t:(r=!0,i?.state===`ready`?{...t,projectsState:`ready`,projects:i.projects,issues:t.issues.map(e=>({...e,projectIds:i.membership?.[e.number]??[]}))}:{...t,projectsState:`unavailable`,projectsReason:i?.reason??`Project boards unavailable. Refresh to try again.`})});return r?{...t,pages:i}:t})})},[r,d.map((e,t)=>e.data||e.error?u[t]:``).join(`,`)]),{pages:s,data:(0,M.useMemo)(()=>fr(s.data?.pages??[]),[s.data])}}function Ri(e,t=50,n=!0){let r=Ft({...Ii([e,`github`,`pages`,t],t,e),enabled:n});return{pages:r,data:(0,M.useMemo)(()=>fr(r.data?.pages??[]),[r.data])}}function zi(e,t,n=!0){let r=N({queries:t.filter(e=>e.length>0).map(t=>({queryKey:X.githubCommentCounts(e,t),queryFn:({signal:n})=>Se(e,t,{},{signal:n}),enabled:n,staleTime:6e4}))});return(0,M.useMemo)(()=>{let e={};for(let t of r)t.data?.available&&Object.assign(e,t.data.counts);return e},[r.map(e=>e.dataUpdatedAt).join(`,`)])}function Bi(e,t,n,r=!0){return A({queryKey:[e,`github`,`search`,t,n],queryFn:({signal:r})=>Ze(t,n,{projectId:e},{signal:r}),enabled:r&&n.trim()!==``,staleTime:6e4})}function Vi(e,t=!0){return A({queryKey:X.githubChecks(e),queryFn:({signal:t})=>Ce(e,{signal:t}),enabled:t&&e.length>0,staleTime:6e4})}function Hi(e,t,n=!0){return A({queryKey:X.githubSearch(e,t),queryFn:({signal:n})=>Ze(e,t,{},{signal:n}),enabled:n&&t.trim()!==``,staleTime:6e4})}var Ui=100;function Wi(e){return[...e].sort((e,t)=>t-e).slice(0,Ui).sort((e,t)=>e-t)}function Gi(){let e=gt(),t=$();return e.projectId??t.data?.bootProject}function Ki(e){for(let[t,n]of Object.entries(e)){for(let[e,r]of Object.entries(n.prs))In(q({projectId:t,kind:`PR`,number:Number(e)}),r);for(let[e,r]of Object.entries(n.issues))In(q({projectId:t,kind:`Issue`,number:Number(e)}),r)}}var qi=5*6e4;function Ji(e){return e?e.recheckAfterMs:qi}function Yi(e,t=!0){let n=(0,M.useMemo)(()=>{let t=new Map;for(let n of e){let e=t.get(n.projectId)??{prs:new Set,issues:new Set};e[n.kind===`PR`?`prs`:`issues`].add(n.number),t.set(n.projectId,e)}return[...t.entries()].map(([e,t])=>({projectId:e,prs:Wi(t.prs),issues:Wi(t.issues)}))},[e.map(q).sort().join(`|`)]),r=N({queries:n.map(e=>({queryKey:X.githubRefStatus(e.projectId,e.prs,e.issues),queryFn:({signal:t})=>vt(e.projectId,{prs:e.prs,issues:e.issues},{signal:t}),enabled:t&&e.prs.length+e.issues.length>0,staleTime:e=>Ji(e.state.data)??1/0,refetchInterval:!1,refetchOnWindowFocus:!0}))}),a=y(),o=JSON.stringify(n.map((e,t)=>({...e,interval:Ji(r[t]?.data)??!1})));(0,M.useEffect)(()=>{if(!t||i())return;let e=!0,n=JSON.parse(o).filter(e=>e.interval!==!1).map(t=>{let n=new URLSearchParams;t.prs.length&&n.set(`prs`,t.prs.join(`,`)),t.issues.length&&n.set(`issues`,t.issues.join(`,`));let r=X.githubRefStatus(t.projectId,t.prs,t.issues);return It({path:`/api/v1/p/${t.projectId}/github/ref-status?${n}`,intervalMs:t.interval},(t,n)=>{n||a.cancelQueries({queryKey:r,exact:!0}).then(()=>{e&&a.setQueryData(r,t)})})});return()=>{e=!1;for(let e of n)e()}},[t,o,a]);let s=(0,M.useMemo)(()=>Kn(n,r),[n,r.map(e=>`${e.dataUpdatedAt}:${e.status}`).join(`,`)]);return(0,M.useCallback)(e=>{let t=q(e),n=s.get(t);if(n)return n;let r=G.get(t);return{state:`idle`,...r?{status:r}:{},...K.has(t)?{conflicting:!0}:{}}},[s])}function Xi(e,t,n=!0){return A({queryKey:X.githubComments(e,t),queryFn:({signal:n})=>we(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function Zi(e,t,n=!0){return A({queryKey:X.githubItem(e,t),queryFn:({signal:n})=>fe(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}function Qi(e){return A({queryKey:X.githubPrChanges(e??0),queryFn:({signal:t})=>Be(e,{},{signal:t}),enabled:e!==void 0,staleTime:6e4,retry:!1})}export{gr as $,Qi as A,wi as At,Ri as B,Mn as Bt,Pi as C,si as Ct,Zi as D,Sr as Dt,Xi as E,jr as Et,Oi as F,ur as Ft,vi as G,Kt as Gt,di as H,H as Ht,kr as I,or as It,hr as J,I as Jt,_i as K,Gt as Kt,Hr as L,sr as Lt,$ as M,gi as Mt,Br as N,Z as Nt,zr as O,Er as Ot,Di as P,mr as Pt,Yi as Q,Ei as R,ar as Rt,yr as S,Ai as St,zi as T,yi as Tt,Vr as U,L as Ut,Bi as V,Cn as Vt,Xr as W,Jt as Wt,Ir as X,N as Xt,Si as Y,P as Yt,Gi as Z,zt as Zt,Rr as _,Jr as _t,xi as a,ui as at,Mi as b,Gr as bt,ti as c,mi as ct,ci as d,Qr as dt,br as et,Lr as f,ai as ft,Ar as g,oi as gt,ji as h,$r as ht,bi as i,Ni as it,Hi as j,Ci as jt,Li as k,li as kt,ni as l,_r as lt,Fr as m,Zr as mt,Ki as n,xr as nt,Ti as o,fi as ot,hi as p,ii as pt,vr as q,F as qt,Pr as r,Dr as rt,Wr as s,pi as st,X as t,Mr as tt,ri as u,Yr as ut,Tr as v,Ur as vt,Vi as w,Or as wt,ei as x,Nr as xt,qr as y,Kr as yt,ki as z,An as zt};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{n as r,t as i}from"./utils-DSMR_WLb.js";import{Fn as a,Gn as o,Lt as s,Pn as c,Rt as l,Wn as u,ci as d,i as f,jn as p,k as m,mr as h,o as g,pr as _,qn as v,rr as y,tr as b}from"./project-scope-context-Dgq8_2JZ.js";import{F as x,Ht as ee,I as te,J as S,Jt as ne,L as re,M as ie,R as C,U as w,Yt as T,Z as E,_t as D,gt as ae,q as oe,qt as se,t as ce,ut as le,vt as ue,y as de,z as fe}from"./queries-yuG-mM6_.js";import{d as pe,h as me}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{a as he,d as ge,f as _e,g as ve,m as ye,o as be,p as xe,s as Se}from"./tasks-table-DTNcYbbN.js";import{n as O}from"./toaster-Bo5vCbz-.js";import{s as Ce}from"./runners-CDw7wLfd.js";import{A as we,F as Te,a as Ee,at as De,f as Oe,ft as ke,g as Ae,h as je,i as Me,l as Ne,m as Pe,p as Fe,q as Ie,t as Le,v as k,x as Re}from"./design-icons-CzEoMH9c.js";import{t as A}from"./createLucideIcon-BHp8sXmF.js";import{t as ze}from"./app-window-CSHwDX9N.js";import{n as Be,r as Ve,t as He}from"./open-in-menu-D03osLGE.js";import{t as Ue}from"./info-DA1x_4bz.js";import{a as We,t as Ge}from"./format-BNCkW110.js";import{t as Ke}from"./message-square-B-MD-8rD.js";import{i as qe,n as Je,t as j}from"./reference-chip-DTKtEtWv.js";import{t as Ye}from"./square-terminal-B6RYYieR.js";import{t as M}from"./button-BQ2y4XRB.js";import{a as N,i as P,l as F,n as I,p as L,r as R,t as z}from"./dropdown-menu-4e2iKSMT.js";import{i as Xe,r as Ze,t as Qe}from"./popover-BPgUYFyu.js";import{a as $e,i as et,o as tt,r as nt,s as rt,t as it}from"./dialog-BVF6dIeS.js";import{c as at,s as ot,t as B}from"./project-router-DtTvMbeA.js";import"./attention-otQlgfRj.js";import{T as st,f as V,u as ct,x as lt}from"./task-groups-D4RYW5I_.js";import{t as H}from"./status-dot-DtAOFiIi.js";import{$t as ut,An as dt,B as U,Bt as ft,Gn as pt,Gt as mt,Ht as ht,Kn as gt,Kt as _t,Qt as vt,R as yt,Ut as bt,Vt as xt,Wt as St,Xn as Ct,a as W,dn as G,en as wt,fn as K,jn as Tt,kn as Et,m as Dt,nn as Ot,nr as kt,o as At,qt as jt,r as Mt,rn as Nt,sn as Pt,yn as Ft,z as It}from"./index-DXIRYobS.js";import{r as Lt,t as Rt}from"./markdown-CT65TA_B.js";import{i as zt}from"./automation-format-BsnXeUET.js";import{t as Bt}from"./textarea-vJt9undk.js";import{t as q}from"./tab-link-Dl5Mmavw.js";var Vt=A(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),Ht=A(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Ut=A(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),J=e(t(),1),Y=n();function Wt(e){let t=ee();return T({mutationFn:t=>g(ne(e),t),onSuccess:()=>t.invalidateAfter(`runs`,()=>se()),onError:e=>O(e.message,{tone:`danger`})})}function Gt(e){return e.archived?`Unarchive`:`Archive task`}function Kt({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,Y.jsx)(ft,{open:t,onOpenChange:n,children:(0,Y.jsxs)(bt,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Y.jsxs)(_t,{children:[(0,Y.jsx)(jt,{children:`Archive task?`}),(0,Y.jsxs)(St,{children:[`Move “`,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,title:V(e),children:V(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,Y.jsxs)(mt,{children:[(0,Y.jsx)(ht,{children:`Cancel`}),(0,Y.jsx)(xt,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function X({run:e,className:t,compactOnMobile:n=!1}){let[r,a]=(0,J.useState)(!1),o=Wt(e.id),s=Gt(e);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(M,{type:`button`,variant:`outline`,"data-slot":`archive-action`,"aria-label":s,title:e.archived?`Put this task back in Active tasks`:`Move this task out of Active tasks`,disabled:o.isPending,className:i(`h-11 gap-[7px] px-3`,n&&`max-md:size-11 max-md:px-0`,t),onClick:()=>e.archived?o.mutate(!1):a(!0),children:[e.archived?(0,Y.jsx)(kt,{"aria-hidden":`true`}):(0,Y.jsx)(Le,{"aria-hidden":`true`}),(0,Y.jsx)(`span`,{className:i(n&&`max-md:sr-only`),children:s})]}),(0,Y.jsx)(Kt,{run:e,open:r,onOpenChange:a,onConfirm:()=>{o.mutate(!0),a(!1)}})]})}function qt({run:e,action:t,prUrl:n,patch:i}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:t.phase===`blocked`?`Completion blocked`:`Completion pending`}),` · `,t.message||(t.phase===`blocked`?`Completion needs attention.`:`Checking completion actions.`)]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n&&r(n)?(0,Y.jsx)(M,{variant:`outline`,asChild:!0,children:(0,Y.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:`Open PR`})}):null,e.autoMergePr?(0,Y.jsx)(M,{variant:`outline`,disabled:i.isPending,onClick:()=>i.mutate({autoMergePr:!1},{onError:e=>O(e.message,{tone:`danger`})}),children:i.isPending?`Saving…`:`Disable auto-merge`}):null]})]})}function Jt({run:e,blocker:t,flags:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Archive blocked`}),` · `,t.message]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.runId?(0,Y.jsx)(M,{variant:`outline`,asChild:!0,children:(0,Y.jsx)(B,{to:`/tasks/${t.runId}`,children:`Open blocking task`})}):null,t.pullRequestUrl&&r(t.pullRequestUrl)?(0,Y.jsx)(M,{variant:`outline`,asChild:!0,children:(0,Y.jsx)(`a`,{href:t.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,children:`Open blocking PR`})}):null,n.archive?(0,Y.jsx)(X,{run:e}):null]})]})}function Yt({run:e}){let t=C(e.id),n=K(e),r=e.status===`done`?e.completionAction:void 0,i=n.archive?e.archiveBlocker:void 0,a=r&&r.phase!==`complete`?r:void 0;if(!a&&!i)return null;let o=e.pullRequestUrl??e.pullRequests?.find(e=>e.url)?.url;return(0,Y.jsxs)(`section`,{"data-slot":`completion-status`,"aria-label":`Completion action`,className:`grid min-w-0 gap-2 rounded-lg border border-border bg-card p-3 [margin-block:0.75rem]`,children:[a?(0,Y.jsx)(qt,{run:e,action:a,prUrl:o,patch:t}):null,i?(0,Y.jsx)(Jt,{run:e,blocker:i,flags:n}):null]})}var Xt=[`running`,`queued`,`waiting`];function Zt(e,{queuePosition:t,now:n=new Date}){let r=p(e),i=r.label.charAt(0).toUpperCase()+r.label.slice(1),a=t===void 0?i:`${i} #${t}`,o=Xt.includes(e.status)?$t(e,n):void 0;return o?{attention:r,label:a,nextCheck:o}:{attention:r,label:a}}function Qt(e){return e.nextCheck?`${e.label} · Next check ${e.nextCheck.text}`:e.label}function $t(e,t){let n;for(let t of Array.isArray(e.waits)?e.waits:[]){if(t?.kind!==`timer`||t.phase!==`open`)continue;let e=new Date(t.deadline);Number.isFinite(e.getTime())&&(!n||e<n)&&(n=e)}if(n)return{at:n.toISOString(),text:Ge(n,t)}}async function Z(e,t){try{await navigator.clipboard.writeText(e),O(t)}catch{O(`Run manually: ${e}`)}}function en(e){let t=w(),n=E(),r=(0,J.useMemo)(()=>ve(e,t),[e,t]);return{referenceProjectId:n,repoBase:t,references:r,requests:(0,J.useMemo)(()=>n===void 0?[]:r.filter(e=>he(e,t)).map(e=>({projectId:n,kind:e.kind,number:e.number})),[r,n,t])}}function tn(e){return T({mutationFn:()=>l(e.id),onError:e=>{if(e instanceof f&&e.command){Z(e.command,`No terminal found — command copied to clipboard.`);return}O(e.message,{tone:`danger`})}})}function Q(e,t){let n=re(),r=S(),i=Ce(),a=T({mutationFn:t=>s(e.id,t),onError:e=>O(e.message,{tone:`danger`})}),o=Ft(),c=st(e),l=o.runnersOn(e=>t&&c.sessionId!==void 0&&e===c.backend?c.profileId??`default`:o.repoAccount?.[e]).runners,u=e=>!r.isSuccess||!i.isSuccess||l.includes(e??`claude`);return{canResumeHere:t&&u(Pt(e)),choices:e.worktreePath?(n.data?.targets??[]).filter(e=>{let t=Be(e.id);return t===void 0||i.isSuccess&&u(t)}).map(t=>({target:t,...Nt(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[],open:a}}function nn({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Q(e,t),o=Ce().data,s=G(e);return!r&&i.length===0&&!s?null:(0,Y.jsxs)(Y.Fragment,{children:[r||i.length>0?(0,Y.jsxs)(`div`,{className:`task-open-targets flex flex-wrap gap-3`,children:[r?(0,Y.jsxs)(M,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,Y.jsx)(Ye,{}),`Terminal (resume session)`]}):null,i.map(({target:e,suffix:t,title:n})=>{let r=Ve(e,o);return(0,Y.jsxs)(M,{variant:`outline`,"data-target":e.id,title:n,disabled:a.isPending,onClick:()=>a.mutate(e.id),children:[(0,Y.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,Y.jsxs)(M,{variant:`outline`,onClick:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>O(`Worktree path copied`)).catch(()=>O(`Path: ${t}`))},children:[(0,Y.jsx)(k,{}),`Copy worktree path`]}):null]}):null,s?(0,Y.jsxs)(`div`,{"data-slot":`resume-command`,className:`mt-5 border-t border-border pt-5`,children:[(0,Y.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,Y.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:s}),(0,Y.jsxs)(M,{variant:`outline`,onClick:()=>void Z(s,`Command copied to clipboard.`),children:[(0,Y.jsx)(k,{}),`Copy resume command`]})]}):null]})}function rn({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Q(e,t),o=G(e),s=e.worktreePath;if(!r&&i.length===0&&!o&&!s)return null;let c=`max-md:min-h-11`;return(0,Y.jsxs)(`div`,{"data-slot":`workspace-tools`,className:`flex min-w-0 flex-wrap gap-2`,children:[r||i.length>0?(0,Y.jsx)(He,{choices:i,onPick:e=>a.mutate(e),disabled:a.isPending,triggerVariant:`outline`,className:c,leading:r?(0,Y.jsxs)(P,{"data-target":`terminal-resume`,onSelect:n,children:[(0,Y.jsx)(Ye,{"aria-hidden":`true`}),`Terminal (resume session)`]}):void 0}):null,s?(0,Y.jsxs)(M,{variant:`outline`,size:`sm`,className:c,onClick:()=>void Z(s,`Worktree path copied`),children:[(0,Y.jsx)(k,{"aria-hidden":`true`}),`Copy worktree path`]}):null,o?(0,Y.jsxs)(M,{variant:`outline`,size:`sm`,"data-slot":`resume-command`,title:o,className:c,onClick:()=>void Z(o,`Command copied to clipboard.`),children:[(0,Y.jsx)(k,{"aria-hidden":`true`}),`Copy resume command`]}):null]})}function an({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let{canResumeHere:a,choices:o}=Q(e,t);return!a&&o.length===0?null:r?(0,Y.jsx)(P,{onSelect:r,children:`Open in…`}):(0,Y.jsxs)(`section`,{"aria-label":`Open task worktree in…`,className:`task-action-panel my-5 rounded-xl border border-border bg-card p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,Y.jsx)(M,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,Y.jsx)(ke,{})})]}),e.worktreePath?(0,Y.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(nn,{run:e,canResume:t,onResume:n})})]})}function on({branch:e}){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(null);(0,J.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);let i=t===e,a=async()=>{r.current!==null&&clearTimeout(r.current),n(null);try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(e),n(e),r.current=setTimeout(()=>n(null),2e3)}catch{O(`Could not copy branch. Select and copy: ${e}`)}};return(0,Y.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,children:[(0,Y.jsx)(`span`,{"data-slot":`branch-chip`,className:`min-w-0 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium break-all`,children:e}),(0,Y.jsxs)(`button`,{type:`button`,"aria-label":i?`Copied branch name`:`Copy branch name`,onClick:()=>void a(),className:`inline-flex min-h-11 shrink-0 items-center gap-1 rounded-sm px-2 text-xs font-medium text-foreground hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground md:min-h-8`,children:[(0,Y.jsx)(k,{className:`size-3.5`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function sn({run:e}){let t=w(),n=E(),i=r=>n===void 0?void 0:_e(n,e.id,r,t),a=(0,J.useMemo)(()=>ve(e,t),[e,t]),o=[],s=[],c=a.filter(e=>e.kind===`PR`);for(let t of c)o.push((0,Y.jsx)(j,{reference:t,to:i(t),taskTitle:V(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,Y.jsx)(wt,{run:e,prNumber:t.number})},Se(t)));let l=ye(e);l&&r(l)&&!c.some(e=>e.url===l)&&o.push((0,Y.jsx)(j,{reference:{kind:`PR`,url:l},taskTitle:V(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`pr`));let u=a.filter(e=>e.kind===`Issue`);for(let t of u)s.push((0,Y.jsx)(j,{reference:t,to:i(t),taskTitle:V(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},Se(t)));let d=ge(e,t);if(d&&r(d)&&!u.some(e=>e.url===d)){let t=be(d);s.push((0,Y.jsx)(j,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},to:t?i({kind:`Issue`,number:Number(t),url:d}):void 0,taskTitle:V(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`issue`))}return o.length===0&&s.length===0?null:(0,Y.jsx)(`div`,{"data-slot":`linked-references`,className:`flex min-w-0 flex-col gap-3`,children:[[`PR`,`PRs`,o],[`Issue`,`Issues`,s]].map(([e,t,n])=>n.length>0?(0,Y.jsxs)(`div`,{"data-reference-kind":e,className:`grid min-w-0 grid-cols-[5rem_minmax(0,1fr)] items-center gap-x-2 gap-y-1`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:n})]},e):null)})}function cn(){let e=ot(),t=oe();return yt(t.data?.projects?.find(n=>n.id===(e??t.data?.bootProject)))}var ln=e=>e.map(e=>`${e.name}: ${It(e.url)}`).join(`
|
|
2
|
-
`);function un(e){return cn().length>0||e.notify===!0}function dn({run:e}){let t=cn(),n=t.length>0,r=te(e.id),[i,a]=(0,J.useState)(null),o=e.notify===!0;return!n&&!o?null:(0,Y.jsxs)(Y.Fragment,{children:[o?(0,Y.jsxs)(z,{children:[(0,Y.jsx)(L,{asChild:!0,children:(0,Y.jsxs)(M,{variant:`outline`,size:`sm`,"data-slot":`notifying-chip`,className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":n?`Notifying ${U(t)} — webhook actions`:`Notifying — webhook actions`,title:n?ln(t):void 0,children:[(0,Y.jsx)(H,{tone:`success`}),(0,Y.jsx)(`span`,{children:`Notifying`}),(0,Y.jsx)(Ne,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,Y.jsxs)(R,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[n?(0,Y.jsx)(N,{"data-slot":`notifying-targets`,className:`flex flex-col gap-0.5 px-2 py-1.5 text-[11px] font-normal text-muted-foreground`,children:t.map(e=>(0,Y.jsx)(`span`,{"data-webhook-target":e.id,className:`truncate`,title:It(e.url),children:e.name},e.id))}):null,n?(0,Y.jsxs)(P,{className:`min-h-11`,onSelect:()=>a(`note`),children:[(0,Y.jsx)(Ke,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,Y.jsxs)(P,{variant:`destructive`,className:`min-h-11`,disabled:r.isPending,onSelect:()=>r.mutate({notify:!1},{onSuccess:()=>O(`Stopped notifying the webhook`),onError:e=>O(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),children:[(0,Y.jsx)(Vt,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,Y.jsxs)(M,{variant:`outline`,size:`sm`,"data-action":`handoff`,className:`size-11 px-0 md:h-[30px] md:w-auto md:px-2.5`,"aria-label":`Hand off to webhook`,onClick:()=>a(`handoff`),children:[(0,Y.jsx)(pt,{"aria-hidden":`true`}),(0,Y.jsx)(`span`,{className:`max-md:sr-only`,children:`Hand off`})]}),n?(0,Y.jsx)(fn,{mode:i,targets:t,pending:r.isPending,onOpenChange:e=>!e&&a(null),onSubmit:e=>r.mutate({notify:!0,...e?{message:e}:{}},{onSuccess:()=>{a(null),O(i===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>O(`Could not hand off. ${e.message}`,{tone:`danger`})})}):null]})}function fn({mode:e,targets:t,pending:n,onOpenChange:r,onSubmit:i}){let a=(0,J.useId)(),o=(0,J.useId)(),[s,c]=(0,J.useState)(``);(0,J.useEffect)(()=>{e!==null&&c(``)},[e]);let l=e===`note`,u=U(t);return(0,Y.jsx)(it,{open:e!==null,onOpenChange:e=>{e||c(``),r(e)},children:(0,Y.jsx)(nt,{"data-slot":`handoff-dialog`,className:`max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none max-sm:rounded-t-xl max-sm:border-x-0 max-sm:border-b-0 max-sm:pb-[max(1.5rem,env(safe-area-inset-bottom))] max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=closed]:zoom-out-100`,children:(0,Y.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),i(s.trim())},children:[(0,Y.jsxs)(tt,{className:`text-left`,children:[(0,Y.jsx)(rt,{children:l?`Send a note to ${t.length===1?`the webhook`:`the webhooks`}`:`Hand off to webhook`}),(0,Y.jsx)(et,{children:(0,Y.jsx)(`span`,{"data-webhook-destination":``,title:ln(t),children:l?`${u} ${t.length===1?`gets`:`get`} this note with the task's current status.`:`${u} will start receiving this task's status updates. Add a note (optional).`})})]}),(0,Y.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,Y.jsx)(`label`,{htmlFor:a,className:`text-[13px] font-medium`,children:`Note`}),(0,Y.jsx)(Bt,{id:a,"data-slot":`handoff-note`,"aria-describedby":o,rows:4,maxLength:1e5,className:`min-h-24`,placeholder:`e.g. Take over from here, ping me when the PR is green`,value:s,onChange:e=>c(e.target.value)}),(0,Y.jsxs)(`p`,{id:o,className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[(0,Y.jsx)(Ue,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,Y.jsxs)($e,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:h-11 max-sm:[&>button]:w-full`,children:[(0,Y.jsx)(M,{type:`button`,variant:`ghost`,className:`sm:h-9`,onClick:()=>r(!1),children:`Cancel`}),(0,Y.jsxs)(M,{type:`submit`,variant:`contrast`,className:`sm:h-9`,"data-action":`handoff-submit`,disabled:n||l&&s.trim()===``,children:[(0,Y.jsx)(pt,{"aria-hidden":`true`}),l?`Send note`:`Hand off`]})]})]})})})}function pn({runId:e,children:t}){let n=pe(),r=(0,J.useMemo)(()=>({runId:e}),[e]);return n?(0,Y.jsx)(mn,{runId:e,children:t}):(0,Y.jsx)(Lt.Provider,{value:r,children:t})}function mn({runId:e,children:t}){let{projectId:n}=me(),r=(0,J.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,Y.jsx)(Lt.Provider,{value:r,children:t})}function hn(e,t,n,r){return n?r===`step`?`Step ${e} of ${t}`:`${e} of ${t} complete`:`${e} / ${t}`}function gn(e){return typeof e==`object`&&!!e&&!(0,J.isValidElement)(e)&&`keep`in e}function _n({slot:e,icon:t,title:n,meta:r,summary:a,aside:o,open:s,onToggle:c,className:l,children:u}){let d=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center text-accent-text`,children:t}),(0,Y.jsx)(`span`,{className:i(`truncate text-[14px] font-semibold text-foreground`,typeof n==`string`?`shrink-0`:`min-w-0 shrink`),children:n}),a??(gn(r)?(0,Y.jsxs)(`span`,{"data-slot":`run-activity-meta`,className:`contents text-[13px] text-muted-foreground tabular-nums`,children:[r.drop===void 0?null:(0,Y.jsxs)(`span`,{className:`flex h-[1lh] min-w-0 shrink-[2] flex-wrap overflow-hidden`,children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`h-[1lh] w-0`}),(0,Y.jsxs)(`span`,{"data-slot":`run-activity-meta-drop`,className:`whitespace-nowrap`,children:[r.drop,(0,Y.jsx)(`span`,{className:`text-soft-foreground`,children:` ·`})]})]}),` `,(0,Y.jsx)(`span`,{"data-slot":`run-activity-meta-keep`,className:`shrink-0 whitespace-nowrap`,children:r.keep})]}):r===void 0?null:(0,Y.jsx)(`span`,{"data-slot":`run-activity-meta`,className:`min-w-0 shrink-[2] truncate text-[13px] text-muted-foreground tabular-nums`,children:r}))]}),f=c!==void 0;return(0,Y.jsxs)(`div`,{"data-slot":`run-activity-${e}`,"data-state":f&&s?`open`:`collapsed`,className:i(`min-w-0 border-t border-border first:border-t-0`,l),children:[f?(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":s,onClick:c,className:`flex min-h-11 w-full min-w-0 items-center gap-2.5 px-3.5 py-2 text-start hover:bg-muted/40 active:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`,children:[d,o,(0,Y.jsx)(Ne,{"aria-hidden":!0,className:i(`size-4 shrink-0 text-soft-foreground motion-safe:transition-transform motion-reduce:transition-none`,!o&&`ms-auto`,s&&`rotate-180`)})]}):(0,Y.jsxs)(`div`,{className:`flex min-h-11 w-full min-w-0 items-center gap-2.5 px-3.5 py-2`,children:[d,o]}),f&&s?(0,Y.jsx)(`div`,{"data-slot":`run-activity-body`,className:`min-w-0 border-t border-border/60 bg-muted/30 px-3.5 py-2.5`,children:u}):null]})}function $(e){return _(e.delegation)}function vn(e,t){let n=e?.role===`root`?e.receipts.map(e=>e.workerId).reverse():[];return[...new Set([...n,...(t?.workers??[]).map(e=>e.workerId)])]}function yn(e){let t=e.delegation,n=$(e),r=D(e.id,{enabled:n});if(!n||!t)return`complete`;if(!r.isSuccess)return r.isError||r.fetchStatus===`paused`?`unknown`:`pending`;let i=new Map(r.data.workers.map(e=>[e.workerId,e])),a=vn(t,r.data).map(e=>{let t=i.get(e)?.status;return t===`done`||t===`cancelled`?`complete`:t===void 0||t===`failed`?`issue`:`pending`});return a.includes(`pending`)?`pending`:a.includes(`issue`)?`issue`:`complete`}function bn(e){let t=D(e.id,{enabled:e.delegation?.role===`root`});return t.isSuccess&&t.data.workers.some(e=>lt(e.status))}function xn({run:e,open:t,onToggle:n}){let r=D(e.id),a=ue(),s=ut(),c=e.delegation,l=new Map(r.data?.workers.map(e=>[e.workerId,e])),d=vn(c,r.data),f=u(e)??o(e),p=f?Sn(e,f):void 0,m=e=>a.data?.find(t=>t.id===e)??r.data?.titles?.find(t=>t.id===e),h=e=>{let t=m(e);return t?V(t):`worker ${e.slice(0,8)}`};return(0,Y.jsx)(_n,{slot:`workers`,icon:(0,Y.jsx)(we,{className:`size-4`}),title:`Workers`,meta:Cn({ids:d,workers:l,desktop:s,query:r}),aside:r.data?.capacity?(0,Y.jsx)(An,{capacity:r.data.capacity}):void 0,open:t,onToggle:n,children:(0,Y.jsxs)(`div`,{"aria-label":`Task relationships`,className:`min-w-0 text-[13px] text-muted-foreground`,role:`group`,children:[r.data?.capacity&&r.data.capacity.outstanding>=r.data.capacity.limit?(0,Y.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`All worker slots are in use. Clean up finished workers to free a slot.`}):null,f?(0,Y.jsx)(Dn,{wait:f,dependencyLabel:p}):null,d.length>0?(0,Y.jsx)(`ul`,{className:`grid max-h-64 min-w-0 gap-0.5 overflow-y-auto`,children:d.map(t=>{let n=l.get(t),a=m(t),o=n?Tn(n.status):r.isSuccess?`Record unavailable or deleted`:`Status unavailable`;return(0,Y.jsxs)(`li`,{"data-slot":`worker-item`,"data-status":n?.status,className:`min-w-0`,children:[(0,Y.jsxs)(B,{to:`/tasks/${t}`,"aria-label":`Worker task ${t}`,className:`group flex min-h-11 min-w-0 items-center gap-2.5 rounded-md px-1 text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,Y.jsx)(wn,{status:n?.status}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`span`,{className:`block truncate`,children:a?V(a):`Worker ${t.slice(0,8)}`}),n?.supervisorRunId&&n.supervisorRunId!==e.id?(0,Y.jsxs)(`span`,{"data-slot":`worker-supervisor`,className:`block truncate text-xs text-muted-foreground`,children:[`Started by `,h(n.supervisorRunId)]}):null]}),(0,Y.jsx)(`span`,{className:i(`max-w-[45%] shrink-0 truncate text-xs`,En(n?.status)),children:o}),(0,Y.jsx)(Ee,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground`})]}),n?(0,Y.jsx)(Mn,{parentRunId:e.id,worker:n}):null,n?.destroy?(0,Y.jsx)(In,{state:n.destroy}):null]},t)})}):$(e)&&r.isSuccess?(0,Y.jsx)(`p`,{className:`px-1 py-1`,children:`No workers`}):null,r.fetchStatus===`paused`?(0,Y.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Offline — relationship details will refresh when connected.`}):r.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Loading relationships…`}):null,r.isError?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-1 py-1`,children:[(0,Y.jsx)(`p`,{role:`status`,children:`Could not load relationships. Known task links are retained.`}),(0,Y.jsx)(M,{variant:`outline`,className:`min-h-11`,onClick:()=>void r.refetch(),children:`Retry relationships`})]}):null]})})}function Sn(e,t){let n=e.delegation;if(!(!n||n.role===`invalid`))return a(e)??c(n.role,t,`requestIds`in t&&v(n,t.requestIds))}function Cn({ids:e,workers:t,desktop:n,query:r}){if(e.length===0)return r.isError?`Unavailable`:r.isPending?`Linking…`:`No workers`;let i=`${e.length} linked`;if(!n)return i;let a=new Map;for(let n of e){let e=t.get(n)?.status;e!==void 0&&a.set(e,(a.get(e)??0)+1)}return[i,...[...a.entries()].map(([e,t])=>`${t} ${e}`)].join(` · `)}function wn({status:e}){let t=`size-[15px] shrink-0`;return e===`done`?(0,Y.jsx)(Oe,{"aria-hidden":!0,className:i(t,`text-success`)}):e===`failed`?(0,Y.jsx)(Ae,{"aria-hidden":!0,className:i(t,`text-danger`)}):e===`cancelled`?(0,Y.jsx)(je,{"aria-hidden":!0,className:i(t,`text-soft-foreground`)}):e===`running`||e===`waiting`||e===`review`?(0,Y.jsx)(We,{role:`status`,"aria-label":`Worker running`,className:i(t,`animate-spin stroke-pending motion-reduce:animate-none`)}):(0,Y.jsx)(Pe,{"aria-hidden":!0,className:i(t,`text-soft-foreground`)})}function Tn(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function En(e){return e===`done`?`text-success`:e===`failed`?`text-danger`:`text-muted-foreground`}function Dn({wait:e,dependencyLabel:t}){return(0,Y.jsxs)(`p`,{className:`px-2 break-words`,children:[e.phase===`parked`&&t?`${t.charAt(0).toUpperCase()}${t.slice(1)}`:`requestIds`in e&&e.requestIds?e.phase===`parked`?`Waiting on request replies`:e.phase===`wake-pending`?`Conversation update queued for this task`:`Request wait registered — the agent is finishing its turn`:e.phase===`parked`?`Waiting on workers`:e.phase===`wake-pending`?`Worker update queued for the parent`:`Worker wait registered — the agent is finishing its turn`,`.`,`deadline`in e?(0,Y.jsxs)(Y.Fragment,{children:[` `,`Deadline: `,(0,Y.jsx)(`time`,{dateTime:e.deadline,children:e.deadline})]}):` No deadline: Squawk wakes this task when they have all settled.`]})}function On(e){return e.delegation?.role===`worker`&&o(e)?.phase===`wake-pending`}function kn({run:e}){let t=o(e);return e.delegation?.role===`worker`&&t?.phase===`wake-pending`?(0,Y.jsx)(Dn,{wait:t,dependencyLabel:c(`worker`,t)}):null}function An({capacity:e}){return(0,Y.jsxs)(`span`,{"data-slot":`worker-capacity`,role:`status`,"aria-label":`Worker capacity: ${e.outstanding} of ${e.limit} in use`,className:`ms-auto shrink-0 whitespace-nowrap text-[13px] font-normal text-muted-foreground tabular-nums`,children:[e.outstanding,` of `,e.limit,` in use`]})}var jn=new Set([`review`,`done`,`failed`,`cancelled`]);function Mn({parentRunId:e,worker:t}){let n=de(e),[r,i]=(0,J.useState)(!1);if(!jn.has(t.status)||t.destroy?.phase===`complete`&&t.destroy.remaining.length===0)return null;let a=t.workerId.slice(0,8),o=!!t.destroy&&t.destroy.phase!==`complete`,s=n.error instanceof f?n.error.work:void 0;return(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 px-1`,children:[r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`break-words text-xs`,children:h(t.workspace)?`Removes this worker's worktree and branch. Its result is saved first.`:`Stops this worker and frees its slot. It runs in this task's worktree, so no worktree or branch is removed. Its result is saved first.`}),(0,Y.jsx)(M,{variant:`danger-ghost`,size:`sm`,className:`min-h-11`,"aria-label":`Confirm clean up of worker ${a}`,onClick:()=>{i(!1),n.mutate({workerId:t.workerId})},children:`Clean up`}),(0,Y.jsx)(M,{variant:`outline`,size:`sm`,className:`min-h-11`,onClick:()=>i(!1),children:`Cancel`})]}):(0,Y.jsx)(M,{variant:`outline`,size:`sm`,className:`min-h-11`,"aria-label":o?`Retry clean up of worker ${a}`:`Clean up worker ${a}`,disabled:n.isPending,onClick:()=>i(!0),children:n.isPending?`Cleaning up…`:o?`Retry clean up`:`Clean up`}),n.isError&&!r?(0,Y.jsx)(`span`,{role:`status`,className:`break-words text-xs`,children:s?`Cleanup stopped: this worker holds ${Pn(s)}. Land or commit what you need first, or discard it.`:`Cleanup did not finish: ${n.error.message}`}):null,s&&!r&&!n.isPending?(0,Y.jsx)(M,{variant:`danger-ghost`,size:`sm`,className:`min-h-11`,"aria-label":`Discard work and clean up worker ${a}`,onClick:()=>n.mutate({workerId:t.workerId,discardWork:!0}),children:`Discard work and clean up`}):null]})}var Nn=(e,t,n)=>`${e} ${e===1?t:n}`;function Pn(e){return[...e.uncommittedFiles?[Nn(e.uncommittedFiles,`uncommitted file`,`uncommitted files`)]:[],...e.commits?[`${Nn(e.commits,`commit`,`commits`)} no other branch reaches`]:[]].join(` and `)}function Fn(e){return e!==void 0&&(e.phase!==`complete`||e.remaining.length>0||e.error!==void 0)}function In({state:e}){if(!Fn(e))return null;let t=e.phase===`complete`?void 0:e.retry,n=t&&(0,Y.jsx)(Ln,{at:t.nextAt});return(0,Y.jsxs)(`p`,{className:`px-2 pb-2 break-words`,children:[t?.needsAttention?`Cleanup needs attention`:e.phase===`incomplete`?`Cleanup incomplete`:e.phase===`complete`?`Cleanup complete`:`Cleanup ${e.phase}`,e.remaining.length?` — remaining: ${e.remaining.join(`, `)}`:``,e.error?` — ${t?e.error.replace(/\.$/,``):e.error}`:``,t?.needsAttention?(0,Y.jsxs)(Y.Fragment,{children:[`. Nothing changed after `,t.attempts,` automatic attempts; checking hourly, next check `,n,`. Retry clean up to try now.`]}):t?(0,Y.jsxs)(Y.Fragment,{children:[`. Retrying automatically, next attempt `,n,`.`]}):null]})}function Ln({at:e}){let t=vt(3e4);return(0,Y.jsx)(`time`,{dateTime:e,title:new Date(e).toLocaleString(),children:zt(t,Date.parse(e))})}function Rn({id:e}){return(0,Y.jsxs)(B,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,"data-slot":`mobile-parent-task-link`,className:`inline-flex shrink-0 items-center justify-center gap-1 rounded-sm px-2 text-[13px] text-muted-foreground [min-block-size:2.75rem] [min-inline-size:2.75rem] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:bg-muted active:text-foreground`,children:[(0,Y.jsx)(Me,{"aria-hidden":!0,className:`shrink-0 [block-size:1.2cap] [inline-size:auto]`}),`Parent`]})}function zn({id:e}){let t=le(e),n=t.data?V(t.data):e;return(0,Y.jsxs)(`div`,{"data-slot":`parent-task`,className:`flex min-w-0 flex-wrap items-center gap-x-2 text-[13px] text-muted-foreground`,children:[(0,Y.jsxs)(B,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,title:`Parent · ${n}`,"data-slot":`parent-task-link`,className:`flex min-h-11 min-w-0 max-w-full items-center gap-2 rounded-sm text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:text-foreground`,children:[(0,Y.jsx)(Me,{"aria-hidden":!0,className:`h-[1.2cap] w-auto shrink-0`}),(0,Y.jsx)(`span`,{className:`shrink-0`,children:`Parent`}),(0,Y.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,Y.jsx)(`span`,{className:`min-w-0 overflow-clip text-ellipsis whitespace-nowrap`,children:n})]}),t.isError?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{children:`Parent record unavailable or deleted`}),(0,Y.jsx)(M,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}var Bn=3,Vn=(e,t)=>e.kind===t.kind&&e.number===t.number;function Hn(e,t,n=Bn){let r=t?e.findIndex(e=>Vn(e,t)):-1;if(e.length<=n||r<n)return{inline:e.slice(0,n),overflow:e.slice(n)};let i=[...e.slice(0,n-1),e[r]];return{inline:i,overflow:e.filter(e=>!i.includes(e))}}var Un=(e,t)=>`/tasks/${e}/${t.kind}/${t.number}`;function Wn({tab:e}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(e.kind===`pr`?Te:Fe,{"aria-hidden":`true`,className:`mr-1 size-3.5 shrink-0`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:e.kind===`pr`?`Pull request`:`Issue`}),` #`,e.number,(0,Y.jsx)(Je,{kind:e.kind===`pr`?`PR`:`Issue`,number:e.number,className:`ml-1`})]})}function Gn(e,t){let n=e[0],r=e.length+ +!!t;return n?`Preview :${n.port}${r>1?` +${r-1}`:``}`:t?`Preview · agent`:`Preview`}function Kn({servers:e}){let t=Dt();if(t===null)return null;let n=t.agentLive===!0,r=e[0],i=e.length+ +!!n===1?r?{port:r.port}:{agent:!0}:{};return(0,Y.jsxs)(M,{variant:`outline`,size:`sm`,"data-slot":`preview-toggle`,className:`max-md:h-11`,"aria-pressed":t.open,onClick:()=>t.openPane(i),children:[(0,Y.jsx)(ze,{"aria-hidden":`true`}),Gn(e,n),t.live?(0,Y.jsx)(H,{tone:`success`,"aria-label":`Preview is live`}):null]})}function qn(e){return e?.role===`worker`?`Worker session`:e?.role===`root`?`Parent session`:`Task session`}function Jn({run:e,compact:t=!1}){if(e.delegation?.role!==`worker`)return null;let n=e.delegation.supervisorRunId??e.delegation.parentRunId;return t?(0,Y.jsx)(Rn,{id:n}):(0,Y.jsx)(zn,{id:n})}function Yn(e,t,n,r){return!e.archiveBlocker&&t.archive&&(n!==`session`||!Ot(e,r))?(0,Y.jsx)(X,{run:e}):null}function Xn({run:e}){return e.archived&&e.autoArchive?.reason===`pull-requests-merged`&&e.autoArchive.archivedAt===e.archivedAt?(0,Y.jsx)(`p`,{"data-slot":`auto-archive-reason`,className:`text-[13px] text-muted-foreground`,children:`Archived automatically after all associated PRs merged.`}):null}function Zn({shown:e,run:t,archiveButton:n,previewToggle:r}){let i=un(t);return e&&(n||r||i)?(0,Y.jsxs)(`div`,{"data-slot":`run-mobile-actions`,className:`flex flex-wrap items-center gap-2 pt-2`,children:[n,r,(0,Y.jsx)(dn,{run:t})]}):null}function Qn({run:e,tab:t,activeItem:n,inlineItemTabs:r,overflowItemTabs:i,phoneBar:a,isDesktop:o}){let s=(0,J.useRef)(null),c=n?`${n.kind}#${n.number}`:null;return(0,J.useEffect)(()=>{!c||o||s.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[c,r.map(e=>`${e.kind}#${e.number}`).join(`,`),o]),(0,Y.jsxs)(`div`,{ref:s,"data-slot":`run-tabs`,"data-phone-bar":a||void 0,className:`mt-3 flex flex-wrap items-end gap-1 border-b border-border md:mt-5 max-md:flex-nowrap max-md:overflow-x-auto max-md:border-b-0 max-md:shadow-[inset_0_-1px_0_var(--border)] max-md:gap-0 max-md:[&>*]:mb-0 max-md:[&>*]:shrink-0 max-md:[&>a]:min-h-11 max-md:[&>a]:px-3.5 max-md:[&>a]:text-[13.5px]`,children:[(0,Y.jsx)(q,{to:`/tasks/${e.id}`,active:t===`session`,replace:a,children:`Session`}),(0,Y.jsx)(q,{to:`/tasks/${e.id}/changes`,active:t===`changes`,replace:a,count:e.diffStat&&e.diffStat.files>0?e.diffStat.files:void 0,children:`Changes`}),(0,Y.jsx)(q,{to:`/tasks/${e.id}/commits`,active:t===`commits`,replace:a,children:`Commits`}),(0,Y.jsx)(q,{to:`/tasks/${e.id}/files`,active:t===`files`,replace:a,children:`Files`}),r.map(t=>(0,Y.jsx)(q,{to:Un(e.id,t),active:n!==null&&Vn(t,n),replace:a,children:(0,Y.jsx)(Wn,{tab:t})},`${t.kind}-${t.number}`)),i.length>0?(0,Y.jsxs)(z,{children:[(0,Y.jsxs)(L,{"data-slot":`run-tabs-more`,"aria-label":`${i.length} more linked items`,className:`-mb-px flex h-8 items-center rounded-t-md border-b-2 border-transparent px-3 text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground max-md:min-h-11 max-md:px-3.5 max-md:text-[13.5px]`,children:[`+`,i.length]}),(0,Y.jsx)(R,{align:`end`,children:i.map(t=>(0,Y.jsx)(P,{asChild:!0,children:(0,Y.jsx)(B,{to:Un(e.id,t),replace:a,children:(0,Y.jsx)(Wn,{tab:t})})},`${t.kind}-${t.number}`))})]}):null]})}function $n({run:e,tab:t=`session`,onMarkedUnread:n}){let r=p(e),a=K(e),o=bn(e),[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(!1),d=er(e,n),f=ue(),m=ie(),h=Zt(e,{queuePosition:e.status===`queued`?ct(f.data??[]).get(e.id):void 0}),g=Tt(),_=dt(),v=g!==null&&!_?g:null,y=v!==null,{referenceProjectId:b,repoBase:x,requests:ee}=en(e),te=(0,J.useMemo)(()=>xe(e,x),[e,x]),S=typeof t==`object`?t:null,{inline:ne,overflow:re}=Hn(te,S),C=m.data?.capabilities?.preview===!0,w=e.worktreePath&&C?(0,Y.jsx)(Kn,{servers:e.previewServers??[]}):null,T=(0,Y.jsx)(ir,{run:e,actions:d,onOpenChooser:()=>u(!0),onToggleNotes:()=>c(e=>!e)}),E=Yn(e,a,t,o);return(0,Y.jsx)(qe,{projectId:b,repoBase:x,requests:ee,children:(0,Y.jsxs)(`header`,{"data-slot":`run-header`,className:i(`relative z-20 bg-background px-[18px] md:px-9 md:pt-7`,y?`pt-0`:`pt-[18px]`,t===`session`&&`md:sticky md:top-0`),children:[(0,Y.jsx)(Xn,{run:e}),(0,Y.jsx)(Yt,{run:e}),(0,Y.jsxs)(`div`,{className:`w-full`,children:[(0,Y.jsx)(Jn,{run:e}),v?(0,Y.jsxs)(Et,{slot:v,children:[(0,Y.jsx)(rr,{run:e}),(0,Y.jsx)(Jn,{run:e,compact:!0}),T]}):(0,Y.jsxs)(`div`,{"data-slot":`run-title-row`,className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 md:flex-nowrap`,children:[(0,Y.jsx)(`p`,{"data-slot":`session-kind`,className:`text-[12px] font-semibold tracking-[0.14em] text-muted-foreground uppercase md:hidden`,children:qn(e.delegation)}),(0,Y.jsx)(nr,{run:e}),(0,Y.jsx)(Mt,{dot:r.tone,shape:r.shape,pulse:r.pulse,className:`max-md:hidden`,children:Qt(h)}),(0,Y.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[E,w,(0,Y.jsx)(dn,{run:e}),T]})]}),(0,Y.jsx)(Zn,{shown:v!==null,run:e,archiveButton:E,previewToggle:w}),(0,Y.jsx)(Qn,{run:e,tab:t,activeItem:S,inlineItemTabs:ne,overflowItemTabs:re,phoneBar:y,isDesktop:_}),s?(0,Y.jsx)(sr,{runId:e.id,onClose:()=>c(!1)}):null,l?(0,Y.jsx)(an,{run:e,canResume:K(e).terminal,onResume:()=>d.terminal.mutate(),onClose:()=>u(!1)}):null]}),(0,Y.jsx)(or,{run:e,actions:d})]})})}function er(e,t){let n=d(),r=at(),[i,a]=(0,J.useState)(null),o=()=>n.invalidateQueries({queryKey:ce.runs.all}),s=e=>O(e.message,{tone:`danger`}),c=fe(),l={isPending:c.isPending,mutate:()=>c.mutate({id:e.id,pinned:!e.pinned})},u=x();return{pin:l,markUnread:{isPending:u.isPending,mutate:()=>{t?.(),u.mutate(e.id,{onError:s})}},delete:T({mutationFn:()=>m(e.id),onSuccess:()=>{o(),r(`/`)},onError:s}),terminal:tn(e),confirming:i,setConfirming:a}}function tr(e){let t=C(e.id),n=V(e);return{title:n,editor:At(n,e=>t.mutate({title:e},{onError:e=>O(e.message,{tone:`danger`})}))}}function nr({run:e}){let{title:t,editor:n}=tr(e);return n.editing?(0,Y.jsx)(W,{editor:n,className:`flex-1 text-[16px] font-semibold`}):(0,Y.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,Y.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:t}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,onClick:n.begin,className:`shrink-0 rounded-sm p-1 text-soft-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Y.jsx)(gt,{className:`size-3.5`,"aria-hidden":`true`})})]})}function rr({run:e}){let{title:t,editor:n}=tr(e);return(0,Y.jsxs)(Qe,{open:n.editing,onOpenChange:e=>{e?n.begin():n.commit()},children:[(0,Y.jsx)(`div`,{"data-slot":`mobile-run-title`,className:`flex min-w-0 flex-1 flex-col gap-px`,children:(0,Y.jsx)(`h1`,{className:`truncate text-[15px] leading-tight font-semibold text-foreground`,title:e.task,children:t})}),(0,Y.jsx)(Xe,{asChild:!0,children:(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,className:`flex size-11 shrink-0 items-center justify-center rounded-sm text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Y.jsx)(gt,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,Y.jsx)(Ze,{align:`end`,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),n.cancel()},children:(0,Y.jsx)(W,{editor:n,className:`text-[16px] font-semibold`})})]})}function ir({run:e,actions:t,onToggleNotes:n,onOpenChooser:r}){let i=K(e),a=G(e),o=C(e.id),s=(0,J.useId)();return(0,Y.jsxs)(z,{children:[(0,Y.jsx)(L,{asChild:!0,children:(0,Y.jsx)(M,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,Y.jsx)(Re,{"aria-hidden":`true`})})}),(0,Y.jsxs)(R,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,Y.jsx)(N,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),(0,Y.jsxs)(P,{onSelect:n,children:[(0,Y.jsx)(Ct,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,Y.jsx)(an,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),a?(0,Y.jsxs)(P,{onSelect:()=>void Z(a,`Command copied to clipboard.`),children:[(0,Y.jsx)(k,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.markUnread?(0,Y.jsxs)(P,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,Y.jsx)(Ht,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,Y.jsxs)(I,{"data-slot":`pin-run`,className:`min-h-11`,checked:!!e.pinned,disabled:t.pin.isPending,onCheckedChange:()=>t.pin.mutate(),children:[e.pinned?(0,Y.jsx)(Ut,{"aria-hidden":`true`}):(0,Y.jsx)(Ie,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,(0,Y.jsx)(F,{}),(0,Y.jsx)(N,{className:`text-xs text-muted-foreground`,children:`AFTER DONE`}),(0,Y.jsx)(I,{"data-slot":`archive-when-done`,className:`min-h-11`,checked:e.archiveWhenDone===!0,disabled:o.isPending,onCheckedChange:e=>o.mutate({archiveWhenDone:e},{onError:e=>O(e.message,{tone:`danger`})}),children:`Archive when Done`}),(0,Y.jsx)(I,{"data-slot":`auto-merge-pr`,className:`min-h-11`,checked:e.autoMergePr===!0,disabled:o.isPending,"aria-describedby":s,onCheckedChange:e=>o.mutate({autoMergePr:e},{onError:e=>O(e.message,{tone:`danger`})}),children:`Auto-merge PR`}),(0,Y.jsx)(`p`,{id:s,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block:0.5rem]`,children:`After Done, auto-merge can mark a draft PR ready. It waits for current-head CI and GitHub rules. Merge comes before archive.`}),e.delegation?.role===`worker`?null:(0,Y.jsx)(ar,{run:e,patch:o}),i.deleteRun?(0,Y.jsx)(F,{}):null,i.deleteRun?(0,Y.jsxs)(P,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,Y.jsx)(De,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})}function ar({run:e,patch:t}){let n=(0,J.useId)(),r=(0,J.useId)(),i=(0,J.useId)(),a=e=>O(e.message,{tone:`danger`});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(F,{}),(0,Y.jsx)(N,{className:`text-xs text-muted-foreground`,children:`TASK ACCESS`}),(0,Y.jsx)(I,{"data-slot":`allow-workers`,className:`min-h-11`,checked:y(e),disabled:t.isPending,"aria-describedby":`${n} ${i}`,onCheckedChange:e=>t.mutate({allowWorkers:e},{onError:a}),children:`Allow Squawk workers`}),(0,Y.jsx)(`p`,{id:n,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block-end:0.5rem]`,children:`Agents in this task can start Squawk workers. Each worker is a separate paid agent session. Worker limits cap resources, not spending.`}),(0,Y.jsx)(I,{"data-slot":`allow-messaging`,className:`min-h-11`,checked:b(e),disabled:t.isPending,"aria-describedby":`${r} ${i}`,onCheckedChange:e=>t.mutate({allowMessaging:e},{onError:a}),children:`Allow task messaging`}),(0,Y.jsx)(`p`,{id:r,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block-end:0.5rem]`,children:`Agents in this task can message other tasks in this project.`}),(0,Y.jsx)(`p`,{id:i,"data-slot":`task-access-session-note`,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block-end:0.5rem]`,children:`Turning one off applies at once. Turning one on reaches a running agent at its next session.`})]})}function or({run:e,actions:t}){let n=t.confirming;return(0,Y.jsx)(ft,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,Y.jsxs)(bt,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Y.jsxs)(_t,{children:[(0,Y.jsx)(jt,{className:`text-danger`,children:`Delete task permanently?`}),(0,Y.jsx)(St,{children:(0,Y.jsxs)(Y.Fragment,{children:[`Delete “`,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,title:V(e),children:V(e)}),`” and its transcript`,e.delegation?.role===`worker`&&!h(e.delegation.workspace)?``:`, worktree and branch`,`. This cannot be undone.`]})})]}),(0,Y.jsxs)(mt,{children:[(0,Y.jsx)(ht,{children:`Cancel`}),(0,Y.jsx)(xt,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{t.delete.mutate(),t.setConfirming(null)},children:`Delete task`})]})]})})}function sr({runId:e,onClose:t}){let n=ae(e);return(0,Y.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 rounded-xl border border-border bg-card p-6`,children:[(0,Y.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,Y.jsx)(M,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,Y.jsx)(ke,{})})]}),n.isPending?(0,Y.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,Y.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,Y.jsx)(pn,{runId:e,children:(0,Y.jsx)(Rt,{children:n.data})}):(0,Y.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`}),(0,Y.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,Y.jsx)(M,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void Z(n.data??``,`Notes copied`),children:`Copy notes`}),(0,Y.jsx)(M,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{en as _,Fn as a,bn as c,hn as d,pn as f,tn as g,rn as h,kn as i,yn as l,sn as m,In as n,On as o,on as p,xn as r,$ as s,$n as t,_n as u,Zt as v,X as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Xr as e,f as t,gn as n,jt as r}from"./project-scope-context-Dgq8_2JZ.js";import{B as i,I as a,N as o,P as s,W as c,j as l}from"./live-protocol-BXzu6cSE.js";import{t as u}from"./useQuery-BUslvRIM.js";var d=l([`own`,`provider-spanning`]),f=i({suggested:o(i({id:c(),label:c(),desc:c()})),retired:o(c())}),p=i({id:l([`settings`,`mcp`,`memory`]),label:c(),note:c().optional(),empty:c().optional(),showsUserMcp:a(!0).optional()}),m=i({label:c(),note:c().optional(),groups:o(p)}),h=i({runners:o(i({id:e,displayName:c(),modelListName:c(),modelIdScope:d,pickerLabel:c(),pickerDescription:c(),icon:c(),installHint:c(),loginCommand:c(),terminalLogin:s().optional(),browserLogin:s().optional(),managedInstall:a(!0).optional(),accountFolderExample:c().optional(),models:f,agentConfig:m}))}),g=[`workspace`,`runners`];async function _(e){return n(await t.api.v1.runners.$get({},r(e)),`/runners`,h)}var v={queryKey:g,queryFn:({signal:e})=>_({signal:e}),staleTime:1/0};function y(){return u(v)}function b(e){return e?.runners??[]}function x(e){return b(e).map(e=>e.id)}function S(e,t){return e?.runners.find(e=>e.id===t)}function C(e,t){return S(e,t)?.displayName??t}function w(e,t){return S(e,t)?.pickerLabel??t}function T(e,t){return S(e,t)?.modelListName}export{T as a,x as i,b as n,w as o,S as r,y as s,C as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{br as i,ci as a,f as o,hn as s}from"./project-scope-context-Dgq8_2JZ.js";import{M as c,Nt as l,Yt as u}from"./queries-yuG-mM6_.js";import{t as d}from"./useQuery-BUslvRIM.js";import{i as f,n as p,s as m}from"./runners-CDw7wLfd.js";import{it as h,l as g}from"./design-icons-CzEoMH9c.js";import{t as _}from"./button-BQ2y4XRB.js";import{a as v,i as y,o as b,r as x,s as S,t as C}from"./dialog-BVF6dIeS.js";import{Hn as w}from"./index-DXIRYobS.js";var T=e(t(),1),E=n();function D(e,t){return p(t).flatMap(t=>{let n=e.filter(e=>e.provider===t.id);return n.length<2?[{runner:t,account:null,label:t.pickerLabel,desc:t.pickerDescription,missing:!1}]:n.map(e=>({runner:t,account:e.isDefault?null:e.id,label:`${t.pickerLabel} · ${e.label}`,desc:e.exists?e.configDir:`${e.configDir} — folder not created yet`,missing:!e.exists,...e.isDefault||e.status===void 0?{}:{accountStatus:e.status.status}}))})}var O=(e,t)=>e.length>f(t).length;function k(e,t,n){let r=i(e.data,t),a=r!==void 0&&r.status!==`not-installed`&&(n??r.status)===`connected`,o=!e.isPending&&!e.isError&&r?.enabled===!0&&a;return{providerConnected:o,providerReason:e.isPending?`Checking provider authentication…`:e.isError?`Provider authentication could not be verified.`:r?.enabled===!1?`This provider is disabled. Enable it above or choose another provider.`:o?void 0:`Connect this provider before selecting it.`}}function A({rows:e,runner:t,accountFor:n,providerStatus:i,disabled:a=!1,accountDisabled:o=!1,onPick:s}){let c=m().data,l=c===void 0,u=O(e,c);return(0,E.jsx)(`div`,{role:`radiogroup`,"aria-label":`Default runner`,"data-slot":`agents-runner`,className:r(`gap-0.5 rounded-md border border-border bg-card p-0.5`,u?`flex max-w-md flex-col`:`inline-flex w-fit`),children:e.map(c=>{let{providerConnected:d,providerReason:f}=k(i,c.runner.id,c.accountStatus),p=e.filter(e=>e.runner.id===c.runner.id).length>1,m=c.runner.id===t&&c.account===n(c.runner.id);return(0,E.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":m,"data-value":c.runner.id,"data-account":c.account??``,title:f??c.desc,disabled:a||l||!d||p&&o,onClick:()=>s(c.runner.id,c.account,p),className:r(`rounded-sm px-3 py-1.5 text-left font-mono text-[13px] font-medium transition-colors disabled:opacity-50`,m?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:[c.label,u?(0,E.jsx)(`span`,{"data-slot":c.missing?`agents-account-missing`:`agents-account-dir`,"data-runner":c.runner.id,className:`ml-2 font-sans text-[11px] text-soft-foreground`,children:c.desc}):null]},`${c.runner.id}:${c.account??``}`)})})}async function j(e,t){return s(await o.api.v1.providers[`sign-in`].start.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/sign-in/start`)}async function M(e){return s(await o.api.v1.providers[`sign-in`][`:id`].$get({param:{id:e}}),`/providers/sign-in/:id`)}async function N(e,t){return s(await o.api.v1.providers[`sign-in`][`:id`].redirect.$post({param:{id:e},json:{redirectUrl:t}}),`/providers/sign-in/:id/redirect`)}async function P(e){return s(await o.api.v1.providers[`sign-in`][`:id`].$delete({param:{id:e}}),`/providers/sign-in/:id`)}function F(e,t){let n=a(),[r,i]=(0,T.useState)(!1),[o,s]=(0,T.useState)(null),[c,f]=(0,T.useState)(``),p=(0,T.useRef)(null),m=(0,T.useRef)(!0),h=(0,T.useRef)(0),g=()=>{h.current++,v.current=!1;let e=p.current;p.current=null,e?.state===`waiting`&&P(e.id).catch(()=>{}),s(null),f(``),i(!1)};(0,T.useEffect)(()=>(m.current=!0,()=>{m.current=!1,h.current++;let e=p.current;e?.state===`waiting`&&P(e.id).catch(()=>{})}),[]);let _=u({mutationFn:n=>j(e,t).then(e=>({result:e,generation:n})),retry:!1,onSuccess:({result:e,generation:t})=>{if(!m.current||!v.current||t!==h.current){P(e.id).catch(()=>{});return}p.current=e,s(e)}}),v=(0,T.useRef)(r);v.current=r;let y=d({queryKey:[`browser-sign-in`,o?.id],queryFn:()=>M(o.id),enabled:r&&o?.state===`waiting`,retry:!1,refetchInterval:e=>e.state.error||e.state.data?.state&&e.state.data.state!==`waiting`?!1:1e3,gcTime:0}),b=y.data??o,x=u({mutationFn:()=>N(o.id,c),retry:!1,onSuccess:()=>{f(``),y.refetch()}});return(0,T.useEffect)(()=>{b?.state===`connected`&&(p.current=b,s(b),Promise.all([n.invalidateQueries({queryKey:l.agentProfiles}),n.invalidateQueries({queryKey:l.providerStatus}),n.invalidateQueries({queryKey:l.models(e)})]))},[b,n,e]),{open:r,result:b,redirect:c,setRedirect:f,start:_,replay:x,status:y,error:_.error??x.error??y.error,close:g,connect:()=>{i(!0),v.current=!0,_.reset(),x.reset(),_.mutate(++h.current)}}}function I(){return`Open the sign-in link in your browser. After Google consent, the page shows a code. Copy that code, or the full address of that page, and paste it below.`}function L({provider:e,profileId:t,label:n}){let{open:r,result:i,redirect:a,setRedirect:o,start:s,replay:l,status:u,error:d,close:f,connect:p}=F(e,t);return c().data?.capabilities?.settingsAdmin===!0?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(_,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:s.isPending,onClick:p,children:`Connect`}),(0,E.jsx)(C,{open:r,onOpenChange:e=>{e||f()},children:(0,E.jsxs)(x,{children:[(0,E.jsxs)(b,{children:[(0,E.jsxs)(S,{children:[`Sign in to `,n]}),(0,E.jsx)(y,{children:`Use a personal Google account. Business and agent-platform sign-in are not supported.`})]}),s.isPending?(0,E.jsx)(`p`,{role:`status`,children:`Preparing sign-in…`}):null,i?.state===`waiting`?(0,E.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,E.jsx)(`a`,{href:i.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-action underline`,children:`Open Google sign-in`}),(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,E.jsx)(I,{})}),(0,E.jsxs)(`label`,{className:`grid gap-2`,children:[`Code or page address`,(0,E.jsx)(w,{type:`text`,autoComplete:`off`,spellCheck:!1,value:a,onChange:e=>o(e.target.value)})]}),(0,E.jsx)(_,{disabled:!a.trim()||l.isPending,onClick:()=>l.mutate(),children:`Complete sign-in`})]}):null,i?.state===`connected`?(0,E.jsx)(`p`,{role:`status`,children:`Connected.`}):null,i?.state===`failed`?(0,E.jsx)(`p`,{role:`alert`,children:i.error}):null,i?.state===`cancelled`?(0,E.jsx)(`p`,{role:`status`,children:`Sign-in cancelled. Close this window and Connect again.`}):null,d?(0,E.jsx)(`p`,{role:`alert`,children:d.message}):null,u.isError&&i?.state===`waiting`?(0,E.jsx)(_,{onClick:()=>void u.refetch(),children:`Retry status`}):null,(0,E.jsx)(v,{children:(0,E.jsx)(_,{variant:`outline`,onClick:f,children:i?.state===`connected`?`Done`:`Cancel`})})]})})]}):null}function R(e){let t=(0,T.useRef)(null),n=e.rows.find(t=>t.runner.id===e.runner&&t.account===e.accountFor(t.runner.id));return(0,E.jsxs)(`details`,{ref:t,className:`settings-agent-picker`,children:[(0,E.jsxs)(`summary`,{children:[(0,E.jsx)(h,{"aria-hidden":`true`,className:`size-4 text-accent-text`}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1`,children:(n?.label??e.runner).replace(/^codex/,`Codex`).replace(/^claude/,`Claude Code`)}),(0,E.jsx)(g,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})]}),(0,E.jsx)(A,{...e,onPick:(...n)=>{e.onPick(...n),t.current&&(t.current.open=!1)}})]})}export{k as a,O as i,L as n,D as r,R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Ct as i,ci as a}from"./project-scope-context-Dgq8_2JZ.js";import{Pt as o,p as s,t as c}from"./queries-yuG-mM6_.js";import{g as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as u}from"./toaster-Bo5vCbz-.js";import{s as d,t as f}from"./runners-CDw7wLfd.js";import{O as p,T as m,X as h,Y as g,ct as _,ot as v,u as y}from"./design-icons-CzEoMH9c.js";import{t as b}from"./button-BQ2y4XRB.js";import{t as x}from"./project-router-DtTvMbeA.js";import{f as S,l as C}from"./skills-pM_PouEs.js";import{Hn as w,V as T,vn as E,wn as D}from"./index-DXIRYobS.js";var O=e(t(),1),k=n(),A=e=>e.split(`@`)[0]||e,j={project:0,user:1,plugin:2,system:3,other:4},M={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function N(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:A(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:M[t],kind:t}}function P(e){let t=new Map;for(let n of e){let e=N(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>j[e.kind]-j[t.kind]||e.label.localeCompare(t.label))}function F(e){let t=e.plugin?`${A(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var I={project:m,user:_,plugin:p,system:p,other:p};function L({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,O.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,k.jsx)(`div`,{"data-slot":`skills-list`,className:`overflow-hidden rounded-xl border border-border bg-card`,children:e.map(e=>{let o=n||!a.has(e.key);return(0,k.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,k.jsx)(R,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,k.jsx)(z,{skill:e,open:e.id===t,runner:r,account:i},S(e))):null]},e.key)})})}function R({group:e,open:t,onToggle:n}){let i=I[e.kind];return(0,k.jsx)(`h2`,{className:`m-0`,children:(0,k.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:n,className:`flex min-h-10 w-full items-center gap-2 bg-muted/45 px-3.5 text-left text-xs font-semibold text-muted-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:text-foreground`,children:[(0,k.jsx)(y,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,k.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,k.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,k.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function z({skill:e,open:t,runner:n,account:r}){let i=D({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,k.jsxs)(`details`,{"data-slot":`skill-row`,"data-skill":e.id,"data-skill-path":e.path,name:`skill-details`,open:t||void 0,className:`group/skill border-t border-border/60 open:bg-sidebar-row-selected`,children:[(0,k.jsxs)(`summary`,{className:`grid min-h-11 cursor-pointer list-none grid-cols-1 items-baseline gap-x-4 gap-y-0.5 py-2.5 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)] [&::-webkit-details-marker]:hidden`,children:[(0,k.jsx)(`span`,{className:`truncate text-[13.5px] font-semibold`,title:e.name,children:F(e)}),e.description?(0,k.jsx)(`span`,{className:`truncate text-[13px] text-muted-foreground group-open/skill:hidden`,children:e.description}):null]}),(0,k.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,k.jsx)(T,{skill:e,heading:null,actions:(0,k.jsx)(b,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,k.jsx)(x,{to:i,children:`Start task`})})})})]})}function B(){let e=s(),[t,n]=(0,O.useState)(null),[i,a]=(0,O.useState)(null),[c,u]=(0,O.useState)(``),[d]=l(),f=t??e.data?.defaultRunner??`claude`,p=o(t??e.data?.defaultRunner,i),m=G(f,p.account),_=p.data??[];return(0,k.jsxs)(`div`,{"data-route":`skills`,className:`mx-auto grid min-h-full w-full max-w-[1100px] grid-cols-1 content-start gap-5 px-[18px] py-6 md:p-9 max-md:[padding-block-end:5rem]`,children:[(0,k.jsxs)(`header`,{children:[(0,k.jsx)(`h1`,{className:`text-[25px] font-semibold tracking-tight md:text-[30px]`,children:`Skills`}),(0,k.jsx)(`p`,{className:`mt-1 text-[13px] text-muted-foreground`,children:`The skills each agent loads in this project, as its runner reports them.`})]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(H,{runner:f,onChange:e=>{n(e),a(null)}}),(0,k.jsx)(U,{runner:f,account:i,onChange:a}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-soft-foreground`,"data-slot":`skills-count`,children:p.list?`${_.length} ${_.length===1?`skill`:`skills`}${p.list.source===`cache`?` · from cache`:``}`:null}),(0,k.jsxs)(b,{variant:`outline`,size:`sm`,onClick:()=>void m.run(),disabled:m.running||p.isPending,"data-slot":`skills-refresh`,children:[(0,k.jsx)(g,{"aria-hidden":`true`,className:r(`size-3.5`,m.running&&`motion-safe:animate-spin`)}),`Re-read`]})]}),(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,k.jsx)(w,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:c,onChange:e=>u(e.target.value),className:`h-10 bg-card pl-9 text-[13px]`})]}),(0,k.jsx)(W,{query:p}),p.isPending?(0,k.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,k.jsx)(V,{skills:_,search:c,openId:d.get(`skill`),runner:f,account:p.account??null,unchecked:p.unchecked})]})}function V({skills:e,search:t,openId:n,runner:r,account:i,unchecked:a}){if(e.length===0)return a?null:(0,k.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`No skills reported by this runner and account.`});let o=C(e,t);return o.length===0?(0,k.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No skills match “`,t.trim(),`”.`]}):(0,k.jsx)(L,{groups:P(o),openId:n,searching:t.trim()!==``,runner:r,account:i})}function H({runner:e,onChange:t}){let n=d().data;return n?(0,k.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-0.5 overflow-x-auto rounded-[10px] border border-border bg-card p-[3px]`,children:n.runners.map(r=>(0,k.jsx)(`button`,{type:`button`,"aria-pressed":r.id===e,onClick:()=>t(r.id),className:`h-8 shrink-0 rounded-[7px] px-3 text-[13px] text-muted-foreground focus-visible:outline-2 aria-pressed:bg-muted aria-pressed:font-semibold aria-pressed:text-foreground pointer-hover:text-foreground`,children:f(n,r.id)},r.id))}):null}function U({runner:e,account:t,onChange:n}){let r=E().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,k.jsxs)(`select`,{"aria-label":`Account`,value:t??``,onChange:e=>n(e.target.value||null),className:`h-[38px] rounded-md border border-border bg-card px-2.5 text-[13px] text-foreground focus-visible:outline-2`,children:[(0,k.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,k.jsx)(`option`,{value:e.id,children:e.label},e.id))]})}function W({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,k.jsxs)(`div`,{className:`grid gap-1.5 rounded-lg border border-pending/40 bg-pending/10 px-3.5 py-2.5 text-[13px]`,children:[e.unchecked&&!e.isPending?(0,k.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,k.jsx)(v,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,k.jsxs)(`span`,{children:[`Skill list unavailable. `,e.list?.reason??e.error?.message,` You can still type a skill id when starting a task.`]})]}):null,t.map((e,t)=>(0,k.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,k.jsx)(v,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,k.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function G(e,t){let n=a(),[r,o]=(0,O.useState)(!1),s=c.runnerSkills(e,t);return{running:r,run:async()=>{o(!0);try{n.setQueryData(s,await i(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:s.slice(0,3)})}catch(e){u(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{o(!1)}}}}export{B as SkillsRoute};
|