@kabmo-labs/kabmo 0.55.0 → 0.57.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 (151) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +466 -466
  3. package/dist/client/static/js/{Body-a4dwe3hh.js → Body-k96gtstv.js} +1 -1
  4. package/dist/client/static/js/{CsvGrid-ppj80brw.js → CsvGrid-t84xmbk9.js} +1 -1
  5. package/dist/client/static/js/{DocxView-ef0bd2pg.js → DocxView-4jda3szm.js} +1 -1
  6. package/dist/client/static/js/{DrawioView-44tpkzbd.js → DrawioView-9qvvtnvt.js} +1 -1
  7. package/dist/client/static/js/{HtmlPreview-w654aykz.js → HtmlPreview-4pba1ys5.js} +1 -1
  8. package/dist/client/static/js/{ImageView-kg0skt5s.js → ImageView-0gf5xdsv.js} +1 -1
  9. package/dist/client/static/js/{LayoutWrapper-qepkrtd8.js → LayoutWrapper-pwbq5syv.js} +2 -2
  10. package/dist/client/static/js/MergeDiffView-m4jkr786.js +1 -0
  11. package/dist/client/static/js/{Modal-8d299emm.js → Modal-yjszc3vy.js} +12 -12
  12. package/dist/client/static/js/{PdfView-eq7fnqa2.js → PdfView-sny55sne.js} +1 -1
  13. package/dist/client/static/js/{SessionsView-tedh2es3.js → SessionsView-q3800n83.js} +1 -1
  14. package/dist/client/static/js/{SheetView-5xm33kgk.js → SheetView-ezqak2b4.js} +1 -1
  15. package/dist/client/static/js/{SvgPreview-tp1m8r4t.js → SvgPreview-q1cvdf4s.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-xppr9jf1.js → abnfDiagram-O67JEVCF-ftm2qwa3.js} +1 -1
  17. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-s23e6vtk.js → architectureDiagram-NJMV4G6O-j8kqfzmf.js} +3 -3
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-7ws8yq9e.js → blockDiagram-BEXU5L5S-m3zpsp9h.js} +3 -3
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-517yhfzj.js → c4Diagram-YGBWAQC7-myshvbrx.js} +2 -2
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-tcad3rst.js → classDiagram-v2-NBCMYWYE-s0cwmsj4.js} +1 -1
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-a76vf82p.js → cose-bilkent-JH36ORCC-t5t02sfr.js} +1 -1
  22. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-9kety453.js → cynefinDiagram-VND7K2PF-6yxd72sh.js} +1 -1
  23. package/dist/client/static/js/{dagre-6A5THRUB-6g6gsp6b.js → dagre-6A5THRUB-vft5103m.js} +1 -1
  24. package/dist/client/static/js/{diagram-22UHCM2B-ngj4fyg3.js → diagram-22UHCM2B-yy2jfvxt.js} +1 -1
  25. package/dist/client/static/js/{diagram-3UASUU5V-xw2m99qa.js → diagram-3UASUU5V-1xqhzq20.js} +1 -1
  26. package/dist/client/static/js/{diagram-ATOU4E4O-hz3bd083.js → diagram-ATOU4E4O-f11cxgvm.js} +1 -1
  27. package/dist/client/static/js/{diagram-CDSNMT55-vfhtemve.js → diagram-CDSNMT55-gqmkfcp7.js} +3 -3
  28. package/dist/client/static/js/{diagram-MLGK6HIB-22cjvj5g.js → diagram-MLGK6HIB-1fg7304a.js} +1 -1
  29. package/dist/client/static/js/{diagram-MPIPVDR6-xv8fsecp.js → diagram-MPIPVDR6-mem80369.js} +1 -1
  30. package/dist/client/static/js/{dockerfile-491tyqmj.js → dockerfile-jarjwxp9.js} +1 -1
  31. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-m6mkn986.js → ebnfDiagram-ZINNZB2B-4rcbvfrj.js} +1 -1
  32. package/dist/client/static/js/{elk-276RUBZZ-jccw706n.js → elk-276RUBZZ-ykd0stxz.js} +1 -1
  33. package/dist/client/static/js/{erDiagram-OPXOYQCR-rxk86jsf.js → erDiagram-OPXOYQCR-b2th9bk4.js} +1 -1
  34. package/dist/client/static/js/flowDiagram-KWPJA3E3-f3bdtc1z.js +1 -0
  35. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-veweech7.js → ganttDiagram-FUAMR5RP-64p5r7cx.js} +2 -2
  36. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-7dyqcj8r.js → gitGraphDiagram-X574FWY7-z3yc333r.js} +1 -1
  37. package/dist/client/static/js/{index-wa234c7k.js → index-1mm7kyjd.js} +1 -1
  38. package/dist/client/static/js/{index-sx5x2q80.js → index-2gf593e3.js} +1 -1
  39. package/dist/client/static/js/{index-xm3691yp.js → index-3w18s59k.js} +1 -1
  40. package/dist/client/static/js/{index-60fjqzdw.js → index-3x3nhs8n.js} +1 -1
  41. package/dist/client/static/js/{index-2asa0faw.js → index-5m0se6fk.js} +2 -2
  42. package/dist/client/static/js/{index-tk1vr8q2.js → index-6m5n8b6w.js} +4 -4
  43. package/dist/client/static/js/{index-2cfw7wem.js → index-77wznmg5.js} +1 -1
  44. package/dist/client/static/js/{index-e6tjaccf.js → index-bwwgtesb.js} +1 -1
  45. package/dist/client/static/js/{index-5701gj1f.js → index-c2vc6znd.js} +1 -1
  46. package/dist/client/static/js/{index-d9dz0wt0.js → index-dxx49b9m.js} +1 -1
  47. package/dist/client/static/js/{index-4kchzh9y.js → index-e4yj4kbe.js} +8 -8
  48. package/dist/client/static/js/{index-twjq786a.js → index-ebnd5hnr.js} +1 -1
  49. package/dist/client/static/js/{index-zjc8yfbe.js → index-ep353yxd.js} +1 -1
  50. package/dist/client/static/js/{index-wvqwzgpx.js → index-ewtv8gg7.js} +1 -1
  51. package/dist/client/static/js/{index-na95tr1k.js → index-g71wn1pr.js} +2 -2
  52. package/dist/client/static/js/{index-bhst1c2x.js → index-gr07t5c4.js} +1 -1
  53. package/dist/client/static/js/{index-r51fqzb5.js → index-h4qmywn5.js} +1 -1
  54. package/dist/client/static/js/{index-x3g8fwkc.js → index-hge0y4vn.js} +2 -2
  55. package/dist/client/static/js/{index-nzjc24v9.js → index-hmjb96kb.js} +1 -1
  56. package/dist/client/static/js/{index-gsw1zh30.js → index-jd2h5tvh.js} +1 -1
  57. package/dist/client/static/js/{index-637my5h0.js → index-k57bandz.js} +1 -1
  58. package/dist/client/static/js/{index-xq78fj64.js → index-k6wms0kx.js} +1 -1
  59. package/dist/client/static/js/{index-39mr4tym.js → index-k9v6477a.js} +1 -1
  60. package/dist/client/static/js/{index-pqmvhqmj.js → index-kbaffwp1.js} +21 -21
  61. package/dist/client/static/js/{index-3x88fxzj.js → index-mdmtxh1c.js} +1 -1
  62. package/dist/client/static/js/{index-cz80n8yc.js → index-mv83hpva.js} +1 -1
  63. package/dist/client/static/js/{index-xbvjpa60.js → index-n71ffk62.js} +3 -3
  64. package/dist/client/static/js/{index-7ckzdf4r.js → index-nr5gwny1.js} +178 -178
  65. package/dist/client/static/js/{index-j0qt8gaj.js → index-q9gbwqbe.js} +3 -3
  66. package/dist/client/static/js/{index-0qmpqtp2.js → index-rqpbva78.js} +1 -1
  67. package/dist/client/static/js/{index-0xh8402w.js → index-sw370sk7.js} +1 -1
  68. package/dist/client/static/js/{index-0ak5wdz1.js → index-t415df0c.js} +1 -1
  69. package/dist/client/static/js/index-taz2nfym.css +1 -0
  70. package/dist/client/static/js/{index-dg714jam.js → index-w659dhe5.js} +1 -1
  71. package/dist/client/static/js/{index-trpn9gxs.js → index-wgcgshdh.js} +1 -1
  72. package/dist/client/static/js/{index-kfcpkx7h.js → index-x6945djv.js} +1 -1
  73. package/dist/client/static/js/{index-088gwjbz.js → index-y5mf2w81.js} +1 -1
  74. package/dist/client/static/js/{index-wp7tsava.js → index-y69cbdvd.js} +1 -1
  75. package/dist/client/static/js/{index-bfy437re.js → index-y6qtx68e.js} +1 -1
  76. package/dist/client/static/js/{index-4m94cbms.js → index-yktwxghr.js} +1 -1
  77. package/dist/client/static/js/{index-7ehep28z.js → index-zj65csnm.js} +2 -2
  78. package/dist/client/static/js/{infoDiagram-VRGFBTTK-ksz9cvq3.js → infoDiagram-VRGFBTTK-59xq3n1b.js} +2 -2
  79. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-g8symmrp.js → ishikawaDiagram-OU5B5YK6-v18q4qt7.js} +2 -2
  80. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-qs2e3hdf.js → journeyDiagram-ZHPQQLJL-etazj0p8.js} +2 -2
  81. package/dist/client/static/js/{kanban-definition-PNTS6WVX-pzef80sz.js → kanban-definition-PNTS6WVX-ph15e5p2.js} +1 -1
  82. package/dist/client/static/js/{mermaid.core-chfcvkkc.js → mermaid.core-7ygd161b.js} +2 -2
  83. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-sds2e243.js → mindmap-definition-NLK3R4M7-j5xsftrf.js} +1 -1
  84. package/dist/client/static/js/one-dark-pro-4s2rr12v.js +1 -0
  85. package/dist/client/static/js/one-light-3bkk59ww.js +1 -0
  86. package/dist/client/static/js/{pegDiagram-GJSIUBJH-m8199cy0.js → pegDiagram-GJSIUBJH-09nvb70v.js} +1 -1
  87. package/dist/client/static/js/{pieDiagram-5QR66LMP-wqz5k5w6.js → pieDiagram-5QR66LMP-6ymh1960.js} +2 -2
  88. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-rjszd8an.js → quadrantDiagram-O4NWA36T-hk61avw2.js} +2 -2
  89. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-qv0be7dh.js → railroadDiagram-XR7U4H2S-3jvqrfnb.js} +1 -1
  90. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-b87kqbr7.js → requirementDiagram-PLB6GJNP-zthfj48k.js} +1 -1
  91. package/dist/client/static/js/{rust-m7ma3tq9.js → rust-q7n7q6dy.js} +1 -1
  92. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-dh5we479.js → sankeyDiagram-IPEJSGJF-nh5d6xte.js} +1 -1
  93. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-e6fg0x45.js → sequenceDiagram-PO4LG4MO-crej9b40.js} +4 -4
  94. package/dist/client/static/js/{sizeCapture-INFHLROL-mam6cagq.js → sizeCapture-INFHLROL-nvvxw58j.js} +1 -1
  95. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-htwar22v.js → stateDiagram-v2-GCMORJYK-e6tztjnj.js} +1 -1
  96. package/dist/client/static/js/{swimlanes-2SLR337P-5g26cnkr.js → swimlanes-2SLR337P-xhdqjqmf.js} +1 -1
  97. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-rseba3zs.js → swimlanesDiagram-TC7HE7FX-hbwg3m3k.js} +1 -1
  98. package/dist/client/static/js/{timeline-definition-EJHVYXUP-5km8n8mj.js → timeline-definition-EJHVYXUP-9cve31zc.js} +1 -1
  99. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-0vt6ms5g.js → usecaseDiagram-POWQR4AR-asycstwe.js} +1 -1
  100. package/dist/client/static/js/{vennDiagram-UO4OBE2U-k425105a.js → vennDiagram-UO4OBE2U-gbzk6era.js} +4 -4
  101. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-s0gd4jg1.js → wardleyDiagram-VNRHLVJA-1swwfszr.js} +2 -2
  102. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-2nrdzp7p.js → xychartDiagram-PMCCYNJV-v7qkwv0b.js} +3 -3
  103. package/package.json +4 -4
  104. package/src/client/components/settings/categories/chat-settings/ToolRenderSection.tsx +1 -1
  105. package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +5 -3
  106. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  107. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.tsx +25 -62
  108. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.test.tsx +40 -0
  109. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +41 -2
  110. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk.tsx +41 -21
  111. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +16 -3
  112. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionList.tsx +117 -0
  113. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/SwipeDeck.tsx +220 -0
  114. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts +105 -2
  115. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +59 -8
  116. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.test.tsx +0 -13
  117. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.tsx +6 -23
  118. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.test.ts +1 -39
  119. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.ts +11 -46
  120. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +36 -1
  121. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +10 -5
  122. package/src/client/data/settings/omp-schema.json +59 -7
  123. package/src/client/hooks/chat/timeline/ask-frame-buckets.ts +14 -4
  124. package/src/client/hooks/chat/timeline/ask-frames-context.ts +3 -1
  125. package/src/client/hooks/chat/timeline/ask-frames-form.test.ts +29 -0
  126. package/src/client/hooks/chat/timeline/ask-frames-grouped.test.ts +31 -0
  127. package/src/client/hooks/chat/timeline/ask-frames.ts +12 -3
  128. package/src/client/hooks/chat/timeline/send-props.ts +1 -2
  129. package/src/server/lib/harness/acp/client-capabilities.test.ts +3 -2
  130. package/src/server/lib/sessions/last-opened.server.test.ts +26 -7
  131. package/src/server/lib/sessions/last-opened.server.ts +19 -4
  132. package/src/shared/lib/chat/ask-form/data.ts +25 -6
  133. package/src/shared/lib/chat/ask-form/deck.ts +80 -0
  134. package/src/shared/lib/chat/ask-form/fields.ts +26 -1
  135. package/src/shared/lib/chat/ask-form/index.ts +18 -310
  136. package/src/shared/lib/chat/ask-form/types.ts +14 -2
  137. package/src/shared/lib/chat/ask-form/walker.ts +350 -0
  138. package/src/shared/lib/chat/ask-form.test.ts +41 -0
  139. package/src/shared/lib/chat/ask-questions.test.ts +29 -0
  140. package/src/shared/lib/chat/ask-questions.ts +44 -3
  141. package/src/shared/lib/chat/ask-results.test.ts +66 -0
  142. package/src/shared/lib/chat/ask-results.ts +58 -0
  143. package/src/shared/lib/chat/timeline/block-chrome.ts +4 -4
  144. package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +47 -0
  145. package/src/shared/lib/omp/config/schema-releases.test.ts +4 -2
  146. package/tsconfig.json +6 -0
  147. package/dist/client/static/js/MergeDiffView-n2h8vv0j.js +0 -1
  148. package/dist/client/static/js/flowDiagram-KWPJA3E3-aegwx04w.js +0 -1
  149. package/dist/client/static/js/index-4m2d73m3.css +0 -1
  150. package/dist/client/static/js/one-dark-pro-5fvhpb1t.js +0 -1
  151. package/dist/client/static/js/one-light-pwj40vbr.js +0 -1
