@hearsay-tools/squawk 0.17.0-dev.5734 → 0.17.0-dev.5739

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 (63) hide show
  1. package/dist/contract/discovery.d.ts +1 -32
  2. package/dist/contract/health.d.ts +2 -17
  3. package/dist/contract/index.js +2573 -2565
  4. package/dist/contract/repo-info.d.ts +12 -0
  5. package/dist/contract/repo.d.ts +1 -2
  6. package/dist/contract/runner.d.ts +15 -0
  7. package/dist/contract/usage-limit-hold.d.ts +15 -0
  8. package/dist/contract/waits.d.ts +2 -11
  9. package/dist/contract/workflows.d.ts +1 -1
  10. package/dist/contract/workspace.d.ts +36 -1
  11. package/dist/delegation/routes.d.ts +4 -4
  12. package/dist/delegation/transport.d.ts +71 -71
  13. package/dist/runs/run-exits.js.map +1 -1
  14. package/dist/voice/routes.d.ts +19 -19
  15. package/dist/workflows/run/wait-engine.d.ts +72 -72
  16. package/dist/workflows/run-states.js +3 -3
  17. package/dist/workflows/run-states.js.map +1 -1
  18. package/package.json +4 -4
  19. package/web/dist/assets/activity-motion-Deqj_hcK.js +2 -0
  20. package/web/dist/assets/{activity-route-De0BnSrc.js → activity-route-Z8SMpPLm.js} +1 -1
  21. package/web/dist/assets/{agent-accounts-BCg-578Q.js → agent-accounts-f1cxwgfz.js} +2 -2
  22. package/web/dist/assets/{cez-idle-BT0U4GN_.js → cez-idle-EVoUsgU3.js} +1 -1
  23. package/web/dist/assets/{commit-diff-panel-DYtYc_dH.js → commit-diff-panel-DZutYRbq.js} +1 -1
  24. package/web/dist/assets/{control-locations-CA9TMupq.js → control-locations-C9II3kPz.js} +1 -1
  25. package/web/dist/assets/{diff-tVGVhYyc.js → diff-DNAtaTLC.js} +2 -2
  26. package/web/dist/assets/{diff-view-CNM3u77o.js → diff-view---8Bt-0a.js} +1 -1
  27. package/web/dist/assets/{file-preview-C1eTdJLJ.js → file-preview-D08Kq15E.js} +1 -1
  28. package/web/dist/assets/{git-toolbar-Dwz8p8GW.js → git-toolbar-DMDmGits.js} +1 -1
  29. package/web/dist/assets/{github-BSezqH6f.js → github-DlMu4p0I.js} +1 -1
  30. package/web/dist/assets/{github-sidebar-model-Ct0DltOv.js → github-sidebar-model-B0Ufci5S.js} +1 -1
  31. package/web/dist/assets/{global-activity-route-BZiYz-B0.js → global-activity-route-mJrrP9I0.js} +1 -1
  32. package/web/dist/assets/{index-D489J7QW.js → index-FoxgrgAH.js} +8 -8
  33. package/web/dist/assets/{live-protocol-BDY7JJpT.js → live-protocol-BVn0UA_g.js} +1 -1
  34. package/web/dist/assets/{live-refetch-C0kQc3-z.js → live-refetch-BdnmTJ_8.js} +1 -1
  35. package/web/dist/assets/{preview-pane-connected-DGkEs_L3.js → preview-pane-connected-KzJn9jAG.js} +1 -1
  36. package/web/dist/assets/{project-router-1m_VlC22.js → project-router-MMOk9VbW.js} +1 -1
  37. package/web/dist/assets/project-scope-context-B3M-u8R0.js +4 -0
  38. package/web/dist/assets/{queries-DYfIpJ-d.js → queries-DORTKwyN.js} +1 -1
  39. package/web/dist/assets/{repo-git-CU1S5P-y.js → repo-git-Bf_EfIHt.js} +1 -1
  40. package/web/dist/assets/{report-reader-DlZol2Ux.js → report-reader-ztLhC9gp.js} +1 -1
  41. package/web/dist/assets/reports-BxGqf1aC.js +1 -0
  42. package/web/dist/assets/{run-header-DPjiPKRe.js → run-header-CDMGqoPE.js} +1 -1
  43. package/web/dist/assets/skills-D2r8n5IP.js +1 -0
  44. package/web/dist/assets/{tab-link-DCUifQ46.js → tab-link-BvoGfK8S.js} +1 -1
  45. package/web/dist/assets/{task-changes-BZXWvQN3.js → task-changes-CfUCDwcL.js} +1 -1
  46. package/web/dist/assets/{task-commits-ByI9MSfc.js → task-commits-IOjoz_mL.js} +1 -1
  47. package/web/dist/assets/{task-files-LJbenpiH.js → task-files-CpUYhIpd.js} +1 -1
  48. package/web/dist/assets/{task-github-item-B0CU9lGR.js → task-github-item-B8YPhQDV.js} +1 -1
  49. package/web/dist/assets/task-thread-2Kme3Fc0.js +9 -0
  50. package/web/dist/assets/{thread-state-BLaCzqeX.js → thread-state-C136Em0C.js} +1 -1
  51. package/web/dist/assets/{use-hand-to-agent-state-BkmKad8x.js → use-hand-to-agent-state-C6u70P2A.js} +1 -1
  52. package/web/dist/assets/{useInfiniteQuery-qEY8OhKb.js → useInfiniteQuery-BbYMWe23.js} +1 -1
  53. package/web/dist/assets/useQuery-CqqnAJvu.js +1 -0
  54. package/web/dist/assets/{workflows-Dbxb-d-6.js → workflows-CWrdqLII.js} +1 -1
  55. package/web/dist/assets/{ws-DvGmrP4z.js → ws-BtSVmivO.js} +1 -1
  56. package/web/dist/index.html +13 -13
  57. package/web/dist/live-worker.js +1 -1
  58. package/web/dist/assets/activity-motion-hhx0e841.js +0 -2
  59. package/web/dist/assets/project-scope-context-CaUqlAd7.js +0 -4
  60. package/web/dist/assets/reports-DIGGjk7C.js +0 -1
  61. package/web/dist/assets/skills-BMwanop_.js +0 -1
  62. package/web/dist/assets/task-thread-CXCN__1a.js +0 -9
  63. package/web/dist/assets/useQuery-DOJQOEBO.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{M as t,t as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{t as o}from"./arrow-right-Dh_Lx3um.js";import{A as s,B as c,C as l,E as u,F as d,G as f,H as p,I as m,K as h,L as g,N as _,Q as v,T as y,U as b,V as x,W as S,X as C,Y as w,Z as T,a as E,c as D,g as O,i as k,m as A,n as j,o as M,r as N,s as P,t as F,w as I,z as L}from"./activity-motion-hhx0e841.js";import{s as R}from"./project-router-1m_VlC22.js";import{Ft as z,ot as B}from"./index-D489J7QW.js";var V=e(i(),1),H=a(),U=`rounded-xl border border-border bg-card px-3.5 py-3`,W=`mb-2 flex gap-2 text-[11.5px] font-semibold tracking-[0.06em] text-muted-foreground uppercase`;function G({request:e,index:t,now:n,motion:i}){let{kind:a,relation:s}=g(e,t),c=A(e,n),l=e.relationship===`peer`?`text-message-peer-accent`:`text-message-inbound-accent`;return(0,H.jsxs)(`li`,{"data-slot":i===`fold`?`activity-request-closing`:`activity-request`,"data-request":e.requestId,"aria-hidden":i===`fold`||void 0,className:r(`border-t border-border py-2.5 first:border-t-0 first:pt-0`,i===`enter`&&`activity-row-enter`,i===`fold`&&`activity-row-fold`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12px] font-medium`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:f(t,e)}),(0,H.jsx)(o,{"aria-label":`to`,className:`size-3 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:p(t,e)}),(0,H.jsx)(`span`,{className:r(`ml-auto shrink-0 text-[10px] font-semibold tracking-[0.05em] uppercase`,l),children:a})]}),(0,H.jsxs)(`p`,{className:`my-1 line-clamp-3 text-[12px] text-muted-foreground`,children:[`“`,e.text,`”`]}),(0,H.jsxs)(`div`,{className:`flex gap-1.5 text-[11px] text-muted-foreground tabular-nums`,children:[(0,H.jsxs)(`span`,{children:[s,` · open `,C(T(e.createdAt,n))]}),e.deadline?(0,H.jsx)(`span`,{className:`ml-auto`,children:b(e.deadline,n)}):null]}),c===void 0?null:(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`mt-1.5 h-[3px] overflow-hidden rounded-sm bg-border`,children:(0,H.jsx)(`span`,{className:r(`block h-full bg-current`,l),style:{width:`${Math.round(c*100)}%`}})})]})}function K({className:e}){return(0,H.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:(0,H.jsx)(`path`,{d:`M2 5h30`,strokeWidth:2,strokeDasharray:`6 5`,className:e})})}function q(){return(0,H.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:[(0,H.jsx)(`path`,{d:`M2 5h24`,strokeWidth:2.2,strokeLinecap:`round`,strokeDasharray:`0 6`,className:`stroke-message-peer-accent opacity-80`}),(0,H.jsx)(`circle`,{cx:`29.5`,cy:`5`,r:`3`,strokeWidth:1.6,className:`fill-card stroke-message-peer-accent`})]})}function J(){let e=`flex items-center gap-2`;return(0,H.jsxs)(`div`,{"data-slot":`activity-legend`,className:r(U,`grid gap-1.5 text-[11.5px] text-muted-foreground`),children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`Legend`}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`running`,"aria-hidden":`true`}),`Filled: working now`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`info`,shape:`ring`,"aria-hidden":`true`}),`Ring: waiting for something outside`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`running`,shape:`workers`,"aria-hidden":`true`}),`Robot: waiting for its own workers`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(s,{rate:[0,2,5,1,3,0,4,2],className:`w-[34px]`}),`Heartbeat: tool calls, last 30 s`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(K,{className:`stroke-message-peer-accent`}),`Open request, task to task`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(q,{}),`Waits for a peer to write`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(K,{className:`stroke-message-inbound-accent`}),`Open question, worker to parent`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:(0,H.jsx)(`circle`,{cx:`17`,cy:`5`,r:`4`,className:`fill-foreground`})}),`Comet: a message is travelling`]})]})}var Y={..._,peer:`bg-message-peer-accent`,family:`bg-message-inbound-accent`};function X({feed:e,now:t,watchingSince:n}){return(0,H.jsxs)(`section`,{"data-slot":`activity-just-now`,className:U,children:[(0,H.jsx)(`h2`,{className:W,children:`Just now`}),e.length>0?(0,H.jsx)(`ul`,{"data-slot":`activity-feed`,children:e.map((e,n)=>(0,H.jsxs)(`li`,{"data-slot":`activity-feed-entry`,className:r(`grid grid-cols-[10px_minmax(0,1fr)_auto] items-baseline gap-2 py-1 text-[12px] text-muted-foreground`,n===0&&`activity-feed-enter`),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:r(`size-[7px] -translate-y-px rounded-full`,Y[e.tone])}),(0,H.jsx)(`span`,{className:`min-w-0`,children:e.text}),(0,H.jsx)(`span`,{"data-slot":`activity-feed-age`,className:`text-[11px] tabular-nums`,children:P(t-e.at)})]},e.id))}):null,(0,H.jsxs)(`p`,{className:`py-1.5 text-[12px] text-muted-foreground`,children:[`Watching since `,w(n)]})]})}function Z({requests:e,closing:t=[],index:n,now:r,watchingSince:i,feed:a=[],motion:o=d}){return(0,H.jsxs)(`aside`,{"data-slot":`activity-rail`,"aria-label":`Activity details`,className:`grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-4`,children:[(0,H.jsxs)(`section`,{"data-slot":`activity-open-requests`,className:U,children:[(0,H.jsxs)(`h2`,{className:W,children:[`Open requests `,(0,H.jsx)(`b`,{className:`text-foreground`,children:e.length})]}),e.length===0&&t.length===0?(0,H.jsx)(`p`,{className:`py-1.5 text-[12px] text-muted-foreground`,children:`No task waits for a reply.`}):(0,H.jsxs)(`ul`,{children:[e.map(e=>(0,H.jsx)(G,{request:e,index:n,now:r,motion:e.requestId in o.opening?`enter`:void 0},e.requestId)),t.map(e=>(0,H.jsx)(G,{request:e,index:n,now:r,motion:`fold`},e.requestId))]})]}),(0,H.jsx)(X,{feed:a,now:r,watchingSince:i}),(0,H.jsx)(J,{})]})}function Q(e){let[t,n]=V.useState(0);return V.useLayoutEffect(()=>{let t=e.current;if(!t)return;let r=()=>n(t.clientWidth);if(r(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e]),t}function $(e,t,n){let[r,i]=V.useState(void 0),a=I(r,e,t,n);return y(r,a)||i(a),a}function ee(e,t,n=c(e.tasks)){let r=new Set(e.tasks.map(e=>e.runId)),i=new Set(e.requests.map(e=>e.requestId)),a=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!i.has(t.request.requestId));return{cards:Object.values(t.leaving).filter(t=>t.projectId===e.projectId&&!r.has(t.task.runId)).map(e=>e.task),requests:a.map(e=>e.request),waits:m(e.projectId,n,t),folding:a.filter(e=>e.phase===`reply`||!e.replied).map(e=>e.request)}}function te({project:e,now:t,watchingSince:n,motion:r=d,feed:i,still:a=!1,paused:o=!1}){let s=V.useRef(null),f=l(Q(s)),p=V.useMemo(()=>S(e),[e]),m=V.useMemo(()=>c(e.tasks),[e.tasks]),h=V.useMemo(()=>ee(e,r,m),[e,r,m]),g=V.useMemo(()=>[...e.requests,...h.requests],[e.requests,h.requests]),_=V.useMemo(()=>[...m,...h.waits],[m,h.waits]),v=M(m),y=new Map([...h.cards,...e.tasks].map(e=>[e.runId,e])),b=new Set(h.cards.map(e=>e.runId)),x=e=>1+.35*(y.get(e)?.workers.length??0),C=$([...y.keys()],f,x),w=f===1,T=e.tasks.length>12,E={now:t,titleOf:e=>L(p,e)},k=C.map(e=>e.join(`,`)).join(`|`),A=`${e.tasks.length}:${f}:${T}:${k}:${g.map(e=>e.requestId).join(`,`)}:${_.map(e=>e.id).join(`,`)}`;return O(s,`data-flip`,k,!a&&!o),(0,H.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 pl-5`,children:[e.tasks.length===0?(0,H.jsx)(`p`,{"data-slot":`activity-empty`,className:`py-6 text-[13px] text-muted-foreground`,children:`No active work in this project.`}):null,(0,H.jsxs)(`div`,{ref:s,"data-slot":`activity-graph`,"data-columns":f,"data-dense":T?`true`:void 0,className:`relative grid items-start`,style:{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`,columnGap:w?0:96},children:[C.map((t,n)=>(0,H.jsx)(`div`,{"data-slot":`activity-column`,className:`grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-[30px] max-md:gap-4`,children:t.map(t=>{let n=y.get(t);return n?(0,H.jsx)(u,{task:n,requests:e.requests,waits:m,index:p,ctx:E,dense:T,narrow:w,motion:r,ghost:b.has(t),linked:v.linked.has(t),onHover:v.onHover},t):null})},n)),(0,H.jsx)(D,{requests:g,waits:_,active:v.active,index:p,peers:!w,layoutKey:A,now:t,motion:r,paused:o||a})]})]}),(0,H.jsx)(Z,{requests:e.requests,closing:h.folding,index:p,now:t,watchingSince:n,feed:i,motion:r})]})}function ne(){let e=t(),r=v({kind:`project`,projectId:e}),i=R(),[a]=V.useState(()=>new Date().toISOString()),o=F(r.data?.generatedAt,r.dataUpdatedAt),{motion:s,feed:c,reduced:l,paused:u}=j(r.data,e),d=r.data?.projects[0];if(r.isPending)return(0,H.jsx)(z,{});let f=d?x(d):void 0;return d?(0,H.jsxs)(`div`,{"data-route":`activity`,"data-activity-paused":u?`true`:void 0,className:`flex min-h-full w-full flex-col gap-4 px-[18px] py-6 md:px-7`,children:[(0,H.jsx)(N,{name:d.name,now:o,stale:r.isError,children:(0,H.jsx)(k,{scope:`project`,projectId:i??d.projectId})}),(0,H.jsx)(E,{summary:h([d]),tasksTo:`/`,bumps:s.bumps}),f?(0,H.jsx)(`p`,{"data-slot":`activity-project-notice`,role:`status`,className:`py-6 text-[13px] text-muted-foreground`,children:f}):(0,H.jsx)(te,{project:d,now:o,watchingSince:a,motion:s,feed:c,still:l,paused:u})]}):(0,H.jsxs)(`div`,{"data-route":`activity`,className:`min-h-full w-full px-[18px] py-6 md:px-7`,children:[(0,H.jsx)(N,{name:i??`project`,children:(0,H.jsx)(k,{scope:`project`,projectId:i})}),(0,H.jsxs)(`div`,{role:`alert`,className:`mt-6 flex items-center gap-3 text-[13px] text-muted-foreground`,children:[r.error?`Could not load activity: ${r.error.message}`:`This project has no activity snapshot.`,(0,H.jsx)(n,{size:`sm`,variant:`outline`,onClick:()=>void r.refetch(),className:`max-md:min-h-11`,children:`Retry`})]})]})}export{ne as ProjectActivityRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{M as t,t as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{t as o}from"./arrow-right-Dh_Lx3um.js";import{A as s,B as c,C as l,E as u,F as d,G as f,H as p,I as m,K as h,L as g,N as _,Q as v,T as y,U as b,V as x,W as S,X as C,Y as w,Z as T,a as E,c as D,g as O,i as k,m as A,n as j,o as M,r as N,s as P,t as F,w as I,z as L}from"./activity-motion-Deqj_hcK.js";import{s as R}from"./project-router-MMOk9VbW.js";import{Ft as z,ot as B}from"./index-FoxgrgAH.js";var V=e(i(),1),H=a(),U=`rounded-xl border border-border bg-card px-3.5 py-3`,W=`mb-2 flex gap-2 text-[11.5px] font-semibold tracking-[0.06em] text-muted-foreground uppercase`;function G({request:e,index:t,now:n,motion:i}){let{kind:a,relation:s}=g(e,t),c=A(e,n),l=e.relationship===`peer`?`text-message-peer-accent`:`text-message-inbound-accent`;return(0,H.jsxs)(`li`,{"data-slot":i===`fold`?`activity-request-closing`:`activity-request`,"data-request":e.requestId,"aria-hidden":i===`fold`||void 0,className:r(`border-t border-border py-2.5 first:border-t-0 first:pt-0`,i===`enter`&&`activity-row-enter`,i===`fold`&&`activity-row-fold`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12px] font-medium`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:f(t,e)}),(0,H.jsx)(o,{"aria-label":`to`,className:`size-3 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:p(t,e)}),(0,H.jsx)(`span`,{className:r(`ml-auto shrink-0 text-[10px] font-semibold tracking-[0.05em] uppercase`,l),children:a})]}),(0,H.jsxs)(`p`,{className:`my-1 line-clamp-3 text-[12px] text-muted-foreground`,children:[`“`,e.text,`”`]}),(0,H.jsxs)(`div`,{className:`flex gap-1.5 text-[11px] text-muted-foreground tabular-nums`,children:[(0,H.jsxs)(`span`,{children:[s,` · open `,C(T(e.createdAt,n))]}),e.deadline?(0,H.jsx)(`span`,{className:`ml-auto`,children:b(e.deadline,n)}):null]}),c===void 0?null:(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`mt-1.5 h-[3px] overflow-hidden rounded-sm bg-border`,children:(0,H.jsx)(`span`,{className:r(`block h-full bg-current`,l),style:{width:`${Math.round(c*100)}%`}})})]})}function K({className:e}){return(0,H.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:(0,H.jsx)(`path`,{d:`M2 5h30`,strokeWidth:2,strokeDasharray:`6 5`,className:e})})}function q(){return(0,H.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:[(0,H.jsx)(`path`,{d:`M2 5h24`,strokeWidth:2.2,strokeLinecap:`round`,strokeDasharray:`0 6`,className:`stroke-message-peer-accent opacity-80`}),(0,H.jsx)(`circle`,{cx:`29.5`,cy:`5`,r:`3`,strokeWidth:1.6,className:`fill-card stroke-message-peer-accent`})]})}function J(){let e=`flex items-center gap-2`;return(0,H.jsxs)(`div`,{"data-slot":`activity-legend`,className:r(U,`grid gap-1.5 text-[11.5px] text-muted-foreground`),children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`Legend`}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`running`,"aria-hidden":`true`}),`Filled: working now`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`info`,shape:`ring`,"aria-hidden":`true`}),`Ring: waiting for something outside`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`running`,shape:`workers`,"aria-hidden":`true`}),`Robot: waiting for its own workers`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(s,{rate:[0,2,5,1,3,0,4,2],className:`w-[34px]`}),`Heartbeat: tool calls, last 30 s`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(K,{className:`stroke-message-peer-accent`}),`Open request, task to task`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(q,{}),`Waits for a peer to write`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(K,{className:`stroke-message-inbound-accent`}),`Open question, worker to parent`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:(0,H.jsx)(`circle`,{cx:`17`,cy:`5`,r:`4`,className:`fill-foreground`})}),`Comet: a message is travelling`]})]})}var Y={..._,peer:`bg-message-peer-accent`,family:`bg-message-inbound-accent`};function X({feed:e,now:t,watchingSince:n}){return(0,H.jsxs)(`section`,{"data-slot":`activity-just-now`,className:U,children:[(0,H.jsx)(`h2`,{className:W,children:`Just now`}),e.length>0?(0,H.jsx)(`ul`,{"data-slot":`activity-feed`,children:e.map((e,n)=>(0,H.jsxs)(`li`,{"data-slot":`activity-feed-entry`,className:r(`grid grid-cols-[10px_minmax(0,1fr)_auto] items-baseline gap-2 py-1 text-[12px] text-muted-foreground`,n===0&&`activity-feed-enter`),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:r(`size-[7px] -translate-y-px rounded-full`,Y[e.tone])}),(0,H.jsx)(`span`,{className:`min-w-0`,children:e.text}),(0,H.jsx)(`span`,{"data-slot":`activity-feed-age`,className:`text-[11px] tabular-nums`,children:P(t-e.at)})]},e.id))}):null,(0,H.jsxs)(`p`,{className:`py-1.5 text-[12px] text-muted-foreground`,children:[`Watching since `,w(n)]})]})}function Z({requests:e,closing:t=[],index:n,now:r,watchingSince:i,feed:a=[],motion:o=d}){return(0,H.jsxs)(`aside`,{"data-slot":`activity-rail`,"aria-label":`Activity details`,className:`grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-4`,children:[(0,H.jsxs)(`section`,{"data-slot":`activity-open-requests`,className:U,children:[(0,H.jsxs)(`h2`,{className:W,children:[`Open requests `,(0,H.jsx)(`b`,{className:`text-foreground`,children:e.length})]}),e.length===0&&t.length===0?(0,H.jsx)(`p`,{className:`py-1.5 text-[12px] text-muted-foreground`,children:`No task waits for a reply.`}):(0,H.jsxs)(`ul`,{children:[e.map(e=>(0,H.jsx)(G,{request:e,index:n,now:r,motion:e.requestId in o.opening?`enter`:void 0},e.requestId)),t.map(e=>(0,H.jsx)(G,{request:e,index:n,now:r,motion:`fold`},e.requestId))]})]}),(0,H.jsx)(X,{feed:a,now:r,watchingSince:i}),(0,H.jsx)(J,{})]})}function Q(e){let[t,n]=V.useState(0);return V.useLayoutEffect(()=>{let t=e.current;if(!t)return;let r=()=>n(t.clientWidth);if(r(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e]),t}function $(e,t,n){let[r,i]=V.useState(void 0),a=I(r,e,t,n);return y(r,a)||i(a),a}function ee(e,t,n=c(e.tasks)){let r=new Set(e.tasks.map(e=>e.runId)),i=new Set(e.requests.map(e=>e.requestId)),a=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!i.has(t.request.requestId));return{cards:Object.values(t.leaving).filter(t=>t.projectId===e.projectId&&!r.has(t.task.runId)).map(e=>e.task),requests:a.map(e=>e.request),waits:m(e.projectId,n,t),folding:a.filter(e=>e.phase===`reply`||!e.replied).map(e=>e.request)}}function te({project:e,now:t,watchingSince:n,motion:r=d,feed:i,still:a=!1,paused:o=!1}){let s=V.useRef(null),f=l(Q(s)),p=V.useMemo(()=>S(e),[e]),m=V.useMemo(()=>c(e.tasks),[e.tasks]),h=V.useMemo(()=>ee(e,r,m),[e,r,m]),g=V.useMemo(()=>[...e.requests,...h.requests],[e.requests,h.requests]),_=V.useMemo(()=>[...m,...h.waits],[m,h.waits]),v=M(m),y=new Map([...h.cards,...e.tasks].map(e=>[e.runId,e])),b=new Set(h.cards.map(e=>e.runId)),x=e=>1+.35*(y.get(e)?.workers.length??0),C=$([...y.keys()],f,x),w=f===1,T=e.tasks.length>12,E={now:t,titleOf:e=>L(p,e)},k=C.map(e=>e.join(`,`)).join(`|`),A=`${e.tasks.length}:${f}:${T}:${k}:${g.map(e=>e.requestId).join(`,`)}:${_.map(e=>e.id).join(`,`)}`;return O(s,`data-flip`,k,!a&&!o),(0,H.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 pl-5`,children:[e.tasks.length===0?(0,H.jsx)(`p`,{"data-slot":`activity-empty`,className:`py-6 text-[13px] text-muted-foreground`,children:`No active work in this project.`}):null,(0,H.jsxs)(`div`,{ref:s,"data-slot":`activity-graph`,"data-columns":f,"data-dense":T?`true`:void 0,className:`relative grid items-start`,style:{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`,columnGap:w?0:96},children:[C.map((t,n)=>(0,H.jsx)(`div`,{"data-slot":`activity-column`,className:`grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-[30px] max-md:gap-4`,children:t.map(t=>{let n=y.get(t);return n?(0,H.jsx)(u,{task:n,requests:e.requests,waits:m,index:p,ctx:E,dense:T,narrow:w,motion:r,ghost:b.has(t),linked:v.linked.has(t),onHover:v.onHover},t):null})},n)),(0,H.jsx)(D,{requests:g,waits:_,active:v.active,index:p,peers:!w,layoutKey:A,now:t,motion:r,paused:o||a})]})]}),(0,H.jsx)(Z,{requests:e.requests,closing:h.folding,index:p,now:t,watchingSince:n,feed:i,motion:r})]})}function ne(){let e=t(),r=v({kind:`project`,projectId:e}),i=R(),[a]=V.useState(()=>new Date().toISOString()),o=F(r.data?.generatedAt,r.dataUpdatedAt),{motion:s,feed:c,reduced:l,paused:u}=j(r.data,e),d=r.data?.projects[0];if(r.isPending)return(0,H.jsx)(z,{});let f=d?x(d):void 0;return d?(0,H.jsxs)(`div`,{"data-route":`activity`,"data-activity-paused":u?`true`:void 0,className:`flex min-h-full w-full flex-col gap-4 px-[18px] py-6 md:px-7`,children:[(0,H.jsx)(N,{name:d.name,now:o,stale:r.isError,children:(0,H.jsx)(k,{scope:`project`,projectId:i??d.projectId})}),(0,H.jsx)(E,{summary:h([d]),tasksTo:`/`,bumps:s.bumps}),f?(0,H.jsx)(`p`,{"data-slot":`activity-project-notice`,role:`status`,className:`py-6 text-[13px] text-muted-foreground`,children:f}):(0,H.jsx)(te,{project:d,now:o,watchingSince:a,motion:s,feed:c,still:l,paused:u})]}):(0,H.jsxs)(`div`,{"data-route":`activity`,className:`min-h-full w-full px-[18px] py-6 md:px-7`,children:[(0,H.jsx)(N,{name:i??`project`,children:(0,H.jsx)(k,{scope:`project`,projectId:i})}),(0,H.jsxs)(`div`,{role:`alert`,className:`mt-6 flex items-center gap-3 text-[13px] text-muted-foreground`,children:[r.error?`Could not load activity: ${r.error.message}`:`This project has no activity snapshot.`,(0,H.jsx)(n,{size:`sm`,variant:`outline`,onClick:()=>void r.refetch(),className:`max-md:min-h-11`,children:`Retry`})]})]})}export{ne as ProjectActivityRoute};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{l as t,o as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{B as o,F as s,I as c,P as l,Q as u,Z as d,at as f,et as p,ot as m,rt as h}from"./live-protocol-BDY7JJpT.js";import{c as g,dt as _}from"./queries-DYfIpJ-d.js";import{h as v,l as y}from"./es2015-D345RR4o.js";import{c as ee,i as te,p as b,r as x,s as S,t as C}from"./dropdown-menu-DhrBcVgr.js";import{d as w,l as T,m as E,p as D}from"./alert-dialog-Dj464rjk.js";import{Q as O,u as k}from"./design-icons-DmYTv2r1.js";import{a as A,c as j,i as M,n as N,s as ne}from"./textarea-DlVUfdWG.js";var P=80,F=2e3,I=50,re=200,ie=50,ae=[{id:`add-tests`,label:`Add tests`,text:`Also add or update tests covering this change.`},{id:`explain-change`,label:`Explain the change`,text:`Explain what changed and why before finishing.`},{id:`keep-minimal`,label:`Keep it minimal`,text:`Keep the change as small and targeted as possible — no unrelated refactors.`},{id:`update-docs`,label:`Update docs`,text:`Also update any relevant documentation or comments.`},{id:`check-edge-cases`,label:`Double-check edge cases`,text:`Double-check edge cases and error handling before finishing.`},{id:`create-automation`,label:`Create an automation`,skills:[`create-cezarion-automation`],text:`Create an automation for this repository.
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{l as t,o as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{B as o,F as s,I as c,J as l,P as u,Y as d,Z as f,et as p,nt as m,rt as h}from"./live-protocol-BVn0UA_g.js";import{c as g,dt as _}from"./queries-DORTKwyN.js";import{h as v,l as y}from"./es2015-D345RR4o.js";import{c as ee,i as te,p as b,r as x,s as S,t as C}from"./dropdown-menu-DhrBcVgr.js";import{d as w,l as T,m as E,p as D}from"./alert-dialog-Dj464rjk.js";import{Q as O,u as k}from"./design-icons-DmYTv2r1.js";import{a as A,c as j,i as M,n as N,s as ne}from"./textarea-DlVUfdWG.js";var P=80,F=2e3,I=50,re=200,ie=50,ae=[{id:`add-tests`,label:`Add tests`,text:`Also add or update tests covering this change.`},{id:`explain-change`,label:`Explain the change`,text:`Explain what changed and why before finishing.`},{id:`keep-minimal`,label:`Keep it minimal`,text:`Keep the change as small and targeted as possible — no unrelated refactors.`},{id:`update-docs`,label:`Update docs`,text:`Also update any relevant documentation or comments.`},{id:`check-edge-cases`,label:`Double-check edge cases`,text:`Double-check edge cases and error handling before finishing.`},{id:`create-automation`,label:`Create an automation`,skills:[`create-cezarion-automation`],text:`Create an automation for this repository.
2
2
  Trigger: <a GitHub event or a schedule, e.g. every new pull request; every issue labelled \`needs-agent\`; every day at 04:00; weekdays at 07:30; every 6 hours>.
3
3
  Task for each run: <what the launched task must do, e.g. review the diff, run the tests and post findings as a review comment>.
4
4
  Leave it paused and, for a GitHub trigger, preview its matches so I can check the filter before enabling it.`}],oe=new Set([`create-automation`]);function se(e,t){return t.automations===!0?e:e.filter(e=>!oe.has(e.id))}function ce(e){return!!e&&typeof e==`object`}function le(e){if(e===void 0||!Array.isArray(e))return ae.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!ce(r))continue;let e=typeof r.id==`string`?r.id.trim():``,i=typeof r.label==`string`?r.label.trim():``,a=typeof r.text==`string`?r.text.trim():``;if(!e||!i||!a||t.has(e))continue;t.add(e);let o=ue(r.skills);if(n.push({id:e,label:i.slice(0,P),text:a.slice(0,F),...o.length>0?{skills:o}:{}}),n.length>=I)break}return n}function ue(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(!(!e||t.has(e))&&(t.add(e.slice(0,re)),t.size>=ie))break}return[...t]}function de(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function fe(e,t){return de(e,t).map(e=>e.text).join(`
@@ -15,4 +15,4 @@ Leave it paused and, for a GitHub trigger, preview its matches so I can check th
15
15
  `)?`
16
16
  `:`
17
17
 
18
- `),{text:i+o+n+c+s,caret:i.length+o.length+n.length}}function ge({prompt:e,base:t,selectionStart:n,focused:r,remembered:i}){return e===t?e.length:r&&n!=null||n!=null&&n>0?n:i??e.length}var L=e(i(),1),_e=1,ve=.9,ye=.8,be=.17,R=.1,xe=.999,Se=.9999,Ce=.99,we=/[\\\/_+.#"@\[\(\{&]/,Te=/[\\\/_+.#"@\[\(\{&]/g,Ee=/[\s-]/,De=/[\s-]/g;function Oe(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?_e:Ce;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Oe(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=_e:we.test(e.charAt(l-1))?(d*=ye,p=e.slice(i,l-1).match(Te),p&&i>0&&(d*=xe**+p.length)):Ee.test(e.charAt(l-1))?(d*=ve,m=e.slice(i,l-1).match(De),m&&i>0&&(d*=xe**+m.length)):(d*=be,i>0&&(d*=xe**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Se)),(d<R&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Oe(e,t,n,r,l+1,a+2,o),f*R>d&&(d=f*R)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ke(e){return e.toLowerCase().replace(De,` `)}function Ae(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Oe(e,t,ke(e),ke(t),0,0,{})}var z=`[cmdk-group=""]`,je=`[cmdk-group-items=""]`,Me=`[cmdk-group-heading=""]`,Ne=`[cmdk-item=""]`,Pe=`${Ne}:not([aria-disabled="true"])`,Fe=`cmdk-item-select`,B=`data-value`,Ie=(e,t,n)=>Ae(e,t,n),Le=L.createContext(void 0),V=()=>L.useContext(Le),Re=L.createContext(void 0),H=()=>L.useContext(Re),ze=L.createContext(void 0),Be=L.forwardRef((e,t)=>{let n=G(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=G(()=>new Set),i=G(()=>new Map),a=G(()=>new Map),o=G(()=>new Set),s=Ze(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,ee=y(),te=y(),b=y(),x=L.useRef(null),S=$e();W(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),W(()=>{S(6,k)},[]);let C=L.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(ee))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=L.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:ee,inputId:b,labelId:te,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Ie;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(je);t?t.appendChild(e.parentElement===t?e:e.closest(`${je} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${je} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${z}[${B}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(B);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(z)?.querySelector(Me))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Ne}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(Pe)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(B))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(B))}function ne(e){let t=A()?.closest(z),n;for(;t&&!n;)t=e>0?Ye(t,z):Xe(t,z),n=t?.querySelector(Pe);n?C.setState(`value`,n.getAttribute(B)):N(e)}let P=()=>M(j().length-1),F=e=>{e.preventDefault(),e.metaKey?P():e.altKey?ne(1):N(1)},I=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?ne(-1):N(-1)};return L.createElement(v.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&F(e);break;case`ArrowDown`:F(e);break;case`p`:case`k`:g&&e.ctrlKey&&I(e);break;case`ArrowUp`:I(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),P();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(Fe);t.dispatchEvent(e)}}}}},L.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:tt},c),q(e,e=>L.createElement(Re.Provider,{value:C},L.createElement(Le.Provider,{value:w},e))))}),Ve=L.forwardRef((e,t)=>{let r=y(),i=L.useRef(null),a=L.useContext(ze),o=V(),s=Ze(e),c=s.current?.forceMount??a?.forceMount;W(()=>{if(!c)return o.item(r,a?.id)},[c]);let l=Qe(r,i,[e.value,e.children,i],e.keywords),u=H(),d=K(e=>e.value&&e.value===l.current),f=K(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(r)>0);L.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(Fe,p),()=>t.removeEventListener(Fe,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:ee,keywords:te,...b}=e;return L.createElement(v.div,{ref:n(i,t),...b,id:r,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),He=L.forwardRef((e,t)=>{let{heading:r,children:i,forceMount:a,...o}=e,s=y(),c=L.useRef(null),l=L.useRef(null),u=y(),d=V(),f=K(e=>a||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));W(()=>d.group(s),[]),Qe(s,c,[e.value,e.heading,l]);let p=L.useMemo(()=>({id:s,forceMount:a}),[a]);return L.createElement(v.div,{ref:n(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},r&&L.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},r),q(e,e=>L.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":r?u:void 0},L.createElement(ze.Provider,{value:p},e))))}),Ue=L.forwardRef((e,t)=>{let{alwaysRender:r,...i}=e,a=L.useRef(null),o=K(e=>!e.search);return!r&&!o?null:L.createElement(v.div,{ref:n(a,t),...i,"cmdk-separator":``,role:`separator`})}),We=L.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=H(),o=K(e=>e.search),s=K(e=>e.selectedItemId),c=V();return L.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),L.createElement(v.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Ge=L.forwardRef((e,t)=>{let{children:r,label:i=`Suggestions`,...a}=e,o=L.useRef(null),s=L.useRef(null),c=K(e=>e.selectedItemId),l=V();return L.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),L.createElement(v.div,{ref:n(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":i,id:l.listId},q(e,e=>L.createElement(`div`,{ref:n(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),Ke=L.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return L.createElement(T,{open:n,onOpenChange:r},L.createElement(E,{container:o},L.createElement(D,{"cmdk-overlay":``,className:i}),L.createElement(w,{"aria-label":e.label,"cmdk-dialog":``,className:a},L.createElement(Be,{ref:t,...s}))))}),qe=L.forwardRef((e,t)=>K(e=>e.filtered.count===0)?L.createElement(v.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Je=L.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return L.createElement(v.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},q(e,e=>L.createElement(`div`,{"aria-hidden":!0},e)))}),U=Object.assign(Be,{List:Ge,Item:Ve,Input:We,Group:He,Separator:Ue,Dialog:Ke,Empty:qe,Loading:Je});function Ye(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Xe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ze(e){let t=L.useRef(e);return W(()=>{t.current=e}),t}var W=typeof window>`u`?L.useEffect:L.useLayoutEffect;function G(e){let t=L.useRef();return t.current===void 0&&(t.current=e()),t}function K(e){let t=H(),n=()=>e(t.snapshot());return L.useSyncExternalStore(t.subscribe,n,n)}function Qe(e,t,n,r=[]){let i=L.useRef(),a=V();return W(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(B,s),i.current=s}),i}var $e=()=>{let[e,t]=L.useState(),n=G(()=>new Map);return W(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function et(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function q({asChild:e,children:t},n){return e&&L.isValidElement(t)?L.cloneElement(et(t),{ref:t.ref},n(t.props.children)):n(t)}var tt={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},J=a();function nt({className:e,...t}){return(0,J.jsx)(U,{"data-slot":`command`,className:r(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function rt({title:e=`Command Palette`,description:n=`Search for a command to run...`,children:i,className:a,showCloseButton:o=!0,filter:s,value:c,onValueChange:l,overlayClassName:u,contentProps:d,...f}){return(0,J.jsxs)(N,{...f,children:[(0,J.jsxs)(ne,{className:`sr-only`,children:[(0,J.jsx)(j,{children:e}),(0,J.jsx)(A,{children:n})]}),(0,J.jsx)(M,{...d,className:r(`overflow-hidden p-0`,a),showCloseButton:o,overlayClassName:u,children:(0,J.jsx)(nt,{...t({filter:s,value:c,onValueChange:l}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:i})})]})}function it({className:e,...t}){return(0,J.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,J.jsx)(O,{className:`size-4 shrink-0 opacity-50`}),(0,J.jsx)(U.Input,{"data-slot":`command-input`,className:r(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function at({className:e,onPointerMoveCapture:t,...n}){return(0,J.jsx)(U.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:r(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ot({...e}){return(0,J.jsx)(U.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function st({className:e,...t}){return(0,J.jsx)(U.Group,{"data-slot":`command-group`,className:r(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function ct({className:e,...t}){return(0,J.jsx)(U.Separator,{"data-slot":`command-separator`,className:r(`-mx-1 h-px bg-border`,e),...t})}function lt({className:e,...t}){return(0,J.jsx)(U.Item,{"data-slot":`command-item`,className:r(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function ut({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`command-shortcut`,className:r(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var dt=`default`,ft=h({id:m(),label:m(),path:m(),exists:u()}),pt=h({id:m(),provider:l,label:m(),configDir:m(),path:m(),exists:u(),looksValid:u(),isDefault:u(),status:s.optional(),files:d(ft)});function mt(e){return e.isDefault?`default:${e.provider}`:e.id}var Y=o();h({editable:u(),profiles:d(pt),profileCapableProviders:d(l),selections:f(m(),Y),defaults:Y}),h({projectId:m().min(1).max(64).nullable(),provider:l,profileId:m().max(64).nullable()}),h({selections:f(m(),Y),defaults:Y}),h({status:s}),h({available:u(),reason:m().optional(),fields:d(h({label:m(),value:m()}))}),h({file:m().min(1).max(200),target:m().min(1).max(64).optional()}),h({opened:p(!0),path:m()}),h({provider:l,label:m().trim().max(200).optional(),configDir:m().trim().min(1).max(4096)}),h({profile:pt}),h({label:m().trim().max(200).optional(),configDir:m().trim().min(1).max(4096).optional()}),h({removed:p(!0),id:m()});var ht=`quick-task`;function gt(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var _t=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`},{id:`pi`,label:`pi`,desc:`pi CLI (provider/model)`},{id:`cursor`,label:`Cursor`,desc:`Cursor CLI`},{id:`omp`,label:`OMP`,desc:`Oh My Pi CLI (provider/model)`}],X={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`}],cursor:[{id:``,label:`auto`,desc:`Use your Cursor default model`}],pi:[{id:``,label:`auto`,desc:`Use your pi default model`}],omp:[{id:``,label:`auto`,desc:`Use your OMP default model`}]},Z=[{value:``,label:`auto`,desc:`Harness default`},{value:`low`,label:`low`,desc:`Less reasoning, faster replies`},{value:`medium`,label:`medium`,desc:`Balanced reasoning`},{value:`high`,label:`high`,desc:`More reasoning for hard tasks`},{value:`xhigh`,label:`xhigh`,desc:`Extra-high reasoning`},{value:`max`,label:`max`,desc:`Maximum reasoning`}];function vt(e,t,n){let r=e===`cursor`?[Z[0]]:Z,i=c(e)&&(e!==`cursor`||n?.runner===e)?n?.models.find(e=>e.id===t)?.effortLevels:void 0;if(!i?.length)return r;let a=[Z[0]],o=new Set;for(let e of i){if(o.has(e))continue;let t=Z.find(t=>t.value===e);t&&(o.add(e),a.push(t))}return a.length>1?a:r}function yt(e,t){let n=e??``;return t.some(e=>e.value===n)?n:``}var bt=[`opencode`,`pi`,`omp`];function xt(e,t){return t===`cursor`||!e||X[t].some(t=>t.id===e)?!1:t!==`claude`&&[`claude-fable-5`,`claude-opus-4-8`,`claude-sonnet-5`,`claude-haiku-4-5`].includes(e)?!0:Object.entries(X).some(([n,r])=>n!==t&&!bt.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function St(e,t,n=[]){let r=t?.runner===e?t.models:[],i=X[e]??X.claude,a=[...r.length?i.slice(0,1):i],o=new Set(a.map(e=>e.id));if(c(e))for(let e of r)!e.id||o.has(e.id)||(o.add(e.id),a.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let t of n)!t||o.has(t)||xt(t,e)||(o.add(t),a.push({id:t,label:t,desc:`Custom or legacy model`}));return a}var Ct={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`,pi:`Pi`,cursor:`Cursor`,omp:`OMP`};function wt(e,t,n=!1,r=!1){if(!c(e))return;let i=Ct[e];if(t?.stale)return`Using cached ${i} model list`;if(n||t?.source===`unavailable`)return`Latest ${i} models unavailable`;if(r&&!t)return`Loading ${i} models…`}function Tt(e){let t=_t.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function Et(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function Dt(e,t,n=!1){return!n&&e===t?void 0:e}function Ot(e,t,n,r){let i=St(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function kt(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function At(e,t,n){return e&&kt(e,t,n)?e:null}function jt(e){let{task:t,source:n,model:r,modelsLocked:i,effort:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,images:u,worktree:d,autonomous:f,archiveWhenDone:p,autoMergePr:m,allowWorkers:h,allowMessaging:g}=e;return{task:t,...n?.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n?.ref??`quick-task`},model:i?void 0:r||void 0,effort:i?void 0:a||void 0,runner:Dt(o,c,s),agentProfile:l||void 0,images:u.length>0?[...u]:void 0,worktree:d!==!1&&void 0,autonomous:f===!0||void 0,...Mt({archiveWhenDone:p,autoMergePr:m,allowWorkers:h,allowMessaging:g})}}function Mt(e){return{...e.archiveWhenDone?{archiveWhenDone:!0}:{},...e.autoMergePr?{autoMergePr:!0}:{},...e.allowWorkers===!1?{allowWorkers:!1}:{},...e.allowMessaging===!1?{allowMessaging:!1}:{}}}function Nt(e,t){return t?{...e,notify:!0}:e}function Pt(e){return`/tasks/${e.id}`}var Ft=`inline-flex h-[26px] min-w-0 max-w-full items-center gap-1.5 rounded-full border border-control-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:border-dashed disabled:bg-muted`,It=(0,J.jsx)(k,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-supporting-foreground`}),Lt=(0,L.createContext)(null),Q=e=>Number.parseFloat(e)||0;function Rt({pill:e,box:t,full:n}){let r=getComputedStyle(e),i=[...e.children].filter(e=>{if(e===t)return!1;let n=getComputedStyle(e);return n.display!==`none`&&n.position!==`absolute`});return i.reduce((e,t)=>e+t.getBoundingClientRect().width,0)+Q(r.columnGap)*i.length+n.getBoundingClientRect().width+Q(r.paddingLeft)+Q(r.paddingRight)+Q(r.borderLeftWidth)+Q(r.borderRightWidth)}function zt(e){for(let t=e.parentElement;t;t=t.parentElement){if(t.dataset.slot===`picker-pill-disabled-wrapper`)continue;let e=getComputedStyle(t).display;if(e===`grid`||e===`flex`)return t}return e.parentElement}function Bt(e){let t=new Map;for(let n of e){let e=zt(n.pill),r=t.get(e)??new Map,i=Math.round(n.pill.getBoundingClientRect().top);r.set(i,[...r.get(i)??[],n]),t.set(e,r)}for(let[e,n]of t){let t=getComputedStyle(e),r=e.clientWidth-Q(t.paddingLeft)-Q(t.paddingRight);for(let e of n.values())if(e.reduce((e,t)=>e+Rt(t),0)+Q(t.columnGap)*(e.length-1)>r+.5)return!1}return!0}function Vt({children:e}){let t=(0,L.useRef)(new Map),n=(0,L.useRef)(null),[r,i]=(0,L.useState)(!0),a=(0,L.useCallback)(()=>i(Bt([...t.current.values()])),[]),o=(0,L.useCallback)((e,r)=>{if(t.current.set(e,r),typeof ResizeObserver<`u`){n.current??=new ResizeObserver(a);for(let e of[r.box,r.full,zt(r.pill)])n.current.observe(e)}return a(),()=>{if(t.current.delete(e),typeof ResizeObserver<`u`)for(let e of[r.box,r.full])n.current?.unobserve(e);a()}},[a]);(0,L.useLayoutEffect)(()=>()=>n.current?.disconnect(),[]);let s=(0,L.useMemo)(()=>({register:o,showPrefixes:r}),[o,r]);return(0,J.jsx)(Lt.Provider,{value:s,children:e})}function Ht({field:e,children:t}){let n=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useContext)(Lt),o=a?.register,s=(0,L.useId)(),[c,l]=(0,L.useState)(!0);(0,L.useLayoutEffect)(()=>{let e=n.current,t=i.current;if(o){let n=e.closest(`[data-slot$="pill"]`);return n?o(s,{pill:n,box:e,full:t}):void 0}let r=()=>l(t.getBoundingClientRect().width<=e.getBoundingClientRect().width+.5);if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(e),a.observe(t),()=>a.disconnect()},[e,t,s,o]);let u=a!==null,d=u?a.showPrefixes:c,f=u&&!d;return(0,J.jsxs)(`span`,{ref:n,className:`relative min-w-0 overflow-hidden`,"aria-hidden":`true`,children:[(0,J.jsxs)(`span`,{ref:i,className:r(`invisible w-max whitespace-nowrap`,f?`absolute left-0 top-0`:`block`),children:[e,` · `,t]}),(0,J.jsxs)(`span`,{"data-slot":`picker-label`,className:r(`block truncate`,f?`relative`:`absolute inset-0`),children:[d?(0,J.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,` · `]}):null,t]})]})}function Ut({fieldLabel:e,ariaLabel:t,label:n,options:r,value:i}){return e?`${t} · ${typeof n==`string`?n:r.find(e=>e.value===i)?.label??i}`:t}function Wt({readOnly:e,disabled:t,hint:n,disabledHint:r}){return e?r??n:t?r:n}function Gt({fieldLabel:e,fullLabel:t,explanation:n}){return e?[t,n].filter(Boolean).join(` — `):n}function Kt({icon:e,fieldLabel:t,ariaLabel:n,label:r}){return(0,J.jsxs)(J.Fragment,{children:[e,t?(0,J.jsx)(Ht,{field:n,children:r}):(0,J.jsx)(`span`,{className:`min-w-0 truncate`,title:typeof r==`string`?r:void 0,children:r})]})}function qt({slot:e,ariaLabel:t,label:n,value:i,options:a,onPick:o,disabled:s=!1,readOnly:c=!1,hint:l,disabledHint:u,status:d,searchPlaceholder:f,icon:p,fieldLabel:m=!1}){let[h,g]=(0,L.useState)(!1),[_,v]=(0,L.useState)(``),y=(0,L.useRef)(null),w=(0,L.useRef)(null),T=f?a.filter(e=>e.label.toLowerCase().includes(_.trim().toLowerCase())):a;(0,L.useEffect)(()=>{if(!h||!f)return;let e=window.setTimeout(()=>y.current?.focus());return()=>window.clearTimeout(e)},[h,f]);let E=e=>{y.current&&document.activeElement===y.current&&e.preventDefault()},D=p?` h-11 gap-2 rounded-lg border-border px-3 text-foreground`:``,A=Ut({fieldLabel:m,ariaLabel:t,label:n,options:a,value:i}),j=Gt({fieldLabel:m,fullLabel:A,explanation:Wt({readOnly:c,disabled:s,hint:l,disabledHint:u})}),M=Kt({icon:p,fieldLabel:m,ariaLabel:t,label:n});if(c)return(0,J.jsxs)(`span`,{"data-slot":e,"aria-label":A,title:j,className:r(Ft,D,`cursor-default hover:bg-card hover:text-muted-foreground`),children:[M,m?(0,J.jsx)(`span`,{className:`sr-only`,children:A}):null]});let N=(0,J.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":A,disabled:s,title:j,className:r(Ft,D),children:[M,p?(0,J.jsx)(k,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-muted-foreground`}):It]});return s?(0,J.jsx)(`span`,{"data-slot":`picker-pill-disabled-wrapper`,title:j,className:`inline-flex min-w-0 max-w-full`,children:N}):(0,J.jsxs)(C,{open:h,onOpenChange:e=>{g(e),e||v(``)},children:[(0,J.jsx)(b,{asChild:!0,children:N}),(0,J.jsxs)(x,{ref:w,align:`start`,"data-testid":`${e}-menu`,children:[f?(0,J.jsxs)(`div`,{"data-slot":`picker-search`,className:`mbe-1 flex min-h-11 min-w-56 items-center gap-2 border-b border-border px-2`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,J.jsx)(`input`,{ref:y,type:`search`,"aria-label":f,placeholder:f,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=w.current?.querySelectorAll(`[role="menuitemradio"]:not([data-disabled])`);(e.key===`ArrowDown`?t?.[0]:t?.[t.length-1])?.focus()}else e.key!==`Escape`&&e.stopPropagation()},className:`h-11 w-0 min-w-0 flex-1 bg-transparent text-sm placeholder:text-muted-foreground`})]}):null,(0,J.jsx)(S,{value:i,onValueChange:o,children:T.map(e=>(0,J.jsx)(ee,{value:e.value,className:r(`gap-2.5`,f&&`min-h-11`),onPointerMove:E,onPointerLeave:E,onKeyDown:t=>{y.current&&(t.key===`ArrowUp`&&e===T[0]||t.key===`Tab`&&t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),y.current.focus())},children:(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.label}),e.desc?(0,J.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),f&&T.length===0?(0,J.jsx)(`p`,{role:`status`,className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:`No matches found.`}):null,d?(0,J.jsx)(te,{disabled:!0,onPointerMove:E,onPointerLeave:E,className:`border-t border-border text-[11px] text-muted-foreground`,children:d}):null]})]})}var $=(e,t)=>t===null?e:`${e}:${t}`;function Jt({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o,icon:s,fieldLabel:c}){let l=_t.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:$(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:$(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),u=a??o?.[t]??`default`,d=l.some(e=>e.value===$(t,u))?$(t,u):$(t,null);return(0,J.jsx)(qt,{icon:s,fieldLabel:c,slot:`runner-pill`,ariaLabel:`Runner`,label:l.find(e=>e.value===d)?.label??t,value:d,disabled:r,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:l})}function Yt(){let e=g(),t=_(),n=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),r=t.data?.info?.root;return{accounts:n,repoAccount:r?e.data?.selections?.[r]:void 0}}function Xt(e,t){return e.filter(e=>e.provider===t).length>1}export{it as A,pe as B,Nt as C,rt as D,nt as E,ae as F,se as H,fe as I,he as L,at as M,ct as N,ot as O,ut as P,me as R,Mt as S,mt as T,ge as V,Ot as _,Jt as a,Dt as b,ht as c,jt as d,vt as f,yt as g,gt as h,Vt as i,lt as j,st as k,_t as l,St as m,Yt as n,It as o,wt as p,qt as r,Ft as s,Xt as t,Tt as u,Et as v,dt as w,Pt as x,At as y,le as z};
18
+ `),{text:i+o+n+c+s,caret:i.length+o.length+n.length}}function ge({prompt:e,base:t,selectionStart:n,focused:r,remembered:i}){return e===t?e.length:r&&n!=null||n!=null&&n>0?n:i??e.length}var L=e(i(),1),_e=1,ve=.9,ye=.8,be=.17,R=.1,xe=.999,Se=.9999,Ce=.99,we=/[\\\/_+.#"@\[\(\{&]/,Te=/[\\\/_+.#"@\[\(\{&]/g,Ee=/[\s-]/,De=/[\s-]/g;function Oe(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?_e:Ce;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Oe(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=_e:we.test(e.charAt(l-1))?(d*=ye,p=e.slice(i,l-1).match(Te),p&&i>0&&(d*=xe**+p.length)):Ee.test(e.charAt(l-1))?(d*=ve,m=e.slice(i,l-1).match(De),m&&i>0&&(d*=xe**+m.length)):(d*=be,i>0&&(d*=xe**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Se)),(d<R&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Oe(e,t,n,r,l+1,a+2,o),f*R>d&&(d=f*R)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ke(e){return e.toLowerCase().replace(De,` `)}function Ae(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Oe(e,t,ke(e),ke(t),0,0,{})}var z=`[cmdk-group=""]`,je=`[cmdk-group-items=""]`,Me=`[cmdk-group-heading=""]`,Ne=`[cmdk-item=""]`,Pe=`${Ne}:not([aria-disabled="true"])`,Fe=`cmdk-item-select`,B=`data-value`,Ie=(e,t,n)=>Ae(e,t,n),Le=L.createContext(void 0),V=()=>L.useContext(Le),Re=L.createContext(void 0),H=()=>L.useContext(Re),ze=L.createContext(void 0),Be=L.forwardRef((e,t)=>{let n=G(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=G(()=>new Set),i=G(()=>new Map),a=G(()=>new Map),o=G(()=>new Set),s=Ze(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,ee=y(),te=y(),b=y(),x=L.useRef(null),S=$e();W(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),W(()=>{S(6,k)},[]);let C=L.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(ee))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=L.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:ee,inputId:b,labelId:te,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Ie;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(je);t?t.appendChild(e.parentElement===t?e:e.closest(`${je} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${je} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${z}[${B}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(B);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(z)?.querySelector(Me))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Ne}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(Pe)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(B))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(B))}function ne(e){let t=A()?.closest(z),n;for(;t&&!n;)t=e>0?Ye(t,z):Xe(t,z),n=t?.querySelector(Pe);n?C.setState(`value`,n.getAttribute(B)):N(e)}let P=()=>M(j().length-1),F=e=>{e.preventDefault(),e.metaKey?P():e.altKey?ne(1):N(1)},I=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?ne(-1):N(-1)};return L.createElement(v.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&F(e);break;case`ArrowDown`:F(e);break;case`p`:case`k`:g&&e.ctrlKey&&I(e);break;case`ArrowUp`:I(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),P();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(Fe);t.dispatchEvent(e)}}}}},L.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:tt},c),q(e,e=>L.createElement(Re.Provider,{value:C},L.createElement(Le.Provider,{value:w},e))))}),Ve=L.forwardRef((e,t)=>{let r=y(),i=L.useRef(null),a=L.useContext(ze),o=V(),s=Ze(e),c=s.current?.forceMount??a?.forceMount;W(()=>{if(!c)return o.item(r,a?.id)},[c]);let l=Qe(r,i,[e.value,e.children,i],e.keywords),u=H(),d=K(e=>e.value&&e.value===l.current),f=K(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(r)>0);L.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(Fe,p),()=>t.removeEventListener(Fe,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:ee,keywords:te,...b}=e;return L.createElement(v.div,{ref:n(i,t),...b,id:r,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),He=L.forwardRef((e,t)=>{let{heading:r,children:i,forceMount:a,...o}=e,s=y(),c=L.useRef(null),l=L.useRef(null),u=y(),d=V(),f=K(e=>a||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));W(()=>d.group(s),[]),Qe(s,c,[e.value,e.heading,l]);let p=L.useMemo(()=>({id:s,forceMount:a}),[a]);return L.createElement(v.div,{ref:n(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},r&&L.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},r),q(e,e=>L.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":r?u:void 0},L.createElement(ze.Provider,{value:p},e))))}),Ue=L.forwardRef((e,t)=>{let{alwaysRender:r,...i}=e,a=L.useRef(null),o=K(e=>!e.search);return!r&&!o?null:L.createElement(v.div,{ref:n(a,t),...i,"cmdk-separator":``,role:`separator`})}),We=L.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=H(),o=K(e=>e.search),s=K(e=>e.selectedItemId),c=V();return L.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),L.createElement(v.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Ge=L.forwardRef((e,t)=>{let{children:r,label:i=`Suggestions`,...a}=e,o=L.useRef(null),s=L.useRef(null),c=K(e=>e.selectedItemId),l=V();return L.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),L.createElement(v.div,{ref:n(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":i,id:l.listId},q(e,e=>L.createElement(`div`,{ref:n(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),Ke=L.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return L.createElement(T,{open:n,onOpenChange:r},L.createElement(E,{container:o},L.createElement(D,{"cmdk-overlay":``,className:i}),L.createElement(w,{"aria-label":e.label,"cmdk-dialog":``,className:a},L.createElement(Be,{ref:t,...s}))))}),qe=L.forwardRef((e,t)=>K(e=>e.filtered.count===0)?L.createElement(v.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Je=L.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return L.createElement(v.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},q(e,e=>L.createElement(`div`,{"aria-hidden":!0},e)))}),U=Object.assign(Be,{List:Ge,Item:Ve,Input:We,Group:He,Separator:Ue,Dialog:Ke,Empty:qe,Loading:Je});function Ye(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Xe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ze(e){let t=L.useRef(e);return W(()=>{t.current=e}),t}var W=typeof window>`u`?L.useEffect:L.useLayoutEffect;function G(e){let t=L.useRef();return t.current===void 0&&(t.current=e()),t}function K(e){let t=H(),n=()=>e(t.snapshot());return L.useSyncExternalStore(t.subscribe,n,n)}function Qe(e,t,n,r=[]){let i=L.useRef(),a=V();return W(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(B,s),i.current=s}),i}var $e=()=>{let[e,t]=L.useState(),n=G(()=>new Map);return W(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function et(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function q({asChild:e,children:t},n){return e&&L.isValidElement(t)?L.cloneElement(et(t),{ref:t.ref},n(t.props.children)):n(t)}var tt={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},J=a();function nt({className:e,...t}){return(0,J.jsx)(U,{"data-slot":`command`,className:r(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function rt({title:e=`Command Palette`,description:n=`Search for a command to run...`,children:i,className:a,showCloseButton:o=!0,filter:s,value:c,onValueChange:l,overlayClassName:u,contentProps:d,...f}){return(0,J.jsxs)(N,{...f,children:[(0,J.jsxs)(ne,{className:`sr-only`,children:[(0,J.jsx)(j,{children:e}),(0,J.jsx)(A,{children:n})]}),(0,J.jsx)(M,{...d,className:r(`overflow-hidden p-0`,a),showCloseButton:o,overlayClassName:u,children:(0,J.jsx)(nt,{...t({filter:s,value:c,onValueChange:l}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:i})})]})}function it({className:e,...t}){return(0,J.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,J.jsx)(O,{className:`size-4 shrink-0 opacity-50`}),(0,J.jsx)(U.Input,{"data-slot":`command-input`,className:r(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function at({className:e,onPointerMoveCapture:t,...n}){return(0,J.jsx)(U.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:r(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ot({...e}){return(0,J.jsx)(U.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function st({className:e,...t}){return(0,J.jsx)(U.Group,{"data-slot":`command-group`,className:r(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function ct({className:e,...t}){return(0,J.jsx)(U.Separator,{"data-slot":`command-separator`,className:r(`-mx-1 h-px bg-border`,e),...t})}function lt({className:e,...t}){return(0,J.jsx)(U.Item,{"data-slot":`command-item`,className:r(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function ut({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`command-shortcut`,className:r(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var dt=`default`,ft=p({id:h(),label:h(),path:h(),exists:d()}),pt=p({id:h(),provider:u,label:h(),configDir:h(),path:h(),exists:d(),looksValid:d(),isDefault:d(),status:s.optional(),files:l(ft)});function mt(e){return e.isDefault?`default:${e.provider}`:e.id}var Y=o();p({editable:d(),profiles:l(pt),profileCapableProviders:l(u),selections:m(h(),Y),defaults:Y}),p({projectId:h().min(1).max(64).nullable(),provider:u,profileId:h().max(64).nullable()}),p({selections:m(h(),Y),defaults:Y}),p({status:s}),p({available:d(),reason:h().optional(),fields:l(p({label:h(),value:h()}))}),p({file:h().min(1).max(200),target:h().min(1).max(64).optional()}),p({opened:f(!0),path:h()}),p({provider:u,label:h().trim().max(200).optional(),configDir:h().trim().min(1).max(4096)}),p({profile:pt}),p({label:h().trim().max(200).optional(),configDir:h().trim().min(1).max(4096).optional()}),p({removed:f(!0),id:h()});var ht=`quick-task`;function gt(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var _t=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`},{id:`pi`,label:`pi`,desc:`pi CLI (provider/model)`},{id:`cursor`,label:`Cursor`,desc:`Cursor CLI`},{id:`omp`,label:`OMP`,desc:`Oh My Pi CLI (provider/model)`}],X={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`}],cursor:[{id:``,label:`auto`,desc:`Use your Cursor default model`}],pi:[{id:``,label:`auto`,desc:`Use your pi default model`}],omp:[{id:``,label:`auto`,desc:`Use your OMP default model`}]},Z=[{value:``,label:`auto`,desc:`Harness default`},{value:`low`,label:`low`,desc:`Less reasoning, faster replies`},{value:`medium`,label:`medium`,desc:`Balanced reasoning`},{value:`high`,label:`high`,desc:`More reasoning for hard tasks`},{value:`xhigh`,label:`xhigh`,desc:`Extra-high reasoning`},{value:`max`,label:`max`,desc:`Maximum reasoning`}];function vt(e,t,n){let r=e===`cursor`?[Z[0]]:Z,i=c(e)&&(e!==`cursor`||n?.runner===e)?n?.models.find(e=>e.id===t)?.effortLevels:void 0;if(!i?.length)return r;let a=[Z[0]],o=new Set;for(let e of i){if(o.has(e))continue;let t=Z.find(t=>t.value===e);t&&(o.add(e),a.push(t))}return a.length>1?a:r}function yt(e,t){let n=e??``;return t.some(e=>e.value===n)?n:``}var bt=[`opencode`,`pi`,`omp`];function xt(e,t){return t===`cursor`||!e||X[t].some(t=>t.id===e)?!1:t!==`claude`&&[`claude-fable-5`,`claude-opus-4-8`,`claude-sonnet-5`,`claude-haiku-4-5`].includes(e)?!0:Object.entries(X).some(([n,r])=>n!==t&&!bt.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function St(e,t,n=[]){let r=t?.runner===e?t.models:[],i=X[e]??X.claude,a=[...r.length?i.slice(0,1):i],o=new Set(a.map(e=>e.id));if(c(e))for(let e of r)!e.id||o.has(e.id)||(o.add(e.id),a.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let t of n)!t||o.has(t)||xt(t,e)||(o.add(t),a.push({id:t,label:t,desc:`Custom or legacy model`}));return a}var Ct={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`,pi:`Pi`,cursor:`Cursor`,omp:`OMP`};function wt(e,t,n=!1,r=!1){if(!c(e))return;let i=Ct[e];if(t?.stale)return`Using cached ${i} model list`;if(n||t?.source===`unavailable`)return`Latest ${i} models unavailable`;if(r&&!t)return`Loading ${i} models…`}function Tt(e){let t=_t.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function Et(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function Dt(e,t,n=!1){return!n&&e===t?void 0:e}function Ot(e,t,n,r){let i=St(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function kt(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function At(e,t,n){return e&&kt(e,t,n)?e:null}function jt(e){let{task:t,source:n,model:r,modelsLocked:i,effort:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,images:u,worktree:d,autonomous:f,archiveWhenDone:p,autoMergePr:m,allowWorkers:h,allowMessaging:g}=e;return{task:t,...n?.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n?.ref??`quick-task`},model:i?void 0:r||void 0,effort:i?void 0:a||void 0,runner:Dt(o,c,s),agentProfile:l||void 0,images:u.length>0?[...u]:void 0,worktree:d!==!1&&void 0,autonomous:f===!0||void 0,...Mt({archiveWhenDone:p,autoMergePr:m,allowWorkers:h,allowMessaging:g})}}function Mt(e){return{...e.archiveWhenDone?{archiveWhenDone:!0}:{},...e.autoMergePr?{autoMergePr:!0}:{},...e.allowWorkers===!1?{allowWorkers:!1}:{},...e.allowMessaging===!1?{allowMessaging:!1}:{}}}function Nt(e,t){return t?{...e,notify:!0}:e}function Pt(e){return`/tasks/${e.id}`}var Ft=`inline-flex h-[26px] min-w-0 max-w-full items-center gap-1.5 rounded-full border border-control-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:border-dashed disabled:bg-muted`,It=(0,J.jsx)(k,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-supporting-foreground`}),Lt=(0,L.createContext)(null),Q=e=>Number.parseFloat(e)||0;function Rt({pill:e,box:t,full:n}){let r=getComputedStyle(e),i=[...e.children].filter(e=>{if(e===t)return!1;let n=getComputedStyle(e);return n.display!==`none`&&n.position!==`absolute`});return i.reduce((e,t)=>e+t.getBoundingClientRect().width,0)+Q(r.columnGap)*i.length+n.getBoundingClientRect().width+Q(r.paddingLeft)+Q(r.paddingRight)+Q(r.borderLeftWidth)+Q(r.borderRightWidth)}function zt(e){for(let t=e.parentElement;t;t=t.parentElement){if(t.dataset.slot===`picker-pill-disabled-wrapper`)continue;let e=getComputedStyle(t).display;if(e===`grid`||e===`flex`)return t}return e.parentElement}function Bt(e){let t=new Map;for(let n of e){let e=zt(n.pill),r=t.get(e)??new Map,i=Math.round(n.pill.getBoundingClientRect().top);r.set(i,[...r.get(i)??[],n]),t.set(e,r)}for(let[e,n]of t){let t=getComputedStyle(e),r=e.clientWidth-Q(t.paddingLeft)-Q(t.paddingRight);for(let e of n.values())if(e.reduce((e,t)=>e+Rt(t),0)+Q(t.columnGap)*(e.length-1)>r+.5)return!1}return!0}function Vt({children:e}){let t=(0,L.useRef)(new Map),n=(0,L.useRef)(null),[r,i]=(0,L.useState)(!0),a=(0,L.useCallback)(()=>i(Bt([...t.current.values()])),[]),o=(0,L.useCallback)((e,r)=>{if(t.current.set(e,r),typeof ResizeObserver<`u`){n.current??=new ResizeObserver(a);for(let e of[r.box,r.full,zt(r.pill)])n.current.observe(e)}return a(),()=>{if(t.current.delete(e),typeof ResizeObserver<`u`)for(let e of[r.box,r.full])n.current?.unobserve(e);a()}},[a]);(0,L.useLayoutEffect)(()=>()=>n.current?.disconnect(),[]);let s=(0,L.useMemo)(()=>({register:o,showPrefixes:r}),[o,r]);return(0,J.jsx)(Lt.Provider,{value:s,children:e})}function Ht({field:e,children:t}){let n=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useContext)(Lt),o=a?.register,s=(0,L.useId)(),[c,l]=(0,L.useState)(!0);(0,L.useLayoutEffect)(()=>{let e=n.current,t=i.current;if(o){let n=e.closest(`[data-slot$="pill"]`);return n?o(s,{pill:n,box:e,full:t}):void 0}let r=()=>l(t.getBoundingClientRect().width<=e.getBoundingClientRect().width+.5);if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(e),a.observe(t),()=>a.disconnect()},[e,t,s,o]);let u=a!==null,d=u?a.showPrefixes:c,f=u&&!d;return(0,J.jsxs)(`span`,{ref:n,className:`relative min-w-0 overflow-hidden`,"aria-hidden":`true`,children:[(0,J.jsxs)(`span`,{ref:i,className:r(`invisible w-max whitespace-nowrap`,f?`absolute left-0 top-0`:`block`),children:[e,` · `,t]}),(0,J.jsxs)(`span`,{"data-slot":`picker-label`,className:r(`block truncate`,f?`relative`:`absolute inset-0`),children:[d?(0,J.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,` · `]}):null,t]})]})}function Ut({fieldLabel:e,ariaLabel:t,label:n,options:r,value:i}){return e?`${t} · ${typeof n==`string`?n:r.find(e=>e.value===i)?.label??i}`:t}function Wt({readOnly:e,disabled:t,hint:n,disabledHint:r}){return e?r??n:t?r:n}function Gt({fieldLabel:e,fullLabel:t,explanation:n}){return e?[t,n].filter(Boolean).join(` — `):n}function Kt({icon:e,fieldLabel:t,ariaLabel:n,label:r}){return(0,J.jsxs)(J.Fragment,{children:[e,t?(0,J.jsx)(Ht,{field:n,children:r}):(0,J.jsx)(`span`,{className:`min-w-0 truncate`,title:typeof r==`string`?r:void 0,children:r})]})}function qt({slot:e,ariaLabel:t,label:n,value:i,options:a,onPick:o,disabled:s=!1,readOnly:c=!1,hint:l,disabledHint:u,status:d,searchPlaceholder:f,icon:p,fieldLabel:m=!1}){let[h,g]=(0,L.useState)(!1),[_,v]=(0,L.useState)(``),y=(0,L.useRef)(null),w=(0,L.useRef)(null),T=f?a.filter(e=>e.label.toLowerCase().includes(_.trim().toLowerCase())):a;(0,L.useEffect)(()=>{if(!h||!f)return;let e=window.setTimeout(()=>y.current?.focus());return()=>window.clearTimeout(e)},[h,f]);let E=e=>{y.current&&document.activeElement===y.current&&e.preventDefault()},D=p?` h-11 gap-2 rounded-lg border-border px-3 text-foreground`:``,A=Ut({fieldLabel:m,ariaLabel:t,label:n,options:a,value:i}),j=Gt({fieldLabel:m,fullLabel:A,explanation:Wt({readOnly:c,disabled:s,hint:l,disabledHint:u})}),M=Kt({icon:p,fieldLabel:m,ariaLabel:t,label:n});if(c)return(0,J.jsxs)(`span`,{"data-slot":e,"aria-label":A,title:j,className:r(Ft,D,`cursor-default hover:bg-card hover:text-muted-foreground`),children:[M,m?(0,J.jsx)(`span`,{className:`sr-only`,children:A}):null]});let N=(0,J.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":A,disabled:s,title:j,className:r(Ft,D),children:[M,p?(0,J.jsx)(k,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-muted-foreground`}):It]});return s?(0,J.jsx)(`span`,{"data-slot":`picker-pill-disabled-wrapper`,title:j,className:`inline-flex min-w-0 max-w-full`,children:N}):(0,J.jsxs)(C,{open:h,onOpenChange:e=>{g(e),e||v(``)},children:[(0,J.jsx)(b,{asChild:!0,children:N}),(0,J.jsxs)(x,{ref:w,align:`start`,"data-testid":`${e}-menu`,children:[f?(0,J.jsxs)(`div`,{"data-slot":`picker-search`,className:`mbe-1 flex min-h-11 min-w-56 items-center gap-2 border-b border-border px-2`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,J.jsx)(`input`,{ref:y,type:`search`,"aria-label":f,placeholder:f,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=w.current?.querySelectorAll(`[role="menuitemradio"]:not([data-disabled])`);(e.key===`ArrowDown`?t?.[0]:t?.[t.length-1])?.focus()}else e.key!==`Escape`&&e.stopPropagation()},className:`h-11 w-0 min-w-0 flex-1 bg-transparent text-sm placeholder:text-muted-foreground`})]}):null,(0,J.jsx)(S,{value:i,onValueChange:o,children:T.map(e=>(0,J.jsx)(ee,{value:e.value,className:r(`gap-2.5`,f&&`min-h-11`),onPointerMove:E,onPointerLeave:E,onKeyDown:t=>{y.current&&(t.key===`ArrowUp`&&e===T[0]||t.key===`Tab`&&t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),y.current.focus())},children:(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.label}),e.desc?(0,J.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),f&&T.length===0?(0,J.jsx)(`p`,{role:`status`,className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:`No matches found.`}):null,d?(0,J.jsx)(te,{disabled:!0,onPointerMove:E,onPointerLeave:E,className:`border-t border-border text-[11px] text-muted-foreground`,children:d}):null]})]})}var $=(e,t)=>t===null?e:`${e}:${t}`;function Jt({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o,icon:s,fieldLabel:c}){let l=_t.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:$(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:$(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),u=a??o?.[t]??`default`,d=l.some(e=>e.value===$(t,u))?$(t,u):$(t,null);return(0,J.jsx)(qt,{icon:s,fieldLabel:c,slot:`runner-pill`,ariaLabel:`Runner`,label:l.find(e=>e.value===d)?.label??t,value:d,disabled:r,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:l})}function Yt(){let e=g(),t=_(),n=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),r=t.data?.info?.root;return{accounts:n,repoAccount:r?e.data?.selections?.[r]:void 0}}function Xt(e,t){return e.filter(e=>e.provider===t).length>1}export{it as A,pe as B,Nt as C,rt as D,nt as E,ae as F,se as H,fe as I,he as L,at as M,ct as N,ot as O,ut as P,me as R,Mt as S,mt as T,ge as V,Ot as _,Jt as a,Dt as b,ht as c,jt as d,vt as f,yt as g,gt as h,Vt as i,lt as j,st as k,_t as l,St as m,Yt as n,It as o,wt as p,qt as r,Ft as s,Xt as t,Tt as u,Et as v,dt as w,Pt as x,At as y,le as z};
@@ -1 +1 @@
1
- import{ft as e}from"./live-protocol-BDY7JJpT.js";var t={queries:!1,sse:!1,ws:!1};function n(){return!t.queries&&!t.sse&&!t.ws}function r(){typeof window>`u`||Object.getOwnPropertyDescriptor(window,`__cezIdle`)?.get||Object.defineProperty(window,"__cezIdle",{configurable:!0,enumerable:!1,get:n})}function i(e,n){t[e]=n,r()}var a=!1;function o(e){a=e,!(typeof window>`u`)&&(Object.getOwnPropertyDescriptor(window,`__cezLive`)?.get||Object.defineProperty(window,"__cezLive",{configurable:!0,enumerable:!1,get:()=>a}))}function s(t){let n=0,r=!0;i(`queries`,t.isFetching()>0);let a=t.getQueryCache().subscribe(()=>{let a=++n;i(`queries`,!0),!(t.isFetching()>0)&&e.schedule(()=>{e.schedule(()=>{r&&a===n&&t.isFetching()===0&&i(`queries`,!1)})})});return()=>{r=!1,a(),i(`queries`,!1)}}function c(e){i(`sse`,!0);let t=e().filter(e=>e instanceof Promise);return Promise.allSettled(t).then(()=>i(`sse`,!1))}export{c as i,i as n,o as r,s as t};
1
+ import{lt as e}from"./live-protocol-BVn0UA_g.js";var t={queries:!1,sse:!1,ws:!1};function n(){return!t.queries&&!t.sse&&!t.ws}function r(){typeof window>`u`||Object.getOwnPropertyDescriptor(window,`__cezIdle`)?.get||Object.defineProperty(window,"__cezIdle",{configurable:!0,enumerable:!1,get:n})}function i(e,n){t[e]=n,r()}var a=!1;function o(e){a=e,!(typeof window>`u`)&&(Object.getOwnPropertyDescriptor(window,`__cezLive`)?.get||Object.defineProperty(window,"__cezLive",{configurable:!0,enumerable:!1,get:()=>a}))}function s(t){let n=0,r=!0;i(`queries`,t.isFetching()>0);let a=t.getQueryCache().subscribe(()=>{let a=++n;i(`queries`,!0),!(t.isFetching()>0)&&e.schedule(()=>{e.schedule(()=>{r&&a===n&&t.isFetching()===0&&i(`queries`,!1)})})});return()=>{r=!1,a(),i(`queries`,!1)}}function c(e){i(`sse`,!0);let t=e().filter(e=>e instanceof Promise);return Promise.allSettled(t).then(()=>i(`sse`,!1))}export{c as i,i as n,o as r,s as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./project-scope-context-CaUqlAd7.js";import{M as a,ct as o,r as s}from"./design-icons-DmYTv2r1.js";import{n as c}from"./diff-controls-BR2uqhwG.js";import{u as l}from"./control-locations-CA9TMupq.js";import{t as u}from"./project-router-1m_VlC22.js";import{t as d}from"./centered-state-DGyy0SuA.js";import{K as f,q as p}from"./index-D489J7QW.js";import{t as m}from"./diff-tVGVhYyc.js";var h=e(n(),1),g=r();function _({commit:e,sha:n,backTo:r,backLabel:_,slot:v,className:y,diffClassName:b}){let x=p(),[S,C]=(0,h.useState)(`unified`),[w,T]=(0,h.useState)(!1),E=e.isError&&e.error instanceof i&&e.error.status===409,D=x?S:`unified`,O=!x||w;return(0,g.jsxs)(`section`,{"data-slot":v,"data-sha":n,className:y,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,g.jsx)(t,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,g.jsxs)(u,{to:r,children:[(0,g.jsx)(s,{size:16,"aria-hidden":`true`}),_]})}),e.data?(0,g.jsx)(f,{stat:e.data.stat}):null,(0,g.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,g.jsx)(c,{mode:S,wrap:w,onModeChange:C,onWrapChange:T})})]}),e.isPending?(0,g.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):e.isError?(0,g.jsx)(d,{icon:E?(0,g.jsx)(l,{}):(0,g.jsx)(o,{size:16}),tone:E?`neutral`:`danger`,heading:`h2`,title:E?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,g.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[e.data.author,` · `,e.data.when,` ·`,` `,(0,g.jsx)(`span`,{className:`font-mono select-all`,children:e.data.sha})]})]}),e.data.files.length===0?(0,g.jsx)(d,{icon:(0,g.jsx)(a,{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,g.jsx)(`div`,{className:b,children:(0,g.jsx)(m,{files:e.data.files,mode:D,wrap:O,className:`min-w-0`})})]})]})}export{_ as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./project-scope-context-B3M-u8R0.js";import{M as a,ct as o,r as s}from"./design-icons-DmYTv2r1.js";import{n as c}from"./diff-controls-BR2uqhwG.js";import{u as l}from"./control-locations-C9II3kPz.js";import{t as u}from"./project-router-MMOk9VbW.js";import{t as d}from"./centered-state-DGyy0SuA.js";import{K as f,q as p}from"./index-FoxgrgAH.js";import{t as m}from"./diff-DNAtaTLC.js";var h=e(n(),1),g=r();function _({commit:e,sha:n,backTo:r,backLabel:_,slot:v,className:y,diffClassName:b}){let x=p(),[S,C]=(0,h.useState)(`unified`),[w,T]=(0,h.useState)(!1),E=e.isError&&e.error instanceof i&&e.error.status===409,D=x?S:`unified`,O=!x||w;return(0,g.jsxs)(`section`,{"data-slot":v,"data-sha":n,className:y,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,g.jsx)(t,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,g.jsxs)(u,{to:r,children:[(0,g.jsx)(s,{size:16,"aria-hidden":`true`}),_]})}),e.data?(0,g.jsx)(f,{stat:e.data.stat}):null,(0,g.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,g.jsx)(c,{mode:S,wrap:w,onModeChange:C,onWrapChange:T})})]}),e.isPending?(0,g.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):e.isError?(0,g.jsx)(d,{icon:E?(0,g.jsx)(l,{}):(0,g.jsx)(o,{size:16}),tone:E?`neutral`:`danger`,heading:`h2`,title:E?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,g.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[e.data.author,` · `,e.data.when,` ·`,` `,(0,g.jsx)(`span`,{className:`font-mono select-all`,children:e.data.sha})]})]}),e.data.files.length===0?(0,g.jsx)(d,{icon:(0,g.jsx)(a,{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,g.jsx)(`div`,{className:b,children:(0,g.jsx)(m,{files:e.data.files,mode:D,wrap:O,className:`min-w-0`})})]})]})}export{_ as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,p as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Ln as o,Rn as s,Zt as c,it as l}from"./queries-DYfIpJ-d.js";import{n as u,r as d,t as f}from"./popover-DRcRI46x.js";import{F as p,I as m,N as h,P as g,U as _,_ as v,ct as y,g as b,h as x,m as S,p as C}from"./design-icons-DmYTv2r1.js";import{t as w}from"./createLucideIcon-BHp8sXmF.js";var T=w(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),E=e(i(),1),D=a(),O=(0,E.createContext)(null);function k({children:e}){let[t,n]=(0,E.useState)(()=>new Map),r=(0,E.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,E.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=l((0,E.useMemo)(()=>[...t.values()].flat(),[t])),o=(0,E.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,D.jsx)(O.Provider,{value:o,children:e})}var A=(0,E.createContext)(null);function j({projectId:e,repoBase:t,requests:n,children:r}){let i=(0,E.useContext)(O),a=(0,E.useContext)(A),o=(0,E.useId)();(0,E.useEffect)(()=>{if(i)return i.publish(o,n),()=>i.retract(o)},[i,o,n.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`)]);let s=l(i?M:n),c=i?.lookup??s,u=t??(a&&a.projectId===e?a.repoBase:void 0),d=(0,E.useMemo)(()=>({lookup:c,projectId:e,repoBase:u}),[c,e,u]);return(0,D.jsx)(A.Provider,{value:d,children:r})}var M=[];function N(e,t,n){let r=(0,E.useContext)(A),i=n??r?.projectId;return!r||!i||t===void 0?te:r.lookup({projectId:i,kind:e,number:t})}function ee(e,t){let n=(0,E.useContext)(A),r=t??n?.projectId;return!n||!r?[]:e.filter(e=>n.lookup({projectId:r,kind:`PR`,number:e}).conflicting===!0)}function P(){let e=(0,E.useContext)(A);return{projectId:e?.projectId,repoBase:e?.repoBase}}var te=Object.freeze({state:`idle`}),F={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,accent:`border-accent-strong/35 text-accent-text`,merged:`border-merged-strong/35 text-merged-text`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},I={success:`text-success`,danger:`text-danger`,accent:`text-merged-text`,merged:`text-merged-text`,info:`text-info`,neutral:`text-soft-foreground`,pending:`text-pending-strong`,conflict:`text-conflict`},ne={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,accent:`hover:bg-accent-strong/10`,merged:`hover:bg-merged-strong/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},re={draft:p,"review-required":m,"changes-requested":_,"checks-pending":null,"checks-failing":v,ready:C,merged:h,closed:g,open:S,completed:C,"not-planned":b};function L(e){return e===`PR`?`pr-chip`:`issue-chip`}function R(e){return e?{"data-conflicting":`true`}:{}}function z(e,t,n,r){return!n||r!==void 0&&c({kind:e,number:t??0,url:n},r)}function B(e,t,n){return e===`PR`&&(t??n)===!0}function V({plain:e,inert:t,conflicting:n,className:i,tone:a}){return e?r(`inline-flex items-center gap-1 rounded-[2px] text-inherit`,n&&`text-conflict font-medium`,!t&&`group/reference focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground`,i):r(`inline-flex h-[22px] items-center gap-1 rounded-md border px-1.5 font-mono text-[12px] font-normal`,F[a],i)}function H(e,t,n,r){return n&&!r?t?`${e===`PR`?`PR `:``}#${t}`:e:t?`${!r&&e===`Issue`?`Issue `:``}#${t}`:e}function U(e){return e===`PR`?`pull request`:`issue`}function W(e,t,n,r){return`Open the ${e}${t?` #${t}`:``} for ${n}${r?` — ${r.label}`:``}`}function G(e,t){return e&&t?I[t.tone]:void 0}function K(e,n){return!e&&(!n||!t(n))}function q({conflicting:e,presentation:t,status:n,plain:i,compact:a,inert:o,kind:s,label:c,glyphClass:l}){return(0,D.jsxs)(D.Fragment,{children:[e?(0,D.jsx)(y,{className:r(`size-2.5 shrink-0`,l),"aria-hidden":`true`}):(0,D.jsx)($,{status:t?n:void 0,className:i?r(`size-2.5`,l):void 0}),i&&a?s===`PR`?(0,D.jsx)(m,{"data-slot":`reference-kind`,className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,D.jsx)(S,{"data-slot":`reference-kind`,className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null,i?(0,D.jsx)(`span`,{className:o?void 0:`underline-offset-2 group-hover/reference:underline group-focus-visible/reference:underline`,children:c}):c]})}function J({kind:e,status:t,conflicting:n,chipClass:r,body:i}){return(0,D.jsx)(`span`,{"data-slot":L(e),"data-status":t,"data-inert":`true`,...R(n),className:r,children:i})}function Y({kind:e,number:n,tooltip:r,url:i}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`block font-medium`,children:[e===`PR`?`Pull request`:`Issue`,n?` #${n}`:``,` · `,r.headline]}),(0,D.jsx)(`span`,{className:`block`,children:r.detail}),r.also?(0,D.jsx)(`span`,{className:`block opacity-70`,children:r.also}):null,i&&t(i)?(0,D.jsx)(`span`,{className:`block opacity-70`,children:i.replace(/^https?:\/\//,``)}):null]})}function ie({reference:e,taskTitle:t,status:n,conflicting:i,conflictAction:a,projectId:c,repoBase:l,to:u,className:d,compact:f=!1,plain:p=!1,inert:m=!1}){let{kind:h,number:g,url:_}=e,v=P(),y=N(h,z(h,g,_,l??v.repoBase)?g:void 0,c),b=n??y.status,x=s(b),S=B(h,i,y.conflicting),C=S?o:x,w=C?.tone??`accent`,T=V({plain:p,inert:m,conflicting:S,className:d,tone:w}),E=le(y,C,S?x:void 0),O=H(h,g,p,f),k=U(h),A=W(k,g,t,C),j=(0,D.jsx)(q,{conflicting:S,presentation:C,status:b,plain:p,compact:f,inert:m,kind:h,label:O,glyphClass:G(p,C)});if(m)return(0,D.jsx)(J,{kind:h,status:b,conflicting:S,chipClass:T,body:j});let M=K(u,_)?(0,D.jsx)(`span`,{"data-slot":L(h),"data-status":b,...R(S),"aria-label":C?`${k} ${O} — ${C.label}`:void 0,className:T,children:j}):(0,D.jsx)(ae,{to:u,url:_,"data-slot":L(h),"data-status":b,...R(S),title:E?void 0:_,"aria-label":A,className:p?T:r(T,ne[w]),children:j});return E?(0,D.jsx)(ce,{chip:M,action:S?a:void 0,state:y.state,children:(0,D.jsx)(Y,{kind:h,number:g,tooltip:E,url:_})}):M}function ae({to:e,url:t,children:r,...i}){return e?(0,D.jsx)(n,{to:e,...i,children:r}):(0,D.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,...i,children:r})}var X=(0,E.createContext)(()=>{});function oe(){return(0,E.useContext)(X)}var se=150,Z=120;function ce({chip:e,action:t,state:n,children:r}){let[i,a]=(0,E.useState)(!1),o=(0,E.useRef)(null),s=(0,E.useRef)(null),c=(0,E.useRef)(void 0),l=(0,E.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),p=(0,E.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,E.useEffect)(()=>()=>clearTimeout(c.current),[]);let m=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,D.jsxs)(f,{open:i,onOpenChange:e=>e?a(!0):p(),children:[(0,D.jsx)(u,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,se)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,Z)},onFocus:()=>a(!0),onBlur:e=>{m(e.relatedTarget)||p()},onKeyDown:e=>{if(e.key===`Escape`)return p();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,D.jsxs)(d,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),m(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,Z)},children:[(0,D.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,D.jsx)(X.Provider,{value:p,children:t}):null]})]})}function le(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${ue(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function ue(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Q({kind:e,number:t,className:n}){let i=N(e,t),a=s(i.status),c=e===`PR`&&i.conflicting===!0,l=c?o:a;if(!l)return null;let u=r(`size-2.5`,I[l.tone]);return(0,D.jsx)(`span`,{"data-slot":`reference-status-glyph`,"data-status":i.status,...c?{"data-conflicting":`true`}:{},"aria-hidden":`true`,className:r(`inline-flex items-center`,n),children:c?(0,D.jsx)(y,{className:r(`shrink-0`,u),"aria-hidden":`true`}):(0,D.jsx)($,{status:i.status,className:u})})}function $({status:e,className:t}){if(!e)return null;if(e===`checks-pending`)return(0,D.jsx)(x,{"data-slot":`status-dot`,"data-tone":`pending`,className:r(`size-3 animate-pulse motion-reduce:animate-none`,t),"aria-hidden":`true`});let n=re[e];return n?(0,D.jsx)(n,{className:r(`size-2.5 shrink-0`,t),"aria-hidden":`true`}):null}var de={general:[`Settings`,`General`],webhooks:[`Settings`,`General`,`Webhooks`],providers:[`Settings`,`Agents`,`Providers`],projects:[`Settings`,`Projects`],worktrees:[`Settings`,`Worktrees`],sidebar:[`Settings`,`Sidebar`]};function fe(e,t=` → `){return de[e].join(t)}export{j as a,P as c,oe as i,N as l,ie as n,k as o,Q as r,ee as s,fe as t,T as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,p as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Ln as o,Rn as s,Zt as c,it as l}from"./queries-DORTKwyN.js";import{n as u,r as d,t as f}from"./popover-DRcRI46x.js";import{F as p,I as m,N as h,P as g,U as _,_ as v,ct as y,g as b,h as x,m as S,p as C}from"./design-icons-DmYTv2r1.js";import{t as w}from"./createLucideIcon-BHp8sXmF.js";var T=w(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),E=e(i(),1),D=a(),O=(0,E.createContext)(null);function k({children:e}){let[t,n]=(0,E.useState)(()=>new Map),r=(0,E.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,E.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=l((0,E.useMemo)(()=>[...t.values()].flat(),[t])),o=(0,E.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,D.jsx)(O.Provider,{value:o,children:e})}var A=(0,E.createContext)(null);function j({projectId:e,repoBase:t,requests:n,children:r}){let i=(0,E.useContext)(O),a=(0,E.useContext)(A),o=(0,E.useId)();(0,E.useEffect)(()=>{if(i)return i.publish(o,n),()=>i.retract(o)},[i,o,n.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`)]);let s=l(i?M:n),c=i?.lookup??s,u=t??(a&&a.projectId===e?a.repoBase:void 0),d=(0,E.useMemo)(()=>({lookup:c,projectId:e,repoBase:u}),[c,e,u]);return(0,D.jsx)(A.Provider,{value:d,children:r})}var M=[];function N(e,t,n){let r=(0,E.useContext)(A),i=n??r?.projectId;return!r||!i||t===void 0?te:r.lookup({projectId:i,kind:e,number:t})}function ee(e,t){let n=(0,E.useContext)(A),r=t??n?.projectId;return!n||!r?[]:e.filter(e=>n.lookup({projectId:r,kind:`PR`,number:e}).conflicting===!0)}function P(){let e=(0,E.useContext)(A);return{projectId:e?.projectId,repoBase:e?.repoBase}}var te=Object.freeze({state:`idle`}),F={success:`border-success/40 text-success`,danger:`border-danger/40 text-danger`,accent:`border-accent-strong/35 text-accent-text`,merged:`border-merged-strong/35 text-merged-text`,info:`border-info/40 text-info`,neutral:`border-border text-muted-foreground`,pending:`border-pending-strong/45 text-pending-strong`,conflict:`border-conflict/45 text-conflict`},I={success:`text-success`,danger:`text-danger`,accent:`text-merged-text`,merged:`text-merged-text`,info:`text-info`,neutral:`text-soft-foreground`,pending:`text-pending-strong`,conflict:`text-conflict`},ne={success:`hover:bg-success/10`,danger:`hover:bg-danger/10`,accent:`hover:bg-accent-strong/10`,merged:`hover:bg-merged-strong/10`,info:`hover:bg-info/10`,neutral:`hover:bg-muted`,pending:`hover:bg-pending-strong/10`,conflict:`hover:bg-conflict/10`},re={draft:p,"review-required":m,"changes-requested":_,"checks-pending":null,"checks-failing":v,ready:C,merged:h,closed:g,open:S,completed:C,"not-planned":b};function L(e){return e===`PR`?`pr-chip`:`issue-chip`}function R(e){return e?{"data-conflicting":`true`}:{}}function z(e,t,n,r){return!n||r!==void 0&&c({kind:e,number:t??0,url:n},r)}function B(e,t,n){return e===`PR`&&(t??n)===!0}function V({plain:e,inert:t,conflicting:n,className:i,tone:a}){return e?r(`inline-flex items-center gap-1 rounded-[2px] text-inherit`,n&&`text-conflict font-medium`,!t&&`group/reference focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground`,i):r(`inline-flex h-[22px] items-center gap-1 rounded-md border px-1.5 font-mono text-[12px] font-normal`,F[a],i)}function H(e,t,n,r){return n&&!r?t?`${e===`PR`?`PR `:``}#${t}`:e:t?`${!r&&e===`Issue`?`Issue `:``}#${t}`:e}function U(e){return e===`PR`?`pull request`:`issue`}function W(e,t,n,r){return`Open the ${e}${t?` #${t}`:``} for ${n}${r?` — ${r.label}`:``}`}function G(e,t){return e&&t?I[t.tone]:void 0}function K(e,n){return!e&&(!n||!t(n))}function q({conflicting:e,presentation:t,status:n,plain:i,compact:a,inert:o,kind:s,label:c,glyphClass:l}){return(0,D.jsxs)(D.Fragment,{children:[e?(0,D.jsx)(y,{className:r(`size-2.5 shrink-0`,l),"aria-hidden":`true`}):(0,D.jsx)($,{status:t?n:void 0,className:i?r(`size-2.5`,l):void 0}),i&&a?s===`PR`?(0,D.jsx)(m,{"data-slot":`reference-kind`,className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,D.jsx)(S,{"data-slot":`reference-kind`,className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null,i?(0,D.jsx)(`span`,{className:o?void 0:`underline-offset-2 group-hover/reference:underline group-focus-visible/reference:underline`,children:c}):c]})}function J({kind:e,status:t,conflicting:n,chipClass:r,body:i}){return(0,D.jsx)(`span`,{"data-slot":L(e),"data-status":t,"data-inert":`true`,...R(n),className:r,children:i})}function Y({kind:e,number:n,tooltip:r,url:i}){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`block font-medium`,children:[e===`PR`?`Pull request`:`Issue`,n?` #${n}`:``,` · `,r.headline]}),(0,D.jsx)(`span`,{className:`block`,children:r.detail}),r.also?(0,D.jsx)(`span`,{className:`block opacity-70`,children:r.also}):null,i&&t(i)?(0,D.jsx)(`span`,{className:`block opacity-70`,children:i.replace(/^https?:\/\//,``)}):null]})}function ie({reference:e,taskTitle:t,status:n,conflicting:i,conflictAction:a,projectId:c,repoBase:l,to:u,className:d,compact:f=!1,plain:p=!1,inert:m=!1}){let{kind:h,number:g,url:_}=e,v=P(),y=N(h,z(h,g,_,l??v.repoBase)?g:void 0,c),b=n??y.status,x=s(b),S=B(h,i,y.conflicting),C=S?o:x,w=C?.tone??`accent`,T=V({plain:p,inert:m,conflicting:S,className:d,tone:w}),E=le(y,C,S?x:void 0),O=H(h,g,p,f),k=U(h),A=W(k,g,t,C),j=(0,D.jsx)(q,{conflicting:S,presentation:C,status:b,plain:p,compact:f,inert:m,kind:h,label:O,glyphClass:G(p,C)});if(m)return(0,D.jsx)(J,{kind:h,status:b,conflicting:S,chipClass:T,body:j});let M=K(u,_)?(0,D.jsx)(`span`,{"data-slot":L(h),"data-status":b,...R(S),"aria-label":C?`${k} ${O} — ${C.label}`:void 0,className:T,children:j}):(0,D.jsx)(ae,{to:u,url:_,"data-slot":L(h),"data-status":b,...R(S),title:E?void 0:_,"aria-label":A,className:p?T:r(T,ne[w]),children:j});return E?(0,D.jsx)(ce,{chip:M,action:S?a:void 0,state:y.state,children:(0,D.jsx)(Y,{kind:h,number:g,tooltip:E,url:_})}):M}function ae({to:e,url:t,children:r,...i}){return e?(0,D.jsx)(n,{to:e,...i,children:r}):(0,D.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,...i,children:r})}var X=(0,E.createContext)(()=>{});function oe(){return(0,E.useContext)(X)}var se=150,Z=120;function ce({chip:e,action:t,state:n,children:r}){let[i,a]=(0,E.useState)(!1),o=(0,E.useRef)(null),s=(0,E.useRef)(null),c=(0,E.useRef)(void 0),l=(0,E.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),p=(0,E.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,E.useEffect)(()=>()=>clearTimeout(c.current),[]);let m=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,D.jsxs)(f,{open:i,onOpenChange:e=>e?a(!0):p(),children:[(0,D.jsx)(u,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,se)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,Z)},onFocus:()=>a(!0),onBlur:e=>{m(e.relatedTarget)||p()},onKeyDown:e=>{if(e.key===`Escape`)return p();if(e.key!==`Tab`||e.shiftKey||!t)return;let n=s.current?.querySelector(`button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);n&&(e.preventDefault(),n.focus())},...t?{"aria-haspopup":`dialog`,"aria-expanded":i}:{},children:e}),(0,D.jsxs)(d,{ref:s,side:`top`,role:t?`dialog`:`tooltip`,"data-slot":`reference-status-card`,"data-tooltip-state":n,className:`w-64 space-y-2 p-3 text-xs`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),m(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,Z)},children:[(0,D.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,D.jsx)(X.Provider,{value:p,children:t}):null]})]})}function le(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${ue(n.label)} — ${n.hint}`:void 0;return e.state===`unavailable`?{headline:r,detail:`last known — GitHub is unreachable${e.reason?` (${e.reason})`:``}`,...a?{also:a}:{}}:{headline:r,detail:i,...a?{also:a}:{}}}switch(e.state){case`loading`:return{headline:`Checking GitHub…`,detail:`the status of this reference is on its way`};case`unavailable`:return{headline:`Status unavailable`,detail:e.reason??`GitHub could not be reached — the chip says nothing rather than guessing`};case`unknown`:return{headline:`Not found on this repository`,detail:`GitHub has no such number here — the reference may point at another repo`};default:return null}}function ue(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Q({kind:e,number:t,className:n}){let i=N(e,t),a=s(i.status),c=e===`PR`&&i.conflicting===!0,l=c?o:a;if(!l)return null;let u=r(`size-2.5`,I[l.tone]);return(0,D.jsx)(`span`,{"data-slot":`reference-status-glyph`,"data-status":i.status,...c?{"data-conflicting":`true`}:{},"aria-hidden":`true`,className:r(`inline-flex items-center`,n),children:c?(0,D.jsx)(y,{className:r(`shrink-0`,u),"aria-hidden":`true`}):(0,D.jsx)($,{status:i.status,className:u})})}function $({status:e,className:t}){if(!e)return null;if(e===`checks-pending`)return(0,D.jsx)(x,{"data-slot":`status-dot`,"data-tone":`pending`,className:r(`size-3 animate-pulse motion-reduce:animate-none`,t),"aria-hidden":`true`});let n=re[e];return n?(0,D.jsx)(n,{className:r(`size-2.5 shrink-0`,t),"aria-hidden":`true`}):null}var de={general:[`Settings`,`General`],webhooks:[`Settings`,`General`,`Webhooks`],providers:[`Settings`,`Agents`,`Providers`],projects:[`Settings`,`Projects`],worktrees:[`Settings`,`Worktrees`],sidebar:[`Settings`,`Sidebar`]};function fe(e,t=` → `){return de[e].join(t)}export{j as a,P as c,oe as i,N as l,ie as n,k as o,Q as r,ee as s,fe as t,T as u};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-CNM3u77o.js","assets/rolldown-runtime-QTnfLwEv.js","assets/button-CHUAMTHK.js","assets/react-runtime-CCIEwYL0.js","assets/bundle-mjs-BT31bpU6.js","assets/eye-B8okNWXU.js","assets/createLucideIcon-BHp8sXmF.js","assets/markdown-D7DUNWcJ.js","assets/alert-dialog-Dj464rjk.js","assets/es2015-D345RR4o.js","assets/chunk-BO2N2NFS-DE6qKn3r.js","assets/lib-BxQXEXDF.js","assets/index-D489J7QW.js","assets/live-refetch-C0kQc3-z.js","assets/project-scope-context-CaUqlAd7.js","assets/live-protocol-BDY7JJpT.js","assets/useInfiniteQuery-qEY8OhKb.js","assets/queries-DYfIpJ-d.js","assets/useQuery-DOJQOEBO.js","assets/ws-DvGmrP4z.js","assets/toaster-B1MyeHiE.js","assets/cez-idle-BT0U4GN_.js","assets/dropdown-menu-DhrBcVgr.js","assets/design-icons-DmYTv2r1.js","assets/github-sidebar-model-Ct0DltOv.js","assets/popover-DRcRI46x.js","assets/textarea-DlVUfdWG.js","assets/project-router-1m_VlC22.js","assets/agent-accounts-BCg-578Q.js","assets/skills-DFBiAuJG.js","assets/skills-workflows-C21NystW.css","assets/loader-circle-CZkGEdoI.js","assets/nav-row-styles-BZUUavOF.js","assets/control-locations-CA9TMupq.js","assets/centered-state-DGyy0SuA.js","assets/sortable.esm-zp_qkYGV.js","assets/index-B18AqW0Z.css","assets/image-preview-Cq1vDiEo.js","assets/zoomable-image-5pOUaPEg.js","assets/markdown-BBDDg-4t.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{K as a}from"./index-D489J7QW.js";import{n as o,t as s}from"./image-preview-Cq1vDiEo.js";var c=e(n(),1),l=r();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-CNM3u77o.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:n=!1,imageSrc:r,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:t(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:n,imageSrc:r,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:n,imageSrc:r,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:r,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:t(`py-2 font-mono text-xs leading-[1.7]`,n?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view---8Bt-0a.js","assets/rolldown-runtime-QTnfLwEv.js","assets/button-CHUAMTHK.js","assets/react-runtime-CCIEwYL0.js","assets/bundle-mjs-BT31bpU6.js","assets/eye-B8okNWXU.js","assets/createLucideIcon-BHp8sXmF.js","assets/markdown-D7DUNWcJ.js","assets/alert-dialog-Dj464rjk.js","assets/es2015-D345RR4o.js","assets/chunk-BO2N2NFS-DE6qKn3r.js","assets/lib-BxQXEXDF.js","assets/index-FoxgrgAH.js","assets/live-refetch-BdnmTJ_8.js","assets/project-scope-context-B3M-u8R0.js","assets/live-protocol-BVn0UA_g.js","assets/useInfiniteQuery-BbYMWe23.js","assets/queries-DORTKwyN.js","assets/useQuery-CqqnAJvu.js","assets/ws-BtSVmivO.js","assets/toaster-B1MyeHiE.js","assets/cez-idle-EVoUsgU3.js","assets/dropdown-menu-DhrBcVgr.js","assets/design-icons-DmYTv2r1.js","assets/github-sidebar-model-B0Ufci5S.js","assets/popover-DRcRI46x.js","assets/textarea-DlVUfdWG.js","assets/project-router-MMOk9VbW.js","assets/agent-accounts-f1cxwgfz.js","assets/skills-DFBiAuJG.js","assets/skills-workflows-C21NystW.css","assets/loader-circle-CZkGEdoI.js","assets/nav-row-styles-BZUUavOF.js","assets/control-locations-C9II3kPz.js","assets/centered-state-DGyy0SuA.js","assets/sortable.esm-zp_qkYGV.js","assets/index-B18AqW0Z.css","assets/image-preview-Cq1vDiEo.js","assets/zoomable-image-5pOUaPEg.js","assets/markdown-BBDDg-4t.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{K as a}from"./index-FoxgrgAH.js";import{n as o,t as s}from"./image-preview-Cq1vDiEo.js";var c=e(n(),1),l=r();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view---8Bt-0a.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:n=!1,imageSrc:r,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:t(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:n,imageSrc:r,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:n,imageSrc:r,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:r,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:t(`py-2 font-mono text-xs leading-[1.7]`,n?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
3
3
  `).map((e,n)=>(0,l.jsxs)(`span`,{className:t(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},n))})]})}export{u as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{t as i}from"./eye-B8okNWXU.js";import{h as a,m as o,p as s,t as c}from"./markdown-D7DUNWcJ.js";import{K as l,X as u,Xt as d}from"./index-D489J7QW.js";import{n as f,t as p}from"./image-preview-Cq1vDiEo.js";import{n as m,t as h}from"./markdown-BBDDg-4t.js";var g=e(n(),1),_=44;function v(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-CHUAMTHK.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{t as i}from"./eye-B8okNWXU.js";import{h as a,m as o,p as s,t as c}from"./markdown-D7DUNWcJ.js";import{K as l,X as u,Xt as d}from"./index-FoxgrgAH.js";import{n as f,t as p}from"./image-preview-Cq1vDiEo.js";import{n as m,t as h}from"./markdown-BBDDg-4t.js";var g=e(n(),1),_=44;function v(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
2
2
  `),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function y(e){return v(e)*20+_}function b(e){return e.reduce((e,t)=>e+v(t),0)}function x(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function S(e){return`${e.oldPath??``}→${e.path}`}function C(e){let t=0;for(let n of e.split(`
3
3
  `))n.length>t&&(t=n.length);return t}var w=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,T=300,E=.3;function D(e,t){if(e===t)return null;let n=e.match(w)??[],r=t.match(w)??[];if(n.length===0||r.length===0||n.length>T||r.length>T)return null;let i=O(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<E?null:k(n,r,i)}function O(e,t){let n=t.length+1,r=new Uint16Array((e.length+1)*n);for(let i=1;i<=e.length;i++)for(let a=1;a<=t.length;a++)r[i*n+a]=e[i-1]===t[a-1]?(r[(i-1)*n+(a-1)]??0)+1:Math.max(r[(i-1)*n+a]??0,r[i*n+(a-1)]??0);return r}function k(e,t,n){let r=t.length+1,i=Array.from({length:e.length},()=>!1),a=Array.from({length:t.length},()=>!1),o=e.length,s=t.length;for(;o>0&&s>0;)e[o-1]===t[s-1]?(i[o-1]=!0,a[s-1]=!0,o--,s--):(n[(o-1)*r+s]??0)>=(n[o*r+(s-1)]??0)?o--:s--;return{del:A(e,i),add:A(t,a)}}function A(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function j(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var M=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,N=`… (patch truncated)`;function P(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
4
4
  `);o.at(-1)===``&&o.pop();for(let e of o){let o=M.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(N)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function F(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function I(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function L(e,t){let n=Array.from({length:e.length}),r=Array.from({length:t.length}),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=D(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function R(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(L(t,i))}else t(i),r++}}function z(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),R(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function B(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),R(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var V=r();function H({file:e,loadFileText:t,imageSrc:n}){let r=(0,g.useMemo)(()=>U(e),[e]),i=(0,g.useRef)(t);i.current=t;let a=(0,g.useRef)(n);a.current=n;let o=t!==void 0,[s,l]=(0,g.useState)(null);(0,g.useEffect)(()=>{let t=i.current;if(!t)return;let n=!1;return t(e.path).then(t=>!n&&l({path:e.path,text:t}),()=>!n&&l({path:e.path,text:null})),()=>{n=!0}},[e.path,e.patch,o]);let u=(0,g.useCallback)(t=>{let n=a.current,r=n?m(e.path,t):null;return r===null||!n?null:n(r)},[e.path]),d=s?.path===e.path?s:null;if(o&&d===null)return(0,V.jsx)(`p`,{role:`status`,className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Loading preview…`});let f=d?.text??null;if(f===null&&r.text===``)return(0,V.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes to preview.`});let p=f!==null||r.complete?null:o?`The full file could not be loaded. Showing the changed sections only.`:`Showing the changed sections only.`;return(0,V.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,V.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[p?(0,V.jsx)(`p`,{className:`mb-4 text-xs text-soft-foreground`,children:p}):null,(0,V.jsx)(c,{document:!0,imageSrc:u,children:f??r.text})]})})}function U(e){let t=P(e.patch);return{text:t.hunks.map(e=>e.lines.filter(e=>e.kind!==`del`).map(e=>e.text).join(`
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,u as n,w as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,vn as s}from"./project-scope-context-CaUqlAd7.js";import{xt as c}from"./queries-DYfIpJ-d.js";import{T as l,ct as u}from"./design-icons-DmYTv2r1.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{t as f}from"./centered-state-DGyy0SuA.js";import{a as p,c as m,d as h,h as g,l as _,m as v,n as y,o as b,p as x,s as S,t as C,u as w}from"./markdown-D7DUNWcJ.js";var T=d(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=d(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=e(i(),1),k=a(),A=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function j(e){let t=A.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var M={};function N(e){let t=(0,O.useMemo)(()=>w(e),[e]).join(` `),[n,r]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return h(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:M}function P({html:e,title:t,fragment:r,className:i}){let a=N(e);return a?(0,k.jsx)(F,{html:e,title:t,fragment:r,className:i,libraries:a}):(0,k.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:n(`flex min-h-0 flex-col`,i)})}function F({html:e,title:t,fragment:r,className:i,libraries:a}){let{srcdoc:o,blocked:s}=(0,O.useMemo)(()=>{let n=m(e,a);return{srcdoc:_(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{r&&/^#\S+$/.test(r)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${r}`)},l=j(s);return(0,k.jsxs)(`div`,{"data-slot":`html-report`,className:n(`flex min-h-0 flex-col`,i),children:[l?(0,k.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,k.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:b,allow:p,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var I=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function L(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:I.has(t.slice(n+1).toLowerCase())}function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return L(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function z(e){return e.tooLarge?`too-large`:R(e.path)?`image`:e.binary?`binary`:`text`}function B(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function V({runId:e,path:t,className:n}){let r=c(e,t??void 0);if(t===null)return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(l,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,k.jsx)(K,{className:n,children:(0,k.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof o&&r.error.status===409;return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:e?(0,k.jsx)(D,{}):(0,k.jsx)(u,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,k.jsx)(H,{runId:e,entry:r.data,className:n}):(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function H({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,readerHref:o,documentPreview:s=!1}){let[c,l]=(0,O.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=s&&S(t.path),f=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),p=s&&f&&t.size<=10*1024*1024?`image`:z(t),m=(u||d)&&p===`text`;return(0,k.jsxs)(K,{className:n,children:[(0,k.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:B(t.size)})]}),a||i||m?(0,k.jsx)(W,{snapshot:a,downloadUrl:i,source:m?c:null,onSource:()=>l(e=>!e),readerHref:d&&p===`text`?o:void 0}):null,(0,k.jsx)(U,{runId:e,entry:t,kind:p,showImage:p===`image`&&(!s||f),rendered:c?null:u?`markdown`:d?`html`:null,imageUrl:r})]})}function U({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a}){return r?(0,k.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,k.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??s(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,k.jsx)(f,{icon:(0,k.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${B(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${B(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(C,{document:!0,children:t.content??``})}):i===`html`?(0,k.jsx)(P,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,k.jsx)(Y,{path:t.path,text:t.content??``})}function W({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,k.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,k.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,k.jsx)(G,{href:i}):null]})}function G({href:e}){let n=r(),i=t();return(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:t=>y(t,n,e,i),children:`Open reader`})}function K({className:e,children:t}){return(0,k.jsx)(`section`,{"data-slot":`file-preview`,className:n(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var q=1500;function J(e,t){let n=(0,O.useMemo)(()=>t.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,u as n,w as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,vn as s}from"./project-scope-context-B3M-u8R0.js";import{xt as c}from"./queries-DORTKwyN.js";import{T as l,ct as u}from"./design-icons-DmYTv2r1.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{t as f}from"./centered-state-DGyy0SuA.js";import{a as p,c as m,d as h,h as g,l as _,m as v,n as y,o as b,p as x,s as S,t as C,u as w}from"./markdown-D7DUNWcJ.js";var T=d(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=d(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=e(i(),1),k=a(),A=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function j(e){let t=A.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var M={};function N(e){let t=(0,O.useMemo)(()=>w(e),[e]).join(` `),[n,r]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return h(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:M}function P({html:e,title:t,fragment:r,className:i}){let a=N(e);return a?(0,k.jsx)(F,{html:e,title:t,fragment:r,className:i,libraries:a}):(0,k.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:n(`flex min-h-0 flex-col`,i)})}function F({html:e,title:t,fragment:r,className:i,libraries:a}){let{srcdoc:o,blocked:s}=(0,O.useMemo)(()=>{let n=m(e,a);return{srcdoc:_(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{r&&/^#\S+$/.test(r)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${r}`)},l=j(s);return(0,k.jsxs)(`div`,{"data-slot":`html-report`,className:n(`flex min-h-0 flex-col`,i),children:[l?(0,k.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,k.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:b,allow:p,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var I=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function L(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:I.has(t.slice(n+1).toLowerCase())}function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return L(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function z(e){return e.tooLarge?`too-large`:R(e.path)?`image`:e.binary?`binary`:`text`}function B(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function V({runId:e,path:t,className:n}){let r=c(e,t??void 0);if(t===null)return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(l,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,k.jsx)(K,{className:n,children:(0,k.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof o&&r.error.status===409;return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:e?(0,k.jsx)(D,{}):(0,k.jsx)(u,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,k.jsx)(H,{runId:e,entry:r.data,className:n}):(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function H({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,readerHref:o,documentPreview:s=!1}){let[c,l]=(0,O.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=s&&S(t.path),f=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),p=s&&f&&t.size<=10*1024*1024?`image`:z(t),m=(u||d)&&p===`text`;return(0,k.jsxs)(K,{className:n,children:[(0,k.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:B(t.size)})]}),a||i||m?(0,k.jsx)(W,{snapshot:a,downloadUrl:i,source:m?c:null,onSource:()=>l(e=>!e),readerHref:d&&p===`text`?o:void 0}):null,(0,k.jsx)(U,{runId:e,entry:t,kind:p,showImage:p===`image`&&(!s||f),rendered:c?null:u?`markdown`:d?`html`:null,imageUrl:r})]})}function U({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a}){return r?(0,k.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,k.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??s(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,k.jsx)(f,{icon:(0,k.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${B(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${B(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(C,{document:!0,children:t.content??``})}):i===`html`?(0,k.jsx)(P,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,k.jsx)(Y,{path:t.path,text:t.content??``})}function W({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,k.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,k.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,k.jsx)(G,{href:i}):null]})}function G({href:e}){let n=r(),i=t();return(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:t=>y(t,n,e,i),children:`Open reader`})}function K({className:e,children:t}){return(0,k.jsx)(`section`,{"data-slot":`file-preview`,className:n(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var q=1500;function J(e,t){let n=(0,O.useMemo)(()=>t.split(`
2
2
  `).map(e=>[{content:e}]),[t]),r=(0,O.useMemo)(()=>g(e),[e]),i=n.length>q,[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(r===null||i)return;let n=!1;return x(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:v(t,r)?.tokens??n}function Y({path:e,text:t}){let n=J(e,t);return(0,k.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":g(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,k.jsxs)(`div`,{className:`flex px-4`,children:[(0,k.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,k.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}export{R as a,E as c,B as i,T as l,H as n,P as o,V as r,D as s,Y as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,t as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,p as s,r as c,t as l}from"./dropdown-menu-DhrBcVgr.js";import{s as u}from"./popover-DRcRI46x.js";import{E as d,I as f,M as p,d as m,lt as h}from"./design-icons-DmYTv2r1.js";import{t as g}from"./createLucideIcon-BHp8sXmF.js";import{n as _,r as v,t as y}from"./diff-controls-BR2uqhwG.js";import{K as b,Lt as x}from"./index-D489J7QW.js";var S=g(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),C=g(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),w=e(i(),1),T=a();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:i}){let[a,o]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 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+t*14}px`},children:[(0,T.jsx)(m,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,T.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),a?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>i(e.path),className:r(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,healthReady:t,branch:i,stat:a,mode:u,wrap:d,preview:f=!1,onModeChange:p,onWrapChange:m,onPreviewChange:h,onAction:g}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[i?(0,T.jsx)(y,{branch:i}):null,a?(0,T.jsx)(R,{stat:a}):null,h?(0,T.jsx)(`span`,{className:`ml-auto flex items-center`,children:(0,T.jsx)(v,{preview:f,onPreviewChange:h})}):null,(0,T.jsxs)(`span`,{className:r(`flex items-center gap-1`,h?`max-md:ml-auto`:`ml-auto`),children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(_,{mode:u,wrap:d,onModeChange:p,onWrapChange:m})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:g},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:g}),e.menu.length>0?(0,T.jsxs)(l,{children:[(0,T.jsx)(s,{asChild:!0,children:(0,T.jsx)(n,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(S,{"aria-hidden":`true`})})}),(0,T.jsx)(c,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(o,{disabled:!e.enabled,title:e.reason,onSelect:()=>g(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(p,{size:16,"aria-hidden":`true`}),push:(0,T.jsx)(h,{size:16,"aria-hidden":`true`}),"create-pr":(0,T.jsx)(f,{size:16,"aria-hidden":`true`}),"view-pr":(0,T.jsx)(u,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(x,{"aria-hidden":`true`})};function L({action:e,variant:r,onAction:i}){return e.id===`view-pr`?t(e.href)?(0,T.jsx)(n,{asChild:!0,variant:r,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>i(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(b,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{E as i,F as n,P as r,R as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,t as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{i as o,p as s,r as c,t as l}from"./dropdown-menu-DhrBcVgr.js";import{s as u}from"./popover-DRcRI46x.js";import{E as d,I as f,M as p,d as m,lt as h}from"./design-icons-DmYTv2r1.js";import{t as g}from"./createLucideIcon-BHp8sXmF.js";import{n as _,r as v,t as y}from"./diff-controls-BR2uqhwG.js";import{K as b,Lt as x}from"./index-FoxgrgAH.js";var S=g(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),C=g(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),w=e(i(),1),T=a();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:i}){let[a,o]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 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+t*14}px`},children:[(0,T.jsx)(m,{size:16,"aria-hidden":`true`,className:r(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,T.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),a?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:i},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:i},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:i}){let a=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>i(e.path),className:r(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:r(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,healthReady:t,branch:i,stat:a,mode:u,wrap:d,preview:f=!1,onModeChange:p,onWrapChange:m,onPreviewChange:h,onAction:g}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[i?(0,T.jsx)(y,{branch:i}):null,a?(0,T.jsx)(R,{stat:a}):null,h?(0,T.jsx)(`span`,{className:`ml-auto flex items-center`,children:(0,T.jsx)(v,{preview:f,onPreviewChange:h})}):null,(0,T.jsxs)(`span`,{className:r(`flex items-center gap-1`,h?`max-md:ml-auto`:`ml-auto`),children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(_,{mode:u,wrap:d,onModeChange:p,onWrapChange:m})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:g},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:g}),e.menu.length>0?(0,T.jsxs)(l,{children:[(0,T.jsx)(s,{asChild:!0,children:(0,T.jsx)(n,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(S,{"aria-hidden":`true`})})}),(0,T.jsx)(c,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(o,{disabled:!e.enabled,title:e.reason,onSelect:()=>g(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(p,{size:16,"aria-hidden":`true`}),push:(0,T.jsx)(h,{size:16,"aria-hidden":`true`}),"create-pr":(0,T.jsx)(f,{size:16,"aria-hidden":`true`}),"view-pr":(0,T.jsx)(u,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(x,{"aria-hidden":`true`})};function L({action:e,variant:r,onAction:i}){return e.id===`view-pr`?t(e.href)?(0,T.jsx)(n,{asChild:!0,variant:r,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(n,{variant:r,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>i(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(b,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{E as i,F as n,P as r,R as t};