@dylanpiercey/work 0.0.45 → 0.0.47

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 (246) hide show
  1. package/bin/work.mjs +7 -2
  2. package/dist/_CV5G1-Sr.js +2 -0
  3. package/dist/{_P9IsUQm2.js → _DM_oFS_v.js} +28 -3
  4. package/dist/{_BlvusYIA.js → _Dm4BVuln.js} +52 -52
  5. package/dist/{_DncwyiYL.js → _o0dwm0Ww.js} +68 -68
  6. package/dist/index.mjs +823 -1057
  7. package/dist/public/assets/{_BrNJO7NC.js → _2_8X99jw.js} +1 -1
  8. package/dist/public/assets/_2_8X99jw.js.br +0 -0
  9. package/dist/public/assets/{_CxfUzQkI.js → _5pEZdV75.js} +1 -1
  10. package/dist/public/assets/_5pEZdV75.js.br +0 -0
  11. package/dist/public/assets/{_DdvD3pSx2.js → _6fdNa05X2.js} +1 -1
  12. package/dist/public/assets/_6fdNa05X2.js.br +0 -0
  13. package/dist/public/assets/{_BPhrpOAd.js → _9CHuxVRu.js} +1 -1
  14. package/dist/public/assets/_9CHuxVRu.js.br +0 -0
  15. package/dist/public/assets/{_BeS7I1tE.js → _AG00U05V.js} +1 -1
  16. package/dist/public/assets/_AG00U05V.js.br +0 -0
  17. package/dist/public/assets/{_COItZVVh.js → _B2pxLNBO.js} +1 -1
  18. package/dist/public/assets/_B2pxLNBO.js.br +0 -0
  19. package/dist/public/assets/{_0jDMZ5Nf.js → _B3rIZBik.js} +1 -1
  20. package/dist/public/assets/_B3rIZBik.js.br +0 -0
  21. package/dist/public/assets/{_DlEZP4B2.js → _B8PQyubX.js} +1 -1
  22. package/dist/public/assets/_B8PQyubX.js.br +0 -0
  23. package/dist/public/assets/{_Dp6GcCez.js → _BDIKDRj8.js} +1 -1
  24. package/dist/public/assets/_BDIKDRj8.js.br +0 -0
  25. package/dist/public/assets/{_CBWyaxNg.js → _BEEHMSv_.js} +1 -1
  26. package/dist/public/assets/_BEEHMSv_.js.br +0 -0
  27. package/dist/public/assets/{_Drob8ol2.js → _BGFm3dJ4.js} +1 -1
  28. package/dist/public/assets/_BGFm3dJ4.js.br +0 -0
  29. package/dist/public/assets/{_2JIp-AkL.js → _BHjsQD4C.js} +1 -1
  30. package/dist/public/assets/_BHjsQD4C.js.br +0 -0
  31. package/dist/public/assets/{_DYgx29Kq2.js → _BIP7B1g62.js} +1 -1
  32. package/dist/public/assets/{_B2jdNsMP.js → _BLibugcj.js} +44 -44
  33. package/dist/public/assets/_BLibugcj.js.br +0 -0
  34. package/dist/public/assets/{_CWcbEhLf.js → _BLvHtG5b.js} +1 -1
  35. package/dist/public/assets/_BLvHtG5b.js.br +0 -0
  36. package/dist/public/assets/{_DQZT5aYv2.js → _BMWhe7UA2.js} +1 -1
  37. package/dist/public/assets/_BMWhe7UA2.js.br +0 -0
  38. package/dist/public/assets/{_DbeeD9R1.js → _BPiDffSK.js} +1 -1
  39. package/dist/public/assets/_BPiDffSK.js.br +0 -0
  40. package/dist/public/assets/{_rShrll8V.js → _BPq9uIVf.js} +1 -1
  41. package/dist/public/assets/_BPq9uIVf.js.br +0 -0
  42. package/dist/public/assets/{_ChdHZg3q2.js → _BRHBgjBP2.js} +1 -1
  43. package/dist/public/assets/_BRHBgjBP2.js.br +0 -0
  44. package/dist/public/assets/{_Fd6qP3go.js → _BZe4BZ4G.js} +1 -1
  45. package/dist/public/assets/_BZe4BZ4G.js.br +0 -0
  46. package/dist/public/assets/{_CVpg0dqw.js → _BgDRYHYE.js} +1 -1
  47. package/dist/public/assets/_BgDRYHYE.js.br +0 -0
  48. package/dist/public/assets/{_CUudFj1k2.js → _BmH7JUGb2.js} +1 -1
  49. package/dist/public/assets/_BmH7JUGb2.js.br +0 -0
  50. package/dist/public/assets/{_BKPFmzRa2.js → _BmtVFK052.js} +1 -1
  51. package/dist/public/assets/_BmtVFK052.js.br +0 -0
  52. package/dist/public/assets/{_C-3_S2jT.js → _Btx74Q-k.js} +1 -1
  53. package/dist/public/assets/_Btx74Q-k.js.br +0 -0
  54. package/dist/public/assets/{_B7_IQvxy.js → _BxlHpe2T.js} +1 -1
  55. package/dist/public/assets/_BxlHpe2T.js.br +0 -0
  56. package/dist/public/assets/{_7WXyLEhK.js → _BxuGlOMJ.js} +1 -1
  57. package/dist/public/assets/_BxuGlOMJ.js.br +0 -0
  58. package/dist/public/assets/{_Bj8eqKyf2.js → _By0S6RFm2.js} +1 -1
  59. package/dist/public/assets/_By0S6RFm2.js.br +0 -0
  60. package/dist/public/assets/{_B6bkX_xw.js → _ByQc1pkS.js} +1 -1
  61. package/dist/public/assets/_ByQc1pkS.js.br +0 -0
  62. package/dist/public/assets/{_BEn7bsbI.js → _BzuTzxB9.js} +1 -1
  63. package/dist/public/assets/_BzuTzxB9.js.br +0 -0
  64. package/dist/public/assets/{_DmkxrcNE2.js → _C3QGlxhv2.js} +1 -1
  65. package/dist/public/assets/_C3QGlxhv2.js.br +0 -0
  66. package/dist/public/assets/{_B1lH2KuX.js → _C7kYFLNM.js} +1 -1
  67. package/dist/public/assets/_C7kYFLNM.js.br +0 -0
  68. package/dist/public/assets/{_QBVNsQ8h.js → _C9YvMapn.js} +1 -1
  69. package/dist/public/assets/_C9YvMapn.js.br +0 -0
  70. package/dist/public/assets/{_BsDGIBWi.js → _CBF2sJFl.js} +1 -1
  71. package/dist/public/assets/_CBF2sJFl.js.br +0 -0
  72. package/dist/public/assets/{_cRSAYsIy.js → _CCXyJU0G.js} +1 -1
  73. package/dist/public/assets/_CCXyJU0G.js.br +0 -0
  74. package/dist/public/assets/{_wx4NAfvC.js → _CMIAElmF.js} +1 -1
  75. package/dist/public/assets/_CMIAElmF.js.br +0 -0
  76. package/dist/public/assets/{_C5qWivO82.js → _COmscE442.js} +1 -1
  77. package/dist/public/assets/_COmscE442.js.br +0 -0
  78. package/dist/public/assets/{_C7E2sftJ.js → _CRF3psRH.js} +1 -1
  79. package/dist/public/assets/_CRF3psRH.js.br +0 -0
  80. package/dist/public/assets/{_Cu2zWIrA.js → _CRpvVy-g.js} +1 -1
  81. package/dist/public/assets/_CRpvVy-g.js.br +0 -0
  82. package/dist/public/assets/{_WSiIjl8k.js → _CXsVxa93.js} +1 -1
  83. package/dist/public/assets/{_DJIoEU4l.js → _CYLr_2iE.js} +1 -1
  84. package/dist/public/assets/_CYLr_2iE.js.br +0 -0
  85. package/dist/public/assets/{_BmpuJc0U2.js → _CYb-TtX12.js} +1 -1
  86. package/dist/public/assets/_CYb-TtX12.js.br +0 -0
  87. package/dist/public/assets/{_BQKEgF_-.js → _Cawlufow.js} +1 -1
  88. package/dist/public/assets/_Cawlufow.js.br +0 -0
  89. package/dist/public/assets/{_i3m2va9y2.js → _CfyASWBT2.js} +1 -1
  90. package/dist/public/assets/_CfyASWBT2.js.br +0 -0
  91. package/dist/public/assets/{_BdE0YzeT2.js → _ChIGZgCK2.js} +1 -1
  92. package/dist/public/assets/_ChIGZgCK2.js.br +0 -0
  93. package/dist/public/assets/{_GX4ApnkB.js → _ClduJgR5.js} +1 -1
  94. package/dist/public/assets/_ClduJgR5.js.br +0 -0
  95. package/dist/public/assets/{_DUwDVnyb2.js → _Cp2bkjzT2.js} +1 -1
  96. package/dist/public/assets/_Cp2bkjzT2.js.br +0 -0
  97. package/dist/public/assets/{_BszYFXns.js → _CpxRirGf.js} +1 -1
  98. package/dist/public/assets/_CpxRirGf.js.br +0 -0
  99. package/dist/public/assets/{_DAES5BQ6.js → _CrvHv7e4.js} +1 -1
  100. package/dist/public/assets/_CrvHv7e4.js.br +0 -0
  101. package/dist/public/assets/{_DAp7RKbE2.js → _Cu3f85ax2.js} +1 -1
  102. package/dist/public/assets/_Cu3f85ax2.js.br +0 -0
  103. package/dist/public/assets/{_HmwD_O7C.js → _CyDJr5hJ.js} +1 -1
  104. package/dist/public/assets/_CyDJr5hJ.js.br +0 -0
  105. package/dist/public/assets/{_c4j42n9F2.js → _D1Ecsx8-2.js} +1 -1
  106. package/dist/public/assets/_D1Ecsx8-2.js.br +0 -0
  107. package/dist/public/assets/{_B-HE1A0L.js → _D2tmOnaH.js} +1 -1
  108. package/dist/public/assets/_D2tmOnaH.js.br +0 -0
  109. package/dist/public/assets/{_NSw61-q82.js → _D5DIKC5J2.js} +1 -1
  110. package/dist/public/assets/_D5DIKC5J2.js.br +0 -0
  111. package/dist/public/assets/{_CMXeuTU3.js → _DFC22iAc.js} +1 -1
  112. package/dist/public/assets/_DFC22iAc.js.br +0 -0
  113. package/dist/public/assets/{_Csumg8kE2.js → _DJYs9cGt2.js} +1 -1
  114. package/dist/public/assets/_DJYs9cGt2.js.br +0 -0
  115. package/dist/public/assets/{_BVVf3KNx2.js → _DPW4NADy2.js} +1 -1
  116. package/dist/public/assets/_DPW4NADy2.js.br +0 -0
  117. package/dist/public/assets/{_DSl3gnKp2.js → _DPc97sYv2.js} +1 -1
  118. package/dist/public/assets/{_DSfzkPVh.js → _DTXvrAdN.js} +1 -1
  119. package/dist/public/assets/_DTXvrAdN.js.br +0 -0
  120. package/dist/public/assets/{_RcdEaPTX.js → _DU0F-fSc.js} +1 -1
  121. package/dist/public/assets/_DU0F-fSc.js.br +0 -0
  122. package/dist/public/assets/{_wsALS6ya.js → _DZExUZ7A.js} +1 -1
  123. package/dist/public/assets/_DZExUZ7A.js.br +0 -0
  124. package/dist/public/assets/{_BKSy9tfl.js → _DZyW50O5.js} +1 -1
  125. package/dist/public/assets/_DZyW50O5.js.br +0 -0
  126. package/dist/public/assets/{_IiVyZhFQ2.js → _DbkqHev42.js} +1 -1
  127. package/dist/public/assets/_DbkqHev42.js.br +0 -0
  128. package/dist/public/assets/{_Ty6Zi_p6.js → _DeCqhciO.js} +1 -1
  129. package/dist/public/assets/_DeCqhciO.js.br +0 -0
  130. package/dist/public/assets/{_CCxiHsg1.js → _DgucIXC9.js} +1 -1
  131. package/dist/public/assets/_DgucIXC9.js.br +0 -0
  132. package/dist/public/assets/{_gqKnRhHm2.js → _Dj0FqIsq2.js} +1 -1
  133. package/dist/public/assets/_Dj0FqIsq2.js.br +0 -0
  134. package/dist/public/assets/{_B-tmCiTe2.js → _DvqRc7vA2.js} +1 -1
  135. package/dist/public/assets/_DvqRc7vA2.js.br +0 -0
  136. package/dist/public/assets/{_CvB8TafR.js → _Dvsdxjs1.js} +1 -1
  137. package/dist/public/assets/_Dvsdxjs1.js.br +0 -0
  138. package/dist/public/assets/{_CQjfWgLv.js → _FZ5aDFyS.js} +1 -1
  139. package/dist/public/assets/_FZ5aDFyS.js.br +0 -0
  140. package/dist/public/assets/{_D5wyt0NZ.js → _QZ7jIJEp.js} +1 -1
  141. package/dist/public/assets/_QZ7jIJEp.js.br +0 -0
  142. package/dist/public/assets/{_BBnPf4LB.js → _T_hWiFRO.js} +1 -1
  143. package/dist/public/assets/_T_hWiFRO.js.br +0 -0
  144. package/dist/public/assets/{_MbiYJ36s.js → _fkktwOR8.js} +1 -1
  145. package/dist/public/assets/_fkktwOR8.js.br +0 -0
  146. package/dist/public/assets/{_CVRoyRZW.js → _ji5qc8J4.js} +1 -1
  147. package/dist/public/assets/_ji5qc8J4.js.br +0 -0
  148. package/dist/public/assets/{_C9jJ-zAu2.js → _lTcPBjyz2.js} +1 -1
  149. package/dist/public/assets/_lTcPBjyz2.js.br +0 -0
  150. package/dist/public/assets/{_6t6kjpdU.js → _nqBpAHq9.js} +1 -1
  151. package/dist/public/assets/_nqBpAHq9.js.br +0 -0
  152. package/dist/public/assets/{_M4_M1GCx2.js → _tKPNE6U52.js} +1 -1
  153. package/dist/public/assets/_tKPNE6U52.js.br +0 -0
  154. package/dist/public/assets/{_C2a60ukk2.js → _zkaPdW0C2.js} +1 -1
  155. package/dist/public/assets/_zkaPdW0C2.js.br +0 -0
  156. package/dist/public/assets/diff-view-AJeZtePd.css +1 -0
  157. package/dist/public/assets/diff-view-AJeZtePd.css.br +0 -0
  158. package/dist/public/assets/index-BG3uLJV6.js +85 -0
  159. package/dist/public/assets/index-BG3uLJV6.js.br +0 -0
  160. package/dist/public/assets/index-_5MkiydM.css +1 -0
  161. package/dist/public/assets/index-_5MkiydM.css.br +0 -0
  162. package/dist/public/assets/preload-helper-C1JvlFma.css +1 -0
  163. package/dist/public/assets/preload-helper-C1JvlFma.css.br +0 -0
  164. package/package.json +1 -2
  165. package/dist/_kABYZA6_.js +0 -2
  166. package/dist/public/assets/_0jDMZ5Nf.js.br +0 -0
  167. package/dist/public/assets/_2JIp-AkL.js.br +0 -0
  168. package/dist/public/assets/_6t6kjpdU.js.br +0 -0
  169. package/dist/public/assets/_7WXyLEhK.js.br +0 -0
  170. package/dist/public/assets/_B-HE1A0L.js.br +0 -0
  171. package/dist/public/assets/_B-tmCiTe2.js.br +0 -0
  172. package/dist/public/assets/_B1lH2KuX.js.br +0 -0
  173. package/dist/public/assets/_B2jdNsMP.js.br +0 -0
  174. package/dist/public/assets/_B6bkX_xw.js.br +0 -0
  175. package/dist/public/assets/_B7_IQvxy.js.br +0 -0
  176. package/dist/public/assets/_BBnPf4LB.js.br +0 -0
  177. package/dist/public/assets/_BEn7bsbI.js.br +0 -0
  178. package/dist/public/assets/_BKPFmzRa2.js.br +0 -0
  179. package/dist/public/assets/_BKSy9tfl.js.br +0 -0
  180. package/dist/public/assets/_BPhrpOAd.js.br +0 -0
  181. package/dist/public/assets/_BQKEgF_-.js.br +0 -0
  182. package/dist/public/assets/_BVVf3KNx2.js.br +0 -0
  183. package/dist/public/assets/_BdE0YzeT2.js.br +0 -0
  184. package/dist/public/assets/_BeS7I1tE.js.br +0 -0
  185. package/dist/public/assets/_Bj8eqKyf2.js.br +0 -0
  186. package/dist/public/assets/_BmpuJc0U2.js.br +0 -0
  187. package/dist/public/assets/_BrNJO7NC.js.br +0 -0
  188. package/dist/public/assets/_BsDGIBWi.js.br +0 -0
  189. package/dist/public/assets/_BszYFXns.js.br +0 -0
  190. package/dist/public/assets/_C-3_S2jT.js.br +0 -0
  191. package/dist/public/assets/_C2a60ukk2.js.br +0 -0
  192. package/dist/public/assets/_C5qWivO82.js.br +0 -0
  193. package/dist/public/assets/_C7E2sftJ.js.br +0 -0
  194. package/dist/public/assets/_C9jJ-zAu2.js.br +0 -0
  195. package/dist/public/assets/_CBWyaxNg.js.br +0 -0
  196. package/dist/public/assets/_CCxiHsg1.js.br +0 -0
  197. package/dist/public/assets/_CMXeuTU3.js.br +0 -0
  198. package/dist/public/assets/_COItZVVh.js.br +0 -0
  199. package/dist/public/assets/_CQjfWgLv.js.br +0 -0
  200. package/dist/public/assets/_CUudFj1k2.js.br +0 -0
  201. package/dist/public/assets/_CVRoyRZW.js.br +0 -0
  202. package/dist/public/assets/_CVpg0dqw.js.br +0 -0
  203. package/dist/public/assets/_CWcbEhLf.js.br +0 -0
  204. package/dist/public/assets/_ChdHZg3q2.js.br +0 -0
  205. package/dist/public/assets/_Csumg8kE2.js.br +0 -0
  206. package/dist/public/assets/_Cu2zWIrA.js.br +0 -0
  207. package/dist/public/assets/_CvB8TafR.js.br +0 -0
  208. package/dist/public/assets/_CxfUzQkI.js.br +0 -0
  209. package/dist/public/assets/_D5wyt0NZ.js.br +0 -0
  210. package/dist/public/assets/_DAES5BQ6.js.br +0 -0
  211. package/dist/public/assets/_DAp7RKbE2.js.br +0 -0
  212. package/dist/public/assets/_DJIoEU4l.js.br +0 -0
  213. package/dist/public/assets/_DQZT5aYv2.js.br +0 -0
  214. package/dist/public/assets/_DSfzkPVh.js.br +0 -0
  215. package/dist/public/assets/_DUwDVnyb2.js.br +0 -0
  216. package/dist/public/assets/_DbeeD9R1.js.br +0 -0
  217. package/dist/public/assets/_DdvD3pSx2.js.br +0 -0
  218. package/dist/public/assets/_DlEZP4B2.js.br +0 -0
  219. package/dist/public/assets/_DmkxrcNE2.js.br +0 -0
  220. package/dist/public/assets/_Dp6GcCez.js.br +0 -0
  221. package/dist/public/assets/_Drob8ol2.js.br +0 -0
  222. package/dist/public/assets/_Fd6qP3go.js.br +0 -0
  223. package/dist/public/assets/_GX4ApnkB.js.br +0 -0
  224. package/dist/public/assets/_HmwD_O7C.js.br +0 -0
  225. package/dist/public/assets/_IiVyZhFQ2.js.br +0 -0
  226. package/dist/public/assets/_M4_M1GCx2.js.br +0 -0
  227. package/dist/public/assets/_MbiYJ36s.js.br +0 -0
  228. package/dist/public/assets/_NSw61-q82.js.br +0 -0
  229. package/dist/public/assets/_QBVNsQ8h.js.br +0 -0
  230. package/dist/public/assets/_RcdEaPTX.js.br +0 -0
  231. package/dist/public/assets/_Ty6Zi_p6.js.br +0 -0
  232. package/dist/public/assets/_c4j42n9F2.js.br +0 -0
  233. package/dist/public/assets/_cRSAYsIy.js.br +0 -0
  234. package/dist/public/assets/_gqKnRhHm2.js.br +0 -0
  235. package/dist/public/assets/_i3m2va9y2.js.br +0 -0
  236. package/dist/public/assets/_rShrll8V.js.br +0 -0
  237. package/dist/public/assets/_wsALS6ya.js.br +0 -0
  238. package/dist/public/assets/_wx4NAfvC.js.br +0 -0
  239. package/dist/public/assets/diff-view-l7q43Ong.css +0 -1
  240. package/dist/public/assets/diff-view-l7q43Ong.css.br +0 -0
  241. package/dist/public/assets/index-BXWsr0DP.js +0 -86
  242. package/dist/public/assets/index-BXWsr0DP.js.br +0 -0
  243. package/dist/public/assets/index-Du7Hgz2d.css +0 -1
  244. package/dist/public/assets/index-Du7Hgz2d.css.br +0 -0
  245. package/dist/public/assets/preload-helper-Di0vWBYv.css +0 -1
  246. package/dist/public/assets/preload-helper-Di0vWBYv.css.br +0 -0
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "./_BMI-E3GI.js";
2
- import { A as TMUX_SOCKET, B as db, C as pushPublicKey, D as preferredAgent, E as allPrefs, F as publish, H as workspacePath, I as subscribe, L as subscriberCount, M as git, N as run, O as setPref, P as tmux, R as subscriberJoins, S as deleteSubscription, T as AGENTS, U as config, V as get, _ as reasonFromHookPayload, a as killSession, b as setSessionViewers, c as newSessionArgs, d as renameSession, f as sendToSession, g as clearAgentPhase, h as reportsWorking, i as getSession, j as gh, k as setSetting, m as tmuxName, n as createSession, o as killWorkspaceSessions, p as sessionStates, r as ensureTmuxServer, s as listSessions, t as cleanEnv, u as panePids, v as setAgentPhase, w as saveSubscription, x as summaryFromHookPayload, y as setScrapedPhase, z as all } from "./_P9IsUQm2.js";
3
- import { $ as _subscribe, A as _el_resume, B as _peek_scope_id, C as _attr_style, D as _dynamic_tag, E as _content_resume, F as _hoist, G as _scope_with_id, H as _resume_branch, I as _hoist_read_error, J as _serialize_guard, K as _script, L as _html, M as _existing_scope, N as _flush_head, P as _for_of, Q as _show_start, R as _id, S as _attr_select_value, T as _content, U as _scope_id, V as _resume, W as _scope_reason, X as _set_serialize_reason, Y as _serialize_if, Z as _show_end, _ as _attr, at as attrTag, b as _attr_input_value, c as sideNavOpen, d as icon_base_default, et as _template, f as fuzzy, g as $global, h as phase, i as icon_sidebar_default, it as _var, j as _escape, k as _el_read_error, l as workspaceTab, m as toast_default, n as findIconBtn, nt as _trailers, ot as withPageAssets, p as rankRepos, q as _sep, r as findInput, rt as _try, s as setWorkspaceTab, st as writeScope, tt as _to_text, u as icon_refresh_default, v as _attr_class, w as _await, x as _attr_option_value, z as _if } from "./_BlvusYIA.js";
2
+ import { A as allPrefs, B as subscribe, C as setScrapedPhase, D as pushPublicKey, E as deleteSubscription, F as gh, G as get, H as subscriberJoins, I as git, K as workspacePath, L as run, M as setPref, N as setSetting, O as saveSubscription, P as TMUX_SOCKET, R as tmux, S as setAgentPhase, T as summaryFromHookPayload, U as all, V as subscriberCount, W as db, _ as tmuxName, a as ensureTmuxServer, b as clearAgentPhase, c as killWorkspaceSessions, d as newSessionArgs, g as sessionStates, h as sendToSession, i as disposeSessions, j as preferredAgent, k as AGENTS, l as listSessions, m as renameSession, n as clearTmuxStarted, o as getSession, p as panePids, q as config, r as createSession, s as killSession, t as cleanEnv, u as markTmuxStarted, v as tmuxWasStarted, w as setSessionViewers, x as reasonFromHookPayload, y as reportsWorking, z as publish } from "./_DM_oFS_v.js";
3
+ import { $ as _subscribe, A as _el_resume, B as _peek_scope_id, C as _attr_style, D as _dynamic_tag, E as _content_resume, F as _hoist, G as _scope_with_id, H as _resume_branch, I as _hoist_read_error, J as _serialize_guard, K as _script, L as _html, M as _existing_scope, N as _flush_head, P as _for_of, Q as _show_start, R as _id, S as _attr_select_value, T as _content, U as _scope_id, V as _resume, W as _scope_reason, X as _set_serialize_reason, Y as _serialize_if, Z as _show_end, _ as _attr, at as attrTag, b as _attr_input_value, c as sideNavOpen, d as rankRepos, et as _template, f as icon_refresh_default, g as $global, h as phase, i as icon_sidebar_default, it as _var, j as _escape, k as _el_read_error, l as workspaceTab, m as toast_default, n as findIconBtn, nt as _trailers, ot as withPageAssets, p as icon_base_default, q as _sep, r as findInput, rt as _try, s as setWorkspaceTab, st as writeScope, tt as _to_text, v as _attr_class, w as _await, x as _attr_option_value, z as _if } from "./_Dm4BVuln.js";
4
4
  import fs from "node:fs";
5
5
  import { createServer } from "node:http";
6
6
  import path from "node:path";
@@ -1741,8 +1741,11 @@ async function setWorkspaceStatus(id, status) {
1741
1741
  async function deleteWorkspace(id) {
1742
1742
  const ws = getWorkspace(id);
1743
1743
  if (!ws) throw new Error(`unknown workspace: ${id}`);
1744
+ const sessions = listSessions(id);
1745
+ db.prepare("DELETE FROM workspaces WHERE id = ?").run(id);
1746
+ notifyWorkspacesChanged();
1744
1747
  progress$1(`Stopping sessions and processes…`);
1745
- await killWorkspaceSessions(id);
1748
+ await disposeSessions(sessions);
1746
1749
  await killWorkspaceProcs(ws.path);
1747
1750
  const foreign = otherWorkspaceBranches(ws.id);
1748
1751
  for (const repo of ws.repos) {
@@ -1769,8 +1772,6 @@ async function deleteWorkspace(id) {
1769
1772
  recursive: true,
1770
1773
  force: true
1771
1774
  });
1772
- db.prepare("DELETE FROM workspaces WHERE id = ?").run(id);
1773
- notifyWorkspacesChanged();
1774
1775
  }
1775
1776
  /** SSE payload: full workspace list so clients don't refetch. */
1776
1777
  function notifyWorkspacesChanged() {
@@ -2154,6 +2155,9 @@ function swr(ttlMs, load, seed) {
2154
2155
  value
2155
2156
  });
2156
2157
  };
2158
+ /** Current cached value, if any — used when a batch update must merge
2159
+ * with a richer per-key load rather than replace it. */
2160
+ read.get = (key) => cache.get(key)?.value;
2157
2161
  return read;
2158
2162
  }
2159
2163
  //#endregion
@@ -2254,7 +2258,14 @@ async function refreshPrsBatch(targets, force = false) {
2254
2258
  const branches = [...new Set(wanted.map((t) => t.branch))];
2255
2259
  for (const target of wanted) {
2256
2260
  const foreign = branches.filter((b) => b !== target.branch);
2257
- branchPrs.set(branchKey(target.fullName, target.branch), prsForBranchPrefix(nodes.filter((n) => n.repository.nameWithOwner === target.fullName), target.branch, foreign));
2261
+ const key = branchKey(target.fullName, target.branch);
2262
+ const incoming = prsForBranchPrefix(nodes.filter((n) => n.repository.nameWithOwner === target.fullName), target.branch, foreign);
2263
+ const open = incoming.filter((p) => p.state === "OPEN");
2264
+ const openNums = new Set(open.map((p) => p.number));
2265
+ const done = /* @__PURE__ */ new Map();
2266
+ for (const p of branchPrs.get(key) ?? []) if (p.state !== "OPEN" && !openNums.has(p.number)) done.set(p.number, p);
2267
+ for (const p of incoming) if (p.state !== "OPEN" && !openNums.has(p.number)) done.set(p.number, p);
2268
+ branchPrs.set(key, [...open, ...done.values()]);
2258
2269
  }
2259
2270
  return true;
2260
2271
  } catch (err) {
@@ -2580,71 +2591,12 @@ function coalesce(fn) {
2580
2591
  };
2581
2592
  }
2582
2593
  //#endregion
