cezarion 0.18.0-dev.8338 → 0.18.0-dev.8342

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/package.json +3 -3
  2. package/web/dist/assets/accounts-section-D3rKSj1e.js +1 -0
  3. package/web/dist/assets/{activity-motion-wGHBuD_L.js → activity-motion-CFgok4CI.js} +1 -1
  4. package/web/dist/assets/{activity-route-BhT-npje.js → activity-route-HvdWBepL.js} +1 -1
  5. package/web/dist/assets/{agent-config-section-BIkW506A.js → agent-config-section-DbmhTCJA.js} +2 -2
  6. package/web/dist/assets/agent-defaults-section-5fBA2FMV.js +1 -0
  7. package/web/dist/assets/{appearance-CipbKN5k.js → appearance-ZpysBpxH.js} +1 -1
  8. package/web/dist/assets/{archive-on-merge-field-Dx8afb0D.js → archive-on-merge-field-BlGo3o7a.js} +1 -1
  9. package/web/dist/assets/attention-CvHM4cjG.js +1 -0
  10. package/web/dist/assets/{automations-route-DKKwkBjL.js → automations-route-aINxoEQX.js} +1 -1
  11. package/web/dist/assets/{commit-diff-panel-OqVigspU.js → commit-diff-panel-BzAqXG0p.js} +1 -1
  12. package/web/dist/assets/{diff-CpkjO5Q-.js → diff-lVUk7FAR.js} +2 -2
  13. package/web/dist/assets/{diff-view-D6QC4z_i.js → diff-view-B5RGiepv.js} +1 -1
  14. package/web/dist/assets/{file-preview-C-oYrG0r.js → file-preview-Bn5u5k1W.js} +1 -1
  15. package/web/dist/assets/{folder-browser-DJd_sQFq.js → folder-browser-CffyHz8w.js} +1 -1
  16. package/web/dist/assets/{git-toolbar-BiWUXSvy.js → git-toolbar-xLFz5nnr.js} +1 -1
  17. package/web/dist/assets/{github-DSZtAYK0.js → github-DxiILmDg.js} +1 -1
  18. package/web/dist/assets/{global-activity-route-ylV7sfQb.js → global-activity-route-BmqMaZug.js} +1 -1
  19. package/web/dist/assets/index-DndX-kC-.js +21 -0
  20. package/web/dist/assets/{label-HRVFTN4V.js → label-6PgIe3Ny.js} +1 -1
  21. package/web/dist/assets/{live-reads-Djkq38NT.js → live-reads-BxjlQXfN.js} +1 -1
  22. package/web/dist/assets/{markdown-Drj1MCd_.js → markdown-DHYxiDex.js} +1 -1
  23. package/web/dist/assets/{notifications-section-BNncS89W.js → notifications-section-xHvjaRxV.js} +1 -1
  24. package/web/dist/assets/{open-in-menu-BeAj_aq3.js → open-in-menu-AZMtej8C.js} +1 -1
  25. package/web/dist/assets/{preview-pane-connected-C9bYs_nr.js → preview-pane-connected-C5Lsjf2P.js} +2 -2
  26. package/web/dist/assets/{project-location-DJEH4PmN.js → project-location-DzOgHfcA.js} +1 -1
  27. package/web/dist/assets/{project-router-C6zhlnwO.js → project-router-CDPfL2Jz.js} +1 -1
  28. package/web/dist/assets/{project-scope-context-d3J3hWPR.js → project-scope-context-D9axDY18.js} +2 -2
  29. package/web/dist/assets/{projects-section-DAyPYxaB.js → projects-section-0ov7IK9p.js} +1 -1
  30. package/web/dist/assets/{prompt-templates-section-BUTjHN-R.js → prompt-templates-section-DgLWN4ZB.js} +1 -1
  31. package/web/dist/assets/{queries-dnpdX9VT.js → queries-DzwCG927.js} +1 -1
  32. package/web/dist/assets/{reference-chip-DHWnJcWz.js → reference-chip-BnIoiMgY.js} +1 -1
  33. package/web/dist/assets/remote-settings-notice-kmlL_JEi.js +1 -0
  34. package/web/dist/assets/{repo-git-CahuM1Bi.js → repo-git-D-L0KYwh.js} +1 -1
  35. package/web/dist/assets/{report-reader-BMw7TyID.js → report-reader-Fb02sGC6.js} +1 -1
  36. package/web/dist/assets/{reports-BqhgWSM-.js → reports--yxm1Dbp.js} +1 -1
  37. package/web/dist/assets/{resources-section-CPdErsDL.js → resources-section-CZu7afz7.js} +1 -1
  38. package/web/dist/assets/run-header-Bajufo9w.js +2 -0
  39. package/web/dist/assets/settings-agent-picker-XdHS0cXP.js +1 -0
  40. package/web/dist/assets/{settings-shell-Cg1j_HUU.js → settings-shell-63smMna1.js} +1 -1
  41. package/web/dist/assets/{sidebar-section-C7mKySo9.js → sidebar-section-Dgf9Tda6.js} +1 -1
  42. package/web/dist/assets/{skills-DL6gTurZ.js → skills-CVoGqJeT.js} +1 -1
  43. package/web/dist/assets/{tab-link-Cq8g7cFx.js → tab-link-BaKE6KnE.js} +1 -1
  44. package/web/dist/assets/{task-changes-BYdPYqmr.js → task-changes-Cd30VNwk.js} +1 -1
  45. package/web/dist/assets/{task-commits-CZs64PxA.js → task-commits-33kwaiVP.js} +1 -1
  46. package/web/dist/assets/{task-files-CHDvZdch.js → task-files-W2NkAX0s.js} +1 -1
  47. package/web/dist/assets/{task-github-item-BaAS8tc7.js → task-github-item-C7dEQxMN.js} +1 -1
  48. package/web/dist/assets/{task-groups-BF7_ZZTh.js → task-groups-DoiPFEfM.js} +1 -1
  49. package/web/dist/assets/{task-thread-DKTYTRYk.js → task-thread-Bi5cKYmZ.js} +6 -6
  50. package/web/dist/assets/{tasks-table-CzLkD-kr.js → tasks-table-CmESFng9.js} +1 -1
  51. package/web/dist/assets/{thread-state-Cnu6irf1.js → thread-state-DI7JLoTx.js} +1 -1
  52. package/web/dist/assets/{use-hand-to-agent-state-C0HmC08K.js → use-hand-to-agent-state-B869bBKO.js} +1 -1
  53. package/web/dist/assets/{useInfiniteQuery-qJcgwcf9.js → useInfiniteQuery-GZp9laKm.js} +1 -1
  54. package/web/dist/assets/useQuery-CzVHT8UE.js +1 -0
  55. package/web/dist/assets/{workflows-BxrHkrIx.js → workflows-CeRdeF9n.js} +3 -3
  56. package/web/dist/assets/{workspace-tools-DK0GgizV.js → workspace-tools-YqTAoyv7.js} +1 -1
  57. package/web/dist/assets/{worktrees-section-CBWXq2mc.js → worktrees-section-9fwC5DGp.js} +1 -1
  58. package/web/dist/index.html +14 -14
  59. package/web/dist/assets/accounts-section-qnA3YX9G.js +0 -1
  60. package/web/dist/assets/agent-defaults-section-D9oxRh7t.js +0 -1
  61. package/web/dist/assets/attention-VcsXbAZz.js +0 -1
  62. package/web/dist/assets/index-CS5yyNbo.js +0 -21
  63. package/web/dist/assets/remote-settings-notice-BTtluTx2.js +0 -1
  64. package/web/dist/assets/run-header-BpdSJ6lc.js +0 -2
  65. package/web/dist/assets/settings-agent-picker-By-EZVYH.js +0 -1
  66. package/web/dist/assets/useQuery-CkUPLiaa.js +0 -1
