zidane-gui 9.0.3 → 9.1.1
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.
- package/README.md +1 -1
- package/out/main/chunks/{dev-extension-D5os9z0A.js → dev-extension-CjcEOYly.js} +10 -9
- package/out/main/chunks/extension-watch-Bk_X4gTf.js +93 -0
- package/out/main/chunks/{history-pager-DUFgTrih.js → history-pager-B5iwhWqn.js} +44 -7
- package/out/main/chunks/idle-collect-ZgTY7fw2.js +33 -0
- package/out/main/chunks/{remote-hosts-DlvE2ELX.js → remote-hosts-DmiOiwKi.js} +41 -1
- package/out/main/chunks/{session-search-sql-BrNTuwjH.js → session-search-sql-BaBnjEgm.js} +4 -4
- package/out/main/chunks/{tool-results-sql-C0MqWcQc.js → tool-results-sql-CVleIS51.js} +1 -1
- package/out/main/chunks/transcript-sql-DfsO-a4Q.js +27 -0
- package/out/main/extension-worker.js +52 -0
- package/out/main/git-watch-worker.js +21 -0
- package/out/main/history-worker.js +6 -3
- package/out/main/index.js +7614 -4263
- package/out/main/session-search-worker.js +18 -13
- package/out/main/tool-results-worker.js +18 -13
- package/out/main/update-worker.js +6 -0
- package/out/main/usage-worker.js +4 -1
- package/out/preload/index.mjs +49 -6
- package/out/renderer/assets/2CHDFZHC-B7OS2WPy.js +76 -0
- package/out/renderer/assets/43YPWK3Q-C1KxyhBe.js +297 -0
- package/out/renderer/assets/45MVAN6X-uedsCyvs.js +227 -0
- package/out/renderer/assets/46GJKBLZ-DqRDtmyU.js +362 -0
- package/out/renderer/assets/5THPTBWS-2mBFupjU.js +21 -0
- package/out/renderer/assets/63WH7YNF-E23uJkxY.js +1519 -0
- package/out/renderer/assets/6DDU7VKX-BnYMT-fZ.js +139 -0
- package/out/renderer/assets/7WLXJQOR-C8MM6Bra.js +23 -0
- package/out/renderer/assets/CLQLV5VT-BsAy1F0L.js +1159 -0
- package/out/renderer/assets/CUSPXG5M-BndthcFo.js +233 -0
- package/out/renderer/assets/{CodeEditor-in2F3Rz-.js → CodeEditor-Bc2yVqNr.js} +404 -744
- package/out/renderer/assets/{ComposerEditor-DzKoxH6Z.js → ComposerEditor-B4wmjkXE.js} +6 -7
- package/out/renderer/assets/D3L7O4X2-LfFKkl0g.js +194 -0
- package/out/renderer/assets/D5TW5CPZ-BUXfpU2q.js +21 -0
- package/out/renderer/assets/DKTLEL5E-Dj3316cp.js +42 -0
- package/out/renderer/assets/{DiffsTab-Ceh4E5wW.js → DiffsTab-BHaJc7Ve.js} +43 -26
- package/out/renderer/assets/EGADTWYV-giCCF2cw.js +292 -0
- package/out/renderer/assets/EOJSJZXM-B9xc3U2A.js +1137 -0
- package/out/renderer/assets/{EditorWorkers-Bhv2OJRb.js → EditorWorkers-DABG5YG9.js} +9 -11
- package/out/renderer/assets/FTXIJQGB-BX14b7pN.js +13 -0
- package/out/renderer/assets/{FileIcon-CYgGSQ59.js → FileIcon-acads6Ac.js} +1 -1
- package/out/renderer/assets/{FilesTab-DESQMqGK.js → FilesTab-CyWw9vW2.js} +70 -28
- package/out/renderer/assets/G2OEIG6X-hZmo0wrY.js +519 -0
- package/out/renderer/assets/G3MDBVQH-qZ3yfAIw.js +25 -0
- package/out/renderer/assets/GXJ2T77W-Dx1MA_On.js +445 -0
- package/out/renderer/assets/HX3UMAK7-DcJt6NaE.js +177 -0
- package/out/renderer/assets/IU7WZTP6-BZMu2vL3.js +137 -0
- package/out/renderer/assets/J5J2NR2G-CbQLnnZq.js +673 -0
- package/out/renderer/assets/JRCWTJEL-xEOyWDIN.js +419 -0
- package/out/renderer/assets/KHUP5TOH-032p46g-.js +359 -0
- package/out/renderer/assets/L74FQTH5-CQ_54hNm.js +994 -0
- package/out/renderer/assets/LAV4ZXOS-DvhVMhLR.js +968 -0
- package/out/renderer/assets/LBIZYCRR-CMaDdulz.js +715 -0
- package/out/renderer/assets/LFFXNLRS-BjbqzBYN.js +377 -0
- package/out/renderer/assets/LLLWOAQD-B2zZRpRf.js +409 -0
- package/out/renderer/assets/LTYQZ5U5-DzI-7yJW.js +1223 -0
- package/out/renderer/assets/NDSCUZ25-C9oT6c6G.js +83 -0
- package/out/renderer/assets/NMN3IKWL-9IsXehWp.js +1042 -0
- package/out/renderer/assets/NMUA3R2D-B2ZuyfXA.js +1080 -0
- package/out/renderer/assets/NY5A6PPW-BzmvsXmE.js +523 -0
- package/out/renderer/assets/OHJ2EJXK-BEkFEoxu.js +85 -0
- package/out/renderer/assets/OU2GIT2H-DZQl_5qv.js +32 -0
- package/out/renderer/assets/PDMLSE6I-C3FMl6Ej.js +15 -0
- package/out/renderer/assets/PJ7X32S5-BQ3aTkUy.js +188 -0
- package/out/renderer/assets/RLLQ44NJ-Dq15CCQ6.js +248 -0
- package/out/renderer/assets/RVARI57O-DMrXgtoB.js +10 -0
- package/out/renderer/assets/S6DWMCK5-KeQNStMI.js +817 -0
- package/out/renderer/assets/STIOTUT7-ZnewWXB7.js +509 -0
- package/out/renderer/assets/SXSLPWUD-VIPmiOfk.js +120 -0
- package/out/renderer/assets/TR4WJQGX-CQ3dPMLJ.js +25 -0
- package/out/renderer/assets/UWRPUF3N-CtgKKvKe.js +1276 -0
- package/out/renderer/assets/VSWIZJ7B-BN-hZ_G_.js +205 -0
- package/out/renderer/assets/WM7NR6YK-CghasXna.js +193 -0
- package/out/renderer/assets/WXKV2YEK-C8qjO_OQ.js +499 -0
- package/out/renderer/assets/XLHPVVFU-CoRVO17g.js +56 -0
- package/out/renderer/assets/YNX532HU-DhZCm9iK.js +119 -0
- package/out/renderer/assets/YUPSMAUO-Brx2G_oh.js +39 -0
- package/out/renderer/assets/ZFRCZTLK-Cs8fJIgy.js +150 -0
- package/out/renderer/assets/ZZDR4CN3-DcTVOpcO.js +122 -0
- package/out/renderer/assets/andromeeda-Bx1G2cLE.js +293 -0
- package/out/renderer/assets/andromeeda-vBqMIOkk.js +293 -0
- package/out/renderer/assets/aurora-x-Cm7-xw-C.js +243 -0
- package/out/renderer/assets/aurora-x-DPl7s7lw.js +243 -0
- package/out/renderer/assets/ayu-dark-CwZzE4zG.js +207 -0
- package/out/renderer/assets/ayu-dark-DkHc-GR-.js +207 -0
- package/out/renderer/assets/ayu-light-D8NJUeg2.js +207 -0
- package/out/renderer/assets/ayu-light-DNVhSCsl.js +207 -0
- package/out/renderer/assets/ayu-mirage-C-lSBwzI.js +207 -0
- package/out/renderer/assets/ayu-mirage-JE49iZ2H.js +207 -0
- package/out/renderer/assets/catppuccin-frappe-DU1nAiyx.js +414 -0
- package/out/renderer/assets/catppuccin-frappe-DX6Q-ciL.js +414 -0
- package/out/renderer/assets/catppuccin-latte-CO9onEOF.js +414 -0
- package/out/renderer/assets/catppuccin-latte-CkSyOFfG.js +414 -0
- package/out/renderer/assets/catppuccin-macchiato-OyZDjojj.js +414 -0
- package/out/renderer/assets/catppuccin-macchiato-WINjU_Dw.js +414 -0
- package/out/renderer/assets/catppuccin-mocha-0z8-eFg0.js +414 -0
- package/out/renderer/assets/catppuccin-mocha-DRTSTdRR.js +414 -0
- package/out/renderer/assets/core-COuvbqNs.js +5186 -0
- package/out/renderer/assets/{highlight.worker-gURcNJD7.js → core-Drnj1qQL.js} +404 -4454
- package/out/renderer/assets/{core-xOIU6ifr.js → core-Z_paRVMb.js} +3208 -1946
- package/out/renderer/assets/dark-plus-BaggkchT.js +241 -0
- package/out/renderer/assets/dark-plus-Conw9IRY.js +241 -0
- package/out/renderer/assets/default-CzLFidVE.js +1890 -0
- package/out/renderer/assets/dracula-BKSZoV-6.js +227 -0
- package/out/renderer/assets/dracula-BpiXsqbq.js +227 -0
- package/out/renderer/assets/dracula-soft-BF0b4PXf.js +169 -0
- package/out/renderer/assets/dracula-soft-DIWOT7Wr.js +169 -0
- package/out/renderer/assets/engine-javascript-CtTomO8o.js +3238 -0
- package/out/renderer/assets/engine-javascript-DUvVq6Hk.js +3223 -0
- package/out/renderer/assets/engine-oniguruma-DKBWYAaE.js +482 -0
- package/out/renderer/assets/engine-oniguruma-mZf4aRKS.js +482 -0
- package/out/renderer/assets/everforest-dark-B3n4qCUZ.js +181 -0
- package/out/renderer/assets/everforest-dark-BXgth4bF.js +181 -0
- package/out/renderer/assets/everforest-light-BhaIwhYu.js +181 -0
- package/out/renderer/assets/everforest-light-cbpcbx0E.js +181 -0
- package/out/renderer/assets/{file-tabs-Cozt9Sho.js → file-tabs-BCf1cAWp.js} +10 -12
- package/out/renderer/assets/{ghostty-web-BTHoKwMc.js → ghostty-web-CdNv377h.js} +3 -1
- package/out/renderer/assets/github-dark-BESFF5XO.js +234 -0
- package/out/renderer/assets/github-dark-DNCSzN6m.js +234 -0
- package/out/renderer/assets/github-dark-default-DgFmzzcd.js +168 -0
- package/out/renderer/assets/github-dark-default-ffmDUf0z.js +168 -0
- package/out/renderer/assets/github-dark-dimmed-CLKTYZCg.js +225 -0
- package/out/renderer/assets/github-dark-dimmed-s1SLsKJt.js +225 -0
- package/out/renderer/assets/github-dark-high-contrast-CXehgwDU.js +225 -0
- package/out/renderer/assets/github-dark-high-contrast-KLlCEr3k.js +225 -0
- package/out/renderer/assets/github-light-U3PkvbB_.js +234 -0
- package/out/renderer/assets/github-light-default-BPzGUBgG.js +225 -0
- package/out/renderer/assets/github-light-default-xMLgS_bN.js +225 -0
- package/out/renderer/assets/github-light-high-contrast-C8D72_o0.js +225 -0
- package/out/renderer/assets/github-light-high-contrast-DQhuIFi9.js +225 -0
- package/out/renderer/assets/github-light-jtm9FPHO.js +234 -0
- package/out/renderer/assets/gruvbox-dark-hard-BAboCHnq.js +214 -0
- package/out/renderer/assets/gruvbox-dark-hard-woZR1aVf.js +214 -0
- package/out/renderer/assets/gruvbox-dark-medium-BsoEOmFF.js +214 -0
- package/out/renderer/assets/gruvbox-dark-medium-CNo7daJC.js +214 -0
- package/out/renderer/assets/gruvbox-dark-soft-CaJ_lf0b.js +214 -0
- package/out/renderer/assets/gruvbox-dark-soft-Cg271WAX.js +214 -0
- package/out/renderer/assets/gruvbox-light-hard-CEjA0x_J.js +214 -0
- package/out/renderer/assets/gruvbox-light-hard-D8Ufxp8E.js +214 -0
- package/out/renderer/assets/gruvbox-light-medium-BCS-MX7u.js +214 -0
- package/out/renderer/assets/gruvbox-light-medium-DZkNZdeM.js +214 -0
- package/out/renderer/assets/gruvbox-light-soft-CRdK2Ssn.js +214 -0
- package/out/renderer/assets/gruvbox-light-soft-DEEl98i-.js +214 -0
- package/out/renderer/assets/hastToHtml-AUrFnNH_.js +123 -0
- package/out/renderer/assets/highlight.worker-BYB12Fvh.js +1624 -0
- package/out/renderer/assets/highlights-Cjdp9LIq.js +292 -0
- package/out/renderer/assets/highlights-CpZm9DAR-DaBE50nC.js +2188 -0
- package/out/renderer/assets/highlights-DaYW35iB.js +313 -0
- package/out/renderer/assets/horizon-B492K9Ky.js +165 -0
- package/out/renderer/assets/horizon-DAZuC-xh.js +165 -0
- package/out/renderer/assets/horizon-bright-D2Sfzu7E.js +165 -0
- package/out/renderer/assets/horizon-bright-tGFWGsRc.js +165 -0
- package/out/renderer/assets/houston-BuwDhoUX.js +373 -0
- package/out/renderer/assets/houston-Cp9zzZds.js +373 -0
- package/out/renderer/assets/index-DhpOdP7M.js +882 -0
- package/out/renderer/assets/{index-DkE-xvCG.js → index-_dhRO6Oc.js} +1823 -384
- package/out/renderer/assets/{index-DrLLItLS.css → index-fNK5AY6Q.css} +202 -42
- package/out/renderer/assets/kanagawa-dragon-6NLBJhOz.js +229 -0
- package/out/renderer/assets/kanagawa-dragon-BF7rCHRT.js +229 -0
- package/out/renderer/assets/kanagawa-lotus-Cj8RDQcT.js +229 -0
- package/out/renderer/assets/kanagawa-lotus-uV7FMPcj.js +229 -0
- package/out/renderer/assets/kanagawa-wave-0rvDP1ei.js +229 -0
- package/out/renderer/assets/kanagawa-wave-B6IVm0GO.js +229 -0
- package/out/renderer/assets/{kit-BUt8oFlT.js → kit-E8-H6M0V.js} +45590 -39890
- package/out/renderer/assets/langs-BDUDFyts.js +1333 -0
- package/out/renderer/assets/langs-BtXnoosO.js +1331 -0
- package/out/renderer/assets/laserwave-DXWE1WnK.js +166 -0
- package/out/renderer/assets/laserwave-JLRBtymH.js +166 -0
- package/out/renderer/assets/lazy-DQmrNfMK.js +1188 -0
- package/out/renderer/assets/light-plus-DU2oMqtU.js +244 -0
- package/out/renderer/assets/light-plus-D_GZIzn-.js +244 -0
- package/out/renderer/assets/loader-byWkNl6P.js +83 -0
- package/out/renderer/assets/loader-q6EC19QI.js +80 -0
- package/out/renderer/assets/material-theme-C0rHRk_7.js +171 -0
- package/out/renderer/assets/material-theme-CKzpgSIj.js +171 -0
- package/out/renderer/assets/material-theme-darker-LxtgP-nI.js +171 -0
- package/out/renderer/assets/material-theme-darker-q1PJSGwC.js +171 -0
- package/out/renderer/assets/material-theme-lighter-Bo7q33GI.js +171 -0
- package/out/renderer/assets/material-theme-lighter-DIrXq_cm.js +171 -0
- package/out/renderer/assets/material-theme-ocean-DBoGA257.js +171 -0
- package/out/renderer/assets/material-theme-ocean-DKw0PiZ1.js +171 -0
- package/out/renderer/assets/material-theme-palenight-C6KqY_uf.js +171 -0
- package/out/renderer/assets/material-theme-palenight-DoLm5E7H.js +171 -0
- package/out/renderer/assets/min-dark-C29HEm34.js +166 -0
- package/out/renderer/assets/min-dark-C5zOB6s9.js +166 -0
- package/out/renderer/assets/min-light-BDAdB2zx.js +166 -0
- package/out/renderer/assets/min-light-CCfylF7u.js +166 -0
- package/out/renderer/assets/monokai-CgbJVDnk.js +246 -0
- package/out/renderer/assets/monokai-hi1UnAdE.js +246 -0
- package/out/renderer/assets/night-owl-Cy8ZrWil.js +238 -0
- package/out/renderer/assets/night-owl-Pfm14M0L.js +238 -0
- package/out/renderer/assets/night-owl-light-Cr6ug2dl.js +237 -0
- package/out/renderer/assets/night-owl-light-UewpB7JV.js +237 -0
- package/out/renderer/assets/nord-C68LX7oy.js +200 -0
- package/out/renderer/assets/nord-D68iK8nx.js +200 -0
- package/out/renderer/assets/one-dark-pro-DSih0ZZj.js +196 -0
- package/out/renderer/assets/one-dark-pro-DyTT0T_G.js +196 -0
- package/out/renderer/assets/one-light--fEa3idW.js +232 -0
- package/out/renderer/assets/one-light-BzGf0rQc.js +232 -0
- package/out/renderer/assets/{patch-parse.worker-BAW1QWyk.js → patch-parse.worker-siqPY9wG.js} +24 -4
- package/out/renderer/assets/pierre-dark-1Xh1-lMo.js +4 -0
- package/out/renderer/assets/pierre-dark-7z_hCG7W.js +364 -0
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-DjiH32kw.js +364 -0
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-GW6g2K_K.js +364 -0
- package/out/renderer/assets/pierre-dark-protanopia-deuteranopia-LDfpPKjm.js +4 -0
- package/out/renderer/assets/pierre-dark-soft-1iBHdNO0.js +364 -0
- package/out/renderer/assets/pierre-dark-soft-C_k_gt55.js +4 -0
- package/out/renderer/assets/pierre-dark-soft-D5-n1AeJ.js +364 -0
- package/out/renderer/assets/pierre-dark-tritanopia-CeWJyYfV.js +4 -0
- package/out/renderer/assets/pierre-dark-tritanopia-ClMvjOGO.js +364 -0
- package/out/renderer/assets/pierre-dark-tritanopia-D9kXXcwP.js +364 -0
- package/out/renderer/assets/pierre-dark-vibrant-6Oqz1PbM.js +4 -0
- package/out/renderer/assets/pierre-dark-vibrant-C8yH51pK.js +364 -0
- package/out/renderer/assets/pierre-dark-vibrant-D_7rJXbX.js +364 -0
- package/out/renderer/assets/pierre-dark-yHUcpElV.js +364 -0
- package/out/renderer/assets/pierre-light-BIebL0yQ.js +4 -0
- package/out/renderer/assets/pierre-light-C34x-mcs.js +364 -0
- package/out/renderer/assets/pierre-light-C9v4GAHb.js +364 -0
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-BufD2-1n.js +4 -0
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-DUrvpW2C.js +364 -0
- package/out/renderer/assets/pierre-light-protanopia-deuteranopia-VwXWNPo2.js +364 -0
- package/out/renderer/assets/pierre-light-soft-BmDnpPlM.js +364 -0
- package/out/renderer/assets/pierre-light-soft-Cd6v49hf.js +4 -0
- package/out/renderer/assets/pierre-light-soft-DqFh0kZA.js +364 -0
- package/out/renderer/assets/pierre-light-tritanopia-BVCfgdSF.js +364 -0
- package/out/renderer/assets/pierre-light-tritanopia-RkA2q6k9.js +364 -0
- package/out/renderer/assets/pierre-light-tritanopia-VrCUn-Lh.js +4 -0
- package/out/renderer/assets/pierre-light-vibrant-C5BaqWq3.js +364 -0
- package/out/renderer/assets/pierre-light-vibrant-CCrCMYrB.js +364 -0
- package/out/renderer/assets/pierre-light-vibrant-ClZHsQXl.js +4 -0
- package/out/renderer/assets/{pierre-theme-Bj5EAt1L.js → pierre-theme-CsyO3esE.js} +1022 -913
- package/out/renderer/assets/plastic-7t7HzasC.js +207 -0
- package/out/renderer/assets/plastic-EgWoj0TX.js +207 -0
- package/out/renderer/assets/poimandres-Clm3QHf_.js +186 -0
- package/out/renderer/assets/poimandres-_9ZL-zjP.js +186 -0
- package/out/renderer/assets/red-BGLMOAQA.js +240 -0
- package/out/renderer/assets/red-C7WxuK4s.js +240 -0
- package/out/renderer/assets/rose-pine-CSYOOLQH.js +200 -0
- package/out/renderer/assets/rose-pine-DQTixAK4.js +200 -0
- package/out/renderer/assets/rose-pine-dawn-BsExWFpO.js +200 -0
- package/out/renderer/assets/rose-pine-dawn-DtnCKB3V.js +200 -0
- package/out/renderer/assets/rose-pine-moon-CIVzFPCR.js +200 -0
- package/out/renderer/assets/rose-pine-moon-DUVYttUm.js +200 -0
- package/out/renderer/assets/shiki-Ci4cdHsM-C6d-uTVf.js +681 -0
- package/out/renderer/assets/shiki-DxXti3Bm.js +651 -0
- package/out/renderer/assets/slack-dark-DqfBLzDN.js +156 -0
- package/out/renderer/assets/slack-dark-PDVLPqBV.js +156 -0
- package/out/renderer/assets/slack-ochin-BXb20b9s.js +167 -0
- package/out/renderer/assets/slack-ochin-Bkl8Akj-.js +167 -0
- package/out/renderer/assets/snazzy-light-B-XgRQqH.js +169 -0
- package/out/renderer/assets/snazzy-light-B_Pnr_t3.js +169 -0
- package/out/renderer/assets/solarized-dark-BExlwCgF.js +256 -0
- package/out/renderer/assets/solarized-dark-BWOkBqBk.js +256 -0
- package/out/renderer/assets/solarized-light-B0LC-9ef.js +256 -0
- package/out/renderer/assets/solarized-light-B7xKmc3j.js +256 -0
- package/out/renderer/assets/stream-tokenizer-DK9xp5M5-BkzgPytU.js +2641 -0
- package/out/renderer/assets/stream-tokenizer-sqhinrU5.js +131 -0
- package/out/renderer/assets/synthwave-84-Bz5LYLQI.js +766 -0
- package/out/renderer/assets/synthwave-84-DnB997dV.js +766 -0
- package/out/renderer/assets/themes-DGY5d--g.js +323 -0
- package/out/renderer/assets/themes-KOxcu5sY.js +322 -0
- package/out/renderer/assets/tokyo-night-BFQDXQF9.js +343 -0
- package/out/renderer/assets/tokyo-night-BKV2xFQO.js +343 -0
- package/out/renderer/assets/{useDetachCleanup-Bb7k1ePf.js → useDetachCleanup-DYbCqwX-.js} +95 -51
- package/out/renderer/assets/{useFolderChanges-B4X4n6NV.js → useFolderChanges-Y0OqX_nG.js} +406 -242
- package/out/renderer/assets/utils-BcG7Lqcy.js +90 -0
- package/out/renderer/assets/{vendor-BvslLX9q.js → vendor-BpwX-s_O.js} +16835 -16799
- package/out/renderer/assets/{vendor-editor-Bx3dRdBD.js → vendor-editor-Cx3SvGyZ.js} +2 -2
- package/out/renderer/assets/{vendor-motion-BLeNAEjH.js → vendor-motion-CD5Og8pC.js} +3 -3
- package/out/renderer/assets/{vendor-react-DltKc0Ts.js → vendor-react-bPTwWURR.js} +28 -12
- package/out/renderer/assets/vesper-BVtJs6jF.js +173 -0
- package/out/renderer/assets/vesper-BXSaHQeX.js +173 -0
- package/out/renderer/assets/vitesse-black-Bk4nGSr_.js +388 -0
- package/out/renderer/assets/vitesse-black-DjBh7jMr.js +388 -0
- package/out/renderer/assets/vitesse-dark-BSeRY0TR.js +388 -0
- package/out/renderer/assets/vitesse-dark-Czy_Ejt3.js +388 -0
- package/out/renderer/assets/vitesse-light-BpMpGmeY.js +388 -0
- package/out/renderer/assets/vitesse-light-Cv09MZGR.js +388 -0
- package/out/renderer/assets/worker-CswOd5_T.js +2367 -0
- package/out/renderer/index.html +8 -9
- package/package.json +13 -6
- package/out/main/chunks/transcript-sql-DbZ-a5wb.js +0 -43
- package/out/renderer/assets/index-DogoEzwx.js +0 -10868
- package/out/renderer/assets/vendor-shiki-ba8IDo5s.js +0 -459
- 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-
|
|
2
|
-
import { r as reactExports, j as jsxRuntimeExports, e as ReactDOM, c as React } from "./vendor-react-
|
|
3
|
-
import "./vendor-
|
|
4
|
-
import {
|
|
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
|
|
6
|
-
import
|
|
7
|
-
import "./vendor-
|
|
8
|
-
import "./vendor-editor-Bx3dRdBD.js";
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./file-tabs-BCf1cAWp.js","./vendor-react-bPTwWURR.js","./EditorWorkers-DABG5YG9.js","./pierre-theme-CsyO3esE.js","./core-Z_paRVMb.js","./vendor-BpwX-s_O.js","./vendor-D_E2rLzO.css","./kit-E8-H6M0V.js","./vendor-motion-CD5Og8pC.js","./vendor-editor-Cx3SvGyZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
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";
|
|
3
|
+
import "./vendor-BpwX-s_O.js";
|
|
4
|
+
import { cg as LOCAL_HOST_KEY, dC as sessionKey$1, ca as parseSessionKey$1, dD as LOCAL_HOST_NAME, k as DEFAULT_SETTINGS, dE as ARTIFACT_BADGES_MAX, dF as spacesEnabled, dG as ARTIFACTS_PANEL_ID, dH as buildPanelCatalog, dI as MEDIA_BY_EXTENSION, dJ as USAGE_BLOCK_ID, b9 as CONNECTORS, ba as connectorInstalled, aP as nativeExtensionByName, dK as nativeExtensionSource, d2 as connectorById, dL as connectorServerConfig, dM as machineWaiting, dN as SIDE_PANEL_ID, dO as normalizeBrowserUrl, aH as INBOX_PANEL_ID, _ as __vitePreload, dP as BROWSER_PANEL_ID, aG as QUEUE_PANEL_ID, aI as TODOS_PANEL_ID, cB as TERMINAL_PANEL_ID, W as FILES_PANEL_ID, V as DIFFS_PANEL_ID, aq as resolveSessionSpace, aj as parseMachineKind, c9 as accentColor, br as DEFAULT_MODEL_PICK, dQ as decisionsEnabled, dR as countNeighbors, dS as selectableTurnIds, G as GITHUB_PULL_PROVIDER_ID, F as GITHUB_ISSUE_PROVIDER_ID, H as githubRefKey, cf as parseRepoInput } from "./core-Z_paRVMb.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 ChatProvider, fY as useHasFocusedComposer, fZ as hasFocusedComposer, d as pushComposerMention, f_ as OpenSessionContext, f$ as BadgeMenuProvider, g0 as createStorageRecents, g1 as PaletteProvider, g2 as WorkerWrapper, g3 as LabelsProvider, g4 as PromptHistoryProvider, g5 as SelectTurnProvider, g6 as KeybindingsProvider, g7 as GitProvider, g8 as SidebarHostProvider, g9 as useShikiTheme, T as useEditorPrefs, ga as CodeHighlightProvider, gb as CodeWrapProvider, gc as createCodeHighlighter, gd as WorkerWrapper$1, ge as AppearanceProvider, gf as EditorEnvironmentRoot, gg as configureErrorReports, gh as installRendererErrorHandlers, gi as reportRendererError, G as buttonClass, gj as readMotionMs } from "./kit-E8-H6M0V.js";
|
|
6
|
+
import "./vendor-motion-CD5Og8pC.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$
|
|
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$
|
|
105
|
+
return useResource(store$2, spec);
|
|
107
106
|
}
|
|
108
107
|
function peekIpcResource(spec) {
|
|
109
|
-
return store$
|
|
108
|
+
return store$2.peek(spec);
|
|
110
109
|
}
|
|
111
110
|
function subscribeIpcResource(spec, onChange) {
|
|
112
|
-
return store$
|
|
111
|
+
return store$2.subscribe(spec, onChange);
|
|
113
112
|
}
|
|
114
113
|
function subscribeInvalidation(options, listener) {
|
|
115
|
-
return store$
|
|
114
|
+
return store$2.subscribeInvalidation(options, listener);
|
|
116
115
|
}
|
|
117
116
|
function fetchIpcResource(spec) {
|
|
118
|
-
return store$
|
|
117
|
+
return store$2.fetch(spec);
|
|
119
118
|
}
|
|
120
119
|
function readableIpcResource(spec) {
|
|
121
|
-
return readableResource(store$
|
|
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,
|
|
1008
|
+
install: async (cwd, request2, onProgress) => {
|
|
1010
1009
|
const result = await withProgress(
|
|
1011
1010
|
onProgress,
|
|
1012
1011
|
(requestId) => api.skills.install(cwd, {
|
|
1013
|
-
source:
|
|
1014
|
-
scope:
|
|
1015
|
-
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,
|
|
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: (
|
|
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(
|
|
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
|
-
|
|
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) =>
|
|
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 =
|
|
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
|
|
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 !==
|
|
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
|
|
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:
|
|
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
|
-
|
|
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
|
|
2462
|
-
const
|
|
2463
|
-
const
|
|
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
|
|
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: !
|
|
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$
|
|
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$
|
|
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$
|
|
2636
|
-
return () => void listeners$
|
|
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(
|
|
@@ -3013,7 +3086,7 @@ const Timeline = reactExports.memo(({ events, isStreaming, sessionId }) => {
|
|
|
3013
3086
|
}),
|
|
3014
3087
|
[sessionId, openSession, modelName, openTarget, scopeCwd]
|
|
3015
3088
|
);
|
|
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(
|
|
3089
|
+
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
3090
|
Transcript,
|
|
3018
3091
|
{
|
|
3019
3092
|
events,
|
|
@@ -3025,7 +3098,7 @@ const Timeline = reactExports.memo(({ events, isStreaming, sessionId }) => {
|
|
|
3025
3098
|
runStatus,
|
|
3026
3099
|
children: turnMenu.menu
|
|
3027
3100
|
}
|
|
3028
|
-
) }) }) }) });
|
|
3101
|
+
) }) }) }) }) });
|
|
3029
3102
|
});
|
|
3030
3103
|
function tokenizeQuery(query) {
|
|
3031
3104
|
const tokens = [];
|
|
@@ -3089,6 +3162,909 @@ function TranscriptSearch({
|
|
|
3089
3162
|
const events = useSessionEvents(sessionId);
|
|
3090
3163
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptSearch$1, { ...props, revision: events, terms: tokenizeQuery });
|
|
3091
3164
|
}
|
|
3165
|
+
const usePresenceMap = usePresenceMap$1;
|
|
3166
|
+
const useSessionPresence = useSessionPresence$1;
|
|
3167
|
+
function usePending(sessionId) {
|
|
3168
|
+
const approval = useSessionApprovalHead(sessionId);
|
|
3169
|
+
const interaction = useInteractionHead(sessionId);
|
|
3170
|
+
return Boolean(approval) || Boolean(interaction);
|
|
3171
|
+
}
|
|
3172
|
+
const sidebarLive = createSidebarLive({
|
|
3173
|
+
useRunning: (sessionId) => useSessionRunning(sessionId),
|
|
3174
|
+
useRunElapsedSec: (sessionId, live, intervalMs) => useRunElapsedSec(sessionId, live, intervalMs),
|
|
3175
|
+
usePending,
|
|
3176
|
+
useNotification: (sessionId) => useSessionNotification(sessionId),
|
|
3177
|
+
usePresence: (sessionId) => useSessionPresence(sessionId),
|
|
3178
|
+
useHost: (hostId) => useHosts().hostById(hostId),
|
|
3179
|
+
activity: sessionActivity,
|
|
3180
|
+
estimates: runEstimates,
|
|
3181
|
+
badges: sessionBadges,
|
|
3182
|
+
openBadge: (sessionId, panel, focus) => openSessionPanel(sessionId, panel, focus)
|
|
3183
|
+
});
|
|
3184
|
+
const useSessionDotState = sidebarLive.useSessionDotState;
|
|
3185
|
+
const SessionStatusDot$1 = sidebarLive.SessionStatusDot;
|
|
3186
|
+
const HOST_MODULE_PREFIX = "zidane-host:";
|
|
3187
|
+
const DESKTOP_HOST_MODULES = {
|
|
3188
|
+
react: React,
|
|
3189
|
+
"react/jsx-runtime": ReactJsxRuntime,
|
|
3190
|
+
// Bundled in production mode, so the dev runtime is never asked for; mapped to the same runtime if it is.
|
|
3191
|
+
"react/jsx-dev-runtime": ReactJsxRuntime,
|
|
3192
|
+
"react-dom": ReactDom,
|
|
3193
|
+
"react-dom/client": ReactDomClient,
|
|
3194
|
+
"zidane-ui/extensions": ZidaneUiExtensions,
|
|
3195
|
+
"zidane-ui/extensions/kit": ZidaneUiExtensionsKit
|
|
3196
|
+
};
|
|
3197
|
+
const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
3198
|
+
const RESERVED$1 = /* @__PURE__ */ new Set([
|
|
3199
|
+
"default",
|
|
3200
|
+
"await",
|
|
3201
|
+
"enum",
|
|
3202
|
+
"implements",
|
|
3203
|
+
"interface",
|
|
3204
|
+
"package",
|
|
3205
|
+
"private",
|
|
3206
|
+
"protected",
|
|
3207
|
+
"public",
|
|
3208
|
+
"static",
|
|
3209
|
+
"yield"
|
|
3210
|
+
]);
|
|
3211
|
+
const GLOBAL_KEY = "__zidaneHostModules";
|
|
3212
|
+
function hostModuleShim(specifier, mod) {
|
|
3213
|
+
const names = Object.keys(mod).filter((name) => IDENTIFIER.test(name) && !RESERVED$1.has(name));
|
|
3214
|
+
const ref = `globalThis[${JSON.stringify(GLOBAL_KEY)}][${JSON.stringify(specifier)}]`;
|
|
3215
|
+
return [
|
|
3216
|
+
`const m = ${ref};`,
|
|
3217
|
+
`export default (m.default ?? m);`,
|
|
3218
|
+
...names.length > 0 ? [`export const { ${names.join(", ")} } = m;`] : []
|
|
3219
|
+
].join("\n");
|
|
3220
|
+
}
|
|
3221
|
+
function linkHostModules(code2, urlOf) {
|
|
3222
|
+
return code2.replace(
|
|
3223
|
+
/(["'])zidane-host:([^"']+)\1/g,
|
|
3224
|
+
(_match, quote, specifier) => `${quote}${urlOf(specifier)}${quote}`
|
|
3225
|
+
);
|
|
3226
|
+
}
|
|
3227
|
+
async function importFromBlob(source) {
|
|
3228
|
+
const url = URL.createObjectURL(new Blob([source], { type: "text/javascript" }));
|
|
3229
|
+
try {
|
|
3230
|
+
return await import(
|
|
3231
|
+
/* @vite-ignore */
|
|
3232
|
+
url
|
|
3233
|
+
);
|
|
3234
|
+
} finally {
|
|
3235
|
+
URL.revokeObjectURL(url);
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
function createExtensionModuleLoader(options) {
|
|
3239
|
+
const hostModules = options.hostModules ?? DESKTOP_HOST_MODULES;
|
|
3240
|
+
const importSource = options.importSource ?? importFromBlob;
|
|
3241
|
+
const shims = /* @__PURE__ */ new Map();
|
|
3242
|
+
const loaded = /* @__PURE__ */ new Map();
|
|
3243
|
+
globalThis[GLOBAL_KEY] = hostModules;
|
|
3244
|
+
const shimUrl = (specifier) => {
|
|
3245
|
+
const mod = hostModules[specifier];
|
|
3246
|
+
if (!mod)
|
|
3247
|
+
throw new Error(
|
|
3248
|
+
`"${specifier}" is not provided by the desktop app (it provides ${Object.keys(hostModules).join(", ")}).`
|
|
3249
|
+
);
|
|
3250
|
+
let url = shims.get(specifier);
|
|
3251
|
+
if (!url) {
|
|
3252
|
+
url = typeof URL.createObjectURL === "function" ? URL.createObjectURL(new Blob([hostModuleShim(specifier, mod)], { type: "text/javascript" })) : `${HOST_MODULE_PREFIX}${specifier}`;
|
|
3253
|
+
shims.set(specifier, url);
|
|
3254
|
+
}
|
|
3255
|
+
return url;
|
|
3256
|
+
};
|
|
3257
|
+
return async (extensionId) => {
|
|
3258
|
+
const cwd = options.folder();
|
|
3259
|
+
if (cwd === void 0) throw new Error("No folder is open: extension components have nothing to load from.");
|
|
3260
|
+
const result = await options.api.module(cwd, extensionId);
|
|
3261
|
+
if (!result.ok) throw new Error(result.message);
|
|
3262
|
+
const key2 = `${extensionId}\0${result.value.hash}`;
|
|
3263
|
+
let module = loaded.get(key2);
|
|
3264
|
+
if (!module) {
|
|
3265
|
+
module = importSource(linkHostModules(result.value.code, shimUrl));
|
|
3266
|
+
loaded.set(key2, module);
|
|
3267
|
+
module.catch(() => loaded.delete(key2));
|
|
3268
|
+
}
|
|
3269
|
+
return module;
|
|
3270
|
+
};
|
|
3271
|
+
}
|
|
3272
|
+
const EVERY_FOLDER = "*";
|
|
3273
|
+
const EXTENSION_WEBVIEW_SCHEME = "zg-extview";
|
|
3274
|
+
function webviewFileUrl(extensionId, cwd, file) {
|
|
3275
|
+
const path = file.split(/[\\/]+/).filter((s) => s && s !== ".").map(encodeURIComponent).join("/");
|
|
3276
|
+
return `${EXTENSION_WEBVIEW_SCHEME}://${encodeURIComponent(extensionId)}/${encodeURIComponent(cwd)}/${path}`;
|
|
3277
|
+
}
|
|
3278
|
+
const CATALOG_KINDS = [
|
|
3279
|
+
"tools",
|
|
3280
|
+
"agents",
|
|
3281
|
+
"subagents",
|
|
3282
|
+
"models",
|
|
3283
|
+
"providers",
|
|
3284
|
+
"mcp",
|
|
3285
|
+
"skills"
|
|
3286
|
+
];
|
|
3287
|
+
function connectionsOf(i) {
|
|
3288
|
+
const raw = i.connections ?? (i.connection ? [i.connection] : []);
|
|
3289
|
+
const defaultAccount = i.connection?.account ?? raw.find((c) => c.isDefault)?.account ?? raw[0]?.account;
|
|
3290
|
+
const connections = raw.map((c) => ({
|
|
3291
|
+
methodId: c.methodId,
|
|
3292
|
+
account: c.account || "default",
|
|
3293
|
+
...c.label ? { label: c.label } : {},
|
|
3294
|
+
...c.account === defaultAccount ? { isDefault: true } : {},
|
|
3295
|
+
connectedAt: c.connectedAt
|
|
3296
|
+
}));
|
|
3297
|
+
const connection = connections.find((c) => c.isDefault);
|
|
3298
|
+
return { ...connection ? { connection } : {}, ...connections.length > 0 ? { connections } : {} };
|
|
3299
|
+
}
|
|
3300
|
+
const empty = () => Object.fromEntries(EXTENSION_TOKENS.map((t) => [t, []]));
|
|
3301
|
+
function desktopWebviewSrc(webview, extension, cwd) {
|
|
3302
|
+
if ("file" in webview.src) return cwd ? webviewFileUrl(extension, cwd, webview.src.file) : null;
|
|
3303
|
+
return httpUrl(webview.src.url);
|
|
3304
|
+
}
|
|
3305
|
+
function httpUrl(raw) {
|
|
3306
|
+
try {
|
|
3307
|
+
const url = new URL(raw);
|
|
3308
|
+
return url.protocol === "https:" || url.protocol === "http:" ? url.href : null;
|
|
3309
|
+
} catch {
|
|
3310
|
+
return null;
|
|
3311
|
+
}
|
|
3312
|
+
}
|
|
3313
|
+
async function unwrap(call) {
|
|
3314
|
+
let result;
|
|
3315
|
+
try {
|
|
3316
|
+
result = await call;
|
|
3317
|
+
} catch {
|
|
3318
|
+
throw new ExtensionsHostError({ code: "unavailable" });
|
|
3319
|
+
}
|
|
3320
|
+
if (result.ok) return result.value;
|
|
3321
|
+
if (result.reason === "locked" || result.reason === "invalid")
|
|
3322
|
+
throw new ExtensionsHostError({ code: "refused", reason: result.reason, message: result.message });
|
|
3323
|
+
if (result.reason === "unavailable") throw new ExtensionsHostError({ code: "unavailable" });
|
|
3324
|
+
throw new ExtensionsHostError({ code: "failed", message: result.message });
|
|
3325
|
+
}
|
|
3326
|
+
function invokeRequest(id, args) {
|
|
3327
|
+
const a = args;
|
|
3328
|
+
switch (id) {
|
|
3329
|
+
case "panel.load":
|
|
3330
|
+
return { cwd: a.cwd, request: { op: "panel.load", panelId: a.panelId, ctx: a.context } };
|
|
3331
|
+
case "panel.action":
|
|
3332
|
+
return {
|
|
3333
|
+
cwd: a.cwd,
|
|
3334
|
+
request: {
|
|
3335
|
+
op: "panel.action",
|
|
3336
|
+
panelId: a.panelId,
|
|
3337
|
+
actionId: a.actionId,
|
|
3338
|
+
payload: a.payload,
|
|
3339
|
+
ctx: a.context
|
|
3340
|
+
}
|
|
3341
|
+
};
|
|
3342
|
+
case "reference.resolve":
|
|
3343
|
+
return { request: { op: "reference.resolve", providerId: a.providerId, key: a.key } };
|
|
3344
|
+
case "badge.menu":
|
|
3345
|
+
return { request: { op: "badge.menu", target: a.target } };
|
|
3346
|
+
case "badge.run":
|
|
3347
|
+
return {
|
|
3348
|
+
...typeof a.cwd === "string" ? { cwd: a.cwd } : {},
|
|
3349
|
+
request: {
|
|
3350
|
+
op: "badge.run",
|
|
3351
|
+
source: a.source,
|
|
3352
|
+
actionId: a.actionId,
|
|
3353
|
+
target: a.target,
|
|
3354
|
+
...typeof a.sessionId === "string" ? { sessionId: a.sessionId } : {}
|
|
3355
|
+
}
|
|
3356
|
+
};
|
|
3357
|
+
case "setting.action":
|
|
3358
|
+
return { request: { op: "setting.action", pageId: a.pageId, key: a.key } };
|
|
3359
|
+
case "setting.status":
|
|
3360
|
+
return { request: { op: "setting.status", pageId: a.pageId, key: a.key } };
|
|
3361
|
+
default:
|
|
3362
|
+
throw new ExtensionsHostError({ code: "unavailable" });
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
function effectOf(request2) {
|
|
3366
|
+
switch (request2.op) {
|
|
3367
|
+
case "panel":
|
|
3368
|
+
return {
|
|
3369
|
+
kind: "panel",
|
|
3370
|
+
action: request2.action,
|
|
3371
|
+
panelId: request2.panelId,
|
|
3372
|
+
...request2.sessionId ? { sessionId: request2.sessionId } : {},
|
|
3373
|
+
...request2.focus ? { focus: request2.focus } : {}
|
|
3374
|
+
};
|
|
3375
|
+
case "panelState":
|
|
3376
|
+
return { kind: "panel-state", ...request2.sessionId ? { sessionId: request2.sessionId } : {} };
|
|
3377
|
+
case "navigate":
|
|
3378
|
+
return { kind: "navigate", to: request2.to };
|
|
3379
|
+
case "composer":
|
|
3380
|
+
return {
|
|
3381
|
+
kind: "composer",
|
|
3382
|
+
op: request2.edit,
|
|
3383
|
+
...request2.sessionId ? { sessionId: request2.sessionId } : {}
|
|
3384
|
+
};
|
|
3385
|
+
case "notify":
|
|
3386
|
+
return { kind: "notify", ...request2 };
|
|
3387
|
+
// Pressed in this window, in the view of the session it names (main routed it here).
|
|
3388
|
+
case "keymap.dispatch":
|
|
3389
|
+
return { kind: "keymap", chord: request2.chord, ...request2.sessionId ? { sessionId: request2.sessionId } : {} };
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
const storeKey = (ref) => JSON.stringify([ref.extensionId, ref.name, ref.scope, ref.sessionId ?? ""]);
|
|
3393
|
+
function createElectronExtensionsHost(api = window.api.extensionHost, options = {}) {
|
|
3394
|
+
const folder = writable(options.folder);
|
|
3395
|
+
const hostIdStore = writable(options.hostId);
|
|
3396
|
+
const whereOf = (cwd) => {
|
|
3397
|
+
const hostId = hostIdStore.get();
|
|
3398
|
+
return hostId ? { cwd, hostId } : cwd;
|
|
3399
|
+
};
|
|
3400
|
+
const target = () => {
|
|
3401
|
+
const cwd = folder.get();
|
|
3402
|
+
return cwd === void 0 ? void 0 : whereOf(cwd);
|
|
3403
|
+
};
|
|
3404
|
+
const keyOf2 = (sessionId) => sessionKey(hostIdStore.get() ?? null, sessionId);
|
|
3405
|
+
const hostSession = (key2) => parseSessionKey(key2).sessionId;
|
|
3406
|
+
const windowItem = (item) => {
|
|
3407
|
+
const scoped = item;
|
|
3408
|
+
return hostIdStore.get() && typeof scoped.sessionId === "string" ? { ...scoped, sessionId: keyOf2(scoped.sessionId) } : item;
|
|
3409
|
+
};
|
|
3410
|
+
const tokenStores = Object.fromEntries(
|
|
3411
|
+
EXTENSION_TOKENS.map((t) => [t, writable([])])
|
|
3412
|
+
);
|
|
3413
|
+
const settingsWire = writable({
|
|
3414
|
+
schema: { categories: [], items: [] },
|
|
3415
|
+
actions: [],
|
|
3416
|
+
values: {},
|
|
3417
|
+
locked: []
|
|
3418
|
+
});
|
|
3419
|
+
const integrationList = writable([]);
|
|
3420
|
+
const commandList = writable([]);
|
|
3421
|
+
const keyCommands = writable([]);
|
|
3422
|
+
const keymapMode = writable(void 0);
|
|
3423
|
+
const sessionMenu = writable([]);
|
|
3424
|
+
const scope = writable(null);
|
|
3425
|
+
const panelListeners = /* @__PURE__ */ new Set();
|
|
3426
|
+
const queue = createDialogQueue();
|
|
3427
|
+
const channel = createUiEffectChannel();
|
|
3428
|
+
const closers = /* @__PURE__ */ new Map();
|
|
3429
|
+
let generation = 0;
|
|
3430
|
+
const publishItems = (all) => {
|
|
3431
|
+
for (const token of EXTENSION_TOKENS) tokenStores[token].set((all[token] ?? []).map(windowItem));
|
|
3432
|
+
};
|
|
3433
|
+
const requireFolder = () => {
|
|
3434
|
+
const where = target();
|
|
3435
|
+
if (where === void 0) throw new ExtensionsHostError({ code: "unavailable" });
|
|
3436
|
+
return where;
|
|
3437
|
+
};
|
|
3438
|
+
const reload = {
|
|
3439
|
+
items: async () => {
|
|
3440
|
+
const cwd = target();
|
|
3441
|
+
const at = generation;
|
|
3442
|
+
if (cwd === void 0) return publishItems(empty());
|
|
3443
|
+
const result = await api.list(cwd).catch(() => void 0);
|
|
3444
|
+
if (at !== generation || !result?.ok) return;
|
|
3445
|
+
const snapshot = result.value;
|
|
3446
|
+
const all = empty();
|
|
3447
|
+
for (const token of EXTENSION_TOKENS) all[token] = snapshot[token] ?? [];
|
|
3448
|
+
publishItems(all);
|
|
3449
|
+
},
|
|
3450
|
+
settings: async () => {
|
|
3451
|
+
const cwd = target();
|
|
3452
|
+
const at = generation;
|
|
3453
|
+
if (cwd === void 0) return;
|
|
3454
|
+
const [result, provenance] = await Promise.all([
|
|
3455
|
+
api.settings.get(cwd).catch(() => void 0),
|
|
3456
|
+
Promise.all(
|
|
3457
|
+
CATALOG_KINDS.map(async (kind) => {
|
|
3458
|
+
const changed2 = await api.catalogProvenance?.(cwd, kind).catch(() => void 0);
|
|
3459
|
+
return changed2?.ok ? changed2.value.map((item) => ({ ...item, kind })) : [];
|
|
3460
|
+
})
|
|
3461
|
+
)
|
|
3462
|
+
]);
|
|
3463
|
+
if (at !== generation || !result?.ok) return;
|
|
3464
|
+
const { sources: _sources, clientScope, ...wire2 } = result.value;
|
|
3465
|
+
scope.set(clientScope ?? null);
|
|
3466
|
+
settingsWire.set({
|
|
3467
|
+
...wire2,
|
|
3468
|
+
provenance: provenance.flat()
|
|
3469
|
+
});
|
|
3470
|
+
},
|
|
3471
|
+
integrations: async () => {
|
|
3472
|
+
const cwd = target();
|
|
3473
|
+
const at = generation;
|
|
3474
|
+
if (cwd === void 0) return integrationList.set([]);
|
|
3475
|
+
const result = await api.integrations.list(cwd).catch(() => void 0);
|
|
3476
|
+
if (at !== generation || !result?.ok) return;
|
|
3477
|
+
integrationList.set(
|
|
3478
|
+
result.value.map((i) => ({
|
|
3479
|
+
id: i.id,
|
|
3480
|
+
name: i.name,
|
|
3481
|
+
...i.description !== void 0 ? { description: i.description } : {},
|
|
3482
|
+
extensionId: i.extensionId,
|
|
3483
|
+
methods: i.methods.map((m) => ({
|
|
3484
|
+
type: m.type,
|
|
3485
|
+
id: m.id,
|
|
3486
|
+
label: m.label,
|
|
3487
|
+
..."placeholder" in m && typeof m.placeholder === "string" ? { placeholder: m.placeholder } : {},
|
|
3488
|
+
..."help" in m && typeof m.help === "string" ? { help: m.help } : {}
|
|
3489
|
+
})),
|
|
3490
|
+
...connectionsOf(i)
|
|
3491
|
+
}))
|
|
3492
|
+
);
|
|
3493
|
+
},
|
|
3494
|
+
commands: async () => {
|
|
3495
|
+
const cwd = target();
|
|
3496
|
+
const at = generation;
|
|
3497
|
+
if (cwd === void 0) {
|
|
3498
|
+
commandList.set([]);
|
|
3499
|
+
keyCommands.set([]);
|
|
3500
|
+
return;
|
|
3501
|
+
}
|
|
3502
|
+
const result = await api.commands.list(cwd).catch(() => void 0);
|
|
3503
|
+
if (at !== generation || !result?.ok) return;
|
|
3504
|
+
keyCommands.set(result.value.commands);
|
|
3505
|
+
keymapMode.set(result.value.mode);
|
|
3506
|
+
commandList.set(
|
|
3507
|
+
result.value.commands.map((c) => ({
|
|
3508
|
+
id: c.id,
|
|
3509
|
+
title: c.title,
|
|
3510
|
+
...c.description !== void 0 ? { description: c.description } : {},
|
|
3511
|
+
...c.slash ? { slash: c.slash.name } : {},
|
|
3512
|
+
...c.bind.length > 0 ? { bind: c.bind } : {},
|
|
3513
|
+
...c.extensionId ? { extensionId: c.extensionId } : {}
|
|
3514
|
+
}))
|
|
3515
|
+
);
|
|
3516
|
+
}
|
|
3517
|
+
};
|
|
3518
|
+
const reloadMenus = async () => {
|
|
3519
|
+
const cwd = target();
|
|
3520
|
+
const at = generation;
|
|
3521
|
+
if (cwd === void 0) return sessionMenu.set([]);
|
|
3522
|
+
const result = await api.menus(cwd).catch(() => void 0);
|
|
3523
|
+
if (at !== generation || !result?.ok) return;
|
|
3524
|
+
sessionMenu.set(result.value.filter((m) => m.menu === "session"));
|
|
3525
|
+
};
|
|
3526
|
+
const reloadAll = () => {
|
|
3527
|
+
void reloadMenus();
|
|
3528
|
+
void reload.items();
|
|
3529
|
+
void reload.settings();
|
|
3530
|
+
void reload.integrations();
|
|
3531
|
+
void reload.commands();
|
|
3532
|
+
};
|
|
3533
|
+
const stores = /* @__PURE__ */ new Map();
|
|
3534
|
+
const location2 = (ref) => ref.scope === "session" ? { extensionId: ref.extensionId, scope: "session", sessionId: hostSession(ref.sessionId ?? "") } : { extensionId: ref.extensionId, scope: ref.scope };
|
|
3535
|
+
const readRecord = (entry, raw) => {
|
|
3536
|
+
const record = raw;
|
|
3537
|
+
if (record && typeof record === "object" && "value" in record) {
|
|
3538
|
+
if (typeof record.v === "number") entry.v = record.v;
|
|
3539
|
+
entry.value.set(record.value);
|
|
3540
|
+
} else entry.value.set(void 0);
|
|
3541
|
+
};
|
|
3542
|
+
const loadStore = async (entry) => {
|
|
3543
|
+
const cwd = target();
|
|
3544
|
+
if (cwd === void 0) return;
|
|
3545
|
+
const result = await api.storage.load(cwd, location2(entry.ref)).catch(() => void 0);
|
|
3546
|
+
if (!result?.ok) return;
|
|
3547
|
+
entry.projectRoot = result.value.projectRoot;
|
|
3548
|
+
readRecord(entry, result.value.stores[entry.ref.name]);
|
|
3549
|
+
};
|
|
3550
|
+
const mine = (signal) => signal.host === hostIdStore.get() && (signal.cwd === void 0 || signal.cwd === folder.get());
|
|
3551
|
+
const onSignal = (signal) => {
|
|
3552
|
+
switch (signal.kind) {
|
|
3553
|
+
case "extensions:ui": {
|
|
3554
|
+
if (signal.cwd === EVERY_FOLDER && signal.host === void 0 && hostIdStore.get() === void 0) {
|
|
3555
|
+
generation++;
|
|
3556
|
+
return reloadAll();
|
|
3557
|
+
}
|
|
3558
|
+
if (!mine(signal)) return;
|
|
3559
|
+
const change = signal.change;
|
|
3560
|
+
if (change.type === "reset") return reloadAll();
|
|
3561
|
+
if (change.type === "upsert" && change.entry.token === "menu" || change.type === "remove" && change.token === "menu")
|
|
3562
|
+
return void reloadMenus();
|
|
3563
|
+
if (change.type === "panel-changed") {
|
|
3564
|
+
const event = {
|
|
3565
|
+
extensionId: change.extension,
|
|
3566
|
+
panelId: change.panelId,
|
|
3567
|
+
...change.sessionId ? { sessionId: hostIdStore.get() ? keyOf2(change.sessionId) : change.sessionId } : {}
|
|
3568
|
+
};
|
|
3569
|
+
for (const listener of [...panelListeners]) listener(event);
|
|
3570
|
+
return;
|
|
3571
|
+
}
|
|
3572
|
+
if (change.type === "upsert") {
|
|
3573
|
+
const entry = windowItem(change.entry);
|
|
3574
|
+
const store2 = tokenStores[entry.token];
|
|
3575
|
+
if (!store2) return;
|
|
3576
|
+
const list2 = store2.get();
|
|
3577
|
+
const at = list2.findIndex((i) => i.key === entry.key);
|
|
3578
|
+
const next = at >= 0 ? list2.map((i, n) => n === at ? entry : i) : [...list2, entry];
|
|
3579
|
+
if (entry.token === "slot")
|
|
3580
|
+
next.sort((a, b) => a.item.order - b.item.order);
|
|
3581
|
+
store2.set(next);
|
|
3582
|
+
return;
|
|
3583
|
+
}
|
|
3584
|
+
if (change.type === "remove") {
|
|
3585
|
+
const store2 = tokenStores[change.token];
|
|
3586
|
+
store2?.set(store2.get().filter((i) => i.key !== change.key));
|
|
3587
|
+
}
|
|
3588
|
+
return;
|
|
3589
|
+
}
|
|
3590
|
+
case "extensions:commands":
|
|
3591
|
+
case "extensions:keymap":
|
|
3592
|
+
if (mine(signal)) void reload.commands();
|
|
3593
|
+
return;
|
|
3594
|
+
case "extensions:integrations":
|
|
3595
|
+
if (mine(signal)) void reload.integrations();
|
|
3596
|
+
return;
|
|
3597
|
+
// An extension of the folder loaded, reloaded or went: its items, commands and bundle may be new.
|
|
3598
|
+
case "extensions:entries":
|
|
3599
|
+
if (mine(signal)) reloadAll();
|
|
3600
|
+
return;
|
|
3601
|
+
case "extensions:storage": {
|
|
3602
|
+
if (signal.area !== "stores" || signal.host !== hostIdStore.get()) return;
|
|
3603
|
+
for (const entry of stores.values()) {
|
|
3604
|
+
const { ref } = entry;
|
|
3605
|
+
if (ref.extensionId !== signal.extensionId || ref.name !== signal.key || ref.scope !== signal.scope) continue;
|
|
3606
|
+
if (ref.scope === "session" && keyOf2(signal.sessionId ?? "") !== ref.sessionId) continue;
|
|
3607
|
+
if (ref.scope !== "user" && entry.projectRoot !== signal.projectRoot) continue;
|
|
3608
|
+
readRecord(entry, signal.value);
|
|
3609
|
+
}
|
|
3610
|
+
return;
|
|
3611
|
+
}
|
|
3612
|
+
case "ui:dialog": {
|
|
3613
|
+
const controller = new AbortController();
|
|
3614
|
+
closers.set(signal.dialogId, controller);
|
|
3615
|
+
queue.show(signal.request, {
|
|
3616
|
+
id: signal.dialogId,
|
|
3617
|
+
extensionId: signal.extensionId,
|
|
3618
|
+
...signal.sessionId ? { sessionId: signal.sessionId } : {},
|
|
3619
|
+
signal: controller.signal
|
|
3620
|
+
}).then(
|
|
3621
|
+
(answer) => void api.answerDialog(signal.dialogId, answer),
|
|
3622
|
+
() => void 0
|
|
3623
|
+
).finally(() => closers.delete(signal.dialogId));
|
|
3624
|
+
return;
|
|
3625
|
+
}
|
|
3626
|
+
// A sign-in step for this window: main opened its link already; a question shows as a dialog here.
|
|
3627
|
+
case "extensions:integration-flow": {
|
|
3628
|
+
const { flowId, step } = signal;
|
|
3629
|
+
const ask = (request2, inputId, pick) => void queue.show(request2, { extensionId: "zidane" }).then(
|
|
3630
|
+
(answer) => void api.integrations.flowInput(
|
|
3631
|
+
flowId,
|
|
3632
|
+
inputId,
|
|
3633
|
+
pick ? pick(answer) : typeof answer === "string" ? answer : void 0
|
|
3634
|
+
),
|
|
3635
|
+
() => void api.integrations.flowInput(flowId, inputId, void 0)
|
|
3636
|
+
);
|
|
3637
|
+
if (step.type === "device")
|
|
3638
|
+
void queue.show({ kind: "toast", text: `${step.userCode} · ${step.verificationUri}`, tone: "info" }, {
|
|
3639
|
+
extensionId: "zidane"
|
|
3640
|
+
}).catch(() => void 0);
|
|
3641
|
+
else if (step.type === "prompt")
|
|
3642
|
+
ask(
|
|
3643
|
+
{ kind: "prompt", title: step.message, ...step.placeholder ? { placeholder: step.placeholder } : {} },
|
|
3644
|
+
step.inputId
|
|
3645
|
+
);
|
|
3646
|
+
else if (step.type === "manual-code")
|
|
3647
|
+
ask({ kind: "prompt", title: "Paste the address the browser ended on" }, step.inputId);
|
|
3648
|
+
else if (step.type === "select")
|
|
3649
|
+
ask(
|
|
3650
|
+
{ kind: "select", title: step.message, options: step.options },
|
|
3651
|
+
step.inputId,
|
|
3652
|
+
(answer) => answer?.ids?.[0]
|
|
3653
|
+
);
|
|
3654
|
+
return;
|
|
3655
|
+
}
|
|
3656
|
+
case "ui:dialog:close":
|
|
3657
|
+
closers.get(signal.dialogId)?.abort(new Error("The extension withdrew the dialog."));
|
|
3658
|
+
return;
|
|
3659
|
+
case "ui:client": {
|
|
3660
|
+
const { requestId, request: request2 } = signal;
|
|
3661
|
+
void channel.apply(effectOf(request2)).then((result) => {
|
|
3662
|
+
if (requestId) void api.reply(requestId, result);
|
|
3663
|
+
});
|
|
3664
|
+
return;
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
};
|
|
3668
|
+
const stop = api.onSignal(onSignal);
|
|
3669
|
+
reloadAll();
|
|
3670
|
+
const items = tokenStores;
|
|
3671
|
+
const minted = /* @__PURE__ */ new Map();
|
|
3672
|
+
const webviewListeners = /* @__PURE__ */ new Set();
|
|
3673
|
+
const webviews = {
|
|
3674
|
+
resolveSrc(webview, extension) {
|
|
3675
|
+
const hostId = hostIdStore.get();
|
|
3676
|
+
if (!hostId) return desktopWebviewSrc(webview, extension, folder.get());
|
|
3677
|
+
if ("url" in webview.src) return httpUrl(webview.src.url);
|
|
3678
|
+
const where = target();
|
|
3679
|
+
if (where === void 0) return null;
|
|
3680
|
+
const key2 = JSON.stringify([hostId, folder.get(), webview.id]);
|
|
3681
|
+
if (minted.has(key2)) return minted.get(key2) ?? null;
|
|
3682
|
+
minted.set(key2, null);
|
|
3683
|
+
void api.webviewUrl(where, webview.id).then((result) => {
|
|
3684
|
+
if (!minted.has(key2)) return;
|
|
3685
|
+
const url = result.ok && result.value ? httpUrl(result.value) : null;
|
|
3686
|
+
if (!url) return void minted.delete(key2);
|
|
3687
|
+
minted.set(key2, url);
|
|
3688
|
+
for (const listener of [...webviewListeners]) listener();
|
|
3689
|
+
}).catch(() => minted.delete(key2));
|
|
3690
|
+
return null;
|
|
3691
|
+
},
|
|
3692
|
+
subscribe(listener) {
|
|
3693
|
+
webviewListeners.add(listener);
|
|
3694
|
+
return () => webviewListeners.delete(listener);
|
|
3695
|
+
},
|
|
3696
|
+
sandbox: "allow-scripts allow-forms"
|
|
3697
|
+
};
|
|
3698
|
+
return {
|
|
3699
|
+
items,
|
|
3700
|
+
folder,
|
|
3701
|
+
hostId: hostIdStore,
|
|
3702
|
+
target,
|
|
3703
|
+
setFolder(cwd, hostId) {
|
|
3704
|
+
if (cwd === folder.get() && hostId === hostIdStore.get()) return;
|
|
3705
|
+
generation++;
|
|
3706
|
+
hostIdStore.set(hostId);
|
|
3707
|
+
folder.set(cwd);
|
|
3708
|
+
minted.clear();
|
|
3709
|
+
publishItems(empty());
|
|
3710
|
+
reloadAll();
|
|
3711
|
+
for (const entry of stores.values()) void loadStore(entry);
|
|
3712
|
+
for (const listener of [...webviewListeners]) listener();
|
|
3713
|
+
},
|
|
3714
|
+
webviews,
|
|
3715
|
+
announce(info) {
|
|
3716
|
+
void api.announce({ ...info, dialogs: true, ui: true });
|
|
3717
|
+
},
|
|
3718
|
+
keyCommands,
|
|
3719
|
+
keymapMode,
|
|
3720
|
+
sessionMenu,
|
|
3721
|
+
scope,
|
|
3722
|
+
async openLink(request2) {
|
|
3723
|
+
const where = target();
|
|
3724
|
+
if (where === void 0) return false;
|
|
3725
|
+
const result = await api.openLink(where, {
|
|
3726
|
+
url: request2.url,
|
|
3727
|
+
source: request2.source,
|
|
3728
|
+
// The session as the host names it.
|
|
3729
|
+
...request2.sessionId ? { sessionId: hostSession(request2.sessionId) } : {}
|
|
3730
|
+
}).catch(() => void 0);
|
|
3731
|
+
return result?.ok === true && result.value.handled === true;
|
|
3732
|
+
},
|
|
3733
|
+
panelChanged(listener) {
|
|
3734
|
+
panelListeners.add(listener);
|
|
3735
|
+
return () => panelListeners.delete(listener);
|
|
3736
|
+
},
|
|
3737
|
+
dispose() {
|
|
3738
|
+
stop();
|
|
3739
|
+
queue.clear();
|
|
3740
|
+
},
|
|
3741
|
+
invoke: async (callbackId, args) => {
|
|
3742
|
+
const { cwd, request: request2 } = invokeRequest(callbackId, args);
|
|
3743
|
+
const sent = request2.op === "badge.run" && request2.sessionId ? { ...request2, sessionId: hostSession(request2.sessionId) } : request2;
|
|
3744
|
+
return unwrap(api.invoke(cwd !== void 0 ? whereOf(cwd) : requireFolder(), sent));
|
|
3745
|
+
},
|
|
3746
|
+
dialogs: queue.dialogs,
|
|
3747
|
+
effects: channel.effects,
|
|
3748
|
+
rpc: async (contract, method, input, opts = {}) => {
|
|
3749
|
+
if (!opts.extensionId)
|
|
3750
|
+
throw new ExtensionsHostError({
|
|
3751
|
+
code: "refused",
|
|
3752
|
+
reason: "not-allowed",
|
|
3753
|
+
message: "An RPC call from the UI names its extension."
|
|
3754
|
+
});
|
|
3755
|
+
if (opts.signal?.aborted) throw new ExtensionsHostError({ code: "rpc", type: "rpc.aborted", message: "aborted" });
|
|
3756
|
+
const callId = `c${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;
|
|
3757
|
+
const onAbort = () => void api.cancelRpc(callId);
|
|
3758
|
+
opts.signal?.addEventListener("abort", onAbort, { once: true });
|
|
3759
|
+
try {
|
|
3760
|
+
const envelope = await unwrap(
|
|
3761
|
+
api.rpc(target() ?? "", {
|
|
3762
|
+
contract,
|
|
3763
|
+
method,
|
|
3764
|
+
...input !== void 0 ? { input } : {},
|
|
3765
|
+
extensionId: opts.extensionId,
|
|
3766
|
+
callId
|
|
3767
|
+
})
|
|
3768
|
+
);
|
|
3769
|
+
if (envelope.ok) return envelope.output;
|
|
3770
|
+
const { type, message, data } = envelope.error;
|
|
3771
|
+
throw new ExtensionsHostError({ code: "rpc", type, message, ...data !== void 0 ? { data } : {} });
|
|
3772
|
+
} finally {
|
|
3773
|
+
opts.signal?.removeEventListener("abort", onAbort);
|
|
3774
|
+
}
|
|
3775
|
+
},
|
|
3776
|
+
storage: {
|
|
3777
|
+
store(ref) {
|
|
3778
|
+
const key2 = storeKey(ref);
|
|
3779
|
+
let entry = stores.get(key2);
|
|
3780
|
+
if (!entry) {
|
|
3781
|
+
entry = { ref, value: writable(void 0), v: 1 };
|
|
3782
|
+
stores.set(key2, entry);
|
|
3783
|
+
void loadStore(entry);
|
|
3784
|
+
}
|
|
3785
|
+
return entry.value;
|
|
3786
|
+
},
|
|
3787
|
+
async set(ref, value) {
|
|
3788
|
+
const key2 = storeKey(ref);
|
|
3789
|
+
const entry = stores.get(key2);
|
|
3790
|
+
const record = { v: entry?.v ?? 1, value };
|
|
3791
|
+
const result = await unwrap(api.storage.set(requireFolder(), location2(ref), "stores", ref.name, record));
|
|
3792
|
+
if (result && result.accepted === false) {
|
|
3793
|
+
if (entry && "value" in result) readRecord(entry, result.value);
|
|
3794
|
+
throw new ExtensionsHostError({ code: "refused", reason: "invalid", message: result.reason });
|
|
3795
|
+
}
|
|
3796
|
+
entry?.value.set(value);
|
|
3797
|
+
}
|
|
3798
|
+
},
|
|
3799
|
+
settings: {
|
|
3800
|
+
wire: settingsWire,
|
|
3801
|
+
async set(extensionId, key2, value) {
|
|
3802
|
+
const where = requireFolder();
|
|
3803
|
+
await unwrap(
|
|
3804
|
+
api.settings.set({
|
|
3805
|
+
...typeof where === "string" ? { cwd: where } : where,
|
|
3806
|
+
extension: extensionId,
|
|
3807
|
+
key: key2,
|
|
3808
|
+
value,
|
|
3809
|
+
scope: "user"
|
|
3810
|
+
})
|
|
3811
|
+
);
|
|
3812
|
+
await reload.settings();
|
|
3813
|
+
}
|
|
3814
|
+
},
|
|
3815
|
+
integrations: {
|
|
3816
|
+
list: integrationList,
|
|
3817
|
+
async connect(integrationId, opts) {
|
|
3818
|
+
const cwd = requireFolder();
|
|
3819
|
+
await unwrap(
|
|
3820
|
+
opts.key !== void 0 ? api.integrations.connectKey(cwd, integrationId, opts.key, opts.methodId) : api.integrations.start(cwd, integrationId, opts.methodId)
|
|
3821
|
+
);
|
|
3822
|
+
await reload.integrations();
|
|
3823
|
+
},
|
|
3824
|
+
async setDefault(integrationId, account) {
|
|
3825
|
+
await unwrap(api.integrations.setDefault(requireFolder(), integrationId, account));
|
|
3826
|
+
await reload.integrations();
|
|
3827
|
+
},
|
|
3828
|
+
async disconnect(integrationId, opts) {
|
|
3829
|
+
await unwrap(api.integrations.disconnect(requireFolder(), integrationId, opts?.account));
|
|
3830
|
+
await reload.integrations();
|
|
3831
|
+
}
|
|
3832
|
+
},
|
|
3833
|
+
commands: {
|
|
3834
|
+
list: commandList,
|
|
3835
|
+
async run(id, opts = {}) {
|
|
3836
|
+
return unwrap(
|
|
3837
|
+
api.commands.run(requireFolder(), id, {
|
|
3838
|
+
...opts.args !== void 0 ? { args: opts.args } : {},
|
|
3839
|
+
...opts.sessionId !== void 0 ? { sessionId: hostSession(opts.sessionId) } : {}
|
|
3840
|
+
})
|
|
3841
|
+
);
|
|
3842
|
+
}
|
|
3843
|
+
}
|
|
3844
|
+
};
|
|
3845
|
+
}
|
|
3846
|
+
const HostContext = reactExports.createContext(null);
|
|
3847
|
+
function useElectronExtensionsHost() {
|
|
3848
|
+
return reactExports.useContext(HostContext);
|
|
3849
|
+
}
|
|
3850
|
+
function ExtensionsHostProvider({ children }) {
|
|
3851
|
+
const { allSessions, activeSessionId, defaultFolder } = useSessions();
|
|
3852
|
+
const host2 = reactExports.useMemo(() => createElectronExtensionsHost(), []);
|
|
3853
|
+
const loadModule = reactExports.useMemo(
|
|
3854
|
+
() => createExtensionModuleLoader({ api: window.api.extensionHost, folder: () => host2.target() }),
|
|
3855
|
+
[host2]
|
|
3856
|
+
);
|
|
3857
|
+
reactExports.useEffect(() => () => host2.dispose(), [host2]);
|
|
3858
|
+
const { attachSidebarContributions } = useSessionsActions();
|
|
3859
|
+
reactExports.useEffect(() => attachSidebarContributions(sidebarContributionsOf(host2.items)), [host2, attachSidebarContributions]);
|
|
3860
|
+
const serverId = activeSessionId !== null ? serverIdOf(activeSessionId) ?? void 0 : void 0;
|
|
3861
|
+
const sessionCwd = activeSessionId !== null ? allSessions.find((s) => s.id === activeSessionId)?.cwd : void 0;
|
|
3862
|
+
const folder = activeSessionId === null ? defaultFolder ?? void 0 : sessionCwd || void 0;
|
|
3863
|
+
reactExports.useEffect(() => host2.setFolder(folder, serverId), [host2, folder, serverId]);
|
|
3864
|
+
const viewing = activeSessionId ?? void 0;
|
|
3865
|
+
reactExports.useEffect(() => {
|
|
3866
|
+
host2.announce({ viewing: viewing ? [viewing] : [], active: document.hasFocus() });
|
|
3867
|
+
}, [host2, viewing]);
|
|
3868
|
+
reactExports.useEffect(() => {
|
|
3869
|
+
const active = () => host2.announce({ active: true });
|
|
3870
|
+
window.addEventListener("focus", active);
|
|
3871
|
+
return () => window.removeEventListener("focus", active);
|
|
3872
|
+
}, [host2]);
|
|
3873
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(HostContext.Provider, { value: host2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionsProvider, { host: host2, loadModule, children }) });
|
|
3874
|
+
}
|
|
3875
|
+
const NONE = [];
|
|
3876
|
+
const noMenu = { get: () => NONE, subscribe: () => () => {
|
|
3877
|
+
} };
|
|
3878
|
+
function useExtensionSessionMenuItems(sessionKey2) {
|
|
3879
|
+
const host2 = useElectronExtensionsHost();
|
|
3880
|
+
const items = useReadable(host2?.sessionMenu ?? noMenu);
|
|
3881
|
+
return reactExports.useMemo(
|
|
3882
|
+
() => items.map((item) => ({
|
|
3883
|
+
id: `extension:${item.key}`,
|
|
3884
|
+
label: item.label,
|
|
3885
|
+
group: "extensions",
|
|
3886
|
+
...item.enabled ? {} : { disabled: true },
|
|
3887
|
+
onSelect: () => void host2?.commands?.run(item.command, { sessionId: sessionKey2 }).catch(() => void 0)
|
|
3888
|
+
})),
|
|
3889
|
+
[items, host2, sessionKey2]
|
|
3890
|
+
);
|
|
3891
|
+
}
|
|
3892
|
+
const { SessionStatusDot, RowMeta, RowArtifacts } = sidebarLive;
|
|
3893
|
+
const HomeSessionRow = reactExports.memo(function HomeSessionRow2({ item, session, fallback }) {
|
|
3894
|
+
const key2 = localSessionKey(session);
|
|
3895
|
+
const { allSessions } = useSessionsList();
|
|
3896
|
+
const row = reactExports.useMemo(() => allSessions.find((s) => s.id === key2), [allSessions, key2]);
|
|
3897
|
+
const named = (item.facts?.length ?? 0) > 0;
|
|
3898
|
+
return row ? /* @__PURE__ */ jsxRuntimeExports.jsx(KnownRow, { row, named }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: fallback });
|
|
3899
|
+
});
|
|
3900
|
+
function KnownRow({ row, named }) {
|
|
3901
|
+
const key2 = row.id;
|
|
3902
|
+
const { activeSessionId, spacesOn, spaces } = useSessionsList();
|
|
3903
|
+
const actions = useSessionsActions();
|
|
3904
|
+
const { settings } = useSettings();
|
|
3905
|
+
const { icons } = useProjectIcons();
|
|
3906
|
+
const confirmDelete = useConfirmDeleteSession((id) => actions.deleteSession(id));
|
|
3907
|
+
const moveSession = useMoveSession();
|
|
3908
|
+
const [arrived, setArrived] = reactExports.useState(false);
|
|
3909
|
+
const [menuOpen, setMenuOpen] = reactExports.useState(false);
|
|
3910
|
+
const [renameValue, setRenameValue] = reactExports.useState(null);
|
|
3911
|
+
const project = reactExports.useMemo(() => {
|
|
3912
|
+
const path = named ? (row.projectRoot || row.cwd).replace(/\/+$/, "") : "";
|
|
3913
|
+
if (!path) return void 0;
|
|
3914
|
+
return {
|
|
3915
|
+
label: basename(path) || path,
|
|
3916
|
+
path,
|
|
3917
|
+
isGitRepo: row.isGitRepo === true,
|
|
3918
|
+
...icons[path] ? { icon: icons[path] } : {}
|
|
3919
|
+
};
|
|
3920
|
+
}, [row, named, icons]);
|
|
3921
|
+
const target = {
|
|
3922
|
+
id: key2,
|
|
3923
|
+
title: row.title,
|
|
3924
|
+
cwd: row.cwd,
|
|
3925
|
+
archived: row.archived,
|
|
3926
|
+
...row.favorite ? { favorite: true } : {},
|
|
3927
|
+
...row.spaceId ? { spaceId: row.spaceId } : {},
|
|
3928
|
+
...row.environment ? { environment: row.environment } : {}
|
|
3929
|
+
};
|
|
3930
|
+
const appMenuItems = useSessionMenuItems(target, spacesOn ? spaces : null, menuOpen, {
|
|
3931
|
+
rename: () => setRenameValue(row.title),
|
|
3932
|
+
setFavorite: (favorite) => void actions.setFavorite(key2, favorite),
|
|
3933
|
+
setArchived: (archived) => void actions.setArchived(key2, archived),
|
|
3934
|
+
remove: () => confirmDelete(target),
|
|
3935
|
+
moveToSpace: (spaceId) => void actions.setSessionSpace(key2, spaceId),
|
|
3936
|
+
...moveSession ? { moveSession: () => void moveSession(moveSubject(row)) } : {}
|
|
3937
|
+
});
|
|
3938
|
+
const extensionMenu = useExtensionSessionMenuItems(key2);
|
|
3939
|
+
const menuItems = reactExports.useMemo(() => [...appMenuItems, ...extensionMenu], [appMenuItems, extensionMenu]);
|
|
3940
|
+
const open = () => actions.setActiveSessionId(key2);
|
|
3941
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3942
|
+
SessionListRow,
|
|
3943
|
+
{
|
|
3944
|
+
id: key2,
|
|
3945
|
+
title: row.title,
|
|
3946
|
+
active: activeSessionId === key2,
|
|
3947
|
+
archived: row.archived,
|
|
3948
|
+
status: row.archived ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsx(SessionStatusDot, { sessionId: key2 }),
|
|
3949
|
+
meta: /* @__PURE__ */ jsxRuntimeExports.jsx(RowMeta, { sessionId: key2, updatedAt: row.updatedAt, details: settings.sidebarRunDetails !== false }),
|
|
3950
|
+
sub: renameValue !== null ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3951
|
+
RowArtifacts,
|
|
3952
|
+
{
|
|
3953
|
+
sessionId: key2,
|
|
3954
|
+
enabled: settings.artifacts !== false,
|
|
3955
|
+
onArrival: setArrived,
|
|
3956
|
+
onSelect: open,
|
|
3957
|
+
cards: "below",
|
|
3958
|
+
...row.cwd ? { cwd: row.cwd } : {},
|
|
3959
|
+
...project ? { project } : {},
|
|
3960
|
+
...row.environment ? { environment: row.environment } : {}
|
|
3961
|
+
}
|
|
3962
|
+
),
|
|
3963
|
+
onSelect: open,
|
|
3964
|
+
renaming: renameValue !== null,
|
|
3965
|
+
renameValue: renameValue ?? "",
|
|
3966
|
+
onStartRename: () => setRenameValue(row.title),
|
|
3967
|
+
onRenameChange: setRenameValue,
|
|
3968
|
+
onRenameCommit: async () => {
|
|
3969
|
+
const next = renameValue?.trim();
|
|
3970
|
+
setRenameValue(null);
|
|
3971
|
+
if (next && next !== row.title) await actions.renameSession(key2, next);
|
|
3972
|
+
},
|
|
3973
|
+
onRenameCancel: () => setRenameValue(null),
|
|
3974
|
+
menuItems,
|
|
3975
|
+
menuOpen,
|
|
3976
|
+
onOpenMenu: () => setMenuOpen(true),
|
|
3977
|
+
onCloseMenu: () => setMenuOpen(false),
|
|
3978
|
+
arrived
|
|
3979
|
+
}
|
|
3980
|
+
);
|
|
3981
|
+
}
|
|
3982
|
+
const DEFAULT_BLOCKS = [USAGE_BLOCK_ID];
|
|
3983
|
+
function ProjectHomeScreen({ draft: draft2 }) {
|
|
3984
|
+
const host2 = useWorkspaceHost();
|
|
3985
|
+
const scope = useScopeOf(null);
|
|
3986
|
+
const { setActiveSessionId, allSessions } = useSessions();
|
|
3987
|
+
const { icons } = useProjectIcons();
|
|
3988
|
+
const { file: onOpenPath } = useOpenTarget();
|
|
3989
|
+
const panels = usePanelActions();
|
|
3990
|
+
const links = useLinkRouter();
|
|
3991
|
+
const server = draft2.server;
|
|
3992
|
+
const folder = server ? draft2.remoteFolder ?? draft2.remoteRoot ?? "" : draft2.folderPath ?? "";
|
|
3993
|
+
const root = server ? folder : scope?.root || folder;
|
|
3994
|
+
const serverId = server?.id;
|
|
3995
|
+
reactExports.useEffect(() => {
|
|
3996
|
+
publishHomeProject(root ? { path: root, ...serverId ? { hostId: serverId } : {} } : null);
|
|
3997
|
+
}, [root, serverId]);
|
|
3998
|
+
reactExports.useEffect(() => () => publishHomeProject(null), []);
|
|
3999
|
+
const rows2 = server ? [] : allSessions.filter((s) => !s.hostId && (s.projectRoot || s.cwd).replace(/\/+$/, "") === root);
|
|
4000
|
+
const isGitRepo = rows2.some((s) => s.isGitRepo);
|
|
4001
|
+
const repoKey = rows2.find((s) => s.repoKey)?.repoKey;
|
|
4002
|
+
const [web, setWeb] = reactExports.useState(null);
|
|
4003
|
+
reactExports.useEffect(() => {
|
|
4004
|
+
if (!isGitRepo || !root) return void 0;
|
|
4005
|
+
let current = true;
|
|
4006
|
+
window.api.system.repoWebBase(root).then(
|
|
4007
|
+
(url) => current && setWeb({ root, url }),
|
|
4008
|
+
() => current && setWeb({ root, url: null })
|
|
4009
|
+
);
|
|
4010
|
+
return () => {
|
|
4011
|
+
current = false;
|
|
4012
|
+
};
|
|
4013
|
+
}, [isGitRepo, root]);
|
|
4014
|
+
const webUrl = web?.root === root ? web.url : null;
|
|
4015
|
+
const repo = isGitRepo ? repoChip(webUrl, repoKey, basename(root)) : void 0;
|
|
4016
|
+
const picked = server || !root ? void 0 : icons[root];
|
|
4017
|
+
const project = root ? {
|
|
4018
|
+
name: basename(root),
|
|
4019
|
+
path: root,
|
|
4020
|
+
...serverId ? { hostId: serverId } : {},
|
|
4021
|
+
...repo ? { repo } : {},
|
|
4022
|
+
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectIconGlyph, { size: "lg", ...picked ? { icon: picked } : {}, isGitRepo })
|
|
4023
|
+
} : void 0;
|
|
4024
|
+
return (
|
|
4025
|
+
// Rows that stand for a session (the recent sessions block) are the sidebar's rows, wider.
|
|
4026
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PanelSessionRowProvider, { row: HomeSessionRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4027
|
+
ProjectHome,
|
|
4028
|
+
{
|
|
4029
|
+
cwd: server ? "" : folder,
|
|
4030
|
+
projectKey: server ? `${server.id}${root}` : root,
|
|
4031
|
+
defaultBlocks: DEFAULT_BLOCKS,
|
|
4032
|
+
switcher: server ? { projects: draft2.serverFolders, current: draft2.remoteFolder, onPick: draft2.setRemoteFolder } : {
|
|
4033
|
+
projects: draft2.recentFolders,
|
|
4034
|
+
current: draft2.folderPath,
|
|
4035
|
+
onPick: draft2.pickRecent,
|
|
4036
|
+
onImportRepo: draft2.importRepoIntoDraft,
|
|
4037
|
+
onSelectDirectory: draft2.pickFolder
|
|
4038
|
+
},
|
|
4039
|
+
...project ? { project } : {},
|
|
4040
|
+
...server ? { blocksUnavailable: true } : host2?.panels ? { panels: host2.panels } : {},
|
|
4041
|
+
onOpenSession: (id) => setActiveSessionId(localSessionKey(id)),
|
|
4042
|
+
onOpenPath,
|
|
4043
|
+
...server ? {} : {
|
|
4044
|
+
// A folder on this computer: its repository, its files, Finder, the editor.
|
|
4045
|
+
...repo ? {
|
|
4046
|
+
// Its web page, else what changed in the working tree.
|
|
4047
|
+
onOpenRepo: () => webUrl ? void links.open(webUrl, { source: "panel" }, () => void window.open(webUrl, "_blank")) : panels.showWorkingTree()
|
|
4048
|
+
} : {},
|
|
4049
|
+
// Opens the panel on Files with the project's folder selected (a trailing `/` names a folder).
|
|
4050
|
+
onOpenFiles: () => panels.revealFile(`${folder.replace(/\/+$/, "")}/`),
|
|
4051
|
+
onRevealPath: (path) => void window.api.system.revealPath(path),
|
|
4052
|
+
onOpenInEditor: (path) => void links.open(path, { source: "panel" }, () => void window.api.system.openPath(path))
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
) })
|
|
4056
|
+
);
|
|
4057
|
+
}
|
|
4058
|
+
function repoChip(webUrl, repoKey, folder) {
|
|
4059
|
+
const fromUrl = webUrl ? new URL(webUrl).pathname.replace(/^\/+|\/+$/g, "") : "";
|
|
4060
|
+
const fromKey = repoKey ? repoKey.split("/").slice(1).join("/") : "";
|
|
4061
|
+
const host2 = webUrl ? new URL(webUrl).hostname : repoKey?.split("/")[0] ?? "";
|
|
4062
|
+
return {
|
|
4063
|
+
name: fromUrl || fromKey || folder,
|
|
4064
|
+
web: Boolean(webUrl),
|
|
4065
|
+
icon: host2 === "github.com" ? "i-ph-github-logo" : host2.includes("gitlab") ? "i-ph-gitlab-logo" : "i-ph-git-branch"
|
|
4066
|
+
};
|
|
4067
|
+
}
|
|
3092
4068
|
function WelcomeScreen() {
|
|
3093
4069
|
const modelName = useModelName();
|
|
3094
4070
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WelcomeScreen$1, { modelName });
|
|
@@ -3596,6 +4572,7 @@ function GitBranchMenu({
|
|
|
3596
4572
|
anchorRef,
|
|
3597
4573
|
cwd,
|
|
3598
4574
|
sessionId,
|
|
4575
|
+
...hostKey === LOCAL_SESSION_HOST ? {} : { hostId: hostKey },
|
|
3599
4576
|
current,
|
|
3600
4577
|
onClose,
|
|
3601
4578
|
onSwitched,
|
|
@@ -3763,18 +4740,6 @@ const ConversationBadges = reactExports.memo(function ConversationBadges2({
|
|
|
3763
4740
|
}
|
|
3764
4741
|
);
|
|
3765
4742
|
});
|
|
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
4743
|
function ConversationComposer({
|
|
3779
4744
|
session,
|
|
3780
4745
|
running,
|
|
@@ -3948,80 +4913,20 @@ const selectMachineWaiting = (events) => machineWaiting(events);
|
|
|
3948
4913
|
function SessionMachineWaiting({ sessionId }) {
|
|
3949
4914
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(MachineWaitingBanner, { machine: useSessionEventsSelector(sessionId, selectMachineWaiting) });
|
|
3950
4915
|
}
|
|
3951
|
-
function ScopeToolbar({ scope
|
|
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
|
-
);
|
|
4916
|
+
function ScopeToolbar({ scope }) {
|
|
3967
4917
|
const session = scope.session;
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
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
|
-
] });
|
|
4918
|
+
const standaloneParts = useStandaloneParts(session ?? null);
|
|
4919
|
+
const panelsElsewhere = session !== void 0 && (windowRole.kind === "main" || windowRole.parts === "chat") && standaloneParts !== null && hasPanels(standaloneParts);
|
|
4920
|
+
if (!panelsElsewhere || !session) return null;
|
|
4921
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { align: "end", label: "Side panels are in their own window", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4922
|
+
IconButton,
|
|
4923
|
+
{
|
|
4924
|
+
icon: "i-ph-arrow-square-out",
|
|
4925
|
+
label: "Side panels are in their own window",
|
|
4926
|
+
title: "",
|
|
4927
|
+
onClick: () => void window.api.windows.focus(session)
|
|
4928
|
+
}
|
|
4929
|
+
) });
|
|
4025
4930
|
}
|
|
4026
4931
|
function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
|
|
4027
4932
|
const {
|
|
@@ -4076,20 +4981,16 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
|
|
|
4076
4981
|
moveSession
|
|
4077
4982
|
]
|
|
4078
4983
|
);
|
|
4984
|
+
const extensionMenu = useExtensionSessionMenuItems(session.id);
|
|
4985
|
+
const allMenuItems = reactExports.useMemo(() => [...menuItems, ...extensionMenu], [menuItems, extensionMenu]);
|
|
4079
4986
|
const { hostById } = useHosts();
|
|
4080
4987
|
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
4988
|
const scope = reactExports.useMemo(
|
|
4085
4989
|
() => scopeOfSession(session),
|
|
4086
4990
|
// The fields that make the scope, not the row object (rebuilt on every list refresh).
|
|
4087
4991
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4088
4992
|
[session.id, session.cwd, session.projectRoot, session.workspace]
|
|
4089
4993
|
);
|
|
4090
|
-
reactExports.useEffect(() => {
|
|
4091
|
-
if (artifactsShown) void fetchArtifacts?.(session.id).catch(() => void 0);
|
|
4092
|
-
}, [artifactsShown, fetchArtifacts, session.id]);
|
|
4093
4994
|
const folderless = !session.cwd;
|
|
4094
4995
|
const pickFolder = async () => {
|
|
4095
4996
|
const picked = await window.api.folder.pick();
|
|
@@ -4123,7 +5024,10 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
|
|
|
4123
5024
|
* chevron itself. A standalone window has no sidebar toggle beside
|
|
4124
5025
|
* the lights: just clear them.
|
|
4125
5026
|
*/
|
|
4126
|
-
paddingLeft: windowRole.kind === "session" ? nativeAnchoredPx(84) : lightsInCenter ?
|
|
5027
|
+
paddingLeft: windowRole.kind === "session" ? nativeAnchoredPx(84) : lightsInCenter ? (
|
|
5028
|
+
// The extensions' title bar items sit after the toggle (`TitlebarSlot`).
|
|
5029
|
+
`calc(${nativeAnchoredPx(84)} + 36px + var(--zg-titlebar-w, 0px))`
|
|
5030
|
+
) : 16,
|
|
4127
5031
|
/**
|
|
4128
5032
|
* Tweened on the panel clock so the leading inset grows while the
|
|
4129
5033
|
* sidebar narrows (and shrinks while it widens): the header content
|
|
@@ -4131,7 +5035,9 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
|
|
|
4131
5035
|
*/
|
|
4132
5036
|
transitionProperty: "padding-left",
|
|
4133
5037
|
transitionDuration: "var(--zg-panel-ms)",
|
|
4134
|
-
transitionTimingFunction: "var(--zg-panel-ease)"
|
|
5038
|
+
transitionTimingFunction: "var(--zg-panel-ease)",
|
|
5039
|
+
// Room for the side panel's toggle over the header's end while the panel is closed (`Center`).
|
|
5040
|
+
paddingRight: "calc(1rem + var(--zg-panel-corner-inset, 0px))"
|
|
4135
5041
|
}),
|
|
4136
5042
|
[lightsInCenter]
|
|
4137
5043
|
);
|
|
@@ -4154,9 +5060,10 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
|
|
|
4154
5060
|
onRename: (next) => renameSession(session.id, next),
|
|
4155
5061
|
renaming,
|
|
4156
5062
|
onRenamingChange: setRenaming,
|
|
4157
|
-
menuItems,
|
|
5063
|
+
menuItems: allMenuItems,
|
|
4158
5064
|
onMenuOpenChange: setMenuOpen,
|
|
4159
|
-
|
|
5065
|
+
sessionId: session.id,
|
|
5066
|
+
toolbar: /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeToolbar, { scope }),
|
|
4160
5067
|
style
|
|
4161
5068
|
}
|
|
4162
5069
|
);
|
|
@@ -4180,7 +5087,8 @@ function HeaderBand({ scope, lightsInCenter }) {
|
|
|
4180
5087
|
* (see SessionHeader): 84 DIP chevron origin (zoom-compensated via
|
|
4181
5088
|
* `nativeAnchoredPx`) + 28px CSS chevron width.
|
|
4182
5089
|
*/
|
|
4183
|
-
|
|
5090
|
+
// Plus the extensions' title bar items after the chevron (`TitlebarSlot`).
|
|
5091
|
+
paddingLeft: lightsInCenter ? `calc(${nativeAnchoredPx(84)} + 28px + var(--zg-titlebar-w, 0px))` : 0,
|
|
4184
5092
|
/**
|
|
4185
5093
|
* Matches `SessionHeader`'s padding tween — the lights (animated in
|
|
4186
5094
|
* App.tsx) slide INTO this band over `--zg-panel-ms` instead of the
|
|
@@ -4188,7 +5096,9 @@ function HeaderBand({ scope, lightsInCenter }) {
|
|
|
4188
5096
|
*/
|
|
4189
5097
|
transitionProperty: "padding-left",
|
|
4190
5098
|
transitionDuration: "var(--zg-panel-ms)",
|
|
4191
|
-
transitionTimingFunction: "var(--zg-panel-ease)"
|
|
5099
|
+
transitionTimingFunction: "var(--zg-panel-ease)",
|
|
5100
|
+
// Room for the side panel's toggle over the band's end while the panel is closed (`Center`).
|
|
5101
|
+
paddingRight: "calc(1rem + var(--zg-panel-corner-inset, 0px))"
|
|
4192
5102
|
},
|
|
4193
5103
|
children: scope && /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeToolbar, { scope })
|
|
4194
5104
|
}
|
|
@@ -4219,9 +5129,9 @@ function useSendPrompt({ session, running, draft: draft2, hostId, glideToBottom
|
|
|
4219
5129
|
draft: draft2,
|
|
4220
5130
|
hostId,
|
|
4221
5131
|
reveal: glideToBottom,
|
|
4222
|
-
createSession: async (
|
|
5132
|
+
createSession: async (request2) => {
|
|
4223
5133
|
try {
|
|
4224
|
-
const created = await sessions.createSession(
|
|
5134
|
+
const created = await sessions.createSession(request2, { fromDraft: draftScope() });
|
|
4225
5135
|
return { id: created.id, provisioning: created.environment?.state === "provisioning" };
|
|
4226
5136
|
} catch (err) {
|
|
4227
5137
|
throw new Error(ipcErrorMessage(err));
|
|
@@ -4301,14 +5211,24 @@ const ConversationPane = reactExports.memo(function ConversationPane2({
|
|
|
4301
5211
|
const meters = useSessionMeters(session, running);
|
|
4302
5212
|
const { defaultFolder, setDefaultFolder, sessions } = useSessions();
|
|
4303
5213
|
const { servers } = useHosts();
|
|
5214
|
+
const draftRequest = useDraftRequest();
|
|
4304
5215
|
const draft2 = useDraftTarget({
|
|
4305
5216
|
session,
|
|
4306
5217
|
defaultFolder,
|
|
4307
5218
|
setDefaultFolder,
|
|
4308
5219
|
sessions,
|
|
4309
5220
|
servers,
|
|
4310
|
-
onLocalFolder: publishDraftFolder
|
|
5221
|
+
onLocalFolder: publishDraftFolder,
|
|
5222
|
+
request: draftRequest
|
|
4311
5223
|
});
|
|
5224
|
+
reactExports.useEffect(() => {
|
|
5225
|
+
if (!isNewSession) clearDraftRequest();
|
|
5226
|
+
}, [isNewSession]);
|
|
5227
|
+
const chatDraft2 = isNewSession && !draft2.server && draft2.folderPath === "";
|
|
5228
|
+
reactExports.useEffect(() => {
|
|
5229
|
+
publishChatDraft(chatDraft2);
|
|
5230
|
+
return () => publishChatDraft(false);
|
|
5231
|
+
}, [chatDraft2]);
|
|
4312
5232
|
const hostId = session ? session.hostId ?? null : draft2.server?.id ?? null;
|
|
4313
5233
|
const { scrollRef, page, loadEarlier, pinned, scrolledFromTop, glideToBottom } = useTranscriptScroll(
|
|
4314
5234
|
sessionId,
|
|
@@ -4317,7 +5237,24 @@ const ConversationPane = reactExports.memo(function ConversationPane2({
|
|
|
4317
5237
|
const search = useComposerSearch(sessionId, scrollRef, actions.closeSearch);
|
|
4318
5238
|
const prompt = useSendPrompt({ session, running, draft: draft2, hostId, glideToBottom });
|
|
4319
5239
|
const veiled = useSettledReveal(sessionId, hydrated) && !isNewSession;
|
|
4320
|
-
const { showRowIcons } = useSettings().settings;
|
|
5240
|
+
const { showRowIcons, projectHome: projectHomeOn } = useSettings().settings;
|
|
5241
|
+
const projectHome = isNewSession && projectHomeOn === true;
|
|
5242
|
+
const composer = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5243
|
+
ConversationComposer,
|
|
5244
|
+
{
|
|
5245
|
+
session,
|
|
5246
|
+
running,
|
|
5247
|
+
scrolled: !projectHome && scrolledFromTop && !pinned,
|
|
5248
|
+
hostId,
|
|
5249
|
+
draft: draft2,
|
|
5250
|
+
prompt,
|
|
5251
|
+
search,
|
|
5252
|
+
searchOverlayOpen: searchOpen,
|
|
5253
|
+
meters,
|
|
5254
|
+
onOpenRunningWork: actions.openRunningWork,
|
|
5255
|
+
onOpenEnvironmentSettings: actions.openEnvironmentSettings
|
|
5256
|
+
}
|
|
5257
|
+
);
|
|
4321
5258
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-h-0 min-w-0 flex flex-col", children: [
|
|
4322
5259
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4323
5260
|
ConversationHeader,
|
|
@@ -4343,14 +5280,14 @@ const ConversationPane = reactExports.memo(function ConversationPane2({
|
|
|
4343
5280
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4344
5281
|
"div",
|
|
4345
5282
|
{
|
|
4346
|
-
className: `mx-auto w-full max-w-[1160px] ${isNewSession ? "h-full" : ""}`,
|
|
5283
|
+
className: `mx-auto w-full max-w-[1160px] ${isNewSession && !projectHome ? "h-full" : ""}`,
|
|
4347
5284
|
"data-veiled": veiled ? "" : void 0,
|
|
4348
5285
|
"aria-busy": veiled ? true : void 0,
|
|
4349
5286
|
style: veiled ? { opacity: 0 } : { opacity: 1, transition: "opacity var(--zg-motion-fade)" },
|
|
4350
5287
|
children: session ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
4351
5288
|
/* @__PURE__ */ jsxRuntimeExports.jsx(LoadEarlierRow, { page, onLoad: () => loadEarlier(session.id), showIcon: showRowIcons }),
|
|
4352
5289
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Transcript", resetKey: session.id, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptPane, { sessionId: session.id, running }) })
|
|
4353
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(WelcomeScreen, {})
|
|
5290
|
+
] }) : projectHome ? /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectHomeScreen, { draft: draft2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(WelcomeScreen, {})
|
|
4354
5291
|
}
|
|
4355
5292
|
)
|
|
4356
5293
|
}
|
|
@@ -4368,22 +5305,7 @@ const ConversationPane = reactExports.memo(function ConversationPane2({
|
|
|
4368
5305
|
),
|
|
4369
5306
|
search.query !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(SearchHighlightStyle, {})
|
|
4370
5307
|
] }),
|
|
4371
|
-
|
|
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
|
-
)
|
|
5308
|
+
composer
|
|
4387
5309
|
] })
|
|
4388
5310
|
] });
|
|
4389
5311
|
});
|
|
@@ -5877,8 +6799,8 @@ function SideTab({ parentId, cwd }) {
|
|
|
5877
6799
|
}
|
|
5878
6800
|
);
|
|
5879
6801
|
}
|
|
5880
|
-
const DesktopDiffsTab = reactExports.lazy(() => __vitePreload(() => import("./file-tabs-
|
|
5881
|
-
const DesktopFilesTab = reactExports.lazy(() => __vitePreload(() => import("./file-tabs-
|
|
6802
|
+
const DesktopDiffsTab = reactExports.lazy(() => __vitePreload(() => import("./file-tabs-BCf1cAWp.js"), true ? __vite__mapDeps([0,1,2,3,4,5,6,7,8,9]) : void 0, import.meta.url).then((m) => ({ default: m.DesktopDiffsTab })));
|
|
6803
|
+
const DesktopFilesTab = reactExports.lazy(() => __vitePreload(() => import("./file-tabs-BCf1cAWp.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
6804
|
const KEEP_ALIVE = /* @__PURE__ */ new Set([
|
|
5883
6805
|
ARTIFACTS_PANEL_ID,
|
|
5884
6806
|
BROWSER_PANEL_ID,
|
|
@@ -5889,6 +6811,17 @@ const KEEP_ALIVE = /* @__PURE__ */ new Set([
|
|
|
5889
6811
|
SIDE_PANEL_ID,
|
|
5890
6812
|
TODOS_PANEL_ID
|
|
5891
6813
|
]);
|
|
6814
|
+
const DESCRIPTIONS = {
|
|
6815
|
+
[ARTIFACTS_PANEL_ID]: "Pull requests, branches and commits the session made",
|
|
6816
|
+
[DIFFS_PANEL_ID]: "The agent's edits and the working tree",
|
|
6817
|
+
[FILES_PANEL_ID]: "The folder as a tree, with a viewer and an editor",
|
|
6818
|
+
[TERMINAL_PANEL_ID]: "Terminals where the session runs",
|
|
6819
|
+
[BROWSER_PANEL_ID]: "A browser for the app you are building",
|
|
6820
|
+
[INBOX_PANEL_ID]: "Plans and questions waiting for you",
|
|
6821
|
+
[TODOS_PANEL_ID]: "The agent's todo list",
|
|
6822
|
+
[QUEUE_PANEL_ID]: "Messages waiting for the run to end",
|
|
6823
|
+
[SIDE_PANEL_ID]: "A side chat beside this session"
|
|
6824
|
+
};
|
|
5892
6825
|
function tabBodyKey(scope) {
|
|
5893
6826
|
return [scopeKey(scope), scope.cwd, scope.root, scope.workspace ?? ""].join("\0");
|
|
5894
6827
|
}
|
|
@@ -5900,7 +6833,9 @@ function useTabRegistry(scope) {
|
|
|
5900
6833
|
render: (tab) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabBody, { tab, scope }),
|
|
5901
6834
|
keepAlive: (tab) => tab.builtin && KEEP_ALIVE.has(tab.id),
|
|
5902
6835
|
snap: (tab) => tab.id === BROWSER_PANEL_ID,
|
|
5903
|
-
wrap: (tab, body) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabBoundary, { tab, children: body })
|
|
6836
|
+
wrap: (tab, body) => /* @__PURE__ */ jsxRuntimeExports.jsx(TabBoundary, { tab, children: body }),
|
|
6837
|
+
// An extension's panel names its extension.
|
|
6838
|
+
describe: (tab) => tab.builtin ? DESCRIPTIONS[tab.id] : `From ${tab.owner}`
|
|
5904
6839
|
}),
|
|
5905
6840
|
// Keyed by the scope's identity, not its object.
|
|
5906
6841
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -5940,7 +6875,7 @@ function TabBody({ tab, scope }) {
|
|
|
5940
6875
|
}
|
|
5941
6876
|
function ExtensionTabBody({ id }) {
|
|
5942
6877
|
const { contentFor } = usePanelContent();
|
|
5943
|
-
const { act } = usePanelActions();
|
|
6878
|
+
const { act, refresh } = usePanelActions();
|
|
5944
6879
|
const entry = contentFor(id);
|
|
5945
6880
|
const onAction = reactExports.useCallback(
|
|
5946
6881
|
(actionId, payload) => {
|
|
@@ -5948,6 +6883,18 @@ function ExtensionTabBody({ id }) {
|
|
|
5948
6883
|
},
|
|
5949
6884
|
[act, id]
|
|
5950
6885
|
);
|
|
6886
|
+
const onControl = reactExports.useCallback(
|
|
6887
|
+
(control, value) => {
|
|
6888
|
+
setPanelView(id, control, value);
|
|
6889
|
+
refresh(id);
|
|
6890
|
+
},
|
|
6891
|
+
[refresh, id]
|
|
6892
|
+
);
|
|
6893
|
+
const { setActiveSessionId } = useSessions();
|
|
6894
|
+
const onOpenSession = reactExports.useCallback(
|
|
6895
|
+
(sessionId) => setActiveSessionId(localSessionKey(sessionId)),
|
|
6896
|
+
[setActiveSessionId]
|
|
6897
|
+
);
|
|
5951
6898
|
const { file: onOpenPath } = useOpenTarget();
|
|
5952
6899
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5953
6900
|
PanelContentView,
|
|
@@ -5956,10 +6903,86 @@ function ExtensionTabBody({ id }) {
|
|
|
5956
6903
|
loading: entry.loading,
|
|
5957
6904
|
error: entry.error,
|
|
5958
6905
|
onAction,
|
|
6906
|
+
onControl,
|
|
6907
|
+
onOpenSession,
|
|
5959
6908
|
onOpenPath
|
|
5960
6909
|
}
|
|
5961
6910
|
);
|
|
5962
6911
|
}
|
|
6912
|
+
let expanded = false;
|
|
6913
|
+
const listeners$3 = /* @__PURE__ */ new Set();
|
|
6914
|
+
const subscribe$3 = (listener) => {
|
|
6915
|
+
listeners$3.add(listener);
|
|
6916
|
+
return () => listeners$3.delete(listener);
|
|
6917
|
+
};
|
|
6918
|
+
const read = () => expanded;
|
|
6919
|
+
function setPanelExpanded(next) {
|
|
6920
|
+
if (next === expanded) return;
|
|
6921
|
+
expanded = next;
|
|
6922
|
+
for (const listener of listeners$3) listener();
|
|
6923
|
+
}
|
|
6924
|
+
function usePanelExpanded() {
|
|
6925
|
+
return reactExports.useSyncExternalStore(subscribe$3, read, read);
|
|
6926
|
+
}
|
|
6927
|
+
function usePanelCorner(sessionId) {
|
|
6928
|
+
const panels = usePanelLayout();
|
|
6929
|
+
const budget = useLayoutBudget();
|
|
6930
|
+
const expanded2 = usePanelExpanded();
|
|
6931
|
+
const available = panels.tabs.length > 0;
|
|
6932
|
+
const open = available && panels.state.open && !(budget.panelMode === "overlay" && budget.panelHidden);
|
|
6933
|
+
const canPopOut = windowRole.kind === "main" && sessionId !== null;
|
|
6934
|
+
const buttons = 1 + 1 + (canPopOut ? 1 : 0);
|
|
6935
|
+
return {
|
|
6936
|
+
available,
|
|
6937
|
+
open,
|
|
6938
|
+
expanded: open && expanded2,
|
|
6939
|
+
canPopOut,
|
|
6940
|
+
/** What the panel's top-right strip keeps free (every button). */
|
|
6941
|
+
stripInset: `${panelCornerWidth(buttons)}px`,
|
|
6942
|
+
/** What the chat header keeps free while the panel is closed (the toggle). */
|
|
6943
|
+
headerInset: available && !open ? `${panelCornerWidth(1)}px` : "0px"
|
|
6944
|
+
};
|
|
6945
|
+
}
|
|
6946
|
+
function useArtifactCount(sessionId, available) {
|
|
6947
|
+
const count = countArtifacts(useSessionArtifacts(sessionId));
|
|
6948
|
+
const refresh = useSessionHost().artifacts?.refresh;
|
|
6949
|
+
reactExports.useEffect(() => {
|
|
6950
|
+
if (sessionId && available) void refresh?.(sessionId).catch(() => void 0);
|
|
6951
|
+
}, [sessionId, available, refresh]);
|
|
6952
|
+
return sessionId ? count : 0;
|
|
6953
|
+
}
|
|
6954
|
+
function PanelCornerHost({ sessionId }) {
|
|
6955
|
+
const corner = usePanelCorner(sessionId);
|
|
6956
|
+
const artifactCount = useArtifactCount(sessionId, corner.available);
|
|
6957
|
+
const panels = usePanelLayout();
|
|
6958
|
+
const actions = usePanelActions();
|
|
6959
|
+
const budget = useLayoutBudget();
|
|
6960
|
+
reactExports.useEffect(() => {
|
|
6961
|
+
if (!corner.open) setPanelExpanded(false);
|
|
6962
|
+
}, [corner.open]);
|
|
6963
|
+
if (!corner.available) return null;
|
|
6964
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6965
|
+
PanelCorner,
|
|
6966
|
+
{
|
|
6967
|
+
open: corner.open,
|
|
6968
|
+
expanded: corner.expanded,
|
|
6969
|
+
count: artifactCount,
|
|
6970
|
+
onToggle: () => {
|
|
6971
|
+
if (panels.state.open && budget.panelMode === "overlay" && budget.panelHidden) budget.revealPanel();
|
|
6972
|
+
else actions.toggle();
|
|
6973
|
+
},
|
|
6974
|
+
onExpand: () => setPanelExpanded(!corner.expanded),
|
|
6975
|
+
...corner.canPopOut && sessionId ? {
|
|
6976
|
+
onPopOut: () => {
|
|
6977
|
+
setPanelExpanded(false);
|
|
6978
|
+
window.api.windows.open(sessionId, "panels").catch((err) => console.error("[zidane-gui] panels window failed", err));
|
|
6979
|
+
}
|
|
6980
|
+
} : {},
|
|
6981
|
+
className: "absolute top-0 right-2 z-50",
|
|
6982
|
+
style: { height: `max(44px, ${nativeAnchoredPx(44)})` }
|
|
6983
|
+
}
|
|
6984
|
+
);
|
|
6985
|
+
}
|
|
5963
6986
|
const SidePanel = reactExports.memo(function SidePanel2({ scope, fill = false }) {
|
|
5964
6987
|
if (scope === null) return null;
|
|
5965
6988
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopedSidePanel, { scope, fill });
|
|
@@ -5967,7 +6990,6 @@ const SidePanel = reactExports.memo(function SidePanel2({ scope, fill = false })
|
|
|
5967
6990
|
function ScopedSidePanel({ scope, fill }) {
|
|
5968
6991
|
const sessionId = scope.session ?? null;
|
|
5969
6992
|
const panels = usePanelLayout();
|
|
5970
|
-
const actions = usePanelActions();
|
|
5971
6993
|
const budget = useLayoutBudget();
|
|
5972
6994
|
const registry = useTabRegistry(scope);
|
|
5973
6995
|
const overlay = !fill && budget.panelMode === "overlay";
|
|
@@ -5981,14 +7003,10 @@ function ScopedSidePanel({ scope, fill }) {
|
|
|
5981
7003
|
const split = splitPanelWidth(window.innerWidth, budget.sidebarWidth, LIMITS.panelWidth.min);
|
|
5982
7004
|
const wanted = layout.panelWidth ?? split;
|
|
5983
7005
|
const width = budget.panelWidth > 0 ? budget.panelWidth : wanted;
|
|
5984
|
-
const
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
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
|
-
};
|
|
7006
|
+
const corner = usePanelCorner(sessionId);
|
|
7007
|
+
const controls = fill ? { onClose: () => window.close(), closeLabel: "Close window" } : void 0;
|
|
7008
|
+
const lightsInCenter = useSidebarCollapsed() || budget.sidebarForcedCollapsed;
|
|
7009
|
+
const startInset = corner.expanded && lightsInCenter && windowRole.kind === "main" ? `calc(${nativeAnchoredPx(84)} + 36px + var(--zg-titlebar-w, 0px))` : void 0;
|
|
5992
7010
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5993
7011
|
SidePanel$1,
|
|
5994
7012
|
{
|
|
@@ -6002,7 +7020,9 @@ function ScopedSidePanel({ scope, fill }) {
|
|
|
6002
7020
|
onWidthCommit: (w) => {
|
|
6003
7021
|
updateScopeLayout(scope, panelDragResult(window.innerWidth, budget.sidebarWidth, w));
|
|
6004
7022
|
},
|
|
6005
|
-
controls,
|
|
7023
|
+
...controls ? { controls } : { endInset: corner.stripInset },
|
|
7024
|
+
...startInset ? { startInset } : {},
|
|
7025
|
+
expanded: corner.expanded,
|
|
6006
7026
|
overlay,
|
|
6007
7027
|
slidAway: budget.panelHidden,
|
|
6008
7028
|
onReveal: budget.revealPanel,
|
|
@@ -6036,6 +7056,12 @@ function Center(props) {
|
|
|
6036
7056
|
const { hostById } = useHosts();
|
|
6037
7057
|
const activeHost = activeSession?.hostId ? hostById(activeSession.hostId) : void 0;
|
|
6038
7058
|
const serverOffline = Boolean(activeSession?.hostId) && !hostReachable(activeHost);
|
|
7059
|
+
const corner = usePanelCorner(activeSession?.id ?? null);
|
|
7060
|
+
const cornerShown = panelsHere && scope !== null && corner.available;
|
|
7061
|
+
const mainStyle = reactExports.useMemo(
|
|
7062
|
+
() => ({ "--zg-panel-corner-inset": cornerShown ? corner.headerInset : "0px" }),
|
|
7063
|
+
[cornerShown, corner.headerInset]
|
|
7064
|
+
);
|
|
6039
7065
|
const mainRef = reactExports.useRef(null);
|
|
6040
7066
|
const shownSessionId = activeSession?.id ?? null;
|
|
6041
7067
|
const lastShownSessionId = reactExports.useRef(shownSessionId);
|
|
@@ -6065,13 +7091,14 @@ function Center(props) {
|
|
|
6065
7091
|
};
|
|
6066
7092
|
}, [shownSessionId, activeSpace.id]);
|
|
6067
7093
|
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: [
|
|
7094
|
+
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
7095
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
6070
7096
|
"div",
|
|
6071
7097
|
{
|
|
6072
7098
|
className: "zg-chat-column flex-1 min-w-0 flex flex-col h-full",
|
|
6073
7099
|
style: { paddingRight: overlayInset },
|
|
6074
7100
|
onPointerDownCapture: overlayInset > 0 ? budget.hidePanel : void 0,
|
|
7101
|
+
inert: cornerShown && corner.expanded || void 0,
|
|
6075
7102
|
children: [
|
|
6076
7103
|
activeSessionId !== null && activeSession === null ? (
|
|
6077
7104
|
// A session the list does not hold (still loading, or left out by the archive view): no draft composer.
|
|
@@ -6090,40 +7117,12 @@ function Center(props) {
|
|
|
6090
7117
|
]
|
|
6091
7118
|
}
|
|
6092
7119
|
),
|
|
6093
|
-
panelsHere && /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Side panel", framed: false, resetKey: scope ? scopeKey(scope) : null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SidePanel, { scope }) })
|
|
7120
|
+
panelsHere && /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Side panel", framed: false, resetKey: scope ? scopeKey(scope) : null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SidePanel, { scope }) }),
|
|
7121
|
+
cornerShown && /* @__PURE__ */ jsxRuntimeExports.jsx(PanelCornerHost, { sessionId: activeSession?.id ?? null })
|
|
6094
7122
|
] });
|
|
6095
7123
|
}
|
|
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
7124
|
const INITIAL = {
|
|
7125
|
+
channel: "npm",
|
|
6127
7126
|
running: "",
|
|
6128
7127
|
latest: null,
|
|
6129
7128
|
hasUpdate: false,
|
|
@@ -6247,12 +7246,14 @@ function CompactingIndicator() {
|
|
|
6247
7246
|
}
|
|
6248
7247
|
function Footer({ hasAuth, onOpenAuth, onOpenSettings, spaces }) {
|
|
6249
7248
|
const { settings } = useSettings();
|
|
7249
|
+
const { activeSessionId } = useSessionsList();
|
|
6250
7250
|
useUpdateChecks();
|
|
6251
7251
|
const update = useAppUpdate();
|
|
6252
7252
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6253
7253
|
SidebarFooter,
|
|
6254
7254
|
{
|
|
6255
7255
|
onOpenSettings,
|
|
7256
|
+
...activeSessionId ? { sessionId: activeSessionId } : {},
|
|
6256
7257
|
spaces,
|
|
6257
7258
|
...update ? { settingsNote: { text: update.title.split("\n")[0], warn: update.kind === "failed" } } : {},
|
|
6258
7259
|
status: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -6267,11 +7268,12 @@ function Footer({ hasAuth, onOpenAuth, onOpenSettings, spaces }) {
|
|
|
6267
7268
|
const searchSessions = (query, filter) => window.api.sessions.search(query, filter, "sidebar").then((response) => response.results);
|
|
6268
7269
|
const chromeInset = () => ({
|
|
6269
7270
|
height: nativeAnchoredPx(44),
|
|
6270
|
-
|
|
7271
|
+
// Plus the extensions' title bar items after the toggle (`TitlebarSlot`).
|
|
7272
|
+
width: `calc(${nativeAnchoredPx(84)} + 28px + var(--zg-titlebar-w, 0px))`
|
|
6271
7273
|
});
|
|
6272
7274
|
const commitWidth = (width) => appearanceHost.prefs.set({ sidebarWidth: width });
|
|
6273
7275
|
function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
|
|
6274
|
-
const
|
|
7276
|
+
const collapsed = useSidebarCollapsed();
|
|
6275
7277
|
const {
|
|
6276
7278
|
sessions,
|
|
6277
7279
|
activeSessionId,
|
|
@@ -6294,7 +7296,13 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
|
|
|
6294
7296
|
deleteSession,
|
|
6295
7297
|
listProjectSessions,
|
|
6296
7298
|
archiveSessions,
|
|
6297
|
-
deleteSessions
|
|
7299
|
+
deleteSessions,
|
|
7300
|
+
switcherSpaces,
|
|
7301
|
+
hiddenSpaces,
|
|
7302
|
+
setSpaceHidden,
|
|
7303
|
+
moveSpace,
|
|
7304
|
+
patchView,
|
|
7305
|
+
query
|
|
6298
7306
|
} = useSessions();
|
|
6299
7307
|
const { settings } = useSettings();
|
|
6300
7308
|
const { hosts } = useHosts();
|
|
@@ -6314,10 +7322,30 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
|
|
|
6314
7322
|
const onNewSessionIn = reactExports.useCallback(
|
|
6315
7323
|
(fullPath) => {
|
|
6316
7324
|
setDefaultFolder(fullPath);
|
|
7325
|
+
requestDraftOn(LOCAL_HOST_KEY, null);
|
|
6317
7326
|
onNewSessionRef.current();
|
|
6318
7327
|
},
|
|
6319
7328
|
[setDefaultFolder]
|
|
6320
7329
|
);
|
|
7330
|
+
const projectHome = settings.projectHome === true;
|
|
7331
|
+
const homeProject = useHomeProject();
|
|
7332
|
+
const onNewSessionOrFocus = reactExports.useCallback(() => {
|
|
7333
|
+
if (homeProject && activeSessionId == null) focusComposer();
|
|
7334
|
+
else onNewSessionRef.current();
|
|
7335
|
+
}, [homeProject, activeSessionId]);
|
|
7336
|
+
const chatsOpen = useChatDraft();
|
|
7337
|
+
const onOpenChats = reactExports.useCallback(() => {
|
|
7338
|
+
requestFolderlessDraft();
|
|
7339
|
+
onNewSessionRef.current();
|
|
7340
|
+
}, []);
|
|
7341
|
+
const onOpenProject = reactExports.useCallback(
|
|
7342
|
+
({ path, hostId }) => {
|
|
7343
|
+
if (!hostId) return onNewSessionIn(path);
|
|
7344
|
+
requestDraftOn(hostId, path);
|
|
7345
|
+
onNewSessionRef.current();
|
|
7346
|
+
},
|
|
7347
|
+
[onNewSessionIn]
|
|
7348
|
+
);
|
|
6321
7349
|
const moveSession = useMoveSession();
|
|
6322
7350
|
const sessionsRef = reactExports.useRef(sessions);
|
|
6323
7351
|
sessionsRef.current = sessions;
|
|
@@ -6336,10 +7364,31 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
|
|
|
6336
7364
|
hasAuth,
|
|
6337
7365
|
onOpenAuth,
|
|
6338
7366
|
onOpenSettings,
|
|
6339
|
-
spaces: spacesOn ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7367
|
+
spaces: spacesOn ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7368
|
+
SpaceSwitcher,
|
|
7369
|
+
{
|
|
7370
|
+
spaces: switcherSpaces,
|
|
7371
|
+
hidden: hiddenSpaces,
|
|
7372
|
+
activeId: activeSpace.id,
|
|
7373
|
+
onSelect: setActiveSpace,
|
|
7374
|
+
onHide: setSpaceHidden,
|
|
7375
|
+
onMove: moveSpace
|
|
7376
|
+
}
|
|
7377
|
+
) : void 0
|
|
6340
7378
|
}
|
|
6341
7379
|
),
|
|
6342
|
-
[
|
|
7380
|
+
[
|
|
7381
|
+
hasAuth,
|
|
7382
|
+
onOpenAuth,
|
|
7383
|
+
onOpenSettings,
|
|
7384
|
+
spacesOn,
|
|
7385
|
+
switcherSpaces,
|
|
7386
|
+
hiddenSpaces,
|
|
7387
|
+
activeSpace.id,
|
|
7388
|
+
setActiveSpace,
|
|
7389
|
+
setSpaceHidden,
|
|
7390
|
+
moveSpace
|
|
7391
|
+
]
|
|
6343
7392
|
);
|
|
6344
7393
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
6345
7394
|
SessionSidebar,
|
|
@@ -6360,8 +7409,11 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
|
|
|
6360
7409
|
live: sidebarLive,
|
|
6361
7410
|
runDetails,
|
|
6362
7411
|
artifactBadges: settings.artifacts !== false,
|
|
6363
|
-
onNewSession,
|
|
7412
|
+
onNewSession: onNewSessionOrFocus,
|
|
6364
7413
|
onNewSessionIn,
|
|
7414
|
+
...projectHome ? { onOpenProject, openProject: homeProject } : {},
|
|
7415
|
+
onOpenChats,
|
|
7416
|
+
chatsOpen,
|
|
6365
7417
|
onRename: renameSession,
|
|
6366
7418
|
onSetArchived: setArchived,
|
|
6367
7419
|
onSetFavorite: setFavorite,
|
|
@@ -6372,9 +7424,11 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
|
|
|
6372
7424
|
onArchiveProject: projectSessions.archive,
|
|
6373
7425
|
onDeleteProject: projectSessions.remove,
|
|
6374
7426
|
keyboardBlocked,
|
|
7427
|
+
query,
|
|
7428
|
+
onViewChange: patchView,
|
|
6375
7429
|
filter: /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarFilters, {}),
|
|
6376
7430
|
footer,
|
|
6377
|
-
collapsed
|
|
7431
|
+
collapsed,
|
|
6378
7432
|
width: sidebarWidth,
|
|
6379
7433
|
onWidthCommit: commitWidth,
|
|
6380
7434
|
chromeInset: chromeInset()
|
|
@@ -6382,24 +7436,56 @@ function Sidebar({ onNewSession, hasAuth, onOpenAuth, onOpenSettings }) {
|
|
|
6382
7436
|
);
|
|
6383
7437
|
}
|
|
6384
7438
|
function SidebarFilters() {
|
|
6385
|
-
const {
|
|
7439
|
+
const { availableProjects, query, spacesOn, spaces, patchView, saveViewAsSpace } = useSessions();
|
|
6386
7440
|
const { enabled: remoteHosts } = useHosts();
|
|
6387
|
-
const
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
7441
|
+
const onSaveView = useSaveViewAsSpace(saveViewAsSpace, spaces);
|
|
7442
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7443
|
+
SidebarFilterMenu,
|
|
7444
|
+
{
|
|
7445
|
+
view: query.view,
|
|
7446
|
+
projects: availableProjects,
|
|
7447
|
+
onChange: patchView,
|
|
7448
|
+
hosts: remoteHosts,
|
|
7449
|
+
agents: query.agents,
|
|
7450
|
+
query,
|
|
7451
|
+
...spacesOn && onSaveView ? { onSaveView } : {}
|
|
7452
|
+
}
|
|
7453
|
+
);
|
|
7454
|
+
}
|
|
7455
|
+
const TITLEBAR_WIDTH_VAR = "--zg-titlebar-w";
|
|
7456
|
+
const GAP_PX = 8;
|
|
7457
|
+
function publishTitlebarWidth(element, root = document.documentElement) {
|
|
7458
|
+
const apply = () => {
|
|
7459
|
+
const width = element.getBoundingClientRect().width;
|
|
7460
|
+
root.style.setProperty(TITLEBAR_WIDTH_VAR, width > 0 ? `${Math.ceil(width) + GAP_PX}px` : "0px");
|
|
7461
|
+
};
|
|
7462
|
+
apply();
|
|
7463
|
+
const observer = typeof ResizeObserver === "function" ? new ResizeObserver(apply) : null;
|
|
7464
|
+
observer?.observe(element);
|
|
7465
|
+
return () => {
|
|
7466
|
+
observer?.disconnect();
|
|
7467
|
+
root.style.removeProperty(TITLEBAR_WIDTH_VAR);
|
|
7468
|
+
};
|
|
7469
|
+
}
|
|
7470
|
+
function TitlebarSlot({ sessionId }) {
|
|
7471
|
+
const ref = reactExports.useRef(null);
|
|
7472
|
+
reactExports.useLayoutEffect(() => ref.current ? publishTitlebarWidth(ref.current) : void 0, []);
|
|
7473
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7474
|
+
"div",
|
|
7475
|
+
{
|
|
7476
|
+
ref,
|
|
7477
|
+
"data-titlebar-slot": true,
|
|
7478
|
+
className: "zg-no-drag fixed z-30 flex items-center gap-1 overflow-hidden empty:hidden",
|
|
7479
|
+
style: {
|
|
7480
|
+
// Right of the toggle (84 DIP + its 28px, then the same 8px gap).
|
|
7481
|
+
left: `calc(${nativeAnchoredPx(84)} + 36px)`,
|
|
7482
|
+
top: `calc((${nativeAnchoredPx(44)} - 28px) / 2)`,
|
|
7483
|
+
height: 28,
|
|
7484
|
+
maxWidth: "min(320px, 40vw)"
|
|
7485
|
+
},
|
|
7486
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionSlot, { at: "app.titlebar", ...sessionId ? { sessionId } : {}, className: "flex-nowrap" })
|
|
7487
|
+
}
|
|
6401
7488
|
);
|
|
6402
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarFilterMenu, { view, projects: availableProjects, onChange, hosts: remoteHosts });
|
|
6403
7489
|
}
|
|
6404
7490
|
function CreateExtensionModal({ cwd, onCancel, onClose }) {
|
|
6405
7491
|
const { createSession } = useSessionsActions();
|
|
@@ -6415,10 +7501,6 @@ function CreateExtensionModal({ cwd, onCancel, onClose }) {
|
|
|
6415
7501
|
}
|
|
6416
7502
|
);
|
|
6417
7503
|
}
|
|
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
7504
|
const TERMINAL_TOOLS = {
|
|
6423
7505
|
wait_task: "task_id",
|
|
6424
7506
|
terminal_read: "id",
|
|
@@ -6493,6 +7575,7 @@ function SessionDetailsModal({ session: initialSession, onClose }) {
|
|
|
6493
7575
|
const isMain = session.isMain === true;
|
|
6494
7576
|
session.status === "running";
|
|
6495
7577
|
const { hostById } = useHosts();
|
|
7578
|
+
const display = useDisplayPath();
|
|
6496
7579
|
const server = session.hostId ? hostById(session.hostId) : void 0;
|
|
6497
7580
|
const machine = session.environment ? parseMachineKind(session.environment.kind) : null;
|
|
6498
7581
|
const folderLocation = session.hostId ? server ? null : { kind: "server-gone" } : machine ? { kind: "machine", name: machine.name } : session.workspace ? { kind: "sandbox" } : null;
|
|
@@ -6518,7 +7601,7 @@ function SessionDetailsModal({ session: initialSession, onClose }) {
|
|
|
6518
7601
|
...session.createdAt ? { createdAt: session.createdAt } : {},
|
|
6519
7602
|
...session.updatedAt ? { updatedAt: session.updatedAt } : {},
|
|
6520
7603
|
cwd: session.cwd,
|
|
6521
|
-
...session.cwd ? { folderDisplay: compactPath(session.cwd, 56) } : {},
|
|
7604
|
+
...session.cwd ? { folderDisplay: compactPath(display.path(session.cwd, session.hostId), 56) } : {},
|
|
6522
7605
|
...session.projectRoot ? { projectRoot: session.projectRoot } : {},
|
|
6523
7606
|
isMain,
|
|
6524
7607
|
folderLocation
|
|
@@ -6572,6 +7655,159 @@ function usePinnedAccount(session) {
|
|
|
6572
7655
|
const found = catalog.find((e) => e.providerKey === providerKey && e.account?.id === account)?.account;
|
|
6573
7656
|
return found ? { label: found.label } : { label: "", signedOut: true };
|
|
6574
7657
|
}
|
|
7658
|
+
const EMPTY_SETTINGS = {
|
|
7659
|
+
schema: { categories: [], items: [] },
|
|
7660
|
+
actions: [],
|
|
7661
|
+
values: {},
|
|
7662
|
+
locked: []
|
|
7663
|
+
};
|
|
7664
|
+
const NO_INTEGRATIONS = [];
|
|
7665
|
+
const noop = { get: () => EMPTY_SETTINGS, subscribe: () => () => {
|
|
7666
|
+
} };
|
|
7667
|
+
const noIntegrations = { get: () => NO_INTEGRATIONS, subscribe: () => () => {
|
|
7668
|
+
} };
|
|
7669
|
+
const KIND_LABEL = {
|
|
7670
|
+
tools: "tool",
|
|
7671
|
+
agents: "agent",
|
|
7672
|
+
subagents: "sub-agent",
|
|
7673
|
+
models: "model",
|
|
7674
|
+
providers: "provider",
|
|
7675
|
+
mcp: "MCP server",
|
|
7676
|
+
skills: "skill"
|
|
7677
|
+
};
|
|
7678
|
+
function provenanceLabel(p) {
|
|
7679
|
+
if (p.removed) return `hidden by ${p.removedBy ?? p.changedBy.at(-1) ?? "an extension"}`;
|
|
7680
|
+
if (p.origin.kind === "extension" && p.changedBy.length <= 1)
|
|
7681
|
+
return `added by ${p.origin.id ?? p.changedBy[0] ?? "an extension"}`;
|
|
7682
|
+
return `modified by ${p.changedBy.join(", ")}`;
|
|
7683
|
+
}
|
|
7684
|
+
function errorText$1(err) {
|
|
7685
|
+
const error = extensionsErrorOf(err);
|
|
7686
|
+
if (error.code === "refused")
|
|
7687
|
+
return error.message ?? (error.reason === "locked" ? "Locked by the config file." : "Refused.");
|
|
7688
|
+
if (error.code === "unavailable") return "Not available here.";
|
|
7689
|
+
return error.message;
|
|
7690
|
+
}
|
|
7691
|
+
function IntegrationRow({ integration }) {
|
|
7692
|
+
const host2 = useExtensionsHost();
|
|
7693
|
+
const [keys, setKeys] = reactExports.useState({});
|
|
7694
|
+
const [busy, setBusy] = reactExports.useState(false);
|
|
7695
|
+
const [error, setError] = reactExports.useState(null);
|
|
7696
|
+
const run = (work) => {
|
|
7697
|
+
setBusy(true);
|
|
7698
|
+
setError(null);
|
|
7699
|
+
void Promise.resolve(work()).catch((err) => setError(errorText$1(err))).finally(() => setBusy(false));
|
|
7700
|
+
};
|
|
7701
|
+
const connections = integration.connections ?? (integration.connection ? [integration.connection] : []);
|
|
7702
|
+
const connected = connections.length > 0;
|
|
7703
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex flex-col gap-1.5 py-2", "data-integration": integration.id, children: [
|
|
7704
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7705
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[13px] font-medium", children: integration.name }),
|
|
7706
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[12px] text-[var(--zg-text-muted)]", children: !connected ? "Not connected" : connections.length === 1 ? "Connected" : `${connections.length} accounts` })
|
|
7707
|
+
] }),
|
|
7708
|
+
integration.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[12px] text-[var(--zg-text-muted)]", children: integration.description }),
|
|
7709
|
+
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: [
|
|
7710
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: c.label ?? c.account }),
|
|
7711
|
+
c.isDefault ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta", children: "Default" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7712
|
+
"button",
|
|
7713
|
+
{
|
|
7714
|
+
type: "button",
|
|
7715
|
+
className: "text-[12px] underline",
|
|
7716
|
+
disabled: busy,
|
|
7717
|
+
"aria-label": `Make ${c.label ?? c.account} the default`,
|
|
7718
|
+
onClick: () => run(() => host2?.integrations?.setDefault(integration.id, c.account)),
|
|
7719
|
+
children: "Make default"
|
|
7720
|
+
}
|
|
7721
|
+
),
|
|
7722
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7723
|
+
"button",
|
|
7724
|
+
{
|
|
7725
|
+
type: "button",
|
|
7726
|
+
className: "ml-auto text-[12px] underline",
|
|
7727
|
+
disabled: busy,
|
|
7728
|
+
"aria-label": `Disconnect ${c.label ?? c.account}`,
|
|
7729
|
+
onClick: () => run(() => host2?.integrations?.disconnect(integration.id, { account: c.account })),
|
|
7730
|
+
children: "Disconnect"
|
|
7731
|
+
}
|
|
7732
|
+
)
|
|
7733
|
+
] }, c.account)) }),
|
|
7734
|
+
integration.methods.map(
|
|
7735
|
+
(method) => method.type === "apiKey" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
7736
|
+
"form",
|
|
7737
|
+
{
|
|
7738
|
+
className: "flex items-center gap-2",
|
|
7739
|
+
onSubmit: (e) => {
|
|
7740
|
+
e.preventDefault();
|
|
7741
|
+
run(
|
|
7742
|
+
() => host2?.integrations?.connect(integration.id, { methodId: method.id, key: keys[method.id] ?? "" }).then(() => setKeys((k) => ({ ...k, [method.id]: "" })))
|
|
7743
|
+
);
|
|
7744
|
+
},
|
|
7745
|
+
children: [
|
|
7746
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7747
|
+
"input",
|
|
7748
|
+
{
|
|
7749
|
+
type: "password",
|
|
7750
|
+
"aria-label": method.label,
|
|
7751
|
+
placeholder: method.placeholder ?? method.label,
|
|
7752
|
+
value: keys[method.id] ?? "",
|
|
7753
|
+
onChange: (e) => setKeys((k) => ({ ...k, [method.id]: e.target.value })),
|
|
7754
|
+
className: "zg-well flex-1 min-w-0 rounded px-2 py-1 text-[12px]"
|
|
7755
|
+
}
|
|
7756
|
+
),
|
|
7757
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "submit", disabled: busy || !keys[method.id], className: "text-[12px] underline", children: connected ? "Add account" : "Connect" })
|
|
7758
|
+
]
|
|
7759
|
+
},
|
|
7760
|
+
method.id
|
|
7761
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7762
|
+
"button",
|
|
7763
|
+
{
|
|
7764
|
+
type: "button",
|
|
7765
|
+
disabled: busy,
|
|
7766
|
+
className: "self-start text-[12px] underline",
|
|
7767
|
+
onClick: () => run(() => host2?.integrations?.connect(integration.id, { methodId: method.id })),
|
|
7768
|
+
children: connected ? `Add account with ${method.label}` : method.label
|
|
7769
|
+
},
|
|
7770
|
+
method.id
|
|
7771
|
+
)
|
|
7772
|
+
),
|
|
7773
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { role: "alert", className: "text-[12px] text-[var(--zg-danger)]", children: error })
|
|
7774
|
+
] });
|
|
7775
|
+
}
|
|
7776
|
+
function ExtensionSettingsSection() {
|
|
7777
|
+
const host2 = useExtensionsHost();
|
|
7778
|
+
const wire2 = useReadable(host2?.settings?.wire ?? noop);
|
|
7779
|
+
const integrations = useReadable(host2?.integrations?.list ?? noIntegrations);
|
|
7780
|
+
if (!host2) return null;
|
|
7781
|
+
const locked = wire2.locked;
|
|
7782
|
+
const changes = wire2.provenance ?? [];
|
|
7783
|
+
if (locked.length === 0 && changes.length === 0 && integrations.length === 0) return null;
|
|
7784
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { "aria-label": "Extension settings", className: "flex flex-col gap-4", children: [
|
|
7785
|
+
locked.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
7786
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[12px] uppercase tracking-wide text-[var(--zg-text-muted)]", children: "Set by the config file" }),
|
|
7787
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "text-[12px]", children: locked.map((id) => {
|
|
7788
|
+
const [extension = "", key2 = ""] = id.split(":");
|
|
7789
|
+
const value = wire2.values[extension]?.[key2];
|
|
7790
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "flex gap-2 py-0.5", "data-locked-setting": id, children: [
|
|
7791
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono", children: id }),
|
|
7792
|
+
value !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-text-muted)]", children: String(value) }),
|
|
7793
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-auto text-[var(--zg-text-muted)]", children: "locked" })
|
|
7794
|
+
] }, id);
|
|
7795
|
+
}) })
|
|
7796
|
+
] }),
|
|
7797
|
+
changes.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
7798
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[12px] uppercase tracking-wide text-[var(--zg-text-muted)]", children: "Changed by extensions" }),
|
|
7799
|
+
/* @__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: [
|
|
7800
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-text-muted)]", children: KIND_LABEL[p.kind] }),
|
|
7801
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono", children: p.id }),
|
|
7802
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-auto text-[var(--zg-text-muted)]", children: provenanceLabel(p) })
|
|
7803
|
+
] }, `${p.kind}:${p.id}`)) })
|
|
7804
|
+
] }),
|
|
7805
|
+
integrations.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
7806
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-[12px] uppercase tracking-wide text-[var(--zg-text-muted)]", children: "Integrations" }),
|
|
7807
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "divide-y divide-[var(--zg-border)]", children: integrations.map((integration) => /* @__PURE__ */ jsxRuntimeExports.jsx(IntegrationRow, { integration }, integration.id)) })
|
|
7808
|
+
] })
|
|
7809
|
+
] });
|
|
7810
|
+
}
|
|
6575
7811
|
const LABELS = {
|
|
6576
7812
|
home: "Show the zidane folder in Finder",
|
|
6577
7813
|
skills: "Show the skills folder in Finder",
|
|
@@ -6761,7 +7997,6 @@ const PanelPage = reactExports.memo(function PanelPage2({
|
|
|
6761
7997
|
onClose,
|
|
6762
7998
|
onCreateExtension
|
|
6763
7999
|
}) {
|
|
6764
|
-
const { visible } = useSettingsSection();
|
|
6765
8000
|
if (server) {
|
|
6766
8001
|
switch (id) {
|
|
6767
8002
|
case "accounts":
|
|
@@ -6800,9 +8035,16 @@ const PanelPage = reactExports.memo(function PanelPage2({
|
|
|
6800
8035
|
case "accounts":
|
|
6801
8036
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopProvidersSection, { cwd });
|
|
6802
8037
|
case "extensions":
|
|
6803
|
-
return
|
|
8038
|
+
return (
|
|
8039
|
+
// The extensions' settings rows are their own pages in the sidebar (the kit's `useExtensionSettingsSections`).
|
|
8040
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DesktopExtensionsSection, { cwd, onClose, onCreateExtension, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionSettingsSection, {}) })
|
|
8041
|
+
);
|
|
6804
8042
|
}
|
|
6805
8043
|
});
|
|
8044
|
+
function UpdateChannelNote() {
|
|
8045
|
+
const { channel } = useUpdateState();
|
|
8046
|
+
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." });
|
|
8047
|
+
}
|
|
6806
8048
|
function ClearSiteDataRow({ cwd }) {
|
|
6807
8049
|
const [state2, setState] = reactExports.useState("idle");
|
|
6808
8050
|
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 +8168,9 @@ const SectionsPage = reactExports.memo(function SectionsPage2({
|
|
|
6926
8168
|
enabled: settings.useDaemon === true,
|
|
6927
8169
|
onOpenDaemon: () => select("advanced", "useDaemon")
|
|
6928
8170
|
}
|
|
6929
|
-
)
|
|
8171
|
+
),
|
|
8172
|
+
// About this app: a server's settings say nothing of how it updates.
|
|
8173
|
+
updates: () => server ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(UpdateChannelNote, {})
|
|
6930
8174
|
}
|
|
6931
8175
|
}
|
|
6932
8176
|
);
|
|
@@ -7003,6 +8247,7 @@ function AppVersion() {
|
|
|
7003
8247
|
void navigator.clipboard.writeText(version).then(() => setCopied(true));
|
|
7004
8248
|
},
|
|
7005
8249
|
hint: "Copy version",
|
|
8250
|
+
icon: null,
|
|
7006
8251
|
title: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta", children: copied ? "copied" : `Zidane ${version}` }),
|
|
7007
8252
|
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
8253
|
}
|
|
@@ -7031,6 +8276,9 @@ function UpgradeButton() {
|
|
|
7031
8276
|
);
|
|
7032
8277
|
}
|
|
7033
8278
|
const NO_ACTIONS = [];
|
|
8279
|
+
const NO_STORE = { get: () => void 0, subscribe: () => () => {
|
|
8280
|
+
} };
|
|
8281
|
+
const NO_SEARCH = [];
|
|
7034
8282
|
function SettingsModal({ initialHostId, ...props }) {
|
|
7035
8283
|
const { servers, hostById } = useHosts();
|
|
7036
8284
|
const [hostId, setHostId] = reactExports.useState(initialHostId ?? LOCAL_HOST_ID);
|
|
@@ -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
|
|
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,8 +8383,8 @@ 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(
|
|
@@ -7354,9 +8610,102 @@ function perfSource(openPage) {
|
|
|
7354
8610
|
}
|
|
7355
8611
|
};
|
|
7356
8612
|
}
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
8613
|
+
function fromSettings(editor) {
|
|
8614
|
+
if (!editor || typeof editor !== "object" || Object.keys(editor).length === 0) return void 0;
|
|
8615
|
+
return parseEditor(JSON.stringify(editor));
|
|
8616
|
+
}
|
|
8617
|
+
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
8618
|
+
function createSettingsEditorPrefs(options) {
|
|
8619
|
+
const { api, cache, onSettingsWritten } = options;
|
|
8620
|
+
let state2;
|
|
8621
|
+
let cached;
|
|
8622
|
+
let inflight = 0;
|
|
8623
|
+
const listeners2 = /* @__PURE__ */ new Set();
|
|
8624
|
+
const notify2 = () => {
|
|
8625
|
+
for (const l of [...listeners2]) l();
|
|
8626
|
+
};
|
|
8627
|
+
const remember2 = (next) => {
|
|
8628
|
+
try {
|
|
8629
|
+
cache.setItem(EDITOR_STORAGE_KEY, JSON.stringify(next));
|
|
8630
|
+
} catch {
|
|
8631
|
+
}
|
|
8632
|
+
};
|
|
8633
|
+
const adopt = (editor) => {
|
|
8634
|
+
if (inflight > 0 || !state2) return;
|
|
8635
|
+
const next = fromSettings(editor) ?? DEFAULT_EDITOR;
|
|
8636
|
+
if (same(state2, next)) return;
|
|
8637
|
+
state2 = next;
|
|
8638
|
+
remember2(next);
|
|
8639
|
+
notify2();
|
|
8640
|
+
};
|
|
8641
|
+
const persist = (next) => {
|
|
8642
|
+
inflight++;
|
|
8643
|
+
void api().settings.set({ editor: { ...next } }).then(
|
|
8644
|
+
(settings) => {
|
|
8645
|
+
inflight--;
|
|
8646
|
+
adopt(settings.editor);
|
|
8647
|
+
},
|
|
8648
|
+
() => {
|
|
8649
|
+
inflight--;
|
|
8650
|
+
}
|
|
8651
|
+
);
|
|
8652
|
+
};
|
|
8653
|
+
const read2 = () => {
|
|
8654
|
+
void api().settings.get().then(
|
|
8655
|
+
(settings) => adopt(settings.editor),
|
|
8656
|
+
() => void 0
|
|
8657
|
+
);
|
|
8658
|
+
};
|
|
8659
|
+
const load = () => {
|
|
8660
|
+
if (state2) return state2;
|
|
8661
|
+
try {
|
|
8662
|
+
const raw = cache.getItem(EDITOR_STORAGE_KEY);
|
|
8663
|
+
cached = raw === null ? void 0 : parseEditor(raw);
|
|
8664
|
+
} catch {
|
|
8665
|
+
cached = void 0;
|
|
8666
|
+
}
|
|
8667
|
+
state2 = cached ?? DEFAULT_EDITOR;
|
|
8668
|
+
void api().settings.get().then(
|
|
8669
|
+
(settings) => {
|
|
8670
|
+
const stored = fromSettings(settings.editor);
|
|
8671
|
+
if (stored || !cached) adopt(settings.editor);
|
|
8672
|
+
else if (inflight === 0) persist(cached);
|
|
8673
|
+
},
|
|
8674
|
+
() => void 0
|
|
8675
|
+
);
|
|
8676
|
+
onSettingsWritten(read2);
|
|
8677
|
+
api().settings.onChanged((signal) => adopt(signal.settings.editor));
|
|
8678
|
+
return state2;
|
|
8679
|
+
};
|
|
8680
|
+
const prefs = {
|
|
8681
|
+
get: load,
|
|
8682
|
+
subscribe(onChange) {
|
|
8683
|
+
load();
|
|
8684
|
+
listeners2.add(onChange);
|
|
8685
|
+
return () => {
|
|
8686
|
+
listeners2.delete(onChange);
|
|
8687
|
+
};
|
|
8688
|
+
},
|
|
8689
|
+
set(update) {
|
|
8690
|
+
const prev = load();
|
|
8691
|
+
const next = { ...prev, ...update, version: 1 };
|
|
8692
|
+
if (same(prev, next)) return;
|
|
8693
|
+
state2 = next;
|
|
8694
|
+
remember2(next);
|
|
8695
|
+
notify2();
|
|
8696
|
+
persist(next);
|
|
8697
|
+
},
|
|
8698
|
+
reset() {
|
|
8699
|
+
prefs.set(DEFAULT_EDITOR);
|
|
8700
|
+
}
|
|
8701
|
+
};
|
|
8702
|
+
return prefs;
|
|
8703
|
+
}
|
|
8704
|
+
const editorPrefs = createSettingsEditorPrefs({
|
|
8705
|
+
// Read on first use: a module imported where there is no `window` (a node test) still loads.
|
|
8706
|
+
api: () => window.api,
|
|
8707
|
+
cache: { getItem: (key2) => localStorage.getItem(key2), setItem: (key2, value) => localStorage.setItem(key2, value) },
|
|
8708
|
+
onSettingsWritten: (onChange) => subscribeInvalidation({ topics: ["settings"], scope: hostScope(null) }, () => onChange())
|
|
7360
8709
|
});
|
|
7361
8710
|
function isOnThisMachine(cwd) {
|
|
7362
8711
|
return !cwd.startsWith("zidane-env://");
|
|
@@ -7467,7 +8816,7 @@ function useSessionFacts(id) {
|
|
|
7467
8816
|
return session ? { updatedAt: session.updatedAt, current: id === activeSessionId } : void 0;
|
|
7468
8817
|
}
|
|
7469
8818
|
const rows = createPaletteRows({
|
|
7470
|
-
StatusDot: SessionStatusDot,
|
|
8819
|
+
StatusDot: SessionStatusDot$1,
|
|
7471
8820
|
useSessionStatus: useSessionDotState,
|
|
7472
8821
|
useSession: useSessionFacts,
|
|
7473
8822
|
highlight: (excerpt, query) => focusExcerpt(excerpt, findTermRanges(excerpt, tokenizeQuery(query)))
|
|
@@ -7626,6 +8975,112 @@ function PaletteHost({
|
|
|
7626
8975
|
usePaletteModalSlot({ context, cwd, render: (ctx) => /* @__PURE__ */ jsxRuntimeExports.jsx(DesktopPaletteDialog, { context: ctx }) });
|
|
7627
8976
|
return null;
|
|
7628
8977
|
}
|
|
8978
|
+
const RESERVED = (event) => event.key === "Escape" || event.ctrlKey && !event.metaKey && !event.altKey && event.key.toLowerCase() === "c";
|
|
8979
|
+
function commandAllowed(command, focus, mode) {
|
|
8980
|
+
if (!command.enabled) return false;
|
|
8981
|
+
if (command.mode !== void 0 && command.mode !== mode) return false;
|
|
8982
|
+
if (focus.typing && !command.editable) return false;
|
|
8983
|
+
const scope = command.scope;
|
|
8984
|
+
if (focus.modal) return scope === "modal";
|
|
8985
|
+
if (scope === "global") return true;
|
|
8986
|
+
if (scope === "composer") return focus.composer;
|
|
8987
|
+
if (scope === "transcript") return focus.transcript;
|
|
8988
|
+
if (scope.startsWith("panel:")) return focus.panel !== void 0 && scope.slice("panel:".length) === focus.panel;
|
|
8989
|
+
return false;
|
|
8990
|
+
}
|
|
8991
|
+
function createExtensionKeyHandler(options) {
|
|
8992
|
+
return (event) => {
|
|
8993
|
+
if (event.defaultPrevented || event.repeat || RESERVED(event)) return;
|
|
8994
|
+
const focus = options.focus(event);
|
|
8995
|
+
const mode = options.mode();
|
|
8996
|
+
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));
|
|
8997
|
+
if (matching.length === 0) return;
|
|
8998
|
+
event.preventDefault();
|
|
8999
|
+
event.stopPropagation();
|
|
9000
|
+
void (async () => {
|
|
9001
|
+
for (const command of matching) {
|
|
9002
|
+
if (await options.run(command.id).catch(() => false)) return;
|
|
9003
|
+
}
|
|
9004
|
+
})();
|
|
9005
|
+
};
|
|
9006
|
+
}
|
|
9007
|
+
function desktopFocusScopes(event) {
|
|
9008
|
+
const target = event.target instanceof Element ? event.target : document.activeElement;
|
|
9009
|
+
const typing = !!target && (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable);
|
|
9010
|
+
const panelRoot = target?.closest('aside[aria-label="Side panel"]');
|
|
9011
|
+
const activeTab = panelRoot?.querySelector('[data-tab-id][aria-selected="true"]')?.dataset.tabId;
|
|
9012
|
+
return {
|
|
9013
|
+
// A dialog animating out (`data-state="closing"`, inert) is gone for the keys already.
|
|
9014
|
+
modal: document.querySelector('[role="dialog"][aria-modal="true"]:not([data-state="closing"])') !== null,
|
|
9015
|
+
composer: !!target?.closest("[data-composer-shell], .zg-composer-editor"),
|
|
9016
|
+
transcript: !!target?.closest("[data-row], .zg-cv-row"),
|
|
9017
|
+
...panelRoot && activeTab ? { panel: activeTab } : {},
|
|
9018
|
+
typing
|
|
9019
|
+
};
|
|
9020
|
+
}
|
|
9021
|
+
function appliesHere(effect) {
|
|
9022
|
+
if (effect.kind === "composer" || effect.kind === "keymap") return false;
|
|
9023
|
+
return !(effect.kind === "navigate" && "screen" in effect.to);
|
|
9024
|
+
}
|
|
9025
|
+
function ExtensionsRoot() {
|
|
9026
|
+
const host2 = useElectronExtensionsHost();
|
|
9027
|
+
const { setActiveSessionId, activeSessionId } = useSessions();
|
|
9028
|
+
const sessionRef = reactExports.useRef(void 0);
|
|
9029
|
+
sessionRef.current = activeSessionId ?? void 0;
|
|
9030
|
+
const panels = useOptionalPanelActions();
|
|
9031
|
+
const layout = usePanelLayout();
|
|
9032
|
+
const handler = (effect) => {
|
|
9033
|
+
switch (effect.kind) {
|
|
9034
|
+
case "panel": {
|
|
9035
|
+
if (!panels) return false;
|
|
9036
|
+
const open = layout.openTabs.some((t) => t.id === effect.panelId) && layout.state.open;
|
|
9037
|
+
if (effect.action === "close" || effect.action === "toggle" && open) {
|
|
9038
|
+
if (!open) return false;
|
|
9039
|
+
panels.closeTab(effect.panelId);
|
|
9040
|
+
return true;
|
|
9041
|
+
}
|
|
9042
|
+
if (!layout.tabs.some((t) => t.id === effect.panelId)) return false;
|
|
9043
|
+
panels.pick(effect.panelId);
|
|
9044
|
+
return true;
|
|
9045
|
+
}
|
|
9046
|
+
case "panel-state":
|
|
9047
|
+
return layout.state.open ? layout.openTabs.map((t) => t.id) : [];
|
|
9048
|
+
case "navigate": {
|
|
9049
|
+
const to = effect.to;
|
|
9050
|
+
if ("session" in to) {
|
|
9051
|
+
setActiveSessionId(to.session);
|
|
9052
|
+
return true;
|
|
9053
|
+
}
|
|
9054
|
+
if ("screen" in to) return false;
|
|
9055
|
+
setActiveSessionId(null);
|
|
9056
|
+
return true;
|
|
9057
|
+
}
|
|
9058
|
+
case "notify":
|
|
9059
|
+
if (!document.hasFocus() && typeof Notification === "function")
|
|
9060
|
+
new Notification(effect.title, {
|
|
9061
|
+
...effect.body ? { body: effect.body } : {},
|
|
9062
|
+
silent: effect.sound === false
|
|
9063
|
+
});
|
|
9064
|
+
return void 0;
|
|
9065
|
+
default:
|
|
9066
|
+
return false;
|
|
9067
|
+
}
|
|
9068
|
+
};
|
|
9069
|
+
useExtensionEffects(handler, { accepts: appliesHere });
|
|
9070
|
+
reactExports.useEffect(() => {
|
|
9071
|
+
if (!host2) return void 0;
|
|
9072
|
+
const onKey = createExtensionKeyHandler({
|
|
9073
|
+
commands: () => host2.keyCommands.get(),
|
|
9074
|
+
mode: () => host2.keymapMode.get(),
|
|
9075
|
+
matches: (event, chord) => matchesBinding(event, chord),
|
|
9076
|
+
focus: desktopFocusScopes,
|
|
9077
|
+
run: async (id) => host2.commands ? host2.commands.run(id, sessionRef.current ? { sessionId: sessionRef.current } : {}) : false
|
|
9078
|
+
});
|
|
9079
|
+
window.addEventListener("keydown", onKey, true);
|
|
9080
|
+
return () => window.removeEventListener("keydown", onKey, true);
|
|
9081
|
+
}, [host2]);
|
|
9082
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionDialogHost, {});
|
|
9083
|
+
}
|
|
7629
9084
|
function useOnboardingGate(enabled, surfaceFirstRun, openOnboarding) {
|
|
7630
9085
|
const opener = reactExports.useRef(openOnboarding);
|
|
7631
9086
|
opener.current = openOnboarding;
|
|
@@ -7784,6 +9239,7 @@ function Webview({
|
|
|
7784
9239
|
const onStop = () => {
|
|
7785
9240
|
browserStore.update(sessionId, { loading: false });
|
|
7786
9241
|
sync();
|
|
9242
|
+
browserStore.recordVisit(sessionId);
|
|
7787
9243
|
};
|
|
7788
9244
|
const onNavigate = () => {
|
|
7789
9245
|
browserStore.update(sessionId, { error: null, crashed: null });
|
|
@@ -7809,6 +9265,7 @@ function Webview({
|
|
|
7809
9265
|
};
|
|
7810
9266
|
const onGone = () => {
|
|
7811
9267
|
const now = Date.now();
|
|
9268
|
+
for (const [id, times] of crashLog) if (times.every((t) => now - t >= CRASH_WINDOW_MS)) crashLog.delete(id);
|
|
7812
9269
|
const recent = (crashLog.get(sessionId) ?? []).filter((t) => now - t < CRASH_WINDOW_MS);
|
|
7813
9270
|
if (recent.length >= MAX_CRASH_RETRIES) {
|
|
7814
9271
|
crashLog.set(sessionId, recent);
|
|
@@ -7904,10 +9361,10 @@ function BrowserRequests() {
|
|
|
7904
9361
|
[]
|
|
7905
9362
|
);
|
|
7906
9363
|
reactExports.useEffect(() => {
|
|
7907
|
-
let
|
|
9364
|
+
let seq2 = 0;
|
|
7908
9365
|
return window.api.browser.onPointer(({ sessionId, x, y, phase }) => {
|
|
7909
|
-
|
|
7910
|
-
browserStore.update(sessionId, { pointer: { x, y, phase, seq } });
|
|
9366
|
+
seq2 += 1;
|
|
9367
|
+
browserStore.update(sessionId, { pointer: { x, y, phase, seq: seq2 } });
|
|
7911
9368
|
});
|
|
7912
9369
|
}, []);
|
|
7913
9370
|
return null;
|
|
@@ -8343,6 +9800,7 @@ function AppShell({ appearanceFirstRun: appearanceFirstRun2 }) {
|
|
|
8343
9800
|
onFindInConversation: find.findIn
|
|
8344
9801
|
}
|
|
8345
9802
|
) }),
|
|
9803
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Extensions", resetKey: regionKey, fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionsRoot, {}) }),
|
|
8346
9804
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Browser", resetKey: regionKey, fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrowserHost, {}) }),
|
|
8347
9805
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Browser requests", resetKey: regionKey, fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrowserRequests, {}) }),
|
|
8348
9806
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { region: "Inbox", resetKey: regionKey, fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(InboxAttention, {}) }),
|
|
@@ -8373,7 +9831,8 @@ function AppShell({ appearanceFirstRun: appearanceFirstRun2 }) {
|
|
|
8373
9831
|
onOpenEnvironmentSettings: openEnvironmentSettings
|
|
8374
9832
|
}
|
|
8375
9833
|
) }),
|
|
8376
|
-
!standalone && /* @__PURE__ */ jsxRuntimeExports.jsx(WindowSidebarToggle, {})
|
|
9834
|
+
!standalone && /* @__PURE__ */ jsxRuntimeExports.jsx(WindowSidebarToggle, {}),
|
|
9835
|
+
!standalone && /* @__PURE__ */ jsxRuntimeExports.jsx(TitlebarSlot, { sessionId: activeSessionId ?? void 0 })
|
|
8377
9836
|
] }) })
|
|
8378
9837
|
] });
|
|
8379
9838
|
}
|
|
@@ -8521,7 +9980,8 @@ function createElectronSessionHost(api, onStreamSignal2) {
|
|
|
8521
9980
|
usage: {
|
|
8522
9981
|
summary: (range) => api.usage.summary(range),
|
|
8523
9982
|
providers: (options) => api.providerUsage.fetchAll(void 0, options?.refresh ? { refresh: true } : void 0),
|
|
8524
|
-
github: (options) => api.providerUsage.fetchGithub(options)
|
|
9983
|
+
github: (options) => api.providerUsage.fetchGithub(options),
|
|
9984
|
+
redeemReset: (target) => api.providerUsage.redeemReset(target.providerKey, target.credentialKey, target.creditId)
|
|
8525
9985
|
},
|
|
8526
9986
|
connect() {
|
|
8527
9987
|
const off = [
|
|
@@ -8756,12 +10216,12 @@ function createElectronChatHost(api, streams, options = {}) {
|
|
|
8756
10216
|
if (!store2.isHydrated(sessionId)) store2.setEventsPage(sessionId, page);
|
|
8757
10217
|
if (running && store2.runStateVersion === version) store2.markRunning(sessionId);
|
|
8758
10218
|
};
|
|
8759
|
-
const transcripts = /* @__PURE__ */ new
|
|
10219
|
+
const transcripts = /* @__PURE__ */ new WeakMap();
|
|
8760
10220
|
const transcript = (id) => {
|
|
8761
|
-
let t = transcripts.get(id);
|
|
8762
|
-
if (t) return t;
|
|
8763
10221
|
const sessionId = id;
|
|
8764
10222
|
const inner = streams.transcript(sessionId);
|
|
10223
|
+
let t = transcripts.get(inner);
|
|
10224
|
+
if (t) return t;
|
|
8765
10225
|
t = {
|
|
8766
10226
|
...inner,
|
|
8767
10227
|
subscribe(onChange) {
|
|
@@ -8770,7 +10230,7 @@ function createElectronChatHost(api, streams, options = {}) {
|
|
|
8770
10230
|
return off;
|
|
8771
10231
|
}
|
|
8772
10232
|
};
|
|
8773
|
-
transcripts.set(
|
|
10233
|
+
transcripts.set(inner, t);
|
|
8774
10234
|
return t;
|
|
8775
10235
|
};
|
|
8776
10236
|
const pendings = /* @__PURE__ */ new Map();
|
|
@@ -8785,14 +10245,16 @@ function createElectronChatHost(api, streams, options = {}) {
|
|
|
8785
10245
|
};
|
|
8786
10246
|
const everyPending = writable([]);
|
|
8787
10247
|
const resolved = /* @__PURE__ */ new Set();
|
|
8788
|
-
const
|
|
8789
|
-
|
|
8790
|
-
|
|
10248
|
+
const RESOLVED_MAX = 500;
|
|
10249
|
+
const addInteraction = (sessionId, request2, live, hydrated = false) => {
|
|
10250
|
+
if (resolved.has(request2.id) || everyPending.get().some((i) => i.requestId === request2.id)) return;
|
|
10251
|
+
const item = { requestId: request2.id, sessionId, request: request2, live };
|
|
8791
10252
|
pending(sessionId).set((all) => hydrated ? [item, ...all] : [...all, item]);
|
|
8792
10253
|
everyPending.set((all) => hydrated ? [item, ...all] : [...all, item]);
|
|
8793
10254
|
};
|
|
8794
10255
|
const resolveInteraction = (requestId) => {
|
|
8795
10256
|
resolved.add(requestId);
|
|
10257
|
+
if (resolved.size > RESOLVED_MAX) resolved.delete(resolved.values().next().value);
|
|
8796
10258
|
for (const p of pendings.values()) {
|
|
8797
10259
|
if (p.get().some((i) => i.requestId === requestId)) p.set((all) => all.filter((i) => i.requestId !== requestId));
|
|
8798
10260
|
}
|
|
@@ -9273,7 +10735,7 @@ const GUI_LABELS = {
|
|
|
9273
10735
|
};
|
|
9274
10736
|
const APP_RENDERERS = { attachmentLabel: codeAttachmentLabel };
|
|
9275
10737
|
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 }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
|
|
10738
|
+
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
10739
|
}
|
|
9278
10740
|
const HIGHLIGHTER = createCodeHighlighter(
|
|
9279
10741
|
typeof WorkerWrapper$1 === "function" ? { createWorker: () => trackRendererWorker("Code highlighting", new WorkerWrapper$1()) } : {}
|
|
@@ -9283,41 +10745,6 @@ function CodeHighlight({ children }) {
|
|
|
9283
10745
|
const { wordWrap } = useEditorPrefs();
|
|
9284
10746
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(CodeHighlightProvider, { highlighter: HIGHLIGHTER, theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeWrapProvider, { wrap: wordWrap, children }) });
|
|
9285
10747
|
}
|
|
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
10748
|
const RELEASE_AFTER_MS = 5 * 6e4;
|
|
9322
10749
|
let views = 0;
|
|
9323
10750
|
let held = false;
|
|
@@ -9342,7 +10769,7 @@ const subscribe = (listener) => {
|
|
|
9342
10769
|
listeners.add(listener);
|
|
9343
10770
|
return () => void listeners.delete(listener);
|
|
9344
10771
|
};
|
|
9345
|
-
const EditorWorkerPool = reactExports.lazy(() => __vitePreload(() => import("./EditorWorkers-
|
|
10772
|
+
const EditorWorkerPool = reactExports.lazy(() => __vitePreload(() => import("./EditorWorkers-DABG5YG9.js"), true ? __vite__mapDeps([2,1,3,4,5,6,7,8,9]) : void 0, import.meta.url).then((m) => ({ default: m.EditorWorkerPool })));
|
|
9346
10773
|
function EditorWorkersHold() {
|
|
9347
10774
|
const on2 = reactExports.useSyncExternalStore(
|
|
9348
10775
|
subscribe,
|
|
@@ -9358,10 +10785,21 @@ function ThemedShell({ children }) {
|
|
|
9358
10785
|
const activeSession = activeSessionId ? sessions.find((session) => session.id === activeSessionId) : null;
|
|
9359
10786
|
const cwd = activeSession?.cwd ?? defaultFolder;
|
|
9360
10787
|
const extensionKey = settings.enabledExtensions?.join("") ?? "*";
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
10788
|
+
const extensions = useElectronExtensionsHost();
|
|
10789
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10790
|
+
AppearanceProvider,
|
|
10791
|
+
{
|
|
10792
|
+
host: appearanceHost,
|
|
10793
|
+
legacyThemeId: settings.theme,
|
|
10794
|
+
folder: cwd,
|
|
10795
|
+
themesKey: extensionKey,
|
|
10796
|
+
...extensions ? { extensions } : {},
|
|
10797
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CodeHighlight, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(EditorEnvironmentRoot, { children: [
|
|
10798
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(EditorWorkersHold, {}),
|
|
10799
|
+
children
|
|
10800
|
+
] }) })
|
|
10801
|
+
}
|
|
10802
|
+
);
|
|
9365
10803
|
}
|
|
9366
10804
|
const MAX_KEYS = 500;
|
|
9367
10805
|
const RENDERING_FLOOR_MS = 16;
|
|
@@ -9455,6 +10893,7 @@ const appearanceFirstRun = appearanceHost.prefs.isFirstRun();
|
|
|
9455
10893
|
startRunMeter();
|
|
9456
10894
|
sessionActivity.start();
|
|
9457
10895
|
sessionCompaction.start();
|
|
10896
|
+
runEstimates.start();
|
|
9458
10897
|
sessionBadges.start();
|
|
9459
10898
|
ReactDOM.createRoot(document.getElementById("root"), {
|
|
9460
10899
|
// An `ErrorBoundary` logs what it caught itself, with its region; React's default would log it a second time.
|
|
@@ -9463,7 +10902,7 @@ ReactDOM.createRoot(document.getElementById("root"), {
|
|
|
9463
10902
|
reportRendererError(error, { source: "caught by an error boundary", componentStack: info.componentStack });
|
|
9464
10903
|
}
|
|
9465
10904
|
}).render(
|
|
9466
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(React.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10905
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(React$1.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9467
10906
|
ErrorBoundary,
|
|
9468
10907
|
{
|
|
9469
10908
|
region: "Zidane",
|