zidane-gui 9.0.4 → 9.1.3

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 (284) hide show
  1. package/README.md +1 -1
  2. package/out/main/chunks/{dev-extension-D5os9z0A.js → dev-extension-CjcEOYly.js} +10 -9
  3. package/out/main/chunks/extension-watch-Bk_X4gTf.js +93 -0
  4. package/out/main/chunks/{history-pager-DUFgTrih.js → history-pager-B5iwhWqn.js} +44 -7
  5. package/out/main/chunks/idle-collect-ZgTY7fw2.js +33 -0
  6. package/out/main/chunks/{remote-hosts-DlvE2ELX.js → remote-hosts-DmiOiwKi.js} +41 -1
  7. package/out/main/chunks/{session-search-sql-BrNTuwjH.js → session-search-sql-BaBnjEgm.js} +4 -4
  8. package/out/main/chunks/{tool-results-sql-C0MqWcQc.js → tool-results-sql-CVleIS51.js} +1 -1
  9. package/out/main/chunks/transcript-sql-DfsO-a4Q.js +27 -0
  10. package/out/main/extension-worker.js +52 -0
  11. package/out/main/git-watch-worker.js +21 -0
  12. package/out/main/history-worker.js +6 -3
  13. package/out/main/index.js +7677 -4252
  14. package/out/main/session-search-worker.js +18 -13
  15. package/out/main/tool-results-worker.js +18 -13
  16. package/out/main/update-worker.js +6 -0
  17. package/out/main/usage-worker.js +4 -1
  18. package/out/preload/index.mjs +56 -6
  19. package/out/renderer/assets/2CHDFZHC-B7OS2WPy.js +76 -0
  20. package/out/renderer/assets/43YPWK3Q-BLwohgFu.js +297 -0
  21. package/out/renderer/assets/45MVAN6X-DCPmrh2y.js +227 -0
  22. package/out/renderer/assets/46GJKBLZ-n_NiMQEY.js +362 -0
  23. package/out/renderer/assets/5THPTBWS-2mBFupjU.js +21 -0
  24. package/out/renderer/assets/63WH7YNF-B0-gnOSz.js +1519 -0
  25. package/out/renderer/assets/6DDU7VKX-BKAF5gyQ.js +139 -0
  26. package/out/renderer/assets/7WLXJQOR-C8MM6Bra.js +23 -0
  27. package/out/renderer/assets/CLQLV5VT-BIZsXon4.js +1159 -0
  28. package/out/renderer/assets/CUSPXG5M-Donlp74Y.js +233 -0
  29. package/out/renderer/assets/{CodeEditor-in2F3Rz-.js → CodeEditor-80QT2Pyq.js} +404 -744
  30. package/out/renderer/assets/{ComposerEditor-DzKoxH6Z.js → ComposerEditor-CXpNHoo1.js} +6 -7
  31. package/out/renderer/assets/D3L7O4X2-BCbmkNpB.js +194 -0
  32. package/out/renderer/assets/D5TW5CPZ-Bp-wetYa.js +21 -0
  33. package/out/renderer/assets/DKTLEL5E-Dj3316cp.js +42 -0
  34. package/out/renderer/assets/{DiffsTab-Ceh4E5wW.js → DiffsTab-Dy8a_hwG.js} +43 -26
  35. package/out/renderer/assets/EGADTWYV-CqSrkc7g.js +292 -0
  36. package/out/renderer/assets/EOJSJZXM-BTI84tys.js +1137 -0
  37. package/out/renderer/assets/{EditorWorkers-Bhv2OJRb.js → EditorWorkers-Durn1REy.js} +9 -11
  38. package/out/renderer/assets/FTXIJQGB-BX14b7pN.js +13 -0
  39. package/out/renderer/assets/{FileIcon-CYgGSQ59.js → FileIcon-acads6Ac.js} +1 -1
  40. package/out/renderer/assets/{FilesTab-DESQMqGK.js → FilesTab-h32FFVsw.js} +70 -28
  41. package/out/renderer/assets/G2OEIG6X-CS8YUqSL.js +519 -0
  42. package/out/renderer/assets/G3MDBVQH-qZ3yfAIw.js +25 -0
  43. package/out/renderer/assets/GXJ2T77W-BHaQFzB4.js +445 -0
  44. package/out/renderer/assets/HX3UMAK7-DOOY2pSg.js +177 -0
  45. package/out/renderer/assets/IU7WZTP6-D7pwhQLH.js +137 -0
  46. package/out/renderer/assets/J5J2NR2G-SPjkbJgo.js +673 -0
  47. package/out/renderer/assets/JRCWTJEL-DT7JLR7k.js +419 -0
  48. package/out/renderer/assets/KHUP5TOH-BX0A2YHC.js +359 -0
  49. package/out/renderer/assets/L74FQTH5-MbDLfIZo.js +994 -0
  50. package/out/renderer/assets/LAV4ZXOS-ClHlsIHg.js +968 -0
  51. package/out/renderer/assets/LBIZYCRR-DmofT7Vk.js +715 -0
  52. package/out/renderer/assets/LFFXNLRS-yLLLefJM.js +377 -0
  53. package/out/renderer/assets/LLLWOAQD-DNhT1-qV.js +409 -0
  54. package/out/renderer/assets/LTYQZ5U5-BxUtiilS.js +1223 -0
  55. package/out/renderer/assets/NDSCUZ25-DltJ5xGa.js +83 -0
  56. package/out/renderer/assets/NMN3IKWL-BXUYzi9o.js +1042 -0
  57. package/out/renderer/assets/NMUA3R2D-CAVxt8OJ.js +1080 -0
  58. package/out/renderer/assets/NY5A6PPW-B3P5KUoQ.js +523 -0
  59. package/out/renderer/assets/OHJ2EJXK-CKyEtj37.js +85 -0
  60. package/out/renderer/assets/OU2GIT2H-i9HfUuBk.js +32 -0
  61. package/out/renderer/assets/PDMLSE6I-BnbSSXbG.js +15 -0
  62. package/out/renderer/assets/PJ7X32S5-Do_rplzd.js +188 -0
  63. package/out/renderer/assets/RLLQ44NJ-SEvjKAya.js +248 -0
  64. package/out/renderer/assets/RVARI57O-DMrXgtoB.js +10 -0
  65. package/out/renderer/assets/S6DWMCK5-CK9P5x9H.js +817 -0
  66. package/out/renderer/assets/STIOTUT7-KYZS5tvF.js +509 -0
  67. package/out/renderer/assets/SXSLPWUD-ylCpsia5.js +120 -0
  68. package/out/renderer/assets/TR4WJQGX-DXlqK6NQ.js +25 -0
  69. package/out/renderer/assets/UWRPUF3N-7_KSfEv0.js +1276 -0
  70. package/out/renderer/assets/VSWIZJ7B-qmPn48eQ.js +205 -0
  71. package/out/renderer/assets/WM7NR6YK-D4oWq6L3.js +193 -0
  72. package/out/renderer/assets/WXKV2YEK-DsK-bqP8.js +499 -0
  73. package/out/renderer/assets/XLHPVVFU-4_9lhZe2.js +56 -0
  74. package/out/renderer/assets/YNX532HU-C1DPijVc.js +119 -0
  75. package/out/renderer/assets/YUPSMAUO-0pM5w-ie.js +39 -0
  76. package/out/renderer/assets/ZFRCZTLK-4EIJek0V.js +150 -0
  77. package/out/renderer/assets/ZZDR4CN3-B_T2R-Zh.js +122 -0
  78. package/out/renderer/assets/andromeeda-Bx1G2cLE.js +293 -0
  79. package/out/renderer/assets/andromeeda-vBqMIOkk.js +293 -0
  80. package/out/renderer/assets/aurora-x-Cm7-xw-C.js +243 -0
  81. package/out/renderer/assets/aurora-x-DPl7s7lw.js +243 -0
  82. package/out/renderer/assets/ayu-dark-CwZzE4zG.js +207 -0
  83. package/out/renderer/assets/ayu-dark-DkHc-GR-.js +207 -0
  84. package/out/renderer/assets/ayu-light-D8NJUeg2.js +207 -0
  85. package/out/renderer/assets/ayu-light-DNVhSCsl.js +207 -0
  86. package/out/renderer/assets/ayu-mirage-C-lSBwzI.js +207 -0
  87. package/out/renderer/assets/ayu-mirage-JE49iZ2H.js +207 -0
  88. package/out/renderer/assets/catppuccin-frappe-DU1nAiyx.js +414 -0
  89. package/out/renderer/assets/catppuccin-frappe-DX6Q-ciL.js +414 -0
  90. package/out/renderer/assets/catppuccin-latte-CO9onEOF.js +414 -0
  91. package/out/renderer/assets/catppuccin-latte-CkSyOFfG.js +414 -0
  92. package/out/renderer/assets/catppuccin-macchiato-OyZDjojj.js +414 -0
  93. package/out/renderer/assets/catppuccin-macchiato-WINjU_Dw.js +414 -0
  94. package/out/renderer/assets/catppuccin-mocha-0z8-eFg0.js +414 -0
  95. package/out/renderer/assets/catppuccin-mocha-DRTSTdRR.js +414 -0
  96. package/out/renderer/assets/{core-xOIU6ifr.js → core-2jWUG3m-.js} +4466 -2537
  97. package/out/renderer/assets/core-COuvbqNs.js +5186 -0
  98. package/out/renderer/assets/{highlight.worker-gURcNJD7.js → core-Drnj1qQL.js} +404 -4454
  99. package/out/renderer/assets/dark-plus-BaggkchT.js +241 -0
  100. package/out/renderer/assets/dark-plus-Conw9IRY.js +241 -0
  101. package/out/renderer/assets/default-CzLFidVE.js +1890 -0
  102. package/out/renderer/assets/dracula-BKSZoV-6.js +227 -0
  103. package/out/renderer/assets/dracula-BpiXsqbq.js +227 -0
  104. package/out/renderer/assets/dracula-soft-BF0b4PXf.js +169 -0
  105. package/out/renderer/assets/dracula-soft-DIWOT7Wr.js +169 -0
  106. package/out/renderer/assets/engine-javascript-CtTomO8o.js +3238 -0
  107. package/out/renderer/assets/engine-javascript-DUvVq6Hk.js +3223 -0
  108. package/out/renderer/assets/engine-oniguruma-DKBWYAaE.js +482 -0
  109. package/out/renderer/assets/engine-oniguruma-mZf4aRKS.js +482 -0
  110. package/out/renderer/assets/everforest-dark-B3n4qCUZ.js +181 -0
  111. package/out/renderer/assets/everforest-dark-BXgth4bF.js +181 -0
  112. package/out/renderer/assets/everforest-light-BhaIwhYu.js +181 -0
  113. package/out/renderer/assets/everforest-light-cbpcbx0E.js +181 -0
  114. package/out/renderer/assets/{file-tabs-Cozt9Sho.js → file-tabs-DwqRIh1X.js} +10 -12
  115. package/out/renderer/assets/{ghostty-web-BTHoKwMc.js → ghostty-web-DnI2p8KS.js} +3 -1
  116. package/out/renderer/assets/github-dark-BESFF5XO.js +234 -0
  117. package/out/renderer/assets/github-dark-DNCSzN6m.js +234 -0
  118. package/out/renderer/assets/github-dark-default-DgFmzzcd.js +168 -0
  119. package/out/renderer/assets/github-dark-default-ffmDUf0z.js +168 -0
  120. package/out/renderer/assets/github-dark-dimmed-CLKTYZCg.js +225 -0
  121. package/out/renderer/assets/github-dark-dimmed-s1SLsKJt.js +225 -0
  122. package/out/renderer/assets/github-dark-high-contrast-CXehgwDU.js +225 -0
  123. package/out/renderer/assets/github-dark-high-contrast-KLlCEr3k.js +225 -0
  124. package/out/renderer/assets/github-light-U3PkvbB_.js +234 -0
  125. package/out/renderer/assets/github-light-default-BPzGUBgG.js +225 -0
  126. package/out/renderer/assets/github-light-default-xMLgS_bN.js +225 -0
  127. package/out/renderer/assets/github-light-high-contrast-C8D72_o0.js +225 -0
  128. package/out/renderer/assets/github-light-high-contrast-DQhuIFi9.js +225 -0
  129. package/out/renderer/assets/github-light-jtm9FPHO.js +234 -0
  130. package/out/renderer/assets/gruvbox-dark-hard-BAboCHnq.js +214 -0
  131. package/out/renderer/assets/gruvbox-dark-hard-woZR1aVf.js +214 -0
  132. package/out/renderer/assets/gruvbox-dark-medium-BsoEOmFF.js +214 -0
  133. package/out/renderer/assets/gruvbox-dark-medium-CNo7daJC.js +214 -0
  134. package/out/renderer/assets/gruvbox-dark-soft-CaJ_lf0b.js +214 -0
  135. package/out/renderer/assets/gruvbox-dark-soft-Cg271WAX.js +214 -0
  136. package/out/renderer/assets/gruvbox-light-hard-CEjA0x_J.js +214 -0
  137. package/out/renderer/assets/gruvbox-light-hard-D8Ufxp8E.js +214 -0
  138. package/out/renderer/assets/gruvbox-light-medium-BCS-MX7u.js +214 -0
  139. package/out/renderer/assets/gruvbox-light-medium-DZkNZdeM.js +214 -0
  140. package/out/renderer/assets/gruvbox-light-soft-CRdK2Ssn.js +214 -0
  141. package/out/renderer/assets/gruvbox-light-soft-DEEl98i-.js +214 -0
  142. package/out/renderer/assets/hastToHtml-AUrFnNH_.js +123 -0
  143. package/out/renderer/assets/highlight.worker-BYB12Fvh.js +1624 -0
  144. package/out/renderer/assets/highlights-6LT5DvBO.js +292 -0
  145. package/out/renderer/assets/highlights-CpZm9DAR-DaBE50nC.js +2188 -0
  146. package/out/renderer/assets/highlights-DmxOEap0.js +313 -0
  147. package/out/renderer/assets/horizon-B492K9Ky.js +165 -0
  148. package/out/renderer/assets/horizon-DAZuC-xh.js +165 -0
  149. package/out/renderer/assets/horizon-bright-D2Sfzu7E.js +165 -0
  150. package/out/renderer/assets/horizon-bright-tGFWGsRc.js +165 -0
  151. package/out/renderer/assets/houston-BuwDhoUX.js +373 -0
  152. package/out/renderer/assets/houston-Cp9zzZds.js +373 -0
  153. package/out/renderer/assets/icons-D67TrEZV.js +23 -0
  154. package/out/renderer/assets/{index-DkE-xvCG.js → index-BnnCv70H.js} +1852 -394
  155. package/out/renderer/assets/{index-DrLLItLS.css → index-C-Dal-Bp.css} +508 -44
  156. package/out/renderer/assets/index-DhpOdP7M.js +882 -0
  157. package/out/renderer/assets/kanagawa-dragon-6NLBJhOz.js +229 -0
  158. package/out/renderer/assets/kanagawa-dragon-BF7rCHRT.js +229 -0
  159. package/out/renderer/assets/kanagawa-lotus-Cj8RDQcT.js +229 -0
  160. package/out/renderer/assets/kanagawa-lotus-uV7FMPcj.js +229 -0
  161. package/out/renderer/assets/kanagawa-wave-0rvDP1ei.js +229 -0
  162. package/out/renderer/assets/kanagawa-wave-B6IVm0GO.js +229 -0
  163. package/out/renderer/assets/{kit-BUt8oFlT.js → kit-CdRTRA2T.js} +46458 -39887
  164. package/out/renderer/assets/langs-BtXnoosO.js +1331 -0
  165. package/out/renderer/assets/langs-D9nZatrh.js +1333 -0
  166. package/out/renderer/assets/laserwave-DXWE1WnK.js +166 -0
  167. package/out/renderer/assets/laserwave-JLRBtymH.js +166 -0
  168. package/out/renderer/assets/lazy-C1DShJVi.js +1188 -0
  169. package/out/renderer/assets/light-plus-DU2oMqtU.js +244 -0
  170. package/out/renderer/assets/light-plus-D_GZIzn-.js +244 -0
  171. package/out/renderer/assets/loader-BlmA-DDi.js +83 -0
  172. package/out/renderer/assets/loader-q6EC19QI.js +80 -0
  173. package/out/renderer/assets/material-theme-C0rHRk_7.js +171 -0
  174. package/out/renderer/assets/material-theme-CKzpgSIj.js +171 -0
  175. package/out/renderer/assets/material-theme-darker-LxtgP-nI.js +171 -0
  176. package/out/renderer/assets/material-theme-darker-q1PJSGwC.js +171 -0
  177. package/out/renderer/assets/material-theme-lighter-Bo7q33GI.js +171 -0
  178. package/out/renderer/assets/material-theme-lighter-DIrXq_cm.js +171 -0
  179. package/out/renderer/assets/material-theme-ocean-DBoGA257.js +171 -0
  180. package/out/renderer/assets/material-theme-ocean-DKw0PiZ1.js +171 -0
  181. package/out/renderer/assets/material-theme-palenight-C6KqY_uf.js +171 -0
  182. package/out/renderer/assets/material-theme-palenight-DoLm5E7H.js +171 -0
  183. package/out/renderer/assets/min-dark-C29HEm34.js +166 -0
  184. package/out/renderer/assets/min-dark-C5zOB6s9.js +166 -0
  185. package/out/renderer/assets/min-light-BDAdB2zx.js +166 -0
  186. package/out/renderer/assets/min-light-CCfylF7u.js +166 -0
  187. package/out/renderer/assets/monokai-CgbJVDnk.js +246 -0
  188. package/out/renderer/assets/monokai-hi1UnAdE.js +246 -0
  189. package/out/renderer/assets/night-owl-Cy8ZrWil.js +238 -0
  190. package/out/renderer/assets/night-owl-Pfm14M0L.js +238 -0
  191. package/out/renderer/assets/night-owl-light-Cr6ug2dl.js +237 -0
  192. package/out/renderer/assets/night-owl-light-UewpB7JV.js +237 -0
  193. package/out/renderer/assets/nord-C68LX7oy.js +200 -0
  194. package/out/renderer/assets/nord-D68iK8nx.js +200 -0
  195. package/out/renderer/assets/one-dark-pro-DSih0ZZj.js +196 -0
  196. package/out/renderer/assets/one-dark-pro-DyTT0T_G.js +196 -0
  197. package/out/renderer/assets/one-light--fEa3idW.js +232 -0
  198. package/out/renderer/assets/one-light-BzGf0rQc.js +232 -0
  199. package/out/renderer/assets/{patch-parse.worker-BAW1QWyk.js → patch-parse.worker-siqPY9wG.js} +24 -4
  200. package/out/renderer/assets/pierre-dark-1Xh1-lMo.js +4 -0
  201. package/out/renderer/assets/pierre-dark-7z_hCG7W.js +364 -0
  202. package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-DjiH32kw.js +364 -0
  203. package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-GW6g2K_K.js +364 -0
  204. package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-LDfpPKjm.js +4 -0
  205. package/out/renderer/assets/pierre-dark-soft-1iBHdNO0.js +364 -0
  206. package/out/renderer/assets/pierre-dark-soft-C_k_gt55.js +4 -0
  207. package/out/renderer/assets/pierre-dark-soft-D5-n1AeJ.js +364 -0
  208. package/out/renderer/assets/pierre-dark-tritanopia-CeWJyYfV.js +4 -0
  209. package/out/renderer/assets/pierre-dark-tritanopia-ClMvjOGO.js +364 -0
  210. package/out/renderer/assets/pierre-dark-tritanopia-D9kXXcwP.js +364 -0
  211. package/out/renderer/assets/pierre-dark-vibrant-6Oqz1PbM.js +4 -0
  212. package/out/renderer/assets/pierre-dark-vibrant-C8yH51pK.js +364 -0
  213. package/out/renderer/assets/pierre-dark-vibrant-D_7rJXbX.js +364 -0
  214. package/out/renderer/assets/pierre-dark-yHUcpElV.js +364 -0
  215. package/out/renderer/assets/pierre-light-BIebL0yQ.js +4 -0
  216. package/out/renderer/assets/pierre-light-C34x-mcs.js +364 -0
  217. package/out/renderer/assets/pierre-light-C9v4GAHb.js +364 -0
  218. package/out/renderer/assets/pierre-light-protanopia-deuteranopia-BufD2-1n.js +4 -0
  219. package/out/renderer/assets/pierre-light-protanopia-deuteranopia-DUrvpW2C.js +364 -0
  220. package/out/renderer/assets/pierre-light-protanopia-deuteranopia-VwXWNPo2.js +364 -0
  221. package/out/renderer/assets/pierre-light-soft-BmDnpPlM.js +364 -0
  222. package/out/renderer/assets/pierre-light-soft-Cd6v49hf.js +4 -0
  223. package/out/renderer/assets/pierre-light-soft-DqFh0kZA.js +364 -0
  224. package/out/renderer/assets/pierre-light-tritanopia-BVCfgdSF.js +364 -0
  225. package/out/renderer/assets/pierre-light-tritanopia-RkA2q6k9.js +364 -0
  226. package/out/renderer/assets/pierre-light-tritanopia-VrCUn-Lh.js +4 -0
  227. package/out/renderer/assets/pierre-light-vibrant-C5BaqWq3.js +364 -0
  228. package/out/renderer/assets/pierre-light-vibrant-CCrCMYrB.js +364 -0
  229. package/out/renderer/assets/pierre-light-vibrant-ClZHsQXl.js +4 -0
  230. package/out/renderer/assets/{pierre-theme-Bj5EAt1L.js → pierre-theme-DpuLJ_93.js} +1022 -913
  231. package/out/renderer/assets/plastic-7t7HzasC.js +207 -0
  232. package/out/renderer/assets/plastic-EgWoj0TX.js +207 -0
  233. package/out/renderer/assets/poimandres-Clm3QHf_.js +186 -0
  234. package/out/renderer/assets/poimandres-_9ZL-zjP.js +186 -0
  235. package/out/renderer/assets/red-BGLMOAQA.js +240 -0
  236. package/out/renderer/assets/red-C7WxuK4s.js +240 -0
  237. package/out/renderer/assets/rose-pine-CSYOOLQH.js +200 -0
  238. package/out/renderer/assets/rose-pine-DQTixAK4.js +200 -0
  239. package/out/renderer/assets/rose-pine-dawn-BsExWFpO.js +200 -0
  240. package/out/renderer/assets/rose-pine-dawn-DtnCKB3V.js +200 -0
  241. package/out/renderer/assets/rose-pine-moon-CIVzFPCR.js +200 -0
  242. package/out/renderer/assets/rose-pine-moon-DUVYttUm.js +200 -0
  243. package/out/renderer/assets/shiki-Ci4cdHsM-C6d-uTVf.js +681 -0
  244. package/out/renderer/assets/shiki-RupN-xqP.js +651 -0
  245. package/out/renderer/assets/slack-dark-DqfBLzDN.js +156 -0
  246. package/out/renderer/assets/slack-dark-PDVLPqBV.js +156 -0
  247. package/out/renderer/assets/slack-ochin-BXb20b9s.js +167 -0
  248. package/out/renderer/assets/slack-ochin-Bkl8Akj-.js +167 -0
  249. package/out/renderer/assets/snazzy-light-B-XgRQqH.js +169 -0
  250. package/out/renderer/assets/snazzy-light-B_Pnr_t3.js +169 -0
  251. package/out/renderer/assets/solarized-dark-BExlwCgF.js +256 -0
  252. package/out/renderer/assets/solarized-dark-BWOkBqBk.js +256 -0
  253. package/out/renderer/assets/solarized-light-B0LC-9ef.js +256 -0
  254. package/out/renderer/assets/solarized-light-B7xKmc3j.js +256 -0
  255. package/out/renderer/assets/stream-tokenizer-DK9xp5M5-BkzgPytU.js +2641 -0
  256. package/out/renderer/assets/stream-tokenizer-DLDzyMrK.js +131 -0
  257. package/out/renderer/assets/synthwave-84-Bz5LYLQI.js +766 -0
  258. package/out/renderer/assets/synthwave-84-DnB997dV.js +766 -0
  259. package/out/renderer/assets/themes-B1aebwax.js +323 -0
  260. package/out/renderer/assets/themes-KOxcu5sY.js +322 -0
  261. package/out/renderer/assets/tokyo-night-BFQDXQF9.js +343 -0
  262. package/out/renderer/assets/tokyo-night-BKV2xFQO.js +343 -0
  263. package/out/renderer/assets/{useDetachCleanup-Bb7k1ePf.js → useDetachCleanup-BXvhEVk-.js} +95 -51
  264. package/out/renderer/assets/{useFolderChanges-B4X4n6NV.js → useFolderChanges-BHQktE6l.js} +406 -242
  265. package/out/renderer/assets/utils-BcG7Lqcy.js +90 -0
  266. package/out/renderer/assets/{vendor-BvslLX9q.js → vendor-BpwX-s_O.js} +16835 -16799
  267. package/out/renderer/assets/{vendor-editor-Bx3dRdBD.js → vendor-editor-Cx3SvGyZ.js} +2 -2
  268. package/out/renderer/assets/{vendor-motion-BLeNAEjH.js → vendor-motion-BgQeucLF.js} +3 -3
  269. package/out/renderer/assets/{vendor-react-DltKc0Ts.js → vendor-react-bPTwWURR.js} +28 -12
  270. package/out/renderer/assets/vesper-BVtJs6jF.js +173 -0
  271. package/out/renderer/assets/vesper-BXSaHQeX.js +173 -0
  272. package/out/renderer/assets/vitesse-black-Bk4nGSr_.js +388 -0
  273. package/out/renderer/assets/vitesse-black-DjBh7jMr.js +388 -0
  274. package/out/renderer/assets/vitesse-dark-BSeRY0TR.js +388 -0
  275. package/out/renderer/assets/vitesse-dark-Czy_Ejt3.js +388 -0
  276. package/out/renderer/assets/vitesse-light-BpMpGmeY.js +388 -0
  277. package/out/renderer/assets/vitesse-light-Cv09MZGR.js +388 -0
  278. package/out/renderer/assets/worker-CswOd5_T.js +2367 -0
  279. package/out/renderer/index.html +8 -9
  280. package/package.json +13 -6
  281. package/out/main/chunks/transcript-sql-DbZ-a5wb.js +0 -43
  282. package/out/renderer/assets/index-DogoEzwx.js +0 -10868
  283. package/out/renderer/assets/vendor-shiki-ba8IDo5s.js +0 -459
  284. package/out/renderer/assets/worker-DNIQ0wG8.js +0 -12761
