@kabmo-labs/kabmo 0.56.0 → 0.57.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 (129) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +3 -3
  3. package/dist/client/static/js/{Body-jfy4bhk2.js → Body-p6zwk0nx.js} +1 -1
  4. package/dist/client/static/js/{CsvGrid-4c5t668z.js → CsvGrid-563qmmmr.js} +1 -1
  5. package/dist/client/static/js/{DocxView-3x7whtvq.js → DocxView-5j69q3s0.js} +1 -1
  6. package/dist/client/static/js/{DrawioView-tbkc5dfz.js → DrawioView-gd6k3hvn.js} +1 -1
  7. package/dist/client/static/js/{HtmlPreview-egxkayya.js → HtmlPreview-6gnktzzp.js} +1 -1
  8. package/dist/client/static/js/{ImageView-swhzvw2p.js → ImageView-fkfq3fwv.js} +1 -1
  9. package/dist/client/static/js/{LayoutWrapper-sangsrt5.js → LayoutWrapper-mdb1qm26.js} +1 -1
  10. package/dist/client/static/js/MergeDiffView-7kpjxcg9.js +1 -0
  11. package/dist/client/static/js/{Modal-1fj8kvme.js → Modal-0p9cr2tn.js} +12 -12
  12. package/dist/client/static/js/{PdfView-0k2egsbz.js → PdfView-n1zq27td.js} +1 -1
  13. package/dist/client/static/js/{SessionsView-t547rqeb.js → SessionsView-gptt0rq8.js} +1 -1
  14. package/dist/client/static/js/{SheetView-anb3gavm.js → SheetView-nes7j86v.js} +1 -1
  15. package/dist/client/static/js/{SvgPreview-e2wrj2hj.js → SvgPreview-vv0qzkt7.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-0rs86b68.js → abnfDiagram-O67JEVCF-02g96sn6.js} +1 -1
  17. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-0k3zzxz1.js → architectureDiagram-NJMV4G6O-7qj2fpwt.js} +1 -1
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-t1n1fx96.js → blockDiagram-BEXU5L5S-grdr1j2h.js} +3 -3
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-93b7eds9.js → c4Diagram-YGBWAQC7-7y980xpx.js} +2 -2
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-bnf85z0f.js → classDiagram-v2-NBCMYWYE-29ag4js1.js} +1 -1
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-e290161f.js → cose-bilkent-JH36ORCC-e5dvgehd.js} +1 -1
  22. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-s13ra9ag.js → cynefinDiagram-VND7K2PF-eq6fmx0b.js} +1 -1
  23. package/dist/client/static/js/{dagre-6A5THRUB-83wshh5e.js → dagre-6A5THRUB-xfhwp8ha.js} +1 -1
  24. package/dist/client/static/js/{diagram-22UHCM2B-ywh4wqna.js → diagram-22UHCM2B-1bw6x6zt.js} +1 -1
  25. package/dist/client/static/js/{diagram-3UASUU5V-cb53z698.js → diagram-3UASUU5V-076ej5n5.js} +1 -1
  26. package/dist/client/static/js/{diagram-ATOU4E4O-btf55c44.js → diagram-ATOU4E4O-cvf9fhdq.js} +1 -1
  27. package/dist/client/static/js/{diagram-CDSNMT55-p6tbbm1n.js → diagram-CDSNMT55-hn1wdx54.js} +3 -3
  28. package/dist/client/static/js/{diagram-MLGK6HIB-6kzssf4y.js → diagram-MLGK6HIB-76gk27b5.js} +1 -1
  29. package/dist/client/static/js/{diagram-MPIPVDR6-4v0yncvv.js → diagram-MPIPVDR6-0cbajhpx.js} +1 -1
  30. package/dist/client/static/js/{dockerfile-r422htmd.js → dockerfile-7atfjhnf.js} +1 -1
  31. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-mw1gh30z.js → ebnfDiagram-ZINNZB2B-n0g3b9m2.js} +1 -1
  32. package/dist/client/static/js/{elk-276RUBZZ-1pe786ap.js → elk-276RUBZZ-f6wrjcv9.js} +1 -1
  33. package/dist/client/static/js/{erDiagram-OPXOYQCR-x7rk70q6.js → erDiagram-OPXOYQCR-jz622yrg.js} +1 -1
  34. package/dist/client/static/js/flowDiagram-KWPJA3E3-5bvd5k2t.js +1 -0
  35. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-j3m5km4p.js → ganttDiagram-FUAMR5RP-2ex4nxyg.js} +2 -2
  36. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-fd1kebdy.js → gitGraphDiagram-X574FWY7-38eyay6g.js} +1 -1
  37. package/dist/client/static/js/{index-zkef5q39.js → index-1q934wfk.js} +1 -1
  38. package/dist/client/static/js/{index-5fxm2tpg.js → index-28wv94gz.js} +1 -1
  39. package/dist/client/static/js/{index-4jg10xtp.js → index-3wgjtp2k.js} +1 -1
  40. package/dist/client/static/js/{index-29b1ysz6.js → index-4cff0zg2.js} +1 -1
  41. package/dist/client/static/js/{index-8e66p2a7.js → index-55v3qv04.js} +1 -1
  42. package/dist/client/static/js/{index-s4v3vcsn.js → index-63mk2qk6.js} +1 -1
  43. package/dist/client/static/js/{index-4dzvjfkd.js → index-6z30g3ha.js} +1 -1
  44. package/dist/client/static/js/{index-473wm10a.js → index-7trfm17d.js} +1 -1
  45. package/dist/client/static/js/{index-drsy400d.js → index-8444mec5.js} +1 -1
  46. package/dist/client/static/js/{index-j1prebvy.js → index-9gfn1a3h.js} +1 -1
  47. package/dist/client/static/js/{index-qdabc51h.js → index-ays8t3t3.js} +2 -2
  48. package/dist/client/static/js/{index-q4t5j3x7.js → index-cxe75e06.js} +1 -1
  49. package/dist/client/static/js/{index-22frp78d.js → index-db7vsjkd.js} +1 -1
  50. package/dist/client/static/js/{index-7tsdw8wt.js → index-dmb1pykr.js} +1 -1
  51. package/dist/client/static/js/{index-tcp5cp53.js → index-ep99arz1.js} +1 -1
  52. package/dist/client/static/js/{index-0mhxw0a1.js → index-ewst55j2.js} +1 -1
  53. package/dist/client/static/js/{index-hgsjynb0.js → index-fqc1snjw.js} +1 -1
  54. package/dist/client/static/js/{index-rm5b3kn8.js → index-g2e0m757.js} +3 -3
  55. package/dist/client/static/js/{index-3k45gspr.js → index-jaxhfk9x.js} +1 -1
  56. package/dist/client/static/js/{index-satnfvaz.js → index-jsn2kedv.js} +1 -1
  57. package/dist/client/static/js/{index-bxhszdcz.js → index-n1xmkf2g.js} +1 -1
  58. package/dist/client/static/js/{index-004x0a3p.js → index-pe4d9wht.js} +1 -1
  59. package/dist/client/static/js/{index-cbbwq25c.js → index-pjf5wak8.js} +1 -1
  60. package/dist/client/static/js/{index-8n4qwd64.js → index-sm8gpk3g.js} +2 -2
  61. package/dist/client/static/js/{index-qrwjxqdh.js → index-st6a8q5z.js} +176 -176
  62. package/dist/client/static/js/{index-dfha2z56.js → index-stmwbavz.js} +1 -1
  63. package/dist/client/static/js/index-swaveqxg.css +1 -0
  64. package/dist/client/static/js/{index-3hrvhyym.js → index-t82q5t6m.js} +1 -1
  65. package/dist/client/static/js/{index-s6nv35dv.js → index-t9zjfxvc.js} +1 -1
  66. package/dist/client/static/js/{index-jbaceghb.js → index-tdbcp70z.js} +1 -1
  67. package/dist/client/static/js/{index-kbk0vmex.js → index-tdryzzy9.js} +1 -1
  68. package/dist/client/static/js/{index-jtyzeynv.js → index-tksrpqkh.js} +1 -1
  69. package/dist/client/static/js/{index-g84dwmvr.js → index-v38j2zxn.js} +1 -1
  70. package/dist/client/static/js/{index-4nyajpeg.js → index-x17y7xdr.js} +1 -1
  71. package/dist/client/static/js/{index-4fpyzg5e.js → index-xfnjwhan.js} +20 -20
  72. package/dist/client/static/js/{index-72v57e07.js → index-xrb4kjr3.js} +1 -1
  73. package/dist/client/static/js/{index-4acka5fn.js → index-zv8wrvha.js} +1 -1
  74. package/dist/client/static/js/{index-q178zgxp.js → index-zynbvm7x.js} +1 -1
  75. package/dist/client/static/js/{index-bnamrpm6.js → index-zzggk17b.js} +1 -1
  76. package/dist/client/static/js/{infoDiagram-VRGFBTTK-1m0br602.js → infoDiagram-VRGFBTTK-c55t0tvd.js} +2 -2
  77. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-zryzhpq6.js → ishikawaDiagram-OU5B5YK6-r9kg5kg5.js} +2 -2
  78. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-6apqr7h4.js → journeyDiagram-ZHPQQLJL-zmmst4v8.js} +2 -2
  79. package/dist/client/static/js/{kanban-definition-PNTS6WVX-am385c1e.js → kanban-definition-PNTS6WVX-3tt6sc9a.js} +1 -1
  80. package/dist/client/static/js/{mermaid.core-k937exrm.js → mermaid.core-pkrs8zp5.js} +2 -2
  81. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-hx8qq866.js → mindmap-definition-NLK3R4M7-b4c6gxg4.js} +1 -1
  82. package/dist/client/static/js/one-dark-pro-sstqnzcf.js +1 -0
  83. package/dist/client/static/js/one-light-6fpxxq2j.js +1 -0
  84. package/dist/client/static/js/{pegDiagram-GJSIUBJH-1hasj2h7.js → pegDiagram-GJSIUBJH-9jkat1mz.js} +1 -1
  85. package/dist/client/static/js/{pieDiagram-5QR66LMP-x5nwff8r.js → pieDiagram-5QR66LMP-6pbchjh7.js} +2 -2
  86. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-gmrcr5jb.js → quadrantDiagram-O4NWA36T-p9brea19.js} +2 -2
  87. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-rdznfhfb.js → railroadDiagram-XR7U4H2S-3cep8css.js} +1 -1
  88. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-v9wb3ppf.js → requirementDiagram-PLB6GJNP-x1yjgsrr.js} +1 -1
  89. package/dist/client/static/js/{rust-9cgnbbcs.js → rust-yy8gekx8.js} +1 -1
  90. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-3p4ddd2h.js → sankeyDiagram-IPEJSGJF-23wzf4aj.js} +1 -1
  91. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-wfcqxjfq.js → sequenceDiagram-PO4LG4MO-w4wr3zzr.js} +4 -4
  92. package/dist/client/static/js/{sizeCapture-INFHLROL-g02k0k8x.js → sizeCapture-INFHLROL-aabfesnr.js} +1 -1
  93. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-7k449yvg.js → stateDiagram-v2-GCMORJYK-t0n288xw.js} +1 -1
  94. package/dist/client/static/js/{swimlanes-2SLR337P-zkf2bgm8.js → swimlanes-2SLR337P-1nnm0p7h.js} +1 -1
  95. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-yex8g4fx.js → swimlanesDiagram-TC7HE7FX-cx3f29mq.js} +1 -1
  96. package/dist/client/static/js/{timeline-definition-EJHVYXUP-qsfpjr1c.js → timeline-definition-EJHVYXUP-8pyssn0q.js} +1 -1
  97. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-b2vprhsr.js → usecaseDiagram-POWQR4AR-vveepvt6.js} +1 -1
  98. package/dist/client/static/js/{vennDiagram-UO4OBE2U-x0ffeg2t.js → vennDiagram-UO4OBE2U-tqyvmqxc.js} +4 -4
  99. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-hsnhaf4f.js → wardleyDiagram-VNRHLVJA-p8rs34em.js} +2 -2
  100. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-90f9aadp.js → xychartDiagram-PMCCYNJV-pgnvxtps.js} +3 -3
  101. package/package.json +3 -3
  102. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.tsx +25 -62
  103. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.test.tsx +40 -0
  104. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +41 -2
  105. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionList.tsx +117 -0
  106. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/SwipeDeck.tsx +220 -0
  107. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +10 -8
  108. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/toggle-label.test.ts +37 -0
  109. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/toggle-label.ts +17 -1
  110. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +18 -15
  111. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +7 -8
  112. package/src/client/data/settings/omp-schema.json +59 -7
  113. package/src/client/hooks/chat/timeline/ask-frames-form.test.ts +29 -0
  114. package/src/server/lib/dictation/capability.server.test.ts +9 -6
  115. package/src/server/lib/dictation/worker-process.ts +9 -2
  116. package/src/shared/lib/chat/ask-form/data.ts +25 -6
  117. package/src/shared/lib/chat/ask-form/deck.ts +80 -0
  118. package/src/shared/lib/chat/ask-form/fields.ts +26 -1
  119. package/src/shared/lib/chat/ask-form/index.ts +18 -310
  120. package/src/shared/lib/chat/ask-form/types.ts +14 -2
  121. package/src/shared/lib/chat/ask-form/walker.ts +350 -0
  122. package/src/shared/lib/chat/ask-form.test.ts +41 -0
  123. package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +47 -0
  124. package/src/shared/lib/omp/config/schema-releases.test.ts +4 -2
  125. package/dist/client/static/js/MergeDiffView-bv00y63x.js +0 -1
  126. package/dist/client/static/js/flowDiagram-KWPJA3E3-kfwaac44.js +0 -1
  127. package/dist/client/static/js/index-gedsa0z7.css +0 -1
  128. package/dist/client/static/js/one-dark-pro-phxqe9mx.js +0 -1
  129. package/dist/client/static/js/one-light-vhwh499y.js +0 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "@oh-my-pi/pi-coding-agent 10 tabs / 659 settings",
