@nikcli-ai/app 0.0.6
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/.turbo/turbo-build.log +661 -0
- package/.turbo/turbo-typecheck.log +1 -0
- package/AGENTS.md +30 -0
- package/README.md +51 -0
- package/dist/_headers +17 -0
- package/dist/apple-touch-icon-v3.png +0 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/assets/BlexMonoNerdFontMono-Bold-B8jzonSj.woff2 +0 -0
- package/dist/assets/BlexMonoNerdFontMono-Medium-BvtJB5kd.woff2 +0 -0
- package/dist/assets/BlexMonoNerdFontMono-Regular-DSJ7IWr2.woff2 +0 -0
- package/dist/assets/CaskaydiaCoveNerdFontMono-Bold-CxABrWmj.woff2 +0 -0
- package/dist/assets/CaskaydiaCoveNerdFontMono-Regular-C_H0OSLN.woff2 +0 -0
- package/dist/assets/FiraCodeNerdFontMono-Bold-BjAeM3gJ.woff2 +0 -0
- package/dist/assets/FiraCodeNerdFontMono-Regular-io3c92n9.woff2 +0 -0
- package/dist/assets/HackNerdFontMono-Bold-BNG4kp7w.woff2 +0 -0
- package/dist/assets/HackNerdFontMono-Regular-IcpSchWC.woff2 +0 -0
- package/dist/assets/InconsolataNerdFontMono-Bold-oTRjQesI.woff2 +0 -0
- package/dist/assets/InconsolataNerdFontMono-Regular-CRHGEvh2.woff2 +0 -0
- package/dist/assets/IntoneMonoNerdFontMono-Bold-BL6LrHzx.woff2 +0 -0
- package/dist/assets/IntoneMonoNerdFontMono-Regular-BwjBdmsJ.woff2 +0 -0
- package/dist/assets/JetBrainsMonoNerdFontMono-Bold-CU80ifuM.woff2 +0 -0
- package/dist/assets/JetBrainsMonoNerdFontMono-Regular-QVq88ZfU.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/assets/MesloLGSNerdFontMono-Bold-CrpVO3ec.woff2 +0 -0
- package/dist/assets/MesloLGSNerdFontMono-Regular-j-nTZDWZ.woff2 +0 -0
- package/dist/assets/RobotoMonoNerdFontMono-Bold-DNxuDepp.woff2 +0 -0
- package/dist/assets/RobotoMonoNerdFontMono-Regular-DvxS3QZC.woff2 +0 -0
- package/dist/assets/SauceCodeProNerdFontMono-Bold-DloEeUVQ.woff2 +0 -0
- package/dist/assets/SauceCodeProNerdFontMono-Regular-Ba96Bdne.woff2 +0 -0
- package/dist/assets/UbuntuMonoNerdFontMono-Bold-wLXUURqB.woff2 +0 -0
- package/dist/assets/UbuntuMonoNerdFontMono-Regular-tdnXLyap.woff2 +0 -0
- package/dist/assets/abap-BXYWi5l2.js +1 -0
- package/dist/assets/abap-BdImnpbu.js +1 -0
- package/dist/assets/actionscript-3-CfeIJUat.js +1 -0
- package/dist/assets/actionscript-3-LjD3sNyx.js +1 -0
- package/dist/assets/ada-DeReRNhg.js +1 -0
- package/dist/assets/ada-bCR0ucgS.js +1 -0
- package/dist/assets/alert-01-BuOD_o_q.aac +0 -0
- package/dist/assets/alert-02-CS75AsoP.aac +0 -0
- package/dist/assets/alert-04-CaGsIGFP.aac +0 -0
- package/dist/assets/alert-05-D2gbGoRH.aac +0 -0
- package/dist/assets/alert-06-GK5Tqy6u.aac +0 -0
- package/dist/assets/alert-07-0r0kiLGz.aac +0 -0
- package/dist/assets/alert-08-CZowNquU.aac +0 -0
- package/dist/assets/alert-10-Ck5hR7zH.aac +0 -0
- package/dist/assets/android-studio-D0DqtVA4.svg +1 -0
- package/dist/assets/andromeeda-C-Jbm3Hp.js +1 -0
- package/dist/assets/angular-html-6NEUuZou.js +1 -0
- package/dist/assets/angular-html-CU67Zn6k.js +1 -0
- package/dist/assets/angular-ts-BfBSdvnY.js +1 -0
- package/dist/assets/angular-ts-BwZT4LLn.js +1 -0
- package/dist/assets/antigravity-XfClf80L.svg +1 -0
- package/dist/assets/apache-CCUDgqAf.js +1 -0
- package/dist/assets/apache-Pmp26Uib.js +1 -0
- package/dist/assets/apex-DDbsPZ6N.js +1 -0
- package/dist/assets/apex-ynV6aGfE.js +1 -0
- package/dist/assets/apl-C-KxP0FL.js +1 -0
- package/dist/assets/apl-dKokRX4l.js +1 -0
- package/dist/assets/applescript-Co6uUVPk.js +1 -0
- package/dist/assets/applescript-Dd26Nb5t.js +1 -0
- package/dist/assets/ara-BRHolxvo.js +1 -0
- package/dist/assets/ara-D6vCOKVX.js +1 -0
- package/dist/assets/asciidoc-DZ9uQOoP.js +1 -0
- package/dist/assets/asciidoc-Dv7Oe6Be.js +1 -0
- package/dist/assets/asm-CbVMAfFB.js +1 -0
- package/dist/assets/asm-D_Q5rh1f.js +1 -0
- package/dist/assets/astro-CbQHKStN.js +1 -0
- package/dist/assets/astro-OEl6i-aI.js +1 -0
- package/dist/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/dist/assets/awk-DMzUqQB5.js +1 -0
- package/dist/assets/awk-UmR4Ublb.js +1 -0
- package/dist/assets/ayu-dark-Cv9koXgw.js +1 -0
- package/dist/assets/ballerina-BFfxhgS-.js +1 -0
- package/dist/assets/ballerina-BMbY-1wP.js +1 -0
- package/dist/assets/bat-BkioyH1T.js +1 -0
- package/dist/assets/bat-Dcnh2ot_.js +1 -0
- package/dist/assets/beancount-B92nBv9q.js +1 -0
- package/dist/assets/beancount-k_qm7-4y.js +1 -0
- package/dist/assets/berry-C9fz7p0n.js +1 -0
- package/dist/assets/berry-uYugtg8r.js +1 -0
- package/dist/assets/bibtex-CHM0blh-.js +1 -0
- package/dist/assets/bibtex-DELXwv0g.js +1 -0
- package/dist/assets/bicep-Bmn6On1c.js +1 -0
- package/dist/assets/bicep-D2njIRU5.js +1 -0
- package/dist/assets/bip-bop-03-DXp7Zb0f.aac +0 -0
- package/dist/assets/bip-bop-04-CfVtpI7z.aac +0 -0
- package/dist/assets/bip-bop-06-BuvNosjK.aac +0 -0
- package/dist/assets/bip-bop-08-DBf7Bwjz.aac +0 -0
- package/dist/assets/bip-bop-09-CxEgoAHQ.aac +0 -0
- package/dist/assets/blade-CwZbp2Ca.js +1 -0
- package/dist/assets/blade-DVc8C-J4.js +1 -0
- package/dist/assets/bsl-BO_Y6i37.js +1 -0
- package/dist/assets/bsl-C4qeDxuX.js +1 -0
- package/dist/assets/c-BIGW1oBm.js +1 -0
- package/dist/assets/c-CyUOlKFr.js +1 -0
- package/dist/assets/cadence-Bv_4Rxtq.js +1 -0
- package/dist/assets/cadence-bIHbUj02.js +1 -0
- package/dist/assets/cairo-C_mOTUpN.js +1 -0
- package/dist/assets/cairo-KRGpt6FW.js +1 -0
- package/dist/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/dist/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/dist/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/dist/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/dist/assets/clarity-A4x-rz24.js +1 -0
- package/dist/assets/clarity-D53aC0YG.js +1 -0
- package/dist/assets/clojure-Bb2-3A0I.js +1 -0
- package/dist/assets/clojure-P80f7IUj.js +1 -0
- package/dist/assets/cmake-Cv5ljclQ.js +1 -0
- package/dist/assets/cmake-D1j8_8rp.js +1 -0
- package/dist/assets/cobol-Cg3yRVOY.js +1 -0
- package/dist/assets/cobol-nwyudZeR.js +1 -0
- package/dist/assets/codeowners-Bp6g37R7.js +1 -0
- package/dist/assets/codeowners-CKT8dJip.js +1 -0
- package/dist/assets/codeql-DXd8ggn3.js +1 -0
- package/dist/assets/codeql-DsOJ9woJ.js +1 -0
- package/dist/assets/coffee-CSg58a7P.js +1 -0
- package/dist/assets/coffee-Ch7k5sss.js +1 -0
- package/dist/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/dist/assets/common-lisp-v102bg8X.js +1 -0
- package/dist/assets/coq-CxCehFeR.js +1 -0
- package/dist/assets/coq-DkFqJrB1.js +1 -0
- package/dist/assets/cpp-C28rag7_.js +1 -0
- package/dist/assets/cpp-CofmeUqb.js +1 -0
- package/dist/assets/crystal-kLfOnxTY.js +1 -0
- package/dist/assets/crystal-tKQVLTB8.js +1 -0
- package/dist/assets/csharp-DFQpaWb6.js +1 -0
- package/dist/assets/csharp-K5feNrxe.js +1 -0
- package/dist/assets/css-BSK200cd.js +1 -0
- package/dist/assets/css-DPfMkruS.js +1 -0
- package/dist/assets/csv-AZNL9t8Q.js +1 -0
- package/dist/assets/csv-fuZLfV_i.js +1 -0
- package/dist/assets/cue-D82EKSYY.js +1 -0
- package/dist/assets/cue-nzsbQn5T.js +1 -0
- package/dist/assets/cypher-BM7Pwunj.js +1 -0
- package/dist/assets/cypher-COkxafJQ.js +1 -0
- package/dist/assets/d-85-TOEBH.js +1 -0
- package/dist/assets/d-TG9YRPoI.js +1 -0
- package/dist/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/assets/dart-CF10PKvl.js +1 -0
- package/dist/assets/dart-DArdxSyj.js +1 -0
- package/dist/assets/dax-B28Cho4e.js +1 -0
- package/dist/assets/dax-CEL-wOlO.js +1 -0
- package/dist/assets/desktop-BmXAJ9_W.js +1 -0
- package/dist/assets/desktop-Z9LhWKWr.js +1 -0
- package/dist/assets/diff-BlzBhZx2.js +1 -0
- package/dist/assets/diff-D97Zzqfu.js +1 -0
- package/dist/assets/docker-BcOcwvcX.js +1 -0
- package/dist/assets/docker-DIG_IqVK.js +1 -0
- package/dist/assets/dotenv-Bf0GLMGc.js +1 -0
- package/dist/assets/dotenv-Da5cRb03.js +1 -0
- package/dist/assets/dracula-BzJJZx-M.js +1 -0
- package/dist/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/dist/assets/dream-maker-BtqSS_iP.js +1 -0
- package/dist/assets/dream-maker-DBhfoDN-.js +1 -0
- package/dist/assets/edge-BkV0erSs.js +1 -0
- package/dist/assets/edge-C9mkmEUa.js +1 -0
- package/dist/assets/elixir-B1OcFvXE.js +1 -0
- package/dist/assets/elixir-CDX3lj18.js +1 -0
- package/dist/assets/elm-BX_9EnK8.js +1 -0
- package/dist/assets/elm-DbKCFpqz.js +1 -0
- package/dist/assets/emacs-lisp-C9XAeP06.js +1 -0
- package/dist/assets/emacs-lisp-fXIB3QbG.js +1 -0
- package/dist/assets/erb-BOJIQeun.js +1 -0
- package/dist/assets/erb-CjsbKF3w.js +1 -0
- package/dist/assets/erlang-Dh270pQQ.js +1 -0
- package/dist/assets/erlang-DsQrWhSR.js +1 -0
- package/dist/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/dist/assets/everforest-light-C8M2exoo.js +1 -0
- package/dist/assets/fennel-BYunw83y.js +1 -0
- package/dist/assets/fennel-CKW7gc4E.js +1 -0
- package/dist/assets/finder-CGxGn0h3.png +0 -0
- package/dist/assets/fish-BiaFC76h.js +1 -0
- package/dist/assets/fish-BvzEVeQv.js +1 -0
- package/dist/assets/fluent-C1VbA1FI.js +1 -0
- package/dist/assets/fluent-C4IJs8-o.js +1 -0
- package/dist/assets/fortran-fixed-form-BZjJHVRy.js +1 -0
- package/dist/assets/fortran-fixed-form-VBUom2Po.js +1 -0
- package/dist/assets/fortran-free-form-D22FLkUw.js +1 -0
- package/dist/assets/fortran-free-form-xZZnushS.js +1 -0
- package/dist/assets/fsharp-B6CigNpP.js +1 -0
- package/dist/assets/fsharp-CXgrBDvD.js +1 -0
- package/dist/assets/gdresource-B57lXvxj.js +1 -0
- package/dist/assets/gdresource-B7Tvp0Sc.js +1 -0
- package/dist/assets/gdscript-DTMYz4Jt.js +1 -0
- package/dist/assets/gdscript-etqGfJNh.js +1 -0
- package/dist/assets/gdshader-DkwncUOv.js +1 -0
- package/dist/assets/gdshader-MbeiIFWW.js +1 -0
- package/dist/assets/genie-CTXGoN_z.js +1 -0
- package/dist/assets/genie-D0YGMca9.js +1 -0
- package/dist/assets/gherkin-DQeIZrj7.js +1 -0
- package/dist/assets/gherkin-DyxjwDmM.js +1 -0
- package/dist/assets/ghostty-web-CsYhFgbJ.js +13 -0
- package/dist/assets/git-commit-BicZTByO.js +1 -0
- package/dist/assets/git-commit-F4YmCXRG.js +1 -0
- package/dist/assets/git-rebase-Bzlpfr7M.js +1 -0
- package/dist/assets/git-rebase-r7XF79zn.js +1 -0
- package/dist/assets/github-dark-DHJKELXO.js +1 -0
- package/dist/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/dist/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/dist/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/dist/assets/github-light-DAi9KRSo.js +1 -0
- package/dist/assets/github-light-default-D7oLnXFd.js +1 -0
- package/dist/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/dist/assets/gleam-B-IqXlZK.js +1 -0
- package/dist/assets/gleam-BspZqrRM.js +1 -0
- package/dist/assets/glimmer-js-Rg0-pVw9.js +1 -0
- package/dist/assets/glimmer-js-cZi37nA1.js +1 -0
- package/dist/assets/glimmer-ts-BY3QTAW9.js +1 -0
- package/dist/assets/glimmer-ts-U6CK756n.js +1 -0
- package/dist/assets/glsl-Bk7TyU8J.js +1 -0
- package/dist/assets/glsl-DplSGwfg.js +1 -0
- package/dist/assets/gnuplot-BBjkHhdK.js +1 -0
- package/dist/assets/gnuplot-DdkO51Og.js +1 -0
- package/dist/assets/go-BYCC9JQ2.js +1 -0
- package/dist/assets/go-Dn2_MT6a.js +1 -0
- package/dist/assets/graphql-By4-2MiP.js +1 -0
- package/dist/assets/graphql-ChdNCCLP.js +1 -0
- package/dist/assets/groovy-DjMbfbx0.js +1 -0
- package/dist/assets/groovy-gcz8RCvz.js +1 -0
- package/dist/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/dist/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/dist/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/dist/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/dist/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/dist/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/dist/assets/hack-CaT9iCJl.js +1 -0
- package/dist/assets/hack-Ce3HFLQu.js +1 -0
- package/dist/assets/haml-B8DHNrY2.js +1 -0
- package/dist/assets/haml-C-C08OMF.js +1 -0
- package/dist/assets/handlebars-BFxKmXBZ.js +1 -0
- package/dist/assets/handlebars-BL8al0AC.js +1 -0
- package/dist/assets/haskell-Df6bDoY_.js +1 -0
- package/dist/assets/haskell-DtebQ3Kv.js +1 -0
- package/dist/assets/haxe-CzTSHFRz.js +1 -0
- package/dist/assets/haxe-n0Q_eay_.js +1 -0
- package/dist/assets/hcl-BWvSN4gD.js +1 -0
- package/dist/assets/hcl-shhv74hy.js +1 -0
- package/dist/assets/hjson-BEMFYqr7.js +1 -0
- package/dist/assets/hjson-D5-asLiD.js +1 -0
- package/dist/assets/hlsl-D3lLCCz7.js +1 -0
- package/dist/assets/hlsl-Pefxhtaj.js +1 -0
- package/dist/assets/home-DDFZTO3p.js +1 -0
- package/dist/assets/houston-DnULxvSX.js +1 -0
- package/dist/assets/html-DBrZJmtb.js +1 -0
- package/dist/assets/html-GMplVEZG.js +1 -0
- package/dist/assets/html-derivative-BFtXZ54Q.js +1 -0
- package/dist/assets/html-derivative-DgyNW28a.js +1 -0
- package/dist/assets/http-D0p2QOuJ.js +1 -0
- package/dist/assets/http-jrhK8wxY.js +1 -0
- package/dist/assets/hurl-CeF7EoTQ.js +1 -0
- package/dist/assets/hurl-irOxFIW8.js +1 -0
- package/dist/assets/hxml-B_SuSTPP.js +1 -0
- package/dist/assets/hxml-Bvhsp5Yf.js +1 -0
- package/dist/assets/hy-CTpXmg0M.js +1 -0
- package/dist/assets/hy-DFXneXwc.js +1 -0
- package/dist/assets/imba-DGztddWO.js +1 -0
- package/dist/assets/imba-z_cUhu9e.js +1 -0
- package/dist/assets/index-D0jX0BNw.js +1844 -0
- package/dist/assets/index-DDCRe3lm.css +1 -0
- package/dist/assets/ini-BEwlwnbL.js +1 -0
- package/dist/assets/ini-DOGW4-0C.js +1 -0
- package/dist/assets/inter-FIwubZjA.woff2 +0 -0
- package/dist/assets/iosevka-nerd-font-DKH7rjGs.woff2 +0 -0
- package/dist/assets/iosevka-nerd-font-bold-BObfzjZJ.woff2 +0 -0
- package/dist/assets/java-B2AjWfgk.js +1 -0
- package/dist/assets/java-CylS5w8V.js +1 -0
- package/dist/assets/javascript-XPxc2APE.js +1 -0
- package/dist/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/assets/jinja-4LBKfQ-Z.js +1 -0
- package/dist/assets/jinja-DlBE7Xgz.js +1 -0
- package/dist/assets/jison-DRGa8fbr.js +1 -0
- package/dist/assets/jison-wvAkD_A8.js +1 -0
- package/dist/assets/json-CjLXzM_z.js +1 -0
- package/dist/assets/json-Cp-IABpG.js +1 -0
- package/dist/assets/json5-C9tS-k6U.js +1 -0
- package/dist/assets/json5-DE06a0U2.js +1 -0
- package/dist/assets/jsonc-BYi4HS05.js +1 -0
- package/dist/assets/jsonc-Des-eS-w.js +1 -0
- package/dist/assets/jsonl-CuhIcKDk.js +1 -0
- package/dist/assets/jsonl-DcaNXYhu.js +1 -0
- package/dist/assets/jsonnet-DFQXde-d.js +1 -0
- package/dist/assets/jsonnet-DtQdHwK-.js +1 -0
- package/dist/assets/jssm-BlhucWo7.js +1 -0
- package/dist/assets/jssm-C2t-YnRu.js +1 -0
- package/dist/assets/jsx-BGEKFWBk.js +1 -0
- package/dist/assets/jsx-g9-lgVsj.js +1 -0
- package/dist/assets/julia-Bh5qjrIj.js +1 -0
- package/dist/assets/julia-C8NyazO9.js +1 -0
- package/dist/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/dist/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/dist/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/dist/assets/kdl-DJsF4U57.js +1 -0
- package/dist/assets/kdl-DV7GczEv.js +1 -0
- package/dist/assets/kotlin-BdnUsdx6.js +1 -0
- package/dist/assets/kotlin-DwKqsDKK.js +1 -0
- package/dist/assets/kusto-BvAqAH-y.js +1 -0
- package/dist/assets/kusto-w7PrLrBe.js +1 -0
- package/dist/assets/laserwave-DUszq2jm.js +1 -0
- package/dist/assets/latex-BdAV_C_H.js +1 -0
- package/dist/assets/latex-BuzO6rjU.js +1 -0
- package/dist/assets/lean-Bc6EcWN3.js +1 -0
- package/dist/assets/lean-Dle5D8N4.js +1 -0
- package/dist/assets/less-B1dDrJ26.js +1 -0
- package/dist/assets/less-C76OjOdF.js +1 -0
- package/dist/assets/light-plus-B7mTdjB0.js +1 -0
- package/dist/assets/liquid-DYVedYrR.js +1 -0
- package/dist/assets/liquid-DdraCjph.js +1 -0
- package/dist/assets/llvm-BtvRca6l.js +1 -0
- package/dist/assets/llvm-s1WuUfOe.js +1 -0
- package/dist/assets/log-2UxHyX5q.js +1 -0
- package/dist/assets/log-CbW7hOWU.js +1 -0
- package/dist/assets/logo-BbooMuDm.js +1 -0
- package/dist/assets/logo-BtOb2qkB.js +1 -0
- package/dist/assets/lua-BbnMAYS6.js +1 -0
- package/dist/assets/lua-tkfysgZP.js +1 -0
- package/dist/assets/luau-CBwFb-vO.js +1 -0
- package/dist/assets/luau-CXu1NL6O.js +1 -0
- package/dist/assets/make-CHLpvVh8.js +1 -0
- package/dist/assets/make-s9FKP0VE.js +1 -0
- package/dist/assets/markdown-CKXSK5AY.js +1 -0
- package/dist/assets/markdown-Cvjx9yec.js +1 -0
- package/dist/assets/marko-BsqRlKIY.js +1 -0
- package/dist/assets/marko-CPi9NSCl.js +1 -0
- package/dist/assets/material-theme-D5KoaKCx.js +1 -0
- package/dist/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/dist/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/dist/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/dist/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/dist/assets/matlab-BQKM-LA_.js +1 -0
- package/dist/assets/matlab-D7o27uSR.js +1 -0
- package/dist/assets/mdc-BBM-UqJy.js +1 -0
- package/dist/assets/mdc-DUICxH0z.js +1 -0
- package/dist/assets/mdx-BWRhHdFl.js +1 -0
- package/dist/assets/mdx-Cmh6b_Ma.js +1 -0
- package/dist/assets/mermaid-DKYwYmdq.js +1 -0
- package/dist/assets/mermaid-DrapLM8U.js +1 -0
- package/dist/assets/min-dark-CafNBF8u.js +1 -0
- package/dist/assets/min-light-CTRr51gU.js +1 -0
- package/dist/assets/mipsasm-BElnB_7Q.js +1 -0
- package/dist/assets/mipsasm-CKIfxQSi.js +1 -0
- package/dist/assets/mojo-1DNp92w6.js +1 -0
- package/dist/assets/mojo-Dz6zCmiK.js +1 -0
- package/dist/assets/monokai-D4h5O-jR.js +1 -0
- package/dist/assets/move-Bu9oaDYs.js +1 -0
- package/dist/assets/move-Dvu4btzz.js +1 -0
- package/dist/assets/narrat-Cy2k80UN.js +1 -0
- package/dist/assets/narrat-DRg8JJMk.js +1 -0
- package/dist/assets/nextflow-BO4ujnzu.js +1 -0
- package/dist/assets/nextflow-BrzmwbiE.js +1 -0
- package/dist/assets/nginx-DknmC5AR.js +1 -0
- package/dist/assets/nginx-XmDIhN78.js +1 -0
- package/dist/assets/night-owl-C39BiMTA.js +1 -0
- package/dist/assets/nim-CVrawwO9.js +1 -0
- package/dist/assets/nim-Cm6-Nayq.js +1 -0
- package/dist/assets/nix-DcZRBjkC.js +1 -0
- package/dist/assets/nix-c8nO5XWb.js +1 -0
- package/dist/assets/nope-02-EygnDbCM.aac +0 -0
- package/dist/assets/nope-05-DZsXzrQW.aac +0 -0
- package/dist/assets/nope-08-COPo0uNf.aac +0 -0
- package/dist/assets/nope-11-CVdXg8G-.aac +0 -0
- package/dist/assets/nope-12-BJR1Ka3c.aac +0 -0
- package/dist/assets/nord-Ddv68eIx.js +1 -0
- package/dist/assets/nushell-C-sUppwS.js +1 -0
- package/dist/assets/nushell-Dqv-0Q5X.js +1 -0
- package/dist/assets/objective-c-DXmwc3jG.js +1 -0
- package/dist/assets/objective-c-sgtl-PdD.js +1 -0
- package/dist/assets/objective-cpp-BTQ37cYs.js +1 -0
- package/dist/assets/objective-cpp-CLxacb5B.js +1 -0
- package/dist/assets/ocaml-BvBP9Lm0.js +1 -0
- package/dist/assets/ocaml-C0hk2d4L.js +1 -0
- package/dist/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/dist/assets/one-light-PoHY5YXO.js +1 -0
- package/dist/assets/openscad-C4EeE6gA.js +1 -0
- package/dist/assets/openscad-Dmi2c_42.js +1 -0
- package/dist/assets/pascal-D93ZcfNL.js +1 -0
- package/dist/assets/pascal-DYjw0AuS.js +1 -0
- package/dist/assets/perl-C0TMdlhV.js +1 -0
- package/dist/assets/perl-Djxv1YJ9.js +1 -0
- package/dist/assets/php-CDn_0X-4.js +1 -0
- package/dist/assets/php-DEfiO3Bd.js +1 -0
- package/dist/assets/pierre-dark-BXuwtOqb.js +1 -0
- package/dist/assets/pierre-light-dckrK0oj.js +1 -0
- package/dist/assets/pkl-Cij4Vm9z.js +1 -0
- package/dist/assets/pkl-u5AG7uiY.js +1 -0
- package/dist/assets/plastic-3e1v2bzS.js +1 -0
- package/dist/assets/plsql-Bd6NdBJI.js +1 -0
- package/dist/assets/plsql-ChMvpjG-.js +1 -0
- package/dist/assets/po-BTJTHyun.js +1 -0
- package/dist/assets/po-CUhVi7la.js +1 -0
- package/dist/assets/poimandres-CS3Unz2-.js +1 -0
- package/dist/assets/polar-B-qJ3AIy.js +1 -0
- package/dist/assets/polar-C0HS_06l.js +1 -0
- package/dist/assets/postcss-BSGhOJ4k.js +1 -0
- package/dist/assets/postcss-CXtECtnM.js +1 -0
- package/dist/assets/powerquery-CC1XieQO.js +1 -0
- package/dist/assets/powerquery-CEu0bR-o.js +1 -0
- package/dist/assets/powershell-DdRAnR4Z.js +1 -0
- package/dist/assets/powershell-Dpen1YoG.js +1 -0
- package/dist/assets/prisma-C0hJlfqX.js +1 -0
- package/dist/assets/prisma-Dd19v3D-.js +1 -0
- package/dist/assets/prolog-CbFg5uaA.js +1 -0
- package/dist/assets/prolog-bSi0SE3D.js +1 -0
- package/dist/assets/proto-DIGPV07t.js +1 -0
- package/dist/assets/proto-DyJlTyXw.js +1 -0
- package/dist/assets/pug-CGlum2m_.js +1 -0
- package/dist/assets/pug-ClQUpJlV.js +1 -0
- package/dist/assets/puppet-BMWR74SV.js +1 -0
- package/dist/assets/puppet-ja2MI9-b.js +1 -0
- package/dist/assets/purescript-CklMAg4u.js +1 -0
- package/dist/assets/purescript-CxgsQa43.js +1 -0
- package/dist/assets/python-B6aJPvgy.js +1 -0
- package/dist/assets/python-DgE28U1V.js +1 -0
- package/dist/assets/qml-3beO22l8.js +1 -0
- package/dist/assets/qml-BEkX6VoX.js +1 -0
- package/dist/assets/qmldir-C8lEn-DE.js +1 -0
- package/dist/assets/qmldir-DNYHzgow.js +1 -0
- package/dist/assets/qss-BZsEMKxJ.js +1 -0
- package/dist/assets/qss-IeuSbFQv.js +1 -0
- package/dist/assets/r-BfG_C0qz.js +1 -0
- package/dist/assets/r-DiinP2Uv.js +1 -0
- package/dist/assets/racket-BqYA7rlc.js +1 -0
- package/dist/assets/racket-CzHBKLyy.js +1 -0
- package/dist/assets/raku-CPccoUN1.js +1 -0
- package/dist/assets/raku-DXvB9xmW.js +1 -0
- package/dist/assets/razor-8rj0VRTp.js +1 -0
- package/dist/assets/razor-CE9lU5zL.js +1 -0
- package/dist/assets/red-bN70gL4F.js +1 -0
- package/dist/assets/reg-C-SQnVFl.js +1 -0
- package/dist/assets/reg-DkqHJyC0.js +1 -0
- package/dist/assets/regexp-BW_zLBm-.js +1 -0
- package/dist/assets/regexp-CDVJQ6XC.js +1 -0
- package/dist/assets/rel-BIqKdwke.js +1 -0
- package/dist/assets/rel-C3B-1QV4.js +1 -0
- package/dist/assets/riscv-BM1_JUlF.js +1 -0
- package/dist/assets/riscv-s6spwTFp.js +1 -0
- package/dist/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/dist/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/dist/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/dist/assets/rosmsg-BJDFO7_C.js +1 -0
- package/dist/assets/rosmsg-TcL_zzr8.js +1 -0
- package/dist/assets/rst-8IYWyo0X.js +1 -0
- package/dist/assets/rst-B0xPkSld.js +1 -0
- package/dist/assets/ruby-BvKwtOVI.js +1 -0
- package/dist/assets/ruby-CHyTNJrF.js +1 -0
- package/dist/assets/rust-B1yitclQ.js +1 -0
- package/dist/assets/rust-DJErdhjk.js +1 -0
- package/dist/assets/sas-BZeeyq_z.js +1 -0
- package/dist/assets/sas-cz2c8ADy.js +1 -0
- package/dist/assets/sass-CIfQ9yqV.js +1 -0
- package/dist/assets/sass-Cj5Yp3dK.js +1 -0
- package/dist/assets/scala-C151Ov-r.js +1 -0
- package/dist/assets/scala-CWwlNtab.js +1 -0
- package/dist/assets/scheme-ByM66cy_.js +1 -0
- package/dist/assets/scheme-C98Dy4si.js +1 -0
- package/dist/assets/scss-Dk05w39G.js +1 -0
- package/dist/assets/scss-OYdSNvt2.js +1 -0
- package/dist/assets/sdbl-C5Q1usnU.js +1 -0
- package/dist/assets/sdbl-DVxCFoDh.js +1 -0
- package/dist/assets/session-fRmszlju.js +41 -0
- package/dist/assets/shaderlab-DNkMdb2B.js +1 -0
- package/dist/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/dist/assets/shellscript-CE-5zpiL.js +1 -0
- package/dist/assets/shellscript-Yzrsuije.js +1 -0
- package/dist/assets/shellsession-BADoaaVG.js +1 -0
- package/dist/assets/shellsession-BhddCRKA.js +1 -0
- package/dist/assets/slack-dark-BthQWCQV.js +1 -0
- package/dist/assets/slack-ochin-DqwNpetd.js +1 -0
- package/dist/assets/smalltalk-BERRCDM3.js +1 -0
- package/dist/assets/smalltalk-GKfhTxrk.js +1 -0
- package/dist/assets/snazzy-light-Bw305WKR.js +1 -0
- package/dist/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/dist/assets/solarized-light-L9t79GZl.js +1 -0
- package/dist/assets/solidity-DanOLEvk.js +1 -0
- package/dist/assets/solidity-rGO070M0.js +1 -0
- package/dist/assets/soy-Brmx7dQM.js +1 -0
- package/dist/assets/soy-C6ERzLIv.js +1 -0
- package/dist/assets/sparql-CHK3vDkL.js +1 -0
- package/dist/assets/sparql-rVzFXLq3.js +1 -0
- package/dist/assets/splunk-BtCnVYZw.js +1 -0
- package/dist/assets/splunk-YU1HCmJX.js +1 -0
- package/dist/assets/sprite-BxALe73Z.svg +882 -0
- package/dist/assets/sprite-Fb-TFjRY.svg +11707 -0
- package/dist/assets/sql-BLtJtn59.js +1 -0
- package/dist/assets/sql-CKXjX23X.js +1 -0
- package/dist/assets/ssh-config-Cpnw3KEt.js +1 -0
- package/dist/assets/ssh-config-_ykCGR6B.js +1 -0
- package/dist/assets/staplebops-03-Aug82oH0.aac +0 -0
- package/dist/assets/staplebops-04-olyHi8qQ.aac +0 -0
- package/dist/assets/staplebops-06-Cj_2vOI4.aac +0 -0
- package/dist/assets/staplebops-07-cqQEvbIf.aac +0 -0
- package/dist/assets/stata-BH5u7GGu.js +1 -0
- package/dist/assets/stata-BJqnY-gO.js +1 -0
- package/dist/assets/stylus-BEDo0Tqx.js +1 -0
- package/dist/assets/stylus-CHekGIgu.js +1 -0
- package/dist/assets/svelte-3Dk4HxPD.js +1 -0
- package/dist/assets/svelte-DmnhoTkn.js +1 -0
- package/dist/assets/swift-Deru3G9w.js +1 -0
- package/dist/assets/swift-Dg5xB15N.js +1 -0
- package/dist/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/dist/assets/system-verilog-CnnmHF94.js +1 -0
- package/dist/assets/system-verilog-rKNYENrf.js +1 -0
- package/dist/assets/systemd-4A_iFExJ.js +1 -0
- package/dist/assets/systemd-C1FfcI00.js +1 -0
- package/dist/assets/talonscript-CkByrt1z.js +1 -0
- package/dist/assets/talonscript-bksoRmW6.js +1 -0
- package/dist/assets/tasl-Bl4tsGRM.js +1 -0
- package/dist/assets/tasl-QIJgUcNo.js +1 -0
- package/dist/assets/tcl-B2_VAYrd.js +1 -0
- package/dist/assets/tcl-dwOrl1Do.js +1 -0
- package/dist/assets/templ-CyHhV9jl.js +1 -0
- package/dist/assets/templ-W15q3VgB.js +1 -0
- package/dist/assets/terminal-Cpd_WDea.png +0 -0
- package/dist/assets/terraform-BETggiCN.js +1 -0
- package/dist/assets/terraform-Ba94thAr.js +1 -0
- package/dist/assets/tex-CxkMU7Pf.js +1 -0
- package/dist/assets/tex-DZ7Smwga.js +1 -0
- package/dist/assets/textmate-B-hymv65.png +0 -0
- package/dist/assets/tokyo-night-hegEt444.js +1 -0
- package/dist/assets/toml-Btlk-g9G.js +1 -0
- package/dist/assets/toml-vGWfd6FD.js +1 -0
- package/dist/assets/ts-tags-DMPjx__B.js +1 -0
- package/dist/assets/ts-tags-zn1MmPIZ.js +1 -0
- package/dist/assets/tsv-B_m7g4N7.js +1 -0
- package/dist/assets/tsv-DYfmKMIW.js +1 -0
- package/dist/assets/tsx-COt5Ahok.js +1 -0
- package/dist/assets/tsx-Dio8iE-N.js +1 -0
- package/dist/assets/turtle-BsS91CYL.js +1 -0
- package/dist/assets/turtle-whXsfw69.js +1 -0
- package/dist/assets/twig-CO9l9SDP.js +1 -0
- package/dist/assets/twig-vsFUeHgy.js +1 -0
- package/dist/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/assets/typescript-DttGkNCf.js +1 -0
- package/dist/assets/typespec-BGHnOYBU.js +1 -0
- package/dist/assets/typespec-C_z-8Pri.js +1 -0
- package/dist/assets/typst-D2RORpaG.js +1 -0
- package/dist/assets/typst-DHCkPAjA.js +1 -0
- package/dist/assets/v-BcVCzyr7.js +1 -0
- package/dist/assets/v-CvM42WIw.js +1 -0
- package/dist/assets/vala-B_5xOBNr.js +1 -0
- package/dist/assets/vala-CsfeWuGM.js +1 -0
- package/dist/assets/vb-BVDm3zBt.js +1 -0
- package/dist/assets/vb-D17OF-Vu.js +1 -0
- package/dist/assets/verilog-BQ8w6xss.js +1 -0
- package/dist/assets/verilog-D5iownw6.js +1 -0
- package/dist/assets/vesper-DU1UobuO.js +1 -0
- package/dist/assets/vhdl-Bmgbkl_-.js +1 -0
- package/dist/assets/vhdl-CeAyd5Ju.js +1 -0
- package/dist/assets/viml-3ZODU9FQ.js +1 -0
- package/dist/assets/viml-CJc9bBzg.js +1 -0
- package/dist/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/dist/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/dist/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/dist/assets/vue-BJuclMoA.js +1 -0
- package/dist/assets/vue-DnHKYNfI.js +1 -0
- package/dist/assets/vue-html-CChd_i61.js +1 -0
- package/dist/assets/vue-html-CRAum25o.js +1 -0
- package/dist/assets/vue-vine-8moa0y9V.js +1 -0
- package/dist/assets/vue-vine-CDS6dxm6.js +1 -0
- package/dist/assets/vyper-B6NKdirK.js +1 -0
- package/dist/assets/vyper-CDx5xZoG.js +1 -0
- package/dist/assets/wasm-CG6Dc4jp.js +1 -0
- package/dist/assets/wasm-LUzQYg3H.js +1 -0
- package/dist/assets/wasm-MzD3tlZU.js +1 -0
- package/dist/assets/wenyan-8fXatRyt.js +1 -0
- package/dist/assets/wenyan-BV7otONQ.js +1 -0
- package/dist/assets/wgsl-CECC3vJ5.js +1 -0
- package/dist/assets/wgsl-Dx-B1_4e.js +1 -0
- package/dist/assets/wikitext-BaRWL9sq.js +1 -0
- package/dist/assets/wikitext-BhOHFoWU.js +1 -0
- package/dist/assets/wit-5i3qLPDT.js +1 -0
- package/dist/assets/wit-MEd50GYB.js +1 -0
- package/dist/assets/wolfram-CmMaIVaG.js +1 -0
- package/dist/assets/wolfram-lXgVvXCa.js +1 -0
- package/dist/assets/worker-CKpRWWws.js +153 -0
- package/dist/assets/xcode-4zqeTePl.png +0 -0
- package/dist/assets/xml-DtyAt_xK.js +1 -0
- package/dist/assets/xml-sdJ4AIDG.js +1 -0
- package/dist/assets/xsl-Btrj9DhN.js +1 -0
- package/dist/assets/xsl-CtQFsRM5.js +1 -0
- package/dist/assets/yaml-B92AUxDB.js +1 -0
- package/dist/assets/yaml-Buea-lGh.js +1 -0
- package/dist/assets/yup-01-BtRq6dLN.aac +0 -0
- package/dist/assets/yup-03-BHLEoqSS.aac +0 -0
- package/dist/assets/yup-04-C7yadpJT.aac +0 -0
- package/dist/assets/yup-05-CuuaeyjC.aac +0 -0
- package/dist/assets/zenscript-DVFEvuxE.js +1 -0
- package/dist/assets/zenscript-Dja4fBOE.js +1 -0
- package/dist/assets/zig-LhWa2ADv.js +1 -0
- package/dist/assets/zig-VOosw3JB.js +1 -0
- package/dist/favicon-96x96-v3.png +0 -0
- package/dist/favicon-96x96.png +0 -0
- package/dist/favicon-v3.ico +0 -0
- package/dist/favicon-v3.svg +7 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.svg +7 -0
- package/dist/index.html +24 -0
- package/dist/oc-theme-preload.js +28 -0
- package/dist/site.webmanifest +21 -0
- package/dist/social-share-zen.png +0 -0
- package/dist/social-share.png +0 -0
- package/dist/web-app-manifest-192x192.png +0 -0
- package/dist/web-app-manifest-512x512.png +0 -0
- package/e2e/AGENTS.md +176 -0
- package/e2e/actions.ts +421 -0
- package/e2e/app/home.spec.ts +21 -0
- package/e2e/app/navigation.spec.ts +10 -0
- package/e2e/app/palette.spec.ts +11 -0
- package/e2e/app/server-default.spec.ts +55 -0
- package/e2e/app/session.spec.ts +16 -0
- package/e2e/app/titlebar-history.spec.ts +42 -0
- package/e2e/files/file-open.spec.ts +18 -0
- package/e2e/files/file-tree.spec.ts +37 -0
- package/e2e/files/file-viewer.spec.ts +26 -0
- package/e2e/fixtures.ts +87 -0
- package/e2e/models/model-picker.spec.ts +42 -0
- package/e2e/models/models-visibility.spec.ts +61 -0
- package/e2e/projects/project-edit.spec.ts +53 -0
- package/e2e/projects/projects-close.spec.ts +74 -0
- package/e2e/projects/projects-switch.spec.ts +35 -0
- package/e2e/projects/workspaces.spec.ts +333 -0
- package/e2e/prompt/context.spec.ts +40 -0
- package/e2e/prompt/prompt-mention.spec.ts +26 -0
- package/e2e/prompt/prompt-slash-open.spec.ts +22 -0
- package/e2e/prompt/prompt.spec.ts +58 -0
- package/e2e/selectors.ts +57 -0
- package/e2e/session/session.spec.ts +157 -0
- package/e2e/settings/settings-keybinds.spec.ts +320 -0
- package/e2e/settings/settings-models.spec.ts +122 -0
- package/e2e/settings/settings-providers.spec.ts +136 -0
- package/e2e/settings/settings.spec.ts +292 -0
- package/e2e/sidebar/sidebar-session-links.spec.ts +31 -0
- package/e2e/sidebar/sidebar.spec.ts +14 -0
- package/e2e/status/status-popover.spec.ts +94 -0
- package/e2e/terminal/terminal-init.spec.ts +26 -0
- package/e2e/terminal/terminal.spec.ts +17 -0
- package/e2e/thinking-level.spec.ts +25 -0
- package/e2e/tsconfig.json +8 -0
- package/e2e/utils.ts +35 -0
- package/happydom.ts +75 -0
- package/index.html +23 -0
- package/package.json +72 -0
- package/playwright.config.ts +43 -0
- package/public/_headers +17 -0
- package/public/oc-theme-preload.js +28 -0
- package/script/e2e-local.ts +140 -0
- package/src/addons/serialize.test.ts +319 -0
- package/src/addons/serialize.ts +634 -0
- package/src/app.tsx +170 -0
- package/src/components/dialog-connect-provider.tsx +456 -0
- package/src/components/dialog-custom-provider.tsx +424 -0
- package/src/components/dialog-edit-project.tsx +245 -0
- package/src/components/dialog-fork.tsx +100 -0
- package/src/components/dialog-manage-models.tsx +76 -0
- package/src/components/dialog-release-notes.tsx +158 -0
- package/src/components/dialog-select-directory.tsx +326 -0
- package/src/components/dialog-select-file.tsx +404 -0
- package/src/components/dialog-select-mcp.tsx +96 -0
- package/src/components/dialog-select-model-unpaid.tsx +132 -0
- package/src/components/dialog-select-model.tsx +271 -0
- package/src/components/dialog-select-provider.tsx +87 -0
- package/src/components/dialog-select-server.tsx +536 -0
- package/src/components/dialog-settings.tsx +82 -0
- package/src/components/file-tree.test.ts +77 -0
- package/src/components/file-tree.tsx +468 -0
- package/src/components/link.tsx +17 -0
- package/src/components/model-tooltip.tsx +91 -0
- package/src/components/prompt-input/attachments.ts +145 -0
- package/src/components/prompt-input/build-request-parts.test.ts +277 -0
- package/src/components/prompt-input/build-request-parts.ts +190 -0
- package/src/components/prompt-input/context-items.tsx +82 -0
- package/src/components/prompt-input/drag-overlay.tsx +20 -0
- package/src/components/prompt-input/editor-dom.test.ts +51 -0
- package/src/components/prompt-input/editor-dom.ts +135 -0
- package/src/components/prompt-input/history.test.ts +69 -0
- package/src/components/prompt-input/history.ts +160 -0
- package/src/components/prompt-input/image-attachments.tsx +51 -0
- package/src/components/prompt-input/placeholder.test.ts +35 -0
- package/src/components/prompt-input/placeholder.ts +13 -0
- package/src/components/prompt-input/slash-popover.tsx +144 -0
- package/src/components/prompt-input/submit.ts +411 -0
- package/src/components/prompt-input.tsx +1199 -0
- package/src/components/question-dock.tsx +295 -0
- package/src/components/server/server-row.tsx +77 -0
- package/src/components/session/index.ts +5 -0
- package/src/components/session/session-context-metrics.test.ts +93 -0
- package/src/components/session/session-context-metrics.ts +94 -0
- package/src/components/session/session-context-tab.tsx +400 -0
- package/src/components/session/session-header.tsx +571 -0
- package/src/components/session/session-new-view.tsx +78 -0
- package/src/components/session/session-sortable-tab.tsx +63 -0
- package/src/components/session/session-sortable-terminal-tab.tsx +190 -0
- package/src/components/session-context-usage.tsx +100 -0
- package/src/components/settings-agents.tsx +15 -0
- package/src/components/settings-commands.tsx +15 -0
- package/src/components/settings-general.tsx +434 -0
- package/src/components/settings-keybinds.tsx +435 -0
- package/src/components/settings-mcp.tsx +15 -0
- package/src/components/settings-models.tsx +130 -0
- package/src/components/settings-permissions.tsx +228 -0
- package/src/components/settings-providers.tsx +264 -0
- package/src/components/status-popover.tsx +371 -0
- package/src/components/terminal.tsx +464 -0
- package/src/components/titlebar-history.test.ts +63 -0
- package/src/components/titlebar-history.ts +57 -0
- package/src/components/titlebar.tsx +261 -0
- package/src/context/command-keybind.test.ts +43 -0
- package/src/context/command.test.ts +25 -0
- package/src/context/command.tsx +365 -0
- package/src/context/comments.test.ts +111 -0
- package/src/context/comments.tsx +185 -0
- package/src/context/file/content-cache.ts +88 -0
- package/src/context/file/path.test.ts +352 -0
- package/src/context/file/path.ts +143 -0
- package/src/context/file/tree-store.ts +170 -0
- package/src/context/file/types.ts +41 -0
- package/src/context/file/view-cache.ts +136 -0
- package/src/context/file/watcher.test.ts +118 -0
- package/src/context/file/watcher.ts +52 -0
- package/src/context/file-content-eviction-accounting.test.ts +65 -0
- package/src/context/file.tsx +263 -0
- package/src/context/global-sdk.tsx +108 -0
- package/src/context/global-sync/bootstrap.ts +195 -0
- package/src/context/global-sync/child-store.ts +263 -0
- package/src/context/global-sync/event-reducer.test.ts +201 -0
- package/src/context/global-sync/event-reducer.ts +319 -0
- package/src/context/global-sync/eviction.ts +28 -0
- package/src/context/global-sync/queue.ts +83 -0
- package/src/context/global-sync/session-load.ts +26 -0
- package/src/context/global-sync/session-trim.test.ts +59 -0
- package/src/context/global-sync/session-trim.ts +56 -0
- package/src/context/global-sync/types.ts +134 -0
- package/src/context/global-sync/utils.ts +25 -0
- package/src/context/global-sync.test.ts +136 -0
- package/src/context/global-sync.tsx +365 -0
- package/src/context/highlights.tsx +225 -0
- package/src/context/language.tsx +226 -0
- package/src/context/layout-scroll.test.ts +36 -0
- package/src/context/layout-scroll.ts +118 -0
- package/src/context/layout.test.ts +69 -0
- package/src/context/layout.tsx +844 -0
- package/src/context/local.tsx +229 -0
- package/src/context/models.tsx +140 -0
- package/src/context/notification-index.ts +66 -0
- package/src/context/notification.test.ts +73 -0
- package/src/context/notification.tsx +199 -0
- package/src/context/permission.tsx +186 -0
- package/src/context/platform.tsx +75 -0
- package/src/context/prompt.tsx +246 -0
- package/src/context/sdk.tsx +48 -0
- package/src/context/server.tsx +208 -0
- package/src/context/settings.tsx +177 -0
- package/src/context/sync-optimistic.test.ts +56 -0
- package/src/context/sync.tsx +358 -0
- package/src/context/terminal.test.ts +38 -0
- package/src/context/terminal.tsx +283 -0
- package/src/entry.tsx +104 -0
- package/src/env.d.ts +8 -0
- package/src/hooks/use-providers.ts +31 -0
- package/src/i18n/ar.ts +716 -0
- package/src/i18n/br.ts +722 -0
- package/src/i18n/bs.ts +749 -0
- package/src/i18n/da.ts +721 -0
- package/src/i18n/de.ts +766 -0
- package/src/i18n/en.ts +792 -0
- package/src/i18n/es.ts +727 -0
- package/src/i18n/fr.ts +733 -0
- package/src/i18n/ja.ts +715 -0
- package/src/i18n/ko.ts +720 -0
- package/src/i18n/no.ts +723 -0
- package/src/i18n/parity.test.ts +31 -0
- package/src/i18n/pl.ts +723 -0
- package/src/i18n/ru.ts +727 -0
- package/src/i18n/th.ts +714 -0
- package/src/i18n/zh.ts +754 -0
- package/src/i18n/zht.ts +752 -0
- package/src/index.css +1 -0
- package/src/index.ts +3 -0
- package/src/pages/directory-layout.tsx +71 -0
- package/src/pages/error.tsx +290 -0
- package/src/pages/home.tsx +126 -0
- package/src/pages/layout/deep-links.ts +26 -0
- package/src/pages/layout/helpers.test.ts +63 -0
- package/src/pages/layout/helpers.ts +65 -0
- package/src/pages/layout/inline-editor.tsx +113 -0
- package/src/pages/layout/sidebar-items.tsx +328 -0
- package/src/pages/layout/sidebar-project-helpers.test.ts +63 -0
- package/src/pages/layout/sidebar-project-helpers.ts +11 -0
- package/src/pages/layout/sidebar-project.tsx +283 -0
- package/src/pages/layout/sidebar-shell-helpers.ts +1 -0
- package/src/pages/layout/sidebar-shell.test.ts +13 -0
- package/src/pages/layout/sidebar-shell.tsx +109 -0
- package/src/pages/layout/sidebar-workspace-helpers.ts +2 -0
- package/src/pages/layout/sidebar-workspace.test.ts +13 -0
- package/src/pages/layout/sidebar-workspace.tsx +410 -0
- package/src/pages/layout.tsx +1996 -0
- package/src/pages/session/file-tab-scroll.test.ts +40 -0
- package/src/pages/session/file-tab-scroll.ts +67 -0
- package/src/pages/session/file-tabs.tsx +516 -0
- package/src/pages/session/helpers.test.ts +61 -0
- package/src/pages/session/helpers.ts +38 -0
- package/src/pages/session/message-gesture.test.ts +62 -0
- package/src/pages/session/message-gesture.ts +21 -0
- package/src/pages/session/message-timeline.tsx +348 -0
- package/src/pages/session/review-tab.tsx +158 -0
- package/src/pages/session/scroll-spy.test.ts +127 -0
- package/src/pages/session/scroll-spy.ts +274 -0
- package/src/pages/session/session-command-helpers.ts +10 -0
- package/src/pages/session/session-mobile-tabs.tsx +36 -0
- package/src/pages/session/session-prompt-dock.test.ts +22 -0
- package/src/pages/session/session-prompt-dock.tsx +137 -0
- package/src/pages/session/session-prompt-helpers.ts +4 -0
- package/src/pages/session/session-side-panel.tsx +319 -0
- package/src/pages/session/terminal-label.ts +16 -0
- package/src/pages/session/terminal-panel.test.ts +25 -0
- package/src/pages/session/terminal-panel.tsx +169 -0
- package/src/pages/session/use-session-commands.test.ts +44 -0
- package/src/pages/session/use-session-commands.tsx +455 -0
- package/src/pages/session/use-session-hash-scroll.test.ts +16 -0
- package/src/pages/session/use-session-hash-scroll.ts +174 -0
- package/src/pages/session.tsx +1755 -0
- package/src/sst-env.d.ts +12 -0
- package/src/utils/agent.ts +11 -0
- package/src/utils/aim.ts +138 -0
- package/src/utils/base64.ts +10 -0
- package/src/utils/dom.ts +51 -0
- package/src/utils/id.ts +99 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/perf.ts +135 -0
- package/src/utils/persist.ts +451 -0
- package/src/utils/prompt.ts +203 -0
- package/src/utils/runtime-adapters.test.ts +62 -0
- package/src/utils/runtime-adapters.ts +39 -0
- package/src/utils/same.ts +6 -0
- package/src/utils/scoped-cache.test.ts +69 -0
- package/src/utils/scoped-cache.ts +104 -0
- package/src/utils/server-health.test.ts +42 -0
- package/src/utils/server-health.ts +29 -0
- package/src/utils/solid-dnd.tsx +55 -0
- package/src/utils/sound.ts +117 -0
- package/src/utils/speech.ts +326 -0
- package/src/utils/time.ts +14 -0
- package/src/utils/worktree.test.ts +46 -0
- package/src/utils/worktree.ts +73 -0
- package/sst-env.d.ts +10 -0
- package/tsconfig.json +26 -0
- package/vite.config.ts +15 -0
- package/vite.js +26 -0
|
@@ -0,0 +1,1996 @@
|
|
|
1
|
+
import {
|
|
2
|
+
batch,
|
|
3
|
+
createEffect,
|
|
4
|
+
createMemo,
|
|
5
|
+
For,
|
|
6
|
+
on,
|
|
7
|
+
onCleanup,
|
|
8
|
+
onMount,
|
|
9
|
+
ParentProps,
|
|
10
|
+
Show,
|
|
11
|
+
untrack,
|
|
12
|
+
type JSX,
|
|
13
|
+
} from "solid-js"
|
|
14
|
+
import { A, useNavigate, useParams } from "@solidjs/router"
|
|
15
|
+
import { useLayout, LocalProject } from "@/context/layout"
|
|
16
|
+
import { useGlobalSync } from "@/context/global-sync"
|
|
17
|
+
import { Persist, persisted } from "@/utils/persist"
|
|
18
|
+
import { base64Encode } from "@nikcli-ai/util/encode"
|
|
19
|
+
import { decode64 } from "@/utils/base64"
|
|
20
|
+
import { ResizeHandle } from "@nikcli-ai/ui/resize-handle"
|
|
21
|
+
import { Button } from "@nikcli-ai/ui/button"
|
|
22
|
+
import { Icon } from "@nikcli-ai/ui/icon"
|
|
23
|
+
import { IconButton } from "@nikcli-ai/ui/icon-button"
|
|
24
|
+
import { Tooltip, TooltipKeybind } from "@nikcli-ai/ui/tooltip"
|
|
25
|
+
import { DropdownMenu } from "@nikcli-ai/ui/dropdown-menu"
|
|
26
|
+
import { Dialog } from "@nikcli-ai/ui/dialog"
|
|
27
|
+
import { getFilename } from "@nikcli-ai/util/path"
|
|
28
|
+
import { Session, type Message } from "@nikcli-ai/sdk/v2/client"
|
|
29
|
+
import { usePlatform } from "@/context/platform"
|
|
30
|
+
import { useSettings } from "@/context/settings"
|
|
31
|
+
import { createStore, produce, reconcile } from "solid-js/store"
|
|
32
|
+
import { DragDropProvider, DragDropSensors, DragOverlay, SortableProvider, closestCenter } from "@thisbeyond/solid-dnd"
|
|
33
|
+
import type { DragEvent } from "@thisbeyond/solid-dnd"
|
|
34
|
+
import { useProviders } from "@/hooks/use-providers"
|
|
35
|
+
import { showToast, Toast, toaster } from "@nikcli-ai/ui/toast"
|
|
36
|
+
import { useGlobalSDK } from "@/context/global-sdk"
|
|
37
|
+
import { useNotification } from "@/context/notification"
|
|
38
|
+
import { usePermission } from "@/context/permission"
|
|
39
|
+
import { Binary } from "@nikcli-ai/util/binary"
|
|
40
|
+
import { retry } from "@nikcli-ai/util/retry"
|
|
41
|
+
import { playSound, soundSrc } from "@/utils/sound"
|
|
42
|
+
import { createAim } from "@/utils/aim"
|
|
43
|
+
import { Worktree as WorktreeState } from "@/utils/worktree"
|
|
44
|
+
|
|
45
|
+
import { useDialog } from "@nikcli-ai/ui/context/dialog"
|
|
46
|
+
import { useTheme, type ColorScheme } from "@nikcli-ai/ui/theme"
|
|
47
|
+
import { DialogSelectProvider } from "@/components/dialog-select-provider"
|
|
48
|
+
import { DialogSelectServer } from "@/components/dialog-select-server"
|
|
49
|
+
import { DialogSettings } from "@/components/dialog-settings"
|
|
50
|
+
import { useCommand, type CommandOption } from "@/context/command"
|
|
51
|
+
import { ConstrainDragXAxis } from "@/utils/solid-dnd"
|
|
52
|
+
import { navStart } from "@/utils/perf"
|
|
53
|
+
import { DialogSelectDirectory } from "@/components/dialog-select-directory"
|
|
54
|
+
import { DialogEditProject } from "@/components/dialog-edit-project"
|
|
55
|
+
import { Titlebar } from "@/components/titlebar"
|
|
56
|
+
import { useServer } from "@/context/server"
|
|
57
|
+
import { useLanguage, type Locale } from "@/context/language"
|
|
58
|
+
import {
|
|
59
|
+
childMapByParent,
|
|
60
|
+
displayName,
|
|
61
|
+
errorMessage,
|
|
62
|
+
getDraggableId,
|
|
63
|
+
sortedRootSessions,
|
|
64
|
+
syncWorkspaceOrder,
|
|
65
|
+
workspaceKey,
|
|
66
|
+
} from "./layout/helpers"
|
|
67
|
+
import { collectOpenProjectDeepLinks, deepLinkEvent, drainPendingDeepLinks } from "./layout/deep-links"
|
|
68
|
+
import { createInlineEditorController } from "./layout/inline-editor"
|
|
69
|
+
import {
|
|
70
|
+
LocalWorkspace,
|
|
71
|
+
SortableWorkspace,
|
|
72
|
+
WorkspaceDragOverlay,
|
|
73
|
+
type WorkspaceSidebarContext,
|
|
74
|
+
} from "./layout/sidebar-workspace"
|
|
75
|
+
import { workspaceOpenState } from "./layout/sidebar-workspace-helpers"
|
|
76
|
+
import { ProjectDragOverlay, SortableProject, type ProjectSidebarContext } from "./layout/sidebar-project"
|
|
77
|
+
import { SidebarContent } from "./layout/sidebar-shell"
|
|
78
|
+
|
|
79
|
+
export default function Layout(props: ParentProps) {
|
|
80
|
+
const [store, setStore, , ready] = persisted(
|
|
81
|
+
Persist.global("layout.page", ["layout.page.v1"]),
|
|
82
|
+
createStore({
|
|
83
|
+
lastSession: {} as { [directory: string]: string },
|
|
84
|
+
activeProject: undefined as string | undefined,
|
|
85
|
+
activeWorkspace: undefined as string | undefined,
|
|
86
|
+
workspaceOrder: {} as Record<string, string[]>,
|
|
87
|
+
workspaceName: {} as Record<string, string>,
|
|
88
|
+
workspaceBranchName: {} as Record<string, Record<string, string>>,
|
|
89
|
+
workspaceExpanded: {} as Record<string, boolean>,
|
|
90
|
+
}),
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
const pageReady = createMemo(() => ready())
|
|
94
|
+
|
|
95
|
+
let scrollContainerRef: HTMLDivElement | undefined
|
|
96
|
+
|
|
97
|
+
const params = useParams()
|
|
98
|
+
const globalSDK = useGlobalSDK()
|
|
99
|
+
const globalSync = useGlobalSync()
|
|
100
|
+
const layout = useLayout()
|
|
101
|
+
const layoutReady = createMemo(() => layout.ready())
|
|
102
|
+
const platform = usePlatform()
|
|
103
|
+
const settings = useSettings()
|
|
104
|
+
const server = useServer()
|
|
105
|
+
const notification = useNotification()
|
|
106
|
+
const permission = usePermission()
|
|
107
|
+
const navigate = useNavigate()
|
|
108
|
+
const providers = useProviders()
|
|
109
|
+
const dialog = useDialog()
|
|
110
|
+
const command = useCommand()
|
|
111
|
+
const theme = useTheme()
|
|
112
|
+
const language = useLanguage()
|
|
113
|
+
const initialDirectory = decode64(params.dir)
|
|
114
|
+
const availableThemeEntries = createMemo(() => Object.entries(theme.themes()))
|
|
115
|
+
const colorSchemeOrder: ColorScheme[] = ["system", "light", "dark"]
|
|
116
|
+
const colorSchemeKey: Record<ColorScheme, "theme.scheme.system" | "theme.scheme.light" | "theme.scheme.dark"> = {
|
|
117
|
+
system: "theme.scheme.system",
|
|
118
|
+
light: "theme.scheme.light",
|
|
119
|
+
dark: "theme.scheme.dark",
|
|
120
|
+
}
|
|
121
|
+
const colorSchemeLabel = (scheme: ColorScheme) => language.t(colorSchemeKey[scheme])
|
|
122
|
+
const currentDir = createMemo(() => decode64(params.dir) ?? "")
|
|
123
|
+
|
|
124
|
+
const [state, setState] = createStore({
|
|
125
|
+
autoselect: !initialDirectory,
|
|
126
|
+
busyWorkspaces: new Set<string>(),
|
|
127
|
+
hoverSession: undefined as string | undefined,
|
|
128
|
+
hoverProject: undefined as string | undefined,
|
|
129
|
+
scrollSessionKey: undefined as string | undefined,
|
|
130
|
+
nav: undefined as HTMLElement | undefined,
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
const editor = createInlineEditorController()
|
|
134
|
+
const setBusy = (directory: string, value: boolean) => {
|
|
135
|
+
const key = workspaceKey(directory)
|
|
136
|
+
setState("busyWorkspaces", (prev) => {
|
|
137
|
+
const next = new Set(prev)
|
|
138
|
+
if (value) next.add(key)
|
|
139
|
+
else next.delete(key)
|
|
140
|
+
return next
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
const isBusy = (directory: string) => state.busyWorkspaces.has(workspaceKey(directory))
|
|
144
|
+
const navLeave = { current: undefined as number | undefined }
|
|
145
|
+
|
|
146
|
+
const aim = createAim({
|
|
147
|
+
enabled: () => !layout.sidebar.opened(),
|
|
148
|
+
active: () => state.hoverProject,
|
|
149
|
+
el: () => state.nav,
|
|
150
|
+
onActivate: (directory) => {
|
|
151
|
+
globalSync.child(directory)
|
|
152
|
+
setState("hoverProject", directory)
|
|
153
|
+
setState("hoverSession", undefined)
|
|
154
|
+
},
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
onCleanup(() => {
|
|
158
|
+
if (navLeave.current !== undefined) clearTimeout(navLeave.current)
|
|
159
|
+
aim.reset()
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
const sidebarHovering = createMemo(() => !layout.sidebar.opened() && state.hoverProject !== undefined)
|
|
163
|
+
const sidebarExpanded = createMemo(() => layout.sidebar.opened() || sidebarHovering())
|
|
164
|
+
const clearHoverProjectSoon = () => queueMicrotask(() => setState("hoverProject", undefined))
|
|
165
|
+
const setHoverSession = (id: string | undefined) => setState("hoverSession", id)
|
|
166
|
+
|
|
167
|
+
const hoverProjectData = createMemo(() => {
|
|
168
|
+
const id = state.hoverProject
|
|
169
|
+
if (!id) return
|
|
170
|
+
return layout.projects.list().find((project) => project.worktree === id)
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
createEffect(() => {
|
|
174
|
+
if (!layout.sidebar.opened()) return
|
|
175
|
+
aim.reset()
|
|
176
|
+
setState("hoverProject", undefined)
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
createEffect(() => {
|
|
180
|
+
if (state.hoverProject !== undefined) return
|
|
181
|
+
aim.reset()
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
createEffect(
|
|
185
|
+
on(
|
|
186
|
+
() => ({ dir: params.dir, id: params.id }),
|
|
187
|
+
() => {
|
|
188
|
+
if (layout.sidebar.opened()) return
|
|
189
|
+
if (!state.hoverProject) return
|
|
190
|
+
aim.reset()
|
|
191
|
+
setState("hoverSession", undefined)
|
|
192
|
+
setState("hoverProject", undefined)
|
|
193
|
+
},
|
|
194
|
+
{ defer: true },
|
|
195
|
+
),
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
const autoselecting = createMemo(() => {
|
|
199
|
+
if (params.dir) return false
|
|
200
|
+
if (!state.autoselect) return false
|
|
201
|
+
if (!pageReady()) return true
|
|
202
|
+
if (!layoutReady()) return true
|
|
203
|
+
const list = layout.projects.list()
|
|
204
|
+
if (list.length > 0) return true
|
|
205
|
+
return !!server.projects.last()
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
createEffect(() => {
|
|
209
|
+
if (!state.autoselect) return
|
|
210
|
+
const dir = params.dir
|
|
211
|
+
if (!dir) return
|
|
212
|
+
const directory = decode64(dir)
|
|
213
|
+
if (!directory) return
|
|
214
|
+
setState("autoselect", false)
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
const editorOpen = editor.editorOpen
|
|
218
|
+
const openEditor = editor.openEditor
|
|
219
|
+
const closeEditor = editor.closeEditor
|
|
220
|
+
const setEditor = editor.setEditor
|
|
221
|
+
const InlineEditor = editor.InlineEditor
|
|
222
|
+
|
|
223
|
+
function cycleTheme(direction = 1) {
|
|
224
|
+
const ids = availableThemeEntries().map(([id]) => id)
|
|
225
|
+
if (ids.length === 0) return
|
|
226
|
+
const currentIndex = ids.indexOf(theme.themeId())
|
|
227
|
+
const nextIndex = currentIndex === -1 ? 0 : (currentIndex + direction + ids.length) % ids.length
|
|
228
|
+
const nextThemeId = ids[nextIndex]
|
|
229
|
+
theme.setTheme(nextThemeId)
|
|
230
|
+
const nextTheme = theme.themes()[nextThemeId]
|
|
231
|
+
showToast({
|
|
232
|
+
title: language.t("toast.theme.title"),
|
|
233
|
+
description: nextTheme?.name ?? nextThemeId,
|
|
234
|
+
})
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function cycleColorScheme(direction = 1) {
|
|
238
|
+
const current = theme.colorScheme()
|
|
239
|
+
const currentIndex = colorSchemeOrder.indexOf(current)
|
|
240
|
+
const nextIndex =
|
|
241
|
+
currentIndex === -1 ? 0 : (currentIndex + direction + colorSchemeOrder.length) % colorSchemeOrder.length
|
|
242
|
+
const next = colorSchemeOrder[nextIndex]
|
|
243
|
+
theme.setColorScheme(next)
|
|
244
|
+
showToast({
|
|
245
|
+
title: language.t("toast.scheme.title"),
|
|
246
|
+
description: colorSchemeLabel(next),
|
|
247
|
+
})
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function setLocale(next: Locale) {
|
|
251
|
+
if (next === language.locale()) return
|
|
252
|
+
language.setLocale(next)
|
|
253
|
+
showToast({
|
|
254
|
+
title: language.t("toast.language.title"),
|
|
255
|
+
description: language.t("toast.language.description", { language: language.label(next) }),
|
|
256
|
+
})
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function cycleLanguage(direction = 1) {
|
|
260
|
+
const locales = language.locales
|
|
261
|
+
const currentIndex = locales.indexOf(language.locale())
|
|
262
|
+
const nextIndex = currentIndex === -1 ? 0 : (currentIndex + direction + locales.length) % locales.length
|
|
263
|
+
const next = locales[nextIndex]
|
|
264
|
+
if (!next) return
|
|
265
|
+
setLocale(next)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
onMount(() => {
|
|
269
|
+
if (!platform.checkUpdate || !platform.update || !platform.restart) return
|
|
270
|
+
|
|
271
|
+
let toastId: number | undefined
|
|
272
|
+
let interval: ReturnType<typeof setInterval> | undefined
|
|
273
|
+
|
|
274
|
+
async function pollUpdate() {
|
|
275
|
+
const { updateAvailable, version } = await platform.checkUpdate!()
|
|
276
|
+
if (updateAvailable && toastId === undefined) {
|
|
277
|
+
toastId = showToast({
|
|
278
|
+
persistent: true,
|
|
279
|
+
icon: "download",
|
|
280
|
+
title: language.t("toast.update.title"),
|
|
281
|
+
description: language.t("toast.update.description", { version: version ?? "" }),
|
|
282
|
+
actions: [
|
|
283
|
+
{
|
|
284
|
+
label: language.t("toast.update.action.installRestart"),
|
|
285
|
+
onClick: async () => {
|
|
286
|
+
await platform.update!()
|
|
287
|
+
await platform.restart!()
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
label: language.t("toast.update.action.notYet"),
|
|
292
|
+
onClick: "dismiss",
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
})
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
createEffect(() => {
|
|
300
|
+
if (!settings.ready()) return
|
|
301
|
+
|
|
302
|
+
if (!settings.updates.startup()) {
|
|
303
|
+
if (interval === undefined) return
|
|
304
|
+
clearInterval(interval)
|
|
305
|
+
interval = undefined
|
|
306
|
+
return
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (interval !== undefined) return
|
|
310
|
+
void pollUpdate()
|
|
311
|
+
interval = setInterval(pollUpdate, 10 * 60 * 1000)
|
|
312
|
+
})
|
|
313
|
+
|
|
314
|
+
onCleanup(() => {
|
|
315
|
+
if (interval === undefined) return
|
|
316
|
+
clearInterval(interval)
|
|
317
|
+
})
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
onMount(() => {
|
|
321
|
+
const toastBySession = new Map<string, number>()
|
|
322
|
+
const alertedAtBySession = new Map<string, number>()
|
|
323
|
+
const cooldownMs = 5000
|
|
324
|
+
|
|
325
|
+
const unsub = globalSDK.event.listen((e) => {
|
|
326
|
+
if (e.details?.type !== "permission.asked" && e.details?.type !== "question.asked") return
|
|
327
|
+
const title =
|
|
328
|
+
e.details.type === "permission.asked"
|
|
329
|
+
? language.t("notification.permission.title")
|
|
330
|
+
: language.t("notification.question.title")
|
|
331
|
+
const icon = e.details.type === "permission.asked" ? ("checklist" as const) : ("bubble-5" as const)
|
|
332
|
+
const directory = e.name
|
|
333
|
+
const props = e.details.properties
|
|
334
|
+
if (e.details.type === "permission.asked" && permission.autoResponds(e.details.properties, directory)) return
|
|
335
|
+
|
|
336
|
+
const [store] = globalSync.child(directory, { bootstrap: false })
|
|
337
|
+
const session = store.session.find((s) => s.id === props.sessionID)
|
|
338
|
+
const sessionKey = `${directory}:${props.sessionID}`
|
|
339
|
+
|
|
340
|
+
const sessionTitle = session?.title ?? language.t("command.session.new")
|
|
341
|
+
const projectName = getFilename(directory)
|
|
342
|
+
const description =
|
|
343
|
+
e.details.type === "permission.asked"
|
|
344
|
+
? language.t("notification.permission.description", { sessionTitle, projectName })
|
|
345
|
+
: language.t("notification.question.description", { sessionTitle, projectName })
|
|
346
|
+
const href = `/${base64Encode(directory)}/session/${props.sessionID}`
|
|
347
|
+
|
|
348
|
+
const now = Date.now()
|
|
349
|
+
const lastAlerted = alertedAtBySession.get(sessionKey) ?? 0
|
|
350
|
+
if (now - lastAlerted < cooldownMs) return
|
|
351
|
+
alertedAtBySession.set(sessionKey, now)
|
|
352
|
+
|
|
353
|
+
if (e.details.type === "permission.asked") {
|
|
354
|
+
playSound(soundSrc(settings.sounds.permissions()))
|
|
355
|
+
if (settings.notifications.permissions()) {
|
|
356
|
+
void platform.notify(title, description, href)
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (e.details.type === "question.asked") {
|
|
361
|
+
if (settings.notifications.agent()) {
|
|
362
|
+
void platform.notify(title, description, href)
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const currentSession = params.id
|
|
367
|
+
if (directory === currentDir() && props.sessionID === currentSession) return
|
|
368
|
+
if (directory === currentDir() && session?.parentID === currentSession) return
|
|
369
|
+
|
|
370
|
+
const existingToastId = toastBySession.get(sessionKey)
|
|
371
|
+
if (existingToastId !== undefined) toaster.dismiss(existingToastId)
|
|
372
|
+
|
|
373
|
+
const toastId = showToast({
|
|
374
|
+
persistent: true,
|
|
375
|
+
icon,
|
|
376
|
+
title,
|
|
377
|
+
description,
|
|
378
|
+
actions: [
|
|
379
|
+
{
|
|
380
|
+
label: language.t("notification.action.goToSession"),
|
|
381
|
+
onClick: () => navigate(href),
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
label: language.t("common.dismiss"),
|
|
385
|
+
onClick: "dismiss",
|
|
386
|
+
},
|
|
387
|
+
],
|
|
388
|
+
})
|
|
389
|
+
toastBySession.set(sessionKey, toastId)
|
|
390
|
+
})
|
|
391
|
+
onCleanup(unsub)
|
|
392
|
+
|
|
393
|
+
createEffect(() => {
|
|
394
|
+
const currentSession = params.id
|
|
395
|
+
if (!currentDir() || !currentSession) return
|
|
396
|
+
const sessionKey = `${currentDir()}:${currentSession}`
|
|
397
|
+
const toastId = toastBySession.get(sessionKey)
|
|
398
|
+
if (toastId !== undefined) {
|
|
399
|
+
toaster.dismiss(toastId)
|
|
400
|
+
toastBySession.delete(sessionKey)
|
|
401
|
+
alertedAtBySession.delete(sessionKey)
|
|
402
|
+
}
|
|
403
|
+
const [store] = globalSync.child(currentDir(), { bootstrap: false })
|
|
404
|
+
const childSessions = store.session.filter((s) => s.parentID === currentSession)
|
|
405
|
+
for (const child of childSessions) {
|
|
406
|
+
const childKey = `${currentDir()}:${child.id}`
|
|
407
|
+
const childToastId = toastBySession.get(childKey)
|
|
408
|
+
if (childToastId !== undefined) {
|
|
409
|
+
toaster.dismiss(childToastId)
|
|
410
|
+
toastBySession.delete(childKey)
|
|
411
|
+
alertedAtBySession.delete(childKey)
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
})
|
|
415
|
+
})
|
|
416
|
+
|
|
417
|
+
function scrollToSession(sessionId: string, sessionKey: string) {
|
|
418
|
+
if (!scrollContainerRef) return
|
|
419
|
+
if (state.scrollSessionKey === sessionKey) return
|
|
420
|
+
const element = scrollContainerRef.querySelector(`[data-session-id="${sessionId}"]`)
|
|
421
|
+
if (!element) return
|
|
422
|
+
const containerRect = scrollContainerRef.getBoundingClientRect()
|
|
423
|
+
const elementRect = element.getBoundingClientRect()
|
|
424
|
+
if (elementRect.top >= containerRect.top && elementRect.bottom <= containerRect.bottom) {
|
|
425
|
+
setState("scrollSessionKey", sessionKey)
|
|
426
|
+
return
|
|
427
|
+
}
|
|
428
|
+
setState("scrollSessionKey", sessionKey)
|
|
429
|
+
element.scrollIntoView({ block: "nearest", behavior: "smooth" })
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const currentProject = createMemo(() => {
|
|
433
|
+
const directory = currentDir()
|
|
434
|
+
if (!directory) return
|
|
435
|
+
|
|
436
|
+
const projects = layout.projects.list()
|
|
437
|
+
|
|
438
|
+
const sandbox = projects.find((p) => p.sandboxes?.includes(directory))
|
|
439
|
+
if (sandbox) return sandbox
|
|
440
|
+
|
|
441
|
+
const direct = projects.find((p) => p.worktree === directory)
|
|
442
|
+
if (direct) return direct
|
|
443
|
+
|
|
444
|
+
const [child] = globalSync.child(directory, { bootstrap: false })
|
|
445
|
+
const id = child.project
|
|
446
|
+
if (!id) return
|
|
447
|
+
|
|
448
|
+
const meta = globalSync.data.project.find((p) => p.id === id)
|
|
449
|
+
const root = meta?.worktree
|
|
450
|
+
if (!root) return
|
|
451
|
+
|
|
452
|
+
return projects.find((p) => p.worktree === root)
|
|
453
|
+
})
|
|
454
|
+
|
|
455
|
+
createEffect(
|
|
456
|
+
on(
|
|
457
|
+
() => ({ ready: pageReady(), project: currentProject() }),
|
|
458
|
+
(value) => {
|
|
459
|
+
if (!value.ready) return
|
|
460
|
+
const project = value.project
|
|
461
|
+
if (!project) return
|
|
462
|
+
const last = server.projects.last()
|
|
463
|
+
if (last === project.worktree) return
|
|
464
|
+
server.projects.touch(project.worktree)
|
|
465
|
+
},
|
|
466
|
+
{ defer: true },
|
|
467
|
+
),
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
createEffect(
|
|
471
|
+
on(
|
|
472
|
+
() => ({ ready: pageReady(), layoutReady: layoutReady(), dir: params.dir, list: layout.projects.list() }),
|
|
473
|
+
(value) => {
|
|
474
|
+
if (!value.ready) return
|
|
475
|
+
if (!value.layoutReady) return
|
|
476
|
+
if (!state.autoselect) return
|
|
477
|
+
if (value.dir) return
|
|
478
|
+
|
|
479
|
+
const last = server.projects.last()
|
|
480
|
+
|
|
481
|
+
if (value.list.length === 0) {
|
|
482
|
+
if (!last) return
|
|
483
|
+
setState("autoselect", false)
|
|
484
|
+
openProject(last, false)
|
|
485
|
+
navigateToProject(last)
|
|
486
|
+
return
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const next = value.list.find((project) => project.worktree === last) ?? value.list[0]
|
|
490
|
+
if (!next) return
|
|
491
|
+
setState("autoselect", false)
|
|
492
|
+
openProject(next.worktree, false)
|
|
493
|
+
navigateToProject(next.worktree)
|
|
494
|
+
},
|
|
495
|
+
),
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
const workspaceName = (directory: string, projectId?: string, branch?: string) => {
|
|
499
|
+
const key = workspaceKey(directory)
|
|
500
|
+
const direct = store.workspaceName[key] ?? store.workspaceName[directory]
|
|
501
|
+
if (direct) return direct
|
|
502
|
+
if (!projectId) return
|
|
503
|
+
if (!branch) return
|
|
504
|
+
return store.workspaceBranchName[projectId]?.[branch]
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
const setWorkspaceName = (directory: string, next: string, projectId?: string, branch?: string) => {
|
|
508
|
+
const key = workspaceKey(directory)
|
|
509
|
+
setStore("workspaceName", (prev) => ({ ...(prev ?? {}), [key]: next }))
|
|
510
|
+
if (!projectId) return
|
|
511
|
+
if (!branch) return
|
|
512
|
+
setStore("workspaceBranchName", projectId, (prev) => ({ ...(prev ?? {}), [branch]: next }))
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const workspaceLabel = (directory: string, branch?: string, projectId?: string) =>
|
|
516
|
+
workspaceName(directory, projectId, branch) ?? branch ?? getFilename(directory)
|
|
517
|
+
|
|
518
|
+
const workspaceSetting = createMemo(() => {
|
|
519
|
+
const project = currentProject()
|
|
520
|
+
if (!project) return false
|
|
521
|
+
if (project.vcs !== "git") return false
|
|
522
|
+
return layout.sidebar.workspaces(project.worktree)()
|
|
523
|
+
})
|
|
524
|
+
|
|
525
|
+
createEffect(() => {
|
|
526
|
+
if (!pageReady()) return
|
|
527
|
+
if (!layoutReady()) return
|
|
528
|
+
const project = currentProject()
|
|
529
|
+
if (!project) return
|
|
530
|
+
|
|
531
|
+
const local = project.worktree
|
|
532
|
+
const dirs = [project.worktree, ...(project.sandboxes ?? [])]
|
|
533
|
+
const existing = store.workspaceOrder[project.worktree]
|
|
534
|
+
const merged = syncWorkspaceOrder(local, dirs, existing)
|
|
535
|
+
if (!existing) {
|
|
536
|
+
setStore("workspaceOrder", project.worktree, merged)
|
|
537
|
+
return
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
if (merged.length !== existing.length) {
|
|
541
|
+
setStore("workspaceOrder", project.worktree, merged)
|
|
542
|
+
return
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
if (merged.some((d, i) => d !== existing[i])) {
|
|
546
|
+
setStore("workspaceOrder", project.worktree, merged)
|
|
547
|
+
}
|
|
548
|
+
})
|
|
549
|
+
|
|
550
|
+
createEffect(() => {
|
|
551
|
+
if (!pageReady()) return
|
|
552
|
+
if (!layoutReady()) return
|
|
553
|
+
const projects = layout.projects.list()
|
|
554
|
+
for (const [directory, expanded] of Object.entries(store.workspaceExpanded)) {
|
|
555
|
+
if (!expanded) continue
|
|
556
|
+
const project = projects.find((item) => item.worktree === directory || item.sandboxes?.includes(directory))
|
|
557
|
+
if (!project) continue
|
|
558
|
+
if (project.vcs === "git" && layout.sidebar.workspaces(project.worktree)()) continue
|
|
559
|
+
setStore("workspaceExpanded", directory, false)
|
|
560
|
+
}
|
|
561
|
+
})
|
|
562
|
+
|
|
563
|
+
const currentSessions = createMemo(() => {
|
|
564
|
+
const project = currentProject()
|
|
565
|
+
if (!project) return [] as Session[]
|
|
566
|
+
const now = Date.now()
|
|
567
|
+
if (workspaceSetting()) {
|
|
568
|
+
const dirs = workspaceIds(project)
|
|
569
|
+
const activeDir = currentDir()
|
|
570
|
+
const result: Session[] = []
|
|
571
|
+
for (const dir of dirs) {
|
|
572
|
+
const expanded = store.workspaceExpanded[dir] ?? dir === project.worktree
|
|
573
|
+
const active = dir === activeDir
|
|
574
|
+
if (!expanded && !active) continue
|
|
575
|
+
const [dirStore] = globalSync.child(dir, { bootstrap: true })
|
|
576
|
+
const dirSessions = sortedRootSessions(dirStore, now)
|
|
577
|
+
result.push(...dirSessions)
|
|
578
|
+
}
|
|
579
|
+
return result
|
|
580
|
+
}
|
|
581
|
+
const [projectStore] = globalSync.child(project.worktree)
|
|
582
|
+
return sortedRootSessions(projectStore, now)
|
|
583
|
+
})
|
|
584
|
+
|
|
585
|
+
type PrefetchQueue = {
|
|
586
|
+
inflight: Set<string>
|
|
587
|
+
pending: string[]
|
|
588
|
+
pendingSet: Set<string>
|
|
589
|
+
running: number
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
const prefetchChunk = 200
|
|
593
|
+
const prefetchConcurrency = 1
|
|
594
|
+
const prefetchPendingLimit = 6
|
|
595
|
+
const prefetchToken = { value: 0 }
|
|
596
|
+
const prefetchQueues = new Map<string, PrefetchQueue>()
|
|
597
|
+
|
|
598
|
+
const PREFETCH_MAX_SESSIONS_PER_DIR = 10
|
|
599
|
+
const prefetchedByDir = new Map<string, Map<string, true>>()
|
|
600
|
+
|
|
601
|
+
const lruFor = (directory: string) => {
|
|
602
|
+
const existing = prefetchedByDir.get(directory)
|
|
603
|
+
if (existing) return existing
|
|
604
|
+
const created = new Map<string, true>()
|
|
605
|
+
prefetchedByDir.set(directory, created)
|
|
606
|
+
return created
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const markPrefetched = (directory: string, sessionID: string) => {
|
|
610
|
+
const lru = lruFor(directory)
|
|
611
|
+
if (lru.has(sessionID)) lru.delete(sessionID)
|
|
612
|
+
lru.set(sessionID, true)
|
|
613
|
+
while (lru.size > PREFETCH_MAX_SESSIONS_PER_DIR) {
|
|
614
|
+
const oldest = lru.keys().next().value as string | undefined
|
|
615
|
+
if (!oldest) return
|
|
616
|
+
lru.delete(oldest)
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
createEffect(() => {
|
|
621
|
+
params.dir
|
|
622
|
+
globalSDK.url
|
|
623
|
+
|
|
624
|
+
prefetchToken.value += 1
|
|
625
|
+
for (const q of prefetchQueues.values()) {
|
|
626
|
+
q.pending.length = 0
|
|
627
|
+
q.pendingSet.clear()
|
|
628
|
+
}
|
|
629
|
+
})
|
|
630
|
+
|
|
631
|
+
const queueFor = (directory: string) => {
|
|
632
|
+
const existing = prefetchQueues.get(directory)
|
|
633
|
+
if (existing) return existing
|
|
634
|
+
|
|
635
|
+
const created: PrefetchQueue = {
|
|
636
|
+
inflight: new Set(),
|
|
637
|
+
pending: [],
|
|
638
|
+
pendingSet: new Set(),
|
|
639
|
+
running: 0,
|
|
640
|
+
}
|
|
641
|
+
prefetchQueues.set(directory, created)
|
|
642
|
+
return created
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
async function prefetchMessages(directory: string, sessionID: string, token: number) {
|
|
646
|
+
const [store, setStore] = globalSync.child(directory, { bootstrap: false })
|
|
647
|
+
|
|
648
|
+
return retry(() => globalSDK.client.session.messages({ directory, sessionID, limit: prefetchChunk }))
|
|
649
|
+
.then((messages) => {
|
|
650
|
+
if (prefetchToken.value !== token) return
|
|
651
|
+
|
|
652
|
+
const items = (messages.data ?? []).filter((x) => !!x?.info?.id)
|
|
653
|
+
const next = items
|
|
654
|
+
.map((x) => x.info)
|
|
655
|
+
.filter((m) => !!m?.id)
|
|
656
|
+
.slice()
|
|
657
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))
|
|
658
|
+
|
|
659
|
+
const current = store.message[sessionID] ?? []
|
|
660
|
+
const merged = (() => {
|
|
661
|
+
if (current.length === 0) return next
|
|
662
|
+
|
|
663
|
+
const map = new Map<string, Message>()
|
|
664
|
+
for (const item of current) {
|
|
665
|
+
if (!item?.id) continue
|
|
666
|
+
map.set(item.id, item)
|
|
667
|
+
}
|
|
668
|
+
for (const item of next) {
|
|
669
|
+
map.set(item.id, item)
|
|
670
|
+
}
|
|
671
|
+
return [...map.values()].sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))
|
|
672
|
+
})()
|
|
673
|
+
|
|
674
|
+
batch(() => {
|
|
675
|
+
setStore("message", sessionID, reconcile(merged, { key: "id" }))
|
|
676
|
+
|
|
677
|
+
for (const message of items) {
|
|
678
|
+
const currentParts = store.part[message.info.id] ?? []
|
|
679
|
+
const mergedParts = (() => {
|
|
680
|
+
if (currentParts.length === 0) {
|
|
681
|
+
return message.parts
|
|
682
|
+
.filter((p) => !!p?.id)
|
|
683
|
+
.slice()
|
|
684
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
const map = new Map<string, (typeof currentParts)[number]>()
|
|
688
|
+
for (const item of currentParts) {
|
|
689
|
+
if (!item?.id) continue
|
|
690
|
+
map.set(item.id, item)
|
|
691
|
+
}
|
|
692
|
+
for (const item of message.parts) {
|
|
693
|
+
if (!item?.id) continue
|
|
694
|
+
map.set(item.id, item)
|
|
695
|
+
}
|
|
696
|
+
return [...map.values()].sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))
|
|
697
|
+
})()
|
|
698
|
+
|
|
699
|
+
setStore("part", message.info.id, reconcile(mergedParts, { key: "id" }))
|
|
700
|
+
}
|
|
701
|
+
})
|
|
702
|
+
})
|
|
703
|
+
.catch(() => undefined)
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
const pumpPrefetch = (directory: string) => {
|
|
707
|
+
const q = queueFor(directory)
|
|
708
|
+
if (q.running >= prefetchConcurrency) return
|
|
709
|
+
|
|
710
|
+
const sessionID = q.pending.shift()
|
|
711
|
+
if (!sessionID) return
|
|
712
|
+
|
|
713
|
+
q.pendingSet.delete(sessionID)
|
|
714
|
+
q.inflight.add(sessionID)
|
|
715
|
+
q.running += 1
|
|
716
|
+
|
|
717
|
+
const token = prefetchToken.value
|
|
718
|
+
|
|
719
|
+
void prefetchMessages(directory, sessionID, token).finally(() => {
|
|
720
|
+
q.running -= 1
|
|
721
|
+
q.inflight.delete(sessionID)
|
|
722
|
+
pumpPrefetch(directory)
|
|
723
|
+
})
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
const prefetchSession = (session: Session, priority: "high" | "low" = "low") => {
|
|
727
|
+
const directory = session.directory
|
|
728
|
+
if (!directory) return
|
|
729
|
+
|
|
730
|
+
const [store] = globalSync.child(directory, { bootstrap: false })
|
|
731
|
+
const cached = untrack(() => store.message[session.id] !== undefined)
|
|
732
|
+
if (cached) return
|
|
733
|
+
|
|
734
|
+
const q = queueFor(directory)
|
|
735
|
+
if (q.inflight.has(session.id)) return
|
|
736
|
+
if (q.pendingSet.has(session.id)) return
|
|
737
|
+
|
|
738
|
+
const lru = lruFor(directory)
|
|
739
|
+
const known = lru.has(session.id)
|
|
740
|
+
if (!known && lru.size >= PREFETCH_MAX_SESSIONS_PER_DIR && priority !== "high") return
|
|
741
|
+
markPrefetched(directory, session.id)
|
|
742
|
+
|
|
743
|
+
if (priority === "high") q.pending.unshift(session.id)
|
|
744
|
+
if (priority !== "high") q.pending.push(session.id)
|
|
745
|
+
q.pendingSet.add(session.id)
|
|
746
|
+
|
|
747
|
+
while (q.pending.length > prefetchPendingLimit) {
|
|
748
|
+
const dropped = q.pending.pop()
|
|
749
|
+
if (!dropped) continue
|
|
750
|
+
q.pendingSet.delete(dropped)
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
pumpPrefetch(directory)
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
createEffect(() => {
|
|
757
|
+
const sessions = currentSessions()
|
|
758
|
+
const id = params.id
|
|
759
|
+
|
|
760
|
+
if (!id) {
|
|
761
|
+
const first = sessions[0]
|
|
762
|
+
if (first) prefetchSession(first)
|
|
763
|
+
|
|
764
|
+
const second = sessions[1]
|
|
765
|
+
if (second) prefetchSession(second)
|
|
766
|
+
return
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
const index = sessions.findIndex((s) => s.id === id)
|
|
770
|
+
if (index === -1) return
|
|
771
|
+
|
|
772
|
+
const next = sessions[index + 1]
|
|
773
|
+
if (next) prefetchSession(next)
|
|
774
|
+
|
|
775
|
+
const prev = sessions[index - 1]
|
|
776
|
+
if (prev) prefetchSession(prev)
|
|
777
|
+
})
|
|
778
|
+
|
|
779
|
+
function navigateSessionByOffset(offset: number) {
|
|
780
|
+
const sessions = currentSessions()
|
|
781
|
+
if (sessions.length === 0) return
|
|
782
|
+
|
|
783
|
+
const sessionIndex = params.id ? sessions.findIndex((s) => s.id === params.id) : -1
|
|
784
|
+
|
|
785
|
+
let targetIndex: number
|
|
786
|
+
if (sessionIndex === -1) {
|
|
787
|
+
targetIndex = offset > 0 ? 0 : sessions.length - 1
|
|
788
|
+
} else {
|
|
789
|
+
targetIndex = (sessionIndex + offset + sessions.length) % sessions.length
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
const session = sessions[targetIndex]
|
|
793
|
+
if (!session) return
|
|
794
|
+
|
|
795
|
+
const next = sessions[(targetIndex + 1) % sessions.length]
|
|
796
|
+
const prev = sessions[(targetIndex - 1 + sessions.length) % sessions.length]
|
|
797
|
+
|
|
798
|
+
if (offset > 0) {
|
|
799
|
+
if (next) prefetchSession(next, "high")
|
|
800
|
+
if (prev) prefetchSession(prev)
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
if (offset < 0) {
|
|
804
|
+
if (prev) prefetchSession(prev, "high")
|
|
805
|
+
if (next) prefetchSession(next)
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
if (import.meta.env.DEV) {
|
|
809
|
+
navStart({
|
|
810
|
+
dir: base64Encode(session.directory),
|
|
811
|
+
from: params.id,
|
|
812
|
+
to: session.id,
|
|
813
|
+
trigger: offset > 0 ? "alt+arrowdown" : "alt+arrowup",
|
|
814
|
+
})
|
|
815
|
+
}
|
|
816
|
+
navigateToSession(session)
|
|
817
|
+
queueMicrotask(() => scrollToSession(session.id, `${session.directory}:${session.id}`))
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
function navigateSessionByUnseen(offset: number) {
|
|
821
|
+
const sessions = currentSessions()
|
|
822
|
+
if (sessions.length === 0) return
|
|
823
|
+
|
|
824
|
+
const hasUnseen = sessions.some((session) => notification.session.unseenCount(session.id) > 0)
|
|
825
|
+
if (!hasUnseen) return
|
|
826
|
+
|
|
827
|
+
const activeIndex = params.id ? sessions.findIndex((s) => s.id === params.id) : -1
|
|
828
|
+
const start = activeIndex === -1 ? (offset > 0 ? -1 : 0) : activeIndex
|
|
829
|
+
|
|
830
|
+
for (let i = 1; i <= sessions.length; i++) {
|
|
831
|
+
const index = offset > 0 ? (start + i) % sessions.length : (start - i + sessions.length) % sessions.length
|
|
832
|
+
const session = sessions[index]
|
|
833
|
+
if (!session) continue
|
|
834
|
+
if (notification.session.unseenCount(session.id) === 0) continue
|
|
835
|
+
|
|
836
|
+
prefetchSession(session, "high")
|
|
837
|
+
|
|
838
|
+
const next = sessions[(index + 1) % sessions.length]
|
|
839
|
+
const prev = sessions[(index - 1 + sessions.length) % sessions.length]
|
|
840
|
+
|
|
841
|
+
if (offset > 0) {
|
|
842
|
+
if (next) prefetchSession(next, "high")
|
|
843
|
+
if (prev) prefetchSession(prev)
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
if (offset < 0) {
|
|
847
|
+
if (prev) prefetchSession(prev, "high")
|
|
848
|
+
if (next) prefetchSession(next)
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
if (import.meta.env.DEV) {
|
|
852
|
+
navStart({
|
|
853
|
+
dir: base64Encode(session.directory),
|
|
854
|
+
from: params.id,
|
|
855
|
+
to: session.id,
|
|
856
|
+
trigger: offset > 0 ? "shift+alt+arrowdown" : "shift+alt+arrowup",
|
|
857
|
+
})
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
navigateToSession(session)
|
|
861
|
+
queueMicrotask(() => scrollToSession(session.id, `${session.directory}:${session.id}`))
|
|
862
|
+
return
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
async function archiveSession(session: Session) {
|
|
867
|
+
const [store, setStore] = globalSync.child(session.directory)
|
|
868
|
+
const sessions = store.session ?? []
|
|
869
|
+
const index = sessions.findIndex((s) => s.id === session.id)
|
|
870
|
+
const nextSession = sessions[index + 1] ?? sessions[index - 1]
|
|
871
|
+
|
|
872
|
+
await globalSDK.client.session.update({
|
|
873
|
+
directory: session.directory,
|
|
874
|
+
sessionID: session.id,
|
|
875
|
+
time: { archived: Date.now() },
|
|
876
|
+
})
|
|
877
|
+
setStore(
|
|
878
|
+
produce((draft) => {
|
|
879
|
+
const match = Binary.search(draft.session, session.id, (s) => s.id)
|
|
880
|
+
if (match.found) draft.session.splice(match.index, 1)
|
|
881
|
+
}),
|
|
882
|
+
)
|
|
883
|
+
if (session.id === params.id) {
|
|
884
|
+
if (nextSession) {
|
|
885
|
+
navigate(`/${params.dir}/session/${nextSession.id}`)
|
|
886
|
+
} else {
|
|
887
|
+
navigate(`/${params.dir}/session`)
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
command.register("layout", () => {
|
|
893
|
+
const commands: CommandOption[] = [
|
|
894
|
+
{
|
|
895
|
+
id: "sidebar.toggle",
|
|
896
|
+
title: language.t("command.sidebar.toggle"),
|
|
897
|
+
category: language.t("command.category.view"),
|
|
898
|
+
keybind: "mod+b",
|
|
899
|
+
onSelect: () => layout.sidebar.toggle(),
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
id: "project.open",
|
|
903
|
+
title: language.t("command.project.open"),
|
|
904
|
+
category: language.t("command.category.project"),
|
|
905
|
+
keybind: "mod+o",
|
|
906
|
+
onSelect: () => chooseProject(),
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
id: "provider.connect",
|
|
910
|
+
title: language.t("command.provider.connect"),
|
|
911
|
+
category: language.t("command.category.provider"),
|
|
912
|
+
onSelect: () => connectProvider(),
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
id: "server.switch",
|
|
916
|
+
title: language.t("command.server.switch"),
|
|
917
|
+
category: language.t("command.category.server"),
|
|
918
|
+
onSelect: () => openServer(),
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
id: "settings.open",
|
|
922
|
+
title: language.t("command.settings.open"),
|
|
923
|
+
category: language.t("command.category.settings"),
|
|
924
|
+
keybind: "mod+comma",
|
|
925
|
+
onSelect: () => openSettings(),
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
id: "session.previous",
|
|
929
|
+
title: language.t("command.session.previous"),
|
|
930
|
+
category: language.t("command.category.session"),
|
|
931
|
+
keybind: "alt+arrowup",
|
|
932
|
+
onSelect: () => navigateSessionByOffset(-1),
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
id: "session.next",
|
|
936
|
+
title: language.t("command.session.next"),
|
|
937
|
+
category: language.t("command.category.session"),
|
|
938
|
+
keybind: "alt+arrowdown",
|
|
939
|
+
onSelect: () => navigateSessionByOffset(1),
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
id: "session.previous.unseen",
|
|
943
|
+
title: language.t("command.session.previous.unseen"),
|
|
944
|
+
category: language.t("command.category.session"),
|
|
945
|
+
keybind: "shift+alt+arrowup",
|
|
946
|
+
onSelect: () => navigateSessionByUnseen(-1),
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
id: "session.next.unseen",
|
|
950
|
+
title: language.t("command.session.next.unseen"),
|
|
951
|
+
category: language.t("command.category.session"),
|
|
952
|
+
keybind: "shift+alt+arrowdown",
|
|
953
|
+
onSelect: () => navigateSessionByUnseen(1),
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
id: "session.archive",
|
|
957
|
+
title: language.t("command.session.archive"),
|
|
958
|
+
category: language.t("command.category.session"),
|
|
959
|
+
keybind: "mod+shift+backspace",
|
|
960
|
+
disabled: !params.dir || !params.id,
|
|
961
|
+
onSelect: () => {
|
|
962
|
+
const session = currentSessions().find((s) => s.id === params.id)
|
|
963
|
+
if (session) archiveSession(session)
|
|
964
|
+
},
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
id: "workspace.new",
|
|
968
|
+
title: language.t("workspace.new"),
|
|
969
|
+
category: language.t("command.category.workspace"),
|
|
970
|
+
keybind: "mod+shift+w",
|
|
971
|
+
disabled: !workspaceSetting(),
|
|
972
|
+
onSelect: () => {
|
|
973
|
+
const project = currentProject()
|
|
974
|
+
if (!project) return
|
|
975
|
+
return createWorkspace(project)
|
|
976
|
+
},
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
id: "workspace.toggle",
|
|
980
|
+
title: language.t("command.workspace.toggle"),
|
|
981
|
+
description: language.t("command.workspace.toggle.description"),
|
|
982
|
+
category: language.t("command.category.workspace"),
|
|
983
|
+
slash: "workspace",
|
|
984
|
+
disabled: !currentProject() || currentProject()?.vcs !== "git",
|
|
985
|
+
onSelect: () => {
|
|
986
|
+
const project = currentProject()
|
|
987
|
+
if (!project) return
|
|
988
|
+
if (project.vcs !== "git") return
|
|
989
|
+
const wasEnabled = layout.sidebar.workspaces(project.worktree)()
|
|
990
|
+
layout.sidebar.toggleWorkspaces(project.worktree)
|
|
991
|
+
showToast({
|
|
992
|
+
title: wasEnabled
|
|
993
|
+
? language.t("toast.workspace.disabled.title")
|
|
994
|
+
: language.t("toast.workspace.enabled.title"),
|
|
995
|
+
description: wasEnabled
|
|
996
|
+
? language.t("toast.workspace.disabled.description")
|
|
997
|
+
: language.t("toast.workspace.enabled.description"),
|
|
998
|
+
})
|
|
999
|
+
},
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
id: "theme.cycle",
|
|
1003
|
+
title: language.t("command.theme.cycle"),
|
|
1004
|
+
category: language.t("command.category.theme"),
|
|
1005
|
+
keybind: "mod+shift+t",
|
|
1006
|
+
onSelect: () => cycleTheme(1),
|
|
1007
|
+
},
|
|
1008
|
+
]
|
|
1009
|
+
|
|
1010
|
+
for (const [id, definition] of availableThemeEntries()) {
|
|
1011
|
+
commands.push({
|
|
1012
|
+
id: `theme.set.${id}`,
|
|
1013
|
+
title: language.t("command.theme.set", { theme: definition.name ?? id }),
|
|
1014
|
+
category: language.t("command.category.theme"),
|
|
1015
|
+
onSelect: () => theme.commitPreview(),
|
|
1016
|
+
onHighlight: () => {
|
|
1017
|
+
theme.previewTheme(id)
|
|
1018
|
+
return () => theme.cancelPreview()
|
|
1019
|
+
},
|
|
1020
|
+
})
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
commands.push({
|
|
1024
|
+
id: "theme.scheme.cycle",
|
|
1025
|
+
title: language.t("command.theme.scheme.cycle"),
|
|
1026
|
+
category: language.t("command.category.theme"),
|
|
1027
|
+
keybind: "mod+shift+s",
|
|
1028
|
+
onSelect: () => cycleColorScheme(1),
|
|
1029
|
+
})
|
|
1030
|
+
|
|
1031
|
+
for (const scheme of colorSchemeOrder) {
|
|
1032
|
+
commands.push({
|
|
1033
|
+
id: `theme.scheme.${scheme}`,
|
|
1034
|
+
title: language.t("command.theme.scheme.set", { scheme: colorSchemeLabel(scheme) }),
|
|
1035
|
+
category: language.t("command.category.theme"),
|
|
1036
|
+
onSelect: () => theme.commitPreview(),
|
|
1037
|
+
onHighlight: () => {
|
|
1038
|
+
theme.previewColorScheme(scheme)
|
|
1039
|
+
return () => theme.cancelPreview()
|
|
1040
|
+
},
|
|
1041
|
+
})
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
commands.push({
|
|
1045
|
+
id: "language.cycle",
|
|
1046
|
+
title: language.t("command.language.cycle"),
|
|
1047
|
+
category: language.t("command.category.language"),
|
|
1048
|
+
onSelect: () => cycleLanguage(1),
|
|
1049
|
+
})
|
|
1050
|
+
|
|
1051
|
+
for (const locale of language.locales) {
|
|
1052
|
+
commands.push({
|
|
1053
|
+
id: `language.set.${locale}`,
|
|
1054
|
+
title: language.t("command.language.set", { language: language.label(locale) }),
|
|
1055
|
+
category: language.t("command.category.language"),
|
|
1056
|
+
onSelect: () => setLocale(locale),
|
|
1057
|
+
})
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
return commands
|
|
1061
|
+
})
|
|
1062
|
+
|
|
1063
|
+
function connectProvider() {
|
|
1064
|
+
dialog.show(() => <DialogSelectProvider />)
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
function openServer() {
|
|
1068
|
+
dialog.show(() => <DialogSelectServer />)
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
function openSettings() {
|
|
1072
|
+
dialog.show(() => <DialogSettings />)
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
function navigateToProject(directory: string | undefined) {
|
|
1076
|
+
if (!directory) return
|
|
1077
|
+
if (!layout.sidebar.opened()) {
|
|
1078
|
+
setState("hoverSession", undefined)
|
|
1079
|
+
setState("hoverProject", undefined)
|
|
1080
|
+
}
|
|
1081
|
+
server.projects.touch(directory)
|
|
1082
|
+
const lastSession = store.lastSession[directory]
|
|
1083
|
+
navigate(`/${base64Encode(directory)}${lastSession ? `/session/${lastSession}` : ""}`)
|
|
1084
|
+
layout.mobileSidebar.hide()
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
function navigateToSession(session: Session | undefined) {
|
|
1088
|
+
if (!session) return
|
|
1089
|
+
if (!layout.sidebar.opened()) {
|
|
1090
|
+
setState("hoverSession", undefined)
|
|
1091
|
+
setState("hoverProject", undefined)
|
|
1092
|
+
}
|
|
1093
|
+
navigate(`/${base64Encode(session.directory)}/session/${session.id}`)
|
|
1094
|
+
layout.mobileSidebar.hide()
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
function openProject(directory: string, navigate = true) {
|
|
1098
|
+
layout.projects.open(directory)
|
|
1099
|
+
if (navigate) navigateToProject(directory)
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
const handleDeepLinks = (urls: string[]) => {
|
|
1103
|
+
if (!server.isLocal()) return
|
|
1104
|
+
for (const directory of collectOpenProjectDeepLinks(urls)) {
|
|
1105
|
+
openProject(directory)
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
onMount(() => {
|
|
1110
|
+
const handler = (event: Event) => {
|
|
1111
|
+
const detail = (event as CustomEvent<{ urls: string[] }>).detail
|
|
1112
|
+
const urls = detail?.urls ?? []
|
|
1113
|
+
if (urls.length === 0) return
|
|
1114
|
+
handleDeepLinks(urls)
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
handleDeepLinks(drainPendingDeepLinks(window))
|
|
1118
|
+
window.addEventListener(deepLinkEvent, handler as EventListener)
|
|
1119
|
+
onCleanup(() => window.removeEventListener(deepLinkEvent, handler as EventListener))
|
|
1120
|
+
})
|
|
1121
|
+
|
|
1122
|
+
async function renameProject(project: LocalProject, next: string) {
|
|
1123
|
+
const current = displayName(project)
|
|
1124
|
+
if (next === current) return
|
|
1125
|
+
const name = next === getFilename(project.worktree) ? "" : next
|
|
1126
|
+
|
|
1127
|
+
if (project.id && project.id !== "global") {
|
|
1128
|
+
await globalSDK.client.project.update({ projectID: project.id, directory: project.worktree, name })
|
|
1129
|
+
return
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
globalSync.project.meta(project.worktree, { name })
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
const renameWorkspace = (directory: string, next: string, projectId?: string, branch?: string) => {
|
|
1136
|
+
const current = workspaceName(directory, projectId, branch) ?? branch ?? getFilename(directory)
|
|
1137
|
+
if (current === next) return
|
|
1138
|
+
setWorkspaceName(directory, next, projectId, branch)
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
function closeProject(directory: string) {
|
|
1142
|
+
const index = layout.projects.list().findIndex((x) => x.worktree === directory)
|
|
1143
|
+
const next = layout.projects.list()[index + 1]
|
|
1144
|
+
layout.projects.close(directory)
|
|
1145
|
+
if (next) navigateToProject(next.worktree)
|
|
1146
|
+
else navigate("/")
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
function toggleProjectWorkspaces(project: LocalProject) {
|
|
1150
|
+
const enabled = layout.sidebar.workspaces(project.worktree)()
|
|
1151
|
+
if (enabled) {
|
|
1152
|
+
layout.sidebar.toggleWorkspaces(project.worktree)
|
|
1153
|
+
return
|
|
1154
|
+
}
|
|
1155
|
+
if (project.vcs !== "git") return
|
|
1156
|
+
layout.sidebar.toggleWorkspaces(project.worktree)
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
const showEditProjectDialog = (project: LocalProject) => dialog.show(() => <DialogEditProject project={project} />)
|
|
1160
|
+
|
|
1161
|
+
async function chooseProject() {
|
|
1162
|
+
function resolve(result: string | string[] | null) {
|
|
1163
|
+
if (Array.isArray(result)) {
|
|
1164
|
+
for (const directory of result) {
|
|
1165
|
+
openProject(directory, false)
|
|
1166
|
+
}
|
|
1167
|
+
navigateToProject(result[0])
|
|
1168
|
+
} else if (result) {
|
|
1169
|
+
openProject(result)
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
if (platform.openDirectoryPickerDialog && server.isLocal()) {
|
|
1174
|
+
const result = await platform.openDirectoryPickerDialog?.({
|
|
1175
|
+
title: language.t("command.project.open"),
|
|
1176
|
+
multiple: true,
|
|
1177
|
+
})
|
|
1178
|
+
resolve(result)
|
|
1179
|
+
} else {
|
|
1180
|
+
dialog.show(
|
|
1181
|
+
() => <DialogSelectDirectory multiple={true} onSelect={resolve} />,
|
|
1182
|
+
() => resolve(null),
|
|
1183
|
+
)
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
const deleteWorkspace = async (root: string, directory: string) => {
|
|
1188
|
+
if (directory === root) return
|
|
1189
|
+
|
|
1190
|
+
setBusy(directory, true)
|
|
1191
|
+
|
|
1192
|
+
const result = await globalSDK.client.worktree
|
|
1193
|
+
.remove({ directory: root, worktreeRemoveInput: { directory } })
|
|
1194
|
+
.then((x) => x.data)
|
|
1195
|
+
.catch((err) => {
|
|
1196
|
+
showToast({
|
|
1197
|
+
title: language.t("workspace.delete.failed.title"),
|
|
1198
|
+
description: errorMessage(err, language.t("common.requestFailed")),
|
|
1199
|
+
})
|
|
1200
|
+
return false
|
|
1201
|
+
})
|
|
1202
|
+
|
|
1203
|
+
setBusy(directory, false)
|
|
1204
|
+
|
|
1205
|
+
if (!result) return
|
|
1206
|
+
|
|
1207
|
+
layout.projects.close(directory)
|
|
1208
|
+
layout.projects.open(root)
|
|
1209
|
+
|
|
1210
|
+
if (params.dir && currentDir() === directory) {
|
|
1211
|
+
navigateToProject(root)
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
const resetWorkspace = async (root: string, directory: string) => {
|
|
1216
|
+
if (directory === root) return
|
|
1217
|
+
setBusy(directory, true)
|
|
1218
|
+
|
|
1219
|
+
const progress = showToast({
|
|
1220
|
+
persistent: true,
|
|
1221
|
+
title: language.t("workspace.resetting.title"),
|
|
1222
|
+
description: language.t("workspace.resetting.description"),
|
|
1223
|
+
})
|
|
1224
|
+
const dismiss = () => toaster.dismiss(progress)
|
|
1225
|
+
|
|
1226
|
+
const sessions = await globalSDK.client.session
|
|
1227
|
+
.list({ directory })
|
|
1228
|
+
.then((x) => x.data ?? [])
|
|
1229
|
+
.catch(() => [])
|
|
1230
|
+
|
|
1231
|
+
const result = await globalSDK.client.worktree
|
|
1232
|
+
.reset({ directory: root, worktreeResetInput: { directory } })
|
|
1233
|
+
.then((x) => x.data)
|
|
1234
|
+
.catch((err) => {
|
|
1235
|
+
showToast({
|
|
1236
|
+
title: language.t("workspace.reset.failed.title"),
|
|
1237
|
+
description: errorMessage(err, language.t("common.requestFailed")),
|
|
1238
|
+
})
|
|
1239
|
+
return false
|
|
1240
|
+
})
|
|
1241
|
+
|
|
1242
|
+
if (!result) {
|
|
1243
|
+
setBusy(directory, false)
|
|
1244
|
+
dismiss()
|
|
1245
|
+
return
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
const archivedAt = Date.now()
|
|
1249
|
+
await Promise.all(
|
|
1250
|
+
sessions
|
|
1251
|
+
.filter((session) => session.time.archived === undefined)
|
|
1252
|
+
.map((session) =>
|
|
1253
|
+
globalSDK.client.session
|
|
1254
|
+
.update({
|
|
1255
|
+
sessionID: session.id,
|
|
1256
|
+
directory: session.directory,
|
|
1257
|
+
time: { archived: archivedAt },
|
|
1258
|
+
})
|
|
1259
|
+
.catch(() => undefined),
|
|
1260
|
+
),
|
|
1261
|
+
)
|
|
1262
|
+
|
|
1263
|
+
await globalSDK.client.instance.dispose({ directory }).catch(() => undefined)
|
|
1264
|
+
|
|
1265
|
+
setBusy(directory, false)
|
|
1266
|
+
dismiss()
|
|
1267
|
+
|
|
1268
|
+
showToast({
|
|
1269
|
+
title: language.t("workspace.reset.success.title"),
|
|
1270
|
+
description: language.t("workspace.reset.success.description"),
|
|
1271
|
+
actions: [
|
|
1272
|
+
{
|
|
1273
|
+
label: language.t("command.session.new"),
|
|
1274
|
+
onClick: () => {
|
|
1275
|
+
const href = `/${base64Encode(directory)}/session`
|
|
1276
|
+
navigate(href)
|
|
1277
|
+
layout.mobileSidebar.hide()
|
|
1278
|
+
},
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
label: language.t("common.dismiss"),
|
|
1282
|
+
onClick: "dismiss",
|
|
1283
|
+
},
|
|
1284
|
+
],
|
|
1285
|
+
})
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
function DialogDeleteWorkspace(props: { root: string; directory: string }) {
|
|
1289
|
+
const name = createMemo(() => getFilename(props.directory))
|
|
1290
|
+
const [data, setData] = createStore({
|
|
1291
|
+
status: "loading" as "loading" | "ready" | "error",
|
|
1292
|
+
dirty: false,
|
|
1293
|
+
})
|
|
1294
|
+
|
|
1295
|
+
onMount(() => {
|
|
1296
|
+
globalSDK.client.file
|
|
1297
|
+
.status({ directory: props.directory })
|
|
1298
|
+
.then((x) => {
|
|
1299
|
+
const files = x.data ?? []
|
|
1300
|
+
const dirty = files.length > 0
|
|
1301
|
+
setData({ status: "ready", dirty })
|
|
1302
|
+
})
|
|
1303
|
+
.catch(() => {
|
|
1304
|
+
setData({ status: "error", dirty: false })
|
|
1305
|
+
})
|
|
1306
|
+
})
|
|
1307
|
+
|
|
1308
|
+
const handleDelete = () => {
|
|
1309
|
+
dialog.close()
|
|
1310
|
+
void deleteWorkspace(props.root, props.directory)
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
const description = () => {
|
|
1314
|
+
if (data.status === "loading") return language.t("workspace.status.checking")
|
|
1315
|
+
if (data.status === "error") return language.t("workspace.status.error")
|
|
1316
|
+
if (!data.dirty) return language.t("workspace.status.clean")
|
|
1317
|
+
return language.t("workspace.status.dirty")
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
return (
|
|
1321
|
+
<Dialog title={language.t("workspace.delete.title")} fit>
|
|
1322
|
+
<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3">
|
|
1323
|
+
<div class="flex flex-col gap-1">
|
|
1324
|
+
<span class="text-14-regular text-text-strong">
|
|
1325
|
+
{language.t("workspace.delete.confirm", { name: name() })}
|
|
1326
|
+
</span>
|
|
1327
|
+
<span class="text-12-regular text-text-weak">{description()}</span>
|
|
1328
|
+
</div>
|
|
1329
|
+
<div class="flex justify-end gap-2">
|
|
1330
|
+
<Button variant="ghost" size="large" onClick={() => dialog.close()}>
|
|
1331
|
+
{language.t("common.cancel")}
|
|
1332
|
+
</Button>
|
|
1333
|
+
<Button variant="primary" size="large" disabled={data.status === "loading"} onClick={handleDelete}>
|
|
1334
|
+
{language.t("workspace.delete.button")}
|
|
1335
|
+
</Button>
|
|
1336
|
+
</div>
|
|
1337
|
+
</div>
|
|
1338
|
+
</Dialog>
|
|
1339
|
+
)
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
function DialogResetWorkspace(props: { root: string; directory: string }) {
|
|
1343
|
+
const name = createMemo(() => getFilename(props.directory))
|
|
1344
|
+
const [state, setState] = createStore({
|
|
1345
|
+
status: "loading" as "loading" | "ready" | "error",
|
|
1346
|
+
dirty: false,
|
|
1347
|
+
sessions: [] as Session[],
|
|
1348
|
+
})
|
|
1349
|
+
|
|
1350
|
+
const refresh = async () => {
|
|
1351
|
+
const sessions = await globalSDK.client.session
|
|
1352
|
+
.list({ directory: props.directory })
|
|
1353
|
+
.then((x) => x.data ?? [])
|
|
1354
|
+
.catch(() => [])
|
|
1355
|
+
const active = sessions.filter((session) => session.time.archived === undefined)
|
|
1356
|
+
setState({ sessions: active })
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
onMount(() => {
|
|
1360
|
+
globalSDK.client.file
|
|
1361
|
+
.status({ directory: props.directory })
|
|
1362
|
+
.then((x) => {
|
|
1363
|
+
const files = x.data ?? []
|
|
1364
|
+
const dirty = files.length > 0
|
|
1365
|
+
setState({ status: "ready", dirty })
|
|
1366
|
+
void refresh()
|
|
1367
|
+
})
|
|
1368
|
+
.catch(() => {
|
|
1369
|
+
setState({ status: "error", dirty: false })
|
|
1370
|
+
})
|
|
1371
|
+
})
|
|
1372
|
+
|
|
1373
|
+
const handleReset = () => {
|
|
1374
|
+
dialog.close()
|
|
1375
|
+
void resetWorkspace(props.root, props.directory)
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
const archivedCount = () => state.sessions.length
|
|
1379
|
+
|
|
1380
|
+
const description = () => {
|
|
1381
|
+
if (state.status === "loading") return language.t("workspace.status.checking")
|
|
1382
|
+
if (state.status === "error") return language.t("workspace.status.error")
|
|
1383
|
+
if (!state.dirty) return language.t("workspace.status.clean")
|
|
1384
|
+
return language.t("workspace.status.dirty")
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
const archivedLabel = () => {
|
|
1388
|
+
const count = archivedCount()
|
|
1389
|
+
if (count === 0) return language.t("workspace.reset.archived.none")
|
|
1390
|
+
if (count === 1) return language.t("workspace.reset.archived.one")
|
|
1391
|
+
return language.t("workspace.reset.archived.many", { count })
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
return (
|
|
1395
|
+
<Dialog title={language.t("workspace.reset.title")} fit>
|
|
1396
|
+
<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3">
|
|
1397
|
+
<div class="flex flex-col gap-1">
|
|
1398
|
+
<span class="text-14-regular text-text-strong">
|
|
1399
|
+
{language.t("workspace.reset.confirm", { name: name() })}
|
|
1400
|
+
</span>
|
|
1401
|
+
<span class="text-12-regular text-text-weak">
|
|
1402
|
+
{description()} {archivedLabel()} {language.t("workspace.reset.note")}
|
|
1403
|
+
</span>
|
|
1404
|
+
</div>
|
|
1405
|
+
<div class="flex justify-end gap-2">
|
|
1406
|
+
<Button variant="ghost" size="large" onClick={() => dialog.close()}>
|
|
1407
|
+
{language.t("common.cancel")}
|
|
1408
|
+
</Button>
|
|
1409
|
+
<Button variant="primary" size="large" disabled={state.status === "loading"} onClick={handleReset}>
|
|
1410
|
+
{language.t("workspace.reset.button")}
|
|
1411
|
+
</Button>
|
|
1412
|
+
</div>
|
|
1413
|
+
</div>
|
|
1414
|
+
</Dialog>
|
|
1415
|
+
)
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
createEffect(
|
|
1419
|
+
on(
|
|
1420
|
+
() => ({ ready: pageReady(), dir: params.dir, id: params.id }),
|
|
1421
|
+
(value) => {
|
|
1422
|
+
if (!value.ready) return
|
|
1423
|
+
const dir = value.dir
|
|
1424
|
+
const id = value.id
|
|
1425
|
+
if (!dir || !id) return
|
|
1426
|
+
const directory = decode64(dir)
|
|
1427
|
+
if (!directory) return
|
|
1428
|
+
setStore("lastSession", directory, id)
|
|
1429
|
+
notification.session.markViewed(id)
|
|
1430
|
+
const expanded = untrack(() => store.workspaceExpanded[directory])
|
|
1431
|
+
if (expanded === false) {
|
|
1432
|
+
setStore("workspaceExpanded", directory, true)
|
|
1433
|
+
}
|
|
1434
|
+
requestAnimationFrame(() => scrollToSession(id, `${directory}:${id}`))
|
|
1435
|
+
},
|
|
1436
|
+
{ defer: true },
|
|
1437
|
+
),
|
|
1438
|
+
)
|
|
1439
|
+
|
|
1440
|
+
createEffect(() => {
|
|
1441
|
+
const sidebarWidth = layout.sidebar.opened() ? layout.sidebar.width() : 48
|
|
1442
|
+
document.documentElement.style.setProperty("--dialog-left-margin", `${sidebarWidth}px`)
|
|
1443
|
+
})
|
|
1444
|
+
|
|
1445
|
+
createEffect(() => {
|
|
1446
|
+
const project = currentProject()
|
|
1447
|
+
if (!project) return
|
|
1448
|
+
|
|
1449
|
+
if (workspaceSetting()) {
|
|
1450
|
+
const activeDir = currentDir()
|
|
1451
|
+
const dirs = [project.worktree, ...(project.sandboxes ?? [])]
|
|
1452
|
+
for (const directory of dirs) {
|
|
1453
|
+
const expanded = store.workspaceExpanded[directory] ?? directory === project.worktree
|
|
1454
|
+
const active = directory === activeDir
|
|
1455
|
+
if (!expanded && !active) continue
|
|
1456
|
+
globalSync.project.loadSessions(directory)
|
|
1457
|
+
}
|
|
1458
|
+
return
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
globalSync.project.loadSessions(project.worktree)
|
|
1462
|
+
})
|
|
1463
|
+
|
|
1464
|
+
function handleDragStart(event: unknown) {
|
|
1465
|
+
const id = getDraggableId(event)
|
|
1466
|
+
if (!id) return
|
|
1467
|
+
setState("hoverProject", undefined)
|
|
1468
|
+
setStore("activeProject", id)
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
function handleDragOver(event: DragEvent) {
|
|
1472
|
+
const { draggable, droppable } = event
|
|
1473
|
+
if (draggable && droppable) {
|
|
1474
|
+
const projects = layout.projects.list()
|
|
1475
|
+
const fromIndex = projects.findIndex((p) => p.worktree === draggable.id.toString())
|
|
1476
|
+
const toIndex = projects.findIndex((p) => p.worktree === droppable.id.toString())
|
|
1477
|
+
if (fromIndex !== toIndex && toIndex !== -1) {
|
|
1478
|
+
layout.projects.move(draggable.id.toString(), toIndex)
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
function handleDragEnd() {
|
|
1484
|
+
setStore("activeProject", undefined)
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
function workspaceIds(project: LocalProject | undefined) {
|
|
1488
|
+
if (!project) return []
|
|
1489
|
+
const local = project.worktree
|
|
1490
|
+
const dirs = [local, ...(project.sandboxes ?? [])]
|
|
1491
|
+
const active = currentProject()
|
|
1492
|
+
const directory = active?.worktree === project.worktree ? currentDir() : undefined
|
|
1493
|
+
const extra = directory && directory !== local && !dirs.includes(directory) ? directory : undefined
|
|
1494
|
+
const pending = extra ? WorktreeState.get(extra)?.status === "pending" : false
|
|
1495
|
+
|
|
1496
|
+
const existing = store.workspaceOrder[project.worktree]
|
|
1497
|
+
if (!existing) return extra ? [...dirs, extra] : dirs
|
|
1498
|
+
|
|
1499
|
+
const merged = syncWorkspaceOrder(local, dirs, existing)
|
|
1500
|
+
if (pending && extra) return [local, extra, ...merged.filter((directory) => directory !== local)]
|
|
1501
|
+
if (!extra) return merged
|
|
1502
|
+
if (pending) return merged
|
|
1503
|
+
return [...merged, extra]
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
const sidebarProject = createMemo(() => {
|
|
1507
|
+
if (layout.sidebar.opened()) return currentProject()
|
|
1508
|
+
const hovered = hoverProjectData()
|
|
1509
|
+
if (hovered) return hovered
|
|
1510
|
+
return currentProject()
|
|
1511
|
+
})
|
|
1512
|
+
|
|
1513
|
+
function handleWorkspaceDragStart(event: unknown) {
|
|
1514
|
+
const id = getDraggableId(event)
|
|
1515
|
+
if (!id) return
|
|
1516
|
+
setStore("activeWorkspace", id)
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
function handleWorkspaceDragOver(event: DragEvent) {
|
|
1520
|
+
const { draggable, droppable } = event
|
|
1521
|
+
if (!draggable || !droppable) return
|
|
1522
|
+
|
|
1523
|
+
const project = sidebarProject()
|
|
1524
|
+
if (!project) return
|
|
1525
|
+
|
|
1526
|
+
const ids = workspaceIds(project)
|
|
1527
|
+
const fromIndex = ids.findIndex((dir) => dir === draggable.id.toString())
|
|
1528
|
+
const toIndex = ids.findIndex((dir) => dir === droppable.id.toString())
|
|
1529
|
+
if (fromIndex === -1 || toIndex === -1) return
|
|
1530
|
+
if (fromIndex === toIndex) return
|
|
1531
|
+
|
|
1532
|
+
const result = ids.slice()
|
|
1533
|
+
const [item] = result.splice(fromIndex, 1)
|
|
1534
|
+
if (!item) return
|
|
1535
|
+
result.splice(toIndex, 0, item)
|
|
1536
|
+
setStore("workspaceOrder", project.worktree, result)
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
function handleWorkspaceDragEnd() {
|
|
1540
|
+
setStore("activeWorkspace", undefined)
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
const createWorkspace = async (project: LocalProject) => {
|
|
1544
|
+
if (!layout.sidebar.opened()) {
|
|
1545
|
+
setState("hoverSession", undefined)
|
|
1546
|
+
setState("hoverProject", undefined)
|
|
1547
|
+
}
|
|
1548
|
+
const created = await globalSDK.client.worktree
|
|
1549
|
+
.create({ directory: project.worktree })
|
|
1550
|
+
.then((x) => x.data)
|
|
1551
|
+
.catch((err) => {
|
|
1552
|
+
showToast({
|
|
1553
|
+
title: language.t("workspace.create.failed.title"),
|
|
1554
|
+
description: errorMessage(err, language.t("common.requestFailed")),
|
|
1555
|
+
})
|
|
1556
|
+
return undefined
|
|
1557
|
+
})
|
|
1558
|
+
|
|
1559
|
+
if (!created?.directory) return
|
|
1560
|
+
|
|
1561
|
+
setWorkspaceName(created.directory, created.branch, project.id, created.branch)
|
|
1562
|
+
|
|
1563
|
+
const local = project.worktree
|
|
1564
|
+
const key = workspaceKey(created.directory)
|
|
1565
|
+
const root = workspaceKey(local)
|
|
1566
|
+
|
|
1567
|
+
setBusy(created.directory, true)
|
|
1568
|
+
WorktreeState.pending(created.directory)
|
|
1569
|
+
setStore("workspaceExpanded", key, true)
|
|
1570
|
+
if (key !== created.directory) {
|
|
1571
|
+
setStore("workspaceExpanded", created.directory, true)
|
|
1572
|
+
}
|
|
1573
|
+
setStore("workspaceOrder", project.worktree, (prev) => {
|
|
1574
|
+
const existing = prev ?? []
|
|
1575
|
+
const next = existing.filter((item) => {
|
|
1576
|
+
const id = workspaceKey(item)
|
|
1577
|
+
if (id === root) return false
|
|
1578
|
+
return id !== key
|
|
1579
|
+
})
|
|
1580
|
+
return [local, created.directory, ...next]
|
|
1581
|
+
})
|
|
1582
|
+
|
|
1583
|
+
globalSync.child(created.directory)
|
|
1584
|
+
navigate(`/${base64Encode(created.directory)}/session`)
|
|
1585
|
+
layout.mobileSidebar.hide()
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
const workspaceSidebarCtx: WorkspaceSidebarContext = {
|
|
1589
|
+
currentDir,
|
|
1590
|
+
sidebarExpanded,
|
|
1591
|
+
sidebarHovering,
|
|
1592
|
+
nav: () => state.nav,
|
|
1593
|
+
hoverSession: () => state.hoverSession,
|
|
1594
|
+
setHoverSession,
|
|
1595
|
+
clearHoverProjectSoon,
|
|
1596
|
+
prefetchSession,
|
|
1597
|
+
archiveSession,
|
|
1598
|
+
workspaceName,
|
|
1599
|
+
renameWorkspace,
|
|
1600
|
+
editorOpen,
|
|
1601
|
+
openEditor,
|
|
1602
|
+
closeEditor,
|
|
1603
|
+
setEditor,
|
|
1604
|
+
InlineEditor,
|
|
1605
|
+
isBusy,
|
|
1606
|
+
workspaceExpanded: (directory, local) => workspaceOpenState(store.workspaceExpanded, directory, local),
|
|
1607
|
+
setWorkspaceExpanded: (directory, value) => setStore("workspaceExpanded", directory, value),
|
|
1608
|
+
showResetWorkspaceDialog: (root, directory) =>
|
|
1609
|
+
dialog.show(() => <DialogResetWorkspace root={root} directory={directory} />),
|
|
1610
|
+
showDeleteWorkspaceDialog: (root, directory) =>
|
|
1611
|
+
dialog.show(() => <DialogDeleteWorkspace root={root} directory={directory} />),
|
|
1612
|
+
setScrollContainerRef: (el, mobile) => {
|
|
1613
|
+
if (!mobile) scrollContainerRef = el
|
|
1614
|
+
},
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
const projectSidebarCtx: ProjectSidebarContext = {
|
|
1618
|
+
currentDir,
|
|
1619
|
+
sidebarOpened: () => layout.sidebar.opened(),
|
|
1620
|
+
sidebarHovering,
|
|
1621
|
+
hoverProject: () => state.hoverProject,
|
|
1622
|
+
nav: () => state.nav,
|
|
1623
|
+
onProjectMouseEnter: (worktree, event) => aim.enter(worktree, event),
|
|
1624
|
+
onProjectMouseLeave: (worktree) => aim.leave(worktree),
|
|
1625
|
+
onProjectFocus: (worktree) => aim.activate(worktree),
|
|
1626
|
+
navigateToProject,
|
|
1627
|
+
openSidebar: () => layout.sidebar.open(),
|
|
1628
|
+
closeProject,
|
|
1629
|
+
showEditProjectDialog,
|
|
1630
|
+
toggleProjectWorkspaces,
|
|
1631
|
+
workspacesEnabled: (project) => project.vcs === "git" && layout.sidebar.workspaces(project.worktree)(),
|
|
1632
|
+
workspaceIds,
|
|
1633
|
+
workspaceLabel,
|
|
1634
|
+
sessionProps: {
|
|
1635
|
+
sidebarExpanded,
|
|
1636
|
+
sidebarHovering,
|
|
1637
|
+
nav: () => state.nav,
|
|
1638
|
+
hoverSession: () => state.hoverSession,
|
|
1639
|
+
setHoverSession,
|
|
1640
|
+
clearHoverProjectSoon,
|
|
1641
|
+
prefetchSession,
|
|
1642
|
+
archiveSession,
|
|
1643
|
+
},
|
|
1644
|
+
setHoverSession,
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
const SidebarPanel = (panelProps: { project: LocalProject | undefined; mobile?: boolean }) => {
|
|
1648
|
+
const projectName = createMemo(() => {
|
|
1649
|
+
const project = panelProps.project
|
|
1650
|
+
if (!project) return ""
|
|
1651
|
+
return project.name || getFilename(project.worktree)
|
|
1652
|
+
})
|
|
1653
|
+
const projectId = createMemo(() => panelProps.project?.id ?? "")
|
|
1654
|
+
const workspaces = createMemo(() => workspaceIds(panelProps.project))
|
|
1655
|
+
const workspacesEnabled = createMemo(() => {
|
|
1656
|
+
const project = panelProps.project
|
|
1657
|
+
if (!project) return false
|
|
1658
|
+
if (project.vcs !== "git") return false
|
|
1659
|
+
return layout.sidebar.workspaces(project.worktree)()
|
|
1660
|
+
})
|
|
1661
|
+
const homedir = createMemo(() => globalSync.data.path.home)
|
|
1662
|
+
|
|
1663
|
+
return (
|
|
1664
|
+
<div
|
|
1665
|
+
classList={{
|
|
1666
|
+
"flex flex-col min-h-0 bg-background-stronger border border-b-0 border-border-weak-base rounded-tl-sm": true,
|
|
1667
|
+
"flex-1 min-w-0": panelProps.mobile,
|
|
1668
|
+
}}
|
|
1669
|
+
style={{ width: panelProps.mobile ? undefined : `${Math.max(layout.sidebar.width() - 64, 0)}px` }}
|
|
1670
|
+
>
|
|
1671
|
+
<Show when={panelProps.project}>
|
|
1672
|
+
{(p) => (
|
|
1673
|
+
<>
|
|
1674
|
+
<div class="shrink-0 px-2 py-1">
|
|
1675
|
+
<div class="group/project flex items-start justify-between gap-2 p-2 pr-1">
|
|
1676
|
+
<div class="flex flex-col min-w-0">
|
|
1677
|
+
<InlineEditor
|
|
1678
|
+
id={`project:${projectId()}`}
|
|
1679
|
+
value={projectName}
|
|
1680
|
+
onSave={(next) => renameProject(p(), next)}
|
|
1681
|
+
class="text-16-medium text-text-strong truncate"
|
|
1682
|
+
displayClass="text-16-medium text-text-strong truncate"
|
|
1683
|
+
stopPropagation
|
|
1684
|
+
/>
|
|
1685
|
+
|
|
1686
|
+
<Tooltip
|
|
1687
|
+
placement="bottom"
|
|
1688
|
+
gutter={2}
|
|
1689
|
+
value={p().worktree}
|
|
1690
|
+
class="shrink-0"
|
|
1691
|
+
contentStyle={{
|
|
1692
|
+
"max-width": "640px",
|
|
1693
|
+
transform: "translate3d(52px, 0, 0)",
|
|
1694
|
+
}}
|
|
1695
|
+
>
|
|
1696
|
+
<span class="text-12-regular text-text-base truncate select-text">
|
|
1697
|
+
{p().worktree.replace(homedir(), "~")}
|
|
1698
|
+
</span>
|
|
1699
|
+
</Tooltip>
|
|
1700
|
+
</div>
|
|
1701
|
+
|
|
1702
|
+
<DropdownMenu modal={!sidebarHovering()}>
|
|
1703
|
+
<DropdownMenu.Trigger
|
|
1704
|
+
as={IconButton}
|
|
1705
|
+
icon="dot-grid"
|
|
1706
|
+
variant="ghost"
|
|
1707
|
+
data-action="project-menu"
|
|
1708
|
+
data-project={base64Encode(p().worktree)}
|
|
1709
|
+
class="shrink-0 size-6 rounded-md data-[expanded]:bg-surface-base-active"
|
|
1710
|
+
classList={{
|
|
1711
|
+
"opacity-0 group-hover/project:opacity-100 data-[expanded]:opacity-100": !panelProps.mobile,
|
|
1712
|
+
}}
|
|
1713
|
+
aria-label={language.t("common.moreOptions")}
|
|
1714
|
+
/>
|
|
1715
|
+
<DropdownMenu.Portal mount={!panelProps.mobile ? state.nav : undefined}>
|
|
1716
|
+
<DropdownMenu.Content class="mt-1">
|
|
1717
|
+
<DropdownMenu.Item onSelect={() => showEditProjectDialog(p())}>
|
|
1718
|
+
<DropdownMenu.ItemLabel>{language.t("common.edit")}</DropdownMenu.ItemLabel>
|
|
1719
|
+
</DropdownMenu.Item>
|
|
1720
|
+
<DropdownMenu.Item
|
|
1721
|
+
data-action="project-workspaces-toggle"
|
|
1722
|
+
data-project={base64Encode(p().worktree)}
|
|
1723
|
+
disabled={p().vcs !== "git" && !layout.sidebar.workspaces(p().worktree)()}
|
|
1724
|
+
onSelect={() => toggleProjectWorkspaces(p())}
|
|
1725
|
+
>
|
|
1726
|
+
<DropdownMenu.ItemLabel>
|
|
1727
|
+
{layout.sidebar.workspaces(p().worktree)()
|
|
1728
|
+
? language.t("sidebar.workspaces.disable")
|
|
1729
|
+
: language.t("sidebar.workspaces.enable")}
|
|
1730
|
+
</DropdownMenu.ItemLabel>
|
|
1731
|
+
</DropdownMenu.Item>
|
|
1732
|
+
<DropdownMenu.Separator />
|
|
1733
|
+
<DropdownMenu.Item
|
|
1734
|
+
data-action="project-close-menu"
|
|
1735
|
+
data-project={base64Encode(p().worktree)}
|
|
1736
|
+
onSelect={() => closeProject(p().worktree)}
|
|
1737
|
+
>
|
|
1738
|
+
<DropdownMenu.ItemLabel>{language.t("common.close")}</DropdownMenu.ItemLabel>
|
|
1739
|
+
</DropdownMenu.Item>
|
|
1740
|
+
</DropdownMenu.Content>
|
|
1741
|
+
</DropdownMenu.Portal>
|
|
1742
|
+
</DropdownMenu>
|
|
1743
|
+
</div>
|
|
1744
|
+
</div>
|
|
1745
|
+
|
|
1746
|
+
<div class="flex-1 min-h-0 flex flex-col">
|
|
1747
|
+
<Show
|
|
1748
|
+
when={workspacesEnabled()}
|
|
1749
|
+
fallback={
|
|
1750
|
+
<>
|
|
1751
|
+
<div class="shrink-0 py-4 px-3">
|
|
1752
|
+
<TooltipKeybind
|
|
1753
|
+
title={language.t("command.session.new")}
|
|
1754
|
+
keybind={command.keybind("session.new")}
|
|
1755
|
+
placement="top"
|
|
1756
|
+
>
|
|
1757
|
+
<Button
|
|
1758
|
+
size="large"
|
|
1759
|
+
icon="plus-small"
|
|
1760
|
+
class="w-full"
|
|
1761
|
+
onClick={() => {
|
|
1762
|
+
if (!layout.sidebar.opened()) {
|
|
1763
|
+
setState("hoverSession", undefined)
|
|
1764
|
+
setState("hoverProject", undefined)
|
|
1765
|
+
}
|
|
1766
|
+
navigate(`/${base64Encode(p().worktree)}/session`)
|
|
1767
|
+
layout.mobileSidebar.hide()
|
|
1768
|
+
}}
|
|
1769
|
+
>
|
|
1770
|
+
{language.t("command.session.new")}
|
|
1771
|
+
</Button>
|
|
1772
|
+
</TooltipKeybind>
|
|
1773
|
+
</div>
|
|
1774
|
+
<div class="flex-1 min-h-0">
|
|
1775
|
+
<LocalWorkspace ctx={workspaceSidebarCtx} project={p()} mobile={panelProps.mobile} />
|
|
1776
|
+
</div>
|
|
1777
|
+
</>
|
|
1778
|
+
}
|
|
1779
|
+
>
|
|
1780
|
+
<>
|
|
1781
|
+
<div class="shrink-0 py-4 px-3">
|
|
1782
|
+
<TooltipKeybind
|
|
1783
|
+
title={language.t("workspace.new")}
|
|
1784
|
+
keybind={command.keybind("workspace.new")}
|
|
1785
|
+
placement="top"
|
|
1786
|
+
>
|
|
1787
|
+
<Button size="large" icon="plus-small" class="w-full" onClick={() => createWorkspace(p())}>
|
|
1788
|
+
{language.t("workspace.new")}
|
|
1789
|
+
</Button>
|
|
1790
|
+
</TooltipKeybind>
|
|
1791
|
+
</div>
|
|
1792
|
+
<div class="relative flex-1 min-h-0">
|
|
1793
|
+
<DragDropProvider
|
|
1794
|
+
onDragStart={handleWorkspaceDragStart}
|
|
1795
|
+
onDragEnd={handleWorkspaceDragEnd}
|
|
1796
|
+
onDragOver={handleWorkspaceDragOver}
|
|
1797
|
+
collisionDetector={closestCenter}
|
|
1798
|
+
>
|
|
1799
|
+
<DragDropSensors />
|
|
1800
|
+
<ConstrainDragXAxis />
|
|
1801
|
+
<div
|
|
1802
|
+
ref={(el) => {
|
|
1803
|
+
if (!panelProps.mobile) scrollContainerRef = el
|
|
1804
|
+
}}
|
|
1805
|
+
class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]"
|
|
1806
|
+
>
|
|
1807
|
+
<SortableProvider ids={workspaces()}>
|
|
1808
|
+
<For each={workspaces()}>
|
|
1809
|
+
{(directory) => (
|
|
1810
|
+
<SortableWorkspace
|
|
1811
|
+
ctx={workspaceSidebarCtx}
|
|
1812
|
+
directory={directory}
|
|
1813
|
+
project={p()}
|
|
1814
|
+
mobile={panelProps.mobile}
|
|
1815
|
+
/>
|
|
1816
|
+
)}
|
|
1817
|
+
</For>
|
|
1818
|
+
</SortableProvider>
|
|
1819
|
+
</div>
|
|
1820
|
+
<DragOverlay>
|
|
1821
|
+
<WorkspaceDragOverlay
|
|
1822
|
+
sidebarProject={sidebarProject}
|
|
1823
|
+
activeWorkspace={() => store.activeWorkspace}
|
|
1824
|
+
workspaceLabel={workspaceLabel}
|
|
1825
|
+
/>
|
|
1826
|
+
</DragOverlay>
|
|
1827
|
+
</DragDropProvider>
|
|
1828
|
+
</div>
|
|
1829
|
+
</>
|
|
1830
|
+
</Show>
|
|
1831
|
+
</div>
|
|
1832
|
+
</>
|
|
1833
|
+
)}
|
|
1834
|
+
</Show>
|
|
1835
|
+
|
|
1836
|
+
<div
|
|
1837
|
+
class="shrink-0 px-2 py-3 border-t border-border-weak-base"
|
|
1838
|
+
classList={{
|
|
1839
|
+
hidden: !(providers.all().length > 0 && providers.paid().length === 0),
|
|
1840
|
+
}}
|
|
1841
|
+
>
|
|
1842
|
+
<div class="rounded-md bg-background-base shadow-xs-border-base">
|
|
1843
|
+
<div class="p-3 flex flex-col gap-2">
|
|
1844
|
+
<div class="text-12-medium text-text-strong">{language.t("sidebar.gettingStarted.title")}</div>
|
|
1845
|
+
<div class="text-text-base">{language.t("sidebar.gettingStarted.line1")}</div>
|
|
1846
|
+
<div class="text-text-base">{language.t("sidebar.gettingStarted.line2")}</div>
|
|
1847
|
+
</div>
|
|
1848
|
+
<Button
|
|
1849
|
+
class="flex w-full text-left justify-start text-12-medium text-text-strong stroke-[1.5px] rounded-md rounded-t-none shadow-none border-t border-border-weak-base px-3"
|
|
1850
|
+
size="large"
|
|
1851
|
+
icon="plus"
|
|
1852
|
+
onClick={connectProvider}
|
|
1853
|
+
>
|
|
1854
|
+
{language.t("command.provider.connect")}
|
|
1855
|
+
</Button>
|
|
1856
|
+
</div>
|
|
1857
|
+
</div>
|
|
1858
|
+
</div>
|
|
1859
|
+
)
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
return (
|
|
1863
|
+
<div class="relative bg-background-base flex-1 min-h-0 flex flex-col select-none [&_input]:select-text [&_textarea]:select-text [&_[contenteditable]]:select-text">
|
|
1864
|
+
<Titlebar />
|
|
1865
|
+
<div class="flex-1 min-h-0 flex">
|
|
1866
|
+
<nav
|
|
1867
|
+
aria-label={language.t("sidebar.nav.projectsAndSessions")}
|
|
1868
|
+
data-component="sidebar-nav-desktop"
|
|
1869
|
+
classList={{
|
|
1870
|
+
"hidden xl:block": true,
|
|
1871
|
+
"relative shrink-0": true,
|
|
1872
|
+
}}
|
|
1873
|
+
style={{ width: layout.sidebar.opened() ? `${Math.max(layout.sidebar.width(), 244)}px` : "64px" }}
|
|
1874
|
+
ref={(el) => {
|
|
1875
|
+
setState("nav", el)
|
|
1876
|
+
}}
|
|
1877
|
+
onMouseEnter={() => {
|
|
1878
|
+
if (navLeave.current === undefined) return
|
|
1879
|
+
clearTimeout(navLeave.current)
|
|
1880
|
+
navLeave.current = undefined
|
|
1881
|
+
}}
|
|
1882
|
+
onMouseLeave={() => {
|
|
1883
|
+
aim.reset()
|
|
1884
|
+
if (!sidebarHovering()) return
|
|
1885
|
+
|
|
1886
|
+
if (navLeave.current !== undefined) clearTimeout(navLeave.current)
|
|
1887
|
+
navLeave.current = window.setTimeout(() => {
|
|
1888
|
+
navLeave.current = undefined
|
|
1889
|
+
setState("hoverProject", undefined)
|
|
1890
|
+
setState("hoverSession", undefined)
|
|
1891
|
+
}, 300)
|
|
1892
|
+
}}
|
|
1893
|
+
>
|
|
1894
|
+
<div class="@container w-full h-full contain-strict">
|
|
1895
|
+
<SidebarContent
|
|
1896
|
+
opened={() => layout.sidebar.opened()}
|
|
1897
|
+
aimMove={aim.move}
|
|
1898
|
+
projects={() => layout.projects.list()}
|
|
1899
|
+
renderProject={(project) => <SortableProject ctx={projectSidebarCtx} project={project} />}
|
|
1900
|
+
handleDragStart={handleDragStart}
|
|
1901
|
+
handleDragEnd={handleDragEnd}
|
|
1902
|
+
handleDragOver={handleDragOver}
|
|
1903
|
+
openProjectLabel={language.t("command.project.open")}
|
|
1904
|
+
openProjectKeybind={() => command.keybind("project.open")}
|
|
1905
|
+
onOpenProject={chooseProject}
|
|
1906
|
+
renderProjectOverlay={() => (
|
|
1907
|
+
<ProjectDragOverlay projects={() => layout.projects.list()} activeProject={() => store.activeProject} />
|
|
1908
|
+
)}
|
|
1909
|
+
settingsLabel={() => language.t("sidebar.settings")}
|
|
1910
|
+
settingsKeybind={() => command.keybind("settings.open")}
|
|
1911
|
+
onOpenSettings={openSettings}
|
|
1912
|
+
helpLabel={() => language.t("sidebar.help")}
|
|
1913
|
+
onOpenHelp={() => platform.openLink("https://nikcli.ai/desktop-feedback")}
|
|
1914
|
+
renderPanel={() => <SidebarPanel project={currentProject()} />}
|
|
1915
|
+
/>
|
|
1916
|
+
</div>
|
|
1917
|
+
<Show when={!layout.sidebar.opened() ? hoverProjectData() : undefined} keyed>
|
|
1918
|
+
{(project) => (
|
|
1919
|
+
<div class="absolute inset-y-0 left-16 z-50 flex" onMouseEnter={aim.reset}>
|
|
1920
|
+
<SidebarPanel project={project} />
|
|
1921
|
+
</div>
|
|
1922
|
+
)}
|
|
1923
|
+
</Show>
|
|
1924
|
+
<Show when={layout.sidebar.opened()}>
|
|
1925
|
+
<ResizeHandle
|
|
1926
|
+
direction="horizontal"
|
|
1927
|
+
size={layout.sidebar.width()}
|
|
1928
|
+
min={244}
|
|
1929
|
+
max={window.innerWidth * 0.3 + 64}
|
|
1930
|
+
collapseThreshold={244}
|
|
1931
|
+
onResize={layout.sidebar.resize}
|
|
1932
|
+
onCollapse={layout.sidebar.close}
|
|
1933
|
+
/>
|
|
1934
|
+
</Show>
|
|
1935
|
+
</nav>
|
|
1936
|
+
<div class="xl:hidden">
|
|
1937
|
+
<div
|
|
1938
|
+
classList={{
|
|
1939
|
+
"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200": true,
|
|
1940
|
+
"opacity-100 pointer-events-auto": layout.mobileSidebar.opened(),
|
|
1941
|
+
"opacity-0 pointer-events-none": !layout.mobileSidebar.opened(),
|
|
1942
|
+
}}
|
|
1943
|
+
onClick={(e) => {
|
|
1944
|
+
if (e.target === e.currentTarget) layout.mobileSidebar.hide()
|
|
1945
|
+
}}
|
|
1946
|
+
/>
|
|
1947
|
+
<nav
|
|
1948
|
+
aria-label={language.t("sidebar.nav.projectsAndSessions")}
|
|
1949
|
+
data-component="sidebar-nav-mobile"
|
|
1950
|
+
classList={{
|
|
1951
|
+
"@container fixed top-10 bottom-0 left-0 z-50 w-72 bg-background-base transition-transform duration-200 ease-out": true,
|
|
1952
|
+
"translate-x-0": layout.mobileSidebar.opened(),
|
|
1953
|
+
"-translate-x-full": !layout.mobileSidebar.opened(),
|
|
1954
|
+
}}
|
|
1955
|
+
onClick={(e) => e.stopPropagation()}
|
|
1956
|
+
>
|
|
1957
|
+
<SidebarContent
|
|
1958
|
+
mobile
|
|
1959
|
+
opened={() => layout.sidebar.opened()}
|
|
1960
|
+
aimMove={aim.move}
|
|
1961
|
+
projects={() => layout.projects.list()}
|
|
1962
|
+
renderProject={(project) => <SortableProject ctx={projectSidebarCtx} project={project} mobile />}
|
|
1963
|
+
handleDragStart={handleDragStart}
|
|
1964
|
+
handleDragEnd={handleDragEnd}
|
|
1965
|
+
handleDragOver={handleDragOver}
|
|
1966
|
+
openProjectLabel={language.t("command.project.open")}
|
|
1967
|
+
openProjectKeybind={() => command.keybind("project.open")}
|
|
1968
|
+
onOpenProject={chooseProject}
|
|
1969
|
+
renderProjectOverlay={() => (
|
|
1970
|
+
<ProjectDragOverlay projects={() => layout.projects.list()} activeProject={() => store.activeProject} />
|
|
1971
|
+
)}
|
|
1972
|
+
settingsLabel={() => language.t("sidebar.settings")}
|
|
1973
|
+
settingsKeybind={() => command.keybind("settings.open")}
|
|
1974
|
+
onOpenSettings={openSettings}
|
|
1975
|
+
helpLabel={() => language.t("sidebar.help")}
|
|
1976
|
+
onOpenHelp={() => platform.openLink("https://nikcli.ai/desktop-feedback")}
|
|
1977
|
+
renderPanel={() => <SidebarPanel project={currentProject()} mobile />}
|
|
1978
|
+
/>
|
|
1979
|
+
</nav>
|
|
1980
|
+
</div>
|
|
1981
|
+
|
|
1982
|
+
<main
|
|
1983
|
+
classList={{
|
|
1984
|
+
"size-full overflow-x-hidden flex flex-col items-start contain-strict border-t border-border-weak-base": true,
|
|
1985
|
+
"xl:border-l xl:rounded-tl-sm": !layout.sidebar.opened(),
|
|
1986
|
+
}}
|
|
1987
|
+
>
|
|
1988
|
+
<Show when={!autoselecting()} fallback={<div class="size-full" />}>
|
|
1989
|
+
{props.children}
|
|
1990
|
+
</Show>
|
|
1991
|
+
</main>
|
|
1992
|
+
</div>
|
|
1993
|
+
<Toast.Region />
|
|
1994
|
+
</div>
|
|
1995
|
+
)
|
|
1996
|
+
}
|