@kabmo-labs/kabmo 0.37.0 → 0.38.1

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 (261) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +551 -531
  3. package/dist/client/static/js/{CsvGrid-xb429wvb.js → CsvGrid-t1n057vw.js} +1 -1
  4. package/dist/client/static/js/{DocxView-g58e0bs7.js → DocxView-c9g6teks.js} +2 -2
  5. package/dist/client/static/js/{DrawioView-1j66avvy.js → DrawioView-gd14j54m.js} +1 -1
  6. package/dist/client/static/js/{ImageView-kraqkypn.js → ImageView-57f1ecdp.js} +1 -1
  7. package/dist/client/static/js/{LayoutWrapper-85dhbn62.js → LayoutWrapper-x7srbpz1.js} +2 -2
  8. package/dist/client/static/js/{Modal-f0nfya07.js → Modal-0bn3f77b.js} +15 -15
  9. package/dist/client/static/js/{PdfView-nddkrky9.js → PdfView-cybz0xbj.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-a595m6g1.js → SessionsView-gx5q68tp.js} +1 -1
  11. package/dist/client/static/js/{SheetView-s2p4sk6b.js → SheetView-1kk5y326.js} +1 -1
  12. package/dist/client/static/js/{SvgPreview-ppdx4yb9.js → SvgPreview-mp4tk37p.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-5cjzxcaq.js → abnfDiagram-O67JEVCF-78qb3can.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-r8sz34h3.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-62mygavm.js → architectureDiagram-NJMV4G6O-n0fr4hb6.js} +2 -2
  16. package/dist/client/static/js/{astro-80bs6hvg.js → astro-p3f5p9p2.js} +1 -1
  17. package/dist/client/static/js/{blockDiagram-BEXU5L5S-s5yz9hcd.js → blockDiagram-BEXU5L5S-2xemfrzh.js} +6 -6
  18. package/dist/client/static/js/c-jkdstn33.js +1 -0
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-rf9xkmrm.js → c4Diagram-YGBWAQC7-zxfdx3eb.js} +2 -2
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-zfm2cj2a.js → classDiagram-v2-NBCMYWYE-z9sasy3k.js} +5 -5
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-fmgpv55e.js → cose-bilkent-JH36ORCC-9byp0czh.js} +1 -1
  22. package/dist/client/static/js/cpp-9d3xdpe3.js +1 -0
  23. package/dist/client/static/js/css-r3wja1ze.js +1 -0
  24. package/dist/client/static/js/css-sebxkh5f.js +1 -0
  25. package/dist/client/static/js/cynefin-OW5HDTMX-w2f2vev7.js +1 -0
  26. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-468r5xc2.js → cynefinDiagram-VND7K2PF-gnm129fx.js} +1 -1
  27. package/dist/client/static/js/{dagre-6A5THRUB-w370qmgj.js → dagre-6A5THRUB-sc5tfv1w.js} +2 -2
  28. package/dist/client/static/js/{diagram-22UHCM2B-sfvfjjsy.js → diagram-22UHCM2B-hq11eek7.js} +7 -7
  29. package/dist/client/static/js/{diagram-3UASUU5V-3r2c8s14.js → diagram-3UASUU5V-7bk532gd.js} +2 -2
  30. package/dist/client/static/js/{diagram-ATOU4E4O-yathy97a.js → diagram-ATOU4E4O-yt8wxttm.js} +2 -2
  31. package/dist/client/static/js/{diagram-CDSNMT55-kk437kxq.js → diagram-CDSNMT55-n3978w6p.js} +1 -1
  32. package/dist/client/static/js/{diagram-MLGK6HIB-qdxfjjhf.js → diagram-MLGK6HIB-004x4gyw.js} +1 -1
  33. package/dist/client/static/js/{diagram-MPIPVDR6-dfqeqa1d.js → diagram-MPIPVDR6-498nt489.js} +1 -1
  34. package/dist/client/static/js/{dockerfile-yxrt509r.js → dockerfile-6hbcmkc8.js} +1 -1
  35. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-s0b0vv4k.js → ebnfDiagram-ZINNZB2B-5fkmymqn.js} +1 -1
  36. package/dist/client/static/js/{elixir-rpa1g4gy.js → elixir-jwphgp8j.js} +1 -1
  37. package/dist/client/static/js/{elk-276RUBZZ-mtpw0spa.js → elk-276RUBZZ-6xrfa2kd.js} +1 -1
  38. package/dist/client/static/js/{erDiagram-OPXOYQCR-agjdsm1b.js → erDiagram-OPXOYQCR-byz4zbkn.js} +4 -4
  39. package/dist/client/static/js/eventmodeling-NTZA5JFV-k5n61zzh.js +1 -0
  40. package/dist/client/static/js/flowDiagram-KWPJA3E3-s3fbfwrz.js +1 -0
  41. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-z6ywqqc1.js → ganttDiagram-FUAMR5RP-4fkw1k01.js} +2 -2
  42. package/dist/client/static/js/gitGraph-4MIJSDKK-2gf053bx.js +1 -0
  43. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-bvbmfw6h.js → gitGraphDiagram-X574FWY7-19g84yw8.js} +2 -2
  44. package/dist/client/static/js/graphql-p4cskvad.js +1 -0
  45. package/dist/client/static/js/html-f26r6vv5.js +1 -0
  46. package/dist/client/static/js/{index-z0frtyje.js → index-0v8b5pzb.js} +4 -4
  47. package/dist/client/static/js/{index-z7qnffwj.js → index-1j1s91c4.js} +1 -1
  48. package/dist/client/static/js/{index-jpkj6vqp.js → index-20vhkcb9.js} +1 -1
  49. package/dist/client/static/js/{index-0j518hqm.js → index-3az1w5f8.js} +2 -2
  50. package/dist/client/static/js/{index-qznwd6g8.js → index-3wpsr2bc.js} +184 -184
  51. package/dist/client/static/js/{index-09gx6edj.js → index-3y6krykq.js} +1 -1
  52. package/dist/client/static/js/{index-we1rpftn.js → index-4jbbdq6n.js} +2 -2
  53. package/dist/client/static/js/{index-ntxm8pw3.js → index-4qt2e84b.js} +2 -2
  54. package/dist/client/static/js/{index-49dhv8ry.js → index-57z8mtmx.js} +2 -2
  55. package/dist/client/static/js/{index-qz8mbxm9.js → index-5gn56236.js} +2 -2
  56. package/dist/client/static/js/{index-9t82sx0w.js → index-6k3e5dph.js} +2 -2
  57. package/dist/client/static/js/{index-es3pt29g.js → index-74scnfpk.js} +1 -1
  58. package/dist/client/static/js/{index-0mvcbbmy.js → index-7kafzae0.js} +9 -9
  59. package/dist/client/static/js/{index-pd0140dx.js → index-89a2702q.js} +1 -1
  60. package/dist/client/static/js/{index-059qyaj0.js → index-8j90mdgz.js} +1 -1
  61. package/dist/client/static/js/{index-zvfvqvn9.js → index-9wd9y6m0.js} +2 -2
  62. package/dist/client/static/js/{index-a0bdavdr.js → index-ashpbfqv.js} +1 -1
  63. package/dist/client/static/js/{index-72t6kqjx.js → index-b9b2nwdd.js} +2 -2
  64. package/dist/client/static/js/{index-8e0s9p45.js → index-baet2nv8.js} +1 -1
  65. package/dist/client/static/js/{index-j7r414hf.js → index-bhng2dax.js} +2 -2
  66. package/dist/client/static/js/{index-21b3zyrd.js → index-cj9193d5.js} +2 -2
  67. package/dist/client/static/js/{index-sezz011q.js → index-dd4q54y0.js} +1 -1
  68. package/dist/client/static/js/{index-xearvz2z.js → index-e3w46vsc.js} +7 -7
  69. package/dist/client/static/js/{index-1tyvk778.js → index-e99ec2f0.js} +1 -1
  70. package/dist/client/static/js/{index-w9zxmev3.js → index-ehnztdd2.js} +1 -1
  71. package/dist/client/static/js/{index-actppd4z.js → index-epbqzayj.js} +2 -2
  72. package/dist/client/static/js/{index-k06med7d.js → index-fghst0kd.js} +12 -12
  73. package/dist/client/static/js/{index-t07b31ny.js → index-fpf1jkwd.js} +3 -3
  74. package/dist/client/static/js/{index-hbtk0c12.js → index-g252205p.js} +2 -2
  75. package/dist/client/static/js/{index-vtbbfwx0.js → index-gr6jng0x.js} +2 -2
  76. package/dist/client/static/js/{index-kzhtmrh0.js → index-gxtgyya0.js} +1 -1
  77. package/dist/client/static/js/index-j314me09.js +1 -0
  78. package/dist/client/static/js/{index-5fn0agag.js → index-jbwns6sc.js} +1 -1
  79. package/dist/client/static/js/{index-cx89yk15.js → index-kdgcbt17.js} +2 -2
  80. package/dist/client/static/js/{index-m87yykre.js → index-m4bjsyj2.js} +5 -5
  81. package/dist/client/static/js/{index-15zn3sns.js → index-nd4p98mc.js} +1 -1
  82. package/dist/client/static/js/{index-nmc30xaz.js → index-pfwd0160.js} +1 -1
  83. package/dist/client/static/js/{index-w7xbfv44.js → index-qn4pkjfh.js} +2 -2
  84. package/dist/client/static/js/{index-0sqa91wb.js → index-qntytvt0.js} +2 -2
  85. package/dist/client/static/js/{index-64mb65wx.js → index-r83kr4s5.js} +2 -2
  86. package/dist/client/static/js/{index-7sa2e8mn.js → index-rgdhyry3.js} +2 -2
  87. package/dist/client/static/js/{index-m3j5yx5f.js → index-sjnnv1gd.js} +4 -4
  88. package/dist/client/static/js/{index-6q80csr0.js → index-t5t71dhp.js} +2 -2
  89. package/dist/client/static/js/{index-z6g74h7g.js → index-vb6t44dw.js} +2 -2
  90. package/dist/client/static/js/{index-a293pdg7.js → index-y3hdv561.js} +2 -2
  91. package/dist/client/static/js/{index-302d35e5.js → index-zj45wj1x.js} +34 -34
  92. package/dist/client/static/js/{index-83ts8zmk.js → index-zw7qjx65.js} +1 -1
  93. package/dist/client/static/js/info-A6RAGUB7-3tr0y3s6.js +1 -0
  94. package/dist/client/static/js/{infoDiagram-VRGFBTTK-58bv28d4.js → infoDiagram-VRGFBTTK-aw6ter0a.js} +1 -1
  95. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-tz6b0caw.js → ishikawaDiagram-OU5B5YK6-62gst5wh.js} +2 -2
  96. package/dist/client/static/js/javascript-nyf39d5r.js +1 -0
  97. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-ydamm17a.js → journeyDiagram-ZHPQQLJL-6kgv5a4j.js} +3 -3
  98. package/dist/client/static/js/{julia-v7j460gw.js → julia-237yk557.js} +1 -1
  99. package/dist/client/static/js/{kanban-definition-PNTS6WVX-7jxfsf17.js → kanban-definition-PNTS6WVX-8p3515b7.js} +3 -3
  100. package/dist/client/static/js/lua-86fjqj8v.js +1 -0
  101. package/dist/client/static/js/{mermaid.core-vty0aq6f.js → mermaid.core-b6ga2y8y.js} +6 -6
  102. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-ra4wrts4.js → mindmap-definition-NLK3R4M7-na9e9b4a.js} +2 -2
  103. package/dist/client/static/js/one-dark-pro-xp6ssk4z.js +1 -0
  104. package/dist/client/static/js/one-light-xgab7b02.js +1 -0
  105. package/dist/client/static/js/packet-AYTQ26CC-xbsyjzrh.js +1 -0
  106. package/dist/client/static/js/{pegDiagram-GJSIUBJH-ydjcfea9.js → pegDiagram-GJSIUBJH-d1hk7fnq.js} +1 -1
  107. package/dist/client/static/js/{perl-gg4jdkcr.js → perl-dvz4y1tb.js} +1 -1
  108. package/dist/client/static/js/{php-2q8fm6k8.js → php-n6y7dzhm.js} +1 -1
  109. package/dist/client/static/js/pie-WAS4IAKB-j2tpz0cs.js +1 -0
  110. package/dist/client/static/js/{pieDiagram-5QR66LMP-wh04y7wp.js → pieDiagram-5QR66LMP-7b9f4x0y.js} +2 -2
  111. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-4mhbag8n.js → quadrantDiagram-O4NWA36T-q4wxgmhg.js} +1 -1
  112. package/dist/client/static/js/radar-RG4KPBEZ-m3tsyfv0.js +1 -0
  113. package/dist/client/static/js/railroad-74A4TZTK-5p202a4q.js +1 -0
  114. package/dist/client/static/js/railroad-abnf-HS5TGJTU-hj0y9tgn.js +1 -0
  115. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-8c5dct8f.js +1 -0
  116. package/dist/client/static/js/railroad-peg-WCYAUIDC-3tx8z65q.js +1 -0
  117. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-pagmr4hc.js → railroadDiagram-XR7U4H2S-jngq1qx4.js} +1 -1
  118. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-jhfhp4eq.js → requirementDiagram-PLB6GJNP-6xph3b72.js} +4 -4
  119. package/dist/client/static/js/{ruby-vag6a82m.js → ruby-7zye3g0e.js} +1 -1
  120. package/dist/client/static/js/{rust-yntkm6hw.js → rust-w6hen2h4.js} +1 -1
  121. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-qrfxzvp3.js → sankeyDiagram-IPEJSGJF-ncfzgdj8.js} +1 -1
  122. package/dist/client/static/js/{sass-kbwea482.js → sass-m0h9yzfb.js} +1 -1
  123. package/dist/client/static/js/{scss-zphrqp25.js → scss-2pwwfkvn.js} +1 -1
  124. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-fpznwnva.js → sequenceDiagram-PO4LG4MO-sqz0yfg0.js} +3 -3
  125. package/dist/client/static/js/{sizeCapture-INFHLROL-3hz930jg.js → sizeCapture-INFHLROL-vt8qp04d.js} +1 -1
  126. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-2m99syxm.js → stateDiagram-v2-GCMORJYK-myjtrmfe.js} +3 -3
  127. package/dist/client/static/js/{svelte-mwtx07d9.js → svelte-x8f8c8hq.js} +1 -1
  128. package/dist/client/static/js/{swimlanes-2SLR337P-hmhd360r.js → swimlanes-2SLR337P-z9vx7z4j.js} +1 -1
  129. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-a8b7z74e.js → swimlanesDiagram-TC7HE7FX-5vha7thx.js} +1 -1
  130. package/dist/client/static/js/{timeline-definition-EJHVYXUP-765y3ssa.js → timeline-definition-EJHVYXUP-z815np57.js} +2 -2
  131. package/dist/client/static/js/treeView-Q6P3EWNA-mf0rb2yv.js +1 -0
  132. package/dist/client/static/js/treemap-WGGIJYW6-0x5gf06b.js +1 -0
  133. package/dist/client/static/js/typescript-5nmrzgkj.js +1 -0
  134. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-rex2j507.js → usecaseDiagram-POWQR4AR-06ntggng.js} +13 -13
  135. package/dist/client/static/js/{vennDiagram-UO4OBE2U-wd51qq26.js → vennDiagram-UO4OBE2U-nmtaf5rp.js} +1 -1
  136. package/dist/client/static/js/{vue-j8vb9d7r.js → vue-myjjd0gd.js} +1 -1
  137. package/dist/client/static/js/wardley-WFR3VGLG-x7ej8dms.js +1 -0
  138. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-6jdqn8f7.js → wardleyDiagram-VNRHLVJA-zgsxmak8.js} +1 -1
  139. package/dist/client/static/js/xml-3dd1pter.js +1 -0
  140. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-kcz8y04e.js → xychartDiagram-PMCCYNJV-8bg9qdra.js} +2 -2
  141. package/package.json +1 -1
  142. package/src/client/components/common/ComposerPicker.tsx +24 -12
  143. package/src/client/components/common/ComposerTextarea.tsx +1 -0
  144. package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +1 -1
  145. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +1 -1
  146. package/src/client/components/workspace/chat-timeline/index.tsx +3 -3
  147. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.test.tsx +210 -0
  148. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.tsx +342 -0
  149. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/LooseFieldAsk.tsx +44 -0
  150. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.test.tsx +44 -1
  151. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +10 -5
  152. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions.test.ts +1 -0
  153. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts.ts +19 -0
  154. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/form-picks.ts +52 -0
  155. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts +2 -2
  156. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +53 -4
  157. package/src/client/components/workspace/model-dropdown/index.tsx +1 -1
  158. package/src/client/components/workspace/model-dropdown/use-catalog.ts +3 -32
  159. package/src/client/data/settings/omp-schema.json +55 -1
  160. package/src/client/hooks/chat/composer/harness-model-picker.ts +84 -0
  161. package/src/client/hooks/chat/composer/index.ts +26 -6
  162. package/src/client/hooks/chat/timeline/ask-frames.test.ts +80 -7
  163. package/src/client/hooks/chat/timeline/ask-frames.ts +95 -21
  164. package/src/client/hooks/models/use-harnesses.ts +15 -2
  165. package/src/server/lib/auth/agent-gate.server.ts +64 -0
  166. package/src/server/lib/auth/agent-tree-gate.test.ts +121 -0
  167. package/src/server/lib/auth/guard.test.ts +18 -18
  168. package/src/server/lib/auth/guard.ts +15 -11
  169. package/src/server/lib/auth/handover-guard.test.ts +1 -1
  170. package/src/server/lib/changes/attach.server.ts +57 -0
  171. package/src/server/lib/changes/attach.test.ts +94 -0
  172. package/src/server/lib/changes/blobs.server.ts +52 -0
  173. package/src/server/lib/changes/capture-bash.server.ts +171 -0
  174. package/src/server/lib/changes/capture-fs.server.ts +64 -0
  175. package/src/server/lib/changes/capture-races.test.ts +107 -0
  176. package/src/server/lib/changes/capture-runs.test.ts +136 -0
  177. package/src/server/lib/changes/capture-scan.test.ts +157 -0
  178. package/src/server/lib/changes/capture-test-util.ts +46 -0
  179. package/src/server/lib/changes/capture-types.ts +64 -0
  180. package/src/server/lib/changes/capture-write.server.ts +50 -0
  181. package/src/server/lib/changes/capture.server.ts +349 -0
  182. package/src/server/lib/changes/capture.test.ts +293 -0
  183. package/src/server/lib/changes/classify-command.test.ts +172 -0
  184. package/src/server/lib/changes/classify-command.ts +272 -0
  185. package/src/server/lib/changes/classify-git.ts +88 -0
  186. package/src/server/lib/changes/classify-paths.ts +112 -0
  187. package/src/server/lib/changes/classify-tokenize.ts +185 -0
  188. package/src/server/lib/changes/journal.server.ts +185 -0
  189. package/src/server/lib/changes/journal.test.ts +125 -0
  190. package/src/server/lib/changes/merge.test.ts +137 -0
  191. package/src/server/lib/changes/omp-fallback.server.ts +48 -0
  192. package/src/server/lib/changes/omp-fallback.test.ts +75 -0
  193. package/src/server/lib/changes/paths.server.ts +37 -0
  194. package/src/server/lib/changes/purge.server.ts +32 -0
  195. package/src/server/lib/changes/reader.server.ts +350 -0
  196. package/src/server/lib/changes/reader.test.ts +137 -0
  197. package/src/server/lib/changes/records.ts +120 -0
  198. package/src/server/lib/changes/scan.server.ts +139 -0
  199. package/src/server/lib/changes/sessions.server.ts +65 -0
  200. package/src/server/lib/changes/sessions.test.ts +52 -0
  201. package/src/server/lib/harness/register.server.ts +3 -0
  202. package/src/server/lib/omp/rpc/event-fanout.test.ts +58 -0
  203. package/src/server/lib/omp/rpc/event-fanout.ts +19 -0
  204. package/src/server/lib/omp/rpc/manager.ts +4 -3
  205. package/src/server/lib/omp/rpc/session-registration.ts +5 -0
  206. package/src/server/lib/omp/rpc/session-registry.ts +4 -5
  207. package/src/server/lib/omp/session/delete.server.ts +4 -0
  208. package/src/server/lib/sessions/agent-token.server.test.ts +28 -5
  209. package/src/server/lib/sessions/agent-token.server.ts +42 -6
  210. package/src/server/lib/sessions/relation-access.server.test.ts +96 -0
  211. package/src/server/lib/sessions/relation-access.server.ts +71 -0
  212. package/src/server/routes/sessions/changes.ts +1 -1
  213. package/src/shared/lib/chat/ask-form/fields.ts +1 -0
  214. package/src/shared/lib/chat/ask-form/types.ts +6 -0
  215. package/src/shared/lib/chat/ask-questions.ts +56 -3
  216. package/src/shared/lib/chat/composer/delegation.ts +2 -13
  217. package/src/shared/lib/chat/composer/filter.test.ts +39 -0
  218. package/src/shared/lib/chat/composer/filter.ts +23 -13
  219. package/src/shared/lib/chat/composer/harness-model-items.test.ts +54 -0
  220. package/src/shared/lib/chat/composer/harness-model-items.ts +41 -0
  221. package/src/shared/lib/chat/composer/trigger.test.ts +50 -0
  222. package/src/shared/lib/chat/composer/trigger.ts +29 -1
  223. package/src/shared/lib/chat/timeline/changed-files.test.ts +16 -0
  224. package/src/shared/lib/chat/timeline/changed-files.ts +102 -25
  225. package/src/shared/lib/harness/catalog.ts +21 -0
  226. package/src/{client/components/workspace/model-dropdown/harness-models.test.ts → shared/lib/harness/models.test.ts} +1 -1
  227. package/src/shared/lib/models/option.ts +46 -0
  228. package/src/shared/lib/omp/config/schema.test.ts +20 -0
  229. package/src/shared/types/chat.ts +12 -6
  230. package/src/shared/types/omp/agent.ts +9 -0
  231. package/src/shared/types/session-changes.ts +4 -0
  232. package/dist/client/static/js/architecture-7GRP2DOG-7ewrw5vc.js +0 -1
  233. package/dist/client/static/js/c-wkgxb1t1.js +0 -1
  234. package/dist/client/static/js/cpp-y0t6mynx.js +0 -1
  235. package/dist/client/static/js/css-r2nhvzff.js +0 -1
  236. package/dist/client/static/js/css-tf1s0nb7.js +0 -1
  237. package/dist/client/static/js/cynefin-OW5HDTMX-yyyx3px0.js +0 -1
  238. package/dist/client/static/js/eventmodeling-NTZA5JFV-cx3ztxfz.js +0 -1
  239. package/dist/client/static/js/flowDiagram-KWPJA3E3-267mw6sv.js +0 -1
  240. package/dist/client/static/js/gitGraph-4MIJSDKK-eg9r85ak.js +0 -1
  241. package/dist/client/static/js/graphql-skw5krjr.js +0 -1
  242. package/dist/client/static/js/html-pv88ny12.js +0 -1
  243. package/dist/client/static/js/index-tcegdd2t.js +0 -1
  244. package/dist/client/static/js/info-A6RAGUB7-7qhah7fs.js +0 -1
  245. package/dist/client/static/js/javascript-4kw2j9t3.js +0 -1
  246. package/dist/client/static/js/lua-ke895s2q.js +0 -1
  247. package/dist/client/static/js/one-dark-pro-2pywnqrh.js +0 -1
  248. package/dist/client/static/js/one-light-vfgdt4wf.js +0 -1
  249. package/dist/client/static/js/packet-AYTQ26CC-ag2g7tbk.js +0 -1
  250. package/dist/client/static/js/pie-WAS4IAKB-nqcyj3x1.js +0 -1
  251. package/dist/client/static/js/radar-RG4KPBEZ-60gby7be.js +0 -1
  252. package/dist/client/static/js/railroad-74A4TZTK-cnkmcjse.js +0 -1
  253. package/dist/client/static/js/railroad-abnf-HS5TGJTU-qgfdnazd.js +0 -1
  254. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-609h6cpx.js +0 -1
  255. package/dist/client/static/js/railroad-peg-WCYAUIDC-xqnytjhg.js +0 -1
  256. package/dist/client/static/js/treeView-Q6P3EWNA-8djqab8k.js +0 -1
  257. package/dist/client/static/js/treemap-WGGIJYW6-hdztnffk.js +0 -1
  258. package/dist/client/static/js/typescript-0s2t05jj.js +0 -1
  259. package/dist/client/static/js/wardley-WFR3VGLG-avby77vv.js +0 -1
  260. package/dist/client/static/js/xml-81hxjjt4.js +0 -1
  261. /package/src/{client/components/workspace/model-dropdown/harness-models.ts → shared/lib/harness/models.ts} +0 -0