2
+ "source": "@oh-my-pi/pi-coding-agent 10 tabs / 662 settings",
3
3
  "tabs": [
4
4
  {
5
5
  "id": "appearance",
@@ -280,6 +280,16 @@
280
280
  "description": "Show a live generation tok/s readout: on the working row next to the session title, or in the native composer bar right after the thinking level, where the last reading stays between turns. Estimated from streamed deltas and corrected by the provider's billed output count as each message completes."
281
281
  }
282
282
  },
283
+ "composer.providerIcon": {
284
+ "type": "boolean",
285
+ "default": false,
286
+ "ui": {
287
+ "tab": "appearance",
288
+ "group": "Composer",
289
+ "label": "Provider Icon",
290
+ "description": "In the native composer bar, lead the model name with the provider's icon: the one set in the /model hub (`providerIcons` in models.yml), else Tern's logo for it."
291
+ }
292
+ },
283
293
  "statusLine.preset": {
284
294
  "type": "enum",
285
295
  "default": "default",
@@ -659,6 +669,16 @@
659
669
  "description": "Render Mermaid fenced code blocks as ASCII diagrams"
660
670
  }
661
671
  },
672
+ "tui.codeFrame": {
673
+ "type": "boolean",
674
+ "default": false,
675
+ "ui": {
676
+ "tab": "appearance",
677
+ "group": "Display",
678
+ "label": "Frame Code Blocks",
679
+ "description": "Draw code blocks between a dashed hairline carrying the language and a bare one, instead of literal ``` rows (indented blocks included). Selecting the code rows copies the same text; selecting the whole block copies the hairlines, not ``` fences. Plain terminal only; the native view ignores it."
680
+ }
681
+ },
662
682
  "tui.renderSvg": {
663
683
  "type": "boolean",
664
684
  "default": true,
@@ -7084,6 +7104,38 @@
7084
7104
  ]