@@ -1,11 +1,10 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./file-tabs-Cozt9Sho.js","./vendor-react-DltKc0Ts.js","./EditorWorkers-Bhv2OJRb.js","./pierre-theme-Bj5EAt1L.js","./vendor-shiki-ba8IDo5s.js","./index-DogoEzwx.js","./vendor-BvslLX9q.js","./vendor-D_E2rLzO.css","./kit-BUt8oFlT.js","./vendor-motion-BLeNAEjH.js","./core-xOIU6ifr.js","./vendor-editor-Bx3dRdBD.js"])))=>i.map(i=>d[i]);
2
- import { r as reactExports, j as jsxRuntimeExports, e as ReactDOM, c as React } from "./vendor-react-DltKc0Ts.js";
3
- import "./vendor-BvslLX9q.js";
4
- import { aZ as LOCAL_HOST_KEY, db as sessionKey$1, ce as parseSessionKey$1, dc as LOCAL_HOST_NAME, i as DEFAULT_SETTINGS, dd as spacesEnabled, de as ARTIFACTS_PANEL_ID, df as buildPanelCatalog, dg as MEDIA_BY_EXTENSION, bG as CONNECTORS, bH as connectorInstalled, br as nativeExtensionByName, dh as nativeExtensionSource, cD as connectorById, di as connectorServerConfig, dj as machineWaiting, dk as SIDE_PANEL_ID, dl as normalizeBrowserUrl, ae as INBOX_PANEL_ID, dm as BROWSER_PANEL_ID, u as DIFFS_PANEL_ID, F as FILES_PANEL_ID, ad as QUEUE_PANEL_ID, af as TODOS_PANEL_ID, cf as TERMINAL_PANEL_ID, dn as ARTIFACT_BADGES_MAX, a8 as resolveSessionSpace, a0 as parseMachineKind, aQ as accentColor, b3 as DEFAULT_MODEL_PICK, dp as decisionsEnabled, dq as countNeighbors, dr as selectableTurnIds, cb as GITHUB_PULL_PROVIDER_ID, cc as GITHUB_ISSUE_PROVIDER_ID, cd as githubRefKey, aX as parseRepoInput } from "./core-xOIU6ifr.js";
5
- import { aj as createResourceStore, ak as useResource, al as readableResource, am as writable, an as keyedSettingsResources, ao as createSettingsResource, ap as toSettingsError, aq as settingsMcpServerOf, ar as createPresenceStore, as as createOnlineMachines, at as createMachineLists, au as lazyReadable, av as createHostSyncReads, aw as useSettingsHost, ax as SettingsProvider$1, ay as useSettings, ai as useReadable, az as MachinesProvider, aA as createLayoutMemory, aB as useScopeLayout$1, aC as createDraftScopeStore, aD as draftScopeOf, aE as createRunMeter, aF as createTerminalStore, aG as usePeekSessionEvents, aH as useSessionStreamActions, aI as useIsSessionHydrated, aJ as useSessionEvents$1, aK as useSessionEventsSelector$1, aL as createSessionStreams, aM as SessionStreamsProvider, aN as useSessionStreams$1, aO as usePeekRunSeq$1, aP as usePeekSessionRunning, aQ as useSessionRunning, aR as createSidebarViews, aS as createSessionDirectory, aT as useSessionDirectoryView, aU as useNewSessionDefaults, aV as writePersisted, aW as DEFAULT_SIDEBAR_LABELS, aX as useCaptureRunState, aY as pinnedSessions, aZ as useCycleAgent$1, a_ as createPanelFocusStore, a$ as pickTab, b0 as useWorkspaceView, b1 as useWorkspaceRequests, b2 as useWorkspaceContent, b3 as useExtensionPanels, b4 as WorkspaceProvider, b5 as useWorkspaceActions, b6 as readPersisted, b7 as parseBoolean, ah as useAppearanceState, b8 as LayoutBudgetProvider, b9 as LIMITS, ba as useTurnCommands, bb as useTurnMenu$1, bc as createOpenTarget, bd as CommandScopeContext, be as findCommand, bf as hasInteractionBody, bg as InteractionToolBody, bh as InlineChipText, bi as ProseMarkdown, bj as useTranscriptActions, bk as PromptEcho, bl as createModelPickerPrefs, bm as ComposerHostProvider$1, bn as modelNamesOf, bo as useSelectTurn, bp as useSessionRetry, bq as pushComposerPrompt, br as MarkdownContext, bs as TranscriptRenderersProvider, bt as TranscriptActionsProvider, bu as Transcript, bv as TranscriptSearch$1, bw as WelcomeScreen$1, bx as modelKnobsOf, by as commitModelPick$1, bz as createStorageBoot, bA as createStorageAppearancePrefs, bB as codeThemeTypeOf, bC as constant, bD as EFFORT_LEVELS, bE as BUILTIN_THEMES, bF as useModal, bG as useAppearance, bH as OnboardingProvider, bI as OnboardingFlow, bJ as createSiteIcons, bK as useEnvironmentChoices, bL as BranchMenu$1, bM as GitBar$1, bN as createKeybindingOverrides, bO as useSessionFallbackModel, bP as getMergedKeybindings, K as KeyHint, bQ as ComposerStatusPills, bR as ComposerControls, bS as RetryPill, bT as useLayoutBudgetOptional, bU as ConversationBadges$1, bV as DockCard, bW as DockRow, bX as SelectTurnHintKeys, bY as SelectTurnExit, bZ as hostReachable, b_ as useLentServers, b$ as ServerOfflineBanner, c0 as ArchivedBanner, c1 as HostRemovedBanner, c2 as ComposerNotice, c3 as ConnectProviderCard, c4 as ComposerDock, c5 as ApprovalDock, c6 as ErrorBoundary, c7 as RichComposer, c8 as codeAttachmentLabel, c9 as WherePicker, ca as RemoteFolderPicker, cb as ServerScopeToggle, cc as ScopeToggle, cd as MachineWaitingBanner, ce as TerminalToggle, U as Tooltip, V as IconButton, R as RowActionsMenu, cf as useConfirmDeleteSession, cg as useSidebarHost, ch as useSidebarLabels, ci as useEnvironmentCommands, cj as useEnvironmentActions, ck as useMoveSession, cl as sessionMenuItems, cm as countArtifacts, cn as useSessionArtifacts, co as useSessionHost, cp as useReferenceMatches, cq as SessionHeader$1, cr as HostStatusDot, cs as ReferenceText, ct as moveSubject, cu as useComposerSearch$1, cv as createSideRequests, cw as DEFAULT_SESSION_LABELS, cx as useSendPrompt$1, cy as useSessionPage, cz as useTranscriptScroll$1, cA as useSessionMeters, cB as useDraftTarget, cC as useSettledReveal, cD as LoadEarlierRow, cE as SearchHighlightStyle, cF as ArtifactsPanel$1, cG as BTN_SECONDARY, cH as BTN_PRIMARY, b as pushComposerAttachment, c as textAttachment, cI as focusComposer, n as usePanelVisible, cJ as subscribeLayoutAnimating, cK as isLayoutAnimating, cL as useSiteIcon, cM as useKeybindings, cN as usePaletteSource, cO as NavButton, cP as AddressBar, cQ as Popover, cR as SectionLabel, cS as MenuRow, cT as Menu, cU as MenuSection, cV as MenuSeparator, cW as relativeTime, cX as InboxPanel, cY as attachmentLightboxItems, cZ as AttachmentRow, c_ as QueueTab$1, c$ as SideChat, d0 as HostModelPicker, d1 as HostModelOptionsPicker, d2 as TerminalPanelTab, d3 as TodosPanel, d4 as PanelContentView, d5 as useLayoutBudget, d6 as splitPanelWidth, d7 as SidePanel$1, d8 as TAB_REGION_PROPS, d9 as panelDragResult, da as TerminalDrawer, db as useSessionPresence$1, dc as usePresenceMap$1, dd as createSessionActivity, de as createCompactionProgress, df as createSessionBadges, dg as createSidebarLive, dh as useSessionApprovalHead, di as useInteractionHead, dj as useRunElapsedSec, dk as SidebarFooter, dl as SidebarSignInPrompt, dm as DaemonMenu, dn as useProviderUsage, dp as SidebarUsageIndicator, dq as useCompactionProgress, dr as Presence, ds as SidebarCompactingIndicator, dt as useProjectSessionActions, du as SpaceSwitcher, dv as SessionSidebar, dw as SidebarFilterMenu, dx as CreateExtensionDialog, dy as ModalShell, dz as useTerminalsEnabled, dA as useTerminalStore, dB as useScopeTerminals, dC as RunningWorkDialog, dD as useAgentProfiles$1, dE as useConfirm, dF as useSessionCacheReport, dG as useColors, dH as compactPath, dI as SessionDetailsDialog, dJ as SessionCacheFacts, dK as deleteSessionPrompt, dL as BTN_LG_SECONDARY, dM as SettingsTutorial, dN as McpSection, dO as ServerProvidersSection, dP as ProvidersSection, dQ as ExtensionsSection, dR as SkillsSection, dS as InstructionsSection, dT as KeybindingsSection, dU as EditorSection, dV as AppearanceSection, dW as useSettingsSection, dX as HostCatalogSection, dY as ExtensionOptionsSection, dZ as PluginsSection, d_ as PerformanceSection, d$ as LogsSection, e0 as EnvironmentsSection, e1 as HostsSection, e2 as ROW_BUTTON_CLASS, e3 as RowText, e4 as useServerSyncStatus, e5 as agentDefaultsOf, e6 as SettingsRowsPage, e7 as SpacesDefaultsSection, e8 as ConversationPresetsRow, e9 as CompactionModelRow, ea as DecisionModelRow, eb as TextModelRow, ec as AgentDefaultsRows, ed as SyncMarker, ee as ApprovalModeRow, ef as agentDefaultsPatch, eg as settingsPageCounts, eh as listLength, ei as KEYBINDING_ROW_COUNT, ej as SegmentSpinner, ek as SettingsHostSwitcher, el as ScreenShell, em as visiblePages, en as useExtensionOptionsSearch, eo as layoutSections, ep as SettingsHeadingText, eq as SettingsShell, er as UsagePanel, es as TurnDetailsDialog, et as usePanelGroupHandlers$1, eu as InboxAttention$1, ev as TodosAttention$1, ew as QueueAttention$1, ex as PerformanceHud, ey as createStorageEditorPrefs, ez as createPaletteRows, eA as usePaletteHost, eB as usePaletteLabels, eC as useSessionRank, eD as sessionsSource, eE as conversationsSource, eF as useActionsPaletteSource, eG as panelsSource, eH as spacesSource, eI as commandsSource, eJ as useImportRepo, eK as repoSource, eL as filesSource, eM as settingsSource, eN as prefsSource, eO as extensionsSource, eP as setupSource, eQ as usePaletteModalSlot, eR as PaletteDialog, eS as pushComposerInsert, eT as registerTabScope, eU as serializeTerminalExcerpt, eV as hasComposerFor, eW as TerminalProvider, eX as ModalProvider, eY as KeyCommandsProvider, eZ as useSessionContextStatus, e_ as useProviderReadyPoll, e$ as useClaudeImportAvailable, f0 as AgentPickerDialog, f1 as effortPickerTarget, f2 as EffortPickerDialog, f3 as createSessionActions, f4 as useHelpKey, f5 as useTranscriptFind, f6 as ModelPickerDialog, f7 as usePaletteActions, f8 as useWorkspaceKeyCommands, f9 as useMainSession, fa as useSelectTurnKeys, fb as zoomKeyCommands, fc as sessionKeyCommands, fd as useKeyCommands, fe as ClaudeImportDialog, ff as SafelistPanel, fg as SidebarToggleButton, fh as hostSettingsFocus, fi as createPendingApprovals, fj as createSafelist, fk as ApprovalsProvider, fl as createRunningWorkState, fm as createArtifactsState, fn as createQueueState, fo as createTodosState, fp as SessionProvider, fq as ProviderUsageProvider, fr as FilesProvider, fs as ChatProvider, ft as useHasFocusedComposer, fu as hasFocusedComposer, d as pushComposerMention, fv as OpenSessionContext, fw as BadgeMenuProvider, fx as createStorageRecents, fy as PaletteProvider, fz as WorkerWrapper, fA as LabelsProvider, fB as PromptHistoryProvider, fC as SelectTurnProvider, fD as KeybindingsProvider, fE as GitProvider, fF as SidebarHostProvider, fG as useShikiTheme, T as useEditorPrefs, fH as CodeHighlightProvider, fI as CodeWrapProvider, fJ as createCodeHighlighter, fK as WorkerWrapper$1, fL as usePalette, w as useAppearanceReducedMotion, fM as EditorEnvironmentProvider, fN as AppearanceProvider, fO as configureErrorReports, fP as installRendererErrorHandlers, fQ as reportRendererError, G as buttonClass, fR as readMotionMs } from "./kit-BUt8oFlT.js";
6
- import { _ as __vitePreload } from "./vendor-shiki-ba8IDo5s.js";
7
- import "./vendor-motion-BLeNAEjH.js";
8
- import "./vendor-editor-Bx3dRdBD.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./file-tabs-DwqRIh1X.js","./vendor-react-bPTwWURR.js","./EditorWorkers-Durn1REy.js","./pierre-theme-DpuLJ_93.js","./core-2jWUG3m-.js","./vendor-BpwX-s_O.js","./vendor-D_E2rLzO.css","./kit-CdRTRA2T.js","./vendor-motion-BgQeucLF.js","./vendor-editor-Cx3SvGyZ.js"])))=>i.map(i=>d[i]);
2
+ import { ct as LOCAL_HOST_KEY, dP as sessionKey$1, cn as parseSessionKey$1, dQ as LOCAL_HOST_NAME, k as DEFAULT_SETTINGS, dR as ARTIFACT_BADGES_MAX, dS as spacesEnabled, dT as ARTIFACTS_PANEL_ID, dU as buildPanelCatalog, dV as MEDIA_BY_EXTENSION, dW as USAGE_BLOCK_ID, bj as CONNECTORS, bk as connectorInstalled, aZ as nativeExtensionByName, dX as nativeExtensionSource, df as connectorById, dY as connectorServerConfig, dZ as machineWaiting, d_ as SIDE_PANEL_ID, d$ as normalizeBrowserUrl, aR as INBOX_PANEL_ID, _ as __vitePreload, e0 as BROWSER_PANEL_ID, aQ as QUEUE_PANEL_ID, aS as TODOS_PANEL_ID, cO as TERMINAL_PANEL_ID, a0 as FILES_PANEL_ID, $ as DIFFS_PANEL_ID, aA as resolveSessionSpace, at as parseMachineKind, cm as accentColor, bB as DEFAULT_MODEL_PICK, e1 as decisionsEnabled, e2 as countNeighbors, e3 as selectableTurnIds, G as GITHUB_PULL_PROVIDER_ID, F as GITHUB_ISSUE_PROVIDER_ID, H as githubRefKey, e4 as runBlockOnHost, cs as parseRepoInput } from "./core-2jWUG3m-.js";
3
+ import { r as reactExports, j as jsxRuntimeExports, e as ReactDomClient, f as ReactDom, h as ReactJsxRuntime, R as React, i as ReactDOM, c as React$1 } from "./vendor-react-bPTwWURR.js";
4
+ import "./vendor-BpwX-s_O.js";
5
+ import { aj as createResourceStore, ak as useResource, al as readableResource, am as writable, an as keyedSettingsResources, ao as createSettingsResource, ap as toSettingsError, aq as settingsMcpServerOf, ar as createPresenceStore, as as createOnlineMachines, at as createMachineLists, au as lazyReadable, av as createHostSyncReads, aw as useSettingsHost, ax as SettingsProvider$1, ay as useSettings, ai as useReadable, az as PathDisplayProvider, aA as MachinesProvider, aB as createLayoutMemory, aC as useScopeLayout$1, aD as createDraftScopeStore, aE as draftScopeOf, aF as createRunMeter, aG as createSessionBadges, aH as createSessionActivity, aI as createRunEstimates, aJ as createCompactionProgress, aK as createTerminalStore, aL as usePeekSessionEvents, aM as useSessionStreamActions, aN as useIsSessionHydrated, aO as useSessionEvents$1, aP as useSessionEventsSelector$1, aQ as createSessionStreams, aR as SessionStreamsProvider, aS as RunEstimatesProvider, aT as useSessionStreams$1, aU as usePeekRunSeq$1, aV as usePeekSessionRunning, aW as useSessionRunning, aX as createSidebarViews, aY as createSessionDirectory, aZ as useSessionDirectoryView, a_ as useNewSessionDefaults, a$ as writePersisted, b0 as DEFAULT_SIDEBAR_LABELS, b1 as useCaptureRunState, b2 as pinnedSessions, b3 as useCycleAgent$1, b4 as createPanelFocusStore, b5 as pickTab, b6 as useWorkspaceView, b7 as useWorkspaceRequests, b8 as useWorkspaceContent, b9 as useExtensionPanels, ba as WorkspaceHostProvider, bb as WorkspaceProvider, bc as useWorkspaceActions, bd as createSidebarCollapsed, ah as useAppearanceState, be as LayoutBudgetProvider, bf as LIMITS, bg as useTurnCommands, bh as useTurnMenu$1, bi as createOpenTarget, bj as CommandScopeContext, bk as findCommand, bl as hasInteractionBody, bm as InteractionToolBody, bn as InlineChipText, bo as ProseMarkdown, bp as useTranscriptActions, bq as PromptEcho, br as createModelPickerPrefs, bs as ComposerHostProvider$1, bt as modelNamesOf, bu as useSelectTurn, bv as useTranscriptOptions, bw as useSessionRetry, bx as pushComposerPrompt, by as MarkdownContext, bz as TranscriptRenderersProvider, bA as TranscriptActionsProvider, bB as PathDisplayScope, bC as Transcript, bD as TranscriptSearch$1, bE as useSessionPresence$1, bF as usePresenceMap$1, bG as createSidebarLive, bH as useSessionApprovalHead, bI as useInteractionHead, bJ as useRunElapsedSec, bK as ZidaneUiExtensionsKit, bL as ZidaneUiExtensions, bM as EXTENSION_TOKENS, bN as ExtensionsHostError, bO as createUiEffectChannel, bP as createDialogQueue, bQ as sidebarContributionsOf, bR as ExtensionsProvider, bS as useProjectIcons, bT as useConfirmDeleteSession, bU as useMoveSession, bV as basename, bW as useSessionMenuItems, bX as SessionListRow, bY as moveSubject, bZ as useWorkspaceHost, b_ as useLinkRouter, b$ as PanelSessionRowProvider, c0 as ProjectHome, c1 as ProjectIconGlyph, c2 as WelcomeScreen$1, c3 as modelKnobsOf, c4 as commitModelPick$1, c5 as createStorageBoot, c6 as createStorageAppearancePrefs, c7 as codeThemeTypeOf, c8 as constant, c9 as EFFORT_LEVELS, ca as BUILTIN_THEMES, cb as useModal, cc as useAppearance, cd as OnboardingProvider, ce as OnboardingFlow, cf as createSiteIcons, cg as useEnvironmentChoices, ch as BranchMenu$1, ci as GitBar$1, cj as createKeybindingOverrides, ck as useSessionFallbackModel, cl as getMergedKeybindings, K as KeyHint, cm as ComposerStatusPills, cn as ComposerControls, co as RetryPill, cp as useLayoutBudgetOptional, cq as ConversationBadges$1, cr as hostReachable, cs as useLentServers, ct as ServerOfflineBanner, cu as ArchivedBanner, cv as HostRemovedBanner, cw as ComposerNotice, cx as ConnectProviderCard, cy as ComposerDock, cz as SelectTurnHint, cA as ApprovalDock, cB as ErrorBoundary, cC as RichComposer, cD as codeAttachmentLabel, cE as WherePicker, cF as RemoteFolderPicker, cG as ServerScopeToggle, cH as ScopeToggle, cI as MachineWaitingBanner, U as Tooltip, V as IconButton, cJ as useSidebarHost, cK as useSidebarLabels, cL as useEnvironmentCommands, cM as useEnvironmentActions, cN as sessionMenuItems, cO as useReferenceMatches, cP as SessionHeader$1, cQ as HostStatusDot, cR as ReferenceText, cS as useComposerSearch$1, cT as createSideRequests, cU as DEFAULT_SESSION_LABELS, cV as useSendPrompt$1, cW as useSessionHost, cX as useSessionPage, cY as useTranscriptScroll$1, cZ as useSessionMeters, c_ as useDraftTarget, c$ as useSettledReveal, d0 as LoadEarlierRow, d1 as SearchHighlightStyle, d2 as ArtifactsPanel$1, d3 as BTN_SECONDARY, d4 as BTN_PRIMARY, b as pushComposerAttachment, c as textAttachment, d5 as focusComposer, n as usePanelVisible, d6 as subscribeLayoutAnimating, d7 as isLayoutAnimating, d8 as useSiteIcon, d9 as useKeybindings, da as usePaletteSource, db as NavButton, dc as AddressBar, dd as Popover, de as SectionLabel, df as MenuRow, dg as Menu, dh as MenuSection, di as MenuSeparator, dj as relativeTime, R as RowActionsMenu, dk as InboxPanel, dl as attachmentLightboxItems, dm as AttachmentRow, dn as QueueTab$1, dp as SideChat, dq as HostModelPicker, dr as HostModelOptionsPicker, ds as TerminalPanelTab, dt as TodosPanel, du as PanelContentView, dv as useLayoutBudget, dw as panelCornerWidth, dx as PanelCorner, dy as countArtifacts, dz as useSessionArtifacts, dA as splitPanelWidth, dB as SidePanel$1, dC as TAB_REGION_PROPS, dD as panelDragResult, dE as TerminalDrawer, dF as SidebarFooter, dG as SidebarSignInPrompt, dH as DaemonMenu, dI as useProviderUsage, dJ as SidebarUsageIndicator, dK as useCompactionProgress, dL as Presence, dM as SidebarCompactingIndicator, dN as useProjectSessionActions, dO as SpaceSwitcher, dP as SessionSidebar, dQ as useSaveViewAsSpace, dR as SidebarFilterMenu, dS as ExtensionSlot, dT as CreateExtensionDialog, dU as useTerminalsEnabled, dV as useTerminalStore, dW as useScopeTerminals, dX as RunningWorkDialog, dY as renderSessionModalShell, dZ as useAgentProfiles$1, d_ as useConfirm, d$ as useSessionCacheReport, e0 as useColors, e1 as useDisplayPath, e2 as compactPath, e3 as SessionDetailsDialog, e4 as renderWideSessionModalShell, e5 as SessionCacheFacts, e6 as deleteSessionPrompt, e7 as useExtensionsHost, e8 as extensionsErrorOf, e9 as BTN_LG_SECONDARY, ea as SettingsTutorial, eb as McpSection, ec as ServerProvidersSection, ed as ProvidersSection, ee as ExtensionsSection, ef as SkillsSection, eg as InstructionsSection, eh as KeybindingsSection, ei as EditorSection, ej as AppearanceSection, ek as HostCatalogSection, el as PluginsSection, em as PerformanceSection, en as LogsSection, eo as EnvironmentsSection, ep as HostsSection, eq as ROW_BUTTON_CLASS, er as RowText, es as useSettingsSection, et as useServerSyncStatus, eu as agentDefaultsOf, ev as SettingsRowsPage, ew as SpacesDefaultsSection, ex as ConversationPresetsRow, ey as CompactionModelRow, ez as DecisionModelRow, eA as TextModelRow, eB as AgentDefaultsRows, eC as SyncMarker, eD as ApprovalModeRow, eE as agentDefaultsPatch, eF as settingsPageCounts, eG as listLength, eH as KEYBINDING_ROW_COUNT, eI as SegmentSpinner, eJ as SettingsHostSwitcher, eK as ScreenShell, eL as visiblePages, eM as useExtensionSettingsSections, eN as layoutSections, eO as SettingsHeadingText, eP as SettingsShell, eQ as UsagePanel, eR as TurnDetailsDialog, eS as usePanelGroupHandlers$1, eT as InboxAttention$1, eU as TodosAttention$1, eV as QueueAttention$1, eW as PerformanceHud, eX as DEFAULT_EDITOR, eY as EDITOR_STORAGE_KEY, eZ as parseEditor, e_ as createPaletteRows, e$ as usePaletteHost, f0 as usePaletteLabels, f1 as useSessionRank, f2 as sessionsSource, f3 as conversationsSource, f4 as useActionsPaletteSource, f5 as panelsSource, f6 as spacesSource, f7 as commandsSource, f8 as useImportRepo, f9 as repoSource, fa as filesSource, fb as settingsSource, fc as prefsSource, fd as extensionsSource, fe as setupSource, ff as usePaletteModalSlot, fg as PaletteDialog, fh as pushComposerInsert, fi as useExtensionEffects, fj as ExtensionDialogHost, fk as matchesBinding, fl as registerTabScope, fm as serializeTerminalExcerpt, fn as hasComposerFor, fo as TerminalProvider, fp as ModalProvider, fq as KeyCommandsProvider, fr as useSessionContextStatus, fs as useProviderReadyPoll, ft as useClaudeImportAvailable, fu as AgentPickerDialog, fv as effortPickerTarget, fw as EffortPickerDialog, fx as createSessionActions, fy as useHelpKey, fz as useTranscriptFind, fA as ModelPickerDialog, fB as usePaletteActions, fC as useWorkspaceKeyCommands, fD as useMainSession, fE as useSelectTurnKeys, fF as zoomKeyCommands, fG as sessionKeyCommands, fH as useKeyCommands, fI as ClaudeImportDialog, fJ as SafelistPanel, fK as ModalShell, fL as SidebarToggleButton, fM as hostSettingsFocus, fN as createPendingApprovals, fO as createSafelist, fP as ApprovalsProvider, fQ as createRunningWorkState, fR as createArtifactsState, fS as createQueueState, fT as createTodosState, fU as SessionProvider, fV as ProviderUsageProvider, fW as FilesProvider, fX as createChatBlockRuns, fY as ChatProvider, fZ as useHasFocusedComposer, f_ as hasFocusedComposer, d as pushComposerMention, f$ as OpenSessionContext, g0 as BadgeMenuProvider, g1 as createStorageRecents, g2 as PaletteProvider, g3 as WorkerWrapper, g4 as LabelsProvider, g5 as PromptHistoryProvider, g6 as SelectTurnProvider, g7 as KeybindingsProvider, g8 as GitProvider, g9 as SidebarHostProvider, ga as useShikiTheme, T as useEditorPrefs, gb as CodeHighlightProvider, gc as CodeWrapProvider, gd as createCodeHighlighter, ge as WorkerWrapper$1, gf as AppearanceProvider, gg as EditorEnvironmentRoot, gh as configureErrorReports, gi as installRendererErrorHandlers, gj as watchRuntimeIcons, gk as reportRendererError, G as buttonClass, gl as readMotionMs, gm as crispPhosphor } from "./kit-CdRTRA2T.js";
6
+ import "./vendor-motion-BgQeucLF.js";
7
+ import "./vendor-editor-Cx3SvGyZ.js";
9
8
  const LOCAL_SESSION_HOST = LOCAL_HOST_KEY;
