@kabmo-labs/kabmo 0.40.0 → 0.42.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 +533 -517
- package/dist/client/static/js/{CsvGrid-j9nvnhq1.js → CsvGrid-20k047ht.js} +2 -2
- package/dist/client/static/js/{DocxView-87gnpm81.js → DocxView-qpvhfcmg.js} +5 -5
- package/dist/client/static/js/{DrawioView-a351t8f8.js → DrawioView-178skky8.js} +2 -2
- package/dist/client/static/js/ImageView-460th5qa.js +1 -0
- package/dist/client/static/js/LayoutWrapper-5cv0dty8.js +2 -0
- package/dist/client/static/js/Modal-wks6p4r5.js +38 -0
- package/dist/client/static/js/{PdfView-n6bwcvc8.js → PdfView-y51g03nr.js} +1 -1
- package/dist/client/static/js/SessionsView-rsmvn7ks.js +1 -0
- package/dist/client/static/js/{SheetView-k8ymr87w.js → SheetView-z7yvb05v.js} +25 -25
- package/dist/client/static/js/{SvgPreview-5pcp444e.js → SvgPreview-yehgzhem.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-psav75bx.js → abnfDiagram-O67JEVCF-6zxpcy8b.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-9q06651f.js +1 -0
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-m98sgh3c.js +36 -0
- package/dist/client/static/js/{astro-0rh34hha.js → astro-nn7xg0we.js} +1 -1
- package/dist/client/static/js/bash-fjzhxy10.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-17xsf182.js → blockDiagram-BEXU5L5S-cp7rervg.js} +5 -5
- package/dist/client/static/js/c-wqtyezvw.js +1 -0
- package/dist/client/static/js/c4Diagram-YGBWAQC7-t31recqm.js +38 -0
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-663z1g1r.js → classDiagram-v2-NBCMYWYE-fy8x3dkx.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-vp4yvx8x.js → cose-bilkent-JH36ORCC-va7ybm9e.js} +1 -1
- package/dist/client/static/js/cpp-y0nzwner.js +1 -0
- package/dist/client/static/js/css-a13jmmnc.js +1 -0
- package/dist/client/static/js/css-n2waj098.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-w7a38g4g.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-dagkrjbh.js → cynefinDiagram-VND7K2PF-4k0k429c.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-8qgwpb5a.js → dagre-6A5THRUB-ykdhxq6t.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-671xtp0d.js → diagram-22UHCM2B-5nvwx7b6.js} +8 -8
- package/dist/client/static/js/{diagram-3UASUU5V-8nn5fha8.js → diagram-3UASUU5V-hc7zsjgw.js} +1 -1
- package/dist/client/static/js/diagram-ATOU4E4O-97ae07y7.js +3 -0
- package/dist/client/static/js/diagram-CDSNMT55-b56nnbbs.js +30 -0
- package/dist/client/static/js/{diagram-MLGK6HIB-tp6dwxdb.js → diagram-MLGK6HIB-37rygr9k.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-qgx8c8ee.js → diagram-MPIPVDR6-wv3vhhfk.js} +2 -2
- package/dist/client/static/js/{dockerfile-hk0s4qaw.js → dockerfile-0efb1z6e.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-nmf9r33z.js → ebnfDiagram-ZINNZB2B-13fv7vxg.js} +1 -1
- package/dist/client/static/js/{elixir-gpez1k9m.js → elixir-mabagxwa.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-dheh5ngz.js → elk-276RUBZZ-xam60ktz.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-8837mk18.js → erDiagram-OPXOYQCR-24ctv2ee.js} +6 -6
- package/dist/client/static/js/{erlang-w9gmf866.js → erlang-zwy7cqdk.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-6wrjccyw.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-19vjkg84.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-g68mvnje.js → ganttDiagram-FUAMR5RP-766a8fqw.js} +2 -2
- package/dist/client/static/js/gitGraph-4MIJSDKK-4je2p50v.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ymk81cdj.js → gitGraphDiagram-X574FWY7-fmwjkgh6.js} +2 -2
- package/dist/client/static/js/graphql-gvb7e2eb.js +1 -0
- package/dist/client/static/js/html-bwyt0ayy.js +1 -0
- package/dist/client/static/js/{index-rc8wrs2a.js → index-03pyvmcz.js} +2 -2
- package/dist/client/static/js/index-13dr1t1r.js +314 -0
- package/dist/client/static/js/{index-mxpgfj6p.js → index-13xbwcbz.js} +2 -2
- package/dist/client/static/js/{index-4j5jwb54.js → index-1c0pnsjd.js} +2 -2
- package/dist/client/static/js/index-1rxa9zxp.js +1 -0
- package/dist/client/static/js/{index-aznkfx1z.js → index-2hpy58d0.js} +2 -2
- package/dist/client/static/js/{index-4j1g7m8g.js → index-2x9eqztp.js} +1 -1
- package/dist/client/static/js/{index-vv9ytx0t.js → index-4cncqz8j.js} +2 -2
- package/dist/client/static/js/index-4j8rgr4p.js +1 -0
- package/dist/client/static/js/{index-pp6mss9b.js → index-4mstdh41.js} +3 -3
- package/dist/client/static/js/index-4z4ax55k.js +12 -0
- package/dist/client/static/js/{index-q1bqg4f6.js → index-6ge6gk9w.js} +1 -1
- package/dist/client/static/js/{index-c003wb3r.js → index-7t63akyt.js} +1 -1
- package/dist/client/static/js/{index-ys4t1am4.js → index-8b3t2y77.js} +2 -2
- package/dist/client/static/js/index-8hgm0abr.js +474 -0
- package/dist/client/static/js/index-8jqawh3r.js +2 -0
- package/dist/client/static/js/index-95en3p3g.js +9 -0
- package/dist/client/static/js/{index-dj7y2df7.js → index-97qst4k9.js} +2 -2
- package/dist/client/static/js/{index-018ehs1n.js → index-9vdbnvmk.js} +1 -1
- package/dist/client/static/js/{index-harsfp4x.js → index-a9t9gdew.js} +9 -9
- package/dist/client/static/js/{index-8888hgj8.js → index-b4y5g48d.js} +5 -5
- package/dist/client/static/js/{index-gx2xefdg.js → index-czagykbq.js} +2 -2
- package/dist/client/static/js/{index-r1fe56cn.js → index-dfqmwm7j.js} +2 -2
- package/dist/client/static/js/{index-cccrappc.js → index-dydwcp3n.js} +2 -2
- package/dist/client/static/js/{index-jy91r3ap.js → index-e1yz59fa.js} +2 -2
- package/dist/client/static/js/{index-ce4vytm6.js → index-e6any867.js} +2 -2
- package/dist/client/static/js/{index-wy05jt00.js → index-ejdnjh5c.js} +2 -2
- package/dist/client/static/js/index-f4vr1c6e.css +1 -0
- package/dist/client/static/js/{index-9wjnbb3q.js → index-feffxxss.js} +2 -2
- package/dist/client/static/js/{index-547h1b8j.js → index-grczkttn.js} +13 -13
- package/dist/client/static/js/{index-s78n0dtv.js → index-hga3e13s.js} +2 -2
- package/dist/client/static/js/{index-d1vearmk.js → index-hw14rhen.js} +2 -2
- package/dist/client/static/js/index-hzwr5fm9.js +4 -0
- package/dist/client/static/js/{index-sj4y8kj2.js → index-j17h4z6f.js} +2 -2
- package/dist/client/static/js/{index-y5hxhr7q.js → index-ka2rc2cr.js} +5 -5
- package/dist/client/static/js/{index-b612vske.js → index-ktbrmp29.js} +2 -2
- package/dist/client/static/js/{index-ag78jnva.js → index-nbexks3x.js} +1 -1
- package/dist/client/static/js/{index-vwc8pdy3.js → index-nh29fkk9.js} +2 -2
- package/dist/client/static/js/{index-gn92c6hp.js → index-p0ez6hqd.js} +2 -2
- package/dist/client/static/js/{index-173x4bh0.js → index-pkes9492.js} +2 -2
- package/dist/client/static/js/{index-fg965t62.js → index-pysqpc5n.js} +2 -2
- package/dist/client/static/js/index-qj34r6d0.js +1 -0
- package/dist/client/static/js/{index-ek4gwrm8.js → index-qx6x4z0y.js} +2 -2
- package/dist/client/static/js/{index-agdbjh5k.js → index-r8cc80w5.js} +2 -2
- package/dist/client/static/js/{index-2kg3r5jw.js → index-rab39785.js} +2 -2
- package/dist/client/static/js/{index-haaz8t7e.js → index-sk9ej289.js} +2 -2
- package/dist/client/static/js/{index-8ggxxp8c.js → index-sq3r1xhf.js} +2 -2
- package/dist/client/static/js/{index-wsqgp9jw.js → index-sx809d6d.js} +2 -2
- package/dist/client/static/js/{index-p2812ygk.js → index-sz3mxjvy.js} +1 -1
- package/dist/client/static/js/{index-69xe17c1.js → index-tqycj126.js} +2 -2
- package/dist/client/static/js/{index-js81yrmy.js → index-vcn1kcpy.js} +3 -3
- package/dist/client/static/js/{index-rvjc19x7.js → index-x7f5ysch.js} +2 -2
- package/dist/client/static/js/index-xe5cqwnf.js +1 -0
- package/dist/client/static/js/index-xxe52zrm.js +2 -0
- package/dist/client/static/js/{index-ek7hqfp0.js → index-yvxa7hd8.js} +2 -2
- package/dist/client/static/js/{index-qw5aqk2d.js → index-z6kpc98a.js} +1 -1
- package/dist/client/static/js/{index-yzg9mbsv.js → index-zjydzxhm.js} +1 -1
- package/dist/client/static/js/{index-6wtx7a9x.js → index-zvazj4va.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-k0z5qdew.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-11trzn8c.js → infoDiagram-VRGFBTTK-tqytmzp1.js} +1 -1
- package/dist/client/static/js/ini-2gvjwh83.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-8xnnymb5.js → ishikawaDiagram-OU5B5YK6-rp77ff6m.js} +1 -1
- package/dist/client/static/js/java-1xwcq79s.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-wd47j0hy.js → journeyDiagram-ZHPQQLJL-c7bxrhf1.js} +2 -2
- package/dist/client/static/js/json-4pqjabgq.js +1 -0
- package/dist/client/static/js/jsx-wcsss15s.js +1 -0
- package/dist/client/static/js/{julia-c2q0vwpd.js → julia-2eekpjq8.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-s5rgcp44.js → kanban-definition-PNTS6WVX-j2pxewqq.js} +8 -8
- package/dist/client/static/js/lua-h7vjcn0h.js +1 -0
- package/dist/client/static/js/markdown-f30jjjh9.js +1 -0
- package/dist/client/static/js/{mermaid.core-9fxp8nt2.js → mermaid.core-cqqe1krg.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-4fyewtst.js → mindmap-definition-NLK3R4M7-s03k32p9.js} +9 -9
- package/dist/client/static/js/one-dark-pro-9tt0a020.js +1 -0
- package/dist/client/static/js/one-light-5fg4r0ra.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-6cnvmb2z.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-s2xe2e2k.js → pegDiagram-GJSIUBJH-dfg2j0zc.js} +1 -1
- package/dist/client/static/js/{perl-6pa0tn3b.js → perl-5vxax0nr.js} +1 -1
- package/dist/client/static/js/{php-1zy994pz.js → php-hgrgdq63.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-m9z1mztn.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-1szpjbzy.js → pieDiagram-5QR66LMP-pshd1j79.js} +1 -1
- package/dist/client/static/js/properties-ymexza6q.js +1 -0
- package/dist/client/static/js/python-31ycwa66.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-mv3ee2qa.js → quadrantDiagram-O4NWA36T-cvvvmtk2.js} +4 -4
- package/dist/client/static/js/r-t2nne4xp.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-8m9rkex6.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-wc55emj8.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2y2rnrzq.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-zzcc9x0v.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-z82na5nb.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-hgdqjpm9.js → railroadDiagram-XR7U4H2S-h53p3sha.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-yrfjp9wx.js → requirementDiagram-PLB6GJNP-bdv2fkxd.js} +4 -4
- package/dist/client/static/js/{ruby-arvs7kz4.js → ruby-8pxcn21w.js} +1 -1
- package/dist/client/static/js/{rust-3ahjk339.js → rust-j80dxgjg.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-k7k871xa.js → sankeyDiagram-IPEJSGJF-xqnnvmhy.js} +2 -2
- package/dist/client/static/js/{sass-cmkf7nwd.js → sass-bm32bb5k.js} +1 -1
- package/dist/client/static/js/{scss-x7ddw6gb.js → scss-e2dndbfa.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-gd80m0as.js → sequenceDiagram-PO4LG4MO-3p67305f.js} +10 -10
- package/dist/client/static/js/{sizeCapture-INFHLROL-jv6p4834.js → sizeCapture-INFHLROL-f87525h7.js} +1 -1
- package/dist/client/static/js/sql-bwnasywx.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-tvphxq2h.js → stateDiagram-v2-GCMORJYK-e5st1fy3.js} +6 -6
- package/dist/client/static/js/{svelte-0hv6pak2.js → svelte-ztkaww47.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-3dt7nxj2.js → swimlanes-2SLR337P-ceghkbez.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-vc8hvfya.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-40vvf856.js → timeline-definition-EJHVYXUP-f7evs443.js} +3 -3
- package/dist/client/static/js/treeView-Q6P3EWNA-kzh6cm3f.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-wz5ed560.js +1 -0
- package/dist/client/static/js/tsx-zfy727zs.js +1 -0
- package/dist/client/static/js/typescript-p3syh43m.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-g1j5x0xh.js → usecaseDiagram-POWQR4AR-0gpn21p7.js} +27 -27
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-5b8789qk.js → vennDiagram-UO4OBE2U-4spzy428.js} +3 -3
- package/dist/client/static/js/{vue-zccj3qa5.js → vue-xm1dxpmy.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-zewbfccz.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-c7x3za3w.js → wardleyDiagram-VNRHLVJA-745xr2pa.js} +4 -4
- package/dist/client/static/js/xml-4enq788a.js +1 -0
- package/dist/client/static/js/xychartDiagram-PMCCYNJV-7dr9qwx5.js +7 -0
- package/dist/client/static/js/yaml-pjtt3jsc.js +1 -0
- package/package.json +1 -1
- package/src/client/components/common/batch-selection/folder-state.ts +2 -2
- package/src/client/components/common/server-control/Panel.tsx +16 -5
- package/src/client/components/common/server-control/index.test.tsx +63 -9
- package/src/client/components/common/session-row/TrailingSlot.tsx +8 -0
- package/src/client/components/common/session-row/index.tsx +16 -9
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +7 -0
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +1 -1
- package/src/client/components/layout/session-sidebar/ClassicView.tsx +13 -0
- package/src/client/components/layout/session-sidebar/HarnessFilter.tsx +175 -0
- package/src/client/components/layout/session-sidebar/SessionList.tsx +9 -1
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +8 -1
- package/src/client/components/layout/session-sidebar/about-modal/index.test.tsx +1 -1
- package/src/client/components/layout/session-sidebar/harness-filter.test.tsx +173 -0
- package/src/client/components/layout/session-sidebar/modern/FilterChips.tsx +63 -18
- package/src/client/components/layout/session-sidebar/modern/SearchField.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +21 -12
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/index.tsx +11 -2
- package/src/client/components/layout/session-sidebar/modern/search-field.test.tsx +96 -0
- package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +3 -0
- package/src/client/components/layout/session-sidebar/variant-props.ts +7 -0
- package/src/client/components/mobile/SessionSidebar.tsx +14 -21
- package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +19 -0
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +1 -1
- package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +19 -19
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.image.test.ts +147 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +51 -83
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +44 -63
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ReadDirectory.tsx +72 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ReadImage.tsx +51 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/read-test-util.ts +91 -0
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.test.ts +80 -62
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.tsx +15 -33
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +1 -1
- package/src/client/components/workspace/terminal-panel/copy.test.ts +179 -0
- package/src/client/components/workspace/terminal-panel/copy.ts +76 -0
- package/src/client/components/workspace/terminal-panel/mount.ts +13 -0
- package/src/client/data/settings/omp-schema.json +39 -18
- package/src/client/hooks/chat/omp/pending-child.test.ts +1 -1
- package/src/client/hooks/chat/omp/session-sidebar-controller.test.ts +61 -0
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +37 -39
- package/src/client/hooks/chat/omp/sidebar-filter.ts +62 -0
- package/src/client/hooks/chat/timeline/session-changes.test.ts +85 -0
- package/src/client/hooks/chat/timeline/session-changes.ts +8 -5
- package/src/client/hooks/commands/use-command-runtime.ts +15 -0
- package/src/client/hooks/shell/servers.ts +60 -2
- package/src/client/hooks/ui/updates/check-request.ts +41 -0
- package/src/client/hooks/ui/updates/index.ts +13 -5
- package/src/client/hooks/ui/updates/mobile-flow.ts +56 -0
- package/src/client/lib/native/run-command.test.ts +95 -0
- package/src/client/lib/native/run-command.ts +52 -0
- package/src/client/lib/router/open-session.test.ts +26 -1
- package/src/client/lib/router/open-session.ts +21 -0
- package/src/client/main.tsx +9 -0
- package/src/client/tailwind.css +58 -0
- package/src/server/lib/changes/capture-shell.test.ts +253 -0
- package/src/server/lib/changes/capture-targets.test.ts +83 -0
- package/src/server/lib/changes/capture-targets.ts +51 -0
- package/src/server/lib/changes/capture-write.server.ts +2 -2
- package/src/server/lib/changes/capture.server.ts +14 -29
- package/src/server/lib/changes/capture.test.ts +69 -149
- package/src/server/lib/changes/patch-paths.ts +37 -0
- package/src/server/lib/harness/acp/commands.test.ts +1 -0
- package/src/server/lib/harness/acp/commands.ts +12 -4
- package/src/server/lib/harness/acp/replay-transcript.ts +32 -13
- package/src/server/lib/harness/acp/session-transcript.server.test.ts +162 -0
- package/src/server/lib/harness/acp/session-transcript.server.ts +350 -0
- package/src/server/lib/harness/acp/session.ts +6 -1
- package/src/server/lib/harness/schema.server.ts +18 -0
- package/src/server/lib/harness/spawn.server.ts +14 -1
- package/src/server/lib/models/provider-icon-fetch.ts +2 -2
- package/src/server/lib/models/provider-icon-parse.test.ts +0 -12
- package/src/server/lib/models/provider-icon-parse.ts +0 -8
- package/src/server/lib/omp/rpc/frame-fold.test.ts +16 -1
- package/src/server/lib/omp/rpc/frame-fold.ts +17 -4
- package/src/server/lib/omp/session/blobs.server.test.ts +34 -0
- package/src/server/lib/omp/session/blobs.server.ts +8 -3
- package/src/server/lib/omp/session/delete.server.ts +4 -0
- package/src/server/lib/omp/session/sidebar-activity.server.test.ts +2 -1
- package/src/server/routes/agent/harness-command.test.ts +71 -0
- package/src/server/routes/agent/harness-command.ts +27 -13
- package/src/server/routes/chat/imported.ts +5 -2
- package/src/server/routes/chat/live-meta.ts +42 -0
- package/src/server/routes/chat/session.test.ts +110 -0
- package/src/server/routes/chat/session.ts +31 -34
- package/src/shared/lib/chat/transcript-rows.ts +22 -0
- package/src/shared/lib/commands/catalog.test.ts +36 -0
- package/src/shared/lib/commands/catalog.ts +16 -0
- package/src/shared/lib/fs/file-kind.test.ts +46 -3
- package/src/shared/lib/fs/file-kind.ts +40 -9
- package/src/shared/lib/omp/config/schema-releases.test.ts +29 -0
- package/src/shared/lib/updates/popup-state.ts +11 -0
- package/src/shared/lib/workspace/harness-filter.test.ts +89 -0
- package/src/shared/lib/workspace/harness-filter.ts +75 -0
- package/src/{client/lib → shared/lib/workspace}/session-tree.test.ts +1 -1
- package/src/shared/lib/workspace/session-visibility.test.ts +71 -0
- package/src/shared/lib/workspace/session-visibility.ts +48 -23
- package/src/shared/lib/workspace/sidebar-filter-row.test.ts +64 -23
- package/src/shared/lib/workspace/sidebar-filter-row.ts +89 -31
- package/dist/client/static/js/ImageView-c139r891.js +0 -1
- package/dist/client/static/js/LayoutWrapper-08axzr3a.js +0 -2
- package/dist/client/static/js/Modal-0weqfqvk.js +0 -38
- package/dist/client/static/js/SessionsView-awef8ehj.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-6rbq97t9.js +0 -1
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-9bk6ykn7.js +0 -36
- package/dist/client/static/js/bash-vv2ysp0a.js +0 -1
- package/dist/client/static/js/c-67jyc7sg.js +0 -1
- package/dist/client/static/js/c4Diagram-YGBWAQC7-jn9j4n04.js +0 -38
- package/dist/client/static/js/cpp-crfbnwv8.js +0 -1
- package/dist/client/static/js/css-983fbv00.js +0 -1
- package/dist/client/static/js/css-zj4qzw6r.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-zafxcz2k.js +0 -1
- package/dist/client/static/js/diagram-ATOU4E4O-dnar0ktg.js +0 -3
- package/dist/client/static/js/diagram-CDSNMT55-bt0fhk7n.js +0 -30
- package/dist/client/static/js/eventmodeling-NTZA5JFV-cq3dvz7e.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-spzh2jxq.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-epgk26pj.js +0 -1
- package/dist/client/static/js/graphql-dewsj5g1.js +0 -1
- package/dist/client/static/js/html-1cpe2xc8.js +0 -1
- package/dist/client/static/js/index-bdz08fe2.js +0 -12
- package/dist/client/static/js/index-bgpcf3mr.js +0 -1
- package/dist/client/static/js/index-bj3wn9je.js +0 -1
- package/dist/client/static/js/index-dhrp656p.js +0 -1
- package/dist/client/static/js/index-g10nr8m6.js +0 -9
- package/dist/client/static/js/index-j4ks5s41.js +0 -474
- package/dist/client/static/js/index-jqs23cc7.css +0 -1
- package/dist/client/static/js/index-qnt118mp.js +0 -2
- package/dist/client/static/js/index-qntpsp98.js +0 -2
- package/dist/client/static/js/index-w130cs7d.js +0 -1
- package/dist/client/static/js/index-wv36ddd5.js +0 -314
- package/dist/client/static/js/index-y82bk3hr.js +0 -4
- package/dist/client/static/js/info-A6RAGUB7-0an46pag.js +0 -1
- package/dist/client/static/js/ini-09e0scxh.js +0 -1
- package/dist/client/static/js/java-vnaesxzs.js +0 -1
- package/dist/client/static/js/json-g5ggnd94.js +0 -1
- package/dist/client/static/js/jsx-xz71aed4.js +0 -1
- package/dist/client/static/js/lua-e4wenyzt.js +0 -1
- package/dist/client/static/js/markdown-yv3p1p7m.js +0 -1
- package/dist/client/static/js/one-dark-pro-ahch85zb.js +0 -1
- package/dist/client/static/js/one-light-9706jgqt.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-5e397pav.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-0zzmzg64.js +0 -1
- package/dist/client/static/js/properties-0ag74bdj.js +0 -1
- package/dist/client/static/js/python-zsn5tdbj.js +0 -1
- package/dist/client/static/js/r-mwtqhnw3.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-mtar9742.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-d6a6j9fq.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-1257kd8x.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-v8b6qmas.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-jxpbx410.js +0 -1
- package/dist/client/static/js/sql-aczp05f2.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-aqnh1hhp.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-q3qr7ew7.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-zgbdydeq.js +0 -1
- package/dist/client/static/js/tsx-s1shkfg9.js +0 -1
- package/dist/client/static/js/typescript-htx9v6bf.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-b230aajh.js +0 -1
- package/dist/client/static/js/xml-23y6pgvx.js +0 -1
- package/dist/client/static/js/xychartDiagram-PMCCYNJV-h0fy45tg.js +0 -7
- package/dist/client/static/js/yaml-vrayja34.js +0 -1
- /package/src/{client/lib → shared/lib/workspace}/session-tree.ts +0 -0
|
@@ -4,26 +4,34 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Which form the filter row
|
|
8
|
-
* moves to the right edge.
|
|
7
|
+
* Which form each control in the filter row takes, by width.
|
|
9
8
|
*
|
|
10
9
|
* The thresholds are the point of this file, so they are pinned by width rather
|
|
11
10
|
* than described: the sidebar's floor is 264px (240px of row content) and its
|
|
12
|
-
* default is 280px (256px)
|
|
13
|
-
*
|
|
11
|
+
* default is 280px (256px). At the default the harness control fits as a glyph
|
|
12
|
+
* beside `Archived`, `Select` as its trailing glyph; at the floor neither narrow
|
|
13
|
+
* form fits and only the harness control wraps. A Select form decided without
|
|
14
|
+
* the harness control would have overflowed the moment the filter was added.
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
import { describe, expect, test } from 'bun:test';
|
|
17
18
|
import {
|
|
18
19
|
FILTER_CHIP_PX,
|
|
20
|
+
FILTER_HARNESS_PX,
|
|
19
21
|
FILTER_ROW_GAP_PX,
|
|
22
|
+
FILTER_SELECT_BUTTON_PX,
|
|
23
|
+
FILTER_SELECT_MINI_PX,
|
|
20
24
|
filterChipGroupWidth,
|
|
21
|
-
|
|
25
|
+
filterRowForms,
|
|
22
26
|
} from '@/shared/lib/workspace/sidebar-filter-row';
|
|
23
27
|
|
|
24
28
|
/** The row's content width at a given sidebar width (its `px-3` removed). */
|
|
25
29
|
const contentAt = (sidebarWidth: number) => sidebarWidth - 24;
|
|
26
30
|
|
|
31
|
+
/** The row's width with the harness form and the Select form it budgets for. */
|
|
32
|
+
const rowWith = (runningCount: number, harness: number, select: number) =>
|
|
33
|
+
filterChipGroupWidth(runningCount, false) + 2 * FILTER_ROW_GAP_PX + harness + select;
|
|
34
|
+
|
|
27
35
|
describe('filterChipGroupWidth', () => {
|
|
28
36
|
test('three chips plus two gaps', () => {
|
|
29
37
|
expect(filterChipGroupWidth(0, false)).toBe(
|
|
@@ -42,32 +50,65 @@ describe('filterChipGroupWidth', () => {
|
|
|
42
50
|
});
|
|
43
51
|
});
|
|
44
52
|
|
|
45
|
-
describe('
|
|
46
|
-
test('the
|
|
47
|
-
expect(
|
|
48
|
-
|
|
53
|
+
describe('filterRowForms', () => {
|
|
54
|
+
test('the 280px default fits the harness glyph and the trailing Select glyph', () => {
|
|
55
|
+
expect(filterRowForms(contentAt(280), 0)).toEqual({
|
|
56
|
+
select: 'button',
|
|
57
|
+
harness: 'icon',
|
|
58
|
+
wrap: false,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('a running count still fits at the default, in the mini form', () => {
|
|
63
|
+
expect(filterRowForms(contentAt(280), 2)).toEqual({
|
|
64
|
+
select: 'mini',
|
|
65
|
+
harness: 'icon',
|
|
66
|
+
wrap: false,
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('the 264px floor fits without a count and wraps with one', () => {
|
|
71
|
+
expect(filterRowForms(contentAt(264), 0).wrap).toBe(false);
|
|
72
|
+
expect(filterRowForms(contentAt(264), 2).wrap).toBe(true);
|
|
49
73
|
});
|
|
50
74
|
|
|
51
|
-
test('
|
|
52
|
-
|
|
75
|
+
test('a wide sidebar takes the harness chip before it takes the Select chip', () => {
|
|
76
|
+
const chipHarnessWithButton = rowWith(0, FILTER_HARNESS_PX.chip, FILTER_SELECT_BUTTON_PX);
|
|
77
|
+
expect(filterRowForms(chipHarnessWithButton, 0)).toEqual({
|
|
78
|
+
select: 'button',
|
|
79
|
+
harness: 'chip',
|
|
80
|
+
wrap: false,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const chipHarnessWithChip = rowWith(0, FILTER_HARNESS_PX.chip, FILTER_CHIP_PX.select);
|
|
84
|
+
expect(filterRowForms(chipHarnessWithChip, 0)).toEqual({
|
|
85
|
+
select: 'chip',
|
|
86
|
+
harness: 'chip',
|
|
87
|
+
wrap: false,
|
|
88
|
+
});
|
|
53
89
|
});
|
|
54
90
|
|
|
55
|
-
test('a
|
|
56
|
-
const
|
|
57
|
-
expect(
|
|
58
|
-
|
|
91
|
+
test('one pixel under a threshold drops to the next form, never a wrap', () => {
|
|
92
|
+
const chipHarness = rowWith(0, FILTER_HARNESS_PX.chip, FILTER_SELECT_BUTTON_PX);
|
|
93
|
+
expect(filterRowForms(chipHarness - 1, 0).harness).toBe('icon');
|
|
94
|
+
|
|
95
|
+
const button = rowWith(0, FILTER_HARNESS_PX.icon, FILTER_SELECT_BUTTON_PX);
|
|
96
|
+
expect(filterRowForms(button - 1, 0).select).toBe('mini');
|
|
97
|
+
|
|
98
|
+
const mini = rowWith(0, FILTER_HARNESS_PX.icon, FILTER_SELECT_MINI_PX);
|
|
99
|
+
expect(filterRowForms(mini - 1, 0).wrap).toBe(true);
|
|
59
100
|
});
|
|
60
101
|
|
|
61
|
-
test('a running count moves the
|
|
62
|
-
const withoutCount =
|
|
63
|
-
const withCount =
|
|
102
|
+
test('a running count moves the thresholds with it', () => {
|
|
103
|
+
const withoutCount = rowWith(0, FILTER_HARNESS_PX.chip, FILTER_SELECT_BUTTON_PX);
|
|
104
|
+
const withCount = rowWith(2, FILTER_HARNESS_PX.chip, FILTER_SELECT_BUTTON_PX);
|
|
64
105
|
expect(withCount).toBeGreaterThan(withoutCount);
|
|
65
|
-
expect(
|
|
66
|
-
expect(
|
|
106
|
+
expect(filterRowForms(withoutCount, 2).harness).toBe('icon');
|
|
107
|
+
expect(filterRowForms(withCount, 2).harness).toBe('chip');
|
|
67
108
|
});
|
|
68
109
|
|
|
69
|
-
test('an unmeasured row keeps the narrow
|
|
70
|
-
expect(
|
|
71
|
-
expect(
|
|
110
|
+
test('an unmeasured row keeps the narrow forms rather than guessing', () => {
|
|
111
|
+
expect(filterRowForms(0, 0)).toEqual({ select: 'mini', harness: 'icon', wrap: false });
|
|
112
|
+
expect(filterRowForms(Number.NaN, 0)).toEqual({ select: 'mini', harness: 'icon', wrap: false });
|
|
72
113
|
});
|
|
73
114
|
});
|
|
@@ -4,32 +4,34 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* How the `modern` sidebar's filter row spends its width
|
|
7
|
+
* How the `modern` sidebar's filter row spends its width.
|
|
8
8
|
*
|
|
9
|
-
* The row is `All · Running · Archived
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* way the classic toolbar picks its visible controls
|
|
13
|
-
* and for the same reason — the sidebar is
|
|
14
|
-
* `@container` breakpoint would keep a narrow
|
|
15
|
-
* panel.
|
|
9
|
+
* The row is `All · Running · Archived · harness · Select`, and it must never
|
|
10
|
+
* wrap: a second line of chips pushes the list down and reads as a layout
|
|
11
|
+
* break. Each control's form is therefore chosen by MEASURED width, richest
|
|
12
|
+
* first, the same way the classic toolbar picks its visible controls
|
|
13
|
+
* (`sidebarToolbarCapacity`), and for the same reason — the sidebar is
|
|
14
|
+
* draggable, so a media query or a `@container` breakpoint would keep a narrow
|
|
15
|
+
* form after the user widened the panel.
|
|
16
16
|
*
|
|
17
|
-
* - `button`
|
|
18
|
-
*
|
|
19
|
-
* - `chip`
|
|
20
|
-
*
|
|
17
|
+
* - **Select** — `button` (a 28px glyph pinned to the row's trailing edge) or
|
|
18
|
+
* `chip` (a fourth chip in the same slot).
|
|
19
|
+
* - **Harness** — `chip` (glyph, name, chevron) or `icon` (the harness's own
|
|
20
|
+
* mark in the row's 22px slot). It sits immediately right of `Archived`,
|
|
21
|
+
* which is where the user looks for it.
|
|
21
22
|
*
|
|
22
|
-
* **The
|
|
23
|
-
* and Archived keep the row's left edge in
|
|
24
|
-
* that sits under the search field and over the rows, so moving
|
|
25
|
-
* when
|
|
23
|
+
* **The forms change the controls, never the chip group's position.** All,
|
|
24
|
+
* Running and Archived keep the row's left edge in every form — they are a
|
|
25
|
+
* reading order that sits under the search field and over the rows, so moving
|
|
26
|
+
* them sideways when a form changed made the filters jump as the panel was
|
|
27
|
+
* dragged.
|
|
26
28
|
*
|
|
27
|
-
* The metrics are the
|
|
28
|
-
* `px-2`/`gap-1`, measured in the browser
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* The metrics are the controls' own rendered widths at `text-[11px]` with
|
|
30
|
+
* `px-2`/`gap-1`, measured in the browser. They are constants rather than a
|
|
31
|
+
* render-time measurement of the children because the FORM has to be decided
|
|
32
|
+
* before the children exist — measuring after paint would draw the wrong form
|
|
33
|
+
* for a frame, which is the flicker `useToolbarRowWidth`'s layout effect exists
|
|
34
|
+
* to avoid.
|
|
33
35
|
*/
|
|
34
36
|
|
|
35
37
|
/** The row's own `px-3`, which `clientWidth` counts and the budget must not. */
|
|
@@ -41,7 +43,8 @@ export const FILTER_ROW_GAP_PX = 4;
|
|
|
41
43
|
/** The two chip forms, measured at `text-[11px] font-medium`. */
|
|
42
44
|
export const FILTER_CHIP_PX = {
|
|
43
45
|
all: 32,
|
|
44
|
-
|
|
46
|
+
/** `Running` with its dot, before the count badge. Measured 68.6. */
|
|
47
|
+
running: 69,
|
|
45
48
|
/** The count badge inside `Running`, when there is something to count. */
|
|
46
49
|
runningCount: 14,
|
|
47
50
|
archived: 79,
|
|
@@ -52,6 +55,17 @@ export const FILTER_CHIP_PX = {
|
|
|
52
55
|
/** The trailing glyph (`h-7 w-7`). */
|
|
53
56
|
export const FILTER_SELECT_BUTTON_PX = 28;
|
|
54
57
|
|
|
58
|
+
/**
|
|
59
|
+
* The Select glyph when the harness control shares the row (`h-[22px] w-[22px]`).
|
|
60
|
+
*
|
|
61
|
+
* Not a third style for its own sake: with a running count and the harness mark
|
|
62
|
+
* inline, the 28px form measured 4px too wide at the 280px default, and the
|
|
63
|
+
* alternative — letting the row wrap — put the only way into batch selection on
|
|
64
|
+
* a line of its own. 22px is the slot the session rows already use for their
|
|
65
|
+
* trailing control.
|
|
66
|
+
*/
|
|
67
|
+
export const FILTER_SELECT_MINI_PX = 22;
|
|
68
|
+
|
|
55
69
|
/**
|
|
56
70
|
* The width the chip group needs for a given running count.
|
|
57
71
|
*
|
|
@@ -70,17 +84,61 @@ export function filterChipGroupWidth(runningCount: number, includeSelect: boolea
|
|
|
70
84
|
}
|
|
71
85
|
|
|
72
86
|
/**
|
|
73
|
-
*
|
|
87
|
+
* The harness trigger's two forms.
|
|
88
|
+
*
|
|
89
|
+
* `chip` is the full control — glyph, the words "All harnesses" (or the active
|
|
90
|
+
* harness's name), and the chevron — measured at 104.7px in the browser at the
|
|
91
|
+
* default width. `icon` is the narrow form: the active harness's own mark (or a
|
|
92
|
+
* generic agent mark) in the row's 22px trailing slot, which is the same slot
|
|
93
|
+
* the session rows use for their `⋯`.
|
|
94
|
+
*/
|
|
95
|
+
export const FILTER_HARNESS_PX = {
|
|
96
|
+
chip: 105,
|
|
97
|
+
icon: 22,
|
|
98
|
+
} as const;
|
|
99
|
+
|
|
100
|
+
export interface FilterRowForms {
|
|
101
|
+
select: 'chip' | 'button' | 'mini';
|
|
102
|
+
harness: 'chip' | 'icon';
|
|
103
|
+
/**
|
|
104
|
+
* True when even the narrow forms do not fit. The harness control then wraps
|
|
105
|
+
* to a second line — the row never clips a control, and the alternative (a
|
|
106
|
+
* 16px target) is not a control.
|
|
107
|
+
*/
|
|
108
|
+
wrap: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Which form each control takes in a row `available` px wide.
|
|
74
113
|
*
|
|
75
|
-
* The
|
|
76
|
-
*
|
|
114
|
+
* The row is `All · Running · Archived · harness · Select`, and it must never
|
|
115
|
+
* wrap: a second line of chips pushes the list down and reads as a layout
|
|
116
|
+
* break. The forms are therefore chosen by MEASURED width, richest first, and
|
|
117
|
+
* the harness control is part of the budget — a Select form decided without it
|
|
118
|
+
* would overflow the moment the filter was added.
|
|
77
119
|
*
|
|
78
120
|
* `available` is the row's CONTENT width (the caller's `px-3` already
|
|
79
121
|
* subtracted). A row that reports `0` — a collapsed panel, or a layout that has
|
|
80
|
-
* not run yet — keeps the
|
|
81
|
-
*
|
|
122
|
+
* not run yet — keeps the narrowest forms: they are the answer that can never
|
|
123
|
+
* be wrong.
|
|
82
124
|
*/
|
|
83
|
-
export function
|
|
84
|
-
if (!(available > 0)) return '
|
|
85
|
-
|
|
125
|
+
export function filterRowForms(available: number, runningCount: number): FilterRowForms {
|
|
126
|
+
if (!(available > 0)) return { select: 'mini', harness: 'icon', wrap: false };
|
|
127
|
+
const base = filterChipGroupWidth(runningCount, false);
|
|
128
|
+
const fits = (harness: number, select: number) =>
|
|
129
|
+
base + 2 * FILTER_ROW_GAP_PX + harness + select <= available;
|
|
130
|
+
|
|
131
|
+
if (fits(FILTER_HARNESS_PX.chip, FILTER_CHIP_PX.select)) {
|
|
132
|
+
return { select: 'chip', harness: 'chip', wrap: false };
|
|
133
|
+
}
|
|
134
|
+
if (fits(FILTER_HARNESS_PX.chip, FILTER_SELECT_BUTTON_PX)) {
|
|
135
|
+
return { select: 'button', harness: 'chip', wrap: false };
|
|
136
|
+
}
|
|
137
|
+
if (fits(FILTER_HARNESS_PX.icon, FILTER_SELECT_BUTTON_PX)) {
|
|
138
|
+
return { select: 'button', harness: 'icon', wrap: false };
|
|
139
|
+
}
|
|
140
|
+
if (fits(FILTER_HARNESS_PX.icon, FILTER_SELECT_MINI_PX)) {
|
|
141
|
+
return { select: 'mini', harness: 'icon', wrap: false };
|
|
142
|
+
}
|
|
143
|
+
return { select: 'mini', harness: 'icon', wrap: true };
|
|
86
144
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e,m,Qr}from"./index-j4ks5s41.js";import{gi,jc}from"./index-bdz08fe2.js";function g({source:t,name:r,revision:s=0}){let{url:i,loading:n,error:o}=jc(t,s);if(o)return e(Qr,{name:r,message:o});if(n||!i)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading image…"})]});return e(gi,{src:i,name:r,className:"flex-1 min-h-0"})}export{g as ImageView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d,n,o,W,i,u,a,Ke,le,fn,Jl,e,Kn,Os,Ze,Se,Xt,Zg,$a,Fp,s,Qe,Be,m,en,_,Xe,tn,f,B,ie,et,re,fe,Et,qe,sn,ge,Ge,de,va,Kr,ln,ka,Y,D,O,Us,b,un,Gs,Pe,Bt,Eo,pe,J,it,Vi,Yi,Hu,ec,Ie,je,Zi,BA,rc,Wt,Kt,_t,oc,Vs,_o,Ys,Js,To,bt,St,ta,He,el,kc,xc,Ia,wc,hm,_a,Qo,No,Ro,vt,Xn,ls,Fo,Lo,Mo,nl,Va,rl,al,Ir,Dm,Qm,Po,_c,Rm,Fm,Lm,Sc,er,_r,Oo,$o,Mm,Tc,Ya,Pm,Om,$m,ih,rd,sh,ct,ad,zm,Um,Gm,ol,pg,rf,Qc,pl,uf,df,fd,pf,Ch}from"./index-j4ks5s41.js";import{Mc,Pc,Oc,$c,zc,Uc,Gc,bd,ds,Uo,ps,gi,qc,ml,Hc,Wc,Kc,Vc,Yc,Jc,Zc,Xc,eu}from"./index-bdz08fe2.js";import{Pu,Ou,Jo,$u,zu}from"./index-pp6mss9b.js";import{kt,Ai,nu,ru,ou}from"./index-qntpsp98.js";import{gs,Ta,Nr,hl,iu,su,Go,lu,As,_d,wg,hs,bs,Rr,ys,vs,jo,ks,xs,ws,Cs,bi,Es,Bs,Is,cu,Sd,uu,du,pu,mu,fu,gu,Au,hu}from"./index-y82bk3hr.js";import{bu}from"./index-4j5jwb54.js";import{Qa,Na}from"./index-wsqgp9jw.js";function eo(t){let{editorOpen:r,diffOpen:c,settingsOpen:p,offMainScreen:h,onCloseEditor:g,onCloseDiff:v,onCloseSettings:S,onReturnToMain:k}=t;o(()=>Ch(()=>{if(r)return g(),!0;if(c)return v(),!0;if(p)return S(),!0;if(h)return k(),!0;return!1}),[r,c,p,h,g,v,S,k])}var lt={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]},oo=s(lt);function ze(){let t=Zi(),[r,c]=n(null),p=a((v,S)=>{c({top:S,bottom:S,left:v,right:v})},[]),h=Pu({enabled:t,onLongPress:p}),g=a(()=>c(null),[]);return{anchor:r,close:g,surfaceProps:{onContextMenu:(v)=>{v.preventDefault();let S=v.currentTarget.getBoundingClientRect();c({top:S.top,bottom:S.bottom,left:S.left,right:S.right})},onTouchStart:h.onTouchStart,onTouchMove:h.onTouchMove,onTouchEnd:h.onTouchEnd,onTouchCancel:h.onTouchCancel,onClickCapture:(v)=>{if(!h.consume())return;v.preventDefault(),v.stopPropagation()}}}}var dt=10,to=600000;function no({activeSessionTitle:t,activeSessionId:r,onOpenSessionSidebar:c,onOpenRightSidebar:p,onNewSession:h,onSelectSession:g}){let{folders:v}=He(),S=fd(),k=_a(r),[l,x]=n(null),{hidden:N,setHidden:P}=zm(),y=ze(),E=u(()=>{let w=Date.now(),C=[];for(let A of v)for(let T of A.sessions??[]){if(T.is_archived===1)continue;let I=Zg(String(T.id)),z=T.updated_at?Date.parse(T.updated_at):0,j=I!==void 0&&w-I<=to?I:z;if(I!==void 0&&w-I>to)continue;C.push({id:T.id,title:T.title,folderName:A.name,modified:j})}return C.sort((A,T)=>T.modified-A.modified).slice(0,dt)},[v]),R=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 ${nl} px-3 z-20 titlebar-drag-region select-none`,...Oo(),...y.surfaceProps,style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingLeft:$o(er("0.75rem",!0)),paddingRight:_r("0.75rem",!0),paddingTop:"env(safe-area-inset-top, 0px)"},children:[e("div",{className:"flex items-center space-x-2 flex-1 min-w-0 titlebar-no-drag",children:[e("button",{type:"button",onClick:c,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(oo,{size:20,strokeWidth:2})}),e("span",{className:"relative font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:[e(Ia,{glow:!0}),e("span",{className:"absolute -top-0.5 -right-1.5 flex",children:e(Sc,{status:S})})]}),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:(w)=>{x((C)=>C?null:Wt(w.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:R,"aria-haspopup":"menu","aria-expanded":l!==null,children:[e("span",{className:"truncate",children:R}),k&&e(m,{size:12,className:"animate-spin text-ink/50 flex-shrink-0",role:"status","aria-label":"Generating a session name…"}),e(B,{size:13,className:"text-ink/50 flex-shrink-0"})]}),l&&e(Kt,{anchor:l,align:"start",className:"w-72 bg-paper border border-ink/15 rounded-xl shadow-lg p-2 text-xs",onClose:()=>x(null),children:[e("button",{type:"button",onClick:()=>{x(null),h()},className:"w-full text-left px-3 py-2 rounded-lg bg-ink text-canvas flex items-center space-x-2 font-medium mb-1.5 active:scale-98",children:[e(Y,{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:E.length===0?e("div",{className:"px-2.5 py-2 text-ink/40 italic",children:"No sessions yet"}):E.map((w)=>e("button",{type:"button",onClick:()=>{x(null),g(w.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(w.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:w.title?w.title.charAt(0).toUpperCase()+w.title.slice(1):"Untitled"}),e("span",{className:"truncate text-[10px] text-ink/40 font-mono",children:w.folderName})]}),String(r)===String(w.id)&&e(f,{size:12,className:"flex-shrink-0"})]},w.id))})]})]})]}),e(Um,{layout:"mobile",sessionId:r==null?null:String(r),showRightPanel:!1,onToggleRightPanel:p,hidden:N}),y.anchor?e(Po,{anchor:y.anchor,title:"Navbar",align:"right",items:ad.filter((w)=>w.id!==ct.install&&w.id!==ct.editor&&w.id!==ct.mobile).map((w)=>({...w,removable:!0})),hidden:N,onToggle:P,onClose:y.close}):null]})}function io({activeSessionId:t,onSelectSession:r,onNewSession:c,onOpenSessionSidebar:p,onOpenRightSidebar:h,appSettings:g={}}){let{folders:v}=He(),[S,k]=n(null),l=u(()=>{if(!t)return"New session";for(let N of v){let P=N.sessions?.find((y)=>String(y.id)===String(t));if(P)return P.title}return null},[t,v]);return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative",children:[e(no,{activeSessionTitle:S||l||"New session",activeSessionId:t,onOpenSessionSidebar:p,onOpenRightSidebar:h,onNewSession:c,onSelectSession:r}),e("main",{className:"flex-1 min-h-0",children:e(rf,{appSettings:g,onSessionTitle:k,variant:"mobile"})})]})}function ro({onClose:t,viewLabel:r="Sessions",menuProps:c}){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",...Oo(),...c,style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingLeft:$o(er("0.75rem",!0)),paddingRight:_r("0.75rem",!0),paddingTop:"env(safe-area-inset-top, 0px)"},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(Ia,{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(Gm,{variant:"chip"}),e("button",{type:"button",onClick:t,className:"w-9 h-9 rounded-xl hover:bg-ink/5 active:bg-ink/10 text-ink flex items-center justify-center transition-colors cursor-pointer",title:"Close sidebar","aria-label":"Close sidebar",children:e(b,{size:19,strokeWidth:2})})]})]})}var Ne="w-9.5 h-9.5 rounded-xl border active:scale-95 flex items-center justify-center transition-all flex-shrink-0 cursor-pointer shadow-xs",Ce="border-ink/15 bg-paper hover:bg-ink/5 text-ink/80 hover:text-ink",so="bg-ink/10 text-ink border-ink/30";function ao({searchQuery:t,sortOption:r,optionsOpen:c,showArchived:p,optionsRef:h,onNewSession:g,onNewWorkspace:v,onScheduler:S,scheduledCount:k,onRefresh:l,refreshing:x,onToggleOptions:N,onSortChange:P,onResetSort:y,onToggleArchived:E,onHideArchived:R,onSearchChange:w,onClearSearch:C,onSelectWorkspaces:A,selecting:T}){let{ref:I,width:z}=As(0),j=wg(z),G={};for(let X of _d.slice(0,j))G[X]=!0;let K=_d.slice(j),M=p?"Hide archived sessions":"Show archived sessions",ee=k>0?`Scheduled tasks (${k} armed)`:"Scheduled tasks",Z=[];if(K.includes("new-workspace"))Z.push({id:"new-workspace",label:"New Workspace",icon:sn,onSelect:v});if(K.includes("refresh"))Z.push({id:"refresh",label:"Refresh sessions",icon:D,onSelect:l});if(K.includes("scheduler"))Z.push({id:"scheduler",label:ee,icon:Ta,onSelect:S});if(K.includes("archive"))Z.push({id:"archive",label:M,icon:Xe,onSelect:E,active:p});if(K.includes("select"))Z.push({id:"select",label:T?"Cancel selection":"Select workspaces",icon:Nr,onSelect:A,active:T});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:I,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 active:scale-[0.98] text-xs font-semibold transition-all shadow-xs",children:[e(Y,{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:`${Ne} ${Ce}`,title:"New Workspace","aria-label":"New Workspace",children:e(sn,{size:16,strokeWidth:1.8})}),G.scheduler&&e("button",{type:"button",onClick:S,className:`relative ${Ne} ${Ce}`,title:ee,"aria-label":k>0?`Scheduled tasks, ${k} armed`:"Scheduled tasks",children:[e(Ta,{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:E,"aria-pressed":p,className:`${Ne} ${p?"bg-warning/15 border-warning/40 text-warning":Ce}`,title:M,"aria-label":M,children:e(Xe,{size:16,strokeWidth:1.8})}),G.select&&e("button",{type:"button",onClick:A,"aria-pressed":T,className:`${Ne} ${T?so:Ce}`,title:T?"Cancel selection":"Select workspaces","aria-label":T?"Cancel selection":"Select workspaces",children:e(Nr,{size:16,strokeWidth:1.8})}),G.refresh&&e("button",{type:"button",onClick:l,className:`${Ne} ${Ce}`,title:"Refresh sessions","aria-label":"Refresh sessions","aria-busy":x,children:e(D,{size:15,strokeWidth:1.8,className:x?"animate-spin":void 0})}),G.sort&&e("div",{className:"relative flex-shrink-0",ref:h,children:[e("button",{type:"button",onClick:N,className:`${Ne} ${c||r!=="A-Z"?so:Ce}`,title:"Sort workspaces","aria-label":"Sort workspaces",children:e(gs,{size:15,strokeWidth:1.8})}),c&&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(Go,{variant:"mobile",sortOption:r,onSortChange:P})})]}),K.length>0&&e(lu,{actions:Z,sortHidden:K.includes("sort"),sortOption:r,onSortChange:P,layout:"mobile"})]}),e("div",{className:"relative flex items-center",children:[e(O,{size:14,className:"absolute left-3 text-ink/40"}),e("input",{type:"text",value:t,onChange:(X)=>w(X.currentTarget.value),placeholder:"Search workspaces & sessions...",className:"w-full bg-paper border border-ink/15 rounded-xl pl-8 pr-8 py-2 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),t&&e("button",{type:"button",onClick:C,className:"absolute right-2.5 text-ink/40 hover:text-ink p-1","aria-label":"Clear search",children:e(b,{size:13})})]}),(p||r!=="A-Z")&&e("div",{className:"flex items-center space-x-1.5 flex-wrap gap-y-1 pt-0.5",children:[r!=="A-Z"&&e("span",{className:"inline-flex items-center space-x-1 bg-ink/5 border border-ink/10 text-ink/80 rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e("span",{children:["Sort: ",r.replace("_"," ")]}),e("button",{type:"button",onClick:y,className:"hover:text-ink ml-0.5",title:"Reset sort",children:e(b,{size:10})})]}),p&&e("span",{className:"inline-flex items-center space-x-1 bg-warning/15 border border-warning/25 text-warning rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e(Xe,{size:10}),e("span",{children:"Archived"}),e("button",{type:"button",onClick:R,className:"hover:text-warning-hover ml-0.5",title:"Hide archived",children:e(b,{size:10})})]})]})]})}var pt="p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink";function lo({folder:t,canWorktree:r,onOpenFolder:c,onNewWorktree:p,onSelectSessions:h,confirmDelete:g,onPin:v,onDelete:S,onRequestDelete:k,onCancelDelete:l}){let[x,N]=n(!1),P=i(null),[y,E]=n(null),R=(w)=>()=>{N(!1),w()};return e("div",{className:"relative flex items-center",onClick:(w)=>w.stopPropagation(),children:[e("button",{ref:P,type:"button",onClick:(w)=>{if(w.stopPropagation(),P.current)E(Wt(P.current));N((C)=>!C)},className:pt,title:"Workspace options","aria-label":`Options for ${t.name}`,"aria-haspopup":"menu","aria-expanded":x,children:e(Be,{size:15})}),e(Kt,{anchor:x?y: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:()=>{N(!1),l()},children:e(ws,{variant:"mobile",isPinned:t.isPinned,onOpenFolder:c?R(c):void 0,onNewWorktree:r&&p?R(p):void 0,onSelectSessions:h?R(h):void 0,confirmDelete:g,onPin:R(v),onDelete:R(S),onRequestDelete:k,onCancelDelete:l})})]})}var co={inset:"",insetPx:0,slotWidth:16,markGap:8,padding:"py-2",glyph:St.touch};function po({session:t,harness:r,isActive:c,status:p,awaitingInput:h=!1,timeAgo:g,timeTitle:v,runStartedAt:S,expandable:k=!1,isExpanded:l=!1,onToggleExpand:x,isChild:N=!1,folderId:P,onSelect:y,onArchive:E,onDelete:R,onRename:w,onRenameWithAi:C,waitingFor:A,onCancelWait:T,selectable:I=!1,selected:z=!1,onToggleSelect:j}){let{isEditing:G,draft:K,setDraft:M,inputRef:ee,startRename:Z,handleKeyDown:X,handleBlur:ue}=Ro(t.title,w),ae=_a(t.id),oe=Fo(),te=oe.anchor!==null,q=Boolean(w||E||R||T),U=Boolean(A),ce=k&&Boolean(x),ne=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:ee,autoFocus:!0,value:K,onChange:(me)=>M(me.currentTarget.value),onKeyDown:X,onBlur:ue,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":te?"true":void 0,onContextMenu:q&&!I?oe.openAtCursor:void 0,className:`w-full rounded-lg flex items-center transition-colors ${I&&z||te?xs:c?"bg-ink/10 font-medium text-ink":"hover:bg-ink/5 text-ink/85"}`,children:[e("button",{type:"button",onClick:I?j:y,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:[I?e(Rr,{checked:z,label:`Select ${t.title}`,onChange:()=>j?.()}):e("span",{className:"w-4 flex-shrink-0 flex items-center justify-center",children:ae?e("span",{role:"status","aria-label":"Generating a name…",children:e(m,{size:13,className:"text-ink/50 animate-spin"})}):h?e(Qe,{size:13,className:"text-ink/70 animate-pulse"}):U?e("span",{role:"status","aria-label":`Waiting for ${A?.title??"another session"}`,children:e(Ge,{size:13,className:"text-ink/60 animate-pulse"})}):p==="stream"?e("span",{role:"status","aria-label":"Running",children:e(m,{size:13,className:"text-ink/50 animate-spin"})}):p?e(f,{size:13,className:"text-ink/50"}):N?e("span",{"data-testid":"child-indicator",className:"text-ink/35","aria-hidden":"true",children:e(ge,{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(bt,{harness:r,size:St.touch})}),e("span",{className:"min-w-0 truncate text-xs",children:ne})]}),U&&e("span",{className:"text-[10px] text-ink/40 truncate",children:["waiting for ",A?.title??"another session"]}),t.worktree?e(ys,{worktree:t.worktree}):null]})]}),e(ks,{timeAgo:g,timeTitle:v,runStartedAt:S,className:"text-[11px] font-mono flex-shrink-0 ml-2",restingClassName:"text-ink/45"})]}),q&&!I&&e("button",{type:"button",onClick:oe.openBelow,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":te,className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 text-ink/35 hover:text-ink rounded-lg cursor-pointer",children:e(Be,{size:16})}),ce&&!I&&e("button",{type:"button",onClick:x,title:l?"Collapse sessions and subagents":"Expand sessions and subagents","aria-expanded":l,"aria-label":l?"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:l?e(B,{size:14}):e(ie,{size:14})})]}),oe.anchor&&e(Lo,{anchor:oe.anchor,sessionId:t.id,...r?{harness:r}:{},...P!==void 0?{folderId:P}:{},isArchived:t.is_archived===1,onRename:w?Z:void 0,onRenameWithAi:C,onArchive:E,onDelete:R,onCancelWait:T,onClose:oe.close})]})}function mo(t,r){let[c,p]=n(!1);return{open:()=>p(!0),dialog:c?e(Mo,{isOpen:!0,onClose:()=>p(!1),root:t.project_path??null,folderId:t.id,folderName:t.name,onCreated:(h)=>{p(!1),r(h.path)}}):null}}function uo({hiddenCount:t,canShowLess:r,onShowMore:c,onShowLess:p}){if(t<=0&&!r)return null;return e("div",{className:"flex items-center gap-1",children:[t>0&&e("button",{type:"button",onClick:c,className:"flex items-center min-w-0 text-left py-2 pr-3 text-xs text-ink/60 hover:text-ink",children:[e("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:e(B,{size:12})}),e("span",{className:"w-2 shrink-0"}),e("span",{className:"truncate",children:["Show more sessions (",t,")"]})]}),r&&e("button",{type:"button",onClick:p,className:"ml-auto shrink-0 flex items-center gap-1 text-xs text-ink/60 hover:text-ink pl-3 py-2",children:[e(et,{size:12}),e("span",{className:"truncate",children:"Show less"})]})]})}function fo(t){return t?"mb-4":"mb-1"}function ho({folder:t,activeSessionId:r,onSelectSession:c,onNewSessionForFolder:p,onNewWorktreeSession:h,isExpanded:g,onToggleExpand:v,showArchived:S=!1,sessionStatus:k={},onToast:l,batch:x,onStartSessionSelection:N,onCancelWait:P}){let{visibleCount:y,showMore:E,showLess:R,canShowLess:w}=hs(),C=mo(t,(L)=>h?.(t.id,L)),{refresh:A,runStartedAtMap:T}=He(),{expandedSessionIds:I,toggleSession:z}=ls(),[j]=le(),G=j.get("subagent"),K=j.get("sessionId"),{confirmDelete:M,requestDelete:ee,cancelDelete:Z,handlePin:X,handleDelete:ue,handleArchive:ae,handleRename:oe,handleRenameWithAi:te,handleOpenFolder:q}=bs(t,A,l),U=Qo(),ce=X,ne=ue,me=q??void 0,ve=(t.sessions||[]).filter((L)=>S?L.is_archived===1:L.is_archived!==1),xe=ta(t.icon),{folderCheckbox:he,sessionCheckboxes:be,folderSummary:F,toggleFolderSelection:V,rendered:H,hiddenCount:Me}=Bs({batch:x,folder:t,sessions:ve,showArchived:S,visibleCount:y,activeSessionId:r,sessionStatus:k}),we=Es(H),Re=g||be,Ae=(L,ke)=>{let Q=String(L.id),Te=String(r)===Q,Le=Te&&K===Q&&Boolean(G),Ee=vt(Q);return e(po,{session:L,harness:L.harness,folderId:L.folder_id,isActive:Te&&!Le,status:k[Q],awaitingInput:Boolean(L.awaitingInput),timeAgo:vs(L.updated_at??L.created_at),timeTitle:jo(L.updated_at??L.created_at),runStartedAt:k[Q]==="stream"?T[Q]:void 0,expandable:ke.expandable,isChild:ke.isChild,isExpanded:ke.isExpanded,onToggleExpand:ke.onToggleExpand,onSelect:()=>c(L.id),onArchive:()=>ae(L),onDelete:Ee?void 0:()=>U.requestDelete(L),onRename:Ee?void 0:(We)=>void oe(L,We),onRenameWithAi:Ee?void 0:()=>void te(L),waitingFor:L.waitingFor?{title:L.waitingFor.title}:void 0,onCancelWait:L.waitingFor?()=>P?.(L.waitingFor.waitId):void 0,selectable:be,selected:Boolean(x?.selected.includes(Q)),onToggleSelect:x?()=>x.toggle(Q):void 0})},ye=(L)=>Cs(L,we.childrenOf,I,z);return e("div",{className:fo(Re),"data-testid":"session-folder",children:[e("div",{onClick:x?void 0:v,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:[he&&F?e(Rr,{size:"md",checked:F.all,indeterminate:F.some,label:`Select ${t.name}`,onChange:V}):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(ln,{size:15,className:"text-ink/80"}):e(xe,{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:ve.length}),t.project_path&&e(ge,{size:13,className:"text-ink/50 ml-1"}),!x&&e(d,{children:[e("button",{type:"button",onClick:(L)=>{L.stopPropagation(),p(t.id)},className:"p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink",title:"New Session","aria-label":`New session in ${t.name}`,children:e(Y,{size:15})}),e(lo,{folder:t,canWorktree:Boolean(h&&t.project_path),onOpenFolder:me,onNewWorktree:h?()=>C.open():void 0,onSelectSessions:N?()=>N(t.id):void 0,confirmDelete:M,onPin:ce,onDelete:ne,onRequestDelete:ee,onCancelDelete:Z}),e("span",{className:"flex items-center justify-center pr-1",children:g?e(B,{size:14}):e(ie,{size:14})})]})]})]}),Re&&e("div",{className:"mt-0.5 space-y-0.5",children:[we.roots.map((L)=>{let ke=String(L.id),Q=ye(L);return e("div",{className:"space-y-0.5",children:[Ae(L,Q),Q.isExpanded&&e(bi,{parentId:ke,hasSubagents:Boolean(L.hasSubagents),childrenOf:we.childrenOf,expandedIds:I,onToggle:z,activeSessionId:r===null?null:String(r),renderSession:Ae,style:co})]},L.id)}),e(uo,{hiddenCount:be?0:Me,canShowLess:!be&&w,onShowMore:E,onShowLess:R})]}),e(No,{session:U.pending,isDeleting:U.isDeleting,error:U.error,onClose:U.cancelDelete,onConfirm:()=>void U.confirmDelete()}),C.dialog]})}function bo({folders:t,activeSessionId:r,expandedFolders:c,showArchived:p,sessionStatus:h,onSelectSession:g,onNewSessionForFolder:v,onNewWorktreeSession:S,onToggleFolder:k,onToast:l,batch:x,onStartSessionSelection:N,onCancelWait:P}){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((y)=>e(ho,{folder:y,activeSessionId:r,onSelectSession:g,onNewSessionForFolder:v,onNewWorktreeSession:S,isExpanded:c[y.id]??!0,onToggleExpand:()=>k(y.id),showArchived:p,sessionStatus:h,onToast:l,batch:x,onStartSessionSelection:N,onCancelWait:P},y.id))})}var mt=[3,2];function go(){return e("div",{className:"flex-1 p-3 space-y-4","aria-hidden":"true",children:mt.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},(c,p)=>e("div",{className:"flex items-center gap-2 rounded py-2",children:[e("span",{className:"w-4 h-4 rounded-full animate-pulse bg-ink/10"}),e("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${58-p%3*12}%`}})]},p))]},r))})}function vo({folders:t,initializing:r,failed:c,activeSessionId:p,expandedFolders:h,sessionStatus:g,searchQuery:v,sortOption:S,optionsOpen:k,showArchived:l,optionsRef:x,scheduledCount:N,refreshing:P,selecting:y,batch:E,onNewSession:R,onNewWorkspace:w,onScheduler:C,onRefresh:A,onToggleOptions:T,onSortChange:I,onResetSort:z,onToggleArchived:j,onHideArchived:G,onSearchChange:K,onClearSearch:M,onSelectWorkspaces:ee,onSelectSession:Z,onNewSessionForFolder:X,onNewWorktreeSession:ue,onToggleFolder:ae,onToast:oe,onStartSessionSelection:te,onCancelWait:q}){return e(d,{children:[e(ao,{searchQuery:v,sortOption:S,optionsOpen:k,showArchived:l,optionsRef:x,onNewSession:R,onNewWorkspace:w,onScheduler:C,scheduledCount:N,onRefresh:A,refreshing:P,onToggleOptions:T,onSortChange:I,onResetSort:z,onToggleArchived:j,onHideArchived:G,onSearchChange:K,onClearSearch:M,onSelectWorkspaces:ee,selecting:y}),c?e(Is,{touch:!0,onRetry:A,refreshing:P}):r?e(go,{}):e(bo,{folders:t,activeSessionId:p,expandedFolders:h,showArchived:l,sessionStatus:g,onSelectSession:Z,onNewSessionForFolder:X,onNewWorktreeSession:ue,onToggleFolder:ae,onToast:oe,batch:E,onStartSessionSelection:te,onCancelWait:q})]})}function xo({onSettings:t,onKeyBindings:r,onAbout:c,updateAvailable:p,onUpdateClick:h,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(Us,{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(va,{size:14}),e("span",{children:"Keys"})]}),e("button",{type:"button",onClick:c,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(de,{size:14}),e("span",{children:"About"})]}),v&&e(Lm,{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(ka,{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",xc.version]}),p&&e("button",{type:"button",onClick:h,className:"px-2 py-0.5 rounded-full border border-ink/20 text-[10px] font-semibold text-ink hover:border-ink/40",children:"update"})]})]})}function So(t,r,c){return t.filter((p)=>p.id!==r&&!(c&&p.side==="left"))}function ko(t){return t}function wo(t,r=0){let{scrollLeft:c,clientWidth:p,scrollWidth:h,start:g,size:v}=t,S=Math.max(0,h-p),k=g-r,l=g+v+r;if(v+r*2>=p)return Math.max(0,Math.min(S,k));let x=c;if(k<c)x=k;else if(l>c+p)x=l-p;return Math.max(0,Math.min(S,x))}var ut=8;function _e({panels:t,activeId:r,onSelect:c,hasGitChanges:p=!1}){let h=i(null),g=i(new Map),v=i({activeId:r,panels:t});v.current={activeId:r,panels:t};let S=i({signature:"",width:0}),k=a(()=>{let l=h.current,x=g.current.get(v.current.activeId);if(!l||!x||l.clientWidth<=0)return;let N=`${v.current.activeId}\x00${v.current.panels.map((w)=>w.id).join("\x00")}`,P=S.current;if(P.signature===N&&P.width===l.clientWidth)return;S.current={signature:N,width:l.clientWidth};let y=l.getBoundingClientRect(),E=x.getBoundingClientRect(),R=wo({scrollLeft:l.scrollLeft,clientWidth:l.clientWidth,scrollWidth:l.scrollWidth,start:E.left-y.left+l.scrollLeft,size:E.width},ut);if(R!==l.scrollLeft)l.scrollLeft=R},[]);return W(k,[r,t,k]),o(()=>{let l=h.current;if(!l||typeof ResizeObserver>"u")return;let x=new ResizeObserver(k);return x.observe(l),()=>x.disconnect()},[k]),e("div",{ref:h,className:"flex items-center space-x-1.5 overflow-x-auto no-scrollbar py-1",children:t.map((l)=>{let x=l.id===r;return e("button",{ref:(N)=>{if(N)g.current.set(l.id,N);else g.current.delete(l.id)},type:"button",onClick:()=>c(l.id),"aria-pressed":x,"aria-label":l.title,className:`relative flex shrink-0 items-center transition-all cursor-pointer ${x?"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:l.title,children:[e(el,{panelId:l.id,builtin:l.builtin,icon:l.builtin?l.icon:void 0,name:l.builtin?l.label:l.name,...l.iconUrl?{iconUrl:l.iconUrl}:{},...l.color?{color:l.color}:{},size:fn}),x&&e("span",{className:`shrink-0 whitespace-nowrap ${l.id==="git"?"tracking-wide":""}`,children:l.label}),l.id==="git"&&p&&e("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full bg-info",title:"Uncommitted changes"})]},l.id)})})}function yo({panels:t,activeId:r,onSelect:c,menuProps:p}){return e("div",{className:"px-3 py-1.5 border-b border-ink/10 bg-canvas flex-shrink-0",...p,children:e(_e,{panels:t,activeId:r,onSelect:c})})}function Co({panelKey:t,panel:r,body:c}){if(!r)return e("div",{className:"flex-1 min-h-0",children:e(_c,{panelKey:t})});return e("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:e(Ke,{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(Eo,{value:c,children:r.render(c)})})})}function Do({activeSessionId:t,newWorkspaceOpen:r,onCloseNewWorkspace:c,schedulerOpen:p,onCloseScheduler:h,aboutOpen:g,onCloseAbout:v,updates:S,pushToast:k,batchDelete:l,batchMode:x,onEndBatch:N,scopeLabel:P}){return e(d,{children:[e(hl,{isOpen:r,onClose:c,onCreate:pu,onClone:mu}),e(su,{isOpen:p,onClose:h,activeSessionId:t===null?null:String(t),onToast:k}),e(hm,{isOpen:g,onClose:v,updates:S,onToast:k}),e(Rm,{updates:S}),e(hu,{mode:x??"session",count:l.pending.length,scopeLabel:P,isDeleting:l.isDeleting,progress:l.progress,outcome:l.outcome,onClose:()=>{let y=l.outcome?.refused.length??0;if(l.cancel(),l.outcome&&y===0)N()},onConfirm:()=>{let y=x??"session";l.confirm(y).then((E)=>{if(E&&E.refused.length===0)N()})}})]})}function Ao(){let t=Bt(),r=Ir("left"),[c,p]=$a("layout.mobileLeftPanel",Pe),h=Dm(c,t.enabled);return{catalog:r,activeView:h,setActiveView:p,showingSessions:h===Pe,activePanel:r.find((g)=>g.id===h),enabled:t.enabled}}function Io(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 Wo({appSettings:t,onSelectSession:r,onClose:c,rootPath:p,refreshKey:h,onRefresh:g,onOpenFile:v}){let S=uu(t,{onSelectSession:r,onAfterSelect:c}),{folders:k,processedFolders:l,refreshNow:x,showArchived:N,activeSessionId:P}=S,y=gu(l,N,x),[E,R]=n({1:!0,2:!0,3:!0}),w=i(null);pe(w,()=>S.setOptionsOpen(!1));let C=(z)=>{R((K)=>({...K,[z]:!K[z]}));let j=k.find((K)=>K.id===z),G=!(E[z]??j?.isExpanded??!0);Sd(z,G)},A=l.map((z)=>`${z.id}:${z.isExpanded}`).join("|");o(()=>{R(Object.fromEntries(l.map((z)=>[z.id,z.isExpanded])))},[A]);let T=Ao(),I=Io({sessionId:P,refreshKey:h,rootPath:p,onRefresh:g,onOpenFile:v,onClose:c,requiresWorkspace:T.activePanel?.requiresWorkspace??!1,hasActiveContext:Boolean(p)});return{controller:S,batch:y,expandedFolders:E,toggleFolder:C,optionsRef:w,dock:T,dockBody:I}}function Ve(t){let{disabledPanels:r}=un(),{setEnabled:c}=Gs(),p=ze(),h=Qm(t),g=a((v,S)=>{c(v,S)},[c]);return{...p,items:h,hidden:r,toggle:g}}function Bo({activeSessionId:t,onSelectSession:r,onNewSession:c,onNewSessionForFolder:p,onNewWorktreeSession:h,onClose:g,onDesktopToggle:v,appSettings:S={},rootPath:k,refreshKey:l=0,onRefresh:x,onOpenFile:N}){let{controller:P,batch:y,expandedFolders:E,toggleFolder:R,optionsRef:w,dock:C,dockBody:A}=Wo({appSettings:S,onSelectSession:r,onClose:g,rootPath:k,refreshKey:l,onRefresh:x,onOpenFile:N}),{initializing:T,failed:I,refreshNow:z,isRefreshing:j,searchQuery:G,setSearchQuery:K,showArchived:M,setShowArchived:ee,optionsOpen:Z,setOptionsOpen:X,sortOption:ue,handleSortChange:ae,processedFolders:oe,sessionStatus:te,handleSelectSession:q}=P,{selection:U,deleteRun:ce,archiveRun:ne,binding:me,scopeFolder:ve,available:xe,selected:he}=y,be=bu(),F=Ve("left"),[V,H]=n(!1),[Me,we]=n(!1),Re=iu(),[Ae,ye]=n(!1),L=Mm(),ke=Fm(),{pushToast:Q}=je(),Te=al(Q);du({onNotice:Q}),Ie(wc,()=>{g(),ye(!0),L.apply("kabmo").then((se)=>{if(!se)return;Q(se.message,ec(se))})});let Le=()=>{c(),g()},Ee=()=>{ne.archive(he).then((se)=>{if(!se)return;let Oe=fu(se);if(Oe)Q(Oe.message,Oe.tone);if(!se.error)U.end()})},We=(se)=>{p(se),g()},Ye=()=>{ee(!M)},Je=h?(se,Oe)=>{h(se,Oe),g()}:void 0,at={className:"flex-1 min-h-0 w-full",folders:oe,initializing:T,failed:I,activeSessionId:t,sessionStatus:te,searchQuery:G,onSearchChange:K,showArchived:M,onToggleArchived:Ye,sortOption:ue,optionsOpen:Z,onToggleOptions:()=>X(!Z),onCloseOptions:()=>X(!1),onSortChange:ae,onRefresh:z,refreshing:j,scheduledCount:Re,onNewSession:Le,onNewWorkspace:()=>H(!0),onScheduler:()=>we(!0),onSelectSession:q,onNewSessionForFolder:We,onNewWorktreeSession:Je,onToast:Q,onCancelWait:Te,batch:me,onSelectWorkspaces:y.toggleWorkspaceSelection,onStartSessionSelection:(se)=>U.begin("session",se)};return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative select-none",children:[e(ro,{onClose:g,viewLabel:C.showingSessions?"Sessions":C.activePanel?.label??"Panel",menuProps:F.surfaceProps}),ko(C.enabled)?e(yo,{panels:C.catalog,activeId:C.activeView,onSelect:C.setActiveView,menuProps:F.surfaceProps}):null,F.anchor?e(Po,{anchor:F.anchor,items:F.items,hidden:F.hidden,onToggle:F.toggle,onClose:F.close}):null,e("div",{className:C.showingSessions?"contents":"hidden",children:[be==="modern"?e(cu,{...at,touch:!0}):e(vo,{folders:oe,initializing:T,failed:I,activeSessionId:t,expandedFolders:E,sessionStatus:te,searchQuery:G,sortOption:ue,optionsOpen:Z,showArchived:M,optionsRef:w,scheduledCount:Re,refreshing:j,selecting:U.mode!==null,batch:me,onNewSession:Le,onNewWorkspace:()=>H(!0),onScheduler:()=>we(!0),onRefresh:z,onToggleOptions:()=>X(!Z),onSortChange:ae,onResetSort:()=>ae("A-Z"),onToggleArchived:Ye,onHideArchived:()=>ee(!1),onSearchChange:K,onClearSearch:()=>K(""),onSelectWorkspaces:y.toggleWorkspaceSelection,onSelectSession:q,onNewSessionForFolder:We,onNewWorktreeSession:Je,onToggleFolder:R,onToast:Q,onStartSessionSelection:(se)=>U.begin("session",se),onCancelWait:Te}),U.mode&&e(Au,{drawer:!0,mode:U.mode,count:he.length,total:xe.length,busy:ce.isDeleting,archiving:ne.isArchiving,scopeLabel:ve?.name,onSelectAll:()=>U.selectAllOf(xe),onUnselectAll:()=>U.unselectAllOf(xe),onDelete:()=>ce.request(he),onArchive:Ee,onCancel:U.end})]}),C.showingSessions?null:e(Co,{panelKey:C.activeView,panel:C.activePanel,body:A}),e(xo,{onSettings:()=>window.dispatchEvent(new CustomEvent("omp:open-settings",{detail:{}})),onKeyBindings:Tc,onAbout:()=>ye(!0),shellDownload:ke,onDesktopToggle:v,updateAvailable:L.hasUpdate,onUpdateClick:()=>{ye(!0),L.check()}}),e(Do,{activeSessionId:t,newWorkspaceOpen:V,onCloseNewWorkspace:()=>H(!1),schedulerOpen:Me,onCloseScheduler:()=>we(!1),aboutOpen:Ae,onCloseAbout:()=>ye(!1),updates:L,pushToast:Q,batchDelete:ce,batchMode:U.mode,onEndBatch:U.end,scopeLabel:ve?.name})]})}var ft="terminal";function $e(t){return t===ft}function De(t){if($e(t))BA()}function zo({enabled:t=!0,rootPath:r,refreshKey:c=0,onRefresh:p,onOpenFile:h,onClose:g}){let[v,S]=$a("layout.mobileRightPanel",Jl),k=Bt(),l=So(Ir("all"),Pe,k.enabled),x=l.find((A)=>A.id===v)??l[0],N=Fp(r,t),{changes:P}=Os(r,N,t),y=P.length>0,E=a((A)=>{if(A!==x?.id)De(A);S(A)},[x?.id,S]);o(()=>{if(!$e(x?.id))rc()},[x?.id]);let R=Ve(k.enabled?"right":"all"),w=k.enabled?R.items:R.items.filter((A)=>A.id!==Pe),C={className:"h-full w-full",enabled:t||!x?.requiresWorkspace,active:!0,refreshKey:c,...r?{rootPath:r}:{},onRefresh:p,onOpenFile:h,onClose:g,showHeader:!1,layout:"phone"};return e("div",{className:"flex flex-col h-full w-full bg-paper text-ink relative select-none",children:[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",...Oo(),...R.surfaceProps,style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:$o(er("0.75rem",!0)),paddingRight:_r("0.75rem",!0)},children:[e("div",{className:"flex items-center min-w-0 titlebar-no-drag",children:e(_e,{panels:l,activeId:x?.id??v,onSelect:E,hasGitChanges:y})}),e("button",{type:"button",onClick:g,className:"p-1.5 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 ml-2 titlebar-no-drag",title:"Close right sidebar","aria-label":"Close right sidebar",children:e(b,{size:20,strokeWidth:1.8})})]}),R.anchor?e(Po,{anchor:R.anchor,align:"right",items:w,hidden:R.hidden,onToggle:R.toggle,onClose:R.close}):null,e("div",{className:"flex-1 min-h-0 overflow-hidden relative",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:x?e(Ke,{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(Eo,{value:C,children:x.render(C)})}):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"})})})]})}function Vo({fileName:t,hasPreview:r,isPreview:c,hasReview:p,isReviewing:h,onToggleReview:g,wordWrap:v,copied:S,byteViewer:k=!1,missing:l=!1,onSave:x,onClose:N,onTogglePreview:P,onToggleFind:y,findOpen:E,onToggleWrap:R,onZoomOut:w,onZoomIn:C,onCopy:A,onDownload:T}){return e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0",style:{height:"calc(3rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:er("0.75rem",!0),paddingRight:_r("0.75rem",!0)},children:[e("div",{className:"flex items-center space-x-2 min-w-0 pr-2",children:[e("button",{type:"button",onClick:N,className:"p-1.5 rounded-lg hover:bg-ink/10 text-ink transition-colors active:scale-90 flex-shrink-0 cursor-pointer",title:"Close editor","aria-label":"Close editor",children:e(tn,{size:18,strokeWidth:2})}),e("div",{className:"flex items-center space-x-1.5 truncate",children:[e(it,{name:t,size:15,className:`flex-shrink-0${l?" text-error":""}`}),e("span",{className:`font-semibold text-xs truncate${l?" text-error line-through":" text-ink"}`,children:t})]})]}),e("div",{className:"flex items-center space-x-1 text-ink/70 flex-shrink-0",children:[l&&x&&e("button",{type:"button",onClick:x,className:"p-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer",title:"Save and recreate the file","aria-label":"Save and recreate the file",children:e(kt,{size:15})}),!k&&e("button",{type:"button",onClick:y,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${E?"bg-ink text-canvas":""}`,title:E?"Close find":"Find in file","aria-label":E?"Close find":"Find in file","aria-pressed":E,children:e(O,{size:15})}),p&&e("button",{type:"button",onClick:g,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${h?"bg-ink text-canvas":""}`,title:h?"Exit review mode":"Review this document","aria-label":h?"Exit review mode":"Review this document","aria-pressed":h,children:e(ln,{size:15})}),r&&e("button",{type:"button",onClick:P,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${c?"bg-ink text-canvas":""}`,title:c?"View source":"Show preview","aria-label":c?"View source":"Show preview",children:c?e(Et,{size:15}):e(qe,{size:15})}),!k&&e(d,{children:[e("button",{type:"button",onClick:R,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${v?"text-ink":""}`,title:"Toggle word wrap",children:e(en,{size:15})}),e("button",{type:"button",onClick:w,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Decrease font size",children:e(Na,{size:15})}),e("button",{type:"button",onClick:C,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Increase font size",children:e(Qa,{size:15})})]}),e("button",{type:"button",onClick:A,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Copy content",children:S?e(f,{size:15,className:"text-success"}):e(re,{size:15})}),e("button",{type:"button",onClick:T,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Download file",children:e(fe,{size:15})})]})]})}function Ho({fileName:t,content:r,path:c,root:p,repo:h,fontSize:g,scrollRef:v,onScroll:S,isLoading:k,unsupported:l,loadError:x,reviewActive:N,onExitReview:P}){return e("div",{ref:v,onScroll:S,"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(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading file content..."})]}):l?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(Mc,{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:l})]}):x?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(_,{size:20,className:"text-error"}),e("span",{className:"text-xs text-error font-sans",children:["Could not read ",t]}),e("span",{className:"text-[11px] text-ink/50 font-mono break-all",children:x})]}):e("div",{className:"p-4 bg-paper text-ink min-h-full font-sans",style:{fontSize:`${g}px`},children:e(Oc,{content:r,file:{name:t,path:c,root:p,repo:h},active:N,onExit:P})})})}function Ko({file:t,editor:r,viewerKind:c,byteViewer:p,isPreview:h,isMd:g,content:v,language:S,wordWrap:k,fileKey:l,revealMarks:x,currentMark:N,surfaceRef:P,setCodeScroller:y,previewRef:E,scroll:R,fontSize:w,reviewActive:C,onExitReview:A,editorTheme:T,editorFontFamily:I,indentUnitText:z,typing:j}){let G=a(async(K)=>{let M=await Wc(t,K,{interactive:!0,baseMtimeMs:r.baseMtimeMs});if(M.status==="written")return{ok:!0};if(M.status==="conflict")return{ok:!1,error:"This file changed on disk since it was opened."};if(M.status==="needs-permission")return{ok:!1,error:"Tap Save again to grant write access."};return{ok:!1,error:M.error}},[t,r.baseMtimeMs]);if(r.isImage&&r.imageUrl)return e(gi,{src:r.imageUrl,name:t.name,className:"flex-1 min-h-0"});if(r.isImage||qc(c)&&(p||h))return e(ml,{kind:c,path:t.path??t.name,name:t.name,source:r.byteSource,content:r.content,revision:r.revision,onContentChange:r.onChange,onSaveBytes:r.deviceBacked?void 0:G,onDirtyChange:r.setBinaryDirty});if(r.isLoading||r.unsupported||r.loadError||g&&h)return e(Ho,{fileName:t.name,content:v,path:t.path??t.name,root:t.root,repo:t.repo,fontSize:w,scrollRef:E,onScroll:R.onScroll,isLoading:r.isLoading,unsupported:r.unsupported,loadError:r.loadError,reviewActive:C,onExitReview:A});return e(zc,{ref:P,value:v,onValueChange:r.onChange,language:S,wordWrap:k,documentKey:l,marks:x,currentMark:N,onScroller:y,scrollTestId:"editor-scroller",className:"flex-1 min-h-0 text-ink select-text",themeVars:T.vars,themes:T.themes,indentUnitText:z,typing:j,padding:12,placeholder:"This file is empty",style:{fontFamily:I,fontSize:`${w}px`,lineHeight:Vs}})}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 shrink-0",children:[e(_,{size:14,className:"shrink-0 mt-0.5"}),e("div",{className:"min-w-0",children:[e("div",{className:"text-[11.5px] font-sans",children:"This file was deleted from disk."}),e("div",{className:"text-[11px] font-sans text-error/80",children:"The buffer is still here. Saving recreates the file — autosave is off until then."})]})]})}function Zo({isImage:t,byteViewer:r,viewerKind:c,lineCount:p,charCount:h,language:g,saveStatus:v,path:S,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:Uo[c]}):e(d,{children:[k>0&&e("span",{className:"text-error font-semibold tabular-nums",children:["⚠ ",k]}),e("span",{children:[p," lines"]}),e("span",{children:[h," chars"]}),e("span",{className:"uppercase",children:g})]})}),e("div",{className:"flex items-center space-x-2",children:[v==="saving"&&e(d,{children:[e(m,{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",children:"Save failed"})]}),v==="idle"&&S&&e("span",{className:"truncate max-w-[140px]",children:S})]})]})}function Xo({path:t,content:r,ready:c,surfaceRef:p}){let h=Yc(t,r,c),g=i(null);return o(()=>{if(!h||g.current===h.request)return;g.current=h.request;let v=h.matches[h.currentIndex];if(!v)return;p.current?.select(v.start,v.end,!1),p.current?.revealOffset(v.start)},[h,p]),{matches:h?.matches??[],currentIndex:h?.currentIndex??-1}}function Yo({path:t,content:r,documentKey:c,ready:p,surfaceRef:h,toggleWordWrap:g}){let v=Xo({path:t,content:r,ready:p,surfaceRef:h}),S=Vc({text:r,documentKey:c,readSelection:()=>h.current?.getSelection()??null,select:(k,l,x=!0)=>h.current?.select(k,l,x),reveal:(k)=>h.current?.revealOffset(k),applyDocument:(k,l,x)=>h.current?.applyDocument(k,l,x),toggleWordWrap:g});if(S.open&&S.matches.length>0)return{find:S,revealMarks:S.matches,currentMark:S.currentIndex};return{find:S,revealMarks:v.matches.length>0?v.matches:void 0,currentMark:v.currentIndex}}function ot({path:t,symbols:r,total:c,truncated:p,emptyNotice:h,preview:g=!1}){let[v,S]=n(!1);if(!t)return null;let k=(l,x)=>{if(S(!1),g){let N=Hu(r,x);if(N)Yi({path:t,...N});return}Vi({path:t,line:l.line,column:l.column,length:l.name.length})};return e(d,{children:[e("div",{className:"absolute bottom-14 right-3 z-20",children:e("button",{type:"button",onClick:()=>S(!0),"aria-label":`Outline (${c} 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 active:scale-95",children:e(Kr,{size:16})})}),v&&e(J,{onClose:()=>S(!1),maxWidthClass:"max-w-sm",zClass:"z-[70]",header:e("div",{className:"flex min-w-0 items-center gap-2",children:[e(Kr,{size:15,className:"flex-shrink-0 text-ink/50"}),e("span",{className:"text-sm font-medium",children:"Outline"}),e("span",{className:"font-mono text-[11px] text-ink/40",children:p?`${r.length}/${c}`:c})]}),children:e("div",{className:"max-h-[60vh] overflow-y-auto scrollbar-overlay-container py-1",children:[r.length===0?e("div",{className:"px-4 py-3 text-[11px] italic text-ink/40",children:h}):r.map((l,x)=>e("button",{type:"button",onClick:()=>k(l,x),"aria-label":g?`${Jo(l.kind)} ${l.name}`:`${Jo(l.kind)} ${l.name}, line ${l.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+l.depth*12}px`},children:[e(Ou,{kind:l.kind,size:13}),e("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-ink",children:l.name}),!g&&e("span",{className:"flex-shrink-0 font-mono text-[10px] text-ink/40",children:l.line})]},`${l.line}:${l.kind}:${l.name}`)),p&&e("div",{className:"px-4 py-2 text-[11px] italic text-ink/40",children:$u(c)})]})})]})}function tt({file:t,missing:r=!1,onClose:c,onFileSaved:p,onDropResult:h}){let g=ps(t.path??t.name),[v,S]=n({}),[k,l]=n(_o),[x,N]=n(!0),P=To(),y=Ai(),E=ru(),R=ou(),w=g==="markdown",C=bd[g]===!0,A=ds[g]===!0,T=t.path??t.name,I=v[T]??A,z=eu(String(T)),j=w&&I,G=()=>S((H)=>({...H,[T]:!I})),K=Qc({enabled:Boolean(t.root),onResult:h}),M=Kc(t,{flushOnUnmount:!0,reportSaveError:!0,downloadMimeType:"text/plain;charset=utf-8",onFileSaved:p,missing:r}),[ee,Z]=n(null),X=ol({tabKey:T,surface:w&&I?"rendered":"code",ready:M.loaded,slot:ih,element:w&&I?void 0:ee}),[ue,ae]=n(null),oe=a((H)=>{X.ref(H),ae(H)},[X.ref]);Gc({path:t.path??null,scroller:ue,preview:w&&I});let te=i(null),{find:q,revealMarks:U,currentMark:ce}=Yo({path:t.path??null,content:M.content,documentKey:`${T}\x00${M.language}`,ready:M.loaded&&!M.loadError,surfaceRef:te,toggleWordWrap:()=>N((H)=>!H)}),{content:ne,language:me}=M,ve=ne.split(`
|
|
2
|
-
`).length,xe=$c(ne);Jc({file:{id:T,name:t.name,path:t.path??T},editor:M,surfaceRef:te,isPreview:I,exitPreview:()=>S((H)=>({...H,[T]:!1})),publish:!1});let{symbols:he,total:be,truncated:F,notice:V}=zu({content:ne,language:me,path:t.path??null,state:C?"not-a-document":M.loadError?"error":M.loaded?"ready":"loading",note:C?`${Uo[g]} files have no text outline.`:M.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",...K.dropProps,...K.captureDropProps,children:[e(pl,{visible:K.isDragging}),e(Vo,{fileName:t.name,hasPreview:A,isPreview:I,wordWrap:x,copied:M.copied,byteViewer:C,missing:r,onSave:M.saveNow,onClose:c,onTogglePreview:G,hasReview:j,isReviewing:j&&z.active,onToggleReview:z.toggle,onToggleFind:()=>q.open?q.close():q.openFind(),findOpen:q.open,onToggleWrap:()=>N(!x),onZoomOut:()=>l((H)=>Math.max(Ys,H-1)),onZoomIn:()=>l((H)=>Math.min(Js,H+1)),onCopy:M.copy,onDownload:M.download}),r&&e(qo,{}),M.diskChange&&e(Zc,{fileName:t.name,onReload:M.reloadFromDisk,onKeepMine:M.keepMineAgainstDisk}),q.open&&!C&&e("div",{className:"relative shrink-0 h-9 border-b border-ink/10 bg-paper",children:e(Uc,{find:q})}),e(Ko,{file:t,editor:M,viewerKind:g,byteViewer:C,isPreview:I,isMd:w,content:ne,language:me,wordWrap:x,fileKey:T,revealMarks:U,currentMark:ce,surfaceRef:te,setCodeScroller:Z,previewRef:oe,scroll:X,fontSize:k,reviewActive:j&&z.active,onExitReview:z.toggle,editorTheme:y,editorFontFamily:P,indentUnitText:nu(E),typing:R}),!C&&e(ot,{path:t.path??null,symbols:he,total:be,truncated:F,emptyNotice:V,preview:w&&I}),e(Zo,{isImage:M.isImage,byteViewer:C,viewerKind:g,lineCount:ve,charCount:ne.length,language:me,saveStatus:M.saveStatus,path:t.path,conflicts:xe}),M.saveMissingConfirm&&t.path&&e(Xc,{fileName:t.name,filePath:t.path,onClose:M.cancelSaveMissing,onConfirm:M.confirmSaveMissing})]})}function nt({diff:t,onClose:r,onFileSaved:c}){let p=t.path.split("/").pop()||t.path,h=Boolean(t.staged),g=t.status||"M",v=Kn(g,h);return e("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col",children:[e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0",style:{height:"calc(3rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:er("0.75rem",!0),paddingRight:_r("0.75rem",!0)},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(tn,{size:18,strokeWidth:1.9})}),e(it,{name:p,size:14,className:"flex-shrink-0"}),e("span",{className:"font-mono text-xs text-ink font-medium truncate",title:t.path,children:p})]}),e("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border flex-shrink-0 ${v.badgeBgClass}`,children:[v.charStatus," ",v.label]})]}),e("div",{className:"flex-1 min-h-0",children:e(Pc,{className:"h-full",viewModeButtons:!1,filePath:t.path,status:g,isStaged:h,root:t.root,repo:t.repo||".",journalDiff:t.journal,readOnly:Boolean(t.journal),onFileSaved:c,tabKey:t.journal?$m(t.journal.path,t.journal.from,t.journal.to):Om(t.path,h)})})]})}function Fe(t,r){let c=t[r];return typeof c==="string"&&c.length>0?c:void 0}function ht(t){let r=t.content;return typeof r==="string"?r:void 0}function Ue(t,r){let c=typeof t==="object"&&t!==null?t:{},p=(Fe(c,"path")??"").replace(/^\/+/,"");if(!p)return null;return{name:Fe(c,"name")??p.split("/").pop()??"file",path:p,content:ht(c),root:Fe(c,"root")??r??void 0,repo:Fe(c,"repo"),handleId:Fe(c,"handleId"),deviceFile:c.deviceFile===!0?!0:void 0}}function rt(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 st(t,r,c){Va(c);let p=Xn(r);return Xt(p,pg,{folderId:r,worktreePath:c}),t.setSearchParams((h)=>{let g=_t(h);return g.set("sessionId",p),g.set("folderId",r.toString()),g},{replace:!0}),t.afterNavigate?.(),p}function Ic({onDesktopToggle:t,appSettings:r={}}){let{folders:c,isMock:p}=He(),h=Bt(),{sessionId:g}=Ze(),[v,S]=le(),k=v.get("sessionId"),l=k?Number.isNaN(Number(k))?k:Number(k):null,x=v.get("folderId"),N=x?Number.isNaN(Number(x))?x:Number(x):null,[P,y]=n("main"),[E,R]=n(null),[w,C]=n(null),[A,T]=n(0),[I,z]=n(!1),[j,G]=n("appearance"),[K,M]=n(!1),ee=a(()=>T((F)=>F+1),[]),Z=Hc(rt(E),A),{pushToast:X}=je(),ue=a((F)=>X(F.message,F.ok?"success":"error"),[X]),ae=Z.size>0;eo({editorOpen:E!==null,diffOpen:w!==null,settingsOpen:I,offMainScreen:P!=="main",onCloseEditor:()=>R(null),onCloseDiff:()=>C(null),onCloseSettings:()=>{z(!1),M(!1)},onReturnToMain:()=>y("main")});let{folder:oe}=Ya(c,l),te=oe??(N?c.find((F)=>String(F.id)===String(N))??null:null),q=Pm(c,l)??te?.project_path??null,U=!!te,ce=Qc({enabled:U,onResult:ue});Ie("omp:open-file",(F)=>{let H=Ue(F.detail,q);if(H)R(H)}),Ie("omp:open-diff",(F)=>{let V=F.detail;if(!V?.file)return;C({path:V.file.replace(/^\/+/,""),status:V.status,staged:V.staged,repo:V.repo,root:V.root??q??void 0,...V.source==="journal"&&V.journal?{journal:V.journal}:{}})}),Ie("omp:view-subagent",()=>y("main")),Ie(rd,(F)=>{let V=F.detail?.panelKey;if(!V)return;let H=sh(V,h);if(!H)return;let Me=Se(g,"layout.mobileRightPanel");if(H==="right"&&(P!=="right"||Me!==V))De(V);Xt(g,H==="left"?"layout.mobileLeftPanel":"layout.mobileRightPanel",V),y(H==="left"?"session":"right")}),Ie("omp:open-settings",(F)=>{let V=F.detail;G(V?.category??"appearance"),M(Boolean(V?.autoOpenAdd)),z(!0)});let ne=(F)=>{S((V)=>{let H=_t(V);if(H.set("sessionId",F.toString()),H.has("subagent"))H.delete("subagent");return H},{replace:!0}),y("main")},me=()=>{S(new URLSearchParams,{replace:!0}),y("main")},ve=(F)=>{let V=rl(c,k,F);if(V)Va(V);S((H)=>oc(H,Xn(F),F),{replace:!0}),y("main")},xe=(F,V)=>st({setSearchParams:S,afterNavigate:()=>y("main")},F,V),he=a((F)=>{let V=Ue(F,q);if(V)R(V)},[q]),be=a(()=>{let F=Se(g,"layout.mobileRightPanel")??Jl;De(F),y("right")},[g]);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(uf,{}),e(df,{isMock:p}),e(pf,{workspacePath:q}),e("div",{className:`flex-1 min-h-0 w-full relative ${P==="main"?"block":"hidden"}`,...ce.dropProps,...ce.captureDropProps,children:[e(pl,{visible:ce.isDragging}),e(io,{activeSessionId:l,onSelectSession:ne,onNewSession:me,onOpenSessionSidebar:()=>y("session"),onOpenRightSidebar:be,appSettings:r})]}),e("div",{className:`flex-1 min-h-0 w-full ${P==="session"?"block":"hidden"}`,children:e(Bo,{activeSessionId:l,onSelectSession:ne,onNewSession:me,onNewSessionForFolder:ve,onNewWorktreeSession:xe,onClose:()=>y("main"),onDesktopToggle:t,appSettings:r,rootPath:q??void 0,refreshKey:A,onRefresh:ee,onOpenFile:he})}),P==="right"&&e("div",{className:"flex-1 min-h-0 w-full",children:e(zo,{enabled:U,rootPath:q??void 0,refreshKey:A,onRefresh:ee,onOpenFile:he,onClose:()=>y("main")})}),E&&e(tt,{file:E,missing:ae,onClose:()=>R(null),onFileSaved:ee}),w&&e(nt,{diff:w,onClose:()=>C(null),onFileSaved:ee}),e(kc,{isOpen:I,onClose:()=>{z(!1),M(!1)},initialCategory:j,autoOpenAddProvider:K,appSettings:r})]})}export{Ic as MobileLayoutWrapper};
|