7085
7105
  }
7086
7106
  },
7107
+ "act.enabled": {
7108
+ "type": "enum",
7109
+ "default": "auto",
7110
+ "values": [
7111
+ "auto",
7112
+ "on",
7113
+ "off"
7114
+ ],
7115
+ "ui": {
7116
+ "tab": "tools",
7117
+ "group": "Available Tools",
7118
+ "label": "Act (judge-picked clicks)",
7119
+ "description": "Enable tab.act/tab.expect in browser use and win.act/win.expect in computer use: the judge model role picks the element an intent names, or checks the screen. Auto enables them when the first usable judge is native",
7120
+ "options": [
7121
+ {
7122
+ "value": "auto",
7123
+ "label": "Auto",
7124
+ "description": "Enable when the first usable judge is native"
7125
+ },
7126
+ {
7127
+ "value": "on",
7128
+ "label": "On",
7129
+ "description": "Always enable, whichever model the judge role resolves to"
7130
+ },
7131
+ {
7132
+ "value": "off",
7133
+ "label": "Off",
7134
+ "description": "Disable the act helpers"
7135
+ }
7136
+ ]
7137
+ }
7138
+ },
7087
7139
  "find.timeoutMs": {
7088
7140
  "type": "number",
7089
7141
  "default": 20000,
@@ -7379,7 +7431,7 @@
7379
7431
  "tab": "tools",
7380
7432
  "group": "GitHub",
7381
7433
  "label": "GitHub View Cache",
7382
- "description": "Cache rendered issue/PR view output in ~/.omp/cache/github-cache.db so repeated reads are free"
7434
+ "description": "Cache forge overviews and diffs in ~/.omp/cache/github-cache.db"
7383
7435
  }
