@hearsay-tools/squawk 0.18.0-pr3927.7421 → 0.18.0-pr3927.7426

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 (56) hide show
  1. package/dist/contract/attention.d.ts +1 -1
  2. package/dist/contract/delegation.d.ts +6 -0
  3. package/dist/contract/index.js +7 -2
  4. package/dist/contract/waits.d.ts +2 -1
  5. package/dist/delegation/provision.js +8 -4
  6. package/dist/delegation/provision.js.map +1 -1
  7. package/dist/server/reports-api.d.ts +2 -2
  8. package/dist/server/server.d.ts +1562 -1562
  9. package/package.json +4 -4
  10. package/web/dist/assets/activity-motion-CQKAazEg.js +2 -0
  11. package/web/dist/assets/{activity-route-CG_suLmL.js → activity-route-C6oKznjI.js} +1 -1
  12. package/web/dist/assets/{agent-accounts-DaF-ybaB.js → agent-accounts-T6Q6vL9r.js} +1 -1
  13. package/web/dist/assets/attention-KYhxOgNq.js +1 -0
  14. package/web/dist/assets/{commit-diff-panel-DvSOi3Dk.js → commit-diff-panel-DUeb6EUF.js} +1 -1
  15. package/web/dist/assets/{diff-DhcQus9M.js → diff-DVALb2F0.js} +2 -2
  16. package/web/dist/assets/{diff-view-DiuMMFWa.js → diff-view-DxV_tLUt.js} +1 -1
  17. package/web/dist/assets/{file-preview-CZoDjpW4.js → file-preview-BFS1UwXr.js} +1 -1
  18. package/web/dist/assets/{git-toolbar-CA-ZwUuj.js → git-toolbar-C89FoROy.js} +1 -1
  19. package/web/dist/assets/{github-Dita6Kp5.js → github-B4Meld9S.js} +1 -1
  20. package/web/dist/assets/{global-activity-route-DksHUiPz.js → global-activity-route-CuU0bmKz.js} +1 -1
  21. package/web/dist/assets/{index-D59vfFuq.js → index-Cwfi9cG9.js} +9 -9
  22. package/web/dist/assets/{markdown-B66DXw4l.js → markdown-DuVt8jbQ.js} +1 -1
  23. package/web/dist/assets/{picker-pill-bwLTIbHM.js → picker-pill-CwbEYCjL.js} +1 -1
  24. package/web/dist/assets/{preview-pane-connected-B7-FZ5DE.js → preview-pane-connected-CSwZ6Xl5.js} +2 -2
  25. package/web/dist/assets/{project-router-ewovT3Kf.js → project-router-B73juPC3.js} +1 -1
  26. package/web/dist/assets/project-scope-context-B2P3zXB1.js +4 -0
  27. package/web/dist/assets/{prompt-template-menu-BJEe-Kv2.js → prompt-template-menu-nShN9uXQ.js} +1 -1
  28. package/web/dist/assets/queries-B6a1W2sa.js +1 -0
  29. package/web/dist/assets/{reference-chip-Tj9CYsE2.js → reference-chip-yXXzlbts.js} +1 -1
  30. package/web/dist/assets/{repo-git-C0MVr1i5.js → repo-git-CDOCx8X4.js} +1 -1
  31. package/web/dist/assets/{report-reader-BW21aq_k.js → report-reader-CgYcjz5W.js} +1 -1
  32. package/web/dist/assets/reports-nt1YPqOJ.js +1 -0
  33. package/web/dist/assets/run-header-DaqWXi5W.js +2 -0
  34. package/web/dist/assets/{skills-CZq8WNx7.js → skills-D45ND2YB.js} +1 -1
  35. package/web/dist/assets/{tab-link-D4l87fgz.js → tab-link-BwGcrAfg.js} +1 -1
  36. package/web/dist/assets/{task-changes-FumjZsw6.js → task-changes-NPbEK_pM.js} +1 -1
  37. package/web/dist/assets/{task-commits-75nPVeL3.js → task-commits-D_YFcFld.js} +1 -1
  38. package/web/dist/assets/{task-files-CdhoQGlN.js → task-files-eHbJ4ftX.js} +1 -1
  39. package/web/dist/assets/{task-github-item-1IbcFtr-.js → task-github-item-D0splQvy.js} +1 -1
  40. package/web/dist/assets/{task-thread-9Q-PLOFf.js → task-thread-B_pBPheb.js} +6 -6
  41. package/web/dist/assets/{thread-state-Bfb8orUP.js → thread-state-DFXgDkC_.js} +1 -1
  42. package/web/dist/assets/{use-desktop-DJrxV0gM.js → use-desktop-D3W91YLi.js} +1 -1
  43. package/web/dist/assets/{use-hand-to-agent-state-bZUXClR3.js → use-hand-to-agent-state-CVgHwx89.js} +1 -1
  44. package/web/dist/assets/{useInfiniteQuery-Bbi75-bb.js → useInfiniteQuery-B6Kx_mBY.js} +1 -1
  45. package/web/dist/assets/useQuery-D8aTqerT.js +1 -0
  46. package/web/dist/assets/{workflows-gbQKlO53.js → workflows-fidBxppB.js} +1 -1
  47. package/web/dist/assets/ws-Bb6iWQU5.js +1 -0
  48. package/web/dist/index.html +13 -13
  49. package/web/dist/assets/activity-motion-BjRSOxuh.js +0 -2
  50. package/web/dist/assets/attention-DtccMSEl.js +0 -1
  51. package/web/dist/assets/project-scope-context-CdJF4Chv.js +0 -4
  52. package/web/dist/assets/queries-DEhoSzZx.js +0 -1
  53. package/web/dist/assets/reports-DWXaed-t.js +0 -1
  54. package/web/dist/assets/run-header-LMdC07au.js +0 -2
  55. package/web/dist/assets/useQuery-is45BI1J.js +0 -1
  56. package/web/dist/assets/ws-BRHd49V3.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{C as r,M as i,T as a,t as o}from"./button-RJMdCnZw.js";import{Er as s,Nt as c,Or as l,Xr as u,_r as d,f,gn as p}from"./project-scope-context-CdJF4Chv.js";import{A as m,G as h,I as g,K as _,L as v,M as y,N as b,V as x}from"./live-protocol-CjfZMf1X.js";import{t as S}from"./useInfiniteQuery-Bbi75-bb.js";import{n as C,t as w}from"./ws-BRHd49V3.js";import{t as T}from"./project-router-ewovT3Kf.js";import{$t as E,C as D,jt as O}from"./index-D59vfFuq.js";import{t as k}from"./report-title-D4Mbu2Er.js";var A=e(t(),1),j=1e3,M=x().min(1).max(1024);v({q:x().max(j).optional(),before:M.optional(),limit:x().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()}).strict();var N=v({reports:m(v({id:h(),runId:h(),name:x(),title:x(),createdAt:_(),size:g().int().nonnegative(),taskTitle:x(),taskStatus:d}).strict()),nextCursor:M.nullable(),total:g().int().nonnegative()}).strict(),P=v({epoch:h(),generation:g().int().nonnegative(),metadataGeneration:g().int().nonnegative()}).strict(),F=v({runId:h(),taskTitle:x(),taskStatus:d}).strict(),I=y(`type`,[P.extend({type:b(`snapshot`)}),P.extend({type:b(`content`)}),P.extend({type:b(`metadata`),runs:m(F)})]),L=new WeakMap;function R(e,t){if(!e)return{content:t.type===`content`,metadata:t.type===`metadata`,reset:!1};if(e.epoch!==t.epoch)return{content:!0,metadata:!0,reset:!0};if(!(t.generation<e.generation||t.metadataGeneration<e.metadataGeneration)&&!(e.generation===t.generation&&e.metadataGeneration===t.metadataGeneration))return{content:t.generation!==e.generation,metadata:t.metadataGeneration!==e.metadataGeneration,reset:!1}}var z=class{client;project;state;content=0;metadata=0;patches=new Map;trailing=new Set;flights=new Map;constructor(e,t){this.client=e,this.project=t,e.getQueryCache().subscribe(n=>{if(n.type===`removed`){this.trailing.delete(n.query),this.flights.delete(n.query);return}if(!(n.query.queryKey[0]!==t||n.query.queryKey[1]!==`reports`)){if(n.type===`updated`&&n.action.type===`fetch`&&this.flights.set(n.query,this.metadata),n.query.state.fetchStatus===`idle`&&this.flights.has(n.query)){let e=this.flights.get(n.query);this.flights.delete(n.query),e!==this.metadata&&String(n.query.queryKey[2]??``).trim()===``&&this.client.setQueryData(n.query.queryKey,t=>t&&{...t,pages:t.pages.map(t=>this.patch(t,e))})}!this.trailing.has(n.query)||n.query.state.fetchStatus!==`idle`||(this.trailing.delete(n.query),queueMicrotask(()=>{e.invalidateQueries({queryKey:n.query.queryKey,exact:!0,refetchType:`active`},{cancelRefetch:!1})}))}})}patch(e,t=-1){return{...e,reports:e.reports.map(e=>{let n=this.patches.get(e.runId);return n&&n.version>t?{...e,taskTitle:n.value.taskTitle,taskStatus:n.value.taskStatus}:e})}}async read(e,t){for(;;){let n=this.content,r=this.metadata,i=await t();if(!(n!==this.content||e.trim()!==``&&r!==this.metadata))return e.trim()===``?this.patch(i,r):i}}receive(e,t=!1){let n=this.state;if(!n&&e.type===`snapshot`){this.state=e,this.content++,this.client.getQueryCache().findAll({queryKey:[this.project,`reports`]}).some(e=>e.state.data!==void 0)&&this.invalidate(!0);return}let r=R(n,e);if(!r){t&&e.type===`snapshot`&&(this.content++,this.invalidate(!0));return}let{metadata:i,reset:a}=r,o=r.content||t&&e.type===`snapshot`;this.state=e,a&&this.patches.clear(),i&&this.metadata++,o&&this.content++,e.type===`metadata`&&!a&&this.patchCaches(e);let s=o||i&&e.type!==`metadata`;(s||i)&&this.invalidate(s)}patchCaches(e){for(let t of e.runs)this.patches.set(t.runId,{value:t,version:this.metadata});this.client.setQueriesData({queryKey:[this.project,`reports`],predicate:e=>String(e.queryKey[2]??``).trim()===``},e=>e&&{...e,pages:e.pages.map(e=>this.patch(e,this.metadata-1))})}invalidate(e){let t={queryKey:[this.project,`reports`],refetchType:`active`,...e?{}:{predicate:e=>String(e.queryKey[2]??``).trim()!==``}};for(let e of this.client.getQueryCache().findAll(t))e.state.fetchStatus===`fetching`&&this.trailing.add(e);this.client.invalidateQueries(t,{cancelRefetch:!1})}};function B(e,t){let n=L.get(e);n||(n=new Map,L.set(e,n));let r=n.get(t);return r||(r=new z(e,t),n.set(t,r)),r}async function V(e,t){let n=await f.api.v1.p[`:projectId`].reports.state.$get({param:{projectId:e}},c({signal:t}));return P.parse(await p(n,`/reports/state`))}function H(e){let t=B(u(),e);return(0,A.useEffect)(()=>{let n=w(`reports:project:${e}`,e=>{let n=I.safeParse(e);n.success&&t.receive(n.data,n.data.type===`snapshot`)}),r,i,a=()=>{if(s()===`finite`&&!r){i=new AbortController;let n=i.signal;V(e,n).then(e=>{n.aborted||t.receive({type:`snapshot`,...e})}).catch(()=>void 0),r=C({path:`/api/v1/p/${encodeURIComponent(e)}/reports/state`,intervalMs:5e3},(e,n)=>{let r=P.safeParse(e);!n&&r.success&&t.receive({type:`snapshot`,...r.data})})}else s()!==`finite`&&(i?.abort(),r?.(),r=void 0)};a();let o=l(a);return()=>{o(),i?.abort(),r?.(),n()}},[t,e]),t}async function U(e,t,n,r){let i=await f.api.v1.p[`:projectId`].reports.$get({param:{projectId:e},query:{q:t.slice(0,j),...n?{before:n}:{}}},c(r?{signal:r}:void 0));return N.parse(await p(i,`/reports`))}function W(e){let t=i(),n=H(t);return S({queryKey:[t,`reports`,e],initialPageParam:void 0,queryFn:({pageParam:r,signal:i})=>n.read(e,()=>U(t,e,r,i)),getNextPageParam:e=>e.nextCursor??void 0,staleTime:0,refetchOnWindowFocus:!0})}var G=n(),K=new Map;function q(){let e=r(),t=a(),[n,i]=D(),s=(n.get(`q`)??``).slice(0,j),c=W(s),l=(0,A.useRef)(null),u=(0,A.useRef)(``),d=e.pathname+e.search,f=c.data?.pages.flatMap(e=>e.reports)??[];(0,A.useLayoutEffect)(()=>{if(!c.data||u.current===d)return;let n=K.get(d),r=e.state?.filesRestoreKey===d;if(!n||!l.current||t!==`POP`&&!r){u.current=d;return}let i=l.current.querySelector(`[data-report-id="${n.row}"]`);if(c.isFetchNextPageError){u.current=d,l.current.scrollTop=0;return}if((!i||c.data.pages.length<n.pages)&&c.hasNextPage){c.isFetchingNextPage||c.fetchNextPage();return}u.current=d,l.current.scrollTop=i?n.scroll:0,i?.focus({preventScroll:!0})},[d,c.data,c.hasNextPage,c.isFetchingNextPage,c.isFetchNextPageError,c.fetchNextPage,e.state,t]);let p=t=>i(n=>(t?n.set(`q`,t.slice(0,j)):n.delete(`q`),K.delete(e.pathname+`?`+n.toString()),n));return(0,G.jsxs)(`section`,{"data-route":`reports`,className:`flex h-full min-h-0 flex-col`,children:[(0,G.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b border-border p-4`,children:[(0,G.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Reports`}),(0,G.jsx)(E,{maxLength:j,"aria-label":`Search reports`,placeholder:`Search reports or source tasks`,value:s,onChange:e=>p(e.target.value),className:`min-h-11`})]}),(0,G.jsxs)(`div`,{ref:l,"data-slot":`reports-list`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4 [scrollbar-gutter:stable]`,children:[c.isPending?(0,G.jsx)(`p`,{role:`status`,children:`Loading reports…`}):c.isError?(0,G.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-3`,children:[(0,G.jsx)(`p`,{children:`Could not load reports`}),(0,G.jsx)(`p`,{className:`text-sm text-soft-foreground`,children:c.error.message}),(0,G.jsx)(o,{className:`min-h-11`,onClick:()=>void c.refetch(),children:`Retry`})]}):f.length===0?(0,G.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[(0,G.jsx)(`h2`,{className:`font-medium`,children:s?`No matching reports`:`No published reports yet`}),s?(0,G.jsx)(o,{"data-slot":`reports-clear-search`,variant:`outline`,className:`min-h-11`,onClick:()=>p(``),children:`Clear search`}):(0,G.jsxs)(`p`,{className:`text-sm text-soft-foreground`,children:[`Publish an HTML snapshot with `,(0,G.jsxs)(`code`,{children:[O(),` artifact publish`]}),` to list it here.`]})]}):(0,G.jsx)(`ul`,{className:`flex flex-col gap-3`,children:f.map(e=>(0,G.jsxs)(`li`,{"data-slot":`report-row`,className:`reports-row rounded-lg border border-border bg-card p-3`,children:[(0,G.jsx)(`h2`,{className:`min-w-0 font-medium [overflow-wrap:anywhere]`,children:(0,G.jsx)(T,{"data-report-id":e.id,className:`reports-open`,to:`/tasks/${e.runId}/report?artifact=${e.id}`,state:{readerFrom:d,filesRestoreKey:d},onClick:()=>K.set(d,{scroll:l.current?.scrollTop??0,row:e.id,pages:c.data?.pages.length??1}),children:k(e)})}),(0,G.jsx)(T,{className:`reports-task text-sm text-accent-text underline [overflow-wrap:anywhere]`,to:`/tasks/${e.runId}`,children:e.taskTitle}),(0,G.jsx)(`time`,{className:`block text-xs text-soft-foreground`,dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleString()})]},e.id))}),c.hasNextPage?(0,G.jsx)(o,{variant:`outline`,className:`min-h-11`,disabled:c.isFetchingNextPage,onClick:()=>void c.fetchNextPage(),children:`Load more reports`}):null]})]})}export{q as ReportsRoute};
