cezarion 0.18.0-dev.8631 → 0.18.0-dev.8635
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-D7EK3_7b.js +1 -0
- package/web/dist/assets/activity-motion-2BQBW4lA.js +2 -0
- package/web/dist/assets/activity-route-Ct06t8Y9.js +1 -0
- package/web/dist/assets/agent-config-section-D6Lcc7c5.js +7 -0
- package/web/dist/assets/agent-defaults-section-BnDBbzuG.js +1 -0
- package/web/dist/assets/{appearance-Bcl2amXv.js → appearance-CM6ahUyy.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-Bm8miJjt.js → archive-on-merge-field-C7_Fwy2A.js} +1 -1
- package/web/dist/assets/arrow-up-right-DKGzsMqY.js +1 -0
- package/web/dist/assets/attention-CBCeJN5w.js +1 -0
- package/web/dist/assets/automations-route-7B_DF4O1.js +2 -0
- package/web/dist/assets/automations-route-CzqZXK0W.css +1 -0
- package/web/dist/assets/{commit-list-DtEqtn9o.js → commit-list-O4ugJ12w.js} +1 -1
- package/web/dist/assets/{diff-BK789dS0.js → diff-DKZvZQ2G.js} +2 -2
- package/web/dist/assets/{diff-controls-BFqQNxRu.js → diff-controls-BpTFu29H.js} +1 -1
- package/web/dist/assets/{diff-view-BEgQ7jZV.js → diff-view-D4yXb2w7.js} +1 -1
- package/web/dist/assets/file-preview-CUhut4J9.js +2 -0
- package/web/dist/assets/{folder-browser-BfclRPcX.js → folder-browser-B7IbnF0d.js} +1 -1
- package/web/dist/assets/{git-toolbar-Pugtjt-9.js → git-toolbar-po0QJciG.js} +1 -1
- package/web/dist/assets/github-TgLTixC7.js +1 -0
- package/web/dist/assets/global-activity-route-OHCmn0ZO.js +1 -0
- package/web/dist/assets/html-report-BX3msvci.js +3 -0
- package/web/dist/assets/html-report-frame-uuqkBC0u.js +1 -0
- package/web/dist/assets/{image-preview-Dx2w5oIn.js → image-preview-Sisptm3b.js} +1 -1
- package/web/dist/assets/index-C69_Sk06.css +1 -0
- package/web/dist/assets/index-CvVmG4Yu.js +21 -0
- package/web/dist/assets/{label-DEH7fJN4.js → label-Bt8n7Spq.js} +1 -1
- package/web/dist/assets/live-reads-Crd6fVGH.js +1 -0
- package/web/dist/assets/markdown-jle_P0a2.js +2 -0
- package/web/dist/assets/{nav-row-styles-DqKjMToI.js → nav-row-styles-DKeXbc4N.js} +1 -1
- package/web/dist/assets/{notifications-section-DCiqPl3M.js → notifications-section-Bhqr3yOz.js} +1 -1
- package/web/dist/assets/open-in-menu-BPp88ouw.js +1 -0
- package/web/dist/assets/page-shell-7pLJMOgh.js +1 -0
- package/web/dist/assets/page-shell-DQPYcKyL.css +1 -0
- package/web/dist/assets/{preview-pane-connected-WV9oolnn.js → preview-pane-connected-CBt_nlmX.js} +1 -1
- package/web/dist/assets/project-location-BRxXN249.js +1 -0
- package/web/dist/assets/{project-router-Bii3ofOk.js → project-router-CLJTc7gv.js} +1 -1
- package/web/dist/assets/project-scope-context-Rv6S_BXt.js +4 -0
- package/web/dist/assets/projects-section-DnGSWHZJ.js +1 -0
- package/web/dist/assets/{prompt-templates-section-toLPd5u2.js → prompt-templates-section-8kBTviSw.js} +1 -1
- package/web/dist/assets/queries-qCF-eOqZ.js +1 -0
- package/web/dist/assets/{reference-chip-rylFalfg.js → reference-chip-D0v0keVC.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-N9vtBTIK.js → remote-settings-notice-D7G8cXSx.js} +1 -1
- package/web/dist/assets/repo-git-DqBUjQMh.js +1 -0
- package/web/dist/assets/report-reader-DtSBGt0O.js +1 -0
- package/web/dist/assets/reports-CgbU2SrW.css +1 -0
- package/web/dist/assets/reports-ea3-iuBm.js +1 -0
- package/web/dist/assets/{resources-section-B88h1y0Q.js → resources-section-CpXFFHXl.js} +1 -1
- package/web/dist/assets/run-header-BWTrj0_2.js +2 -0
- package/web/dist/assets/{select-BaydzE-I.js → select-aiSr0uTB.js} +1 -1
- package/web/dist/assets/{session-context-section-BJKRXbss.js → session-context-section-BRaZbxVO.js} +2 -2
- package/web/dist/assets/settings-agent-picker-DMIqQhkC.js +1 -0
- package/web/dist/assets/settings-shell-CqiAPuLq.css +1 -0
- package/web/dist/assets/settings-shell-DwMbZhxp.js +1 -0
- package/web/dist/assets/{sidebar-section-B57HIEgv.js → sidebar-section-ClrORHpO.js} +1 -1
- package/web/dist/assets/skills-B97qjJ7j.js +1 -0
- package/web/dist/assets/{tab-link-B1CULYRs.js → tab-link-Bu1g-ArE.js} +1 -1
- package/web/dist/assets/task-changes-BEfLx9dF.js +1 -0
- package/web/dist/assets/task-commits-6f0GpNF7.js +1 -0
- package/web/dist/assets/task-files-CA2xTRaM.js +1 -0
- package/web/dist/assets/task-github-item-BWapcDJr.js +1 -0
- package/web/dist/assets/{task-groups-BbnYlkYj.js → task-groups-4tzKGROI.js} +1 -1
- package/web/dist/assets/task-thread-0rKVutjQ.js +9 -0
- package/web/dist/assets/{tasks-table-Cx7AM7lZ.js → tasks-table-C5uoZMFs.js} +1 -1
- package/web/dist/assets/{thread-state-R0MTvwlo.js → thread-state-C3eDWXYs.js} +1 -1
- package/web/dist/assets/toaster-BXnLIU3z.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-Ch0ok71s.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-DrAmCxn8.js +1 -0
- package/web/dist/assets/workflows-CW-1K6tq.js +7 -0
- package/web/dist/assets/workflows-DsE0ExV6.css +1 -0
- package/web/dist/assets/workspace-tools-BzDQrP3y.js +1 -0
- package/web/dist/assets/{worktrees-section-C07tNayi.js → worktrees-section-ay1jJn_w.js} +4 -4
- package/web/dist/index.html +17 -18
- package/web/dist/assets/accounts-section-COizLyTO.js +0 -1
- package/web/dist/assets/activity-motion-DfI5xoMG.js +0 -2
- package/web/dist/assets/activity-route-BQs2vBeo.js +0 -1
- package/web/dist/assets/agent-config-section-BwBo-HRw.js +0 -7
- package/web/dist/assets/agent-defaults-section-h-Gjb_gh.js +0 -1
- package/web/dist/assets/attention-8bNiiAFt.js +0 -1
- package/web/dist/assets/automations-route-CutF-cGn.css +0 -1
- package/web/dist/assets/automations-route-rSezHxBp.js +0 -2
- package/web/dist/assets/file-preview-CDWTFZ4P.js +0 -2
- package/web/dist/assets/github-CvpaGHe6.js +0 -1
- package/web/dist/assets/global-activity-route-Di_ICsRI.js +0 -1
- package/web/dist/assets/index-CGjknHnV.css +0 -1
- package/web/dist/assets/index-CJFT0IZP.js +0 -21
- package/web/dist/assets/live-reads-BJ9eDISf.js +0 -1
- package/web/dist/assets/live-refetch-VoLPvzhe.js +0 -1
- package/web/dist/assets/markdown-Dv0r75AX.js +0 -4
- package/web/dist/assets/open-in-menu-HM5l7Bwk.js +0 -1
- package/web/dist/assets/project-location-CfJLc6aJ.js +0 -1
- package/web/dist/assets/project-scope-context-BdqKyBHa.js +0 -4
- package/web/dist/assets/projects-section-D2cACaaG.js +0 -1
- package/web/dist/assets/queries-C7VNk-nW.js +0 -1
- package/web/dist/assets/repo-git-DJym0aRY.js +0 -1
- package/web/dist/assets/report-reader-CjskGtxS.js +0 -1
- package/web/dist/assets/reports-B-G9HA48.js +0 -1
- package/web/dist/assets/reports-CNFNb36Z.css +0 -1
- package/web/dist/assets/run-header-B-olCSdg.js +0 -2
- package/web/dist/assets/settings-agent-picker-6xZMIC_D.js +0 -1
- package/web/dist/assets/settings-shell-BkTgs1S9.js +0 -1
- package/web/dist/assets/settings-shell-iSd4xMWS.css +0 -1
- package/web/dist/assets/skills-pBrfwrKF.js +0 -1
- package/web/dist/assets/task-changes-CXldTh93.js +0 -1
- package/web/dist/assets/task-commits-BZ3B_GPB.js +0 -1
- package/web/dist/assets/task-files-BSfmCkJc.js +0 -1
- package/web/dist/assets/task-github-item-v2bygvdO.js +0 -1
- package/web/dist/assets/task-thread-BPWnJ7Qx.js +0 -9
- package/web/dist/assets/toaster-Bo5vCbz-.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-B6h6kcQg.css +0 -1
- package/web/dist/assets/use-hand-to-agent-state-BckHuhr8.js +0 -1
- package/web/dist/assets/useInfiniteQuery--iQKfpUQ.js +0 -1
- package/web/dist/assets/useQuery-BSyhc3l3.js +0 -1
- package/web/dist/assets/workflows-BBc2PFDB.js +0 -7
- package/web/dist/assets/workflows-C6suai0L.css +0 -1
- package/web/dist/assets/workspace-tools-CiTG-ArW.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{c as r,n as i,t as a}from"./utils-DSMR_WLb.js";import{F as o,I as s,Nn as c,Pt as l,di as u,ot as d,s as f,u as p}from"./project-scope-context-BdqKyBHa.js";import{Z as m}from"./live-protocol-DMhTnCmf.js";import{Bt as h,C as g,E as _,Qt as v,T as y,Ut as b,W as x,bt as S,j as ee,n as C,rt as w,vt as te,w as T}from"./queries-C7VNk-nW.js";import{g as ne,h as re}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{i as E}from"./tasks-table-Cx7AM7lZ.js";import{n as D}from"./toaster-Bo5vCbz-.js";import{A as O,C as k,E as ie,F as ae,J as oe,M as se,X as ce,Y as le,at as ue,j as de,n as fe,ot as A,s as pe,u as me,v as he,x as ge}from"./design-icons-CzEoMH9c.js";import{t as _e}from"./createLucideIcon-BHp8sXmF.js";import{n as ve,t as ye}from"./circle-x-7nTlobAF.js";import{l as be,n as xe,y as Se}from"./nav-row-styles-DqKjMToI.js";import{i as Ce,r as we,t as Te}from"./git-toolbar-Pugtjt-9.js";import{t as j}from"./info-DA1x_4bz.js";import{t as Ee}from"./loader-circle-CPBhhDbB.js";import{n as De,r as Oe}from"./diff-controls-BFqQNxRu.js";import{c as ke,i as Ae,l as je,t as Me}from"./reference-chip-rylFalfg.js";import{t as M}from"./button-B7MKxYjT.js";import{i as N,l as Ne,p as Pe,r as Fe,t as Ie}from"./dropdown-menu-4e2iKSMT.js";import{t as P}from"./project-router-Bii3ofOk.js";import{t as Le}from"./status-dot-BRzVlF2X.js";import{a as F,o as Re}from"./format-BU7D3IfE.js";import{t as I}from"./centered-state-V15AR_qo.js";import{At as ze,Bt as Be,D as L,E as Ve,Ft as He,Gt as R,Ht as z,It as Ue,Jt as B,Kt as V,Lt as We,Mt as Ge,Nt as Ke,Ot as qe,Pt as Je,Rt as Ye,Ut as H,Vt as Xe,Wn as U,Wt as W,Yt as G,Zn as Ze,en as K,ir as Qe,jt as $e,kt as et,or as q,qt as J,zt as tt}from"./index-CJFT0IZP.js";import{t as nt}from"./markdown-BBDDg-4t.js";import{t as rt}from"./diff-BK789dS0.js";import{t as it}from"./change-counts-CW7O8g5Y.js";import{n as at,r as ot}from"./commit-list-DtEqtn9o.js";var Y=e(t(),1);function st(e,t){let n=u(t),r=n.getQueryCache();return Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(m.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}var ct=_e(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),lt=_e(`git-pull-request-create`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 9v12`,key:`1sc30k`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v3`,key:`1jb6z3`}],[`path`,{d:`M18 15v6`,key:`9wciyi`}],[`path`,{d:`M21 18h-6`,key:`139f0c`}]]),X=n();function ut(){let e=r(),t=g(),n=u(),i=st({queryKey:h.repo})>0,o=t.data?.info?t.data:null,s=qe(e,o,`screen`);return(0,X.jsxs)(`div`,{"data-route":`repo-git`,"data-slot":`git-screen`,className:xe,children:[(0,X.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,X.jsx)(`h1`,{className:a(be,`min-w-0 flex-1`),children:`Git`}),(0,X.jsx)(`button`,{type:`button`,"data-slot":`git-screen-refresh`,"aria-label":`Refresh the repository`,title:`Refresh the repository`,disabled:i,onClick:()=>{n.invalidateQueries({queryKey:h.repo}),n.invalidateQueries({queryKey:h.worktrees})},className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,X.jsx)(le,{size:17,"aria-hidden":`true`,className:a(`size-[17px]`,i&&`motion-safe:animate-spin`)})})]}),o?.info?(0,X.jsx)(`div`,{className:`mb-[16px]`,children:(0,X.jsx)($e,{scope:e,repo:o,info:o.info,variant:`screen`},e)}):t.isPending?(0,X.jsx)(`p`,{"data-slot":`git-screen-loading`,role:`status`,className:`mb-[16px] px-[10px] text-[13px] text-soft-foreground`,children:`Loading the checkout…`}):t.isError?(0,X.jsxs)(`p`,{"data-slot":`git-screen-error`,role:`alert`,className:`mb-[16px] px-[10px] text-[13px] text-danger`,children:[`Could not load the repository: `,t.error.message]}):(0,X.jsx)(`p`,{"data-slot":`git-screen-not-git`,className:`mb-[16px] px-[10px] text-[13px] text-soft-foreground`,children:`Not a git repository.`}),t.isPending?null:(0,X.jsx)(et,{branch:o?.info?.branch??null,counts:s,variant:`screen`})]})}function Z({entry:e}){return e.keptReason?(0,X.jsx)(`span`,{"data-slot":`branch-kept-reason`,className:`min-w-0 text-xs text-muted-foreground`,children:e.keptReason}):null}function dt({repo:e,info:t}){let n=r(),i=[n,`repo`],o=[n,`health`],s=te(),c=T(),l=new Map((c.data?.branches??[]).map(e=>[e.name,e])),d=u(),p=v({mutationFn:e=>f({name:e},n),onSuccess:async e=>{D(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([d.invalidateQueries({queryKey:i}),d.invalidateQueries({queryKey:o})]),d.setQueryData(i,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),d.setQueryData(o,t=>Ke(t,n,e.branch))},onError:e=>D(e.message,{tone:`danger`})}),[m,h]=(0,Y.useState)(``),[g,_]=(0,Y.useState)(``),y=g.trim().toLowerCase(),b=Q(e,c.data?.branches),x=y?b.filter(e=>e.toLowerCase().includes(y)):b;return(0,X.jsxs)(`section`,{"data-slot":`repo-branches`,className:`grid min-w-0 grid-cols-1 gap-5 px-4 pt-0 pb-9 md:grid-cols-[minmax(0,1fr)_290px] md:px-9`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:[(0,X.jsx)(`h2`,{className:`sr-only`,children:`Branches`}),(0,X.jsxs)(`label`,{className:`relative block`,children:[(0,X.jsx)(ce,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3 size-4 text-muted-foreground`}),(0,X.jsx)(U,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:g,onChange:e=>_(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-10`})]}),(0,X.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-3.5 flex min-w-0 flex-col divide-y divide-border border-t border-border md:max-h-[40rem] md:overflow-y-auto md:overscroll-contain`,children:[x.map(e=>{let n=e===t.branch,r=l.get(e);return(0,X.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,"data-branch-class":r?.class,className:`flex min-h-[60px] flex-col items-start justify-center gap-1.5 py-2 md:flex-row md:items-center md:justify-start md:gap-2.5`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-[8px]`,children:[r?.runId?(0,X.jsx)(P,{to:`/tasks/${r.runId}`,"data-slot":`branch-task-link`,title:r.title?`Open the task ${r.title}`:`Open the task`,className:`min-w-0 truncate rounded-[2px] font-mono text-[12px] underline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-ring`,children:e}):(0,X.jsx)(`span`,{className:a(`min-w-0 truncate font-mono text-[12px]`,n&&`font-medium`),children:e}),r&&!(n&&r.class===`active`)?(0,X.jsx)(gt,{entry:r}):null]}),r?(0,X.jsx)(Z,{entry:r}):null,e.startsWith(`cez/`)&&!n?null:n?(0,X.jsx)(`span`,{"data-slot":`branch-current`,className:`flex h-8 shrink-0 items-center rounded-md bg-accent-strong/10 px-2.5 text-[12px] font-medium text-accent-text md:ml-auto`,children:`Current`}):(0,X.jsxs)(M,{variant:`outline`,size:`sm`,"data-action":`switch-branch`,className:`h-8 max-md:h-11 no-hover:h-11 md:ml-auto`,disabled:p.isPending,onClick:()=>p.mutate(e),children:[(0,X.jsx)(O,{size:16,"aria-hidden":`true`}),`Switch`]})]},e)}),x.length===0?(0,X.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-muted-foreground`,children:[`No branches match “`,g.trim(),`”.`]}):null]})]}),(0,X.jsxs)(`div`,{className:`min-w-0 self-start rounded-xl border border-border bg-card p-5`,children:[(0,X.jsx)(`h2`,{className:`text-base font-semibold`,children:`Create a branch`}),(0,X.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-5 flex flex-col items-stretch gap-3`,onSubmit:e=>{e.preventDefault();let t=m.trim();t&&p.mutate(t,{onSuccess:()=>h(``)})},children:[(0,X.jsx)(`label`,{htmlFor:`new-branch-name`,className:`text-sm font-medium`,children:`Branch name`}),(0,X.jsxs)(`p`,{"data-slot":`branch-create-base`,className:`-mt-1 text-xs text-muted-foreground`,children:[`Create from `,(0,X.jsx)(`span`,{className:`font-mono text-[11px] text-foreground`,children:t.branch}),`.`]}),(0,X.jsx)(U,{id:`new-branch-name`,"aria-label":`New branch name`,placeholder:`new-branch-name`,className:`h-11 bg-background placeholder:text-muted-foreground/70`,value:m,onChange:e=>h(e.target.value)}),(0,X.jsxs)(M,{type:`submit`,variant:`primary`,size:`sm`,className:`min-h-11 self-start`,"data-action":`create-branch`,disabled:!m.trim()||p.isPending,children:[(0,X.jsx)(oe,{size:16,"aria-hidden":`true`}),`Create branch`]})]}),(0,X.jsx)(`p`,{"data-slot":`branch-create-note`,className:`mt-4 text-xs leading-relaxed text-muted-foreground`,children:`Switching branches changes your working tree. Review uncommitted changes first.`})]}),s.data?.forge?.available?(0,X.jsx)(ft,{}):null]})}function ft(){let e=C({limit:20});return(0,X.jsxs)(`div`,{"data-slot":`repo-prs`,className:`min-w-0 rounded-xl border border-border bg-card p-5 md:col-span-2`,children:[(0,X.jsx)(`h2`,{className:`text-base font-semibold`,children:`Open pull requests`}),e.isPending?(0,X.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Loading pull requests…`}):e.isError?(0,X.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,X.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`No open pull requests.`}):(0,X.jsx)(`ul`,{className:`mt-3 flex flex-col divide-y divide-border border-t border-border`,children:e.data.prs.map(e=>(0,X.jsx)(pt,{pr:e},e.number))}):(0,X.jsx)(`p`,{"data-slot":`repo-prs-unavailable`,className:`mt-3 text-xs text-muted-foreground`,children:e.data.reason??`The forge is unreachable right now.`})]})}function pt({pr:e}){let t=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ae,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,e.number]}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,X.jsx)(mt,{checks:e.checks}):null]}),n=`flex min-h-11 min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,X.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:i(e.url)?(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:a(n,`hover:bg-muted`),children:t}):(0,X.jsx)(`span`,{className:n,children:t})})}function mt({checks:e}){let t=e===`passing`?ve:e===`failing`?ye:Qe;return(0,X.jsxs)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:a(`inline-flex shrink-0 items-center gap-1 text-[12px] font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:[(0,X.jsx)(t,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),e]})}var ht={active:`in use`,"not-landed":`not landed`,orphan:`not landed`,merged:`merged`,empty:`empty`,other:`yours`};function gt({entry:e}){return(0,X.jsx)(`span`,{"data-slot":`branch-class`,className:a(`shrink-0 rounded-[4px] border px-1.5 py-px text-[11px] leading-4 font-medium`,e.class===`active`?`border-status-running/40 text-status-running`:e.class===`not-landed`||e.class===`orphan`?`border-inbox-count-foreground/40 text-inbox-count-foreground`:`border-border text-soft-foreground`),children:ht[e.class]})}function Q(e,t){let n=new Set(e.branches);for(let e of t??[])n.add(e.name);return[...n].sort((e,t)=>e.localeCompare(t))}function _t(){let e=y(),t=K(),[n,r]=(0,Y.useState)(`unified`),[i,a]=(0,Y.useState)(!0),[o,s]=(0,Y.useState)(!1),[l,u]=(0,Y.useState)(null),d=(0,Y.useRef)(null),f=e.isError&&e.error instanceof c&&e.error.status===409,p=e.data?.files??[],m=(0,Y.useMemo)(()=>we(p),[p]),h=(0,Y.useMemo)(()=>p.some(nt),[p]),g=t?n:`unified`;return(0,X.jsx)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:e.isPending?(0,X.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-muted-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,X.jsx)(I,{icon:f?(0,X.jsx)(k,{size:16}):(0,X.jsx)(A,{size:16}),tone:f?`neutral`:`danger`,heading:`h2`,title:f?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):p.length===0?(0,X.jsx)(I,{icon:(0,X.jsx)(k,{size:16}),tone:`neutral`,heading:`h2`,title:`Working tree clean`,subtitle:`No uncommitted changes in the main working tree. Edits show up here as they happen.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,className:`flex flex-wrap items-center gap-x-3 gap-y-2 px-4 pb-4 md:px-9 [&_button]:min-h-11`,children:[e.data?(0,X.jsx)(Te,{stat:e.data.stat}):null,(0,X.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[h?(0,X.jsx)(Oe,{preview:o,onPreviewChange:s}):null,(0,X.jsx)(`span`,{className:`flex items-center gap-1.5`,children:(0,X.jsx)(De,{mode:n,wrap:i,onModeChange:r,onWrapChange:a})})]})]}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 px-4 pb-9 pt-0 [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,X.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 lg:w-[288px]`,children:[(0,X.jsx)(`h2`,{"data-slot":`changes-tree-heading`,className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,X.jsx)(Ce,{root:m,selected:l,onSelect:e=>{u(e),d.current?.scrollToPath(e)}})]}),(0,X.jsx)(rt,{files:p,viewRef:d,mode:g,wrap:i,preview:o,totals:!1,className:`min-w-0 flex-1`})]})]})})}function vt({repo:e,info:t}){let{sha:n}=re(),r=e.log,i=(0,Y.useMemo)(()=>Xe(r),[r]);if(n)return(0,X.jsx)(xt,{sha:n});let a=We(e,t),o=a&&a.behind>0?(0,X.jsx)(bt,{info:t,tracking:a}):null;return r.length===0?(0,X.jsxs)(X.Fragment,{children:[o?(0,X.jsx)(`div`,{className:`px-4 pt-0 md:px-9`,children:o}):null,(0,X.jsx)(I,{icon:(0,X.jsx)(de,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`})]}):(0,X.jsxs)(`div`,{"data-slot":`repo-commits`,className:`flex flex-col gap-4 px-4 pt-0 pb-9 md:px-9`,children:[o,i.map(e=>(0,X.jsxs)(`section`,{"data-slot":`repo-commit-day`,"aria-label":e.label,className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`h2`,{className:`text-xs font-medium text-muted-foreground`,children:e.label}),(0,X.jsx)(`ul`,{className:`flex flex-col divide-y divide-border rounded-xl border border-border bg-card`,children:e.commits.map(e=>(0,X.jsxs)(`li`,{className:`flex min-h-[52px] items-center gap-3.5 first:rounded-t-xl last:rounded-b-xl hover:bg-sidebar-row-hover`,children:[(0,X.jsxs)(P,{to:`/git/commits/${e.hash}`,"data-slot":`commit-row`,"data-sha":e.hash,className:`flex min-h-[52px] min-w-0 flex-1 flex-col justify-center gap-0.5 px-4 py-2 focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,X.jsx)(`span`,{"data-slot":`commit-row-subject`,className:`truncate text-[13px] font-medium text-foreground`,children:e.subject}),(0,X.jsxs)(`span`,{"data-slot":`commit-row-meta`,className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(at,{sha:e.hash}),(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:`·`}),(0,X.jsxs)(`span`,{className:`truncate`,children:[e.author,` · `,(0,X.jsx)(`span`,{title:Be(e.when,e.at),children:tt(e.when,e.at)})]})]})]}),(0,X.jsx)(yt,{source:e.source})]},e.hash))})]},e.label))]})}function yt({source:e}){let t=`hidden max-w-[45%] shrink-0 items-center gap-[5px] pr-4 text-[11.5px] text-muted-foreground md:flex`;return e?(0,X.jsxs)(P,{to:`/tasks/${e.runId}`,"data-slot":`commit-source`,"data-source":`task`,"aria-label":`From the task ${e.title}${e.prNumber===null?``:`, pull request #${e.prNumber}`}`,className:a(t,`rounded-[4px] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`),children:[e.prNumber===null?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(se,{"aria-hidden":`true`,className:`size-[11px] shrink-0 text-merged-text`}),(0,X.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[`PR #`,e.prNumber]})]}),(0,X.jsx)(pe,{"aria-hidden":`true`,className:`size-[12px] shrink-0`}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]}):(0,X.jsx)(`span`,{"data-slot":`commit-source`,"data-source":`unknown`,className:t,children:`no task found`})}function bt({info:e,tracking:t}){let n=Je(r(),e),i=(0,Y.useRef)(null);return(0,X.jsxs)(`div`,{"data-slot":`git-incoming`,className:`flex min-h-[44px] items-center gap-2.5 rounded-xl border border-border bg-card px-4 py-2`,children:[(0,X.jsx)(ct,{"aria-hidden":`true`,className:`size-[14px] shrink-0 text-inbox-count-foreground`}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 text-[12.5px] text-muted-foreground`,children:[t.behind,` commit`,t.behind===1?``:`s`,` on `,t.ref,` `,t.behind===1?`is`:`are`,` not in your checkout yet`]}),(0,X.jsxs)(`button`,{ref:i,type:`button`,"data-action":`repo-pull-incoming`,disabled:!n.hasRemote||n.pulling,onClick:()=>void n.pull(),className:`inline-flex h-[28px] shrink-0 items-center gap-[4px] rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 max-md:h-11 [&>svg]:size-[12px]`,children:[n.pulling?(0,X.jsx)(Ee,{"aria-hidden":`true`,className:`motion-safe:animate-spin`}):(0,X.jsx)(fe,{"aria-hidden":`true`}),`Pull`]}),(0,X.jsx)(Ge,{checkout:n,returnFocus:i})]})}function xt({sha:e}){return(0,X.jsx)(ot,{commit:_(e),sha:e,backTo:K()?`/git`:He,backLabel:`All recent commits`,slot:`repo-commit`,className:`flex min-h-0 flex-1 flex-col`,diffClassName:`px-4 py-4 [--diff-sticky-top:1rem] md:px-9`})}var St=`Squash-merged branches may show as not landed without GitHub`;function Ct(e){let t=[],n=[],r=[];for(let i of e)if(i.class===`orphan`)r.push(i);else if(i.class!==`not-landed`)continue;else i.pr&&(i.pr.state===`open`||i.pr.state===`draft`)?n.push(i):t.push(i);return[{key:`no-pr`,title:`No pull request`,note:`nobody sees this work until you act`,rows:t},{key:`pr-open`,title:`Pull request open`,rows:n},{key:`deleted`,title:`Task deleted`,note:`this branch is the only copy of the work`,rows:r}].filter(e=>e.rows.length>0)}function wt(e){return e.filter(e=>e.class===`active`&&e.runId!==null&&e.ahead>0&&(e.runStatus===`done`||e.runStatus===`failed`||e.runStatus===`cancelled`)).length}var Tt={done:`success`,failed:`danger`,cancelled:`neutral`};function Et(){let e=T(),t=w(),n=r(),i=S(),[a,o]=(0,Y.useState)(null);if(e.isPending)return(0,X.jsx)(`p`,{"data-slot":`not-landed-loading`,role:`status`,className:`px-4 py-5 text-[13px] text-muted-foreground md:px-9`,children:`Loading branches…`});if(e.isError)return(0,X.jsx)(I,{icon:(0,X.jsx)(A,{size:16}),tone:`danger`,heading:`h2`,title:`Could not classify the branches`,subtitle:e.error.message});let s=Ct(e.data.branches),c=wt(e.data.branches),l=c>0?(0,X.jsxs)(`p`,{"data-slot":`not-landed-retained`,className:`flex items-start gap-2 text-xs leading-relaxed text-muted-foreground`,children:[(0,X.jsx)(j,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,X.jsxs)(`span`,{children:[c,` finished task`,c===1?` still has its`:`s still have their`,` worktree and commits not on the base, so `,c===1?`it is`:`they are`,` not listed here.`,` `,`They show here once the worktree is reclaimed in `,(0,X.jsx)(P,{to:Ue.cleanup,className:`underline underline-offset-2 hover:text-foreground`,children:`Cleanup`}),`.`]})]}):null,u=new Map((t.data??[]).map(e=>[e.id,e.finishedAt]));return(0,X.jsxs)(Ae,{projectId:n,repoBase:i,requests:s.flatMap(e=>e.rows).flatMap(e=>e.pr?[{projectId:n,kind:`PR`,number:e.pr.number}]:[]),children:[(0,X.jsxs)(`div`,{"data-slot":`repo-not-landed`,className:`flex flex-col gap-4 px-4 pt-0 pb-[calc(90px+env(safe-area-inset-bottom))] md:px-9 md:pb-9`,children:[e.data.prStateKnown?null:(0,X.jsx)(Dt,{}),l,s.length===0?(0,X.jsx)(I,{icon:(0,X.jsx)(Ze,{size:16}),tone:`neutral`,heading:`h2`,title:c>0?`Nothing else waiting to land`:`Everything landed`,subtitle:c>0?`Every other finished task's commits are on the base branch, or it made none.`:`Every finished task's commits are on the base branch, or it made none.`}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(`div`,{className:`flex flex-col gap-5`,children:s.map(e=>(0,X.jsxs)(`section`,{"data-slot":`not-landed-group`,"data-group":e.key,"aria-label":e.title,className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`h2`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`font-semibold text-foreground`,children:e.title}),(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.rows.length}),e.note?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(`span`,{children:e.note})]}):null]}),(0,X.jsx)(`ul`,{className:`flex flex-col divide-y divide-border rounded-xl border border-border bg-card`,children:e.rows.map(e=>(0,X.jsx)(Ot,{entry:e,finishedAt:e.runId?u.get(e.runId):void 0,onDelete:()=>o(e)},e.name))})]},e.key))}),(0,X.jsxs)(`p`,{"data-slot":`not-landed-note`,className:`flex items-start gap-1.5 px-1 text-xs leading-snug text-muted-foreground`,children:[(0,X.jsx)(j,{"aria-hidden":`true`,className:`mt-px size-3 shrink-0`}),`Delete a branch from its row's … menu. It confirms and names the commits it drops; nothing here is bulk-deleted.`]})]})]}),(0,X.jsx)(Nt,{entry:a,onClose:()=>o(null)})]})}function Dt({className:e}){return(0,X.jsxs)(`p`,{"data-slot":`git-no-forge`,className:a(`flex items-start gap-2 text-xs leading-relaxed text-muted-foreground`,e),children:[(0,X.jsx)(j,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),St,`.`]})}function Ot({entry:e,finishedAt:t,onDelete:n}){return(0,X.jsxs)(`li`,{"data-slot":`not-landed-row`,"data-branch":e.name,"data-branch-class":e.class,className:`flex min-h-[60px] items-center gap-3 px-4 py-3 first:rounded-t-xl last:rounded-b-xl hover:bg-sidebar-row-hover`,children:[(0,X.jsx)(jt,{entry:e,finishedAt:t}),(0,X.jsx)(kt,{entry:e}),(0,X.jsx)(At,{entry:e,onDelete:n})]})}function kt({entry:e}){return(0,X.jsx)(X.Fragment,{children:e.pr?(0,X.jsxs)(`span`,{"data-slot":`not-landed-pr`,className:`hidden shrink-0 items-center gap-1.5 text-xs text-muted-foreground md:flex`,children:[(0,X.jsx)(Me,{plain:!0,reference:{kind:`PR`,number:e.pr.number,url:e.pr.url},taskTitle:e.title??e.name,status:e.pr.state===`draft`?`draft`:e.pr.state===`closed`?`closed`:void 0}),(0,X.jsx)(Mt,{entry:e})]}):null})}function At({entry:e,onDelete:t}){let n=u(),r=e.class===`orphan`,i=e.pr&&(e.pr.state===`open`||e.pr.state===`draft`)?e.pr:null,o=!r&&e.runId!==null&&!i,s=v({mutationFn:()=>d(e.runId),onSuccess:e=>{D(`Draft PR created — ${e.url}`),n.invalidateQueries({queryKey:h.repoBranches}),n.invalidateQueries({queryKey:h.runs.all})},onError:e=>D(e instanceof c&&e.manual?`${e.message} — ${e.manual}`:e.message,{tone:`danger`})}),l=()=>void navigator.clipboard.writeText(e.name).then(()=>D(`Copied ${e.name}`),()=>D(`Could not copy the branch name`,{tone:`danger`})),f=`inline-flex h-8 shrink-0 items-center gap-1.5 rounded-sm px-2.5 text-[12.5px] font-medium text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 [&>svg]:size-[12px]`;return(0,X.jsxs)(X.Fragment,{children:[e.runId?(0,X.jsx)(P,{to:`/tasks/${e.runId}`,"data-action":`not-landed-open`,className:a(f,`hidden border border-border bg-card hover:bg-muted md:inline-flex`),children:`Open task`}):null,o?(0,X.jsxs)(`button`,{type:`button`,"data-action":`not-landed-create-pr`,disabled:s.isPending,onClick:()=>s.mutate(),className:a(f,`hidden border border-border bg-card hover:bg-muted md:inline-flex`),children:[(0,X.jsx)(lt,{"aria-hidden":`true`}),s.isPending?`Creating…`:`Draft PR`]}):null,r?(0,X.jsxs)(`button`,{type:`button`,"data-action":`not-landed-copy`,onClick:l,className:a(f,`hidden border border-border bg-card hover:bg-muted md:inline-flex`),children:[(0,X.jsx)(he,{"aria-hidden":`true`}),`Copy branch`]}):null,(0,X.jsxs)(Ie,{children:[(0,X.jsx)(Pe,{"data-action":`not-landed-more`,"aria-label":`More actions for ${e.name}`,className:`flex size-8 shrink-0 items-center justify-center rounded-sm text-soft-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring max-md:size-11`,children:(0,X.jsx)(ge,{"aria-hidden":`true`,className:`size-[14px]`})}),(0,X.jsxs)(Fe,{align:`end`,className:`w-52`,children:[e.runId?(0,X.jsx)(N,{asChild:!0,className:`md:hidden`,children:(0,X.jsx)(P,{to:`/tasks/${e.runId}`,children:`Open task`})}):null,o?(0,X.jsx)(N,{className:`md:hidden`,disabled:s.isPending,onSelect:()=>s.mutate(),children:`Draft PR`}):null,(0,X.jsx)(N,{className:a(!r&&`md:hidden`),onSelect:l,children:`Copy branch`}),(0,X.jsx)(Ne,{className:`md:hidden`}),(0,X.jsx)(N,{"data-action":`not-landed-delete`,variant:`destructive`,onSelect:t,children:`Delete branch…`})]})]})]})}function jt({entry:e,finishedAt:t}){let n=e.class===`orphan`,r=n?`No task · last commit “${e.lastCommit.subject}”`:e.title??e.name,i=t??e.lastCommit.at,a=F(i),o=n||!e.runStatus?a:`${e.runStatus}${a?` ${a}`:``}`,s=Number.isFinite(Date.parse(i))?new Date(i).toLocaleString():void 0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`flex size-[12px] shrink-0 items-center justify-center`,children:n?(0,X.jsx)(Se,{"aria-label":`Task deleted`,className:`size-[12px] text-muted-foreground`}):(0,X.jsx)(Le,{tone:e.runStatus&&Tt[e.runStatus]||`neutral`,"aria-label":e.runStatus??void 0})}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[e.runId?(0,X.jsx)(P,{to:`/tasks/${e.runId}`,"data-slot":`not-landed-title`,className:`min-w-0 truncate rounded-[2px] text-[13px] font-medium text-foreground hover:underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-ring`,children:r}):(0,X.jsx)(`span`,{"data-slot":`not-landed-title`,className:`min-w-0 truncate text-[13px] font-medium text-foreground`,title:r,children:r}),(0,X.jsxs)(`span`,{"data-slot":`not-landed-meta`,className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),(0,X.jsx)($,{}),(0,X.jsxs)(`span`,{className:`shrink-0`,children:[e.ahead,` commit`,e.ahead===1?``:`s`]}),e.diffStat?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(it,{adds:e.diffStat.additions,dels:e.diffStat.deletions})]}):null,o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(`span`,{className:`truncate`,title:s,children:o})]}):null]}),e.parentRunId?(0,X.jsx)(P,{to:`/tasks/${e.parentRunId}`,"data-slot":`not-landed-parent`,className:`w-fit rounded-[2px] text-xs text-muted-foreground hover:underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-ring`,children:`Worker of its parent task`}):null,(0,X.jsx)(Z,{entry:e})]})]})}function $(){return(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:`·`})}function Mt({entry:e}){let t=b(ke(`PR`,e.pr?.number).status),n=e.pr?.state,r=n===`draft`||n===`closed`?n:t?t.label.toLowerCase():`open`;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(`span`,{"data-slot":`not-landed-pr-state`,children:r})]})}function Nt({entry:e,onClose:t}){let n=u(),[r,i]=(0,Y.useState)(``),a=(0,Y.useId)(),o=v({mutationFn:e=>p({names:[e],confirm:e}),onSuccess:e=>{let t=e.dropped?.length??0;D(e.deleted.length>0?`Deleted ${e.deleted[0]}${t?` and ${t} commit${t===1?``:`s`} with it`:``}`:e.refused[0]?.reason??`Nothing was deleted`),n.invalidateQueries({queryKey:h.repo}),s()},onError:e=>D(e.message,{tone:`danger`})}),s=()=>{i(``),t()},c=e!==null&&r.trim()===e.name,l=e&&`${e.ahead} commit${e.ahead===1?``:`s`}`;return(0,X.jsx)(z,{open:e!==null,onOpenChange:e=>!e&&!o.isPending&&s(),children:(0,X.jsxs)(R,{"data-slot":`delete-branch-dialog`,children:[(0,X.jsxs)(B,{children:[(0,X.jsxs)(G,{children:[`Delete `,e?.name,`?`]}),(0,X.jsx)(V,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{children:e?.class===`orphan`?`Its task was deleted, so this branch is the only copy of the work.`:(0,X.jsxs)(X.Fragment,{children:[`This drops the work of `,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:e?.title??e?.name}),`. It is not on the base branch`,e?.pr?``:` and no pull request carries it`,`.`]})}),(0,X.jsxs)(`p`,{"data-slot":`delete-branch-dropped`,children:[l,` will be dropped`,e?.diffStat?` (+${e.diffStat.additions} −${e.diffStat.deletions})`:``,`, the latest “`,e?.lastCommit.subject,`”`,` `,`(`,(0,X.jsx)(`span`,{className:`font-mono`,title:e?.lastCommit.sha,children:e?.lastCommit.sha.slice(0,8)}),`).`]})]})})]}),(0,X.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),c&&e&&!o.isPending&&o.mutate(e.name)},className:`flex flex-col gap-[6px]`,children:[(0,X.jsxs)(`label`,{htmlFor:a,className:`text-[12.5px] text-muted-foreground`,children:[`Type `,(0,X.jsx)(`span`,{className:`font-mono text-foreground`,children:e?.name}),` to confirm`]}),(0,X.jsx)(U,{id:a,"data-slot":`delete-branch-confirm`,autoComplete:`off`,spellCheck:!1,value:r,onChange:e=>i(e.target.value),className:`h-11 font-mono`})]}),(0,X.jsxs)(J,{children:[(0,X.jsx)(W,{className:`h-11`,disabled:o.isPending,children:`Keep it`}),(0,X.jsx)(H,{"data-action":`delete-branch-confirm`,className:`h-11 bg-danger text-danger-foreground hover:brightness-[0.96]`,disabled:!c||o.isPending,onClick:t=>{t.preventDefault(),e&&o.mutate(e.name)},children:o.isPending?`Deleting…`:`Delete branch`})]})]})})}function Pt({base:e}){let t=T(),n=u(),[r,i]=(0,Y.useState)({merged:!1,empty:!1}),[a,o]=(0,Y.useState)(!1),s=(t.data?.branches??[]).filter(e=>e.class===`merged`),c=(t.data?.branches??[]).filter(e=>e.class===`empty`),l=[...s,...c],d=v({mutationFn:e=>p({names:e}),onSuccess:e=>{let t=e.refused.length;D(`Deleted ${e.deleted.length} branch${e.deleted.length===1?``:`es`}${t?`; kept ${t} that ${t===1?`is`:`are`} no longer safe to delete`:``}`),n.invalidateQueries({queryKey:h.repo})},onError:e=>{n.invalidateQueries({queryKey:h.repo}),D(e.message,{tone:`danger`})}});if(t.isPending)return(0,X.jsx)(`p`,{"data-slot":`cleanup-branches-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading branches…`});if(t.isError)return(0,X.jsxs)(`p`,{"data-slot":`cleanup-branches-error`,className:`text-[13px] text-danger`,children:[`Branches did not load: `,t.error.message]});let f=l.length,m=`branch${f===1?``:`es`}`;return(0,X.jsxs)(`section`,{"data-slot":`cleanup-branches`,"aria-labelledby":`cleanup-branches-title`,className:`flex flex-col rounded-[8px] border border-border`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-[10px] border-b border-border px-[14px] py-[12px] md:flex-row md:items-center`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,X.jsxs)(`h2`,{id:`cleanup-branches-title`,className:`text-[13px] font-semibold text-foreground`,children:[`Branches safe to delete · `,f]}),(0,X.jsxs)(`p`,{className:`text-[11.5px] leading-[17px] text-soft-foreground`,children:[`Their work is already on `,e,`, or they have none. Deleting loses nothing.`]})]}),(0,X.jsxs)(`button`,{type:`button`,"data-action":`cleanup-branches-delete`,disabled:f===0||d.isPending,onClick:()=>o(!0),className:`inline-flex h-[28px] shrink-0 items-center gap-[5px] self-start rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 disabled:hover:brightness-100 max-md:h-11 md:self-center`,children:[(0,X.jsx)(ue,{"aria-hidden":`true`,className:`size-[12px]`}),d.isPending?`Deleting…`:`Delete ${f} ${m}`]})]}),(0,X.jsx)(Ft,{kind:`merged`,title:`Merged into ${e}`,hint:t.data.prStateKnown?`including squash-merged PRs, read from the PR state`:St.toLowerCase(),rows:s,open:r.merged,onToggle:()=>i(e=>({...e,merged:!e.merged}))}),(0,X.jsx)(Ft,{kind:`empty`,title:`Empty`,hint:`no commits beyond the fork point`,rows:c,open:r.empty,onToggle:()=>i(e=>({...e,empty:!e.empty}))}),(0,X.jsx)(z,{open:a,onOpenChange:o,children:(0,X.jsxs)(R,{children:[(0,X.jsxs)(B,{children:[(0,X.jsxs)(G,{children:[`Delete `,f,` `,m,`?`]}),(0,X.jsxs)(V,{children:[s.length,` merged into `,e,` and `,c.length,` empty. Their work is already on `,e,`, or they have none. Anything that stopped being safe since this list loaded is kept.`]})]}),(0,X.jsxs)(J,{children:[(0,X.jsx)(W,{children:`Keep them`}),(0,X.jsxs)(H,{"data-action":`cleanup-branches-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{d.mutate(l.map(e=>e.name)),o(!1)},children:[`Delete `,f,` `,m]})]})]})})]})}function Ft({kind:e,title:t,hint:n,rows:r,open:i,onToggle:o}){let s=`cleanup-branches-${e}`;return(0,X.jsxs)(`div`,{"data-slot":`cleanup-branch-group`,"data-group":e,className:`border-b border-border last:border-0`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":s,disabled:r.length===0,onClick:o,className:`flex min-h-[44px] w-full items-center gap-[12px] px-[14px] py-[4px] text-left hover:bg-sidebar-row-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring disabled:hover:bg-transparent`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,X.jsxs)(`span`,{className:`truncate text-[12.5px] text-foreground`,children:[t,` · `,r.length]}),(0,X.jsx)(`span`,{className:`truncate text-[11px] text-soft-foreground`,children:n})]}),r.length>0?(0,X.jsx)(me,{"aria-hidden":`true`,className:a(`size-[13px] shrink-0 text-soft-foreground transition-transform motion-reduce:transition-none`,i&&`rotate-90`)}):null]}),i?(0,X.jsx)(`ul`,{id:s,"aria-label":t,className:`flex flex-col pb-[6px]`,children:r.map(e=>(0,X.jsxs)(`li`,{"data-slot":`cleanup-branch-row`,"data-branch":e.name,className:`flex min-h-[32px] items-center gap-[10px] px-[14px] pl-[26px] text-[11.5px]`,children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:e.name}),e.runId?(0,X.jsx)(P,{to:`/tasks/${e.runId}`,className:`min-w-0 flex-1 truncate text-soft-foreground underline-offset-2 hover:text-foreground hover:underline`,children:e.title??`Open the task`}):(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-soft-foreground`,children:e.lastCommit.subject}),e.pr?(0,X.jsxs)(`span`,{className:`shrink-0 text-soft-foreground`,children:[`PR #`,e.pr.number]}):null,(0,X.jsx)(`span`,{className:`shrink-0 tabular-nums text-soft-foreground`,children:F(e.lastCommit.at)})]},e.name))}):null]})}function It(){let e=ee(),t=x().data?.targets.find(e=>e.id===`finder`),n=v({mutationFn:e=>l(e,t.id),onError:e=>D(e.message,{tone:`danger`})}),r=u(),[i,a]=(0,Y.useState)(!1),c=()=>Promise.all([r.invalidateQueries({queryKey:h.worktrees}),r.invalidateQueries({queryKey:h.repoBranches})]),d=v({mutationFn:e=>s(),onSuccess:(e,t)=>{c();let n=e.reclaimed.length,r=Math.max(0,t-n);D(n===0?r>0?`Nothing was reclaimed — the worktrees past the keep limit have uncommitted work or are in use`:`Nothing to reclaim — no finished worktrees exceed the keep limit`:`Reclaimed ${n} worktree${n===1?``:`s`} (branch kept)${r>0?` · ${r} kept: uncommitted work or in use`:``}`)},onError:e=>D(e.message,{tone:`danger`})}),f=v({mutationFn:e=>o(e.runId),onSuccess:(e,t)=>{c(),D(`Reclaimed the worktree of ${t.title} (branch kept)`)},onError:e=>{c(),D(e.message,{tone:`danger`})}});if(e.isPending)return(0,X.jsx)(`p`,{"data-slot":`worktrees-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading worktrees…`});if(e.isError)return(0,X.jsxs)(`p`,{"data-slot":`worktrees-error`,className:`text-[13px] text-danger`,children:[`Worktrees did not load: `,e.error.message]});let{worktrees:p,totalBytes:m,keep:g}=e.data,_=d.isPending||f.isPending,y=p.filter(e=>e.pastKeep),b=y.length>0,S=y.some(e=>e.sizeBytes===null)?null:y.reduce((e,t)=>e+(t.sizeBytes??0),0),C=b?S?`Reclaim ${E(S)} now`:`Reclaim ${y.length} now`:`Reclaim now`,w=m?E(m):null;return(0,X.jsxs)(`section`,{"data-slot":`worktrees-panel`,"aria-labelledby":`worktrees-panel-title`,className:`flex flex-col rounded-[8px] border border-border`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-[10px] border-b border-border px-[14px] py-[12px] md:flex-row md:items-center`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,X.jsxs)(`h2`,{id:`worktrees-panel-title`,className:`text-[13px] font-semibold text-foreground`,children:[`Worktrees on disk`,w?` · ${w}`:``]}),(0,X.jsxs)(`p`,{"data-slot":`worktrees-retention`,className:`text-[11.5px] leading-[17px] text-soft-foreground`,children:[g===0?`Retention is unlimited (`:`Retention keeps the newest ${g} finished checkout${g===1?``:`s`} (`,(0,X.jsx)(P,{to:`/settings/worktrees`,"data-slot":`worktrees-retention-link`,className:`underline-offset-2 hover:text-foreground hover:underline`,children:je(`worktrees`,` › `)}),g===0?`), so nothing is reclaimed on its own.`:`) and reclaims the rest.`,` `,`Reclaim removes the directory only; the branch stays, so its work stays recoverable.`]})]}),(0,X.jsxs)(`button`,{type:`button`,"data-action":`worktrees-reclaim-now`,disabled:_||!b,title:b?void 0:`Nothing past the keep limit to reclaim`,onClick:()=>a(!0),className:`inline-flex h-[28px] shrink-0 items-center gap-[5px] self-start rounded-[6px] bg-muted px-[10px] text-[12px] font-medium text-foreground hover:brightness-110 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 disabled:hover:brightness-100 max-md:h-11 md:self-center`,children:[(0,X.jsx)(q,{"aria-hidden":`true`,className:`size-[12px]`}),C]})]}),p.length===0?(0,X.jsx)(`p`,{"data-slot":`worktrees-empty`,className:`px-[14px] py-[12px] text-[12.5px] text-soft-foreground`,children:`No task worktrees on disk.`}):(0,X.jsx)(`ul`,{"aria-label":`Task worktrees on disk`,className:`flex flex-col`,children:p.map(e=>(0,X.jsx)(zt,{worktree:e,keep:g,disabled:_,onOpen:t?()=>n.mutate(e.runId):void 0,opening:n.isPending,onReclaim:()=>f.mutate(e)},e.runId))}),(0,X.jsx)(z,{open:i,onOpenChange:a,children:(0,X.jsxs)(R,{children:[(0,X.jsxs)(B,{children:[(0,X.jsx)(G,{children:`Reclaim old worktrees?`}),(0,X.jsxs)(V,{children:[y.length,` finished worktree`,y.length===1?``:`s`,` beyond the keep limit`,S?` (${E(S)})`:``,` `,y.length===1?`is`:`are`,` reclaimed now, directory only. Their branches are kept, so the work stays recoverable.`]})]}),(0,X.jsxs)(J,{children:[(0,X.jsx)(W,{children:`Keep them`}),(0,X.jsx)(H,{"data-action":`worktrees-confirm`,onClick:()=>{d.mutate(y.length),a(!1)},children:C})]})]})})]})}var Lt=new Set([`queued`,`running`,`waiting`,`review`]);function Rt(e,t){return Lt.has(e.status)||!e.reclaimable?{label:`in use`,tone:`in-use`}:e.pastKeep?{label:`reclaimable`,tone:`plain`}:{label:t>0?`kept · newest ${t}`:`kept`,tone:`plain`}}function zt({worktree:e,keep:t,disabled:n,onOpen:r,opening:i,onReclaim:o}){let s=Rt(e,t),c=F(e.finishedAt??void 0),l=e.status===`review`?`at review`:c?`${e.status} ${Re(c)}`:e.status,u=(0,X.jsx)(`span`,{"data-slot":`worktree-state`,"data-state":s.tone===`in-use`?`in-use`:e.pastKeep?`reclaimable`:`kept`,className:a(`text-[11.5px]`,s.tone===`in-use`?`text-status-running`:`text-soft-foreground`),children:s.label}),d=`flex size-[28px] shrink-0 items-center justify-center rounded-[6px] text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 max-md:size-11`;return(0,X.jsxs)(`li`,{"data-slot":`worktree-row`,"data-run":e.runId,className:`flex min-h-[44px] items-center gap-[12px] border-b border-border px-[14px] py-[4px] last:border-0`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,X.jsx)(`span`,{className:`truncate text-[12.5px] text-foreground`,title:e.title,children:e.title}),(0,X.jsxs)(`span`,{className:`truncate font-mono text-[11px] text-soft-foreground`,children:[e.branch??e.runId.slice(0,8),` · `,l,(0,X.jsxs)(`span`,{className:`md:hidden`,children:[` · `,s.label]})]})]}),(0,X.jsx)(`span`,{"data-slot":`worktree-size`,className:`shrink-0 text-[11.5px] tabular-nums text-muted-foreground`,children:e.sizeBytes===null?`—`:E(e.sizeBytes)||`0 kB`}),(0,X.jsx)(`span`,{className:`hidden shrink-0 md:inline`,children:u}),r?(0,X.jsx)(`button`,{type:`button`,className:d,"aria-label":`Open folder for ${e.title}`,title:`Open folder`,disabled:i,onClick:r,children:(0,X.jsx)(ie,{"aria-hidden":`true`,className:`size-[13px]`})}):null,s.tone===`in-use`?null:(0,X.jsx)(`button`,{type:`button`,"data-action":`worktree-reclaim`,"aria-label":`Reclaim the worktree of ${e.title} (branch kept)`,title:`Reclaim the directory (branch kept)`,disabled:n,onClick:o,className:d,children:(0,X.jsx)(q,{"aria-hidden":`true`,className:`size-[13px]`})})]})}function Bt({section:e,index:t=!1}){let n=g(),r=K(),[i]=ne();if(t&&!r&&i.get(`view`)!==`repo`)return(0,X.jsx)(ut,{});if(n.isPending)return(0,X.jsx)(Ve,{});if(n.isError)return(0,X.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,X.jsx)(L,{}),(0,X.jsx)(I,{icon:(0,X.jsx)(A,{size:16}),tone:`danger`,title:`Could not load the repository`,subtitle:n.error.message})]});let a=n.data.info;return a?(0,X.jsx)(Vt,{repo:n.data,info:a,section:e}):(0,X.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,X.jsx)(L,{}),(0,X.jsx)(I,{icon:(0,X.jsx)(O,{size:16}),tone:`neutral`,title:`Not a git repository`,subtitle:`Squawk is running outside a git repository — start it inside one to browse changes, commits and branches.`})]})}function Vt({repo:e,info:t,section:n}){return(0,X.jsxs)(`div`,{"data-route":`repo-git`,"data-git-section":n,className:`flex min-h-full flex-col`,children:[(0,X.jsx)(L,{}),(0,X.jsx)(`header`,{"data-slot":`repo-header`,className:`flex flex-wrap items-start justify-between gap-4 px-4 pt-7 pb-5 md:px-9`,children:(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h1`,{className:`text-[26px] leading-[1.2] font-semibold tracking-tight text-foreground md:text-[28px]`,children:ze(n,t.branch)}),(0,X.jsx)(`p`,{"data-slot":`repo-meta`,className:`mt-1 text-[13px] text-muted-foreground`,children:(0,X.jsx)(Ht,{repo:e,info:t,section:n})})]})}),n===`main`?(0,X.jsx)(vt,{repo:e,info:t}):n===`not-landed`?(0,X.jsx)(Et,{}):n===`cleanup`?(0,X.jsxs)(`div`,{"data-slot":`repo-cleanup`,className:`flex flex-col gap-4 px-4 pt-0 pb-[calc(90px+env(safe-area-inset-bottom))] md:px-9 md:pb-9`,children:[(0,X.jsx)(It,{}),(0,X.jsx)(Pt,{base:e.baseBranch??t.branch})]}):n===`branches`?(0,X.jsx)(dt,{repo:e,info:t}):(0,X.jsx)(_t,{})]})}function Ht({repo:e,info:t,section:n}){let r=e.baseBranch??t.branch;switch(n){case`main`:return(0,X.jsxs)(X.Fragment,{children:[e.log.length===0?`No commits yet`:`Latest ${e.log.length} commit${e.log.length===1?``:`s`} in the main checkout`,e.tracking?` · ${Ye(e.tracking)}`:``]});case`not-landed`:return(0,X.jsxs)(X.Fragment,{children:[`Finished tasks whose commits are not on `,r]});case`branches`:return(0,X.jsx)(Ut,{repo:e,info:t});case`changes`:return(0,X.jsxs)(X.Fragment,{children:[e.status.length,` uncommitted file`,e.status.length===1?``:`s`,` in the main checkout`]});case`cleanup`:return(0,X.jsxs)(X.Fragment,{children:[`Nothing here can delete work that is not on `,r]})}}function Ut({repo:e,info:t}){let n=Q(e,T().data?.branches).length;return(0,X.jsxs)(X.Fragment,{children:[n,` branch`,n===1?``:`es`,` · on `,t.branch]})}export{Bt as RepoGitRoute};
|
|
@@ -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{Nn as r,et as i}from"./project-scope-context-BdqKyBHa.js";import{B as a,N as o}from"./queries-C7VNk-nW.js";import{f as s,g as c,h as l,i as u,n as d,p as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{ot as p,r as m}from"./design-icons-CzEoMH9c.js";import{a as h,c as g,l as _,s as v,t as y,u as b}from"./file-preview-CDWTFZ4P.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./centered-state-V15AR_qo.js";import{_ as C,g as w,h as T}from"./index-CJFT0IZP.js";import{s as E}from"./markdown-Dv0r75AX.js";var D=e(t(),1),O=n();function k(){let e=s(),t=f();return()=>{if(e.key==="default"||window.history.state?.idx===0){t({pathname:e.pathname.replace(/\/report\/?$/,``)},{replace:!0});return}let n=window.navigation,r=A(e.state);n?.canGoBack?n.back():r?t(r,{state:{filesRestoreKey:e.state?.filesRestoreKey}}):t(-1)}}function A(e){let t=e?.readerFrom;return typeof t==`string`&&t.startsWith(`/`)&&!t.startsWith(`//`)?t:null}function j(e){return e?.type===`file`?e:null}function M(){let[e]=c(),t=e.get(`path`),n=e.get(`artifact`);return{path:t,artifactId:n,conflict:e.getAll(`path`).length>1||e.getAll(`artifact`).length>1||t!==null&&n!==null||t===``||n===``}}function N(){let{id:e=``}=l(),t=M(),n=s(),r=k();return(0,O.jsx)(P,{runId:e,selection:t,fragment:n.hash,onBack:r,variant:`route`})}function P({runId:e,selection:t,fragment:n,onBack:r,variant:i,sourceLookup:a}){let{path:o,conflict:c,selected:l,result:d}=I(e,t,a),f=C(T,!0),p=C(w,!1),m=s(),[h,g]=(0,D.useState)(!1),_=j(d.data);if(i===`route`&&L(_))return(0,O.jsx)(u,{replace:!0,to:{pathname:m.pathname.replace(/\/report\/?$/,`/files`),search:m.search,hash:m.hash}});let v=z(_,o),y=i===`pane`&&!p&&!f?`Conversation`:`Back`,b=i===`pane`&&!h&&R(_),x=F(m.pathname,e,t);return(0,O.jsxs)(`div`,{"data-route":`task-report`,"data-variant":i,onKeyDown:e=>{i!==`pane`||e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),r())},className:i===`route`?`fixed inset-0 z-50 flex flex-col bg-background [padding-block-start:env(safe-area-inset-top)] [padding-inline-end:env(safe-area-inset-right)] [padding-block-end:env(safe-area-inset-bottom)] [padding-inline-start:env(safe-area-inset-left)] md:static md:z-auto md:h-full md:p-0`:`flex h-full min-h-0 flex-col bg-background max-md:[padding-block-start:env(safe-area-inset-top)] max-md:[padding-inline-start:env(safe-area-inset-left)] max-md:[padding-inline-end:env(safe-area-inset-right)]`,children:[(0,O.jsx)(B,{runId:e,file:_,name:v,source:h,onSource:()=>g(e=>!e),onBack:r,backLabel:y,hideDownload:i===`pane`&&p,focusBack:i===`pane`}),(0,O.jsx)(`div`,{"data-slot":`report-body`,className:b?`flex min-h-0 flex-1 flex-col overflow-clip`:`flex min-h-0 flex-1 flex-col overflow-auto`,children:(0,O.jsx)(V,{conflict:c,selected:l,result:d,source:h,name:v,fragment:n,pane:i===`pane`,filesHref:x})})]})}function F(e,t,n){let r=/^\/p\/[^/]+/.exec(e)?.[0]??``,i=n.artifactId?new URLSearchParams({artifact:n.artifactId}):new URLSearchParams({path:n.path??``});return`${r}/tasks/${encodeURIComponent(t)}/files?${i}`}function I(e,t,n){let{path:r=null,artifactId:i=null,conflict:s=!1}=t,c=n?.isPending||n?.isError,l=a(e,i||s||c?null:r),u=o(e,s||c?null:i),d=c&&n?{...n,data:void 0}:i?u:l;return{path:r,conflict:s,selected:r!==null||i!==null,result:d}}function L(e){return e!==null&&(!E(e.path)||!e.artifact&&(e.tooLarge||e.binary))}function R(e){return e!==null&&!e.tooLarge&&!e.binary}function z(e,t){return e?e.artifact?.name??e.path.split(/[\\/]/).at(-1)??e.path:t??`Report`}function B({runId:e,file:t,name:n,source:r,onSource:a,onBack:o,backLabel:s,hideDownload:c,focusBack:l}){let u=(0,D.useRef)(null);(0,D.useEffect)(()=>{l&&u.current?.focus({preventScroll:!0})},[l]);let d=t?.artifact;return(0,O.jsxs)(`header`,{"data-slot":`report-bar`,className:`flex min-h-14 shrink-0 items-center gap-2 border-b border-border bg-card px-2 md:px-4`,children:[(0,O.jsxs)(x,{ref:u,variant:`ghost`,className:`min-h-11 min-w-11 gap-1.5 px-2`,onClick:o,"aria-label":s,children:[(0,O.jsx)(m,{size:18,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`max-sm:sr-only`,children:s})]}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsx)(`h1`,{className:`truncate text-sm font-medium`,children:n}),t?(0,O.jsxs)(`p`,{className:`truncate text-xs text-soft-foreground`,children:[d?`Published snapshot · ${new Date(d.createdAt).toLocaleString()}`:`Live file`,` · `,h(t.size)]}):null]}),t&&!t.tooLarge&&!t.binary?(0,O.jsx)(x,{variant:`ghost`,className:`min-h-11 px-3 text-accent-text`,onClick:a,children:r?`Preview`:`Source`}):null,d&&!c?(0,O.jsx)(`a`,{className:`inline-flex min-h-11 items-center rounded-md px-3 text-sm text-accent-text underline focus-visible:ring-2`,href:i(e,d.id,`download`),children:`Download`}):null]})}function V({conflict:e,selected:t,result:n,source:r,name:i,fragment:a,pane:o,filesHref:s}){if(e)return(0,O.jsx)(U,{icon:(0,O.jsx)(g,{}),title:`Invalid report link`,subtitle:`Choose either a path or a published artifact.`});if(!t)return(0,O.jsx)(U,{icon:(0,O.jsx)(_,{}),title:`No report selected`,subtitle:`Open a report from a link in the conversation or from Files.`});if(n.isPending)return(0,O.jsx)(`p`,{role:`status`,"data-slot":`report-loading`,className:`px-4 py-6 text-center text-sm text-soft-foreground`,children:`Loading report…`});if(n.isError)return(0,O.jsx)(H,{result:n});let c=n.data;return c.type===`file`?o&&!E(c.path)?(0,O.jsx)(U,{icon:(0,O.jsx)(_,{}),title:`Not an HTML report`,subtitle:`Open this published file in Files.`,action:(0,O.jsx)(d,{to:s,className:`inline-flex min-h-11 items-center rounded-md px-3 text-sm text-accent-text underline active:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:`Open in Files`})}):c.tooLarge?(0,O.jsx)(U,{icon:(0,O.jsx)(b,{}),title:`Too large to preview`,subtitle:`${h(c.size)} is past the 500 kB preview limit. Download it to read it.`}):c.binary?(0,O.jsx)(U,{icon:(0,O.jsx)(_,{}),title:`Binary file`,subtitle:`This file holds binary data, not readable HTML.`}):r?(0,O.jsx)(`div`,{className:`bg-card`,children:(0,O.jsx)(y,{path:c.path,text:c.content??``})}):(0,O.jsx)(v,{html:c.content??``,title:`Report: ${i}`,fragment:a,className:o?`min-h-0 flex-1`:`min-h-[60dvh] flex-1`}):(0,O.jsx)(U,{icon:(0,O.jsx)(g,{}),title:c.type===`unpublished`?`Report not published`:`Report unavailable`,subtitle:c.reason})}function H({result:e}){let t=e.error instanceof r&&e.error.status===404;return(0,O.jsx)(U,{icon:t?(0,O.jsx)(g,{}):(0,O.jsx)(p,{size:16}),tone:t?`neutral`:`danger`,title:t?`Report missing or deleted`:`Could not load this report`,subtitle:e.error?.message??`Try again.`,action:(0,O.jsx)(x,{variant:`outline`,className:`min-h-11`,onClick:()=>void e.refetch(),children:`Retry`})})}function U({icon:e,title:t,subtitle:n,tone:r=`neutral`,action:i}){return(0,O.jsxs)(`div`,{"data-slot":`report-state`,className:`flex flex-col items-center gap-3 p-6`,children:[(0,O.jsx)(S,{icon:e,tone:r,heading:`h2`,title:t,subtitle:n}),i]})}export{P as ReportReader,N as TaskReportRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{c as r}from"./utils-DSMR_WLb.js";import{Br as i,Fn as a,Hr as o,Ln as s,Pn as c,di as l,vr as u}from"./project-scope-context-BdqKyBHa.js";import{B as d,F as f,I as p,J as m,N as h,W as g,Y as _,z as v}from"./live-protocol-DMhTnCmf.js";import{t as y}from"./useInfiniteQuery--iQKfpUQ.js";import{f as b,m as x}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{r as S,t as C}from"./live-reads-BJ9eDISf.js";import{X as w}from"./design-icons-CzEoMH9c.js";import{t as T}from"./chevron-right-BENZ-1ZN.js";import{t as E}from"./button-B7MKxYjT.js";import{t as D}from"./project-router-Bii3ofOk.js";import{a as O}from"./format-BU7D3IfE.js";import{$n as k,Wn as A,_n as j,b as M}from"./index-CJFT0IZP.js";import{t as N}from"./report-title-D4Mbu2Er.js";var P=e(t(),1),F=1e3,I=g().min(1).max(1024);d({q:g().max(F).optional(),before:I.optional(),limit:g().regex(/^(?:[1-9]|[1-9][0-9]|100)$/).transform(Number).optional()}).strict();var L=d({reports:h(d({id:m(),runId:m(),name:g(),title:g(),createdAt:_(),size:v().int().nonnegative(),taskTitle:g(),taskStatus:u}).strict()),nextCursor:I.nullable(),total:v().int().nonnegative()}).strict(),R=d({epoch:m(),generation:v().int().nonnegative(),metadataGeneration:v().int().nonnegative()}).strict(),z=d({runId:m(),taskTitle:g(),taskStatus:u}).strict(),B=f(`type`,[R.extend({type:p(`snapshot`)}),R.extend({type:p(`content`)}),R.extend({type:p(`metadata`),runs:h(z)})]),V=new WeakMap;function H(e,t){if(!e)return{content:t.type===`content`,metadata:t.type===`metadata`,reset:!1};if(e.epoch!==t.epoch)return{content:!0,metadata:!0,reset:!0};if(!(t.generation<e.generation||t.metadataGeneration<e.metadataGeneration)&&!(e.generation===t.generation&&e.metadataGeneration===t.metadataGeneration))return{content:t.generation!==e.generation,metadata:t.metadataGeneration!==e.metadataGeneration,reset:!1}}var U=class{client;project;state;content=0;metadata=0;patches=new Map;trailing=new Set;flights=new Map;constructor(e,t){this.client=e,this.project=t,e.getQueryCache().subscribe(n=>{if(n.type===`removed`){this.trailing.delete(n.query),this.flights.delete(n.query);return}if(!(n.query.queryKey[0]!==t||n.query.queryKey[1]!==`reports`)){if(n.type===`updated`&&n.action.type===`fetch`&&this.flights.set(n.query,this.metadata),n.query.state.fetchStatus===`idle`&&this.flights.has(n.query)){let e=this.flights.get(n.query);this.flights.delete(n.query),e!==this.metadata&&String(n.query.queryKey[2]??``).trim()===``&&this.client.setQueryData(n.query.queryKey,t=>t&&{...t,pages:t.pages.map(t=>this.patch(t,e))})}!this.trailing.has(n.query)||n.query.state.fetchStatus!==`idle`||(this.trailing.delete(n.query),queueMicrotask(()=>{e.invalidateQueries({queryKey:n.query.queryKey,exact:!0,refetchType:`active`},{cancelRefetch:!1})}))}})}patch(e,t=-1){return{...e,reports:e.reports.map(e=>{let n=this.patches.get(e.runId);return n&&n.version>t?{...e,taskTitle:n.value.taskTitle,taskStatus:n.value.taskStatus}:e})}}async read(e,t){for(;;){let n=this.content,r=this.metadata,i=await t();if(!(n!==this.content||e.trim()!==``&&r!==this.metadata))return e.trim()===``?this.patch(i,r):i}}receive(e,t=!1){let n=this.state;if(!n&&e.type===`snapshot`){this.state=e,this.content++,this.client.getQueryCache().findAll({queryKey:[this.project,`reports`]}).some(e=>e.state.data!==void 0)&&this.invalidate(!0);return}let r=H(n,e);if(!r){t&&e.type===`snapshot`&&(this.content++,this.invalidate(!0));return}let{metadata:i,reset:a}=r,o=r.content||t&&e.type===`snapshot`;this.state=e,a&&this.patches.clear(),i&&this.metadata++,o&&this.content++,e.type===`metadata`&&!a&&this.patchCaches(e);let s=o||i&&e.type!==`metadata`;(s||i)&&this.invalidate(s)}patchCaches(e){for(let t of e.runs)this.patches.set(t.runId,{value:t,version:this.metadata});this.client.setQueriesData({queryKey:[this.project,`reports`],predicate:e=>String(e.queryKey[2]??``).trim()===``},e=>e&&{...e,pages:e.pages.map(e=>this.patch(e,this.metadata-1))})}invalidate(e){let t={queryKey:[this.project,`reports`],refetchType:`active`,...e?{}:{predicate:e=>String(e.queryKey[2]??``).trim()!==``}};for(let e of this.client.getQueryCache().findAll(t))e.state.fetchStatus===`fetching`&&this.trailing.add(e);this.client.invalidateQueries(t,{cancelRefetch:!1})}};function W(e,t){let n=V.get(e);n||(n=new Map,V.set(e,n));let r=n.get(t);return r||(r=new U(e,t),n.set(t,r)),r}async function G(e,t){let n=await c.api.v1.p[`:projectId`].reports.state.$get({param:{projectId:e}},a({signal:t}));return R.parse(await s(n,`/reports/state`))}function K(e){let t=W(l(),e);return(0,P.useEffect)(()=>{let n=S(`reports:project:${e}`,e=>{let n=B.safeParse(e);n.success&&t.receive(n.data,n.data.type===`snapshot`)}),r,a,s=()=>{if(i()===`finite`&&!r){a=new AbortController;let n=a.signal;G(e,n).then(e=>{n.aborted||t.receive({type:`snapshot`,...e})}).catch(()=>void 0),r=C({path:`/api/v1/p/${encodeURIComponent(e)}/reports/state`,intervalMs:5e3},(e,n)=>{let r=R.safeParse(e);!n&&r.success&&t.receive({type:`snapshot`,...r.data})})}else i()!==`finite`&&(a?.abort(),r?.(),r=void 0)};s();let c=o(s);return()=>{c(),a?.abort(),r?.(),n()}},[t,e]),t}async function q(e,t,n,r){let i=await c.api.v1.p[`:projectId`].reports.$get({param:{projectId:e},query:{q:t.slice(0,F),...n?{before:n}:{}}},a(r?{signal:r}:void 0));return L.parse(await s(i,`/reports`))}function J(e){let t=r(),n=K(t);return y({queryKey:[t,`reports`,e],initialPageParam:void 0,queryFn:({pageParam:r,signal:i})=>n.read(e,()=>q(t,e,r,i)),getNextPageParam:e=>e.nextCursor??void 0,staleTime:0,refetchOnWindowFocus:!0})}var Y=n(),X=new Map;function Z(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t)}function Q(){let e=b(),t=x(),[n,r]=M(),i=(n.get(`q`)??``).slice(0,F),a=J(i),o=(0,P.useRef)(null),s=(0,P.useRef)(``),c=e.pathname+e.search,l=a.data?.pages.flatMap(e=>e.reports)??[];(0,P.useLayoutEffect)(()=>{if(!a.data||s.current===c)return;let n=X.get(c),r=e.state?.filesRestoreKey===c;if(!n||!o.current||t!==`POP`&&!r){s.current=c;return}let i=o.current.querySelector(`[data-report-id="${n.row}"]`);if(a.isFetchNextPageError){s.current=c,o.current.scrollTop=0;return}if((!i||a.data.pages.length<n.pages)&&a.hasNextPage){a.isFetchingNextPage||a.fetchNextPage();return}s.current=c,o.current.scrollTop=i?n.scroll:0,i?.focus({preventScroll:!0})},[c,a.data,a.hasNextPage,a.isFetchingNextPage,a.isFetchNextPageError,a.fetchNextPage,e.state,t]);let u=t=>r(n=>(t?n.set(`q`,t.slice(0,F)):n.delete(`q`),X.delete(e.pathname+`?`+n.toString()),n));return(0,Y.jsxs)(`section`,{"data-route":`reports`,className:`flex h-full min-h-0 flex-col`,children:[(0,Y.jsxs)(`div`,{className:`shrink-0 px-4 pt-7 pb-4 md:px-9`,children:[(0,Y.jsx)(`header`,{className:`mb-5 flex flex-wrap items-start justify-between gap-4`,children:(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`h1`,{className:`text-[26px] font-semibold tracking-tight leading-[1.2] text-foreground md:text-[28px]`,children:`Reports`}),(0,Y.jsx)(`p`,{className:`mt-1 text-[13px] text-muted-foreground`,children:`Published HTML snapshots from tasks in this project.`})]})}),(0,Y.jsxs)(`div`,{className:`relative w-full`,children:[(0,Y.jsx)(w,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,Y.jsx)(A,{maxLength:F,"aria-label":`Search reports`,placeholder:`Search reports or source tasks…`,value:i,onChange:e=>u(e.target.value),className:`h-10 w-full rounded-lg border-border bg-card pl-9 text-sm max-md:h-11`})]})]}),(0,Y.jsxs)(`div`,{ref:o,"data-slot":`reports-list`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-9 md:px-9`,children:[a.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`py-4 text-sm text-muted-foreground`,children:`Loading reports…`}):a.isError?(0,Y.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-3 rounded-xl border border-border bg-card p-5`,children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Could not load reports`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a.error.message}),(0,Y.jsx)(E,{variant:`outline`,className:`min-h-11`,onClick:()=>void a.refetch(),children:`Retry`})]}):l.length===0?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-xl border border-border bg-card p-6`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:i?`No matching reports`:`No published reports yet`}),i?(0,Y.jsx)(E,{"data-slot":`reports-clear-search`,variant:`outline`,className:`min-h-11`,onClick:()=>u(``),children:`Clear search`}):(0,Y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Publish an HTML snapshot with `,(0,Y.jsxs)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground`,children:[j(),` artifact publish`]}),` to list it here.`]})]}):(0,Y.jsx)(`ul`,{className:`flex flex-col gap-1.5`,"aria-label":`Reports`,children:l.map(e=>(0,Y.jsxs)(`li`,{"data-slot":`report-row`,className:`reports-row flex items-center gap-3 rounded-xl border border-border bg-card px-4 py-3 transition-colors`,children:[(0,Y.jsx)(k,{"aria-hidden":`true`,className:`reports-icon size-4 shrink-0 self-start mt-0.5 text-accent-text`}),(0,Y.jsxs)(`div`,{className:`reports-lines flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Y.jsx)(`h2`,{className:`flex min-w-0 text-[14px] leading-5 font-semibold text-foreground`,title:N(e),children:(0,Y.jsx)(D,{"data-report-id":e.id,className:`reports-open text-foreground no-underline`,to:`/tasks/${e.runId}/report?artifact=${e.id}`,state:{readerFrom:c,filesRestoreKey:c},onClick:()=>X.set(c,{scroll:o.current?.scrollTop??0,row:e.id,pages:a.data?.pages.length??1}),children:(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:N(e)})})}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-xs leading-4 text-muted-foreground`,children:[(0,Y.jsx)(D,{className:`reports-task min-w-0 truncate text-xs text-muted-foreground no-underline hover:text-foreground hover:underline`,to:`/tasks/${e.runId}`,children:(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,title:e.taskTitle,children:e.taskTitle})}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:`·`}),(0,Y.jsx)(`time`,{className:`shrink-0 tabular-nums`,dateTime:e.createdAt,title:Z(e.createdAt),children:$(e.createdAt)})]})]}),(0,Y.jsx)(T,{"aria-hidden":`true`,"data-slot":`report-open-cue`,className:`reports-cue size-4 shrink-0 text-muted-foreground`})]},e.id))}),a.hasNextPage?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(E,{variant:`outline`,className:`min-h-11`,disabled:a.isFetchingNextPage,onClick:()=>void a.fetchNextPage(),children:`Load more reports`})}):null]})]})}function $(e){let t=O(e);return t?t===`just now`?`Published just now`:`Published · ${t}`:``}export{Q as ReportsRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.reports-row{position:relative}.reports-open{align-items:center;min-width:0;display:flex}.reports-open:after{content:"";position:absolute;inset:0}.reports-task{z-index:1;align-items:center;min-width:0;max-width:100%;display:inline-flex;position:relative}@media (hover:none),(width<=767px){.reports-row{padding-block:0}.reports-lines{gap:0}.reports-icon{margin-block-start:14px}.reports-open,.reports-task{min-block-size:44px}}.reports-open:focus-visible{outline:2px solid #0000}.reports-row:has(.reports-open:focus-visible){outline:2px solid var(--ring);outline-offset:2px}.reports-task:focus-visible{outline:2px solid var(--ring);outline-offset:2px;border-radius:4px}.reports-row:active{background:var(--sidebar-row-selected)}@media (hover:hover) and (pointer:fine){.reports-row:hover{background:var(--sidebar-row-hover)}.reports-row:hover .reports-cue{color:var(--foreground)}}
|
|
@@ -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{d as a}from"./live-refetch-VoLPvzhe.js";import{$ as o,Ft as s,Nn as c,On as l,Pt as u,_r as d,ct as f,di as p,ir as m,or as h}from"./project-scope-context-BdqKyBHa.js";import{Bt as g,G as _,H as v,K as y,Qt as b,St as x,U as ee,W as S,Xt as C,Y as w,Zt as T,bt as E,ct as D,f as O,rt as te,tt as ne,vt as re,xt as ie}from"./queries-C7VNk-nW.js";import{d as ae,h as oe}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{a as se,d as ce,f as le,g as ue,m as de,o as fe,p as pe,s as me}from"./tasks-table-Cx7AM7lZ.js";import{n as k}from"./toaster-Bo5vCbz-.js";import{F as he,at as ge,ft as A,i as j,l as _e,p as ve,q as ye,t as be,v as M,x as xe}from"./design-icons-CzEoMH9c.js";import{t as N}from"./createLucideIcon-BHp8sXmF.js";import{t as Se}from"./app-window-CSHwDX9N.js";import{n as Ce,r as we,t as Te}from"./open-in-menu-HM5l7Bwk.js";import{t as Ee}from"./info-DA1x_4bz.js";import{t as De}from"./message-square-B-MD-8rD.js";import{i as Oe,n as ke,t as P}from"./reference-chip-rylFalfg.js";import{t as F}from"./square-terminal-B6RYYieR.js";import{t as I}from"./button-B7MKxYjT.js";import{a as L,i as R,l as z,n as B,p as V,r as H,t as U}from"./dropdown-menu-4e2iKSMT.js";import{i as Ae,r as je,t as Me}from"./popover-BPgUYFyu.js";import{a as Ne,i as Pe,o as Fe,r as Ie,s as Le,t as Re}from"./dialog-B531GGAo.js";import{c as ze,s as Be,t as W}from"./project-router-Bii3ofOk.js";import"./attention-8bNiiAFt.js";import{T as Ve,f as G,u as He}from"./task-groups-BbnYlkYj.js";import{t as Ue}from"./status-dot-BRzVlF2X.js";import{t as We}from"./format-BU7D3IfE.js";import{$n as Ge,B as Ke,Gt as qe,Ht as Je,Jn as Ye,Jt as K,Kt as Xe,Mn as Ze,Nn as Qe,R as $e,Ut as et,Wt as tt,Yn as nt,Yt as rt,a as it,dn as q,fn as J,jn as at,m as ot,o as st,qt as ct,r as lt,rn as ut,sn as dt,sr as ft,tn as pt,xn as mt,z as ht}from"./index-CJFT0IZP.js";import{r as gt,t as _t}from"./markdown-Dv0r75AX.js";import{t as vt}from"./textarea-vJt9undk.js";import{t as Y}from"./tab-link-B1CULYRs.js";var yt=N(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),bt=N(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),xt=N(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),X=e(t(),1),Z=n();function St(e){let t=D();return b({mutationFn:t=>o(T(e),t),onSuccess:()=>t.invalidateAfter(`runs`,()=>C()),onError:e=>k(e.message,{tone:`danger`})})}function Ct(e){return e.archived?`Unarchive`:`Archive task`}function wt({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,Z.jsx)(Je,{open:t,onOpenChange:n,children:(0,Z.jsxs)(qe,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(rt,{children:`Archive task?`}),(0,Z.jsxs)(Xe,{children:[`Move “`,(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,title:G(e),children:G(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,Z.jsxs)(ct,{children:[(0,Z.jsx)(tt,{children:`Cancel`}),(0,Z.jsx)(et,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function Tt({run:e,className:t}){let[n,r]=(0,X.useState)(!1),a=St(e.id),o=Ct(e);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(I,{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,Z.jsx)(ft,{"aria-hidden":`true`}):(0,Z.jsx)(be,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{children:o})]}),(0,Z.jsx)(wt,{run:e,open:n,onOpenChange:r,onConfirm:()=>{a.mutate(!0),r(!1)}})]})}function Et({run:e,action:t,prUrl:n,patch:i}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,Z.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,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n&&r(n)?(0,Z.jsx)(I,{variant:`outline`,asChild:!0,children:(0,Z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:`Open PR`})}):null,e.autoMergePr?(0,Z.jsx)(I,{variant:`outline`,disabled:i.isPending,onClick:()=>i.mutate({autoMergePr:!1},{onError:e=>k(e.message,{tone:`danger`})}),children:i.isPending?`Saving…`:`Disable auto-merge`}):null]})]})}function Dt({run:e,blocker:t,flags:n}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-sm [overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Archive blocked`}),` · `,t.message]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.runId?(0,Z.jsx)(I,{variant:`outline`,asChild:!0,children:(0,Z.jsx)(W,{to:`/tasks/${t.runId}`,children:`Open blocking task`})}):null,t.pullRequestUrl&&r(t.pullRequestUrl)?(0,Z.jsx)(I,{variant:`outline`,asChild:!0,children:(0,Z.jsx)(`a`,{href:t.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,children:`Open blocking PR`})}):null,n.archive?(0,Z.jsx)(Tt,{run:e}):null]})]})}function Ot({run:e}){let t=_(e.id),n=J(e),r=e.status===`done`?e.completionAction:void 0,i=n.archive?e.archiveBlocker:void 0,a=r&&r.phase!==`complete`?r:void 0;if(!a&&!i)return null;let o=e.pullRequestUrl??e.pullRequests?.find(e=>e.url)?.url;return(0,Z.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,Z.jsx)(Et,{run:e,action:a,prUrl:o,patch:t}):null,i?(0,Z.jsx)(Dt,{run:e,blocker:i,flags:n}):null]})}var kt=[`running`,`queued`,`waiting`];function At(e,{queuePosition:t,now:n=new Date}){let r=l(e),i=r.label.charAt(0).toUpperCase()+r.label.slice(1),a=t===void 0?i:`${i} #${t}`,o=kt.includes(e.status)?Mt(e,n):void 0;return o?{attention:r,label:a,nextCheck:o}:{attention:r,label:a}}function jt(e){return e.nextCheck?`${e.label} · Next check ${e.nextCheck.text}`:e.label}function Mt(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:We(n,t)}}async function Q(e,t){try{await navigator.clipboard.writeText(e),k(t)}catch{k(`Run manually: ${e}`)}}function Nt(e){let t=E(),n=O(),r=(0,X.useMemo)(()=>ue(e,t),[e,t]);return{referenceProjectId:n,repoBase:t,references:r,requests:(0,X.useMemo)(()=>n===void 0?[]:r.filter(e=>se(e,t)).map(e=>({projectId:n,kind:e.kind,number:e.number})),[r,n,t])}}function Pt(e){return b({mutationFn:()=>s(e.id),onError:e=>{if(e instanceof c&&e.command){Q(e.command,`No terminal found — command copied to clipboard.`);return}k(e.message,{tone:`danger`})}})}function $(e,t){let n=S(),r=x(),i=a(),o=b({mutationFn:t=>u(e.id,t),onError:e=>k(e.message,{tone:`danger`})}),s=mt(),c=Ve(e),l=s.runnersOn(e=>t&&c.sessionId!==void 0&&e===c.backend?c.profileId??`default`:s.repoAccount?.[e]).runners,d=e=>!r.isSuccess||!i.isSuccess||l.includes(e??`claude`);return{canResumeHere:t&&d(dt(e)),choices:e.worktreePath?(n.data?.targets??[]).filter(e=>{let t=Ce(e.id);return t===void 0||i.isSuccess&&d(t)}).map(t=>({target:t,...ut(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[],open:o}}function Ft({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:o}=$(e,t),s=a().data,c=q(e);return!r&&i.length===0&&!c?null:(0,Z.jsxs)(Z.Fragment,{children:[r||i.length>0?(0,Z.jsxs)(`div`,{className:`task-open-targets flex flex-wrap gap-3`,children:[r?(0,Z.jsxs)(I,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,Z.jsx)(F,{}),`Terminal (resume session)`]}):null,i.map(({target:e,suffix:t,title:n})=>{let r=we(e,s);return(0,Z.jsxs)(I,{variant:`outline`,"data-target":e.id,title:n,disabled:o.isPending,onClick:()=>o.mutate(e.id),children:[(0,Z.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,Z.jsxs)(I,{variant:`outline`,onClick:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>k(`Worktree path copied`)).catch(()=>k(`Path: ${t}`))},children:[(0,Z.jsx)(M,{}),`Copy worktree path`]}):null]}):null,c?(0,Z.jsxs)(`div`,{"data-slot":`resume-command`,className:`mt-5 border-t border-border pt-5`,children:[(0,Z.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,Z.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:c}),(0,Z.jsxs)(I,{variant:`outline`,onClick:()=>void Q(c,`Command copied to clipboard.`),children:[(0,Z.jsx)(M,{}),`Copy resume command`]})]}):null]})}function It({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=$(e,t),o=q(e),s=e.worktreePath;if(!r&&i.length===0&&!o&&!s)return null;let c=`max-md:min-h-11`;return(0,Z.jsxs)(`div`,{"data-slot":`workspace-tools`,className:`flex min-w-0 flex-wrap gap-2`,children:[r||i.length>0?(0,Z.jsx)(Te,{choices:i,onPick:e=>a.mutate(e),disabled:a.isPending,triggerVariant:`outline`,className:c,leading:r?(0,Z.jsxs)(R,{"data-target":`terminal-resume`,onSelect:n,children:[(0,Z.jsx)(F,{"aria-hidden":`true`}),`Terminal (resume session)`]}):void 0}):null,s?(0,Z.jsxs)(I,{variant:`outline`,size:`sm`,className:c,onClick:()=>void Q(s,`Worktree path copied`),children:[(0,Z.jsx)(M,{"aria-hidden":`true`}),`Copy worktree path`]}):null,o?(0,Z.jsxs)(I,{variant:`outline`,size:`sm`,"data-slot":`resume-command`,title:o,className:c,onClick:()=>void Q(o,`Command copied to clipboard.`),children:[(0,Z.jsx)(M,{"aria-hidden":`true`}),`Copy resume command`]}):null]})}function Lt({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let{canResumeHere:a,choices:o}=$(e,t);return!a&&o.length===0?null:r?(0,Z.jsx)(R,{onSelect:r,children:`Open in…`}):(0,Z.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,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,Z.jsx)(I,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,Z.jsx)(A,{})})]}),e.worktreePath?(0,Z.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,Z.jsx)(`div`,{className:`mt-4`,children:(0,Z.jsx)(Ft,{run:e,canResume:t,onResume:n})})]})}function Rt({branch:e}){let[t,n]=(0,X.useState)(null),r=(0,X.useRef)(null);(0,X.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{k(`Could not copy branch. Select and copy: ${e}`)}};return(0,Z.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,children:[(0,Z.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,Z.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,Z.jsx)(M,{className:`size-3.5`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function zt({run:e}){let t=E(),n=O(),i=r=>n===void 0?void 0:le(n,e.id,r,t),a=(0,X.useMemo)(()=>ue(e,t),[e,t]),o=[],s=[],c=a.filter(e=>e.kind===`PR`);for(let t of c)o.push((0,Z.jsx)(P,{reference:t,to:i(t),taskTitle:G(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,Z.jsx)(pt,{run:e,prNumber:t.number})},me(t)));let l=de(e);l&&r(l)&&!c.some(e=>e.url===l)&&o.push((0,Z.jsx)(P,{reference:{kind:`PR`,url:l},taskTitle:G(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,Z.jsx)(P,{reference:t,to:i(t),taskTitle:G(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},me(t)));let d=ce(e,t);if(d&&r(d)&&!u.some(e=>e.url===d)){let t=fe(d);s.push((0,Z.jsx)(P,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},to:t?i({kind:`Issue`,number:Number(t),url:d}):void 0,taskTitle:G(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`issue`))}return o.length===0&&s.length===0?null:(0,Z.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,Z.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,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:n})]},e):null)})}function Bt(){let e=Be(),t=ie();return $e(t.data?.projects?.find(n=>n.id===(e??t.data?.bootProject)))}var Vt=e=>e.map(e=>`${e.name}: ${ht(e.url)}`).join(`
|
|
2
|
-
`);function Ht(e){return Bt().length>0||e.notify===!0}function Ut({run:e}){let t=Bt(),n=t.length>0,r=ee(e.id),[i,a]=(0,X.useState)(null),o=e.notify===!0;return!n&&!o?null:(0,Z.jsxs)(Z.Fragment,{children:[o?(0,Z.jsxs)(U,{children:[(0,Z.jsx)(V,{asChild:!0,children:(0,Z.jsxs)(I,{variant:`outline`,size:`sm`,"data-slot":`notifying-chip`,className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":n?`Notifying ${Ke(t)} — webhook actions`:`Notifying — webhook actions`,title:n?Vt(t):void 0,children:[(0,Z.jsx)(Ue,{tone:`success`}),(0,Z.jsx)(`span`,{children:`Notifying`}),(0,Z.jsx)(_e,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,Z.jsxs)(H,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[n?(0,Z.jsx)(L,{"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,Z.jsx)(`span`,{"data-webhook-target":e.id,className:`truncate`,title:ht(e.url),children:e.name},e.id))}):null,n?(0,Z.jsxs)(R,{className:`min-h-11`,onSelect:()=>a(`note`),children:[(0,Z.jsx)(De,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,Z.jsxs)(R,{variant:`destructive`,className:`min-h-11`,disabled:r.isPending,onSelect:()=>r.mutate({notify:!1},{onSuccess:()=>k(`Stopped notifying the webhook`),onError:e=>k(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),children:[(0,Z.jsx)(yt,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,Z.jsxs)(I,{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,Z.jsx)(Ye,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`max-md:sr-only`,children:`Hand off`})]}),n?(0,Z.jsx)(Wt,{mode:i,targets:t,pending:r.isPending,onOpenChange:e=>!e&&a(null),onSubmit:e=>r.mutate({notify:!0,...e?{message:e}:{}},{onSuccess:()=>{a(null),k(i===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>k(`Could not hand off. ${e.message}`,{tone:`danger`})})}):null]})}function Wt({mode:e,targets:t,pending:n,onOpenChange:r,onSubmit:i}){let a=(0,X.useId)(),o=(0,X.useId)(),[s,c]=(0,X.useState)(``);(0,X.useEffect)(()=>{e!==null&&c(``)},[e]);let l=e===`note`,u=Ke(t);return(0,Z.jsx)(Re,{open:e!==null,onOpenChange:e=>{e||c(``),r(e)},children:(0,Z.jsx)(Ie,{"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,Z.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),i(s.trim())},children:[(0,Z.jsxs)(Fe,{className:`text-left`,children:[(0,Z.jsx)(Le,{children:l?`Send a note to ${t.length===1?`the webhook`:`the webhooks`}`:`Hand off to webhook`}),(0,Z.jsx)(Pe,{children:(0,Z.jsx)(`span`,{"data-webhook-destination":``,title:Vt(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,Z.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:a,className:`text-[13px] font-medium`,children:`Note`}),(0,Z.jsx)(vt,{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,Z.jsxs)(`p`,{id:o,className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[(0,Z.jsx)(Ee,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,Z.jsxs)(Ne,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:h-11 max-sm:[&>button]:w-full`,children:[(0,Z.jsx)(I,{type:`button`,variant:`ghost`,className:`sm:h-9`,onClick:()=>r(!1),children:`Cancel`}),(0,Z.jsxs)(I,{type:`submit`,variant:`contrast`,className:`sm:h-9`,"data-action":`handoff-submit`,disabled:n||l&&s.trim()===``,children:[(0,Z.jsx)(Ye,{"aria-hidden":`true`}),l?`Send note`:`Hand off`]})]})]})})})}function Gt({runId:e,children:t}){let n=ae(),r=(0,X.useMemo)(()=>({runId:e}),[e]);return n?(0,Z.jsx)(Kt,{runId:e,children:t}):(0,Z.jsx)(gt.Provider,{value:r,children:t})}function Kt({runId:e,children:t}){let{projectId:n}=oe(),r=(0,X.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,Z.jsx)(gt.Provider,{value:r,children:t})}function qt({id:e}){return(0,Z.jsxs)(W,{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,Z.jsx)(j,{"aria-hidden":!0,className:`shrink-0 [block-size:1.2cap] [inline-size:auto]`}),`Parent`]})}function Jt({id:e}){let t=w(e),n=t.data?G(t.data):e;return(0,Z.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,Z.jsxs)(W,{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,Z.jsx)(j,{"aria-hidden":!0,className:`h-[1.2cap] w-auto shrink-0`}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`Parent`}),(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,Z.jsx)(`span`,{className:`min-w-0 overflow-clip text-ellipsis whitespace-nowrap`,children:n})]}),t.isError?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{children:`Parent record unavailable or deleted`}),(0,Z.jsx)(I,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}var Yt=3,Xt=(e,t)=>e.kind===t.kind&&e.number===t.number;function Zt(e,t,n=Yt){let r=t?e.findIndex(e=>Xt(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 Qt=(e,t)=>`/tasks/${e}/${t.kind}/${t.number}`;function $t({tab:e}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(e.kind===`pr`?he:ve,{"aria-hidden":`true`,className:`mr-1 size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.kind===`pr`?`Pull request`:`Issue`}),` #`,e.number,(0,Z.jsx)(ke,{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=ot();if(t===null)return null;let n=t.agentLive===!0,r=e[0],i=e.length+ +!!n===1?r?{port:r.port}:{agent:!0}:{};return(0,Z.jsxs)(I,{variant:`outline`,size:`sm`,"data-slot":`preview-toggle`,className:`max-md:h-11`,"aria-pressed":t.open,onClick:()=>t.openPane(i),children:[(0,Z.jsx)(Se,{"aria-hidden":`true`}),en(e,n),t.live?(0,Z.jsx)(Ue,{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,Z.jsx)(qt,{id:n}):(0,Z.jsx)(Jt,{id:n})}function an(e,t){return!e.archiveBlocker&&t.archive?(0,Z.jsx)(Tt,{run:e}):null}function on({run:e}){return e.archived&&e.autoArchive?.reason===`pull-requests-merged`&&e.autoArchive.archivedAt===e.archivedAt?(0,Z.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=Ht(t);return e&&(n||r)?(0,Z.jsxs)(`div`,{"data-slot":`run-mobile-actions`,className:`flex flex-wrap items-center gap-2 pt-2`,children:[n,(0,Z.jsx)(Ut,{run:t})]}):null}function cn({run:e,tab:t,activeItem:n,inlineItemTabs:r,overflowItemTabs:i,phoneBar:a,isDesktop:o}){let s=(0,X.useRef)(null),c=n?`${n.kind}#${n.number}`:null;return(0,X.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,Z.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,Z.jsx)(Y,{to:`/tasks/${e.id}`,active:t===`session`,replace:a,children:`Session`}),(0,Z.jsx)(Y,{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,Z.jsx)(Y,{to:`/tasks/${e.id}/commits`,active:t===`commits`,replace:a,children:`Commits`}),(0,Z.jsx)(Y,{to:`/tasks/${e.id}/files`,active:t===`files`,replace:a,children:`Files`}),r.map(t=>(0,Z.jsx)(Y,{to:Qt(e.id,t),active:n!==null&&Xt(t,n),replace:a,children:(0,Z.jsx)($t,{tab:t})},`${t.kind}-${t.number}`)),i.length>0?(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(V,{"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,Z.jsx)(H,{align:`end`,children:i.map(t=>(0,Z.jsx)(R,{asChild:!0,children:(0,Z.jsx)(W,{to:Qt(e.id,t),replace:a,children:(0,Z.jsx)($t,{tab:t})})},`${t.kind}-${t.number}`))})]}):null]})}function ln({run:e,tab:t=`session`,onMarkedUnread:n}){let r=l(e),a=J(e),[o,s]=(0,X.useState)(!1),[c,u]=(0,X.useState)(!1),d=un(e,n),f=te(),p=re(),m=At(e,{queuePosition:e.status===`queued`?He(f.data??[]).get(e.id):void 0}),h=Qe(),g=Ze(),_=h!==null&&!g?h:null,v=_!==null,{referenceProjectId:y,repoBase:b,requests:x}=Nt(e),ee=(0,X.useMemo)(()=>pe(e,b),[e,b]),S=typeof t==`object`?t:null,{inline:C,overflow:w}=Zt(ee,S),T=p.data?.capabilities?.preview===!0,E=e.worktreePath&&T?(0,Z.jsx)(tn,{servers:e.previewServers??[]}):null,D=(0,Z.jsx)(mn,{run:e,actions:d,onOpenChooser:()=>u(!0),onToggleNotes:()=>s(e=>!e)}),O=an(e,a);return(0,Z.jsx)(Oe,{projectId:y,repoBase:b,requests:x,children:(0,Z.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`,v?`pt-0`:`pt-[18px]`,t===`session`&&`sticky [inset-block-start:0]`),children:[(0,Z.jsx)(on,{run:e}),(0,Z.jsx)(Ot,{run:e}),(0,Z.jsxs)(`div`,{className:`w-full`,children:[(0,Z.jsx)(rn,{run:e}),_?(0,Z.jsxs)(at,{slot:_,children:[(0,Z.jsx)(pn,{run:e,status:(0,Z.jsx)(lt,{"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:m.label})}),(0,Z.jsx)(rn,{run:e,compact:!0}),D]}):(0,Z.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,Z.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,Z.jsx)(fn,{run:e}),(0,Z.jsx)(lt,{dot:r.tone,shape:r.shape,pulse:r.pulse,className:`max-md:hidden`,children:jt(m)}),(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[g?O:null,E,(0,Z.jsx)(Ut,{run:e}),D]})]}),(0,Z.jsx)(sn,{shown:_!==null,run:e,previewToggle:E}),(0,Z.jsx)(cn,{run:e,tab:t,activeItem:S,inlineItemTabs:C,overflowItemTabs:w,phoneBar:v,isDesktop:g}),o?(0,Z.jsx)(_n,{runId:e.id,onClose:()=>s(!1)}):null,c?(0,Z.jsx)(Lt,{run:e,canResume:J(e).terminal,onResume:()=>d.terminal.mutate(),onClose:()=>u(!1)}):null]}),(0,Z.jsx)(gn,{run:e,actions:d})]})})}function un(e,t){let n=p(),r=ze(),[i,a]=(0,X.useState)(null),o=()=>n.invalidateQueries({queryKey:g.runs.all}),s=e=>k(e.message,{tone:`danger`}),c=y(),l={isPending:c.isPending,mutate:()=>c.mutate({id:e.id,pinned:!e.pinned})},u=v();return{pin:l,markUnread:{isPending:u.isPending,mutate:()=>{t?.(),u.mutate(e.id,{onError:s})}},delete:b({mutationFn:()=>f(e.id),onSuccess:()=>{o(),r(`/`)},onError:s}),terminal:Pt(e),confirming:i,setConfirming:a}}function dn(e){let t=_(e.id),n=G(e);return{title:n,editor:st(n,e=>t.mutate({title:e},{onError:e=>k(e.message,{tone:`danger`})}))}}function fn({run:e}){let{title:t,editor:n}=dn(e);return n.editing?(0,Z.jsx)(it,{editor:n,className:`flex-1 text-[16px] font-semibold`}):(0,Z.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,Z.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:t}),(0,Z.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,Z.jsx)(nt,{className:`size-3.5`,"aria-hidden":`true`})})]})}function pn({run:e,status:t}){let{title:n,editor:r}=dn(e);return(0,Z.jsxs)(Me,{open:r.editing,onOpenChange:e=>{e?r.begin():r.commit()},children:[(0,Z.jsxs)(`div`,{"data-slot":`mobile-run-title`,className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`h1`,{className:`line-clamp-2 break-words text-[15px] leading-[18px] font-semibold text-foreground`,title:e.task,children:n}),t]}),(0,Z.jsx)(Ae,{asChild:!0,children:(0,Z.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,Z.jsx)(nt,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,Z.jsx)(je,{align:`end`,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),r.cancel()},children:(0,Z.jsx)(it,{editor:r,className:`text-[16px] font-semibold`})})]})}function mn({run:e,actions:t,onToggleNotes:n,onOpenChooser:r}){let i=J(e),a=q(e),o=Ze(),s=St(e.id),[c,l]=(0,X.useState)(!1),u=_(e.id),d=(0,X.useId)();return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{run:e,open:c,onOpenChange:l,onConfirm:()=>{s.mutate(!0),l(!1)}}),(0,Z.jsxs)(U,{children:[(0,Z.jsx)(V,{asChild:!0,children:(0,Z.jsx)(I,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,Z.jsx)(xe,{"aria-hidden":`true`})})}),(0,Z.jsxs)(H,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,Z.jsx)(L,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),!o&&i.archive&&!e.archiveBlocker?(0,Z.jsx)(R,{disabled:s.isPending,onSelect:()=>e.archived?s.mutate(!1):l(!0),children:Ct(e)}):null,(0,Z.jsxs)(R,{onSelect:n,children:[(0,Z.jsx)(Ge,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,Z.jsx)(Lt,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),a?(0,Z.jsxs)(R,{onSelect:()=>void Q(a,`Command copied to clipboard.`),children:[(0,Z.jsx)(M,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.markUnread?(0,Z.jsxs)(R,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,Z.jsx)(bt,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,Z.jsxs)(B,{"data-slot":`pin-run`,className:`min-h-11`,checked:!!e.pinned,disabled:t.pin.isPending,onCheckedChange:()=>t.pin.mutate(),children:[e.pinned?(0,Z.jsx)(xt,{"aria-hidden":`true`}):(0,Z.jsx)(ye,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,(0,Z.jsx)(z,{}),(0,Z.jsx)(L,{className:`text-xs text-muted-foreground`,children:`AFTER DONE`}),(0,Z.jsx)(B,{"data-slot":`archive-when-done`,className:`min-h-11`,checked:e.archiveWhenDone===!0,disabled:u.isPending,onCheckedChange:e=>u.mutate({archiveWhenDone:e},{onError:e=>k(e.message,{tone:`danger`})}),children:`Archive when Done`}),(0,Z.jsx)(B,{"data-slot":`auto-merge-pr`,className:`min-h-11`,checked:e.autoMergePr===!0,disabled:u.isPending,"aria-describedby":d,onCheckedChange:e=>u.mutate({autoMergePr:e},{onError:e=>k(e.message,{tone:`danger`})}),children:`Auto-merge PR`}),(0,Z.jsx)(`p`,{id:d,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,Z.jsx)(hn,{run:e,patch:u}),i.deleteRun?(0,Z.jsx)(z,{}):null,i.deleteRun?(0,Z.jsxs)(R,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,Z.jsx)(ge,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})]})}function hn({run:e,patch:t}){let n=(0,X.useId)(),r=(0,X.useId)(),i=(0,X.useId)(),a=e=>k(e.message,{tone:`danger`});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(z,{}),(0,Z.jsx)(L,{className:`text-xs text-muted-foreground`,children:`TASK ACCESS`}),(0,Z.jsx)(B,{"data-slot":`allow-workers`,className:`min-h-11`,checked:h(e),disabled:t.isPending,"aria-describedby":`${n} ${i}`,onCheckedChange:e=>t.mutate({allowWorkers:e},{onError:a}),children:`Allow Squawk workers`}),(0,Z.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,Z.jsx)(B,{"data-slot":`allow-messaging`,className:`min-h-11`,checked:m(e),disabled:t.isPending,"aria-describedby":`${r} ${i}`,onCheckedChange:e=>t.mutate({allowMessaging:e},{onError:a}),children:`Allow task messaging`}),(0,Z.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,Z.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,Z.jsx)(Je,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,Z.jsxs)(qe,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(rt,{className:`text-danger`,children:`Delete task permanently?`}),(0,Z.jsx)(Xe,{children:(0,Z.jsxs)(Z.Fragment,{children:[`Delete “`,(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,title:G(e),children:G(e)}),`” and its transcript`,e.delegation?.role===`worker`&&!d(e.delegation.workspace)?``:`, worktree and branch`,`. This cannot be undone.`]})})]}),(0,Z.jsxs)(ct,{children:[(0,Z.jsx)(tt,{children:`Cancel`}),(0,Z.jsx)(et,{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=ne(e);return(0,Z.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 rounded-xl border border-border bg-card p-6`,children:[(0,Z.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,Z.jsx)(I,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,Z.jsx)(A,{})})]}),n.isPending?(0,Z.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,Z.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,Z.jsx)(Gt,{runId:e,children:(0,Z.jsx)(_t,{children:n.data})}):(0,Z.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`}),(0,Z.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,Z.jsx)(I,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void Q(n.data??``,`Notes copied`),children:`Copy notes`}),(0,Z.jsx)(I,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{It as a,At as c,zt as i,Gt as n,Pt as o,Rt as r,Nt 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{a as i,d as a,s as o}from"./live-refetch-VoLPvzhe.js";import{Cr as s,Ln as c,Pn as l,di as u}from"./project-scope-context-BdqKyBHa.js";import{Qt as d,Vt as f,vt as p}from"./queries-C7VNk-nW.js";import{t as m}from"./useQuery-BSyhc3l3.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{Wn as w}from"./index-CJFT0IZP.js";var T=e(t(),1),E=n();function D(e,t){return i(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>o(t).length;function k(e,t,n){let r=s(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:o=!1,accountDisabled:s=!1,onPick:c}){let l=a().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(a=>{let{providerConnected:l,providerReason:f}=k(i,a.runner.id,a.accountStatus),p=e.filter(e=>e.runner.id===a.runner.id).length>1,m=a.runner.id===t&&a.account===n(a.runner.id);return(0,E.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":m,"data-value":a.runner.id,"data-account":a.account??``,title:f??a.desc,disabled:o||u||!l||p&&s,onClick:()=>c(a.runner.id,a.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:[a.label,d?(0,E.jsx)(`span`,{"data-slot":a.missing?`agents-account-missing`:`agents-account-dir`,"data-runner":a.runner.id,className:`ml-2 font-sans text-[11px] text-soft-foreground`,children:a.desc}):null]},`${a.runner.id}:${a.account??``}`)})})}async function j(e,t){return c(await l.api.v1.providers[`sign-in`].start.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/sign-in/start`)}async function M(e){return c(await l.api.v1.providers[`sign-in`][`:id`].$get({param:{id:e}}),`/providers/sign-in/:id`)}async function N(e,t){return c(await l.api.v1.providers[`sign-in`][`:id`].redirect.$post({param:{id:e},json:{redirectUrl:t}}),`/providers/sign-in/:id/redirect`)}async function P(e){return c(await l.api.v1.providers[`sign-in`][`:id`].$delete({param:{id:e}}),`/providers/sign-in/:id`)}function F(e,t){let n=u(),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(``),l=(0,T.useRef)(null),p=(0,T.useRef)(!0),h=(0,T.useRef)(0),g=()=>{h.current++,v.current=!1;let e=l.current;l.current=null,e?.state===`waiting`&&P(e.id).catch(()=>{}),o(null),c(``),i(!1)};(0,T.useEffect)(()=>(p.current=!0,()=>{p.current=!1,h.current++;let e=l.current;e?.state===`waiting`&&P(e.id).catch(()=>{})}),[]);let _=d({mutationFn:n=>j(e,t).then(e=>({result:e,generation:n})),retry:!1,onSuccess:({result:e,generation:t})=>{if(!p.current||!v.current||t!==h.current){P(e.id).catch(()=>{});return}l.current=e,o(e)}}),v=(0,T.useRef)(r);v.current=r;let y=m({queryKey:[`browser-sign-in`,a?.id],queryFn:()=>M(a.id),enabled:r&&a?.state===`waiting`,retry:!1,refetchInterval:e=>e.state.error||e.state.data?.state&&e.state.data.state!==`waiting`?!1:1e3,gcTime:0}),b=y.data??a,x=d({mutationFn:()=>N(a.id,s),retry:!1,onSuccess:()=>{c(``),y.refetch()}});return(0,T.useEffect)(()=>{b?.state===`connected`&&(l.current=b,o(b),Promise.all([n.invalidateQueries({queryKey:f.agentProfiles}),n.invalidateQueries({queryKey:f.providerStatus}),n.invalidateQueries({queryKey:f.models(e)})]))},[b,n,e]),{open:r,result:b,redirect:s,setRedirect:c,start:_,replay:x,status:y,error:_.error??x.error??y.error,close:g,connect:()=>{i(!0),v.current=!0,_.reset(),x.reset(),_.mutate(++h.current)}}}function I(){return`Open the sign-in link in your browser. After Google consent, the page shows a code. Copy that code, or the full address of that page, and paste it below.`}function L({provider:e,profileId:t,label:n}){let{open:r,result:i,redirect:a,setRedirect:o,start:s,replay:c,status:l,error:u,close:d,connect:f}=F(e,t);return p().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:f,children:`Connect`}),(0,E.jsx)(C,{open:r,onOpenChange:e=>{e||d()},children:(0,E.jsxs)(x,{children:[(0,E.jsxs)(b,{children:[(0,E.jsxs)(S,{children:[`Sign in to `,n]}),(0,E.jsx)(y,{children:`Use a personal Google account. Business and agent-platform sign-in are not supported.`})]}),s.isPending?(0,E.jsx)(`p`,{role:`status`,children:`Preparing sign-in…`}):null,i?.state===`waiting`?(0,E.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,E.jsx)(`a`,{href:i.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-action underline`,children:`Open Google sign-in`}),(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,E.jsx)(I,{})}),(0,E.jsxs)(`label`,{className:`grid gap-2`,children:[`Code or page address`,(0,E.jsx)(w,{type:`text`,autoComplete:`off`,spellCheck:!1,value:a,onChange:e=>o(e.target.value)})]}),(0,E.jsx)(_,{disabled:!a.trim()||c.isPending,onClick:()=>c.mutate(),children:`Complete sign-in`})]}):null,i?.state===`connected`?(0,E.jsx)(`p`,{role:`status`,children:`Connected.`}):null,i?.state===`failed`?(0,E.jsx)(`p`,{role:`alert`,children:i.error}):null,i?.state===`cancelled`?(0,E.jsx)(`p`,{role:`status`,children:`Sign-in cancelled. Close this window and Connect again.`}):null,u?(0,E.jsx)(`p`,{role:`alert`,children:u.message}):null,l.isError&&i?.state===`waiting`?(0,E.jsx)(_,{onClick:()=>void l.refetch(),children:`Retry status`}):null,(0,E.jsx)(v,{children:(0,E.jsx)(_,{variant:`outline`,onClick:d,children:i?.state===`connected`?`Done`:`Cancel`})})]})})]}):null}function R(e){let t=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{En as r,Sn as i,Tn as a,bn as o,xn as s}from"./project-scope-context-BdqKyBHa.js";import{Ft as c,Ot as l,Pt as u,ht as d,jt as f,xt as p}from"./queries-C7VNk-nW.js";import{n as m,p as h,r as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as _}from"./toaster-Bo5vCbz-.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 te,t as ne}from"./collapsible-BEV4FO-1.js";import{r as S}from"./switch-SP8pw5uU.js";import{t as C}from"./badge-DQ3U69Ht.js";import{n as w,s as T,t as E}from"./project-router-Bii3ofOk.js";import"./attention-8bNiiAFt.js";import{Bn as D,Wn as O,dt as re,ft as k,gn as A,pt as j,z as M}from"./index-CJFT0IZP.js";import{t as ie}from"./textarea-vJt9undk.js";import{n as ae,t as oe}from"./saved-draft-BwzBc-_Y.js";import{ArchiveOnMergeField as se}from"./archive-on-merge-field-Bm8miJjt.js";import{a as ce,i as le,n as ue,t as de}from"./projects-section-D2cACaaG.js";import{n as N}from"./settings-field-DP9sYv5a.js";import{t as fe}from"./project-location-CfJLc6aJ.js";var P=e(t(),1),F={"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`}},I=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),L={name:``,description:``,url:``,token:``,tasks:!0,triggers:a,agent:!1};function R(e){return{name:e.name,description:e.description??``,url:e.url,token:``,tasks:e.tasks,triggers:e.triggers??a,agent:e.agent}}var z=e=>r.filter(t=>e.includes(t));function B(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,...I(e.triggers,a)?{}:{triggers:z(e.triggers)},agent:e.agent}}function pe(e){return e.name.trim()!==``||e.description.trim()!==``||e.url.trim()!==``||e.token!==``||e.tasks!==L.tasks||e.agent!==L.agent||!I(e.triggers,L.triggers)}function me(e,t){let n={},r=e.name.trim(),i=e.description.trim(),o=e.url.trim();return r!==t.name&&(n.name=r),i!==(t.description??``)&&(n.description=i),o!==t.url&&(n.url=o),e.token&&(n.token=e.token),e.tasks!==t.tasks&&(n.tasks=e.tasks),I(e.triggers,t.triggers??a)||(n.triggers=z(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 a=(0,P.useId)(),c=(0,P.useId)(),l=(0,P.useId)(),u=(0,P.useId)(),d=(0,P.useId)(),f=(0,P.useId)(),p=(0,P.useId)(),m=(0,P.useId)(),h=(0,P.useId)(),g=(0,P.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:a,className:U,children:`Name`}),(0,V.jsx)(O,{id:a,"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:u,className:U,children:`URL`}),(0,V.jsx)(O,{id:u,"data-slot":`webhook-url`,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,maxLength:i,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:c,className:U,children:`Description`}),(0,V.jsx)(ie,{id:c,"data-slot":`webhook-description`,"aria-describedby":l,rows:2,maxLength:o,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:l,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:d,className:U,children:`Token`}),(0,V.jsx)(O,{id:d,"data-slot":`webhook-token`,type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:s,"aria-describedby":f,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:f,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)(S,{id:p,"aria-describedby":m,"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:p,className:`font-medium`,children:`Task notifications`}),(0,V.jsx)(`span`,{id:m,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:r.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:F[n].label}),(0,V.jsx)(`span`,{className:`text-[11px] text-soft-foreground`,children:F[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)(S,{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.`}),he=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 ge({projectId:e,webhook:t,defaultOpen:n=!1}){let r=u(),i=l(),a=f(),[o,s]=(0,P.useState)(n),[c,d]=ae(R(t),oe),[p,m]=(0,P.useState)(null),h=me(c,t),g=Object.keys(h).length>0;A(g);let y=c.name.trim()!==``&&c.url.trim()!==``,b=r.isPending||i.isPending||a.isPending,S={projectId:e,webhookId:t.id},w=e=>r.mutate({...S,...h},{onSuccess:()=>{d(e=>({...e,token:``})),e?e():_(`${c.name.trim()} saved`)},onError:e=>m(K(e,`Save`))}),T=()=>a.mutate(S,{onSuccess:e=>m(he(e)),onError:e=>m({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)(ne,{open:o,onOpenChange:s,children:[(0,V.jsx)(te,{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)(C,{variant:`secondary`,"data-badge":`tasks`,children:`Task notifications`}):null,t.agent?(0,V.jsx)(C,{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:M(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(),m(null),y&&g&&w()},children:[(0,V.jsx)(W,{draft:c,tokenSet:t.tokenSet,onChange:e=>d(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||!g,children:`Save`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`outline`,"data-action":`webhook-test`,disabled:b||!y,onClick:()=>{m(null),g?w(T):T()},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:()=>r.mutate({...S,token:``},{onSuccess:()=>_(`Webhook token cleared`),onError:e=>m({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:()=>i.mutate(S,{onSuccess:()=>_(`${t.name} removed`),onError:e=>m({tone:`danger`,text:`Not removed: ${e.message}.`})}),children:`Remove`})]}),(0,V.jsx)(q,{feedback:p})]})})]})})}function _e({projectId:e,onCreated:t,onCancel:n}){let r=d(),[i,a]=(0,P.useState)(L),[o,s]=(0,P.useState)(null),c=i.name.trim()!==``&&i.url.trim()!==``;return A(pe(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(),s(null),c&&r.mutate({projectId:e,...B(i)},{onSuccess:({webhook:e})=>{_(`${e.name} created`),t(e)},onError:e=>s(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||!c,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 ve({project:e}){let t=e.webhooks??[],[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(null),o=t.length>=16;return(0,V.jsx)(N,{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)(ge,{projectId:e.id,webhook:t,defaultOpen:t.id===i},t.id)),n?(0,V.jsx)(_e,{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 Z(){let e=T(),t=p(),n=c();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,i=r?.projects.find(t=>t.id===e);return!r||!i?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)(fe,{}),(0,V.jsx)(ye,{project:i}),(0,V.jsx)(N,{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)(de,{project:i,workspaceMax:n.data.resources.maxParallel}):(0,V.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading the workspace limit…`})}),(0,V.jsx)(ve,{project:i},i.id)]}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(be,{project:i,bootProject:r.bootProject})})]})}function ye({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:[ue[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 be({project:e,bootProject:t}){let[n,r]=(0,P.useState)(null),i=ce(),a=h(),o=e.id===t;return(0,V.jsxs)(N,{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)(le,{project:n,onOpenChange:e=>!e&&r(null),onConfirm:()=>{r(null),i.confirm(e,()=>void a(`/p/${encodeURIComponent(t)}`))}})]})}function xe(e){return e===`global`?{Link:m,NavLink:g}:{Link:E,NavLink:w}}function Q({scope:e,title:t,mobileTitle:n,description:r}){let i=D().name,a=e===`global`?`every project`:i??`this project`;return(0,V.jsxs)(`header`,{"data-slot":`settings-main-header`,className:`settings-route-header flex shrink-0 flex-col md:px-9 px-4 pt-7 pb-5`,children:[(0,V.jsxs)(`h1`,{className:`font-semibold tracking-tight leading-[1.2] text-foreground`,children:[(0,V.jsx)(`span`,{className:`md:hidden`,children:n}),(0,V.jsxs)(`span`,{className:`max-md:hidden`,children:[t,` `,(0,V.jsxs)(`span`,{className:`font-normal text-soft-foreground`,children:[`· `,a]})]})]}),(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}),r?(0,V.jsx)(`p`,{className:`mt-1 max-md:hidden text-[13px] text-muted-foreground`,children:r}):null,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}=xe(e),r=j(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:k(e,t.id),"data-section":t.id,children:t.title},t.id))]})]},`${e}-${t}`)}function Se({section:e,scope:t}){let n=e.component;return(0,V.jsxs)(`div`,{"data-route":t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,className:`settings-route flex min-h-full w-full flex-col`,children:[(0,V.jsx)(Q,{scope:t,title:e.title,description:e.description,mobileTitle:t===`global`?`Global settings`:`Project settings`}),(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 Ce(){return(0,V.jsxs)(`div`,{"data-route":`settings`,className:`settings-route flex min-h-full w-full flex-col`,children:[(0,V.jsx)(Q,{scope:`project`,title:`General`,mobileTitle:`Project settings`}),(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)(Z,{}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(se,{})}),(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:j(`project`).map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(E,{to:k(`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)(m,{to:re,"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})]})]})]})}export{Ce as SettingsIndexRoute,Se 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{gap:0;padding:0}.settings-route-header{gap:0}.settings-route-body{gap:24px;width:100%;max-width:56rem;padding-block:8px 28px;padding-inline:36px}.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{gap:24px;padding-block:28px 32px;padding-inline:16px}.settings-route-header{padding:0}.settings-route-header h1{letter-spacing:-.01em;line-height:1.2}.settings-route-header>p{display:none}.settings-route-body{gap:20px;max-width:none;padding:0}.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}.settings-route[data-route=settings] .settings-route-header>p,.settings-route[data-route=settings-global] .settings-route-header>p{display:block}.settings-route[data-route=settings] .settings-route-header h1,.settings-route[data-route=settings-global] .settings-route-header h1{font-weight:600}.settings-route[data-route=settings-global] [data-slot=settings-index] a>span:nth-child(2)>span:first-child{font-weight:400}.settings-route[data-route=settings-global] [data-slot=settings-index] a>span:nth-child(2)>span+span{margin-block-start:8px}.settings-route[data-route=settings-global] [data-slot=settings-index]+p{display:none}@media (width<=767px){.settings-route{gap:16px}.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%}@media (width<=767px){.settings-route-header{padding:0}}.settings-route-header h1{letter-spacing:-.01em;font-size:26px;font-weight:600;line-height:1.2}.settings-route-header>p{margin-block-start:4px;font-size:13px}@media (width>=768px){.settings-route-header{padding-block:28px 20px;padding-inline:36px}.settings-route-header h1{font-size:28px}}.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{d as i,u as a}from"./live-refetch-VoLPvzhe.js";import{S as o,di as s}from"./project-scope-context-BdqKyBHa.js";import{Bt as c,Wt as l,_ as u}from"./queries-C7VNk-nW.js";import{g as d}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as f}from"./toaster-Bo5vCbz-.js";import{O as p,T as m,X as h,Y as g,ct as _,l as v,ot as y,u as b}from"./design-icons-CzEoMH9c.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./project-router-Bii3ofOk.js";import{f as C,l as w}from"./skills-pM_PouEs.js";import{En as T,V as E,Wn as D,bn as O}from"./index-CJFT0IZP.js";var k=e(t(),1),A=n(),j=e=>e.split(`@`)[0]||e,M={project:0,user:1,plugin:2,system:3,other:4},N={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function P(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:j(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:N[t],kind:t}}function F(e){let t=new Map;for(let n of e){let e=P(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>M[e.kind]-M[t.kind]||e.label.localeCompare(t.label))}function I(e){let t=e.plugin?`${j(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var L={project:m,user:_,plugin:p,system:p,other:p};function R({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,k.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,A.jsx)(`div`,{"data-slot":`skills-list`,className:`overflow-hidden rounded-xl border border-border bg-card`,children:e.map(e=>{let o=n||!a.has(e.key);return(0,A.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,A.jsx)(z,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,A.jsx)(B,{skill:e,open:e.id===t,runner:r,account:i},C(e))):null]},e.key)})})}function z({group:e,open:t,onToggle:n}){let i=L[e.kind];return(0,A.jsx)(`h2`,{className:`m-0`,children:(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:n,className:`flex min-h-10 w-full items-center gap-2 bg-muted/45 px-3.5 text-left text-xs font-semibold text-muted-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:text-foreground`,children:[(0,A.jsx)(b,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,A.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,A.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function B({skill:e,open:t,runner:n,account:r}){let i=T({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,A.jsxs)(`details`,{"data-slot":`skill-row`,"data-skill":e.id,"data-skill-path":e.path,name:`skill-details`,open:t||void 0,className:`group/skill border-t border-border/60 open:bg-sidebar-row-selected`,children:[(0,A.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-3 py-2 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover [&::-webkit-details-marker]:hidden`,children:[(0,A.jsxs)(`span`,{className:`grid min-w-0 flex-1 grid-cols-1 items-center gap-x-4 gap-y-0.5 sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)]`,children:[(0,A.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:I(e)}),e.description?(0,A.jsx)(`span`,{className:`min-w-0 line-clamp-2 text-[13px] leading-snug text-muted-foreground [overflow-wrap:anywhere] group-open/skill:hidden`,title:e.description,children:e.description}):null]}),(0,A.jsx)(v,{"data-slot":`skill-row-cue`,"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/skill:rotate-180 motion-reduce:transition-none`})]}),(0,A.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,A.jsx)(E,{skill:e,heading:null,actions:(0,A.jsx)(x,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,A.jsx)(S,{to:i,children:`Start task`})})})})]})}function V(){let e=u(),[t,n]=(0,k.useState)(null),[i,o]=(0,k.useState)(null),[s,c]=(0,k.useState)(``),[f]=d(),p=t??e.data?.defaultRunner,{runner:m}=a(p??`claude`),_=i?.runner===m?i.id:null,v=e=>o(e===null?null:{runner:m,id:e}),y=l(p,_),b=K(m,y.account),S=y.data??[];return(0,A.jsxs)(`div`,{"data-route":`skills`,className:`grid min-h-full w-full grid-cols-1 content-start gap-5 px-4 pt-7 pb-9 md:px-9 max-md:[padding-block-end:5rem]`,children:[(0,A.jsx)(`header`,{className:`flex flex-wrap items-start justify-between gap-4`,children:(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h1`,{className:`text-[26px] font-semibold tracking-tight leading-[1.2] text-foreground md:text-[28px]`,children:`Skills`}),(0,A.jsx)(`p`,{className:`mt-1 text-[13px] text-muted-foreground`,children:`The skills each agent loads in this project, as its runner reports them.`})]})}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(U,{runner:m,onChange:e=>{n(e),v(null)}}),(0,A.jsx)(W,{runner:m,account:_,onChange:v}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,"data-slot":`skills-count`,children:y.list?`${S.length} ${S.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null}),(0,A.jsxs)(x,{variant:`outline`,size:`sm`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,A.jsx)(g,{"aria-hidden":`true`,className:r(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})]}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(D,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:s,onChange:e=>c(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-9 text-[13px]`})]}),(0,A.jsx)(G,{query:y}),y.isPending?(0,A.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,A.jsx)(H,{skills:S,search:s,openId:f.get(`skill`),runner:m,account:y.account??null,unchecked:y.unchecked})]})}function H({skills:e,search:t,openId:n,runner:r,account:i,unchecked:a}){if(e.length===0)return a?null:(0,A.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`No skills reported by this runner and account.`});let o=w(e,t);return o.length===0?(0,A.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No skills match “`,t.trim(),`”.`]}):(0,A.jsx)(R,{groups:F(o),openId:n,searching:t.trim()!==``,runner:r,account:i})}function U({runner:e,onChange:t}){let n=i().data;return n?(0,A.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-1 overflow-x-auto rounded-lg border border-border bg-muted/60 p-1`,children:n.runners.map(n=>(0,A.jsx)(`button`,{type:`button`,"aria-pressed":n.id===e,onClick:()=>t(n.id),className:`h-8 shrink-0 rounded-md border border-transparent px-3 text-[13px] font-normal text-muted-foreground transition-colors focus-visible:outline-2 aria-pressed:border-border aria-pressed:bg-card aria-pressed:font-semibold aria-pressed:text-foreground aria-pressed:shadow-xs pointer-hover:text-foreground max-md:h-11`,children:n.displayName},n.id))}):null}function W({runner:e,account:t,onChange:n}){let r=O().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,A.jsxs)(`div`,{className:`relative inline-flex items-center`,children:[(0,A.jsxs)(`select`,{"aria-label":`Account`,value:t??``,onChange:e=>n(e.target.value||null),className:`h-[38px] appearance-none rounded-lg border border-border bg-card pr-8 pl-3 text-[13px] text-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,A.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,A.jsx)(`option`,{value:e.id,children:e.label},e.id))]}),(0,A.jsx)(v,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 size-3.5 text-muted-foreground`})]})}function G({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,A.jsxs)(`div`,{className:`grid gap-1.5 rounded-lg border border-pending/40 bg-pending/10 px-3.5 py-2.5 text-[13px]`,children:[e.unchecked&&!e.isPending?(0,A.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,A.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,A.jsxs)(`span`,{children:[`Skill list unavailable. `,e.list?.reason??e.error?.message,` You can still type a skill id when starting a task.`]})]}):null,t.map((e,t)=>(0,A.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,A.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,A.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function K(e,t){let n=s(),[r,i]=(0,k.useState)(!1),a=c.runnerSkills(e,t);return{running:r,run:async()=>{i(!0);try{n.setQueryData(a,await o(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:a.slice(0,3)})}catch(e){f(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{V as SkillsRoute};
|
|
@@ -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{Bt as i,Ct as a,Ft as o,Nn as s,Nt as c,Qn as l,Rt as u,di as d,ot as f,rt as p}from"./project-scope-context-BdqKyBHa.js";import{Bt as m,C as h,Qt as g,X as _,Y as v,vt as y}from"./queries-C7VNk-nW.js";import{h as b}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as x}from"./toaster-Bo5vCbz-.js";import{C as S,j as C,l as w}from"./design-icons-CzEoMH9c.js";import{t as T}from"./run-header-B-olCSdg.js";import{i as E,n as D,r as O}from"./git-toolbar-Pugtjt-9.js";import{t as k}from"./button-B7MKxYjT.js";import{a as A,i as j,o as M,r as N,s as P,t as F}from"./dialog-B531GGAo.js";import{b as I,f as L}from"./task-groups-BbnYlkYj.js";import{t as R}from"./centered-state-V15AR_qo.js";import{C as z,X as B,cn as V,en as H,w as U}from"./index-CJFT0IZP.js";import{t as W}from"./markdown-BBDDg-4t.js";import{t as G}from"./textarea-vJt9undk.js";import{t as K}from"./diff-BK789dS0.js";var q=e(t(),1),J=`no worktree — this task ran directly in the repo working tree`;function Y(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.run.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${J}`)}function X(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.run.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${J}`)}function Z(e){let t=e=>({id:`create-pr`,label:`Draft PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Draft PR unavailable — ${J}`):e.forge===null?t(`Draft PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?l(e.run)?t(`Draft PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):I(e.run)?t(`Draft PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Draft PR`,enabled:!0}:t(`Draft PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function Q(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:Y(e),n=e.prUrl?[Y(e),X(e)]:[X(e),Z(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?I(e.run)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var $=n();function ee({run:e,open:t,onOpenChange:n}){let r=d(),[i,a]=(0,q.useState)(``),o=L(e),s=(0,q.useRef)(o);s.current=o,(0,q.useEffect)(()=>{t&&a(s.current)},[t]);let c=g({mutationFn:t=>p(e.id,t),onSuccess:t=>{x(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:m.runs.changes(e.id)}),r.invalidateQueries({queryKey:m.runs.all})},onError:e=>x(e.message,{tone:`danger`})}),l=()=>{let e=i.trim();e.length===0||c.isPending||c.mutate(e)};return(0,$.jsx)(F,{open:t,onOpenChange:n,children:(0,$.jsxs)(N,{"data-slot":`commit-dialog`,children:[(0,$.jsxs)(M,{children:[(0,$.jsx)(P,{children:`Commit changes`}),(0,$.jsxs)(j,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,$.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,$.jsx)(G,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{B({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),l())}}),(0,$.jsxs)(A,{children:[(0,$.jsx)(k,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,$.jsx)(k,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||c.isPending,onClick:l,children:c.isPending?`Committing…`:`Commit`})]})]})})}function te(){let{id:e}=b(),t=v(e);return t.isPending?(0,$.jsx)(U,{tab:`changes`}):t.isError?(0,$.jsx)(z,{tab:`changes`,error:t.error}):(0,$.jsx)(ne,{run:t.data})}function ne({run:e}){let t=y(),n=h(),r=_(e.id,I(e)),i=H(),[a,l]=(0,q.useState)(`unified`),[p,v]=(0,q.useState)(!0),[b,S]=(0,q.useState)(!1),[C,w]=(0,q.useState)(null),[E,k]=(0,q.useState)(!1),A=(0,q.useRef)(null),j=d(),M=()=>j.invalidateQueries({queryKey:m.runs.all}),N=e=>x(e.message,{tone:`danger`}),P=g({mutationFn:()=>u(e.id),onSuccess:e=>x(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:N}),F=g({mutationFn:()=>f(e.id),onSuccess:e=>{x(`Draft PR created — ${e.url}`),M()},onError:N}),L=g({mutationFn:()=>o(e.id),onError:e=>{if(e instanceof s&&e.command){navigator.clipboard.writeText(e.command).then(()=>x(`No terminal found — command copied to clipboard.`)).catch(()=>x(`Run manually: ${e.command}`));return}N(e)}}),R=g({mutationFn:t=>c(e.id,t),onError:N}),z=r.isError&&r.error instanceof s&&r.error.status===409,B=Q({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!z,branch:e.branch,changedFiles:r.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:V(e)!==void 0,prUrl:e.pullRequestUrl}),U=e=>{switch(e){case`commit`:k(!0);break;case`push`:P.mutate();break;case`create-pr`:F.mutate();break;case`open-terminal`:L.mutate();break;case`view-pr`:break}},G=r.data?.files??[],K=(0,q.useMemo)(()=>O(G),[G]),J=(0,q.useMemo)(()=>G.some(W),[G]),Y=i?a:`unified`;return(0,$.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,$.jsx)(T,{run:e,tab:`changes`}),(0,$.jsx)(D,{bar:B,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:Y,wrap:p,preview:b,onModeChange:l,onWrapChange:v,onPreviewChange:J?S:void 0,onAction:U}),r.data?.repointedHead?(0,$.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,$.jsx)(`code`,{children:r.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,$.jsx)(`code`,{children:r.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,$.jsx)(re,{changes:r,changesRefused:z,fileCount:G.length,children:(0,$.jsx)(ie,{runId:e.id,files:G,tree:K,selected:C,selectFile:e=>{w(e),A.current?.scrollToPath(e)},diffRef:A,effectiveMode:Y,effectiveWrap:p,preview:b,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:R.mutate})}),(0,$.jsx)(ee,{run:e,open:E,onOpenChange:k})]})}function re({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,$.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,$.jsx)(R,{icon:t?(0,$.jsx)(S,{size:16}):(0,$.jsx)(C,{size:16}),tone:t?`neutral`:`danger`,heading:`h2`,title:t?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):n===0?(0,$.jsx)(R,{icon:(0,$.jsx)(S,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):r}function ie({runId:e,files:t,tree:n,selected:a,selectFile:o,diffRef:s,effectiveMode:c,effectiveWrap:l,preview:u,localHandoff:d,onOpenInApp:f}){let[p,m]=(0,q.useState)(!1);return(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-4 px-4 pb-9 pt-0 [--diff-sticky-top:0px] md:flex-row md:items-start md:gap-5 md:px-9 md:[--diff-sticky-top:1rem]`,children:[(0,$.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain md:p-3.5 lg:w-[288px]`,children:[(0,$.jsxs)(`button`,{type:`button`,"data-slot":`changes-tree-toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),className:`flex min-h-11 w-full items-center justify-between gap-2 px-3.5 py-2 text-left text-xs font-semibold text-foreground md:hidden`,children:[(0,$.jsxs)(`span`,{children:[`Changed files`,` `,(0,$.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,$.jsx)(w,{size:16,"aria-hidden":`true`,className:r(`size-4 shrink-0 text-muted-foreground motion-safe:transition-transform`,p&&`rotate-180`)})]}),(0,$.jsx)(`h2`,{className:`mb-3 hidden border-b border-border pb-3 text-xs font-semibold md:block`,children:`Changed files`}),(0,$.jsx)(`div`,{className:r(p?`border-t border-border px-3.5 py-3 md:border-t-0 md:p-0`:`hidden md:block`),children:(0,$.jsx)(E,{root:n,selected:a,onSelect:e=>{o(e),m(!1)}})})]}),(0,$.jsx)(K,{files:t,viewRef:s,mode:c,wrap:l,preview:u,loadFileText:t=>ae(e,t),imageSrc:t=>i(e,t),onOpenInApp:d?e=>f(e):void 0,totals:!1,className:`min-w-0 flex-1`})]})}async function ae(e,t){try{let n=await a(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{te as TaskChangesRoute};
|
|
@@ -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{Nn as r,bt as i}from"./project-scope-context-BdqKyBHa.js";import{$t as a,Bt as o,Q as s,Y as c,Z as l}from"./queries-C7VNk-nW.js";import{h as u}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as d,j as f,ot as p}from"./design-icons-CzEoMH9c.js";import{t as m}from"./run-header-B-olCSdg.js";import{n as h}from"./diff-controls-BFqQNxRu.js";import{t as g}from"./project-router-Bii3ofOk.js";import{b as _}from"./task-groups-BbnYlkYj.js";import{t as v}from"./centered-state-V15AR_qo.js";import{C as y,en as b,hn as x,w as S,zt as C}from"./index-CJFT0IZP.js";import{t as w}from"./diff-BK789dS0.js";import{t as T}from"./change-counts-CW7O8g5Y.js";import{r as E,t as D}from"./commit-list-DtEqtn9o.js";var O=e(t(),1),k=n();function A(){let{id:e}=u(),t=c(e);return t.isPending?(0,k.jsx)(S,{tab:`changes`}):t.isError?(0,k.jsx)(y,{tab:`changes`,error:t.error}):(0,k.jsx)(j,{run:t.data})}function j({run:e}){let{sha:t}=u(),n=s(e.id,_(e)),i=n.data?.commits[0]?.sha;return(0,k.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,k.jsx)(m,{run:e,tab:`commits`}),t?(0,k.jsx)(N,{runId:e.id,sha:t}):n.isPending?(0,k.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading commits…`}):n.isError?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),tone:n.error instanceof r&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof r&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,k.jsx)(M,{run:e,commits:n.data.commits,selectedSha:i})]})}function M({run:e,commits:t,selectedSha:n}){let r=l(e.id,n),i=F(e.id,t),a=(0,O.useRef)(null),o=b(),[s,c]=(0,O.useState)(`unified`),[u,d]=(0,O.useState)(!0),m=o?s:`unified`;return(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-5 px-4 py-5 md:px-9 lg:flex-row lg:items-start`,children:[(0,k.jsxs)(`div`,{className:`w-full shrink-0 lg:w-[380px] xl:w-[420px]`,children:[(0,k.jsx)(D,{slot:`task-commits`,selectedSha:n,heading:(0,k.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[t.length,` `,t.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:t.map(t=>({...t,href:`/tasks/${e.id}/commits/${t.sha}`,stat:i.get(t.sha)}))}),n&&r.data&&r.data.files.length>0?(0,k.jsx)(I,{runId:e.id,sha:n,files:r.data.files,onPick:e=>a.current?.scrollToPath(e)}):null]}),n?(0,k.jsx)(`section`,{"data-slot":`task-commit-preview`,"data-sha":n,className:`min-w-0 flex-1 overflow-hidden rounded-xl border border-border bg-card`,children:r.isPending?(0,k.jsx)(`p`,{className:`px-4 py-8 text-center text-xs text-muted-foreground`,children:`Loading commit diff…`}):r.isError?(0,k.jsx)(v,{icon:(0,k.jsx)(p,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load commit diff`,subtitle:r.error.message}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2 border-b border-border px-4 py-3`,children:[(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`h3`,{className:`break-words text-sm leading-snug font-semibold text-foreground`,children:r.data.subject}),(0,k.jsxs)(`p`,{className:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{children:r.data.author}),(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(`span`,{title:r.data.when,children:C(r.data.when)}),(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(`span`,{className:`font-mono select-all`,title:r.data.sha??n,children:(r.data.sha??n).slice(0,8)}),r.data.stat?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(x,{stat:r.data.stat})]}):null]})]}),(0,k.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:(0,k.jsx)(h,{mode:s,wrap:u,onModeChange:c,onWrapChange:d})})]}),!r.data.files||r.data.files.length===0?(0,k.jsx)(v,{icon:(0,k.jsx)(f,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,k.jsx)(`div`,{className:`p-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem]`,children:(0,k.jsx)(w,{viewRef:a,files:r.data.files,mode:m,wrap:u,totals:!1,className:`min-w-0`})})]})}):null]})}function N({runId:e,sha:t}){return(0,k.jsx)(E,{commit:l(e,t),sha:t,backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,diffClassName:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`})}var P=12;function F(e,t){let n=t.length<=P,r=a({queries:t.map(t=>({queryKey:o.runs.commit(e,t.sha),queryFn:({signal:n})=>i(e,t.sha,{signal:n}),enabled:n,retry:!1}))}),s=new Map;return r.forEach((e,n)=>{let r=t[n]?.sha;r&&e.data?.stat&&s.set(r,e.data.stat)}),s}function I({runId:e,sha:t,files:n,onPick:r}){return(0,k.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-4 rounded-xl border border-border bg-card p-4`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,k.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[n.length,` `,n.length===1?`file`:`files`,` in`,` `,(0,k.jsx)(`span`,{className:`font-mono text-[13px] font-medium`,title:t,children:t.slice(0,8)})]}),(0,k.jsx)(g,{to:`/tasks/${e}/changes`,className:`text-xs text-muted-foreground hover:text-foreground`,children:`All task changes ›`})]}),(0,k.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-slot":`task-commit-file`,title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,onClick:()=>r(e.path),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 break-all`,children:e.path}),(0,k.jsx)(T,{adds:e.adds,dels:e.dels,className:`font-mono text-xs`})]})},e.path))})]})}export{A as TaskCommitsRoute};
|
|
@@ -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{Nn as i,et as a,ut as o}from"./project-scope-context-BdqKyBHa.js";import{B as s,F as c,N as l,Y as u,et as d}from"./queries-C7VNk-nW.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-B-olCSdg.js";import{a as T,i as E,n as D,o as O,r as k}from"./file-preview-CDWTFZ4P.js";import{t as A}from"./button-B7MKxYjT.js";import{t as j}from"./centered-state-V15AR_qo.js";import{$n as M,C as N,Wn as P,w as F}from"./index-CJFT0IZP.js";import{r as I}from"./markdown-Dv0r75AX.js";var L=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`}]]),R=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`}]]),z=e(t(),1),B=n();function V({runId:e,path:t,artifactId:n,worktreePath:r}){let i=s(e,n?null:t),c=l(e,n),u=n?c:i,d=(0,z.useContext)(I),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=u.data,g=(0,z.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...d,basePath:h.path}:null,[h,d,e]);if(!t&&!n)return(0,B.jsx)(k,{runId:e,path:null,className:`min-w-0 flex-1`});if(u.isPending)return(0,B.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(u.isError)return(0,B.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,B.jsx)(`h2`,{children:`Could not load this file`}),(0,B.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:u.error.message}),(0,B.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});if(!h)return(0,B.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,B.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,B.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,B.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,B.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,B.jsx)(A,{variant:`outline`,onClick:()=>void u.refetch(),children:`Retry`})]});let v=h.artifact;return(0,B.jsx)(I.Provider,{value:g,children:(0,B.jsx)(D,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:m,className:`min-w-0 flex-1`,imageUrl:v?a(e,v.id,`image`):o(e,t),...v?{downloadUrl:a(e,v.id,`download`),snapshot:new Date(v.createdAt).toLocaleString()}:{}},v?.id??h.path)})}var H=new Map;function U(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var W=(0,z.createContext)(null);function G(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,z.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 K=()=>document.querySelector(`[data-slot="main"]`);function q(e,t){let n=(0,z.useRef)(null),r=f(),i=h()===`POP`?r.key:U(r.state),[a]=(0,z.useState)(()=>{let t=i?H.get(i):void 0;return t?.runId===e?t:null}),o=(0,z.useRef)(new Set(a?.folders??[])),s=(0,z.useRef)(new Set),[c,l]=(0,z.useState)(0),u=(0,z.useRef)(a===null),d=(0,z.useCallback)(()=>{u.current&&H.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:K()?.scrollTop??0})},[r.key,e]),p=(0,z.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,z.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=K();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,z.useEffect)(()=>{d();let e=[n.current,K()].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 J({runId:e,selected:t,onSelect:n}){return(0,B.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,B.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,B.jsx)(Y,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function Y({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=d(e,t),o=(0,z.useContext)(W);return(0,z.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,B.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,B.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,B.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,B.jsx)(B.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,B.jsx)(X,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,B.jsx)(Z,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function X({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,z.useContext)(W),[c,l]=(0,z.useState)(()=>s?.isOpen(n)??!1);return(0,B.jsxs)(`li`,{children:[(0,B.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,B.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,B.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,B.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,B.jsx)(Y,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function Z({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=O(t)?R:g;return(0,B.jsx)(`li`,{children:(0,B.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,B.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,B.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:T(n)})]})})}function Q(){let{id:e}=m(),t=u(e),n=G();return t.isPending?(0,B.jsx)(F,{tab:`files`}):t.isError?(0,B.jsx)(N,{tab:`files`,error:t.error}):(0,B.jsx)(C,{runId:t.data.id,children:(0,B.jsx)(ee,{run:t.data},`${t.data.id}:${n}`)})}function $(e,t,n,r){let i=s(e,r||n!==null?null:t),a=l(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function ee({run:e}){let t=d(e.id,``),n=c(e.id),[r,a]=p(),o=r.get(`path`),s=r.get(`artifact`),l=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&s!==null,[u,f]=(0,z.useState)(o??``);(0,z.useEffect)(()=>f(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},h=t.isError&&t.error instanceof i&&t.error.status===409,g=$(e.id,o,s,l),_=q(e.id,!t.isPending&&g);return(0,B.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,B.jsx)(w,{run:e,tab:`files`}),(0,B.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),u.trim()&&m(`path`,u.trim())},children:[(0,B.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,B.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,B.jsx)(P,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:u,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,B.jsx)(A,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!u.trim(),children:`Open file`})]}),(0,B.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,B.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,B.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,B.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,B.jsx)(j,{icon:h?(0,B.jsx)(L,{}):(0,B.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,B.jsx)(W.Provider,{value:_.folders,children:(0,B.jsx)(J,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,B.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,B.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),n.isPending?(0,B.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):n.isError?(0,B.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):n.data.artifacts.length===0?(0,B.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,B.jsx)(`ul`,{children:n.data.artifacts.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===s?`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:()=>m(`artifact`,e.id),children:[(0,B.jsx)(M,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,B.jsx)(x,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,B.jsxs)(A,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2 max-md:h-11 no-hover:h-11`,onClick:()=>void n.refetch(),children:[(0,B.jsx)(y,{"aria-hidden":`true`}),`Refresh published files`]})]})]}),l?(0,B.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,B.jsx)(V,{runId:e.id,path:o,artifactId:s,worktreePath:e.worktreePath}):null]}),(0,B.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.`})]})}export{Q as TaskFilesRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{n as t}from"./utils-DSMR_WLb.js";import{G as n,di as r}from"./project-scope-context-BdqKyBHa.js";import{Bt as i,Qt as a,Y as o,bt as s,o as c,r as l,vt as u,xt as d}from"./queries-C7VNk-nW.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{g as p,p as m}from"./tasks-table-Cx7AM7lZ.js";import{F as h,ot as g,p as _}from"./design-icons-CzEoMH9c.js";import{t as v}from"./run-header-B-olCSdg.js";import{t as y}from"./external-link-BE6y205O.js";import{u as b}from"./reference-chip-rylFalfg.js";import{t as x}from"./button-B7MKxYjT.js";import{t as S}from"./project-router-Bii3ofOk.js";import{t as C}from"./centered-state-V15AR_qo.js";import{C as w,S as T,Xn as E}from"./index-CJFT0IZP.js";import{n as D,o as O,t as k}from"./use-hand-to-agent-state-BckHuhr8.js";var A=e(),j={issue:`Issue`,pr:`Pull request`};function M({kind:e}){let{id:t}=f(),n=o(t);return n.isPending?(0,A.jsx)(T,{kind:e}):n.isError?(0,A.jsx)(w,{tab:`github-item`,error:n.error}):(0,A.jsx)(N,{run:n.data,kind:e})}function N({run:e,kind:t}){let{n}=f(),r=Number(n),i=s(),a=d(),o=u(),l=a.isPending||o.isPending,p=m(e,i).some(e=>e.kind===t&&e.number===r),h=c(t,r,p);return(0,A.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,A.jsx)(v,{run:e,tab:{kind:t,number:r}}),p?(0,A.jsx)(V,{run:e,kind:t,number:r,repoBase:i,item:h}):l?(0,A.jsx)(T,{kind:t,number:r,heading:`h2`}):(0,A.jsx)(C,{icon:(0,A.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`#${n} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function P(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function F(e,t,n,r){return e===`pr`?n?.[t]??r:r}function I({retry:e,kind:t,number:n}){return(0,A.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(i.githubItem(t,n)),children:`Retry`})}function L({kind:e,number:t,error:n,retryButton:r}){return(0,A.jsx)(C,{icon:(0,A.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${j[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function R({run:e,kind:n,number:r,repoBase:i,reason:a,retryError:o,retryButton:s}){let c=n===`pr`?h:_,l=p(e,i).find(e=>e.kind===`PR`==(n===`pr`)&&e.number===r)?.url;return(0,A.jsx)(C,{icon:(0,A.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:o?.message??a,actions:(0,A.jsxs)(A.Fragment,{children:[s,l&&t(l)?(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,A.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function z({label:e,repoBase:t}){return(0,A.jsx)(C,{icon:(0,A.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${H(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function B({kind:e,item:t,labelColors:n,checks:r}){return(0,A.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,A.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,A.jsx)(U,{item:t},t.url):null})})}function V({run:e,kind:t,number:i,repoBase:o,item:s}){let c=r(),u=a({mutationFn:e=>n(t,i,{refresh:!0}),onSuccess:(e,t)=>c.setQueryData(t,e)}),d=P(t,s),f=l(d?[i]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${j[t]} #${i}`,h=(0,A.jsx)(I,{retry:u,kind:t,number:i});if(s.isPending)return(0,A.jsx)(T,{kind:t,number:i,heading:`h2`});if(s.isError)return(0,A.jsx)(L,{kind:t,number:i,error:u.error??s.error,retryButton:h});let g=s.data;return g.available?g.item?(0,A.jsx)(B,{kind:t,item:g.item,labelColors:g.labelColors,checks:F(t,i,p,g.item.checks)}):(0,A.jsx)(z,{label:m,repoBase:o}):(0,A.jsx)(R,{run:e,kind:t,number:i,repoBase:o,reason:g.reason,retryError:u.error,retryButton:h})}function H(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}function U({item:e}){let t=k();return(0,A.jsx)(D,{item:e,workflows:t.workflows.data?.workflows??[],skills:t.skillList,workflow:t.workflow,onWorkflowChange:t.setWorkflow,selectedSkills:t.selectedSkills,onSkillsChange:t.setSelectedSkills,engine:t.engine,onEngineChange:t.setEngine,queuedRunId:t.queued.get(e.url)??null,onQueued:t.onQueued},e.url)}export{M as TaskGithubItemRoute};
|