7384
7436
  },
7385
7437
  "github.cache.softTtlSec": {
@@ -7389,7 +7441,7 @@
7389
7441
  "tab": "tools",
7390
7442
  "group": "GitHub",
7391
7443
  "label": "GitHub Cache Soft TTL",
7392
- "description": "Within this window, cached issue/PR view rows are returned directly (seconds; default 5 minutes)"
7444
+ "description": "Revalidate cached forge overviews after this many seconds; diffs check revisions on every live read"
7393
7445
  }
7394
7446
  },
7395
7447
  "github.cache.hardTtlSec": {
@@ -7399,7 +7451,7 @@
7399
7451
  "tab": "tools",
7400
7452
  "group": "GitHub",
7401
7453
  "label": "GitHub Cache Hard TTL",
7402
- "description": "Past the soft TTL the cached row is returned and refreshed in the background; past the hard TTL it is dropped (seconds; default 7 days)"
7454
+ "description": "Maximum age of cached forge rows and retained diff snapshots (seconds; default 7 days)"
7403
7455
  }
7404
7456
  },
7405
7457
  "web_search.enabled": {
@@ -7796,7 +7848,7 @@
7796
7848
  "tab": "shell",
7797
7849
  "group": "Bash",
7798
7850
  "label": "Reap Background Processes",
7799
- "description": "Remind the agent about processes its bash calls left running (`cmd &`, `nohup`) when it stops, and kill the `&` ones at session end unless registered as services; off in RPC mode"
7851
+ "description": "Remind the agent about processes its bash calls left running (`cmd &`, `nohup`) when it stops, and kill the `&` ones at session end unless registered as services; off in non-interactive runs (print, RPC, ACP)"
7800
7852
  }