2583
- //#region src/client/status.ts
2584
- /** Workspace activity dot from its polled status counts. */
2585
- function phaseOf(status) {
2586
- return status?.working ? "working" : status?.waiting ? "waiting" : status?.agents ? "idle" : "off";
2587
- }
2588
- /** Session activity dot from its own state. */
2589
- function sessionPhase(state) {
2590
- return state?.phase === "working" ? "working" : state?.phase === "waiting" ? "waiting" : state?.alive ? "idle" : "off";
2591
- }
2592
- /** Binary each session kind launches, inverted — `sessions.ts` COMMANDS. */
2593
- var AGENT_BY_COMMAND = {
2594
- claude: "claude",
2595
- codex: "codex",
2596
- grok: "grok",
2597
- copilot: "copilot",
2598
- "cursor-agent": "cursor"
2599
- };
2600
- /**
2601
- * What a session is *running*, which is not always what it was started as: a
2602
- * shell someone typed `claude` into is a claude session as far as the reader
2603
- * is concerned. Only shells are reinterpreted — an agent kind stays itself
2604
- * even while it shells out, so the icon doesn't flicker mid-command.
2605
- */
2606
- function activeAgent(session) {
2607
- if (session.agent !== "shell") return session.agent;
2608
- const command = session.state?.command?.trim();
2609
- return command && AGENT_BY_COMMAND[command] || session.agent;
2610
- }
2611
- //#endregion
2612
- //#region src/tags/icons/icon-diff.marko
2613
- var icon_diff_default = _template("F", (input) => {
2614
- const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
2615
- const $scope0_id = _scope_id();
2616
- _set_serialize_reason({
2617
- 0: $sg__input_size__OR__input_class,
2618
- 1: $sg__input_size__OR__input_class
2619
- });
2620
- const $childScope = _peek_scope_id();
2621
- icon_base_default({
2622
- d: "M18 21C19.1046 21 20 20.1046 20 19C20 17.8954 19.1046 17 18 17C16.8954 17 16 17.8954 16 19C16 20.1046 16.8954 21 18 21Z M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z M18 17V7C18 7 18 5 16 5H13 M6 7V17C6 17 6 19 8 19H11 M15.0005 7.50012L12.5005 5.00012L15.0005 2.50012 M8.5 16.5L11 19L8.5 21.5",
2623
- size: input.size,
2624
- class: input.class
2625
- });
2626
- _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
2627
- });
2628
- //#endregion
2629
- //#region src/tags/icons/icon-manage.marko
2630
- var icon_manage_default = _template("M", (input) => {
2631
- const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
2632
- const $scope0_id = _scope_id();
2633
- _set_serialize_reason({
2634
- 0: $sg__input_size__OR__input_class,
2635
- 1: $sg__input_size__OR__input_class
2636
- });
2637
- const $childScope = _peek_scope_id();
2638
- icon_base_default({
2639
- d: "M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z M19.6224 10.3954L18.5247 7.7448L20 6L18 4L16.2647 5.48295L13.5578 4.36974L12.9353 2H10.981L10.3491 4.40113L7.70441 5.51596L6 4L4 6L5.45337 7.78885L4.3725 10.4463L2 11V13L4.40111 13.6555L5.51575 16.2997L4 18L6 20L7.79116 18.5403L10.397 19.6123L11 22H13L13.6045 19.6132L16.2551 18.5155C16.6969 18.8313 18 20 18 20L20 18L18.5159 16.2494L19.6139 13.598L21.9999 12.9772L22 11L19.6224 10.3954Z",
2640
- size: input.size,
2641
- class: input.class
2642
- });
2643
- _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
2644
- });
2594
+ //#region src/tags/new-workspace.css.ts
2595
+ var content$2 = "_X _Q";
2596
+ var iconBtn$3 = "_0 _A";
2645
2597
  //#endregion
2646
2598
  //#region src/tags/icons/icon-plus.marko
