@kabmo-labs/kabmo 0.45.1 → 0.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +412 -412
- package/dist/client/static/js/{CsvGrid-eqmctwyq.js → CsvGrid-qdkmv8bj.js} +2 -2
- package/dist/client/static/js/{DocxView-rjrshmzf.js → DocxView-k84ns803.js} +3 -3
- package/dist/client/static/js/{DrawioView-za569srw.js → DrawioView-r1n717f7.js} +2 -2
- package/dist/client/static/js/ImageView-jkrdrq8v.js +1 -0
- package/dist/client/static/js/LayoutWrapper-sh634350.js +2 -0
- package/dist/client/static/js/Modal-xe6h99jn.js +59 -0
- package/dist/client/static/js/{PdfView-2m78d4jz.js → PdfView-ffg4mccg.js} +1 -1
- package/dist/client/static/js/{SessionsView-54awmse0.js → SessionsView-cdcbsee9.js} +1 -1
- package/dist/client/static/js/{SheetView-xfvjdh24.js → SheetView-89sscpz6.js} +19 -19
- package/dist/client/static/js/{SvgPreview-yfjrfb40.js → SvgPreview-68c0ccbv.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-tmsa3b36.js → abnfDiagram-O67JEVCF-h3a5s259.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-a5effrpz.js → architectureDiagram-NJMV4G6O-983p0jgn.js} +3 -3
- package/dist/client/static/js/{astro-56b0as3q.js → astro-hyj5wege.js} +1 -1
- package/dist/client/static/js/bash-8d8z8zrg.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-3q2kf22c.js → blockDiagram-BEXU5L5S-16pse5mh.js} +5 -5
- package/dist/client/static/js/c-acmn1zc9.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-mkw3jvf6.js → c4Diagram-YGBWAQC7-mvnb00zt.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fw9bs1za.js → classDiagram-v2-NBCMYWYE-kmpd91xb.js} +7 -7
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-eqjrpps4.js → cose-bilkent-JH36ORCC-3ek5r5se.js} +1 -1
- package/dist/client/static/js/cpp-620mvjkk.js +1 -0
- package/dist/client/static/js/css-bt76kxbq.js +1 -0
- package/dist/client/static/js/css-drfs4n12.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-4w61hq3e.js → cynefinDiagram-VND7K2PF-jkbh84zn.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-t52jdfr1.js → dagre-6A5THRUB-4fdc0sgn.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-448hyxaz.js → diagram-22UHCM2B-hbk61nq9.js} +18 -18
- package/dist/client/static/js/{diagram-3UASUU5V-350k213a.js → diagram-3UASUU5V-hfpbr9qh.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-9davjeyb.js → diagram-ATOU4E4O-fn0nt71a.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-034wwghk.js → diagram-CDSNMT55-ssswxjeb.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-kzzd4ecm.js → diagram-MLGK6HIB-whnzxv6f.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-rsky4e3s.js → diagram-MPIPVDR6-hk1chzxk.js} +2 -2
- package/dist/client/static/js/{dockerfile-68b0e6b6.js → dockerfile-zmsj8r4g.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-7bm1e394.js → ebnfDiagram-ZINNZB2B-q1vkg5mr.js} +1 -1
- package/dist/client/static/js/{elixir-12pgbgtq.js → elixir-80wq7gak.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-4xjp4rgh.js → elk-276RUBZZ-kt98vg8j.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-v52qmcrv.js → erDiagram-OPXOYQCR-ey3avsn9.js} +9 -9
- package/dist/client/static/js/{erlang-811btv6p.js → erlang-814e8qy5.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7gvtpn3d.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-1r1fn18p.js → ganttDiagram-FUAMR5RP-a9k1at43.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-zt5cwg83.js → gitGraphDiagram-X574FWY7-gnekjfym.js} +13 -13
- package/dist/client/static/js/graphql-j1a6zp7m.js +1 -0
- package/dist/client/static/js/html-m0megrvb.js +1 -0
- package/dist/client/static/js/{index-qt9jc4ck.js → index-19x11s5w.js} +2 -2
- package/dist/client/static/js/{index-0gmw2bt3.js → index-1ax52p0q.js} +2 -2
- package/dist/client/static/js/{index-2b1wnvez.js → index-1c2jvnyh.js} +2 -2
- package/dist/client/static/js/index-2a6qp9y6.js +2 -0
- package/dist/client/static/js/{index-gcwmpfr4.js → index-2ks0m8ss.js} +2 -2
- package/dist/client/static/js/{index-pfj3sd1n.js → index-33qxg79j.js} +7 -7
- package/dist/client/static/js/{index-bcpyxt97.js → index-3x7h2eqj.js} +2 -2
- package/dist/client/static/js/{index-q36gq3yz.js → index-4cag7w6k.js} +198 -198
- package/dist/client/static/js/{index-03j5j1j0.js → index-561gkvve.js} +2 -2
- package/dist/client/static/js/{index-m9s7r4z9.js → index-5ka2tyf9.js} +3 -3
- package/dist/client/static/js/{index-f51jxezc.js → index-5wz0y88c.js} +2 -2
- package/dist/client/static/js/{index-frqq7yen.js → index-60v30k5h.js} +64 -64
- package/dist/client/static/js/{index-x2wvq4ae.js → index-64sqfr4a.js} +2 -2
- package/dist/client/static/js/{index-xgv501v0.js → index-65afr75v.js} +2 -2
- package/dist/client/static/js/index-83rkg916.js +2 -0
- package/dist/client/static/js/{index-ga6492qc.js → index-84fyq5a6.js} +1 -1
- package/dist/client/static/js/{index-2tmnqqzt.js → index-8g7q8mz4.js} +3 -3
- package/dist/client/static/js/{index-mnh8nptt.js → index-9vv7wr1n.js} +2 -2
- package/dist/client/static/js/{index-gzafyqsr.js → index-abs635a1.js} +56 -56
- package/dist/client/static/js/{index-j50y0z44.js → index-amsa0tfs.js} +1 -1
- package/dist/client/static/js/index-atq9q1s7.js +1 -0
- package/dist/client/static/js/{index-8ps5gdwz.js → index-b2e5pwx7.js} +5 -5
- package/dist/client/static/js/{index-cza9mnxx.js → index-b5dfvget.js} +6 -6
- package/dist/client/static/js/{index-zwx3vbf0.js → index-bsr7wmj2.js} +1 -1
- package/dist/client/static/js/{index-ex3w7t7s.js → index-c9e417cs.js} +2 -2
- package/dist/client/static/js/{index-fbct0jcf.js → index-d23eacf2.js} +2 -2
- package/dist/client/static/js/{index-wqrdgt1g.js → index-dn7hg4em.js} +2 -2
- package/dist/client/static/js/index-dpy3ewrn.css +1 -0
- package/dist/client/static/js/index-dt6q3rws.js +12 -0
- package/dist/client/static/js/{index-3h2mr90j.js → index-dxvtjn6a.js} +2 -2
- package/dist/client/static/js/{index-127se1a3.js → index-e9cxje00.js} +19 -19
- package/dist/client/static/js/{index-6sqmhdyv.js → index-fj5rsp5v.js} +2 -2
- package/dist/client/static/js/{index-c7vbr57m.js → index-fzngzhww.js} +2 -2
- package/dist/client/static/js/{index-n1ga63de.js → index-g7s0wsag.js} +2 -2
- package/dist/client/static/js/{index-x0kgnkv3.js → index-hgzntg2j.js} +2 -2
- package/dist/client/static/js/{index-jaqjvk22.js → index-hkz2mz34.js} +2 -2
- package/dist/client/static/js/{index-gzp4j2h5.js → index-hnb66d3s.js} +2 -2
- package/dist/client/static/js/{index-9zwtpazh.js → index-kb14dhrx.js} +2 -2
- package/dist/client/static/js/{index-snjtkfkq.js → index-kbhrvep8.js} +6 -6
- package/dist/client/static/js/{index-vgcm2g0g.js → index-kty4ncsr.js} +2 -2
- package/dist/client/static/js/index-m4k054wz.js +4 -0
- package/dist/client/static/js/{index-pxq4v81r.js → index-nw5mvcaj.js} +2 -2
- package/dist/client/static/js/index-pavvxrsz.js +1 -0
- package/dist/client/static/js/index-q9ytjey8.js +1 -0
- package/dist/client/static/js/{index-8dtp7mt0.js → index-qf3y3ahx.js} +2 -2
- package/dist/client/static/js/{index-as1wptfa.js → index-qfxn7yh5.js} +2 -2
- package/dist/client/static/js/{index-e6any867.js → index-sa1675y0.js} +2 -2
- package/dist/client/static/js/{index-ehg2ftnp.js → index-trvqvb1v.js} +2 -2
- package/dist/client/static/js/{index-1nwwvv29.js → index-vjmg7kn5.js} +2 -2
- package/dist/client/static/js/index-vkqb4dnt.js +1 -0
- package/dist/client/static/js/{index-nzhwd6t3.js → index-wbws16ag.js} +2 -2
- package/dist/client/static/js/{index-528x5x8c.js → index-wrcdc9vz.js} +1 -1
- package/dist/client/static/js/{index-2zntn964.js → index-x9r7zfp4.js} +2 -2
- package/dist/client/static/js/{index-mhnwyra0.js → index-xq5f3nxa.js} +2 -2
- package/dist/client/static/js/index-xwjbq003.js +2 -0
- package/dist/client/static/js/{index-2gbfke1a.js → index-yf93db65.js} +1 -1
- package/dist/client/static/js/{index-tkfxnnr5.js → index-ykm7a3cp.js} +2 -2
- package/dist/client/static/js/{index-t0yv1375.js → index-z0fkfphe.js} +2 -2
- package/dist/client/static/js/{index-84vmdg3k.js → index-z25ss7xj.js} +1 -1
- package/dist/client/static/js/{index-dmv2zasz.js → index-z4530r3c.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-yd4zwrtv.js → infoDiagram-VRGFBTTK-r1p25738.js} +2 -2
- package/dist/client/static/js/ini-5f4zqtqr.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-7sjp09d4.js → ishikawaDiagram-OU5B5YK6-afgrqdrt.js} +3 -3
- package/dist/client/static/js/java-jj41mty3.js +1 -0
- package/dist/client/static/js/javascript-n9w9p97f.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-qh9jk7qk.js → journeyDiagram-ZHPQQLJL-hepa4wk7.js} +5 -5
- package/dist/client/static/js/json-rnh2h17x.js +1 -0
- package/dist/client/static/js/jsx-4gecrt29.js +1 -0
- package/dist/client/static/js/{julia-mgsev9df.js → julia-yv2j8qd0.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-cjc8k0jk.js → kanban-definition-PNTS6WVX-jysft8ya.js} +5 -5
- package/dist/client/static/js/lua-zszaw2f7.js +1 -0
- package/dist/client/static/js/markdown-nm6gw4v4.js +1 -0
- package/dist/client/static/js/{mermaid.core-vw0b7r0k.js → mermaid.core-0m90b0s8.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-jyhtpt1z.js → mindmap-definition-NLK3R4M7-x2rrzpvr.js} +8 -8
- package/dist/client/static/js/one-dark-pro-09d8p5vy.js +1 -0
- package/dist/client/static/js/one-light-g3ednt6p.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-80ygdd29.js → pegDiagram-GJSIUBJH-z7vb7f1z.js} +1 -1
- package/dist/client/static/js/{perl-6n93vjsa.js → perl-917pjq5a.js} +1 -1
- package/dist/client/static/js/{php-w23nmbtc.js → php-hwz75qzt.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-6vgh7ntn.js → pieDiagram-5QR66LMP-jqv6v4e6.js} +3 -3
- package/dist/client/static/js/properties-rkptax7r.js +1 -0
- package/dist/client/static/js/python-qf1se1mj.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-k5byajmm.js → quadrantDiagram-O4NWA36T-w2h8yxrv.js} +6 -6
- package/dist/client/static/js/r-ms0cygq2.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-qffrkk7g.js → railroadDiagram-XR7U4H2S-nd09yac3.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-r80w7tdp.js → requirementDiagram-PLB6GJNP-t61zxh5v.js} +10 -10
- package/dist/client/static/js/{ruby-ag3b3t9t.js → ruby-er7ayhte.js} +1 -1
- package/dist/client/static/js/{rust-a9jcfy2e.js → rust-avnkhh0p.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-g9qdy74b.js → sankeyDiagram-IPEJSGJF-2f7h2cmw.js} +4 -4
- package/dist/client/static/js/{sass-x0eez0kp.js → sass-n47tt136.js} +1 -1
- package/dist/client/static/js/{scss-qycakpjn.js → scss-kvev49ga.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-nywg1eq3.js → sequenceDiagram-PO4LG4MO-kfb5d7zd.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-m5pks027.js → sizeCapture-INFHLROL-amfg19se.js} +1 -1
- package/dist/client/static/js/sql-hd42h8wx.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-xzzv780w.js → stateDiagram-v2-GCMORJYK-k5hx7btx.js} +3 -3
- package/dist/client/static/js/{svelte-tg19by0f.js → svelte-2pmz35vx.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-n4q5ad13.js → swimlanes-2SLR337P-wv3rp8kk.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-6y8zdbm4.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-j9pde7sa.js → timeline-definition-EJHVYXUP-0re95wtn.js} +6 -6
- package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +1 -0
- package/dist/client/static/js/tsx-gx7td06z.js +1 -0
- package/dist/client/static/js/typescript-1a808spn.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ehnc0600.js → usecaseDiagram-POWQR4AR-yrje14qp.js} +44 -44
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-cp4kj6kw.js → vennDiagram-UO4OBE2U-jxkmrfy5.js} +7 -7
- package/dist/client/static/js/{vue-mhj4sme0.js → vue-d5gpjfgn.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-eegf1jpw.js → wardleyDiagram-VNRHLVJA-d3v2m9b1.js} +3 -3
- package/dist/client/static/js/xml-3117mxd9.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-zkkqfyex.js → xychartDiagram-PMCCYNJV-9a1s1rjt.js} +5 -5
- package/dist/client/static/js/yaml-dmvh8vyt.js +1 -0
- package/extensions/kabmo-modes/index.ts +1 -1
- package/extensions/kabmo-modes/parked.test.ts +2 -2
- package/extensions/kabmo-modes/parked.ts +10 -9
- package/extensions/kabmo-modes/plan.test.ts +4 -4
- package/extensions/kabmo-modes/plan.ts +6 -6
- package/extensions/kabmo-modes/session.ts +2 -2
- package/package.json +1 -1
- package/src/client/components/common/FolderPicker.tsx +1 -1
- package/src/client/components/common/Modal.tsx +8 -3
- package/src/client/components/common/NotificationPermissionDialog.test.tsx +8 -3
- package/src/client/components/common/NotificationPermissionDialog.tsx +7 -9
- package/src/client/components/common/PWAInstallButton.tsx +1 -1
- package/src/client/components/common/header-panel-buttons/index.tsx +5 -1
- package/src/client/components/common/shell-update-button/Modal.tsx +31 -36
- package/src/client/components/common/shell-update-button/index.test.tsx +5 -2
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +16 -0
- package/src/client/components/layout/desktop-layout/RightColumn.test.tsx +204 -0
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +52 -15
- package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +4 -6
- package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +9 -43
- package/src/client/components/mobile/RightSidebar.tsx +31 -12
- package/src/client/components/mobile/SessionSidebar.tsx +112 -137
- package/src/client/components/mobile/drawer-strip.tsx +85 -0
- package/src/client/components/mobile/left-drawer-nav.test.tsx +350 -0
- package/src/client/components/mobile/mobile-drawer-reveals.test.tsx +194 -0
- package/src/client/components/mobile/mobile-drawer-reveals.ts +138 -0
- package/src/client/components/mobile/mobile-main-view/Header.tsx +12 -24
- package/src/client/components/mobile/mobile-right-sidebar/Action.tsx +57 -0
- package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +14 -87
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +2 -7
- package/src/client/components/mobile/mobile-right-sidebar/Header.test.tsx +157 -0
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +109 -105
- package/src/client/components/mobile/mobile-right-sidebar/OutlineButton.tsx +1 -1
- package/src/client/components/mobile/mobile-right-sidebar/Overflow.tsx +95 -0
- package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +212 -0
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +7 -9
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +2 -2
- package/src/client/components/mobile/mobile-session-sidebar/use-dock.ts +29 -8
- package/src/client/components/mobile/mobile-session-sidebar/use-drawer-tabs.ts +97 -0
- package/src/client/components/settings/Band.test.tsx +83 -0
- package/src/client/components/settings/Band.tsx +96 -0
- package/src/client/components/settings/Modal.tsx +44 -69
- package/src/client/components/settings/apply-side-effects.ts +15 -4
- package/src/client/components/settings/band-height.test.tsx +16 -3
- package/src/client/components/settings/categories/AppearanceSettings.test.tsx +35 -9
- package/src/client/components/settings/categories/AppearanceSettings.tsx +2 -0
- package/src/client/components/settings/categories/ChatSettings.test.tsx +32 -9
- package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
- package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/PanelNavSection.tsx +40 -223
- package/src/client/components/settings/categories/appearance-settings/nav-choice.tsx +176 -0
- package/src/client/components/settings/categories/appearance-settings/nav-miniatures.tsx +93 -0
- package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
- package/src/client/components/settings/categories/notification-settings/PermissionNotice.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +1 -1
- package/src/client/components/settings/drill.tsx +113 -0
- package/src/client/components/settings/master-detail/GroupDetail.tsx +14 -6
- package/src/client/components/settings/master-detail/GroupSidebar.tsx +9 -1
- package/src/client/components/settings/master-detail/index.tsx +45 -25
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +11 -0
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +29 -21
- package/src/client/components/workspace/chat-timeline/MobileTurnJump.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +4 -0
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.test.ts +23 -6
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +19 -2
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/index.tsx +5 -9
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.test.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.test.tsx +127 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +225 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.test.tsx +5 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions.test.ts +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts +4 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +40 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Footer.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +5 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +8 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +5 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +16 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +16 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +37 -12
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +4 -3
- package/src/client/components/workspace/diff-panel/index.tsx +1 -1
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +1 -1
- package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +1 -1
- package/src/client/components/workspace/file-explorer/Modals.tsx +4 -4
- package/src/client/components/workspace/git-panel/Modals.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/CloseButton.tsx +38 -0
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +16 -25
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +30 -9
- package/src/client/components/workspace/model-dropdown/Header.tsx +33 -21
- package/src/client/components/workspace/model-dropdown/Panel.tsx +19 -4
- package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +139 -0
- package/src/client/components/workspace/model-dropdown/placement.test.tsx +9 -7
- package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
- package/src/client/components/workspace/wiki-panel/NavModal.tsx +1 -1
- package/src/client/data/settings/omp-schema.json +103 -42
- package/src/client/hooks/chat/timeline/ask-form-frame.ts +33 -0
- package/src/client/hooks/chat/timeline/ask-frame-asks.ts +68 -0
- package/src/client/hooks/chat/timeline/ask-frame-buckets.ts +77 -0
- package/src/client/hooks/chat/timeline/ask-frames-context.ts +68 -0
- package/src/client/hooks/chat/timeline/ask-frames-form.test.ts +170 -0
- package/src/client/hooks/chat/timeline/ask-frames.test.ts +1 -1
- package/src/client/hooks/chat/timeline/ask-frames.ts +36 -93
- package/src/client/hooks/chat/timeline/row-measure.ts +75 -0
- package/src/client/hooks/chat/timeline/row-window.test.ts +41 -21
- package/src/client/hooks/chat/timeline/row-window.ts +6 -24
- package/src/client/hooks/workspace/left-dock.ts +19 -0
- package/src/client/hooks/workspace/mobile-panel-nav.ts +90 -0
- package/src/client/hooks/workspace/panel-nav.test.ts +42 -21
- package/src/client/hooks/workspace/panel-tabs-reveal.test.tsx +286 -0
- package/src/client/hooks/workspace/panel-tabs-reveal.ts +174 -0
- package/src/client/hooks/workspace/panel-tabs.ts +22 -4
- package/src/client/hooks/workspace/session-state/index.test.tsx +145 -0
- package/src/client/hooks/workspace/session-state/index.ts +28 -16
- package/src/client/lib/ui/phone-row.test.ts +52 -0
- package/src/client/lib/ui/phone-row.ts +71 -0
- package/src/client/press-state.test.ts +179 -0
- package/src/client/tailwind.css +146 -0
- package/src/server/lib/bundler/titlebar-css.test.ts +10 -1
- package/src/server/lib/omp/rpc/constants.test.ts +6 -1
- package/src/shared/lib/chat/ask-form/data.ts +155 -0
- package/src/shared/lib/chat/ask-form/fields.ts +4 -0
- package/src/shared/lib/chat/ask-form/index.ts +8 -0
- package/src/shared/lib/chat/ask-form/types.ts +12 -0
- package/src/shared/lib/chat/timeline/tool-verbs.ts +28 -1
- package/src/shared/lib/chat/tool/tool-commands.test.ts +102 -0
- package/src/shared/lib/chat/tool/tool-commands.ts +124 -0
- package/src/shared/lib/omp/config/schema-releases.test.ts +34 -1
- package/src/shared/lib/omp/dialog-methods.ts +6 -0
- package/src/shared/lib/omp/session/wait-idle.ts +7 -3
- package/src/shared/lib/settings/defaults.ts +3 -2
- package/src/shared/lib/workspace/panel-nav.test.ts +26 -19
- package/src/shared/lib/workspace/panel-nav.ts +20 -9
- package/src/shared/types/omp/agent.ts +20 -3
- package/src/shared/types/settings/state.ts +17 -5
- package/dist/client/static/js/ImageView-6ksvyzqv.js +0 -1
- package/dist/client/static/js/LayoutWrapper-px60417t.js +0 -2
- package/dist/client/static/js/Modal-yv1718s1.js +0 -59
- package/dist/client/static/js/architecture-7GRP2DOG-bch3nye9.js +0 -1
- package/dist/client/static/js/bash-mevzaywf.js +0 -1
- package/dist/client/static/js/c-y1y6v00q.js +0 -1
- package/dist/client/static/js/cpp-wk9z0c5g.js +0 -1
- package/dist/client/static/js/css-3w3p9s67.js +0 -1
- package/dist/client/static/js/css-g85rwzty.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-vqy5jtnk.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-65ph4s3m.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-hekt0qsb.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-t45ekjb6.js +0 -1
- package/dist/client/static/js/graphql-027z8sc0.js +0 -1
- package/dist/client/static/js/html-fqda6wxx.js +0 -1
- package/dist/client/static/js/index-252br0k2.js +0 -1
- package/dist/client/static/js/index-6bm4pw90.css +0 -1
- package/dist/client/static/js/index-80qxk9hx.js +0 -1
- package/dist/client/static/js/index-9674dxb4.js +0 -1
- package/dist/client/static/js/index-9k4121z4.js +0 -4
- package/dist/client/static/js/index-b6454rme.js +0 -12
- package/dist/client/static/js/index-ck0fd3aj.js +0 -2
- package/dist/client/static/js/index-jdf1tks1.js +0 -2
- package/dist/client/static/js/index-q58e8x6j.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-mw29xbwf.js +0 -1
- package/dist/client/static/js/ini-3cx6tmv4.js +0 -1
- package/dist/client/static/js/java-zs6qh1dm.js +0 -1
- package/dist/client/static/js/javascript-b9mkygak.js +0 -1
- package/dist/client/static/js/json-qn73s8xb.js +0 -1
- package/dist/client/static/js/jsx-gahhfczw.js +0 -1
- package/dist/client/static/js/lua-d8enp14s.js +0 -1
- package/dist/client/static/js/markdown-qetaj4vp.js +0 -1
- package/dist/client/static/js/one-dark-pro-axkq0m3s.js +0 -1
- package/dist/client/static/js/one-light-pncb08qd.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-md85wpjq.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-4grcqnp8.js +0 -1
- package/dist/client/static/js/properties-g6tpq003.js +0 -1
- package/dist/client/static/js/python-cy06fzhg.js +0 -1
- package/dist/client/static/js/r-vw8berfv.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-7j9prhg1.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-g8x2jps1.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-cbg7k68h.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-xfvjk9f8.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-7w97805z.js +0 -1
- package/dist/client/static/js/sql-bwnasywx.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-253nz20y.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-xhf1r6c3.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-4n3j7ekq.js +0 -1
- package/dist/client/static/js/tsx-3dzv8h6k.js +0 -1
- package/dist/client/static/js/typescript-44vs0wn4.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-fb0py35r.js +0 -1
- package/dist/client/static/js/xml-yvv5fn3k.js +0 -1
- package/dist/client/static/js/yaml-avewh7n5.js +0 -1
- package/src/client/hooks/workspace/mobile-right-panel-nav.ts +0 -63
- package/src/shared/lib/ui/safe-area.test.ts +0 -28
- package/src/shared/lib/ui/safe-area.ts +0 -42
|
@@ -137,7 +137,7 @@ export function GoalModal({ open, goal, goalRecord, pending, defaultBudget = nul
|
|
|
137
137
|
// such ancestor; the same reason `Toast`, `anchored-menu` and `diagram-viewer`
|
|
138
138
|
// portal.
|
|
139
139
|
return createPortal(
|
|
140
|
-
<div className="fixed inset-0 z-[60] flex items-center justify-center modal-scrim
|
|
140
|
+
<div className="fixed inset-0 z-[60] flex items-center justify-center modal-scrim modal-safe" onClick={onClose}>
|
|
141
141
|
<div
|
|
142
142
|
className="glass-overlay w-full max-w-lg overflow-hidden rounded-xl border border-ink/15 bg-paper shadow-xl"
|
|
143
143
|
onClick={(event) => event.stopPropagation()}
|
|
@@ -85,7 +85,7 @@ const ACTION_BASE =
|
|
|
85
85
|
'tap-target flex items-center justify-center rounded-lg flex-shrink-0 cursor-pointer ' +
|
|
86
86
|
'transition duration-150 ' +
|
|
87
87
|
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/50 ' +
|
|
88
|
-
'focus-visible:ring-offset-2 focus-visible:ring-offset-paper
|
|
88
|
+
'focus-visible:ring-offset-2 focus-visible:ring-offset-paper';
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Bottom config row of the composer: model + thinking + access + plan/goal
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'preact/hooks';
|
|
2
2
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
3
|
-
import {
|
|
3
|
+
import { splitAskFrames } from '@/client/hooks/chat/timeline/ask-frames';
|
|
4
|
+
import { AskFramesContext, type AskFramesHandle } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
4
5
|
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
5
6
|
import type { UserTurnRef } from '@/shared/types/chat';
|
|
6
7
|
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
@@ -106,18 +107,13 @@ export function ChatTimeline({ className = '', appSettings = {}, onSessionTitle,
|
|
|
106
107
|
// blocked on (an approval gate, an extension picker) has no card and keeps
|
|
107
108
|
// the modal. It also waits for committed history: a replayed dialog has no
|
|
108
109
|
// card to match yet, and deciding early flashed the modal and withdrew it.
|
|
109
|
-
const { framesByTool, looseByTool, orphanAsks, modalRequest } = useMemo(
|
|
110
|
-
() => splitAskFrames(localMessages, extensionDialogs, !sessionLoading),
|
|
111
|
-
[localMessages, extensionDialogs, sessionLoading],
|
|
112
|
-
);
|
|
110
|
+
const { framesByTool, looseByTool, orphanAsks, formByTool, modalRequest } = useMemo(() => splitAskFrames(localMessages, extensionDialogs, !sessionLoading), [localMessages, extensionDialogs, sessionLoading]);
|
|
113
111
|
const respondToFrame = useCallback((request: ExtensionUiDialogRequest, response: ExtensionDialogResponse) => {
|
|
114
112
|
void respondToExtensionUi(request, response);
|
|
115
113
|
resolveExtensionDialog(request.id);
|
|
116
114
|
}, [respondToExtensionUi, resolveExtensionDialog]);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
[framesByTool, looseByTool, orphanAsks, respondToFrame],
|
|
120
|
-
);
|
|
115
|
+
// `formByTool` rides along: an ask card answers omp 19.1.0's whole-form dialog through this responder too.
|
|
116
|
+
const askFrames = useMemo<AskFramesHandle>(() => ({ framesByTool, looseByTool, orphanAsks, formByTool, respond: respondToFrame }), [framesByTool, looseByTool, orphanAsks, formByTool, respondToFrame]);
|
|
121
117
|
|
|
122
118
|
const newChat = useNewChatOpen({ folders, sessionId, selectedFolderId, ...(activeHarness.harness ? { harness: activeHarness.harness } : {}) });
|
|
123
119
|
const { pendingUndo, undoing, error: undoError, requestUndo: handleRequestUndo, closeUndoConfirm, confirmUndo } = useUndoConfirmation(handleUndo);
|
|
@@ -67,7 +67,7 @@ export function PlanReviewPanel({ proposal, deciding, error, onDecide, onDismiss
|
|
|
67
67
|
.join('\n\n');
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
|
-
<div className="fixed inset-0 z-[70] flex items-center justify-center modal-scrim
|
|
70
|
+
<div className="fixed inset-0 z-[70] flex items-center justify-center modal-scrim modal-safe">
|
|
71
71
|
<div className="glass-overlay flex h-[88vh] w-full max-w-5xl flex-col overflow-hidden rounded-xl border border-ink/15 bg-paper shadow-2xl">
|
|
72
72
|
<div className="flex items-center justify-between border-b border-ink/10 px-4 py-3">
|
|
73
73
|
<div className="flex min-w-0 items-center gap-2">
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.test.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { h, render } from 'preact';
|
|
|
4
4
|
import { act } from 'preact/test-utils';
|
|
5
5
|
import { useMemo, useState } from 'preact/hooks';
|
|
6
6
|
import { AskPanel } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel';
|
|
7
|
-
import { AskFramesContext, type AskFramesHandle } from '@/client/hooks/chat/timeline/ask-frames';
|
|
7
|
+
import { AskFramesContext, type AskFramesHandle } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
8
8
|
import { resetListSlots } from '@/client/lib/plugins/list-slots';
|
|
9
9
|
import type { ToolCallData } from '@/shared/types';
|
|
10
10
|
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
@@ -63,7 +63,7 @@ function Harness({
|
|
|
63
63
|
const handle = useMemo<AskFramesHandle>(() => ({
|
|
64
64
|
framesByTool: new Map([[TOOL.id, groups]]),
|
|
65
65
|
looseByTool: new Map(),
|
|
66
|
-
orphanAsks: [],
|
|
66
|
+
orphanAsks: [], formByTool: new Map(),
|
|
67
67
|
respond: (frame, response) => {
|
|
68
68
|
onSent(frame, response);
|
|
69
69
|
setGroups(next ? [[], [next]] : [[], []]);
|
|
@@ -144,7 +144,7 @@ describe('the grouped form for a per-field ask', () => {
|
|
|
144
144
|
const handle = useMemo<AskFramesHandle>(() => ({
|
|
145
145
|
framesByTool: new Map([[checkedTool.id, groups]]),
|
|
146
146
|
looseByTool: new Map(),
|
|
147
|
-
orphanAsks: [],
|
|
147
|
+
orphanAsks: [], formByTool: new Map(),
|
|
148
148
|
respond: (_request, response) => {
|
|
149
149
|
sent.push(response);
|
|
150
150
|
setGroups([[], []]);
|
|
@@ -186,7 +186,7 @@ describe('the grouped form for a per-field ask', () => {
|
|
|
186
186
|
const handle = useMemo<AskFramesHandle>(() => ({
|
|
187
187
|
framesByTool: new Map([[multiTool.id, groups]]),
|
|
188
188
|
looseByTool: new Map(),
|
|
189
|
-
orphanAsks: [],
|
|
189
|
+
orphanAsks: [], formByTool: new Map(),
|
|
190
190
|
respond: (_frame, response) => {
|
|
191
191
|
sent.push(response);
|
|
192
192
|
step += 1;
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.test.tsx
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The `method:"form"` card, mounted.
|
|
8
|
+
*
|
|
9
|
+
* omp 19.1.0 sends the `ask` tool's whole HTML form as ONE frame and refuses a
|
|
10
|
+
* reply that does not match the form it parsed. A unit test on the payload
|
|
11
|
+
* builder cannot show that the CARD sends that payload, and the reported
|
|
12
|
+
* failure mode was invisible to a type check: nothing rendered at all. So this
|
|
13
|
+
* mounts `AskPanel` over a live form frame and asserts what the wire receives.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { afterAll, afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
17
|
+
import { Window } from 'happy-dom';
|
|
18
|
+
import { h, render } from 'preact';
|
|
19
|
+
import { act } from 'preact/test-utils';
|
|
20
|
+
import { useMemo } from 'preact/hooks';
|
|
21
|
+
import { AskPanel } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel';
|
|
22
|
+
import { AskFramesContext, type AskFramesHandle } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
23
|
+
import { resetListSlots } from '@/client/lib/plugins/list-slots';
|
|
24
|
+
import type { ToolCallData } from '@/shared/types';
|
|
25
|
+
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
26
|
+
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
27
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
28
|
+
|
|
29
|
+
const HTML = `<form>
|
|
30
|
+
<fieldset>
|
|
31
|
+
<legend>Flavour</legend>
|
|
32
|
+
<label><input type="radio" name="flavour" value="yes" checked> Yes</label>
|
|
33
|
+
<label><input type="radio" name="flavour" value="no"> No</label>
|
|
34
|
+
</fieldset>
|
|
35
|
+
<label>Serving <input type="number" name="serving" value="1" required></label>
|
|
36
|
+
</form>`;
|
|
37
|
+
|
|
38
|
+
const TOOL: ToolCallData = {
|
|
39
|
+
id: 'call-form', type: 'other', title: 'ask', name: 'ask', status: 'running', input: { html: HTML },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const FRAME: ExtensionUiDialogRequest = {
|
|
43
|
+
type: 'extension_ui_request', id: 'form-1', method: 'form', html: HTML,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
let container: HTMLElement;
|
|
47
|
+
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
resetListSlots();
|
|
50
|
+
installDomGlobals(new Window());
|
|
51
|
+
container = document.createElement('div');
|
|
52
|
+
document.body.appendChild(container);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
afterEach(() => {
|
|
56
|
+
render(null, container);
|
|
57
|
+
container.remove();
|
|
58
|
+
resetListSlots();
|
|
59
|
+
restoreDomGlobals();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
afterAll(() => restoreDomGlobals());
|
|
63
|
+
|
|
64
|
+
function buttonStarting(prefix: string): HTMLElement {
|
|
65
|
+
const found = [...container.querySelectorAll('button')].find((node) => node.textContent?.trim().startsWith(prefix));
|
|
66
|
+
if (!found) throw new Error(`no button starting with "${prefix}" in ${container.innerHTML}`);
|
|
67
|
+
return found as HTMLElement;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function Harness({ onSent }: { onSent: (frame: ExtensionUiDialogRequest, response: ExtensionDialogResponse) => void }) {
|
|
71
|
+
const handle = useMemo<AskFramesHandle>(() => ({
|
|
72
|
+
framesByTool: new Map(),
|
|
73
|
+
looseByTool: new Map(),
|
|
74
|
+
orphanAsks: [],
|
|
75
|
+
formByTool: new Map([[TOOL.id, FRAME]]),
|
|
76
|
+
respond: onSent,
|
|
77
|
+
}), [onSent]);
|
|
78
|
+
return h(AskFramesContext.Provider, { value: handle }, h(AskPanel, { tool: TOOL }));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
describe('the whole-form dialog', () => {
|
|
82
|
+
test('draws every control at once, with one submit gated on the required field', () => {
|
|
83
|
+
act(() => {
|
|
84
|
+
render(h(Harness, { onSent: () => {} }), container);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
expect(container.textContent).toContain('Flavour');
|
|
88
|
+
expect(container.textContent).toContain('Serving');
|
|
89
|
+
// A form frame is never modal material: the modal has no form body.
|
|
90
|
+
expect(container.querySelector('[role="dialog"]')).toBeNull();
|
|
91
|
+
|
|
92
|
+
// The radio group is optional and the checked row seeds it; the required
|
|
93
|
+
// number field is empty, so the submit stays disabled.
|
|
94
|
+
expect(buttonStarting('Submit answers').hasAttribute('disabled')).toBe(true);
|
|
95
|
+
act(() => buttonStarting('No').click());
|
|
96
|
+
expect(buttonStarting('Submit answers').hasAttribute('disabled')).toBe(true);
|
|
97
|
+
|
|
98
|
+
const serving = container.querySelector('textarea') as HTMLTextAreaElement | null;
|
|
99
|
+
expect(serving).not.toBeNull();
|
|
100
|
+
act(() => {
|
|
101
|
+
serving!.value = '3';
|
|
102
|
+
serving!.dispatchEvent(new Event('input', { bubbles: true }));
|
|
103
|
+
});
|
|
104
|
+
expect(buttonStarting('Submit answers').hasAttribute('disabled')).toBe(false);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('one submit sends ONE { data } reply keyed by control name', () => {
|
|
108
|
+
const sent: { id: string; response: ExtensionDialogResponse }[] = [];
|
|
109
|
+
act(() => {
|
|
110
|
+
render(h(Harness, { onSent: (frame, response) => sent.push({ id: frame.id, response }) }), container);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
act(() => buttonStarting('No').click());
|
|
114
|
+
const serving = container.querySelector('textarea') as HTMLTextAreaElement;
|
|
115
|
+
act(() => {
|
|
116
|
+
serving.value = '3';
|
|
117
|
+
serving.dispatchEvent(new Event('input', { bubbles: true }));
|
|
118
|
+
});
|
|
119
|
+
act(() => buttonStarting('Submit answers').click());
|
|
120
|
+
|
|
121
|
+
// omp compares against the form's own `value` attributes, never the labels,
|
|
122
|
+
// and a number/range control submits a string it converts itself.
|
|
123
|
+
expect(sent).toEqual([{ id: 'form-1', response: { data: { flavour: 'no', serving: '3' } } }]);
|
|
124
|
+
// The card keeps saying what it sent while omp runs the turn.
|
|
125
|
+
expect(container.textContent).toContain('Answers sent');
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The whole-form control for omp 19.1.0's `method:"form"` frame.
|
|
8
|
+
*
|
|
9
|
+
* omp gave its RPC host a real `ui.formDialog`, so the `ask` tool no longer
|
|
10
|
+
* walks a form one blocking dialog per control: it sends the form ONCE and
|
|
11
|
+
* parks on one `{ data }` reply. That is the shape this card draws — every
|
|
12
|
+
* question at once, one Submit — and it is also what the earlier per-field
|
|
13
|
+
* walk was reconstructed into (`FormAsk`), so the two look the same.
|
|
14
|
+
*
|
|
15
|
+
* The payload is built by `buildFormData`, which mirrors the validation omp
|
|
16
|
+
* applies to the reply (unknown keys, disabled options, array-vs-string
|
|
17
|
+
* choices, required fields). Sending a guess would be refused with the field
|
|
18
|
+
* named and the run parked, so Submit is disabled until the form is valid.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
|
|
22
|
+
import type { ComponentChildren } from 'preact';
|
|
23
|
+
import { AlertTriangle, Check, CornerDownLeft, HelpCircle } from 'lucide-preact';
|
|
24
|
+
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
25
|
+
import type { AskQuestion } from '@/shared/lib/chat/ask-form/types';
|
|
26
|
+
import { buildFormData, type FormPick } from '@/shared/lib/chat/ask-form/data';
|
|
27
|
+
import { isOtherOption } from '@/shared/lib/chat/ask-questions';
|
|
28
|
+
import { AnswerList, QuestionCard } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard';
|
|
29
|
+
import { OptionRow } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow';
|
|
30
|
+
import { partsFor } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/form-picks';
|
|
31
|
+
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
32
|
+
|
|
33
|
+
interface FormDialogProps {
|
|
34
|
+
/** The live `method:"form"` frame. */
|
|
35
|
+
frame: ExtensionUiDialogRequest;
|
|
36
|
+
questions: AskQuestion[];
|
|
37
|
+
/** Answers omp already recorded, per question — those render settled. */
|
|
38
|
+
recorded: (readonly string[] | null)[];
|
|
39
|
+
/** What this client just sent, held until omp echoes it in the tool result. */
|
|
40
|
+
submitted?: Record<string, string | string[]> | null;
|
|
41
|
+
onRespond: (response: ExtensionDialogResponse) => void;
|
|
42
|
+
interactions?: ComponentChildren;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** A text control's answer; a `number`/`range` input submits a number. */
|
|
46
|
+
function pickFor(picks: Record<number, FormPick>, index: number): FormPick {
|
|
47
|
+
return picks[index] ?? { selected: [], text: '' };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function FormDialog({ frame, questions, recorded, submitted, onRespond, interactions }: FormDialogProps) {
|
|
51
|
+
const [picks, setPicks] = useState<Record<number, FormPick>>({});
|
|
52
|
+
const [failure, setFailure] = useState<string | null>(null);
|
|
53
|
+
const [sent, setSent] = useState(false);
|
|
54
|
+
const sentRef = useRef(false);
|
|
55
|
+
|
|
56
|
+
// A NEW frame is a new form: text and picks left over from the previous one
|
|
57
|
+
// must not read as answers the user just gave.
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
setPicks({});
|
|
60
|
+
setFailure(null);
|
|
61
|
+
setSent(false);
|
|
62
|
+
sentRef.current = false;
|
|
63
|
+
}, [frame.id]);
|
|
64
|
+
|
|
65
|
+
// Seeded from the form's own defaults, so a form that opens with a checked
|
|
66
|
+
// radio shows that choice instead of an empty control.
|
|
67
|
+
const seeded = useMemo(() => {
|
|
68
|
+
const initial: Record<number, FormPick> = {};
|
|
69
|
+
questions.forEach((question, index) => {
|
|
70
|
+
const checked = question.options.filter((option) => option.checked).map((option) => option.label);
|
|
71
|
+
const selected = question.multi === true ? checked : checked.slice(0, 1);
|
|
72
|
+
if (selected.length > 0) initial[index] = { selected, text: '' };
|
|
73
|
+
});
|
|
74
|
+
return initial;
|
|
75
|
+
}, [questions]);
|
|
76
|
+
const effective = useMemo(() => ({ ...seeded, ...picks }), [seeded, picks]);
|
|
77
|
+
|
|
78
|
+
// `submitted` is optional, so a plain `!== null` reads `undefined` as "already
|
|
79
|
+
// sent" — which disabled every control on a fresh card (measured in the
|
|
80
|
+
// mounted test: the textarea rendered `disabled`).
|
|
81
|
+
const settled = sent || submitted != null;
|
|
82
|
+
|
|
83
|
+
const toggle = (index: number, label: string, multi: boolean) => {
|
|
84
|
+
setPicks((current) => {
|
|
85
|
+
const base = current[index] ?? seeded[index] ?? { selected: [], text: '' };
|
|
86
|
+
const selected = multi
|
|
87
|
+
? (base.selected.includes(label)
|
|
88
|
+
? base.selected.filter((item) => item !== label)
|
|
89
|
+
: [...base.selected, label])
|
|
90
|
+
: [label];
|
|
91
|
+
return { ...current, [index]: { ...base, selected } };
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const setText = (index: number, text: string) => {
|
|
96
|
+
setPicks((current) => {
|
|
97
|
+
const base = current[index] ?? seeded[index] ?? { selected: [], text: '' };
|
|
98
|
+
return { ...current, [index]: { ...base, text } };
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const built = useMemo(() => buildFormData(questions, effective), [questions, effective]);
|
|
103
|
+
const ready = 'data' in built;
|
|
104
|
+
|
|
105
|
+
const submit = () => {
|
|
106
|
+
if (sentRef.current) return;
|
|
107
|
+
const outcome = buildFormData(questions, effective);
|
|
108
|
+
if ('missing' in outcome) {
|
|
109
|
+
setFailure(outcome.missing);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
sentRef.current = true;
|
|
113
|
+
setSent(true);
|
|
114
|
+
setFailure(null);
|
|
115
|
+
onRespond({ data: outcome.data });
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<div className="space-y-2">
|
|
120
|
+
{questions.map((question, index) => {
|
|
121
|
+
const recordedParts = recorded[index] ?? null;
|
|
122
|
+
const pick = pickFor(effective, index);
|
|
123
|
+
const sentData = submitted?.[question.id ?? ''];
|
|
124
|
+
const parts = recordedParts
|
|
125
|
+
? [...recordedParts]
|
|
126
|
+
: submitted && sentData !== undefined
|
|
127
|
+
? partsFor(question, pick, null)
|
|
128
|
+
: [];
|
|
129
|
+
const answered = recordedParts !== null || (submitted !== null && sentData !== undefined);
|
|
130
|
+
return (
|
|
131
|
+
<QuestionCard
|
|
132
|
+
key={question.id ?? index}
|
|
133
|
+
index={index}
|
|
134
|
+
total={questions.length}
|
|
135
|
+
header={question.header}
|
|
136
|
+
question={question.question}
|
|
137
|
+
multi={question.multi === true}
|
|
138
|
+
answered={answered}
|
|
139
|
+
>
|
|
140
|
+
{answered ? (
|
|
141
|
+
<AnswerList parts={parts} />
|
|
142
|
+
) : question.kind === 'text' ? (
|
|
143
|
+
<textarea
|
|
144
|
+
rows={3}
|
|
145
|
+
value={pick.text}
|
|
146
|
+
disabled={settled}
|
|
147
|
+
placeholder="Type your answer…"
|
|
148
|
+
aria-label={`Your answer for question ${index + 1}`}
|
|
149
|
+
onInput={(event) => setText(index, event.currentTarget.value)}
|
|
150
|
+
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"
|
|
151
|
+
/>
|
|
152
|
+
) : (
|
|
153
|
+
<>
|
|
154
|
+
<div className="mt-2 space-y-1" role={question.multi === true ? 'group' : 'radiogroup'}>
|
|
155
|
+
{question.options
|
|
156
|
+
.filter((option) => !isOtherOption(option.label) && option.disabled !== true)
|
|
157
|
+
.map((option) => (
|
|
158
|
+
<OptionRow
|
|
159
|
+
key={option.label}
|
|
160
|
+
label={option.label}
|
|
161
|
+
description={option.description}
|
|
162
|
+
multi={question.multi === true}
|
|
163
|
+
checked={pick.selected.includes(option.label)}
|
|
164
|
+
suggested={question.recommended === question.options.indexOf(option)}
|
|
165
|
+
disabled={settled}
|
|
166
|
+
onClick={() => toggle(index, option.label, question.multi === true)}
|
|
167
|
+
/>
|
|
168
|
+
))}
|
|
169
|
+
</div>
|
|
170
|
+
<input
|
|
171
|
+
type="text"
|
|
172
|
+
value={pick.text}
|
|
173
|
+
disabled={settled}
|
|
174
|
+
placeholder="Or type your own…"
|
|
175
|
+
aria-label={`Your own answer for question ${index + 1}`}
|
|
176
|
+
onInput={(event) => setText(index, event.currentTarget.value)}
|
|
177
|
+
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"
|
|
178
|
+
/>
|
|
179
|
+
</>
|
|
180
|
+
)}
|
|
181
|
+
</QuestionCard>
|
|
182
|
+
);
|
|
183
|
+
})}
|
|
184
|
+
|
|
185
|
+
{interactions}
|
|
186
|
+
|
|
187
|
+
{failure && (
|
|
188
|
+
<div className="flex items-start gap-1.5 text-[10.5px] text-error">
|
|
189
|
+
<AlertTriangle size={11} className="mt-0.5 shrink-0" />
|
|
190
|
+
<span>{failure}</span>
|
|
191
|
+
</div>
|
|
192
|
+
)}
|
|
193
|
+
|
|
194
|
+
<div className="flex items-center gap-2">
|
|
195
|
+
{settled ? (
|
|
196
|
+
<span className="flex items-center gap-1.5 text-[10.5px] text-ink/50">
|
|
197
|
+
<HelpCircle size={11} className="shrink-0" />
|
|
198
|
+
<span>Answers sent — the agent is working on them.</span>
|
|
199
|
+
</span>
|
|
200
|
+
) : (
|
|
201
|
+
<span className="text-[10.5px] text-ink/45">Answer every required question, then submit once.</span>
|
|
202
|
+
)}
|
|
203
|
+
<div className="ml-auto flex items-center gap-2">
|
|
204
|
+
<button
|
|
205
|
+
type="button"
|
|
206
|
+
disabled={settled}
|
|
207
|
+
onClick={() => onRespond({ cancelled: true })}
|
|
208
|
+
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"
|
|
209
|
+
>
|
|
210
|
+
Dismiss
|
|
211
|
+
</button>
|
|
212
|
+
<button
|
|
213
|
+
type="button"
|
|
214
|
+
disabled={settled || !ready}
|
|
215
|
+
onClick={submit}
|
|
216
|
+
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"
|
|
217
|
+
>
|
|
218
|
+
{settled ? <Check size={11} /> : <CornerDownLeft size={11} />}
|
|
219
|
+
<span>Submit answers</span>
|
|
220
|
+
</button>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
225
|
+
}
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.test.tsx
CHANGED
|
@@ -18,7 +18,8 @@ import { afterAll, afterEach, beforeEach, describe, expect, test } from 'bun:tes
|
|
|
18
18
|
import { Window } from 'happy-dom';
|
|
19
19
|
import { h, render } from 'preact';
|
|
20
20
|
import { act } from 'preact/test-utils';
|
|
21
|
-
import {
|
|
21
|
+
import { splitAskFrames } from '@/client/hooks/chat/timeline/ask-frames';
|
|
22
|
+
import { AskFramesContext, type AskFramesHandle } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
22
23
|
import { OrphanAsks } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks';
|
|
23
24
|
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
24
25
|
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
@@ -66,7 +67,7 @@ describe('an ask dialog with no tool card', () => {
|
|
|
66
67
|
|
|
67
68
|
test('renders inline with every question and its own submit', () => {
|
|
68
69
|
const split = splitWithoutCards([ORPHAN]);
|
|
69
|
-
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: split.orphanAsks, respond: () => {} };
|
|
70
|
+
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: split.orphanAsks, formByTool: new Map(), respond: () => {} };
|
|
70
71
|
|
|
71
72
|
act(() => {
|
|
72
73
|
render(h(AskFramesContext.Provider, { value: handle }, h(OrphanAsks, {})), container);
|
|
@@ -87,7 +88,7 @@ describe('an ask dialog with no tool card', () => {
|
|
|
87
88
|
const handle: AskFramesHandle = {
|
|
88
89
|
framesByTool: split.framesByTool,
|
|
89
90
|
looseByTool: split.looseByTool,
|
|
90
|
-
orphanAsks: split.orphanAsks,
|
|
91
|
+
orphanAsks: split.orphanAsks, formByTool: new Map(),
|
|
91
92
|
respond: (_request, response) => sent.push(response),
|
|
92
93
|
};
|
|
93
94
|
|
|
@@ -158,7 +159,7 @@ describe('an ask dialog with no tool card', () => {
|
|
|
158
159
|
const handle: AskFramesHandle = {
|
|
159
160
|
framesByTool: split.framesByTool,
|
|
160
161
|
looseByTool: split.looseByTool,
|
|
161
|
-
orphanAsks: split.orphanAsks,
|
|
162
|
+
orphanAsks: split.orphanAsks, formByTool: new Map(),
|
|
162
163
|
respond: () => {},
|
|
163
164
|
};
|
|
164
165
|
act(() => { render(h(AskFramesContext.Provider, { value: handle }, h(OrphanAsks, {})), container); });
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
import { HelpCircle } from 'lucide-preact';
|
|
31
31
|
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
32
|
-
import { useAskFrames } from '@/client/hooks/chat/timeline/ask-frames';
|
|
32
|
+
import { useAskFrames } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
33
33
|
import { GroupedAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk';
|
|
34
34
|
import { LooseFieldAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/LooseFieldAsk';
|
|
35
35
|
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
@@ -33,7 +33,7 @@ import { AskPanel } from '@/client/components/workspace/chat-timeline/tool-rende
|
|
|
33
33
|
import { GroupedAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk';
|
|
34
34
|
import { PluginPendingInteractions } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions';
|
|
35
35
|
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
36
|
-
import { AskFramesContext, type AskFramesHandle } from '@/client/hooks/chat/timeline/ask-frames';
|
|
36
|
+
import { AskFramesContext, type AskFramesHandle } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
37
37
|
import { registerListSlot, resetListSlots } from '@/client/lib/plugins/list-slots';
|
|
38
38
|
import type { ToolCallData } from '@/shared/types';
|
|
39
39
|
import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
@@ -112,7 +112,7 @@ function mount(tool: ToolCallData, groups: ExtensionUiDialogRequest[][]): void {
|
|
|
112
112
|
const handle: AskFramesHandle = {
|
|
113
113
|
framesByTool: new Map([[tool.id, groups]]),
|
|
114
114
|
looseByTool: new Map(),
|
|
115
|
-
orphanAsks: [],
|
|
115
|
+
orphanAsks: [], formByTool: new Map(),
|
|
116
116
|
respond: (request, response) => calls.push({ request, response }),
|
|
117
117
|
};
|
|
118
118
|
act(() => {
|
package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { Window } from 'happy-dom';
|
|
|
3
3
|
import { h, render } from 'preact';
|
|
4
4
|
import { act } from 'preact/test-utils';
|
|
5
5
|
import { AskPanel } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel';
|
|
6
|
-
import {
|
|
6
|
+
import { splitAskFrames } from '@/client/hooks/chat/timeline/ask-frames';
|
|
7
|
+
import { AskFramesContext, type AskFramesHandle } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
7
8
|
import { createOmpAgentCallbacks, type OmpAgentCallbacksDeps } from '@/shared/lib/chat/timeline/omp-callbacks';
|
|
8
9
|
import { resetListSlots } from '@/client/lib/plugins/list-slots';
|
|
9
10
|
import type { ChatMessageData, ToolCallData } from '@/shared/types';
|
|
@@ -46,7 +47,7 @@ function mountFromFrame(frame: IncomingExtensionUiRequest): ExtensionUiDialogReq
|
|
|
46
47
|
createOmpAgentCallbacks(deps).onExtensionUiRequest?.(frame);
|
|
47
48
|
|
|
48
49
|
const split = splitAskFrames([MESSAGE], queue, true);
|
|
49
|
-
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: [], respond: () => {} };
|
|
50
|
+
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: [], formByTool: new Map(), respond: () => {} };
|
|
50
51
|
act(() => { render(h(AskFramesContext.Provider, { value: handle }, h(AskPanel, { tool: ASK_TOOL })), container); });
|
|
51
52
|
return queue;
|
|
52
53
|
}
|
|
@@ -54,7 +55,7 @@ function mountFromFrame(frame: IncomingExtensionUiRequest): ExtensionUiDialogReq
|
|
|
54
55
|
/** Mount the card with an explicit frame queue and tool, keeping it mounted. */
|
|
55
56
|
function paint(queue: ExtensionUiDialogRequest[], tool: ToolCallData = ASK_TOOL): void {
|
|
56
57
|
const split = splitAskFrames([MESSAGE], queue, true);
|
|
57
|
-
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: [], respond: () => {} };
|
|
58
|
+
const handle: AskFramesHandle = { framesByTool: split.framesByTool, looseByTool: split.looseByTool, orphanAsks: [], formByTool: new Map(), respond: () => {} };
|
|
58
59
|
act(() => { render(h(AskFramesContext.Provider, { value: handle }, h(AskPanel, { tool })), container); });
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -29,11 +29,12 @@ import type { ExtensionUiDialogRequest } from '@/shared/types/omp/agent';
|
|
|
29
29
|
import { isAskSettled, parseAskQuestions } from '@/shared/lib/chat/ask-questions';
|
|
30
30
|
import type { AskQuestion } from '@/shared/lib/chat/ask-form/types';
|
|
31
31
|
import { parseAskResult } from '@/shared/lib/chat/ask-results';
|
|
32
|
-
import { useAskFrames } from '@/client/hooks/chat/timeline/ask-frames';
|
|
32
|
+
import { useAskFrames } from '@/client/hooks/chat/timeline/ask-frames-context';
|
|
33
33
|
import { liveFrame, useAskDrafts } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts';
|
|
34
34
|
import { QuestionBlock } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock';
|
|
35
35
|
import { GroupedAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk';
|
|
36
36
|
import { FormAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk';
|
|
37
|
+
import { FormDialog } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog';
|
|
37
38
|
import { LooseFieldAsk } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/LooseFieldAsk';
|
|
38
39
|
import { PluginPendingInteractions } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions';
|
|
39
40
|
import type { ExtensionDialogResponse } from '@/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy';
|
|
@@ -60,15 +61,19 @@ interface SubmittedAsk {
|
|
|
60
61
|
export function AskPanel({ tool }: { tool: ToolCallData }) {
|
|
61
62
|
const questions = parseAskQuestions(tool);
|
|
62
63
|
const recorded = parseAskResult(tool, questions);
|
|
63
|
-
const { framesByTool, looseByTool, respond } = useAskFrames();
|
|
64
|
+
const { framesByTool, looseByTool, formByTool, respond } = useAskFrames();
|
|
64
65
|
const groups = framesByTool.get(tool.id) ?? NO_GROUPS;
|
|
65
66
|
const loose = looseByTool.get(tool.id) ?? NO_FRAMES;
|
|
66
67
|
const settled = isAskSettled(tool);
|
|
68
|
+
// omp 19.1.0's whole-form dialog answers every control in ONE `{ data }`
|
|
69
|
+
// reply; it is not part of the per-field walk at all.
|
|
70
|
+
const formFrame = formByTool.get(tool.id) ?? null;
|
|
67
71
|
// Two or more open fields are answered by ONE Submit (`FormAsk`). The
|
|
68
72
|
// per-question draft bookkeeper must not run in that mode: it auto-sends a
|
|
69
73
|
// restored draft the moment its frame arrives, which would answer question 1
|
|
70
74
|
// before the user could reach the form's Submit.
|
|
71
|
-
const groupedForm =
|
|
75
|
+
const groupedForm =
|
|
76
|
+
!formFrame && !settled && questions.length > 1 && recorded.some((answer) => answer === null);
|
|
72
77
|
const [submitted, setSubmitted] = useState<SubmittedAsk | null>(null);
|
|
73
78
|
const { drafts, multiSelected, commit, toggleMulti } = useAskDrafts({
|
|
74
79
|
toolId: tool.id,
|
|
@@ -93,7 +98,9 @@ export function AskPanel({ tool }: { tool: ToolCallData }) {
|
|
|
93
98
|
// mid-ask reads its still-blocking tool call back from the JSONL as
|
|
94
99
|
// `success` (omp writes no result until the question is answered), and that
|
|
95
100
|
// question must stay answerable.
|
|
96
|
-
const waiting =
|
|
101
|
+
const waiting =
|
|
102
|
+
!settled &&
|
|
103
|
+
(formFrame !== null || groups.some((frames, index) => frames.length > 0 && !recorded[index]));
|
|
97
104
|
// omp asks in order and blocks on each, so the earliest question holding a
|
|
98
105
|
// dialog is the only open one: everything before it is answered, whether or
|
|
99
106
|
// not this client still has the text.
|
|
@@ -148,6 +155,35 @@ export function AskPanel({ tool }: { tool: ToolCallData }) {
|
|
|
148
155
|
);
|
|
149
156
|
}
|
|
150
157
|
|
|
158
|
+
// omp 19.1.0's `method:"form"` frame: ONE dialog for the whole form, answered
|
|
159
|
+
// by one `{ data }` reply. It carries no per-question dialogs, so it is drawn
|
|
160
|
+
// before the per-field branches — those have nothing to show here.
|
|
161
|
+
if (formFrame) {
|
|
162
|
+
return (
|
|
163
|
+
<div className="space-y-2">
|
|
164
|
+
{waiting && (
|
|
165
|
+
<div className="flex items-center gap-1.5 text-[10.5px] text-ink/50">
|
|
166
|
+
<HelpCircle size={11} className="shrink-0" />
|
|
167
|
+
<span>Input needed: the agent is blocked until you answer.</span>
|
|
168
|
+
</div>
|
|
169
|
+
)}
|
|
170
|
+
<FormDialog
|
|
171
|
+
frame={formFrame}
|
|
172
|
+
questions={questions}
|
|
173
|
+
recorded={recorded.map((answer) => (answer ? [...answer.selectedOptions, ...(answer.customInput ? [answer.customInput] : [])] : null))}
|
|
174
|
+
onRespond={(response) => respond(formFrame, response)}
|
|
175
|
+
interactions={
|
|
176
|
+
<PluginPendingInteractions
|
|
177
|
+
frame={formFrame}
|
|
178
|
+
recorded={questions.map((_, index) => recorded[index] !== null)}
|
|
179
|
+
onRespond={(response) => respond(formFrame, response)}
|
|
180
|
+
/>
|
|
181
|
+
}
|
|
182
|
+
/>
|
|
183
|
+
</div>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
151
187
|
// Two or more fields from the per-field walk: draw the WHOLE form and take a
|
|
152
188
|
// single Submit. The old card answered one question per round trip, so the
|
|
153
189
|
// second question appeared only after the first had gone to omp — and a
|
package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Footer.tsx
CHANGED
|
@@ -80,7 +80,7 @@ export function ExtensionDialogFooter({
|
|
|
80
80
|
type="button"
|
|
81
81
|
onClick={onSubmit}
|
|
82
82
|
disabled={isSelectDisabled}
|
|
83
|
-
className="flex cursor-pointer items-center gap-1.5 rounded-lg bg-ink px-4 py-1.5 text-[12px] font-semibold text-paper shadow-xs transition-all hover:opacity-90
|
|
83
|
+
className="flex cursor-pointer items-center gap-1.5 rounded-lg bg-ink px-4 py-1.5 text-[12px] font-semibold text-paper shadow-xs transition-all hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-35"
|
|
84
84
|
>
|
|
85
85
|
<span>
|
|
86
86
|
{method === 'confirm'
|
package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx
CHANGED
|
@@ -137,7 +137,7 @@ export function ExtensionDialog({ request, onRespond }: ExtensionDialogProps) {
|
|
|
137
137
|
|
|
138
138
|
return (
|
|
139
139
|
<div
|
|
140
|
-
className="extension-dialog-backdrop modal-scrim fixed inset-0 z-50 flex items-center justify-center
|
|
140
|
+
className="extension-dialog-backdrop modal-scrim fixed inset-0 z-50 flex items-center justify-center modal-safe sm:p-6 backdrop-blur-[8px]"
|
|
141
141
|
onMouseDown={(e) => {
|
|
142
142
|
if (e.target === e.currentTarget) cancel();
|
|
143
143
|
}}
|