7801
7853
  },
7802
7854
  "bash.gitGuard": {
@@ -8476,7 +8528,7 @@
8476
8528
  },
8477
8529
  "task.maxRecursionDepth": {
8478
8530
  "type": "number",
8479
- "default": 2,
8531
+ "default": 1,
8480
8532
  "ui": {
8481
8533
  "tab": "tasks",
8482
8534
  "group": "Subagents",
@@ -9046,7 +9098,7 @@
9046
9098
  "tab": "tools",
9047
9099
  "group": "Grep & Browser",
9048
9100
  "label": "Freeze Browser Tabs On Turn End",
9049
- "description": "Freeze OMP-owned headless Chromium tabs when a turn settles so animated pages stop burning CPU/GPU while idle (WebKit tabs draw nothing unless asked). Tabs unfreeze automatically on next use; pass persist:true on open to opt a tab out."
9101
+ "description": "Freeze OMP-owned headless Chromium tabs when a turn settles so animated pages stop burning CPU/GPU while idle. WebKit tabs are not frozen: their pages keep animating until closed or reaped by browser.idleCloseSec. Tabs unfreeze automatically on next use; pass persist:true on open to opt a tab out."
9050
9102
  }
9051
9103
  },
9052
9104
  "browser.idleCloseSec": {
@@ -169,6 +169,35 @@ describe('buildFormData', () => {
169
169
  });
170
170
  });
171
171
 
