@hearsay-tools/squawk 0.19.0-dev.8965 → 0.19.0-dev.8974

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/ci-wait/controller.d.ts +7 -7
  2. package/dist/delegation/transport.d.ts +65 -65
  3. package/dist/server/activity-routes.d.ts +23 -23
  4. package/package.json +4 -4
  5. package/web/dist/assets/{accounts-section-Db5lzinF.js → accounts-section-CwPAaLRX.js} +1 -1
  6. package/web/dist/assets/{activity-motion-DP9A-iJP.js → activity-motion-CAoXpVXT.js} +1 -1
  7. package/web/dist/assets/{activity-route-CSVZG1Yk.js → activity-route-BpOdhGDr.js} +1 -1
  8. package/web/dist/assets/{agent-config-section-BWpBfi7r.js → agent-config-section-ByS0qQmf.js} +1 -1
  9. package/web/dist/assets/{agent-defaults-section-B7oMQzUO.js → agent-defaults-section-DmeS7JAr.js} +1 -1
  10. package/web/dist/assets/{appearance-DYSwuTmE.js → appearance-CVJfUYxX.js} +1 -1
  11. package/web/dist/assets/{archive-on-merge-field-Cuw5IABu.js → archive-on-merge-field-Ba4YFn-_.js} +1 -1
  12. package/web/dist/assets/{automations-route-BgdxYmqh.js → automations-route-CiXw_h6J.js} +1 -1
  13. package/web/dist/assets/{middle-truncated-name-TQxp8NxE.js → code-workbench-CUkiQ1pF.js} +1 -1
  14. package/web/dist/assets/commit-list-dNvEgOHg.js +1 -0
  15. package/web/dist/assets/{diff-BFrqQZmo.js → diff-DNdhxMzq.js} +2 -2
  16. package/web/dist/assets/{diff-controls-x4n0YQLg.js → diff-controls-CP2nphAy.js} +1 -1
  17. package/web/dist/assets/{diff-view-BUofv-IL.js → diff-view-CmpfM3xF.js} +1 -1
  18. package/web/dist/assets/{discard-changes-dialog-CO98KAfo.js → discard-changes-dialog-BvBZrkEB.js} +1 -1
  19. package/web/dist/assets/{file-preview-lIaIJUZK.js → file-preview-Btoe2k0y.js} +1 -1
  20. package/web/dist/assets/{git-toolbar-BlwZtWla.js → git-toolbar-BUGct09v.js} +1 -1
  21. package/web/dist/assets/{github-Dc3nfijN.js → github-sNMaEXUl.js} +1 -1
  22. package/web/dist/assets/{global-activity-route-9kNmmkcm.js → global-activity-route-CO5gHnfm.js} +2 -2
  23. package/web/dist/assets/index-BXyNYltk.css +1 -0
  24. package/web/dist/assets/{index-CwaCfhQn.js → index-TFU1q5Sa.js} +7 -7
  25. package/web/dist/assets/{markdown-CdlTRkrR.js → markdown-BOOMYZ7a.js} +1 -1
  26. package/web/dist/assets/middle-truncated-name-D41ibfXD.js +1 -0
  27. package/web/dist/assets/{option-select-CpZhQQ4x.js → option-select-3qhDlvG6.js} +1 -1
  28. package/web/dist/assets/{preferences-section-BNZaZoHj.js → preferences-section-D3h6N_fh.js} +1 -1
  29. package/web/dist/assets/{preview-pane-connected-DtjCqQCW.js → preview-pane-connected-ClZ67Ztq.js} +1 -1
  30. package/web/dist/assets/{project-location-BkThFjg5.js → project-location-xnTFoKUD.js} +1 -1
  31. package/web/dist/assets/{projects-section-BdK2iGn2.js → projects-section-BmyA80eB.js} +1 -1
  32. package/web/dist/assets/{prompt-templates-section-K8tGcjHO.js → prompt-templates-section-Dt2aX-LZ.js} +1 -1
  33. package/web/dist/assets/{remote-settings-notice-BjVD9Tpd.js → remote-settings-notice-CJORtXkl.js} +1 -1
  34. package/web/dist/assets/repo-git-BVxsEJ1H.js +1 -0
  35. package/web/dist/assets/{report-reader-C9faqNxp.js → report-reader-BCPKro-Z.js} +1 -1
  36. package/web/dist/assets/{reports-_MEq44e-.js → reports-Djl8nY0A.js} +1 -1
  37. package/web/dist/assets/{resources-section-B9AnYDT1.js → resources-section-DCETRc-9.js} +1 -1
  38. package/web/dist/assets/{review-panel-QkkXnNl6.js → review-panel-CzhsQN4V.js} +1 -1
  39. package/web/dist/assets/{run-header-C6-a8K7X.js → run-header-BIyS_qou.js} +1 -1
  40. package/web/dist/assets/{select-BG2mryTI.js → select-BoL_3H6E.js} +1 -1
  41. package/web/dist/assets/{session-context-section-DoPTAAaF.js → session-context-section-ChNqEmpe.js} +1 -1
  42. package/web/dist/assets/{settings-agent-picker-PVoldhz2.js → settings-agent-picker-CesXF2fy.js} +1 -1
  43. package/web/dist/assets/{settings-save-bar-DrJyUlGR.js → settings-save-bar-BhGzX1Vj.js} +1 -1
  44. package/web/dist/assets/{settings-shell-C-eZ0DiM.js → settings-shell-D4cNW7VG.js} +1 -1
  45. package/web/dist/assets/{sidebar-section-iVSpyRZ0.js → sidebar-section-DgOjPxdA.js} +1 -1
  46. package/web/dist/assets/{skills-Cvskb0Fk.js → skills-D4-zEnec.js} +1 -1
  47. package/web/dist/assets/task-changes-NKykdnYs.js +1 -0
  48. package/web/dist/assets/task-commits-B-VWmssz.js +1 -0
  49. package/web/dist/assets/{task-file-scope-Z2smLv09.js → task-file-scope-DEybXfMX.js} +1 -1
  50. package/web/dist/assets/task-files-CVGsEv7Y.js +1 -0
  51. package/web/dist/assets/{task-github-item-xrfEri2x.js → task-github-item-BvwsdG3G.js} +1 -1
  52. package/web/dist/assets/{task-thread-Dsm-48-n.js → task-thread-T66nypz9.js} +1 -1
  53. package/web/dist/assets/{thread-state-CrCMnkHo.js → thread-state-BdpOuHqc.js} +1 -1
  54. package/web/dist/assets/{use-hand-to-agent-state-D2mTcKQq.js → use-hand-to-agent-state-BK-LieHJ.js} +1 -1
  55. package/web/dist/assets/use-path-bases-Qp3_G7-A.js +1 -0
  56. package/web/dist/assets/workflows-B2Sw8qQa.css +1 -0
  57. package/web/dist/assets/workflows-DZyeZQyI.js +7 -0
  58. package/web/dist/assets/{workspace-tools-DHMaUd94.js → workspace-tools-CyT1P2Pd.js} +1 -1
  59. package/web/dist/assets/{worktrees-section-VBLWYgdm.js → worktrees-section-DoBhAjkj.js} +1 -1
  60. package/web/dist/index.html +3 -3
  61. package/web/dist/assets/commit-list-D-eUAETe.js +0 -1
  62. package/web/dist/assets/index-j7fiJmmF.css +0 -1
  63. package/web/dist/assets/repo-git-83M_eSW4.js +0 -1
  64. package/web/dist/assets/task-changes-gGRvQ3NB.js +0 -1
  65. package/web/dist/assets/task-commits-DGPH3gFX.js +0 -1
  66. package/web/dist/assets/task-files-905jN7TA.js +0 -1
  67. package/web/dist/assets/use-path-bases-DIMmnJTH.js +0 -1
  68. package/web/dist/assets/workflows-BM4nrPVB.js +0 -7
  69. package/web/dist/assets/workflows-BpuZNAc8.css +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{o as r,p as i,s as a}from"./dist-C_rn70hE.js";import{C as o,E as s,T as c,W as l,Wt as u,dn as d,j as f,n as p,qt as m,rt as h,w as g,xt as _,yt as v}from"./queries-CII6fTHH.js";import{Fn as y,It as b,L as x,R as S,ct as C,f as w,hi as T,l as E,n as D}from"./toaster-Bs1mVYf9.js";import{Z as O}from"./live-protocol-DMhTnCmf.js";import{g as k,h as A}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{i as j}from"./tasks-table-CPAY1N-E.js";import{D as ee,I as M,M as te,N as ne,Q as re,S as ie,X as ae,Z as oe,c as se,ct as ce,d as le,j as ue,l as de,n as fe,st as pe,w as me,y as he}from"./design-icons-QbNMZniQ.js";import{t as ge}from"./createLucideIcon-BHp8sXmF.js";import{n as _e,t as ve}from"./circle-x-7nTlobAF.js";import{_ as ye}from"./nav-row-styles-CgP5uNp4.js";import{i as be,r as xe,t as Se}from"./git-toolbar-BlwZtWla.js";import{t as N}from"./info-DA1x_4bz.js";import{t as Ce}from"./loader-circle-CPBhhDbB.js";import{i as we,n as Te,r as Ee}from"./diff-controls-x4n0YQLg.js";import{c as De,i as Oe,t as ke}from"./reference-chip-Cv3i1kxz.js";import{t as P}from"./button-C8jUIs8Q.js";import{i as F,l as Ae,p as je,r as Me,t as Ne}from"./dropdown-menu-DjtKUK8F.js";import{t as I}from"./project-router-onKnSy5a.js";import{t as Pe}from"./status-dot-BXf-Ubd0.js";import{a as Fe,o as Ie}from"./format-BU7D3IfE.js";import{c as Le,d as Re,f as ze,m as L,n as Be,s as R,t as Ve}from"./page-shell-Dky5crRl.js";import{t as z}from"./centered-state-BgSV4e79.js";import{$t as B,Bt as V,E as H,Ft as He,Gt as Ue,Ht as We,In as Ge,It as Ke,Jt as U,Kt as W,Ln as qe,Lt as Je,Mn as Ye,Mt as Xe,Nt as Ze,Pt as Qe,Qt as G,Rn as $e,Rt as et,T as tt,Ut as nt,Vt as rt,Wt as it,Xt as K,Yt as q,Zt as J,_r as at,gn as ot,qt as Y,rr as st,ur as ct,yr as lt,zt as ut}from"./index-CwaCfhQn.js";import{t as dt}from"./markdown-BBDDg-4t.js";import{t as ft}from"./diff-BFrqQZmo.js";import{t as pt}from"./change-counts-wqSYI3W8.js";import{n as mt}from"./middle-truncated-name-TQxp8NxE.js";import{n as ht,r as gt}from"./commit-list-D-eUAETe.js";var X=e(t(),1);function _t(e,t){let n=T(t),r=n.getQueryCache();return X.useSyncExternalStore(X.useCallback(e=>r.subscribe(O.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}var vt=ge(`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`}]]),yt=ge(`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`}]]),Z=n();function bt(){let e=i(),t=o(),n=T(),a=_t({queryKey:u.repo})>0,s=t.data?.info?t.data:null,c=Xe(e,s,`screen`);return(0,Z.jsx)(Re,{route:`repo-git`,density:s?.info?`full`:`empty`,headerSpacing:`compact`,header:{title:`Git`,secondaryActions:(0,Z.jsx)(Le,{type:`button`,variant:`ghost`,"data-slot":`git-screen-refresh`,"aria-label":`Refresh the repository`,title:`Refresh the repository`,disabled:a,onClick:()=>{n.invalidateQueries({queryKey:u.repo}),n.invalidateQueries({queryKey:u.worktrees})},children:(0,Z.jsx)(oe,{size:17,"aria-hidden":`true`,className:r(`size-[17px]`,a&&`motion-safe:animate-spin`)})})},children:(0,Z.jsxs)(`div`,{"data-slot":`git-screen`,children:[s?.info?(0,Z.jsx)(`div`,{className:`mb-[16px]`,children:(0,Z.jsx)(He,{scope:e,repo:s,info:s.info,variant:`screen`},e)}):t.isPending?(0,Z.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,Z.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,Z.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,Z.jsx)(Ze,{branch:s?.info?.branch??null,counts:c,variant:`screen`})]})})}function xt({entry:e}){return e.keptReason?(0,Z.jsx)(`span`,{"data-slot":`branch-kept-reason`,className:`min-w-0 text-xs text-muted-foreground`,children:e.keptReason}):null}function St(e){if(e===``)return null;if(e===`@`)return`A branch cannot be named “@”.`;if(e.startsWith(`-`))return`A branch name cannot start with “-”.`;if(/\s/.test(e))return`A branch name cannot contain spaces.`;if(/[\u0000-\u001f\u007f]/.test(e))return`A branch name cannot contain control characters.`;let t=/[~^:?*[\\]/.exec(e);if(t)return`A branch name cannot contain “${t[0]}”.`;if(e.includes(`..`))return`A branch name cannot contain “..”.`;if(e.includes(`@{`))return`A branch name cannot contain “@{”.`;if(e.startsWith(`/`)||e.endsWith(`/`))return`A branch name cannot start or end with “/”.`;if(e.includes(`//`))return`A branch name cannot contain “//”.`;if(e.endsWith(`.`))return`A branch name cannot end with “.”.`;for(let t of e.split(`/`)){if(t.startsWith(`.`))return`A part of a branch name cannot start with “.”.`;if(t.endsWith(`.lock`))return`A part of a branch name cannot end with “.lock”.`}return null}function Ct({repo:e,info:t}){let n=i(),a=[n,`repo`],o=[n,`health`],s=v(),c=g(),l=new Map((c.data?.branches??[]).map(e=>[e.name,e])),u=T(),f=d({mutationFn:e=>E({name:e},n),onSuccess:async e=>{D(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([u.invalidateQueries({queryKey:a}),u.invalidateQueries({queryKey:o})]),u.setQueryData(a,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),u.setQueryData(o,t=>Je(t,n,e.branch))},onError:e=>D(e.message,{tone:`danger`})}),[p,m]=(0,X.useState)(``),[h,_]=(0,X.useState)(``),y=h.trim().toLowerCase(),b=kt(e,c.data?.branches),x=y?b.filter(e=>e.toLowerCase().includes(y)):b,S=p.trim(),C=St(S);return(0,Z.jsxs)(`section`,{"data-slot":`repo-branches`,className:`grid min-w-0 grid-cols-1 gap-5 md:grid-cols-[minmax(0,1fr)_290px]`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:[(0,Z.jsx)(`h2`,{className:`sr-only`,children:`Branches`}),(0,Z.jsxs)(`label`,{className:`relative block`,children:[(0,Z.jsx)(re,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3 size-4 text-muted-foreground`}),(0,Z.jsx)(st,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:h,onChange:e=>_(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-10`})]}),(0,Z.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,i=l.get(e);return(0,Z.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,"data-branch-class":i?.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,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-[8px]`,children:[i?.runId?(0,Z.jsx)(I,{to:`/tasks/${i.runId}`,"data-slot":`branch-task-link`,title:i.title?`Open the task ${i.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,Z.jsx)(`span`,{className:r(`min-w-0 truncate font-mono text-[12px]`,n&&`font-medium`),children:e}),i&&!(n&&i.class===`active`)?(0,Z.jsx)(Ot,{entry:i}):null]}),i?(0,Z.jsx)(xt,{entry:i}):null,e.startsWith(`cez/`)&&!n?null:n?(0,Z.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,Z.jsxs)(P,{variant:`outline`,size:`sm`,"data-action":`switch-branch`,className:`h-8 max-md:h-11 no-hover:h-11 md:ml-auto`,disabled:f.isPending,onClick:()=>f.mutate(e),children:[(0,Z.jsx)(ue,{size:16,"aria-hidden":`true`}),`Switch`]})]},e)}),x.length===0?(0,Z.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-muted-foreground`,children:[`No branches match “`,h.trim(),`”.`]}):null]})]}),(0,Z.jsxs)(`div`,{className:`min-w-0 self-start rounded-xl border border-border bg-card p-5`,children:[(0,Z.jsx)(`h2`,{className:`text-base font-semibold`,children:`Create a branch`}),(0,Z.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-5 flex flex-col items-stretch gap-3`,onSubmit:e=>{e.preventDefault();let t=S;!t||C||f.mutate(t,{onSuccess:()=>m(``)})},children:[(0,Z.jsx)(`label`,{htmlFor:`new-branch-name`,className:`text-sm font-medium`,children:`Branch name`}),(0,Z.jsxs)(`p`,{"data-slot":`branch-create-base`,className:`-mt-1 text-xs text-muted-foreground`,children:[`Create from `,(0,Z.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:t.branch}),`.`]}),(0,Z.jsx)(st,{id:`new-branch-name`,"aria-label":`New branch name`,placeholder:`new-branch-name`,className:`h-11 bg-background placeholder:text-soft-foreground`,value:p,"aria-invalid":C?!0:void 0,"aria-describedby":C?`new-branch-name-hint`:void 0,onChange:e=>m(e.target.value)}),C?(0,Z.jsx)(`p`,{id:`new-branch-name-hint`,"data-slot":`branch-name-hint`,role:`alert`,className:`-mt-1 text-xs text-danger`,children:C}):null,(0,Z.jsxs)(P,{type:`submit`,variant:`primary`,size:`sm`,className:`min-h-11 self-start`,"data-action":`create-branch`,disabled:!S||C!==null||f.isPending,children:[(0,Z.jsx)(ae,{size:16,"aria-hidden":`true`}),`Create branch`]})]}),(0,Z.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,Z.jsx)(wt,{}):null]})}function wt(){let e=p({limit:20});return(0,Z.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,Z.jsx)(`h2`,{className:`text-base font-semibold`,children:`Open pull requests`}),e.isPending?(0,Z.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Loading pull requests…`}):e.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,Z.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`No open pull requests.`}):(0,Z.jsx)(`ul`,{className:`mt-3 flex flex-col divide-y divide-border border-t border-border`,children:e.data.prs.map(e=>(0,Z.jsx)(Tt,{pr:e},e.number))}):(0,Z.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 Tt({pr:e}){let t=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(M,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:[`#`,e.number]}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,Z.jsx)(Et,{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,Z.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:a(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:r(n,`hover:bg-muted`),children:t}):(0,Z.jsx)(`span`,{className:n,children:t})})}function Et({checks:e}){let t=e===`passing`?_e:e===`failing`?ve:at;return(0,Z.jsxs)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:r(`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,Z.jsx)(t,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),e]})}var Dt={active:`in use`,"not-landed":`not landed`,orphan:`not landed`,merged:`merged`,empty:`empty`,other:`yours`};function Ot({entry:e}){return(0,Z.jsx)(`span`,{"data-slot":`branch-class`,className:r(`shrink-0 rounded-[4px] border px-1.5 py-px text-xs 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:Dt[e.class]})}function kt(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 At(){let e=c(),t=L(),[n,r]=(0,X.useState)(`unified`),[i,a]=(0,X.useState)(!0),[o,s]=(0,X.useState)(!1),[l,u]=(0,X.useState)(null),d=(0,X.useRef)(null),f=e.isError&&e.error instanceof y&&e.error.status===409,p=e.data?.files??[],m=(0,X.useMemo)(()=>xe(p),[p]),h=(0,X.useMemo)(()=>p.some(dt),[p]),g=t?n:`unified`;return(0,Z.jsx)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:e.isPending?(0,Z.jsx)(`p`,{"data-slot":`changes-loading`,className:`py-6 text-center text-xs text-muted-foreground`,children:`Loading changes…`}):e.isError?(0,Z.jsx)(z,{icon:f?(0,Z.jsx)(me,{size:16}):(0,Z.jsx)(ce,{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,Z.jsx)(z,{icon:(0,Z.jsx)(me,{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,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,className:`flex flex-wrap items-center gap-x-3 gap-y-2 pb-4 [&_button]:min-h-11`,children:[e.data?(0,Z.jsx)(Se,{stat:e.data.stat}):null,(0,Z.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[h&&o?(0,Z.jsx)(Ee,{}):null,h?(0,Z.jsx)(we,{preview:o,onPreviewChange:s}):null,(0,Z.jsx)(`span`,{className:`flex items-center gap-1.5`,children:(0,Z.jsx)(Te,{mode:n,wrap:i,onModeChange:r,onWrapChange:a,disabled:h&&o})})]})]}),(0,Z.jsx)(mt,{className:`gap-5 [--diff-sticky-top:0px] md:gap-0`,treeSlot:`changes-tree-pane`,treeClassName:`overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_2rem)]`,tree:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`h2`,{"data-slot":`changes-tree-heading`,className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,Z.jsx)(be,{root:m,selected:l,onSelect:e=>{u(e),d.current?.scrollToPath(e)}})]}),children:(0,Z.jsx)(ft,{files:p,viewRef:d,mode:g,wrap:i,preview:o,totals:!1,className:`min-w-0 flex-1`})})]})})}function jt({repo:e,info:t}){let{sha:n}=A(),r=e.log,i=(0,X.useMemo)(()=>Ue(r),[r]);if(n)return(0,Z.jsx)(Pt,{sha:n});let a=rt(e,t),o=a&&a.behind>0?(0,Z.jsx)(Nt,{info:t,tracking:a}):null;return r.length===0?(0,Z.jsxs)(Z.Fragment,{children:[o?(0,Z.jsx)(`div`,{children:o}):null,(0,Z.jsx)(z,{icon:(0,Z.jsx)(te,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`})]}):(0,Z.jsxs)(`div`,{"data-slot":`repo-commits`,className:`flex flex-col gap-4`,children:[o,i.map(e=>(0,Z.jsxs)(`section`,{"data-slot":`repo-commit-day`,"aria-label":e.label,className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(`h2`,{className:`text-xs font-medium text-muted-foreground`,children:e.label}),(0,Z.jsx)(`ul`,{className:`flex flex-col divide-y divide-border rounded-xl border border-border bg-card`,children:e.commits.map(e=>(0,Z.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,Z.jsxs)(I,{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,Z.jsx)(`span`,{"data-slot":`commit-row-subject`,className:`truncate text-[13px] font-medium text-foreground`,children:e.subject}),(0,Z.jsxs)(`span`,{"data-slot":`commit-row-meta`,className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(ht,{sha:e.hash}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:`·`}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.author,` · `,(0,Z.jsx)(`span`,{title:it(e.when,e.at),children:nt(e.when,e.at)})]})]})]}),(0,Z.jsx)(Mt,{source:e.source})]},e.hash))})]},e.label))]})}function Mt({source:e}){let t=`hidden max-w-[45%] shrink-0 items-center gap-[5px] pr-4 text-xs text-muted-foreground md:flex`;return e?(0,Z.jsxs)(I,{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:r(t,`rounded-[4px] hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring`),children:[e.prNumber===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ne,{"aria-hidden":`true`,className:`size-[11px] shrink-0 text-merged-text`}),(0,Z.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[`PR #`,e.prNumber]})]}),(0,Z.jsx)(se,{"aria-hidden":`true`,className:`size-[12px] shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]}):(0,Z.jsx)(`span`,{"data-slot":`commit-source`,"data-source":`unknown`,className:t,children:`no task found`})}function Nt({info:e,tracking:t}){let n=et(i(),e),r=(0,X.useRef)(null);return(0,Z.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,Z.jsx)(vt,{"aria-hidden":`true`,className:`size-[14px] shrink-0 text-inbox-count-foreground`}),(0,Z.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,Z.jsxs)(`button`,{ref:r,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,Z.jsx)(Ce,{"aria-hidden":`true`,className:`motion-safe:animate-spin`}):(0,Z.jsx)(fe,{"aria-hidden":`true`}),`Pull`]}),(0,Z.jsx)(Ke,{checkout:n,returnFocus:r})]})}function Pt({sha:e}){return(0,Z.jsx)(gt,{commit:s(e),sha:e,backTo:L()?`/git`:ut,backLabel:`All recent commits`,slot:`repo-commit`,className:`flex min-h-0 flex-1 flex-col`,diffClassName:`px-4 py-4 [--diff-sticky-top:0px] md:px-9`})}var Ft=`Squash-merged branches may show as not landed without GitHub`;function It(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 Lt(e){return e.filter(e=>e.class===`active`&&e.runId!==null&&e.ahead>0&&(e.runStatus===`done`||e.runStatus===`failed`||e.runStatus===`cancelled`)).length}function Rt(){let e=g(),t=h(),n=i(),r=_(),[a,o]=(0,X.useState)(null);if(e.isPending)return(0,Z.jsx)(`p`,{"data-slot":`not-landed-loading`,role:`status`,className:`py-5 text-[13px] text-muted-foreground`,children:`Loading branches…`});if(e.isError)return(0,Z.jsx)(z,{icon:(0,Z.jsx)(ce,{size:16}),tone:`danger`,heading:`h2`,title:`Could not classify the branches`,subtitle:e.error.message});let s=It(e.data.branches),c=s.reduce((e,t)=>e+t.rows.length,0),l=Lt(e.data.branches),u=l>0?(0,Z.jsxs)(`p`,{"data-slot":`not-landed-retained`,className:`flex items-start gap-2 text-xs leading-relaxed text-muted-foreground`,children:[(0,Z.jsx)(N,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Z.jsxs)(`span`,{children:[l,` finished task`,l===1?` still has its`:`s still have their`,` worktree and commits not on the base, so `,l===1?`it is`:`they are`,` not listed here.`,` `,`They show here once the worktree is reclaimed in `,(0,Z.jsx)(I,{to:V.cleanup,className:`underline underline-offset-2 hover:text-foreground`,children:`Cleanup`}),`.`]})]}):null,d=new Map((t.data??[]).map(e=>[e.id,e.finishedAt]));return(0,Z.jsxs)(Oe,{projectId:n,repoBase:r,requests:s.flatMap(e=>e.rows).flatMap(e=>e.pr?[{projectId:n,kind:`PR`,number:e.pr.number}]:[]),children:[(0,Z.jsxs)(`div`,{"data-slot":`repo-not-landed`,className:`flex flex-col gap-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-0`,children:[e.data.prStateKnown?null:(0,Z.jsx)(zt,{}),u,s.length===0?(0,Z.jsx)(Ve,{icon:(0,Z.jsx)(ct,{size:16}),title:l>0?`Nothing else waiting to land`:`Everything landed`,description:l>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.`,actions:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(P,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,Z.jsx)(I,{to:V.cleanup,children:`Check cleanup`})}),(0,Z.jsx)(P,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,Z.jsx)(I,{to:`/`,children:`View tasks`})})]})}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-5`,children:s.map(e=>(0,Z.jsxs)(`section`,{"data-slot":`not-landed-group`,"data-group":e.key,"aria-label":e.title,className:`flex flex-col gap-1.5`,children:[(0,Z.jsxs)(`h2`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`font-semibold text-foreground`,children:e.title}),(0,Z.jsx)(`span`,{className:`tabular-nums`,children:e.rows.length}),e.note?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{}),(0,Z.jsx)(`span`,{children:e.note})]}):null]}),(0,Z.jsx)(`ul`,{className:`flex flex-col divide-y divide-border rounded-xl border border-border bg-card`,children:e.rows.map(e=>(0,Z.jsx)(Bt,{entry:e,finishedAt:e.runId?d.get(e.runId):void 0,onDelete:()=>o(e)},e.name))})]},e.key))}),(0,Z.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,Z.jsx)(N,{"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.`]}),c<=3?(0,Z.jsx)(Be,{summary:`${c} ${c===1?`branch`:`branches`} waiting to land. Open a draft PR or inspect worktrees in Cleanup.`,actions:(0,Z.jsx)(P,{variant:`outline`,size:`sm`,asChild:!0,className:`max-md:min-h-11`,children:(0,Z.jsx)(I,{to:V.cleanup,children:`Open cleanup`})})}):null]})]}),(0,Z.jsx)(Gt,{entry:a,onClose:()=>o(null)})]})}function zt({className:e}){return(0,Z.jsxs)(`p`,{"data-slot":`git-no-forge`,className:r(`flex items-start gap-2 text-xs leading-relaxed text-muted-foreground`,e),children:[(0,Z.jsx)(N,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),Ft,`.`]})}function Bt({entry:e,finishedAt:t,onDelete:n}){return(0,Z.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,Z.jsx)(Ut,{entry:e,finishedAt:t}),(0,Z.jsx)(Vt,{entry:e}),(0,Z.jsx)(Ht,{entry:e,onDelete:n})]})}function Vt({entry:e}){return(0,Z.jsx)(Z.Fragment,{children:e.pr?(0,Z.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,Z.jsx)(ke,{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,Z.jsx)(Wt,{entry:e})]}):null})}function Ht({entry:e,onDelete:t}){let n=T(),i=e.class===`orphan`,a=e.pr&&(e.pr.state===`open`||e.pr.state===`draft`)?e.pr:null,o=!i&&e.runId!==null&&!a,s=d({mutationFn:()=>C(e.runId),onSuccess:e=>{D(`Draft PR created — ${e.url}`),n.invalidateQueries({queryKey:u.repoBranches}),n.invalidateQueries({queryKey:u.runs.all})},onError:e=>D(e instanceof y&&e.manual?`${e.message} — ${e.manual}`:e.message,{tone:`danger`})}),[c,l]=(0,X.useState)(!1),f=(0,X.useRef)(null);(0,X.useEffect)(()=>()=>{f.current!==null&&clearTimeout(f.current)},[]);let p=()=>void navigator.clipboard.writeText(e.name).then(()=>{D(`Copied ${e.name}`),f.current!==null&&clearTimeout(f.current),l(!0),f.current=setTimeout(()=>l(!1),2e3)},()=>D(`Could not copy the branch name`,{tone:`danger`})),m=`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,Z.jsxs)(Z.Fragment,{children:[e.runId?(0,Z.jsx)(I,{to:`/tasks/${e.runId}`,"data-action":`not-landed-open`,className:r(m,`hidden border border-border bg-card hover:bg-muted md:inline-flex`),children:`Open task`}):null,o?(0,Z.jsxs)(`button`,{type:`button`,"data-action":`not-landed-create-pr`,disabled:s.isPending,onClick:()=>s.mutate(),className:r(m,`hidden border border-border bg-card hover:bg-muted md:inline-flex`),children:[(0,Z.jsx)(yt,{"aria-hidden":`true`}),s.isPending?`Creating…`:`Draft PR`]}):null,i?(0,Z.jsxs)(`button`,{type:`button`,"data-action":`not-landed-copy`,"data-copied":c||void 0,"aria-live":`polite`,onClick:p,className:r(m,`hidden border border-border bg-card hover:bg-muted md:inline-flex`),children:[c?(0,Z.jsx)(de,{"aria-hidden":`true`}):(0,Z.jsx)(he,{"aria-hidden":`true`}),c?`Copied`:`Copy branch`]}):null,(0,Z.jsxs)(Ne,{children:[(0,Z.jsx)(je,{"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,Z.jsx)(ie,{"aria-hidden":`true`,className:`size-[14px]`})}),(0,Z.jsxs)(Me,{align:`end`,className:`w-52`,children:[e.runId?(0,Z.jsx)(F,{asChild:!0,className:`md:hidden`,children:(0,Z.jsx)(I,{to:`/tasks/${e.runId}`,children:`Open task`})}):null,o?(0,Z.jsx)(F,{className:`md:hidden`,disabled:s.isPending,onSelect:()=>s.mutate(),children:`Draft PR`}):null,(0,Z.jsx)(F,{className:r(!i&&`md:hidden`),onSelect:p,children:`Copy branch`}),(0,Z.jsx)(Ae,{className:`md:hidden`}),(0,Z.jsx)(F,{"data-action":`not-landed-delete`,variant:`destructive`,onSelect:t,children:`Delete branch…`})]})]})]})}function Ut({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=Fe(i),o=e.runStatus?Ye(e.runStatus):void 0,s=n||!o?a:`${o.label}${a?` ${a}`:``}`,c=Number.isFinite(Date.parse(i))?new Date(i).toLocaleString():void 0;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`flex size-[12px] shrink-0 items-center justify-center`,children:n?(0,Z.jsx)(ye,{"aria-label":`Task deleted`,className:`size-[12px] text-muted-foreground`}):(0,Z.jsx)(Pe,{tone:o?.tone??`neutral`,shape:o?.shape??`filled`,"aria-label":o?.label})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[e.runId?(0,Z.jsx)(I,{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,Z.jsx)(`span`,{"data-slot":`not-landed-title`,className:`min-w-0 truncate text-[13px] font-medium text-foreground`,title:r,children:r}),(0,Z.jsxs)(`span`,{"data-slot":`not-landed-meta`,className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),(0,Z.jsx)(Q,{}),(0,Z.jsxs)(`span`,{className:`shrink-0`,children:[e.ahead,` commit`,e.ahead===1?``:`s`]}),e.diffStat?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{}),(0,Z.jsx)(pt,{adds:e.diffStat.additions,dels:e.diffStat.deletions})]}):null,s?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{}),(0,Z.jsx)(`span`,{className:`truncate`,title:c,children:s})]}):null]}),e.parentRunId?(0,Z.jsx)(I,{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,Z.jsx)(xt,{entry:e})]})]})}function Q(){return(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:`·`})}function Wt({entry:e}){let t=m(De(`PR`,e.pr?.number).status),n=e.pr?.state,r=n===`draft`||n===`closed`?n:t?t.label.toLowerCase():`open`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{}),(0,Z.jsx)(`span`,{"data-slot":`not-landed-pr-state`,children:r})]})}function Gt({entry:e,onClose:t}){let n=T(),[r,i]=(0,X.useState)(``),a=(0,X.useId)(),o=d({mutationFn:e=>w({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:u.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,Z.jsx)(W,{open:e!==null,onOpenChange:e=>!e&&!o.isPending&&s(),children:(0,Z.jsxs)(q,{"data-slot":`delete-branch-dialog`,children:[(0,Z.jsxs)(G,{children:[(0,Z.jsxs)(B,{children:[`Delete `,e?.name,`?`]}),(0,Z.jsx)(K,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(`p`,{children:e?.class===`orphan`?`Its task was deleted, so this branch is the only copy of the work.`:(0,Z.jsxs)(Z.Fragment,{children:[`This drops the work of `,(0,Z.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,Z.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,`”`,e?.lastCommit.sha?(0,Z.jsxs)(Z.Fragment,{children:[` (`,(0,Z.jsx)($e,{sha:e.lastCommit.sha,variant:`inline`}),`)`]}):null,`.`]})]})})]}),(0,Z.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),c&&e&&!o.isPending&&o.mutate(e.name)},className:`flex flex-col gap-[6px]`,children:[(0,Z.jsxs)(`label`,{htmlFor:a,className:`text-[12.5px] text-muted-foreground`,children:[`Type `,(0,Z.jsx)(`span`,{className:`font-mono text-foreground`,children:e?.name}),` to confirm`]}),(0,Z.jsx)(st,{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,Z.jsxs)(J,{children:[(0,Z.jsx)(U,{className:`h-11`,disabled:o.isPending,children:`Keep it`}),(0,Z.jsx)(Y,{"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 Kt({base:e}){let t=g(),n=T(),[r,i]=(0,X.useState)({merged:!1,empty:!1}),[a,o]=(0,X.useState)(!1),s=(t.data?.branches??[]).filter(e=>e.class===`merged`),c=(t.data?.branches??[]).filter(e=>e.class===`empty`),l=[...s,...c],f=d({mutationFn:e=>w({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:u.repo})},onError:e=>{n.invalidateQueries({queryKey:u.repo}),D(e.message,{tone:`danger`})}});if(t.isPending)return(0,Z.jsx)(`p`,{"data-slot":`cleanup-branches-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading branches…`});if(t.isError)return(0,Z.jsxs)(`p`,{"data-slot":`cleanup-branches-error`,className:`text-[13px] text-danger`,children:[`Branches did not load: `,t.error.message]});let p=l.length,m=`branch${p===1?``:`es`}`;return(0,Z.jsxs)(`section`,{"data-slot":`cleanup-branches`,"aria-labelledby":`cleanup-branches-title`,className:`flex flex-col rounded-[8px] border border-border`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] border-b border-border px-[14px] py-[12px] md:flex-row md:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,Z.jsxs)(`h2`,{id:`cleanup-branches-title`,className:`text-[13px] font-semibold text-foreground`,children:[`Branches safe to delete · `,p]}),(0,Z.jsxs)(`p`,{className:`text-xs leading-[17px] text-soft-foreground`,children:[`Their work is already on `,e,`, or they have none. Deleting loses nothing.`]})]}),(0,Z.jsxs)(`button`,{type:`button`,"data-action":`cleanup-branches-delete`,disabled:p===0||f.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,Z.jsx)(pe,{"aria-hidden":`true`,className:`size-[12px]`}),f.isPending?`Deleting…`:`Delete ${p} ${m}`]})]}),(0,Z.jsx)(qt,{kind:`merged`,title:`Merged into ${e}`,hint:t.data.prStateKnown?`including squash-merged PRs, read from the PR state`:Ft.toLowerCase(),rows:s,open:r.merged,onToggle:()=>i(e=>({...e,merged:!e.merged}))}),(0,Z.jsx)(qt,{kind:`empty`,title:`Empty`,hint:`no commits beyond the fork point`,rows:c,open:r.empty,onToggle:()=>i(e=>({...e,empty:!e.empty}))}),(0,Z.jsx)(W,{open:a,onOpenChange:o,children:(0,Z.jsxs)(q,{children:[(0,Z.jsxs)(G,{children:[(0,Z.jsxs)(B,{children:[`Delete `,p,` `,m,`?`]}),(0,Z.jsxs)(K,{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,Z.jsxs)(J,{children:[(0,Z.jsx)(U,{children:`Keep them`}),(0,Z.jsxs)(Y,{"data-action":`cleanup-branches-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{f.mutate(l.map(e=>e.name)),o(!1)},children:[`Delete `,p,` `,m]})]})]})})]})}function qt({kind:e,title:t,hint:n,rows:i,open:a,onToggle:o}){let s=`cleanup-branches-${e}`;return(0,Z.jsxs)(`div`,{"data-slot":`cleanup-branch-group`,"data-group":e,className:`border-b border-border last:border-0`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":s,disabled:i.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,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,Z.jsxs)(`span`,{className:`truncate text-[12.5px] text-foreground`,children:[t,` · `,i.length]}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-soft-foreground`,children:n})]}),i.length>0?(0,Z.jsx)(le,{"aria-hidden":`true`,className:r(`size-[13px] shrink-0 text-soft-foreground transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}):null]}),a?(0,Z.jsx)(`ul`,{id:s,"aria-label":t,className:`flex flex-col pb-[6px]`,children:i.map(e=>(0,Z.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-xs`,children:[(0,Z.jsx)(Ge,{value:e.name,className:`shrink-0 text-muted-foreground`}),e.runId?(0,Z.jsx)(I,{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,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-soft-foreground`,children:e.lastCommit.subject}),e.pr?(0,Z.jsxs)(`span`,{className:`shrink-0 text-soft-foreground`,children:[`PR #`,e.pr.number]}):null,(0,Z.jsx)(qe,{iso:e.lastCommit.at,className:`shrink-0 text-soft-foreground`})]},e.name))}):null]})}function $(e){return e.some(e=>e.sizeBytes===null)?null:e.reduce((e,t)=>e+(t.sizeBytes??0),0)}function Jt(e){return e.kind===`dirty`?`${e.uncommittedFiles} uncommitted`:e.kind===`detached-head`?`detached HEAD`:e.kind===`submodules`?`has submodules`:`broken worktree`}function Yt(e){if(e.kind===`dirty`){let t=`${e.uncommittedFiles} uncommitted file${e.uncommittedFiles===1?``:`s`}`;return e.detachedHead?`${t} and a detached HEAD on no branch`:t}return e.kind===`detached-head`?`a detached HEAD whose commit is on no branch`:e.kind===`submodules`?`initialized submodules that Git will not remove without force`:`an unregistered or broken Git worktree directory`}function Xt(e){let t=e.some(e=>e.reclaimBlocker?.kind===`dirty`),n=e.some(e=>e.reclaimBlocker?.kind===`detached-head`||e.reclaimBlocker?.kind===`dirty`&&e.reclaimBlocker.detachedHead),r=e.some(e=>e.reclaimBlocker?.kind===`submodules`),i=e.some(e=>e.reclaimBlocker?.kind===`invalid`),a=[...t?[`uncommitted work`]:[],...n?[`a detached HEAD`]:[],...r?[`initialized submodules`]:[],...i?[`a broken checkout`]:[]];return a.length<=1?a[0]??`uncommitted work`:`${a.slice(0,-1).join(`, `)} or ${a.at(-1)}`}function Zt(e,t,n){let r=Math.max(0,t-e);return e===0?r===0?`Nothing to reclaim — no finished worktrees exceed the keep limit`:n?`Nothing was reclaimed — the worktrees past the keep limit are in use or could not be removed`:`Nothing was reclaimed — the worktrees past the keep limit have uncommitted work or are in use`:`Reclaimed ${e} worktree${e===1?``:`s`} (branch kept)${r>0?` · ${r} kept: ${n?`in use or could not be removed`:`uncommitted work or in use`}`:``}`}function Qt(e,t){return e===0?`Reclaim now`:t?`Reclaim ${j(t)} now`:`Reclaim ${e} now`}function $t(e,t,n){let r=t?j(t):String(e);return n?`Discard & reclaim all ${r}`:`Discard & reclaim ${r}`}function en(e,t){if(!e)return t>0?`No clean worktrees past the keep limit — use Discard & reclaim for blocked worktrees`:`Nothing past the keep limit to reclaim`}function tn(e){return e===0?{prefix:`Retention is unlimited (`,suffix:`), so nothing is reclaimed on its own.`}:{prefix:`Retention keeps the newest ${e} finished checkout${e===1?``:`s`} (`,suffix:`) and reclaims the rest.`}}function nn({blocked:e,discardLabel:t,disabled:n,onDiscard:r}){let i=$(e),a=e.length===1?``:`s`,o=e.length===1?`it has`:`they have`;return(0,Z.jsxs)(`div`,{"data-slot":`worktrees-blocked-banner`,className:`flex flex-col gap-[10px] border-b border-border bg-muted/40 px-[14px] py-[10px] md:flex-row md:items-center`,children:[(0,Z.jsxs)(`p`,{className:`min-w-0 flex-1 text-[12px] leading-[17px] text-foreground`,children:[e.length,` worktree`,a,` past the keep limit`,i?` (${j(i)})`:``,` `,`cannot be reclaimed automatically because `,o,` `,Xt(e),`.`]}),(0,Z.jsxs)(`button`,{type:`button`,"data-action":`worktrees-discard-reclaim`,disabled:n,onClick:r,className:`inline-flex h-[28px] shrink-0 items-center gap-[5px] self-start rounded-[6px] border border-danger/40 px-[10px] text-[12px] font-medium text-danger hover:bg-danger/10 focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-50 max-md:h-11 md:self-center`,children:[(0,Z.jsx)(lt,{"aria-hidden":`true`,className:`size-[12px]`}),t]})]})}function rn({confirmClean:e,onCloseClean:t,cleanCount:n,cleanBytes:r,reclaimLabel:i,onConfirmClean:a,discardBatch:o,onCloseDiscardBatch:s,onConfirmDiscardBatch:c,discardRow:l,onCloseRow:u,onConfirmRow:d}){let f=o?$(o):null,p=o?o.filter(e=>e.reclaimBlocker!==null).length:0,m=o?o.some(e=>!e.reclaimBlocker):!1,h=o?$t(o.length,f,m):``;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(W,{open:e,onOpenChange:e=>{e||t()},children:(0,Z.jsxs)(q,{children:[(0,Z.jsxs)(G,{children:[(0,Z.jsx)(B,{children:`Reclaim old worktrees?`}),(0,Z.jsxs)(K,{children:[n,` finished worktree`,n===1?``:`s`,` beyond the keep limit`,r?` (${j(r)})`:``,` `,n===1?`is`:`are`,` reclaimed now, directory only. Their branches are kept, so the work stays recoverable.`]})]}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(U,{children:`Keep them`}),(0,Z.jsx)(Y,{"data-action":`worktrees-confirm`,onClick:a,children:i})]})]})}),(0,Z.jsx)(W,{open:o!==null,onOpenChange:e=>{e||s()},children:(0,Z.jsxs)(q,{children:[(0,Z.jsxs)(G,{children:[(0,Z.jsx)(B,{children:`Discard changes and reclaim worktrees?`}),(0,Z.jsx)(K,{children:o?(0,Z.jsxs)(Z.Fragment,{children:[o.length,` finished worktree`,o.length===1?``:`s`,` beyond the keep limit`,f?` (${j(f)})`:``,` will be reclaimed now.`,` `,`Uncommitted files and detached-HEAD commits in `,p,` blocked checkout`,p===1?``:`s`,` will be permanently discarded. Each task’s branch is kept.`]}):null})]}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(U,{children:`Keep them`}),(0,Z.jsx)(Y,{"data-action":`worktrees-discard-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{o&&c(o),s()},children:h})]})]})}),(0,Z.jsx)(W,{open:l!==null,onOpenChange:e=>{e||u()},children:(0,Z.jsxs)(q,{children:[(0,Z.jsxs)(G,{children:[(0,Z.jsx)(B,{children:`Discard changes and reclaim worktree?`}),(0,Z.jsx)(K,{children:l?.reclaimBlocker?(0,Z.jsxs)(Z.Fragment,{children:[l.title,` has `,Yt(l.reclaimBlocker),`. Reclaiming removes the directory and permanently discards uncommitted or unbranched changes in it. The branch (`,l.branch??l.runId.slice(0,8),`) is kept.`]}):null})]}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(U,{children:`Keep it`}),(0,Z.jsx)(Y,{"data-action":`worktree-discard-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{l&&d(l),u()},children:`Discard & reclaim`})]})]})})]})}function an(){let e=f(),t=l().data?.targets.find(e=>e.id===`finder`),n=d({mutationFn:e=>b(e,t.id),onError:e=>D(e.message,{tone:`danger`})}),r=T(),[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(null),[c,p]=(0,X.useState)(null),m=()=>Promise.all([r.invalidateQueries({queryKey:u.worktrees}),r.invalidateQueries({queryKey:u.repoBranches})]),h=d({mutationFn:({runIds:e})=>S(e?{discardWork:!0,runIds:e}:void 0),onSuccess:(e,{expected:t,runIds:n})=>{m(),D(Zt(e.reclaimed.length,t,!!n))},onError:e=>D(e.message,{tone:`danger`})}),g=d({mutationFn:({worktree:e,discardWork:t})=>x(e.runId,t?{discardWork:!0}:void 0),onSuccess:(e,{worktree:t})=>{m(),D(`Reclaimed the worktree of ${t.title} (branch kept)`)},onError:e=>{m(),D(e.message,{tone:`danger`})}});if(e.isPending)return(0,Z.jsx)(`p`,{"data-slot":`worktrees-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading worktrees…`});if(e.isError)return(0,Z.jsxs)(`p`,{"data-slot":`worktrees-error`,className:`text-[13px] text-danger`,children:[`Worktrees did not load: `,e.error.message]});let{worktrees:_,totalBytes:v,keep:y}=e.data,C=h.isPending||g.isPending,w=_.filter(e=>e.pastKeep),E=w.filter(e=>!e.reclaimBlocker),O=w.filter(e=>e.reclaimBlocker!==null),k=E.length>0,A=$(E),ee=$(w),M=Qt(E.length,A),te=$t(w.length,ee,k),ne=v?j(v):null,re=tn(y);return(0,Z.jsxs)(`section`,{"data-slot":`worktrees-panel`,"aria-labelledby":`worktrees-panel-title`,className:`flex flex-col rounded-[8px] border border-border`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] border-b border-border px-[14px] py-[12px] md:flex-row md:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,Z.jsxs)(`h2`,{id:`worktrees-panel-title`,className:`text-[13px] font-semibold text-foreground`,children:[`Worktrees on disk`,ne?` · ${ne}`:``]}),(0,Z.jsxs)(`p`,{"data-slot":`worktrees-retention`,className:`text-xs leading-[17px] text-soft-foreground`,children:[re.prefix,(0,Z.jsx)(I,{to:`/settings/worktrees`,"data-slot":`worktrees-retention-link`,className:`underline-offset-2 hover:text-foreground hover:underline`,children:ot(`worktrees`,` › `)}),re.suffix,` `,`Reclaim removes the directory only; the branch stays, so its work stays recoverable.`]})]}),(0,Z.jsxs)(`button`,{type:`button`,"data-action":`worktrees-reclaim-now`,disabled:C||!k,title:en(k,O.length),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,Z.jsx)(lt,{"aria-hidden":`true`,className:`size-[12px]`}),M]})]}),O.length>0?(0,Z.jsx)(nn,{blocked:O,discardLabel:te,disabled:C,onDiscard:()=>s(w)}):null,_.length===0?(0,Z.jsx)(`p`,{"data-slot":`worktrees-empty`,className:`px-[14px] py-[12px] text-[12.5px] text-soft-foreground`,children:`No task worktrees on disk.`}):(0,Z.jsx)(`ul`,{"aria-label":`Task worktrees on disk`,className:`flex flex-col`,children:_.map(e=>(0,Z.jsx)(cn,{worktree:e,keep:y,disabled:C,onOpen:t?()=>n.mutate(e.runId):void 0,opening:n.isPending,onReclaim:()=>{e.reclaimBlocker?p(e):g.mutate({worktree:e,discardWork:!1})}},e.runId))}),(0,Z.jsx)(rn,{confirmClean:i,onCloseClean:()=>a(!1),cleanCount:E.length,cleanBytes:A,reclaimLabel:M,onConfirmClean:()=>{h.mutate({expected:E.length}),a(!1)},discardBatch:o,onCloseDiscardBatch:()=>s(null),onConfirmDiscardBatch:e=>{h.mutate({expected:e.length,runIds:e.map(e=>e.runId)})},discardRow:c,onCloseRow:()=>p(null),onConfirmRow:e=>g.mutate({worktree:e,discardWork:!0})})]})}var on=new Set([`queued`,`running`,`waiting`,`review`]);function sn(e,t){return on.has(e.status)||!e.reclaimable?{label:`in use`,tone:`in-use`,state:`in-use`}:e.reclaimBlocker?{label:Jt(e.reclaimBlocker),tone:`blocked`,state:`blocked`}:e.pastKeep?{label:`reclaimable`,tone:`plain`,state:`reclaimable`}:{label:t>0?`kept · newest ${t}`:`kept`,tone:`plain`,state:`kept`}}function cn({worktree:e,keep:t,disabled:n,onOpen:i,opening:a,onReclaim:o}){let s=sn(e,t),c=Fe(e.finishedAt??void 0),l=e.status===`review`?`at review`:c?`${e.status} ${Ie(c)}`:e.status,u=s.tone===`in-use`?`text-status-running`:s.tone===`blocked`?`text-danger`:`text-soft-foreground`,d=e.reclaimBlocker?`Cannot auto-reclaim: ${Yt(e.reclaimBlocker)}`:void 0,f=(0,Z.jsx)(`span`,{"data-slot":`worktree-state`,"data-state":s.state,title:d,className:r(`text-xs`,u),children:s.label}),p=`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`,m=e.reclaimBlocker?`Discard changes and reclaim the worktree of ${e.title} (branch kept)`:`Reclaim the worktree of ${e.title} (branch kept)`,h=e.reclaimBlocker?`Discard changes and reclaim the directory (branch kept)`:`Reclaim the directory (branch kept)`;return(0,Z.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,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-[2px]`,children:[(0,Z.jsx)(`span`,{className:`truncate text-[12.5px] text-foreground`,title:e.title,children:e.title}),(0,Z.jsxs)(`span`,{className:`truncate font-mono text-xs text-soft-foreground`,children:[e.branch??e.runId.slice(0,8),` · `,l,(0,Z.jsxs)(`span`,{className:`md:hidden`,children:[` · `,s.label]})]})]}),(0,Z.jsx)(`span`,{"data-slot":`worktree-size`,className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:e.sizeBytes===null?`—`:j(e.sizeBytes)||`0 kB`}),(0,Z.jsx)(`span`,{className:`hidden shrink-0 md:inline`,children:f}),i?(0,Z.jsx)(`button`,{type:`button`,className:p,"aria-label":`Open folder for ${e.title}`,title:`Open folder`,disabled:a,onClick:i,children:(0,Z.jsx)(ee,{"aria-hidden":`true`,className:`size-[13px]`})}):null,s.tone===`in-use`?null:(0,Z.jsx)(`button`,{type:`button`,"data-action":`worktree-reclaim`,"aria-label":m,title:h,disabled:n,onClick:o,className:r(p,e.reclaimBlocker&&`text-danger hover:text-danger`),children:(0,Z.jsx)(lt,{"aria-hidden":`true`,className:`size-[13px]`})})]})}function ln(e){return e===`main`||e===`changes`?`Split`:`Table`}function un({section:e,index:t=!1}){let n=o(),r=L(),[i]=k(),a=ln(e);if(t&&!r&&i.get(`view`)!==`repo`)return(0,Z.jsx)(bt,{});if(n.isPending)return(0,Z.jsx)(tt,{});if(n.isError)return(0,Z.jsx)(R,{template:a,route:`repo-git`,density:`empty`,beforeHeader:(0,Z.jsx)(H,{}),children:(0,Z.jsx)(z,{icon:(0,Z.jsx)(ce,{size:16}),tone:`danger`,title:`Could not load the repository`,subtitle:n.error.message})});let s=n.data.info;return s?(0,Z.jsx)(dn,{repo:n.data,info:s,section:e}):(0,Z.jsx)(R,{template:a,route:`repo-git`,density:`empty`,beforeHeader:(0,Z.jsx)(H,{}),children:(0,Z.jsx)(z,{icon:(0,Z.jsx)(ue,{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 dn({repo:e,info:t,section:n}){let r=ln(n),i=g(),a=n===`main`?e.log.length:n===`changes`?e.status.length:n===`branches`?kt(e,i.data?.branches).length:n===`not-landed`?i.data?.branches.filter(e=>e.class===`not-landed`||e.class===`orphan`).length??0:4;return(0,Z.jsx)(R,{template:r,route:`repo-git`,density:n===`not-landed`&&i.isPending?`full`:ze(a),rootProps:{"data-git-section":n},beforeHeader:(0,Z.jsx)(H,{}),header:{title:Qe(n,t.branch),headerSlot:`repo-header`,subtitle:(0,Z.jsx)(fn,{repo:e,info:t,section:n}),subtitleSlot:`repo-meta`},children:n===`main`?(0,Z.jsx)(jt,{repo:e,info:t}):n===`not-landed`?(0,Z.jsx)(Rt,{}):n===`cleanup`?(0,Z.jsxs)(`div`,{"data-slot":`repo-cleanup`,className:`flex flex-col gap-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:pb-0`,children:[(0,Z.jsx)(an,{}),(0,Z.jsx)(Kt,{base:e.baseBranch??t.branch})]}):n===`branches`?(0,Z.jsx)(Ct,{repo:e,info:t}):(0,Z.jsx)(At,{})})}function fn({repo:e,info:t,section:n}){let r=e.baseBranch??t.branch;switch(n){case`main`:return(0,Z.jsxs)(Z.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?` · ${We(e.tracking)}`:``]});case`not-landed`:return(0,Z.jsxs)(Z.Fragment,{children:[`Finished tasks whose commits are not on `,r]});case`branches`:return(0,Z.jsx)(pn,{repo:e,info:t});case`changes`:return(0,Z.jsxs)(Z.Fragment,{children:[e.status.length,` uncommitted file`,e.status.length===1?``:`s`,` in the main checkout`]});case`cleanup`:return(0,Z.jsxs)(Z.Fragment,{children:[`Nothing here can delete work that is not on `,r]})}}function pn({repo:e,info:t}){let n=kt(e,g().data?.branches).length;return(0,Z.jsxs)(Z.Fragment,{children:[n,` branch`,n===1?``:`es`,` · on `,t.branch]})}export{un 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{o as r}from"./dist-C_rn70hE.js";import{C as i,Wt as a,X as o,Y as s,dn as c,yt as l}from"./queries-CII6fTHH.js";import{Bt as u,Fn as d,Ft as f,Ht as p,Lt as m,Tt as h,at as g,ct as _,hi as v,n as y,tr as b}from"./toaster-Bs1mVYf9.js";import{h as x}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{M as S,u as C,w}from"./design-icons-QbNMZniQ.js";import{t as ee}from"./run-header-C6-a8K7X.js";import{i as T,n as E,r as D}from"./git-toolbar-BlwZtWla.js";import{t as O}from"./button-C8jUIs8Q.js";import{a as k,i as A,o as j,r as M,s as N,t as P}from"./dialog-DRZuXvul.js";import{b as F,f as I}from"./task-groups-dEzH1nMg.js";import{f as L,l as R,m as z}from"./page-shell-Dky5crRl.js";import{t as B}from"./centered-state-BgSV4e79.js";import{C as V,Q as H,S as U,ln as te,zn as W}from"./index-CwaCfhQn.js";import{t as ne}from"./markdown-BBDDg-4t.js";import{t as G}from"./textarea-vEsJAUAV.js";import{t as K}from"./diff-BFrqQZmo.js";import{n as q}from"./middle-truncated-name-TQxp8NxE.js";var J=e(t(),1),Y=`no worktree — this task ran directly in the repo working tree`;function X(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 — ${Y}`)}function Z(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 — ${Y}`)}function re(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 — ${Y}`):e.forge===null?t(`Draft PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?b(e.run)?t(`Draft PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):F(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 ie(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:X(e),n=e.prUrl?[X(e),Z(e)]:[Z(e),re(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?F(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 Q=n();function $({run:e,open:t,onOpenChange:n}){let r=v(),[i,o]=(0,J.useState)(``),s=I(e),l=(0,J.useRef)(s);l.current=s,(0,J.useEffect)(()=>{t&&o(l.current)},[t]);let u=c({mutationFn:t=>g(e.id,t),onSuccess:t=>{y(`Committed ${W(t.sha)}`),n(!1),r.invalidateQueries({queryKey:a.runs.changes(e.id)}),r.invalidateQueries({queryKey:a.runs.all})},onError:e=>y(e.message,{tone:`danger`})}),d=()=>{let e=i.trim();e.length===0||u.isPending||u.mutate(e)};return(0,Q.jsx)(P,{open:t,onOpenChange:n,children:(0,Q.jsxs)(M,{"data-slot":`commit-dialog`,children:[(0,Q.jsxs)(j,{children:[(0,Q.jsx)(N,{children:`Commit changes`}),(0,Q.jsxs)(A,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,Q.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,Q.jsx)(G,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{H({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(),d())}}),(0,Q.jsxs)(k,{children:[(0,Q.jsx)(O,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Q.jsx)(O,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||u.isPending,onClick:d,children:u.isPending?`Committing…`:`Commit`})]})]})})}function ae(){let{id:e}=x(),t=s(e);return t.isPending?(0,Q.jsx)(V,{tab:`changes`}):t.isError?(0,Q.jsx)(U,{tab:`changes`,error:t.error}):(0,Q.jsx)(oe,{run:t.data})}function oe({run:e}){let t=l(),n=i(),r=o(e.id,F(e)),s=z(),[p,h]=(0,J.useState)(`unified`),[g,b]=(0,J.useState)(!0),[x,S]=(0,J.useState)(!1),[C,w]=(0,J.useState)(null),[T,O]=(0,J.useState)(!1),k=(0,J.useRef)(null),A=v(),j=()=>A.invalidateQueries({queryKey:a.runs.all}),M=e=>y(e.message,{tone:`danger`}),N=c({mutationFn:()=>u(e.id),onSuccess:e=>y(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:M}),P=c({mutationFn:()=>_(e.id),onSuccess:e=>{y(`Draft PR created — ${e.url}`),j()},onError:M}),I=c({mutationFn:()=>m(e.id),onError:e=>{if(e instanceof d&&e.command){navigator.clipboard.writeText(e.command).then(()=>y(`No terminal found — command copied to clipboard.`)).catch(()=>y(`Run manually: ${e.command}`));return}M(e)}}),B=c({mutationFn:t=>f(e.id,t),onError:M}),V=r.isError&&r.error instanceof d&&r.error.status===409,H=ie({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!V,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:te(e)!==void 0,prUrl:e.pullRequestUrl}),U=e=>{switch(e){case`commit`:O(!0);break;case`push`:N.mutate();break;case`create-pr`:P.mutate();break;case`open-terminal`:I.mutate();break;case`view-pr`:break}},W=r.data?.files??[],G=(0,J.useMemo)(()=>D(W),[W]),K=(0,J.useMemo)(()=>W.some(ne),[W]),q=s?p:`unified`;return(0,Q.jsxs)(R,{route:`task-changes`,density:L(W.length),flushPadding:!0,children:[(0,Q.jsx)(ee,{run:e,tab:`changes`}),(0,Q.jsx)(E,{bar:H,healthReady:t.data!==void 0,branch:e.branch,stat:r.data?.stat,mode:q,wrap:g,preview:x,onModeChange:h,onWrapChange:b,onPreviewChange:K?S:void 0,onAction:U}),r.data?.repointedHead?(0,Q.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,Q.jsx)(`code`,{children:r.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,Q.jsx)(`code`,{children:r.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,Q.jsx)(se,{changes:r,changesRefused:V,fileCount:W.length,children:(0,Q.jsx)(ce,{runId:e.id,files:W,tree:G,selected:C,selectFile:e=>{w(e),k.current?.scrollToPath(e)},diffRef:k,effectiveMode:q,effectiveWrap:g,preview:x,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:B.mutate})}),(0,Q.jsx)($,{run:e,open:T,onOpenChange:O})]})}function se({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,Q.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,Q.jsx)(B,{icon:t?(0,Q.jsx)(w,{size:16}):(0,Q.jsx)(S,{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,Q.jsx)(B,{icon:(0,Q.jsx)(w,{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 ce({runId:e,files:t,tree:n,selected:i,selectFile:a,diffRef:o,effectiveMode:s,effectiveWrap:c,preview:l,localHandoff:u,onOpenInApp:d}){let[f,m]=(0,J.useState)(!1);return(0,Q.jsx)(q,{className:`px-4 pb-9 pt-0 [--diff-sticky-top:0px] md:px-9`,treeSlot:`changes-tree-pane`,treeClassName:`rounded-xl border border-border bg-card md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_2rem)] md:overflow-y-auto md:overscroll-contain md:p-3.5`,tree:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,"data-slot":`changes-tree-toggle`,"aria-expanded":f,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,Q.jsxs)(`span`,{children:[`Changed files`,` `,(0,Q.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,Q.jsx)(C,{size:16,"aria-hidden":`true`,className:r(`size-4 shrink-0 text-muted-foreground motion-safe:transition-transform`,f&&`rotate-180`)})]}),(0,Q.jsx)(`h2`,{className:`mb-3 hidden border-b border-border pb-3 text-xs font-semibold md:block`,children:`Changed files`}),(0,Q.jsx)(`div`,{className:r(f?`border-t border-border px-3.5 py-3 md:border-t-0 md:p-0`:`hidden md:block`),children:(0,Q.jsx)(T,{root:n,selected:i,onSelect:e=>{a(e),m(!1)}})})]}),children:(0,Q.jsx)(K,{files:t,viewRef:o,mode:s,wrap:c,preview:l,loadFileText:t=>le(e,t),imageSrc:t=>p(e,t),onOpenInApp:u?e=>d(e):void 0,totals:!1,className:`min-w-0 flex-1`})})}async function le(e,t){try{let n=await h(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{ae 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{Q as r,Wt as i,Y as a,Z as o,fn as s}from"./queries-CII6fTHH.js";import{Fn as c,St as l}from"./toaster-Bs1mVYf9.js";import{h as u}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as d,M as f,ct as p}from"./design-icons-QbNMZniQ.js";import{t as m}from"./run-header-C6-a8K7X.js";import{n as h}from"./diff-controls-x4n0YQLg.js";import{t as g}from"./project-router-onKnSy5a.js";import{b as _}from"./task-groups-dEzH1nMg.js";import{f as v,l as y,m as b}from"./page-shell-Dky5crRl.js";import{t as x}from"./centered-state-BgSV4e79.js";import{C as S,Fn as C,Rn as w,S as T,Ut as E}from"./index-CwaCfhQn.js";import{t as D}from"./diff-BFrqQZmo.js";import{t as O}from"./change-counts-wqSYI3W8.js";import{r as k,t as A}from"./commit-list-D-eUAETe.js";var j=e(t(),1),M=n();function N(){let{id:e}=u(),t=a(e);return t.isPending?(0,M.jsx)(S,{tab:`changes`}):t.isError?(0,M.jsx)(T,{tab:`changes`,error:t.error}):(0,M.jsx)(P,{run:t.data})}function P({run:e}){let{sha:t}=u(),n=r(e.id,_(e)),i=n.data?.commits[0]?.sha;return(0,M.jsxs)(y,{route:`task-commits`,density:v(n.data?.commits.length??0),flushPadding:!0,children:[(0,M.jsx)(m,{run:e,tab:`commits`}),t?(0,M.jsx)(I,{runId:e.id,sha:t}):n.isPending?(0,M.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,M.jsx)(x,{icon:(0,M.jsx)(f,{size:16}),tone:n.error instanceof c&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof c&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,M.jsx)(x,{icon:(0,M.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,M.jsx)(F,{run:e,commits:n.data.commits,selectedSha:i})]})}function F({run:e,commits:t,selectedSha:n}){let r=o(e.id,n),i=R(e.id,t),a=(0,j.useRef)(null),s=b(),[c,l]=(0,j.useState)(`unified`),[u,d]=(0,j.useState)(!0),m=s?c:`unified`;return(0,M.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,M.jsxs)(`div`,{className:`w-full shrink-0 lg:w-[380px] xl:w-[420px]`,children:[(0,M.jsx)(A,{slot:`task-commits`,selectedSha:n,heading:(0,M.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,M.jsx)(z,{runId:e.id,sha:n,files:r.data.files,onPick:e=>a.current?.scrollToPath(e)}):null]}),n?(0,M.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,M.jsx)(`p`,{className:`px-4 py-8 text-center text-xs text-muted-foreground`,children:`Loading commit diff…`}):r.isError?(0,M.jsx)(x,{icon:(0,M.jsx)(p,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load commit diff`,subtitle:r.error.message}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-3 gap-y-2 border-b border-border px-4 py-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`h3`,{className:`break-words text-sm leading-snug font-semibold text-foreground`,children:r.data.subject}),(0,M.jsxs)(`p`,{className:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,M.jsx)(`span`,{children:r.data.author}),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,M.jsx)(`span`,{title:r.data.when,children:E(r.data.when)}),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,M.jsx)(w,{sha:r.data.sha??n,variant:`inline`}),r.data.stat?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,M.jsx)(C,{stat:r.data.stat})]}):null]})]}),(0,M.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:(0,M.jsx)(h,{mode:c,wrap:u,onModeChange:l,onWrapChange:d})})]}),!r.data.files||r.data.files.length===0?(0,M.jsx)(x,{icon:(0,M.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,M.jsx)(`div`,{className:`p-4 [--diff-sticky-top:0px]`,children:(0,M.jsx)(D,{viewRef:a,files:r.data.files,mode:m,wrap:u,totals:!1,className:`min-w-0`})})]})}):null]})}function I({runId:e,sha:t}){return(0,M.jsx)(k,{commit:o(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:px-9`})}var L=12;function R(e,t){let n=t.length<=L,r=s({queries:t.map(t=>({queryKey:i.runs.commit(e,t.sha),queryFn:({signal:n})=>l(e,t.sha,{signal:n}),enabled:n,retry:!1}))}),a=new Map;return r.forEach((e,n)=>{let r=t[n]?.sha;r&&e.data?.stat&&a.set(r,e.data.stat)}),a}function z({runId:e,sha:t,files:n,onPick:r}){return(0,M.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-4 rounded-xl border border-border bg-card p-4`,children:[(0,M.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,M.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[n.length,` `,n.length===1?`file`:`files`,` in`,` `,(0,M.jsx)(w,{sha:t,variant:`inline`,className:`text-[13px] font-medium`})]}),(0,M.jsx)(g,{to:`/tasks/${e}/changes`,className:`text-xs text-muted-foreground hover:text-foreground`,children:`All task changes ›`})]}),(0,M.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,M.jsx)(`li`,{children:(0,M.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,M.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 break-all`,children:e.path}),(0,M.jsx)(O,{adds:e.adds,dels:e.dels,className:`font-mono text-xs`})]})},e.path))})]})}export{N 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{o as r}from"./dist-C_rn70hE.js";import{B as i,F as a,N as o,Y as s,et as c}from"./queries-CII6fTHH.js";import{Fn as l,ft as u,nt as d}from"./toaster-Bs1mVYf9.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as g,E as _,Q as v,Z as y,ct as b,d as x}from"./design-icons-QbNMZniQ.js";import{t as S}from"./createLucideIcon-BHp8sXmF.js";import{t as C}from"./run-header-C6-a8K7X.js";import{a as w,i as T,n as E,o as D,r as O}from"./file-preview-lIaIJUZK.js";import{t as k}from"./button-C8jUIs8Q.js";import{l as A}from"./page-shell-Dky5crRl.js";import{t as j}from"./centered-state-BgSV4e79.js";import{C as M,Ln as N,S as P,fr as F,rr as I}from"./index-CwaCfhQn.js";import{r as L}from"./markdown-CdlTRkrR.js";import{t as R}from"./task-file-scope-Z2smLv09.js";import{n as z,t as B}from"./middle-truncated-name-TQxp8NxE.js";var V=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`}]]),H=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`}]]),U=e(t(),1),W=n();function G({runId:e,path:t,artifactId:n,worktreePath:r}){let a=i(e,n?null:t),s=o(e,n),c=n?s:a,l=(0,U.useContext)(L),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=c.data,g=(0,U.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...l,basePath:h.path}:null,[h,l,e]);if(!t&&!n)return(0,W.jsx)(O,{runId:e,path:null,className:`min-w-0 flex-1`});if(c.isPending)return(0,W.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(c.isError)return(0,W.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,W.jsx)(`h2`,{children:`Could not load this file`}),(0,W.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:c.error.message}),(0,W.jsx)(k,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});if(!h)return(0,W.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=T(h.path,r,t);if(h.type!==`file`)return(0,W.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,W.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,W.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,W.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,W.jsx)(k,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});let v=h.artifact;return(0,W.jsx)(L.Provider,{value:g,children:(0,W.jsx)(E,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:m,className:`min-w-0 flex-1`,imageUrl:v?d(e,v.id,`image`):u(e,t),...v?{downloadUrl:d(e,v.id,`download`),snapshot:(0,W.jsx)(N,{iso:v.createdAt})}:{}},v?.id??h.path)})}var K=new Map;function q(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var J=(0,U.createContext)(null);function Y(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,U.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 X=()=>document.querySelector(`[data-slot="main"]`);function Z(e,t){let n=(0,U.useRef)(null),r=f(),i=h()===`POP`?r.key:q(r.state),[a]=(0,U.useState)(()=>{let t=i?K.get(i):void 0;return t?.runId===e?t:null}),o=(0,U.useRef)(new Set(a?.folders??[])),s=(0,U.useRef)(new Set),[c,l]=(0,U.useState)(0),u=(0,U.useRef)(a===null),d=(0,U.useCallback)(()=>{u.current&&K.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:X()?.scrollTop??0})},[r.key,e]),p=(0,U.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,U.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=X();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,U.useEffect)(()=>{d();let e=[n.current,X()].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 Q({runId:e,selected:t,onSelect:n}){return(0,W.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,W.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,W.jsx)($,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function $({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=c(e,t),o=(0,U.useContext)(J);return(0,U.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,W.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,W.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,W.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,W.jsx)(W.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,W.jsx)(ee,{runId:e,name:a.chain??a.name,path:t===``?a.chain??a.name:`${t}/${a.chain??a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,W.jsx)(te,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function ee({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,U.useContext)(J),[c,l]=(0,U.useState)(()=>s?.isOpen(n)??!1);return(0,W.jsxs)(`li`,{children:[(0,W.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,W.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,W.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,W.jsx)(`span`,{title:n,className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,W.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,W.jsx)($,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function te({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=D(t)?H:g;return(0,W.jsx)(`li`,{children:(0,W.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,W.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,W.jsx)(B,{name:e,path:t}),n===void 0?null:(0,W.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:w(n)})]})})}function ne(){let{id:e}=m(),t=s(e),n=Y();return t.isPending?(0,W.jsx)(M,{tab:`files`}):t.isError?(0,W.jsx)(P,{tab:`files`,error:t.error}):(0,W.jsx)(R,{runId:t.data.id,children:(0,W.jsx)(ie,{run:t.data},`${t.data.id}:${n}`)})}function re(e,t,n,r){let a=i(e,r||n!==null?null:t),s=o(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?a:s).isPending}function ie({run:e}){let t=c(e.id,``),n=a(e.id),[r,i]=p(),o=r.get(`path`),s=r.get(`artifact`),u=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&s!==null,[d,f]=(0,U.useState)(o??``);(0,U.useEffect)(()=>f(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),i(n)},h=t.isError&&t.error instanceof l&&t.error.status===409,g=re(e.id,o,s,u),_=Z(e.id,!t.isPending&&g);return(0,W.jsxs)(A,{route:`task-files`,density:ae(t.isError),flushPadding:!0,children:[(0,W.jsx)(C,{run:e,tab:`files`}),(0,W.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),d.trim()&&m(`path`,d.trim())},children:[(0,W.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,W.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,W.jsx)(I,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:d,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,W.jsx)(k,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!d.trim(),children:`Open file`})]}),(0,W.jsx)(z,{className:`flex-none gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:gap-0 md:px-9`,treeRef:_.tree,treeSlot:`files-tree-pane`,treeClassName:`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:overflow-y-auto md:overscroll-contain`,tree:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,W.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,W.jsx)(j,{icon:h?(0,W.jsx)(V,{}):(0,W.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,W.jsx)(J.Provider,{value:_.folders,children:(0,W.jsx)(Q,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,W.jsx)(oe,{artifacts:n,artifactId:s,onSelect:e=>m(`artifact`,e)})]}),children:u?(0,W.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,W.jsx)(G,{runId:e.id,path:o,artifactId:s,worktreePath:e.worktreePath}):null}),(0,W.jsx)(`p`,{className:`px-4 pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}function ae(e){return e?`empty`:`full`}function oe({artifacts:e,artifactId:t,onSelect:n}){return(0,W.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,W.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,W.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,W.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,W.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,W.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===t?`true`:void 0,className:`group flex min-h-11 w-full items-center gap-2 rounded px-2 py-2 text-left text-xs text-foreground hover:bg-muted focus-visible:ring-2 aria-[current=true]:bg-muted aria-[current=true]:font-medium`,onClick:()=>n(e.id),children:[(0,W.jsx)(F,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,W.jsx)(x,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,W.jsxs)(k,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2 max-md:h-11 no-hover:h-11`,onClick:()=>void e.refetch(),children:[(0,W.jsx)(y,{"aria-hidden":`true`}),`Refresh published files`]})]})}export{ne as TaskFilesRoute};
@@ -1 +0,0 @@
1
- import{It as e}from"./queries-CII6fTHH.js";import{n as t}from"./project-location-BkThFjg5.js";function n(){return{home:e().data?.homeDir??null,root:t()}}export{n as t};
@@ -1,7 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{A as i,Jt as a,Wt as o,dn as s,k as c}from"./queries-CII6fTHH.js";import{A as l,Fn as u,hi as d,k as f,n as p,p as m,u as h}from"./toaster-Bs1mVYf9.js";import{h as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as _,K as v,Q as y,R as ee,W as te,X as ne,a as re,ct as ie,dt as b,l as ae,lt as oe,mt as se,n as ce,ot as le,rt as ue,st as x,x as de,y as fe}from"./design-icons-QbNMZniQ.js";import{t as S}from"./button-C8jUIs8Q.js";import{i as pe,o as C,r as w,s as T,t as me}from"./dialog-DRZuXvul.js";import{i as E,l as he,o as ge}from"./skills-pM_PouEs.js";import{c as _e,f as ve,u as ye}from"./page-shell-Dky5crRl.js";import{t as be}from"./centered-state-BgSV4e79.js";import{$t as D,Jt as O,Kt as k,Qt as A,Xt as xe,Yt as j,Zt as Se,qt as M,rr as N,vn as P,w as Ce}from"./index-CwaCfhQn.js";import{_ as F,a as we,c as Te,f as Ee,g as De,h as Oe,i as ke,m as I,n as Ae,o as je,p as Me,r as Ne,t as Pe,u as Fe}from"./sortable.esm-CAVTYaA3.js";import{t as L}from"./textarea-vEsJAUAV.js";import{t as Ie}from"./option-select-CpZhQQ4x.js";import{t as Le}from"./discard-changes-dialog-CO98KAfo.js";var R=e(t(),1);function z(e){let t=[];for(let n of e){if(n.kind===`plugin`||n.command||!n.skill||n.prompt!==void 0&&n.prompt!==`{{task}}`||n.name!==void 0&&n.name!==n.skill||n.timeoutMs!==void 0||n.model||n.effort!==void 0||n.runner||n.agentProfile||n.allowedTools||n.bashAllowlist||n.onFail)return null;t.push(n.skill)}return t.length?t:null}function Re(e,t){return{id:B(e,t),name:e,skill:e,prompt:`{{task}}`}}function B(e,t){let n=new Set(t.map(e=>e.id)),r=e;for(let t=2;n.has(r);t++)r=`${e}-${t}`;return r}function ze(e,t,n){return{id:B(e,n),[e]:t.trim()}}function V(e){if(!(e.kind===`plugin`||e.skill))return e.command===void 0?e.prompt===void 0?void 0:`prompt`:`command`}function Be(e,t,n){let r=e[t],i=r&&V(r);return!r||!i?[...e]:e.map((e,r)=>r===t?{...e,[i]:n}:e)}function H(e){return e.some(e=>{let t=V(e);return t!==void 0&&!e[t]?.trim()})}function Ve(e,t,n){let r=[...e];return r.splice(Math.max(0,Math.min(n,r.length)),0,t),r}function He(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return[...e];let r=[...e],[i]=r.splice(t,1);return i===void 0?[...e]:(r.splice(n,0,i),r)}function Ue(e,t){return e.filter((e,n)=>n!==t)}function U(e){let t=String(e),n=/^[A-Za-z0-9._][A-Za-z0-9 ._/-]*$/.test(t)&&!t.endsWith(` `),r=/^(true|false|yes|no|on|off|null|~)$/i.test(t)||/^[-+.]?\d/.test(t);return n&&!r?t:JSON.stringify(t)}function W(e,t,n){let r=` `.repeat(n);return!t.includes(`
2
- `)||/^\s/.test(t)?[`${r}${e}: ${U(t)}`]:[`${r}${e}: |`,...t.split(`
3
- `).map(e=>`${r} ${e}`)]}function We(e){let t=[];return e.name&&e.name!==e.id&&t.push(` name: ${U(e.name)}`),e.skill&&t.push(` skill: ${U(e.skill)}`),t}function G(e){let t=[];return e.model&&t.push(` model: ${U(e.model)}`),e.timeoutMs!==void 0&&t.push(` timeoutMs: ${e.timeoutMs}`),e.effort!==void 0&&t.push(` effort: ${U(e.effort)}`),e.runner&&t.push(` runner: ${U(e.runner)}`),e.agentProfile&&t.push(` agentProfile: ${U(e.agentProfile)}`),t}function K(e){let t=[];return e.allowedTools&&t.push(` allowedTools: [${e.allowedTools.map(U).join(`, `)}]`),e.bashAllowlist&&t.push(` bashAllowlist: [${e.bashAllowlist.map(U).join(`, `)}]`),t}function q(e){return e.onFail?[` onFail:`,` retry: ${U(e.onFail.retry)}`,` max: ${e.onFail.max??2}`]:[]}function J(e){return[` - id: ${U(e.id)}`,...We(e),...e.prompt?W(`prompt`,e.prompt,4):[],...e.kind===`plugin`?[` kind: plugin`,` pluginKind: ${U(e.pluginKind)}`,...e.config===void 0?[]:[` config: ${JSON.stringify(e.config)}`]]:[],...G(e),...K(e),...e.command?W(`command`,e.command,4):[],...q(e)]}function Ge(e,t,n){let r=[`name: ${U(e.trim()||`my-workflow`)}`];t.trim()&&r.push(...W(`description`,t.trim(),0));let i=z(n);if(i){r.push(`skills:`);for(let e of i)r.push(` - ${U(e)}`)}else if(n.length){r.push(`steps:`);for(let e of n)r.push(...J(e))}else r.push(`skills: []`);return`${r.join(`
4
- `)}\n`}function Ke(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`chain`}function qe(e){let t=z(e)?`skill`:`step`;return`${e.length} ${t}${e.length===1?``:`s`}`}function Je(e,t){let n=new Set,r=[];for(let t of e.steps.slice(0,8)){let e=t.id||`step`,i=e;for(let t=2;n.has(i);t++)i=`${e}-${t}`;n.add(i),r.push({...t,id:i})}return{name:e.name?.trim()||t,steps:r}}function Ye(e,t,n){let r=z(n);return{name:e.trim(),...t.trim()?{description:t.trim()}:{},...r?{skills:r}:{steps:[...n]}}}var Y=n(),X=[{value:`skill`,label:`Skill`,icon:ue},{value:`prompt`,label:`Prompt`,icon:te},{value:`command`,label:`Command`,icon:le}],Z={prompt:{field:`Prompt the agent runs`,placeholder:`Review the change for {{task}}…`,add:`Add prompt step`,blank:`A prompt step needs text.`},command:{field:`Shell command`,placeholder:`npm test`,add:`Add command step`,blank:`A command step needs text.`}};function Q({kind:e,onKindChange:t}){return(0,Y.jsx)(`div`,{role:`radiogroup`,"aria-label":`Step kind`,"data-slot":`wb-add-kind`,className:`grid grid-cols-3 gap-0.5 rounded-lg border border-border bg-muted/60 p-1 sm:inline-flex sm:w-fit`,children:X.map(n=>(0,Y.jsxs)(`label`,{className:r(`flex min-h-11 cursor-pointer items-center justify-center gap-2 rounded-md border border-transparent px-2 py-1.5 sm:px-3 text-[13px] font-medium transition-colors has-[:focus-visible]:outline-2`,e===n.value?`border-border bg-card text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,Y.jsx)(`input`,{type:`radio`,name:`workflow-add-kind`,className:`sr-only`,value:n.value,checked:e===n.value,onChange:()=>t(n.value)}),(0,Y.jsx)(n.icon,{"aria-hidden":`true`,className:`size-3.5 max-sm:hidden`}),n.label]},n.value))})}function Xe({query:e,onQueryChange:t,matches:n,skillsCount:r,error:i,selectedSkill:a,onSelectSkill:o}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(N,{"aria-label":`Filter skills`,placeholder:`Filter skills…`,value:e,onChange:e=>t(e.target.value)}),i===null?(0,Y.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Available skills`,className:`grid max-h-80 gap-2 overflow-y-auto`,children:[n.map(e=>(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-lg py-2 has-[:checked]:bg-accent-strong/10 has-[:focus-visible]:outline-2`,children:[(0,Y.jsx)(`input`,{type:`radio`,name:`workflow-add-skill`,className:`sr-only`,value:e.id,checked:a===e.id,onChange:()=>o(e.id)}),(0,Y.jsxs)(`span`,{className:`min-w-0 break-words text-sm`,children:[(0,Y.jsx)(`span`,{className:`block`,children:e.name}),(0,Y.jsx)(`span`,{className:`mt-2 block text-xs text-muted-foreground`,children:e.description}),e.path?(0,Y.jsx)(`span`,{className:`block break-all text-xs`,children:e.path}):null]})]},JSON.stringify([e.id,e.path]))),n.length===0?(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r===0?`No skills available in this project.`:`No matching skills.`}):null]}):(0,Y.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not load skills: `,i]}),e.trim()&&!n.some(t=>t.id===e.trim())?(0,Y.jsxs)(S,{onClick:()=>o(e.trim()),children:[`Use skill id “`,e.trim(),`” (unchecked)`]}):null]})}function Ze({open:e,onOpenChange:t,kind:n,onKindChange:i,text:a,onTextChange:o,stepsCount:s,onCloseAutoFocus:c,onCancel:l,onAdd:u,onAddText:d,...f}){let p=s>=8,m=f.selectedSkill;return(0,Y.jsx)(me,{open:e,onOpenChange:t,children:(0,Y.jsxs)(w,{"data-slot":`wb-add-dialog`,onCloseAutoFocus:c,className:`max-h-[85dvh] overflow-y-auto sm:max-w-[660px] [&_button]:min-h-11`,children:[(0,Y.jsxs)(C,{children:[(0,Y.jsx)(T,{className:`text-xl font-normal`,children:`Add step`}),(0,Y.jsx)(pe,{className:`sr-only`,children:`Choose a skill, write a prompt or a shell command to append to this workflow.`})]}),(0,Y.jsx)(Q,{kind:n,onKindChange:i}),n===`skill`?(0,Y.jsx)(Xe,{...f}):(0,Y.jsx)(L,{"aria-label":Z[n].field,placeholder:Z[n].placeholder,value:a,rows:4,className:r(n===`command`&&`font-mono`),onChange:e=>o(e.target.value)}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,Y.jsx)(S,{variant:`outline`,onClick:l,children:`Cancel`}),n===`skill`?(0,Y.jsx)(S,{variant:`primary`,disabled:!m||p,onClick:()=>{m&&u(m)},children:`Add selected skill`}):(0,Y.jsx)(S,{variant:`primary`,disabled:!a.trim()||p,onClick:()=>d(n,a),children:Z[n].add})]}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Append the new step, then reorder it in the existing canvas.`}),p?(0,Y.jsxs)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:[`A workflow can contain up to `,8,` steps. Remove a step before adding another.`]}):null]})})}function Qe({kind:e,text:t,index:n,editing:i,onTextChange:a}){let o=(0,R.useId)(),s=!t.trim();return(0,Y.jsxs)(Y.Fragment,{children:[i?(0,Y.jsx)(L,{"data-slot":`wb-step-text`,"aria-label":`Step ${n+1} ${e}`,"aria-invalid":s||void 0,"aria-describedby":s?o:void 0,value:t,rows:3,className:r(`mt-2`,e===`command`&&`font-mono`),onChange:e=>a(e.target.value)}):null,s?(0,Y.jsx)(`p`,{id:o,"data-slot":`wb-step-text-error`,className:`mt-1 text-xs text-danger`,children:Z[e].blank}):null]})}function $e({kind:e,index:t,editing:n,onEditingChange:r}){return(0,Y.jsxs)(S,{variant:`outline`,size:`sm`,className:`min-h-11`,"data-slot":`wb-step-edit`,"aria-label":n?`Done editing step ${t+1}`:`Edit ${e} of step ${t+1}`,"aria-expanded":n,onClick:()=>r(!n),children:[n?(0,Y.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}):(0,Y.jsx)(v,{"aria-hidden":`true`,className:`size-4`}),n?`Done`:`Edit ${e}`]})}function et({workflows:e,draft:t,trimmedName:n,nameRef:r,onDraft:i,onLoadWorkflow:a,renamedFrom:o}){return(0,Y.jsxs)(`section`,{"data-slot":`wb-metadata`,"data-reports-dirty":``,className:`grid min-w-0 grid-cols-1 gap-3 @xl:grid-cols-2 @4xl:grid-cols-[minmax(180px,240px)_minmax(200px,280px)_minmax(0,1fr)] @xl:items-start`,children:[(0,Y.jsxs)(`div`,{"data-slot":`wb-load`,className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsx)(`label`,{htmlFor:`workflow-load`,className:`text-xs font-medium text-foreground`,children:`Load an existing workflow`}),(0,Y.jsx)(Ie,{id:`workflow-load`,"data-slot":`wb-load-picker`,value:e.some(e=>e.name===n)?n:``,placeholder:`Choose a workflow`,onValueChange:t=>{let n=e.find(e=>e.name===t);n&&a(n)},options:e.map(e=>({value:e.name,label:e.name})),className:`w-full min-w-0 rounded-lg border-border bg-card px-3.5 text-xs font-medium text-foreground md:data-[size=default]:h-10`})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsx)(`label`,{htmlFor:`workflow-name`,className:`text-xs font-medium text-foreground`,children:`Workflow name`}),(0,Y.jsx)(N,{id:`workflow-name`,ref:r,"data-slot":`wb-name`,"aria-label":`Workflow name`,spellCheck:!1,value:t.name,"aria-describedby":o===void 0?void 0:`workflow-rename-note`,onChange:e=>i({...t,name:e.target.value}),className:`h-10 bg-card text-sm max-md:h-11`}),(0,Y.jsx)(`p`,{id:`workflow-rename-note`,"aria-live":`polite`,className:`text-xs text-muted-foreground empty:hidden`,children:o===void 0?null:(0,Y.jsxs)(`span`,{"data-slot":`wb-rename-note`,children:[`Saving creates a new workflow “`,n,`”. “`,o,`” stays as it is.`]})})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 @xl:col-span-2 @4xl:col-span-1`,children:[(0,Y.jsx)(`label`,{htmlFor:`workflow-description`,className:`text-xs font-medium text-foreground`,children:`Description`}),(0,Y.jsx)(L,{id:`workflow-description`,"data-slot":`wb-description`,"aria-label":`Description`,rows:1,value:t.description,onChange:e=>i({...t,description:e.target.value}),className:`min-h-10 bg-card px-3 py-2 text-sm max-md:min-h-11`})]})]})}function tt({savedFile:e,autoOpen:t,onImportToggle:n,onExport:r,onAutoToggle:i,onDeleteRequest:a}){return(0,Y.jsxs)(`div`,{"data-slot":`wb-actions`,className:`grid grid-cols-[max-content_max-content] items-center justify-start gap-2 sm:flex sm:flex-wrap [&_button]:min-h-11 [&_button]:border [&_button]:border-border [&_button]:bg-card`,children:[(0,Y.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import`,className:`col-span-2 justify-self-start`,onClick:n,children:[(0,Y.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),`Import`]}),(0,Y.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-export`,className:`col-span-2 justify-self-start`,title:`Download workflow.yaml`,onClick:r,children:[(0,Y.jsx)(de,{"aria-hidden":`true`,className:`size-3`}),`Export`]}),(0,Y.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto`,"aria-expanded":t,"aria-describedby":`wb-auto-hint`,title:`Auto-build: describe the chain in words and an agent drafts its steps for you to review`,onClick:i,children:[(0,Y.jsx)(b,{"aria-hidden":`true`,className:`size-3`}),`Auto-build`]}),(0,Y.jsx)(`span`,{id:`wb-auto-hint`,className:`sr-only`,children:`Describe the chain in words and an agent drafts its steps for you to review.`}),e?(0,Y.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-delete`,className:`relative text-danger hover:text-danger sm:ms-3 sm:before:absolute sm:before:-start-[13px] sm:before:top-1/2 sm:before:h-5 sm:before:w-px sm:before:-translate-y-1/2 sm:before:bg-border sm:before:content-['']`,title:`Delete the saved workflow file`,onClick:a,children:[(0,Y.jsx)(x,{"aria-hidden":`true`,className:`size-3`}),`Delete`]}):null]})}function nt({text:e,onTextChange:t,pending:n,onRun:r,onCancel:i}){return(0,Y.jsxs)(`div`,{"data-slot":`wb-auto-panel`,className:`rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Y.jsx)(`h2`,{className:`text-lg font-normal`,children:`Build a chain from a prompt`}),(0,Y.jsx)(`p`,{className:`mt-4 text-[13px] leading-relaxed text-muted-foreground`,children:`Describe the outcome. An agent proposes a title and ordered skill/check steps. Review the result, edit it, then Save.`}),(0,Y.jsx)(L,{"data-slot":`wb-auto-text`,"aria-label":`Describe the chain to build`,rows:3,autoFocus:!0,placeholder:`e.g. Fix the bug, run the tests, then review the diff for regressions.`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),r())},className:`mt-4 min-h-[108px] bg-background p-4 text-sm`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,Y.jsxs)(S,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-auto-run`,disabled:n||e.trim()===``,onClick:r,children:[(0,Y.jsx)(b,{"aria-hidden":`true`,className:`size-3`}),n?`Building…`:`Build chain`]}),(0,Y.jsxs)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-auto-cancel`,onClick:i,children:[(0,Y.jsx)(se,{"aria-hidden":`true`,className:`size-4`}),`Cancel`]})]}),(0,Y.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`Creates an editable draft. Review the generated name and steps before saving.`})]})}function rt({open:e,onOpenChange:t,text:n,onTextChange:r,error:i,pending:a,onRun:o,onCancel:s}){return(0,Y.jsx)(me,{open:e,onOpenChange:t,children:(0,Y.jsxs)(w,{showCloseButton:!1,"data-slot":`wb-import-panel`,className:`max-md:translate-x-0 max-md:translate-y-0 sm:max-w-[660px] rounded-xl border border-border bg-card p-5 [&_button]:min-h-11`,children:[(0,Y.jsx)(T,{className:`text-xl font-normal`,children:`Import workflow YAML`}),(0,Y.jsx)(pe,{className:`sr-only`,children:`Paste a portable workflow definition to import.`}),(0,Y.jsx)(L,{"data-slot":`wb-import-text`,"aria-label":`Workflow YAML to import`,rows:4,spellCheck:!1,placeholder:`name: my-flow
5
- skills:
6
- - test-conventions
7
- - commit-style`,value:n,onChange:e=>r(e.target.value),className:`mt-4 min-h-[124px] bg-background p-4 font-mono text-[13px] leading-relaxed`}),(0,Y.jsx)(`p`,{className:`mt-4 text-[13px] text-muted-foreground`,children:`Paste a portable workflow definition. Imported steps appear in execution order.`}),i===``?null:(0,Y.jsx)(`p`,{"data-slot":`wb-import-error`,role:`alert`,className:`mt-2 text-xs text-danger`,children:i}),(0,Y.jsxs)(`div`,{className:`mt-3 flex items-center gap-1.5`,children:[(0,Y.jsx)(S,{type:`button`,variant:`primary`,size:`sm`,"data-slot":`wb-import-run`,disabled:a,onClick:o,children:`Import`}),(0,Y.jsx)(S,{type:`button`,variant:`ghost`,size:`sm`,"data-slot":`wb-import-cancel`,onClick:s,children:`Cancel`})]})]})})}function it({paletteSkills:e,query:t,onQueryChange:n,error:r,inFlow:i,onAdd:a,yaml:o}){return(0,Y.jsxs)(`aside`,{"data-slot":`wb-aside`,className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:[(0,Y.jsx)(`h2`,{className:`text-[16px] font-semibold`,children:`Available skills`}),(0,Y.jsxs)(`div`,{className:`sw-search relative mt-4`,children:[(0,Y.jsx)(y,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Y.jsx)(N,{"data-slot":`wb-filter`,placeholder:`Find a skill…`,"aria-label":`Filter skills`,value:t,onChange:e=>n(e.target.value),className:`h-11 pl-9 text-xs`})]}),(0,Y.jsx)(vt,{skills:e,query:t,error:r,inFlow:i,onAdd:a}),(0,Y.jsx)(`h3`,{className:`mt-5 text-sm font-semibold`,children:`workflow.yaml`}),(0,Y.jsx)(`p`,{className:`mt-3 text-xs leading-relaxed text-muted-foreground`,children:`Export the workflow to use this chain in another project.`}),(0,Y.jsxs)(`details`,{className:`mt-4 min-w-0`,children:[(0,Y.jsxs)(`summary`,{"data-slot":`wb-yaml-toggle`,className:`inline-flex min-h-[44px] cursor-pointer items-center rounded-lg border border-border px-3 text-xs font-medium focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(_,{"aria-hidden":`true`,className:`mr-2 size-4`}),`View YAML`]}),(0,Y.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Y.jsx)(bt,{yaml:o})}),(0,Y.jsx)(`pre`,{"data-slot":`wb-yaml`,className:`mt-2 max-h-96 overflow-auto rounded-lg border border-border bg-background p-3 font-mono text-xs leading-relaxed whitespace-pre text-muted-foreground`,children:o})]})]})}function at({dragging:e,steps:t,skills:n}){return e?.type===`palette`?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[13px] font-medium shadow-md`,children:[(0,Y.jsx)(ue,{"aria-hidden":`true`,className:`size-3.5 text-link-foreground`}),e.skill]}):e?.type===`step`?(0,Y.jsx)(_t,{step:e.step,index:t.findIndex(t=>t.id===e.step.id),skills:n,overlay:!0}):null}function ot({trimmedName:e,savedFile:t,overwriteOpen:n,onOverwriteDismiss:r,deleteOpen:i,onDeleteDismiss:a,onOverwrite:o,onDelete:s}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(k,{open:n,onOpenChange:e=>!e&&r(),children:(0,Y.jsxs)(j,{"data-slot":`wb-overwrite-dialog`,className:`sw-workflow-confirm sm:max-w-[660px]`,children:[(0,Y.jsxs)(A,{children:[(0,Y.jsxs)(D,{children:[`“`,e,`” already exists`]}),(0,Y.jsx)(xe,{children:`Saving overwrites the existing workflow file. There is no undo.`})]}),(0,Y.jsxs)(Se,{children:[(0,Y.jsx)(O,{children:`Keep the file`}),(0,Y.jsx)(M,{"data-slot":`wb-overwrite-confirm`,className:`bg-danger text-danger-foreground`,onClick:o,children:`Overwrite`})]})]})}),(0,Y.jsx)(k,{open:i,onOpenChange:e=>!e&&a(),children:(0,Y.jsxs)(j,{"data-slot":`wb-delete-dialog`,className:`sw-workflow-confirm sm:max-w-[660px]`,children:[(0,Y.jsxs)(A,{children:[(0,Y.jsxs)(D,{children:[`Delete workflow “`,e,`”?`]}),(0,Y.jsxs)(xe,{children:[`Removes `,t?.path?.split(`/`).pop()??`the saved file`,` from`,` `,(0,Y.jsx)(`span`,{className:`font-mono`,children:`.ai/cezar/workflows/`}),`. There is no undo.`]})]}),(0,Y.jsxs)(Se,{children:[(0,Y.jsx)(O,{children:`Keep the file`}),(0,Y.jsx)(M,{"data-slot":`wb-delete-confirm`,className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:s,children:`Delete workflow`})]})]})})]})}function st(e){return e.name??e.skill??e.id}function ct(e){return e.skill&&e.name&&e.name!==e.skill?e.skill:void 0}function lt(e){return e.prompt?.trim()===`{{task}}`?void 0:e.prompt?.trim()}function ut(e){let t=e.onFail?` — on fail retry from "${e.onFail.retry}" (×${e.onFail.max??2})`:``;return`$ ${e.command}${t}`}function dt(e,t){return lt(e)||t?.description||`Not listed by this runner and account. Step open will check the skill id.`}function ft(e,t){return e.command===void 0?e.skill?dt(e,t):e.prompt??``:ut(e)}function pt(e,t){return e.skill&&!t?`unknown`:null}function mt(e){return e.command===void 0?e.skill?`Skill step`:`Prompt step`:`Command step${e.onFail?` · Retry ×${e.onFail.max??2}`:``}`}function ht({index:e,title:t,badge:n,onRemove:i,gripProps:a}){return(0,Y.jsxs)(`div`,{"data-slot":`wb-step-heading`,className:`flex min-w-0 items-center gap-2.5`,children:[(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`wb-step-grip`,"aria-label":`Reorder step ${e+1}: ${t}`,className:`group/grip inline-flex h-[26px] shrink-0 cursor-grab items-center justify-center gap-0.5 rounded-md text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 active:cursor-grabbing`,...a,children:[(0,Y.jsx)(ee,{"aria-hidden":`true`,className:`size-4 opacity-70 transition-opacity group-hover/grip:opacity-100`}),(0,Y.jsx)(`span`,{className:`rounded bg-accent-strong/10 px-2 py-1 font-mono text-[12px] text-link-foreground`,children:String(e+1).padStart(2,`0`)})]}),(0,Y.jsx)(`div`,{className:`min-w-0 flex-1 break-words text-sm font-medium [overflow-wrap:anywhere]`,children:t}),n?(0,Y.jsx)(`span`,{"data-slot":`wb-step-badge`,className:r(`shrink-0 rounded-full border px-2 py-px font-mono text-xs`,n===`unknown`&&`border-danger/35 text-danger`),children:n}):null,i?(0,Y.jsxs)(S,{"data-slot":`wb-step-remove`,variant:`ghost`,size:`sm`,className:`shrink-0`,"aria-label":`Remove step ${e+1}: ${t}`,onClick:i,children:[(0,Y.jsx)(x,{"aria-hidden":`true`}),` Remove`]}):null]})}function gt({index:e,inRow:t=!1,onMoveUp:n,onMoveDown:i}){return(0,Y.jsxs)(`div`,{className:r(`flex flex-wrap gap-2 @min-[900px]:hidden`,!t&&`mt-3`),children:[(0,Y.jsxs)(S,{variant:`outline`,size:`sm`,className:`min-h-11`,"aria-label":`Move step ${e+1} up`,disabled:!n,onClick:n,children:[(0,Y.jsx)(re,{"aria-hidden":`true`,className:`size-4`}),`Move up`]}),(0,Y.jsxs)(S,{variant:`outline`,size:`sm`,className:`min-h-11`,"aria-label":`Move step ${e+1} down`,disabled:!i,onClick:i,children:[(0,Y.jsx)(ce,{"aria-hidden":`true`,className:`size-4`}),`Move down`]})]})}function _t({step:e,index:t,skills:n,onRemove:i,gripProps:a,onMoveUp:o,onMoveDown:s,onTextChange:c,overlay:l=!1}){let u=n.find(t=>t.id===e.skill),d=st(e),f=ft(e,u),p=pt(e,u),m=c&&!l?V(e):void 0,[h,g]=(0,R.useState)(!1);return(0,Y.jsxs)(`div`,{"data-slot":`wb-step`,"data-id":e.id,"data-index":t,className:r(`rounded-lg border border-border bg-background p-4`,l&&`shadow-md`),children:[(0,Y.jsx)(ht,{index:t,title:d,badge:p,onRemove:i,gripProps:a}),f&&!(m&&h)?(0,Y.jsx)(`div`,{"data-slot":`wb-step-summary`,className:`mt-1.5 break-words text-xs leading-relaxed text-muted-foreground`,children:f}):null,(0,Y.jsx)(`p`,{"data-slot":`wb-step-kind`,className:`mt-1.5 text-xs text-link-foreground`,children:mt(e)}),ct(e)?(0,Y.jsx)(`p`,{"data-slot":`wb-step-skill`,className:`mt-1 font-mono text-xs text-muted-foreground`,children:ct(e)}):null,m&&c?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Qe,{kind:m,text:e[m]??``,index:t,editing:h,onTextChange:c}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,Y.jsx)($e,{kind:m,index:t,editing:h,onEditingChange:g}),(0,Y.jsx)(gt,{index:t,inRow:!0,onMoveUp:o,onMoveDown:s})]})]}):l?null:(0,Y.jsx)(gt,{index:t,onMoveUp:o,onMoveDown:s})]})}function vt({skills:e,query:t,error:n,inFlow:r,onAdd:i}){if(n!==null)return(0,Y.jsxs)(`p`,{"data-slot":`wb-palette`,className:`mt-2.5 text-xs text-danger`,children:[`Could not load skills: `,n]});let a=he(e,t);return(0,Y.jsx)(`div`,{"data-slot":`wb-palette`,className:`mt-2.5 flex flex-col gap-1`,children:a.length>0?a.map(e=>(0,Y.jsx)(yt,{skill:e,inFlow:r.has(e.id),onAdd:i},JSON.stringify([e.id,e.path]))):(0,Y.jsx)(`p`,{className:`py-1 text-xs leading-relaxed text-soft-foreground`,children:e.length>0?`No skills match.`:`This runner reports no skills.`})})}function yt({skill:e,inFlow:t,onAdd:n}){let{listeners:i,setNodeRef:a,isDragging:o}=Me({id:`palette:${JSON.stringify([e.id,e.path])}`,data:{type:`palette`,skill:e.id}});return(0,Y.jsxs)(`div`,{ref:a,"data-slot":`wb-skill`,"data-skill":e.id,"data-in-flow":t||void 0,title:e.description??``,className:r(`flex min-h-11 cursor-grab items-center gap-2 rounded-md py-1 transition-colors hover:bg-muted`,o&&`opacity-40`),...i,children:[(0,Y.jsxs)(`span`,{className:r(`min-w-0 flex-1 break-words text-xs`,E(e)?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:[e.name,e.path?(0,Y.jsx)(`span`,{className:`block break-all text-xs text-soft-foreground`,children:e.path}):null]}),(0,Y.jsx)(`button`,{type:`button`,"data-slot":`wb-skill-add`,"aria-label":`Add ${e.name} to the flow`,title:`Add to the flow`,onClick:()=>n(e.id),className:`inline-flex size-11 shrink-0 items-center justify-center rounded-md text-link-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:(0,Y.jsx)(ne,{"aria-hidden":`true`,className:`size-3.5`})})]})}function bt({yaml:e}){let[t,n]=(0,R.useState)(!1),r=(0,R.useRef)(null);return(0,R.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]),(0,Y.jsx)(`button`,{type:`button`,"data-slot":`wb-copy`,title:`Copy the YAML`,onClick:()=>{navigator.clipboard?.writeText(e).catch(()=>{}),n(!0),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1600)},className:`flex items-center gap-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:t?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ae,{"aria-hidden":`true`,className:`size-3 text-success`}),`Copied`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(fe,{"aria-hidden":`true`,className:`size-3`}),`Copy`]})})}function xt(e,t){return{yaml:Ge(e.name,e.description,e.steps),loadedName:t}}function St(){let[e,t]=(0,R.useState)(null),[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)(null),o=(0,R.useRef)(0),s=e!==null&&n!==null&&xt(e,void 0).yaml!==n.yaml;P(s);let c=(e,n)=>{o.current+=1,t(e),r(xt(e,n))};return{draft:e,setDraft:t,dirty:s,replace:c,guardedReplace:(e,t)=>{s?a({draft:e,loadedName:t}):c(e,t)},sending:()=>e===null?null:{baseline:xt(e,e.name.trim()),replacement:o.current},saved:e=>{e&&e.replacement===o.current&&r(e.baseline)},renamedFrom:e=>{let t=n?.loadedName;if(!(t===void 0||e===``))return Ke(e)===Ke(t)?void 0:t},discardOpen:i!==null,keepEditing:()=>a(null),discard:()=>{i&&c(i.draft,i.loadedName),a(null)}}}var Ct=`wb-canvas`;function $(){return{name:`my-workflow`,description:``,steps:[]}}function wt(e){return{name:e.name,description:e.description??``,steps:structuredClone(e.steps??[])}}function Tt(e,t){return e?`No unsaved changes`:H(t)?`A step has no text`:void 0}function Et(){let{name:e}=g();return(0,Y.jsx)(Dt,{routeName:e},e??``)}function Dt({routeName:e}){let t=i(),n=a(),r=c(),g=d(),_=St(),{draft:v,setDraft:y}=_,[ee,te]=(0,R.useState)(``),[re,b]=(0,R.useState)(!1),[oe,se]=(0,R.useState)(``),[ce,le]=(0,R.useState)(null),[ue,x]=(0,R.useState)(`skill`),[de,fe]=(0,R.useState)(``),[pe,C]=(0,R.useState)(!1),[w,T]=(0,R.useState)(``),[me,E]=(0,R.useState)(``),[D,O]=(0,R.useState)(!1),[k,A]=(0,R.useState)(``),[xe,j]=(0,R.useState)(!1),[Se,M]=(0,R.useState)(!1),N=(0,R.useId)(),[P,F]=(0,R.useState)(null),[ke,I]=(0,R.useState)(null),Me=(0,R.useRef)(null),Ne=(0,R.useRef)(null),Pe=t.data?.workflows??[],L=n.data??[],Ie=ge(L,r.data?.skillUsage),z=he(Ie,oe,r.data?.skillUsage);(0,R.useEffect)(()=>{if(v!==null||t.data===void 0)return;let n=t.data.workflows,r=(e?n.find(t=>t.name===e):void 0)??n.find(e=>e.source===`file`);_.replace(r?wt(r):$(),r?.name)},[v,t.data,e,_.replace]);let B=e=>y(t=>t===null?t:{...t,steps:e}),V=s({mutationFn:e=>f(e),onSuccess:e=>{y({name:e.name,description:e.description??``,steps:e.steps}),C(!1),T(``),E(``),p(`Imported "${e.name}" — review, then Save.`)},onError:e=>E(e.message)}),H=s({mutationFn:e=>l(e),onSuccess:e=>{y(t=>{let n=t??$(),{name:r,steps:i}=Je(e,n.name);return{...n,name:r,steps:i}}),O(!1),A(``),p(e.fallback?`Planner unavailable — added a single step. Edit, then Save.`:`Built "${e.name??v?.name??`workflow`}" — review, tweak, then Save.`,e.fallback?{tone:`danger`}:void 0)},onError:e=>p(e instanceof Error?e.message:String(e),{tone:`danger`})}),U=s({onMutate:()=>_.sending(),mutationFn:e=>h({...Ye(v?.name??``,v?.description??``,v?.steps??[]),...e?{overwrite:!0}:{}}),onSuccess:(e,t,n)=>{j(!1),_.saved(n),p(`Saved — ${e.path.split(`/`).pop()??e.path}`),g.invalidateQueries({queryKey:o.workflows})},onError:e=>{e instanceof u&&e.exists===!0?j(!0):p(e instanceof Error?e.message:String(e),{tone:`danger`})}}),W=s({mutationFn:e=>m(e),onSuccess:(e,t)=>{M(!1),p(`Deleted "${t}".`),_.replace($(),void 0),g.invalidateQueries({queryKey:o.workflows})},onError:e=>{M(!1),p(e instanceof Error?e.message:String(e),{tone:`danger`})}}),We=De(Oe(Fe,{activationConstraint:{distance:4}}),Oe(Te,{coordinateGetter:Ae}));if(t.isError)return(0,Y.jsx)(ye,{route:`workflows`,density:`empty`,className:`@container`,children:(0,Y.jsx)(be,{icon:(0,Y.jsx)(ie,{}),tone:`danger`,title:`Could not load workflows`,subtitle:t.error.message})});if(v===null)return(0,Y.jsx)(Ce,{});let G=v.steps,K=v.name.trim(),q=Pe.find(e=>e.name===K&&e.source===`file`),J=Ge(v.name,v.description,G),X=Tt(q!==void 0&&Ge(q.name,q.description??``,q.steps??[])===J,G),Z=(e,t=G.length)=>{if(G.length>=8){p(`A workflow holds at most 8 steps.`,{tone:`danger`});return}B(Ve(G,e,t))},Q=(e,t=G.length)=>Z(Re(e,G),t);return(0,Y.jsxs)(ye,{route:`workflows`,density:ve(G.length),className:`@container`,header:{title:`Workflows`,subtitle:`Portable skill chains. Steps run from top to bottom.`,status:X?(0,Y.jsx)(`span`,{id:N,"data-slot":`wb-save-cue`,className:`whitespace-nowrap text-xs text-muted-foreground`,children:X}):void 0,secondaryActions:(0,Y.jsxs)(_e,{type:`button`,variant:`outline`,"data-slot":`wb-new`,onClick:()=>_.guardedReplace($(),void 0),children:[(0,Y.jsx)(ne,{"aria-hidden":`true`,className:`size-4`}),`New workflow`]}),primaryAction:(0,Y.jsxs)(_e,{type:`button`,variant:`primary`,"data-slot":`wb-save`,disabled:U.isPending||X!==void 0,"aria-describedby":X?N:void 0,onClick:()=>{if(K===``){Me.current?.focus();return}if(G.length===0){p(`Add at least one step first.`,{tone:`danger`});return}U.mutate(!1)},children:[(0,Y.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}),`Save workflow`]})},children:[(0,Y.jsxs)(we,{sensors:We,collisionDetection:Ee,onDragStart:e=>{let t=e.active.data.current;F(t??null)},onDragOver:e=>{I(e.over?String(e.over.id):null)},onDragEnd:e=>{F(null),I(null);let{active:t,over:n}=e;if(n===null)return;let r=t.data.current;if(r?.type===`palette`){let e=n.id===Ct?G.length:G.findIndex(e=>e.id===n.id);Q(r.skill,e===-1?G.length:e);return}if(n.id===t.id)return;let i=G.findIndex(e=>e.id===t.id),a=G.findIndex(e=>e.id===n.id);i!==-1&&a!==-1&&B(He(G,i,a))},onDragCancel:()=>{F(null),I(null)},children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4 pb-[calc(32px+env(safe-area-inset-bottom))]`,children:[(0,Y.jsx)(et,{workflows:Pe,draft:v,trimmedName:K,nameRef:Me,onDraft:y,onLoadWorkflow:e=>_.guardedReplace(wt(e),e.name),renamedFrom:_.renamedFrom(K)}),(0,Y.jsx)(tt,{savedFile:q,autoOpen:D,onImportToggle:()=>{E(``),O(!1),C(e=>!e)},onExport:()=>{let e=new Blob([J],{type:`text/yaml`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${Ke(v.name)}.yaml`,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)},onAutoToggle:()=>{C(!1),O(e=>!e)},onDeleteRequest:()=>M(!0)}),D?(0,Y.jsx)(nt,{text:k,onTextChange:A,pending:H.isPending,onRun:()=>{let e=k.trim();e===``||H.isPending||H.mutate(e)},onCancel:()=>{O(!1),A(``)}}):null,(0,Y.jsx)(rt,{open:pe,onOpenChange:C,text:w,onTextChange:T,error:me,pending:V.isPending,onRun:()=>{let e=w.trim();e!==``&&V.mutate(e)},onCancel:()=>{C(!1),T(``),E(``)}}),(0,Y.jsxs)(`div`,{className:`grid min-w-0 items-start gap-[22px] @min-[700px]:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,Y.jsxs)(`section`,{"data-slot":`wb-main`,className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,title:`A workflow holds at most 8 steps`,children:[`Steps · `,G.length,` of `,8,` max`,(0,Y.jsx)(`span`,{"data-slot":`wb-count`,className:`sr-only`,children:qe(G)})]}),(0,Y.jsx)(Ot,{steps:G,skills:L,dragging:P!==null,overId:ke,activeStepId:P?.type===`step`?P.step.id:null,onRemove:e=>B(Ue(G,e)),onTextChange:(e,t)=>B(Be(G,e,t)),onMove:(e,t)=>B(He(G,e,t))}),(0,Y.jsxs)(S,{ref:Ne,variant:`outline`,className:`mt-4 min-h-11`,onClick:()=>{le(null),se(``),x(`skill`),fe(``),b(!0)},children:[(0,Y.jsx)(ne,{"aria-hidden":`true`,className:`size-4`}),`Add step`]}),(0,Y.jsxs)(`p`,{className:`mt-4 text-xs leading-relaxed text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:`hidden @min-[900px]:inline`,children:`Drag to reorder. The agent follows this sequence from top to bottom.`}),(0,Y.jsx)(`span`,{className:`@min-[900px]:hidden`,children:`Use Move up / Move down to reorder without dragging.`})]})]}),(0,Y.jsx)(it,{paletteSkills:Ie,query:ee,onQueryChange:te,error:n.isError?n.error.message:null,inFlow:new Set(G.map(e=>e.skill).filter(e=>!!e)),onAdd:e=>Q(e),yaml:J})]})]}),(0,Y.jsx)(je,{children:(0,Y.jsx)(At,{dragging:P,steps:G,skills:L})})]}),(0,Y.jsx)(Ze,{open:re,onOpenChange:b,query:oe,onQueryChange:se,matches:z,skillsCount:L.length,error:n.isError?n.error.message:null,selectedSkill:ce,onSelectSkill:le,kind:ue,onKindChange:x,text:de,onTextChange:fe,stepsCount:G.length,onCloseAutoFocus:e=>{e.preventDefault(),Ne.current?.focus()},onCancel:()=>b(!1),onAdd:e=>{Q(e),b(!1)},onAddText:(e,t)=>{Z(ze(e,t,G)),b(!1)}}),(0,Y.jsx)(ot,{trimmedName:K,savedFile:q,overwriteOpen:xe,onOverwriteDismiss:()=>j(!1),deleteOpen:Se,onDeleteDismiss:()=>M(!1),onOverwrite:()=>U.mutate(!0),onDelete:()=>W.mutate(K)}),(0,Y.jsx)(Le,{open:_.discardOpen,subject:K===``?`this workflow`:`“${K}”`,onKeep:_.keepEditing,onDiscard:_.discard})]})}function Ot({steps:e,skills:t,dragging:n,overId:i,activeStepId:a,onRemove:o,onTextChange:s,onMove:c}){let{setNodeRef:l,isOver:u}=I({id:Ct}),d=n&&i===Ct;return(0,Y.jsx)(`div`,{ref:l,"data-slot":`wb-steps`,"data-reports-dirty":``,"data-dragging":n||void 0,className:r(`relative mt-3 rounded-lg transition-colors`,u?`border-accent-strong/60 bg-accent-strong/5`:`border-muted-foreground/25`),children:e.length===0?(0,Y.jsx)(`p`,{className:r(`rounded-md px-3 py-10 text-center text-[13px] transition-colors`,u?`text-link-foreground`:`text-muted-foreground`),children:`Drop a skill here — or Import a workflow.yaml`}):(0,Y.jsxs)(Pe,{items:e.map(e=>e.id),strategy:ke,children:[(0,Y.jsx)(`ol`,{className:`flex flex-col gap-2.5`,children:e.map((r,l)=>(0,Y.jsx)(kt,{step:r,index:l,skills:t,dragging:n,insertBefore:n&&i===r.id&&a!==r.id,onRemove:()=>o(l),onTextChange:e=>s(l,e),onMoveUp:l>0?()=>c(l,l-1):void 0,onMoveDown:l<e.length-1?()=>c(l,l+1):void 0},r.id))}),(0,Y.jsx)(`div`,{"aria-hidden":`true`,className:r(`absolute inset-x-0 mt-1 h-[3px] rounded-full transition-colors`,d?`bg-accent-strong`:`bg-transparent`)})]})})}function kt({step:e,index:t,insertBefore:n,onRemove:i,onTextChange:o,onMoveUp:s,onMoveDown:c}){let l=a(e.runner,e.agentProfile),{attributes:u,listeners:d,setNodeRef:f,transform:p,transition:m,isDragging:h}=Ne({id:e.id,data:{type:`step`,step:e}});return(0,Y.jsxs)(`li`,{ref:f,style:{transform:F.Transform.toString(p),transition:m},className:r(`relative`,h&&`opacity-40`),children:[n?(0,Y.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`wb-drop-line`,className:`pointer-events-none absolute -top-[7px] right-0 left-0 h-[3px] rounded-full bg-accent-strong`}):null,(0,Y.jsx)(_t,{step:e,index:t,skills:l.data??[],onRemove:i,onTextChange:o,onMoveUp:s,onMoveDown:c,gripProps:{...u,...d}})]})}function At(e){let t=e.dragging?.type===`step`?e.dragging.step:void 0,n=a(t?.runner,t?.agentProfile,!!t);return(0,Y.jsx)(at,{...e,skills:t?n.data??[]:e.skills})}export{Et as WorkflowsRoute};
@@ -1 +0,0 @@
1
- [data-route=skills] :is([data-slot=skills-list],[data-slot=skills-detail]),[data-route=workflows] :is([data-slot=wb-main],[data-slot=wb-aside],[data-slot=wb-auto-panel],[data-slot=wb-import-panel]){border-radius:10px}[data-slot=skills-section]>header a{gap:8px}[data-slot=skill-row]{gap:10px;min-height:0}[data-slot=skill-row]>span:nth-child(2){font-size:12px;line-height:1.65}[data-slot=skill-detail]{flex-direction:column;gap:16px;display:flex}[data-slot=skill-detail]>:is(p,section){margin-block-start:0}.sw-detail-source{background:color-mix(in oklch, var(--accent-strong) 10%, transparent);height:26px;color:var(--link-foreground);white-space:pre;border-radius:5px;align-items:center;padding-inline:8px;font-weight:500;display:inline-flex}.sw-detail-source [data-slot=skill-source]{color:inherit;font-size:inherit;font-weight:inherit;background:0 0;padding:0}[data-slot=skill-used-by]>p{margin-block-start:16px;line-height:1.6}[data-slot=skill-body]{margin-block-start:0;font-size:13px;line-height:1.65}[data-slot=skill-body] h1,[data-slot=skill-body] h2{font-size:18px;font-weight:600}[data-slot=skill-body] h3{font-size:14px;font-weight:600}[data-slot=wb-metadata]{gap:14px}[data-slot=wb-load] label{font-size:12px}[data-slot=wb-name]{padding-inline:12px}[data-slot=wb-actions] button{border-radius:8px;gap:8px;padding-inline:12px}[data-slot=wb-actions] svg{width:16px;height:16px}[data-slot=wb-auto-panel]{border-color:color-mix(in oklch, var(--accent-strong) 35%, var(--border))}[data-slot=wb-auto-cancel]{border:1px solid var(--border);background:var(--card)}[data-slot=wb-palette]{gap:4px;margin-block-start:12px}[data-slot=wb-skill]{padding:0}[data-slot=wb-skill-add]{width:24px}[data-slot=wb-aside] h2{font-size:16px}[data-slot=wb-aside] h3{margin-block-start:16px}[data-slot=wb-step-grip] span{justify-content:center;align-items:center;min-width:28px;height:26px;padding:0 4px;font-family:inherit;font-size:12px;font-weight:500;display:inline-flex}[data-slot=wb-step-heading]>div{font-weight:500}[data-slot=wb-main]>p:last-of-type{font-size:12px}[data-slot=wb-import-panel]>div{flex-direction:row-reverse;justify-content:flex-end;gap:12px;margin-block-start:16px}[data-slot=wb-import-cancel]{border:1px solid var(--border)}[data-slot=wb-import-panel]{flex-direction:column;display:flex}[data-slot=wb-import-error]{order:1;margin-block-start:16px;font-size:12px}@media (width<=767px){[data-route=skills],[data-route=workflows]{padding-block-end:32px}[data-slot=skills-section]>header a{gap:10px;padding-inline:14px}[data-slot=wb-import-panel]{z-index:50;max-height:calc(100dvh - 57px);position:fixed;inset-block:57px auto;inset-inline:0;overflow-y:auto}}@container (width<=649px){[data-slot=skill-row][aria-current=page]{border-color:var(--border);background:0 0}}[data-slot=skill-row]:before{display:none}[data-slot=skill-row]:has([data-source=team])>span:first-child>span{font-weight:500;line-height:1.6}[data-slot=skill-row] [data-source=team]{font-weight:400}[data-slot=skill-row][aria-current=page],[data-slot=skill-row][data-highlighted],[data-slot=skills-section]>header a[aria-current=page]{background:var(--task-brand-selected)}[data-slot=skill-detail]>div:first-child{gap:16px}[data-slot=skill-detail]>div:first-child :is(h2,h3),[data-slot=skill-path]{line-height:1.6}[data-slot=skill-body] .thread-markdown{flex-direction:column;gap:16px;display:flex}[data-slot=skill-body] .thread-markdown>*{margin:0}[data-slot=skill-body] .thread-markdown :is(p,ul,ol){color:var(--muted-foreground)}[data-slot=skill-body] .thread-markdown ul{flex-direction:column;gap:16px;padding-inline-start:12px;font-size:12px;display:flex}[data-slot=skill-body] .thread-markdown li{margin:0;padding:0}[data-slot=wb-skill]>span{color:var(--muted-foreground);font-weight:400}@container (width<=649px){[data-slot=skill-row][aria-current=page]{background:0 0}}[data-slot=wb-import-panel]{gap:0}.sw-workflow-confirm{border-radius:12px;padding:24px}.sw-workflow-confirm [data-slot=alert-dialog-title]{font-size:20px;font-weight:400}.sw-workflow-confirm [data-slot=alert-dialog-footer]{justify-content:flex-start}.sw-workflow-confirm button{min-height:44px}@media (width<=767px){[data-slot=dialog-overlay]:has(+[data-slot=wb-import-panel]){background:0 0}[data-slot=wb-import-panel]{width:100%;max-width:100%;inset-block-start:57px;inset-inline-start:0;transform:none}}[data-slot=skills-section]>header a{font-size:13px;font-weight:600}.sw-detail-source,[data-slot=wb-step-grip] span{background:var(--task-brand-selected)}[data-route=workflows] [data-slot=page-shell-body] button{border-radius:8px;font-size:12px;font-weight:500}:is([data-slot=wb-import-panel],[data-slot=wb-add-dialog],.sw-workflow-confirm) button{border-radius:8px;font-size:12px;font-weight:400}.sw-workflow-confirm [data-slot=alert-dialog-title]{line-height:1.6}.sw-workflow-confirm [data-slot=alert-dialog-description]{font-size:13px;line-height:1.6}.sw-workflow-confirm [data-slot=alert-dialog-header]{text-align:start;gap:16px}[data-slot=wb-step-remove] svg,[data-slot=wb-skill-add] svg{width:18px;height:18px}[data-slot=wb-save] svg,[data-slot=wb-auto-run] svg{width:16px;height:16px}[data-slot=skill-row] [data-slot=skill-source]{line-height:1.5}:is([data-slot=wb-import-panel],[data-slot=wb-add-dialog],.sw-workflow-confirm){box-shadow:none}[data-slot=wb-import-panel] [data-slot=dialog-title]{line-height:1.6}[data-slot=wb-add-dialog] [data-slot=dialog-header]{text-align:start}[data-slot=skills-section]>header a{padding-inline:11px}[data-slot=skill-body] .thread-markdown :is(h1,h2,h3){line-height:1.5}[data-slot=skill-body] .thread-markdown :is(p,ul,ol){line-height:1.6}[data-slot=skill-body] .thread-markdown ul{padding-inline-start:0;list-style-position:inside}:is([data-slot=skills-filter],[data-route=workflows] :is(input,textarea,select)){border-color:var(--border);border-radius:8px}:is([data-slot=skills-filter],[data-route=workflows] :is(input,textarea)):focus-visible{border-color:var(--ring)}[data-slot=wb-filter]{background:var(--card)}[data-slot=wb-metadata]>label{line-height:1.5}[data-slot=wb-auto-panel]{border-color:var(--composer-border);padding:19px}[data-slot=wb-auto-panel]>h2,[data-slot=wb-auto-panel]>p{line-height:1.6}[data-slot=wb-auto-panel]>div{gap:8px;margin-block-start:16px}[data-slot=wb-auto-text]{border-radius:8px;padding:15px}@media (width<=767px){[data-slot=skills-section]>header a{padding-inline:13px}}[data-slot=skill-body] .thread-markdown :is(h1,h2){font-size:18px}[data-slot=skill-body] .thread-markdown h3{font-size:14px}[data-slot=wb-step-heading] :is([data-slot=wb-step-grip],[data-slot=wb-step-remove]){gap:4px;width:auto;min-width:26px;height:26px;min-height:26px;position:relative}[data-slot=wb-step-heading] [data-slot=wb-step-remove]{padding-inline:8px}[data-slot=wb-step-heading] :is([data-slot=wb-step-grip],[data-slot=wb-step-remove]):after{content:"";position:absolute;inset:-9px}@media (width<=767px){[data-slot=wb-import-panel]{gap:18px;padding:19px}[data-slot=wb-import-panel]>*{margin:0}[data-slot=wb-import-panel] [data-slot=dialog-title]{line-height:1.5}[data-slot=wb-import-panel]>p{font-size:12px;line-height:1.5}[data-slot=wb-import-text]{border-radius:12px;padding:15px;line-height:1.8}[data-slot=wb-import-panel]>div{margin-block-start:0}[data-slot=wb-import-panel] button{height:50px;min-height:50px;padding-inline:15px}}[data-slot=wb-step-grip] span{border-radius:5px}[data-slot=wb-main],[data-slot=wb-aside]{padding:19px}[data-slot=wb-step]{padding:12px 14px}[data-slot=wb-step-heading]>div{line-height:24px}[data-slot=wb-step-summary],[data-slot=wb-main]>p:first-child,[data-slot=wb-main] footer p,[data-slot=wb-aside]>p{line-height:19px}[data-slot=wb-main]>p:last-of-type{line-height:18px}[data-slot=wb-main] footer{padding-block-start:15px}[data-slot=wb-aside]>p{margin-block-start:16px}[data-slot=wb-aside] h3{line-height:21px}[data-slot=wb-load] label{line-height:16px}[data-slot=wb-auto-run]{gap:8px;padding-inline:12px}[data-slot=wb-actions] button,[data-slot=wb-main]>button,[data-slot=wb-step]>div:last-child button,[data-slot=wb-auto-cancel],[data-slot=wb-yaml-toggle]{gap:8px;padding-inline:11px}[data-slot=skills-section]>header a{gap:10px;height:43px;min-height:43px;padding-inline:13px;position:relative}[data-slot=skills-section]>header a:after{content:"";position:absolute;inset-block:-.5px;inset-inline:0}[data-slot=skill-row]>span:first-child{font-size:13px;line-height:21px}[data-slot=skill-row]:has([data-source=team])>span:first-child>span{line-height:21px}[data-slot=skill-row]>span:nth-child(2){line-height:18px}[data-slot=skill-detail]>div:first-child :is(h2,h3){line-height:30px}[data-slot=skill-used-by]>h3,[data-slot=skill-used-by]>p{line-height:19px}[data-slot=skill-body] .thread-markdown p{line-height:21px}[data-slot=skill-body] .thread-markdown :is(ul,ol){line-height:19px}[data-slot=skill-body] .thread-markdown ul{list-style:none}[data-slot=skill-body] .thread-markdown ul>li:before{content:"• ";white-space:pre}@media (width<=639px){[data-slot=wb-main] footer{gap:14px}}@media (width>=768px){[data-slot=skill-detail]>div:first-child :is(h2,h3){line-height:38px}[data-slot=wb-skill]{min-height:36px;padding-block:4px}[data-slot=wb-skill-add]{height:32px}}[data-slot=wb-auto-panel]>h2{line-height:29px}[data-slot=wb-auto-panel]>p{line-height:21px}[data-slot=wb-auto-panel]>p:last-child{font-size:12px;line-height:18px}[data-slot=wb-auto-text]{line-height:22px}@container (width<=649px){[data-slot=skill-row][aria-current=page]{box-shadow:inset 0 -1px var(--border)}}[data-slot=wb-yaml-toggle] svg{margin-inline-end:0}[data-slot=wb-description]{field-sizing:content;color:var(--foreground);padding:9px 12px;font-size:13px;line-height:20px}