@kabmo-labs/kabmo 0.59.0 → 0.60.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 +397 -397
- package/dist/client/static/js/{Body-jqq4654r.js → Body-p82s28sj.js} +3 -3
- package/dist/client/static/js/{CsvGrid-avw0taqb.js → CsvGrid-erc5mcvc.js} +2 -2
- package/dist/client/static/js/{DocxView-d221vr6g.js → DocxView-x3faj0jv.js} +3 -3
- package/dist/client/static/js/{DrawioView-gjsy7p01.js → DrawioView-t7fh3ens.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-949393v1.js → HtmlPreview-zy7x7jmm.js} +1 -1
- package/dist/client/static/js/ImageView-xc90jc1c.js +1 -0
- package/dist/client/static/js/LayoutWrapper-wyqe98kf.js +2 -0
- package/dist/client/static/js/MergeDiffView-bng34cpr.js +1 -0
- package/dist/client/static/js/Modal-89jk7wff.js +60 -0
- package/dist/client/static/js/{PdfView-dzj2s6rj.js → PdfView-kqx472q7.js} +1 -1
- package/dist/client/static/js/SessionsView-6bpz1faj.js +1 -0
- package/dist/client/static/js/{SheetView-jpc178g5.js → SheetView-0n9fze50.js} +9 -9
- package/dist/client/static/js/{SvgPreview-94fap32p.js → SvgPreview-6xc6ts46.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-a6eyfzrj.js → abnfDiagram-O67JEVCF-2xdkkqwg.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-sxrkxwbq.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-pgmyfncy.js → architectureDiagram-NJMV4G6O-ja8cx19z.js} +11 -11
- package/dist/client/static/js/{astro-ryr2ajmg.js → astro-yphdvdty.js} +1 -1
- package/dist/client/static/js/bash-bcbct9gc.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-rf51jyb2.js → blockDiagram-BEXU5L5S-ytf7s99c.js} +8 -8
- package/dist/client/static/js/c-fn9jz26e.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-0faj48jp.js → c4Diagram-YGBWAQC7-5a0kdx0z.js} +5 -5
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-bvzsws8x.js → classDiagram-v2-NBCMYWYE-hd98dvjw.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-j1amnd3m.js → cose-bilkent-JH36ORCC-man3fqcj.js} +1 -1
- package/dist/client/static/js/cpp-a1q64mke.js +1 -0
- package/dist/client/static/js/css-b92azee8.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-g1xwa8b9.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-f73w6zzz.js → cynefinDiagram-VND7K2PF-2f0kbbv2.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-a5vgvjsg.js → dagre-6A5THRUB-k7pyhgzn.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-6y9efamp.js → diagram-22UHCM2B-qx0afa2m.js} +15 -15
- package/dist/client/static/js/{diagram-3UASUU5V-2mycy7xm.js → diagram-3UASUU5V-ydpe77sv.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-10zgjb66.js → diagram-ATOU4E4O-e63v984n.js} +2 -2
- package/dist/client/static/js/{diagram-CDSNMT55-bewa52yf.js → diagram-CDSNMT55-8c765h3a.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-mh3b7gd3.js → diagram-MLGK6HIB-3pq0n7v8.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-gvdrbdm5.js → diagram-MPIPVDR6-638atzxz.js} +2 -2
- package/dist/client/static/js/{dockerfile-6bn19kg0.js → dockerfile-yehc914q.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-2prre93c.js → ebnfDiagram-ZINNZB2B-3gv43zvm.js} +1 -1
- package/dist/client/static/js/{elixir-fyxw6d70.js → elixir-3nwnd9yw.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-9t6t9kc6.js → elk-276RUBZZ-6s5pggfc.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-etcggr5n.js → erDiagram-OPXOYQCR-x7cqyb89.js} +3 -3
- package/dist/client/static/js/{erlang-97ayje6m.js → erlang-p5c4n3t0.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-05p61bka.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7sn6nwjv.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-cdc4mwhs.js → ganttDiagram-FUAMR5RP-g97te4v1.js} +5 -5
- package/dist/client/static/js/gitGraph-4MIJSDKK-z1yehwys.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-55d0fa7x.js → gitGraphDiagram-X574FWY7-sw4f94tc.js} +14 -14
- package/dist/client/static/js/graphql-8d8bn59j.js +1 -0
- package/dist/client/static/js/html-6hdrwtz2.js +1 -0
- package/dist/client/static/js/{index-5e4e18tg.js → index-025s3fp8.js} +2 -2
- package/dist/client/static/js/{index-pgy7ree5.js → index-0ze5bwvw.js} +5 -5
- package/dist/client/static/js/{index-f13ern5e.js → index-111bq6rs.js} +1 -1
- package/dist/client/static/js/{index-8tzt0dek.js → index-11qn05g9.js} +2 -2
- package/dist/client/static/js/{index-np2rfq06.js → index-2dmew334.js} +2 -2
- package/dist/client/static/js/index-2n2evsg0.js +2 -0
- package/dist/client/static/js/{index-trq7bdvk.js → index-37apvxgj.js} +2 -2
- package/dist/client/static/js/{index-6bsez5n6.js → index-43gmn7yb.js} +1 -1
- package/dist/client/static/js/index-4h2zkrk1.js +2 -0
- package/dist/client/static/js/{index-xe447cw3.js → index-4xbc0j7t.js} +1 -1
- package/dist/client/static/js/index-5nm8hm4k.js +2 -0
- package/dist/client/static/js/{index-mx5y9vt9.js → index-6qn9kygb.js} +7 -7
- package/dist/client/static/js/{index-jpvng27a.js → index-8zct30zd.js} +1 -1
- package/dist/client/static/js/{index-eggbcdwx.js → index-95jfphx5.js} +197 -197
- package/dist/client/static/js/{index-yrwm437g.js → index-97sw4d9n.js} +2 -2
- package/dist/client/static/js/{index-8z9aqgf3.js → index-9pw441wc.js} +4 -4
- package/dist/client/static/js/{index-27gwghmp.js → index-9rz6kzsv.js} +1 -1
- package/dist/client/static/js/{index-y4cx8cqf.js → index-a145x0w2.js} +2 -2
- package/dist/client/static/js/{index-mhrkjbjq.js → index-bdtftrym.js} +2 -2
- package/dist/client/static/js/index-bjz54ht6.js +1 -0
- package/dist/client/static/js/{index-db6s66jr.js → index-bkn6jtn1.js} +2 -2
- package/dist/client/static/js/{index-rw84kefb.js → index-bpcg34jp.js} +2 -2
- package/dist/client/static/js/{index-f6t91mpp.js → index-bqapt2e8.js} +1 -1
- package/dist/client/static/js/{index-ndqtff48.js → index-ca6tmamh.js} +2 -2
- package/dist/client/static/js/{index-fyt8m8ah.js → index-cf69bhjx.js} +2 -2
- package/dist/client/static/js/{index-yh7gngsh.js → index-cfvc1zpk.js} +2 -2
- package/dist/client/static/js/{index-nnwcbp2d.js → index-ddkjgv5h.js} +2 -2
- package/dist/client/static/js/{index-60cxxnpk.js → index-dekvtt2a.js} +87 -87
- package/dist/client/static/js/{index-ax8gaayq.js → index-dv01prse.js} +2 -2
- package/dist/client/static/js/{index-sg65xdey.js → index-enm77k5z.js} +2 -2
- package/dist/client/static/js/{index-nf4hq5tg.js → index-excgtjhx.js} +14 -14
- package/dist/client/static/js/{index-51rbgeh9.js → index-fb2fjndj.js} +5 -5
- package/dist/client/static/js/index-fnwaxc6r.js +1 -0
- package/dist/client/static/js/{index-vs2y8gxr.js → index-fr6wsqk8.js} +2 -2
- package/dist/client/static/js/index-h65zrhva.js +1 -0
- package/dist/client/static/js/{index-fr91ghwb.js → index-hgfyx8dt.js} +2 -2
- package/dist/client/static/js/{index-gcad7b6g.js → index-hwdkxe4n.js} +2 -2
- package/dist/client/static/js/{index-69mnn71v.js → index-hwv7bfxc.js} +2 -2
- package/dist/client/static/js/index-hxsqw7sz.js +4 -0
- package/dist/client/static/js/{index-461ga40v.js → index-hxy1sadd.js} +2 -2
- package/dist/client/static/js/{index-c253x7vt.js → index-ja0ajnvq.js} +7 -7
- package/dist/client/static/js/{index-2f6afhze.js → index-jfqd838j.js} +2 -2
- package/dist/client/static/js/{index-d9sfavx1.js → index-mtav0rpf.js} +2 -2
- package/dist/client/static/js/{index-58z2hatp.js → index-n8r7r86r.js} +1 -1
- package/dist/client/static/js/{index-j1ksa4x2.js → index-pdgc9ccr.js} +1 -1
- package/dist/client/static/js/{index-s9ts6qbj.js → index-pdz6j2g2.js} +2 -2
- package/dist/client/static/js/{index-jct0jryd.js → index-qccydkze.js} +2 -2
- package/dist/client/static/js/{index-yg38s8t3.js → index-qkqkygrf.js} +1 -1
- package/dist/client/static/js/index-qkyy563e.js +1 -0
- package/dist/client/static/js/{index-92h38pwg.js → index-s4j2ghmx.js} +2 -2
- package/dist/client/static/js/{index-z82nd2bd.js → index-sx83ans2.js} +2 -2
- package/dist/client/static/js/index-t6nqy2n5.css +1 -0
- package/dist/client/static/js/{index-fsa18ns9.js → index-twwsn91p.js} +2 -2
- package/dist/client/static/js/{index-nwbr15b3.js → index-v88m5sva.js} +2 -2
- package/dist/client/static/js/{index-a5ecn5yx.js → index-vcq6zfxx.js} +6 -6
- package/dist/client/static/js/{index-3akjcs82.js → index-vec7m1yd.js} +2 -2
- package/dist/client/static/js/{index-mngpcca7.js → index-vejz38qt.js} +9 -9
- package/dist/client/static/js/{index-9rvjegmy.js → index-wrk99kks.js} +2 -2
- package/dist/client/static/js/{index-q3k8r0ms.js → index-wsy6y5em.js} +9 -9
- package/dist/client/static/js/{index-h1xbx74w.js → index-yfcy4cf6.js} +2 -2
- package/dist/client/static/js/{index-pa70qj4p.js → index-ywp0sd1e.js} +1 -1
- package/dist/client/static/js/{index-njhrm5qa.js → index-z8k42dwz.js} +9 -9
- package/dist/client/static/js/info-A6RAGUB7-dqyaxjc1.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-9xph6cr5.js → infoDiagram-VRGFBTTK-pw2qaa27.js} +1 -1
- package/dist/client/static/js/ini-g6a5xsaw.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-3gshs3v8.js → ishikawaDiagram-OU5B5YK6-d13jhvxy.js} +3 -3
- package/dist/client/static/js/java-n596am4c.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-fa8x56mf.js → journeyDiagram-ZHPQQLJL-20gb8a04.js} +4 -4
- package/dist/client/static/js/json-7k70qbkj.js +1 -0
- package/dist/client/static/js/jsx-sndenqrc.js +1 -0
- package/dist/client/static/js/{julia-agc5kfvg.js → julia-rpd1y9vh.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-fybp2hh4.js → kanban-definition-PNTS6WVX-s78e158c.js} +5 -5
- package/dist/client/static/js/lua-djd3g9q5.js +1 -0
- package/dist/client/static/js/markdown-r2tpvxpn.js +1 -0
- package/dist/client/static/js/{mermaid.core-jjh5ggp0.js → mermaid.core-xbm27k28.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-gtfbg619.js → mindmap-definition-NLK3R4M7-6y7xe2zm.js} +7 -7
- package/dist/client/static/js/one-dark-pro-7bgqnyhm.js +1 -0
- package/dist/client/static/js/one-light-47y6etng.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-7jxzax4z.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-1a51sbqv.js → pegDiagram-GJSIUBJH-dmvewetf.js} +1 -1
- package/dist/client/static/js/{perl-v5vbtzgf.js → perl-kmtz9dnv.js} +1 -1
- package/dist/client/static/js/{php-83qwy98t.js → php-bttrsbxy.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-wc9wxr7f.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-zd9svyyn.js → pieDiagram-5QR66LMP-1q9e7rcm.js} +2 -2
- package/dist/client/static/js/properties-brn72zdk.js +1 -0
- package/dist/client/static/js/python-g9mghwgm.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-5gtw2m6s.js → quadrantDiagram-O4NWA36T-mvrem3n6.js} +4 -4
- package/dist/client/static/js/r-e247x4mw.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-kwj5padj.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-h8sdx3w5.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2wmwx246.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-h4cdgw3y.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-q7m0tfd0.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-3ccwpfzz.js → railroadDiagram-XR7U4H2S-axttcfhw.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-sasndrrp.js → requirementDiagram-PLB6GJNP-5qx7erta.js} +12 -12
- package/dist/client/static/js/{ruby-994n5j6e.js → ruby-dve3y59w.js} +1 -1
- package/dist/client/static/js/{rust-n9z2c9m3.js → rust-b3ckax3e.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2ahb4sda.js → sankeyDiagram-IPEJSGJF-es87a3j6.js} +4 -4
- package/dist/client/static/js/{sass-p6g7qdv2.js → sass-emxqt5p2.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-bfj90kz1.js → sequenceDiagram-PO4LG4MO-dgpnjrtk.js} +21 -21
- package/dist/client/static/js/{sizeCapture-INFHLROL-5tygxmtc.js → sizeCapture-INFHLROL-kyw0p86n.js} +1 -1
- package/dist/client/static/js/sql-0kar81jy.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-533xw76e.js → stateDiagram-v2-GCMORJYK-vnsbw8y9.js} +3 -3
- package/dist/client/static/js/{svelte-bek3h1sz.js → svelte-dbsx1ehx.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-gd3d04pk.js → swimlanes-2SLR337P-060q1rep.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y77g9dq0.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-fvqvgqvg.js → timeline-definition-EJHVYXUP-8a3yqmx0.js} +6 -6
- package/dist/client/static/js/treeView-Q6P3EWNA-yv9640h3.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-7kpzjg21.js +1 -0
- package/dist/client/static/js/typescript-bm89v3gk.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-tm1f0m4x.js → usecaseDiagram-POWQR4AR-18sp73v7.js} +51 -51
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-2vdvv1hd.js → vennDiagram-UO4OBE2U-gf4y1r3s.js} +5 -5
- package/dist/client/static/js/{vue-y44m889c.js → vue-hyr58df9.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-mggay64p.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-7avcjznx.js → wardleyDiagram-VNRHLVJA-q0kwmbzh.js} +5 -5
- package/dist/client/static/js/xml-b7824nx0.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-g39y526n.js → xychartDiagram-PMCCYNJV-y0gpmg6m.js} +6 -6
- package/dist/client/static/js/yaml-kqqktdv1.js +1 -0
- package/package.json +4 -4
- package/src/client/borders.css +28 -15
- package/src/client/components/common/Modal.tsx +10 -2
- package/src/client/components/common/Toast.tsx +8 -3
- package/src/client/components/common/anchored-menu/index.tsx +10 -3
- package/src/client/components/common/command-palette/index.tsx +9 -3
- package/src/client/components/common/fullscreen-viewer/index.tsx +1 -1
- package/src/client/components/common/header-controls/index.test.tsx +40 -3
- package/src/client/components/common/header-controls/index.tsx +106 -56
- package/src/client/components/common/search-select/search-select.test.tsx +10 -1
- package/src/client/components/common/session-row/TrailingSlot.tsx +8 -1
- package/src/client/components/common/session-row/index.tsx +4 -0
- package/src/client/components/common/session-row/session-row.test.tsx +5 -0
- package/src/client/components/common/workspace-mark/index.test.tsx +67 -0
- package/src/client/components/common/workspace-mark/index.tsx +48 -0
- package/src/client/components/layout/ActivityBar.test.ts +1 -1
- package/src/client/components/layout/ActivityBarDrag.test.ts +1 -1
- package/src/client/components/layout/LeftActivityBar.test.ts +48 -3
- package/src/client/components/layout/LeftDock.tsx +33 -14
- package/src/client/components/layout/PanelButton.test.tsx +119 -0
- package/src/client/components/layout/PanelButton.tsx +2 -4
- package/src/client/components/layout/activity-bar/Row.tsx +125 -0
- package/src/client/components/layout/{ActivityBar.tsx → activity-bar/index.tsx} +81 -20
- package/src/client/components/layout/controls-bar/index.tsx +183 -0
- package/src/client/components/layout/desktop-layout/BarSlot.tsx +18 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.test.tsx +187 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +81 -64
- package/src/client/components/layout/desktop-layout/LeftRail.tsx +60 -0
- package/src/client/components/layout/desktop-layout/LeftTabsColumn.tsx +91 -0
- package/src/client/components/layout/desktop-layout/ResizeHandle.tsx +19 -3
- package/src/client/components/layout/desktop-layout/RightColumn.test.tsx +60 -0
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +77 -28
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +114 -104
- package/src/client/components/layout/desktop-layout/index.tsx +48 -45
- package/src/client/components/layout/desktop-layout/resizer/index.tsx +25 -83
- package/src/client/components/layout/desktop-layout/resizer/panel-motion.ts +61 -0
- package/src/client/components/layout/desktop-layout/resizer/panel.test.ts +40 -2
- package/src/client/components/layout/desktop-layout/resizer/separator.tsx +89 -0
- package/src/client/components/layout/left-bar/index.tsx +88 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +5 -2
- package/src/client/components/layout/session-sidebar/Footer.tsx +28 -11
- package/src/client/components/layout/session-sidebar/FooterHost.tsx +167 -0
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +2 -2
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +8 -3
- package/src/client/components/layout/session-sidebar/footer-host.test.tsx +133 -0
- package/src/client/components/layout/session-sidebar/modern/RevealRow.tsx +36 -5
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +5 -2
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +1 -0
- package/src/client/components/layout/session-sidebar/modern/reveal-row.test.tsx +28 -1
- package/src/client/components/layout/session-title-bar/index.tsx +199 -0
- package/src/client/components/layout/top-bars.test.tsx +338 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +13 -2
- package/src/client/components/mobile/SessionSidebar.tsx +10 -8
- package/src/client/components/mobile/drawer-layout.test.tsx +67 -0
- package/src/client/components/mobile/drawer-strip.tsx +37 -14
- package/src/client/components/mobile/left-drawer-nav.test.tsx +19 -127
- package/src/client/components/settings/LazyModal.tsx +8 -2
- package/src/client/components/settings/Modal.tsx +6 -2
- package/src/client/components/settings/apply-side-effects.ts +5 -0
- package/src/client/components/settings/categories/AppearanceSettings.test.tsx +1 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +2 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +6 -5
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/ChromeStyleSection.tsx +105 -0
- package/src/client/components/settings/categories/appearance-settings/groups.ts +3 -2
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
- package/src/client/components/settings/categories/voice-settings/SpeechSettings.test.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +8 -1
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +8 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +9 -2
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +1 -25
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +1 -1
- package/src/client/components/workspace/editor/Tab.tsx +160 -0
- package/src/client/components/workspace/editor/Tabs.test.ts +40 -0
- package/src/client/components/workspace/editor/Tabs.tsx +52 -102
- package/src/client/components/workspace/editor/index.tsx +2 -0
- package/src/client/components/workspace/editor/props.ts +6 -0
- package/src/client/components/workspace/file-explorer/OutlineResize.test.tsx +225 -0
- package/src/client/components/workspace/file-explorer/OutlineSection.tsx +43 -3
- package/src/client/components/workspace/file-explorer/index.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/CloseButton.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +10 -1
- package/src/client/components/workspace/model-dropdown/Header.tsx +27 -20
- package/src/client/components/workspace/model-dropdown/Panel.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/SpecsTooltip.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +18 -0
- package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +34 -4
- package/src/client/components/workspace/panel-tabs/TabChip.tsx +48 -20
- package/src/client/components/workspace/panel-tabs/TabStrip.connected.test.tsx +163 -0
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +18 -9
- package/src/client/components/workspace/search-panel/Body.tsx +3 -3
- package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
- package/src/client/data/settings/omp-schema.json +205 -9
- package/src/client/floating.css +276 -0
- package/src/client/floating.test.ts +151 -0
- package/src/client/hooks/chat/timeline/session-pagination.ts +13 -9
- package/src/client/hooks/editor/use-outline-resize.ts +145 -0
- package/src/client/hooks/ui/border-style.test.ts +19 -7
- package/src/client/hooks/ui/border-style.ts +2 -3
- package/src/client/hooks/ui/chrome-style.test.ts +140 -0
- package/src/client/hooks/ui/chrome-style.ts +75 -0
- package/src/client/hooks/ui/media-query.ts +29 -0
- package/src/client/hooks/ui/presence.test.ts +104 -0
- package/src/client/hooks/ui/presence.ts +62 -0
- package/src/client/hooks/ui/style-attributes.test.ts +7 -6
- package/src/client/hooks/ui/surface-style.ts +2 -2
- package/src/client/hooks/ui/titlebar-inset.test.ts +56 -0
- package/src/client/hooks/ui/titlebar-inset.ts +31 -0
- package/src/client/hooks/workspace/available-width.ts +25 -1
- package/src/client/hooks/workspace/panel-peek.test.ts +124 -0
- package/src/client/hooks/workspace/panel-peek.ts +151 -0
- package/src/client/hooks/workspace/panel-rail.test.ts +86 -0
- package/src/client/hooks/workspace/panel-rail.ts +108 -0
- package/src/client/hooks/workspace/panel-resize.ts +8 -2
- package/src/client/hooks/workspace/rail-peek.test.ts +119 -0
- package/src/client/hooks/workspace/rail-peek.ts +68 -0
- package/src/client/hooks/workspace/right-panel-card.test.ts +71 -0
- package/src/client/hooks/workspace/right-panel-card.ts +69 -0
- package/src/client/hooks/workspace/right-panel-geometry.ts +172 -0
- package/src/client/hooks/workspace/right-side.ts +7 -0
- package/src/client/lib/desktop/titlebar.test.ts +6 -0
- package/src/client/lib/desktop/titlebar.ts +16 -0
- package/src/client/main.tsx +11 -0
- package/src/client/motion.test.ts +36 -0
- package/src/client/tailwind.css +67 -0
- package/src/server/lib/assets/shell-attributes.server.ts +14 -4
- package/src/server/lib/assets/shell-attributes.test.ts +35 -21
- package/src/server/lib/bundler/titlebar-css.test.ts +3 -2
- package/src/server/lib/realtime/topics/peer-relay.server.test.ts +19 -3
- package/src/server/lib/updates/omp.test.ts +40 -1
- package/src/server/lib/updates/omp.ts +29 -2
- package/src/server/plugins/ssr.ts +2 -0
- package/src/server/routes/settings/mcp.test.ts +16 -0
- package/src/server/routes/settings/mcp.ts +4 -0
- package/src/shared/lib/code/outline/resize.test.ts +57 -0
- package/src/shared/lib/code/outline/resize.ts +67 -0
- package/src/shared/lib/models/provider/glyph.test.ts +3 -1
- package/src/shared/lib/models/provider/glyph.ts +1 -0
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +103 -3
- package/src/shared/lib/omp/config/schema.test.ts +9 -0
- package/src/shared/lib/omp/config/schema.ts +8 -0
- package/src/shared/lib/settings/defaults.ts +2 -0
- package/src/shared/lib/theme/border-style.test.ts +12 -14
- package/src/shared/lib/theme/border-style.ts +25 -18
- package/src/shared/lib/theme/chrome-style.test.ts +31 -0
- package/src/shared/lib/theme/chrome-style.ts +74 -0
- package/src/shared/lib/theme/surface-style.test.ts +4 -5
- package/src/shared/lib/theme/surface-style.ts +6 -5
- package/src/shared/lib/ui/motion.ts +29 -0
- package/src/shared/lib/workspace/floating-chrome.ts +23 -0
- package/src/shared/lib/workspace/session-state/store.ts +3 -0
- package/src/shared/lib/workspace/workspace-panel-widths.test.ts +73 -0
- package/src/shared/lib/workspace/workspace-panel-widths.ts +79 -17
- package/src/shared/types/settings/state.ts +10 -9
- package/src/test-support/left-drawer-harness.test-util.ts +169 -0
- package/src/test-support/peer-harness.ts +44 -36
- package/dist/client/static/js/ImageView-pan9pqtm.js +0 -1
- package/dist/client/static/js/LayoutWrapper-p0qmghgt.js +0 -2
- package/dist/client/static/js/MergeDiffView-swt467g7.js +0 -1
- package/dist/client/static/js/Modal-4spmcn44.js +0 -60
- package/dist/client/static/js/SessionsView-b6szjdg5.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-bwn1drdz.js +0 -1
- package/dist/client/static/js/bash-zknkkwkw.js +0 -1
- package/dist/client/static/js/c-0w02jkxb.js +0 -1
- package/dist/client/static/js/cpp-p5b4vean.js +0 -1
- package/dist/client/static/js/css-9jzbvdyz.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-jbc50ks8.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-b37ey01t.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7c2ncsw7.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-mvqq7tcs.js +0 -1
- package/dist/client/static/js/graphql-xzykn0ba.js +0 -1
- package/dist/client/static/js/html-2zc3shky.js +0 -1
- package/dist/client/static/js/index-537m8a3x.js +0 -2
- package/dist/client/static/js/index-me0b6wkw.js +0 -1
- package/dist/client/static/js/index-mttx9327.css +0 -1
- package/dist/client/static/js/index-pe5f2gmn.js +0 -1
- package/dist/client/static/js/index-pzwf6hwe.js +0 -4
- package/dist/client/static/js/index-skvfxcd8.js +0 -1
- package/dist/client/static/js/index-sx2yz2wx.js +0 -1
- package/dist/client/static/js/index-wwyjzhgs.js +0 -2
- package/dist/client/static/js/index-y09de44h.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-zkv4crz7.js +0 -1
- package/dist/client/static/js/ini-62r3vxaf.js +0 -1
- package/dist/client/static/js/java-kacycary.js +0 -1
- package/dist/client/static/js/json-yrwpn6bd.js +0 -1
- package/dist/client/static/js/jsx-b40ag8q1.js +0 -1
- package/dist/client/static/js/lua-bk961f37.js +0 -1
- package/dist/client/static/js/markdown-b7rgzgd6.js +0 -1
- package/dist/client/static/js/one-dark-pro-vht9rv39.js +0 -1
- package/dist/client/static/js/one-light-arxc5whh.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-dgpge627.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-b8pgsqrd.js +0 -1
- package/dist/client/static/js/properties-k8gbzggp.js +0 -1
- package/dist/client/static/js/python-343tspad.js +0 -1
- package/dist/client/static/js/r-ycdwmv8g.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-fmfe5y27.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-b5tks4ce.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-0sf4m0ze.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pjfy3pt7.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-nr8ngt42.js +0 -1
- package/dist/client/static/js/sql-kwpd5w07.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xxmvdyg4.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-23r9fa68.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-mxxzdrj6.js +0 -1
- package/dist/client/static/js/typescript-4dchbnya.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-cbqtax1x.js +0 -1
- package/dist/client/static/js/xml-xs6qz3ya.js +0 -1
- package/dist/client/static/js/yaml-174nk5bn.js +0 -1
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +0 -238
- package/src/client/components/layout/session-sidebar/Header.test.ts +0 -98
- package/src/client/components/layout/session-sidebar/Header.tsx +0 -60
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The mounted phone LEFT drawer, shared by its behaviour and layout suites.
|
|
8
|
+
*
|
|
9
|
+
* Both suites start the same tree — real provider, real drawer — and a second
|
|
10
|
+
* copy of the DOM globals, the fetch stub and the mount would let one suite
|
|
11
|
+
* assert against a harness the other no longer runs. The hooks themselves stay
|
|
12
|
+
* in each test file (`beforeAll(installDrawerHarness)`): `bun test` scopes them
|
|
13
|
+
* per file, and a module that registers them would attach them to whichever
|
|
14
|
+
* file imported it first.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Window } from 'happy-dom';
|
|
18
|
+
import { h, render } from 'preact';
|
|
19
|
+
import { act } from 'preact/test-utils';
|
|
20
|
+
import { MobileSessionSidebar } from '@/client/components/mobile/SessionSidebar';
|
|
21
|
+
import { SessionStateProvider } from '@/client/components/common/session-state-provider/index';
|
|
22
|
+
import { primeKabmoSettings } from '@/shared/lib/settings/client';
|
|
23
|
+
import { resetSessionStateStore } from '@/shared/lib/workspace/session-state/store';
|
|
24
|
+
import { writeLeftDock } from '@/shared/lib/workspace/left-dock';
|
|
25
|
+
import { silenceRealtime, restoreRealtime } from '@/test-support/silent-socket';
|
|
26
|
+
|
|
27
|
+
const DOM_GLOBALS = [
|
|
28
|
+
'window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement',
|
|
29
|
+
'Event', 'MouseEvent', 'KeyboardEvent',
|
|
30
|
+
] as const;
|
|
31
|
+
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
32
|
+
|
|
33
|
+
let win: Window | undefined;
|
|
34
|
+
let container: HTMLElement | undefined;
|
|
35
|
+
let realFetch: typeof fetch | undefined;
|
|
36
|
+
|
|
37
|
+
/** Counts the workspace-refresh requests the drawer makes. */
|
|
38
|
+
export const refreshCalls = { count: 0 };
|
|
39
|
+
|
|
40
|
+
/** A built-in view placed on the dock, so the catalog has something to open. */
|
|
41
|
+
const PLACED = 'files';
|
|
42
|
+
|
|
43
|
+
export function installDrawerHarness(): void {
|
|
44
|
+
realFetch = globalThis.fetch;
|
|
45
|
+
// Answers EVERY endpoint with an empty JSON object: the drawer reads the
|
|
46
|
+
// session blob, and opening its catalog triggers the update flow's own read.
|
|
47
|
+
// A single canned body is enough for both, and one stub keeps a missing
|
|
48
|
+
// endpoint from failing as an unrelated `undefined` deeper in a hook.
|
|
49
|
+
globalThis.fetch = (async () =>
|
|
50
|
+
new Response(JSON.stringify({ state: {}, kabmo: {}, omp: {} }), {
|
|
51
|
+
status: 200,
|
|
52
|
+
})) as unknown as typeof fetch;
|
|
53
|
+
win = new Window({ url: 'http://localhost' });
|
|
54
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
55
|
+
for (const key of DOM_GLOBALS) {
|
|
56
|
+
if (!(key in nativeGlobals)) nativeGlobals[key] = target[key];
|
|
57
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function teardownDrawerHarness(): Promise<void> {
|
|
62
|
+
await act(async () => {
|
|
63
|
+
await Bun.sleep(60);
|
|
64
|
+
});
|
|
65
|
+
if (realFetch) globalThis.fetch = realFetch;
|
|
66
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
67
|
+
for (const key of DOM_GLOBALS) {
|
|
68
|
+
const value = nativeGlobals[key];
|
|
69
|
+
if (value === undefined) delete target[key];
|
|
70
|
+
else target[key] = value;
|
|
71
|
+
}
|
|
72
|
+
win = undefined;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Start a case: a fresh container, a clean store and a silent socket. */
|
|
76
|
+
export function resetDrawerHarness(): HTMLElement {
|
|
77
|
+
silenceRealtime();
|
|
78
|
+
refreshCalls.count = 0;
|
|
79
|
+
// The store is a module singleton: a tab set left by one test would seed the
|
|
80
|
+
// next one's drawer.
|
|
81
|
+
resetSessionStateStore();
|
|
82
|
+
container = document.createElement('div');
|
|
83
|
+
document.body.appendChild(container);
|
|
84
|
+
primeKabmoSettings({});
|
|
85
|
+
return container;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export async function disposeDrawerHarness(): Promise<void> {
|
|
89
|
+
const target = container;
|
|
90
|
+
if (target) {
|
|
91
|
+
await act(() => {
|
|
92
|
+
render(null, target);
|
|
93
|
+
});
|
|
94
|
+
target.remove();
|
|
95
|
+
container = undefined;
|
|
96
|
+
}
|
|
97
|
+
restoreRealtime();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Mount the drawer with a given style and rail state. */
|
|
101
|
+
export async function mountDrawer(
|
|
102
|
+
mountInto: HTMLElement,
|
|
103
|
+
style: 'classic' | 'tabs',
|
|
104
|
+
railEnabled = true,
|
|
105
|
+
): Promise<void> {
|
|
106
|
+
primeKabmoSettings({ mobileLeftPanelNav: style });
|
|
107
|
+
// The rail switch and the placement are ONE global setting
|
|
108
|
+
// (`omp_left_panels`), read through `useLeftDock`. Writing them before the
|
|
109
|
+
// mount is what the user's Settings click and a drop do. A placed panel is
|
|
110
|
+
// what gives the catalog a second card to open.
|
|
111
|
+
writeLeftDock({ enabled: railEnabled, panels: [PLACED] });
|
|
112
|
+
await act(async () => {
|
|
113
|
+
render(
|
|
114
|
+
h(SessionStateProvider, {
|
|
115
|
+
sessionId: 'session-left-drawer-nav',
|
|
116
|
+
children: h(MobileSessionSidebar, {
|
|
117
|
+
activeSessionId: null,
|
|
118
|
+
onSelectSession: () => {},
|
|
119
|
+
onNewSession: () => {},
|
|
120
|
+
onNewSessionForFolder: () => {},
|
|
121
|
+
onOpenWorkspacePanels: () => {},
|
|
122
|
+
onClose: () => {},
|
|
123
|
+
// The drawer's `onRefresh` is the WORKSPACE refresh the layout hands
|
|
124
|
+
// down (`LayoutWrapper` passes `handleWorkspaceChanged`), so counting
|
|
125
|
+
// it is how these suites tell the two refreshes apart.
|
|
126
|
+
onRefresh: () => {
|
|
127
|
+
refreshCalls.count += 1;
|
|
128
|
+
},
|
|
129
|
+
}),
|
|
130
|
+
}),
|
|
131
|
+
mountInto,
|
|
132
|
+
);
|
|
133
|
+
});
|
|
134
|
+
await settleDrawer(mountInto);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Deferred commit + provider load. Polls instead of a fixed 40ms sleep: the
|
|
138
|
+
* sleep made this suite order-dependent (the header was sometimes not drawn
|
|
139
|
+
* yet, failing "the strip draws no second close control" about once per two
|
|
140
|
+
* full runs). Waits for the row BOTH chromes draw. */
|
|
141
|
+
export async function settleDrawer(mountInto: HTMLElement): Promise<void> {
|
|
142
|
+
const deadline = Date.now() + 2000;
|
|
143
|
+
while (Date.now() < deadline) {
|
|
144
|
+
await act(async () => {
|
|
145
|
+
await Bun.sleep(10);
|
|
146
|
+
});
|
|
147
|
+
if (mountInto.querySelector('button[aria-label="Close sidebar"]')) return;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function stripChips(mountInto: HTMLElement): (string | undefined)[] {
|
|
152
|
+
return [...mountInto.querySelectorAll('[role="tablist"] [role="tab"]')].map((chip) =>
|
|
153
|
+
chip.textContent?.trim(),
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The dock's chip row, identified by what only it draws: a pressed chip that
|
|
159
|
+
* names a VIEW. The session list's own filter chips ("All", "Running",
|
|
160
|
+
* "Archived") are also `aria-pressed`, so a bare count would be measuring the
|
|
161
|
+
* list rather than the chrome.
|
|
162
|
+
*/
|
|
163
|
+
export function dockChips(mountInto: HTMLElement): HTMLElement[] {
|
|
164
|
+
return [...mountInto.querySelectorAll('[aria-pressed][aria-label]')].filter((chip) =>
|
|
165
|
+
['Sessions', 'Files', 'GIT', 'Search', 'Terminal'].some((name) =>
|
|
166
|
+
chip.getAttribute('aria-label')?.startsWith(name),
|
|
167
|
+
),
|
|
168
|
+
) as HTMLElement[];
|
|
169
|
+
}
|
|
@@ -12,19 +12,20 @@
|
|
|
12
12
|
* (`globalThis`), so an in-process "owner" would share it with the relay
|
|
13
13
|
* under test and could exercise nothing; a raw socket is the only way to be
|
|
14
14
|
* genuinely other.
|
|
15
|
-
* - a lease holder in a SEPARATE,
|
|
16
|
-
* treats a lease held by this very process —
|
|
17
|
-
* spawned — as "our own", so a foreign holder has
|
|
15
|
+
* - a lease holder in a SEPARATE process, parented by a wrapper that stays
|
|
16
|
+
* alive. The ownership guard treats a lease held by this very process —
|
|
17
|
+
* and a child this process spawned — as "our own", so a foreign holder has
|
|
18
|
+
* to be one generation further down.
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
|
-
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
21
|
+
import { mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
21
22
|
import { tmpdir } from 'node:os';
|
|
22
23
|
import { join } from 'node:path';
|
|
23
24
|
|
|
24
25
|
import type { RealtimeConnection } from '@/server/lib/realtime/hub.server';
|
|
25
26
|
import { sessionLeasePath } from '@/server/lib/omp/session/ownership.server';
|
|
26
27
|
import { leaseHeldByAnother } from '@kabmo-labs/kabmo-omp/session-runtime/lease-probe.server';
|
|
27
|
-
import {
|
|
28
|
+
import { processParentPid } from '@kabmo-labs/kabmo-process/probe/identity';
|
|
28
29
|
import type { RealtimeServerFrame } from '@/shared/lib/realtime/protocol';
|
|
29
30
|
|
|
30
31
|
/** Spin the event loop until `condition` holds, up to `timeoutMs`. */
|
|
@@ -186,22 +187,19 @@ export interface ForeignLease {
|
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
/**
|
|
189
|
-
* Hold `sessionId`'s lease from a SEPARATE
|
|
190
|
-
*
|
|
190
|
+
* Hold `sessionId`'s lease from a SEPARATE process — the shape a real second
|
|
191
|
+
* Kabmo instance's omp child has.
|
|
191
192
|
*
|
|
192
193
|
* A lease held by this very process is deliberately NOT a conflict (the local
|
|
193
194
|
* registry already answers for it), and a directly-spawned child is "our own
|
|
194
|
-
* child" by the guard's parent rule — so the holder
|
|
195
|
-
*
|
|
196
|
-
* portable way to get a foreign holder (macOS ships no `setsid`).
|
|
195
|
+
* child" by the guard's parent rule — so the holder is spawned as the wrapper
|
|
196
|
+
* shell's child, one generation down.
|
|
197
197
|
*
|
|
198
|
-
* The
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
* one-shot `resolve` ran, so no record matched and the topic answered locally
|
|
204
|
-
* instead of forwarding to the owner (`ownerCalls` was `[]`).
|
|
198
|
+
* The wrapper STAYS ALIVE (`wait`) for as long as the holder runs, so
|
|
199
|
+
* `parentPid` is a stable, live pid the instance record can name. The previous
|
|
200
|
+
* wrapper exited at once and left `bun` under the kernel's reaper — on the Linux
|
|
201
|
+
* gate that was pid 1, and a record naming init did not match (`ownerCalls` was
|
|
202
|
+
* `[]`, measured on `43568904108` and again on `47286715621`).
|
|
205
203
|
*/
|
|
206
204
|
export async function holdLeaseInForeignProcess(sessionId: string): Promise<ForeignLease> {
|
|
207
205
|
const lease = sessionLeasePath(sessionId);
|
|
@@ -212,28 +210,38 @@ export async function holdLeaseInForeignProcess(sessionId: string): Promise<Fore
|
|
|
212
210
|
await Promise.withResolvers().promise;
|
|
213
211
|
`;
|
|
214
212
|
const inner = `exec ${JSON.stringify(process.execPath)} -e '${script.replace(/'/g, `'\\''`)}' '${lease}'`;
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
// The wrapper STAYS ALIVE as the holder's parent, and it does so without
|
|
214
|
+
// `wait`: a shell's job table is not something this harness should bet the
|
|
215
|
+
// guard's parent lookup on (the Linux gate had the wrapper gone by resolve
|
|
216
|
+
// time, leaving the holder under init). `exec sleep` keeps the SAME pid —
|
|
217
|
+
// now sleeping — for the rest of the test; the callers kill it with the
|
|
218
|
+
// holder.
|
|
219
|
+
//
|
|
220
|
+
// The child pid arrives through a FILE, not stdout: a live wrapper never
|
|
221
|
+
// closes its stdout pipe, so reading it to EOF would hang until the holder
|
|
222
|
+
// died.
|
|
223
|
+
const pidFile = join(tmpdir(), `kabmo-holder-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}.pid`);
|
|
224
|
+
const child = Bun.spawn(['sh', '-c', `${inner} >/dev/null 2>&1 & echo $! > '${pidFile}' ; exec sleep 3600`], {
|
|
225
|
+
stdout: 'ignore',
|
|
217
226
|
stderr: 'ignore',
|
|
218
227
|
env: { ...Bun.env },
|
|
219
228
|
});
|
|
220
|
-
|
|
221
|
-
await waitUntil(() => leaseHeldByAnother(lease) === true);
|
|
222
|
-
// Held AND reparented: until the wrapper exits, the holder's parent is the
|
|
223
|
-
// wrapper itself, which no instance record can name.
|
|
224
|
-
//
|
|
225
|
-
// "Reparented" means the parent ALIVE and UNCHANGED across two polls, not
|
|
226
|
-
// merely different from the wrapper: a caller writes an instance record naming
|
|
227
|
-
// this pid, and the guard drops a record whose pid is dead — so reading a
|
|
228
|
-
// parent that is about to be replaced is the difference between a forwarded
|
|
229
|
-
// resolve and a local answer.
|
|
230
|
-
let settled: number | null = null;
|
|
229
|
+
let pid = 0;
|
|
231
230
|
await waitUntil(() => {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
try {
|
|
232
|
+
pid = Number(readFileSync(pidFile, 'utf8').trim());
|
|
233
|
+
} catch {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
return Number.isInteger(pid) && pid > 0;
|
|
236
237
|
});
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
rmSync(pidFile, { force: true });
|
|
239
|
+
await waitUntil(() => leaseHeldByAnother(lease) === true);
|
|
240
|
+
// The guard matches the holder's PARENT against an instance record, so the
|
|
241
|
+
// parent must really be this wrapper — a reparented holder would leave the
|
|
242
|
+
// record naming a pid nobody is running.
|
|
243
|
+
if (processParentPid(pid) !== child.pid) {
|
|
244
|
+
throw new Error(`the lease holder left its wrapper (parent ${processParentPid(pid)}, expected ${child.pid})`);
|
|
245
|
+
}
|
|
246
|
+
return { pid, parentPid: child.pid };
|
|
239
247
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e,p,jr}from"./index-eggbcdwx.js";import{$i}from"./index-8z9aqgf3.js";import{Uu}from"./index-c253x7vt.js";function g({source:t,name:r,revision:s=0}){let{url:i,loading:m,error:o}=Uu(t,s);if(o)return e(jr,{name:r,message:o});if(m||!i)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(p,{size:14,className:"animate-spin"}),e("span",{children:"Loading image…"})]});return e($i,{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,Fe,ce,jt,Sa,e,s,Re,Ie,p,dn,pn,B,ft,mn,f,C,le,gt,ae,me,Mt,at,tt,yn,de,Ye,he,Qa,ca,rn,La,ir,L,S,U,Cl,h,lr,Bl,Oe,fe,At,jh,co,zm,kn,Ne,Ft,zo,Je,Sl,Ur,$e,X,ht,Me,ze,Uo,ks,$d,Mc,oe,Ue,ws,Oc,b0,zc,Ir,jo,Dt,Gc,jd,Es,Ho,Ql,Rl,Ko,st,ut,ga,Ze,Pl,yo,Ol,cu,Ga,uu,Jd,Ns,ja,Yo,Jo,Zo,Qt,dr,Ms,Xo,ei,ti,vo,zl,Ul,Gl,jl,pr,Zf,Xf,ni,fu,eg,Fs,Ps,tg,Os,rg,ag,og,gu,Li,Hl,Ha,Mi,ig,sg,Au,lg,cg,kb,rp,Cb,ai,ap,_n,ug,dg,pg,mg,MA,ql,gg,Ag,hu,Kl,kg,xg,cp,wg,_b}from"./index-eggbcdwx.js";import{gp}from"./index-y09de44h.js";import"./index-q3k8r0ms.js";import{vu,ku,xu,wu,Cu,Eu,Bu,$i,Iu,Vl,_u}from"./index-8z9aqgf3.js";import{al}from"./index-mx5y9vt9.js";import"./index-2f6afhze.js";import{zs,Du,Nu,oi,Us,Qu,Ru,Lu,Mu,Fu,Pu,$u,zu}from"./index-c253x7vt.js";import{Sd,Td,hi,Dd,Nd}from"./index-9rvjegmy.js";import{kt,zi,ju,Hu,Wu}from"./index-wwyjzhgs.js";import{Hs,Wa,Hr,Ku,Vu,ii,Yu,qs,wp,JA,Ws,Ks,qr,Vs,Ys,si,Js,Zs,Xs,el,tl,Gi,li,nl,rl,Ju,Cp,Zu,Xu,ed,td,nd,rd}from"./index-pzwf6hwe.js";import{Ya,Ja}from"./index-trq7bdvk.js";import{Ld,ls}from"./index-nnwcbp2d.js";function Qe({stateSessionId:t,drawers:r,setSearchParams:l,setCurrentScreen:m}){let b=a((v)=>{let x=Ir(v);if(fe(x,"layout.mobileRightPanel")===void 0)At(x,"layout.mobileRightPanel",Sa);if(l((k)=>jd(k,v),{replace:!0}),t===x)r.openRightDrawer();else m("right")},[t,r,l,m]),g=i(null);return o(()=>{if(!jo(t)){g.current=null;return}if(g.current===t)return;if(g.current=t,fe(t,"layout.mobileRightPanel")===void 0)At(t,"layout.mobileRightPanel",Sa);r.openRightDrawer()},[t,r]),b}function eo(t){let{editorOpen:r,diffOpen:l,settingsOpen:m,offMainScreen:b,onCloseEditor:g,onCloseDiff:v,onCloseSettings:x,onReturnToMain:k}=t;o(()=>_b(()=>{if(r)return g(),!0;if(l)return v(),!0;if(m)return x(),!0;if(b)return k(),!0;return!1}),[r,l,m,b,g,v,x,k])}var bt="terminal";function Ge(t){return t===bt}function De(t){if(Ge(t))b0()}function oo({dock:t,sessionId:r,currentScreen:l,setCurrentScreen:m}){let[b,g]=n(0),[v,x]=n(0),k=a(()=>{let y=fe(r,"layout.mobileRightPanel")??Sa;De(y),g((N)=>N+1),m("right")},[r,m]),c=a(()=>{x((y)=>y+1),m("session")},[m]),w=a((y)=>{let N=Cb(y,t);if(!N)return;let O=fe(r,"layout.mobileRightPanel");if(N==="right"&&(l!=="right"||O!==y))De(y);if(At(r,N==="left"?"layout.mobileLeftPanel":"layout.mobileRightPanel",y),N==="right")g(0);m(N==="left"?"session":"right")},[t,r,l,m]);return oe(rp,(y)=>{let N=y.detail?.panelKey;if(N)w(N)}),{right:b,left:v,openSessionDrawer:c,openRightDrawer:k,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"}]]},to=s(vt);function Be(){let t=ws(),[r,l]=n(null),m=a((v,x)=>{l({top:x,bottom:x,left:v,right:v})},[]),b=Sd({enabled:t,onLongPress:m}),g=a(()=>l(null),[]);return{anchor:r,close:g,surfaceProps:{onContextMenu:(v)=>{v.preventDefault();let x=v.currentTarget.getBoundingClientRect();l({top:x.top,bottom:x.bottom,left:x.left,right:x.right})},onTouchStart:b.onTouchStart,onTouchMove:b.onTouchMove,onTouchEnd:b.onTouchEnd,onTouchCancel:b.onTouchCancel,onClickCapture:(v)=>{if(!b.consume())return;v.preventDefault(),v.stopPropagation()}}}}var St=10,no=600000;function ro({activeSessionTitle:t,activeSessionId:r,onOpenSessionSidebar:l,onOpenRightSidebar:m,onNewSession:b,onSelectSession:g}){let{folders:v}=Ze(),x=cp(),k=ja(r),[c,w]=n(null),{hidden:y,setHidden:N}=dg(),O=Be(),R=ap("mobile"),F=u(()=>{let T=Date.now(),W=[];for(let M of v)for(let D of M.sessions??[]){if(D.is_archived===1)continue;let E=jh(String(D.id)),_=D.updated_at?Date.parse(D.updated_at):0,G=E!==void 0&&T-E<=no?E:_;if(E!==void 0&&T-E>no)continue;W.push({id:D.id,title:D.title,folderName:M.name,modified:G})}return W.sort((M,D)=>D.modified-M.modified).slice(0,St)},[v]),P=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 ${Sl} px-3 z-20 titlebar-drag-region select-none`,...Ha(),...O.surfaceProps,style:ai(),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(to,{size:20,strokeWidth:2})}),e("span",{className:"relative font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:[e(Ga,{glow:!0}),e("span",{className:"absolute -top-0.5 -right-1.5 flex",children:e(gu,{status:x})})]}),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:(T)=>{w((W)=>W?null:Me(T.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:P,"aria-haspopup":"menu","aria-expanded":c!==null,children:[e("span",{className:"truncate",children:P}),k&&e(p,{size:12,className:"animate-spin text-ink/50 flex-shrink-0",role:"status","aria-label":"Generating a session name…"}),e(C,{size:13,className:"text-ink/50 flex-shrink-0"})]}),c&&e(ze,{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),b()},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(L,{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:F.length===0?e("div",{className:"px-2.5 py-2 text-ink/40 italic",children:"No sessions yet"}):F.map((T)=>e("button",{type:"button",onClick:()=>{w(null),g(T.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(T.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:T.title?T.title.charAt(0).toUpperCase()+T.title.slice(1):"Untitled"}),e("span",{className:"truncate text-[10px] text-ink/40 font-mono",children:T.folderName})]}),String(r)===String(T.id)&&e(f,{size:12,className:"flex-shrink-0"})]},T.id))})]})]})]}),e(pg,{layout:"mobile",sessionId:r==null?null:String(r),showRightPanel:!1,onToggleRightPanel:m,entries:R,hidden:y}),O.anchor?e(ni,{anchor:O.anchor,title:"Navbar",align:"right",items:ug([...R.inline,...R.folded]).filter((T)=>T.id!==_n.install).map((T)=>({...T,removable:!0})),hidden:y,onToggle:N,onClose:O.close}):null]})}function io({activeSessionId:t,onSelectSession:r,onNewSession:l,onOpenSessionSidebar:m,onOpenRightSidebar:b,appSettings:g={}}){let{folders:v}=Ze(),[x,k]=n(null),c=u(()=>{if(!t)return"New session";for(let y of v){let N=y.sessions?.find((O)=>String(O.id)===String(t));if(N)return N.title}return null},[t,v]);return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative",children:[e(ro,{activeSessionTitle:x||c||"New session",activeSessionId:t,onOpenSessionSidebar:m,onOpenRightSidebar:b,onNewSession:l,onSelectSession:r}),e("main",{className:"flex-1 min-h-0",children:e(Ag,{appSettings:g,onSessionTitle:k,variant:"mobile"})})]})}function so({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",...Ha(),...l,style:{...ai()},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(Ga,{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(mg,{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(h,{size:19,strokeWidth:2})})]})]})}function ao({onSettings:t,onKeyBindings:r,onAbout:l,updateAvailable:m,onUpdateClick:b,onDesktopToggle:g,shellDownload:v}){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(Cl,{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(Qa,{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(he,{size:14}),e("span",{children:"About"})]}),v&&e(og,{download:v,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(La,{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",cu.version]}),m&&e("button",{type:"button",onClick:b,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 lo(t){let r=ig(),l=ag();return oe(uu,()=>{t.onClose(),t.openAbout(),r.apply("kabmo").then((m)=>{if(!m)return;t.pushToast(m.message,Mc(m))})}),sg(r,t.pushToast),{updates:r,shellDownload:l}}function po(t,r,l){return t.filter((m)=>m.id!==r&&!(l&&m.side==="left"))}function mo(t){return t}var xt=8;function _e({panels:t,activeId:r,onSelect:l,hasGitChanges:m=!1}){let b=i(null),g=i(new Map),v=i({activeId:r,panels:t});v.current={activeId:r,panels:t};let x=i({signature:"",width:0}),k=a(()=>{let c=b.current,w=g.current.get(v.current.activeId);if(!c||!w||c.clientWidth<=0)return;let y=`${v.current.activeId}\x00${v.current.panels.map((P)=>P.id).join("\x00")}`,N=x.current;if(N.signature===y&&N.width===c.clientWidth)return;x.current={signature:y,width:c.clientWidth};let O=c.getBoundingClientRect(),R=w.getBoundingClientRect(),F=eg({scrollLeft:c.scrollLeft,clientWidth:c.clientWidth,scrollWidth:c.scrollWidth,start:R.left-O.left+c.scrollLeft,size:R.width},xt);if(F!==c.scrollLeft)c.scrollLeft=F},[]);return K(k,[r,t,k]),o(()=>{let c=b.current;if(!c||typeof ResizeObserver>"u")return;let w=new ResizeObserver(k);return w.observe(c),()=>w.disconnect()},[k]),e("div",{ref:b,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:(y)=>{if(y)g.current.set(c.id,y);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(yo,{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:jt}),w&&e("span",{className:`shrink-0 whitespace-nowrap ${c.id==="git"?"tracking-wide":""}`,children:c.label}),c.id==="git"&&m&&e("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full bg-info",title:"Uncommitted changes"})]},c.id)})})}function uo({panels:t,activeId:r,onSelect:l,menuProps:m}){return e("div",{className:"px-3 py-1.5 border-b border-ink/10 bg-canvas flex-shrink-0",...m,children:e(_e,{panels:t,activeId:r,onSelect:l})})}function fo({panelKey:t,panel:r,body:l}){if(!r)return e("div",{className:"flex-1 min-h-0",children:e(fu,{panelKey:t})});return e("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:e(Fe,{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(zo,{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",Le="border-ink/15 bg-paper hover:bg-ink/5 text-ink/80 hover:text-ink",ho="bg-ink/10 text-ink border-ink/30";function bo({searchQuery:t,sortOption:r,optionsOpen:l,showArchived:m,optionsRef:b,onNewSession:g,onNewWorkspace:v,onScheduler:x,scheduledCount:k,onRefresh:c,refreshing:w,onToggleOptions:y,onSortChange:N,onResetSort:O,onToggleArchived:R,onHideArchived:F,onSearchChange:P,onClearSearch:T,onSelectWorkspaces:W,selecting:M}){let{ref:D,width:E}=qs(0),_=JA(E),G={};for(let Z of wp.slice(0,_))G[Z]=!0;let j=wp.slice(_),A=m?"Hide archived sessions":"Show archived sessions",te=k>0?`Scheduled tasks (${k} armed)`:"Scheduled tasks",q=[];if(j.includes("new-workspace"))q.push({id:"new-workspace",label:"New Workspace",icon:yn,onSelect:v});if(j.includes("refresh"))q.push({id:"refresh",label:"Refresh sessions",icon:S,onSelect:c});if(j.includes("scheduler"))q.push({id:"scheduler",label:te,icon:Wa,onSelect:x});if(j.includes("archive"))q.push({id:"archive",label:A,icon:ft,onSelect:R,active:m});if(j.includes("select"))q.push({id:"select",label:M?"Cancel selection":"Select workspaces",icon:Hr,onSelect:W,active:M});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:D,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(L,{size:15,strokeWidth:2.4,className:"shrink-0"}),e("span",{className:"min-w-0 truncate",children:"New Session"})]}),G["new-workspace"]&&e("button",{type:"button",onClick:v,className:`${Ae} ${Le}`,title:"New Workspace","aria-label":"New Workspace",children:e(yn,{size:16,strokeWidth:1.8})}),G.scheduler&&e("button",{type:"button",onClick:x,className:`relative ${Ae} ${Le}`,title:te,"aria-label":k>0?`Scheduled tasks, ${k} armed`:"Scheduled tasks",children:[e(Wa,{size:16,strokeWidth:1.8}),k>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:k>9?"9+":k})]}),G.archive&&e("button",{type:"button",onClick:R,"aria-pressed":m,className:`${Ae} ${m?"bg-warning/15 border-warning/40 text-warning-text":Le}`,title:A,"aria-label":A,children:e(ft,{size:16,strokeWidth:1.8})}),G.select&&e("button",{type:"button",onClick:W,"aria-pressed":M,className:`${Ae} ${M?ho:Le}`,title:M?"Cancel selection":"Select workspaces","aria-label":M?"Cancel selection":"Select workspaces",children:e(Hr,{size:16,strokeWidth:1.8})}),G.refresh&&e("button",{type:"button",onClick:c,className:`${Ae} ${Le}`,title:"Refresh sessions","aria-label":"Refresh sessions","aria-busy":w,children:e(S,{size:15,strokeWidth:1.8,className:w?"animate-spin":void 0})}),G.sort&&e("div",{className:"relative flex-shrink-0",ref:b,children:[e("button",{type:"button",onClick:y,className:`${Ae} ${l||r!=="A-Z"?ho:Le}`,title:"Sort workspaces","aria-label":"Sort workspaces",children:e(Hs,{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(ii,{variant:"mobile",sortOption:r,onSortChange:N})})]}),j.length>0&&e(Yu,{actions:q,sortHidden:j.includes("sort"),sortOption:r,onSortChange:N,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:(Z)=>P(Z.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:T,className:"absolute right-2.5 text-ink/40 hover:text-ink p-1","aria-label":"Clear search",children:e(h,{size:13})})]}),(m||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:O,className:"hover:text-ink ml-0.5",title:"Reset sort",children:e(h,{size:10})})]}),m&&e("span",{className:"inline-flex items-center space-x-1 bg-warning/15 border border-warning/25 text-warning-text rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e(ft,{size:10}),e("span",{children:"Archived"}),e("button",{type:"button",onClick:F,className:"hover:text-warning-text ml-0.5",title:"Hide archived",children:e(h,{size:10})})]})]})]})}var wt="p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink";function go({folder:t,canWorktree:r,onOpenFolder:l,onNewWorktree:m,onSelectSessions:b,confirmDelete:g,onPin:v,onDelete:x,onRequestDelete:k,onCancelDelete:c}){let[w,y]=n(!1),N=i(null),[O,R]=n(null),F=(P)=>()=>{y(!1),P()};return e("div",{className:"relative flex items-center",onClick:(P)=>P.stopPropagation(),children:[e("button",{ref:N,type:"button",onClick:(P)=>{if(P.stopPropagation(),N.current)R(Me(N.current));y((T)=>!T)},className:wt,title:"Workspace options","aria-label":`Options for ${t.name}`,"aria-haspopup":"menu","aria-expanded":w,children:e(Ie,{size:15})}),e(ze,{anchor:w?O: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:()=>{y(!1),c()},children:e(Xs,{variant:"mobile",isPinned:t.isPinned,onOpenFolder:l?F(l):void 0,onNewWorktree:r&&m?F(m):void 0,onSelectSessions:b?F(b):void 0,confirmDelete:g,onPin:F(v),onDelete:F(x),onRequestDelete:k,onCancelDelete:c})})]})}var So={inset:"",insetPx:0,slotWidth:16,markGap:8,padding:"py-2",glyph:ut.touch};function xo({session:t,harness:r,isActive:l,status:m,awaitingInput:b=!1,timeAgo:g,timeTitle:v,runStartedAt:x,expandable:k=!1,isExpanded:c=!1,onToggleExpand:w,isChild:y=!1,folderId:N,onSelect:O,onArchive:R,onDelete:F,onRename:P,onRenameWithAi:T,waitingFor:W,onCancelWait:M,selectable:D=!1,selected:E=!1,onToggleSelect:_}){let{isEditing:G,draft:j,setDraft:A,inputRef:te,startRename:q,handleKeyDown:Z,handleBlur:Y}=Zo(t.title,P),H=ja(t.id),ne=Xo(),se=ne.anchor!==null,Q=Boolean(P||R||F||M),re=Boolean(W),ie=k&&Boolean(w),J=t.title.charAt(0).toUpperCase()+t.title.slice(1);if(G)return e("div",{className:"w-full rounded-lg flex items-center bg-ink/10",children:e("input",{ref:te,autoFocus:!0,value:j,onChange:(ee)=>A(ee.currentTarget.value),onKeyDown:Z,onBlur:Y,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":se?"true":void 0,onContextMenu:Q&&!D?ne.openAtCursor:void 0,className:`w-full rounded-lg flex items-center transition-colors ${D&&E||se?Zs:l?"bg-ink/10 font-medium text-ink":"hover:bg-ink/5 text-ink/85"}`,children:[e("button",{type:"button",onClick:D?_:O,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:[D?e(qr,{checked:E,label:`Select ${t.title}`,onChange:()=>_?.()}):e("span",{className:"w-4 flex-shrink-0 flex items-center justify-center",children:H?e("span",{role:"status","aria-label":"Generating a name…",children:e(p,{size:13,className:"text-ink/50 animate-spin"})}):b?e(Re,{size:13,className:"text-ink/70 animate-pulse"}):re?e("span",{role:"status","aria-label":`Waiting for ${W?.title??"another session"}`,children:e(Ye,{size:13,className:"text-ink/60 animate-pulse"})}):m==="stream"?e("span",{role:"status","aria-label":"Running",children:e(p,{size:13,className:"text-ink/50 animate-spin"})}):m?e(f,{size:13,className:"text-ink/50"}):y?e("span",{"data-testid":"child-indicator",className:"text-ink/35","aria-hidden":"true",children:e(de,{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(st,{harness:r,size:ut.touch})}),e("span",{className:"min-w-0 truncate text-xs",children:J})]}),re&&e("span",{className:"text-[10px] text-ink/40 truncate",children:["waiting for ",W?.title??"another session"]}),t.worktree?e(Vs,{worktree:t.worktree}):null]})]}),e(Js,{timeAgo:g,timeTitle:v,runStartedAt:x,className:"text-[11px] font-mono flex-shrink-0 ml-2",restingClassName:"text-ink/45"})]}),Q&&!D&&e("button",{type:"button",onClick:ne.openBelow,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":se,className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 text-ink/35 hover:text-ink rounded-lg cursor-pointer",children:e(Ie,{size:16})}),ie&&!D&&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(C,{size:14}):e(le,{size:14})})]}),ne.anchor&&e(ei,{anchor:ne.anchor,sessionId:t.id,...r?{harness:r}:{},...N!==void 0?{folderId:N}:{},isArchived:t.is_archived===1,onRename:P?q:void 0,onRenameWithAi:T,onArchive:R,onDelete:F,onCancelWait:M,onClose:ne.close})]})}function ko(t,r){let[l,m]=n(!1);return{open:()=>m(!0),dialog:l?e(ti,{isOpen:!0,onClose:()=>m(!1),root:t.project_path??null,folderId:t.id,folderName:t.name,onCreated:(b)=>{m(!1),r(b.path)}}):null}}function wo({hiddenCount:t,canShowLess:r,onShowMore:l,onShowLess:m}){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(C,{size:12})}),e("span",{className:"w-2 shrink-0"}),e("span",{className:"truncate",children:["Show more sessions (",t,")"]})]}),r&&e("button",{type:"button",onClick:m,className:"ml-auto shrink-0 flex items-center gap-1 text-xs text-ink/60 hover:text-ink pl-3 py-2",children:[e(gt,{size:12}),e("span",{className:"truncate",children:"Show less"})]})]})}function No(t){return t?"mb-4":"mb-1"}function Po({folder:t,activeSessionId:r,onSelectSession:l,onNewSessionForFolder:m,onOpenWorkspacePanels:b,onNewWorktreeSession:g,isExpanded:v,onToggleExpand:x,showArchived:k=!1,sessionStatus:c={},onToast:w,batch:y,onStartSessionSelection:N,onCancelWait:O}){let{visibleCount:R,showMore:F,showLess:P,canShowLess:T}=ls(),W=ko(t,(z)=>g?.(t.id,z)),{refresh:M,runStartedAtMap:D}=Ze(),{expandedSessionIds:E,toggleSession:_}=Ms(),[G]=ce(),j=G.get("subagent"),A=G.get("sessionId"),{confirmDelete:te,requestDelete:q,cancelDelete:Z,handlePin:Y,handleDelete:H,handleArchive:ne,handleRename:se,handleRenameWithAi:Q,handleOpenFolder:re}=Ks(t,M,w),ie=Yo(),J=Y,ee=H,pe=re??void 0,be=(t.sessions||[]).filter((z)=>k?z.is_archived===1:z.is_archived!==1),we=ga(t.icon),{folderCheckbox:ve,sessionCheckboxes:ge,folderSummary:V,toggleFolderSelection:I,rendered:ue,hiddenCount:ye}=nl({batch:y,folder:t,sessions:be,showArchived:k,visibleCount:R,activeSessionId:r,sessionStatus:c}),Te=li(ue),xe=v||ge,Pe=(z,Ee)=>{let Se=String(z.id),qe=String(r)===Se,pt=qe&&A===Se&&Boolean(j),Ke=Qt(Se);return e(xo,{session:z,harness:z.harness,folderId:z.folder_id,isActive:qe&&!pt,status:c[Se],awaitingInput:Boolean(z.awaitingInput),timeAgo:Ys(z.updated_at??z.created_at),timeTitle:si(z.updated_at??z.created_at),runStartedAt:c[Se]==="stream"?D[Se]:void 0,expandable:Ee.expandable,isChild:Ee.isChild,isExpanded:Ee.isExpanded,onToggleExpand:Ee.onToggleExpand,onSelect:()=>l(z.id),onArchive:()=>ne(z),onDelete:Ke?void 0:()=>ie.requestDelete(z),onRename:Ke?void 0:(mt)=>void se(z,mt),onRenameWithAi:Ke?void 0:()=>void Q(z),waitingFor:z.waitingFor?{title:z.waitingFor.title}:void 0,onCancelWait:z.waitingFor?()=>O?.(z.waitingFor.waitId):void 0,selectable:ge,selected:Boolean(y?.selected.includes(Se)),onToggleSelect:y?()=>y.toggle(Se):void 0})},dt=(z)=>tl(z,Te.childrenOf,E,_);return e("div",{className:No(xe),"data-testid":"session-folder",children:[e("div",{onClick:y?void 0:x,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:[ve&&V?e(qr,{size:"md",checked:V.all,indeterminate:V.some,label:`Select ${t.name}`,onChange:I}):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(rn,{size:15,className:"text-ink/80"}):e(we,{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:be.length}),t.project_path&&e(de,{size:13,className:"text-ink/50 ml-1"}),!y&&e(d,{children:[e("span",{className:"flex items-center justify-center",children:v?e(C,{size:14}):e(le,{size:14})}),e("button",{type:"button",onClick:(z)=>{z.stopPropagation(),b(t.id)},className:`p-1.5 rounded-lg transition-colors ${String(r)===Ir(t.id)?el:"hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink"}`,title:"Workspace panels","aria-label":`Open workspace panels for ${t.name}`,"aria-pressed":String(r)===Ir(t.id),children:e(tt,{size:15})}),e("button",{type:"button",onClick:(z)=>{z.stopPropagation(),m(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(L,{size:15})}),e(go,{folder:t,canWorktree:Boolean(g&&t.project_path),onOpenFolder:pe,onNewWorktree:g?()=>W.open():void 0,onSelectSessions:N?()=>N(t.id):void 0,confirmDelete:te,onPin:J,onDelete:ee,onRequestDelete:q,onCancelDelete:Z})]})]})]}),xe&&e("div",{className:"mt-0.5 space-y-0.5",children:[Te.roots.map((z)=>{let Ee=String(z.id),Se=dt(z);return e("div",{className:"space-y-0.5",children:[Pe(z,Se),Se.isExpanded&&e(Gi,{parentId:Ee,hasSubagents:Boolean(z.hasSubagents),childrenOf:Te.childrenOf,expandedIds:E,onToggle:_,activeSessionId:r===null?null:String(r),renderSession:Pe,style:So})]},z.id)}),e(wo,{hiddenCount:ge?0:ye,canShowLess:!ge&&T,onShowMore:F,onShowLess:P})]}),e(Jo,{session:ie.pending,isDeleting:ie.isDeleting,error:ie.error,onClose:ie.cancelDelete,onConfirm:()=>void ie.confirmDelete()}),W.dialog]})}function Co({folders:t,activeSessionId:r,expandedFolders:l,showArchived:m,sessionStatus:b,onSelectSession:g,onNewSessionForFolder:v,onOpenWorkspacePanels:x,onNewWorktreeSession:k,onToggleFolder:c,onToast:w,batch:y,onStartSessionSelection:N,onCancelWait:O}){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((R)=>e(Po,{folder:R,activeSessionId:r,onSelectSession:g,onNewSessionForFolder:v,onOpenWorkspacePanels:x,onNewWorktreeSession:k,isExpanded:l[R.id]??!0,onToggleExpand:()=>c(R.id),showArchived:m,sessionStatus:b,onToast:w,batch:y,onStartSessionSelection:N,onCancelWait:O},R.id))})}var yt=[3,2];function Mo(){return e("div",{className:"flex-1 p-3 space-y-4","aria-hidden":"true",children:yt.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,m)=>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-m%3*12}%`}})]},m))]},r))})}function Ro({folders:t,initializing:r,failed:l,activeSessionId:m,expandedFolders:b,sessionStatus:g,searchQuery:v,sortOption:x,optionsOpen:k,showArchived:c,harnessFilter:w,onHarnessFilterChange:y,harnessOptions:N,optionsRef:O,scheduledCount:R,refreshing:F,selecting:P,batch:T,onNewSession:W,onNewWorkspace:M,onScheduler:D,onRefresh:E,onToggleOptions:_,onSortChange:G,onResetSort:j,onToggleArchived:A,onHideArchived:te,onSearchChange:q,onClearSearch:Z,onSelectWorkspaces:Y,onSelectSession:H,onNewSessionForFolder:ne,onOpenWorkspacePanels:se,onNewWorktreeSession:Q,onToggleFolder:re,onToast:ie,onStartSessionSelection:J,onCancelWait:ee}){return e(d,{children:[e(bo,{searchQuery:v,sortOption:x,optionsOpen:k,showArchived:c,optionsRef:O,onNewSession:W,onNewWorkspace:M,onScheduler:D,scheduledCount:R,onRefresh:E,refreshing:F,onToggleOptions:_,onSortChange:G,onResetSort:j,onToggleArchived:A,onHideArchived:te,onSearchChange:q,onClearSearch:Z,onSelectWorkspaces:Y,selecting:P}),e("div",{className:"px-3 pt-2 pb-1",children:e(Ws,{options:N,value:w,onChange:y,touch:!0})}),l?e(rl,{touch:!0,onRetry:E,refreshing:F}):r?e(Mo,{}):e(Co,{folders:t,activeSessionId:m,expandedFolders:b,showArchived:c,sessionStatus:g,onSelectSession:H,onNewSessionForFolder:ne,onOpenWorkspacePanels:se,onNewWorktreeSession:Q,onToggleFolder:re,onToast:ie,batch:T,onStartSessionSelection:J,onCancelWait:ee})]})}function To({sidebarStyle:t,controller:r,batch:l,dock:m,dockBody:b,expandedFolders:g,optionsRef:v,activeSessionId:x,scheduledCount:k,onToggleFolder:c,onNewSession:w,onNewWorkspace:y,onScheduler:N,onToggleArchived:O,onNewSessionForFolder:R,onOpenWorkspacePanels:F,onNewWorktreeSession:P,onToast:T,onArchiveSelected:W,onCancelWait:M}){let{initializing:D,failed:E,refreshNow:_,isRefreshing:G,searchQuery:j,setSearchQuery:A,showArchived:te,setShowArchived:q,optionsOpen:Z,setOptionsOpen:Y,sortOption:H,handleSortChange:ne,harnessFilter:se,setHarnessFilter:Q,harnessOptions:re,processedFolders:ie,sessionStatus:J,handleSelectSession:ee}=r,{selection:pe,deleteRun:be,archiveRun:we,binding:ve,scopeFolder:ge,available:V,selected:I}=l,ue={className:"flex-1 min-h-0 w-full",folders:ie,initializing:D,failed:E,activeSessionId:x,sessionStatus:J,searchQuery:j,onSearchChange:A,showArchived:te,onToggleArchived:O,sortOption:H,optionsOpen:Z,onToggleOptions:()=>Y(!Z),onCloseOptions:()=>Y(!1),onSortChange:ne,harnessFilter:se,onHarnessFilterChange:Q,harnessOptions:re,onRefresh:_,refreshing:G,scheduledCount:k,onNewSession:w,onNewWorkspace:y,onScheduler:N,onSelectSession:ee,onNewSessionForFolder:R,onOpenWorkspacePanels:F,onNewWorktreeSession:P,onToast:T,onCancelWait:M,batch:ve,onSelectWorkspaces:l.toggleWorkspaceSelection,onStartSessionSelection:(ye)=>pe.begin("session",ye)};return e(d,{children:[e("div",{className:m.showingSessions?"contents":"hidden",children:[t==="modern"?e(Ju,{...ue,touch:!0}):e(Ro,{folders:ie,initializing:D,failed:E,activeSessionId:x,expandedFolders:g,sessionStatus:J,searchQuery:j,sortOption:H,optionsOpen:Z,showArchived:te,harnessFilter:se,onHarnessFilterChange:Q,harnessOptions:re,optionsRef:v,scheduledCount:k,refreshing:G,selecting:pe.mode!==null,batch:ve,onNewSession:w,onNewWorkspace:y,onScheduler:N,onRefresh:_,onToggleOptions:()=>Y(!Z),onSortChange:ne,onResetSort:()=>ne("A-Z"),onToggleArchived:O,onHideArchived:()=>q(!1),onSearchChange:A,onClearSearch:()=>A(""),onSelectWorkspaces:l.toggleWorkspaceSelection,onSelectSession:ee,onNewSessionForFolder:R,onOpenWorkspacePanels:F,onNewWorktreeSession:P,onToggleFolder:c,onToast:T,onStartSessionSelection:(ye)=>pe.begin("session",ye),onCancelWait:M}),pe.mode&&e(nd,{drawer:!0,mode:pe.mode,count:I.length,total:V.length,busy:be.isDeleting,archiving:we.isArchiving,scopeLabel:ge?.name,onSelectAll:()=>pe.selectAllOf(V),onUnselectAll:()=>pe.unselectAllOf(V),onDelete:()=>be.request(I),onArchive:W,onCancel:pe.end})]}),m.showingSessions?null:e(fo,{panelKey:m.activeView,panel:m.activePanel,body:b})]})}function Eo(t,r){let l=t.tabs;Os({enabled:t.tabsMode,revealed:tg(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 m=i(!1),b=l?{...l,select:(g)=>{m.current=!0,l.select(g)},open:(g)=>{m.current=!0,l.open(g)},close:(g)=>{m.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(m.current){m.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:b}}function He(t){return{dragRegion:!0,layout:"mobile",rootProps:{...Ha(),...t},style:{paddingLeft:Mi(Li("0.75rem",!0)),paddingRight:Hl("0.75rem",!0)}}}function Oo({side:t,onClose:r}){let l=t==="left"?dn:ir;return e("button",{type:"button",onClick:r,className:`${Je.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:Ur.mobile,strokeWidth:1.8})})}function Do({activeSessionId:t,newWorkspaceOpen:r,onCloseNewWorkspace:l,schedulerOpen:m,onCloseScheduler:b,aboutOpen:g,onCloseAbout:v,updates:x,pushToast:k,batchDelete:c,batchMode:w,onEndBatch:y,scopeLabel:N}){return e(d,{children:[e(Ns,{isOpen:r,onClose:l,onCreate:Gl,onClone:jl}),e(Vu,{isOpen:m,onClose:b,activeSessionId:t===null?null:String(t),onToast:k}),e(Jd,{isOpen:g,onClose:v,updates:x,onToast:k}),e(rg,{updates:x}),e(rd,{mode:w??"session",count:c.pending.length,scopeLabel:N,isDeleting:c.isDeleting,progress:c.progress,outcome:c.outcome,onClose:()=>{let O=c.outcome?.refused.length??0;if(c.cancel(),c.outcome&&O===0)y()},onConfirm:()=>{let O=w??"session";c.confirm(O).then((R)=>{if(R&&R.refused.length===0)y()})}})]})}function Ao(){let t=Ft(),r=pr("left"),[l,m]=co("layout.mobileLeftPanel",Ne),b=Zf(l,t.enabled),g=gp("left"),v=t.enabled&&g==="tabs",x=u(()=>new Set(r.map((c)=>c.id)),[r]),k=Ps("left",x,Ne);return{catalog:r,activeView:b,setActiveView:m,showingSessions:b===Ne,activePanel:r.find((c)=>c.id===b),enabled:t.enabled,tabsMode:v,tabs:v?k:null}}function Fo(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 Io({appSettings:t,onSelectSession:r,onClose:l,rootPath:m,refreshKey:b,onRefresh:g,onOpenFile:v}){let x=Zu(t,{onSelectSession:r,onAfterSelect:l}),{folders:k,processedFolders:c,refreshNow:w,showArchived:y,activeSessionId:N}=x,O=td(c,y,w),[R,F]=n({1:!0,2:!0,3:!0}),P=i(null);$e(P,()=>x.setOptionsOpen(!1));let T=(E)=>{F((j)=>({...j,[E]:!j[E]}));let _=k.find((j)=>j.id===E),G=!(R[E]??_?.isExpanded??!0);Cp(E,G)},W=c.map((E)=>`${E.id}:${E.isExpanded}`).join("|");o(()=>{F(Object.fromEntries(c.map((E)=>[E.id,E.isExpanded])))},[W]);let M=Ao(),D=Fo({sessionId:N,refreshKey:b,rootPath:m,onRefresh:g,onOpenFile:v,onClose:l,requiresWorkspace:M.activePanel?.requiresWorkspace??!1,hasActiveContext:Boolean(m)});return{controller:x,batch:O,expandedFolders:R,toggleFolder:T,optionsRef:P,dock:M,dockBody:D}}function Ve(t){let{disabledPanels:r}=kn(),{setEnabled:l}=Pl(),m=Be(),b=Xf(t),g=a((v,x)=>{l(v,x)},[l]);return{...m,items:b,hidden:r,toggle:g}}function Lo({activeSessionId:t,onSelectSession:r,onNewSession:l,onNewSessionForFolder:m,onOpenWorkspacePanels:b,onNewWorktreeSession:g,onClose:v,onDesktopToggle:x,appSettings:k={},rootPath:c,refreshKey:w=0,onRefresh:y,onOpenFile:N,revealSignal:O=0}){let{controller:R,batch:F,expandedFolders:P,toggleFolder:T,optionsRef:W,dock:M,dockBody:D}=Io({appSettings:k,onSelectSession:r,onClose:v,rootPath:c,refreshKey:w,onRefresh:y,onOpenFile:N}),{showArchived:E,setShowArchived:_}=R,{selection:G,deleteRun:j,archiveRun:A,selected:te,scopeFolder:q}=F,Z=Ld(),Y=Ve("left"),[H,ne]=n(!1),[se,Q]=n(!1),re=Ku(),[ie,J]=n(!1),{pushToast:ee}=Ue(),pe=Ul(ee);Xu({onNotice:ee});let{updates:be,shellDownload:we}=lo({onClose:v,openAbout:()=>J(!0),pushToast:ee}),{tabs:ve}=Eo(M,O),ge=()=>{l(),v()},V=()=>{A.archive(te).then((xe)=>{if(!xe)return;let Pe=ed(xe);if(Pe)ee(Pe.message,Pe.tone);if(!xe.error)G.end()})},I=(xe)=>{m(xe),v()},ue=()=>{_(!E)},ye=g?(xe,Pe)=>{g(xe,Pe),v()}:void 0,Te=e(To,{sidebarStyle:Z,controller:R,batch:F,dock:M,dockBody:D,expandedFolders:P,optionsRef:W,activeSessionId:t,scheduledCount:re,onToggleFolder:T,onNewSession:ge,onNewWorkspace:()=>ne(!0),onScheduler:()=>Q(!0),onToggleArchived:ue,onNewSessionForFolder:I,onOpenWorkspacePanels:b,...ye?{onNewWorktreeSession:ye}:{},onToast:ee,onArchiveSelected:V,onCancelWait:pe});return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative select-none",children:[e(so,{onClose:v,viewLabel:M.showingSessions?"Sessions":M.activePanel?.label??"Panel",menuProps:Y.surfaceProps}),!M.tabsMode&&mo(M.enabled)?e(uo,{panels:M.catalog,activeId:M.activeView,onSelect:M.setActiveView,menuProps:Y.surfaceProps}):null,M.tabsMode&&ve?e("div",{className:"flex-1 min-h-0 flex flex-col",children:e(Fs,{catalog:M.catalog,tabs:ve,pinned:Ne,homeTitle:"Panel kiri",stripProps:He(Y.surfaceProps),children:e("div",{className:"h-full w-full",children:Te})})}):null,Y.anchor?e(ni,{anchor:Y.anchor,items:Y.items,hidden:Y.hidden,onToggle:Y.toggle,onClose:Y.close}):null,M.tabsMode?null:e("div",{className:"contents",children:Te}),e(ao,{onSettings:()=>window.dispatchEvent(new CustomEvent("omp:open-settings",{detail:{}})),onKeyBindings:Oc,onAbout:()=>J(!0),shellDownload:we,onDesktopToggle:x,updateAvailable:be.hasUpdate,onUpdateClick:()=>{J(!0),be.check()}}),e(Do,{activeSessionId:t,newWorkspaceOpen:H,onCloseNewWorkspace:()=>ne(!1),schedulerOpen:se,onCloseScheduler:()=>Q(!1),aboutOpen:ie,onCloseAbout:()=>J(!1),updates:be,pushToast:ee,batchDelete:j,batchMode:G.mode,onEndBatch:G.end,scopeLabel:q?.name})]})}function Wo({catalog:t,activeId:r,onSelect:l,hasGitChanges:m,onClose:b,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",...Ha(),...g,style:ai(),children:[e("div",{className:"flex items-center min-w-0 titlebar-no-drag",children:e(_e,{panels:t,activeId:r,onSelect:l,hasGitChanges:m})}),e("button",{type:"button",onClick:b,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(h,{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(Fe,{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(zo,{value:r,children:t.render(r)})})}function Bo({enabled:t=!0,rootPath:r,refreshKey:l=0,onRefresh:m,onOpenFile:b,onClose:g,revealSignal:v=0}){let[x,k]=co("layout.mobileRightPanel",Sa),{sessionId:c}=Oe(),w=Ft(),y=po(pr("all"),Ne,w.enabled),N=y.find((H)=>H.id===x)??y[0],R=gp("right")==="tabs",F=u(()=>new Set(y.map((H)=>H.id)),[y]),P=Ps("right",F,null),T=fe(c,"layout.mobileRightPanel")!==void 0;Os({enabled:R,revealed:tg(v),storedView:T?x:null,home:P.home,chosenHome:P.chosenHome,openTab:P.open,known:F});let{open:W,tabs:M}=P,D=(H)=>{if(H!==N?.id)De(H)},E=i(!1),_={...P,select:(H)=>{E.current=!0,D(H),P.select(H)},open:(H)=>{E.current=!0,D(H),P.open(H)},close:(H)=>{E.current=!0,P.close(H)}};o(()=>{if(!R)return;if(P.active!==null&&P.active!==x)k(P.active)},[R,P.active,x,k]),o(()=>{if(!R||P.home)return;if(E.current){E.current=!1;return}if(!T)return;if(M.includes(x)||!F.has(x))return;W(x)},[R,P.home,T,x,M,W,F]);let G=zm(r,t),{changes:j}=Bl(r,G,t),A=j.length>0,te=a((H)=>{if(H!==N?.id)De(H);k(H)},[N?.id,k]);o(()=>{if(!Ge(N?.id))zc()},[N?.id]);let q=Ve(w.enabled?"right":"all"),Z=w.enabled?q.items:q.items.filter((H)=>H.id!==Ne),Y={className:"h-full w-full",enabled:t||!N?.requiresWorkspace,active:!0,refreshKey:l,...r?{rootPath:r}:{},onRefresh:m,onOpenFile:b,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:[R?null:e(Wo,{catalog:y,activeId:N?.id??x,onSelect:te,hasGitChanges:A,onClose:g,menuProps:q.surfaceProps}),R?e("div",{className:"flex-1 min-h-0 flex flex-col",children:e(Fs,{catalog:y,tabs:_,homeTitle:"Panel kanan",stripProps:He(q.surfaceProps),actions:e(Oo,{side:"right",onClose:g}),children:e("div",{className:"h-full w-full",children:e(je,{panel:N,body:Y})})})}):null,q.anchor?e(ni,{anchor:q.anchor,align:"right",items:Z,hidden:q.hidden,onToggle:q.toggle,onClose:q.close}):null,R?null:e("div",{className:"flex-1 min-h-0 overflow-hidden relative",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:e(je,{panel:N,body:Y})})]})}function Ce({label:t,onClick:r,active:l=!1,danger:m=!1,children:b}){let g=m?"bg-error text-error-on 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:`${Je.mobile} flex-none cursor-pointer rounded-lg transition-colors ${g}`,children:b})}var ke=Ur.mobile;function _o({actions:t}){let[r,l]=n(!1),m=i(null);return $e(m,()=>l(!1),r),o(()=>{if(!r)return;let b=(g)=>{if(g.key==="Escape")l(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[r]),e("div",{className:"relative flex-none",ref:m,children:[e("button",{type:"button",onClick:()=>l((b)=>!b),title:"More file actions","aria-label":"More file actions","aria-haspopup":"menu","aria-expanded":r,className:`${Je.mobile} flex-none cursor-pointer rounded-lg text-ink/70 transition-colors hover:bg-ink/10 hover:text-ink`,children:e(Ie,{size:Ur.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((b)=>{let g=b.icon;return e("button",{type:"button",role:"menuitem",onClick:()=>{l(!1),b.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:b.label})]},b.id)})}):null]})}var Nt=420;function Vo({fileName:t,hasPreview:r,isPreview:l,hasReview:m,isReviewing:b,onToggleReview:g,wordWrap:v,copied:x,byteViewer:k=!1,missing:c=!1,onSave:w,onClose:y,onTogglePreview:N,onToggleFind:O,findOpen:R,onToggleWrap:F,onZoomOut:P,onZoomIn:T,onCopy:W,onDownload:M}){let D=Au(Nt),E=u(()=>{let _=[];if(!k)_.push({id:"wrap",label:v?"Word wrap: on":"Word wrap: off",icon:pn,onSelect:F},{id:"zoom-out",label:"Decrease font size",icon:Ja,onSelect:P},{id:"zoom-in",label:"Increase font size",icon:Ya,onSelect:T});if(!D)_.push({id:"copy",label:x?"Copied":"Copy content",icon:x?f:ae,onSelect:W},{id:"download",label:"Download file",icon:me,onSelect:M});return _},[k,D,v,x,F,P,T,W,M]);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:ai(),children:[e("div",{className:"flex items-center gap-1 min-w-0 titlebar-no-drag",children:[e(Ce,{label:"Close editor",onClick:y,children:e(mn,{size:ke,strokeWidth:2})}),e("div",{className:"flex min-w-0 items-center gap-1.5",children:[e(ht,{name:t,size:15,className:`flex-shrink-0${c?" text-error-text":""}`}),e("span",{className:`truncate font-semibold text-xs${c?" text-error-text 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(kt,{size:ke})}),!k&&e(Ce,{label:R?"Close find":"Find in file",onClick:O,active:R,children:e(U,{size:ke})}),m&&e(Ce,{label:b?"Exit review mode":"Review this document",onClick:g,active:b,children:e(rn,{size:ke})}),r&&e(Ce,{label:l?"View source":"Show preview",onClick:N,active:l,children:l?e(Mt,{size:ke}):e(at,{size:ke})}),D&&e(d,{children:[e(Ce,{label:"Copy content",onClick:W,children:x?e(f,{size:ke,className:"text-success-text"}):e(ae,{size:ke})}),e(Ce,{label:"Download file",onClick:M,children:e(me,{size:ke})})]}),E.length>0&&e(_o,{actions:E})]})]})}function $o({fileName:t,content:r,path:l,root:m,repo:b,fontSize:g,scrollRef:v,onScroll:x,isLoading:k,unsupported:c,loadError:w,reviewActive:y,onExitReview:N}){return e("div",{ref:v,onScroll:x,"data-testid":"editor-scroller",className:"flex-1 min-h-0 overflow-auto relative bg-paper text-ink select-text",children:k?e("div",{className:"flex items-center justify-center h-full text-ink/40 text-xs gap-2",children:[e(p,{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(vu,{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(B,{size:20,className:"text-error-text"}),e("span",{className:"text-xs text-error-text 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(xu,{content:r,file:{name:t,path:l,root:m,repo:b},active:y,onExit:N})})})}function Go({file:t,editor:r,viewerKind:l,byteViewer:m,isPreview:b,isMd:g,content:v,language:x,wordWrap:k,fileKey:c,revealMarks:w,currentMark:y,surfaceRef:N,setCodeScroller:O,previewRef:R,scroll:F,fontSize:P,reviewActive:T,onExitReview:W,editorTheme:M,editorFontFamily:D,indentUnitText:E,typing:_}){let G=a(async(j)=>{let A=await _u(t,j,{interactive:!0,baseMtimeMs:r.baseMtimeMs});if(A.status==="written")return{ok:!0};if(A.status==="conflict")return{ok:!1,error:"This file changed on disk since it was opened."};if(A.status==="needs-permission")return{ok:!1,error:"Tap Save again to grant write access."};return{ok:!1,error:A.error}},[t,r.baseMtimeMs]);if(r.isImage&&r.imageUrl)return e($i,{src:r.imageUrl,name:t.name,className:"flex-1 min-h-0"});if(r.isImage||Iu(l)&&(m||b))return e(Vl,{kind:l,path:t.path??t.name,name:t.name,source:r.byteSource,content:r.content,root:t.root,repo:t.repo,revision:r.revision,onContentChange:r.onChange,onSaveBytes:r.deviceBacked?void 0:G,onDirtyChange:r.setBinaryDirty});if(r.isLoading||r.unsupported||r.loadError||g&&b)return e($o,{fileName:t.name,content:v,path:t.path??t.name,root:t.root,repo:t.repo,fontSize:P,scrollRef:R,onScroll:F.onScroll,isLoading:r.isLoading,unsupported:r.unsupported,loadError:r.loadError,reviewActive:T,onExitReview:W});return e(Cu,{ref:N,value:v,onValueChange:r.onChange,language:x,wordWrap:k,documentKey:c,marks:w,currentMark:y,onScroller:O,scrollTestId:"editor-scroller",className:"flex-1 min-h-0 text-ink select-text",themeVars:M.vars,themes:M.themes,indentUnitText:E,typing:_,padding:12,placeholder:"This file is empty",style:{fontFamily:D,fontSize:`${P}px`,lineHeight:Es}})}function qo(){return e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-error/30 bg-error/10 text-error-text shrink-0",children:[e(B,{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-text",children:"The buffer is still here. Saving recreates the file — autosave is off until then."})]})]})}function Qo({isImage:t,byteViewer:r,viewerKind:l,lineCount:m,charCount:b,language:g,saveStatus:v,path:x,conflicts:k=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:oi[l]}):e(d,{children:[k>0&&e("span",{className:"text-error-text font-semibold tabular-nums",children:["⚠ ",k]}),e("span",{children:[m," lines"]}),e("span",{children:[b," chars"]}),e("span",{className:"uppercase",children:g})]})}),e("div",{className:"flex items-center space-x-2",children:[v==="saving"&&e(d,{children:[e(p,{size:10,className:"animate-spin"}),e("span",{children:"Saving…"})]}),v==="saved"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),e("span",{children:"Saved"})]}),v==="error"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-error"}),e("span",{className:"text-error-text",children:"Save failed"})]}),v==="idle"&&x&&e("span",{className:"truncate max-w-[140px]",children:x})]})]})}function et({path:t,content:r,ready:l,surfaceRef:m}){let b=Mu(t,r,l),g=i(null);return o(()=>{if(!b||g.current===b.request)return;g.current=b.request;let v=b.matches[b.currentIndex];if(!v)return;m.current?.select(v.start,v.end,!1),m.current?.revealOffset(v.start)},[b,m]),{matches:b?.matches??[],currentIndex:b?.currentIndex??-1}}function ot({path:t,content:r,documentKey:l,ready:m,surfaceRef:b,toggleWordWrap:g}){let v=et({path:t,content:r,ready:m,surfaceRef:b}),x=Lu({text:r,documentKey:l,readSelection:()=>b.current?.getSelection()??null,select:(k,c,w=!0)=>b.current?.select(k,c,w),reveal:(k)=>b.current?.revealOffset(k),applyDocument:(k,c,w)=>b.current?.applyDocument(k,c,w),toggleWordWrap:g});if(x.open&&x.matches.length>0)return{find:x,revealMarks:x.matches,currentMark:x.currentIndex};return{find:x,revealMarks:v.matches.length>0?v.matches:void 0,currentMark:v.currentIndex}}function nt({path:t,symbols:r,total:l,truncated:m,emptyNotice:b,preview:g=!1}){let[v,x]=n(!1);if(!t)return null;let k=(c,w)=>{if(x(!1),g){let y=$d(r,w);if(y)ks({path:t,...y});return}Uo({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:()=>x(!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(ca,{size:16})})}),v&&e(X,{onClose:()=>x(!1),maxWidthClass:"max-w-sm",zClass:"z-[70]",header:e("div",{className:"flex min-w-0 items-center gap-2",children:[e(ca,{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:m?`${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:b}):r.map((c,w)=>e("button",{type:"button",onClick:()=>k(c,w),"aria-label":g?`${hi(c.kind)} ${c.name}`:`${hi(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(Td,{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}`)),m&&e("div",{className:"px-4 py-2 text-[11px] italic text-ink/40",children:Dd(l)})]})})]})}function rt({file:t,missing:r=!1,onClose:l,onFileSaved:m,onDropResult:b}){let g=Us(t.path??t.name),[v,x]=n({}),[k,c]=n(Ho),[w,y]=n(!0),N=Ko(),O=zi(),R=Hu(),F=Wu(),P=g==="markdown",T=zs[g]===!0,W=Du[g]===!0,M=t.path??t.name,D=v[M]??Nu(g),E=zu(String(M)),_=P&&D,G=()=>x((I)=>({...I,[M]:!D})),j=hu({enabled:Boolean(t.root),onResult:b}),A=Ru(t,{flushOnUnmount:!0,reportSaveError:!0,downloadMimeType:"text/plain;charset=utf-8",onFileSaved:m,missing:r}),[te,q]=n(null),Z=al({tabKey:M,surface:P&&D?"rendered":"code",ready:A.loaded,slot:kb,element:P&&D?void 0:te}),[Y,H]=n(null),ne=a((I)=>{Z.ref(I),H(I)},[Z.ref]);Bu({path:t.path??null,scroller:Y,preview:P&&D});let se=i(null),{find:Q,revealMarks:re,currentMark:ie}=ot({path:t.path??null,content:A.content,documentKey:`${M}\x00${A.language}`,ready:A.loaded&&!A.loadError,surfaceRef:se,toggleWordWrap:()=>y((I)=>!I)}),{content:J,language:ee}=A,pe=J.split(`
|
|
2
|
-
`).length,be=wu(J);Fu({file:{id:M,name:t.name,path:t.path??M},editor:A,surfaceRef:se,isPreview:D,exitPreview:()=>x((I)=>({...I,[M]:!1})),publish:!1});let{symbols:we,total:ve,truncated:ge,notice:V}=Nd({content:J,language:ee,path:t.path??null,state:T?"not-a-document":A.loadError?"error":A.loaded?"ready":"loading",note:T?`${oi[g]} files have no text outline.`:A.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",...j.dropProps,...j.captureDropProps,children:[e(Kl,{visible:j.isDragging}),e(Vo,{fileName:t.name,hasPreview:W,isPreview:D,wordWrap:w,copied:A.copied,byteViewer:T,missing:r,onSave:A.saveNow,onClose:l,onTogglePreview:G,hasReview:_,isReviewing:_&&E.active,onToggleReview:E.toggle,onToggleFind:()=>Q.open?Q.close():Q.openFind(),findOpen:Q.open,onToggleWrap:()=>y(!w),onZoomOut:()=>c((I)=>Math.max(Ql,I-1)),onZoomIn:()=>c((I)=>Math.min(Rl,I+1)),onCopy:A.copy,onDownload:A.download}),r&&e(qo,{}),A.diskChange&&e(Pu,{fileName:t.name,onReload:A.reloadFromDisk,onKeepMine:A.keepMineAgainstDisk}),Q.open&&!T&&e("div",{className:"relative shrink-0 h-9 border-b border-ink/10 bg-paper",children:e(Eu,{find:Q})}),e(Go,{file:t,editor:A,viewerKind:g,byteViewer:T,isPreview:D,isMd:P,content:J,language:ee,wordWrap:w,fileKey:M,revealMarks:re,currentMark:ie,surfaceRef:se,setCodeScroller:q,previewRef:ne,scroll:Z,fontSize:k,reviewActive:_&&E.active,onExitReview:E.toggle,editorTheme:O,editorFontFamily:N,indentUnitText:ju(R),typing:F}),!T&&e(nt,{path:t.path??null,symbols:we,total:ve,truncated:ge,emptyNotice:V,preview:P&&D}),e(Qo,{isImage:A.isImage,byteViewer:T,viewerKind:g,lineCount:pe,charCount:J.length,language:ee,saveStatus:A.saveStatus,path:t.path,conflicts:be}),A.saveMissingConfirm&&t.path&&e($u,{fileName:t.name,filePath:t.path,onClose:A.cancelSaveMissing,onConfirm:A.confirmSaveMissing})]})}function it({diff:t,onClose:r,onFileSaved:l}){let m=t.path.split("/").pop()||t.path,b=Boolean(t.staged),g=t.status||"M",v=lr(g,b);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:ai(),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(mn,{size:18,strokeWidth:1.9})}),e(ht,{name:m,size:14,className:"flex-shrink-0"}),e("span",{className:"font-mono text-xs text-ink font-medium truncate",title:t.path,children:m})]}),e("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border flex-shrink-0 ${v.badgeBgClass}`,children:[v.charStatus," ",v.label]})]}),e("div",{className:"flex-1 min-h-0",children:e(ku,{className:"h-full",viewModeButtons:!1,filePath:t.path,status:g,isStaged:b,root:t.root,repo:t.repo||".",journalDiff:t.journal,readOnly:Boolean(t.journal),onFileSaved:l,tabKey:t.journal?cg(t.journal.path,t.journal.from,t.journal.to):lg(t.path,b)})})]})}function We(t,r){let l=t[r];return typeof l==="string"&&l.length>0?l:void 0}function Pt(t){let r=t.content;return typeof r==="string"?r:void 0}function Xe(t,r){let l=typeof t==="object"&&t!==null?t:{},m=(We(l,"path")??"").replace(/^\/+/,"");if(!m)return null;return{name:We(l,"name")??m.split("/").pop()??"file",path:m,content:Pt(l),root:We(l,"root")??r??void 0,repo:We(l,"repo"),handleId:We(l,"handleId"),deviceFile:l.deviceFile===!0?!0:void 0}}function lt(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 ct(t,r,l){vo(l);let m=dr(r);return At(m,MA,{folderId:r,worktreePath:l}),t.setSearchParams((b)=>{let g=Dt(b);return g.set("sessionId",m),g.set("folderId",r.toString()),g},{replace:!0}),t.afterNavigate?.(),m}function kp({onDesktopToggle:t,appSettings:r={}}){let{folders:l,isMock:m}=Ze(),b=Ft(),{sessionId:g}=Oe(),[v,x]=ce(),k=v.get("sessionId"),c=k?Number.isNaN(Number(k))?k:Number(k):null,w=v.get("folderId"),y=w?Number.isNaN(Number(w))?w:Number(w):null,[N,O]=n("main"),R=oo({dock:b,sessionId:g,currentScreen:N,setCurrentScreen:O}),[F,P]=n(null),[T,W]=n(null),[M,D]=n(0),[E,_]=n(!1),[G,j]=n("appearance"),[A,te]=n(!1),q=a(()=>D((V)=>V+1),[]),Z=Qu(lt(F),M),{pushToast:Y}=Ue(),H=a((V)=>Y(V.message,V.ok?"success":"error"),[Y]),ne=Z.size>0;eo({editorOpen:F!==null,diffOpen:T!==null,settingsOpen:E,offMainScreen:N!=="main",onCloseEditor:()=>P(null),onCloseDiff:()=>W(null),onCloseSettings:()=>{_(!1),te(!1)},onReturnToMain:()=>O("main")});let{folder:se}=ql(l,c),Q=se??(y?l.find((V)=>String(V.id)===String(y))??null:null),re=gg(l,c)??Q?.project_path??null,ie=!!Q,J=hu({enabled:ie,onResult:H});oe("omp:open-file",(V)=>{let ue=Xe(V.detail,re);if(ue)P(ue)}),oe("omp:open-diff",(V)=>{let I=V.detail;if(!I?.file)return;W({path:I.file.replace(/^\/+/,""),status:I.status,staged:I.staged,repo:I.repo,root:I.root??re??void 0,...I.source==="journal"&&I.journal?{journal:I.journal}:{}})}),oe("omp:view-subagent",()=>O("main")),oe("omp:open-settings",(V)=>{let I=V.detail;j(I?.category??"appearance"),te(Boolean(I?.autoOpenAdd)),_(!0)});let ee=(V)=>{x((I)=>{let ue=Dt(I);if(ue.set("sessionId",V.toString()),ue.has("subagent"))ue.delete("subagent");return ue},{replace:!0}),O("main")},pe=()=>{x(new URLSearchParams,{replace:!0}),O("main")},be=(V)=>{let I=zl(l,k,V);if(I)vo(I);x((ue)=>Gc(ue,dr(V),V),{replace:!0}),O("main")},we=Qe({stateSessionId:g,drawers:R,setSearchParams:x,setCurrentScreen:O}),ve=(V,I)=>ct({setSearchParams:x,afterNavigate:()=>O("main")},V,I),ge=a((V)=>{let I=Xe(V,re);if(I)P(I)},[re]);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(kg,{}),e(xg,{isMock:m}),e(wg,{workspacePath:re}),e("div",{className:`flex-1 min-h-0 w-full relative ${N==="main"?"block":"hidden"}`,...J.dropProps,...J.captureDropProps,children:[e(Kl,{visible:J.isDragging}),e(io,{activeSessionId:c,onSelectSession:ee,onNewSession:pe,onOpenSessionSidebar:R.openSessionDrawer,onOpenRightSidebar:R.openRightDrawer,appSettings:r})]}),e("div",{className:`flex-1 min-h-0 w-full ${N==="session"?"block":"hidden"}`,children:e(Lo,{activeSessionId:c,onSelectSession:ee,onNewSession:pe,onNewSessionForFolder:be,onOpenWorkspacePanels:we,onNewWorktreeSession:ve,onClose:()=>O("main"),onDesktopToggle:t,appSettings:r,rootPath:re??void 0,refreshKey:M,onRefresh:q,onOpenFile:ge,revealSignal:R.left})}),N==="right"&&e("div",{className:"flex-1 min-h-0 w-full",children:e(Bo,{enabled:ie,rootPath:re??void 0,refreshKey:M,onRefresh:q,onOpenFile:ge,onClose:()=>O("main"),revealSignal:R.right})}),F&&e(rt,{file:F,missing:ne,onClose:()=>P(null),onFileSaved:q}),T&&e(it,{diff:T,onClose:()=>W(null),onFileSaved:q}),e(Ol,{isOpen:E,onClose:()=>{_(!1),te(!1)},initialCategory:G,autoOpenAddProvider:A,appSettings:r})]})}export{kp as MobileLayoutWrapper};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Sg}from"./index-mx5y9vt9.js";import"./index-q3k8r0ms.js";import"./index-2f6afhze.js";export{Sg as MergeDiffView};
|