@@ -27,11 +27,14 @@ import { HelpCircle, XCircle } from 'lucide-preact';
27
27
  import type { ToolCallData } from '@/shared/types';
28
28
  import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
29
29
  import { isAskSettled, parseAskQuestions } from '@/shared/lib/chat/ask-questions';
30
+ import type { AskQuestion } from '@/shared/lib/chat/ask-form/types';
30
31
  import { parseAskResult } from '@/shared/lib/chat/ask-results';
31
32
  import { useAskFrames } from '@/client/hooks/chat/timeline/ask-frames';
32
33
  import { liveFrame, useAskDrafts } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts';
33
34
  import { QuestionBlock } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock';
34
35
  import { GroupedAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk';
36
+ import { FormAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk';
37
+ import { LooseFieldAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/LooseFieldAsk';
35
38
  import { PluginPendingInteractions } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions';
36
39
  import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
37
40
  import { FallbackOutput } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput';
@@ -40,6 +43,7 @@ import { FallbackOutput } from '@/client/components/workspace/chat-timeline/tool
40
43
  const NO_FRAMES: ExtensionUiDialogRequest[] = [];
41
44
  const NO_GROUPS: ExtensionUiDialogRequest[][] = [];
42
45
  const NO_LABELS: string[] = [];
46
+ const NO_QUESTIONS: AskQuestion[] = [];
43
47
 
44
48
  /**
45
49
  * A grouped ask this client answered, waiting for omp to echo it in the result.
@@ -56,13 +60,20 @@ interface SubmittedAsk {
56
60
  export function AskPanel({ tool }: { tool: ToolCallData }) {
57
61
  const questions = parseAskQuestions(tool);
58
62
  const recorded = parseAskResult(tool, questions);
59
- const { framesByTool, respond } = useAskFrames();
63
+ const { framesByTool, looseByTool, respond } = useAskFrames();
60
64
  const groups = framesByTool.get(tool.id) ?? NO_GROUPS;
65
+ const loose = looseByTool.get(tool.id) ?? NO_FRAMES;
66
+ const settled = isAskSettled(tool);
67
+ // Two or more open fields are answered by ONE Submit (`FormAsk`). The
68
+ // per-question draft bookkeeper must not run in that mode: it auto-sends a
69
+ // restored draft the moment its frame arrives, which would answer question 1
70
+ // before the user could reach the form's Submit.
71
+ const groupedForm = !settled && questions.length > 1 && recorded.some((answer) => answer === null);
61
72
  const [submitted, setSubmitted] = useState<SubmittedAsk | null>(null);
62
73
  const { drafts, multiSelected, commit, toggleMulti } = useAskDrafts({
63
74
  toolId: tool.id,
64
- questions,
65
- groups,
75
+ questions: groupedForm ? NO_QUESTIONS : questions,
76
+ groups: groupedForm ? NO_GROUPS : groups,
66
77
  recorded,
67
78
  respond,
68
79
  });
@@ -82,7 +93,6 @@ export function AskPanel({ tool }: { tool: ToolCallData }) {
82
93
  // mid-ask reads its still-blocking tool call back from the JSONL as
83
94
  // `success` (omp writes no result until the question is answered), and that
84
95
  // question must stay answerable.
85
- const settled = isAskSettled(tool);
86
96
  const waiting = !settled && groups.some((frames, index) => frames.length > 0 && !recorded[index]);
87
97
  // omp asks in order and blocks on each, so the earliest question holding a
88
98
  // dialog is the only open one: everything before it is answered, whether or
@@ -138,6 +148,41 @@ export function AskPanel({ tool }: { tool: ToolCallData }) {
138
148
  );
139
149
  }
140
150
 
151
+ // Two or more fields from the per-field walk: draw the WHOLE form and take a
152
+ // single Submit. The old card answered one question per round trip, so the
153
+ // second question appeared only after the first had gone to omp — and a
154
+ // field whose derived title drifted was handed to the modal. The submit here
155
+ // is what `FormAsk` replays into omp's one-dialog-per-field wire.
156
+ if (groupedForm) {
157
+ const live = groups.map((frames) => (frames.length > 0 ? frames[frames.length - 1] : null)).find(Boolean) ?? loose[0] ?? null;
158
+ return (
159
+ <div className="space-y-2">
160
+ {waiting && (
161
+ <div className="flex items-center gap-1.5 text-[10.5px] text-ink/50">
162
+ <HelpCircle size={11} className="shrink-0" />
163
+ <span>Input needed: the agent is blocked until you answer.</span>
164
+ </div>
165
+ )}
166
+ <FormAsk
167
+ questions={questions}
168
+ groups={groups}
169
+ recorded={recorded}
170
+ loose={loose}
171
+ onRespond={respond}
172
+ interactions={
173
+ live ? (
174
+ <PluginPendingInteractions
175
+ frame={live}
176
+ recorded={questions.map((_, index) => recorded[index] !== null)}
177
+ onRespond={(response) => respond(live, response)}
178
+ />
179
+ ) : undefined
180
+ }
181
+ />
182
+ </div>
183
+ );
184
+ }
185
+
141
186
  return (
142
187
  <div className="space-y-2">
143
188
  {waiting && (
@@ -183,6 +228,10 @@ export function AskPanel({ tool }: { tool: ToolCallData }) {
183
228
  );
184
229
  })}
185
230
 
231
+ {loose.map((frame) => (
232
+ <LooseFieldAsk key={frame.id} frame={frame} onRespond={respond} />
233
+ ))}
234
+
186
235
  {(tool.status === 'error' || tool.status === 'aborted') && tool.output && (
187
236
  <div className="flex items-start gap-2 rounded-md border border-ink/8 bg-ink/[0.02] px-2.5 py-1.5 text-[10.5px] text-ink/60">
188
237
  <XCircle size={11} className="mt-0.5 shrink-0 text-ink/40" />
@@ -10,7 +10,7 @@ import { useCollapsedSections } from '@/client/components/workspace/model-dropdo
10
10
  import { useHarnesses } from '@/client/hooks/models/use-harnesses';
11
11
  import { harnessCategoryId } from '@/shared/lib/harness/menu';
12
12
  import { useFullscreenPicker } from '@/client/components/workspace/model-dropdown/fullscreen-picker';
13
- import { harnessModels, pickerHarnesses } from '@/client/components/workspace/model-dropdown/harness-models';
13
+ import { harnessModels, pickerHarnesses } from '@/shared/lib/harness/models';
14
14
  import { useRowMutations } from '@/client/components/workspace/model-dropdown/row-mutations';
15
15
  import { HarnessGlyph, HARNESS_GLYPH_SIZE } from '@/client/components/common/harness-glyph';
16
16
  import { buildPickerGroups, type PickerRow } from '@/client/components/workspace/model-dropdown/groups';
@@ -1,42 +1,13 @@
1
1
  import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
2
- import type { AIModelOption, ModelEntry, ModelPreferences } from '@/shared/types';
2
+ import type { AIModelOption, ModelPreferences } from '@/shared/types';
3
3
  import { fetchModelsData, subscribeModelsUpdated } from '@/shared/lib/models/client';
4
+ import { modelEntryOption } from '@/shared/lib/models/option';
4
5
  import {
5
6
  EMPTY_MODEL_PREFERENCES,
6
7
  applyModelPreferences,
7
8
  readModelPreferences,
8
9
  } from '@/shared/lib/models/preferences';
9
10
 
10
- function toOption(m: ModelEntry): AIModelOption {
11
- const ladder = Array.isArray(m.thinkingLevels) ? m.thinkingLevels : [];
12
- const cost = m.cost;
13
- return {
14
- id: m.id,
15
- name: m.name || m.id,
16
- // A row without a provider still has to render. `/api/models` is read from
17
- // omp's registry, and a partial entry (a custom provider whose `provider`
18
- // field never landed) used to crash the whole picker — `buildPickerGroups`
19
- // upper-cased `undefined` and the composer's model pill took the chat input
20
- // down with it. `unknown` keeps the row visible and gives it a stable
21
- // section instead of dropping a model the user may have selected.
22
- provider: m.provider || 'unknown',
23
- // The provider's fetched web icon, when the server has one. Carried through
24
- // so the picker's section header and the selected model's mark can draw the
25
- // site's own logo instead of the initials of a provider nobody has drawn.
26
- ...(m.providerIconUrl ? { providerIconUrl: m.providerIconUrl } : {}),
27
- contextWindow: m.contextWindow,
28
- thinkingLevel: ladder[0] ?? 'off',
29
- thinkingLevels: ladder,
30
- capabilities: ladder.length > 1 ? ['Tool calling', 'Reasoning'] : ['Tool calling'],
31
- cost: cost ? {
32
- input: cost.input !== undefined ? `$${cost.input}` : '—',
33
- output: cost.output !== undefined ? `$${cost.output}` : '—',
34
- cacheRead: cost.cacheRead !== undefined ? `$${cost.cacheRead}` : undefined,
35
- cacheWrite: cost.cacheWrite !== undefined ? `$${cost.cacheWrite}` : undefined,
36
- } : undefined,
37
- };
38
- }
39
-
40
11
  export interface ModelCatalogState {
41
12
  models: AIModelOption[];
42
13
  isLoading: boolean;
@@ -98,7 +69,7 @@ export function useModelCatalog(externalSelectedModel?: AIModelOption): ModelCat
98
69
  // empty state over a transient failure.
99
70
  if (Array.isArray(data.modelList) && !data.modelError) {
100
71
  const prefs = readModelPreferences(data.modelPreferences);
101
- const realModels = applyModelPreferences(data.modelList.map(toOption), prefs);
72
+ const realModels = applyModelPreferences(data.modelList.map(modelEntryOption), prefs);
102
73
  setPreferences(prefs);
103
74
  // Keep a thinking level the user already picked, but only when it is
104
75
  // still a real level of this model's ladder (legacy mock values like
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "@oh-my-pi/pi-coding-agent 10 tabs / 622 settings",
2
+ "source": "@oh-my-pi/pi-coding-agent 10 tabs / 625 settings",
3
3
  "tabs": [
4
4
  {
5
5
  "id": "appearance",
@@ -5230,6 +5230,39 @@
5230
5230
  "condition": "mnemopiActive"
5231
5231
  }
5232
5232
  },
5233
+ "mnemopi.recallRelevance": {
5234
+ "type": "enum",
5235
+ "default": "off",
5236
+ "values": [
5237
+ "auto",
5238
+ "on",
5239
+ "off"
5240
+ ],
5241
+ "ui": {
5242
+ "tab": "memory",
5243
+ "group": "Mnemopi",
5244
+ "label": "Mnemopi Recall Relevance",
5245
+ "description": "Ask the judge model role whether each automatically recalled memory is relevant to the task before injecting it",
5246
+ "options": [
5247
+ {
5248
+ "value": "auto",
5249
+ "label": "Auto",
5250
+ "description": "Filter only with a native judge backend; otherwise inject every recalled memory"
5251
+ },
5252
+ {
5253
+ "value": "on",
5254
+ "label": "On",
5255
+ "description": "Filter with whichever model the judge role resolves to; an on-device judge may answer only some memories in time"
5256
+ },
5257
+ {
5258
+ "value": "off",
5259
+ "label": "Off",
5260
+ "description": "Never filter; inject every recalled memory"
5261
+ }
5262
+ ],
5263
+ "condition": "mnemopiActive"
5264
+ }
5265
+ },
5233
5266
  "mnemopi.autoRetain": {
5234
5267
  "type": "boolean",
5235
5268
  "default": true,
@@ -5315,6 +5348,27 @@
5315
5348
  "condition": "mnemopiActive"
5316
5349
  }
5317
5350
  },
5351
+ "mnemopi.embeddingQueryPrefix": {
5352
+ "type": "string",
5353
+ "ui": {
5354
+ "tab": "memory",
5355
+ "group": "Mnemopi",
5356
+ "label": "Mnemopi Embedding Query Prefix",
5357
+ "description": "Text prepended to recall queries before embedding, for instruction-tuned embedders (Qwen3-Embedding, E5); stored memories are embedded unchanged",
5358
+ "condition": "mnemopiActive"
5359
+ }
5360
+ },
5361
+ "mnemopi.embeddingInputType": {
5362
+ "type": "boolean",
5363
+ "default": false,
5364
+ "ui": {
5365
+ "tab": "memory",
5366
+ "group": "Mnemopi",
5367
+ "label": "Mnemopi Embedding Input Type",
5368
+ "description": "Send input_type (query for recall, passage for stored memories) with embedding API requests; NVIDIA NIM asymmetric embedders require it",
5369
+ "condition": "mnemopiActive"
5370
+ }
5371
+ },
5318
5372
  "mnemopi.llmMode": {
5319
5373
  "type": "enum",
5320
5374
  "default": "smol",
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The model list behind `@harness:<id>:` in the composer.
8
+ *
9
+ * It is the SAME catalogue the model dropdown's tab shows for that harness
10
+ * (`harnessModels`): omp's `/api/models` registry for `omp-rpc`, the live
11
+ * session's published selectors first and the probe second for an ACP agent.
12
+ * A second rule here would offer a model the agent refuses at spawn, which is
13
+ * exactly what the dropdown was built to prevent.
14
+ */
15
+
16
+ import { useEffect, useMemo, useState } from 'preact/hooks';
17
+ import type { AIModelOption, ComposerPickItem } from '@/shared/types';
18
+ import { useHarnesses } from '@/client/hooks/models/use-harnesses';
19
+ import { fetchModelsData, subscribeModelsUpdated } from '@/shared/lib/models/client';
20
+ import { modelEntryOption } from '@/shared/lib/models/option';
21
+ import { harnessModels, type HarnessModelList } from '@/shared/lib/harness/models';
22
+ import { harnessModelPickItems } from '@/shared/lib/chat/composer/harness-model-items';
23
+
24
+ export interface HarnessModelPickerState {
25
+ items: ComposerPickItem[];
26
+ loading: boolean;
27
+ /** Why the list is empty, when the harness (or its probe) has an answer. */
28
+ emptyText: string | null;
29
+ }
30
+
31
+ const UNPROBED = 'This harness has not reported its models yet.';
32
+
33
+ function emptyTextFor(list: HarnessModelList): string | null {
34
+ if (list.models.length > 0) return null;
35
+ if (list.blocked) return list.blocked;
36
+ if (list.unprobed) return UNPROBED;
37
+ return null;
38
+ }
39
+
40
+ /**
41
+ * `harness` is null whenever the popup is not completing a model, so an idle
42
+ * composer costs no `/api/models` read and no harness-catalog subscription.
43
+ */
44
+ export function useHarnessModelPicker(harness: string | null): HarnessModelPickerState {
45
+ const { harnesses, liveModels, isLoading } = useHarnesses({ enabled: harness !== null });
46
+ const [ompModels, setOmpModels] = useState<AIModelOption[]>([]);
47
+ const [ompLoading, setOmpLoading] = useState(false);
48
+
49
+ useEffect(() => {
50
+ if (harness !== 'omp-rpc') return;
51
+ let active = true;
52
+ setOmpLoading(true);
53
+ const load = async () => {
54
+ try {
55
+ const data = await fetchModelsData();
56
+ if (!active || !Array.isArray(data.modelList)) return;
57
+ setOmpModels(data.modelList.map(modelEntryOption));
58
+ } catch {
59
+ // The empty state is the honest answer: a failed read must not leave
60
+ // rows the registry no longer serves.
61
+ } finally {
62
+ if (active) setOmpLoading(false);
63
+ }
64
+ };
65
+ void load();
66
+ const off = subscribeModelsUpdated(() => {
67
+ void load();
68
+ });
69
+ return () => {
70
+ active = false;
71
+ off();
72
+ };
73
+ }, [harness]);
74
+
75
+ return useMemo(() => {
76
+ if (!harness) return { items: [], loading: false, emptyText: null };
77
+ const list = harnessModels(harnesses, harness, ompModels, liveModels[harness]);
78
+ return {
79
+ items: harnessModelPickItems(list.models, harness),
80
+ loading: list.models.length === 0 && (harness === 'omp-rpc' ? ompLoading : isLoading),
81
+ emptyText: emptyTextFor(list),
82
+ };
83
+ }, [harness, harnesses, ompModels, liveModels, ompLoading, isLoading]);
84
+ }
@@ -5,6 +5,7 @@ import type { ComposerMatchItem, ComposerPickItem, ComposerTrigger } from '@/sha
5
5
  import { detectComposerTrigger, insertToken, sendInsteadOfAccept, tokenForItem } from '@/shared/lib/chat/composer/trigger';
6
6
  import { filterComposerItems } from '@/shared/lib/chat/composer/filter';
7
7
  import { useComposerItems } from '@/client/hooks/chat/composer/items';
8
+ import { useHarnessModelPicker } from '@/client/hooks/chat/composer/harness-model-picker';
8
9
 
9
10
  export interface UseComposerTriggerOptions {
10
11
  value: string;
@@ -35,6 +36,8 @@ export interface ComposerTriggerController {
35
36
  matches: ComposerMatchItem[];
36
37
  loading: boolean;
37
38
  error: string | null;
39
+ /** Why a model-scoped mention has no rows, when the harness said why. */
40
+ emptyText: string | null;
38
41
  activeIndex: number;
39
42
  setActiveIndex: (index: number) => void;
40
43
  handleChange: (e: ChangeEvent<HTMLTextAreaElement>) => void;
@@ -77,11 +80,21 @@ export function useComposerTrigger(options: UseComposerTriggerOptions): Composer
77
80
  const pendingCaretRef = useRef<number | null>(null);
78
81
 
79
82
  const includeAgents = !harness || harness === 'omp-rpc' || harness === 'omp-acp';
80
- const { items, loading, error } = useComposerItems(trigger?.kind ?? null, rootPath ?? null, sessionId ?? null, includeAgents);
83
+ const modelPhase = trigger?.kind === 'mention' && trigger.phase === 'model';
84
+ const modelHarness = modelPhase ? trigger.harness ?? null : null;
85
+ const modelPicker = useHarnessModelPicker(modelHarness);
86
+ // A model completion must not also fire the mention loader: its rows are the
87
+ // harness's catalogue, not agents and files.
88
+ const { items, loading, error } = useComposerItems(
89
+ modelPhase ? null : trigger?.kind ?? null,
90
+ rootPath ?? null,
91
+ sessionId ?? null,
92
+ includeAgents,
93
+ );
81
94
 
82
95
  const matches = useMemo(
83
- () => (trigger ? filterComposerItems(items, trigger) : []),
84
- [items, trigger],
96
+ () => (trigger ? filterComposerItems(modelPhase ? modelPicker.items : items, trigger) : []),
97
+ [items, modelPicker.items, modelPhase, trigger],
85
98
  );
86
99
 
87
100
  const clampedIndex = matches.length > 0
@@ -140,6 +153,12 @@ export function useComposerTrigger(options: UseComposerTriggerOptions): Composer
140
153
  const next = insertToken(value, trigger, tokenForItem(item));
141
154
  pendingCaretRef.current = next.caret;
142
155
  setValue(next.value);
156
+ // A model pick COMPLETES the mention. Re-querying would match the model
157
+ // it just inserted and leave the popup covering the task that follows.
158
+ if (trigger.phase === 'model') {
159
+ close();
160
+ return;
161
+ }
143
162
  // Re-query instead of closing: oh-my-pi reopens on the accepted text, so
144
163
  // `/fast` → `/fast ` immediately offers its subcommands and the collapsed
145
164
  // `/skill:` row expands into the individual skills. `shouldOpen` keeps a
@@ -147,7 +166,7 @@ export function useComposerTrigger(options: UseComposerTriggerOptions): Composer
147
166
  setTrigger(detectComposerTrigger(next.value, next.caret));
148
167
  setActiveIndexState(0);
149
168
  },
150
- [value, trigger, setValue],
169
+ [value, trigger, setValue, close],
151
170
  );
152
171
 
153
172
  const handleKeyDown = useCallback(
@@ -206,8 +225,9 @@ export function useComposerTrigger(options: UseComposerTriggerOptions): Composer
206
225
  trigger,
207
226
  isOpen: open,
208
227
  matches,
209
- loading,
210
- error,
228
+ loading: modelPhase ? modelPicker.loading : loading,
229
+ error: modelPhase ? null : error,
230
+ emptyText: modelPhase ? modelPicker.emptyText : null,
211
231
  activeIndex: clampedIndex,
212
232
  setActiveIndex,
213
233
  handleChange,
@@ -74,7 +74,7 @@ describe('splitAskFrames', () => {
74
74
  const gate = confirmFrame('g1', 'Run bash?');
75
75
 
76
76
  // The regression: the frame has been replayed, its tool call has not.
77
- expect(splitAskFrames([], [question], false)).toEqual({ framesByTool: new Map(), orphanAsks: [], modalRequest: null });
77
+ expect(splitAskFrames([], [question], false)).toEqual({ framesByTool: new Map(), looseByTool: new Map(), orphanAsks: [], modalRequest: null });
78
78
  // The hold is uniform — a gate cannot be told from an ask before history
79
79
  // either, and it is re-decided the moment the history settles.
80
80
  expect(splitAskFrames([], [gate], false).modalRequest).toBeNull();
@@ -127,7 +127,7 @@ describe('splitAskFrames', () => {
127
127
  expect(split.framesByTool.get('call_ask')?.[0]?.map((held) => held.id)).toEqual(['f1']);
128
128
  });
129
129
 
130
- test('an already answered ask cannot claim a later dialog', () => {
130
+ test('a frame naming an answered ask is drawn inline, never as a modal', () => {
131
131
  const [answered] = askHistory(['Which language?']);
132
132
  answered.toolCalls![0].details = { selectedOptions: ['Python'] };
133
133
 
@@ -135,12 +135,16 @@ describe('splitAskFrames', () => {
135
135
  const split = splitAskFrames([answered], [frame], true);
136
136
 
137
137
  expect(split.framesByTool.get('call_ask')).toBeUndefined();
138
- expect(split.modalRequest).toBe(frame);
138
+ // The ask worked; its dialog is a stray ask dialog, and the modal has no
139
+ // ask body. It belongs on the timeline where its call lives.
140
+ expect(split.orphanAsks).toEqual([frame]);
141
+ expect(split.modalRequest).toBeNull();
139
142
  });
140
143
 
141
- test('a retry whose questions never parsed falls back to the modal', () => {
142
- // The safety net the module note describes: no card can claim the frame,
143
- // so it stays answerable instead of vanishing.
144
+ test('a frame matching a failed ask stays inline even when another call is truncated', () => {
145
+ // The safety net the module note describes: no card can render it, so it
146
+ // stays answerable on the timeline instead of becoming a modal the ask
147
+ // body cannot fill.
144
148
  const [dead] = askHistory(['Which language?']);
145
149
  dead.toolCalls![0].id = 'call_dead';
146
150
  dead.toolCalls![0].status = 'error';
@@ -155,7 +159,8 @@ describe('splitAskFrames', () => {
155
159
  const split = splitAskFrames([dead, truncated], [frame], true);
156
160
 
157
161
  expect(split.framesByTool.size).toBe(0);
158
- expect(split.modalRequest).toBe(frame);
162
+ expect(split.orphanAsks).toEqual([frame]);
163
+ expect(split.modalRequest).toBeNull();
159
164
  });
160
165
 
161
166
  test('an approval gate is not claimed by an open question\'s card', () => {
@@ -182,6 +187,74 @@ describe('splitAskFrames', () => {
182
187
  expect(split.modalRequest).toBe(gate);
183
188
  });
184
189
 
190
+ test('a context-prefixed title is claimed by suffix, not sent to the modal', () => {
191
+ // omp titles a per-field dialog with the text between the previous control
192
+ // and this one, then the question. A context block made the title match
193
+ // nothing, so the SECOND question of a two-question form opened as a modal.
194
+ const [history] = askHistory(['Which language?', 'Normalise the text?']);
195
+ history.toolCalls![0].input = {
196
+ questions: [
197
+ { id: 'lang', question: 'Which language?', options: [{ label: 'Python' }, { label: 'Go' }] },
198
+ { id: 'norm', question: 'Normalise the text?', multi: true, options: [{ label: 'Fix typos' }] },
199
+ ],
200
+ };
201
+ const second: ExtensionUiDialogRequest = {
202
+ type: 'extension_ui_request',
203
+ id: 'f2',
204
+ method: 'select',
205
+ title: 'Every entry will be written as pending.\n\nNormalise the text?',
206
+ options: ['Fix typos', 'Done selecting'],
207
+ selectionMarker: 'checkbox',
208
+ };
209
+
210
+ const split = splitAskFrames([history], [second], true);
211
+
212
+ expect(split.framesByTool.get('call_ask')?.[1]?.map((held) => held.id)).toEqual(['f2']);
213
+ expect(split.modalRequest).toBeNull();
214
+ });
215
+
216
+ test('a one-row question is claimed by its single option', () => {
217
+ const [history] = askHistory(['Normalise the text?']);
218
+ history.toolCalls![0].input = {
219
+ questions: [{ id: 'norm', question: 'Normalise the text?', multi: true, options: [{ label: 'Fix typos' }] }],
220
+ };
221
+ const frame: ExtensionUiDialogRequest = {
222
+ type: 'extension_ui_request',
223
+ id: 'f1',
224
+ method: 'select',
225
+ title: 'This build derived a different question',
226
+ options: ['Fix typos', 'Done selecting'],
227
+ selectionMarker: 'checkbox',
228
+ };
229
+
230
+ const split = splitAskFrames([history], [frame], true);
231
+
232
+ expect(split.framesByTool.get('call_ask')?.[0]?.map((held) => held.id)).toEqual(['f1']);
233
+ expect(split.modalRequest).toBeNull();
234
+ });
235
+
236
+ test('a drifted field dialog is drawn on the card as a loose control', () => {
237
+ // The last resort between "the title names the question" and "open a
238
+ // modal": the only open ask owns a field dialog that still shares a content
239
+ // word with one of its questions. It is answerable on the card even when no
240
+ // single question can be named.
241
+ const [history] = askHistory(['Which language?']);
242
+ history.toolCalls![0].input = {
243
+ questions: [{ id: 'lang', question: 'Which language?', kind: 'text', options: [] }],
244
+ };
245
+ const frame: ExtensionUiDialogRequest = {
246
+ type: 'extension_ui_request',
247
+ id: 'f1',
248
+ method: 'input',
249
+ title: 'Tell me: which concrete language, please',
250
+ };
251
+
252
+ const split = splitAskFrames([history], [frame], true);
253
+
254
+ expect(split.looseByTool.get('call_ask')?.map((held) => held.id)).toEqual(['f1']);
255
+ expect(split.modalRequest).toBeNull();
256
+ });
257
+
185
258
  test('a select whose title matches no question is claimed by its option rows', () => {
186
259
  // The parser-drift safety net: the two derivations of a form's question text
187
260
  // can disagree on a shape neither was written for, and the title is the only