2647
- var icon_plus_default = _template("N", (input) => {
2599
+ var icon_plus_default = _template("M", (input) => {
2648
2600
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
2649
2601
  const $scope0_id = _scope_id();
2650
2602
  _set_serialize_reason({
@@ -2660,347 +2612,9 @@ var icon_plus_default = _template("N", (input) => {
2660
2612
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
2661
2613
  });
2662
2614
  //#endregion
2663
- //#region src/tags/icons/icon-agent.marko
2664
- var PATHS = {
2665
- claude: "M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z",
2666
- codex: "M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z",
2667
- grok: "M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815",
2668
- copilot: "M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z",
2669
- cursor: "M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"
2670
- };
2671
- var icon_agent_default = _template("z", (input) => {
2672
- const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0), $si__input_size__OR__input_class = _serialize_if($scope0_reason, 0), $si__input_size__OR__input_agent__OR__input_class = _serialize_if($scope0_reason, 1), $sg__input_agent = _serialize_guard($scope0_reason, 2);
2673
- const $scope0_id = _scope_id();
2674
- const size = input.size ?? 15;
2675
- const d = PATHS[input.agent];
2676
- _if(() => {
2677
- if (d) {
2678
- const $scope1_id = _scope_id();
2679
- _html(`<svg${_attr_class(["_d", input.class])}${_attr("width", size)}${_attr("height", size)} viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path${_attr("d", d)}></path>${_el_resume($scope1_id, "b", $sg__input_agent)}</svg>${_el_resume($scope1_id, "a", $sg__input_size__OR__input_class)}`);
2680
- $si__input_size__OR__input_agent__OR__input_class && writeScope($scope1_id, { _: _scope_with_id($scope0_id) });
2681
- return 0;
2682
- } else {
2683
- const $scope2_id = _scope_id();
2684
- _set_serialize_reason({
2685
- 0: $sg__input_size__OR__input_class,
2686
- 1: $sg__input_size__OR__input_class
2687
- });
2688
- const $childScope = _peek_scope_id();
2689
- icon_base_default({
2690
- d: "M5 7L10 12L5 17 M13 17H20",
2691
- size: input.size,
2692
- class: input.class
2693
- });
2694
- $si__input_size__OR__input_agent__OR__input_class && writeScope($scope2_id, {
2695
- _: $si__input_size__OR__input_class && _scope_with_id($scope0_id),
2696
- a: $si__input_size__OR__input_class && _existing_scope($childScope)
2697
- });
2698
- return 1;
2699
- }
2700
- }, $scope0_id, "a", _serialize_guard($scope0_reason, 1), $sg__input_agent, $sg__input_agent, 0, 1);
2701
- _serialize_if($scope0_reason, 2) && writeScope($scope0_id, {
2702
- d: input.size,
2703
- f: input.class,
2704
- g: size,
2705
- h: d
2706
- });
2707
- });
2708
- //#endregion
2709
- //#region src/tags/palette.marko
2710
- var api$7;
2711
- var palette_default = _template("o", (input) => {
2712
- const $scope0_reason = _scope_reason(), $sg__input_inline = _serialize_guard($scope0_reason, 8), $sg__input_inline__OR__input_workspaces_length = _serialize_guard($scope0_reason, 0), $si__input_settings_agents = _serialize_if($scope0_reason, 10), $si__input_selectedId = _serialize_if($scope0_reason, 7), $si__input_status = _serialize_if($scope0_reason, 9);
2713
- const $scope0_id = _scope_id();
2714
- const $input_selectedId__closures = /* @__PURE__ */ new Set();
2715
- const $input_status__closures = /* @__PURE__ */ new Set();
2716
- const $input_settings_agents__closures = /* @__PURE__ */ new Set();
2717
- input.open;
2718
- let query = input.query;
2719
- let settings = input.settings;
2720
- let hiRaw = 0;
2721
- let showArchived = false;
2722
- const active = input.workspaces.filter((ws) => ws.status === "active");
2723
- const archived = input.workspaces.filter((ws) => ws.status === "archived");
2724
- const matches = _resume((list) => list.filter((ws) => fuzzy(query || "", ws.name)), "o2", $scope0_id);
2725
- const currentWs = input.workspaces.find((ws) => ws.id === input.selectedId);
2726
- const commands = !query || !currentWs ? [] : [
2727
- {
2728
- kind: "cmd",
2729
- label: `Review changes — ${currentWs.name}`,
2730
- run: () => input.onReview(currentWs)
2731
- },
2732
- {
2733
- kind: "cmd",
2734
- label: `Manage workspace — ${currentWs.name}`,
2735
- run: () => input.onManage(currentWs)
2736
- },
2737
- {
2738
- kind: "cmd",
2739
- label: `New ${settings?.preferredAgent || "agent"} session — ${currentWs.name}`,
2740
- run: () => input.onNewSession(currentWs, settings?.preferredAgent || "claude")
2741
- }
2742
- ].filter((r) => r.kind === "cmd" && fuzzy(query || "", r.label));
2743
- const rows$1 = [
2744
- ...matches(active).map((ws) => ({
2745
- kind: "ws",
2746
- ws
2747
- })),
2748
- ...query ? matches(archived).map((ws) => ({
2749
- kind: "ws",
2750
- ws,
2751
- archived: true
2752
- })) : [],
2753
- ...commands,
2754
- { kind: "new" }
2755
- ];
2756
- const hi = Math.min(hiRaw, rows$1.length - 1);
2757
- const pick = _resume((row) => {
2758
- if (!row) return;
2759
- if (row.kind === "new") input.onNew();
2760
- else if (row.kind === "cmd") row.run();
2761
- else input.onSelect(row.ws);
2762
- }, "o3", $scope0_id);
2763
- _if(() => {
2764
- if (!input.inline) {
2765
- const $scope5_id = _scope_id();
2766
- _html(`<div${_attr_class("_bo")}></div>${_el_resume($scope5_id, "a")}`);
2767
- _script($scope5_id, "o4");
2768
- writeScope($scope5_id, {});
2769
- return 0;
2770
- }
2771
- }, $scope0_id, "a", $sg__input_inline, $sg__input_inline, 1, 0, 1);
2772
- _html(`<div${_attr_class(["_bq", { ["_bp"]: input.inline }])} data-palette${input.inline ? " data-inline" : ""} role=dialog aria-label=Workspaces>`);
2773
- _if(() => {
2774
- if (input.inline && !input.workspaces.length) {
2775
- const $scope8_id = _scope_id();
2776
- _html(`<div${_attr_class("_by")}><p${_attr_class("_bK")}>A <strong>workspace</strong> checks out one or more repos as git worktrees on a shared branch and gives each agent session its own terminal. Create one to get started.</p><p${_attr_class("_bK")}>Pick your preferred agent below — new sessions and the quick-create button use it. GitHub access uses your <code>gh</code> login.</p></div>`);
2777
- _serialize_if($scope0_reason, 0) && writeScope($scope8_id, {});
2778
- return 0;
2779
- }
2780
- }, $scope0_id, "c", $sg__input_inline__OR__input_workspaces_length, $sg__input_inline__OR__input_workspaces_length, 1, 0, 1);
2781
- _html(`<input${_attr_input_value($scope0_id, "d", query || "", _resume(function(v) {
2782
- query = v;
2783
- hiRaw = 0;
2784
- }, "o0", $scope0_id))}${_attr_class("_bI")} autofocus placeholder="Jump to workspace…" aria-label="Filter workspaces">${_el_resume($scope0_id, "d")}<ul${_attr_class(["_br", !input.inline && "_bJ"])}>`);
2785
- _for_of(rows$1, (row$1, i) => {
2786
- const $scope1_id = _scope_id();
2787
- _html(`<li><div${_attr_class("_bs")}><button${_attr_class(["_bv", {
2788
- ["_bu"]: i === hi,
2789
- ["_bt"]: row$1.kind === "ws" && row$1.archived
2790
- }])}>`);
2791
- _if(() => {
2792
- if (row$1.kind === "new") {
2793
- const $scope10_id = _scope_id();
2794
- _html(`<span${_attr_class("_bz")}>+ New workspace</span>`);
2795
- writeScope($scope10_id, {});
2796
- return 0;
2797
- } else if (row$1.kind === "cmd") {
2798
- const $scope9_id = _scope_id();
2799
- _html(`<span${_attr_class(["_bz", "_bx"])}>▸ <!>${_escape(row$1.label)}${_el_resume($scope9_id, "b")}</span>`);
2800
- writeScope($scope9_id, {});
2801
- return 1;
2802
- } else {
2803
- const $scope2_id = _scope_id();
2804
- const st = input.status[row$1.ws.id];
2805
- const rowPrs = (st?.repos || []).flatMap((r) => r.prs || []);
2806
- _html(`<span${_attr_class("_bz")}><span${_attr_class(["_q", phase[phaseOf(st)]])}></span>${_el_resume($scope2_id, "b")}<span${_attr_class("_bA")}>${_escape(row$1.ws.name)}${_el_resume($scope2_id, "d")}</span>`);
2807
- _if(() => {
2808
- if (row$1.ws.id === input.selectedId) {
2809
- const $scope14_id = _scope_id();
2810
- _html(`<span${_attr_class(["_j", "_bC"])}>open</span>`);
2811
- writeScope($scope14_id, {});
2812
- return 0;
2813
- }
2814
- }, $scope2_id, "e", 1, 1, 1, 0, 1);
2815
- _if(() => {
2816
- if (row$1.archived) {
2817
- const $scope15_id = _scope_id();
2818
- _html(`<span${_attr_class("_j")}>archived</span>`);
2819
- writeScope($scope15_id, {});
2820
- return 0;
2821
- }
2822
- }, $scope2_id, "f", 1, 1, 1, 0, 1);
2823
- _html(`<span${_attr_class("_bB")}>`);
2824
- _if(() => {
2825
- if (st?.agents) {
2826
- const $scope11_id = _scope_id();
2827
- _html(`<span${_attr_class(["_j", "_bD"])}${_attr("title", `${st.agents} running session${st.agents === 1 ? "" : "s"}${st.working ? ` — ${st.working} working` : ""}${st.waiting ? ` — ${st.waiting} waiting on you` : ""}`)}>${_escape(st.agents)}${_el_resume($scope11_id, "b")}</span>${_el_resume($scope11_id, "a")}`);
2828
- writeScope($scope11_id, {});
2829
- return 0;
2830
- }
2831
- }, $scope2_id, "h", 1, 1, 1, 0, 1);
2832
- _if(() => {
2833
- if (rowPrs.length) {
2834
- const $scope13_id = _scope_id();
2835
- _html(`<span${_attr_class(["_j", "_bD"])}${_attr("title", `${rowPrs.length} open PR${rowPrs.length === 1 ? "" : "s"}`)}>${_escape(rowPrs.length)}${_el_resume($scope13_id, "b")} PR<!>${rowPrs.length === 1 ? "" : "s"}${_el_resume($scope13_id, "c")}</span>${_el_resume($scope13_id, "a")}`);
2836
- writeScope($scope13_id, {});
2837
- return 0;
2838
- }
2839
- }, $scope2_id, "i", 1, 1, 1, 0, 1);
2840
- _if(() => {
2841
- if ((st?.ports || []).length) {
2842
- const $scope12_id = _scope_id();
2843
- _html(`<span${_attr_class(["_j", "_bD"])}${_attr("title", st.ports.map((p) => `:${p.port} ${p.cmd}`).join("\n"))}>:<!>${_escape(st.ports.length)}${_el_resume($scope12_id, "b")}</span>${_el_resume($scope12_id, "a")}`);
2844
- writeScope($scope12_id, {});
2845
- return 0;
2846
- }
2847
- }, $scope2_id, "j", 1, 1, 1, 0, 1);
2848
- _html(`</span></span><span${_attr_class("_bE")}>`);
2849
- _for_of(st?.repos || row$1.ws.repos, (repo) => {
2850
- const $scope16_id = _scope_id();
2851
- _html(`<span${_attr_class("_o")}>${_escape(repo.worktree)}${_el_resume($scope16_id, "b")}</span>`);
2852
- writeScope($scope16_id, {});
2853
- }, "full_name", $scope2_id, "k", 1, 1, 1, "</span>", 1);
2854
- _subscribe($si__input_status && $input_status__closures, _subscribe($si__input_selectedId && $input_selectedId__closures, writeScope($scope2_id, {
2855
- o: st?.agents,
2856
- p: st?.working,
2857
- q: st?.waiting,
2858
- r: st?.ports,
2859
- s: st?.ports?.length,
2860
- u: rowPrs?.length
2861
- })));
2862
- return 2;
2863
- }
2864
- }, $scope1_id, "b", 1, 1, 1, "</button>");
2865
- _if(() => {
2866
- if (row$1.kind === "ws") {
2867
- const $scope3_id = _scope_id();
2868
- _html(`<button${_attr_class("_bw")} title="Review changes">`);
2869
- icon_diff_default({ size: 13 });
2870
- _html(`</button>${_el_resume($scope3_id, "a")}<button${_attr_class("_bw")} title="Manage workspace">`);
2871
- icon_manage_default({ size: 13 });
2872
- const newPopId = _id();
2873
- let pickerReady = false;
2874
- _html(`</button>${_el_resume($scope3_id, "c")}<button${_attr_class("_bw")} title="New session"${_attr("popovertarget", newPopId)}>`);
2875
- icon_plus_default({ size: 13 });
2876
- _html(`</button>${_el_resume($scope3_id, "e")}<div${_attr("id", newPopId)} popover=auto${_attr_class("_bM")}>`);
2877
- _for_of([], (agent) => {
2878
- const $scope4_id = _scope_id();
2879
- _html(`<button${_attr_class("_bN")}>`);
2880
- _set_serialize_reason(12);
2881
- const $childScope = _peek_scope_id();
2882
- icon_agent_default({
2883
- agent,
2884
- size: 14
2885
- });
2886
- _html(`<!>${_escape(agent)}${_el_resume($scope4_id, "c")}</button>${_el_resume($scope4_id, "a")}`);
2887
- _script($scope4_id, "o5");
2888
- writeScope($scope4_id, {
2889
- e: agent,
2890
- b: _existing_scope($childScope)
2891
- });
2892
- }, (a) => a, $scope3_id, "g", 1, 1, 1, "</div>", 1);
2893
- _script($scope3_id, "o6");
2894
- _subscribe($si__input_settings_agents && $input_settings_agents__closures, writeScope($scope3_id, { i: $si__input_settings_agents && pickerReady }));
2895
- return 0;
2896
- }
2897
- }, $scope1_id, "c");
2898
- _html("</div></li>");
2899
- _script($scope1_id, "o7");
2900
- writeScope($scope1_id, {
2901
- e: row$1,
2902
- f: row$1?.kind,
2903
- g: row$1?.archived,
2904
- h: row$1?.label,
2905
- i: row$1?.ws,
2906
- j: row$1?.ws?.id,
2907
- k: row$1?.ws?.name,
2908
- l: row$1?.ws?.repos,
2909
- m: i
2910
- });
2911
- }, (r) => r.kind === "new" ? "new" : r.kind === "cmd" ? `cmd:${r.label}` : r.ws.id, $scope0_id, "e", 1, 1, 1, "</ul>", 1);
2912
- _if(() => {
2913
- if (archived.length && !query) {
2914
- const $scope7_id = _scope_id();
2915
- _html(`<button${_attr_class("_bH")}>${`archived (${_escape(`${archived.length}`)})`}${_el_resume($scope7_id, "b")}</button>${_el_resume($scope7_id, "a")}`);
2916
- _script($scope7_id, "o8");
2917
- writeScope($scope7_id, {});
2918
- return 0;
2919
- }
2920
- }, $scope0_id, "f", 1, 1, 1, 0, 1);
2921
- _html(`<div${_attr_class("_bF")}><span></span><span${_attr_class("_bG")}>↑↓ navigate · ↵ open · ⌘1–9 switch · esc close</span>`);
2922
- _if(() => {
2923
- if (settings) {
2924
- const $scope6_id = _scope_id();
2925
- _html(`<label${_attr_class("_n")}>`);
2926
- _attr_select_value($scope6_id, "b", settings.preferredAgent, _resume(function(v) {
2927
- settings = {
2928
- ...settings,
2929
- preferredAgent: v
2930
- };
2931
- api$7("/api/settings", {
2932
- method: "PUT",
2933
- headers: { "content-type": "application/json" },
2934
- body: JSON.stringify({ preferredAgent: v })
2935
- }).catch(() => {});
2936
- }, "o1", $scope6_id), () => {
2937
- _html(`<select${_attr_class("_bL")} aria-label="Preferred agent">`);
2938
- _for_of(settings.agents, (agent) => {
2939
- const $scope17_id = _scope_id();
2940
- _html(`<option${_attr_option_value(agent)}>${_escape(agent)}${_el_resume($scope17_id, "b")}</option>${_el_resume($scope17_id, "a")}`);
2941
- writeScope($scope17_id, {});
2942
- }, (a) => a, $scope6_id, "b", 1, 1, 1, "</select>", 1);
2943
- });
2944
- _html("</label>");
2945
- _script($scope6_id, "o9");
2946
- writeScope($scope6_id, {});
2947
- return 0;
2948
- }
2949
- }, $scope0_id, "i", 1, 1, 1, 0, 1);
2950
- _html(`</div></div>${_el_resume($scope0_id, "b")}`);
2951
- _script($scope0_id, "o10");
2952
- _script($scope0_id, "o11");
2953
- _script($scope0_id, "o12");
2954
- writeScope($scope0_id, {
2955
- l: _serialize_if($scope0_reason, 2) && input.open,
2956
- m: _serialize_if($scope0_reason, 1) && input.openChange,
2957
- o: _serialize_if($scope0_reason, 4) && input.query,
2958
- p: _serialize_if($scope0_reason, 3) && input.queryChange,
2959
- r: _serialize_if($scope0_reason, 6) && input.settings,
2960
- s: _serialize_if($scope0_reason, 5) && input.settingsChange,
2961
- u: $si__input_selectedId && input.workspaces,
2962
- v: input.selectedId,
2963
- x: input.onReview,
2964
- y: input.onManage,
2965
- z: input.onNewSession,
2966
- a0: input.onNew,
2967
- a1: input.onSelect,
2968
- a3: input.inline,
2969
- a4: _serialize_if($scope0_reason, 8) && input.workspaces?.length,
2970
- a6: input.status,
2971
- a7: input.settings?.agents,
2972
- a8: query,
2973
- aa: settings,
2974
- ac: settings?.preferredAgent,
2975
- ad: settings?.agents,
2976
- ae: hiRaw,
2977
- af: showArchived,
2978
- ag: active,
2979
- ah: archived,
2980
- ai: archived?.length,
2981
- ak: matches,
2982
- al: currentWs,
2983
- an: commands,
2984
- ap: rows$1,
2985
- aq: rows$1.length,
2986
- as: hi,
2987
- au: pick,
2988
- a9: input.queryChange || void 0,
2989
- ab: input.settingsChange || void 0,
2990
- av: $si__input_selectedId && $input_selectedId__closures,
2991
- aw: $si__input_status && $input_status__closures,
2992
- ax: $si__input_settings_agents && $input_settings_agents__closures
2993
- });
2994
- _resume_branch($scope0_id);
2995
- });
2996
- //#endregion
2997
- //#region src/tags/new-workspace.css.ts
2998
- var content$2 = "_V _O";
2999
- var iconBtn$3 = "_Y _y";
3000
- //#endregion
3001
2615
  //#region src/tags/repo-picker.marko
3002
2616
  var api$6;
3003
- var repo_picker_default = _template("q", (input) => {
2617
+ var repo_picker_default = _template("p", (input) => {
3004
2618
  const $scope0_reason = _scope_reason();
3005
2619
  const $scope0_id = _scope_id();
3006
2620
  const $branchFilter__closures = /* @__PURE__ */ new Set();
@@ -3020,7 +2634,7 @@ var repo_picker_default = _template("q", (input) => {
3020
2634
  input.onError?.(String(err.message || err));
3021
2635
  }
3022
2636
  if (refresh);
3023
- }, "q3", $scope0_id);
2637
+ }, "p3", $scope0_id);
3024
2638
  const results = catalog && filter ? rankRepos(filter, catalog.repos, (name) => input.exclude.has(name)) : [];
3025
2639
  let branchesFor = null;
3026
2640
  let branches = null;
@@ -3029,7 +2643,7 @@ var repo_picker_default = _template("q", (input) => {
3029
2643
  filter = "";
3030
2644
  branchesFor = null;
3031
2645
  input.onPick(fullName, baseBranch);
3032
- }, "q4", $scope0_id);
2646
+ }, "p4", $scope0_id);
3033
2647
  const toggleBranches = _resume(async (fullName) => {
3034
2648
  if (branchesFor === fullName) {
3035
2649
  branchesFor = null;
@@ -3045,15 +2659,15 @@ var repo_picker_default = _template("q", (input) => {
3045
2659
  branchesFor = null;
3046
2660
  input.onError?.(String(err.message || err));
3047
2661
  }
3048
- }, "q5", $scope0_id);
3049
- _html(`<div${_attr_class("_bX")}><input${_attr_input_value($scope0_id, "b", filter, _resume(function(v) {
2662
+ }, "p5", $scope0_id);
2663
+ _html(`<div${_attr_class("_bB")}><input${_attr_input_value($scope0_id, "b", filter, _resume(function(v) {
3050
2664
  filter = v;
3051
2665
  highlight = 0;
3052
- }, "q0", $scope0_id))}${_attr_class("_b9")} placeholder="Add a repo…" aria-label="Add a repo"${_attr("disabled", input.disabled)}>${_el_resume($scope0_id, "b")}`);
2666
+ }, "p0", $scope0_id))}${_attr_class("_bN")} placeholder="Add a repo…" aria-label="Add a repo"${_attr("disabled", input.disabled)}>${_el_resume($scope0_id, "b")}`);
3053
2667
  _if(() => {
3054
2668
  if (filter && !catalog) {
3055
2669
  const $scope8_id = _scope_id();
3056
- _html(`<p${_attr_class("_b8")}>Loading repos…</p>`);
2670
+ _html(`<p${_attr_class("_bM")}>Loading repos…</p>`);
3057
2671
  writeScope($scope8_id, {});
3058
2672
  return 0;
3059
2673
  }
@@ -3061,23 +2675,23 @@ var repo_picker_default = _template("q", (input) => {
3061
2675
  _if(() => {
3062
2676
  if (results.length) {
3063
2677
  const $scope2_id = _scope_id();
3064
- _html(`<ul${_attr_class("_bY")}>`);
2678
+ _html(`<ul${_attr_class("_bC")}>`);
3065
2679
  _for_of(results, (repo, i) => {
3066
2680
  const $scope3_id = _scope_id();
3067
- _html(`<li><div${_attr_class(["_b0", { ["_bZ"]: i === highlight }])}><button${_attr_class("_b1")}>`);
2681
+ _html(`<li><div${_attr_class(["_bE", { ["_bD"]: i === highlight }])}><button${_attr_class("_bF")}>`);
3068
2682
  icon_plus_default({
3069
2683
  size: 12,
3070
- class: "_b6"
2684
+ class: "_bK"
3071
2685
  });
3072
- _html(`<span${_attr_class("_b7")}>${_escape(repo.nameWithOwner)}${_el_resume($scope3_id, "e")}</span></button>${_el_resume($scope3_id, "b")}<button${_attr_class(["_b3", { ["_b2"]: branchesFor === repo.nameWithOwner }])}${_attr("title", `Pick a base branch for ${repo.nameWithOwner}`)}${_attr("aria-label", `Pick a base branch for ${repo.nameWithOwner}`)}>⎇</button>${_el_resume($scope3_id, "f")}</div>${_el_resume($scope3_id, "a")}`);
2686
+ _html(`<span${_attr_class("_bL")}>${_escape(repo.nameWithOwner)}${_el_resume($scope3_id, "e")}</span></button>${_el_resume($scope3_id, "b")}<button${_attr_class(["_bH", { ["_bG"]: branchesFor === repo.nameWithOwner }])}${_attr("title", `Pick a base branch for ${repo.nameWithOwner}`)}${_attr("aria-label", `Pick a base branch for ${repo.nameWithOwner}`)}>⎇</button>${_el_resume($scope3_id, "f")}</div>${_el_resume($scope3_id, "a")}`);
3073
2687
  _if(() => {
3074
2688
  if (branchesFor === repo.nameWithOwner) {
3075
2689
  const $scope4_id = _scope_id();
3076
- _html(`<div${_attr_class("_b4")}>`);
2690
+ _html(`<div${_attr_class("_bI")}>`);
3077
2691
  _if(() => {
3078
2692
  if (!branches) {
3079
2693
  const $scope9_id = _scope_id();
3080
- _html(`<p${_attr_class("_b8")}><span${_attr_class("_w")}></span> Loading branches…</p>`);
2694
+ _html(`<p${_attr_class("_bM")}><span${_attr_class("_y")}></span> Loading branches…</p>`);
3081
2695
  writeScope($scope9_id, {});
3082
2696
  return 0;
3083
2697
  } else {
@@ -3087,24 +2701,24 @@ var repo_picker_default = _template("q", (input) => {
3087
2701
  const $scope6_id = _scope_id();
3088
2702
  _html(`<input${_attr_input_value($scope6_id, "a", branchFilter, _resume((_new_branchFilter) => {
3089
2703
  branchFilter = _new_branchFilter;
3090
- }, "q1", $scope6_id))}${_attr_class("_b_")} placeholder="Filter branches…" aria-label="Filter branches" autofocus>${_el_resume($scope6_id, "a")}`);
3091
- _script($scope6_id, "q6");
2704
+ }, "p1", $scope6_id))}${_attr_class("_bO")} placeholder="Filter branches…" aria-label="Filter branches" autofocus>${_el_resume($scope6_id, "a")}`);
2705
+ _script($scope6_id, "p6");
3092
2706
  _subscribe($branchFilter__closures, writeScope($scope6_id, { Ca9: 1 }));
3093
2707
  return 0;
3094
2708
  }
3095
2709
  }, $scope5_id, "a", 1, 1, 1, 0, 1);
3096
2710
  const shown = (branchFilter ? branches.filter((b) => b.toLowerCase().includes(branchFilter.toLowerCase())) : branches).slice(0, 12);
3097
- _html(`<ul${_attr_class("_b5")}>`);
2711
+ _html(`<ul${_attr_class("_bJ")}>`);
3098
2712
  _for_of(shown, (branch) => {
3099
2713
  const $scope7_id = _scope_id();
3100
- _html(`<li><button${_attr_class(["_b1", "_ca"])}><span${_attr_class(["_b7", "_o"])}>${_escape(branch)}${_el_resume($scope7_id, "c")}</span></button>${_el_resume($scope7_id, "a")}</li>`);
3101
- _script($scope7_id, "q7");
2714
+ _html(`<li><button${_attr_class(["_bF", "_bP"])}><span${_attr_class(["_bL", "_q"])}>${_escape(branch)}${_el_resume($scope7_id, "c")}</span></button>${_el_resume($scope7_id, "a")}</li>`);
2715
+ _script($scope7_id, "p7");
3102
2716
  writeScope($scope7_id, { e: branch });
3103
2717
  }, (b) => b, $scope5_id, "c", 1, 1, 1, 0, 1);
3104
2718
  _if(() => {
3105
2719
  if (!shown.length) {
3106
2720
  const $scope10_id = _scope_id();
3107
- _html(`<li><p${_attr_class("_b8")}>No branches match.</p></li>`);
2721
+ _html(`<li><p${_attr_class("_bM")}>No branches match.</p></li>`);
3108
2722
  writeScope($scope10_id, {});
3109
2723
  return 0;
3110
2724
  }
@@ -3119,7 +2733,7 @@ var repo_picker_default = _template("q", (input) => {
3119
2733
  }
3120
2734
  }, $scope3_id, "g", 1, 1, 1, 0, 1);
3121
2735
  _html("</li>");
3122
- _script($scope3_id, "q8");
2736
+ _script($scope3_id, "p8");
3123
2737
  _subscribe($branchesFor__closures, _subscribe($highlight__closures, writeScope($scope3_id, {
3124
2738
  j: repo?.nameWithOwner,
3125
2739
  l: i
@@ -3129,15 +2743,15 @@ var repo_picker_default = _template("q", (input) => {
3129
2743
  return 0;
3130
2744
  } else if (filter && catalog) {
3131
2745
  const $scope1_id = _scope_id();
3132
- _html(`<p${_attr_class("_b8")}>No repos match "<!>${_escape(filter)}${_el_resume($scope1_id, "b")}".</p>`);
2746
+ _html(`<p${_attr_class("_bM")}>No repos match "<!>${_escape(filter)}${_el_resume($scope1_id, "b")}".</p>`);
3133
2747
  writeScope($scope1_id, {});
3134
2748
  return 1;
3135
2749
  }
3136
2750
  }, $scope0_id, "d", 1, 1, 1, 0, 1);
3137
2751
  _html("</div>");
3138
- const $return = _resume(() => loadCatalog(true), "q2", $scope0_id);
3139
- _script($scope0_id, "q9");
3140
- _script($scope0_id, "q10");
2752
+ const $return = _resume(() => loadCatalog(true), "p2", $scope0_id);
2753
+ _script($scope0_id, "p9");
2754
+ _script($scope0_id, "p10");
3141
2755
  writeScope($scope0_id, {
3142
2756
  g: _serialize_if($scope0_reason, 1) && input.refreshing,
3143
2757
  h: _serialize_if($scope0_reason, 0) && input.refreshingChange,
@@ -3181,7 +2795,7 @@ var new_workspace_default = _template("m", (input) => {
3181
2795
  let restoring = null;
3182
2796
  let error = null;
3183
2797
  let steps$1 = [];
3184
- const archived$2 = (input.workspaces || []).filter((ws) => ws.status === "archived").slice().sort((a, b) => b.created_at.localeCompare(a.created_at));
2798
+ const archived$1 = (input.workspaces || []).filter((ws) => ws.status === "archived").slice().sort((a, b) => b.created_at.localeCompare(a.created_at));
3185
2799
  const prog = {
3186
2800
  last: 0,
3187
2801
  op: ""
@@ -3259,7 +2873,7 @@ var new_workspace_default = _template("m", (input) => {
3259
2873
  }
3260
2874
  }, "m5", $scope0_id);
3261
2875
  const titleId = _id();
3262
- _html(`<div${_attr_class("_M")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_N")}><div${_attr_class(content$2)}><header${_attr_class("_Q")}><div${_attr_class("_S")}><h1${_attr("id", titleId)}${_attr_class("_R")}>New workspace</h1><p${_attr_class("_T")}>Name the space and pick repos — or restore an archived one below.</p></div></header>`);
2876
+ _html(`<div${_attr_class("_O")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_P")}><div${_attr_class(content$2)}><header${_attr_class("_S")}><div${_attr_class("_U")}><h1${_attr("id", titleId)}${_attr_class("_T")}>New workspace</h1><p${_attr_class("_V")}>Name the space and pick repos — or restore an archived one below.</p></div></header>`);
3263
2877
  _if(() => {
3264
2878
  if (error) {
3265
2879
  const $scope4_id = _scope_id();
@@ -3280,28 +2894,28 @@ var new_workspace_default = _template("m", (input) => {
3280
2894
  return 0;
3281
2895
  }
3282
2896
  }, $scope0_id, "h", 1, 1, 1, 0, 1);
3283
- _html(`<label${_attr_class("_Z")}><span${_attr_class("_bj")}>Name</span><input${_attr_input_value($scope0_id, "k", name, _resume((_new_name) => {
2897
+ _html(`<label${_attr_class("_1")}><span${_attr_class("_bl")}>Name</span><input${_attr_input_value($scope0_id, "k", name, _resume((_new_name) => {
3284
2898
  name = _new_name;
3285
- }, "m0", $scope0_id))}${_attr_class("_bk")} placeholder=my-feature${_attr("disabled", busy)} autofocus>${_el_resume($scope0_id, "k")}</label><section${_attr_class("_0")}><div${_attr_class("_1")}><h2${_attr_class("_bl")}>Repos</h2><button${_attr_class(iconBtn$3)} title="Refresh repo list" aria-label="Refresh repo list"${_attr("disabled", catalogRefreshing)}>`);
2899
+ }, "m0", $scope0_id))}${_attr_class("_bm")} placeholder=my-feature${_attr("disabled", busy)} autofocus>${_el_resume($scope0_id, "k")}</label><section${_attr_class("_2")}><div${_attr_class("_3")}><h2${_attr_class("_bn")}>Repos</h2><button${_attr_class(iconBtn$3)} title="Refresh repo list" aria-label="Refresh repo list"${_attr("disabled", catalogRefreshing)}>`);
3286
2900
  _set_serialize_reason(1);
3287
2901
  const $childScope = _peek_scope_id();
3288
2902
  icon_refresh_default({
3289
2903
  size: 14,
3290
- class: catalogRefreshing && "_v"
2904
+ class: catalogRefreshing && "_x"
3291
2905
  });
3292
- _html(`</button>${_el_resume($scope0_id, "o")}</div><ul${_attr_class("_2")}>`);
2906
+ _html(`</button>${_el_resume($scope0_id, "o")}</div><ul${_attr_class("_4")}>`);
3293
2907
  _for_of(selected, (repo) => {
3294
2908
  const $scope1_id = _scope_id();
3295
- _html(`<li${_attr_class("_3")}><span${_attr_class("_4")}>${_escape(repo.fullName)}${_el_resume($scope1_id, "c")}</span>`);
2909
+ _html(`<li${_attr_class("_5")}><span${_attr_class("_6")}>${_escape(repo.fullName)}${_el_resume($scope1_id, "c")}</span>`);
3296
2910
  _if(() => {
3297
2911
  if (repo.baseBranch) {
3298
2912
  const $scope8_id = _scope_id();
3299
- _html(`<span${_attr_class(["_5", "_o"])} title="Base branch">⎇ <!>${_escape(repo.baseBranch)}${_el_resume($scope8_id, "b")}</span>`);
2913
+ _html(`<span${_attr_class(["_7", "_q"])} title="Base branch">⎇ <!>${_escape(repo.baseBranch)}${_el_resume($scope8_id, "b")}</span>`);
3300
2914
  writeScope($scope8_id, {});
3301
2915
  return 0;
3302
2916
  }
3303
2917
  }, $scope1_id, "d", 1, 1, 1, 0, 1);
3304
- _html(`<button${_attr_class("_6")}${_attr("title", `Remove ${repo.fullName}`)}${_attr("disabled", busy)}>×</button>${_el_resume($scope1_id, "e")}</li>`);
2918
+ _html(`<button${_attr_class("_8")}${_attr("title", `Remove ${repo.fullName}`)}${_attr("disabled", busy)}>×</button>${_el_resume($scope1_id, "e")}</li>`);
3305
2919
  _script($scope1_id, "m11");
3306
2920
  writeScope($scope1_id, {
3307
2921
  h: repo?.fullName,
@@ -3311,7 +2925,7 @@ var new_workspace_default = _template("m", (input) => {
3311
2925
  _if(() => {
3312
2926
  if (!selected.length) {
3313
2927
  const $scope9_id = _scope_id();
3314
- _html(`<li${_attr_class("_7")}>No repos yet — search below to add one (or create empty).</li>`);
2928
+ _html(`<li${_attr_class("_9")}>No repos yet — search below to add one (or create empty).</li>`);
3315
2929
  writeScope($scope9_id, {});
3316
2930
  return 0;
3317
2931
  }
@@ -3336,19 +2950,19 @@ var new_workspace_default = _template("m", (input) => {
3336
2950
  _if(() => {
3337
2951
  if (busy && steps$1.length) {
3338
2952
  const $scope6_id = _scope_id();
3339
- _html(`<ul${_attr_class("_8")}>`);
2953
+ _html(`<ul${_attr_class("__")}>`);
3340
2954
  _for_of(steps$1, (step$1, i) => {
3341
2955
  const $scope7_id = _scope_id();
3342
- _html(`<li${_attr_class(["_bm", { ["_9"]: i === steps$1.length - 1 }])}>`);
2956
+ _html(`<li${_attr_class(["_bo", { ["_ba"]: i === steps$1.length - 1 }])}>`);
3343
2957
  _if(() => {
3344
2958
  if (i === steps$1.length - 1) {
3345
2959
  const $scope10_id = _scope_id();
3346
- _html(`<span${_attr_class("_w")}></span>`);
2960
+ _html(`<span${_attr_class("_y")}></span>`);
3347
2961
  writeScope($scope10_id, {});
3348
2962
  return 0;
3349
2963
  } else {
3350
2964
  const $scope11_id = _scope_id();
3351
- _html(`<span${_attr_class("__")}>✓</span>`);
2965
+ _html(`<span${_attr_class("_bb")}>✓</span>`);
3352
2966
  writeScope($scope11_id, {});
3353
2967
  return 1;
3354
2968
  }
@@ -3360,23 +2974,23 @@ var new_workspace_default = _template("m", (input) => {
3360
2974
  return 0;
3361
2975
  }
3362
2976
  }, $scope0_id, "v", 1, 1, 1, 0, 1);
3363
- _html(`<div${_attr_class("_W")}><button type=button${_attr_class(["_f", "_bn"])}${_attr("disabled", busy || !!restoring)}>Cancel</button>${_el_resume($scope0_id, "x")}<button type=button${_attr_class([
3364
- "_f",
3365
- "_g",
3366
- "_X",
3367
- "_bn"
2977
+ _html(`<div${_attr_class("_Y")}><button type=button${_attr_class(["_h", "_bp"])}${_attr("disabled", busy || !!restoring)}>Cancel</button>${_el_resume($scope0_id, "x")}<button type=button${_attr_class([
2978
+ "_h",
2979
+ "_i",
2980
+ "_Z",
2981
+ "_bp"
3368
2982
  ])}${_attr("disabled", busy || !!restoring || !name.trim())}>${busy ? "Creating…" : "Create workspace"}${_el_resume($scope0_id, "z")}</button>${_el_resume($scope0_id, "y")}</div>`);
3369
2983
  _if(() => {
3370
- if (archived$2.length) {
2984
+ if (archived$1.length) {
3371
2985
  const $scope2_id = _scope_id();
3372
- _html(`<section${_attr_class("_ba")}><div${_attr_class("_1")}><h2${_attr_class("_bl")}>Archived</h2><span${_attr_class("_bb")}>${_escape(archived$2.length)}${_el_resume($scope2_id, "e", $sg__input_workspaces)}</span></div><p${_attr_class("_bc")}>Restore a parked space instead of creating a new one.</p><ul${_attr_class("_bd")}>`);
3373
- _for_of(archived$2, (ws) => {
2986
+ _html(`<section${_attr_class("_bc")}><div${_attr_class("_3")}><h2${_attr_class("_bn")}>Archived</h2><span${_attr_class("_bd")}>${_escape(archived$1.length)}${_el_resume($scope2_id, "e", $sg__input_workspaces)}</span></div><p${_attr_class("_be")}>Restore a parked space instead of creating a new one.</p><ul${_attr_class("_bf")}>`);
2987
+ _for_of(archived$1, (ws) => {
3374
2988
  const $scope3_id = _scope_id();
3375
- _html(`<li${_attr_class("_be")}><div${_attr_class("_bf")}><span${_attr_class("_bg")}>${_escape(ws.name)}${_el_resume($scope3_id, "d", $sg__input_workspaces)}</span><span${_attr_class(["_bh", "_o"])}${_attr("title", ws.display_path || ws.path)}>${_escape(ws.display_path || ws.path)}${_el_resume($scope3_id, "f", $sg__input_workspaces)}</span>${_el_resume($scope3_id, "e", $sg__input_workspaces)}</div><button type=button${_attr_class(["_f", "_bi"])}${_attr("disabled", busy || !!restoring)}>`);
2989
+ _html(`<li${_attr_class("_bg")}><div${_attr_class("_bh")}><span${_attr_class("_bi")}>${_escape(ws.name)}${_el_resume($scope3_id, "d", $sg__input_workspaces)}</span><span${_attr_class(["_bj", "_q"])}${_attr("title", ws.display_path || ws.path)}>${_escape(ws.display_path || ws.path)}${_el_resume($scope3_id, "f", $sg__input_workspaces)}</span>${_el_resume($scope3_id, "e", $sg__input_workspaces)}</div><button type=button${_attr_class(["_h", "_bk"])}${_attr("disabled", busy || !!restoring)}>`);
3376
2990
  _if(() => {
3377
2991
  if (restoring === ws.id) {
3378
2992
  const $scope12_id = _scope_id();
3379
- _html(`<span${_attr_class("_w")}></span> Restoring…`);
2993
+ _html(`<span${_attr_class("_y")}></span> Restoring…`);
3380
2994
  writeScope($scope12_id, {});
3381
2995
  return 0;
3382
2996
  } else {
@@ -3413,8 +3027,8 @@ var new_workspace_default = _template("m", (input) => {
3413
3027
  ag: error,
3414
3028
  ah: steps$1,
3415
3029
  ai: steps$1?.length,
3416
- ak: $si__input_workspaces && archived$2,
3417
- al: $si__input_workspaces && archived$2?.length,
3030
+ ak: $si__input_workspaces && archived$1,
3031
+ al: $si__input_workspaces && archived$1?.length,
3418
3032
  an: prog.op,
3419
3033
  ao: prog.last,
3420
3034
  aq: takeProgress,
@@ -3494,9 +3108,38 @@ function vapidKey(base64) {
3494
3108
  const raw = atob(padded.replace(/-/g, "+").replace(/_/g, "/"));
3495
3109
  return Uint8Array.from(raw, (c) => c.charCodeAt(0));
3496
3110
  }
3497
- var iconBtn$2 = "_cD _y";
3498
- var navToggle = "_cH _y";
3499
- _template("C", (input) => {
3111
+ //#endregion
3112
+ //#region src/client/status.ts
3113
+ /** Workspace activity dot from its polled status counts. */
3114
+ function phaseOf(status) {
3115
+ return status?.working ? "working" : status?.waiting ? "waiting" : status?.agents ? "idle" : "off";
3116
+ }
3117
+ /** Session activity dot from its own state. */
3118
+ function sessionPhase(state) {
3119
+ return state?.phase === "working" ? "working" : state?.phase === "waiting" ? "waiting" : state?.alive ? "idle" : "off";
3120
+ }
3121
+ /** Binary each session kind launches, inverted — `sessions.ts` COMMANDS. */
3122
+ var AGENT_BY_COMMAND = {
3123
+ claude: "claude",
3124
+ codex: "codex",
3125
+ grok: "grok",
3126
+ copilot: "copilot",
3127
+ "cursor-agent": "cursor"
3128
+ };
3129
+ /**
3130
+ * What a session is *running*, which is not always what it was started as: a
3131
+ * shell someone typed `claude` into is a claude session as far as the reader
3132
+ * is concerned. Only shells are reinterpreted — an agent kind stays itself
3133
+ * even while it shells out, so the icon doesn't flicker mid-command.
3134
+ */
3135
+ function activeAgent(session) {
3136
+ if (session.agent !== "shell") return session.agent;
3137
+ const command = session.state?.command?.trim();
3138
+ return command && AGENT_BY_COMMAND[command] || session.agent;
3139
+ }
3140
+ var iconBtn$2 = "_cR _A";
3141
+ var navToggle = "_cV _A";
3142
+ _template("B", (input) => {
3500
3143
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
3501
3144
  const $scope0_id = _scope_id();
3502
3145
  _set_serialize_reason({
@@ -3513,7 +3156,7 @@ _template("C", (input) => {
3513
3156
  });
3514
3157
  //#endregion
3515
3158
  //#region src/tags/icons/icon-gauge.marko
3516
- var icon_gauge_default = _template("J", (input) => {
3159
+ var icon_gauge_default = _template("I", (input) => {
3517
3160
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
3518
3161
  const $scope0_id = _scope_id();
3519
3162
  _set_serialize_reason({
@@ -3528,10 +3171,90 @@ var icon_gauge_default = _template("J", (input) => {
3528
3171
  });
3529
3172
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
3530
3173
  });
3531
- var railBtn = "_fz _y";
3174
+ var railBtn = "_eU _A";
3175
+ //#endregion
3176
+ //#region src/tags/icons/icon-agent.marko
3177
+ var PATHS = {
3178
+ claude: "M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z",
3179
+ codex: "M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z",
3180
+ grok: "M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815",
3181
+ copilot: "M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z",
3182
+ cursor: "M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"
3183
+ };
3184
+ var icon_agent_default = _template("y", (input) => {
3185
+ const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0), $si__input_size__OR__input_class = _serialize_if($scope0_reason, 0), $si__input_size__OR__input_agent__OR__input_class = _serialize_if($scope0_reason, 1), $sg__input_agent = _serialize_guard($scope0_reason, 2);
3186
+ const $scope0_id = _scope_id();
3187
+ const size = input.size ?? 15;
3188
+ const d = PATHS[input.agent];
3189
+ _if(() => {
3190
+ if (d) {
3191
+ const $scope1_id = _scope_id();
3192
+ _html(`<svg${_attr_class(["_d", input.class])}${_attr("width", size)}${_attr("height", size)} viewBox="0 0 24 24" fill=currentColor fill-rule=evenodd aria-hidden=true><path${_attr("d", d)}></path>${_el_resume($scope1_id, "b", $sg__input_agent)}</svg>${_el_resume($scope1_id, "a", $sg__input_size__OR__input_class)}`);
3193
+ $si__input_size__OR__input_agent__OR__input_class && writeScope($scope1_id, { _: _scope_with_id($scope0_id) });
3194
+ return 0;
3195
+ } else {
3196
+ const $scope2_id = _scope_id();
3197
+ _set_serialize_reason({
3198
+ 0: $sg__input_size__OR__input_class,
3199
+ 1: $sg__input_size__OR__input_class
3200
+ });
3201
+ const $childScope = _peek_scope_id();
3202
+ icon_base_default({
3203
+ d: "M5 7L10 12L5 17 M13 17H20",
3204
+ size: input.size,
3205
+ class: input.class
3206
+ });
3207
+ $si__input_size__OR__input_agent__OR__input_class && writeScope($scope2_id, {
3208
+ _: $si__input_size__OR__input_class && _scope_with_id($scope0_id),
3209
+ a: $si__input_size__OR__input_class && _existing_scope($childScope)
3210
+ });
3211
+ return 1;
3212
+ }
3213
+ }, $scope0_id, "a", _serialize_guard($scope0_reason, 1), $sg__input_agent, $sg__input_agent, 0, 1);
3214
+ _serialize_if($scope0_reason, 2) && writeScope($scope0_id, {
3215
+ d: input.size,
3216
+ f: input.class,
3217
+ g: size,
3218
+ h: d
3219
+ });
3220
+ });
3221
+ //#endregion
3222
+ //#region src/tags/icons/icon-diff.marko
3223
+ var icon_diff_default = _template("E", (input) => {
3224
+ const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
3225
+ const $scope0_id = _scope_id();
3226
+ _set_serialize_reason({
3227
+ 0: $sg__input_size__OR__input_class,
3228
+ 1: $sg__input_size__OR__input_class
3229
+ });
3230
+ const $childScope = _peek_scope_id();
3231
+ icon_base_default({
3232
+ d: "M18 21C19.1046 21 20 20.1046 20 19C20 17.8954 19.1046 17 18 17C16.8954 17 16 17.8954 16 19C16 20.1046 16.8954 21 18 21Z M6 7C7.10457 7 8 6.10457 8 5C8 3.89543 7.10457 3 6 3C4.89543 3 4 3.89543 4 5C4 6.10457 4.89543 7 6 7Z M18 17V7C18 7 18 5 16 5H13 M6 7V17C6 17 6 19 8 19H11 M15.0005 7.50012L12.5005 5.00012L15.0005 2.50012 M8.5 16.5L11 19L8.5 21.5",
3233
+ size: input.size,
3234
+ class: input.class
3235
+ });
3236
+ _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
3237
+ });
3238
+ //#endregion
3239
+ //#region src/tags/icons/icon-manage.marko
3240
+ var icon_manage_default = _template("L", (input) => {
3241
+ const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
3242
+ const $scope0_id = _scope_id();
3243
+ _set_serialize_reason({
3244
+ 0: $sg__input_size__OR__input_class,
3245
+ 1: $sg__input_size__OR__input_class
3246
+ });
3247
+ const $childScope = _peek_scope_id();
3248
+ icon_base_default({
3249
+ d: "M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z M19.6224 10.3954L18.5247 7.7448L20 6L18 4L16.2647 5.48295L13.5578 4.36974L12.9353 2H10.981L10.3491 4.40113L7.70441 5.51596L6 4L4 6L5.45337 7.78885L4.3725 10.4463L2 11V13L4.40111 13.6555L5.51575 16.2997L4 18L6 20L7.79116 18.5403L10.397 19.6123L11 22H13L13.6045 19.6132L16.2551 18.5155C16.6969 18.8313 18 20 18 20L20 18L18.5159 16.2494L19.6139 13.598L21.9999 12.9772L22 11L19.6224 10.3954Z",
3250
+ size: input.size,
3251
+ class: input.class
3252
+ });
3253
+ _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
3254
+ });
3532
3255
  //#endregion
3533
3256
  //#region src/tags/icons/icon-edit.marko
3534
- var icon_edit_default = _template("H", (input) => {
3257
+ var icon_edit_default = _template("G", (input) => {
3535
3258
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
3536
3259
  const $scope0_id = _scope_id();
3537
3260
  _set_serialize_reason({
@@ -3546,16 +3269,16 @@ var icon_edit_default = _template("H", (input) => {
3546
3269
  });
3547
3270
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
3548
3271
  });
3549
- var prChip = "_fZ _j _fY";
3550
- var portChip = "_f0 _j _fY";
3272
+ var prChip = "_fA _l _fz";
3273
+ var portChip = "_fB _l _fz";
3551
3274
  var prState = {
3552
- open: "_f5",
3553
- merged: "_f6",
3554
- closed: "_f7"
3275
+ open: "_fG",
3276
+ merged: "_fH",
3277
+ closed: "_fI"
3555
3278
  };
3556
3279
  //#endregion
3557
3280
  //#region src/tags/icons/icon-xmark.marko
3558
- var icon_xmark_default = _template("U", (input) => {
3281
+ var icon_xmark_default = _template("T", (input) => {
3559
3282
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
3560
3283
  const $scope0_id = _scope_id();
3561
3284
  _set_serialize_reason({
@@ -3581,7 +3304,7 @@ var prTitle = (repo, pr) => {
3581
3304
  return parts.join(" · ");
3582
3305
  };
3583
3306
  var isOpen = (pr) => !pr.state || pr.state === "OPEN";
3584
- var side_nav_chips_default = _template("r", (input) => {
3307
+ var side_nav_chips_default = _template("q", (input) => {
3585
3308
  const $scope0_reason = _scope_reason(), $sg__input_status_repos = _serialize_guard($scope0_reason, 1), $si__input_status_repos = _serialize_if($scope0_reason, 1), $sg__input_status_ports = _serialize_guard($scope0_reason, 2), $sg__input_status_repos__OR__input_status_ports = _serialize_guard($scope0_reason, 0), $si__input_status_repos__OR__input_status_ports = _serialize_if($scope0_reason, 0);
3586
3309
  const $scope0_id = _scope_id();
3587
3310
  const $armedPid__closures = /* @__PURE__ */ new Set();
@@ -3593,7 +3316,7 @@ var side_nav_chips_default = _template("r", (input) => {
3593
3316
  armBox.timer = setTimeout(() => {
3594
3317
  armedPid = null;
3595
3318
  }, 3500);
3596
- }, "r0", $scope0_id);
3319
+ }, "q0", $scope0_id);
3597
3320
  const dismissPr = _resume((fullName, number) => {
3598
3321
  fetch(`/api/workspaces/${input.workspaceId}/prs`, {
3599
3322
  method: "POST",
@@ -3603,7 +3326,7 @@ var side_nav_chips_default = _template("r", (input) => {
3603
3326
  number
3604
3327
  })
3605
3328
  }).catch(() => {});
3606
- }, "r1", $scope0_id);
3329
+ }, "q1", $scope0_id);
3607
3330
  const repos = input.status?.repos || [];
3608
3331
  const ports = input.status?.ports || [];
3609
3332
  _if(() => {
@@ -3614,42 +3337,42 @@ var side_nav_chips_default = _template("r", (input) => {
3614
3337
  if (repos.length < 2) return "";
3615
3338
  const name = repo.full_name.split("/")[1];
3616
3339
  return repos.some((r) => r.full_name !== repo.full_name && r.full_name.split("/")[1] === name) ? repo.full_name : name;
3617
- }, "r2", $scope1_id);
3618
- _html(`<div${_attr_class("_fX")}>`);
3340
+ }, "q2", $scope1_id);
3341
+ _html(`<div${_attr_class("_fy")}>`);
3619
3342
  _for_of(repos, (repo) => {
3620
3343
  const $scope2_id = _scope_id();
3621
3344
  _for_of(repo.prs || [], (pr) => {
3622
3345
  const $scope3_id = _scope_id();
3623
3346
  const open = isOpen(pr);
3624
3347
  _html(`<span${_attr_class([
3625
- "_j",
3348
+ "_l",
3626
3349
  prChip,
3627
3350
  {
3628
- ["_l"]: open && !pr.isDraft,
3629
- ["_m"]: open && pr.isDraft,
3351
+ ["_n"]: open && !pr.isDraft,
3352
+ ["_o"]: open && pr.isDraft,
3630
3353
  [prState.merged]: pr.state === "MERGED",
3631
3354
  [prState.closed]: pr.state === "CLOSED"
3632
3355
  }
3633
- ])}${_attr("title", prTitle(repo, pr))}><a${_attr_class(["_f1", { ["_f9"]: !open }])}${_attr("href", pr.url)} target=_blank rel=noopener>${_escape(repoLabel(repo))}${_el_resume($scope3_id, "c", $sg__input_status_repos)}#${_sep($sg__input_status_repos)}${_escape(pr.number)}${_el_resume($scope3_id, "d", $sg__input_status_repos)}</a>${_el_resume($scope3_id, "b", $sg__input_status_repos)}`);
3356
+ ])}${_attr("title", prTitle(repo, pr))}><a${_attr_class(["_fC", { ["_fK"]: !open }])}${_attr("href", pr.url)} target=_blank rel=noopener>${_escape(repoLabel(repo))}${_el_resume($scope3_id, "c", $sg__input_status_repos)}#${_sep($sg__input_status_repos)}${_escape(pr.number)}${_el_resume($scope3_id, "d", $sg__input_status_repos)}</a>${_el_resume($scope3_id, "b", $sg__input_status_repos)}`);
3634
3357
  _if(() => {
3635
3358
  if (open) {
3636
3359
  const $scope4_id = _scope_id();
3637
- _html(`<button type=button${_attr_class(["_f1", "_f2"])}${_attr("title", `Review #${pr.number} diff`)}>`);
3360
+ _html(`<button type=button${_attr_class(["_fC", "_fD"])}${_attr("title", `Review #${pr.number} diff`)}>`);
3638
3361
  icon_diff_default({ size: 12 });
3639
3362
  _html(`</button>${_el_resume($scope4_id, "a")}`);
3640
- _script($scope4_id, "r3");
3363
+ _script($scope4_id, "q3");
3641
3364
  writeScope($scope4_id, { _: _scope_with_id($scope3_id) });
3642
3365
  return 0;
3643
3366
  } else {
3644
3367
  const $scope6_id = _scope_id();
3645
3368
  _html(`<button type=button${_attr_class([
3646
- "_f1",
3647
- "_f2",
3648
- "_f3"
3369
+ "_fC",
3370
+ "_fD",
3371
+ "_fE"
3649
3372
  ])}${_attr("title", `Clear #${pr.number} from this list`)}>`);
3650
3373
  icon_xmark_default({ size: 12 });
3651
3374
  _html(`</button>${_el_resume($scope6_id, "a")}`);
3652
- _script($scope6_id, "r4");
3375
+ _script($scope6_id, "q4");
3653
3376
  writeScope($scope6_id, { _: _scope_with_id($scope3_id) });
3654
3377
  return 1;
3655
3378
  }
@@ -3669,15 +3392,15 @@ var side_nav_chips_default = _template("r", (input) => {
3669
3392
  }, "full_name", $scope1_id, "b", $sg__input_status_repos, $sg__input_status_repos, $sg__input_status_repos__OR__input_status_ports);
3670
3393
  _for_of(ports, (p) => {
3671
3394
  const $scope5_id = _scope_id();
3672
- _html(`<span${_attr_class(["_j", portChip])}${_attr("title", p.cmd)}><button type=button${_attr_class(["_f1", "_f8"])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${p.port}`)}>:${_sep($sg__input_status_ports)}${_escape(p.port)}${_el_resume($scope5_id, "c", $sg__input_status_ports)}</button>${_el_resume($scope5_id, "b")}<button type=button${_attr_class([
3673
- "_f1",
3674
- "_f2",
3675
- "_f3",
3676
- { ["_f4"]: armedPid === p.pid }
3395
+ _html(`<span${_attr_class(["_l", portChip])}${_attr("title", p.cmd)}><button type=button${_attr_class(["_fC", "_fJ"])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${p.port}`)}>:${_sep($sg__input_status_ports)}${_escape(p.port)}${_el_resume($scope5_id, "c", $sg__input_status_ports)}</button>${_el_resume($scope5_id, "b")}<button type=button${_attr_class([
3396
+ "_fC",
3397
+ "_fD",
3398
+ "_fE",
3399
+ { ["_fF"]: armedPid === p.pid }
3677
3400
  ])}${armedPid === p.pid ? _attr("title", `Really kill ${p.cmd}?`) : _attr("title", `Kill ${p.cmd} (pid ${p.pid})`)}>`);
3678
3401
  icon_xmark_default({ size: 12 });
3679
3402
  _html(`</button>${_el_resume($scope5_id, "d")}</span>${_el_resume($scope5_id, "a", $sg__input_status_ports)}`);
3680
- _script($scope5_id, "r5");
3403
+ _script($scope5_id, "q5");
3681
3404
  _subscribe($armedPid__closures, writeScope($scope5_id, {
3682
3405
  h: p?.cmd,
3683
3406
  i: p?.port,
@@ -3710,7 +3433,7 @@ var side_nav_chips_default = _template("r", (input) => {
3710
3433
  });
3711
3434
  //#endregion
3712
3435
  //#region src/tags/side-nav-item.marko
3713
- var side_nav_item_default = _template("s", (input) => {
3436
+ var side_nav_item_default = _template("r", (input) => {
3714
3437
  const $scope0_reason = _scope_reason(), $sg__input_workspaceId__OR__input_status = _serialize_guard($scope0_reason, 1), $sg__input_sessions = _serialize_guard($scope0_reason, 18), $sg__input_workspaceId__OR__input_status__OR__input_sessions__OR__input_page = _serialize_guard($scope0_reason, 10), $si__input_current = _serialize_if($scope0_reason, 16), $sg__input_page = _serialize_guard($scope0_reason, 20), $si__input_agents = _serialize_if($scope0_reason, 22), $sg__input_onNewSession = _serialize_guard($scope0_reason, 21), $sg__input_onNewSession__OR__input_onReview = _serialize_guard($scope0_reason, 2), $sg__input_onReview = _serialize_guard($scope0_reason, 23), $si__input_sessions = _serialize_if($scope0_reason, 18), $si__input_workspaces__OR__input_workspaceId = _serialize_if($scope0_reason, 0), $si__input_workspaceId__OR__input_status = _serialize_if($scope0_reason, 1), $si__input_workspaceId__OR__input_status__OR__input_sessions__OR__input_page = _serialize_if($scope0_reason, 10), $sg__input_rail = _serialize_guard($scope0_reason, 15), $si__input_rail = _serialize_if($scope0_reason, 15), $sg__input_workspaces__OR__input_workspaceId = _serialize_guard($scope0_reason, 0), $si__input_workspaceId = _serialize_if($scope0_reason, 14), $si__input_workspaces__OR__input_workspaceId__OR__input_rail = _serialize_if($scope0_reason, 3), $si__input_workspaces__OR__input_workspaceId__OR__input_rail__OR__input_current__OR__input_page = _serialize_if($scope0_reason, 11), $si__input_index = _serialize_if($scope0_reason, 17), $si__input_onNewSession = _serialize_if($scope0_reason, 21), $si__input_onReview = _serialize_if($scope0_reason, 23), $si__input_managing = _serialize_if($scope0_reason, 24), $si__input_currentTab = _serialize_if($scope0_reason, 25), $si__input_railPop = _serialize_if($scope0_reason, 19), $si__input_page = _serialize_if($scope0_reason, 20), $si__input_onReviewPr = _serialize_if($scope0_reason, 26);
3715
3438
  const $scope0_id = _scope_id();
3716
3439
  const $input_current__closures = /* @__PURE__ */ new Set();
@@ -3737,7 +3460,7 @@ var side_nav_item_default = _template("s", (input) => {
3737
3460
  armBox.timer = setTimeout(() => {
3738
3461
  armedKill = null;
3739
3462
  }, 3500);
3740
- }, "s1", $scope0_id);
3463
+ }, "r1", $scope0_id);
3741
3464
  let renamingId = null;
3742
3465
  let renameValue = "";
3743
3466
  const commitRename = _resume((s) => {
@@ -3745,7 +3468,7 @@ var side_nav_item_default = _template("s", (input) => {
3745
3468
  const title = renameValue.trim();
3746
3469
  renamingId = null;
3747
3470
  if (title) input.onRenameSession?.(s, title);
3748
- }, "s2", $scope0_id);
3471
+ }, "r2", $scope0_id);
3749
3472
  const ws$1 = input.workspaces.find((w) => w.id === input.workspaceId);
3750
3473
  _if(() => {
3751
3474
  if (ws$1) {
@@ -3755,26 +3478,26 @@ var side_nav_item_default = _template("s", (input) => {
3755
3478
  _if(() => {
3756
3479
  if (input.rail) {
3757
3480
  const $scope2_id = _scope_id();
3758
- _html(`<button${_attr_class([railBtn, { ["_fw"]: input.current }])}${_attr("title", ws$1.name)}>${_escape((input.index ?? 0) + 1)}${_el_resume($scope2_id, "b", _serialize_guard($scope0_reason, 17))}<span${_attr_class([
3759
- "_q",
3481
+ _html(`<button${_attr_class([railBtn, { ["_eR"]: input.current }])}${_attr("title", ws$1.name)}>${_escape((input.index ?? 0) + 1)}${_el_resume($scope2_id, "b", _serialize_guard($scope0_reason, 17))}<span${_attr_class([
3482
+ "_s",
3760
3483
  phase[dot],
3761
- "_fA"
3484
+ "_eV"
3762
3485
  ])}></span>${_el_resume($scope2_id, "c", $sg__input_workspaceId__OR__input_status)}</button>${_el_resume($scope2_id, "a")}`);
3763
- _script($scope2_id, "s3");
3486
+ _script($scope2_id, "r3");
3764
3487
  _subscribe($si__input_workspaces__OR__input_workspaceId && $ws_name__closures, _subscribe($si__input_index && $input_index__closures, _subscribe($si__input_current && $input_current__closures, writeScope($scope2_id, { _: _scope_with_id($scope1_id) }))));
3765
3488
  return 0;
3766
3489
  } else {
3767
3490
  const $scope3_id = _scope_id();
3768
3491
  const sessions$1 = input.sessions || [];
3769
3492
  const phaseLabel = dot === "working" ? "Working" : dot === "waiting" ? "Needs you" : dot === "idle" ? "Idle" : "Off";
3770
- _html(`<section${_attr_class(["_fC", {
3771
- ["_fw"]: input.current,
3772
- ["_fD"]: input.railPop,
3773
- ["_fB"]: input.page
3774
- }])}><div${_attr_class("_fE")}><button${_attr_class("_fF")}><span${_attr_class([
3775
- "_q",
3493
+ _html(`<section${_attr_class(["_eX", {
3494
+ ["_eR"]: input.current,
3495
+ ["_eY"]: input.railPop,
3496
+ ["_eW"]: input.page
3497
+ }])}><div${_attr_class("_eZ")}><button${_attr_class("_e0")}><span${_attr_class([
3498
+ "_s",
3776
3499
  phase[dot],
3777
- "_fP"
3500
+ "_e_"
3778
3501
  ])}></span>${_el_resume($scope3_id, "d", $sg__input_workspaceId__OR__input_status)}`);
3779
3502
  _if(() => {
3780
3503
  if (sessions$1.length === 1) {
@@ -3787,7 +3510,7 @@ var side_nav_item_default = _template("s", (input) => {
3787
3510
  icon_agent_default({
3788
3511
  agent: activeAgent(sessions$1[0]),
3789
3512
  size: 12,
3790
- class: "_fK"
3513
+ class: "_e5"
3791
3514
  });
3792
3515
  $si__input_sessions && writeScope($scope12_id, {
3793
3516
  _: _scope_with_id($scope3_id),
@@ -3797,11 +3520,11 @@ var side_nav_item_default = _template("s", (input) => {
3797
3520
  }
3798
3521
  }, $scope3_id, "e", $sg__input_sessions, $sg__input_sessions, $sg__input_workspaceId__OR__input_status__OR__input_sessions__OR__input_page);
3799
3522
  const metaText = sessions$1.length === 0 ? phaseLabel : sessions$1.length === 1 ? sessions$1[0].title || "" : `${sessions$1.length} sessions`;
3800
- _html(`<span${_attr_class("_fL")}><span${_attr_class("_fM")}>${_escape(ws$1.name)}${_el_resume($scope3_id, "h", $sg__input_workspaces__OR__input_workspaceId)}</span>`);
3523
+ _html(`<span${_attr_class("_e6")}><span${_attr_class("_e7")}>${_escape(ws$1.name)}${_el_resume($scope3_id, "h", $sg__input_workspaces__OR__input_workspaceId)}</span>`);
3801
3524
  _if(() => {
3802
3525
  if (input.page && metaText) {
3803
3526
  const $scope13_id = _scope_id();
3804
- _html(`<span${_attr_class("_fN")}>${_escape(metaText)}${_el_resume($scope13_id, "b", _serialize_guard($scope0_reason, 5))}</span>`);
3527
+ _html(`<span${_attr_class("_e8")}>${_escape(metaText)}${_el_resume($scope13_id, "b", _serialize_guard($scope0_reason, 5))}</span>`);
3805
3528
  $si__input_workspaceId__OR__input_status__OR__input_sessions__OR__input_page && writeScope($scope13_id, { _: _serialize_if($scope0_reason, 5) && _scope_with_id($scope3_id) });
3806
3529
  return 0;
3807
3530
  }
@@ -3810,7 +3533,7 @@ var side_nav_item_default = _template("s", (input) => {
3810
3533
  _if(() => {
3811
3534
  if (input.page) {
3812
3535
  const $scope4_id = _scope_id();
3813
- _html(`<span${_attr_class("_fO")}>${input.current ? "Open" : ""}${_el_resume($scope4_id, "b", _serialize_guard($scope0_reason, 16))}</span>`);
3536
+ _html(`<span${_attr_class("_e9")}>${input.current ? "Open" : ""}${_el_resume($scope4_id, "b", _serialize_guard($scope0_reason, 16))}</span>`);
3814
3537
  $si__input_workspaces__OR__input_workspaceId__OR__input_rail__OR__input_current__OR__input_page && _subscribe($si__input_current && $input_current__closures, writeScope($scope4_id, {
3815
3538
  _: _scope_with_id($scope3_id),
3816
3539
  Cab: $si__input_current && 2
@@ -3822,21 +3545,21 @@ var side_nav_item_default = _template("s", (input) => {
3822
3545
  _if(() => {
3823
3546
  if (!input.page) {
3824
3547
  const $scope5_id = _scope_id();
3825
- _html(`<div${_attr_class("_fG")}>`);
3548
+ _html(`<div${_attr_class("_e1")}>`);
3826
3549
  _if(() => {
3827
3550
  if (input.onNewSession) {
3828
3551
  const $scope6_id = _scope_id();
3829
3552
  const newPopId = _id();
3830
3553
  let pickerReady = false;
3831
- _html(`<button${_attr_class("_fI")} title="New session"${_attr("popovertarget", newPopId)}>`);
3554
+ _html(`<button${_attr_class("_e3")} title="New session"${_attr("popovertarget", newPopId)}>`);
3832
3555
  icon_agent_default({
3833
3556
  agent: "shell",
3834
3557
  size: 12
3835
3558
  });
3836
- _html(`</button>${_el_resume($scope6_id, "a")}<div${_attr("id", newPopId)} popover=auto${_attr_class("_bM")}>`);
3559
+ _html(`</button>${_el_resume($scope6_id, "a")}<div${_attr("id", newPopId)} popover=auto${_attr_class("_eP")}>`);
3837
3560
  _for_of([], (agent) => {
3838
3561
  const $scope7_id = _scope_id();
3839
- _html(`<button${_attr_class("_bN")}>`);
3562
+ _html(`<button${_attr_class("_eQ")}>`);
3840
3563
  _set_serialize_reason(12);
3841
3564
  const $childScope2 = _peek_scope_id();
3842
3565
  icon_agent_default({
@@ -3844,13 +3567,13 @@ var side_nav_item_default = _template("s", (input) => {
3844
3567
  size: 14
3845
3568
  });
3846
3569
  _html(`<!>${_escape(agent)}${_el_resume($scope7_id, "c")}</button>${_el_resume($scope7_id, "a")}`);
3847
- _script($scope7_id, "s4");
3570
+ _script($scope7_id, "r4");
3848
3571
  writeScope($scope7_id, {
3849
3572
  e: agent,
3850
3573
  b: _existing_scope($childScope2)
3851
3574
  });
3852
3575
  }, (a) => a, $scope6_id, "c", 1, 1, 1, "</div>", 1);
3853
- _script($scope6_id, "s5");
3576
+ _script($scope6_id, "r5");
3854
3577
  _subscribe($si__input_agents && $input_agents__closures, writeScope($scope6_id, {
3855
3578
  e: $si__input_agents && pickerReady,
3856
3579
  _: _scope_with_id($scope5_id)
@@ -3861,33 +3584,33 @@ var side_nav_item_default = _template("s", (input) => {
3861
3584
  _if(() => {
3862
3585
  if (input.onReview) {
3863
3586
  const $scope8_id = _scope_id();
3864
- _html(`<button${_attr_class("_fI")} title="Review changes">`);
3587
+ _html(`<button${_attr_class("_e3")} title="Review changes">`);
3865
3588
  icon_diff_default({ size: 12 });
3866
3589
  _html(`</button>${_el_resume($scope8_id, "a")}`);
3867
- _script($scope8_id, "s6");
3590
+ _script($scope8_id, "r6");
3868
3591
  writeScope($scope8_id, { _: _scope_with_id($scope5_id) });
3869
3592
  return 0;
3870
3593
  }
3871
3594
  }, $scope5_id, "c", $sg__input_onReview, $sg__input_onReview, $sg__input_onNewSession__OR__input_onReview, 0, 1);
3872
- _html(`<button${_attr_class(["_fI", { ["_fx"]: input.managing }])} title="Manage workspace" aria-pressed=${input.managing ? "true" : "false"}>`);
3595
+ _html(`<button${_attr_class(["_e3", { ["_eS"]: input.managing }])} title="Manage workspace" aria-pressed=${input.managing ? "true" : "false"}>`);
3873
3596
  icon_manage_default({ size: 12 });
3874
3597
  _html(`</button>${_el_resume($scope5_id, "d")}</div>`);
3875
- _script($scope5_id, "s7");
3598
+ _script($scope5_id, "r7");
3876
3599
  _subscribe($si__input_managing && $input_managing__closures, _subscribe($si__input_onReview && $input_onReview__closures, _subscribe($si__input_onNewSession && $input_onNewSession__closures, writeScope($scope5_id, { _: _scope_with_id($scope3_id) }))));
3877
3600
  return 0;
3878
3601
  }
3879
3602
  }, $scope3_id, "k", $sg__input_page, $sg__input_page, $sg__input_workspaceId__OR__input_status__OR__input_sessions__OR__input_page, 0, 1);
3880
- _html(`</div><div${_attr_class("_fU")}>`);
3603
+ _html(`</div><div${_attr_class("_fe")}>`);
3881
3604
  _for_of(sessions$1.length > 1 ? sessions$1 : [], (s) => {
3882
3605
  const $scope9_id = _scope_id();
3883
- _html(`<div${_attr_class(["_fH", { ["_fw"]: s.id === input.currentTab }])}>`);
3606
+ _html(`<div${_attr_class(["_e2", { ["_eR"]: s.id === input.currentTab }])}>`);
3884
3607
  _if(() => {
3885
3608
  if (renamingId === s.id) {
3886
3609
  const $scope11_id = _scope_id();
3887
3610
  _html(`<span${_attr_class([
3888
- "_q",
3611
+ "_s",
3889
3612
  phase[sessionPhase(s.state)],
3890
- "_fS"
3613
+ "_fc"
3891
3614
  ])}></span>${_el_resume($scope11_id, "a", $sg__input_sessions)}`);
3892
3615
  _set_serialize_reason({
3893
3616
  1: $sg__input_sessions,
@@ -3897,17 +3620,17 @@ var side_nav_item_default = _template("s", (input) => {
3897
3620
  icon_agent_default({
3898
3621
  agent: activeAgent(s),
3899
3622
  size: 13,
3900
- class: "_fW"
3623
+ class: "_fg"
3901
3624
  });
3902
3625
  _html(`<input${_attr_input_value($scope11_id, "c", renameValue, _resume((_new_renameValue) => {
3903
3626
  renameValue = _new_renameValue;
3904
- }, "s0", $scope11_id))}${_attr_class("_fT")} aria-label="Session name">${_el_resume($scope11_id, "c")}`);
3905
- _script($scope11_id, "s8");
3627
+ }, "r0", $scope11_id))}${_attr_class("_fd")} aria-label="Session name">${_el_resume($scope11_id, "c")}`);
3628
+ _script($scope11_id, "r8");
3906
3629
  _subscribe($renameValue__closures, writeScope($scope11_id, { b: $si__input_sessions && _existing_scope($childScope3) }));
3907
3630
  return 0;
3908
3631
  } else {
3909
3632
  const $scope10_id = _scope_id();
3910
- _html(`<button${_attr_class("_fV")}><span${_attr_class(["_q", phase[sessionPhase(s.state)]])}></span>${_el_resume($scope10_id, "b", $sg__input_sessions)}`);
3633
+ _html(`<button${_attr_class("_ff")}><span${_attr_class(["_s", phase[sessionPhase(s.state)]])}></span>${_el_resume($scope10_id, "b", $sg__input_sessions)}`);
3911
3634
  _set_serialize_reason({
3912
3635
  1: $sg__input_sessions,
3913
3636
  2: $sg__input_sessions
@@ -3916,12 +3639,12 @@ var side_nav_item_default = _template("s", (input) => {
3916
3639
  icon_agent_default({
3917
3640
  agent: activeAgent(s),
3918
3641
  size: 13,
3919
- class: "_fW"
3642
+ class: "_fg"
3920
3643
  });
3921
- _html(`<span${_attr_class("_fQ")}>${_escape(s.title || activeAgent(s))}${_el_resume($scope10_id, "e", $sg__input_sessions)}</span></button>${_el_resume($scope10_id, "a")}<div${_attr_class("_fR")}><button${_attr_class("_fI")} title="Rename session">`);
3644
+ _html(`<span${_attr_class("_fa")}>${_escape(s.title || activeAgent(s))}${_el_resume($scope10_id, "e", $sg__input_sessions)}</span></button>${_el_resume($scope10_id, "a")}<div${_attr_class("_fb")}><button${_attr_class("_e3")} title="Rename session">`);
3922
3645
  icon_edit_default({ size: 12 });
3923
- _html(`</button>${_el_resume($scope10_id, "g")}<button${_attr_class(["_fJ", { ["_fy"]: armedKill === s.id }])} title=${armedKill === s.id ? "\"Really kill this session?\"" : "\"Kill session\""}>×</button>${_el_resume($scope10_id, "i")}</div>`);
3924
- _script($scope10_id, "s9");
3646
+ _html(`</button>${_el_resume($scope10_id, "g")}<button${_attr_class(["_e4", { ["_eT"]: armedKill === s.id }])} title=${armedKill === s.id ? "\"Really kill this session?\"" : "\"Kill session\""}>×</button>${_el_resume($scope10_id, "i")}</div>`);
3647
+ _script($scope10_id, "r9");
3925
3648
  _subscribe($armedKill__closures, writeScope($scope10_id, { c: $si__input_sessions && _existing_scope($childScope4) }));
3926
3649
  return 1;
3927
3650
  }
@@ -3947,7 +3670,7 @@ var side_nav_item_default = _template("s", (input) => {
3947
3670
  onReviewPr: input.onReviewPr
3948
3671
  });
3949
3672
  _html(`</div></section>${_el_resume($scope3_id, "a")}`);
3950
- _script($scope3_id, "s10");
3673
+ _script($scope3_id, "r10");
3951
3674
  _subscribe($si__input_workspaces__OR__input_workspaceId && $ws_name__closures, _subscribe($si__input_onReviewPr && $input_onReviewPr__closures, _subscribe($si__input_page && $input_page__closures, _subscribe($si__input_railPop && $input_railPop__closures, _subscribe($si__input_sessions && $input_sessions__closures, _subscribe($si__input_current && $input_current__closures, _subscribe($si__input_workspaceId && $input_workspaceId__closures, writeScope($scope3_id, {
3952
3675
  p: $si__input_workspaceId__OR__input_status && sessions$1.length,
3953
3676
  q: $si__input_sessions && sessions$1[0],
@@ -4019,7 +3742,7 @@ var side_nav_item_default = _template("s", (input) => {
4019
3742
  });
4020
3743
  //#endregion
4021
3744
  //#region src/tags/icons/icon-folder-plus.marko
4022
- var icon_folder_plus_default = _template("I", (input) => {
3745
+ var icon_folder_plus_default = _template("H", (input) => {
4023
3746
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
4024
3747
  const $scope0_id = _scope_id();
4025
3748
  _set_serialize_reason({
@@ -4036,7 +3759,7 @@ var icon_folder_plus_default = _template("I", (input) => {
4036
3759
  });
4037
3760
  //#endregion
4038
3761
  //#region src/tags/icons/icon-sidebar-collapse.marko
4039
- var icon_sidebar_collapse_default = _template("Q", (input) => {
3762
+ var icon_sidebar_collapse_default = _template("P", (input) => {
4040
3763
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
4041
3764
  const $scope0_id = _scope_id();
4042
3765
  _set_serialize_reason({
@@ -4053,7 +3776,7 @@ var icon_sidebar_collapse_default = _template("Q", (input) => {
4053
3776
  });
4054
3777
  //#endregion
4055
3778
  //#region src/tags/side-nav.marko
4056
- var side_nav_default = _template("t", (input) => {
3779
+ var side_nav_default = _template("s", (input) => {
4057
3780
  const $scope0_reason = _scope_reason(), $sg__input_workspace__OR__input_allWorkspaces = _serialize_guard($scope0_reason, 0), $sg__input_workspace__OR__input_allWorkspaces__OR__input_allStatus = _serialize_guard($scope0_reason, 1), $sg__input_agents = _serialize_guard($scope0_reason, 10), $sg__input_workspace = _serialize_guard($scope0_reason, 2), $si__input_workspace = _serialize_if($scope0_reason, 2), $si__input_workspace__OR__input_allWorkspaces = _serialize_if($scope0_reason, 0), $si__input_allStatus = _serialize_if($scope0_reason, 8), $si__input_onSelectWorkspace = _serialize_if($scope0_reason, 9), $si__input_agents = _serialize_if($scope0_reason, 10), $si__input_onNewSession = _serialize_if($scope0_reason, 11), $si__input_onReviewOpened = _serialize_if($scope0_reason, 12), $si__input_sessions = _serialize_if($scope0_reason, 13), $si__input_onRenameSession = _serialize_if($scope0_reason, 14), $si__input_onCloseSession = _serialize_if($scope0_reason, 15);
4058
3781
  const $scope0_id = _scope_id();
4059
3782
  const $notifyOn__closures = /* @__PURE__ */ new Set();
@@ -4078,7 +3801,7 @@ var side_nav_default = _template("t", (input) => {
4078
3801
  let canPush = false;
4079
3802
  const leaveNav = _resume(() => {
4080
3803
  if (view === "nav") view = "term";
4081
- }, "t0", $scope0_id);
3804
+ }, "s0", $scope0_id);
4082
3805
  const toggleNotify = _resume(async () => {
4083
3806
  try {
4084
3807
  if (notifyOn) {
@@ -4092,7 +3815,7 @@ var side_nav_default = _template("t", (input) => {
4092
3815
  notifyOn = false;
4093
3816
  input.onError?.(`Notifications failed: ${String(err.message || err)}`);
4094
3817
  }
4095
- }, "t1", $scope0_id);
3818
+ }, "s1", $scope0_id);
4096
3819
  const itemIds = input.allWorkspaces?.length ? input.allWorkspaces.filter((w) => w.status === "active").map((w) => w.id) : [ws.id];
4097
3820
  const workspaces = input.allWorkspaces || [ws];
4098
3821
  const allStatus = input.allStatus || {};
@@ -4101,34 +3824,34 @@ var side_nav_default = _template("t", (input) => {
4101
3824
  const wsSelected = view !== "usage" && view !== "new";
4102
3825
  const otherIds = itemIds.filter((id) => id !== ws.id);
4103
3826
  const listIds = isPage ? [ws.id, ...otherIds] : itemIds;
4104
- _html(`<aside${_attr_class(["_cG", {
4105
- ["_cE"]: !navOpen,
4106
- ["_cF"]: isPage
3827
+ _html(`<aside${_attr_class(["_cU", {
3828
+ ["_cS"]: !navOpen,
3829
+ ["_cT"]: isPage
4107
3830
  }])}${_attr("hidden", view === "diff")}>`);
4108
3831
  _if(() => {
4109
3832
  if (isPage) {
4110
3833
  const $scope1_id = _scope_id();
4111
- _html(`<header${_attr_class("_cJ")}><h1${_attr_class("_cK")}>Workspaces</h1><div${_attr_class("_cL")}>`);
3834
+ _html(`<header${_attr_class("_cX")}><h1${_attr_class("_cY")}>Workspaces</h1><div${_attr_class("_cZ")}>`);
4112
3835
  _if(() => {}, $scope1_id, "d", 1, 1, 1, 0, 1);
4113
3836
  _html(`<button${_attr_class([
4114
3837
  iconBtn$2,
4115
- "_cM",
4116
- { ["_cC"]: view === "usage" }
3838
+ "_c0",
3839
+ { ["_cQ"]: view === "usage" }
4117
3840
  ])} title=Usage aria-pressed=${view === "usage" ? "true" : "false"}>`);
4118
3841
  icon_gauge_default({ size: 16 });
4119
3842
  _html(`</button>${_el_resume($scope1_id, "e")}</div></header>`);
4120
- _script($scope1_id, "t18");
3843
+ _script($scope1_id, "s18");
4121
3844
  writeScope($scope1_id, {});
4122
3845
  return 0;
4123
3846
  }
4124
3847
  }, $scope0_id, "b", 1, 1, 1, 0, 1);
4125
- _html(`<div${_attr_class("_cP")}>`);
3848
+ _html(`<div${_attr_class("_c3")}>`);
4126
3849
  _for_of(listIds, (wsId) => {
4127
3850
  const $scope2_id = _scope_id();
4128
3851
  _if(() => {
4129
3852
  if (isPage && wsId === ws.id) {
4130
3853
  const $scope10_id = _scope_id();
4131
- _html(`<h2${_attr_class("_cN")}>Current</h2>`);
3854
+ _html(`<h2${_attr_class("_c1")}>Current</h2>`);
4132
3855
  writeScope($scope10_id, {});
4133
3856
  return 0;
4134
3857
  }
@@ -4136,7 +3859,7 @@ var side_nav_default = _template("t", (input) => {
4136
3859
  _if(() => {
4137
3860
  if (isPage && wsId !== ws.id && wsId === otherIds[0]) {
4138
3861
  const $scope11_id = _scope_id();
4139
- _html(`<h2${_attr_class("_cN")}>Other spaces</h2>`);
3862
+ _html(`<h2${_attr_class("_c1")}>Other spaces</h2>`);
4140
3863
  writeScope($scope11_id, {});
4141
3864
  return 0;
4142
3865
  }
@@ -4180,15 +3903,15 @@ var side_nav_default = _template("t", (input) => {
4180
3903
  leaveNav();
4181
3904
  input.onSelectWorkspace?.(wsId);
4182
3905
  } else if (view === "nav" || view === "manage" || view === "usage" || view === "new") view = "term";
4183
- }, "t2", $scope2_id),
3906
+ }, "s2", $scope2_id),
4184
3907
  onManage: _resume(function() {
4185
3908
  input.onManage?.(wsId);
4186
- }, "t3", $scope2_id),
3909
+ }, "s3", $scope2_id),
4187
3910
  agents: input.agents,
4188
3911
  onNewSession: _resume(function(agent) {
4189
3912
  leaveNav();
4190
3913
  input.onNewSession(wsId, agent);
4191
- }, "t4", $scope2_id),
3914
+ }, "s4", $scope2_id),
4192
3915
  onReview: _resume(function() {
4193
3916
  if (wsId === ws.id) {
4194
3917
  if (view === "diff") view = "term";
@@ -4197,7 +3920,7 @@ var side_nav_default = _template("t", (input) => {
4197
3920
  requestDiff(wsId);
4198
3921
  input.onSelectWorkspace?.(wsId);
4199
3922
  }
4200
- }, "t5", $scope2_id),
3923
+ }, "s5", $scope2_id),
4201
3924
  onReviewPr: _resume(function(worktree, number) {
4202
3925
  const pr = `${worktree}/${number}`;
4203
3926
  if (wsId === ws.id) input.onReviewOpened?.(pr);
@@ -4205,7 +3928,7 @@ var side_nav_default = _template("t", (input) => {
4205
3928
  requestDiff(wsId, pr);
4206
3929
  input.onSelectWorkspace?.(wsId);
4207
3930
  }
4208
- }, "t6", $scope2_id),
3931
+ }, "s6", $scope2_id),
4209
3932
  sessions: wsId === ws.id && input.sessions ? input.sessions : allStatus[wsId]?.sessions || [],
4210
3933
  currentTab: wsId === ws.id && view === "term" ? tab : null,
4211
3934
  onOpenTab: _resume(function(sessionId) {
@@ -4213,7 +3936,7 @@ var side_nav_default = _template("t", (input) => {
4213
3936
  tab = sessionId;
4214
3937
  view = "term";
4215
3938
  } else input.onOpenSession?.(wsId, sessionId);
4216
- }, "t7", $scope2_id),
3939
+ }, "s7", $scope2_id),
4217
3940
  onRenameSession: input.onRenameSession,
4218
3941
  onCloseSession: input.onCloseSession
4219
3942
  });
@@ -4227,14 +3950,14 @@ var side_nav_default = _template("t", (input) => {
4227
3950
  const $scope3_id = _scope_id();
4228
3951
  let railHover = null;
4229
3952
  const railHoverBox = { timer: 0 };
4230
- const railKeep = _resume(() => clearTimeout(railHoverBox.timer), "t8", $scope3_id);
3953
+ const railKeep = _resume(() => clearTimeout(railHoverBox.timer), "s8", $scope3_id);
4231
3954
  const railHide = _resume(() => {
4232
3955
  clearTimeout(railHoverBox.timer);
4233
3956
  railHoverBox.timer = setTimeout(() => {
4234
3957
  railHover = null;
4235
3958
  }, 150);
4236
- }, "t9", $scope3_id);
4237
- _html(`<div${_attr_class("_cQ")}>`);
3959
+ }, "s9", $scope3_id);
3960
+ _html(`<div${_attr_class("_c4")}>`);
4238
3961
  _for_of(itemIds, (wsId, i) => {
4239
3962
  const $scope4_id = _scope_id();
4240
3963
  _html("<span>");
@@ -4267,10 +3990,10 @@ var side_nav_default = _template("t", (input) => {
4267
3990
  onSelect: _resume(function() {
4268
3991
  if (wsId !== ws.id) input.onSelectWorkspace?.(wsId);
4269
3992
  else if (view === "manage" || view === "usage" || view === "new") view = "term";
4270
- }, "t10", $scope4_id)
3993
+ }, "s10", $scope4_id)
4271
3994
  });
4272
3995
  _html(`</span>${_el_resume($scope4_id, "a")}`);
4273
- _script($scope4_id, "t19");
3996
+ _script($scope4_id, "s19");
4274
3997
  _subscribe($wsSelected__closures, _subscribe($si__input_allStatus && $allStatus__closures, _subscribe($si__input_workspace__OR__input_allWorkspaces && $workspaces__closures, _subscribe($si__input_workspace && $ws_id__closures, writeScope($scope4_id, {
4275
3998
  d: wsId,
4276
3999
  _: _scope_with_id($scope3_id),
@@ -4281,7 +4004,7 @@ var side_nav_default = _template("t", (input) => {
4281
4004
  if (railHover) {
4282
4005
  const $scope5_id = _scope_id();
4283
4006
  const hoverId = railHover.id;
4284
- _html(`<div${_attr_class("_cT")}${_attr_style(`top:${railHover.top}px;left:${railHover.left}px`)}>`);
4007
+ _html(`<div${_attr_class("_c7")}${_attr_style(`top:${railHover.top}px;left:${railHover.left}px`)}>`);
4285
4008
  _set_serialize_reason({
4286
4009
  0: 1,
4287
4010
  1: 1,
@@ -4319,16 +4042,16 @@ var side_nav_default = _template("t", (input) => {
4319
4042
  railHover = null;
4320
4043
  if (hoverId !== ws.id) input.onSelectWorkspace?.(hoverId);
4321
4044
  else if (view === "manage" || view === "usage" || view === "new") view = "term";
4322
- }, "t11", $scope5_id),
4045
+ }, "s11", $scope5_id),
4323
4046
  onManage: _resume(function() {
4324
4047
  railHover = null;
4325
4048
  input.onManage?.(hoverId);
4326
- }, "t12", $scope5_id),
4049
+ }, "s12", $scope5_id),
4327
4050
  agents: input.agents,
4328
4051
  onNewSession: _resume(function(agent) {
4329
4052
  railHover = null;
4330
4053
  input.onNewSession(hoverId, agent);
4331
- }, "t13", $scope5_id),
4054
+ }, "s13", $scope5_id),
4332
4055
  onReview: _resume(function() {
4333
4056
  railHover = null;
4334
4057
  if (hoverId === ws.id) {
@@ -4338,7 +4061,7 @@ var side_nav_default = _template("t", (input) => {
4338
4061
  requestDiff(hoverId);
4339
4062
  input.onSelectWorkspace?.(hoverId);
4340
4063
  }
4341
- }, "t14", $scope5_id),
4064
+ }, "s14", $scope5_id),
4342
4065
  onReviewPr: _resume(function(worktree, number) {
4343
4066
  railHover = null;
4344
4067
  const pr = `${worktree}/${number}`;
@@ -4347,7 +4070,7 @@ var side_nav_default = _template("t", (input) => {
4347
4070
  requestDiff(hoverId, pr);
4348
4071
  input.onSelectWorkspace?.(hoverId);
4349
4072
  }
4350
- }, "t15", $scope5_id),
4073
+ }, "s15", $scope5_id),
4351
4074
  sessions: hoverId === ws.id && input.sessions ? input.sessions : allStatus[hoverId]?.sessions || [],
4352
4075
  currentTab: hoverId === ws.id && view === "term" ? tab : null,
4353
4076
  onOpenTab: _resume(function(sessionId) {
@@ -4356,12 +4079,12 @@ var side_nav_default = _template("t", (input) => {
4356
4079
  tab = sessionId;
4357
4080
  view = "term";
4358
4081
  } else input.onOpenSession?.(hoverId, sessionId);
4359
- }, "t16", $scope5_id),
4082
+ }, "s16", $scope5_id),
4360
4083
  onRenameSession: input.onRenameSession,
4361
4084
  onCloseSession: input.onCloseSession
4362
4085
  });
4363
4086
  _html(`</div>${_el_resume($scope5_id, "a")}`);
4364
- _script($scope5_id, "t20");
4087
+ _script($scope5_id, "s20");
4365
4088
  _subscribe($wsSelected__closures, _subscribe($si__input_allStatus && $allStatus__closures, _subscribe($si__input_workspace__OR__input_allWorkspaces && $workspaces__closures, _subscribe($view__closures, _subscribe($tab__closures, _subscribe($si__input_workspace && $ws_id__closures, _subscribe($si__input_onCloseSession && $input_onCloseSession__closures, _subscribe($si__input_onRenameSession && $input_onRenameSession__closures, _subscribe($si__input_sessions && $input_sessions__closures, _subscribe($si__input_onReviewOpened && $input_onReviewOpened__closures, _subscribe($si__input_onNewSession && $input_onNewSession__closures, _subscribe($si__input_agents && $input_agents__closures, _subscribe($si__input_onSelectWorkspace && $input_onSelectWorkspace__closures, writeScope($scope5_id, {
4366
4089
  c: hoverId,
4367
4090
  b: _existing_scope($childScope3),
@@ -4384,14 +4107,14 @@ var side_nav_default = _template("t", (input) => {
4384
4107
  return 0;
4385
4108
  }
4386
4109
  }, $scope0_id, "d");
4387
- _html(`<div${_attr_class("_cR")}>`);
4110
+ _html(`<div${_attr_class("_c5")}>`);
4388
4111
  _if(() => {
4389
4112
  if (isPage) {
4390
4113
  const $scope6_id = _scope_id();
4391
- _html(`<button${_attr_class(["_cO", { ["_cC"]: view === "new" }])} title="New workspace" aria-pressed=${view === "new" ? "true" : "false"}>`);
4114
+ _html(`<button${_attr_class(["_c2", { ["_cQ"]: view === "new" }])} title="New workspace" aria-pressed=${view === "new" ? "true" : "false"}>`);
4392
4115
  icon_folder_plus_default({ size: 16 });
4393
4116
  _html(` New workspace</button>${_el_resume($scope6_id, "a")}`);
4394
- _script($scope6_id, "t21");
4117
+ _script($scope6_id, "s21");
4395
4118
  writeScope($scope6_id, {});
4396
4119
  return 0;
4397
4120
  } else {
@@ -4410,21 +4133,21 @@ var side_nav_default = _template("t", (input) => {
4410
4133
  return 1;
4411
4134
  }
4412
4135
  }, $scope7_id, "a", 1, 1, 1, "</button>", 1);
4413
- _html(`<div${_attr_class(["_p", "_cS"])}></div>`);
4136
+ _html(`<div${_attr_class(["_r", "_c6"])}></div>`);
4414
4137
  _if(() => {}, $scope7_id, "c", 1, 1, 1, 0, 1);
4415
- _html(`<button${_attr_class([iconBtn$2, { ["_cC"]: view === "usage" }])} title=Usage aria-pressed=${view === "usage" ? "true" : "false"}>`);
4138
+ _html(`<button${_attr_class([iconBtn$2, { ["_cQ"]: view === "usage" }])} title=Usage aria-pressed=${view === "usage" ? "true" : "false"}>`);
4416
4139
  icon_gauge_default({ size: 15 });
4417
- _html(`</button>${_el_resume($scope7_id, "d")}<button${_attr_class([iconBtn$2, { ["_cC"]: view === "new" }])} title="New workspace" aria-pressed=${view === "new" ? "true" : "false"}>`);
4140
+ _html(`</button>${_el_resume($scope7_id, "d")}<button${_attr_class([iconBtn$2, { ["_cQ"]: view === "new" }])} title="New workspace" aria-pressed=${view === "new" ? "true" : "false"}>`);
4418
4141
  icon_folder_plus_default({ size: 16 });
4419
4142
  _html(`</button>${_el_resume($scope7_id, "f")}`);
4420
- _script($scope7_id, "t23");
4143
+ _script($scope7_id, "s23");
4421
4144
  writeScope($scope7_id, {});
4422
4145
  return 1;
4423
4146
  }
4424
4147
  }, $scope0_id, "e", 1, 1, 1, "</div>");
4425
4148
  _html(`</aside>${_el_resume($scope0_id, "a")}`);
4426
- _script($scope0_id, "t24");
4427
- _script($scope0_id, "t25");
4149
+ _script($scope0_id, "s24");
4150
+ _script($scope0_id, "s25");
4428
4151
  writeScope($scope0_id, {
4429
4152
  i: _serialize_if($scope0_reason, 4) && input.tab,
4430
4153
  j: _serialize_if($scope0_reason, 3) && input.tabChange,
@@ -4481,9 +4204,9 @@ var side_nav_default = _template("t", (input) => {
4481
4204
  });
4482
4205
  //#endregion
4483
4206
  //#region src/tags/manage-workspace.css.ts
4484
- var content$1 = "_cU _O";
4485
- var pageMeta = "_cV _T";
4486
- var iconBtn$1 = "_dm _y";
4207
+ var content$1 = "_ck _Q";
4208
+ var pageMeta = "_cl _V";
4209
+ var iconBtn$1 = "_cO _A";
4487
4210
  //#endregion
4488
4211
  //#region src/tags/manage-workspace.marko
4489
4212
  var api$3;
@@ -4564,7 +4287,7 @@ var manage_workspace_default = _template("k", (input) => {
4564
4287
  ...ws,
4565
4288
  status: "archived"
4566
4289
  });
4567
- else if (action === "delete") input.onExit?.();
4290
+ else if (action === "delete") input.onDeleted?.();
4568
4291
  } catch (err) {
4569
4292
  error = String(err.message || err);
4570
4293
  } finally {
@@ -4577,16 +4300,16 @@ var manage_workspace_default = _template("k", (input) => {
4577
4300
  setTimeout(() => loadProcs(void 0), 500);
4578
4301
  }, "k5", $scope0_id);
4579
4302
  const titleId = _id();
4580
- _html(`<div${_attr_class("_M")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_N")}><div${_attr_class(content$1)}><header${_attr_class("_Q")}><div${_attr_class("_S")}><h1${_attr("id", titleId)}${_attr_class("_R")}>Manage</h1><p${_attr_class(pageMeta)}${_attr("title", ws.display_path || ws.path)}><span${_attr_class("_cW")}>${_escape(ws.name)}${_el_resume($scope0_id, "i")}</span>`);
4303
+ _html(`<div${_attr_class("_O")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_P")}><div${_attr_class(content$1)}><header${_attr_class("_S")}><div${_attr_class("_U")}><h1${_attr("id", titleId)}${_attr_class("_T")}>Manage</h1><p${_attr_class(pageMeta)}${_attr("title", ws.display_path || ws.path)}><span${_attr_class("_cm")}>${_escape(ws.name)}${_el_resume($scope0_id, "i")}</span>`);
4581
4304
  _if(() => {
4582
4305
  if (ws.status !== "active") {
4583
4306
  const $scope10_id = _scope_id();
4584
- _html(`<span${_attr_class(["_cZ", "_c0"])}>Archived</span>`);
4307
+ _html(`<span${_attr_class(["_cp", "_cq"])}>Archived</span>`);
4585
4308
  writeScope($scope10_id, {});
4586
4309
  return 0;
4587
4310
  }
4588
4311
  }, $scope0_id, "j", 1, 1, 1, 0, 1);
4589
- _html(`<span${_attr_class("_cX")} aria-hidden=true>·</span><span${_attr_class(["_cY", "_o"])}>${_escape(ws.display_path || ws.path)}${_el_resume($scope0_id, "m")}</span></p>${_el_resume($scope0_id, "g")}</div></header>`);
4312
+ _html(`<span${_attr_class("_cn")} aria-hidden=true>·</span><span${_attr_class(["_co", "_q"])}>${_escape(ws.display_path || ws.path)}${_el_resume($scope0_id, "m")}</span></p>${_el_resume($scope0_id, "g")}</div></header>`);
4590
4313
  _if(() => {
4591
4314
  if (error) {
4592
4315
  const $scope2_id = _scope_id();
@@ -4610,26 +4333,26 @@ var manage_workspace_default = _template("k", (input) => {
4610
4333
  _if(() => {
4611
4334
  if (pendingAction && actionStep) {
4612
4335
  const $scope7_id = _scope_id();
4613
- _html(`<p${_attr_class("_c1")}><span${_attr_class("_w")}></span><!>${_escape(actionStep)}${_el_resume($scope7_id, "c")}</p>`);
4336
+ _html(`<p${_attr_class("_cr")}><span${_attr_class("_y")}></span><!>${_escape(actionStep)}${_el_resume($scope7_id, "c")}</p>`);
4614
4337
  writeScope($scope7_id, {});
4615
4338
  return 0;
4616
4339
  }
4617
4340
  }, $scope0_id, "o", 1, 1, 1, 0, 1);
4618
- _html(`<section${_attr_class("_c2")}><div${_attr_class("_c3")}><h2${_attr_class("_dn")}>Repos</h2><span${_attr_class("_c4")}>${_escape(ws.repos.length)}${_el_resume($scope0_id, "t")}</span><div${_attr_class("_p")}></div><button${_attr_class(iconBtn$1)} title="Refresh repo list" aria-label="Refresh repo list"${_attr("disabled", catalogRefreshing)}>`);
4341
+ _html(`<section${_attr_class("_cs")}><div${_attr_class("_ct")}><h2${_attr_class("_cP")}>Repos</h2><span${_attr_class("_cu")}>${_escape(ws.repos.length)}${_el_resume($scope0_id, "t")}</span><div${_attr_class("_r")}></div><button${_attr_class(iconBtn$1)} title="Refresh repo list" aria-label="Refresh repo list"${_attr("disabled", catalogRefreshing)}>`);
4619
4342
  _set_serialize_reason(1);
4620
4343
  const $childScope = _peek_scope_id();
4621
4344
  icon_refresh_default({
4622
4345
  size: 14,
4623
- class: catalogRefreshing && "_v"
4346
+ class: catalogRefreshing && "_x"
4624
4347
  });
4625
- _html(`</button>${_el_resume($scope0_id, "v")}</div><ul${_attr_class("_c6")}>`);
4348
+ _html(`</button>${_el_resume($scope0_id, "v")}</div><ul${_attr_class("_cw")}>`);
4626
4349
  _for_of(ws.repos, (row) => {
4627
4350
  const $scope1_id = _scope_id();
4628
- _html(`<li${_attr_class("_c8")}><div${_attr_class("_c9")}><span${_attr_class(["_c_", "_o"])}>${_escape(row.worktree)}${_el_resume($scope1_id, "d")}/</span><span${_attr_class("_da")}><span${_attr_class("_db")}>${_escape(row.full_name)}${_el_resume($scope1_id, "g")}</span>`);
4351
+ _html(`<li${_attr_class("_cy")}><div${_attr_class("_cz")}><span${_attr_class(["_cA", "_q"])}>${_escape(row.worktree)}${_el_resume($scope1_id, "d")}/</span><span${_attr_class("_cB")}><a${_attr_class(["_cC", "_cD"])}${_attr("href", `https://github.com/${row.full_name}`)} target=_blank rel=noopener${_attr("title", `Open ${row.full_name} on GitHub`)}>${_escape(row.full_name)}${_el_resume($scope1_id, "g")}</a>${_el_resume($scope1_id, "f")}`);
4629
4352
  _if(() => {
4630
4353
  if (row.base_branch !== row.default_branch) {
4631
4354
  const $scope11_id = _scope_id();
4632
- _html(`<span${_attr_class(["_dc", "_o"])} title="Base branch">⎇ <!>${_escape(row.base_branch)}${_el_resume($scope11_id, "b")}</span>`);
4355
+ _html(`<span${_attr_class(["_cE", "_q"])} title="Base branch">⎇ <!>${_escape(row.base_branch)}${_el_resume($scope11_id, "b")}</span>`);
4633
4356
  writeScope($scope11_id, {});
4634
4357
  return 0;
4635
4358
  }
@@ -4638,15 +4361,15 @@ var manage_workspace_default = _template("k", (input) => {
4638
4361
  _if(() => {
4639
4362
  if (busy.has(row.full_name)) {
4640
4363
  const $scope12_id = _scope_id();
4641
- _html(`<span${_attr_class("_w")}></span>`);
4364
+ _html(`<span${_attr_class("_y")}></span>`);
4642
4365
  writeScope($scope12_id, {});
4643
4366
  return 0;
4644
4367
  } else {
4645
4368
  const $scope6_id = _scope_id();
4646
4369
  _html(`<button${_attr_class([
4647
- "_dd",
4648
- "_df",
4649
- { ["_de"]: confirmingRemove === row.full_name }
4370
+ "_cF",
4371
+ "_cH",
4372
+ { ["_cG"]: confirmingRemove === row.full_name }
4650
4373
  ])}${confirmingRemove === row.full_name ? _attr("title", `Really remove ${row.worktree}/? Uncommitted changes are lost.`) : _attr("title", `Remove ${row.worktree}/`)}>${confirmingRemove === row.full_name ? "Remove?" : "×"}${_el_resume($scope6_id, "b")}</button>${_el_resume($scope6_id, "a")}`);
4651
4374
  _script($scope6_id, "k11");
4652
4375
  _subscribe($confirmingRemove__closures, writeScope($scope6_id, {}));
@@ -4663,19 +4386,19 @@ var manage_workspace_default = _template("k", (input) => {
4663
4386
  }, "full_name", $scope0_id, "y", 1, 1, 1, 0, 1);
4664
4387
  _for_of([...busy].filter((n) => !inWorkspace.has(n)), (name) => {
4665
4388
  const $scope13_id = _scope_id();
4666
- _html(`<li${_attr_class(["_c8", "_c7"])}><span${_attr_class("_w")}></span><div${_attr_class("_c9")}><span${_attr_class("_db")}>Adding <!>${_escape(name)}${_el_resume($scope13_id, "e")}…</span></div></li>`);
4389
+ _html(`<li${_attr_class(["_cy", "_cx"])}><span${_attr_class("_y")}></span><div${_attr_class("_cz")}><span${_attr_class("_cC")}>Adding <!>${_escape(name)}${_el_resume($scope13_id, "e")}…</span></div></li>`);
4667
4390
  writeScope($scope13_id, {});
4668
4391
  }, (n) => n, $scope0_id, "z", 1, 1, 1, 0, 1);
4669
4392
  _html("</ul>");
4670
4393
  _if(() => {
4671
4394
  if (!ws.repos.length && !busy.size) {
4672
4395
  const $scope14_id = _scope_id();
4673
- _html(`<p${_attr_class("_dh")}>No repos yet — search below to add one.</p>`);
4396
+ _html(`<p${_attr_class("_cJ")}>No repos yet — search below to add one.</p>`);
4674
4397
  writeScope($scope14_id, {});
4675
4398
  return 0;
4676
4399
  }
4677
4400
  }, $scope0_id, "a0", 1, 1, 1, 0, 1);
4678
- _html(`<div${_attr_class("_c5")}>`);
4401
+ _html(`<div${_attr_class("_cv")}>`);
4679
4402
  const $childScope2 = _peek_scope_id();
4680
4403
  let refreshCatalog = repo_picker_default({
4681
4404
  exclude: inWorkspace,
@@ -4695,17 +4418,17 @@ var manage_workspace_default = _template("k", (input) => {
4695
4418
  _if(() => {
4696
4419
  if (running.length) {
4697
4420
  const $scope8_id = _scope_id();
4698
- _html(`<section${_attr_class("_c2")}><div${_attr_class("_c3")}><h2${_attr_class("_dn")}>Running</h2><span${_attr_class("_c4")}>${_escape(running.length)}${_el_resume($scope8_id, "e")}</span></div><ul${_attr_class("_c6")}>`);
4421
+ _html(`<section${_attr_class("_cs")}><div${_attr_class("_ct")}><h2${_attr_class("_cP")}>Running</h2><span${_attr_class("_cu")}>${_escape(running.length)}${_el_resume($scope8_id, "e")}</span></div><ul${_attr_class("_cw")}>`);
4699
4422
  _for_of(running, (p) => {
4700
4423
  const $scope9_id = _scope_id();
4701
- _html(`<li${_attr_class("_c8")}><div${_attr_class("_c9")}${_attr("title", p.args)}><span${_attr_class(["_c_", "_o"])}>${_escape(p.cmd)}${_el_resume($scope9_id, "d")}</span>`);
4424
+ _html(`<li${_attr_class("_cy")}><div${_attr_class("_cz")}${_attr("title", p.args)}><span${_attr_class(["_cA", "_q"])}>${_escape(p.cmd)}${_el_resume($scope9_id, "d")}</span>`);
4702
4425
  _if(() => {
4703
4426
  if (p.ports.length) {
4704
4427
  const $scope15_id = _scope_id();
4705
- _html(`<span${_attr_class("_da")}>`);
4428
+ _html(`<span${_attr_class("_cB")}>`);
4706
4429
  _for_of(p.ports, (port) => {
4707
4430
  const $scope16_id = _scope_id();
4708
- _html(`<button${_attr_class(["_j", "_dg"])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${port}`)}>:<!>${_escape(port)}${_el_resume($scope16_id, "b")}</button>${_el_resume($scope16_id, "a")}`);
4431
+ _html(`<button${_attr_class(["_l", "_cI"])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${port}`)}>:<!>${_escape(port)}${_el_resume($scope16_id, "b")}</button>${_el_resume($scope16_id, "a")}`);
4709
4432
  _script($scope16_id, "k13");
4710
4433
  writeScope($scope16_id, { d: port });
4711
4434
  }, (x) => String(x), $scope15_id, "a", 1, 1, 1, "</span>", 1);
@@ -4713,7 +4436,7 @@ var manage_workspace_default = _template("k", (input) => {
4713
4436
  return 0;
4714
4437
  }
4715
4438
  }, $scope9_id, "e", 1, 1, 1, 0, 1);
4716
- _html(`</div>${_el_resume($scope9_id, "b")}<button${_attr_class(["_dd", "_df"])} type=button${_attr("title", `Kill ${p.pid}`)}${_attr("aria-label", `Kill process ${p.pid}`)}>×</button>${_el_resume($scope9_id, "f")}</li>`);
4439
+ _html(`</div>${_el_resume($scope9_id, "b")}<button${_attr_class(["_cF", "_cH"])} type=button${_attr("title", `Kill ${p.pid}`)}${_attr("aria-label", `Kill process ${p.pid}`)}>×</button>${_el_resume($scope9_id, "f")}</li>`);
4717
4440
  _script($scope9_id, "k14");
4718
4441
  writeScope($scope9_id, {
4719
4442
  k: p?.ports,
@@ -4725,34 +4448,34 @@ var manage_workspace_default = _template("k", (input) => {
4725
4448
  return 0;
4726
4449
  }
4727
4450
  }, $scope0_id, "a4", 1, 1, 1, 0, 1);
4728
- _html(`<section${_attr_class(["_c2", "_di"])}><div${_attr_class("_c3")}><h2${_attr_class("_dn")}>Workspace</h2></div><div${_attr_class("_dj")}>`);
4451
+ _html(`<section${_attr_class(["_cs", "_cK"])}><div${_attr_class("_ct")}><h2${_attr_class("_cP")}>Workspace</h2></div><div${_attr_class("_cL")}>`);
4729
4452
  _if(() => {
4730
4453
  if (ws.status === "active") {
4731
4454
  const $scope4_id = _scope_id();
4732
- _html(`<button type=button${_attr_class(["_f", "_dk"])}${_attr("disabled", !!pendingAction)}>${pendingAction === "archive" ? "Archiving…" : "Archive"}${_el_resume($scope4_id, "b")}</button>${_el_resume($scope4_id, "a")}`);
4455
+ _html(`<button type=button${_attr_class(["_h", "_cM"])}${_attr("disabled", !!pendingAction)}>${pendingAction === "archive" ? "Archiving…" : "Archive"}${_el_resume($scope4_id, "b")}</button>${_el_resume($scope4_id, "a")}`);
4733
4456
  _script($scope4_id, "k15");
4734
4457
  writeScope($scope4_id, {});
4735
4458
  return 0;
4736
4459
  } else {
4737
4460
  const $scope5_id = _scope_id();
4738
- _html(`<button type=button${_attr_class(["_f", "_dk"])}${_attr("disabled", !!pendingAction)}>Restore</button>${_el_resume($scope5_id, "a")}`);
4461
+ _html(`<button type=button${_attr_class(["_h", "_cM"])}${_attr("disabled", !!pendingAction)}>Restore</button>${_el_resume($scope5_id, "a")}`);
4739
4462
  _script($scope5_id, "k16");
4740
4463
  writeScope($scope5_id, {});
4741
4464
  return 1;
4742
4465
  }
4743
4466
  }, $scope0_id, "a9", 1, 1, 1, 0, 1);
4744
4467
  _html(`<button type=button${_attr_class([
4745
- "_f",
4746
- "_i",
4747
- "_dk",
4748
- { ["_h"]: confirmingDelete }
4749
- ])}${_attr("disabled", !!pendingAction)}>${pendingAction === "delete" ? "Deleting…" : "Delete"}${_el_resume($scope0_id, "ab")}</button>${_el_resume($scope0_id, "aa")}</div><p${_attr_class("_dl")}>Archive hides the space from the list. Delete removes it and its worktrees.</p></section></div></div></div>`);
4468
+ "_h",
4469
+ "_k",
4470
+ "_cM",
4471
+ { ["_j"]: confirmingDelete }
4472
+ ])}${_attr("disabled", !!pendingAction)}>${pendingAction === "delete" ? "Deleting…" : "Delete"}${_el_resume($scope0_id, "ab")}</button>${_el_resume($scope0_id, "aa")}</div><p${_attr_class("_cN")}>Archive hides the space from the list. Delete removes it and its worktrees.</p></section></div></div></div>`);
4750
4473
  _script($scope0_id, "k17");
4751
4474
  _script($scope0_id, "k18");
4752
4475
  writeScope($scope0_id, {
4753
4476
  af: _serialize_if($scope0_reason, 0) && input.workspace,
4754
4477
  ah: input.workspaceChange,
4755
- aj: input.onExit,
4478
+ aj: input.onDeleted,
4756
4479
  am: busy,
4757
4480
  an: busy?.size,
4758
4481
  ao: error,
@@ -4783,8 +4506,8 @@ var manage_workspace_default = _template("k", (input) => {
4783
4506
  });
4784
4507
  //#endregion
4785
4508
  //#region src/tags/usage-stats.css.ts
4786
- var content = "_cb _O _P";
4787
- var iconBtn = "_cc _y";
4509
+ var content = "_bQ _Q _R";
4510
+ var iconBtn = "_bR _A";
4788
4511
  //#endregion
4789
4512
  //#region src/tags/usage-stats.marko
4790
4513
  var api$2;
@@ -4801,8 +4524,8 @@ function resetLabel(iso, stale) {
4801
4524
  if (ms <= 0) return stale ? null : "now";
4802
4525
  return duration(ms);
4803
4526
  }
4804
- var usage_stats_default = _template("x", (input) => {
4805
- _scope_reason();
4527
+ var usage_stats_default = _template("w", (input) => {
4528
+ const $scope0_reason = _scope_reason(), $sg__input_agents = _serialize_guard($scope0_reason, 1);
4806
4529
  const $scope0_id = _scope_id();
4807
4530
  let usage = null;
4808
4531
  let refreshing = false;
@@ -4812,74 +4535,90 @@ var usage_stats_default = _template("x", (input) => {
4812
4535
  } catch (err) {
4813
4536
  usage = { error: String(err.message || err) };
4814
4537
  }
4815
- }, "x0", $scope0_id);
4538
+ }, "w1", $scope0_id);
4816
4539
  const refresh = _resume(async () => {
4817
4540
  refreshing = true;
4818
4541
  await load(true);
4819
4542
  refreshing = false;
4820
- }, "x1", $scope0_id);
4543
+ }, "w2", $scope0_id);
4821
4544
  const titleId = _id();
4822
- _html(`<div${_attr_class("_M")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_N")}><div${_attr_class(content)}><header${_attr_class("_Q")}><div${_attr_class("_S")}><h1${_attr("id", titleId)}${_attr_class("_R")}>Usage</h1><p${_attr_class("_T")}>Provider plan windows across your agents.</p></div><div${_attr_class("_U")}><button${_attr_class([iconBtn, "_cd"])} title="Refresh usage" aria-label="Refresh usage"${_attr("disabled", refreshing)}>`);
4545
+ _html(`<div${_attr_class("_O")} role=region${_attr("aria-labelledby", titleId)}><div${_attr_class("_P")}><div${_attr_class(content)}><header${_attr_class("_S")}><div${_attr_class("_U")}><h1${_attr("id", titleId)}${_attr_class("_T")}>Usage</h1><p${_attr_class("_V")}>Provider plan windows across your agents.</p></div><div${_attr_class("_W")}><button${_attr_class([iconBtn, "_bS"])} title="Refresh usage" aria-label="Refresh usage"${_attr("disabled", refreshing)}>`);
4823
4546
  _set_serialize_reason(1);
4824
4547
  const $childScope = _peek_scope_id();
4825
4548
  icon_refresh_default({
4826
4549
  size: 14,
4827
- class: refreshing && "_v"
4550
+ class: refreshing && "_x"
4551
+ });
4552
+ _html(`</button>${_el_resume($scope0_id, "i")}</div></header><div${_attr_class("_bT")}><div${_attr_class("_bU")}><p${_attr_class("_bV")}>Preferred agent</p><p${_attr_class("_bW")}>Used when starting a session from an empty workspace or auto-create.</p></div><span${_attr_class("_f")}>`);
4553
+ _attr_select_value($scope0_id, "p", input.preferred, _resume(function(v) {
4554
+ input.preferredChange?.(v);
4555
+ api$2("/api/settings", {
4556
+ method: "PUT",
4557
+ headers: { "content-type": "application/json" },
4558
+ body: JSON.stringify({ preferredAgent: v })
4559
+ }).catch(() => {});
4560
+ }, "w0", $scope0_id), () => {
4561
+ _html(`<select${_attr_class("_g")} aria-label="Preferred agent">`);
4562
+ _for_of(input.agents, (agent) => {
4563
+ const $scope3_id = _scope_id();
4564
+ _html(`<option${_attr_option_value(agent)}>${_escape(agent)}${_el_resume($scope3_id, "b", $sg__input_agents)}</option>${_el_resume($scope3_id, "a", $sg__input_agents)}`);
4565
+ _serialize_if($scope0_reason, 1) && writeScope($scope3_id, {});
4566
+ }, (a) => a, $scope0_id, "p", $sg__input_agents, 1, $sg__input_agents, "</select>", 1);
4828
4567
  });
4829
- _html(`</button>${_el_resume($scope0_id, "i")}</div></header>`);
4568
+ _html("</span></div>");
4830
4569
  _if(() => {
4831
4570
  if (!usage) {
4832
- const $scope3_id = _scope_id();
4833
- _html(`<p${_attr_class(["_n", "_ce"])}><span${_attr_class("_w")}></span> Loading usage…</p>`);
4834
- writeScope($scope3_id, {});
4571
+ const $scope4_id = _scope_id();
4572
+ _html(`<p${_attr_class(["_p", "_bX"])}><span${_attr_class("_y")}></span> Loading usage…</p>`);
4573
+ writeScope($scope4_id, {});
4835
4574
  return 0;
4836
4575
  } else if (usage.error) {
4837
4576
  const $scope1_id = _scope_id();
4838
- _html(`<p${_attr_class(["_n", "_ce"])}>${_escape(usage.error)}${_el_resume($scope1_id, "b")}</p>`);
4577
+ _html(`<p${_attr_class(["_p", "_bX"])}>${_escape(usage.error)}${_el_resume($scope1_id, "b")}</p>`);
4839
4578
  writeScope($scope1_id, {});
4840
4579
  return 1;
4841
4580
  } else {
4842
4581
  const $scope2_id = _scope_id();
4843
- _html(`<div${_attr_class("_cf")}>`);
4582
+ _html(`<div${_attr_class("_bY")}>`);
4844
4583
  _for_of(usage.agents || [], (agent) => {
4845
- const $scope4_id = _scope_id();
4846
- _html(`<div${_attr_class("_cg")}><div${_attr_class("_ch")}><strong${_attr_class("_cA")}>${_escape(agent.agent)}${_el_resume($scope4_id, "d")}</strong>`);
4584
+ const $scope5_id = _scope_id();
4585
+ _html(`<div${_attr_class("_bZ")}><div${_attr_class("_b0")}><strong${_attr_class("_ci")}>${_escape(agent.agent)}${_el_resume($scope5_id, "d")}</strong>`);
4847
4586
  _if(() => {
4848
4587
  if (agent.plan) {
4849
- const $scope5_id = _scope_id();
4850
- _html(`<span${_attr_class("_ci")}>${_escape(agent.plan.replace(/^default_/, "").replaceAll("_", " "))}${_el_resume($scope5_id, "b")}</span>`);
4851
- writeScope($scope5_id, {});
4588
+ const $scope6_id = _scope_id();
4589
+ _html(`<span${_attr_class("_b1")}>${_escape(agent.plan.replace(/^default_/, "").replaceAll("_", " "))}${_el_resume($scope6_id, "b")}</span>`);
4590
+ writeScope($scope6_id, {});
4852
4591
  return 0;
4853
4592
  }
4854
- }, $scope4_id, "e", 1, 1, 1, 0, 1);
4593
+ }, $scope5_id, "e", 1, 1, 1, 0, 1);
4855
4594
  _if(() => {
4856
4595
  if (agent.stale_seconds != null) {
4857
- const $scope6_id = _scope_id();
4858
- _html(`<span${_attr_class("_cj")}${_attr("title", `${agent.note || "couldn't reach this provider"} — these are the last cached numbers, ${duration(agent.stale_seconds * 1e3)} old`)}>⚠ <!>${_escape(duration(agent.stale_seconds * 1e3))}${_el_resume($scope6_id, "b")} old</span>${_el_resume($scope6_id, "a")}`);
4859
- writeScope($scope6_id, {});
4596
+ const $scope7_id = _scope_id();
4597
+ _html(`<span${_attr_class("_b2")}${_attr("title", `${agent.note || "couldn't reach this provider"} — these are the last cached numbers, ${duration(agent.stale_seconds * 1e3)} old`)}>⚠ <!>${_escape(duration(agent.stale_seconds * 1e3))}${_el_resume($scope7_id, "b")} old</span>${_el_resume($scope7_id, "a")}`);
4598
+ writeScope($scope7_id, {});
4860
4599
  return 0;
4861
4600
  }
4862
- }, $scope4_id, "f", 1, 1, 1, 0, 1);
4863
- _html(`</div><div${_attr_class(["_ck", { ["_cB"]: agent.stale_seconds != null }])}>`);
4601
+ }, $scope5_id, "f", 1, 1, 1, 0, 1);
4602
+ _html(`</div><div${_attr_class(["_b3", { ["_cj"]: agent.stale_seconds != null }])}>`);
4864
4603
  _for_of(agent.windows || [], (win) => {
4865
- const $scope7_id = _scope_id();
4604
+ const $scope8_id = _scope_id();
4866
4605
  const pct = Math.round(win.used_percent);
4867
4606
  const label = resetLabel(win.resets_at, agent.stale_seconds != null);
4868
- const fillClass = win.used_percent >= 90 ? "_ct" : win.used_percent >= 70 ? "_cs" : win.used_percent >= 40 ? "_cr" : "_cq";
4869
- const pctClass = win.used_percent >= 90 ? "_cy" : win.used_percent >= 70 ? "_cx" : win.used_percent >= 40 ? "_cw" : "_cv";
4870
- _html(`<div${_attr_class("_cm")}${_attr("title", `${win.window}: ${pct}% used${win.resets_at ? ` — resets ${new Date(win.resets_at).toLocaleString()}` : ""}`)}><span${_attr_class("_cn")}>${_escape(win.window)}${_el_resume($scope7_id, "c")}</span><span${_attr_class("_co")}><span${_attr_class(["_cp", fillClass])}${_attr_style(`width:${Math.min(100, Math.max(2, win.used_percent))}%`)}></span>${_el_resume($scope7_id, "e")}</span><span${_attr_class(["_cu", pctClass])}>${_escape(pct)}${_el_resume($scope7_id, "g")}%</span>${_el_resume($scope7_id, "f")}<span${_attr_class("_cz")}>${label ? `↻ ${_escape(`${_to_text(label)}`)}` : ""}${_el_resume($scope7_id, "i")}</span></div>${_el_resume($scope7_id, "a")}`);
4871
- writeScope($scope7_id, {});
4872
- }, "window", $scope4_id, "h", 1, 1, 1, 0, 1);
4607
+ const fillClass = win.used_percent >= 90 ? "_cb" : win.used_percent >= 70 ? "_ca" : win.used_percent >= 40 ? "_b_" : "_b9";
4608
+ const pctClass = win.used_percent >= 90 ? "_cg" : win.used_percent >= 70 ? "_cf" : win.used_percent >= 40 ? "_ce" : "_cd";
4609
+ _html(`<div${_attr_class("_b5")}${_attr("title", `${win.window}: ${pct}% used${win.resets_at ? ` — resets ${new Date(win.resets_at).toLocaleString()}` : ""}`)}><span${_attr_class("_b6")}>${_escape(win.window)}${_el_resume($scope8_id, "c")}</span><span${_attr_class("_b7")}><span${_attr_class(["_b8", fillClass])}${_attr_style(`width:${Math.min(100, Math.max(2, win.used_percent))}%`)}></span>${_el_resume($scope8_id, "e")}</span><span${_attr_class(["_cc", pctClass])}>${_escape(pct)}${_el_resume($scope8_id, "g")}%</span>${_el_resume($scope8_id, "f")}<span${_attr_class("_ch")}>${label ? `↻ ${_escape(`${_to_text(label)}`)}` : ""}${_el_resume($scope8_id, "i")}</span></div>${_el_resume($scope8_id, "a")}`);
4610
+ writeScope($scope8_id, {});
4611
+ }, "window", $scope5_id, "h", 1, 1, 1, 0, 1);
4873
4612
  _if(() => {
4874
4613
  if (agent.note) {
4875
- const $scope8_id = _scope_id();
4876
- _html(`<p${_attr_class("_cl")}>${_escape(agent.note)}${_el_resume($scope8_id, "b")}</p>`);
4877
- writeScope($scope8_id, {});
4614
+ const $scope9_id = _scope_id();
4615
+ _html(`<p${_attr_class("_b4")}>${_escape(agent.note)}${_el_resume($scope9_id, "b")}</p>`);
4616
+ writeScope($scope9_id, {});
4878
4617
  return 0;
4879
4618
  }
4880
- }, $scope4_id, "i", 1, 1, 1, 0, 1);
4881
- _html(`</div>${_el_resume($scope4_id, "g")}</div>`);
4882
- writeScope($scope4_id, {
4619
+ }, $scope5_id, "i", 1, 1, 1, 0, 1);
4620
+ _html(`</div>${_el_resume($scope5_id, "g")}</div>`);
4621
+ writeScope($scope5_id, {
4883
4622
  m: agent?.plan,
4884
4623
  n: agent?.stale_seconds,
4885
4624
  o: agent?.note
@@ -4888,22 +4627,24 @@ var usage_stats_default = _template("x", (input) => {
4888
4627
  writeScope($scope2_id, {});
4889
4628
  return 2;
4890
4629
  }
4891
- }, $scope0_id, "k", 1, 1, 1, 0, 1);
4630
+ }, $scope0_id, "q", 1, 1, 1, 0, 1);
4892
4631
  _html("</div></div></div>");
4893
- _script($scope0_id, "x2");
4894
- _script($scope0_id, "x3");
4632
+ _script($scope0_id, "w3");
4633
+ _script($scope0_id, "w4");
4895
4634
  writeScope($scope0_id, {
4896
- m: usage?.error,
4897
- n: usage?.agents,
4898
- p: load,
4899
- q: refresh,
4635
+ t: _serialize_if($scope0_reason, 0) && input.preferred,
4636
+ u: input.preferredChange,
4637
+ y: usage?.error,
4638
+ z: usage?.agents,
4639
+ a1: load,
4640
+ a2: refresh,
4900
4641
  j: _existing_scope($childScope)
4901
4642
  });
4902
4643
  _resume_branch($scope0_id);
4903
4644
  });
4904
4645
  //#endregion
4905
4646
  //#region src/tags/term-find.marko
4906
- var term_find_default = _template("u", (input) => {
4647
+ var term_find_default = _template("t", (input) => {
4907
4648
  const $scope0_reason = _scope_reason();
4908
4649
  const $scope0_id = _scope_id();
4909
4650
  let open = input.open;
@@ -4920,35 +4661,35 @@ var term_find_default = _template("u", (input) => {
4920
4661
  if (!live.open) return;
4921
4662
  const search = input.onSearch;
4922
4663
  if (search) search(live.query, dir);
4923
- }, "u1", $scope0_id);
4664
+ }, "t1", $scope0_id);
4924
4665
  const close = _resume(() => {
4925
4666
  open = false;
4926
4667
  live.open = false;
4927
4668
  const clear = input.onClear;
4928
4669
  if (clear) clear();
4929
- }, "u2", $scope0_id);
4670
+ }, "t2", $scope0_id);
4930
4671
  const focusInput = _resume(() => {
4931
4672
  const el = ((findEl) => findEl())(_el_read_error);
4932
4673
  if (!el) return;
4933
4674
  el.focus();
4934
4675
  if (document.activeElement !== el) setTimeout(() => el.focus(), 0);
4935
- }, "u3", $scope0_id);
4676
+ }, "t3", $scope0_id);
4936
4677
  const hasQuery = !!query.trim();
4937
4678
  const canStep = hasQuery && open;
4938
4679
  const keybar = input.placement === "keybar";
4939
4680
  _html(`<div${_attr_class([
4940
- "_fb",
4941
- keybar ? "_fd" : "_fc",
4942
- !open && "_ff"
4943
- ])} aria-hidden=${open ? "false" : "true"}><div${_attr_class(["_e7", keybar ? "_fe" : "_e9"])}><input${_attr_input_value($scope0_id, "c", query, _resume(function(v) {
4681
+ "_eI",
4682
+ keybar ? "_eK" : "_eJ",
4683
+ !open && "_eM"
4684
+ ])} aria-hidden=${open ? "false" : "true"}><div${_attr_class(["_eD", keybar ? "_eL" : "_eF"])}><input${_attr_input_value($scope0_id, "c", query, _resume(function(v) {
4944
4685
  if (!open) return;
4945
4686
  query = v;
4946
4687
  live.query = v;
4947
4688
  run(0);
4948
- }, "u0", $scope0_id))}${_attr_class([findInput, keybar && "_fg"])} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in terminal" aria-label="Find in terminal">${_el_resume($scope0_id, "c")}<button type=button${_attr_class([findIconBtn, keybar && "_fh"])} title="Previous match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "d")}<button type=button${_attr_class([findIconBtn, keybar && "_fh"])} title="Next match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class([findIconBtn, keybar && "_fh"])} title="Close find" tabindex=${open ? "0" : "-1"}>×</button>${_el_resume($scope0_id, "f")}</div>${_el_resume($scope0_id, "b", _serialize_guard($scope0_reason, 2))}</div>${_el_resume($scope0_id, "a")}`);
4949
- _script($scope0_id, "u4");
4950
- _script($scope0_id, "u5");
4951
- _script($scope0_id, "u6");
4689
+ }, "t0", $scope0_id))}${_attr_class([findInput, keybar && "_eN"])} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in terminal" aria-label="Find in terminal">${_el_resume($scope0_id, "c")}<button type=button${_attr_class([findIconBtn, keybar && "_eO"])} title="Previous match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "d")}<button type=button${_attr_class([findIconBtn, keybar && "_eO"])} title="Next match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class([findIconBtn, keybar && "_eO"])} title="Close find" tabindex=${open ? "0" : "-1"}>×</button>${_el_resume($scope0_id, "f")}</div>${_el_resume($scope0_id, "b", _serialize_guard($scope0_reason, 2))}</div>${_el_resume($scope0_id, "a")}`);
4690
+ _script($scope0_id, "t4");
4691
+ _script($scope0_id, "t5");
4692
+ _script($scope0_id, "t6");
4952
4693
  writeScope($scope0_id, {
4953
4694
  i: _serialize_if($scope0_reason, 1) && input.open,
4954
4695
  j: _serialize_if($scope0_reason, 0) && input.openChange,
@@ -4971,7 +4712,7 @@ var term_find_default = _template("u", (input) => {
4971
4712
  });
4972
4713
  _resume_branch($scope0_id);
4973
4714
  });
4974
- _template("T", (input) => {
4715
+ _template("S", (input) => {
4975
4716
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
4976
4717
  const $scope0_id = _scope_id();
4977
4718
  _set_serialize_reason({
@@ -4986,7 +4727,7 @@ _template("T", (input) => {
4986
4727
  });
4987
4728
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
4988
4729
  });
4989
- _template("G", (input) => {
4730
+ _template("F", (input) => {
4990
4731
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
4991
4732
  const $scope0_id = _scope_id();
4992
4733
  _set_serialize_reason({
@@ -5001,7 +4742,7 @@ _template("G", (input) => {
5001
4742
  });
5002
4743
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
5003
4744
  });
5004
- _template("L", (input) => {
4745
+ _template("K", (input) => {
5005
4746
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
5006
4747
  const $scope0_id = _scope_id();
5007
4748
  _set_serialize_reason({
@@ -5016,7 +4757,7 @@ _template("L", (input) => {
5016
4757
  });
5017
4758
  _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
5018
4759
  });
5019
- _template("E", (input) => {
4760
+ _template("D", (input) => {
5020
4761
  const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
5021
4762
  const $scope0_id = _scope_id();
5022
4763
  _set_serialize_reason({
@@ -5035,7 +4776,7 @@ _template("E", (input) => {
5035
4776
  //#region src/tags/term.marko
5036
4777
  var REPEAT_DELAY = 400;
5037
4778
  var REPEAT_EVERY = 55;
5038
- var term_default = _template("v", (input) => {
4779
+ var term_default = _template("u", (input) => {
5039
4780
  const $scope0_reason = _scope_reason();
5040
4781
  _serialize_guard($scope0_reason, 4);
5041
4782
  _serialize_guard($scope0_reason, 0);
@@ -5052,7 +4793,7 @@ var term_default = _template("v", (input) => {
5052
4793
  _serialize_guard($scope0_reason, 12);
5053
4794
  const $si__input_sessionState = _serialize_if($scope0_reason, 5), $si__input_onCloseSession = _serialize_if($scope0_reason, 10), $si__input_sessionId = _serialize_if($scope0_reason, 7), $si__input_workspaceName = _serialize_if($scope0_reason, 12);
5054
4795
  const $scope0_id = _scope_id();
5055
- _hoist($scope0_id, "v20");
4796
+ _hoist($scope0_id, "u20");
5056
4797
  const $findOpen__closures = /* @__PURE__ */ new Set();
5057
4798
  const $findTick__closures = /* @__PURE__ */ new Set();
5058
4799
  const $input_onRenameSession__closures = /* @__PURE__ */ new Set();
@@ -5073,7 +4814,7 @@ var term_default = _template("v", (input) => {
5073
4814
  let findOpen = false;
5074
4815
  const $openChange = _resume((_new_findOpen) => {
5075
4816
  findOpen = _new_findOpen;
5076
- }, "v1", $scope0_id);
4817
+ }, "u1", $scope0_id);
5077
4818
  let findTick = 0;
5078
4819
  const ioBox = { current: null };
5079
4820
  const searchBox = {
@@ -5081,7 +4822,7 @@ var term_default = _template("v", (input) => {
5081
4822
  query: "",
5082
4823
  refreshTimer: 0
5083
4824
  };
5084
- const findFocusRef = { focus: _resume(function() {}, "v2") };
4825
+ const findFocusRef = { focus: _resume(function() {}, "u2") };
5085
4826
  const scheduleFindRefresh = _resume(() => {
5086
4827
  if (!searchBox.query.trim() || !searchBox.overlay) return;
5087
4828
  if (searchBox.refreshTimer) clearTimeout(searchBox.refreshTimer);
@@ -5089,7 +4830,7 @@ var term_default = _template("v", (input) => {
5089
4830
  searchBox.refreshTimer = 0;
5090
4831
  searchBox.overlay?.refresh();
5091
4832
  }, 32);
5092
- }, "v3", $scope0_id);
4833
+ }, "u3", $scope0_id);
5093
4834
  const runFind = _resume((query, dir) => {
5094
4835
  const overlay = searchBox.overlay;
5095
4836
  if (!overlay) return;
@@ -5103,7 +4844,7 @@ var term_default = _template("v", (input) => {
5103
4844
  return;
5104
4845
  }
5105
4846
  overlay.search(query, dir);
5106
- }, "v4", $scope0_id);
4847
+ }, "u4", $scope0_id);
5107
4848
  const clearFind = _resume(() => {
5108
4849
  if (searchBox.refreshTimer) {
5109
4850
  clearTimeout(searchBox.refreshTimer);
@@ -5111,7 +4852,7 @@ var term_default = _template("v", (input) => {
5111
4852
  }
5112
4853
  searchBox.query = "";
5113
4854
  searchBox.overlay?.clear();
5114
- }, "v5", $scope0_id);
4855
+ }, "u5", $scope0_id);
5115
4856
  const openFind = _resume(() => {
5116
4857
  if (kb) {
5117
4858
  kb = false;
@@ -5121,7 +4862,7 @@ var term_default = _template("v", (input) => {
5121
4862
  findOpen = true;
5122
4863
  findTick++;
5123
4864
  findFocusRef.focus();
5124
- }, "v6", $scope0_id);
4865
+ }, "u6", $scope0_id);
5125
4866
  const toggleFind = _resume(() => {
5126
4867
  if (findOpen) {
5127
4868
  findOpen = false;
@@ -5130,7 +4871,7 @@ var term_default = _template("v", (input) => {
5130
4871
  return;
5131
4872
  }
5132
4873
  openFind();
5133
- }, "v7", $scope0_id);
4874
+ }, "u7", $scope0_id);
5134
4875
  const onTermPage = input.mode == null || input.mode === "term";
5135
4876
  const canKeys = onTermPage || input.mode === "diff";
5136
4877
  const findLit = onTermPage ? findOpen : input.mode === "diff" && !!input.reviewFindOpen;
@@ -5141,7 +4882,7 @@ var term_default = _template("v", (input) => {
5141
4882
  return;
5142
4883
  }
5143
4884
  if (input.mode === "diff") input.onToggleReviewFind?.();
5144
- }, "v8", $scope0_id);
4885
+ }, "u8", $scope0_id);
5145
4886
  const thisAgent = activeAgent({
5146
4887
  agent: input.agent || "shell",
5147
4888
  state: input.sessionState
@@ -5153,7 +4894,7 @@ var term_default = _template("v", (input) => {
5153
4894
  copyFlashBox.timer = setTimeout(() => {
5154
4895
  copiedFlash = false;
5155
4896
  }, 1200);
5156
- }, "v9", $scope0_id);
4897
+ }, "u9", $scope0_id);
5157
4898
  const holdBox = { current: null };
5158
4899
  const startHold = _resume((seq) => {
5159
4900
  ((stopHold) => stopHold())(_hoist_read_error);
@@ -5163,7 +4904,7 @@ var term_default = _template("v", (input) => {
5163
4904
  state.repeat = setInterval(() => ioBox.current?.send(seq), REPEAT_EVERY);
5164
4905
  }, REPEAT_DELAY);
5165
4906
  holdBox.current = state;
5166
- }, "v10", $scope0_id);
4907
+ }, "u10", $scope0_id);
5167
4908
  const stopHold = _resume(() => {
5168
4909
  const hold = holdBox.current;
5169
4910
  if (hold) {
@@ -5171,7 +4912,7 @@ var term_default = _template("v", (input) => {
5171
4912
  clearInterval(hold.repeat);
5172
4913
  holdBox.current = null;
5173
4914
  }
5174
- }, "v11", $scope0_id);
4915
+ }, "u11", $scope0_id);
5175
4916
  const uploadAsset = _resume(async (file) => {
5176
4917
  if (!file) return;
5177
4918
  uploading = true;
@@ -5184,7 +4925,7 @@ var term_default = _template("v", (input) => {
5184
4925
  } finally {
5185
4926
  uploading = false;
5186
4927
  }
5187
- }, "v12", $scope0_id);
4928
+ }, "u12", $scope0_id);
5188
4929
  const handlePasted = _resume(async (clipboardData) => {
5189
4930
  const files = [...clipboardData?.files || []];
5190
4931
  for (const file of files) await uploadAsset(file);
@@ -5193,7 +4934,7 @@ var term_default = _template("v", (input) => {
5193
4934
  if (text) ioBox.current?.send(text);
5194
4935
  }
5195
4936
  trapOpen = false;
5196
- }, "v13", $scope0_id);
4937
+ }, "u13", $scope0_id);
5197
4938
  const pasteClipboard = _resume(async () => {
5198
4939
  if (!navigator.clipboard?.read) {
5199
4940
  trapOpen = true;
@@ -5213,8 +4954,8 @@ var term_default = _template("v", (input) => {
5213
4954
  } catch {
5214
4955
  trapOpen = true;
5215
4956
  }
5216
- }, "v14", $scope0_id);
5217
- _html(`<div${_attr("hidden", !onTermPage)}${_attr_class("_dp")}><div${_attr_class("_dq")}></div>${_el_resume($scope0_id, "b")}`);
4957
+ }, "u14", $scope0_id);
4958
+ _html(`<div${_attr("hidden", !onTermPage)}${_attr_class("_c9")}><div${_attr_class("_c_")}></div>${_el_resume($scope0_id, "b")}`);
5218
4959
  _if(() => {
5219
4960
  if (findOpen) {
5220
4961
  const $scope11_id = _scope_id();
@@ -5228,11 +4969,11 @@ var term_default = _template("v", (input) => {
5228
4969
  focusRef: findFocusRef,
5229
4970
  onSearch: _resume(function(q, dir) {
5230
4971
  runFind(q, dir);
5231
- }, "v15", $scope11_id),
4972
+ }, "u15", $scope11_id),
5232
4973
  onClear: _resume(function() {
5233
4974
  clearFind();
5234
4975
  ioBox.current?.setFindMode(false);
5235
- }, "v16", $scope11_id)
4976
+ }, "u16", $scope11_id)
5236
4977
  });
5237
4978
  writeScope($scope11_id, { a: _existing_scope($childScope) });
5238
4979
  return 0;
@@ -5241,7 +4982,7 @@ var term_default = _template("v", (input) => {
5241
4982
  _if(() => {
5242
4983
  if (uploading) {
5243
4984
  const $scope18_id = _scope_id();
5244
- _html(`<div${_attr_class("_du")}>uploading…</div>`);
4985
+ _html(`<div${_attr_class("_dd")}>uploading…</div>`);
5245
4986
  writeScope($scope18_id, {});
5246
4987
  return 0;
5247
4988
  }
@@ -5249,7 +4990,7 @@ var term_default = _template("v", (input) => {
5249
4990
  _if(() => {
5250
4991
  if (copiedFlash) {
5251
4992
  const $scope19_id = _scope_id();
5252
- _html(`<div${_attr_class("_dt")}>Copied</div>`);
4993
+ _html(`<div${_attr_class("_dc")}>Copied</div>`);
5253
4994
  writeScope($scope19_id, {});
5254
4995
  return 0;
5255
4996
  }
@@ -5258,18 +4999,18 @@ var term_default = _template("v", (input) => {
5258
4999
  _if(() => {
5259
5000
  if (trapOpen) {
5260
5001
  const $scope10_id = _scope_id();
5261
- _html(`<div${_attr_class("_dv")}><div${_attr_class("_dw")}><p${_attr_class("_d0")}>Long-press below and choose Paste</p><input placeholder="Paste here…">${_el_resume($scope10_id, "d")}<button${_attr_class("_f")}>Cancel</button>${_el_resume($scope10_id, "e")}</div>${_el_resume($scope10_id, "b")}</div>${_el_resume($scope10_id, "a")}`);
5262
- _script($scope10_id, "v23");
5263
- _script($scope10_id, "v24");
5002
+ _html(`<div${_attr_class("_de")}><div${_attr_class("_df")}><p${_attr_class("_dJ")}>Long-press below and choose Paste</p><input placeholder="Paste here…">${_el_resume($scope10_id, "d")}<button${_attr_class("_h")}>Cancel</button>${_el_resume($scope10_id, "e")}</div>${_el_resume($scope10_id, "b")}</div>${_el_resume($scope10_id, "a")}`);
5003
+ _script($scope10_id, "u23");
5004
+ _script($scope10_id, "u24");
5264
5005
  writeScope($scope10_id, {});
5265
5006
  return 0;
5266
5007
  }
5267
5008
  }, $scope0_id, "g", 1, 1, 1, 0, 1);
5268
5009
  _html(`</div>${_el_resume($scope0_id, "a")}`);
5269
5010
  _if(() => {}, $scope0_id, "h", 1, 1, 1, 0, 1);
5270
- _script($scope0_id, "v39");
5271
- _script($scope0_id, "v40");
5272
- _script($scope0_id, "v41");
5011
+ _script($scope0_id, "u39");
5012
+ _script($scope0_id, "u40");
5013
+ _script($scope0_id, "u41");
5273
5014
  writeScope($scope0_id, {
5274
5015
  k: input.mode,
5275
5016
  l: input.reviewFindOpen,
@@ -5338,8 +5079,8 @@ var term_default = _template("v", (input) => {
5338
5079
  //#region src/tags/work-view.marko
5339
5080
  var api$1;
5340
5081
  var isTransientApiError$1;
5341
- var work_view_default = _template("y", (input) => {
5342
- const $scope0_reason = _scope_reason(), $sg__input_allWorkspaces = _serialize_guard($scope0_reason, 7), $sg__input_agents = _serialize_guard($scope0_reason, 8), $sg__input_workspace = _serialize_guard($scope0_reason, 3), $si__input_workspace = _serialize_if($scope0_reason, 3), $si__input_active = _serialize_if($scope0_reason, 5), $si__input_agents = _serialize_if($scope0_reason, 8), $si__input_preferred = _serialize_if($scope0_reason, 6);
5082
+ var work_view_default = _template("x", (input) => {
5083
+ const $scope0_reason = _scope_reason(), $sg__input_agents = _serialize_guard($scope0_reason, 9), $sg__input_allWorkspaces = _serialize_guard($scope0_reason, 8), $sg__input_workspace = _serialize_guard($scope0_reason, 4), $si__input_workspace = _serialize_if($scope0_reason, 4), $si__input_active = _serialize_if($scope0_reason, 6), $si__input_agents = _serialize_if($scope0_reason, 9), $si__input_preferred = _serialize_if($scope0_reason, 7);
5343
5084
  const $scope0_id = _scope_id();
5344
5085
  const $error__closures = /* @__PURE__ */ new Set();
5345
5086
  const $input_active__closures = /* @__PURE__ */ new Set();
@@ -5363,15 +5104,15 @@ var work_view_default = _template("y", (input) => {
5363
5104
  let DiffView = null;
5364
5105
  const loadDiffView = _resume(() => {
5365
5106
  if (DiffView) return;
5366
- import("./_DncwyiYL.js").then((m) => {
5107
+ import("./_o0dwm0Ww.js").then((m) => {
5367
5108
  DiffView = m.default;
5368
5109
  });
5369
- }, "y4", $scope0_id);
5110
+ }, "x4", $scope0_id);
5370
5111
  let manageMounted = false;
5371
5112
  let usageMounted = false;
5372
5113
  let reviewFindOpen = false;
5373
5114
  let reviewFindTick = 0;
5374
- const reviewFindFocus = { focus: _resume(function() {}, "y0") };
5115
+ const reviewFindFocus = { focus: _resume(function() {}, "x0") };
5375
5116
  let focusPr = "";
5376
5117
  let focusNonce = 0;
5377
5118
  let error = null;
@@ -5383,30 +5124,30 @@ var work_view_default = _template("y", (input) => {
5383
5124
  loadDiffView();
5384
5125
  diffMounted = true;
5385
5126
  view = "diff";
5386
- }, "y5", $scope0_id);
5127
+ }, "x5", $scope0_id);
5387
5128
  const openManage = _resume(() => {
5388
5129
  manageMounted = true;
5389
5130
  view = "manage";
5390
- }, "y6", $scope0_id);
5131
+ }, "x6", $scope0_id);
5391
5132
  const openUsage = _resume(() => {
5392
5133
  usageMounted = true;
5393
5134
  view = "usage";
5394
- }, "y7", $scope0_id);
5135
+ }, "x7", $scope0_id);
5395
5136
  const toggleUsage = _resume(() => {
5396
5137
  if (view === "usage") view = "term";
5397
5138
  else openUsage();
5398
- }, "y8", $scope0_id);
5139
+ }, "x8", $scope0_id);
5399
5140
  const toggleNav = _resume(() => {
5400
5141
  view = view === "nav" ? "term" : "nav";
5401
- }, "y9", $scope0_id);
5142
+ }, "x9", $scope0_id);
5402
5143
  const toggleManage = _resume(() => {
5403
5144
  if (view === "manage") view = "term";
5404
5145
  else openManage();
5405
- }, "y10", $scope0_id);
5146
+ }, "x10", $scope0_id);
5406
5147
  const toggleDiff = _resume(() => {
5407
5148
  if (view === "diff") view = "term";
5408
5149
  else openDiff();
5409
- }, "y11", $scope0_id);
5150
+ }, "x11", $scope0_id);
5410
5151
  const shownSessions = sessions ?? input.allStatus?.[ws.id]?.sessions ?? null;
5411
5152
  const curTab = (() => {
5412
5153
  if (tab && shownSessions?.some((s) => s.id === tab)) return tab;
@@ -5423,10 +5164,10 @@ var work_view_default = _template("y", (input) => {
5423
5164
  reviewFindOpen = true;
5424
5165
  reviewFindTick++;
5425
5166
  reviewFindFocus.focus();
5426
- }, "y12", $scope0_id);
5167
+ }, "x12", $scope0_id);
5427
5168
  const exitCreate = _resume(() => {
5428
5169
  if (view === "new") view = "term";
5429
- }, "y13", $scope0_id);
5170
+ }, "x13", $scope0_id);
5430
5171
  const createSession = _resume(async (agent, select) => {
5431
5172
  spawning = true;
5432
5173
  try {
@@ -5447,7 +5188,7 @@ var work_view_default = _template("y", (input) => {
5447
5188
  } finally {
5448
5189
  spawning = false;
5449
5190
  }
5450
- }, "y14", $scope0_id);
5191
+ }, "x14", $scope0_id);
5451
5192
  const loadMem = {
5452
5193
  wanted: false,
5453
5194
  run: void 0
@@ -5458,11 +5199,12 @@ var work_view_default = _template("y", (input) => {
5458
5199
  try {
5459
5200
  const url = `/api/workspaces/${ws.id}/sessions`;
5460
5201
  let list = await api$1(url);
5461
- if (!list.length && autoCreate && ws.status === "active") list = await api$1(url);
5462
- if (!list.length && autoCreate && ws.status === "active") {
5202
+ if (!list.length && autoCreate && sessions == null && ws.status === "active") list = await api$1(url);
5203
+ if (!list.length && autoCreate && sessions == null && ws.status === "active") {
5463
5204
  await createSession(input.preferred || "claude", false);
5464
5205
  list = await api$1(url).catch(() => sessions || []);
5465
5206
  }
5207
+ if (sessions != null && sessions.length === 0 && list.length) list = await api$1(url).catch(() => []);
5466
5208
  sessions = list;
5467
5209
  const saved = workspaceTab(ws.id);
5468
5210
  if (saved && list.some((s) => s.id === saved)) tab = saved;
@@ -5472,20 +5214,21 @@ var work_view_default = _template("y", (input) => {
5472
5214
  if (isTransientApiError$1(err)) return;
5473
5215
  error = String(err.message || err);
5474
5216
  }
5475
- }, "y15", $scope0_id);
5217
+ }, "x15", $scope0_id);
5476
5218
  const loadSessions = _resume((autoCreate) => {
5477
5219
  if (autoCreate) loadMem.wanted = true;
5478
5220
  return (loadMem.run ??= coalesce(loadBody))();
5479
- }, "y16", $scope0_id);
5221
+ }, "x16", $scope0_id);
5480
5222
  const closeSession = _resume(async (id) => {
5481
5223
  try {
5482
- await api$1(`/api/sessions/${id}`, { method: "DELETE" });
5483
5224
  sessions = (sessions || []).filter((s) => s.id !== id);
5484
5225
  if (tab === id) tab = sessions[0]?.id || null;
5226
+ await api$1(`/api/sessions/${id}`, { method: "DELETE" });
5485
5227
  } catch (err) {
5486
5228
  error = `Kill session failed: ${String(err.message || err)}`;
5229
+ loadSessions(false);
5487
5230
  }
5488
- }, "y17", $scope0_id);
5231
+ }, "x17", $scope0_id);
5489
5232
  const renameSession = _resume(async (id, title) => {
5490
5233
  title = title.trim();
5491
5234
  if (!title) return;
@@ -5498,7 +5241,7 @@ var work_view_default = _template("y", (input) => {
5498
5241
  headers: { "content-type": "application/json" },
5499
5242
  body: JSON.stringify({ title })
5500
5243
  });
5501
- }, "y18", $scope0_id);
5244
+ }, "x18", $scope0_id);
5502
5245
  const newSession = _resume(async (wsId, agent) => {
5503
5246
  if (wsId === ws.id) {
5504
5247
  const session = await createSession(agent, true);
@@ -5516,16 +5259,16 @@ var work_view_default = _template("y", (input) => {
5516
5259
  } catch (err) {
5517
5260
  error = String(err.message || err);
5518
5261
  }
5519
- }, "y19", $scope0_id);
5520
- _html(`<div${_attr_class(["_bP", { ["_bO"]: view === "nav" }])}><div${_attr_class("_bQ")}>`);
5262
+ }, "x19", $scope0_id);
5263
+ _html(`<div${_attr_class(["_br", { ["_bq"]: view === "nav" }])}><div${_attr_class("_bs")}>`);
5521
5264
  _set_serialize_reason({
5522
5265
  0: _serialize_guard($scope0_reason, 0),
5523
- 1: _serialize_guard($scope0_reason, 2),
5266
+ 1: _serialize_guard($scope0_reason, 1),
5524
5267
  2: $sg__input_workspace,
5525
5268
  3: 1,
5526
5269
  5: 1,
5527
5270
  7: $sg__input_allWorkspaces,
5528
- 8: _serialize_guard($scope0_reason, 4),
5271
+ 8: _serialize_guard($scope0_reason, 5),
5529
5272
  9: 1,
5530
5273
  10: $sg__input_agents,
5531
5274
  11: 1,
@@ -5541,62 +5284,62 @@ var work_view_default = _template("y", (input) => {
5541
5284
  tab: curTab,
5542
5285
  tabChange: _resume(function(id) {
5543
5286
  tab = id;
5544
- }, "y20", $scope0_id),
5287
+ }, "x20", $scope0_id),
5545
5288
  view,
5546
5289
  viewChange: _resume((_new_view) => {
5547
5290
  view = _new_view;
5548
- }, "y21", $scope0_id),
5291
+ }, "x21", $scope0_id),
5549
5292
  allWorkspaces: input.allWorkspaces,
5550
5293
  allStatus: input.allStatus,
5551
5294
  agents: input.agents,
5552
5295
  onError: _resume(function(message) {
5553
5296
  error = message;
5554
- }, "y22", $scope0_id),
5297
+ }, "x22", $scope0_id),
5555
5298
  onSelectWorkspace: _resume(function(id) {
5556
5299
  exitCreate();
5557
5300
  input.onSelectWorkspace?.(id);
5558
- }, "y23", $scope0_id),
5301
+ }, "x23", $scope0_id),
5559
5302
  onOpenSession: _resume(function(wsId, sessionId) {
5560
5303
  exitCreate();
5561
5304
  input.onOpenSession?.(wsId, sessionId);
5562
- }, "y24", $scope0_id),
5305
+ }, "x24", $scope0_id),
5563
5306
  onManage: _resume(function(id) {
5564
5307
  exitCreate();
5565
5308
  if (!id || id === ws.id) toggleManage();
5566
5309
  else input.onManage?.(id);
5567
- }, "y25", $scope0_id),
5310
+ }, "x25", $scope0_id),
5568
5311
  onNew: _resume(function() {
5569
5312
  if (view === "new") exitCreate();
5570
5313
  else input.onNew?.();
5571
- }, "y26", $scope0_id),
5314
+ }, "x26", $scope0_id),
5572
5315
  onUsage: _resume(function() {
5573
5316
  exitCreate();
5574
5317
  toggleUsage();
5575
- }, "y27", $scope0_id),
5318
+ }, "x27", $scope0_id),
5576
5319
  onNewSession: _resume(function(wsId, agent) {
5577
5320
  exitCreate();
5578
5321
  newSession(wsId, agent);
5579
- }, "y28", $scope0_id),
5322
+ }, "x28", $scope0_id),
5580
5323
  onCloseSession: _resume(function(id) {
5581
5324
  closeSession(id);
5582
- }, "y29", $scope0_id),
5325
+ }, "x29", $scope0_id),
5583
5326
  onRenameSession: _resume(function(s, title) {
5584
5327
  renameSession(s.id, title);
5585
- }, "y30", $scope0_id),
5328
+ }, "x30", $scope0_id),
5586
5329
  onReviewOpened: _resume(function(pr) {
5587
5330
  exitCreate();
5588
5331
  openDiff(pr);
5589
- }, "y31", $scope0_id)
5332
+ }, "x31", $scope0_id)
5590
5333
  });
5591
- _html(`</div><div${_attr_class("_bR")}>`);
5334
+ _html(`</div><div${_attr_class("_bt")}>`);
5592
5335
  _if(() => {
5593
5336
  if (error) {
5594
5337
  const $scope8_id = _scope_id();
5595
5338
  toast_default({
5596
5339
  onDismiss: _resume(function() {
5597
5340
  error = null;
5598
- }, "y32", $scope8_id),
5599
- content: _content_resume("y47", () => {
5341
+ }, "x32", $scope8_id),
5342
+ content: _content_resume("x48", () => {
5600
5343
  _scope_reason();
5601
5344
  const $scope9_id = _scope_id();
5602
5345
  _html(`${_escape(error)}${_el_resume($scope9_id, "a")}`);
@@ -5624,16 +5367,16 @@ var work_view_default = _template("y", (input) => {
5624
5367
  findOpen: reviewFindOpen,
5625
5368
  findOpenChange: _resume((_new_reviewFindOpen) => {
5626
5369
  reviewFindOpen = _new_reviewFindOpen;
5627
- }, "y1", $scope1_id),
5370
+ }, "x1", $scope1_id),
5628
5371
  findTick: reviewFindTick,
5629
5372
  findFocusRef: reviewFindFocus,
5630
5373
  onSent: _resume(function(sessionId) {
5631
5374
  tab = sessionId;
5632
5375
  view = "term";
5633
- }, "y2", $scope1_id),
5376
+ }, "x2", $scope1_id),
5634
5377
  onExit: _resume(function() {
5635
5378
  view = "term";
5636
- }, "y3", $scope1_id)
5379
+ }, "x3", $scope1_id)
5637
5380
  });
5638
5381
  _show_end($scope1_id, "d", $show);
5639
5382
  writeScope($scope1_id, {});
@@ -5645,42 +5388,52 @@ var work_view_default = _template("y", (input) => {
5645
5388
  const $scope2_id = _scope_id();
5646
5389
  const $show2 = view === "manage";
5647
5390
  _show_start($show2, 1);
5648
- _set_serialize_reason(_serialize_guard($scope0_reason, 9));
5391
+ _set_serialize_reason(_serialize_guard($scope0_reason, 10));
5649
5392
  const $childScope2 = _peek_scope_id();
5650
5393
  manage_workspace_default({
5651
5394
  workspace: ws,
5652
5395
  workspaceChange: _resume(function(next) {
5653
5396
  input.onWorkspaceChange?.(next);
5654
- }, "y33", $scope2_id),
5655
- onExit: _resume(function() {
5656
- view = "term";
5657
- }, "y34", $scope2_id)
5397
+ }, "x33", $scope2_id),
5398
+ onDeleted: _resume(function() {
5399
+ input.onWorkspaceDeleted?.(ws.id);
5400
+ }, "x34", $scope2_id)
5658
5401
  });
5659
5402
  _show_end($scope2_id, "d", $show2);
5660
- writeScope($scope2_id, { b: _serialize_if($scope0_reason, 1) && _existing_scope($childScope2) });
5403
+ writeScope($scope2_id, { b: _serialize_if($scope0_reason, 2) && _existing_scope($childScope2) });
5661
5404
  return 0;
5662
5405
  }
5663
5406
  }, $scope0_id, "g");
5664
5407
  _if(() => {
5665
5408
  if (usageMounted) {
5666
- const $scope7_id = _scope_id();
5409
+ const $scope3_id = _scope_id();
5667
5410
  const $show3 = view === "usage";
5668
5411
  _show_start($show3, 1);
5669
- usage_stats_default({});
5670
- _show_end($scope7_id, "d", $show3);
5671
- writeScope($scope7_id, {});
5412
+ _set_serialize_reason({
5413
+ 0: _serialize_guard($scope0_reason, 11),
5414
+ 1: $sg__input_agents
5415
+ });
5416
+ const $childScope3 = _peek_scope_id();
5417
+ usage_stats_default({
5418
+ preferred: input.preferred,
5419
+ agents: input.agents,
5420
+ preferredChange: _resume(function(agent) {
5421
+ input.onPreferredChange?.(agent);
5422
+ }, "x35", $scope3_id)
5423
+ });
5424
+ _show_end($scope3_id, "d", $show3);
5425
+ writeScope($scope3_id, { b: _serialize_if($scope0_reason, 3) && _existing_scope($childScope3) });
5672
5426
  return 0;
5673
5427
  }
5674
5428
  }, $scope0_id, "h");
5675
5429
  _if(() => {}, $scope0_id, "i");
5676
- _html(`<div${_attr_class(["_bT", { ["_bS"]: view !== "term" }])}>`);
5430
+ _html(`<div${_attr_class(["_bv", { ["_bu"]: view !== "term" }])}>`);
5677
5431
  _if(() => {
5678
5432
  if (shownSessions) {
5679
- const $scope4_id = _scope_id();
5433
+ const $scope5_id = _scope_id();
5680
5434
  _for_of(shownSessions, (s) => {
5681
- const $scope5_id = _scope_id();
5682
- const $show5 = s.id === curTab;
5683
- _show_start($show5, 1);
5435
+ const $scope6_id = _scope_id();
5436
+ _html(`<div${_attr_class(["_bw", { ["_bx"]: s.id === curTab }])}>`);
5684
5437
  _set_serialize_reason({
5685
5438
  0: 1,
5686
5439
  1: 1,
@@ -5696,7 +5449,7 @@ var work_view_default = _template("y", (input) => {
5696
5449
  11: $sg__input_agents,
5697
5450
  12: $sg__input_workspace
5698
5451
  });
5699
- const $childScope4 = _peek_scope_id();
5452
+ const $childScope5 = _peek_scope_id();
5700
5453
  term_default({
5701
5454
  sessionId: s.id,
5702
5455
  workspaceId: ws.id,
@@ -5708,68 +5461,68 @@ var work_view_default = _template("y", (input) => {
5708
5461
  onNewSession: _resume(function(agent) {
5709
5462
  view = "term";
5710
5463
  newSession(ws.id, agent);
5711
- }, "y38", $scope5_id),
5464
+ }, "x39", $scope6_id),
5712
5465
  onOpenTab: _resume(function(id) {
5713
5466
  tab = id;
5714
5467
  view = "term";
5715
- }, "y39", $scope5_id),
5468
+ }, "x40", $scope6_id),
5716
5469
  onCloseSession: _resume(function(id) {
5717
5470
  closeSession(id);
5718
- }, "y40", $scope5_id),
5471
+ }, "x41", $scope6_id),
5719
5472
  onRenameSession: _resume(function(id, title) {
5720
5473
  renameSession(id, title);
5721
- }, "y41", $scope5_id),
5474
+ }, "x42", $scope6_id),
5722
5475
  active: input.active && view === "term" && s.id === curTab,
5723
5476
  mode: view,
5724
5477
  onToggleDiff: _resume(function() {
5725
5478
  toggleDiff();
5726
- }, "y42", $scope5_id),
5479
+ }, "x43", $scope6_id),
5727
5480
  onExitReview: _resume(function() {
5728
5481
  view = "term";
5729
- }, "y43", $scope5_id),
5482
+ }, "x44", $scope6_id),
5730
5483
  onOpenNav: _resume(function() {
5731
5484
  toggleNav();
5732
- }, "y44", $scope5_id),
5485
+ }, "x45", $scope6_id),
5733
5486
  onManage: _resume(function() {
5734
5487
  toggleManage();
5735
- }, "y45", $scope5_id),
5488
+ }, "x46", $scope6_id),
5736
5489
  reviewFindOpen,
5737
5490
  onToggleReviewFind: _resume(function() {
5738
5491
  toggleReviewFind();
5739
- }, "y46", $scope5_id)
5492
+ }, "x47", $scope6_id)
5740
5493
  });
5741
- _show_end($scope5_id, "d", $show5);
5742
- _subscribe($newSession2__closures, _subscribe($renameSession2__closures, _subscribe($closeSession2__closures, _subscribe($toggleReviewFind2__closures, _subscribe($curTab__closures, _subscribe($shownSessions__closures, _subscribe($si__input_workspace && $ws_name__closures, _subscribe($si__input_workspace && $ws_id__closures, _subscribe($reviewFindOpen__closures, _subscribe($view__closures, _subscribe($si__input_agents && $input_agents__closures, _subscribe($si__input_active && $input_active__closures, writeScope($scope5_id, {
5743
- g: s?.id,
5744
- b: _existing_scope($childScope4)
5494
+ _html(`</div>${_el_resume($scope6_id, "a")}`);
5495
+ _subscribe($newSession2__closures, _subscribe($renameSession2__closures, _subscribe($closeSession2__closures, _subscribe($toggleReviewFind2__closures, _subscribe($curTab__closures, _subscribe($shownSessions__closures, _subscribe($si__input_workspace && $ws_name__closures, _subscribe($si__input_workspace && $ws_id__closures, _subscribe($reviewFindOpen__closures, _subscribe($view__closures, _subscribe($si__input_agents && $input_agents__closures, _subscribe($si__input_active && $input_active__closures, writeScope($scope6_id, {
5496
+ e: s?.id,
5497
+ b: _existing_scope($childScope5)
5745
5498
  })))))))))))));
5746
- }, "id", $scope4_id, "a");
5499
+ }, "id", $scope5_id, "a", 1, 1, 1, 0, 1);
5747
5500
  _if(() => {
5748
- if (!shownSessions.length) {
5749
- const $scope6_id = _scope_id();
5750
- _html(`<div${_attr_class("_bV")}><p${_attr_class("_bW")}>No sessions in this workspace.</p><button${_attr_class(["_f", "_g"])}${_attr("disabled", spawning)}>${spawning ? "Starting…" : `Start ${_escape(`${input.preferred || "claude"}`)}`}${_el_resume($scope6_id, "d")}</button>${_el_resume($scope6_id, "c")}</div>`);
5751
- _script($scope6_id, "y48");
5752
- _subscribe($spawning__closures, _subscribe($si__input_preferred && $input_preferred__closures, writeScope($scope6_id, {})));
5501
+ if (!shownSessions.length && view === "term") {
5502
+ const $scope7_id = _scope_id();
5503
+ _html(`<div${_attr_class("_bz")}><p${_attr_class("_bA")}>No sessions in this workspace.</p><button${_attr_class(["_h", "_i"])}${_attr("disabled", spawning)}>${spawning ? "Starting…" : `Start ${_escape(`${input.preferred || "claude"}`)}`}${_el_resume($scope7_id, "d")}</button>${_el_resume($scope7_id, "c")}</div>`);
5504
+ _script($scope7_id, "x49");
5505
+ _subscribe($spawning__closures, _subscribe($si__input_preferred && $input_preferred__closures, writeScope($scope7_id, {})));
5753
5506
  return 0;
5754
5507
  }
5755
- }, $scope4_id, "b", 1, 1, 1, 0, 1);
5756
- writeScope($scope4_id, {});
5508
+ }, $scope5_id, "b", 1, 1, 1, 0, 1);
5509
+ writeScope($scope5_id, {});
5757
5510
  return 0;
5758
5511
  } else {
5759
5512
  const $scope10_id = _scope_id();
5760
- _html(`<p${_attr_class("_bU")}>Loading sessions…</p>`);
5513
+ _html(`<p${_attr_class("_by")}>Loading sessions…</p>`);
5761
5514
  writeScope($scope10_id, {});
5762
5515
  return 1;
5763
5516
  }
5764
5517
  }, $scope0_id, "j", 1, 1, 1, "</div>");
5765
5518
  _html(`</div></div>${_el_resume($scope0_id, "a")}`);
5766
- _script($scope0_id, "y49");
5767
- _script($scope0_id, "y50");
5768
- _script($scope0_id, "y51");
5769
- _script($scope0_id, "y52");
5770
- _script($scope0_id, "y53");
5771
- _script($scope0_id, "y54");
5772
- _script($scope0_id, "y55");
5519
+ _script($scope0_id, "x50");
5520
+ _script($scope0_id, "x51");
5521
+ _script($scope0_id, "x52");
5522
+ _script($scope0_id, "x53");
5523
+ _script($scope0_id, "x54");
5524
+ _script($scope0_id, "x55");
5525
+ _script($scope0_id, "x56");
5773
5526
  writeScope($scope0_id, {
5774
5527
  n: input.allStatus,
5775
5528
  o: input.active,
@@ -5783,62 +5536,64 @@ var work_view_default = _template("y", (input) => {
5783
5536
  w: input.onManage,
5784
5537
  x: input.onNew,
5785
5538
  y: input.onWorkspaceChange,
5786
- z: input.onCreated,
5787
- a0: sessions,
5788
- a1: tab,
5789
- a3: view,
5790
- a5: diffMounted,
5791
- a6: DiffView,
5792
- a8: loadDiffView,
5793
- ac: reviewFindOpen,
5794
- ae: reviewFindTick,
5795
- af: reviewFindFocus,
5796
- ah: focusPr,
5797
- ai: focusNonce,
5798
- ak: error,
5799
- al: spawning,
5800
- am: ws,
5801
- an: ws?.id,
5802
- ar: ws?.status,
5803
- as: ws?.branch,
5804
- at: ws?.name,
5805
- au: openDiff,
5806
- aw: openManage,
5807
- az: openUsage,
5808
- b1: toggleUsage,
5809
- b2: toggleNav,
5810
- b3: toggleManage,
5811
- b4: toggleDiff,
5812
- b5: shownSessions,
5813
- b7: shownSessions?.length,
5814
- b8: curTab,
5815
- ba: createGate.open,
5816
- bc: toggleReviewFind,
5817
- bd: exitCreate,
5818
- bg: createSession,
5819
- bj: loadMem.wanted,
5820
- bl: loadMem.run,
5821
- bm: loadBody,
5822
- bo: loadSessions,
5823
- bq: closeSession,
5824
- br: renameSession,
5825
- bs: newSession,
5539
+ z: input.onWorkspaceDeleted,
5540
+ a0: input.onPreferredChange,
5541
+ a1: input.onCreated,
5542
+ a2: sessions,
5543
+ a3: tab,
5544
+ a4: view,
5545
+ a6: diffMounted,
5546
+ a7: DiffView,
5547
+ a9: loadDiffView,
5548
+ ad: reviewFindOpen,
5549
+ af: reviewFindTick,
5550
+ ag: reviewFindFocus,
5551
+ ai: focusPr,
5552
+ aj: focusNonce,
5553
+ al: error,
5554
+ am: spawning,
5555
+ an: ws,
5556
+ ao: ws?.id,
5557
+ as: ws?.status,
5558
+ at: ws?.branch,
5559
+ au: ws?.name,
5560
+ av: openDiff,
5561
+ ax: openManage,
5562
+ b0: openUsage,
5563
+ b2: toggleUsage,
5564
+ b3: toggleNav,
5565
+ b4: toggleManage,
5566
+ b5: toggleDiff,
5567
+ b6: shownSessions,
5568
+ b8: shownSessions?.length,
5569
+ b9: curTab,
5570
+ bb: createGate.open,
5571
+ bd: toggleReviewFind,
5572
+ be: exitCreate,
5573
+ bh: createSession,
5574
+ bk: loadMem.wanted,
5575
+ bm: loadMem.run,
5576
+ bn: loadBody,
5577
+ bp: loadSessions,
5578
+ bs: closeSession,
5579
+ bt: renameSession,
5580
+ bu: newSession,
5826
5581
  c: _existing_scope($childScope),
5827
- c8: $error__closures,
5828
- bu: $si__input_active && $input_active__closures,
5829
- by: $si__input_agents && $input_agents__closures,
5830
- c1: $view__closures,
5831
- c3: $reviewFindOpen__closures,
5832
- cb: $si__input_workspace && $ws_id__closures,
5833
- cd: $si__input_workspace && $ws_name__closures,
5834
- ce: $shownSessions__closures,
5835
- cg: $curTab__closures,
5836
- ch: $toggleReviewFind2__closures,
5837
- cj: $closeSession2__closures,
5838
- ck: $renameSession2__closures,
5839
- cl: $newSession2__closures,
5840
- bv: $si__input_preferred && $input_preferred__closures,
5841
- c9: $spawning__closures
5582
+ cc: $error__closures,
5583
+ bw: $si__input_active && $input_active__closures,
5584
+ c0: $si__input_agents && $input_agents__closures,
5585
+ c5: $view__closures,
5586
+ c7: $reviewFindOpen__closures,
5587
+ cf: $si__input_workspace && $ws_id__closures,
5588
+ ch: $si__input_workspace && $ws_name__closures,
5589
+ ci: $shownSessions__closures,
5590
+ ck: $curTab__closures,
5591
+ cl: $toggleReviewFind2__closures,
5592
+ cn: $closeSession2__closures,
5593
+ co: $renameSession2__closures,
5594
+ cp: $newSession2__closures,
5595
+ bx: $si__input_preferred && $input_preferred__closures,
5596
+ cd: $spawning__closures
5842
5597
  });
5843
5598
  _resume_branch($scope0_id);
5844
5599
  });
@@ -5863,17 +5618,25 @@ var page_boot_default = _template("n", (input) => {
5863
5618
  let status = boot.status;
5864
5619
  let settings = boot.settings;
5865
5620
  const last = boot.prefs["last-workspace"];
5866
- let selectedId = last && boot.workspaces.some((ws) => ws.id === last) ? last : null;
5621
+ const bootActive = boot.workspaces.filter((ws) => ws.status === "active");
5622
+ let selectedId = (last && bootActive.some((ws) => ws.id === last) ? last : null) || bootActive[0]?.id || null;
5867
5623
  let openIds = selectedId ? [selectedId] : [];
5868
5624
  let creating = false;
5869
- let paletteOpen = false;
5870
5625
  let error = null;
5871
5626
  const applyWorkspaces = _resume((list) => {
5872
5627
  workspaces = list;
5873
5628
  const activeIds = new Set(list.filter((ws) => ws.status === "active").map((ws) => ws.id));
5874
5629
  openIds = openIds.filter((id) => activeIds.has(id));
5875
5630
  if (selectedId && !activeIds.has(selectedId)) {
5876
- selectedId = openIds[openIds.length - 1] || null;
5631
+ let fallback = openIds[openIds.length - 1] || null;
5632
+ if (!fallback) {
5633
+ for (const ws of list) if (ws.status === "active") {
5634
+ fallback = ws.id;
5635
+ break;
5636
+ }
5637
+ }
5638
+ selectedId = fallback;
5639
+ if (fallback && !openIds.includes(fallback)) openIds = openIds.concat(fallback);
5877
5640
  prefs.setLastWorkspace(selectedId);
5878
5641
  }
5879
5642
  }, "n0", $scope0_id);
@@ -5935,120 +5698,62 @@ var page_boot_default = _template("n", (input) => {
5935
5698
  }
5936
5699
  selectedId = id;
5937
5700
  creating = false;
5938
- paletteOpen = false;
5939
5701
  if (!openIds.includes(id)) openIds = openIds.concat(id);
5940
5702
  prefs.setLastWorkspace(id);
5941
5703
  }, "n4", $scope0_id);
5942
- const selected = workspaces.find((ws) => ws.id === selectedId);
5943
- const showInlinePalette = !creating && !selected;
5944
- _html(`<div${_attr_class("_x")}>`);
5704
+ _html(`<div${_attr_class("_z")}>`);
5945
5705
  _if(() => {
5946
5706
  if (error) {
5947
- const $scope5_id = _scope_id();
5707
+ const $scope4_id = _scope_id();
5948
5708
  toast_default({
5949
5709
  onDismiss: _resume(function() {
5950
5710
  error = null;
5951
- }, "n5", $scope5_id),
5952
- content: _content_resume("n23", () => {
5711
+ }, "n5", $scope4_id),
5712
+ content: _content_resume("n18", () => {
5953
5713
  _scope_reason();
5954
- const $scope6_id = _scope_id();
5955
- _html(`${_escape(error)}${_el_resume($scope6_id, "a")}`);
5956
- _subscribe($error__closures, writeScope($scope6_id, { _: _scope_with_id($scope5_id) }));
5957
- _resume_branch($scope6_id);
5958
- }, $scope5_id)
5714
+ const $scope5_id = _scope_id();
5715
+ _html(`${_escape(error)}${_el_resume($scope5_id, "a")}`);
5716
+ _subscribe($error__closures, writeScope($scope5_id, { _: _scope_with_id($scope4_id) }));
5717
+ _resume_branch($scope5_id);
5718
+ }, $scope4_id)
5959
5719
  });
5960
- writeScope($scope5_id, {});
5720
+ writeScope($scope4_id, {});
5961
5721
  return 0;
5962
5722
  }
5963
5723
  }, $scope0_id, "b", 1, 1, 1, 0, 1);
5964
5724
  _if(() => {
5965
- if (paletteOpen || showInlinePalette) {
5725
+ if (!selectedId) {
5966
5726
  const $scope1_id = _scope_id();
5967
- _set_serialize_reason(3910);
5968
- const $childScope = _peek_scope_id();
5969
- palette_default({
5970
- workspaces,
5971
- status,
5972
- settings,
5973
- selectedId,
5974
- inline: !paletteOpen && showInlinePalette,
5975
- settingsChange: _resume(function(s) {
5976
- settings = s;
5977
- }, "n6", $scope1_id),
5978
- onSelect: _resume(function(ws) {
5979
- openWorkspace(ws.id);
5980
- }, "n7", $scope1_id),
5981
- onReview: _resume(function(ws) {
5982
- requestDiff(ws.id);
5983
- openWorkspace(ws.id);
5984
- }, "n8", $scope1_id),
5985
- onNewSession: _resume(function(ws, agent) {
5986
- paletteOpen = false;
5987
- api(`/api/workspaces/${ws.id}/sessions`, {
5988
- method: "POST",
5989
- headers: { "content-type": "application/json" },
5990
- body: JSON.stringify({ agent })
5991
- }).then((session) => {
5992
- requestTab(ws.id, session.id);
5993
- openWorkspace(ws.id);
5994
- }).catch((err) => {
5995
- error = `New session failed: ${String(err.message || err)}`;
5996
- });
5997
- }, "n9", $scope1_id),
5998
- onManage: _resume(function(ws) {
5999
- creating = false;
6000
- paletteOpen = false;
6001
- requestManage(ws.id);
6002
- openWorkspace(ws.id);
6003
- }, "n10", $scope1_id),
6004
- onNew: _resume(function() {
6005
- creating = true;
6006
- paletteOpen = false;
6007
- }, "n11", $scope1_id),
6008
- open: paletteOpen,
6009
- openChange: _resume((_new_paletteOpen) => {
6010
- paletteOpen = _new_paletteOpen;
6011
- }, "n12", $scope1_id)
6012
- });
6013
- writeScope($scope1_id, { a: _existing_scope($childScope) });
6014
- return 0;
6015
- }
6016
- }, $scope0_id, "c");
6017
- _if(() => {
6018
- if (creating && !selectedId) {
6019
- const $scope2_id = _scope_id();
6020
5727
  _set_serialize_reason(1);
6021
- const $childScope2 = _peek_scope_id();
5728
+ const $childScope = _peek_scope_id();
6022
5729
  new_workspace_default({
6023
5730
  workspaces,
6024
- onExit: _resume(function() {
6025
- creating = false;
6026
- }, "n13", $scope2_id),
5731
+ onExit: _resume(function() {}, "n6"),
6027
5732
  onCreate: _resume(function(ws) {
6028
5733
  if (!workspaces.some((w) => w.id === ws.id)) workspaces = [ws, ...workspaces];
6029
5734
  creating = false;
6030
5735
  openWorkspace(ws.id);
6031
- }, "n14", $scope2_id),
5736
+ }, "n7", $scope1_id),
6032
5737
  onRestore: _resume(function(next) {
6033
5738
  applyWorkspaces(workspaces.map((w) => w.id === next.id ? next : w));
6034
5739
  creating = false;
6035
5740
  openWorkspace(next.id);
6036
- }, "n15", $scope2_id)
5741
+ }, "n8", $scope1_id)
6037
5742
  });
6038
- writeScope($scope2_id, { a: _existing_scope($childScope2) });
5743
+ writeScope($scope1_id, { a: _existing_scope($childScope) });
6039
5744
  return 0;
6040
5745
  }
6041
- }, $scope0_id, "d", 1, 1, 1, 0, 1);
5746
+ }, $scope0_id, "c", 1, 1, 1, 0, 1);
6042
5747
  _for_of(openIds, (id) => {
6043
- const $scope3_id = _scope_id();
5748
+ const $scope2_id = _scope_id();
6044
5749
  const ws = workspaces.find((w) => w.id === id);
6045
5750
  _if(() => {
6046
5751
  if (ws) {
6047
- const $scope4_id = _scope_id();
5752
+ const $scope3_id = _scope_id();
6048
5753
  const $show = ws.id === selectedId;
6049
5754
  _show_start($show, 1);
6050
5755
  _set_serialize_reason(1);
6051
- const $childScope3 = _peek_scope_id();
5756
+ const $childScope2 = _peek_scope_id();
6052
5757
  work_view_default({
6053
5758
  workspace: ws,
6054
5759
  active: ws.id === selectedId,
@@ -6057,75 +5762,82 @@ var page_boot_default = _template("n", (input) => {
6057
5762
  allStatus: status,
6058
5763
  preferred: settings ? settings.preferredAgent : "claude",
6059
5764
  agents: settings ? settings.agents : ["claude"],
5765
+ onPreferredChange: _resume(function(agent) {
5766
+ if (!settings) return;
5767
+ settings = {
5768
+ ...settings,
5769
+ preferredAgent: agent
5770
+ };
5771
+ }, "n9", $scope3_id),
6060
5772
  onSelectWorkspace: _resume(function(wsId) {
6061
5773
  openWorkspace(wsId);
6062
- }, "n16", $scope4_id),
5774
+ }, "n10", $scope3_id),
6063
5775
  onOpenSession: _resume(function(wsId, sessionId) {
6064
5776
  requestTab(wsId, sessionId);
6065
5777
  prefs.setWorkspaceTab(wsId, sessionId);
6066
5778
  openWorkspace(wsId);
6067
- }, "n17", $scope4_id),
5779
+ }, "n11", $scope3_id),
6068
5780
  onManage: _resume(function(wsId) {
6069
5781
  const id = wsId || ws.id;
6070
5782
  requestManage(id);
6071
5783
  openWorkspace(id);
6072
- }, "n18", $scope4_id),
5784
+ }, "n12", $scope3_id),
6073
5785
  onWorkspaceChange: _resume(function(next) {
6074
5786
  applyWorkspaces(workspaces.map((w) => w.id === next.id ? next : w));
6075
- }, "n19", $scope4_id),
5787
+ }, "n13", $scope3_id),
5788
+ onWorkspaceDeleted: _resume(function(id) {
5789
+ applyWorkspaces(workspaces.filter((w) => w.id !== id));
5790
+ }, "n14", $scope3_id),
6076
5791
  onNew: _resume(function() {
6077
5792
  creating = true;
6078
- }, "n20", $scope4_id),
5793
+ }, "n15", $scope3_id),
6079
5794
  onExitCreate: _resume(function() {
6080
5795
  creating = false;
6081
- }, "n21", $scope4_id),
5796
+ }, "n16", $scope3_id),
6082
5797
  onCreated: _resume(function(ws) {
6083
5798
  if (!workspaces.some((w) => w.id === ws.id)) workspaces = [ws, ...workspaces];
6084
5799
  creating = false;
6085
5800
  openWorkspace(ws.id);
6086
- }, "n22", $scope4_id)
5801
+ }, "n17", $scope3_id)
6087
5802
  });
6088
- _show_end($scope4_id, "d", $show);
6089
- _subscribe($openWorkspace2__closures, _subscribe($applyWorkspaces2__closures, _subscribe($creating__closures, _subscribe($selectedId__closures, _subscribe($settings__closures, _subscribe($status__closures, _subscribe($workspaces__closures, writeScope($scope4_id, { b: _existing_scope($childScope3) }))))))));
5803
+ _show_end($scope3_id, "d", $show);
5804
+ _subscribe($openWorkspace2__closures, _subscribe($applyWorkspaces2__closures, _subscribe($creating__closures, _subscribe($selectedId__closures, _subscribe($settings__closures, _subscribe($status__closures, _subscribe($workspaces__closures, writeScope($scope3_id, { b: _existing_scope($childScope2) }))))))));
6090
5805
  return 0;
6091
5806
  }
6092
- }, $scope3_id, "a");
6093
- writeScope($scope3_id, {
5807
+ }, $scope2_id, "a");
5808
+ writeScope($scope2_id, {
6094
5809
  c: id,
6095
5810
  e: ws,
6096
5811
  f: ws?.id
6097
5812
  });
6098
- }, (id) => id, $scope0_id, "e");
5813
+ }, (id) => id, $scope0_id, "d");
6099
5814
  _html(`</div>${_el_resume($scope0_id, "a")}`);
6100
- _script($scope0_id, "n24");
6101
- _script($scope0_id, "n25");
5815
+ _script($scope0_id, "n19");
5816
+ _script($scope0_id, "n20");
6102
5817
  writeScope($scope0_id, {
6103
- m: boot?.prefs,
6104
- o: workspaces,
6105
- p: status,
6106
- q: settings,
5818
+ l: boot?.prefs,
5819
+ n: workspaces,
5820
+ o: status,
5821
+ p: settings,
6107
5822
  s: selectedId,
6108
- u: openIds,
6109
- x: creating,
6110
- z: paletteOpen,
6111
- a0: error,
6112
- a1: applyWorkspaces,
6113
- a2: load,
6114
- a3: patchStatusSessions,
6115
- a5: statusMem.fresh,
6116
- a6: statusMem.run,
6117
- a8: loadStatus,
6118
- a9: openWorkspace,
6119
- ab: selected,
6120
- ad: showInlinePalette,
6121
- al: $error__closures,
6122
- af: $workspaces__closures,
6123
- ag: $status__closures,
6124
- ah: $settings__closures,
6125
- ai: $selectedId__closures,
6126
- aj: $creating__closures,
6127
- am: $applyWorkspaces2__closures,
6128
- an: $openWorkspace2__closures
5823
+ t: openIds,
5824
+ w: creating,
5825
+ x: error,
5826
+ y: applyWorkspaces,
5827
+ z: load,
5828
+ a0: patchStatusSessions,
5829
+ a2: statusMem.fresh,
5830
+ a3: statusMem.run,
5831
+ a5: loadStatus,
5832
+ a6: openWorkspace,
5833
+ ad: $error__closures,
5834
+ a8: $workspaces__closures,
5835
+ a9: $status__closures,
5836
+ aa: $settings__closures,
5837
+ ab: $selectedId__closures,
5838
+ ac: $creating__closures,
5839
+ ae: $applyWorkspaces2__closures,
5840
+ af: $openWorkspace2__closures
6129
5841
  });
6130
5842
  _resume_branch($scope0_id);
6131
5843
  });
@@ -6156,7 +5868,7 @@ var _page_default = _template("b", (input) => {
6156
5868
  placeholder: attrTag({ content: _content_resume("b0", () => {
6157
5869
  _scope_reason();
6158
5870
  _scope_id();
6159
- _html(`<div${_attr_class("_b")}><span${_attr_class("_w")}></span>Loading workspaces…</div>`);
5871
+ _html(`<div${_attr_class("_b")}><span${_attr_class("_y")}></span>Loading workspaces…</div>`);
6160
5872
  }, $scope0_id) }),
6161
5873
  catch: attrTag({ content: _content_resume("b1", (err) => {
6162
5874
  const $scope3_reason = _scope_reason();
@@ -13043,9 +12755,14 @@ var import_websocket_server = /* @__PURE__ */ __toESM(require_websocket_server()
13043
12755
  /**
13044
12756
  * Terminal endpoint: ws://host/term/<sessionId>?cols=&rows=
13045
12757
  * Binary frames = keyboard input; text frames = JSON control ({resize:[c,r]}).
13046
- * Each connection attaches a tmux client (new-session -A), so closing the
13047
- * socket detaches the tmux session and whatever runs in it survive.
12758
+ * Attaches a tmux client to the session's pane. The pane is created on first
12759
+ * connect (or `?respawn=1`); later connects only attach. Recreating on every
12760
+ * attach would restart the agent after Ctrl-C once tmux had torn the session
12761
+ * down — the socket retry loop made that look instant.
13048
12762
  */
12763
+ /** WebSocket close code: tmux session is gone after the agent exited; the
12764
+ * client should show Reconnect rather than retry-create. */
12765
+ var WS_EXITED = 4e3;
13049
12766
  /** Batch pty output for this long before sending (imperceptible latency,
13050
12767
  * collapses bursty output into few frames). */
13051
12768
  /** Coalescing window for mid-burst output, in ms.
@@ -13084,104 +12801,153 @@ function attachTermServer(server) {
13084
12801
  wss.handleUpgrade(req, socket, head, (ws) => wss.emit("connection", ws, req));
13085
12802
  });
13086
12803
  wss.on("connection", (ws, req) => {
13087
- const url = new URL(req.url || "/", "http://localhost");
13088
- const sessionId = url.pathname.split("/")[2];
13089
- const session = sessionId ? getSession(sessionId) : void 0;
13090
- if (!session) return ws.close(4004, "unknown session");
13091
- const wsPath = workspacePath(session.workspace_id);
13092
- if (!wsPath) return ws.close(4004, "unknown workspace");
13093
- const cols = Number(url.searchParams.get("cols")) || 80;
13094
- const rows = Number(url.searchParams.get("rows")) || 24;
13095
- const connectedVisible = url.searchParams.get("visible") !== "0";
13096
- const proc = pty.spawn("tmux", [
13097
- "-L",
13098
- TMUX_SOCKET,
13099
- ...newSessionArgs(session, wsPath, "-A")
13100
- ], {
13101
- name: "xterm-256color",
13102
- cols,
13103
- rows,
13104
- cwd: wsPath,
13105
- env: cleanEnv()
12804
+ handleTermConnection(ws, req).catch(() => {
12805
+ try {
12806
+ ws.close();
12807
+ } catch {}
13106
12808
  });
13107
- let pending = [];
13108
- let flushTimer;
13109
- let paused = false;
13110
- let lastSend = 0;
13111
- const flush = () => {
13112
- flushTimer = void 0;
13113
- if (ws.readyState !== ws.OPEN) {
13114
- pending = [];
13115
- return;
13116
- }
13117
- if (ws.bufferedAmount > SEND_HIGH_WATER) {
13118
- if (!paused) {
13119
- paused = true;
13120
- proc.pause();
13121
- }
13122
- flushTimer = setTimeout(flush, 50);
13123
- return;
13124
- }
13125
- if (paused) {
13126
- paused = false;
13127
- proc.resume();
13128
- }
13129
- if (pending.length) {
13130
- ws.send(pending.length === 1 ? pending[0] : pending.join(""));
13131
- pending = [];
13132
- lastSend = Date.now();
12809
+ });
12810
+ }
12811
+ async function handleTermConnection(ws, req) {
12812
+ const url = new URL(req.url || "/", "http://localhost");
12813
+ const sessionId = url.pathname.split("/")[2];
12814
+ const session = sessionId ? getSession(sessionId) : void 0;
12815
+ if (!session) return ws.close(4004, "unknown session");
12816
+ const wsPath = workspacePath(session.workspace_id);
12817
+ if (!wsPath) return ws.close(4004, "unknown workspace");
12818
+ const cols = Number(url.searchParams.get("cols")) || 80;
12819
+ const rows = Number(url.searchParams.get("rows")) || 24;
12820
+ const connectedVisible = url.searchParams.get("visible") !== "0";
12821
+ const respawn = url.searchParams.get("respawn") === "1";
12822
+ await ensureTmuxServer();
12823
+ const name = tmuxName(session.id);
12824
+ const alive = await tmux([
12825
+ "has-session",
12826
+ "-t",
12827
+ name
12828
+ ]).then(() => true, () => false);
12829
+ let tmuxArgs;
12830
+ if (alive && !respawn) {
12831
+ markTmuxStarted(session.id);
12832
+ tmuxArgs = [
12833
+ "attach-session",
12834
+ "-t",
12835
+ name
12836
+ ];
12837
+ } else if (respawn || !tmuxWasStarted(session.id)) {
12838
+ if (alive && respawn) await tmux([
12839
+ "kill-session",
12840
+ "-t",
12841
+ name
12842
+ ]).catch(() => {});
12843
+ clearTmuxStarted(session.id);
12844
+ markTmuxStarted(session.id);
12845
+ tmuxArgs = newSessionArgs(session, wsPath, "-A");
12846
+ } else return ws.close(WS_EXITED, "exited");
12847
+ const proc = pty.spawn("tmux", [
12848
+ "-L",
12849
+ TMUX_SOCKET,
12850
+ ...tmuxArgs
12851
+ ], {
12852
+ name: "xterm-256color",
12853
+ cols,
12854
+ rows,
12855
+ cwd: wsPath,
12856
+ env: cleanEnv()
12857
+ });
12858
+ let pending = [];
12859
+ let flushTimer;
12860
+ let paused = false;
12861
+ let lastSend = 0;
12862
+ const flush = () => {
12863
+ flushTimer = void 0;
12864
+ if (ws.readyState !== ws.OPEN) {
12865
+ pending = [];
12866
+ return;
12867
+ }
12868
+ if (ws.bufferedAmount > SEND_HIGH_WATER) {
12869
+ if (!paused) {
12870
+ paused = true;
12871
+ proc.pause();
13133
12872
  }
13134
- };
13135
- proc.onData((data) => {
13136
- pending.push(data);
13137
- if (flushTimer) return;
13138
- flushTimer = setTimeout(flush, Date.now() - lastSend >= FLUSH_MS ? 1 : FLUSH_MS);
12873
+ flushTimer = setTimeout(flush, 50);
12874
+ return;
12875
+ }
12876
+ if (paused) {
12877
+ paused = false;
12878
+ proc.resume();
12879
+ }
12880
+ if (pending.length) {
12881
+ ws.send(pending.length === 1 ? pending[0] : pending.join(""));
12882
+ pending = [];
12883
+ lastSend = Date.now();
12884
+ }
12885
+ };
12886
+ proc.onData((data) => {
12887
+ pending.push(data);
12888
+ if (flushTimer) return;
12889
+ flushTimer = setTimeout(flush, Date.now() - lastSend >= FLUSH_MS ? 1 : FLUSH_MS);
12890
+ });
12891
+ proc.onExit(() => {
12892
+ tmux([
12893
+ "has-session",
12894
+ "-t",
12895
+ name
12896
+ ]).then(() => {
12897
+ try {
12898
+ ws.close();
12899
+ } catch {}
12900
+ }, () => {
12901
+ try {
12902
+ ws.close(WS_EXITED, "exited");
12903
+ } catch {}
13139
12904
  });
13140
- proc.onExit(() => ws.close());
13141
- let visible = connectedVisible;
13142
- if (visible) trackViewer(session.id, 1);
13143
- let dims = [cols, rows];
13144
- const forceWindowSize = () => {
13145
- if (!visible) return;
13146
- lastForced.set(session.id, `${dims[0]}x${dims[1]}`);
13147
- tmux([
13148
- "resize-window",
13149
- "-t",
13150
- tmuxName(session.id),
13151
- "-x",
13152
- String(dims[0]),
13153
- "-y",
13154
- String(dims[1])
13155
- ]).catch(() => {});
13156
- };
13157
- forceWindowSize();
13158
- ws.on("message", (data, isBinary) => {
13159
- if (isBinary) {
13160
- if (lastForced.get(session.id) !== `${dims[0]}x${dims[1]}`) forceWindowSize();
13161
- proc.write(data.toString());
13162
- } else {
13163
- const text = data.toString();
13164
- const resize = parseResize(text);
13165
- if (resize) {
13166
- dims = resize;
13167
- try {
13168
- proc.resize(resize[0], resize[1]);
13169
- } catch {}
13170
- forceWindowSize();
13171
- }
13172
- const vis = parseVisible(text);
13173
- if (vis !== void 0 && vis !== visible) {
13174
- visible = vis;
13175
- trackViewer(session.id, vis ? 1 : -1);
13176
- if (vis) forceWindowSize();
13177
- }
12905
+ });
12906
+ let visible = connectedVisible;
12907
+ if (visible) trackViewer(session.id, 1);
12908
+ let dims = [cols, rows];
12909
+ const forceWindowSize = () => {
12910
+ if (!visible) return;
12911
+ const key = `${dims[0]}x${dims[1]}`;
12912
+ if (lastForced.get(session.id) === key) return;
12913
+ lastForced.set(session.id, key);
12914
+ tmux([
12915
+ "resize-window",
12916
+ "-t",
12917
+ tmuxName(session.id),
12918
+ "-x",
12919
+ String(dims[0]),
12920
+ "-y",
12921
+ String(dims[1])
12922
+ ]).catch(() => {});
12923
+ };
12924
+ forceWindowSize();
12925
+ ws.on("message", (data, isBinary) => {
12926
+ if (isBinary) {
12927
+ if (lastForced.get(session.id) !== `${dims[0]}x${dims[1]}`) forceWindowSize();
12928
+ proc.write(data.toString());
12929
+ } else {
12930
+ const text = data.toString();
12931
+ const resize = parseResize(text);
12932
+ if (resize) {
12933
+ dims = resize;
12934
+ try {
12935
+ proc.resize(resize[0], resize[1]);
12936
+ } catch {}
12937
+ forceWindowSize();
13178
12938
  }
13179
- });
13180
- ws.on("close", () => {
13181
- if (visible) trackViewer(session.id, -1);
13182
- clearTimeout(flushTimer);
13183
- proc.kill();
13184
- });
12939
+ const vis = parseVisible(text);
12940
+ if (vis !== void 0 && vis !== visible) {
12941
+ visible = vis;
12942
+ trackViewer(session.id, vis ? 1 : -1);
12943
+ if (vis) forceWindowSize();
12944
+ }
12945
+ }
12946
+ });
12947
+ ws.on("close", () => {
12948
+ if (visible) trackViewer(session.id, -1);
12949
+ clearTimeout(flushTimer);
12950
+ proc.kill();
13185
12951
  });
13186
12952
  }
13187
12953
  function parseVisible(text) {
@@ -13342,4 +13108,4 @@ server.listen(port, () => {
13342
13108
  //#endregion
13343
13109
  export {};
13344
13110
 
13345
- ;var __MARKO_MANIFEST__={"esfPH6H":{"block":[2,"stylesheet#/assets/preload-helper-Di0vWBYv.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/preload-helper-Di0vWBYv.css\"",">",2,"stylesheet#/assets/index-Du7Hgz2d.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/index-Du7Hgz2d.css\"",">"],"defer":[2,"/assets/index-BXWsr0DP.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/index-BXWsr0DP.js\"","></script>",2,"modulepreload#/assets/_B-HE1A0L.js",6,"<link",0," rel=\"modulepreload\" crossorigin href=\"",1,"assets/_B-HE1A0L.js\"",">"]}};
13111
+ ;var __MARKO_MANIFEST__={"esfPH6H":{"block":[2,"stylesheet#/assets/preload-helper-C1JvlFma.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/preload-helper-C1JvlFma.css\"",">",2,"stylesheet#/assets/index-_5MkiydM.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/index-_5MkiydM.css\"",">"],"defer":[2,"/assets/index-BG3uLJV6.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/index-BG3uLJV6.js\"","></script>",2,"modulepreload#/assets/_D2tmOnaH.js",6,"<link",0," rel=\"modulepreload\" crossorigin href=\"",1,"assets/_D2tmOnaH.js\"",">"]}};