@alivault/pico 0.1.0
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/.output/nitro.json +17 -0
- package/.output/public/apple-touch-icon.png +0 -0
- package/.output/public/assets/abap-smLpETzL.js +1 -0
- package/.output/public/assets/actionscript-3-o-aRvjY5.js +1 -0
- package/.output/public/assets/ada-D5RRX1i4.js +1 -0
- package/.output/public/assets/andromeeda-N4z3YzmR.js +1 -0
- package/.output/public/assets/angular-html-BZNntD0J.js +1 -0
- package/.output/public/assets/angular-ts-SQQMYL2C.js +1 -0
- package/.output/public/assets/apache-DttKlSqg.js +1 -0
- package/.output/public/assets/apex-DL7j-a2n.js +1 -0
- package/.output/public/assets/apl-D5V6uPDr.js +1 -0
- package/.output/public/assets/applescript-DCbL_2FX.js +1 -0
- package/.output/public/assets/ara-DqheWJCe.js +1 -0
- package/.output/public/assets/asciidoc-BH2sf2K4.js +1 -0
- package/.output/public/assets/asm-rfjOMz3U.js +1 -0
- package/.output/public/assets/astro-DeXKSaFP.js +1 -0
- package/.output/public/assets/aurora-x-CND-FqEb.js +1 -0
- package/.output/public/assets/awk-CMV5n9Z7.js +1 -0
- package/.output/public/assets/ayu-dark-on7xzq_B.js +1 -0
- package/.output/public/assets/ayu-light-DnGeGGc2.js +1 -0
- package/.output/public/assets/ayu-mirage-DG3LlYC_.js +1 -0
- package/.output/public/assets/ballerina-BjMqJjlr.js +1 -0
- package/.output/public/assets/bat-BaVbo_qw.js +1 -0
- package/.output/public/assets/beancount-DBt5Mbc_.js +1 -0
- package/.output/public/assets/berry-Cyjuxiss.js +1 -0
- package/.output/public/assets/bibtex-BV_0nsPq.js +1 -0
- package/.output/public/assets/bicep-C2gEwu4J.js +1 -0
- package/.output/public/assets/bird2-BRyaEJd0.js +1 -0
- package/.output/public/assets/blade-Bu5re0Vg.js +1 -0
- package/.output/public/assets/bsl-B1qbqNES.js +1 -0
- package/.output/public/assets/c-Nc9zJT78.js +1 -0
- package/.output/public/assets/c3-DTTbp5N2.js +1 -0
- package/.output/public/assets/cadence-CPz83cmI.js +1 -0
- package/.output/public/assets/cairo-BDj8wWhy.js +1 -0
- package/.output/public/assets/catppuccin-frappe-Dr22sraq.js +1 -0
- package/.output/public/assets/catppuccin-latte-C57EeX8c.js +1 -0
- package/.output/public/assets/catppuccin-macchiato-CpheI4uD.js +1 -0
- package/.output/public/assets/catppuccin-mocha-D8Lmdks_.js +1 -0
- package/.output/public/assets/clarity-CFJ2Yc3q.js +1 -0
- package/.output/public/assets/clojure-6R01QgJC.js +1 -0
- package/.output/public/assets/cmake-D5rSbMir.js +1 -0
- package/.output/public/assets/cobol-nvZDS9LT.js +1 -0
- package/.output/public/assets/codeowners-_3A-ClkN.js +1 -0
- package/.output/public/assets/codeql-DlIhJTR7.js +1 -0
- package/.output/public/assets/coffee-BKLOTq4e.js +1 -0
- package/.output/public/assets/common-lisp-BvQzz173.js +1 -0
- package/.output/public/assets/coq-DTNXReIC.js +1 -0
- package/.output/public/assets/cpp-D6g1DVNt.js +1 -0
- package/.output/public/assets/crystal-DfoZI57w.js +1 -0
- package/.output/public/assets/csharp-BDKQY1K9.js +1 -0
- package/.output/public/assets/css-DRmnABqB.js +1 -0
- package/.output/public/assets/csv-DNUpVBxl.js +1 -0
- package/.output/public/assets/cue-DDdBc2s3.js +1 -0
- package/.output/public/assets/cypher-CguaznO2.js +1 -0
- package/.output/public/assets/d-CHcoyjv3.js +1 -0
- package/.output/public/assets/dark-plus-CqeW_0kH.js +1 -0
- package/.output/public/assets/dart-RM3aRphk.js +1 -0
- package/.output/public/assets/dax-nbnY1d79.js +1 -0
- package/.output/public/assets/desktop-BD76cvxT.js +1 -0
- package/.output/public/assets/diff-CdkWtnkL.js +1 -0
- package/.output/public/assets/docker-ZyPHc6zB.js +1 -0
- package/.output/public/assets/dotenv-BdJZEwA6.js +1 -0
- package/.output/public/assets/dracula-CtqCPLGa.js +1 -0
- package/.output/public/assets/dracula-soft-DmBpwRAy.js +1 -0
- package/.output/public/assets/dream-maker-BJL4qlg3.js +1 -0
- package/.output/public/assets/edge-DwocGnOF.js +1 -0
- package/.output/public/assets/elixir-Dtbfds1r.js +1 -0
- package/.output/public/assets/elm-CpPtm471.js +1 -0
- package/.output/public/assets/emacs-lisp-_LyYa2Ky.js +1 -0
- package/.output/public/assets/erb--z3IM9Cb.js +1 -0
- package/.output/public/assets/erlang-Bc4hQuqa.js +1 -0
- package/.output/public/assets/everforest-dark-CrbyKk4n.js +1 -0
- package/.output/public/assets/everforest-light-DRbSh8Tm.js +1 -0
- package/.output/public/assets/fennel-CC2BkRsS.js +1 -0
- package/.output/public/assets/fish-D2ZCzqcE.js +1 -0
- package/.output/public/assets/fluent-DKAm3m7q.js +1 -0
- package/.output/public/assets/fortran-fixed-form-B02FOYI-.js +1 -0
- package/.output/public/assets/fortran-free-form-BPTf0lbT.js +1 -0
- package/.output/public/assets/fsharp-DhdR18vN.js +1 -0
- package/.output/public/assets/gdresource-DgnrMPIx.js +1 -0
- package/.output/public/assets/gdscript-CsadCSaZ.js +1 -0
- package/.output/public/assets/gdshader-PfnN_8tR.js +1 -0
- package/.output/public/assets/genie-Bj-orPAV.js +1 -0
- package/.output/public/assets/gherkin-COVWpJ-Q.js +1 -0
- package/.output/public/assets/git-commit-DGJi7qBD.js +1 -0
- package/.output/public/assets/git-rebase-Ce47xoa6.js +1 -0
- package/.output/public/assets/github-dark-default-DX3IG_X0.js +1 -0
- package/.output/public/assets/github-dark-dimmed-CH6p_7ez.js +1 -0
- package/.output/public/assets/github-dark-high-contrast-Bg2sSao5.js +1 -0
- package/.output/public/assets/github-dark-ipGuFGYC.js +1 -0
- package/.output/public/assets/github-light-BxjqOQl0.js +1 -0
- package/.output/public/assets/github-light-default-DwpDd1IQ.js +1 -0
- package/.output/public/assets/github-light-high-contrast-C0QeixPf.js +1 -0
- package/.output/public/assets/gleam-BF2NigGj.js +1 -0
- package/.output/public/assets/glimmer-js-C0BuzxQC.js +1 -0
- package/.output/public/assets/glimmer-ts-irOZ-cAQ.js +1 -0
- package/.output/public/assets/glsl-JAhLUe0P.js +1 -0
- package/.output/public/assets/gn-CMIt9roj.js +1 -0
- package/.output/public/assets/gnuplot-DgWlRTEj.js +1 -0
- package/.output/public/assets/go-DLnOLj8q.js +1 -0
- package/.output/public/assets/graphql-D2ba3BkR.js +1 -0
- package/.output/public/assets/groovy-B9qLWIkE.js +1 -0
- package/.output/public/assets/gruvbox-dark-hard-BIMX9ePb.js +1 -0
- package/.output/public/assets/gruvbox-dark-medium-DxuwyVzM.js +1 -0
- package/.output/public/assets/gruvbox-dark-soft-ba2fjht0.js +1 -0
- package/.output/public/assets/gruvbox-light-hard-DAJK2PqC.js +1 -0
- package/.output/public/assets/gruvbox-light-medium-WRifDAJD.js +1 -0
- package/.output/public/assets/gruvbox-light-soft-B0dBOoVB.js +1 -0
- package/.output/public/assets/hack-CgzUpY8l.js +1 -0
- package/.output/public/assets/haml-C-oIZcDo.js +1 -0
- package/.output/public/assets/handlebars-CbP-Mhzf.js +1 -0
- package/.output/public/assets/haskell-BaGpmm_c.js +1 -0
- package/.output/public/assets/haxe-DfXTCEOz.js +1 -0
- package/.output/public/assets/hcl-CbCtpSbi.js +1 -0
- package/.output/public/assets/hjson-_4-w-pHU.js +1 -0
- package/.output/public/assets/hlsl-DpuYn7pp.js +1 -0
- package/.output/public/assets/horizon-C5RtD1fY.js +1 -0
- package/.output/public/assets/horizon-bright-pEOice34.js +1 -0
- package/.output/public/assets/houston-A0zg9vNP.js +1 -0
- package/.output/public/assets/html-ddqpqPg0.js +1 -0
- package/.output/public/assets/html-derivative-DWGxf_At.js +1 -0
- package/.output/public/assets/http-Bg1nG1nG.js +1 -0
- package/.output/public/assets/hurl-zm47Pi1n.js +1 -0
- package/.output/public/assets/hxml-adC65L_J.js +1 -0
- package/.output/public/assets/hy-t9zDXBje.js +1 -0
- package/.output/public/assets/imba-Bxu-TDfw.js +1 -0
- package/.output/public/assets/index-CthXqlK7.js +53 -0
- package/.output/public/assets/ini-D-v34c8N.js +1 -0
- package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/.output/public/assets/java-DVLnIrqC.js +1 -0
- package/.output/public/assets/javascript-Cop1kpy_.js +1 -0
- package/.output/public/assets/jinja-Bnj4awH5.js +1 -0
- package/.output/public/assets/jison-CuCNs9Q3.js +1 -0
- package/.output/public/assets/json-CTw4n7kn.js +1 -0
- package/.output/public/assets/json5-D0XL1D5m.js +1 -0
- package/.output/public/assets/jsonc-BBgf3TX3.js +1 -0
- package/.output/public/assets/jsonl-KrKLbtB7.js +1 -0
- package/.output/public/assets/jsonnet-B2ZwWMOt.js +1 -0
- package/.output/public/assets/jssm-ByRpI9-B.js +1 -0
- package/.output/public/assets/jsx-0oMUGqZj.js +1 -0
- package/.output/public/assets/julia-DNYHzXlE.js +1 -0
- package/.output/public/assets/just-BlWkkmf2.js +1 -0
- package/.output/public/assets/kanagawa-dragon-CtPmcCMp.js +1 -0
- package/.output/public/assets/kanagawa-lotus-DpOXEGCa.js +1 -0
- package/.output/public/assets/kanagawa-wave-CLVCyc-n.js +1 -0
- package/.output/public/assets/kdl-6FPPEH4H.js +1 -0
- package/.output/public/assets/kotlin-D4L3Nd2D.js +1 -0
- package/.output/public/assets/kusto-D-mmc07O.js +1 -0
- package/.output/public/assets/laserwave-7fEj4XGb.js +1 -0
- package/.output/public/assets/latex-DqPzjMIt.js +1 -0
- package/.output/public/assets/lean-BMVMuP2E.js +1 -0
- package/.output/public/assets/less-C95PyOu0.js +1 -0
- package/.output/public/assets/light-plus-DHI2dh3p.js +1 -0
- package/.output/public/assets/liquid-BURJK16h.js +1 -0
- package/.output/public/assets/llvm-Dy3qORTl.js +1 -0
- package/.output/public/assets/log-BQop7fzg.js +1 -0
- package/.output/public/assets/logo-DKtnYmrp.js +1 -0
- package/.output/public/assets/lua-31hdJClp.js +1 -0
- package/.output/public/assets/luau-Dha4KG0q.js +1 -0
- package/.output/public/assets/make-DfmS6buu.js +1 -0
- package/.output/public/assets/markdown-BaI9LyM4.js +1 -0
- package/.output/public/assets/marko-C2ZcdSLh.js +1 -0
- package/.output/public/assets/material-theme-Dm6ETY8i.js +1 -0
- package/.output/public/assets/material-theme-darker-BeyjmM5Z.js +1 -0
- package/.output/public/assets/material-theme-lighter-CCOYYzKL.js +1 -0
- package/.output/public/assets/material-theme-ocean-CUtPiiX3.js +1 -0
- package/.output/public/assets/material-theme-palenight-2L4zMwIM.js +1 -0
- package/.output/public/assets/matlab-BT79Cq_j.js +1 -0
- package/.output/public/assets/mdc-N1ii9pk5.js +1 -0
- package/.output/public/assets/mdx-CxGBwLNt.js +1 -0
- package/.output/public/assets/mermaid-DLf3axBN.js +1 -0
- package/.output/public/assets/min-dark-B8TUPGHg.js +1 -0
- package/.output/public/assets/min-light-BDOoBxcA.js +1 -0
- package/.output/public/assets/mipsasm-DXuU_0cI.js +1 -0
- package/.output/public/assets/mojo-1Omp2pIo.js +1 -0
- package/.output/public/assets/monokai-E_VBmXGZ.js +1 -0
- package/.output/public/assets/moonbit-DZzq699o.js +1 -0
- package/.output/public/assets/move-DxDAOJVd.js +1 -0
- package/.output/public/assets/narrat-CxDcPPb9.js +1 -0
- package/.output/public/assets/nextflow-JEyYUlIq.js +1 -0
- package/.output/public/assets/nextflow-groovy-wvmJO4hi.js +1 -0
- package/.output/public/assets/nginx-BuomO0W8.js +1 -0
- package/.output/public/assets/night-owl-DefhalNX.js +1 -0
- package/.output/public/assets/night-owl-light-byb3AbEn.js +1 -0
- package/.output/public/assets/nim-hKoEPsYL.js +1 -0
- package/.output/public/assets/nix-DsFTDHWT.js +1 -0
- package/.output/public/assets/nord-D5rQzHT-.js +1 -0
- package/.output/public/assets/nushell-BQ_rO0AM.js +1 -0
- package/.output/public/assets/objective-c-BMq6JT_m.js +1 -0
- package/.output/public/assets/objective-cpp-DRwojuGv.js +1 -0
- package/.output/public/assets/ocaml-e4_gKO6E.js +1 -0
- package/.output/public/assets/odin-mdTPwYOg.js +1 -0
- package/.output/public/assets/one-dark-pro-DxXww9jg.js +1 -0
- package/.output/public/assets/one-light-D9c03w7t.js +1 -0
- package/.output/public/assets/openscad-D2aTdNfr.js +1 -0
- package/.output/public/assets/pascal-D4n_G8vj.js +1 -0
- package/.output/public/assets/perl-CAGVW6Ra.js +1 -0
- package/.output/public/assets/php-BycclmzS.js +1 -0
- package/.output/public/assets/pierre-dark-CizZ1Z5z.js +1 -0
- package/.output/public/assets/pierre-light-CHMWfAMe.js +1 -0
- package/.output/public/assets/pkl-DcjhAp0L.js +1 -0
- package/.output/public/assets/plastic-uOsw7z1x.js +1 -0
- package/.output/public/assets/plsql-BSy3Ag0J.js +1 -0
- package/.output/public/assets/po-Be96RYkA.js +1 -0
- package/.output/public/assets/poimandres-CyO4HORD.js +1 -0
- package/.output/public/assets/polar-BmhMKWum.js +1 -0
- package/.output/public/assets/postcss-BTQso3H9.js +1 -0
- package/.output/public/assets/powerquery-DVyQv3M2.js +1 -0
- package/.output/public/assets/powershell-BmtCGJVD.js +1 -0
- package/.output/public/assets/prisma-CCFA9rEj.js +1 -0
- package/.output/public/assets/prolog-DWGEEo78.js +1 -0
- package/.output/public/assets/proto-C3eop1kM.js +1 -0
- package/.output/public/assets/pug-4maJHz9G.js +1 -0
- package/.output/public/assets/puppet-C0_7Nv5A.js +1 -0
- package/.output/public/assets/purescript-Bv-B8yRw.js +1 -0
- package/.output/public/assets/python-CKg5r0C3.js +1 -0
- package/.output/public/assets/qml-JLIQfzyb.js +1 -0
- package/.output/public/assets/qmldir-Cqfb4Lox.js +1 -0
- package/.output/public/assets/qss-Csho9BH8.js +1 -0
- package/.output/public/assets/r-UcxRcvcA.js +1 -0
- package/.output/public/assets/racket-D8-uWeQH.js +1 -0
- package/.output/public/assets/raku-Cj4JSa8p.js +1 -0
- package/.output/public/assets/razor-P8rbooCh.js +1 -0
- package/.output/public/assets/red-z4H4llUY.js +1 -0
- package/.output/public/assets/reg-DXGFiJSl.js +1 -0
- package/.output/public/assets/regexp-3-A0406L.js +1 -0
- package/.output/public/assets/rel-CunnVTBK.js +1 -0
- package/.output/public/assets/riscv-C8BcOCkS.js +1 -0
- package/.output/public/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
- package/.output/public/assets/ron-DiDyR9oa.js +1 -0
- package/.output/public/assets/rose-pine-BADquuIH.js +1 -0
- package/.output/public/assets/rose-pine-dawn-BLcEeBoh.js +1 -0
- package/.output/public/assets/rose-pine-moon-BK_tLY1Y.js +1 -0
- package/.output/public/assets/rosmsg-CHmL1Uyj.js +1 -0
- package/.output/public/assets/routes-Bp0r03R8.js +2147 -0
- package/.output/public/assets/rst-C6GHyL-N.js +1 -0
- package/.output/public/assets/ruby-Cl8PVkbY.js +1 -0
- package/.output/public/assets/rust-DjJFInu3.js +1 -0
- package/.output/public/assets/sas-CXoVwlZN.js +1 -0
- package/.output/public/assets/sass-D3xZ5o-v.js +1 -0
- package/.output/public/assets/scala-B0IRml5w.js +1 -0
- package/.output/public/assets/scheme-BhwcV3Av.js +1 -0
- package/.output/public/assets/scss-DNczJ95n.js +1 -0
- package/.output/public/assets/sdbl-BmWYR-pI.js +1 -0
- package/.output/public/assets/shaderlab-DZ3Lsiak.js +1 -0
- package/.output/public/assets/shellscript-DaVPunOM.js +1 -0
- package/.output/public/assets/shellsession-COm1V40U.js +1 -0
- package/.output/public/assets/slack-dark-DOnVms5P.js +1 -0
- package/.output/public/assets/slack-ochin-DcRTft4q.js +1 -0
- package/.output/public/assets/smalltalk-DVQuUMII.js +1 -0
- package/.output/public/assets/snazzy-light-x9CLJ1W9.js +1 -0
- package/.output/public/assets/solarized-dark-BB1sh-pe.js +1 -0
- package/.output/public/assets/solarized-light-9-RPS998.js +1 -0
- package/.output/public/assets/solidity-gQ4WXILB.js +1 -0
- package/.output/public/assets/soy-DwewhJ_3.js +1 -0
- package/.output/public/assets/sparql-B9c85a_o.js +1 -0
- package/.output/public/assets/splunk-OB48_RcD.js +1 -0
- package/.output/public/assets/sql-CrTmZCMa.js +1 -0
- package/.output/public/assets/ssh-config-DA9YMRGV.js +1 -0
- package/.output/public/assets/stata-Bl--TAbZ.js +1 -0
- package/.output/public/assets/styles-DEX5mU_p.css +2 -0
- package/.output/public/assets/stylus-sKwvsUaC.js +1 -0
- package/.output/public/assets/surrealql-BW79EE-U.js +1 -0
- package/.output/public/assets/svelte-ziMErdPi.js +1 -0
- package/.output/public/assets/swift-C72NbAtg.js +1 -0
- package/.output/public/assets/synthwave-84-eJ9uRN_S.js +1 -0
- package/.output/public/assets/system-verilog-CnWMF7Nq.js +1 -0
- package/.output/public/assets/systemd-DMzItW5N.js +1 -0
- package/.output/public/assets/talonscript-DopQCWDL.js +1 -0
- package/.output/public/assets/tasl-C28SYKbq.js +1 -0
- package/.output/public/assets/tcl-DHq7zmoF.js +1 -0
- package/.output/public/assets/templ-C_9I6ncv.js +1 -0
- package/.output/public/assets/terraform-CogS1YKX.js +1 -0
- package/.output/public/assets/tex-D8LVuLf5.js +1 -0
- package/.output/public/assets/tokyo-night-B9N7LyrF.js +1 -0
- package/.output/public/assets/toml-BH_iPsgK.js +1 -0
- package/.output/public/assets/ts-tags-DKuFCGsc.js +1 -0
- package/.output/public/assets/tsv-BIkdBZX1.js +1 -0
- package/.output/public/assets/tsx-BjkCKOtw.js +1 -0
- package/.output/public/assets/turtle-CqNXyJWZ.js +1 -0
- package/.output/public/assets/twig-Bs1kcsO6.js +1 -0
- package/.output/public/assets/typescript-BoHeP9q1.js +1 -0
- package/.output/public/assets/typespec-CQ9LYD_e.js +1 -0
- package/.output/public/assets/typst-T-Fsk-Sv.js +1 -0
- package/.output/public/assets/v-BhMEOw9x.js +1 -0
- package/.output/public/assets/vala-DzajMnwt.js +1 -0
- package/.output/public/assets/vb-7Xr8dEYW.js +1 -0
- package/.output/public/assets/verilog-AvXtwZir.js +1 -0
- package/.output/public/assets/vesper-CtgQQ2sf.js +1 -0
- package/.output/public/assets/vhdl-BHu0zg1P.js +1 -0
- package/.output/public/assets/viml-Di0QpLfC.js +1 -0
- package/.output/public/assets/vitesse-black-jXdfyqgD.js +1 -0
- package/.output/public/assets/vitesse-dark-B88PxG1r.js +1 -0
- package/.output/public/assets/vitesse-light-BXxZh2iV.js +1 -0
- package/.output/public/assets/vue-Dnf0y5RU.js +1 -0
- package/.output/public/assets/vue-html-CRtKS76J.js +1 -0
- package/.output/public/assets/vue-vine-BxjPqU7T.js +1 -0
- package/.output/public/assets/vyper-C3R5yXgx.js +1 -0
- package/.output/public/assets/wasm-CEUrWlVz.js +1 -0
- package/.output/public/assets/wasm-Chsuwt1A.js +1 -0
- package/.output/public/assets/wenyan-BonVcr2i.js +1 -0
- package/.output/public/assets/wgsl-D59WYmNq.js +1 -0
- package/.output/public/assets/wikitext-ariTI2Wk.js +1 -0
- package/.output/public/assets/wit-EA4fa3Dt.js +1 -0
- package/.output/public/assets/wolfram-DDp7LhyU.js +1 -0
- package/.output/public/assets/xml-eU7M3iZJ.js +1 -0
- package/.output/public/assets/xsl-DSqe4nTO.js +1 -0
- package/.output/public/assets/yaml-BTD1XHJG.js +1 -0
- package/.output/public/assets/zenscript-4WaROUyc.js +1 -0
- package/.output/public/assets/zig-CJoLJGwV.js +1 -0
- package/.output/public/favicon.png +0 -0
- package/.output/public/favicon.svg +7 -0
- package/.output/public/manifest.json +28 -0
- package/.output/public/robots.txt +3 -0
- package/.output/public/screenshots/pico-workspace-alt.png +0 -0
- package/.output/public/screenshots/pico-workspace.png +0 -0
- package/.output/public/sounds/session-done.mp3 +0 -0
- package/.output/server/__23tanstack-start-plugin-adapters-y_fshQDY.mjs +5 -0
- package/.output/server/_chunks/ssr-renderer.mjs +15 -0
- package/.output/server/_libs/@base-ui/react+[...].mjs +14407 -0
- package/.output/server/_libs/@dnd-kit/core+[...].mjs +2748 -0
- package/.output/server/_libs/@pierre/diffs+[...].mjs +19074 -0
- package/.output/server/_libs/@pierre/trees+[...].mjs +9236 -0
- package/.output/server/_libs/@radix-ui/react-dialog+[...].mjs +1789 -0
- package/.output/server/_libs/@radix-ui/react-primitive+[...].mjs +136 -0
- package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +196 -0
- package/.output/server/_libs/@tanstack/hotkeys+[...].mjs +1607 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +13950 -0
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +90 -0
- package/.output/server/_libs/bail.mjs +13 -0
- package/.output/server/_libs/character-entities.mjs +2135 -0
- package/.output/server/_libs/class-variance-authority+clsx.mjs +69 -0
- package/.output/server/_libs/cmdk.mjs +473 -0
- package/.output/server/_libs/decode-named-character-reference+[...].mjs +19 -0
- package/.output/server/_libs/devlop.mjs +5 -0
- package/.output/server/_libs/diff.mjs +732 -0
- package/.output/server/_libs/dnd-kit__accessibility.mjs +46 -0
- package/.output/server/_libs/dnd-kit__sortable.mjs +400 -0
- package/.output/server/_libs/escape-string-regexp.mjs +7 -0
- package/.output/server/_libs/estree-util-is-identifier-name.mjs +20 -0
- package/.output/server/_libs/extend.mjs +75 -0
- package/.output/server/_libs/h3+rou3+srvx.mjs +1210 -0
- package/.output/server/_libs/hast-util-to-jsx-runtime+[...].mjs +1244 -0
- package/.output/server/_libs/hookable.mjs +41 -0
- package/.output/server/_libs/html-url-attributes.mjs +44 -0
- package/.output/server/_libs/is-plain-obj.mjs +8 -0
- package/.output/server/_libs/longest-streak.mjs +29 -0
- package/.output/server/_libs/lucide-react.mjs +632 -0
- package/.output/server/_libs/markdown-table.mjs +289 -0
- package/.output/server/_libs/mdast-util-find-and-replace+[...].mjs +636 -0
- package/.output/server/_libs/mdast-util-from-markdown+[...].mjs +8409 -0
- package/.output/server/_libs/mdast-util-gfm+[...].mjs +2346 -0
- package/.output/server/_libs/mdast-util-to-hast+[...].mjs +1772 -0
- package/.output/server/_libs/micromark-extension-gfm+[...].mjs +2234 -0
- package/.output/server/_libs/next-themes.mjs +124 -0
- package/.output/server/_libs/pierre__theme.mjs +10 -0
- package/.output/server/_libs/radix-ui__primitive.mjs +9 -0
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +30 -0
- package/.output/server/_libs/radix-ui__react-context.mjs +88 -0
- package/.output/server/_libs/react-markdown+[...].mjs +2316 -0
- package/.output/server/_libs/remark-gfm.mjs +34 -0
- package/.output/server/_libs/shiki.mjs +16 -0
- package/.output/server/_libs/shikijs__langs.mjs +1355 -0
- package/.output/server/_libs/shikijs__themes.mjs +262 -0
- package/.output/server/_libs/sonner.mjs +908 -0
- package/.output/server/_libs/sugar-high.mjs +1036 -0
- package/.output/server/_libs/tailwind-merge.mjs +1962 -0
- package/.output/server/_libs/tanstack__history.mjs +342 -0
- package/.output/server/_libs/tanstack__pacer.mjs +1111 -0
- package/.output/server/_libs/tanstack__query-core.mjs +2202 -0
- package/.output/server/_libs/tanstack__react-hotkeys.mjs +152 -0
- package/.output/server/_libs/tanstack__react-query.mjs +180 -0
- package/.output/server/_libs/tanstack__react-store.mjs +39 -0
- package/.output/server/_libs/tanstack__router-core.mjs +6 -0
- package/.output/server/_libs/tanstack__store.mjs +28 -0
- package/.output/server/_libs/ufo.mjs +64 -0
- package/.output/server/_libs/unctx.mjs +82 -0
- package/.output/server/_libs/ungap__structured-clone.mjs +197 -0
- package/.output/server/_libs/vaul.mjs +1250 -0
- package/.output/server/_libs/zod.mjs +3341 -0
- package/.output/server/_runtime.mjs +35 -0
- package/.output/server/_ssr/router-Bz70uQ0p.mjs +7231 -0
- package/.output/server/_ssr/routes-C7oV8l68.mjs +21622 -0
- package/.output/server/_ssr/routes-DGvt0TQ-.mjs +1275 -0
- package/.output/server/_ssr/ssr.mjs +5176 -0
- package/.output/server/_ssr/start-C9AjCGlr.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-D0yEuwRY.mjs +65 -0
- package/.output/server/index.mjs +2563 -0
- package/.output/server/node_modules/tslib/modules/index.js +70 -0
- package/.output/server/node_modules/tslib/modules/package.json +3 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/package.json +9 -0
- package/LICENSE +8 -0
- package/README.md +111 -0
- package/bin/pico.mjs +206 -0
- package/package.json +105 -0
- package/public/screenshots/pico-workspace-alt.png +0 -0
- package/public/screenshots/pico-workspace.png +0 -0
- package/scripts/patch-react-jsx-dev-runtime.mjs +93 -0
|
@@ -0,0 +1,1275 @@
|
|
|
1
|
+
import { i as __toESM } from "../_runtime.mjs";
|
|
2
|
+
import { B as TooltipProvider$1, G as TooltipRoot, H as TooltipPositioner, U as TooltipPortal, V as TooltipPopup, W as TooltipTrigger$1, X as require_react, Y as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
|
+
import { o as lazyRouteComponent, s as createFileRoute } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
4
|
+
import { n as clsx } from "../_libs/class-variance-authority+clsx.mjs";
|
|
5
|
+
import { t as twMerge } from "../_libs/tailwind-merge.mjs";
|
|
6
|
+
import { B as ArrowDown, I as ArrowUp, M as ChevronUp, O as Command, R as ArrowRight, V as ArrowBigUp, m as Option, z as ArrowLeft } from "../_libs/lucide-react.mjs";
|
|
7
|
+
import { n as string, t as object } from "../_libs/zod.mjs";
|
|
8
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/routes-DGvt0TQ-.js
|
|
9
|
+
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
10
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
11
|
+
function cn(...inputs) {
|
|
12
|
+
return twMerge(clsx(inputs));
|
|
13
|
+
}
|
|
14
|
+
var modifierTokenPattern = /(Shift|Control|Ctrl|Command|Cmd|Meta|Alt|Option|⇧|⌃|⌘|⌥|↑|↓|←|→|\s+|\/|\+)/gi;
|
|
15
|
+
var modifierLabels = {
|
|
16
|
+
command: "Command",
|
|
17
|
+
control: "Control",
|
|
18
|
+
option: "Option",
|
|
19
|
+
shift: "Shift"
|
|
20
|
+
};
|
|
21
|
+
var arrowLabels = {
|
|
22
|
+
down: "Arrow down",
|
|
23
|
+
left: "Arrow left",
|
|
24
|
+
right: "Arrow right",
|
|
25
|
+
up: "Arrow up"
|
|
26
|
+
};
|
|
27
|
+
function getShortcutModifier(value) {
|
|
28
|
+
const normalized = value.toLowerCase();
|
|
29
|
+
if (value === "⌘" || normalized === "command") return "command";
|
|
30
|
+
if (normalized === "cmd" || normalized === "meta") return "command";
|
|
31
|
+
if (value === "⌃" || normalized === "control") return "control";
|
|
32
|
+
if (normalized === "ctrl") return "control";
|
|
33
|
+
if (value === "⌥" || normalized === "option") return "option";
|
|
34
|
+
if (normalized === "alt") return "option";
|
|
35
|
+
if (value === "⇧" || normalized === "shift") return "shift";
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function getShortcutArrow(value) {
|
|
39
|
+
if (value === "↑") return "up";
|
|
40
|
+
if (value === "↓") return "down";
|
|
41
|
+
if (value === "←") return "left";
|
|
42
|
+
if (value === "→") return "right";
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
function tokenizeShortcut(value) {
|
|
46
|
+
const rawTokens = value.split(modifierTokenPattern).filter((token) => token.length > 0);
|
|
47
|
+
const shortcutTokens = [];
|
|
48
|
+
for (let index = 0; index < rawTokens.length; index += 1) {
|
|
49
|
+
const token = rawTokens[index];
|
|
50
|
+
const modifier = getShortcutModifier(token);
|
|
51
|
+
const arrow = getShortcutArrow(token);
|
|
52
|
+
if (modifier) {
|
|
53
|
+
shortcutTokens.push({
|
|
54
|
+
type: "modifier",
|
|
55
|
+
modifier,
|
|
56
|
+
label: modifierLabels[modifier]
|
|
57
|
+
});
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (arrow) {
|
|
61
|
+
shortcutTokens.push({
|
|
62
|
+
type: "arrow",
|
|
63
|
+
arrow,
|
|
64
|
+
label: arrowLabels[arrow]
|
|
65
|
+
});
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (token === "/") {
|
|
69
|
+
shortcutTokens.push({
|
|
70
|
+
type: "separator",
|
|
71
|
+
value: token
|
|
72
|
+
});
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (token === "+") {
|
|
76
|
+
const previousModifier = getShortcutModifier(rawTokens[index - 1] ?? "");
|
|
77
|
+
const nextModifier = getShortcutModifier(rawTokens[index + 1] ?? "");
|
|
78
|
+
if (previousModifier || nextModifier) continue;
|
|
79
|
+
}
|
|
80
|
+
if (token.trim().length === 0) continue;
|
|
81
|
+
shortcutTokens.push({
|
|
82
|
+
type: "text",
|
|
83
|
+
value: token
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return shortcutTokens;
|
|
87
|
+
}
|
|
88
|
+
function ShortcutModifierIcon({ modifier }) {
|
|
89
|
+
const className = "size-[10px] shrink-0 stroke-[2.4]";
|
|
90
|
+
if (modifier === "shift") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowBigUp, {
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
className
|
|
93
|
+
});
|
|
94
|
+
if (modifier === "control") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronUp, {
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
className
|
|
97
|
+
});
|
|
98
|
+
if (modifier === "command") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Command, {
|
|
99
|
+
"aria-hidden": "true",
|
|
100
|
+
className
|
|
101
|
+
});
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, {
|
|
103
|
+
"aria-hidden": "true",
|
|
104
|
+
className
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function ShortcutArrowIcon({ arrow }) {
|
|
108
|
+
const className = "size-[10px] shrink-0 stroke-[2.4]";
|
|
109
|
+
if (arrow === "up") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowUp, {
|
|
110
|
+
"aria-hidden": "true",
|
|
111
|
+
className
|
|
112
|
+
});
|
|
113
|
+
if (arrow === "down") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowDown, {
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
className
|
|
116
|
+
});
|
|
117
|
+
if (arrow === "left") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowLeft, {
|
|
118
|
+
"aria-hidden": "true",
|
|
119
|
+
className
|
|
120
|
+
});
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowRight, {
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
className
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function ShortcutText({ value }) {
|
|
127
|
+
const tokens = tokenizeShortcut(value);
|
|
128
|
+
if (tokens.length === 0) return null;
|
|
129
|
+
return tokens.map((token, index) => {
|
|
130
|
+
if (token.type === "modifier") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShortcutModifierIcon, { modifier: token.modifier }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
131
|
+
className: "sr-only",
|
|
132
|
+
children: token.label
|
|
133
|
+
})] }, `${token.modifier}-${index}`);
|
|
134
|
+
if (token.type === "arrow") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShortcutArrowIcon, { arrow: token.arrow }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
135
|
+
className: "sr-only",
|
|
136
|
+
children: token.label
|
|
137
|
+
})] }, `${token.arrow}-${index}`);
|
|
138
|
+
if (token.type === "separator") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
139
|
+
"aria-hidden": "true",
|
|
140
|
+
className: "mx-0.5",
|
|
141
|
+
children: token.value
|
|
142
|
+
}, `separator-${index}`);
|
|
143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: token.value }, `text-${index}`);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function KeyboardShortcutContent({ children, className }) {
|
|
147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
148
|
+
className: cn("inline-flex items-center gap-1 align-middle leading-none", className),
|
|
149
|
+
children: import_react.Children.map(children, (child) => {
|
|
150
|
+
if (typeof child === "string" || typeof child === "number") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShortcutText, { value: String(child) });
|
|
151
|
+
return child;
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function Kbd({ className, children, ...props }) {
|
|
156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("kbd", {
|
|
157
|
+
className: cn("inline-flex items-center rounded border border-border/70 bg-muted/40 px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground data-[active=true]:border-primary/40 data-[active=true]:bg-primary data-[active=true]:text-primary-foreground", className),
|
|
158
|
+
...props,
|
|
159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KeyboardShortcutContent, { children })
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function TooltipProvider({ delay = 0, ...props }) {
|
|
163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipProvider$1, {
|
|
164
|
+
"data-slot": "tooltip-provider",
|
|
165
|
+
delay,
|
|
166
|
+
...props
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function Tooltip$1({ ...props }) {
|
|
170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipRoot, {
|
|
171
|
+
"data-slot": "tooltip",
|
|
172
|
+
...props
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function TooltipTrigger({ ...props }) {
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger$1, {
|
|
177
|
+
"data-slot": "tooltip-trigger",
|
|
178
|
+
...props
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function TooltipContent({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) {
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPositioner, {
|
|
183
|
+
align,
|
|
184
|
+
alignOffset,
|
|
185
|
+
side,
|
|
186
|
+
sideOffset,
|
|
187
|
+
className: "isolate z-50",
|
|
188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPopup, {
|
|
189
|
+
"data-slot": "tooltip-content",
|
|
190
|
+
className: cn("z-50 flex max-h-[min(24rem,calc(100vh-2rem))] max-w-[min(42rem,calc(100vw-2rem))] min-w-0 origin-(--transform-origin) items-center gap-1.5 overflow-x-hidden overflow-y-auto rounded-md bg-secondary px-3 py-1.5 text-xs [overflow-wrap:anywhere] whitespace-pre-wrap text-secondary-foreground has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
191
|
+
...props,
|
|
192
|
+
children
|
|
193
|
+
})
|
|
194
|
+
}) });
|
|
195
|
+
}
|
|
196
|
+
function TitleTooltip({ title, children, kbd, rows, side, align, sideOffset, className }) {
|
|
197
|
+
if (!title) return children;
|
|
198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tooltip$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger, { render: children }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContent, {
|
|
199
|
+
side,
|
|
200
|
+
align,
|
|
201
|
+
sideOffset,
|
|
202
|
+
className,
|
|
203
|
+
children: rows ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
204
|
+
className: "flex flex-col gap-1",
|
|
205
|
+
children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
206
|
+
className: "flex items-center justify-between gap-3",
|
|
207
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
208
|
+
className: "min-w-0",
|
|
209
|
+
children: row.title
|
|
210
|
+
}), row.kbd ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Kbd, {
|
|
211
|
+
"data-slot": "kbd",
|
|
212
|
+
children: row.kbd
|
|
213
|
+
}) : null]
|
|
214
|
+
}, index))
|
|
215
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
216
|
+
className: "min-w-0",
|
|
217
|
+
children: title
|
|
218
|
+
}), kbd ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Kbd, {
|
|
219
|
+
"data-slot": "kbd",
|
|
220
|
+
children: kbd
|
|
221
|
+
}) : null] })
|
|
222
|
+
})] });
|
|
223
|
+
}
|
|
224
|
+
var BRAILLE_SPINNER_FRAMES = [
|
|
225
|
+
"⠋",
|
|
226
|
+
"⠙",
|
|
227
|
+
"⠹",
|
|
228
|
+
"⠸",
|
|
229
|
+
"⠼",
|
|
230
|
+
"⠴",
|
|
231
|
+
"⠦",
|
|
232
|
+
"⠧",
|
|
233
|
+
"⠇",
|
|
234
|
+
"⠏"
|
|
235
|
+
];
|
|
236
|
+
function Spinner({ className, "aria-label": ariaLabel = "Loading", ...props }) {
|
|
237
|
+
const [frameIndex, setFrameIndex] = import_react.useState(0);
|
|
238
|
+
import_react.useEffect(() => {
|
|
239
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
240
|
+
const intervalId = window.setInterval(() => {
|
|
241
|
+
setFrameIndex((current) => (current + 1) % BRAILLE_SPINNER_FRAMES.length);
|
|
242
|
+
}, 80);
|
|
243
|
+
return () => window.clearInterval(intervalId);
|
|
244
|
+
}, []);
|
|
245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
246
|
+
role: "status",
|
|
247
|
+
"aria-label": ariaLabel,
|
|
248
|
+
className: cn("pointer-events-none inline-flex size-4 shrink-0 items-center justify-center font-mono leading-none text-primary select-none", className),
|
|
249
|
+
...props,
|
|
250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
251
|
+
"aria-hidden": "true",
|
|
252
|
+
className: "leading-none",
|
|
253
|
+
children: BRAILLE_SPINNER_FRAMES[frameIndex]
|
|
254
|
+
})
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
var THEME_STORAGE_KEY = "pico-theme";
|
|
258
|
+
var DRAFT_DIRECTORY_STORAGE_KEY = "pico-draft-directory";
|
|
259
|
+
var SIDEBAR_DIRECTORIES_STORAGE_KEY = "pico-sidebar-directories";
|
|
260
|
+
var COLLAPSED_DIRECTORIES_STORAGE_KEY = "pico-collapsed-directories";
|
|
261
|
+
var RECENT_DIRECTORIES_STORAGE_KEY = "pico-recent-directories";
|
|
262
|
+
var SESSION_DONE_SOUND_ENABLED_STORAGE_KEY = "pico-session-done-sound";
|
|
263
|
+
var SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY = "pico-session-done-desktop-notifications";
|
|
264
|
+
var HIDE_TOOL_BLOCKS_STORAGE_KEY = "pico-hide-tools";
|
|
265
|
+
var CENTER_MESSAGES_STORAGE_KEY = "pico-center-messages";
|
|
266
|
+
var AUTO_SCROLL_ENABLED_STORAGE_KEY = "pico-auto-scroll";
|
|
267
|
+
var RIGHT_SIDEBAR_OPEN_STORAGE_KEY = "pico-right-sidebar-open";
|
|
268
|
+
var PROMPT_DRAFTS_STORAGE_KEY = "pico-prompt-drafts";
|
|
269
|
+
var VIEWER_CONTEXT_STORAGE_KEY = "pico-context-id";
|
|
270
|
+
function createContextId() {
|
|
271
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return `ctx-${crypto.randomUUID()}`;
|
|
272
|
+
return `ctx-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
273
|
+
}
|
|
274
|
+
function safeLocalStorageGetItem(key) {
|
|
275
|
+
try {
|
|
276
|
+
return window.localStorage.getItem(key);
|
|
277
|
+
} catch {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function safeLocalStorageSetItem(key, value) {
|
|
282
|
+
try {
|
|
283
|
+
window.localStorage.setItem(key, value);
|
|
284
|
+
return true;
|
|
285
|
+
} catch {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function safeSessionStorageGetItem(key) {
|
|
290
|
+
try {
|
|
291
|
+
return window.sessionStorage.getItem(key);
|
|
292
|
+
} catch {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
function safeSessionStorageSetItem(key, value) {
|
|
297
|
+
try {
|
|
298
|
+
window.sessionStorage.setItem(key, value);
|
|
299
|
+
return true;
|
|
300
|
+
} catch {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function normalizeStoredDirectoryList(value) {
|
|
305
|
+
if (!Array.isArray(value)) return [];
|
|
306
|
+
const nextDirectories = [];
|
|
307
|
+
const seen = /* @__PURE__ */ new Set();
|
|
308
|
+
for (const entry of value) {
|
|
309
|
+
const normalized = typeof entry === "string" ? entry.trim() : "";
|
|
310
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
311
|
+
seen.add(normalized);
|
|
312
|
+
nextDirectories.push(normalized);
|
|
313
|
+
}
|
|
314
|
+
return nextDirectories;
|
|
315
|
+
}
|
|
316
|
+
function sessionListEntryKey(sessionLike = {}) {
|
|
317
|
+
if (sessionLike.path) return `path:${sessionLike.path}`;
|
|
318
|
+
if (sessionLike.id) return `id:${sessionLike.id}`;
|
|
319
|
+
return "";
|
|
320
|
+
}
|
|
321
|
+
function normalizeSessionSelectionKeys(value) {
|
|
322
|
+
if (!Array.isArray(value)) return [];
|
|
323
|
+
const keys = [];
|
|
324
|
+
const seen = /* @__PURE__ */ new Set();
|
|
325
|
+
for (const entry of value) {
|
|
326
|
+
const key = typeof entry === "string" ? entry.trim() : "";
|
|
327
|
+
if (!key || seen.has(key)) continue;
|
|
328
|
+
seen.add(key);
|
|
329
|
+
keys.push(key);
|
|
330
|
+
}
|
|
331
|
+
return keys;
|
|
332
|
+
}
|
|
333
|
+
function promptDraftKey(target = {}) {
|
|
334
|
+
if (target.sessionId) return `session:${target.sessionId}`;
|
|
335
|
+
if (target.sessionFile) return `file:${target.sessionFile}`;
|
|
336
|
+
return `draft:${target.cwd?.trim() || "default"}`;
|
|
337
|
+
}
|
|
338
|
+
function loadStoredPromptDrafts() {
|
|
339
|
+
try {
|
|
340
|
+
const raw = safeSessionStorageGetItem(PROMPT_DRAFTS_STORAGE_KEY);
|
|
341
|
+
if (!raw) return {};
|
|
342
|
+
const parsed = JSON.parse(raw);
|
|
343
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
344
|
+
} catch {
|
|
345
|
+
return {};
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function readStoredPromptDraft(target = {}) {
|
|
349
|
+
const value = loadStoredPromptDrafts()[promptDraftKey(target)];
|
|
350
|
+
return typeof value === "string" ? value : void 0;
|
|
351
|
+
}
|
|
352
|
+
function rememberStoredPromptDraft(target = {}, text = "") {
|
|
353
|
+
const key = promptDraftKey(target);
|
|
354
|
+
const drafts = loadStoredPromptDrafts();
|
|
355
|
+
const nextValue = typeof text === "string" ? text : "";
|
|
356
|
+
if (nextValue) drafts[key] = nextValue;
|
|
357
|
+
else delete drafts[key];
|
|
358
|
+
return safeSessionStorageSetItem(PROMPT_DRAFTS_STORAGE_KEY, JSON.stringify(drafts));
|
|
359
|
+
}
|
|
360
|
+
function readStoredSidebarDirectories() {
|
|
361
|
+
try {
|
|
362
|
+
const raw = safeLocalStorageGetItem(SIDEBAR_DIRECTORIES_STORAGE_KEY);
|
|
363
|
+
if (raw == null) return {
|
|
364
|
+
directories: [],
|
|
365
|
+
hasStoredValue: false
|
|
366
|
+
};
|
|
367
|
+
return {
|
|
368
|
+
directories: normalizeStoredDirectoryList(JSON.parse(raw)),
|
|
369
|
+
hasStoredValue: true
|
|
370
|
+
};
|
|
371
|
+
} catch {
|
|
372
|
+
return {
|
|
373
|
+
directories: [],
|
|
374
|
+
hasStoredValue: false
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function readStoredCollapsedDirectories() {
|
|
379
|
+
try {
|
|
380
|
+
const raw = safeLocalStorageGetItem(COLLAPSED_DIRECTORIES_STORAGE_KEY);
|
|
381
|
+
if (!raw) return {};
|
|
382
|
+
const parsed = JSON.parse(raw);
|
|
383
|
+
if (!parsed || typeof parsed !== "object") return {};
|
|
384
|
+
return Object.fromEntries(Object.entries(parsed).map(([key, value]) => [key.trim(), Boolean(value)]).filter(([key]) => Boolean(key)));
|
|
385
|
+
} catch {
|
|
386
|
+
return {};
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function readStoredDraftDirectory() {
|
|
390
|
+
return (safeLocalStorageGetItem("pico-draft-directory") ?? "").trim();
|
|
391
|
+
}
|
|
392
|
+
function readStoredRecentDirectories() {
|
|
393
|
+
try {
|
|
394
|
+
const raw = safeLocalStorageGetItem(RECENT_DIRECTORIES_STORAGE_KEY);
|
|
395
|
+
if (!raw) return [];
|
|
396
|
+
return normalizeStoredDirectoryList(JSON.parse(raw));
|
|
397
|
+
} catch {
|
|
398
|
+
return [];
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function normalizeThemeMode(value) {
|
|
402
|
+
return value === "light" || value === "dark" || value === "system" ? value : "system";
|
|
403
|
+
}
|
|
404
|
+
function readStoredHideToolBlocks() {
|
|
405
|
+
return safeLocalStorageGetItem(HIDE_TOOL_BLOCKS_STORAGE_KEY) === "1";
|
|
406
|
+
}
|
|
407
|
+
function readStoredCenterMessages() {
|
|
408
|
+
return safeLocalStorageGetItem(CENTER_MESSAGES_STORAGE_KEY) === "1";
|
|
409
|
+
}
|
|
410
|
+
function readStoredAutoScrollEnabled() {
|
|
411
|
+
const value = safeLocalStorageGetItem(AUTO_SCROLL_ENABLED_STORAGE_KEY);
|
|
412
|
+
return value == null ? true : value !== "0";
|
|
413
|
+
}
|
|
414
|
+
function readStoredRightSidebarOpen() {
|
|
415
|
+
return safeLocalStorageGetItem(RIGHT_SIDEBAR_OPEN_STORAGE_KEY) === "1";
|
|
416
|
+
}
|
|
417
|
+
function readStoredSessionDoneSoundEnabled() {
|
|
418
|
+
const value = safeLocalStorageGetItem(SESSION_DONE_SOUND_ENABLED_STORAGE_KEY);
|
|
419
|
+
return value == null ? true : value !== "0";
|
|
420
|
+
}
|
|
421
|
+
function readStoredSessionDoneDesktopNotificationsEnabled() {
|
|
422
|
+
const value = safeLocalStorageGetItem(SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY);
|
|
423
|
+
return value == null ? true : value !== "0";
|
|
424
|
+
}
|
|
425
|
+
var EXPLORE_TOOL_NAMES = new Set([
|
|
426
|
+
"read",
|
|
427
|
+
"grep",
|
|
428
|
+
"glob",
|
|
429
|
+
"find",
|
|
430
|
+
"ls",
|
|
431
|
+
"list",
|
|
432
|
+
"rg"
|
|
433
|
+
]);
|
|
434
|
+
var EXPLORE_SHELL_COMMAND_NAMES = new Set([
|
|
435
|
+
"find",
|
|
436
|
+
"grep",
|
|
437
|
+
"ls",
|
|
438
|
+
"rg"
|
|
439
|
+
]);
|
|
440
|
+
var SKIPPABLE_SHELL_COMMAND_NAMES = new Set([
|
|
441
|
+
"cd",
|
|
442
|
+
"export",
|
|
443
|
+
"pwd",
|
|
444
|
+
"set"
|
|
445
|
+
]);
|
|
446
|
+
var SHELL_COMMAND_WRAPPER_NAMES = new Set([
|
|
447
|
+
"command",
|
|
448
|
+
"env",
|
|
449
|
+
"noglob",
|
|
450
|
+
"sudo",
|
|
451
|
+
"time"
|
|
452
|
+
]);
|
|
453
|
+
function normalizeToolArgs(args) {
|
|
454
|
+
if (!args) return void 0;
|
|
455
|
+
if (typeof args === "object") return args;
|
|
456
|
+
if (typeof args !== "string") return void 0;
|
|
457
|
+
try {
|
|
458
|
+
const parsed = JSON.parse(args);
|
|
459
|
+
return parsed && typeof parsed === "object" ? parsed : void 0;
|
|
460
|
+
} catch {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
function getToolArgText(args, key) {
|
|
465
|
+
const value = args?.[key];
|
|
466
|
+
return typeof value === "string" && value.trim() ? value.trim() : "";
|
|
467
|
+
}
|
|
468
|
+
function toolCommandPreviewFromArgs(args) {
|
|
469
|
+
if (typeof args === "string" && args.trim()) return args.trim();
|
|
470
|
+
const normalizedArgs = normalizeToolArgs(args);
|
|
471
|
+
return getToolArgText(normalizedArgs, "description") || getToolArgText(normalizedArgs, "command") || getToolArgText(normalizedArgs, "path") || getToolArgText(normalizedArgs, "filePath");
|
|
472
|
+
}
|
|
473
|
+
function rawShellCommandTextFromTool(name, args) {
|
|
474
|
+
if (name !== "bash") return "";
|
|
475
|
+
if (typeof args === "string") {
|
|
476
|
+
const trimmed = args.trim();
|
|
477
|
+
if (!trimmed) return "";
|
|
478
|
+
try {
|
|
479
|
+
const parsed = JSON.parse(trimmed);
|
|
480
|
+
if (parsed && typeof parsed === "object" && "command" in parsed) {
|
|
481
|
+
const command = parsed.command;
|
|
482
|
+
return typeof command === "string" ? command.trim() : trimmed;
|
|
483
|
+
}
|
|
484
|
+
} catch {
|
|
485
|
+
return trimmed;
|
|
486
|
+
}
|
|
487
|
+
return trimmed;
|
|
488
|
+
}
|
|
489
|
+
return getToolArgText(normalizeToolArgs(args), "command") || toolCommandPreviewFromArgs(args);
|
|
490
|
+
}
|
|
491
|
+
function pathBaseName(path) {
|
|
492
|
+
const normalized = path.replace(/\\/g, "/").trim();
|
|
493
|
+
if (!normalized) return "";
|
|
494
|
+
const parts = normalized.split("/");
|
|
495
|
+
return parts[parts.length - 1] || normalized;
|
|
496
|
+
}
|
|
497
|
+
function shellCommandNameFromSegment(segment) {
|
|
498
|
+
let text = segment.trim();
|
|
499
|
+
while (text) {
|
|
500
|
+
const assignmentMatch = text.match(/^(?:env\s+)?[A-Za-z_][A-Za-z0-9_]*=(?:"[^"]*"|'[^']*'|\S*)\s*/);
|
|
501
|
+
if (assignmentMatch) {
|
|
502
|
+
text = text.slice(assignmentMatch[0].length).trimStart();
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
const commandMatch = text.match(/^([./A-Za-z0-9_-]+)\b/);
|
|
506
|
+
if (!commandMatch) return "";
|
|
507
|
+
const commandPath = commandMatch[1] || "";
|
|
508
|
+
const commandName = pathBaseName(commandPath);
|
|
509
|
+
if (!SHELL_COMMAND_WRAPPER_NAMES.has(commandName)) return commandName;
|
|
510
|
+
text = text.slice(commandPath.length).trimStart();
|
|
511
|
+
}
|
|
512
|
+
return "";
|
|
513
|
+
}
|
|
514
|
+
function exploreShellCommandNameFromTool(name, args) {
|
|
515
|
+
if (name !== "bash") return "";
|
|
516
|
+
const segments = rawShellCommandTextFromTool(name, args).split(/(?:&&|\|\||;)/);
|
|
517
|
+
for (const segment of segments) {
|
|
518
|
+
const commandName = shellCommandNameFromSegment(segment);
|
|
519
|
+
if (!commandName || SKIPPABLE_SHELL_COMMAND_NAMES.has(commandName)) continue;
|
|
520
|
+
return EXPLORE_SHELL_COMMAND_NAMES.has(commandName) ? commandName : "";
|
|
521
|
+
}
|
|
522
|
+
return "";
|
|
523
|
+
}
|
|
524
|
+
function toolCategoryFromTool(name, args) {
|
|
525
|
+
return EXPLORE_TOOL_NAMES.has(name || "") || Boolean(exploreShellCommandNameFromTool(name, args)) ? "explore" : void 0;
|
|
526
|
+
}
|
|
527
|
+
function previewUrlForImage(image) {
|
|
528
|
+
return `data:${image.mimeType};base64,${image.data}`;
|
|
529
|
+
}
|
|
530
|
+
function normalizePromptImage(image) {
|
|
531
|
+
if (!image || typeof image !== "object") return null;
|
|
532
|
+
let mimeType = typeof image.mimeType === "string" ? image.mimeType.trim() : "";
|
|
533
|
+
let data = typeof image.data === "string" ? image.data.trim() : "";
|
|
534
|
+
if (!data) return null;
|
|
535
|
+
const dataUrlMatch = data.match(/^data:([^;,]+);base64,(.+)$/i);
|
|
536
|
+
if (dataUrlMatch) {
|
|
537
|
+
if (!mimeType) mimeType = dataUrlMatch[1] ?? mimeType;
|
|
538
|
+
data = dataUrlMatch[2] ?? "";
|
|
539
|
+
}
|
|
540
|
+
if (!mimeType || !/^image\//i.test(mimeType) || !data) return null;
|
|
541
|
+
return {
|
|
542
|
+
type: "image",
|
|
543
|
+
mimeType,
|
|
544
|
+
data,
|
|
545
|
+
previewUrl: previewUrlForImage({
|
|
546
|
+
mimeType,
|
|
547
|
+
data
|
|
548
|
+
})
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function extractMessageText(message) {
|
|
552
|
+
if (typeof message?.content === "string") return message.content;
|
|
553
|
+
if (!Array.isArray(message?.content)) return "";
|
|
554
|
+
return message.content.filter((part) => part?.type === "text").map((part) => part.text || "").join("\n");
|
|
555
|
+
}
|
|
556
|
+
function extractToolText(result) {
|
|
557
|
+
if (!result || !Array.isArray(result.content)) return "";
|
|
558
|
+
return result.content.filter((part) => part?.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n");
|
|
559
|
+
}
|
|
560
|
+
function extractMessageImages(message) {
|
|
561
|
+
if (!Array.isArray(message?.content)) return [];
|
|
562
|
+
return message.content.filter((part) => part?.type === "image").map((part) => normalizePromptImage(part)).filter((part) => Boolean(part));
|
|
563
|
+
}
|
|
564
|
+
function normalizeStreamingBehavior(value) {
|
|
565
|
+
return value === "steer" || value === "followUp" ? value : void 0;
|
|
566
|
+
}
|
|
567
|
+
function stableJsonValue(value) {
|
|
568
|
+
if (value == null) return "";
|
|
569
|
+
if (typeof value !== "object") return JSON.stringify(value);
|
|
570
|
+
if (Array.isArray(value)) return `[${value.map((entry) => stableJsonValue(entry)).join(",")}]`;
|
|
571
|
+
return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stableJsonValue(value[key])}`).join(",")}}`;
|
|
572
|
+
}
|
|
573
|
+
function sameContextUsage(left, right) {
|
|
574
|
+
return stableJsonValue(left) === stableJsonValue(right);
|
|
575
|
+
}
|
|
576
|
+
function samePromptImages(leftImages = [], rightImages = []) {
|
|
577
|
+
if (leftImages.length !== rightImages.length) return false;
|
|
578
|
+
for (let index = 0; index < leftImages.length; index += 1) {
|
|
579
|
+
const left = leftImages[index];
|
|
580
|
+
const right = rightImages[index];
|
|
581
|
+
if (!left || !right) return false;
|
|
582
|
+
if (left.mimeType !== right.mimeType) return false;
|
|
583
|
+
if (left.data !== right.data) return false;
|
|
584
|
+
if (left.previewUrl !== right.previewUrl) return false;
|
|
585
|
+
}
|
|
586
|
+
return true;
|
|
587
|
+
}
|
|
588
|
+
function sameUserMessageBody(left, right) {
|
|
589
|
+
return left.text === right.text && samePromptImages(left.images, right.images) && Boolean(left.queued) === Boolean(right.queued) && left.streamingBehavior === right.streamingBehavior;
|
|
590
|
+
}
|
|
591
|
+
function sameUserMessageContent(left, right) {
|
|
592
|
+
return (left.itemKey || "") === (right.itemKey || "") && sameUserMessageBody(left, right);
|
|
593
|
+
}
|
|
594
|
+
function sameAssistantBlockPayload(left, right) {
|
|
595
|
+
if (!left || !right || left.type !== right.type) return false;
|
|
596
|
+
switch (left.type) {
|
|
597
|
+
case "text": return right.type === "text" && left.text === right.text && Boolean(left.isError) === Boolean(right.isError);
|
|
598
|
+
case "thinking": return right.type === "thinking" && left.text === right.text && (left.summaryLabel || "") === (right.summaryLabel || "");
|
|
599
|
+
case "tool": return right.type === "tool" && (left.callId || "") === (right.callId || "") && (left.name || "") === (right.name || "") && stableJsonValue(left.args) === stableJsonValue(right.args) && left.output === right.output && stableJsonValue(left.details) === stableJsonValue(right.details) && Boolean(left.isError) === Boolean(right.isError) && Boolean(left.running) === Boolean(right.running);
|
|
600
|
+
case "compaction": return right.type === "compaction" && left.summary === right.summary && left.tokensBefore === right.tokensBefore;
|
|
601
|
+
default: return false;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
function sameAssistantBlock(left, right) {
|
|
605
|
+
return (left.blockKey || "") === (right.blockKey || "") && sameAssistantBlockPayload(left, right);
|
|
606
|
+
}
|
|
607
|
+
function sameAssistantModel(left, right) {
|
|
608
|
+
if (left === right) return true;
|
|
609
|
+
if (!left || !right) return false;
|
|
610
|
+
return left.id === right.id && (left.provider || "") === (right.provider || "") && (left.name || "") === (right.name || "") && Boolean(left.reasoning) === Boolean(right.reasoning);
|
|
611
|
+
}
|
|
612
|
+
function sameAssistantMessageMeta(left, right) {
|
|
613
|
+
return sameAssistantModel(left.model, right.model) && left.done === false === (right.done === false);
|
|
614
|
+
}
|
|
615
|
+
function sameStateItem(left, right) {
|
|
616
|
+
if (!left || !right || left.kind !== right.kind) return false;
|
|
617
|
+
if ((left.itemKey || "") !== (right.itemKey || "")) return false;
|
|
618
|
+
if (left.kind === "user" && right.kind === "user") return (left.pendingId || "") === (right.pendingId || "") && sameUserMessageContent(left, right);
|
|
619
|
+
if (left.kind !== "assistant" || right.kind !== "assistant") return false;
|
|
620
|
+
if (Boolean(left.streaming) !== Boolean(right.streaming)) return false;
|
|
621
|
+
if (!sameAssistantMessageMeta(left, right)) return false;
|
|
622
|
+
if (left.blocks.length !== right.blocks.length) return false;
|
|
623
|
+
for (let index = 0; index < left.blocks.length; index += 1) if (!sameAssistantBlock(left.blocks[index], right.blocks[index])) return false;
|
|
624
|
+
return true;
|
|
625
|
+
}
|
|
626
|
+
function previousAssistantBlockByKey(blocks, blockKey) {
|
|
627
|
+
if (!blockKey) return void 0;
|
|
628
|
+
return blocks.find((block) => block.blockKey === blockKey);
|
|
629
|
+
}
|
|
630
|
+
function assistantBlockRenderKey(block) {
|
|
631
|
+
return block?.renderKey || block?.blockKey || "";
|
|
632
|
+
}
|
|
633
|
+
function withAssistantBlockRenderKey(block, previousBlock) {
|
|
634
|
+
const renderKey = assistantBlockRenderKey(previousBlock);
|
|
635
|
+
if (!renderKey || block.renderKey === renderKey) return block;
|
|
636
|
+
return {
|
|
637
|
+
...block,
|
|
638
|
+
renderKey
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
function sameAssistantBlockListPayload(leftBlocks, rightBlocks) {
|
|
642
|
+
if (leftBlocks.length !== rightBlocks.length) return false;
|
|
643
|
+
for (let index = 0; index < leftBlocks.length; index += 1) if (!sameAssistantBlockPayload(leftBlocks[index], rightBlocks[index])) return false;
|
|
644
|
+
return true;
|
|
645
|
+
}
|
|
646
|
+
function reconcileAssistantBlocks(previousBlocks, nextBlocks) {
|
|
647
|
+
let changed = previousBlocks.length !== nextBlocks.length;
|
|
648
|
+
const reconciled = [];
|
|
649
|
+
for (let index = 0; index < nextBlocks.length; index += 1) {
|
|
650
|
+
const nextBlock = nextBlocks[index];
|
|
651
|
+
const previousBlock = previousAssistantBlockByKey(previousBlocks, nextBlock.blockKey) || previousBlocks[index];
|
|
652
|
+
if (previousBlock && sameAssistantBlock(previousBlock, nextBlock)) {
|
|
653
|
+
reconciled.push(previousBlock);
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
changed = true;
|
|
657
|
+
if (previousBlock?.type === nextBlock.type && ((previousBlock.blockKey || "") === (nextBlock.blockKey || "") || sameAssistantBlockPayload(previousBlock, nextBlock))) {
|
|
658
|
+
reconciled.push(withAssistantBlockRenderKey(nextBlock, previousBlock));
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
reconciled.push(nextBlock);
|
|
662
|
+
}
|
|
663
|
+
return changed ? reconciled : previousBlocks;
|
|
664
|
+
}
|
|
665
|
+
function conversationItemRenderKey(item) {
|
|
666
|
+
return item?.renderKey || item?.itemKey || "";
|
|
667
|
+
}
|
|
668
|
+
function withConversationItemRenderKey(item, previousItem) {
|
|
669
|
+
const renderKey = conversationItemRenderKey(previousItem);
|
|
670
|
+
if (!renderKey || item.renderKey === renderKey) return item;
|
|
671
|
+
return {
|
|
672
|
+
...item,
|
|
673
|
+
renderKey
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
function reconcileConversationItems(previousItems, nextItems) {
|
|
677
|
+
if (previousItems.length === 0) return nextItems;
|
|
678
|
+
const previousItemsByKey = /* @__PURE__ */ new Map();
|
|
679
|
+
const previousItemsByRenderKey = /* @__PURE__ */ new Map();
|
|
680
|
+
for (const item of previousItems) {
|
|
681
|
+
if (item.itemKey && !previousItemsByKey.has(item.itemKey)) previousItemsByKey.set(item.itemKey, item);
|
|
682
|
+
const renderKey = conversationItemRenderKey(item);
|
|
683
|
+
if (renderKey && !previousItemsByRenderKey.has(renderKey)) previousItemsByRenderKey.set(renderKey, item);
|
|
684
|
+
}
|
|
685
|
+
let changed = previousItems.length !== nextItems.length;
|
|
686
|
+
const reconciled = [];
|
|
687
|
+
for (let index = 0; index < nextItems.length; index += 1) {
|
|
688
|
+
const nextItem = nextItems[index];
|
|
689
|
+
const nextRenderKey = conversationItemRenderKey(nextItem);
|
|
690
|
+
const previousItem = (nextItem.itemKey ? previousItemsByKey.get(nextItem.itemKey) : void 0) || (nextRenderKey ? previousItemsByRenderKey.get(nextRenderKey) : void 0) || previousItems[index];
|
|
691
|
+
if (!previousItem || previousItem.kind !== nextItem.kind) {
|
|
692
|
+
changed = true;
|
|
693
|
+
reconciled.push(nextItem);
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
if (sameStateItem(previousItem, nextItem)) {
|
|
697
|
+
reconciled.push(previousItem);
|
|
698
|
+
continue;
|
|
699
|
+
}
|
|
700
|
+
if (previousItem.kind === "user" && nextItem.kind === "user") {
|
|
701
|
+
if (sameUserMessageBody(previousItem, nextItem)) {
|
|
702
|
+
changed = true;
|
|
703
|
+
reconciled.push(withConversationItemRenderKey(nextItem, previousItem));
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
if (previousItem.kind === "assistant" && nextItem.kind === "assistant") {
|
|
708
|
+
const blocks = reconcileAssistantBlocks(previousItem.blocks, nextItem.blocks);
|
|
709
|
+
const sameLogicalItem = (previousItem.itemKey || "") === (nextItem.itemKey || "");
|
|
710
|
+
const sameRenderItem = conversationItemRenderKey(previousItem) === conversationItemRenderKey(nextItem);
|
|
711
|
+
const finalizingStreamingItem = Boolean(previousItem.streaming) && !nextItem.streaming && sameAssistantBlockListPayload(previousItem.blocks, nextItem.blocks);
|
|
712
|
+
const itemWithStableRenderKey = sameLogicalItem || sameRenderItem || finalizingStreamingItem ? withConversationItemRenderKey(nextItem, previousItem) : nextItem;
|
|
713
|
+
if (sameLogicalItem && blocks === previousItem.blocks && Boolean(previousItem.streaming) === Boolean(nextItem.streaming) && sameAssistantMessageMeta(previousItem, nextItem)) {
|
|
714
|
+
reconciled.push(previousItem);
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
changed = true;
|
|
718
|
+
reconciled.push(blocks === itemWithStableRenderKey.blocks ? itemWithStableRenderKey : {
|
|
719
|
+
...itemWithStableRenderKey,
|
|
720
|
+
blocks
|
|
721
|
+
});
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
changed = true;
|
|
725
|
+
reconciled.push(nextItem);
|
|
726
|
+
}
|
|
727
|
+
return changed ? reconciled : previousItems;
|
|
728
|
+
}
|
|
729
|
+
function assistantStopMessage(message) {
|
|
730
|
+
const stopReason = typeof message?.stopReason === "string" ? message.stopReason : "";
|
|
731
|
+
const errorMessage = typeof message?.errorMessage === "string" ? message.errorMessage.trim() : "";
|
|
732
|
+
if (stopReason === "aborted") return errorMessage && errorMessage !== "Request was aborted" ? errorMessage : "Operation aborted";
|
|
733
|
+
if (stopReason === "error") return `Error: ${errorMessage || "Unknown error"}`;
|
|
734
|
+
return "";
|
|
735
|
+
}
|
|
736
|
+
function assistantStopIsError(message) {
|
|
737
|
+
const stopReason = typeof message?.stopReason === "string" ? message.stopReason : "";
|
|
738
|
+
return stopReason === "aborted" || stopReason === "error";
|
|
739
|
+
}
|
|
740
|
+
function assistantModelFromMessage(message) {
|
|
741
|
+
const id = typeof message?.model === "string" ? message.model.trim() : "";
|
|
742
|
+
if (!id) return void 0;
|
|
743
|
+
const provider = typeof message?.provider === "string" ? message.provider.trim() : "";
|
|
744
|
+
return {
|
|
745
|
+
id,
|
|
746
|
+
...provider ? { provider } : {}
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
function assistantItemMetadataFromMessage(message) {
|
|
750
|
+
const model = assistantModelFromMessage(message);
|
|
751
|
+
return model ? { model } : {};
|
|
752
|
+
}
|
|
753
|
+
function applyAssistantStopToToolBlocks(blocks, stopMessage) {
|
|
754
|
+
let changed = false;
|
|
755
|
+
const nextBlocks = blocks.map((block) => {
|
|
756
|
+
if (block.type !== "tool" || block.output.trim()) return block;
|
|
757
|
+
changed = true;
|
|
758
|
+
return {
|
|
759
|
+
...block,
|
|
760
|
+
output: stopMessage,
|
|
761
|
+
isError: true,
|
|
762
|
+
running: false
|
|
763
|
+
};
|
|
764
|
+
});
|
|
765
|
+
return changed ? nextBlocks : blocks;
|
|
766
|
+
}
|
|
767
|
+
function assistantBlocksFromMessage(message, keyPrefix = "assistant") {
|
|
768
|
+
let blocks = [];
|
|
769
|
+
const toolBlockIndexByCallId = /* @__PURE__ */ new Map();
|
|
770
|
+
const content = Array.isArray(message?.content) ? message.content : [];
|
|
771
|
+
const stopMessage = assistantStopMessage(message);
|
|
772
|
+
const stopIsError = assistantStopIsError(message);
|
|
773
|
+
for (let index = 0; index < content.length; index += 1) {
|
|
774
|
+
const part = content[index];
|
|
775
|
+
const partKey = `${keyPrefix}:part:${index}`;
|
|
776
|
+
if (part?.type === "text") blocks.push({
|
|
777
|
+
type: "text",
|
|
778
|
+
blockKey: `${partKey}:text`,
|
|
779
|
+
text: part.text || ""
|
|
780
|
+
});
|
|
781
|
+
if (part?.type === "thinking") {
|
|
782
|
+
const thinkingText = part.thinking || "";
|
|
783
|
+
if (thinkingText.trim()) blocks.push({
|
|
784
|
+
type: "thinking",
|
|
785
|
+
blockKey: `${partKey}:thinking`,
|
|
786
|
+
text: thinkingText,
|
|
787
|
+
...typeof part.summaryLabel === "string" ? { summaryLabel: part.summaryLabel } : {}
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
if (part?.type === "toolCall") {
|
|
791
|
+
const callId = typeof part.id === "string" ? part.id.trim() : "";
|
|
792
|
+
const toolName = typeof part.name === "string" ? part.name : void 0;
|
|
793
|
+
const category = toolCategoryFromTool(toolName, part.arguments);
|
|
794
|
+
const toolBlock = {
|
|
795
|
+
type: "tool",
|
|
796
|
+
blockKey: callId ? `${keyPrefix}:tool:${callId}` : `${partKey}:tool`,
|
|
797
|
+
...callId ? { callId } : {},
|
|
798
|
+
...toolName ? { name: toolName } : {},
|
|
799
|
+
...category ? { category } : {},
|
|
800
|
+
args: part.arguments,
|
|
801
|
+
output: "",
|
|
802
|
+
details: void 0,
|
|
803
|
+
isError: false,
|
|
804
|
+
running: true
|
|
805
|
+
};
|
|
806
|
+
const existingIndex = callId ? toolBlockIndexByCallId.get(callId) : void 0;
|
|
807
|
+
const existingBlock = existingIndex !== void 0 ? blocks[existingIndex] : void 0;
|
|
808
|
+
if (existingIndex !== void 0 && existingBlock?.type === "tool") {
|
|
809
|
+
blocks[existingIndex] = {
|
|
810
|
+
...existingBlock,
|
|
811
|
+
...toolBlock.name ? { name: toolBlock.name } : {},
|
|
812
|
+
...toolBlock.category || existingBlock.category ? { category: toolBlock.category || existingBlock.category } : {},
|
|
813
|
+
args: toolBlock.args,
|
|
814
|
+
running: true
|
|
815
|
+
};
|
|
816
|
+
continue;
|
|
817
|
+
}
|
|
818
|
+
if (callId) toolBlockIndexByCallId.set(callId, blocks.length);
|
|
819
|
+
blocks.push(toolBlock);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
if (stopMessage) if (blocks.some((block) => block.type === "tool")) blocks = applyAssistantStopToToolBlocks(blocks, stopMessage);
|
|
823
|
+
else blocks.push({
|
|
824
|
+
type: "text",
|
|
825
|
+
blockKey: `${keyPrefix}:stop`,
|
|
826
|
+
text: stopMessage,
|
|
827
|
+
...stopIsError ? { isError: true } : {}
|
|
828
|
+
});
|
|
829
|
+
return blocks;
|
|
830
|
+
}
|
|
831
|
+
function createCompactionSummaryItem(summary, tokensBefore, itemKey = "compaction") {
|
|
832
|
+
return {
|
|
833
|
+
kind: "assistant",
|
|
834
|
+
itemKey,
|
|
835
|
+
blocks: [{
|
|
836
|
+
type: "compaction",
|
|
837
|
+
blockKey: `${itemKey}:compaction`,
|
|
838
|
+
summary: typeof summary === "string" ? summary : "",
|
|
839
|
+
tokensBefore: Number.isFinite(Number(tokensBefore)) ? Number(tokensBefore) : 0
|
|
840
|
+
}],
|
|
841
|
+
streaming: false
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
function mutateToolBlockInItems(items, callId, mutate) {
|
|
845
|
+
if (!callId) return;
|
|
846
|
+
for (let index = items.length - 1; index >= 0; index -= 1) {
|
|
847
|
+
const item = items[index];
|
|
848
|
+
if (item?.kind !== "assistant") continue;
|
|
849
|
+
const block = item.blocks.find((entry) => entry.type === "tool" && entry.callId === callId);
|
|
850
|
+
if (!block) continue;
|
|
851
|
+
mutate(block);
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
function applyToolResultToBlock(block, update) {
|
|
856
|
+
if (!update) return block;
|
|
857
|
+
if (block.output === update.output && block.details === update.details && block.isError === update.isError && !block.running) return block;
|
|
858
|
+
return {
|
|
859
|
+
...block,
|
|
860
|
+
output: update.output,
|
|
861
|
+
details: update.details,
|
|
862
|
+
isError: update.isError,
|
|
863
|
+
running: false
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
function applyToolResultsToBlocks(blocks, toolResultsByCallId) {
|
|
867
|
+
if (toolResultsByCallId.size === 0) return blocks;
|
|
868
|
+
let changed = false;
|
|
869
|
+
const nextBlocks = blocks.map((block) => {
|
|
870
|
+
if (block.type !== "tool" || !block.callId) return block;
|
|
871
|
+
const nextBlock = applyToolResultToBlock(block, toolResultsByCallId.get(block.callId));
|
|
872
|
+
if (nextBlock !== block) changed = true;
|
|
873
|
+
return nextBlock;
|
|
874
|
+
});
|
|
875
|
+
return changed ? nextBlocks : blocks;
|
|
876
|
+
}
|
|
877
|
+
function mergeAssistantBlocksForStreaming(options) {
|
|
878
|
+
const previousBlocks = options.previousBlocks ?? [];
|
|
879
|
+
const withToolResults = (blocks) => options.toolResultsByCallId ? applyToolResultsToBlocks(blocks, options.toolResultsByCallId) : blocks;
|
|
880
|
+
if (previousBlocks.length === 0) return withToolResults(options.nextBlocks);
|
|
881
|
+
const previousToolByCallId = /* @__PURE__ */ new Map();
|
|
882
|
+
previousBlocks.forEach((block) => {
|
|
883
|
+
if (block.type === "tool" && block.callId) previousToolByCallId.set(block.callId, block);
|
|
884
|
+
});
|
|
885
|
+
const nextToolCallIds = /* @__PURE__ */ new Set();
|
|
886
|
+
const mergedNextBlocks = options.nextBlocks.map((block, index) => {
|
|
887
|
+
if (block.type === "tool" && block.callId) {
|
|
888
|
+
nextToolCallIds.add(block.callId);
|
|
889
|
+
const previousTool = previousToolByCallId.get(block.callId);
|
|
890
|
+
if (previousTool) return {
|
|
891
|
+
...block,
|
|
892
|
+
renderKey: assistantBlockRenderKey(previousTool),
|
|
893
|
+
category: block.category || previousTool.category,
|
|
894
|
+
output: previousTool.output || block.output,
|
|
895
|
+
details: previousTool.details ?? block.details,
|
|
896
|
+
isError: previousTool.isError || block.isError,
|
|
897
|
+
running: previousTool.running === false ? false : block.running
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
const previousBlock = options.preserveBlockRenderKeysByIndex ? previousBlocks[index] : void 0;
|
|
901
|
+
if (previousBlock?.type === block.type) return withAssistantBlockRenderKey(block, previousBlock);
|
|
902
|
+
return block;
|
|
903
|
+
});
|
|
904
|
+
if (!options.preserveMissingTools) return withToolResults(mergedNextBlocks);
|
|
905
|
+
const missingPreviousTools = previousBlocks.map((block, index) => ({
|
|
906
|
+
block,
|
|
907
|
+
index
|
|
908
|
+
})).filter((entry) => entry.block.type === "tool" && Boolean(entry.block.callId) && !nextToolCallIds.has(entry.block.callId || ""));
|
|
909
|
+
if (missingPreviousTools.length === 0) return withToolResults(mergedNextBlocks);
|
|
910
|
+
const blocks = [];
|
|
911
|
+
let missingIndex = 0;
|
|
912
|
+
for (let index = 0; index < mergedNextBlocks.length; index += 1) {
|
|
913
|
+
while (missingIndex < missingPreviousTools.length && missingPreviousTools[missingIndex].index <= index) {
|
|
914
|
+
blocks.push(missingPreviousTools[missingIndex].block);
|
|
915
|
+
missingIndex += 1;
|
|
916
|
+
}
|
|
917
|
+
blocks.push(mergedNextBlocks[index]);
|
|
918
|
+
}
|
|
919
|
+
while (missingIndex < missingPreviousTools.length) {
|
|
920
|
+
blocks.push(missingPreviousTools[missingIndex].block);
|
|
921
|
+
missingIndex += 1;
|
|
922
|
+
}
|
|
923
|
+
return withToolResults(blocks);
|
|
924
|
+
}
|
|
925
|
+
function mergeStreamingAssistantBlocks(options) {
|
|
926
|
+
return mergeAssistantBlocksForStreaming({
|
|
927
|
+
previousBlocks: options.previousStreamingItem?.blocks,
|
|
928
|
+
nextBlocks: options.nextBlocks,
|
|
929
|
+
toolResultsByCallId: options.toolResultsByCallId,
|
|
930
|
+
preserveMissingTools: true
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
function appendAssistantItem(items, item) {
|
|
934
|
+
items.push(item);
|
|
935
|
+
return item;
|
|
936
|
+
}
|
|
937
|
+
function findStreamingAssistantItem(items) {
|
|
938
|
+
for (let index = items.length - 1; index >= 0; index -= 1) {
|
|
939
|
+
const item = items[index];
|
|
940
|
+
if (item?.kind === "assistant" && item.streaming) return item;
|
|
941
|
+
}
|
|
942
|
+
return null;
|
|
943
|
+
}
|
|
944
|
+
function isPendingConversationItem(item) {
|
|
945
|
+
return item.kind === "user" && (Boolean(item.pendingId) || item.itemKey?.startsWith("pending:"));
|
|
946
|
+
}
|
|
947
|
+
function isOptimisticPendingConversationItem(item) {
|
|
948
|
+
return item.kind === "user" && Boolean(item.pendingId?.startsWith("optimistic:"));
|
|
949
|
+
}
|
|
950
|
+
function sameUserPromptBody(left, right) {
|
|
951
|
+
return left.text === right.text && samePromptImages(left.images, right.images);
|
|
952
|
+
}
|
|
953
|
+
function hasMatchingCommittedUserItem(candidate, committedItems, previousIndex) {
|
|
954
|
+
const startIndex = Math.max(0, previousIndex);
|
|
955
|
+
for (let index = startIndex; index < committedItems.length; index += 1) {
|
|
956
|
+
const item = committedItems[index];
|
|
957
|
+
if (item?.kind !== "user") continue;
|
|
958
|
+
if (sameUserPromptBody(candidate, item)) return true;
|
|
959
|
+
}
|
|
960
|
+
return false;
|
|
961
|
+
}
|
|
962
|
+
function mergePendingItemsForSync(options) {
|
|
963
|
+
if (!options.preserveOptimisticItems) return [];
|
|
964
|
+
const mergedPendingItems = [];
|
|
965
|
+
for (const previousItem of pendingItemsFromPrevious(options.previousItems)) {
|
|
966
|
+
const previousIndex = options.previousItems.indexOf(previousItem);
|
|
967
|
+
if (hasMatchingCommittedUserItem(previousItem, options.committedItems, previousIndex)) continue;
|
|
968
|
+
mergedPendingItems.push(previousItem);
|
|
969
|
+
}
|
|
970
|
+
return mergedPendingItems;
|
|
971
|
+
}
|
|
972
|
+
function committedItemsFromPrevious(previousItems) {
|
|
973
|
+
return previousItems.filter((item) => {
|
|
974
|
+
if (isPendingConversationItem(item) || isQueuedConversationItem(item)) return false;
|
|
975
|
+
return !(item.kind === "assistant" && item.streaming);
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
function pendingItemsFromPrevious(previousItems) {
|
|
979
|
+
return previousItems.filter((item) => item.kind === "user" && isOptimisticPendingConversationItem(item) && !item.queued);
|
|
980
|
+
}
|
|
981
|
+
function isQueuedConversationItem(item) {
|
|
982
|
+
return item.kind === "user" && Boolean(item.queued);
|
|
983
|
+
}
|
|
984
|
+
function messageItemIndex(item) {
|
|
985
|
+
const match = item.itemKey?.match(/^message:(\d+)$/);
|
|
986
|
+
if (!match) return -1;
|
|
987
|
+
return Number(match[1]);
|
|
988
|
+
}
|
|
989
|
+
function nextMessageItemIndex(items) {
|
|
990
|
+
let maxIndex = -1;
|
|
991
|
+
for (const item of items) maxIndex = Math.max(maxIndex, messageItemIndex(item));
|
|
992
|
+
return maxIndex + 1;
|
|
993
|
+
}
|
|
994
|
+
function uniqueRenderKey(preferredKey, items) {
|
|
995
|
+
const existingRenderKeys = new Set(items.map((item) => conversationItemRenderKey(item)).filter(Boolean));
|
|
996
|
+
if (!existingRenderKeys.has(preferredKey)) return preferredKey;
|
|
997
|
+
let suffix = 1;
|
|
998
|
+
while (existingRenderKeys.has(`${preferredKey}:streaming:${suffix}`)) suffix += 1;
|
|
999
|
+
return `${preferredKey}:streaming:${suffix}`;
|
|
1000
|
+
}
|
|
1001
|
+
function streamingAssistantRenderKey(options) {
|
|
1002
|
+
const previousRenderKey = conversationItemRenderKey(options.previousStreamingItem || void 0);
|
|
1003
|
+
if (previousRenderKey && !options.items.some((item) => conversationItemRenderKey(item) === previousRenderKey)) return previousRenderKey;
|
|
1004
|
+
const optimisticUserCount = options.items.filter((item) => item.kind === "user" && isOptimisticPendingConversationItem(item)).length;
|
|
1005
|
+
const predictedAssistantIndex = (options.hasMessages ? options.messages.length : nextMessageItemIndex(options.items)) + optimisticUserCount;
|
|
1006
|
+
return uniqueRenderKey(`message:${Math.max(0, predictedAssistantIndex)}`, options.items);
|
|
1007
|
+
}
|
|
1008
|
+
function messageIsQueued(message) {
|
|
1009
|
+
const metadata = message?.metadata && typeof message.metadata === "object" ? message.metadata : void 0;
|
|
1010
|
+
return Boolean(message.queued || metadata?.queued);
|
|
1011
|
+
}
|
|
1012
|
+
function authoritativeItemsFromSync(sync) {
|
|
1013
|
+
if (!Array.isArray(sync.items)) return null;
|
|
1014
|
+
return sync.items.filter((item) => !isPendingConversationItem(item) && !isQueuedConversationItem(item));
|
|
1015
|
+
}
|
|
1016
|
+
function buildItemsFromSync(sync, previousItems = []) {
|
|
1017
|
+
const authoritativeItems = authoritativeItemsFromSync(sync);
|
|
1018
|
+
const hasAuthoritativeItems = Array.isArray(authoritativeItems);
|
|
1019
|
+
const hasMessages = Array.isArray(sync.messages);
|
|
1020
|
+
const hasPendingUserMessages = Array.isArray(sync.pendingUserMessages);
|
|
1021
|
+
const hasStreamingMessageUpdate = Object.prototype.hasOwnProperty.call(sync, "streamingMessage");
|
|
1022
|
+
const hasStreamingUpdate = typeof sync.streaming === "boolean" || hasStreamingMessageUpdate;
|
|
1023
|
+
if (!hasAuthoritativeItems && !hasMessages && !hasPendingUserMessages && !hasStreamingUpdate) return {
|
|
1024
|
+
items: previousItems,
|
|
1025
|
+
currentAssistantItem: findStreamingAssistantItem(previousItems)
|
|
1026
|
+
};
|
|
1027
|
+
if (authoritativeItems) {
|
|
1028
|
+
const streamingItems = authoritativeItems.filter((item) => item.kind === "assistant" && item.streaming);
|
|
1029
|
+
const items = authoritativeItems.filter((item) => !(item.kind === "assistant" && item.streaming));
|
|
1030
|
+
const preserveOptimisticItems = Boolean(sync.draft) || streamingItems.length > 0 || Boolean(sync.streaming);
|
|
1031
|
+
items.push(...mergePendingItemsForSync({
|
|
1032
|
+
previousItems,
|
|
1033
|
+
committedItems: items,
|
|
1034
|
+
preserveOptimisticItems
|
|
1035
|
+
}));
|
|
1036
|
+
items.push(...streamingItems);
|
|
1037
|
+
const reconciledItems = reconcileConversationItems(previousItems, items);
|
|
1038
|
+
return {
|
|
1039
|
+
items: reconciledItems,
|
|
1040
|
+
currentAssistantItem: findStreamingAssistantItem(reconciledItems)
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
const items = hasMessages ? [] : committedItemsFromPrevious(previousItems);
|
|
1044
|
+
const toolResultsByCallId = /* @__PURE__ */ new Map();
|
|
1045
|
+
const messages = Array.isArray(sync.messages) ? sync.messages : [];
|
|
1046
|
+
for (let index = 0; index < messages.length; index += 1) {
|
|
1047
|
+
const message = messages[index];
|
|
1048
|
+
const itemKey = `message:${index}`;
|
|
1049
|
+
if (message.role === "user") {
|
|
1050
|
+
if (messageIsQueued(message)) continue;
|
|
1051
|
+
items.push({
|
|
1052
|
+
kind: "user",
|
|
1053
|
+
itemKey,
|
|
1054
|
+
text: extractMessageText(message),
|
|
1055
|
+
images: extractMessageImages(message),
|
|
1056
|
+
streamingBehavior: normalizeStreamingBehavior(message.streamingBehavior ?? message.deliverAs ?? message?.metadata?.streamingBehavior ?? message?.metadata?.deliverAs)
|
|
1057
|
+
});
|
|
1058
|
+
continue;
|
|
1059
|
+
}
|
|
1060
|
+
if (message.role === "assistant") {
|
|
1061
|
+
appendAssistantItem(items, {
|
|
1062
|
+
kind: "assistant",
|
|
1063
|
+
itemKey,
|
|
1064
|
+
blocks: assistantBlocksFromMessage(message, itemKey),
|
|
1065
|
+
streaming: false,
|
|
1066
|
+
...assistantItemMetadataFromMessage(message)
|
|
1067
|
+
});
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
if (message.role === "compactionSummary") {
|
|
1071
|
+
items.push(createCompactionSummaryItem(message.summary, message.tokensBefore, itemKey));
|
|
1072
|
+
continue;
|
|
1073
|
+
}
|
|
1074
|
+
if (message.role === "toolResult") {
|
|
1075
|
+
const callId = typeof message.toolCallId === "string" ? message.toolCallId.trim() : "";
|
|
1076
|
+
const update = {
|
|
1077
|
+
output: extractMessageText(message),
|
|
1078
|
+
details: message.details,
|
|
1079
|
+
isError: Boolean(message.isError)
|
|
1080
|
+
};
|
|
1081
|
+
if (callId) toolResultsByCallId.set(callId, update);
|
|
1082
|
+
mutateToolBlockInItems(items, callId, (block) => {
|
|
1083
|
+
block.output = update.output;
|
|
1084
|
+
block.details = update.details;
|
|
1085
|
+
block.isError = update.isError;
|
|
1086
|
+
block.running = false;
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
const previousStreamingItem = findStreamingAssistantItem(previousItems);
|
|
1091
|
+
const shouldRenderStreaming = typeof sync.streaming === "boolean" ? sync.streaming : sync.streamingMessage != null ? true : Boolean(previousStreamingItem);
|
|
1092
|
+
if (shouldRenderStreaming) for (let index = items.length - 1; index >= 0; index -= 1) {
|
|
1093
|
+
const item = items[index];
|
|
1094
|
+
if (item?.kind !== "assistant") continue;
|
|
1095
|
+
items[index] = {
|
|
1096
|
+
...item,
|
|
1097
|
+
done: false
|
|
1098
|
+
};
|
|
1099
|
+
break;
|
|
1100
|
+
}
|
|
1101
|
+
const pendingItems = mergePendingItemsForSync({
|
|
1102
|
+
previousItems,
|
|
1103
|
+
committedItems: items,
|
|
1104
|
+
preserveOptimisticItems: Boolean(sync.draft) || shouldRenderStreaming
|
|
1105
|
+
});
|
|
1106
|
+
items.push(...pendingItems);
|
|
1107
|
+
if (shouldRenderStreaming) if (sync.streamingMessage?.role === "assistant") {
|
|
1108
|
+
const renderKey = streamingAssistantRenderKey({
|
|
1109
|
+
hasMessages,
|
|
1110
|
+
messages,
|
|
1111
|
+
items,
|
|
1112
|
+
previousStreamingItem
|
|
1113
|
+
});
|
|
1114
|
+
items.push({
|
|
1115
|
+
kind: "assistant",
|
|
1116
|
+
itemKey: "streaming",
|
|
1117
|
+
renderKey,
|
|
1118
|
+
blocks: mergeStreamingAssistantBlocks({
|
|
1119
|
+
previousStreamingItem,
|
|
1120
|
+
nextBlocks: assistantBlocksFromMessage(sync.streamingMessage, renderKey),
|
|
1121
|
+
toolResultsByCallId
|
|
1122
|
+
}),
|
|
1123
|
+
streaming: true,
|
|
1124
|
+
done: false,
|
|
1125
|
+
...assistantItemMetadataFromMessage(sync.streamingMessage)
|
|
1126
|
+
});
|
|
1127
|
+
} else if (previousStreamingItem && !hasStreamingMessageUpdate) {
|
|
1128
|
+
const blocks = applyToolResultsToBlocks(previousStreamingItem.blocks, toolResultsByCallId);
|
|
1129
|
+
items.push(blocks === previousStreamingItem.blocks ? previousStreamingItem : {
|
|
1130
|
+
...previousStreamingItem,
|
|
1131
|
+
blocks
|
|
1132
|
+
});
|
|
1133
|
+
} else {
|
|
1134
|
+
const renderKey = streamingAssistantRenderKey({
|
|
1135
|
+
hasMessages,
|
|
1136
|
+
messages,
|
|
1137
|
+
items,
|
|
1138
|
+
previousStreamingItem
|
|
1139
|
+
});
|
|
1140
|
+
items.push({
|
|
1141
|
+
kind: "assistant",
|
|
1142
|
+
itemKey: "streaming",
|
|
1143
|
+
renderKey,
|
|
1144
|
+
blocks: mergeStreamingAssistantBlocks({
|
|
1145
|
+
previousStreamingItem,
|
|
1146
|
+
nextBlocks: [],
|
|
1147
|
+
toolResultsByCallId
|
|
1148
|
+
}),
|
|
1149
|
+
streaming: true,
|
|
1150
|
+
done: false
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
const reconciledItems = reconcileConversationItems(previousItems, items);
|
|
1154
|
+
return {
|
|
1155
|
+
items: reconciledItems,
|
|
1156
|
+
currentAssistantItem: findStreamingAssistantItem(reconciledItems)
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
function sanitizeThinkingSummaryText(value) {
|
|
1160
|
+
if (typeof value !== "string") return "";
|
|
1161
|
+
let text = value.replace(/\r\n?/g, "\n");
|
|
1162
|
+
text = text.replace(/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g, (_match, altText) => altText || "image");
|
|
1163
|
+
text = text.replace(/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g, "$1");
|
|
1164
|
+
text = text.replace(/```([\s\S]*?)```/g, "$1");
|
|
1165
|
+
text = text.replace(/`([^`]+)`/g, "$1");
|
|
1166
|
+
text = text.replace(/\*\*([^*]+)\*\*/g, "$1");
|
|
1167
|
+
text = text.replace(/__([^_]+)__/g, "$1");
|
|
1168
|
+
text = text.replace(/\*([^*\n]+)\*/g, "$1");
|
|
1169
|
+
text = text.replace(/_([^_\n]+)_/g, "$1");
|
|
1170
|
+
text = text.replace(/^\s{0,3}#{1,6}\s+/gm, "");
|
|
1171
|
+
text = text.replace(/^\s*>\s?/gm, "");
|
|
1172
|
+
text = text.replace(/^\s*[-*+]\s+/gm, "");
|
|
1173
|
+
text = text.replace(/^\s*\d+\.\s+/gm, "");
|
|
1174
|
+
text = text.replace(/\/var\/folders\/[^\s)]*\/pi-clipboard-[A-Za-z0-9-]+\.(?:png|jpe?g|gif|webp)\b/gi, "pasted image");
|
|
1175
|
+
text = text.replace(/\s+/g, " ").trim();
|
|
1176
|
+
return text;
|
|
1177
|
+
}
|
|
1178
|
+
function primaryThinkingSummaryText(value) {
|
|
1179
|
+
if (typeof value !== "string") return "";
|
|
1180
|
+
const normalized = value.replace(/\r\n?/g, "\n");
|
|
1181
|
+
const paragraphs = normalized.split(/\n\s*\n+/).map((part) => sanitizeThinkingSummaryText(part)).filter(Boolean);
|
|
1182
|
+
if (paragraphs.length) return paragraphs[0] || "";
|
|
1183
|
+
return sanitizeThinkingSummaryText(normalized);
|
|
1184
|
+
}
|
|
1185
|
+
function meaningfulHiddenThinkingLabel(value) {
|
|
1186
|
+
const label = sanitizeThinkingSummaryText(value);
|
|
1187
|
+
return label && label !== "Thinking..." && label !== "Thinking" ? label : void 0;
|
|
1188
|
+
}
|
|
1189
|
+
function truncateThinkingSummary(text, maxLength = 140) {
|
|
1190
|
+
const normalized = text.replace(/\s+/g, " ").trim();
|
|
1191
|
+
if (!normalized) return "";
|
|
1192
|
+
if (normalized.length <= maxLength) return normalized;
|
|
1193
|
+
return `${normalized.slice(0, Math.max(0, maxLength - 1)).trimEnd()}…`;
|
|
1194
|
+
}
|
|
1195
|
+
function thinkingSummaryText(block, options = {}) {
|
|
1196
|
+
const blockLabel = meaningfulHiddenThinkingLabel(block?.summaryLabel);
|
|
1197
|
+
if (blockLabel) return truncateThinkingSummary(blockLabel);
|
|
1198
|
+
const text = primaryThinkingSummaryText(block?.text);
|
|
1199
|
+
if (!text) return options.allowPlaceholder ? "Thinking…" : "";
|
|
1200
|
+
return truncateThinkingSummary(text);
|
|
1201
|
+
}
|
|
1202
|
+
function createInitialSessionState() {
|
|
1203
|
+
return {
|
|
1204
|
+
connected: false,
|
|
1205
|
+
replaying: false,
|
|
1206
|
+
streaming: false,
|
|
1207
|
+
compacting: false,
|
|
1208
|
+
draft: true,
|
|
1209
|
+
messages: [],
|
|
1210
|
+
items: [],
|
|
1211
|
+
historyOffset: 0,
|
|
1212
|
+
historyTotalCount: 0,
|
|
1213
|
+
firstMessage: "",
|
|
1214
|
+
thinkingLevel: "off",
|
|
1215
|
+
availableThinkingLevels: ["off"],
|
|
1216
|
+
availableModels: [],
|
|
1217
|
+
availableSkills: [],
|
|
1218
|
+
hideThinkingBlock: false,
|
|
1219
|
+
contextUsage: void 0,
|
|
1220
|
+
uiState: {
|
|
1221
|
+
statuses: {},
|
|
1222
|
+
editorText: ""
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
}
|
|
1226
|
+
function flattenTree(tree) {
|
|
1227
|
+
const flatNodes = [];
|
|
1228
|
+
function visit(node, depth) {
|
|
1229
|
+
const entry = node.entry;
|
|
1230
|
+
const role = entry.message?.role;
|
|
1231
|
+
const label = node.label;
|
|
1232
|
+
const contentParts = [
|
|
1233
|
+
label,
|
|
1234
|
+
role ? `${role}:` : "",
|
|
1235
|
+
entry.message?.text,
|
|
1236
|
+
entry.summary,
|
|
1237
|
+
entry.text,
|
|
1238
|
+
entry.message?.command,
|
|
1239
|
+
entry.modelId,
|
|
1240
|
+
entry.thinkingLevel,
|
|
1241
|
+
entry.name,
|
|
1242
|
+
entry.label,
|
|
1243
|
+
...entry.message?.toolCalls?.map((toolCall) => toolCall.preview || toolCall.name || "") ?? []
|
|
1244
|
+
];
|
|
1245
|
+
flatNodes.push({
|
|
1246
|
+
id: entry.id,
|
|
1247
|
+
parentId: entry.parentId,
|
|
1248
|
+
depth,
|
|
1249
|
+
label,
|
|
1250
|
+
labelTimestamp: node.labelTimestamp,
|
|
1251
|
+
streaming: Boolean(node.streaming),
|
|
1252
|
+
timestamp: entry.timestamp,
|
|
1253
|
+
type: entry.type,
|
|
1254
|
+
role,
|
|
1255
|
+
text: contentParts.filter(Boolean).join(" ").trim(),
|
|
1256
|
+
node
|
|
1257
|
+
});
|
|
1258
|
+
for (const child of node.children || []) visit(child, depth + 1);
|
|
1259
|
+
}
|
|
1260
|
+
for (const node of tree) visit(node, 0);
|
|
1261
|
+
return flatNodes;
|
|
1262
|
+
}
|
|
1263
|
+
function getSessionTitle(summary) {
|
|
1264
|
+
if (summary?.title?.trim()) return summary.title.trim();
|
|
1265
|
+
if (summary?.name?.trim()) return summary.name.trim();
|
|
1266
|
+
return "New session";
|
|
1267
|
+
}
|
|
1268
|
+
var $$splitComponentImporter = () => import("./routes-C7oV8l68.mjs");
|
|
1269
|
+
var indexSearchSchema = object({ session: string().optional() });
|
|
1270
|
+
var Route = createFileRoute("/")({
|
|
1271
|
+
validateSearch: indexSearchSchema,
|
|
1272
|
+
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
1273
|
+
});
|
|
1274
|
+
//#endregion
|
|
1275
|
+
export { sameContextUsage as $, extractToolText as A, readStoredAutoScrollEnabled as B, buildItemsFromSync as C, createInitialSessionState as D, createContextId as E, normalizeSessionSelectionKeys as F, readStoredPromptDraft as G, readStoredCollapsedDirectories as H, normalizeStoredDirectoryList as I, readStoredSessionDoneDesktopNotificationsEnabled as J, readStoredRecentDirectories as K, normalizeThemeMode as L, getSessionTitle as M, mergeAssistantBlocksForStreaming as N, extractMessageImages as O, normalizePromptImage as P, safeLocalStorageSetItem as Q, previewUrlForImage as R, assistantBlocksFromMessage as S, createCompactionSummaryItem as T, readStoredDraftDirectory as U, readStoredCenterMessages as V, readStoredHideToolBlocks as W, readStoredSidebarDirectories as X, readStoredSessionDoneSoundEnabled as Y, rememberStoredPromptDraft as Z, Tooltip$1 as _, HIDE_TOOL_BLOCKS_STORAGE_KEY as a, TooltipTrigger as b, RECENT_DIRECTORIES_STORAGE_KEY as c, SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY as d, sessionListEntryKey as et, SESSION_DONE_SOUND_ENABLED_STORAGE_KEY as f, TitleTooltip as g, THEME_STORAGE_KEY as h, DRAFT_DIRECTORY_STORAGE_KEY as i, flattenTree as j, extractMessageText as k, RIGHT_SIDEBAR_OPEN_STORAGE_KEY as l, Spinner as m, CENTER_MESSAGES_STORAGE_KEY as n, toolCategoryFromTool as nt, Kbd as o, SIDEBAR_DIRECTORIES_STORAGE_KEY as p, readStoredRightSidebarOpen as q, COLLAPSED_DIRECTORIES_STORAGE_KEY as r, KeyboardShortcutContent as s, AUTO_SCROLL_ENABLED_STORAGE_KEY as t, thinkingSummaryText as tt, Route as u, TooltipContent as v, cn as w, VIEWER_CONTEXT_STORAGE_KEY as x, TooltipProvider as y, promptDraftKey as z };
|