@kabmo-labs/kabmo 0.36.0 → 0.38.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.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +547 -528
- package/dist/client/static/js/{CsvGrid-1h3bcak7.js → CsvGrid-90zfbn7f.js} +2 -2
- package/dist/client/static/js/{DocxView-ndca8jch.js → DocxView-vwq2rf16.js} +2 -2
- package/dist/client/static/js/{DrawioView-kpzd6y0b.js → DrawioView-bvx7eqcz.js} +2 -2
- package/dist/client/static/js/{ImageView-79prn3dg.js → ImageView-q6xfmbrq.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-v2wn2sb2.js → LayoutWrapper-qatdaw3n.js} +2 -2
- package/dist/client/static/js/{Modal-99j0zz3z.js → Modal-6jx1fvfb.js} +15 -15
- package/dist/client/static/js/{PdfView-2rjd87ay.js → PdfView-tkv2d2zs.js} +1 -1
- package/dist/client/static/js/{SessionsView-t7f3s71b.js → SessionsView-rbnecykz.js} +1 -1
- package/dist/client/static/js/{SheetView-ehb976st.js → SheetView-t08g8kdr.js} +4 -4
- package/dist/client/static/js/{SvgPreview-de2bbba6.js → SvgPreview-9vh6mdcp.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-nx9jzn7m.js → abnfDiagram-O67JEVCF-bxcn33e1.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-r8sz34h3.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-170v67rr.js → architectureDiagram-NJMV4G6O-40ggw6e8.js} +2 -2
- package/dist/client/static/js/{astro-80bs6hvg.js → astro-p3f5p9p2.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-16q285n1.js → blockDiagram-BEXU5L5S-k41cvjrd.js} +6 -6
- package/dist/client/static/js/c-jkdstn33.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-rn3qt45h.js → c4Diagram-YGBWAQC7-rdcmn6ac.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-r26wg74e.js → classDiagram-v2-NBCMYWYE-txbmbkxv.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-82kwe7ha.js → cose-bilkent-JH36ORCC-bxzh3qj1.js} +1 -1
- package/dist/client/static/js/cpp-9d3xdpe3.js +1 -0
- package/dist/client/static/js/css-r3wja1ze.js +1 -0
- package/dist/client/static/js/css-sebxkh5f.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-w2f2vev7.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-tcxdn6pa.js → cynefinDiagram-VND7K2PF-abx5343b.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-g833ata3.js → dagre-6A5THRUB-baj278kt.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-f1fq8xec.js → diagram-22UHCM2B-vqvhdc5m.js} +7 -7
- package/dist/client/static/js/{diagram-3UASUU5V-6j2w016f.js → diagram-3UASUU5V-w328rfx0.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-6t2qxsk4.js → diagram-ATOU4E4O-zzcmwnm8.js} +2 -2
- package/dist/client/static/js/{diagram-CDSNMT55-7abar8s7.js → diagram-CDSNMT55-8yw39mmj.js} +1 -1
- package/dist/client/static/js/{diagram-MLGK6HIB-s68rgy16.js → diagram-MLGK6HIB-zgc386pv.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-azgkm6w8.js → diagram-MPIPVDR6-efmvvscm.js} +1 -1
- package/dist/client/static/js/{dockerfile-47e33kqa.js → dockerfile-bp5dre33.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-esrjz750.js → ebnfDiagram-ZINNZB2B-p66h0dzq.js} +1 -1
- package/dist/client/static/js/{elixir-rpa1g4gy.js → elixir-jwphgp8j.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-fhr4b4jj.js → elk-276RUBZZ-g0jjxcqd.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-5r3fmdnz.js → erDiagram-OPXOYQCR-39gat96z.js} +4 -4
- package/dist/client/static/js/{erlang-bh5cbm8m.js → erlang-6m6tpt72.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-k5n61zzh.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-f6jpcqyq.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-j4pf6rdn.js → ganttDiagram-FUAMR5RP-nsjv1zt4.js} +2 -2
- package/dist/client/static/js/gitGraph-4MIJSDKK-2gf053bx.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-x5epk0gr.js → gitGraphDiagram-X574FWY7-r4vnkcy3.js} +2 -2
- package/dist/client/static/js/graphql-p4cskvad.js +1 -0
- package/dist/client/static/js/html-f26r6vv5.js +1 -0
- package/dist/client/static/js/{index-c1j0xb0w.js → index-0kxqzafy.js} +1 -1
- package/dist/client/static/js/{index-3kgrcaq1.js → index-11bdd235.js} +1 -1
- package/dist/client/static/js/{index-b48p8d1j.js → index-1qszrvzk.js} +2 -2
- package/dist/client/static/js/{index-3vdmwpbh.js → index-24yyj78e.js} +2 -2
- package/dist/client/static/js/{index-63c6t75t.js → index-2drjp9ks.js} +1 -1
- package/dist/client/static/js/{index-d2km9egp.js → index-2ndq1ngv.js} +4 -4
- package/dist/client/static/js/{index-0j518hqm.js → index-3az1w5f8.js} +2 -2
- package/dist/client/static/js/{index-ye450a7z.js → index-50z4ek83.js} +1 -1
- package/dist/client/static/js/{index-60ceydzn.js → index-5ebhb94w.js} +1 -1
- package/dist/client/static/js/{index-ctgefatv.js → index-5y0bvq4q.js} +34 -34
- package/dist/client/static/js/{index-40ve7zzv.js → index-6ax2z70w.js} +1 -1
- package/dist/client/static/js/{index-9t82sx0w.js → index-6k3e5dph.js} +2 -2
- package/dist/client/static/js/{index-6xzfta4b.js → index-73jwm4d5.js} +1 -1
- package/dist/client/static/js/{index-8cy3x2y8.js → index-7fdp9c7m.js} +2 -2
- package/dist/client/static/js/{index-zvfvqvn9.js → index-9wd9y6m0.js} +2 -2
- package/dist/client/static/js/{index-q5t4sy22.js → index-9wtg6ywn.js} +4 -4
- package/dist/client/static/js/{index-nws03exw.js → index-a74k07z2.js} +2 -2
- package/dist/client/static/js/{index-982jyfsb.js → index-ashpbfqv.js} +2 -2
- package/dist/client/static/js/{index-zp73zexp.js → index-b9b2nwdd.js} +2 -2
- package/dist/client/static/js/{index-h1e1abpt.js → index-c15r8jd3.js} +2 -2
- package/dist/client/static/js/{index-5rzk1226.js → index-da10qpns.js} +2 -2
- package/dist/client/static/js/{index-ky0prc71.js → index-dfgdn3fj.js} +9 -9
- package/dist/client/static/js/{index-c09a5s1n.js → index-dkseg29t.js} +9 -9
- package/dist/client/static/js/{index-w3n97x4b.js → index-dt7e1328.js} +2 -2
- package/dist/client/static/js/{index-sar2ggde.js → index-e1pr3k50.js} +2 -2
- package/dist/client/static/js/{index-0b1kwsam.js → index-fghst0kd.js} +32 -32
- package/dist/client/static/js/{index-af24nes6.js → index-gbfg0anm.js} +2 -2
- package/dist/client/static/js/{index-vtbbfwx0.js → index-gr6jng0x.js} +2 -2
- package/dist/client/static/js/{index-44qrckd2.js → index-gwhx66f4.js} +1 -1
- package/dist/client/static/js/{index-55pqvh82.js → index-h7pn9qw6.js} +2 -2
- package/dist/client/static/js/{index-97t3mv1v.js → index-h8h5c2r8.js} +1 -1
- package/dist/client/static/js/{index-v5t761a1.js → index-ha75kff0.js} +2 -2
- package/dist/client/static/js/{index-ydvfc9td.js → index-hzx81cjq.js} +4 -4
- package/dist/client/static/js/{index-be6gevq8.js → index-k9xsvab3.js} +1 -1
- package/dist/client/static/js/{index-v8qd8ypc.js → index-nd4p98mc.js} +2 -2
- package/dist/client/static/js/{index-dmgawfhw.js → index-qkscve6n.js} +2 -2
- package/dist/client/static/js/{index-w7xbfv44.js → index-qn4pkjfh.js} +2 -2
- package/dist/client/static/js/{index-zdtsvnpq.js → index-r83kr4s5.js} +2 -2
- package/dist/client/static/js/{index-htt8qxm3.js → index-ra38ggke.js} +1 -1
- package/dist/client/static/js/{index-skm6k5w2.js → index-rf0p3v7q.js} +5 -5
- package/dist/client/static/js/{index-7r1hw2gd.js → index-rgp69pa8.js} +1 -1
- package/dist/client/static/js/{index-8e15fzax.js → index-rqrcw8nj.js} +2 -2
- package/dist/client/static/js/{index-63jbb4kf.js → index-sa9cp6km.js} +2 -2
- package/dist/client/static/js/{index-75haaj8g.js → index-st202rjv.js} +184 -184
- package/dist/client/static/js/{index-mm1rf116.js → index-t5t71dhp.js} +2 -2
- package/dist/client/static/js/{index-ktvbsj6w.js → index-tfsaj5d1.js} +2 -2
- package/dist/client/static/js/{index-k1xt92h4.js → index-tv61v3t3.js} +1 -1
- package/dist/client/static/js/index-tzm90bsz.js +1 -0
- package/dist/client/static/js/{index-z6g74h7g.js → index-vb6t44dw.js} +2 -2
- package/dist/client/static/js/{index-pyx8n25s.js → index-vnn7m9yp.js} +3 -3
- package/dist/client/static/js/{index-5kjpacvd.js → index-vxd4gykh.js} +2 -2
- package/dist/client/static/js/{index-r8pckaqe.js → index-xya34x4v.js} +2 -2
- package/dist/client/static/js/{index-a293pdg7.js → index-y3hdv561.js} +2 -2
- package/dist/client/static/js/{index-9gf8b73w.js → index-z0cpp5bc.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-3tr0y3s6.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-ktc8nb8g.js → infoDiagram-VRGFBTTK-e39pvm4j.js} +1 -1
- package/dist/client/static/js/ini-cg0a5wm3.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-n3dk6227.js → ishikawaDiagram-OU5B5YK6-rqhszgvp.js} +2 -2
- package/dist/client/static/js/java-vcck089n.js +1 -0
- package/dist/client/static/js/javascript-nyf39d5r.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-f0p1h8qn.js → journeyDiagram-ZHPQQLJL-wgy5qrsv.js} +3 -3
- package/dist/client/static/js/jsx-ht9zyzwa.js +1 -0
- package/dist/client/static/js/{julia-73zjh2w6.js → julia-237yk557.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-7jdt7dv1.js → kanban-definition-PNTS6WVX-b8bxn0h1.js} +3 -3
- package/dist/client/static/js/lua-86fjqj8v.js +1 -0
- package/dist/client/static/js/markdown-gwmsh53r.js +1 -0
- package/dist/client/static/js/{mermaid.core-e8rzrjt9.js → mermaid.core-vb5ehtre.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-7shv6ge0.js → mindmap-definition-NLK3R4M7-t4p38s38.js} +3 -3
- package/dist/client/static/js/one-dark-pro-dhybn1ff.js +1 -0
- package/dist/client/static/js/one-light-bqg77ay0.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-xbsyjzrh.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-17ak2zx3.js → pegDiagram-GJSIUBJH-3gp4madx.js} +1 -1
- package/dist/client/static/js/{perl-8z46dmze.js → perl-dvz4y1tb.js} +1 -1
- package/dist/client/static/js/{php-6qvnp2t6.js → php-n6y7dzhm.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-j2tpz0cs.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-at4x1g4q.js → pieDiagram-5QR66LMP-0cbm773h.js} +2 -2
- package/dist/client/static/js/properties-mzvvbqg5.js +1 -0
- package/dist/client/static/js/python-3w64wsyd.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-apzhwrn4.js → quadrantDiagram-O4NWA36T-jwg7fc9f.js} +1 -1
- package/dist/client/static/js/r-32re2zwb.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-m3tsyfv0.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-5p202a4q.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-hj0y9tgn.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-8c5dct8f.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-3tx8z65q.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-rw8cj5f3.js → railroadDiagram-XR7U4H2S-38xh691s.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-qyrse7mb.js → requirementDiagram-PLB6GJNP-gpddawxh.js} +4 -4
- package/dist/client/static/js/{ruby-qy8mhstq.js → ruby-7zye3g0e.js} +1 -1
- package/dist/client/static/js/{rust-fpshqnk0.js → rust-bx3ecv4n.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-254qr59q.js → sankeyDiagram-IPEJSGJF-s6t6bbhk.js} +1 -1
- package/dist/client/static/js/{sass-kbwea482.js → sass-m0h9yzfb.js} +1 -1
- package/dist/client/static/js/{scss-zphrqp25.js → scss-2pwwfkvn.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-y9xjxfc5.js → sequenceDiagram-PO4LG4MO-wkq51pmb.js} +3 -3
- package/dist/client/static/js/{sizeCapture-INFHLROL-sc5e60t3.js → sizeCapture-INFHLROL-xtwexf8k.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-r134s4xr.js → stateDiagram-v2-GCMORJYK-jnwsqa7y.js} +3 -3
- package/dist/client/static/js/{svelte-mwtx07d9.js → svelte-x8f8c8hq.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-xc7rbawt.js → swimlanes-2SLR337P-mnkkqcbx.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-6xmrz03n.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-cgjd8shk.js → timeline-definition-EJHVYXUP-rxq6heqh.js} +2 -2
- package/dist/client/static/js/treeView-Q6P3EWNA-mf0rb2yv.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-0x5gf06b.js +1 -0
- package/dist/client/static/js/typescript-5nmrzgkj.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-9qsmjhm6.js → usecaseDiagram-POWQR4AR-dz94f57t.js} +13 -13
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-4grw9awx.js → vennDiagram-UO4OBE2U-5mmvkhsq.js} +1 -1
- package/dist/client/static/js/{vue-j8vb9d7r.js → vue-myjjd0gd.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-x7ej8dms.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-8gxy0wat.js → wardleyDiagram-VNRHLVJA-dctdntpa.js} +1 -1
- package/dist/client/static/js/xml-3dd1pter.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-5sh7tdrx.js → xychartDiagram-PMCCYNJV-njyfrqkv.js} +2 -2
- package/dist/client/static/js/yaml-yssayv8a.js +1 -0
- package/package.json +1 -1
- package/src/client/components/common/ComposerPicker.tsx +24 -12
- package/src/client/components/common/ComposerTextarea.tsx +1 -0
- package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +1 -1
- package/src/client/components/settings/apply-side-effects.test.ts +5 -4
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/index.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.test.tsx +210 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.tsx +342 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/LooseFieldAsk.tsx +44 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.test.tsx +44 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +10 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions.test.ts +1 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts.ts +19 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/form-picks.ts +52 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +53 -4
- package/src/client/components/workspace/model-dropdown/index.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/use-catalog.ts +3 -32
- package/src/client/data/settings/omp-schema.json +55 -1
- package/src/client/hooks/chat/composer/harness-model-picker.ts +84 -0
- package/src/client/hooks/chat/composer/index.ts +26 -6
- package/src/client/hooks/chat/timeline/ask-frames.test.ts +80 -7
- package/src/client/hooks/chat/timeline/ask-frames.ts +95 -21
- package/src/client/hooks/models/use-harnesses.ts +15 -2
- package/src/client/hooks/ui/icon-style.ts +7 -4
- package/src/client/hooks/ui/style-attributes.test.ts +11 -11
- package/src/client/hooks/ui/surface-style.ts +8 -5
- package/src/server/lib/assets/shell-attributes.server.ts +12 -9
- package/src/server/lib/assets/shell-attributes.test.ts +18 -13
- package/src/server/lib/auth/agent-gate.server.ts +64 -0
- package/src/server/lib/auth/agent-tree-gate.test.ts +121 -0
- package/src/server/lib/auth/guard.test.ts +18 -18
- package/src/server/lib/auth/guard.ts +15 -11
- package/src/server/lib/auth/handover-guard.test.ts +1 -1
- package/src/server/lib/changes/attach.server.ts +57 -0
- package/src/server/lib/changes/attach.test.ts +94 -0
- package/src/server/lib/changes/blobs.server.ts +52 -0
- package/src/server/lib/changes/capture-bash.server.ts +106 -0
- package/src/server/lib/changes/capture-fs.server.ts +64 -0
- package/src/server/lib/changes/capture-runs.test.ts +136 -0
- package/src/server/lib/changes/capture-test-util.ts +46 -0
- package/src/server/lib/changes/capture-types.ts +62 -0
- package/src/server/lib/changes/capture.server.ts +333 -0
- package/src/server/lib/changes/capture.test.ts +245 -0
- package/src/server/lib/changes/classify-command.test.ts +172 -0
- package/src/server/lib/changes/classify-command.ts +272 -0
- package/src/server/lib/changes/classify-git.ts +88 -0
- package/src/server/lib/changes/classify-paths.ts +112 -0
- package/src/server/lib/changes/classify-tokenize.ts +185 -0
- package/src/server/lib/changes/journal.server.ts +183 -0
- package/src/server/lib/changes/journal.test.ts +125 -0
- package/src/server/lib/changes/merge.test.ts +137 -0
- package/src/server/lib/changes/paths.server.ts +37 -0
- package/src/server/lib/changes/purge.server.ts +32 -0
- package/src/server/lib/changes/reader.server.ts +322 -0
- package/src/server/lib/changes/reader.test.ts +137 -0
- package/src/server/lib/changes/records.ts +120 -0
- package/src/server/lib/changes/scan.server.ts +89 -0
- package/src/server/lib/harness/register.server.ts +3 -0
- package/src/server/lib/omp/rpc/event-fanout.test.ts +58 -0
- package/src/server/lib/omp/rpc/event-fanout.ts +19 -0
- package/src/server/lib/omp/rpc/manager.ts +4 -3
- package/src/server/lib/omp/rpc/session-registration.ts +5 -0
- package/src/server/lib/omp/rpc/session-registry.ts +4 -5
- package/src/server/lib/omp/session/delete.server.ts +4 -0
- package/src/server/lib/sessions/agent-token.server.test.ts +28 -5
- package/src/server/lib/sessions/agent-token.server.ts +42 -6
- package/src/server/lib/sessions/relation-access.server.test.ts +96 -0
- package/src/server/lib/sessions/relation-access.server.ts +71 -0
- package/src/server/routes/sessions/changes.ts +1 -1
- package/src/shared/lib/chat/ask-form/fields.ts +1 -0
- package/src/shared/lib/chat/ask-form/types.ts +6 -0
- package/src/shared/lib/chat/ask-questions.ts +56 -3
- package/src/shared/lib/chat/composer/delegation.ts +2 -13
- package/src/shared/lib/chat/composer/filter.test.ts +39 -0
- package/src/shared/lib/chat/composer/filter.ts +23 -13
- package/src/shared/lib/chat/composer/harness-model-items.test.ts +54 -0
- package/src/shared/lib/chat/composer/harness-model-items.ts +41 -0
- package/src/shared/lib/chat/composer/trigger.test.ts +50 -0
- package/src/shared/lib/chat/composer/trigger.ts +29 -1
- package/src/shared/lib/chat/timeline/changed-files.test.ts +16 -0
- package/src/shared/lib/chat/timeline/changed-files.ts +102 -25
- package/src/shared/lib/harness/catalog.ts +21 -0
- package/src/{client/components/workspace/model-dropdown/harness-models.test.ts → shared/lib/harness/models.test.ts} +1 -1
- package/src/shared/lib/icons/icon-paint-authority.ts +5 -3
- package/src/shared/lib/models/option.ts +46 -0
- package/src/shared/lib/omp/config/schema.test.ts +20 -0
- package/src/shared/lib/theme/icon-style.test.ts +8 -5
- package/src/shared/lib/theme/icon-style.ts +15 -7
- package/src/shared/lib/theme/surface-style.test.ts +8 -5
- package/src/shared/lib/theme/surface-style.ts +17 -7
- package/src/shared/lib/workspace/sidebar-style.test.ts +7 -8
- package/src/shared/lib/workspace/sidebar-style.ts +7 -8
- package/src/shared/types/chat.ts +12 -6
- package/src/shared/types/omp/agent.ts +9 -0
- package/src/shared/types/session-changes.ts +4 -0
- package/dist/client/static/js/architecture-7GRP2DOG-aqft2erp.js +0 -1
- package/dist/client/static/js/c-wkgxb1t1.js +0 -1
- package/dist/client/static/js/cpp-y0t6mynx.js +0 -1
- package/dist/client/static/js/css-r2nhvzff.js +0 -1
- package/dist/client/static/js/css-tf1s0nb7.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-v2sz60t6.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-8qbefe4m.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-krsvgcq7.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-9bx1a38k.js +0 -1
- package/dist/client/static/js/graphql-xnpp5gn9.js +0 -1
- package/dist/client/static/js/html-pv88ny12.js +0 -1
- package/dist/client/static/js/index-dh1vd0d9.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-j51t7jhh.js +0 -1
- package/dist/client/static/js/ini-ygfyhprj.js +0 -1
- package/dist/client/static/js/java-gm49vw59.js +0 -1
- package/dist/client/static/js/javascript-4kw2j9t3.js +0 -1
- package/dist/client/static/js/jsx-ksxw1byz.js +0 -1
- package/dist/client/static/js/lua-53gzb9bx.js +0 -1
- package/dist/client/static/js/markdown-tk3cd3vs.js +0 -1
- package/dist/client/static/js/one-dark-pro-39bt34v9.js +0 -1
- package/dist/client/static/js/one-light-xec0sehr.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-n83gfj2g.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-5c5pctwz.js +0 -1
- package/dist/client/static/js/properties-2tcybqjk.js +0 -1
- package/dist/client/static/js/python-qph3dntq.js +0 -1
- package/dist/client/static/js/r-gd26x93y.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-52e5n99a.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-44nqxxpy.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-25jxgwg7.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-64pqpf2y.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-0p5sxzpx.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-kdcdamkj.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-8j14nnd1.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-esf993kk.js +0 -1
- package/dist/client/static/js/typescript-0s2t05jj.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-v4dxm2sb.js +0 -1
- package/dist/client/static/js/xml-0py2vkw7.js +0 -1
- package/dist/client/static/js/yaml-vghdz0f0.js +0 -1
- /package/src/{client/components/workspace/model-dropdown/harness-models.ts → shared/lib/harness/models.ts} +0 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The GROUPED control for omp 18.18.3's per-field `ask` walk.
|
|
8
|
+
*
|
|
9
|
+
* That tool takes one HTML form, but the RPC host has no `formDialog` member,
|
|
10
|
+
* so omp walks the form's named controls one blocking dialog at a time — a
|
|
11
|
+
* question the user could only answer by filling the card one field per round
|
|
12
|
+
* trip. This component restores the grouped shape from omp's own
|
|
13
|
+
* `method:"ask"` dialog: every question is drawn and answered on the card, and
|
|
14
|
+
* ONE Submit sends the answers by walking the frames omp raises for them.
|
|
15
|
+
*
|
|
16
|
+
* The submit is a small state machine, because the wire is still per-field:
|
|
17
|
+
* answering the live dialog makes omp ask the next field, so each new frame is
|
|
18
|
+
* answered from the collected picks as it arrives. A multi-select is re-asked
|
|
19
|
+
* once per toggle (`selectionMarker: "checkbox"`), so its labels are sent one
|
|
20
|
+
* per frame and the "Done selecting" row ends it; a typed answer is sent to
|
|
21
|
+
* the `input`/`editor` frame the "Other" row opens.
|
|
22
|
+
*
|
|
23
|
+
* Answer labels are matched against the FRAME's rows, never the parsed
|
|
24
|
+
* question: omp decorates them (` (Recommended)`, `Other (type your own)`,
|
|
25
|
+
* `✓ Done selecting`) and compares a response against those exact strings.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { useEffect, useRef, useState } from 'preact/hooks';
|
|
29
|
+
import type { ComponentChildren } from 'preact';
|
|
30
|
+
import { AlertTriangle, Check, CornerDownLeft, HelpCircle } from 'lucide-preact';
|
|
31
|
+
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
32
|
+
import type { AskAnswer, AskQuestion } from '@/shared/lib/chat/ask-form/types';
|
|
33
|
+
import { isOtherOption } from '@/shared/lib/chat/ask-questions';
|
|
34
|
+
import { AnswerList, QuestionCard } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard';
|
|
35
|
+
import { OptionRow } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow';
|
|
36
|
+
import { liveFrame } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts';
|
|
37
|
+
import { DONE_ROW, optionForLabel, partsFor, type Pick } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/form-picks';
|
|
38
|
+
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
39
|
+
|
|
40
|
+
interface FormAskProps {
|
|
41
|
+
questions: AskQuestion[];
|
|
42
|
+
/** Dialogs per question, oldest first — the last one is live. */
|
|
43
|
+
groups: ExtensionUiDialogRequest[][];
|
|
44
|
+
/** Answers omp already recorded; those questions render settled. */
|
|
45
|
+
recorded: (AskAnswer | null)[];
|
|
46
|
+
/** Owned field dialogs whose title and rows both missed. */
|
|
47
|
+
loose: ExtensionUiDialogRequest[];
|
|
48
|
+
onRespond: (request: ExtensionUiDialogRequest, response: ExtensionDialogResponse) => void;
|
|
49
|
+
interactions?: ComponentChildren;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type Phase = 'editing' | 'sending' | 'failed';
|
|
53
|
+
|
|
54
|
+
/** omp rejects a typed answer with the question and a reason; give up after 3. */
|
|
55
|
+
const MAX_TEXT_ATTEMPTS = 3;
|
|
56
|
+
|
|
57
|
+
export function FormAsk({ questions, groups, recorded, loose, onRespond, interactions }: FormAskProps) {
|
|
58
|
+
const [picks, setPicks] = useState<Record<number, Pick>>(() => {
|
|
59
|
+
const initial: Record<number, Pick> = {};
|
|
60
|
+
questions.forEach((question, index) => {
|
|
61
|
+
const checked = question.options.filter((option) => option.checked).map((option) => option.label);
|
|
62
|
+
const selected = question.multi === true ? checked : checked.slice(0, 1);
|
|
63
|
+
if (selected.length > 0) initial[index] = { selected, text: '' };
|
|
64
|
+
});
|
|
65
|
+
return initial;
|
|
66
|
+
});
|
|
67
|
+
const picksRef = useRef(picks);
|
|
68
|
+
picksRef.current = picks;
|
|
69
|
+
const [phase, setPhase] = useState<Phase>('editing');
|
|
70
|
+
const [failure, setFailure] = useState<string | null>(null);
|
|
71
|
+
// Frame ids already answered, so a re-render cannot answer one twice.
|
|
72
|
+
const sentRef = useRef<Set<string>>(new Set());
|
|
73
|
+
// Per-question progress through a multi-select's labels and its Other flow.
|
|
74
|
+
const cursorRef = useRef<Record<number, number>>({});
|
|
75
|
+
const otherRef = useRef<Record<number, boolean>>({});
|
|
76
|
+
const attemptsRef = useRef<Record<number, number>>({});
|
|
77
|
+
|
|
78
|
+
const pickFor = (index: number): Pick => picks[index] ?? { selected: [], text: '' };
|
|
79
|
+
|
|
80
|
+
const toggle = (index: number, label: string, multi: boolean) => {
|
|
81
|
+
setPicks((current) => {
|
|
82
|
+
const pick = current[index] ?? { selected: [], text: '' };
|
|
83
|
+
const selected = multi
|
|
84
|
+
? (pick.selected.includes(label)
|
|
85
|
+
? pick.selected.filter((item) => item !== label)
|
|
86
|
+
: [...pick.selected, label])
|
|
87
|
+
: [label];
|
|
88
|
+
return { ...current, [index]: { ...pick, selected } };
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const setText = (index: number, text: string) => {
|
|
93
|
+
setPicks((current) => ({ ...current, [index]: { ...(current[index] ?? { selected: [] }), text } }));
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const answerFor = (index: number): AskAnswer | null => {
|
|
97
|
+
const recordedAnswer = recorded[index] ?? null;
|
|
98
|
+
if (recordedAnswer) return recordedAnswer;
|
|
99
|
+
// Only the in-flight phase shows the picks as sent; `failed` hands the
|
|
100
|
+
// controls back so the answer that omp rejected can be fixed.
|
|
101
|
+
if (phase !== 'sending') return null;
|
|
102
|
+
const pick = pickFor(index);
|
|
103
|
+
if (pick.selected.length === 0 && !pick.text.trim()) return null;
|
|
104
|
+
return {
|
|
105
|
+
selectedOptions: pick.selected,
|
|
106
|
+
...(pick.text.trim() ? { customInput: pick.text.trim() } : {}),
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const hasAnswer = (index: number): boolean => {
|
|
111
|
+
if (recorded[index]) return true;
|
|
112
|
+
const pick = pickFor(index);
|
|
113
|
+
return pick.selected.length > 0 || pick.text.trim().length > 0;
|
|
114
|
+
};
|
|
115
|
+
const ready = questions.every((_, index) => hasAnswer(index));
|
|
116
|
+
|
|
117
|
+
// The submit: answer the live frame for each question as omp raises it. A
|
|
118
|
+
// frame with no question bucket is used by the first question still waiting
|
|
119
|
+
// when it is the only one left — that is what keeps a drifted title on the
|
|
120
|
+
// card instead of leaving the run parked.
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (phase !== 'sending') return;
|
|
123
|
+
const fail = (message: string) => {
|
|
124
|
+
setFailure(message);
|
|
125
|
+
setPhase('failed');
|
|
126
|
+
};
|
|
127
|
+
for (let index = 0; index < questions.length; index += 1) {
|
|
128
|
+
if (recorded[index]) continue;
|
|
129
|
+
const question = questions[index];
|
|
130
|
+
let frame = liveFrame(groups, index);
|
|
131
|
+
if (!frame) {
|
|
132
|
+
const remaining = loose.filter((candidate) => !sentRef.current.has(candidate.id));
|
|
133
|
+
const wanted = question.kind === 'text' ? ['input', 'editor'] : ['select'];
|
|
134
|
+
const only = remaining.filter((candidate) => wanted.includes(candidate.method));
|
|
135
|
+
if (remaining.length === 1 && only.length === 1) frame = only[0];
|
|
136
|
+
}
|
|
137
|
+
if (!frame || sentRef.current.has(frame.id)) continue;
|
|
138
|
+
const pick = picksRef.current[index] ?? { selected: [], text: '' };
|
|
139
|
+
const send = (response: ExtensionDialogResponse) => {
|
|
140
|
+
sentRef.current.add(frame!.id);
|
|
141
|
+
onRespond(frame!, response);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
if (frame.method === 'input' || frame.method === 'editor') {
|
|
145
|
+
const text = pick.text.trim();
|
|
146
|
+
if (!text) return fail(`Question ${index + 1} has no typed answer.`);
|
|
147
|
+
const attempts = attemptsRef.current[index] ?? 0;
|
|
148
|
+
if (attempts >= MAX_TEXT_ATTEMPTS) {
|
|
149
|
+
return fail(`omp rejected the answer to question ${index + 1} ${MAX_TEXT_ATTEMPTS} times. Fix it and submit again.`);
|
|
150
|
+
}
|
|
151
|
+
attemptsRef.current[index] = attempts + 1;
|
|
152
|
+
send({ value: text });
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (frame.method !== 'select') continue;
|
|
157
|
+
const options = frame.options ?? [];
|
|
158
|
+
|
|
159
|
+
if (question.multi !== true) {
|
|
160
|
+
const label = optionForLabel(options, pick.selected[0]);
|
|
161
|
+
if (label) {
|
|
162
|
+
send({ value: label });
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
const other = options.find(isOtherOption);
|
|
166
|
+
if (pick.text.trim() && other) {
|
|
167
|
+
// Picking the row is what opens omp's free-text dialog; the text is
|
|
168
|
+
// sent to the `input` frame that follows.
|
|
169
|
+
if (!otherRef.current[index]) {
|
|
170
|
+
otherRef.current[index] = true;
|
|
171
|
+
send({ value: other });
|
|
172
|
+
}
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
return fail(`Question ${index + 1} has no choice omp is offering.`);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// A multi-select starts from whatever the form marked `checked`, so a
|
|
179
|
+
// response is only sent for a row whose state DIFFERS from the frame's
|
|
180
|
+
// own `checkedIndices` — sending a checked row would toggle it OFF.
|
|
181
|
+
const wanted = new Set<string>();
|
|
182
|
+
for (const label of pick.selected) {
|
|
183
|
+
if (isOtherOption(label)) continue;
|
|
184
|
+
const row = optionForLabel(options, label);
|
|
185
|
+
if (!row) return fail(`Question ${index + 1} has no row "${label}".`);
|
|
186
|
+
wanted.add(row);
|
|
187
|
+
}
|
|
188
|
+
if (Array.isArray(frame.checkedIndices)) {
|
|
189
|
+
const on = new Set(frame.checkedIndices.map((row) => options[row]).filter(Boolean));
|
|
190
|
+
const ownRows = new Set(
|
|
191
|
+
question.options
|
|
192
|
+
.filter((option) => !isOtherOption(option.label))
|
|
193
|
+
.map((option) => optionForLabel(options, option.label))
|
|
194
|
+
.filter((row): row is string => Boolean(row)),
|
|
195
|
+
);
|
|
196
|
+
const needOn = [...wanted].filter((row) => ownRows.has(row) && !on.has(row));
|
|
197
|
+
const needOff = [...on].filter((row) => ownRows.has(row) && !wanted.has(row));
|
|
198
|
+
const next = needOn[0] ?? needOff[0];
|
|
199
|
+
if (next) {
|
|
200
|
+
send({ value: next });
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
} else {
|
|
204
|
+
// Older children send no `checkedIndices`; each label is one toggle and
|
|
205
|
+
// the cursor is all the progress there is.
|
|
206
|
+
const cursor = cursorRef.current[index] ?? 0;
|
|
207
|
+
const rows = [...wanted];
|
|
208
|
+
if (cursor < rows.length) {
|
|
209
|
+
cursorRef.current[index] = cursor + 1;
|
|
210
|
+
send({ value: rows[cursor] });
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const other = options.find(isOtherOption);
|
|
215
|
+
if (pick.text.trim() && other && !otherRef.current[index]) {
|
|
216
|
+
otherRef.current[index] = true;
|
|
217
|
+
send({ value: other });
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
const done = options.find((option) => DONE_ROW.test(option));
|
|
221
|
+
if (!done) return fail(`Question ${index + 1} has no "Done selecting" row.`);
|
|
222
|
+
send({ value: done });
|
|
223
|
+
}
|
|
224
|
+
}, [phase, groups, loose, recorded, questions, onRespond]);
|
|
225
|
+
|
|
226
|
+
const submit = () => {
|
|
227
|
+
sentRef.current = new Set();
|
|
228
|
+
cursorRef.current = {};
|
|
229
|
+
otherRef.current = {};
|
|
230
|
+
attemptsRef.current = {};
|
|
231
|
+
setFailure(null);
|
|
232
|
+
setPhase('sending');
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const live = groups.map((frames) => (frames.length > 0 ? frames[frames.length - 1] : null)).find(Boolean) ?? loose[0] ?? null;
|
|
236
|
+
const sending = phase === 'sending';
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<div className="space-y-2">
|
|
240
|
+
{questions.map((question, index) => {
|
|
241
|
+
const answer = answerFor(index);
|
|
242
|
+
const pick = pickFor(index);
|
|
243
|
+
return (
|
|
244
|
+
<QuestionCard
|
|
245
|
+
key={question.id ?? index}
|
|
246
|
+
index={index}
|
|
247
|
+
total={questions.length}
|
|
248
|
+
header={question.header}
|
|
249
|
+
question={question.question}
|
|
250
|
+
multi={question.multi === true}
|
|
251
|
+
answered={answer !== null}
|
|
252
|
+
>
|
|
253
|
+
{answer !== null ? (
|
|
254
|
+
<AnswerList parts={partsFor(question, pick, recorded[index] ?? null)} />
|
|
255
|
+
) : (
|
|
256
|
+
<>
|
|
257
|
+
{question.kind === 'text' ? (
|
|
258
|
+
<textarea
|
|
259
|
+
rows={3}
|
|
260
|
+
value={pick.text}
|
|
261
|
+
disabled={sending}
|
|
262
|
+
placeholder="Type your answer…"
|
|
263
|
+
aria-label={`Your answer for question ${index + 1}`}
|
|
264
|
+
onInput={(event) => setText(index, event.currentTarget.value)}
|
|
265
|
+
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"
|
|
266
|
+
/>
|
|
267
|
+
) : (
|
|
268
|
+
<>
|
|
269
|
+
<div className="mt-2 space-y-1" role={question.multi === true ? 'group' : 'radiogroup'}>
|
|
270
|
+
{question.options.filter((option) => !isOtherOption(option.label)).map((option, optionIndex) => (
|
|
271
|
+
<OptionRow
|
|
272
|
+
key={option.label}
|
|
273
|
+
label={option.label}
|
|
274
|
+
description={option.description}
|
|
275
|
+
multi={question.multi === true}
|
|
276
|
+
checked={pick.selected.includes(option.label)}
|
|
277
|
+
suggested={question.recommended === optionIndex}
|
|
278
|
+
disabled={sending}
|
|
279
|
+
onClick={() => toggle(index, option.label, question.multi === true)}
|
|
280
|
+
/>
|
|
281
|
+
))}
|
|
282
|
+
</div>
|
|
283
|
+
<input
|
|
284
|
+
type="text"
|
|
285
|
+
value={pick.text}
|
|
286
|
+
disabled={sending}
|
|
287
|
+
placeholder="Or type your own…"
|
|
288
|
+
aria-label={`Your own answer for question ${index + 1}`}
|
|
289
|
+
onInput={(event) => setText(index, event.currentTarget.value)}
|
|
290
|
+
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"
|
|
291
|
+
/>
|
|
292
|
+
</>
|
|
293
|
+
)}
|
|
294
|
+
</>
|
|
295
|
+
)}
|
|
296
|
+
</QuestionCard>
|
|
297
|
+
);
|
|
298
|
+
})}
|
|
299
|
+
|
|
300
|
+
{interactions}
|
|
301
|
+
|
|
302
|
+
{failure && (
|
|
303
|
+
<div className="flex items-start gap-1.5 text-[10.5px] text-error">
|
|
304
|
+
<AlertTriangle size={11} className="mt-0.5 shrink-0" />
|
|
305
|
+
<span>{failure}</span>
|
|
306
|
+
</div>
|
|
307
|
+
)}
|
|
308
|
+
|
|
309
|
+
<div className="flex items-center gap-2">
|
|
310
|
+
{sending ? (
|
|
311
|
+
<span className="flex items-center gap-1.5 text-[10.5px] text-ink/50">
|
|
312
|
+
<HelpCircle size={11} className="shrink-0" />
|
|
313
|
+
<span>Sending your answers — the agent is blocked until the form completes.</span>
|
|
314
|
+
</span>
|
|
315
|
+
) : (
|
|
316
|
+
<span className="text-[10.5px] text-ink/45">Answer every question, then submit once.</span>
|
|
317
|
+
)}
|
|
318
|
+
<div className="ml-auto flex items-center gap-2">
|
|
319
|
+
<button
|
|
320
|
+
type="button"
|
|
321
|
+
disabled={sending || !live}
|
|
322
|
+
onClick={() => {
|
|
323
|
+
if (live) onRespond(live, { cancelled: true });
|
|
324
|
+
}}
|
|
325
|
+
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"
|
|
326
|
+
>
|
|
327
|
+
Dismiss
|
|
328
|
+
</button>
|
|
329
|
+
<button
|
|
330
|
+
type="button"
|
|
331
|
+
disabled={sending || !ready}
|
|
332
|
+
onClick={submit}
|
|
333
|
+
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"
|
|
334
|
+
>
|
|
335
|
+
{sending ? <Check size={11} /> : <CornerDownLeft size={11} />}
|
|
336
|
+
<span>Submit answers</span>
|
|
337
|
+
</button>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
);
|
|
342
|
+
}
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/LooseFieldAsk.tsx
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A field dialog that matched NO question of the ask card, drawn where it is
|
|
8
|
+
* answerable. The card owns the frame (see `looseByTool`) because the modal has
|
|
9
|
+
* no ask body; this is the last resort before the agent stays parked.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useState } from 'preact/hooks';
|
|
13
|
+
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
14
|
+
import { FrameControl } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FrameControl';
|
|
15
|
+
import { QuestionCard } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard';
|
|
16
|
+
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
17
|
+
|
|
18
|
+
export function LooseFieldAsk({
|
|
19
|
+
frame,
|
|
20
|
+
onRespond,
|
|
21
|
+
}: {
|
|
22
|
+
frame: ExtensionUiDialogRequest;
|
|
23
|
+
onRespond: (request: ExtensionUiDialogRequest, response: ExtensionDialogResponse) => void;
|
|
24
|
+
}) {
|
|
25
|
+
const [selected, setSelected] = useState<string[]>([]);
|
|
26
|
+
const multi = frame.selectionMarker === 'checkbox';
|
|
27
|
+
return (
|
|
28
|
+
<QuestionCard index={0} total={1} question={frame.title || 'Input needed'} multi={multi}>
|
|
29
|
+
<FrameControl
|
|
30
|
+
frame={frame}
|
|
31
|
+
multi={multi}
|
|
32
|
+
selected={selected}
|
|
33
|
+
onAnswer={(value) => onRespond(frame, { value })}
|
|
34
|
+
onToggle={(label) => {
|
|
35
|
+
setSelected((current) => (
|
|
36
|
+
current.includes(label) ? current.filter((item) => item !== label) : [...current, label]
|
|
37
|
+
));
|
|
38
|
+
onRespond(frame, { value: label });
|
|
39
|
+
}}
|
|
40
|
+
onRespond={(response) => onRespond(frame, response)}
|
|
41
|
+
/>
|
|
42
|
+
</QuestionCard>
|
|
43
|
+
);
|
|
44
|
+
}
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.test.tsx
CHANGED
|
@@ -66,7 +66,7 @@ describe('an ask dialog with no tool card', () => {
|
|
|
66
66
|
|
|
67
67
|
test('renders inline with every question and its own submit', () => {
|
|
68
68
|
const split = splitWithoutCards([ORPHAN]);
|
|
69
|
-
const handle: AskFramesHandle = { framesByTool: split.framesByTool, orphanAsks: split.orphanAsks, respond: () => {} };
|
|
69
|
+
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: split.orphanAsks, respond: () => {} };
|
|
70
70
|
|
|
71
71
|
act(() => {
|
|
72
72
|
render(h(AskFramesContext.Provider, { value: handle }, h(OrphanAsks, {})), container);
|
|
@@ -86,6 +86,7 @@ describe('an ask dialog with no tool card', () => {
|
|
|
86
86
|
const split = splitWithoutCards([ORPHAN]);
|
|
87
87
|
const handle: AskFramesHandle = {
|
|
88
88
|
framesByTool: split.framesByTool,
|
|
89
|
+
looseByTool: split.looseByTool,
|
|
89
90
|
orphanAsks: split.orphanAsks,
|
|
90
91
|
respond: (_request, response) => sent.push(response),
|
|
91
92
|
};
|
|
@@ -124,4 +125,46 @@ describe('an ask dialog with no tool card', () => {
|
|
|
124
125
|
expect(split.modalRequest).toBe(gate);
|
|
125
126
|
expect(split.orphanAsks).toEqual([]);
|
|
126
127
|
});
|
|
128
|
+
|
|
129
|
+
test('a per-field dialog of a failed ask is drawn inline, not as a modal', () => {
|
|
130
|
+
// omp 18.18.3 walks the ask HTML form one field at a time, so the stray
|
|
131
|
+
// frame is an ordinary `select` — not `method:"ask"`. It still has no card
|
|
132
|
+
// when its tool call already failed, and the modal has no ask body for it.
|
|
133
|
+
const field: ExtensionUiDialogRequest = {
|
|
134
|
+
type: 'extension_ui_request',
|
|
135
|
+
id: 'field-1',
|
|
136
|
+
method: 'select',
|
|
137
|
+
title: 'Pick colors',
|
|
138
|
+
options: ['red', 'green', 'Other (type your own)'],
|
|
139
|
+
};
|
|
140
|
+
const history = [{
|
|
141
|
+
id: 'm1',
|
|
142
|
+
role: 'ai',
|
|
143
|
+
content: '',
|
|
144
|
+
toolCalls: [{
|
|
145
|
+
id: 'call-dead',
|
|
146
|
+
type: 'ask',
|
|
147
|
+
name: 'ask',
|
|
148
|
+
title: 'ask',
|
|
149
|
+
status: 'error',
|
|
150
|
+
input: { questions: [{ id: 'q1', question: 'Pick colors', options: [{ label: 'red' }, { label: 'green' }] }] },
|
|
151
|
+
}],
|
|
152
|
+
}] as unknown as Parameters<typeof splitAskFrames>[0];
|
|
153
|
+
const split = splitAskFrames(history, [field], true);
|
|
154
|
+
|
|
155
|
+
expect(split.modalRequest).toBeNull();
|
|
156
|
+
expect(split.orphanAsks).toEqual([field]);
|
|
157
|
+
|
|
158
|
+
const handle: AskFramesHandle = {
|
|
159
|
+
framesByTool: split.framesByTool,
|
|
160
|
+
looseByTool: split.looseByTool,
|
|
161
|
+
orphanAsks: split.orphanAsks,
|
|
162
|
+
respond: () => {},
|
|
163
|
+
};
|
|
164
|
+
act(() => { render(h(AskFramesContext.Provider, { value: handle }, h(OrphanAsks, {})), container); });
|
|
165
|
+
|
|
166
|
+
expect(container.textContent).toContain('Pick colors');
|
|
167
|
+
expect(container.textContent).toContain('green');
|
|
168
|
+
expect(container.querySelector('[role="dialog"]')).toBeNull();
|
|
169
|
+
});
|
|
127
170
|
});
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx
CHANGED
|
@@ -31,6 +31,7 @@ import { HelpCircle } from 'lucide-preact';
|
|
|
31
31
|
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
32
32
|
import { useAskFrames } from '@/client/hooks/chat/timeline/ask-frames';
|
|
33
33
|
import { GroupedAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk';
|
|
34
|
+
import { LooseFieldAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/LooseFieldAsk';
|
|
34
35
|
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
35
36
|
|
|
36
37
|
/** One orphan ask, rendered as a self-contained card at the end of the timeline. */
|
|
@@ -44,11 +45,15 @@ function OrphanAskCard({ frame, onRespond }: {
|
|
|
44
45
|
<HelpCircle size={11} className="shrink-0" />
|
|
45
46
|
<span>Input needed: the agent is blocked until you answer.</span>
|
|
46
47
|
</div>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
{frame.questions && frame.questions.length > 0 ? (
|
|
49
|
+
<GroupedAsk
|
|
50
|
+
frame={frame}
|
|
51
|
+
recorded={(frame.questions ?? []).map(() => null)}
|
|
52
|
+
onRespond={(response) => onRespond(frame, response)}
|
|
53
|
+
/>
|
|
54
|
+
) : (
|
|
55
|
+
<LooseFieldAsk frame={frame} onRespond={onRespond} />
|
|
56
|
+
)}
|
|
52
57
|
</div>
|
|
53
58
|
);
|
|
54
59
|
}
|
|
@@ -111,6 +111,7 @@ afterAll(() => restoreDomGlobals());
|
|
|
111
111
|
function mount(tool: ToolCallData, groups: ExtensionUiDialogRequest[][]): void {
|
|
112
112
|
const handle: AskFramesHandle = {
|
|
113
113
|
framesByTool: new Map([[tool.id, groups]]),
|
|
114
|
+
looseByTool: new Map(),
|
|
114
115
|
orphanAsks: [],
|
|
115
116
|
respond: (request, response) => calls.push({ request, response }),
|
|
116
117
|
};
|
|
@@ -68,6 +68,25 @@ export function useAskDrafts({ toolId, questions, groups, recorded, respond }: U
|
|
|
68
68
|
const [drafts, setDrafts] = useState<Record<number, string>>(() => loadDrafts(toolId));
|
|
69
69
|
const [multiSelected, setMultiSelected] = useState<Record<number, string[]>>({});
|
|
70
70
|
const sentRef = useRef<Set<string>>(new Set());
|
|
71
|
+
// Frames whose checked rows have already seeded the display.
|
|
72
|
+
const syncedRef = useRef<Set<string>>(new Set());
|
|
73
|
+
|
|
74
|
+
// A checkbox the form marks `checked` starts ON, and the frame reports it in
|
|
75
|
+
// `checkedIndices`. Drawing an empty set made the first click SEND that label
|
|
76
|
+
// — toggling the default OFF — while the card showed it as selected.
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
for (let index = 0; index < questions.length; index += 1) {
|
|
79
|
+
if (questions[index].multi !== true) continue;
|
|
80
|
+
const frame = liveFrame(groups, index);
|
|
81
|
+
if (!frame || frame.method !== 'select' || !Array.isArray(frame.checkedIndices)) continue;
|
|
82
|
+
if (syncedRef.current.has(frame.id)) continue;
|
|
83
|
+
syncedRef.current.add(frame.id);
|
|
84
|
+
const checked = frame.checkedIndices
|
|
85
|
+
.map((row) => frame.options?.[row])
|
|
86
|
+
.filter((label): label is string => typeof label === 'string');
|
|
87
|
+
setMultiSelected((current) => ({ ...current, [index]: checked }));
|
|
88
|
+
}
|
|
89
|
+
}, [questions, groups]);
|
|
71
90
|
|
|
72
91
|
useEffect(() => {
|
|
73
92
|
for (let index = 0; index < questions.length; index += 1) {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Answer bookkeeping shared by the grouped ask form: what the user picked, the
|
|
8
|
+
* frame row that pick names, and the rows it is drawn as.
|
|
9
|
+
*
|
|
10
|
+
* omp compares a response against the labels IT offered — decorated with
|
|
11
|
+
* ` (Recommended)`, `Other (type your own)` and the multi-select action row — so
|
|
12
|
+
* the picked label is always mapped through the live frame's own list. Drawing
|
|
13
|
+
* the answer is the inverse rule: a single choice sent one row, and the card
|
|
14
|
+
* must not print a typed draft beside it as if both went out.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { AskAnswer, AskQuestion } from '@/shared/lib/chat/ask-form/types';
|
|
18
|
+
import { isOtherOption } from '@/shared/lib/chat/ask-questions';
|
|
19
|
+
|
|
20
|
+
export interface Pick {
|
|
21
|
+
selected: string[];
|
|
22
|
+
text: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** `✓ Done selecting` / `Done selecting` — the row that ends a multi pick. */
|
|
26
|
+
export const DONE_ROW = /\bdone\b/i;
|
|
27
|
+
|
|
28
|
+
function normalize(value: string): string {
|
|
29
|
+
return value.replace(/\s+/g, ' ').trim().toLowerCase();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The frame's own row for a picked label, including omp's decorations. */
|
|
33
|
+
export function optionForLabel(options: string[], wanted: string | undefined): string | undefined {
|
|
34
|
+
if (!wanted) return undefined;
|
|
35
|
+
const needle = normalize(wanted);
|
|
36
|
+
return (
|
|
37
|
+
options.find((option) => normalize(option) === needle) ??
|
|
38
|
+
options.find((option) => !isOtherOption(option) && normalize(option).startsWith(`${needle} (`)) ??
|
|
39
|
+
options.find((option) => !isOtherOption(option) && normalize(option).startsWith(needle))
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The rows an answer is drawn as: omp's recorded one, else the local pick. */
|
|
44
|
+
export function partsFor(question: AskQuestion, pick: Pick | undefined, answer: AskAnswer | null): string[] {
|
|
45
|
+
if (answer) return [...answer.selectedOptions, ...(answer.customInput ? [answer.customInput] : [])];
|
|
46
|
+
if (!pick) return [];
|
|
47
|
+
const text = pick.text.trim();
|
|
48
|
+
if (question.multi === true) return [...pick.selected, ...(text ? [text] : [])];
|
|
49
|
+
if (question.kind === 'text') return text ? [text] : [];
|
|
50
|
+
const selected = pick.selected[0];
|
|
51
|
+
return selected ? [selected] : text ? [text] : [];
|
|
52
|
+
}
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts
CHANGED
|
@@ -46,7 +46,7 @@ function mountFromFrame(frame: IncomingExtensionUiRequest): ExtensionUiDialogReq
|
|
|
46
46
|
createOmpAgentCallbacks(deps).onExtensionUiRequest?.(frame);
|
|
47
47
|
|
|
48
48
|
const split = splitAskFrames([MESSAGE], queue, true);
|
|
49
|
-
const handle: AskFramesHandle = { framesByTool: split.framesByTool, orphanAsks: [], respond: () => {} };
|
|
49
|
+
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: [], respond: () => {} };
|
|
50
50
|
act(() => { render(h(AskFramesContext.Provider, { value: handle }, h(AskPanel, { tool: ASK_TOOL })), container); });
|
|
51
51
|
return queue;
|
|
52
52
|
}
|
|
@@ -54,7 +54,7 @@ function mountFromFrame(frame: IncomingExtensionUiRequest): ExtensionUiDialogReq
|
|
|
54
54
|
/** Mount the card with an explicit frame queue and tool, keeping it mounted. */
|
|
55
55
|
function paint(queue: ExtensionUiDialogRequest[], tool: ToolCallData = ASK_TOOL): void {
|
|
56
56
|
const split = splitAskFrames([MESSAGE], queue, true);
|
|
57
|
-
const handle: AskFramesHandle = { framesByTool: split.framesByTool, orphanAsks: [], respond: () => {} };
|
|
57
|
+
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: [], respond: () => {} };
|
|
58
58
|
act(() => { render(h(AskFramesContext.Provider, { value: handle }, h(AskPanel, { tool })), container); });
|
|
59
59
|
}
|
|
60
60
|
|