@@ -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{E as r,S as i,d as a,t as o,u as s}from"./button-RJMdCnZw.js";import{Bt as c,Cr as l,Fn as u,Hn as d,Kn as f,Pn as p,Un as m,Xr as h,Yn as g,cr as _,i as v,jn as ee,k as te,o as y,qn as b,zt as ne}from"./project-scope-context-CdJF4Chv.js";import{$ as x,B as S,I as C,Jt as re,Kt as w,L as T,N as ie,R as E,St as ae,W as oe,X as se,Y as ce,Yt as D,b as le,ft as ue,n as de,qt as fe,vt as pe,yt as O,z as k}from"./queries-DEhoSzZx.js";import{J as me,L as he,S as ge,_ as _e,a as ve,b as ye,d as be,f as xe,n as Se,o as Ce,p as we,r as Te,v as Ee,y as De,z as A}from"./use-desktop-DJrxV0gM.js";import{n as j}from"./toaster-BWMQArHJ.js";import{A as Oe,F as ke,a as Ae,at as je,f as Me,ft as Ne,g as Pe,h as Fe,i as Ie,l as Le,m as Re,p as ze,q as Be,t as Ve,v as M,x as He}from"./design-icons-B6-0w7Aw.js";import{t as N}from"./createLucideIcon-BHp8sXmF.js";import{t as Ue}from"./app-window-CSHwDX9N.js";import{t as We}from"./info-DA1x_4bz.js";import{a as Ge,t as Ke}from"./format-BNCkW110.js";import{t as qe}from"./message-square-B-MD-8rD.js";import{i as Je,n as Ye,t as P}from"./reference-chip-Tj9CYsE2.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-Cr9RsmWG.js";import{a as Xe,i as Ze,o as Qe,r as $e,s as et,t as tt}from"./dialog-7Mg2IZCP.js";import{c as nt,s as rt,t as H}from"./project-router-ewovT3Kf.js";import"./attention-DtccMSEl.js";import{Ct as it,Dt as U,Ht as at,M as W,N as ot,Ot as G,Qt as st,Ut as ct,V as lt,Vt as ut,Xt as dt,Yt as ft,Zt as pt,_ as mt,a as ht,ct as gt,dt as _t,ft as vt,gt as yt,ht as bt,in as xt,j as St,lt as Ct,mt as wt,o as Tt,pt as Et,r as Dt,rn as Ot,st as kt,t as At,tn as jt,un as Mt,ut as Nt,vt as Pt,yn as Ft,yt as It}from"./index-D59vfFuq.js";import{r as Lt,t as Rt}from"./markdown-B66DXw4l.js";import{t as K}from"./tab-link-D4l87fgz.js";var zt=N(`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`}]]),Bt=N(`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`}]]),Vt=N(`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`}]]),q=e(t(),1),J=n();function Ht(e){let t=w();return D({mutationFn:t=>y(re(e),t),onSuccess:()=>t.invalidateAfter(`runs`,()=>fe()),onError:e=>j(e.message,{tone:`danger`})})}function Ut(e){return e.archived?`Unarchive`:`Archive task`}function Wt({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,J.jsx)(kt,{open:t,onOpenChange:n,children:(0,J.jsxs)(Nt,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,J.jsxs)(Et,{children:[(0,J.jsx)(wt,{children:`Archive task?`}),(0,J.jsxs)(_t,{children:[`Move “`,(0,J.jsx)(`span`,{className:`font-medium text-foreground`,title:A(e),children:A(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,J.jsxs)(vt,{children:[(0,J.jsx)(Ct,{children:`Cancel`}),(0,J.jsx)(gt,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function Y({run:e,className:t,compactOnMobile:n=!1}){let[r,i]=(0,q.useState)(!1),a=Ht(e.id),c=Ut(e);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(o,{type:`button`,variant:`outline`,"data-slot":`archive-action`,"aria-label":c,title:e.archived?`Put this task back in Active tasks`:`Move this task out of Active tasks`,disabled:a.isPending,className:s(`h-11 gap-[7px] px-3`,n&&`max-md:size-11 max-md:px-0`,t),onClick:()=>e.archived?a.mutate(!1):i(!0),children:[e.archived?(0,J.jsx)(Ft,{"aria-hidden":`true`}):(0,J.jsx)(Ve,{"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:s(n&&`max-md:sr-only`),children:c})]}),(0,J.jsx)(Wt,{run:e,open:r,onOpenChange:i,onConfirm:()=>{a.mutate(!0),i(!1)}})]})}function Gt({run:e,action:t,prUrl:n,patch:r}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,J.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,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n&&a(n)?(0,J.jsx)(o,{variant:`outline`,asChild:!0,children:(0,J.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:`Open PR`})}):null,e.autoMergePr?(0,J.jsx)(o,{variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({autoMergePr:!1},{onError:e=>j(e.message,{tone:`danger`})}),children:r.isPending?`Saving…`:`Disable auto-merge`}):null]})]})}function Kt({run:e,blocker:t,flags:n}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Archive blocked`}),` · `,t.message]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.runId?(0,J.jsx)(o,{variant:`outline`,asChild:!0,children:(0,J.jsx)(H,{to:`/tasks/${t.runId}`,children:`Open blocking task`})}):null,t.pullRequestUrl&&a(t.pullRequestUrl)?(0,J.jsx)(o,{variant:`outline`,asChild:!0,children:(0,J.jsx)(`a`,{href:t.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,children:`Open blocking PR`})}):null,n.archive?(0,J.jsx)(Y,{run:e}):null]})]})}function qt({run:e}){let t=k(e.id),n=G(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,J.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,J.jsx)(Gt,{run:e,action:a,prUrl:o,patch:t}):null,i?(0,J.jsx)(Kt,{run:e,blocker:i,flags:n}):null]})}var Jt=[`running`,`queued`,`waiting`];function Yt(e,{queuePosition:t,now:n=new Date}){let r=ee(e),i=r.label.charAt(0).toUpperCase()+r.label.slice(1),a=t===void 0?i:`${i} #${t}`,o=Jt.includes(e.status)?Zt(e,n):void 0;return o?{attention:r,label:a,nextCheck:o}:{attention:r,label:a}}function Xt(e){return e.nextCheck?`${e.label} · Next check ${e.nextCheck.text}`:e.label}function Zt(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:Ke(n,t)}}async function X(e,t){try{await navigator.clipboard.writeText(e),j(t)}catch{j(`Run manually: ${e}`)}}function Qt(e){let t=oe(),n=x(),r=(0,q.useMemo)(()=>ge(e,t),[e,t]);return{referenceProjectId:n,repoBase:t,references:r,requests:(0,q.useMemo)(()=>n===void 0?[]:r.filter(e=>be(e,t)).map(e=>({projectId:n,kind:e.kind,number:e.number})),[r,n,t])}}function $t(e){return D({mutationFn:()=>c(e.id),onError:e=>{if(e instanceof v&&e.command){X(e.command,`No terminal found — command copied to clipboard.`);return}j(e.message,{tone:`danger`})}})}function Z(e,t){let n=E(),r=se(),i=D({mutationFn:t=>ne(e.id,t),onError:e=>j(e.message,{tone:`danger`})}),a=l(r.data),o=e=>!r.isSuccess||a.includes(e??`claude`);return{canResumeHere:t&&o(it(e)),choices:e.worktreePath?(n.data?.targets??[]).filter(e=>{let t=pt(e.id);return t===void 0||o(t)}).map(t=>({target:t,...It(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[],open:i}}function en({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Z(e,t),s=U(e);return!r&&i.length===0&&!s?null:(0,J.jsxs)(J.Fragment,{children:[r||i.length>0?(0,J.jsxs)(`div`,{className:`task-open-targets flex flex-wrap gap-3`,children:[r?(0,J.jsxs)(o,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,J.jsx)(jt,{}),`Terminal (resume session)`]}):null,i.map(({target:e,suffix:t,title:n})=>{let r=st(e);return(0,J.jsxs)(o,{variant:`outline`,"data-target":e.id,title:n,disabled:a.isPending,onClick:()=>a.mutate(e.id),children:[(0,J.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,J.jsxs)(o,{variant:`outline`,onClick:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>j(`Worktree path copied`)).catch(()=>j(`Path: ${t}`))},children:[(0,J.jsx)(M,{}),`Copy worktree path`]}):null]}):null,s?(0,J.jsxs)(`div`,{"data-slot":`resume-command`,className:`mt-5 border-t border-border pt-5`,children:[(0,J.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,J.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:s}),(0,J.jsxs)(o,{variant:`outline`,onClick:()=>void X(s,`Command copied to clipboard.`),children:[(0,J.jsx)(M,{}),`Copy resume command`]})]}):null]})}function tn({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Z(e,t),s=U(e),c=e.worktreePath;if(!r&&i.length===0&&!s&&!c)return null;let l=`max-md:min-h-11`;return(0,J.jsxs)(`div`,{"data-slot":`workspace-tools`,className:`flex min-w-0 flex-wrap gap-2`,children:[r||i.length>0?(0,J.jsx)(dt,{choices:i,onPick:e=>a.mutate(e),disabled:a.isPending,triggerVariant:`outline`,className:l,leading:r?(0,J.jsxs)(I,{"data-target":`terminal-resume`,onSelect:n,children:[(0,J.jsx)(jt,{"aria-hidden":`true`}),`Terminal (resume session)`]}):void 0}):null,c?(0,J.jsxs)(o,{variant:`outline`,size:`sm`,className:l,onClick:()=>void X(c,`Worktree path copied`),children:[(0,J.jsx)(M,{"aria-hidden":`true`}),`Copy worktree path`]}):null,s?(0,J.jsxs)(o,{variant:`outline`,size:`sm`,"data-slot":`resume-command`,title:s,className:l,onClick:()=>void X(s,`Command copied to clipboard.`),children:[(0,J.jsx)(M,{"aria-hidden":`true`}),`Copy resume command`]}):null]})}function nn({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let{canResumeHere:a,choices:s}=Z(e,t);return!a&&s.length===0?null:r?(0,J.jsx)(I,{onSelect:r,children:`Open in…`}):(0,J.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,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,J.jsx)(o,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,J.jsx)(Ne,{})})]}),e.worktreePath?(0,J.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,J.jsx)(`div`,{className:`mt-4`,children:(0,J.jsx)(en,{run:e,canResume:t,onResume:n})})]})}function rn({branch:e}){let[t,n]=(0,q.useState)(null),r=(0,q.useRef)(null);(0,q.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{j(`Could not copy branch. Select and copy: ${e}`)}};return(0,J.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,children:[(0,J.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,J.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,J.jsx)(M,{className:`size-3.5`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function an({run:e}){let t=oe(),n=x(),r=r=>n===void 0?void 0:Ee(n,e.id,r,t),i=(0,q.useMemo)(()=>ge(e,t),[e,t]),o=[],s=[],c=i.filter(e=>e.kind===`PR`);for(let t of c)o.push((0,J.jsx)(P,{reference:t,to:r(t),taskTitle:A(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,J.jsx)(yt,{run:e,prNumber:t.number})},we(t)));let l=ye(e);l&&a(l)&&!c.some(e=>e.url===l)&&o.push((0,J.jsx)(P,{reference:{kind:`PR`,url:l},taskTitle:A(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`pr`));let u=i.filter(e=>e.kind===`Issue`);for(let t of u)s.push((0,J.jsx)(P,{reference:t,to:r(t),taskTitle:A(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},we(t)));let d=_e(e,t);if(d&&a(d)&&!u.some(e=>e.url===d)){let t=xe(d);s.push((0,J.jsx)(P,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},to:t?r({kind:`Issue`,number:Number(t),url:d}):void 0,taskTitle:A(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`issue`))}return o.length===0&&s.length===0?null:(0,J.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,J.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,J.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,J.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:n})]},e):null)})}function on(){let e=rt(),t=ce();return St(t.data?.projects?.find(n=>n.id===(e??t.data?.bootProject)))}var sn=e=>e.map(e=>`${e.name}: ${W(e.url)}`).join(`
2
- `);function cn(e){return on().length>0||e.notify===!0}function ln({run:e}){let t=on(),n=t.length>0,r=T(e.id),[i,a]=(0,q.useState)(null),s=e.notify===!0;return!n&&!s?null:(0,J.jsxs)(J.Fragment,{children:[s?(0,J.jsxs)(V,{children:[(0,J.jsx)(z,{asChild:!0,children:(0,J.jsxs)(o,{variant:`outline`,size:`sm`,"data-slot":`notifying-chip`,className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":n?`Notifying ${ot(t)} — webhook actions`:`Notifying — webhook actions`,title:n?sn(t):void 0,children:[(0,J.jsx)(ft,{tone:`success`}),(0,J.jsx)(`span`,{children:`Notifying`}),(0,J.jsx)(Le,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,J.jsxs)(B,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[n?(0,J.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,J.jsx)(`span`,{"data-webhook-target":e.id,className:`truncate`,title:W(e.url),children:e.name},e.id))}):null,n?(0,J.jsxs)(I,{className:`min-h-11`,onSelect:()=>a(`note`),children:[(0,J.jsx)(qe,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,J.jsxs)(I,{variant:`destructive`,className:`min-h-11`,disabled:r.isPending,onSelect:()=>r.mutate({notify:!1},{onSuccess:()=>j(`Stopped notifying the webhook`),onError:e=>j(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),children:[(0,J.jsx)(zt,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,J.jsxs)(o,{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,J.jsx)(Ot,{"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`max-md:sr-only`,children:`Hand off`})]}),n?(0,J.jsx)(un,{mode:i,targets:t,pending:r.isPending,onOpenChange:e=>!e&&a(null),onSubmit:e=>r.mutate({notify:!0,...e?{message:e}:{}},{onSuccess:()=>{a(null),j(i===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>j(`Could not hand off. ${e.message}`,{tone:`danger`})})}):null]})}function un({mode:e,targets:t,pending:n,onOpenChange:r,onSubmit:i}){let a=(0,q.useId)(),s=(0,q.useId)(),[c,l]=(0,q.useState)(``);(0,q.useEffect)(()=>{e!==null&&l(``)},[e]);let u=e===`note`,d=ot(t);return(0,J.jsx)(tt,{open:e!==null,onOpenChange:e=>{e||l(``),r(e)},children:(0,J.jsx)($e,{"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,J.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),i(c.trim())},children:[(0,J.jsxs)(Qe,{className:`text-left`,children:[(0,J.jsx)(et,{children:u?`Send a note to ${t.length===1?`the webhook`:`the webhooks`}`:`Hand off to webhook`}),(0,J.jsx)(Ze,{children:(0,J.jsx)(`span`,{"data-webhook-destination":``,title:sn(t),children:u?`${d} ${t.length===1?`gets`:`get`} this note with the task's current status.`:`${d} will start receiving this task's status updates. Add a note (optional).`})})]}),(0,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,J.jsx)(`label`,{htmlFor:a,className:`text-[13px] font-medium`,children:`Note`}),(0,J.jsx)(lt,{id:a,"data-slot":`handoff-note`,"aria-describedby":s,rows:4,maxLength:1e5,className:`min-h-24`,placeholder:`e.g. Take over from here, ping me when the PR is green`,value:c,onChange:e=>l(e.target.value)}),(0,J.jsxs)(`p`,{id:s,className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[(0,J.jsx)(We,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,J.jsxs)(Xe,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:h-11 max-sm:[&>button]:w-full`,children:[(0,J.jsx)(o,{type:`button`,variant:`ghost`,className:`sm:h-9`,onClick:()=>r(!1),children:`Cancel`}),(0,J.jsxs)(o,{type:`submit`,variant:`contrast`,className:`sm:h-9`,"data-action":`handoff-submit`,disabled:n||u&&c.trim()===``,children:[(0,J.jsx)(Ot,{"aria-hidden":`true`}),u?`Send note`:`Hand off`]})]})]})})})}function dn({runId:e,children:t}){let n=i(),r=(0,q.useMemo)(()=>({runId:e}),[e]);return n?(0,J.jsx)(fn,{runId:e,children:t}):(0,J.jsx)(Lt.Provider,{value:r,children:t})}function fn({runId:e,children:t}){let{projectId:n}=r(),i=(0,q.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,J.jsx)(Lt.Provider,{value:i,children:t})}function pn(e,t,n,r){return n?r===`step`?`Step ${e} of ${t}`:`${e} of ${t} complete`:`${e} / ${t}`}function mn(e){return typeof e==`object`&&!!e&&!(0,q.isValidElement)(e)&&`keep`in e}function hn({slot:e,icon:t,title:n,meta:r,summary:i,aside:a,open:o,onToggle:c,className:l,children:u}){let d=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center text-accent-text`,children:t}),(0,J.jsx)(`span`,{className:s(`truncate text-[14px] font-semibold text-foreground`,typeof n==`string`?`shrink-0`:`min-w-0 shrink`),children:n}),i??(mn(r)?(0,J.jsxs)(`span`,{"data-slot":`run-activity-meta`,className:`contents text-[13px] text-muted-foreground tabular-nums`,children:[r.drop===void 0?null:(0,J.jsxs)(`span`,{className:`flex h-[1lh] min-w-0 shrink-[2] flex-wrap overflow-hidden`,children:[(0,J.jsx)(`span`,{"aria-hidden":!0,className:`h-[1lh] w-0`}),(0,J.jsxs)(`span`,{"data-slot":`run-activity-meta-drop`,className:`whitespace-nowrap`,children:[r.drop,(0,J.jsx)(`span`,{className:`text-soft-foreground`,children:` ·`})]})]}),` `,(0,J.jsx)(`span`,{"data-slot":`run-activity-meta-keep`,className:`shrink-0 whitespace-nowrap`,children:r.keep})]}):r===void 0?null:(0,J.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,J.jsxs)(`div`,{"data-slot":`run-activity-${e}`,"data-state":f&&o?`open`:`collapsed`,className:s(`min-w-0 border-t border-border first:border-t-0`,l),children:[f?(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":o,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,a,(0,J.jsx)(Le,{"aria-hidden":!0,className:s(`size-4 shrink-0 text-soft-foreground motion-safe:transition-transform motion-reduce:transition-none`,!a&&`ms-auto`,o&&`rotate-180`)})]}):(0,J.jsxs)(`div`,{className:`flex min-h-11 w-full min-w-0 items-center gap-2.5 px-3.5 py-2`,children:[d,a]}),f&&o?(0,J.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 Q(e){let t=e.delegation;return t?.role===`root`||t?.role===`worker`&&!!t.spawnGrant?.kinds.length}function gn(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 _n(e){let t=e.delegation,n=Q(e),r=O(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=gn(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 $(e){let t=O(e.id,{enabled:e.delegation?.role===`root`});return t.isSuccess&&t.data.workers.some(e=>me(e.status))}function vn({run:e,open:t,onToggle:n}){let r=O(e.id),i=ae(),a=Se(),c=e.delegation,l=new Map(r.data?.workers.map(e=>[e.workerId,e])),u=gn(c,r.data),d=f(e)??b(e),p=d?yn(e,d):void 0,m=e=>i.data?.find(t=>t.id===e)??r.data?.titles?.find(t=>t.id===e),h=e=>{let t=m(e);return t?A(t):`worker ${e.slice(0,8)}`};return(0,J.jsx)(hn,{slot:`workers`,icon:(0,J.jsx)(Oe,{className:`size-4`}),title:`Workers`,meta:bn({ids:u,workers:l,desktop:a,query:r}),aside:r.data?.capacity?(0,J.jsx)(Dn,{capacity:r.data.capacity}):void 0,open:t,onToggle:n,children:(0,J.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,J.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,d?(0,J.jsx)(wn,{wait:d,dependencyLabel:p}):null,u.length>0?(0,J.jsx)(`ul`,{className:`grid max-h-64 min-w-0 gap-0.5 overflow-y-auto`,children:u.map(t=>{let n=l.get(t),i=m(t),a=n?Sn(n.status):r.isSuccess?`Record unavailable or deleted`:`Status unavailable`;return(0,J.jsxs)(`li`,{"data-slot":`worker-item`,"data-status":n?.status,className:`min-w-0`,children:[(0,J.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,J.jsx)(xn,{status:n?.status}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`block truncate`,children:i?A(i):`Worker ${t.slice(0,8)}`}),n?.supervisorRunId&&n.supervisorRunId!==e.id?(0,J.jsxs)(`span`,{"data-slot":`worker-supervisor`,className:`block truncate text-xs text-muted-foreground`,children:[`Started by `,h(n.supervisorRunId)]}):null]}),(0,J.jsx)(`span`,{className:s(`max-w-[45%] shrink-0 truncate text-xs`,Cn(n?.status)),children:a}),(0,J.jsx)(Ae,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground`})]}),n?(0,J.jsx)(kn,{parentRunId:e.id,worker:n}):null,n?.destroy?(0,J.jsx)(jn,{state:n.destroy}):null]},t)})}):Q(e)&&r.isSuccess?(0,J.jsx)(`p`,{className:`px-1 py-1`,children:`No workers`}):null,r.fetchStatus===`paused`?(0,J.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Offline — relationship details will refresh when connected.`}):r.isPending?(0,J.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Loading relationships…`}):null,r.isError?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-1 py-1`,children:[(0,J.jsx)(`p`,{role:`status`,children:`Could not load relationships. Known task links are retained.`}),(0,J.jsx)(o,{variant:`outline`,className:`min-h-11`,onClick:()=>void r.refetch(),children:`Retry relationships`})]}):null]})})}function yn(e,t){let n=e.delegation;if(!(!n||n.role===`invalid`))return u(e)??p(n.role,t,`requestIds`in t&&g(n,t.requestIds))}function bn({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 xn({status:e}){let t=`size-[15px] shrink-0`;return e===`done`?(0,J.jsx)(Me,{"aria-hidden":!0,className:s(t,`text-success`)}):e===`failed`?(0,J.jsx)(Pe,{"aria-hidden":!0,className:s(t,`text-danger`)}):e===`cancelled`?(0,J.jsx)(Fe,{"aria-hidden":!0,className:s(t,`text-soft-foreground`)}):e===`running`||e===`waiting`||e===`review`?(0,J.jsx)(Ge,{role:`status`,"aria-label":`Worker running`,className:s(t,`animate-spin stroke-pending motion-reduce:animate-none`)}):(0,J.jsx)(Re,{"aria-hidden":!0,className:s(t,`text-soft-foreground`)})}function Sn(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Cn(e){return e===`done`?`text-success`:e===`failed`?`text-danger`:`text-muted-foreground`}function wn({wait:e,dependencyLabel:t}){return(0,J.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,J.jsxs)(J.Fragment,{children:[` `,`Deadline: `,(0,J.jsx)(`time`,{dateTime:e.deadline,children:e.deadline})]}):` No deadline: Squawk wakes this task when they have all settled.`]})}function Tn(e){return e.delegation?.role===`worker`&&b(e)?.phase===`wake-pending`}function En({run:e}){let t=b(e);return e.delegation?.role===`worker`&&t?.phase===`wake-pending`?(0,J.jsx)(wn,{wait:t,dependencyLabel:p(`worker`,t)}):null}function Dn({capacity:e}){return(0,J.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 On=new Set([`review`,`done`,`failed`,`cancelled`]);function kn({parentRunId:e,worker:t}){let n=le(e),[r,i]=(0,q.useState)(!1);if(!On.has(t.status)||t.destroy?.phase===`complete`&&t.destroy.remaining.length===0)return null;let a=t.workerId.slice(0,8),s=!!t.destroy&&t.destroy.phase!==`complete`;return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 px-1`,children:[r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`break-words text-xs`,children:_(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,J.jsx)(o,{variant:`danger-ghost`,size:`sm`,className:`min-h-11`,"aria-label":`Confirm clean up of worker ${a}`,onClick:()=>{i(!1),n.mutate(t.workerId)},children:`Clean up`}),(0,J.jsx)(o,{variant:`outline`,size:`sm`,className:`min-h-11`,onClick:()=>i(!1),children:`Cancel`})]}):(0,J.jsx)(o,{variant:`outline`,size:`sm`,className:`min-h-11`,"aria-label":s?`Retry clean up of worker ${a}`:`Clean up worker ${a}`,disabled:n.isPending,onClick:()=>i(!0),children:n.isPending?`Cleaning up…`:s?`Retry clean up`:`Clean up`}),n.isError&&!r?(0,J.jsxs)(`span`,{role:`status`,className:`break-words text-xs`,children:[`Cleanup did not finish: `,n.error.message]}):null]})}function An(e){return e!==void 0&&(e.phase!==`complete`||e.remaining.length>0||e.error!==void 0)}function jn({state:e}){if(!An(e))return null;let t=e.phase===`complete`?void 0:e.retry,n=t&&(0,J.jsx)(Mn,{at:t.nextAt});return(0,J.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,J.jsxs)(J.Fragment,{children:[`. Nothing changed after `,t.attempts,` automatic attempts; checking hourly, next check `,n,`. Retry clean up to try now.`]}):t?(0,J.jsxs)(J.Fragment,{children:[`. Retrying automatically, next attempt `,n,`.`]}):null]})}function Mn({at:e}){let t=bt(3e4);return(0,J.jsx)(`time`,{dateTime:e,title:new Date(e).toLocaleString(),children:At(t,Date.parse(e))})}function Nn({id:e}){return(0,J.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,J.jsx)(Ie,{"aria-hidden":!0,className:`shrink-0 [block-size:1.2cap] [inline-size:auto]`}),`Parent`]})}function Pn({id:e}){let t=ue(e),n=t.data?A(t.data):e;return(0,J.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,J.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,J.jsx)(Ie,{"aria-hidden":!0,className:`h-[1.2cap] w-auto shrink-0`}),(0,J.jsx)(`span`,{className:`shrink-0`,children:`Parent`}),(0,J.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,J.jsx)(`span`,{className:`min-w-0 overflow-clip text-ellipsis whitespace-nowrap`,children:n})]}),t.isError?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{children:`Parent record unavailable or deleted`}),(0,J.jsx)(o,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}var Fn=3,In=(e,t)=>e.kind===t.kind&&e.number===t.number;function Ln(e,t,n=Fn){let r=t?e.findIndex(e=>In(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 Rn=(e,t)=>`/tasks/${e}/${t.kind}/${t.number}`;function zn({tab:e}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(e.kind===`pr`?ke:ze,{"aria-hidden":`true`,className:`mr-1 size-3.5 shrink-0`}),(0,J.jsx)(`span`,{className:`sr-only`,children:e.kind===`pr`?`Pull request`:`Issue`}),` #`,e.number,(0,J.jsx)(Ye,{kind:e.kind===`pr`?`PR`:`Issue`,number:e.number,className:`ml-1`})]})}function Bn(e,t){let n=e[0],r=e.length+ +!!t;return n?`Preview :${n.port}${r>1?` +${r-1}`:``}`:t?`Preview · agent`:`Preview`}function Vn({servers:e}){let t=mt();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,J.jsxs)(o,{variant:`outline`,size:`sm`,"data-slot":`preview-toggle`,className:`max-md:h-11`,"aria-pressed":t.open,onClick:()=>t.openPane(i),children:[(0,J.jsx)(Ue,{"aria-hidden":`true`}),Bn(e,n),t.live?(0,J.jsx)(ft,{tone:`success`,"aria-label":`Preview is live`}):null]})}function Hn(e){return e?.role===`worker`?`Worker session`:e?.role===`root`?`Parent session`:`Task session`}function Un({run:e,compact:t=!1}){if(e.delegation?.role!==`worker`)return null;let n=e.delegation.supervisorRunId??e.delegation.parentRunId;return t?(0,J.jsx)(Nn,{id:n}):(0,J.jsx)(Pn,{id:n})}function Wn(e,t,n,r){return!e.archiveBlocker&&t.archive&&(n!==`session`||!Pt(e,r))?(0,J.jsx)(Y,{run:e}):null}function Gn({run:e}){return e.archived&&e.autoArchive?.reason===`pull-requests-merged`&&e.autoArchive.archivedAt===e.archivedAt?(0,J.jsx)(`p`,{"data-slot":`auto-archive-reason`,className:`text-[13px] text-muted-foreground`,children:`Archived automatically after all associated PRs merged.`}):null}function Kn({shown:e,run:t,archiveButton:n,previewToggle:r}){let i=cn(t);return e&&(n||r||i)?(0,J.jsxs)(`div`,{"data-slot":`run-mobile-actions`,className:`flex flex-wrap items-center gap-2 pt-2`,children:[n,r,(0,J.jsx)(ln,{run:t})]}):null}function qn({run:e,tab:t,activeItem:n,inlineItemTabs:r,overflowItemTabs:i,phoneBar:a,isDesktop:o}){let s=(0,q.useRef)(null),c=n?`${n.kind}#${n.number}`:null;return(0,q.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,J.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,J.jsx)(K,{to:`/tasks/${e.id}`,active:t===`session`,replace:a,children:`Session`}),(0,J.jsx)(K,{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,J.jsx)(K,{to:`/tasks/${e.id}/commits`,active:t===`commits`,replace:a,children:`Commits`}),(0,J.jsx)(K,{to:`/tasks/${e.id}/files`,active:t===`files`,replace:a,children:`Files`}),r.map(t=>(0,J.jsx)(K,{to:Rn(e.id,t),active:n!==null&&In(t,n),replace:a,children:(0,J.jsx)(zn,{tab:t})},`${t.kind}-${t.number}`)),i.length>0?(0,J.jsxs)(V,{children:[(0,J.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,J.jsx)(B,{align:`end`,children:i.map(t=>(0,J.jsx)(I,{asChild:!0,children:(0,J.jsx)(H,{to:Rn(e.id,t),replace:a,children:(0,J.jsx)(zn,{tab:t})})},`${t.kind}-${t.number}`))})]}):null]})}function Jn({run:e,tab:t=`session`,onMarkedUnread:n}){let r=ee(e),i=G(e),a=$(e),[o,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(!1),d=Yn(e,n),f=ae(),p=ie(),m=Yt(e,{queuePosition:e.status===`queued`?he(f.data??[]).get(e.id):void 0}),h=ct(),g=at(),_=h!==null&&!g?h:null,v=_!==null,{referenceProjectId:te,repoBase:y,requests:b}=Qt(e),ne=(0,q.useMemo)(()=>De(e,y),[e,y]),x=typeof t==`object`?t:null,{inline:S,overflow:C}=Ln(ne,x),re=p.data?.capabilities?.preview===!0,w=e.worktreePath&&re?(0,J.jsx)(Vn,{servers:e.previewServers??[]}):null,T=(0,J.jsx)($n,{run:e,actions:d,onOpenChooser:()=>u(!0),onToggleNotes:()=>c(e=>!e)}),E=Wn(e,i,t,a);return(0,J.jsx)(Je,{projectId:te,repoBase:y,requests:b,children:(0,J.jsxs)(`header`,{"data-slot":`run-header`,className:s(`relative z-20 bg-background px-[18px] md:px-9 md:pt-7`,v?`pt-0`:`pt-[18px]`,t===`session`&&`md:sticky md:top-0`),children:[(0,J.jsx)(Gn,{run:e}),(0,J.jsx)(qt,{run:e}),(0,J.jsxs)(`div`,{className:`w-full`,children:[(0,J.jsx)(Un,{run:e}),_?(0,J.jsxs)(ut,{slot:_,children:[(0,J.jsx)(Qn,{run:e}),(0,J.jsx)(Un,{run:e,compact:!0}),T]}):(0,J.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,J.jsx)(`p`,{"data-slot":`session-kind`,className:`text-[12px] font-semibold tracking-[0.14em] text-muted-foreground uppercase md:hidden`,children:Hn(e.delegation)}),(0,J.jsx)(Zn,{run:e}),(0,J.jsx)(Dt,{dot:r.tone,shape:r.shape,pulse:r.pulse,className:`max-md:hidden`,children:Xt(m)}),(0,J.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[E,w,(0,J.jsx)(ln,{run:e}),T]})]}),(0,J.jsx)(Kn,{shown:_!==null,run:e,archiveButton:E,previewToggle:w}),(0,J.jsx)(qn,{run:e,tab:t,activeItem:x,inlineItemTabs:S,overflowItemTabs:C,phoneBar:v,isDesktop:g}),o?(0,J.jsx)(nr,{runId:e.id,onClose:()=>c(!1)}):null,l?(0,J.jsx)(nn,{run:e,canResume:G(e).terminal,onResume:()=>d.terminal.mutate(),onClose:()=>u(!1)}):null]}),(0,J.jsx)(tr,{run:e,actions:d})]})})}function Yn(e,t){let n=h(),r=nt(),[i,a]=(0,q.useState)(null),o=()=>n.invalidateQueries({queryKey:de.runs.all}),s=e=>j(e.message,{tone:`danger`}),c=S(),l={isPending:c.isPending,mutate:()=>c.mutate({id:e.id,pinned:!e.pinned})},u=C();return{pin:l,markUnread:{isPending:u.isPending,mutate:()=>{t?.(),u.mutate(e.id,{onError:s})}},delete:D({mutationFn:()=>te(e.id),onSuccess:()=>{o(),r(`/`)},onError:s}),terminal:$t(e),confirming:i,setConfirming:a}}function Xn(e){let t=k(e.id),n=A(e);return{title:n,editor:Tt(n,e=>t.mutate({title:e},{onError:e=>j(e.message,{tone:`danger`})}))}}function Zn({run:e}){let{title:t,editor:n}=Xn(e);return n.editing?(0,J.jsx)(ht,{editor:n,className:`flex-1 text-[16px] font-semibold`}):(0,J.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,J.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:t}),(0,J.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,J.jsx)(xt,{className:`size-3.5`,"aria-hidden":`true`})})]})}function Qn({run:e}){let{title:t,editor:n}=Xn(e);return(0,J.jsxs)(Te,{open:n.editing,onOpenChange:e=>{e?n.begin():n.commit()},children:[(0,J.jsx)(`div`,{"data-slot":`mobile-run-title`,className:`flex min-w-0 flex-1 flex-col gap-px`,children:(0,J.jsx)(`h1`,{className:`truncate text-[15px] leading-tight font-semibold text-foreground`,title:e.task,children:t})}),(0,J.jsx)(Ce,{asChild:!0,children:(0,J.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,J.jsx)(xt,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,J.jsx)(ve,{align:`end`,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),n.cancel()},children:(0,J.jsx)(ht,{editor:n,className:`text-[16px] font-semibold`})})]})}function $n({run:e,actions:t,onToggleNotes:n,onOpenChooser:r}){let i=G(e),a=U(e),s=k(e.id),c=(0,q.useId)();return(0,J.jsxs)(V,{children:[(0,J.jsx)(z,{asChild:!0,children:(0,J.jsx)(o,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,J.jsx)(He,{"aria-hidden":`true`})})}),(0,J.jsxs)(B,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,J.jsx)(F,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),(0,J.jsxs)(I,{onSelect:n,children:[(0,J.jsx)(Mt,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,J.jsx)(nn,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),a?(0,J.jsxs)(I,{onSelect:()=>void X(a,`Command copied to clipboard.`),children:[(0,J.jsx)(M,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.markUnread?(0,J.jsxs)(I,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,J.jsx)(Bt,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,J.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,J.jsx)(Vt,{"aria-hidden":`true`}):(0,J.jsx)(Be,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,(0,J.jsx)(L,{}),(0,J.jsx)(F,{className:`text-xs text-muted-foreground`,children:`AFTER DONE`}),(0,J.jsx)(R,{"data-slot":`archive-when-done`,className:`min-h-11`,checked:e.archiveWhenDone===!0,disabled:s.isPending,onCheckedChange:e=>s.mutate({archiveWhenDone:e},{onError:e=>j(e.message,{tone:`danger`})}),children:`Archive when Done`}),(0,J.jsx)(R,{"data-slot":`auto-merge-pr`,className:`min-h-11`,checked:e.autoMergePr===!0,disabled:s.isPending,"aria-describedby":c,onCheckedChange:e=>s.mutate({autoMergePr:e},{onError:e=>j(e.message,{tone:`danger`})}),children:`Auto-merge PR`}),(0,J.jsx)(`p`,{id:c,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,J.jsx)(er,{run:e,patch:s}),i.deleteRun?(0,J.jsx)(L,{}):null,i.deleteRun?(0,J.jsxs)(I,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,J.jsx)(je,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})}function er({run:e,patch:t}){let n=(0,q.useId)(),r=(0,q.useId)(),i=(0,q.useId)(),a=e=>j(e.message,{tone:`danger`});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(L,{}),(0,J.jsx)(F,{className:`text-xs text-muted-foreground`,children:`TASK ACCESS`}),(0,J.jsx)(R,{"data-slot":`allow-workers`,className:`min-h-11`,checked:m(e),disabled:t.isPending,"aria-describedby":`${n} ${i}`,onCheckedChange:e=>t.mutate({allowWorkers:e},{onError:a}),children:`Allow Squawk workers`}),(0,J.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,J.jsx)(R,{"data-slot":`allow-messaging`,className:`min-h-11`,checked:d(e),disabled:t.isPending,"aria-describedby":`${r} ${i}`,onCheckedChange:e=>t.mutate({allowMessaging:e},{onError:a}),children:`Allow task messaging`}),(0,J.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,J.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 tr({run:e,actions:t}){let n=t.confirming;return(0,J.jsx)(kt,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,J.jsxs)(Nt,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,J.jsxs)(Et,{children:[(0,J.jsx)(wt,{className:`text-danger`,children:`Delete task permanently?`}),(0,J.jsx)(_t,{children:(0,J.jsxs)(J.Fragment,{children:[`Delete “`,(0,J.jsx)(`span`,{className:`font-medium text-foreground`,title:A(e),children:A(e)}),`” and its transcript`,e.delegation?.role===`worker`&&!_(e.delegation.workspace)?``:`, worktree and branch`,`. This cannot be undone.`]})})]}),(0,J.jsxs)(vt,{children:[(0,J.jsx)(Ct,{children:`Cancel`}),(0,J.jsx)(gt,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{t.delete.mutate(),t.setConfirming(null)},children:`Delete task`})]})]})})}function nr({runId:e,onClose:t}){let n=pe(e);return(0,J.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 rounded-xl border border-border bg-card p-6`,children:[(0,J.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,J.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,J.jsx)(o,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,J.jsx)(Ne,{})})]}),n.isPending?(0,J.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,J.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,J.jsx)(dn,{runId:e,children:(0,J.jsx)(Rt,{children:n.data})}):(0,J.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`}),(0,J.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,J.jsx)(o,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void X(n.data??``,`Notes copied`),children:`Copy notes`}),(0,J.jsx)(o,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{Qt as _,An as a,$ as c,pn as d,dn as f,$t as g,tn as h,En as i,_n as l,an as m,jn as n,Tn as o,rn as p,vn as r,Q as s,Jn as t,hn as u,Yt as v,Y as y};
@@ -1 +0,0 @@
1
- import{Br as e,Zr as t}from"./project-scope-context-CdJF4Chv.js";function n(n,r){return e(n,t,r)}export{n as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{Xr as n,jr as r}from"./project-scope-context-CdJF4Chv.js";import{i}from"./live-protocol-CjfZMf1X.js";var a=e(t(),1);function o(e,t){if(!i(e.path))throw Error(`unsupported shared read`);let n=new URL(e.path,`http://cezar.invalid`);return n.searchParams.sort(),r({kind:`read`,path:`${n.pathname}${n.search}`,intervalMs:e.intervalMs},{value:t})}function s(e,t,r,i){let s=n(),c=JSON.stringify(t),l=(0,a.useMemo)(()=>JSON.parse(c),[c]);(0,a.useEffect)(()=>{if(!e||r===!1)return;let t=!0,n=o({path:e,intervalMs:r},(e,n)=>{n||s.cancelQueries({queryKey:l,exact:!0}).then(()=>{t&&s.setQueryData(l,i?i(e,s):e)})});return()=>{t=!1,n()}},[s,e,l,r,i])}function c(e,t){return r({kind:`topic`,topic:e},{value:t})}export{o as n,s as r,c as t};