@hearsay-tools/squawk 0.19.0-dev.9130 → 0.19.0-dev.9132

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 (80) hide show
  1. package/dist/ci-wait/controller.d.ts +7 -7
  2. package/dist/delegation/routes.d.ts +78 -78
  3. package/dist/features/hosts/routes.d.ts +44 -44
  4. package/dist/features/reports/routes.d.ts +2 -2
  5. package/dist/features/webhooks/routes.d.ts +38 -38
  6. package/dist/server/activity-routes.d.ts +23 -23
  7. package/dist/server/models-routes.d.ts +12 -12
  8. package/dist/server/project-settings-routes.d.ts +107 -107
  9. package/dist/server/projects-routes.d.ts +41 -41
  10. package/dist/server/provider-sign-in-routes.d.ts +2 -2
  11. package/dist/server/providers-routes.d.ts +58 -58
  12. package/dist/server/repo-routes.d.ts +13 -13
  13. package/dist/server/runner-install-routes.d.ts +10 -10
  14. package/dist/server/runners-routes.d.ts +10 -10
  15. package/dist/server/runs-routes.d.ts +311 -311
  16. package/dist/server/server.d.ts +1170 -1170
  17. package/dist/server/workspace-identity-routes.d.ts +5 -5
  18. package/dist/server/workspace-live-routes.d.ts +5 -5
  19. package/dist/server/workspace-routes.d.ts +85 -85
  20. package/package.json +4 -4
  21. package/web/dist/assets/{accounts-section-CB4vkCsb.js → accounts-section-B4kEEiWs.js} +1 -1
  22. package/web/dist/assets/{activity-motion-CWVqj0za.js → activity-motion-DUZ4l5Y3.js} +1 -1
  23. package/web/dist/assets/{activity-route-D_1WO5Z1.js → activity-route-YAqJVIKB.js} +1 -1
  24. package/web/dist/assets/{agent-config-section-DoqyETC4.js → agent-config-section-bUNUaoek.js} +1 -1
  25. package/web/dist/assets/{agent-defaults-section-OS2L78-e.js → agent-defaults-section-B8dWNT51.js} +1 -1
  26. package/web/dist/assets/{appearance-CLcSBCp1.js → appearance-BwqalVnF.js} +1 -1
  27. package/web/dist/assets/{archive-on-merge-field-C2Byigt_.js → archive-on-merge-field-B3PVwd5v.js} +1 -1
  28. package/web/dist/assets/{ask-card-C4IYkE2O.js → ask-card-BmLwnSDP.js} +1 -1
  29. package/web/dist/assets/{automations-route-BZHu5YyF.js → automations-route-B0AiEpEO.js} +1 -1
  30. package/web/dist/assets/{commit-list-B8WibZ6m.js → commit-list-DidJ1SQk.js} +1 -1
  31. package/web/dist/assets/{diff-B_8aWFPC.js → diff-1-ZZxHE7.js} +2 -2
  32. package/web/dist/assets/{diff-controls-QX-jSmyx.js → diff-controls-BW6ZPORB.js} +1 -1
  33. package/web/dist/assets/{diff-view-BS1q2trQ.js → diff-view-BXLNGK_U.js} +1 -1
  34. package/web/dist/assets/{discard-changes-dialog-_XKURVyg.js → discard-changes-dialog-BVKAatbp.js} +1 -1
  35. package/web/dist/assets/{file-preview-Dfpn6tQe.js → file-preview-CL7CFVQW.js} +1 -1
  36. package/web/dist/assets/{git-toolbar-DuUdRzI1.js → git-toolbar-Cn5M9SIx.js} +1 -1
  37. package/web/dist/assets/{github-CPC8EK-y.js → github-CWssvL9L.js} +1 -1
  38. package/web/dist/assets/{global-activity-route-B7WkPq9M.js → global-activity-route-WSb9IeCy.js} +1 -1
  39. package/web/dist/assets/index-CESQIsLq.css +1 -0
  40. package/web/dist/assets/{index-BovBmPyJ.js → index-CS4efF3Z.js} +4 -4
  41. package/web/dist/assets/{markdown-B0yqWHDP.js → markdown-DkyIbV7h.js} +1 -1
  42. package/web/dist/assets/{option-select-COXy_9e6.js → option-select-DgSc8QKe.js} +1 -1
  43. package/web/dist/assets/{preferences-section-Bbzs9RW1.js → preferences-section-C5ipASFT.js} +1 -1
  44. package/web/dist/assets/{preview-pane-connected-dMTWNhX8.js → preview-pane-connected-B_DUnNJx.js} +1 -1
  45. package/web/dist/assets/{project-location-B-O2lQQU.js → project-location-0NYs0ZDN.js} +1 -1
  46. package/web/dist/assets/{projects-section-BjffHvrf.js → projects-section-CQquy8jC.js} +1 -1
  47. package/web/dist/assets/{prompt-templates-section--SsT2vbo.js → prompt-templates-section-CbchtG9G.js} +1 -1
  48. package/web/dist/assets/{remote-settings-notice-DyWrqTzR.js → remote-settings-notice-BosQQg8I.js} +1 -1
  49. package/web/dist/assets/{repo-git-CAX7JKaD.js → repo-git-DxWPoHJ9.js} +1 -1
  50. package/web/dist/assets/{report-reader-Cu5tL1Ph.js → report-reader-DCpgZb3Q.js} +1 -1
  51. package/web/dist/assets/{reports-D9ouruqt.js → reports-C7oXbx7H.js} +1 -1
  52. package/web/dist/assets/{resources-section-D21Lq0Jb.js → resources-section-B7ikBubL.js} +1 -1
  53. package/web/dist/assets/{review-notes-drafts-AEBwPEaV.js → review-notes-drafts-DrS7HBu8.js} +1 -1
  54. package/web/dist/assets/{review-panel-Cy1EYoBI.js → review-panel-DocPb2sY.js} +1 -1
  55. package/web/dist/assets/{review-strip-ClN1AfmS.js → review-strip-BqnpW1n1.js} +1 -1
  56. package/web/dist/assets/run-header-C_asFhAY.js +2 -0
  57. package/web/dist/assets/{select-JCfCIElu.js → select-DuuHVsVn.js} +1 -1
  58. package/web/dist/assets/{session-context-section-Cbzxxjcu.js → session-context-section-DecXXiZF.js} +1 -1
  59. package/web/dist/assets/{settings-agent-picker-1H6fIPXo.js → settings-agent-picker-C4KKci2g.js} +1 -1
  60. package/web/dist/assets/{settings-save-bar-BUi6H-gE.js → settings-save-bar-Jp9UQXYS.js} +1 -1
  61. package/web/dist/assets/{settings-shell-lj--GRCk.js → settings-shell-D_WnST_P.js} +1 -1
  62. package/web/dist/assets/{sidebar-section-Cv1ulfXy.js → sidebar-section-Dyw_hnnC.js} +1 -1
  63. package/web/dist/assets/{skills-DAJzu767.js → skills-C48utCzL.js} +1 -1
  64. package/web/dist/assets/{task-changes-GTdXC-dZ.js → task-changes-CHMaGATC.js} +1 -1
  65. package/web/dist/assets/{task-commits-6ZKh7FRW.js → task-commits-BWBec83J.js} +1 -1
  66. package/web/dist/assets/{task-file-scope-CaJR98S8.js → task-file-scope-bmyzqReq.js} +1 -1
  67. package/web/dist/assets/{task-files-DRnSkRoC.js → task-files-BjSP_4uv.js} +1 -1
  68. package/web/dist/assets/{task-github-item-080YJpbP.js → task-github-item-CFCxfzlu.js} +1 -1
  69. package/web/dist/assets/{task-thread-D1bM1I_e.js → task-thread-C4aSbGAi.js} +1 -1
  70. package/web/dist/assets/{thread-state-CmjIQNn7.js → thread-state-C1Pf77GN.js} +1 -1
  71. package/web/dist/assets/{use-finish-run-BE6ugaLE.js → use-finish-run-CqVI9_BW.js} +1 -1
  72. package/web/dist/assets/{use-hand-to-agent-state-CK_1_QCG.js → use-hand-to-agent-state-B0wW0kOx.js} +1 -1
  73. package/web/dist/assets/use-path-bases-BZSjw1dB.js +1 -0
  74. package/web/dist/assets/{workflows-D9hqYoNT.js → workflows-B8CS-UWS.js} +1 -1
  75. package/web/dist/assets/{workspace-tools-DuYt1zu5.js → workspace-tools-DA2Q9bj8.js} +1 -1
  76. package/web/dist/assets/{worktrees-section-JViXzzNC.js → worktrees-section-BdZorHZ5.js} +1 -1
  77. package/web/dist/index.html +2 -2
  78. package/web/dist/assets/index-FmHk4o3n.css +0 -1
  79. package/web/dist/assets/run-header-C7L9lspH.js +0 -2
  80. package/web/dist/assets/use-path-bases-RiQd3y2m.js +0 -1