@@ -30,6 +30,7 @@ import { buildFormData, type FormPick } from '@/shared/lib/chat/ask-form/data';
30
30
  import { isOtherOption } from '@/shared/lib/chat/ask-questions';
31
31
  import { AnswerList, QuestionCard } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard';
32
32
  import { OptionRow } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow';
33
+ import { SwipeDeck } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/SwipeDeck';
33
34
  import { partsFor } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/form-picks';
34
35
  import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
35
36
 
@@ -40,7 +41,7 @@ interface FormDialogProps {
40
41
  /** Answers omp already recorded, per question — those render settled. */
41
42
  recorded: (readonly string[] | null)[];
42
43
  /** What this client just sent, held until omp echoes it in the tool result. */
43
- submitted?: Record<string, string | string[]> | null;
44
+ submitted?: Record<string, string | string[] | boolean> | null;
44
45
  onRespond: (response: ExtensionDialogResponse) => void;
45
46
  interactions?: ComponentChildren;
46
47
  }
@@ -102,6 +103,19 @@ export function FormDialog({ frame, questions, recorded, submitted, onRespond, i
102
103
  });
103
104
  };
104
105
 
106
+ const undo = () => {
107
+ setPicks((current) => {
108
+ const decided = Object.entries(current)
109
+ .filter(([, pick]) => pick.selected.length > 0)
110
+ .map(([index]) => Number(index));
111
+ if (decided.length === 0) return current;
112
+ const last = Math.max(...decided);
113
+ const next = { ...current };
114
+ delete next[last];
115
+ return next;
116
+ });
117
+ };
118
+
105
119
  const built = useMemo(() => buildFormData(questions, effective), [questions, effective]);
