@cuongtran001/kanna 0.39.2
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/LICENSE +22 -0
- package/README.md +355 -0
- package/bin/kanna +9 -0
- package/dist/client/apple-touch-icon.png +0 -0
- package/dist/client/assets/abap-BdImnpbu.js +1 -0
- package/dist/client/assets/actionscript-3-CoDkCxhg.js +1 -0
- package/dist/client/assets/ada-bCR0ucgS.js +1 -0
- package/dist/client/assets/andromeeda-C4gqWexZ.js +1 -0
- package/dist/client/assets/angular-html-CU67Zn6k.js +1 -0
- package/dist/client/assets/angular-ts-BwZT4LLn.js +1 -0
- package/dist/client/assets/apache-Pmp26Uib.js +1 -0
- package/dist/client/assets/apex-D8_7TLub.js +1 -0
- package/dist/client/assets/apl-dKokRX4l.js +1 -0
- package/dist/client/assets/applescript-Co6uUVPk.js +1 -0
- package/dist/client/assets/ara-BRHolxvo.js +1 -0
- package/dist/client/assets/asciidoc-Ve4PFQV2.js +1 -0
- package/dist/client/assets/asm-D_Q5rh1f.js +1 -0
- package/dist/client/assets/astro-CbQHKStN.js +1 -0
- package/dist/client/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/dist/client/assets/awk-DMzUqQB5.js +1 -0
- package/dist/client/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/dist/client/assets/ayu-light-BA47KaF1.js +1 -0
- package/dist/client/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/dist/client/assets/ballerina-BFfxhgS-.js +1 -0
- package/dist/client/assets/bat-BkioyH1T.js +1 -0
- package/dist/client/assets/beancount-k_qm7-4y.js +1 -0
- package/dist/client/assets/berry-uYugtg8r.js +1 -0
- package/dist/client/assets/bibtex-CHM0blh-.js +1 -0
- package/dist/client/assets/bicep-Bmn6On1c.js +1 -0
- package/dist/client/assets/bird2-DPOp833l.js +1 -0
- package/dist/client/assets/blade-D4QpJJKB.js +1 -0
- package/dist/client/assets/bricolage-grotesque-latin-ext-wght-normal-CcLUaPy7.woff2 +0 -0
- package/dist/client/assets/bricolage-grotesque-latin-wght-normal-DLoelf7F.woff2 +0 -0
- package/dist/client/assets/bricolage-grotesque-vietnamese-wght-normal-BUzh504Q.woff2 +0 -0
- package/dist/client/assets/bsl-BO_Y6i37.js +1 -0
- package/dist/client/assets/c-BIGW1oBm.js +1 -0
- package/dist/client/assets/c3-eo99z4R2.js +1 -0
- package/dist/client/assets/cadence-Bv_4Rxtq.js +1 -0
- package/dist/client/assets/cairo-KRGpt6FW.js +1 -0
- package/dist/client/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/dist/client/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/dist/client/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/dist/client/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/dist/client/assets/clarity-D53aC0YG.js +1 -0
- package/dist/client/assets/clojure-P80f7IUj.js +1 -0
- package/dist/client/assets/cmake-D1j8_8rp.js +1 -0
- package/dist/client/assets/cobol-nwyudZeR.js +1 -0
- package/dist/client/assets/codeowners-Bp6g37R7.js +1 -0
- package/dist/client/assets/codeql-DsOJ9woJ.js +1 -0
- package/dist/client/assets/coffee-Ch7k5sss.js +1 -0
- package/dist/client/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/dist/client/assets/coq-DkFqJrB1.js +1 -0
- package/dist/client/assets/cpp-CofmeUqb.js +1 -0
- package/dist/client/assets/crystal-tKQVLTB8.js +1 -0
- package/dist/client/assets/csharp-COcwbKMJ.js +1 -0
- package/dist/client/assets/css-DPfMkruS.js +1 -0
- package/dist/client/assets/csv-fuZLfV_i.js +1 -0
- package/dist/client/assets/cue-D82EKSYY.js +1 -0
- package/dist/client/assets/cypher-COkxafJQ.js +1 -0
- package/dist/client/assets/d-85-TOEBH.js +1 -0
- package/dist/client/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/client/assets/dart-CF10PKvl.js +1 -0
- package/dist/client/assets/dax-CEL-wOlO.js +1 -0
- package/dist/client/assets/desktop-BmXAJ9_W.js +1 -0
- package/dist/client/assets/diff-D97Zzqfu.js +1 -0
- package/dist/client/assets/docker-BcOcwvcX.js +1 -0
- package/dist/client/assets/dotenv-Da5cRb03.js +1 -0
- package/dist/client/assets/dracula-BzJJZx-M.js +1 -0
- package/dist/client/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/dist/client/assets/dream-maker-BtqSS_iP.js +1 -0
- package/dist/client/assets/edge-BkV0erSs.js +1 -0
- package/dist/client/assets/elixir-CDX3lj18.js +1 -0
- package/dist/client/assets/elm-DbKCFpqz.js +1 -0
- package/dist/client/assets/emacs-lisp-C9XAeP06.js +1 -0
- package/dist/client/assets/erb-B12qg9BL.js +1 -0
- package/dist/client/assets/erlang-DsQrWhSR.js +1 -0
- package/dist/client/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/dist/client/assets/everforest-light-C8M2exoo.js +1 -0
- package/dist/client/assets/fennel-BYunw83y.js +1 -0
- package/dist/client/assets/fish-BvzEVeQv.js +1 -0
- package/dist/client/assets/fluent-C4IJs8-o.js +1 -0
- package/dist/client/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/dist/client/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/dist/client/assets/fsharp-CXgrBDvD.js +1 -0
- package/dist/client/assets/gdresource-BOOCDP_w.js +1 -0
- package/dist/client/assets/gdscript-C5YyOfLZ.js +1 -0
- package/dist/client/assets/gdshader-DkwncUOv.js +1 -0
- package/dist/client/assets/genie-D0YGMca9.js +1 -0
- package/dist/client/assets/gherkin-DyxjwDmM.js +1 -0
- package/dist/client/assets/git-commit-F4YmCXRG.js +1 -0
- package/dist/client/assets/git-rebase-r7XF79zn.js +1 -0
- package/dist/client/assets/github-dark-DHJKELXO.js +1 -0
- package/dist/client/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/dist/client/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/dist/client/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/dist/client/assets/github-light-DAi9KRSo.js +1 -0
- package/dist/client/assets/github-light-default-D7oLnXFd.js +1 -0
- package/dist/client/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/dist/client/assets/gleam-BspZqrRM.js +1 -0
- package/dist/client/assets/glimmer-js-Rg0-pVw9.js +1 -0
- package/dist/client/assets/glimmer-ts-U6CK756n.js +1 -0
- package/dist/client/assets/glsl-DplSGwfg.js +1 -0
- package/dist/client/assets/gn-n2N0HUVH.js +1 -0
- package/dist/client/assets/gnuplot-DdkO51Og.js +1 -0
- package/dist/client/assets/go-CxLEBnE3.js +1 -0
- package/dist/client/assets/graphql-ChdNCCLP.js +1 -0
- package/dist/client/assets/groovy-gcz8RCvz.js +1 -0
- package/dist/client/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/dist/client/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/dist/client/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/dist/client/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/dist/client/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/dist/client/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/dist/client/assets/hack-CaT9iCJl.js +1 -0
- package/dist/client/assets/haml-B8DHNrY2.js +1 -0
- package/dist/client/assets/handlebars-BL8al0AC.js +1 -0
- package/dist/client/assets/haskell-Df6bDoY_.js +1 -0
- package/dist/client/assets/haxe-CzTSHFRz.js +1 -0
- package/dist/client/assets/hcl-BWvSN4gD.js +1 -0
- package/dist/client/assets/hjson-D5-asLiD.js +1 -0
- package/dist/client/assets/hlsl-D3lLCCz7.js +1 -0
- package/dist/client/assets/horizon-BUw7H-hv.js +1 -0
- package/dist/client/assets/horizon-bright-Cn-bp-IR.js +1 -0
- package/dist/client/assets/houston-DnULxvSX.js +1 -0
- package/dist/client/assets/html-GMplVEZG.js +1 -0
- package/dist/client/assets/html-derivative-BFtXZ54Q.js +1 -0
- package/dist/client/assets/http-jrhK8wxY.js +1 -0
- package/dist/client/assets/hurl-irOxFIW8.js +1 -0
- package/dist/client/assets/hxml-Bvhsp5Yf.js +1 -0
- package/dist/client/assets/hy-DFXneXwc.js +1 -0
- package/dist/client/assets/imba-DGztddWO.js +1 -0
- package/dist/client/assets/index-Do7324M0.css +32 -0
- package/dist/client/assets/index-ktE9DLCD.js +2620 -0
- package/dist/client/assets/ini-BEwlwnbL.js +1 -0
- package/dist/client/assets/java-CylS5w8V.js +1 -0
- package/dist/client/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/client/assets/jinja-4LBKfQ-Z.js +1 -0
- package/dist/client/assets/jison-wvAkD_A8.js +1 -0
- package/dist/client/assets/json-Cp-IABpG.js +1 -0
- package/dist/client/assets/json5-C9tS-k6U.js +1 -0
- package/dist/client/assets/jsonc-Des-eS-w.js +1 -0
- package/dist/client/assets/jsonl-DcaNXYhu.js +1 -0
- package/dist/client/assets/jsonnet-DFQXde-d.js +1 -0
- package/dist/client/assets/jssm-C2t-YnRu.js +1 -0
- package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
- package/dist/client/assets/julia-CxzCAyBv.js +1 -0
- package/dist/client/assets/just-Cw27pwNe.js +1 -0
- package/dist/client/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/dist/client/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/dist/client/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/dist/client/assets/kdl-DV7GczEv.js +1 -0
- package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
- package/dist/client/assets/kusto-DZf3V79B.js +1 -0
- package/dist/client/assets/laserwave-DUszq2jm.js +1 -0
- package/dist/client/assets/latex-CWtU0Tv5.js +1 -0
- package/dist/client/assets/lean-BZvkOJ9d.js +1 -0
- package/dist/client/assets/less-B1dDrJ26.js +1 -0
- package/dist/client/assets/light-plus-B7mTdjB0.js +1 -0
- package/dist/client/assets/liquid-DYVedYrR.js +1 -0
- package/dist/client/assets/llvm-DjAJT7YJ.js +1 -0
- package/dist/client/assets/log-2UxHyX5q.js +1 -0
- package/dist/client/assets/logo-BtOb2qkB.js +1 -0
- package/dist/client/assets/lua-BaeVxFsk.js +1 -0
- package/dist/client/assets/luau-C-HG3fhB.js +1 -0
- package/dist/client/assets/make-CHLpvVh8.js +1 -0
- package/dist/client/assets/markdown-Cvjx9yec.js +1 -0
- package/dist/client/assets/marko-CnJfTvn9.js +1 -0
- package/dist/client/assets/material-theme-D5KoaKCx.js +1 -0
- package/dist/client/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/dist/client/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/dist/client/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/dist/client/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/dist/client/assets/matlab-D7o27uSR.js +1 -0
- package/dist/client/assets/mdc-BMNejdWA.js +1 -0
- package/dist/client/assets/mdx-Cmh6b_Ma.js +1 -0
- package/dist/client/assets/mermaid-mWjccvbQ.js +1 -0
- package/dist/client/assets/min-dark-CafNBF8u.js +1 -0
- package/dist/client/assets/min-light-CTRr51gU.js +1 -0
- package/dist/client/assets/mipsasm-CKIfxQSi.js +1 -0
- package/dist/client/assets/mojo-rZm6bMo-.js +1 -0
- package/dist/client/assets/monokai-D4h5O-jR.js +1 -0
- package/dist/client/assets/moonbit-_H4v1dQx.js +1 -0
- package/dist/client/assets/move-IF9eRakj.js +1 -0
- package/dist/client/assets/narrat-DRg8JJMk.js +1 -0
- package/dist/client/assets/nextflow-Zz6hmt5N.js +1 -0
- package/dist/client/assets/nextflow-groovy-BeH2EWoN.js +1 -0
- package/dist/client/assets/nginx-BpAMiNFr.js +1 -0
- package/dist/client/assets/night-owl-C39BiMTA.js +1 -0
- package/dist/client/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/dist/client/assets/nim-CVrawwO9.js +1 -0
- package/dist/client/assets/nix-CwoSXNpI.js +1 -0
- package/dist/client/assets/nord-Ddv68eIx.js +1 -0
- package/dist/client/assets/nushell-Cz2AlsmD.js +1 -0
- package/dist/client/assets/objective-c-DXmwc3jG.js +1 -0
- package/dist/client/assets/objective-cpp-CLxacb5B.js +1 -0
- package/dist/client/assets/ocaml-C0hk2d4L.js +1 -0
- package/dist/client/assets/odin-BBf5iR-q.js +1 -0
- package/dist/client/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/dist/client/assets/one-light-C3Wv6jpd.js +1 -0
- package/dist/client/assets/openscad-C4EeE6gA.js +1 -0
- package/dist/client/assets/pascal-D93ZcfNL.js +1 -0
- package/dist/client/assets/perl-C0TMdlhV.js +1 -0
- package/dist/client/assets/php-Dhbhpdrm.js +1 -0
- package/dist/client/assets/pierre-dark-DF2SEV7i.js +1 -0
- package/dist/client/assets/pierre-light-DOlZxES8.js +1 -0
- package/dist/client/assets/pkl-u5AG7uiY.js +1 -0
- package/dist/client/assets/plastic-3e1v2bzS.js +1 -0
- package/dist/client/assets/plsql-ChMvpjG-.js +1 -0
- package/dist/client/assets/po-BTJTHyun.js +1 -0
- package/dist/client/assets/poimandres-CS3Unz2-.js +1 -0
- package/dist/client/assets/polar-C0HS_06l.js +1 -0
- package/dist/client/assets/postcss-CXtECtnM.js +1 -0
- package/dist/client/assets/powerquery-CEu0bR-o.js +1 -0
- package/dist/client/assets/powershell-Dpen1YoG.js +1 -0
- package/dist/client/assets/prisma-Dd19v3D-.js +1 -0
- package/dist/client/assets/prolog-CbFg5uaA.js +1 -0
- package/dist/client/assets/proto-C7zT0LnQ.js +1 -0
- package/dist/client/assets/pug-CGlum2m_.js +1 -0
- package/dist/client/assets/puppet-BMWR74SV.js +1 -0
- package/dist/client/assets/purescript-CklMAg4u.js +1 -0
- package/dist/client/assets/python-B6aJPvgy.js +1 -0
- package/dist/client/assets/qml-3beO22l8.js +1 -0
- package/dist/client/assets/qmldir-C8lEn-DE.js +1 -0
- package/dist/client/assets/qss-IeuSbFQv.js +1 -0
- package/dist/client/assets/r-Dspwwk_N.js +1 -0
- package/dist/client/assets/racket-BqYA7rlc.js +1 -0
- package/dist/client/assets/raku-DXvB9xmW.js +1 -0
- package/dist/client/assets/razor-Uh8Bk_45.js +1 -0
- package/dist/client/assets/red-bN70gL4F.js +1 -0
- package/dist/client/assets/reg-C-SQnVFl.js +1 -0
- package/dist/client/assets/regexp-CDVJQ6XC.js +1 -0
- package/dist/client/assets/rel-C3B-1QV4.js +1 -0
- package/dist/client/assets/riscv-BM1_JUlF.js +1 -0
- package/dist/client/assets/ron-D8l8udqQ.js +1 -0
- package/dist/client/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/dist/client/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/dist/client/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/dist/client/assets/rosmsg-BJDFO7_C.js +1 -0
- package/dist/client/assets/rst-BrH8l1NY.js +1 -0
- package/dist/client/assets/ruby-Dw2BHqvy.js +1 -0
- package/dist/client/assets/rust-B1yitclQ.js +1 -0
- package/dist/client/assets/sas-cz2c8ADy.js +1 -0
- package/dist/client/assets/sass-Cj5Yp3dK.js +1 -0
- package/dist/client/assets/scala-C151Ov-r.js +1 -0
- package/dist/client/assets/scheme-C98Dy4si.js +1 -0
- package/dist/client/assets/scss-OYdSNvt2.js +1 -0
- package/dist/client/assets/sdbl-DVxCFoDh.js +1 -0
- package/dist/client/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/dist/client/assets/shellscript-Yzrsuije.js +1 -0
- package/dist/client/assets/shellsession-BADoaaVG.js +1 -0
- package/dist/client/assets/slack-dark-BthQWCQV.js +1 -0
- package/dist/client/assets/slack-ochin-DqwNpetd.js +1 -0
- package/dist/client/assets/smalltalk-BERRCDM3.js +1 -0
- package/dist/client/assets/snazzy-light-Bw305WKR.js +1 -0
- package/dist/client/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/dist/client/assets/solarized-light-L9t79GZl.js +1 -0
- package/dist/client/assets/solidity-rGO070M0.js +1 -0
- package/dist/client/assets/soy-Brmx7dQM.js +1 -0
- package/dist/client/assets/sparql-rVzFXLq3.js +1 -0
- package/dist/client/assets/splunk-BtCnVYZw.js +1 -0
- package/dist/client/assets/sql-BLtJtn59.js +1 -0
- package/dist/client/assets/ssh-config-_ykCGR6B.js +1 -0
- package/dist/client/assets/stata-BH5u7GGu.js +1 -0
- package/dist/client/assets/stylus-BEDo0Tqx.js +1 -0
- package/dist/client/assets/surrealql-Bq5Q-fJD.js +1 -0
- package/dist/client/assets/svelte-C_ipcX3V.js +1 -0
- package/dist/client/assets/swift-D82vCrfD.js +1 -0
- package/dist/client/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/dist/client/assets/system-verilog-CnnmHF94.js +1 -0
- package/dist/client/assets/systemd-4A_iFExJ.js +1 -0
- package/dist/client/assets/talonscript-CkByrt1z.js +1 -0
- package/dist/client/assets/tasl-QIJgUcNo.js +1 -0
- package/dist/client/assets/tcl-dwOrl1Do.js +1 -0
- package/dist/client/assets/templ-P3uqSqPl.js +1 -0
- package/dist/client/assets/terraform-BETggiCN.js +1 -0
- package/dist/client/assets/tex-idrVyKtj.js +1 -0
- package/dist/client/assets/tokyo-night-hegEt444.js +1 -0
- package/dist/client/assets/toml-vGWfd6FD.js +1 -0
- package/dist/client/assets/ts-tags-zn1MmPIZ.js +1 -0
- package/dist/client/assets/tsv-B_m7g4N7.js +1 -0
- package/dist/client/assets/tsx-COt5Ahok.js +1 -0
- package/dist/client/assets/turtle-BsS91CYL.js +1 -0
- package/dist/client/assets/twig-DNn4PbVi.js +1 -0
- package/dist/client/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/client/assets/typespec-BGHnOYBU.js +1 -0
- package/dist/client/assets/typst-DHCkPAjA.js +1 -0
- package/dist/client/assets/v-BcVCzyr7.js +1 -0
- package/dist/client/assets/vala-CsfeWuGM.js +1 -0
- package/dist/client/assets/vb-D17OF-Vu.js +1 -0
- package/dist/client/assets/verilog-BQ8w6xss.js +1 -0
- package/dist/client/assets/vesper-DU1UobuO.js +1 -0
- package/dist/client/assets/vhdl-CeAyd5Ju.js +1 -0
- package/dist/client/assets/viml-CJc9bBzg.js +1 -0
- package/dist/client/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/dist/client/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/dist/client/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/dist/client/assets/vue-DN_0RTcg.js +1 -0
- package/dist/client/assets/vue-html-AaS7Mt5G.js +1 -0
- package/dist/client/assets/vue-vine-CQOfvN7w.js +1 -0
- package/dist/client/assets/vyper-CDx5xZoG.js +1 -0
- package/dist/client/assets/wasm-CG6Dc4jp.js +1 -0
- package/dist/client/assets/wasm-MzD3tlZU.js +1 -0
- package/dist/client/assets/wenyan-BV7otONQ.js +1 -0
- package/dist/client/assets/wgsl-Dx-B1_4e.js +1 -0
- package/dist/client/assets/wikitext-BhOHFoWU.js +1 -0
- package/dist/client/assets/wit-5i3qLPDT.js +1 -0
- package/dist/client/assets/wolfram-lXgVvXCa.js +1 -0
- package/dist/client/assets/xml-sdJ4AIDG.js +1 -0
- package/dist/client/assets/xsl-CtQFsRM5.js +1 -0
- package/dist/client/assets/yaml-Buea-lGh.js +1 -0
- package/dist/client/assets/zenscript-DVFEvuxE.js +1 -0
- package/dist/client/assets/zig-VOosw3JB.js +1 -0
- package/dist/client/chat-sounds/Blow.mp3 +0 -0
- package/dist/client/chat-sounds/Bottle.mp3 +0 -0
- package/dist/client/chat-sounds/Frog.mp3 +0 -0
- package/dist/client/chat-sounds/Funk.mp3 +0 -0
- package/dist/client/chat-sounds/Glass.mp3 +0 -0
- package/dist/client/chat-sounds/Ping.mp3 +0 -0
- package/dist/client/chat-sounds/Pop.mp3 +0 -0
- package/dist/client/chat-sounds/Purr.mp3 +0 -0
- package/dist/client/chat-sounds/Tink.mp3 +0 -0
- package/dist/client/editor-icons/cursor.png +0 -0
- package/dist/client/editor-icons/custom.png +0 -0
- package/dist/client/editor-icons/default-app.png +0 -0
- package/dist/client/editor-icons/finder.png +0 -0
- package/dist/client/editor-icons/preview.png +0 -0
- package/dist/client/editor-icons/terminal.png +0 -0
- package/dist/client/editor-icons/windsurf.png +0 -0
- package/dist/client/editor-icons/xcode.png +0 -0
- package/dist/client/favicon.png +0 -0
- package/dist/client/fonts/body-medium.woff2 +0 -0
- package/dist/client/fonts/body-regular-italic.woff2 +0 -0
- package/dist/client/fonts/body-regular.woff2 +0 -0
- package/dist/client/fonts/body-semibold.woff2 +0 -0
- package/dist/client/icon-192.png +0 -0
- package/dist/client/icon-512.png +0 -0
- package/dist/client/icon-maskable-512.png +0 -0
- package/dist/client/icon.svg +4 -0
- package/dist/client/index.html +34 -0
- package/dist/client/manifest.webmanifest +46 -0
- package/dist/client/screenshot-light.png +0 -0
- package/dist/client/screenshot.png +0 -0
- package/dist/export-viewer/assets/bricolage-grotesque-latin-ext-wght-normal-CcLUaPy7.woff2 +0 -0
- package/dist/export-viewer/assets/bricolage-grotesque-latin-wght-normal-DLoelf7F.woff2 +0 -0
- package/dist/export-viewer/assets/bricolage-grotesque-vietnamese-wght-normal-BUzh504Q.woff2 +0 -0
- package/dist/export-viewer/assets/index-D1qUumZR.js +410 -0
- package/dist/export-viewer/assets/index-gG2nMW51.css +1 -0
- package/dist/export-viewer/editor-icons/cursor.png +0 -0
- package/dist/export-viewer/editor-icons/custom.png +0 -0
- package/dist/export-viewer/editor-icons/default-app.png +0 -0
- package/dist/export-viewer/editor-icons/finder.png +0 -0
- package/dist/export-viewer/editor-icons/preview.png +0 -0
- package/dist/export-viewer/editor-icons/terminal.png +0 -0
- package/dist/export-viewer/editor-icons/windsurf.png +0 -0
- package/dist/export-viewer/editor-icons/xcode.png +0 -0
- package/dist/export-viewer/fonts/body-medium.woff2 +0 -0
- package/dist/export-viewer/fonts/body-regular-italic.woff2 +0 -0
- package/dist/export-viewer/fonts/body-regular.woff2 +0 -0
- package/dist/export-viewer/fonts/body-semibold.woff2 +0 -0
- package/dist/export-viewer/index.html +14 -0
- package/package.json +99 -0
- package/src/server/__fixtures__/claude-session-empty.jsonl +0 -0
- package/src/server/__fixtures__/claude-session-malformed.jsonl +3 -0
- package/src/server/__fixtures__/claude-session-valid.jsonl +6 -0
- package/src/server/agent.test.ts +2369 -0
- package/src/server/agent.ts +1927 -0
- package/src/server/analytics.test.ts +313 -0
- package/src/server/analytics.ts +131 -0
- package/src/server/app-settings.test.ts +233 -0
- package/src/server/app-settings.ts +548 -0
- package/src/server/auth.test.ts +329 -0
- package/src/server/auth.ts +204 -0
- package/src/server/auto-continue/e2e.test.ts +215 -0
- package/src/server/auto-continue/events.test.ts +30 -0
- package/src/server/auto-continue/events.ts +35 -0
- package/src/server/auto-continue/limit-detector.test.ts +153 -0
- package/src/server/auto-continue/limit-detector.ts +159 -0
- package/src/server/auto-continue/read-model.test.ts +109 -0
- package/src/server/auto-continue/read-model.ts +83 -0
- package/src/server/auto-continue/schedule-manager.test.ts +155 -0
- package/src/server/auto-continue/schedule-manager.ts +116 -0
- package/src/server/claude-session-importer.test.ts +214 -0
- package/src/server/claude-session-importer.ts +187 -0
- package/src/server/claude-session-mapper.test.ts +88 -0
- package/src/server/claude-session-mapper.ts +106 -0
- package/src/server/claude-session-parser.test.ts +38 -0
- package/src/server/claude-session-parser.ts +67 -0
- package/src/server/claude-session-scanner.test.ts +49 -0
- package/src/server/claude-session-scanner.ts +24 -0
- package/src/server/claude-session-types.ts +61 -0
- package/src/server/cli-runtime.test.ts +523 -0
- package/src/server/cli-runtime.ts +405 -0
- package/src/server/cli-supervisor.ts +102 -0
- package/src/server/cli.ts +64 -0
- package/src/server/cloudflare-tunnel/agent-integration.test.ts +76 -0
- package/src/server/cloudflare-tunnel/agent-integration.ts +55 -0
- package/src/server/cloudflare-tunnel/detector.test.ts +72 -0
- package/src/server/cloudflare-tunnel/detector.ts +44 -0
- package/src/server/cloudflare-tunnel/e2e.test.ts +194 -0
- package/src/server/cloudflare-tunnel/events.test.ts +43 -0
- package/src/server/cloudflare-tunnel/events.ts +31 -0
- package/src/server/cloudflare-tunnel/gateway.ts +143 -0
- package/src/server/cloudflare-tunnel/lifecycle.test.ts +48 -0
- package/src/server/cloudflare-tunnel/lifecycle.ts +62 -0
- package/src/server/cloudflare-tunnel/read-model.test.ts +69 -0
- package/src/server/cloudflare-tunnel/read-model.ts +80 -0
- package/src/server/cloudflare-tunnel/tunnel-manager.test.ts +116 -0
- package/src/server/cloudflare-tunnel/tunnel-manager.ts +165 -0
- package/src/server/codex-app-server-protocol.ts +487 -0
- package/src/server/codex-app-server.test.ts +1816 -0
- package/src/server/codex-app-server.ts +1475 -0
- package/src/server/diff-store.test.ts +737 -0
- package/src/server/diff-store.ts +2199 -0
- package/src/server/discovery.test.ts +211 -0
- package/src/server/discovery.ts +301 -0
- package/src/server/event-store.test.ts +797 -0
- package/src/server/event-store.ts +1421 -0
- package/src/server/events.ts +217 -0
- package/src/server/external-open.test.ts +112 -0
- package/src/server/external-open.ts +345 -0
- package/src/server/generate-commit-message.test.ts +79 -0
- package/src/server/generate-commit-message.ts +126 -0
- package/src/server/generate-title.ts +76 -0
- package/src/server/harness-types.ts +19 -0
- package/src/server/keybindings.test.ts +144 -0
- package/src/server/keybindings.ts +178 -0
- package/src/server/llm-provider.test.ts +134 -0
- package/src/server/llm-provider.ts +207 -0
- package/src/server/machine-name.ts +22 -0
- package/src/server/paths-route.test.ts +64 -0
- package/src/server/paths.ts +35 -0
- package/src/server/process-utils.test.ts +12 -0
- package/src/server/process-utils.ts +47 -0
- package/src/server/project-paths.test.ts +95 -0
- package/src/server/project-paths.ts +191 -0
- package/src/server/provider-catalog.test.ts +69 -0
- package/src/server/provider-catalog.ts +87 -0
- package/src/server/quick-response.test.ts +440 -0
- package/src/server/quick-response.ts +300 -0
- package/src/server/read-models.test.ts +509 -0
- package/src/server/read-models.ts +230 -0
- package/src/server/restart.test.ts +27 -0
- package/src/server/restart.ts +30 -0
- package/src/server/server.ts +616 -0
- package/src/server/share.test.ts +180 -0
- package/src/server/share.ts +150 -0
- package/src/server/standalone-export.test.ts +224 -0
- package/src/server/standalone-export.ts +419 -0
- package/src/server/terminal-manager.test.ts +315 -0
- package/src/server/terminal-manager.ts +350 -0
- package/src/server/test-helpers/async-event-queue.ts +52 -0
- package/src/server/test-helpers/wait-for.ts +14 -0
- package/src/server/title-generation.live.test.ts +44 -0
- package/src/server/update-manager.test.ts +158 -0
- package/src/server/update-manager.ts +222 -0
- package/src/server/update-strategy.test.ts +237 -0
- package/src/server/update-strategy.ts +241 -0
- package/src/server/uploads.test.ts +292 -0
- package/src/server/uploads.ts +131 -0
- package/src/server/ws-router.test.ts +2292 -0
- package/src/server/ws-router.ts +1465 -0
- package/src/shared/analytics.ts +30 -0
- package/src/shared/branding.test.ts +31 -0
- package/src/shared/branding.ts +77 -0
- package/src/shared/dev-ports.test.ts +113 -0
- package/src/shared/dev-ports.ts +134 -0
- package/src/shared/ports.ts +2 -0
- package/src/shared/protocol.ts +257 -0
- package/src/shared/share.ts +27 -0
- package/src/shared/tools.test.ts +164 -0
- package/src/shared/tools.ts +327 -0
- package/src/shared/types.test.ts +25 -0
- package/src/shared/types.ts +1088 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const ANALYTICS_ENDPOINT = "https://kanna.sh/api/t"
|
|
2
|
+
|
|
3
|
+
export const ANALYTICS_STATIC_EVENT_NAMES = [
|
|
4
|
+
"app_launch",
|
|
5
|
+
"project_opened",
|
|
6
|
+
"project_created",
|
|
7
|
+
"project_removed",
|
|
8
|
+
"chat_created",
|
|
9
|
+
"chat_deleted",
|
|
10
|
+
"message_sent",
|
|
11
|
+
"update_checked",
|
|
12
|
+
"update_installed",
|
|
13
|
+
"update_failed",
|
|
14
|
+
"analytics_enabled",
|
|
15
|
+
"analytics_disabled",
|
|
16
|
+
] as const
|
|
17
|
+
|
|
18
|
+
export const ANALYTICS_STATIC_PROPERTY_NAMES = [
|
|
19
|
+
"current_version",
|
|
20
|
+
"environment",
|
|
21
|
+
"latest_version",
|
|
22
|
+
"custom_port_enabled",
|
|
23
|
+
"no_open_enabled",
|
|
24
|
+
"password_enabled",
|
|
25
|
+
"strict_port_enabled",
|
|
26
|
+
"remote_enabled",
|
|
27
|
+
"host_enabled",
|
|
28
|
+
"share_quick_enabled",
|
|
29
|
+
"share_token_enabled",
|
|
30
|
+
] as const
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test"
|
|
2
|
+
import {
|
|
3
|
+
getDataDir,
|
|
4
|
+
getDataDirDisplay,
|
|
5
|
+
getDataRootName,
|
|
6
|
+
getKeybindingsFilePath,
|
|
7
|
+
getKeybindingsFilePathDisplay,
|
|
8
|
+
getRuntimeProfile,
|
|
9
|
+
} from "./branding"
|
|
10
|
+
|
|
11
|
+
describe("runtime profile helpers", () => {
|
|
12
|
+
test("defaults to the prod profile when unset", () => {
|
|
13
|
+
expect(getRuntimeProfile({})).toBe("prod")
|
|
14
|
+
expect(getDataRootName({})).toBe(".kanna")
|
|
15
|
+
expect(getDataDir("/tmp/home", {})).toBe("/tmp/home/.kanna/data")
|
|
16
|
+
expect(getDataDirDisplay({})).toBe("~/.kanna/data")
|
|
17
|
+
expect(getKeybindingsFilePath("/tmp/home", {})).toBe("/tmp/home/.kanna/keybindings.json")
|
|
18
|
+
expect(getKeybindingsFilePathDisplay({})).toBe("~/.kanna/keybindings.json")
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
test("switches to dev paths for the dev profile", () => {
|
|
22
|
+
const env = { KANNA_RUNTIME_PROFILE: "dev" }
|
|
23
|
+
|
|
24
|
+
expect(getRuntimeProfile(env)).toBe("dev")
|
|
25
|
+
expect(getDataRootName(env)).toBe(".kanna-dev")
|
|
26
|
+
expect(getDataDir("/tmp/home", env)).toBe("/tmp/home/.kanna-dev/data")
|
|
27
|
+
expect(getDataDirDisplay(env)).toBe("~/.kanna-dev/data")
|
|
28
|
+
expect(getKeybindingsFilePath("/tmp/home", env)).toBe("/tmp/home/.kanna-dev/keybindings.json")
|
|
29
|
+
expect(getKeybindingsFilePathDisplay(env)).toBe("~/.kanna-dev/keybindings.json")
|
|
30
|
+
})
|
|
31
|
+
})
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export const APP_NAME = "Kanna"
|
|
2
|
+
export const CLI_COMMAND = "kanna"
|
|
3
|
+
export const DATA_ROOT_NAME = ".kanna"
|
|
4
|
+
export const DEV_DATA_ROOT_NAME = ".kanna-dev"
|
|
5
|
+
export const PACKAGE_NAME = "@cuongtran001/kanna"
|
|
6
|
+
export const RUNTIME_PROFILE_ENV_VAR = "KANNA_RUNTIME_PROFILE"
|
|
7
|
+
// Read version from package.json — JSON import works in both Bun and Vite
|
|
8
|
+
import pkg from "../../package.json"
|
|
9
|
+
export const APP_VERSION = pkg.version
|
|
10
|
+
export const SDK_CLIENT_APP = `kanna/${pkg.version}`
|
|
11
|
+
export const LOG_PREFIX = "[kanna]"
|
|
12
|
+
export const DEFAULT_NEW_PROJECT_ROOT = `~/${APP_NAME}`
|
|
13
|
+
|
|
14
|
+
export type RuntimeProfile = "dev" | "prod"
|
|
15
|
+
|
|
16
|
+
type RuntimeEnv = Record<string, string | undefined> | undefined
|
|
17
|
+
|
|
18
|
+
function getRuntimeEnv(): RuntimeEnv {
|
|
19
|
+
const candidate = globalThis as typeof globalThis & {
|
|
20
|
+
process?: {
|
|
21
|
+
env?: Record<string, string | undefined>
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return candidate.process?.env
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function getRuntimeProfile(env: RuntimeEnv = getRuntimeEnv()): RuntimeProfile {
|
|
28
|
+
return env?.[RUNTIME_PROFILE_ENV_VAR]?.trim().toLowerCase() === "dev" ? "dev" : "prod"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getDataRootName(env: RuntimeEnv = getRuntimeEnv()) {
|
|
32
|
+
return getRuntimeProfile(env) === "dev" ? DEV_DATA_ROOT_NAME : DATA_ROOT_NAME
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getDataRootDir(homeDir: string, env: RuntimeEnv = getRuntimeEnv()) {
|
|
36
|
+
return `${homeDir}/${getDataRootName(env)}`
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getDataRootDirDisplay(env: RuntimeEnv = getRuntimeEnv()) {
|
|
40
|
+
return `~/${getDataRootName(env)}`
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function getDataDir(homeDir: string, env: RuntimeEnv = getRuntimeEnv()) {
|
|
44
|
+
return `${getDataRootDir(homeDir, env)}/data`
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function getDataDirDisplay(env: RuntimeEnv = getRuntimeEnv()) {
|
|
48
|
+
return `${getDataRootDirDisplay(env)}/data`
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getSettingsFilePath(homeDir: string, env: RuntimeEnv = getRuntimeEnv()) {
|
|
52
|
+
return `${getDataDir(homeDir, env)}/settings.json`
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function getSettingsFilePathDisplay(env: RuntimeEnv = getRuntimeEnv()) {
|
|
56
|
+
return `${getDataDirDisplay(env)}/settings.json`
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function getKeybindingsFilePath(homeDir: string, env: RuntimeEnv = getRuntimeEnv()) {
|
|
60
|
+
return `${getDataRootDir(homeDir, env)}/keybindings.json`
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function getKeybindingsFilePathDisplay(env: RuntimeEnv = getRuntimeEnv()) {
|
|
64
|
+
return `${getDataRootDirDisplay(env)}/keybindings.json`
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function getLlmProviderFilePath(homeDir: string, env: RuntimeEnv = getRuntimeEnv()) {
|
|
68
|
+
return `${getDataRootDir(homeDir, env)}/llm-provider.json`
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function getLlmProviderFilePathDisplay(env: RuntimeEnv = getRuntimeEnv()) {
|
|
72
|
+
return `${getDataRootDirDisplay(env)}/llm-provider.json`
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function getCliInvocation(arg?: string) {
|
|
76
|
+
return arg ? `${CLI_COMMAND} ${arg}` : CLI_COMMAND
|
|
77
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test"
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_DEV_CLIENT_PORT,
|
|
4
|
+
getDefaultDevServerPort,
|
|
5
|
+
parseDevArgs,
|
|
6
|
+
resolveDevPorts,
|
|
7
|
+
stripShareArg,
|
|
8
|
+
stripPortArg,
|
|
9
|
+
} from "./dev-ports"
|
|
10
|
+
|
|
11
|
+
describe("getDefaultDevServerPort", () => {
|
|
12
|
+
test("derives the default backend port from the client port", () => {
|
|
13
|
+
expect(getDefaultDevServerPort()).toBe(DEFAULT_DEV_CLIENT_PORT + 1)
|
|
14
|
+
expect(getDefaultDevServerPort(4000)).toBe(4001)
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
describe("resolveDevPorts", () => {
|
|
19
|
+
test("uses default dev ports when no port override is provided", () => {
|
|
20
|
+
expect(resolveDevPorts([])).toEqual({
|
|
21
|
+
clientPort: DEFAULT_DEV_CLIENT_PORT,
|
|
22
|
+
serverPort: DEFAULT_DEV_CLIENT_PORT + 1,
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
test("treats --port as the client port and derives the backend port", () => {
|
|
27
|
+
expect(resolveDevPorts(["--remote", "--port", "4000"])).toEqual({
|
|
28
|
+
clientPort: 4000,
|
|
29
|
+
serverPort: 4001,
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
test("uses the last provided --port value", () => {
|
|
34
|
+
expect(resolveDevPorts(["--port", "4000", "--port", "4100"])).toEqual({
|
|
35
|
+
clientPort: 4100,
|
|
36
|
+
serverPort: 4101,
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
test("throws when --port is missing a value", () => {
|
|
41
|
+
expect(() => resolveDevPorts(["--port"])).toThrow("Missing value for --port")
|
|
42
|
+
expect(() => resolveDevPorts(["--port", "--remote"])).toThrow("Missing value for --port")
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
describe("stripPortArg", () => {
|
|
47
|
+
test("removes --port and its value while preserving other args", () => {
|
|
48
|
+
expect(stripPortArg(["--remote", "--port", "4000", "--host", "dev-box"])).toEqual([
|
|
49
|
+
"--remote",
|
|
50
|
+
"--host",
|
|
51
|
+
"dev-box",
|
|
52
|
+
])
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
describe("stripShareArg", () => {
|
|
57
|
+
test("removes --share and --cloudflared arguments while preserving other args", () => {
|
|
58
|
+
expect(stripShareArg(["--remote", "--share", "--cloudflared", "secret-token", "--host", "dev-box"])).toEqual([
|
|
59
|
+
"--remote",
|
|
60
|
+
"--host",
|
|
61
|
+
"dev-box",
|
|
62
|
+
])
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
describe("parseDevArgs", () => {
|
|
67
|
+
test("derives dev share options from the client port", () => {
|
|
68
|
+
expect(parseDevArgs(["--share", "--port", "3333"], "dev-machine")).toEqual({
|
|
69
|
+
clientPort: 3333,
|
|
70
|
+
serverPort: 3334,
|
|
71
|
+
share: "quick",
|
|
72
|
+
backendTargetHost: "127.0.0.1",
|
|
73
|
+
allowedHosts: true,
|
|
74
|
+
serverArgs: [],
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test("accepts a token-bearing cloudflared dev mode", () => {
|
|
79
|
+
expect(parseDevArgs(["--cloudflared", "secret-token", "--port", "3333"], "dev-machine")).toEqual({
|
|
80
|
+
clientPort: 3333,
|
|
81
|
+
serverPort: 3334,
|
|
82
|
+
share: { kind: "token", token: "secret-token" },
|
|
83
|
+
backendTargetHost: "127.0.0.1",
|
|
84
|
+
allowedHosts: true,
|
|
85
|
+
serverArgs: [],
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
test("rejects combining --share with --host or --remote", () => {
|
|
90
|
+
expect(() => parseDevArgs(["--share", "--host", "dev-box"], "dev-machine")).toThrow("--share cannot be used with --host")
|
|
91
|
+
expect(() => parseDevArgs(["--host", "dev-box", "--share"], "dev-machine")).toThrow("--share cannot be used with --host")
|
|
92
|
+
expect(() => parseDevArgs(["--share", "--remote"], "dev-machine")).toThrow("--share cannot be used with --remote")
|
|
93
|
+
expect(() => parseDevArgs(["--remote", "--share"], "dev-machine")).toThrow("--share cannot be used with --remote")
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
test("rejects combining --cloudflared with --host or --remote", () => {
|
|
97
|
+
expect(() => parseDevArgs(["--cloudflared", "secret-token", "--host", "dev-box"], "dev-machine")).toThrow("--cloudflared cannot be used with --host")
|
|
98
|
+
expect(() => parseDevArgs(["--host", "dev-box", "--cloudflared", "secret-token"], "dev-machine")).toThrow("--cloudflared cannot be used with --host")
|
|
99
|
+
expect(() => parseDevArgs(["--cloudflared", "secret-token", "--remote"], "dev-machine")).toThrow("--cloudflared cannot be used with --remote")
|
|
100
|
+
expect(() => parseDevArgs(["--remote", "--cloudflared", "secret-token"], "dev-machine")).toThrow("--cloudflared cannot be used with --remote")
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
test("preserves existing remote host behavior when share is off", () => {
|
|
104
|
+
expect(parseDevArgs(["--remote", "--port", "3333"], "dev-machine")).toEqual({
|
|
105
|
+
clientPort: 3333,
|
|
106
|
+
serverPort: 3334,
|
|
107
|
+
share: false,
|
|
108
|
+
backendTargetHost: "127.0.0.1",
|
|
109
|
+
allowedHosts: true,
|
|
110
|
+
serverArgs: ["--remote"],
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
})
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { ShareMode } from "./share"
|
|
2
|
+
import { assertNoHostOverride, getShareCliFlag, isShareEnabled } from "./share"
|
|
3
|
+
|
|
4
|
+
export const DEFAULT_DEV_CLIENT_PORT = 5174
|
|
5
|
+
|
|
6
|
+
export function getDefaultDevServerPort(clientPort = DEFAULT_DEV_CLIENT_PORT) {
|
|
7
|
+
return clientPort + 1
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface DevArgResolution {
|
|
11
|
+
clientPort: number
|
|
12
|
+
serverPort: number
|
|
13
|
+
share: ShareMode
|
|
14
|
+
backendTargetHost: string
|
|
15
|
+
allowedHosts: true | string[]
|
|
16
|
+
serverArgs: string[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function resolveDevPorts(args: string[]) {
|
|
20
|
+
let clientPort = DEFAULT_DEV_CLIENT_PORT
|
|
21
|
+
|
|
22
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
23
|
+
const arg = args[index]
|
|
24
|
+
if (arg !== "--port") continue
|
|
25
|
+
|
|
26
|
+
const next = args[index + 1]
|
|
27
|
+
if (!next || next.startsWith("-")) {
|
|
28
|
+
throw new Error("Missing value for --port")
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
clientPort = Number(next)
|
|
32
|
+
index += 1
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
clientPort,
|
|
37
|
+
serverPort: getDefaultDevServerPort(clientPort),
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function stripPortArg(args: string[]) {
|
|
42
|
+
const stripped: string[] = []
|
|
43
|
+
|
|
44
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
45
|
+
const arg = args[index]
|
|
46
|
+
if (arg === "--port") {
|
|
47
|
+
index += 1
|
|
48
|
+
continue
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
stripped.push(arg)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return stripped
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function stripShareArg(args: string[]) {
|
|
58
|
+
const stripped: string[] = []
|
|
59
|
+
|
|
60
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
61
|
+
const arg = args[index]
|
|
62
|
+
if (arg === "--share") {
|
|
63
|
+
continue
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (arg === "--cloudflared") {
|
|
67
|
+
index += 1
|
|
68
|
+
continue
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (arg !== "--share") {
|
|
72
|
+
stripped.push(arg)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return stripped
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function parseDevArgs(args: string[], localHostname: string): DevArgResolution {
|
|
80
|
+
const { clientPort, serverPort } = resolveDevPorts(args)
|
|
81
|
+
const serverArgs = stripShareArg(stripPortArg(args))
|
|
82
|
+
let share: ShareMode = false
|
|
83
|
+
let sawHost = false
|
|
84
|
+
let sawRemote = false
|
|
85
|
+
let backendTargetHost = "127.0.0.1"
|
|
86
|
+
let allowAllHosts = false
|
|
87
|
+
const hosts = new Set<string>(["localhost", "127.0.0.1", "0.0.0.0", localHostname])
|
|
88
|
+
|
|
89
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
90
|
+
const arg = args[index]
|
|
91
|
+
if (arg === "--share") {
|
|
92
|
+
assertNoHostOverride("--share", sawHost, sawRemote)
|
|
93
|
+
share = "quick"
|
|
94
|
+
continue
|
|
95
|
+
}
|
|
96
|
+
if (arg === "--cloudflared") {
|
|
97
|
+
assertNoHostOverride("--cloudflared", sawHost, sawRemote)
|
|
98
|
+
const next = args[index + 1]
|
|
99
|
+
if (!next || next.startsWith("-")) throw new Error("Missing value for --cloudflared")
|
|
100
|
+
share = { kind: "token", token: next }
|
|
101
|
+
index += 1
|
|
102
|
+
continue
|
|
103
|
+
}
|
|
104
|
+
if (arg === "--remote") {
|
|
105
|
+
if (isShareEnabled(share)) {
|
|
106
|
+
throw new Error(`${getShareCliFlag(share)} cannot be used with --remote`)
|
|
107
|
+
}
|
|
108
|
+
sawRemote = true
|
|
109
|
+
backendTargetHost = "127.0.0.1"
|
|
110
|
+
allowAllHosts = true
|
|
111
|
+
continue
|
|
112
|
+
}
|
|
113
|
+
if (arg !== "--host") continue
|
|
114
|
+
|
|
115
|
+
const next = args[index + 1]
|
|
116
|
+
if (!next || next.startsWith("-")) continue
|
|
117
|
+
if (isShareEnabled(share)) {
|
|
118
|
+
throw new Error(`${getShareCliFlag(share)} cannot be used with --host`)
|
|
119
|
+
}
|
|
120
|
+
sawHost = true
|
|
121
|
+
hosts.add(next)
|
|
122
|
+
backendTargetHost = next === "0.0.0.0" ? "127.0.0.1" : next
|
|
123
|
+
index += 1
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
clientPort,
|
|
128
|
+
serverPort,
|
|
129
|
+
share,
|
|
130
|
+
backendTargetHost,
|
|
131
|
+
allowedHosts: isShareEnabled(share) || allowAllHosts ? true : [...hosts],
|
|
132
|
+
serverArgs,
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AppSettingsSnapshot,
|
|
3
|
+
AppSettingsPatch,
|
|
4
|
+
AgentProvider,
|
|
5
|
+
ChatAttachment,
|
|
6
|
+
ChatDiffSnapshot,
|
|
7
|
+
ChatHistoryPage,
|
|
8
|
+
ChatSnapshot,
|
|
9
|
+
CloudflareTunnelSettings,
|
|
10
|
+
DiffCommitMode,
|
|
11
|
+
KeybindingsSnapshot,
|
|
12
|
+
LlmProviderSnapshot,
|
|
13
|
+
LocalProjectsSnapshot,
|
|
14
|
+
ModelOptions,
|
|
15
|
+
SidebarData,
|
|
16
|
+
StandaloneTranscriptAttachmentMode,
|
|
17
|
+
StandaloneTranscriptExportResult,
|
|
18
|
+
UpdateSnapshot,
|
|
19
|
+
EditorPreset,
|
|
20
|
+
} from "./types"
|
|
21
|
+
|
|
22
|
+
export type { EditorPreset }
|
|
23
|
+
|
|
24
|
+
export interface EditorOpenSettings {
|
|
25
|
+
preset: EditorPreset
|
|
26
|
+
commandTemplate: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type SubscriptionTopic =
|
|
30
|
+
| { type: "sidebar" }
|
|
31
|
+
| { type: "local-projects" }
|
|
32
|
+
| { type: "update" }
|
|
33
|
+
| { type: "keybindings" }
|
|
34
|
+
| { type: "app-settings" }
|
|
35
|
+
| { type: "chat"; chatId: string; recentLimit?: number }
|
|
36
|
+
| { type: "project-git"; projectId: string }
|
|
37
|
+
| { type: "terminal"; terminalId: string }
|
|
38
|
+
|
|
39
|
+
export interface TerminalSnapshot {
|
|
40
|
+
terminalId: string
|
|
41
|
+
title: string
|
|
42
|
+
cwd: string
|
|
43
|
+
shell: string
|
|
44
|
+
cols: number
|
|
45
|
+
rows: number
|
|
46
|
+
scrollback: number
|
|
47
|
+
serializedState: string
|
|
48
|
+
status: "running" | "exited"
|
|
49
|
+
exitCode: number | null
|
|
50
|
+
signal?: number
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type TerminalEvent =
|
|
54
|
+
| { type: "terminal.output"; terminalId: string; data: string }
|
|
55
|
+
| { type: "terminal.exit"; terminalId: string; exitCode: number; signal?: number }
|
|
56
|
+
|
|
57
|
+
export type ClientCommand =
|
|
58
|
+
| { type: "project.open"; localPath: string }
|
|
59
|
+
| { type: "project.create"; localPath: string; title: string }
|
|
60
|
+
| { type: "sessions.importClaude" }
|
|
61
|
+
| { type: "project.remove"; projectId: string }
|
|
62
|
+
| { type: "sidebar.reorderProjectGroups"; projectIds: string[] }
|
|
63
|
+
| { type: "project.readDiffPatch"; projectId: string; path: string }
|
|
64
|
+
| { type: "system.ping" }
|
|
65
|
+
| { type: "update.check"; force?: boolean }
|
|
66
|
+
| { type: "update.install" }
|
|
67
|
+
| { type: "update.reload" }
|
|
68
|
+
| { type: "settings.readKeybindings" }
|
|
69
|
+
| { type: "settings.writeKeybindings"; bindings: KeybindingsSnapshot["bindings"] }
|
|
70
|
+
| { type: "settings.readAppSettings" }
|
|
71
|
+
| { type: "settings.writeAppSettings"; analyticsEnabled: boolean }
|
|
72
|
+
| { type: "appSettings.setCloudflareTunnel"; patch: Partial<CloudflareTunnelSettings> }
|
|
73
|
+
| { type: "settings.writeAppSettingsPatch"; patch: AppSettingsPatch }
|
|
74
|
+
| { type: "settings.readLlmProvider" }
|
|
75
|
+
| {
|
|
76
|
+
type: "settings.writeLlmProvider"
|
|
77
|
+
provider: LlmProviderSnapshot["provider"]
|
|
78
|
+
apiKey: string
|
|
79
|
+
model: string
|
|
80
|
+
baseUrl: string
|
|
81
|
+
}
|
|
82
|
+
| {
|
|
83
|
+
type: "settings.validateLlmProvider"
|
|
84
|
+
provider: LlmProviderSnapshot["provider"]
|
|
85
|
+
apiKey: string
|
|
86
|
+
model: string
|
|
87
|
+
baseUrl: string
|
|
88
|
+
}
|
|
89
|
+
| {
|
|
90
|
+
type: "system.openExternal"
|
|
91
|
+
localPath: string
|
|
92
|
+
action: "open_finder" | "open_terminal" | "open_editor" | "open_preview" | "open_default"
|
|
93
|
+
line?: number
|
|
94
|
+
column?: number
|
|
95
|
+
editor?: EditorOpenSettings
|
|
96
|
+
}
|
|
97
|
+
| { type: "chat.create"; projectId: string }
|
|
98
|
+
| { type: "chat.fork"; chatId: string }
|
|
99
|
+
| { type: "chat.rename"; chatId: string; title: string }
|
|
100
|
+
| { type: "chat.archive"; chatId: string }
|
|
101
|
+
| { type: "chat.unarchive"; chatId: string }
|
|
102
|
+
| { type: "chat.delete"; chatId: string }
|
|
103
|
+
| { type: "chat.setDraftProtection"; chatIds: string[] }
|
|
104
|
+
| { type: "chat.markRead"; chatId: string }
|
|
105
|
+
| {
|
|
106
|
+
type: "chat.send"
|
|
107
|
+
chatId?: string
|
|
108
|
+
projectId?: string
|
|
109
|
+
clientTraceId?: string
|
|
110
|
+
provider?: AgentProvider
|
|
111
|
+
content: string
|
|
112
|
+
attachments?: ChatAttachment[]
|
|
113
|
+
model?: string
|
|
114
|
+
modelOptions?: ModelOptions
|
|
115
|
+
effort?: string
|
|
116
|
+
planMode?: boolean
|
|
117
|
+
autoResumeOnRateLimit?: boolean
|
|
118
|
+
}
|
|
119
|
+
| { type: "chat.refreshDiffs"; chatId: string }
|
|
120
|
+
| { type: "chat.initGit"; chatId: string }
|
|
121
|
+
| { type: "chat.getGitHubPublishInfo"; chatId: string }
|
|
122
|
+
| { type: "chat.checkGitHubRepoAvailability"; chatId: string; owner: string; name: string }
|
|
123
|
+
| {
|
|
124
|
+
type: "chat.publishToGitHub"
|
|
125
|
+
chatId: string
|
|
126
|
+
owner: string
|
|
127
|
+
name: string
|
|
128
|
+
visibility: "public" | "private"
|
|
129
|
+
description?: string
|
|
130
|
+
}
|
|
131
|
+
| { type: "chat.listBranches"; chatId: string }
|
|
132
|
+
| {
|
|
133
|
+
type: "chat.previewMergeBranch"
|
|
134
|
+
chatId: string
|
|
135
|
+
branch:
|
|
136
|
+
| { kind: "local"; name: string }
|
|
137
|
+
| { kind: "remote"; name: string; remoteRef: string }
|
|
138
|
+
| {
|
|
139
|
+
kind: "pull_request"
|
|
140
|
+
name: string
|
|
141
|
+
prNumber: number
|
|
142
|
+
headRefName: string
|
|
143
|
+
headRepoCloneUrl?: string
|
|
144
|
+
isCrossRepository?: boolean
|
|
145
|
+
remoteRef?: string
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
| {
|
|
149
|
+
type: "chat.mergeBranch"
|
|
150
|
+
chatId: string
|
|
151
|
+
branch:
|
|
152
|
+
| { kind: "local"; name: string }
|
|
153
|
+
| { kind: "remote"; name: string; remoteRef: string }
|
|
154
|
+
| {
|
|
155
|
+
kind: "pull_request"
|
|
156
|
+
name: string
|
|
157
|
+
prNumber: number
|
|
158
|
+
headRefName: string
|
|
159
|
+
headRepoCloneUrl?: string
|
|
160
|
+
isCrossRepository?: boolean
|
|
161
|
+
remoteRef?: string
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
| { type: "chat.syncBranch"; chatId: string; action: "fetch" | "pull" | "push" | "publish" }
|
|
165
|
+
| {
|
|
166
|
+
type: "chat.checkoutBranch"
|
|
167
|
+
chatId: string
|
|
168
|
+
branch:
|
|
169
|
+
| { kind: "local"; name: string }
|
|
170
|
+
| { kind: "remote"; name: string; remoteRef: string }
|
|
171
|
+
| {
|
|
172
|
+
kind: "pull_request"
|
|
173
|
+
name: string
|
|
174
|
+
prNumber: number
|
|
175
|
+
headRefName: string
|
|
176
|
+
headRepoCloneUrl?: string
|
|
177
|
+
isCrossRepository?: boolean
|
|
178
|
+
remoteRef?: string
|
|
179
|
+
}
|
|
180
|
+
bringChanges?: boolean
|
|
181
|
+
}
|
|
182
|
+
| { type: "chat.createBranch"; chatId: string; name: string; baseBranchName?: string }
|
|
183
|
+
| { type: "chat.generateCommitMessage"; chatId: string; paths: string[] }
|
|
184
|
+
| { type: "chat.commitDiffs"; chatId: string; paths: string[]; summary: string; description?: string; mode: DiffCommitMode }
|
|
185
|
+
| { type: "chat.discardDiffFile"; chatId: string; path: string }
|
|
186
|
+
| { type: "chat.ignoreDiffFile"; chatId: string; path: string }
|
|
187
|
+
| { type: "chat.cancel"; chatId: string }
|
|
188
|
+
| { type: "chat.stopDraining"; chatId: string }
|
|
189
|
+
| {
|
|
190
|
+
type: "chat.exportStandalone"
|
|
191
|
+
chatId: string
|
|
192
|
+
theme: "light" | "dark"
|
|
193
|
+
attachmentMode: StandaloneTranscriptAttachmentMode
|
|
194
|
+
}
|
|
195
|
+
| { type: "chat.loadHistory"; chatId: string; beforeCursor: string; limit: number }
|
|
196
|
+
| { type: "chat.respondTool"; chatId: string; toolUseId: string; result: unknown }
|
|
197
|
+
| {
|
|
198
|
+
type: "message.enqueue"
|
|
199
|
+
chatId: string
|
|
200
|
+
content: string
|
|
201
|
+
attachments?: ChatAttachment[]
|
|
202
|
+
provider?: AgentProvider
|
|
203
|
+
model?: string
|
|
204
|
+
modelOptions?: ModelOptions
|
|
205
|
+
planMode?: boolean
|
|
206
|
+
autoResumeOnRateLimit?: boolean
|
|
207
|
+
}
|
|
208
|
+
| {
|
|
209
|
+
type: "message.steer"
|
|
210
|
+
chatId: string
|
|
211
|
+
queuedMessageId: string
|
|
212
|
+
}
|
|
213
|
+
| {
|
|
214
|
+
type: "message.dequeue"
|
|
215
|
+
chatId: string
|
|
216
|
+
queuedMessageId: string
|
|
217
|
+
}
|
|
218
|
+
| { type: "autoContinue.accept"; chatId: string; scheduleId: string; scheduledAt: number }
|
|
219
|
+
| { type: "autoContinue.reschedule"; chatId: string; scheduleId: string; scheduledAt: number }
|
|
220
|
+
| { type: "autoContinue.cancel"; chatId: string; scheduleId: string }
|
|
221
|
+
| { type: "tunnel.accept"; chatId: string; tunnelId: string }
|
|
222
|
+
| { type: "tunnel.stop"; chatId: string; tunnelId: string }
|
|
223
|
+
| { type: "tunnel.retry"; chatId: string; tunnelId: string }
|
|
224
|
+
| { type: "terminal.create"; projectId: string; terminalId: string; cols: number; rows: number; scrollback: number }
|
|
225
|
+
| { type: "terminal.input"; terminalId: string; data: string }
|
|
226
|
+
| { type: "terminal.resize"; terminalId: string; cols: number; rows: number }
|
|
227
|
+
| { type: "terminal.close"; terminalId: string }
|
|
228
|
+
|
|
229
|
+
export type OpenExternalAction = Extract<ClientCommand, { type: "system.openExternal" }>["action"]
|
|
230
|
+
|
|
231
|
+
export type ClientEnvelope =
|
|
232
|
+
| { v: 1; type: "subscribe"; id: string; topic: SubscriptionTopic }
|
|
233
|
+
| { v: 1; type: "unsubscribe"; id: string }
|
|
234
|
+
| { v: 1; type: "command"; id: string; command: ClientCommand }
|
|
235
|
+
|
|
236
|
+
export type ServerSnapshot =
|
|
237
|
+
| { type: "sidebar"; data: SidebarData }
|
|
238
|
+
| { type: "local-projects"; data: LocalProjectsSnapshot }
|
|
239
|
+
| { type: "update"; data: UpdateSnapshot }
|
|
240
|
+
| { type: "keybindings"; data: KeybindingsSnapshot }
|
|
241
|
+
| { type: "app-settings"; data: AppSettingsSnapshot }
|
|
242
|
+
| { type: "llm-provider"; data: LlmProviderSnapshot }
|
|
243
|
+
| { type: "chat"; data: ChatSnapshot | null }
|
|
244
|
+
| { type: "project-git"; data: ChatDiffSnapshot | null }
|
|
245
|
+
| { type: "terminal"; data: TerminalSnapshot | null }
|
|
246
|
+
|
|
247
|
+
export type ServerEnvelope =
|
|
248
|
+
| { v: 1; type: "snapshot"; id: string; snapshot: ServerSnapshot }
|
|
249
|
+
| { v: 1; type: "event"; id: string; event: TerminalEvent }
|
|
250
|
+
| { v: 1; type: "ack"; id: string; result?: unknown | ChatHistoryPage | StandaloneTranscriptExportResult }
|
|
251
|
+
| { v: 1; type: "error"; id?: string; message: string }
|
|
252
|
+
|
|
253
|
+
export function isClientEnvelope(value: unknown): value is ClientEnvelope {
|
|
254
|
+
if (!value || typeof value !== "object") return false
|
|
255
|
+
const candidate = value as Partial<ClientEnvelope>
|
|
256
|
+
return candidate.v === 1 && typeof candidate.type === "string"
|
|
257
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type ShareMode = false | "quick" | {
|
|
2
|
+
kind: "token"
|
|
3
|
+
token: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type ShareCliFlag = "--share" | "--cloudflared"
|
|
7
|
+
|
|
8
|
+
export function isShareEnabled(share: ShareMode): share is Exclude<ShareMode, false> {
|
|
9
|
+
return share !== false
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function isTokenShareMode(share: ShareMode): share is { kind: "token"; token: string } {
|
|
13
|
+
return typeof share === "object" && share !== null && share.kind === "token"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function getShareCliFlag(share: Exclude<ShareMode, false>): ShareCliFlag {
|
|
17
|
+
return isTokenShareMode(share) ? "--cloudflared" : "--share"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function assertNoHostOverride(shareFlag: ShareCliFlag, sawHost: boolean, sawRemote: boolean) {
|
|
21
|
+
if (sawHost) {
|
|
22
|
+
throw new Error(`${shareFlag} cannot be used with --host`)
|
|
23
|
+
}
|
|
24
|
+
if (sawRemote) {
|
|
25
|
+
throw new Error(`${shareFlag} cannot be used with --remote`)
|
|
26
|
+
}
|
|
27
|
+
}
|