cezarion 0.19.0-dev.8714 → 0.19.0-dev.8724
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/web/dist/assets/accounts-section-DDKrIQHV.js +1 -0
- package/web/dist/assets/activity-motion-BTEsjlIe.js +1 -0
- package/web/dist/assets/{activity-route-DQ2vQVUG.js → activity-route-nAfZdSHs.js} +1 -1
- package/web/dist/assets/agent-config-section-SeeFuvxb.js +7 -0
- package/web/dist/assets/agent-defaults-section-BfBT817S.js +1 -0
- package/web/dist/assets/{appearance-CxkUoLLY.js → appearance-BTm4Q_SI.js} +1 -1
- package/web/dist/assets/automations-route-CBTOewMF.js +2 -0
- package/web/dist/assets/{change-counts-CW7O8g5Y.js → change-counts-npLATh-3.js} +1 -1
- package/web/dist/assets/{commit-list-Ca61W21s.js → commit-list-DkFgC3zM.js} +1 -1
- package/web/dist/assets/{diff-controls-_6OoQImc.js → diff-controls-Bg2hEd-d.js} +1 -1
- package/web/dist/assets/{diff-B5yQN9UD.js → diff-is16ZW0n.js} +2 -2
- package/web/dist/assets/{diff-stat-U7DT4Ilj.js → diff-stat-C7KB1kDX.js} +1 -1
- package/web/dist/assets/{diff-view-DFiA3y5a.js → diff-view-Cr8XQJSx.js} +1 -1
- package/web/dist/assets/{file-preview-v5_F5k3C.js → file-preview-Bnls5OJY.js} +1 -1
- package/web/dist/assets/folder-browser-6stmlyVQ.js +1 -0
- package/web/dist/assets/git-toolbar-CNKKRUHu.js +1 -0
- package/web/dist/assets/github-BqFTLhmt.js +1 -0
- package/web/dist/assets/global-activity-route-CWe04LvJ.js +2 -0
- package/web/dist/assets/{image-preview-2S3PEy8S.js → image-preview-DCUeM8u3.js} +1 -1
- package/web/dist/assets/index-CZ2f_VDZ.js +21 -0
- package/web/dist/assets/index-DefVZIaB.css +1 -0
- package/web/dist/assets/{markdown-nyVMLqM-.js → markdown-BlP4Ruj9.js} +1 -1
- package/web/dist/assets/nav-row-styles-D5HpOmDZ.js +1 -0
- package/web/dist/assets/{notifications-section-oiF-HLRZ.js → notifications-section-D74r_7fK.js} +1 -1
- package/web/dist/assets/{popover-BPgUYFyu.js → popover-CZV6tz9i.js} +1 -1
- package/web/dist/assets/preview-pane-connected-Bmczg9HP.js +3 -0
- package/web/dist/assets/projects-section-nCxUoesH.js +1 -0
- package/web/dist/assets/prompt-templates-section-BrLXH68w.js +1 -0
- package/web/dist/assets/reference-chip-D_AkXXCW.js +1 -0
- package/web/dist/assets/{remote-settings-notice-KN0zBmre.js → remote-settings-notice-DgXTd6s8.js} +1 -1
- package/web/dist/assets/repo-git-kl6QizKC.js +1 -0
- package/web/dist/assets/{report-reader-CeBbC_Jy.js → report-reader-CGmbDHza.js} +1 -1
- package/web/dist/assets/{reports-B-hz_AlB.js → reports-CTFaCJWS.js} +1 -1
- package/web/dist/assets/{resources-section-BywQtsIL.js → resources-section-BhRQQrVy.js} +1 -1
- package/web/dist/assets/review-panel-DJN1QoGx.js +11 -0
- package/web/dist/assets/run-header-CRtXOTxt.js +2 -0
- package/web/dist/assets/{run-header-Ccnr9k0X.css → run-header-DfEfupCk.css} +1 -1
- package/web/dist/assets/{select-ETUx1MVz.js → select-BfLaIiyd.js} +1 -1
- package/web/dist/assets/{session-context-section-2B1lqgAc.js → session-context-section-CaPupOFU.js} +2 -2
- package/web/dist/assets/settings-agent-picker-CzE4qiW7.js +1 -0
- package/web/dist/assets/settings-shell-AMRJAsgc.css +1 -0
- package/web/dist/assets/settings-shell-CpEw1Yep.js +1 -0
- package/web/dist/assets/{sidebar-section-Bamq8P_D.js → sidebar-section-Ct0x6SOQ.js} +1 -1
- package/web/dist/assets/{skills-BIhWfWYY.js → skills-D2HTiFIT.js} +1 -1
- package/web/dist/assets/{tab-link-DE6t7XkG.js → tab-link-BMblA2WK.js} +1 -1
- package/web/dist/assets/{task-changes-CBuihPwR.js → task-changes-4SjmpLQN.js} +1 -1
- package/web/dist/assets/{task-commits-BKHSmTUJ.js → task-commits-C6CoCyG9.js} +1 -1
- package/web/dist/assets/task-file-scope-BkUJ30q2.js +1 -0
- package/web/dist/assets/task-files-CCX3HTxx.js +1 -0
- package/web/dist/assets/{task-github-item-BhIl0YRe.js → task-github-item-DWLVVmvv.js} +1 -1
- package/web/dist/assets/task-thread-EBqjZ5Vz.js +2 -0
- package/web/dist/assets/task-thread-PDeU-fL6.css +1 -0
- package/web/dist/assets/{thread-state-C8v4gnTh.js → thread-state-DU6OEOIL.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-Ch0ok71s.css → use-hand-to-agent-state-BHaqyTxa.css} +1 -1
- package/web/dist/assets/use-hand-to-agent-state-DUkm37P-.js +1 -0
- package/web/dist/assets/workflows-CGHzfqLC.js +7 -0
- package/web/dist/assets/{workflows-DsE0ExV6.css → workflows-FH3RBKvk.css} +1 -1
- package/web/dist/assets/workspace-tools-9mkf36oR.js +1 -0
- package/web/dist/assets/{worktrees-section-w7yDtBtW.js → worktrees-section-B91kPX6V.js} +4 -4
- package/web/dist/assets/{zoomable-image-CIQl1Wpe.js → zoomable-image-6RTKhLGE.js} +1 -1
- package/web/dist/index.html +7 -7
- package/web/dist/assets/accounts-section-CQAZjNMH.js +0 -1
- package/web/dist/assets/activity-motion-Cjk0Ozs9.js +0 -1
- package/web/dist/assets/agent-config-section-6tcXGdqh.js +0 -7
- package/web/dist/assets/agent-defaults-section-DHdrzX19.js +0 -1
- package/web/dist/assets/automations-route-BFaRgLxq.js +0 -2
- package/web/dist/assets/folder-browser-CZiaPNK7.js +0 -1
- package/web/dist/assets/git-toolbar-C33icZYQ.js +0 -1
- package/web/dist/assets/github-DAftYTLP.js +0 -1
- package/web/dist/assets/global-activity-route-Dc0oqViK.js +0 -2
- package/web/dist/assets/index-1TLdjVro.css +0 -1
- package/web/dist/assets/index-7M_Uae0m.js +0 -21
- package/web/dist/assets/nav-row-styles-DKeXbc4N.js +0 -1
- package/web/dist/assets/preview-pane-connected-DgRQbaVm.js +0 -3
- package/web/dist/assets/projects-section-DtL1VsXT.js +0 -1
- package/web/dist/assets/prompt-templates-section-qK5TH9GX.js +0 -1
- package/web/dist/assets/reference-chip-bAUYx-Fl.js +0 -1
- package/web/dist/assets/repo-git-BY2jC4L2.js +0 -1
- package/web/dist/assets/review-panel-DV9yD5Zl.js +0 -8
- package/web/dist/assets/run-header-CZjnjsNk.js +0 -2
- package/web/dist/assets/settings-agent-picker-BdoxLNMP.js +0 -1
- package/web/dist/assets/settings-shell-BIhAcEF4.js +0 -1
- package/web/dist/assets/settings-shell-CqiAPuLq.css +0 -1
- package/web/dist/assets/task-files-CAPgay7C.js +0 -1
- package/web/dist/assets/task-thread-DwqQN87Q.js +0 -2
- package/web/dist/assets/task-thread-DzADOhZd.css +0 -1
- package/web/dist/assets/use-hand-to-agent-state-P0PYtQDy.js +0 -1
- package/web/dist/assets/workflows-Cp5n5AnS.js +0 -7
- package/web/dist/assets/workspace-tools-CsubVxbO.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{n as r,t as i}from"./utils-DSMR_WLb.js";import{Ct as a,G as o,H as s,K as c,St as l,U as u,W as d,Wt as f,Y as p,dn as m,f as h,ln as g,lt as _,rn as v,rt as ee,tt as y,un as te,xt as b,yt as ne}from"./queries-ClkIgWFx.js";import{An as re,Fn as x,It as ie,Lt as ae,cr as S,hi as C,n as w,or as oe,tt as se,ut as ce,yr as le}from"./toaster-C-xqAWVX.js";import{d as ue,h as de}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{a as fe,d as pe,f as me,g as he,m as ge,o as _e,p as ve,s as ye}from"./tasks-table-BkjZYg2J.js";import{F as be,at as xe,ft as Se,i as Ce,l as we,p as Te,q as Ee,t as De,v as T,x as Oe}from"./design-icons-CzEoMH9c.js";import{t as E}from"./createLucideIcon-BHp8sXmF.js";import{t as ke}from"./app-window-CSHwDX9N.js";import{n as Ae,r as je,t as Me}from"./open-in-menu-N8rXgYSG.js";import{t as Ne}from"./info-DA1x_4bz.js";import{t as Pe}from"./message-square-B-MD-8rD.js";import{i as Fe,n as Ie,t as D}from"./reference-chip-bAUYx-Fl.js";import{t as Le}from"./square-terminal-B6RYYieR.js";import{t as O}from"./button-B7MKxYjT.js";import{a as k,i as A,l as j,n as M,p as N,r as P,t as F}from"./dropdown-menu-4e2iKSMT.js";import{i as Re,r as ze,t as Be}from"./popover-BPgUYFyu.js";import{a as Ve,i as He,o as Ue,r as We,s as Ge,t as Ke}from"./dialog-B531GGAo.js";import{c as qe,s as Je,t as I}from"./project-router-CT6gVIcC.js";import"./attention--Y0CyzCN.js";import{T as Ye,f as L,u as Xe}from"./task-groups-aquji1Kv.js";import{t as R}from"./status-dot-BRzVlF2X.js";import{t as Ze}from"./format-BU7D3IfE.js";import{Bt as z,Fn as Qe,Gn as B,Gt as V,Ht as H,I as $e,Kn as U,Kt as W,L as G,Nn as et,Pn as tt,Qt as nt,R as rt,Ut as it,Vt as at,Wt as ot,Xn as st,a as ct,cn as K,en as lt,in as ut,ir as dt,ln as q,m as ft,o as pt,qt as mt,r as ht,vn as gt}from"./index-7M_Uae0m.js";import{r as _t,t as vt}from"./markdown-nyVMLqM-.js";import{t as yt}from"./textarea-vJt9undk.js";import{t as J}from"./tab-link-DE6t7XkG.js";var bt=E(`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`}]]),xt=E(`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`}]]),St=E(`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`}]]),Y=e(t(),1),X=n();function Ct(e){let t=_();return m({mutationFn:t=>se(te(e),t),onSuccess:()=>t.invalidateAfter(`runs`,()=>g()),onError:e=>w(e.message,{tone:`danger`})})}function wt(e){return e.archived?`Unarchive`:`Archive task`}function Tt({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,X.jsx)(z,{open:t,onOpenChange:n,children:(0,X.jsxs)(it,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,X.jsxs)(W,{children:[(0,X.jsx)(mt,{children:`Archive task?`}),(0,X.jsxs)(ot,{children:[`Move “`,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,title:L(e),children:L(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,X.jsxs)(V,{children:[(0,X.jsx)(H,{children:`Cancel`}),(0,X.jsx)(at,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function Et({run:e,className:t}){let[n,r]=(0,Y.useState)(!1),a=Ct(e.id),o=wt(e);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(O,{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:i(`h-11 gap-[7px] px-3`,t),onClick:()=>e.archived?a.mutate(!1):r(!0),children:[e.archived?(0,X.jsx)(dt,{"aria-hidden":`true`}):(0,X.jsx)(De,{"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:o})]}),(0,X.jsx)(Tt,{run:e,open:n,onOpenChange:r,onConfirm:()=>{a.mutate(!0),r(!1)}})]})}function Dt({run:e,action:t,prUrl:n,patch:i}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,X.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,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n&&r(n)?(0,X.jsx)(O,{variant:`outline`,asChild:!0,children:(0,X.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:`Open PR`})}):null,e.autoMergePr?(0,X.jsx)(O,{variant:`outline`,disabled:i.isPending,onClick:()=>i.mutate({autoMergePr:!1},{onError:e=>w(e.message,{tone:`danger`})}),children:i.isPending?`Saving…`:`Disable auto-merge`}):null]})]})}function Ot({run:e,blocker:t,flags:n}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Archive blocked`}),` · `,t.message]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.runId?(0,X.jsx)(O,{variant:`outline`,asChild:!0,children:(0,X.jsx)(I,{to:`/tasks/${t.runId}`,children:`Open blocking task`})}):null,t.pullRequestUrl&&r(t.pullRequestUrl)?(0,X.jsx)(O,{variant:`outline`,asChild:!0,children:(0,X.jsx)(`a`,{href:t.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,children:`Open blocking PR`})}):null,n.archive?(0,X.jsx)(Et,{run:e}):null]})]})}function kt({run:e}){let t=o(e.id),n=q(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 s=e.pullRequestUrl??e.pullRequests?.find(e=>e.url)?.url;return(0,X.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,X.jsx)(Dt,{run:e,action:a,prUrl:s,patch:t}):null,i?(0,X.jsx)(Ot,{run:e,blocker:i,flags:n}):null]})}var At=[`running`,`queued`,`waiting`];function jt(e,{queuePosition:t,now:n=new Date}){let r=re(e),i=r.label.charAt(0).toUpperCase()+r.label.slice(1),a=t===void 0?i:`${i} #${t}`,o=At.includes(e.status)?Nt(e,n):void 0;return o?{attention:r,label:a,nextCheck:o}:{attention:r,label:a}}function Mt(e){return e.nextCheck?`${e.label} · Next check ${e.nextCheck.text}`:e.label}function Nt(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:Ze(n,t)}}async function Z(e,t){try{await navigator.clipboard.writeText(e),w(t)}catch{w(`Run manually: ${e}`)}}function Pt(e){let t=b(),n=h(),r=(0,Y.useMemo)(()=>he(e,t),[e,t]);return{referenceProjectId:n,repoBase:t,references:r,requests:(0,Y.useMemo)(()=>n===void 0?[]:r.filter(e=>fe(e,t)).map(e=>({projectId:n,kind:e.kind,number:e.number})),[r,n,t])}}function Ft(e){return m({mutationFn:()=>ae(e.id),onError:e=>{if(e instanceof x&&e.command){Z(e.command,`No terminal found — command copied to clipboard.`);return}w(e.message,{tone:`danger`})}})}function Q(e,t){let n=d(),r=a(),i=v(),o=m({mutationFn:t=>ie(e.id,t),onError:e=>w(e.message,{tone:`danger`})}),s=gt(),c=Ye(e),l=s.runnersOn(e=>t&&c.sessionId!==void 0&&e===c.backend?c.profileId??`default`:s.repoAccount?.[e]).runners,u=e=>!r.isSuccess||!i.isSuccess||l.includes(e??`claude`);return{canResumeHere:t&&u(ut(e)),choices:e.worktreePath?(n.data?.targets??[]).filter(e=>{let t=Ae(e.id);return t===void 0||i.isSuccess&&u(t)}).map(t=>({target:t,...lt(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[],open:o}}function It({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Q(e,t),o=v().data,s=K(e);return!r&&i.length===0&&!s?null:(0,X.jsxs)(X.Fragment,{children:[r||i.length>0?(0,X.jsxs)(`div`,{className:`task-open-targets flex flex-wrap gap-3`,children:[r?(0,X.jsxs)(O,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,X.jsx)(Le,{}),`Terminal (resume session)`]}):null,i.map(({target:e,suffix:t,title:n})=>{let r=je(e,o);return(0,X.jsxs)(O,{variant:`outline`,"data-target":e.id,title:n,disabled:a.isPending,onClick:()=>a.mutate(e.id),children:[(0,X.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,X.jsxs)(O,{variant:`outline`,onClick:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>w(`Worktree path copied`)).catch(()=>w(`Path: ${t}`))},children:[(0,X.jsx)(T,{}),`Copy worktree path`]}):null]}):null,s?(0,X.jsxs)(`div`,{"data-slot":`resume-command`,className:`mt-5 border-t border-border pt-5`,children:[(0,X.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,X.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:s}),(0,X.jsxs)(O,{variant:`outline`,onClick:()=>void Z(s,`Command copied to clipboard.`),children:[(0,X.jsx)(T,{}),`Copy resume command`]})]}):null]})}function Lt({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Q(e,t),o=K(e),s=e.worktreePath;if(!r&&i.length===0&&!o&&!s)return null;let c=`max-md:min-h-11`;return(0,X.jsxs)(`div`,{"data-slot":`workspace-tools`,className:`flex min-w-0 flex-wrap gap-2`,children:[r||i.length>0?(0,X.jsx)(Me,{choices:i,onPick:e=>a.mutate(e),disabled:a.isPending,triggerVariant:`outline`,className:c,leading:r?(0,X.jsxs)(A,{"data-target":`terminal-resume`,onSelect:n,children:[(0,X.jsx)(Le,{"aria-hidden":`true`}),`Terminal (resume session)`]}):void 0}):null,s?(0,X.jsxs)(O,{variant:`outline`,size:`sm`,className:c,onClick:()=>void Z(s,`Worktree path copied`),children:[(0,X.jsx)(T,{"aria-hidden":`true`}),`Copy worktree path`]}):null,o?(0,X.jsxs)(O,{variant:`outline`,size:`sm`,"data-slot":`resume-command`,title:o,className:c,onClick:()=>void Z(o,`Command copied to clipboard.`),children:[(0,X.jsx)(T,{"aria-hidden":`true`}),`Copy resume command`]}):null]})}function Rt({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let{canResumeHere:a,choices:o}=Q(e,t);return!a&&o.length===0?null:r?(0,X.jsx)(A,{onSelect:r,children:`Open in…`}):(0,X.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,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,X.jsx)(O,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,X.jsx)(Se,{})})]}),e.worktreePath?(0,X.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,X.jsx)(`div`,{className:`mt-4`,children:(0,X.jsx)(It,{run:e,canResume:t,onResume:n})})]})}function zt({branch:e}){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(null);(0,Y.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,X.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,children:[(0,X.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,X.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,X.jsx)(T,{className:`size-3.5`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function Bt({run:e}){let t=b(),n=h(),i=r=>n===void 0?void 0:me(n,e.id,r,t),a=(0,Y.useMemo)(()=>he(e,t),[e,t]),o=[],s=[],c=a.filter(e=>e.kind===`PR`);for(let t of c)o.push((0,X.jsx)(D,{reference:t,to:i(t),taskTitle:L(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,X.jsx)(nt,{run:e,prNumber:t.number})},ye(t)));let l=ge(e);l&&r(l)&&!c.some(e=>e.url===l)&&o.push((0,X.jsx)(D,{reference:{kind:`PR`,url:l},taskTitle:L(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,X.jsx)(D,{reference:t,to:i(t),taskTitle:L(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},ye(t)));let d=pe(e,t);if(d&&r(d)&&!u.some(e=>e.url===d)){let t=_e(d);s.push((0,X.jsx)(D,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},to:t?i({kind:`Issue`,number:Number(t),url:d}):void 0,taskTitle:L(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`issue`))}return o.length===0&&s.length===0?null:(0,X.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,X.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,X.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,X.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:n})]},e):null)})}function Vt(){let e=Je(),t=l();return $e(t.data?.projects?.find(n=>n.id===(e??t.data?.bootProject)))}var Ht=e=>e.map(e=>`${e.name}: ${G(e.url)}`).join(`
|
|
2
|
-
`);function Ut(e){return Vt().length>0||e.notify===!0}function Wt({run:e}){let t=Vt(),n=t.length>0,r=u(e.id),[i,a]=(0,Y.useState)(null),o=e.notify===!0;return!n&&!o?null:(0,X.jsxs)(X.Fragment,{children:[o?(0,X.jsxs)(F,{children:[(0,X.jsx)(N,{asChild:!0,children:(0,X.jsxs)(O,{variant:`outline`,size:`sm`,"data-slot":`notifying-chip`,className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":n?`Notifying ${rt(t)} — webhook actions`:`Notifying — webhook actions`,title:n?Ht(t):void 0,children:[(0,X.jsx)(R,{tone:`success`}),(0,X.jsx)(`span`,{children:`Notifying`}),(0,X.jsx)(we,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,X.jsxs)(P,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[n?(0,X.jsx)(k,{"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,X.jsx)(`span`,{"data-webhook-target":e.id,className:`truncate`,title:G(e.url),children:e.name},e.id))}):null,n?(0,X.jsxs)(A,{className:`min-h-11`,onSelect:()=>a(`note`),children:[(0,X.jsx)(Pe,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,X.jsxs)(A,{variant:`destructive`,className:`min-h-11`,disabled:r.isPending,onSelect:()=>r.mutate({notify:!1},{onSuccess:()=>w(`Stopped notifying the webhook`),onError:e=>w(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),children:[(0,X.jsx)(bt,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,X.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,X.jsx)(B,{"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`max-md:sr-only`,children:`Hand off`})]}),n?(0,X.jsx)(Gt,{mode:i,targets:t,pending:r.isPending,onOpenChange:e=>!e&&a(null),onSubmit:e=>r.mutate({notify:!0,...e?{message:e}:{}},{onSuccess:()=>{a(null),w(i===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>w(`Could not hand off. ${e.message}`,{tone:`danger`})})}):null]})}function Gt({mode:e,targets:t,pending:n,onOpenChange:r,onSubmit:i}){let a=(0,Y.useId)(),o=(0,Y.useId)(),[s,c]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{e!==null&&c(``)},[e]);let l=e===`note`,u=rt(t);return(0,X.jsx)(Ke,{open:e!==null,onOpenChange:e=>{e||c(``),r(e)},children:(0,X.jsx)(We,{"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,X.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),i(s.trim())},children:[(0,X.jsxs)(Ue,{className:`text-left`,children:[(0,X.jsx)(Ge,{children:l?`Send a note to ${t.length===1?`the webhook`:`the webhooks`}`:`Hand off to webhook`}),(0,X.jsx)(He,{children:(0,X.jsx)(`span`,{"data-webhook-destination":``,title:Ht(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,X.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:a,className:`text-[13px] font-medium`,children:`Note`}),(0,X.jsx)(yt,{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,X.jsxs)(`p`,{id:o,className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[(0,X.jsx)(Ne,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,X.jsxs)(Ve,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:h-11 max-sm:[&>button]:w-full`,children:[(0,X.jsx)(O,{type:`button`,variant:`ghost`,className:`sm:h-9`,onClick:()=>r(!1),children:`Cancel`}),(0,X.jsxs)(O,{type:`submit`,variant:`contrast`,className:`sm:h-9`,"data-action":`handoff-submit`,disabled:n||l&&s.trim()===``,children:[(0,X.jsx)(B,{"aria-hidden":`true`}),l?`Send note`:`Hand off`]})]})]})})})}function Kt({runId:e,children:t}){let n=ue(),r=(0,Y.useMemo)(()=>({runId:e}),[e]);return n?(0,X.jsx)(qt,{runId:e,children:t}):(0,X.jsx)(_t.Provider,{value:r,children:t})}function qt({runId:e,children:t}){let{projectId:n}=de(),r=(0,Y.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,X.jsx)(_t.Provider,{value:r,children:t})}function Jt({id:e}){return(0,X.jsxs)(I,{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,X.jsx)(Ce,{"aria-hidden":!0,className:`shrink-0 [block-size:1.2cap] [inline-size:auto]`}),`Parent`]})}function Yt({id:e}){let t=p(e),n=t.data?L(t.data):e;return(0,X.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,X.jsxs)(I,{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,X.jsx)(Ce,{"aria-hidden":!0,className:`h-[1.2cap] w-auto shrink-0`}),(0,X.jsx)(`span`,{className:`shrink-0`,children:`Parent`}),(0,X.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,X.jsx)(`span`,{className:`min-w-0 overflow-clip text-ellipsis whitespace-nowrap`,children:n})]}),t.isError?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:`Parent record unavailable or deleted`}),(0,X.jsx)(O,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}var Xt=3,Zt=(e,t)=>e.kind===t.kind&&e.number===t.number;function Qt(e,t,n=Xt){let r=t?e.findIndex(e=>Zt(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 $=(e,t)=>`/tasks/${e}/${t.kind}/${t.number}`;function $t({tab:e}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(e.kind===`pr`?be:Te,{"aria-hidden":`true`,className:`mr-1 size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`sr-only`,children:e.kind===`pr`?`Pull request`:`Issue`}),` #`,e.number,(0,X.jsx)(Ie,{kind:e.kind===`pr`?`PR`:`Issue`,number:e.number,className:`ml-1`})]})}function en(e,t){let n=e[0],r=e.length+ +!!t;return n?`Preview :${n.port}${r>1?` +${r-1}`:``}`:t?`Preview · agent`:`Preview`}function tn({servers:e}){let t=ft();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,X.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,X.jsx)(ke,{"aria-hidden":`true`}),en(e,n),t.live?(0,X.jsx)(R,{tone:`success`,"aria-label":`Preview is live`}):null]})}function nn(e){return e?.role===`worker`?`Worker session`:e?.role===`root`?`Parent session`:`Task session`}function rn({run:e,compact:t=!1}){if(e.delegation?.role!==`worker`)return null;let n=e.delegation.supervisorRunId??e.delegation.parentRunId;return t?(0,X.jsx)(Jt,{id:n}):(0,X.jsx)(Yt,{id:n})}function an(e,t){return!e.archiveBlocker&&t.archive?(0,X.jsx)(Et,{run:e}):null}function on({run:e}){return e.archived&&e.autoArchive?.reason===`pull-requests-merged`&&e.autoArchive.archivedAt===e.archivedAt?(0,X.jsx)(`p`,{"data-slot":`auto-archive-reason`,className:`text-[13px] text-muted-foreground`,children:`Archived automatically after all associated PRs merged.`}):null}function sn({shown:e,run:t,previewToggle:n}){let r=Ut(t);return e&&(n||r)?(0,X.jsxs)(`div`,{"data-slot":`run-mobile-actions`,className:`flex flex-wrap items-center gap-2 pt-2`,children:[n,(0,X.jsx)(Wt,{run:t})]}):null}function cn({run:e,tab:t,activeItem:n,inlineItemTabs:r,overflowItemTabs:i,phoneBar:a,isDesktop:o}){let s=(0,Y.useRef)(null),c=n?`${n.kind}#${n.number}`:null;return(0,Y.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,X.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,X.jsx)(J,{to:`/tasks/${e.id}`,active:t===`session`,replace:a,children:`Session`}),(0,X.jsx)(J,{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,X.jsx)(J,{to:`/tasks/${e.id}/commits`,active:t===`commits`,replace:a,children:`Commits`}),(0,X.jsx)(J,{to:`/tasks/${e.id}/files`,active:t===`files`,replace:a,children:`Files`}),r.map(t=>(0,X.jsx)(J,{to:$(e.id,t),active:n!==null&&Zt(t,n),replace:a,children:(0,X.jsx)($t,{tab:t})},`${t.kind}-${t.number}`)),i.length>0?(0,X.jsxs)(F,{children:[(0,X.jsxs)(N,{"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,X.jsx)(P,{align:`end`,children:i.map(t=>(0,X.jsx)(A,{asChild:!0,children:(0,X.jsx)(I,{to:$(e.id,t),replace:a,children:(0,X.jsx)($t,{tab:t})})},`${t.kind}-${t.number}`))})]}):null]})}function ln({run:e,tab:t=`session`,onMarkedUnread:n}){let r=re(e),a=q(e),[o,s]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(!1),u=un(e,n),d=ee(),f=ne(),p=jt(e,{queuePosition:e.status===`queued`?Xe(d.data??[]).get(e.id):void 0}),m=Qe(),h=tt(),g=m!==null&&!h?m:null,_=g!==null,{referenceProjectId:v,repoBase:y,requests:te}=Pt(e),b=(0,Y.useMemo)(()=>ve(e,y),[e,y]),x=typeof t==`object`?t:null,{inline:ie,overflow:ae}=Qt(b,x),S=f.data?.capabilities?.preview===!0,C=e.worktreePath&&S?(0,X.jsx)(tn,{servers:e.previewServers??[]}):null,w=(0,X.jsx)(mn,{run:e,actions:u,onOpenChooser:()=>l(!0),onToggleNotes:()=>s(e=>!e)}),oe=an(e,a);return(0,X.jsx)(Fe,{projectId:v,repoBase:y,requests:te,children:(0,X.jsxs)(`header`,{"data-slot":`run-header`,"data-sticky":t===`session`||void 0,className:i(`relative z-20 bg-background px-4 md:px-9 md:pt-7`,_?`pt-0`:`pt-[18px]`,t===`session`&&`sticky [inset-block-start:0]`),children:[(0,X.jsx)(on,{run:e}),(0,X.jsx)(kt,{run:e}),(0,X.jsxs)(`div`,{className:`w-full`,children:[(0,X.jsx)(rn,{run:e}),g?(0,X.jsxs)(et,{slot:g,children:[(0,X.jsx)(pn,{run:e,status:(0,X.jsx)(ht,{"data-slot":`mobile-run-status`,dot:r.tone,shape:r.shape,pulse:r.pulse,className:`max-w-full self-start truncate px-2 py-px text-[11px] leading-4`,children:p.label})}),(0,X.jsx)(rn,{run:e,compact:!0}),w]}):(0,X.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,X.jsx)(`p`,{"data-slot":`session-kind`,className:`text-[12px] font-semibold tracking-[0.14em] text-muted-foreground uppercase md:hidden`,children:nn(e.delegation)}),(0,X.jsx)(fn,{run:e}),(0,X.jsx)(ht,{dot:r.tone,shape:r.shape,pulse:r.pulse,className:`max-md:hidden`,children:Mt(p)}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[h?oe:null,C,(0,X.jsx)(Wt,{run:e}),w]})]}),(0,X.jsx)(sn,{shown:g!==null,run:e,previewToggle:C}),(0,X.jsx)(cn,{run:e,tab:t,activeItem:x,inlineItemTabs:ie,overflowItemTabs:ae,phoneBar:_,isDesktop:h}),o?(0,X.jsx)(_n,{runId:e.id,onClose:()=>s(!1)}):null,c?(0,X.jsx)(Rt,{run:e,canResume:q(e).terminal,onResume:()=>u.terminal.mutate(),onClose:()=>l(!1)}):null]}),(0,X.jsx)(gn,{run:e,actions:u})]})})}function un(e,t){let n=C(),r=qe(),[i,a]=(0,Y.useState)(null),o=()=>n.invalidateQueries({queryKey:f.runs.all}),l=e=>w(e.message,{tone:`danger`}),u=c(),d={isPending:u.isPending,mutate:()=>u.mutate({id:e.id,pinned:!e.pinned})},p=s();return{pin:d,markUnread:{isPending:p.isPending,mutate:()=>{t?.(),p.mutate(e.id,{onError:l})}},delete:m({mutationFn:()=>ce(e.id),onSuccess:()=>{o(),r(`/`)},onError:l}),terminal:Ft(e),confirming:i,setConfirming:a}}function dn(e){let t=o(e.id),n=L(e);return{title:n,editor:pt(n,e=>t.mutate({title:e},{onError:e=>w(e.message,{tone:`danger`})}))}}function fn({run:e}){let{title:t,editor:n}=dn(e);return n.editing?(0,X.jsx)(ct,{editor:n,className:`flex-1 text-[16px] font-semibold`}):(0,X.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:t}),(0,X.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,X.jsx)(U,{className:`size-3.5`,"aria-hidden":`true`})})]})}function pn({run:e,status:t}){let{title:n,editor:r}=dn(e);return(0,X.jsxs)(Be,{open:r.editing,onOpenChange:e=>{e?r.begin():r.commit()},children:[(0,X.jsxs)(`div`,{"data-slot":`mobile-run-title`,className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsx)(`h1`,{className:`line-clamp-2 break-words text-[15px] leading-[18px] font-semibold text-foreground`,title:e.task,children:n}),t]}),(0,X.jsx)(Re,{asChild:!0,children:(0,X.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,X.jsx)(U,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,X.jsx)(ze,{align:`end`,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),r.cancel()},children:(0,X.jsx)(ct,{editor:r,className:`text-[16px] font-semibold`})})]})}function mn({run:e,actions:t,onToggleNotes:n,onOpenChooser:r}){let i=q(e),a=K(e),s=tt(),c=Ct(e.id),[l,u]=(0,Y.useState)(!1),d=o(e.id),f=(0,Y.useId)();return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Tt,{run:e,open:l,onOpenChange:u,onConfirm:()=>{c.mutate(!0),u(!1)}}),(0,X.jsxs)(F,{children:[(0,X.jsx)(N,{asChild:!0,children:(0,X.jsx)(O,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,X.jsx)(Oe,{"aria-hidden":`true`})})}),(0,X.jsxs)(P,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,X.jsx)(k,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),!s&&i.archive&&!e.archiveBlocker?(0,X.jsx)(A,{disabled:c.isPending,onSelect:()=>e.archived?c.mutate(!1):u(!0),children:wt(e)}):null,(0,X.jsxs)(A,{onSelect:n,children:[(0,X.jsx)(st,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,X.jsx)(Rt,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),a?(0,X.jsxs)(A,{onSelect:()=>void Z(a,`Command copied to clipboard.`),children:[(0,X.jsx)(T,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.markUnread?(0,X.jsxs)(A,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,X.jsx)(xt,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,X.jsxs)(M,{"data-slot":`pin-run`,className:`min-h-11`,checked:!!e.pinned,disabled:t.pin.isPending,onCheckedChange:()=>t.pin.mutate(),children:[e.pinned?(0,X.jsx)(St,{"aria-hidden":`true`}):(0,X.jsx)(Ee,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,(0,X.jsx)(j,{}),(0,X.jsx)(k,{className:`text-xs text-muted-foreground`,children:`AFTER DONE`}),(0,X.jsx)(M,{"data-slot":`archive-when-done`,className:`min-h-11`,checked:e.archiveWhenDone===!0,disabled:d.isPending,onCheckedChange:e=>d.mutate({archiveWhenDone:e},{onError:e=>w(e.message,{tone:`danger`})}),children:`Archive when Done`}),(0,X.jsx)(M,{"data-slot":`auto-merge-pr`,className:`min-h-11`,checked:e.autoMergePr===!0,disabled:d.isPending,"aria-describedby":f,onCheckedChange:e=>d.mutate({autoMergePr:e},{onError:e=>w(e.message,{tone:`danger`})}),children:`Auto-merge PR`}),(0,X.jsx)(`p`,{id:f,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,X.jsx)(hn,{run:e,patch:d}),i.deleteRun?(0,X.jsx)(j,{}):null,i.deleteRun?(0,X.jsxs)(A,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,X.jsx)(xe,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})]})}function hn({run:e,patch:t}){let n=(0,Y.useId)(),r=(0,Y.useId)(),i=(0,Y.useId)(),a=e=>w(e.message,{tone:`danger`});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{}),(0,X.jsx)(k,{className:`text-xs text-muted-foreground`,children:`TASK ACCESS`}),(0,X.jsx)(M,{"data-slot":`allow-workers`,className:`min-h-11`,checked:S(e),disabled:t.isPending,"aria-describedby":`${n} ${i}`,onCheckedChange:e=>t.mutate({allowWorkers:e},{onError:a}),children:`Allow Squawk workers`}),(0,X.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,X.jsx)(M,{"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,X.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,X.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 gn({run:e,actions:t}){let n=t.confirming;return(0,X.jsx)(z,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,X.jsxs)(it,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,X.jsxs)(W,{children:[(0,X.jsx)(mt,{className:`text-danger`,children:`Delete task permanently?`}),(0,X.jsx)(ot,{children:(0,X.jsxs)(X.Fragment,{children:[`Delete “`,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,title:L(e),children:L(e)}),`” and its transcript`,e.delegation?.role===`worker`&&!le(e.delegation.workspace)?``:`, worktree and branch`,`. This cannot be undone.`]})})]}),(0,X.jsxs)(V,{children:[(0,X.jsx)(H,{children:`Cancel`}),(0,X.jsx)(at,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{t.delete.mutate(),t.setConfirming(null)},children:`Delete task`})]})]})})}function _n({runId:e,onClose:t}){let n=y(e);return(0,X.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 rounded-xl border border-border bg-card p-6`,children:[(0,X.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,X.jsx)(O,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,X.jsx)(Se,{})})]}),n.isPending?(0,X.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,X.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,X.jsx)(Kt,{runId:e,children:(0,X.jsx)(vt,{children:n.data})}):(0,X.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`}),(0,X.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,X.jsx)(O,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void Z(n.data??``,`Notes copied`),children:`Copy notes`}),(0,X.jsx)(O,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{Lt as a,jt as c,Bt as i,Kt as n,Ft as o,zt as r,Pt as s,ln as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{$t as i,Gt as a,Zt as o,dn as s,rn as c,yt as l}from"./queries-ClkIgWFx.js";import{In as u,Tr as d,hi as f,ii as p,zn as m}from"./toaster-C-xqAWVX.js";import{it as h,l as g}from"./design-icons-CzEoMH9c.js";import{t as _}from"./button-B7MKxYjT.js";import{a as v,i as y,o as b,r as x,s as S,t as C}from"./dialog-B531GGAo.js";import{Vn as w}from"./index-7M_Uae0m.js";var T=e(t(),1),E=n();function D(e,t){return o(t).flatMap(t=>{let n=e.filter(e=>e.provider===t.id);return n.length<2?[{runner:t,account:null,label:t.pickerLabel,desc:t.pickerDescription,missing:!1}]:n.map(e=>({runner:t,account:e.isDefault?null:e.id,label:`${t.pickerLabel} · ${e.label}`,desc:e.configDir?e.exists?e.configDir:`${e.configDir} — folder not created yet`:e.exists?``:`Not initialized on host yet`,missing:!e.exists,...e.isDefault||e.status===void 0?{}:{accountStatus:e.status.status}}))})}var O=(e,t)=>e.length>i(t).length;function k(e,t,n){let r=d(e.data,t),i=r!==void 0&&r.status!==`not-installed`&&(n??r.status)===`connected`,a=!e.isPending&&!e.isError&&r?.enabled===!0&&i;return{providerConnected:a,providerReason:e.isPending?`Checking provider authentication…`:e.isError?`Provider authentication could not be verified.`:r?.enabled===!1?`This provider is disabled. Enable it above or choose another provider.`:a?void 0:`Connect this provider before selecting it.`}}function A({rows:e,runner:t,accountFor:n,providerStatus:i,disabled:a=!1,accountDisabled:o=!1,onPick:s}){let l=c().data,u=l===void 0,d=O(e,l);return(0,E.jsx)(`div`,{role:`radiogroup`,"aria-label":`Default runner`,"data-slot":`agents-runner`,className:r(`gap-0.5 rounded-md border border-border bg-card p-0.5`,d?`flex max-w-md flex-col`:`inline-flex w-fit`),children:e.map(c=>{let{providerConnected:l,providerReason:f}=k(i,c.runner.id,c.accountStatus),p=e.filter(e=>e.runner.id===c.runner.id).length>1,m=c.runner.id===t&&c.account===n(c.runner.id);return(0,E.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":m,"data-value":c.runner.id,"data-account":c.account??``,title:f??c.desc,disabled:a||u||!l||p&&o,onClick:()=>s(c.runner.id,c.account,p),className:r(`rounded-sm px-3 py-1.5 text-left font-mono text-[13px] font-medium transition-colors disabled:opacity-50`,m?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:[c.label,d?(0,E.jsx)(`span`,{"data-slot":c.missing?`agents-account-missing`:`agents-account-dir`,"data-runner":c.runner.id,className:`ml-2 font-sans text-[11px] text-soft-foreground`,children:c.desc}):null]},`${c.runner.id}:${c.account??``}`)})})}async function j(e,t){return m(await u.api.v1.providers[`sign-in`].start.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/sign-in/start`)}async function M(e){return m(await u.api.v1.providers[`sign-in`][`:id`].$get({param:{id:e}}),`/providers/sign-in/:id`)}async function N(e,t){return m(await u.api.v1.providers[`sign-in`][`:id`].redirect.$post({param:{id:e},json:{redirectUrl:t}}),`/providers/sign-in/:id/redirect`)}async function P(e){return m(await u.api.v1.providers[`sign-in`][`:id`].$delete({param:{id:e}}),`/providers/sign-in/:id`)}function F(e,t){let n=f(),[r,i]=(0,T.useState)(!1),[o,c]=(0,T.useState)(null),[l,u]=(0,T.useState)(``),d=(0,T.useRef)(null),m=(0,T.useRef)(!0),h=(0,T.useRef)(0),g=()=>{h.current++,v.current=!1;let e=d.current;d.current=null,e?.state===`waiting`&&P(e.id).catch(()=>{}),c(null),u(``),i(!1)};(0,T.useEffect)(()=>(m.current=!0,()=>{m.current=!1,h.current++;let e=d.current;e?.state===`waiting`&&P(e.id).catch(()=>{})}),[]);let _=s({mutationFn:n=>j(e,t).then(e=>({result:e,generation:n})),retry:!1,onSuccess:({result:e,generation:t})=>{if(!m.current||!v.current||t!==h.current){P(e.id).catch(()=>{});return}d.current=e,c(e)}}),v=(0,T.useRef)(r);v.current=r;let y=p({queryKey:[`browser-sign-in`,o?.id],queryFn:()=>M(o.id),enabled:r&&o?.state===`waiting`,retry:!1,refetchInterval:e=>e.state.error||e.state.data?.state&&e.state.data.state!==`waiting`?!1:1e3,gcTime:0}),b=y.data??o,x=s({mutationFn:()=>N(o.id,l),retry:!1,onSuccess:()=>{u(``),y.refetch()}});return(0,T.useEffect)(()=>{b?.state===`connected`&&(d.current=b,c(b),Promise.all([n.invalidateQueries({queryKey:a.agentProfiles}),n.invalidateQueries({queryKey:a.providerStatus}),n.invalidateQueries({queryKey:a.models(e)})]))},[b,n,e]),{open:r,result:b,redirect:l,setRedirect:u,start:_,replay:x,status:y,error:_.error??x.error??y.error,close:g,connect:()=>{i(!0),v.current=!0,_.reset(),x.reset(),_.mutate(++h.current)}}}function I(){return`Open the sign-in link in your browser. After Google consent, the page shows a code. Copy that code, or the full address of that page, and paste it below.`}function L({provider:e,profileId:t,label:n}){let{open:r,result:i,redirect:a,setRedirect:o,start:s,replay:c,status:u,error:d,close:f,connect:p}=F(e,t);return l().data?.capabilities?.settingsAdmin===!0?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(_,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:s.isPending,onClick:p,children:`Connect`}),(0,E.jsx)(C,{open:r,onOpenChange:e=>{e||f()},children:(0,E.jsxs)(x,{children:[(0,E.jsxs)(b,{children:[(0,E.jsxs)(S,{children:[`Sign in to `,n]}),(0,E.jsx)(y,{children:`Use a personal Google account. Business and agent-platform sign-in are not supported.`})]}),s.isPending?(0,E.jsx)(`p`,{role:`status`,children:`Preparing sign-in…`}):null,i?.state===`waiting`?(0,E.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,E.jsx)(`a`,{href:i.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-action underline`,children:`Open Google sign-in`}),(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,E.jsx)(I,{})}),(0,E.jsxs)(`label`,{className:`grid gap-2`,children:[`Code or page address`,(0,E.jsx)(w,{type:`text`,autoComplete:`off`,spellCheck:!1,value:a,onChange:e=>o(e.target.value)})]}),(0,E.jsx)(_,{disabled:!a.trim()||c.isPending,onClick:()=>c.mutate(),children:`Complete sign-in`})]}):null,i?.state===`connected`?(0,E.jsx)(`p`,{role:`status`,children:`Connected.`}):null,i?.state===`failed`?(0,E.jsx)(`p`,{role:`alert`,children:i.error}):null,i?.state===`cancelled`?(0,E.jsx)(`p`,{role:`status`,children:`Sign-in cancelled. Close this window and Connect again.`}):null,d?(0,E.jsx)(`p`,{role:`alert`,children:d.message}):null,u.isError&&i?.state===`waiting`?(0,E.jsx)(_,{onClick:()=>void u.refetch(),children:`Retry status`}):null,(0,E.jsx)(v,{children:(0,E.jsx)(_,{variant:`outline`,onClick:f,children:i?.state===`connected`?`Done`:`Cancel`})})]})})]}):null}function R(e){let t=e.label.startsWith(e.runner.pickerLabel)?e.label.slice(e.runner.pickerLabel.length):``;return{...e,label:`${e.runner.displayName}${t}`}}function z(e){let t=(0,T.useRef)(null),n=e.rows.map(R),r=n.find(t=>t.runner.id===e.runner&&t.account===e.accountFor(t.runner.id)),i=n.find(t=>t.runner.id===e.runner)?.runner.displayName;return(0,E.jsxs)(`details`,{ref:t,className:`settings-agent-picker`,children:[(0,E.jsxs)(`summary`,{children:[(0,E.jsx)(h,{"aria-hidden":`true`,className:`size-4 text-accent-text`}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1`,children:r?.label??i??e.runner}),(0,E.jsx)(g,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})]}),(0,E.jsx)(A,{...e,rows:n,onPick:(...n)=>{e.onPick(...n),t.current&&(t.current.open=!1)}})]})}export{k as a,O as i,L as n,D as r,z as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ft as r,It as i,Mt as a,St as o,gt as s,kt as c}from"./queries-ClkIgWFx.js";import{Cn as l,Dn as u,On as d,Sn as f,n as p,wn as m}from"./toaster-C-xqAWVX.js";import{n as h,p as g,r as _}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{l as v,u as y}from"./design-icons-CzEoMH9c.js";import{t as b}from"./plus-CxRU2X8C.js";import{t as x}from"./button-B7MKxYjT.js";import{n as ee,r as S,t as te}from"./collapsible-BEV4FO-1.js";import{r as C}from"./switch-SP8pw5uU.js";import{t as w}from"./badge-DQ3U69Ht.js";import{n as T,s as E,t as D}from"./project-router-CT6gVIcC.js";import"./attention--Y0CyzCN.js";import{a as O,l as ne}from"./page-shell-7pLJMOgh.js";import{L as re,Ln as ie,Vn as k,dt as A,lt as j,pn as M,ut as N}from"./index-7M_Uae0m.js";import{t as ae}from"./textarea-vJt9undk.js";import{n as oe,t as se}from"./saved-draft-BwzBc-_Y.js";import{ArchiveOnMergeField as ce}from"./archive-on-merge-field-D7-FuLiL.js";import{a as le,i as ue,n as de,t as fe}from"./projects-section-DtL1VsXT.js";import{n as P}from"./settings-field-DP9sYv5a.js";import{t as pe}from"./project-location-CcmuGA5W.js";var F=e(t(),1),I={"needs-you":{label:`Needs you`,hint:`Asks a question, asks for permission, or waits for review`},failed:{label:`Failed`,hint:`Failed, with no scheduled resume`},done:{label:`Done`,hint:`Finished`},cancelled:{label:`Cancelled`,hint:`Was cancelled`},running:{label:`Running`,hint:`Runs an agent turn`},"waiting-workers":{label:`Waiting for agents`,hint:`Waits on its workers or their replies`},"waiting-ci":{label:`Waiting on CI`,hint:`Waits on a pull request's checks`},"waiting-timer":{label:`Waiting`,hint:`Waits on a timer`},"waiting-other":{label:`Any other wait`,hint:`Waits on anything else, including wait types added later`}},L=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),R={name:``,description:``,url:``,token:``,tasks:!0,triggers:u,agent:!1};function z(e){return{name:e.name,description:e.description??``,url:e.url,token:``,tasks:e.tasks,triggers:e.triggers??u,agent:e.agent}}var B=e=>d.filter(t=>e.includes(t));function me(e){let t=e.description.trim();return{name:e.name.trim(),url:e.url.trim(),...t?{description:t}:{},...e.token?{token:e.token}:{},tasks:e.tasks,...L(e.triggers,u)?{}:{triggers:B(e.triggers)},agent:e.agent}}function he(e){return e.name.trim()!==``||e.description.trim()!==``||e.url.trim()!==``||e.token!==``||e.tasks!==R.tasks||e.agent!==R.agent||!L(e.triggers,R.triggers)}function ge(e,t){let n={},r=e.name.trim(),i=e.description.trim(),a=e.url.trim();return r!==t.name&&(n.name=r),i!==(t.description??``)&&(n.description=i),a!==t.url&&(n.url=a),e.token&&(n.token=e.token),e.tasks!==t.tasks&&(n.tasks=e.tasks),L(e.triggers,t.triggers??u)||(n.triggers=B(e.triggers)),e.agent!==t.agent&&(n.agent=e.agent),n}var V=n(),H=`flex flex-col gap-1 text-[13px]`,U=`text-[11px] text-muted-foreground`;function W({draft:e,onChange:t,tokenSet:n}){let r=(0,F.useId)(),i=(0,F.useId)(),a=(0,F.useId)(),o=(0,F.useId)(),s=(0,F.useId)(),c=(0,F.useId)(),u=(0,F.useId)(),p=(0,F.useId)(),h=(0,F.useId)(),g=(0,F.useId)();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3`,children:[(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:r,className:U,children:`Name`}),(0,V.jsx)(k,{id:r,"data-slot":`webhook-name`,autoComplete:`off`,maxLength:80,placeholder:`e.g. Team bot`,value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:o,className:U,children:`URL`}),(0,V.jsx)(k,{id:o,"data-slot":`webhook-url`,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,maxLength:m,placeholder:`https://bot.example/hooks/cez`,value:e.url,onChange:e=>t({url:e.target.value})})]})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:i,className:U,children:`Description`}),(0,V.jsx)(ae,{id:i,"data-slot":`webhook-description`,"aria-describedby":a,rows:2,maxLength:f,placeholder:`e.g. Posts to the #releases channel. Use it for release notes.`,value:e.description,onChange:e=>t({description:e.target.value})}),(0,V.jsx)(`span`,{id:a,className:`text-[11px] text-soft-foreground`,children:`Agents read the name and description to decide when to use this webhook.`})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:s,className:U,children:`Token`}),(0,V.jsx)(k,{id:s,"data-slot":`webhook-token`,type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:l,"aria-describedby":c,placeholder:n?`Token set — type to replace`:`Optional Bearer token`,value:e.token,onChange:e=>t({token:e.target.value})}),(0,V.jsx)(`span`,{id:c,className:`text-[11px] text-soft-foreground`,children:n?`The token is stored in ~/.cezar and never shown again. Leave it empty to keep it.`:`The token is stored in ~/.cezar, never in the repo. It is sent as a Bearer header.`})]}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(C,{id:u,"aria-describedby":p,"data-slot":`webhook-tasks`,checked:e.tasks,onCheckedChange:e=>t({tasks:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:u,className:`font-medium`,children:`Task notifications`}),(0,V.jsx)(`span`,{id:p,className:`text-[11px] text-soft-foreground`,children:`Tasks you hand off, or start with notify on, send their status here.`})]})]}),e.tasks?(0,V.jsxs)(`fieldset`,{"data-slot":`webhook-triggers`,className:`flex flex-col gap-1 sm:ps-[3.25rem]`,children:[(0,V.jsx)(`legend`,{className:`pbe-1 text-[11px] text-muted-foreground`,children:`Send a delivery when a task enters`}),(0,V.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,15rem),1fr))] gap-x-3`,children:d.map(n=>(0,V.jsxs)(`label`,{className:`flex min-h-11 items-start gap-2.5 pbs-2 text-[13px]`,children:[(0,V.jsx)(`input`,{type:`checkbox`,"data-trigger":n,checked:e.triggers.includes(n),onChange:r=>t({triggers:r.target.checked?[...e.triggers,n]:e.triggers.filter(e=>e!==n)}),className:`mbs-0.5 size-[18px] shrink-0`}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:I[n].label}),(0,V.jsx)(`span`,{className:`text-[11px] text-soft-foreground`,children:I[n].hint})]})]},n))}),(0,V.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Handing a task off and Send test always deliver.`})]}):null]}),(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(C,{id:h,"aria-describedby":g,"data-slot":`webhook-agent`,checked:e.agent,onCheckedChange:e=>t({agent:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:h,className:`font-medium`,children:`Let agents send reports`}),(0,V.jsx)(`span`,{id:g,className:`text-[11px] text-soft-foreground`,children:`Agents in this project may post a report here when the task calls for it.`})]})]})]})}var G=`max-sm:h-11`,K=(e,t)=>({tone:`alert`,text:`Not saved: ${e.message}. Fix the field and select ${t} again.`}),_e=e=>e.dryRun?{tone:`ok`,text:`Dry run: nothing was sent.`}:e.ok?{tone:`ok`,text:`Delivered (HTTP ${e.status??200}).`}:{tone:`danger`,text:`Not delivered: ${e.error??`unknown error`}.`};function q({feedback:e}){return e?(0,V.jsx)(`p`,{"data-slot":e.tone===`alert`?`webhook-error`:`webhook-result`,role:e.tone===`alert`?`alert`:`status`,className:e.tone===`ok`?`text-[13px] text-muted-foreground`:`text-[13px] text-danger`,children:e.text}):null}var J=`rounded-md border border-border bg-background`,Y=`flex flex-col gap-3 border-bs border-border p-3`;function ve({projectId:e,webhook:t,defaultOpen:n=!1}){let i=r(),o=c(),s=a(),[l,u]=(0,F.useState)(n),[d,f]=oe(z(t),se),[m,h]=(0,F.useState)(null),g=ge(d,t),_=Object.keys(g).length>0;M(_);let y=d.name.trim()!==``&&d.url.trim()!==``,b=i.isPending||o.isPending||s.isPending,C={projectId:e,webhookId:t.id},T=e=>i.mutate({...C,...g},{onSuccess:()=>{f(e=>({...e,token:``})),e?e():p(`${d.name.trim()} saved`)},onError:e=>h(K(e,`Save`))}),E=()=>s.mutate(C,{onSuccess:e=>h(_e(e)),onError:e=>h({tone:`danger`,text:e.message})});return(0,V.jsx)(`li`,{"data-slot":`webhook-card`,"data-webhook-id":t.id,className:J,children:(0,V.jsxs)(te,{open:l,onOpenChange:u,children:[(0,V.jsx)(S,{asChild:!0,children:(0,V.jsxs)(`button`,{type:`button`,"data-action":`webhook-toggle`,className:`group flex min-h-11 w-full items-center gap-3 rounded-md p-3 text-start focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-foreground pointer-hover:bg-muted/50 active:bg-muted/50`,children:[(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,V.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(`span`,{"data-slot":`webhook-card-name`,className:`min-w-0 break-words text-[13px] font-medium`,children:t.name}),t.tasks?(0,V.jsx)(w,{variant:`secondary`,"data-badge":`tasks`,children:`Task notifications`}):null,t.agent?(0,V.jsx)(w,{variant:`secondary`,"data-badge":`agent`,children:`Agents`}):null]}),(0,V.jsx)(`span`,{"data-slot":`webhook-card-url`,className:`truncate text-[12px] text-muted-foreground`,children:re(t.url)})]}),(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground group-data-[state=open]:rotate-180`})]})}),(0,V.jsx)(ee,{children:(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,className:Y,onSubmit:e=>{e.preventDefault(),h(null),y&&_&&T()},children:[(0,V.jsx)(W,{draft:d,tokenSet:t.tokenSet,onChange:e=>f(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-save`,disabled:b||!y||!_,children:`Save`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`outline`,"data-action":`webhook-test`,disabled:b||!y,onClick:()=>{h(null),_?T(E):E()},children:`Send test`}),t.tokenSet?(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-clear-token`,disabled:b,onClick:()=>i.mutate({...C,token:``},{onSuccess:()=>p(`Webhook token cleared`),onError:e=>h({tone:`danger`,text:`Token not cleared: ${e.message}.`})}),children:`Clear token`}):null,(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`danger-ghost`,"data-action":`webhook-remove`,"aria-label":`Remove ${t.name}`,disabled:b,onClick:()=>o.mutate(C,{onSuccess:()=>p(`${t.name} removed`),onError:e=>h({tone:`danger`,text:`Not removed: ${e.message}.`})}),children:`Remove`})]}),(0,V.jsx)(q,{feedback:m})]})})]})})}function ye({projectId:e,onCreated:t,onCancel:n}){let r=s(),[i,a]=(0,F.useState)(R),[o,c]=(0,F.useState)(null),l=i.name.trim()!==``&&i.url.trim()!==``;return M(he(i)),(0,V.jsxs)(`li`,{"data-slot":`webhook-card`,"data-draft":``,className:J,children:[(0,V.jsx)(`p`,{className:`p-3 text-[13px] font-medium`,children:`New webhook`}),(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,"aria-label":`New webhook`,className:Y,onSubmit:n=>{n.preventDefault(),c(null),l&&r.mutate({projectId:e,...me(i)},{onSuccess:({webhook:e})=>{p(`${e.name} created`),t(e)},onError:e=>c(K(e,`Create`))})},children:[(0,V.jsx)(W,{draft:i,tokenSet:!1,onChange:e=>a(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-create`,disabled:r.isPending||!l,children:`Create`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-cancel`,disabled:r.isPending,onClick:n,children:`Cancel`})]}),(0,V.jsx)(q,{feedback:o})]})]})}function be({project:e}){let t=e.webhooks??[],[n,r]=(0,F.useState)(!1),[i,a]=(0,F.useState)(null),o=t.length>=16;return(0,V.jsx)(P,{title:`Webhooks`,hint:`A webhook gets a POST from Squawk. Tasks can send their status to it, and agents can send it reports.`,children:(0,V.jsxs)(`div`,{"data-slot":`project-webhooks`,className:`flex flex-col gap-3`,children:[t.length===0&&!n?(0,V.jsx)(`p`,{"data-slot":`webhooks-empty`,className:`text-[13px] text-soft-foreground`,children:`No webhooks yet. Add one to send task updates to a bot, or to let agents post reports.`}):null,t.length>0||n?(0,V.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[t.map(t=>(0,V.jsx)(ve,{projectId:e.id,webhook:t,defaultOpen:t.id===i},t.id)),n?(0,V.jsx)(ye,{projectId:e.id,onCancel:()=>r(!1),onCreated:e=>{a(e.id),r(!1)}}):null]}):null,n?null:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(x,{type:`button`,size:`sm`,variant:`outline`,className:`max-sm:h-11`,"data-action":`webhook-add`,disabled:o,onClick:()=>r(!0),children:[(0,V.jsx)(b,{"aria-hidden":`true`}),`Add webhook`]}),o?(0,V.jsxs)(`span`,{className:`text-[11px] text-soft-foreground`,children:[`A project holds at most `,16,` webhooks.`]}):null]})]})})}function X(e){let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}function xe(){let e=E(),t=o(),n=i();if(t.isPending)return(0,V.jsx)(`p`,{"data-slot":`project-general-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading project…`});if(t.isError)return(0,V.jsxs)(`p`,{"data-slot":`project-general-error`,className:`text-[13px] text-danger`,children:[`Could not read the project registry — `,t.error.message]});let r=t.data,a=r?.projects.find(t=>t.id===e);return!r||!a?null:(0,V.jsxs)(`div`,{"data-slot":`project-general`,className:`flex w-full flex-col gap-5`,children:[(0,V.jsxs)(`section`,{className:`flex flex-col gap-5 rounded-lg border border-border bg-card p-5 [&_select]:min-h-11 [&_select]:w-full`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`General`}),(0,V.jsx)(pe,{}),(0,V.jsx)(Se,{project:a}),(0,V.jsx)(P,{title:`Max parallel tasks`,hint:n.data?`The workspace limit (${n.data.resources.maxParallel}) still applies as an overall ceiling.`:`How many of this project's tasks may run at once. The workspace limit still applies as an overall ceiling.`,children:n.data?(0,V.jsx)(fe,{project:a,workspaceMax:n.data.resources.maxParallel}):(0,V.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading the workspace limit…`})}),(0,V.jsx)(be,{project:a},a.id)]}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(Z,{project:a,bootProject:r.bootProject})})]})}function Se({project:e}){return(0,V.jsxs)(`dl`,{"data-slot":`project-facts`,className:`grid grid-cols-1 gap-4 text-[13px] sm:grid-cols-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Project`}),(0,V.jsx)(`dd`,{className:`mt-1 font-medium`,children:e.name})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Branch`}),(0,V.jsx)(`dd`,{className:`mt-1 break-all`,children:e.branch??`—`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Status`}),(0,V.jsxs)(`dd`,{"data-slot":`project-general-status`,className:e.status===`missing`?`mt-1 text-danger`:`mt-1`,children:[de[e.status],e.status===`missing`?` — remove it below, or restore the folder`:null]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Added`}),(0,V.jsxs)(`dd`,{className:`mt-1`,children:[X(e.addedAt),(0,V.jsx)(`span`,{className:`text-soft-foreground`,children:e.source===`checkout`?` · cloned from GitHub`:` · opened locally`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last opened`}),(0,V.jsx)(`dd`,{className:`mt-1`,children:X(e.lastOpenedAt)})]})]})}function Z({project:e,bootProject:t}){let[n,r]=(0,F.useState)(null),i=le(),a=g(),o=e.id===t;return(0,V.jsxs)(P,{title:`Remove from workspace`,hint:`Unregisters this project so it leaves the sidebar and the project list. Nothing on disk is deleted — the folder, its git history and its task history all stay, and opening it again re-registers it.`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,"data-action":`project-general-remove`,"aria-label":`Remove ${e.name} from the workspace — unregisters it, no files are deleted`,title:o?`Squawk is serving this project — it re-registers itself at every start`:void 0,disabled:o||i.isPending,onClick:()=>r(e),className:`text-danger`,children:[`Remove `,e.name]}),o?(0,V.jsx)(`span`,{"data-slot":`project-general-remove-boot`,className:`text-xs text-soft-foreground`,children:`Squawk is serving this project — it re-registers itself at every start.`}):null]}),(0,V.jsx)(ue,{project:n,onOpenChange:e=>!e&&r(null),onConfirm:()=>{r(null),i.confirm(e,()=>void a(`/p/${encodeURIComponent(t)}`))}})]})}function Ce(e){return e===`global`?{Link:h,NavLink:_}:{Link:D,NavLink:T}}function Q({scope:e,title:t,mobileTitle:n,description:r}){let i=ie().name,a=e===`global`?`every project`:i??`this project`;return{headerSlot:`settings-main-header`,title:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`md:hidden`,children:n}),(0,V.jsxs)(`span`,{className:`max-md:hidden`,children:[t,` `,(0,V.jsxs)(`span`,{"data-slot":`page-header-scope`,className:`font-normal text-soft-foreground`,children:[`· `,a]})]})]}),subtitle:r,hideSubtitleOnMobile:!0,headerExtra:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{"data-slot":`settings-mobile-scope`,className:`mt-1 text-[13px] text-muted-foreground md:hidden`,children:e===`global`?`Applies to every project`:a}),e===`global`?(0,V.jsx)(`span`,{"data-slot":`settings-scope-chip`,className:`sr-only`,children:`Global settings`}):null]})}}function $({scope:e,activeId:t}){let{NavLink:n}=Ce(e),r=A(e);return(0,V.jsxs)(`details`,{className:`settings-section-picker md:hidden`,children:[(0,V.jsxs)(`summary`,{children:[r.find(e=>e.id===t)?.title??`General`,(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`})]}),(0,V.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav-mobile`,"data-scope":e,children:[e===`project`?(0,V.jsx)(n,{to:`/settings`,end:!0,"data-slot":`settings-nav-index`,children:`General`}):null,r.map(t=>(0,V.jsx)(n,{to:N(e,t.id),"data-section":t.id,children:t.title},t.id))]})]},`${e}-${t}`)}function we({section:e,scope:t}){let n=e.component,r=Q({scope:t,title:e.title,description:e.description,mobileTitle:t===`global`?`Global settings`:`Project settings`});return(0,V.jsx)(e.id===`agent-config`?ne:O,{route:t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,density:`full`,className:`settings-route`,header:r,children:(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsxs)(`div`,{"data-slot":`settings-mobile-section`,className:`flex flex-col gap-2 md:hidden`,children:[(0,V.jsx)($,{scope:t,activeId:e.id}),e.description?(0,V.jsx)(`p`,{"data-slot":`settings-mobile-section-subtitle`,className:`px-1 text-[13px] leading-normal text-muted-foreground`,children:e.description}):null]}),(0,V.jsxs)(`section`,{className:`settings-panel min-w-0 self-start md:flex-1`,"aria-label":e.title,children:[(0,V.jsx)(`h2`,{className:`settings-panel-title sr-only`,children:e.title}),(0,V.jsx)(n,{})]})]})})}function Te(){return(0,V.jsx)(O,{route:`settings`,density:`full`,className:`settings-route`,header:Q({scope:`project`,title:`General`,mobileTitle:`Project settings`}),children:(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsx)($,{scope:`project`,activeId:null}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,V.jsx)(xe,{}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(ce,{})}),(0,V.jsx)(`h2`,{className:`settings-other-title mt-6 rounded-t-lg border border-b-0 border-border bg-card px-5 pt-5 text-base font-semibold md:hidden`,children:`Other project settings`}),(0,V.jsx)(`ul`,{"data-slot":`settings-index`,className:`mt-7 flex w-full flex-col gap-5 md:hidden`,children:A(`project`).map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(D,{to:N(`project`,e.id),"data-section":e.id,className:`flex items-center gap-3.5 rounded-lg border border-border bg-card p-4 transition-colors hover:bg-card-2`,children:[(0,V.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center text-accent-text`,children:(0,V.jsx)(e.icon,{"aria-hidden":`true`,className:`size-4`})}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,V.jsx)(`span`,{className:`block text-xs text-soft-foreground`,children:e.description})]}),(0,V.jsx)(y,{"aria-hidden":`true`,className:`size-4 shrink-0 text-soft-foreground`})]})},e.id))}),(0,V.jsxs)(`p`,{className:`mt-5 w-full text-[12px] text-soft-foreground`,children:[`Appearance, notifications, host resources and the project registry live in`,` `,(0,V.jsx)(h,{to:j,"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})]})]})})}export{Te as SettingsIndexRoute,we as SettingsSectionRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.settings-panel{border:1px solid var(--border);background:var(--card);border-radius:12px;width:100%;padding:24px}.settings-panel>[data-slot]{width:100%;max-width:none;margin:0;padding:0}.settings-panel .settings-field+.settings-field{border-block-start:1px solid var(--border);padding-block-start:22px}.settings-panel .settings-field h2{font-size:14px;font-weight:400}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])){background:var(--background);min-width:0;max-width:100%;min-height:44px;box-shadow:none;font-size:13px}.settings-panel .settings-field>:is(input,select,textarea:not([data-slot=code-editor-input])),.settings-panel .settings-field>.settings-select,.settings-panel .settings-field>.settings-select>select,.settings-panel [data-slot=agents-default-runner],.settings-panel [data-slot=projects-browse-root],.settings-panel [data-slot=projects-checkout-root]{width:100%;max-width:none}.settings-panel button:not([role=switch]):not([data-slot=project-tag-suggestion]){min-height:40px}.settings-panel [data-slot=resources-composer-defaults]{grid-template-columns:1fr;gap:24px}.settings-panel [data-slot=prompt-template-row]{border:1px solid var(--border);background:0 0;border-radius:8px;gap:6px;margin-block-end:0;padding:12px 14px}.settings-panel [data-slot=prompt-template-new]{border:0;border-block-end:1px solid var(--border);border-radius:0;gap:12px;padding-block:20px;padding-inline:0}.settings-panel [data-slot=agent-config-agents]{background:color-mix(in oklch, var(--muted) 60%, transparent);border:1px solid var(--border);border-radius:8px;gap:4px;width:fit-content;max-width:100%;padding:4px}.settings-panel [data-slot=agent-config-agent]{border:1px solid #0000}.settings-panel [data-slot=agent-config-agent][aria-selected=true]{background:var(--card);border-color:var(--border);color:var(--foreground);box-shadow:var(--shadow-xs)}.settings-panel [data-slot=projects-section] table{display:block}.settings-panel [data-slot=projects-section] :is(tbody,tr){min-width:0;display:grid}.settings-panel [data-slot=projects-section] thead{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}.settings-panel [data-slot=projects-section] colgroup{display:none}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]){gap:8px;padding-block:16px;padding-inline:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>:is(th,td){text-align:start;width:100%;min-width:0;max-width:none;padding-block:0;padding-inline:12px;display:block}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]) .truncate{white-space:normal;overflow-wrap:anywhere}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]) td:last-child{border-block-start:1px solid var(--border);padding-block-start:12px}:is(.settings-panel .settings-field:has([data-slot=resources-auto-resume]),.settings-panel .settings-field:has([data-slot=resources-monitoring-wake-mode])){position:relative}:is(.settings-panel .settings-field:has([data-slot=resources-auto-resume])>div:first-child,.settings-panel .settings-field:has([data-slot=resources-monitoring-wake-mode])>div:first-child){padding-inline-end:60px}.settings-panel [data-slot=resources-auto-resume],.settings-panel [data-slot=resources-monitoring-wake-mode]{position:absolute;inset-block-start:24px;inset-inline-end:0}.settings-panel [data-slot=agent-config-group] ul{flex-direction:column;gap:6px}.settings-panel [data-slot=agent-config-file]{border:1px solid var(--border);width:100%;color:var(--foreground);padding-block:10px;padding-inline:12px}.settings-panel [data-slot=agent-config-file][data-selected=true]{border-color:var(--accent-strong);color:var(--accent-text)}.settings-route-body{gap:24px;width:100%;max-width:56rem;padding-block:0;padding-inline:0}.settings-route[data-route=settings-agent-config] .settings-route-body{max-width:none}.settings-section-picker{border:1px solid var(--border);background:var(--card);border-radius:8px;width:100%;position:relative}.settings-section-picker summary{cursor:pointer;justify-content:space-between;align-items:center;min-height:48px;padding-block:12px;padding-inline:14px;font-size:14px;list-style:none;display:flex}.settings-section-picker summary::-webkit-details-marker{display:none}.settings-section-picker nav{border-block-start:1px solid var(--border);padding:4px;display:grid}.settings-section-picker nav a{border-radius:6px;padding:12px;font-size:13px}.settings-section-picker nav a[aria-current=page]{background:color-mix(in oklch, var(--accent-strong) 12%, transparent);color:var(--accent-text)}.settings-panel{border-radius:10px}.settings-panel h3,.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2{font-weight:400}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2+p{margin-block-start:8px;line-height:1.6}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) [role=switch]{margin-block-start:8px}.settings-panel [data-slot=appearance-section]{border:0;border-radius:0}.settings-panel [data-slot=appearance-section]>section{gap:12px}.settings-panel [data-slot=appearance-section]>section+section{border-block-start:1px solid var(--border);padding-block-start:24px}.settings-panel [data-slot=appearance-section] h2{font-size:14px;font-weight:400}.settings-panel [data-slot=appearance-section] h2+p{margin-block-start:8px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{gap:4px}.settings-panel [data-slot=appearance-section] [role=radio]{border-radius:6px;padding-block:8px;padding-inline:14px;font-weight:400}.settings-panel [data-slot=notifications-permission]{margin-block:20px;margin-inline:0}.settings-panel [data-slot=notifications-permission][data-permission=denied]{color:var(--danger)}.settings-panel .settings-readout{border:1px solid var(--border);background:var(--background);overflow-wrap:anywhere;border-radius:6px;padding:12px;font-size:13px;line-height:1.6}.settings-panel .settings-disclosure{border-block-start:1px solid var(--border);color:var(--muted-foreground);padding-block-start:16px;font-size:12px}.settings-panel .settings-disclosure summary{cursor:pointer;padding-block:4px;padding-inline:0}.settings-panel .settings-disclosure>:not(summary){margin-block-start:12px}.settings-panel [data-slot=agent-defaults-section]{gap:20px}.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:20px}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}.settings-panel [data-slot=agents-task-runs]>h2{font-size:14px;font-weight:400}.settings-panel .settings-option-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.settings-panel .settings-option-row>div:first-child{flex:1;min-width:0}.settings-panel .settings-option-row h3{font-size:14px;font-weight:400}.settings-panel .settings-option-row p{margin-block-start:8px;line-height:1.6}.settings-panel .settings-option-row label{flex-shrink:0}.settings-panel .settings-option-row label>span{display:none}.settings-panel .settings-form-actions{border-block-start:1px solid var(--border);flex-wrap:wrap;gap:12px;padding-block-start:20px;display:flex}@media (width<=767px){.settings-route-body{gap:20px;max-width:none}.settings-panel{padding:16px}.settings-panel button:not([role=switch]):not([data-slot=project-tag-suggestion]):not([data-slot=prompt-template-skill-chip]){min-height:44px}.settings-panel [data-slot=agent-config-agents]{flex-wrap:wrap}.settings-panel [data-slot=agent-config-group] li{max-width:100%}.settings-panel [data-slot=appearance-section] [role=radiogroup]{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;display:grid}.settings-panel [data-slot=appearance-section] [role=radiogroup][data-slot=appearance-width]{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-panel [data-slot=appearance-section] [role=radio]{white-space:nowrap;justify-content:center;padding-inline:8px;font-size:12px}.settings-panel [data-slot=appearance-section] [role=radiogroup][data-slot=appearance-density]{grid-template-columns:repeat(3,auto);gap:4px}.settings-panel [data-slot=appearance-section] [data-slot=appearance-density] [role=radio]{padding-inline:10px}.settings-panel .settings-resource-controls{align-items:stretch}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}}.settings-panel .settings-retention-controls input{width:100%}.settings-panel .settings-retention-controls>span{display:none}.settings-panel .settings-appearance-preview{padding:20px}.settings-panel [data-slot=appearance-theme] svg,.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>h2{display:none}.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>p{margin-block-start:0}.settings-panel [data-slot=prompt-template-row]>label,.settings-panel [data-slot=prompt-template-row]>p,.settings-panel [data-slot=prompt-template-new]>label:not(:first-of-type){margin-block-start:6px}.settings-panel [data-slot=prompt-template-row] textarea{min-height:44px}.settings-panel [data-slot=prompt-template-skill-chip]{border:1px solid var(--border);background:var(--muted);border-radius:6px;min-height:28px;padding-block:2px;padding-inline:8px;font-size:12px}.settings-panel [data-slot=prompt-template-skill-chip]:hover{background:color-mix(in oklch, var(--danger) 10%, transparent);color:var(--danger)}.settings-panel [data-slot=prompt-template-skills-trigger]{border-radius:6px}.settings-panel [data-slot=accounts-defaults]{margin-block-start:8px}.settings-panel [data-slot=accounts-defaults] select{max-width:none}.settings-panel [data-slot=account-details]{background:var(--background)}.settings-route [data-slot=project-general]{gap:20px}.settings-route [data-slot=project-general]>section{border-radius:10px;padding:20px}.settings-route [data-slot=project-general] [data-slot=project-facts]{border-block-end:1px solid var(--border);padding-block-end:16px}:is(.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-browse-root])>div:nth-child(2),.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-checkout-root])>div:nth-child(2)){flex-wrap:wrap;row-gap:8px}.settings-panel [data-slot=settings-save-row]{align-items:center}.settings-panel [data-slot=settings-save-row]>*{margin:0}.settings-panel [data-slot=projects-section] .overflow-x-auto{border:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>:is(th,td){padding-inline:0}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>th{font-size:14px}@media (width<=767px){.settings-panel [data-slot=accounts-defaults] label{flex-direction:column;align-items:stretch}.settings-panel [data-slot=accounts-defaults] label>span{width:auto}.settings-route [data-slot=project-general]>section{padding:16px}}.settings-agent-picker{border:1px solid var(--border);background:var(--background);border-radius:6px;min-width:0}.settings-agent-picker summary{cursor:pointer;align-items:center;gap:10px;min-height:44px;padding-block:10px;padding-inline:12px;font-size:13px;list-style:none;display:flex}.settings-agent-picker summary::-webkit-details-marker{display:none}.settings-agent-picker [data-slot=agents-runner]{border:0;border-block-start:1px solid var(--border);flex-direction:column;width:100%;max-width:none;padding:4px;display:flex}.settings-agent-picker [role=radio]{white-space:normal;font-family:inherit}.settings-panel [data-slot=settings-config-editor]>[data-slot=agent-config-editor-frame]{margin-block-start:8px}@media (width<=767px){.settings-route[data-route=settings] [data-slot=settings-index]{border:1px solid var(--border);background:var(--card);border-block-start:0;border-radius:0 0 10px 10px;gap:0;margin-block-start:0;padding-block:12px;padding-inline:16px}.settings-route[data-route=settings] [data-slot=settings-index] a{border:0;border-radius:0;padding-block:16px;padding-inline:0}.settings-route[data-route=settings] [data-slot=settings-index] a>span:first-child,.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span+span{display:none}.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span:first-child{color:var(--muted-foreground);font-size:13px;font-weight:400}.settings-panel .settings-resource-controls input{flex-basis:100%}.settings-panel [data-slot=resources-composer-defaults] :is(.settings-select,select){width:100%}}.settings-model-control{position:relative}.settings-model-control>svg{pointer-events:none;position:absolute;inset-block-start:50%;inset-inline-start:12px;transform:translateY(-50%)}.settings-panel .settings-model-control :is(select,output){padding-inline-start:36px}.settings-route [data-slot=button]{border-radius:8px;font-weight:400}.settings-panel [data-slot=button]{padding-inline:16px}.settings-route [data-slot=switch-thumb]{background:#fff}.settings-panel .settings-form-actions [data-variant=primary]{order:1}.settings-panel .settings-form-actions>span{order:2}.settings-panel [data-slot=settings-config-editor]{gap:12px}.settings-config-toolbar{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.settings-config-file-row{flex-wrap:wrap;gap:10px;display:flex}.settings-config-file-row button{border:1px solid var(--border);background:var(--card);border-radius:8px;padding-block:10px;padding-inline:16px;font-size:12px;font-weight:400}.settings-config-file-row button[aria-pressed=true]{background:var(--card);color:var(--foreground);border-color:var(--border);box-shadow:var(--shadow-xs);font-weight:500}.settings-config-agent-choice{color:var(--muted-foreground);align-items:center;gap:8px;margin-inline-start:auto;font-size:12px;display:flex}.settings-panel .settings-config-agent-choice select{border:1px solid var(--border);border-radius:6px;min-height:36px;padding-block:6px;padding-inline:10px}.settings-config-content-heading{border-block-start:1px solid var(--border);margin-block-start:8px;padding-block-start:20px}.settings-config-content-heading h3{font-size:14px}.settings-config-content-heading p{color:var(--muted-foreground);margin-block-start:8px;font-size:12px}.settings-config-save-help{color:var(--muted-foreground);gap:8px;padding-block-start:8px;font-size:12px;display:grid}.settings-config-scopes{border-block-start:1px solid var(--border);gap:12px;padding-block-start:24px;display:grid}.settings-config-scopes h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]{background:0 0;border:0;gap:12px;margin-block-start:12px;padding:0}.settings-panel [data-slot=accounts-defaults]>div:first-child>h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]>div:first-child>p{margin-block-start:8px;font-size:12px}.settings-account-models{background:var(--background);border:1px solid var(--border);border-radius:8px;padding:14px}.settings-panel .settings-account-model{background:var(--background);border:1px solid var(--border);border-radius:8px;padding-block:10px;padding-inline:12px;position:relative}.settings-panel .settings-account-model select{min-height:24px;box-shadow:none;background:0 0;border:0;padding:0 36px 0 0;font-size:13px}@media (width<=767px){.settings-config-agent-choice{margin-inline-start:0}.settings-config-file-row{gap:8px}.settings-config-file-row button{padding-inline:12px}.settings-panel [data-slot=accounts-defaults] .settings-account-model{flex-flow:wrap;align-items:center}.settings-panel .settings-account-model select{flex:1;min-width:100px}}.settings-panel [data-slot=agent-config-path]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.settings-config-scopes [data-slot=agent-config-nav]{grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:20px;display:grid}.settings-config-scopes [data-slot=agent-config-file]{padding:8px;font-size:12px}.settings-panel [data-slot=accounts-defaults] .settings-model-agent-choice{color:var(--muted-foreground);flex-direction:row;align-items:center;gap:8px;font-size:12px;display:flex}.settings-panel .settings-model-agent-choice select{width:16rem;max-width:100%}.settings-config-scopes [data-slot=agent-config-group]>ul>li{width:100%;min-width:0}.settings-config-scopes [data-slot=agent-config-file]{min-width:0;max-width:100%}.settings-panel [data-slot=settings-config-editor] [data-slot=code-editor]{background:var(--background)}.settings-panel select{appearance:none;border:1px solid var(--border);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-position:right 12px center;background-repeat:no-repeat;border-radius:8px;padding-inline:12px 36px}.settings-panel .settings-select>select{background-image:none}.settings-panel .settings-option-row{align-items:center}.settings-panel .settings-option-row :is(select,output){width:16rem;min-width:0;max-width:100%}.settings-panel .settings-field>select{width:16rem;max-width:100%}.settings-panel .settings-field>.settings-select:has(>select:is([data-slot=resources-max-parallel],[data-slot=resources-max-monitoring])){width:8rem}.settings-panel .settings-resource-controls input[data-slot=resources-memory-limit],.settings-panel .settings-resource-controls input[data-slot=resources-monitoring-wake-interval]{flex:none;width:9rem}.settings-panel [data-slot=resources-composer-defaults] select{width:16rem;max-width:100%}.settings-panel [data-slot=archive-on-merge-field]>div:first-child>label{font-size:14px;font-weight:400}.settings-panel [data-slot=archive-on-merge-field]>div:first-child>label+p{margin-block-start:4px;line-height:1.6}.settings-panel .settings-agent-card{gap:0;padding:0;scroll-margin-block-start:16px}.settings-agent-head{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 16px;padding:12px 16px;display:flex}.settings-agent-heading{flex-wrap:wrap;flex:18rem;align-items:baseline;gap:2px 12px;min-width:0;display:flex}.settings-panel .settings-account-provider-title{color:var(--foreground);font-size:14px;font-weight:600}.settings-agent-summary{min-width:0;color:var(--muted-foreground);flex-wrap:wrap;align-items:center;gap:2px 0;font-size:12px;line-height:1.5;display:flex}.settings-agent-summary-item{overflow-wrap:anywhere;align-items:center;min-width:0;display:inline-flex}.settings-agent-summary-sep{color:var(--soft-foreground);padding-inline:6px}.settings-account-actions{flex-flow:wrap;align-items:center;gap:8px;display:flex}.settings-panel .settings-agent-card .settings-account-actions button:not([data-slot=account-rename-input]){min-height:32px;padding-inline:12px;font-size:12px}.settings-agent-accounts{flex-direction:column;display:flex}.settings-account-meta{border-block-start:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 16px;margin-inline:16px;padding-block:8px 10px;display:flex}.settings-account-readout{flex-direction:column;align-items:flex-start;gap:2px;min-width:0;display:flex}.settings-account-meta-line{min-width:0;color:var(--muted-foreground);flex-wrap:wrap;align-items:center;gap:2px 12px;font-size:12px;display:flex}.settings-account-label{color:var(--foreground);font-size:13px;font-weight:500}.settings-account-path{font-family:var(--font-mono);color:color-mix(in oklch, var(--foreground) 80%, transparent);overflow-wrap:anywhere;font-size:12px;line-height:1.5}.settings-account-hint{color:var(--muted-foreground);font-size:12px;line-height:1.5}.settings-account-line{border-block-start:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 16px;margin-inline:16px;padding-block:8px 10px;display:flex}.settings-agent-note{border-block-start:1px solid var(--border);color:var(--muted-foreground);margin-inline:16px;padding-block:8px 10px;font-size:12px;line-height:1.5}.settings-agent-card>section[aria-label=CLI\ installation]{border-block-start:1px solid var(--border);margin-inline:16px;padding-block:8px 10px}.settings-account-management{display:contents}.settings-account-management>span{color:var(--muted-foreground);flex-basis:100%;font-size:12px}.settings-account-management [data-slot=account-rename-input]{min-width:0;max-width:100%}@media (width<=767px){.settings-agent-head{padding:12px}.settings-account-meta,.settings-account-line,.settings-agent-note,.settings-agent-card>section[aria-label=CLI\ installation]{margin-inline:12px}.settings-panel .settings-agent-card .settings-account-actions button:not([data-slot=account-rename-input]){min-height:44px}}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])),.settings-panel [data-slot=code-editor]{border-color:var(--border)}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input])):focus-visible{border-color:var(--ring)}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),select,textarea:not([data-slot=code-editor-input]))[aria-invalid=true]{border-color:var(--destructive)}.settings-panel [data-slot=code-editor]:focus-within{border-color:var(--ring)}.settings-panel :is(input,textarea)::placeholder{color:var(--soft-foreground);opacity:1}.settings-panel .settings-form-actions [data-variant=outline]:disabled{opacity:1;color:var(--muted-foreground);background:0 0}@media (width>=768px){.settings-panel{padding:20px 24px}}.settings-panel>:is([data-slot=agent-defaults-section],[data-slot=worktrees-section],[data-slot=projects-section],[data-slot=accounts-section]){gap:16px}.settings-panel .settings-field{gap:10px}.settings-panel .settings-field+.settings-field,.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:18px}.settings-panel .settings-field h2+p{margin-block-start:4px;line-height:1.55}.settings-panel [data-slot=agents-task-runs]{gap:16px}.settings-panel [data-slot=agent-cards]{gap:12px}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row]){gap:6px;padding-block:12px}.settings-panel :is([data-slot=project-row],[data-slot=worktree-row])>td:last-child{margin-block-start:4px;padding-block-start:12px}.settings-panel .settings-form-actions{padding-block-start:16px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{background:color-mix(in oklch, var(--muted) 60%, transparent)}.settings-panel [data-slot=appearance-section] [role=radio][aria-checked=true]{background:var(--card);border-color:var(--border);color:var(--foreground);box-shadow:var(--shadow-xs);font-weight:500}.settings-panel .settings-select:has(>select[data-slot=project-max-parallel]){width:15rem;max-width:100%}@media (width<=767px){.settings-panel .settings-select:has(>select[data-slot=project-max-parallel]){width:100%}}@media (width<48rem),(any-pointer:coarse){[data-slot=agent-config-placeholder]{font-size:max(16px,1rem)}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{B as i,F as a,N as o,Y as s,et as c}from"./queries-ClkIgWFx.js";import{Fn as l,ft as u,nt as d}from"./toaster-C-xqAWVX.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as g,T as _,X as v,Y as y,ot as b,u as x}from"./design-icons-CzEoMH9c.js";import{t as S}from"./createLucideIcon-BHp8sXmF.js";import{n as C,t as w}from"./run-header-CZjnjsNk.js";import{a as T,i as E,n as D,o as O,r as k}from"./file-preview-v5_F5k3C.js";import{t as A}from"./button-B7MKxYjT.js";import{c as j}from"./page-shell-7pLJMOgh.js";import{t as M}from"./centered-state-V15AR_qo.js";import{S as N,Vn as P,Xn as F,x as I}from"./index-7M_Uae0m.js";import{r as L}from"./markdown-nyVMLqM-.js";var R=S(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),z=S(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),B=e(t(),1),V=n();function H({runId:e,path:t,artifactId:n,worktreePath:r}){let a=i(e,n?null:t),s=o(e,n),c=n?s:a,l=(0,B.useContext)(L),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=c.data,g=(0,B.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...l,basePath:h.path}:null,[h,l,e]);if(!t&&!n)return(0,V.jsx)(k,{runId:e,path:null,className:`min-w-0 flex-1`});if(c.isPending)return(0,V.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(c.isError)return(0,V.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,V.jsx)(`h2`,{children:`Could not load this file`}),(0,V.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:c.error.message}),(0,V.jsx)(A,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});if(!h)return(0,V.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=E(h.path,r,t);if(h.type!==`file`)return(0,V.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,V.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,V.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,V.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,V.jsx)(A,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});let v=h.artifact;return(0,V.jsx)(L.Provider,{value:g,children:(0,V.jsx)(D,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:m,className:`min-w-0 flex-1`,imageUrl:v?d(e,v.id,`image`):u(e,t),...v?{downloadUrl:d(e,v.id,`download`),snapshot:new Date(v.createdAt).toLocaleString()}:{}},v?.id??h.path)})}var U=new Map;function W(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var G=(0,B.createContext)(null);function K(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,B.useState)({key:e,generation:0});if(n.key===e)return n.generation;let i={key:e,generation:t?n.generation+1:n.generation};return r(i),i.generation}var q=()=>document.querySelector(`[data-slot="main"]`);function J(e,t){let n=(0,B.useRef)(null),r=f(),i=h()===`POP`?r.key:W(r.state),[a]=(0,B.useState)(()=>{let t=i?U.get(i):void 0;return t?.runId===e?t:null}),o=(0,B.useRef)(new Set(a?.folders??[])),s=(0,B.useRef)(new Set),[c,l]=(0,B.useState)(0),u=(0,B.useRef)(a===null),d=(0,B.useCallback)(()=>{u.current&&U.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:q()?.scrollTop??0})},[r.key,e]),p=(0,B.useMemo)(()=>({isOpen:e=>o.current.has(e),setOpen:(e,t)=>{t?o.current.add(e):o.current.delete(e),d()},loading:(e,t)=>{a?.folders.has(e)&&(t?s.current.add(e):s.current.delete(e),l(s.current.size))}}),[a,d]);return(0,B.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=q();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,B.useEffect)(()=>{d();let e=[n.current,q()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,d,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,d)}},[d]),{tree:n,folders:p}}function Y({runId:e,selected:t,onSelect:n}){return(0,V.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,V.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,V.jsx)(X,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function X({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=c(e,t),o=(0,B.useContext)(G);return(0,B.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,V.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,V.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,V.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,V.jsx)(V.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,V.jsx)(Z,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,V.jsx)(Q,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function Z({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,B.useContext)(G),[c,l]=(0,B.useState)(()=>s?.isOpen(n)??!1);return(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>{s?.setOpen(n,!c),l(!c)},className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+i*14}px`},children:[(0,V.jsx)(x,{size:16,"aria-hidden":`true`,className:r(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,V.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,V.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,V.jsx)(X,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function Q({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=O(t)?z:g;return(0,V.jsx)(`li`,{children:(0,V.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>o(t),className:r(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+i*14}px`},children:[(0,V.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,V.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:T(n)})]})})}function $(){let{id:e}=m(),t=s(e),n=K();return t.isPending?(0,V.jsx)(N,{tab:`files`}):t.isError?(0,V.jsx)(I,{tab:`files`,error:t.error}):(0,V.jsx)(C,{runId:t.data.id,children:(0,V.jsx)(te,{run:t.data},`${t.data.id}:${n}`)})}function ee(e,t,n,r){let a=i(e,r||n!==null?null:t),s=o(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?a:s).isPending}function te({run:e}){let t=c(e.id,``),n=a(e.id),[r,i]=p(),o=r.get(`path`),s=r.get(`artifact`),u=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&s!==null,[d,f]=(0,B.useState)(o??``);(0,B.useEffect)(()=>f(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),i(n)},h=t.isError&&t.error instanceof l&&t.error.status===409,g=ee(e.id,o,s,u),_=J(e.id,!t.isPending&&g);return(0,V.jsxs)(j,{route:`task-files`,density:ne(t.isError),flushPadding:!0,children:[(0,V.jsx)(w,{run:e,tab:`files`}),(0,V.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),d.trim()&&m(`path`,d.trim())},children:[(0,V.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,V.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,V.jsx)(P,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:d,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,V.jsx)(A,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!d.trim(),children:`Open file`})]}),(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,V.jsxs)(`aside`,{ref:_.tree,"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,V.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,V.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,V.jsx)(M,{icon:h?(0,V.jsx)(R,{}):(0,V.jsx)(b,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,V.jsx)(G.Provider,{value:_.folders,children:(0,V.jsx)(Y,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,V.jsx)(re,{artifacts:n,artifactId:s,onSelect:e=>m(`artifact`,e)})]}),u?(0,V.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||s!==null||t.isSuccess?(0,V.jsx)(H,{runId:e.id,path:o,artifactId:s,worktreePath:e.worktreePath}):null]}),(0,V.jsx)(`p`,{className:`px-4 pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}function ne(e){return e?`empty`:`full`}function re({artifacts:e,artifactId:t,onSelect:n}){return(0,V.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,V.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,V.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,V.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,V.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===t?`true`:void 0,className:`group flex min-h-11 w-full items-center gap-2 rounded px-2 py-2 text-left text-xs text-foreground hover:bg-muted focus-visible:ring-2 aria-[current=true]:bg-muted aria-[current=true]:font-medium`,onClick:()=>n(e.id),children:[(0,V.jsx)(F,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,V.jsx)(x,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,V.jsxs)(A,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2 max-md:h-11 no-hover:h-11`,onClick:()=>void e.refetch(),children:[(0,V.jsx)(y,{"aria-hidden":`true`}),`Refresh published files`]})]})}export{$ as TaskFilesRoute};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{n as i,t as a}from"./utils-DSMR_WLb.js";import{G as o,J as s,R as c,Ut as l,V as u,Wt as d,Xt as f,Y as p,_ as m,dn as h,dt as g,ln as _,lt as v,nt as y,ot as b,rn as x,rt as S,sn as ee,un as C,xt as w,yt as T,z as E}from"./queries-ClkIgWFx.js";import{$r as D,An as O,At as te,Fn as k,Nn as A,Pn as j,Qn as M,Xn as N,Yn as P,Zn as ne,ei as F,hi as I,ii as L,it as R,lt as z,n as B,ot as V,rt as H,tr as U,vr as re,yr as ie}from"./toaster-C-xqAWVX.js";import{f as ae,h as W,n as oe}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{d as se,m as ce,r as le,s as ue,v as de}from"./tasks-table-BkjZYg2J.js";import{A as fe,B as pe,a as me,f as he,g as G,h as ge,it as _e,k as ve,l as ye,m as K,n as be,ot as xe,p as Se,s as Ce,u as we,ut as Te,y as Ee,z as De}from"./design-icons-CzEoMH9c.js";import{t as Oe}from"./createLucideIcon-BHp8sXmF.js";import{A as ke,B as Ae,C as je,D as Me,E as Ne,F as Pe,H as Fe,I as Ie,L as Le,M as Re,N as ze,O as Be,P as Ve,R as He,S as Ue,T as We,V as Ge,_ as Ke,a as qe,b as Je,c as Ye,d as Xe,f as Ze,g as Qe,h as $e,i as et,j as tt,k as nt,l as rt,m as it,n as at,o as ot,p as st,r as ct,s as lt,t as ut,u as dt,v as ft,w as pt,x as mt,y as ht,z as gt}from"./review-panel-DV9yD5Zl.js";import{a as _t,c as vt,i as yt,n as bt,o as xt,r as St,s as Ct,t as wt}from"./run-header-CZjnjsNk.js";import{t as Tt}from"./loader-circle-CPBhhDbB.js";import{a as Et}from"./tool-display-B9NN44oU.js";import{i as Dt,l as Ot,o as kt,t as At}from"./reference-chip-bAUYx-Fl.js";import{a as jt,i as Mt,n as Nt,o as Pt,r as Ft,t as It}from"./thread-state-C8v4gnTh.js";import{t as q}from"./button-B7MKxYjT.js";import{n as Lt,r as Rt,t as zt}from"./collapsible-BEV4FO-1.js";import{a as Bt}from"./popover-BPgUYFyu.js";import{s as Vt,t as Ht}from"./project-router-CT6gVIcC.js";import"./attention--Y0CyzCN.js";import{D as Ut,E as Wt,O as Gt,S as Kt,b as qt,f as J,u as Jt,w as Yt,x as Xt}from"./task-groups-aquji1Kv.js";import{t as Zt}from"./status-dot-BRzVlF2X.js";import{c as Qt,i as $t,l as en,o as tn,r as nn,s as rn,t as an}from"./report-selection-D9xJZoKb.js";import{c as on}from"./page-shell-7pLJMOgh.js";import{t as sn}from"./centered-state-V15AR_qo.js";import{$t as cn,A as ln,H as un,M as dn,N as fn,Tn as pn,U as mn,W as hn,Zt as gn,_n,cn as vn,dn as yn,hn as bn,i as xn,j as Sn,k as Cn,l as wn,ln as Tn,m as En,mn as Dn,n as On,nn as kn,on as An,q as jn,rn as Mn,s as Nn,sn as Pn,wn as Fn,y as In}from"./index-7M_Uae0m.js";import{t as Ln}from"./markdown-nyVMLqM-.js";import{i as Rn}from"./automation-format-DB34jUyF.js";var zn=Oe(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Bn=Oe(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Y=e(t(),1),X=r(),Vn=12;function Hn({run:e}){let t=I(),n=h({mutationFn:()=>H(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:d.runs.detail(e.id)}),t.invalidateQueries({queryKey:d.runs.list()}),B(`This task will not resume itself`)},onError:e=>B(e.message,{tone:`danger`})});if(!U(e))return null;let r=new Date(e.autoResumeAt);if(!Number.isFinite(r.getTime()))return null;let i=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(r);return(0,X.jsxs)(`div`,{"data-slot":`auto-resume-hint`,role:`status`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(Zt,{tone:`neutral`,shape:`ring`}),e.autoResumeReason===`provider-error`?(0,X.jsxs)(`span`,{title:e.error,children:[`Provider error — this task retries automatically at`,` `,(0,X.jsx)(`time`,{dateTime:e.autoResumeAt,className:`font-medium text-foreground`,children:i}),` `,`(attempt `,(e.autoResumeAttempts??0)+1,` of `,Vn,`)`]}):(0,X.jsxs)(`span`,{children:[`Usage limit reached — this task resumes automatically at`,` `,(0,X.jsx)(`time`,{dateTime:e.autoResumeAt,className:`font-medium text-foreground`,children:i})]}),(0,X.jsx)(`button`,{type:`button`,"data-action":`auto-resume-cancel`,disabled:n.isPending,onClick:()=>n.mutate(),className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground disabled:opacity-50`,children:`Don’t resume`}),(0,X.jsx)(oe,{to:`/settings/global/resources`,"data-slot":`auto-resume-settings-link`,className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground`,children:`Auto-resume settings`})]})}function Un(e,t,n,r,i,a,o,s,c){let l=Gt(e,Mn(e)),u=l?l.model:e.model,d=l?l.effort:e.effort,f=!r&&!n&&u?{...i?.defaultModels,[t]:u}:i?.defaultModels,p=r?null:s,m=Sn(t,o,a,[p,f?.[t]]),h=fn(p,t,o,f,a),g=ln(h,a),_=r?``:c??d??``,v=dn(_,g);return{models:m,model:h,effortOptions:g,effort:v,mustClearStoredEffort:!r&&c===null&&_!==``&&v===``}}function Wn(e,t,n,r){let i=Wt(e.steps),a=Gt(e,Mn(e)),o=a?.agentProfile??e.agentProfile??i?.profileId??`default`;return{sessionStep:i,workerStep:a,account:n?r?.[t]??`default`:o}}function Gn(e,t,n,r,i,a,o,{model:s,effort:c,mustClearStoredEffort:l}){return{text:e.trim()?e:void 0,images:t.length?t:void 0,runner:n,model:!r&&(a!==null||i)?s:void 0,effort:!r&&(o!==null||i)?c:l?``:void 0}}function Kn(e,t,n,r){return!!t&&(r!==Ut(t,e)||(n?.agentProfile??e.agentProfile??t.profileId??`default`)!==(t.profileId??`default`))}function qn({models:e,model:t,effortOptions:n,effort:r}){return{modelLabel:e.find(e=>e.id===t)?.label??`auto`,effortLabel:n.find(e=>e.value===r)?.label??`auto`}}function Jn(e){let t=v(),n=Tn(e).continueRun,r=m(),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(null),u=`${e.id}:${Gt(e,Mn(e))?.id??``}`,[d,p]=(0,Y.useState)(u);d!==u&&(p(u),a(null),s(null),l(null));let g=et(e,i),{runners:_,canContinue:y,currentRunner:b,runner:S}=g,{sessionStep:w,workerStep:E,account:D}=Wn(e,S,S!==b,_n().repoAccount),O=T(),te=O.data?.capabilities?.localHandoff!==!1,A=x(),j=ee(S,n&&!O.isPending&&!A.isPending,te?D:null),M=r.data?.modelsLocked===!0,N=S!==b,P=Un(e,S,N,M,r.data,j.data,A.data,o,c),{models:ne,model:F,effortOptions:I,effort:L}=P,{modelLabel:R,effortLabel:z}=qn(P),B=h({mutationFn:({text:t,images:n})=>y?V(C(e.id),Gn(t,n,g.runnerOverride,M,N,o,c,P)):Promise.reject(Error(g.reason??`Connect an agent provider to continue.`)),onMutate:()=>C(e.id),onSuccess:(e,n,r)=>t.invalidateAfter(`continue`,r),onError:(e,n,r)=>{e instanceof k&&e.status===409&&r&&t.invalidateAfter(`continue`,r)}}),H=e.delegation?.role===`worker`;return{skillRunner:S,skillAccount:D,available:n,canContinue:y,startsNewConversation:Kn(e,w,E,S),reason:g.reason,providerPending:g.providerPending,pills:(0,X.jsx)(Yn,{compact:e.status===`review`,summary:`${f(A.data,S)} · ${R} · ${z}`,children:(0,X.jsxs)(mn,{children:[!H&&(_.length>1||g.signedOut.length>0)?(0,X.jsx)(hn,{icon:(0,X.jsx)(_e,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,runners:_,signedOut:g.signedOut,value:S,onPick:e=>{e!==S&&(a(e),s(null))}}):(0,X.jsx)(un,{icon:(0,X.jsx)(_e,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,readOnly:!0,disabledHint:H?`Owned workers keep their runner; change model or effort instead.`:void 0,slot:`session-runner-value`,ariaLabel:`Runner`,label:S,value:S,onPick:()=>{},options:[{value:S,label:S}]}),(0,X.jsx)(un,{icon:(0,X.jsx)(Ee,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`follow-up-model-pill`,ariaLabel:`Model`,label:R,value:F,readOnly:M,disabledHint:`Model selection is locked to native coding-agent settings.`,onPick:e=>{s(e);let t=ln(e,j.data);L!==``&&dn(L,t)===``&&l(``)},options:ne.map(e=>({value:e.id,label:e.label,desc:e.desc})),status:Cn(S,A.data,j)}),(0,X.jsx)(un,{icon:(0,X.jsx)(ve,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),fieldLabel:!0,slot:`follow-up-effort-pill`,ariaLabel:`Effort`,label:z,value:L,readOnly:M,disabledHint:`Effort selection is locked to native coding-agent settings.`,onPick:e=>l(e),options:I.map(e=>({value:e.value,label:e.label,desc:e.desc}))})]})},u),continueWith:(e,t)=>B.mutateAsync({text:e,images:t})}}function Yn({compact:e,summary:t,children:n}){let[r,i]=(0,Y.useState)(!1),a=(0,Y.useRef)(null),o=e&&!r;return(0,Y.useEffect)(()=>{r&&a.current?.querySelector(`button:not([disabled])`)?.focus()},[r]),(0,X.jsx)(`div`,{ref:a,"data-slot":`follow-up-engine`,"data-folded":o||void 0,className:o?`min-w-0`:`session-engine-controls`,children:o?(0,X.jsxs)(`button`,{type:`button`,"data-slot":`follow-up-engine-summary`,"aria-expanded":!1,"aria-label":`Agent settings: ${t}`,title:`Change the runner, model or effort`,onClick:()=>i(!0),className:`inline-flex min-h-11 max-w-full min-w-0 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[(0,X.jsx)(_e,{"aria-hidden":`true`,className:`size-4 shrink-0 text-accent-text`}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,X.jsx)(ye,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):n})}var Xn=120,Zn=e=>e!==`pending`&&e!==`running`,Qn=e=>e.kind===`tool`&&e.toolKind===`task`,$n=e=>Qn(e)&&e.parentItemId===void 0,er=e=>Le(e.kind)&&!(e.kind===`tool`&&e.toolKind===`plan`);function tr(e){let t=e.input;if(typeof t!=`object`||!t)return;let n=t;for(let e of[`subagent_type`,`subagentType`,`agent`]){let t=n[e];if(typeof t==`string`&&t.trim()!==``)return t.trim()}}function nr(e){if(e.kind===`tool`)return rr(e.title);if(e.kind===`hook`)return rr(`${e.event} hook${e.status===`completed`?``:` ${e.status}`}`);if(e.kind===`message`||e.kind===`reasoning`){let t=e.text.split(`
|
|
2
|
-
`);for(let e=t.length-1;e>=0;--e){let n=t[e].trim();if(n!==``)return rr(n)}}}function rr(e){return e.length>Xn?`${e.slice(0,Xn-1).trimEnd()}…`:e}function ir(e,t=!1,n=e){let r=cr(e,e=>e.items.some($n));if(r===-1)return[];let i=e=>!t&&!Zn(e.status),a=e=>i(e)&&e.background===!0,o=[],s=!1;for(let t=r-1;t>=0;--t){let n=e[t].items.filter($n);n.length!==0&&(!s&&!n.some(i)&&(s=!0),(!s||n.some(a))&&o.unshift(...n))}let c=[...o,...e[r].items.filter($n)];return r!==e.length-1&&!c.some(i)?[]:c.map(r=>ar(r,fr(n,e,r.id),t))}function ar(e,t,n){let r={id:e.id,title:Ie(e.title).detail??e.title,status:e.status,toolCalls:t.filter(e=>e.kind===`tool`).length},i=tr(e);i!==void 0&&(r.agentType=i),n&&!Zn(e.status)&&(r.stalled=!0);for(let e=t.length-1;e>=0;--e){let n=nr(t[e]);if(n!==void 0){r.activity=n;break}}return r}function or(e){return{done:e.filter(e=>e.status===`completed`).length,total:e.length}}function sr(e){return e.activity??(e.stalled===!0?`never finished`:`starting…`)}function cr(e,t){for(let n=e.length-1;n>=0;--n)if(t(e[n]))return n;return-1}function lr(e,t,n=!1,r=e){for(let i=e.length-1;i>=0;--i){let a=e[i].items.find(e=>e.id===t&&$n(e));if(a!==void 0)return ar(a,fr(r,e,t),n)}}function ur(e,t){return cr(e,e=>e.items.some(e=>e.id===t&&$n(e)))}function dr(e,t,n){let r=[];for(let i=n;i<e.length;i+=1){let n=e[i];for(let e of n.items)er(e)&&e.parentItemId===t&&e.id!==t&&r.push({entry:e,seqs:n.itemSeqs?.get(e.id)})}return r}function fr(e,t,n){let r=ur(t,n);if(r===-1)return[];let i=dr(t,n,r);if(e===t)return i.map(({entry:e})=>e);let a=t[r].itemSeqs?.get(n)?.first,o=e=>a===void 0||e.seqs===void 0||e.seqs.first>a,s=new Map;for(let t of dr(e,n,Math.max(ur(e,n),0)))o(t)&&!s.has(t.entry.id)&&s.set(t.entry.id,t);for(let e of i){let t=s.get(e.entry.id);s.set(e.entry.id,t===void 0?e:pr(t,e))}return[...s.values()].sort(mr).map(({entry:e})=>e)}function pr(e,t){return e.seqs===void 0||t.seqs===void 0?e:{entry:(t.seqs.last>e.seqs.last?t:e).entry,seqs:{first:Math.min(e.seqs.first,t.seqs.first),last:Math.max(e.seqs.last,t.seqs.last)}}}function mr(e,t){return e.seqs===void 0||t.seqs===void 0?0:e.seqs.first-t.seqs.first}function hr(e,t){if(e.kind===`entry`){let n=e.entry;return n.kind===`message`&&n.role===`assistant`?[{messageKey:`${t}:${n.id}`,text:n.text}]:[]}return e.kind===`tool-card`?Pe(e.children).flatMap(n=>hr(n,`${t}:${e.id}`)):e.kind===`streak`?e.blocks.flatMap(e=>hr(e,t)):[]}function gr(e){return e.flatMap((e,t)=>e.content.kind===`block`?hr(e.content.block,e.scope).map(n=>({...n,rowKey:e.key,rowIndex:t})):[])}function _r(e,t,n,r){let i=(0,Y.useContext)(an),{projectId:a}=W(),o=(0,Y.useMemo)(()=>gr(t),[t]);(0,Y.useLayoutEffect)(()=>{if(!i)return;let t=[],s={runId:e,...a?{projectId:a}:{}};for(let e of o){let a=Ge(e.text,s);for(let e of a)t.push(i.register(e.artifactId,e.runId));r===`document`&&a.length>0&&t.push(i.registerOpener(e.messageKey,(t,r)=>{let i=Ae(e.messageKey,t);n.jumpToRow(e.rowKey,e.rowIndex,e=>[...e.querySelectorAll(`[id]`)].find(e=>e.id===i)??null,r)}))}return()=>{for(let e of t)e()}},[i,o,e,a,r,n.jumpToRow])}function vr(e){let t=I();return h({mutationFn:t=>z(e,t),retry:!1,networkMode:`always`,onSettled:()=>{t.invalidateQueries({queryKey:d.runs.all})}})}var yr=e=>(window.addEventListener(`online`,e),window.addEventListener(`offline`,e),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,e)}),br=()=>navigator.onLine;function xr({permission:e,runId:t,sessionOpen:n=!1}){return e.status!==`pending`||!n?(0,X.jsx)(Cr,{permission:e,state:e.status===`resolved`?`resolved`:`expired`}):(0,X.jsx)(Sr,{permission:e,runId:t},e.requestId)}function Sr({permission:e,runId:t}){let n=vr(t),r=(0,Y.useSyncExternalStore)(yr,br,()=>!1),i=(0,Y.useRef)(!1),[a,o]=(0,Y.useState)(`pending`),[s,c]=(0,Y.useState)(),[l,u]=(0,Y.useState)(),d=async t=>{if(!(i.current||!r||a!==`pending`)){i.current=!0,o(`sending`),u(void 0);try{await n.mutateAsync({requestId:e.requestId,optionId:t}),c(t),o(`resolved`)}catch(e){e instanceof k&&e.status===409?o(`expired`):(u(e instanceof Error?e.message:String(e)),o(`pending`))}finally{i.current=!1}}};return(0,X.jsx)(Cr,{permission:{...e,...s===void 0?{}:{optionId:s}},state:a,offline:!r,error:l,onSelect:e=>{d(e)}})}function Cr({permission:e,state:t,offline:n=!1,error:r,onSelect:i}){let a=(0,Y.useId)(),o=e.options.find(t=>t.id===e.optionId),s=t!==`pending`||n||!i,c=t===`expired`?`Approval expired. This session can no longer accept a decision.`:t===`resolved`?`Decision sent: ${o?.label??`Recorded`}.`:t===`sending`?`Sending decision…`:n?`Offline. Reconnect to send a decision.`:`Choose an option to respond to this permission request.`;return(0,X.jsxs)(`section`,{"data-slot":`permission-card`,"data-request-id":e.requestId,"data-state":n&&t===`pending`?`offline`:t,"aria-labelledby":a,"aria-busy":t===`sending`,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 text-sm [overflow-wrap:anywhere]`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Permission request`}),(0,X.jsx)(`h3`,{id:a,className:`font-semibold whitespace-pre-wrap`,children:e.title})]}),e.details?(0,X.jsx)(`pre`,{className:`min-w-0 font-mono text-xs leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.details}):null,(0,X.jsx)(`div`,{role:`group`,"aria-labelledby":a,className:`flex min-w-0 flex-col gap-2`,children:e.options.map(t=>(0,X.jsx)(q,{type:`button`,variant:`outline`,disabled:s,"aria-pressed":e.optionId===t.id,className:`h-auto min-h-11 min-w-0 max-w-full justify-start py-2 text-start whitespace-normal [overflow-wrap:anywhere] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,onClick:()=>i?.(t.id),children:t.label},t.id))}),(0,X.jsxs)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:[c,e.reason?` ${e.reason}`:``]}),r&&t===`pending`?(0,X.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:r}):null]})}var wr=(0,Y.createContext)({targets:new Map,replies:new Map,navigate:()=>{}});function Tr(e,t){let n={};for(let e of t??[])n[e.id]=e.currentStepBackend??e.runner;return n[e.id]=e.steps.find(t=>t.id===e.currentStepId)?.backend??e.runner,n}function Er(e,t,n=[]){let r={};for(let e of n)r[e.id]=J(e);for(let e of t??[])r[e.id]=J(e);return r[e.id]=J(e),r}function Dr(e,t){return t?.[e]??`Task`}function Or(e,t,n){return t?n?.[e]??`peer task`:Dr(e,n)}function kr(e,t){return e.senderRunId===t?`outbound`:`inbound`}function Ar(e){return e?.relationship===`peer`}function jr(e){switch(e){case`request`:return`Request`;case`progress`:return`Progress`;case`follow-up`:return`Follow-up`;case`reply`:return`Reply`}}function Mr(e){switch(e){case`pending`:return`Pending`;case`replied`:return`Replied`;case`replied-late`:return`Replied late`;case`timed-out`:return`Timed out`;case`cancelled`:return`Cancelled`;case`completed-without-reply`:return`Completed without reply`;case`failed`:return`Failed`;case`destroyed`:return`Destroyed`;case`sender-closed`:return`Sender closed`;case`human-fallback`:return`Sent to a human`;case`deleted`:return`Recipient deleted`}}function Nr(e){if(e.outcome)return Mr(e.outcome.status);if(e.delivery===`not-delivered`)return Pr(`not-delivered`)}function Pr(e){switch(e){case`queued`:return`Queued`;case`delivered`:return`Delivered`;case`consumed`:return`Read`;case`not-delivered`:return`Not delivered`}}function Fr(e,t){return e.instruction===void 0?e.delivery===`queued`?`${t?`Queued for delivery. This agent can receive messages during its current turn.`:`Queued for delivery. Timing depends on the recipient agent.`} Pending messages are batched within the size limit; human questions and scheduler capacity can delay delivery.`:e.state===`continuation-required`?Ar(e)?`Not delivered. The recipient is not running. Only its human can continue it.`:`Not delivered. The recipient needs a new instruction to resume. A parent can resume its owned worker with ${Dn()} worker resume; workers cannot resume parents.`:e.state===`destroyed`?`Not delivered. This worker was destroyed.`:void 0:e.instruction}function Ir({id:e,peer:t,taskTitles:n,children:r}){return!t||n?.[e]!==void 0?r({title:Dr(e,n),linkable:!0}):(0,X.jsx)(Lr,{id:e,children:r})}function Lr({id:e,children:t}){let n=p(e);return n.data?t({title:J(n.data),linkable:!0}):n.isPending?t({title:`Peer task`,linkable:!1}):t({title:n.error instanceof k&&n.error.status===404?`Deleted task`:`Task unavailable`,linkable:!1})}var Rr={outbound:{classes:`border-message-outbound-border bg-message-outbound-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-outbound-accent`,accent:`text-message-outbound-accent`},inbound:{classes:`border-message-inbound-border bg-message-inbound-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-inbound-accent`,accent:`text-message-inbound-accent`},peer:{classes:`border-message-peer-border bg-message-peer-bg [html:not(.light)_&]:border-s-[3px] [html:not(.light)_&]:border-s-message-peer-accent`,accent:`text-message-peer-accent`}},zr=`inline-flex min-h-11 max-w-full items-center break-words underline underline-offset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`;function Br({block:e,runId:t,taskTitles:n,recipientBackends:r}){return(0,X.jsx)(`div`,{"data-slot":`worker-conversation`,className:`flex min-w-0 flex-col gap-2`,children:e.batches.map(e=>(0,X.jsx)(Vr,{batch:e,runId:t,taskTitles:n,recipientBackends:r},e.id))})}function Vr({batch:e,runId:t,taskTitles:n,recipientBackends:r}){let i=kr(e.messages[0]??{senderRunId:e.senderRunId},t),o=Ar(e.messages[0]),s=Rr[o?`peer`:i],c=Xr(e.messages.map(e=>i===`outbound`?e.recipientRunId:e.senderRunId)),l=i===`outbound`?`SENT to`:`RECEIVED from`,u=`${l} ${c.map(e=>Or(e,o,n)).join(`, `)}`,d=e.messages[0],f=d?.createdAt??d?.recordedAt;return(0,X.jsxs)(`article`,{"data-slot":`worker-conversation-card`,"data-direction":i,"data-relationship":o?`peer`:`family`,"data-kind":e.kind,className:a(`flex w-full min-w-0 flex-col gap-2 rounded-[8px] border p-3 md:px-4 md:py-[14px]`,s.classes),children:[(0,X.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`p`,{className:a(`m-0 flex min-w-0 flex-wrap items-center gap-x-2 text-[11px] leading-[1.2] font-semibold tracking-[0.6px] uppercase`,s.accent),children:[(0,X.jsx)(`span`,{children:l}),c.map((e,t)=>(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-x-2 normal-case tracking-normal`,children:[t>0?(0,X.jsx)(`span`,{"aria-hidden":!0,children:`,`}):null,(0,X.jsx)(Ir,{id:e,peer:o,taskTitles:n,children:t=>(0,X.jsx)(Kr,{view:t,to:`/tasks/${e}`,label:`${l} ${t.title}`})})]},e))]}),o?(0,X.jsx)(`span`,{"data-slot":`conversation-relationship`,className:`rounded-full border border-message-peer-border px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-foreground uppercase`,children:`Peer`}):null,(0,X.jsx)(`span`,{"data-slot":`conversation-kind`,className:`rounded-full bg-background/60 px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-foreground uppercase`,children:jr(e.kind)}),e.messages.length===1&&d?(0,X.jsx)(Ur,{message:d}):null]}),(0,X.jsx)(Hr,{at:f,className:`flex shrink-0 items-center justify-self-end gap-1 whitespace-nowrap text-[11px] text-soft-foreground`,children:e.messages.length>1?`First sent`:null})]}),(0,X.jsx)(Gr,{batch:e},`${t}:${d?.messageId??e.id}`),[...new Set(e.messages.map(e=>Fr(e,r?.[e.recipientRunId])))].map(e=>e?(0,X.jsx)(`p`,{"data-slot":`conversation-delivery-explanation`,className:`min-w-0 text-xs leading-relaxed text-muted-foreground [overflow-wrap:anywhere]`,children:e},e):null),e.kind===`request`&&e.messages.length>1?(0,X.jsx)(Wr,{messages:e.messages,peer:o,runId:t,taskTitles:n}):null,e.messages.length===1&&d?(0,X.jsx)(qr,{message:d,runId:t,taskTitles:n}):null,(0,X.jsx)(Jr,{batch:e,heading:u})]})}function Hr({at:e,className:t,children:n}){return e===void 0||mt(e)===void 0?null:(0,X.jsxs)(`span`,{className:t,children:[n,(0,X.jsx)(ht,{ts:e})]})}function Ur({message:e}){let t=Nr(e),n=Pr(e.delivery),r=(e.messageKind===`request`||e.messageKind===`reply`)&&n!==t;return(0,X.jsxs)(X.Fragment,{children:[t?(0,X.jsx)(`span`,{"data-slot":`conversation-outcome`,className:`text-xs font-medium text-muted-foreground`,children:t}):null,r?(0,X.jsx)(`span`,{"data-slot":`conversation-delivery`,className:`text-xs text-muted-foreground`,children:n}):null]})}function Wr({messages:e,peer:t,runId:n,taskTitles:r}){return(0,X.jsx)(`ul`,{className:`grid min-w-0 gap-1 text-xs text-muted-foreground`,children:e.map(e=>{let i=Nr(e),a=e.createdAt??e.recordedAt;return(0,X.jsxs)(`li`,{className:`flex min-h-11 min-w-0 flex-wrap items-center gap-2`,children:[(0,X.jsx)(Ir,{id:e.recipientRunId,peer:t,taskTitles:r,children:t=>(0,X.jsx)(Kr,{view:t,to:`/tasks/${e.recipientRunId}`,label:`${t.title}${i?` — ${i}`:``}`})}),i?(0,X.jsx)(`span`,{"data-slot":`conversation-outcome`,children:i}):null,Pr(e.delivery)===i?null:(0,X.jsx)(`span`,{"data-slot":`conversation-delivery`,children:Pr(e.delivery)}),(0,X.jsx)(qr,{message:e,runId:n,taskTitles:r}),(0,X.jsx)(Hr,{at:a,className:`ml-auto whitespace-nowrap`})]},e.id)})})}function Gr({batch:e}){let t=Ve(),n=`conversation-body:${e.messages[0]?.messageId??e.id}`,[r,i]=(0,Y.useState)(()=>t?.get(n)??!1),a=(0,X.jsx)(`div`,{className:`min-w-0 break-words text-[14px] leading-[1.6] text-foreground select-text [overflow-wrap:anywhere]`,children:(0,X.jsx)(Ln,{breaks:!0,children:e.text})});return e.kind!==`request`&&e.kind!==`reply`?a:(0,X.jsxs)(zt,{"data-slot":`conversation-body`,open:r,onOpenChange:e=>{t?.set(n,e),i(e)},className:`min-w-0`,children:[(0,X.jsxs)(Rt,{type:`button`,"data-slot":`conversation-body-toggle`,className:`group/body inline-flex min-h-11 min-w-11 items-center gap-1.5 rounded-md px-2 text-start text-xs font-medium text-muted-foreground [@media(hover:hover)_and_(pointer:fine)]:hover:bg-background/40 [@media(hover:hover)_and_(pointer:fine)]:hover:text-foreground active:bg-background/60 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(we,{"aria-hidden":!0,className:`size-3.5 shrink-0 group-data-[state=open]/body:rotate-90`}),r?`Hide message`:`Show message`]}),(0,X.jsx)(Lt,{children:a})]})}function Kr({view:e,to:t,label:n}){return e.linkable?(0,X.jsx)(Ht,{className:zr,to:t,"aria-label":n,children:e.title}):(0,X.jsx)(`span`,{"data-slot":`conversation-counterpart`,children:e.title})}function qr({message:e,runId:t,taskTitles:n}){let{targets:r,replies:i,navigate:o}=(0,Y.useContext)(wr),s=e.requestId?r.get(e.requestId):void 0,c=e.requestId?s?[s]:[]:i.get(e.messageId)??[],l=e.requestId?`request`:`reply`;return c.length===0?e.requestId||e.outcome?.replyId?(0,X.jsxs)(`p`,{"data-slot":`conversation-connector`,className:`text-xs text-muted-foreground`,children:[`Linked `,l,` is outside loaded history.`]}):null:c.map(e=>{let r=kr(e.message,t)===`outbound`,i=r?e.message.recipientRunId:e.message.senderRunId;return(0,X.jsxs)(`button`,{type:`button`,"data-slot":`conversation-connector`,className:a(zr,`w-fit gap-1.5 text-xs text-muted-foreground`),onClick:()=>o(e),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,children:`↗`}),(0,X.jsx)(Ir,{id:i,peer:Ar(e.message),taskTitles:n,children:e=>(0,X.jsxs)(X.Fragment,{children:[`View `,l,` `,r?`to`:`from`,` `,e.title]})})]},e.message.messageId)})}function Jr({batch:e,heading:t}){return(0,X.jsxs)(zt,{"data-slot":`conversation-details`,className:`group/details`,children:[(0,X.jsxs)(Rt,{type:`button`,className:`inline-flex min-h-11 min-w-11 items-center gap-1.5 rounded-md px-2 text-left text-xs font-medium text-muted-foreground hover:bg-background/40 hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:[(0,X.jsx)(we,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]/details:rotate-90`}),`Details`]}),(0,X.jsx)(Lt,{children:(0,X.jsxs)(`dl`,{className:`grid min-w-0 gap-1 break-all px-2 pb-1 font-mono text-[11px] text-muted-foreground`,children:[(0,X.jsx)(`div`,{className:`sr-only`,children:t}),e.messages.flatMap(e=>Yr(e)).map((e,t)=>(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`dt`,{className:`inline font-sans font-medium text-soft-foreground`,children:[e.label,`: `]}),(0,X.jsx)(`dd`,{className:`inline`,children:e.value})]},`${e.label}:${e.value}:${t}`))]})})]})}function Yr(e){let t=[{label:`Message`,value:e.messageId},{label:`Sender`,value:e.senderRunId},{label:`Recipient`,value:e.recipientRunId},...Ar(e)?[{label:`Relationship`,value:`peer`}]:[],{label:`Delivery`,value:Pr(e.delivery)}];return e.requestId&&t.push({label:`Request`,value:e.requestId}),e.outcome?.replyId&&t.push({label:`Reply`,value:e.outcome.replyId}),e.state&&t.push({label:`State`,value:e.state}),e.createdAt&&t.push({label:`Created`,value:e.createdAt}),e.deliveredAt&&t.push({label:e.resumed?`Opening turn completed`:`Delivery acknowledged`,value:e.deliveredAt}),e.recordedAt&&t.push({label:`Event recorded`,value:e.recordedAt}),e.resumed&&t.push({label:`Continuation`,value:`Requested by parent with this instruction`}),e.deadline&&t.push({label:`Deadline`,value:e.deadline}),e.requestHash&&t.push({label:`Hash`,value:e.requestHash}),t}function Xr(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}var Zr=e(n(),1),Qr=`pending-ask`;function $r(e){return e.querySelector(`[data-slot="ask-question"] :is(button, textarea):not(:disabled)`)||(e.tabIndex=-1,e)}function ei(e){let t=e.querySelector(`[data-slot="ask-card"][data-pinned="true"]`);return t?$r(t):null}function ti(e,t){let n=`${Qr}:${e}`;return e=>{if(!t())return!1;let r=[...e.querySelectorAll(`[data-row-key]`)].find(e=>e.dataset.rowKey===n);return r?ei(r):null}}var ni=`[data-slot="ask-card"][data-pinned="true"]`;function ri(e,t){let[n,r]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{if(!e||typeof IntersectionObserver>`u`||typeof MutationObserver>`u`)return;let n=t.current??document.body,i=null,a=null,o=()=>{let e=n.querySelector(ni);if(e===i)return;if(a?.disconnect(),i=e,!i){r(!1);return}let t=document.querySelector(`[data-slot="thread-dock"]`),o=t&&getComputedStyle(t).position===`sticky`?Math.round(t.getBoundingClientRect().height):0;a=new IntersectionObserver(e=>r(e.some(e=>e.isIntersecting)),{rootMargin:`0px 0px -${o}px 0px`}),a.observe(i)};o();let s=new MutationObserver(o);return s.observe(n,{childList:!0,subtree:!0}),()=>{s.disconnect(),a?.disconnect()}},[e,t]),e&&n}function ii(e){return e<=0?`Jump to latest`:`Jump to latest (${e} ${e===1?`question`:`questions`} pending)`}function ai({onGoToQuestion:e}){return(0,X.jsxs)(`div`,{"data-slot":`ask-origin`,className:`flex flex-wrap items-center gap-x-2 rounded-lg border border-dashed border-accent-strong/40 px-3.5 py-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`font-medium text-link-foreground`,children:`Question asked here`}),(0,X.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`ask-go-to-question`,className:`min-h-11 min-w-11 px-2 text-foreground underline underline-offset-4`,onClick:e,children:`Go to the question`})]})}function oi(){let e=(0,Y.useRef)(null);return(0,Y.useLayoutEffect)(()=>{let t=e.current,n=t?.closest(`[data-slot="main"]`),r=t?.querySelector(`[data-slot="run-header"]`),i=t?.querySelector(`[data-slot="thread-dock"]`);if(!n||!r||!i)return;let a=()=>{let e=r.querySelector(`[data-slot="run-tabs"]`),t=r.getBoundingClientRect();r.style.setProperty(`--run-header-lead`,`${e?Math.max(0,e.getBoundingClientRect().top-t.top):0}px`),n.style.setProperty(`--thread-viewport-height`,`${n.clientHeight}px`),n.style.setProperty(`--thread-header-height`,`${si(r)}px`),n.style.setProperty(`--thread-footer-height`,`${i.getBoundingClientRect().height}px`)};a();let o=new ResizeObserver(a);return o.observe(r),o.observe(i),o.observe(n),()=>{o.disconnect(),r.style.removeProperty(`--run-header-lead`),n.style.removeProperty(`--thread-header-height`),n.style.removeProperty(`--thread-footer-height`),n.style.removeProperty(`--thread-viewport-height`)}},[]),e}function si(e){let t=Number.parseFloat(getComputedStyle(e).insetBlockStart)||0;return Math.max(0,e.getBoundingClientRect().height+Math.min(0,t))}var Z={viewKey:void 0,generation:0},ci=600,li=24;function ui(e,t={}){let{surface:n=`document`,onLoadOlder:r,onJumpToLatest:i,rowKeys:a=[]}=t,o=(0,Y.useRef)(a);o.current=a;let s=(0,Y.useRef)(e);s.current=e;let c=(0,Y.useRef)(null),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(!1),m=(0,Y.useRef)(!0),h=(0,Y.useRef)(!0),g=(0,Y.useRef)(0),_=(0,Y.useRef)(0),v=(0,Y.useRef)(new Set),y=(0,Y.useCallback)(e=>{for(let t of[...v.current])t(e)},[]),b=(0,Y.useCallback)(e=>(v.current.add(e),()=>{v.current.delete(e)}),[]),x=(0,Y.useRef)(null),S=(0,Y.useRef)(null),ee=(0,Y.useRef)(null),C=(0,Y.useRef)(null),w=(0,Y.useCallback)(e=>{let t=c.current;if(!t)return;let n=C.current;n?n.scrollTo(e):t.scrollTop=e},[]),T=(0,Y.useCallback)(()=>{let e=c.current;if(!e)return;let t=h.current?o.current.findIndex(e=>e.startsWith(`pending-ask:`)):-1,n=h.current?e.querySelector(`[data-slot="ask-card"][data-pinned="true"][data-resolved="false"]`):null,r=e.querySelector(`[data-slot="run-header"]`),i=r&&getComputedStyle(r).position===`sticky`?si(r):0;n?w(e.scrollTop+n.getBoundingClientRect().top-e.getBoundingClientRect().top-i-12):t>=0&&C.current?C.current.scrollToIndex(t,{align:`start`,offset:-i-12}):w(e.scrollHeight-e.clientHeight)},[w]),E=(0,Y.useCallback)(()=>{if(c.current){if(ee.current!==e){ee.current=e,h.current=!0;let t=Be(e);t&&!t.atBottom?(m.current=!1,x.current=t.top,S.current=Ne(e)?.rowKeys?{viewKey:e,top:t.top}:null):(m.current=!0,x.current=null,S.current=null)}x.current===null?m.current&&T():w(x.current)}},[e,w,T]),D=(0,Y.useCallback)(e=>S.current?.viewKey===e,[]),O=(0,Y.useCallback)(e=>{let t=S.current;return!t||!D(e)||e!==s.current?!1:(x.current=t.top,m.current=!1,S.current=null,!0)},[D]),te=(0,Y.useCallback)(e=>{d(e),e&&(c.current=e.closest(n===`panel`?`[data-slot="transcript-viewport"]`:`[data-slot="main"]`),E())},[n,E]),k=(0,Y.useCallback)(()=>{m.current&&T()},[T]),A=(0,Y.useRef)(!1),j=(0,Y.useRef)(0),M=(0,Y.useRef)(!1),N=(0,Y.useRef)(void 0),P=(0,Y.useRef)(!1),ne=(0,Y.useRef)(!1),F=(0,Y.useCallback)(e=>[...e.querySelectorAll(`[data-slot="thread-row"][data-row-key]`)].map(e=>{let t=e.getBoundingClientRect();return{key:e.dataset.rowKey,top:t.top,bottom:t.bottom}}),[]),I=(0,Y.useRef)(null),L=(0,Y.useRef)(0);(0,Y.useEffect)(()=>{if(!l())return;let e=e=>{x.current=null,S.current=null,L.current+=1,I.current=null,m.current=!1,h.current=!1,w(e)};return window.__cezThreadScrollTo=e,()=>{window.__cezThreadScrollTo===e&&delete window.__cezThreadScrollTo}},[w]);let R=(0,Y.useCallback)(()=>{let e=I.current,t=c.current;if(!e||!t)return;I.current=null;let n=e.beforeTop+Math.max(0,t.scrollHeight-e.beforeHeight),r=t.getBoundingClientRect().top,i=e.anchor===void 0?-1:o.current.indexOf(e.anchor.key),a=C.current;a&&i>=0?a.scrollToIndex(i,{align:`start`,offset:-e.anchor.offset}):w(tt(t.scrollTop,r,e.anchor,F(t),n))},[F,w]),z=(0,Y.useCallback)(()=>{let e=c.current;if(!e||!r||A.current)return;x.current=null,S.current=null,m.current=!1,A.current=!0;let t=j.current+1;j.current=t;let n=e.scrollHeight,i=e.scrollTop,a=e.getBoundingClientRect().top,l=je(a,F(e)),u=l===void 0?-1:o.current.indexOf(l.key),d=s.current,f=L.current;r().then(()=>{s.current===d&&L.current===f&&(I.current={beforeHeight:n,beforeTop:i,anchor:l,anchorIndex:u})},()=>{}).finally(()=>{j.current===t&&(A.current=!1)})},[F,r]);(0,Y.useEffect)(()=>()=>clearTimeout(N.current),[]);let B=(0,Y.useRef)(null),V=(0,Y.useRef)(0),H=(0,Y.useCallback)(()=>n===`document`?++Z.generation:++V.current,[n]),U=(0,Y.useCallback)((e,t)=>n===`document`?Z.viewKey===e&&Z.generation===t:s.current===e&&V.current===t,[n]);(0,Y.useEffect)(()=>()=>B.current?.disconnect(),[e,u]);let re=(0,Y.useCallback)((t,n,r,i)=>{let a=c.current;if(!a||!u)return;x.current=null,S.current=null,L.current+=1,I.current=null,m.current=!1,g.current=0,p(!0),H(),B.current?.disconnect();let o=()=>[...u.querySelectorAll(`[data-row-key]`)].find(e=>e.dataset.rowKey===t),s=()=>{let e=o();if(!e||getComputedStyle(e).visibility===`hidden`)return!1;let t=r?.(e)??e;return t===e&&(e.tabIndex=-1),t.focus({preventScroll:!0}),document.activeElement===t?(B.current?.disconnect(),!0):!1},l=a.querySelector(`[data-slot="run-header"]`),d=l&&getComputedStyle(l).position===`sticky`?si(l):0,f=C.current;if(i!==void 0)w(i);else if(f)f.scrollToIndex(n,{align:`start`,...d>0?{offset:-d}:{}});else{let e=o();e&&w(a.scrollTop+e.getBoundingClientRect().top-a.getBoundingClientRect().top-d)}s()||(B.current=new MutationObserver(()=>{s()}),B.current.observe(u,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`,`class`]})),ke(e,{top:i??a.scrollTop,atBottom:!1})},[u,w,e,H]),ie=(0,Y.useCallback)(t=>{let n=H(),r=s.current;B.current?.disconnect();let a=c.current;if(!a)return;x.current=null,S.current=null,L.current+=1,I.current=null,m.current=!0,h.current=!0,_.current=0,y({direction:`tail`}),ke(e,{top:a.scrollHeight-a.clientHeight,atBottom:!0});let o=()=>{m.current&&T()},l=()=>U(r,n),u=()=>{let e=t?.(a);return e===!1?!0:e?(e.focus({preventScroll:!0}),document.activeElement===e):!1};(i?.()??Promise.resolve()).finally(()=>{requestAnimationFrame(()=>{o(),requestAnimationFrame(()=>{if(o(),!t||!l()||u())return;B.current?.disconnect();let e=new MutationObserver(()=>{l()?u()&&e.disconnect():e.disconnect()});B.current=e,e.observe(a,{childList:!0,subtree:!0})})})})},[i,e,T,H,U,y]),ae=a.at(-1),W=a.length;return(0,Y.useLayoutEffect)(()=>{L.current+=1,I.current=null,A.current=!1,n===`document`?Z.viewKey!==e&&(Z.viewKey=e,Z.generation+=1):V.current+=1},[e,n]),(0,Y.useLayoutEffect)(()=>{let e=I.current;e?(e.anchor===void 0?-1:o.current.indexOf(e.anchor.key))>e.anchorIndex?R():I.current=null:m.current&&T()},[ae,W,R,T]),(0,Y.useLayoutEffect)(()=>{!c.current||!u||E()},[u,E]),(0,Y.useEffect)(()=>{let t=c.current,n=u;if(!t||!n)return;g.current=0;let r=null,i=!1,a=t.scrollTop,o,s=0,l,d=()=>{h.current&&!pt(t,80)&&(m.current=!1),h.current=!1},f=e=>{_.current=Date.now(),d(),l=e},v=()=>{H(),B.current?.disconnect(),x.current=null,S.current=null,L.current+=1,I.current=null,m.current=!1,g.current=0},b=()=>{x.current=null,S.current=null,L.current+=1,I.current=null,g.current=Date.now()},ee=e=>{if(e.deltaY!==0)if(f(e.deltaY<0?`up`:`down`),e.deltaY<0){v();let e=!M.current;M.current=!0,clearTimeout(N.current),N.current=setTimeout(()=>{M.current=!1},180),e&&We(t)&&z()}else b()},C=e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)?(f(`up`),v(),!e.repeat&&We(t)&&z()):[`ArrowDown`,`PageDown`,`End`].includes(e.key)&&(f(`down`),b())},E=e=>{if(e.target!==t||e.button!==0||e.pointerType===`touch`||e.pointerType===`pen`||t.scrollHeight<=t.clientHeight)return;i=!0,ne.current=!1,a=t.scrollTop;let n=t.getBoundingClientRect(),r=getComputedStyle(t),o=parseFloat(r.borderLeftWidth)||0,s=parseFloat(r.borderRightWidth)||0,c=n.left+t.clientLeft,l=c+t.clientWidth;!(e.clientX>=n.left+o&&e.clientX<c||e.clientX>=l&&e.clientX<n.right-s)||e.clientY<n.top+t.clientTop||e.clientY>=n.top+t.clientTop+t.clientHeight||(h.current=!1,x.current=null,S.current=null,pt(t,80)||(v(),b()))},O=()=>{i=!1},te=e=>{P.current=!1,r=e.touches[0]?.clientY??null},k=e=>{let n=e.touches[0]?.clientY;n!==void 0&&(r!==null&&n>r+1?(f(`up`),v(),!P.current&&We(t)&&(P.current=!0,z())):r!==null&&n<r-1&&(f(`down`),b()),r=n)},A=e=>{if(e===0||!i&&Date.now()-_.current>=ci)return;let n=e<0?`up`:`down`;!i&&n!==l||(n!==o&&(o=n,s=0),s+=Math.abs(e),s>=li&&(0,Zr.flushSync)(()=>y({direction:n,distanceFromBottom:t.scrollHeight-t.clientHeight-t.scrollTop})))},j=()=>{let n=m.current;A(t.scrollTop-a),i&&t.scrollTop!==a&&(d(),t.scrollTop<a?v():b()),i&&!ne.current&&t.scrollTop<a&&We(t)&&(ne.current=!0,z()),a=t.scrollTop;let r=pt(t,80);r&&x.current===null&&(m.current||Date.now()-g.current<2e3)&&(m.current=!0),!n&&m.current&&y({direction:`tail`}),p(!r),x.current===null&&!D(e)&&ke(e,{top:t.scrollTop,atBottom:r})};t.addEventListener(`scroll`,j,{passive:!0}),t.addEventListener(`wheel`,ee,{passive:!0}),t.addEventListener(`touchstart`,te,{passive:!0}),t.addEventListener(`touchmove`,k,{passive:!0}),t.addEventListener(`pointerdown`,E,{passive:!0}),window.addEventListener(`pointerup`,O,{passive:!0}),window.addEventListener(`pointercancel`,O,{passive:!0}),t.addEventListener(`keydown`,C);let F;if(typeof ResizeObserver<`u`){F=new ResizeObserver(()=>{let e=x.current;if(e!==null){let n=t.scrollHeight-t.clientHeight;w(Math.min(e,n)),n>=e&&(x.current=null)}else m.current&&T()}),F.observe(n);let e=n.closest(`[data-route="task-thread"]`),r=e?.querySelector(`[data-slot="run-header"]`),i=e?.querySelector(`[data-slot="thread-dock"]`);r&&F.observe(r),i&&F.observe(i)}return()=>{t.removeEventListener(`scroll`,j),t.removeEventListener(`wheel`,ee),t.removeEventListener(`touchstart`,te),t.removeEventListener(`touchmove`,k),t.removeEventListener(`pointerdown`,E),window.removeEventListener(`pointerup`,O),window.removeEventListener(`pointercancel`,O),t.removeEventListener(`keydown`,C),F?.disconnect()}},[e,u,z,w,T,D,H,y]),{attachContent:te,scrollElRef:c,virtualizerRef:C,restoreMeasurements:O,ownsMeasurementRestore:D,pillVisible:f,jumpToLatest:ie,jumpToRow:re,loadOlder:z,restickIfStuck:k,subscribeReaderScroll:b}}function di({runId:e,rows:t,mode:n,controls:r}){return n===`virtual`?(0,X.jsx)(fi,{runId:e,rows:t,controls:r}):(0,X.jsx)(`div`,{ref:r.attachContent,"data-slot":`thread-rows`,"data-virtualized":`false`,className:`[overflow-anchor:none]`,children:t.map(e=>(0,X.jsx)(`div`,{"data-slot":`thread-row`,"data-row-key":e.key,className:`flex w-full flex-col pb-2.5 [contain-intrinsic-block-size:auto_3rem] [content-visibility:auto]`,children:e.node},e.key))})}function fi({runId:e,rows:t,controls:n}){return(0,X.jsx)(pi,{runId:e,rows:t,controls:n},e)}function pi({runId:e,rows:t,controls:n}){let r=(0,Y.useRef)(null),i=(0,Y.useRef)(t),a=t[0]?.key,o=i.current[0]?.key,s=a!==o&&(t.some(e=>e.key===o)||i.current.some(e=>e.key===a));(0,Y.useLayoutEffect)(()=>{i.current=t},[t]);let[c]=(0,Y.useState)(()=>Ne(e)),[l,u]=(0,Y.useState)(()=>({cache:Me(e,t.length,t.map(e=>e.key)),generation:0})),d=(0,Y.useRef)(l.cache===void 0&&c?.rowKeys?.length===c?.rows&&c!==void 0);(0,Y.useLayoutEffect)(()=>{let r=c?.rowKeys;if(!d.current){n.restoreMeasurements(e);return}if(!(!c||!r)){if(t.length>c.rows||t.some((e,t)=>e.key!==r[t])){d.current=!1,n.restoreMeasurements(e);return}t.length===c.rows&&(d.current=!1,n.restoreMeasurements(e)&&u({cache:c.cache,generation:1}))}},[c,t,n.restoreMeasurements,e]);let f=(0,Y.useRef)(t.length);f.current=t.length;let p=(0,Y.useRef)(t.map(e=>e.key));p.current=t.map(e=>e.key);let m=(0,Y.useRef)(null),h=(0,Y.useCallback)(t=>{n.virtualizerRef.current=t,t?m.current=t:m.current&&=(d.current&&c?.rowKeys&&f.current<c.rows&&n.ownsMeasurementRestore(e)||nt(e,{rows:f.current,cache:m.current.cache,rowKeys:p.current}),null)},[e,n.virtualizerRef,n.ownsMeasurementRestore,c]),[g,_]=(0,Y.useState)(0);return(0,Y.useLayoutEffect)(()=>{let e=()=>{let e=r.current,t=n.scrollElRef.current;!e||!t||_(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n.scrollElRef]),(0,X.jsx)(`div`,{ref:e=>{r.current=e,n.attachContent(e)},"data-slot":`thread-rows`,"data-virtualized":`true`,className:`[overflow-anchor:none]`,children:(0,X.jsx)(Nn,{ref:h,scrollRef:n.scrollElRef,startMargin:g,shift:s,...l.cache===void 0?{}:{cache:l.cache},children:t.map(e=>(0,X.jsx)(`div`,{"data-slot":`thread-row`,"data-row-key":e.key,className:`flex w-full flex-col pb-2.5`,children:e.node},e.key))},l.generation)})}function mi({onJump:e,pendingQuestions:t=0}){return(0,X.jsxs)(`button`,{type:`button`,"data-slot":`jump-to-latest`,"data-pending-questions":t>0?t:void 0,onClick:()=>e(),className:`pointer-events-auto inline-flex min-h-11 min-w-11 items-center gap-1.5 rounded-full border border-border bg-background px-3.5 text-xs font-medium text-muted-foreground shadow-sm hover:text-foreground`,children:[(0,X.jsx)(be,{"aria-hidden":!0,className:`size-3.5`}),ii(t)]})}function hi(e){return e.consumedAt?`consumed`:e.deliveredAt?`delivered`:`queued`}function gi(e,t){let n=new Map((e.agentInputs??[]).map(e=>[e.id,hi(e)]));if(n.size===0)return t;let r=!1,i=t.map(e=>{if(e.kind!==`note`||!e.id.startsWith(`agent-input:`))return e;let t=n.get(e.id.slice(12));return!t||e.delivery===t?e:(r=!0,{...e,delivery:t})});return r?i:t}function _i(e,t,n){return e.kind===`ask`?e.id===t?n===void 0?e:{...e,placement:`origin`}:e.resolved?e:{...e,resolved:!0}:e}var vi=new WeakMap;function yi(e,t){let n=vi.get(e);return n?.length===t.length&&t.every((e,t)=>{let r=n[t];return e===r||Object.keys(e).length===Object.keys(r).length&&Object.entries(e).every(([e,t])=>t===r[e])})?n:(vi.set(e,t),t)}function bi(e,t,n=t,r){let i=r==null?void 0:n.turns.flatMap(e=>e.items).find(e=>e.kind===`ask`&&e.id===r&&!e.resolved),a=new Map(n.turns.flatMap(e=>e.items).filter(e=>e.kind===`permission`).map(e=>[e.requestId,e])),o=new Set,s=new Set(t.turns.map(e=>e.userMessage?.ask?.id)),c=[];e.task&&c.push({id:`task`,userMessageKey:`task`,userMessage:{text:e.task,images:e.taskImages??[],ts:e.createdAt},entries:[]});for(let t of e.queuedMessages??[])c.push({id:`queued:${t.id}`,userMessageKey:`queued:${t.id}`,userMessage:{text:t.text,images:t.images??[],ts:t.createdAt},inDaySequence:!1,entries:[]});let l=t.turns.at(-1);for(let n of t.turns){let t=e.status===`review`&&n===l?Si(n.items):n.items;c.push({id:n.id,userMessageKey:`${n.id}:user`,...n.userMessage===void 0?{}:{userMessage:{text:n.userMessage.text,ask:n.userMessage.ask,imageCount:n.userMessage.imageCount,images:n.userMessage.images,...n.userMessage.ts===void 0?{}:{ts:n.userMessage.ts}}},...n.startedAt===void 0?{}:{startedAt:n.startedAt},...n.completed?.ts===void 0?{}:{completedAt:n.completed.ts},entries:yi(n.items,gi(e,t.filter(t=>!e.task||!jt(t,`opening`)).map(e=>e.kind===`ask`&&s.has(e.id)?{...e,placement:`origin`}:r!==void 0&&e.kind===`ask`?_i(e,r,i):e.kind===`permission`?(o.add(e.requestId),a.get(e.requestId)??(e.status===`pending`?{...e,status:`expired`}:e)):e)))})}let u=[...a.values()].filter(e=>e.status===`pending`&&!o.has(e.requestId));return u.length>0&&c.push({id:`pending-permissions`,entries:u,inDaySequence:!1}),i!==void 0&&c.push({id:Qr,entries:[{...i,placement:`pinned`}],inDaySequence:!1}),c}var xi=`changes ready for review`;function Si(e){return e.filter(e=>!(e.kind===`note`&&e.tone===`dim`&&e.text.startsWith(xi)))}function Ci(e,t,n){let r=e.findIndex(({content:e})=>e.kind===`block`&&e.block.kind===`entry`&&e.block.entry.kind===`ask`&&e.block.entry.id===t&&e.block.entry.placement===n);return r<0?void 0:{key:e[r].key,index:r}}function wi(e,t){return[{id:`agent:${e}`,entries:t}]}function Ti(e){if(e.inDaySequence!==!1)return e.userMessage?.ts??e.startedAt??e.completedAt}function Ei(e,t){let n=[],r;for(let t of e){let e=Ti(t),i=Ue(e);i!==void 0&&e!==void 0&&(r===void 0||i>r)&&(r!==void 0&&n.push({key:`${t.id}:day-separator`,scope:t.id,content:{kind:`day-separator`,ts:e}}),r=i),t.userMessage!==void 0&&n.push({key:t.userMessageKey??`${t.id}:user`,scope:t.id,content:{kind:`user-message`,message:t.userMessage}});for(let e of Pe(t.entries))n.push({key:`${t.id}:${e.id}`,scope:t.id,content:{kind:`block`,block:e}});t.completedAt!==void 0&&n.push({key:`${t.id}:turn-time`,scope:t.id,content:{kind:`turn-time`,completedAt:t.completedAt,...t.startedAt===void 0?{}:{startedAt:t.startedAt}}})}return n}function Di({runId:e,viewId:t,sections:n,mode:r,empty:i,renderAsk:a,renderPermission:o,messageActions:s,scrollControls:c,renderMode:l,taskTitles:u,recipientBackends:d}){let f=(0,Y.useMemo)(()=>Ei(n,e),[n,e]),p=ui(`${e}:${t}`,{surface:r}),m=c??p;_r(e,f,m,r);let h=(0,Y.useMemo)(()=>{let e=new Map;f.forEach((t,n)=>{if(!(t.content.kind!==`block`||t.content.block.kind!==`worker-conversation`))for(let r of t.content.block.batches)for(let i of r.messages)e.set(i.messageId,{message:i,rowKey:t.key,rowIndex:n})});let t=new Map;for(let n of e.values()){let{message:e}=n;if(e.messageKind!==`reply`||!e.requestId)continue;let r=t.get(e.requestId)??[];r.push(n),t.set(e.requestId,r)}return{targets:e,replies:t,navigate:e=>m.jumpToRow(e.rowKey,e.rowIndex)}},[f,m.jumpToRow]),g=(0,Y.useMemo)(()=>f.map(t=>({key:t.key,node:Oi(t,s?.[t.key],a,o,e,u,d)})),[s,a,o,f,e,u,d]),_=l??Re(``,g.length),v=g.length===0?i??null:(0,X.jsx)(di,{runId:`${e}:${t}`,rows:g,mode:_,controls:m});return(0,X.jsx)(bt,{runId:e,children:(0,X.jsx)(ze,{runId:e,children:(0,X.jsx)(wr.Provider,{value:h,children:r===`panel`?(0,X.jsxs)(`div`,{"data-slot":`transcript-viewport`,"aria-label":`Agent transcript`,role:`region`,tabIndex:0,className:`relative flex min-h-0 flex-1 flex-col overflow-y-auto [scrollbar-gutter:stable]`,children:[(0,X.jsx)(`div`,{"data-slot":`subagent-stream`,className:`flex flex-col px-5 py-4`,children:v}),m.pillVisible?(0,X.jsx)(`div`,{className:`pointer-events-none sticky inset-x-0 bottom-4 flex justify-center`,children:(0,X.jsx)(mi,{onJump:m.jumpToLatest})}):null]}):v})})})}function Oi(e,t,n,r,i,a,o){switch(e.content.kind){case`user-message`:return(0,X.jsx)(ki,{message:e.content.message,actions:t});case`day-separator`:return(0,X.jsx)(ft,{ts:e.content.ts});case`turn-time`:return(0,X.jsx)(Je,{completedAt:e.content.completedAt,...e.content.startedAt===void 0?{}:{startedAt:e.content.startedAt}});case`block`:return(0,X.jsx)(Ai,{block:e.content.block,scope:e.scope,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o});default:return Pi(e.content)}}function ki({message:e,actions:t}){return(0,X.jsx)($e,{text:e.text,imageCount:e.imageCount,images:e.images,...e.ts===void 0?{}:{ts:e.ts},onEdit:t?.onEdit,onRemove:t?.onRemove,editLabel:t?.editLabel,removeLabel:t?.removeLabel,children:e.ask?(0,X.jsx)(`div`,{"data-slot":`ask-card`,"data-resolved":`true`,children:(0,X.jsx)(Fe,{ask:e.ask})}):void 0})}function Ai({block:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o}){switch(e.kind){case`entry`:return(0,X.jsx)(He.Provider,{value:`${t}:${e.entry.id}`,children:(0,X.jsx)(Mi,{entry:e.entry,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o})});case`tool-card`:return(0,X.jsx)(st,{item:e.item,nested:e.children,cacheKey:`${t}:${e.id}`,renderNested:(e,t)=>(0,X.jsx)(ji,{entries:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o})});case`context-group`:return(0,X.jsx)(Ye,{group:e,scope:t});case`streak`:return(0,X.jsx)(it,{count:e.count,children:e.blocks.map(e=>(0,X.jsx)(Ai,{block:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o},e.id))});case`worker-conversation`:return(0,X.jsx)(Br,{block:e,runId:i,taskTitles:a,recipientBackends:o});default:return Pi(e)}}function ji({entries:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o}){return Pe(e).map(e=>(0,X.jsx)(Ai,{block:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o},e.id))}function Mi({entry:e,scope:t,renderAsk:n,renderPermission:r,runId:i,taskTitles:a,recipientBackends:o}){switch(e.kind){case`message`:return e.role===`assistant`?(0,X.jsx)(lt,{text:e.text,ts:e.ts}):(0,X.jsx)($e,{text:e.text,ts:e.ts});case`reasoning`:return(0,X.jsx)(Ze,{text:e.text});case`tool`:return(0,X.jsx)(st,{item:e,cacheKey:`${t}:${e.id}`});case`note`:return e.attribution?(0,X.jsxs)(`div`,{className:`min-w-0 rounded-md border border-border px-4 py-3 text-sm`,children:[(0,X.jsxs)(`p`,{className:`mb-2 break-all text-xs text-muted-foreground`,children:[e.attribution.source===`agent`?`Agent input from parent ${e.attribution.parentRunId}`:`Worker lifecycle context for parent ${e.attribution.parentRunId}`,e.delivery?` · ${Pr(e.delivery)}`:``]}),(0,X.jsx)(Ke,{note:e})]}):(0,X.jsx)(Ke,{note:e});case`conversation`:return(0,X.jsx)(Br,{runId:i,taskTitles:a,recipientBackends:o,block:{kind:`worker-conversation`,id:e.id,batches:[{id:e.id,kind:e.messageKind,text:e.text,senderRunId:e.senderRunId,messages:[e]}]}});case`image`:return(0,X.jsx)(dt,{image:e});case`ask`:return n===void 0?(0,X.jsx)(`div`,{"data-slot":`ask-card`,className:`rounded-lg border border-border bg-card px-4 py-3 text-sm`,children:`The agent asked a question. Open the main session to answer it.`}):n(e);case`permission`:return r?r(e):(0,X.jsx)(xr,{permission:e,runId:i});case`provider-auth-required`:return(0,X.jsx)(Xe,{incident:e});case`preview-server`:return(0,X.jsx)(Ni,{entry:e});case`hook`:return(0,X.jsx)(rt,{item:e,cacheKey:`${t}:${e.id}`});default:return Pi(e)}}function Ni({entry:e}){let t=En(),n=T().data?.capabilities?.preview===!0;return(0,X.jsx)(Pt,{entry:t?.worktreeRemoved?{kind:`preview-server`,id:e.id,server:e.server,state:`unavailable`}:e,inPreview:t!==null&&t.open&&t.port===e.server.port,onOpen:t!==null&&n?t.openPane:void 0})}function Pi(e){throw Error(`Unhandled transcript variant: ${JSON.stringify(e)}`)}function Fi({runId:e,renderAsk:t,renderPermission:n,agent:r,entries:i,onClose:a,taskTitles:o,recipientBackends:s}){let c=(0,Y.useContext)(an),l=(0,Y.useRef)(void 0),u=(0,Y.useRef)(!1);return(0,Y.useEffect)(()=>()=>{l.current?.()},[c,e]),(0,X.jsx)($t,{open:r!==void 0,onOpenChange:e=>{e||a()},children:(0,X.jsx)(tn,{"data-slot":`subagent-sheet`,side:`right`,onCloseAutoFocus:e=>{u.current&&=(e.preventDefault(),!1)},className:`flex min-h-0 w-full gap-0 p-0 sm:max-w-xl`,children:r===void 0?null:(0,X.jsx)(gt.Provider,{value:e=>{let t=[...document.querySelectorAll(`[data-agent-id]`)].find(e=>e.dataset.agentId===r?.id);l.current?.(),l.current=c?.registerOpener(e,()=>{t?.focus({preventScroll:!0})}),u.current=!0,a()},children:(0,X.jsx)(Ii,{runId:e,renderAsk:t,renderPermission:n,agent:r,entries:i,taskTitles:o,recipientBackends:s})})})})}function Ii({runId:e,renderAsk:t,renderPermission:n,agent:r,entries:i,taskTitles:a,recipientBackends:o}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(Qt,{className:`gap-1.5 border-b border-border px-5 py-4`,children:[(0,X.jsxs)(en,{className:`flex min-w-0 items-center gap-2 pr-8 text-[16px]`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:r.title}),r.agentType===void 0?null:(0,X.jsx)(`span`,{"data-slot":`agent-type`,className:`shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:r.agentType})]}),(0,X.jsxs)(rn,{"data-slot":`subagent-meta`,className:`flex items-center gap-2 text-xs`,children:[(0,X.jsx)(Li,{status:r.status}),(0,X.jsxs)(`span`,{className:`tabular-nums`,children:[r.toolCalls,` `,r.toolCalls===1?`tool call`:`tool calls`]})]})]}),(0,X.jsx)(Di,{runId:e,viewId:`agent:${r.id}`,sections:wi(r.id,i),mode:`panel`,renderAsk:t,renderPermission:n,taskTitles:a,recipientBackends:o,empty:(0,X.jsx)(`div`,{"data-slot":`subagent-empty`,className:`py-2 text-[13px] text-muted-foreground`,children:`No attributed output — see the thread card for this agent's result.`})})]})}function Li({status:e}){let t=e===`completed`?`Completed`:e===`failed`?`Failed`:e===`declined`?`Declined`:e===`pending`?`Pending`:`Running`;return(0,X.jsx)(`span`,{"data-slot":`subagent-status`,"data-status":e,className:a(`rounded-full px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] uppercase`,e===`completed`&&`bg-success/15 text-success`,(e===`failed`||e===`declined`)&&`bg-danger/15 text-danger`,(e===`running`||e===`pending`)&&`bg-muted text-muted-foreground`),children:t})}function Ri(e,t,n,r){return n?r===`step`?`Step ${e} of ${t}`:`${e} of ${t} complete`:`${e} / ${t}`}function zi(e){return typeof e==`object`&&!!e&&!(0,Y.isValidElement)(e)&&`keep`in e}function Q({slot:e,icon:t,title:n,meta:r,summary:i,aside:o,open:s,onToggle:c,className:l,children:u}){let d=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center text-accent-text`,children:t}),(0,X.jsx)(`span`,{className:a(`truncate text-[14px] font-semibold text-foreground`,typeof n==`string`?`shrink-0`:`min-w-0 shrink`),children:n}),i??(zi(r)?(0,X.jsxs)(`span`,{"data-slot":`run-activity-meta`,className:`contents text-[13px] text-muted-foreground tabular-nums`,children:[r.drop===void 0?null:(0,X.jsxs)(`span`,{className:`flex h-[1lh] min-w-0 shrink-[2] flex-wrap overflow-hidden`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-[1lh] w-0`}),(0,X.jsxs)(`span`,{"data-slot":`run-activity-meta-drop`,className:`whitespace-nowrap`,children:[r.drop,(0,X.jsx)(`span`,{className:`text-soft-foreground`,children:` ·`})]})]}),` `,(0,X.jsx)(`span`,{"data-slot":`run-activity-meta-keep`,className:`shrink-0 whitespace-nowrap`,children:r.keep})]}):r===void 0?null:(0,X.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,X.jsxs)(`div`,{"data-slot":`run-activity-${e}`,"data-state":f&&s?`open`:`collapsed`,className:a(`min-w-0 border-t border-border first:border-t-0`,l),children:[f?(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":s,onClick:c,className:`flex min-h-11 w-full min-w-0 items-center gap-2.5 px-3.5 py-2 text-start hover:bg-muted/40 active:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`,children:[d,o,(0,X.jsx)(ye,{"aria-hidden":!0,className:a(`size-4 shrink-0 text-soft-foreground motion-safe:transition-transform motion-reduce:transition-none`,!o&&`ms-auto`,s&&`rotate-180`)})]}):(0,X.jsxs)(`div`,{className:`flex min-h-11 w-full min-w-0 items-center gap-2.5 px-3.5 py-2`,children:[d,o]}),f&&s?(0,X.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 Bi(e){return re(e.delegation)}function Vi(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 Hi(e){let t=e.delegation,n=Bi(e),r=y(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=Vi(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 Ui(e){let t=y(e.id,{enabled:e.delegation?.role===`root`});return t.isSuccess&&t.data.workers.some(e=>Xt(e.status))}function Wi({run:e,open:t,onToggle:n}){let r=y(e.id),i=S(),o=gn(),s=e.delegation,c=new Map(r.data?.workers.map(e=>[e.workerId,e])),l=Vi(s,r.data),u=P(e)??N(e),d=u?Gi(e,u):void 0,f=e=>i.data?.find(t=>t.id===e)??r.data?.titles?.find(t=>t.id===e),p=e=>{let t=f(e);return t?J(t):`worker ${e.slice(0,8)}`};return(0,X.jsx)(Q,{slot:`workers`,icon:(0,X.jsx)(fe,{className:`size-4`}),title:`Workers`,meta:Ki({ids:l,workers:c,desktop:o,query:r}),aside:r.data?.capacity?(0,X.jsx)($i,{capacity:r.data.capacity}):void 0,open:t,onToggle:n,children:(0,X.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,X.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,u?(0,X.jsx)(Xi,{wait:u,dependencyLabel:d}):null,l.length>0?(0,X.jsx)(`ul`,{className:`grid max-h-64 min-w-0 gap-0.5 overflow-y-auto`,children:l.map(t=>{let n=c.get(t),i=f(t),o=n?Ji(n.status):r.isSuccess?`Record unavailable or deleted`:`Status unavailable`;return(0,X.jsxs)(`li`,{"data-slot":`worker-item`,"data-status":n?.status,className:`min-w-0`,children:[(0,X.jsxs)(Ht,{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,X.jsx)(qi,{status:n?.status}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`block truncate`,children:i?J(i):`Worker ${t.slice(0,8)}`}),n?.supervisorRunId&&n.supervisorRunId!==e.id?(0,X.jsxs)(`span`,{"data-slot":`worker-supervisor`,className:`block truncate text-xs text-muted-foreground`,children:[`Started by `,p(n.supervisorRunId)]}):null]}),(0,X.jsx)(`span`,{className:a(`max-w-[45%] shrink-0 truncate text-xs`,Yi(n?.status)),children:o}),(0,X.jsx)(me,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground`})]}),n?(0,X.jsx)(ta,{parentRunId:e.id,worker:n}):null,n?.destroy?(0,X.jsx)(aa,{state:n.destroy}):null]},t)})}):Bi(e)&&r.isSuccess?(0,X.jsx)(`p`,{className:`px-1 py-1`,children:`No workers`}):null,r.fetchStatus===`paused`?(0,X.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Offline — relationship details will refresh when connected.`}):r.isPending?(0,X.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Loading relationships…`}):null,r.isError?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-1 py-1`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Could not load relationships. Known task links are retained.`}),(0,X.jsx)(q,{variant:`outline`,className:`min-h-11`,onClick:()=>void r.refetch(),children:`Retry relationships`})]}):null]})})}function Gi(e,t){let n=e.delegation;if(!(!n||n.role===`invalid`))return j(e)??A(n.role,t,`requestIds`in t&&M(n,t.requestIds))}function Ki({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 qi({status:e}){let t=`size-[15px] shrink-0`;return e===`done`?(0,X.jsx)(he,{"aria-hidden":!0,className:a(t,`text-success`)}):e===`failed`?(0,X.jsx)(G,{"aria-hidden":!0,className:a(t,`text-danger`)}):e===`cancelled`?(0,X.jsx)(ge,{"aria-hidden":!0,className:a(t,`text-soft-foreground`)}):e===`running`||e===`waiting`||e===`review`?(0,X.jsx)(Tt,{role:`status`,"aria-label":`Worker running`,className:a(t,`animate-spin stroke-pending motion-reduce:animate-none`)}):(0,X.jsx)(K,{"aria-hidden":!0,className:a(t,`text-soft-foreground`)})}function Ji(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Yi(e){return e===`done`?`text-success`:e===`failed`?`text-danger`:`text-muted-foreground`}function Xi({wait:e,dependencyLabel:t}){return(0,X.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,X.jsxs)(X.Fragment,{children:[` `,`Deadline: `,(0,X.jsx)(`time`,{dateTime:e.deadline,children:e.deadline})]}):` No deadline: Squawk wakes this task when they have all settled.`]})}function Zi(e){return e.delegation?.role===`worker`&&N(e)?.phase===`wake-pending`}function Qi({run:e}){let t=N(e);return e.delegation?.role===`worker`&&t?.phase===`wake-pending`?(0,X.jsx)(Xi,{wait:t,dependencyLabel:A(`worker`,t)}):null}function $i({capacity:e}){return(0,X.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 ea=new Set([`review`,`done`,`failed`,`cancelled`]);function ta({parentRunId:e,worker:t}){let n=c(e),[r,i]=(0,Y.useState)(!1);if(!ea.has(t.status)||t.destroy?.phase===`complete`&&t.destroy.remaining.length===0)return null;let a=t.workerId.slice(0,8),o=!!t.destroy&&t.destroy.phase!==`complete`,s=n.error instanceof k?n.error.work:void 0;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 px-1`,children:[r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`break-words text-xs`,children:ie(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,X.jsx)(q,{variant:`danger-ghost`,size:`sm`,className:`min-h-11`,"aria-label":`Confirm clean up of worker ${a}`,onClick:()=>{i(!1),n.mutate({workerId:t.workerId})},children:`Clean up`}),(0,X.jsx)(q,{variant:`outline`,size:`sm`,className:`min-h-11`,onClick:()=>i(!1),children:`Cancel`})]}):(0,X.jsx)(q,{variant:`outline`,size:`sm`,className:`min-h-11`,"aria-label":o?`Retry clean up of worker ${a}`:`Clean up worker ${a}`,disabled:n.isPending,onClick:()=>i(!0),children:n.isPending?`Cleaning up…`:o?`Retry clean up`:`Clean up`}),n.isError&&!r?(0,X.jsx)(`span`,{role:`status`,className:`break-words text-xs`,children:s?`Cleanup stopped: this worker holds ${ra(s)}. Land or commit what you need first, or discard it.`:`Cleanup did not finish: ${n.error.message}`}):null,s&&!r&&!n.isPending?(0,X.jsx)(q,{variant:`danger-ghost`,size:`sm`,className:`min-h-11`,"aria-label":`Discard work and clean up worker ${a}`,onClick:()=>n.mutate({workerId:t.workerId,discardWork:!0}),children:`Discard work and clean up`}):null]})}var na=(e,t,n)=>`${e} ${e===1?t:n}`;function ra(e){return[...e.uncommittedFiles?[na(e.uncommittedFiles,`uncommitted file`,`uncommitted files`)]:[],...e.commits?[`${na(e.commits,`commit`,`commits`)} no other branch reaches`]:[]].join(` and `)}function ia(e){return e!==void 0&&(e.phase!==`complete`||e.remaining.length>0||e.error!==void 0)}function aa({state:e}){if(!ia(e))return null;let t=e.phase===`complete`?void 0:e.retry,n=t&&(0,X.jsx)(oa,{at:t.nextAt});return(0,X.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,X.jsxs)(X.Fragment,{children:[`. Nothing changed after `,t.attempts,` automatic attempts; checking hourly, next check `,n,`. Retry clean up to try now.`]}):t?(0,X.jsxs)(X.Fragment,{children:[`. Retrying automatically, next attempt `,n,`.`]}):null]})}function oa({at:e}){let t=nn(3e4);return(0,X.jsx)(`time`,{dateTime:e,title:new Date(e).toLocaleString(),children:Rn(t,Date.parse(e))})}function sa(e){let t=I(),[n,r]=(0,Y.useState)(),i=qt(e);(0,Y.useEffect)(()=>{(!i||n&&n!==e.id)&&r(void 0)},[i,e.id,n]);let a=h({mutationFn:async()=>{r(e.id);try{if(!(await R(e.id)).cancelled)throw Error(`The task changed before Stop was accepted. Check its status and retry.`)}catch(e){throw r(void 0),e}},onSettled:()=>t.invalidateQueries({queryKey:d.runs.all})});return{stopping:!!e.stopping||a.isPending||i&&n===e.id,stop:()=>a.mutateAsync()}}function ca({agents:e,onSelect:t}){return e.length===0?null:(0,X.jsx)(`ul`,{"data-slot":`agents-list`,className:`flex min-w-0 flex-col gap-[7px]`,children:e.map(e=>(0,X.jsx)(la,{agent:e,onSelect:t},e.id))})}function la({agent:e,onSelect:t}){let n=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ua,{status:e.status,stalled:e.stalled===!0}),(0,X.jsx)(`span`,{className:`min-w-0 shrink truncate font-medium`,children:e.title}),e.agentType===void 0?null:(0,X.jsx)(`span`,{"data-slot":`agent-type`,className:`shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:e.agentType}),(0,X.jsx)(`span`,{"data-slot":`agent-activity`,className:`min-w-0 flex-1 truncate text-muted-foreground`,children:sr(e)}),(0,X.jsxs)(`span`,{"data-slot":`agent-tools`,className:`shrink-0 text-muted-foreground tabular-nums`,children:[e.toolCalls,` `,e.toolCalls===1?`tool`:`tools`]})]});return(0,X.jsx)(`li`,{"data-slot":`agent-item`,"data-status":e.status,className:`min-w-0 text-[13px]`,children:t?(0,X.jsx)(`button`,{type:`button`,"data-agent-id":e.id,onClick:()=>t(e.id),"aria-haspopup":`dialog`,className:`flex min-h-5 w-full min-w-0 items-center gap-2.5 rounded-sm text-left hover:bg-muted/50`,children:n}):(0,X.jsx)(`div`,{className:`flex min-h-5 min-w-0 items-center gap-2.5`,children:n})})}function ua({status:e,stalled:t=!1}){return t?(0,X.jsx)(`svg`,{"aria-hidden":!0,"data-slot":`agent-glyph`,"data-stalled":`true`,className:`size-[15px] shrink-0 text-soft-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`3 2.5`,children:(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`})}):e===`completed`?(0,X.jsxs)(`svg`,{"aria-hidden":!0,"data-slot":`agent-glyph`,className:`size-[15px] shrink-0 text-success`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,X.jsx)(`path`,{d:`m8.5 12.2 2.4 2.4 4.6-5`})]}):e===`failed`||e===`declined`?(0,X.jsxs)(`svg`,{"aria-hidden":!0,"data-slot":`agent-glyph`,className:`size-[15px] shrink-0 text-danger`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,X.jsx)(`path`,{d:`m9 9 6 6M15 9l-6 6`})]}):(0,X.jsxs)(`svg`,{"aria-hidden":!0,"data-slot":`agent-glyph`,className:`size-[15px] shrink-0 animate-pulse motion-reduce:animate-none`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,X.jsx)(`circle`,{className:`stroke-pending`,cx:`12`,cy:`12`,r:`8.5`,strokeWidth:`2`}),(0,X.jsx)(`path`,{className:`fill-pending`,d:`M12 3.5 A8.5 8.5 0 0 1 12 20.5 Z`})]})}function da(e){return{done:e.filter(e=>e.status===`completed`).length,total:e.filter(e=>e.status!==`cancelled`).length}}function fa({entries:e}){return e.length===0?null:(0,X.jsx)(`ul`,{"data-slot":`plan-list`,className:`flex min-w-0 flex-col gap-[7px]`,children:e.map((e,t)=>(0,X.jsx)(pa,{entry:e},`${t}:${e.content}`))})}function pa({entry:e}){return(0,X.jsxs)(`li`,{"data-slot":`plan-item`,"data-status":e.status,className:a(`flex min-h-5 min-w-0 items-center gap-2.5 text-[13px]`,e.status===`completed`&&`text-soft-foreground line-through`,e.status===`in_progress`&&`font-medium`,e.status===`pending`&&`text-muted-foreground`,e.status===`cancelled`&&`text-soft-foreground/70 line-through`),children:[(0,X.jsx)(ma,{status:e.status}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.content}),e.status===`in_progress`?(0,X.jsx)(`span`,{"data-slot":`plan-tag`,className:`ml-auto shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:`in progress`}):null]})}function ma({status:e}){return e===`cancelled`?(0,X.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-soft-foreground/70`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`,opacity:`.5`}),(0,X.jsx)(`path`,{d:`m8.5 15.5 7-7`})]}):e===`completed`?(0,X.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-success`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,X.jsx)(`path`,{d:`m8.5 12.2 2.4 2.4 4.6-5`})]}):e===`in_progress`?(0,X.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 animate-pulse motion-reduce:animate-none`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,X.jsx)(`circle`,{className:`stroke-pending`,cx:`12`,cy:`12`,r:`8.5`,strokeWidth:`2`}),(0,X.jsx)(`path`,{className:`fill-pending`,d:`M12 3.5 A8.5 8.5 0 0 1 12 20.5 Z`})]}):(0,X.jsx)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-soft-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`})})}function ha(e){switch(e){case`done`:return`done`;case`running`:case`waiting`:case`review`:return`active`;case`failed`:case`cancelled`:return`failed`;case`pending`:case`skipped`:return`pending`}}function ga(e,t){let n=ha(e);return n===`active`&&t===`waiting`?`paused`:n}function _a(e){return e===`active`?`running`:e}function va(e){if(e.length===0)return 0;let t=new Set([`done`,`failed`,`cancelled`,`skipped`]),n=new Set([`running`,`waiting`,`review`]),r=0;for(let i of e)t.has(i.status)?r+=1:n.has(i.status)&&(r+=.5);return r/e.length}function ya({steps:e,runStatus:t=`running`}){if(e.length===0)return null;let n=va(e)*100;return(0,X.jsxs)(`div`,{"data-slot":`step-rail`,className:`flex min-w-0 flex-col gap-1`,children:[e.map((n,r)=>(0,X.jsxs)(`div`,{"data-slot":`step-row`,"data-visual":ga(n.status,t),className:`flex min-h-[22px] min-w-0 items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,X.jsx)(ba,{visual:ga(n.status,t)}),(0,X.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:n.name}),n.iterations>1?(0,X.jsxs)(`span`,{"data-slot":`step-iterations`,className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:[`×`,n.iterations]}):null,(0,X.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-[11px] text-soft-foreground tabular-nums`,children:[n.pluginKind??n.kind,` · step `,r+1,` of `,e.length]})]},n.id)),(0,X.jsx)(`div`,{"data-slot":`step-progress`,className:`mt-1 h-0.5 overflow-hidden rounded-full bg-muted`,children:(0,X.jsx)(`div`,{className:`h-full rounded-full bg-pending`,style:{width:`${n}%`}})})]})}function ba({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,X.jsx)(he,{"aria-hidden":!0,className:a(t,`text-success`)});case`active`:return(0,X.jsx)(Tt,{role:`status`,"aria-label":`Step running`,className:a(t,`animate-spin stroke-pending motion-reduce:animate-none [html.light_&]:stroke-pending-strong`)});case`paused`:return(0,X.jsx)(Se,{role:`img`,"aria-label":`Step paused`,className:a(t,xa)});case`failed`:return(0,X.jsx)(G,{"aria-hidden":!0,className:a(t,`text-danger`)});case`pending`:return(0,X.jsx)(K,{"aria-hidden":!0,className:a(t,`text-soft-foreground`)})}}var xa=`stroke-pending [html.light_&]:stroke-pending-strong`,Sa={done:`done`,failed:`failed`,cancelled:`cancelled`};function Ca(e){let t=Sa[e.status];return t?e.steps.map(e=>ha(e.status)===`active`?{...e,status:t}:e.status===`pending`?{...e,status:`skipped`}:e):wa(e)}function wa(e){let t=Ta(e.currentStepId,e.steps);return e.steps.some((e,n)=>n!==t&&e.status===`waiting`)?e.steps.map((e,n)=>n!==t&&e.status===`waiting`?{...e,status:`done`}:e):e.steps}function Ta(e,t){let n=t.findIndex(t=>t.id===e);if(n>=0)return n;let r=t.reduce((e,t,n)=>ha(t.status)===`active`?n:e,-1);if(r>=0)return r;let i=t.findIndex(e=>e.status===`pending`);return i>=0?i:t.reduce((e,t,n)=>t.status===`skipped`?e:n,0)}function Ea({items:e,lead:t=0}){let n=(0,Y.useRef)(null),[r,i]=(0,Y.useState)(-1/0);return(0,Y.useLayoutEffect)(()=>{let r=n.current;if(!r)return;let a=()=>{let n=r.getBoundingClientRect().width;if(!n&&r.getClientRects().length===0)return;let a=getComputedStyle(r),o=Number.parseFloat(a.width),s=o>0?n/o:1,c=(Number.parseFloat(a.columnGap)||0)*s,l=Array.from(r.children,e=>e.getBoundingClientRect().width),u=e.map((e,t)=>({...e,width:l[t]??0})),d=-1/0,f=()=>u.reduce((e,t)=>e+t.width,0)+Math.max(0,u.length-1)*c+(u.length>0?t*s:0);for(let t of[...new Set(e.map(e=>e.priority))].sort((e,t)=>e-t)){if(f()<=n)break;d=t,u=u.filter(e=>e.priority>t)}i(e=>e===d?e:d)};if(a(),typeof ResizeObserver>`u`)return;let o=new ResizeObserver(a);o.observe(r);for(let e of r.children)o.observe(e);return()=>o.disconnect()},[e,t]),(0,X.jsx)(`span`,{ref:n,"data-slot":`activity-summary`,className:`relative flex h-[max(1.5em,22px)] min-w-0 flex-1 items-center gap-2.5 overflow-clip whitespace-nowrap text-[13px] font-normal text-muted-foreground tabular-nums`,children:e.map(n=>{let i=n.priority<=r,a=n===e.find(e=>e.priority>r);return(0,X.jsxs)(`span`,{"data-summary-item":n.id,"data-hidden":i,"aria-hidden":i||void 0,inert:i||void 0,style:a&&t?{marginInlineStart:t}:void 0,className:`inline-flex w-max shrink-0 items-center gap-1.5 data-[hidden=true]:invisible data-[hidden=true]:absolute`,children:[!a||t>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`activity-separator`,className:`before:content-['·']`}):null,n.content]},n.id)})})}function Da({run:e,references:t}){return(0,X.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:t.map(t=>(0,X.jsx)(At,{reference:t,taskTitle:J(e),inert:!0},ue(t)))})}function Oa(e){return e.accountId===void 0||e.profilesPending?void 0:e.profilesError?e.accountId:e.accountId==="default"?bn(e.accounts,e.accountBackend)?`default`:void 0:e.known?bn(e.accounts,e.accountBackend)?e.known.label:void 0:`${e.accountId} (removed)`}function ka(e){let t=x(),n=m(),r=g(),{accounts:i}=_n(),a=e.runner??n.data?.defaultRunner??`claude`,o=e.model??`auto`,s=e.effort||`auto`,c=[...e.steps].reverse().find(e=>e.profileId),l=c?.profileId,u=c?.backend??a,d=r.data?.profiles.find(e=>e.id===l&&e.provider===u),p=Oa({accountId:l,profilesPending:r.isPending,profilesError:r.isError,known:d,accounts:i,accountBackend:u}),h=e.modelIdentity&&e.modelIdentity!==o?e.modelIdentity:void 0;return{runner:e.removedRunner===void 0?f(t.data,a):D(e.removedRunner),...p?{account:p}:{},model:o,effort:s,...h?{identity:h}:{}}}var Aa=[`running`,`queued`,`waiting`];function ja(e){return Array.isArray(e)?e.filter(e=>e?.kind===`pr`||e?.kind===`timer`||e?.kind===`worker`||e?.kind===`process`||e?.kind===`peer`||e?.kind===`subagent`||e?.kind===`plugin`):[]}function $(e){let t=e?new Date(e):void 0;return t&&Number.isFinite(t.getTime())?new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(t):void 0}function Ma(e,t){return`${e} — ${t.status===`failed`?`not delivered; Continue delivers it, Stop discards it`:t.status===`running`?`current turn still working`:`waiting for capacity`}`}function Na(e){return e.kind!==`worker`&&e.kind!==`peer`&&e.kind!==`subagent`}function Pa(e){let t=ja(e.waits),n=Aa.includes(e.status),r=t.filter(t=>t.phase===`open`?n:t.phase===`resolved`&&Na(t)&&(n||e.status===`failed`)),i=r.some(e=>e.kind===`pr`),a=[...ja(e.lastWaits),...t.filter(e=>!r.includes(e)&&e.phase!==`open`)],o=i?void 0:a.filter(e=>e.kind===`pr`).at(-1),s=i?void 0:e.lastWaitsError,c=r.some(e=>e.kind===`process`)?void 0:a.filter(e=>e.kind===`process`).at(-1);return r.length||o||s||c?{open:r,lastCi:o,error:s,lastProcess:c}:void 0}function Fa(e){return Pa(e)!==void 0}function Ia(e){return(Pa(e)?.open??[]).filter(e=>e.kind===`pr`).map(e=>({kind:`PR`,number:e.prNumber,url:e.prUrl}))}function La({run:e}){let t=Pa(e);if(!t)return null;let{open:n,lastCi:r,error:i,lastProcess:a}=t;return(0,X.jsxs)(`div`,{"data-slot":`open-waits`,className:`flex min-w-0 flex-col gap-1`,children:[n.map(t=>t.kind===`pr`?(0,X.jsx)(za,{run:e,wait:t},t.id):t.kind===`worker`?(0,X.jsx)(Ba,{wait:t},t.id):t.kind===`process`?(0,X.jsx)(Ka,{run:e,wait:t},t.id):t.kind===`peer`?(0,X.jsx)(Va,{wait:t},t.id):t.kind===`subagent`?(0,X.jsx)(Ha,{wait:t},t.id):t.kind===`plugin`?(0,X.jsx)(Ua,{run:e,wait:t},t.id):(0,X.jsx)(Wa,{run:e,wait:t},t.id)),i?(0,X.jsx)(`div`,{"data-slot":`ci-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:i}):r?(0,X.jsx)(za,{run:e,wait:r,settled:!0}):null,a?(0,X.jsx)(Ka,{run:e,wait:a,settled:!0}):null]})}function Ra(e,t,n){let r=t.result,i=t.until!==`checks`,a={passed:`CI checks passed — observed checks only; not merge approval`,stuck:`CI checks stuck in queue — inspect the PR checks`,failed:`CI checks failed — inspect the PR checks`,conflicting:i?`PR has merge conflicts — inspect the PR; not merged`:`PR has merge conflicts — inspect the PR; not merge approval`,cancelled:i?`Merge wait cancelled`:`CI wait cancelled`,skipped:`CI checks skipped — inspect the PR checks`,no_checks:`No CI checks found — inspect the PR workflows`,startup_failure:`CI workflow never started — inspect the PR workflows`,deadline:i?`Merge wait timed out — merge not confirmed`:`CI wait timed out — inspect the PR checks`,error:i?`Merge wait unavailable — inspect access and the PR`:`CI wait unavailable — inspect access and the PR checks`,head_changed:`CI head changed — ${r?.headSha?Fn(r.headSha):`unknown`} → ${r?.observedHeadSha?Fn(r.observedHeadSha):`unknown`}`,merged:`PR merged`,closed:`PR closed without merge — inspect the PR`,blocked:`Initiated merge blocked — inspect the PR; not merged`},o=i?`Merge`:`CI`,s=n&&t.phase===`cancelled`;return n?s?`${o} wait cancelled`:r?a[r.outcome]:`${o} wait unavailable`:t.phase===`resolved`?Ma(`${o} result ready`,e):t.until===`merge_or_blocked`?`Waiting for merge or blockage`:i?`Waiting for merge`:`Waiting for CI`}function za({run:e,wait:t,settled:n=!1}){let r=t.result,a=t.until===`checks`?`CI`:`Merge`,o=n&&t.phase===`cancelled`,s=Ra(e,t,n),c=n?o?t.cancelledAt:r?.observedAt:t.deadline,l=$(c),u=`${t.repository}#${t.prNumber}`;return(0,X.jsx)(`div`,{"data-slot":`ci-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-[13px] text-muted-foreground [overflow-wrap:anywhere]`,children:(0,X.jsxs)(`dl`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-baseline gap-x-3 gap-y-1`,children:[(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Status`}),(0,X.jsx)(`dd`,{children:s}),(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Pull request`}),(0,X.jsx)(`dd`,{className:`min-w-0`,children:i(t.prUrl)?(0,X.jsx)(`a`,{href:t.prUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-h-11 min-w-11 max-w-full items-center rounded-sm px-1 font-medium text-foreground underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:bg-muted`,children:u}):(0,X.jsx)(`span`,{children:u})}),l?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:n?o?`Cancelled`:`Observed`:`Deadline`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(`time`,{dateTime:c,children:l})})]}):n?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Deadline`}),(0,X.jsxs)(`dd`,{children:[a,` deadline unavailable`]})]})]})})}function Ba({wait:e}){let t=e.workerIds!==void 0,n=new Set((t?e.outcomes:e.requestOutcomes)?.map(e=>`workerId`in e?e.workerId:e.requestId)),r=(e.workerIds??e.requestIds??[]).filter(e=>!n.has(e)).length,i=t?r===1?`worker`:`workers`:r===1?`request reply`:`request replies`,a=$(e.deadline);return(0,X.jsxs)(`div`,{"data-slot":`worker-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,X.jsxs)(`p`,{children:[`Waiting on `,r,` `,i]}),a?(0,X.jsxs)(`p`,{children:[`Deadline`,` `,(0,X.jsx)(`time`,{dateTime:e.deadline,children:a})]}):(0,X.jsx)(`p`,{children:`Worker wait deadline unavailable`})]})}function Va({wait:e}){let t=e.peerIds.length,n=$(e.deadline);return(0,X.jsxs)(`div`,{"data-slot":`peer-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,X.jsxs)(`p`,{children:[`Waiting on `,t,` `,t===1?`task`:`tasks`]}),n?(0,X.jsxs)(`p`,{children:[`Deadline`,` `,(0,X.jsx)(`time`,{dateTime:e.deadline,children:n})]}):(0,X.jsx)(`p`,{children:`Peer wait deadline unavailable`})]})}function Ha({wait:e}){let t=(Array.isArray(e.children)?e.children:[]).filter(e=>e?.status===`running`).length,n=$(e.deadline);return(0,X.jsxs)(`div`,{"data-slot":`subagent-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,X.jsxs)(`p`,{children:[`Waiting for `,t,` `,t===1?`subagent`:`subagents`]}),n?(0,X.jsxs)(`p`,{children:[`Check by`,` `,(0,X.jsx)(`time`,{dateTime:e.deadline,children:n})]}):(0,X.jsx)(`p`,{children:`Subagent wait deadline unavailable`})]})}function Ua({run:e,wait:t}){let n=t.phase===`open`?$(t.deadline):void 0;return(0,X.jsxs)(`div`,{"data-slot":`plugin-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,X.jsx)(`p`,{children:t.phase===`resolved`?Ma(t.summary,e):t.summary}),n?(0,X.jsxs)(`p`,{children:[`Deadline`,` `,(0,X.jsx)(`time`,{dateTime:t.deadline,children:n})]}):null]})}function Wa({run:e,wait:t}){let n=$(t.deadline);return(0,X.jsxs)(`div`,{"data-slot":`monitoring-schedule`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[t.phase===`resolved`?(0,X.jsx)(`p`,{children:Ma(`Automatic check due`,e)}):n?(0,X.jsxs)(`p`,{children:[`Next automatic check`,` `,(0,X.jsx)(`time`,{dateTime:t.deadline,className:`font-medium text-foreground`,children:n})]}):(0,X.jsx)(`p`,{children:`Automatic check time unavailable`}),t.note?(0,X.jsx)(`p`,{children:t.note}):null]})}function Ga(e){let t=e.result;return t?t.outcome===`exit_file`?t.exitCode===void 0?`PID ${e.pid} wrote an exit file that is not an exit code`:`PID ${e.pid} exited with code ${t.exitCode}`:t.outcome===`exited`?e.startToken===void 0&&t.observedAt===e.registeredAt?`PID ${e.pid} was not running when the wait was registered`:`PID ${e.pid} exited, code unknown`:t.outcome===`deadline`?`PID ${e.pid} still running at the deadline`:`PID ${e.pid} could not be checked`:`PID ${e.pid} still running at the deadline`}function Ka({run:e,wait:t,settled:n=!1}){let r=n&&t.phase===`cancelled`?`Process wait on PID ${t.pid} cancelled`:n?Ga(t):t.phase===`resolved`?Ma(Ga(t),e):`Waiting for PID ${t.pid}${t.note?` — ${t.note}`:``}`,i=!n&&t.phase===`open`?$(t.deadline):void 0;return(0,X.jsxs)(`div`,{"data-slot":`process-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,X.jsx)(`p`,{children:r}),i?(0,X.jsxs)(`p`,{children:[`Until`,` `,(0,X.jsx)(`time`,{dateTime:t.deadline,children:i})]}):null]})}var qa=new Map,Ja=new Map;function Ya(e){let{referenceProjectId:t,repoBase:n,references:r,requests:i}=Ct(e.run);return(0,X.jsx)(Dt,{projectId:t,repoBase:n,requests:i,children:(0,X.jsx)(Xa,{...e,references:r,prNumbers:i.filter(e=>e.kind===`PR`).map(e=>e.number),hasReferences:r.length>0||!!ce(e.run)||!!se(e.run,n)})})}function Xa({run:e,thread:t,currentThread:n,currentComplete:r=!0,pendingAsk:i=!1,onOpenWorker:a,readerScroll:o,prNumbers:s,hasReferences:c,references:l}){let u=gn(),d=ka(e),[f,p]=(0,Y.useState)(()=>i?!1:qa.get(e.id)??!1),m=po(o,f),h=m.open,[g,_]=(0,Y.useState)({}),v=Za(e,t??n,n,r,s),y=xt(e),b=t=>g[t]??Ja.get(`${e.id}:${t}`)??t===`workers`,x=t=>{let n=!b(t);Ja.set(`${e.id}:${t}`,n),_(e=>({...e,[t]:n}))},S=e=>({open:b(e),onToggle:()=>x(e)});return(0,X.jsxs)(`section`,{"data-slot":`run-activity-dock`,ref:m.ref,"data-state":h?`open`:`collapsed`,className:`min-w-0 overflow-hidden rounded-xl border border-border bg-card shadow-xs`,children:[(0,X.jsx)(no,{run:e,identity:d,activity:v,references:l,open:h,onToggle:()=>{qa.set(e.id,!h),p(!h),m.chose(!h)}}),h?(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col border-t border-border`,children:[(0,X.jsx)(ao,{run:e,activity:v,...S(`status`)}),(0,X.jsx)(oo,{run:e,desktop:u,automations:v.automations,...S(`workflow`)}),(0,X.jsx)(so,{activity:v,desktop:u,onOpenWorker:a,...S(`subagents`)}),(0,X.jsx)(co,{run:e,...S(`workers`)}),(0,X.jsx)(lo,{activity:v,desktop:u,...S(`plan`)}),(0,X.jsx)(uo,{run:e,identity:d,activity:v,...S(`usage`)}),(0,X.jsx)(fo,{run:e,references:l,conflicts:v.conflicts,hasReferences:c,onResume:()=>y.mutate(),...S(`workspace`)})]}):null]})}function Za(e,t,n,r,i){let a=T(),o=On(a.data),s=S(),c=vt(e,{queuePosition:e.status===`queued`?Jt(s.data??[]).get(e.id):void 0}),l=kt(i),u=!Kt(e)&&e.status!==`queued`,d=(0,Y.useMemo)(()=>r?ir(n.turns,u,t.turns):[],[r,n.turns,u,t.turns]),f=It(n)??[],p=Hi(e),m=or(d),h=da(f);return{line:c,...Qa(e,c,p,r?m:void 0,h),...$a(e,o),conflicts:l,waitReferences:Ia(e),agents:d,agentCounts:m,planEntries:f,planCounts:h,automations:pn(a.data)}}function Qa(e,t,n,r,i){let a=e.steps.every(e=>e.status===`done`||e.status===`skipped`),o=e.status===`done`&&a&&n===`complete`&&r!==void 0&&r.done===r.total&&i.done===i.total;return{allComplete:o,statusText:o?`All complete`:e.status!==`done`||r===void 0?t.label:n===`unknown`?`Workers unavailable`:n===`pending`?`In progress`:`Incomplete`,failed:t.attention.tone===`danger`||e.status===`cancelled`,glyph:o?(0,X.jsx)(he,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-success`}):(0,X.jsx)(Zt,{tone:t.attention.tone,shape:t.attention.shape,pulse:t.attention.pulse})}}function $a(e,t){return{cost:t.cost&&e.costUsd!==void 0?le(e.costUsd):void 0,tokens:t.tokens&&(e.inputTokens!==void 0||e.outputTokens!==void 0)?(0,X.jsx)(xn,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):void 0}}function eo(e){return e.allComplete?`text-success`:e.failed&&`text-danger`}function to(e){let t=Ca(e),n=Ta(e.currentStepId,t);return t.length>0?{steps:t,index:n,step:t[n]}:void 0}function no({run:e,identity:t,activity:n,references:r,open:i,onToggle:o}){let{cost:s}=n,c=[...new Map([...r,...n.waitReferences].map(e=>[ue(e),e])).values()];return(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-label":ro(e,t,n,c,i),onClick:o,className:a(`flex min-h-11 w-full min-w-0 items-center px-3.5 py-2 text-start text-[14px] hover:bg-muted/40 active:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`,i?`gap-2.5`:`gap-2`),children:[(0,X.jsx)(De,{"aria-hidden":!0,className:`size-4 shrink-0 text-accent-text`}),(0,X.jsx)(`span`,{className:`shrink-0 font-semibold`,children:`Activity`}),i?null:(0,X.jsx)(io,{run:e,identity:t,activity:n,summaryReferences:c}),i&&s?(0,X.jsx)(`span`,{"data-slot":`run-activity-cost`,className:`ms-auto shrink-0 text-[13px] text-muted-foreground tabular-nums`,children:s}):null,(0,X.jsx)(ye,{"aria-hidden":!0,className:a(`size-4 shrink-0 text-soft-foreground motion-safe:transition-transform motion-reduce:transition-none`,i&&!s&&`ms-auto`,i&&`rotate-180`)})]})}function ro(e,t,n,r,i){let{statusText:a,conflicts:o,cost:s}=n,c=`Session activity: ${a}${o.length?`; pull request conflicts`:``}${s?`; cost ${s}`:``}`;if(i)return c;let l=to(e)?.step,u=l?`; step ${l.name}, ${_a(ga(l.status,e.status))}`:``,d=r.length?`; ${r.map(e=>`${e.kind} #${e.number}`).join(`; `)}`:``;return`${c}${u}; runner ${t.runner}; model ${t.model}; effort ${t.effort}${d}`}function io({run:e,identity:t,activity:n,summaryReferences:r}){let{statusText:i,cost:o,conflicts:s}=n,c=to(e)?.step,l=[{id:`runner`,priority:2,content:t.runner},{id:`model`,priority:4,content:t.model},{id:`effort`,priority:3,content:t.effort},...o?[{id:`cost`,priority:1,content:(0,X.jsx)(`span`,{"data-slot":`run-activity-cost`,children:o})}]:[],...r.length||s.length?[{id:`chips`,priority:0,content:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Da,{run:e,references:r}),s.length>0?(0,X.jsxs)(`span`,{"data-slot":`run-activity-conflict`,className:`inline-flex items-center gap-1 font-medium text-conflict`,children:[(0,X.jsx)(xe,{"aria-hidden":!0,className:`size-3.5`}),`Conflicts`]}):null]})}]:[]];return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{"data-slot":`run-activity-status`,title:i,className:a(`inline-flex min-w-[calc(0.875rem+3ch)] flex-[0_1_auto] items-center gap-1.5 text-[13px] whitespace-nowrap text-muted-foreground`,eo(n)),children:[n.glyph,(0,X.jsx)(`span`,{"data-slot":`run-activity-status-label`,className:`min-w-0 truncate`,children:i})]}),c?(0,X.jsxs)(`span`,{"data-slot":`run-activity-step`,className:a(`flex max-w-max min-w-[calc(1.375rem+2ch)] flex-[1000_1_0] items-center gap-1.5 text-[13px] text-muted-foreground`,e.status===`waiting`&&`max-md:hidden`),children:[(0,X.jsx)(_o,{step:c,runStatus:e.status,decorative:!0}),(0,X.jsx)(`span`,{"data-slot":`run-activity-step-name`,title:c.name,className:`min-w-0 truncate`,children:c.name})]}):null,(0,X.jsx)(`span`,{className:`-ms-2 flex min-w-0 flex-[1_1_0]`,children:(0,X.jsx)(Ea,{items:l,lead:8})})]})}function ao({run:e,activity:t,open:n,onToggle:r}){let{line:i,waitReferences:o}=t,s=Zi(e);return(0,X.jsxs)(Q,{slot:`status-row`,icon:t.glyph,title:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{"data-slot":`run-activity-status`,className:a(`truncate`,eo(t)),children:t.statusText}),i.nextCheck?(0,X.jsxs)(`span`,{"data-slot":`run-activity-next-check`,className:`whitespace-normal text-[13px] font-normal text-muted-foreground`,children:[`Next check `,(0,X.jsx)(`time`,{dateTime:i.nextCheck.at,children:i.nextCheck.text})]}):null]}),summary:!n&&o.length>0?(0,X.jsx)(Ea,{items:[{id:`chips`,priority:0,content:(0,X.jsx)(Da,{run:e,references:o})}]}):void 0,open:n,onToggle:Fa(e)||s?r:void 0,children:[(0,X.jsx)(La,{run:e}),s?(0,X.jsx)(Qi,{run:e}):null]})}function oo({run:e,desktop:t,automations:n,open:r,onToggle:i}){let a=de(e),o=to(e);return!a&&!o?null:(0,X.jsxs)(Q,{slot:`workflow`,icon:o?(0,X.jsx)(_o,{step:o.step,runStatus:e.status}):(0,X.jsx)(Te,{className:`size-4`}),title:(0,X.jsxs)(X.Fragment,{children:[`Workflow`,a?(0,X.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` · `,a]}):null]}),meta:o?{drop:o.step.name,keep:Ri(o.index+1,o.steps.length,t,`step`)}:void 0,open:r,onToggle:i,children:[o?(0,X.jsx)(ya,{steps:o.steps,runStatus:e.status}):null,(0,X.jsx)(go,{run:e,available:n})]})}function so({activity:e,desktop:t,onOpenWorker:n,open:r,onToggle:i}){let{agents:a,agentCounts:o}=e;return a.length===0?null:(0,X.jsx)(Q,{slot:`subagents`,icon:(0,X.jsx)(Ce,{className:`size-4`}),title:`Subagents`,meta:Ri(o.done,o.total,t),open:r,onToggle:i,children:(0,X.jsx)(ca,{agents:a,onSelect:n})})}function co({run:e,open:t,onToggle:n}){return Bi(e)?(0,X.jsx)(Wi,{run:e,open:t,onToggle:n}):null}function lo({activity:e,desktop:t,open:n,onToggle:r}){let{planEntries:i,planCounts:a}=e;return i.length===0?null:(0,X.jsx)(Q,{slot:`plan`,icon:(0,X.jsx)(pe,{className:`size-4`}),title:`Plan`,meta:Ri(a.done,a.total,t),open:n,onToggle:r,children:(0,X.jsx)(fa,{entries:i})})}function uo({run:e,identity:t,activity:n,open:r,onToggle:i}){let{cost:a,tokens:o}=n,s=e.modelIdentity?.includes(`/`)?e.modelIdentity.split(`/`)[0]:void 0,c=[...s?[{id:`provider`,priority:2,content:s}]:[],{id:`model`,priority:4,content:t.model},{id:`effort`,priority:3,content:t.effort},...a?[{id:`cost`,priority:1,content:a}]:[],...o?[{id:`tokens`,priority:0,content:o}]:[]];return(0,X.jsx)(Q,{slot:`usage`,icon:(0,X.jsx)(zn,{className:`size-4`}),title:`Usage & agent`,summary:(0,X.jsx)(`span`,{"data-slot":`run-activity-meta`,className:`contents`,children:(0,X.jsx)(Ea,{items:c})}),open:r,onToggle:i,children:(0,X.jsx)(ho,{run:e,tokens:o,cost:a})})}function fo({run:e,references:t,conflicts:n,hasReferences:r,onResume:i,open:a,onToggle:o}){let s=e.delegation?.role===`worker`?e.delegation.destroy:void 0;if(!(e.branch||e.worktreePath||r||vn(e)||ia(s)))return null;let c=n.length===1?`PR #${n[0]} conflicts`:`${n.length} PRs conflict`;return(0,X.jsx)(Q,{slot:`workspace`,icon:(0,X.jsx)(fe,{className:`size-4`}),title:`Workspace`,summary:!a&&t.length>0?(0,X.jsx)(`span`,{"data-slot":`run-activity-meta`,className:`contents`,children:(0,X.jsx)(Ea,{items:[...e.branch?[{id:`branch`,priority:0,content:(0,X.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.branch})}]:[],{id:`chips`,priority:1,content:(0,X.jsx)(Da,{run:e,references:t})},...n.length>0?[{id:`conflicts`,priority:2,content:(0,X.jsx)(`span`,{className:`font-medium text-conflict`,children:c})}]:[]]})}):void 0,meta:n.length>0?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-conflict`,children:[(0,X.jsx)(xe,{"aria-hidden":!0,className:`size-3.5`}),c]}):e.branch?(0,X.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.branch}):void 0,open:a,onToggle:o,children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 text-[13px] text-muted-foreground`,children:[s?(0,X.jsx)(aa,{state:s}):null,(0,X.jsx)(yt,{run:e}),e.branch?(0,X.jsx)(mo,{label:`Branch`,children:(0,X.jsx)(St,{branch:e.branch})}):null,e.worktreePath?(0,X.jsx)(mo,{label:`Worktree`,children:(0,X.jsx)(`span`,{className:`min-w-0 break-all font-mono text-[12px] text-foreground`,children:e.worktreePath})}):null,(0,X.jsx)(_t,{run:e,canResume:Tn(e).terminal,onResume:i})]})})}function po(e,t){let n=(0,Y.useRef)(null),[r,i]=(0,Y.useState)(!1),a=(0,Y.useRef)(t);a.current=t;let o=(0,Y.useRef)({active:!1,override:!1});return(0,Y.useEffect)(()=>e?.(e=>{if(e.direction===`tail`){o.current={active:!1,override:!1},i(!1);return}if(e.direction===`down`){i(!1);return}if(o.current.active=!0,o.current.override||!a.current)return;let t=n.current?.closest(`[data-slot="thread-dock"]`);!t||getComputedStyle(t).position!==`sticky`||e.distanceFromBottom<=t.getBoundingClientRect().height||i(!0)}),[e]),{ref:n,open:t&&!r,chose:e=>{i(!1),e&&o.current.active&&(o.current.override=!0)}}}function mo({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,X.jsx)(`span`,{className:`w-20 shrink-0 font-medium text-foreground`,children:e}),t]})}function ho({run:e,tokens:t,cost:n}){let{runner:r,account:i,model:a,effort:o,identity:s}=ka(e);return(0,X.jsxs)(`dl`,{"data-slot":`agent-details`,className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-[13px]`,children:[t?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Tokens`}),(0,X.jsx)(`dd`,{className:`min-w-0 text-[12px]`,children:t})]}):null,n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Cost`}),(0,X.jsx)(`dd`,{className:`min-w-0 font-mono text-[12px] tabular-nums`,children:n})]}):null,(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Runner`}),(0,X.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[12px]`,children:r}),i?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Account`}),(0,X.jsx)(`dd`,{"data-slot":`agent-badge-account`,className:`min-w-0 break-all font-mono text-[12px]`,children:i})]}):null,(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Model`}),(0,X.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[12px]`,children:a}),(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Effort`}),(0,X.jsx)(`dd`,{"data-slot":`agent-badge-effort`,className:`min-w-0 break-all font-mono text-[12px]`,children:o}),s?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`font-medium text-foreground`,children:`Identity`}),(0,X.jsx)(`dd`,{"data-slot":`agent-badge-identity`,className:`min-w-0 break-all font-mono text-[12px]`,children:s})]}):null]})}function go({run:e,available:t}){if(!e.automation)return null;let n=`inline-flex min-h-11 items-center rounded-sm text-[13px] font-medium md:min-h-8`;return(0,X.jsxs)(`p`,{className:`mt-2 text-[13px] text-muted-foreground`,children:[`Launched by`,` `,t?(0,X.jsx)(Ht,{to:`/automations/${encodeURIComponent(e.automation.automationId)}/log`,className:a(n,`text-foreground underline underline-offset-2`),children:`Automation`}):(0,X.jsx)(`span`,{"data-slot":`automation-origin`,title:`Automations are off on this server (CEZ_AUTOMATIONS)`,className:n,children:`Automation`})]})}function _o({step:e,runStatus:t,decorative:n=!1}){let r=ga(e.status,t),i=`size-4 shrink-0`;switch(r){case`active`:return(0,X.jsx)(Tt,{...n?{"aria-hidden":!0}:{role:`status`,"aria-label":`Step running`},"data-slot":`workflow-glyph`,"data-visual":r,className:a(i,`animate-spin stroke-pending motion-reduce:animate-none [html.light_&]:stroke-pending-strong`)});case`paused`:return(0,X.jsx)(Se,{...n?{"aria-hidden":!0}:{role:`img`,"aria-label":`Step paused`},"data-slot":`workflow-glyph`,"data-visual":r,className:a(i,xa)});case`failed`:return(0,X.jsx)(G,{"aria-hidden":!0,"data-slot":`workflow-glyph`,"data-visual":r,className:a(i,`text-danger`)});case`pending`:return(0,X.jsx)(K,{"aria-hidden":!0,"data-slot":`workflow-glyph`,"data-visual":r,className:a(i,`text-soft-foreground`)});case`done`:return(0,X.jsx)(he,{"aria-hidden":!0,"data-slot":`workflow-glyph`,"data-visual":r,className:a(i,`text-success`)})}}var vo=2e3;function yo(e){let t=0,n=0;for(let r of e)typeof r.seq==`number`&&(r.type===`session.ended`&&r.seq>t&&(t=r.seq),(r.type===`session.started`||r.type===`step-start`&&r.kind===`agent`)&&r.seq>n&&(n=r.seq));return t>n?t:0}function bo(e){let t=0,n=0;for(let r of e)typeof r.seq==`number`&&(r.type===`turn-end`&&r.seq>t&&(t=r.seq),(r.type===`turn.started`||r.type===`session.started`||r.type===`user-message`||r.type===`step-start`&&r.kind===`agent`)&&r.seq>n&&(n=r.seq));return t>n?t:0}function xo(e,t){let n=I(),r=(0,Y.useMemo)(()=>yo(t),[t]),i=(0,Y.useMemo)(()=>bo(t),[t]),a=e?.id,o=e?.status;(0,Y.useEffect)(()=>{if(!(r!==0&&(o===`running`||o===`waiting`))&&!(i!==0&&o===`running`)||a===void 0)return;let e=setTimeout(()=>{n.invalidateQueries({queryKey:d.runs.detail(a)}),n.invalidateQueries({queryKey:d.runs.list()})},vo);return()=>clearTimeout(e)},[r,i,a,o,n])}function So(e){let t=e.querySelector(`[data-slot="ask-origin"]`);return t&&(t.tabIndex=-1),t}function Co({pendingAskId:e,askSeq:t,rows:n,history:r,jumpToRow:i}){let[a,o]=(0,Y.useState)(void 0),s=(0,Y.useCallback)(()=>o(e),[e]),c=r?.visibleEvents,l=t!==void 0&&(c?.some(({seq:e})=>e===t)??!1),u=r?.hasOlder??!1,d=r?.isFetchingOlder??!1,f=r?.olderError,p=r?.loadOlder;return(0,Y.useEffect)(()=>{if(a===void 0)return;if(a!==e){o(void 0);return}let r=Ci(n,a,`origin`);if(r){o(void 0),i(r.key,r.index,So);return}if(!(p!==void 0&&u&&f===void 0&&t!==void 0&&!l)){o(void 0);return}d||p().catch(()=>{})},[a,e,n,c,l,u,d,f,p,t,i]),{reveal:s,seeking:a!==void 0&&a===e}}function wo(){let{id:e}=W(),t=p(e),n=wn(e),r=t.data?.status,i=(0,Y.useMemo)(()=>Nt(n.visibleEvents,{activeTurn:r===`running`}),[n.visibleEvents,r]),a=(0,Y.useMemo)(()=>Nt(n.currentEvents,{activeTurn:r===`running`}),[n.currentEvents,r]),o=(0,Y.useRef)(void 0),s=(0,Y.useCallback)(e=>{o.current=e},[]),{mutate:c}=u();if((0,Y.useEffect)(()=>{t.data&&o.current!==t.data.id&&Yt(t.data)&&c(t.data.id)},[c,t.data?.id,t.data?.status,t.data?.finishedAt,t.data?.seenAt,t.data?.archived]),xo(t.data,n.visibleEvents),t.isPending)return(0,X.jsx)(In,{});if(t.isError){let e=t.error instanceof k&&t.error.status===404;return(0,X.jsx)(on,{route:`task-thread`,density:`empty`,flushPadding:!0,children:(0,X.jsx)(sn,{icon:e?(0,X.jsx)(Ot,{}):(0,X.jsx)(Bn,{}),tone:e?`neutral`:`danger`,title:e?`Task not found`:`Could not load this task`,subtitle:e?`No run has this id. It may have been deleted, or the link is from another machine.`:t.error.message,actions:(0,X.jsx)(q,{asChild:!0,variant:`outline`,children:(0,X.jsx)(Ht,{to:`/`,children:`Back to tasks`})})})})}return n.isPending?(0,X.jsx)(In,{}):(0,X.jsx)(Eo,{run:t.data,thread:i,currentThread:a,history:n,onMarkedUnread:s})}var To=e=>({titles:Object.fromEntries(e.map(e=>[e.id,J(e)])),backends:Object.fromEntries(e.map(e=>[e.id,e.currentStepBackend??e.runner]))});function Eo({run:e,thread:t,currentThread:n=t,history:r,onMarkedUnread:i}){Vt();let a=L({queryKey:d.runs.list(),queryFn:({signal:e})=>te(_(),{signal:e}),select:To}),{pendingAsk:c,transcriptAsk:l,pendingAskId:u,historyLoading:f}=Do(r,n),p=O(e),m=Mt(e.status,e.error,t),h=kn(e),g=!h&&e.status!==`queued`,v=e.status===`queued`,x=Jn(e),S=sa(e),ee=ct(e.id),C=l||ne(e),{hasContinuation:T,continuable:D}=Oo(h,v,x),[k,A]=(0,Y.useState)(void 0),[j,M]=(0,Y.useState)(e.id);j!==e.id&&(M(e.id),A(void 0));let N=(0,Y.useMemo)(()=>k===void 0?void 0:lr(n.turns,k,g,t.turns),[n.turns,k,g,t.turns]),P=(0,Y.useMemo)(()=>k===void 0?[]:fr(t.turns,n.turns,k),[t.turns,n.turns,k]),F=b(e.id),I=cn(e),{providerBlocked:R,providerReason:z}=ko(h,yn(e),T,x),{mutateAsync:B}=o(e.id),{mutateAsync:V}=E(e.id),{mutateAsync:H}=s(e.id),U=(0,Y.useMemo)(()=>v?{onEditTask:async e=>{await B({task:e})},onEditMessage:(e,t)=>V({msgId:e,message:{text:t}}).then(()=>void 0),onRemoveMessage:e=>H(e).then(()=>void 0)}:void 0,[v,B,V,H]),re=f?void 0:u??null,ie=(0,Y.useMemo)(()=>bi(e,t,n,re),[e,t,n,re]),W=(0,Y.useMemo)(()=>Ei(ie,e.id),[ie,e.id]),oe=e.delegation?.role===`root`||e.delegation?.role===`worker`,ce=y(e.id,{enabled:oe}),le=(0,Y.useMemo)(()=>({...Er(e,void 0,ce.data?.titles),...a.data?.titles,[e.id]:J(e)}),[e,a.data,ce.data]),ue=(0,Y.useMemo)(()=>({...a.data?.backends,...Tr(e,void 0)}),[e,a.data]),de=(0,Y.useCallback)(t=>(0,X.jsx)(xr,{permission:t,runId:e.id,sessionOpen:h}),[e.id,h]),fe=(0,Y.useMemo)(()=>{if(U===void 0)return;let t={task:{onEdit:U.onEditTask,editLabel:`Edit the prompt`}};for(let n of e.queuedMessages??[])t[`queued:${n.id}`]={onEdit:e=>U.onEditMessage(n.id,e),onRemove:()=>U.onRemoveMessage(n.id)};return t},[U,e.queuedMessages]),pe=se(e,w()),{search:me}=ae(),he=Re(me,W.length),G=ui(`${e.id}:main`,{onLoadOlder:r?.hasOlder?r.loadOlder:void 0,onJumpToLatest:r?.jumpToLatest,rowKeys:W.map(({key:e})=>e)}),{pinnedAsk:ge,pendingQuestions:_e}=Ao(ie),ve=Co({pendingAskId:u,askSeq:r?c?.seq:void 0,rows:W,history:r,jumpToRow:G.jumpToRow}),ye=(0,Y.useRef)(u);f||(ye.current=u);let K=(0,Y.useRef)({rows:W,jumpToRow:G.jumpToRow,reveal:ve.reveal});K.current={rows:W,jumpToRow:G.jumpToRow,reveal:ve.reveal};let be=(0,Y.useCallback)(t=>t.placement===`origin`?(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t.resolved&&t.context?(0,X.jsx)(ot,{text:t.context}):null,t.resolved?null:(0,X.jsx)(ai,{onGoToQuestion:()=>{let{rows:e,jumpToRow:n}=K.current,r=Ci(e,t.id,`pinned`);r&&n(r.key,r.index,e=>ei(e))}})]}):(0,X.jsx)(qe,{ask:t,run:e,onShowOrigin:()=>K.current.reveal()}),[e]);Bt(G.restickIfStuck);let xe=oi();return(0,X.jsxs)(on,{route:`task-thread`,density:t.turns.length===0?`empty`:`full`,flushPadding:!0,rootRef:xe,rootProps:{"data-run-id":e.id},children:[(0,X.jsx)(wt,{run:e,onMarkedUnread:()=>i?.(e.id)}),(0,X.jsx)(jo,{run:e,thread:t,history:r,footer:m,issueUrl:pe,sections:ie,renderAsk:be,renderPermission:de,messageActions:fe,scroll:G,mode:he,taskTitles:le,recipientBackends:ue}),(0,X.jsx)(ut,{status:e.status}),(0,X.jsx)(Fi,{runId:e.id,renderAsk:be,renderPermission:de,agent:N,entries:P,taskTitles:le,recipientBackends:ue,onClose:()=>A(void 0)}),(0,X.jsx)(Mo,{run:e,thread:t,currentThread:n,currentComplete:r?.currentComplete??!0,scroll:G,pendingQuestions:_e,onJump:()=>{let e=_e>0?ge?.id:void 0;G.jumpToLatest(e===void 0?void 0:ti(e,()=>ye.current===e))},onOpenWorker:A,sessionOpen:h,attention:p,queued:v,continuable:D,continueAction:x,stopAction:S,finishAction:ee,needsAnswer:C,sendMessage:F,reply:I,providerBlocked:R,providerReason:z}),(0,X.jsx)(`div`,{"data-slot":`thread-tail-anchor`,"aria-hidden":`true`,className:`h-px shrink-0 md:hidden`})]})}function Do(e,t){let n=e?Et(e.currentEvents):void 0;return{pendingAsk:n,transcriptAsk:e?n!==void 0:t.turns.some(e=>e.items.some(e=>e.kind===`ask`&&!e.resolved)),pendingAskId:e?n?.requestId:t.turns.flatMap(e=>e.items).reverse().find(e=>e.kind===`ask`&&!e.resolved)?.id,historyLoading:e!==void 0&&(e.isPending||e.contextPending)}}function Oo(e,t,n){let r=!e&&!t&&n.available;return{hasContinuation:r,continuable:r&&n.canContinue}}function ko(e,t,n,r){let i=e&&!t.usable,a=n&&!r.canContinue;return{providerBlocked:i||a,providerReason:i?t.reason:r.reason}}function Ao(e){let t=e.at(-1),n=t?.id===`pending-ask`?t.entries[0]:void 0;return{pinnedAsk:n,pendingQuestions:n?.kind===`ask`?n.questions.length:0}}function jo({run:e,thread:t,history:n,footer:r,issueUrl:o,sections:s,renderAsk:c,renderPermission:l,messageActions:u,scroll:d,mode:f,taskTitles:p,recipientBackends:m}){return(0,X.jsxs)(`div`,{"data-slot":`session-conversation`,className:`mx-auto flex w-full max-w-[var(--measure)] flex-1 flex-col gap-2.5 px-[18px] py-3 [padding-block-end:12px] md:gap-3.5 md:px-16 md:py-5 md:[padding-block-end:24px]`,children:[n?(0,X.jsx)(Lo,{hasOlder:n.hasOlder,loading:n.isFetchingOlder,error:n.olderError,fallback:n.fallback,retainedPages:n.retainedPages,onLoad:d.loadOlder}):null,(0,X.jsx)(Di,{runId:e.id,viewId:`main`,sections:s,mode:`document`,renderAsk:c,renderPermission:l,messageActions:u,scrollControls:d,renderMode:f,taskTitles:p,recipientBackends:m}),t.turns.length===0?e.status===`queued`?(0,X.jsx)(Ro,{run:e}):(0,X.jsx)(`p`,{"data-slot":`thread-empty`,className:`py-6 text-center text-xs text-soft-foreground`,children:`No session events yet.`}):null,e.status===`running`?(0,X.jsx)(Qe,{}):null,r&&r.state===`closed`?(0,X.jsxs)(`div`,{"data-slot":`thread-footer`,"data-state":r.state,className:a(`mt-auto flex items-center gap-2 border-t border-border pt-3 text-xs`,r.tone===`danger`?`text-danger`:`text-soft-foreground`),children:[r.label,i(ce(e))?(0,X.jsx)(`a`,{"data-slot":`pr-link`,href:ce(e),target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline-offset-2 hover:underline`,children:`PR ↗`}):null,i(o)?(0,X.jsx)(`a`,{"data-slot":`issue-link`,href:o,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline-offset-2 hover:underline`,children:`Issue ↗`}):null]}):null,e.status===`review`?(0,X.jsx)(at,{run:e}):null]})}function Mo({run:e,thread:t,currentThread:n,currentComplete:r,scroll:i,pendingQuestions:a,onJump:o,onOpenWorker:s,sessionOpen:c,attention:l,queued:u,continuable:d,continueAction:f,stopAction:p,finishAction:m,needsAnswer:h,sendMessage:g,reply:_,providerBlocked:v,providerReason:y}){let b=ri(h&&a>0,i.scrollElRef);return(0,X.jsxs)(`div`,{"data-slot":`thread-dock`,"data-pending-ask":h||void 0,className:`relative z-10 bg-background pt-1 pb-2 md:pt-1.5 md:pb-4`,children:[i.pillVisible&&!b?(0,X.jsx)(`div`,{"data-slot":`thread-jump`,className:`pointer-events-none z-30 flex justify-center`,children:(0,X.jsx)(mi,{pendingQuestions:a,onJump:o})}):null,(0,X.jsxs)(`div`,{"data-slot":`thread-footer-content`,className:`mx-auto flex w-full max-w-[var(--measure)] flex-col gap-1.5 px-[14px] md:gap-2.5 md:px-16`,children:[(0,X.jsx)(Ya,{pendingAsk:h,run:e,thread:t,currentThread:n,currentComplete:r,onOpenWorker:s,readerScroll:i.subscribeReaderScroll},`${e.id}:${h}`),(0,X.jsx)(Hn,{run:e}),e.status===`waiting`&&c?(0,X.jsxs)(`div`,{"data-slot":`paused-hint`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(Zt,{tone:l.tone,shape:l.shape,pulse:l.pulse}),l.bucket===`permission`?`Choose an approval option above to continue`:l.bucket===`waiting`?`The agent is paused, waiting for your reply`:`${l.label.charAt(0).toUpperCase()}${l.label.slice(1)} — you can send a message to resume`]}):null,u?(0,X.jsxs)(`div`,{"data-slot":`queued-hint`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(Zt,{tone:`neutral`,shape:`ring`}),`Messages you add now are folded into the prompt before the run starts.`]}):null,d&&e.removedRunner!==void 0?(0,X.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,role:`status`,children:F(e.removedRunner)}):d&&f.startsNewConversation?(0,X.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,role:`status`,children:`Starts a new agent conversation.`}):null,(0,X.jsx)(Po,{run:e,thread:t,stopAction:p,finishAction:m,attention:l,needsAnswer:h,continuable:d,continueAction:f,queued:u,sendMessage:g,reply:_,providerBlocked:v,providerReason:y,sessionOpen:c})]})]})}function No(e,t,n){if(t)return{skillRunner:n.skillRunner,skillAccount:n.skillAccount};let r=e.steps.find(t=>t.id===e.currentStepId),i=e.workflowDef?.steps.find(t=>t.id===e.currentStepId);return{skillRunner:r?.backend??i?.runner??e.runner,skillAccount:r?.profileId??i?.agentProfile??e.agentProfile}}function Po({run:e,thread:t,stopAction:n,finishAction:r,attention:i,needsAnswer:a,continuable:o,continueAction:s,queued:c,sendMessage:l,reply:u,providerBlocked:d,providerReason:f,sessionOpen:p}){let m=Ui(e);return(0,X.jsx)(jn,{...No(e,o,s),onStop:Tn(e,m).cancel?n.stop:void 0,onFinish:An(e)?()=>r.mutateAsync().catch(()=>void 0):void 0,finishing:r.isPending,stopOnEmpty:Fo(e,i,a),stopping:n.stopping,retainDraftUntilSuccess:!0,compactFeedback:!0,pendingLabel:o?`Continuing…`:`Sending…`,failureHint:`Your draft is kept. Check the task status and connection, then retry.`,sessionControls:o?s.pills:void 0,onSubmit:o?(e,t)=>s.continueWith(e,t):c?(e,t)=>l.mutateAsync({text:e,images:t}):async(e,t)=>{let n=await u.send(e,t);if(n!==void 0)throw Error(n)},disabled:d||!p&&!c&&!o,disabledReason:d?f:`Session closed — no session to resume.`,footerEnd:d&&!s.providerPending?(0,X.jsx)(Ht,{to:`/settings/agent-defaults#providers`,className:`text-xs font-medium text-foreground underline underline-offset-4`,children:`Configure providers`}):void 0,allowEmptySubmit:o&&!a,emptySubmitVariant:e.status===`review`?`outline`:`primary`,emptySubmitLabel:o&&!a?`Continue`:void 0,placeholder:Io(e,c,o),autocompleteSkills:!0,quickReplies:!0,getMentionCandidates:()=>Ft(t)})}function Fo(e,t,n){return e.status===`queued`||e.status===`running`||e.status===`waiting`&&t.bucket===`none`&&!n}function Io(e,t,n){return t?`Add to the prompt — sent when the run starts…`:n?`Continue — add a prompt, or send to just reopen the session…`:e.status===`waiting`?`Reply — / for skills, @ for files…`:`Message the agent — / for skills, @ for files…`}function Lo({hasOlder:e,loading:t,error:n,fallback:r,retainedPages:i,onLoad:a}){return r?(0,X.jsx)(`p`,{"data-slot":`history-fallback`,className:`text-center text-xs text-soft-foreground`,role:`status`,children:`Progressive history is unavailable; showing the complete session.`}):!e&&!n?(0,X.jsxs)(`div`,{"data-slot":`history-start`,className:`flex items-center gap-3 text-[11px] text-soft-foreground`,children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`}),`Start of session`,(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`})]}):(0,X.jsxs)(`div`,{"data-slot":`history-boundary`,"data-retained-pages":i,"aria-busy":t,className:`flex min-h-8 items-center justify-center text-xs text-muted-foreground`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:a,disabled:t,className:`rounded-md px-3 py-1.5 font-medium hover:bg-muted disabled:cursor-wait`,children:t?`Loading 100 earlier items…`:n?`Couldn’t load earlier items · Retry`:`Load 100 earlier items`}),(0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:t?`Loading earlier session history`:n||``})]})}function Ro({run:e}){let t=Pn(S().data??[],e.id);return(0,X.jsxs)(`div`,{"data-slot":`queued-state`,className:`flex flex-col items-center gap-1.5 py-10 text-center`,children:[(0,X.jsx)(Zt,{tone:`neutral`,shape:`ring`}),(0,X.jsxs)(`p`,{className:`text-[13px] font-medium`,children:[`Waiting for a free agent slot`,t===void 0?``:` — #${t} in queue`]}),(0,X.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[e.workflow,` · starts automatically when a slot frees up`]})]})}export{wo as TaskThreadRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.session-composer [data-slot=composer-editor]{border-color:var(--ring);border-radius:12px}.session-composer [data-slot=session-controls]{padding-block:0 10px;padding-inline:12px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content;gap:8px;min-width:0;display:grid}.session-engine-controls [data-slot$=pill]{width:100%;min-width:0}.session-engine-controls [data-slot$=pill]>svg:last-child{margin-inline-start:auto}.session-engine-controls [data-slot=session-runner-value]{width:100%;min-width:0}.session-composer [data-slot=composer-toolbar]{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding-block:0 12px;padding-inline:12px;display:grid}.session-composer [data-slot=composer-toolbar]>[data-slot=session-controls]{grid-area:1/1/auto/-1;min-width:0;padding:0}.session-composer [data-slot=composer-footer-start]{flex-wrap:nowrap;grid-area:2/1;gap:8px}.session-composer [aria-label=Attach\ files],.session-composer [aria-label=Start\ dictation]{border:1px solid var(--border);border-radius:9px;width:44px;height:44px}.session-composer [data-slot=follow-up-model-pill]{min-height:44px}.session-composer [data-slot=follow-up-model-pill]>svg:last-child{margin-inline-start:auto}.session-composer [data-slot=composer-submit-row]{flex:none;grid-area:2/2;margin:0}.session-composer [data-slot=composer-toolbar]:has([data-folded]){grid-template-columns:auto minmax(0,1fr) auto}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=session-controls]{grid-area:1/2;align-self:center}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=composer-footer-start]{grid-area:1/1}.session-composer [data-slot=composer-toolbar]:has([data-folded])>[data-slot=composer-submit-row]{grid-area:1/3}[data-slot=run-actions-menu] [role^=menuitem]{min-height:44px}[data-route=task-thread] [data-slot=thread-dock]{container:thread-dock/inline-size}[data-route=task-thread] [data-slot=thread-jump]{max-inline-size:var(--measure);margin-inline:auto;padding-block:8px;position:fixed;inset-block-end:calc(24px + env(safe-area-inset-bottom,0px));inset-inline:16px}@media (width>=768px){[data-slot=main]:has([data-route=task-thread]){scroll-padding-block:calc(var(--thread-header-height,0px) + 8px) calc(var(--thread-footer-height,0px) + 8px)}[data-route=task-thread] [data-slot=thread-dock]{position:sticky;inset-block-end:0}[data-route=task-thread] [data-slot=thread-dock]:before{content:"";background:linear-gradient(to bottom, transparent, var(--background));pointer-events:none;block-size:16px;position:absolute;inset-block-end:100%;inset-inline:0}[data-route=task-thread] [data-slot=thread-dock][data-pending-ask]:before{content:none}[data-route=task-thread] [data-slot=thread-jump]{margin-block-end:8px;padding-inline:64px;position:absolute;inset-block-end:100%;inset-inline:0}[data-route=task-thread] [data-slot=thread-footer-content]{--thread-footer-limit:min(60dvh, calc(var(--thread-viewport-height,100dvh) - var(--thread-header-height,0px) - var(--spacing) * 5.5));max-block-size:var(--thread-footer-limit)}[data-route=task-thread] [data-slot=thread-footer-content]>:not([data-slot=run-activity-dock]){flex-shrink:0}[data-route=task-thread] [data-slot=run-activity-dock]{overscroll-behavior-block:contain;min-block-size:46px;overflow-y:auto}[data-route=task-thread] [data-slot=thread-footer-content]>[data-slot=composer]{min-block-size:0;max-block-size:calc(var(--thread-footer-limit) - 46px - var(--spacing) * 2.5);flex-direction:column;display:flex}[data-route=task-thread] [data-slot=composer-editor]{flex-direction:column;min-block-size:0;display:flex;overflow-y:auto}[data-route=task-thread] [data-slot=composer-editor]>textarea{flex-shrink:1;min-block-size:44px}[data-route=task-thread] [data-slot=composer-thumbs]{flex-wrap:nowrap;flex-shrink:0;max-block-size:60px;overflow:auto}[data-route=task-thread] [data-slot=composer-toolbar]{flex-shrink:0}@container thread-dock (width<=680px){[data-slot=thread-dock]>div{padding-inline:8px}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr) max-content}.session-engine-controls :is([data-slot=runner-pill],[data-slot=session-runner-value],[data-slot=follow-up-effort-pill]){gap:6px;padding-inline:8px}.session-engine-controls :is([data-slot=runner-pill],[data-slot=follow-up-effort-pill])>svg:last-child{display:none}}}@media (width<=767px){[data-slot=main]:has([data-route=task-thread] [data-slot=run-header][data-sticky]){scroll-padding-block-start:calc(var(--thread-header-height,0px) + 8px)}[data-route=task-thread] [data-slot=run-header][data-sticky]{inset-block-start:calc(var(--run-header-lead,0px) * -1)}[data-slot=run-title-row]>.group{max-width:calc(100% - 52px)}.session-engine-controls{grid-template-columns:max-content minmax(0,1fr)}.session-engine-controls [data-slot=follow-up-model-pill]{grid-area:2/1/auto/-1}.session-engine-controls [data-slot=follow-up-effort-pill]{grid-area:1/2}.task-open-targets{flex-direction:column;align-items:flex-start}}[data-route=task-thread] [data-slot=assistant-message] :is(h1,h2,h3,h4,strong,[data-streamdown=strong]){color:var(--foreground)}[data-route=task-thread] [data-slot=assistant-message] h2{font-size:20px;line-height:1.4}@media (width<=767px){[data-route=task-thread] [data-slot=assistant-message] h2{letter-spacing:-.4px;font-size:18px}}[data-route=task-thread] .session-composer [data-slot=composer-editor]{border-color:var(--composer-border)}[data-route=task-thread] [data-slot=session-conversation]{overflow-anchor:none}@media (width<=767px){[data-route=task-thread] [data-slot=thread-dock]{overflow-anchor:none}[data-route=task-thread] [data-slot=thread-tail-anchor]{overflow-anchor:auto}}[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 5.5) calc(var(--spacing) * 4);gap:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 4)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:is(p,ul,ol,table,blockquote){margin-block:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:first-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:first-child{margin-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>:last-child,[data-route=task-thread] [data-slot=user-bubble] .thread-markdown>:last-child{margin-block-end:0}@media (width<=767px){[data-route=task-thread] [data-slot=session-conversation]{padding-block:calc(var(--spacing) * 4);gap:calc(var(--spacing) * 3.5)}[data-route=task-thread] [data-slot=thread-row]{padding-block-end:calc(var(--spacing) * 3.5)}}[data-route=task-thread] [data-slot=thread-footer][data-state=closed]{border-block-start:0;margin-block-start:0;padding-block-start:0}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child){margin-block-end:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=assistant-message] .thread-markdown>p:has(>:is(strong,[data-streamdown=strong]):only-child)+p{margin-block-start:calc(var(--spacing) * 1)}[data-route=task-thread] [data-slot=tool-card]{background:var(--task-brand-bg);border-radius:7px}[data-route=task-thread] [data-slot=tool-card]>button{padding-block:calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-card]>[data-slot=collapsible-content]>div{background:0 0;border-block-start:0}[data-route=task-thread] [data-slot=tool-output] pre,[data-route=task-thread] [data-slot=tool-error]{padding-block:calc(var(--spacing) * 2) calc(var(--spacing) * 2.5);padding-inline:calc(var(--spacing) * 3)}[data-route=task-thread] [data-slot=tool-output-fade]{--tw-gradient-to:var(--task-brand-bg)}[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=session-conversation],[data-slot=task-split][data-pane=open] [data-route=task-thread] [data-slot=thread-dock]>div{padding-inline:18px}[data-route=task-thread] [data-slot=ask-card]{scroll-margin-block:24px}[data-route=task-thread] [data-slot=ask-card][data-resolved=false][data-pinned=true]{margin-block-end:calc(var(--spacing) * 2)}[data-route=task-thread] [data-slot=composer-submit-row]>button{font-size:13px}[data-route=task-thread] [data-slot=run-header][data-sticky]:after{content:"";background:linear-gradient(to bottom, var(--background) 0, var(--background) 12px, transparent);pointer-events:none;block-size:36px;position:absolute;inset-block-start:100%;inset-inline:0}@supports (animation-timeline:scroll()){[data-route=task-thread] [data-slot=run-header][data-sticky]:after{animation:linear both thread-top-fade;animation-timeline:scroll();animation-range:0 32px}}@keyframes thread-top-fade{0%{opacity:0}to{opacity:1}}[data-route=task-thread]:has([data-slot=thread-dock][data-pending-ask]) [data-slot=run-header][data-sticky]:after{content:none}
|