@@ -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{o as r,s as i}from"./dist-C_rn70hE.js";import{G as a,H as o,J as s,St as c,U as l,Ut as u,V as d,W as f,bt as p,cn as m,ct as h,d as g,et as _,ln as v,nn as y,nt as ee,un as b,vt as te,xt as x}from"./queries-CchoEEzj.js";import{Bt as ne,Nn as re,Rn as S,Sr as ie,dr as ae,ft as C,lr as oe,n as w,rt as T,vi as se,zt as E}from"./toaster-zMN8cNZQ.js";import{C as ce,S as le,T as ue,b as de,g as fe,i as pe,m as me,n as he,p as ge,t as D,x as _e}from"./reference-chip-z7dZJVH-.js";import{I as ve,S as ye,Y as be,a as xe,m as Se,mt as Ce,st as we,t as Te,u as Ee,y as O}from"./design-icons-QbNMZniQ.js";import{t as k}from"./createLucideIcon-BHp8sXmF.js";import{t as De}from"./app-window-CSHwDX9N.js";import{n as Oe,r as ke,t as Ae}from"./open-in-menu-CbQWVBD0.js";import{t as je}from"./info-DA1x_4bz.js";import{t as Me}from"./message-square-B-MD-8rD.js";import{t as Ne}from"./square-terminal-B6RYYieR.js";import{t as A}from"./button-B22ANdCY.js";import{a as j,i as M,l as N,n as P,p as F,r as I,t as L}from"./dropdown-menu-DjtKUK8F.js";import{n as Pe,r as Fe,t as Ie}from"./popover-CvL6hQ5c.js";import{a as Le,i as Re,o as ze,r as Be,s as Ve,t as He}from"./dialog-rpNyAWGb.js";import{c as Ue,s as We,t as R}from"./project-router-j0uBi7Ep.js";import"./attention-DnxGjw_R.js";import{T as Ge,f as z,u as Ke}from"./task-groups-CGCnVqHE.js";import{t as B}from"./status-dot-Drd4-nfa.js";import{t as qe}from"./format-BU7D3IfE.js";import{a as Je}from"./agent-accounts-D_7QcFSx.js";import{Er as Ye,J as Xe,Ln as Ze,Sn as V,Y as H,Yn as Qe,_ as $e,_n as et,a as tt,an as nt,cn as rt,dn as it,g as at,in as ot,kn as U,mr as st,nn as ct,nr as lt,o as ut,on as dt,pn as ft,pr as W,q as pt,r as G,rn as mt,rr as ht,sn as gt,tn as _t,tr as vt,vr as yt,xn as K}from"./index-BovBmPyJ.js";import{t as bt}from"./textarea-vEsJAUAV.js";import{t as xt}from"./markdown-B0yqWHDP.js";import{t as St}from"./task-file-scope-CaJR98S8.js";import{t as q}from"./tab-link-BKlpD9sn.js";var Ct=k(`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`}]]),wt=k(`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`}]]),Tt=k(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Et=k(`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 Dt(e){let t=h();return b({mutationFn:t=>T(v(e),t),onSuccess:()=>t.invalidateAfter(`runs`,()=>m()),onError:e=>w(e.message,{tone:`danger`})})}function Ot(e){return e.archived?`Unarchive`:`Archive task`}function kt({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,Y.jsx)(_t,{open:t,onOpenChange:n,children:(0,Y.jsxs)(ot,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Y.jsxs)(gt,{children:[(0,Y.jsx)(rt,{children:`Archive task?`}),(0,Y.jsxs)(nt,{children:[`Move “`,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,title:z(e),children:z(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,Y.jsxs)(dt,{children:[(0,Y.jsx)(mt,{children:`Cancel`}),(0,Y.jsx)(ct,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function At({run:e,className:t}){let[n,i]=(0,J.useState)(!1),a=Dt(e.id),o=Ot(e);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(A,{type:`button`,variant:`outline`,"data-slot":`archive-action`,"aria-label":o,title:e.archived?`Put this task back in Active tasks`:`Move this task out of Active tasks`,disabled:a.isPending,className:r(`gap-[7px] px-3`,t),onClick:()=>e.archived?a.mutate(!1):i(!0),children:[e.archived?(0,Y.jsx)(Ye,{"aria-hidden":`true`}):(0,Y.jsx)(Te,{"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:o})]}),(0,Y.jsx)(kt,{run:e,open:n,onOpenChange:i,onConfirm:()=>{a.mutate(!0),i(!1)}})]})}function jt({run:e,action:t,prUrl:n,patch:r}){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&&i(n)?(0,Y.jsx)(A,{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)(A,{variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({autoMergePr:!1},{onError:e=>w(e.message,{tone:`danger`})}),children:r.isPending?`Saving…`:`Disable auto-merge`}):null]})]})}function Mt({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)(A,{variant:`outline`,asChild:!0,children:(0,Y.jsx)(R,{to:`/tasks/${t.runId}`,children:`Open blocking task`})}):null,t.pullRequestUrl&&i(t.pullRequestUrl)?(0,Y.jsx)(A,{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)(At,{run:e}):null]})]})}function Nt({run:e}){let t=f(e.id),n=V(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-card-edge bg-card p-3 shadow-card [margin-block:0.75rem]`,children:[a?(0,Y.jsx)(jt,{run:e,action:a,prUrl:o,patch:t}):null,i?(0,Y.jsx)(Mt,{run:e,blocker:i,flags:n}):null]})}var Pt=[`running`,`queued`,`waiting`];function Ft(e,{queuePosition:t,now:n=new Date}){let r=re(e),i=Ze(e,r).label,a=t===void 0?i:`${i} #${t}`,o=Pt.includes(e.status)?Lt(e,n):void 0;return o?{attention:r,label:a,nextCheck:o}:{attention:r,label:a}}function It(e){return e.nextCheck?`${e.label} · Next check ${e.nextCheck.text}`:e.label}function Lt(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:qe(n,t)}}async function X(e,t){try{await navigator.clipboard.writeText(e),w(t)}catch{w(`Run manually: ${e}`)}}function Rt(e){let t=p(),n=g(),r=(0,J.useMemo)(()=>ue(e,t),[e,t]);return{referenceProjectId:n,repoBase:t,references:r,requests:(0,J.useMemo)(()=>n===void 0?[]:r.filter(e=>ge(e,t)).map(e=>({projectId:n,kind:e.kind,number:e.number})),[r,n,t])}}function zt(e){return b({mutationFn:()=>ne(e.id),onError:e=>{if(e instanceof S&&e.command){X(e.command,`No terminal found — command copied to clipboard.`);return}w(e.message,{tone:`danger`})}})}function Z(e,t){let n=l(),r=c(),i=y(),a=b({mutationFn:t=>E(e.id,t),onError:e=>w(e.message,{tone:`danger`})}),o=Je(),s=Ge(e),u=o.runnersOn(e=>t&&s.sessionId!==void 0&&e===s.backend?s.profileId??`default`:o.repoAccount?.[e]).runners,d=e=>!r.isSuccess||!i.isSuccess||u.includes(e??`claude`);return{canResumeHere:t&&d(et(e)),choices:e.worktreePath?(n.data?.targets??[]).filter(e=>{let t=Oe(e.id);return t===void 0||i.isSuccess&&d(t)}).map(t=>({target:t,...ft(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[],open:a}}function Bt({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Z(e,t),o=y().data,s=K(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)(A,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,Y.jsx)(Ne,{}),`Terminal (resume session)`]}):null,i.map(({target:e,suffix:t,title:n})=>{let r=ke(e,o);return(0,Y.jsxs)(A,{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)(A,{variant:`outline`,onClick:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>w(`Worktree path copied`)).catch(()=>w(`Path: ${t}`))},children:[(0,Y.jsx)(O,{}),`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)(A,{variant:`outline`,onClick:()=>void X(s,`Command copied to clipboard.`),children:[(0,Y.jsx)(O,{}),`Copy resume command`]})]}):null]})}function Vt({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Z(e,t),o=K(e),s=e.worktreePath;return!r&&i.length===0&&!o&&!s?null:(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)(Ae,{choices:i,onPick:e=>a.mutate(e),disabled:a.isPending,triggerVariant:`outline`,leading:r?(0,Y.jsxs)(M,{"data-target":`terminal-resume`,onSelect:n,children:[(0,Y.jsx)(Ne,{"aria-hidden":`true`}),`Terminal (resume session)`]}):void 0}):null,s?(0,Y.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void X(s,`Worktree path copied`),children:[(0,Y.jsx)(O,{"aria-hidden":`true`}),`Copy worktree path`]}):null,o?(0,Y.jsxs)(A,{variant:`outline`,size:`sm`,"data-slot":`resume-command`,title:o,onClick:()=>void X(o,`Command copied to clipboard.`),children:[(0,Y.jsx)(O,{"aria-hidden":`true`}),`Copy resume command`]}):null]})}function Ht({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let{canResumeHere:a,choices:o}=Z(e,t);return!a&&o.length===0?null:r?(0,Y.jsx)(M,{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)(A,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,Y.jsx)(Ce,{})})]}),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)(Bt,{run:e,canResume:t,onResume:n})})]})}function Ut({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{w(`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-xs 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)(O,{className:`size-3.5`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function Wt({run:e}){let t=p(),n=g(),r=r=>n===void 0?void 0:_e(n,e.id,r,t),a=(0,J.useMemo)(()=>ue(e,t),[e,t]),o=[],s=[],c=a.filter(e=>e.kind===`PR`);for(let t of c)o.push((0,Y.jsx)(D,{reference:t,to:r(t),taskTitle:z(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,Y.jsx)(it,{run:e,prNumber:t.number})},fe(t)));let l=ce(e);l&&i(l)&&!c.some(e=>e.url===l)&&o.push((0,Y.jsx)(D,{reference:{kind:`PR`,url:l},taskTitle:z(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)(D,{reference:t,to:r(t),taskTitle:z(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},fe(t)));let d=de(e,t);if(d&&i(d)&&!u.some(e=>e.url===d)){let t=me(d);s.push((0,Y.jsx)(D,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},to:t?r({kind:`Issue`,number:Number(t),url:d}):void 0,taskTitle:z(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 Gt(){let e=We(),t=x();return pt(t.data?.projects?.find(n=>n.id===(e??t.data?.bootProject)))}var Q=e=>e.map(e=>`${e.name}: ${Xe(e.url)}`).join(`
2
- `);function Kt(e){let t=Qe(),n=Gt(),r=n.length>0,i=o(e.id),[a,s]=(0,J.useState)(null),c=e.notify===!0,l=()=>i.mutate({notify:!1},{onSuccess:()=>w(`Stopped notifying the webhook`),onError:e=>w(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),u=r?(0,Y.jsx)(Xt,{mode:a,targets:n,pending:i.isPending,onOpenChange:e=>!e&&s(null),onSubmit:e=>i.mutate({notify:!0,...e?{message:e}:{}},{onSuccess:()=>{s(null),w(a===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>w(`Could not hand off. ${e.message}`,{tone:`danger`})})}):null;return{visible:t!==`absent`&&(r||c),notifying:c,reachable:r,targets:n,pending:i.isPending,open:s,stop:l,dialog:u}}function qt({run:e}){let t=Kt(e);if(!t.visible)return null;let{notifying:n,reachable:r,targets:i}=t;return(0,Y.jsxs)(Y.Fragment,{children:[n?(0,Y.jsxs)(L,{children:[(0,Y.jsx)(F,{asChild:!0,children:(0,Y.jsxs)(A,{variant:`outline`,"data-slot":`notifying-chip`,className:`gap-1.5`,"aria-label":r?`Notifying ${H(i)} — webhook actions`:`Notifying — webhook actions`,title:r?Q(i):void 0,children:[(0,Y.jsx)(B,{tone:`success`}),(0,Y.jsx)(`span`,{children:`Notifying`}),(0,Y.jsx)(Ee,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,Y.jsxs)(I,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[r?(0,Y.jsx)(j,{"data-slot":`notifying-targets`,className:`flex flex-col gap-0.5 px-2 py-1.5 text-xs font-normal text-muted-foreground`,children:i.map(e=>(0,Y.jsx)(`span`,{"data-webhook-target":e.id,className:`truncate`,title:Xe(e.url),children:e.name},e.id))}):null,r?(0,Y.jsxs)(M,{className:`min-h-11`,onSelect:()=>t.open(`note`),children:[(0,Y.jsx)(Me,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,Y.jsxs)(M,{variant:`destructive`,className:`min-h-11`,disabled:t.pending,onSelect:t.stop,children:[(0,Y.jsx)(Ct,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,Y.jsxs)(A,{variant:`outline`,"data-action":`handoff`,className:`max-md:px-0`,"aria-label":`Hand off to webhook`,onClick:()=>t.open(`handoff`),children:[(0,Y.jsx)(W,{"aria-hidden":`true`}),(0,Y.jsx)(`span`,{className:`max-md:sr-only`,children:`Hand off`})]}),t.dialog]})}function Jt({handoff:e}){if(!e.visible)return null;let{notifying:t,reachable:n,targets:r}=e;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(N,{}),(0,Y.jsx)(j,{"data-slot":`handoff-menu-label`,className:`truncate px-2 py-3 text-[12px] font-normal text-muted-foreground uppercase`,title:n?Q(r):void 0,children:n?`Webhook · ${H(r)}`:`Webhook`}),t?(0,Y.jsxs)(Y.Fragment,{children:[n?(0,Y.jsx)(M,{"data-action":`handoff-note`,className:`min-h-11`,onSelect:()=>e.open(`note`),children:`Send a note…`}):null,(0,Y.jsx)(M,{"data-action":`handoff-stop`,variant:`destructive`,className:`min-h-11`,disabled:e.pending,onSelect:e.stop,children:`Stop notifying`})]}):(0,Y.jsx)(M,{"data-action":`handoff`,className:`min-h-11`,onSelect:()=>e.open(`handoff`),children:`Hand off to webhook…`})]})}function Yt({run:e}){let t=Qe(),n=Gt();return e.notify!==!0||t===`absent`?null:(0,Y.jsx)(G,{"data-slot":`notifying-status`,role:`img`,"aria-label":n.length>0?`Notifying ${H(n)}`:`Notifying`,title:n.length>0?Q(n):void 0,className:`shrink-0 px-2 py-px leading-4`,children:(0,Y.jsx)(W,{"aria-hidden":`true`,className:`size-3 text-success`})})}function Xt({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=H(t);return(0,Y.jsx)(He,{open:e!==null,onOpenChange:e=>{e||c(``),r(e)},children:(0,Y.jsx)(Be,{"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)(ze,{className:`text-left`,children:[(0,Y.jsx)(Ve,{children:l?`Send a note to ${t.length===1?`the webhook`:`the webhooks`}`:`Hand off to webhook`}),(0,Y.jsx)(Re,{children:(0,Y.jsx)(`span`,{"data-webhook-destination":``,title:Q(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)(je,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,Y.jsxs)(Le,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:w-full`,children:[(0,Y.jsx)(A,{type:`button`,variant:`ghost`,onClick:()=>r(!1),children:`Cancel`}),(0,Y.jsxs)(A,{type:`submit`,variant:`contrast`,"data-action":`handoff-submit`,disabled:n||l&&s.trim()===``,children:[(0,Y.jsx)(W,{"aria-hidden":`true`}),l?`Send note`:`Hand off`]})]})]})})})}function Zt({id:e}){return(0,Y.jsxs)(R,{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)(xe,{"aria-hidden":!0,className:`shrink-0 [block-size:1.2cap] [inline-size:auto]`}),`Parent`]})}function Qt({id:e}){let t=s(e),n=t.data?z(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)(R,{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)(xe,{"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)(A,{variant:`outline`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}var $t=3,$=(e,t)=>e.kind===t.kind&&e.number===t.number;function en(e,t,n=$t){let r=t?e.findIndex(e=>$(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 tn=(e,t)=>`/tasks/${e}/${t.kind}/${t.number}`;function nn({tab:e}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(e.kind===`pr`?ve:Se,{"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)(he,{kind:e.kind===`pr`?`PR`:`Issue`,number:e.number,className:`ml-1`})]})}function rn(e,t){let n=e[0],r=e.length+ +!!t;return n?`Preview :${n.port}${r>1?` +${r-1}`:``}`:t?`Preview · agent`:`Preview`}function an({servers:e,icon:t=!1}){let n=at();if(n===null)return null;let i=n.agentLive===!0,a=e[0],o=e.length+ +!!i,s=o===1?a?{port:a.port}:{agent:!0}:{};return t?(0,Y.jsxs)(A,{variant:`ghost`,size:`icon`,"data-slot":`preview-toggle`,"data-entries":o,"aria-pressed":n.open,"aria-label":rn(e,i),className:r(`relative`,o>0?`text-foreground`:`text-soft-foreground`),onClick:()=>n.openPane(s),children:[(0,Y.jsx)(De,{"aria-hidden":`true`}),n.live?(0,Y.jsx)(B,{tone:`success`,"aria-hidden":`true`,"data-slot":`preview-live-dot`,className:`absolute top-2 right-2`}):null]}):(0,Y.jsxs)(A,{variant:`outline`,"data-slot":`preview-toggle`,"aria-pressed":n.open,onClick:()=>n.openPane(s),children:[(0,Y.jsx)(De,{"aria-hidden":`true`}),rn(e,i),n.live?(0,Y.jsx)(B,{tone:`success`,"aria-label":`Preview is live`}):null]})}function on({tab:e}){let t=$e();return!t?.available||e!==`session`&&e!==`changes`?null:(0,Y.jsxs)(A,{variant:`outline`,"data-slot":`split-view-toggle`,className:r(t.showing&&`border-accent-text/40 bg-muted text-accent-text`),"aria-pressed":t.showing,title:t.showing?`Show Session alone`:`Show Changes beside Session`,onClick:()=>t.setOn(!t.showing),children:[(0,Y.jsx)(Tt,{"aria-hidden":`true`}),`Split view`]})}function sn(e){return e?.role===`worker`?`Worker session`:e?.role===`root`?`Parent session`:`Task session`}function cn({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)(Zt,{id:n}):(0,Y.jsx)(Qt,{id:n})}function ln({isDesktop:e,desktopActivitySlot:t,attention:n,statusLine:r}){return e&&t?(0,Y.jsx)(Y.Fragment,{children:t}):(0,Y.jsx)(`span`,{"data-slot":`run-status-slot`,className:`hidden`,children:(0,Y.jsx)(G,{dot:n.tone,shape:n.shape,pulse:n.pulse,children:It(r)})})}function un(e,t,n){return e.worktreePath&&t?(0,Y.jsx)(an,{servers:e.previewServers??[],icon:n}):null}function dn(e,t,n){return n&&!e.archiveBlocker&&t.archive?(0,Y.jsx)(At,{run:e}):null}function fn({archived:e,className:t}){return e?(0,Y.jsx)(G,{"data-slot":`run-archived-pill`,dot:U.tone,shape:U.shape,className:t,children:U.label}):null}function pn({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 mn({run:e,statusLine:t,activityTrigger:n}){let{attention:r}=t;return(0,Y.jsx)(`span`,{"data-slot":`mobile-status-room`,className:`flex min-w-0`,children:(0,Y.jsxs)(`span`,{className:`inline-flex max-w-full min-w-0 items-center gap-1.5`,children:[n??(0,Y.jsx)(G,{"data-slot":`mobile-run-status`,dot:r.tone,shape:r.shape,pulse:r.pulse,className:`min-w-0 px-2 py-px text-xs leading-4`,children:(0,Y.jsx)(`span`,{className:`truncate`,children:t.label})}),(0,Y.jsx)(fn,{archived:e.archived,className:`shrink-0 px-2 py-px text-xs leading-4`}),(0,Y.jsx)(Yt,{run:e})]})})}function hn({run:e,tab:t,activeItem:n,inlineItemTabs:i,overflowItemTabs:a,phoneBar:o,isDesktop:s}){let c=(0,J.useRef)(null),[l,u]=(0,J.useState)(!1);(0,J.useEffect)(()=>{let e=c.current;if(!e||s){u(!1);return}let t=()=>u(e.scrollWidth-e.clientWidth-e.scrollLeft>1),n=new ResizeObserver(t);n.observe(e);for(let t of e.children)n.observe(t);return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>{n.disconnect(),e.removeEventListener(`scroll`,t)}},[s,i,a,e.diffStat?.files]);let d=n?`${n.kind}#${n.number}`:null;return(0,J.useEffect)(()=>{!d||s||c.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[d,i.map(e=>`${e.kind}#${e.number}`).join(`,`),s]),(0,Y.jsxs)(`div`,{ref:c,"data-slot":`run-tabs`,"data-phone-bar":o||void 0,"data-overflow-end":l||void 0,className:r(`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-2 max-md:[&>a]:text-[13.5px]`,o?`mt-0`:`mt-3`),children:[(0,Y.jsx)(q,{to:`/tasks/${e.id}`,active:t===`session`,replace:o,children:`Session`}),(0,Y.jsx)(q,{to:`/tasks/${e.id}/changes`,active:t===`changes`,replace:o,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:o,children:`Commits`}),(0,Y.jsx)(q,{to:`/tasks/${e.id}/files`,active:t===`files`,replace:o,children:`Files`}),i.map(t=>(0,Y.jsx)(q,{to:tn(e.id,t),active:n!==null&&$(t,n),replace:o,children:(0,Y.jsx)(nn,{tab:t})},`${t.kind}-${t.number}`)),a.length>0?(0,Y.jsxs)(L,{children:[(0,Y.jsxs)(F,{"data-slot":`run-tabs-more`,"aria-label":`${a.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:[`+`,a.length]}),(0,Y.jsx)(I,{align:`end`,children:a.map(t=>(0,Y.jsx)(M,{asChild:!0,children:(0,Y.jsx)(R,{to:tn(e.id,t),replace:o,children:(0,Y.jsx)(nn,{tab:t})})},`${t.kind}-${t.number}`))})]}):null]})}function gn({run:e,tab:t=`session`,onMarkedUnread:n,desktopActivitySlot:i,mobileActivitySlot:a}){let o=re(e),s=V(e),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(!1),f=_n(e,n),p=vn(e),m=(0,J.useRef)(null),h=ee(),g=te(),_=Ft(e,{queuePosition:e.status===`queued`?Ke(h.data??[]).get(e.id):void 0}),v=ht(),y=lt(),b=v!==null&&!y?v:null,x=b!==null,{referenceProjectId:ne,repoBase:S,requests:ie}=Rt(e),ae=(0,J.useMemo)(()=>le(e,S),[e,S]),C=typeof t==`object`?t:null,{inline:oe,overflow:w}=en(ae,C),T=g.data?.capabilities?.preview===!0,se=un(e,T,!1),E=(0,Y.jsx)(xn,{run:e,actions:f,triggerRef:m,onRename:x?p.editor.begin:void 0,onOpenChooser:()=>d(!0),onToggleNotes:()=>l(e=>!e)}),ce=dn(e,s,y);return(0,Y.jsx)(pe,{projectId:ne,repoBase:S,requests:ie,children:(0,Y.jsxs)(`header`,{"data-slot":`run-header`,"data-sticky":t===`session`||void 0,className:r(`relative z-20 shrink-0 bg-background px-4 md:px-9 md:pt-7`,x?`pt-0`:`pt-[18px]`,t===`session`&&`border-b border-border`),children:[(0,Y.jsx)(pn,{run:e}),(0,Y.jsx)(Nt,{run:e}),(0,Y.jsxs)(`div`,{className:`w-full`,children:[(0,Y.jsx)(cn,{run:e}),b?(0,Y.jsxs)(vt,{slot:b,children:[(0,Y.jsx)(bn,{run:e,title:p,returnFocus:m,status:(0,Y.jsx)(mn,{run:e,statusLine:_,activityTrigger:a})}),un(e,T,!0),(0,Y.jsx)(cn,{run:e,compact:!0}),E]}):(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:sn(e.delegation)}),(0,Y.jsx)(yn,{run:e}),(0,Y.jsx)(ln,{isDesktop:y,desktopActivitySlot:i,attention:o,statusLine:_}),(0,Y.jsx)(fn,{archived:e.archived,className:`max-md:hidden`}),(0,Y.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[ce,(0,Y.jsx)(on,{tab:t}),se,(0,Y.jsx)(qt,{run:e}),E]})]}),(0,Y.jsx)(hn,{run:e,tab:t,activeItem:C,inlineItemTabs:oe,overflowItemTabs:w,phoneBar:x,isDesktop:y}),c?(0,Y.jsx)(wn,{runId:e.id,onClose:()=>l(!1)}):null,u?(0,Y.jsx)(Ht,{run:e,canResume:V(e).terminal,onResume:()=>f.terminal.mutate(),onClose:()=>d(!1)}):null]}),(0,Y.jsx)(Cn,{run:e,actions:f})]})})}function _n(e,t){let n=se(),r=Ue(),[i,o]=(0,J.useState)(null),s=()=>n.invalidateQueries({queryKey:u.runs.all}),c=e=>w(e.message,{tone:`danger`}),l=a(),f={isPending:l.isPending,mutate:()=>l.mutate({id:e.id,pinned:!e.pinned})},p=d();return{pin:f,markUnread:{isPending:p.isPending,mutate:()=>{t?.(),p.mutate(e.id,{onError:c})}},delete:b({mutationFn:()=>C(e.id),onSuccess:()=>{s(),r(`/`)},onError:c}),terminal:zt(e),confirming:i,setConfirming:o}}function vn(e){let t=f(e.id),n=z(e);return{title:n,editor:ut(n,e=>t.mutate({title:e},{onError:e=>w(e.message,{tone:`danger`})}))}}function yn({run:e}){let{title:t,editor:n}=vn(e);return n.editing?(0,Y.jsx)(tt,{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)(st,{className:`size-3.5`,"aria-hidden":`true`})})]})}function bn({run:e,title:{title:t,editor:n},returnFocus:r,status:i}){return(0,Y.jsxs)(Ie,{open:n.editing,onOpenChange:e=>{e||n.commit()},children:[(0,Y.jsx)(Pe,{asChild:!0,children:(0,Y.jsxs)(`div`,{"data-slot":`mobile-run-title`,className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Y.jsx)(`h1`,{className:`line-clamp-2 break-words text-[15px] leading-[18px] font-semibold text-foreground`,title:e.task,children:t}),i]})}),(0,Y.jsx)(Fe,{align:`start`,sideOffset:12,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),n.cancel()},onCloseAutoFocus:e=>{e.preventDefault(),r.current?.focus()},children:(0,Y.jsx)(tt,{editor:n,className:`text-[16px] font-semibold`})})]})}function xn({run:e,actions:t,triggerRef:n,onRename:r,onToggleNotes:i,onOpenChooser:a}){let o=V(e),s=K(e),c=lt(),l=Dt(e.id),[u,d]=(0,J.useState)(!1),p=f(e.id),m=(0,J.useId)(),h=Kt(e),g=(0,J.useRef)(!1);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(kt,{run:e,open:u,onOpenChange:d,onConfirm:()=>{l.mutate(!0),d(!1)}}),c?null:h.dialog,(0,Y.jsxs)(L,{children:[(0,Y.jsx)(F,{asChild:!0,children:(0,Y.jsx)(A,{ref:n,variant:`ghost`,size:`icon`,"aria-label":`Run actions`,children:(0,Y.jsx)(ye,{"aria-hidden":`true`})})}),(0,Y.jsxs)(I,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,onCloseAutoFocus:e=>{g.current&&(g.current=!1,e.preventDefault(),r?.())},children:[(0,Y.jsx)(j,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),r?(0,Y.jsxs)(M,{"data-action":`rename-task`,className:`min-h-11`,onSelect:()=>{g.current=!0},children:[(0,Y.jsx)(st,{"aria-hidden":`true`}),` Rename`]}):null,!c&&o.archive&&!e.archiveBlocker?(0,Y.jsx)(M,{disabled:l.isPending,onSelect:()=>e.archived?l.mutate(!1):d(!0),children:Ot(e)}):null,(0,Y.jsxs)(M,{onSelect:i,children:[(0,Y.jsx)(yt,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,Y.jsx)(Ht,{run:e,canResume:o.terminal,onResume:()=>t.terminal.mutate(),onOpen:a}),s?(0,Y.jsxs)(M,{onSelect:()=>void X(s,`Command copied to clipboard.`),children:[(0,Y.jsx)(O,{"aria-hidden":`true`}),` Copy resume command`]}):null,o.markUnread?(0,Y.jsxs)(M,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,Y.jsx)(wt,{"aria-hidden":`true`}),` Mark unread`]}):null,o.pin?(0,Y.jsxs)(P,{"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)(Et,{"aria-hidden":`true`}):(0,Y.jsx)(be,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,c?null:(0,Y.jsx)(Jt,{handoff:h}),(0,Y.jsx)(N,{}),(0,Y.jsx)(j,{className:`text-xs text-muted-foreground`,children:`AFTER DONE`}),(0,Y.jsx)(P,{"data-slot":`archive-when-done`,className:`min-h-11`,checked:e.archiveWhenDone===!0,disabled:p.isPending,onCheckedChange:e=>p.mutate({archiveWhenDone:e},{onError:e=>w(e.message,{tone:`danger`})}),children:`Archive when Done`}),(0,Y.jsx)(P,{"data-slot":`auto-merge-pr`,className:`min-h-11`,checked:e.autoMergePr===!0,disabled:p.isPending,"aria-describedby":m,onCheckedChange:e=>p.mutate({autoMergePr:e},{onError:e=>w(e.message,{tone:`danger`})}),children:`Auto-merge PR`}),(0,Y.jsx)(`p`,{id:m,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)(Sn,{run:e,patch:p}),o.deleteRun?(0,Y.jsx)(N,{}):null,o.deleteRun?(0,Y.jsxs)(M,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,Y.jsx)(we,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})]})}function Sn({run:e,patch:t}){let n=(0,J.useId)(),r=(0,J.useId)(),i=(0,J.useId)(),a=e=>w(e.message,{tone:`danger`});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(N,{}),(0,Y.jsx)(j,{className:`text-xs text-muted-foreground`,children:`TASK ACCESS`}),(0,Y.jsx)(P,{"data-slot":`allow-workers`,className:`min-h-11`,checked:ae(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)(P,{"data-slot":`allow-messaging`,className:`min-h-11`,checked:oe(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 Cn({run:e,actions:t}){let n=t.confirming;return(0,Y.jsx)(_t,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,Y.jsxs)(ot,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Y.jsxs)(gt,{children:[(0,Y.jsx)(rt,{className:`text-danger`,children:`Delete task permanently?`}),(0,Y.jsx)(nt,{children:(0,Y.jsxs)(Y.Fragment,{children:[`Delete “`,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,title:z(e),children:z(e)}),`” and its transcript`,e.delegation?.role===`worker`&&!ie(e.delegation.workspace)?``:`, worktree and branch`,`. This cannot be undone.`]})})]}),(0,Y.jsxs)(dt,{children:[(0,Y.jsx)(mt,{children:`Cancel`}),(0,Y.jsx)(ct,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{t.delete.mutate(),t.setConfirming(null)},children:`Delete task`})]})]})})}function wn({runId:e,onClose:t}){let n=_(e);return(0,Y.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 flex max-h-[min(45dvh,420px)] flex-col overflow-hidden rounded-xl border border-border bg-card p-6`,children:[(0,Y.jsxs)(`div`,{className:`mb-4 flex shrink-0 items-center justify-between gap-3`,children:[(0,Y.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,Y.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,Y.jsx)(Ce,{})})]}),(0,Y.jsx)(`div`,{"data-slot":`notes-panel-body`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children: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)(St,{runId:e,children:(0,Y.jsx)(xt,{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 shrink-0 gap-3`,children:[(0,Y.jsx)(A,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void X(n.data??``,`Notes copied`),children:`Copy notes`}),(0,Y.jsx)(A,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{zt as a,Vt as i,Ut as n,Rt as o,Wt as r,Ft as s,gn as t};
@@ -1 +0,0 @@
1
- import{Ft as e}from"./queries-CchoEEzj.js";import{n as t}from"./project-location-B-O2lQQU.js";function n(){return{home:e().data?.homeDir??null,root:t()}}export{n as t};