@wjarka/cezarion 0.13.6 → 0.14.0

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 (127) hide show
  1. package/README.md +27 -3
  2. package/dist/agent-config/catalog.d.ts +2 -0
  3. package/dist/agent-config/catalog.js +40 -2
  4. package/dist/agent-config/catalog.js.map +1 -1
  5. package/dist/agent-config/models.js +4 -0
  6. package/dist/agent-config/models.js.map +1 -1
  7. package/dist/automations/types.d.ts +4 -0
  8. package/dist/config.d.ts +2 -0
  9. package/dist/config.js +1 -0
  10. package/dist/config.js.map +1 -1
  11. package/dist/contract/agent-config.d.ts +2 -0
  12. package/dist/contract/agent-profiles.d.ts +15 -0
  13. package/dist/contract/automations.d.ts +16 -0
  14. package/dist/contract/delegation.d.ts +6 -0
  15. package/dist/contract/health.d.ts +4 -0
  16. package/dist/contract/index.js +20 -11
  17. package/dist/contract/runs.d.ts +25 -3
  18. package/dist/contract/skills.d.ts +3 -0
  19. package/dist/contract/workflows.d.ts +6 -0
  20. package/dist/contract/workspace.d.ts +20 -2
  21. package/dist/core/agent-env.js +1 -0
  22. package/dist/core/agent-env.js.map +1 -1
  23. package/dist/core/agent-profiles.js +3 -0
  24. package/dist/core/agent-profiles.js.map +1 -1
  25. package/dist/core/agent-runner.d.ts +1 -1
  26. package/dist/core/agent-runner.js +1 -1
  27. package/dist/core/agent-runner.js.map +1 -1
  28. package/dist/core/backend-detect.d.ts +1 -1
  29. package/dist/core/backend-detect.js +14 -0
  30. package/dist/core/backend-detect.js.map +1 -1
  31. package/dist/core/cursor-acp-runner.d.ts +15 -0
  32. package/dist/core/cursor-acp-runner.js +466 -0
  33. package/dist/core/cursor-acp-runner.js.map +1 -0
  34. package/dist/core/cursor-config-options.d.ts +18 -0
  35. package/dist/core/cursor-config-options.js +31 -0
  36. package/dist/core/cursor-config-options.js.map +1 -0
  37. package/dist/core/cursor-model-catalog.d.ts +23 -0
  38. package/dist/core/cursor-model-catalog.js +271 -0
  39. package/dist/core/cursor-model-catalog.js.map +1 -0
  40. package/dist/core/cursor-ui-mapper.d.ts +29 -0
  41. package/dist/core/cursor-ui-mapper.js +272 -0
  42. package/dist/core/cursor-ui-mapper.js.map +1 -0
  43. package/dist/core/host-model-catalog.js +2 -0
  44. package/dist/core/host-model-catalog.js.map +1 -1
  45. package/dist/core/model-identity.js +3 -0
  46. package/dist/core/model-identity.js.map +1 -1
  47. package/dist/core/model-presets.js +4 -0
  48. package/dist/core/model-presets.js.map +1 -1
  49. package/dist/core/provider-auth.d.ts +1 -1
  50. package/dist/core/provider-auth.js +30 -1
  51. package/dist/core/provider-auth.js.map +1 -1
  52. package/dist/core/runner-factory.js +3 -0
  53. package/dist/core/runner-factory.js.map +1 -1
  54. package/dist/core/runner-model-catalog.js +1 -0
  55. package/dist/core/runner-model-catalog.js.map +1 -1
  56. package/dist/core/shell-env.d.ts +2 -0
  57. package/dist/core/shell-env.js +8 -0
  58. package/dist/core/shell-env.js.map +1 -1
  59. package/dist/core/ui-events.d.ts +1 -1
  60. package/dist/delegation/execution-identity.d.ts +3 -0
  61. package/dist/delegation/execution-identity.js +1 -1
  62. package/dist/delegation/execution-identity.js.map +1 -1
  63. package/dist/delegation/provision.js +1 -1
  64. package/dist/delegation/provision.js.map +1 -1
  65. package/dist/delegation/routes.d.ts +53 -53
  66. package/dist/delegation/transport.d.ts +7 -7
  67. package/dist/paths.js +3 -0
  68. package/dist/paths.js.map +1 -1
  69. package/dist/runs/store.d.ts +7 -3
  70. package/dist/server/open-in-app.js +1 -0
  71. package/dist/server/open-in-app.js.map +1 -1
  72. package/dist/server/provider-action-gate.js +1 -0
  73. package/dist/server/provider-action-gate.js.map +1 -1
  74. package/dist/server/server.d.ts +1441 -1401
  75. package/dist/server/server.js +23 -9
  76. package/dist/server/server.js.map +1 -1
  77. package/dist/workflows/types.d.ts +3 -0
  78. package/dist/workflows/types.js +1 -0
  79. package/dist/workflows/types.js.map +1 -1
  80. package/dist/workspace/agent-accounts.d.ts +5 -1
  81. package/dist/workspace/agent-accounts.js +1 -0
  82. package/dist/workspace/agent-accounts.js.map +1 -1
  83. package/dist/workspace/agent-profiles.js +1 -1
  84. package/dist/workspace/agent-profiles.js.map +1 -1
  85. package/dist/workspace/config.d.ts +3 -1
  86. package/dist/workspace/config.js +1 -0
  87. package/dist/workspace/config.js.map +1 -1
  88. package/package.json +3 -3
  89. package/scripts/mock-cursor-acp.mjs +77 -0
  90. package/web/dist/assets/{agent-accounts-CdHFiYTN.js → agent-accounts-MT-jtwOU.js} +1 -1
  91. package/web/dist/assets/alert-dialog-KUiPIBmb.js +43 -0
  92. package/web/dist/assets/{collapsible-CI78cX0k.js → collapsible-CkSaP6_n.js} +1 -1
  93. package/web/dist/assets/{commit-list-D3Cy_0hj.js → commit-list-B47VXJez.js} +1 -1
  94. package/web/dist/assets/{compare-variants-BkYiBaI1.js → compare-variants-DNqtPFUv.js} +1 -1
  95. package/web/dist/assets/{diff-DDUpEMjA2.js → diff-C4aSZfrQ2.js} +2 -2
  96. package/web/dist/assets/{diff-controls-C1THeHoP.js → diff-controls-D5b8ocJ0.js} +1 -1
  97. package/web/dist/assets/{diff-stat-Cq4juy0u.js → diff-stat-B7f-F8cC.js} +1 -1
  98. package/web/dist/assets/{diff-view-Coyp_Kst.js → diff-view-BPKHTL85.js} +1 -1
  99. package/web/dist/assets/{dropdown-menu-BP8LYsNU.js → dropdown-menu-xYcDecNM.js} +1 -1
  100. package/web/dist/assets/{git-toolbar-BP8_wDyk.js → git-toolbar-C4zVVSpl.js} +1 -1
  101. package/web/dist/assets/{github-CVranJaK.js → github-D97-DHsF.js} +1 -1
  102. package/web/dist/assets/{image-preview-DXIixdjJ.js → image-preview-BhuwWeyP.js} +1 -1
  103. package/web/dist/assets/index-ujHRHX5o.js +7 -0
  104. package/web/dist/assets/{markdown-uwx4ouIE.js → markdown-CIi0LXvU.js} +1 -1
  105. package/web/dist/assets/pill-DDhByAhe.js +1 -0
  106. package/web/dist/assets/{project-router-D9DfwL9L.js → project-router-BOglfKgF.js} +1 -1
  107. package/web/dist/assets/{prompt-templates-DgR9lv5k.js → prompt-templates-DTSPmJP-.js} +1 -1
  108. package/web/dist/assets/{repo-git-BLjI-1pn.js → repo-git-DvxUSPot.js} +1 -1
  109. package/web/dist/assets/{run-diff-DRPGyUPP.js → run-diff-DEVs-zV1.js} +1 -1
  110. package/web/dist/assets/run-header-Dvb1P3Ge.js +1 -0
  111. package/web/dist/assets/{skills-DRowiHKX.js → skills-DJ06RZbi.js} +1 -1
  112. package/web/dist/assets/{tab-link-C5tpLlqv.js → tab-link-ChqeHA8K.js} +1 -1
  113. package/web/dist/assets/{task-changes-LBnRxH_G.js → task-changes-CIN0MkJE.js} +1 -1
  114. package/web/dist/assets/{task-commits-lpE22fPa.js → task-commits-BRZshVHV.js} +1 -1
  115. package/web/dist/assets/{task-files-Dh6SjTQF.js → task-files-BZTNbpcP.js} +1 -1
  116. package/web/dist/assets/{task-thread-B_74GvMl.js → task-thread-D_N6ELtr.js} +6 -6
  117. package/web/dist/assets/{textarea-D_Ce7vp0.js → textarea-DdKiIORK.js} +1 -1
  118. package/web/dist/assets/{thread-loading-CwnPHwar.js → thread-loading-BRM8kyKz.js} +1 -1
  119. package/web/dist/assets/{token-metrics-BC00XXU8.js → token-metrics-DDvhrHmK.js} +1 -1
  120. package/web/dist/assets/{utils-B8qbBJrk.js → utils-CG8vWc5K.js} +1 -1
  121. package/web/dist/assets/{workflows-B2Iq2bcd.js → workflows-CplF7YNk.js} +1 -1
  122. package/web/dist/assets/{zoomable-image-Idq840Ej.js → zoomable-image-BXioMWqb.js} +1 -1
  123. package/web/dist/index.html +13 -13
  124. package/web/dist/assets/alert-dialog-7OZcjFyp.js +0 -43
  125. package/web/dist/assets/index-CokupxlP.js +0 -7
  126. package/web/dist/assets/pill-jITycc8f.js +0 -1
  127. package/web/dist/assets/run-header-DO-yE5Gj.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,B as i,Gr as a,Jt as o,Ln as s,Ot as c,Pn as l,Q as u,Vn as d,Xr as f,Z as p,Zr as m,_t as h,aa as g,bt as _,d as v,ei as y,et as b,la as x,pn as S,tt as C,ur as w,vt as T,yt as E}from"./alert-dialog-7OZcjFyp.js";import{n as D,t as O}from"./utils-B8qbBJrk.js";import{c as ee,i as te,l as ne,r as re,t as ie}from"./dropdown-menu-BP8LYsNU.js";import{a as ae,i as oe,r as se}from"./agent-accounts-CdHFiYTN.js";import{t as k}from"./createLucideIcon-BHp8sXmF.js";import{t as A}from"./external-link-BE6y205O.js";import{t as ce}from"./square-terminal-B6RYYieR.js";var le=k(`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`}]]),j=k(`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`}]]),ue=k(`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`}]]),de=k(`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`}]]),fe=k(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),pe=k(`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`}]]),me=k(`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`}]]),he=k(`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`}]]),M=k(`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`}]]),ge=k(`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`}]]),N=k(`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`}]]),_e=k(`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`}]]),ve=k(`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`}]]),ye=k(`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`}]]),be=k(`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`}]]),xe=k(`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`}]]),Se=k(`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`}]]),Ce=k(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),we=k(`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`}]]),Te=k(`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`}]]),Ee=k(`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`}]]),P=e(t(),1),F=n(),De=i(`inline-block size-[7px] shrink-0 rounded-full`,{variants:{tone:{success:`bg-success`,pending:`bg-pending-strong`,danger:`bg-danger`,accent:`bg-accent-strong`,neutral:`bg-soft-foreground`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},defaultVariants:{tone:`neutral`,pulse:!1}});function I({className:e,tone:t=`neutral`,pulse:n=!1,...r}){return(0,F.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,className:O(De({tone:t,pulse:n,className:e})),...r})}var Oe=[`done`,`failed`,`cancelled`],ke=[`done`,`failed`];function L(e){return e.status===`failed`&&e.autoResumeAt!==void 0}function Ae(e){return Oe.includes(e)}function R(e){return e.archived||L(e)||!ke.includes(e.status)?!1:e.finishedAt!==void 0}function z(e){let t=e.finishedAt;return t===void 0||!R(e)?!1:e.seenAt===void 0||e.seenAt<t}function je(e){return!L(e)&&Ae(e.status)&&!z(e)}function Me(e){return e.reduce((e,t)=>z(t)?e+1:e,0)}var B=(0,P.createContext)(null);function Ne({children:e}){let[t,n]=(0,P.useState)(()=>new Map),r=(0,P.useCallback)((e,t)=>{n(n=>{let r=new Map(n);return r.set(e,t),r})},[]),i=(0,P.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),a=d((0,P.useMemo)(()=>[...t.values()].flat(),[t])),o=(0,P.useMemo)(()=>({publish:r,retract:i,lookup:a}),[r,i,a]);return(0,F.jsx)(B.Provider,{value:o,children:e})}var V=(0,P.createContext)(null);function Pe({projectId:e,requests:t,children:n}){let r=(0,P.useContext)(B),i=(0,P.useId)();(0,P.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=d(r?Fe:t),o=r?.lookup??a,s=(0,P.useMemo)(()=>({lookup:o,projectId:e}),[o,e]);return(0,F.jsx)(V.Provider,{value:s,children:n})}var Fe=[];function Ie(e,t,n){let r=(0,P.useContext)(V),i=n??r?.projectId;return!r||!i||t===void 0?Le:r.lookup({projectId:i,kind:e,number:t})}var Le=Object.freeze({state:`idle`}),Re={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`},ze={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`},Be={draft:E,"review-required":_,"changes-requested":c,"checks-pending":null,"checks-failing":C,ready:p,merged:h,closed:T,open:u,completed:p,"not-planned":b};function H({reference:e,taskTitle:t,status:n,conflicting:r,conflictAction:i,projectId:a,className:s,compact:c=!1}){let{kind:l,number:u,url:d}=e,p=Ie(l,u,a),h=n??p.status,g=m(h),_=l===`PR`&&(r??p.conflicting)===!0,v=_?f:g,y=O(`inline-flex h-[22px] items-center gap-1 rounded-md border px-1.5 font-mono text-[10px] font-normal`,Re[v?.tone??`accent`],s),b=We(p,v,_?g:void 0),x=u?`${!c&&l===`Issue`?`Issue `:``}#${u}`:l,S=l===`PR`?`pull request`:`issue`,C=`Open the ${S} for ${t}${v?` — ${v.label}`:``}`,w=(0,F.jsxs)(F.Fragment,{children:[_?(0,F.jsx)(o,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):(0,F.jsx)(Ke,{status:v?h:void 0}),x]}),T=!d||!D(d)?(0,F.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,F.jsx)(`a`,{"data-slot":l===`PR`?`pr-chip`:`issue-chip`,"data-status":h,..._?{"data-conflicting":`true`}:{},href:d,target:`_blank`,rel:`noopener noreferrer`,title:b?void 0:d,"aria-label":C,className:O(y,ze[v?.tone??`accent`]),children:w});if(!b)return T;let E=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`block font-medium`,children:[l===`PR`?`Pull request`:`Issue`,u?` #${u}`:``,` · `,b.headline]}),(0,F.jsx)(`span`,{className:`block`,children:b.detail}),b.also?(0,F.jsx)(`span`,{className:`block opacity-70`,children:b.also}):null,d&&D(d)?(0,F.jsx)(`span`,{className:`block opacity-70`,children:d.replace(/^https?:\/\//,``)}):null]});return(0,F.jsx)(Ue,{chip:T,action:_?i:void 0,state:p.state,children:E})}var U=(0,P.createContext)(()=>{});function Ve(){return(0,P.useContext)(U)}var He=150,W=120;function Ue({chip:e,action:t,state:n,children:r}){let[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(null),s=(0,P.useRef)(null),c=(0,P.useRef)(void 0),l=(0,P.useCallback)((e,t)=>{clearTimeout(c.current),c.current=setTimeout(()=>a(e),t)},[]),u=(0,P.useCallback)(()=>{clearTimeout(c.current),a(!1)},[]);(0,P.useEffect)(()=>()=>clearTimeout(c.current),[]);let d=e=>e instanceof Node&&(s.current?.contains(e)||o.current?.contains(e));return(0,F.jsxs)(se,{open:i,onOpenChange:e=>e?a(!0):u(),children:[(0,F.jsx)(oe,{asChild:!0,ref:o,onPointerEnter:e=>{e.pointerType!==`touch`&&l(!0,He)},onPointerLeave:e=>{e.pointerType!==`touch`&&l(!1,W)},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,F.jsxs)(ae,{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,W)},children:[(0,F.jsx)(`div`,{className:`space-y-0.5`,children:r}),t?(0,F.jsx)(U.Provider,{value:u,children:t}):null]})]})}function We(e,t,n){if(t){let{label:r,hint:i}=t,a=n?`also ${Ge(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 Ge(e){return e.charAt(0).toLowerCase()+e.slice(1)}function Ke({status:e}){if(!e)return null;if(e===`checks-pending`)return(0,F.jsx)(r,{"data-slot":`status-dot`,"data-tone":`pending`,className:`size-3 animate-pulse motion-reduce:animate-none`,"aria-hidden":`true`});let t=Be[e];return t?(0,F.jsx)(t,{className:`size-2.5 shrink-0`,"aria-hidden":`true`}):null}var G={claude:`Claude Code`,codex:`Codex`,opencode:`OpenCode`,pi:`pi`};function K(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 q(e){return e.runner??`claude`}function J(e,t){let n=x(t,e);return n?.enabled===!1?{provider:e,usable:!1,reason:`${G[e]} is disabled. Enable it in Settings → Agents → Providers.`}:n?.status===`connected`?{provider:e,usable:!0}:{provider:e,usable:!1,reason:`${G[e]} credentials are unavailable. Authorize it in Settings → Agents → Providers.`}}function qe(e,t){return J(K(e),t)}function Je(e,t){return J(q(e),t)}function Y(e){let t=s(),n=K(e);return t.isSuccess&&t.data?qe(e,t.data):{provider:n,usable:!0}}function Ye(e){let t=s(),n=q(e);return t.isSuccess&&t.data?Je(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 Xe={folder:M,terminal:ce,vscode:fe,cursor:ye,zed:Ee,windsurf:Te,sublime:he,idea:me,pycharm:ve,webstorm:N,goland:Se,rubymine:ge,phpstorm:de,clion:pe,rider:ue,"android-studio":Ce,xcode:_e,warp:xe,claude:j,codex:we,opencode:j,pi:j};function Ze(e){return e.icon&&Xe[e.icon]||A}function Qe(e){let t=/^cli:(claude|codex|opencode|pi)$/.exec(e);return t?t[1]:void 0}function $e({choices:e,onPick:t,label:n=`Open in…`,title:r,triggerVariant:i=`ghost`,disabled:a=!1,leading:o,trailing:s,slot:c}){return(0,F.jsxs)(ie,{children:[(0,F.jsx)(ne,{asChild:!0,children:(0,F.jsxs)(v,{variant:i,size:`sm`,title:r,disabled:a,"data-slot":c,children:[(0,F.jsx)(A,{"aria-hidden":`true`}),n]})}),(0,F.jsxs)(re,{align:`end`,children:[o,o&&e.length>0?(0,F.jsx)(ee,{}):null,e.map(({target:e,suffix:n,title:r})=>{let i=Ze(e);return(0,F.jsxs)(te,{"data-target":e.id,title:r,onSelect:()=>t(e.id),children:[(0,F.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}var et=/^[A-Za-z0-9._][A-Za-z0-9._-]{0,199}$/;function tt(e,t){if(et.test(t))switch(e){case`codex`:return`codex resume ${t}`;case`opencode`:return`opencode --session ${t}`;default:return`claude --resume ${t}`}}function nt(e){if(X(e.status))return;let t=Z(e);if(t===void 0)return;let n=tt(e.runner,t);if(n!==void 0)return e.worktreePath?`cd ${e.worktreePath} && ${n}`:n}function rt(e,t){let n=Qe(t);return!n||X(e.status)?!1:n===(e.runner??`claude`)&&Z(e)!==void 0}function it(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 at(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||it(e)),terminal:!t&&n,notes:!0,archive:!t,pin:!e.archived,markUnread:R(e)&&!z(e),cancel:t,deleteRun:!t}}function ot(e){return`Merge head branch and resolve conflicts in ${e?`PR number ${e}`:`this pull request`}`}function st(e){return e===`review`?`Accept the changes without a PR`:`Close the session`}function ct(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 lt=[50,100,200,400,800,1e3,1e3,1e3,1e3],ut=e=>new Promise(t=>setTimeout(t,e));function dt(e){return e instanceof y&&e.status===409&&e.message===`run is still active`}async function ft(e,t=ut){for(let n=0;;n+=1)try{return await e()}catch(e){let r=lt[n];if(!dt(e)||r===void 0)throw e;await t(r)}}function pt(e){return X(e.status)?`live`:at(e).continueRun?`resume`:`unavailable`}function Q(e,t){let n=w(e.id,t),r=S(e.id,t),i=Y(e),a=Ye(e),[o,s]=(0,P.useState)(void 0),[c,l]=(0,P.useState)(!1),u=(0,P.useRef)(!1),d=pt(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 ft(()=>h(t,r));return}try{await n.mutateAsync({text:t,...r===void 0?{}:{images:r}})}catch(n){if(n instanceof y&&n.status===409&&Z(e)!==void 0){try{await ft(()=>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=Q(e,t),i=Ve(),[a,o]=(0,P.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(ot(n));t?g(t,{tone:`danger`}):(g(`${e?`Task reopened`:`Sent to the task`} — resolving conflicts${n?` in PR #${n}`:``}`),i())}finally{o(!1)}};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(v,{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,F.jsx)(`span`,{className:`block opacity-70`,children:r.reason}):null]})}function mt({projectId:e,runId:t,prNumber:n}){let r=l(e,t);return r.data?(0,F.jsx)($,{run:r.data,projectId:e,prNumber:n}):(0,F.jsx)(v,{type:`button`,size:`sm`,disabled:!0,className:`h-7 w-full text-xs`,children:r.isError?`Unavailable`:`Loading…`})}function ht({run:e,reference:t,className:n,compact:r=!1}){return(0,F.jsx)(H,{reference:t,taskTitle:a(e),conflictAction:(0,F.jsx)($,{run:e,prNumber:t.number}),className:n,compact:r})}function gt(e,t){let[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(``),o=(0,P.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 _t({editor:e,className:t}){return(0,F.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:O(`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 vt({className:e,dot:t,pulse:n=!1,children:r,...i}){return(0,F.jsxs)(`span`,{"data-slot":`pill`,className:O(`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,F.jsx)(I,{tone:t,pulse:n}):null,r]})}export{M as A,R as C,I as D,Me as E,be as O,Ne as S,z as T,Qe as _,mt as a,H as b,rt as c,it as d,Z as f,$e as g,at as h,$ as i,le as j,N as k,st as l,nt as m,_t as n,ht as o,ct as p,gt as r,Q as s,vt as t,X as u,Ze as v,je as w,Pe as x,Y as y};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,An as i,Bn as a,Ca as o,Cn as s,Gr as c,Ii as l,Ir as u,J as d,Jr as f,Li as p,Ln as m,Mn as h,Nn as g,Nr as _,Oa as v,On as y,Or as b,Pr as x,Pt as S,Rr as ee,Ur as te,V as ne,Y as C,Z as re,Zn as ie,_i as ae,a as oe,aa as w,c as se,d as T,dn as ce,ei as le,en as E,ht as ue,i as de,ii as fe,ir as pe,jn as me,jr as he,ln as ge,n as _e,o as ve,ot as ye,q as D,qt as be,r as xe,rn as O,rr as Se,rt as k,s as Ce,sr as A,t as we,tt as Te,ua as Ee,yi as De}from"./alert-dialog-7OZcjFyp.js";import{n as j,t as M}from"./utils-B8qbBJrk.js";import{a as N,c as Oe,i as P,l as F,n as ke,r as I,t as L}from"./dropdown-menu-BP8LYsNU.js";import{n as Ae,r as je,t as Me}from"./collapsible-CI78cX0k.js";import{n as Ne,t as Pe}from"./agent-accounts-CdHFiYTN.js";import{t as R}from"./createLucideIcon-BHp8sXmF.js";import{O as Fe,_ as Ie,b as z,c as Le,h as B,i as Re,j as ze,m as V,n as Be,r as Ve,t as He,v as Ue,x as We}from"./pill-jITycc8f.js";import{c as Ge,s as Ke,t as H,u as qe}from"./project-router-D9DfwL9L.js";import{t as Je}from"./square-terminal-B6RYYieR.js";import{t as Ye}from"./markdown-uwx4ouIE.js";import{t as Xe}from"./diff-stat-Cq4juy0u.js";import{n as Ze,t as Qe}from"./token-metrics-BC00XXU8.js";import{t as U}from"./tab-link-C5tpLlqv.js";import{t as $e}from"./use-desktop-BaYgO7YW.js";var W=R(`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`}]]),et=R(`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`}]]),tt=R(`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`}]]),G=e(t(),1),K=n(),q=`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 nt({run:e}){return!e.delegation||e.delegation.role===`invalid`?null:(0,K.jsx)(rt,{run:e})}function rt({run:e}){let t=pe(e.id),n=$e(),[r,i]=(0,G.useState)(null),a=n||r===e.id,o=(0,G.useId)(),s=A(),l=e.delegation,u=l?.role===`worker`?l.parentRunId:t.data?.parentRunId,d=l?.role===`root`?l.receipts.map(e=>e.workerId):[],f=new Map(t.data?.workers.map(e=>[e.workerId,e])),p=[...new Set([...d,...f.keys()])].slice(0,32),m=l&&l.role!==`invalid`?l.wait:void 0;return(0,K.jsxs)(`section`,{"aria-label":`Task relationships`,className:`min-w-0 border-t border-border py-2 text-sm text-muted-foreground`,children:[(0,K.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":o,onClick:()=>i(r===e.id?null:e.id),children:[(0,K.jsx)(ue,{"aria-hidden":`true`,className:`size-4 text-accent-text`}),l?.role===`worker`?`Worker session`:`Parent`,(0,K.jsx)(D,{"aria-hidden":`true`,className:`ml-1 size-4`}),l?.role===`worker`?`Parent & workers`:p.length>0?`Workers ${p.length}`:t.isSuccess?`Workers 0`:t.isError?`Workers unavailable`:`Workers…`,(0,K.jsx)(C,{"aria-hidden":`true`,className:`ml-auto size-4 ${a?`rotate-180`:``}`})]}),l?.role===`worker`&&l.destroy?(0,K.jsx)(J,{state:l.destroy}):null,m?(0,K.jsxs)(`p`,{className:`px-2 break-words`,children:[m.requestIds?m.phase===`parked`?`Waiting on request replies`:m.phase===`wake-pending`?`Conversation update queued for this task`:`Request wait registered — the agent is finishing its turn`:m.phase===`parked`?`Waiting on workers`:m.phase===`wake-pending`?`Worker update queued for the parent`:`Worker wait registered — the agent is finishing its turn`,`.`,` `,`Deadline: `,(0,K.jsx)(`time`,{dateTime:m.deadline,children:m.deadline})]}):null,(0,K.jsxs)(`div`,{id:o,hidden:!a,children:[u?(0,K.jsx)(it,{id:u}):null,p.length>0?(0,K.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=s.data?.find(t=>t.id===e);return(0,K.jsxs)(`li`,{className:`min-w-0 rounded-md bg-muted/40 px-1`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2`,children:[(0,K.jsx)(H,{to:`/tasks/${e}`,"aria-label":`Worker task ${e}`,className:q,children:r?c(r):`Worker ${e.slice(0,8)}`}),(0,K.jsx)(`span`,{className:`px-2 text-xs`,children:n?.status??(t.isSuccess?`Record unavailable or deleted`:`Status unavailable`)})]}),n?.destroy?(0,K.jsx)(J,{state:n.destroy}):null]},e)})}):l?.role===`root`&&t.isSuccess?(0,K.jsx)(`p`,{className:`px-2`,children:`No workers`}):null,t.fetchStatus===`paused`?(0,K.jsx)(`p`,{role:`status`,className:`px-2`,children:`Offline — relationship details will refresh when connected.`}):t.isPending?(0,K.jsx)(`p`,{role:`status`,className:`px-2`,children:`Loading relationships…`}):null,t.isError?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-2`,children:[(0,K.jsx)(`p`,{role:`status`,children:`Could not load relationships. Known task links are retained.`}),(0,K.jsx)(T,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry relationships`})]}):null]})]})}function it({id:e}){let t=ie(e);return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2`,children:[(0,K.jsx)(H,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,className:q,children:t.data?`Parent · ${c(t.data)}`:`Parent task ${e}`}),t.isError?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`px-2 text-xs`,children:`Parent record unavailable or deleted`}),(0,K.jsx)(T,{variant:`outline`,className:`min-h-11`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}function J({state:e}){return(0,K.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 Y(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 X(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 at({steps:e}){if(e.length===0)return null;let t=X(e)*100;return(0,K.jsxs)(`div`,{"data-slot":`step-rail`,className:`flex min-w-0 flex-col gap-1`,children:[e.map((t,n)=>(0,K.jsxs)(`div`,{"data-slot":`step-row`,"data-visual":Y(t.status),className:`flex min-h-[22px] min-w-0 items-center gap-2 text-[13px] text-muted-foreground`,children:[(0,K.jsx)(ot,{visual:Y(t.status)}),(0,K.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:t.name}),t.iterations>1?(0,K.jsxs)(`span`,{"data-slot":`step-iterations`,className:`shrink-0 text-xs text-soft-foreground tabular-nums`,children:[`×`,t.iterations]}):null,(0,K.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,K.jsx)(`div`,{"data-slot":`step-progress`,className:`mt-1 h-0.5 overflow-hidden rounded-full bg-muted`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full bg-pending`,style:{width:`${t}%`}})})]})}function ot({visual:e}){let t=`size-[13px] shrink-0`;switch(e){case`done`:return(0,K.jsx)(re,{"aria-hidden":!0,className:M(t,`text-success`)});case`active`:return(0,K.jsx)(qe,{role:`status`,"aria-label":`Step running`,className:M(t,`animate-spin stroke-pending motion-reduce:animate-none`)});case`failed`:return(0,K.jsx)(Te,{"aria-hidden":!0,className:M(t,`text-danger`)});case`pending`:return(0,K.jsx)(r,{"aria-hidden":!0,className:M(t,`text-soft-foreground`)})}}function st(e){let t=e.findIndex(e=>Y(e.status)===`active`);if(t>=0)return t;let n=e.findIndex(e=>Y(e.status)===`pending`);return n>=0?n:Math.max(0,e.length-1)}function ct({visual:e}){return(0,K.jsx)(`span`,{"aria-hidden":!0,"data-slot":`step-dot`,"data-visual":e,className:M(`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 Z=new Map;function lt({runId:e,steps:t}){let[n,r]=(0,G.useState)(()=>Z.get(e)??!1);if(t.length===0)return null;let i=t=>{Z.set(e,t),r(t)},a=st(t),o=t[a],s=X(t)*100;return(0,K.jsxs)(Me,{"data-slot":`workflow-steps`,open:n,onOpenChange:i,className:`min-w-0`,children:[(0,K.jsxs)(je,{"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,K.jsx)(`span`,{"data-slot":`step-dots`,className:`flex shrink-0 items-center gap-1`,children:t.map(e=>(0,K.jsx)(ct,{visual:Y(e.status)},e.id))}),(0,K.jsx)(`span`,{className:`min-w-0 max-w-[45%] shrink truncate font-semibold text-foreground`,children:o.name}),(0,K.jsxs)(`span`,{className:`shrink-0 text-soft-foreground tabular-nums`,children:[`step `,a+1,` of `,t.length]}),(0,K.jsx)(`span`,{"data-slot":`step-summary-progress`,className:`h-0.5 min-w-[36px] flex-1 overflow-hidden rounded-full bg-muted`,children:(0,K.jsx)(`span`,{className:`block h-full rounded-full bg-pending`,style:{width:`${s}%`}})}),(0,K.jsx)(C,{"aria-hidden":!0,className:`size-4 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-180`})]}),(0,K.jsx)(Ae,{children:(0,K.jsx)(`div`,{className:`pt-2`,children:(0,K.jsx)(at,{steps:t})})})]})}function ut(e){let t=v();return o({mutationFn:()=>De(e),onSuccess:()=>t.invalidateQueries({queryKey:O.runs.all}),onError:e=>w(e.message,{tone:`danger`})})}var dt=new Map;function ft({run:e,planTally:t,tab:n=`session`,hasPendingHumanAsk:r=!1,onMarkedUnread:i}){let a=f(e,r),[o,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(!1),d=pt(e,i),[,p]=(0,G.useReducer)(e=>e+1,0),m=(0,G.useId)(),h=Ke(),g=JSON.stringify([h,e.id]),_=dt.get(g)??!1,v=()=>{dt.set(g,!_),p()},y=A(),b=s(),x=Qe(b.data),S=e.status===`queued`?te(y.data??[]).get(e.id):void 0;return(0,K.jsxs)(`header`,{"data-slot":`run-header`,className:M(`relative z-20 bg-background px-[18px] pt-[18px] md:px-9 md:pt-7`,n===`session`&&`md:sticky md:top-0`),children:[(0,K.jsxs)(`div`,{className:`w-full`,children:[(0,K.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,K.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,K.jsx)(mt,{run:e}),(0,K.jsxs)(He,{dot:a.tone,pulse:a.pulse,children:[a.label,S===void 0?``:` #${S}`]}),(0,K.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[t?(0,K.jsxs)(`span`,{"data-slot":`plan-mirror`,className:`hidden text-[11px] text-soft-foreground tabular-nums md:inline`,children:[`Plan `,t.done,`/`,t.total]}):null,(0,K.jsx)(T,{variant:`ghost`,size:`icon-sm`,className:`size-11 md:hidden`,"aria-label":_?`Hide run details`:`Show run details`,"aria-controls":m,"aria-expanded":_,onClick:v,children:(0,K.jsx)(C,{"aria-hidden":`true`,className:M(`transition-transform motion-reduce:transition-none`,_&&`rotate-180`)})}),(0,K.jsx)(vt,{run:e,actions:d,onOpenChooser:()=>u(!0),onToggleNotes:()=>c(e=>!e)})]})]}),(0,K.jsx)(`div`,{id:m,"data-slot":`run-details`,className:M(_?`block`:`hidden`,`md:block`),children:(0,K.jsx)(ht,{run:e,showTokens:x.tokens,showCost:x.cost,automationsAvailable:b.data?.capabilities?.automations===!0})}),(0,K.jsx)(gt,{run:e}),(0,K.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,K.jsx)(U,{to:`/tasks/${e.id}`,active:n===`session`,children:`Session`}),(0,K.jsx)(U,{to:`/tasks/${e.id}/changes`,active:n===`changes`,children:`Changes`}),(0,K.jsx)(U,{to:`/tasks/${e.id}/commits`,active:n===`commits`,children:`Commits`}),(0,K.jsx)(U,{to:`/tasks/${e.id}/files`,active:n===`files`,children:`Files`})]}),(0,K.jsx)(nt,{run:e}),n!==`session`&&e.steps.length>0?(0,K.jsx)(`div`,{className:`border-t border-border pt-1 pb-0 md:pt-2 md:pb-1`,children:(0,K.jsx)(lt,{runId:e.id,steps:e.steps})}):null,o?(0,K.jsx)(bt,{runId:e.id,onClose:()=>c(!1)}):null,l?(0,K.jsx)(Q,{run:e,canResume:B(e).terminal,onResume:()=>d.terminal.mutate(),onClose:()=>u(!1)}):null]}),(0,K.jsx)(yt,{run:e,actions:d})]})}function Q({run:e,canResume:t,onResume:n,onOpen:r,onClose:a}){let s=i(),c=m(),u=o({mutationFn:t=>l(e.id,t),onError:e=>w(e.message,{tone:`danger`})}),d=Ee(c.data),f=e=>!c.isSuccess||d.includes(e??`claude`),p=t&&f(e.runner),h=e.worktreePath?(s.data?.targets??[]).filter(e=>{let t=Ie(e.id);return t===void 0||f(t)}).map(t=>({target:t,...Le(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[];if(!p&&h.length===0)return null;let g=()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>w(`Worktree path copied`)).catch(()=>w(`Path: ${t}`))};if(r)return(0,K.jsx)(P,{onSelect:r,children:`Open in…`});let _=V(e);return(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,K.jsx)(T,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:a,children:(0,K.jsx)(E,{})})]}),e.worktreePath?(0,K.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,K.jsxs)(`div`,{className:`task-open-targets mt-4 flex flex-wrap gap-3`,children:[p?(0,K.jsxs)(T,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,K.jsx)(Je,{}),`Terminal (resume session)`]}):null,h.map(({target:e,suffix:t,title:n})=>{let r=Ue(e);return(0,K.jsxs)(T,{variant:`outline`,"data-target":e.id,title:n,disabled:u.isPending,onClick:()=>u.mutate(e.id),children:[(0,K.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,K.jsxs)(T,{variant:`outline`,onClick:g,children:[(0,K.jsx)(k,{}),`Copy worktree path`]}):null]}),_?(0,K.jsxs)(`div`,{className:`mt-5 border-t border-border pt-5`,children:[(0,K.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,K.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:_}),(0,K.jsxs)(T,{variant:`outline`,onClick:()=>void $(_,`Command copied to clipboard.`),children:[(0,K.jsx)(k,{}),`Copy resume command`]})]}):null]})}function pt(e,t){let n=v(),r=Ge(),[i,a]=(0,G.useState)(null),s=()=>n.invalidateQueries({queryKey:O.runs.all}),c=e=>w(e.message,{tone:`danger`}),l=ut(e.id),u=o({mutationFn:()=>fe(e.id,!e.archived),onSuccess:s,onError:c}),d=h(),f={isPending:d.isPending,mutate:()=>d.mutate({id:e.id,pinned:!e.pinned})},m=y();return{finish:l,archive:u,pin:f,markUnread:{isPending:m.isPending,mutate:()=>{t?.(),m.mutate(e.id,{onError:c})}},delete:o({mutationFn:()=>ae(e.id),onSuccess:()=>{s(),r(`/`)},onError:c}),terminal:o({mutationFn:()=>p(e.id),onError:e=>{if(e instanceof le&&e.command){$(e.command,`No terminal found — command copied to clipboard.`);return}c(e)}}),confirming:i,setConfirming:a}}async function $(e,t){try{await navigator.clipboard.writeText(e),w(t)}catch{w(`Run manually: ${e}`)}}function mt({run:e}){let t=me(e.id),n=c(e),r=Ve(n,e=>t.mutate({title:e},{onError:e=>w(e.message,{tone:`danger`})}));return r.editing?(0,K.jsx)(Be,{editor:r,className:`flex-1 text-[15px] font-semibold`}):(0,K.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,K.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:n}),(0,K.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,K.jsx)(Fe,{className:`size-3.5`,"aria-hidden":`true`})})]})}function ht({run:e,showTokens:t,showCost:n,automationsAvailable:r}){let i=g(),o=a(),s=(0,G.useMemo)(()=>u(e,i),[e,i]),l=(0,G.useMemo)(()=>o===void 0?[]:s.map(e=>({projectId:o,kind:e.kind,number:e.number})),[s,o]),d=[(0,K.jsx)(`span`,{className:`max-md:max-w-full max-md:break-all`,children:ee(e)},`workflow`)];e.branch&&d.push((0,K.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 f=s.filter(e=>e.kind===`PR`);for(let t of f)d.push((0,K.jsx)(z,{reference:t,taskTitle:c(e),className:`h-5`,conflictAction:(0,K.jsx)(Re,{run:e,prNumber:t.number})},`pr-${t.number}`));let p=x(e);p&&j(p)&&!f.some(e=>e.url===p)&&d.push((0,K.jsx)(z,{reference:{kind:`PR`,url:p},taskTitle:c(e),className:`h-5`},`pr`));let m=_(e,i);if(m&&j(m)){let t=he(m);d.push((0,K.jsx)(z,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:m},taskTitle:c(e),className:`h-5`},`issue`))}e.diffStat&&d.push((0,K.jsx)(Xe,{stat:e.diffStat},`diff`)),e.automation&&d.push(r?(0,K.jsx)(H,{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,K.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 h=[];return t&&(e.inputTokens!==void 0||e.outputTokens!==void 0)&&h.push((0,K.jsx)(Ze,{inputTokens:e.inputTokens,outputTokens:e.outputTokens},`tokens`)),n&&e.costUsd&&h.push((0,K.jsx)(`span`,{className:`tabular-nums`,children:b(e.costUsd)},`cost`)),(0,K.jsx)(We,{projectId:o,requests:l,children:(0,K.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,K.jsxs)(G.Fragment,{children:[t>0?(0,K.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,K.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5 max-md:min-w-0 max-md:max-w-full`,children:[h.map((e,t)=>(0,K.jsxs)(G.Fragment,{children:[t>0?(0,K.jsx)(`span`,{className:`text-soft-foreground`,"aria-hidden":`true`,children:`·`}):null,e]},t)),(0,K.jsx)(_t,{run:e})]})]})})}function gt({run:e}){if(e.status!==`running`||e.activity!==`monitoring`)return null;if(e.monitoringWakeCapReached)return(0,K.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,K.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,K.jsxs)(`p`,{"data-slot":`monitoring-schedule`,role:`status`,className:`mt-1 text-xs text-muted-foreground`,children:[`Next automatic check`,` `,(0,K.jsx)(`time`,{dateTime:e.monitoringWakeAt,className:`font-medium text-foreground`,children:r})]})}function _t({run:e}){let t=ce(),n=ge(),{accounts:r}=Ne(),i=e.runner??t.data?.defaultRunner??`claude`,a=e.model??`auto`,o=e.effort||void 0,s=[...e.steps].reverse().find(e=>e.profileId),c=s?.profileId,l=s?.backend??i,u=n.data?.profiles.find(e=>e.id===c),d=c===void 0||n.isPending?void 0:n.isError?c:u?Pe(r,l)?c==="default"?`default`:u.label:void 0:`${c} (removed)`,f=e.modelIdentity&&e.modelIdentity!==a?e.modelIdentity:void 0,p=[i,d,a,o].filter(Boolean).join(` · `);return(0,K.jsxs)(L,{children:[(0,K.jsx)(F,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,"data-slot":`agent-badge`,title:p,"aria-label":`Agent: ${i}, ${d?`account ${d}, `:``}model ${a}${o?`, effort ${o}`:``}`,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,K.jsx)(D,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,K.jsx)(`span`,{"data-slot":`agent-badge-summary`,className:`truncate font-mono text-[11px]`,children:p})]})}),(0,K.jsxs)(I,{align:`end`,className:`min-w-[9rem] max-md:max-w-[calc(100vw-2rem)] max-md:break-all`,children:[(0,K.jsxs)(N,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`runner: `,i]}),d?(0,K.jsxs)(N,{"data-slot":`agent-badge-account`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`account: `,d]}):null,(0,K.jsxs)(N,{className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`model: `,a]}),o?(0,K.jsxs)(N,{"data-slot":`agent-badge-effort`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`effort: `,o]}):null,f?(0,K.jsxs)(N,{"data-slot":`agent-badge-identity`,className:`font-mono text-[11px] font-normal text-muted-foreground`,children:[`identity: `,f]}):null]})]})}function vt({run:e,actions:t,onToggleNotes:n,onOpenChooser:r}){let i=B(e),a=V(e);return(0,K.jsxs)(L,{children:[(0,K.jsx)(F,{asChild:!0,children:(0,K.jsx)(T,{variant:`ghost`,size:`icon-sm`,className:`size-11`,"aria-label":`Run actions`,children:(0,K.jsx)(ye,{"aria-hidden":`true`})})}),(0,K.jsxs)(I,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,children:[(0,K.jsx)(N,{className:`px-2 py-3 text-[10px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),(0,K.jsxs)(P,{onSelect:n,children:[(0,K.jsx)(W,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,K.jsx)(Q,{run:e,canResume:i.terminal,onResume:()=>t.terminal.mutate(),onOpen:r}),a?(0,K.jsxs)(P,{onSelect:()=>void $(a,`Command copied to clipboard.`),children:[(0,K.jsx)(k,{"aria-hidden":`true`}),` Copy resume command`]}):null,i.finish?(0,K.jsxs)(P,{disabled:t.finish.isPending,onSelect:()=>t.setConfirming(`finish`),children:[(0,K.jsx)(d,{"aria-hidden":`true`}),` Finish`]}):null,i.markUnread?(0,K.jsxs)(P,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,K.jsx)(et,{"aria-hidden":`true`}),` Mark unread`]}):null,i.pin?(0,K.jsxs)(ke,{"data-slot":`pin-run`,className:`min-h-11`,checked:!!e.pinned,disabled:t.pin.isPending,onCheckedChange:()=>t.pin.mutate(),children:[e.pinned?(0,K.jsx)(tt,{"aria-hidden":`true`}):(0,K.jsx)(S,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,i.archive?(0,K.jsxs)(P,{disabled:t.archive.isPending,onSelect:()=>e.archived?t.archive.mutate():t.setConfirming(`archive`),children:[e.archived?(0,K.jsx)(ze,{"aria-hidden":`true`}):(0,K.jsx)(ne,{"aria-hidden":`true`}),e.archived?`Unarchive`:`Archive task`]}):null,i.deleteRun?(0,K.jsx)(Oe,{}):null,i.deleteRun?(0,K.jsxs)(P,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,K.jsx)(be,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})}function yt({run:e,actions:t}){let n=t.confirming,r=(0,G.useRef)(n);n!==null&&(r.current=n);let i=n??r.current,a=i===`finish`?`Finish task?`:i===`archive`?`Archive task?`:`Delete task permanently?`,o=i===`finish`?`Review and finish`:i===`archive`?`Archive task`:`Delete task`;return(0,K.jsx)(we,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,K.jsxs)(de,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,K.jsxs)(Ce,{children:[(0,K.jsx)(se,{className:i===`delete`?`text-danger`:void 0,children:a}),(0,K.jsx)(oe,{children:(0,K.jsxs)(K.Fragment,{children:[i===`finish`?`Finish “`:i===`archive`?`Move “`:`Delete “`,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,title:c(e),children:c(e)}),i===`finish`?`”. Continue through the existing change-review gate before finalizing.`:i===`archive`?`” out of Active tasks. You can restore it from Archived.`:`” and its transcript, worktree and branch. This cannot be undone.`]})})]}),(0,K.jsxs)(ve,{children:[(0,K.jsx)(xe,{children:`Cancel`}),(0,K.jsx)(_e,{className:i===`delete`?`bg-danger text-danger-foreground hover:brightness-[0.96]`:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:()=>{i===`finish`?t.finish.mutate():i===`archive`?t.archive.mutate():t.delete.mutate(),t.setConfirming(null)},children:o})]})]})})}function bt({runId:e,onClose:t}){let n=Se(e);return(0,K.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 rounded-xl border border-border bg-card p-6`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,K.jsx)(T,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,K.jsx)(E,{})})]}),n.isPending?(0,K.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,K.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,K.jsx)(Ye,{children:n.data}):(0,K.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`}),(0,K.jsxs)(`div`,{className:`mt-4 flex gap-3`,children:[(0,K.jsx)(T,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void $(n.data??``,`Notes copied`),children:`Copy notes`}),(0,K.jsx)(T,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{W as i,ut as n,lt as r,ft as t};