172
+ describe('buildFormData for swipe cards', () => {
173
+ const questions = parseAskForm(
174
+ '<form><booldeck><card name="a">First?</card><card name="b">Second?</card></booldeck></form>',
175
+ );
176
+
177
+ test('yes submits true, no submits false, skip is omitted', () => {
178
+ // omp's `parseFormDialogResponse` rejects a card value that is not a
179
+ // boolean and reads an absent entry as skipped.
180
+ const built = buildFormData(questions, {
181
+ 0: { selected: ['Yes'], text: '' },
182
+ 1: { selected: ['No'], text: '' },
183
+ });
184
+ expect(built).toEqual({ data: { a: true, b: false } });
185
+ });
186
+
187
+ test('a skipped card alone submits nothing', () => {
188
+ const built = buildFormData(questions, { 0: { selected: ['Skip'], text: '' } });
189
+ expect(built).toEqual({ missing: 'Answer at least one question.' });
190
+ });
191
+
192
+ test('a relabelled side still submits by its verdict value', () => {
193
+ const relabelled = parseAskForm(
194
+ '<form><booldeck yes="Fix" no="Ignore"><card name="x">Leak?</card></booldeck></form>',
195
+ );
196
+ const built = buildFormData(relabelled, { 0: { selected: ['Fix'], text: '' } });
197
+ expect(built).toEqual({ data: { x: true } });
198
+ });
199
+ });
200
+
172
201
  describe('AskQuestion required flag', () => {
173
202
  test('is absent on a form whose controls are all optional', () => {
174
203
  const questions: AskQuestion[] = parseAskForm('<form><label>Note <input name="note"></label></form>');
@@ -33,12 +33,14 @@ import {
33
33
  * A worker that exits before answering anything — the 19.1.1 failure mode with
34
34
  * the 18.x transport. Constant source (the fixture cache is keyed by it); the
35
35
  * run counter arrives through the environment.
36
+ *
37
+ * APPEND one mark per run, never read-modify-write: a mark is a single write
38
+ * syscall, while a rewrite would truncate first, and a child killed inside that
39
+ * window (measured on Windows) left an empty file that read back as 0 spawns.
36
40
  */
37
- const STUB_SOURCE = `const counter = process.env.FAKE_STT_SPAWN_FILE;
38
- if (counter) {
39
- const previous = await Bun.file(counter).text().catch(() => '0');
40
- await Bun.write(counter, String(Number(previous || '0') + 1));
41
- }
41
+ const STUB_SOURCE = `import { appendFileSync } from 'node:fs';
42
+ const counter = process.env.FAKE_STT_SPAWN_FILE;
43
+ if (counter) appendFileSync(counter, 'x');
42
44
  process.exit(0);
43
45
  `;
44
46
 
@@ -47,9 +49,10 @@ const originalCounter = Bun.env.FAKE_STT_SPAWN_FILE;
47
49
  let dir = '';
48
50
  let counter = '';
49
51
 
52
+ /** One mark per spawn the stub has recorded. */
50
53
  function spawns(): number {
51
54
  try {
52
- return Number(fs.readFileSync(counter, 'utf8').trim()) || 0;
55
+ return fs.readFileSync(counter, 'utf8').length;
53
56
  } catch {
54
57
  return 0;
55
58
  }
@@ -102,10 +102,17 @@ export function startSttWorkerProcess(bin: string, handlers: SttWorkerHandlers):
102
102
  return {
103
103
  send: (frame) => {
104
104
  try {
105
- child.stdin.write(encodeSpeechFrame(frame));
106
105
  // Buffered writes stay ordered; the flush is what puts the frame on the
107
106
  // wire before a decode that can take a second.
108
- void child.stdin.flush();
107
+ //
108
+ // Both type as `number`, but a failed write/flush is reported as a
109
+ // REJECTED PROMISE rather than a throw. On Windows the write that races
110
+ // the child's pipe setup comes back EPIPE that way, and the unhandled
111
+ // rejection took down the `Gates / Checks (Windows)` job even though the
112
+ // probe reported the failure correctly. A closed pipe is the exit
113
+ // handler's news, not an error here.
114
+ void Promise.resolve(child.stdin.write(encodeSpeechFrame(frame))).catch(() => {});
115
+ void Promise.resolve(child.stdin.flush()).catch(() => {});
109
116
  } catch {
110
117
  // Closed pipe: the exit handler is what reports it.
111
118
  }
@@ -45,8 +45,12 @@ export interface FormPick {
45
45
  export interface FormAnswer {
46
46
  /** The control name (`AskQuestion.id`). */
47
47
  name: string;
48
- /** `string` for a single choice or text field, `string[]` for a group. */
49
- value: string | string[];
48
+ /**
49
+ * `string` for a single choice or text field, `string[]` for a group,
50
+ * `boolean` for a swipe card (`<booldeck>`, omp 19.4.0): yes is `true`,
51
+ * no is `false`, skip is absent (`undefined`) so `buildFormData` omits it.
52
+ */
53
+ value: string | string[] | boolean | undefined;
50
54
  }
51
55
 
52
56
  /** Whether a question takes an array (checkbox group or multi-select). */
@@ -71,12 +75,22 @@ function optionFor(question: AskQuestion, label: string): { value: string; disab
71
75
  * compares against those, never the visible label — and a disabled option is
72
76
  * dropped rather than sent (omp refuses the whole frame for it).
73
77
  */
74
- export function answerForQuestion(question: AskQuestion, pick: FormPick | undefined): string | string[] | undefined {
78
+ export function answerForQuestion(question: AskQuestion, pick: FormPick | undefined): string | string[] | boolean | undefined {
75
79
  const selected = pick?.selected ?? [];
76
80
  const text = pick?.text.trim() ?? '';
77
81
 
78
82
  if (question.kind === 'text') return text ? text : undefined;
79
83
 
84
+ if (question.kind === 'card') {
85
+ // A swipe card's verdict rides as the picked option's VALUE (the fixed
86
+ // words `yes`/`no`/`skip`, never the labels — the user may have
87
+ // relabelled them). Skip means unanswered: omp omits it.
88
+ const verdict = selected[0] ? optionFor(question, selected[0])?.value : undefined;
89
+ if (verdict === 'yes') return true;
90
+ if (verdict === 'no') return false;
91
+ return undefined;
92
+ }
93
+
80
94
  const values: string[] = [];
81
95
  for (const label of selected) {
82
96
  const option = optionFor(question, label);
@@ -103,8 +117,11 @@ export function answerForQuestion(question: AskQuestion, pick: FormPick | undefi
103
117
  * user leaves partly empty still submits what it holds.
104
118
  */
105
119
  export function formAnswers(questions: AskQuestion[], picks: Record<number, FormPick>): FormAnswer[] {
120
+ // A skipped swipe card is unanswered and must be omitted — omp reads an
121
+ // absent entry as "skipped" — never sent as "" or [].
106
122
  return questions.map((question, index) => {
107
123
  const value = answerForQuestion(question, picks[index]);
124
+ if (question.kind === 'card' && value === undefined) return { name: question.id ?? '', value: undefined };
108
125
  return {
109
126
  name: question.id ?? '',
110
127
  value: value ?? (isArrayQuestion(question) ? [] : ''),
@@ -112,6 +129,7 @@ export function formAnswers(questions: AskQuestion[], picks: Record<number, Form
112
129
  });
113
130
  }
114
131
 
132
+
115
133
  /** The `data` object to send, or the reason it cannot be sent.
116
134
  *
117
135
  * At least one entry is mandatory: omp throws on an empty object ("at least
@@ -121,12 +139,13 @@ export function formAnswers(questions: AskQuestion[], picks: Record<number, Form
121
139
  export function buildFormData(
122
140
  questions: AskQuestion[],
123
141
  picks: Record<number, FormPick>,
124
- ): { data: Record<string, string | string[]> } | { missing: string } {
125
- const data: Record<string, string | string[]> = {};
142
+ ): { data: Record<string, string | string[] | boolean> } | { missing: string } {
143
+ const data: Record<string, string | string[] | boolean> = {};
126
144
  for (const answer of formAnswers(questions, picks)) {
127
145
  if (!answer.name) continue;
128
146
  const value = answer.value;
129
- if (typeof value === 'string' ? value.trim() === '' : value.length === 0) continue;
147
+ if (value === undefined) continue;
148
+ if (typeof value === 'string' ? value.trim() === '' : typeof value !== 'boolean' && value.length === 0) continue;
130
149
  data[answer.name] = value;
131
150
  }
132
151
  if (Object.keys(data).length === 0) return { missing: 'Answer at least one question.' };
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * `<booldeck>` deck collection for the `ask` form parser (`walker.ts`): each
8
+ * nested `<card name="…">` becomes a `card` field whose verdict submits as a
9
+ * boolean. Split out of the walker at the 350-line ceiling.
10
+ */
11
+
12
+ import type { DraftField } from '@/shared/lib/chat/ask-form/fields';
13
+ import type { WalkContext } from '@/shared/lib/chat/ask-form/walker';
14
+ import { flush } from '@/shared/lib/chat/ask-form/walker';
15
+ import { BLOCK, HEADING, matchingClose, oneLine, textOf } from '@/shared/lib/chat/ask-form/tokens';
16
+
17
+ /** A card carries its question in the caption it was collected with. */
18
+ export function addCardField(ctx: WalkContext, field: DraftField): void {
19
+ ctx.fields.push(field);
20
+ }
21
+
22
+ function sideLabel(attrs: Record<string, string>, name: 'yes' | 'no'): string | undefined {
23
+ const label = oneLine(attrs[name] ?? '');
24
+ return label ? label : undefined;
25
+ }
26
+
27
+ /**
28
+ * One `<booldeck>` deck (omp 19.4.0): each nested `<card name="…">` becomes a
29
+ * `card` field. The side labels resolve per-card over the deck's over
30
+ * `Yes`/`No`. The card's question is its first text block (omp's
31
+ * `cardQuestion`); later blocks are context, not the question.
32
+ */
33
+ export function addDeck(ctx: WalkContext, deckAttrs: Record<string, string>, start: number, close: number): void {
34
+ const deckYes = sideLabel(deckAttrs, 'yes');
35
+ const deckNo = sideLabel(deckAttrs, 'no');
36
+ for (let index = start; index <= close; index += 1) {
37
+ const token = ctx.tokens[index];
38
+ if (token.kind !== 'open' || token.tag !== 'card' || token.selfClosing) continue;
39
+ const cardClose = Math.min(matchingClose(ctx.tokens, index, 'card'), close);
40
+ // The surrounding caption must not leak into the card.
41
+ const outerCaption = ctx.caption;
42
+ ctx.caption = '';
43
+ flush(ctx);
44
+ let cardCaption = '';
45
+ for (let at = index + 1; at <= cardClose; at += 1) {
46
+ const inner = ctx.tokens[at];
47
+ const innerTag = inner.kind === 'open' ? inner.tag : '';
48
+ if (innerTag !== '' && !innerTag.startsWith('/') && (BLOCK[innerTag] || HEADING[innerTag])) {
49
+ const blockClose = Math.min(matchingClose(ctx.tokens, at, innerTag), cardClose);
50
+ const text = oneLine(textOf(ctx.tokens, at + 1, blockClose));
51
+ if (text) {
52
+ cardCaption = text;
53
+ break;
54
+ }
55
+ }
56
+ if (inner.kind === 'text' && oneLine(inner.text)) {
57
+ cardCaption = oneLine(inner.text);
58
+ break;
59
+ }
60
+ }
61
+ ctx.inline = '';
62
+ ctx.caption = outerCaption;
63
+ addCardField(ctx, {
64
+ name: token.attrs.name ?? '',
65
+ kind: 'card',
66
+ multi: false,
67
+ select: false,
68
+ label: '',
69
+ options: [],
70
+ value: '',
71
+ multiline: false,
72
+ caption: cardCaption,
73
+ section: ctx.section,
74
+ required: false,
75
+ yes: sideLabel(token.attrs, 'yes') ?? deckYes ?? 'Yes',
76
+ no: sideLabel(token.attrs, 'no') ?? deckNo ?? 'No',
77
+ });
78
+ index = cardClose;
79
+ }
80
+ }
@@ -30,7 +30,7 @@ export interface DraftOption {
30
30
 
31
31
  export interface DraftField {
32
32
  name: string;
33
- kind: 'choice' | 'text';
33
+ kind: 'choice' | 'text' | 'card';
34
34
  multi: boolean;
35
35
  select: boolean;
36
36
  label: string;
@@ -44,6 +44,10 @@ export interface DraftField {
44
44
  /** The control carries `required`. Since omp 19.2.0 it is a hint: the form
45
45
  * handler flags the empty control but still submits, so it never blocks. */
46
46
  required: boolean;
47
+ /** Card only: the side labels, each already resolved per-card over the
48
+ * deck's — what swiping right and left mean. */
49
+ yes?: string;
50
+ no?: string;
47
51
  }
48
52
 
49
53
  /** Named fields, in document order, as the questions the card renders. */
@@ -51,6 +55,27 @@ export function toQuestions(fields: DraftField[]): AskQuestion[] {
51
55
  const questions: AskQuestion[] = [];
52
56
  for (const field of fields) {
53
57
  if (!field.name) continue;
58
+ if (field.kind === 'card') {
59
+ // omp's card deck: the question is the card's first text block (here its
60
+ // caption — the walker hands text blocks to `caption` — else its name),
61
+ // and the three verdict rows ride as options, yes/no/skip in order, so
62
+ // the existing `OptionRow` picks and the same Submit carry them. The
63
+ // verdict values are the fixed words omp submits as booleans for, never
64
+ // the labels, which the user may have relabelled.
65
+ const question = oneLine(field.label) || field.caption || field.section || field.name;
66
+ questions.push({
67
+ id: field.name,
68
+ question,
69
+ options: [
70
+ { label: field.yes ?? 'Yes', value: 'yes' },
71
+ { label: field.no ?? 'No', value: 'no' },
72
+ { label: 'Skip', value: 'skip' },
73
+ ],
74
+ multi: false,
75
+ kind: 'card',
76
+ });
77
+ continue;
78
+ }
54
79
  const lone = field.kind === 'choice' && field.options.length === 1 ? oneLine(field.options[0].label) : '';
55
80
  const question = oneLine(field.label) || field.caption || field.section || lone || field.name;
56
81
  const options: AskOption[] = field.options.map((option) => ({