10
9
  function sessionKey(hostId, sessionId) {
11
10
  return sessionKey$1(hostId, sessionId);
@@ -97,28 +96,28 @@ function ipcErrorMessage(err) {
97
96
  function hostScope(hostId) {
98
97
  return { hostId: hostId ?? LOCAL_SESSION_HOST };
99
98
  }
100
- const store$1 = createResourceStore({
99
+ const store$2 = createResourceStore({
101
100
  // Absent outside the app's preload (tests, a page opened on its own); read when first needed.
102
101
  invalidation: () => typeof window === "undefined" ? void 0 : window.api?.invalidation,
103
102
  watchedTopics: ["git:refs", "git:config"]
104
103
  });
105
104
  function useIpcResource(spec) {
106
- return useResource(store$1, spec);
105
+ return useResource(store$2, spec);
107
106
  }
108
107
  function peekIpcResource(spec) {
109
- return store$1.peek(spec);
108
+ return store$2.peek(spec);
110
109
  }
111
110
  function subscribeIpcResource(spec, onChange) {
112
- return store$1.subscribe(spec, onChange);
111
+ return store$2.subscribe(spec, onChange);
113
112
  }
114
113
  function subscribeInvalidation(options, listener) {
115
- return store$1.subscribeInvalidation(options, listener);
114
+ return store$2.subscribeInvalidation(options, listener);
116
115
  }
117
116
  function fetchIpcResource(spec) {
118
- return store$1.fetch(spec);
117
+ return store$2.fetch(spec);
119
118
  }
120
119
  function readableIpcResource(spec) {
121
- return readableResource(store$1, spec);
120
+ return readableResource(store$2, spec);
122
121
  }
123
122
  function modelCatalogResource(cwd, hostId) {
124
123
  return {
@@ -1006,13 +1005,13 @@ function createElectronSettingsSections(api, options) {
1006
1005
  skills: {
1007
1006
  catalog: skillCatalogs,
1008
1007
  browse: (input) => typed(api.skills.browse(input)),
1009
- install: async (cwd, request, onProgress) => {
1008
+ install: async (cwd, request2, onProgress) => {
1010
1009
  const result = await withProgress(
1011
1010
  onProgress,
1012
1011
  (requestId) => api.skills.install(cwd, {
1013
- source: request.source,
1014
- scope: request.scope,
1015
- skills: request.skills,
1012
+ source: request2.source,
1013
+ scope: request2.scope,
1014
+ skills: request2.skills,
1016
1015
  requestId
1017
1016
  })
1018
1017
  );
@@ -1026,8 +1025,17 @@ function createElectronSettingsSections(api, options) {
1026
1025
  },
1027
1026
  extensions: {
1028
1027
  list: (cwd) => typed(api.extensions.list(cwd)),
1029
- install: (cwd, request, onProgress) => withProgress(onProgress, (requestId) => api.extensions.install(cwd, { ...request, requestId })),
1028
+ install: (cwd, request2, onProgress) => withProgress(onProgress, (requestId) => api.extensions.install(cwd, { ...request2, requestId })),
1030
1029
  update: (cwd, extension) => typed(api.extensions.update(cwd, extension.dir)),
1030
+ browse: (input) => typed(api.extensions.browse(input)),
1031
+ changeOrigin: async (cwd, extension, source, onProgress) => {
1032
+ const result = await withProgress(
1033
+ onProgress,
1034
+ (requestId) => api.extensions.changeOrigin(cwd, { dir: extension.dir, source, requestId })
1035
+ );
1036
+ if (!result.ok) throw { kind: "failed", detail: result.message, found: result.found };
1037
+ return result.message;
1038
+ },
1031
1039
  remove: async (cwd, extension) => {
1032
1040
  await typed(api.extensions.remove(cwd, extension.dir, extension.name));
1033
1041
  },
@@ -1036,7 +1044,7 @@ function createElectronSettingsSections(api, options) {
1036
1044
  actions: extensionActions,
1037
1045
  actionStatuses: (cwd) => typed(api.extensions.actionStatuses(cwd)),
1038
1046
  runAction: (cwd, extension, key2) => typed(api.extensions.runAction(cwd, extension, key2)),
1039
- create: (request) => typed(api.extensions.create(request))
1047
+ create: (request2) => typed(api.extensions.create(request2))
1040
1048
  },
1041
1049
  plugins: { catalog: pluginCatalogs },
1042
1050
  instructions: {
@@ -1077,8 +1085,22 @@ function createElectronSettingsSections(api, options) {
1077
1085
  if (event.hostId === hostId) listener(event.catalog);
1078
1086
  }),
1079
1087
  installs: () => api.hosts.installsAllowed(hostId),
1080
- install: async (kind, spec) => {
1081
- await typed(api.hosts.install(hostId, kind, spec));
1088
+ install: async (kind, spec, installOptions) => {
1089
+ await typed(
1090
+ api.hosts.install(
1091
+ hostId,
1092
+ kind,
1093
+ spec,
1094
+ installOptions?.extension ? { extension: installOptions.extension } : void 0
1095
+ )
1096
+ );
1097
+ },
1098
+ browse: (input) => typed(api.hosts.browseExtensions(hostId, input)),
1099
+ changeOrigin: async (name, source) => {
1100
+ const result = await typed(api.hosts.changeExtensionOrigin(hostId, name, source));
1101
+ if (!result.ok)
1102
+ throw { kind: "failed", detail: result.message, found: result.found };
1103
+ return result.message;
1082
1104
  },
1083
1105
  remove: async (kind, name) => {
1084
1106
  await typed(api.hosts.uninstall(hostId, kind, name));
@@ -1323,7 +1345,8 @@ function HostsProvider({ children }) {
1323
1345
  refresh
1324
1346
  };
1325
1347
  }, [state2, refresh]);
1326
- return /* @__PURE__ */ jsxRuntimeExports.jsx(HostsContext.Provider, { value, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MachinesProvider, { host: machinesHost, children }) });
1348
+ const homes = reactExports.useMemo(() => Object.fromEntries(state2.hosts.map((host2) => [host2.id, host2.home])), [state2.hosts]);
1349
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(HostsContext.Provider, { value, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PathDisplayProvider, { homes, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MachinesProvider, { host: machinesHost, children }) }) });
1327
1350
  }
1328
1351
  const FALLBACK = {
1329
1352
  ...OFF,
@@ -1455,6 +1478,19 @@ const noteRunStarts = runMeter.noteStarts;
1455
1478
  noteProgress: runMeter.noteProgress,
1456
1479
  settleCost: runMeter.settleCost
1457
1480
  });
1481
+ const sessionActivity = createSessionActivity({ subscribe: onStreamSignal });
1482
+ const sessionCompaction = createCompactionProgress({ subscribe: onStreamSignal });
1483
+ const runEstimates = createRunEstimates({ subscribe: onStreamSignal });
1484
+ const sessionBadges = createSessionBadges({
1485
+ read: (ids) => window.api.artifacts.badges(ids),
1486
+ batchMax: ARTIFACT_BADGES_MAX,
1487
+ onArtifactsChanged: (listener) => onStreamSignal((signal) => {
1488
+ if (signal.kind === "artifact:recorded" || signal.kind === "artifact:changed") listener(signal.sessionId);
1489
+ }),
1490
+ onRegistryChanged: (listener) => subscribeInvalidation({ topics: ["extensions", "extensions:built"], scope: hostScope(null) }, listener),
1491
+ // Main checks what the rows show again while the window is looked at (`artifact-freshness.ts`).
1492
+ shown: (ids) => window.api.artifacts.shown(ids)
1493
+ });
1458
1494
  const LOCAL_ENVIRONMENT = { kind: "local", remote: false };
1459
1495
  const clean = (call) => call.catch((err) => {
1460
1496
  throw new Error(ipcErrorMessage(err));
@@ -1538,7 +1574,17 @@ const terminalHost = (() => {
1538
1574
  const host2 = createElectronTerminalHost(windowApi$4, sessionLayouts);
1539
1575
  return {
1540
1576
  ...host2,
1541
- listen: (sink) => typeof window !== "undefined" && window.api?.terminal ? host2.listen(sink) : () => void 0
1577
+ listen: (sink) => {
1578
+ if (typeof window === "undefined" || !window.api?.terminal) return () => void 0;
1579
+ const off = host2.listen(sink);
1580
+ const offDeleted = window.api.sessions?.onChanged((signal) => {
1581
+ if (signal.op === "delete") terminalStore.forget(signal.sessionId);
1582
+ });
1583
+ return () => {
1584
+ off();
1585
+ offDeleted?.();
1586
+ };
1587
+ }
1542
1588
  };
1543
1589
  })();
1544
1590
  const terminalStore = createTerminalStore(terminalHost);
@@ -1555,7 +1601,9 @@ function electronSessionSource(api = window.api.sessions) {
1555
1601
  setArchived: (id, archived) => api.setArchived(id, archived),
1556
1602
  setSpace: (id, spaceId) => api.setSpace(id, spaceId),
1557
1603
  remove: (id) => removeSession(api, id),
1558
- onChanged: (listener) => api.onChanged((signal) => listener(signal.sessionId))
1604
+ onChanged: (listener) => api.onChanged((signal) => listener(signal.sessionId)),
1605
+ // `sessions:facets` (main sends it to every window): facets are stored without a `sessions:changed`.
1606
+ onFacets: (listener) => api.onFacets((signal) => listener(signal.sessionId, signal.facets))
1559
1607
  };
1560
1608
  }
1561
1609
  function electronSidebarViews(api = window.api.sidebar) {
@@ -1578,7 +1626,7 @@ const PAGES_KEY = "zg:browser:pages:v1";
1578
1626
  const EMULATION_KEY = "zg:browser:emulation:v1";
1579
1627
  const RECENT_KEY = "zg:browser:recent:v1";
1580
1628
  const MAX_REMEMBERED = 50;
1581
- const MAX_RECENT = 4;
1629
+ const MAX_RECENT = 6;
1582
1630
  class BrowserStore {
1583
1631
  pages = /* @__PURE__ */ new Map();
1584
1632
  slots = /* @__PURE__ */ new Map();
@@ -1656,7 +1704,6 @@ class BrowserStore {
1656
1704
  this.pages.set(sessionId, next);
1657
1705
  if (patch.url && patch.url !== page.url && patch.url !== "about:blank") {
1658
1706
  remember(sessionId, patch.url);
1659
- if (next.cwd) rememberRecent(next.cwd, patch.url, patch.title ?? "");
1660
1707
  } else if (next.cwd && patch.title && patch.title !== page.title && next.url) {
1661
1708
  retitleRecent(next.cwd, next.url, patch.title);
1662
1709
  }
@@ -1665,6 +1712,16 @@ class BrowserStore {
1665
1712
  }
1666
1713
  this.emit();
1667
1714
  }
1715
+ /**
1716
+ * The page finished loading (`did-stop-loading`): it goes first in its project's recent pages. Only a page that
1717
+ * loaded counts, so a typo or a dead port never takes a slot; an in-page navigation (a route of a single-page app)
1718
+ * is the same visit. Recents are per project: a page whose project is not known yet records none.
1719
+ */
1720
+ recordVisit(sessionId) {
1721
+ const page = this.pages.get(sessionId);
1722
+ if (!page?.cwd || page.error || !/^https?:\/\//i.test(page.url)) return;
1723
+ rememberRecent(page.cwd, page.url, page.title);
1724
+ }
1668
1725
  navigate(sessionId, url) {
1669
1726
  const page = this.pages.get(sessionId);
1670
1727
  if (!page) return;
@@ -1735,6 +1792,14 @@ function useLiveBrowserPages() {
1735
1792
  function useBrowserSlot(sessionId) {
1736
1793
  return reactExports.useSyncExternalStore(browserStore.subscribe, () => browserStore.slot(sessionId));
1737
1794
  }
1795
+ function pageKey(url) {
1796
+ try {
1797
+ const u = new URL(url);
1798
+ return `${u.origin}${u.pathname.replace(/\/+$/, "") || "/"}`;
1799
+ } catch {
1800
+ return url;
1801
+ }
1802
+ }
1738
1803
  function recentBrowserPages(cwd) {
1739
1804
  return readRecent()[cwd] ?? [];
1740
1805
  }
@@ -1793,16 +1858,18 @@ function forget(sessionId) {
1793
1858
  }
1794
1859
  function rememberRecent(cwd, url, title) {
1795
1860
  const all = readRecent();
1796
- const prev = (all[cwd] ?? []).find((e) => e.url === url);
1861
+ const key2 = pageKey(url);
1862
+ const prev = (all[cwd] ?? []).find((e) => pageKey(e.url) === key2);
1797
1863
  all[cwd] = [
1798
1864
  { url, title: title || prev?.title || "", visitedAt: Date.now() },
1799
- ...(all[cwd] ?? []).filter((e) => e.url !== url)
1865
+ ...(all[cwd] ?? []).filter((e) => pageKey(e.url) !== key2)
1800
1866
  ].slice(0, MAX_RECENT);
1801
1867
  writeJson(RECENT_KEY, all);
1802
1868
  }
1803
1869
  function retitleRecent(cwd, url, title) {
1804
1870
  const all = readRecent();
1805
- const entry = all[cwd]?.find((e) => e.url === url);
1871
+ const key2 = pageKey(url);
1872
+ const entry = all[cwd]?.find((e) => pageKey(e.url) === key2);
1806
1873
  if (!entry || entry.title === title) return;
1807
1874
  entry.title = title;
1808
1875
  writeJson(RECENT_KEY, all);
@@ -1912,7 +1979,7 @@ function StreamProvider({ children }) {
1912
1979
  reactExports.useEffect(() => {
1913
1980
  if (!smoothStreaming) streams.drainSmoothing();
1914
1981
  }, [smoothStreaming, streams]);
1915
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SessionStreamsProvider, { streams, children });
1982
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SessionStreamsProvider, { streams, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RunEstimatesProvider, { store: runEstimates, children }) });
1916
1983
  }
1917
1984
  const useActions = () => useSessionStreamActions();
1918
1985
  const useSessionStreams = () => useSessionStreams$1();
@@ -1995,6 +2062,9 @@ function SessionsProvider({ children }) {
1995
2062
  const [ports] = reactExports.useState(() => ({ servers: writable(servers), settings: writable(directorySettings) }));
1996
2063
  reactExports.useLayoutEffect(() => ports.servers.set(servers), [ports, servers]);
1997
2064
  reactExports.useLayoutEffect(() => ports.settings.set(directorySettings), [ports, directorySettings]);
2065
+ const settingsHost = useSettingsHost();
2066
+ const settingsHostRef = reactExports.useRef(settingsHost);
2067
+ settingsHostRef.current = settingsHost;
1998
2068
  const [directory] = reactExports.useState(() => {
1999
2069
  const views2 = createSidebarViews({
2000
2070
  storage: localStorage,
@@ -2014,12 +2084,23 @@ function SessionsProvider({ children }) {
2014
2084
  serverOf: serverIdOf,
2015
2085
  pinned: pinnedSessions,
2016
2086
  pinnedSession,
2017
- onListed: noteRunStarts,
2087
+ onListed: (rows2) => {
2088
+ noteRunStarts(rows2);
2089
+ runEstimates.noteRows(rows2);
2090
+ },
2018
2091
  onRemoved: (id) => {
2019
2092
  browserStore.close(id);
2020
2093
  forgetScopeLayout(id);
2021
2094
  },
2022
- onError: (err) => console.warn("[sessions] refresh failed", err)
2095
+ onError: (err) => console.warn("[sessions] refresh failed", err),
2096
+ saveSpace: async (space) => {
2097
+ const host2 = settingsHostRef.current;
2098
+ const doc = host2.document.get();
2099
+ if (doc.status !== "ready") throw new Error("Settings are not loaded yet.");
2100
+ const list2 = Array.isArray(doc.values.spaceList) ? doc.values.spaceList : [];
2101
+ if (!host2.update) throw new Error("Settings are read-only here.");
2102
+ await host2.update({ spaceList: [...list2, space] });
2103
+ }
2023
2104
  });
2024
2105
  });
2025
2106
  reactExports.useEffect(() => {
@@ -2135,7 +2216,10 @@ function SessionsProvider({ children }) {
2135
2216
  defaultProviderKey: defaults.defaultProviderKey,
2136
2217
  defaultModelId: defaults.defaultModelId,
2137
2218
  defaultAccount: defaults.defaultAccount,
2138
- hostNotice: view.hostNotice
2219
+ hostNotice: view.hostNotice,
2220
+ switcherSpaces: view.switcherSpaces,
2221
+ hiddenSpaces: view.hiddenSpaces,
2222
+ query: view.query
2139
2223
  }),
2140
2224
  [
2141
2225
  view,
@@ -2176,6 +2260,11 @@ function SessionsProvider({ children }) {
2176
2260
  setActivityFilter: (activity) => patchView({ activity }),
2177
2261
  setGroupBy: (groupBy) => patchView({ groupBy }),
2178
2262
  setSortBy: (sortBy) => patchView({ sortBy }),
2263
+ patchView,
2264
+ setSpaceHidden: directory.setSpaceHidden,
2265
+ moveSpace: directory.moveSpace,
2266
+ attachSidebarContributions: directory.attachContributions,
2267
+ saveViewAsSpace: (name) => directory.saveViewAsSpace?.(name) ?? Promise.reject(new Error("unavailable")),
2179
2268
  refresh: directory.refresh,
2180
2269
  dismissHostNotice: directory.dismissHostNotice
2181
2270
  }),
@@ -2252,16 +2341,23 @@ function useNativeChromeZoomVar() {
2252
2341
  };
2253
2342
  }, []);
2254
2343
  }
2255
- const store = createPanelFocusStore();
2344
+ const store$1 = createPanelFocusStore();
2256
2345
  function openSessionPanel(sessionId, panelId, focus) {
2257
2346
  const id = panelId || ARTIFACTS_PANEL_ID;
2258
- store.set(sessionId, id, focus);
2347
+ store$1.set(sessionId, id, focus);
2259
2348
  updateSessionLayout(sessionId, (layout) => ({ panelOpen: true, panelTree: pickTab(layout.panelTree, id) }));
2260
2349
  }
2261
- const getPanelFocus = (sessionId, panelId) => store.get(sessionId, panelId);
2350
+ const getPanelFocus = (sessionId, panelId) => store$1.get(sessionId, panelId);
2262
2351
  function usePanelFocus(sessionId, panelId) {
2263
- const read2 = () => store.get(sessionId, panelId);
2264
- return reactExports.useSyncExternalStore(store.subscribe, read2, read2);
2352
+ const read2 = () => store$1.get(sessionId, panelId);
2353
+ return reactExports.useSyncExternalStore(store$1.subscribe, read2, read2);
2354
+ }
2355
+ const views$1 = /* @__PURE__ */ new Map();
2356
+ function getPanelView(panelId) {
2357
+ return views$1.get(panelId);
2358
+ }
2359
+ function setPanelView(panelId, control, value) {
2360
+ views$1.set(panelId, { ...views$1.get(panelId), [control]: value });
2265
2361
  }
2266
2362
  function workspaceScopeOf(scope) {
2267
2363
  return { key: scopeKey(scope), scope };
@@ -2354,11 +2450,12 @@ function PanelsProvider({ children }) {
2354
2450
  const loadContext = reactExports.useCallback(
2355
2451
  (id) => {
2356
2452
  const focus = getPanelFocus(sessionId, id)?.focus;
2357
- return focus ? { focus } : void 0;
2453
+ const view = getPanelView(id);
2454
+ return focus || view ? { ...focus ? { focus } : {}, ...view ? { view } : {} } : void 0;
2358
2455
  },
2359
2456
  [sessionId]
2360
2457
  );
2361
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
2458
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WorkspaceHostProvider, { host: host2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2362
2459
  WorkspaceProvider,
2363
2460
  {
2364
2461
  host: host2,
@@ -2369,7 +2466,7 @@ function PanelsProvider({ children }) {
2369
2466
  loadContext,
2370
2467
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(PanelsBridge, { sessionId, children })
2371
2468
  }
2372
- );
2469
+ ) });
2373
2470
  }
2374
2471
  function PanelsBridge({ sessionId, children }) {
2375
2472
  const local = useWorkspaceActions();
@@ -2458,32 +2555,14 @@ function applyPanelAction(actions, a) {
2458
2555
  return actions.focusTab(a.id);
2459
2556
  }
2460
2557
  }
2461
- const KEY$1 = "zg-sidebar-collapsed";
2462
- const standalone$1 = windowRole.kind === "session";
2463
- const read = () => standalone$1 || (readPersisted(KEY$1, parseBoolean) ?? false);
2464
- const listeners$4 = /* @__PURE__ */ new Set();
2465
- let collapsed = read();
2466
- const sidebarCollapsed = () => collapsed;
2467
- function toggleSidebar() {
2468
- if (standalone$1) return;
2469
- collapsed = !collapsed;
2470
- writePersisted(KEY$1, String(collapsed));
2471
- for (const listener of [...listeners$4]) listener();
2472
- }
2473
- const subscribe$3 = (listener) => {
2474
- listeners$4.add(listener);
2475
- return () => {
2476
- listeners$4.delete(listener);
2477
- };
2478
- };
2479
- function useSidebarCollapsed() {
2480
- return reactExports.useSyncExternalStore(subscribe$3, sidebarCollapsed, sidebarCollapsed);
2481
- }
2558
+ const store = createSidebarCollapsed({ key: "zg-sidebar-collapsed", pinned: windowRole.kind === "session" });
2559
+ const toggleSidebar = store.toggle;
2560
+ const useSidebarCollapsed = store.useCollapsed;
2482
2561
  function LayoutProvider({
2483
2562
  scope,
2484
2563
  children
2485
2564
  }) {
2486
- const sidebarCollapsed2 = useSidebarCollapsed();
2565
+ const sidebarCollapsed = useSidebarCollapsed();
2487
2566
  const appearance = useAppearanceState();
2488
2567
  const layout = useScopeLayout(scope);
2489
2568
  const panels = usePanelLayout();
@@ -2493,7 +2572,7 @@ function LayoutProvider({
2493
2572
  LayoutBudgetProvider,
2494
2573
  {
2495
2574
  sidebar: {
2496
- open: !sidebarCollapsed2,
2575
+ open: !sidebarCollapsed,
2497
2576
  width: appearance.sidebarWidth,
2498
2577
  min: LIMITS.sidebarWidth.min,
2499
2578
  max: LIMITS.sidebarWidth.max
@@ -2510,6 +2589,52 @@ function LayoutProvider({
2510
2589
  }
2511
2590
  );
2512
2591
  }
2592
+ function createStore(initial) {
2593
+ let value = initial;
2594
+ const listeners2 = /* @__PURE__ */ new Set();
2595
+ return {
2596
+ get: () => value,
2597
+ set(next) {
2598
+ if (next === value) return;
2599
+ value = next;
2600
+ for (const listener of listeners2) listener();
2601
+ },
2602
+ subscribe(listener) {
2603
+ listeners2.add(listener);
2604
+ return () => listeners2.delete(listener);
2605
+ }
2606
+ };
2607
+ }
2608
+ const request = createStore(null);
2609
+ const home = createStore(null);
2610
+ const chatDraft = createStore(false);
2611
+ let seq = 0;
2612
+ function requestDraftOn(hostId, folder) {
2613
+ request.set({ seq: ++seq, hostId, folder });
2614
+ }
2615
+ function requestFolderlessDraft() {
2616
+ request.set({ seq: ++seq, hostId: LOCAL_HOST_KEY, folder: null, folderless: true });
2617
+ }
2618
+ function clearDraftRequest() {
2619
+ request.set(null);
2620
+ }
2621
+ function useDraftRequest() {
2622
+ return reactExports.useSyncExternalStore(request.subscribe, request.get, request.get);
2623
+ }
2624
+ function publishHomeProject(project) {
2625
+ const current = home.get();
2626
+ if (current?.path === project?.path && current?.hostId === project?.hostId) return;
2627
+ home.set(project);
2628
+ }
2629
+ function publishChatDraft(open) {
2630
+ chatDraft.set(open);
2631
+ }
2632
+ function useChatDraft() {
2633
+ return reactExports.useSyncExternalStore(chatDraft.subscribe, chatDraft.get, chatDraft.get);
2634
+ }
2635
+ function useHomeProject() {
2636
+ return reactExports.useSyncExternalStore(home.subscribe, home.get, home.get);
2637
+ }
2513
2638
  function useTurnMenu(sessionId) {
2514
2639
  const { setActiveSessionId, refresh } = useSessionsActions();
2515
2640
  const setEventsPage = useSetEventsPage();
@@ -2598,10 +2723,10 @@ function getCommandsCatalog(cwd, hostId) {
2598
2723
  }
2599
2724
  const values = /* @__PURE__ */ new Map();
2600
2725
  const requested = /* @__PURE__ */ new Set();
2601
- const listeners$3 = /* @__PURE__ */ new Set();
2726
+ const listeners$4 = /* @__PURE__ */ new Set();
2602
2727
  const keyOf = (scope, name) => `${scope.hostId ?? ""}\0${scope.cwd}\0${name.toLowerCase()}`;
2603
2728
  function notify() {
2604
- listeners$3.forEach((listener) => listener());
2729
+ listeners$4.forEach((listener) => listener());
2605
2730
  }
2606
2731
  function noteCommandArgs(scope, name, found) {
2607
2732
  const key2 = keyOf(scope, name);
@@ -2632,8 +2757,8 @@ function commandArgs(scope, name) {
2632
2757
  }
2633
2758
  const EMPTY = /* @__PURE__ */ new Set();
2634
2759
  function onCommandArgs(listener) {
2635
- listeners$3.add(listener);
2636
- return () => void listeners$3.delete(listener);
2760
+ listeners$4.add(listener);
2761
+ return () => void listeners$4.delete(listener);
2637
2762
  }
2638
2763
  function useCommandArgs(name) {
2639
2764
  const scope = reactExports.useContext(CommandScopeContext);
@@ -2684,6 +2809,7 @@ const GUI_TRANSCRIPT_RENDERERS = {
2684
2809
  InlineText: InlineChipText,
2685
2810
  Prompt,
2686
2811
  SessionTitle,
2812
+ // A plan / question / todo call drawn as its panel draws it.
2687
2813
  ToolBody: InteractionToolBody,
2688
2814
  hasToolBody: hasInteractionBody
2689
2815
  };
@@ -2754,10 +2880,6 @@ function createElectronComposerChrome(api, options) {
2754
2880
  noteSeen: runMeter2.noteSeen,
2755
2881
  noteProgress: runMeter2.noteProgress,
2756
2882
  settleCost: runMeter2.settleCost
2757
- },
2758
- hud: {
2759
- get: () => api.hud.get(),
2760
- onState: (listener) => api.hud.onState(listener)
2761
2883
  }
2762
2884
  };
2763
2885
  }
@@ -2922,56 +3044,7 @@ const Timeline = reactExports.memo(({ events, isStreaming, sessionId }) => {
2922
3044
  () => hasSession2 ? { cwd: scopeCwd, hostId: scopeHostId } : null,
2923
3045
  [hasSession2, scopeCwd, scopeHostId]
2924
3046
  );
2925
- const {
2926
- showRowIcons,
2927
- showThinking,
2928
- showToolResults,
2929
- showEditDiffs,
2930
- showFullShellOutput,
2931
- groupToolCalls,
2932
- toolCallDisplay,
2933
- transcriptDensity,
2934
- hideSubagentOutput,
2935
- showRunReceipt,
2936
- thinkingAutoExpand,
2937
- showCacheNotices,
2938
- codemodeShowCalls,
2939
- showToolAttachments
2940
- } = settings;
2941
- const options = reactExports.useMemo(
2942
- () => ({
2943
- showRowIcons,
2944
- showThinking,
2945
- showToolResults,
2946
- showEditDiffs,
2947
- showFullShellOutput,
2948
- groupToolCalls,
2949
- toolCallDisplay,
2950
- transcriptDensity,
2951
- hideSubagentOutput,
2952
- showRunReceipt,
2953
- thinkingAutoExpand,
2954
- showCacheNotices,
2955
- codemodeShowCalls,
2956
- showToolAttachments
2957
- }),
2958
- [
2959
- showRowIcons,
2960
- showThinking,
2961
- showToolResults,
2962
- showEditDiffs,
2963
- showFullShellOutput,
2964
- groupToolCalls,
2965
- toolCallDisplay,
2966
- transcriptDensity,
2967
- hideSubagentOutput,
2968
- showRunReceipt,
2969
- thinkingAutoExpand,
2970
- showCacheNotices,
2971
- codemodeShowCalls,
2972
- showToolAttachments
2973
- ]
2974
- );
3047
+ const options = useTranscriptOptions(settings);
2975
3048
  const selected = selectTurn.state && selectTurn.state.sessionId === sessionId ? selectTurn.state.turnId : null;
2976
3049
  const { registerStops: registerSessionStops } = selectTurn;
2977
3050
  const registerStops = reactExports.useCallback(
@@ -2993,6 +3066,12 @@ const Timeline = reactExports.memo(({ events, isStreaming, sessionId }) => {
2993
3066
  const runStatus = reactExports.useMemo(() => ({ retry }), [retry]);
2994
3067
  const modelName = useModelName();
2995
3068
  const openTarget = useOpenTarget();
3069
+ const scopeRoot = session?.projectRoot;
3070
+ const scopeWorkspace = session?.workspace;
3071
+ const terminalScope = reactExports.useMemo(
3072
+ () => sessionId && hasSession2 && settings.terminal !== false && session?.archived !== true ? scopeOfSession({ id: sessionId, cwd: scopeCwd, projectRoot: scopeRoot, workspace: scopeWorkspace }) : null,
3073
+ [sessionId, hasSession2, settings.terminal, session?.archived, scopeCwd, scopeRoot, scopeWorkspace]
3074
+ );
2996
3075
  const actions = reactExports.useMemo(
2997
3076
  () => ({
2998
3077
  sessionId,
@@ -3009,11 +3088,12 @@ const Timeline = reactExports.memo(({ events, isStreaming, sessionId }) => {
3009
3088
  // Files the session wrote, on this computer only: a server session's files are on the server.
3010
3089
  ...sessionId && serverIdOf(sessionId) === null && scopeCwd ? {
3011
3090
  openFile: (path, event) => void openTarget.file(`${scopeCwd.replace(/\/+$/, "")}/${path}`, event)
3012
- } : {}
3091
+ } : {},
3092
+ ...terminalScope ? { runInTerminal: (input) => void terminalStore.runIn(terminalScope, input) } : {}
3013
3093
  }),
3014
- [sessionId, openSession, modelName, openTarget, scopeCwd]
3094
+ [sessionId, openSession, modelName, openTarget, scopeCwd, terminalScope]
3015
3095
  );
3016
- return /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownContext.Provider, { value: markdownCtx, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CommandScopeContext.Provider, { value: commandScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptRenderersProvider, { value: GUI_TRANSCRIPT_RENDERERS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptActionsProvider, { value: actions, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3096
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownContext.Provider, { value: markdownCtx, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CommandScopeContext.Provider, { value: commandScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptRenderersProvider, { value: GUI_TRANSCRIPT_RENDERERS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptActionsProvider, { value: actions, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PathDisplayScope, { hostId: sessionId ? serverIdOf(sessionId) : null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3017
3097
  Transcript,
3018
3098
  {
3019
3099
  events,
@@ -3025,7 +3105,7 @@ const Timeline = reactExports.memo(({ events, isStreaming, sessionId }) => {
3025
3105
  runStatus,
3026
3106
  children: turnMenu.menu
3027
3107
  }
3028
- ) }) }) }) });
3108
+ ) }) }) }) }) });
3029
3109
  });
3030
3110
  function tokenizeQuery(query) {
3031
3111
  const tokens = [];
@@ -3089,6 +3169,909 @@ function TranscriptSearch({
3089
3169
  const events = useSessionEvents(sessionId);
3090
3170
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptSearch$1, { ...props, revision: events, terms: tokenizeQuery });
3091
3171
  }
3172
+ const usePresenceMap = usePresenceMap$1;
3173
+ const useSessionPresence = useSessionPresence$1;
3174
+ function usePending(sessionId) {
3175
+ const approval = useSessionApprovalHead(sessionId);
3176
+ const interaction = useInteractionHead(sessionId);
3177
+ return Boolean(approval) || Boolean(interaction);
3178
+ }
3179
+ const sidebarLive = createSidebarLive({
3180
+ useRunning: (sessionId) => useSessionRunning(sessionId),
3181
+ useRunElapsedSec: (sessionId, live, intervalMs) => useRunElapsedSec(sessionId, live, intervalMs),
3182
+ usePending,
3183
+ useNotification: (sessionId) => useSessionNotification(sessionId),
3184
+ usePresence: (sessionId) => useSessionPresence(sessionId),
3185
+ useHost: (hostId) => useHosts().hostById(hostId),
3186
+ activity: sessionActivity,
3187
+ estimates: runEstimates,
3188
+ badges: sessionBadges,
3189
+ openBadge: (sessionId, panel, focus) => openSessionPanel(sessionId, panel, focus)
3190
+ });
3191
+ const useSessionDotState = sidebarLive.useSessionDotState;
3192
+ const SessionStatusDot$1 = sidebarLive.SessionStatusDot;
3193
+ const HOST_MODULE_PREFIX = "zidane-host:";
3194
+ const DESKTOP_HOST_MODULES = {
3195
+ react: React,
3196
+ "react/jsx-runtime": ReactJsxRuntime,
3197
+ // Bundled in production mode, so the dev runtime is never asked for; mapped to the same runtime if it is.
3198
+ "react/jsx-dev-runtime": ReactJsxRuntime,
3199
+ "react-dom": ReactDom,
3200
+ "react-dom/client": ReactDomClient,
3201
+ "zidane-ui/extensions": ZidaneUiExtensions,
3202
+ "zidane-ui/extensions/kit": ZidaneUiExtensionsKit
3203
+ };
3204
+ const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
3205
+ const RESERVED$1 = /* @__PURE__ */ new Set([
3206
+ "default",
3207
+ "await",
3208
+ "enum",
3209
+ "implements",
3210
+ "interface",
3211
+ "package",
3212
+ "private",
3213
+ "protected",
3214
+ "public",
3215
+ "static",
3216
+ "yield"
3217
+ ]);
3218
+ const GLOBAL_KEY = "__zidaneHostModules";
3219
+ function hostModuleShim(specifier, mod) {
3220
+ const names = Object.keys(mod).filter((name) => IDENTIFIER.test(name) && !RESERVED$1.has(name));
3221
+ const ref = `globalThis[${JSON.stringify(GLOBAL_KEY)}][${JSON.stringify(specifier)}]`;
3222
+ return [
3223
+ `const m = ${ref};`,
3224
+ `export default (m.default ?? m);`,
3225
+ ...names.length > 0 ? [`export const { ${names.join(", ")} } = m;`] : []
3226
+ ].join("\n");
3227
+ }
3228
+ function linkHostModules(code2, urlOf) {
3229
+ return code2.replace(
3230
+ /(["'])zidane-host:([^"']+)\1/g,
3231
+ (_match, quote, specifier) => `${quote}${urlOf(specifier)}${quote}`
3232
+ );
3233
+ }
3234
+ async function importFromBlob(source) {
3235
+ const url = URL.createObjectURL(new Blob([source], { type: "text/javascript" }));
3236
+ try {
3237
+ return await import(
3238
+ /* @vite-ignore */
3239
+ url
3240
+ );
3241
+ } finally {
3242
+ URL.revokeObjectURL(url);
3243
+ }
3244
+ }
3245
+ function createExtensionModuleLoader(options) {
3246
+ const hostModules = options.hostModules ?? DESKTOP_HOST_MODULES;
3247
+ const importSource = options.importSource ?? importFromBlob;
3248
+ const shims = /* @__PURE__ */ new Map();
3249
+ const loaded = /* @__PURE__ */ new Map();
3250
+ globalThis[GLOBAL_KEY] = hostModules;
3251
+ const shimUrl = (specifier) => {
3252
+ const mod = hostModules[specifier];
3253
+ if (!mod)
3254
+ throw new Error(
3255
+ `"${specifier}" is not provided by the desktop app (it provides ${Object.keys(hostModules).join(", ")}).`
3256
+ );
3257
+ let url = shims.get(specifier);
3258
+ if (!url) {
3259
+ url = typeof URL.createObjectURL === "function" ? URL.createObjectURL(new Blob([hostModuleShim(specifier, mod)], { type: "text/javascript" })) : `${HOST_MODULE_PREFIX}${specifier}`;
3260
+ shims.set(specifier, url);
3261
+ }
3262
+ return url;
3263
+ };
3264
+ return async (extensionId) => {
3265
+ const cwd = options.folder();
3266
+ if (cwd === void 0) throw new Error("No folder is open: extension components have nothing to load from.");
3267
+ const result = await options.api.module(cwd, extensionId);
3268
+ if (!result.ok) throw new Error(result.message);
3269
+ const key2 = `${extensionId}\0${result.value.hash}`;
3270
+ let module = loaded.get(key2);
3271
+ if (!module) {
3272
+ module = importSource(linkHostModules(result.value.code, shimUrl));
3273
+ loaded.set(key2, module);
3274
+ module.catch(() => loaded.delete(key2));
3275
+ }
3276
+ return module;
3277
+ };
3278
+ }
3279
+ const EVERY_FOLDER = "*";
3280
+ const EXTENSION_WEBVIEW_SCHEME = "zg-extview";
3281
+ function webviewFileUrl(extensionId, cwd, file) {
3282
+ const path = file.split(/[\\/]+/).filter((s) => s && s !== ".").map(encodeURIComponent).join("/");
3283
+ return `${EXTENSION_WEBVIEW_SCHEME}://${encodeURIComponent(extensionId)}/${encodeURIComponent(cwd)}/${path}`;
3284
+ }
3285
+ const CATALOG_KINDS = [
3286
+ "tools",
3287
+ "agents",
3288
+ "subagents",
3289
+ "models",
3290
+ "providers",
3291
+ "mcp",
3292
+ "skills"
3293
+ ];
3294
+ function connectionsOf(i) {
3295
+ const raw = i.connections ?? (i.connection ? [i.connection] : []);
3296
+ const defaultAccount = i.connection?.account ?? raw.find((c) => c.isDefault)?.account ?? raw[0]?.account;
3297
+ const connections = raw.map((c) => ({
3298
+ methodId: c.methodId,
3299
+ account: c.account || "default",
3300
+ ...c.label ? { label: c.label } : {},
3301
+ ...c.account === defaultAccount ? { isDefault: true } : {},
3302
+ connectedAt: c.connectedAt
3303
+ }));
3304
+ const connection = connections.find((c) => c.isDefault);
3305
+ return { ...connection ? { connection } : {}, ...connections.length > 0 ? { connections } : {} };
3306
+ }
3307
+ const empty = () => Object.fromEntries(EXTENSION_TOKENS.map((t) => [t, []]));
3308
+ function desktopWebviewSrc(webview, extension, cwd) {
3309
+ if ("file" in webview.src) return cwd ? webviewFileUrl(extension, cwd, webview.src.file) : null;
3310
+ return httpUrl(webview.src.url);
3311
+ }
3312
+ function httpUrl(raw) {
3313
+ try {
3314
+ const url = new URL(raw);
3315
+ return url.protocol === "https:" || url.protocol === "http:" ? url.href : null;
3316
+ } catch {
3317
+ return null;
3318
+ }
3319
+ }
3320
+ async function unwrap(call) {
3321
+ let result;
3322
+ try {
3323
+ result = await call;
3324
+ } catch {
3325
+ throw new ExtensionsHostError({ code: "unavailable" });
3326
+ }
3327
+ if (result.ok) return result.value;
3328
+ if (result.reason === "locked" || result.reason === "invalid")
3329
+ throw new ExtensionsHostError({ code: "refused", reason: result.reason, message: result.message });
3330
+ if (result.reason === "unavailable") throw new ExtensionsHostError({ code: "unavailable" });
3331
+ throw new ExtensionsHostError({ code: "failed", message: result.message });
3332
+ }
3333
+ function invokeRequest(id, args) {
3334
+ const a = args;
3335
+ switch (id) {
3336
+ case "panel.load":
3337
+ return { cwd: a.cwd, request: { op: "panel.load", panelId: a.panelId, ctx: a.context } };
3338
+ case "panel.action":
3339
+ return {
3340
+ cwd: a.cwd,
3341
+ request: {
3342
+ op: "panel.action",
3343
+ panelId: a.panelId,
3344
+ actionId: a.actionId,
3345
+ payload: a.payload,
3346
+ ctx: a.context
3347
+ }
3348
+ };
3349
+ case "reference.resolve":
3350
+ return { request: { op: "reference.resolve", providerId: a.providerId, key: a.key } };
3351
+ case "badge.menu":
3352
+ return { request: { op: "badge.menu", target: a.target } };
3353
+ case "badge.run":
3354
+ return {
3355
+ ...typeof a.cwd === "string" ? { cwd: a.cwd } : {},
3356
+ request: {
3357
+ op: "badge.run",
3358
+ source: a.source,
3359
+ actionId: a.actionId,
3360
+ target: a.target,
3361
+ ...typeof a.sessionId === "string" ? { sessionId: a.sessionId } : {}
3362
+ }
3363
+ };
3364
+ case "setting.action":
3365
+ return { request: { op: "setting.action", pageId: a.pageId, key: a.key } };
3366
+ case "setting.status":
3367
+ return { request: { op: "setting.status", pageId: a.pageId, key: a.key } };
3368
+ default:
3369
+ throw new ExtensionsHostError({ code: "unavailable" });
3370
+ }
3371
+ }
3372
+ function effectOf(request2) {
3373
+ switch (request2.op) {
3374
+ case "panel":
3375
+ return {
3376
+ kind: "panel",
3377
+ action: request2.action,
3378
+ panelId: request2.panelId,
3379
+ ...request2.sessionId ? { sessionId: request2.sessionId } : {},
3380
+ ...request2.focus ? { focus: request2.focus } : {}
3381
+ };
3382
+ case "panelState":
3383
+ return { kind: "panel-state", ...request2.sessionId ? { sessionId: request2.sessionId } : {} };
3384
+ case "navigate":
3385
+ return { kind: "navigate", to: request2.to };
3386
+ case "composer":
3387
+ return {
3388
+ kind: "composer",
3389
+ op: request2.edit,
3390
+ ...request2.sessionId ? { sessionId: request2.sessionId } : {}
3391
+ };
3392
+ case "notify":
3393
+ return { kind: "notify", ...request2 };
3394
+ // Pressed in this window, in the view of the session it names (main routed it here).
3395
+ case "keymap.dispatch":
3396
+ return { kind: "keymap", chord: request2.chord, ...request2.sessionId ? { sessionId: request2.sessionId } : {} };
3397
+ }
3398
+ }
3399
+ const storeKey = (ref) => JSON.stringify([ref.extensionId, ref.name, ref.scope, ref.sessionId ?? ""]);
3400
+ function createElectronExtensionsHost(api = window.api.extensionHost, options = {}) {
3401
+ const folder = writable(options.folder);
3402
+ const hostIdStore = writable(options.hostId);
3403
+ const whereOf = (cwd) => {
3404
+ const hostId = hostIdStore.get();
3405
+ return hostId ? { cwd, hostId } : cwd;
3406
+ };
3407
+ const target = () => {
3408
+ const cwd = folder.get();
3409
+ return cwd === void 0 ? void 0 : whereOf(cwd);
3410
+ };
3411
+ const keyOf2 = (sessionId) => sessionKey(hostIdStore.get() ?? null, sessionId);
3412
+ const hostSession = (key2) => parseSessionKey(key2).sessionId;
3413
+ const windowItem = (item) => {
3414
+ const scoped = item;
3415
+ return hostIdStore.get() && typeof scoped.sessionId === "string" ? { ...scoped, sessionId: keyOf2(scoped.sessionId) } : item;
3416
+ };
3417
+ const tokenStores = Object.fromEntries(
3418
+ EXTENSION_TOKENS.map((t) => [t, writable([])])
3419
+ );
3420
+ const settingsWire = writable({
3421
+ schema: { categories: [], items: [] },
3422
+ actions: [],
3423
+ values: {},
3424
+ locked: []
3425
+ });
3426
+ const integrationList = writable([]);
3427
+ const commandList = writable([]);
3428
+ const keyCommands = writable([]);
3429
+ const keymapMode = writable(void 0);
3430
+ const sessionMenu = writable([]);
3431
+ const scope = writable(null);
3432
+ const panelListeners = /* @__PURE__ */ new Set();
3433
+ const queue = createDialogQueue();
3434
+ const channel = createUiEffectChannel();
3435
+ const closers = /* @__PURE__ */ new Map();
3436
+ let generation = 0;
3437
+ const publishItems = (all) => {
3438
+ for (const token of EXTENSION_TOKENS) tokenStores[token].set((all[token] ?? []).map(windowItem));
3439
+ };
3440
+ const requireFolder = () => {
3441
+ const where = target();
3442
+ if (where === void 0) throw new ExtensionsHostError({ code: "unavailable" });
3443
+ return where;
3444
+ };
3445
+ const reload = {
3446
+ items: async () => {
3447
+ const cwd = target();
3448
+ const at = generation;
3449
+ if (cwd === void 0) return publishItems(empty());
3450
+ const result = await api.list(cwd).catch(() => void 0);
3451
+ if (at !== generation || !result?.ok) return;
3452
+ const snapshot = result.value;
3453
+ const all = empty();
3454
+ for (const token of EXTENSION_TOKENS) all[token] = snapshot[token] ?? [];
3455
+ publishItems(all);
3456
+ },
3457
+ settings: async () => {
3458
+ const cwd = target();
3459
+ const at = generation;
3460
+ if (cwd === void 0) return;
3461
+ const [result, provenance] = await Promise.all([
3462
+ api.settings.get(cwd).catch(() => void 0),
3463
+ Promise.all(
3464
+ CATALOG_KINDS.map(async (kind) => {
3465
+ const changed2 = await api.catalogProvenance?.(cwd, kind).catch(() => void 0);
3466
+ return changed2?.ok ? changed2.value.map((item) => ({ ...item, kind })) : [];
3467
+ })
3468
+ )
3469
+ ]);
3470
+ if (at !== generation || !result?.ok) return;
3471
+ const { sources: _sources, clientScope, ...wire2 } = result.value;
3472
+ scope.set(clientScope ?? null);
3473
+ settingsWire.set({
3474
+ ...wire2,
3475
+ provenance: provenance.flat()
3476
+ });
3477
+ },
3478
+ integrations: async () => {
3479
+ const cwd = target();
3480
+ const at = generation;
3481
+ if (cwd === void 0) return integrationList.set([]);
3482
+ const result = await api.integrations.list(cwd).catch(() => void 0);
3483
+ if (at !== generation || !result?.ok) return;
3484
+ integrationList.set(
3485
+ result.value.map((i) => ({
3486
+ id: i.id,
3487
+ name: i.name,
3488
+ ...i.description !== void 0 ? { description: i.description } : {},
3489
+ extensionId: i.extensionId,
3490
+ methods: i.methods.map((m) => ({
3491
+ type: m.type,
3492
+ id: m.id,
3493
+ label: m.label,
3494
+ ..."placeholder" in m && typeof m.placeholder === "string" ? { placeholder: m.placeholder } : {},
3495
+ ..."help" in m && typeof m.help === "string" ? { help: m.help } : {}
3496
+ })),
3497
+ ...connectionsOf(i)
3498
+ }))
3499
+ );
3500
+ },
3501
+ commands: async () => {
3502
+ const cwd = target();
3503
+ const at = generation;
3504
+ if (cwd === void 0) {
3505
+ commandList.set([]);
3506
+ keyCommands.set([]);
3507
+ return;
3508
+ }
3509
+ const result = await api.commands.list(cwd).catch(() => void 0);
3510
+ if (at !== generation || !result?.ok) return;
3511
+ keyCommands.set(result.value.commands);
3512
+ keymapMode.set(result.value.mode);
3513
+ commandList.set(
3514
+ result.value.commands.map((c) => ({
3515
+ id: c.id,
3516
+ title: c.title,
3517
+ ...c.description !== void 0 ? { description: c.description } : {},
3518
+ ...c.slash ? { slash: c.slash.name } : {},
3519
+ ...c.bind.length > 0 ? { bind: c.bind } : {},
3520
+ ...c.extensionId ? { extensionId: c.extensionId } : {}
3521
+ }))
3522
+ );
3523
+ }
3524
+ };
3525
+ const reloadMenus = async () => {
3526
+ const cwd = target();
3527
+ const at = generation;
3528
+ if (cwd === void 0) return sessionMenu.set([]);
3529
+ const result = await api.menus(cwd).catch(() => void 0);
3530
+ if (at !== generation || !result?.ok) return;
3531
+ sessionMenu.set(result.value.filter((m) => m.menu === "session"));
3532
+ };
3533
+ const reloadAll = () => {
3534
+ void reloadMenus();
3535
+ void reload.items();
3536
+ void reload.settings();
3537
+ void reload.integrations();
3538
+ void reload.commands();
3539
+ };
3540
+ const stores = /* @__PURE__ */ new Map();
3541
+ const location2 = (ref) => ref.scope === "session" ? { extensionId: ref.extensionId, scope: "session", sessionId: hostSession(ref.sessionId ?? "") } : { extensionId: ref.extensionId, scope: ref.scope };
3542
+ const readRecord = (entry, raw) => {
3543
+ const record = raw;
3544
+ if (record && typeof record === "object" && "value" in record) {
3545
+ if (typeof record.v === "number") entry.v = record.v;
3546
+ entry.value.set(record.value);
3547
+ } else entry.value.set(void 0);
3548
+ };
3549
+ const loadStore = async (entry) => {
3550
+ const cwd = target();
3551
+ if (cwd === void 0) return;
3552
+ const result = await api.storage.load(cwd, location2(entry.ref)).catch(() => void 0);
3553
+ if (!result?.ok) return;
3554
+ entry.projectRoot = result.value.projectRoot;
3555
+ readRecord(entry, result.value.stores[entry.ref.name]);
3556
+ };
3557
+ const mine = (signal) => signal.host === hostIdStore.get() && (signal.cwd === void 0 || signal.cwd === folder.get());
3558
+ const onSignal = (signal) => {
3559
+ switch (signal.kind) {
3560
+ case "extensions:ui": {
3561
+ if (signal.cwd === EVERY_FOLDER && signal.host === void 0 && hostIdStore.get() === void 0) {
3562
+ generation++;
3563
+ return reloadAll();
3564
+ }
3565
+ if (!mine(signal)) return;
3566
+ const change = signal.change;
3567
+ if (change.type === "reset") return reloadAll();
3568
+ if (change.type === "upsert" && change.entry.token === "menu" || change.type === "remove" && change.token === "menu")
3569
+ return void reloadMenus();
3570
+ if (change.type === "panel-changed") {
3571
+ const event = {
3572
+ extensionId: change.extension,
3573
+ panelId: change.panelId,
3574
+ ...change.sessionId ? { sessionId: hostIdStore.get() ? keyOf2(change.sessionId) : change.sessionId } : {}
3575
+ };
3576
+ for (const listener of [...panelListeners]) listener(event);
3577
+ return;
3578
+ }
3579
+ if (change.type === "upsert") {
3580
+ const entry = windowItem(change.entry);
3581
+ const store2 = tokenStores[entry.token];
3582
+ if (!store2) return;
3583
+ const list2 = store2.get();
3584
+ const at = list2.findIndex((i) => i.key === entry.key);
3585
+ const next = at >= 0 ? list2.map((i, n) => n === at ? entry : i) : [...list2, entry];
3586
+ if (entry.token === "slot")
3587
+ next.sort((a, b) => a.item.order - b.item.order);
3588
+ store2.set(next);
3589
+ return;
3590
+ }
3591
+ if (change.type === "remove") {
3592
+ const store2 = tokenStores[change.token];
3593
+ store2?.set(store2.get().filter((i) => i.key !== change.key));
3594
+ }
3595
+ return;
3596
+ }
3597
+ case "extensions:commands":
3598
+ case "extensions:keymap":
3599
+ if (mine(signal)) void reload.commands();
3600
+ return;
3601
+ case "extensions:integrations":
3602
+ if (mine(signal)) void reload.integrations();
3603
+ return;
3604
+ // An extension of the folder loaded, reloaded or went: its items, commands and bundle may be new.
3605
+ case "extensions:entries":
3606
+ if (mine(signal)) reloadAll();
3607
+ return;
3608
+ case "extensions:storage": {
3609
+ if (signal.area !== "stores" || signal.host !== hostIdStore.get()) return;
3610
+ for (const entry of stores.values()) {
3611
+ const { ref } = entry;
3612
+ if (ref.extensionId !== signal.extensionId || ref.name !== signal.key || ref.scope !== signal.scope) continue;
3613
+ if (ref.scope === "session" && keyOf2(signal.sessionId ?? "") !== ref.sessionId) continue;
3614
+ if (ref.scope !== "user" && entry.projectRoot !== signal.projectRoot) continue;
3615
+ readRecord(entry, signal.value);
3616
+ }
3617
+ return;
3618
+ }
3619
+ case "ui:dialog": {
3620
+ const controller = new AbortController();
3621
+ closers.set(signal.dialogId, controller);
3622
+ queue.show(signal.request, {
3623
+ id: signal.dialogId,
3624
+ extensionId: signal.extensionId,
3625
+ ...signal.sessionId ? { sessionId: signal.sessionId } : {},
3626
+ signal: controller.signal
3627
+ }).then(
3628
+ (answer) => void api.answerDialog(signal.dialogId, answer),
3629
+ () => void 0
3630
+ ).finally(() => closers.delete(signal.dialogId));
3631
+ return;
3632
+ }
3633
+ // A sign-in step for this window: main opened its link already; a question shows as a dialog here.
3634
+ case "extensions:integration-flow": {
3635
+ const { flowId, step } = signal;
3636
+ const ask = (request2, inputId, pick) => void queue.show(request2, { extensionId: "zidane" }).then(
3637
+ (answer) => void api.integrations.flowInput(
3638
+ flowId,
3639
+ inputId,
3640
+ pick ? pick(answer) : typeof answer === "string" ? answer : void 0
3641
+ ),
3642
+ () => void api.integrations.flowInput(flowId, inputId, void 0)
3643
+ );
3644
+ if (step.type === "device")
3645
+ void queue.show({ kind: "toast", text: `${step.userCode} · ${step.verificationUri}`, tone: "info" }, {
3646
+ extensionId: "zidane"
3647
+ }).catch(() => void 0);
3648
+ else if (step.type === "prompt")
3649
+ ask(
3650
+ { kind: "prompt", title: step.message, ...step.placeholder ? { placeholder: step.placeholder } : {} },
3651
+ step.inputId
3652
+ );
3653
+ else if (step.type === "manual-code")
3654
+ ask({ kind: "prompt", title: "Paste the address the browser ended on" }, step.inputId);
3655
+ else if (step.type === "select")
3656
+ ask(
3657
+ { kind: "select", title: step.message, options: step.options },
3658
+ step.inputId,
3659
+ (answer) => answer?.ids?.[0]
3660
+ );
3661
+ return;
3662
+ }
3663
+ case "ui:dialog:close":
3664
+ closers.get(signal.dialogId)?.abort(new Error("The extension withdrew the dialog."));
3665
+ return;
3666
+ case "ui:client": {
3667
+ const { requestId, request: request2 } = signal;
3668
+ void channel.apply(effectOf(request2)).then((result) => {
3669
+ if (requestId) void api.reply(requestId, result);
3670
+ });
3671
+ return;
3672
+ }
3673
+ }
3674
+ };
3675
+ const stop = api.onSignal(onSignal);
3676
+ reloadAll();
3677
+ const items = tokenStores;
3678
+ const minted = /* @__PURE__ */ new Map();
3679
+ const webviewListeners = /* @__PURE__ */ new Set();
3680
+ const webviews = {
3681
+ resolveSrc(webview, extension) {
3682
+ const hostId = hostIdStore.get();
3683
+ if (!hostId) return desktopWebviewSrc(webview, extension, folder.get());
3684
+ if ("url" in webview.src) return httpUrl(webview.src.url);
3685
+ const where = target();
3686
+ if (where === void 0) return null;
3687
+ const key2 = JSON.stringify([hostId, folder.get(), webview.id]);
3688
+ if (minted.has(key2)) return minted.get(key2) ?? null;
3689
+ minted.set(key2, null);
3690
+ void api.webviewUrl(where, webview.id).then((result) => {
3691
+ if (!minted.has(key2)) return;
3692
+ const url = result.ok && result.value ? httpUrl(result.value) : null;
3693
+ if (!url) return void minted.delete(key2);
3694
+ minted.set(key2, url);
3695
+ for (const listener of [...webviewListeners]) listener();
3696
+ }).catch(() => minted.delete(key2));
3697
+ return null;
3698
+ },
3699
+ subscribe(listener) {
3700
+ webviewListeners.add(listener);
3701
+ return () => webviewListeners.delete(listener);
3702
+ },
3703
+ sandbox: "allow-scripts allow-forms"
3704
+ };
3705
+ return {
3706
+ items,
3707
+ folder,
3708
+ hostId: hostIdStore,
3709
+ target,
3710
+ setFolder(cwd, hostId) {
3711
+ if (cwd === folder.get() && hostId === hostIdStore.get()) return;
3712
+ generation++;
3713
+ hostIdStore.set(hostId);
3714
+ folder.set(cwd);
3715
+ minted.clear();
3716
+ publishItems(empty());
3717
+ reloadAll();
3718
+ for (const entry of stores.values()) void loadStore(entry);
3719
+ for (const listener of [...webviewListeners]) listener();
3720
+ },
3721
+ webviews,
3722
+ announce(info) {
3723
+ void api.announce({ ...info, dialogs: true, ui: true });
3724
+ },
3725
+ keyCommands,
3726
+ keymapMode,
3727
+ sessionMenu,
3728
+ scope,
3729
+ async openLink(request2) {
3730
+ const where = target();
3731
+ if (where === void 0) return false;
3732
+ const result = await api.openLink(where, {
3733
+ url: request2.url,
3734
+ source: request2.source,
3735
+ // The session as the host names it.
3736
+ ...request2.sessionId ? { sessionId: hostSession(request2.sessionId) } : {}
3737
+ }).catch(() => void 0);
3738
+ return result?.ok === true && result.value.handled === true;
3739
+ },
3740
+ panelChanged(listener) {
3741
+ panelListeners.add(listener);
3742
+ return () => panelListeners.delete(listener);
3743
+ },
3744
+ dispose() {
3745
+ stop();
3746
+ queue.clear();
3747
+ },
3748
+ invoke: async (callbackId, args) => {
3749
+ const { cwd, request: request2 } = invokeRequest(callbackId, args);
3750
+ const sent = request2.op === "badge.run" && request2.sessionId ? { ...request2, sessionId: hostSession(request2.sessionId) } : request2;
3751
+ return unwrap(api.invoke(cwd !== void 0 ? whereOf(cwd) : requireFolder(), sent));
3752
+ },
3753
+ dialogs: queue.dialogs,
3754
+ effects: channel.effects,
3755
+ rpc: async (contract, method, input, opts = {}) => {
3756
+ if (!opts.extensionId)
3757
+ throw new ExtensionsHostError({
3758
+ code: "refused",
3759
+ reason: "not-allowed",
3760
+ message: "An RPC call from the UI names its extension."
3761
+ });
3762
+ if (opts.signal?.aborted) throw new ExtensionsHostError({ code: "rpc", type: "rpc.aborted", message: "aborted" });
3763
+ const callId = `c${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
3764
+ const onAbort = () => void api.cancelRpc(callId);
3765
+ opts.signal?.addEventListener("abort", onAbort, { once: true });
3766
+ try {
3767
+ const envelope = await unwrap(
3768
+ api.rpc(target() ?? "", {
3769
+ contract,
3770
+ method,
3771
+ ...input !== void 0 ? { input } : {},
3772
+ extensionId: opts.extensionId,
3773
+ callId
3774
+ })
3775
+ );
3776
+ if (envelope.ok) return envelope.output;
3777
+ const { type, message, data } = envelope.error;
3778
+ throw new ExtensionsHostError({ code: "rpc", type, message, ...data !== void 0 ? { data } : {} });
3779
+ } finally {
3780
+ opts.signal?.removeEventListener("abort", onAbort);
3781
+ }
3782
+ },
3783
+ storage: {
3784
+ store(ref) {
3785
+ const key2 = storeKey(ref);
3786
+ let entry = stores.get(key2);
3787
+ if (!entry) {
3788
+ entry = { ref, value: writable(void 0), v: 1 };
3789
+ stores.set(key2, entry);
3790
+ void loadStore(entry);
3791
+ }
3792
+ return entry.value;
3793
+ },
3794
+ async set(ref, value) {
3795
+ const key2 = storeKey(ref);
3796
+ const entry = stores.get(key2);
3797
+ const record = { v: entry?.v ?? 1, value };
3798
+ const result = await unwrap(api.storage.set(requireFolder(), location2(ref), "stores", ref.name, record));
3799
+ if (result && result.accepted === false) {
3800
+ if (entry && "value" in result) readRecord(entry, result.value);
3801
+ throw new ExtensionsHostError({ code: "refused", reason: "invalid", message: result.reason });
3802
+ }
3803
+ entry?.value.set(value);
3804
+ }
3805
+ },
3806
+ settings: {
3807
+ wire: settingsWire,
3808
+ async set(extensionId, key2, value) {
3809
+ const where = requireFolder();
3810
+ await unwrap(
3811
+ api.settings.set({
3812
+ ...typeof where === "string" ? { cwd: where } : where,
3813
+ extension: extensionId,
3814
+ key: key2,
3815
+ value,
3816
+ scope: "user"
3817
+ })
3818
+ );
3819
+ await reload.settings();
3820
+ }
3821
+ },
3822
+ integrations: {
3823
+ list: integrationList,
3824
+ async connect(integrationId, opts) {
3825
+ const cwd = requireFolder();
3826
+ await unwrap(
3827
+ opts.key !== void 0 ? api.integrations.connectKey(cwd, integrationId, opts.key, opts.methodId) : api.integrations.start(cwd, integrationId, opts.methodId)
3828
+ );
3829
+ await reload.integrations();
3830
+ },
3831
+ async setDefault(integrationId, account) {
3832
+ await unwrap(api.integrations.setDefault(requireFolder(), integrationId, account));
3833
+ await reload.integrations();
3834
+ },
3835
+ async disconnect(integrationId, opts) {
3836
+ await unwrap(api.integrations.disconnect(requireFolder(), integrationId, opts?.account));
3837
+ await reload.integrations();
3838
+ }
3839
+ },
3840
+ commands: {
3841
+ list: commandList,
3842
+ async run(id, opts = {}) {
3843
+ return unwrap(
3844
+ api.commands.run(requireFolder(), id, {
3845
+ ...opts.args !== void 0 ? { args: opts.args } : {},
3846
+ ...opts.sessionId !== void 0 ? { sessionId: hostSession(opts.sessionId) } : {}
3847
+ })
3848
+ );
3849
+ }
3850
+ }
3851
+ };
3852
+ }
3853
+ const HostContext = reactExports.createContext(null);
3854
+ function useElectronExtensionsHost() {
3855
+ return reactExports.useContext(HostContext);
3856
+ }
3857
+ function ExtensionsHostProvider({ children }) {
3858
+ const { allSessions, activeSessionId, defaultFolder } = useSessions();
3859
+ const host2 = reactExports.useMemo(() => createElectronExtensionsHost(), []);
3860
+ const loadModule = reactExports.useMemo(
3861
+ () => createExtensionModuleLoader({ api: window.api.extensionHost, folder: () => host2.target() }),
3862
+ [host2]
3863
+ );
3864
+ reactExports.useEffect(() => () => host2.dispose(), [host2]);
3865
+ const { attachSidebarContributions } = useSessionsActions();
3866
+ reactExports.useEffect(() => attachSidebarContributions(sidebarContributionsOf(host2.items)), [host2, attachSidebarContributions]);
3867
+ const serverId = activeSessionId !== null ? serverIdOf(activeSessionId) ?? void 0 : void 0;
3868
+ const sessionCwd = activeSessionId !== null ? allSessions.find((s) => s.id === activeSessionId)?.cwd : void 0;
3869
+ const folder = activeSessionId === null ? defaultFolder ?? void 0 : sessionCwd || void 0;
3870
+ reactExports.useEffect(() => host2.setFolder(folder, serverId), [host2, folder, serverId]);
3871
+ const viewing = activeSessionId ?? void 0;
3872
+ reactExports.useEffect(() => {
3873
+ host2.announce({ viewing: viewing ? [viewing] : [], active: document.hasFocus() });
3874
+ }, [host2, viewing]);
3875
+ reactExports.useEffect(() => {
3876
+ const active = () => host2.announce({ active: true });
3877
+ window.addEventListener("focus", active);
3878
+ return () => window.removeEventListener("focus", active);
3879
+ }, [host2]);
3880
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(HostContext.Provider, { value: host2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionsProvider, { host: host2, loadModule, children }) });
3881
+ }
3882
+ const NONE = [];
3883
+ const noMenu = { get: () => NONE, subscribe: () => () => {
3884
+ } };
3885
+ function useExtensionSessionMenuItems(sessionKey2) {
3886
+ const host2 = useElectronExtensionsHost();
3887
+ const items = useReadable(host2?.sessionMenu ?? noMenu);
3888
+ return reactExports.useMemo(
3889
+ () => items.map((item) => ({
3890
+ id: `extension:${item.key}`,
3891
+ label: item.label,
3892
+ group: "extensions",
3893
+ ...item.enabled ? {} : { disabled: true },
3894
+ onSelect: () => void host2?.commands?.run(item.command, { sessionId: sessionKey2 }).catch(() => void 0)
3895
+ })),
3896
+ [items, host2, sessionKey2]
3897
+ );
3898
+ }
3899
+ const { SessionStatusDot, RowMeta, RowArtifacts } = sidebarLive;
3900
+ const HomeSessionRow = reactExports.memo(function HomeSessionRow2({ item, session, fallback }) {
3901
+ const key2 = localSessionKey(session);
3902
+ const { allSessions } = useSessionsList();
3903
+ const row = reactExports.useMemo(() => allSessions.find((s) => s.id === key2), [allSessions, key2]);
3904
+ const named = (item.facts?.length ?? 0) > 0;
3905
+ return row ? /* @__PURE__ */ jsxRuntimeExports.jsx(KnownRow, { row, named }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: fallback });
3906
+ });
3907
+ function KnownRow({ row, named }) {
3908
+ const key2 = row.id;
3909
+ const { activeSessionId, spacesOn, spaces } = useSessionsList();
3910
+ const actions = useSessionsActions();
3911
+ const { settings } = useSettings();
3912
+ const { icons } = useProjectIcons();
3913
+ const confirmDelete = useConfirmDeleteSession((id) => actions.deleteSession(id));
3914
+ const moveSession = useMoveSession();
3915
+ const [arrived, setArrived] = reactExports.useState(false);
3916
+ const [menuOpen, setMenuOpen] = reactExports.useState(false);
3917
+ const [renameValue, setRenameValue] = reactExports.useState(null);
3918
+ const project = reactExports.useMemo(() => {
3919
+ const path = named ? (row.projectRoot || row.cwd).replace(/\/+$/, "") : "";
3920
+ if (!path) return void 0;
3921
+ return {
3922
+ label: basename(path) || path,
3923
+ path,
3924
+ isGitRepo: row.isGitRepo === true,
3925
+ ...icons[path] ? { icon: icons[path] } : {}
3926
+ };
3927
+ }, [row, named, icons]);
3928
+ const target = {
3929
+ id: key2,
3930
+ title: row.title,
3931
+ cwd: row.cwd,
3932
+ archived: row.archived,
3933
+ ...row.favorite ? { favorite: true } : {},
3934
+ ...row.spaceId ? { spaceId: row.spaceId } : {},
3935
+ ...row.environment ? { environment: row.environment } : {}
3936
+ };
3937
+ const appMenuItems = useSessionMenuItems(target, spacesOn ? spaces : null, menuOpen, {
3938
+ rename: () => setRenameValue(row.title),
3939
+ setFavorite: (favorite) => void actions.setFavorite(key2, favorite),
3940
+ setArchived: (archived) => void actions.setArchived(key2, archived),
3941
+ remove: () => confirmDelete(target),
3942
+ moveToSpace: (spaceId) => void actions.setSessionSpace(key2, spaceId),
3943
+ ...moveSession ? { moveSession: () => void moveSession(moveSubject(row)) } : {}
3944
+ });
3945
+ const extensionMenu = useExtensionSessionMenuItems(key2);
3946
+ const menuItems = reactExports.useMemo(() => [...appMenuItems, ...extensionMenu], [appMenuItems, extensionMenu]);
3947
+ const open = () => actions.setActiveSessionId(key2);
3948
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
3949
+ SessionListRow,
3950
+ {
3951
+ id: key2,
3952
+ title: row.title,
3953
+ active: activeSessionId === key2,
3954
+ archived: row.archived,
3955
+ status: row.archived ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsx(SessionStatusDot, { sessionId: key2 }),
3956
+ meta: /* @__PURE__ */ jsxRuntimeExports.jsx(RowMeta, { sessionId: key2, updatedAt: row.updatedAt, details: settings.sidebarRunDetails !== false }),
3957
+ sub: renameValue !== null ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsx(
3958
+ RowArtifacts,
3959
+ {
3960
+ sessionId: key2,
3961
+ enabled: settings.artifacts !== false,
3962
+ onArrival: setArrived,
3963
+ onSelect: open,
3964
+ cards: "below",
3965
+ ...row.cwd ? { cwd: row.cwd } : {},
3966
+ ...project ? { project } : {},
3967
+ ...row.environment ? { environment: row.environment } : {}
3968
+ }
3969
+ ),
3970
+ onSelect: open,
3971
+ renaming: renameValue !== null,
3972
+ renameValue: renameValue ?? "",
3973
+ onStartRename: () => setRenameValue(row.title),
3974
+ onRenameChange: setRenameValue,
3975
+ onRenameCommit: async () => {
3976
+ const next = renameValue?.trim();
3977
+ setRenameValue(null);
3978
+ if (next && next !== row.title) await actions.renameSession(key2, next);
3979
+ },
3980
+ onRenameCancel: () => setRenameValue(null),
3981
+ menuItems,
3982
+ menuOpen,
3983
+ onOpenMenu: () => setMenuOpen(true),
3984
+ onCloseMenu: () => setMenuOpen(false),
3985
+ arrived
3986
+ }
3987
+ );
3988
+ }
3989
+ const DEFAULT_BLOCKS = [USAGE_BLOCK_ID];
3990
+ function ProjectHomeScreen({ draft: draft2 }) {
3991
+ const host2 = useWorkspaceHost();
3992
+ const scope = useScopeOf(null);
3993
+ const { setActiveSessionId, allSessions } = useSessions();
3994
+ const { icons } = useProjectIcons();
3995
+ const { file: onOpenPath } = useOpenTarget();
3996
+ const panels = usePanelActions();
3997
+ const links = useLinkRouter();
3998
+ const server = draft2.server;
3999
+ const folder = server ? draft2.remoteFolder ?? draft2.remoteRoot ?? "" : draft2.folderPath ?? "";
4000
+ const root = server ? folder : scope?.root || folder;
4001
+ const serverId = server?.id;
4002
+ reactExports.useEffect(() => {
4003
+ publishHomeProject(root ? { path: root, ...serverId ? { hostId: serverId } : {} } : null);
4004
+ }, [root, serverId]);
4005
+ reactExports.useEffect(() => () => publishHomeProject(null), []);
4006
+ const rows2 = server ? [] : allSessions.filter((s) => !s.hostId && (s.projectRoot || s.cwd).replace(/\/+$/, "") === root);
4007
+ const isGitRepo = rows2.some((s) => s.isGitRepo);
4008
+ const repoKey = rows2.find((s) => s.repoKey)?.repoKey;
4009
+ const [web, setWeb] = reactExports.useState(null);
4010
+ reactExports.useEffect(() => {
4011
+ if (!isGitRepo || !root) return void 0;
4012
+ let current = true;
4013
+ window.api.system.repoWebBase(root).then(
4014
+ (url) => current && setWeb({ root, url }),
4015
+ () => current && setWeb({ root, url: null })
4016
+ );
4017
+ return () => {
4018
+ current = false;
4019
+ };
4020
+ }, [isGitRepo, root]);
4021
+ const webUrl = web?.root === root ? web.url : null;
4022
+ const repo = isGitRepo ? repoChip(webUrl, repoKey, basename(root)) : void 0;
4023
+ const picked = server || !root ? void 0 : icons[root];
4024
+ const project = root ? {
4025
+ name: basename(root),
4026
+ path: root,
4027
+ ...serverId ? { hostId: serverId } : {},
4028
+ ...repo ? { repo } : {},
4029
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectIconGlyph, { size: "lg", ...picked ? { icon: picked } : {}, isGitRepo })
4030
+ } : void 0;
4031
+ return (
4032
+ // Rows that stand for a session (the recent sessions block) are the sidebar's rows, wider.
4033
+ /* @__PURE__ */ jsxRuntimeExports.jsx(PanelSessionRowProvider, { row: HomeSessionRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4034
+ ProjectHome,
4035
+ {
4036
+ cwd: server ? "" : folder,
4037
+ projectKey: server ? `${server.id}${root}` : root,
4038
+ defaultBlocks: DEFAULT_BLOCKS,
4039
+ switcher: server ? { projects: draft2.serverFolders, current: draft2.remoteFolder, onPick: draft2.setRemoteFolder } : {
4040
+ projects: draft2.recentFolders,
4041
+ current: draft2.folderPath,
4042
+ onPick: draft2.pickRecent,
4043
+ onImportRepo: draft2.importRepoIntoDraft,
4044
+ onSelectDirectory: draft2.pickFolder
4045
+ },
4046
+ ...project ? { project } : {},
4047
+ ...server ? { blocksUnavailable: true } : host2?.panels ? { panels: host2.panels } : {},
4048
+ onOpenSession: (id) => setActiveSessionId(localSessionKey(id)),
4049
+ onOpenPath,
4050
+ ...server ? {} : {
4051
+ // A folder on this computer: its repository, its files, Finder, the editor.
4052
+ ...repo ? {
4053
+ // Its web page, else what changed in the working tree.
4054
+ onOpenRepo: () => webUrl ? void links.open(webUrl, { source: "panel" }, () => void window.open(webUrl, "_blank")) : panels.showWorkingTree()
4055
+ } : {},
4056
+ // Opens the panel on Files with the project's folder selected (a trailing `/` names a folder).
4057
+ onOpenFiles: () => panels.revealFile(`${folder.replace(/\/+$/, "")}/`),
4058
+ onRevealPath: (path) => void window.api.system.revealPath(path),
4059
+ onOpenInEditor: (path) => void links.open(path, { source: "panel" }, () => void window.api.system.openPath(path))
4060
+ }
4061
+ }
4062
+ ) })
4063
+ );
4064
+ }
4065
+ function repoChip(webUrl, repoKey, folder) {
4066
+ const fromUrl = webUrl ? new URL(webUrl).pathname.replace(/^\/+|\/+$/g, "") : "";
4067
+ const fromKey = repoKey ? repoKey.split("/").slice(1).join("/") : "";
4068
+ const host2 = webUrl ? new URL(webUrl).hostname : repoKey?.split("/")[0] ?? "";
4069
+ return {
4070
+ name: fromUrl || fromKey || folder,
4071
+ web: Boolean(webUrl),
4072
+ icon: host2 === "github.com" ? "i-ph-github-logo" : host2.includes("gitlab") ? "i-ph-gitlab-logo" : "i-ph-git-branch"
4073
+ };
4074
+ }
3092
4075
  function WelcomeScreen() {
3093
4076
  const modelName = useModelName();
3094
4077
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WelcomeScreen$1, { modelName });
@@ -3566,10 +4549,6 @@ const COMPOSER_COMMAND_ARGS = {
3566
4549
  };
3567
4550
  const siteIcons = createSiteIcons((origin) => window.api.favicons.get(origin));
3568
4551
  siteIcons.get;
3569
- function worktreeChat(sessions, ids, current) {
3570
- const wanted = new Set(ids);
3571
- return sessions.filter((s) => wanted.has(s.id) && s.id !== current && !s.archived).sort((a, b) => b.updatedAt - a.updatedAt)[0];
3572
- }
3573
4552
  function GitBranchMenu({
3574
4553
  open,
3575
4554
  anchorRef,
@@ -3580,7 +4559,6 @@ function GitBranchMenu({
3580
4559
  onSwitched
3581
4560
  }) {
3582
4561
  const { allSessions } = useSessionsList();
3583
- const { setActiveSessionId } = useSessionsActions();
3584
4562
  const session = sessionId ? allSessions.find((s) => s.id === sessionId) : void 0;
3585
4563
  const canMove = session !== void 0 && (session.environment?.kind ?? "local") === "local";
3586
4564
  const hostKey = sessionId ? parseSessionKey(sessionId).hostId : LOCAL_SESSION_HOST;
@@ -3599,9 +4577,7 @@ function GitBranchMenu({
3599
4577
  current,
3600
4578
  onClose,
3601
4579
  onSwitched,
3602
- ...worktree ? { worktree } : {},
3603
- resolveChat: (chats) => worktreeChat(allSessions, chats, sessionId)?.id,
3604
- onOpenChat: (chat) => setActiveSessionId(chat)
4580
+ ...worktree ? { worktree } : {}
3605
4581
  }
3606
4582
  );
3607
4583
  }
@@ -3763,18 +4739,6 @@ const ConversationBadges = reactExports.memo(function ConversationBadges2({
3763
4739
  }
3764
4740
  );
3765
4741
  });
3766
- function SelectTurnHint({ sessionId }) {
3767
- const sel = useSelectTurn().state;
3768
- if (!sel || sel.sessionId !== sessionId) return null;
3769
- return /* @__PURE__ */ jsxRuntimeExports.jsx(DockCard, { className: "zg-select-hint", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3770
- DockRow,
3771
- {
3772
- glyph: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-cursor-text text-[12px] text-[var(--zg-accent)]" }),
3773
- trailing: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTurnExit, {}),
3774
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTurnHintKeys, { sessionId })
3775
- }
3776
- ) });
3777
- }
3778
4742
  function ConversationComposer({
3779
4743
  session,
3780
4744
  running,
@@ -3948,80 +4912,20 @@ const selectMachineWaiting = (events) => machineWaiting(events);
3948
4912
  function SessionMachineWaiting({ sessionId }) {
3949
4913
  return /* @__PURE__ */ jsxRuntimeExports.jsx(MachineWaitingBanner, { machine: useSessionEventsSelector(sessionId, selectMachineWaiting) });
3950
4914
  }
3951
- function ScopeToolbar({ scope, artifactCount = 0 }) {
3952
- const panels = usePanelLayout();
3953
- const { pick } = usePanelActions();
3954
- const standaloneParts = useStandaloneParts(scope.session ?? null);
3955
- const panelsElsewhere = scope.session !== void 0 && (windowRole.kind === "main" || windowRole.parts === "chat") && standaloneParts !== null && hasPanels(standaloneParts);
3956
- const panelsShown = panels.tabs.length > 0 && !panelsElsewhere;
3957
- const panelTriggerRef = reactExports.useRef(null);
3958
- const [panelMenuOpen, setPanelMenuOpen] = reactExports.useState(false);
3959
- const panelItems = reactExports.useMemo(
3960
- () => panels.tabs.map((t) => ({
3961
- id: t.id,
3962
- label: t.id === "artifacts" && artifactCount > 0 ? `${t.label} (${artifactCount})` : t.label,
3963
- onSelect: () => pick(t.id)
3964
- })),
3965
- [panels.tabs, pick, artifactCount]
3966
- );
4915
+ function ScopeToolbar({ scope }) {
3967
4916
  const session = scope.session;
3968
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3969
- /* @__PURE__ */ jsxRuntimeExports.jsx(TerminalToggle, { scope }),
3970
- panelsElsewhere && session && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { align: "end", label: "Side panels are in their own window", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
3971
- IconButton,
3972
- {
3973
- icon: "i-ph-arrow-square-out",
3974
- label: "Side panels are in their own window",
3975
- title: "",
3976
- onClick: () => void window.api.windows.focus(session)
3977
- }
3978
- ) }),
3979
- panelsShown && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
3980
- /* @__PURE__ */ jsxRuntimeExports.jsx(
3981
- Tooltip,
3982
- {
3983
- align: "end",
3984
- label: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
3985
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Open panel" }),
3986
- /* @__PURE__ */ jsxRuntimeExports.jsx(KeyHint, { spec: "ctrl+shift+a", size: "sm" })
3987
- ] }),
3988
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "relative inline-flex shrink-0", children: [
3989
- /* @__PURE__ */ jsxRuntimeExports.jsx(
3990
- IconButton,
3991
- {
3992
- ref: panelTriggerRef,
3993
- icon: "i-ph-plus",
3994
- label: `Open panel${artifactCount > 0 ? `, ${artifactCount} artifacts` : ""}`,
3995
- title: "",
3996
- active: panelMenuOpen || panels.state.open,
3997
- "aria-haspopup": "menu",
3998
- "aria-expanded": panelMenuOpen,
3999
- onClick: () => setPanelMenuOpen((o) => !o),
4000
- "data-testid": "open-panel"
4001
- }
4002
- ),
4003
- artifactCount > 0 && !panels.state.open && /* @__PURE__ */ jsxRuntimeExports.jsx(
4004
- "span",
4005
- {
4006
- "aria-hidden": true,
4007
- className: "pointer-events-none absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] px-[3px] rounded-full bg-[var(--zg-accent-fill)] text-[var(--zg-accent-fill-fg)] text-[9px] leading-[14px] font-medium text-center",
4008
- children: artifactCount > 99 ? "99+" : artifactCount
4009
- }
4010
- )
4011
- ] })
4012
- }
4013
- ),
4014
- /* @__PURE__ */ jsxRuntimeExports.jsx(
4015
- RowActionsMenu,
4016
- {
4017
- open: panelMenuOpen,
4018
- anchorRef: panelTriggerRef,
4019
- onClose: () => setPanelMenuOpen(false),
4020
- items: panelItems
4021
- }
4022
- )
4023
- ] })
4024
- ] });
4917
+ const standaloneParts = useStandaloneParts(session ?? null);
4918
+ const panelsElsewhere = session !== void 0 && (windowRole.kind === "main" || windowRole.parts === "chat") && standaloneParts !== null && hasPanels(standaloneParts);
4919
+ if (!panelsElsewhere || !session) return null;
4920
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { align: "end", label: "Side panels are in their own window", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4921
+ IconButton,
4922
+ {
4923
+ icon: "i-ph-arrow-square-out",
4924
+ label: "Side panels are in their own window",
4925
+ title: "",
4926
+ onClick: () => void window.api.windows.focus(session)
4927
+ }
4928
+ ) });
4025
4929
  }
4026
4930
  function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
4027
4931
  const {
@@ -4076,20 +4980,16 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
4076
4980
  moveSession
4077
4981
  ]
4078
4982
  );
4983
+ const extensionMenu = useExtensionSessionMenuItems(session.id);
4984
+ const allMenuItems = reactExports.useMemo(() => [...menuItems, ...extensionMenu], [menuItems, extensionMenu]);
4079
4985
  const { hostById } = useHosts();
4080
4986
  const server = session.hostId ? hostById(session.hostId) : void 0;
4081
- const artifactCount = countArtifacts(useSessionArtifacts(session.id));
4082
- const fetchArtifacts = useSessionHost().artifacts?.refresh;
4083
- const artifactsShown = usePanelLayout().tabs.length > 0;
4084
4987
  const scope = reactExports.useMemo(
4085
4988
  () => scopeOfSession(session),
4086
4989
  // The fields that make the scope, not the row object (rebuilt on every list refresh).
4087
4990
  // eslint-disable-next-line react-hooks/exhaustive-deps
4088
4991
  [session.id, session.cwd, session.projectRoot, session.workspace]
4089
4992
  );
4090
- reactExports.useEffect(() => {
4091
- if (artifactsShown) void fetchArtifacts?.(session.id).catch(() => void 0);
4092
- }, [artifactsShown, fetchArtifacts, session.id]);
4093
4993
  const folderless = !session.cwd;
4094
4994
  const pickFolder = async () => {
4095
4995
  const picked = await window.api.folder.pick();
@@ -4123,7 +5023,10 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
4123
5023
  * chevron itself. A standalone window has no sidebar toggle beside
4124
5024
  * the lights: just clear them.
4125
5025
  */
4126
- paddingLeft: windowRole.kind === "session" ? nativeAnchoredPx(84) : lightsInCenter ? `calc(${nativeAnchoredPx(84)} + 36px)` : 16,
5026
+ paddingLeft: windowRole.kind === "session" ? nativeAnchoredPx(84) : lightsInCenter ? (
5027
+ // The extensions' title bar items sit after the toggle (`TitlebarSlot`).
5028
+ `calc(${nativeAnchoredPx(84)} + 36px + var(--zg-titlebar-w, 0px))`
5029
+ ) : 16,
4127
5030
  /**
4128
5031
  * Tweened on the panel clock so the leading inset grows while the
4129
5032
  * sidebar narrows (and shrinks while it widens): the header content
@@ -4131,7 +5034,9 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
4131
5034
  */
4132
5035
  transitionProperty: "padding-left",
4133
5036
  transitionDuration: "var(--zg-panel-ms)",
4134
- transitionTimingFunction: "var(--zg-panel-ease)"
5037
+ transitionTimingFunction: "var(--zg-panel-ease)",
5038
+ // Room for the side panel's toggle over the header's end while the panel is closed (`Center`).
5039
+ paddingRight: "calc(1rem + var(--zg-panel-corner-inset, 0px))"
4135
5040
  }),
4136
5041
  [lightsInCenter]
4137
5042
  );
@@ -4154,9 +5059,10 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
4154
5059
  onRename: (next) => renameSession(session.id, next),
4155
5060
  renaming,
4156
5061
  onRenamingChange: setRenaming,
4157
- menuItems,
5062
+ menuItems: allMenuItems,
4158
5063
  onMenuOpenChange: setMenuOpen,
4159
- toolbar: /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeToolbar, { scope, artifactCount }),
5064
+ sessionId: session.id,
5065
+ toolbar: /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeToolbar, { scope }),
4160
5066
  style
4161
5067
  }
4162
5068
  );
@@ -4180,7 +5086,8 @@ function HeaderBand({ scope, lightsInCenter }) {
4180
5086
  * (see SessionHeader): 84 DIP chevron origin (zoom-compensated via
4181
5087
  * `nativeAnchoredPx`) + 28px CSS chevron width.
4182
5088
  */
4183
- paddingLeft: lightsInCenter ? `calc(${nativeAnchoredPx(84)} + 28px)` : 0,
5089
+ // Plus the extensions' title bar items after the chevron (`TitlebarSlot`).
5090
+ paddingLeft: lightsInCenter ? `calc(${nativeAnchoredPx(84)} + 28px + var(--zg-titlebar-w, 0px))` : 0,
4184
5091
  /**
4185
5092
  * Matches `SessionHeader`'s padding tween — the lights (animated in
4186
5093
  * App.tsx) slide INTO this band over `--zg-panel-ms` instead of the
@@ -4188,7 +5095,9 @@ function HeaderBand({ scope, lightsInCenter }) {
4188
5095
  */
4189
5096
  transitionProperty: "padding-left",
4190
5097
  transitionDuration: "var(--zg-panel-ms)",
4191
- transitionTimingFunction: "var(--zg-panel-ease)"
5098
+ transitionTimingFunction: "var(--zg-panel-ease)",
5099
+ // Room for the side panel's toggle over the band's end while the panel is closed (`Center`).
5100
+ paddingRight: "calc(1rem + var(--zg-panel-corner-inset, 0px))"
4192
5101
  },
4193
5102
  children: scope && /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeToolbar, { scope })
4194
5103
  }
@@ -4219,9 +5128,9 @@ function useSendPrompt({ session, running, draft: draft2, hostId, glideToBottom
4219
5128
  draft: draft2,
4220
5129
  hostId,
4221
5130
  reveal: glideToBottom,
4222
- createSession: async (request) => {
5131
+ createSession: async (request2) => {
4223
5132
  try {
4224
- const created = await sessions.createSession(request, { fromDraft: draftScope() });
5133
+ const created = await sessions.createSession(request2, { fromDraft: draftScope() });
4225
5134
  return { id: created.id, provisioning: created.environment?.state === "provisioning" };
4226
5135
  } catch (err) {
4227
5136
  throw new Error(ipcErrorMessage(err));
@@ -4301,14 +5210,24 @@ const ConversationPane = reactExports.memo(function ConversationPane2({
4301
5210
  const meters = useSessionMeters(session, running);
4302
5211
  const { defaultFolder, setDefaultFolder, sessions } = useSessions();
4303
5212
  const { servers } = useHosts();
5213
+ const draftRequest = useDraftRequest();
4304
5214
  const draft2 = useDraftTarget({
4305
5215
  session,
4306
5216
  defaultFolder,
4307
5217
  setDefaultFolder,
4308
5218
  sessions,
4309
5219
  servers,
4310
- onLocalFolder: publishDraftFolder
5220
+ onLocalFolder: publishDraftFolder,
5221
+ request: draftRequest
4311
5222
  });
5223
+ reactExports.useEffect(() => {
5224
+ if (!isNewSession) clearDraftRequest();
5225
+ }, [isNewSession]);
5226
+ const chatDraft2 = isNewSession && !draft2.server && draft2.folderPath === "";
5227
+ reactExports.useEffect(() => {
5228
+ publishChatDraft(chatDraft2);
5229
+ return () => publishChatDraft(false);
5230
+ }, [chatDraft2]);
4312
5231
  const hostId = session ? session.hostId ?? null : draft2.server?.id ?? null;
4313
5232
  const { scrollRef, page, loadEarlier, pinned, scrolledFromTop, glideToBottom } = useTranscriptScroll(
4314
5233
  sessionId,
@@ -4317,7 +5236,24 @@ const ConversationPane = reactExports.memo(function ConversationPane2({
4317
5236
  const search = useComposerSearch(sessionId, scrollRef, actions.closeSearch);
4318
5237
  const prompt = useSendPrompt({ session, running, draft: draft2, hostId, glideToBottom });
4319
5238
  const veiled = useSettledReveal(sessionId, hydrated) && !isNewSession;
4320
- const { showRowIcons } = useSettings().settings;
5239
+ const { showRowIcons, projectHome: projectHomeOn } = useSettings().settings;
5240
+ const projectHome = isNewSession && projectHomeOn === true;
5241
+ const composer = /* @__PURE__ */ jsxRuntimeExports.jsx(
5242
+ ConversationComposer,
5243
+ {
5244
+ session,
5245
+ running,
5246
+ scrolled: !projectHome && scrolledFromTop && !pinned,
5247
+ hostId,
5248
+ draft: draft2,
5249
+ prompt,
5250
+ search,
5251
+ searchOverlayOpen: searchOpen,
5252
+ meters,
5253
+ onOpenRunningWork: actions.openRunningWork,
5254
+ onOpenEnvironmentSettings: actions.openEnvironmentSettings
5255
+ }
5256
+ );
4321
5257
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-h-0 min-w-0 flex flex-col", children: [
4322
5258
  /* @__PURE__ */ jsxRuntimeExports.jsx(
4323
5259
  ConversationHeader,
@@ -4343,14 +5279,14 @@ const ConversationPane = reactExports.memo(function ConversationPane2({
4343
5279
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4344
5280
  "div",
4345
5281
  {
4346
- className: `mx-auto w-full max-w-[1160px] ${isNewSession ? "h-full" : ""}`,
5282
+ className: `mx-auto w-full max-w-[1160px] ${isNewSession && !projectHome ? "h-full" : ""}`,
4347
5283
  "data-veiled": veiled ? "" : void 0,
4348
5284
  "aria-busy": veiled ? true : void 0,
4349
5285
  style: veiled ? { opacity: 0 } : { opacity: 1, transition: "opacity var(--zg-motion-fade)" },
4350
5286
  children: session ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
4351
5287
  /* @__PURE__ */ jsxRuntimeExports.jsx(LoadEarlierRow, { page, onLoad: () => loadEarlier(session.id), showIcon: showRowIcons }),
4352
5288
  /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Transcript", resetKey: session.id, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptPane, { sessionId: session.id, running }) })
4353
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(WelcomeScreen, {})
5289
+ ] }) : projectHome ? /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectHomeScreen, { draft: draft2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(WelcomeScreen, {})
4354
5290
  }
4355
5291
  )
4356
5292
  }
@@ -4368,22 +5304,7 @@ const ConversationPane = reactExports.memo(function ConversationPane2({
4368
5304
  ),
4369
5305
  search.query !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(SearchHighlightStyle, {})
4370
5306
  ] }),
4371
- /* @__PURE__ */ jsxRuntimeExports.jsx(
4372
- ConversationComposer,
4373
- {
4374
- session,
4375
- running,
4376
- scrolled: scrolledFromTop && !pinned,
4377
- hostId,
4378
- draft: draft2,
4379
- prompt,
4380
- search,
4381
- searchOverlayOpen: searchOpen,
4382
- meters,
4383
- onOpenRunningWork: actions.openRunningWork,
4384
- onOpenEnvironmentSettings: actions.openEnvironmentSettings
4385
- }
4386
- )
5307
+ composer
4387
5308
  ] })
4388
5309
  ] });
4389
5310
  });
@@ -5877,8 +6798,8 @@ function SideTab({ parentId, cwd }) {
5877
6798
  }
5878
6799
  );
5879
6800
  }
5880
- const DesktopDiffsTab = reactExports.lazy(() => __vitePreload(() => import("./file-tabs-Cozt9Sho.js"), true ? __vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]) : void 0, import.meta.url).then((m) => ({ default: m.DesktopDiffsTab })));
5881
- const DesktopFilesTab = reactExports.lazy(() => __vitePreload(() => import("./file-tabs-Cozt9Sho.js"), true ? __vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]) : void 0, import.meta.url).then((m) => ({ default: m.DesktopFilesTab })));
6801
+ const DesktopDiffsTab = reactExports.lazy(() => __vitePreload(() => import("./file-tabs-DwqRIh1X.js"), true ? __vite__mapDeps([0,1,2,3,4,5,6,7,8,9]) : void 0, import.meta.url).then((m) => ({ default: m.DesktopDiffsTab })));
6802
+ const DesktopFilesTab = reactExports.lazy(() => __vitePreload(() => import("./file-tabs-DwqRIh1X.js"), true ? __vite__mapDeps([0,1,2,3,4,5,6,7,8,9]) : void 0, import.meta.url).then((m) => ({ default: m.DesktopFilesTab })));
5882
6803
  const KEEP_ALIVE = /* @__PURE__ */ new Set([
5883
6804
  ARTIFACTS_PANEL_ID,
5884
6805
  BROWSER_PANEL_ID,
@@ -5889,6 +6810,17 @@ const KEEP_ALIVE = /* @__PURE__ */ new Set([
5889
6810
  SIDE_PANEL_ID,
5890
6811
  TODOS_PANEL_ID
5891
6812
  ]);
6813
+ const DESCRIPTIONS = {
6814
+ [ARTIFACTS_PANEL_ID]: "Pull requests, branches and commits the session made",
6815
+ [DIFFS_PANEL_ID]: "The agent's edits and the working tree",
6816
+ [FILES_PANEL_ID]: "The folder as a tree, with a viewer and an editor",
6817
+ [TERMINAL_PANEL_ID]: "Terminals where the session runs",
6818
+ [BROWSER_PANEL_ID]: "A browser for the app you are building",
6819
+ [INBOX_PANEL_ID]: "Plans and questions waiting for you",
6820
+ [TODOS_PANEL_ID]: "The agent's todo list",
6821
+ [QUEUE_PANEL_ID]: "Messages waiting for the run to end",
6822
+ [SIDE_PANEL_ID]: "A side chat beside this session"
6823
+ };
5892
6824
  function tabBodyKey(scope) {
5893
6825
  return [scopeKey(scope), scope.cwd, scope.root, scope.workspace ?? ""].join("\0");
5894
6826
  }
@@ -5900,7 +6832,9 @@ function useTabRegistry(scope) {
5900
6832
  render: (tab) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabBody, { tab, scope }),
5901
6833
  keepAlive: (tab) => tab.builtin && KEEP_ALIVE.has(tab.id),
5902
6834
  snap: (tab) => tab.id === BROWSER_PANEL_ID,
5903
- wrap: (tab, body) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabBoundary, { tab, children: body })
6835
+ wrap: (tab, body) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabBoundary, { tab, children: body }),
6836
+ // An extension's panel names its extension.
6837
+ describe: (tab) => tab.builtin ? DESCRIPTIONS[tab.id] : `From ${tab.owner}`
5904
6838
  }),
5905
6839
  // Keyed by the scope's identity, not its object.
5906
6840
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -5940,7 +6874,7 @@ function TabBody({ tab, scope }) {
5940
6874
  }
5941
6875
  function ExtensionTabBody({ id }) {
5942
6876
  const { contentFor } = usePanelContent();
5943
- const { act } = usePanelActions();
6877
+ const { act, refresh } = usePanelActions();
5944
6878
  const entry = contentFor(id);
5945
6879
  const onAction = reactExports.useCallback(
5946
6880
  (actionId, payload) => {
@@ -5948,6 +6882,18 @@ function ExtensionTabBody({ id }) {
5948
6882
  },
5949
6883
  [act, id]
5950
6884
  );
6885
+ const onControl = reactExports.useCallback(
6886
+ (control, value) => {
6887
+ setPanelView(id, control, value);
6888
+ refresh(id);
6889
+ },
6890
+ [refresh, id]
6891
+ );
6892
+ const { setActiveSessionId } = useSessions();
6893
+ const onOpenSession = reactExports.useCallback(
6894
+ (sessionId) => setActiveSessionId(localSessionKey(sessionId)),
6895
+ [setActiveSessionId]
6896
+ );
5951
6897
  const { file: onOpenPath } = useOpenTarget();
5952
6898
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
5953
6899
  PanelContentView,
@@ -5956,10 +6902,86 @@ function ExtensionTabBody({ id }) {
5956
6902
  loading: entry.loading,
5957
6903
  error: entry.error,
5958
6904
  onAction,
6905
+ onControl,
6906
+ onOpenSession,
5959
6907
  onOpenPath
5960
6908
  }
5961
6909
  );
5962
6910
  }
6911
+ let expanded = false;
6912
+ const listeners$3 = /* @__PURE__ */ new Set();
6913
+ const subscribe$3 = (listener) => {
6914
+ listeners$3.add(listener);
6915
+ return () => listeners$3.delete(listener);
6916
+ };
6917
+ const read = () => expanded;
6918
+ function setPanelExpanded(next) {
6919
+ if (next === expanded) return;
6920
+ expanded = next;
6921
+ for (const listener of listeners$3) listener();
6922
+ }
6923
+ function usePanelExpanded() {
6924
+ return reactExports.useSyncExternalStore(subscribe$3, read, read);
6925
+ }
6926
+ function usePanelCorner(sessionId) {
6927
+ const panels = usePanelLayout();
6928
+ const budget = useLayoutBudget();
6929
+ const expanded2 = usePanelExpanded();
6930
+ const available = panels.tabs.length > 0;
6931
+ const open = available && panels.state.open && !(budget.panelMode === "overlay" && budget.panelHidden);
6932
+ const canPopOut = windowRole.kind === "main" && sessionId !== null;
6933
+ const buttons = 1 + 1 + (canPopOut ? 1 : 0);
6934
+ return {
6935
+ available,
6936
+ open,
6937
+ expanded: open && expanded2,
6938
+ canPopOut,
6939
+ /** What the panel's top-right strip keeps free (every button). */
6940
+ stripInset: `${panelCornerWidth(buttons)}px`,
6941
+ /** What the chat header keeps free while the panel is closed (the toggle). */
6942
+ headerInset: available && !open ? `${panelCornerWidth(1)}px` : "0px"
6943
+ };
6944
+ }
6945
+ function useArtifactCount(sessionId, available) {
6946
+ const count = countArtifacts(useSessionArtifacts(sessionId));
6947
+ const refresh = useSessionHost().artifacts?.refresh;
6948
+ reactExports.useEffect(() => {
6949
+ if (sessionId && available) void refresh?.(sessionId).catch(() => void 0);
6950
+ }, [sessionId, available, refresh]);
6951
+ return sessionId ? count : 0;
6952
+ }
6953
+ function PanelCornerHost({ sessionId }) {
6954
+ const corner = usePanelCorner(sessionId);
6955
+ const artifactCount = useArtifactCount(sessionId, corner.available);
6956
+ const panels = usePanelLayout();
6957
+ const actions = usePanelActions();
6958
+ const budget = useLayoutBudget();
6959
+ reactExports.useEffect(() => {
6960
+ if (!corner.open) setPanelExpanded(false);
6961
+ }, [corner.open]);
6962
+ if (!corner.available) return null;
6963
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
6964
+ PanelCorner,
6965
+ {
6966
+ open: corner.open,
6967
+ expanded: corner.expanded,
6968
+ count: artifactCount,
6969
+ onToggle: () => {
6970
+ if (panels.state.open && budget.panelMode === "overlay" && budget.panelHidden) budget.revealPanel();
6971
+ else actions.toggle();
6972
+ },
6973
+ onExpand: () => setPanelExpanded(!corner.expanded),
6974
+ ...corner.canPopOut && sessionId ? {
6975
+ onPopOut: () => {
6976
+ setPanelExpanded(false);
6977
+ window.api.windows.open(sessionId, "panels").catch((err) => console.error("[zidane-gui] panels window failed", err));
6978
+ }
6979
+ } : {},
6980
+ className: "absolute top-0 right-2 z-50",
6981
+ style: { height: `max(44px, ${nativeAnchoredPx(44)})` }
6982
+ }
6983
+ );
6984
+ }
5963
6985
  const SidePanel = reactExports.memo(function SidePanel2({ scope, fill = false }) {
5964
6986
  if (scope === null) return null;
5965
6987
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopedSidePanel, { scope, fill });
@@ -5967,7 +6989,6 @@ const SidePanel = reactExports.memo(function SidePanel2({ scope, fill = false })
5967
6989
  function ScopedSidePanel({ scope, fill }) {
5968
6990
  const sessionId = scope.session ?? null;
5969
6991
  const panels = usePanelLayout();
5970
- const actions = usePanelActions();
5971
6992
  const budget = useLayoutBudget();
5972
6993
  const registry = useTabRegistry(scope);
5973
6994
  const overlay = !fill && budget.panelMode === "overlay";
@@ -5981,14 +7002,10 @@ function ScopedSidePanel({ scope, fill }) {
5981
7002
  const split = splitPanelWidth(window.innerWidth, budget.sidebarWidth, LIMITS.panelWidth.min);
5982
7003
  const wanted = layout.panelWidth ?? split;
5983
7004
  const width = budget.panelWidth > 0 ? budget.panelWidth : wanted;
5984
- const controls = {
5985
- // The panels' own window: closing them closes it.
5986
- onClose: fill ? () => window.close() : actions.close,
5987
- closeLabel: fill ? "Close window" : "Close panel",
5988
- onPopOut: windowRole.kind === "main" && sessionId ? () => {
5989
- window.api.windows.open(sessionId, "panels").catch((err) => console.error("[zidane-gui] panels window failed", err));
5990
- } : void 0
5991
- };
7005
+ const corner = usePanelCorner(sessionId);
7006
+ const controls = fill ? { onClose: () => window.close(), closeLabel: "Close window" } : void 0;
7007
+ const lightsInCenter = useSidebarCollapsed() || budget.sidebarForcedCollapsed;
7008
+ const startInset = corner.expanded && lightsInCenter && windowRole.kind === "main" ? `calc(${nativeAnchoredPx(84)} + 36px + var(--zg-titlebar-w, 0px))` : void 0;
5992
7009
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
5993
7010
  SidePanel$1,
5994
7011
  {
@@ -6002,7 +7019,9 @@ function ScopedSidePanel({ scope, fill }) {
6002
7019
  onWidthCommit: (w) => {
6003
7020
  updateScopeLayout(scope, panelDragResult(window.innerWidth, budget.sidebarWidth, w));
6004
7021
  },
6005
- controls,
7022
+ ...controls ? { controls } : { endInset: corner.stripInset },
7023
+ ...startInset ? { startInset } : {},
7024
+ expanded: corner.expanded,
6006
7025
  overlay,
6007
7026
  slidAway: budget.panelHidden,
6008
7027
  onReveal: budget.revealPanel,
@@ -6036,6 +7055,12 @@ function Center(props) {
6036
7055
  const { hostById } = useHosts();
6037
7056
  const activeHost = activeSession?.hostId ? hostById(activeSession.hostId) : void 0;
6038
7057
  const serverOffline = Boolean(activeSession?.hostId) && !hostReachable(activeHost);
7058
+ const corner = usePanelCorner(activeSession?.id ?? null);
7059
+ const cornerShown = panelsHere && scope !== null && corner.available;
7060
+ const mainStyle = reactExports.useMemo(
7061
+ () => ({ "--zg-panel-corner-inset": cornerShown ? corner.headerInset : "0px" }),
7062
+ [cornerShown, corner.headerInset]
7063
+ );
6039
7064
  const mainRef = reactExports.useRef(null);
6040
7065
  const shownSessionId = activeSession?.id ?? null;
6041
7066
  const lastShownSessionId = reactExports.useRef(shownSessionId);
@@ -6065,13 +7090,14 @@ function Center(props) {
6065
7090
  };
6066
7091
  }, [shownSessionId, activeSpace.id]);
6067
7092
  reactExports.useEffect(() => () => release2.current(), []);
6068
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { ref: mainRef, className: "relative flex-1 min-w-0 flex flex-row h-full bg-[var(--zg-bg)]", children: [
7093
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { ref: mainRef, className: "relative flex-1 min-w-0 flex flex-row h-full bg-[var(--zg-bg)]", style: mainStyle, children: [
6069
7094
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
6070
7095
  "div",
6071
7096
  {
6072
7097
  className: "zg-chat-column flex-1 min-w-0 flex flex-col h-full",
6073
7098
  style: { paddingRight: overlayInset },
6074
7099
  onPointerDownCapture: overlayInset > 0 ? budget.hidePanel : void 0,
7100
+ inert: cornerShown && corner.expanded || void 0,
6075
7101
  children: [
6076
7102
  activeSessionId !== null && activeSession === null ? (
6077
7103
  // A session the list does not hold (still loading, or left out by the archive view): no draft composer.
@@ -6090,40 +7116,12 @@ function Center(props) {
6090
7116
  ]
6091
7117
  }
6092
7118
  ),
6093
- panelsHere && /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Side panel", framed: false, resetKey: scope ? scopeKey(scope) : null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SidePanel, { scope }) })
7119
+ panelsHere && /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Side panel", framed: false, resetKey: scope ? scopeKey(scope) : null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SidePanel, { scope }) }),
7120
+ cornerShown && /* @__PURE__ */ jsxRuntimeExports.jsx(PanelCornerHost, { sessionId: activeSession?.id ?? null })
6094
7121
  ] });
6095
7122
  }
6096
- const usePresenceMap = usePresenceMap$1;
6097
- const useSessionPresence = useSessionPresence$1;
6098
- const sessionActivity = createSessionActivity({ subscribe: onStreamSignal });
6099
- const sessionCompaction = createCompactionProgress({ subscribe: onStreamSignal });
6100
- const sessionBadges = createSessionBadges({
6101
- read: (ids) => window.api.artifacts.badges(ids),
6102
- batchMax: ARTIFACT_BADGES_MAX,
6103
- onArtifactsChanged: (listener) => onStreamSignal((signal) => {
6104
- if (signal.kind === "artifact:recorded" || signal.kind === "artifact:changed") listener(signal.sessionId);
6105
- }),
6106
- onRegistryChanged: (listener) => subscribeInvalidation({ topics: ["extensions", "extensions:built"], scope: hostScope(null) }, listener)
6107
- });
6108
- function usePending(sessionId) {
6109
- const approval = useSessionApprovalHead(sessionId);
6110
- const interaction = useInteractionHead(sessionId);
6111
- return Boolean(approval) || Boolean(interaction);
6112
- }
6113
- const sidebarLive = createSidebarLive({
6114
- useRunning: (sessionId) => useSessionRunning(sessionId),
6115
- useRunElapsedSec: (sessionId, live, intervalMs) => useRunElapsedSec(sessionId, live, intervalMs),
6116
- usePending,
6117
- useNotification: (sessionId) => useSessionNotification(sessionId),
6118
- usePresence: (sessionId) => useSessionPresence(sessionId),
6119
- useHost: (hostId) => useHosts().hostById(hostId),
6120
- activity: sessionActivity,
6121
- badges: sessionBadges,
6122
- openBadge: (sessionId, panel, focus) => openSessionPanel(sessionId, panel, focus)
6123
- });
6124
- const useSessionDotState = sidebarLive.useSessionDotState;
6125
- const SessionStatusDot = sidebarLive.SessionStatusDot;
6126
7123
  const INITIAL = {
7124
+ channel: "npm",
6127
7125
  running: "",
6128
7126
  latest: null,
6129
7127
  hasUpdate: false,
@@ -6247,12 +7245,14 @@ function CompactingIndicator() {
6247
7245
  }
6248
7246
  function Footer({ hasAuth, onOpenAuth, onOpenSettings, spaces }) {
6249
7247
  const { settings } = useSettings();
7248
+ const { activeSessionId } = useSessionsList();
6250
7249
  useUpdateChecks();
6251
7250
  const update = useAppUpdate();
6252
7251
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
6253
7252
  SidebarFooter,
6254
7253
  {
6255
7254
  onOpenSettings,
7255
+ ...activeSessionId ? { sessionId: activeSessionId } : {},
6256
7256
  spaces,
6257
7257
  ...update ? { settingsNote: { text: update.title.split("\n")[0], warn: update.kind === "failed" } } : {},
6258
7258
  status: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -6267,11 +7267,12 @@ function Footer({ hasAuth, onOpenAuth, onOpenSettings, spaces }) {
6267
7267
  const searchSessions = (query, filter) => window.api.sessions.search(query, filter, "sidebar").then((response) => response.results);
6268
7268
  const chromeInset = () => ({
6269
7269
  height: nativeAnchoredPx(44),
6270
- width: `calc(${nativeAnchoredPx(84)} + 28px)`
7270
+ // Plus the extensions' title bar items after the toggle (`TitlebarSlot`).
7271
+ width: `calc(${nativeAnchoredPx(84)} + 28px + var(--zg-titlebar-w, 0px))`
6271
7272
  });
6272
7273
  const commitWidth = (width) => appearanceHost.prefs.set({ sidebarWidth: width });
6273
7274
  function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
6274
- const collapsed2 = useSidebarCollapsed();
7275
+ const collapsed = useSidebarCollapsed();
6275
7276
  const {
6276
7277
  sessions,
6277
7278
  activeSessionId,
@@ -6294,7 +7295,13 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
6294
7295
  deleteSession,
6295
7296
  listProjectSessions,
6296
7297
  archiveSessions,
6297
- deleteSessions
7298
+ deleteSessions,
7299
+ switcherSpaces,
7300
+ hiddenSpaces,
7301
+ setSpaceHidden,
7302
+ moveSpace,
7303
+ patchView,
7304
+ query
6298
7305
  } = useSessions();
6299
7306
  const { settings } = useSettings();
6300
7307
  const { hosts } = useHosts();
@@ -6314,10 +7321,30 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
6314
7321
  const onNewSessionIn = reactExports.useCallback(
6315
7322
  (fullPath) => {
6316
7323
  setDefaultFolder(fullPath);
7324
+ requestDraftOn(LOCAL_HOST_KEY, null);
6317
7325
  onNewSessionRef.current();
6318
7326
  },
6319
7327
  [setDefaultFolder]
6320
7328
  );
7329
+ const projectHome = settings.projectHome === true;
7330
+ const homeProject = useHomeProject();
7331
+ const onNewSessionOrFocus = reactExports.useCallback(() => {
7332
+ if (homeProject && activeSessionId == null) focusComposer();
7333
+ else onNewSessionRef.current();
7334
+ }, [homeProject, activeSessionId]);
7335
+ const chatsOpen = useChatDraft();
7336
+ const onOpenChats = reactExports.useCallback(() => {
7337
+ requestFolderlessDraft();
7338
+ onNewSessionRef.current();
7339
+ }, []);
7340
+ const onOpenProject = reactExports.useCallback(
7341
+ ({ path, hostId }) => {
7342
+ if (!hostId) return onNewSessionIn(path);
7343
+ requestDraftOn(hostId, path);
7344
+ onNewSessionRef.current();
7345
+ },
7346
+ [onNewSessionIn]
7347
+ );
6321
7348
  const moveSession = useMoveSession();
6322
7349
  const sessionsRef = reactExports.useRef(sessions);
6323
7350
  sessionsRef.current = sessions;
@@ -6336,10 +7363,31 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
6336
7363
  hasAuth,
6337
7364
  onOpenAuth,
6338
7365
  onOpenSettings,
6339
- spaces: spacesOn ? /* @__PURE__ */ jsxRuntimeExports.jsx(SpaceSwitcher, { spaces, activeId: activeSpace.id, onSelect: setActiveSpace }) : void 0
7366
+ spaces: spacesOn ? /* @__PURE__ */ jsxRuntimeExports.jsx(
7367
+ SpaceSwitcher,
7368
+ {
7369
+ spaces: switcherSpaces,
7370
+ hidden: hiddenSpaces,
7371
+ activeId: activeSpace.id,
7372
+ onSelect: setActiveSpace,
7373
+ onHide: setSpaceHidden,
7374
+ onMove: moveSpace
7375
+ }
7376
+ ) : void 0
6340
7377
  }
6341
7378
  ),
6342
- [hasAuth, onOpenAuth, onOpenSettings, spacesOn, spaces, activeSpace.id, setActiveSpace]
7379
+ [
7380
+ hasAuth,
7381
+ onOpenAuth,
7382
+ onOpenSettings,
7383
+ spacesOn,
7384
+ switcherSpaces,
7385
+ hiddenSpaces,
7386
+ activeSpace.id,
7387
+ setActiveSpace,
7388
+ setSpaceHidden,
7389
+ moveSpace
7390
+ ]
6343
7391
  );
6344
7392
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
6345
7393
  SessionSidebar,
@@ -6360,8 +7408,11 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
6360
7408
  live: sidebarLive,
6361
7409
  runDetails,
6362
7410
  artifactBadges: settings.artifacts !== false,
6363
- onNewSession,
7411
+ onNewSession: onNewSessionOrFocus,
6364
7412
  onNewSessionIn,
7413
+ ...projectHome ? { onOpenProject, openProject: homeProject } : {},
7414
+ onOpenChats,
7415
+ chatsOpen,
6365
7416
  onRename: renameSession,
6366
7417
  onSetArchived: setArchived,
6367
7418
  onSetFavorite: setFavorite,
@@ -6372,9 +7423,11 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
6372
7423
  onArchiveProject: projectSessions.archive,
6373
7424
  onDeleteProject: projectSessions.remove,
6374
7425
  keyboardBlocked,
7426
+ query,
7427
+ onViewChange: patchView,
6375
7428
  filter: /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarFilters, {}),
6376
7429
  footer,
6377
- collapsed: collapsed2,
7430
+ collapsed,
6378
7431
  width: sidebarWidth,
6379
7432
  onWidthCommit: commitWidth,
6380
7433
  chromeInset: chromeInset()
@@ -6382,24 +7435,56 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
6382
7435
  );
6383
7436
  }
6384
7437
  function SidebarFilters() {
6385
- const { archiveFilter, projectFilter, activityFilter, availableProjects, groupBy, sortBy } = useSessions();
7438
+ const { availableProjects, query, spacesOn, spaces, patchView, saveViewAsSpace } = useSessions();
6386
7439
  const { enabled: remoteHosts } = useHosts();
6387
- const view = reactExports.useMemo(
6388
- () => ({ archive: archiveFilter, project: projectFilter, activity: activityFilter, groupBy, sortBy }),
6389
- [archiveFilter, projectFilter, activityFilter, groupBy, sortBy]
6390
- );
6391
- const { setArchiveFilter, setProjectFilter, setActivityFilter, setGroupBy, setSortBy } = useSessions();
6392
- const onChange = reactExports.useCallback(
6393
- (patch) => {
6394
- if (patch.archive !== void 0) setArchiveFilter(patch.archive);
6395
- if (patch.project !== void 0) setProjectFilter(patch.project);
6396
- if (patch.activity !== void 0) setActivityFilter(patch.activity);
6397
- if (patch.groupBy !== void 0) setGroupBy(patch.groupBy);
6398
- if (patch.sortBy !== void 0) setSortBy(patch.sortBy);
6399
- },
6400
- [setArchiveFilter, setProjectFilter, setActivityFilter, setGroupBy, setSortBy]
7440
+ const onSaveView = useSaveViewAsSpace(saveViewAsSpace, spaces);
7441
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
7442
+ SidebarFilterMenu,
7443
+ {
7444
+ view: query.view,
7445
+ projects: availableProjects,
7446
+ onChange: patchView,
7447
+ hosts: remoteHosts,
7448
+ agents: query.agents,
7449
+ query,
7450
+ ...spacesOn && onSaveView ? { onSaveView } : {}
7451
+ }
7452
+ );
7453
+ }
7454
+ const TITLEBAR_WIDTH_VAR = "--zg-titlebar-w";
7455
+ const GAP_PX = 8;
7456
+ function publishTitlebarWidth(element, root = document.documentElement) {
7457
+ const apply = () => {
7458
+ const width = element.getBoundingClientRect().width;
7459
+ root.style.setProperty(TITLEBAR_WIDTH_VAR, width > 0 ? `${Math.ceil(width) + GAP_PX}px` : "0px");
7460
+ };
7461
+ apply();
7462
+ const observer = typeof ResizeObserver === "function" ? new ResizeObserver(apply) : null;
7463
+ observer?.observe(element);
7464
+ return () => {
7465
+ observer?.disconnect();
7466
+ root.style.removeProperty(TITLEBAR_WIDTH_VAR);
7467
+ };
7468
+ }
7469
+ function TitlebarSlot({ sessionId }) {
7470
+ const ref = reactExports.useRef(null);
7471
+ reactExports.useLayoutEffect(() => ref.current ? publishTitlebarWidth(ref.current) : void 0, []);
7472
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
7473
+ "div",
7474
+ {
7475
+ ref,
7476
+ "data-titlebar-slot": true,
7477
+ className: "zg-no-drag fixed z-30 flex items-center gap-1 overflow-hidden empty:hidden",
7478
+ style: {
7479
+ // Right of the toggle (84 DIP + its 28px, then the same 8px gap).
7480
+ left: `calc(${nativeAnchoredPx(84)} + 36px)`,
7481
+ top: `calc((${nativeAnchoredPx(44)} - 28px) / 2)`,
7482
+ height: 28,
7483
+ maxWidth: "min(320px, 40vw)"
7484
+ },
7485
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionSlot, { at: "app.titlebar", ...sessionId ? { sessionId } : {}, className: "flex-nowrap" })
7486
+ }
6401
7487
  );
6402
- return /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarFilterMenu, { view, projects: availableProjects, onChange, hosts: remoteHosts });
6403
7488
  }
6404
7489
  function CreateExtensionModal({ cwd, onCancel, onClose }) {
6405
7490
  const { createSession } = useSessionsActions();
@@ -6415,10 +7500,6 @@ function CreateExtensionModal({ cwd, onCancel, onClose }) {
6415
7500
  }
6416
7501
  );
6417
7502
  }
6418
- const noop = () => void 0;
6419
- const shellOfSize = (size) => ({ title, description, onClose, footer, children }) => /* @__PURE__ */ jsxRuntimeExports.jsx(ModalShell, { title, description, onClose: onClose ?? noop, footer, size, children });
6420
- const renderSessionModalShell = shellOfSize("medium");
6421
- const renderWideSessionModalShell = shellOfSize("large");
6422
7503
  const TERMINAL_TOOLS = {
6423
7504
  wait_task: "task_id",
6424
7505
  terminal_read: "id",
@@ -6493,6 +7574,7 @@ function SessionDetailsModal({ session: initialSession, onClose }) {
6493
7574
  const isMain = session.isMain === true;
6494
7575
  session.status === "running";
6495
7576
  const { hostById } = useHosts();
7577
+ const display = useDisplayPath();
6496
7578
  const server = session.hostId ? hostById(session.hostId) : void 0;
6497
7579
  const machine = session.environment ? parseMachineKind(session.environment.kind) : null;
6498
7580
  const folderLocation = session.hostId ? server ? null : { kind: "server-gone" } : machine ? { kind: "machine", name: machine.name } : session.workspace ? { kind: "sandbox" } : null;
@@ -6518,7 +7600,7 @@ function SessionDetailsModal({ session: initialSession, onClose }) {
6518
7600
  ...session.createdAt ? { createdAt: session.createdAt } : {},
6519
7601
  ...session.updatedAt ? { updatedAt: session.updatedAt } : {},
6520
7602
  cwd: session.cwd,
6521
- ...session.cwd ? { folderDisplay: compactPath(session.cwd, 56) } : {},
7603
+ ...session.cwd ? { folderDisplay: compactPath(display.path(session.cwd, session.hostId), 56) } : {},
6522
7604
  ...session.projectRoot ? { projectRoot: session.projectRoot } : {},
6523
7605
  isMain,
6524
7606
  folderLocation
@@ -6572,6 +7654,159 @@ function usePinnedAccount(session) {
6572
7654
  const found = catalog.find((e) => e.providerKey === providerKey && e.account?.id === account)?.account;
6573
7655
  return found ? { label: found.label } : { label: "", signedOut: true };
6574
7656
  }
7657
+ const EMPTY_SETTINGS = {
7658
+ schema: { categories: [], items: [] },
7659
+ actions: [],
7660
+ values: {},
7661
+ locked: []
7662
+ };
7663
+ const NO_INTEGRATIONS = [];
7664
+ const noop = { get: () => EMPTY_SETTINGS, subscribe: () => () => {
7665
+ } };
7666
+ const noIntegrations = { get: () => NO_INTEGRATIONS, subscribe: () => () => {
7667
+ } };
7668
+ const KIND_LABEL = {
7669
+ tools: "tool",
7670
+ agents: "agent",
7671
+ subagents: "sub-agent",
7672
+ models: "model",
7673
+ providers: "provider",
7674
+ mcp: "MCP server",
7675
+ skills: "skill"
7676
+ };
7677
+ function provenanceLabel(p) {
7678
+ if (p.removed) return `hidden by ${p.removedBy ?? p.changedBy.at(-1) ?? "an extension"}`;
7679
+ if (p.origin.kind === "extension" && p.changedBy.length <= 1)
7680
+ return `added by ${p.origin.id ?? p.changedBy[0] ?? "an extension"}`;
7681
+ return `modified by ${p.changedBy.join(", ")}`;
7682
+ }
7683
+ function errorText$1(err) {
7684
+ const error = extensionsErrorOf(err);
7685
+ if (error.code === "refused")
7686
+ return error.message ?? (error.reason === "locked" ? "Locked by the config file." : "Refused.");
7687
+ if (error.code === "unavailable") return "Not available here.";
7688
+ return error.message;
7689
+ }
7690
+ function IntegrationRow({ integration }) {
7691
+ const host2 = useExtensionsHost();
7692
+ const [keys, setKeys] = reactExports.useState({});
7693
+ const [busy, setBusy] = reactExports.useState(false);
7694
+ const [error, setError] = reactExports.useState(null);
7695
+ const run = (work) => {
7696
+ setBusy(true);
7697
+ setError(null);
7698
+ void Promise.resolve(work()).catch((err) => setError(errorText$1(err))).finally(() => setBusy(false));
7699
+ };
7700
+ const connections = integration.connections ?? (integration.connection ? [integration.connection] : []);
7701
+ const connected = connections.length > 0;
7702
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex flex-col gap-1.5 py-2", "data-integration": integration.id, children: [
7703
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
7704
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[13px] font-medium", children: integration.name }),
7705
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[12px] text-[var(--zg-text-muted)]", children: !connected ? "Not connected" : connections.length === 1 ? "Connected" : `${connections.length} accounts` })
7706
+ ] }),
7707
+ integration.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-[var(--zg-text-muted)]", children: integration.description }),
7708
+ connected && /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { "aria-label": `${integration.name} accounts`, className: "flex flex-col gap-1", children: connections.map((c) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex items-center gap-2 text-[12px]", "data-connection": c.account, children: [
7709
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: c.label ?? c.account }),
7710
+ c.isDefault ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta", children: "Default" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
7711
+ "button",
7712
+ {
7713
+ type: "button",
7714
+ className: "text-[12px] underline",
7715
+ disabled: busy,
7716
+ "aria-label": `Make ${c.label ?? c.account} the default`,
7717
+ onClick: () => run(() => host2?.integrations?.setDefault(integration.id, c.account)),
7718
+ children: "Make default"
7719
+ }
7720
+ ),
7721
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
7722
+ "button",
7723
+ {
7724
+ type: "button",
7725
+ className: "ml-auto text-[12px] underline",
7726
+ disabled: busy,
7727
+ "aria-label": `Disconnect ${c.label ?? c.account}`,
7728
+ onClick: () => run(() => host2?.integrations?.disconnect(integration.id, { account: c.account })),
7729
+ children: "Disconnect"
7730
+ }
7731
+ )
7732
+ ] }, c.account)) }),
7733
+ integration.methods.map(
7734
+ (method) => method.type === "apiKey" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
7735
+ "form",
7736
+ {
7737
+ className: "flex items-center gap-2",
7738
+ onSubmit: (e) => {
7739
+ e.preventDefault();
7740
+ run(
7741
+ () => host2?.integrations?.connect(integration.id, { methodId: method.id, key: keys[method.id] ?? "" }).then(() => setKeys((k) => ({ ...k, [method.id]: "" })))
7742
+ );
7743
+ },
7744
+ children: [
7745
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
7746
+ "input",
7747
+ {
7748
+ type: "password",
7749
+ "aria-label": method.label,
7750
+ placeholder: method.placeholder ?? method.label,
7751
+ value: keys[method.id] ?? "",
7752
+ onChange: (e) => setKeys((k) => ({ ...k, [method.id]: e.target.value })),
7753
+ className: "zg-well flex-1 min-w-0 rounded px-2 py-1 text-[12px]"
7754
+ }
7755
+ ),
7756
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "submit", disabled: busy || !keys[method.id], className: "text-[12px] underline", children: connected ? "Add account" : "Connect" })
7757
+ ]
7758
+ },
7759
+ method.id
7760
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
7761
+ "button",
7762
+ {
7763
+ type: "button",
7764
+ disabled: busy,
7765
+ className: "self-start text-[12px] underline",
7766
+ onClick: () => run(() => host2?.integrations?.connect(integration.id, { methodId: method.id })),
7767
+ children: connected ? `Add account with ${method.label}` : method.label
7768
+ },
7769
+ method.id
7770
+ )
7771
+ ),
7772
+ error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { role: "alert", className: "text-[12px] text-[var(--zg-danger)]", children: error })
7773
+ ] });
7774
+ }
7775
+ function ExtensionSettingsSection() {
7776
+ const host2 = useExtensionsHost();
7777
+ const wire2 = useReadable(host2?.settings?.wire ?? noop);
7778
+ const integrations = useReadable(host2?.integrations?.list ?? noIntegrations);
7779
+ if (!host2) return null;
7780
+ const locked = wire2.locked;
7781
+ const changes = wire2.provenance ?? [];
7782
+ if (locked.length === 0 && changes.length === 0 && integrations.length === 0) return null;
7783
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { "aria-label": "Extension settings", className: "flex flex-col gap-4", children: [
7784
+ locked.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
7785
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[12px] uppercase tracking-wide text-[var(--zg-text-muted)]", children: "Set by the config file" }),
7786
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "text-[12px]", children: locked.map((id) => {
7787
+ const [extension = "", key2 = ""] = id.split(":");
7788
+ const value = wire2.values[extension]?.[key2];
7789
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex gap-2 py-0.5", "data-locked-setting": id, children: [
7790
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono", children: id }),
7791
+ value !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-text-muted)]", children: String(value) }),
7792
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-auto text-[var(--zg-text-muted)]", children: "locked" })
7793
+ ] }, id);
7794
+ }) })
7795
+ ] }),
7796
+ changes.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
7797
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[12px] uppercase tracking-wide text-[var(--zg-text-muted)]", children: "Changed by extensions" }),
7798
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "text-[12px]", children: changes.map((p) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex gap-2 py-0.5", "data-catalog-change": `${p.kind}:${p.id}`, children: [
7799
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-text-muted)]", children: KIND_LABEL[p.kind] }),
7800
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono", children: p.id }),
7801
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-auto text-[var(--zg-text-muted)]", children: provenanceLabel(p) })
7802
+ ] }, `${p.kind}:${p.id}`)) })
7803
+ ] }),
7804
+ integrations.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
7805
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[12px] uppercase tracking-wide text-[var(--zg-text-muted)]", children: "Integrations" }),
7806
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "divide-y divide-[var(--zg-border)]", children: integrations.map((integration) => /* @__PURE__ */ jsxRuntimeExports.jsx(IntegrationRow, { integration }, integration.id)) })
7807
+ ] })
7808
+ ] });
7809
+ }
6575
7810
  const LABELS = {
6576
7811
  home: "Show the zidane folder in Finder",
6577
7812
  skills: "Show the skills folder in Finder",
@@ -6761,7 +7996,6 @@ const PanelPage = reactExports.memo(function PanelPage2({
6761
7996
  onClose,
6762
7997
  onCreateExtension
6763
7998
  }) {
6764
- const { visible } = useSettingsSection();
6765
7999
  if (server) {
6766
8000
  switch (id) {
6767
8001
  case "accounts":
@@ -6800,9 +8034,16 @@ const PanelPage = reactExports.memo(function PanelPage2({
6800
8034
  case "accounts":
6801
8035
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopProvidersSection, { cwd });
6802
8036
  case "extensions":
6803
- return /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopExtensionsSection, { cwd, onClose, onCreateExtension, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionOptionsSection, { cwd, visible }) });
8037
+ return (
8038
+ // The extensions' settings rows are their own pages in the sidebar (the kit's `useExtensionSettingsSections`).
8039
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopExtensionsSection, { cwd, onClose, onCreateExtension, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionSettingsSection, {}) })
8040
+ );
6804
8041
  }
6805
8042
  });
8043
+ function UpdateChannelNote() {
8044
+ const { channel } = useUpdateState();
8045
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-[var(--zg-text-muted)] px-1 m-0", "data-testid": "update-channel", children: channel === "native" ? "Installed from zidane.si. Updates download from there and are checked against its release list." : "Installed with a package manager. Updates run through it, with the zidane CLI next to it." });
8046
+ }
6806
8047
  function ClearSiteDataRow({ cwd }) {
6807
8048
  const [state2, setState] = reactExports.useState("idle");
6808
8049
  const description = state2 === "done" ? "Cleared. Pages open in this project start signed out." : cwd ? "Logins, cookies, storage and cache of the pages opened in this project." : "Open a session in a project folder to clear its browser data.";
@@ -6926,7 +8167,9 @@ const SectionsPage = reactExports.memo(function SectionsPage2({
6926
8167
  enabled: settings.useDaemon === true,
6927
8168
  onOpenDaemon: () => select("advanced", "useDaemon")
6928
8169
  }
6929
- )
8170
+ ),
8171
+ // About this app: a server's settings say nothing of how it updates.
8172
+ updates: () => server ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(UpdateChannelNote, {})
6930
8173
  }
6931
8174
  }
6932
8175
  );
@@ -7003,6 +8246,7 @@ function AppVersion() {
7003
8246
  void navigator.clipboard.writeText(version).then(() => setCopied(true));
7004
8247
  },
7005
8248
  hint: "Copy version",
8249
+ icon: null,
7006
8250
  title: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta", children: copied ? "copied" : `Zidane ${version}` }),
7007
8251
  className: "flex-1 min-w-0 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--zg-ring)]"
7008
8252
  }
@@ -7031,6 +8275,9 @@ function UpgradeButton() {
7031
8275
  );
7032
8276
  }
7033
8277
  const NO_ACTIONS = [];
8278
+ const NO_STORE = { get: () => void 0, subscribe: () => () => {
8279
+ } };
8280
+ const NO_SEARCH = [];
7034
8281
  function SettingsModal({ initialHostId, ...props }) {
7035
8282
  const { servers, hostById } = useHosts();
7036
8283
  const [hostId, setHostId] = reactExports.useState(initialHostId ?? LOCAL_HOST_ID);
@@ -7073,6 +8320,7 @@ function SettingsModal({ initialHostId, ...props }) {
7073
8320
  fallback: (error) => /* @__PURE__ */ jsxRuntimeExports.jsx(
7074
8321
  ScreenShell,
7075
8322
  {
8323
+ className: "zg-selectable",
7076
8324
  title: "Settings",
7077
8325
  screenLabel: "Settings",
7078
8326
  onClose: props.onClose,
@@ -7088,7 +8336,7 @@ function SettingsModal({ initialHostId, ...props }) {
7088
8336
  )
7089
8337
  }
7090
8338
  ),
7091
- children: body
8339
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(PathDisplayScope, { hostId: server.id, children: body })
7092
8340
  }
7093
8341
  );
7094
8342
  }
@@ -7108,7 +8356,15 @@ function SettingsBody({
7108
8356
  const { enabled: hostsEnabled } = useHosts();
7109
8357
  const pages = reactExports.useMemo(() => visiblePages({ server: Boolean(server), hostsEnabled }), [server, hostsEnabled]);
7110
8358
  const counts = usePageCounts(pages, { server: Boolean(server), cwd });
7111
- const extensionSearch = useExtensionOptionsSearch(cwd);
8359
+ const extHost = useElectronExtensionsHost();
8360
+ const extHostId = useReadable(extHost?.hostId ?? NO_STORE);
8361
+ const ext = useExtensionSettingsSections();
8362
+ const extensionsShown = Boolean(extHost) && extHostId === server?.id;
8363
+ const extensionSections = reactExports.useMemo(
8364
+ () => extensionsShown ? [...ext.entries, ...ext.categories] : [],
8365
+ [extensionsShown, ext]
8366
+ );
8367
+ const extensionSearch = extensionsShown ? ext.search : NO_SEARCH;
7112
8368
  const hostCwdOrNull = server && serverFolder?.hostId === server.id ? serverFolder.cwd : null;
7113
8369
  const sections = reactExports.useMemo(
7114
8370
  () => layoutSections(pages, {
@@ -7127,15 +8383,17 @@ function SettingsBody({
7127
8383
  }
7128
8384
  ),
7129
8385
  renderRows: (page) => /* @__PURE__ */ jsxRuntimeExports.jsx(SectionsPage, { page, server, cwd, hostCwd: hostCwdOrNull, actions })
7130
- }),
7131
- [pages, server, actions, cwd, hostCwdOrNull, onClose, onCreateExtension]
8386
+ }).concat(extensionSections),
8387
+ [pages, server, actions, cwd, hostCwdOrNull, onClose, onCreateExtension, extensionSections]
7132
8388
  );
7133
8389
  const renderFrame = reactExports.useCallback(
7134
8390
  (frame) => /* @__PURE__ */ jsxRuntimeExports.jsx(
7135
8391
  ScreenShell,
7136
8392
  {
8393
+ className: "zg-selectable",
7137
8394
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsHeadingText, { text: frame.title }),
7138
8395
  description: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsHeadingText, { text: frame.description ?? "" }),
8396
+ lead: frame.lead,
7139
8397
  screenLabel: "Settings",
7140
8398
  onClose,
7141
8399
  aside: { search: frame.search, nav: frame.nav },
@@ -7354,9 +8612,102 @@ function perfSource(openPage) {
7354
8612
  }
7355
8613
  };
7356
8614
  }
7357
- const editorPrefs = createStorageEditorPrefs({
7358
- // Read on first use: a module imported where there is no `localStorage` (a node test) still loads.
7359
- storage: { getItem: (key2) => localStorage.getItem(key2), setItem: (key2, value) => localStorage.setItem(key2, value) }
8615
+ function fromSettings(editor) {
8616
+ if (!editor || typeof editor !== "object" || Object.keys(editor).length === 0) return void 0;
8617
+ return parseEditor(JSON.stringify(editor));
8618
+ }
8619
+ const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
8620
+ function createSettingsEditorPrefs(options) {
8621
+ const { api, cache, onSettingsWritten } = options;
8622
+ let state2;
8623
+ let cached;
8624
+ let inflight = 0;
8625
+ const listeners2 = /* @__PURE__ */ new Set();
8626
+ const notify2 = () => {
8627
+ for (const l of [...listeners2]) l();
8628
+ };
8629
+ const remember2 = (next) => {
8630
+ try {
8631
+ cache.setItem(EDITOR_STORAGE_KEY, JSON.stringify(next));
8632
+ } catch {
8633
+ }
8634
+ };
8635
+ const adopt = (editor) => {
8636
+ if (inflight > 0 || !state2) return;
8637
+ const next = fromSettings(editor) ?? DEFAULT_EDITOR;
8638
+ if (same(state2, next)) return;
8639
+ state2 = next;
8640
+ remember2(next);
8641
+ notify2();
8642
+ };
8643
+ const persist = (next) => {
8644
+ inflight++;
8645
+ void api().settings.set({ editor: { ...next } }).then(
8646
+ (settings) => {
8647
+ inflight--;
8648
+ adopt(settings.editor);
8649
+ },
8650
+ () => {
8651
+ inflight--;
8652
+ }
8653
+ );
8654
+ };
8655
+ const read2 = () => {
8656
+ void api().settings.get().then(
8657
+ (settings) => adopt(settings.editor),
8658
+ () => void 0
8659
+ );
8660
+ };
8661
+ const load = () => {
8662
+ if (state2) return state2;
8663
+ try {
8664
+ const raw = cache.getItem(EDITOR_STORAGE_KEY);
8665
+ cached = raw === null ? void 0 : parseEditor(raw);
8666
+ } catch {
8667
+ cached = void 0;
8668
+ }
8669
+ state2 = cached ?? DEFAULT_EDITOR;
8670
+ void api().settings.get().then(
8671
+ (settings) => {
8672
+ const stored = fromSettings(settings.editor);
8673
+ if (stored || !cached) adopt(settings.editor);
8674
+ else if (inflight === 0) persist(cached);
8675
+ },
8676
+ () => void 0
8677
+ );
8678
+ onSettingsWritten(read2);
8679
+ api().settings.onChanged((signal) => adopt(signal.settings.editor));
8680
+ return state2;
8681
+ };
8682
+ const prefs = {
8683
+ get: load,
8684
+ subscribe(onChange) {
8685
+ load();
8686
+ listeners2.add(onChange);
8687
+ return () => {
8688
+ listeners2.delete(onChange);
8689
+ };
8690
+ },
8691
+ set(update) {
8692
+ const prev = load();
8693
+ const next = { ...prev, ...update, version: 1 };
8694
+ if (same(prev, next)) return;
8695
+ state2 = next;
8696
+ remember2(next);
8697
+ notify2();
8698
+ persist(next);
8699
+ },
8700
+ reset() {
8701
+ prefs.set(DEFAULT_EDITOR);
8702
+ }
8703
+ };
8704
+ return prefs;
8705
+ }
8706
+ const editorPrefs = createSettingsEditorPrefs({
8707
+ // Read on first use: a module imported where there is no `window` (a node test) still loads.
8708
+ api: () => window.api,
8709
+ cache: { getItem: (key2) => localStorage.getItem(key2), setItem: (key2, value) => localStorage.setItem(key2, value) },
8710
+ onSettingsWritten: (onChange) => subscribeInvalidation({ topics: ["settings"], scope: hostScope(null) }, () => onChange())
7360
8711
  });
7361
8712
  function isOnThisMachine(cwd) {
7362
8713
  return !cwd.startsWith("zidane-env://");
@@ -7467,7 +8818,7 @@ function useSessionFacts(id) {
7467
8818
  return session ? { updatedAt: session.updatedAt, current: id === activeSessionId } : void 0;
7468
8819
  }
7469
8820
  const rows = createPaletteRows({
7470
- StatusDot: SessionStatusDot,
8821
+ StatusDot: SessionStatusDot$1,
7471
8822
  useSessionStatus: useSessionDotState,
7472
8823
  useSession: useSessionFacts,
7473
8824
  highlight: (excerpt, query) => focusExcerpt(excerpt, findTermRanges(excerpt, tokenizeQuery(query)))
@@ -7626,6 +8977,112 @@ function PaletteHost({
7626
8977
  usePaletteModalSlot({ context, cwd, render: (ctx) => /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopPaletteDialog, { context: ctx }) });
7627
8978
  return null;
7628
8979
  }
8980
+ const RESERVED = (event) => event.key === "Escape" || event.ctrlKey && !event.metaKey && !event.altKey && event.key.toLowerCase() === "c";
8981
+ function commandAllowed(command, focus, mode) {
8982
+ if (!command.enabled) return false;
8983
+ if (command.mode !== void 0 && command.mode !== mode) return false;
8984
+ if (focus.typing && !command.editable) return false;
8985
+ const scope = command.scope;
8986
+ if (focus.modal) return scope === "modal";
8987
+ if (scope === "global") return true;
8988
+ if (scope === "composer") return focus.composer;
8989
+ if (scope === "transcript") return focus.transcript;
8990
+ if (scope.startsWith("panel:")) return focus.panel !== void 0 && scope.slice("panel:".length) === focus.panel;
8991
+ return false;
8992
+ }
8993
+ function createExtensionKeyHandler(options) {
8994
+ return (event) => {
8995
+ if (event.defaultPrevented || event.repeat || RESERVED(event)) return;
8996
+ const focus = options.focus(event);
8997
+ const mode = options.mode();
8998
+ const matching = options.commands().filter((c) => c.bind.some((chord) => options.matches(event, chord)) && commandAllowed(c, focus, mode)).sort((a, b) => Number(b.mode !== void 0) - Number(a.mode !== void 0));
8999
+ if (matching.length === 0) return;
9000
+ event.preventDefault();
9001
+ event.stopPropagation();
9002
+ void (async () => {
9003
+ for (const command of matching) {
9004
+ if (await options.run(command.id).catch(() => false)) return;
9005
+ }
9006
+ })();
9007
+ };
9008
+ }
9009
+ function desktopFocusScopes(event) {
9010
+ const target = event.target instanceof Element ? event.target : document.activeElement;
9011
+ const typing = !!target && (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable);
9012
+ const panelRoot = target?.closest('aside[aria-label="Side panel"]');
9013
+ const activeTab = panelRoot?.querySelector('[data-tab-id][aria-selected="true"]')?.dataset.tabId;
9014
+ return {
9015
+ // A dialog animating out (`data-state="closing"`, inert) is gone for the keys already.
9016
+ modal: document.querySelector('[role="dialog"][aria-modal="true"]:not([data-state="closing"])') !== null,
9017
+ composer: !!target?.closest("[data-composer-shell], .zg-composer-editor"),
9018
+ transcript: !!target?.closest("[data-row], .zg-cv-row"),
9019
+ ...panelRoot && activeTab ? { panel: activeTab } : {},
9020
+ typing
9021
+ };
9022
+ }
9023
+ function appliesHere(effect) {
9024
+ if (effect.kind === "composer" || effect.kind === "keymap") return false;
9025
+ return !(effect.kind === "navigate" && "screen" in effect.to);
9026
+ }
9027
+ function ExtensionsRoot() {
9028
+ const host2 = useElectronExtensionsHost();
9029
+ const { setActiveSessionId, activeSessionId } = useSessions();
9030
+ const sessionRef = reactExports.useRef(void 0);
9031
+ sessionRef.current = activeSessionId ?? void 0;
9032
+ const panels = useOptionalPanelActions();
9033
+ const layout = usePanelLayout();
9034
+ const handler = (effect) => {
9035
+ switch (effect.kind) {
9036
+ case "panel": {
9037
+ if (!panels) return false;
9038
+ const open = layout.openTabs.some((t) => t.id === effect.panelId) && layout.state.open;
9039
+ if (effect.action === "close" || effect.action === "toggle" && open) {
9040
+ if (!open) return false;
9041
+ panels.closeTab(effect.panelId);
9042
+ return true;
9043
+ }
9044
+ if (!layout.tabs.some((t) => t.id === effect.panelId)) return false;
9045
+ panels.pick(effect.panelId);
9046
+ return true;
9047
+ }
9048
+ case "panel-state":
9049
+ return layout.state.open ? layout.openTabs.map((t) => t.id) : [];
9050
+ case "navigate": {
9051
+ const to = effect.to;
9052
+ if ("session" in to) {
9053
+ setActiveSessionId(to.session);
9054
+ return true;
9055
+ }
9056
+ if ("screen" in to) return false;
9057
+ setActiveSessionId(null);
9058
+ return true;
9059
+ }
9060
+ case "notify":
9061
+ if (!document.hasFocus() && typeof Notification === "function")
9062
+ new Notification(effect.title, {
9063
+ ...effect.body ? { body: effect.body } : {},
9064
+ silent: effect.sound === false
9065
+ });
9066
+ return void 0;
9067
+ default:
9068
+ return false;
9069
+ }
9070
+ };
9071
+ useExtensionEffects(handler, { accepts: appliesHere });
9072
+ reactExports.useEffect(() => {
9073
+ if (!host2) return void 0;
9074
+ const onKey = createExtensionKeyHandler({
9075
+ commands: () => host2.keyCommands.get(),
9076
+ mode: () => host2.keymapMode.get(),
9077
+ matches: (event, chord) => matchesBinding(event, chord),
9078
+ focus: desktopFocusScopes,
9079
+ run: async (id) => host2.commands ? host2.commands.run(id, sessionRef.current ? { sessionId: sessionRef.current } : {}) : false
9080
+ });
9081
+ window.addEventListener("keydown", onKey, true);
9082
+ return () => window.removeEventListener("keydown", onKey, true);
9083
+ }, [host2]);
9084
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionDialogHost, {});
9085
+ }
7629
9086
  function useOnboardingGate(enabled, surfaceFirstRun, openOnboarding) {
7630
9087
  const opener = reactExports.useRef(openOnboarding);
7631
9088
  opener.current = openOnboarding;
@@ -7784,6 +9241,7 @@ function Webview({
7784
9241
  const onStop = () => {
7785
9242
  browserStore.update(sessionId, { loading: false });
7786
9243
  sync();
9244
+ browserStore.recordVisit(sessionId);
7787
9245
  };
7788
9246
  const onNavigate = () => {
7789
9247
  browserStore.update(sessionId, { error: null, crashed: null });
@@ -7809,6 +9267,7 @@ function Webview({
7809
9267
  };
7810
9268
  const onGone = () => {
7811
9269
  const now = Date.now();
9270
+ for (const [id, times] of crashLog) if (times.every((t) => now - t >= CRASH_WINDOW_MS)) crashLog.delete(id);
7812
9271
  const recent = (crashLog.get(sessionId) ?? []).filter((t) => now - t < CRASH_WINDOW_MS);
7813
9272
  if (recent.length >= MAX_CRASH_RETRIES) {
7814
9273
  crashLog.set(sessionId, recent);
@@ -7904,10 +9363,10 @@ function BrowserRequests() {
7904
9363
  []
7905
9364
  );
7906
9365
  reactExports.useEffect(() => {
7907
- let seq = 0;
9366
+ let seq2 = 0;
7908
9367
  return window.api.browser.onPointer(({ sessionId, x, y, phase }) => {
7909
- seq += 1;
7910
- browserStore.update(sessionId, { pointer: { x, y, phase, seq } });
9368
+ seq2 += 1;
9369
+ browserStore.update(sessionId, { pointer: { x, y, phase, seq: seq2 } });
7911
9370
  });
7912
9371
  }, []);
7913
9372
  return null;
@@ -8343,6 +9802,7 @@ function AppShell({ appearanceFirstRun: appearanceFirstRun2 }) {
8343
9802
  onFindInConversation: find.findIn
8344
9803
  }
8345
9804
  ) }),
9805
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Extensions", resetKey: regionKey, fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionsRoot, {}) }),
8346
9806
  /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Browser", resetKey: regionKey, fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrowserHost, {}) }),
8347
9807
  /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Browser requests", resetKey: regionKey, fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrowserRequests, {}) }),
8348
9808
  /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Inbox", resetKey: regionKey, fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(InboxAttention, {}) }),
@@ -8373,7 +9833,8 @@ function AppShell({ appearanceFirstRun: appearanceFirstRun2 }) {
8373
9833
  onOpenEnvironmentSettings: openEnvironmentSettings
8374
9834
  }
8375
9835
  ) }),
8376
- !standalone && /* @__PURE__ */ jsxRuntimeExports.jsx(WindowSidebarToggle, {})
9836
+ !standalone && /* @__PURE__ */ jsxRuntimeExports.jsx(WindowSidebarToggle, {}),
9837
+ !standalone && /* @__PURE__ */ jsxRuntimeExports.jsx(TitlebarSlot, { sessionId: activeSessionId ?? void 0 })
8377
9838
  ] }) })
8378
9839
  ] });
8379
9840
  }
@@ -8521,7 +9982,8 @@ function createElectronSessionHost(api, onStreamSignal2) {
8521
9982
  usage: {
8522
9983
  summary: (range) => api.usage.summary(range),
8523
9984
  providers: (options) => api.providerUsage.fetchAll(void 0, options?.refresh ? { refresh: true } : void 0),
8524
- github: (options) => api.providerUsage.fetchGithub(options)
9985
+ github: (options) => api.providerUsage.fetchGithub(options),
9986
+ redeemReset: (target) => api.providerUsage.redeemReset(target.providerKey, target.credentialKey, target.creditId)
8525
9987
  },
8526
9988
  connect() {
8527
9989
  const off = [
@@ -8666,6 +10128,22 @@ function createElectronTranscriptMembers(api, deps = {}) {
8666
10128
  };
8667
10129
  }
8668
10130
  if (deps.siteIcons) members.siteIcons = deps.siteIcons;
10131
+ const blocks = api.blocks;
10132
+ if (blocks) {
10133
+ const client = {
10134
+ call: (method, params) => blocks.call(method, params),
10135
+ onSignal: (listener) => blocks.onSignal(listener)
10136
+ };
10137
+ members.blockRuns = createChatBlockRuns({
10138
+ list: (sessionId) => blocks.list(sessionId),
10139
+ run: (sessionId, request2, options) => runBlockOnHost(client, sessionId, request2, {
10140
+ ...options?.onOutput ? { onOutput: options.onOutput } : {},
10141
+ ...options?.signal ? { signal: options.signal } : {}
10142
+ }),
10143
+ remove: (sessionId, key2) => blocks.remove(sessionId, key2),
10144
+ onChanged: (listener) => blocks.onChanged(({ sessionId }) => listener(sessionId))
10145
+ });
10146
+ }
8669
10147
  return members;
8670
10148
  }
8671
10149
  function toChatSession(row) {
@@ -8756,12 +10234,12 @@ function createElectronChatHost(api, streams, options = {}) {
8756
10234
  if (!store2.isHydrated(sessionId)) store2.setEventsPage(sessionId, page);
8757
10235
  if (running && store2.runStateVersion === version) store2.markRunning(sessionId);
8758
10236
  };
8759
- const transcripts = /* @__PURE__ */ new Map();
10237
+ const transcripts = /* @__PURE__ */ new WeakMap();
8760
10238
  const transcript = (id) => {
8761
- let t = transcripts.get(id);
8762
- if (t) return t;
8763
10239
  const sessionId = id;
8764
10240
  const inner = streams.transcript(sessionId);
10241
+ let t = transcripts.get(inner);
10242
+ if (t) return t;
8765
10243
  t = {
8766
10244
  ...inner,
8767
10245
  subscribe(onChange) {
@@ -8770,7 +10248,7 @@ function createElectronChatHost(api, streams, options = {}) {
8770
10248
  return off;
8771
10249
  }
8772
10250
  };
8773
- transcripts.set(id, t);
10251
+ transcripts.set(inner, t);
8774
10252
  return t;
8775
10253
  };
8776
10254
  const pendings = /* @__PURE__ */ new Map();
@@ -8785,14 +10263,16 @@ function createElectronChatHost(api, streams, options = {}) {
8785
10263
  };
8786
10264
  const everyPending = writable([]);
8787
10265
  const resolved = /* @__PURE__ */ new Set();
8788
- const addInteraction = (sessionId, request, live, hydrated = false) => {
8789
- if (resolved.has(request.id) || everyPending.get().some((i) => i.requestId === request.id)) return;
8790
- const item = { requestId: request.id, sessionId, request, live };
10266
+ const RESOLVED_MAX = 500;
10267
+ const addInteraction = (sessionId, request2, live, hydrated = false) => {
10268
+ if (resolved.has(request2.id) || everyPending.get().some((i) => i.requestId === request2.id)) return;
10269
+ const item = { requestId: request2.id, sessionId, request: request2, live };
8791
10270
  pending(sessionId).set((all) => hydrated ? [item, ...all] : [...all, item]);
8792
10271
  everyPending.set((all) => hydrated ? [item, ...all] : [...all, item]);
8793
10272
  };
8794
10273
  const resolveInteraction = (requestId) => {
8795
10274
  resolved.add(requestId);
10275
+ if (resolved.size > RESOLVED_MAX) resolved.delete(resolved.values().next().value);
8796
10276
  for (const p of pendings.values()) {
8797
10277
  if (p.get().some((i) => i.requestId === requestId)) p.set((all) => all.filter((i) => i.requestId !== requestId));
8798
10278
  }
@@ -9273,7 +10753,7 @@ const GUI_LABELS = {
9273
10753
  };
9274
10754
  const APP_RENDERERS = { attachmentLabel: codeAttachmentLabel };
9275
10755
  function AppProviders({ children }) {
9276
- return /* @__PURE__ */ jsxRuntimeExports.jsx(LabelsProvider, { labels: GUI_LABELS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(HostsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ApprovalsHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StreamProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ComposerHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PromptHistoryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTurnProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FilesHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PanelsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TerminalHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopPaletteProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChatHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeybindingsProvider, { host: keybindingsHost, children: /* @__PURE__ */ jsxRuntimeExports.jsx(GitProvider, { host: gitHost, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarHostProvider, { host: sidebarHost, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptRenderersProvider, { value: APP_RENDERERS, children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
10756
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(LabelsProvider, { labels: GUI_LABELS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(HostsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ApprovalsHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StreamProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ComposerHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PromptHistoryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTurnProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(FilesHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PanelsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionsHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TerminalHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopPaletteProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChatHostProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeybindingsProvider, { host: keybindingsHost, children: /* @__PURE__ */ jsxRuntimeExports.jsx(GitProvider, { host: gitHost, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarHostProvider, { host: sidebarHost, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptRenderersProvider, { value: APP_RENDERERS, children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
9277
10757
  }
9278
10758
  const HIGHLIGHTER = createCodeHighlighter(
9279
10759
  typeof WorkerWrapper$1 === "function" ? { createWorker: () => trackRendererWorker("Code highlighting", new WorkerWrapper$1()) } : {}
@@ -9283,41 +10763,6 @@ function CodeHighlight({ children }) {
9283
10763
  const { wordWrap } = useEditorPrefs();
9284
10764
  return /* @__PURE__ */ jsxRuntimeExports.jsx(CodeHighlightProvider, { highlighter: HIGHLIGHTER, theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeWrapProvider, { wrap: wordWrap, children }) });
9285
10765
  }
9286
- function EditorEnvironmentRoot({ children }) {
9287
- const shikiTheme = useShikiTheme();
9288
- const { appearance } = usePalette();
9289
- const ed = useEditorPrefs();
9290
- const reducedMotion = useAppearanceReducedMotion();
9291
- const value = reactExports.useMemo(
9292
- () => ({
9293
- shikiTheme,
9294
- appearance,
9295
- reducedMotion,
9296
- settings: {
9297
- editing: ed.editing,
9298
- saveOn: ed.saveOn,
9299
- tabSize: ed.tabSize,
9300
- wordWrap: ed.wordWrap,
9301
- matchBrackets: ed.matchBrackets,
9302
- roundedSelection: ed.roundedSelection,
9303
- autoSurround: ed.autoSurround
9304
- }
9305
- }),
9306
- [
9307
- shikiTheme,
9308
- appearance,
9309
- reducedMotion,
9310
- ed.editing,
9311
- ed.saveOn,
9312
- ed.tabSize,
9313
- ed.wordWrap,
9314
- ed.matchBrackets,
9315
- ed.roundedSelection,
9316
- ed.autoSurround
9317
- ]
9318
- );
9319
- return /* @__PURE__ */ jsxRuntimeExports.jsx(EditorEnvironmentProvider, { value, children });
9320
- }
9321
10766
  const RELEASE_AFTER_MS = 5 * 6e4;
9322
10767
  let views = 0;
9323
10768
  let held = false;
@@ -9342,7 +10787,7 @@ const subscribe = (listener) => {
9342
10787
  listeners.add(listener);
9343
10788
  return () => void listeners.delete(listener);
9344
10789
  };
9345
- const EditorWorkerPool = reactExports.lazy(() => __vitePreload(() => import("./EditorWorkers-Bhv2OJRb.js"), true ? __vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11]) : void 0, import.meta.url).then((m) => ({ default: m.EditorWorkerPool })));
10790
+ const EditorWorkerPool = reactExports.lazy(() => __vitePreload(() => import("./EditorWorkers-Durn1REy.js"), true ? __vite__mapDeps([2,1,3,4,5,6,7,8,9]) : void 0, import.meta.url).then((m) => ({ default: m.EditorWorkerPool })));
9346
10791
  function EditorWorkersHold() {
9347
10792
  const on2 = reactExports.useSyncExternalStore(
9348
10793
  subscribe,
@@ -9358,10 +10803,21 @@ function ThemedShell({ children }) {
9358
10803
  const activeSession = activeSessionId ? sessions.find((session) => session.id === activeSessionId) : null;
9359
10804
  const cwd = activeSession?.cwd ?? defaultFolder;
9360
10805
  const extensionKey = settings.enabledExtensions?.join("") ?? "*";
9361
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AppearanceProvider, { host: appearanceHost, legacyThemeId: settings.theme, folder: cwd, themesKey: extensionKey, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeHighlight, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(EditorEnvironmentRoot, { children: [
9362
- /* @__PURE__ */ jsxRuntimeExports.jsx(EditorWorkersHold, {}),
9363
- children
9364
- ] }) }) });
10806
+ const extensions = useElectronExtensionsHost();
10807
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
10808
+ AppearanceProvider,
10809
+ {
10810
+ host: appearanceHost,
10811
+ legacyThemeId: settings.theme,
10812
+ folder: cwd,
10813
+ themesKey: extensionKey,
10814
+ ...extensions ? { extensions } : {},
10815
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeHighlight, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(EditorEnvironmentRoot, { children: [
10816
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EditorWorkersHold, {}),
10817
+ children
10818
+ ] }) })
10819
+ }
10820
+ );
9365
10821
  }
9366
10822
  const MAX_KEYS = 500;
9367
10823
  const RENDERING_FLOOR_MS = 16;
@@ -9450,11 +10906,13 @@ configureErrorReports({
9450
10906
  showStacks: false
9451
10907
  });
9452
10908
  installRendererErrorHandlers();
10909
+ watchRuntimeIcons({ loadPhosphor: () => __vitePreload(() => import("./icons-D67TrEZV.js"), true ? [] : void 0, import.meta.url).then((m) => crispPhosphor(m.default)) });
9453
10910
  installPerf();
9454
10911
  const appearanceFirstRun = appearanceHost.prefs.isFirstRun();
9455
10912
  startRunMeter();
9456
10913
  sessionActivity.start();
9457
10914
  sessionCompaction.start();
10915
+ runEstimates.start();
9458
10916
  sessionBadges.start();
9459
10917
  ReactDOM.createRoot(document.getElementById("root"), {
9460
10918
  // An `ErrorBoundary` logs what it caught itself, with its region; React's default would log it a second time.
@@ -9463,7 +10921,7 @@ ReactDOM.createRoot(document.getElementById("root"), {
9463
10921
  reportRendererError(error, { source: "caught by an error boundary", componentStack: info.componentStack });
9464
10922
  }
9465
10923
  }).render(
9466
- /* @__PURE__ */ jsxRuntimeExports.jsx(React.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10924
+ /* @__PURE__ */ jsxRuntimeExports.jsx(React$1.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
9467
10925
  ErrorBoundary,
9468
10926
  {
9469
10927
  region: "Zidane",