@kabmo-labs/kabmo 0.42.1 → 0.43.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.
Files changed (362) hide show
  1. package/README.md +1 -1
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/index.js +619 -582
  4. package/dist/client/static/js/{CsvGrid-8gdp5b49.js → CsvGrid-3fr85032.js} +2 -2
  5. package/dist/client/static/js/{DocxView-j9sphgra.js → DocxView-pqbp2fpd.js} +4 -4
  6. package/dist/client/static/js/{DrawioView-xsgjc7d8.js → DrawioView-m0vecq1m.js} +2 -2
  7. package/dist/client/static/js/ImageView-rbejbjwg.js +1 -0
  8. package/dist/client/static/js/LayoutWrapper-mxfsqh57.js +2 -0
  9. package/dist/client/static/js/Modal-vnwg4xn3.js +59 -0
  10. package/dist/client/static/js/{PdfView-afd5cg54.js → PdfView-wmg0vk2p.js} +1 -1
  11. package/dist/client/static/js/SessionsView-90z2t4qe.js +1 -0
  12. package/dist/client/static/js/{SheetView-gfzgxb4r.js → SheetView-rg5gkcd7.js} +13 -13
  13. package/dist/client/static/js/{SvgPreview-225pkb99.js → SvgPreview-wpb7b0ez.js} +1 -1
  14. package/dist/client/static/js/{abnfDiagram-O67JEVCF-z70sk69m.js → abnfDiagram-O67JEVCF-4pxqt66j.js} +1 -1
  15. package/dist/client/static/js/architecture-7GRP2DOG-7j23x20s.js +1 -0
  16. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-pf1gpkje.js → architectureDiagram-NJMV4G6O-kwt1va5y.js} +11 -11
  17. package/dist/client/static/js/{astro-nn7xg0we.js → astro-dpfdhc5e.js} +1 -1
  18. package/dist/client/static/js/bash-vv2ysp0a.js +1 -0
  19. package/dist/client/static/js/{blockDiagram-BEXU5L5S-sr25kbn6.js → blockDiagram-BEXU5L5S-hbj5v7n7.js} +7 -7
  20. package/dist/client/static/js/c-8jf64j6h.js +1 -0
  21. package/dist/client/static/js/{c4Diagram-YGBWAQC7-znstpg86.js → c4Diagram-YGBWAQC7-epfzh8dw.js} +6 -6
  22. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-7n0pdcd8.js → classDiagram-v2-NBCMYWYE-kbks4qgz.js} +6 -6
  23. package/dist/client/static/js/{cose-bilkent-JH36ORCC-zn3qw4c4.js → cose-bilkent-JH36ORCC-dvdmckrf.js} +1 -1
  24. package/dist/client/static/js/cpp-vh94zee0.js +1 -0
  25. package/dist/client/static/js/css-p57h1fme.js +1 -0
  26. package/dist/client/static/js/cynefin-OW5HDTMX-me5xnx6a.js +1 -0
  27. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-3z41vtzs.js → cynefinDiagram-VND7K2PF-r084stj5.js} +2 -2
  28. package/dist/client/static/js/{dagre-6A5THRUB-5j3zn883.js → dagre-6A5THRUB-64qc51n1.js} +2 -2
  29. package/dist/client/static/js/{diagram-22UHCM2B-ryw1w2kh.js → diagram-22UHCM2B-70qtb1rm.js} +16 -16
  30. package/dist/client/static/js/{diagram-3UASUU5V-p91q4gkh.js → diagram-3UASUU5V-dgkvnsme.js} +1 -1
  31. package/dist/client/static/js/{diagram-ATOU4E4O-22dn73g4.js → diagram-ATOU4E4O-rnpsp26v.js} +3 -3
  32. package/dist/client/static/js/{diagram-CDSNMT55-589p9n53.js → diagram-CDSNMT55-26hthh60.js} +5 -5
  33. package/dist/client/static/js/{diagram-MLGK6HIB-ezw06wbx.js → diagram-MLGK6HIB-nc1s85r5.js} +2 -2
  34. package/dist/client/static/js/{diagram-MPIPVDR6-cfwrsvk1.js → diagram-MPIPVDR6-e4dckqhv.js} +3 -3
  35. package/dist/client/static/js/{dockerfile-r4k7q34y.js → dockerfile-rxtyyhr1.js} +1 -1
  36. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3rv2wvbf.js → ebnfDiagram-ZINNZB2B-3w9h8qk7.js} +1 -1
  37. package/dist/client/static/js/{elixir-szk51ehr.js → elixir-5ewfhvfh.js} +1 -1
  38. package/dist/client/static/js/{elk-276RUBZZ-ma40kneq.js → elk-276RUBZZ-httpkyb1.js} +1 -1
  39. package/dist/client/static/js/{erDiagram-OPXOYQCR-xwstsfqa.js → erDiagram-OPXOYQCR-3qhvf7se.js} +8 -8
  40. package/dist/client/static/js/{erlang-zwy7cqdk.js → erlang-jqqa3ehb.js} +1 -1
  41. package/dist/client/static/js/eventmodeling-NTZA5JFV-5zbvjj84.js +1 -0
  42. package/dist/client/static/js/flowDiagram-KWPJA3E3-1jat076e.js +1 -0
  43. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-qxyx9tr9.js → ganttDiagram-FUAMR5RP-t53m50e5.js} +6 -6
  44. package/dist/client/static/js/gitGraph-4MIJSDKK-tjhkv71w.js +1 -0
  45. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-v6sg7bkh.js → gitGraphDiagram-X574FWY7-b5wn9eht.js} +14 -14
  46. package/dist/client/static/js/graphql-kesh8gk0.js +1 -0
  47. package/dist/client/static/js/html-sxpfydga.js +1 -0
  48. package/dist/client/static/js/{index-e1yz59fa.js → index-0c6vpk89.js} +2 -2
  49. package/dist/client/static/js/{index-p0ez6hqd.js → index-181p91hf.js} +1 -1
  50. package/dist/client/static/js/{index-kh6vp5w5.js → index-1dwdgp27.js} +1 -1
  51. package/dist/client/static/js/{index-df4yxfzd.js → index-2q23dwrs.js} +2 -2
  52. package/dist/client/static/js/{index-4cncqz8j.js → index-38v0781h.js} +2 -2
  53. package/dist/client/static/js/{index-mvykbyhe.js → index-4banz7gr.js} +1 -1
  54. package/dist/client/static/js/{index-nh29fkk9.js → index-7dp90ad1.js} +2 -2
  55. package/dist/client/static/js/{index-b37ewyvk.js → index-7z9tz4ze.js} +2 -2
  56. package/dist/client/static/js/{index-3d40c0a7.js → index-7zc1z9z9.js} +4 -4
  57. package/dist/client/static/js/{index-8pdz41yh.js → index-8y51kgan.js} +3 -3
  58. package/dist/client/static/js/{index-qh753ynv.js → index-axszsg7a.js} +1 -1
  59. package/dist/client/static/js/{index-pxtff3ez.js → index-bvjct7sp.js} +2 -2
  60. package/dist/client/static/js/{index-8b3t2y77.js → index-cqnpsw2m.js} +2 -2
  61. package/dist/client/static/js/{index-869bpqcs.js → index-d8r84zjd.js} +12 -12
  62. package/dist/client/static/js/{index-mq6s2faf.js → index-dg3b0mfk.js} +2 -2
  63. package/dist/client/static/js/index-dkqgmacr.js +4 -0
  64. package/dist/client/static/js/{index-pkes9492.js → index-e7yf273s.js} +2 -2
  65. package/dist/client/static/js/{index-0p43qr4k.js → index-egd0vfey.js} +1 -1
  66. package/dist/client/static/js/{index-x7m6dmt4.js → index-enb6chty.js} +1 -1
  67. package/dist/client/static/js/{index-6eq445nn.js → index-f4fqvct6.js} +22 -22
  68. package/dist/client/static/js/{index-pysqpc5n.js → index-fg965t62.js} +2 -2
  69. package/dist/client/static/js/{index-sr7sdm2t.js → index-fgyenbv8.js} +4 -4
  70. package/dist/client/static/js/{index-qsw5edtk.js → index-fjnkzk12.js} +5 -5
  71. package/dist/client/static/js/{index-0nca2nhp.js → index-g3a9j9hf.js} +1 -1
  72. package/dist/client/static/js/{index-x7a5jpvq.js → index-g4rsmakg.js} +3 -3
  73. package/dist/client/static/js/{index-qx6x4z0y.js → index-gmnmnfm0.js} +2 -2
  74. package/dist/client/static/js/{index-313ctswm.js → index-gwqb7m8g.js} +1 -1
  75. package/dist/client/static/js/{index-w5q9ymf4.js → index-j60gtvw8.js} +1 -1
  76. package/dist/client/static/js/index-jvs2fvqz.js +2 -0
  77. package/dist/client/static/js/{index-r8cc80w5.js → index-jz93j0at.js} +2 -2
  78. package/dist/client/static/js/{index-2w9j2nj4.js → index-k9ws464d.js} +2 -2
  79. package/dist/client/static/js/{index-b3d2k7ec.js → index-kc3c2gzb.js} +1 -1
  80. package/dist/client/static/js/{index-9hzfvjrb.js → index-kccp6tgd.js} +2 -2
  81. package/dist/client/static/js/{index-9ss64g4g.js → index-kmzd0adv.js} +1 -1
  82. package/dist/client/static/js/{index-8fvmyv7t.js → index-ksph3kpr.js} +2 -2
  83. package/dist/client/static/js/{index-dfqmwm7j.js → index-m9s9rg5k.js} +2 -2
  84. package/dist/client/static/js/{index-gsxebrq9.js → index-n9scbxy5.js} +2 -2
  85. package/dist/client/static/js/{index-mphhvgm9.js → index-q1gwgmxt.js} +2 -2
  86. package/dist/client/static/js/{index-b42t14wk.js → index-q81rxwh7.js} +35 -35
  87. package/dist/client/static/js/{index-ktbrmp29.js → index-qhytrsyb.js} +2 -2
  88. package/dist/client/static/js/index-qzw4jnnv.js +1 -0
  89. package/dist/client/static/js/{index-xsts4pqm.js → index-r11bbnek.js} +78 -78
  90. package/dist/client/static/js/{index-q3qpm7jn.js → index-rv4qs3wm.js} +2 -2
  91. package/dist/client/static/js/{index-hga3e13s.js → index-s78n0dtv.js} +2 -2
  92. package/dist/client/static/js/{index-03pyvmcz.js → index-sesghshh.js} +2 -2
  93. package/dist/client/static/js/index-tnv3dryk.js +9 -0
  94. package/dist/client/static/js/{index-v5dbrq83.js → index-tzbzehqd.js} +1 -1
  95. package/dist/client/static/js/index-vcrh95gf.css +1 -0
  96. package/dist/client/static/js/{index-4y0ayjfx.js → index-vmgzhp41.js} +1 -1
  97. package/dist/client/static/js/{index-6dxs0tvg.js → index-wmv3crye.js} +2 -2
  98. package/dist/client/static/js/{index-b0v6gwym.js → index-ycks7gyg.js} +2 -2
  99. package/dist/client/static/js/{index-hw14rhen.js → index-ynaxep06.js} +2 -2
  100. package/dist/client/static/js/{index-rab39785.js → index-ys0xpw3q.js} +2 -2
  101. package/dist/client/static/js/{index-feffxxss.js → index-yvgbr7ek.js} +2 -2
  102. package/dist/client/static/js/index-zqthmaxq.js +478 -0
  103. package/dist/client/static/js/info-A6RAGUB7-m6qz24p8.js +1 -0
  104. package/dist/client/static/js/{infoDiagram-VRGFBTTK-0anekyhb.js → infoDiagram-VRGFBTTK-qv7438m3.js} +1 -1
  105. package/dist/client/static/js/ini-1x0ad976.js +1 -0
  106. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-zxpmfkjb.js → ishikawaDiagram-OU5B5YK6-p1w6zg5y.js} +4 -4
  107. package/dist/client/static/js/java-3944nq02.js +1 -0
  108. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-1e86fzra.js → journeyDiagram-ZHPQQLJL-ywk6xqxr.js} +5 -5
  109. package/dist/client/static/js/json-g5ggnd94.js +1 -0
  110. package/dist/client/static/js/jsx-f6p72qpc.js +1 -0
  111. package/dist/client/static/js/{julia-2eekpjq8.js → julia-0h9krgsd.js} +1 -1
  112. package/dist/client/static/js/{kanban-definition-PNTS6WVX-e85hhmr1.js → kanban-definition-PNTS6WVX-gtrmhggc.js} +5 -5
  113. package/dist/client/static/js/lua-edn2b3wn.js +1 -0
  114. package/dist/client/static/js/markdown-9dhg1fax.js +1 -0
  115. package/dist/client/static/js/{mermaid.core-jpcrnzyw.js → mermaid.core-5s24b4hh.js} +6 -6
  116. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-xwy5928e.js → mindmap-definition-NLK3R4M7-3wx7abqn.js} +4 -4
  117. package/dist/client/static/js/one-dark-pro-3vya9z02.js +1 -0
  118. package/dist/client/static/js/one-light-1yrwn9my.js +1 -0
  119. package/dist/client/static/js/packet-AYTQ26CC-ng6wq5xj.js +1 -0
  120. package/dist/client/static/js/{pegDiagram-GJSIUBJH-7dy6pw26.js → pegDiagram-GJSIUBJH-yvyqnjya.js} +1 -1
  121. package/dist/client/static/js/{perl-dtn1fccw.js → perl-rptyx23q.js} +1 -1
  122. package/dist/client/static/js/{php-7av78hch.js → php-sagvq3wz.js} +1 -1
  123. package/dist/client/static/js/pie-WAS4IAKB-rf6jhxf6.js +1 -0
  124. package/dist/client/static/js/{pieDiagram-5QR66LMP-nrv2t5yn.js → pieDiagram-5QR66LMP-26x6pj38.js} +3 -3
  125. package/dist/client/static/js/properties-fcmj08pv.js +1 -0
  126. package/dist/client/static/js/python-532d8ezm.js +1 -0
  127. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-3nt63xr8.js → quadrantDiagram-O4NWA36T-qhe8h0j9.js} +6 -6
  128. package/dist/client/static/js/r-ptmdxs2a.js +1 -0
  129. package/dist/client/static/js/radar-RG4KPBEZ-ygp6hxq4.js +1 -0
  130. package/dist/client/static/js/railroad-74A4TZTK-rxgnrb2g.js +1 -0
  131. package/dist/client/static/js/railroad-abnf-HS5TGJTU-xkv52a2p.js +1 -0
  132. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-bvcktbqh.js +1 -0
  133. package/dist/client/static/js/railroad-peg-WCYAUIDC-9c3v7jsq.js +1 -0
  134. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-evm05hzp.js → railroadDiagram-XR7U4H2S-dwy3k2jx.js} +1 -1
  135. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-tzrcmktj.js → requirementDiagram-PLB6GJNP-hcmgfesg.js} +4 -4
  136. package/dist/client/static/js/{ruby-s2bqr910.js → ruby-9qyx7knh.js} +1 -1
  137. package/dist/client/static/js/{rust-pcvgybk3.js → rust-bmb4ee5w.js} +1 -1
  138. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-jvjd5rz8.js → sankeyDiagram-IPEJSGJF-s6d3k4zs.js} +6 -6
  139. package/dist/client/static/js/{sass-bm32bb5k.js → sass-07rteya0.js} +1 -1
  140. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-0zvjwx29.js → sequenceDiagram-PO4LG4MO-0fcmzgdy.js} +19 -19
  141. package/dist/client/static/js/{sizeCapture-INFHLROL-6t6g0edv.js → sizeCapture-INFHLROL-t8fcm7rq.js} +1 -1
  142. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-nb13b23a.js → stateDiagram-v2-GCMORJYK-jr80hfeg.js} +6 -6
  143. package/dist/client/static/js/{svelte-ztkaww47.js → svelte-w365cpwa.js} +1 -1
  144. package/dist/client/static/js/{swimlanes-2SLR337P-ef8vmg6f.js → swimlanes-2SLR337P-x1ay6w39.js} +1 -1
  145. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xj123xrp.js +8 -0
  146. package/dist/client/static/js/{timeline-definition-EJHVYXUP-3bfph698.js → timeline-definition-EJHVYXUP-qz0g6msb.js} +2 -2
  147. package/dist/client/static/js/treeView-Q6P3EWNA-fb58a7z1.js +1 -0
  148. package/dist/client/static/js/treemap-WGGIJYW6-ej4qhksx.js +1 -0
  149. package/dist/client/static/js/typescript-683kkkaw.js +1 -0
  150. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-vj6yj6tc.js → usecaseDiagram-POWQR4AR-sxzrv8ht.js} +43 -43
  151. package/dist/client/static/js/{vennDiagram-UO4OBE2U-9xyyabaq.js → vennDiagram-UO4OBE2U-qsqgnjcv.js} +5 -5
  152. package/dist/client/static/js/{vue-cbqm4bed.js → vue-d6cesny1.js} +1 -1
  153. package/dist/client/static/js/wardley-WFR3VGLG-mkp0kanv.js +1 -0
  154. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-zpcwgv9d.js → wardleyDiagram-VNRHLVJA-rvwxn458.js} +4 -4
  155. package/dist/client/static/js/xml-6ct32gys.js +1 -0
  156. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-pdr2rms2.js → xychartDiagram-PMCCYNJV-nb4w7rcg.js} +5 -5
  157. package/dist/client/static/js/yaml-1d5m3bfj.js +1 -0
  158. package/marketplace/plugins/command-runner/package.json +2 -2
  159. package/marketplace/plugins/command-runner/src/app.test.tsx +161 -0
  160. package/marketplace/plugins/command-runner/src/app.tsx +37 -3
  161. package/marketplace/plugins/command-runner/src/panel/Glyph.tsx +22 -4
  162. package/marketplace/plugins/git-forge/package.json +2 -2
  163. package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +22 -3
  164. package/marketplace/plugins/git-forge/src/panel/index.tsx +21 -3
  165. package/marketplace/plugins/git-forge/src/panel/refresh.test.tsx +192 -0
  166. package/marketplace/plugins/git-forge/src/panel/use-forge.ts +4 -2
  167. package/marketplace/plugins/git-forge/src/panel/write.test.tsx +21 -0
  168. package/marketplace/plugins/stats/package.json +2 -2
  169. package/marketplace/plugins/stats/src/RefreshButton.tsx +9 -7
  170. package/marketplace/plugins/stats/src/app.tsx +15 -1
  171. package/marketplace/plugins/stats/src/refresh.test.tsx +166 -0
  172. package/package.json +1 -1
  173. package/src/client/components/common/anchored-menu/index.tsx +26 -8
  174. package/src/client/components/common/context-usage-button/McpSection.test.tsx +34 -5
  175. package/src/client/components/common/context-usage-button/McpSection.tsx +25 -3
  176. package/src/client/components/common/harness-glyph/brands.ts +3 -0
  177. package/src/client/components/common/harness-glyph/omo.ts +22 -0
  178. package/src/client/components/common/server-control/Panel.tsx +24 -86
  179. package/src/client/components/common/server-control/Row.tsx +98 -0
  180. package/src/client/components/common/server-control/index.test.tsx +69 -9
  181. package/src/client/components/layout/VisibilityMenu.tsx +18 -6
  182. package/src/client/components/layout/new-workspace-host/index.test.tsx +84 -0
  183. package/src/client/components/layout/new-workspace-host/index.tsx +35 -0
  184. package/src/client/components/mobile/header-titlebar.test.tsx +38 -3
  185. package/src/client/components/settings/Sidebar.tsx +2 -1
  186. package/src/client/components/settings/categories/GitSettings.tsx +31 -0
  187. package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +292 -0
  188. package/src/client/components/settings/categories/git-settings/IdentitySection.tsx +215 -0
  189. package/src/client/components/settings/category-content.tsx +3 -0
  190. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +8 -0
  191. package/src/client/components/workspace/chat-timeline/MessageList.test.ts +55 -2
  192. package/src/client/components/workspace/chat-timeline/MessageList.tsx +13 -1
  193. package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +56 -50
  194. package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +38 -2
  195. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +13 -1
  196. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +50 -0
  197. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +20 -1
  198. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +2 -1
  199. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +1 -4
  200. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +3 -2
  201. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +3 -3
  202. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +45 -0
  203. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +14 -4
  204. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -12
  205. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +42 -38
  206. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +25 -21
  207. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +41 -29
  208. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +47 -43
  209. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +136 -0
  210. package/src/client/components/workspace/git-panel/CommitBox.test.tsx +98 -0
  211. package/src/client/components/workspace/git-panel/CommitBox.tsx +68 -3
  212. package/src/client/components/workspace/git-panel/index.test.ts +12 -0
  213. package/src/client/components/workspace/git-panel/index.tsx +20 -1
  214. package/src/client/components/workspace/repo-picker/index.test.tsx +20 -0
  215. package/src/client/components/workspace/repo-picker/index.tsx +5 -6
  216. package/src/client/data/settings/omp-schema.json +134 -8
  217. package/src/client/hooks/chat/context/mcp.ts +19 -1
  218. package/src/client/hooks/chat/timeline/jump-rail.ts +1 -0
  219. package/src/client/hooks/chat/timeline/row-window.test.ts +38 -3
  220. package/src/client/hooks/chat/timeline/row-window.ts +33 -9
  221. package/src/client/hooks/chat/timeline/scroll-geometry.ts +19 -1
  222. package/src/client/hooks/chat/timeline/scroll.ts +15 -0
  223. package/src/client/hooks/chat/timeline/thinking-open.ts +10 -4
  224. package/src/client/hooks/workspace/commit-box.test.ts +62 -1
  225. package/src/client/hooks/workspace/commit-box.ts +94 -2
  226. package/src/client/hooks/workspace/git-panel-data.ts +15 -7
  227. package/src/client/hooks/workspace/repo-scope/index.test.ts +10 -3
  228. package/src/client/hooks/workspace/repo-scope/index.ts +21 -9
  229. package/src/client/lib/plugins/repo-scope-service.ts +7 -25
  230. package/src/server/lib/chat/session-store.server.ts +22 -1
  231. package/src/server/lib/fs/git-commit-context.test.ts +111 -0
  232. package/src/server/lib/fs/git-commit-context.ts +85 -0
  233. package/src/server/lib/fs/git-commit-message.server.ts +251 -0
  234. package/src/server/lib/fs/git-commit-message.test.ts +211 -0
  235. package/src/server/lib/fs/git-commit-prompt.test.ts +69 -0
  236. package/src/server/lib/fs/git-commit-prompt.ts +57 -0
  237. package/src/server/lib/fs/git-commit-settings.server.ts +42 -0
  238. package/src/server/lib/fs/git-identity.server.test.ts +129 -0
  239. package/src/server/lib/fs/git-identity.server.ts +130 -0
  240. package/src/server/lib/harness/acp/acp-audit.server.ts +13 -62
  241. package/src/server/lib/harness/acp/acp-frames.server.test.ts +105 -0
  242. package/src/server/lib/harness/acp/acp-frames.server.ts +217 -0
  243. package/src/server/lib/harness/acp/acp-raw-messages.server.test.ts +69 -0
  244. package/src/server/lib/harness/acp/acp-raw-messages.server.ts +129 -0
  245. package/src/server/lib/harness/acp/acp-telemetry.server.ts +19 -0
  246. package/src/server/lib/harness/acp/one-shot.server.ts +141 -0
  247. package/src/server/lib/harness/acp/raw-listeners.ts +30 -0
  248. package/src/server/lib/harness/acp/session-handshake.ts +11 -3
  249. package/src/server/lib/harness/acp/session.test-util.ts +2 -0
  250. package/src/server/lib/harness/acp/session.ts +8 -0
  251. package/src/server/lib/harness/capabilities.ts +11 -0
  252. package/src/server/lib/harness/launch-table.ts +19 -0
  253. package/src/server/lib/harness/launch.ts +4 -0
  254. package/src/server/lib/harness/schema.server.ts +23 -0
  255. package/src/server/lib/harness/spawn.server.ts +18 -2
  256. package/src/server/lib/mcp/agent-config.server.test.ts +111 -0
  257. package/src/server/lib/mcp/agent-config.server.ts +205 -0
  258. package/src/server/lib/mcp/probe.server.ts +7 -1
  259. package/src/server/lib/mcp/registry.server.ts +4 -3
  260. package/src/server/lib/mcp/secrets.server.test.ts +85 -0
  261. package/src/server/lib/mcp/secrets.server.ts +108 -0
  262. package/src/server/lib/omp/core/print.server.ts +100 -0
  263. package/src/server/lib/omp/rpc/frame-fold.ts +4 -0
  264. package/src/server/lib/omp/session/artifacts.server.test.ts +15 -5
  265. package/src/server/lib/omp/session/artifacts.server.ts +41 -26
  266. package/src/server/lib/omp/session/delete.server.ts +2 -0
  267. package/src/server/lib/omp/session/goal-auditor.server.ts +10 -48
  268. package/src/server/lib/omp/session/scan.ts +15 -2
  269. package/src/server/lib/omp/session/session-discovery.test.ts +21 -0
  270. package/src/server/lib/realtime/topics/session-data.server.ts +6 -14
  271. package/src/server/routes/fs/git-message.test.ts +101 -0
  272. package/src/server/routes/fs/git-message.ts +60 -0
  273. package/src/server/routes/fs/index.ts +2 -0
  274. package/src/server/routes/omp/artifact.ts +4 -3
  275. package/src/server/routes/sessions/mcp.test.ts +65 -1
  276. package/src/server/routes/sessions/mcp.ts +77 -5
  277. package/src/server/routes/settings/git-identity.test.ts +77 -0
  278. package/src/server/routes/settings/git-identity.ts +47 -0
  279. package/src/server/routes/settings/index.ts +2 -0
  280. package/src/server/routes/telemetry/acp-telemetry.test.ts +149 -0
  281. package/src/server/routes/telemetry/context.ts +31 -0
  282. package/src/server/routes/telemetry/raw-messages.ts +34 -0
  283. package/src/shared/lib/chat/timeline/tool-render-mode.ts +3 -3
  284. package/src/shared/lib/chat/tool/artifact.test.ts +4 -2
  285. package/src/shared/lib/chat/tool/artifact.ts +6 -1
  286. package/src/shared/lib/chat/tool/proc-facts.ts +2 -1
  287. package/src/shared/lib/fs/paths.test.ts +2 -0
  288. package/src/shared/lib/fs/repo-label.test.ts +22 -1
  289. package/src/shared/lib/fs/repo-label.ts +29 -0
  290. package/src/shared/lib/git/commit-prompt.test.ts +47 -0
  291. package/src/shared/lib/git/commit-prompt.ts +72 -0
  292. package/src/shared/lib/git/identity.test.ts +46 -0
  293. package/src/shared/lib/git/identity.ts +70 -0
  294. package/src/shared/lib/harness/brand-color.ts +3 -0
  295. package/src/shared/lib/harness/catalog.test.ts +14 -0
  296. package/src/shared/lib/harness/catalog.ts +9 -1
  297. package/src/shared/lib/harness/mcp-facts.ts +4 -0
  298. package/src/shared/lib/harness/provider-facts.test.ts +11 -0
  299. package/src/shared/lib/harness/provider-facts.ts +14 -0
  300. package/src/shared/lib/harness/providers.ts +2 -2
  301. package/src/shared/lib/harness/updates.test.ts +8 -0
  302. package/src/shared/lib/harness/updates.ts +9 -0
  303. package/src/shared/lib/omp/session/operator-title.test.ts +21 -0
  304. package/src/shared/lib/omp/session/operator-title.ts +28 -0
  305. package/src/shared/lib/omp/session/proc-daemon.ts +124 -0
  306. package/src/shared/lib/omp/session/proc.test.ts +30 -3
  307. package/src/shared/lib/omp/session/proc.ts +6 -82
  308. package/src/shared/lib/omp/session/wait-idle.test.ts +15 -4
  309. package/src/shared/lib/omp/session/wait-idle.ts +11 -4
  310. package/src/shared/lib/settings/defaults.ts +5 -0
  311. package/src/shared/lib/workspace/new-workspace.ts +20 -0
  312. package/src/shared/types/settings/mcp.ts +2 -2
  313. package/src/shared/types/settings/state.ts +16 -0
  314. package/src/test-support/preload.ts +1 -0
  315. package/dist/client/static/js/ImageView-ve9hc519.js +0 -1
  316. package/dist/client/static/js/LayoutWrapper-5mqffvkc.js +0 -2
  317. package/dist/client/static/js/Modal-50whypff.js +0 -38
  318. package/dist/client/static/js/SessionsView-7719nvy0.js +0 -1
  319. package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +0 -1
  320. package/dist/client/static/js/bash-fjzhxy10.js +0 -1
  321. package/dist/client/static/js/c-wqtyezvw.js +0 -1
  322. package/dist/client/static/js/cpp-y0nzwner.js +0 -1
  323. package/dist/client/static/js/css-n2waj098.js +0 -1
  324. package/dist/client/static/js/cynefin-OW5HDTMX-6g2ydrss.js +0 -1
  325. package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +0 -1
  326. package/dist/client/static/js/flowDiagram-KWPJA3E3-evp84v09.js +0 -1
  327. package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +0 -1
  328. package/dist/client/static/js/graphql-gvb7e2eb.js +0 -1
  329. package/dist/client/static/js/html-tbz83eke.js +0 -1
  330. package/dist/client/static/js/index-001vebsp.js +0 -2
  331. package/dist/client/static/js/index-5599dngt.js +0 -1
  332. package/dist/client/static/js/index-5asf5625.js +0 -4
  333. package/dist/client/static/js/index-cqaz1281.js +0 -2
  334. package/dist/client/static/js/index-f4vr1c6e.css +0 -1
  335. package/dist/client/static/js/index-rt6ac0kk.js +0 -478
  336. package/dist/client/static/js/index-y1p3bdsw.js +0 -9
  337. package/dist/client/static/js/info-A6RAGUB7-n495k952.js +0 -1
  338. package/dist/client/static/js/ini-2gvjwh83.js +0 -1
  339. package/dist/client/static/js/java-1xwcq79s.js +0 -1
  340. package/dist/client/static/js/json-4pqjabgq.js +0 -1
  341. package/dist/client/static/js/jsx-wcsss15s.js +0 -1
  342. package/dist/client/static/js/lua-h7vjcn0h.js +0 -1
  343. package/dist/client/static/js/markdown-f30jjjh9.js +0 -1
  344. package/dist/client/static/js/one-dark-pro-r0tswz8r.js +0 -1
  345. package/dist/client/static/js/one-light-xzcfrptf.js +0 -1
  346. package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +0 -1
  347. package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +0 -1
  348. package/dist/client/static/js/properties-ymexza6q.js +0 -1
  349. package/dist/client/static/js/python-31ycwa66.js +0 -1
  350. package/dist/client/static/js/r-t2nne4xp.js +0 -1
  351. package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +0 -1
  352. package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +0 -1
  353. package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +0 -1
  354. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +0 -1
  355. package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +0 -1
  356. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-f4sx355z.js +0 -8
  357. package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +0 -1
  358. package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.js +0 -1
  359. package/dist/client/static/js/typescript-p3syh43m.js +0 -1
  360. package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +0 -1
  361. package/dist/client/static/js/xml-4enq788a.js +0 -1
  362. package/dist/client/static/js/yaml-pjtt3jsc.js +0 -1
