@kabmo-labs/kabmo 0.50.0 → 0.51.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 (370) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +503 -501
  3. package/dist/client/static/js/{Body-pd3nt4xa.js → Body-s3nh6vet.js} +3 -3
  4. package/dist/client/static/js/{CsvGrid-eksmqv8f.js → CsvGrid-j4h6cpnn.js} +2 -2
  5. package/dist/client/static/js/{DocxView-xfx1kt8x.js → DocxView-197x16zq.js} +3 -3
  6. package/dist/client/static/js/{DrawioView-2xyqg9bv.js → DrawioView-v6ps0cm5.js} +2 -2
  7. package/dist/client/static/js/{HtmlPreview-ps3f0aa5.js → HtmlPreview-a2t5zngp.js} +1 -1
  8. package/dist/client/static/js/ImageView-ar7hz7jx.js +1 -0
  9. package/dist/client/static/js/LayoutWrapper-epef152a.js +2 -0
  10. package/dist/client/static/js/MergeDiffView-7rwjvzk5.js +1 -0
  11. package/dist/client/static/js/Modal-9nxt67fm.js +60 -0
  12. package/dist/client/static/js/{PdfView-8fp08jym.js → PdfView-gzhcym20.js} +1 -1
  13. package/dist/client/static/js/SessionsView-3h872gpe.js +1 -0
  14. package/dist/client/static/js/{SheetView-g7mstjdp.js → SheetView-baaynkb4.js} +8 -8
  15. package/dist/client/static/js/{SvgPreview-wsv4h6c6.js → SvgPreview-jzcqwwcc.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-1kgm1049.js → abnfDiagram-O67JEVCF-grb1sfhr.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-3hkq8grc.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-mtm210rw.js → architectureDiagram-NJMV4G6O-9084jzwr.js} +5 -5
  19. package/dist/client/static/js/{astro-dszrfwwn.js → astro-m3fcq2sa.js} +1 -1
  20. package/dist/client/static/js/bash-n7wcmq3s.js +1 -0
  21. package/dist/client/static/js/{blockDiagram-BEXU5L5S-s474vn2w.js → blockDiagram-BEXU5L5S-qqcjrg1b.js} +6 -6
  22. package/dist/client/static/js/c-ypdp030b.js +1 -0
  23. package/dist/client/static/js/{c4Diagram-YGBWAQC7-s68v6tc8.js → c4Diagram-YGBWAQC7-gc8fqbpc.js} +2 -2
  24. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-291va3yk.js → classDiagram-v2-NBCMYWYE-pp6060kq.js} +7 -7
  25. package/dist/client/static/js/{cose-bilkent-JH36ORCC-0zg7crdw.js → cose-bilkent-JH36ORCC-744ekavk.js} +1 -1
  26. package/dist/client/static/js/cpp-cxwev3gs.js +1 -0
  27. package/dist/client/static/js/css-6mxcqf8c.js +1 -0
  28. package/dist/client/static/js/css-9gak6bze.js +1 -0
  29. package/dist/client/static/js/cynefin-OW5HDTMX-9m18e6m5.js +1 -0
  30. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-4gnmn3yc.js → cynefinDiagram-VND7K2PF-57dja6g9.js} +1 -1
  31. package/dist/client/static/js/{dagre-6A5THRUB-nxmj6bkg.js → dagre-6A5THRUB-de4xrbrw.js} +2 -2
  32. package/dist/client/static/js/{diagram-22UHCM2B-3171dabw.js → diagram-22UHCM2B-ky3ncyv8.js} +18 -18
  33. package/dist/client/static/js/{diagram-3UASUU5V-9h1pd6h8.js → diagram-3UASUU5V-zgg82bz9.js} +2 -2
  34. package/dist/client/static/js/{diagram-ATOU4E4O-ywfrbd6m.js → diagram-ATOU4E4O-r4s13e4n.js} +3 -3
  35. package/dist/client/static/js/{diagram-CDSNMT55-t87b4wbk.js → diagram-CDSNMT55-my21t0kq.js} +5 -5
  36. package/dist/client/static/js/{diagram-MLGK6HIB-bzv52p97.js → diagram-MLGK6HIB-pvt20jtj.js} +2 -2
  37. package/dist/client/static/js/{diagram-MPIPVDR6-8f66rp0a.js → diagram-MPIPVDR6-as9dk4f3.js} +2 -2
  38. package/dist/client/static/js/{dockerfile-z3v0km9v.js → dockerfile-3b5caedj.js} +1 -1
  39. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3y4w2j6t.js → ebnfDiagram-ZINNZB2B-tj3hkcj4.js} +1 -1
  40. package/dist/client/static/js/{elixir-c701n0qg.js → elixir-7q2k61zb.js} +1 -1
  41. package/dist/client/static/js/{elk-276RUBZZ-d9d23jch.js → elk-276RUBZZ-5e7wczf3.js} +1 -1
  42. package/dist/client/static/js/{erDiagram-OPXOYQCR-w4z3501c.js → erDiagram-OPXOYQCR-5jje7qrh.js} +3 -3
  43. package/dist/client/static/js/{erlang-cpw5s1f9.js → erlang-tjsd7n4d.js} +1 -1
  44. package/dist/client/static/js/eventmodeling-NTZA5JFV-d4egnv9v.js +1 -0
  45. package/dist/client/static/js/flowDiagram-KWPJA3E3-pdeqndnd.js +1 -0
  46. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-7wcxk4bm.js → ganttDiagram-FUAMR5RP-7hresycc.js} +4 -4
  47. package/dist/client/static/js/gitGraph-4MIJSDKK-grqv890n.js +1 -0
  48. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-sdh1hsb1.js → gitGraphDiagram-X574FWY7-8m202jb7.js} +17 -17
  49. package/dist/client/static/js/graphql-6rwdfcnf.js +1 -0
  50. package/dist/client/static/js/html-p76eszt9.js +1 -0
  51. package/dist/client/static/js/{index-zhnfq8br.js → index-0prwdwyb.js} +2 -2
  52. package/dist/client/static/js/{index-tew3rd6t.js → index-0y6tstk8.js} +1 -1
  53. package/dist/client/static/js/{index-1dx4dqzy.js → index-20hj80g4.js} +4 -4
  54. package/dist/client/static/js/index-21421tq7.js +2 -0
  55. package/dist/client/static/js/{index-0q39ajgh.js → index-254387vg.js} +2 -2
  56. package/dist/client/static/js/index-2y4gk5q5.js +2 -0
  57. package/dist/client/static/js/index-3fk8grhz.js +2 -0
  58. package/dist/client/static/js/index-3rrdmk9m.js +2 -0
  59. package/dist/client/static/js/{index-frhxbqhg.js → index-3sz9cztk.js} +1 -1
  60. package/dist/client/static/js/{index-9ydvkxz1.css → index-4m2d73m3.css} +1 -1
  61. package/dist/client/static/js/{index-7xn7gxgw.js → index-4nvcwtvr.js} +2 -2
  62. package/dist/client/static/js/index-4ppap7vb.js +9 -0
  63. package/dist/client/static/js/{index-vgwjn4de.js → index-4tbdws4r.js} +2 -2
  64. package/dist/client/static/js/{index-hqhz4eam.js → index-56hy2hcy.js} +1 -1
  65. package/dist/client/static/js/{index-dgkpbrdr.js → index-60g0e74a.js} +2 -2
  66. package/dist/client/static/js/{index-n54jd3aw.js → index-7ag37ghj.js} +11 -11
  67. package/dist/client/static/js/{index-bggz63br.js → index-7ehcjb3r.js} +7 -7
  68. package/dist/client/static/js/index-899yw6fh.js +2 -0
  69. package/dist/client/static/js/{index-4vaxdt8a.js → index-8pqx5n2p.js} +2 -2
  70. package/dist/client/static/js/{index-971stdh4.js → index-91jm3ywm.js} +2 -2
  71. package/dist/client/static/js/{index-5qwgexg6.js → index-9qf2h9jb.js} +4 -4
  72. package/dist/client/static/js/{index-wbma8kqw.js → index-9rp7h1nv.js} +23 -23
  73. package/dist/client/static/js/index-9rr23e0e.js +2 -0
  74. package/dist/client/static/js/index-9wj4ma9g.js +3 -0
  75. package/dist/client/static/js/{index-e471eprg.js → index-awtk0djy.js} +1 -1
  76. package/dist/client/static/js/{index-1d8v3bvm.js → index-awz6pyd0.js} +2 -2
  77. package/dist/client/static/js/index-cvx1vkrx.js +1 -0
  78. package/dist/client/static/js/{index-09ap9ncj.js → index-cwwg7k5f.js} +46 -46
  79. package/dist/client/static/js/{index-8fk7h2me.js → index-dzatbdws.js} +5 -5
  80. package/dist/client/static/js/{index-1adfks1n.js → index-e6ew77ph.js} +2 -2
  81. package/dist/client/static/js/{index-144aknp3.js → index-ej1va073.js} +2 -2
  82. package/dist/client/static/js/{index-cm8pa783.js → index-er7pj5k6.js} +2 -2
  83. package/dist/client/static/js/index-fm0t4pct.js +4 -0
  84. package/dist/client/static/js/{index-aqqj4xxy.js → index-g5wp6ksw.js} +2 -2
  85. package/dist/client/static/js/{index-ajqmcds5.js → index-gy4mtr2e.js} +2 -2
  86. package/dist/client/static/js/{index-kce86cnw.js → index-j9y4tjk0.js} +2 -2
  87. package/dist/client/static/js/{index-gws4prmg.js → index-kt7c42n7.js} +2 -2
  88. package/dist/client/static/js/index-ktmb341a.js +468 -0
  89. package/dist/client/static/js/{index-56319bht.js → index-m6zncj00.js} +2 -2
  90. package/dist/client/static/js/{index-jxxewcat.js → index-mpyd7qxj.js} +2 -2
  91. package/dist/client/static/js/{index-gcgsjd3c.js → index-ms80nne4.js} +2 -2
  92. package/dist/client/static/js/{index-k66w6d9b.js → index-my856e49.js} +2 -2
  93. package/dist/client/static/js/{index-c2mqr5fh.js → index-nt17ejrm.js} +2 -2
  94. package/dist/client/static/js/{index-zsx5vs3j.js → index-pvv340b4.js} +2 -2
  95. package/dist/client/static/js/{index-svx6rnfs.js → index-pxr36neg.js} +2 -2
  96. package/dist/client/static/js/{index-r2z0a118.js → index-q0k1am0g.js} +2 -2
  97. package/dist/client/static/js/{index-xrn2reb5.js → index-qrpx4sk1.js} +2 -2
  98. package/dist/client/static/js/{index-ajdzvegm.js → index-r2zsw7nw.js} +8 -8
  99. package/dist/client/static/js/{index-xgbcn89g.js → index-rbkvw2xs.js} +2 -2
  100. package/dist/client/static/js/{index-2g1ey1c9.js → index-scmtzcv1.js} +2 -2
  101. package/dist/client/static/js/{index-3rhk4apq.js → index-syvkpnc8.js} +1 -1
  102. package/dist/client/static/js/index-tfqqsj2g.js +1 -0
  103. package/dist/client/static/js/{index-7jdz4jr4.js → index-tj7xr4ta.js} +2 -2
  104. package/dist/client/static/js/{index-1vfej0gk.js → index-wvw70pgd.js} +2 -2
  105. package/dist/client/static/js/{index-qxzyvye9.js → index-wxs0x3g1.js} +2 -2
  106. package/dist/client/static/js/index-x507ndnc.js +314 -0
  107. package/dist/client/static/js/{index-1jx4nt2f.js → index-x87scjpa.js} +1 -1
  108. package/dist/client/static/js/{index-grkacfv3.js → index-xtrsvm0d.js} +2 -2
  109. package/dist/client/static/js/{index-ratbr10x.js → index-y1j18rha.js} +2 -2
  110. package/dist/client/static/js/{index-r6bm9sth.js → index-yv2ervdj.js} +7 -7
  111. package/dist/client/static/js/{index-k3vvk28c.js → index-z2pmt1bc.js} +1 -1
  112. package/dist/client/static/js/{index-ap6hv7s7.js → index-z446edg9.js} +1 -1
  113. package/dist/client/static/js/{index-1ec33b1j.js → index-zkgqa0c2.js} +2 -2
  114. package/dist/client/static/js/index-zwbw177x.js +2 -0
  115. package/dist/client/static/js/info-A6RAGUB7-rzpg7qk1.js +1 -0
  116. package/dist/client/static/js/{infoDiagram-VRGFBTTK-gtdp0z6p.js → infoDiagram-VRGFBTTK-5mb5w005.js} +2 -2
  117. package/dist/client/static/js/ini-kjcpgebh.js +1 -0
  118. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-c05m0sqq.js → ishikawaDiagram-OU5B5YK6-zk7fa0fm.js} +3 -3
  119. package/dist/client/static/js/java-0bcyv1jt.js +1 -0
  120. package/dist/client/static/js/javascript-0mqgcvps.js +1 -0
  121. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kgk5ygm2.js → journeyDiagram-ZHPQQLJL-8jd7b2aw.js} +5 -5
  122. package/dist/client/static/js/json-mb8k0b1n.js +1 -0
  123. package/dist/client/static/js/jsx-8p6dqgpq.js +1 -0
  124. package/dist/client/static/js/{julia-w13bz4s1.js → julia-nwh5w343.js} +1 -1
  125. package/dist/client/static/js/{kanban-definition-PNTS6WVX-q1w9w68s.js → kanban-definition-PNTS6WVX-yp9rks4k.js} +7 -7
  126. package/dist/client/static/js/lua-nxnqww9z.js +1 -0
  127. package/dist/client/static/js/markdown-8gbyxxjd.js +1 -0
  128. package/dist/client/static/js/{mermaid.core-1rz62j9g.js → mermaid.core-kxsxr8ec.js} +9 -9
  129. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-3m3w6bnb.js → mindmap-definition-NLK3R4M7-anx2kj3b.js} +5 -5
  130. package/dist/client/static/js/one-dark-pro-wyegjr0d.js +1 -0
  131. package/dist/client/static/js/one-light-kp6c3eqh.js +1 -0
  132. package/dist/client/static/js/packet-AYTQ26CC-eac14hsq.js +1 -0
  133. package/dist/client/static/js/{pegDiagram-GJSIUBJH-svd3ex4e.js → pegDiagram-GJSIUBJH-9egqyzkc.js} +1 -1
  134. package/dist/client/static/js/{perl-hcg3hacf.js → perl-wb4wtc9x.js} +1 -1
  135. package/dist/client/static/js/{php-q6hhp84p.js → php-9g594k9f.js} +1 -1
  136. package/dist/client/static/js/pie-WAS4IAKB-a9xqvysf.js +1 -0
  137. package/dist/client/static/js/{pieDiagram-5QR66LMP-2nrkw034.js → pieDiagram-5QR66LMP-f3dvprbm.js} +3 -3
  138. package/dist/client/static/js/properties-d5bwhgwz.js +1 -0
  139. package/dist/client/static/js/python-fdwwjjhh.js +1 -0
  140. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-4895d1aq.js → quadrantDiagram-O4NWA36T-qsghd295.js} +6 -6
  141. package/dist/client/static/js/r-4d2ygtfj.js +1 -0
  142. package/dist/client/static/js/radar-RG4KPBEZ-jv2pm0fe.js +1 -0
  143. package/dist/client/static/js/railroad-74A4TZTK-j74sc0b6.js +1 -0
  144. package/dist/client/static/js/railroad-abnf-HS5TGJTU-eaf19baz.js +1 -0
  145. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d4j5nq31.js +1 -0
  146. package/dist/client/static/js/railroad-peg-WCYAUIDC-ba862a9p.js +1 -0
  147. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-zj3g9yne.js → railroadDiagram-XR7U4H2S-6vmazht2.js} +1 -1
  148. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-727yjvs8.js → requirementDiagram-PLB6GJNP-phs0wn1v.js} +5 -5
  149. package/dist/client/static/js/{ruby-wzqz8vw6.js → ruby-c4hxsegh.js} +1 -1
  150. package/dist/client/static/js/{rust-r94pgqvf.js → rust-e4whdswc.js} +1 -1
  151. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-17c7p2pe.js → sankeyDiagram-IPEJSGJF-vkktegjk.js} +4 -4
  152. package/dist/client/static/js/{sass-xb3van7h.js → sass-6yxywx7t.js} +1 -1
  153. package/dist/client/static/js/{scss-ddg6t3x4.js → scss-9wz47c6t.js} +1 -1
  154. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-wcmbpckr.js → sequenceDiagram-PO4LG4MO-37e6se72.js} +16 -16
  155. package/dist/client/static/js/{sizeCapture-INFHLROL-nkr57cd6.js → sizeCapture-INFHLROL-3b4nsa4s.js} +1 -1
  156. package/dist/client/static/js/sql-sd00wgem.js +1 -0
  157. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vd7r8s78.js → stateDiagram-v2-GCMORJYK-2nnyqs9x.js} +3 -3
  158. package/dist/client/static/js/{svelte-wzaxz546.js → svelte-mm3jfpje.js} +1 -1
  159. package/dist/client/static/js/{swimlanes-2SLR337P-zhxm05ak.js → swimlanes-2SLR337P-eezd46ps.js} +1 -1
  160. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-h78096xp.js +8 -0
  161. package/dist/client/static/js/{timeline-definition-EJHVYXUP-n7gbzhzd.js → timeline-definition-EJHVYXUP-pz0f2b4h.js} +6 -6
  162. package/dist/client/static/js/treeView-Q6P3EWNA-e8yb44pd.js +1 -0
  163. package/dist/client/static/js/treemap-WGGIJYW6-zvdv84vp.js +1 -0
  164. package/dist/client/static/js/typescript-5txwpd9t.js +1 -0
  165. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-davsnwkf.js → usecaseDiagram-POWQR4AR-hvg7a87b.js} +29 -29
  166. package/dist/client/static/js/{vennDiagram-UO4OBE2U-gb54bh5k.js → vennDiagram-UO4OBE2U-03zh9phs.js} +8 -8
  167. package/dist/client/static/js/{vue-6zhfw7zx.js → vue-rcdqpz7q.js} +1 -1
  168. package/dist/client/static/js/wardley-WFR3VGLG-hbv0cg4s.js +1 -0
  169. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-sf98cg9t.js → wardleyDiagram-VNRHLVJA-xy77th92.js} +5 -5
  170. package/dist/client/static/js/xml-vtrdnrn6.js +1 -0
  171. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9nn09k40.js → xychartDiagram-PMCCYNJV-h48448cm.js} +4 -4
  172. package/dist/client/static/js/yaml-6k1tmwtm.js +1 -0
  173. package/package.json +2 -1
  174. package/src/client/components/common/MarkdownRenderer.tsx +31 -34
  175. package/src/client/components/common/ViewportSelector.tsx +4 -0
  176. package/src/client/components/common/command-palette/index.tsx +5 -2
  177. package/src/client/components/common/markdown-inline-file.test.tsx +131 -0
  178. package/src/client/components/common/search-select/OptionList.tsx +164 -0
  179. package/src/client/components/common/search-select/index.tsx +159 -136
  180. package/src/client/components/common/search-select/option.ts +16 -0
  181. package/src/client/components/common/search-select/search-select.test.tsx +61 -2
  182. package/src/client/components/common/sort-menu/index.tsx +9 -4
  183. package/src/client/components/layout/session-sidebar/HarnessFilter.tsx +26 -6
  184. package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +45 -49
  185. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +31 -25
  186. package/src/client/components/settings/ProjectSelectorDropdown.tsx +40 -101
  187. package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +12 -10
  188. package/src/client/components/settings/categories/command-settings/DetailPane.tsx +12 -10
  189. package/src/client/components/settings/categories/dictation-settings/CaptureSection.tsx +13 -18
  190. package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +8 -9
  191. package/src/client/components/settings/categories/keyboard-settings/ComposerKeys.tsx +10 -10
  192. package/src/client/components/settings/categories/mcp-settings/AdvancedSection.tsx +21 -18
  193. package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +12 -7
  194. package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +11 -11
  195. package/src/client/components/settings/categories/omp-settings/RoleEditor.test.ts +14 -11
  196. package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +17 -16
  197. package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +11 -9
  198. package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +10 -9
  199. package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +10 -8
  200. package/src/client/components/settings/categories/provider-settings/DialectFields.tsx +40 -24
  201. package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +13 -9
  202. package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +22 -17
  203. package/src/client/components/settings/categories/provider-settings/PresetPicker.tsx +79 -50
  204. package/src/client/components/settings/categories/provider-settings/model-dialogs.test.tsx +14 -7
  205. package/src/client/components/settings/categories/voice-settings/SpeechSettings.test.tsx +117 -15
  206. package/src/client/components/settings/categories/voice-settings/SpeechSettings.tsx +27 -3
  207. package/src/client/components/settings/categories/voice-settings/speech/EndpointSection.tsx +3 -1
  208. package/src/client/components/settings/categories/voice-settings/speech/EngineSection.tsx +32 -2
  209. package/src/client/components/settings/categories/voice-settings/speech/ModelsSection.tsx +277 -0
  210. package/src/client/components/settings/categories/voice-settings/speech/TestSection.tsx +2 -1
  211. package/src/client/components/settings/categories/voice-settings/speech/VoiceSection.tsx +83 -41
  212. package/src/client/components/workspace/btw-panel/TopicMenu.tsx +20 -2
  213. package/src/client/components/workspace/chat-timeline/AiMessageFooter.speech.test.tsx +35 -6
  214. package/src/client/components/workspace/chat-timeline/SpeechButton.tsx +111 -36
  215. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +21 -6
  216. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +7 -4
  217. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +22 -6
  218. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +17 -1
  219. package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +8 -65
  220. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.test.ts +12 -1
  221. package/src/client/components/workspace/chat-timeline/tool-renderers/registry.test.ts +35 -218
  222. package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +40 -177
  223. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.test.ts +13 -1
  224. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackToolJson.test.tsx +79 -0
  225. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackToolJson.tsx +86 -0
  226. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +25 -16
  227. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts +4 -2
  228. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +11 -4
  229. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.plugin.test.ts +3 -1
  230. package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +15 -15
  231. package/src/client/components/workspace/git-panel/BranchToolbar.tsx +30 -5
  232. package/src/client/data/mock/chat.ts +17 -0
  233. package/src/client/data/samples/tools-session.ts +8 -5
  234. package/src/client/hooks/editor/font.test.ts +21 -0
  235. package/src/client/hooks/editor/font.ts +12 -9
  236. package/src/client/hooks/settings/local-tts-models.ts +164 -0
  237. package/src/client/hooks/tts/tts-context.ts +6 -0
  238. package/src/client/hooks/tts/use-tts-player.ts +10 -0
  239. package/src/client/hooks/ui/markdown-render.ts +9 -1
  240. package/src/client/hooks/ui/markdown-scoped-links.ts +77 -0
  241. package/src/client/hooks/ui/open-inline-file.test.ts +144 -0
  242. package/src/client/hooks/ui/open-inline-file.ts +71 -0
  243. package/src/client/lib/commands/overlays.ts +16 -2
  244. package/src/client/lib/tts/player.test.ts +61 -0
  245. package/src/client/lib/tts/player.ts +120 -41
  246. package/src/client/tailwind.css +16 -0
  247. package/src/server/lib/chat/normalize-tools.server.test.ts +79 -0
  248. package/src/server/lib/chat/normalize-tools.server.ts +87 -0
  249. package/src/server/lib/harness/acp/background-replay.test.ts +36 -0
  250. package/src/server/lib/harness/acp/background-replay.ts +8 -3
  251. package/src/server/lib/harness/acp/frames-tool-shapes.test.ts +41 -13
  252. package/src/server/lib/harness/acp/frames-vendor-names.test.ts +209 -0
  253. package/src/server/lib/harness/acp/frames.test.ts +11 -20
  254. package/src/server/lib/harness/acp/frames.ts +5 -3
  255. package/src/server/lib/harness/acp/mapper.ts +5 -41
  256. package/src/server/lib/harness/acp/replay-transcript.ts +6 -1
  257. package/src/server/lib/harness/acp/subagent-frames.test.ts +1 -1
  258. package/src/server/lib/harness/acp/subagent-frames.ts +0 -2
  259. package/src/server/lib/harness/acp/tool-calls.ts +5 -16
  260. package/src/server/lib/harness/acp/tool-identity.test.ts +69 -8
  261. package/src/server/lib/harness/acp/tool-identity.ts +58 -10
  262. package/src/server/lib/harness/acp/tool-shape.ts +5 -3
  263. package/src/server/lib/harness/codex/transcript.server.test.ts +3 -1
  264. package/src/server/lib/harness/codex/transcript.server.ts +8 -15
  265. package/src/server/lib/lifecycle/paths.ts +12 -0
  266. package/src/server/lib/omp/session/messages.ts +5 -1
  267. package/src/server/lib/realtime/topics/peer-relay.server.ts +9 -1
  268. package/src/server/lib/realtime/topics/session.server.ts +5 -1
  269. package/src/server/lib/tts/engines/adapters.test.ts +17 -8
  270. package/src/server/lib/tts/engines/deepgram.ts +30 -9
  271. package/src/server/lib/tts/engines/index.ts +11 -0
  272. package/src/server/lib/tts/engines/local.ts +53 -0
  273. package/src/server/lib/tts/engines/sherpa-onnx-node.d.ts +38 -0
  274. package/src/server/lib/tts/engines/sherpa.test.ts +53 -0
  275. package/src/server/lib/tts/engines/sherpa.ts +287 -0
  276. package/src/server/lib/tts/local-models.server.ts +257 -0
  277. package/src/server/lib/tts/local-request.test.ts +66 -0
  278. package/src/server/lib/tts/local-request.ts +59 -0
  279. package/src/server/lib/tts/model-manifest.server.test.ts +71 -0
  280. package/src/server/lib/tts/model-manifest.server.ts +154 -0
  281. package/src/server/lib/tts/settings.server.ts +7 -4
  282. package/src/server/lib/tts/wav.test.ts +37 -0
  283. package/src/server/lib/tts/wav.ts +43 -0
  284. package/src/server/routes/chat/session-legacy-tools.test.ts +132 -0
  285. package/src/server/routes/chat/session.ts +10 -4
  286. package/src/server/routes/tts/index.ts +2 -0
  287. package/src/server/routes/tts/models.test.ts +148 -0
  288. package/src/server/routes/tts/models.ts +89 -0
  289. package/src/shared/lib/chat/tool/normalize.ts +67 -0
  290. package/src/shared/lib/chat/tool/render-key.test.ts +167 -0
  291. package/src/shared/lib/chat/tool/render-key.ts +247 -0
  292. package/src/shared/lib/chat/tool/tool-aliases.test.ts +42 -0
  293. package/src/shared/lib/chat/tool/tool-aliases.ts +59 -12
  294. package/src/shared/lib/fs/open-reference.test.ts +64 -0
  295. package/src/shared/lib/fs/open-reference.ts +74 -0
  296. package/src/shared/lib/icons/tint-hues.generated.ts +20 -20
  297. package/src/shared/lib/markdown/inline-file.test.ts +100 -0
  298. package/src/shared/lib/markdown/inline-file.ts +213 -0
  299. package/src/shared/lib/omp/session/messages-map.test.ts +2 -1
  300. package/src/shared/lib/omp/session/messages-parse.ts +3 -2
  301. package/src/shared/lib/omp/session/parse-message-blocks.ts +14 -0
  302. package/src/shared/lib/omp/subagent/transcript-client.ts +5 -1
  303. package/src/shared/lib/tts/engines.test.ts +28 -3
  304. package/src/shared/lib/tts/engines.ts +31 -6
  305. package/src/shared/lib/tts/local-models.test.ts +69 -0
  306. package/src/shared/lib/tts/local-models.ts +200 -0
  307. package/src/shared/lib/tts/speakable.test.ts +21 -1
  308. package/src/shared/lib/tts/speakable.ts +66 -33
  309. package/src/shared/lib/tts/voices.ts +125 -19
  310. package/src/shared/types/chat.ts +3 -0
  311. package/src/shared/types/index.ts +1 -0
  312. package/src/shared/types/tool-render.ts +37 -0
  313. package/dist/client/static/js/ImageView-7vse3k6x.js +0 -1
  314. package/dist/client/static/js/LayoutWrapper-qdp83fps.js +0 -2
  315. package/dist/client/static/js/MergeDiffView-hzsccppq.js +0 -1
  316. package/dist/client/static/js/Modal-zw9x5b6f.js +0 -60
  317. package/dist/client/static/js/SessionsView-qmgg03fv.js +0 -1
  318. package/dist/client/static/js/architecture-7GRP2DOG-g7b64973.js +0 -1
  319. package/dist/client/static/js/bash-z5pe89pt.js +0 -1
  320. package/dist/client/static/js/c-fy0fysfw.js +0 -1
  321. package/dist/client/static/js/cpp-wam8dze6.js +0 -1
  322. package/dist/client/static/js/css-ke51m4kc.js +0 -1
  323. package/dist/client/static/js/css-yryw442h.js +0 -1
  324. package/dist/client/static/js/cynefin-OW5HDTMX-8bscrcct.js +0 -1
  325. package/dist/client/static/js/eventmodeling-NTZA5JFV-pj22bng1.js +0 -1
  326. package/dist/client/static/js/flowDiagram-KWPJA3E3-9h6g160j.js +0 -1
  327. package/dist/client/static/js/gitGraph-4MIJSDKK-hgw4jcvk.js +0 -1
  328. package/dist/client/static/js/graphql-0yv8dc1v.js +0 -1
  329. package/dist/client/static/js/html-zk3m0az9.js +0 -1
  330. package/dist/client/static/js/index-0ff2x5g9.js +0 -1
  331. package/dist/client/static/js/index-17jy16v3.js +0 -314
  332. package/dist/client/static/js/index-1kjgdyfk.js +0 -2
  333. package/dist/client/static/js/index-4z3qtazf.js +0 -2
  334. package/dist/client/static/js/index-779rptb2.js +0 -1
  335. package/dist/client/static/js/index-9jrej3ht.js +0 -3
  336. package/dist/client/static/js/index-bczhbk01.js +0 -2
  337. package/dist/client/static/js/index-evvmkk2f.js +0 -2
  338. package/dist/client/static/js/index-jr6q69r3.js +0 -465
  339. package/dist/client/static/js/index-qaxjp73x.js +0 -2
  340. package/dist/client/static/js/index-rgneq3zt.js +0 -2
  341. package/dist/client/static/js/index-tfwsch7a.js +0 -4
  342. package/dist/client/static/js/index-vn495w82.js +0 -9
  343. package/dist/client/static/js/info-A6RAGUB7-k0kv05ny.js +0 -1
  344. package/dist/client/static/js/ini-apj95p59.js +0 -1
  345. package/dist/client/static/js/java-khk2v3g4.js +0 -1
  346. package/dist/client/static/js/javascript-gez6yppm.js +0 -1
  347. package/dist/client/static/js/json-r78y6e80.js +0 -1
  348. package/dist/client/static/js/jsx-h7hfj8cz.js +0 -1
  349. package/dist/client/static/js/lua-pat2bzg3.js +0 -1
  350. package/dist/client/static/js/markdown-545zn05v.js +0 -1
  351. package/dist/client/static/js/one-dark-pro-7c942tnw.js +0 -1
  352. package/dist/client/static/js/one-light-tp8y6c5g.js +0 -1
  353. package/dist/client/static/js/packet-AYTQ26CC-ne66q5h9.js +0 -1
  354. package/dist/client/static/js/pie-WAS4IAKB-ej9aysvz.js +0 -1
  355. package/dist/client/static/js/properties-9f76xngb.js +0 -1
  356. package/dist/client/static/js/python-nwerpkfq.js +0 -1
  357. package/dist/client/static/js/r-39k5dr2p.js +0 -1
  358. package/dist/client/static/js/radar-RG4KPBEZ-375pe46t.js +0 -1
  359. package/dist/client/static/js/railroad-74A4TZTK-hdgdfsc1.js +0 -1
  360. package/dist/client/static/js/railroad-abnf-HS5TGJTU-2p5ynn4a.js +0 -1
  361. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-2p1fxxen.js +0 -1
  362. package/dist/client/static/js/railroad-peg-WCYAUIDC-g131pt42.js +0 -1
  363. package/dist/client/static/js/sql-4dcrp3sw.js +0 -1
  364. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-myzk2rg0.js +0 -8
  365. package/dist/client/static/js/treeView-Q6P3EWNA-gfztfha9.js +0 -1
  366. package/dist/client/static/js/treemap-WGGIJYW6-kwtrwq1f.js +0 -1
  367. package/dist/client/static/js/typescript-q0493nmw.js +0 -1
  368. package/dist/client/static/js/wardley-WFR3VGLG-30dnzvww.js +0 -1
  369. package/dist/client/static/js/xml-91sb3gt9.js +0 -1
  370. package/dist/client/static/js/yaml-ghx4mjw1.js +0 -1