106
120
  const ready = 'data' in built;
107
121
 
@@ -118,9 +132,34 @@ export function FormDialog({ frame, questions, recorded, submitted, onRespond, i
118
132
  onRespond({ data: outcome.data });
119
133
  };
120
134
 
135
+ // Consecutive swipe cards are one deck in omp; a change of kind breaks the
136
+ // run. Built once per render so the deck keeps its card state.
137
+ const runs: { kind: 'deck' | 'single'; index: number; cards: AskQuestion[] }[] = [];
138
+ for (let index = 0; index < questions.length; index += 1) {
139
+ const card = questions[index].kind === 'card';
140
+ const prev = runs[runs.length - 1];
141
+ if (card && prev && prev.kind === 'deck') prev.cards.push(questions[index]);
142
+ else runs.push({ kind: card ? 'deck' : 'single', index, cards: card ? [questions[index]] : [] });
143
+ }
144
+
121
145
  return (
122
146
  <div className="space-y-2">
123
- {questions.map((question, index) => {
147
+ {runs.map((run) => {
148
+ if (run.kind === 'deck') {
149
+ return (
150
+ <SwipeDeck
151
+ key={run.index}
152
+ cards={run.cards}
153
+ picks={effective}
154
+ offset={run.index}
155
+ onVerdict={(index, label) => toggle(index, label, false)}
156
+ disabled={settled}
157
+ onUndo={undo}
158
+ />
159
+ );
160
+ }
161
+ const question = questions[run.index];
162
+ const index = run.index;
124
163
  const recordedParts = recorded[index] ?? null;
125
164
  const pick = pickFor(effective, index);
126
165
  const sentData = submitted?.[question.id ?? ''];
@@ -49,6 +49,17 @@ interface GroupedAskProps {
49
49
  */
50
50
  submitted?: { id: string; selectedOptions: string[]; customInput?: string }[] | null;
51
51
  onRespond: (response: ExtensionDialogResponse) => void;
52
+ /**
53
+ * An ACP ask answers by sending a prompt, not by replying to a frame. These
54
+ * flags let the same card lock while that send is on the wire, hide the
55
+ * omp-only Dismiss button, and label the action for what it does.
56
+ */
57
+ busy?: boolean;
58
+ readOnly?: boolean;
59
+ dismissible?: boolean;
60
+ submitLabel?: string;
61
+ /** Every question needs an answer (an ACP adapter reads one message). */
62
+ requireAll?: boolean;
52
63
  /**
53
64
  * The `pendingInteraction` slot's controls, if any.
54
65
  *
@@ -141,7 +152,7 @@ function QuestionRow({
141
152
  );
142
153
  }
143
154
 
144
- export function GroupedAsk({ frame, recorded, submitted, onRespond, interactions }: GroupedAskProps) {
155
+ export function GroupedAsk({ frame, recorded, submitted, onRespond, interactions, busy, readOnly, dismissible, submitLabel, requireAll }: GroupedAskProps) {
145
156
  const questions = useMemo(() => frame.questions ?? [], [frame.questions]);
146
157
  const [drafts, setDrafts] = useState<Record<string, Draft>>({});
147
158
 
@@ -188,9 +199,14 @@ export function GroupedAsk({ frame, recorded, submitted, onRespond, interactions
188
199
  };
189
200
  });
190
201
  const anyAnswer = answers.some((answer) => answer.selectedOptions.length > 0 || answer.customInput);
202
+ // An ACP adapter reads ONE prompt as the answer, so every question must carry
203
+ // one; omp's grouped frame keeps its original "any answer" rule.
204
+ const everyAnswer = answers.every((answer) => answer.selectedOptions.length > 0 || answer.customInput);
205
+ const ready = requireAll ? everyAnswer : anyAnswer;
191
206
  // Every question carries an answer once a submit is in flight, so the card
192
207
  // stops drawing controls and shows what was sent.
193
208
  const settled = submitted !== null && questions.every((question, index) => answerFor(question, index) !== null);
209
+ const locked = settled || busy === true || readOnly === true;
194
210
 
195
211
  return (
196
212
  <div className="space-y-2">
@@ -202,31 +218,35 @@ export function GroupedAsk({ frame, recorded, submitted, onRespond, interactions
202
218
  total={questions.length}
203
219
  draft={draftFor(question)}
204
220
  answer={answerFor(question, index)}
205
- locked={settled}
221
+ locked={locked}
206
222
  onToggle={(label) => toggle(question, label)}
207
223
  onText={(value) => setText(question, value)}
208
224
  />
209
225
  ))}
210
226
  {interactions}
211
- <div className="flex items-center justify-end gap-2">
212
- <button
213
- type="button"
214
- disabled={settled}
215
- onClick={() => onRespond({ cancelled: true })}
216
- className="cursor-pointer rounded-md border border-ink/15 px-3 py-1 text-[11.5px] font-medium text-ink/70 transition-colors hover:border-ink/30 hover:text-ink disabled:cursor-default disabled:opacity-40"
217
- >
218
- Dismiss
219
- </button>
220
- <button
221
- type="button"
222
- disabled={!anyAnswer || settled}
223
- onClick={() => onRespond({ answers })}
224
- className="flex cursor-pointer items-center gap-1.5 rounded-md bg-ink px-3 py-1 text-[11.5px] font-semibold text-paper transition-opacity hover:opacity-90 disabled:opacity-40"
225
- >
226
- <CornerDownLeft size={11} />
227
- <span>Submit answers</span>
228
- </button>
229
- </div>
227
+ {readOnly !== true && (
228
+ <div className="flex items-center justify-end gap-2">
229
+ {dismissible !== false && (
230
+ <button
231
+ type="button"
232
+ disabled={locked}
233
+ onClick={() => onRespond({ cancelled: true })}
234
+ className="cursor-pointer rounded-md border border-ink/15 px-3 py-1 text-[11.5px] font-medium text-ink/70 transition-colors hover:border-ink/30 hover:text-ink disabled:cursor-default disabled:opacity-40"
235
+ >
236
+ Dismiss
237
+ </button>
238
+ )}
239
+ <button
240
+ type="button"
241
+ disabled={!ready || locked}
242
+ onClick={() => onRespond({ answers })}
243
+ className="flex cursor-pointer items-center gap-1.5 rounded-md bg-ink px-3 py-1 text-[11.5px] font-semibold text-paper transition-opacity hover:opacity-90 disabled:opacity-40"
244
+ >
245
+ <CornerDownLeft size={11} />
246
+ <span>{submitLabel ?? 'Submit answers'}</span>
247
+ </button>
248
+ </div>
249
+ )}
230
250
  </div>
231
251
  );
232
252
  }
@@ -15,7 +15,7 @@
15
15
  * both of omp's shapes.
16
16
  */
17
17
 
18
- import { Ban, CheckCircle2, Clock } from 'lucide-preact';
18
+ import { Ban, CheckCircle2, Clock, MessageSquare } from 'lucide-preact';
19
19
  import type { ComponentChildren } from 'preact';
20
20
  import type { ExtensionUiDialogRequest } from '@kabmo-labs/kabmo-chat/contracts/agent';
21
21
  import type { AskAnswer, AskQuestion } from '@/shared/lib/chat/ask-form/types';
@@ -40,6 +40,12 @@ interface QuestionBlockProps {
40
40
  * anything.
41
41
  */
42
42
  settled: boolean;
43
+ /**
44
+ * Where an unanswered question is answered. ACP ask tools have no dialog:
45
+ * their adapter reads the next user message, so the card names the composer
46
+ * instead of promising a control it cannot draw.
47
+ */
48
+ answerChannel?: 'dialog' | 'message';
43
49
  /** Labels toggled locally on a multi-select question. */
44
50
  multiSelected: string[];
45
51
  /**
@@ -69,6 +75,7 @@ export function QuestionBlock({
69
75
  draft,
70
76
  passed,
71
77
  settled,
78
+ answerChannel = 'dialog',
72
79
  multiSelected,
73
80
  interactions,
74
81
  onAnswer,
@@ -143,8 +150,14 @@ export function QuestionBlock({
143
150
  ))}
144
151
  {/* "Waiting for the previous answer" is only true while the ask
145
152
  is still running: once it settles nothing is being asked, and
146
- the question was abandoned unanswered. */}
147
- {settled ? (
153
+ the question was abandoned unanswered. An ACP ask never has a
154
+ dialog at all, so it names the channel that actually works. */}
155
+ {answerChannel === 'message' ? (
156
+ <div className="flex items-center gap-1.5 pt-0.5 text-[10.5px] text-ink/40">
157
+ <MessageSquare size={10} className="shrink-0" />
158
+ <span>This harness has no inline control for this question.</span>
159
+ </div>
160
+ ) : settled ? (
148
161
  <div className="flex items-center gap-1.5 pt-0.5 text-[10.5px] text-ink/40">
149
162
  <Ban size={10} className="shrink-0" />
150
163
  <span>Not answered: the ask was cut short.</span>
@@ -0,0 +1,117 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The question list of the grouped `ask` form (`FormAsk`): every question at
8
+ * once, with swipe decks (`<booldeck>` cards) drawn as one deck per run.
9
+ *
10
+ * Split out of `FormAsk` at the 350-line ceiling: the submit state machine
11
+ * owns the rest of that file. The deck run detection lives here because a run
12
+ * needs every card of the run: only the run's first card renders the
13
+ * `SwipeDeck`, the rest are its stack.
14
+ */
15
+
16
+ import { AnswerList, QuestionCard } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard';
17
+ import { OptionRow } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow';
18
+ import { SwipeDeck } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/SwipeDeck';
19
+ import { partsFor, type Pick } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/form-picks';
20
+ import { isOtherOption } from '@/shared/lib/chat/ask-questions';
21
+ import type { AskAnswer, AskQuestion } from '@/shared/lib/chat/ask-form/types';
22
+
23
+ interface QuestionListProps {
24
+ questions: AskQuestion[];
25
+ picks: Record<number, Pick>;
26
+ recorded: (AskAnswer | null)[];
27
+ /** Whether the machine is sending — controls render inert only then. */
28
+ sending: boolean;
29
+ /** The live frame's answer for one question, or null while unanswered. */
30
+ answerFor: (index: number) => AskAnswer | null;
31
+ onToggle: (index: number, label: string, multi: boolean) => void;
32
+ onText: (index: number, text: string) => void;
33
+ onUndo: () => void;
34
+ }
35
+
36
+ export function QuestionList({ questions, picks, recorded, sending, answerFor, onToggle, onText, onUndo }: QuestionListProps) {
37
+ return (
38
+ <>
39
+ {questions.map((question, index) => {
40
+ if (question.kind === 'card') {
41
+ const prev = questions[index - 1];
42
+ if (prev && prev.kind === 'card') return null;
43
+ const cards: AskQuestion[] = [];
44
+ for (let at = index; at < questions.length && questions[at].kind === 'card'; at += 1) cards.push(questions[at]);
45
+ return (
46
+ <SwipeDeck
47
+ key={question.id ?? index}
48
+ cards={cards}
49
+ picks={picks}
50
+ offset={index}
51
+ onVerdict={(verdictIndex, label) => onToggle(verdictIndex, label, false)}
52
+ disabled={sending}
53
+ onUndo={onUndo}
54
+ />
55
+ );
56
+ }
57
+ const answer = answerFor(index);
58
+ const pick = picks[index] ?? { selected: [], text: '' };
59
+ return (
60
+ <QuestionCard
61
+ key={question.id ?? index}
62
+ index={index}
63
+ total={questions.length}
64
+ header={question.header}
65
+ question={question.question}
66
+ multi={question.multi === true}
67
+ answered={answer !== null}
68
+ >
69
+ {answer !== null ? (
70
+ <AnswerList parts={partsFor(question, pick, recorded[index] ?? null)} />
71
+ ) : (
72
+ <>
73
+ {question.kind === 'text' ? (
74
+ <textarea
75
+ rows={3}
76
+ value={pick.text}
77
+ disabled={sending}
78
+ placeholder="Type your answer…"
79
+ aria-label={`Your answer for question ${index + 1}`}
80
+ onInput={(event) => onText(index, event.currentTarget.value)}
81
+ className="mt-2 w-full rounded-md border border-ink/15 bg-canvas/40 px-2 py-1 font-mono text-[11.5px] text-ink outline-none focus:border-ink disabled:opacity-50"
82
+ />
83
+ ) : (
84
+ <>
85
+ <div className="mt-2 space-y-1" role={question.multi === true ? 'group' : 'radiogroup'}>
86
+ {question.options.filter((option) => !isOtherOption(option.label)).map((option, optionIndex) => (
87
+ <OptionRow
88
+ key={option.label}
89
+ label={option.label}
90
+ description={option.description}
91
+ multi={question.multi === true}
92
+ checked={pick.selected.includes(option.label)}
93
+ suggested={question.recommended === optionIndex}
94
+ disabled={sending}
95
+ onClick={() => onToggle(index, option.label, question.multi === true)}
96
+ />
97
+ ))}
98
+ </div>
99
+ <input
100
+ type="text"
101
+ value={pick.text}
102
+ disabled={sending}
103
+ placeholder="Or type your own…"
104
+ aria-label={`Your own answer for question ${index + 1}`}
105
+ onInput={(event) => onText(index, event.currentTarget.value)}
106
+ className="mt-2 w-full rounded-md border border-ink/15 bg-canvas/40 px-2 py-1 text-[11.5px] text-ink outline-none focus:border-ink disabled:opacity-50"
107
+ />
108
+ </>
109
+ )}
110
+ </>
111
+ )}
112
+ </QuestionCard>
113
+ );
114
+ })}
115
+ </>
116
+ );
117
+ }
@@ -0,0 +1,220 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The `<booldeck>` swipe deck (omp 19.4.0), drawn in the timeline instead of a
8
+ * modal — the same surface every other `ask` question uses.
9
+ *
10
+ * omp's terminal deck shows one card from a stack: swipe right for yes, left
11
+ * for no, up to skip, with a pip per card and a tally (`7 Keep · 2 Drop · 1
12
+ * skipped`) once every card is decided. A card it cannot animate is the same
13
+ * deck without flight: the top card first with its three verdict buttons
14
+ * (`♥` yes, `✕` no, `↑` skip) and `↺` undo, a pip per card, the next card
15
+ * waiting under it, and the tally when the deck is done. Verdicts ride as the
16
+ * question's `options` (values `yes`/`no`/`skip`), so the one-Submit form
17
+ * builder carries them without a second convention.
18
+ */
19
+
20
+ import { useEffect, useRef } from 'preact/hooks';
21
+ import { CheckCircle2 } from 'lucide-preact';
22
+ import type { AskQuestion } from '@/shared/lib/chat/ask-form/types';
23
+ import type { FormPick } from '@/shared/lib/chat/ask-form/data';
24
+
25
+ /** One card verdict, in omp's order: yes, no, skip. */
26
+ export type Verdict = 'yes' | 'no' | 'skip';
27
+
28
+ /** The verdict a picked row carries, by its fixed value (never its label). */
29
+ export function verdictOf(question: AskQuestion, picked: readonly string[]): Verdict | undefined {
30
+ const option = question.options.find(
31
+ (candidate) => candidate.value === picked[0] || candidate.label === picked[0],
32
+ );
33
+ const value = option?.value ?? picked[0];
34
+ return value === 'yes' || value === 'no' || value === 'skip' ? value : undefined;
35
+ }
36
+
37
+ /** omp's label for a verdict: the side's own label, `Skip` for a skip. */
38
+ export function verdictLabel(question: AskQuestion, verdict: Verdict): string {
39
+ if (verdict === 'skip') return 'Skip';
40
+ return question.options.find((candidate) => candidate.value === verdict)?.label ?? (verdict === 'yes' ? 'Yes' : 'No');
41
+ }
42
+
43
+ /** omp's tally: `7 Keep · 2 Drop · 1 skipped`, skipping zero verdicts. */
44
+ export function tallyOf(cards: readonly AskQuestion[], picks: Record<number, FormPick>, offset: number): string | undefined {
45
+ const counts: Record<Verdict, number> = { yes: 0, no: 0, skip: 0 };
46
+ for (const [index, card] of cards.entries()) {
47
+ const verdict = verdictOf(card, picks[offset + index]?.selected ?? []);
48
+ if (verdict) counts[verdict] += 1;
49
+ }
50
+ const parts: string[] = [];
51
+ for (const verdict of ['yes', 'no', 'skip'] as const satisfies readonly Verdict[]) {
52
+ if (counts[verdict] === 0) continue;
53
+ const labels = [...new Set(cards.map((card) => verdictLabel(card, verdict)))];
54
+ const label = labels.length === 1 ? labels[0] : verdict === 'yes' ? 'Yes' : 'No';
55
+ parts.push(`${counts[verdict]} ${verdict === 'skip' ? 'skipped' : label}`);
56
+ }
57
+ return parts.length ? parts.join(' · ') : undefined;
58
+ }
59
+
60
+ interface SwipeDeckProps {
61
+ /** Every card question of the deck, in form order. */
62
+ cards: AskQuestion[];
63
+ /** Picks by question index (the timeline answers read these). */
64
+ picks: Record<number, FormPick>;
65
+ /** Offset of the deck's first card in the form's question list. */
66
+ offset: number;
67
+ /** Choose a verdict for one card. */
68
+ onVerdict: (index: number, label: string) => void;
69
+ /** Disable every control once the answers are on the wire. */
70
+ disabled?: boolean;
71
+ /** Drop the last verdict (omp's `↺`). */
72
+ onUndo?: () => void;
73
+ }
74
+
75
+ /**
76
+ * The deck: the first undecided card on top with its three verdicts, a pip per
77
+ * card, the cards under it, and the tally when every card is decided.
78
+ */
79
+ export function SwipeDeck({ cards, picks, offset, onVerdict, disabled, onUndo }: SwipeDeckProps) {
80
+ const focusRef = useRef<HTMLDivElement>(null);
81
+
82
+ // The deck owns the keyboard while it is on screen: arrows decide the top
83
+ // card, Enter submits once every card is decided. Mirrors the terminal
84
+ // deck's key map without overriding the app's shortcuts.
85
+ useEffect(() => {
86
+ if (disabled || !focusRef.current) return;
87
+ const node = focusRef.current;
88
+ const onKey = (event: KeyboardEvent) => {
89
+ const verdicts = cards.map((card, index) => verdictOf(card, picks[offset + index]?.selected ?? []));
90
+ const top = verdicts.findIndex((verdict) => verdict === undefined);
91
+ const verdictByKey: Record<string, Verdict> = {
92
+ ArrowRight: 'yes',
93
+ ArrowLeft: 'no',
94
+ ArrowUp: 'skip',
95
+ };
96
+ const verdict = verdictByKey[event.key];
97
+ if (verdict && top >= 0) {
98
+ event.preventDefault();
99
+ onVerdict(offset + top, verdictLabel(cards[top], verdict));
100
+ return;
101
+ }
102
+ if (event.key === 'Backspace' && onUndo) {
103
+ event.preventDefault();
104
+ onUndo();
105
+ }
106
+ };
107
+ node.addEventListener('keydown', onKey);
108
+ return () => node.removeEventListener('keydown', onKey);
109
+ }, [cards, picks, offset, onVerdict, disabled, onUndo]);
110
+
111
+ const verdicts = cards.map((card, index) => verdictOf(card, picks[offset + index]?.selected ?? []));
112
+ const top = verdicts.findIndex((verdict) => verdict === undefined);
113
+ const done = top === -1;
114
+ const visible = cards
115
+ .map((card, index) => ({ card, index, verdict: verdicts[index] }))
116
+ .filter(({ index }) => done || index >= top - 1)
117
+ .slice(0, 3);
118
+
119
+ return (
120
+ <div ref={focusRef} tabIndex={disabled ? undefined : 0} className="space-y-1.5 outline-none" aria-label="Swipe deck">
121
+ <div className="flex items-center gap-1" aria-hidden="true">
122
+ {cards.map((card, index) => {
123
+ const verdict = verdicts[index];
124
+ const tone =
125
+ verdict === 'yes'
126
+ ? 'text-success'
127
+ : verdict === 'no'
128
+ ? 'text-error'
129
+ : verdict === 'skip'
130
+ ? 'text-ink/40'
131
+ : index === top
132
+ ? 'text-accent'
133
+ : 'text-ink/25';
134
+ return (
135
+ <span key={card.id ?? index} className={`text-[10px] ${tone}`}>
136
+ {verdict ? '●' : index === top ? '◉' : '○'}
137
+ </span>
138
+ );
139
+ })}
140
+ <span className="ml-auto font-mono text-[10px] text-ink/40">
141
+ {done ? `${cards.length} of ${cards.length}` : `${top + 1} of ${cards.length}`}
142
+ </span>
143
+ </div>
144
+
145
+ {visible.map(({ card, index, verdict }) => (
146
+ <div
147
+ key={card.id ?? index}
148
+ className={`rounded-lg border bg-paper p-2.5 ${index === top ? 'border-ink/25 shadow-xs' : 'border-ink/10 opacity-70'}`}
149
+ >
150
+ <div className="text-[12.5px] leading-relaxed text-ink/90 select-text">{card.question}</div>
151
+ <div className="mt-1.5 flex items-center gap-1.5">
152
+ {(['yes', 'no', 'skip'] as const satisfies readonly Verdict[]).map((candidate) => {
153
+ const label = verdictLabel(card, candidate);
154
+ const active = verdict === candidate;
155
+ const tone =
156
+ candidate === 'yes'
157
+ ? active
158
+ ? 'border-success/40 bg-success/10 text-success'
159
+ : 'border-ink/15 text-ink/70 hover:border-success/40 hover:text-success'
160
+ : candidate === 'no'
161
+ ? active
162
+ ? 'border-error/40 bg-error/10 text-error'
163
+ : 'border-ink/15 text-ink/70 hover:border-error/40 hover:text-error'
164
+ : active
165
+ ? 'border-ink/30 bg-ink/5 text-ink'
166
+ : 'border-ink/15 text-ink/70 hover:border-ink/40 hover:text-ink';
167
+ const glyph = candidate === 'yes' ? '♥' : candidate === 'no' ? '✕' : '↑';
168
+ return (
169
+ <button
170
+ key={candidate}
171
+ type="button"
172
+ disabled={disabled}
173
+ onClick={() => onVerdict(offset + index, label)}
174
+ aria-label={`${label} — ${card.question}`}
175
+ aria-pressed={active}
176
+ className={`flex min-h-8 flex-1 cursor-pointer items-center justify-center gap-1 rounded-md border px-2 text-[11.5px] font-medium transition-colors disabled:cursor-default disabled:opacity-40 ${tone}`}
177
+ >
178
+ <span aria-hidden="true">{glyph}</span>
179
+ {label}
180
+ </button>
181
+ );
182
+ })}
183
+ {verdict && (
184
+ <span className="flex shrink-0 items-center gap-1 text-[10.5px] font-medium text-ink/60">
185
+ <CheckCircle2 size={11} className="text-success" />
186
+ {verdictLabel(card, verdict)}
187
+ </span>
188
+ )}
189
+ {onUndo && verdict !== undefined && index === verdicts.length - 1 && (
190
+ <button
191
+ type="button"
192
+ disabled={disabled}
193
+ onClick={onUndo}
194
+ aria-label="Undo the last verdict"
195
+ title="Undo (Backspace)"
196
+ className="shrink-0 cursor-pointer rounded-md border border-ink/15 px-2 py-1 text-[11.5px] text-ink/70 transition-colors hover:border-ink/40 hover:text-ink disabled:cursor-default disabled:opacity-40"
197
+ >
198
+ ↺
199
+ </button>
200
+ )}
201
+ </div>
202
+ </div>
203
+ ))}
204
+
205
+ {onUndo && verdicts.some((verdict) => verdict !== undefined) && !done && (
206
+ <div className="text-[10.5px] text-ink/45">
207
+ <span className="font-mono">←</span> no · <span className="font-mono">→</span> yes ·{' '}
208
+ <span className="font-mono">↑</span> skip · <span className="font-mono">⌫</span> undo
209
+ </div>
210
+ )}
211
+
212
+ {done && (
213
+ <div className="rounded-lg border border-ink/10 bg-paper p-2.5 text-center">
214
+ <div className="text-[12.5px] font-medium text-ink/90">That’s every card</div>
215
+ <div className="mt-1 text-[11.5px] text-ink/70">{tallyOf(cards, picks, offset)}</div>
216
+ </div>
217
+ )}
218
+ </div>
219
+ );
220
+ }
@@ -53,9 +53,20 @@ function mountFromFrame(frame: IncomingExtensionUiRequest): ExtensionUiDialogReq
53
53
  }
54
54
 
55
55
  /** Mount the card with an explicit frame queue and tool, keeping it mounted. */
56
- function paint(queue: ExtensionUiDialogRequest[], tool: ToolCallData = ASK_TOOL): void {
56
+ function paint(
57
+ queue: ExtensionUiDialogRequest[],
58
+ tool: ToolCallData = ASK_TOOL,
59
+ harness?: string,
60
+ ): void {
57
61
  const split = splitAskFrames([MESSAGE], queue, true);
58
- const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: [], formByTool: new Map(), respond: () => {} };
62
+ const handle: AskFramesHandle = {
63
+ framesByTool: split.framesByTool,
64
+ looseByTool: split.looseByTool,
65
+ orphanAsks: [],
66
+ formByTool: new Map(),
67
+ ...(harness ? { harness } : {}),
68
+ respond: () => {},
69
+ };
59
70
  act(() => { render(h(AskFramesContext.Provider, { value: handle }, h(AskPanel, { tool })), container); });
60
71
  }
61
72
 
@@ -140,3 +151,95 @@ describe('grouped ask frame end to end', () => {
140
151
  expect(container.querySelector('[title="the warm one"]')).toBeNull();
141
152
  });
142
153
  });
154
+
155
+ describe('external ACP ask tool call', () => {
156
+ test('renders questions read-only when no elicitation frame has arrived', () => {
157
+ const external: ToolCallData = {
158
+ id: 'call-acp-ask',
159
+ type: 'other',
160
+ title: 'Run AskUserQuestion',
161
+ name: 'AskUserQuestion',
162
+ status: 'running',
163
+ input: {
164
+ questions: [{
165
+ header: 'Approach',
166
+ question: 'Which strategy?',
167
+ multiSelect: true,
168
+ options: [
169
+ { label: 'Conservative', description: 'small steps' },
170
+ { label: 'Balanced' },
171
+ ],
172
+ }],
173
+ },
174
+ };
175
+
176
+ paint([], external);
177
+
178
+ const text = container.textContent ?? '';
179
+ expect(text).toContain('Which strategy?');
180
+ expect(text).toContain('Conservative');
181
+ expect(text).toContain('small steps');
182
+ expect(text).toContain('This harness has no inline control for this question.');
183
+ expect(text).not.toContain('Waiting for the previous answer');
184
+ expect(text).not.toContain('Submit answers');
185
+ expect(text).not.toContain('Send answer');
186
+ });
187
+
188
+ test('omp-acp’s exact `ask` name is recognized as an external ask', () => {
189
+ // omp's own tool is `ask`; over ACP the only signal is the chat's harness.
190
+ paint([], ASK_TOOL, 'omp-acp');
191
+
192
+ const text = container.textContent ?? '';
193
+ expect(text).toContain('waiting for your answer.');
194
+ expect(text).toContain('This harness has no inline control for this question.');
195
+ expect(text).not.toContain('Waiting for the previous answer');
196
+ });
197
+
198
+ test('a completed external ask renders the answers its result carries', () => {
199
+ // The reported opencode/claude symptom: the answer was delivered and the
200
+ // tool completed, but the card still drew the question as unanswered.
201
+ const external: ToolCallData = {
202
+ id: 'call-acp-answered',
203
+ type: 'other',
204
+ title: 'question',
205
+ name: 'question',
206
+ status: 'success',
207
+ input: {
208
+ questions: [
209
+ { question: 'Koneksi ini buat ngoding stack apa?', options: [{ label: 'TypeScript / JS' }, { label: 'Go' }] },
210
+ { question: 'Gaya respons yang kamu mau?', options: [{ label: 'Singkat & langsung' }, { label: 'Detail' }] },
211
+ ],
212
+ },
213
+ output: 'Your questions have been answered: "Koneksi ini buat ngoding stack apa?"="TypeScript / JS", "Gaya respons yang kamu mau?"="Singkat & langsung". You can now continue with the user\'s answers in mind.',
214
+ };
215
+
216
+ paint([], external);
217
+
218
+ const text = container.textContent ?? '';
219
+ expect(text).toContain('TypeScript / JS');
220
+ expect(text).toContain('Singkat & langsung');
221
+ expect(text).not.toContain('Input needed');
222
+ expect(text).not.toContain('Send answer');
223
+ });
224
+
225
+ test('reads a single-question shape from an adapter that does not use questions[]', () => {
226
+ const external: ToolCallData = {
227
+ id: 'call-acp-single',
228
+ type: 'other',
229
+ title: 'Run ask_question',
230
+ name: 'ask_question',
231
+ status: 'success',
232
+ input: { question: 'Lanjut tes yang mana?', options: ['Image generation', 'Selesai'] },
233
+ };
234
+
235
+ paint([], external);
236
+
237
+ const text = container.textContent ?? '';
238
+ expect(text).toContain('Lanjut tes yang mana?');
239
+ expect(text).toContain('Image generation');
240
+ expect(text).toContain('Selesai');
241
+ expect(text).toContain('This harness has no inline control for this question.');
242
+ expect(text).not.toContain('Not answered: the ask was cut short.');
243
+ });
244
+ });
245
+