@kabmo-labs/kabmo 0.50.0 → 0.51.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 +503 -501
- package/dist/client/static/js/{Body-pd3nt4xa.js → Body-s3nh6vet.js} +3 -3
- package/dist/client/static/js/{CsvGrid-eksmqv8f.js → CsvGrid-j4h6cpnn.js} +2 -2
- package/dist/client/static/js/{DocxView-xfx1kt8x.js → DocxView-197x16zq.js} +3 -3
- package/dist/client/static/js/{DrawioView-2xyqg9bv.js → DrawioView-v6ps0cm5.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-ps3f0aa5.js → HtmlPreview-a2t5zngp.js} +1 -1
- package/dist/client/static/js/ImageView-ar7hz7jx.js +1 -0
- package/dist/client/static/js/LayoutWrapper-epef152a.js +2 -0
- package/dist/client/static/js/MergeDiffView-7rwjvzk5.js +1 -0
- package/dist/client/static/js/Modal-9nxt67fm.js +60 -0
- package/dist/client/static/js/{PdfView-8fp08jym.js → PdfView-gzhcym20.js} +1 -1
- package/dist/client/static/js/SessionsView-3h872gpe.js +1 -0
- package/dist/client/static/js/{SheetView-g7mstjdp.js → SheetView-baaynkb4.js} +8 -8
- package/dist/client/static/js/{SvgPreview-wsv4h6c6.js → SvgPreview-jzcqwwcc.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-1kgm1049.js → abnfDiagram-O67JEVCF-grb1sfhr.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-3hkq8grc.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-mtm210rw.js → architectureDiagram-NJMV4G6O-9084jzwr.js} +5 -5
- package/dist/client/static/js/{astro-dszrfwwn.js → astro-m3fcq2sa.js} +1 -1
- package/dist/client/static/js/bash-n7wcmq3s.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-s474vn2w.js → blockDiagram-BEXU5L5S-qqcjrg1b.js} +6 -6
- package/dist/client/static/js/c-ypdp030b.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-s68v6tc8.js → c4Diagram-YGBWAQC7-gc8fqbpc.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-291va3yk.js → classDiagram-v2-NBCMYWYE-pp6060kq.js} +7 -7
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-0zg7crdw.js → cose-bilkent-JH36ORCC-744ekavk.js} +1 -1
- package/dist/client/static/js/cpp-cxwev3gs.js +1 -0
- package/dist/client/static/js/css-6mxcqf8c.js +1 -0
- package/dist/client/static/js/css-9gak6bze.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-9m18e6m5.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-4gnmn3yc.js → cynefinDiagram-VND7K2PF-57dja6g9.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-nxmj6bkg.js → dagre-6A5THRUB-de4xrbrw.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-3171dabw.js → diagram-22UHCM2B-ky3ncyv8.js} +18 -18
- package/dist/client/static/js/{diagram-3UASUU5V-9h1pd6h8.js → diagram-3UASUU5V-zgg82bz9.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-ywfrbd6m.js → diagram-ATOU4E4O-r4s13e4n.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-t87b4wbk.js → diagram-CDSNMT55-my21t0kq.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-bzv52p97.js → diagram-MLGK6HIB-pvt20jtj.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-8f66rp0a.js → diagram-MPIPVDR6-as9dk4f3.js} +2 -2
- package/dist/client/static/js/{dockerfile-z3v0km9v.js → dockerfile-3b5caedj.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3y4w2j6t.js → ebnfDiagram-ZINNZB2B-tj3hkcj4.js} +1 -1
- package/dist/client/static/js/{elixir-c701n0qg.js → elixir-7q2k61zb.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-d9d23jch.js → elk-276RUBZZ-5e7wczf3.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-w4z3501c.js → erDiagram-OPXOYQCR-5jje7qrh.js} +3 -3
- package/dist/client/static/js/{erlang-cpw5s1f9.js → erlang-tjsd7n4d.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-d4egnv9v.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-pdeqndnd.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-7wcxk4bm.js → ganttDiagram-FUAMR5RP-7hresycc.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-grqv890n.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-sdh1hsb1.js → gitGraphDiagram-X574FWY7-8m202jb7.js} +17 -17
- package/dist/client/static/js/graphql-6rwdfcnf.js +1 -0
- package/dist/client/static/js/html-p76eszt9.js +1 -0
- package/dist/client/static/js/{index-zhnfq8br.js → index-0prwdwyb.js} +2 -2
- package/dist/client/static/js/{index-tew3rd6t.js → index-0y6tstk8.js} +1 -1
- package/dist/client/static/js/{index-1dx4dqzy.js → index-20hj80g4.js} +4 -4
- package/dist/client/static/js/index-21421tq7.js +2 -0
- package/dist/client/static/js/{index-0q39ajgh.js → index-254387vg.js} +2 -2
- package/dist/client/static/js/index-2y4gk5q5.js +2 -0
- package/dist/client/static/js/index-3fk8grhz.js +2 -0
- package/dist/client/static/js/index-3rrdmk9m.js +2 -0
- package/dist/client/static/js/{index-frhxbqhg.js → index-3sz9cztk.js} +1 -1
- package/dist/client/static/js/{index-9ydvkxz1.css → index-4m2d73m3.css} +1 -1
- package/dist/client/static/js/{index-7xn7gxgw.js → index-4nvcwtvr.js} +2 -2
- package/dist/client/static/js/index-4ppap7vb.js +9 -0
- package/dist/client/static/js/{index-vgwjn4de.js → index-4tbdws4r.js} +2 -2
- package/dist/client/static/js/{index-hqhz4eam.js → index-56hy2hcy.js} +1 -1
- package/dist/client/static/js/{index-dgkpbrdr.js → index-60g0e74a.js} +2 -2
- package/dist/client/static/js/{index-n54jd3aw.js → index-7ag37ghj.js} +11 -11
- package/dist/client/static/js/{index-bggz63br.js → index-7ehcjb3r.js} +7 -7
- package/dist/client/static/js/index-899yw6fh.js +2 -0
- package/dist/client/static/js/{index-4vaxdt8a.js → index-8pqx5n2p.js} +2 -2
- package/dist/client/static/js/{index-971stdh4.js → index-91jm3ywm.js} +2 -2
- package/dist/client/static/js/{index-5qwgexg6.js → index-9qf2h9jb.js} +4 -4
- package/dist/client/static/js/{index-wbma8kqw.js → index-9rp7h1nv.js} +23 -23
- package/dist/client/static/js/index-9rr23e0e.js +2 -0
- package/dist/client/static/js/index-9wj4ma9g.js +3 -0
- package/dist/client/static/js/{index-e471eprg.js → index-awtk0djy.js} +1 -1
- package/dist/client/static/js/{index-1d8v3bvm.js → index-awz6pyd0.js} +2 -2
- package/dist/client/static/js/index-cvx1vkrx.js +1 -0
- package/dist/client/static/js/{index-09ap9ncj.js → index-cwwg7k5f.js} +46 -46
- package/dist/client/static/js/{index-8fk7h2me.js → index-dzatbdws.js} +5 -5
- package/dist/client/static/js/{index-1adfks1n.js → index-e6ew77ph.js} +2 -2
- package/dist/client/static/js/{index-144aknp3.js → index-ej1va073.js} +2 -2
- package/dist/client/static/js/{index-cm8pa783.js → index-er7pj5k6.js} +2 -2
- package/dist/client/static/js/index-fm0t4pct.js +4 -0
- package/dist/client/static/js/{index-aqqj4xxy.js → index-g5wp6ksw.js} +2 -2
- package/dist/client/static/js/{index-ajqmcds5.js → index-gy4mtr2e.js} +2 -2
- package/dist/client/static/js/{index-kce86cnw.js → index-j9y4tjk0.js} +2 -2
- package/dist/client/static/js/{index-gws4prmg.js → index-kt7c42n7.js} +2 -2
- package/dist/client/static/js/index-ktmb341a.js +468 -0
- package/dist/client/static/js/{index-56319bht.js → index-m6zncj00.js} +2 -2
- package/dist/client/static/js/{index-jxxewcat.js → index-mpyd7qxj.js} +2 -2
- package/dist/client/static/js/{index-gcgsjd3c.js → index-ms80nne4.js} +2 -2
- package/dist/client/static/js/{index-k66w6d9b.js → index-my856e49.js} +2 -2
- package/dist/client/static/js/{index-c2mqr5fh.js → index-nt17ejrm.js} +2 -2
- package/dist/client/static/js/{index-zsx5vs3j.js → index-pvv340b4.js} +2 -2
- package/dist/client/static/js/{index-svx6rnfs.js → index-pxr36neg.js} +2 -2
- package/dist/client/static/js/{index-r2z0a118.js → index-q0k1am0g.js} +2 -2
- package/dist/client/static/js/{index-xrn2reb5.js → index-qrpx4sk1.js} +2 -2
- package/dist/client/static/js/{index-ajdzvegm.js → index-r2zsw7nw.js} +8 -8
- package/dist/client/static/js/{index-xgbcn89g.js → index-rbkvw2xs.js} +2 -2
- package/dist/client/static/js/{index-2g1ey1c9.js → index-scmtzcv1.js} +2 -2
- package/dist/client/static/js/{index-3rhk4apq.js → index-syvkpnc8.js} +1 -1
- package/dist/client/static/js/index-tfqqsj2g.js +1 -0
- package/dist/client/static/js/{index-7jdz4jr4.js → index-tj7xr4ta.js} +2 -2
- package/dist/client/static/js/{index-1vfej0gk.js → index-wvw70pgd.js} +2 -2
- package/dist/client/static/js/{index-qxzyvye9.js → index-wxs0x3g1.js} +2 -2
- package/dist/client/static/js/index-x507ndnc.js +314 -0
- package/dist/client/static/js/{index-1jx4nt2f.js → index-x87scjpa.js} +1 -1
- package/dist/client/static/js/{index-grkacfv3.js → index-xtrsvm0d.js} +2 -2
- package/dist/client/static/js/{index-ratbr10x.js → index-y1j18rha.js} +2 -2
- package/dist/client/static/js/{index-r6bm9sth.js → index-yv2ervdj.js} +7 -7
- package/dist/client/static/js/{index-k3vvk28c.js → index-z2pmt1bc.js} +1 -1
- package/dist/client/static/js/{index-ap6hv7s7.js → index-z446edg9.js} +1 -1
- package/dist/client/static/js/{index-1ec33b1j.js → index-zkgqa0c2.js} +2 -2
- package/dist/client/static/js/index-zwbw177x.js +2 -0
- package/dist/client/static/js/info-A6RAGUB7-rzpg7qk1.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-gtdp0z6p.js → infoDiagram-VRGFBTTK-5mb5w005.js} +2 -2
- package/dist/client/static/js/ini-kjcpgebh.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-c05m0sqq.js → ishikawaDiagram-OU5B5YK6-zk7fa0fm.js} +3 -3
- package/dist/client/static/js/java-0bcyv1jt.js +1 -0
- package/dist/client/static/js/javascript-0mqgcvps.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kgk5ygm2.js → journeyDiagram-ZHPQQLJL-8jd7b2aw.js} +5 -5
- package/dist/client/static/js/json-mb8k0b1n.js +1 -0
- package/dist/client/static/js/jsx-8p6dqgpq.js +1 -0
- package/dist/client/static/js/{julia-w13bz4s1.js → julia-nwh5w343.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-q1w9w68s.js → kanban-definition-PNTS6WVX-yp9rks4k.js} +7 -7
- package/dist/client/static/js/lua-nxnqww9z.js +1 -0
- package/dist/client/static/js/markdown-8gbyxxjd.js +1 -0
- package/dist/client/static/js/{mermaid.core-1rz62j9g.js → mermaid.core-kxsxr8ec.js} +9 -9
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-3m3w6bnb.js → mindmap-definition-NLK3R4M7-anx2kj3b.js} +5 -5
- package/dist/client/static/js/one-dark-pro-wyegjr0d.js +1 -0
- package/dist/client/static/js/one-light-kp6c3eqh.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-eac14hsq.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-svd3ex4e.js → pegDiagram-GJSIUBJH-9egqyzkc.js} +1 -1
- package/dist/client/static/js/{perl-hcg3hacf.js → perl-wb4wtc9x.js} +1 -1
- package/dist/client/static/js/{php-q6hhp84p.js → php-9g594k9f.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-a9xqvysf.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-2nrkw034.js → pieDiagram-5QR66LMP-f3dvprbm.js} +3 -3
- package/dist/client/static/js/properties-d5bwhgwz.js +1 -0
- package/dist/client/static/js/python-fdwwjjhh.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-4895d1aq.js → quadrantDiagram-O4NWA36T-qsghd295.js} +6 -6
- package/dist/client/static/js/r-4d2ygtfj.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-jv2pm0fe.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-j74sc0b6.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-eaf19baz.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d4j5nq31.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-ba862a9p.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-zj3g9yne.js → railroadDiagram-XR7U4H2S-6vmazht2.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-727yjvs8.js → requirementDiagram-PLB6GJNP-phs0wn1v.js} +5 -5
- package/dist/client/static/js/{ruby-wzqz8vw6.js → ruby-c4hxsegh.js} +1 -1
- package/dist/client/static/js/{rust-r94pgqvf.js → rust-e4whdswc.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-17c7p2pe.js → sankeyDiagram-IPEJSGJF-vkktegjk.js} +4 -4
- package/dist/client/static/js/{sass-xb3van7h.js → sass-6yxywx7t.js} +1 -1
- package/dist/client/static/js/{scss-ddg6t3x4.js → scss-9wz47c6t.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-wcmbpckr.js → sequenceDiagram-PO4LG4MO-37e6se72.js} +16 -16
- package/dist/client/static/js/{sizeCapture-INFHLROL-nkr57cd6.js → sizeCapture-INFHLROL-3b4nsa4s.js} +1 -1
- package/dist/client/static/js/sql-sd00wgem.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vd7r8s78.js → stateDiagram-v2-GCMORJYK-2nnyqs9x.js} +3 -3
- package/dist/client/static/js/{svelte-wzaxz546.js → svelte-mm3jfpje.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-zhxm05ak.js → swimlanes-2SLR337P-eezd46ps.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-h78096xp.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-n7gbzhzd.js → timeline-definition-EJHVYXUP-pz0f2b4h.js} +6 -6
- package/dist/client/static/js/treeView-Q6P3EWNA-e8yb44pd.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-zvdv84vp.js +1 -0
- package/dist/client/static/js/typescript-5txwpd9t.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-davsnwkf.js → usecaseDiagram-POWQR4AR-hvg7a87b.js} +29 -29
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-gb54bh5k.js → vennDiagram-UO4OBE2U-03zh9phs.js} +8 -8
- package/dist/client/static/js/{vue-6zhfw7zx.js → vue-rcdqpz7q.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-hbv0cg4s.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-sf98cg9t.js → wardleyDiagram-VNRHLVJA-xy77th92.js} +5 -5
- package/dist/client/static/js/xml-vtrdnrn6.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9nn09k40.js → xychartDiagram-PMCCYNJV-h48448cm.js} +4 -4
- package/dist/client/static/js/yaml-6k1tmwtm.js +1 -0
- package/package.json +2 -1
- package/src/client/components/common/MarkdownRenderer.tsx +31 -34
- package/src/client/components/common/ViewportSelector.tsx +4 -0
- package/src/client/components/common/command-palette/index.tsx +5 -2
- package/src/client/components/common/markdown-inline-file.test.tsx +131 -0
- package/src/client/components/common/search-select/OptionList.tsx +164 -0
- package/src/client/components/common/search-select/index.tsx +159 -136
- package/src/client/components/common/search-select/option.ts +16 -0
- package/src/client/components/common/search-select/search-select.test.tsx +61 -2
- package/src/client/components/common/sort-menu/index.tsx +9 -4
- package/src/client/components/layout/session-sidebar/HarnessFilter.tsx +26 -6
- package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +45 -49
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +31 -25
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +40 -101
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +12 -10
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +12 -10
- package/src/client/components/settings/categories/dictation-settings/CaptureSection.tsx +13 -18
- package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +8 -9
- package/src/client/components/settings/categories/keyboard-settings/ComposerKeys.tsx +10 -10
- package/src/client/components/settings/categories/mcp-settings/AdvancedSection.tsx +21 -18
- package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +12 -7
- package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +11 -11
- package/src/client/components/settings/categories/omp-settings/RoleEditor.test.ts +14 -11
- package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +17 -16
- package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +11 -9
- package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +10 -9
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +10 -8
- package/src/client/components/settings/categories/provider-settings/DialectFields.tsx +40 -24
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +13 -9
- package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +22 -17
- package/src/client/components/settings/categories/provider-settings/PresetPicker.tsx +79 -50
- package/src/client/components/settings/categories/provider-settings/model-dialogs.test.tsx +14 -7
- package/src/client/components/settings/categories/voice-settings/SpeechSettings.test.tsx +117 -15
- package/src/client/components/settings/categories/voice-settings/SpeechSettings.tsx +27 -3
- package/src/client/components/settings/categories/voice-settings/speech/EndpointSection.tsx +3 -1
- package/src/client/components/settings/categories/voice-settings/speech/EngineSection.tsx +32 -2
- package/src/client/components/settings/categories/voice-settings/speech/ModelsSection.tsx +277 -0
- package/src/client/components/settings/categories/voice-settings/speech/TestSection.tsx +2 -1
- package/src/client/components/settings/categories/voice-settings/speech/VoiceSection.tsx +83 -41
- package/src/client/components/workspace/btw-panel/TopicMenu.tsx +20 -2
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.speech.test.tsx +35 -6
- package/src/client/components/workspace/chat-timeline/SpeechButton.tsx +111 -36
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +21 -6
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +7 -4
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +22 -6
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +17 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +8 -65
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.test.ts +12 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/registry.test.ts +35 -218
- package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +40 -177
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.test.ts +13 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackToolJson.test.tsx +79 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackToolJson.tsx +86 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +25 -16
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts +4 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +11 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.plugin.test.ts +3 -1
- package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +15 -15
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +30 -5
- package/src/client/data/mock/chat.ts +17 -0
- package/src/client/data/samples/tools-session.ts +8 -5
- package/src/client/hooks/editor/font.test.ts +21 -0
- package/src/client/hooks/editor/font.ts +12 -9
- package/src/client/hooks/settings/local-tts-models.ts +164 -0
- package/src/client/hooks/tts/tts-context.ts +6 -0
- package/src/client/hooks/tts/use-tts-player.ts +10 -0
- package/src/client/hooks/ui/markdown-render.ts +9 -1
- package/src/client/hooks/ui/markdown-scoped-links.ts +77 -0
- package/src/client/hooks/ui/open-inline-file.test.ts +144 -0
- package/src/client/hooks/ui/open-inline-file.ts +71 -0
- package/src/client/lib/commands/overlays.ts +16 -2
- package/src/client/lib/tts/player.test.ts +61 -0
- package/src/client/lib/tts/player.ts +120 -41
- package/src/client/tailwind.css +16 -0
- package/src/server/lib/chat/normalize-tools.server.test.ts +79 -0
- package/src/server/lib/chat/normalize-tools.server.ts +87 -0
- package/src/server/lib/harness/acp/background-replay.test.ts +36 -0
- package/src/server/lib/harness/acp/background-replay.ts +8 -3
- package/src/server/lib/harness/acp/frames-tool-shapes.test.ts +41 -13
- package/src/server/lib/harness/acp/frames-vendor-names.test.ts +209 -0
- package/src/server/lib/harness/acp/frames.test.ts +11 -20
- package/src/server/lib/harness/acp/frames.ts +5 -3
- package/src/server/lib/harness/acp/mapper.ts +5 -41
- package/src/server/lib/harness/acp/replay-transcript.ts +6 -1
- package/src/server/lib/harness/acp/subagent-frames.test.ts +1 -1
- package/src/server/lib/harness/acp/subagent-frames.ts +0 -2
- package/src/server/lib/harness/acp/tool-calls.ts +5 -16
- package/src/server/lib/harness/acp/tool-identity.test.ts +69 -8
- package/src/server/lib/harness/acp/tool-identity.ts +58 -10
- package/src/server/lib/harness/acp/tool-shape.ts +5 -3
- package/src/server/lib/harness/codex/transcript.server.test.ts +3 -1
- package/src/server/lib/harness/codex/transcript.server.ts +8 -15
- package/src/server/lib/lifecycle/paths.ts +12 -0
- package/src/server/lib/omp/session/messages.ts +5 -1
- package/src/server/lib/realtime/topics/peer-relay.server.ts +9 -1
- package/src/server/lib/realtime/topics/session.server.ts +5 -1
- package/src/server/lib/tts/engines/adapters.test.ts +17 -8
- package/src/server/lib/tts/engines/deepgram.ts +30 -9
- package/src/server/lib/tts/engines/index.ts +11 -0
- package/src/server/lib/tts/engines/local.ts +53 -0
- package/src/server/lib/tts/engines/sherpa-onnx-node.d.ts +38 -0
- package/src/server/lib/tts/engines/sherpa.test.ts +53 -0
- package/src/server/lib/tts/engines/sherpa.ts +287 -0
- package/src/server/lib/tts/local-models.server.ts +257 -0
- package/src/server/lib/tts/local-request.test.ts +66 -0
- package/src/server/lib/tts/local-request.ts +59 -0
- package/src/server/lib/tts/model-manifest.server.test.ts +71 -0
- package/src/server/lib/tts/model-manifest.server.ts +154 -0
- package/src/server/lib/tts/settings.server.ts +7 -4
- package/src/server/lib/tts/wav.test.ts +37 -0
- package/src/server/lib/tts/wav.ts +43 -0
- package/src/server/routes/chat/session-legacy-tools.test.ts +132 -0
- package/src/server/routes/chat/session.ts +10 -4
- package/src/server/routes/tts/index.ts +2 -0
- package/src/server/routes/tts/models.test.ts +148 -0
- package/src/server/routes/tts/models.ts +89 -0
- package/src/shared/lib/chat/tool/normalize.ts +67 -0
- package/src/shared/lib/chat/tool/render-key.test.ts +167 -0
- package/src/shared/lib/chat/tool/render-key.ts +247 -0
- package/src/shared/lib/chat/tool/tool-aliases.test.ts +42 -0
- package/src/shared/lib/chat/tool/tool-aliases.ts +59 -12
- package/src/shared/lib/fs/open-reference.test.ts +64 -0
- package/src/shared/lib/fs/open-reference.ts +74 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +20 -20
- package/src/shared/lib/markdown/inline-file.test.ts +100 -0
- package/src/shared/lib/markdown/inline-file.ts +213 -0
- package/src/shared/lib/omp/session/messages-map.test.ts +2 -1
- package/src/shared/lib/omp/session/messages-parse.ts +3 -2
- package/src/shared/lib/omp/session/parse-message-blocks.ts +14 -0
- package/src/shared/lib/omp/subagent/transcript-client.ts +5 -1
- package/src/shared/lib/tts/engines.test.ts +28 -3
- package/src/shared/lib/tts/engines.ts +31 -6
- package/src/shared/lib/tts/local-models.test.ts +69 -0
- package/src/shared/lib/tts/local-models.ts +200 -0
- package/src/shared/lib/tts/speakable.test.ts +21 -1
- package/src/shared/lib/tts/speakable.ts +66 -33
- package/src/shared/lib/tts/voices.ts +125 -19
- package/src/shared/types/chat.ts +3 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/tool-render.ts +37 -0
- package/dist/client/static/js/ImageView-7vse3k6x.js +0 -1
- package/dist/client/static/js/LayoutWrapper-qdp83fps.js +0 -2
- package/dist/client/static/js/MergeDiffView-hzsccppq.js +0 -1
- package/dist/client/static/js/Modal-zw9x5b6f.js +0 -60
- package/dist/client/static/js/SessionsView-qmgg03fv.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-g7b64973.js +0 -1
- package/dist/client/static/js/bash-z5pe89pt.js +0 -1
- package/dist/client/static/js/c-fy0fysfw.js +0 -1
- package/dist/client/static/js/cpp-wam8dze6.js +0 -1
- package/dist/client/static/js/css-ke51m4kc.js +0 -1
- package/dist/client/static/js/css-yryw442h.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-8bscrcct.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-pj22bng1.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-9h6g160j.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-hgw4jcvk.js +0 -1
- package/dist/client/static/js/graphql-0yv8dc1v.js +0 -1
- package/dist/client/static/js/html-zk3m0az9.js +0 -1
- package/dist/client/static/js/index-0ff2x5g9.js +0 -1
- package/dist/client/static/js/index-17jy16v3.js +0 -314
- package/dist/client/static/js/index-1kjgdyfk.js +0 -2
- package/dist/client/static/js/index-4z3qtazf.js +0 -2
- package/dist/client/static/js/index-779rptb2.js +0 -1
- package/dist/client/static/js/index-9jrej3ht.js +0 -3
- package/dist/client/static/js/index-bczhbk01.js +0 -2
- package/dist/client/static/js/index-evvmkk2f.js +0 -2
- package/dist/client/static/js/index-jr6q69r3.js +0 -465
- package/dist/client/static/js/index-qaxjp73x.js +0 -2
- package/dist/client/static/js/index-rgneq3zt.js +0 -2
- package/dist/client/static/js/index-tfwsch7a.js +0 -4
- package/dist/client/static/js/index-vn495w82.js +0 -9
- package/dist/client/static/js/info-A6RAGUB7-k0kv05ny.js +0 -1
- package/dist/client/static/js/ini-apj95p59.js +0 -1
- package/dist/client/static/js/java-khk2v3g4.js +0 -1
- package/dist/client/static/js/javascript-gez6yppm.js +0 -1
- package/dist/client/static/js/json-r78y6e80.js +0 -1
- package/dist/client/static/js/jsx-h7hfj8cz.js +0 -1
- package/dist/client/static/js/lua-pat2bzg3.js +0 -1
- package/dist/client/static/js/markdown-545zn05v.js +0 -1
- package/dist/client/static/js/one-dark-pro-7c942tnw.js +0 -1
- package/dist/client/static/js/one-light-tp8y6c5g.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-ne66q5h9.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-ej9aysvz.js +0 -1
- package/dist/client/static/js/properties-9f76xngb.js +0 -1
- package/dist/client/static/js/python-nwerpkfq.js +0 -1
- package/dist/client/static/js/r-39k5dr2p.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-375pe46t.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-hdgdfsc1.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2p5ynn4a.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-2p1fxxen.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-g131pt42.js +0 -1
- package/dist/client/static/js/sql-4dcrp3sw.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-myzk2rg0.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-gfztfha9.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-kwtrwq1f.js +0 -1
- package/dist/client/static/js/typescript-q0493nmw.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-30dnzvww.js +0 -1
- package/dist/client/static/js/xml-91sb3gt9.js +0 -1
- package/dist/client/static/js/yaml-ghx4mjw1.js +0 -1
|
@@ -13,11 +13,17 @@
|
|
|
13
13
|
* writer `todowrite` opened no panel at all: the card fell back to the generic
|
|
14
14
|
* Input/Output body while a `bash`/`todo` card was one lookup away. Measured on
|
|
15
15
|
* opencode 2.2.5: `shell`, `todowrite`, `webfetch`, `websearch`, `subagent`,
|
|
16
|
-
* `patch
|
|
16
|
+
* `patch` — and the same gap exists on every other adapter that names its tools
|
|
17
|
+
* in its own vocabulary: kimi (`ReadFile`, `StrReplaceFile`, `SetTodoList`),
|
|
18
|
+
* antigravity (`view_file`, `write_to_file`, `replace_file_content`), grok
|
|
19
|
+
* (`run_terminal_command`, `search_replace`), dsh (`str_replace_editor`,
|
|
20
|
+
* `run_code`), hermes (`delegate_task`, `execute_code`, `search_files`),
|
|
21
|
+
* command-code (`shell_command`, `read_directory`).
|
|
17
22
|
*
|
|
18
|
-
* This is the SINGLE table for that vocabulary
|
|
19
|
-
*
|
|
20
|
-
*
|
|
23
|
+
* This is the SINGLE table for that vocabulary. It is applied by the SERVER's
|
|
24
|
+
* one resolver (`shared/lib/chat/tool/render-key.ts`) at ingress and on every
|
|
25
|
+
* stored transcript read, so a live row and a replayed row classify the same
|
|
26
|
+
* and no client derives a panel from a name.
|
|
21
27
|
*
|
|
22
28
|
* It deliberately does NOT restate Kabmo's own legacy aliases (`read_file`,
|
|
23
29
|
* `terminal`, …): those live with the panels/phrases that own them.
|
|
@@ -28,37 +34,78 @@ export const AGENT_TOOL_ALIASES: Readonly<Record<string, string>> = {
|
|
|
28
34
|
shell: 'bash',
|
|
29
35
|
// The same slot across adapters: claude-code-acp reports `Bash` (already the
|
|
30
36
|
// key) or `PowerShell`; codex-acp reports `exec_command`; gemini-family
|
|
31
|
-
// agents (`qwen`, `agy`) report `run_shell_command
|
|
37
|
+
// agents (`qwen`, `agy`) report `run_shell_command`; grok reports
|
|
38
|
+
// `run_terminal_command`/`run_terminal_cmd`; command-code reports
|
|
39
|
+
// `shell_command`; codex's `write_stdin` is the interactive half of the same
|
|
40
|
+
// exec slot.
|
|
32
41
|
powershell: 'bash',
|
|
33
42
|
exec_command: 'bash',
|
|
34
43
|
run_shell_command: 'bash',
|
|
44
|
+
run_terminal_command: 'bash',
|
|
45
|
+
run_terminal_cmd: 'bash',
|
|
46
|
+
shell_command: 'bash',
|
|
47
|
+
write_stdin: 'bash',
|
|
35
48
|
// A plan update from opencode is `todowrite`, from codex `update_plan`;
|
|
36
|
-
// Kabmo's panel key is `todo`.
|
|
49
|
+
// Kabmo's panel key is `todo`. kimi spells it `SetTodoList`/`TodoList`.
|
|
37
50
|
todowrite: 'todo',
|
|
38
51
|
todo_write: 'todo',
|
|
39
52
|
update_plan: 'todo',
|
|
53
|
+
settodolist: 'todo',
|
|
54
|
+
todolist: 'todo',
|
|
40
55
|
// Fetching one URL and searching the web share Kabmo's web_search panel,
|
|
41
56
|
// which falls back to the output text for a single page.
|
|
42
57
|
webfetch: 'web_search',
|
|
43
58
|
websearch: 'web_search',
|
|
44
59
|
web_fetch: 'web_search',
|
|
45
60
|
google_web_search: 'web_search',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
fetchurl: 'web_search',
|
|
62
|
+
read_url_content: 'web_search',
|
|
63
|
+
search_web: 'web_search',
|
|
64
|
+
web_extract: 'web_search',
|
|
65
|
+
// Child-agent calls: opencode `subagent`, claude-code-acp `Agent`/`Task`,
|
|
66
|
+
// hermes `delegate_task`. Kabmo's delegation panel is `task` (its
|
|
67
|
+
// `acpDelegationRow` reads description/prompt/agent).
|
|
49
68
|
subagent: 'task',
|
|
50
69
|
agent: 'task',
|
|
51
|
-
|
|
52
|
-
// `
|
|
70
|
+
delegate_task: 'task',
|
|
71
|
+
// The codex/Claude patch tool, opencode's `patch` plugin, gemini's
|
|
72
|
+
// `replace`, antigravity's `*_file_content` pair, grok's
|
|
73
|
+
// `search_replace`/`hashline_edit`, and kimi's `StrReplaceFile` are edits.
|
|
53
74
|
apply_patch: 'edit',
|
|
54
75
|
patch: 'edit',
|
|
55
76
|
replace: 'edit',
|
|
56
|
-
|
|
77
|
+
str_replace_editor: 'edit',
|
|
78
|
+
strreplacefile: 'edit',
|
|
79
|
+
search_replace: 'edit',
|
|
80
|
+
hashline_edit: 'edit',
|
|
81
|
+
replace_file_content: 'edit',
|
|
82
|
+
multi_replace_file_content: 'edit',
|
|
83
|
+
notebook_edit: 'edit',
|
|
84
|
+
// qwen spells it with the underscore, claude's adapter without.
|
|
85
|
+
notebookedit: 'edit',
|
|
86
|
+
// Gemini-family file tools name the operation in a different word. kimi
|
|
87
|
+
// capitalises its own (`ReadFile`, `WriteFile`), and the table is keyed
|
|
88
|
+
// case-insensitively.
|
|
57
89
|
write_file: 'write',
|
|
90
|
+
writefile: 'write',
|
|
91
|
+
write_to_file: 'write',
|
|
58
92
|
list_directory: 'read',
|
|
93
|
+
list_dir: 'read',
|
|
94
|
+
read_directory: 'read',
|
|
59
95
|
read_many_files: 'read',
|
|
96
|
+
readfile: 'read',
|
|
97
|
+
readmediafile: 'read',
|
|
98
|
+
view_file: 'read',
|
|
60
99
|
search_file_content: 'grep',
|
|
100
|
+
grep_search: 'grep',
|
|
101
|
+
search_files: 'grep',
|
|
102
|
+
find_by_name: 'grep',
|
|
61
103
|
view_image: 'read',
|
|
104
|
+
// Code execution that is not a shell: opencode's Code Mode `execute`, dsh's
|
|
105
|
+
// `run_code`, hermes' `execute_code`. Kabmo's `eval` panel draws the script.
|
|
106
|
+
execute: 'eval',
|
|
107
|
+
run_code: 'eval',
|
|
108
|
+
execute_code: 'eval',
|
|
62
109
|
};
|
|
63
110
|
|
|
64
111
|
/**
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a chat file reference actually lives.
|
|
8
|
+
*
|
|
9
|
+
* The ambiguous case is the reason this module is pure and tested on its own:
|
|
10
|
+
* `index.ts` matching two folders must NOT pick one, and a bare name with no
|
|
11
|
+
* match must still open so the editor reports the missing file.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { describe, expect, test } from 'bun:test';
|
|
15
|
+
import { chooseFileTarget } from '@/shared/lib/fs/open-reference';
|
|
16
|
+
|
|
17
|
+
describe('chooseFileTarget', () => {
|
|
18
|
+
test('a path with a directory opens as written, without consulting the index', () => {
|
|
19
|
+
expect(chooseFileTarget({ path: 'src/client/App.tsx' }, [])).toEqual({
|
|
20
|
+
kind: 'open',
|
|
21
|
+
path: 'src/client/App.tsx',
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('the line rides along on every open', () => {
|
|
26
|
+
expect(chooseFileTarget({ path: 'src/a.ts', line: 7 }, [])).toEqual({
|
|
27
|
+
kind: 'open',
|
|
28
|
+
path: 'src/a.ts',
|
|
29
|
+
line: 7,
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('an exact root file wins over copies deeper in the tree', () => {
|
|
34
|
+
const entries = [{ path: 'AGENTS.md' }, { path: 'docs/AGENTS.md' }];
|
|
35
|
+
expect(chooseFileTarget({ path: 'AGENTS.md' }, entries)).toEqual({
|
|
36
|
+
kind: 'open',
|
|
37
|
+
path: 'AGENTS.md',
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('one basename match resolves to its real path', () => {
|
|
42
|
+
const entries = [{ path: 'src/client/App.tsx' }, { path: 'src/server/read.ts' }];
|
|
43
|
+
expect(chooseFileTarget({ path: 'App.tsx', line: 3 }, entries)).toEqual({
|
|
44
|
+
kind: 'open',
|
|
45
|
+
path: 'src/client/App.tsx',
|
|
46
|
+
line: 3,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('several matches open the picker instead of guessing', () => {
|
|
51
|
+
const entries = [{ path: 'src/a/index.ts' }, { path: 'src/b/index.ts' }];
|
|
52
|
+
expect(chooseFileTarget({ path: 'index.ts' }, entries)).toEqual({
|
|
53
|
+
kind: 'pick',
|
|
54
|
+
query: 'index.ts',
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('no match opens the reference as written, so the editor reports it', () => {
|
|
59
|
+
expect(chooseFileTarget({ path: 'Missing.tsx' }, [{ path: 'src/App.tsx' }])).toEqual({
|
|
60
|
+
kind: 'literal',
|
|
61
|
+
path: 'Missing.tsx',
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a file reference written in chat actually lives.
|
|
8
|
+
*
|
|
9
|
+
* A reference with a directory is opened as written: the tab's root is the
|
|
10
|
+
* active workspace, which is the scope the agent was working in. A BARE name
|
|
11
|
+
* (`App.tsx`, `AGENTS.md`) is not a location — the file can sit in any folder —
|
|
12
|
+
* so it is looked up in the flat `/api/fs/list` index the quick-open picker
|
|
13
|
+
* already uses. The three answers are the honest ones:
|
|
14
|
+
*
|
|
15
|
+
* - one match: open that path (and reveal the line, when the span named one);
|
|
16
|
+
* - several: do not guess — open the picker filtered to the name;
|
|
17
|
+
* - none: open the reference as written, so the editor reports the missing
|
|
18
|
+
* file instead of the click doing nothing.
|
|
19
|
+
*
|
|
20
|
+
* Pure: the caller fetches the index, this decides.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { lastPathSegment } from '@/shared/lib/fs/paths';
|
|
24
|
+
|
|
25
|
+
/** One file reference, as the inline-code detector produced it. */
|
|
26
|
+
export interface InlineFileTarget {
|
|
27
|
+
path: string;
|
|
28
|
+
line?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** What a click on the reference should do. */
|
|
32
|
+
export type FileTargetDecision =
|
|
33
|
+
| { kind: 'open'; path: string; line?: number }
|
|
34
|
+
| { kind: 'pick'; query: string }
|
|
35
|
+
| { kind: 'literal'; path: string; line?: number };
|
|
36
|
+
|
|
37
|
+
/** The minimum a quick-open entry must carry: its workspace-relative path. */
|
|
38
|
+
export interface IndexedPath {
|
|
39
|
+
path: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** One decision with the line carried through, without an `undefined` key. */
|
|
43
|
+
function withLine(
|
|
44
|
+
kind: 'open' | 'literal',
|
|
45
|
+
path: string,
|
|
46
|
+
line: number | undefined,
|
|
47
|
+
): FileTargetDecision {
|
|
48
|
+
return line === undefined ? { kind, path } : { kind, path, line };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The action for `reference` given the workspace file index.
|
|
53
|
+
*
|
|
54
|
+
* The index is only consulted for a bare name: a path with a directory already
|
|
55
|
+
* says where it is, and asking the index about it would add a request to the
|
|
56
|
+
* common case. An EXACT index entry wins before the basename comparison, so a
|
|
57
|
+
* root-level `AGENTS.md` opens that file rather than the picker — a picker over
|
|
58
|
+
* the root copy and one in `docs/` would be noise, not a choice.
|
|
59
|
+
*/
|
|
60
|
+
export function chooseFileTarget(
|
|
61
|
+
reference: InlineFileTarget,
|
|
62
|
+
entries: readonly IndexedPath[],
|
|
63
|
+
): FileTargetDecision {
|
|
64
|
+
const { path, line } = reference;
|
|
65
|
+
if (path.includes('/')) return withLine('open', path, line);
|
|
66
|
+
|
|
67
|
+
if (entries.some((entry) => entry.path === path)) return withLine('open', path, line);
|
|
68
|
+
|
|
69
|
+
const name = lastPathSegment(path);
|
|
70
|
+
const matches = entries.filter((entry) => lastPathSegment(entry.path) === name);
|
|
71
|
+
if (matches.length === 1) return withLine('open', matches[0].path, line);
|
|
72
|
+
if (matches.length > 1) return { kind: 'pick', query: name };
|
|
73
|
+
return withLine('literal', path, line);
|
|
74
|
+
}
|
|
@@ -49,26 +49,26 @@ export const ICON_HUES: Readonly<Record<string, number>> = {
|
|
|
49
49
|
GitPullRequest: 10, Globe: 340, GraduationCap: 190, GripVertical: 350, Hammer: 310, Hand: 200,
|
|
50
50
|
HardDrive: 0, Hash: 330, Heading: 250, Heart: 270, History: 110, Home: 20,
|
|
51
51
|
Image: 140, Key: 240, KeyRound: 240, Keyboard: 120, Laptop: 170, Layers: 30,
|
|
52
|
-
Leaf: 50, Library: 160, Lightbulb: 0, List: 170, ListChecks: 320,
|
|
53
|
-
ListMusic: 0, ListOrdered: 220, ListTodo: 210, ListTree: 330, Loader2: 40,
|
|
54
|
-
LockKeyhole: 270, LockOpen: 180, LogIn: 140, LogOut: 190, Maximize: 310,
|
|
55
|
-
Menu: 100, MessageSquare: 150, MessageSquareOff: 40, MessageSquarePlus: 350, MessagesSquare: 220,
|
|
56
|
-
MicOff: 170, Minimize: 290, Minimize2: 130, Minus: 110, Monitor: 250,
|
|
57
|
-
MoreHorizontal: 160, MousePointerClick: 70, MoveVertical: 300, Music: 280, Package: 270,
|
|
58
|
-
Paintbrush: 250, Palette: 320, PanelLeft: 280, PanelLeftClose: 160, PanelRight: 330,
|
|
59
|
-
Paperclip: 310, Pause: 10, Pencil: 0, PencilLine: 260, Pin: 0,
|
|
60
|
-
Pipette: 120, Play: 310, Plug: 50, Plus: 210, Power: 340,
|
|
61
|
-
Quote: 110, Radio: 320, Ratio: 160, RefreshCw: 180, Regex: 280,
|
|
62
|
-
ReplaceAll: 140, Rocket: 210, RotateCcw: 330, RotateCw: 0, Rows: 160,
|
|
63
|
-
Save: 40, SaveAll: 190, Scissors: 260, Search: 250, Send: 110,
|
|
64
|
-
ServerCog: 50, Settings: 240, Settings2: 20, Shield: 160, ShieldOff: 130,
|
|
65
|
-
Sliders: 290, SlidersHorizontal: 50, Smartphone: 20, Space: 290, Sparkles: 180,
|
|
66
|
-
SquareFunction: 220, SquarePen: 10, Star: 170, StickyNote: 100, Store: 340,
|
|
67
|
-
Tablet: 290, Tag: 310, Target: 200, Terminal: 210, TextSelect: 220,
|
|
68
|
-
TriangleAlert: 210, Type: 170, Undo2: 310, Upload: 0, UploadCloud: 50,
|
|
69
|
-
Variable: 330, Volume2: 270, VolumeX: 50, Wand2: 270, WandSparkles: 40,
|
|
70
|
-
WholeWord: 240, Workflow: 240, WrapText: 340, Wrench: 0, X: 230,
|
|
71
|
-
ZoomIn: 250, ZoomOut: 340,
|
|
52
|
+
Leaf: 50, Library: 160, Lightbulb: 0, Link2: 10, List: 170, ListChecks: 320,
|
|
53
|
+
ListFilter: 230, ListMusic: 0, ListOrdered: 220, ListTodo: 210, ListTree: 330, Loader2: 40,
|
|
54
|
+
Lock: 220, LockKeyhole: 270, LockOpen: 180, LogIn: 140, LogOut: 190, Maximize: 310,
|
|
55
|
+
Maximize2: 270, Menu: 100, MessageSquare: 150, MessageSquareOff: 40, MessageSquarePlus: 350, MessagesSquare: 220,
|
|
56
|
+
Mic: 160, MicOff: 170, Minimize: 290, Minimize2: 130, Minus: 110, Monitor: 250,
|
|
57
|
+
Moon: 80, MoreHorizontal: 160, MousePointerClick: 70, MoveVertical: 300, Music: 280, Package: 270,
|
|
58
|
+
PackageOpen: 230, Paintbrush: 250, Palette: 320, PanelLeft: 280, PanelLeftClose: 160, PanelRight: 330,
|
|
59
|
+
PanelRightClose: 350, Paperclip: 310, Pause: 10, Pencil: 0, PencilLine: 260, Pin: 0,
|
|
60
|
+
PinOff: 50, Pipette: 120, Play: 310, Plug: 50, Plus: 210, Power: 340,
|
|
61
|
+
Puzzle: 50, Quote: 110, Radio: 320, Ratio: 160, RefreshCw: 180, Regex: 280,
|
|
62
|
+
Replace: 190, ReplaceAll: 140, Rocket: 210, RotateCcw: 330, RotateCw: 0, Rows: 160,
|
|
63
|
+
Rows3: 250, Save: 40, SaveAll: 190, Scissors: 260, Search: 250, Send: 110,
|
|
64
|
+
Server: 300, ServerCog: 50, Settings: 240, Settings2: 20, Shield: 160, ShieldOff: 130,
|
|
65
|
+
Shrink: 160, Sliders: 290, SlidersHorizontal: 50, Smartphone: 20, Space: 290, Sparkles: 180,
|
|
66
|
+
Square: 60, SquareFunction: 220, SquarePen: 10, Star: 170, StickyNote: 100, Store: 340,
|
|
67
|
+
Sun: 90, Tablet: 290, Tag: 310, Target: 200, Terminal: 210, TextSelect: 220,
|
|
68
|
+
Ticket: 170, TriangleAlert: 210, Type: 170, Undo2: 310, Upload: 0, UploadCloud: 50,
|
|
69
|
+
User: 140, Variable: 330, Volume2: 270, VolumeX: 50, Wand2: 270, WandSparkles: 40,
|
|
70
|
+
Waypoints: 30, WholeWord: 240, Workflow: 240, WrapText: 340, Wrench: 0, X: 230,
|
|
71
|
+
Zap: 120, ZoomIn: 250, ZoomOut: 340,
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
/**
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Inline code that names a file, and the marker the chat timeline reads.
|
|
8
|
+
*
|
|
9
|
+
* Detection is the load-bearing half: a false positive opens a tab that cannot
|
|
10
|
+
* read, so every rejected shape here is a bug this file prevents. The marker
|
|
11
|
+
* half pins that it rewrites ONLY the chip `marked.ts` emits — a fenced block
|
|
12
|
+
* that prints that markup is escaped and must survive untouched.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { describe, expect, test } from 'bun:test';
|
|
16
|
+
import { inlineFileReference, markInlineFilePaths } from '@/shared/lib/markdown/inline-file';
|
|
17
|
+
|
|
18
|
+
describe('inlineFileReference', () => {
|
|
19
|
+
test('a workspace path with a directory is a file', () => {
|
|
20
|
+
expect(inlineFileReference('src/client/App.tsx')).toEqual({ path: 'src/client/App.tsx' });
|
|
21
|
+
expect(inlineFileReference('docs/hero.png')).toEqual({ path: 'docs/hero.png' });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('a bare filename and a dot-file are files', () => {
|
|
25
|
+
expect(inlineFileReference('AGENTS.md')).toEqual({ path: 'AGENTS.md' });
|
|
26
|
+
expect(inlineFileReference('.gitignore')).toEqual({ path: '.gitignore' });
|
|
27
|
+
expect(inlineFileReference('.env')).toEqual({ path: '.env' });
|
|
28
|
+
expect(inlineFileReference('Makefile')).toEqual({ path: 'Makefile' });
|
|
29
|
+
expect(inlineFileReference('bun.lock')).toEqual({ path: 'bun.lock' });
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('`./` is stripped, because the tab resolves from the workspace root', () => {
|
|
33
|
+
expect(inlineFileReference('./src/a.ts')).toEqual({ path: 'src/a.ts' });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('the line suffixes the editor can reveal are carried', () => {
|
|
37
|
+
expect(inlineFileReference('src/a.ts:42')).toEqual({ path: 'src/a.ts', line: 42 });
|
|
38
|
+
expect(inlineFileReference('src/a.ts:42-50')).toEqual({ path: 'src/a.ts', line: 42 });
|
|
39
|
+
expect(inlineFileReference('src/a.ts:42:7')).toEqual({ path: 'src/a.ts', line: 42 });
|
|
40
|
+
expect(inlineFileReference('src/a.ts#L42-L50')).toEqual({ path: 'src/a.ts', line: 42 });
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('ordinary inline code is not a file', () => {
|
|
44
|
+
const rejected = [
|
|
45
|
+
'bun test',
|
|
46
|
+
'state.user.id',
|
|
47
|
+
'https://bun.sh/docs',
|
|
48
|
+
'/Users/me/project/a.ts',
|
|
49
|
+
'~/project/a.ts',
|
|
50
|
+
'C:\\project\\a.ts',
|
|
51
|
+
'src/',
|
|
52
|
+
'*.tsx',
|
|
53
|
+
'src/a.ts,',
|
|
54
|
+
'../a.ts',
|
|
55
|
+
'src/unknown.xyz',
|
|
56
|
+
'src/foo',
|
|
57
|
+
'App',
|
|
58
|
+
'--config.ts',
|
|
59
|
+
'src//a.ts',
|
|
60
|
+
'src/a.ts#section',
|
|
61
|
+
'npm:foo',
|
|
62
|
+
'a?b.ts',
|
|
63
|
+
];
|
|
64
|
+
for (const text of rejected) expect(inlineFileReference(text)).toBeNull();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe('markInlineFilePaths', () => {
|
|
69
|
+
test('a file chip becomes a focusable button with its line', () => {
|
|
70
|
+
const html = markInlineFilePaths('<p>see <code class="inline-code">src/a.ts:12</code></p>');
|
|
71
|
+
expect(html).toContain('data-file-path="src/a.ts"');
|
|
72
|
+
expect(html).toContain('data-file-line="12"');
|
|
73
|
+
expect(html).toContain('role="button"');
|
|
74
|
+
expect(html).toContain('tabindex="0"');
|
|
75
|
+
expect(html).toContain('aria-label="Open src/a.ts in the editor"');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('ordinary inline code is byte-identical', () => {
|
|
79
|
+
const html = '<p><code class="inline-code">bun test</code></p>';
|
|
80
|
+
expect(markInlineFilePaths(html)).toBe(html);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('a fenced block that prints the chip markup is not a chip', () => {
|
|
84
|
+
// What `marked` emits for a fence whose text is that markup: the tags are
|
|
85
|
+
// escaped, so the marker cannot see a chip and must not invent one.
|
|
86
|
+
const html = '<pre><code class="language-text"><code class="inline-code">src/a.ts</code></code></pre>';
|
|
87
|
+
expect(markInlineFilePaths(html)).toBe(html);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test('an entity in a filename is decoded for detection and re-escaped for the attribute', () => {
|
|
91
|
+
const html = markInlineFilePaths('<p><code class="inline-code">a&b.ts</code></p>');
|
|
92
|
+
expect(html).toContain('data-file-path="a&b.ts"');
|
|
93
|
+
expect(html).toContain('>a&b.ts</code>');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test('marking twice is the same as marking once', () => {
|
|
97
|
+
const once = markInlineFilePaths('<code class="inline-code">src/a.ts</code>');
|
|
98
|
+
expect(markInlineFilePaths(once)).toBe(once);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Inline code that names a file the editor can open.
|
|
8
|
+
*
|
|
9
|
+
* An agent writes `` `src/hooks/use-file.ts:42` `` in prose far more often than
|
|
10
|
+
* it writes a markdown link, and the timeline rendered that as an inert chip.
|
|
11
|
+
* The renderer's own markup is the seam: `marked.ts` emits exactly
|
|
12
|
+
* `<code class="inline-code">…</code>`, so the marker pass rewrites that one
|
|
13
|
+
* shape and nothing else. It runs on the SANITIZED chat HTML, which is why the
|
|
14
|
+
* attributes need no DOMPurify allow-list entry — the same contract
|
|
15
|
+
* `markLocalImageSources` documents.
|
|
16
|
+
*
|
|
17
|
+
* Detection is deliberately conservative, because a false positive is a tab
|
|
18
|
+
* that fails to read. It accepts only what a workspace file plausibly is:
|
|
19
|
+
*
|
|
20
|
+
* - a path segment list that ends in a name the editor can show — a text
|
|
21
|
+
* extension (`TEXT_FILE_EXTENSIONS`), a viewer extension (raster image,
|
|
22
|
+
* SVG, PDF), or an extensionless project file (`Makefile`, `LICENSE`);
|
|
23
|
+
* - optionally suffixed by a line (`:42`, `:42-50`, `:42:7`) or GitHub's
|
|
24
|
+
* `#L42`, which become the editor's line reveal.
|
|
25
|
+
*
|
|
26
|
+
* Everything else stays plain text: commands (`bun test`), identifiers
|
|
27
|
+
* (`state.user.id`), URLs, absolute paths, globs, shell flags, quoted strings
|
|
28
|
+
* and anything containing whitespace. A bare filename is accepted HERE; the
|
|
29
|
+
* click path resolves where it lives (see `chooseFileTarget`).
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { TEXT_FILE_EXTENSIONS } from '@/shared/lib/chat/text-file';
|
|
33
|
+
|
|
34
|
+
/** One file reference written inside inline code. */
|
|
35
|
+
export interface InlineFileReference {
|
|
36
|
+
/** Workspace-relative path, exactly as the click handler hands it to a tab. */
|
|
37
|
+
path: string;
|
|
38
|
+
/** 1-based line, when the code span named one. */
|
|
39
|
+
line?: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The attribute the marker puts on a code span, read by the click handler. */
|
|
43
|
+
export const INLINE_FILE_ATTRIBUTE = 'data-file-path';
|
|
44
|
+
/** The 1-based line, when the span named one. */
|
|
45
|
+
export const INLINE_FILE_LINE_ATTRIBUTE = 'data-file-line';
|
|
46
|
+
|
|
47
|
+
/** Raster images, SVG and PDF: the editor has a viewer for each. */
|
|
48
|
+
const VIEWER_EXTENSIONS: Record<string, true> = {
|
|
49
|
+
png: true,
|
|
50
|
+
jpg: true,
|
|
51
|
+
jpeg: true,
|
|
52
|
+
gif: true,
|
|
53
|
+
webp: true,
|
|
54
|
+
avif: true,
|
|
55
|
+
bmp: true,
|
|
56
|
+
ico: true,
|
|
57
|
+
svg: true,
|
|
58
|
+
pdf: true,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Project files the editor opens that carry no extension.
|
|
63
|
+
*
|
|
64
|
+
* `TEXT_FILE_EXTENSIONS` keys them by a lowercased NAME (`dockerfile`,
|
|
65
|
+
* `makefile`), which never matches a basename with no dot — the reason this
|
|
66
|
+
* table exists rather than being folded into that one.
|
|
67
|
+
*/
|
|
68
|
+
const NAMED_FILES: Record<string, true> = {
|
|
69
|
+
dockerfile: true,
|
|
70
|
+
makefile: true,
|
|
71
|
+
procfile: true,
|
|
72
|
+
justfile: true,
|
|
73
|
+
brewfile: true,
|
|
74
|
+
gemfile: true,
|
|
75
|
+
rakefile: true,
|
|
76
|
+
license: true,
|
|
77
|
+
licence: true,
|
|
78
|
+
notice: true,
|
|
79
|
+
codeowners: true,
|
|
80
|
+
readme: true,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Dot-files and lockfiles whose suffix is not in `TEXT_FILE_EXTENSIONS` but is
|
|
85
|
+
* still ordinary text the editor reads.
|
|
86
|
+
*/
|
|
87
|
+
const EXTRA_EXTENSIONS: Record<string, true> = {
|
|
88
|
+
lock: true,
|
|
89
|
+
prettierrc: true,
|
|
90
|
+
eslintrc: true,
|
|
91
|
+
babelrc: true,
|
|
92
|
+
nvmrc: true,
|
|
93
|
+
npmrc: true,
|
|
94
|
+
gitattributes: true,
|
|
95
|
+
gitmodules: true,
|
|
96
|
+
dockerignore: true,
|
|
97
|
+
editorsettings: true,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** An absolute path (POSIX, Windows drive or home) is never workspace-relative. */
|
|
101
|
+
const ABSOLUTE_RE = /^(?:[/\\]|[A-Za-z]:[\\/]|~[/\\])/;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Glob, shell, markup and query characters. A path on disk can legally hold
|
|
105
|
+
* some of them, but the inline-code spelling of one never does — and rejecting
|
|
106
|
+
* the whole set is what keeps `*.tsx`, `--flag=value`, `a?b` and `foo|bar` out.
|
|
107
|
+
*/
|
|
108
|
+
const FORBIDDEN_RE = /[[\]{}*?<>|"'`$=,;]/;
|
|
109
|
+
|
|
110
|
+
/** `path:42`, `path:42-50`, `path:42:7` — omp's read selector without the mode. */
|
|
111
|
+
const COLON_LINE_RE = /^(.+?):(\d+)(?:[-,:]\d+)?$/;
|
|
112
|
+
|
|
113
|
+
/** GitHub's `path#L42` / `path#L42-L50`. */
|
|
114
|
+
const HASH_LINE_RE = /^(.+?)#L(\d+)(?:-L?\d+)?$/i;
|
|
115
|
+
|
|
116
|
+
/** Whether `name` is a file the editor can open, by extension or by name. */
|
|
117
|
+
function isOpenableName(name: string): boolean {
|
|
118
|
+
const lower = name.toLowerCase();
|
|
119
|
+
if (NAMED_FILES[lower]) return true;
|
|
120
|
+
const dot = lower.lastIndexOf('.');
|
|
121
|
+
if (dot === -1) return false;
|
|
122
|
+
// A dot-file's "extension" is everything after the leading dot.
|
|
123
|
+
const ext = dot === 0 ? lower.slice(1) : lower.slice(dot + 1);
|
|
124
|
+
return TEXT_FILE_EXTENSIONS[ext] === true
|
|
125
|
+
|| VIEWER_EXTENSIONS[ext] === true
|
|
126
|
+
|| EXTRA_EXTENSIONS[ext] === true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** The path alone, and the line when the spelling carries one. */
|
|
130
|
+
function splitLineSuffix(text: string): InlineFileReference {
|
|
131
|
+
const hash = HASH_LINE_RE.exec(text);
|
|
132
|
+
if (hash) return { path: hash[1], line: Number(hash[2]) };
|
|
133
|
+
const colon = COLON_LINE_RE.exec(text);
|
|
134
|
+
if (colon) return { path: colon[1], line: Number(colon[2]) };
|
|
135
|
+
return { path: text };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The file this inline-code text names, or null when it is ordinary code.
|
|
140
|
+
*
|
|
141
|
+
* Pure and synchronous: it runs once per inline code span on every render of a
|
|
142
|
+
* streaming transcript, so it must not touch the network or the DOM.
|
|
143
|
+
*/
|
|
144
|
+
export function inlineFileReference(rawText: string): InlineFileReference | null {
|
|
145
|
+
const text = rawText.trim();
|
|
146
|
+
if (!text || /\s/.test(text)) return null;
|
|
147
|
+
// A shell flag is not a path, even when it ends in `.ts`.
|
|
148
|
+
if (text.startsWith('-')) return null;
|
|
149
|
+
if (ABSOLUTE_RE.test(text)) return null;
|
|
150
|
+
if (FORBIDDEN_RE.test(text)) return null;
|
|
151
|
+
|
|
152
|
+
const reference = splitLineSuffix(text);
|
|
153
|
+
// A leftover scheme, drive letter or read-mode chunk (`:raw`) is not a path;
|
|
154
|
+
// `#` that survived the `#L` rule is an anchor, not part of a filename.
|
|
155
|
+
if (reference.path.includes(':') || reference.path.includes('\\') || reference.path.includes('#')) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const path = reference.path.startsWith('./') ? reference.path.slice(2) : reference.path;
|
|
160
|
+
if (!path || path.endsWith('/')) return null;
|
|
161
|
+
const segments = path.split('/');
|
|
162
|
+
// Empty segments catch `a//b`; `.`/`..` would escape the workspace scope the
|
|
163
|
+
// open event resolves against.
|
|
164
|
+
if (segments.some((segment) => segment === '' || segment === '.' || segment === '..')) return null;
|
|
165
|
+
if (!isOpenableName(segments[segments.length - 1])) return null;
|
|
166
|
+
|
|
167
|
+
return reference.line !== undefined ? { path, line: reference.line } : { path };
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** `&` and friends are how a markdown URL reaches the HTML attribute. */
|
|
171
|
+
function decodeEntities(value: string): string {
|
|
172
|
+
return value
|
|
173
|
+
.replace(/</g, '<')
|
|
174
|
+
.replace(/>/g, '>')
|
|
175
|
+
.replace(/"/g, '"')
|
|
176
|
+
.replace(/�?39;/g, "'")
|
|
177
|
+
.replace(/&/g, '&');
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Attribute values are injected as HTML, so `&` and `"` must be entities. */
|
|
181
|
+
function escapeAttribute(value: string): string {
|
|
182
|
+
return value.replace(/&/g, '&').replace(/"/g, '"');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** Exactly the chip `marked.ts` emits for inline code; a fence has a language class. */
|
|
186
|
+
const INLINE_CODE_RE = /<code class="inline-code">([^<]*)<\/code>/g;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Put the file identity on every inline code span that names one.
|
|
190
|
+
*
|
|
191
|
+
* Runs after sanitization (see `useRenderedMarkdown`), so the attributes never
|
|
192
|
+
* pass through DOMPurify. The regex is safe for the same reason the local-image
|
|
193
|
+
* marker is: the renderer escapes `<` inside a code span, so a fenced block
|
|
194
|
+
* that PRINTS this markup arrives as `<code …` and cannot match.
|
|
195
|
+
*/
|
|
196
|
+
export function markInlineFilePaths(html: string): string {
|
|
197
|
+
if (!html.includes('class="inline-code"')) return html;
|
|
198
|
+
return html.replace(INLINE_CODE_RE, (match, escaped: string) => {
|
|
199
|
+
const reference = inlineFileReference(decodeEntities(escaped));
|
|
200
|
+
if (!reference) return match;
|
|
201
|
+
const path = escapeAttribute(reference.path);
|
|
202
|
+
const title = `Open ${path} in the editor`;
|
|
203
|
+
const attributes = [
|
|
204
|
+
`${INLINE_FILE_ATTRIBUTE}="${path}"`,
|
|
205
|
+
...(reference.line !== undefined ? [`${INLINE_FILE_LINE_ATTRIBUTE}="${reference.line}"`] : []),
|
|
206
|
+
'role="button"',
|
|
207
|
+
'tabindex="0"',
|
|
208
|
+
`title="${title}"`,
|
|
209
|
+
`aria-label="${title}"`,
|
|
210
|
+
];
|
|
211
|
+
return `<code class="inline-code" ${attributes.join(' ')}>${escaped}</code>`;
|
|
212
|
+
});
|
|
213
|
+
}
|
|
@@ -87,8 +87,9 @@ describe('parseAssistantContent', () => {
|
|
|
87
87
|
expect(parsed.thinking).toBe('hmm');
|
|
88
88
|
expect(parsed.intent).toBe('Read it');
|
|
89
89
|
expect(parsed.textParts).toEqual(['answer']);
|
|
90
|
+
// `type` stays the transport's own word; `render` is the panel family.
|
|
90
91
|
expect(parsed.toolCalls).toEqual([
|
|
91
|
-
{ id: 'c1', type: 'read_file', name: 'read', title: 'read — /f', intent: 'Read it', target: '/f', input: { path: '/f' }, output: 'OUT', status: 'success' },
|
|
92
|
+
{ id: 'c1', type: 'read_file', name: 'read', title: 'read — /f', intent: 'Read it', target: '/f', input: { path: '/f' }, output: 'OUT', status: 'success', render: { key: 'read', normalized: true } },
|
|
92
93
|
]);
|
|
93
94
|
});
|
|
94
95
|
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import type { ToolCallData } from '@/shared/types/chat';
|
|
15
15
|
import type { OmpMessageEntry } from '@/shared/types/omp/session';
|
|
16
16
|
import { extractInlinedTextAttachments, extractText as coreExtractText, extractUserImageAttachments, parseMessageBlocks, stripInlinedTextAttachments, toToolCallData } from '@/shared/lib/omp/session/parse-message-blocks';
|
|
17
|
+
import { normalizeToolCall } from '@/shared/lib/chat/tool/normalize';
|
|
17
18
|
import { isRecord } from '@/shared/lib/util/guards';
|
|
18
19
|
|
|
19
20
|
export { stripInlinedTextAttachments };
|
|
@@ -56,11 +57,11 @@ export interface ParsedAssistantTurn {
|
|
|
56
57
|
export function parseAssistantContent(content: unknown): ParsedAssistantTurn {
|
|
57
58
|
const parsed = parseMessageBlocks(content);
|
|
58
59
|
const toolCalls = parsed.toolCalls.map((tc) =>
|
|
59
|
-
toToolCallData(tc, {
|
|
60
|
+
normalizeToolCall(toToolCallData(tc, {
|
|
60
61
|
streaming: false,
|
|
61
62
|
output: parsed.inlineOutputs.get(tc.id) ?? undefined,
|
|
62
63
|
images: parsed.inlineImages.get(tc.id),
|
|
63
|
-
}),
|
|
64
|
+
})),
|
|
64
65
|
);
|
|
65
66
|
return {
|
|
66
67
|
thinking: parsed.thinking,
|