@kabmo-labs/kabmo 0.46.1 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +506 -502
  3. package/dist/client/static/js/Body-3tspyjtk.js +3 -0
  4. package/dist/client/static/js/{CsvGrid-qdkmv8bj.js → CsvGrid-3pwsfmxp.js} +2 -2
  5. package/dist/client/static/js/{DocxView-k84ns803.js → DocxView-xcg9jktb.js} +3 -3
  6. package/dist/client/static/js/{DrawioView-r1n717f7.js → DrawioView-2q19tgkx.js} +2 -2
  7. package/dist/client/static/js/HtmlPreview-92cadvbr.js +1 -0
  8. package/dist/client/static/js/ImageView-pr4h38hb.js +1 -0
  9. package/dist/client/static/js/LayoutWrapper-n4tzhjes.js +2 -0
  10. package/dist/client/static/js/MergeDiffView-0t15nh9f.js +1 -0
  11. package/dist/client/static/js/{Modal-xe6h99jn.js → Modal-77hgx4dw.js} +20 -20
  12. package/dist/client/static/js/{PdfView-ffg4mccg.js → PdfView-gzxhvxe8.js} +1 -1
  13. package/dist/client/static/js/{SessionsView-cdcbsee9.js → SessionsView-2tdqrvk0.js} +1 -1
  14. package/dist/client/static/js/{SheetView-89sscpz6.js → SheetView-w5w2m2de.js} +22 -22
  15. package/dist/client/static/js/{SvgPreview-68c0ccbv.js → SvgPreview-mtk6de6h.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-h3a5s259.js → abnfDiagram-O67JEVCF-tha4j2fn.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-zs15nydj.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-983p0jgn.js → architectureDiagram-NJMV4G6O-heep78p6.js} +6 -6
  19. package/dist/client/static/js/{astro-hyj5wege.js → astro-r4dp34pw.js} +1 -1
  20. package/dist/client/static/js/bash-8d3wrx5c.js +1 -0
  21. package/dist/client/static/js/{blockDiagram-BEXU5L5S-16pse5mh.js → blockDiagram-BEXU5L5S-6mzgfqh8.js} +5 -5
  22. package/dist/client/static/js/c-rn3z0csz.js +1 -0
  23. package/dist/client/static/js/{c4Diagram-YGBWAQC7-mvnb00zt.js → c4Diagram-YGBWAQC7-sfkcw7g9.js} +4 -4
  24. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-kmpd91xb.js → classDiagram-v2-NBCMYWYE-v530ny5e.js} +6 -6
  25. package/dist/client/static/js/{cose-bilkent-JH36ORCC-3ek5r5se.js → cose-bilkent-JH36ORCC-ybv1ttbx.js} +1 -1
  26. package/dist/client/static/js/cpp-99ws9nak.js +1 -0
  27. package/dist/client/static/js/css-narcr42w.js +1 -0
  28. package/dist/client/static/js/cynefin-OW5HDTMX-p3y1b4ap.js +1 -0
  29. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-jkbh84zn.js → cynefinDiagram-VND7K2PF-k8f3z0mm.js} +2 -2
  30. package/dist/client/static/js/{dagre-6A5THRUB-4fdc0sgn.js → dagre-6A5THRUB-gk0gp124.js} +2 -2
  31. package/dist/client/static/js/{diagram-22UHCM2B-hbk61nq9.js → diagram-22UHCM2B-2zh2957c.js} +15 -15
  32. package/dist/client/static/js/{diagram-3UASUU5V-hfpbr9qh.js → diagram-3UASUU5V-bzstt5e2.js} +2 -2
  33. package/dist/client/static/js/{diagram-ATOU4E4O-fn0nt71a.js → diagram-ATOU4E4O-16adx4g0.js} +3 -3
  34. package/dist/client/static/js/{diagram-CDSNMT55-ssswxjeb.js → diagram-CDSNMT55-1ja98ens.js} +5 -5
  35. package/dist/client/static/js/{diagram-MLGK6HIB-whnzxv6f.js → diagram-MLGK6HIB-f9nnyjbq.js} +2 -2
  36. package/dist/client/static/js/{diagram-MPIPVDR6-hk1chzxk.js → diagram-MPIPVDR6-3qgadfjz.js} +2 -2
  37. package/dist/client/static/js/{dockerfile-zmsj8r4g.js → dockerfile-04tc68pq.js} +1 -1
  38. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-q1vkg5mr.js → ebnfDiagram-ZINNZB2B-022cz603.js} +1 -1
  39. package/dist/client/static/js/{elixir-80wq7gak.js → elixir-61gbjv6c.js} +1 -1
  40. package/dist/client/static/js/{elk-276RUBZZ-kt98vg8j.js → elk-276RUBZZ-2anf1c36.js} +1 -1
  41. package/dist/client/static/js/{erDiagram-OPXOYQCR-ey3avsn9.js → erDiagram-OPXOYQCR-ndd27fz1.js} +7 -7
  42. package/dist/client/static/js/{erlang-814e8qy5.js → erlang-bh5cbm8m.js} +1 -1
  43. package/dist/client/static/js/eventmodeling-NTZA5JFV-sx2cwkz3.js +1 -0
  44. package/dist/client/static/js/flowDiagram-KWPJA3E3-dsc17mty.js +1 -0
  45. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-a9k1at43.js → ganttDiagram-FUAMR5RP-9gm6hkgn.js} +4 -4
  46. package/dist/client/static/js/gitGraph-4MIJSDKK-yqhbscsd.js +1 -0
  47. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-gnekjfym.js → gitGraphDiagram-X574FWY7-78bxa67c.js} +8 -8
  48. package/dist/client/static/js/graphql-tr0jcndy.js +1 -0
  49. package/dist/client/static/js/html-n8fdvrdk.js +1 -0
  50. package/dist/client/static/js/index-0e51wknc.js +10 -0
  51. package/dist/client/static/js/{index-z25ss7xj.js → index-13g17wa3.js} +1 -1
  52. package/dist/client/static/js/index-1hb8fvw9.js +1 -0
  53. package/dist/client/static/js/{index-1c2jvnyh.js → index-2bsnywea.js} +2 -2
  54. package/dist/client/static/js/{index-g7s0wsag.js → index-2n1fgpjv.js} +2 -2
  55. package/dist/client/static/js/{index-3x7h2eqj.js → index-30a8py59.js} +2 -2
  56. package/dist/client/static/js/{index-qf3y3ahx.js → index-34aq5bz5.js} +2 -2
  57. package/dist/client/static/js/index-3en15m75.js +2 -0
  58. package/dist/client/static/js/{index-nw5mvcaj.js → index-417fbrqk.js} +2 -2
  59. package/dist/client/static/js/{index-z4530r3c.js → index-45p59fxq.js} +2 -2
  60. package/dist/client/static/js/index-4n7t26ap.js +2 -0
  61. package/dist/client/static/js/{index-kty4ncsr.js → index-55pqvh82.js} +2 -2
  62. package/dist/client/static/js/index-5mpv57fn.js +12 -0
  63. package/dist/client/static/js/{index-x9r7zfp4.js → index-7pz6n3pg.js} +2 -2
  64. package/dist/client/static/js/{index-1ax52p0q.js → index-7whstwc7.js} +2 -2
  65. package/dist/client/static/js/index-869vdnz8.js +2 -0
  66. package/dist/client/static/js/{index-fzngzhww.js → index-8tvrzce0.js} +2 -2
  67. package/dist/client/static/js/index-9a78xmkk.js +462 -0
  68. package/dist/client/static/js/{index-33qxg79j.js → index-a58rkn3f.js} +5 -5
  69. package/dist/client/static/js/{index-60v30k5h.js → index-aa3hmn6j.js} +64 -64
  70. package/dist/client/static/js/{index-wrcdc9vz.js → index-aabp7nt6.js} +1 -1
  71. package/dist/client/static/js/{index-64sqfr4a.js → index-abrrqhne.js} +2 -2
  72. package/dist/client/static/js/{index-9vv7wr1n.js → index-ac2q5903.js} +2 -2
  73. package/dist/client/static/js/index-axtm1aq8.js +2 -0
  74. package/dist/client/static/js/index-b2cs4c51.js +4 -0
  75. package/dist/client/static/js/{index-8g7q8mz4.js → index-c250nzm1.js} +3 -3
  76. package/dist/client/static/js/{index-abs635a1.js → index-dxnkwf39.js} +48 -48
  77. package/dist/client/static/js/{index-kbhrvep8.js → index-e6ny4gd9.js} +6 -6
  78. package/dist/client/static/js/index-ebf50mrs.js +9 -0
  79. package/dist/client/static/js/{index-trvqvb1v.js → index-ep6bqcmg.js} +2 -2
  80. package/dist/client/static/js/{index-qfxn7yh5.js → index-fb2s080r.js} +2 -2
  81. package/dist/client/static/js/index-fryp0kgf.js +2 -0
  82. package/dist/client/static/js/{index-2ks0m8ss.js → index-g3rg6vsd.js} +2 -2
  83. package/dist/client/static/js/{index-sa1675y0.js → index-g8rpydkr.js} +2 -2
  84. package/dist/client/static/js/{index-bsr7wmj2.js → index-gkmn4y1v.js} +1 -1
  85. package/dist/client/static/js/{index-xq5f3nxa.js → index-gpmcth0x.js} +2 -2
  86. package/dist/client/static/js/{index-e9cxje00.js → index-hcmhdpp4.js} +10 -10
  87. package/dist/client/static/js/{index-kb14dhrx.js → index-he4k2j91.js} +2 -2
  88. package/dist/client/static/js/{index-wbws16ag.js → index-hq28918s.js} +2 -2
  89. package/dist/client/static/js/{index-84fyq5a6.js → index-hwzxdwwg.js} +1 -1
  90. package/dist/client/static/js/{index-2a6qp9y6.js → index-jnkc9p53.js} +1 -1
  91. package/dist/client/static/js/{index-pavvxrsz.js → index-k39be93q.js} +1 -1
  92. package/dist/client/static/js/{index-c9e417cs.js → index-kaxvwh07.js} +2 -2
  93. package/dist/client/static/js/{index-ykm7a3cp.js → index-kjr68pcj.js} +2 -2
  94. package/dist/client/static/js/{index-b5dfvget.js → index-m0fatq7c.js} +4 -4
  95. package/dist/client/static/js/{index-atq9q1s7.js → index-m39gbcxn.js} +1 -1
  96. package/dist/client/static/js/{index-hnb66d3s.js → index-mqzgf7rw.js} +2 -2
  97. package/dist/client/static/js/{index-5wz0y88c.js → index-pzsp1src.js} +2 -2
  98. package/dist/client/static/js/{index-yf93db65.js → index-qe0vfv6s.js} +1 -1
  99. package/dist/client/static/js/{index-q9ytjey8.js → index-qek9mt5w.js} +1 -1
  100. package/dist/client/static/js/{index-d23eacf2.js → index-qxzj780x.js} +2 -2
  101. package/dist/client/static/js/index-rgxg0azs.css +1 -0
  102. package/dist/client/static/js/{index-m4k054wz.js → index-rq4dk4tp.js} +4 -4
  103. package/dist/client/static/js/{index-fj5rsp5v.js → index-seekt5k3.js} +2 -2
  104. package/dist/client/static/js/{index-561gkvve.js → index-sng4prpr.js} +2 -2
  105. package/dist/client/static/js/{index-vjmg7kn5.js → index-t4s10406.js} +2 -2
  106. package/dist/client/static/js/{index-b2e5pwx7.js → index-tzz5gp8a.js} +5 -5
  107. package/dist/client/static/js/index-vnv9z0a1.js +1 -0
  108. package/dist/client/static/js/{index-19x11s5w.js → index-x7rajphe.js} +2 -2
  109. package/dist/client/static/js/{index-dxvtjn6a.js → index-xny7vsfz.js} +2 -2
  110. package/dist/client/static/js/index-xr4hjv01.js +2 -0
  111. package/dist/client/static/js/{index-65afr75v.js → index-ya9yqj5w.js} +2 -2
  112. package/dist/client/static/js/{index-z0fkfphe.js → index-zcgqacvx.js} +2 -2
  113. package/dist/client/static/js/info-A6RAGUB7-0sd3zzgg.js +1 -0
  114. package/dist/client/static/js/{infoDiagram-VRGFBTTK-r1p25738.js → infoDiagram-VRGFBTTK-bxk0g0pe.js} +2 -2
  115. package/dist/client/static/js/ini-tnaw7zjy.js +1 -0
  116. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-afgrqdrt.js → ishikawaDiagram-OU5B5YK6-d1kdkhth.js} +3 -3
  117. package/dist/client/static/js/java-m4dpc2vw.js +1 -0
  118. package/dist/client/static/js/javascript-8y26t991.js +1 -0
  119. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-hepa4wk7.js → journeyDiagram-ZHPQQLJL-cahg3zjq.js} +4 -4
  120. package/dist/client/static/js/json-azm7bdqd.js +1 -0
  121. package/dist/client/static/js/jsx-p9j1k773.js +1 -0
  122. package/dist/client/static/js/{julia-yv2j8qd0.js → julia-2n5k898q.js} +1 -1
  123. package/dist/client/static/js/{kanban-definition-PNTS6WVX-jysft8ya.js → kanban-definition-PNTS6WVX-nq7t83en.js} +6 -6
  124. package/dist/client/static/js/lua-hbm9rhz9.js +1 -0
  125. package/dist/client/static/js/markdown-tk3cd3vs.js +1 -0
  126. package/dist/client/static/js/{mermaid.core-0m90b0s8.js → mermaid.core-6nw0853j.js} +8 -8
  127. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-x2rrzpvr.js → mindmap-definition-NLK3R4M7-cm7ykxf2.js} +3 -3
  128. package/dist/client/static/js/one-dark-pro-2cdc2nk7.js +1 -0
  129. package/dist/client/static/js/one-light-bt6z4jf0.js +1 -0
  130. package/dist/client/static/js/packet-AYTQ26CC-13w2v5bb.js +1 -0
  131. package/dist/client/static/js/{pegDiagram-GJSIUBJH-z7vb7f1z.js → pegDiagram-GJSIUBJH-xwxz8nsq.js} +1 -1
  132. package/dist/client/static/js/{perl-917pjq5a.js → perl-66vb5pz7.js} +1 -1
  133. package/dist/client/static/js/{php-hwz75qzt.js → php-4e9we8am.js} +1 -1
  134. package/dist/client/static/js/pie-WAS4IAKB-swtnysgn.js +1 -0
  135. package/dist/client/static/js/{pieDiagram-5QR66LMP-jqv6v4e6.js → pieDiagram-5QR66LMP-n910k9th.js} +3 -3
  136. package/dist/client/static/js/properties-6911ckw7.js +1 -0
  137. package/dist/client/static/js/python-44cvj250.js +1 -0
  138. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-w2h8yxrv.js → quadrantDiagram-O4NWA36T-dxkwxbqb.js} +6 -6
  139. package/dist/client/static/js/r-t3sepzm4.js +1 -0
  140. package/dist/client/static/js/radar-RG4KPBEZ-vtvxkx55.js +1 -0
  141. package/dist/client/static/js/railroad-74A4TZTK-5sp2d63r.js +1 -0
  142. package/dist/client/static/js/railroad-abnf-HS5TGJTU-kg706fan.js +1 -0
  143. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-4ra1gzx5.js +1 -0
  144. package/dist/client/static/js/railroad-peg-WCYAUIDC-hms3zpjm.js +1 -0
  145. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-nd09yac3.js → railroadDiagram-XR7U4H2S-xb1smt7r.js} +1 -1
  146. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-t61zxh5v.js → requirementDiagram-PLB6GJNP-6kb21b9f.js} +6 -6
  147. package/dist/client/static/js/{ruby-er7ayhte.js → ruby-v7nmcvyr.js} +1 -1
  148. package/dist/client/static/js/{rust-avnkhh0p.js → rust-5ersd7be.js} +1 -1
  149. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2f7h2cmw.js → sankeyDiagram-IPEJSGJF-74z0fskw.js} +4 -4
  150. package/dist/client/static/js/{sass-n47tt136.js → sass-h3nvy4c8.js} +1 -1
  151. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-kfb5d7zd.js → sequenceDiagram-PO4LG4MO-apn6kezn.js} +17 -17
  152. package/dist/client/static/js/{sizeCapture-INFHLROL-amfg19se.js → sizeCapture-INFHLROL-2drzcjb8.js} +1 -1
  153. package/dist/client/static/js/sql-zdkawqx3.js +1 -0
  154. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-k5hx7btx.js → stateDiagram-v2-GCMORJYK-ma09vhby.js} +3 -3
  155. package/dist/client/static/js/{svelte-2pmz35vx.js → svelte-dhspkgss.js} +1 -1
  156. package/dist/client/static/js/{swimlanes-2SLR337P-wv3rp8kk.js → swimlanes-2SLR337P-f6y9xqnx.js} +1 -1
  157. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3dwas56m.js +8 -0
  158. package/dist/client/static/js/{timeline-definition-EJHVYXUP-0re95wtn.js → timeline-definition-EJHVYXUP-zmcmvq00.js} +5 -5
  159. package/dist/client/static/js/treeView-Q6P3EWNA-7t5k6rs2.js +1 -0
  160. package/dist/client/static/js/treemap-WGGIJYW6-w56ry3bg.js +1 -0
  161. package/dist/client/static/js/tsx-b7eabr17.js +1 -0
  162. package/dist/client/static/js/typescript-nnkvhwfy.js +1 -0
  163. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-yrje14qp.js → usecaseDiagram-POWQR4AR-wfaa019a.js} +24 -24
  164. package/dist/client/static/js/{vennDiagram-UO4OBE2U-jxkmrfy5.js → vennDiagram-UO4OBE2U-46wf2pgd.js} +8 -8
  165. package/dist/client/static/js/{vue-d5gpjfgn.js → vue-ffngx2b3.js} +1 -1
  166. package/dist/client/static/js/wardley-WFR3VGLG-rtjb9kgv.js +1 -0
  167. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-d3v2m9b1.js → wardleyDiagram-VNRHLVJA-10ph3bzq.js} +4 -4
  168. package/dist/client/static/js/xml-xy1tw6b2.js +1 -0
  169. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9a1s1rjt.js → xychartDiagram-PMCCYNJV-2ba825z9.js} +5 -5
  170. package/dist/client/static/js/yaml-0fexqg2d.js +1 -0
  171. package/marketplace/marketplace.json +34 -7
  172. package/marketplace/plugins/kanban/README.md +143 -0
  173. package/marketplace/plugins/kanban/icon.svg +5 -0
  174. package/marketplace/plugins/kanban/package.json +30 -0
  175. package/marketplace/plugins/kanban/src/app.tsx +34 -0
  176. package/marketplace/plugins/kanban/src/mcp-tools.ts +296 -0
  177. package/marketplace/plugins/kanban/src/mcp.test.ts +199 -0
  178. package/marketplace/plugins/kanban/src/mcp.ts +148 -0
  179. package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +319 -0
  180. package/marketplace/plugins/kanban/src/panel/CardTile.tsx +97 -0
  181. package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +116 -0
  182. package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +249 -0
  183. package/marketplace/plugins/kanban/src/panel/catalogs.ts +114 -0
  184. package/marketplace/plugins/kanban/src/panel/index.tsx +327 -0
  185. package/marketplace/plugins/kanban/src/panel/panel.test.ts +219 -0
  186. package/marketplace/plugins/kanban/src/panel/start-work.ts +132 -0
  187. package/marketplace/plugins/kanban/src/panel/use-board.ts +148 -0
  188. package/marketplace/plugins/kanban/src/panel/use-card-detail.ts +70 -0
  189. package/marketplace/plugins/kanban/src/panel/use-writes.ts +123 -0
  190. package/marketplace/plugins/kanban/src/protocol.ts +180 -0
  191. package/marketplace/plugins/kanban/src/server.test.ts +113 -0
  192. package/marketplace/plugins/kanban/src/server.ts +227 -0
  193. package/marketplace/plugins/kanban/src/store/board.test.ts +311 -0
  194. package/marketplace/plugins/kanban/src/store/board.ts +147 -0
  195. package/marketplace/plugins/kanban/src/store/cards.ts +228 -0
  196. package/marketplace/plugins/kanban/src/store/fs.ts +159 -0
  197. package/marketplace/plugins/kanban/src/store/ops.ts +245 -0
  198. package/marketplace/plugins/kanban/src/store/resolve.test.ts +82 -0
  199. package/marketplace/plugins/kanban/src/store/resolve.ts +135 -0
  200. package/marketplace/plugins/kanban/tsconfig.json +26 -0
  201. package/package.json +2 -2
  202. package/src/client/components/common/file-icon/index.tsx +1 -1
  203. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +12 -3
  204. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +34 -7
  205. package/src/client/components/layout/desktop-layout/index.tsx +17 -22
  206. package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +2 -0
  207. package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +11 -3
  208. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.test.tsx +21 -0
  209. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +8 -4
  210. package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +8 -2
  211. package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +15 -4
  212. package/src/client/components/settings/categories/usage-settings/LimitsSection.tsx +10 -3
  213. package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +27 -4
  214. package/src/client/components/settings/categories/usage-settings/TokenHarborCard.tsx +160 -0
  215. package/src/client/components/settings/categories/usage-settings/TokenPortalCard.tsx +104 -0
  216. package/src/client/components/settings/categories/usage-settings/format.ts +35 -0
  217. package/src/client/components/settings/categories/usage-settings/limits-section.test.tsx +16 -0
  218. package/src/client/components/settings/categories/usage-settings/providers.ts +26 -4
  219. package/src/client/components/settings/categories/usage-settings/token-harbor-card.test.tsx +114 -0
  220. package/src/client/components/settings/categories/usage-settings/token-harbor-hint.test.ts +68 -0
  221. package/src/client/components/settings/categories/usage-settings/token-portal-card.test.tsx +81 -0
  222. package/src/client/components/settings/categories/usage-settings/usage-and-picker.test.ts +66 -0
  223. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +21 -0
  224. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +7 -1
  225. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +3 -1
  226. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +1 -1
  227. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.test.ts +13 -0
  228. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.tsx +41 -18
  229. package/src/client/components/workspace/editor/BodyLazy.tsx +40 -0
  230. package/src/client/components/workspace/editor/FilePane.tsx +4 -2
  231. package/src/client/components/workspace/editor/Tabs.tsx +7 -1
  232. package/src/client/components/workspace/editor/Toolbar.tsx +7 -1
  233. package/src/client/components/workspace/editor/chrome-rows.test.tsx +126 -0
  234. package/src/client/components/workspace/editor/index.tsx +2 -2
  235. package/src/client/components/workspace/editor/viewers/HtmlPreview.test.tsx +94 -0
  236. package/src/client/components/workspace/editor/viewers/HtmlPreview.tsx +71 -0
  237. package/src/client/components/workspace/editor/viewers/bytes.ts +1 -1
  238. package/src/client/components/workspace/editor/viewers/dispatch.tsx +18 -2
  239. package/src/client/components/workspace/editor/viewers/viewers.test.ts +14 -1
  240. package/src/client/components/workspace/panel-header/index.test.tsx +2 -1
  241. package/src/client/components/workspace/panel-header/index.tsx +6 -4
  242. package/src/client/data/settings/omp-schema.json +33 -10
  243. package/src/client/hooks/editor/resolve-viewer.ts +1 -1
  244. package/src/client/hooks/editor/use-editor-drop.ts +14 -0
  245. package/src/client/hooks/editor/use-editor-tab-state.ts +5 -4
  246. package/src/client/hooks/ui/media-query.ts +27 -0
  247. package/src/client/hooks/workspace/file-tabs.ts +10 -0
  248. package/src/client/hooks/workspace/right-panel-presence.test.ts +152 -0
  249. package/src/client/hooks/workspace/right-panel-presence.ts +119 -0
  250. package/src/client/lib/router/search-params.test.ts +83 -0
  251. package/src/client/lib/router/search-params.ts +14 -3
  252. package/src/server/lib/mcp/session-mcp.test.ts +64 -1
  253. package/src/server/lib/mcp/session-overlay.server.ts +7 -4
  254. package/src/server/lib/omp/rpc/constants.test.ts +31 -0
  255. package/src/server/lib/omp/rpc/constants.ts +19 -0
  256. package/src/server/lib/omp/rpc/session-new.ts +78 -0
  257. package/src/server/lib/omp/rpc/session-registry.ts +22 -49
  258. package/src/server/lib/omp/rpc/spawn-mcp.ts +8 -1
  259. package/src/server/lib/omp/session/blobs.server.ts +2 -1
  260. package/src/server/lib/plugins/e2e.test.ts +71 -2
  261. package/src/server/lib/plugins/loader.server.ts +20 -1
  262. package/src/server/lib/plugins/module-import.server.ts +45 -0
  263. package/src/server/lib/usage/provider-key.ts +18 -0
  264. package/src/server/lib/usage/providers.server.ts +27 -3
  265. package/src/server/lib/usage/report.server.ts +24 -0
  266. package/src/server/lib/usage/token-harbor.test.ts +191 -0
  267. package/src/server/lib/usage/token-harbor.ts +207 -0
  268. package/src/server/lib/usage/token-portal.test.ts +140 -0
  269. package/src/server/lib/usage/token-portal.ts +179 -0
  270. package/src/server/lib/usage/vendor-http.test.ts +52 -0
  271. package/src/server/lib/usage/vendor-http.ts +9 -2
  272. package/src/server/routes/agent/new-prompt.test.ts +81 -0
  273. package/src/server/routes/agent/new.ts +78 -4
  274. package/src/server/routes/fs/raw.test.ts +12 -0
  275. package/src/server/routes/fs/raw.ts +2 -6
  276. package/src/server/routes/wiki/asset.ts +1 -1
  277. package/src/shared/lib/fs/document-kind.test.ts +39 -2
  278. package/src/shared/lib/fs/document-kind.ts +49 -1
  279. package/src/shared/lib/fs/file-kind.test.ts +30 -3
  280. package/src/shared/lib/fs/file-kind.ts +7 -104
  281. package/src/shared/lib/fs/mime.ts +159 -0
  282. package/src/shared/lib/omp/config/schema-releases.test.ts +22 -0
  283. package/src/shared/lib/workspace/sidebar-width.test.ts +34 -0
  284. package/src/shared/lib/workspace/sidebar-width.ts +33 -0
  285. package/src/shared/lib/workspace/workspace-panel-widths.test.ts +124 -0
  286. package/src/shared/lib/workspace/workspace-panel-widths.ts +115 -18
  287. package/src/shared/types/settings/usage.ts +89 -2
  288. package/dist/client/static/js/ImageView-jkrdrq8v.js +0 -1
  289. package/dist/client/static/js/LayoutWrapper-sh634350.js +0 -2
  290. package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +0 -1
  291. package/dist/client/static/js/bash-8d8z8zrg.js +0 -1
  292. package/dist/client/static/js/c-acmn1zc9.js +0 -1
  293. package/dist/client/static/js/cpp-620mvjkk.js +0 -1
  294. package/dist/client/static/js/css-bt76kxbq.js +0 -1
  295. package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +0 -1
  296. package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +0 -1
  297. package/dist/client/static/js/flowDiagram-KWPJA3E3-7gvtpn3d.js +0 -1
  298. package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +0 -1
  299. package/dist/client/static/js/graphql-j1a6zp7m.js +0 -1
  300. package/dist/client/static/js/html-m0megrvb.js +0 -1
  301. package/dist/client/static/js/index-4cag7w6k.js +0 -479
  302. package/dist/client/static/js/index-5ka2tyf9.js +0 -3
  303. package/dist/client/static/js/index-83rkg916.js +0 -2
  304. package/dist/client/static/js/index-amsa0tfs.js +0 -2
  305. package/dist/client/static/js/index-dn7hg4em.js +0 -2
  306. package/dist/client/static/js/index-dpy3ewrn.css +0 -1
  307. package/dist/client/static/js/index-dt6q3rws.js +0 -12
  308. package/dist/client/static/js/index-hgzntg2j.js +0 -2
  309. package/dist/client/static/js/index-vkqb4dnt.js +0 -1
  310. package/dist/client/static/js/index-xwjbq003.js +0 -2
  311. package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +0 -1
  312. package/dist/client/static/js/ini-5f4zqtqr.js +0 -1
  313. package/dist/client/static/js/java-jj41mty3.js +0 -1
  314. package/dist/client/static/js/javascript-n9w9p97f.js +0 -1
  315. package/dist/client/static/js/json-rnh2h17x.js +0 -1
  316. package/dist/client/static/js/jsx-4gecrt29.js +0 -1
  317. package/dist/client/static/js/lua-zszaw2f7.js +0 -1
  318. package/dist/client/static/js/markdown-nm6gw4v4.js +0 -1
  319. package/dist/client/static/js/one-dark-pro-09d8p5vy.js +0 -1
  320. package/dist/client/static/js/one-light-g3ednt6p.js +0 -1
  321. package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +0 -1
  322. package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +0 -1
  323. package/dist/client/static/js/properties-rkptax7r.js +0 -1
  324. package/dist/client/static/js/python-qf1se1mj.js +0 -1
  325. package/dist/client/static/js/r-ms0cygq2.js +0 -1
  326. package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +0 -1
  327. package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +0 -1
  328. package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +0 -1
  329. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +0 -1
  330. package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +0 -1
  331. package/dist/client/static/js/sql-hd42h8wx.js +0 -1
  332. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-6y8zdbm4.js +0 -8
  333. package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +0 -1
  334. package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +0 -1
  335. package/dist/client/static/js/tsx-gx7td06z.js +0 -1
  336. package/dist/client/static/js/typescript-1a808spn.js +0 -1
  337. package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +0 -1
  338. package/dist/client/static/js/xml-3117mxd9.js +0 -1
  339. package/dist/client/static/js/yaml-dmvh8vyt.js +0 -1
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The Token Harbor sidebar hint. It is the one line the provider list shows, so
8
+ * it has to carry the Pass percentage (the number that decides whether covered
9
+ * calls keep working), and it must not print "0%" for a window that never
10
+ * started — a fresh account would read as "nothing left" instead of "not yet
11
+ * begun". Kept beside `token-harbor-card.test.tsx`, which pins the card itself.
12
+ */
13
+
14
+ import { describe, expect, test } from 'bun:test';
15
+
16
+ import { buildProviders } from '@/client/components/settings/categories/usage-settings/providers';
17
+ import type { TokenHarborAllowance, TokenHarborUsageReport, UsageProviderSummary } from '@/shared/types';
18
+
19
+ const summary = (overrides: Partial<UsageProviderSummary> = {}): UsageProviderSummary =>
20
+ ({ id: 'token-harbour', name: 'Token Harbor', credentialSources: [], tracked: true, limits: [], ...overrides }) as UsageProviderSummary;
21
+
22
+ /** A live-shaped allowance; each test overrides the one fact it is about. */
23
+ const tokenHarbor = (overrides: Partial<TokenHarborAllowance> = {}): TokenHarborUsageReport => ({
24
+ allowance: {
25
+ planName: 'Agent Pass',
26
+ onPlan: true,
27
+ planUsedPct: 37,
28
+ planExhausted: false,
29
+ usedPct: 12,
30
+ exhausted: false,
31
+ activated: true,
32
+ resetAt: '2026-11-30T07:45:14.048+00:00',
33
+ periodStartedAt: '2026-11-23T07:45:14.048+00:00',
34
+ periodEndsAt: '2026-11-30T07:45:14.048+00:00',
35
+ freeModels: [],
36
+ modelsEnabled: true,
37
+ ...overrides,
38
+ },
39
+ });
40
+
41
+ function hint(report: TokenHarborUsageReport): string | undefined {
42
+ return buildProviders({
43
+ isMock: false,
44
+ generatedAt: '',
45
+ providers: [summary({ tokenHarbor: report })],
46
+ })[0]?.hint;
47
+ }
48
+
49
+ describe('Token Harbor provider hint', () => {
50
+ test('a Pass row carries the plan, its percentage and the window', () => {
51
+ expect(hint(tokenHarbor())).toBe('Agent Pass · 37% · 7d');
52
+ });
53
+
54
+ test('a free-only row reports the free percentage instead of a Pass one', () => {
55
+ expect(hint(tokenHarbor({ onPlan: false, planName: null, planUsedPct: 0 }))).toBe('12% free · 7d');
56
+ });
57
+
58
+ test('a window that never started says so rather than reading "0%"', () => {
59
+ expect(hint(tokenHarbor({
60
+ activated: false,
61
+ planUsedPct: 0,
62
+ usedPct: 0,
63
+ resetAt: null,
64
+ periodStartedAt: null,
65
+ periodEndsAt: null,
66
+ }))).toBe('Agent Pass · not started');
67
+ });
68
+ });
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The TokenPortal card's arithmetic is the regression surface: the endpoint's
8
+ * numbers are whole Rupiah, an uncapped key has no quota window (so drawing a
9
+ * 0%-used bar would claim a limit nobody set), and spend is derived from
10
+ * `limit − limit_remaining`, not from `balance`.
11
+ */
12
+
13
+ import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
14
+ import { Window } from 'happy-dom';
15
+ import { render } from 'preact';
16
+ import { act } from 'preact/test-utils';
17
+ import { TokenPortalCard } from '@/client/components/settings/categories/usage-settings/TokenPortalCard';
18
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
19
+ import type { TokenPortalBalance } from '@/shared/types';
20
+
21
+ let container: HTMLElement;
22
+
23
+ const wallet = (overrides: Partial<TokenPortalBalance> = {}): TokenPortalBalance => ({
24
+ label: 'Kabmo',
25
+ currency: 'IDR',
26
+ balance: 8827,
27
+ limit: null,
28
+ limitRemaining: 8827,
29
+ isFreeTier: false,
30
+ sessionBudget: null,
31
+ ...overrides,
32
+ });
33
+
34
+ function mount(balance: TokenPortalBalance | null): HTMLElement {
35
+ act(() => render(<TokenPortalCard report={balance ? { balance } : { error: 'TokenPortal rejected the API key (HTTP 401).' }} />, container));
36
+ return container;
37
+ }
38
+
39
+ function text(dom: HTMLElement): string {
40
+ return (dom.textContent ?? '').replace(/\s/g, '');
41
+ }
42
+
43
+ beforeEach(() => {
44
+ installDomGlobals(new Window());
45
+ container = document.createElement('div');
46
+ document.body.appendChild(container);
47
+ });
48
+
49
+ afterEach(() => {
50
+ act(() => render(null, container));
51
+ container.remove();
52
+ restoreDomGlobals();
53
+ });
54
+
55
+ describe('TokenPortalCard wallet', () => {
56
+ test('an uncapped key shows its Rupiah balance and no progress bar', () => {
57
+ const dom = mount(wallet());
58
+ expect(text(dom)).toContain('Rp8.827');
59
+ expect(text(dom)).toContain('Nocap');
60
+ expect(text(dom)).toContain('Notset');
61
+ // A cap nobody set must not become a 0%-used bar.
62
+ expect(dom.querySelectorAll('[role="progressbar"]')).toHaveLength(0);
63
+ });
64
+
65
+ test('a capped key derives spend from limit_remaining and draws the bar', () => {
66
+ const dom = mount(wallet({ balance: 15000, limit: 20000, limitRemaining: 12000 }));
67
+ const bars = [...dom.querySelectorAll<HTMLElement>('[role="progressbar"]')];
68
+ expect(bars).toHaveLength(1);
69
+ expect(bars[0]?.getAttribute('aria-valuenow')).toBe('40');
70
+ expect(text(dom)).toContain('Rp8.000');
71
+ expect(text(dom)).toContain('Rp12.000');
72
+ });
73
+
74
+ test('a free-tier key states the tier in words', () => {
75
+ expect(text(mount(wallet({ isFreeTier: true })))).toContain('Free');
76
+ });
77
+
78
+ test('a missing balance says so instead of rendering an empty wallet', () => {
79
+ expect(text(mount(null))).toContain('returnednobalance');
80
+ });
81
+ });
@@ -23,6 +23,8 @@ import { describe, expect, test } from 'bun:test';
23
23
  import {
24
24
  formatAmount,
25
25
  formatCompactTokens,
26
+ formatCurrency,
27
+ formatDate,
26
28
  formatDateTime,
27
29
  formatFractionPercent,
28
30
  formatNumber,
@@ -70,6 +72,15 @@ describe('usage number formatting', () => {
70
72
  expect(formatDateTime('not-a-date')).toBe('not-a-date');
71
73
  });
72
74
 
75
+ test('formatDate keeps the year and drops the clock, in any locale', () => {
76
+ // Cutting `formatDateTime` at a comma would lose the year wherever the
77
+ // locale puts it after the comma (en-US: "Mar 5, 2024, 5:30 PM").
78
+ const date = formatDate('2024-03-05T10:30:00Z');
79
+ expect(date).toContain('2024');
80
+ expect(date).not.toContain(':');
81
+ expect(formatDate('not-a-date')).toBe('not-a-date');
82
+ });
83
+
73
84
  test('usedPercent clamps to 0..100 and divides by zero safely', () => {
74
85
  expect(usedPercent(50, 100)).toBe(50);
75
86
  expect(usedPercent(150, 100)).toBe(100);
@@ -109,9 +120,18 @@ describe('usage number formatting', () => {
109
120
  expect(formatUsd(Number.NaN)).toBe('$0,00');
110
121
  });
111
122
 
123
+ test('formatCurrency delegates IDR and USD, and never invents a symbol', () => {
124
+ expect(formatCurrency(8827, 'IDR').replace(/\s/g, '')).toBe('Rp8.827');
125
+ expect(formatCurrency(12.5, 'usd')).toBe('$12,50');
126
+ // An unknown ISO code must not throw inside a render.
127
+ expect(formatCurrency(5, 'ZZZ')).toContain('ZZZ');
128
+ expect(formatCurrency(Number.NaN, 'IDR')).toBe('—');
129
+ });
130
+
112
131
  test('formatUsageAmount dispatches on the unit and guards non-finite values', () => {
113
132
  expect(formatUsageAmount(50, 'percent')).toBe('50%');
114
133
  expect(formatUsageAmount(12.5, 'usd')).toBe('$12,50');
134
+ expect(formatUsageAmount(8827, 'idr').replace(/\s/g, '')).toBe('Rp8.827');
115
135
  expect(formatUsageAmount(61950, 'tokens')).toBe('61,95K');
116
136
  expect(formatUsageAmount(61950, 'bytes')).toBe('61,95K');
117
137
  expect(formatUsageAmount(61950, 'requests')).toBe('61.950');
@@ -180,6 +200,52 @@ describe('buildProviders', () => {
180
200
  expect(entry?.hint).toBe('USD 12,34');
181
201
  });
182
202
 
203
+ test('a TokenPortal wallet is the hint, in the currency the endpoint named', () => {
204
+ const entry = buildProviders({
205
+ isMock: false,
206
+ generatedAt: '',
207
+ providers: [
208
+ summary({
209
+ id: 'tokenportal',
210
+ name: 'Tokenportal',
211
+ tokenPortal: {
212
+ balance: {
213
+ label: 'Kabmo',
214
+ currency: 'IDR',
215
+ balance: 8827,
216
+ limit: null,
217
+ limitRemaining: 8827,
218
+ isFreeTier: false,
219
+ sessionBudget: null,
220
+ },
221
+ },
222
+ }),
223
+ ],
224
+ })[0];
225
+ // Rp, not $: the live endpoint reports whole Rupiah.
226
+ expect(entry?.hint.replace(/\s/g, '')).toBe('Rp8.827');
227
+ });
228
+
229
+ test('a Rupiah credit window with no rich report keeps its Rupiah hint', () => {
230
+ const entry = buildProviders({
231
+ isMock: false,
232
+ generatedAt: '',
233
+ providers: [summary({ limits: [window({ unit: 'idr', remaining: 15000, label: 'Credit' })] })],
234
+ })[0];
235
+ expect(entry?.hint.replace(/\s/g, '')).toBe('Rp15.000left');
236
+ });
237
+
238
+ test('a tracked Command Code with an OAuth login asks for an API key', () => {
239
+ const entry = buildProviders({
240
+ isMock: false,
241
+ generatedAt: '',
242
+ providers: [summary({ id: 'commandcode', name: 'Command Code', tracked: true, limitsUnavailable: true })],
243
+ })[0];
244
+ // "No quota reported" would claim the plan has none; the credential type is
245
+ // what is missing.
246
+ expect(entry?.hint).toBe('API key needed');
247
+ });
248
+
183
249
  test('the hint reports the WORST used fraction, not the first window', () => {
184
250
  const entry = buildProviders({
185
251
  isMock: false,
@@ -44,6 +44,27 @@ async function open(harness?: string): Promise<HTMLElement> {
44
44
  return container;
45
45
  }
46
46
 
47
+ describe('AccessDropdown label', () => {
48
+ /**
49
+ * The chip's label is hidden by the COMPOSER's width, not the window's.
50
+ *
51
+ * `hidden lg:inline` read the viewport, so a 1440px window kept the label on
52
+ * inside a 366px card (the chat column beside the editor and the right panel)
53
+ * and wrapped the chip to two lines — measured, `Always ask` at h=40 against
54
+ * the row's 24px controls. `Toolbar`'s row is the `@container`, so the class
55
+ * has to be a container query.
56
+ */
57
+ test('the label folds on the COMPOSER width, never a viewport breakpoint', async () => {
58
+ const el = await open('omp-rpc');
59
+ const label = [...el.querySelectorAll('span')].find((span) => span.textContent === 'Always ask');
60
+ expect(label).toBeDefined();
61
+ const classes = label?.className ?? '';
62
+ expect(classes).toContain('hidden');
63
+ expect(classes).toContain('@[420px]:inline');
64
+ expect(classes).not.toMatch(/(^|\s)(sm|md|lg|xl):/);
65
+ });
66
+ });
67
+
47
68
  describe('AccessDropdown copy', () => {
48
69
  test('omp keeps the restricted-folder promise', async () => {
49
70
  const el = await open('omp-rpc');
@@ -36,7 +36,13 @@ export function AccessDropdown({ value, onSelect, harness }: AccessDropdownProps
36
36
  className="tap-chip flex items-center space-x-1 hover:bg-ink/5 px-2 py-1 rounded transition-colors text-xs text-muted"
37
37
  >
38
38
  <LockKeyhole size={12} className="text-ink/60" />
39
- <span className="hidden lg:inline">{copy.labels[value]}</span>
39
+ {/* A CONTAINER query, not `lg:`: the composer lives in a chat column
40
+ that can be 320px on a 1440px window (measured: 400px chat beside
41
+ the editor and the right panel), and `lg:` read the WINDOW, so the
42
+ label stayed on and wrapped the chip to two lines inside a 366px
43
+ card. `Toolbar`'s row is the `@container`; `ModeToggles` states the
44
+ same 420px. */}
45
+ <span className="hidden @[420px]:inline whitespace-nowrap">{copy.labels[value]}</span>
40
46
  </button>
41
47
  {showAccess && (
42
48
  <div className={`glass-popover absolute bottom-full left-0 mb-1 ${copy.note ? 'w-56' : 'w-40'} bg-paper border border-ink/20 rounded-md shadow-lg z-50 py-1 text-xs`}>
@@ -27,7 +27,9 @@ export function ThinkingLevelDropdown({ thinkingLevels, currentThinking, onSelec
27
27
  title={thinkingLevels.length === 0 ? 'This model exposes no thinking levels' : `Thinking Level: ${currentThinking}`}
28
28
  >
29
29
  <Brain size={12} className="text-ink/60" />
30
- <span className="hidden lg:inline">{currentThinking}</span>
30
+ {/* Same axis as `AccessDropdown` and `ModeToggles`: the chip's room is
31
+ the COMPOSER's width, not the window's. */}
32
+ <span className="hidden @[420px]:inline whitespace-nowrap">{currentThinking}</span>
31
33
  </button>
32
34
  {showThinking && thinkingLevels.length > 0 && (
33
35
  <div className="glass-popover absolute bottom-full left-0 mb-1 w-40 bg-paper border border-ink/20 rounded-md shadow-lg z-50 py-1 text-xs">
@@ -3,7 +3,7 @@ import { FileCode, FileImage, FolderOpen, Info, Loader2 } from 'lucide-preact';
3
3
  import { getLanguageFromPath } from '@/shared/lib/code/language';
4
4
  import { useDeferredHighlightLines } from '@/client/hooks/code/deferred-highlight';
5
5
  import { parseDirListing, parseNumberedCode } from '@/shared/lib/code/parser';
6
- import { getPaintableImageMimeType, SVG_MIME } from '@/shared/lib/fs/file-kind';
6
+ import { getPaintableImageMimeType, SVG_MIME } from '@/shared/lib/fs/mime';
7
7
  import { buildFsRawUrl, isVirtualPath, stripReadSelector } from '@/shared/lib/fs/paths';
8
8
  import { toolImageSrc } from '@/shared/lib/omp/session/tool-images';
9
9
  import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
@@ -50,12 +50,25 @@ afterAll(() => {
50
50
  /** omp's excerpt diff, long enough to overflow any ceiling. */
51
51
  const EXCERPT = Array.from({ length: 120 }, (_, i) => `${i + 1}|line ${i + 1}`).join('\n');
52
52
 
53
+ /**
54
+ * The merge view is `lazy()` (it carries CodeMirror, and that is what keeps the
55
+ * editor out of the boot chunk). Hold the same module promise the lazy import
56
+ * resolves, so the test can await the chunk instead of sleeping on it.
57
+ */
58
+ const MERGE_VIEW = import('@/client/components/workspace/diff-panel/MergeDiffView');
59
+
53
60
  async function mount(text = EXCERPT) {
54
61
  container = document.createElement('div');
55
62
  document.body.appendChild(container);
56
63
  await act(async () => {
57
64
  render(h(DiffView, { text, path: 'src/x.ts' }), container);
58
65
  });
66
+ // The assertions below are about the mounted view, not the fallback text:
67
+ // settle the lazy chunk, then let Preact's retry render flush.
68
+ await act(async () => {
69
+ await MERGE_VIEW;
70
+ });
71
+ await act(async () => {});
59
72
  return container;
60
73
  }
61
74
 
@@ -25,16 +25,31 @@
25
25
  */
26
26
 
27
27
  import { useMemo, useState } from 'preact/hooks';
28
- import type { ReactNode } from 'preact/compat';
28
+ import { Suspense, lazy, type ReactNode } from 'preact/compat';
29
29
  import { Columns2, Rows3, WrapText } from 'lucide-preact';
30
30
  import { patchSides } from '@/shared/lib/fs/patch-sides';
31
31
  import { excerptDiffToUnified, isExcerptDiff } from '@/shared/lib/fs/excerpt-diff';
32
32
  import { getLanguageFromPath } from '@/shared/lib/code/language';
33
33
  import { CopyButton } from '@/client/components/common/CopyButton';
34
- import { MergeDiffView } from '@/client/components/workspace/diff-panel/MergeDiffView';
35
34
  import { useEditorFontStack } from '@/client/hooks/editor/font';
36
35
  import { EDITOR_DEFAULT_FONT_SIZE } from '@/shared/lib/code/editor/typography';
37
36
 
37
+ /**
38
+ * The merge view is CodeMirror, and a diff card is the ONLY thing on the boot
39
+ * path that pulled the editor in: `MergeDiffView` → `diff-panel/folding.ts` →
40
+ * `@codemirror/{view,state,language,merge}` was 302 KB of the 2.05 MB boot
41
+ * chunk, paid by every console load whether or not a chat ever drew a diff.
42
+ *
43
+ * `lazy()` here is what keeps that out of the entry: the chat's own card is the
44
+ * first thing to need it, so the chunk is fetched with the transcript instead
45
+ * of ahead of it. The fallback is the same patch as readable text, not a
46
+ * spinner — a card that is already on screen should show its bytes while the
47
+ * editor loads.
48
+ */
49
+ const MergeDiffView = lazy(() =>
50
+ import('@/client/components/workspace/diff-panel/MergeDiffView').then((m) => ({ default: m.MergeDiffView })),
51
+ );
52
+
38
53
  /** A small icon-only toolbar button, `aria-pressed` for its own state. */
39
54
  function ToggleButton({
40
55
  pressed,
@@ -157,22 +172,30 @@ export function DiffView({ text, path = '', maxHeightClass = 'max-h-72' }: DiffV
157
172
  {/* No tab key: this diff lives inside a chat card, and the timeline —
158
173
  not the card — is what the reader scrolls. No counts either: the
159
174
  header above already prints them from the patch. */}
160
- <MergeDiffView
161
- original={sides.original}
162
- next={sides.next}
163
- language={language}
164
- viewMode={split ? 'split' : 'unified'}
165
- // Collapsed gaps: the reconstructed sides carry blank padding up to
166
- // each hunk's real line, so showing every row would draw thousands of
167
- // empty lines between two changes.
168
- contentMode="diff"
169
- wordWrap={wordWrap}
170
- ignoreWhitespace={false}
171
- tabKey={null}
172
- empty={false}
173
- fontFamily={editorFontFamily}
174
- fontSize={EDITOR_DEFAULT_FONT_SIZE}
175
- />
175
+ <Suspense
176
+ fallback={(
177
+ <pre className="h-full w-full overflow-auto p-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-all text-ink/70 select-text">
178
+ {unified}
179
+ </pre>
180
+ )}
181
+ >
182
+ <MergeDiffView
183
+ original={sides.original}
184
+ next={sides.next}
185
+ language={language}
186
+ viewMode={split ? 'split' : 'unified'}
187
+ // Collapsed gaps: the reconstructed sides carry blank padding up to
188
+ // each hunk's real line, so showing every row would draw thousands of
189
+ // empty lines between two changes.
190
+ contentMode="diff"
191
+ wordWrap={wordWrap}
192
+ ignoreWhitespace={false}
193
+ tabKey={null}
194
+ empty={false}
195
+ fontFamily={editorFontFamily}
196
+ fontSize={EDITOR_DEFAULT_FONT_SIZE}
197
+ />
198
+ </Suspense>
176
199
  </div>
177
200
  </div>
178
201
  );
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The editor pane's body, fetched when a document is actually opened.
8
+ *
9
+ * `Body` is where CodeMirror lives — the surface, the diff panel, the document
10
+ * viewers — so importing it statically put `@codemirror/*` in the editor chunk,
11
+ * and the editor column mounts on every console load, with or without a file
12
+ * open. Behind this boundary the column's empty state (`EmptyEditor`, no
13
+ * CodeMirror) is all a console visit pays for; the chunks arrive with the first
14
+ * file.
15
+ *
16
+ * It lives in its own module rather than in `index.tsx` because that file is at
17
+ * the repository's per-file ceiling, and the boundary plus its reason is the
18
+ * one thing here that needs to be read on its own.
19
+ *
20
+ * The fallback is the canvas the body would paint, never a spinner: the tab
21
+ * strip and the pane's frame are already on screen, and a spinner inside them
22
+ * would read as a loading file rather than a loading editor.
23
+ */
24
+
25
+ import { Suspense, lazy } from 'preact/compat';
26
+ import type { EditorBody } from '@/client/components/workspace/editor/Body';
27
+
28
+ const Body = lazy(() =>
29
+ import('@/client/components/workspace/editor/Body').then((m) => ({ default: m.EditorBody })),
30
+ );
31
+
32
+ type BodyProps = Parameters<typeof EditorBody>[0];
33
+
34
+ export function BodyLazy(props: BodyProps) {
35
+ return (
36
+ <Suspense fallback={<div className="h-full w-full" />}>
37
+ <Body {...props} />
38
+ </Suspense>
39
+ );
40
+ }
@@ -12,7 +12,7 @@ import type { UseFileEditorResult } from '@/client/hooks/editor/use-file-editor'
12
12
  import type { EditorFindState } from '@/client/hooks/editor/use-editor-find';
13
13
  import type { EditorCommand } from '@/shared/lib/code/editor/keymap';
14
14
  import { EDITOR_MAX_FONT_SIZE, EDITOR_MIN_FONT_SIZE } from '@/shared/lib/code/editor/typography';
15
- import { RENDERED_VIEWERS, type ViewerKind } from '@/shared/lib/fs/document-kind';
15
+ import { BINARY_VIEWERS, RENDERED_VIEWERS, type ViewerKind } from '@/shared/lib/fs/document-kind';
16
16
  import type { OpenedFile } from '@/shared/types/fs';
17
17
  import { isProbeableTab } from '@/client/hooks/workspace/missing-files';
18
18
  import { saveFileBytes } from '@/client/hooks/editor/save-bytes';
@@ -98,7 +98,7 @@ export function FilePane({
98
98
  }: FilePaneProps) {
99
99
  // A byte viewer owns the whole surface and has no buffer, so Save, find,
100
100
  // wrap and font zoom are all hidden — the toolbar reads this same flag.
101
- const byteViewer = viewerKind === 'image' || viewerKind === 'pdf' || viewerKind === 'docx' || viewerKind === 'spreadsheet';
101
+ const byteViewer = BINARY_VIEWERS[viewerKind] === true;
102
102
  // The rendered text views are the ones the eye toggle switches.
103
103
  const hasPreview = RENDERED_VIEWERS[viewerKind] === true;
104
104
 
@@ -294,6 +294,8 @@ export function FilePane({
294
294
  name={activeFile.name}
295
295
  source={editor.byteSource}
296
296
  content={editor.content}
297
+ root={activeFile.root ?? rootPath}
298
+ repo={activeFile.repo ?? repoPath}
297
299
  revision={editor.revision}
298
300
  onContentChange={editor.onChange}
299
301
  onSaveBytes={editor.deviceBacked ? undefined : saveBytes}
@@ -8,6 +8,7 @@ import { splitCandidate } from '@/shared/lib/workspace/split-editor';
8
8
  import { PanelRight } from 'lucide-preact';
9
9
  import { EditorHideButton } from '@/client/components/workspace/editor/EditorHideButton';
10
10
  import { useOnClickOutside } from '@/client/hooks/ui/on-click-outside';
11
+ import { CONTROL_ROW_HEIGHT } from '@/client/lib/ui/control-plate';
11
12
  import { getGitStatusInfo } from '@/shared/lib/fs/git-status';
12
13
  import type { OpenedFile } from '@/shared/types/fs';
13
14
 
@@ -111,7 +112,12 @@ export function EditorTabs({
111
112
  }
112
113
 
113
114
  return (
114
- <div className="flex bg-ink/10 w-full relative border-b border-ink/10" ref={tabsContainerRef}>
115
+ // The strip is the column's CHROME ROW: `CONTROL_ROW_HEIGHT.desktop`, the
116
+ // same 40px as the right column's strip and its `PanelHeader` beneath it.
117
+ // Sized from its own chips (`py-1.5` + `border-t-2`) it measured 31px, so
118
+ // the two columns' separators landed on different lines (measured in
119
+ // Chromium at 1365x768: 71 against 80).
120
+ <div className={`${CONTROL_ROW_HEIGHT.desktop} flex bg-ink/10 w-full relative border-b border-ink/10`} ref={tabsContainerRef}>
115
121
  <div className="flex overflow-hidden">
116
122
  {visibleTabs.map(file => {
117
123
  const isActive = file.id === activeFileId;
@@ -11,6 +11,7 @@ import { buildEditorClusters } from '@/client/components/workspace/editor/toolba
11
11
  import { ACTION_CLASS } from '@/client/components/workspace/editor/toolbar-toggle';
12
12
  import { writeKabmoSettings } from '@/shared/lib/settings/client';
13
13
  import { EDITOR_BLAME_CHANGED_EVENT, currentEditorBlame, useEditorBlame } from '@/client/hooks/editor/blame-settings';
14
+ import { CONTROL_ROW_HEIGHT } from '@/client/lib/ui/control-plate';
14
15
 
15
16
  export type EditorSaveStatus = 'idle' | 'saving' | 'saved' | 'error' | 'needs-permission';
16
17
 
@@ -244,7 +245,12 @@ export function EditorToolbar({
244
245
  // viewport. At the editor panel's 320px floor the path would be a truncated
245
246
  // fragment of a filename — not information, and the tab above already
246
247
  // carries it.
247
- <div className="@container flex items-center justify-between gap-2 px-3 py-2 border-b border-ink/10 bg-paper flex-shrink-0">
248
+ //
249
+ // The row is the shared chrome row (`CONTROL_ROW_HEIGHT.desktop`, not
250
+ // `py-2` around 27px of controls) because it is the peer of the right
251
+ // column's `PanelHeader`: two columns' second chrome rows have to end on the
252
+ // same line or the panels look staggered.
253
+ <div className={`@container ${CONTROL_ROW_HEIGHT.desktop} flex items-center justify-between gap-2 px-3 border-b border-ink/10 bg-paper flex-shrink-0`}>
248
254
  {/* Left status */}
249
255
  <div className="hidden @[420px]:flex items-center space-x-2 text-xs font-mono text-ink/40 min-w-0">
250
256
  <span className="truncate max-w-[300px]" title={path}>{path}</span>
@@ -0,0 +1,126 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The editor column's two chrome rows and the right column's header are ONE
8
+ * height.
9
+ *
10
+ * Measured in Chromium at 1365x768 before this test existed: the editor strip
11
+ * sized itself from its own chips (`py-1.5` + `border-t-2` = 31px) and its
12
+ * toolbar from `py-2` around 27px of controls (43px), against the right
13
+ * column's 40px strip and 40px header. The first separator landed at y=71 in
14
+ * one column and y=80 in the other, and the document began at 114 against 120 —
15
+ * which reads as two panels that are not on the same grid.
16
+ *
17
+ * happy-dom lays nothing out, so the assertion is the CLASS the rows carry: all
18
+ * three read `CONTROL_ROW_HEIGHT.desktop`, and that constant is 40px. A row that
19
+ * invents its own padding again fails here.
20
+ */
21
+
22
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
23
+ import { Window } from 'happy-dom';
24
+ import { h, render } from 'preact';
25
+ import type { ComponentChildren } from 'preact';
26
+ import { act } from 'preact/test-utils';
27
+
28
+ import { SessionStateContext } from '@/client/hooks/workspace/session-state/context';
29
+ import { CONTROL_ROW_HEIGHT } from '@/client/lib/ui/control-plate';
30
+ import { PanelHeader } from '@/client/components/workspace/panel-header';
31
+ import { EditorTabs } from '@/client/components/workspace/editor/Tabs';
32
+ import { EditorToolbar } from '@/client/components/workspace/editor/Toolbar';
33
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
34
+ import type { OpenedFile } from '@/shared/types/fs';
35
+
36
+ const FILES: OpenedFile[] = [{ id: 1, name: 'keep.ts', path: 'src/keep.ts' }];
37
+
38
+ let container: HTMLElement;
39
+
40
+ beforeAll(() => {
41
+ installDomGlobals(new Window({ url: 'http://localhost' }));
42
+ });
43
+
44
+ afterAll(() => {
45
+ restoreDomGlobals();
46
+ });
47
+
48
+ afterEach(() => {
49
+ if (!container) return;
50
+ render(null, container);
51
+ container.remove();
52
+ });
53
+
54
+ async function mount(children: ComponentChildren): Promise<HTMLElement> {
55
+ container = document.createElement('div');
56
+ document.body.appendChild(container);
57
+ await act(async () => {
58
+ render(
59
+ h(
60
+ SessionStateContext.Provider,
61
+ { value: { sessionId: 'chrome-rows', ready: false } },
62
+ children,
63
+ ),
64
+ container,
65
+ );
66
+ });
67
+ return container;
68
+ }
69
+
70
+ function toolbar() {
71
+ return h(EditorToolbar, {
72
+ path: 'src/keep.ts',
73
+ saveStatus: 'idle',
74
+ wordWrap: false,
75
+ hasPreview: false,
76
+ isPreview: false,
77
+ hasReview: false,
78
+ isReviewing: false,
79
+ copied: false,
80
+ canReload: true,
81
+ reloadDiscardsEdits: false,
82
+ onToggleFind: () => {},
83
+ onSave: () => {},
84
+ onTogglePreview: () => {},
85
+ onToggleReview: () => {},
86
+ onToggleWordWrap: () => {},
87
+ onZoomIn: () => {},
88
+ onZoomOut: () => {},
89
+ onCopy: () => {},
90
+ onDownload: () => {},
91
+ onReload: () => {},
92
+ onSaveAs: () => {},
93
+ onToggleMaximize: () => {},
94
+ });
95
+ }
96
+
97
+ describe('editor chrome rows', () => {
98
+ test('the shared row height is the 40px chrome row', () => {
99
+ expect(CONTROL_ROW_HEIGHT.desktop).toBe('h-10');
100
+ });
101
+
102
+ test('the tab strip is that row', async () => {
103
+ const el = await mount(
104
+ h(EditorTabs, {
105
+ openedFiles: FILES,
106
+ activeFileId: 1,
107
+ onSelectFile: () => {},
108
+ onCloseFile: () => {},
109
+ }),
110
+ );
111
+ const strip = el.firstElementChild as HTMLElement;
112
+ expect(strip.className).toContain(CONTROL_ROW_HEIGHT.desktop);
113
+ });
114
+
115
+ test('the toolbar is that row, so it ends on the right panel header line', async () => {
116
+ const el = await mount(toolbar());
117
+ const row = el.firstElementChild as HTMLElement;
118
+ expect(row.className).toContain(CONTROL_ROW_HEIGHT.desktop);
119
+ });
120
+
121
+ test('the right panel header is that row', async () => {
122
+ const el = await mount(h(PanelHeader, { left: h('span', null, 'picker') }));
123
+ const strip = el.firstElementChild as HTMLElement;
124
+ expect(strip.className).toContain(CONTROL_ROW_HEIGHT.desktop);
125
+ });
126
+ });