@kabmo-labs/kabmo 0.46.1 → 0.48.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/dist/client/index.html +1 -1
- package/dist/client/index.js +506 -502
- package/dist/client/static/js/Body-3tspyjtk.js +3 -0
- package/dist/client/static/js/{CsvGrid-qdkmv8bj.js → CsvGrid-3pwsfmxp.js} +2 -2
- package/dist/client/static/js/{DocxView-k84ns803.js → DocxView-xcg9jktb.js} +3 -3
- package/dist/client/static/js/{DrawioView-r1n717f7.js → DrawioView-2q19tgkx.js} +2 -2
- package/dist/client/static/js/HtmlPreview-92cadvbr.js +1 -0
- package/dist/client/static/js/ImageView-pr4h38hb.js +1 -0
- package/dist/client/static/js/LayoutWrapper-n4tzhjes.js +2 -0
- package/dist/client/static/js/MergeDiffView-0t15nh9f.js +1 -0
- package/dist/client/static/js/{Modal-xe6h99jn.js → Modal-77hgx4dw.js} +20 -20
- package/dist/client/static/js/{PdfView-ffg4mccg.js → PdfView-gzxhvxe8.js} +1 -1
- package/dist/client/static/js/{SessionsView-cdcbsee9.js → SessionsView-2tdqrvk0.js} +1 -1
- package/dist/client/static/js/{SheetView-89sscpz6.js → SheetView-w5w2m2de.js} +22 -22
- package/dist/client/static/js/{SvgPreview-68c0ccbv.js → SvgPreview-mtk6de6h.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-h3a5s259.js → abnfDiagram-O67JEVCF-tha4j2fn.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-zs15nydj.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-983p0jgn.js → architectureDiagram-NJMV4G6O-heep78p6.js} +6 -6
- package/dist/client/static/js/{astro-hyj5wege.js → astro-r4dp34pw.js} +1 -1
- package/dist/client/static/js/bash-8d3wrx5c.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-16pse5mh.js → blockDiagram-BEXU5L5S-6mzgfqh8.js} +5 -5
- package/dist/client/static/js/c-rn3z0csz.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-mvnb00zt.js → c4Diagram-YGBWAQC7-sfkcw7g9.js} +4 -4
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-kmpd91xb.js → classDiagram-v2-NBCMYWYE-v530ny5e.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-3ek5r5se.js → cose-bilkent-JH36ORCC-ybv1ttbx.js} +1 -1
- package/dist/client/static/js/cpp-99ws9nak.js +1 -0
- package/dist/client/static/js/css-narcr42w.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-p3y1b4ap.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-jkbh84zn.js → cynefinDiagram-VND7K2PF-k8f3z0mm.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-4fdc0sgn.js → dagre-6A5THRUB-gk0gp124.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-hbk61nq9.js → diagram-22UHCM2B-2zh2957c.js} +15 -15
- package/dist/client/static/js/{diagram-3UASUU5V-hfpbr9qh.js → diagram-3UASUU5V-bzstt5e2.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-fn0nt71a.js → diagram-ATOU4E4O-16adx4g0.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-ssswxjeb.js → diagram-CDSNMT55-1ja98ens.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-whnzxv6f.js → diagram-MLGK6HIB-f9nnyjbq.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-hk1chzxk.js → diagram-MPIPVDR6-3qgadfjz.js} +2 -2
- package/dist/client/static/js/{dockerfile-zmsj8r4g.js → dockerfile-04tc68pq.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-q1vkg5mr.js → ebnfDiagram-ZINNZB2B-022cz603.js} +1 -1
- package/dist/client/static/js/{elixir-80wq7gak.js → elixir-61gbjv6c.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-kt98vg8j.js → elk-276RUBZZ-2anf1c36.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-ey3avsn9.js → erDiagram-OPXOYQCR-ndd27fz1.js} +7 -7
- package/dist/client/static/js/{erlang-814e8qy5.js → erlang-bh5cbm8m.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-sx2cwkz3.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-dsc17mty.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-a9k1at43.js → ganttDiagram-FUAMR5RP-9gm6hkgn.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-yqhbscsd.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-gnekjfym.js → gitGraphDiagram-X574FWY7-78bxa67c.js} +8 -8
- package/dist/client/static/js/graphql-tr0jcndy.js +1 -0
- package/dist/client/static/js/html-n8fdvrdk.js +1 -0
- package/dist/client/static/js/index-0e51wknc.js +10 -0
- package/dist/client/static/js/{index-z25ss7xj.js → index-13g17wa3.js} +1 -1
- package/dist/client/static/js/index-1hb8fvw9.js +1 -0
- package/dist/client/static/js/{index-1c2jvnyh.js → index-2bsnywea.js} +2 -2
- package/dist/client/static/js/{index-g7s0wsag.js → index-2n1fgpjv.js} +2 -2
- package/dist/client/static/js/{index-3x7h2eqj.js → index-30a8py59.js} +2 -2
- package/dist/client/static/js/{index-qf3y3ahx.js → index-34aq5bz5.js} +2 -2
- package/dist/client/static/js/index-3en15m75.js +2 -0
- package/dist/client/static/js/{index-nw5mvcaj.js → index-417fbrqk.js} +2 -2
- package/dist/client/static/js/{index-z4530r3c.js → index-45p59fxq.js} +2 -2
- package/dist/client/static/js/index-4n7t26ap.js +2 -0
- package/dist/client/static/js/{index-kty4ncsr.js → index-55pqvh82.js} +2 -2
- package/dist/client/static/js/index-5mpv57fn.js +12 -0
- package/dist/client/static/js/{index-x9r7zfp4.js → index-7pz6n3pg.js} +2 -2
- package/dist/client/static/js/{index-1ax52p0q.js → index-7whstwc7.js} +2 -2
- package/dist/client/static/js/index-869vdnz8.js +2 -0
- package/dist/client/static/js/{index-fzngzhww.js → index-8tvrzce0.js} +2 -2
- package/dist/client/static/js/index-9a78xmkk.js +462 -0
- package/dist/client/static/js/{index-33qxg79j.js → index-a58rkn3f.js} +5 -5
- package/dist/client/static/js/{index-60v30k5h.js → index-aa3hmn6j.js} +64 -64
- package/dist/client/static/js/{index-wrcdc9vz.js → index-aabp7nt6.js} +1 -1
- package/dist/client/static/js/{index-64sqfr4a.js → index-abrrqhne.js} +2 -2
- package/dist/client/static/js/{index-9vv7wr1n.js → index-ac2q5903.js} +2 -2
- package/dist/client/static/js/index-axtm1aq8.js +2 -0
- package/dist/client/static/js/index-b2cs4c51.js +4 -0
- package/dist/client/static/js/{index-8g7q8mz4.js → index-c250nzm1.js} +3 -3
- package/dist/client/static/js/{index-abs635a1.js → index-dxnkwf39.js} +48 -48
- package/dist/client/static/js/{index-kbhrvep8.js → index-e6ny4gd9.js} +6 -6
- package/dist/client/static/js/index-ebf50mrs.js +9 -0
- package/dist/client/static/js/{index-trvqvb1v.js → index-ep6bqcmg.js} +2 -2
- package/dist/client/static/js/{index-qfxn7yh5.js → index-fb2s080r.js} +2 -2
- package/dist/client/static/js/index-fryp0kgf.js +2 -0
- package/dist/client/static/js/{index-2ks0m8ss.js → index-g3rg6vsd.js} +2 -2
- package/dist/client/static/js/{index-sa1675y0.js → index-g8rpydkr.js} +2 -2
- package/dist/client/static/js/{index-bsr7wmj2.js → index-gkmn4y1v.js} +1 -1
- package/dist/client/static/js/{index-xq5f3nxa.js → index-gpmcth0x.js} +2 -2
- package/dist/client/static/js/{index-e9cxje00.js → index-hcmhdpp4.js} +10 -10
- package/dist/client/static/js/{index-kb14dhrx.js → index-he4k2j91.js} +2 -2
- package/dist/client/static/js/{index-wbws16ag.js → index-hq28918s.js} +2 -2
- package/dist/client/static/js/{index-84fyq5a6.js → index-hwzxdwwg.js} +1 -1
- package/dist/client/static/js/{index-2a6qp9y6.js → index-jnkc9p53.js} +1 -1
- package/dist/client/static/js/{index-pavvxrsz.js → index-k39be93q.js} +1 -1
- package/dist/client/static/js/{index-c9e417cs.js → index-kaxvwh07.js} +2 -2
- package/dist/client/static/js/{index-ykm7a3cp.js → index-kjr68pcj.js} +2 -2
- package/dist/client/static/js/{index-b5dfvget.js → index-m0fatq7c.js} +4 -4
- package/dist/client/static/js/{index-atq9q1s7.js → index-m39gbcxn.js} +1 -1
- package/dist/client/static/js/{index-hnb66d3s.js → index-mqzgf7rw.js} +2 -2
- package/dist/client/static/js/{index-5wz0y88c.js → index-pzsp1src.js} +2 -2
- package/dist/client/static/js/{index-yf93db65.js → index-qe0vfv6s.js} +1 -1
- package/dist/client/static/js/{index-q9ytjey8.js → index-qek9mt5w.js} +1 -1
- package/dist/client/static/js/{index-d23eacf2.js → index-qxzj780x.js} +2 -2
- package/dist/client/static/js/index-rgxg0azs.css +1 -0
- package/dist/client/static/js/{index-m4k054wz.js → index-rq4dk4tp.js} +4 -4
- package/dist/client/static/js/{index-fj5rsp5v.js → index-seekt5k3.js} +2 -2
- package/dist/client/static/js/{index-561gkvve.js → index-sng4prpr.js} +2 -2
- package/dist/client/static/js/{index-vjmg7kn5.js → index-t4s10406.js} +2 -2
- package/dist/client/static/js/{index-b2e5pwx7.js → index-tzz5gp8a.js} +5 -5
- package/dist/client/static/js/index-vnv9z0a1.js +1 -0
- package/dist/client/static/js/{index-19x11s5w.js → index-x7rajphe.js} +2 -2
- package/dist/client/static/js/{index-dxvtjn6a.js → index-xny7vsfz.js} +2 -2
- package/dist/client/static/js/index-xr4hjv01.js +2 -0
- package/dist/client/static/js/{index-65afr75v.js → index-ya9yqj5w.js} +2 -2
- package/dist/client/static/js/{index-z0fkfphe.js → index-zcgqacvx.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-0sd3zzgg.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-r1p25738.js → infoDiagram-VRGFBTTK-bxk0g0pe.js} +2 -2
- package/dist/client/static/js/ini-tnaw7zjy.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-afgrqdrt.js → ishikawaDiagram-OU5B5YK6-d1kdkhth.js} +3 -3
- package/dist/client/static/js/java-m4dpc2vw.js +1 -0
- package/dist/client/static/js/javascript-8y26t991.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-hepa4wk7.js → journeyDiagram-ZHPQQLJL-cahg3zjq.js} +4 -4
- package/dist/client/static/js/json-azm7bdqd.js +1 -0
- package/dist/client/static/js/jsx-p9j1k773.js +1 -0
- package/dist/client/static/js/{julia-yv2j8qd0.js → julia-2n5k898q.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-jysft8ya.js → kanban-definition-PNTS6WVX-nq7t83en.js} +6 -6
- package/dist/client/static/js/lua-hbm9rhz9.js +1 -0
- package/dist/client/static/js/markdown-tk3cd3vs.js +1 -0
- package/dist/client/static/js/{mermaid.core-0m90b0s8.js → mermaid.core-6nw0853j.js} +8 -8
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-x2rrzpvr.js → mindmap-definition-NLK3R4M7-cm7ykxf2.js} +3 -3
- package/dist/client/static/js/one-dark-pro-2cdc2nk7.js +1 -0
- package/dist/client/static/js/one-light-bt6z4jf0.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-13w2v5bb.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-z7vb7f1z.js → pegDiagram-GJSIUBJH-xwxz8nsq.js} +1 -1
- package/dist/client/static/js/{perl-917pjq5a.js → perl-66vb5pz7.js} +1 -1
- package/dist/client/static/js/{php-hwz75qzt.js → php-4e9we8am.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-swtnysgn.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-jqv6v4e6.js → pieDiagram-5QR66LMP-n910k9th.js} +3 -3
- package/dist/client/static/js/properties-6911ckw7.js +1 -0
- package/dist/client/static/js/python-44cvj250.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-w2h8yxrv.js → quadrantDiagram-O4NWA36T-dxkwxbqb.js} +6 -6
- package/dist/client/static/js/r-t3sepzm4.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-vtvxkx55.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-5sp2d63r.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-kg706fan.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-4ra1gzx5.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-hms3zpjm.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-nd09yac3.js → railroadDiagram-XR7U4H2S-xb1smt7r.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-t61zxh5v.js → requirementDiagram-PLB6GJNP-6kb21b9f.js} +6 -6
- package/dist/client/static/js/{ruby-er7ayhte.js → ruby-v7nmcvyr.js} +1 -1
- package/dist/client/static/js/{rust-avnkhh0p.js → rust-5ersd7be.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2f7h2cmw.js → sankeyDiagram-IPEJSGJF-74z0fskw.js} +4 -4
- package/dist/client/static/js/{sass-n47tt136.js → sass-h3nvy4c8.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-kfb5d7zd.js → sequenceDiagram-PO4LG4MO-apn6kezn.js} +17 -17
- package/dist/client/static/js/{sizeCapture-INFHLROL-amfg19se.js → sizeCapture-INFHLROL-2drzcjb8.js} +1 -1
- package/dist/client/static/js/sql-zdkawqx3.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-k5hx7btx.js → stateDiagram-v2-GCMORJYK-ma09vhby.js} +3 -3
- package/dist/client/static/js/{svelte-2pmz35vx.js → svelte-dhspkgss.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-wv3rp8kk.js → swimlanes-2SLR337P-f6y9xqnx.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3dwas56m.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-0re95wtn.js → timeline-definition-EJHVYXUP-zmcmvq00.js} +5 -5
- package/dist/client/static/js/treeView-Q6P3EWNA-7t5k6rs2.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-w56ry3bg.js +1 -0
- package/dist/client/static/js/tsx-b7eabr17.js +1 -0
- package/dist/client/static/js/typescript-nnkvhwfy.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-yrje14qp.js → usecaseDiagram-POWQR4AR-wfaa019a.js} +24 -24
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-jxkmrfy5.js → vennDiagram-UO4OBE2U-46wf2pgd.js} +8 -8
- package/dist/client/static/js/{vue-d5gpjfgn.js → vue-ffngx2b3.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-rtjb9kgv.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-d3v2m9b1.js → wardleyDiagram-VNRHLVJA-10ph3bzq.js} +4 -4
- package/dist/client/static/js/xml-xy1tw6b2.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9a1s1rjt.js → xychartDiagram-PMCCYNJV-2ba825z9.js} +5 -5
- package/dist/client/static/js/yaml-0fexqg2d.js +1 -0
- package/marketplace/marketplace.json +34 -7
- package/marketplace/plugins/kanban/README.md +143 -0
- package/marketplace/plugins/kanban/icon.svg +5 -0
- package/marketplace/plugins/kanban/package.json +30 -0
- package/marketplace/plugins/kanban/src/app.tsx +34 -0
- package/marketplace/plugins/kanban/src/mcp-tools.ts +296 -0
- package/marketplace/plugins/kanban/src/mcp.test.ts +199 -0
- package/marketplace/plugins/kanban/src/mcp.ts +148 -0
- package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +319 -0
- package/marketplace/plugins/kanban/src/panel/CardTile.tsx +97 -0
- package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +116 -0
- package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +249 -0
- package/marketplace/plugins/kanban/src/panel/catalogs.ts +114 -0
- package/marketplace/plugins/kanban/src/panel/index.tsx +327 -0
- package/marketplace/plugins/kanban/src/panel/panel.test.ts +219 -0
- package/marketplace/plugins/kanban/src/panel/start-work.ts +132 -0
- package/marketplace/plugins/kanban/src/panel/use-board.ts +148 -0
- package/marketplace/plugins/kanban/src/panel/use-card-detail.ts +70 -0
- package/marketplace/plugins/kanban/src/panel/use-writes.ts +123 -0
- package/marketplace/plugins/kanban/src/protocol.ts +180 -0
- package/marketplace/plugins/kanban/src/server.test.ts +113 -0
- package/marketplace/plugins/kanban/src/server.ts +227 -0
- package/marketplace/plugins/kanban/src/store/board.test.ts +311 -0
- package/marketplace/plugins/kanban/src/store/board.ts +147 -0
- package/marketplace/plugins/kanban/src/store/cards.ts +228 -0
- package/marketplace/plugins/kanban/src/store/fs.ts +159 -0
- package/marketplace/plugins/kanban/src/store/ops.ts +245 -0
- package/marketplace/plugins/kanban/src/store/resolve.test.ts +82 -0
- package/marketplace/plugins/kanban/src/store/resolve.ts +135 -0
- package/marketplace/plugins/kanban/tsconfig.json +26 -0
- package/package.json +2 -2
- package/src/client/components/common/file-icon/index.tsx +1 -1
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +12 -3
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +34 -7
- package/src/client/components/layout/desktop-layout/index.tsx +17 -22
- package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +2 -0
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +11 -3
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.test.tsx +21 -0
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +8 -4
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +8 -2
- package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +15 -4
- package/src/client/components/settings/categories/usage-settings/LimitsSection.tsx +10 -3
- package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +27 -4
- package/src/client/components/settings/categories/usage-settings/TokenHarborCard.tsx +160 -0
- package/src/client/components/settings/categories/usage-settings/TokenPortalCard.tsx +104 -0
- package/src/client/components/settings/categories/usage-settings/format.ts +35 -0
- package/src/client/components/settings/categories/usage-settings/limits-section.test.tsx +16 -0
- package/src/client/components/settings/categories/usage-settings/providers.ts +26 -4
- package/src/client/components/settings/categories/usage-settings/token-harbor-card.test.tsx +114 -0
- package/src/client/components/settings/categories/usage-settings/token-harbor-hint.test.ts +68 -0
- package/src/client/components/settings/categories/usage-settings/token-portal-card.test.tsx +81 -0
- package/src/client/components/settings/categories/usage-settings/usage-and-picker.test.ts +66 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +21 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +7 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.test.ts +13 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.tsx +41 -18
- package/src/client/components/workspace/editor/BodyLazy.tsx +40 -0
- package/src/client/components/workspace/editor/FilePane.tsx +4 -2
- package/src/client/components/workspace/editor/Tabs.tsx +7 -1
- package/src/client/components/workspace/editor/Toolbar.tsx +7 -1
- package/src/client/components/workspace/editor/chrome-rows.test.tsx +126 -0
- package/src/client/components/workspace/editor/index.tsx +2 -2
- package/src/client/components/workspace/editor/viewers/HtmlPreview.test.tsx +94 -0
- package/src/client/components/workspace/editor/viewers/HtmlPreview.tsx +71 -0
- package/src/client/components/workspace/editor/viewers/bytes.ts +1 -1
- package/src/client/components/workspace/editor/viewers/dispatch.tsx +18 -2
- package/src/client/components/workspace/editor/viewers/viewers.test.ts +14 -1
- package/src/client/components/workspace/panel-header/index.test.tsx +2 -1
- package/src/client/components/workspace/panel-header/index.tsx +6 -4
- package/src/client/data/settings/omp-schema.json +33 -10
- package/src/client/hooks/editor/resolve-viewer.ts +1 -1
- package/src/client/hooks/editor/use-editor-drop.ts +14 -0
- package/src/client/hooks/editor/use-editor-tab-state.ts +5 -4
- package/src/client/hooks/ui/media-query.ts +27 -0
- package/src/client/hooks/workspace/file-tabs.ts +10 -0
- package/src/client/hooks/workspace/right-panel-presence.test.ts +152 -0
- package/src/client/hooks/workspace/right-panel-presence.ts +119 -0
- package/src/client/lib/router/search-params.test.ts +83 -0
- package/src/client/lib/router/search-params.ts +14 -3
- package/src/server/lib/mcp/session-mcp.test.ts +64 -1
- package/src/server/lib/mcp/session-overlay.server.ts +7 -4
- package/src/server/lib/omp/rpc/constants.test.ts +31 -0
- package/src/server/lib/omp/rpc/constants.ts +19 -0
- package/src/server/lib/omp/rpc/session-new.ts +78 -0
- package/src/server/lib/omp/rpc/session-registry.ts +22 -49
- package/src/server/lib/omp/rpc/spawn-mcp.ts +8 -1
- package/src/server/lib/omp/session/blobs.server.ts +2 -1
- package/src/server/lib/plugins/e2e.test.ts +71 -2
- package/src/server/lib/plugins/loader.server.ts +20 -1
- package/src/server/lib/plugins/module-import.server.ts +45 -0
- package/src/server/lib/usage/provider-key.ts +18 -0
- package/src/server/lib/usage/providers.server.ts +27 -3
- package/src/server/lib/usage/report.server.ts +24 -0
- package/src/server/lib/usage/token-harbor.test.ts +191 -0
- package/src/server/lib/usage/token-harbor.ts +207 -0
- package/src/server/lib/usage/token-portal.test.ts +140 -0
- package/src/server/lib/usage/token-portal.ts +179 -0
- package/src/server/lib/usage/vendor-http.test.ts +52 -0
- package/src/server/lib/usage/vendor-http.ts +9 -2
- package/src/server/routes/agent/new-prompt.test.ts +81 -0
- package/src/server/routes/agent/new.ts +78 -4
- package/src/server/routes/fs/raw.test.ts +12 -0
- package/src/server/routes/fs/raw.ts +2 -6
- package/src/server/routes/wiki/asset.ts +1 -1
- package/src/shared/lib/fs/document-kind.test.ts +39 -2
- package/src/shared/lib/fs/document-kind.ts +49 -1
- package/src/shared/lib/fs/file-kind.test.ts +30 -3
- package/src/shared/lib/fs/file-kind.ts +7 -104
- package/src/shared/lib/fs/mime.ts +159 -0
- package/src/shared/lib/omp/config/schema-releases.test.ts +22 -0
- package/src/shared/lib/workspace/sidebar-width.test.ts +34 -0
- package/src/shared/lib/workspace/sidebar-width.ts +33 -0
- package/src/shared/lib/workspace/workspace-panel-widths.test.ts +124 -0
- package/src/shared/lib/workspace/workspace-panel-widths.ts +115 -18
- package/src/shared/types/settings/usage.ts +89 -2
- package/dist/client/static/js/ImageView-jkrdrq8v.js +0 -1
- package/dist/client/static/js/LayoutWrapper-sh634350.js +0 -2
- package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +0 -1
- package/dist/client/static/js/bash-8d8z8zrg.js +0 -1
- package/dist/client/static/js/c-acmn1zc9.js +0 -1
- package/dist/client/static/js/cpp-620mvjkk.js +0 -1
- package/dist/client/static/js/css-bt76kxbq.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7gvtpn3d.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +0 -1
- package/dist/client/static/js/graphql-j1a6zp7m.js +0 -1
- package/dist/client/static/js/html-m0megrvb.js +0 -1
- package/dist/client/static/js/index-4cag7w6k.js +0 -479
- package/dist/client/static/js/index-5ka2tyf9.js +0 -3
- package/dist/client/static/js/index-83rkg916.js +0 -2
- package/dist/client/static/js/index-amsa0tfs.js +0 -2
- package/dist/client/static/js/index-dn7hg4em.js +0 -2
- package/dist/client/static/js/index-dpy3ewrn.css +0 -1
- package/dist/client/static/js/index-dt6q3rws.js +0 -12
- package/dist/client/static/js/index-hgzntg2j.js +0 -2
- package/dist/client/static/js/index-vkqb4dnt.js +0 -1
- package/dist/client/static/js/index-xwjbq003.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +0 -1
- package/dist/client/static/js/ini-5f4zqtqr.js +0 -1
- package/dist/client/static/js/java-jj41mty3.js +0 -1
- package/dist/client/static/js/javascript-n9w9p97f.js +0 -1
- package/dist/client/static/js/json-rnh2h17x.js +0 -1
- package/dist/client/static/js/jsx-4gecrt29.js +0 -1
- package/dist/client/static/js/lua-zszaw2f7.js +0 -1
- package/dist/client/static/js/markdown-nm6gw4v4.js +0 -1
- package/dist/client/static/js/one-dark-pro-09d8p5vy.js +0 -1
- package/dist/client/static/js/one-light-g3ednt6p.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +0 -1
- package/dist/client/static/js/properties-rkptax7r.js +0 -1
- package/dist/client/static/js/python-qf1se1mj.js +0 -1
- package/dist/client/static/js/r-ms0cygq2.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +0 -1
- package/dist/client/static/js/sql-hd42h8wx.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-6y8zdbm4.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +0 -1
- package/dist/client/static/js/tsx-gx7td06z.js +0 -1
- package/dist/client/static/js/typescript-1a808spn.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +0 -1
- package/dist/client/static/js/xml-3117mxd9.js +0 -1
- package/dist/client/static/js/yaml-dmvh8vyt.js +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Whether the right panel may be on screen at all.
|
|
8
|
+
*
|
|
9
|
+
* The width resolver already capped the panel's own size, but a cap cannot
|
|
10
|
+
* help a panel whose FLOOR does not fit: `resolvePanelWidth`'s ceiling is
|
|
11
|
+
* `max(min, …)`, so the floor wins and the group overflows its own box. The
|
|
12
|
+
* group is `flex-1 min-w-0`, so the overflow is invisible in `clientWidth` and
|
|
13
|
+
* unreachable — measured on the running console at 900px: group clientWidth
|
|
14
|
+
* 483 against scrollWidth 522, with 39px of the Files panel laid out past the
|
|
15
|
+
* viewport edge under the activity bar.
|
|
16
|
+
*
|
|
17
|
+
* The answer is a DROP, not a squeeze: the chat keeps `MIN_CHAT_READING_WIDTH`
|
|
18
|
+
* and the secondary column gives way. These cases pin the arithmetic, the
|
|
19
|
+
* two-report contract the caller branches on, and the fact that a group with no
|
|
20
|
+
* measurement yet does not close a panel it was asked to open.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { describe, expect, test } from 'bun:test';
|
|
24
|
+
|
|
25
|
+
import { HANDLE_WIDTH, MIN_EDITOR_PANEL_WIDTH } from '@/shared/lib/workspace/panel-widths';
|
|
26
|
+
import {
|
|
27
|
+
MIN_CHAT_READING_WIDTH,
|
|
28
|
+
railShown,
|
|
29
|
+
resolveWorkspacePanelWidths,
|
|
30
|
+
rightPanelFits,
|
|
31
|
+
} from '@/shared/lib/workspace/workspace-panel-widths';
|
|
32
|
+
|
|
33
|
+
describe('rightPanelFits', () => {
|
|
34
|
+
test('a group with no measurement yet keeps the requested layout', () => {
|
|
35
|
+
// The first paint happens before the observer reports; closing a panel for
|
|
36
|
+
// one frame and opening it again is worse than trusting the request.
|
|
37
|
+
expect(rightPanelFits({ available: null, showEditor: true, chatHidden: false, rightMin: 200, handleCount: 2 })).toBe(true);
|
|
38
|
+
expect(rightPanelFits({ available: 0, showEditor: true, chatHidden: false, rightMin: 200, handleCount: 2 })).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('the chat keeps its reading width and the editor its floor', () => {
|
|
42
|
+
const needed = MIN_CHAT_READING_WIDTH + MIN_EDITOR_PANEL_WIDTH + 200 + 2 * HANDLE_WIDTH;
|
|
43
|
+
expect(rightPanelFits({ available: needed, showEditor: true, chatHidden: false, rightMin: 200, handleCount: 2 })).toBe(true);
|
|
44
|
+
expect(rightPanelFits({ available: needed - 1, showEditor: true, chatHidden: false, rightMin: 200, handleCount: 2 })).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('with the chat collapsed only the editor and the panel are reserved', () => {
|
|
48
|
+
// The chat column is off screen in compact/full view, so it holds no floor.
|
|
49
|
+
expect(rightPanelFits({ available: MIN_EDITOR_PANEL_WIDTH + 200 + 2 * HANDLE_WIDTH, showEditor: true, chatHidden: true, rightMin: 200, handleCount: 2 })).toBe(true);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
describe('resolveWorkspacePanelWidths and the right panel', () => {
|
|
54
|
+
const base = {
|
|
55
|
+
panelWidths: {},
|
|
56
|
+
editorWidthMode: 'editor' as const,
|
|
57
|
+
activeRightPanel: 'files',
|
|
58
|
+
activePanel: { defaultWidth: 268, defaultFraction: 0.3, minWidth: 200 },
|
|
59
|
+
chatHidden: false,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
test('a group too narrow for all three drops the right panel instead of clipping it', () => {
|
|
63
|
+
// 607px is what a 1024px window leaves this group once the 414px sidebar
|
|
64
|
+
// takes its share — the width where the chat measured 81px and the right
|
|
65
|
+
// panel's own 200px floor pushed the row past its box.
|
|
66
|
+
const resolved = resolveWorkspacePanelWidths({ ...base, available: 607, showEditor: true, showRightPanel: true });
|
|
67
|
+
|
|
68
|
+
expect(resolved.rightShown).toBe(false);
|
|
69
|
+
expect(resolved.rightSuppressed).toBe(true);
|
|
70
|
+
expect(resolved.right).toBe(0);
|
|
71
|
+
// The separator before the editor stays; the one before the dropped panel
|
|
72
|
+
// goes with it, or the drag would transfer pixels into nothing.
|
|
73
|
+
expect(resolved.handleCount).toBe(1);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('a suppressed panel gives the chat everything the editor does not need', () => {
|
|
77
|
+
const resolved = resolveWorkspacePanelWidths({ ...base, available: 607, showEditor: true, showRightPanel: true });
|
|
78
|
+
|
|
79
|
+
// The editor keeps its floor, and the chat takes the rest — 284px where the
|
|
80
|
+
// panel used to leave it 81. The editor's floor is not negotiable (it is
|
|
81
|
+
// only on screen because the user opened a file), so this is the most the
|
|
82
|
+
// chat can have at this group width.
|
|
83
|
+
expect(resolved.editor).toBe(MIN_EDITOR_PANEL_WIDTH);
|
|
84
|
+
expect(607 - resolved.editor - resolved.handleCount * HANDLE_WIDTH).toBe(284);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('a group with room keeps the panel, and reports it as shown', () => {
|
|
88
|
+
const resolved = resolveWorkspacePanelWidths({ ...base, available: 1023, showEditor: true, showRightPanel: true });
|
|
89
|
+
|
|
90
|
+
expect(resolved.rightShown).toBe(true);
|
|
91
|
+
expect(resolved.rightSuppressed).toBe(false);
|
|
92
|
+
expect(resolved.right).toBeGreaterThanOrEqual(200);
|
|
93
|
+
expect(resolved.handleCount).toBe(2);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test('a panel nobody asked for is neither shown nor suppressed', () => {
|
|
97
|
+
const resolved = resolveWorkspacePanelWidths({ ...base, available: 400, showEditor: false, showRightPanel: false });
|
|
98
|
+
|
|
99
|
+
expect(resolved.rightShown).toBe(false);
|
|
100
|
+
// "Suppressed" means "asked for and refused" — a closed panel is not a
|
|
101
|
+
// refusal, and reporting it as one would make the toggle explain a state
|
|
102
|
+
// the user is not in.
|
|
103
|
+
expect(resolved.rightSuppressed).toBe(false);
|
|
104
|
+
expect(resolved.right).toBe(0);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe('railShown', () => {
|
|
109
|
+
test('a panel closed by its own control keeps the rail, which is the way back', () => {
|
|
110
|
+
// The regression this pins: the rail was rendered from `rightPanelShown`,
|
|
111
|
+
// so closing the column took the control that reopens it. `files-nested.e2e.ts`
|
|
112
|
+
// timed out on `getByRole('button', { name: 'Files' })` for every case.
|
|
113
|
+
expect(railShown({ sideShown: true, nav: 'rail', rightSuppressed: false })).toBe(true);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test('a SUPPRESSED panel takes the rail with it: choosing a view would switch nothing', () => {
|
|
117
|
+
expect(railShown({ sideShown: true, nav: 'rail', rightSuppressed: true })).toBe(false);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('the whole side put away, or the tabs style, has no rail either', () => {
|
|
121
|
+
expect(railShown({ sideShown: false, nav: 'rail', rightSuppressed: false })).toBe(false);
|
|
122
|
+
expect(railShown({ sideShown: true, nav: 'tabs', rightSuppressed: false })).toBe(false);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
@@ -27,6 +27,28 @@ import {
|
|
|
27
27
|
type PanelWidths,
|
|
28
28
|
} from '@/shared/lib/workspace/panel-widths';
|
|
29
29
|
import { DEFAULT_RIGHT_PANEL_FRACTION } from '@/shared/lib/workspace/right-panels';
|
|
30
|
+
import type { PanelNavStyle } from '@/shared/lib/workspace/panel-nav';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The width below which the chat column stops being a conversation, used to
|
|
34
|
+
* decide whether a SECONDARY panel may exist at all.
|
|
35
|
+
*
|
|
36
|
+
* `MIN_CHAT_PANEL_WIDTH` is the share the chat is BUDGETED, and it is a wish:
|
|
37
|
+
* when the group cannot spare it the chat narrows rather than the fixed panels
|
|
38
|
+
* clipping. But that wish cannot answer "should the right panel be on screen at
|
|
39
|
+
* this window width", because a 400px chat beside a 320px editor and a 200px
|
|
40
|
+
* file tree needs 926px of group — which no 1152px window has once the sidebar
|
|
41
|
+
* takes its share. The old answer was to keep all three and let the chat fall
|
|
42
|
+
* to 209px (measured at 1152) and then to 0 (measured at 900), with the group's
|
|
43
|
+
* own scrollWidth past its clientWidth so the right panel was clipped by the
|
|
44
|
+
* viewport with no scrollbar to reach it.
|
|
45
|
+
*
|
|
46
|
+
* 320 is the floor the composer's toolbar actually needs: below `@[420px]` every
|
|
47
|
+
* selector is icon-only (`ModeToggles`, `AccessDropdown`, `ThinkingLevelDropdown`),
|
|
48
|
+
* and 320 leaves a 24px-gutter message column about 40 characters wide. At 320
|
|
49
|
+
* the chat is cramped but whole; at 209 it is a column of clipped chips.
|
|
50
|
+
*/
|
|
51
|
+
export const MIN_CHAT_READING_WIDTH = 320;
|
|
30
52
|
|
|
31
53
|
export interface WorkspacePanelWidthsArgs {
|
|
32
54
|
/** Measured area of the group, or null before the observer reports. */
|
|
@@ -48,6 +70,19 @@ export interface WorkspacePanelWidthsArgs {
|
|
|
48
70
|
export interface WorkspacePanelWidths {
|
|
49
71
|
right: number;
|
|
50
72
|
editor: number;
|
|
73
|
+
/**
|
|
74
|
+
* The right panel is ON SCREEN: it was asked for and the group can hold it.
|
|
75
|
+
* The caller renders the column, its separator and the rail from this, never
|
|
76
|
+
* from its own `showRightPanel` request — otherwise a refused request draws a
|
|
77
|
+
* rail beside a panel that is not there.
|
|
78
|
+
*/
|
|
79
|
+
rightShown: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The right panel was ASKED for and there is no room for it. The caller says
|
|
82
|
+
* so (a refusal names its reason) instead of leaving a toggle that flips a
|
|
83
|
+
* flag the layout is ignoring.
|
|
84
|
+
*/
|
|
85
|
+
rightSuppressed: boolean;
|
|
51
86
|
/** Drag ceilings; `undefined` before the group is measured. */
|
|
52
87
|
editorMax: number | undefined;
|
|
53
88
|
rightMax: number | undefined;
|
|
@@ -57,14 +92,57 @@ export interface WorkspacePanelWidths {
|
|
|
57
92
|
rightMin: number;
|
|
58
93
|
}
|
|
59
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Whether the right panel can be on screen beside everything else.
|
|
97
|
+
*
|
|
98
|
+
* A panel whose floor does not fit is DROPPED, not clipped and not squeezed:
|
|
99
|
+
* `resolvePanelWidth`'s ceiling is `max(min, …)`, so a floor that does not fit
|
|
100
|
+
* can only overflow the group. The group is `flex-1 min-w-0`, so its
|
|
101
|
+
* `clientWidth` stays put while its `scrollWidth` grows — the panel is laid out
|
|
102
|
+
* PAST the viewport edge, under the activity bar, with no scrollbar that could
|
|
103
|
+
* bring it back (measured at 900px: group 483 vs scroll 522, 39px of the Files
|
|
104
|
+
* panel unreachable).
|
|
105
|
+
*
|
|
106
|
+
* The chat is the surface the app exists for, so it keeps `MIN_CHAT_READING_WIDTH`
|
|
107
|
+
* and the SECONDARY column is the one that gives way. The editor column never
|
|
108
|
+
* gives way: it is only on screen because the user opened a file or a takeover,
|
|
109
|
+
* and a click that opened nothing would be the worse defect.
|
|
110
|
+
*/
|
|
111
|
+
export function rightPanelFits(args: {
|
|
112
|
+
/** Measured area of the group, or null before the observer reports. */
|
|
113
|
+
available: number | null;
|
|
114
|
+
showEditor: boolean;
|
|
115
|
+
/** The chat is collapsed, so it reserves nothing. */
|
|
116
|
+
chatHidden: boolean;
|
|
117
|
+
/** The right panel's own floor, from the view it would draw. */
|
|
118
|
+
rightMin: number;
|
|
119
|
+
/** Separators the row would hold WITH the right panel present. */
|
|
120
|
+
handleCount: number;
|
|
121
|
+
}): boolean {
|
|
122
|
+
const { available, showEditor, chatHidden, rightMin, handleCount } = args;
|
|
123
|
+
// Before the group is measured there is nothing to decide from, so the
|
|
124
|
+
// requested layout stands: the first paint must not open a panel and close it
|
|
125
|
+
// one frame later.
|
|
126
|
+
if (available === null || available <= 0) return true;
|
|
127
|
+
const chatFloor = chatHidden ? 0 : MIN_CHAT_READING_WIDTH;
|
|
128
|
+
const editorFloor = showEditor && !chatHidden ? MIN_EDITOR_PANEL_WIDTH : 0;
|
|
129
|
+
return available >= chatFloor + editorFloor + rightMin + handleCount * HANDLE_WIDTH;
|
|
130
|
+
}
|
|
131
|
+
|
|
60
132
|
export function resolveWorkspacePanelWidths(args: WorkspacePanelWidthsArgs): WorkspacePanelWidths {
|
|
61
133
|
const { available, panelWidths, editorWidthMode, activeRightPanel, activePanel, showEditor, showRightPanel, chatHidden } = args;
|
|
62
134
|
|
|
135
|
+
const rightMin = activePanel?.minWidth ?? MIN_EDITOR_PANEL_WIDTH;
|
|
136
|
+
// The fit question is asked with the handles the row WOULD have, because the
|
|
137
|
+
// answer decides whether one of them exists.
|
|
138
|
+
const requestedHandleCount = (showEditor && !chatHidden ? 1 : 0) + 1;
|
|
139
|
+
const rightFits =
|
|
140
|
+
showRightPanel && rightPanelFits({ available, showEditor, chatHidden, rightMin, handleCount: requestedHandleCount });
|
|
63
141
|
// The separator before the editor is gone while the chat is collapsed: there
|
|
64
142
|
// is nothing on its left to transfer width to, and the drag's neighbour walk
|
|
65
143
|
// skips a collapsed panel, so it would render a handle that does nothing.
|
|
66
|
-
const handleCount = (showEditor && !chatHidden ? 1 : 0) + (
|
|
67
|
-
const
|
|
144
|
+
const handleCount = (showEditor && !chatHidden ? 1 : 0) + (rightFits ? 1 : 0);
|
|
145
|
+
const showRight = rightFits;
|
|
68
146
|
|
|
69
147
|
// The editor and the right panel are a COUPLED pair: the right panel is
|
|
70
148
|
// resolved first, reserving the editor's WANTED share (the editor has no
|
|
@@ -74,18 +152,20 @@ export function resolveWorkspacePanelWidths(args: WorkspacePanelWidthsArgs): Wor
|
|
|
74
152
|
const editorFraction = panelFraction(panelWidths[editorWidthMode], DEFAULT_EDITOR_FRACTIONS[editorWidthMode], available);
|
|
75
153
|
const editorReservePx = available != null && available > 0 ? Math.round(editorFraction * available) : 0;
|
|
76
154
|
|
|
77
|
-
const right =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
155
|
+
const right = showRight
|
|
156
|
+
? resolvePanelWidth({
|
|
157
|
+
stored: panelWidths.right?.[activeRightPanel],
|
|
158
|
+
defaultFraction: activePanel?.defaultFraction ?? DEFAULT_RIGHT_PANEL_FRACTION,
|
|
159
|
+
defaultPx: activePanel?.defaultWidth ?? MIN_EDITOR_PANEL_WIDTH,
|
|
160
|
+
available,
|
|
161
|
+
min: rightMin,
|
|
162
|
+
pairReservePx: showEditor ? editorReservePx : 0,
|
|
163
|
+
// The editor has not been resolved yet, so only its floor can be reserved.
|
|
164
|
+
siblingWidth: showEditor ? MIN_EDITOR_PANEL_WIDTH : 0,
|
|
165
|
+
handleCount,
|
|
166
|
+
chatHidden,
|
|
167
|
+
})
|
|
168
|
+
: 0;
|
|
89
169
|
|
|
90
170
|
// With the chat collapsed the editor takes everything the right panel and the
|
|
91
171
|
// separators do not. Resolving from its remembered FRACTION would leave the
|
|
@@ -95,7 +175,7 @@ export function resolveWorkspacePanelWidths(args: WorkspacePanelWidthsArgs): Wor
|
|
|
95
175
|
? Math.max(
|
|
96
176
|
MIN_EDITOR_PANEL_WIDTH,
|
|
97
177
|
available != null && available > 0
|
|
98
|
-
? Math.floor(available - (
|
|
178
|
+
? Math.floor(available - (showRight ? right : 0) - handleCount * HANDLE_WIDTH)
|
|
99
179
|
: DEFAULT_EDITOR_WIDTHS[editorWidthMode],
|
|
100
180
|
)
|
|
101
181
|
: resolvePanelWidth({
|
|
@@ -104,21 +184,38 @@ export function resolveWorkspacePanelWidths(args: WorkspacePanelWidthsArgs): Wor
|
|
|
104
184
|
defaultPx: DEFAULT_EDITOR_WIDTHS[editorWidthMode],
|
|
105
185
|
available,
|
|
106
186
|
min: MIN_EDITOR_PANEL_WIDTH,
|
|
107
|
-
pairReservePx:
|
|
108
|
-
siblingWidth:
|
|
187
|
+
pairReservePx: showRight ? right : 0,
|
|
188
|
+
siblingWidth: showRight ? right : 0,
|
|
109
189
|
handleCount,
|
|
110
190
|
});
|
|
111
191
|
|
|
112
192
|
return {
|
|
113
193
|
right,
|
|
114
194
|
editor,
|
|
195
|
+
rightShown: showRight,
|
|
196
|
+
rightSuppressed: showRightPanel && !showRight,
|
|
115
197
|
// `resolvePanelWidth` caps what it HANDS to `defaultSize`, but a separator
|
|
116
198
|
// drag bypasses it — the resizer transfers pixels between two panels clamped
|
|
117
199
|
// only by their own `maxSize`. Each max is its own cap and the pair total
|
|
118
200
|
// minus the sibling's FLOOR (it gives way down to its minimum mid-drag).
|
|
119
|
-
editorMax: pairMaxSize({ available, siblingMin: rightMin, siblingOpen:
|
|
201
|
+
editorMax: pairMaxSize({ available, siblingMin: rightMin, siblingOpen: showRight, chatHidden }),
|
|
120
202
|
rightMax: pairMaxSize({ available, siblingMin: MIN_EDITOR_PANEL_WIDTH, siblingOpen: showEditor, chatHidden }),
|
|
121
203
|
handleCount,
|
|
122
204
|
rightMin,
|
|
123
205
|
};
|
|
124
206
|
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Whether the right activity rail is on screen.
|
|
210
|
+
*
|
|
211
|
+
* The rail is how a view is CHOSEN, so it exists where choosing one can still
|
|
212
|
+
* put something on screen. That is `sideShown && !rightSuppressed` — NOT
|
|
213
|
+
* `rightPanelShown`: a panel closed by its own control is not suppressed, and
|
|
214
|
+
* taking the rail away with it left the column unreachable except through the
|
|
215
|
+
* navbar's chord (measured by `files-nested.e2e.ts`, whose `openFiles` reopens a
|
|
216
|
+
* collapsed column through the rail's chip and timed out once the rail went
|
|
217
|
+
* with it).
|
|
218
|
+
*/
|
|
219
|
+
export function railShown(args: { sideShown: boolean; nav: PanelNavStyle; rightSuppressed: boolean }): boolean {
|
|
220
|
+
return args.sideShown && !args.rightSuppressed && args.nav === 'rail';
|
|
221
|
+
}
|
|
@@ -95,8 +95,91 @@ export interface DeepSeekUsageReport {
|
|
|
95
95
|
error?: string;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
|
|
98
|
+
/**
|
|
99
|
+
* The allowance Token Harbor reports for one account
|
|
100
|
+
* (`GET https://tokenharbor.ai/api/cli/free-tier`).
|
|
101
|
+
*
|
|
102
|
+
* Percentages only, by contract: the endpoint states how much of each allowance
|
|
103
|
+
* is used and never a dollar remainder, so a card built from it must not imply
|
|
104
|
+
* an amount. A Pass allowance and the free-model allowance are metered
|
|
105
|
+
* separately but share ONE 7-day window, hence a single `resetAt`.
|
|
106
|
+
*/
|
|
107
|
+
export interface TokenHarborAllowance {
|
|
108
|
+
/** "Agent Pass" | "Office Pass" | "Frontier Pass", or null without a Pass. */
|
|
109
|
+
planName: string | null;
|
|
110
|
+
/** False when the account holds no Pass: there is no Pass allowance to draw. */
|
|
111
|
+
onPlan: boolean;
|
|
112
|
+
/** Percent of the 7-day Pass allowance used (0-100), null on schema drift. */
|
|
113
|
+
planUsedPct: number | null;
|
|
114
|
+
/**
|
|
115
|
+
* The Pass allowance is spent for this window. Authoritative over
|
|
116
|
+
* `planUsedPct`: the percentage is rounded, so it can read 100 on a request
|
|
117
|
+
* that is still covered and 99 on the one that is refused.
|
|
118
|
+
*/
|
|
119
|
+
planExhausted: boolean;
|
|
120
|
+
/** Percent of the free-model allowance used (0-100), null on schema drift. */
|
|
121
|
+
usedPct: number | null;
|
|
122
|
+
/** The free allowance is spent for this window. */
|
|
123
|
+
exhausted: boolean;
|
|
124
|
+
/** False until the first request starts the 7-day window. */
|
|
125
|
+
activated: boolean;
|
|
126
|
+
/** When both allowances come back in full; null before the first request. */
|
|
127
|
+
resetAt: string | null;
|
|
128
|
+
periodStartedAt: string | null;
|
|
129
|
+
periodEndsAt: string | null;
|
|
130
|
+
/**
|
|
131
|
+
* The `:free` ids the key can call right now, as the endpoint spells them.
|
|
132
|
+
* Kept verbatim: the docs show a `:free` suffix the live response omits, so
|
|
133
|
+
* rebuilding ids from these would invent a model that does not resolve.
|
|
134
|
+
*/
|
|
135
|
+
freeModels: string[];
|
|
136
|
+
/** False when free models are switched off for the account (calls get 403). */
|
|
137
|
+
modelsEnabled: boolean;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Token Harbor allowance; present only when Token Harbor has a credential. */
|
|
141
|
+
export interface TokenHarborUsageReport {
|
|
142
|
+
allowance?: TokenHarborAllowance;
|
|
143
|
+
error?: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The wallet TokenPortal reports for one API key (`GET /v1/key`).
|
|
148
|
+
*
|
|
149
|
+
* The endpoint is OpenRouter-shaped, but the numbers are the vendor's own: both
|
|
150
|
+
* money fields are whole units of the `currency` it names (IDR on the live
|
|
151
|
+
* endpoint), NOT cents — `balance` is what is left, `limit` the key's cap, and
|
|
152
|
+
* `limitRemaining` what is left under that cap.
|
|
153
|
+
*/
|
|
154
|
+
export interface TokenPortalBalance {
|
|
155
|
+
/** The key's own label ("Kabmo"), when the endpoint names it. */
|
|
156
|
+
label: string | null;
|
|
157
|
+
/** ISO 4217 code the amounts are denominated in. */
|
|
158
|
+
currency: string;
|
|
159
|
+
/** Money left on this key, in whole `currency` units. */
|
|
160
|
+
balance: number;
|
|
161
|
+
/** The key's spending cap, when the operator set one. */
|
|
162
|
+
limit: number | null;
|
|
163
|
+
/** Money left under that cap, as the vendor reports it. */
|
|
164
|
+
limitRemaining: number | null;
|
|
165
|
+
/** True while the key is on the free tier. */
|
|
166
|
+
isFreeTier: boolean;
|
|
167
|
+
/** A per-session cap, when the operator set one. */
|
|
168
|
+
sessionBudget: number | null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** TokenPortal wallet; present only when TokenPortal has a credential. */
|
|
172
|
+
export interface TokenPortalUsageReport {
|
|
173
|
+
balance?: TokenPortalBalance;
|
|
174
|
+
error?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Unit of a provider-reported quota amount (mirrors omp's `UsageUnit`, plus
|
|
179
|
+
* `idr` for the Rupiah wallets Kabmo reads itself — an IDR amount formatted as
|
|
180
|
+
* USD would misstate the balance by four orders of magnitude).
|
|
181
|
+
*/
|
|
182
|
+
export type UsageUnit = 'percent' | 'tokens' | 'requests' | 'credits' | 'usd' | 'idr' | 'minutes' | 'bytes' | 'unknown';
|
|
100
183
|
|
|
101
184
|
/** Coarse state of one quota window. */
|
|
102
185
|
export type UsageWindowStatus = 'ok' | 'warning' | 'exhausted' | 'unknown';
|
|
@@ -172,6 +255,10 @@ export interface UsageProviderSummary {
|
|
|
172
255
|
kenari?: KenariUsageReport;
|
|
173
256
|
/** Rich DeepSeek report (prepaid balance). */
|
|
174
257
|
deepseek?: DeepSeekUsageReport;
|
|
258
|
+
/** Rich Token Harbor report (Pass + free allowance percentages). */
|
|
259
|
+
tokenHarbor?: TokenHarborUsageReport;
|
|
260
|
+
/** Rich TokenPortal report (wallet, key cap, session budget). */
|
|
261
|
+
tokenPortal?: TokenPortalUsageReport;
|
|
175
262
|
}
|
|
176
263
|
|
|
177
264
|
/** Response body of `GET /api/settings/usage`. */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e,m,Rr}from"./index-4cag7w6k.js";import{wi,ru}from"./index-dt6q3rws.js";function g({source:t,name:r,revision:s=0}){let{url:i,loading:n,error:o}=ru(t,s);if(o)return e(Rr,{name:r,message:o});if(n||!i)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading image…"})]});return e(wi,{src:i,name:r,className:"flex-1 min-h-0"})}export{g as ImageView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d,n,o,K,i,u,a,Je,le,Ot,uc,e,s,De,Ee,m,nn,rn,_,at,an,f,B,se,ot,re,fe,Tt,We,pn,me,qe,ce,ka,Yr,mn,xa,Zn,P,D,U,Xs,b,er,el,Oe,xe,ln,vA,Ha,Wp,gn,tl,Te,Dt,Io,ue,Z,ct,ns,rs,nd,pc,ge,He,os,KA,gc,Et,Qt,Rt,hc,ll,So,cl,ul,ld,Do,Ke,tt,ra,Ve,Ja,ml,Fc,Sa,Lc,ud,ms,Ta,Qo,Ro,Fo,It,nr,hs,Lo,Mo,Po,$e,gl,Tr,Za,Al,hl,bl,yl,rr,Hm,Wm,Oo,$c,Km,ys,vs,Vm,ks,Jm,Zm,Xm,zc,gi,vl,Da,Ai,ef,tf,Uc,nf,rf,Ph,gd,Oh,zo,Gc,Ad,xn,af,of,sf,lf,kl,Pg,no,xf,wf,qc,_l,Sf,Tf,Bd,Df,n0}from"./index-4cag7w6k.js";import{Qd}from"./index-xwjbq003.js";import{Yc,Jc,Zc,Xc,eu,tu,nu,Td,Cs,Go,Es,wi,au,Sl,ou,iu,su,lu,cu,uu,du,pu,mu}from"./index-dt6q3rws.js";import{Ku,Vu,ei,Yu,Ju}from"./index-8g7q8mz4.js";import{mt,Ci,gu,Au,bu}from"./index-83rkg916.js";import{_s,Qa,Fr,yu,vu,jo,ku,Ss,zd,Vg,Ts,Ds,Ns,Lr,Qs,Rs,qo,Fs,Ls,Ms,Ps,Bi,Ho,Os,$s,xu,Ud,wu,Cu,Eu,Bu,Iu,_u}from"./index-m4k054wz.js";import{Ra,Fa}from"./index-fzngzhww.js";function Ze(t){let{editorOpen:r,diffOpen:l,settingsOpen:p,offMainScreen:h,onCloseEditor:g,onCloseDiff:S,onCloseSettings:v,onReturnToMain:x}=t;o(()=>n0(()=>{if(r)return g(),!0;if(l)return S(),!0;if(p)return v(),!0;if(h)return x(),!0;return!1}),[r,l,p,h,g,S,v,x])}var gt="terminal";function Ge(t){return t===gt}function Re(t){if(Ge(t))KA()}function Qe({dock:t,sessionId:r,currentScreen:l,setCurrentScreen:p}){let[h,g]=n(0),[S,v]=n(0),x=a(()=>{let k=xe(r,"layout.mobileRightPanel")??uc;Re(k),g((y)=>y+1),p("right")},[r,p]),c=a(()=>{v((k)=>k+1),p("session")},[p]),w=a((k)=>{let y=Oh(k,t);if(!y)return;let M=xe(r,"layout.mobileRightPanel");if(y==="right"&&(l!=="right"||M!==k))Re(k);if(ln(r,y==="left"?"layout.mobileLeftPanel":"layout.mobileRightPanel",k),y==="right")g(0);p(y==="left"?"session":"right")},[t,r,l,p]);return ge(gd,(k)=>{let y=k.detail?.panelKey;if(y)w(y)}),{right:h,left:S,openSessionDrawer:c,openRightDrawer:x,openNamedPanel:w}}var vt={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]},eo=s(vt);function Le(){let t=os(),[r,l]=n(null),p=a((S,v)=>{l({top:v,bottom:v,left:S,right:S})},[]),h=Ku({enabled:t,onLongPress:p}),g=a(()=>l(null),[]);return{anchor:r,close:g,surfaceProps:{onContextMenu:(S)=>{S.preventDefault();let v=S.currentTarget.getBoundingClientRect();l({top:v.top,bottom:v.bottom,left:v.left,right:v.right})},onTouchStart:h.onTouchStart,onTouchMove:h.onTouchMove,onTouchEnd:h.onTouchEnd,onTouchCancel:h.onTouchCancel,onClickCapture:(S)=>{if(!h.consume())return;S.preventDefault(),S.stopPropagation()}}}}var St=10,oo=600000;function to({activeSessionTitle:t,activeSessionId:r,onOpenSessionSidebar:l,onOpenRightSidebar:p,onNewSession:h,onSelectSession:g}){let{folders:S}=Ve(),v=Bd(),x=Ta(r),[c,w]=n(null),{hidden:k,setHidden:y}=of(),M=Le(),T=Ad("mobile"),I=u(()=>{let C=Date.now(),A=[];for(let E of S)for(let O of E.sessions??[]){if(O.is_archived===1)continue;let R=vA(String(O.id)),L=O.updated_at?Date.parse(O.updated_at):0,q=R!==void 0&&C-R<=oo?R:L;if(R!==void 0&&C-R>oo)continue;A.push({id:O.id,title:O.title,folderName:E.name,modified:q})}return A.sort((E,O)=>O.modified-E.modified).slice(0,St)},[S]),N=t?t.charAt(0).toUpperCase()+t.slice(1):"New session";return e("header",{className:`flex-shrink-0 bg-canvas border-b border-ink/10 flex items-center justify-between ${gl} px-3 z-20 titlebar-drag-region select-none`,...Da(),...M.surfaceProps,style:zo(),children:[e("div",{className:"flex items-center space-x-2 flex-1 min-w-0 titlebar-no-drag",children:[e("button",{type:"button",onClick:l,className:"w-9 h-9 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 inline-flex items-center justify-center",title:"Open Sessions","aria-label":"Open Sessions",children:e(eo,{size:20,strokeWidth:2})}),e("span",{className:"relative font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:[e(Sa,{glow:!0}),e("span",{className:"absolute -top-0.5 -right-1.5 flex",children:e(zc,{status:v})})]}),e("span",{className:"text-ink/25 font-light text-xs flex-shrink-0 select-none",children:"/"}),e("div",{className:"relative min-w-0 flex-1 max-w-[150px]","data-testid":"session-picker",children:[e("button",{type:"button",onClick:(C)=>{w((A)=>A?null:Et(C.currentTarget))},className:"tap-chip flex w-full items-center space-x-1 text-xs font-semibold text-ink hover:text-ink/80 transition-colors py-1 min-w-0",title:N,"aria-haspopup":"menu","aria-expanded":c!==null,children:[e("span",{className:"truncate",children:N}),x&&e(m,{size:12,className:"animate-spin text-ink/50 flex-shrink-0",role:"status","aria-label":"Generating a session name…"}),e(B,{size:13,className:"text-ink/50 flex-shrink-0"})]}),c&&e(Qt,{anchor:c,align:"start",className:"w-72 bg-paper border border-ink/15 rounded-xl shadow-lg p-2 text-xs",onClose:()=>w(null),children:[e("button",{type:"button",onClick:()=>{w(null),h()},className:"w-full text-left px-3 py-2 rounded-lg bg-ink text-canvas flex items-center space-x-2 font-medium mb-1.5",children:[e(P,{size:14}),e("span",{children:"Start New Session"})]}),e("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40",children:"Recent Sessions"}),e("div",{className:"max-h-64 scrollbar-overlay-container space-y-0.5",children:I.length===0?e("div",{className:"px-2.5 py-2 text-ink/40 italic",children:"No sessions yet"}):I.map((C)=>e("button",{type:"button",onClick:()=>{w(null),g(C.id)},className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between space-x-2 transition-colors ${String(r)===String(C.id)?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[e("span",{className:"min-w-0 flex flex-col",children:[e("span",{className:"truncate",children:C.title?C.title.charAt(0).toUpperCase()+C.title.slice(1):"Untitled"}),e("span",{className:"truncate text-[10px] text-ink/40 font-mono",children:C.folderName})]}),String(r)===String(C.id)&&e(f,{size:12,className:"flex-shrink-0"})]},C.id))})]})]})]}),e(sf,{layout:"mobile",sessionId:r==null?null:String(r),showRightPanel:!1,onToggleRightPanel:p,entries:T,hidden:k}),M.anchor?e(Oo,{anchor:M.anchor,title:"Navbar",align:"right",items:af([...T.inline,...T.folded]).filter((C)=>C.id!==xn.install).map((C)=>({...C,removable:!0})),hidden:k,onToggle:y,onClose:M.close}):null]})}function io({activeSessionId:t,onSelectSession:r,onNewSession:l,onOpenSessionSidebar:p,onOpenRightSidebar:h,appSettings:g={}}){let{folders:S}=Ve(),[v,x]=n(null),c=u(()=>{if(!t)return"New session";for(let k of S){let y=k.sessions?.find((M)=>String(M.id)===String(t));if(y)return y.title}return null},[t,S]);return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative",children:[e(to,{activeSessionTitle:v||c||"New session",activeSessionId:t,onOpenSessionSidebar:p,onOpenRightSidebar:h,onNewSession:l,onSelectSession:r}),e("main",{className:"flex-1 min-h-0",children:e(wf,{appSettings:g,onSessionTitle:x,variant:"mobile"})})]})}function ro({onClose:t,viewLabel:r="Sessions",menuProps:l}){return e("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas titlebar-drag-region select-none",...Da(),...l,style:{...zo()},children:[e("div",{className:"flex items-center space-x-2.5 titlebar-no-drag min-w-0",children:[e("span",{className:"font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:e(Sa,{className:"text-[16px]",glow:!0})}),e("span",{className:"text-ink/25 text-xs select-none flex-shrink-0",children:"/"}),e("span",{className:"text-[11px] font-semibold text-ink/60 uppercase tracking-wider font-mono truncate",children:r})]}),e("div",{className:"flex items-center gap-1 titlebar-no-drag flex-shrink-0",children:[e(lf,{variant:"chip"}),e("button",{type:"button",onClick:t,className:"w-9 h-9 rounded-xl hover:bg-ink/5 active:bg-ink/10 text-ink flex items-center justify-center transition-colors cursor-pointer",title:"Close sidebar","aria-label":"Close sidebar",children:e(b,{size:19,strokeWidth:2})})]})]})}function so({onSettings:t,onKeyBindings:r,onAbout:l,updateAvailable:p,onUpdateClick:h,onDesktopToggle:g,shellDownload:S}){return e("div",{className:"px-3 pt-3 border-t border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas text-xs text-ink/60",style:{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom, 0px))"},children:[e("div",{className:"flex items-center space-x-3",children:[e("button",{type:"button",onClick:t,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(Xs,{size:14}),e("span",{children:"Settings"})]}),e("button",{type:"button",onClick:r,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(ka,{size:14}),e("span",{children:"Keys"})]}),e("button",{type:"button",onClick:l,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(ce,{size:14}),e("span",{children:"About"})]}),S&&e(Xm,{download:S,variant:"label"}),g&&e("button",{type:"button",onClick:g,className:"flex items-center space-x-1 hover:text-ink transition-colors",title:"Switch to desktop view",children:[e(xa,{size:14}),e("span",{children:"Desktop"})]})]}),e("div",{className:"flex items-center gap-2",children:[e("span",{className:"font-mono text-[10px] text-ink/40",children:["v",Fc.version]}),p&&e("button",{type:"button",onClick:h,className:"px-2 py-0.5 rounded-full border border-ink/20 text-[10px] font-semibold text-ink hover:border-ink/40",children:"update"})]})]})}function ao(t){let r=ef(),l=Zm();return ge(Lc,()=>{t.onClose(),t.openAbout(),r.apply("kabmo").then((p)=>{if(!p)return;t.pushToast(p.message,pc(p))})}),tf(r,t.pushToast),{updates:r,shellDownload:l}}function lo(t,r,l){return t.filter((p)=>p.id!==r&&!(l&&p.side==="left"))}function co(t){return t}var xt=8;function Be({panels:t,activeId:r,onSelect:l,hasGitChanges:p=!1}){let h=i(null),g=i(new Map),S=i({activeId:r,panels:t});S.current={activeId:r,panels:t};let v=i({signature:"",width:0}),x=a(()=>{let c=h.current,w=g.current.get(S.current.activeId);if(!c||!w||c.clientWidth<=0)return;let k=`${S.current.activeId}\x00${S.current.panels.map((N)=>N.id).join("\x00")}`,y=v.current;if(y.signature===k&&y.width===c.clientWidth)return;v.current={signature:k,width:c.clientWidth};let M=c.getBoundingClientRect(),T=w.getBoundingClientRect(),I=Km({scrollLeft:c.scrollLeft,clientWidth:c.clientWidth,scrollWidth:c.scrollWidth,start:T.left-M.left+c.scrollLeft,size:T.width},xt);if(I!==c.scrollLeft)c.scrollLeft=I},[]);return K(x,[r,t,x]),o(()=>{let c=h.current;if(!c||typeof ResizeObserver>"u")return;let w=new ResizeObserver(x);return w.observe(c),()=>w.disconnect()},[x]),e("div",{ref:h,className:"flex items-center space-x-1.5 overflow-x-auto no-scrollbar py-1",children:t.map((c)=>{let w=c.id===r;return e("button",{ref:(k)=>{if(k)g.current.set(c.id,k);else g.current.delete(c.id)},type:"button",onClick:()=>l(c.id),"aria-pressed":w,"aria-label":c.title,className:`tap-chip relative flex shrink-0 items-center transition-all cursor-pointer ${w?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:c.title,children:[e(Ja,{panelId:c.id,builtin:c.builtin,icon:c.builtin?c.icon:void 0,name:c.builtin?c.label:c.name,...c.iconUrl?{iconUrl:c.iconUrl}:{},...c.color?{color:c.color}:{},size:Ot}),w&&e("span",{className:`shrink-0 whitespace-nowrap ${c.id==="git"?"tracking-wide":""}`,children:c.label}),c.id==="git"&&p&&e("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full bg-info",title:"Uncommitted changes"})]},c.id)})})}function po({panels:t,activeId:r,onSelect:l,menuProps:p}){return e("div",{className:"px-3 py-1.5 border-b border-ink/10 bg-canvas flex-shrink-0",...p,children:e(Be,{panels:t,activeId:r,onSelect:l})})}function mo({panelKey:t,panel:r,body:l}){if(!r)return e("div",{className:"flex-1 min-h-0",children:e($c,{panelKey:t})});return e("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:e(Je,{fallback:e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono",children:"Loading…"})}),children:e(Io,{value:l,children:r.render(l)})})})}var Ae="w-9.5 h-9.5 rounded-xl border flex items-center justify-center transition-all flex-shrink-0 cursor-pointer shadow-xs",Fe="border-ink/15 bg-paper hover:bg-ink/5 text-ink/80 hover:text-ink",uo="bg-ink/10 text-ink border-ink/30";function fo({searchQuery:t,sortOption:r,optionsOpen:l,showArchived:p,optionsRef:h,onNewSession:g,onNewWorkspace:S,onScheduler:v,scheduledCount:x,onRefresh:c,refreshing:w,onToggleOptions:k,onSortChange:y,onResetSort:M,onToggleArchived:T,onHideArchived:I,onSearchChange:N,onClearSearch:C,onSelectWorkspaces:A,selecting:E}){let{ref:O,width:R}=Ss(0),L=Vg(R),q={};for(let X of zd.slice(0,L))q[X]=!0;let z=zd.slice(L),F=p?"Hide archived sessions":"Show archived sessions",te=x>0?`Scheduled tasks (${x} armed)`:"Scheduled tasks",H=[];if(z.includes("new-workspace"))H.push({id:"new-workspace",label:"New Workspace",icon:pn,onSelect:S});if(z.includes("refresh"))H.push({id:"refresh",label:"Refresh sessions",icon:D,onSelect:c});if(z.includes("scheduler"))H.push({id:"scheduler",label:te,icon:Qa,onSelect:v});if(z.includes("archive"))H.push({id:"archive",label:F,icon:at,onSelect:T,active:p});if(z.includes("select"))H.push({id:"select",label:E?"Cancel selection":"Select workspaces",icon:Fr,onSelect:A,active:E});return e("div",{className:"p-3 border-b border-ink/10 flex flex-col space-y-2.5 flex-shrink-0 bg-canvas",children:[e("div",{ref:O,className:"flex items-center space-x-2",children:[e("button",{type:"button",onClick:g,"aria-label":"New Session",title:"New Session",className:"flex-1 min-w-0 h-9.5 flex items-center justify-center space-x-2 px-3.5 rounded-xl bg-ink text-canvas hover:bg-ink/90 text-xs font-semibold transition-all shadow-xs",children:[e(P,{size:15,strokeWidth:2.4,className:"shrink-0"}),e("span",{className:"min-w-0 truncate",children:"New Session"})]}),q["new-workspace"]&&e("button",{type:"button",onClick:S,className:`${Ae} ${Fe}`,title:"New Workspace","aria-label":"New Workspace",children:e(pn,{size:16,strokeWidth:1.8})}),q.scheduler&&e("button",{type:"button",onClick:v,className:`relative ${Ae} ${Fe}`,title:te,"aria-label":x>0?`Scheduled tasks, ${x} armed`:"Scheduled tasks",children:[e(Qa,{size:16,strokeWidth:1.8}),x>0&&e("span",{className:"absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-[3px] rounded-full bg-ink text-canvas text-[10px] leading-[13px] text-center font-semibold",children:x>9?"9+":x})]}),q.archive&&e("button",{type:"button",onClick:T,"aria-pressed":p,className:`${Ae} ${p?"bg-warning/15 border-warning/40 text-warning":Fe}`,title:F,"aria-label":F,children:e(at,{size:16,strokeWidth:1.8})}),q.select&&e("button",{type:"button",onClick:A,"aria-pressed":E,className:`${Ae} ${E?uo:Fe}`,title:E?"Cancel selection":"Select workspaces","aria-label":E?"Cancel selection":"Select workspaces",children:e(Fr,{size:16,strokeWidth:1.8})}),q.refresh&&e("button",{type:"button",onClick:c,className:`${Ae} ${Fe}`,title:"Refresh sessions","aria-label":"Refresh sessions","aria-busy":w,children:e(D,{size:15,strokeWidth:1.8,className:w?"animate-spin":void 0})}),q.sort&&e("div",{className:"relative flex-shrink-0",ref:h,children:[e("button",{type:"button",onClick:k,className:`${Ae} ${l||r!=="A-Z"?uo:Fe}`,title:"Sort workspaces","aria-label":"Sort workspaces",children:e(_s,{size:15,strokeWidth:1.8})}),l&&e("div",{className:"glass-popover absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 rounded-xl shadow-xl z-50 p-2 text-xs",children:e(jo,{variant:"mobile",sortOption:r,onSortChange:y})})]}),z.length>0&&e(ku,{actions:H,sortHidden:z.includes("sort"),sortOption:r,onSortChange:y,layout:"mobile"})]}),e("div",{className:"relative flex items-center",children:[e(U,{size:14,className:"absolute left-3 text-ink/40"}),e("input",{type:"text",value:t,onChange:(X)=>N(X.currentTarget.value),placeholder:"Search workspaces & sessions...",className:"w-full bg-paper border border-ink/15 rounded-xl pl-8 pr-8 py-2 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),t&&e("button",{type:"button",onClick:C,className:"absolute right-2.5 text-ink/40 hover:text-ink p-1","aria-label":"Clear search",children:e(b,{size:13})})]}),(p||r!=="A-Z")&&e("div",{className:"flex items-center space-x-1.5 flex-wrap gap-y-1 pt-0.5",children:[r!=="A-Z"&&e("span",{className:"inline-flex items-center space-x-1 bg-ink/5 border border-ink/10 text-ink/80 rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e("span",{children:["Sort: ",r.replace("_"," ")]}),e("button",{type:"button",onClick:M,className:"hover:text-ink ml-0.5",title:"Reset sort",children:e(b,{size:10})})]}),p&&e("span",{className:"inline-flex items-center space-x-1 bg-warning/15 border border-warning/25 text-warning rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e(at,{size:10}),e("span",{children:"Archived"}),e("button",{type:"button",onClick:I,className:"hover:text-warning-hover ml-0.5",title:"Hide archived",children:e(b,{size:10})})]})]})]})}var wt="p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink";function ho({folder:t,canWorktree:r,onOpenFolder:l,onNewWorktree:p,onSelectSessions:h,confirmDelete:g,onPin:S,onDelete:v,onRequestDelete:x,onCancelDelete:c}){let[w,k]=n(!1),y=i(null),[M,T]=n(null),I=(N)=>()=>{k(!1),N()};return e("div",{className:"relative flex items-center",onClick:(N)=>N.stopPropagation(),children:[e("button",{ref:y,type:"button",onClick:(N)=>{if(N.stopPropagation(),y.current)T(Et(y.current));k((C)=>!C)},className:wt,title:"Workspace options","aria-label":`Options for ${t.name}`,"aria-haspopup":"menu","aria-expanded":w,children:e(Ee,{size:15})}),e(Qt,{anchor:w?M:null,align:"end",ariaLabel:`Options for ${t.name}`,className:"w-48 rounded-lg border border-ink/15 bg-paper py-1 text-xs shadow-lg",onClose:()=>{k(!1),c()},children:e(Ms,{variant:"mobile",isPinned:t.isPinned,onOpenFolder:l?I(l):void 0,onNewWorktree:r&&p?I(p):void 0,onSelectSessions:h?I(h):void 0,confirmDelete:g,onPin:I(S),onDelete:I(v),onRequestDelete:x,onCancelDelete:c})})]})}var bo={inset:"",insetPx:0,slotWidth:16,markGap:8,padding:"py-2",glyph:tt.touch};function go({session:t,harness:r,isActive:l,status:p,awaitingInput:h=!1,timeAgo:g,timeTitle:S,runStartedAt:v,expandable:x=!1,isExpanded:c=!1,onToggleExpand:w,isChild:k=!1,folderId:y,onSelect:M,onArchive:T,onDelete:I,onRename:N,onRenameWithAi:C,waitingFor:A,onCancelWait:E,selectable:O=!1,selected:R=!1,onToggleSelect:L}){let{isEditing:q,draft:z,setDraft:F,inputRef:te,startRename:H,handleKeyDown:X,handleBlur:ae}=Fo(t.title,N),W=Ta(t.id),ne=Lo(),ie=ne.anchor!==null,ee=Boolean(N||T||I||E),J=Boolean(A),de=x&&Boolean(w),Q=t.title.charAt(0).toUpperCase()+t.title.slice(1);if(q)return e("div",{className:"w-full rounded-lg flex items-center bg-ink/10",children:e("input",{ref:te,autoFocus:!0,value:z,onChange:(oe)=>F(oe.currentTarget.value),onKeyDown:X,onBlur:ae,className:"flex-1 min-w-0 mx-2 my-1.5 bg-paper border border-ink/25 rounded px-2 py-1 text-xs text-ink outline-none focus:border-ink/50"})});return e(d,{children:[e("div",{"data-testid":"session-item","data-session-id":String(t.id),"data-menu-open":ie?"true":void 0,onContextMenu:ee&&!O?ne.openAtCursor:void 0,className:`w-full rounded-lg flex items-center transition-colors ${O&&R||ie?Ls:l?"bg-ink/10 font-medium text-ink":"hover:bg-ink/5 text-ink/85"}`,children:[e("button",{type:"button",onClick:O?L:M,className:"flex-1 text-left py-2 flex items-center justify-between min-w-0",children:[e("div",{className:"flex items-center min-w-0 pr-2",children:[O?e(Lr,{checked:R,label:`Select ${t.title}`,onChange:()=>L?.()}):e("span",{className:"w-4 flex-shrink-0 flex items-center justify-center",children:W?e("span",{role:"status","aria-label":"Generating a name…",children:e(m,{size:13,className:"text-ink/50 animate-spin"})}):h?e(De,{size:13,className:"text-ink/70 animate-pulse"}):J?e("span",{role:"status","aria-label":`Waiting for ${A?.title??"another session"}`,children:e(qe,{size:13,className:"text-ink/60 animate-pulse"})}):p==="stream"?e("span",{role:"status","aria-label":"Running",children:e(m,{size:13,className:"text-ink/50 animate-spin"})}):p?e(f,{size:13,className:"text-ink/50"}):k?e("span",{"data-testid":"child-indicator",className:"text-ink/35","aria-hidden":"true",children:e(me,{size:13})}):null}),e("span",{className:"flex flex-col min-w-0 ml-2 leading-snug",children:[e("span",{className:"flex min-w-0 items-center",children:[r&&e("span",{className:"mr-1.5 flex shrink-0 items-center",children:e(Ke,{harness:r,size:tt.touch})}),e("span",{className:"min-w-0 truncate text-xs",children:Q})]}),J&&e("span",{className:"text-[10px] text-ink/40 truncate",children:["waiting for ",A?.title??"another session"]}),t.worktree?e(Qs,{worktree:t.worktree}):null]})]}),e(Fs,{timeAgo:g,timeTitle:S,runStartedAt:v,className:"text-[11px] font-mono flex-shrink-0 ml-2",restingClassName:"text-ink/45"})]}),ee&&!O&&e("button",{type:"button",onClick:ne.openBelow,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":ie,className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 text-ink/35 hover:text-ink rounded-lg cursor-pointer",children:e(Ee,{size:16})}),de&&!O&&e("button",{type:"button",onClick:w,title:c?"Collapse sessions and subagents":"Expand sessions and subagents","aria-expanded":c,"aria-label":c?"Collapse sessions and subagents":"Expand sessions and subagents",className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 flex items-center justify-center text-ink/50 hover:text-ink rounded-lg cursor-pointer",children:c?e(B,{size:14}):e(se,{size:14})})]}),ne.anchor&&e(Mo,{anchor:ne.anchor,sessionId:t.id,...r?{harness:r}:{},...y!==void 0?{folderId:y}:{},isArchived:t.is_archived===1,onRename:N?H:void 0,onRenameWithAi:C,onArchive:T,onDelete:I,onCancelWait:E,onClose:ne.close})]})}function vo(t,r){let[l,p]=n(!1);return{open:()=>p(!0),dialog:l?e(Po,{isOpen:!0,onClose:()=>p(!1),root:t.project_path??null,folderId:t.id,folderName:t.name,onCreated:(h)=>{p(!1),r(h.path)}}):null}}function xo({hiddenCount:t,canShowLess:r,onShowMore:l,onShowLess:p}){if(t<=0&&!r)return null;return e("div",{className:"flex items-center gap-1",children:[t>0&&e("button",{type:"button",onClick:l,className:"flex items-center min-w-0 text-left py-2 pr-3 text-xs text-ink/60 hover:text-ink",children:[e("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:e(B,{size:12})}),e("span",{className:"w-2 shrink-0"}),e("span",{className:"truncate",children:["Show more sessions (",t,")"]})]}),r&&e("button",{type:"button",onClick:p,className:"ml-auto shrink-0 flex items-center gap-1 text-xs text-ink/60 hover:text-ink pl-3 py-2",children:[e(ot,{size:12}),e("span",{className:"truncate",children:"Show less"})]})]})}function wo(t){return t?"mb-4":"mb-1"}function ko({folder:t,activeSessionId:r,onSelectSession:l,onNewSessionForFolder:p,onNewWorktreeSession:h,isExpanded:g,onToggleExpand:S,showArchived:v=!1,sessionStatus:x={},onToast:c,batch:w,onStartSessionSelection:k,onCancelWait:y}){let{visibleCount:M,showMore:T,showLess:I,canShowLess:N}=Ds(),C=vo(t,(G)=>h?.(t.id,G)),{refresh:A,runStartedAtMap:E}=Ve(),{expandedSessionIds:O,toggleSession:R}=hs(),[L]=le(),q=L.get("subagent"),z=L.get("sessionId"),{confirmDelete:F,requestDelete:te,cancelDelete:H,handlePin:X,handleDelete:ae,handleArchive:W,handleRename:ne,handleRenameWithAi:ie,handleOpenFolder:ee}=Ns(t,A,c),J=Qo(),de=X,Q=ae,oe=ee??void 0,pe=(t.sessions||[]).filter((G)=>v?G.is_archived===1:G.is_archived!==1),ke=ra(t.icon),{folderCheckbox:be,sessionCheckboxes:he,folderSummary:V,toggleFolderSelection:j,rendered:Y,hiddenCount:ye}=Os({batch:w,folder:t,sessions:pe,showArchived:v,visibleCount:M,activeSessionId:r,sessionStatus:x}),Pe=Ho(Y),Se=g||he,Ne=(G,Me)=>{let ve=String(G.id),Ye=String(r)===ve,ht=Ye&&z===ve&&Boolean(q),Ue=It(ve);return e(go,{session:G,harness:G.harness,folderId:G.folder_id,isActive:Ye&&!ht,status:x[ve],awaitingInput:Boolean(G.awaitingInput),timeAgo:Rs(G.updated_at??G.created_at),timeTitle:qo(G.updated_at??G.created_at),runStartedAt:x[ve]==="stream"?E[ve]:void 0,expandable:Me.expandable,isChild:Me.isChild,isExpanded:Me.isExpanded,onToggleExpand:Me.onToggleExpand,onSelect:()=>l(G.id),onArchive:()=>W(G),onDelete:Ue?void 0:()=>J.requestDelete(G),onRename:Ue?void 0:(bt)=>void ne(G,bt),onRenameWithAi:Ue?void 0:()=>void ie(G),waitingFor:G.waitingFor?{title:G.waitingFor.title}:void 0,onCancelWait:G.waitingFor?()=>y?.(G.waitingFor.waitId):void 0,selectable:he,selected:Boolean(w?.selected.includes(ve)),onToggleSelect:w?()=>w.toggle(ve):void 0})},ft=(G)=>Ps(G,Pe.childrenOf,O,R);return e("div",{className:wo(Se),"data-testid":"session-folder",children:[e("div",{onClick:w?void 0:S,className:"flex items-center justify-between gap-2 py-1 cursor-pointer hover:bg-ink/5 rounded-lg select-none transition-colors",children:[e("div",{className:"flex items-center space-x-2 min-w-0",children:[be&&V?e(Lr,{size:"md",checked:V.all,indeterminate:V.some,label:`Select ${t.name}`,onChange:j}):e(d,{children:e("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:t.customIconUrl?e("img",{src:t.customIconUrl,alt:"",className:"w-[15px] h-[15px] rounded-xs object-contain",referrerPolicy:"no-referrer"}):t.iconType==="chat"?e(mn,{size:15,className:"text-ink/80"}):e(ke,{size:15,className:"text-ink/80",style:{color:t.accentColor||void 0}})})}),e("span",{className:"text-sm font-semibold text-ink truncate",children:t.name})]}),e("div",{className:"flex items-center space-x-2 text-xs text-ink/60",children:[e("span",{className:"font-mono text-[11px] text-ink/70",children:pe.length}),t.project_path&&e(me,{size:13,className:"text-ink/50 ml-1"}),!w&&e(d,{children:[e("button",{type:"button",onClick:(G)=>{G.stopPropagation(),p(t.id)},className:"p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink",title:"New Session","aria-label":`New session in ${t.name}`,children:e(P,{size:15})}),e(ho,{folder:t,canWorktree:Boolean(h&&t.project_path),onOpenFolder:oe,onNewWorktree:h?()=>C.open():void 0,onSelectSessions:k?()=>k(t.id):void 0,confirmDelete:F,onPin:de,onDelete:Q,onRequestDelete:te,onCancelDelete:H}),e("span",{className:"flex items-center justify-center pr-1",children:g?e(B,{size:14}):e(se,{size:14})})]})]})]}),Se&&e("div",{className:"mt-0.5 space-y-0.5",children:[Pe.roots.map((G)=>{let Me=String(G.id),ve=ft(G);return e("div",{className:"space-y-0.5",children:[Ne(G,ve),ve.isExpanded&&e(Bi,{parentId:Me,hasSubagents:Boolean(G.hasSubagents),childrenOf:Pe.childrenOf,expandedIds:O,onToggle:R,activeSessionId:r===null?null:String(r),renderSession:Ne,style:bo})]},G.id)}),e(xo,{hiddenCount:he?0:ye,canShowLess:!he&&N,onShowMore:T,onShowLess:I})]}),e(Ro,{session:J.pending,isDeleting:J.isDeleting,error:J.error,onClose:J.cancelDelete,onConfirm:()=>void J.confirmDelete()}),C.dialog]})}function yo({folders:t,activeSessionId:r,expandedFolders:l,showArchived:p,sessionStatus:h,onSelectSession:g,onNewSessionForFolder:S,onNewWorktreeSession:v,onToggleFolder:x,onToast:c,batch:w,onStartSessionSelection:k,onCancelWait:y}){return e("div",{className:"flex-1 scrollbar-overlay-container pl-3 pr-2 py-3",children:t.length===0?e("div",{className:"text-center py-12 text-xs text-ink/50 italic",children:"No matching sessions found"}):t.map((M)=>e(ko,{folder:M,activeSessionId:r,onSelectSession:g,onNewSessionForFolder:S,onNewWorktreeSession:v,isExpanded:l[M.id]??!0,onToggleExpand:()=>x(M.id),showArchived:p,sessionStatus:h,onToast:c,batch:w,onStartSessionSelection:k,onCancelWait:y},M.id))})}var kt=[3,2];function No(){return e("div",{className:"flex-1 p-3 space-y-4","aria-hidden":"true",children:kt.map((t,r)=>e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center gap-2 py-2",children:[e("span",{className:"w-4 h-4 rounded-sm animate-pulse bg-ink/10"}),e("span",{className:"h-3 w-24 rounded animate-pulse bg-ink/10"})]}),Array.from({length:t},(l,p)=>e("div",{className:"flex items-center gap-2 rounded py-2",children:[e("span",{className:"w-4 h-4 rounded-full animate-pulse bg-ink/10"}),e("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${58-p%3*12}%`}})]},p))]},r))})}function Co({folders:t,initializing:r,failed:l,activeSessionId:p,expandedFolders:h,sessionStatus:g,searchQuery:S,sortOption:v,optionsOpen:x,showArchived:c,harnessFilter:w,onHarnessFilterChange:k,harnessOptions:y,optionsRef:M,scheduledCount:T,refreshing:I,selecting:N,batch:C,onNewSession:A,onNewWorkspace:E,onScheduler:O,onRefresh:R,onToggleOptions:L,onSortChange:q,onResetSort:z,onToggleArchived:F,onHideArchived:te,onSearchChange:H,onClearSearch:X,onSelectWorkspaces:ae,onSelectSession:W,onNewSessionForFolder:ne,onNewWorktreeSession:ie,onToggleFolder:ee,onToast:J,onStartSessionSelection:de,onCancelWait:Q}){return e(d,{children:[e(fo,{searchQuery:S,sortOption:v,optionsOpen:x,showArchived:c,optionsRef:M,onNewSession:A,onNewWorkspace:E,onScheduler:O,scheduledCount:T,onRefresh:R,refreshing:I,onToggleOptions:L,onSortChange:q,onResetSort:z,onToggleArchived:F,onHideArchived:te,onSearchChange:H,onClearSearch:X,onSelectWorkspaces:ae,selecting:N}),e("div",{className:"px-3 pt-2 pb-1",children:e(Ts,{options:y,value:w,onChange:k,touch:!0})}),l?e($s,{touch:!0,onRetry:R,refreshing:I}):r?e(No,{}):e(yo,{folders:t,activeSessionId:p,expandedFolders:h,showArchived:c,sessionStatus:g,onSelectSession:W,onNewSessionForFolder:ne,onNewWorktreeSession:ie,onToggleFolder:ee,onToast:J,batch:C,onStartSessionSelection:de,onCancelWait:Q})]})}function To({sidebarStyle:t,controller:r,batch:l,dock:p,dockBody:h,expandedFolders:g,optionsRef:S,activeSessionId:v,scheduledCount:x,onToggleFolder:c,onNewSession:w,onNewWorkspace:k,onScheduler:y,onToggleArchived:M,onNewSessionForFolder:T,onNewWorktreeSession:I,onToast:N,onArchiveSelected:C,onCancelWait:A}){let{initializing:E,failed:O,refreshNow:R,isRefreshing:L,searchQuery:q,setSearchQuery:z,showArchived:F,setShowArchived:te,optionsOpen:H,setOptionsOpen:X,sortOption:ae,handleSortChange:W,harnessFilter:ne,setHarnessFilter:ie,harnessOptions:ee,processedFolders:J,sessionStatus:de,handleSelectSession:Q}=r,{selection:oe,deleteRun:pe,archiveRun:ke,binding:be,scopeFolder:he,available:V,selected:j}=l,Y={className:"flex-1 min-h-0 w-full",folders:J,initializing:E,failed:O,activeSessionId:v,sessionStatus:de,searchQuery:q,onSearchChange:z,showArchived:F,onToggleArchived:M,sortOption:ae,optionsOpen:H,onToggleOptions:()=>X(!H),onCloseOptions:()=>X(!1),onSortChange:W,harnessFilter:ne,onHarnessFilterChange:ie,harnessOptions:ee,onRefresh:R,refreshing:L,scheduledCount:x,onNewSession:w,onNewWorkspace:k,onScheduler:y,onSelectSession:Q,onNewSessionForFolder:T,onNewWorktreeSession:I,onToast:N,onCancelWait:A,batch:be,onSelectWorkspaces:l.toggleWorkspaceSelection,onStartSessionSelection:(ye)=>oe.begin("session",ye)};return e(d,{children:[e("div",{className:p.showingSessions?"contents":"hidden",children:[t==="modern"?e(xu,{...Y,touch:!0}):e(Co,{folders:J,initializing:E,failed:O,activeSessionId:v,expandedFolders:g,sessionStatus:de,searchQuery:q,sortOption:ae,optionsOpen:H,showArchived:F,harnessFilter:ne,onHarnessFilterChange:ie,harnessOptions:ee,optionsRef:S,scheduledCount:x,refreshing:L,selecting:oe.mode!==null,batch:be,onNewSession:w,onNewWorkspace:k,onScheduler:y,onRefresh:R,onToggleOptions:()=>X(!H),onSortChange:W,onResetSort:()=>W("A-Z"),onToggleArchived:M,onHideArchived:()=>te(!1),onSearchChange:z,onClearSearch:()=>z(""),onSelectWorkspaces:l.toggleWorkspaceSelection,onSelectSession:Q,onNewSessionForFolder:T,onNewWorktreeSession:I,onToggleFolder:c,onToast:N,onStartSessionSelection:(ye)=>oe.begin("session",ye),onCancelWait:A}),oe.mode&&e(Iu,{drawer:!0,mode:oe.mode,count:j.length,total:V.length,busy:pe.isDeleting,archiving:ke.isArchiving,scopeLabel:he?.name,onSelectAll:()=>oe.selectAllOf(V),onUnselectAll:()=>oe.unselectAllOf(V),onDelete:()=>pe.request(j),onArchive:C,onCancel:oe.end})]}),p.showingSessions?null:e(mo,{panelKey:p.activeView,panel:p.activePanel,body:h})]})}function Eo(t,r){let l=t.tabs;ks({enabled:t.tabsMode,revealed:Vm(r),storedView:t.activeView,home:l?.home??!1,chosenHome:l?.chosenHome??!1,openTab:l?.open??null,known:new Set(t.catalog.map((g)=>g.id))});let p=i(!1),h=l?{...l,select:(g)=>{p.current=!0,l.select(g)},open:(g)=>{p.current=!0,l.open(g)},close:(g)=>{p.current=!0,l.close(g)}}:null;return o(()=>{if(!t.tabsMode||!l)return;if(l.active!==null&&l.active!==t.activeView)t.setActiveView(l.active)},[t.tabsMode,l?.active,t.activeView,t.setActiveView]),o(()=>{if(!t.tabsMode||!l)return;if(p.current){p.current=!1;return}if(l.tabs.includes(t.activeView))return;if(!t.catalog.some((g)=>g.id===t.activeView))return;l.open(t.activeView)},[t.tabsMode,l,t.activeView,t.catalog]),{tabs:h}}function _e(t){return{dragRegion:!0,layout:"mobile",rootProps:{...Da(),...t},style:{paddingLeft:Ai(gi("0.75rem",!0)),paddingRight:vl("0.75rem",!0)}}}function Ao({side:t,onClose:r}){let l=t==="left"?nn:Zn;return e("button",{type:"button",onClick:r,className:`${$e.mobile} flex-none cursor-pointer rounded-lg text-ink/60 transition-colors hover:bg-ink/5 hover:text-ink titlebar-no-drag`,title:t==="left"?"Tutup panel kiri":"Tutup panel kanan","aria-label":t==="left"?"Close left sidebar":"Close right sidebar",children:e(l,{size:Tr.mobile,strokeWidth:1.8})})}function Wo({activeSessionId:t,newWorkspaceOpen:r,onCloseNewWorkspace:l,schedulerOpen:p,onCloseScheduler:h,aboutOpen:g,onCloseAbout:S,updates:v,pushToast:x,batchDelete:c,batchMode:w,onEndBatch:k,scopeLabel:y}){return e(d,{children:[e(ms,{isOpen:r,onClose:l,onCreate:bl,onClone:yl}),e(vu,{isOpen:p,onClose:h,activeSessionId:t===null?null:String(t),onToast:x}),e(ud,{isOpen:g,onClose:S,updates:v,onToast:x}),e(Jm,{updates:v}),e(_u,{mode:w??"session",count:c.pending.length,scopeLabel:y,isDeleting:c.isDeleting,progress:c.progress,outcome:c.outcome,onClose:()=>{let M=c.outcome?.refused.length??0;if(c.cancel(),c.outcome&&M===0)k()},onConfirm:()=>{let M=w??"session";c.confirm(M).then((T)=>{if(T&&T.refused.length===0)k()})}})]})}function Bo(){let t=Dt(),r=rr("left"),[l,p]=Ha("layout.mobileLeftPanel",Te),h=Hm(l,t.enabled),g=Qd("left"),S=t.enabled&&g==="tabs",v=u(()=>new Set(r.map((c)=>c.id)),[r]),x=vs("left",v,Te);return{catalog:r,activeView:h,setActiveView:p,showingSessions:h===Te,activePanel:r.find((c)=>c.id===h),enabled:t.enabled,tabsMode:S,tabs:S?x:null}}function _o(t){return{className:"w-full h-full",sessionId:t.sessionId===null?null:String(t.sessionId),enabled:t.requiresWorkspace?t.hasActiveContext===!0:!0,active:!0,refreshKey:t.refreshKey,...t.rootPath?{rootPath:t.rootPath}:{},...t.onRefresh?{onRefresh:t.onRefresh}:{},...t.onOpenFile?{onOpenFile:t.onOpenFile}:{},onClose:t.onClose,showHeader:!1,layout:"phone"}}function Vo({appSettings:t,onSelectSession:r,onClose:l,rootPath:p,refreshKey:h,onRefresh:g,onOpenFile:S}){let v=wu(t,{onSelectSession:r,onAfterSelect:l}),{folders:x,processedFolders:c,refreshNow:w,showArchived:k,activeSessionId:y}=v,M=Bu(c,k,w),[T,I]=n({1:!0,2:!0,3:!0}),N=i(null);ue(N,()=>v.setOptionsOpen(!1));let C=(R)=>{I((z)=>({...z,[R]:!z[R]}));let L=x.find((z)=>z.id===R),q=!(T[R]??L?.isExpanded??!0);Ud(R,q)},A=c.map((R)=>`${R.id}:${R.isExpanded}`).join("|");o(()=>{I(Object.fromEntries(c.map((R)=>[R.id,R.isExpanded])))},[A]);let E=Bo(),O=_o({sessionId:y,refreshKey:h,rootPath:p,onRefresh:g,onOpenFile:S,onClose:l,requiresWorkspace:E.activePanel?.requiresWorkspace??!1,hasActiveContext:Boolean(p)});return{controller:v,batch:M,expandedFolders:T,toggleFolder:C,optionsRef:N,dock:E,dockBody:O}}function ze(t){let{disabledPanels:r}=gn(),{setEnabled:l}=tl(),p=Le(),h=Wm(t),g=a((S,v)=>{l(S,v)},[l]);return{...p,items:h,hidden:r,toggle:g}}function Ko({activeSessionId:t,onSelectSession:r,onNewSession:l,onNewSessionForFolder:p,onNewWorktreeSession:h,onClose:g,onDesktopToggle:S,appSettings:v={},rootPath:x,refreshKey:c=0,onRefresh:w,onOpenFile:k,revealSignal:y=0}){let{controller:M,batch:T,expandedFolders:I,toggleFolder:N,optionsRef:C,dock:A,dockBody:E}=Vo({appSettings:v,onSelectSession:r,onClose:g,rootPath:x,refreshKey:c,onRefresh:w,onOpenFile:k}),{showArchived:O,setShowArchived:R}=M,{selection:L,deleteRun:q,archiveRun:z,selected:F,scopeFolder:te}=T,H=ld(),X=ze("left"),[ae,W]=n(!1),[ne,ie]=n(!1),ee=yu(),[J,de]=n(!1),{pushToast:Q}=He(),oe=hl(Q);Cu({onNotice:Q});let{updates:pe,shellDownload:ke}=ao({onClose:g,openAbout:()=>de(!0),pushToast:Q}),{tabs:be}=Eo(A,y),he=()=>{l(),g()},V=()=>{z.archive(F).then((Se)=>{if(!Se)return;let Ne=Eu(Se);if(Ne)Q(Ne.message,Ne.tone);if(!Se.error)L.end()})},j=(Se)=>{p(Se),g()},Y=()=>{R(!O)},ye=h?(Se,Ne)=>{h(Se,Ne),g()}:void 0,Pe=e(To,{sidebarStyle:H,controller:M,batch:T,dock:A,dockBody:E,expandedFolders:I,optionsRef:C,activeSessionId:t,scheduledCount:ee,onToggleFolder:N,onNewSession:he,onNewWorkspace:()=>W(!0),onScheduler:()=>ie(!0),onToggleArchived:Y,onNewSessionForFolder:j,...ye?{onNewWorktreeSession:ye}:{},onToast:Q,onArchiveSelected:V,onCancelWait:oe});return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative select-none",children:[e(ro,{onClose:g,viewLabel:A.showingSessions?"Sessions":A.activePanel?.label??"Panel",menuProps:X.surfaceProps}),!A.tabsMode&&co(A.enabled)?e(po,{panels:A.catalog,activeId:A.activeView,onSelect:A.setActiveView,menuProps:X.surfaceProps}):null,A.tabsMode&&be?e("div",{className:"flex-1 min-h-0 flex flex-col",children:e(ys,{catalog:A.catalog,tabs:be,pinned:Te,homeTitle:"Panel kiri",stripProps:_e(X.surfaceProps),children:e("div",{className:"h-full w-full",children:Pe})})}):null,X.anchor?e(Oo,{anchor:X.anchor,items:X.items,hidden:X.hidden,onToggle:X.toggle,onClose:X.close}):null,A.tabsMode?null:e("div",{className:"contents",children:Pe}),e(so,{onSettings:()=>window.dispatchEvent(new CustomEvent("omp:open-settings",{detail:{}})),onKeyBindings:Uc,onAbout:()=>de(!0),shellDownload:ke,onDesktopToggle:S,updateAvailable:pe.hasUpdate,onUpdateClick:()=>{de(!0),pe.check()}}),e(Wo,{activeSessionId:t,newWorkspaceOpen:ae,onCloseNewWorkspace:()=>W(!1),schedulerOpen:ne,onCloseScheduler:()=>ie(!1),aboutOpen:J,onCloseAbout:()=>de(!1),updates:pe,pushToast:Q,batchDelete:q,batchMode:L.mode,onEndBatch:L.end,scopeLabel:te?.name})]})}function $o({catalog:t,activeId:r,onSelect:l,hasGitChanges:p,onClose:h,menuProps:g}){return e("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas titlebar-drag-region select-none",...Da(),...g,style:zo(),children:[e("div",{className:"flex items-center min-w-0 titlebar-no-drag",children:e(Be,{panels:t,activeId:r,onSelect:l,hasGitChanges:p})}),e("button",{type:"button",onClick:h,className:"p-1.5 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 ml-2 titlebar-no-drag",title:"Close right sidebar","aria-label":"Close right sidebar",children:e(b,{size:20,strokeWidth:1.8})})]})}function je({panel:t,body:r}){if(!t)return e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e(Je,{fallback:e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono",children:"Loading…"})}),children:e(Io,{value:r,children:t.render(r)})})}function Uo({enabled:t=!0,rootPath:r,refreshKey:l=0,onRefresh:p,onOpenFile:h,onClose:g,revealSignal:S=0}){let[v,x]=Ha("layout.mobileRightPanel",uc),{sessionId:c}=Oe(),w=Dt(),k=lo(rr("all"),Te,w.enabled),y=k.find((W)=>W.id===v)??k[0],T=Qd("right")==="tabs",I=u(()=>new Set(k.map((W)=>W.id)),[k]),N=vs("right",I,null),C=xe(c,"layout.mobileRightPanel")!==void 0;ks({enabled:T,revealed:Vm(S),storedView:C?v:null,home:N.home,chosenHome:N.chosenHome,openTab:N.open,known:I});let{open:A,tabs:E}=N,O=(W)=>{if(W!==y?.id)Re(W)},R=i(!1),L={...N,select:(W)=>{R.current=!0,O(W),N.select(W)},open:(W)=>{R.current=!0,O(W),N.open(W)},close:(W)=>{R.current=!0,N.close(W)}};o(()=>{if(!T)return;if(N.active!==null&&N.active!==v)x(N.active)},[T,N.active,v,x]),o(()=>{if(!T||N.home)return;if(R.current){R.current=!1;return}if(!C)return;if(E.includes(v)||!I.has(v))return;A(v)},[T,N.home,C,v,E,A,I]);let q=Wp(r,t),{changes:z}=el(r,q,t),F=z.length>0,te=a((W)=>{if(W!==y?.id)Re(W);x(W)},[y?.id,x]);o(()=>{if(!Ge(y?.id))gc()},[y?.id]);let H=ze(w.enabled?"right":"all"),X=w.enabled?H.items:H.items.filter((W)=>W.id!==Te),ae={className:"h-full w-full",enabled:t||!y?.requiresWorkspace,active:!0,refreshKey:l,...r?{rootPath:r}:{},onRefresh:p,onOpenFile:h,onClose:g,showHeader:!1,layout:"phone"};return e("div",{className:"flex flex-col h-full w-full bg-paper text-ink relative select-none",children:[T?null:e($o,{catalog:k,activeId:y?.id??v,onSelect:te,hasGitChanges:F,onClose:g,menuProps:H.surfaceProps}),T?e("div",{className:"flex-1 min-h-0 flex flex-col",children:e(ys,{catalog:k,tabs:L,homeTitle:"Panel kanan",stripProps:_e(H.surfaceProps),actions:e(Ao,{side:"right",onClose:g}),children:e("div",{className:"h-full w-full",children:e(je,{panel:y,body:ae})})})}):null,H.anchor?e(Oo,{anchor:H.anchor,align:"right",items:X,hidden:H.hidden,onToggle:H.toggle,onClose:H.close}):null,T?null:e("div",{className:"flex-1 min-h-0 overflow-hidden relative",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:e(je,{panel:y,body:ae})})]})}function Ce({label:t,onClick:r,active:l=!1,danger:p=!1,children:h}){let g=p?"bg-error text-canvas hover:bg-error/90":l?"bg-ink text-canvas":"text-ink/70 hover:bg-ink/10 hover:text-ink";return e("button",{type:"button",onClick:r,title:t,"aria-label":t,"aria-pressed":l||void 0,className:`${$e.mobile} flex-none cursor-pointer rounded-lg transition-colors ${g}`,children:h})}var we=Tr.mobile;function Xo({actions:t}){let[r,l]=n(!1),p=i(null);return ue(p,()=>l(!1),r),o(()=>{if(!r)return;let h=(g)=>{if(g.key==="Escape")l(!1)};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[r]),e("div",{className:"relative flex-none",ref:p,children:[e("button",{type:"button",onClick:()=>l((h)=>!h),title:"More file actions","aria-label":"More file actions","aria-haspopup":"menu","aria-expanded":r,className:`${$e.mobile} flex-none cursor-pointer rounded-lg text-ink/70 transition-colors hover:bg-ink/10 hover:text-ink`,children:e(Ee,{size:Tr.mobile})}),r?e("div",{role:"menu","aria-label":"File actions",className:"absolute right-0 top-full z-50 mt-1 w-52 overflow-hidden rounded-xl border border-ink/15 bg-paper py-1 text-xs shadow-lg",children:t.map((h)=>{let g=h.icon;return e("button",{type:"button",role:"menuitem",onClick:()=>{l(!1),h.onSelect()},className:"flex w-full items-center gap-2 px-3 py-2.5 text-left text-ink/80 transition-colors hover:bg-ink/5 hover:text-ink",children:[e(g,{size:15,className:"flex-none text-ink/60"}),e("span",{className:"truncate",children:h.label})]},h.id)})}):null]})}var yt=420;function Yo({fileName:t,hasPreview:r,isPreview:l,hasReview:p,isReviewing:h,onToggleReview:g,wordWrap:S,copied:v,byteViewer:x=!1,missing:c=!1,onSave:w,onClose:k,onTogglePreview:y,onToggleFind:M,findOpen:T,onToggleWrap:I,onZoomOut:N,onZoomIn:C,onCopy:A,onDownload:E}){let O=Gc(yt),R=u(()=>{let L=[];if(!x)L.push({id:"wrap",label:S?"Word wrap: on":"Word wrap: off",icon:rn,onSelect:I},{id:"zoom-out",label:"Decrease font size",icon:Fa,onSelect:N},{id:"zoom-in",label:"Increase font size",icon:Ra,onSelect:C});if(!O)L.push({id:"copy",label:v?"Copied":"Copy content",icon:v?f:re,onSelect:A},{id:"download",label:"Download file",icon:fe,onSelect:E});return L},[x,O,S,v,I,N,C,A,E]);return e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between gap-1 px-3 flex-shrink-0 titlebar-drag-region",style:zo(),children:[e("div",{className:"flex items-center gap-1 min-w-0 titlebar-no-drag",children:[e(Ce,{label:"Close editor",onClick:k,children:e(an,{size:we,strokeWidth:2})}),e("div",{className:"flex min-w-0 items-center gap-1.5",children:[e(ct,{name:t,size:15,className:`flex-shrink-0${c?" text-error":""}`}),e("span",{className:`truncate font-semibold text-xs${c?" text-error line-through":" text-ink"}`,children:t})]})]}),e("div",{className:"flex flex-none items-center gap-0.5 text-ink/70 titlebar-no-drag",children:[c&&w&&e(Ce,{label:"Save and recreate the file",onClick:w,danger:!0,children:e(mt,{size:we})}),!x&&e(Ce,{label:T?"Close find":"Find in file",onClick:M,active:T,children:e(U,{size:we})}),p&&e(Ce,{label:h?"Exit review mode":"Review this document",onClick:g,active:h,children:e(mn,{size:we})}),r&&e(Ce,{label:l?"View source":"Show preview",onClick:y,active:l,children:l?e(Tt,{size:we}):e(We,{size:we})}),O&&e(d,{children:[e(Ce,{label:"Copy content",onClick:A,children:v?e(f,{size:we,className:"text-success"}):e(re,{size:we})}),e(Ce,{label:"Download file",onClick:E,children:e(fe,{size:we})})]}),R.length>0&&e(Xo,{actions:R})]})]})}function Zo({fileName:t,content:r,path:l,root:p,repo:h,fontSize:g,scrollRef:S,onScroll:v,isLoading:x,unsupported:c,loadError:w,reviewActive:k,onExitReview:y}){return e("div",{ref:S,onScroll:v,"data-testid":"editor-scroller",className:"flex-1 min-h-0 overflow-auto relative bg-paper text-ink select-text",children:x?e("div",{className:"flex items-center justify-center h-full text-ink/40 text-xs gap-2",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading file content..."})]}):c?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(Yc,{size:20,className:"text-ink/40"}),e("span",{className:"text-xs text-ink/70 font-sans",children:[t," cannot be opened here"]}),e("span",{className:"text-[11px] text-ink/50 font-sans max-w-[42ch]",children:c})]}):w?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(_,{size:20,className:"text-error"}),e("span",{className:"text-xs text-error font-sans",children:["Could not read ",t]}),e("span",{className:"text-[11px] text-ink/50 font-mono break-all",children:w})]}):e("div",{className:"p-4 bg-paper text-ink min-h-full font-sans",style:{fontSize:`${g}px`},children:e(Zc,{content:r,file:{name:t,path:l,root:p,repo:h},active:k,onExit:y})})})}function Jo({file:t,editor:r,viewerKind:l,byteViewer:p,isPreview:h,isMd:g,content:S,language:v,wordWrap:x,fileKey:c,revealMarks:w,currentMark:k,surfaceRef:y,setCodeScroller:M,previewRef:T,scroll:I,fontSize:N,reviewActive:C,onExitReview:A,editorTheme:E,editorFontFamily:O,indentUnitText:R,typing:L}){let q=a(async(z)=>{let F=await iu(t,z,{interactive:!0,baseMtimeMs:r.baseMtimeMs});if(F.status==="written")return{ok:!0};if(F.status==="conflict")return{ok:!1,error:"This file changed on disk since it was opened."};if(F.status==="needs-permission")return{ok:!1,error:"Tap Save again to grant write access."};return{ok:!1,error:F.error}},[t,r.baseMtimeMs]);if(r.isImage&&r.imageUrl)return e(wi,{src:r.imageUrl,name:t.name,className:"flex-1 min-h-0"});if(r.isImage||au(l)&&(p||h))return e(Sl,{kind:l,path:t.path??t.name,name:t.name,source:r.byteSource,content:r.content,revision:r.revision,onContentChange:r.onChange,onSaveBytes:r.deviceBacked?void 0:q,onDirtyChange:r.setBinaryDirty});if(r.isLoading||r.unsupported||r.loadError||g&&h)return e(Zo,{fileName:t.name,content:S,path:t.path??t.name,root:t.root,repo:t.repo,fontSize:N,scrollRef:T,onScroll:I.onScroll,isLoading:r.isLoading,unsupported:r.unsupported,loadError:r.loadError,reviewActive:C,onExitReview:A});return e(eu,{ref:y,value:S,onValueChange:r.onChange,language:v,wordWrap:x,documentKey:c,marks:w,currentMark:k,onScroller:M,scrollTestId:"editor-scroller",className:"flex-1 min-h-0 text-ink select-text",themeVars:E.vars,themes:E.themes,indentUnitText:R,typing:L,padding:12,placeholder:"This file is empty",style:{fontFamily:O,fontSize:`${N}px`,lineHeight:ll}})}function et(){return e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-error/30 bg-error/10 text-error shrink-0",children:[e(_,{size:14,className:"shrink-0 mt-0.5"}),e("div",{className:"min-w-0",children:[e("div",{className:"text-[11.5px] font-sans",children:"This file was deleted from disk."}),e("div",{className:"text-[11px] font-sans text-error/80",children:"The buffer is still here. Saving recreates the file — autosave is off until then."})]})]})}function nt({isImage:t,byteViewer:r,viewerKind:l,lineCount:p,charCount:h,language:g,saveStatus:S,path:v,conflicts:x=0}){return e("footer",{className:"bg-canvas border-t border-ink/10 px-3 flex items-center justify-between text-[10px] text-ink/60 flex-shrink-0 font-mono",style:{height:"calc(1.75rem + env(safe-area-inset-bottom, 0px))",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px))"},children:[e("div",{className:"flex items-center space-x-3",children:t?e("span",{className:"uppercase",children:"Image"}):r?e("span",{className:"uppercase",children:Go[l]}):e(d,{children:[x>0&&e("span",{className:"text-error font-semibold tabular-nums",children:["⚠ ",x]}),e("span",{children:[p," lines"]}),e("span",{children:[h," chars"]}),e("span",{className:"uppercase",children:g})]})}),e("div",{className:"flex items-center space-x-2",children:[S==="saving"&&e(d,{children:[e(m,{size:10,className:"animate-spin"}),e("span",{children:"Saving…"})]}),S==="saved"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),e("span",{children:"Saved"})]}),S==="error"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-error"}),e("span",{className:"text-error",children:"Save failed"})]}),S==="idle"&&v&&e("span",{className:"truncate max-w-[140px]",children:v})]})]})}function it({path:t,content:r,ready:l,surfaceRef:p}){let h=cu(t,r,l),g=i(null);return o(()=>{if(!h||g.current===h.request)return;g.current=h.request;let S=h.matches[h.currentIndex];if(!S)return;p.current?.select(S.start,S.end,!1),p.current?.revealOffset(S.start)},[h,p]),{matches:h?.matches??[],currentIndex:h?.currentIndex??-1}}function rt({path:t,content:r,documentKey:l,ready:p,surfaceRef:h,toggleWordWrap:g}){let S=it({path:t,content:r,ready:p,surfaceRef:h}),v=lu({text:r,documentKey:l,readSelection:()=>h.current?.getSelection()??null,select:(x,c,w=!0)=>h.current?.select(x,c,w),reveal:(x)=>h.current?.revealOffset(x),applyDocument:(x,c,w)=>h.current?.applyDocument(x,c,w),toggleWordWrap:g});if(v.open&&v.matches.length>0)return{find:v,revealMarks:v.matches,currentMark:v.currentIndex};return{find:v,revealMarks:S.matches.length>0?S.matches:void 0,currentMark:S.currentIndex}}function st({path:t,symbols:r,total:l,truncated:p,emptyNotice:h,preview:g=!1}){let[S,v]=n(!1);if(!t)return null;let x=(c,w)=>{if(v(!1),g){let k=nd(r,w);if(k)rs({path:t,...k});return}ns({path:t,line:c.line,column:c.column,length:c.name.length})};return e(d,{children:[e("div",{className:"absolute bottom-14 right-3 z-20",children:e("button",{type:"button",onClick:()=>v(!0),"aria-label":`Outline (${l} symbols)`,title:"Outline",className:"flex h-9 w-9 items-center justify-center rounded-full border border-ink/20 bg-paper text-ink/60 shadow-sm transition-all hover:bg-ink/5 hover:text-ink",children:e(Yr,{size:16})})}),S&&e(Z,{onClose:()=>v(!1),maxWidthClass:"max-w-sm",zClass:"z-[70]",header:e("div",{className:"flex min-w-0 items-center gap-2",children:[e(Yr,{size:15,className:"flex-shrink-0 text-ink/50"}),e("span",{className:"text-sm font-medium",children:"Outline"}),e("span",{className:"font-mono text-[11px] text-ink/40",children:p?`${r.length}/${l}`:l})]}),children:e("div",{className:"max-h-[60vh] overflow-y-auto scrollbar-overlay-container py-1",children:[r.length===0?e("div",{className:"px-4 py-3 text-[11px] italic text-ink/40",children:h}):r.map((c,w)=>e("button",{type:"button",onClick:()=>x(c,w),"aria-label":g?`${ei(c.kind)} ${c.name}`:`${ei(c.kind)} ${c.name}, line ${c.line}`,className:"flex w-full min-w-0 items-center gap-2 px-4 py-2 text-left transition-colors hover:bg-ink/5 active:bg-ink/10",style:{paddingLeft:`${16+c.depth*12}px`},children:[e(Vu,{kind:c.kind,size:13}),e("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-ink",children:c.name}),!g&&e("span",{className:"flex-shrink-0 font-mono text-[10px] text-ink/40",children:c.line})]},`${c.line}:${c.kind}:${c.name}`)),p&&e("div",{className:"px-4 py-2 text-[11px] italic text-ink/40",children:Yu(l)})]})})]})}function lt({file:t,missing:r=!1,onClose:l,onFileSaved:p,onDropResult:h}){let g=Es(t.path??t.name),[S,v]=n({}),[x,c]=n(So),[w,k]=n(!0),y=Do(),M=Ci(),T=Au(),I=bu(),N=g==="markdown",C=Td[g]===!0,A=Cs[g]===!0,E=t.path??t.name,O=S[E]??A,R=mu(String(E)),L=N&&O,q=()=>v((Y)=>({...Y,[E]:!O})),z=qc({enabled:Boolean(t.root),onResult:h}),F=su(t,{flushOnUnmount:!0,reportSaveError:!0,downloadMimeType:"text/plain;charset=utf-8",onFileSaved:p,missing:r}),[te,H]=n(null),X=kl({tabKey:E,surface:N&&O?"rendered":"code",ready:F.loaded,slot:Ph,element:N&&O?void 0:te}),[ae,W]=n(null),ne=a((Y)=>{X.ref(Y),W(Y)},[X.ref]);nu({path:t.path??null,scroller:ae,preview:N&&O});let ie=i(null),{find:ee,revealMarks:J,currentMark:de}=rt({path:t.path??null,content:F.content,documentKey:`${E}\x00${F.language}`,ready:F.loaded&&!F.loadError,surfaceRef:ie,toggleWordWrap:()=>k((Y)=>!Y)}),{content:Q,language:oe}=F,pe=Q.split(`
|
|
2
|
-
`).length,ke=Xc(Q);uu({file:{id:E,name:t.name,path:t.path??E},editor:F,surfaceRef:ie,isPreview:O,exitPreview:()=>v((Y)=>({...Y,[E]:!1})),publish:!1});let{symbols:be,total:he,truncated:V,notice:j}=Ju({content:Q,language:oe,path:t.path??null,state:C?"not-a-document":F.loadError?"error":F.loaded?"ready":"loading",note:C?`${Go[g]} files have no text outline.`:F.loadError});return e("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col font-mono text-xs select-none",...z.dropProps,...z.captureDropProps,children:[e(_l,{visible:z.isDragging}),e(Yo,{fileName:t.name,hasPreview:A,isPreview:O,wordWrap:w,copied:F.copied,byteViewer:C,missing:r,onSave:F.saveNow,onClose:l,onTogglePreview:q,hasReview:L,isReviewing:L&&R.active,onToggleReview:R.toggle,onToggleFind:()=>ee.open?ee.close():ee.openFind(),findOpen:ee.open,onToggleWrap:()=>k(!w),onZoomOut:()=>c((Y)=>Math.max(cl,Y-1)),onZoomIn:()=>c((Y)=>Math.min(ul,Y+1)),onCopy:F.copy,onDownload:F.download}),r&&e(et,{}),F.diskChange&&e(du,{fileName:t.name,onReload:F.reloadFromDisk,onKeepMine:F.keepMineAgainstDisk}),ee.open&&!C&&e("div",{className:"relative shrink-0 h-9 border-b border-ink/10 bg-paper",children:e(tu,{find:ee})}),e(Jo,{file:t,editor:F,viewerKind:g,byteViewer:C,isPreview:O,isMd:N,content:Q,language:oe,wordWrap:w,fileKey:E,revealMarks:J,currentMark:de,surfaceRef:ie,setCodeScroller:H,previewRef:ne,scroll:X,fontSize:x,reviewActive:L&&R.active,onExitReview:R.toggle,editorTheme:M,editorFontFamily:y,indentUnitText:gu(T),typing:I}),!C&&e(st,{path:t.path??null,symbols:be,total:he,truncated:V,emptyNotice:j,preview:N&&O}),e(nt,{isImage:F.isImage,byteViewer:C,viewerKind:g,lineCount:pe,charCount:Q.length,language:oe,saveStatus:F.saveStatus,path:t.path,conflicts:ke}),F.saveMissingConfirm&&t.path&&e(pu,{fileName:t.name,filePath:t.path,onClose:F.cancelSaveMissing,onConfirm:F.confirmSaveMissing})]})}function dt({diff:t,onClose:r,onFileSaved:l}){let p=t.path.split("/").pop()||t.path,h=Boolean(t.staged),g=t.status||"M",S=er(g,h);return e("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col",children:[e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0",style:zo(),children:[e("div",{className:"flex items-center space-x-2 min-w-0 pr-2",children:[e("button",{type:"button",onClick:r,className:"p-1.5 -ml-1 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0",title:"Back","aria-label":"Close diff",children:e(an,{size:18,strokeWidth:1.9})}),e(ct,{name:p,size:14,className:"flex-shrink-0"}),e("span",{className:"font-mono text-xs text-ink font-medium truncate",title:t.path,children:p})]}),e("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border flex-shrink-0 ${S.badgeBgClass}`,children:[S.charStatus," ",S.label]})]}),e("div",{className:"flex-1 min-h-0",children:e(Jc,{className:"h-full",viewModeButtons:!1,filePath:t.path,status:g,isStaged:h,root:t.root,repo:t.repo||".",journalDiff:t.journal,readOnly:Boolean(t.journal),onFileSaved:l,tabKey:t.journal?rf(t.journal.path,t.journal.from,t.journal.to):nf(t.path,h)})})]})}function Ie(t,r){let l=t[r];return typeof l==="string"&&l.length>0?l:void 0}function Nt(t){let r=t.content;return typeof r==="string"?r:void 0}function Xe(t,r){let l=typeof t==="object"&&t!==null?t:{},p=(Ie(l,"path")??"").replace(/^\/+/,"");if(!p)return null;return{name:Ie(l,"name")??p.split("/").pop()??"file",path:p,content:Nt(l),root:Ie(l,"root")??r??void 0,repo:Ie(l,"repo"),handleId:Ie(l,"handleId"),deviceFile:l.deviceFile===!0?!0:void 0}}function pt(t){if(!t)return[];return[{id:"mobile-editor",path:t.path,root:t.root,repo:t.repo,content:t.content,handleId:t.handleId,deviceFile:t.deviceFile}]}function ut(t,r,l){Za(l);let p=nr(r);return ln(p,Pg,{folderId:r,worktreePath:l}),t.setSearchParams((h)=>{let g=Rt(h);return g.set("sessionId",p),g.set("folderId",r.toString()),g},{replace:!0}),t.afterNavigate?.(),p}function cp({onDesktopToggle:t,appSettings:r={}}){let{folders:l,isMock:p}=Ve(),h=Dt(),{sessionId:g}=Oe(),[S,v]=le(),x=S.get("sessionId"),c=x?Number.isNaN(Number(x))?x:Number(x):null,w=S.get("folderId"),k=w?Number.isNaN(Number(w))?w:Number(w):null,[y,M]=n("main"),T=Qe({dock:h,sessionId:g,currentScreen:y,setCurrentScreen:M}),[I,N]=n(null),[C,A]=n(null),[E,O]=n(0),[R,L]=n(!1),[q,z]=n("appearance"),[F,te]=n(!1),H=a(()=>O((V)=>V+1),[]),X=ou(pt(I),E),{pushToast:ae}=He(),W=a((V)=>ae(V.message,V.ok?"success":"error"),[ae]),ne=X.size>0;Ze({editorOpen:I!==null,diffOpen:C!==null,settingsOpen:R,offMainScreen:y!=="main",onCloseEditor:()=>N(null),onCloseDiff:()=>A(null),onCloseSettings:()=>{L(!1),te(!1)},onReturnToMain:()=>M("main")});let{folder:ie}=no(l,c),ee=ie??(k?l.find((V)=>String(V.id)===String(k))??null:null),J=xf(l,c)??ee?.project_path??null,de=!!ee,Q=qc({enabled:de,onResult:W});ge("omp:open-file",(V)=>{let Y=Xe(V.detail,J);if(Y)N(Y)}),ge("omp:open-diff",(V)=>{let j=V.detail;if(!j?.file)return;A({path:j.file.replace(/^\/+/,""),status:j.status,staged:j.staged,repo:j.repo,root:j.root??J??void 0,...j.source==="journal"&&j.journal?{journal:j.journal}:{}})}),ge("omp:view-subagent",()=>M("main")),ge("omp:open-settings",(V)=>{let j=V.detail;z(j?.category??"appearance"),te(Boolean(j?.autoOpenAdd)),L(!0)});let oe=(V)=>{v((j)=>{let Y=Rt(j);if(Y.set("sessionId",V.toString()),Y.has("subagent"))Y.delete("subagent");return Y},{replace:!0}),M("main")},pe=()=>{v(new URLSearchParams,{replace:!0}),M("main")},ke=(V)=>{let j=Al(l,x,V);if(j)Za(j);v((Y)=>hc(Y,nr(V),V),{replace:!0}),M("main")},be=(V,j)=>ut({setSearchParams:v,afterNavigate:()=>M("main")},V,j),he=a((V)=>{let j=Xe(V,J);if(j)N(j)},[J]);return e("div",{"data-testid":"app-root",className:"app-window flex flex-col h-dvh w-screen overflow-hidden bg-canvas text-ink font-sans selection:bg-ink selection:text-canvas relative",children:[e(Sf,{}),e(Tf,{isMock:p}),e(Df,{workspacePath:J}),e("div",{className:`flex-1 min-h-0 w-full relative ${y==="main"?"block":"hidden"}`,...Q.dropProps,...Q.captureDropProps,children:[e(_l,{visible:Q.isDragging}),e(io,{activeSessionId:c,onSelectSession:oe,onNewSession:pe,onOpenSessionSidebar:T.openSessionDrawer,onOpenRightSidebar:T.openRightDrawer,appSettings:r})]}),e("div",{className:`flex-1 min-h-0 w-full ${y==="session"?"block":"hidden"}`,children:e(Ko,{activeSessionId:c,onSelectSession:oe,onNewSession:pe,onNewSessionForFolder:ke,onNewWorktreeSession:be,onClose:()=>M("main"),onDesktopToggle:t,appSettings:r,rootPath:J??void 0,refreshKey:E,onRefresh:H,onOpenFile:he,revealSignal:T.left})}),y==="right"&&e("div",{className:"flex-1 min-h-0 w-full",children:e(Uo,{enabled:de,rootPath:J??void 0,refreshKey:E,onRefresh:H,onOpenFile:he,onClose:()=>M("main"),revealSignal:T.right})}),I&&e(lt,{file:I,missing:ne,onClose:()=>N(null),onFileSaved:H}),C&&e(dt,{diff:C,onClose:()=>A(null),onFileSaved:H}),e(ml,{isOpen:R,onClose:()=>{L(!1),te(!1)},initialCategory:q,autoOpenAddProvider:F,appSettings:r})]})}export{cp as MobileLayoutWrapper};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{qf}from"./index-abs635a1.js";export{qf as createArchitectureServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Up}from"./index-nw5mvcaj.js";export{Up as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ti}from"./index-z4530r3c.js";export{ti as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cc}from"./index-dxvtjn6a.js";import"./index-z4530r3c.js";export{cc as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Nd,Bs,a0,o0,i0,s0}from"./index-19x11s5w.js";export{a0 as css,s0 as gss,Bs as keywords,i0 as less,Nd as mkCSS,o0 as sCSS};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Of}from"./index-abs635a1.js";export{Of as createCynefinServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Hf}from"./index-abs635a1.js";export{Hf as createEventModelingServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-60v30k5h.js";import"./index-3x7h2eqj.js";import{r0}from"./index-e9cxje00.js";export{r0 as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$f}from"./index-abs635a1.js";export{$f as createGitGraphServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{dg}from"./index-d23eacf2.js";import"./index-qf3y3ahx.js";import"./index-64sqfr4a.js";import"./index-1c2jvnyh.js";import"./index-5wz0y88c.js";export{dg as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ln}from"./index-z0fkfphe.js";import"./index-1c2jvnyh.js";import"./index-hkz2mz34.js";export{Ln as default};
|