@wjarka/cezarion 0.14.6 → 0.14.7

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 (123) hide show
  1. package/README.md +37 -2
  2. package/dist/agent-config/model-settings/shared.d.ts +2 -1
  3. package/dist/agent-config/model-settings/shared.js +1 -1
  4. package/dist/agent-config/model-settings/shared.js.map +1 -1
  5. package/dist/ci-wait/client.d.ts +4 -0
  6. package/dist/ci-wait/client.js +67 -0
  7. package/dist/ci-wait/client.js.map +1 -0
  8. package/dist/ci-wait/controller.d.ts +78 -0
  9. package/dist/ci-wait/controller.js +148 -0
  10. package/dist/ci-wait/controller.js.map +1 -0
  11. package/dist/ci-wait/github.d.ts +61 -0
  12. package/dist/ci-wait/github.js +209 -0
  13. package/dist/ci-wait/github.js.map +1 -0
  14. package/dist/ci-wait/injection.d.ts +3 -0
  15. package/dist/ci-wait/injection.js +26 -0
  16. package/dist/ci-wait/injection.js.map +1 -0
  17. package/dist/ci-wait/mcp.d.ts +97 -0
  18. package/dist/ci-wait/mcp.js +35 -0
  19. package/dist/ci-wait/mcp.js.map +1 -0
  20. package/dist/ci-wait/resources.d.ts +7 -0
  21. package/dist/ci-wait/resources.js +32 -0
  22. package/dist/ci-wait/resources.js.map +1 -0
  23. package/dist/ci-wait/supervisor.d.ts +21 -0
  24. package/dist/ci-wait/supervisor.js +163 -0
  25. package/dist/ci-wait/supervisor.js.map +1 -0
  26. package/dist/contract/ci-wait.d.ts +151 -0
  27. package/dist/contract/conversations.d.ts +7 -0
  28. package/dist/contract/delegation.d.ts +2 -0
  29. package/dist/contract/events.d.ts +3 -0
  30. package/dist/contract/index.d.ts +1 -0
  31. package/dist/contract/index.js +1016 -935
  32. package/dist/contract/runs.d.ts +461 -0
  33. package/dist/contract/skills.d.ts +92 -0
  34. package/dist/core/agent-env.js +2 -0
  35. package/dist/core/agent-env.js.map +1 -1
  36. package/dist/core/agent-runner.d.ts +6 -0
  37. package/dist/core/agent-runner.js +1 -0
  38. package/dist/core/agent-runner.js.map +1 -1
  39. package/dist/core/claude-cli-runner.js +10 -0
  40. package/dist/core/claude-cli-runner.js.map +1 -1
  41. package/dist/core/codex-app-server-runner.js +5 -1
  42. package/dist/core/codex-app-server-runner.js.map +1 -1
  43. package/dist/core/codex-app-server-transport.js +3 -1
  44. package/dist/core/codex-app-server-transport.js.map +1 -1
  45. package/dist/core/cursor-acp-runner.js +9 -1
  46. package/dist/core/cursor-acp-runner.js.map +1 -1
  47. package/dist/core/opencode-server-runner.js +6 -2
  48. package/dist/core/opencode-server-runner.js.map +1 -1
  49. package/dist/core/pi-runner.js +7 -1
  50. package/dist/core/pi-runner.js.map +1 -1
  51. package/dist/delegation/cli.js +8 -4
  52. package/dist/delegation/cli.js.map +1 -1
  53. package/dist/delegation/conversations.js +2 -1
  54. package/dist/delegation/conversations.js.map +1 -1
  55. package/dist/delegation/input.d.ts +6 -0
  56. package/dist/delegation/input.js +22 -0
  57. package/dist/delegation/input.js.map +1 -1
  58. package/dist/delegation/provision.js +3 -1
  59. package/dist/delegation/provision.js.map +1 -1
  60. package/dist/delegation/routes.d.ts +11 -0
  61. package/dist/delegation/service.js +31 -7
  62. package/dist/delegation/service.js.map +1 -1
  63. package/dist/delegation/transport.d.ts +11 -0
  64. package/dist/runs/delegation-state.d.ts +2 -0
  65. package/dist/runs/run-index.js +2 -3
  66. package/dist/runs/run-index.js.map +1 -1
  67. package/dist/runs/store.d.ts +514 -3
  68. package/dist/runs/store.js +85 -6
  69. package/dist/runs/store.js.map +1 -1
  70. package/dist/server/server.d.ts +1376 -12
  71. package/dist/workflows/run.d.ts +25 -1
  72. package/dist/workflows/run.js +470 -43
  73. package/dist/workflows/run.js.map +1 -1
  74. package/package.json +4 -3
  75. package/scripts/mock-ci-tool.mjs +53 -0
  76. package/scripts/mock-claude.mjs +8 -0
  77. package/scripts/mock-codex-app-server.mjs +212 -0
  78. package/scripts/mock-cursor-acp.mjs +6 -2
  79. package/scripts/mock-opencode-serve.mjs +392 -0
  80. package/scripts/mock-pi-rpc.mjs +7 -0
  81. package/scripts/pi-ci-wait.mjs +14 -0
  82. package/web/dist/assets/{agent-accounts-lP_xK83o.js → agent-accounts-BZm_2WAv.js} +1 -1
  83. package/web/dist/assets/{alert-dialog-CmDuefYh.js → alert-dialog-B422RI-k.js} +1 -1
  84. package/web/dist/assets/{collapsible-BqX8REmY.js → collapsible-Cy_Fmkrd.js} +1 -1
  85. package/web/dist/assets/{commit-list-BWvv1H7A.js → commit-list-CLxXMZvP.js} +1 -1
  86. package/web/dist/assets/{compare-variants-Bg7eLW3z.js → compare-variants-D2dRj6H_.js} +1 -1
  87. package/web/dist/assets/{diff-controls-HwWHHait.js → diff-controls-BGrXGi7O.js} +1 -1
  88. package/web/dist/assets/{diff-stat-mNkhAc5m.js → diff-stat-Cgnl_hYF.js} +1 -1
  89. package/web/dist/assets/{diff-0GBum40Q2.js → diff-tRE59UNb2.js} +2 -2
  90. package/web/dist/assets/{diff-view-DW64doDY.js → diff-view-DN1ort7Q.js} +1 -1
  91. package/web/dist/assets/{dropdown-menu-sZjYPcLh.js → dropdown-menu-dwDGT8MM.js} +1 -1
  92. package/web/dist/assets/{git-toolbar-DBW5EIcY.js → git-toolbar-UiHnGvE0.js} +1 -1
  93. package/web/dist/assets/{github-CkZ4hWI5.js → github-CaGjGQnW.js} +1 -1
  94. package/web/dist/assets/{image-preview-DZicGNkU.js → image-preview-C2JGcBlC.js} +1 -1
  95. package/web/dist/assets/index-CXZukB1O.css +1 -0
  96. package/web/dist/assets/{index-DWWI-B9n.js → index-D0RwD9-c.js} +3 -3
  97. package/web/dist/assets/{markdown-AY2K3kIV.js → markdown-C_IcKVQd.js} +1 -1
  98. package/web/dist/assets/{pill-CcJqA1cL.js → pill-BsbO6G7y.js} +1 -1
  99. package/web/dist/assets/{project-router-SwsXRKXs.js → project-router-DbLkll25.js} +1 -1
  100. package/web/dist/assets/{prompt-templates-iV2WD2jy.js → prompt-templates-BlTGJB5W.js} +1 -1
  101. package/web/dist/assets/{repo-git-BW3TOs3U.js → repo-git-CWD2dO8S.js} +1 -1
  102. package/web/dist/assets/{run-diff-DPUNj56q.js → run-diff-CyG0Nciv.js} +1 -1
  103. package/web/dist/assets/{run-header-CSaJIGXl.css → run-header-BJQfFL2l.css} +1 -1
  104. package/web/dist/assets/run-header-IFyIGCey.js +1 -0
  105. package/web/dist/assets/{skills-Dv8Vwv5D.js → skills-e7wHnuoc.js} +1 -1
  106. package/web/dist/assets/{tab-link-DSftvkZS.js → tab-link-BWNp3mLY.js} +1 -1
  107. package/web/dist/assets/{task-changes-CTCuVls1.js → task-changes-CpJImtq8.js} +1 -1
  108. package/web/dist/assets/{task-commits-weJQ5GSl.js → task-commits-hujrykPI.js} +1 -1
  109. package/web/dist/assets/{task-files-B4bUimY8.js → task-files-CjTiGtjt.js} +1 -1
  110. package/web/dist/assets/{task-thread-BuXrVB9K.js → task-thread-DDPFDS8C.js} +4 -4
  111. package/web/dist/assets/task-thread-Dc3wplva.css +1 -0
  112. package/web/dist/assets/{textarea-CxRdTWlq.js → textarea-FjaU370i.js} +1 -1
  113. package/web/dist/assets/thread-loading-77sJ8Yu_.js +1 -0
  114. package/web/dist/assets/{token-metrics-Z3UFYbuD.js → token-metrics-Clxh03bE.js} +1 -1
  115. package/web/dist/assets/utils-PYYcpCFZ.js +64 -0
  116. package/web/dist/assets/{workflows-vA27Yi8W.js → workflows-DGUQmWy7.js} +1 -1
  117. package/web/dist/assets/{zoomable-image-DUE1KFJ0.js → zoomable-image-Z3JDnm0b.js} +1 -1
  118. package/web/dist/index.html +14 -14
  119. package/web/dist/assets/index-DK0Mkv2m.css +0 -1
  120. package/web/dist/assets/run-header-DbDluWoV.js +0 -1
  121. package/web/dist/assets/task-thread-DMRD0IVt.css +0 -1
  122. package/web/dist/assets/thread-loading-JlP6dUpX.js +0 -1
  123. package/web/dist/assets/utils-CUnaAifW.js +0 -64
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./alert-dialog-CmDuefYh.js";import{i as d,n as f}from"./chunk-BO2N2NFS-DE6qKn3r.js";import{i as p,o as m,r as h,t as g}from"./highlighter-CdHqIwFr.js";function _(e,t=Date.now()){if(!e)return``;let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,(t-n)/1e3);return r<60?`${Math.floor(r)}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function v(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${(Math.floor(e/1e5)/10).toFixed(1)}M`:e>=1e3?`${(Math.floor(e/100)/10).toFixed(1)}k`:String(Math.floor(e))}var y=e(t(),1),b=n();function x({isOpen:e,onClose:t,onConfirm:n,url:d}){return(0,b.jsx)(u,{open:e,onOpenChange:e=>{e||t()},children:(0,b.jsxs)(a,{"data-slot":`link-safety-dialog`,children:[(0,b.jsxs)(l,{children:[(0,b.jsx)(i,{children:`Open this link?`}),(0,b.jsxs)(r,{children:[`It leaves cezar in a new tab. The words of a link in a transcript are the agent's — the address below is where it actually goes.`,(0,b.jsx)(`span`,{"data-slot":`link-safety-url`,className:`mt-3 block wrap-anywhere rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-foreground`,children:d})]})]}),(0,b.jsxs)(s,{children:[(0,b.jsx)(c,{children:`Cancel`}),(0,b.jsx)(o,{onClick:n,children:`Open link`})]})]})})}var S={name:`shiki`,type:`code-highlighter`,getThemes:()=>[g,g],getSupportedLanguages:()=>m(),supportsLanguage:e=>m().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>p(e,String(t))||(h(e,String(t)).then(e=>n?.(e)),null)};function C(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./alert-dialog-B422RI-k.js";import{i as d,n as f}from"./chunk-BO2N2NFS-DE6qKn3r.js";import{i as p,o as m,r as h,t as g}from"./highlighter-CdHqIwFr.js";function _(e,t=Date.now()){if(!e)return``;let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,(t-n)/1e3);return r<60?`${Math.floor(r)}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function v(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${(Math.floor(e/1e5)/10).toFixed(1)}M`:e>=1e3?`${(Math.floor(e/100)/10).toFixed(1)}k`:String(Math.floor(e))}var y=e(t(),1),b=n();function x({isOpen:e,onClose:t,onConfirm:n,url:d}){return(0,b.jsx)(u,{open:e,onOpenChange:e=>{e||t()},children:(0,b.jsxs)(a,{"data-slot":`link-safety-dialog`,children:[(0,b.jsxs)(l,{children:[(0,b.jsx)(i,{children:`Open this link?`}),(0,b.jsxs)(r,{children:[`It leaves cezar in a new tab. The words of a link in a transcript are the agent's — the address below is where it actually goes.`,(0,b.jsx)(`span`,{"data-slot":`link-safety-url`,className:`mt-3 block wrap-anywhere rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-foreground`,children:d})]})]}),(0,b.jsxs)(s,{children:[(0,b.jsx)(c,{children:`Cancel`}),(0,b.jsx)(o,{onClick:n,children:`Open link`})]})]})})}var S={name:`shiki`,type:`code-highlighter`,getThemes:()=>[g,g],getSupportedLanguages:()=>m(),supportsLanguage:e=>m().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>p(e,String(t))||(h(e,String(t)).then(e=>n?.(e)),null)};function C(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
2
2
  `)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var w=[...Object.values(f),C],T=[`p`,`strong`,`em`,`del`,`code`,`a`],E={p:`span`,a:`span`},D={enabled:!0,renderModal:e=>(0,b.jsx)(x,{...e})},O=(0,y.memo)(function({children:e,breaks:t=!1,inline:n=!1}){return(0,b.jsx)(d,{className:n?`thread-markdown thread-markdown-inline`:`thread-markdown`,plugins:{code:S},shikiTheme:[g,g],remarkPlugins:t?w:void 0,allowedElements:n?T:void 0,unwrapDisallowed:n||void 0,components:n?E:void 0,linkSafety:D,controls:{code:{copy:!0,download:!1},table:!1,mermaid:!1},lineNumbers:!1,children:e})});export{v as n,_ as r,O as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,$r as i,B as a,Fn as o,Hn as s,Kr as c,Q as l,Qr as u,Rn as d,Xr as f,Yt as p,bt as m,d as h,da as g,dr as _,et as v,kt as y,mn as b,ni as x,nt as S,sa as C,tt as w,vt as T,xt as ee,yt as te}from"./alert-dialog-CmDuefYh.js";import{n as E,t as D}from"./utils-CUnaAifW.js";import{c as ne,i as re,l as ie,r as ae,t as oe}from"./dropdown-menu-sZjYPcLh.js";import{a as se,i as ce,r as le}from"./agent-accounts-lP_xK83o.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as k}from"./external-link-BE6y205O.js";import{t as ue}from"./square-terminal-B6RYYieR.js";var de=O(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),A=O(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),fe=O(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),pe=O(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),me=O(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),he=O(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ge=O(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),_e=O(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),j=O(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ve=O(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),M=O(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ye=O(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),be=O(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),xe=O(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),Se=O(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ce=O(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),we=O(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),Te=O(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Ee=O(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),De=O(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),Oe=O(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),N=e(t(),1),P=n(),ke=a(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending-strong`,danger:`bg-danger`,accent:`bg-accent-strong`,running:`bg-running`,neutral:`bg-soft-foreground`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function F({className:e,tone:t=`neutral`,pulse:n=!1,...r}){return(0,P.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:D(ke({tone:t,pulse:n,className:e})),...r})}var Ae=[`done`,`failed`,`cancelled`],je=[`done`,`failed`];function Me(e){return e.status===`failed`&&e.autoResumeAt!==void 0}function Ne(e){return Ae.includes(e)}function I(e){return e.archived||Me(e)||!je.includes(e.status)?!1:e.finishedAt!==void 0}function L(e){let t=e.finishedAt;return t===void 0||!I(e)?!1:e.seenAt===void 0||e.seenAt<t}function Pe(e){return!Me(e)&&Ne(e.status)&&!L(e)}function Fe(e){return e.reduce((e,t)=>L(t)?e+1:e,0)}var R=(0,N.createContext)(null);function Ie({children:e}){let[t,n]=(0,N.useState)(()=>new Map),r=(0,N.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,N.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=s((0,N.useMemo)(()=>[...t.values()].flat(),[t])),o=(0,N.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,P.jsx)(R.Provider,{value:o,children:e})}var z=(0,N.createContext)(null);function Le({projectId:e,requests:t,children:n}){let r=(0,N.useContext)(R),i=(0,N.useId)();(0,N.useEffect)(()=>{if(r)return r.publish(i,t),()=>r.retract(i)},[r,i,t.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`)]);let a=s(r?Re:t),o=r?.lookup??a,c=(0,N.useMemo)(()=>({lookup:o,projectId:e}),[o,e]);return(0,P.jsx)(z.Provider,{value:c,children:n})}var Re=[];function ze(e,t,n){let r=(0,N.useContext)(z),i=n??r?.projectId;return!r||!i||t===void 0?Be:r.lookup({projectId:i,kind:e,number:t})}var Be=Object.freeze({state:`idle`}),Ve={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`},He={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`},Ue={draft:m,"review-required":ee,"changes-requested":y,"checks-pending":null,"checks-failing":S,ready:l,merged:T,closed:te,open:r,completed:l,"not-planned":w};function B({reference:e,taskTitle:t,status:n,conflicting:r,conflictAction:a,projectId:o,className:s,compact:c=!1}){let{kind:l,number:d,url:f}=e,m=ze(l,d,o),h=n??m.status,g=i(h),_=l===`PR`&&(r??m.conflicting)===!0,v=_?u:g,y=D(`inline-flex h-[22px] items-center gap-1 rounded-md border px-1.5 font-mono text-[10px] font-normal`,Ve[v?.tone??`accent`],s),b=qe(m,v,_?g:void 0),x=d?`${!c&&l===`Issue`?`Issue `:``}#${d}`:l,S=l===`PR`?`pull request`:`issue`,C=`Open the ${S} for ${t}${v?` — ${v.label}`:``}`,w=(0,P.jsxs)(P.Fragment,{children:[_?(0,P.jsx)(p,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,P.jsx)(Ye,{status:v?h:void 0}),x]}),T=!f||!E(f)?(0,P.jsx)(`span`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":h,..._?{"data-conflicting":`true`}:{},"aria-label":v?`${S} ${x} — ${v.label}`:void 0,className:y,children:w}):(0,P.jsx)(`a`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":h,..._?{"data-conflicting":`true`}:{},href:f,target:`_blank`,rel:`noopener noreferrer`,title:b?void 0:f,"aria-label":C,className:D(y,He[v?.tone??`accent`]),children:w});if(!b)return T;let ee=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:`block font-medium`,children:[l===`PR`?`Pull request`:`Issue`,d?` #${d}`:``,` · `,b.headline]}),(0,P.jsx)(`span`,{className:`block`,children:b.detail}),b.also?(0,P.jsx)(`span`,{className:`block opacity-70`,children:b.also}):null,f&&E(f)?(0,P.jsx)(`span`,{className:`block opacity-70`,children:f.replace(/^https?:\/\//,``)}):null]});return(0,P.jsx)(Ke,{chip:T,action:_?a:void 0,state:m.state,children:ee})}var V=(0,N.createContext)(()=>{});function We(){return(0,N.useContext)(V)}var Ge=150,H=120;function Ke({chip:e,action:t,state:n,children:r}){let[i,a]=(0,N.useState)(!1),o=(0,N.useRef)(null),s=(0,N.useRef)(null),c=(0,N.useRef)(void 0),l=(0,N.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),u=(0,N.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,N.useEffect)(()=>()=>clearTimeout(c.current),[]);let d=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,P.jsxs)(le,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,P.jsx)(ce,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,Ge)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,H)},onFocus:()=>a(!0),onBlur:e=>{d(e.relatedTarget)||u()},onKeyDown:e=>{if(e.key===`Escape`)return u();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,P.jsxs)(se,{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(),d(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,H)},children:[(0,P.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,P.jsx)(V.Provider,{value:u,children:t}):null]})]})}function qe(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${Je(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 Je(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Ye({status:e}){if(!e)return null;if(e===`checks-pending`)return(0,P.jsx)(v,{"data-slot":`status-dot`,"data-tone":`pending`,className:`size-3 animate-pulse motion-reduce:animate-none`,"aria-hidden":`true`});let t=Ue[e];return t?(0,P.jsx)(t,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null}var U={claude:`Claude Code`,codex:`Codex`,opencode:`OpenCode`,pi:`pi`,cursor:`Cursor`};function W(e){let t=e.currentStepId?e.steps.find(t=>t.id===e.currentStepId):void 0;if(t?.backend)return t.backend;if(e.runner)return e.runner;for(let t=e.steps.length-1;t>=0;--t){let n=e.steps[t]?.backend;if(n)return n}return`claude`}function G(e){return e.runner??`claude`}function K(e,t){let n=g(t,e);return n?.enabled===!1?{provider:e,usable:!1,reason:`${U[e]} is disabled. Enable it in Settings → Agents → Providers.`}:n?.status===`connected`?{provider:e,usable:!0}:{provider:e,usable:!1,reason:`${U[e]} credentials are unavailable. Authorize it in Settings → Agents → Providers.`}}function Xe(e,t){return K(W(e),t)}function Ze(e,t){return K(G(e),t)}function q(e){let t=d(),n=W(e);return t.isSuccess&&t.data?Xe(e,t.data):{provider:n,usable:!0}}function Qe(e){let t=d(),n=G(e);return t.isSuccess&&t.data?Ze(e,t.data):t.isError?{provider:n,usable:!1,reason:`Provider authentication could not be verified.`}:{provider:n,usable:!1,reason:`Checking agent providers…`}}var $e={folder:j,terminal:ue,vscode:me,cursor:xe,zed:Oe,windsurf:De,sublime:_e,idea:ge,pycharm:be,webstorm:M,goland:we,rubymine:ve,phpstorm:pe,clion:he,rider:fe,"android-studio":Te,xcode:ye,warp:Ce,claude:A,codex:Ee,opencode:A,pi:A};function J(e){return e.icon&&$e[e.icon]||k}function Y(e){let t=/^cli:(claude|codex|opencode|pi|cursor)$/.exec(e);return t?t[1]:void 0}function et({choices:e,onPick:t,label:n=`Open in…`,title:r,triggerVariant:i=`ghost`,disabled:a=!1,leading:o,trailing:s,slot:c}){return(0,P.jsxs)(oe,{children:[(0,P.jsx)(ie,{asChild:!0,children:(0,P.jsxs)(h,{variant:i,size:`sm`,title:r,disabled:a,"data-slot":c,children:[(0,P.jsx)(k,{"aria-hidden":`true`}),n]})}),(0,P.jsxs)(ae,{align:`end`,children:[o,o&&e.length>0?(0,P.jsx)(ne,{}):null,e.map(({target:e,suffix:n,title:r})=>{let i=J(e);return(0,P.jsxs)(re,{"data-target":e.id,title:r,onSelect:()=>t(e.id),children:[(0,P.jsx)(i,{"aria-hidden":`true`}),e.label,n??``]},e.id)}),s]})]})}function X(e){return e===`running`||e===`queued`||e===`waiting`}function Z(e){return[...e.steps].reverse().find(e=>e.sessionId)?.sessionId}function Q(e){return[...e.steps].reverse().find(e=>e.sessionId)?.backend??e.runner??`claude`}var tt=/^[A-Za-z0-9._][A-Za-z0-9._-]{0,199}$/;function nt(e,t){if(tt.test(t))switch(e){case`codex`:return`codex resume ${t}`;case`cursor`:return;case`opencode`:return`opencode --session ${t}`;default:return`claude --resume ${t}`}}function rt(e){if(X(e.status))return;let t=Z(e);if(t===void 0||!tt.test(t))return;let n=Q(e),r=n===`cursor`?e.cliResumeCommand:nt(n,t);if(r!==void 0)return e.worktreePath?`cd ${e.worktreePath} && ${r}`:r}function it(e,t){let n=Y(t);return!n||X(e.status)?!1:n===Q(e)&&Z(e)!==void 0}function at(e){return e.status===`cancelled`&&e.startedAt===void 0&&e.workflowDef!==void 0&&e.steps.every(e=>e.status===`pending`&&e.startedAt===void 0&&!e.sessionId)}function ot(e){let t=X(e.status),n=Z(e)!==void 0;return{finish:e.status===`waiting`||e.status===`review`,continueRun:!t&&!e.stopping&&e.delegation?.role!==`invalid`&&!(e.delegation?.role===`worker`&&e.delegation.destroy)&&(n||at(e)),terminal:!t&&n,notes:!0,archive:!t,pin:!e.archived,markUnread:I(e)&&!L(e),cancel:t,deleteRun:!t}}function st(e,t=!1){return e.status===`waiting`&&e.finishBlocked===null&&f(e,t).bucket===`waiting`}function ct(e){return`Merge head branch and resolve conflicts in ${e?`PR number ${e}`:`this pull request`}`}function lt(e){return e===`review`?`Accept the changes without a PR`:`Close the session`}function ut(e,t){let n=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)).findIndex(e=>e.id===t);return n>=0?n+1:void 0}var dt=[50,100,200,400,800,1e3,1e3,1e3,1e3],ft=e=>new Promise(t=>setTimeout(t,e));function pt(e){return e instanceof x&&e.status===409&&e.message===`run is still active`}async function mt(e,t=ft){for(let n=0;;n+=1)try{return await e()}catch(e){let r=dt[n];if(!pt(e)||r===void 0)throw e;await t(r)}}function ht(e){return X(e.status)?`live`:ot(e).continueRun?`resume`:`unavailable`}function gt(e,t){let n=_(e.id,t),r=b(e.id,t),i=q(e),a=Qe(e),[o,s]=(0,N.useState)(void 0),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(!1),d=ht(e),f=d===`resume`?!a.usable:d===`live`&&!i.usable,p=d===`unavailable`?`no-session`:f?`provider`:void 0,m=p===`no-session`?`This session has ended and no agent session was recorded, so the answer cannot be delivered.`:p===`provider`?d===`resume`?a.reason:i.reason:void 0,h=(e,t)=>a.usable?r.mutateAsync({text:e,...t===void 0?{}:{images:t}}):Promise.reject(Error(a.reason??`The run provider is unavailable.`));return{mode:d,blockedBy:p,reason:m,isPending:c||n.isPending||r.isPending,error:o,send:async(t,r)=>{if(p||u.current)return m;u.current=!0,l(!0),s(void 0);try{if(d===`resume`){await mt(()=>h(t,r));return}try{await n.mutateAsync({text:t,...r===void 0?{}:{images:r}})}catch(n){if(n instanceof x&&n.status===409&&Z(e)!==void 0){try{await mt(()=>h(t,r))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Session closed. Retry to reopen the session. ${t}`)}return}throw n}return}catch(e){let t=e instanceof Error?e.message:String(e);return s(t),t}finally{u.current=!1,l(!1)}}}}function $({run:e,projectId:t,prNumber:n}){let r=gt(e,t),i=We(),[a,o]=(0,N.useState)(!1),s=a||r.isPending,c=!!r.blockedBy,l=async()=>{if(s||c)return;let e=r.mode===`resume`;o(!0);try{let t=await r.send(ct(n));t?C(t,{tone:`danger`}):(C(`${e?`Task reopened`:`Sent to the task`} — resolving conflicts${n?` in PR #${n}`:``}`),i())}finally{o(!1)}};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(h,{type:`button`,size:`sm`,"data-slot":`reference-conflict-action`,disabled:c||s,onClick:()=>void l(),className:`h-7 w-full text-xs`,children:s?`Sending…`:`Resolve conflicts`}),c&&r.reason?(0,P.jsx)(`span`,{className:`block opacity-70`,children:r.reason}):null]})}function _t({projectId:e,runId:t,prNumber:n}){let r=o(e,t);return r.data?(0,P.jsx)($,{run:r.data,projectId:e,prNumber:n}):(0,P.jsx)(h,{type:`button`,size:`sm`,disabled:!0,className:`h-7 w-full text-xs`,children:r.isError?`Unavailable`:`Loading…`})}function vt({run:e,reference:t,className:n,compact:r=!1}){return(0,P.jsx)(B,{reference:t,taskTitle:c(e),conflictAction:(0,P.jsx)($,{run:e,prNumber:t.number}),className:n,compact:r})}function yt(e,t){let[n,r]=(0,N.useState)(!1),[i,a]=(0,N.useState)(``),o=(0,N.useRef)(!1);return{editing:n,draft:i,setDraft:a,begin:()=>{a(e),o.current=!1,r(!0)},commit:()=>{if(o.current)return;o.current=!0,r(!1);let n=i.trim();n.length===0||n===e||t(n)},cancel:()=>{o.current=!0,r(!1)}}}function bt({editor:e,className:t}){return(0,P.jsx)(`input`,{"data-slot":`title-input`,"aria-label":`Task title`,autoFocus:!0,value:e.draft,onChange:t=>e.setDraft(t.target.value),onBlur:e.commit,onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),e.commit()):t.key===`Escape`&&(t.preventDefault(),e.cancel())},className:D(`w-full min-w-0 rounded-sm border border-border bg-card px-1.5 py-0.5 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,t)})}function xt({className:e,dot:t,pulse:n=!1,children:r,...i}){return(0,P.jsxs)(`span`,{"data-slot":`pill`,className:D(`inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-[3px] text-xs font-medium whitespace-nowrap text-muted-foreground`,e),...i,children:[t?(0,P.jsx)(F,{tone:t,pulse:n}):null,r]})}export{Se as A,Le as C,L as D,Pe as E,j as M,de as N,Fe as O,B as S,I as T,ot as _,_t as a,J as b,it as c,at as d,Q as f,rt as g,ut as h,$ as i,M as j,F as k,lt as l,st as m,bt as n,vt as o,Z as p,yt as r,gt as s,xt as t,X as u,et as v,Ie as w,q as x,Y as y};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,$r as i,B as a,Fn as o,Hn as s,Kr as c,Q as l,Qr as u,Rn as d,Xr as f,Yt as p,bt as m,d as h,da as g,dr as _,et as v,kt as y,mn as b,ni as x,nt as S,sa as C,tt as w,vt as T,xt as ee,yt as te}from"./alert-dialog-B422RI-k.js";import{n as E,t as D}from"./utils-PYYcpCFZ.js";import{c as ne,i as re,l as ie,r as ae,t as oe}from"./dropdown-menu-dwDGT8MM.js";import{a as se,i as ce,r as le}from"./agent-accounts-BZm_2WAv.js";import{t as O}from"./createLucideIcon-BHp8sXmF.js";import{t as k}from"./external-link-BE6y205O.js";import{t as ue}from"./square-terminal-B6RYYieR.js";var de=O(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),A=O(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),fe=O(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),pe=O(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),me=O(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),he=O(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ge=O(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),_e=O(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),j=O(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),ve=O(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),M=O(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ye=O(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),be=O(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),xe=O(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),Se=O(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ce=O(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),we=O(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),Te=O(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Ee=O(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),De=O(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),Oe=O(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),N=e(t(),1),P=n(),ke=a(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending-strong`,danger:`bg-danger`,accent:`bg-accent-strong`,running:`bg-running`,neutral:`bg-soft-foreground`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function F({className:e,tone:t=`neutral`,pulse:n=!1,...r}){return(0,P.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:D(ke({tone:t,pulse:n,className:e})),...r})}var Ae=[`done`,`failed`,`cancelled`],je=[`done`,`failed`];function Me(e){return e.status===`failed`&&e.autoResumeAt!==void 0}function Ne(e){return Ae.includes(e)}function I(e){return e.archived||Me(e)||!je.includes(e.status)?!1:e.finishedAt!==void 0}function L(e){let t=e.finishedAt;return t===void 0||!I(e)?!1:e.seenAt===void 0||e.seenAt<t}function Pe(e){return!Me(e)&&Ne(e.status)&&!L(e)}function Fe(e){return e.reduce((e,t)=>L(t)?e+1:e,0)}var R=(0,N.createContext)(null);function Ie({children:e}){let[t,n]=(0,N.useState)(()=>new Map),r=(0,N.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,N.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=s((0,N.useMemo)(()=>[...t.values()].flat(),[t])),o=(0,N.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,P.jsx)(R.Provider,{value:o,children:e})}var z=(0,N.createContext)(null);function Le({projectId:e,requests:t,children:n}){let r=(0,N.useContext)(R),i=(0,N.useId)();(0,N.useEffect)(()=>{if(r)return r.publish(i,t),()=>r.retract(i)},[r,i,t.map(e=>`${e.projectId} ${e.kind}#${e.number}`).sort().join(`|`)]);let a=s(r?Re:t),o=r?.lookup??a,c=(0,N.useMemo)(()=>({lookup:o,projectId:e}),[o,e]);return(0,P.jsx)(z.Provider,{value:c,children:n})}var Re=[];function ze(e,t,n){let r=(0,N.useContext)(z),i=n??r?.projectId;return!r||!i||t===void 0?Be:r.lookup({projectId:i,kind:e,number:t})}var Be=Object.freeze({state:`idle`}),Ve={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`},He={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`},Ue={draft:m,"review-required":ee,"changes-requested":y,"checks-pending":null,"checks-failing":S,ready:l,merged:T,closed:te,open:r,completed:l,"not-planned":w};function B({reference:e,taskTitle:t,status:n,conflicting:r,conflictAction:a,projectId:o,className:s,compact:c=!1}){let{kind:l,number:d,url:f}=e,m=ze(l,d,o),h=n??m.status,g=i(h),_=l===`PR`&&(r??m.conflicting)===!0,v=_?u:g,y=D(`inline-flex h-[22px] items-center gap-1 rounded-md border px-1.5 font-mono text-[10px] font-normal`,Ve[v?.tone??`accent`],s),b=qe(m,v,_?g:void 0),x=d?`${!c&&l===`Issue`?`Issue `:``}#${d}`:l,S=l===`PR`?`pull request`:`issue`,C=`Open the ${S} for ${t}${v?` — ${v.label}`:``}`,w=(0,P.jsxs)(P.Fragment,{children:[_?(0,P.jsx)(p,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,P.jsx)(Ye,{status:v?h:void 0}),x]}),T=!f||!E(f)?(0,P.jsx)(`span`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":h,..._?{"data-conflicting":`true`}:{},"aria-label":v?`${S} ${x} — ${v.label}`:void 0,className:y,children:w}):(0,P.jsx)(`a`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":h,..._?{"data-conflicting":`true`}:{},href:f,target:`_blank`,rel:`noopener noreferrer`,title:b?void 0:f,"aria-label":C,className:D(y,He[v?.tone??`accent`]),children:w});if(!b)return T;let ee=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:`block font-medium`,children:[l===`PR`?`Pull request`:`Issue`,d?` #${d}`:``,` · `,b.headline]}),(0,P.jsx)(`span`,{className:`block`,children:b.detail}),b.also?(0,P.jsx)(`span`,{className:`block opacity-70`,children:b.also}):null,f&&E(f)?(0,P.jsx)(`span`,{className:`block opacity-70`,children:f.replace(/^https?:\/\//,``)}):null]});return(0,P.jsx)(Ke,{chip:T,action:_?a:void 0,state:m.state,children:ee})}var V=(0,N.createContext)(()=>{});function We(){return(0,N.useContext)(V)}var Ge=150,H=120;function Ke({chip:e,action:t,state:n,children:r}){let[i,a]=(0,N.useState)(!1),o=(0,N.useRef)(null),s=(0,N.useRef)(null),c=(0,N.useRef)(void 0),l=(0,N.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),u=(0,N.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,N.useEffect)(()=>()=>clearTimeout(c.current),[]);let d=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,P.jsxs)(le,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,P.jsx)(ce,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,Ge)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,H)},onFocus:()=>a(!0),onBlur:e=>{d(e.relatedTarget)||u()},onKeyDown:e=>{if(e.key===`Escape`)return u();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,P.jsxs)(se,{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(),d(document.activeElement)&&o.current?.focus()},onPointerEnter:()=>clearTimeout(c.current),onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,H)},children:[(0,P.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,P.jsx)(V.Provider,{value:u,children:t}):null]})]})}function qe(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${Je(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 Je(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Ye({status:e}){if(!e)return null;if(e===`checks-pending`)return(0,P.jsx)(v,{"data-slot":`status-dot`,"data-tone":`pending`,className:`size-3 animate-pulse motion-reduce:animate-none`,"aria-hidden":`true`});let t=Ue[e];return t?(0,P.jsx)(t,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null}var U={claude:`Claude Code`,codex:`Codex`,opencode:`OpenCode`,pi:`pi`,cursor:`Cursor`};function W(e){let t=e.currentStepId?e.steps.find(t=>t.id===e.currentStepId):void 0;if(t?.backend)return t.backend;if(e.runner)return e.runner;for(let t=e.steps.length-1;t>=0;--t){let n=e.steps[t]?.backend;if(n)return n}return`claude`}function G(e){return e.runner??`claude`}function K(e,t){let n=g(t,e);return n?.enabled===!1?{provider:e,usable:!1,reason:`${U[e]} is disabled. Enable it in Settings → Agents → Providers.`}:n?.status===`connected`?{provider:e,usable:!0}:{provider:e,usable:!1,reason:`${U[e]} credentials are unavailable. Authorize it in Settings → Agents → Providers.`}}function Xe(e,t){return K(W(e),t)}function Ze(e,t){return K(G(e),t)}function q(e){let t=d(),n=W(e);return t.isSuccess&&t.data?Xe(e,t.data):{provider:n,usable:!0}}function Qe(e){let t=d(),n=G(e);return t.isSuccess&&t.data?Ze(e,t.data):t.isError?{provider:n,usable:!1,reason:`Provider authentication could not be verified.`}:{provider:n,usable:!1,reason:`Checking agent providers…`}}var $e={folder:j,terminal:ue,vscode:me,cursor:xe,zed:Oe,windsurf:De,sublime:_e,idea:ge,pycharm:be,webstorm:M,goland:we,rubymine:ve,phpstorm:pe,clion:he,rider:fe,"android-studio":Te,xcode:ye,warp:Ce,claude:A,codex:Ee,opencode:A,pi:A};function J(e){return e.icon&&$e[e.icon]||k}function Y(e){let t=/^cli:(claude|codex|opencode|pi|cursor)$/.exec(e);return t?t[1]:void 0}function et({choices:e,onPick:t,label:n=`Open in…`,title:r,triggerVariant:i=`ghost`,disabled:a=!1,leading:o,trailing:s,slot:c}){return(0,P.jsxs)(oe,{children:[(0,P.jsx)(ie,{asChild:!0,children:(0,P.jsxs)(h,{variant:i,size:`sm`,title:r,disabled:a,"data-slot":c,children:[(0,P.jsx)(k,{"aria-hidden":`true`}),n]})}),(0,P.jsxs)(ae,{align:`end`,children:[o,o&&e.length>0?(0,P.jsx)(ne,{}):null,e.map(({target:e,suffix:n,title:r})=>{let i=J(e);return(0,P.jsxs)(re,{"data-target":e.id,title:r,onSelect:()=>t(e.id),children:[(0,P.jsx)(i,{"aria-hidden":`true`}),e.label,n??``]},e.id)}),s]})]})}function X(e){return e===`running`||e===`queued`||e===`waiting`}function Z(e){return[...e.steps].reverse().find(e=>e.sessionId)?.sessionId}function Q(e){return[...e.steps].reverse().find(e=>e.sessionId)?.backend??e.runner??`claude`}var tt=/^[A-Za-z0-9._][A-Za-z0-9._-]{0,199}$/;function nt(e,t){if(tt.test(t))switch(e){case`codex`:return`codex resume ${t}`;case`cursor`:return;case`opencode`:return`opencode --session ${t}`;default:return`claude --resume ${t}`}}function rt(e){if(X(e.status))return;let t=Z(e);if(t===void 0||!tt.test(t))return;let n=Q(e),r=n===`cursor`?e.cliResumeCommand:nt(n,t);if(r!==void 0)return e.worktreePath?`cd ${e.worktreePath} && ${r}`:r}function it(e,t){let n=Y(t);return!n||X(e.status)?!1:n===Q(e)&&Z(e)!==void 0}function at(e){return e.status===`cancelled`&&e.startedAt===void 0&&e.workflowDef!==void 0&&e.steps.every(e=>e.status===`pending`&&e.startedAt===void 0&&!e.sessionId)}function ot(e){let t=X(e.status),n=Z(e)!==void 0;return{finish:e.status===`waiting`||e.status===`review`,continueRun:!t&&!e.stopping&&e.delegation?.role!==`invalid`&&!(e.delegation?.role===`worker`&&e.delegation.destroy)&&(n||at(e)),terminal:!t&&n,notes:!0,archive:!t,pin:!e.archived,markUnread:I(e)&&!L(e),cancel:t,deleteRun:!t}}function st(e,t=!1){return e.status===`waiting`&&e.finishBlocked===null&&f(e,t).bucket===`waiting`}function ct(e){return`Merge head branch and resolve conflicts in ${e?`PR number ${e}`:`this pull request`}`}function lt(e){return e===`review`?`Accept the changes without a PR`:`Close the session`}function ut(e,t){let n=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt)).findIndex(e=>e.id===t);return n>=0?n+1:void 0}var dt=[50,100,200,400,800,1e3,1e3,1e3,1e3],ft=e=>new Promise(t=>setTimeout(t,e));function pt(e){return e instanceof x&&e.status===409&&e.message===`run is still active`}async function mt(e,t=ft){for(let n=0;;n+=1)try{return await e()}catch(e){let r=dt[n];if(!pt(e)||r===void 0)throw e;await t(r)}}function ht(e){return X(e.status)?`live`:ot(e).continueRun?`resume`:`unavailable`}function gt(e,t){let n=_(e.id,t),r=b(e.id,t),i=q(e),a=Qe(e),[o,s]=(0,N.useState)(void 0),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(!1),d=ht(e),f=d===`resume`?!a.usable:d===`live`&&!i.usable,p=d===`unavailable`?`no-session`:f?`provider`:void 0,m=p===`no-session`?`This session has ended and no agent session was recorded, so the answer cannot be delivered.`:p===`provider`?d===`resume`?a.reason:i.reason:void 0,h=(e,t)=>a.usable?r.mutateAsync({text:e,...t===void 0?{}:{images:t}}):Promise.reject(Error(a.reason??`The run provider is unavailable.`));return{mode:d,blockedBy:p,reason:m,isPending:c||n.isPending||r.isPending,error:o,send:async(t,r)=>{if(p||u.current)return m;u.current=!0,l(!0),s(void 0);try{if(d===`resume`){await mt(()=>h(t,r));return}try{await n.mutateAsync({text:t,...r===void 0?{}:{images:r}})}catch(n){if(n instanceof x&&n.status===409&&Z(e)!==void 0){try{await mt(()=>h(t,r))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Session closed. Retry to reopen the session. ${t}`)}return}throw n}return}catch(e){let t=e instanceof Error?e.message:String(e);return s(t),t}finally{u.current=!1,l(!1)}}}}function $({run:e,projectId:t,prNumber:n}){let r=gt(e,t),i=We(),[a,o]=(0,N.useState)(!1),s=a||r.isPending,c=!!r.blockedBy,l=async()=>{if(s||c)return;let e=r.mode===`resume`;o(!0);try{let t=await r.send(ct(n));t?C(t,{tone:`danger`}):(C(`${e?`Task reopened`:`Sent to the task`} — resolving conflicts${n?` in PR #${n}`:``}`),i())}finally{o(!1)}};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(h,{type:`button`,size:`sm`,"data-slot":`reference-conflict-action`,disabled:c||s,onClick:()=>void l(),className:`h-7 w-full text-xs`,children:s?`Sending…`:`Resolve conflicts`}),c&&r.reason?(0,P.jsx)(`span`,{className:`block opacity-70`,children:r.reason}):null]})}function _t({projectId:e,runId:t,prNumber:n}){let r=o(e,t);return r.data?(0,P.jsx)($,{run:r.data,projectId:e,prNumber:n}):(0,P.jsx)(h,{type:`button`,size:`sm`,disabled:!0,className:`h-7 w-full text-xs`,children:r.isError?`Unavailable`:`Loading…`})}function vt({run:e,reference:t,className:n,compact:r=!1}){return(0,P.jsx)(B,{reference:t,taskTitle:c(e),conflictAction:(0,P.jsx)($,{run:e,prNumber:t.number}),className:n,compact:r})}function yt(e,t){let[n,r]=(0,N.useState)(!1),[i,a]=(0,N.useState)(``),o=(0,N.useRef)(!1);return{editing:n,draft:i,setDraft:a,begin:()=>{a(e),o.current=!1,r(!0)},commit:()=>{if(o.current)return;o.current=!0,r(!1);let n=i.trim();n.length===0||n===e||t(n)},cancel:()=>{o.current=!0,r(!1)}}}function bt({editor:e,className:t}){return(0,P.jsx)(`input`,{"data-slot":`title-input`,"aria-label":`Task title`,autoFocus:!0,value:e.draft,onChange:t=>e.setDraft(t.target.value),onBlur:e.commit,onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),e.commit()):t.key===`Escape`&&(t.preventDefault(),e.cancel())},className:D(`w-full min-w-0 rounded-sm border border-border bg-card px-1.5 py-0.5 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,t)})}function xt({className:e,dot:t,pulse:n=!1,children:r,...i}){return(0,P.jsxs)(`span`,{"data-slot":`pill`,className:D(`inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-[3px] text-xs font-medium whitespace-nowrap text-muted-foreground`,e),...i,children:[t?(0,P.jsx)(F,{tone:t,pulse:n}):null,r]})}export{Se as A,Le as C,L as D,Pe as E,j as M,de as N,Fe as O,B as S,I as T,ot as _,_t as a,J as b,it as c,at as d,Q as f,rt as g,ut as h,$ as i,M as j,F as k,lt as l,st as m,bt as n,vt as o,Z as p,yt as r,gt as s,xt as t,X as u,et as v,Ie as w,q as x,Y as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Sa as r,ba as i,ga as a,ha as o,ma as s,ti as c,xa as l}from"./alert-dialog-CmDuefYh.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";var d=u(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),f=e(t(),1),p=n(),m=/^\/p\/([^/]+)(?=\/|$)/;function h(e){let t=m.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function g(e){let t=m.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function _(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function v(e,t){return e===null?t:typeof t==`string`?_(e,t):t.pathname===void 0?t:{...t,pathname:_(e,t.pathname)}}function y(){let{projectId:e}=c(),{pathname:t}=l();return e??h(t)}function b(){let e=y();return(0,f.useCallback)(t=>v(e,t),[e])}function x(e){let{pathname:t}=l();return(0,f.useMemo)(()=>i(e,g(t)),[e,t])}function S({to:e,...t}){let n=b();return(0,p.jsx)(s,{...t,to:n(e)})}function C({to:e,...t}){let n=b();return(0,p.jsx)(o,{...t,to:n(e)})}function w({to:e,...t}){let n=b();return(0,p.jsx)(a,{...t,to:n(e)})}function T(){let e=r(),t=b();return(0,f.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{v as a,T as c,h as i,x as l,C as n,g as o,w as r,y as s,S as t,d as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Sa as r,ba as i,ga as a,ha as o,ma as s,ti as c,xa as l}from"./alert-dialog-B422RI-k.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";var d=u(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),f=e(t(),1),p=n(),m=/^\/p\/([^/]+)(?=\/|$)/;function h(e){let t=m.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function g(e){let t=m.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function _(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function v(e,t){return e===null?t:typeof t==`string`?_(e,t):t.pathname===void 0?t:{...t,pathname:_(e,t.pathname)}}function y(){let{projectId:e}=c(),{pathname:t}=l();return e??h(t)}function b(){let e=y();return(0,f.useCallback)(t=>v(e,t),[e])}function x(e){let{pathname:t}=l();return(0,f.useMemo)(()=>i(e,g(t)),[e,t])}function S({to:e,...t}){let n=b();return(0,p.jsx)(s,{...t,to:n(e)})}function C({to:e,...t}){let n=b();return(0,p.jsx)(o,{...t,to:n(e)})}function w({to:e,...t}){let n=b();return(0,p.jsx)(a,{...t,to:n(e)})}function T(){let e=r(),t=b();return(0,f.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{v as a,T as c,h as i,x as l,C as n,g as o,w as r,y as s,S as t,d as u};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,N as i,R as a,Rt as o,X as s,_ as c,f as l,g as u,m as d}from"./alert-dialog-CmDuefYh.js";import{p as f,t as p}from"./utils-CUnaAifW.js";import{i as m,l as h,o as g,r as _,s as v,t as y}from"./dropdown-menu-sZjYPcLh.js";import{i as b,n as x,o as S,r as C,s as w}from"./textarea-CxRdTWlq.js";import{t as T}from"./createLucideIcon-BHp8sXmF.js";var E=T(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),D=T(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),O=e(t(),1),k=1,A=.9,j=.8,ee=.17,M=.1,N=.999,P=.9999,F=.99,I=/[\\\/_+.#"@\[\(\{&]/,L=/[\\\/_+.#"@\[\(\{&]/g,R=/[\s-]/,z=/[\s-]/g;function te(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?k:F;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=te(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=k:I.test(e.charAt(l-1))?(d*=j,p=e.slice(i,l-1).match(L),p&&i>0&&(d*=N**+p.length)):R.test(e.charAt(l-1))?(d*=A,m=e.slice(i,l-1).match(z),m&&i>0&&(d*=N**+m.length)):(d*=ee,i>0&&(d*=N**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=P)),(d<M&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=te(e,t,n,r,l+1,a+2,o),f*M>d&&(d=f*M)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ne(e){return e.toLowerCase().replace(z,` `)}function re(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,te(e,t,ne(e),ne(t),0,0,{})}var B=`[cmdk-group=""]`,ie=`[cmdk-group-items=""]`,ae=`[cmdk-group-heading=""]`,oe=`[cmdk-item=""]`,se=`${oe}:not([aria-disabled="true"])`,V=`cmdk-item-select`,H=`data-value`,ce=(e,t,n)=>re(e,t,n),le=O.createContext(void 0),U=()=>O.useContext(le),ue=O.createContext(void 0),W=()=>O.useContext(ue),de=O.createContext(void 0),fe=O.forwardRef((e,t)=>{let n=q(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),a=q(()=>new Set),o=q(()=>new Map),s=q(()=>new Map),c=q(()=>new Set),l=Ce(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=r(),x=r(),S=r(),C=O.useRef(null),w=Te();K(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,T.emit()}},[f]),K(()=>{w(6,ee)},[]);let T=O.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.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`)j(),k(),w(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,ee),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),E=O.useMemo(()=>({value:(e,t,r)=>{t!==s.current.get(e)?.value&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{k(),T.emit()}))},item:(e,t)=>(a.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),w(3,()=>{j(),k(),n.current.value||A(),T.emit()}),()=>{s.current.delete(e),a.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),T.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=l.current?.filter??ce;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=o.current.get(n),i=0;r.forEach(t=>{let n=e.get(t);i=Math.max(n,i)}),t.push([n,i])});let r=C.current;N().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(ie);t?t.appendChild(e.parentElement===t?e:e.closest(`${ie} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ie} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${B}[${H}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(H);T.setState(`value`,e||void 0)}function j(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of a.current){let r=D(s.current.get(t)?.value??``,s.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of o.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 ee(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(B)?.querySelector(ae))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${oe}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(se)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(H))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(H))}function I(e){let t=M()?.closest(B),n;for(;t&&!n;)t=e>0?xe(t,B):Se(t,B),n=t?.querySelector(se);n?T.setState(`value`,n.getAttribute(H)):F(e)}let L=()=>P(N().length-1),R=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):F(1)},z=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return O.createElement(i.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&R(e);break;case`ArrowDown`:R(e);break;case`p`:case`k`:v&&e.ctrlKey&&z(e);break;case`ArrowUp`:z(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(V);t.dispatchEvent(e)}}}}},O.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:De},u),Y(e,e=>O.createElement(ue.Provider,{value:T},O.createElement(le.Provider,{value:E},e))))}),pe=O.forwardRef((e,t)=>{let n=r(),o=O.useRef(null),s=O.useContext(de),c=U(),l=Ce(e),u=l.current?.forceMount??s?.forceMount;K(()=>{if(!u)return c.item(n,s?.id)},[u]);let d=we(n,o,[e.value,e.children,o],e.keywords),f=W(),p=J(e=>e.value&&e.value===d.current),m=J(e=>u||c.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);O.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(V,h),()=>t.removeEventListener(V,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return O.createElement(i.div,{ref:a(o,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||c.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),me=O.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:s,...c}=e,l=r(),u=O.useRef(null),d=O.useRef(null),f=r(),p=U(),m=J(e=>s||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));K(()=>p.group(l),[]),we(l,u,[e.value,e.heading,d]);let h=O.useMemo(()=>({id:l,forceMount:s}),[s]);return O.createElement(i.div,{ref:a(u,t),...c,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&O.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Y(e,e=>O.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},O.createElement(de.Provider,{value:h},e))))}),he=O.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=O.useRef(null),s=J(e=>!e.search);return!n&&!s?null:O.createElement(i.div,{ref:a(o,t),...r,"cmdk-separator":``,role:`separator`})}),ge=O.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=W(),s=J(e=>e.search),c=J(e=>e.selectedItemId),l=U();return O.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),O.createElement(i.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:a?e.value:s,onChange:e=>{a||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),_e=O.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...o}=e,s=O.useRef(null),c=O.useRef(null),l=J(e=>e.selectedItemId),u=U();return O.useEffect(()=>{if(c.current&&s.current){let e=c.current,t=s.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)}}},[]),O.createElement(i.div,{ref:a(s,t),...o,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Y(e,e=>O.createElement(`div`,{ref:a(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),ve=O.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return O.createElement(l,{open:n,onOpenChange:r},O.createElement(c,{container:o},O.createElement(u,{"cmdk-overlay":``,className:i}),O.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},O.createElement(fe,{ref:t,...s}))))}),ye=O.forwardRef((e,t)=>J(e=>e.filtered.count===0)?O.createElement(i.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),be=O.forwardRef((e,t)=>{let{progress:n,children:r,label:a=`Loading...`,...o}=e;return O.createElement(i.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Y(e,e=>O.createElement(`div`,{"aria-hidden":!0},e)))}),G=Object.assign(fe,{List:_e,Item:pe,Input:ge,Group:me,Separator:he,Dialog:ve,Empty:ye,Loading:be});function xe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Se(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ce(e){let t=O.useRef(e);return K(()=>{t.current=e}),t}var K=typeof window>`u`?O.useEffect:O.useLayoutEffect;function q(e){let t=O.useRef();return t.current===void 0&&(t.current=e()),t}function J(e){let t=W(),n=()=>e(t.snapshot());return O.useSyncExternalStore(t.subscribe,n,n)}function we(e,t,n,r=[]){let i=O.useRef(),a=U();return K(()=>{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(H,s),i.current=s}),i}var Te=()=>{let[e,t]=O.useState(),n=q(()=>new Map);return K(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ee(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Y({asChild:e,children:t},n){return e&&O.isValidElement(t)?O.cloneElement(Ee(t),{ref:t.ref},n(t.props.children)):n(t)}var De={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},X=n();function Oe({className:e,...t}){return(0,X.jsx)(G,{"data-slot":`command`,className:p(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ke({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,filter:a,...o}){return(0,X.jsxs)(x,{...o,children:[(0,X.jsxs)(S,{className:`sr-only`,children:[(0,X.jsx)(w,{children:e}),(0,X.jsx)(b,{children:t})]}),(0,X.jsx)(C,{className:p(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,X.jsx)(Oe,{filter:a,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:n})})]})}function Ae({className:e,...t}){return(0,X.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 shrink-0 items-center gap-2 border-b px-3 max-md:h-[44px]`,children:[(0,X.jsx)(o,{className:`size-4 shrink-0 opacity-50`}),(0,X.jsx)(G.Input,{"data-slot":`command-input`,className:p(`flex h-10 w-full rounded-md bg-transparent py-3 text-base md:text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function je({className:e,onPointerMoveCapture:t,...n}){return(0,X.jsx)(G.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:p(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function Me({...e}){return(0,X.jsx)(G.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function Ne({className:e,...t}){return(0,X.jsx)(G.Group,{"data-slot":`command-group`,className:p(`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 Pe({className:e,...t}){return(0,X.jsx)(G.Separator,{"data-slot":`command-separator`,className:p(`-mx-1 h-px bg-border`,e),...t})}function Fe({className:e,...t}){return(0,X.jsx)(G.Item,{"data-slot":`command-item`,className:p(`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 Ie({className:e,...t}){return(0,X.jsx)(`span`,{"data-slot":`command-shortcut`,className:p(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var Le=`quick-task`;function Re(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var ze=[{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 (ACP)`}],Z={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`}]},Q=[{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 Be(e,t,n){let r=e===`cursor`?[Q[0]]:Q,i=f(e)&&(e!==`cursor`||n?.runner===e)?n?.models.find(e=>e.id===t)?.effortLevels:void 0;if(!i?.length)return r;let a=[Q[0]],o=new Set;for(let e of i){if(o.has(e))continue;let t=Q.find(t=>t.value===e);t&&(o.add(e),a.push(t))}return a.length>1?a:r}function Ve(e,t){let n=e??``;return t.some(e=>e.value===n)?n:``}var He=[`opencode`,`pi`];function Ue(e,t){return t===`cursor`||!e||Z[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(Z).some(([n,r])=>n!==t&&!He.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function We(e,t,n=[]){let r=t?.runner===e?t.models:[],i=Z[e]??Z.claude,a=[...r.length?i.slice(0,1):i],o=new Set(a.map(e=>e.id));if(f(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)||Ue(t,e)||(o.add(t),a.push({id:t,label:t,desc:`Custom or legacy model`}));return a}var Ge={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`,pi:`Pi`,cursor:`Cursor`};function Ke(e,t,n=!1,r=!1){if(!f(e))return;let i=Ge[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 qe(e){let t=ze.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function Je(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function Ye(e,t,n=!1){return!n&&e===t?void 0:e}function Xe(e,t,n,r){let i=We(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 Ze(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function Qe(e,t,n){return e&&Ze(e,t,n)?e:null}function $e(e){let{task:t,source:n,model:r,modelsLocked:i,effort:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,variants:u,images:d,worktree:f,autonomous:p,generateFollowups:m,todoId:h}=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:Ye(o,c,s),agentProfile:l||void 0,variants:u>1?u:void 0,images:d.length>0?[...d]:void 0,worktree:f===!1&&u<=1?!1:void 0,autonomous:p===!0||void 0,generateFollowups:m!==!1&&void 0,todoId:h||void 0}}function et(e){let t=`runs`in e?e.runs[0]:e;return t?`/tasks/${t.id}`:`/`}var tt=`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`,nt=(0,X.jsx)(s,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-supporting-foreground`});function rt({slot:e,ariaLabel:t,label:n,value:r,options:i,onPick:a,disabled:o=!1,readOnly:c=!1,hint:l,disabledHint:u,status:d,icon:f,fieldLabel:b=!1}){let x=f?` h-11 gap-2 rounded-lg border-border px-3 text-foreground`:``,S=(0,X.jsxs)(X.Fragment,{children:[f,(0,X.jsxs)(`span`,{className:`min-w-0 truncate`,title:typeof n==`string`?n:void 0,children:[b?(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[t,` · `]}):null,n]})]});if(c)return(0,X.jsx)(`span`,{"data-slot":e,"aria-label":t,title:u??l,className:p(tt,x,`cursor-default hover:bg-card hover:text-muted-foreground`),children:S});let C=(0,X.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":t,disabled:o,title:o?u:l,className:p(tt,x),children:[S,f?(0,X.jsx)(s,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-muted-foreground`}):nt]});return o?(0,X.jsx)(`span`,{title:u,className:`inline-flex`,children:C}):(0,X.jsxs)(y,{children:[(0,X.jsx)(h,{asChild:!0,children:C}),(0,X.jsxs)(_,{align:`start`,"data-testid":`${e}-menu`,children:[(0,X.jsx)(g,{value:r,onValueChange:a,children:i.map(e=>(0,X.jsx)(v,{value:e.value,className:`gap-2.5`,children:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:e.label}),e.desc?(0,X.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),d?(0,X.jsx)(m,{disabled:!0,className:`border-t border-border text-[11.5px] text-muted-foreground`,children:d}):null]})]})}var $=(e,t)=>t===null?e:`${e}:${t}`;function it({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o,icon:s,fieldLabel:c}){let l=ze.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,X.jsx)(rt,{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})}var at=80,ot=2e3,st=50,ct=200,lt=50,ut=[{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.`}];function dt(e){return!!e&&typeof e==`object`}function ft(e){if(e===void 0||!Array.isArray(e))return ut.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!dt(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=pt(r.skills);if(n.push({id:e,label:i.slice(0,at),text:a.slice(0,ot),...o.length>0?{skills:o}:{}}),n.length>=st)break}return n}function pt(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,ct)),t.size>=lt))break}return[...t]}function mt(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function ht(e,t){return mt(e,t).map(e=>e.text).join(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,N as i,R as a,Rt as o,X as s,_ as c,f as l,g as u,m as d}from"./alert-dialog-B422RI-k.js";import{p as f,t as p}from"./utils-PYYcpCFZ.js";import{i as m,l as h,o as g,r as _,s as v,t as y}from"./dropdown-menu-dwDGT8MM.js";import{i as b,n as x,o as S,r as C,s as w}from"./textarea-FjaU370i.js";import{t as T}from"./createLucideIcon-BHp8sXmF.js";var E=T(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),D=T(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),O=e(t(),1),k=1,A=.9,j=.8,ee=.17,M=.1,N=.999,P=.9999,F=.99,I=/[\\\/_+.#"@\[\(\{&]/,L=/[\\\/_+.#"@\[\(\{&]/g,R=/[\s-]/,z=/[\s-]/g;function te(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?k:F;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=te(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=k:I.test(e.charAt(l-1))?(d*=j,p=e.slice(i,l-1).match(L),p&&i>0&&(d*=N**+p.length)):R.test(e.charAt(l-1))?(d*=A,m=e.slice(i,l-1).match(z),m&&i>0&&(d*=N**+m.length)):(d*=ee,i>0&&(d*=N**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=P)),(d<M&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=te(e,t,n,r,l+1,a+2,o),f*M>d&&(d=f*M)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ne(e){return e.toLowerCase().replace(z,` `)}function re(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,te(e,t,ne(e),ne(t),0,0,{})}var B=`[cmdk-group=""]`,ie=`[cmdk-group-items=""]`,ae=`[cmdk-group-heading=""]`,oe=`[cmdk-item=""]`,se=`${oe}:not([aria-disabled="true"])`,V=`cmdk-item-select`,H=`data-value`,ce=(e,t,n)=>re(e,t,n),le=O.createContext(void 0),U=()=>O.useContext(le),ue=O.createContext(void 0),W=()=>O.useContext(ue),de=O.createContext(void 0),fe=O.forwardRef((e,t)=>{let n=q(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),a=q(()=>new Set),o=q(()=>new Map),s=q(()=>new Map),c=q(()=>new Set),l=Ce(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=r(),x=r(),S=r(),C=O.useRef(null),w=Te();K(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,T.emit()}},[f]),K(()=>{w(6,ee)},[]);let T=O.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.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`)j(),k(),w(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(b))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,ee),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),E=O.useMemo(()=>({value:(e,t,r)=>{t!==s.current.get(e)?.value&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{k(),T.emit()}))},item:(e,t)=>(a.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),w(3,()=>{j(),k(),n.current.value||A(),T.emit()}),()=>{s.current.delete(e),a.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),T.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:S,labelId:x,listInnerRef:C}),[]);function D(e,t){let r=l.current?.filter??ce;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=o.current.get(n),i=0;r.forEach(t=>{let n=e.get(t);i=Math.max(n,i)}),t.push([n,i])});let r=C.current;N().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(ie);t?t.appendChild(e.parentElement===t?e:e.closest(`${ie} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ie} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${B}[${H}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(H);T.setState(`value`,e||void 0)}function j(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of a.current){let r=D(s.current.get(t)?.value??``,s.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of o.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 ee(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(B)?.querySelector(ae))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${oe}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(se)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(H))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(H))}function I(e){let t=M()?.closest(B),n;for(;t&&!n;)t=e>0?xe(t,B):Se(t,B),n=t?.querySelector(se);n?T.setState(`value`,n.getAttribute(H)):F(e)}let L=()=>P(N().length-1),R=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):F(1)},z=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return O.createElement(i.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&R(e);break;case`ArrowDown`:R(e);break;case`p`:case`k`:v&&e.ctrlKey&&z(e);break;case`ArrowUp`:z(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(V);t.dispatchEvent(e)}}}}},O.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:De},u),Y(e,e=>O.createElement(ue.Provider,{value:T},O.createElement(le.Provider,{value:E},e))))}),pe=O.forwardRef((e,t)=>{let n=r(),o=O.useRef(null),s=O.useContext(de),c=U(),l=Ce(e),u=l.current?.forceMount??s?.forceMount;K(()=>{if(!u)return c.item(n,s?.id)},[u]);let d=we(n,o,[e.value,e.children,o],e.keywords),f=W(),p=J(e=>e.value&&e.value===d.current),m=J(e=>u||c.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);O.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(V,h),()=>t.removeEventListener(V,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:y,forceMount:b,keywords:x,...S}=e;return O.createElement(i.div,{ref:a(o,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||c.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),me=O.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:s,...c}=e,l=r(),u=O.useRef(null),d=O.useRef(null),f=r(),p=U(),m=J(e=>s||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));K(()=>p.group(l),[]),we(l,u,[e.value,e.heading,d]);let h=O.useMemo(()=>({id:l,forceMount:s}),[s]);return O.createElement(i.div,{ref:a(u,t),...c,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&O.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Y(e,e=>O.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},O.createElement(de.Provider,{value:h},e))))}),he=O.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=O.useRef(null),s=J(e=>!e.search);return!n&&!s?null:O.createElement(i.div,{ref:a(o,t),...r,"cmdk-separator":``,role:`separator`})}),ge=O.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=W(),s=J(e=>e.search),c=J(e=>e.selectedItemId),l=U();return O.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),O.createElement(i.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:a?e.value:s,onChange:e=>{a||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),_e=O.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...o}=e,s=O.useRef(null),c=O.useRef(null),l=J(e=>e.selectedItemId),u=U();return O.useEffect(()=>{if(c.current&&s.current){let e=c.current,t=s.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)}}},[]),O.createElement(i.div,{ref:a(s,t),...o,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Y(e,e=>O.createElement(`div`,{ref:a(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),ve=O.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return O.createElement(l,{open:n,onOpenChange:r},O.createElement(c,{container:o},O.createElement(u,{"cmdk-overlay":``,className:i}),O.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},O.createElement(fe,{ref:t,...s}))))}),ye=O.forwardRef((e,t)=>J(e=>e.filtered.count===0)?O.createElement(i.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),be=O.forwardRef((e,t)=>{let{progress:n,children:r,label:a=`Loading...`,...o}=e;return O.createElement(i.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Y(e,e=>O.createElement(`div`,{"aria-hidden":!0},e)))}),G=Object.assign(fe,{List:_e,Item:pe,Input:ge,Group:me,Separator:he,Dialog:ve,Empty:ye,Loading:be});function xe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Se(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ce(e){let t=O.useRef(e);return K(()=>{t.current=e}),t}var K=typeof window>`u`?O.useEffect:O.useLayoutEffect;function q(e){let t=O.useRef();return t.current===void 0&&(t.current=e()),t}function J(e){let t=W(),n=()=>e(t.snapshot());return O.useSyncExternalStore(t.subscribe,n,n)}function we(e,t,n,r=[]){let i=O.useRef(),a=U();return K(()=>{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(H,s),i.current=s}),i}var Te=()=>{let[e,t]=O.useState(),n=q(()=>new Map);return K(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ee(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Y({asChild:e,children:t},n){return e&&O.isValidElement(t)?O.cloneElement(Ee(t),{ref:t.ref},n(t.props.children)):n(t)}var De={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},X=n();function Oe({className:e,...t}){return(0,X.jsx)(G,{"data-slot":`command`,className:p(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ke({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,filter:a,...o}){return(0,X.jsxs)(x,{...o,children:[(0,X.jsxs)(S,{className:`sr-only`,children:[(0,X.jsx)(w,{children:e}),(0,X.jsx)(b,{children:t})]}),(0,X.jsx)(C,{className:p(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,X.jsx)(Oe,{filter:a,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:n})})]})}function Ae({className:e,...t}){return(0,X.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 shrink-0 items-center gap-2 border-b px-3 max-md:h-[44px]`,children:[(0,X.jsx)(o,{className:`size-4 shrink-0 opacity-50`}),(0,X.jsx)(G.Input,{"data-slot":`command-input`,className:p(`flex h-10 w-full rounded-md bg-transparent py-3 text-base md:text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function je({className:e,onPointerMoveCapture:t,...n}){return(0,X.jsx)(G.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:p(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function Me({...e}){return(0,X.jsx)(G.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function Ne({className:e,...t}){return(0,X.jsx)(G.Group,{"data-slot":`command-group`,className:p(`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 Pe({className:e,...t}){return(0,X.jsx)(G.Separator,{"data-slot":`command-separator`,className:p(`-mx-1 h-px bg-border`,e),...t})}function Fe({className:e,...t}){return(0,X.jsx)(G.Item,{"data-slot":`command-item`,className:p(`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 Ie({className:e,...t}){return(0,X.jsx)(`span`,{"data-slot":`command-shortcut`,className:p(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var Le=`quick-task`;function Re(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var ze=[{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 (ACP)`}],Z={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`}]},Q=[{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 Be(e,t,n){let r=e===`cursor`?[Q[0]]:Q,i=f(e)&&(e!==`cursor`||n?.runner===e)?n?.models.find(e=>e.id===t)?.effortLevels:void 0;if(!i?.length)return r;let a=[Q[0]],o=new Set;for(let e of i){if(o.has(e))continue;let t=Q.find(t=>t.value===e);t&&(o.add(e),a.push(t))}return a.length>1?a:r}function Ve(e,t){let n=e??``;return t.some(e=>e.value===n)?n:``}var He=[`opencode`,`pi`];function Ue(e,t){return t===`cursor`||!e||Z[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(Z).some(([n,r])=>n!==t&&!He.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function We(e,t,n=[]){let r=t?.runner===e?t.models:[],i=Z[e]??Z.claude,a=[...r.length?i.slice(0,1):i],o=new Set(a.map(e=>e.id));if(f(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)||Ue(t,e)||(o.add(t),a.push({id:t,label:t,desc:`Custom or legacy model`}));return a}var Ge={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`,pi:`Pi`,cursor:`Cursor`};function Ke(e,t,n=!1,r=!1){if(!f(e))return;let i=Ge[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 qe(e){let t=ze.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function Je(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function Ye(e,t,n=!1){return!n&&e===t?void 0:e}function Xe(e,t,n,r){let i=We(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 Ze(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function Qe(e,t,n){return e&&Ze(e,t,n)?e:null}function $e(e){let{task:t,source:n,model:r,modelsLocked:i,effort:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,variants:u,images:d,worktree:f,autonomous:p,generateFollowups:m,todoId:h}=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:Ye(o,c,s),agentProfile:l||void 0,variants:u>1?u:void 0,images:d.length>0?[...d]:void 0,worktree:f===!1&&u<=1?!1:void 0,autonomous:p===!0||void 0,generateFollowups:m!==!1&&void 0,todoId:h||void 0}}function et(e){let t=`runs`in e?e.runs[0]:e;return t?`/tasks/${t.id}`:`/`}var tt=`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`,nt=(0,X.jsx)(s,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-supporting-foreground`});function rt({slot:e,ariaLabel:t,label:n,value:r,options:i,onPick:a,disabled:o=!1,readOnly:c=!1,hint:l,disabledHint:u,status:d,icon:f,fieldLabel:b=!1}){let x=f?` h-11 gap-2 rounded-lg border-border px-3 text-foreground`:``,S=(0,X.jsxs)(X.Fragment,{children:[f,(0,X.jsxs)(`span`,{className:`min-w-0 truncate`,title:typeof n==`string`?n:void 0,children:[b?(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[t,` · `]}):null,n]})]});if(c)return(0,X.jsx)(`span`,{"data-slot":e,"aria-label":t,title:u??l,className:p(tt,x,`cursor-default hover:bg-card hover:text-muted-foreground`),children:S});let C=(0,X.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":t,disabled:o,title:o?u:l,className:p(tt,x),children:[S,f?(0,X.jsx)(s,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-muted-foreground`}):nt]});return o?(0,X.jsx)(`span`,{title:u,className:`inline-flex`,children:C}):(0,X.jsxs)(y,{children:[(0,X.jsx)(h,{asChild:!0,children:C}),(0,X.jsxs)(_,{align:`start`,"data-testid":`${e}-menu`,children:[(0,X.jsx)(g,{value:r,onValueChange:a,children:i.map(e=>(0,X.jsx)(v,{value:e.value,className:`gap-2.5`,children:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:e.label}),e.desc?(0,X.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),d?(0,X.jsx)(m,{disabled:!0,className:`border-t border-border text-[11.5px] text-muted-foreground`,children:d}):null]})]})}var $=(e,t)=>t===null?e:`${e}:${t}`;function it({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o,icon:s,fieldLabel:c}){let l=ze.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,X.jsx)(rt,{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})}var at=80,ot=2e3,st=50,ct=200,lt=50,ut=[{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.`}];function dt(e){return!!e&&typeof e==`object`}function ft(e){if(e===void 0||!Array.isArray(e))return ut.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!dt(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=pt(r.skills);if(n.push({id:e,label:i.slice(0,at),text:a.slice(0,ot),...o.length>0?{skills:o}:{}}),n.length>=st)break}return n}function pt(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,ct)),t.size>=lt))break}return[...t]}function mt(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function ht(e,t){return mt(e,t).map(e=>e.text).join(`
2
2
 
3
3
  `)}function gt(e,t,n,r=``){if(e===``||e===r||e===t){let e=r&&n?`${r}\n\n${n}`:r||n;return{text:e,applied:n?e:``}}return{text:e,applied:t}}function _t(){return`tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function vt(e,t,n){let r=Math.max(0,Math.min(t,e.length)),i=e.slice(0,r),a=e.slice(r),o=``;i.length>0&&(o=i.endsWith(`
4
4
 
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,Ai as i,Ca as a,Ea as o,It as s,Jn as c,Ki as l,Rt as u,Ta as d,U as f,Wi as p,Xn as m,Yn as h,Yt as g,_t as _,a as ee,c as v,d as y,gt as b,hi as x,i as te,in as S,l as C,lt as w,n as T,ni as E,o as D,r as O,s as k,sa as A,t as ne,vn as j,wn as M,xt as N}from"./alert-dialog-CmDuefYh.js";import{n as P,t as F}from"./utils-CUnaAifW.js";import{t as I}from"./createLucideIcon-BHp8sXmF.js";import{n as L}from"./diff-controls-HwWHHait.js";import{i as R,r as z,t as B}from"./git-toolbar-DBW5EIcY.js";import{t as V,u as H}from"./project-router-SwsXRKXs.js";import{t as U}from"./search-x-I9Q8pgUa.js";import{t as W}from"./diff-stat-mNkhAc5m.js";import{a as G,h as K}from"./index-DWWI-B9n.js";import{t as q}from"./diff-0GBum40Q2.js";import{t as J}from"./tab-link-DSftvkZS.js";import{t as Y}from"./use-desktop-BaYgO7YW.js";import{t as X}from"./commit-list-BWvv1H7A.js";var re=I(`git-pull-request-arrow`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]),Z=e(t(),1),Q=n();function ie({repo:e,info:t}){let n=M(),i=r(),a=e=>A(e.message,{tone:`danger`}),o=d({mutationFn:e=>x({name:e}),onSuccess:async e=>{A(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([i.invalidateQueries({queryKey:S.repo}),i.invalidateQueries({queryKey:S.health})]),i.setQueryData(S.repo,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),i.setQueryData(S.health,n=>n?.repo?.root===t.root?{...n,repo:{...n.repo,branch:e.branch}}:n)},onError:a}),c=d({mutationFn:e=>l({baseBranch:e}),onSuccess:e=>{A(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now fork from the checked-out branch`),i.invalidateQueries({queryKey:S.repo})},onError:a}),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),g=m.trim().toLowerCase(),_=g?e.branches.filter(e=>e.toLowerCase().includes(g)):e.branches;return(0,Q.jsxs)(`section`,{"data-slot":`repo-branches`,className:`grid min-w-0 grid-cols-1 gap-5 px-[18px] py-[22px] md:grid-cols-[minmax(0,1fr)_290px] md:px-9`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:[(0,Q.jsx)(`h2`,{className:`sr-only`,children:`Branches`}),(0,Q.jsxs)(`label`,{className:`relative block`,children:[(0,Q.jsx)(u,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Q.jsx)(K,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:m,onChange:e=>h(e.target.value),className:`h-11 pl-10`})]}),(0,Q.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-4 flex min-w-0 flex-col divide-y divide-border border-t border-border md:max-h-[40rem] md:overflow-y-auto md:overscroll-contain`,children:[_.map(e=>{let n=e===t.branch;return(0,Q.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,className:`flex min-h-20 flex-col items-start justify-center gap-2 py-3 md:flex-row md:items-center md:justify-start md:py-2.5`,children:[(0,Q.jsx)(`span`,{className:F(`min-w-0 truncate text-[13px]`,n&&`font-normal`),children:e}),n?(0,Q.jsx)(`span`,{"data-slot":`branch-current`,className:`md:ml-auto flex shrink-0 items-center rounded-md bg-accent-strong/10 px-2 py-1.5 text-[10px] font-medium text-accent-text`,children:`Current`}):(0,Q.jsxs)(y,{variant:`outline`,size:`sm`,"data-action":`switch-branch`,className:`md:ml-auto h-11`,disabled:o.isPending,onClick:()=>o.mutate(e),children:[(0,Q.jsx)(b,{size:16,"aria-hidden":`true`}),`Switch`]})]},e)}),_.length===0?(0,Q.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-soft-foreground`,children:[`No branches match “`,m.trim(),`”.`]}):null]})]}),(0,Q.jsxs)(`div`,{className:`min-w-0 self-start rounded-xl border border-border bg-card p-5`,children:[(0,Q.jsx)(`h2`,{className:`text-base font-semibold`,children:`Create a branch`}),(0,Q.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-7 flex flex-col items-stretch gap-3`,onSubmit:e=>{e.preventDefault();let t=f.trim();t&&o.mutate(t,{onSuccess:()=>p(``)})},children:[(0,Q.jsx)(`label`,{htmlFor:`new-branch-name`,className:`text-sm font-medium`,children:`Branch name`}),(0,Q.jsx)(`p`,{className:`-mt-1 text-xs text-muted-foreground`,children:`Create from the selected base.`}),(0,Q.jsx)(K,{id:`new-branch-name`,"aria-label":`New branch name`,placeholder:`new-branch-name`,className:`h-11 bg-background`,value:f,onChange:e=>p(e.target.value)}),(0,Q.jsxs)(y,{type:`submit`,variant:`primary`,size:`sm`,className:`min-h-11 self-start`,"data-action":`create-branch`,disabled:!f.trim()||o.isPending,children:[(0,Q.jsx)(s,{size:16,"aria-hidden":`true`}),`Create branch`]})]}),(0,Q.jsxs)(`div`,{className:`mt-5`,children:[(0,Q.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`text-sm font-medium`,children:`Agents’ base branch`}),(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`New task worktrees branch from this.`}),(0,Q.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:c.isPending,onChange:e=>c.mutate(e.target.value===``?null:e.target.value),className:`mt-1.5 block min-h-11 w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,Q.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),e.branches.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))]})]}),(0,Q.jsx)(`p`,{className:`mt-3 border-t border-border pt-4 text-xs leading-relaxed text-muted-foreground`,children:`Switching branches changes your working tree. Review uncommitted changes first.`})]}),n.data?.forge?.available?(0,Q.jsx)(ae,{}):null]})}function ae(){let e=j({limit:20});return(0,Q.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,Q.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Open pull requests`}),e.isPending?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,Q.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,Q.jsx)(oe,{pr:e},e.number))}):(0,Q.jsx)(`p`,{"data-slot":`repo-prs-unavailable`,className:`mt-2 text-xs text-soft-foreground`,children:e.data.reason??`The forge is unreachable right now.`})]})}function oe({pr:e}){let t=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,e.number]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,Q.jsx)(se,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,Q.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:P(e.url)?(0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:F(n,`hover:bg-muted`),children:t}):(0,Q.jsx)(`span`,{className:n,children:t})})}function se({checks:e}){return(0,Q.jsx)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:F(`shrink-0 text-[10px] font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:e})}function ce(){let e=h(),t=Y(),[n,r]=(0,Z.useState)(`unified`),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=(0,Z.useRef)(null),l=e.isError&&e.error instanceof E&&e.error.status===409,u=e.data?.files??[],d=(0,Z.useMemo)(()=>z(u),[u]),f=t?n:`unified`,p=!t||i;return(0,Q.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,Q.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9`,children:[(0,Q.jsx)(`span`,{className:`text-sm`,children:e.data?`${e.data.stat.files} files changed ·`:`Uncommitted changes`}),e.data?(0,Q.jsx)(B,{stat:e.data.stat}):null,(0,Q.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,Q.jsx)(L,{mode:n,wrap:i,onModeChange:r,onWrapChange:a})})]}),e.isPending?(0,Q.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,Q.jsx)(C,{icon:l?(0,Q.jsx)(w,{size:16}):(0,Q.jsx)(g,{size:16}),tone:l?`neutral`:`danger`,heading:`h2`,title:l?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):u.length===0?(0,Q.jsx)(C,{icon:(0,Q.jsx)(w,{size:16}),tone:`neutral`,heading:`h2`,title:`Working tree clean`,subtitle:`No uncommitted changes in the main working tree. Edits show up here as they happen.`}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:1rem] md:px-9`,children:[(0,Q.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 lg:w-[250px]`,children:[(0,Q.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,Q.jsx)(R,{root:d,selected:o,onSelect:e=>{s(e),c.current?.scrollToPath(e)}})]}),(0,Q.jsx)(q,{files:u,viewRef:c,mode:f,wrap:p,className:`min-w-0 flex-1`})]})]})}function $({log:e}){let{sha:t}=a();return t?(0,Q.jsx)(le,{sha:t}):e.length===0?(0,Q.jsx)(C,{icon:(0,Q.jsx)(_,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,Q.jsx)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:(0,Q.jsx)(X,{slot:`repo-commits`,commits:e.map(e=>({sha:e.hash,shaLabel:e.hash,subject:e.subject,author:e.author,when:e.when,href:`/git/commits/${e.hash}`}))})})}function le({sha:e}){let t=m(e),n=Y(),[r,i]=(0,Z.useState)(`unified`),[a,o]=(0,Z.useState)(!1),s=t.isError&&t.error instanceof E&&t.error.status===409,c=n?r:`unified`,l=!n||a;return(0,Q.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,Q.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,Q.jsx)(y,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,Q.jsxs)(V,{to:`/git/commits`,children:[(0,Q.jsx)(f,{size:16,"aria-hidden":`true`}),`All commits`]})}),t.data?(0,Q.jsx)(W,{stat:t.data.stat}):null,(0,Q.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,Q.jsx)(L,{mode:r,wrap:a,onModeChange:i,onWrapChange:o})})]}),t.isPending?(0,Q.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):t.isError?(0,Q.jsx)(C,{icon:s?(0,Q.jsx)(U,{}):(0,Q.jsx)(g,{size:16}),tone:s?`neutral`:`danger`,heading:`h2`,title:s?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,Q.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,Q.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,Q.jsx)(C,{icon:(0,Q.jsx)(_,{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,Q.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:1rem] md:px-6`,children:(0,Q.jsx)(q,{files:t.data.files,mode:c,wrap:l,className:`min-w-0`})})]})]})}function ue({repo:e,info:t}){let n=r(),[a,s]=(0,Z.useState)(e.baseBranch??t.branch),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(null),f=S.repo,m=S.health,h=[...f,`pull`],g=!!t.remote,_=o({queryKey:h,queryFn:({signal:e})=>i({signal:e}),enabled:g}),x=d({mutationFn:p}),C=()=>Promise.all([n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:m})]),w=async(e,t=!1)=>{try{let n=await x.mutateAsync(t?{branch:e,confirm:!0}:{branch:e});if(`risks`in n){l(n);return}l(null),A(n.summary),await C()}catch(e){l(null),A(e instanceof Error?e.message:String(e),{tone:`danger`}),await C()}},E=_.data?.branches??e.branches,j=_.data===void 0||E.includes(a),M=j?E:[a,...E],N=g&&_.isPending,P=g?_.isError?`Could not load local branches: ${_.error.message}`:j?null:`${a} is not a local branch. Choose a local branch to pull.`:`No remote configured. Add a Git remote before pulling.`,F=x.isPending||N||!g||_.isError,I=F||!j,L=a!==t.branch;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{"data-slot":`repo-pull`,className:`max-w-full md:w-auto`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`repo-pull-branch`,className:`sr-only`,children:`Branch to pull`}),(0,Q.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,Q.jsx)(b,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Q.jsx)(`select`,{id:`repo-pull-branch`,value:a,disabled:F,onChange:e=>s(e.target.value),className:`h-11 max-w-full min-w-[88px] appearance-none rounded-lg border border-input bg-card pr-3 pl-9 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,style:{width:`${Math.max(88,a.length*8+56)}px`},children:M.map(e=>(0,Q.jsx)(`option`,{value:e,disabled:!j&&e===a,children:e},e))})]}),(0,Q.jsxs)(y,{ref:u,type:`button`,"data-action":`repo-pull`,className:`h-11 px-4`,disabled:I,title:P??void 0,onClick:()=>void w(a),children:[x.isPending?(0,Q.jsx)(H,{"aria-hidden":`true`,className:`motion-safe:animate-spin`}):(0,Q.jsx)(re,{"aria-hidden":`true`}),L?`Switch & pull`:`Pull`]})]}),P||L?(0,Q.jsx)(`p`,{"data-slot":`repo-pull-note`,className:`mt-1 break-all text-[11px] text-soft-foreground md:text-left`,children:P??`${a} stays checked out after the pull.`}):null]}),(0,Q.jsx)(ne,{open:c!==null,onOpenChange:e=>{!e&&!x.isPending&&l(null)},children:(0,Q.jsxs)(te,{onCloseAutoFocus:e=>{e.preventDefault(),u.current?.focus()},children:[(0,Q.jsxs)(k,{children:[(0,Q.jsxs)(v,{children:[`Pull `,c?.branch,` anyway?`]}),(0,Q.jsx)(ee,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[c?.risks.includes(`active_runs`)?(0,Q.jsx)(`p`,{children:`An active session is using this repository. Pulling can change files while it works.`}):null,c?.risks.includes(`dirty_tree`)?(0,Q.jsx)(`p`,{children:`The checkout has dirty files. Git may refuse the switch or pull to protect them.`}):null,(0,Q.jsxs)(`p`,{children:[c?.branch,` will stay checked out after this attempt.`]})]})})]}),(0,Q.jsxs)(D,{children:[(0,Q.jsx)(O,{className:`h-11`,disabled:x.isPending,children:`Cancel`}),(0,Q.jsx)(T,{className:`h-11`,disabled:x.isPending||c===null,onClick:e=>{e.preventDefault(),c&&w(c.branch,!0)},children:x.isPending?`Pulling…`:`Pull anyway`})]})]})})]})}function de({tab:e}){let t=c();if(t.isPending)return(0,Q.jsx)(G,{});if(t.isError)return(0,Q.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,Q.jsx)(C,{icon:(0,Q.jsx)(g,{size:16}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,Q.jsx)(fe,{repo:t.data,info:n,tab:e}):(0,Q.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,Q.jsx)(C,{icon:(0,Q.jsx)(b,{size:16}),tone:`neutral`,title:`Not a git repository`,subtitle:`cezar is running outside a git repository — start it inside one to browse changes, commits and branches.`})})}function fe({repo:e,info:t,tab:n}){return(0,Q.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,Q.jsxs)(`header`,{"data-slot":`repo-header`,className:`px-[18px] pt-[18px] md:px-9 md:pt-9`,children:[(0,Q.jsxs)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[30px]`,children:[`Git · `,n===`changes`?`Changes`:n===`commits`?`Commits`:`Branches`]}),(0,Q.jsxs)(`p`,{"data-slot":`repo-remote`,className:`mt-2 break-all text-[13px] text-muted-foreground`,children:[t.root.split(`/`).filter(Boolean).at(-1),t.remote?` · ${t.remote}`:``,` · `,(0,Q.jsx)(`span`,{"data-slot":`branch-chip`,children:t.branch})]}),(0,Q.jsx)(`div`,{className:`my-[22px] flex min-w-0 items-start gap-2.5`,children:(0,Q.jsx)(ue,{repo:e,info:t})}),(0,Q.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`flex items-end gap-6 border-b border-border [&>a]:min-h-11`,children:[(0,Q.jsx)(J,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,Q.jsx)(J,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,Q.jsx)(J,{to:`/git/branches`,active:n===`branches`,children:`Branches`})]})]}),n===`changes`?(0,Q.jsx)(ce,{}):n===`commits`?(0,Q.jsx)($,{log:e.log}):(0,Q.jsx)(ie,{repo:e,info:t})]})}export{de as RepoGitRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,Ai as i,Ca as a,Ea as o,It as s,Jn as c,Ki as l,Rt as u,Ta as d,U as f,Wi as p,Xn as m,Yn as h,Yt as g,_t as _,a as ee,c as v,d as y,gt as b,hi as x,i as te,in as S,l as C,lt as w,n as T,ni as E,o as D,r as O,s as k,sa as A,t as ne,vn as j,wn as M,xt as N}from"./alert-dialog-B422RI-k.js";import{n as P,t as F}from"./utils-PYYcpCFZ.js";import{t as I}from"./createLucideIcon-BHp8sXmF.js";import{n as L}from"./diff-controls-BGrXGi7O.js";import{i as R,r as z,t as B}from"./git-toolbar-UiHnGvE0.js";import{t as V,u as H}from"./project-router-DbLkll25.js";import{t as U}from"./search-x-I9Q8pgUa.js";import{t as W}from"./diff-stat-Cgnl_hYF.js";import{a as G,h as K}from"./index-D0RwD9-c.js";import{t as q}from"./diff-tRE59UNb2.js";import{t as J}from"./tab-link-BWNp3mLY.js";import{t as Y}from"./use-desktop-BaYgO7YW.js";import{t as X}from"./commit-list-CLxXMZvP.js";var re=I(`git-pull-request-arrow`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]),Z=e(t(),1),Q=n();function ie({repo:e,info:t}){let n=M(),i=r(),a=e=>A(e.message,{tone:`danger`}),o=d({mutationFn:e=>x({name:e}),onSuccess:async e=>{A(e.created?`Created and switched to ${e.branch}`:`Switched to ${e.branch}`),await Promise.all([i.invalidateQueries({queryKey:S.repo}),i.invalidateQueries({queryKey:S.health})]),i.setQueryData(S.repo,t=>t?.info?{...t,info:{...t.info,branch:e.branch}}:t),i.setQueryData(S.health,n=>n?.repo?.root===t.root?{...n,repo:{...n.repo,branch:e.branch}}:n)},onError:a}),c=d({mutationFn:e=>l({baseBranch:e}),onSuccess:e=>{A(e.baseBranch?`Agents now branch from ${e.baseBranch}`:`Agents now fork from the checked-out branch`),i.invalidateQueries({queryKey:S.repo})},onError:a}),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),g=m.trim().toLowerCase(),_=g?e.branches.filter(e=>e.toLowerCase().includes(g)):e.branches;return(0,Q.jsxs)(`section`,{"data-slot":`repo-branches`,className:`grid min-w-0 grid-cols-1 gap-5 px-[18px] py-[22px] md:grid-cols-[minmax(0,1fr)_290px] md:px-9`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border bg-card p-5`,children:[(0,Q.jsx)(`h2`,{className:`sr-only`,children:`Branches`}),(0,Q.jsxs)(`label`,{className:`relative block`,children:[(0,Q.jsx)(u,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Q.jsx)(K,{"aria-label":`Filter branches`,placeholder:`Filter branches…`,value:m,onChange:e=>h(e.target.value),className:`h-11 pl-10`})]}),(0,Q.jsxs)(`ul`,{"data-slot":`repo-branch-list`,className:`mt-4 flex min-w-0 flex-col divide-y divide-border border-t border-border md:max-h-[40rem] md:overflow-y-auto md:overscroll-contain`,children:[_.map(e=>{let n=e===t.branch;return(0,Q.jsxs)(`li`,{"data-slot":`branch-row`,"data-branch":e,className:`flex min-h-20 flex-col items-start justify-center gap-2 py-3 md:flex-row md:items-center md:justify-start md:py-2.5`,children:[(0,Q.jsx)(`span`,{className:F(`min-w-0 truncate text-[13px]`,n&&`font-normal`),children:e}),n?(0,Q.jsx)(`span`,{"data-slot":`branch-current`,className:`md:ml-auto flex shrink-0 items-center rounded-md bg-accent-strong/10 px-2 py-1.5 text-[10px] font-medium text-accent-text`,children:`Current`}):(0,Q.jsxs)(y,{variant:`outline`,size:`sm`,"data-action":`switch-branch`,className:`md:ml-auto h-11`,disabled:o.isPending,onClick:()=>o.mutate(e),children:[(0,Q.jsx)(b,{size:16,"aria-hidden":`true`}),`Switch`]})]},e)}),_.length===0?(0,Q.jsxs)(`li`,{"data-slot":`branch-empty`,className:`py-3 text-xs text-soft-foreground`,children:[`No branches match “`,m.trim(),`”.`]}):null]})]}),(0,Q.jsxs)(`div`,{className:`min-w-0 self-start rounded-xl border border-border bg-card p-5`,children:[(0,Q.jsx)(`h2`,{className:`text-base font-semibold`,children:`Create a branch`}),(0,Q.jsxs)(`form`,{"data-slot":`branch-create`,className:`mt-7 flex flex-col items-stretch gap-3`,onSubmit:e=>{e.preventDefault();let t=f.trim();t&&o.mutate(t,{onSuccess:()=>p(``)})},children:[(0,Q.jsx)(`label`,{htmlFor:`new-branch-name`,className:`text-sm font-medium`,children:`Branch name`}),(0,Q.jsx)(`p`,{className:`-mt-1 text-xs text-muted-foreground`,children:`Create from the selected base.`}),(0,Q.jsx)(K,{id:`new-branch-name`,"aria-label":`New branch name`,placeholder:`new-branch-name`,className:`h-11 bg-background`,value:f,onChange:e=>p(e.target.value)}),(0,Q.jsxs)(y,{type:`submit`,variant:`primary`,size:`sm`,className:`min-h-11 self-start`,"data-action":`create-branch`,disabled:!f.trim()||o.isPending,children:[(0,Q.jsx)(s,{size:16,"aria-hidden":`true`}),`Create branch`]})]}),(0,Q.jsxs)(`div`,{className:`mt-5`,children:[(0,Q.jsx)(`label`,{htmlFor:`base-branch-picker`,className:`text-sm font-medium`,children:`Agents’ base branch`}),(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`New task worktrees branch from this.`}),(0,Q.jsxs)(`select`,{id:`base-branch-picker`,"data-slot":`base-branch-picker`,value:e.baseBranch??``,disabled:c.isPending,onChange:e=>c.mutate(e.target.value===``?null:e.target.value),className:`mt-1.5 block min-h-11 w-full rounded-md border border-input bg-card px-3 py-1.5 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,Q.jsx)(`option`,{value:``,children:`follow checked-out branch (default)`}),e.branches.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))]})]}),(0,Q.jsx)(`p`,{className:`mt-3 border-t border-border pt-4 text-xs leading-relaxed text-muted-foreground`,children:`Switching branches changes your working tree. Review uncommitted changes first.`})]}),n.data?.forge?.available?(0,Q.jsx)(ae,{}):null]})}function ae(){let e=j({limit:20});return(0,Q.jsxs)(`div`,{"data-slot":`repo-prs`,className:`max-w-xl`,children:[(0,Q.jsx)(`h2`,{className:`text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Open pull requests`}),e.isPending?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`Loading pull requests…`}):e.isError?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:e.error.message}):e.data.available?e.data.prs.length===0?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-soft-foreground`,children:`No open pull requests.`}):(0,Q.jsx)(`ul`,{className:`mt-2 flex flex-col divide-y divide-border`,children:e.data.prs.map(e=>(0,Q.jsx)(oe,{pr:e},e.number))}):(0,Q.jsx)(`p`,{"data-slot":`repo-prs-unavailable`,className:`mt-2 text-xs text-soft-foreground`,children:e.data.reason??`The forge is unreachable right now.`})]})}function oe({pr:e}){let t=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(N,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,e.number]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px]`,children:e.title}),e.checks?(0,Q.jsx)(se,{checks:e.checks}):null]}),n=`flex min-w-0 items-center gap-2 rounded-sm px-1.5 py-2`;return(0,Q.jsx)(`li`,{"data-slot":`pr-row`,"data-number":e.number,children:P(e.url)?(0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:F(n,`hover:bg-muted`),children:t}):(0,Q.jsx)(`span`,{className:n,children:t})})}function se({checks:e}){return(0,Q.jsx)(`span`,{"data-slot":`pr-checks`,"data-checks":e,className:F(`shrink-0 text-[10px] font-medium`,e===`passing`&&`text-success`,e===`failing`&&`text-danger`,e===`pending`&&`text-muted-foreground`),children:e})}function ce(){let e=h(),t=Y(),[n,r]=(0,Z.useState)(`unified`),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=(0,Z.useRef)(null),l=e.isError&&e.error instanceof E&&e.error.status===409,u=e.data?.files??[],d=(0,Z.useMemo)(()=>z(u),[u]),f=t?n:`unified`,p=!t||i;return(0,Q.jsxs)(`section`,{"data-slot":`repo-changes`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,Q.jsxs)(`div`,{"data-slot":`repo-changes-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9`,children:[(0,Q.jsx)(`span`,{className:`text-sm`,children:e.data?`${e.data.stat.files} files changed ·`:`Uncommitted changes`}),e.data?(0,Q.jsx)(B,{stat:e.data.stat}):null,(0,Q.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,Q.jsx)(L,{mode:n,wrap:i,onModeChange:r,onWrapChange:a})})]}),e.isPending?(0,Q.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,Q.jsx)(C,{icon:l?(0,Q.jsx)(w,{size:16}):(0,Q.jsx)(g,{size:16}),tone:l?`neutral`:`danger`,heading:`h2`,title:l?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):u.length===0?(0,Q.jsx)(C,{icon:(0,Q.jsx)(w,{size:16}),tone:`neutral`,heading:`h2`,title:`Working tree clean`,subtitle:`No uncommitted changes in the main working tree. Edits show up here as they happen.`}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:1rem] md:px-9`,children:[(0,Q.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 lg:w-[250px]`,children:[(0,Q.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,Q.jsx)(R,{root:d,selected:o,onSelect:e=>{s(e),c.current?.scrollToPath(e)}})]}),(0,Q.jsx)(q,{files:u,viewRef:c,mode:f,wrap:p,className:`min-w-0 flex-1`})]})]})}function $({log:e}){let{sha:t}=a();return t?(0,Q.jsx)(le,{sha:t}):e.length===0?(0,Q.jsx)(C,{icon:(0,Q.jsx)(_,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`The log is empty — this repository has no commits to show.`}):(0,Q.jsx)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:(0,Q.jsx)(X,{slot:`repo-commits`,commits:e.map(e=>({sha:e.hash,shaLabel:e.hash,subject:e.subject,author:e.author,when:e.when,href:`/git/commits/${e.hash}`}))})})}function le({sha:e}){let t=m(e),n=Y(),[r,i]=(0,Z.useState)(`unified`),[a,o]=(0,Z.useState)(!1),s=t.isError&&t.error instanceof E&&t.error.status===409,c=n?r:`unified`,l=!n||a;return(0,Q.jsxs)(`section`,{"data-slot":`repo-commit`,"data-sha":e,className:`flex min-h-0 flex-1 flex-col`,children:[(0,Q.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,Q.jsx)(y,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,Q.jsxs)(V,{to:`/git/commits`,children:[(0,Q.jsx)(f,{size:16,"aria-hidden":`true`}),`All commits`]})}),t.data?(0,Q.jsx)(W,{stat:t.data.stat}):null,(0,Q.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,Q.jsx)(L,{mode:r,wrap:a,onModeChange:i,onWrapChange:o})})]}),t.isPending?(0,Q.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):t.isError?(0,Q.jsx)(C,{icon:s?(0,Q.jsx)(U,{}):(0,Q.jsx)(g,{size:16}),tone:s?`neutral`:`danger`,heading:`h2`,title:s?`Commit not found`:`Could not load the commit`,subtitle:t.error.message}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold`,children:t.data.subject}),(0,Q.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[t.data.author,` · `,t.data.when,` ·`,` `,(0,Q.jsx)(`span`,{className:`font-mono select-all`,children:t.data.sha})]})]}),t.data.files.length===0?(0,Q.jsx)(C,{icon:(0,Q.jsx)(_,{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,Q.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:1rem] md:px-6`,children:(0,Q.jsx)(q,{files:t.data.files,mode:c,wrap:l,className:`min-w-0`})})]})]})}function ue({repo:e,info:t}){let n=r(),[a,s]=(0,Z.useState)(e.baseBranch??t.branch),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(null),f=S.repo,m=S.health,h=[...f,`pull`],g=!!t.remote,_=o({queryKey:h,queryFn:({signal:e})=>i({signal:e}),enabled:g}),x=d({mutationFn:p}),C=()=>Promise.all([n.invalidateQueries({queryKey:f}),n.invalidateQueries({queryKey:m})]),w=async(e,t=!1)=>{try{let n=await x.mutateAsync(t?{branch:e,confirm:!0}:{branch:e});if(`risks`in n){l(n);return}l(null),A(n.summary),await C()}catch(e){l(null),A(e instanceof Error?e.message:String(e),{tone:`danger`}),await C()}},E=_.data?.branches??e.branches,j=_.data===void 0||E.includes(a),M=j?E:[a,...E],N=g&&_.isPending,P=g?_.isError?`Could not load local branches: ${_.error.message}`:j?null:`${a} is not a local branch. Choose a local branch to pull.`:`No remote configured. Add a Git remote before pulling.`,F=x.isPending||N||!g||_.isError,I=F||!j,L=a!==t.branch;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{"data-slot":`repo-pull`,className:`max-w-full md:w-auto`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`repo-pull-branch`,className:`sr-only`,children:`Branch to pull`}),(0,Q.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,Q.jsx)(b,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,Q.jsx)(`select`,{id:`repo-pull-branch`,value:a,disabled:F,onChange:e=>s(e.target.value),className:`h-11 max-w-full min-w-[88px] appearance-none rounded-lg border border-input bg-card pr-3 pl-9 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50`,style:{width:`${Math.max(88,a.length*8+56)}px`},children:M.map(e=>(0,Q.jsx)(`option`,{value:e,disabled:!j&&e===a,children:e},e))})]}),(0,Q.jsxs)(y,{ref:u,type:`button`,"data-action":`repo-pull`,className:`h-11 px-4`,disabled:I,title:P??void 0,onClick:()=>void w(a),children:[x.isPending?(0,Q.jsx)(H,{"aria-hidden":`true`,className:`motion-safe:animate-spin`}):(0,Q.jsx)(re,{"aria-hidden":`true`}),L?`Switch & pull`:`Pull`]})]}),P||L?(0,Q.jsx)(`p`,{"data-slot":`repo-pull-note`,className:`mt-1 break-all text-[11px] text-soft-foreground md:text-left`,children:P??`${a} stays checked out after the pull.`}):null]}),(0,Q.jsx)(ne,{open:c!==null,onOpenChange:e=>{!e&&!x.isPending&&l(null)},children:(0,Q.jsxs)(te,{onCloseAutoFocus:e=>{e.preventDefault(),u.current?.focus()},children:[(0,Q.jsxs)(k,{children:[(0,Q.jsxs)(v,{children:[`Pull `,c?.branch,` anyway?`]}),(0,Q.jsx)(ee,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[c?.risks.includes(`active_runs`)?(0,Q.jsx)(`p`,{children:`An active session is using this repository. Pulling can change files while it works.`}):null,c?.risks.includes(`dirty_tree`)?(0,Q.jsx)(`p`,{children:`The checkout has dirty files. Git may refuse the switch or pull to protect them.`}):null,(0,Q.jsxs)(`p`,{children:[c?.branch,` will stay checked out after this attempt.`]})]})})]}),(0,Q.jsxs)(D,{children:[(0,Q.jsx)(O,{className:`h-11`,disabled:x.isPending,children:`Cancel`}),(0,Q.jsx)(T,{className:`h-11`,disabled:x.isPending||c===null,onClick:e=>{e.preventDefault(),c&&w(c.branch,!0)},children:x.isPending?`Pulling…`:`Pull anyway`})]})]})})]})}function de({tab:e}){let t=c();if(t.isPending)return(0,Q.jsx)(G,{});if(t.isError)return(0,Q.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,Q.jsx)(C,{icon:(0,Q.jsx)(g,{size:16}),tone:`danger`,title:`Could not load the repository`,subtitle:t.error.message})});let n=t.data.info;return n?(0,Q.jsx)(fe,{repo:t.data,info:n,tab:e}):(0,Q.jsx)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:(0,Q.jsx)(C,{icon:(0,Q.jsx)(b,{size:16}),tone:`neutral`,title:`Not a git repository`,subtitle:`cezar is running outside a git repository — start it inside one to browse changes, commits and branches.`})})}function fe({repo:e,info:t,tab:n}){return(0,Q.jsxs)(`div`,{"data-route":`repo-git`,className:`flex min-h-full flex-col`,children:[(0,Q.jsxs)(`header`,{"data-slot":`repo-header`,className:`px-[18px] pt-[18px] md:px-9 md:pt-9`,children:[(0,Q.jsxs)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[30px]`,children:[`Git · `,n===`changes`?`Changes`:n===`commits`?`Commits`:`Branches`]}),(0,Q.jsxs)(`p`,{"data-slot":`repo-remote`,className:`mt-2 break-all text-[13px] text-muted-foreground`,children:[t.root.split(`/`).filter(Boolean).at(-1),t.remote?` · ${t.remote}`:``,` · `,(0,Q.jsx)(`span`,{"data-slot":`branch-chip`,children:t.branch})]}),(0,Q.jsx)(`div`,{className:`my-[22px] flex min-w-0 items-start gap-2.5`,children:(0,Q.jsx)(ue,{repo:e,info:t})}),(0,Q.jsxs)(`div`,{"data-slot":`repo-tabs`,className:`flex items-end gap-6 border-b border-border [&>a]:min-h-11`,children:[(0,Q.jsx)(J,{to:`/git`,active:n===`changes`,children:`Changes`}),(0,Q.jsx)(J,{to:`/git/commits`,active:n===`commits`,children:`Commits`}),(0,Q.jsx)(J,{to:`/git/branches`,active:n===`branches`,children:`Branches`})]})]}),n===`changes`?(0,Q.jsx)(ce,{}):n===`commits`?(0,Q.jsx)($,{log:e.log}):(0,Q.jsx)(ie,{repo:e,info:t})]})}export{de as RepoGitRoute};
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,d as i,in as a,nr as o}from"./alert-dialog-CmDuefYh.js";import{t as s}from"./utils-CUnaAifW.js";import{n as c,r as l,t as u}from"./collapsible-BqX8REmY.js";import{t as d}from"./chevron-right-BENZ-1ZN.js";import{i as f,r as p}from"./highlighter-CdHqIwFr.js";var m=e(t(),1),h=/^diff --git /;function g(e){let t=e.replace(h,``),n=t.lastIndexOf(` b/`);return _(n>=0?t.slice(n+3):t)}function _(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function v(e){let t=_(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function y(e){let t=[],n=null,r=!1;for(let i of e.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,d as i,in as a,nr as o}from"./alert-dialog-B422RI-k.js";import{t as s}from"./utils-PYYcpCFZ.js";import{n as c,r as l,t as u}from"./collapsible-Cy_Fmkrd.js";import{t as d}from"./chevron-right-BENZ-1ZN.js";import{i as f,r as p}from"./highlighter-CdHqIwFr.js";var m=e(t(),1),h=/^diff --git /;function g(e){let t=e.replace(h,``),n=t.lastIndexOf(` b/`);return _(n>=0?t.slice(n+3):t)}function _(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function v(e){let t=_(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function y(e){let t=[],n=null,r=!1;for(let i of e.split(`
2
2
  `)){if(h.test(i)){n={path:g(i),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]},t.push(n),r=!1;continue}if(n){if(!r){if(i.startsWith(`@@`))r=!0,n.lines.push(i);else if(i.startsWith(`rename from `))n.status=`renamed`,n.oldPath=_(i.slice(12));else if(i.startsWith(`rename to `))n.status=`renamed`,n.path=_(i.slice(10));else if(i.startsWith(`new file mode`))n.status=`added`;else if(i.startsWith(`deleted file mode`))n.status=`deleted`;else if(i.startsWith(`Binary files `)||i===`GIT binary patch`)n.binary=!0;else if(i.startsWith(`+++ `)){let e=v(i);e!==void 0&&(n.path=e)}else if(i.startsWith(`--- `)){let e=v(i);e!==void 0&&n.status===`deleted`&&(n.path=e)}continue}n.lines.push(i),i.startsWith(`+`)?n.additions+=1:i.startsWith(`-`)&&(n.deletions+=1)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function b(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var x=n(),S=20,C=300;function w({runId:e}){let t=r(),n=o(e);(0,m.useEffect)(()=>{t.invalidateQueries({queryKey:a.runs.diff(e)})},[t,e]);let s=(0,m.useMemo)(()=>y(n.data??``),[n.data]),[c,l]=(0,m.useState)(!1);if(n.isPending)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(n.isError)return(0,x.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:n.error.message});if(s.length===0)return(0,x.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:n.data.trim()||`(no changes)`});let u=b(s),d=c?s:s.slice(0,S);return(0,x.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,x.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,x.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,u.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,u.deletions]})]})]}),d.map(e=>(0,x.jsx)(E,{file:e},`${e.oldPath??``}→${e.path}`)),s.length>d.length?(0,x.jsxs)(i,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>l(!0),children:[`Show `,s.length-d.length,` more files`]}):null]})}var T={added:`added`,deleted:`deleted`,renamed:`renamed`};function E({file:e}){let[t,n]=(0,m.useState)(!0),r=T[e.status];return(0,x.jsxs)(u,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-border bg-card`,children:[(0,x.jsxs)(l,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,x.jsx)(d,{className:s(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,x.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:r}):null,e.binary?(0,x.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:`binary`}):null,(0,x.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] font-semibold tabular-nums`,children:[(0,x.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,x.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})]}),(0,x.jsx)(c,{children:(0,x.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,x.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,x.jsx)(D,{lines:e.lines})})})]})}function D({lines:e}){let[t,n]=(0,m.useState)(!1),r=t?e:e.slice(0,C),i=r.join(`
3
3
  `),[a,o]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=!1;return p(i,`diff`).then(t=>{e||o({text:i,tokens:t.tokens})}),()=>{e=!0}},[i]);let c=a?.text===i?a.tokens:f(i,`diff`)?.tokens??null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`pre`,{"data-slot":`diff-file-body`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:r.map((e,t)=>(0,x.jsxs)(`span`,{className:s(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[c?.[t]===void 0?e:c[t].map((e,t)=>(0,x.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),e===``?` `:``]},t))}),e.length>C?(0,x.jsx)(`button`,{type:`button`,"data-slot":`diff-file-toggle`,onClick:()=>n(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:t?`Show less`:`Show all ${e.length} lines`}):null]})}export{w as t};
@@ -1 +1 @@
1
- [data-slot=task-confirmation]{border-radius:12px;padding:24px}[data-slot=task-confirmation] [data-slot=alert-dialog-title]{font-size:20px;font-weight:500}[data-slot=task-confirmation] [data-slot=alert-dialog-description]{font-size:13px;line-height:1.6}@media (width<=767px){[data-slot=notes-panel],.task-action-panel{padding:18px}}[data-slot=run-actions-menu] [role^=menuitem]>svg{display:none}@media (width<=767px){[data-slot=run-title-row]{grid-template-columns:minmax(0,1fr) auto auto;gap:6px;display:grid}[data-slot=run-title-row] [data-slot=session-kind]{grid-area:1/1}[data-slot=run-title-row]>.group{grid-area:2/1/auto/-1;max-width:100%}[data-slot=run-title-row]>.group h1{font-size:20px;line-height:1.4}[data-slot=run-title-row]>[data-slot=pill]{grid-area:1/2}[data-slot=run-title-row]>span:last-child{grid-area:1/3}}[data-slot=notes-panel] .thread-markdown{color:var(--muted-foreground);font-size:13px;line-height:1.6}[data-slot=notes-panel] .thread-markdown :is(h1,h2,h3){color:var(--foreground);margin-top:20px;margin-bottom:8px;font-size:16px;font-weight:400;line-height:1.5}[data-slot=notes-panel]>div:first-child h2,.task-action-panel h2{font-size:18px;font-weight:400}[data-slot=notes-panel] button,.task-action-panel button{font-size:13px;font-weight:400}.task-action-panel h3{font-size:16px;font-weight:400}[data-slot=run-tabs]{gap:calc(var(--spacing) * 6)}[data-slot=run-tabs]>a{height:44px;padding-inline:4px;font-size:12px;font-weight:400}[data-slot=run-tabs]>a[aria-current=page]{color:var(--accent-text);border-bottom-color:var(--accent-strong)}@media (width<=767px){[data-slot=run-tabs]{gap:calc(var(--spacing) * 5)}}[data-slot=run-tabs]{margin-top:calc(var(--spacing) * 3)}[data-slot=run-tabs]>a[aria-current=page]{font-weight:600}[data-slot=run-meta]{margin-top:calc(var(--spacing) * 2.5)}@media (width>=768px){[data-slot=run-header]{padding-top:calc(var(--spacing) * 5.5)}[data-slot=run-title-row]{flex-wrap:nowrap;align-items:center;gap:12px;display:flex}[data-slot=run-title-row]>.group{flex:1;min-width:0;max-width:none}[data-slot=run-title-row] h1{letter-spacing:-.7px;font-size:25px}[data-slot=run-title-row]>span:last-child{margin-left:0}}
1
+ [data-slot=task-confirmation]{border-radius:12px;padding:24px}[data-slot=task-confirmation] [data-slot=alert-dialog-title]{font-size:20px;font-weight:500}[data-slot=task-confirmation] [data-slot=alert-dialog-description]{font-size:13px;line-height:1.6}@media (width<=767px){[data-slot=notes-panel],.task-action-panel{padding:18px}}[data-slot=run-actions-menu] [role^=menuitem]>svg{display:none}@media (width<=767px){[data-slot=run-title-row]{grid-template-columns:minmax(0,1fr) auto auto;gap:6px;display:grid}[data-slot=run-title-row] [data-slot=session-kind]{grid-area:1/1}[data-slot=run-title-row]>.group{grid-area:2/1/auto/-1;max-width:100%}[data-slot=run-title-row]>.group h1{font-size:20px;line-height:1.4}[data-slot=run-title-row]>[data-slot=pill]{grid-area:1/2}[data-slot=run-title-row]>span:last-child{grid-area:1/3}}[data-slot=notes-panel] .thread-markdown{color:var(--muted-foreground);font-size:13px;line-height:1.6}[data-slot=notes-panel] .thread-markdown :is(h1,h2,h3){color:var(--foreground);margin-top:20px;margin-bottom:8px;font-size:16px;font-weight:400;line-height:1.5}[data-slot=notes-panel]>div:first-child h2,.task-action-panel h2{font-size:18px;font-weight:400}[data-slot=notes-panel] button,.task-action-panel button{font-size:13px;font-weight:400}.task-action-panel h3{font-size:16px;font-weight:400}[data-slot=run-tabs]{gap:calc(var(--spacing) * 6)}[data-slot=run-tabs]>a{height:44px;padding-inline:4px;font-size:12px;font-weight:400}[data-slot=run-tabs]>a[aria-current=page]{color:var(--accent-text);border-bottom-color:var(--accent-strong)}@media (width<=767px){[data-slot=run-tabs]{gap:calc(var(--spacing) * 5)}}[data-slot=run-tabs]{margin-top:calc(var(--spacing) * 3)}[data-slot=run-tabs]>a[aria-current=page]{font-weight:600}[data-slot=run-meta]{margin-top:calc(var(--spacing) * 2.5)}@media (width>=768px){[data-slot=run-header]{padding-top:calc(var(--spacing) * 5.5)}[data-slot=run-title-row]{flex-wrap:nowrap;align-items:center;gap:12px;display:flex}[data-slot=run-title-row]>.group{flex:1;min-width:0;max-width:none}[data-slot=run-title-row] h1{letter-spacing:-.7px;font-size:25px}[data-slot=run-title-row]>span:last-child{margin-left:0}}[data-slot=run-header]{container-type:inline-size}@container (width<=240px){[data-slot=run-title-row]{flex-wrap:wrap;display:flex}[data-slot=run-title-row]>.group{flex-basis:100%;order:1}}
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,Fr as i,Ft as a,J as o,Jt as s,K as c,Kr as l,Lr as u,Mn as d,Mr as f,Nn as p,Pn as m,Pr as h,Q as g,Qn as _,Ri as v,Rn as y,Ta as b,V as ee,Vn as te,Wr as ne,X as x,Xr as re,Yr as S,a as C,ar as w,c as T,cr as E,d as D,et as ie,fa as ae,fn as oe,gt as se,i as ce,in as le,ir as ue,it as O,jn as de,kn as fe,kr as pe,n as me,ni as he,nt as k,o as A,oi as ge,r as j,s as M,sa as N,st as _e,t as P,tn as F,tt as ve,un as ye,wn as be,yi as xe,zi as Se,zr as Ce}from"./alert-dialog-B422RI-k.js";import{n as I,t as L}from"./utils-PYYcpCFZ.js";import{a as R,c as we,i as z,l as B,n as Te,r as Ee,t as De}from"./dropdown-menu-dwDGT8MM.js";import{n as Oe,r as ke,t as Ae}from"./collapsible-Cy_Fmkrd.js";import{n as je,t as Me}from"./agent-accounts-BZm_2WAv.js";import{t as V}from"./createLucideIcon-BHp8sXmF.js";import{A as Ne,C as Pe,N as Fe,S as H,_ as U,b as Ie,c as Le,f as Re,g as ze,i as Be,n as Ve,r as He,t as Ue,y as We}from"./pill-BsbO6G7y.js";import{c as Ge,s as Ke,t as W,u as qe}from"./project-router-DbLkll25.js";import{t as Je}from"./square-terminal-B6RYYieR.js";import{t as Ye}from"./markdown-C_IcKVQd.js";import{t as Xe}from"./diff-stat-Cgnl_hYF.js";import{n as Ze,t as Qe}from"./token-metrics-Clxh03bE.js";import{t as G}from"./tab-link-BWNp3mLY.js";import{t as $e}from"./use-desktop-BaYgO7YW.js";var et=V(`file-text`,[[`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:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),tt=V(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),nt=V(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),K=e(t(),1),q=n();function rt(e){let t=r();return b({mutationFn:t=>ge(e,t),onSuccess:()=>t.invalidateQueries({queryKey:le.runs.all}),onError:e=>N(e.message,{tone:`danger`})})}function it(e){return e.archived?`Unarchive`:`Archive task`}function at({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,q.jsx)(P,{open:t,onOpenChange:n,children:(0,q.jsxs)(ce,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,q.jsxs)(M,{children:[(0,q.jsx)(T,{children:`Archive task?`}),(0,q.jsxs)(C,{children:[`Move “`,(0,q.jsx)(`span`,{className:`font-medium text-foreground`,title:l(e),children:l(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,q.jsxs)(A,{children:[(0,q.jsx)(j,{children:`Cancel`}),(0,q.jsx)(me,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function ot({run:e,className:t,compactOnMobile:n=!1}){let[r,i]=(0,K.useState)(!1),a=rt(e.id),o=it(e);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(D,{type:`button`,variant:`outline`,"data-slot":`archive-action`,"aria-label":o,title:e.archived?`Put this task back in Active tasks`:`Move this task out of Active tasks`,disabled:a.isPending,className:L(`h-11 gap-[7px] px-3`,n&&`max-md:size-11 max-md:px-0`,t),onClick:()=>e.archived?a.mutate(!1):i(!0),children:[e.archived?(0,q.jsx)(Fe,{"aria-hidden":`true`}):(0,q.jsx)(ee,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:L(n&&`max-md:sr-only`),children:o})]}),(0,q.jsx)(at,{run:e,open:r,onOpenChange:i,onConfirm:()=>{a.mutate(!0),i(!1)}})]})}function st(e,t,n,r){return n?r===`step`?`Step ${e} of ${t}`:`${e} of ${t} complete`:`${e} / ${t}`}function ct({slot:e,icon:t,title:n,meta:r,open:i,onToggle:a,children:o}){return(0,q.jsxs)(`div`,{"data-slot":`run-activity-${e}`,"data-state":i?`open`:`collapsed`,className:`min-w-0 border-t border-border first:border-t-0`,children:[(0,q.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:a,className:`flex min-h-11 w-full min-w-0 items-center gap-2.5 px-3.5 py-2 text-left hover:bg-muted/40`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center text-accent-text`,children:t}),(0,q.jsx)(`span`,{className:`min-w-0 shrink truncate text-[13.5px] font-semibold text-foreground`,children:n}),(0,q.jsx)(`span`,{"data-slot":`run-activity-meta`,className:`min-w-0 shrink-[2] truncate text-[12.5px] text-muted-foreground tabular-nums`,children:r}),(0,q.jsx)(x,{"aria-hidden":!0,className:L(`ml-auto size-4 shrink-0 text-soft-foreground transition-transform`,i&&`rotate-180`)})]}),i?(0,q.jsx)(`div`,{"data-slot":`run-activity-body`,className:`min-w-0 border-t border-border/60 bg-muted/30 px-3.5 py-2.5`,children:o}):null]})}var lt=`flex min-h-11 min-w-0 items-center rounded-md px-2 text-sm text-foreground hover:bg-muted break-words focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`;function ut({run:e}){return!e.delegation||e.delegation.role===`invalid`?null:(0,q.jsx)(ft,{run:e})}function J(e,t){let n=e?.role===`root`?e.receipts.map(e=>e.workerId):[];return[...new Set([...n,...(t?.workers??[]).map(e=>e.workerId)])].slice(0,32)}function dt(e){let t=e.delegation,n=t!==void 0&&t.role!==`invalid`,r=w(e.id,{enabled:n});if(!n||!t)return`complete`;if(!r.isSuccess)return r.isError||r.fetchStatus===`paused`?`unknown`:`pending`;let i=new Map(r.data.workers.map(e=>[e.workerId,e])),a=J(t,r.data).map(e=>{let t=i.get(e)?.status;return t===`done`||t===`cancelled`?`complete`:t===void 0||t===`failed`?`issue`:`pending`});return a.includes(`pending`)?`pending`:a.includes(`issue`)?`issue`:`complete`}function ft({run:e}){let t=w(e.id),n=$e(),[r,i]=(0,K.useState)(null),a=n||r===e.id,s=(0,K.useId)(),c=E(),u=e.delegation,d=u?.role===`worker`?u.parentRunId:t.data?.parentRunId,f=new Map(t.data?.workers.map(e=>[e.workerId,e])),p=J(u,t.data),m=u&&u.role!==`invalid`?u.wait:void 0,h=S(u);return(0,q.jsxs)(`section`,{"aria-label":`Task relationships`,className:`min-w-0 border-t border-border py-2 text-sm text-muted-foreground`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 text-left text-xs md:hidden`,"aria-expanded":a,"aria-controls":s,onClick:()=>i(r===e.id?null:e.id),children:[(0,q.jsx)(se,{"aria-hidden":`true`,className:`size-4 text-accent-text`}),u?.role===`worker`?`Worker session`:`Parent`,(0,q.jsx)(o,{"aria-hidden":`true`,className:`ml-1 size-4`}),u?.role===`worker`?`Parent & workers`:p.length>0?`Workers ${p.length}`:t.isSuccess?`Workers 0`:t.isError?`Workers unavailable`:`Workers…`,(0,q.jsx)(x,{"aria-hidden":`true`,className:`ml-auto size-4 ${a?`rotate-180`:``}`})]}),u?.role===`worker`&&u.destroy?(0,q.jsx)(Y,{state:u.destroy}):null,m?(0,q.jsx)(vt,{wait:m,dependencyLabel:h}):null,(0,q.jsxs)(`div`,{id:s,hidden:!a,children:[d?(0,q.jsx)(yt,{id:d}):null,p.length>0?(0,q.jsx)(`ul`,{className:`grid max-h-64 min-w-0 gap-1 overflow-y-auto`,children:p.map(e=>{let n=f.get(e),r=c.data?.find(t=>t.id===e);return(0,q.jsxs)(`li`,{className:`min-w-0 rounded-md bg-muted/40 px-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2`,children:[(0,q.jsx)(W,{to:`/tasks/${e}`,"aria-label":`Worker task ${e}`,className:lt,children:r?l(r):`Worker ${e.slice(0,8)}`}),(0,q.jsx)(`span`,{className:`px-2 text-xs`,children:n?.status??(t.isSuccess?`Record unavailable or deleted`:`Status unavailable`)})]}),n?.destroy?(0,q.jsx)(Y,{state:n.destroy}):null]},e)})}):u?.role===`root`&&t.isSuccess?(0,q.jsx)(`p`,{className:`px-2`,children:`No workers`}):null,t.fetchStatus===`paused`?(0,q.jsx)(`p`,{role:`status`,className:`px-2`,children:`Offline — relationship details will refresh when connected.`}):t.isPending?(0,q.jsx)(`p`,{role:`status`,className:`px-2`,children:`Loading relationships…`}):null,t.isError?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-2`,children:[(0,q.jsx)(`p`,{role:`status`,children:`Could not load relationships. Known task links are retained.`}),(0,q.jsx)(D,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry relationships`})]}):null]})]})}function pt({run:e,open:t,onToggle:n}){let r=w(e.id),i=E(),a=$e(),o=e.delegation,s=o?.role===`worker`?o.parentRunId:r.data?.parentRunId,u=new Map(r.data?.workers.map(e=>[e.workerId,e])),d=J(o,r.data),f=o&&o.role!==`invalid`?o.wait:void 0,p=S(o);return(0,q.jsx)(ct,{slot:`workers`,icon:(0,q.jsx)(se,{className:`size-4`}),title:`Workers`,meta:mt({ids:d,workers:u,parentId:s,desktop:a,query:r}),open:t,onToggle:n,children:(0,q.jsxs)(`div`,{"aria-label":`Task relationships`,className:`min-w-0 text-[13px] text-muted-foreground`,role:`group`,children:[o?.role===`worker`&&o.destroy?(0,q.jsx)(Y,{state:o.destroy}):null,f?(0,q.jsx)(vt,{wait:f,dependencyLabel:p}):null,s?(0,q.jsx)(yt,{id:s}):null,d.length>0?(0,q.jsx)(`ul`,{className:`grid max-h-64 min-w-0 gap-0.5 overflow-y-auto`,children:d.map(e=>{let t=u.get(e),n=i.data?.find(t=>t.id===e),a=t?gt(t.status):r.isSuccess?`Record unavailable or deleted`:`Status unavailable`;return(0,q.jsxs)(`li`,{"data-slot":`worker-item`,"data-status":t?.status,className:`min-w-0`,children:[(0,q.jsxs)(W,{to:`/tasks/${e}`,"aria-label":`Worker task ${e}`,className:`group flex min-h-11 min-w-0 items-center gap-2.5 rounded-md px-1 text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,q.jsx)(ht,{status:t?.status}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n?l(n):`Worker ${e.slice(0,8)}`}),(0,q.jsx)(`span`,{className:L(`max-w-[45%] shrink-0 truncate text-xs`,_t(t?.status)),children:a}),(0,q.jsx)(c,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground`})]}),t?.destroy?(0,q.jsx)(Y,{state:t.destroy}):null]},e)})}):o?.role===`root`&&r.isSuccess?(0,q.jsx)(`p`,{className:`px-1 py-1`,children:`No workers`}):null,r.fetchStatus===`paused`?(0,q.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Offline — relationship details will refresh when connected.`}):r.isPending?(0,q.jsx)(`p`,{role:`status`,className:`px-1 py-1`,children:`Loading relationships…`}):null,r.isError?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-1 py-1`,children:[(0,q.jsx)(`p`,{role:`status`,children:`Could not load relationships. Known task links are retained.`}),(0,q.jsx)(D,{variant:`outline`,className:`min-h-11`,onClick:()=>void r.refetch(),children:`Retry relationships`})]}):null]})})}function mt({ids:e,workers:t,parentId:n,desktop:r,query:i}){if(e.length===0)return i.isError?`Unavailable`:i.isPending?`Linking…`:n?`Parent linked`:`No workers`;let a=`${e.length} linked`;if(!r)return a;let o=new Map;for(let n of e){let e=t.get(n)?.status;e!==void 0&&o.set(e,(o.get(e)??0)+1)}return[a,...[...o.entries()].map(([e,t])=>`${t} ${e}`)].join(` · `)}function ht({status:e}){let t=`size-[15px] shrink-0`;return e===`done`?(0,q.jsx)(g,{"aria-hidden":!0,className:L(t,`text-success`)}):e===`failed`?(0,q.jsx)(k,{"aria-hidden":!0,className:L(t,`text-danger`)}):e===`cancelled`?(0,q.jsx)(ve,{"aria-hidden":!0,className:L(t,`text-soft-foreground`)}):e===`running`||e===`waiting`||e===`review`?(0,q.jsx)(qe,{role:`status`,"aria-label":`Worker running`,className:L(t,`animate-spin stroke-pending motion-reduce:animate-none`)}):(0,q.jsx)(ie,{"aria-hidden":!0,className:L(t,`text-soft-foreground`)})}function gt(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function _t(e){return e===`done`?`text-success`:e===`failed`?`text-danger`:`text-muted-foreground`}function vt({wait:e,dependencyLabel:t}){return(0,q.jsxs)(`p`,{className:`px-2 break-words`,children:[e.phase===`parked`&&t?`${t.charAt(0).toUpperCase()}${t.slice(1)}`:e.requestIds?e.phase===`parked`?`Waiting on request replies`:e.phase===`wake-pending`?`Conversation update queued for this task`:`Request wait registered — the agent is finishing its turn`:e.phase===`parked`?`Waiting on workers`:e.phase===`wake-pending`?`Worker update queued for the parent`:`Worker wait registered — the agent is finishing its turn`,`.`,` `,`Deadline: `,(0,q.jsx)(`time`,{dateTime:e.deadline,children:e.deadline})]})}function yt({id:e}){let t=_(e);return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2`,children:[(0,q.jsx)(W,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,className:lt,children:t.data?`Parent · ${l(t.data)}`:`Parent task ${e}`}),t.isError?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`px-2 text-xs`,children:`Parent record unavailable or deleted`}),(0,q.jsx)(D,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}function Y({state:e}){return e.phase===`complete`&&e.remaining.length===0&&e.error===void 0?null:(0,q.jsxs)(`p`,{className:`px-2 pb-2 break-words`,children:[e.phase===`incomplete`?`Cleanup incomplete`:e.phase===`complete`?`Cleanup complete`:`Cleanup ${e.phase}`,e.remaining.length?` — remaining: ${e.remaining.join(`, `)}`:``,e.error?` — ${e.error}`:``]})}function X(e){switch(e){case`done`:return`done`;case`running`:case`waiting`:case`review`:return`active`;case`failed`:case`cancelled`:return`failed`;case`pending`:case`skipped`:return`pending`}}function bt(e){if(e.length===0)return 0;let t=new Set([`done`,`failed`,`cancelled`,`skipped`]),n=new Set([`running`,`waiting`,`review`]),r=0;for(let i of e)t.has(i.status)?r+=1:n.has(i.status)&&(r+=.5);return r/e.length}function Z({steps:e}){if(e.length===0)return null;let t=bt(e)*100;return(0,q.jsxs)(`div`,{"data-slot":`step-rail`,className:`flex min-w-0 flex-col gap-1`,children:[e.map((t,n)=>(0,q.jsxs)(`div`,{"data-slot":`step-row`,"data-visual":X(t.status),className:`flex min-h-[22px] min-w-0 items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,q.jsx)(xt,{visual:X(t.status)}),(0,q.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:t.name}),t.iterations>1?(0,q.jsxs)(`span`,{"data-slot":`step-iterations`,className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:[`×`,t.iterations]}):null,(0,q.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 text-[11.5px] text-soft-foreground tabular-nums`,children:[t.kind,` · step `,n+1,` of `,e.length]})]},t.id)),(0,q.jsx)(`div`,{"data-slot":`step-progress`,className:`mt-1 h-0.5 overflow-hidden rounded-full bg-muted`,children:(0,q.jsx)(`div`,{className:`h-full rounded-full bg-pending`,style:{width:`${t}%`}})})]})}function xt({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,q.jsx)(g,{"aria-hidden":!0,className:L(t,`text-success`)});case`active`:return(0,q.jsx)(qe,{role:`status`,"aria-label":`Step running`,className:L(t,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,q.jsx)(k,{"aria-hidden":!0,className:L(t,`text-danger`)});case`pending`:return(0,q.jsx)(ie,{"aria-hidden":!0,className:L(t,`text-soft-foreground`)})}}function St(e){let t=e.findIndex(e=>X(e.status)===`active`);if(t>=0)return t;let n=e.findIndex(e=>X(e.status)===`pending`);return n>=0?n:Math.max(0,e.length-1)}function Ct({visual:e}){return(0,q.jsx)(`span`,{"aria-hidden":!0,"data-slot":`step-dot`,"data-visual":e,className:L(`size-1.5 rounded-full`,e===`done`?`bg-success`:e===`failed`?`bg-danger`:e===`active`?`bg-pending`:`bg-soft-foreground`,e===`active`&&`animate-pulse motion-reduce:animate-none`)})}var wt=new Map;function Tt({runId:e,steps:t}){let[n,r]=(0,K.useState)(()=>wt.get(e)??!1);if(t.length===0)return null;let i=t=>{wt.set(e,t),r(t)},a=St(t),o=t[a],s=bt(t)*100;return(0,q.jsxs)(Ae,{"data-slot":`workflow-steps`,open:n,onOpenChange:i,className:`min-w-0`,children:[(0,q.jsxs)(ke,{"aria-label":`Workflow: ${o.name}, step ${a+1} of ${t.length}`,className:`group flex min-h-11 w-full items-center gap-2 text-left text-xs text-muted-foreground hover:text-foreground md:min-h-[30px] md:gap-2.5`,children:[(0,q.jsx)(`span`,{"data-slot":`step-dots`,className:`flex shrink-0 items-center gap-1`,children:t.map(e=>(0,q.jsx)(Ct,{visual:X(e.status)},e.id))}),(0,q.jsx)(`span`,{className:`min-w-0 max-w-[45%] shrink truncate font-semibold text-foreground`,children:o.name}),(0,q.jsxs)(`span`,{className:`shrink-0 text-soft-foreground tabular-nums`,children:[`step `,a+1,` of `,t.length]}),(0,q.jsx)(`span`,{"data-slot":`step-summary-progress`,className:`h-0.5 min-w-[36px] flex-1 overflow-hidden rounded-full bg-muted`,children:(0,q.jsx)(`span`,{className:`block h-full rounded-full bg-pending`,style:{width:`${s}%`}})}),(0,q.jsx)(x,{"aria-hidden":!0,className:`size-4 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-180`})]}),(0,q.jsx)(Oe,{children:(0,q.jsx)(`div`,{className:`pt-2`,children:(0,q.jsx)(Z,{steps:t})})})]})}var Et=new Map;function Dt({run:e,tab:t=`session`,hasPendingHumanAsk:n=!1,onMarkedUnread:r}){let i=re(e,n),a=U(e),[o,s]=(0,K.useState)(!1),[c,l]=(0,K.useState)(!1),u=kt(e,r),[,d]=(0,K.useReducer)(e=>e+1,0),f=(0,K.useId)(),p=Ke(),m=JSON.stringify([p,e.id]),h=Et.get(m)??!1,g=()=>{Et.set(m,!h),d()},_=E(),v=be(),y=Qe(v.data),b=e.status===`queued`?ne(_.data??[]).get(e.id):void 0;return(0,q.jsxs)(`header`,{"data-slot":`run-header`,className:L(`relative z-20 bg-background px-[18px] pt-[18px] md:px-9 md:pt-7`,t===`session`&&`md:sticky md:top-0`),children:[(0,q.jsxs)(`div`,{className:`w-full`,children:[(0,q.jsxs)(`div`,{"data-slot":`run-title-row`,className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 md:flex-nowrap`,children:[(0,q.jsx)(`p`,{"data-slot":`session-kind`,className:`text-[10px] font-semibold tracking-[0.14em] text-muted-foreground uppercase md:hidden`,children:e.delegation?.role===`worker`?`Worker session`:e.delegation?.role===`root`?`Parent session`:`Task session`}),(0,q.jsx)(At,{run:e}),(0,q.jsxs)(Ue,{dot:i.tone,pulse:i.pulse,children:[i.label,b===void 0?``:` #${b}`]}),(0,q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[(0,q.jsx)(D,{variant:`ghost`,size:`icon-sm`,className:`size-11 md:hidden`,"aria-label":h?`Hide run details`:`Show run details`,"aria-controls":f,"aria-expanded":h,onClick:g,children:(0,q.jsx)(x,{"aria-hidden":`true`,className:L(`transition-transform motion-reduce:transition-none`,h&&`rotate-180`)})}),t!==`session`&&a.archive?(0,q.jsx)(ot,{run:e}):null,(0,q.jsx)(Ft,{run:e,actions:u,onOpenChooser:()=>l(!0),onToggleNotes:()=>s(e=>!e)})]})]}),(0,q.jsx)(`div`,{id:f,"data-slot":`run-details`,className:L(h?`block`:`hidden`,`md:block`),children:(0,q.jsx)(jt,{run:e,showTokens:y.tokens,showCost:y.cost,automationsAvailable:v.data?.capabilities?.automations===!0})}),(0,q.jsx)(Mt,{run:e}),(0,q.jsx)(Nt,{run:e}),(0,q.jsxs)(`div`,{"data-slot":`run-tabs`,className:`mt-3 flex flex-wrap items-end gap-1 border-b border-border md:mt-5 max-md:[&>a]:min-h-11`,children:[(0,q.jsx)(G,{to:`/tasks/${e.id}`,active:t===`session`,children:`Session`}),(0,q.jsx)(G,{to:`/tasks/${e.id}/changes`,active:t===`changes`,children:`Changes`}),(0,q.jsx)(G,{to:`/tasks/${e.id}/commits`,active:t===`commits`,children:`Commits`}),(0,q.jsx)(G,{to:`/tasks/${e.id}/files`,active:t===`files`,children:`Files`})]}),t===`session`?null:(0,q.jsx)(ut,{run:e}),t!==`session`&&e.steps.length>0?(0,q.jsx)(`div`,{className:`border-t border-border pt-1 pb-0 md:pt-2 md:pb-1`,children:(0,q.jsx)(Tt,{runId:e.id,steps:e.steps})}):null,o?(0,q.jsx)(Lt,{runId:e.id,onClose:()=>s(!1)}):null,c?(0,q.jsx)(Ot,{run:e,canResume:U(e).terminal,onResume:()=>u.terminal.mutate(),onClose:()=>l(!1)}):null]}),(0,q.jsx)(It,{run:e,actions:u})]})}function Ot({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let a=de(),o=y(),s=b({mutationFn:t=>v(e.id,t),onError:e=>N(e.message,{tone:`danger`})}),c=ae(o.data),l=e=>!o.isSuccess||c.includes(e??`claude`),u=t&&l(Re(e)),d=e.worktreePath?(a.data?.targets??[]).filter(e=>{let t=We(e.id);return t===void 0||l(t)}).map(t=>({target:t,...Le(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[];if(!u&&d.length===0)return null;let f=()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>N(`Worktree path copied`)).catch(()=>N(`Path: ${t}`))};if(r)return(0,q.jsx)(z,{onSelect:r,children:`Open in…`});let p=ze(e);return(0,q.jsxs)(`section`,{"aria-label":`Open task worktree in…`,className:`task-action-panel my-5 rounded-xl border border-border bg-card p-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,q.jsx)(D,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,q.jsx)(F,{})})]}),e.worktreePath?(0,q.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,q.jsxs)(`div`,{className:`task-open-targets mt-4 flex flex-wrap gap-3`,children:[u?(0,q.jsxs)(D,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,q.jsx)(Je,{}),`Terminal (resume session)`]}):null,d.map(({target:e,suffix:t,title:n})=>{let r=Ie(e);return(0,q.jsxs)(D,{variant:`outline`,"data-target":e.id,title:n,disabled:s.isPending,onClick:()=>s.mutate(e.id),children:[(0,q.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,q.jsxs)(D,{variant:`outline`,onClick:f,children:[(0,q.jsx)(O,{}),`Copy worktree path`]}):null]}),p?(0,q.jsxs)(`div`,{className:`mt-5 border-t border-border pt-5`,children:[(0,q.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,q.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:p}),(0,q.jsxs)(D,{variant:`outline`,onClick:()=>void Q(p,`Command copied to clipboard.`),children:[(0,q.jsx)(O,{}),`Copy resume command`]})]}):null]})}function kt(e,t){let n=r(),i=Ge(),[a,o]=(0,K.useState)(null),s=()=>n.invalidateQueries({queryKey:le.runs.all}),c=e=>N(e.message,{tone:`danger`}),l=p(),u={isPending:l.isPending,mutate:()=>l.mutate({id:e.id,pinned:!e.pinned})},d=fe();return{pin:u,markUnread:{isPending:d.isPending,mutate:()=>{t?.(),d.mutate(e.id,{onError:c})}},delete:b({mutationFn:()=>xe(e.id),onSuccess:()=>{s(),i(`/`)},onError:c}),terminal:b({mutationFn:()=>Se(e.id),onError:e=>{if(e instanceof he&&e.command){Q(e.command,`No terminal found — command copied to clipboard.`);return}c(e)}}),confirming:a,setConfirming:o}}async function Q(e,t){try{await navigator.clipboard.writeText(e),N(t)}catch{N(`Run manually: ${e}`)}}function At({run:e}){let t=d(e.id),n=l(e),r=He(n,e=>t.mutate({title:e},{onError:e=>N(e.message,{tone:`danger`})}));return r.editing?(0,q.jsx)(Ve,{editor:r,className:`flex-1 text-[15px] font-semibold`}):(0,q.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,q.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:n}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,onClick:r.begin,className:`shrink-0 rounded-sm p-1 text-soft-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,q.jsx)(Ne,{className:`size-3.5`,"aria-hidden":`true`})})]})}function jt({run:e,showTokens:t,showCost:n,automationsAvailable:r}){let a=m(),o=te(),s=(0,K.useMemo)(()=>u(e,a),[e,a]),c=(0,K.useMemo)(()=>o===void 0?[]:s.map(e=>({projectId:o,kind:e.kind,number:e.number})),[s,o]),d=[(0,q.jsx)(`span`,{className:`min-w-0 max-w-full break-all`,children:Ce(e)},`workflow`)];e.branch&&d.push((0,q.jsx)(`span`,{"data-slot":`branch-chip`,className:`rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium max-md:max-w-full max-md:break-all`,children:e.branch},`branch`));let p=s.filter(e=>e.kind===`PR`);for(let t of p)d.push((0,q.jsx)(H,{reference:t,taskTitle:l(e),className:`h-5`,conflictAction:(0,q.jsx)(Be,{run:e,prNumber:t.number})},`pr-${t.number}`));let g=i(e);g&&I(g)&&!p.some(e=>e.url===g)&&d.push((0,q.jsx)(H,{reference:{kind:`PR`,url:g},taskTitle:l(e),className:`h-5`},`pr`));let _=h(e,a);if(_&&I(_)){let t=f(_);d.push((0,q.jsx)(H,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:_},taskTitle:l(e),className:`h-5`},`issue`))}e.diffStat&&d.push((0,q.jsx)(Xe,{stat:e.diffStat},`diff`)),e.automation&&d.push(r?(0,q.jsx)(W,{to:`/automations/${encodeURIComponent(e.automation.automationId)}/log`,className:`rounded-sm border border-border bg-card px-1.5 py-px text-[11px] font-medium hover:text-foreground`,children:`Automation`},`automation`):(0,q.jsx)(`span`,{"data-slot":`automation-origin`,title:`Automations are off on this server (CEZ_AUTOMATIONS)`,className:`rounded-sm border border-border bg-card px-1.5 py-px text-[11px] font-medium`,children:`Automation`},`automation`));let v=[];return t&&(e.inputTokens!==void 0||e.outputTokens!==void 0)&&v.push((0,q.jsx)(Ze,{inputTokens:e.inputTokens,outputTokens:e.outputTokens},`tokens`)),n&&e.costUsd&&v.push((0,q.jsx)(`span`,{className:`tabular-nums`,children:pe(e.costUsd)},`cost`)),(0,q.jsx)(Pe,{projectId:o,requests:c,children:(0,q.jsxs)(`div`,{"data-slot":`run-meta`,className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground md:mt-1.5 md:gap-y-1`,children:[d.map((e,t)=>(0,q.jsxs)(K.Fragment,{children:[t>0?(0,q.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,q.jsxs)(`span`,{className:`ml-auto flex min-w-0 max-w-full items-center gap-1.5`,children:[v.map((e,t)=>(0,q.jsxs)(K.Fragment,{children:[t>0?(0,q.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,q.jsx)(Pt,{run:e})]})]})})}function $(e){let t=e.ciWait;return[`running`,`queued`,`waiting`].includes(e.status)&&t&&t.phase!==`delivered`&&t.phase!==`withdrawn`?t:void 0}function Mt({run:e}){let t=$(e),n=t??e.lastCiWait;if(!t&&e.lastCiWaitError)return(0,q.jsx)(`div`,{"data-slot":`ci-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`mt-1 min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:e.lastCiWaitError});if(!n)return null;let r=n.result,i={passed:`CI checks passed — observed checks only; not merge approval`,failed:`CI checks failed — inspect the PR checks`,cancelled:`CI wait cancelled`,skipped:`CI checks skipped — inspect the PR checks`,no_checks:`No CI checks found — inspect the PR workflows`,deadline:`CI wait timed out — inspect the PR checks`,error:`CI wait unavailable — inspect access and the PR checks`,head_changed:`CI head changed — ${r?.headSha.slice(0,7)} → ${r?.observedHeadSha?.slice(0,7)??`unknown`}`},a=t?n.phase===`wake-pending`?e.status!==`running`||e.activity===`monitoring`?`CI result ready — waiting for capacity`:`CI result ready — current turn still working`:`Waiting for CI`:r?i[r.outcome]:n.phase===`withdrawn`?`CI wait cancelled`:`CI wait unavailable`,o=t?n.deadline:r?.observedAt,s=o?new Date(o):void 0,c=s&&Number.isFinite(s.getTime())?new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(s):void 0,l=`${n.repository}#${n.prNumber}`;return(0,q.jsxs)(`div`,{"data-slot":`ci-wait-status`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`mt-1 min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-1`,children:[(0,q.jsx)(`span`,{children:a}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:`—`}),I(n.prUrl)?(0,q.jsx)(`a`,{href:n.prUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-h-11 min-w-11 max-w-full items-center rounded-sm px-1 font-medium text-foreground underline underline-offset-2 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:l}):(0,q.jsx)(`span`,{children:l})]}),c?(0,q.jsxs)(`p`,{children:[t?`Deadline`:`Observed`,` `,(0,q.jsx)(`time`,{dateTime:o,children:c})]}):t?(0,q.jsx)(`p`,{children:`CI deadline unavailable`}):null]})}function Nt({run:e}){if($(e)||e.status!==`running`||e.activity!==`monitoring`)return null;if(e.monitoringWakeCapReached)return(0,q.jsx)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:`Automatic checks paused — 40/40 reached`});let t=e.monitoringWakeAt?new Date(e.monitoringWakeAt):null,n=t&&Number.isFinite(t.getTime())?t:null;if(!n)return(0,q.jsx)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:`Parked — no automatic check scheduled`});let r=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n);return(0,q.jsxs)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:[`Next automatic check`,` `,(0,q.jsx)(`time`,{dateTime:e.monitoringWakeAt,className:`font-medium text-foreground`,children:r})]})}function Pt({run:e}){let t=oe(),n=ye(),{accounts:r}=je(),i=e.runner??t.data?.defaultRunner??`claude`,a=e.model??`auto`,s=e.effort||void 0,c=[...e.steps].reverse().find(e=>e.profileId),l=c?.profileId,u=c?.backend??i,d=n.data?.profiles.find(e=>e.id===l),f=l===void 0||n.isPending?void 0:n.isError?l:d?Me(r,u)?l==="default"?`default`:d.label:void 0:`${l} (removed)`,p=e.modelIdentity&&e.modelIdentity!==a?e.modelIdentity:void 0,m=[i,f,a,s].filter(Boolean).join(` · `);return(0,q.jsxs)(De,{children:[(0,q.jsx)(B,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,"data-slot":`agent-badge`,title:m,"aria-label":`Agent: ${i}, ${f?`account ${f}, `:``}model ${a}${s?`, effort ${s}`:``}`,className:`flex min-w-0 shrink items-center max-md:min-h-11 gap-1.5 rounded-sm px-1 py-1 text-soft-foreground hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:[(0,q.jsx)(o,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{"data-slot":`agent-badge-summary`,className:`truncate font-mono text-[11px]`,children:m})]})}),(0,q.jsxs)(Ee,{align:`end`,className:`min-w-[9rem] max-md:max-w-[calc(100vw-2rem)] max-md:break-all`,children:[(0,q.jsxs)(R,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`runner: `,i]}),f?(0,q.jsxs)(R,{"data-slot":`agent-badge-account`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`account: `,f]}):null,(0,q.jsxs)(R,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`model: `,a]}),s?(0,q.jsxs)(R,{"data-slot":`agent-badge-effort`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`effort: `,s]}):null,p?(0,q.jsxs)(R,{"data-slot":`agent-badge-identity`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`identity: `,p]}):null]})]})}function Ft({run:e,actions:t,onToggleNotes:n,onOpenChooser:r}){let i=U(e),o=ze(e);return(0,q.jsxs)(De,{children:[(0,q.jsx)(B,{asChild:!0,children:(0,q.jsx)(D,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,q.jsx)(_e,{"aria-hidden":`true`})})}),(0,q.jsxs)(Ee,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,q.jsx)(R,{className:`px-2 py-3 text-[10px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),(0,q.jsxs)(z,{onSelect:n,children:[(0,q.jsx)(et,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,q.jsx)(Ot,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),o?(0,q.jsxs)(z,{onSelect:()=>void Q(o,`Command copied to clipboard.`),children:[(0,q.jsx)(O,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.markUnread?(0,q.jsxs)(z,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,q.jsx)(tt,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,q.jsxs)(Te,{"data-slot":`pin-run`,className:`min-h-11`,checked:!!e.pinned,disabled:t.pin.isPending,onCheckedChange:()=>t.pin.mutate(),children:[e.pinned?(0,q.jsx)(nt,{"aria-hidden":`true`}):(0,q.jsx)(a,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,i.deleteRun?(0,q.jsx)(we,{}):null,i.deleteRun?(0,q.jsxs)(z,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,q.jsx)(s,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})}function It({run:e,actions:t}){let n=t.confirming;return(0,q.jsx)(P,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,q.jsxs)(ce,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,q.jsxs)(M,{children:[(0,q.jsx)(T,{className:`text-danger`,children:`Delete task permanently?`}),(0,q.jsx)(C,{children:(0,q.jsxs)(q.Fragment,{children:[`Delete “`,(0,q.jsx)(`span`,{className:`font-medium text-foreground`,title:l(e),children:l(e)}),`” and its transcript, worktree and branch. This cannot be undone.`]})})]}),(0,q.jsxs)(A,{children:[(0,q.jsx)(j,{children:`Cancel`}),(0,q.jsx)(me,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{t.delete.mutate(),t.setConfirming(null)},children:`Delete task`})]})]})})}function Lt({runId:e,onClose:t}){let n=ue(e);return(0,q.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 rounded-xl border border-border bg-card p-6`,children:[(0,q.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,q.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,q.jsx)(D,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,q.jsx)(F,{})})]}),n.isPending?(0,q.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,q.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,q.jsx)(Ye,{children:n.data}):(0,q.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`}),(0,q.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,q.jsx)(D,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void Q(n.data??``,`Notes copied`),children:`Copy notes`}),(0,q.jsx)(D,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{pt as a,st as c,X as i,ot as l,Z as n,dt as o,St as r,ct as s,Dt as t,et as u};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,En as i,Gt as a,It as o,Ln as s,Lt as c,Q as l,Rt as u,Sr as d,Ta as f,U as p,Ut as m,Wt as h,Yi as g,Yt as _,Zi as v,br as y,d as b,fr as x,gi as S,in as C,jt as w,l as T,nn as E,ot as D,pr as O,ri as k,sa as A,ti as j,ui as M,vr as N,wa as P}from"./alert-dialog-CmDuefYh.js";import{t as F}from"./utils-CUnaAifW.js";import{a as ee,i as te,n as ne,o as re,r as ie,s as ae}from"./textarea-CxRdTWlq.js";import{T as oe}from"./prompt-templates-iV2WD2jy.js";import{c as I,t as L}from"./project-router-SwsXRKXs.js";import{i as R,l as z,n as B,o as V,p as H}from"./skills-DFBiAuJG.js";import{c as U,h as W,o as G,t as K}from"./index-DWWI-B9n.js";import{t as se}from"./skill-empty-hint-oOtzR3v0.js";var q=e(t(),1),J=n(),ce=`https://github.com/open-mercato/skills`;function le(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function Y(e,t){return le(e)??[...t]}function X({projectId:e}){let t=r(),n=y(),s=i(),[c,l]=(0,q.useState)(``),f=O(e,!!e),p=s.data??[],m=(0,q.useMemo)(()=>p.map(e=>e.name),[p]),v=(0,q.useRef)([]);v.current=m;let b=(0,q.useMemo)(()=>new Set(Y(n.data,m)),[n.data,m]),x=(0,q.useRef)(Promise.resolve()),S=(0,q.useRef)(0),E=(0,q.useCallback)(e=>{let n=d.uiState,r=t.getQueryData(n),i=e(Y(r,v.current));t.setQueryData(n,{...r,importedSkills:i});let a=++S.current;x.current=x.current.then(async()=>{try{let e=await g({importedSkills:i});a===S.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:C.skills}))}catch(e){A(e instanceof Error?e.message:String(e),{tone:`danger`}),a===S.current&&t.invalidateQueries({queryKey:n})}})},[t]),D=(0,q.useCallback)(e=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[E]),k=m.length>0&&m.every(e=>b.has(e)),j=(0,q.useCallback)(()=>{if(k){let e=new Set(v.current);E(t=>t.filter(t=>!e.has(t)))}else E(e=>[...new Set([...e,...v.current])])},[k,E]);if(s.isError)return(0,J.jsx)(T,{icon:(0,J.jsx)(_,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:s.error.message});let M=z(p,c);return(0,J.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`w-full min-w-0 [&_button]:min-h-11`,children:[(0,J.jsx)(`p`,{className:`mb-4 text-[10px] font-medium tracking-wide text-link-foreground`,children:`OPEN-MERCATO / SKILLS`}),(0,J.jsx)(`h2`,{className:`text-2xl font-medium`,children:`Manage skills`}),(0,J.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,J.jsx)(`a`,{href:ce,target:`_blank`,rel:`noreferrer`,children:`open-mercato`}),` skills appear in your catalog and composer picker. All are enabled by default; uncheck any you don’t want.`]}),(0,J.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Applies across projects · saved automatically`}),(0,J.jsx)(ue,{projectId:e,state:f.data,loadError:f.error}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Checkboxes control visibility. Updating refreshes installed skill files; it does not change your selection.`}),(0,J.jsxs)(`div`,{className:`sw-import-controls mt-4 flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`sw-search relative min-w-0 flex-1`,children:[(0,J.jsx)(u,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(W,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:c,onChange:e=>l(e.target.value),className:`h-11 min-w-0 pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`import-all`,disabled:m.length===0||n.isPending,onClick:j,className:`h-11 shrink-0 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[k?(0,J.jsx)(w,{"aria-hidden":`true`,className:`size-4`}):(0,J.jsx)(o,{"aria-hidden":`true`,className:`size-4`}),k?`Remove all`:`Enable all`]})]}),(0,J.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:s.isPending?(0,J.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):M.length>0?M.map(e=>{let t=b.has(e.name);return(0,J.jsxs)(`label`,{"data-slot":`import-row`,"data-skill":e.name,"data-imported":t?`true`:void 0,className:F(`flex min-h-16 cursor-pointer items-start gap-3 rounded-lg border border-border p-4 transition-colors hover:bg-muted`,t&&`bg-background`),children:[(0,J.jsxs)(`span`,{className:`relative size-5 shrink-0`,children:[(0,J.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>D(e.name),className:`peer absolute inset-0 m-0 size-5 opacity-0`}),t?(0,J.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`}):(0,J.jsx)(a,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`})]}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:`min-w-0 break-words text-[13px] font-medium text-foreground`,children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`mt-2 block text-xs leading-relaxed text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,J.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:p.length>0?`(no skills match)`:`(no skills available — the repo may still be cloning)`})})]})}function Z(e){return e===`project`?`Project installation`:`Global installation`}function ue({projectId:e,state:t,loadError:n}){let i=r(),a=I(),o=(0,q.useRef)(0),[s,u]=(0,q.useState)(!1),p=f({mutationFn:()=>S({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{u(!1),a(oe(e))},onError:e=>A(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===o.current&&(i.setQueryData(d.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(i.invalidateQueries({queryKey:C.skills}),A(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),u(!0)))},h=(e,t)=>{t.seq===o.current&&A(e.message,{tone:`danger`})},g=f({mutationFn:t=>M(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),_=f({mutationFn:t=>k(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),v=e=>{let n=++o.current;e===`apply`?_.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):g.mutate({action:e,seq:n})},y=t?.scopes.some(e=>e.skills.length>0)??!1,x=t?.status===`error`,w=y&&(t?.available||x),T=_.isPending||t?.status===`updating`,E=t?.scopes.filter(e=>e.status===`error`||e.status===`unavailable`)??[],D=t?.scopes.filter(e=>e.updatedAt&&!E.includes(e))??[],O=`Checking installed Open Mercato skills…`;return n?O=`Update status is unavailable right now.`:t?.status===`available`?O=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?O=`Updating installed Open Mercato skills…`:t?.status===`current`?O=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?O=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(O=`The update did not finish for every installation.`),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`mt-4 rounded-lg border border-border bg-background p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:O}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Project and global installations are checked separately.`}),t?.checkedAt?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,t?.scopes.some(e=>e.skills.length>0)?(0,J.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,J.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,E.length>0?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,E.map(e=>Z(e.scope)).join(`, `),D.length?`; updated: ${D.map(e=>Z(e.scope)).join(`, `)}`:``,`.`]}):null]}),w?(0,J.jsxs)(b,{"data-action":`skills-update-apply`,size:`sm`,disabled:T,onClick:()=>v(`apply`),children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:F(`size-3.5`,T&&`motion-safe:animate-spin`)}),T?`Updating…`:x?`Retry`:`Update now`]}):t?.status===`current`?(0,J.jsxs)(b,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-4`}),`Check again`]}):t?.status===`unavailable`||n?(0,J.jsx)(b,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,J.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,J.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,J.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,J.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-accent-strong/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,J.jsx)(l,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-link-foreground`}),(0,J.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,J.jsx)(ne,{open:s,onOpenChange:e=>p.isPending?void 0:u(e),children:(0,J.jsxs)(ie,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,J.jsxs)(re,{children:[(0,J.jsx)(ae,{children:`Apply the upgrade notes now?`}),(0,J.jsxs)(te,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,J.jsxs)(ee,{children:[(0,J.jsx)(b,{type:`button`,variant:`outline`,disabled:p.isPending,onClick:()=>u(!1),children:`No`}),(0,J.jsx)(b,{type:`button`,disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function de(){return(0,J.jsx)(`div`,{"data-route":`skills`,className:`mx-auto min-h-full w-full px-[18px] py-6 md:p-9`,children:(0,J.jsx)(fe,{})})}function fe(){let e=x(),t=N(),n=i(),[a]=P(),[o,l]=(0,q.useState)(``),d=r(),h=s(),g=j().projectId??h.data?.bootProject??``,y=f({mutationFn:()=>v(),onSuccess:e=>{d.setQueryData(C.skills,e),A(`Team skills refreshed.`)},onError:e=>A(e.message,{tone:`danger`})});if(e.isError)return(0,J.jsx)(T,{icon:(0,J.jsx)(_,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let b=V(e.data??[]),S=(n.data?.length??0)>0,w=a.get(`skill`),O=w===Q||w===$||w!==null&&b.some(e=>e.name===w)?w:b[0]?.name??(S?$:Q),k=b.find(e=>e.name===O)??null,M=B(b,o);return(0,J.jsxs)(`div`,{"data-slot":`skills-section`,className:`@container flex min-w-0 flex-col gap-[22px]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-4 @min-[700px]:flex-row @min-[700px]:items-center @min-[700px]:justify-between`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`text-[25px] font-semibold md:text-[30px]`,children:`Skills`}),(0,J.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground md:text-[13px]`,children:`Markdown playbooks your agents can follow.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[S?(0,J.jsxs)(L,{to:`/skills?skill=${$}`,"data-slot":`import-skills-row`,"aria-current":O===$?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Manage skills`]}):null,(0,J.jsxs)(L,{to:`/skills?skill=${Q}`,"data-slot":`bookmarklets-row`,"aria-current":O===Q?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Run from GitHub`]})]})]}),(0,J.jsxs)(`div`,{className:F(`flex-col items-start gap-2 sm:flex-row sm:items-center md:flex`,w===null?`flex`:`hidden`),children:[(0,J.jsxs)(`div`,{className:`sw-search relative w-full min-w-0 flex-1`,children:[(0,J.jsx)(u,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(W,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:o,onChange:e=>l(e.target.value),className:`h-11 min-w-0 bg-card pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:y.isPending,onClick:()=>y.mutate(),className:`flex h-11 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:F(`size-3`,y.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,J.jsxs)(`div`,{className:`grid min-w-0 items-start gap-[22px] md:grid-cols-[minmax(220px,310px)_minmax(0,1fr)]`,children:[(0,J.jsx)(`section`,{"data-slot":`skills-list`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card p-3 md:flex`,w===null?`flex`:`hidden`),children:(0,J.jsx)(`ul`,{"data-slot":`skill-rows`,className:`flex min-h-0 flex-col gap-1 overflow-y-auto md:max-h-[calc(100dvh-280px)]`,children:e.isPending?(0,J.jsx)(`li`,{role:`status`,"aria-busy":`true`,className:`min-h-72 p-3 text-[13px] text-soft-foreground`,children:`Loading skills…`}):M.length>0?M.map(e=>(0,J.jsx)(pe,{skill:e,active:O===e.name,highlighted:O===$&&e===b[0]},e.path)):(0,J.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:b.length>0?`(no skills match)`:(0,J.jsx)(se,{})})})}),(0,J.jsx)(`section`,{"data-slot":`skills-detail`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card md:flex`,w===null?`hidden`:`flex`),children:(0,J.jsxs)(`div`,{className:`min-w-0 p-5`,children:[(0,J.jsxs)(L,{to:`/skills`,"data-slot":`skills-back`,className:`mb-4 inline-flex min-h-11 items-center gap-2 rounded-lg border border-border px-3 text-xs font-medium hover:bg-muted md:hidden`,children:[(0,J.jsx)(p,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),O===$?(0,J.jsx)(X,{projectId:g}):O===Q?(0,J.jsx)(K,{skills:b}):k?(0,J.jsx)(G,{skill:k,usedBy:H(t.data?.workflows??[],k.name)}):e.isPending?(0,J.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`min-h-72 text-xs text-muted-foreground`,children:`Loading skill…`}):(0,J.jsx)(T,{icon:(0,J.jsx)(m,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})]})}function pe({skill:e,active:t,highlighted:n}){let r=R(e);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(L,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-highlighted":n||void 0,"data-project":r?`true`:void 0,"aria-current":t?`page`:void 0,className:F(`selection-row flex min-h-24 flex-col gap-2 rounded-lg border-b border-border p-3 transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground`,(t||n)&&`border-transparent bg-accent-strong/10`),children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:F(`min-w-0 break-words text-[13px]`,r?`font-semibold text-foreground`:`font-normal text-muted-foreground`),children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-supporting-foreground`,children:e.description}):null,(0,J.jsx)(U,{source:e.source,className:`self-start border-0 bg-transparent p-0 text-link-foreground`})]})})}export{de as SkillsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,En as i,Gt as a,It as o,Ln as s,Lt as c,Q as l,Rt as u,Sr as d,Ta as f,U as p,Ut as m,Wt as h,Yi as g,Yt as _,Zi as v,br as y,d as b,fr as x,gi as S,in as C,jt as w,l as T,nn as E,ot as D,pr as O,ri as k,sa as A,ti as j,ui as M,vr as N,wa as P}from"./alert-dialog-B422RI-k.js";import{t as F}from"./utils-PYYcpCFZ.js";import{a as ee,i as te,n as ne,o as re,r as ie,s as ae}from"./textarea-FjaU370i.js";import{T as oe}from"./prompt-templates-BlTGJB5W.js";import{c as I,t as L}from"./project-router-DbLkll25.js";import{i as R,l as z,n as B,o as V,p as H}from"./skills-DFBiAuJG.js";import{c as U,h as W,o as G,t as K}from"./index-D0RwD9-c.js";import{t as se}from"./skill-empty-hint-oOtzR3v0.js";var q=e(t(),1),J=n(),ce=`https://github.com/open-mercato/skills`;function le(e){let t=e?.importedSkills;if(Array.isArray(t))return t.filter(e=>typeof e==`string`&&!!e)}function Y(e,t){return le(e)??[...t]}function X({projectId:e}){let t=r(),n=y(),s=i(),[c,l]=(0,q.useState)(``),f=O(e,!!e),p=s.data??[],m=(0,q.useMemo)(()=>p.map(e=>e.name),[p]),v=(0,q.useRef)([]);v.current=m;let b=(0,q.useMemo)(()=>new Set(Y(n.data,m)),[n.data,m]),x=(0,q.useRef)(Promise.resolve()),S=(0,q.useRef)(0),E=(0,q.useCallback)(e=>{let n=d.uiState,r=t.getQueryData(n),i=e(Y(r,v.current));t.setQueryData(n,{...r,importedSkills:i});let a=++S.current;x.current=x.current.then(async()=>{try{let e=await g({importedSkills:i});a===S.current&&(t.setQueryData(n,e),t.invalidateQueries({queryKey:C.skills}))}catch(e){A(e instanceof Error?e.message:String(e),{tone:`danger`}),a===S.current&&t.invalidateQueries({queryKey:n})}})},[t]),D=(0,q.useCallback)(e=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[E]),k=m.length>0&&m.every(e=>b.has(e)),j=(0,q.useCallback)(()=>{if(k){let e=new Set(v.current);E(t=>t.filter(t=>!e.has(t)))}else E(e=>[...new Set([...e,...v.current])])},[k,E]);if(s.isError)return(0,J.jsx)(T,{icon:(0,J.jsx)(_,{}),tone:`danger`,heading:`h2`,title:`Could not load importable skills`,subtitle:s.error.message});let M=z(p,c);return(0,J.jsxs)(`div`,{"data-slot":`skills-import-panel`,className:`w-full min-w-0 [&_button]:min-h-11`,children:[(0,J.jsx)(`p`,{className:`mb-4 text-[10px] font-medium tracking-wide text-link-foreground`,children:`OPEN-MERCATO / SKILLS`}),(0,J.jsx)(`h2`,{className:`text-2xl font-medium`,children:`Manage skills`}),(0,J.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,J.jsx)(`a`,{href:ce,target:`_blank`,rel:`noreferrer`,children:`open-mercato`}),` skills appear in your catalog and composer picker. All are enabled by default; uncheck any you don’t want.`]}),(0,J.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Applies across projects · saved automatically`}),(0,J.jsx)(ue,{projectId:e,state:f.data,loadError:f.error}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Checkboxes control visibility. Updating refreshes installed skill files; it does not change your selection.`}),(0,J.jsxs)(`div`,{className:`sw-import-controls mt-4 flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`sw-search relative min-w-0 flex-1`,children:[(0,J.jsx)(u,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(W,{"data-slot":`import-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:c,onChange:e=>l(e.target.value),className:`h-11 min-w-0 pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`import-all`,disabled:m.length===0||n.isPending,onClick:j,className:`h-11 shrink-0 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[k?(0,J.jsx)(w,{"aria-hidden":`true`,className:`size-4`}):(0,J.jsx)(o,{"aria-hidden":`true`,className:`size-4`}),k?`Remove all`:`Enable all`]})]}),(0,J.jsx)(`div`,{"data-slot":`import-list`,className:`mt-3 flex flex-col gap-1.5`,children:s.isPending?(0,J.jsx)(`p`,{className:`px-1 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):M.length>0?M.map(e=>{let t=b.has(e.name);return(0,J.jsxs)(`label`,{"data-slot":`import-row`,"data-skill":e.name,"data-imported":t?`true`:void 0,className:F(`flex min-h-16 cursor-pointer items-start gap-3 rounded-lg border border-border p-4 transition-colors hover:bg-muted`,t&&`bg-background`),children:[(0,J.jsxs)(`span`,{className:`relative size-5 shrink-0`,children:[(0,J.jsx)(`input`,{type:`checkbox`,"data-slot":`import-toggle`,checked:t,onChange:()=>D(e.name),className:`peer absolute inset-0 m-0 size-5 opacity-0`}),t?(0,J.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`}):(0,J.jsx)(a,{"aria-hidden":`true`,className:`pointer-events-none size-5 text-link-foreground peer-focus-visible:outline-2 peer-focus-visible:outline-ring`})]}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:`min-w-0 break-words text-[13px] font-medium text-foreground`,children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`mt-2 block text-xs leading-relaxed text-soft-foreground`,children:e.description}):null]})]},e.name)}):(0,J.jsx)(`p`,{className:`px-1 py-2 text-xs text-soft-foreground`,children:p.length>0?`(no skills match)`:`(no skills available — the repo may still be cloning)`})})]})}function Z(e){return e===`project`?`Project installation`:`Global installation`}function ue({projectId:e,state:t,loadError:n}){let i=r(),a=I(),o=(0,q.useRef)(0),[s,u]=(0,q.useState)(!1),p=f({mutationFn:()=>S({task:`Apply the upgrade notes after updating the installed Open Mercato skills.`,steps:[{id:`apply-upgrade-notes`,name:`Apply upgrade notes`,skill:`om-apply-upgrade-notes`,prompt:`{{task}}`}]}),onSuccess:e=>{u(!1),a(oe(e))},onError:e=>A(e.message,{tone:`danger`})}),m=(t,n)=>{n.seq===o.current&&(i.setQueryData(d.skillsUpdate(e),t),n.action===`apply`&&t.updatedAt&&t.updatedAt!==n.previousUpdatedAt&&(i.invalidateQueries({queryKey:C.skills}),A(t.status===`error`?`Some skill updates failed.`:`Open Mercato skills updated.`),u(!0)))},h=(e,t)=>{t.seq===o.current&&A(e.message,{tone:`danger`})},g=f({mutationFn:t=>M(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),_=f({mutationFn:t=>k(e).then(e=>({result:e,request:t})),onSuccess:({result:e,request:t})=>m(e,t),onError:(e,t)=>h(e,t)}),v=e=>{let n=++o.current;e===`apply`?_.mutate({action:e,seq:n,previousUpdatedAt:t?.updatedAt??null}):g.mutate({action:e,seq:n})},y=t?.scopes.some(e=>e.skills.length>0)??!1,x=t?.status===`error`,w=y&&(t?.available||x),T=_.isPending||t?.status===`updating`,E=t?.scopes.filter(e=>e.status===`error`||e.status===`unavailable`)??[],D=t?.scopes.filter(e=>e.updatedAt&&!E.includes(e))??[],O=`Checking installed Open Mercato skills…`;return n?O=`Update status is unavailable right now.`:t?.status===`available`?O=`An update is available for your installed Open Mercato skills.`:t?.status===`updating`?O=`Updating installed Open Mercato skills…`:t?.status===`current`?O=`Installed Open Mercato skills are up to date.`:t?.status===`unavailable`?O=t.scopes.find(e=>e.reason)?.reason??`Automatic updates are unavailable.`:t?.status===`error`&&(O=`The update did not finish for every installation.`),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`section`,{"data-slot":`skills-update-card`,"aria-live":`polite`,className:`mt-4 rounded-lg border border-border bg-background p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:O}),(0,J.jsx)(`p`,{className:`mt-4 text-xs text-soft-foreground`,children:`Project and global installations are checked separately.`}),t?.checkedAt?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:[`Last checked `,new Date(t.checkedAt).toLocaleString(),`.`]}):null,t?.scopes.some(e=>e.skills.length>0)?(0,J.jsx)(`ul`,{className:`mt-1 text-xs text-soft-foreground`,children:t.scopes.filter(e=>e.skills.length>0).map(e=>(0,J.jsxs)(`li`,{children:[Z(e.scope),` · `,e.skills.length,` tracked`]},e.scope))}):null,E.length>0?(0,J.jsxs)(`p`,{className:`mt-1 text-xs text-destructive`,children:[`Failed: `,E.map(e=>Z(e.scope)).join(`, `),D.length?`; updated: ${D.map(e=>Z(e.scope)).join(`, `)}`:``,`.`]}):null]}),w?(0,J.jsxs)(b,{"data-action":`skills-update-apply`,size:`sm`,disabled:T,onClick:()=>v(`apply`),children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:F(`size-3.5`,T&&`motion-safe:animate-spin`)}),T?`Updating…`:x?`Retry`:`Update now`]}):t?.status===`current`?(0,J.jsxs)(b,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-4`}),`Check again`]}):t?.status===`unavailable`||n?(0,J.jsx)(b,{"data-action":`skills-update-check`,variant:`outline`,size:`sm`,disabled:g.isPending,onClick:()=>v(`check`),children:`Retry check`}):null]}),t?.status===`unavailable`||n?(0,J.jsxs)(`div`,{className:`mt-2 text-xs text-soft-foreground`,children:[`Manual examples: `,(0,J.jsx)(`code`,{children:`npx skills update -p`}),` · `,(0,J.jsx)(`code`,{children:`npx skills update -g`}),`. These broad commands may update other tracked sources.`]}):null,t?.needsUpgradeNotes?(0,J.jsxs)(`div`,{"data-slot":`skills-upgrade-notes`,className:`mt-3 flex gap-2 rounded-md border border-accent-strong/30 bg-background p-2.5 text-xs text-foreground`,children:[(0,J.jsx)(l,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-link-foreground`}),(0,J.jsxs)(`span`,{children:[`Skill files were updated. Run `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` in each configured repository to apply descriptor migrations while preserving local edits.`]})]}):null]}),(0,J.jsx)(ne,{open:s,onOpenChange:e=>p.isPending?void 0:u(e),children:(0,J.jsxs)(ie,{"data-slot":`skills-upgrade-notes-dialog`,showCloseButton:!1,children:[(0,J.jsxs)(re,{children:[(0,J.jsx)(ae,{children:`Apply the upgrade notes now?`}),(0,J.jsxs)(te,{children:[`The skill files were updated successfully. Start a new session with`,` `,(0,J.jsx)(`code`,{children:`/om-apply-upgrade-notes`}),` to sync repository descriptors while preserving local edits?`]})]}),(0,J.jsxs)(ee,{children:[(0,J.jsx)(b,{type:`button`,variant:`outline`,disabled:p.isPending,onClick:()=>u(!1),children:`No`}),(0,J.jsx)(b,{type:`button`,disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?`Starting…`:`Yes, start session`})]})]})})]})}var Q=`__bm`,$=`__import`;function de(){return(0,J.jsx)(`div`,{"data-route":`skills`,className:`mx-auto min-h-full w-full px-[18px] py-6 md:p-9`,children:(0,J.jsx)(fe,{})})}function fe(){let e=x(),t=N(),n=i(),[a]=P(),[o,l]=(0,q.useState)(``),d=r(),h=s(),g=j().projectId??h.data?.bootProject??``,y=f({mutationFn:()=>v(),onSuccess:e=>{d.setQueryData(C.skills,e),A(`Team skills refreshed.`)},onError:e=>A(e.message,{tone:`danger`})});if(e.isError)return(0,J.jsx)(T,{icon:(0,J.jsx)(_,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let b=V(e.data??[]),S=(n.data?.length??0)>0,w=a.get(`skill`),O=w===Q||w===$||w!==null&&b.some(e=>e.name===w)?w:b[0]?.name??(S?$:Q),k=b.find(e=>e.name===O)??null,M=B(b,o);return(0,J.jsxs)(`div`,{"data-slot":`skills-section`,className:`@container flex min-w-0 flex-col gap-[22px]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-4 @min-[700px]:flex-row @min-[700px]:items-center @min-[700px]:justify-between`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`text-[25px] font-semibold md:text-[30px]`,children:`Skills`}),(0,J.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground md:text-[13px]`,children:`Markdown playbooks your agents can follow.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[S?(0,J.jsxs)(L,{to:`/skills?skill=${$}`,"data-slot":`import-skills-row`,"aria-current":O===$?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Manage skills`]}):null,(0,J.jsxs)(L,{to:`/skills?skill=${Q}`,"data-slot":`bookmarklets-row`,"aria-current":O===Q?`page`:void 0,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium aria-[current=page]:bg-accent-strong/10 hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring`,children:[(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-4 text-link-foreground`}),`Run from GitHub`]})]})]}),(0,J.jsxs)(`div`,{className:F(`flex-col items-start gap-2 sm:flex-row sm:items-center md:flex`,w===null?`flex`:`hidden`),children:[(0,J.jsxs)(`div`,{className:`sw-search relative w-full min-w-0 flex-1`,children:[(0,J.jsx)(u,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,J.jsx)(W,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:o,onChange:e=>l(e.target.value),className:`h-11 min-w-0 bg-card pl-9 text-xs`})]}),(0,J.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:y.isPending,onClick:()=>y.mutate(),className:`flex h-11 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,J.jsx)(c,{"aria-hidden":`true`,className:F(`size-3`,y.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,J.jsxs)(`div`,{className:`grid min-w-0 items-start gap-[22px] md:grid-cols-[minmax(220px,310px)_minmax(0,1fr)]`,children:[(0,J.jsx)(`section`,{"data-slot":`skills-list`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card p-3 md:flex`,w===null?`flex`:`hidden`),children:(0,J.jsx)(`ul`,{"data-slot":`skill-rows`,className:`flex min-h-0 flex-col gap-1 overflow-y-auto md:max-h-[calc(100dvh-280px)]`,children:e.isPending?(0,J.jsx)(`li`,{role:`status`,"aria-busy":`true`,className:`min-h-72 p-3 text-[13px] text-soft-foreground`,children:`Loading skills…`}):M.length>0?M.map(e=>(0,J.jsx)(pe,{skill:e,active:O===e.name,highlighted:O===$&&e===b[0]},e.path)):(0,J.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:b.length>0?`(no skills match)`:(0,J.jsx)(se,{})})})}),(0,J.jsx)(`section`,{"data-slot":`skills-detail`,className:F(`min-w-0 flex-col rounded-xl border border-border bg-card md:flex`,w===null?`hidden`:`flex`),children:(0,J.jsxs)(`div`,{className:`min-w-0 p-5`,children:[(0,J.jsxs)(L,{to:`/skills`,"data-slot":`skills-back`,className:`mb-4 inline-flex min-h-11 items-center gap-2 rounded-lg border border-border px-3 text-xs font-medium hover:bg-muted md:hidden`,children:[(0,J.jsx)(p,{"aria-hidden":`true`,className:`size-3.5`}),`Back to skills`]}),O===$?(0,J.jsx)(X,{projectId:g}):O===Q?(0,J.jsx)(K,{skills:b}):k?(0,J.jsx)(G,{skill:k,usedBy:H(t.data?.workflows??[],k.name)}):e.isPending?(0,J.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`min-h-72 text-xs text-muted-foreground`,children:`Loading skill…`}):(0,J.jsx)(T,{icon:(0,J.jsx)(m,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})]})}function pe({skill:e,active:t,highlighted:n}){let r=R(e);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(L,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-highlighted":n||void 0,"data-project":r?`true`:void 0,"aria-current":t?`page`:void 0,className:F(`selection-row flex min-h-24 flex-col gap-2 rounded-lg border-b border-border p-3 transition-colors hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground`,(t||n)&&`border-transparent bg-accent-strong/10`),children:[(0,J.jsx)(`span`,{className:`flex min-w-0 items-center gap-2`,children:(0,J.jsx)(`span`,{className:F(`min-w-0 break-words text-[13px]`,r?`font-semibold text-foreground`:`font-normal text-muted-foreground`),children:e.name})}),e.description?(0,J.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-supporting-foreground`,children:e.description}):null,(0,J.jsx)(U,{source:e.source,className:`self-start border-0 bg-transparent p-0 text-link-foreground`})]})})}export{de as SkillsRoute};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-CUnaAifW.js";import{t as n}from"./project-router-SwsXRKXs.js";var r=e();function i({to:e,active:i=!1,onClick:a,children:o}){return(0,r.jsx)(n,{to:e,"aria-current":i?`page`:void 0,onClick:a,className:t(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,i?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:o})}export{i as t};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-PYYcpCFZ.js";import{t as n}from"./project-router-DbLkll25.js";var r=e();function i({to:e,active:i=!1,onClick:a,children:o}){return(0,r.jsx)(n,{to:e,"aria-current":i?`page`:void 0,onClick:a,className:t(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,i?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:o})}export{i as t};