@kabmo-labs/kabmo 0.48.0 → 0.49.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 +521 -507
- package/dist/client/static/js/{Body-3tspyjtk.js → Body-9h5hd351.js} +3 -3
- package/dist/client/static/js/{CsvGrid-3pwsfmxp.js → CsvGrid-s05k1q18.js} +2 -2
- package/dist/client/static/js/{DocxView-xcg9jktb.js → DocxView-x6sjw5ht.js} +22 -22
- package/dist/client/static/js/{DrawioView-2q19tgkx.js → DrawioView-jashn8sf.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-92cadvbr.js → HtmlPreview-eygzgtyc.js} +1 -1
- package/dist/client/static/js/ImageView-g50pk5pt.js +1 -0
- package/dist/client/static/js/LayoutWrapper-tag0qpts.js +2 -0
- package/dist/client/static/js/MergeDiffView-c4mb8m1w.js +1 -0
- package/dist/client/static/js/Modal-pf9p6m1k.js +59 -0
- package/dist/client/static/js/PdfView-syhjmyqf.js +1 -0
- package/dist/client/static/js/SessionsView-2r1grxxs.js +1 -0
- package/dist/client/static/js/{SheetView-w5w2m2de.js → SheetView-26r0e506.js} +45 -45
- package/dist/client/static/js/{SvgPreview-mtk6de6h.js → SvgPreview-2fk85jzz.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-tha4j2fn.js → abnfDiagram-O67JEVCF-fdka7pxr.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-ee9wjsht.js +1 -0
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-278nx8rt.js +36 -0
- package/dist/client/static/js/{astro-r4dp34pw.js → astro-rn2bvwpm.js} +1 -1
- package/dist/client/static/js/bash-36shcpcw.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-6mzgfqh8.js → blockDiagram-BEXU5L5S-vpcmd3vx.js} +9 -9
- package/dist/client/static/js/c-kxeqssf9.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-sfkcw7g9.js → c4Diagram-YGBWAQC7-1rgpdnbq.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-v530ny5e.js → classDiagram-v2-NBCMYWYE-fbsejvb9.js} +9 -9
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-ybv1ttbx.js → cose-bilkent-JH36ORCC-ydq7mvy0.js} +1 -1
- package/dist/client/static/js/cpp-wtk1s3d7.js +1 -0
- package/dist/client/static/js/css-0a0r6rp3.js +1 -0
- package/dist/client/static/js/css-xhnrhg4e.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-gs16zjqa.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-k8f3z0mm.js → cynefinDiagram-VND7K2PF-7ta5vbrw.js} +2 -2
- package/dist/client/static/js/dagre-6A5THRUB-b8gtt32x.js +4 -0
- package/dist/client/static/js/{diagram-22UHCM2B-2zh2957c.js → diagram-22UHCM2B-7emepy7h.js} +30 -30
- package/dist/client/static/js/{diagram-3UASUU5V-bzstt5e2.js → diagram-3UASUU5V-06nptkzc.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-16adx4g0.js → diagram-ATOU4E4O-t113exk3.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-1ja98ens.js → diagram-CDSNMT55-pyj3x97y.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-f9nnyjbq.js → diagram-MLGK6HIB-183sgpjh.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-3qgadfjz.js → diagram-MPIPVDR6-fmbj4hcx.js} +2 -2
- package/dist/client/static/js/{dockerfile-04tc68pq.js → dockerfile-qay672za.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-022cz603.js → ebnfDiagram-ZINNZB2B-eafvfws2.js} +1 -1
- package/dist/client/static/js/{elixir-61gbjv6c.js → elixir-t8bep87c.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-2anf1c36.js → elk-276RUBZZ-573f1vfs.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-ndd27fz1.js → erDiagram-OPXOYQCR-4z1r88ej.js} +14 -14
- package/dist/client/static/js/{erlang-bh5cbm8m.js → erlang-261km7r1.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-ftz7zrz5.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-ax0qfmp3.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-9gm6hkgn.js → ganttDiagram-FUAMR5RP-49jd7msz.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-3rtkds4s.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-78bxa67c.js → gitGraphDiagram-X574FWY7-5p9mgq7n.js} +22 -22
- package/dist/client/static/js/graphql-w9ajhndp.js +1 -0
- package/dist/client/static/js/html-krfbq5wp.js +1 -0
- package/dist/client/static/js/index-05n22cg9.js +4 -0
- package/dist/client/static/js/{index-he4k2j91.js → index-0857zpr0.js} +2 -2
- package/dist/client/static/js/{index-2n1fgpjv.js → index-0w4jqzqk.js} +2 -2
- package/dist/client/static/js/{index-4n7t26ap.js → index-14dgbjsm.js} +1 -1
- package/dist/client/static/js/{index-mqzgf7rw.js → index-1p880x6e.js} +2 -2
- package/dist/client/static/js/{index-34aq5bz5.js → index-1yq96wpa.js} +2 -2
- package/dist/client/static/js/{index-hq28918s.js → index-2bf0txsp.js} +2 -2
- package/dist/client/static/js/index-2jgx68m0.js +1 -0
- package/dist/client/static/js/{index-g3rg6vsd.js → index-2yzt8h3d.js} +2 -2
- package/dist/client/static/js/{index-m39gbcxn.js → index-333rq9yy.js} +1 -1
- package/dist/client/static/js/{index-aa3hmn6j.js → index-38g2eevc.js} +76 -76
- package/dist/client/static/js/{index-aabp7nt6.js → index-3v8k8ms3.js} +1 -1
- package/dist/client/static/js/{index-0e51wknc.js → index-473hk8nb.js} +10 -10
- package/dist/client/static/js/{index-xny7vsfz.js → index-4ccs971z.js} +2 -2
- package/dist/client/static/js/{index-ya9yqj5w.js → index-4dnc1kys.js} +2 -2
- package/dist/client/static/js/{index-7whstwc7.js → index-4z5ram7g.js} +2 -2
- package/dist/client/static/js/{index-pzsp1src.js → index-5dn4159w.js} +2 -2
- package/dist/client/static/js/{index-k39be93q.js → index-5p8dwr4y.js} +1 -1
- package/dist/client/static/js/{index-2bsnywea.js → index-5ztdqm1w.js} +2 -2
- package/dist/client/static/js/{index-m0fatq7c.js → index-7dqq7cjp.js} +13 -13
- package/dist/client/static/js/{index-417fbrqk.js → index-7ff9scbm.js} +2 -2
- package/dist/client/static/js/{index-zcgqacvx.js → index-7rmps91t.js} +2 -2
- package/dist/client/static/js/{index-gpmcth0x.js → index-80fjn77c.js} +2 -2
- package/dist/client/static/js/{index-rgxg0azs.css → index-9wc36am3.css} +1 -1
- package/dist/client/static/js/{index-kaxvwh07.js → index-a4636gt1.js} +2 -2
- package/dist/client/static/js/{index-hwzxdwwg.js → index-bmaktvm2.js} +1 -1
- package/dist/client/static/js/index-bvpzzhn2.js +4 -0
- package/dist/client/static/js/{index-dxnkwf39.js → index-c3whkrwa.js} +47 -47
- package/dist/client/static/js/{index-kjr68pcj.js → index-dh060b7r.js} +2 -2
- package/dist/client/static/js/{index-hkz2mz34.js → index-dmc82cxb.js} +2 -2
- package/dist/client/static/js/index-e19dbqd3.js +2 -0
- package/dist/client/static/js/{index-ep6bqcmg.js → index-e8mt8rag.js} +2 -2
- package/dist/client/static/js/index-epzvftkq.js +1 -0
- package/dist/client/static/js/{index-ac2q5903.js → index-fbg5vhhw.js} +2 -2
- package/dist/client/static/js/{index-qxzj780x.js → index-gaqjrzdb.js} +2 -2
- package/dist/client/static/js/{index-3en15m75.js → index-gg910gpv.js} +2 -2
- package/dist/client/static/js/{index-qe0vfv6s.js → index-gr8sqjpz.js} +1 -1
- package/dist/client/static/js/{index-13g17wa3.js → index-gz7kvpnm.js} +1 -1
- package/dist/client/static/js/{index-x7rajphe.js → index-h8hjcdj1.js} +2 -2
- package/dist/client/static/js/{index-jnkc9p53.js → index-j37m7pn9.js} +2 -2
- package/dist/client/static/js/{index-e6ny4gd9.js → index-mbtenbyc.js} +6 -6
- package/dist/client/static/js/{index-7pz6n3pg.js → index-nbm5r9g1.js} +2 -2
- package/dist/client/static/js/{index-8tvrzce0.js → index-nzvte8s5.js} +2 -2
- package/dist/client/static/js/index-pv4z2mp2.js +463 -0
- package/dist/client/static/js/{index-abrrqhne.js → index-pygy21w5.js} +2 -2
- package/dist/client/static/js/{index-g8rpydkr.js → index-qs4n116g.js} +2 -2
- package/dist/client/static/js/{index-seekt5k3.js → index-qwxawph7.js} +2 -2
- package/dist/client/static/js/index-rz0tz4hg.js +1 -0
- package/dist/client/static/js/{index-sng4prpr.js → index-s5vegk6q.js} +2 -2
- package/dist/client/static/js/{index-c250nzm1.js → index-t522tpxt.js} +3 -3
- package/dist/client/static/js/{index-30a8py59.js → index-taev57jw.js} +2 -2
- package/dist/client/static/js/{index-t4s10406.js → index-tb35a328.js} +2 -2
- package/dist/client/static/js/{index-fb2s080r.js → index-tc6k8qt7.js} +2 -2
- package/dist/client/static/js/{index-hcmhdpp4.js → index-tcfpzqb9.js} +36 -36
- package/dist/client/static/js/{index-45p59fxq.js → index-wbsvg1d9.js} +2 -2
- package/dist/client/static/js/{index-axtm1aq8.js → index-xw1bptp5.js} +2 -2
- package/dist/client/static/js/{index-a58rkn3f.js → index-yg083mk0.js} +6 -6
- package/dist/client/static/js/{index-tzz5gp8a.js → index-ykc14gez.js} +5 -5
- package/dist/client/static/js/index-yr3exz70.js +2 -0
- package/dist/client/static/js/{index-55pqvh82.js → index-yyjw1ty9.js} +2 -2
- package/dist/client/static/js/{index-ebf50mrs.js → index-z6y8j93w.js} +7 -7
- package/dist/client/static/js/{index-869vdnz8.js → index-zdw8bd5t.js} +2 -2
- package/dist/client/static/js/{index-5mpv57fn.js → index-zp40g8ah.js} +12 -12
- package/dist/client/static/js/{index-gkmn4y1v.js → index-zyefab6q.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-vr5mxm6f.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-bxk0g0pe.js → infoDiagram-VRGFBTTK-xsar9j6v.js} +2 -2
- package/dist/client/static/js/ini-zx7x1jj1.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-d1kdkhth.js → ishikawaDiagram-OU5B5YK6-g2rvt9jp.js} +6 -6
- package/dist/client/static/js/java-bbw6kdcr.js +1 -0
- package/dist/client/static/js/javascript-p2a8rbpw.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-cahg3zjq.js → journeyDiagram-ZHPQQLJL-q95v18zc.js} +5 -5
- package/dist/client/static/js/json-zh7m2fyg.js +1 -0
- package/dist/client/static/js/jsx-3zyyt0eh.js +1 -0
- package/dist/client/static/js/{julia-2n5k898q.js → julia-pe5vpc2m.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-nq7t83en.js → kanban-definition-PNTS6WVX-2e7m7ds3.js} +11 -11
- package/dist/client/static/js/lua-d656k76a.js +1 -0
- package/dist/client/static/js/markdown-b5w681mm.js +1 -0
- package/dist/client/static/js/{mermaid.core-6nw0853j.js → mermaid.core-dzajkp0g.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-cm7ykxf2.js → mindmap-definition-NLK3R4M7-banecvf8.js} +4 -4
- package/dist/client/static/js/one-dark-pro-z965dedc.js +1 -0
- package/dist/client/static/js/one-light-capdx801.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-ncb5xxtn.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-xwxz8nsq.js → pegDiagram-GJSIUBJH-6erykm1c.js} +1 -1
- package/dist/client/static/js/{perl-66vb5pz7.js → perl-cc2eqye8.js} +1 -1
- package/dist/client/static/js/{php-4e9we8am.js → php-p9bvnpsv.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-ff8fpvc4.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-n910k9th.js → pieDiagram-5QR66LMP-jn1d905q.js} +3 -3
- package/dist/client/static/js/properties-3c6rmnqp.js +1 -0
- package/dist/client/static/js/python-a3x3zpv1.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-dxkwxbqb.js → quadrantDiagram-O4NWA36T-sz4afnp1.js} +6 -6
- package/dist/client/static/js/r-7h3gwype.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-gbj4b1hf.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-ndv5tqgr.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-yjzj09s1.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-e6pw7e5z.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-9734dxy4.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-xb1smt7r.js → railroadDiagram-XR7U4H2S-ewzhhth2.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-6kb21b9f.js → requirementDiagram-PLB6GJNP-fcs3xd42.js} +7 -7
- package/dist/client/static/js/{ruby-v7nmcvyr.js → ruby-65s2ca5d.js} +1 -1
- package/dist/client/static/js/{rust-5ersd7be.js → rust-ec1j2hwy.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-74z0fskw.js → sankeyDiagram-IPEJSGJF-2r829rjf.js} +4 -4
- package/dist/client/static/js/{sass-h3nvy4c8.js → sass-p6cssgq8.js} +1 -1
- package/dist/client/static/js/{scss-kvev49ga.js → scss-qfx8wt3b.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-apn6kezn.js → sequenceDiagram-PO4LG4MO-3mnte9tv.js} +21 -21
- package/dist/client/static/js/{sizeCapture-INFHLROL-2drzcjb8.js → sizeCapture-INFHLROL-r6hf9265.js} +1 -1
- package/dist/client/static/js/sql-7a5vavm0.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-ma09vhby.js → stateDiagram-v2-GCMORJYK-hm2f0wdb.js} +6 -6
- package/dist/client/static/js/{svelte-dhspkgss.js → svelte-jz3a190v.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-f6y9xqnx.js → swimlanes-2SLR337P-s58xzqhw.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-z4pt2kn1.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-zmcmvq00.js → timeline-definition-EJHVYXUP-ezm1c4pz.js} +7 -7
- package/dist/client/static/js/treeView-Q6P3EWNA-rs10d4p5.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-ey6c5x9f.js +1 -0
- package/dist/client/static/js/tsx-4a9b8tqf.js +1 -0
- package/dist/client/static/js/typescript-kas107wb.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-wfaa019a.js → usecaseDiagram-POWQR4AR-ryvgs5ac.js} +47 -47
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-46wf2pgd.js → vennDiagram-UO4OBE2U-rd5prsf1.js} +7 -7
- package/dist/client/static/js/{vue-ffngx2b3.js → vue-rv4pea8r.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-kd9swrdr.js +1 -0
- package/dist/client/static/js/wardleyDiagram-VNRHLVJA-1kt8q8a4.js +78 -0
- package/dist/client/static/js/xml-3g4bdtpa.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-2ba825z9.js → xychartDiagram-PMCCYNJV-q39bbgq4.js} +5 -5
- package/dist/client/static/js/yaml-ktxjn917.js +1 -0
- package/package.json +1 -1
- package/src/client/components/common/MarkdownRenderer.tsx +29 -28
- package/src/client/components/common/header-controls/index.test.tsx +1 -0
- package/src/client/components/common/header-controls/phone-row.test.tsx +1 -0
- package/src/client/components/common/header-controls/plugin-entry.test.tsx +1 -0
- package/src/client/components/common/header-controls/shell-chrome.test.tsx +1 -0
- package/src/client/components/layout/ActivityBar.tsx +2 -1
- package/src/client/components/layout/LeftActivityBar.test.ts +1 -0
- package/src/client/components/settings/Modal.tsx +1 -1
- package/src/client/components/settings/Sidebar.tsx +2 -1
- package/src/client/components/settings/apply-side-effects.ts +8 -0
- package/src/client/components/settings/categories/DictationSettings.test.tsx +152 -0
- package/src/client/components/settings/categories/DictationSettings.tsx +76 -0
- package/src/client/components/settings/categories/VoiceSettings.tsx +77 -0
- package/src/client/components/settings/categories/dictation-settings/CaptureSection.tsx +153 -0
- package/src/client/components/settings/categories/dictation-settings/EngineSection.tsx +123 -0
- package/src/client/components/settings/categories/dictation-settings/ExternalSection.tsx +221 -0
- package/src/client/components/settings/categories/dictation-settings/LanguageSection.tsx +73 -0
- package/src/client/components/settings/categories/panel-plugins/InstallForm.tsx +24 -17
- package/src/client/components/settings/categories/panel-plugins/Registries.test.tsx +164 -0
- package/src/client/components/settings/categories/panel-plugins/Registries.tsx +180 -0
- package/src/client/components/settings/categories/panel-plugins/Section.tsx +15 -6
- package/src/client/components/settings/categories/voice-settings/SpeechSettings.test.tsx +112 -0
- package/src/client/components/settings/categories/voice-settings/SpeechSettings.tsx +84 -0
- package/src/client/components/settings/categories/voice-settings/groups.test.ts +23 -0
- package/src/client/components/settings/categories/voice-settings/groups.ts +48 -0
- package/src/client/components/settings/categories/voice-settings/speech/AutoplaySection.tsx +49 -0
- package/src/client/components/settings/categories/voice-settings/speech/EndpointSection.tsx +161 -0
- package/src/client/components/settings/categories/voice-settings/speech/EngineSection.tsx +108 -0
- package/src/client/components/settings/categories/voice-settings/speech/TestSection.tsx +56 -0
- package/src/client/components/settings/categories/voice-settings/speech/VoiceSection.tsx +157 -0
- package/src/client/components/settings/categories/voice-settings/speech/styles.ts +15 -0
- package/src/client/components/settings/category-content.tsx +3 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.speech.test.tsx +140 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +41 -97
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +143 -0
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +5 -1
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/SpeechButton.tsx +110 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +26 -10
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +13 -8
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +9 -2
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +6 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +18 -7
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +4 -2
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +19 -11
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +8 -6
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +38 -30
- package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +185 -0
- package/src/client/components/workspace/chat-timeline/chat-input/paste-attach.test.tsx +194 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +4 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +5 -11
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.test.ts +10 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +2 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/task-rows.ts +6 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/registry.test.ts +38 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +10 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-input.ts +5 -5
- package/src/client/hooks/chat/composer/attachments.ts +18 -2
- package/src/client/hooks/chat/composer/capture.test.ts +282 -0
- package/src/client/hooks/chat/composer/capture.ts +166 -0
- package/src/client/hooks/chat/composer/dictation-settings.ts +53 -0
- package/src/client/hooks/chat/composer/narrow.test.ts +130 -0
- package/src/client/hooks/chat/composer/narrow.ts +82 -0
- package/src/client/hooks/chat/composer/paste-attachments.test.ts +215 -0
- package/src/client/hooks/chat/composer/paste-attachments.ts +173 -0
- package/src/client/hooks/chat/composer/pipeline.ts +16 -3
- package/src/client/hooks/chat/composer/speech-to-text.test.tsx +314 -0
- package/src/client/hooks/chat/composer/speech-to-text.ts +158 -134
- package/src/client/hooks/chat/composer/voice-input.ts +24 -9
- package/src/client/hooks/chat/timeline/scroll.test.ts +44 -3
- package/src/client/hooks/chat/timeline/scroll.ts +31 -14
- package/src/client/hooks/chat/timeline/send-helpers.ts +3 -0
- package/src/client/hooks/chat/timeline/send.ts +5 -1
- package/src/client/hooks/settings/dictation.ts +153 -0
- package/src/client/hooks/settings/speech.ts +170 -0
- package/src/client/hooks/tts/provider.tsx +50 -0
- package/src/client/hooks/tts/tts-context.ts +39 -0
- package/src/client/hooks/tts/use-speech-autoplay.test.tsx +122 -0
- package/src/client/hooks/tts/use-speech-autoplay.ts +106 -0
- package/src/client/hooks/tts/use-tts-player.ts +33 -0
- package/src/client/hooks/ui/markdown-hydration.test.tsx +83 -0
- package/src/client/hooks/ui/markdown-hydration.ts +31 -0
- package/src/client/hooks/ui/markdown-render.ts +119 -0
- package/src/client/hooks/workspace/journal-diff.ts +8 -1
- package/src/client/hooks/workspace/panel-actions.ts +184 -0
- package/src/client/hooks/workspace/panel-registry.ts +6 -139
- package/src/client/hooks/workspace/panel-visibility-menu.ts +2 -1
- package/src/client/lib/plugins/bootstrap.test.ts +1 -0
- package/src/client/lib/tts/player.test.ts +103 -0
- package/src/client/lib/tts/player.ts +213 -0
- package/src/client/tailwind.css +11 -0
- package/src/server/lib/changes/capture-bash.server.ts +6 -3
- package/src/server/lib/changes/capture-fs.server.ts +2 -2
- package/src/server/lib/changes/capture-races.test.ts +33 -1
- package/src/server/lib/changes/capture-scan.test.ts +1 -1
- package/src/server/lib/changes/capture-test-util.ts +1 -1
- package/src/server/lib/changes/capture-types.ts +1 -1
- package/src/server/lib/changes/capture.server.ts +1 -1
- package/src/server/lib/changes/journal-read.server.ts +21 -0
- package/src/server/lib/changes/reader.server.ts +92 -14
- package/src/server/lib/changes/reader.test.ts +99 -0
- package/src/server/lib/changes/records.ts +2 -0
- package/src/server/lib/dictation/capability.server.test.ts +113 -0
- package/src/server/lib/dictation/capability.server.ts +57 -0
- package/src/server/lib/dictation/engines/adapter.ts +147 -0
- package/src/server/lib/dictation/engines/adapters.test.ts +215 -0
- package/src/server/lib/dictation/engines/deepgram.ts +77 -0
- package/src/server/lib/dictation/engines/elevenlabs.ts +44 -0
- package/src/server/lib/dictation/engines/index.ts +55 -0
- package/src/server/lib/dictation/engines/openai.ts +51 -0
- package/src/server/lib/dictation/language.server.test.ts +21 -22
- package/src/server/lib/dictation/language.server.ts +16 -19
- package/src/server/lib/dictation/omp-stt-worker.test.ts +183 -0
- package/src/server/lib/dictation/omp-stt-worker.ts +130 -78
- package/src/server/lib/dictation/settings.server.ts +74 -0
- package/src/server/lib/dictation/speech-frames.test.ts +125 -0
- package/src/server/lib/dictation/speech-frames.ts +146 -0
- package/src/server/lib/dictation/worker-process.ts +122 -0
- package/src/server/lib/harness/acp/calls.ts +20 -0
- package/src/server/lib/harness/acp/client-capabilities.ts +8 -1
- package/src/server/lib/harness/acp/client-fs.ts +17 -5
- package/src/server/lib/harness/acp/client-initialize.test.ts +32 -1
- package/src/server/lib/harness/acp/client-initialize.ts +51 -6
- package/src/server/lib/harness/acp/client-requests.ts +49 -0
- package/src/server/lib/harness/acp/client.ts +33 -36
- package/src/server/lib/harness/acp/frames-rows.test.ts +144 -0
- package/src/server/lib/harness/acp/frames-tool-shapes.test.ts +238 -0
- package/src/server/lib/harness/acp/frames-v2.test.ts +21 -0
- package/src/server/lib/harness/acp/frames.test.ts +3 -15
- package/src/server/lib/harness/acp/frames.ts +43 -67
- package/src/server/lib/harness/acp/grants.ts +20 -5
- package/src/server/lib/harness/acp/mapper.test.ts +40 -1
- package/src/server/lib/harness/acp/mapper.ts +69 -9
- package/src/server/lib/harness/acp/message-rows.ts +219 -0
- package/src/server/lib/harness/acp/prompt.ts +20 -2
- package/src/server/lib/harness/acp/protocol.ts +24 -0
- package/src/server/lib/harness/acp/replay-window.test.ts +66 -0
- package/src/server/lib/harness/acp/replay.ts +33 -8
- package/src/server/lib/harness/acp/session-addressing.test.ts +99 -0
- package/src/server/lib/harness/acp/session-approvals.ts +4 -0
- package/src/server/lib/harness/acp/session-cancel-policy.test.ts +86 -0
- package/src/server/lib/harness/acp/session-close.test.ts +89 -0
- package/src/server/lib/harness/acp/session-config.ts +8 -3
- package/src/server/lib/harness/acp/session-handshake.ts +6 -0
- package/src/server/lib/harness/acp/session-inbound.ts +126 -0
- package/src/server/lib/harness/acp/session-intake.ts +9 -2
- package/src/server/lib/harness/acp/session-lifecycle.ts +25 -0
- package/src/server/lib/harness/acp/session-notifications.ts +36 -0
- package/src/server/lib/harness/acp/session-permissions.ts +22 -1
- package/src/server/lib/harness/acp/session-requests.ts +19 -1
- package/src/server/lib/harness/acp/session-stop.ts +54 -0
- package/src/server/lib/harness/acp/session-wiring.ts +1 -0
- package/src/server/lib/harness/acp/session.test-util.ts +8 -3
- package/src/server/lib/harness/acp/session.ts +75 -75
- package/src/server/lib/harness/acp/stdio.ts +8 -1
- package/src/server/lib/harness/acp/subagent-frames.test.ts +82 -0
- package/src/server/lib/harness/acp/subagent-frames.ts +124 -0
- package/src/server/lib/harness/acp/subagents.test.ts +124 -0
- package/src/server/lib/harness/acp/subagents.ts +182 -0
- package/src/server/lib/harness/acp/tool-calls.ts +115 -45
- package/src/server/lib/harness/acp/tool-identity.test.ts +8 -0
- package/src/server/lib/harness/acp/tool-identity.ts +13 -1
- package/src/server/lib/harness/acp/tool-shape.ts +99 -0
- package/src/server/lib/harness/acp/turn.test.ts +1 -0
- package/src/server/lib/harness/acp/turn.ts +4 -1
- package/src/server/lib/harness/acp/v2.test.ts +21 -1
- package/src/server/lib/harness/acp/v2.ts +6 -1
- package/src/server/lib/lifecycle/paths.ts +22 -0
- package/src/server/lib/omp/session/changes-patch.test.ts +120 -0
- package/src/server/lib/omp/session/changes-patch.ts +190 -0
- package/src/server/lib/omp/session/changes.test.ts +55 -61
- package/src/server/lib/omp/session/changes.ts +79 -127
- package/src/server/lib/omp/session/merge-stored.ts +2 -0
- package/src/server/lib/panels/catalog-offers.server.ts +1 -1
- package/src/server/lib/panels/catalog.server.test.ts +71 -2
- package/src/server/lib/panels/catalog.server.ts +80 -0
- package/src/server/lib/panels/install.server.test.ts +15 -0
- package/src/server/lib/panels/install.server.ts +7 -0
- package/src/server/lib/panels/manifest.test.ts +1 -76
- package/src/server/lib/panels/manifest.ts +3 -60
- package/src/server/lib/panels/marketplace-catalog.server.test.ts +154 -0
- package/src/server/lib/panels/marketplace-catalog.server.ts +131 -0
- package/src/server/lib/panels/offers.server.test.ts +5 -5
- package/src/server/lib/panels/offers.server.ts +20 -2
- package/src/server/lib/panels/registries.server.test.ts +216 -0
- package/src/server/lib/panels/registries.server.ts +118 -0
- package/src/server/lib/panels/registry-cache.server.ts +104 -0
- package/src/server/lib/panels/registry-refresh.server.ts +195 -0
- package/src/server/lib/panels/registry.server.test.ts +2 -2
- package/src/server/lib/panels/registry.server.ts +19 -1
- package/src/server/lib/panels/seed.server.ts +4 -1
- package/src/server/lib/tts/engines/adapter.ts +133 -0
- package/src/server/lib/tts/engines/adapters.test.ts +129 -0
- package/src/server/lib/tts/engines/deepgram.ts +43 -0
- package/src/server/lib/tts/engines/elevenlabs.ts +53 -0
- package/src/server/lib/tts/engines/index.ts +75 -0
- package/src/server/lib/tts/engines/openai.ts +52 -0
- package/src/server/lib/tts/engines/xai.ts +44 -0
- package/src/server/lib/tts/local.server.ts +160 -0
- package/src/server/lib/tts/settings.server.ts +103 -0
- package/src/server/routes/dictation/ws.ts +99 -27
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/panels/install-route.test.ts +110 -0
- package/src/server/routes/panels/install.ts +82 -3
- package/src/server/routes/sessions/index.ts +5 -0
- package/src/server/routes/sessions/local-image.test.ts +94 -0
- package/src/server/routes/sessions/local-image.ts +141 -0
- package/src/server/routes/settings/dictation.test.ts +139 -0
- package/src/server/routes/settings/dictation.ts +86 -0
- package/src/server/routes/settings/index.ts +4 -0
- package/src/server/routes/settings/speech.test.ts +156 -0
- package/src/server/routes/settings/speech.ts +98 -0
- package/src/server/routes/tts/index.ts +11 -0
- package/src/server/routes/tts/speak.test.ts +160 -0
- package/src/server/routes/tts/speak.ts +87 -0
- package/src/shared/lib/chat/attachments.ts +17 -3
- package/src/shared/lib/chat/composer/attachment-labels.test.ts +154 -0
- package/src/shared/lib/chat/composer/attachment-labels.ts +166 -0
- package/src/shared/lib/chat/omp/subagent-card-fold.test.ts +75 -0
- package/src/shared/lib/chat/timeline/changed-files.test.ts +13 -0
- package/src/shared/lib/chat/timeline/changed-files.ts +4 -2
- package/src/shared/lib/chat/timeline/local-image.test.ts +88 -0
- package/src/shared/lib/chat/timeline/local-image.ts +110 -0
- package/src/shared/lib/chat/timeline/omp-callbacks.ts +3 -2
- package/src/shared/lib/chat/timeline/run-signals.ts +2 -2
- package/src/shared/lib/chat/timeline/stream-callbacks.ts +8 -6
- package/src/shared/lib/chat/timeline/stream-coalescer.ts +7 -0
- package/src/shared/lib/chat/timeline/stream.test.ts +3 -1
- package/src/shared/lib/chat/timeline/tool-verbs.test.ts +5 -0
- package/src/shared/lib/chat/timeline/tool-verbs.ts +3 -1
- package/src/shared/lib/chat/todo/parser.test.ts +54 -0
- package/src/shared/lib/chat/todo/parser.ts +56 -0
- package/src/shared/lib/chat/tool/tool-aliases.test.ts +37 -0
- package/src/shared/lib/chat/tool/tool-aliases.ts +75 -0
- package/src/shared/lib/chat/tool/tool-input-path.test.ts +44 -0
- package/src/shared/lib/chat/tool/tool-input-path.ts +47 -0
- package/src/shared/lib/dictation/capability.ts +32 -0
- package/src/shared/lib/dictation/constraints.test.ts +41 -0
- package/src/shared/lib/dictation/constraints.ts +48 -0
- package/src/shared/lib/dictation/engines.test.ts +117 -0
- package/src/shared/lib/dictation/engines.ts +190 -0
- package/src/shared/lib/dictation/gate.test.ts +118 -0
- package/src/shared/lib/dictation/gate.ts +85 -0
- package/src/shared/lib/dictation/languages.test.ts +88 -0
- package/src/shared/lib/dictation/languages.ts +90 -0
- package/src/shared/lib/dictation/models.ts +9 -5
- package/src/shared/lib/dictation/protocol.ts +74 -34
- package/src/shared/lib/dictation/settings.test.ts +94 -0
- package/src/shared/lib/dictation/settings.ts +111 -0
- package/src/shared/lib/dictation/wav.test.ts +66 -0
- package/src/shared/lib/dictation/wav.ts +48 -0
- package/src/shared/lib/fs/journal-unavailable.test.ts +30 -0
- package/src/shared/lib/fs/journal-unavailable.ts +35 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +35 -35
- package/src/shared/lib/net/base-url.test.ts +25 -0
- package/src/shared/lib/net/base-url.ts +29 -0
- package/src/shared/lib/omp/config/schema-extras.ts +9 -8
- package/src/shared/lib/omp/session/parse-message-blocks.ts +2 -2
- package/src/shared/lib/panels/plugin-repo.test.ts +113 -0
- package/src/shared/lib/panels/plugin-repo.ts +149 -0
- package/src/shared/lib/settings/defaults.ts +4 -0
- package/src/shared/lib/tts/capability.ts +16 -0
- package/src/shared/lib/tts/engines.test.ts +79 -0
- package/src/shared/lib/tts/engines.ts +313 -0
- package/src/shared/lib/tts/settings.test.ts +56 -0
- package/src/shared/lib/tts/settings.ts +108 -0
- package/src/shared/lib/tts/speakable.test.ts +76 -0
- package/src/shared/lib/tts/speakable.ts +179 -0
- package/src/shared/types/chat.ts +8 -1
- package/src/shared/types/panels-registry.ts +32 -0
- package/src/shared/types/panels.ts +23 -0
- package/src/shared/types/session-changes.ts +15 -1
- package/src/shared/types/settings/state.ts +25 -0
- package/src/test-support/pristine-globals.ts +5 -0
- package/dist/client/static/js/ImageView-pr4h38hb.js +0 -1
- package/dist/client/static/js/LayoutWrapper-n4tzhjes.js +0 -2
- package/dist/client/static/js/MergeDiffView-0t15nh9f.js +0 -1
- package/dist/client/static/js/Modal-77hgx4dw.js +0 -59
- package/dist/client/static/js/PdfView-gzxhvxe8.js +0 -1
- package/dist/client/static/js/SessionsView-2tdqrvk0.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-zs15nydj.js +0 -1
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-heep78p6.js +0 -36
- package/dist/client/static/js/bash-8d3wrx5c.js +0 -1
- package/dist/client/static/js/c-rn3z0csz.js +0 -1
- package/dist/client/static/js/cpp-99ws9nak.js +0 -1
- package/dist/client/static/js/css-drfs4n12.js +0 -1
- package/dist/client/static/js/css-narcr42w.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-p3y1b4ap.js +0 -1
- package/dist/client/static/js/dagre-6A5THRUB-gk0gp124.js +0 -4
- package/dist/client/static/js/eventmodeling-NTZA5JFV-sx2cwkz3.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-dsc17mty.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-yqhbscsd.js +0 -1
- package/dist/client/static/js/graphql-tr0jcndy.js +0 -1
- package/dist/client/static/js/html-n8fdvrdk.js +0 -1
- package/dist/client/static/js/index-1hb8fvw9.js +0 -1
- package/dist/client/static/js/index-9a78xmkk.js +0 -462
- package/dist/client/static/js/index-b2cs4c51.js +0 -4
- package/dist/client/static/js/index-fryp0kgf.js +0 -2
- package/dist/client/static/js/index-qek9mt5w.js +0 -1
- package/dist/client/static/js/index-rq4dk4tp.js +0 -4
- package/dist/client/static/js/index-vnv9z0a1.js +0 -1
- package/dist/client/static/js/index-xr4hjv01.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-0sd3zzgg.js +0 -1
- package/dist/client/static/js/ini-tnaw7zjy.js +0 -1
- package/dist/client/static/js/java-m4dpc2vw.js +0 -1
- package/dist/client/static/js/javascript-8y26t991.js +0 -1
- package/dist/client/static/js/json-azm7bdqd.js +0 -1
- package/dist/client/static/js/jsx-p9j1k773.js +0 -1
- package/dist/client/static/js/lua-hbm9rhz9.js +0 -1
- package/dist/client/static/js/markdown-tk3cd3vs.js +0 -1
- package/dist/client/static/js/one-dark-pro-2cdc2nk7.js +0 -1
- package/dist/client/static/js/one-light-bt6z4jf0.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-13w2v5bb.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-swtnysgn.js +0 -1
- package/dist/client/static/js/properties-6911ckw7.js +0 -1
- package/dist/client/static/js/python-44cvj250.js +0 -1
- package/dist/client/static/js/r-t3sepzm4.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-vtvxkx55.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-5sp2d63r.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-kg706fan.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-4ra1gzx5.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-hms3zpjm.js +0 -1
- package/dist/client/static/js/sql-zdkawqx3.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3dwas56m.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-7t5k6rs2.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-w56ry3bg.js +0 -1
- package/dist/client/static/js/tsx-b7eabr17.js +0 -1
- package/dist/client/static/js/typescript-nnkvhwfy.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-rtjb9kgv.js +0 -1
- package/dist/client/static/js/wardleyDiagram-VNRHLVJA-10ph3bzq.js +0 -78
- package/dist/client/static/js/xml-xy1tw6b2.js +0 -1
- package/dist/client/static/js/yaml-0fexqg2d.js +0 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Markdown → the segments a speech engine should read.
|
|
8
|
+
*
|
|
9
|
+
* The assistant writes markdown for a screen: fenced code, tables, link
|
|
10
|
+
* targets, file paths and emphasis markers. Speaking that text verbatim is the
|
|
11
|
+
* classic text-to-speech failure — a 40-line diff read aloud, a URL spelled
|
|
12
|
+
* character by character, `**bold**` pronounced as asterisks. The rules here
|
|
13
|
+
* mirror omp's own `SpeakableStream`: drop what cannot be spoken, speak a
|
|
14
|
+
* link's label instead of its target, a URL's host instead of its path, and a
|
|
15
|
+
* long path's basename.
|
|
16
|
+
*
|
|
17
|
+
* Pure and synchronous. The player owns timing, network and playback; this
|
|
18
|
+
* module only answers "what is worth saying, and where may a request end?".
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const FENCE_RE = /```[\s\S]*?```|~~~[\s\S]*?~~~/g;
|
|
22
|
+
const IMAGE_RE = /!\[([^\]]*)\]\(([^()]*)\)/g;
|
|
23
|
+
const LINK_RE = /\[([^\]]+)\]\(([^()]*)\)/g;
|
|
24
|
+
const AUTOLINK_RE = /<(https?:\/\/[^\s>]+)>/g;
|
|
25
|
+
const BARE_URL_RE = /\bhttps?:\/\/[^\s<>()"'\]]+|\bwww\.[\w-]+(?:\.[\w-]+)+[^\s<>()"'\]]*/g;
|
|
26
|
+
const INLINE_CODE_RE = /`{1,2}([^`]+)`{1,2}/g;
|
|
27
|
+
const BOLD_STRIKE_RE = /\*\*|__|~~/g;
|
|
28
|
+
const EMPHASIS_ASTERISK_RE = /\*(?=\S)|(?<=\S)\*/g;
|
|
29
|
+
const EMPHASIS_UNDERSCORE_RE = /(^|\s)_+|_+(?=\s|$)/g;
|
|
30
|
+
const HTML_TAG_RE = /<\/?[a-zA-Z][^<>]*>/g;
|
|
31
|
+
const HR_INLINE_RE = /(^|\s)[-*_]{3,}(?=\s|$)/g;
|
|
32
|
+
const PATH_RE = /(^|[\s("'`])((?:~|\.{1,2})?\/?[\w.@+-]+(?:\/[\w.@+-]+){2,}\/?)/g;
|
|
33
|
+
const HAS_SPEAKABLE_RE = /[\p{L}\p{N}]/u;
|
|
34
|
+
const SENTENCE_BOUNDARY_RE = /[.!?…]+[)\]"'»”’]*\s/g;
|
|
35
|
+
const ABBREVIATION_RE = /(?:^|\s)(?:e\.g|i\.e|etc|vs|Mr|Mrs|Ms|Dr|St|No)\.$/i;
|
|
36
|
+
|
|
37
|
+
/** "https://github.com/foo/bar?x#y" → "github.com". */
|
|
38
|
+
function speakableUrl(url: string): string {
|
|
39
|
+
return url
|
|
40
|
+
.replace(/^[a-z][\w+.-]*:\/\//i, '')
|
|
41
|
+
.replace(/^www\./i, '')
|
|
42
|
+
.replace(/[/?#].*$/, '');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** One raw slice → its speakable form; '' when nothing is worth vocalizing. */
|
|
46
|
+
function normalizeSpeakable(raw: string): string {
|
|
47
|
+
const spoken = raw
|
|
48
|
+
.replace(IMAGE_RE, '$1')
|
|
49
|
+
.replace(LINK_RE, '$1')
|
|
50
|
+
.replace(AUTOLINK_RE, (_match, url: string) => speakableUrl(url))
|
|
51
|
+
.replace(BARE_URL_RE, (match) => speakableUrl(match))
|
|
52
|
+
.replace(INLINE_CODE_RE, '$1')
|
|
53
|
+
.replace(BOLD_STRIKE_RE, '')
|
|
54
|
+
.replace(EMPHASIS_ASTERISK_RE, '')
|
|
55
|
+
.replace(EMPHASIS_UNDERSCORE_RE, '$1')
|
|
56
|
+
.replace(HTML_TAG_RE, ' ')
|
|
57
|
+
.replace(HR_INLINE_RE, '$1')
|
|
58
|
+
.replace(PATH_RE, (_match, lead: string, path: string) => {
|
|
59
|
+
const parts = path.split('/').filter((part) => part.length > 0);
|
|
60
|
+
return lead + (parts[parts.length - 1] ?? path);
|
|
61
|
+
})
|
|
62
|
+
.replace(/\s+/g, ' ')
|
|
63
|
+
.trim();
|
|
64
|
+
return HAS_SPEAKABLE_RE.test(spoken) ? spoken : '';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** A line that carries no speakable prose. */
|
|
68
|
+
function isSilentLine(line: string): boolean {
|
|
69
|
+
const trimmed = line.trim();
|
|
70
|
+
if (!trimmed) return false;
|
|
71
|
+
if (trimmed.startsWith('|')) return true;
|
|
72
|
+
if (/^(?:-{3,}|\*{3,}|_{3,})\s*$/.test(trimmed)) return true;
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Strip block markup, drop tables and code, and collapse the rest into one
|
|
78
|
+
* prose string. The newline becomes a space: a heading and the paragraph under
|
|
79
|
+
* it are read as separate sentences by the punctuation, not by the layout.
|
|
80
|
+
*/
|
|
81
|
+
export function speakableText(markdown: string): string {
|
|
82
|
+
const withoutFences = markdown.replace(FENCE_RE, ' ');
|
|
83
|
+
const lines = withoutFences.split('\n').flatMap((line) => {
|
|
84
|
+
if (isSilentLine(line)) return [];
|
|
85
|
+
let text = line;
|
|
86
|
+
text = text.replace(/^\s{0,3}#{1,6}\s+/, '');
|
|
87
|
+
text = text.replace(/^\s{0,3}>\s?/, '');
|
|
88
|
+
text = text.replace(/^\s{0,3}[-*+]\s+/, '');
|
|
89
|
+
text = text.replace(/^\s{0,3}(\d{1,3})[.)]\s+/, '$1. ');
|
|
90
|
+
return text.trim() ? [text.trim()] : [];
|
|
91
|
+
});
|
|
92
|
+
return normalizeSpeakable(lines.join(' '));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Sentence boundaries that exist in `text`, as end offsets. */
|
|
96
|
+
function sentenceEnds(text: string): number[] {
|
|
97
|
+
const ends: number[] = [];
|
|
98
|
+
SENTENCE_BOUNDARY_RE.lastIndex = 0;
|
|
99
|
+
for (let match = SENTENCE_BOUNDARY_RE.exec(text); match; match = SENTENCE_BOUNDARY_RE.exec(text)) {
|
|
100
|
+
const cut = match.index + match[0].length;
|
|
101
|
+
const head = text.slice(0, cut).trimEnd();
|
|
102
|
+
if (ABBREVIATION_RE.test(head)) continue;
|
|
103
|
+
if ((head.match(/`/g)?.length ?? 0) % 2 !== 0) continue;
|
|
104
|
+
ends.push(cut);
|
|
105
|
+
}
|
|
106
|
+
return ends;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Latest position at or below `max` that ends a word. */
|
|
110
|
+
function wordCut(text: string, max: number): number {
|
|
111
|
+
const space = text.lastIndexOf(' ', max);
|
|
112
|
+
return space > 0 ? space + 1 : Math.min(max, text.length);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Split one sentence that exceeds `max` into word-sized pieces. */
|
|
116
|
+
function splitLong(sentence: string, max: number): string[] {
|
|
117
|
+
const pieces: string[] = [];
|
|
118
|
+
let rest = sentence;
|
|
119
|
+
while (rest.length > max) {
|
|
120
|
+
const cut = wordCut(rest, max);
|
|
121
|
+
pieces.push(rest.slice(0, cut).trim());
|
|
122
|
+
rest = rest.slice(cut).trim();
|
|
123
|
+
}
|
|
124
|
+
if (rest) pieces.push(rest);
|
|
125
|
+
return pieces;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The request-sized pieces of an answer, in order.
|
|
130
|
+
*
|
|
131
|
+
* `firstMax` is smaller than `maxChars` on purpose: the first request is what
|
|
132
|
+
* decides time-to-first-audio, and a 600-character first chunk spends seconds
|
|
133
|
+
* synthesizing before the user hears anything. Later chunks fill the engine's
|
|
134
|
+
* budget.
|
|
135
|
+
*/
|
|
136
|
+
export function speechChunks(
|
|
137
|
+
markdown: string,
|
|
138
|
+
maxChars: number,
|
|
139
|
+
firstMax = Math.min(320, maxChars),
|
|
140
|
+
): string[] {
|
|
141
|
+
const text = speakableText(markdown);
|
|
142
|
+
if (!text) return [];
|
|
143
|
+
const limit = Math.max(1, Math.floor(maxChars));
|
|
144
|
+
const firstLimit = Math.max(1, Math.min(Math.floor(firstMax), limit));
|
|
145
|
+
|
|
146
|
+
const sentences: string[] = [];
|
|
147
|
+
let start = 0;
|
|
148
|
+
for (const end of sentenceEnds(text)) {
|
|
149
|
+
const sentence = text.slice(start, end).trim();
|
|
150
|
+
if (sentence) sentences.push(sentence);
|
|
151
|
+
start = end;
|
|
152
|
+
}
|
|
153
|
+
const tail = text.slice(start).trim();
|
|
154
|
+
if (tail) sentences.push(tail);
|
|
155
|
+
|
|
156
|
+
const chunks: string[] = [];
|
|
157
|
+
let current = '';
|
|
158
|
+
let currentLimit = firstLimit;
|
|
159
|
+
const flush = () => {
|
|
160
|
+
if (!current) return;
|
|
161
|
+
chunks.push(current);
|
|
162
|
+
current = '';
|
|
163
|
+
currentLimit = limit;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
for (const sentence of sentences) {
|
|
167
|
+
for (const piece of sentence.length > currentLimit ? splitLong(sentence, currentLimit) : [sentence]) {
|
|
168
|
+
const joined = current ? `${current} ${piece}` : piece;
|
|
169
|
+
if (joined.length > currentLimit) {
|
|
170
|
+
flush();
|
|
171
|
+
current = piece;
|
|
172
|
+
} else {
|
|
173
|
+
current = joined;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
flush();
|
|
178
|
+
return chunks.filter((chunk) => HAS_SPEAKABLE_RE.test(chunk));
|
|
179
|
+
}
|
package/src/shared/types/chat.ts
CHANGED
|
@@ -38,6 +38,13 @@ export interface Attachment {
|
|
|
38
38
|
/** Inlined text-file contents, persisted with the committed user turn so a
|
|
39
39
|
* retry can re-send them without the original `File`. */
|
|
40
40
|
content?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The file's OWN name, kept when the composer renames `name` from the
|
|
43
|
+
* filename text in the draft. Classification reads this: a pasted `notes.md`
|
|
44
|
+
* whose name the user edits to `catatan` must still be inlined as text at
|
|
45
|
+
* send time, and only the extension this name carries can say so.
|
|
46
|
+
*/
|
|
47
|
+
sourceName?: string;
|
|
41
48
|
/**
|
|
42
49
|
* Set when `content` came from sniffing the file's bytes rather than from its
|
|
43
50
|
* name or MIME. A promised-file drag from another app has neither, so without
|
|
@@ -162,7 +169,7 @@ export interface ChatMessageData {
|
|
|
162
169
|
date?: string;
|
|
163
170
|
timestamp?: string;
|
|
164
171
|
content: string;
|
|
165
|
-
attachments?: { id?: string; name: string; preview?: string; type?: string; size?: number }[];
|
|
172
|
+
attachments?: { id?: string; name: string; sourceName?: string; preview?: string; type?: string; size?: number }[];
|
|
166
173
|
thinking?: ThinkingData | string;
|
|
167
174
|
/** Short human intent for tool calls (omp arguments.i) shown before the tools. */
|
|
168
175
|
intent?: string;
|
|
@@ -272,6 +272,38 @@ export interface PanelRegistryPayload {
|
|
|
272
272
|
* with nothing on screen to say why.
|
|
273
273
|
*/
|
|
274
274
|
syncBlocked: Record<string, PanelSyncBlocked>;
|
|
275
|
+
/**
|
|
276
|
+
* GitHub repositories the marketplace registers as plugin sources.
|
|
277
|
+
*
|
|
278
|
+
* Both the registration and the last cached read travel here, because they are
|
|
279
|
+
* different facts and either can be the interesting one: `repo` is what the
|
|
280
|
+
* user added, while `pluginCount`/`fetchedAt`/`error` describe the refresh. A
|
|
281
|
+
* failed refresh keeps the registration with its reason rather than making the
|
|
282
|
+
* repository vanish from the pane.
|
|
283
|
+
*/
|
|
284
|
+
registries: PanelPluginSource[];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* One registered GitHub repository, as the pane renders it.
|
|
289
|
+
*
|
|
290
|
+
* `pluginCount` is what the repository's last successful read offered, so a
|
|
291
|
+
* registration whose fetch has never succeeded shows zero plugins and an
|
|
292
|
+
* `error`, never a silent empty row.
|
|
293
|
+
*/
|
|
294
|
+
export interface PanelPluginSource {
|
|
295
|
+
/** `owner/repo` on GitHub. */
|
|
296
|
+
repo: string;
|
|
297
|
+
url: string;
|
|
298
|
+
name: string;
|
|
299
|
+
description?: string;
|
|
300
|
+
/** ISO time of the last successful refresh. */
|
|
301
|
+
fetchedAt?: string;
|
|
302
|
+
/** Why the last refresh failed. The registration is kept. */
|
|
303
|
+
error?: string;
|
|
304
|
+
/** Entries of the repository's catalog that could not be offered, and why. */
|
|
305
|
+
warning?: string;
|
|
306
|
+
pluginCount: number;
|
|
275
307
|
}
|
|
276
308
|
|
|
277
309
|
/** A bundled plugin whose sync a local edit refused. */
|
|
@@ -179,5 +179,28 @@ export interface PanelMarketplaceManifest {
|
|
|
179
179
|
description?: string;
|
|
180
180
|
owner?: { name?: string };
|
|
181
181
|
plugins?: PanelMarketplacePluginEntry[];
|
|
182
|
+
/** GitHub repositories this catalog registers as further plugin sources. */
|
|
183
|
+
registries?: PanelMarketplaceRegistryEntry[];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* A GitHub repository a `marketplace.json` registers as a plugin source.
|
|
188
|
+
*
|
|
189
|
+
* This is what lets a user publish a plugin in their own repository and have it
|
|
190
|
+
* appear in the pane's Available list without vendoring it into this
|
|
191
|
+
* marketplace: the entry names the repository, the server reads the repository's
|
|
192
|
+
* own catalog when it can, and every plugin it offers becomes installable.
|
|
193
|
+
*
|
|
194
|
+
* The repository must follow the ecosystem naming rule
|
|
195
|
+
* (`kabmo-plugins-<plugin>`, `src/shared/lib/panels/plugin-repo.ts`). The PLUGIN
|
|
196
|
+
* name it publishes is free-form — the prefix belongs to the repository, never
|
|
197
|
+
* to the plugin.
|
|
198
|
+
*/
|
|
199
|
+
export interface PanelMarketplaceRegistryEntry {
|
|
200
|
+
/** `owner/repo` on GitHub. */
|
|
201
|
+
repo: string;
|
|
202
|
+
/** Display name; the repository name without the prefix when absent. */
|
|
203
|
+
name?: string;
|
|
204
|
+
description?: string;
|
|
182
205
|
}
|
|
183
206
|
|
|
@@ -35,6 +35,13 @@ export interface SessionChangeRecord {
|
|
|
35
35
|
before: string | null | undefined;
|
|
36
36
|
/** Blob key of the content after the write; `null` when the write deleted the file. */
|
|
37
37
|
after: string | null | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the file existed before this write, when the journal stores hunks
|
|
40
|
+
* (`base: null` / `sum: '-'`) instead of blob keys. Absent when unknown.
|
|
41
|
+
*/
|
|
42
|
+
existedBefore?: boolean;
|
|
43
|
+
/** Whether it existed after the write; absent when the journal has no answer. */
|
|
44
|
+
existsAfter?: boolean;
|
|
38
45
|
}
|
|
39
46
|
|
|
40
47
|
/** One file a run changed, as the collapsed summary lists it. */
|
|
@@ -54,6 +61,9 @@ export interface SessionChangeCounts {
|
|
|
54
61
|
removed: number;
|
|
55
62
|
}
|
|
56
63
|
|
|
64
|
+
/** Why a journal side cannot be read. */
|
|
65
|
+
export type SessionChangeUnavailableReason = 'too-large' | 'snapshot-race' | 'unreadable';
|
|
66
|
+
|
|
57
67
|
/** The two sides of one file's net change in a run, plus a unified patch. */
|
|
58
68
|
export interface SessionChangeDiff {
|
|
59
69
|
path: string;
|
|
@@ -63,6 +73,10 @@ export interface SessionChangeDiff {
|
|
|
63
73
|
newContent: string;
|
|
64
74
|
/** Unified diff of the two sides; empty when they are equal. */
|
|
65
75
|
diff: string;
|
|
66
|
-
/** A
|
|
76
|
+
/** A side was not stored, or its stored copy is gone, so the pair is unknown. */
|
|
67
77
|
unavailable: boolean;
|
|
78
|
+
/** Why a side is unknown; absent when `unavailable` is false. */
|
|
79
|
+
unavailableReason?: SessionChangeUnavailableReason;
|
|
80
|
+
/** The store's content cap that dropped the side; only for `too-large`. */
|
|
81
|
+
unavailableLimitBytes?: number;
|
|
68
82
|
}
|
|
@@ -10,12 +10,18 @@ import type { IconStyle } from '@/shared/lib/theme/icon-style';
|
|
|
10
10
|
import type { TrayIconStyle } from '@/shared/lib/theme/tray-icon-style';
|
|
11
11
|
import type { SettingsSection } from '@/shared/lib/settings/sections';
|
|
12
12
|
import type { GitIdentity } from '@/shared/lib/git/identity';
|
|
13
|
+
import type { DictationConfig } from '@/shared/lib/dictation/settings';
|
|
14
|
+
import type { TtsConfig } from '@/shared/lib/tts/settings';
|
|
13
15
|
|
|
14
16
|
/** Wire protocol for the live agent event stream (chat timeline). */
|
|
15
17
|
export type SettingsCategoryId =
|
|
16
18
|
// KABMO
|
|
17
19
|
| 'appearance'
|
|
18
20
|
| 'chats'
|
|
21
|
+
/** Voice: the composer mic (STT) and spoken answers (TTS). One category
|
|
22
|
+
* because both decide where AUDIO goes, and a reader looking for one
|
|
23
|
+
* expects the other beside it. */
|
|
24
|
+
| 'voice'
|
|
19
25
|
| 'keyboard'
|
|
20
26
|
| 'notifications'
|
|
21
27
|
| 'usage'
|
|
@@ -290,4 +296,23 @@ export interface SettingsState {
|
|
|
290
296
|
keybindingSend: 'Enter' | 'Shift + Enter' | 'Ctrl / Cmd + Enter';
|
|
291
297
|
keybindingNewLine: 'Enter' | 'Shift + Enter' | 'Ctrl / Cmd + Enter';
|
|
292
298
|
keybindingSteering: 'Enter' | 'Shift + Enter' | 'Ctrl / Cmd + Enter';
|
|
299
|
+
/**
|
|
300
|
+
* Composer dictation: which engine transcribes the mic, in which language,
|
|
301
|
+
* with which model, and the capture limits. One object because every field is
|
|
302
|
+
* read together by the same hook, and the normaliser in
|
|
303
|
+
* `shared/lib/dictation/settings.ts` is the only place that decides what an
|
|
304
|
+
* absent or hostile value means.
|
|
305
|
+
*
|
|
306
|
+
* The API key is NOT here: this object ships to the browser in the bootstrap,
|
|
307
|
+
* so a credential would be readable by any script on the origin. It lives in
|
|
308
|
+
* `~/.kabmo/dictation.json` (0600) behind its own route.
|
|
309
|
+
*/
|
|
310
|
+
dictation: DictationConfig;
|
|
311
|
+
/**
|
|
312
|
+
* Spoken answers: which engine reads the assistant's final text, in which
|
|
313
|
+
* voice, and whether a settled run is read automatically. The API keys are
|
|
314
|
+
* NOT here for the same reason dictation's key is not: the blob ships to the
|
|
315
|
+
* browser. They live in `~/.kabmo/tts.json` (0600) behind their own route.
|
|
316
|
+
*/
|
|
317
|
+
tts: TtsConfig;
|
|
293
318
|
}
|
|
@@ -42,6 +42,11 @@ export const DOM_TEST_GLOBALS = [
|
|
|
42
42
|
// while every other component rendered. Listed here they are installed from
|
|
43
43
|
// the window under test and put back with the rest.
|
|
44
44
|
'requestAnimationFrame', 'cancelAnimationFrame',
|
|
45
|
+
// `location` is read as a BARE global by code that builds an origin-relative
|
|
46
|
+
// URL — dictation's socket (`dictationUrl`) is the one that failed here with
|
|
47
|
+
// `ReferenceError: location is not defined` under `bun test`, because the
|
|
48
|
+
// runner defines no `location` and a mounted hook therefore had no origin.
|
|
49
|
+
'location',
|
|
45
50
|
// The three DOM data classes, because a suite that swaps `window` usually needs them and
|
|
46
51
|
// a LOCAL save-and-restore loop is how they leaked: `editor/save-as.test.ts` installed
|
|
47
52
|
// happy-dom's `File`/`Blob` and never put them back, so a later file's `carriesBytes` read
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e,m,Rr}from"./index-9a78xmkk.js";import{Ii}from"./index-b2cs4c51.js";import{ku}from"./index-0e51wknc.js";function g({source:t,name:r,revision:s=0}){let{url:i,loading:n,error:o}=ku(t,s);if(o)return e(Rr,{name:r,message:o});if(n||!i)return e("div",{className:"flex flex-1 items-center justify-center gap-2 text-xs text-ink/40",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading image…"})]});return e(Ii,{src:i,name:r,className:"flex-1 min-h-0"})}export{g as ImageView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d,n,o,K,i,u,a,Fe,le,$t,hc,e,s,Qe,Ee,m,an,on,_,st,sn,f,B,se,lt,re,ge,Dt,Ye,fn,fe,We,ce,wa,ea,gn,Ca,Xn,O,D,U,ul,b,tr,dl,Ue,xe,Zt,YA,Ya,fm,hn,ml,De,Nt,Do,je,gl,Nr,de,Z,dt,cs,us,Ad,yc,Ae,Ke,ps,Ch,xc,Bt,Rt,Ft,Cc,gs,Qo,vl,kl,xd,Fo,Ze,nt,ia,Xe,no,Cl,zc,Da,Uc,Cd,ks,Na,Mo,Po,Oo,_t,ar,Es,$o,zo,Uo,ro,Bl,Il,_l,Sl,or,Af,hf,Go,Hc,bf,Bs,Is,yf,_s,kf,xf,wf,Wc,xi,Tl,Qa,wi,Cf,Ef,Kc,Vc,Bf,If,m0,Td,A0,qo,Dd,Cn,_f,Sf,Tf,Df,Vg,ao,Qf,Rf,Yc,Nl,Of,$f,Ld,zf,v0}from"./index-9a78xmkk.js";import{Ud}from"./index-fryp0kgf.js";import"./index-5mpv57fn.js";import{Xc,eu,tu,nu,ru,au,ou,Ii,iu,Ql,su}from"./index-b2cs4c51.js";import{Ws}from"./index-ebf50mrs.js";import"./index-3en15m75.js";import{Ts,uu,du,Ho,Ds,pu,mu,fu,gu,Au,hu,yu,vu}from"./index-0e51wknc.js";import{ld,cd,ai,ud,dd}from"./index-c250nzm1.js";import{gt,_i,wu,Cu,Bu}from"./index-xr4hjv01.js";import{Rs,Fa,Fr,Iu,_u,Wo,Su,Fs,Yd,uA,Ls,Ms,Ps,Lr,Os,$s,Ko,zs,Us,Gs,js,Ti,Vo,qs,Hs,Tu,Jd,Du,Nu,Qu,Ru,Fu,Lu}from"./index-rq4dk4tp.js";import{Pa,Oa}from"./index-8tvrzce0.js";function qe(t){let{editorOpen:r,diffOpen:l,settingsOpen:p,offMainScreen:h,onCloseEditor:g,onCloseDiff:S,onCloseSettings:v,onReturnToMain:x}=t;o(()=>v0(()=>{if(r)return g(),!0;if(l)return S(),!0;if(p)return v(),!0;if(h)return x(),!0;return!1}),[r,l,p,h,g,S,v,x])}var St="terminal";function ze(t){return t===St}function Me(t){if(ze(t))Ch()}function Je({dock:t,sessionId:r,currentScreen:l,setCurrentScreen:p}){let[h,g]=n(0),[S,v]=n(0),x=a(()=>{let k=xe(r,"layout.mobileRightPanel")??hc;Me(k),g((y)=>y+1),p("right")},[r,p]),c=a(()=>{v((k)=>k+1),p("session")},[p]),w=a((k)=>{let y=A0(k,t);if(!y)return;let P=xe(r,"layout.mobileRightPanel");if(y==="right"&&(l!=="right"||P!==k))Me(k);if(Zt(r,y==="left"?"layout.mobileLeftPanel":"layout.mobileRightPanel",k),y==="right")g(0);p(y==="left"?"session":"right")},[t,r,l,p]);return Ae(Td,(k)=>{let y=k.detail?.panelKey;if(y)w(y)}),{right:h,left:S,openSessionDrawer:c,openRightDrawer:x,openNamedPanel:w}}var xt={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]},eo=s(xt);function Ie(){let t=ps(),[r,l]=n(null),p=a((S,v)=>{l({top:v,bottom:v,left:S,right:S})},[]),h=ld({enabled:t,onLongPress:p}),g=a(()=>l(null),[]);return{anchor:r,close:g,surfaceProps:{onContextMenu:(S)=>{S.preventDefault();let v=S.currentTarget.getBoundingClientRect();l({top:v.top,bottom:v.bottom,left:v.left,right:v.right})},onTouchStart:h.onTouchStart,onTouchMove:h.onTouchMove,onTouchEnd:h.onTouchEnd,onTouchCancel:h.onTouchCancel,onClickCapture:(S)=>{if(!h.consume())return;S.preventDefault(),S.stopPropagation()}}}}var wt=10,oo=600000;function to({activeSessionTitle:t,activeSessionId:r,onOpenSessionSidebar:l,onOpenRightSidebar:p,onNewSession:h,onSelectSession:g}){let{folders:S}=Xe(),v=Ld(),x=Na(r),[c,w]=n(null),{hidden:k,setHidden:y}=Sf(),P=Ie(),R=Dd("mobile"),I=u(()=>{let C=Date.now(),A=[];for(let T of S)for(let E of T.sessions??[]){if(E.is_archived===1)continue;let M=YA(String(E.id)),L=E.updated_at?Date.parse(E.updated_at):0,q=M!==void 0&&C-M<=oo?M:L;if(M!==void 0&&C-M>oo)continue;A.push({id:E.id,title:E.title,folderName:T.name,modified:q})}return A.sort((T,E)=>E.modified-T.modified).slice(0,wt)},[S]),N=t?t.charAt(0).toUpperCase()+t.slice(1):"New session";return e("header",{className:`flex-shrink-0 bg-canvas border-b border-ink/10 flex items-center justify-between ${gl} px-3 z-20 titlebar-drag-region select-none`,...Qa(),...P.surfaceProps,style:qo(),children:[e("div",{className:"flex items-center space-x-2 flex-1 min-w-0 titlebar-no-drag",children:[e("button",{type:"button",onClick:l,className:"w-9 h-9 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 inline-flex items-center justify-center",title:"Open Sessions","aria-label":"Open Sessions",children:e(eo,{size:20,strokeWidth:2})}),e("span",{className:"relative font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:[e(Da,{glow:!0}),e("span",{className:"absolute -top-0.5 -right-1.5 flex",children:e(Wc,{status:v})})]}),e("span",{className:"text-ink/25 font-light text-xs flex-shrink-0 select-none",children:"/"}),e("div",{className:"relative min-w-0 flex-1 max-w-[150px]","data-testid":"session-picker",children:[e("button",{type:"button",onClick:(C)=>{w((A)=>A?null:Bt(C.currentTarget))},className:"tap-chip flex w-full items-center space-x-1 text-xs font-semibold text-ink hover:text-ink/80 transition-colors py-1 min-w-0",title:N,"aria-haspopup":"menu","aria-expanded":c!==null,children:[e("span",{className:"truncate",children:N}),x&&e(m,{size:12,className:"animate-spin text-ink/50 flex-shrink-0",role:"status","aria-label":"Generating a session name…"}),e(B,{size:13,className:"text-ink/50 flex-shrink-0"})]}),c&&e(Rt,{anchor:c,align:"start",className:"w-72 bg-paper border border-ink/15 rounded-xl shadow-lg p-2 text-xs",onClose:()=>w(null),children:[e("button",{type:"button",onClick:()=>{w(null),h()},className:"w-full text-left px-3 py-2 rounded-lg bg-ink text-canvas flex items-center space-x-2 font-medium mb-1.5",children:[e(O,{size:14}),e("span",{children:"Start New Session"})]}),e("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40",children:"Recent Sessions"}),e("div",{className:"max-h-64 scrollbar-overlay-container space-y-0.5",children:I.length===0?e("div",{className:"px-2.5 py-2 text-ink/40 italic",children:"No sessions yet"}):I.map((C)=>e("button",{type:"button",onClick:()=>{w(null),g(C.id)},className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between space-x-2 transition-colors ${String(r)===String(C.id)?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[e("span",{className:"min-w-0 flex flex-col",children:[e("span",{className:"truncate",children:C.title?C.title.charAt(0).toUpperCase()+C.title.slice(1):"Untitled"}),e("span",{className:"truncate text-[10px] text-ink/40 font-mono",children:C.folderName})]}),String(r)===String(C.id)&&e(f,{size:12,className:"flex-shrink-0"})]},C.id))})]})]})]}),e(Tf,{layout:"mobile",sessionId:r==null?null:String(r),showRightPanel:!1,onToggleRightPanel:p,entries:R,hidden:k}),P.anchor?e(Go,{anchor:P.anchor,title:"Navbar",align:"right",items:_f([...R.inline,...R.folded]).filter((C)=>C.id!==Cn.install).map((C)=>({...C,removable:!0})),hidden:k,onToggle:y,onClose:P.close}):null]})}function io({activeSessionId:t,onSelectSession:r,onNewSession:l,onOpenSessionSidebar:p,onOpenRightSidebar:h,appSettings:g={}}){let{folders:S}=Xe(),[v,x]=n(null),c=u(()=>{if(!t)return"New session";for(let k of S){let y=k.sessions?.find((P)=>String(P.id)===String(t));if(y)return y.title}return null},[t,S]);return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative",children:[e(to,{activeSessionTitle:v||c||"New session",activeSessionId:t,onOpenSessionSidebar:p,onOpenRightSidebar:h,onNewSession:l,onSelectSession:r}),e("main",{className:"flex-1 min-h-0",children:e(Rf,{appSettings:g,onSessionTitle:x,variant:"mobile"})})]})}function so({onClose:t,viewLabel:r="Sessions",menuProps:l}){return e("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas titlebar-drag-region select-none",...Qa(),...l,style:{...qo()},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(Da,{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(Df,{variant:"chip"}),e("button",{type:"button",onClick:t,className:"w-9 h-9 rounded-xl hover:bg-ink/5 active:bg-ink/10 text-ink flex items-center justify-center transition-colors cursor-pointer",title:"Close sidebar","aria-label":"Close sidebar",children:e(b,{size:19,strokeWidth:2})})]})]})}function lo({onSettings:t,onKeyBindings:r,onAbout:l,updateAvailable:p,onUpdateClick:h,onDesktopToggle:g,shellDownload:S}){return e("div",{className:"px-3 pt-3 border-t border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas text-xs text-ink/60",style:{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom, 0px))"},children:[e("div",{className:"flex items-center space-x-3",children:[e("button",{type:"button",onClick:t,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(ul,{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(wa,{size:14}),e("span",{children:"Keys"})]}),e("button",{type:"button",onClick:l,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(ce,{size:14}),e("span",{children:"About"})]}),S&&e(wf,{download:S,variant:"label"}),g&&e("button",{type:"button",onClick:g,className:"flex items-center space-x-1 hover:text-ink transition-colors",title:"Switch to desktop view",children:[e(Ca,{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",zc.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 co(t){let r=Cf(),l=xf();return Ae(Uc,()=>{t.onClose(),t.openAbout(),r.apply("kabmo").then((p)=>{if(!p)return;t.pushToast(p.message,yc(p))})}),Ef(r,t.pushToast),{updates:r,shellDownload:l}}function po(t,r,l){return t.filter((p)=>p.id!==r&&!(l&&p.side==="left"))}function mo(t){return t}var kt=8;function Le({panels:t,activeId:r,onSelect:l,hasGitChanges:p=!1}){let h=i(null),g=i(new Map),S=i({activeId:r,panels:t});S.current={activeId:r,panels:t};let v=i({signature:"",width:0}),x=a(()=>{let c=h.current,w=g.current.get(S.current.activeId);if(!c||!w||c.clientWidth<=0)return;let k=`${S.current.activeId}\x00${S.current.panels.map((N)=>N.id).join("\x00")}`,y=v.current;if(y.signature===k&&y.width===c.clientWidth)return;v.current={signature:k,width:c.clientWidth};let P=c.getBoundingClientRect(),R=w.getBoundingClientRect(),I=bf({scrollLeft:c.scrollLeft,clientWidth:c.clientWidth,scrollWidth:c.scrollWidth,start:R.left-P.left+c.scrollLeft,size:R.width},kt);if(I!==c.scrollLeft)c.scrollLeft=I},[]);return K(x,[r,t,x]),o(()=>{let c=h.current;if(!c||typeof ResizeObserver>"u")return;let w=new ResizeObserver(x);return w.observe(c),()=>w.disconnect()},[x]),e("div",{ref:h,className:"flex items-center space-x-1.5 overflow-x-auto no-scrollbar py-1",children:t.map((c)=>{let w=c.id===r;return e("button",{ref:(k)=>{if(k)g.current.set(c.id,k);else g.current.delete(c.id)},type:"button",onClick:()=>l(c.id),"aria-pressed":w,"aria-label":c.title,className:`tap-chip relative flex shrink-0 items-center transition-all cursor-pointer ${w?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:c.title,children:[e(no,{panelId:c.id,builtin:c.builtin,icon:c.builtin?c.icon:void 0,name:c.builtin?c.label:c.name,...c.iconUrl?{iconUrl:c.iconUrl}:{},...c.color?{color:c.color}:{},size:$t}),w&&e("span",{className:`shrink-0 whitespace-nowrap ${c.id==="git"?"tracking-wide":""}`,children:c.label}),c.id==="git"&&p&&e("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full bg-info",title:"Uncommitted changes"})]},c.id)})})}function uo({panels:t,activeId:r,onSelect:l,menuProps:p}){return e("div",{className:"px-3 py-1.5 border-b border-ink/10 bg-canvas flex-shrink-0",...p,children:e(Le,{panels:t,activeId:r,onSelect:l})})}function fo({panelKey:t,panel:r,body:l}){if(!r)return e("div",{className:"flex-1 min-h-0",children:e(Hc,{panelKey:t})});return e("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:e(Fe,{fallback:e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono",children:"Loading…"})}),children:e(Do,{value:l,children:r.render(l)})})})}var Re="w-9.5 h-9.5 rounded-xl border flex items-center justify-center transition-all flex-shrink-0 cursor-pointer shadow-xs",Te="border-ink/15 bg-paper hover:bg-ink/5 text-ink/80 hover:text-ink",ho="bg-ink/10 text-ink border-ink/30";function bo({searchQuery:t,sortOption:r,optionsOpen:l,showArchived:p,optionsRef:h,onNewSession:g,onNewWorkspace:S,onScheduler:v,scheduledCount:x,onRefresh:c,refreshing:w,onToggleOptions:k,onSortChange:y,onResetSort:P,onToggleArchived:R,onHideArchived:I,onSearchChange:N,onClearSearch:C,onSelectWorkspaces:A,selecting:T}){let{ref:E,width:M}=Fs(0),L=uA(M),q={};for(let X of Yd.slice(0,L))q[X]=!0;let z=Yd.slice(L),F=p?"Hide archived sessions":"Show archived sessions",te=x>0?`Scheduled tasks (${x} armed)`:"Scheduled tasks",H=[];if(z.includes("new-workspace"))H.push({id:"new-workspace",label:"New Workspace",icon:fn,onSelect:S});if(z.includes("refresh"))H.push({id:"refresh",label:"Refresh sessions",icon:D,onSelect:c});if(z.includes("scheduler"))H.push({id:"scheduler",label:te,icon:Fa,onSelect:v});if(z.includes("archive"))H.push({id:"archive",label:F,icon:st,onSelect:R,active:p});if(z.includes("select"))H.push({id:"select",label:T?"Cancel selection":"Select workspaces",icon:Fr,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:E,className:"flex items-center space-x-2",children:[e("button",{type:"button",onClick:g,"aria-label":"New Session",title:"New Session",className:"flex-1 min-w-0 h-9.5 flex items-center justify-center space-x-2 px-3.5 rounded-xl bg-ink text-canvas hover:bg-ink/90 text-xs font-semibold transition-all shadow-xs",children:[e(O,{size:15,strokeWidth:2.4,className:"shrink-0"}),e("span",{className:"min-w-0 truncate",children:"New Session"})]}),q["new-workspace"]&&e("button",{type:"button",onClick:S,className:`${Re} ${Te}`,title:"New Workspace","aria-label":"New Workspace",children:e(fn,{size:16,strokeWidth:1.8})}),q.scheduler&&e("button",{type:"button",onClick:v,className:`relative ${Re} ${Te}`,title:te,"aria-label":x>0?`Scheduled tasks, ${x} armed`:"Scheduled tasks",children:[e(Fa,{size:16,strokeWidth:1.8}),x>0&&e("span",{className:"absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-[3px] rounded-full bg-ink text-canvas text-[10px] leading-[13px] text-center font-semibold",children:x>9?"9+":x})]}),q.archive&&e("button",{type:"button",onClick:R,"aria-pressed":p,className:`${Re} ${p?"bg-warning/15 border-warning/40 text-warning":Te}`,title:F,"aria-label":F,children:e(st,{size:16,strokeWidth:1.8})}),q.select&&e("button",{type:"button",onClick:A,"aria-pressed":T,className:`${Re} ${T?ho:Te}`,title:T?"Cancel selection":"Select workspaces","aria-label":T?"Cancel selection":"Select workspaces",children:e(Fr,{size:16,strokeWidth:1.8})}),q.refresh&&e("button",{type:"button",onClick:c,className:`${Re} ${Te}`,title:"Refresh sessions","aria-label":"Refresh sessions","aria-busy":w,children:e(D,{size:15,strokeWidth:1.8,className:w?"animate-spin":void 0})}),q.sort&&e("div",{className:"relative flex-shrink-0",ref:h,children:[e("button",{type:"button",onClick:k,className:`${Re} ${l||r!=="A-Z"?ho:Te}`,title:"Sort workspaces","aria-label":"Sort workspaces",children:e(Rs,{size:15,strokeWidth:1.8})}),l&&e("div",{className:"glass-popover absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 rounded-xl shadow-xl z-50 p-2 text-xs",children:e(Wo,{variant:"mobile",sortOption:r,onSortChange:y})})]}),z.length>0&&e(Su,{actions:H,sortHidden:z.includes("sort"),sortOption:r,onSortChange:y,layout:"mobile"})]}),e("div",{className:"relative flex items-center",children:[e(U,{size:14,className:"absolute left-3 text-ink/40"}),e("input",{type:"text",value:t,onChange:(X)=>N(X.currentTarget.value),placeholder:"Search workspaces & sessions...",className:"w-full bg-paper border border-ink/15 rounded-xl pl-8 pr-8 py-2 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),t&&e("button",{type:"button",onClick:C,className:"absolute right-2.5 text-ink/40 hover:text-ink p-1","aria-label":"Clear search",children:e(b,{size:13})})]}),(p||r!=="A-Z")&&e("div",{className:"flex items-center space-x-1.5 flex-wrap gap-y-1 pt-0.5",children:[r!=="A-Z"&&e("span",{className:"inline-flex items-center space-x-1 bg-ink/5 border border-ink/10 text-ink/80 rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e("span",{children:["Sort: ",r.replace("_"," ")]}),e("button",{type:"button",onClick:P,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(st,{size:10}),e("span",{children:"Archived"}),e("button",{type:"button",onClick:I,className:"hover:text-warning-hover ml-0.5",title:"Hide archived",children:e(b,{size:10})})]})]})]})}var yt="p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink";function go({folder:t,canWorktree:r,onOpenFolder:l,onNewWorktree:p,onSelectSessions:h,confirmDelete:g,onPin:S,onDelete:v,onRequestDelete:x,onCancelDelete:c}){let[w,k]=n(!1),y=i(null),[P,R]=n(null),I=(N)=>()=>{k(!1),N()};return e("div",{className:"relative flex items-center",onClick:(N)=>N.stopPropagation(),children:[e("button",{ref:y,type:"button",onClick:(N)=>{if(N.stopPropagation(),y.current)R(Bt(y.current));k((C)=>!C)},className:yt,title:"Workspace options","aria-label":`Options for ${t.name}`,"aria-haspopup":"menu","aria-expanded":w,children:e(Ee,{size:15})}),e(Rt,{anchor:w?P:null,align:"end",ariaLabel:`Options for ${t.name}`,className:"w-48 rounded-lg border border-ink/15 bg-paper py-1 text-xs shadow-lg",onClose:()=>{k(!1),c()},children:e(Gs,{variant:"mobile",isPinned:t.isPinned,onOpenFolder:l?I(l):void 0,onNewWorktree:r&&p?I(p):void 0,onSelectSessions:h?I(h):void 0,confirmDelete:g,onPin:I(S),onDelete:I(v),onRequestDelete:x,onCancelDelete:c})})]})}var vo={inset:"",insetPx:0,slotWidth:16,markGap:8,padding:"py-2",glyph:nt.touch};function So({session:t,harness:r,isActive:l,status:p,awaitingInput:h=!1,timeAgo:g,timeTitle:S,runStartedAt:v,expandable:x=!1,isExpanded:c=!1,onToggleExpand:w,isChild:k=!1,folderId:y,onSelect:P,onArchive:R,onDelete:I,onRename:N,onRenameWithAi:C,waitingFor:A,onCancelWait:T,selectable:E=!1,selected:M=!1,onToggleSelect:L}){let{isEditing:q,draft:z,setDraft:F,inputRef:te,startRename:H,handleKeyDown:X,handleBlur:ae}=Oo(t.title,N),W=Na(t.id),ne=$o(),ie=ne.anchor!==null,ee=Boolean(N||R||I||T),J=Boolean(A),pe=x&&Boolean(w),Q=t.title.charAt(0).toUpperCase()+t.title.slice(1);if(q)return e("div",{className:"w-full rounded-lg flex items-center bg-ink/10",children:e("input",{ref:te,autoFocus:!0,value:z,onChange:(oe)=>F(oe.currentTarget.value),onKeyDown:X,onBlur:ae,className:"flex-1 min-w-0 mx-2 my-1.5 bg-paper border border-ink/25 rounded px-2 py-1 text-xs text-ink outline-none focus:border-ink/50"})});return e(d,{children:[e("div",{"data-testid":"session-item","data-session-id":String(t.id),"data-menu-open":ie?"true":void 0,onContextMenu:ee&&!E?ne.openAtCursor:void 0,className:`w-full rounded-lg flex items-center transition-colors ${E&&M||ie?Us:l?"bg-ink/10 font-medium text-ink":"hover:bg-ink/5 text-ink/85"}`,children:[e("button",{type:"button",onClick:E?L:P,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:[E?e(Lr,{checked:M,label:`Select ${t.title}`,onChange:()=>L?.()}):e("span",{className:"w-4 flex-shrink-0 flex items-center justify-center",children:W?e("span",{role:"status","aria-label":"Generating a name…",children:e(m,{size:13,className:"text-ink/50 animate-spin"})}):h?e(Qe,{size:13,className:"text-ink/70 animate-pulse"}):J?e("span",{role:"status","aria-label":`Waiting for ${A?.title??"another session"}`,children:e(We,{size:13,className:"text-ink/60 animate-pulse"})}):p==="stream"?e("span",{role:"status","aria-label":"Running",children:e(m,{size:13,className:"text-ink/50 animate-spin"})}):p?e(f,{size:13,className:"text-ink/50"}):k?e("span",{"data-testid":"child-indicator",className:"text-ink/35","aria-hidden":"true",children:e(fe,{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(Ze,{harness:r,size:nt.touch})}),e("span",{className:"min-w-0 truncate text-xs",children:Q})]}),J&&e("span",{className:"text-[10px] text-ink/40 truncate",children:["waiting for ",A?.title??"another session"]}),t.worktree?e(Os,{worktree:t.worktree}):null]})]}),e(zs,{timeAgo:g,timeTitle:S,runStartedAt:v,className:"text-[11px] font-mono flex-shrink-0 ml-2",restingClassName:"text-ink/45"})]}),ee&&!E&&e("button",{type:"button",onClick:ne.openBelow,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":ie,className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 text-ink/35 hover:text-ink rounded-lg cursor-pointer",children:e(Ee,{size:16})}),pe&&!E&&e("button",{type:"button",onClick:w,title:c?"Collapse sessions and subagents":"Expand sessions and subagents","aria-expanded":c,"aria-label":c?"Collapse sessions and subagents":"Expand sessions and subagents",className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 flex items-center justify-center text-ink/50 hover:text-ink rounded-lg cursor-pointer",children:c?e(B,{size:14}):e(se,{size:14})})]}),ne.anchor&&e(zo,{anchor:ne.anchor,sessionId:t.id,...r?{harness:r}:{},...y!==void 0?{folderId:y}:{},isArchived:t.is_archived===1,onRename:N?H:void 0,onRenameWithAi:C,onArchive:R,onDelete:I,onCancelWait:T,onClose:ne.close})]})}function xo(t,r){let[l,p]=n(!1);return{open:()=>p(!0),dialog:l?e(Uo,{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 wo({hiddenCount:t,canShowLess:r,onShowMore:l,onShowLess:p}){if(t<=0&&!r)return null;return e("div",{className:"flex items-center gap-1",children:[t>0&&e("button",{type:"button",onClick:l,className:"flex items-center min-w-0 text-left py-2 pr-3 text-xs text-ink/60 hover:text-ink",children:[e("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:e(B,{size:12})}),e("span",{className:"w-2 shrink-0"}),e("span",{className:"truncate",children:["Show more sessions (",t,")"]})]}),r&&e("button",{type:"button",onClick:p,className:"ml-auto shrink-0 flex items-center gap-1 text-xs text-ink/60 hover:text-ink pl-3 py-2",children:[e(lt,{size:12}),e("span",{className:"truncate",children:"Show less"})]})]})}function ko(t){return t?"mb-4":"mb-1"}function yo({folder:t,activeSessionId:r,onSelectSession:l,onNewSessionForFolder:p,onNewWorktreeSession:h,isExpanded:g,onToggleExpand:S,showArchived:v=!1,sessionStatus:x={},onToast:c,batch:w,onStartSessionSelection:k,onCancelWait:y}){let{visibleCount:P,showMore:R,showLess:I,canShowLess:N}=Ms(),C=xo(t,(G)=>h?.(t.id,G)),{refresh:A,runStartedAtMap:T}=Xe(),{expandedSessionIds:E,toggleSession:M}=Es(),[L]=le(),q=L.get("subagent"),z=L.get("sessionId"),{confirmDelete:F,requestDelete:te,cancelDelete:H,handlePin:X,handleDelete:ae,handleArchive:W,handleRename:ne,handleRenameWithAi:ie,handleOpenFolder:ee}=Ps(t,A,c),J=Mo(),pe=X,Q=ae,oe=ee??void 0,me=(t.sessions||[]).filter((G)=>v?G.is_archived===1:G.is_archived!==1),we=ia(t.icon),{folderCheckbox:he,sessionCheckboxes:ue,folderSummary:V,toggleFolderSelection:j,rendered:Y,hiddenCount:ke}=qs({batch:w,folder:t,sessions:me,showArchived:v,visibleCount:P,activeSessionId:r,sessionStatus:x}),Ce=Vo(Y),ve=g||ue,ye=(G,Pe)=>{let be=String(G.id),Ge=String(r)===be,bt=Ge&&z===be&&Boolean(q),He=_t(be);return e(So,{session:G,harness:G.harness,folderId:G.folder_id,isActive:Ge&&!bt,status:x[be],awaitingInput:Boolean(G.awaitingInput),timeAgo:$s(G.updated_at??G.created_at),timeTitle:Ko(G.updated_at??G.created_at),runStartedAt:x[be]==="stream"?T[be]:void 0,expandable:Pe.expandable,isChild:Pe.isChild,isExpanded:Pe.isExpanded,onToggleExpand:Pe.onToggleExpand,onSelect:()=>l(G.id),onArchive:()=>W(G),onDelete:He?void 0:()=>J.requestDelete(G),onRename:He?void 0:(vt)=>void ne(G,vt),onRenameWithAi:He?void 0:()=>void ie(G),waitingFor:G.waitingFor?{title:G.waitingFor.title}:void 0,onCancelWait:G.waitingFor?()=>y?.(G.waitingFor.waitId):void 0,selectable:ue,selected:Boolean(w?.selected.includes(be)),onToggleSelect:w?()=>w.toggle(be):void 0})},ht=(G)=>js(G,Ce.childrenOf,E,M);return e("div",{className:ko(ve),"data-testid":"session-folder",children:[e("div",{onClick:w?void 0:S,className:"flex items-center justify-between gap-2 py-1 cursor-pointer hover:bg-ink/5 rounded-lg select-none transition-colors",children:[e("div",{className:"flex items-center space-x-2 min-w-0",children:[he&&V?e(Lr,{size:"md",checked:V.all,indeterminate:V.some,label:`Select ${t.name}`,onChange:j}):e(d,{children:e("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:t.customIconUrl?e("img",{src:t.customIconUrl,alt:"",className:"w-[15px] h-[15px] rounded-xs object-contain",referrerPolicy:"no-referrer"}):t.iconType==="chat"?e(gn,{size:15,className:"text-ink/80"}):e(we,{size:15,className:"text-ink/80",style:{color:t.accentColor||void 0}})})}),e("span",{className:"text-sm font-semibold text-ink truncate",children:t.name})]}),e("div",{className:"flex items-center space-x-2 text-xs text-ink/60",children:[e("span",{className:"font-mono text-[11px] text-ink/70",children:me.length}),t.project_path&&e(fe,{size:13,className:"text-ink/50 ml-1"}),!w&&e(d,{children:[e("button",{type:"button",onClick:(G)=>{G.stopPropagation(),p(t.id)},className:"p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink",title:"New Session","aria-label":`New session in ${t.name}`,children:e(O,{size:15})}),e(go,{folder:t,canWorktree:Boolean(h&&t.project_path),onOpenFolder:oe,onNewWorktree:h?()=>C.open():void 0,onSelectSessions:k?()=>k(t.id):void 0,confirmDelete:F,onPin:pe,onDelete:Q,onRequestDelete:te,onCancelDelete:H}),e("span",{className:"flex items-center justify-center pr-1",children:g?e(B,{size:14}):e(se,{size:14})})]})]})]}),ve&&e("div",{className:"mt-0.5 space-y-0.5",children:[Ce.roots.map((G)=>{let Pe=String(G.id),be=ht(G);return e("div",{className:"space-y-0.5",children:[ye(G,be),be.isExpanded&&e(Ti,{parentId:Pe,hasSubagents:Boolean(G.hasSubagents),childrenOf:Ce.childrenOf,expandedIds:E,onToggle:M,activeSessionId:r===null?null:String(r),renderSession:ye,style:vo})]},G.id)}),e(wo,{hiddenCount:ue?0:ke,canShowLess:!ue&&N,onShowMore:R,onShowLess:I})]}),e(Po,{session:J.pending,isDeleting:J.isDeleting,error:J.error,onClose:J.cancelDelete,onConfirm:()=>void J.confirmDelete()}),C.dialog]})}function No({folders:t,activeSessionId:r,expandedFolders:l,showArchived:p,sessionStatus:h,onSelectSession:g,onNewSessionForFolder:S,onNewWorktreeSession:v,onToggleFolder:x,onToast:c,batch:w,onStartSessionSelection:k,onCancelWait:y}){return e("div",{className:"flex-1 scrollbar-overlay-container pl-3 pr-2 py-3",children:t.length===0?e("div",{className:"text-center py-12 text-xs text-ink/50 italic",children:"No matching sessions found"}):t.map((P)=>e(yo,{folder:P,activeSessionId:r,onSelectSession:g,onNewSessionForFolder:S,onNewWorktreeSession:v,isExpanded:l[P.id]??!0,onToggleExpand:()=>x(P.id),showArchived:p,sessionStatus:h,onToast:c,batch:w,onStartSessionSelection:k,onCancelWait:y},P.id))})}var Ct=[3,2];function Co(){return e("div",{className:"flex-1 p-3 space-y-4","aria-hidden":"true",children:Ct.map((t,r)=>e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center gap-2 py-2",children:[e("span",{className:"w-4 h-4 rounded-sm animate-pulse bg-ink/10"}),e("span",{className:"h-3 w-24 rounded animate-pulse bg-ink/10"})]}),Array.from({length:t},(l,p)=>e("div",{className:"flex items-center gap-2 rounded py-2",children:[e("span",{className:"w-4 h-4 rounded-full animate-pulse bg-ink/10"}),e("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${58-p%3*12}%`}})]},p))]},r))})}function Ro({folders:t,initializing:r,failed:l,activeSessionId:p,expandedFolders:h,sessionStatus:g,searchQuery:S,sortOption:v,optionsOpen:x,showArchived:c,harnessFilter:w,onHarnessFilterChange:k,harnessOptions:y,optionsRef:P,scheduledCount:R,refreshing:I,selecting:N,batch:C,onNewSession:A,onNewWorkspace:T,onScheduler:E,onRefresh:M,onToggleOptions:L,onSortChange:q,onResetSort:z,onToggleArchived:F,onHideArchived:te,onSearchChange:H,onClearSearch:X,onSelectWorkspaces:ae,onSelectSession:W,onNewSessionForFolder:ne,onNewWorktreeSession:ie,onToggleFolder:ee,onToast:J,onStartSessionSelection:pe,onCancelWait:Q}){return e(d,{children:[e(bo,{searchQuery:S,sortOption:v,optionsOpen:x,showArchived:c,optionsRef:P,onNewSession:A,onNewWorkspace:T,onScheduler:E,scheduledCount:R,onRefresh:M,refreshing:I,onToggleOptions:L,onSortChange:q,onResetSort:z,onToggleArchived:F,onHideArchived:te,onSearchChange:H,onClearSearch:X,onSelectWorkspaces:ae,selecting:N}),e("div",{className:"px-3 pt-2 pb-1",children:e(Ls,{options:y,value:w,onChange:k,touch:!0})}),l?e(Hs,{touch:!0,onRetry:M,refreshing:I}):r?e(Co,{}):e(No,{folders:t,activeSessionId:p,expandedFolders:h,showArchived:c,sessionStatus:g,onSelectSession:W,onNewSessionForFolder:ne,onNewWorktreeSession:ie,onToggleFolder:ee,onToast:J,batch:C,onStartSessionSelection:pe,onCancelWait:Q})]})}function To({sidebarStyle:t,controller:r,batch:l,dock:p,dockBody:h,expandedFolders:g,optionsRef:S,activeSessionId:v,scheduledCount:x,onToggleFolder:c,onNewSession:w,onNewWorkspace:k,onScheduler:y,onToggleArchived:P,onNewSessionForFolder:R,onNewWorktreeSession:I,onToast:N,onArchiveSelected:C,onCancelWait:A}){let{initializing:T,failed:E,refreshNow:M,isRefreshing:L,searchQuery:q,setSearchQuery:z,showArchived:F,setShowArchived:te,optionsOpen:H,setOptionsOpen:X,sortOption:ae,handleSortChange:W,harnessFilter:ne,setHarnessFilter:ie,harnessOptions:ee,processedFolders:J,sessionStatus:pe,handleSelectSession:Q}=r,{selection:oe,deleteRun:me,archiveRun:we,binding:he,scopeFolder:ue,available:V,selected:j}=l,Y={className:"flex-1 min-h-0 w-full",folders:J,initializing:T,failed:E,activeSessionId:v,sessionStatus:pe,searchQuery:q,onSearchChange:z,showArchived:F,onToggleArchived:P,sortOption:ae,optionsOpen:H,onToggleOptions:()=>X(!H),onCloseOptions:()=>X(!1),onSortChange:W,harnessFilter:ne,onHarnessFilterChange:ie,harnessOptions:ee,onRefresh:M,refreshing:L,scheduledCount:x,onNewSession:w,onNewWorkspace:k,onScheduler:y,onSelectSession:Q,onNewSessionForFolder:R,onNewWorktreeSession:I,onToast:N,onCancelWait:A,batch:he,onSelectWorkspaces:l.toggleWorkspaceSelection,onStartSessionSelection:(ke)=>oe.begin("session",ke)};return e(d,{children:[e("div",{className:p.showingSessions?"contents":"hidden",children:[t==="modern"?e(Tu,{...Y,touch:!0}):e(Ro,{folders:J,initializing:T,failed:E,activeSessionId:v,expandedFolders:g,sessionStatus:pe,searchQuery:q,sortOption:ae,optionsOpen:H,showArchived:F,harnessFilter:ne,onHarnessFilterChange:ie,harnessOptions:ee,optionsRef:S,scheduledCount:x,refreshing:L,selecting:oe.mode!==null,batch:he,onNewSession:w,onNewWorkspace:k,onScheduler:y,onRefresh:M,onToggleOptions:()=>X(!H),onSortChange:W,onResetSort:()=>W("A-Z"),onToggleArchived:P,onHideArchived:()=>te(!1),onSearchChange:z,onClearSearch:()=>z(""),onSelectWorkspaces:l.toggleWorkspaceSelection,onSelectSession:Q,onNewSessionForFolder:R,onNewWorktreeSession:I,onToggleFolder:c,onToast:N,onStartSessionSelection:(ke)=>oe.begin("session",ke),onCancelWait:A}),oe.mode&&e(Fu,{drawer:!0,mode:oe.mode,count:j.length,total:V.length,busy:me.isDeleting,archiving:we.isArchiving,scopeLabel:ue?.name,onSelectAll:()=>oe.selectAllOf(V),onUnselectAll:()=>oe.unselectAllOf(V),onDelete:()=>me.request(j),onArchive:C,onCancel:oe.end})]}),p.showingSessions?null:e(fo,{panelKey:p.activeView,panel:p.activePanel,body:h})]})}function Eo(t,r){let l=t.tabs;_s({enabled:t.tabsMode,revealed:yf(r),storedView:t.activeView,home:l?.home??!1,chosenHome:l?.chosenHome??!1,openTab:l?.open??null,known:new Set(t.catalog.map((g)=>g.id))});let p=i(!1),h=l?{...l,select:(g)=>{p.current=!0,l.select(g)},open:(g)=>{p.current=!0,l.open(g)},close:(g)=>{p.current=!0,l.close(g)}}:null;return o(()=>{if(!t.tabsMode||!l)return;if(l.active!==null&&l.active!==t.activeView)t.setActiveView(l.active)},[t.tabsMode,l?.active,t.activeView,t.setActiveView]),o(()=>{if(!t.tabsMode||!l)return;if(p.current){p.current=!1;return}if(l.tabs.includes(t.activeView))return;if(!t.catalog.some((g)=>g.id===t.activeView))return;l.open(t.activeView)},[t.tabsMode,l,t.activeView,t.catalog]),{tabs:h}}function Be(t){return{dragRegion:!0,layout:"mobile",rootProps:{...Qa(),...t},style:{paddingLeft:wi(xi("0.75rem",!0)),paddingRight:Tl("0.75rem",!0)}}}function Ao({side:t,onClose:r}){let l=t==="left"?an:Xn;return e("button",{type:"button",onClick:r,className:`${je.mobile} flex-none cursor-pointer rounded-lg text-ink/60 transition-colors hover:bg-ink/5 hover:text-ink titlebar-no-drag`,title:t==="left"?"Tutup panel kiri":"Tutup panel kanan","aria-label":t==="left"?"Close left sidebar":"Close right sidebar",children:e(l,{size:Nr.mobile,strokeWidth:1.8})})}function Io({activeSessionId:t,newWorkspaceOpen:r,onCloseNewWorkspace:l,schedulerOpen:p,onCloseScheduler:h,aboutOpen:g,onCloseAbout:S,updates:v,pushToast:x,batchDelete:c,batchMode:w,onEndBatch:k,scopeLabel:y}){return e(d,{children:[e(ks,{isOpen:r,onClose:l,onCreate:_l,onClone:Sl}),e(_u,{isOpen:p,onClose:h,activeSessionId:t===null?null:String(t),onToast:x}),e(Cd,{isOpen:g,onClose:S,updates:v,onToast:x}),e(kf,{updates:v}),e(Lu,{mode:w??"session",count:c.pending.length,scopeLabel:y,isDeleting:c.isDeleting,progress:c.progress,outcome:c.outcome,onClose:()=>{let P=c.outcome?.refused.length??0;if(c.cancel(),c.outcome&&P===0)k()},onConfirm:()=>{let P=w??"session";c.confirm(P).then((R)=>{if(R&&R.refused.length===0)k()})}})]})}function Lo(){let t=Nt(),r=or("left"),[l,p]=Ya("layout.mobileLeftPanel",De),h=Af(l,t.enabled),g=Ud("left"),S=t.enabled&&g==="tabs",v=u(()=>new Set(r.map((c)=>c.id)),[r]),x=Is("left",v,De);return{catalog:r,activeView:h,setActiveView:p,showingSessions:h===De,activePanel:r.find((c)=>c.id===h),enabled:t.enabled,tabsMode:S,tabs:S?x:null}}function Bo(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 _o({appSettings:t,onSelectSession:r,onClose:l,rootPath:p,refreshKey:h,onRefresh:g,onOpenFile:S}){let v=Du(t,{onSelectSession:r,onAfterSelect:l}),{folders:x,processedFolders:c,refreshNow:w,showArchived:k,activeSessionId:y}=v,P=Ru(c,k,w),[R,I]=n({1:!0,2:!0,3:!0}),N=i(null);de(N,()=>v.setOptionsOpen(!1));let C=(M)=>{I((z)=>({...z,[M]:!z[M]}));let L=x.find((z)=>z.id===M),q=!(R[M]??L?.isExpanded??!0);Jd(M,q)},A=c.map((M)=>`${M.id}:${M.isExpanded}`).join("|");o(()=>{I(Object.fromEntries(c.map((M)=>[M.id,M.isExpanded])))},[A]);let T=Lo(),E=Bo({sessionId:y,refreshKey:h,rootPath:p,onRefresh:g,onOpenFile:S,onClose:l,requiresWorkspace:T.activePanel?.requiresWorkspace??!1,hasActiveContext:Boolean(p)});return{controller:v,batch:P,expandedFolders:R,toggleFolder:C,optionsRef:N,dock:T,dockBody:E}}function _e(t){let{disabledPanels:r}=hn(),{setEnabled:l}=ml(),p=Ie(),h=hf(t),g=a((S,v)=>{l(S,v)},[l]);return{...p,items:h,hidden:r,toggle:g}}function jo({activeSessionId:t,onSelectSession:r,onNewSession:l,onNewSessionForFolder:p,onNewWorktreeSession:h,onClose:g,onDesktopToggle:S,appSettings:v={},rootPath:x,refreshKey:c=0,onRefresh:w,onOpenFile:k,revealSignal:y=0}){let{controller:P,batch:R,expandedFolders:I,toggleFolder:N,optionsRef:C,dock:A,dockBody:T}=_o({appSettings:v,onSelectSession:r,onClose:g,rootPath:x,refreshKey:c,onRefresh:w,onOpenFile:k}),{showArchived:E,setShowArchived:M}=P,{selection:L,deleteRun:q,archiveRun:z,selected:F,scopeFolder:te}=R,H=xd(),X=_e("left"),[ae,W]=n(!1),[ne,ie]=n(!1),ee=Iu(),[J,pe]=n(!1),{pushToast:Q}=Ke(),oe=Il(Q);Nu({onNotice:Q});let{updates:me,shellDownload:we}=co({onClose:g,openAbout:()=>pe(!0),pushToast:Q}),{tabs:he}=Eo(A,y),ue=()=>{l(),g()},V=()=>{z.archive(F).then((ve)=>{if(!ve)return;let ye=Qu(ve);if(ye)Q(ye.message,ye.tone);if(!ve.error)L.end()})},j=(ve)=>{p(ve),g()},Y=()=>{M(!E)},ke=h?(ve,ye)=>{h(ve,ye),g()}:void 0,Ce=e(To,{sidebarStyle:H,controller:P,batch:R,dock:A,dockBody:T,expandedFolders:I,optionsRef:C,activeSessionId:t,scheduledCount:ee,onToggleFolder:N,onNewSession:ue,onNewWorkspace:()=>W(!0),onScheduler:()=>ie(!0),onToggleArchived:Y,onNewSessionForFolder:j,...ke?{onNewWorktreeSession:ke}:{},onToast:Q,onArchiveSelected:V,onCancelWait:oe});return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative select-none",children:[e(so,{onClose:g,viewLabel:A.showingSessions?"Sessions":A.activePanel?.label??"Panel",menuProps:X.surfaceProps}),!A.tabsMode&&mo(A.enabled)?e(uo,{panels:A.catalog,activeId:A.activeView,onSelect:A.setActiveView,menuProps:X.surfaceProps}):null,A.tabsMode&&he?e("div",{className:"flex-1 min-h-0 flex flex-col",children:e(Bs,{catalog:A.catalog,tabs:he,pinned:De,homeTitle:"Panel kiri",stripProps:Be(X.surfaceProps),children:e("div",{className:"h-full w-full",children:Ce})})}):null,X.anchor?e(Go,{anchor:X.anchor,items:X.items,hidden:X.hidden,onToggle:X.toggle,onClose:X.close}):null,A.tabsMode?null:e("div",{className:"contents",children:Ce}),e(lo,{onSettings:()=>window.dispatchEvent(new CustomEvent("omp:open-settings",{detail:{}})),onKeyBindings:Kc,onAbout:()=>pe(!0),shellDownload:we,onDesktopToggle:S,updateAvailable:me.hasUpdate,onUpdateClick:()=>{pe(!0),me.check()}}),e(Io,{activeSessionId:t,newWorkspaceOpen:ae,onCloseNewWorkspace:()=>W(!1),schedulerOpen:ne,onCloseScheduler:()=>ie(!1),aboutOpen:J,onCloseAbout:()=>pe(!1),updates:me,pushToast:Q,batchDelete:q,batchMode:L.mode,onEndBatch:L.end,scopeLabel:te?.name})]})}function Xo({catalog:t,activeId:r,onSelect:l,hasGitChanges:p,onClose:h,menuProps:g}){return e("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas titlebar-drag-region select-none",...Qa(),...g,style:qo(),children:[e("div",{className:"flex items-center min-w-0 titlebar-no-drag",children:e(Le,{panels:t,activeId:r,onSelect:l,hasGitChanges:p})}),e("button",{type:"button",onClick:h,className:"p-1.5 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 ml-2 titlebar-no-drag",title:"Close right sidebar","aria-label":"Close right sidebar",children:e(b,{size:20,strokeWidth:1.8})})]})}function Ve({panel:t,body:r}){if(!t)return e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e(Fe,{fallback:e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono",children:"Loading…"})}),children:e(Do,{value:r,children:t.render(r)})})}function Yo({enabled:t=!0,rootPath:r,refreshKey:l=0,onRefresh:p,onOpenFile:h,onClose:g,revealSignal:S=0}){let[v,x]=Ya("layout.mobileRightPanel",hc),{sessionId:c}=Ue(),w=Nt(),k=po(or("all"),De,w.enabled),y=k.find((W)=>W.id===v)??k[0],R=Ud("right")==="tabs",I=u(()=>new Set(k.map((W)=>W.id)),[k]),N=Is("right",I,null),C=xe(c,"layout.mobileRightPanel")!==void 0;_s({enabled:R,revealed:yf(S),storedView:C?v:null,home:N.home,chosenHome:N.chosenHome,openTab:N.open,known:I});let{open:A,tabs:T}=N,E=(W)=>{if(W!==y?.id)Me(W)},M=i(!1),L={...N,select:(W)=>{M.current=!0,E(W),N.select(W)},open:(W)=>{M.current=!0,E(W),N.open(W)},close:(W)=>{M.current=!0,N.close(W)}};o(()=>{if(!R)return;if(N.active!==null&&N.active!==v)x(N.active)},[R,N.active,v,x]),o(()=>{if(!R||N.home)return;if(M.current){M.current=!1;return}if(!C)return;if(T.includes(v)||!I.has(v))return;A(v)},[R,N.home,C,v,T,A,I]);let q=fm(r,t),{changes:z}=dl(r,q,t),F=z.length>0,te=a((W)=>{if(W!==y?.id)Me(W);x(W)},[y?.id,x]);o(()=>{if(!ze(y?.id))xc()},[y?.id]);let H=_e(w.enabled?"right":"all"),X=w.enabled?H.items:H.items.filter((W)=>W.id!==De),ae={className:"h-full w-full",enabled:t||!y?.requiresWorkspace,active:!0,refreshKey:l,...r?{rootPath:r}:{},onRefresh:p,onOpenFile:h,onClose:g,showHeader:!1,layout:"phone"};return e("div",{className:"flex flex-col h-full w-full bg-paper text-ink relative select-none",children:[R?null:e(Xo,{catalog:k,activeId:y?.id??v,onSelect:te,hasGitChanges:F,onClose:g,menuProps:H.surfaceProps}),R?e("div",{className:"flex-1 min-h-0 flex flex-col",children:e(Bs,{catalog:k,tabs:L,homeTitle:"Panel kanan",stripProps:Be(H.surfaceProps),actions:e(Ao,{side:"right",onClose:g}),children:e("div",{className:"h-full w-full",children:e(Ve,{panel:y,body:ae})})})}):null,H.anchor?e(Go,{anchor:H.anchor,align:"right",items:X,hidden:H.hidden,onToggle:H.toggle,onClose:H.close}):null,R?null:e("div",{className:"flex-1 min-h-0 overflow-hidden relative",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:e(Ve,{panel:y,body:ae})})]})}function Ne({label:t,onClick:r,active:l=!1,danger:p=!1,children:h}){let g=p?"bg-error text-canvas hover:bg-error/90":l?"bg-ink text-canvas":"text-ink/70 hover:bg-ink/10 hover:text-ink";return e("button",{type:"button",onClick:r,title:t,"aria-label":t,"aria-pressed":l||void 0,className:`${je.mobile} flex-none cursor-pointer rounded-lg transition-colors ${g}`,children:h})}var Se=Nr.mobile;function Zo({actions:t}){let[r,l]=n(!1),p=i(null);return de(p,()=>l(!1),r),o(()=>{if(!r)return;let h=(g)=>{if(g.key==="Escape")l(!1)};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[r]),e("div",{className:"relative flex-none",ref:p,children:[e("button",{type:"button",onClick:()=>l((h)=>!h),title:"More file actions","aria-label":"More file actions","aria-haspopup":"menu","aria-expanded":r,className:`${je.mobile} flex-none cursor-pointer rounded-lg text-ink/70 transition-colors hover:bg-ink/10 hover:text-ink`,children:e(Ee,{size:Nr.mobile})}),r?e("div",{role:"menu","aria-label":"File actions",className:"absolute right-0 top-full z-50 mt-1 w-52 overflow-hidden rounded-xl border border-ink/15 bg-paper py-1 text-xs shadow-lg",children:t.map((h)=>{let g=h.icon;return e("button",{type:"button",role:"menuitem",onClick:()=>{l(!1),h.onSelect()},className:"flex w-full items-center gap-2 px-3 py-2.5 text-left text-ink/80 transition-colors hover:bg-ink/5 hover:text-ink",children:[e(g,{size:15,className:"flex-none text-ink/60"}),e("span",{className:"truncate",children:h.label})]},h.id)})}):null]})}var Pt=420;function Jo({fileName:t,hasPreview:r,isPreview:l,hasReview:p,isReviewing:h,onToggleReview:g,wordWrap:S,copied:v,byteViewer:x=!1,missing:c=!1,onSave:w,onClose:k,onTogglePreview:y,onToggleFind:P,findOpen:R,onToggleWrap:I,onZoomOut:N,onZoomIn:C,onCopy:A,onDownload:T}){let E=Vc(Pt),M=u(()=>{let L=[];if(!x)L.push({id:"wrap",label:S?"Word wrap: on":"Word wrap: off",icon:on,onSelect:I},{id:"zoom-out",label:"Decrease font size",icon:Oa,onSelect:N},{id:"zoom-in",label:"Increase font size",icon:Pa,onSelect:C});if(!E)L.push({id:"copy",label:v?"Copied":"Copy content",icon:v?f:re,onSelect:A},{id:"download",label:"Download file",icon:ge,onSelect:T});return L},[x,E,S,v,I,N,C,A,T]);return e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between gap-1 px-3 flex-shrink-0 titlebar-drag-region",style:qo(),children:[e("div",{className:"flex items-center gap-1 min-w-0 titlebar-no-drag",children:[e(Ne,{label:"Close editor",onClick:k,children:e(sn,{size:Se,strokeWidth:2})}),e("div",{className:"flex min-w-0 items-center gap-1.5",children:[e(dt,{name:t,size:15,className:`flex-shrink-0${c?" text-error":""}`}),e("span",{className:`truncate font-semibold text-xs${c?" text-error line-through":" text-ink"}`,children:t})]})]}),e("div",{className:"flex flex-none items-center gap-0.5 text-ink/70 titlebar-no-drag",children:[c&&w&&e(Ne,{label:"Save and recreate the file",onClick:w,danger:!0,children:e(gt,{size:Se})}),!x&&e(Ne,{label:R?"Close find":"Find in file",onClick:P,active:R,children:e(U,{size:Se})}),p&&e(Ne,{label:h?"Exit review mode":"Review this document",onClick:g,active:h,children:e(gn,{size:Se})}),r&&e(Ne,{label:l?"View source":"Show preview",onClick:y,active:l,children:l?e(Dt,{size:Se}):e(Ye,{size:Se})}),E&&e(d,{children:[e(Ne,{label:"Copy content",onClick:A,children:v?e(f,{size:Se,className:"text-success"}):e(re,{size:Se})}),e(Ne,{label:"Download file",onClick:T,children:e(ge,{size:Se})})]}),M.length>0&&e(Zo,{actions:M})]})]})}function et({fileName:t,content:r,path:l,root:p,repo:h,fontSize:g,scrollRef:S,onScroll:v,isLoading:x,unsupported:c,loadError:w,reviewActive:k,onExitReview:y}){return e("div",{ref:S,onScroll:v,"data-testid":"editor-scroller",className:"flex-1 min-h-0 overflow-auto relative bg-paper text-ink select-text",children:x?e("div",{className:"flex items-center justify-center h-full text-ink/40 text-xs gap-2",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading file content..."})]}):c?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(Xc,{size:20,className:"text-ink/40"}),e("span",{className:"text-xs text-ink/70 font-sans",children:[t," cannot be opened here"]}),e("span",{className:"text-[11px] text-ink/50 font-sans max-w-[42ch]",children:c})]}):w?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(_,{size:20,className:"text-error"}),e("span",{className:"text-xs text-error font-sans",children:["Could not read ",t]}),e("span",{className:"text-[11px] text-ink/50 font-mono break-all",children:w})]}):e("div",{className:"p-4 bg-paper text-ink min-h-full font-sans",style:{fontSize:`${g}px`},children:e(tu,{content:r,file:{name:t,path:l,root:p,repo:h},active:k,onExit:y})})})}function ot({file:t,editor:r,viewerKind:l,byteViewer:p,isPreview:h,isMd:g,content:S,language:v,wordWrap:x,fileKey:c,revealMarks:w,currentMark:k,surfaceRef:y,setCodeScroller:P,previewRef:R,scroll:I,fontSize:N,reviewActive:C,onExitReview:A,editorTheme:T,editorFontFamily:E,indentUnitText:M,typing:L}){let q=a(async(z)=>{let F=await su(t,z,{interactive:!0,baseMtimeMs:r.baseMtimeMs});if(F.status==="written")return{ok:!0};if(F.status==="conflict")return{ok:!1,error:"This file changed on disk since it was opened."};if(F.status==="needs-permission")return{ok:!1,error:"Tap Save again to grant write access."};return{ok:!1,error:F.error}},[t,r.baseMtimeMs]);if(r.isImage&&r.imageUrl)return e(Ii,{src:r.imageUrl,name:t.name,className:"flex-1 min-h-0"});if(r.isImage||iu(l)&&(p||h))return e(Ql,{kind:l,path:t.path??t.name,name:t.name,source:r.byteSource,content:r.content,root:t.root,repo:t.repo,revision:r.revision,onContentChange:r.onChange,onSaveBytes:r.deviceBacked?void 0:q,onDirtyChange:r.setBinaryDirty});if(r.isLoading||r.unsupported||r.loadError||g&&h)return e(et,{fileName:t.name,content:S,path:t.path??t.name,root:t.root,repo:t.repo,fontSize:N,scrollRef:R,onScroll:I.onScroll,isLoading:r.isLoading,unsupported:r.unsupported,loadError:r.loadError,reviewActive:C,onExitReview:A});return e(ru,{ref:y,value:S,onValueChange:r.onChange,language:v,wordWrap:x,documentKey:c,marks:w,currentMark:k,onScroller:P,scrollTestId:"editor-scroller",className:"flex-1 min-h-0 text-ink select-text",themeVars:T.vars,themes:T.themes,indentUnitText:M,typing:L,padding:12,placeholder:"This file is empty",style:{fontFamily:E,fontSize:`${N}px`,lineHeight:gs}})}function tt(){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 it({isImage:t,byteViewer:r,viewerKind:l,lineCount:p,charCount:h,language:g,saveStatus:S,path:v,conflicts:x=0}){return e("footer",{className:"bg-canvas border-t border-ink/10 px-3 flex items-center justify-between text-[10px] text-ink/60 flex-shrink-0 font-mono",style:{height:"calc(1.75rem + env(safe-area-inset-bottom, 0px))",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px))"},children:[e("div",{className:"flex items-center space-x-3",children:t?e("span",{className:"uppercase",children:"Image"}):r?e("span",{className:"uppercase",children:Ho[l]}):e(d,{children:[x>0&&e("span",{className:"text-error font-semibold tabular-nums",children:["⚠ ",x]}),e("span",{children:[p," lines"]}),e("span",{children:[h," chars"]}),e("span",{className:"uppercase",children:g})]})}),e("div",{className:"flex items-center space-x-2",children:[S==="saving"&&e(d,{children:[e(m,{size:10,className:"animate-spin"}),e("span",{children:"Saving…"})]}),S==="saved"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),e("span",{children:"Saved"})]}),S==="error"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-error"}),e("span",{className:"text-error",children:"Save failed"})]}),S==="idle"&&v&&e("span",{className:"truncate max-w-[140px]",children:v})]})]})}function rt({path:t,content:r,ready:l,surfaceRef:p}){let h=gu(t,r,l),g=i(null);return o(()=>{if(!h||g.current===h.request)return;g.current=h.request;let S=h.matches[h.currentIndex];if(!S)return;p.current?.select(S.start,S.end,!1),p.current?.revealOffset(S.start)},[h,p]),{matches:h?.matches??[],currentIndex:h?.currentIndex??-1}}function at({path:t,content:r,documentKey:l,ready:p,surfaceRef:h,toggleWordWrap:g}){let S=rt({path:t,content:r,ready:p,surfaceRef:h}),v=fu({text:r,documentKey:l,readSelection:()=>h.current?.getSelection()??null,select:(x,c,w=!0)=>h.current?.select(x,c,w),reveal:(x)=>h.current?.revealOffset(x),applyDocument:(x,c,w)=>h.current?.applyDocument(x,c,w),toggleWordWrap:g});if(v.open&&v.matches.length>0)return{find:v,revealMarks:v.matches,currentMark:v.currentIndex};return{find:v,revealMarks:S.matches.length>0?S.matches:void 0,currentMark:S.currentIndex}}function ct({path:t,symbols:r,total:l,truncated:p,emptyNotice:h,preview:g=!1}){let[S,v]=n(!1);if(!t)return null;let x=(c,w)=>{if(v(!1),g){let k=Ad(r,w);if(k)us({path:t,...k});return}cs({path:t,line:c.line,column:c.column,length:c.name.length})};return e(d,{children:[e("div",{className:"absolute bottom-14 right-3 z-20",children:e("button",{type:"button",onClick:()=>v(!0),"aria-label":`Outline (${l} symbols)`,title:"Outline",className:"flex h-9 w-9 items-center justify-center rounded-full border border-ink/20 bg-paper text-ink/60 shadow-sm transition-all hover:bg-ink/5 hover:text-ink",children:e(ea,{size:16})})}),S&&e(Z,{onClose:()=>v(!1),maxWidthClass:"max-w-sm",zClass:"z-[70]",header:e("div",{className:"flex min-w-0 items-center gap-2",children:[e(ea,{size:15,className:"flex-shrink-0 text-ink/50"}),e("span",{className:"text-sm font-medium",children:"Outline"}),e("span",{className:"font-mono text-[11px] text-ink/40",children:p?`${r.length}/${l}`:l})]}),children:e("div",{className:"max-h-[60vh] overflow-y-auto scrollbar-overlay-container py-1",children:[r.length===0?e("div",{className:"px-4 py-3 text-[11px] italic text-ink/40",children:h}):r.map((c,w)=>e("button",{type:"button",onClick:()=>x(c,w),"aria-label":g?`${ai(c.kind)} ${c.name}`:`${ai(c.kind)} ${c.name}, line ${c.line}`,className:"flex w-full min-w-0 items-center gap-2 px-4 py-2 text-left transition-colors hover:bg-ink/5 active:bg-ink/10",style:{paddingLeft:`${16+c.depth*12}px`},children:[e(cd,{kind:c.kind,size:13}),e("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-ink",children:c.name}),!g&&e("span",{className:"flex-shrink-0 font-mono text-[10px] text-ink/40",children:c.line})]},`${c.line}:${c.kind}:${c.name}`)),p&&e("div",{className:"px-4 py-2 text-[11px] italic text-ink/40",children:ud(l)})]})})]})}function pt({file:t,missing:r=!1,onClose:l,onFileSaved:p,onDropResult:h}){let g=Ds(t.path??t.name),[S,v]=n({}),[x,c]=n(Qo),[w,k]=n(!0),y=Fo(),P=_i(),R=Cu(),I=Bu(),N=g==="markdown",C=Ts[g]===!0,A=uu[g]===!0,T=t.path??t.name,E=S[T]??du(g),M=vu(String(T)),L=N&&E,q=()=>v((Y)=>({...Y,[T]:!E})),z=Yc({enabled:Boolean(t.root),onResult:h}),F=mu(t,{flushOnUnmount:!0,reportSaveError:!0,downloadMimeType:"text/plain;charset=utf-8",onFileSaved:p,missing:r}),[te,H]=n(null),X=Ws({tabKey:T,surface:N&&E?"rendered":"code",ready:F.loaded,slot:m0,element:N&&E?void 0:te}),[ae,W]=n(null),ne=a((Y)=>{X.ref(Y),W(Y)},[X.ref]);ou({path:t.path??null,scroller:ae,preview:N&&E});let ie=i(null),{find:ee,revealMarks:J,currentMark:pe}=at({path:t.path??null,content:F.content,documentKey:`${T}\x00${F.language}`,ready:F.loaded&&!F.loadError,surfaceRef:ie,toggleWordWrap:()=>k((Y)=>!Y)}),{content:Q,language:oe}=F,me=Q.split(`
|
|
2
|
-
`).length,we=nu(Q);Au({file:{id:T,name:t.name,path:t.path??T},editor:F,surfaceRef:ie,isPreview:E,exitPreview:()=>v((Y)=>({...Y,[T]:!1})),publish:!1});let{symbols:he,total:ue,truncated:V,notice:j}=dd({content:Q,language:oe,path:t.path??null,state:C?"not-a-document":F.loadError?"error":F.loaded?"ready":"loading",note:C?`${Ho[g]} files have no text outline.`:F.loadError});return e("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col font-mono text-xs select-none",...z.dropProps,...z.captureDropProps,children:[e(Nl,{visible:z.isDragging}),e(Jo,{fileName:t.name,hasPreview:A,isPreview:E,wordWrap:w,copied:F.copied,byteViewer:C,missing:r,onSave:F.saveNow,onClose:l,onTogglePreview:q,hasReview:L,isReviewing:L&&M.active,onToggleReview:M.toggle,onToggleFind:()=>ee.open?ee.close():ee.openFind(),findOpen:ee.open,onToggleWrap:()=>k(!w),onZoomOut:()=>c((Y)=>Math.max(vl,Y-1)),onZoomIn:()=>c((Y)=>Math.min(kl,Y+1)),onCopy:F.copy,onDownload:F.download}),r&&e(tt,{}),F.diskChange&&e(hu,{fileName:t.name,onReload:F.reloadFromDisk,onKeepMine:F.keepMineAgainstDisk}),ee.open&&!C&&e("div",{className:"relative shrink-0 h-9 border-b border-ink/10 bg-paper",children:e(au,{find:ee})}),e(ot,{file:t,editor:F,viewerKind:g,byteViewer:C,isPreview:E,isMd:N,content:Q,language:oe,wordWrap:w,fileKey:T,revealMarks:J,currentMark:pe,surfaceRef:ie,setCodeScroller:H,previewRef:ne,scroll:X,fontSize:x,reviewActive:L&&M.active,onExitReview:M.toggle,editorTheme:P,editorFontFamily:y,indentUnitText:wu(R),typing:I}),!C&&e(ct,{path:t.path??null,symbols:he,total:ue,truncated:V,emptyNotice:j,preview:N&&E}),e(it,{isImage:F.isImage,byteViewer:C,viewerKind:g,lineCount:me,charCount:Q.length,language:oe,saveStatus:F.saveStatus,path:t.path,conflicts:we}),F.saveMissingConfirm&&t.path&&e(yu,{fileName:t.name,filePath:t.path,onClose:F.cancelSaveMissing,onConfirm:F.confirmSaveMissing})]})}function mt({diff:t,onClose:r,onFileSaved:l}){let p=t.path.split("/").pop()||t.path,h=Boolean(t.staged),g=t.status||"M",S=tr(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:qo(),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(sn,{size:18,strokeWidth:1.9})}),e(dt,{name:p,size:14,className:"flex-shrink-0"}),e("span",{className:"font-mono text-xs text-ink font-medium truncate",title:t.path,children:p})]}),e("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border flex-shrink-0 ${S.badgeBgClass}`,children:[S.charStatus," ",S.label]})]}),e("div",{className:"flex-1 min-h-0",children:e(eu,{className:"h-full",viewModeButtons:!1,filePath:t.path,status:g,isStaged:h,root:t.root,repo:t.repo||".",journalDiff:t.journal,readOnly:Boolean(t.journal),onFileSaved:l,tabKey:t.journal?If(t.journal.path,t.journal.from,t.journal.to):Bf(t.path,h)})})]})}function Oe(t,r){let l=t[r];return typeof l==="string"&&l.length>0?l:void 0}function Mt(t){let r=t.content;return typeof r==="string"?r:void 0}function $e(t,r){let l=typeof t==="object"&&t!==null?t:{},p=(Oe(l,"path")??"").replace(/^\/+/,"");if(!p)return null;return{name:Oe(l,"name")??p.split("/").pop()??"file",path:p,content:Mt(l),root:Oe(l,"root")??r??void 0,repo:Oe(l,"repo"),handleId:Oe(l,"handleId"),deviceFile:l.deviceFile===!0?!0:void 0}}function ut(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 ft(t,r,l){ro(l);let p=ar(r);return Zt(p,Vg,{folderId:r,worktreePath:l}),t.setSearchParams((h)=>{let g=Ft(h);return g.set("sessionId",p),g.set("folderId",r.toString()),g},{replace:!0}),t.afterNavigate?.(),p}function cp({onDesktopToggle:t,appSettings:r={}}){let{folders:l,isMock:p}=Xe(),h=Nt(),{sessionId:g}=Ue(),[S,v]=le(),x=S.get("sessionId"),c=x?Number.isNaN(Number(x))?x:Number(x):null,w=S.get("folderId"),k=w?Number.isNaN(Number(w))?w:Number(w):null,[y,P]=n("main"),R=Je({dock:h,sessionId:g,currentScreen:y,setCurrentScreen:P}),[I,N]=n(null),[C,A]=n(null),[T,E]=n(0),[M,L]=n(!1),[q,z]=n("appearance"),[F,te]=n(!1),H=a(()=>E((V)=>V+1),[]),X=pu(ut(I),T),{pushToast:ae}=Ke(),W=a((V)=>ae(V.message,V.ok?"success":"error"),[ae]),ne=X.size>0;qe({editorOpen:I!==null,diffOpen:C!==null,settingsOpen:M,offMainScreen:y!=="main",onCloseEditor:()=>N(null),onCloseDiff:()=>A(null),onCloseSettings:()=>{L(!1),te(!1)},onReturnToMain:()=>P("main")});let{folder:ie}=ao(l,c),ee=ie??(k?l.find((V)=>String(V.id)===String(k))??null:null),J=Qf(l,c)??ee?.project_path??null,pe=!!ee,Q=Yc({enabled:pe,onResult:W});Ae("omp:open-file",(V)=>{let Y=$e(V.detail,J);if(Y)N(Y)}),Ae("omp:open-diff",(V)=>{let j=V.detail;if(!j?.file)return;A({path:j.file.replace(/^\/+/,""),status:j.status,staged:j.staged,repo:j.repo,root:j.root??J??void 0,...j.source==="journal"&&j.journal?{journal:j.journal}:{}})}),Ae("omp:view-subagent",()=>P("main")),Ae("omp:open-settings",(V)=>{let j=V.detail;z(j?.category??"appearance"),te(Boolean(j?.autoOpenAdd)),L(!0)});let oe=(V)=>{v((j)=>{let Y=Ft(j);if(Y.set("sessionId",V.toString()),Y.has("subagent"))Y.delete("subagent");return Y},{replace:!0}),P("main")},me=()=>{v(new URLSearchParams,{replace:!0}),P("main")},we=(V)=>{let j=Bl(l,x,V);if(j)ro(j);v((Y)=>Cc(Y,ar(V),V),{replace:!0}),P("main")},he=(V,j)=>ft({setSearchParams:v,afterNavigate:()=>P("main")},V,j),ue=a((V)=>{let j=$e(V,J);if(j)N(j)},[J]);return e("div",{"data-testid":"app-root",className:"app-window flex flex-col h-dvh w-screen overflow-hidden bg-canvas text-ink font-sans selection:bg-ink selection:text-canvas relative",children:[e(Of,{}),e($f,{isMock:p}),e(zf,{workspacePath:J}),e("div",{className:`flex-1 min-h-0 w-full relative ${y==="main"?"block":"hidden"}`,...Q.dropProps,...Q.captureDropProps,children:[e(Nl,{visible:Q.isDragging}),e(io,{activeSessionId:c,onSelectSession:oe,onNewSession:me,onOpenSessionSidebar:R.openSessionDrawer,onOpenRightSidebar:R.openRightDrawer,appSettings:r})]}),e("div",{className:`flex-1 min-h-0 w-full ${y==="session"?"block":"hidden"}`,children:e(jo,{activeSessionId:c,onSelectSession:oe,onNewSession:me,onNewSessionForFolder:we,onNewWorktreeSession:he,onClose:()=>P("main"),onDesktopToggle:t,appSettings:r,rootPath:J??void 0,refreshKey:T,onRefresh:H,onOpenFile:ue,revealSignal:R.left})}),y==="right"&&e("div",{className:"flex-1 min-h-0 w-full",children:e(Yo,{enabled:pe,rootPath:J??void 0,refreshKey:T,onRefresh:H,onOpenFile:ue,onClose:()=>P("main"),revealSignal:R.right})}),I&&e(pt,{file:I,missing:ne,onClose:()=>N(null),onFileSaved:H}),C&&e(mt,{diff:C,onClose:()=>A(null),onFileSaved:H}),e(Cl,{isOpen:M,onClose:()=>{L(!1),te(!1)},initialCategory:q,autoOpenAddProvider:F,appSettings:r})]})}export{cp as MobileLayoutWrapper};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Wf}from"./index-ebf50mrs.js";import"./index-5mpv57fn.js";import"./index-3en15m75.js";export{Wf as MergeDiffView};
|