@@ -17,8 +17,10 @@
17
17
  */
18
18
 
19
19
  import type { ToolCallData, ToolType } from '@/shared/types/chat';
20
+ import type { ToolRender } from '@/shared/types/tool-render';
20
21
  import { hashlineTargetPath } from '@/shared/lib/omp/session/hashline-patch';
21
22
  import { toolInputPath } from '@/shared/lib/chat/tool/tool-input-path';
23
+ import { isToolRenderKey } from '@/shared/lib/chat/tool/render-key';
22
24
  import { extractToolImages, type ToolImageRef } from '@/shared/lib/omp/session/tool-images';
23
25
  import { isRecord } from '@/shared/lib/util/guards';
24
26
 
@@ -41,6 +43,10 @@ export interface ParsedToolCall {
41
43
  /** The transport's own renderer key, when it knows one (ACP `kind`). The
42
44
  * shared inference below is a fallback for providers that only send a name. */
43
45
  toolType?: ToolType;
46
+ /** The SERVER-normalized renderer family, carried from the wire block. Its
47
+ * absence means the producer could not classify the call, and the card
48
+ * shows the raw JSON body instead of guessing a panel. */
49
+ render?: ToolRender;
44
50
  intent?: string;
45
51
  target?: string;
46
52
  command?: string;
@@ -117,6 +123,7 @@ export function parseMessageBlocks(content: unknown): ParsedMessageBlocks {
117
123
  arguments?: unknown;
118
124
  input?: unknown;
119
125
  toolType?: unknown;
126
+ render?: unknown;
120
127
  };
121
128
  if (block.type === 'thinking') {
122
129
  const body = typeof block.thinking === 'string'
@@ -155,6 +162,9 @@ export function parseMessageBlocks(content: unknown): ParsedMessageBlocks {
155
162
  name,
156
163
  title: detail ? `${name} — ${detail}` : name,
157
164
  ...(typeof block.toolType === 'string' ? { toolType: block.toolType as ToolType } : {}),
165
+ ...(isToolRenderKey(isRecord(block.render) ? block.render.key : undefined)
166
+ ? { render: block.render as ToolRender }
167
+ : {}),
158
168
  intent,
159
169
  target: target || undefined,
160
170
  command: command || undefined,
@@ -199,9 +209,13 @@ export function toToolCallData(
199
209
  : options.streaming ? 'running' : 'success';
200
210
  return {
201
211
  id: parsed.id,
212
+ // `type` is the transport's own word; the PANEL comes from `render`. The
213
+ // two answer different questions (`glob` is a variant of the grep family),
214
+ // so neither is derived from the other.
202
215
  type: parsed.toolType ?? inferToolType(parsed.name),
203
216
  name: parsed.name,
204
217
  title: parsed.title,
218
+ ...(parsed.render ? { render: parsed.render } : {}),
205
219
  intent: parsed.intent,
206
220
  target: parsed.target,
207
221
  command: parsed.command,
@@ -12,6 +12,7 @@
12
12
 
13
13
  import type { ChatMessageData, SubagentMessagesPage } from '@/shared/types';
14
14
  import { toChatMessage } from '@/shared/lib/omp/session/mapper';
15
+ import { normalizeMessageTools } from '@/shared/lib/chat/tool/normalize';
15
16
  import { extractText } from '@/shared/lib/omp/session/parse-message-blocks';
16
17
  import { normalizeThinkingLevel } from '@/shared/lib/models/thinking-levels';
17
18
  import { isRecord } from '@/shared/lib/util/guards';
@@ -93,7 +94,10 @@ export function convertMessages(raw: unknown[], streaming: boolean): ChatMessage
93
94
  if (currentLevel !== undefined && converted.role !== 'user') {
94
95
  converted.thinkingLevel = currentLevel;
95
96
  }
96
- out.push(converted);
97
+ // A child transcript is read straight off the wire or the disk, never
98
+ // through the session topic's ingress, so its tool rows get the same
99
+ // classification here — one rule, one resolver.
100
+ out.push(normalizeMessageTools(converted));
97
101
  }
98
102
  return out;
99
103
  }
@@ -16,10 +16,10 @@ import {
16
16
  } from '@/shared/lib/tts/engines';
17
17
 
18
18
  describe('TTS_ENGINES', () => {
19
- test('omp is the shipped default and needs no key', () => {
19
+ test('omp is the shipped default, and both on-machine engines need no key', () => {
20
20
  expect(TTS_ENGINES[0].id).toBe('omp');
21
21
  expect(TTS_ENGINES[0].needsKey).toBe(false);
22
- expect(TTS_ENGINES.filter((engine) => !engine.needsKey).map((engine) => engine.id)).toEqual(['omp']);
22
+ expect(TTS_ENGINES.filter((engine) => !engine.needsKey).map((engine) => engine.id)).toEqual(['omp', 'local']);
23
23
  });
24
24
 
25
25
  test('every engine has a positive input budget and an ordered speed range', () => {
@@ -45,12 +45,37 @@ describe('TTS_ENGINES', () => {
45
45
 
46
46
  test('only the engines that document language support expose it', () => {
47
47
  expect(TTS_ENGINES.filter((engine) => engine.language !== 'none').map((engine) => engine.id))
48
- .toEqual(['openai', 'elevenlabs', 'xai', 'gemini']);
48
+ .toEqual(['local', 'openai', 'elevenlabs', 'xai', 'gemini']);
49
49
  expect(ttsEngine('xai').language).toBe('required');
50
50
  expect(ttsEngine('gemini').language).toBe('auto');
51
+ // The ONNX engine sends a language per request; omp has no such channel.
52
+ expect(ttsEngine('local').language).toBe('parameter');
51
53
  expect(ttsEngine('omp').language).toBe('none');
52
54
  });
53
55
 
56
+ test('Deepgram offers Flux voices whose id carries the language', () => {
57
+ const ids = ttsEngine('deepgram').models.map((model) => model.id);
58
+ expect(new Set(ids).size).toBe(ids.length);
59
+ expect(ids).toContain('flux-dewi-id');
60
+ for (const id of ids.filter((entry) => entry.startsWith('flux-'))) {
61
+ expect(id).toMatch(/^flux-[a-z]+-[a-z]{2}$/);
62
+ }
63
+ });
64
+
65
+ test('Deepgram speed is the range both endpoints accept', () => {
66
+ // Measured: Aura refuses 0.5 and 1.55; Flux refuses the same edges.
67
+ expect(clampTtsSpeed('deepgram', 2)).toBe(1.5);
68
+ expect(clampTtsSpeed('deepgram', 0.1)).toBe(0.7);
69
+ });
70
+
71
+ test('the ONNX engine is a machine-local engine with a real speed range', () => {
72
+ expect(ttsEngine('local').where).toContain('never leaves this machine');
73
+ expect(ttsEngine('local').needsKey).toBe(false);
74
+ expect(ttsEngine('local').editableBaseUrl).toBe(false);
75
+ expect(clampTtsSpeed('local', 9)).toBe(2);
76
+ expect(clampTtsSpeed('local', 0.1)).toBe(0.7);
77
+ });
78
+
54
79
  test('only the OpenAI-compatible engine accepts a keyless endpoint', () => {
55
80
  expect(TTS_ENGINES.filter((engine) => engine.keyOptional).map((engine) => engine.id)).toEqual(['openai']);
56
81
  });
@@ -24,7 +24,7 @@ import {
24
24
  XAI_VOICES,
25
25
  } from '@/shared/lib/tts/voices';
26
26
 
27
- export type TtsEngine = 'omp' | 'openai' | 'elevenlabs' | 'deepgram' | 'xai' | 'gemini';
27
+ export type TtsEngine = 'omp' | 'local' | 'openai' | 'elevenlabs' | 'deepgram' | 'xai' | 'gemini';
28
28
 
29
29
  export interface TtsModelOption {
30
30
  id: string;
@@ -73,7 +73,8 @@ export interface TtsEngineSpec {
73
73
  * - `instructions`: folded into the model's steering prompt (OpenAI's
74
74
  * `gpt-4o-mini-tts`); engines without prompt steering ignore it.
75
75
  * - `auto`: no parameter; the model detects the answer's language (Gemini).
76
- * - `none`: the engine has no language control (omp's local voices, Aura).
76
+ * - `none`: the engine has no language control (omp's local voices, and
77
+ * Deepgram, whose model id carries the language).
77
78
  */
78
79
  language: 'required' | 'parameter' | 'instructions' | 'auto' | 'none';
79
80
  /** Where the provider documents the API, shown under the fields. */
@@ -99,6 +100,26 @@ export const TTS_ENGINES: readonly TtsEngineSpec[] = [
99
100
  language: 'none',
100
101
  docs: 'https://github.com/kabmo-labs/kabmo/wiki/Chat-Stream-and-Tools',
101
102
  },
103
+ {
104
+ id: 'local',
105
+ label: 'This machine (ONNX)',
106
+ where: 'Text never leaves this machine. Runs inside Kabmo’s own server; the model is downloaded once.',
107
+ needsKey: false,
108
+ keyOptional: false,
109
+ editableBaseUrl: false,
110
+ baseUrl: '',
111
+ defaultModel: '',
112
+ defaultVoice: '',
113
+ // The model list is the INSTALLED set, which only the server can read — a
114
+ // static list here would offer a download the user has not made.
115
+ models: [],
116
+ voices: [],
117
+ voiceEditable: true,
118
+ maxChars: 4000,
119
+ speed: { min: 0.7, max: 2 },
120
+ language: 'parameter',
121
+ docs: 'https://github.com/kabmo-labs/kabmo/wiki/Chat-Stream-and-Tools',
122
+ },
102
123
  {
103
124
  id: 'openai',
104
125
  label: 'OpenAI-compatible API',
@@ -149,8 +170,8 @@ export const TTS_ENGINES: readonly TtsEngineSpec[] = [
149
170
  },
150
171
  {
151
172
  id: 'deepgram',
152
- label: 'Deepgram Aura',
153
- where: 'Text is uploaded to api.deepgram.com.',
173
+ label: 'Deepgram',
174
+ where: 'Text is uploaded to api.deepgram.com. Aura and Flux voices are both offered.',
154
175
  needsKey: true,
155
176
  keyOptional: false,
156
177
  editableBaseUrl: false,
@@ -161,9 +182,13 @@ export const TTS_ENGINES: readonly TtsEngineSpec[] = [
161
182
  voices: [],
162
183
  voiceEditable: false,
163
184
  maxChars: 2000,
164
- speed: { min: 0.5, max: 2 },
185
+ // The intersection of the two generations, measured: Aura refuses 0.5 and
186
+ // 1.55, Flux refuses 0.5 below and 1.55 above, and only Flux demands 0.05
187
+ // steps. The client must not offer a value either endpoint answers 400 to.
188
+ speed: { min: 0.7, max: 1.5 },
189
+ // The model id's language segment selects the language; there is no field.
165
190
  language: 'none',
166
- docs: 'https://developers.deepgram.com/reference/text-to-speech/speak-request',
191
+ docs: 'https://developers.deepgram.com/docs/tts-models-languages-overview',
167
192
  },
168
193
  {
169
194
  id: 'xai',
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { describe, expect, test } from 'bun:test';
7
+
8
+ import {
9
+ LOCAL_LANGUAGE_LABELS,
10
+ LOCAL_TTS_CATALOG,
11
+ SUPERTONIC_VOICE_LABELS,
12
+ catalogModel,
13
+ describeLocalModel,
14
+ formatModelSize,
15
+ localLanguageOptions,
16
+ localVoiceLabel,
17
+ localVoiceOptions,
18
+ } from '@/shared/lib/tts/local-models';
19
+
20
+ const supertonic = LOCAL_TTS_CATALOG[0]!;
21
+
22
+ describe('local model catalog', () => {
23
+ test('the shipped model speaks Indonesian and states its voices', () => {
24
+ expect(supertonic.id).toBe('supertonic-3');
25
+ expect(supertonic.languages).toContain('id');
26
+ expect(supertonic.defaultLanguage).toBe('en');
27
+ expect(supertonic.voices).toBe(SUPERTONIC_VOICE_LABELS.length);
28
+ expect(catalogModel('supertonic-3')).toBe(supertonic);
29
+ expect(catalogModel('nope')).toBeUndefined();
30
+ });
31
+
32
+ test('every declared Supertonic language has a label', () => {
33
+ for (const code of supertonic.languages) {
34
+ expect(LOCAL_LANGUAGE_LABELS[code]).toBeString();
35
+ }
36
+ expect(supertonic.languages).toHaveLength(31);
37
+ });
38
+
39
+ test('a model with languages offers only those; one without offers every known code', () => {
40
+ expect(localLanguageOptions(supertonic).map((entry) => entry.id)).toContain('id');
41
+ expect(localLanguageOptions(supertonic)).toHaveLength(31);
42
+ expect(localLanguageOptions({ ...supertonic, languages: ['en', 'id'] }).map((entry) => entry.id))
43
+ .toEqual(['en', 'id']);
44
+ expect(localLanguageOptions({ ...supertonic, languages: [] })).toHaveLength(
45
+ Object.keys(LOCAL_LANGUAGE_LABELS).length,
46
+ );
47
+ });
48
+
49
+ test('a voice is its documented name, and an unnamed speaker is still numbered', () => {
50
+ expect(localVoiceLabel(supertonic, 0)).toBe('Female 1');
51
+ expect(localVoiceLabel(supertonic, 9)).toBe('Male 5');
52
+ expect(localVoiceLabel({ ...supertonic, voiceLabels: undefined }, 3)).toBe('Voice 3');
53
+ });
54
+
55
+ test('voice options cover the probed speaker count, or one default when unknown', () => {
56
+ expect(localVoiceOptions({ ...supertonic, voices: 2 }).map((entry) => entry.label))
57
+ .toEqual(['Female 1', 'Female 2']);
58
+ expect(localVoiceOptions({ ...supertonic, voices: 0 })).toEqual([{ id: '0', label: 'Default voice' }]);
59
+ expect(localVoiceOptions(null)).toEqual([{ id: '0', label: 'Default voice' }]);
60
+ });
61
+
62
+ test('the one-line description states languages, voices and size', () => {
63
+ expect(describeLocalModel(supertonic)).toBe('31 languages · 10 voices · 146 MB');
64
+ expect(describeLocalModel({ ...supertonic, languages: [], voices: 0, sizeBytes: undefined }))
65
+ .toBe('languages not declared');
66
+ expect(formatModelSize(1_500_000_000)).toBe('1.5 GB');
67
+ expect(formatModelSize(0)).toBe('');
68
+ });
69
+ });
@@ -0,0 +1,200 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The local ONNX speech engine's model catalog, and the two facts a model has to
8
+ * state before the settings page can offer it: which languages it speaks and
9
+ * which voices it has.
10
+ *
11
+ * Why the catalog is Kabmo's and not the engine's: sherpa-onnx validates the
12
+ * language code against its own 32-code list, NOT against the model that was
13
+ * loaded. Measured — the English-only Supertonic v1 bundle happily accepts
14
+ * `lang: "id"` and returns audio in English. A picker that trusted the runtime
15
+ * would offer Indonesian on a model that cannot speak it, so the declared list
16
+ * lives here, and the adapter refuses a language outside it.
17
+ *
18
+ * `languages: []` means the model declared nothing (a bundle added from a link
19
+ * that carries no metadata). Those pass the language through unchanged, and the
20
+ * settings page says so rather than pretending to know.
21
+ */
22
+
23
+ /** Architectures the in-process runtime can load today, and only measured ones. */
24
+ export type LocalTtsArch = 'supertonic' | 'kokoro';
25
+
26
+ export interface LocalTtsModelInfo {
27
+ /** Directory name under `<data>/tts-models`, and the value stored in settings. */
28
+ id: string;
29
+ label: string;
30
+ arch: LocalTtsArch;
31
+ /** ISO 639-1 codes the model claims. Empty = it claims nothing. */
32
+ languages: string[];
33
+ /** Language used when the setting is empty. */
34
+ defaultLanguage: string;
35
+ /** Speaker count the runtime reports; 0 until probed. */
36
+ voices: number;
37
+ /** Human names by speaker id, when the model documents them. */
38
+ voiceLabels?: string[];
39
+ sampleRate: number;
40
+ /** Bytes on disk, for the settings copy. */
41
+ sizeBytes?: number;
42
+ /** Where it came from: a catalog URL or a link the user pasted. */
43
+ sourceUrl?: string;
44
+ installedAt?: string;
45
+ /** True for entries the settings page offers as a one-click download. */
46
+ curated?: boolean;
47
+ /** One line: what this model trades for what. */
48
+ notes?: string;
49
+ }
50
+
51
+ export type InstallStatus = 'downloading' | 'extracting' | 'probing' | 'ready' | 'error';
52
+
53
+ /** One install in flight, or the record of the last one. */
54
+ export interface InstallJob {
55
+ id: string;
56
+ label: string;
57
+ status: InstallStatus;
58
+ /** Bytes written so far. */
59
+ received: number;
60
+ /** `content-length`, or 0 when the server did not state one. */
61
+ total: number;
62
+ /** 0–1 while downloading, 1 after. */
63
+ progress: number;
64
+ error?: string;
65
+ /** The URL the job is fetching — a pasted link is retried with it, not its id. */
66
+ url?: string;
67
+ startedAt: number;
68
+ }
69
+
70
+ /** The shipped Supertonic style tensors, in the runtime's alphabetical order. */
71
+ export const SUPERTONIC_VOICE_LABELS: readonly string[] = [
72
+ 'Female 1',
73
+ 'Female 2',
74
+ 'Female 3',
75
+ 'Female 4',
76
+ 'Female 5',
77
+ 'Male 1',
78
+ 'Male 2',
79
+ 'Male 3',
80
+ 'Male 4',
81
+ 'Male 5',
82
+ ];
83
+
84
+ /** The 31 codes Supertonic 3 ships, with the label the picker shows. */
85
+ export const LOCAL_LANGUAGE_LABELS: Readonly<Record<string, string>> = {
86
+ ar: 'Arabic',
87
+ bg: 'Bulgarian',
88
+ cs: 'Czech',
89
+ da: 'Danish',
90
+ de: 'German',
91
+ el: 'Greek',
92
+ en: 'English',
93
+ es: 'Spanish',
94
+ et: 'Estonian',
95
+ fi: 'Finnish',
96
+ fr: 'French',
97
+ hi: 'Hindi',
98
+ hr: 'Croatian',
99
+ hu: 'Hungarian',
100
+ id: 'Indonesian',
101
+ it: 'Italian',
102
+ ja: 'Japanese',
103
+ ko: 'Korean',
104
+ lt: 'Lithuanian',
105
+ lv: 'Latvian',
106
+ nl: 'Dutch',
107
+ pl: 'Polish',
108
+ pt: 'Portuguese',
109
+ ro: 'Romanian',
110
+ ru: 'Russian',
111
+ sk: 'Slovak',
112
+ sl: 'Slovenian',
113
+ sv: 'Swedish',
114
+ tr: 'Turkish',
115
+ uk: 'Ukrainian',
116
+ vi: 'Vietnamese',
117
+ };
118
+
119
+ const SUPERTONIC_LANGUAGES: readonly string[] = Object.keys(LOCAL_LANGUAGE_LABELS);
120
+
121
+ /**
122
+ * Models the settings page can download with one click.
123
+ *
124
+ * Both are sherpa-onnx int8 bundles, which is what the runtime reads. The
125
+ * Indonesian voice of Piper is deliberately absent: its model card names the
126
+ * Lessac corpus, whose licence excludes commercial use of the synthesis.
127
+ */
128
+ export const LOCAL_TTS_CATALOG: readonly LocalTtsModelInfo[] = [
129
+ {
130
+ id: 'supertonic-3',
131
+ label: 'Supertonic 3',
132
+ arch: 'supertonic',
133
+ languages: [...SUPERTONIC_LANGUAGES],
134
+ defaultLanguage: 'en',
135
+ voices: 10,
136
+ voiceLabels: [...SUPERTONIC_VOICE_LABELS],
137
+ sampleRate: 44_100,
138
+ sizeBytes: 146_000_000,
139
+ curated: true,
140
+ sourceUrl:
141
+ 'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/sherpa-onnx-supertonic-3-tts-int8-2026-05-11.tar.bz2',
142
+ notes: '99M parameters, 31 languages including Indonesian, ten voices. Weights OpenRAIL-M, runtime MIT.',
143
+ },
144
+ {
145
+ id: 'kokoro-en-zh',
146
+ label: 'Kokoro 82M (English + Chinese)',
147
+ arch: 'kokoro',
148
+ languages: ['en', 'zh'],
149
+ defaultLanguage: 'en',
150
+ voices: 103,
151
+ sampleRate: 24_000,
152
+ sizeBytes: 140_000_000,
153
+ curated: true,
154
+ sourceUrl:
155
+ 'https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kokoro-int8-multi-lang-v1_1.tar.bz2',
156
+ notes: '82M parameters, 103 voices, English and Chinese only — Supertonic 3 is the Indonesian one.',
157
+ },
158
+ ];
159
+
160
+ /** One catalog entry, or undefined. */
161
+ export function catalogModel(id: string): LocalTtsModelInfo | undefined {
162
+ return LOCAL_TTS_CATALOG.find((model) => model.id === id);
163
+ }
164
+
165
+ /** The language list a model declares, or every known code when it declares none. */
166
+ export function localLanguageOptions(model: LocalTtsModelInfo | null): { id: string; label: string }[] {
167
+ const codes = model && model.languages.length > 0 ? model.languages : Object.keys(LOCAL_LANGUAGE_LABELS);
168
+ return codes.map((code) => ({ id: code, label: LOCAL_LANGUAGE_LABELS[code] ?? code.toUpperCase() }));
169
+ }
170
+
171
+ /** "Female 3" when the model names its voices, else "Voice 3". */
172
+ export function localVoiceLabel(model: LocalTtsModelInfo | null, sid: number): string {
173
+ const named = model?.voiceLabels?.[sid];
174
+ return named ?? `Voice ${sid}`;
175
+ }
176
+
177
+ /** Every voice of a model as picker options; one entry when the count is unknown. */
178
+ export function localVoiceOptions(model: LocalTtsModelInfo | null): { id: string; label: string }[] {
179
+ const count = model?.voices ?? 0;
180
+ if (count <= 0) return [{ id: '0', label: 'Default voice' }];
181
+ return Array.from({ length: count }, (_unused, sid) => ({ id: String(sid), label: localVoiceLabel(model, sid) }));
182
+ }
183
+
184
+ /** Bytes → "146 MB", for a settings row that must not show a raw number. */
185
+ export function formatModelSize(bytes: number | undefined): string {
186
+ if (!bytes || bytes <= 0) return '';
187
+ const mb = bytes / 1_000_000;
188
+ return mb >= 1000 ? `${(mb / 1000).toFixed(1)} GB` : `${Math.round(mb)} MB`;
189
+ }
190
+
191
+ /** "31 languages · 10 voices · 146 MB" — the one line under a model's name. */
192
+ export function describeLocalModel(model: LocalTtsModelInfo): string {
193
+ const parts: string[] = [];
194
+ if (model.languages.length > 0) parts.push(`${model.languages.length} languages`);
195
+ else parts.push('languages not declared');
196
+ if (model.voices > 0) parts.push(`${model.voices} voices`);
197
+ const size = formatModelSize(model.sizeBytes);
198
+ if (size) parts.push(size);
199
+ return parts.join(' · ');
200
+ }
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { describe, expect, test } from 'bun:test';
7
- import { speechChunks, speakableText } from '@/shared/lib/tts/speakable';
7
+ import { speechChunks, speakableParagraphs, speakableText } from '@/shared/lib/tts/speakable';
8
8
 
9
9
  describe('speakableText', () => {
10
10
  test('drops fenced code and tables', () => {
@@ -47,7 +47,27 @@ describe('speakableText', () => {
47
47
  });
48
48
  });
49
49
 
50
+ describe('speakableParagraphs', () => {
51
+ test('a blank line separates paragraphs and code blocks vanish', () => {
52
+ expect(speakableParagraphs('First para.\n\n```ts\nconst x = 1;\n```\n\nSecond para.')).toEqual([
53
+ 'First para.',
54
+ 'Second para.',
55
+ ]);
56
+ });
57
+ });
58
+
50
59
  describe('speechChunks', () => {
60
+ test('a paragraph worth of speech ends a request', () => {
61
+ const first = 'The first paragraph says enough to be read on its own, and it keeps going for a little while longer so that a listener has time to settle into the answer.';
62
+ const second = 'The second paragraph also stands alone, with a sentence of its own that ends the thought here.';
63
+ const chunks = speechChunks(`${first}\n\n${second}`, 4000, 4000);
64
+ expect(chunks).toEqual([first, second]);
65
+ });
66
+
67
+ test('short paragraphs merge so a heading is not its own request', () => {
68
+ expect(speechChunks('## Plan\n\nDo the thing.', 4000, 4000)).toEqual(['Plan Do the thing.']);
69
+ });
70
+
51
71
  test('keeps the first request small so audio starts sooner', () => {
52
72
  const text = Array.from({ length: 20 }, (_, i) => `Sentence number ${i + 1} is here.`).join(' ');
53
73
  const chunks = speechChunks(text, 400, 120);
@@ -33,6 +33,13 @@ const PATH_RE = /(^|[\s("'`])((?:~|\.{1,2})?\/?[\w.@+-]+(?:\/[\w.@+-]+){2,}\/?)/
33
33
  const HAS_SPEAKABLE_RE = /[\p{L}\p{N}]/u;
34
34
  const SENTENCE_BOUNDARY_RE = /[.!?…]+[)\]"'»”’]*\s/g;
35
35
  const ABBREVIATION_RE = /(?:^|\s)(?:e\.g|i\.e|etc|vs|Mr|Mrs|Ms|Dr|St|No)\.$/i;
36
+ /**
37
+ * A paragraph this short never ends a request on its own: headings, one-line
38
+ * bullets and answer fragments would otherwise spend a spawn/round-trip each.
39
+ * Longer paragraphs do end one, which is what makes the read follow the
40
+ * writer's pauses.
41
+ */
42
+ const PARAGRAPH_FLOOR = 120;
36
43
 
37
44
  /** "https://github.com/foo/bar?x#y" → "github.com". */
38
45
  function speakableUrl(url: string): string {
@@ -73,14 +80,9 @@ function isSilentLine(line: string): boolean {
73
80
  return false;
74
81
  }
75
82
 
76
- /**
77
- * Strip block markup, drop tables and code, and collapse the rest into one
78
- * prose string. The newline becomes a space: a heading and the paragraph under
79
- * it are read as separate sentences by the punctuation, not by the layout.
80
- */
81
- export function speakableText(markdown: string): string {
82
- const withoutFences = markdown.replace(FENCE_RE, ' ');
83
- const lines = withoutFences.split('\n').flatMap((line) => {
83
+ /** Strip block markup from one block of lines, then normalize the prose. */
84
+ function speakableBlock(block: string): string {
85
+ const lines = block.split('\n').flatMap((line) => {
84
86
  if (isSilentLine(line)) return [];
85
87
  let text = line;
86
88
  text = text.replace(/^\s{0,3}#{1,6}\s+/, '');
@@ -92,6 +94,27 @@ export function speakableText(markdown: string): string {
92
94
  return normalizeSpeakable(lines.join(' '));
93
95
  }
94
96
 
97
+ /**
98
+ * The speakable paragraphs, in order.
99
+ *
100
+ * A blank line is the writer's own pause: a request may end there and the
101
+ * reader hears a paragraph break instead of one unbroken stream. Lines inside
102
+ * a block join with a space — a heading and the paragraph under it are separate
103
+ * sentences by punctuation, not by the layout.
104
+ */
105
+ export function speakableParagraphs(markdown: string): string[] {
106
+ return markdown
107
+ .replace(FENCE_RE, '\n\n')
108
+ .split(/\n{2,}/)
109
+ .map(speakableBlock)
110
+ .filter(Boolean);
111
+ }
112
+
113
+ /** The whole answer as one prose string (the paragraphs, joined). */
114
+ export function speakableText(markdown: string): string {
115
+ return speakableParagraphs(markdown).join(' ');
116
+ }
117
+
95
118
  /** Sentence boundaries that exist in `text`, as end offsets. */
96
119
  function sentenceEnds(text: string): number[] {
97
120
  const ends: number[] = [];
@@ -125,34 +148,41 @@ function splitLong(sentence: string, max: number): string[] {
125
148
  return pieces;
126
149
  }
127
150
 
151
+ /** The sentences of one paragraph, in order. */
152
+ function sentencesOf(paragraph: string): string[] {
153
+ const sentences: string[] = [];
154
+ let start = 0;
155
+ for (const end of sentenceEnds(paragraph)) {
156
+ const sentence = paragraph.slice(start, end).trim();
157
+ if (sentence) sentences.push(sentence);
158
+ start = end;
159
+ }
160
+ const tail = paragraph.slice(start).trim();
161
+ if (tail) sentences.push(tail);
162
+ return sentences;
163
+ }
164
+
128
165
  /**
129
166
  * The request-sized pieces of an answer, in order.
130
167
  *
131
- * `firstMax` is smaller than `maxChars` on purpose: the first request is what
132
- * decides time-to-first-audio, and a 600-character first chunk spends seconds
133
- * synthesizing before the user hears anything. Later chunks fill the engine's
134
- * budget.
168
+ * Two constraints decide a boundary. The paragraph is the writer's own pause,
169
+ * so a chunk ends there once it carries a paragraph's worth of speech: the
170
+ * player can start reading the first paragraph while the rest is still being
171
+ * synthesized, and the reader hears the break. `maxChars` is the engine's hard
172
+ * ceiling and `firstMax` is smaller on purpose — the first request decides
173
+ * time-to-first-audio, so it is the first paragraph (or its first sentences),
174
+ * not a 600-character block that spends seconds synthesizing before a sound.
135
175
  */
136
176
  export function speechChunks(
137
177
  markdown: string,
138
178
  maxChars: number,
139
- firstMax = Math.min(320, maxChars),
179
+ firstMax = Math.min(160, maxChars),
140
180
  ): string[] {
141
- const text = speakableText(markdown);
142
- if (!text) return [];
181
+ const paragraphs = speakableParagraphs(markdown);
182
+ if (paragraphs.length === 0) return [];
143
183
  const limit = Math.max(1, Math.floor(maxChars));
144
184
  const firstLimit = Math.max(1, Math.min(Math.floor(firstMax), limit));
145
185
 
146
- const sentences: string[] = [];
147
- let start = 0;
148
- for (const end of sentenceEnds(text)) {
149
- const sentence = text.slice(start, end).trim();
150
- if (sentence) sentences.push(sentence);
151
- start = end;
152
- }
153
- const tail = text.slice(start).trim();
154
- if (tail) sentences.push(tail);
155
-
156
186
  const chunks: string[] = [];
157
187
  let current = '';
158
188
  let currentLimit = firstLimit;
@@ -163,16 +193,19 @@ export function speechChunks(
163
193
  currentLimit = limit;
164
194
  };
165
195
 
166
- for (const sentence of sentences) {
167
- for (const piece of sentence.length > currentLimit ? splitLong(sentence, currentLimit) : [sentence]) {
168
- const joined = current ? `${current} ${piece}` : piece;
169
- if (joined.length > currentLimit) {
170
- flush();
171
- current = piece;
172
- } else {
173
- current = joined;
196
+ for (const paragraph of paragraphs) {
197
+ for (const sentence of sentencesOf(paragraph)) {
198
+ for (const piece of sentence.length > currentLimit ? splitLong(sentence, currentLimit) : [sentence]) {
199
+ const joined = current ? `${current} ${piece}` : piece;
200
+ if (joined.length > currentLimit) {
201
+ flush();
202
+ current = piece;
203
+ } else {
204
+ current = joined;
205
+ }
174
206
  }
175
207
  }
208
+ if (current.length >= Math.min(currentLimit, PARAGRAPH_FLOOR)) flush();
176
209
  }
177
210
  flush();
178
211
  return chunks.filter((chunk) => HAS_SPEAKABLE_RE.test(chunk));