@@ -21,12 +21,14 @@
21
21
  * legacy `hub` tool carried the same data at the TOP level of `details`
22
22
  * (`{daemon}`, `{jobs}`, `{daemons}`). One reader for both, so the panel, the
23
23
  * card header, the fact chips and the activity phrase cannot disagree about
24
- * what a call did.
24
+ * what a call did. The daemon snapshot itself is read in `proc-daemon.ts`,
25
+ * which maps both the 19.0.0 `UnitSnapshot` and the broker snapshot before it.
25
26
  *
26
27
  * Pure and DOM-free: both the live fold and the reload path reach it.
27
28
  */
28
29
 
29
30
  import { isRecord } from '@/shared/lib/util/guards';
31
+ import { daemonOf, type ProcDaemon } from '@/shared/lib/omp/session/proc-daemon';
30
32
 
31
33
  export const PROC_SCHEME = 'proc://';
32
34
 
@@ -71,23 +73,6 @@ export function procRequestOp(path: string | undefined, toolName: string | undef
71
73
  return target.action;
72
74
  }
73
75
 
74
- export interface ProcDaemon {
75
- name?: string;
76
- id?: string;
77
- state?: string;
78
- pid?: number;
79
- createdAt?: number;
80
- startedAt?: number;
81
- readyAt?: number;
82
- exitedAt?: number;
83
- exitCode?: number;
84
- restartCount?: number;
85
- outputBytes?: number;
86
- readyMatch?: string;
87
- persist?: boolean;
88
- detached?: boolean;
89
- }
90
-
91
76
  export interface ProcJob {
92
77
  id?: string;
93
78
  type?: string;
@@ -158,26 +143,6 @@ function asList<T>(value: unknown): T[] {
158
143
  return Array.isArray(value) ? (value.filter(isRecord) as T[]) : [];
159
144
  }
160
145
 
161
- function daemonOf(value: unknown): ProcDaemon | undefined {
162
- if (!isRecord(value)) return undefined;
163
- return {
164
- name: asString(value.name),
165
- id: asString(value.id),
166
- state: asString(value.state),
167
- pid: asNumber(value.pid),
168
- createdAt: asNumber(value.createdAt),
169
- startedAt: asNumber(value.startedAt),
170
- readyAt: asNumber(value.readyAt),
171
- exitedAt: asNumber(value.exitedAt),
172
- exitCode: asNumber(value.exitCode),
173
- restartCount: asNumber(value.restartCount),
174
- outputBytes: asNumber(value.outputBytes),
175
- readyMatch: asString(value.readyMatch),
176
- persist: asBoolean(value.persist),
177
- detached: asBoolean(value.detached),
178
- };
179
- }
180
-
181
146
  function jobOf(value: unknown): ProcJob | undefined {
182
147
  if (!isRecord(value)) return undefined;
183
148
  return {
@@ -257,32 +222,15 @@ export function procViewOf(tool: {
257
222
  * The service a `bash` launch created, from `details.service`.
258
223
  *
259
224
  * omp answers a service-launching `bash` with `{name, state, ready, timedOut,
260
- * pid}` — the same snapshot `proc://<id>` reports under `proc.daemon` — so a
261
- * service started by `bash` and one read back by `proc://` describe themselves
262
- * through one reader.
225
+ * pid}`; `proc://<id>` reports a 19.0.0 `UnitSnapshot` under `proc.daemon`
226
+ * (`key`, `pids`, `policy.hold`). Both describe themselves through one reader,
227
+ * which reads either generation.
263
228
  */
264
229
  export function bashServiceOf(tool: { details?: Record<string, unknown> }): ProcDaemon | undefined {
265
230
  const details = isRecord(tool.details) ? tool.details : undefined;
266
231
  return daemonOf(details?.service);
267
232
  }
268
233
 
269
- /** Tone for a daemon state — omp's own union, mapped to the ink palette. */
270
- export function daemonTone(state: string | undefined): 'ok' | 'warn' | 'error' | 'muted' {
271
- switch (state) {
272
- case 'ready':
273
- case 'running':
274
- return 'ok';
275
- case 'failed':
276
- return 'error';
277
- case 'starting':
278
- case 'restarting':
279
- case 'stopping':
280
- return 'warn';
281
- default:
282
- return 'muted';
283
- }
284
- }
285
-
286
234
  /** Tone for a job status (`running | completed | failed | cancelled`). */
287
235
  export function jobTone(status: string | undefined): 'ok' | 'warn' | 'error' | 'muted' {
288
236
  switch (status) {
@@ -299,30 +247,6 @@ export function jobTone(status: string | undefined): 'ok' | 'warn' | 'error' | '
299
247
  }
300
248
  }
301
249
 
302
- /** `1h 4m` / `12m 3s` / `840ms` — the scale a service lives on. */
303
- export function formatProcDuration(ms: number): string {
304
- if (!Number.isFinite(ms) || ms < 0) return '';
305
- if (ms < 1000) return `${Math.round(ms)}ms`;
306
- const totalSeconds = Math.floor(ms / 1000);
307
- if (totalSeconds < 60) return `${totalSeconds}s`;
308
- const minutes = Math.floor(totalSeconds / 60);
309
- if (minutes < 60) return `${minutes}m ${totalSeconds % 60}s`;
310
- const hours = Math.floor(minutes / 60);
311
- return `${hours}h ${minutes % 60}m`;
312
- }
313
-
314
- /**
315
- * How long a daemon has been up, or how long it ran before it exited. An
316
- * exited service's span is `exitedAt - startedAt`, never `now - startedAt` —
317
- * a service that died an hour ago has not been running for an hour.
318
- */
319
- export function procUptime(daemon: ProcDaemon, now = Date.now()): { label: string; ms: number } | undefined {
320
- if (typeof daemon.startedAt !== 'number') return undefined;
321
- const end = typeof daemon.exitedAt === 'number' ? daemon.exitedAt : now;
322
- const ms = Math.max(0, end - daemon.startedAt);
323
- return { label: formatProcDuration(ms), ms };
324
- }
325
-
326
250
  /** One-word label for the op a call performed. */
327
251
  export function procOpLabel(op: string): string {
328
252
  switch (op) {
@@ -13,10 +13,10 @@ import { describe, expect, test } from 'bun:test';
13
13
  import { WAIT_LADDER_MS, waitIdleLabel, waitIdleOf } from '@/shared/lib/omp/session/wait-idle';
14
14
 
15
15
  describe('the idle ladder', () => {
16
- test('mirrors the windows omp 18.17.0 gives a blocking wait', () => {
17
- // The 30-minute cap is GONE: a wait returns when its window elapses, and the
18
- // window climbs one rung for each back-to-back idle wait.
19
- expect([...WAIT_LADDER_MS]).toEqual([5_000, 10_000, 30_000, 60_000, 300_000]);
16
+ test('mirrors the two-rung ladder omp 19.0.0 gives a blocking wait', () => {
17
+ // The 30-minute cap is GONE, and 19.0.0 cut the five rungs to two: a first
18
+ // idle wait gets 5 s, every back-to-back one 4 minutes.
19
+ expect([...WAIT_LADDER_MS]).toEqual([5_000, 240_000]);
20
20
  });
21
21
 
22
22
  test('reads the window omp names on a first idle return', () => {
@@ -36,6 +36,17 @@ describe('the idle ladder', () => {
36
36
  .toEqual({ windowMs: 30_000 });
37
37
  });
38
38
 
39
+ test('reads the 19.0.0 sentence, which names the next window in a second sentence', () => {
40
+ // 19.0.0: `No reply within 5.0s. Nothing else left? Call `wait` again right
41
+ // away: it then blocks up to 4m.` The window still ends the first sentence.
42
+ expect(
43
+ waitIdleOf('No reply within 5.0s. Nothing else left? Call `wait` again right away: it then blocks up to 4m.'),
44
+ ).toEqual({ windowMs: 5_000 });
45
+ expect(
46
+ waitIdleOf('1 background job still running.\n\nNo job finished within 4m. Nothing else left? End your turn: results and messages start your next one.'),
47
+ ).toEqual({ windowMs: 240_000 });
48
+ });
49
+
39
50
  test('reads the streak omp names from the second idle wait on', () => {
40
51
  // `WAIT_NOTICE_RUNG` appends the notice whose span is the RUNNING TOTAL:
41
52
  // 5 s + 10 s, then + 30 s, then + 60 s, then + 300 s.
@@ -9,9 +9,10 @@
9
9
  * omp 18.17.0 removed the 30-minute cap (`WAIT_MAX_MS`) and with it the "Wait
10
10
  * limit reached" answer the `wait` card used to name. A blocking wait now
11
11
  * returns when its window elapses, and the window climbs one rung for every
12
- * back-to-back idle wait — 5 s, 10 s, 30 s, 60 s, then 5 minutes — restarting at
13
- * the floor once the agent has done other work in between. So there is no
14
- * ceiling to count down to any more.
12
+ * back-to-back idle wait, restarting at the floor once the agent has done other
13
+ * work in between. omp 19.0.0 standardized the ladder to two rungs — 5 s for a
14
+ * first idle wait, 4 minutes for each back-to-back one — so there is no ceiling
15
+ * to count down to any more.
15
16
  *
16
17
  * Neither the rung nor the streak is a field on the result: both are stated in
17
18
  * omp's prose, which is what this module parses. It lives beside `wait.ts`
@@ -29,8 +30,14 @@ import { formatToolMs } from '@/shared/lib/chat/tool/labels';
29
30
 
30
31
  /**
31
32
  * How long a blocking `wait` gives its first wake, per rung of omp's ladder.
33
+ *
34
+ * omp 19.0.0 cut the five-rung ladder (5 s / 10 s / 30 s / 60 s / 5 min) to two:
35
+ * a first idle wait gets 5 s, every back-to-back one 4 minutes
36
+ * (`WAIT_LADDER_MS` in `tools/wait.ts`). A session recorded before the pin
37
+ * still names the old windows, so this list is a reference for the current pin
38
+ * only — the window a result reports is always parsed from omp's sentence.
32
39
  */
33
- export const WAIT_LADDER_MS = [5_000, 10_000, 30_000, 60_000, 300_000] as const;
40
+ export const WAIT_LADDER_MS = [5_000, 240_000] as const;
34
41
 
35
42
  /** A span in omp's `formatDuration` spelling: `250ms`, `5.0s`, `30s`, `1m45s`, `5m`, `2h5m`. */
36
43
  const OMP_DURATION = String.raw`(?:\d+d)?(?:\d+h)?(?:\d+m)?(?:[\d.]+s)?(?:\d+ms)?`;
@@ -35,6 +35,11 @@ export const DEFAULT_SETTINGS = {
35
35
  editorFont: EDITOR_DEFAULT_FONT_FAMILY,
36
36
  editorTheme: EDITOR_DEFAULT_THEME_ID,
37
37
  autoSessionTitle: true,
38
+ commitMessageMode: 'auto',
39
+ commitMessageHarness: '',
40
+ commitMessageModel: '',
41
+ commitMessagePrompt: '',
42
+ gitIdentities: [],
38
43
  soundAlerts: true,
39
44
  chatCompletionSound: true,
40
45
  notifyDesktopEnabled: true,
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The window event that asks a layout to open the New Workspace dialog.
8
+ *
9
+ * The composer's workspace picker offers "Add new workspace", but the dialog is
10
+ * owned by the LAYOUT, not by the picker: the desktop sidebar that used to own
11
+ * it is unmounted while the dock shows a plugin panel, and the phone's drawer is
12
+ * a screen the chat can be shown without. The picker therefore asks; whichever
13
+ * layout is mounted answers.
14
+ */
15
+ export const NEW_WORKSPACE_EVENT = 'omp:new-workspace';
16
+
17
+ /** Ask the mounted layout to open the New Workspace dialog. */
18
+ export function requestNewWorkspace(): void {
19
+ window.dispatchEvent(new CustomEvent(NEW_WORKSPACE_EVENT));
20
+ }
@@ -55,8 +55,8 @@ export interface McpServerItem {
55
55
  status?: 'active' | 'inactive' | 'error';
56
56
  }
57
57
 
58
- /** Where a session's server was declared. */
59
- export type McpServerSource = 'user' | 'project' | 'custom' | 'plugin';
58
+ /** Where a session's server was declared. `agent` is the harness's own config. */
59
+ export type McpServerSource = 'user' | 'project' | 'custom' | 'plugin' | 'agent';
60
60
 
61
61
  /** The answer of a real MCP handshake, cached for a minute server-side. */
62
62
  export interface McpProbeResult {
@@ -7,6 +7,7 @@ import type { SurfaceStyle } from '@/shared/lib/theme/surface-style';
7
7
  import type { IconStyle } from '@/shared/lib/theme/icon-style';
8
8
  import type { TrayIconStyle } from '@/shared/lib/theme/tray-icon-style';
9
9
  import type { SettingsSection } from '@/shared/lib/settings/sections';
10
+ import type { GitIdentity } from '@/shared/lib/git/identity';
10
11
 
11
12
  /** Wire protocol for the live agent event stream (chat timeline). */
12
13
  export type SettingsCategoryId =
@@ -25,6 +26,7 @@ export type SettingsCategoryId =
25
26
  | 'connect'
26
27
  // WORKSPACE
27
28
  | 'projects'
29
+ | 'git'
28
30
  // OMP
29
31
  | 'omp'
30
32
  | 'providers'
@@ -83,6 +85,20 @@ export interface SettingsState {
83
85
  * once when the first user message settles, retried once at that run's end;
84
86
  * a later run never re-titles it — and a user-set name is never overwritten. */
85
87
  autoSessionTitle: boolean;
88
+ /**
89
+ * How the Source Control panel writes a commit message. `auto` follows the
90
+ * active chat's harness (omp when no chat is open); `omp` always uses omp's
91
+ * tiny role; `harness` pins one ACP agent; `off` hides the action.
92
+ */
93
+ commitMessageMode: 'auto' | 'omp' | 'harness' | 'off';
94
+ /** Harness id for `harness` mode. Empty means none. */
95
+ commitMessageHarness: string;
96
+ /** Optional `provider/model` override. Empty means the target's default. */
97
+ commitMessageModel: string;
98
+ /** Custom prompt template. Empty means the built-in one. */
99
+ commitMessagePrompt: string;
100
+ /** Saved commit identities (name + email). */
101
+ gitIdentities: GitIdentity[];
86
102
  soundAlerts: boolean;
87
103
  chatCompletionSound: boolean;
88
104
  /**
@@ -28,6 +28,7 @@
28
28
  */
29
29
 
30
30
  import { afterAll } from 'bun:test';
31
+
31
32
  import { mkdtempSync } from 'node:fs';
32
33
  import { tmpdir } from 'node:os';
33
34
  import { join } from 'node:path';
@@ -1 +0,0 @@
1
- import{e,m,Nr}from"./index-rt6ac0kk.js";import{Ai,Hc}from"./index-869bpqcs.js";function g({source:t,name:r,revision:s=0}){let{url:i,loading:n,error:o}=Hc(t,s);if(o)return e(Nr,{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(Ai,{src:i,name:r,className:"flex-1 min-h-0"})}export{g as ImageView};
@@ -1,2 +0,0 @@
1
- import{d,n,o,W,i,u,a,Ve,le,fn,Xl,e,Kn,zs,et,Se,Xt,rA,za,Mp,s,Ne,Ie,m,en,_,tt,tn,f,B,ie,nt,re,fe,_t,qe,sn,ge,Ge,ce,ka,Kr,ln,xa,Y,D,O,js,b,un,qs,Pe,St,Bo,pe,Z,lt,Ji,Zi,Ku,nc,we,je,es,TA,oc,xt,Dt,Nt,sc,Js,_o,Zs,Xs,To,He,Je,na,We,nl,wc,Cc,_a,Ec,km,Sa,No,Qo,Ro,Ct,Xn,us,Fo,Lo,Mo,al,Ya,ol,il,Ir,Fm,Lm,Po,Tc,Pm,Om,$m,Dc,er,_r,Oo,$o,zm,Um,Nc,Ja,Gm,jm,qm,uh,od,dh,dt,id,Hm,Wm,Km,sl,hg,cf,Rc,fl,gf,Af,Ad,hf,_h}from"./index-rt6ac0kk.js";import{Oc,$c,zc,Uc,Gc,jc,qc,vd,ms,Uo,fs,Ai,Wc,gl,Kc,Vc,Yc,Jc,Zc,Xc,eu,tu,nu}from"./index-869bpqcs.js";import{$u,zu,Zo,Uu,Gu}from"./index-x7a5jpvq.js";import{Et,hi,au,ou,su}from"./index-001vebsp.js";import{hs,Da,Qr,yl,lu,cu,Go,uu,bs,Td,_g,ys,vs,ks,Rr,xs,ws,jo,Cs,Es,Bs,Is,yi,qo,_s,Ss,du,Dd,pu,mu,fu,gu,Au,hu,bu,yu}from"./index-5asf5625.js";import{vu}from"./index-cqaz1281.js";import{Qa,Ra}from"./index-df4yxfzd.js";function to(t){let{editorOpen:r,diffOpen:c,settingsOpen:p,offMainScreen:h,onCloseEditor:g,onCloseDiff:v,onCloseSettings:S,onReturnToMain:k}=t;o(()=>_h(()=>{if(r)return g(),!0;if(c)return v(),!0;if(p)return S(),!0;if(h)return k(),!0;return!1}),[r,c,p,h,g,v,S,k])}var bt={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]},no=s(bt);function _e(){let t=es(),[r,c]=n(null),p=a((v,S)=>{c({top:S,bottom:S,left:v,right:v})},[]),h=$u({enabled:t,onLongPress:p}),g=a(()=>c(null),[]);return{anchor:r,close:g,surfaceProps:{onContextMenu:(v)=>{v.preventDefault();let S=v.currentTarget.getBoundingClientRect();c({top:S.top,bottom:S.bottom,left:S.left,right:S.right})},onTouchStart:h.onTouchStart,onTouchMove:h.onTouchMove,onTouchEnd:h.onTouchEnd,onTouchCancel:h.onTouchCancel,onClickCapture:(v)=>{if(!h.consume())return;v.preventDefault(),v.stopPropagation()}}}}var gt=10,io=600000;function ro({activeSessionTitle:t,activeSessionId:r,onOpenSessionSidebar:c,onOpenRightSidebar:p,onNewSession:h,onSelectSession:g}){let{folders:v}=We(),S=Ad(),k=Sa(r),[l,x]=n(null),{hidden:N,setHidden:R}=Hm(),y=_e(),E=u(()=>{let w=Date.now(),C=[];for(let A of v)for(let T of A.sessions??[]){if(T.is_archived===1)continue;let F=rA(String(T.id)),I=T.updated_at?Date.parse(T.updated_at):0,U=F!==void 0&&w-F<=io?F:I;if(F!==void 0&&w-F>io)continue;C.push({id:T.id,title:T.title,folderName:A.name,modified:U})}return C.sort((A,T)=>T.modified-A.modified).slice(0,gt)},[v]),P=t?t.charAt(0).toUpperCase()+t.slice(1):"New session";return e("header",{className:`flex-shrink-0 bg-canvas border-b border-ink/10 flex items-center justify-between ${al} px-3 z-20 titlebar-drag-region select-none`,...Oo(),...y.surfaceProps,style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingLeft:$o(er("0.75rem",!0)),paddingRight:_r("0.75rem",!0),paddingTop:"env(safe-area-inset-top, 0px)"},children:[e("div",{className:"flex items-center space-x-2 flex-1 min-w-0 titlebar-no-drag",children:[e("button",{type:"button",onClick:c,className:"w-9 h-9 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 inline-flex items-center justify-center",title:"Open Sessions","aria-label":"Open Sessions",children:e(no,{size:20,strokeWidth:2})}),e("span",{className:"relative font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:[e(_a,{glow:!0}),e("span",{className:"absolute -top-0.5 -right-1.5 flex",children:e(Dc,{status:S})})]}),e("span",{className:"text-ink/25 font-light text-xs flex-shrink-0 select-none",children:"/"}),e("div",{className:"relative min-w-0 flex-1 max-w-[150px]","data-testid":"session-picker",children:[e("button",{type:"button",onClick:(w)=>{x((C)=>C?null:xt(w.currentTarget))},className:"tap-chip flex w-full items-center space-x-1 text-xs font-semibold text-ink hover:text-ink/80 transition-colors py-1 min-w-0",title:P,"aria-haspopup":"menu","aria-expanded":l!==null,children:[e("span",{className:"truncate",children:P}),k&&e(m,{size:12,className:"animate-spin text-ink/50 flex-shrink-0",role:"status","aria-label":"Generating a session name…"}),e(B,{size:13,className:"text-ink/50 flex-shrink-0"})]}),l&&e(Dt,{anchor:l,align:"start",className:"w-72 bg-paper border border-ink/15 rounded-xl shadow-lg p-2 text-xs",onClose:()=>x(null),children:[e("button",{type:"button",onClick:()=>{x(null),h()},className:"w-full text-left px-3 py-2 rounded-lg bg-ink text-canvas flex items-center space-x-2 font-medium mb-1.5 active:scale-98",children:[e(Y,{size:14}),e("span",{children:"Start New Session"})]}),e("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40",children:"Recent Sessions"}),e("div",{className:"max-h-64 scrollbar-overlay-container space-y-0.5",children:E.length===0?e("div",{className:"px-2.5 py-2 text-ink/40 italic",children:"No sessions yet"}):E.map((w)=>e("button",{type:"button",onClick:()=>{x(null),g(w.id)},className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between space-x-2 transition-colors ${String(r)===String(w.id)?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[e("span",{className:"min-w-0 flex flex-col",children:[e("span",{className:"truncate",children:w.title?w.title.charAt(0).toUpperCase()+w.title.slice(1):"Untitled"}),e("span",{className:"truncate text-[10px] text-ink/40 font-mono",children:w.folderName})]}),String(r)===String(w.id)&&e(f,{size:12,className:"flex-shrink-0"})]},w.id))})]})]})]}),e(Wm,{layout:"mobile",sessionId:r==null?null:String(r),showRightPanel:!1,onToggleRightPanel:p,hidden:N}),y.anchor?e(Po,{anchor:y.anchor,title:"Navbar",align:"right",items:id.filter((w)=>w.id!==dt.install&&w.id!==dt.editor&&w.id!==dt.mobile).map((w)=>({...w,removable:!0})),hidden:N,onToggle:R,onClose:y.close}):null]})}function so({activeSessionId:t,onSelectSession:r,onNewSession:c,onOpenSessionSidebar:p,onOpenRightSidebar:h,appSettings:g={}}){let{folders:v}=We(),[S,k]=n(null),l=u(()=>{if(!t)return"New session";for(let N of v){let R=N.sessions?.find((y)=>String(y.id)===String(t));if(R)return R.title}return null},[t,v]);return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative",children:[e(ro,{activeSessionTitle:S||l||"New session",activeSessionId:t,onOpenSessionSidebar:p,onOpenRightSidebar:h,onNewSession:c,onSelectSession:r}),e("main",{className:"flex-1 min-h-0",children:e(cf,{appSettings:g,onSessionTitle:k,variant:"mobile"})})]})}function ao({onClose:t,viewLabel:r="Sessions",menuProps:c}){return e("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas titlebar-drag-region select-none",...Oo(),...c,style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingLeft:$o(er("0.75rem",!0)),paddingRight:_r("0.75rem",!0),paddingTop:"env(safe-area-inset-top, 0px)"},children:[e("div",{className:"flex items-center space-x-2.5 titlebar-no-drag min-w-0",children:[e("span",{className:"font-bold text-sm tracking-tight flex items-center flex-shrink-0",children:e(_a,{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(Km,{variant:"chip"}),e("button",{type:"button",onClick:t,className:"w-9 h-9 rounded-xl hover:bg-ink/5 active:bg-ink/10 text-ink flex items-center justify-center transition-colors cursor-pointer",title:"Close sidebar","aria-label":"Close sidebar",children:e(b,{size:19,strokeWidth:2})})]})]})}var Te="w-9.5 h-9.5 rounded-xl border active:scale-95 flex items-center justify-center transition-all flex-shrink-0 cursor-pointer shadow-xs",Ee="border-ink/15 bg-paper hover:bg-ink/5 text-ink/80 hover:text-ink",lo="bg-ink/10 text-ink border-ink/30";function co({searchQuery:t,sortOption:r,optionsOpen:c,showArchived:p,optionsRef:h,onNewSession:g,onNewWorkspace:v,onScheduler:S,scheduledCount:k,onRefresh:l,refreshing:x,onToggleOptions:N,onSortChange:R,onResetSort:y,onToggleArchived:E,onHideArchived:P,onSearchChange:w,onClearSearch:C,onSelectWorkspaces:A,selecting:T}){let{ref:F,width:I}=bs(0),U=_g(I),j={};for(let J of Td.slice(0,U))j[J]=!0;let K=Td.slice(U),M=p?"Hide archived sessions":"Show archived sessions",ee=k>0?`Scheduled tasks (${k} armed)`:"Scheduled tasks",X=[];if(K.includes("new-workspace"))X.push({id:"new-workspace",label:"New Workspace",icon:sn,onSelect:v});if(K.includes("refresh"))X.push({id:"refresh",label:"Refresh sessions",icon:D,onSelect:l});if(K.includes("scheduler"))X.push({id:"scheduler",label:ee,icon:Da,onSelect:S});if(K.includes("archive"))X.push({id:"archive",label:M,icon:tt,onSelect:E,active:p});if(K.includes("select"))X.push({id:"select",label:T?"Cancel selection":"Select workspaces",icon:Qr,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:F,className:"flex items-center space-x-2",children:[e("button",{type:"button",onClick:g,"aria-label":"New Session",title:"New Session",className:"flex-1 min-w-0 h-9.5 flex items-center justify-center space-x-2 px-3.5 rounded-xl bg-ink text-canvas hover:bg-ink/90 active:scale-[0.98] text-xs font-semibold transition-all shadow-xs",children:[e(Y,{size:15,strokeWidth:2.4,className:"shrink-0"}),e("span",{className:"min-w-0 truncate",children:"New Session"})]}),j["new-workspace"]&&e("button",{type:"button",onClick:v,className:`${Te} ${Ee}`,title:"New Workspace","aria-label":"New Workspace",children:e(sn,{size:16,strokeWidth:1.8})}),j.scheduler&&e("button",{type:"button",onClick:S,className:`relative ${Te} ${Ee}`,title:ee,"aria-label":k>0?`Scheduled tasks, ${k} armed`:"Scheduled tasks",children:[e(Da,{size:16,strokeWidth:1.8}),k>0&&e("span",{className:"absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-[3px] rounded-full bg-ink text-canvas text-[10px] leading-[13px] text-center font-semibold",children:k>9?"9+":k})]}),j.archive&&e("button",{type:"button",onClick:E,"aria-pressed":p,className:`${Te} ${p?"bg-warning/15 border-warning/40 text-warning":Ee}`,title:M,"aria-label":M,children:e(tt,{size:16,strokeWidth:1.8})}),j.select&&e("button",{type:"button",onClick:A,"aria-pressed":T,className:`${Te} ${T?lo:Ee}`,title:T?"Cancel selection":"Select workspaces","aria-label":T?"Cancel selection":"Select workspaces",children:e(Qr,{size:16,strokeWidth:1.8})}),j.refresh&&e("button",{type:"button",onClick:l,className:`${Te} ${Ee}`,title:"Refresh sessions","aria-label":"Refresh sessions","aria-busy":x,children:e(D,{size:15,strokeWidth:1.8,className:x?"animate-spin":void 0})}),j.sort&&e("div",{className:"relative flex-shrink-0",ref:h,children:[e("button",{type:"button",onClick:N,className:`${Te} ${c||r!=="A-Z"?lo:Ee}`,title:"Sort workspaces","aria-label":"Sort workspaces",children:e(hs,{size:15,strokeWidth:1.8})}),c&&e("div",{className:"glass-popover absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 rounded-xl shadow-xl z-50 p-2 text-xs",children:e(Go,{variant:"mobile",sortOption:r,onSortChange:R})})]}),K.length>0&&e(uu,{actions:X,sortHidden:K.includes("sort"),sortOption:r,onSortChange:R,layout:"mobile"})]}),e("div",{className:"relative flex items-center",children:[e(O,{size:14,className:"absolute left-3 text-ink/40"}),e("input",{type:"text",value:t,onChange:(J)=>w(J.currentTarget.value),placeholder:"Search workspaces & sessions...",className:"w-full bg-paper border border-ink/15 rounded-xl pl-8 pr-8 py-2 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),t&&e("button",{type:"button",onClick:C,className:"absolute right-2.5 text-ink/40 hover:text-ink p-1","aria-label":"Clear search",children:e(b,{size:13})})]}),(p||r!=="A-Z")&&e("div",{className:"flex items-center space-x-1.5 flex-wrap gap-y-1 pt-0.5",children:[r!=="A-Z"&&e("span",{className:"inline-flex items-center space-x-1 bg-ink/5 border border-ink/10 text-ink/80 rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e("span",{children:["Sort: ",r.replace("_"," ")]}),e("button",{type:"button",onClick:y,className:"hover:text-ink ml-0.5",title:"Reset sort",children:e(b,{size:10})})]}),p&&e("span",{className:"inline-flex items-center space-x-1 bg-warning/15 border border-warning/25 text-warning rounded-lg px-2 py-0.5 text-[10px] font-mono",children:[e(tt,{size:10}),e("span",{children:"Archived"}),e("button",{type:"button",onClick:P,className:"hover:text-warning-hover ml-0.5",title:"Hide archived",children:e(b,{size:10})})]})]})]})}var vt="p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink";function po({folder:t,canWorktree:r,onOpenFolder:c,onNewWorktree:p,onSelectSessions:h,confirmDelete:g,onPin:v,onDelete:S,onRequestDelete:k,onCancelDelete:l}){let[x,N]=n(!1),R=i(null),[y,E]=n(null),P=(w)=>()=>{N(!1),w()};return e("div",{className:"relative flex items-center",onClick:(w)=>w.stopPropagation(),children:[e("button",{ref:R,type:"button",onClick:(w)=>{if(w.stopPropagation(),R.current)E(xt(R.current));N((C)=>!C)},className:vt,title:"Workspace options","aria-label":`Options for ${t.name}`,"aria-haspopup":"menu","aria-expanded":x,children:e(Ie,{size:15})}),e(Dt,{anchor:x?y:null,align:"end",ariaLabel:`Options for ${t.name}`,className:"w-48 rounded-lg border border-ink/15 bg-paper py-1 text-xs shadow-lg",onClose:()=>{N(!1),l()},children:e(Bs,{variant:"mobile",isPinned:t.isPinned,onOpenFolder:c?P(c):void 0,onNewWorktree:r&&p?P(p):void 0,onSelectSessions:h?P(h):void 0,confirmDelete:g,onPin:P(v),onDelete:P(S),onRequestDelete:k,onCancelDelete:l})})]})}var mo={inset:"",insetPx:0,slotWidth:16,markGap:8,padding:"py-2",glyph:Je.touch};function uo({session:t,harness:r,isActive:c,status:p,awaitingInput:h=!1,timeAgo:g,timeTitle:v,runStartedAt:S,expandable:k=!1,isExpanded:l=!1,onToggleExpand:x,isChild:N=!1,folderId:R,onSelect:y,onArchive:E,onDelete:P,onRename:w,onRenameWithAi:C,waitingFor:A,onCancelWait:T,selectable:F=!1,selected:I=!1,onToggleSelect:U}){let{isEditing:j,draft:K,setDraft:M,inputRef:ee,startRename:X,handleKeyDown:J,handleBlur:me}=Ro(t.title,w),de=Sa(t.id),oe=Fo(),te=oe.anchor!==null,G=Boolean(w||E||P||T),Q=Boolean(A),ae=k&&Boolean(x),ne=t.title.charAt(0).toUpperCase()+t.title.slice(1);if(j)return e("div",{className:"w-full rounded-lg flex items-center bg-ink/10",children:e("input",{ref:ee,autoFocus:!0,value:K,onChange:(q)=>M(q.currentTarget.value),onKeyDown:J,onBlur:me,className:"flex-1 min-w-0 mx-2 my-1.5 bg-paper border border-ink/25 rounded px-2 py-1 text-xs text-ink outline-none focus:border-ink/50"})});return e(d,{children:[e("div",{"data-testid":"session-item","data-session-id":String(t.id),"data-menu-open":te?"true":void 0,onContextMenu:G&&!F?oe.openAtCursor:void 0,className:`w-full rounded-lg flex items-center transition-colors ${F&&I||te?Es:c?"bg-ink/10 font-medium text-ink":"hover:bg-ink/5 text-ink/85"}`,children:[e("button",{type:"button",onClick:F?U:y,className:"flex-1 text-left py-2 flex items-center justify-between min-w-0",children:[e("div",{className:"flex items-center min-w-0 pr-2",children:[F?e(Rr,{checked:I,label:`Select ${t.title}`,onChange:()=>U?.()}):e("span",{className:"w-4 flex-shrink-0 flex items-center justify-center",children:de?e("span",{role:"status","aria-label":"Generating a name…",children:e(m,{size:13,className:"text-ink/50 animate-spin"})}):h?e(Ne,{size:13,className:"text-ink/70 animate-pulse"}):Q?e("span",{role:"status","aria-label":`Waiting for ${A?.title??"another session"}`,children:e(Ge,{size:13,className:"text-ink/60 animate-pulse"})}):p==="stream"?e("span",{role:"status","aria-label":"Running",children:e(m,{size:13,className:"text-ink/50 animate-spin"})}):p?e(f,{size:13,className:"text-ink/50"}):N?e("span",{"data-testid":"child-indicator",className:"text-ink/35","aria-hidden":"true",children:e(ge,{size:13})}):null}),e("span",{className:"flex flex-col min-w-0 ml-2 leading-snug",children:[e("span",{className:"flex min-w-0 items-center",children:[r&&e("span",{className:"mr-1.5 flex shrink-0 items-center",children:e(He,{harness:r,size:Je.touch})}),e("span",{className:"min-w-0 truncate text-xs",children:ne})]}),Q&&e("span",{className:"text-[10px] text-ink/40 truncate",children:["waiting for ",A?.title??"another session"]}),t.worktree?e(xs,{worktree:t.worktree}):null]})]}),e(Cs,{timeAgo:g,timeTitle:v,runStartedAt:S,className:"text-[11px] font-mono flex-shrink-0 ml-2",restingClassName:"text-ink/45"})]}),G&&!F&&e("button",{type:"button",onClick:oe.openBelow,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":te,className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 text-ink/35 hover:text-ink rounded-lg cursor-pointer",children:e(Ie,{size:16})}),ae&&!F&&e("button",{type:"button",onClick:x,title:l?"Collapse sessions and subagents":"Expand sessions and subagents","aria-expanded":l,"aria-label":l?"Collapse sessions and subagents":"Expand sessions and subagents",className:"flex-shrink-0 py-1.5 pl-1.5 pr-1 flex items-center justify-center text-ink/50 hover:text-ink rounded-lg cursor-pointer",children:l?e(B,{size:14}):e(ie,{size:14})})]}),oe.anchor&&e(Lo,{anchor:oe.anchor,sessionId:t.id,...r?{harness:r}:{},...R!==void 0?{folderId:R}:{},isArchived:t.is_archived===1,onRename:w?X:void 0,onRenameWithAi:C,onArchive:E,onDelete:P,onCancelWait:T,onClose:oe.close})]})}function fo(t,r){let[c,p]=n(!1);return{open:()=>p(!0),dialog:c?e(Mo,{isOpen:!0,onClose:()=>p(!1),root:t.project_path??null,folderId:t.id,folderName:t.name,onCreated:(h)=>{p(!1),r(h.path)}}):null}}function ho({hiddenCount:t,canShowLess:r,onShowMore:c,onShowLess:p}){if(t<=0&&!r)return null;return e("div",{className:"flex items-center gap-1",children:[t>0&&e("button",{type:"button",onClick:c,className:"flex items-center min-w-0 text-left py-2 pr-3 text-xs text-ink/60 hover:text-ink",children:[e("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:e(B,{size:12})}),e("span",{className:"w-2 shrink-0"}),e("span",{className:"truncate",children:["Show more sessions (",t,")"]})]}),r&&e("button",{type:"button",onClick:p,className:"ml-auto shrink-0 flex items-center gap-1 text-xs text-ink/60 hover:text-ink pl-3 py-2",children:[e(nt,{size:12}),e("span",{className:"truncate",children:"Show less"})]})]})}function bo(t){return t?"mb-4":"mb-1"}function go({folder:t,activeSessionId:r,onSelectSession:c,onNewSessionForFolder:p,onNewWorktreeSession:h,isExpanded:g,onToggleExpand:v,showArchived:S=!1,sessionStatus:k={},onToast:l,batch:x,onStartSessionSelection:N,onCancelWait:R}){let{visibleCount:y,showMore:E,showLess:P,canShowLess:w}=vs(),C=fo(t,(H)=>h?.(t.id,H)),{refresh:A,runStartedAtMap:T}=We(),{expandedSessionIds:F,toggleSession:I}=us(),[U]=le(),j=U.get("subagent"),K=U.get("sessionId"),{confirmDelete:M,requestDelete:ee,cancelDelete:X,handlePin:J,handleDelete:me,handleArchive:de,handleRename:oe,handleRenameWithAi:te,handleOpenFolder:G}=ks(t,A,l),Q=No(),ae=J,ne=me,q=G??void 0,ve=(t.sessions||[]).filter((H)=>S?H.is_archived===1:H.is_archived!==1),ye=na(t.icon),{folderCheckbox:ke,sessionCheckboxes:he,folderSummary:z,toggleFolderSelection:L,rendered:V,hiddenCount:ue}=_s({batch:x,folder:t,sessions:ve,showArchived:S,visibleCount:y,activeSessionId:r,sessionStatus:k}),Oe=qo(V),Re=g||he,Be=(H,Ce)=>{let se=String(H.id),xe=String(r)===se,ze=xe&&K===se&&Boolean(j),Me=Ct(se);return e(uo,{session:H,harness:H.harness,folderId:H.folder_id,isActive:xe&&!ze,status:k[se],awaitingInput:Boolean(H.awaitingInput),timeAgo:ws(H.updated_at??H.created_at),timeTitle:jo(H.updated_at??H.created_at),runStartedAt:k[se]==="stream"?T[se]:void 0,expandable:Ce.expandable,isChild:Ce.isChild,isExpanded:Ce.isExpanded,onToggleExpand:Ce.onToggleExpand,onSelect:()=>c(H.id),onArchive:()=>de(H),onDelete:Me?void 0:()=>Q.requestDelete(H),onRename:Me?void 0:(Ue)=>void oe(H,Ue),onRenameWithAi:Me?void 0:()=>void te(H),waitingFor:H.waitingFor?{title:H.waitingFor.title}:void 0,onCancelWait:H.waitingFor?()=>R?.(H.waitingFor.waitId):void 0,selectable:he,selected:Boolean(x?.selected.includes(se)),onToggleSelect:x?()=>x.toggle(se):void 0})},De=(H)=>Is(H,Oe.childrenOf,F,I);return e("div",{className:bo(Re),"data-testid":"session-folder",children:[e("div",{onClick:x?void 0:v,className:"flex items-center justify-between gap-2 py-1 cursor-pointer hover:bg-ink/5 rounded-lg select-none transition-colors",children:[e("div",{className:"flex items-center space-x-2 min-w-0",children:[ke&&z?e(Rr,{size:"md",checked:z.all,indeterminate:z.some,label:`Select ${t.name}`,onChange:L}):e(d,{children:e("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:t.customIconUrl?e("img",{src:t.customIconUrl,alt:"",className:"w-[15px] h-[15px] rounded-xs object-contain",referrerPolicy:"no-referrer"}):t.iconType==="chat"?e(ln,{size:15,className:"text-ink/80"}):e(ye,{size:15,className:"text-ink/80",style:{color:t.accentColor||void 0}})})}),e("span",{className:"text-sm font-semibold text-ink truncate",children:t.name})]}),e("div",{className:"flex items-center space-x-2 text-xs text-ink/60",children:[e("span",{className:"font-mono text-[11px] text-ink/70",children:ve.length}),t.project_path&&e(ge,{size:13,className:"text-ink/50 ml-1"}),!x&&e(d,{children:[e("button",{type:"button",onClick:(H)=>{H.stopPropagation(),p(t.id)},className:"p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink",title:"New Session","aria-label":`New session in ${t.name}`,children:e(Y,{size:15})}),e(po,{folder:t,canWorktree:Boolean(h&&t.project_path),onOpenFolder:q,onNewWorktree:h?()=>C.open():void 0,onSelectSessions:N?()=>N(t.id):void 0,confirmDelete:M,onPin:ae,onDelete:ne,onRequestDelete:ee,onCancelDelete:X}),e("span",{className:"flex items-center justify-center pr-1",children:g?e(B,{size:14}):e(ie,{size:14})})]})]})]}),Re&&e("div",{className:"mt-0.5 space-y-0.5",children:[Oe.roots.map((H)=>{let Ce=String(H.id),se=De(H);return e("div",{className:"space-y-0.5",children:[Be(H,se),se.isExpanded&&e(yi,{parentId:Ce,hasSubagents:Boolean(H.hasSubagents),childrenOf:Oe.childrenOf,expandedIds:F,onToggle:I,activeSessionId:r===null?null:String(r),renderSession:Be,style:mo})]},H.id)}),e(ho,{hiddenCount:he?0:ue,canShowLess:!he&&w,onShowMore:E,onShowLess:P})]}),e(Qo,{session:Q.pending,isDeleting:Q.isDeleting,error:Q.error,onClose:Q.cancelDelete,onConfirm:()=>void Q.confirmDelete()}),C.dialog]})}function vo({folders:t,activeSessionId:r,expandedFolders:c,showArchived:p,sessionStatus:h,onSelectSession:g,onNewSessionForFolder:v,onNewWorktreeSession:S,onToggleFolder:k,onToast:l,batch:x,onStartSessionSelection:N,onCancelWait:R}){return e("div",{className:"flex-1 scrollbar-overlay-container pl-3 pr-2 py-3",children:t.length===0?e("div",{className:"text-center py-12 text-xs text-ink/50 italic",children:"No matching sessions found"}):t.map((y)=>e(go,{folder:y,activeSessionId:r,onSelectSession:g,onNewSessionForFolder:v,onNewWorktreeSession:S,isExpanded:c[y.id]??!0,onToggleExpand:()=>k(y.id),showArchived:p,sessionStatus:h,onToast:l,batch:x,onStartSessionSelection:N,onCancelWait:R},y.id))})}var kt=[3,2];function xo(){return e("div",{className:"flex-1 p-3 space-y-4","aria-hidden":"true",children:kt.map((t,r)=>e("div",{className:"space-y-2",children:[e("div",{className:"flex items-center gap-2 py-2",children:[e("span",{className:"w-4 h-4 rounded-sm animate-pulse bg-ink/10"}),e("span",{className:"h-3 w-24 rounded animate-pulse bg-ink/10"})]}),Array.from({length:t},(c,p)=>e("div",{className:"flex items-center gap-2 rounded py-2",children:[e("span",{className:"w-4 h-4 rounded-full animate-pulse bg-ink/10"}),e("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${58-p%3*12}%`}})]},p))]},r))})}function So({folders:t,initializing:r,failed:c,activeSessionId:p,expandedFolders:h,sessionStatus:g,searchQuery:v,sortOption:S,optionsOpen:k,showArchived:l,harnessFilter:x,onHarnessFilterChange:N,harnessOptions:R,optionsRef:y,scheduledCount:E,refreshing:P,selecting:w,batch:C,onNewSession:A,onNewWorkspace:T,onScheduler:F,onRefresh:I,onToggleOptions:U,onSortChange:j,onResetSort:K,onToggleArchived:M,onHideArchived:ee,onSearchChange:X,onClearSearch:J,onSelectWorkspaces:me,onSelectSession:de,onNewSessionForFolder:oe,onNewWorktreeSession:te,onToggleFolder:G,onToast:Q,onStartSessionSelection:ae,onCancelWait:ne}){return e(d,{children:[e(co,{searchQuery:v,sortOption:S,optionsOpen:k,showArchived:l,optionsRef:y,onNewSession:A,onNewWorkspace:T,onScheduler:F,scheduledCount:E,onRefresh:I,refreshing:P,onToggleOptions:U,onSortChange:j,onResetSort:K,onToggleArchived:M,onHideArchived:ee,onSearchChange:X,onClearSearch:J,onSelectWorkspaces:me,selecting:w}),e("div",{className:"px-3 pt-2 pb-1",children:e(ys,{options:R,value:x,onChange:N,touch:!0})}),c?e(Ss,{touch:!0,onRetry:I,refreshing:P}):r?e(xo,{}):e(vo,{folders:t,activeSessionId:p,expandedFolders:h,showArchived:l,sessionStatus:g,onSelectSession:de,onNewSessionForFolder:oe,onNewWorktreeSession:te,onToggleFolder:G,onToast:Q,batch:C,onStartSessionSelection:ae,onCancelWait:ne})]})}function ko({onSettings:t,onKeyBindings:r,onAbout:c,updateAvailable:p,onUpdateClick:h,onDesktopToggle:g,shellDownload:v}){return e("div",{className:"px-3 pt-3 border-t border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas text-xs text-ink/60",style:{paddingBottom:"max(0.75rem, env(safe-area-inset-bottom, 0px))"},children:[e("div",{className:"flex items-center space-x-3",children:[e("button",{type:"button",onClick:t,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(js,{size:14}),e("span",{children:"Settings"})]}),e("button",{type:"button",onClick:r,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(ka,{size:14}),e("span",{children:"Keys"})]}),e("button",{type:"button",onClick:c,className:"flex items-center space-x-1 hover:text-ink transition-colors",children:[e(ce,{size:14}),e("span",{children:"About"})]}),v&&e($m,{download:v,variant:"label"}),g&&e("button",{type:"button",onClick:g,className:"flex items-center space-x-1 hover:text-ink transition-colors",title:"Switch to desktop view",children:[e(xa,{size:14}),e("span",{children:"Desktop"})]})]}),e("div",{className:"flex items-center gap-2",children:[e("span",{className:"font-mono text-[10px] text-ink/40",children:["v",Cc.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 wo(t){let r=zm(),c=Om();return we(Ec,()=>{t.onClose(),t.openAbout(),r.apply("kabmo").then((p)=>{if(!p)return;t.pushToast(p.message,nc(p))})}),Um(r,t.pushToast),{updates:r,shellDownload:c}}function yo(t,r,c){return t.filter((p)=>p.id!==r&&!(c&&p.side==="left"))}function Co(t){return t}function Eo(t,r=0){let{scrollLeft:c,clientWidth:p,scrollWidth:h,start:g,size:v}=t,S=Math.max(0,h-p),k=g-r,l=g+v+r;if(v+r*2>=p)return Math.max(0,Math.min(S,k));let x=c;if(k<c)x=k;else if(l>c+p)x=l-p;return Math.max(0,Math.min(S,x))}var wt=8;function Ke({panels:t,activeId:r,onSelect:c,hasGitChanges:p=!1}){let h=i(null),g=i(new Map),v=i({activeId:r,panels:t});v.current={activeId:r,panels:t};let S=i({signature:"",width:0}),k=a(()=>{let l=h.current,x=g.current.get(v.current.activeId);if(!l||!x||l.clientWidth<=0)return;let N=`${v.current.activeId}\x00${v.current.panels.map((w)=>w.id).join("\x00")}`,R=S.current;if(R.signature===N&&R.width===l.clientWidth)return;S.current={signature:N,width:l.clientWidth};let y=l.getBoundingClientRect(),E=x.getBoundingClientRect(),P=Eo({scrollLeft:l.scrollLeft,clientWidth:l.clientWidth,scrollWidth:l.scrollWidth,start:E.left-y.left+l.scrollLeft,size:E.width},wt);if(P!==l.scrollLeft)l.scrollLeft=P},[]);return W(k,[r,t,k]),o(()=>{let l=h.current;if(!l||typeof ResizeObserver>"u")return;let x=new ResizeObserver(k);return x.observe(l),()=>x.disconnect()},[k]),e("div",{ref:h,className:"flex items-center space-x-1.5 overflow-x-auto no-scrollbar py-1",children:t.map((l)=>{let x=l.id===r;return e("button",{ref:(N)=>{if(N)g.current.set(l.id,N);else g.current.delete(l.id)},type:"button",onClick:()=>c(l.id),"aria-pressed":x,"aria-label":l.title,className:`relative flex shrink-0 items-center transition-all cursor-pointer ${x?"space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-ink text-canvas shadow-sm":"p-2 rounded-lg text-ink/70 hover:bg-ink/5"}`,title:l.title,children:[e(nl,{panelId:l.id,builtin:l.builtin,icon:l.builtin?l.icon:void 0,name:l.builtin?l.label:l.name,...l.iconUrl?{iconUrl:l.iconUrl}:{},...l.color?{color:l.color}:{},size:fn}),x&&e("span",{className:`shrink-0 whitespace-nowrap ${l.id==="git"?"tracking-wide":""}`,children:l.label}),l.id==="git"&&p&&e("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full bg-info",title:"Uncommitted changes"})]},l.id)})})}function Do({panels:t,activeId:r,onSelect:c,menuProps:p}){return e("div",{className:"px-3 py-1.5 border-b border-ink/10 bg-canvas flex-shrink-0",...p,children:e(Ke,{panels:t,activeId:r,onSelect:c})})}function Ao({panelKey:t,panel:r,body:c}){if(!r)return e("div",{className:"flex-1 min-h-0",children:e(Tc,{panelKey:t})});return e("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:e(Ve,{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(Bo,{value:c,children:r.render(c)})})})}function Io({activeSessionId:t,newWorkspaceOpen:r,onCloseNewWorkspace:c,schedulerOpen:p,onCloseScheduler:h,aboutOpen:g,onCloseAbout:v,updates:S,pushToast:k,batchDelete:l,batchMode:x,onEndBatch:N,scopeLabel:R}){return e(d,{children:[e(yl,{isOpen:r,onClose:c,onCreate:fu,onClone:gu}),e(cu,{isOpen:p,onClose:h,activeSessionId:t===null?null:String(t),onToast:k}),e(km,{isOpen:g,onClose:v,updates:S,onToast:k}),e(Pm,{updates:S}),e(yu,{mode:x??"session",count:l.pending.length,scopeLabel:R,isDeleting:l.isDeleting,progress:l.progress,outcome:l.outcome,onClose:()=>{let y=l.outcome?.refused.length??0;if(l.cancel(),l.outcome&&y===0)N()},onConfirm:()=>{let y=x??"session";l.confirm(y).then((E)=>{if(E&&E.refused.length===0)N()})}})]})}function Wo(){let t=St(),r=Ir("left"),[c,p]=za("layout.mobileLeftPanel",Pe),h=Fm(c,t.enabled);return{catalog:r,activeView:h,setActiveView:p,showingSessions:h===Pe,activePanel:r.find((g)=>g.id===h),enabled:t.enabled}}function zo(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 Ho({appSettings:t,onSelectSession:r,onClose:c,rootPath:p,refreshKey:h,onRefresh:g,onOpenFile:v}){let S=pu(t,{onSelectSession:r,onAfterSelect:c}),{folders:k,processedFolders:l,refreshNow:x,showArchived:N,activeSessionId:R}=S,y=hu(l,N,x),[E,P]=n({1:!0,2:!0,3:!0}),w=i(null);pe(w,()=>S.setOptionsOpen(!1));let C=(I)=>{P((K)=>({...K,[I]:!K[I]}));let U=k.find((K)=>K.id===I),j=!(E[I]??U?.isExpanded??!0);Dd(I,j)},A=l.map((I)=>`${I.id}:${I.isExpanded}`).join("|");o(()=>{P(Object.fromEntries(l.map((I)=>[I.id,I.isExpanded])))},[A]);let T=Wo(),F=zo({sessionId:R,refreshKey:h,rootPath:p,onRefresh:g,onOpenFile:v,onClose:c,requiresWorkspace:T.activePanel?.requiresWorkspace??!1,hasActiveContext:Boolean(p)});return{controller:S,batch:y,expandedFolders:E,toggleFolder:C,optionsRef:w,dock:T,dockBody:F}}function $e(t){let{disabledPanels:r}=un(),{setEnabled:c}=qs(),p=_e(),h=Lm(t),g=a((v,S)=>{c(v,S)},[c]);return{...p,items:h,hidden:r,toggle:g}}function Vo({activeSessionId:t,onSelectSession:r,onNewSession:c,onNewSessionForFolder:p,onNewWorktreeSession:h,onClose:g,onDesktopToggle:v,appSettings:S={},rootPath:k,refreshKey:l=0,onRefresh:x,onOpenFile:N}){let{controller:R,batch:y,expandedFolders:E,toggleFolder:P,optionsRef:w,dock:C,dockBody:A}=Ho({appSettings:S,onSelectSession:r,onClose:g,rootPath:k,refreshKey:l,onRefresh:x,onOpenFile:N}),{initializing:T,failed:F,refreshNow:I,isRefreshing:U,searchQuery:j,setSearchQuery:K,showArchived:M,setShowArchived:ee,optionsOpen:X,setOptionsOpen:J,sortOption:me,handleSortChange:de,harnessFilter:oe,setHarnessFilter:te,harnessOptions:G,processedFolders:Q,sessionStatus:ae,handleSelectSession:ne}=R,{selection:q,deleteRun:ve,archiveRun:ye,binding:ke,scopeFolder:he,available:z,selected:L}=y,V=vu(),ue=$e("left"),[Oe,Re]=n(!1),[Be,De]=n(!1),H=lu(),[Ce,se]=n(!1),{pushToast:xe}=je(),ze=il(xe);mu({onNotice:xe});let{updates:Me,shellDownload:Ue}=wo({onClose:g,openAbout:()=>se(!0),pushToast:xe}),Ye=()=>{c(),g()},ft=()=>{ye.archive(L).then((be)=>{if(!be)return;let Fe=Au(be);if(Fe)xe(Fe.message,Fe.tone);if(!be.error)q.end()})},Qe=(be)=>{p(be),g()},eo=()=>{ee(!M)},oo=h?(be,Fe)=>{h(be,Fe),g()}:void 0,ht={className:"flex-1 min-h-0 w-full",folders:Q,initializing:T,failed:F,activeSessionId:t,sessionStatus:ae,searchQuery:j,onSearchChange:K,showArchived:M,onToggleArchived:eo,sortOption:me,optionsOpen:X,onToggleOptions:()=>J(!X),onCloseOptions:()=>J(!1),onSortChange:de,harnessFilter:oe,onHarnessFilterChange:te,harnessOptions:G,onRefresh:I,refreshing:U,scheduledCount:H,onNewSession:Ye,onNewWorkspace:()=>Re(!0),onScheduler:()=>De(!0),onSelectSession:ne,onNewSessionForFolder:Qe,onNewWorktreeSession:oo,onToast:xe,onCancelWait:ze,batch:ke,onSelectWorkspaces:y.toggleWorkspaceSelection,onStartSessionSelection:(be)=>q.begin("session",be)};return e("div",{className:"flex flex-col h-full w-full bg-canvas text-ink relative select-none",children:[e(ao,{onClose:g,viewLabel:C.showingSessions?"Sessions":C.activePanel?.label??"Panel",menuProps:ue.surfaceProps}),Co(C.enabled)?e(Do,{panels:C.catalog,activeId:C.activeView,onSelect:C.setActiveView,menuProps:ue.surfaceProps}):null,ue.anchor?e(Po,{anchor:ue.anchor,items:ue.items,hidden:ue.hidden,onToggle:ue.toggle,onClose:ue.close}):null,e("div",{className:C.showingSessions?"contents":"hidden",children:[V==="modern"?e(du,{...ht,touch:!0}):e(So,{folders:Q,initializing:T,failed:F,activeSessionId:t,expandedFolders:E,sessionStatus:ae,searchQuery:j,sortOption:me,optionsOpen:X,showArchived:M,harnessFilter:oe,onHarnessFilterChange:te,harnessOptions:G,optionsRef:w,scheduledCount:H,refreshing:U,selecting:q.mode!==null,batch:ke,onNewSession:Ye,onNewWorkspace:()=>Re(!0),onScheduler:()=>De(!0),onRefresh:I,onToggleOptions:()=>J(!X),onSortChange:de,onResetSort:()=>de("A-Z"),onToggleArchived:eo,onHideArchived:()=>ee(!1),onSearchChange:K,onClearSearch:()=>K(""),onSelectWorkspaces:y.toggleWorkspaceSelection,onSelectSession:ne,onNewSessionForFolder:Qe,onNewWorktreeSession:oo,onToggleFolder:P,onToast:xe,onStartSessionSelection:(be)=>q.begin("session",be),onCancelWait:ze}),q.mode&&e(bu,{drawer:!0,mode:q.mode,count:L.length,total:z.length,busy:ve.isDeleting,archiving:ye.isArchiving,scopeLabel:he?.name,onSelectAll:()=>q.selectAllOf(z),onUnselectAll:()=>q.unselectAllOf(z),onDelete:()=>ve.request(L),onArchive:ft,onCancel:q.end})]}),C.showingSessions?null:e(Ao,{panelKey:C.activeView,panel:C.activePanel,body:A}),e(ko,{onSettings:()=>window.dispatchEvent(new CustomEvent("omp:open-settings",{detail:{}})),onKeyBindings:Nc,onAbout:()=>se(!0),shellDownload:Ue,onDesktopToggle:v,updateAvailable:Me.hasUpdate,onUpdateClick:()=>{se(!0),Me.check()}}),e(Io,{activeSessionId:t,newWorkspaceOpen:Oe,onCloseNewWorkspace:()=>Re(!1),schedulerOpen:Be,onCloseScheduler:()=>De(!1),aboutOpen:Ce,onCloseAbout:()=>se(!1),updates:Me,pushToast:xe,batchDelete:ve,batchMode:q.mode,onEndBatch:q.end,scopeLabel:he?.name})]})}var yt="terminal";function Ze(t){return t===yt}function Ae(t){if(Ze(t))TA()}function Ko({enabled:t=!0,rootPath:r,refreshKey:c=0,onRefresh:p,onOpenFile:h,onClose:g}){let[v,S]=za("layout.mobileRightPanel",Xl),k=St(),l=yo(Ir("all"),Pe,k.enabled),x=l.find((A)=>A.id===v)??l[0],N=Mp(r,t),{changes:R}=zs(r,N,t),y=R.length>0,E=a((A)=>{if(A!==x?.id)Ae(A);S(A)},[x?.id,S]);o(()=>{if(!Ze(x?.id))oc()},[x?.id]);let P=$e(k.enabled?"right":"all"),w=k.enabled?P.items:P.items.filter((A)=>A.id!==Pe),C={className:"h-full w-full",enabled:t||!x?.requiresWorkspace,active:!0,refreshKey:c,...r?{rootPath:r}:{},onRefresh:p,onOpenFile:h,onClose:g,showHeader:!1,layout:"phone"};return e("div",{className:"flex flex-col h-full w-full bg-paper text-ink relative select-none",children:[e("div",{className:"border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0 bg-canvas titlebar-drag-region select-none",...Oo(),...P.surfaceProps,style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:$o(er("0.75rem",!0)),paddingRight:_r("0.75rem",!0)},children:[e("div",{className:"flex items-center min-w-0 titlebar-no-drag",children:e(Ke,{panels:l,activeId:x?.id??v,onSelect:E,hasGitChanges:y})}),e("button",{type:"button",onClick:g,className:"p-1.5 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0 ml-2 titlebar-no-drag",title:"Close right sidebar","aria-label":"Close right sidebar",children:e(b,{size:20,strokeWidth:1.8})})]}),P.anchor?e(Po,{anchor:P.anchor,align:"right",items:w,hidden:P.hidden,onToggle:P.toggle,onClose:P.close}):null,e("div",{className:"flex-1 min-h-0 overflow-hidden relative",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:x?e(Ve,{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(Bo,{value:C,children:x.render(C)})}):e("div",{className:"h-full flex items-center justify-center text-ink/40",children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})})})]})}function Xo({fileName:t,hasPreview:r,isPreview:c,hasReview:p,isReviewing:h,onToggleReview:g,wordWrap:v,copied:S,byteViewer:k=!1,missing:l=!1,onSave:x,onClose:N,onTogglePreview:R,onToggleFind:y,findOpen:E,onToggleWrap:P,onZoomOut:w,onZoomIn:C,onCopy:A,onDownload:T}){return e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0",style:{height:"calc(3rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:er("0.75rem",!0),paddingRight:_r("0.75rem",!0)},children:[e("div",{className:"flex items-center space-x-2 min-w-0 pr-2",children:[e("button",{type:"button",onClick:N,className:"p-1.5 rounded-lg hover:bg-ink/10 text-ink transition-colors active:scale-90 flex-shrink-0 cursor-pointer",title:"Close editor","aria-label":"Close editor",children:e(tn,{size:18,strokeWidth:2})}),e("div",{className:"flex items-center space-x-1.5 truncate",children:[e(lt,{name:t,size:15,className:`flex-shrink-0${l?" text-error":""}`}),e("span",{className:`font-semibold text-xs truncate${l?" text-error line-through":" text-ink"}`,children:t})]})]}),e("div",{className:"flex items-center space-x-1 text-ink/70 flex-shrink-0",children:[l&&x&&e("button",{type:"button",onClick:x,className:"p-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer",title:"Save and recreate the file","aria-label":"Save and recreate the file",children:e(Et,{size:15})}),!k&&e("button",{type:"button",onClick:y,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${E?"bg-ink text-canvas":""}`,title:E?"Close find":"Find in file","aria-label":E?"Close find":"Find in file","aria-pressed":E,children:e(O,{size:15})}),p&&e("button",{type:"button",onClick:g,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${h?"bg-ink text-canvas":""}`,title:h?"Exit review mode":"Review this document","aria-label":h?"Exit review mode":"Review this document","aria-pressed":h,children:e(ln,{size:15})}),r&&e("button",{type:"button",onClick:R,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${c?"bg-ink text-canvas":""}`,title:c?"View source":"Show preview","aria-label":c?"View source":"Show preview",children:c?e(_t,{size:15}):e(qe,{size:15})}),!k&&e(d,{children:[e("button",{type:"button",onClick:P,className:`p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer ${v?"text-ink":""}`,title:"Toggle word wrap",children:e(en,{size:15})}),e("button",{type:"button",onClick:w,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Decrease font size",children:e(Ra,{size:15})}),e("button",{type:"button",onClick:C,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Increase font size",children:e(Qa,{size:15})})]}),e("button",{type:"button",onClick:A,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Copy content",children:S?e(f,{size:15,className:"text-success"}):e(re,{size:15})}),e("button",{type:"button",onClick:T,className:"p-1.5 rounded hover:bg-ink/10 transition-colors cursor-pointer",title:"Download file",children:e(fe,{size:15})})]})]})}function Yo({fileName:t,content:r,path:c,root:p,repo:h,fontSize:g,scrollRef:v,onScroll:S,isLoading:k,unsupported:l,loadError:x,reviewActive:N,onExitReview:R}){return e("div",{ref:v,onScroll:S,"data-testid":"editor-scroller",className:"flex-1 min-h-0 overflow-auto relative bg-paper text-ink select-text",children:k?e("div",{className:"flex items-center justify-center h-full text-ink/40 text-xs gap-2",children:[e(m,{size:14,className:"animate-spin"}),e("span",{children:"Loading file content..."})]}):l?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(Oc,{size:20,className:"text-ink/40"}),e("span",{className:"text-xs text-ink/70 font-sans",children:[t," cannot be opened here"]}),e("span",{className:"text-[11px] text-ink/50 font-sans max-w-[42ch]",children:l})]}):x?e("div",{className:"flex flex-col items-center justify-center h-full gap-2 px-6 text-center",children:[e(_,{size:20,className:"text-error"}),e("span",{className:"text-xs text-error font-sans",children:["Could not read ",t]}),e("span",{className:"text-[11px] text-ink/50 font-mono break-all",children:x})]}):e("div",{className:"p-4 bg-paper text-ink min-h-full font-sans",style:{fontSize:`${g}px`},children:e(zc,{content:r,file:{name:t,path:c,root:p,repo:h},active:N,onExit:R})})})}function Jo({file:t,editor:r,viewerKind:c,byteViewer:p,isPreview:h,isMd:g,content:v,language:S,wordWrap:k,fileKey:l,revealMarks:x,currentMark:N,surfaceRef:R,setCodeScroller:y,previewRef:E,scroll:P,fontSize:w,reviewActive:C,onExitReview:A,editorTheme:T,editorFontFamily:F,indentUnitText:I,typing:U}){let j=a(async(K)=>{let M=await Vc(t,K,{interactive:!0,baseMtimeMs:r.baseMtimeMs});if(M.status==="written")return{ok:!0};if(M.status==="conflict")return{ok:!1,error:"This file changed on disk since it was opened."};if(M.status==="needs-permission")return{ok:!1,error:"Tap Save again to grant write access."};return{ok:!1,error:M.error}},[t,r.baseMtimeMs]);if(r.isImage&&r.imageUrl)return e(Ai,{src:r.imageUrl,name:t.name,className:"flex-1 min-h-0"});if(r.isImage||Wc(c)&&(p||h))return e(gl,{kind:c,path:t.path??t.name,name:t.name,source:r.byteSource,content:r.content,revision:r.revision,onContentChange:r.onChange,onSaveBytes:r.deviceBacked?void 0:j,onDirtyChange:r.setBinaryDirty});if(r.isLoading||r.unsupported||r.loadError||g&&h)return e(Yo,{fileName:t.name,content:v,path:t.path??t.name,root:t.root,repo:t.repo,fontSize:w,scrollRef:E,onScroll:P.onScroll,isLoading:r.isLoading,unsupported:r.unsupported,loadError:r.loadError,reviewActive:C,onExitReview:A});return e(Gc,{ref:R,value:v,onValueChange:r.onChange,language:S,wordWrap:k,documentKey:l,marks:x,currentMark:N,onScroller:y,scrollTestId:"editor-scroller",className:"flex-1 min-h-0 text-ink select-text",themeVars:T.vars,themes:T.themes,indentUnitText:I,typing:U,padding:12,placeholder:"This file is empty",style:{fontFamily:F,fontSize:`${w}px`,lineHeight:Js}})}function ot(){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:c,lineCount:p,charCount:h,language:g,saveStatus:v,path:S,conflicts:k=0}){return e("footer",{className:"bg-canvas border-t border-ink/10 px-3 flex items-center justify-between text-[10px] text-ink/60 flex-shrink-0 font-mono",style:{height:"calc(1.75rem + env(safe-area-inset-bottom, 0px))",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"max(0.75rem, env(safe-area-inset-left, 0px))",paddingRight:"max(0.75rem, env(safe-area-inset-right, 0px))"},children:[e("div",{className:"flex items-center space-x-3",children:t?e("span",{className:"uppercase",children:"Image"}):r?e("span",{className:"uppercase",children:Uo[c]}):e(d,{children:[k>0&&e("span",{className:"text-error font-semibold tabular-nums",children:["⚠ ",k]}),e("span",{children:[p," lines"]}),e("span",{children:[h," chars"]}),e("span",{className:"uppercase",children:g})]})}),e("div",{className:"flex items-center space-x-2",children:[v==="saving"&&e(d,{children:[e(m,{size:10,className:"animate-spin"}),e("span",{children:"Saving…"})]}),v==="saved"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),e("span",{children:"Saved"})]}),v==="error"&&e(d,{children:[e("span",{className:"w-1.5 h-1.5 rounded-full bg-error"}),e("span",{className:"text-error",children:"Save failed"})]}),v==="idle"&&S&&e("span",{className:"truncate max-w-[140px]",children:S})]})]})}function rt({path:t,content:r,ready:c,surfaceRef:p}){let h=Zc(t,r,c),g=i(null);return o(()=>{if(!h||g.current===h.request)return;g.current=h.request;let v=h.matches[h.currentIndex];if(!v)return;p.current?.select(v.start,v.end,!1),p.current?.revealOffset(v.start)},[h,p]),{matches:h?.matches??[],currentIndex:h?.currentIndex??-1}}function st({path:t,content:r,documentKey:c,ready:p,surfaceRef:h,toggleWordWrap:g}){let v=rt({path:t,content:r,ready:p,surfaceRef:h}),S=Jc({text:r,documentKey:c,readSelection:()=>h.current?.getSelection()??null,select:(k,l,x=!0)=>h.current?.select(k,l,x),reveal:(k)=>h.current?.revealOffset(k),applyDocument:(k,l,x)=>h.current?.applyDocument(k,l,x),toggleWordWrap:g});if(S.open&&S.matches.length>0)return{find:S,revealMarks:S.matches,currentMark:S.currentIndex};return{find:S,revealMarks:v.matches.length>0?v.matches:void 0,currentMark:v.currentIndex}}function at({path:t,symbols:r,total:c,truncated:p,emptyNotice:h,preview:g=!1}){let[v,S]=n(!1);if(!t)return null;let k=(l,x)=>{if(S(!1),g){let N=Ku(r,x);if(N)Zi({path:t,...N});return}Ji({path:t,line:l.line,column:l.column,length:l.name.length})};return e(d,{children:[e("div",{className:"absolute bottom-14 right-3 z-20",children:e("button",{type:"button",onClick:()=>S(!0),"aria-label":`Outline (${c} symbols)`,title:"Outline",className:"flex h-9 w-9 items-center justify-center rounded-full border border-ink/20 bg-paper text-ink/60 shadow-sm transition-all hover:bg-ink/5 hover:text-ink active:scale-95",children:e(Kr,{size:16})})}),v&&e(Z,{onClose:()=>S(!1),maxWidthClass:"max-w-sm",zClass:"z-[70]",header:e("div",{className:"flex min-w-0 items-center gap-2",children:[e(Kr,{size:15,className:"flex-shrink-0 text-ink/50"}),e("span",{className:"text-sm font-medium",children:"Outline"}),e("span",{className:"font-mono text-[11px] text-ink/40",children:p?`${r.length}/${c}`:c})]}),children:e("div",{className:"max-h-[60vh] overflow-y-auto scrollbar-overlay-container py-1",children:[r.length===0?e("div",{className:"px-4 py-3 text-[11px] italic text-ink/40",children:h}):r.map((l,x)=>e("button",{type:"button",onClick:()=>k(l,x),"aria-label":g?`${Zo(l.kind)} ${l.name}`:`${Zo(l.kind)} ${l.name}, line ${l.line}`,className:"flex w-full min-w-0 items-center gap-2 px-4 py-2 text-left transition-colors hover:bg-ink/5 active:bg-ink/10",style:{paddingLeft:`${16+l.depth*12}px`},children:[e(zu,{kind:l.kind,size:13}),e("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-ink",children:l.name}),!g&&e("span",{className:"flex-shrink-0 font-mono text-[10px] text-ink/40",children:l.line})]},`${l.line}:${l.kind}:${l.name}`)),p&&e("div",{className:"px-4 py-2 text-[11px] italic text-ink/40",children:Uu(c)})]})})]})}function ct({file:t,missing:r=!1,onClose:c,onFileSaved:p,onDropResult:h}){let g=fs(t.path??t.name),[v,S]=n({}),[k,l]=n(_o),[x,N]=n(!0),R=To(),y=hi(),E=ou(),P=su(),w=g==="markdown",C=vd[g]===!0,A=ms[g]===!0,T=t.path??t.name,F=v[T]??A,I=nu(String(T)),U=w&&F,j=()=>S((V)=>({...V,[T]:!F})),K=Rc({enabled:Boolean(t.root),onResult:h}),M=Yc(t,{flushOnUnmount:!0,reportSaveError:!0,downloadMimeType:"text/plain;charset=utf-8",onFileSaved:p,missing:r}),[ee,X]=n(null),J=sl({tabKey:T,surface:w&&F?"rendered":"code",ready:M.loaded,slot:uh,element:w&&F?void 0:ee}),[me,de]=n(null),oe=a((V)=>{J.ref(V),de(V)},[J.ref]);qc({path:t.path??null,scroller:me,preview:w&&F});let te=i(null),{find:G,revealMarks:Q,currentMark:ae}=st({path:t.path??null,content:M.content,documentKey:`${T}\x00${M.language}`,ready:M.loaded&&!M.loadError,surfaceRef:te,toggleWordWrap:()=>N((V)=>!V)}),{content:ne,language:q}=M,ve=ne.split(`
2
- `).length,ye=Uc(ne);Xc({file:{id:T,name:t.name,path:t.path??T},editor:M,surfaceRef:te,isPreview:F,exitPreview:()=>S((V)=>({...V,[T]:!1})),publish:!1});let{symbols:ke,total:he,truncated:z,notice:L}=Gu({content:ne,language:q,path:t.path??null,state:C?"not-a-document":M.loadError?"error":M.loaded?"ready":"loading",note:C?`${Uo[g]} files have no text outline.`:M.loadError});return e("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col font-mono text-xs select-none",...K.dropProps,...K.captureDropProps,children:[e(fl,{visible:K.isDragging}),e(Xo,{fileName:t.name,hasPreview:A,isPreview:F,wordWrap:x,copied:M.copied,byteViewer:C,missing:r,onSave:M.saveNow,onClose:c,onTogglePreview:j,hasReview:U,isReviewing:U&&I.active,onToggleReview:I.toggle,onToggleFind:()=>G.open?G.close():G.openFind(),findOpen:G.open,onToggleWrap:()=>N(!x),onZoomOut:()=>l((V)=>Math.max(Zs,V-1)),onZoomIn:()=>l((V)=>Math.min(Xs,V+1)),onCopy:M.copy,onDownload:M.download}),r&&e(ot,{}),M.diskChange&&e(eu,{fileName:t.name,onReload:M.reloadFromDisk,onKeepMine:M.keepMineAgainstDisk}),G.open&&!C&&e("div",{className:"relative shrink-0 h-9 border-b border-ink/10 bg-paper",children:e(jc,{find:G})}),e(Jo,{file:t,editor:M,viewerKind:g,byteViewer:C,isPreview:F,isMd:w,content:ne,language:q,wordWrap:x,fileKey:T,revealMarks:Q,currentMark:ae,surfaceRef:te,setCodeScroller:X,previewRef:oe,scroll:J,fontSize:k,reviewActive:U&&I.active,onExitReview:I.toggle,editorTheme:y,editorFontFamily:R,indentUnitText:au(E),typing:P}),!C&&e(at,{path:t.path??null,symbols:ke,total:he,truncated:z,emptyNotice:L,preview:w&&F}),e(it,{isImage:M.isImage,byteViewer:C,viewerKind:g,lineCount:ve,charCount:ne.length,language:q,saveStatus:M.saveStatus,path:t.path,conflicts:ye}),M.saveMissingConfirm&&t.path&&e(tu,{fileName:t.name,filePath:t.path,onClose:M.cancelSaveMissing,onConfirm:M.confirmSaveMissing})]})}function pt({diff:t,onClose:r,onFileSaved:c}){let p=t.path.split("/").pop()||t.path,h=Boolean(t.staged),g=t.status||"M",v=Kn(g,h);return e("div",{className:"fixed inset-x-0 top-0 h-dvh z-[60] bg-paper flex flex-col",children:[e("header",{className:"bg-canvas border-b border-ink/10 flex items-center justify-between px-3 flex-shrink-0",style:{height:"calc(3rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:er("0.75rem",!0),paddingRight:_r("0.75rem",!0)},children:[e("div",{className:"flex items-center space-x-2 min-w-0 pr-2",children:[e("button",{type:"button",onClick:r,className:"p-1.5 -ml-1 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink transition-colors flex-shrink-0",title:"Back","aria-label":"Close diff",children:e(tn,{size:18,strokeWidth:1.9})}),e(lt,{name:p,size:14,className:"flex-shrink-0"}),e("span",{className:"font-mono text-xs text-ink font-medium truncate",title:t.path,children:p})]}),e("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border flex-shrink-0 ${v.badgeBgClass}`,children:[v.charStatus," ",v.label]})]}),e("div",{className:"flex-1 min-h-0",children:e($c,{className:"h-full",viewModeButtons:!1,filePath:t.path,status:g,isStaged:h,root:t.root,repo:t.repo||".",journalDiff:t.journal,readOnly:Boolean(t.journal),onFileSaved:c,tabKey:t.journal?qm(t.journal.path,t.journal.from,t.journal.to):jm(t.path,h)})})]})}function Le(t,r){let c=t[r];return typeof c==="string"&&c.length>0?c:void 0}function Mt(t){let r=t.content;return typeof r==="string"?r:void 0}function Xe(t,r){let c=typeof t==="object"&&t!==null?t:{},p=(Le(c,"path")??"").replace(/^\/+/,"");if(!p)return null;return{name:Le(c,"name")??p.split("/").pop()??"file",path:p,content:Mt(c),root:Le(c,"root")??r??void 0,repo:Le(c,"repo"),handleId:Le(c,"handleId"),deviceFile:c.deviceFile===!0?!0:void 0}}function mt(t){if(!t)return[];return[{id:"mobile-editor",path:t.path,root:t.root,repo:t.repo,content:t.content,handleId:t.handleId,deviceFile:t.deviceFile}]}function ut(t,r,c){Ya(c);let p=Xn(r);return Xt(p,hg,{folderId:r,worktreePath:c}),t.setSearchParams((h)=>{let g=Nt(h);return g.set("sessionId",p),g.set("folderId",r.toString()),g},{replace:!0}),t.afterNavigate?.(),p}function rd({onDesktopToggle:t,appSettings:r={}}){let{folders:c,isMock:p}=We(),h=St(),{sessionId:g}=et(),[v,S]=le(),k=v.get("sessionId"),l=k?Number.isNaN(Number(k))?k:Number(k):null,x=v.get("folderId"),N=x?Number.isNaN(Number(x))?x:Number(x):null,[R,y]=n("main"),[E,P]=n(null),[w,C]=n(null),[A,T]=n(0),[F,I]=n(!1),[U,j]=n("appearance"),[K,M]=n(!1),ee=a(()=>T((z)=>z+1),[]),X=Kc(mt(E),A),{pushToast:J}=je(),me=a((z)=>J(z.message,z.ok?"success":"error"),[J]),de=X.size>0;to({editorOpen:E!==null,diffOpen:w!==null,settingsOpen:F,offMainScreen:R!=="main",onCloseEditor:()=>P(null),onCloseDiff:()=>C(null),onCloseSettings:()=>{I(!1),M(!1)},onReturnToMain:()=>y("main")});let{folder:oe}=Ja(c,l),te=oe??(N?c.find((z)=>String(z.id)===String(N))??null:null),G=Gm(c,l)??te?.project_path??null,Q=!!te,ae=Rc({enabled:Q,onResult:me});we("omp:open-file",(z)=>{let V=Xe(z.detail,G);if(V)P(V)}),we("omp:open-diff",(z)=>{let L=z.detail;if(!L?.file)return;C({path:L.file.replace(/^\/+/,""),status:L.status,staged:L.staged,repo:L.repo,root:L.root??G??void 0,...L.source==="journal"&&L.journal?{journal:L.journal}:{}})}),we("omp:view-subagent",()=>y("main")),we(od,(z)=>{let L=z.detail?.panelKey;if(!L)return;let V=dh(L,h);if(!V)return;let ue=Se(g,"layout.mobileRightPanel");if(V==="right"&&(R!=="right"||ue!==L))Ae(L);Xt(g,V==="left"?"layout.mobileLeftPanel":"layout.mobileRightPanel",L),y(V==="left"?"session":"right")}),we("omp:open-settings",(z)=>{let L=z.detail;j(L?.category??"appearance"),M(Boolean(L?.autoOpenAdd)),I(!0)});let ne=(z)=>{S((L)=>{let V=Nt(L);if(V.set("sessionId",z.toString()),V.has("subagent"))V.delete("subagent");return V},{replace:!0}),y("main")},q=()=>{S(new URLSearchParams,{replace:!0}),y("main")},ve=(z)=>{let L=ol(c,k,z);if(L)Ya(L);S((V)=>sc(V,Xn(z),z),{replace:!0}),y("main")},ye=(z,L)=>ut({setSearchParams:S,afterNavigate:()=>y("main")},z,L),ke=a((z)=>{let L=Xe(z,G);if(L)P(L)},[G]),he=a(()=>{let z=Se(g,"layout.mobileRightPanel")??Xl;Ae(z),y("right")},[g]);return e("div",{"data-testid":"app-root",className:"app-window flex flex-col h-dvh w-screen overflow-hidden bg-canvas text-ink font-sans selection:bg-ink selection:text-canvas relative",children:[e(gf,{}),e(Af,{isMock:p}),e(hf,{workspacePath:G}),e("div",{className:`flex-1 min-h-0 w-full relative ${R==="main"?"block":"hidden"}`,...ae.dropProps,...ae.captureDropProps,children:[e(fl,{visible:ae.isDragging}),e(so,{activeSessionId:l,onSelectSession:ne,onNewSession:q,onOpenSessionSidebar:()=>y("session"),onOpenRightSidebar:he,appSettings:r})]}),e("div",{className:`flex-1 min-h-0 w-full ${R==="session"?"block":"hidden"}`,children:e(Vo,{activeSessionId:l,onSelectSession:ne,onNewSession:q,onNewSessionForFolder:ve,onNewWorktreeSession:ye,onClose:()=>y("main"),onDesktopToggle:t,appSettings:r,rootPath:G??void 0,refreshKey:A,onRefresh:ee,onOpenFile:ke})}),R==="right"&&e("div",{className:"flex-1 min-h-0 w-full",children:e(Ko,{enabled:Q,rootPath:G??void 0,refreshKey:A,onRefresh:ee,onOpenFile:ke,onClose:()=>y("main")})}),E&&e(ct,{file:E,missing:de,onClose:()=>P(null),onFileSaved:ee}),w&&e(pt,{diff:w,onClose:()=>C(null),onFileSaved:ee}),e(wc,{isOpen:F,onClose:()=>{I(!1),M(!1)},initialCategory:U,autoOpenAddProvider:K,appSettings:r})]})}export{rd as MobileLayoutWrapper};