@@ -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{ci as r}from"./project-scope-context-d3J3hWPR.js";import{Lt as i,ht as a}from"./queries-dnpdX9VT.js";import{vn as o}from"./index-CS5yyNbo.js";var s=e(t(),1),c=n();function l(){let e=r(),t=(0,s.useCallback)(async()=>{await Promise.all([e.invalidateQueries({queryKey:i.health}),e.invalidateQueries({queryKey:i.agentConfig,exact:!0})])},[e]);return(0,s.useEffect)(()=>{t()},[t]),t}var u=`${o()} remote-settings enable`;function d({risk:e}){return a().data?.capabilities?.remoteSettingsAdmin===!0?(0,c.jsxs)(`p`,{role:`note`,"data-slot":`remote-settings-notice`,className:`rounded-md border border-warning/40 bg-warning/10 px-3 py-2 text-[13px] text-foreground`,children:[`Remote settings administration is on. `,e,`, and anyone who can open this cockpit can change them. The host operator turns this off with`,` `,(0,c.jsxs)(`code`,{children:[o(),` remote-settings disable`]}),`.`]}):null}export{d as n,l as r,u as t};
@@ -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{An as a,Gn as o,Mt as s,On as c,Tn as l,Wn as u,X as d,at as f,ci as p,jt as m,kn as h,mr as g,pr as _,qn as v,rr as y,tr as ee}from"./project-scope-context-d3J3hWPR.js";import{$ as b,B as te,F as ne,H as x,K as re,Lt as S,Q as ie,U as C,V as w,Xt as T,_t as ae,at as oe,et as se,f as ce,ht as le,in as E,nn as ue,rn as de,vt as fe,yt as pe,z as me}from"./queries-dnpdX9VT.js";import{d as he,h as ge}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{a as _e,d as ve,f as ye,g as be,m as xe,o as Se,p as Ce,s as we}from"./tasks-table-CzLkD-kr.js";import{n as D}from"./toaster-Bo5vCbz-.js";import{A as Te,F as Ee,a as De,at as Oe,f as ke,ft as O,g as Ae,h as je,i as k,l as A,m as Me,p as Ne,q as Pe,t as Fe,v as j,x as Ie}from"./design-icons-CzEoMH9c.js";import{t as M}from"./createLucideIcon-BHp8sXmF.js";import{t as Le}from"./app-window-CSHwDX9N.js";import{n as Re,r as ze,t as Be}from"./open-in-menu-BeAj_aq3.js";import{t as Ve}from"./info-DA1x_4bz.js";import{a as He,t as Ue}from"./format-BNCkW110.js";import{t as We}from"./message-square-B-MD-8rD.js";import{i as Ge,n as Ke,t as N}from"./reference-chip-DHWnJcWz.js";import{t as qe}from"./square-terminal-B6RYYieR.js";import{t as P}from"./button-BQ2y4XRB.js";import{a as F,i as I,l as L,n as R,p as z,r as B,t as V}from"./dropdown-menu-4e2iKSMT.js";import{i as Je,r as Ye,t as Xe}from"./popover-BPgUYFyu.js";import{a as Ze,i as Qe,o as $e,r as et,s as tt,t as nt}from"./dialog-BVF6dIeS.js";import{c as rt,s as it,t as H}from"./project-router-C6zhlnwO.js";import"./attention-VcsXbAZz.js";import{T as at,f as U,u as ot,x as st}from"./task-groups-BF7_ZZTh.js";import{t as ct}from"./status-dot-DtAOFiIi.js";import{$t as lt,B as W,Gt as ut,Ht as dt,Jn as ft,Jt as pt,Kt as mt,Mn as ht,Nn as gt,Qn as _t,R as vt,Ut as yt,Vt as bt,Wt as xt,a as St,cn as Ct,en as wt,fn as G,in as Tt,ir as Et,jn as Dt,m as Ot,o as kt,pn as K,qn as At,qt as jt,r as Mt,rn as Nt,tn as Pt,xn as Ft,z as It}from"./index-CS5yyNbo.js";import{r as Lt,t as Rt}from"./markdown-Drj1MCd_.js";import{i as zt}from"./automation-format-CUP262Tk.js";import{t as Bt}from"./textarea-vJt9undk.js";import{t as q}from"./tab-link-Cq8g7cFx.js";var Vt=M(`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=M(`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=M(`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=oe();return E({mutationFn:t=>d(de(e),t),onSuccess:()=>t.invalidateAfter(`runs`,()=>ue()),onError:e=>D(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)(bt,{open:t,onOpenChange:n,children:(0,Y.jsxs)(xt,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Y.jsxs)(jt,{children:[(0,Y.jsx)(pt,{children:`Archive task?`}),(0,Y.jsxs)(ut,{children:[`Move “`,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,title:U(e),children:U(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,Y.jsxs)(mt,{children:[(0,Y.jsx)(yt,{children:`Cancel`}),(0,Y.jsx)(dt,{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)(P,{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)(Et,{"aria-hidden":`true`}):(0,Y.jsx)(Fe,{"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)(P,{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)(P,{variant:`outline`,disabled:i.isPending,onClick:()=>i.mutate({autoMergePr:!1},{onError:e=>D(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)(P,{variant:`outline`,asChild:!0,children:(0,Y.jsx)(H,{to:`/tasks/${t.runId}`,children:`Open blocking task`})}):null,t.pullRequestUrl&&r(t.pullRequestUrl)?(0,Y.jsx)(P,{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=x(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=l(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:Ue(n,t)}}async function Z(e,t){try{await navigator.clipboard.writeText(e),D(t)}catch{D(`Run manually: ${e}`)}}function en(e){let t=ae(),n=ce(),r=(0,J.useMemo)(()=>be(e,t),[e,t]);return{referenceProjectId:n,repoBase:t,references:r,requests:(0,J.useMemo)(()=>n===void 0?[]:r.filter(e=>_e(e,t)).map(e=>({projectId:n,kind:e.kind,number:e.number})),[r,n,t])}}function tn(e){return E({mutationFn:()=>s(e.id),onError:e=>{if(e instanceof a&&e.command){Z(e.command,`No terminal found — command copied to clipboard.`);return}D(e.message,{tone:`danger`})}})}function Q(e,t){let n=w(),r=pe(),i=T(),a=E({mutationFn:t=>m(e.id,t),onError:e=>D(e.message,{tone:`danger`})}),o=Ft(),s=at(e),c=o.runnersOn(e=>t&&s.sessionId!==void 0&&e===s.backend?s.profileId??`default`:o.repoAccount?.[e]).runners,l=e=>!r.isSuccess||!i.isSuccess||c.includes(e??`claude`);return{canResumeHere:t&&l(Ct(e)),choices:e.worktreePath?(n.data?.targets??[]).filter(e=>{let t=Re(e.id);return t===void 0||i.isSuccess&&l(t)}).map(t=>({target:t,...Tt(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=T().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)(P,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,Y.jsx)(qe,{}),`Terminal (resume session)`]}):null,i.map(({target:e,suffix:t,title:n})=>{let r=ze(e,o);return(0,Y.jsxs)(P,{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)(P,{variant:`outline`,onClick:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>D(`Worktree path copied`)).catch(()=>D(`Path: ${t}`))},children:[(0,Y.jsx)(j,{}),`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)(P,{variant:`outline`,onClick:()=>void Z(s,`Command copied to clipboard.`),children:[(0,Y.jsx)(j,{}),`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)(Be,{choices:i,onPick:e=>a.mutate(e),disabled:a.isPending,triggerVariant:`outline`,className:c,leading:r?(0,Y.jsxs)(I,{"data-target":`terminal-resume`,onSelect:n,children:[(0,Y.jsx)(qe,{"aria-hidden":`true`}),`Terminal (resume session)`]}):void 0}):null,s?(0,Y.jsxs)(P,{variant:`outline`,size:`sm`,className:c,onClick:()=>void Z(s,`Worktree path copied`),children:[(0,Y.jsx)(j,{"aria-hidden":`true`}),`Copy worktree path`]}):null,o?(0,Y.jsxs)(P,{variant:`outline`,size:`sm`,"data-slot":`resume-command`,title:o,className:c,onClick:()=>void Z(o,`Command copied to clipboard.`),children:[(0,Y.jsx)(j,{"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)(I,{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)(P,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,Y.jsx)(O,{})})]}),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{D(`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)(j,{className:`size-3.5`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function sn({run:e}){let t=ae(),n=ce(),i=r=>n===void 0?void 0:ye(n,e.id,r,t),a=(0,J.useMemo)(()=>be(e,t),[e,t]),o=[],s=[],c=a.filter(e=>e.kind===`PR`);for(let t of c)o.push((0,Y.jsx)(N,{reference:t,to:i(t),taskTitle:U(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,Y.jsx)(Pt,{run:e,prNumber:t.number})},we(t)));let l=xe(e);l&&r(l)&&!c.some(e=>e.url===l)&&o.push((0,Y.jsx)(N,{reference:{kind:`PR`,url:l},taskTitle:U(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)(N,{reference:t,to:i(t),taskTitle:U(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},we(t)));let d=ve(e,t);if(d&&r(d)&&!u.some(e=>e.url===d)){let t=Se(d);s.push((0,Y.jsx)(N,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},to:t?i({kind:`Issue`,number:Number(t),url:d}):void 0,taskTitle:U(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=it(),t=fe();return vt(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)(V,{children:[(0,Y.jsx)(z,{asChild:!0,children:(0,Y.jsxs)(P,{variant:`outline`,size:`sm`,"data-slot":`notifying-chip`,className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":n?`Notifying ${W(t)} — webhook actions`:`Notifying — webhook actions`,title:n?ln(t):void 0,children:[(0,Y.jsx)(ct,{tone:`success`}),(0,Y.jsx)(`span`,{children:`Notifying`}),(0,Y.jsx)(A,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,Y.jsxs)(B,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[n?(0,Y.jsx)(F,{"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)(I,{className:`min-h-11`,onSelect:()=>a(`note`),children:[(0,Y.jsx)(We,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,Y.jsxs)(I,{variant:`destructive`,className:`min-h-11`,disabled:r.isPending,onSelect:()=>r.mutate({notify:!1},{onSuccess:()=>D(`Stopped notifying the webhook`),onError:e=>D(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),children:[(0,Y.jsx)(Vt,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,Y.jsxs)(P,{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)(At,{"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),D(i===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>D(`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=W(t);return(0,Y.jsx)(nt,{open:e!==null,onOpenChange:e=>{e||c(``),r(e)},children:(0,Y.jsx)(et,{"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)($e,{className:`text-left`,children:[(0,Y.jsx)(tt,{children:l?`Send a note to ${t.length===1?`the webhook`:`the webhooks`}`:`Hand off to webhook`}),(0,Y.jsx)(Qe,{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)(Ve,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,Y.jsxs)(Ze,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:h-11 max-sm:[&>button]:w-full`,children:[(0,Y.jsx)(P,{type:`button`,variant:`ghost`,className:`sm:h-9`,onClick:()=>r(!1),children:`Cancel`}),(0,Y.jsxs)(P,{type:`submit`,variant:`contrast`,className:`sm:h-9`,"data-action":`handoff-submit`,disabled:n||l&&s.trim()===``,children:[(0,Y.jsx)(At,{"aria-hidden":`true`}),l?`Send note`:`Hand off`]})]})]})})})}function pn({runId:e,children:t}){let n=he(),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}=ge(),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)(A,{"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=b(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=b(e.id,{enabled:e.delegation?.role===`root`});return t.isSuccess&&t.data.workers.some(e=>st(e.status))}function xn({run:e,open:t,onToggle:n}){let r=b(e.id),a=se(),s=wt(),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?U(t):`worker ${e.slice(0,8)}`};return(0,Y.jsx)(_n,{slot:`workers`,icon:(0,Y.jsx)(Te,{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)(H,{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?U(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)(De,{"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)(P,{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 h(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)(ke,{"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)(He,{role:`status`,"aria-label":`Worker running`,className:i(t,`animate-spin stroke-pending motion-reduce:animate-none`)}):(0,Y.jsx)(Me,{"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=ne(e),[r,i]=(0,J.useState)(!1);if(!jn.has(t.status)||t.destroy?.phase===`complete`&&t.destroy.remaining.length===0)return null;let o=t.workerId.slice(0,8),s=!!t.destroy&&t.destroy.phase!==`complete`,c=n.error instanceof a?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:g(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)(P,{variant:`danger-ghost`,size:`sm`,className:`min-h-11`,"aria-label":`Confirm clean up of worker ${o}`,onClick:()=>{i(!1),n.mutate({workerId:t.workerId})},children:`Clean up`}),(0,Y.jsx)(P,{variant:`outline`,size:`sm`,className:`min-h-11`,onClick:()=>i(!1),children:`Cancel`})]}):(0,Y.jsx)(P,{variant:`outline`,size:`sm`,className:`min-h-11`,"aria-label":s?`Retry clean up of worker ${o}`:`Clean up worker ${o}`,disabled:n.isPending,onClick:()=>i(!0),children:n.isPending?`Cleaning up…`:s?`Retry clean up`:`Clean up`}),n.isError&&!r?(0,Y.jsx)(`span`,{role:`status`,className:`break-words text-xs`,children:c?`Cleanup stopped: this worker holds ${Pn(c)}. Land or commit what you need first, or discard it.`:`Cleanup did not finish: ${n.error.message}`}):null,c&&!r&&!n.isPending?(0,Y.jsx)(P,{variant:`danger-ghost`,size:`sm`,className:`min-h-11`,"aria-label":`Discard work and clean up worker ${o}`,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=lt(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)(H,{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)(k,{"aria-hidden":!0,className:`shrink-0 [block-size:1.2cap] [inline-size:auto]`}),`Parent`]})}function zn({id:e}){let t=re(e),n=t.data?U(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)(H,{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)(k,{"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)(P,{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`?Ee:Ne,{"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)(Ke,{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=Ot();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)(P,{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)(Le,{"aria-hidden":`true`}),Gn(e,n),t.live?(0,Y.jsx)(ct,{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`||!Nt(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)(V,{children:[(0,Y.jsxs)(z,{"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)(B,{align:`end`,children:i.map(t=>(0,Y.jsx)(I,{asChild:!0,children:(0,Y.jsx)(H,{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=l(e),a=K(e),o=bn(e),[s,c]=(0,J.useState)(!1),[u,d]=(0,J.useState)(!1),f=er(e,n),p=se(),m=le(),h=Zt(e,{queuePosition:e.status===`queued`?ot(p.data??[]).get(e.id):void 0}),g=gt(),_=ht(),v=g!==null&&!_?g:null,y=v!==null,{referenceProjectId:ee,repoBase:b,requests:te}=en(e),ne=(0,J.useMemo)(()=>Ce(e,b),[e,b]),x=typeof t==`object`?t:null,{inline:re,overflow:S}=Hn(ne,x),ie=m.data?.capabilities?.preview===!0,C=e.worktreePath&&ie?(0,Y.jsx)(Kn,{servers:e.previewServers??[]}):null,w=(0,Y.jsx)(ir,{run:e,actions:f,onOpenChooser:()=>d(!0),onToggleNotes:()=>c(e=>!e)}),T=Yn(e,a,t,o);return(0,Y.jsx)(Ge,{projectId:ee,repoBase:b,requests:te,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)(Dt,{slot:v,children:[(0,Y.jsx)(rr,{run:e}),(0,Y.jsx)(Jn,{run:e,compact:!0}),w]}):(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:[T,C,(0,Y.jsx)(dn,{run:e}),w]})]}),(0,Y.jsx)(Zn,{shown:v!==null,run:e,archiveButton:T,previewToggle:C}),(0,Y.jsx)(Qn,{run:e,tab:t,activeItem:x,inlineItemTabs:re,overflowItemTabs:S,phoneBar:y,isDesktop:_}),s?(0,Y.jsx)(sr,{runId:e.id,onClose:()=>c(!1)}):null,u?(0,Y.jsx)(an,{run:e,canResume:K(e).terminal,onResume:()=>f.terminal.mutate(),onClose:()=>d(!1)}):null]}),(0,Y.jsx)(or,{run:e,actions:f})]})})}function er(e,t){let n=p(),r=rt(),[i,a]=(0,J.useState)(null),o=()=>n.invalidateQueries({queryKey:S.runs.all}),s=e=>D(e.message,{tone:`danger`}),c=C(),l={isPending:c.isPending,mutate:()=>c.mutate({id:e.id,pinned:!e.pinned})},u=me();return{pin:l,markUnread:{isPending:u.isPending,mutate:()=>{t?.(),u.mutate(e.id,{onError:s})}},delete:E({mutationFn:()=>f(e.id),onSuccess:()=>{o(),r(`/`)},onError:s}),terminal:tn(e),confirming:i,setConfirming:a}}function tr(e){let t=x(e.id),n=U(e);return{title:n,editor:kt(n,e=>t.mutate({title:e},{onError:e=>D(e.message,{tone:`danger`})}))}}function nr({run:e}){let{title:t,editor:n}=tr(e);return n.editing?(0,Y.jsx)(St,{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)(ft,{className:`size-3.5`,"aria-hidden":`true`})})]})}function rr({run:e}){let{title:t,editor:n}=tr(e);return(0,Y.jsxs)(Xe,{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)(Je,{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)(ft,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,Y.jsx)(Ye,{align:`end`,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),n.cancel()},children:(0,Y.jsx)(St,{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=x(e.id),s=(0,J.useId)();return(0,Y.jsxs)(V,{children:[(0,Y.jsx)(z,{asChild:!0,children:(0,Y.jsx)(P,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,Y.jsx)(Ie,{"aria-hidden":`true`})})}),(0,Y.jsxs)(B,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,Y.jsx)(F,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),(0,Y.jsxs)(I,{onSelect:n,children:[(0,Y.jsx)(_t,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,Y.jsx)(an,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),a?(0,Y.jsxs)(I,{onSelect:()=>void Z(a,`Command copied to clipboard.`),children:[(0,Y.jsx)(j,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.markUnread?(0,Y.jsxs)(I,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,Y.jsx)(Ht,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,Y.jsxs)(R,{"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)(Pe,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,(0,Y.jsx)(L,{}),(0,Y.jsx)(F,{className:`text-xs text-muted-foreground`,children:`AFTER DONE`}),(0,Y.jsx)(R,{"data-slot":`archive-when-done`,className:`min-h-11`,checked:e.archiveWhenDone===!0,disabled:o.isPending,onCheckedChange:e=>o.mutate({archiveWhenDone:e},{onError:e=>D(e.message,{tone:`danger`})}),children:`Archive when Done`}),(0,Y.jsx)(R,{"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=>D(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)(L,{}):null,i.deleteRun?(0,Y.jsxs)(I,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,Y.jsx)(Oe,{"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=>D(e.message,{tone:`danger`});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(L,{}),(0,Y.jsx)(F,{className:`text-xs text-muted-foreground`,children:`TASK ACCESS`}),(0,Y.jsx)(R,{"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)(R,{"data-slot":`allow-messaging`,className:`min-h-11`,checked:ee(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)(bt,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,Y.jsxs)(xt,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Y.jsxs)(jt,{children:[(0,Y.jsx)(pt,{className:`text-danger`,children:`Delete task permanently?`}),(0,Y.jsx)(ut,{children:(0,Y.jsxs)(Y.Fragment,{children:[`Delete “`,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,title:U(e),children:U(e)}),`” and its transcript`,e.delegation?.role===`worker`&&!g(e.delegation.workspace)?``:`, worktree and branch`,`. This cannot be undone.`]})})]}),(0,Y.jsxs)(mt,{children:[(0,Y.jsx)(yt,{children:`Cancel`}),(0,Y.jsx)(dt,{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=ie(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)(P,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,Y.jsx)(O,{})})]}),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)(P,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void Z(n.data??``,`Notes copied`),children:`Copy notes`}),(0,Y.jsx)(P,{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{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{Pn as i,br as a,ci as o,jn as s}from"./project-scope-context-d3J3hWPR.js";import{Kt as c,Rt as l,Wt as u,Xt as d,ht as f,in as p}from"./queries-dnpdX9VT.js";import{t as m}from"./useQuery-CkUPLiaa.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{Wn as w}from"./index-CS5yyNbo.js";var T=e(t(),1),E=n();function D(e,t){return u(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>c(t).length;function k(e,t,n){let r=a(e.data,t),i=r!==void 0&&r.status!==`not-installed`&&(n??r.status)===`connected`,o=!e.isPending&&!e.isError&&r?.enabled===!0&&i;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=d().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 i(await s.api.v1.providers[`sign-in`].start.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/sign-in/start`)}async function M(e){return i(await s.api.v1.providers[`sign-in`][`:id`].$get({param:{id:e}}),`/providers/sign-in/:id`)}async function N(e,t){return i(await s.api.v1.providers[`sign-in`][`:id`].redirect.$post({param:{id:e},json:{redirectUrl:t}}),`/providers/sign-in/:id/redirect`)}async function P(e){return i(await s.api.v1.providers[`sign-in`][`:id`].$delete({param:{id:e}}),`/providers/sign-in/:id`)}function F(e,t){let n=o(),[r,i]=(0,T.useState)(!1),[a,s]=(0,T.useState)(null),[c,u]=(0,T.useState)(``),d=(0,T.useRef)(null),f=(0,T.useRef)(!0),h=(0,T.useRef)(0),g=()=>{h.current++,v.current=!1;let e=d.current;d.current=null,e?.state===`waiting`&&P(e.id).catch(()=>{}),s(null),u(``),i(!1)};(0,T.useEffect)(()=>(f.current=!0,()=>{f.current=!1,h.current++;let e=d.current;e?.state===`waiting`&&P(e.id).catch(()=>{})}),[]);let _=p({mutationFn:n=>j(e,t).then(e=>({result:e,generation:n})),retry:!1,onSuccess:({result:e,generation:t})=>{if(!f.current||!v.current||t!==h.current){P(e.id).catch(()=>{});return}d.current=e,s(e)}}),v=(0,T.useRef)(r);v.current=r;let y=m({queryKey:[`browser-sign-in`,a?.id],queryFn:()=>M(a.id),enabled:r&&a?.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??a,x=p({mutationFn:()=>N(a.id,c),retry:!1,onSuccess:()=>{u(``),y.refetch()}});return(0,T.useEffect)(()=>{b?.state===`connected`&&(d.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:u,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:c,status:l,error:u,close:d,connect:p}=F(e,t);return f().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||d()},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()||c.isPending,onClick:()=>c.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,u?(0,E.jsx)(`p`,{role:`alert`,children:u.message}):null,l.isError&&i?.state===`waiting`?(0,E.jsx)(_,{onClick:()=>void l.refetch(),children:`Retry status`}):null,(0,E.jsx)(v,{children:(0,E.jsx)(_,{variant:`outline`,onClick:d,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{Qr as e,li as t}from"./project-scope-context-d3J3hWPR.js";function n(n,r){return e(n,t,r)}export{n as t};