@kabmo-labs/kabmo 0.33.0 → 0.35.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 +785 -624
- package/dist/client/static/js/{CsvGrid-fncjbg6j.js → CsvGrid-0amzgtd7.js} +2 -2
- package/dist/client/static/js/{DocxView-c9v2vr3r.js → DocxView-bxjhzxe9.js} +5 -5
- package/dist/client/static/js/{DrawioView-vxjksm12.js → DrawioView-7s1yqsf4.js} +2 -2
- package/dist/client/static/js/{ImageView-a3g5k226.js → ImageView-ycfbn66h.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-hnjfwsjh.js → LayoutWrapper-tw1q1x0g.js} +2 -2
- package/dist/client/static/js/Modal-wqjactyd.js +38 -0
- package/dist/client/static/js/{PdfView-ksaes53y.js → PdfView-x6dmtwvr.js} +1 -1
- package/dist/client/static/js/{SessionsView-30vcr95v.js → SessionsView-t85wq0me.js} +1 -1
- package/dist/client/static/js/{SheetView-vc484scg.js → SheetView-n52nvz8s.js} +25 -25
- package/dist/client/static/js/{SvgPreview-tph89jet.js → SvgPreview-59z7syme.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-xbar278c.js → abnfDiagram-O67JEVCF-91gnt049.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-bajpnvy7.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-s171n2z6.js → architectureDiagram-NJMV4G6O-5b9qtff2.js} +4 -4
- package/dist/client/static/js/{astro-80bs6hvg.js → astro-31cbyw7b.js} +1 -1
- package/dist/client/static/js/bash-0h36tk0k.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-gzx6rv9n.js → blockDiagram-BEXU5L5S-6f23fjkn.js} +3 -3
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-7f00skch.js → c4Diagram-YGBWAQC7-76t6d3am.js} +5 -5
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-j79v95nc.js → classDiagram-v2-NBCMYWYE-f9tb19xm.js} +3 -3
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-5fkn7ee5.js → cose-bilkent-JH36ORCC-t6nwrbwj.js} +1 -1
- package/dist/client/static/js/cpp-4wp9sy20.js +1 -0
- package/dist/client/static/js/css-c9nsbkh6.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-8q9e90m8.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-cfs1yvrd.js → cynefinDiagram-VND7K2PF-69gc244j.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-44bgc48p.js → dagre-6A5THRUB-54bry3ey.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-a4g4x83k.js → diagram-22UHCM2B-gfkebye6.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-gm4rg5na.js → diagram-3UASUU5V-a1mr319f.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-a95y41vk.js → diagram-ATOU4E4O-tkyk0qbe.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-t3j93mmc.js → diagram-CDSNMT55-np0hc9m2.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-c2wdez02.js → diagram-MLGK6HIB-nh06fshp.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-gya9jhs5.js → diagram-MPIPVDR6-27q2veks.js} +2 -2
- package/dist/client/static/js/{dockerfile-a7q6174s.js → dockerfile-4rtt6c0f.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-jjhkza6t.js → ebnfDiagram-ZINNZB2B-x9p9jqe8.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-f7re45mw.js → elk-276RUBZZ-fw7waks3.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-tpm9g5te.js → erDiagram-OPXOYQCR-fdfgzr5d.js} +5 -5
- package/dist/client/static/js/{erlang-qt876zrq.js → erlang-trjm07as.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-kn4hsm3p.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-ah8cvps1.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-fz43n12d.js → ganttDiagram-FUAMR5RP-2avbqgdr.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-hvavh16n.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-f61hgbn6.js → gitGraphDiagram-X574FWY7-9jmc0a3g.js} +12 -12
- package/dist/client/static/js/graphql-hbkmxsty.js +1 -0
- package/dist/client/static/js/{index-8239j2v1.js → index-0v34a7wf.js} +1 -1
- package/dist/client/static/js/{index-vtbbfwx0.js → index-1wjp16f0.js} +2 -2
- package/dist/client/static/js/index-2mx9ej4k.css +1 -0
- package/dist/client/static/js/{index-q2w6s8n7.js → index-2v1nmxwr.js} +6 -6
- package/dist/client/static/js/{index-apvkd37e.js → index-3ecsp1rx.js} +3 -3
- package/dist/client/static/js/{index-1y9r4frb.js → index-43qpbxjv.js} +2 -2
- package/dist/client/static/js/{index-w0fwb80e.js → index-4vybd9e7.js} +1 -1
- package/dist/client/static/js/{index-ahv9y42z.js → index-6f6cmcbq.js} +2 -2
- package/dist/client/static/js/{index-9fjt5anh.js → index-7ct7qrsp.js} +2 -2
- package/dist/client/static/js/{index-ajs3jj6j.js → index-7q02xnvq.js} +1 -1
- package/dist/client/static/js/{index-rytaa8ca.js → index-7smwzkvq.js} +2 -2
- package/dist/client/static/js/{index-rg8jpbsw.js → index-8acv5b77.js} +2 -2
- package/dist/client/static/js/{index-gs6f0qwa.js → index-8f9x7ev8.js} +2 -2
- package/dist/client/static/js/{index-7y6rpsrp.js → index-8mwragbj.js} +2 -2
- package/dist/client/static/js/{index-gcs49f3p.js → index-8x9ecxb0.js} +1 -1
- package/dist/client/static/js/{index-3rcjx70v.js → index-9ketbkh6.js} +1 -1
- package/dist/client/static/js/{index-ypx3qmhq.js → index-a628fg4m.js} +2 -2
- package/dist/client/static/js/{index-e4p4cd3r.js → index-a8ffattk.js} +2 -2
- package/dist/client/static/js/{index-js7t1vb1.js → index-b8s3xraa.js} +6 -6
- package/dist/client/static/js/index-btr2w8cq.js +12 -0
- package/dist/client/static/js/index-dfzrpy54.js +2 -0
- package/dist/client/static/js/{index-pxv2nw9w.js → index-ee2p07eg.js} +1 -1
- package/dist/client/static/js/{index-03h3bkcf.js → index-ek2e773p.js} +1 -1
- package/dist/client/static/js/{index-1xqs14fr.js → index-fvc0x6nx.js} +3 -3
- package/dist/client/static/js/{index-3zc1b0dv.js → index-jc1yagmk.js} +2 -2
- package/dist/client/static/js/{index-d495kfm0.js → index-jmxqefe3.js} +1 -1
- package/dist/client/static/js/{index-2x5f66t6.js → index-k7q01ye4.js} +2 -2
- package/dist/client/static/js/{index-5tgq7aqx.js → index-kdkfyrja.js} +2 -2
- package/dist/client/static/js/{index-m73za75e.js → index-mc4nefs7.js} +3 -3
- package/dist/client/static/js/{index-trm9x02n.js → index-nb8tp4mj.js} +30 -30
- package/dist/client/static/js/{index-zt75xpq0.js → index-ncrenheb.js} +206 -206
- package/dist/client/static/js/{index-qsm2z36d.js → index-p16scjt7.js} +2 -2
- package/dist/client/static/js/{index-sdtye3jy.js → index-pc6eg8h2.js} +2 -2
- package/dist/client/static/js/{index-zvfvqvn9.js → index-pnt0vc59.js} +2 -2
- package/dist/client/static/js/{index-pbe4yed4.js → index-py2k8std.js} +2 -2
- package/dist/client/static/js/{index-dbe6afkf.js → index-pzbssnsc.js} +2 -2
- package/dist/client/static/js/{index-qckv9nte.js → index-qqz6bcdd.js} +2 -2
- package/dist/client/static/js/{index-xj9649ac.js → index-ray2czf6.js} +7 -7
- package/dist/client/static/js/{index-0tf0arsp.js → index-rbgemjsp.js} +3 -3
- package/dist/client/static/js/{index-vw4brsdx.js → index-rkn0bxxt.js} +1 -1
- package/dist/client/static/js/{index-76zb4m0n.js → index-rv89xpaf.js} +2 -2
- package/dist/client/static/js/index-sbd5e816.js +1 -0
- package/dist/client/static/js/{index-eyzeya95.js → index-sdby39w4.js} +5 -5
- package/dist/client/static/js/{index-0n5wwe60.js → index-t6c0pd43.js} +2 -2
- package/dist/client/static/js/{index-km2zb6wk.js → index-tp7yb3bv.js} +2 -2
- package/dist/client/static/js/{index-vw5k8csz.js → index-vnw3hbeg.js} +56 -56
- package/dist/client/static/js/{index-354mqqra.js → index-vq6wts05.js} +2 -2
- package/dist/client/static/js/{index-14vndmcr.js → index-w5373tg1.js} +2 -2
- package/dist/client/static/js/{index-0e40xskg.js → index-w7tpgt46.js} +1 -1
- package/dist/client/static/js/{index-djmg1d7h.js → index-whbtxmwh.js} +2 -2
- package/dist/client/static/js/{index-2svnq5gg.js → index-xs1m0bpt.js} +1 -1
- package/dist/client/static/js/{index-9y3gjdj7.js → index-xxtsm2rb.js} +2 -2
- package/dist/client/static/js/{index-hf52f59k.js → index-y3ms153k.js} +2 -2
- package/dist/client/static/js/{index-1a0zkj8h.js → index-yq39qbs1.js} +2 -2
- package/dist/client/static/js/{index-j0r5hj0j.js → index-zh2jj56s.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-fmjz8qwg.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-1qj804sn.js → infoDiagram-VRGFBTTK-g2dky5xg.js} +2 -2
- package/dist/client/static/js/ini-72yrpvd4.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-4j4qsnzw.js → ishikawaDiagram-OU5B5YK6-exrcjwp1.js} +6 -6
- package/dist/client/static/js/java-ab5tb2ra.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-j0brnfft.js → journeyDiagram-ZHPQQLJL-pn752qa5.js} +4 -4
- package/dist/client/static/js/jsx-25zj9j3k.js +1 -0
- package/dist/client/static/js/{julia-4ghmfy3e.js → julia-evn99h2m.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-qqc22br0.js → kanban-definition-PNTS6WVX-v8nvr373.js} +5 -5
- package/dist/client/static/js/lua-j5w0c9wm.js +1 -0
- package/dist/client/static/js/markdown-j6hn4377.js +1 -0
- package/dist/client/static/js/{mermaid.core-vv3wbe65.js → mermaid.core-egzv89zv.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-y5b2z8zp.js → mindmap-definition-NLK3R4M7-t9njmv2w.js} +8 -8
- package/dist/client/static/js/one-dark-pro-bm3r4js7.js +1 -0
- package/dist/client/static/js/one-light-e07dt7sy.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-cwr6n1cm.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-0be07mqs.js → pegDiagram-GJSIUBJH-zhycy2b7.js} +1 -1
- package/dist/client/static/js/{perl-sd00t4b4.js → perl-506fy8m8.js} +1 -1
- package/dist/client/static/js/{php-2zfyqa61.js → php-axtsvxck.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-h1ebfzgt.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-544w86jk.js → pieDiagram-5QR66LMP-sgctvma2.js} +2 -2
- package/dist/client/static/js/properties-q8njes42.js +1 -0
- package/dist/client/static/js/python-vqxc7181.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-p09e7z5s.js → quadrantDiagram-O4NWA36T-kzzhdcph.js} +5 -5
- package/dist/client/static/js/r-0k5eej8m.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-k7p1m364.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-d08dw3t0.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-txnjycgk.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-p0r3cv6w.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-sryk900a.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-de830ed2.js → railroadDiagram-XR7U4H2S-nzjffwxm.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-b47d74p1.js → requirementDiagram-PLB6GJNP-tz4xxn4d.js} +2 -2
- package/dist/client/static/js/{ruby-v9qaqhby.js → ruby-qp7zfk2m.js} +1 -1
- package/dist/client/static/js/{rust-fkt0qyrs.js → rust-fz913fvw.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-6ezc2fpj.js → sankeyDiagram-IPEJSGJF-2wcb0xr6.js} +4 -4
- package/dist/client/static/js/{sass-9bxped7y.js → sass-gnk9vsyp.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-by5zqj6w.js → sequenceDiagram-PO4LG4MO-vqgebfns.js} +18 -18
- package/dist/client/static/js/{sizeCapture-INFHLROL-q85r06j6.js → sizeCapture-INFHLROL-xc314tes.js} +1 -1
- package/dist/client/static/js/sql-0e9mnrda.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-ep5pyexs.js → stateDiagram-v2-GCMORJYK-8bd9b1h8.js} +3 -3
- package/dist/client/static/js/{svelte-mwtx07d9.js → svelte-brpgzrtv.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-95fcqkh8.js → swimlanes-2SLR337P-t6hbdzcw.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-c1czc7kv.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-461e615g.js → timeline-definition-EJHVYXUP-2txxasx5.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-77kj68p1.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-rw94xc82.js +1 -0
- package/dist/client/static/js/tsx-yd5wt250.js +1 -0
- package/dist/client/static/js/typescript-v7z7crfe.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ftqfnvhg.js → usecaseDiagram-POWQR4AR-3x353hn4.js} +17 -17
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-7t96h6ez.js → vennDiagram-UO4OBE2U-cerpss8e.js} +7 -7
- package/dist/client/static/js/{vue-j8vb9d7r.js → vue-apnkw9qy.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-18xe4fhz.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-0de8w8c6.js → wardleyDiagram-VNRHLVJA-cx6jfsbf.js} +4 -4
- package/dist/client/static/js/xml-94fhzrfs.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-dez9phkf.js → xychartDiagram-PMCCYNJV-tgn23xj1.js} +5 -5
- package/dist/client/static/js/yaml-s8af9rnw.js +1 -0
- package/package.json +4 -1
- package/src/client/components/auth/login-screen/index.tsx +1 -0
- package/src/client/components/common/MarkdownRenderer.tsx +9 -12
- package/src/client/components/settings/Modal.tsx +14 -84
- package/src/client/components/settings/Sidebar.tsx +3 -1
- package/src/client/components/settings/categories/ConnectSettings.tsx +105 -0
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +145 -0
- package/src/client/components/settings/categories/connect-settings/PairDialog.test.tsx +159 -0
- package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +189 -0
- package/src/client/components/settings/categories/connect-settings/QrCode.tsx +56 -0
- package/src/client/components/settings/categories/connect-settings/ServerCard.tsx +94 -0
- package/src/client/components/settings/categories/connect-settings/TunnelRow.tsx +127 -0
- package/src/client/components/settings/categories/connect-settings/qr-image.ts +76 -0
- package/src/client/components/settings/category-content.tsx +116 -0
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.test.tsx +120 -0
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +56 -20
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +1 -0
- package/src/client/components/workspace/git-panel/init-state.test.ts +5 -0
- package/src/client/hooks/chat/composer/speech-to-text.ts +24 -17
- package/src/client/hooks/chat/timeline/change-stats.ts +57 -0
- package/src/client/hooks/connect/use-connect-status.ts +116 -0
- package/src/client/hooks/connect/use-pairing.ts +100 -0
- package/src/client/hooks/editor/file-actions.ts +3 -11
- package/src/client/hooks/editor/font.test.ts +2 -1
- package/src/client/hooks/editor/use-file-transfer.ts +2 -1
- package/src/client/hooks/ui/clipboard.ts +26 -0
- package/src/client/lib/browser/download.ts +22 -0
- package/src/client/tailwind.css +5 -0
- package/src/server/index.ts +2 -0
- package/src/server/lib/assets/font-css.server.test.ts +19 -0
- package/src/server/lib/auth/client-address.test.ts +58 -0
- package/src/server/lib/auth/client-address.ts +37 -3
- package/src/server/lib/auth/guard.ts +31 -4
- package/src/server/lib/auth/rate-limit.test.ts +25 -8
- package/src/server/lib/auth/rate-limit.ts +8 -5
- package/src/server/lib/connect/cloudflared.lifecycle.test.ts +88 -0
- package/src/server/lib/connect/cloudflared.server.test.ts +65 -0
- package/src/server/lib/connect/cloudflared.server.ts +206 -0
- package/src/server/lib/connect/devices.server.ts +192 -0
- package/src/server/lib/connect/identity.server.ts +81 -0
- package/src/server/lib/connect/pairing.server.test.ts +56 -0
- package/src/server/lib/connect/pairing.server.ts +113 -0
- package/src/server/lib/connect/qr.roundtrip.test.ts +106 -0
- package/src/server/lib/connect/qr.server.ts +36 -0
- package/src/server/lib/connect/run.server.ts +101 -0
- package/src/server/lib/connect/status.server.ts +177 -0
- package/src/server/lib/connect/tailscale.server.test.ts +117 -0
- package/src/server/lib/connect/tailscale.server.ts +172 -0
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/omp/session/changes.test.ts +64 -1
- package/src/server/lib/omp/session/changes.ts +94 -1
- package/src/server/routes/connect/devices.ts +56 -0
- package/src/server/routes/connect/index.ts +15 -0
- package/src/server/routes/connect/pair-page.ts +177 -0
- package/src/server/routes/connect/pair.ts +158 -0
- package/src/server/routes/connect/status.ts +19 -0
- package/src/server/routes/connect/tunnels.ts +76 -0
- package/src/server/routes/health/probe.ts +5 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/sessions/changes.test.ts +12 -3
- package/src/server/routes/sessions/changes.ts +27 -3
- package/src/server/routes/sessions/index.ts +2 -1
- package/src/shared/lib/connect/payload.test.ts +144 -0
- package/src/shared/lib/connect/payload.ts +229 -0
- package/src/shared/lib/connect/tier.test.ts +73 -0
- package/src/shared/lib/connect/tier.ts +105 -0
- package/src/shared/lib/connect/types.ts +99 -0
- package/src/shared/lib/dictation/capture-failure.test.ts +46 -0
- package/src/shared/lib/dictation/capture-failure.ts +36 -0
- package/src/shared/lib/markdown/fira-code-fonts.css +65 -6
- package/src/shared/lib/markdown/marked.ts +7 -4
- package/src/shared/lib/markdown/mermaid-actions.test.ts +78 -0
- package/src/shared/lib/markdown/mermaid-actions.ts +45 -0
- package/src/shared/lib/markdown/mermaid.ts +41 -7
- package/src/shared/lib/settings/sections.ts +6 -1
- package/src/shared/types/session-changes.ts +6 -0
- package/src/shared/types/settings/state.ts +2 -0
- package/dist/client/static/js/Modal-qtftcp2t.js +0 -38
- package/dist/client/static/js/architecture-7GRP2DOG-tavtgb8a.js +0 -1
- package/dist/client/static/js/bash-b3rwyg5p.js +0 -1
- package/dist/client/static/js/cpp-y0t6mynx.js +0 -1
- package/dist/client/static/js/css-6vj0d308.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-cdh3n2z2.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-as97tpyp.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-ggm06d12.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-eqz7p9ng.js +0 -1
- package/dist/client/static/js/graphql-n43pd5fs.js +0 -1
- package/dist/client/static/js/index-at6bhjyf.js +0 -1
- package/dist/client/static/js/index-bkye8mz4.js +0 -2
- package/dist/client/static/js/index-e94a1en0.css +0 -1
- package/dist/client/static/js/index-sffjtm5w.js +0 -12
- package/dist/client/static/js/info-A6RAGUB7-4pkzh1qx.js +0 -1
- package/dist/client/static/js/ini-j5dyq6gm.js +0 -1
- package/dist/client/static/js/java-g4dgwbfd.js +0 -1
- package/dist/client/static/js/jsx-7t5ecz9s.js +0 -1
- package/dist/client/static/js/lua-1g6w30de.js +0 -1
- package/dist/client/static/js/markdown-afx21x8c.js +0 -1
- package/dist/client/static/js/one-dark-pro-hm3f56n1.js +0 -1
- package/dist/client/static/js/one-light-xrz49rct.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-yg71sp88.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-89wd6np0.js +0 -1
- package/dist/client/static/js/properties-thd83wey.js +0 -1
- package/dist/client/static/js/python-264ns4xw.js +0 -1
- package/dist/client/static/js/r-qw82kkv9.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-avn0b8r9.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-de27xv5w.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-rg4zzj7x.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d84fhj8v.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-dvf8xrmc.js +0 -1
- package/dist/client/static/js/sql-g8wcshpc.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xs2en5dv.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-mham0bh6.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-mxrxax86.js +0 -1
- package/dist/client/static/js/tsx-nm94hed6.js +0 -1
- package/dist/client/static/js/typescript-0s2t05jj.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-8vrvh9p3.js +0 -1
- package/dist/client/static/js/xml-dz51p1m3.js +0 -1
- package/dist/client/static/js/yaml-2cfkd30t.js +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `describeCaptureFailure` is the composer's only report of WHY the microphone
|
|
8
|
+
* did not open, so each branch is a message a user can act on — and the
|
|
9
|
+
* fallback must keep the DOMException's name, because the unnamed version is
|
|
10
|
+
* what made an Android WebView capture failure ("Could not open the
|
|
11
|
+
* microphone") impossible to diagnose from the screen.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { describe, expect, test } from 'bun:test';
|
|
15
|
+
import { describeCaptureFailure } from '@/shared/lib/dictation/capture-failure';
|
|
16
|
+
|
|
17
|
+
describe('describeCaptureFailure', () => {
|
|
18
|
+
test('names a refused permission', () => {
|
|
19
|
+
expect(describeCaptureFailure(new DOMException('refused', 'NotAllowedError'))).toBe('Microphone permission denied.');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('separates a device that could not start from a refused permission', () => {
|
|
23
|
+
// Android WebView's message before MODIFY_AUDIO_SETTINGS was declared: the
|
|
24
|
+
// permission WAS granted, so telling the user it was denied would be wrong.
|
|
25
|
+
const message = describeCaptureFailure(new DOMException('refused', 'NotReadableError'));
|
|
26
|
+
expect(message).toContain('could not be started');
|
|
27
|
+
expect(message).not.toContain('permission denied');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('separates a missing device', () => {
|
|
31
|
+
expect(describeCaptureFailure(new DOMException('refused', 'NotFoundError'))).toBe('No microphone was found.');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('keeps the name of an unclassified DOMException', () => {
|
|
35
|
+
// The name is the only diagnosable part; dropping it is the bug this test
|
|
36
|
+
// exists for.
|
|
37
|
+
expect(describeCaptureFailure(new DOMException('refused', 'SecurityError'))).toBe(
|
|
38
|
+
'Could not open the microphone (SecurityError).',
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('a rejection that is not a DOMException says so without inventing a name', () => {
|
|
43
|
+
expect(describeCaptureFailure(new Error('boom'))).toBe('Could not open the microphone.');
|
|
44
|
+
expect(describeCaptureFailure(undefined)).toBe('Could not open the microphone.');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What the composer says when `getUserMedia` refuses the microphone.
|
|
8
|
+
*
|
|
9
|
+
* The reason matters more than the sentence: the three failures a user can act
|
|
10
|
+
* on are a refused permission, a device another app holds, and no device at
|
|
11
|
+
* all — and the fourth case is everything else, which is exactly the case that
|
|
12
|
+
* used to be reported as a bare "Could not open the microphone." with nothing
|
|
13
|
+
* to search for. Android WebView's `NotReadableError` is the one that made this
|
|
14
|
+
* necessary: the app's `RECORD_AUDIO` grant and the page's secure origin were
|
|
15
|
+
* both fine, and the capture still failed one layer below them (Chromium's
|
|
16
|
+
* communication-device selection needs `MODIFY_AUDIO_SETTINGS` in the host
|
|
17
|
+
* manifest). Naming the DOMException is what turns that into a report someone
|
|
18
|
+
* can act on.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** The sentence the composer shows for a failed capture. */
|
|
22
|
+
export function describeCaptureFailure(cause: unknown): string {
|
|
23
|
+
const name = cause instanceof DOMException ? cause.name : '';
|
|
24
|
+
switch (name) {
|
|
25
|
+
case 'NotAllowedError':
|
|
26
|
+
return 'Microphone permission denied.';
|
|
27
|
+
case 'NotReadableError':
|
|
28
|
+
return 'The microphone could not be started — another app may be using it.';
|
|
29
|
+
case 'NotFoundError':
|
|
30
|
+
return 'No microphone was found.';
|
|
31
|
+
default:
|
|
32
|
+
// An unnamed rejection is not a DOMException at all (a thrown string, a
|
|
33
|
+
// missing `AudioContext`), so there is no name to append.
|
|
34
|
+
return name ? `Could not open the microphone (${name}).` : 'Could not open the microphone.';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -7,12 +7,29 @@
|
|
|
7
7
|
* GENERATED — do not edit by hand. Run `bun run scripts/katex-fonts-woff2.mjs`
|
|
8
8
|
* after upgrading @fontsource/fira-code.
|
|
9
9
|
*
|
|
10
|
-
* Fira Code, latin
|
|
11
|
-
* `main.tsx` imports. Replaces
|
|
12
|
-
* which pulled 7 subsets
|
|
13
|
-
* latin-ext, symbols2) x 4
|
|
14
|
-
*
|
|
15
|
-
* fallback is never fetched by
|
|
10
|
+
* Fira Code, latin + symbols2 subsets, woff2-only, weights 400/500/600/700 —
|
|
11
|
+
* the faces `main.tsx` imports. Replaces
|
|
12
|
+
* `@fontsource/fira-code/{400,500,600,700}.css`, which pulled 7 subsets
|
|
13
|
+
* (cyrillic, cyrillic-ext, greek, greek-ext, latin, latin-ext, symbols2) x 4
|
|
14
|
+
* weights x 2 formats = 56 files. This console is English-only, so the
|
|
15
|
+
* language subsets were dead weight, and the woff fallback is never fetched by
|
|
16
|
+
* a browser that supports woff2.
|
|
17
|
+
*
|
|
18
|
+
* ## `symbols2` is NOT a language subset — dropping it broke every ASCII box
|
|
19
|
+
*
|
|
20
|
+
* It is the only subset carrying U+2500-259F (box drawing) and U+2000-200A
|
|
21
|
+
* (the fixed-width spaces). Without it those codepoints have no Fira Code face
|
|
22
|
+
* and fall through to the next family in the stack, `monospace` — a system
|
|
23
|
+
* face whose advance is not 0.6 em. Measured in WebKit at 12px: `M` 7.2px,
|
|
24
|
+
* `─`/`│`/`┌` 8.502px, so a box drawn with `─` overshoots its own `│` border by
|
|
25
|
+
* 1.3px per column and an agent's ASCII diagram arrives visibly skewed. With
|
|
26
|
+
* the face below declared, all four measure 7.2px.
|
|
27
|
+
*
|
|
28
|
+
* The `unicode-range` on every face is upstream's, and it is what keeps the
|
|
29
|
+
* 4 kB symbols2 files off the wire: a page that lays out no box-drawing glyph
|
|
30
|
+
* never requests them. Declaring the ranges also makes the face choice
|
|
31
|
+
* explicit instead of relying on "last declared wins" for the U+2000-200A
|
|
32
|
+
* overlap with latin.
|
|
16
33
|
*
|
|
17
34
|
* `font-display: swap` and the family/style/weight declarations match upstream,
|
|
18
35
|
* so text metrics are unchanged.
|
|
@@ -24,6 +41,7 @@
|
|
|
24
41
|
font-display: swap;
|
|
25
42
|
font-weight: 400;
|
|
26
43
|
src: url('@fontsource/fira-code/files/fira-code-latin-400-normal.woff2') format('woff2');
|
|
44
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
27
45
|
}
|
|
28
46
|
|
|
29
47
|
@font-face {
|
|
@@ -32,6 +50,7 @@
|
|
|
32
50
|
font-display: swap;
|
|
33
51
|
font-weight: 500;
|
|
34
52
|
src: url('@fontsource/fira-code/files/fira-code-latin-500-normal.woff2') format('woff2');
|
|
53
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
35
54
|
}
|
|
36
55
|
|
|
37
56
|
@font-face {
|
|
@@ -40,6 +59,7 @@
|
|
|
40
59
|
font-display: swap;
|
|
41
60
|
font-weight: 600;
|
|
42
61
|
src: url('@fontsource/fira-code/files/fira-code-latin-600-normal.woff2') format('woff2');
|
|
62
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
43
63
|
}
|
|
44
64
|
|
|
45
65
|
@font-face {
|
|
@@ -48,4 +68,43 @@
|
|
|
48
68
|
font-display: swap;
|
|
49
69
|
font-weight: 700;
|
|
50
70
|
src: url('@fontsource/fira-code/files/fira-code-latin-700-normal.woff2') format('woff2');
|
|
71
|
+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Box drawing, block elements and the fixed-width spaces — see the note above.
|
|
75
|
+
* Declared AFTER latin so the U+2000-200A overlap resolves to this face. */
|
|
76
|
+
@font-face {
|
|
77
|
+
font-family: 'Fira Code';
|
|
78
|
+
font-style: normal;
|
|
79
|
+
font-display: swap;
|
|
80
|
+
font-weight: 400;
|
|
81
|
+
src: url('@fontsource/fira-code/files/fira-code-symbols2-400-normal.woff2') format('woff2');
|
|
82
|
+
unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@font-face {
|
|
86
|
+
font-family: 'Fira Code';
|
|
87
|
+
font-style: normal;
|
|
88
|
+
font-display: swap;
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
src: url('@fontsource/fira-code/files/fira-code-symbols2-500-normal.woff2') format('woff2');
|
|
91
|
+
unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@font-face {
|
|
95
|
+
font-family: 'Fira Code';
|
|
96
|
+
font-style: normal;
|
|
97
|
+
font-display: swap;
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
src: url('@fontsource/fira-code/files/fira-code-symbols2-600-normal.woff2') format('woff2');
|
|
100
|
+
unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@font-face {
|
|
104
|
+
font-family: 'Fira Code';
|
|
105
|
+
font-style: normal;
|
|
106
|
+
font-display: swap;
|
|
107
|
+
font-weight: 700;
|
|
108
|
+
src: url('@fontsource/fira-code/files/fira-code-symbols2-700-normal.woff2') format('woff2');
|
|
109
|
+
unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
|
|
51
110
|
}
|
|
@@ -32,6 +32,7 @@ import { codeSafeAutolink } from '@/shared/lib/markdown/autolink';
|
|
|
32
32
|
import remend from 'remend';
|
|
33
33
|
import { highlightCode } from '@/shared/lib/code/syntax-highlight';
|
|
34
34
|
import { directiveBlockHtml, isDirectiveLanguage, parseDirectiveAttributes } from '@/shared/lib/markdown/directives';
|
|
35
|
+
import { mermaidActionsHtml, mermaidSourceHtml } from '@/shared/lib/markdown/mermaid-actions';
|
|
35
36
|
import { mathExtensions, setProseEscaped } from '@/shared/lib/markdown/math-extensions';
|
|
36
37
|
import { registerBlockMapper } from '@/shared/lib/markdown/blocks/renderer';
|
|
37
38
|
import { mapBlocks } from '@/shared/lib/markdown/blocks/scan';
|
|
@@ -82,11 +83,13 @@ function codeBlockShell(code: string, bodyHtml: string): string {
|
|
|
82
83
|
</div>\n`;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
// ```mermaid fences become a placeholder hydrated to SVG by mermaid.ts.
|
|
86
|
+
// ```mermaid fences become a placeholder hydrated to SVG by mermaid.ts. The
|
|
87
|
+
// actions come from `mermaid-actions.ts` rather than `codeBlockShell` because
|
|
88
|
+
// the hydrated block carries a refresh button too, and both states must show
|
|
89
|
+
// the same set.
|
|
86
90
|
function mermaidBlockRenderer(code: string): string {
|
|
87
|
-
const body = `<
|
|
88
|
-
|
|
89
|
-
return `<div class="mermaid-block" data-mermaid="${encodeURIComponent(code)}" data-mermaid-state="pending">${shell}</div>`;
|
|
91
|
+
const body = `<div class="code-block">${mermaidActionsHtml(code)}${mermaidSourceHtml(code)}</div>`;
|
|
92
|
+
return `<div class="mermaid-block" data-mermaid="${encodeURIComponent(code)}" data-mermaid-state="pending">${body}</div>`;
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
function codeBlockRenderer(token: CodeToken): string {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The mermaid block's own actions.
|
|
8
|
+
*
|
|
9
|
+
* The refresh button is the reader's only repair for a diagram that rendered
|
|
10
|
+
* blank, and it is wired by a DELEGATED listener that looks for
|
|
11
|
+
* `data-mermaid-refresh` — so the two things that can silently kill it are
|
|
12
|
+
* (a) the attribute not surviving `sanitizeHtml`, and (b) the hydrated block
|
|
13
|
+
* replacing the placeholder's markup with a set that lacks the button. Both
|
|
14
|
+
* are asserted here, plus the copy payload, which must be the diagram source
|
|
15
|
+
* and not its URI escape.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { afterEach, describe, expect, test } from 'bun:test';
|
|
19
|
+
import { Window } from 'happy-dom';
|
|
20
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
21
|
+
import { renderMarkdown } from '@/shared/lib/markdown/marked';
|
|
22
|
+
import { sanitizeHtml } from '@/shared/lib/markdown/sanitize';
|
|
23
|
+
import { mermaidActionsHtml, mermaidSourceHtml } from '@/shared/lib/markdown/mermaid-actions';
|
|
24
|
+
import { refreshMermaidFromClick } from '@/shared/lib/markdown/mermaid';
|
|
25
|
+
|
|
26
|
+
afterEach(() => restoreDomGlobals());
|
|
27
|
+
|
|
28
|
+
const FENCE = '```mermaid\ngraph TD\n A["quoted"] --> B\n```';
|
|
29
|
+
|
|
30
|
+
describe('mermaid block actions', () => {
|
|
31
|
+
test('the placeholder carries both actions, and the refresh hook survives sanitizing', () => {
|
|
32
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
33
|
+
const html = sanitizeHtml(renderMarkdown(FENCE));
|
|
34
|
+
expect(html).toContain('data-mermaid-refresh');
|
|
35
|
+
expect(html).toContain('data-copy=');
|
|
36
|
+
// The copy payload is the source, not its percent escape.
|
|
37
|
+
expect(html).toContain('graph TD');
|
|
38
|
+
expect(html).not.toContain('graph%20TD');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('the hydrated action set is the same one the placeholder emitted', () => {
|
|
42
|
+
const html = mermaidActionsHtml('graph TD\n A --> B');
|
|
43
|
+
expect(html).toContain('data-mermaid-refresh');
|
|
44
|
+
expect(html).toContain('data-copy="graph TD\n A --> B"');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('a quote in the source cannot break out of the copy attribute', () => {
|
|
48
|
+
const html = mermaidActionsHtml('A["x"] --> B');
|
|
49
|
+
expect(html).toContain('data-copy="A["x"] --> B"');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('the fallback body escapes markup so a fence cannot inject HTML', () => {
|
|
53
|
+
expect(mermaidSourceHtml('<img src=x onerror=alert(1)>')).toBe(
|
|
54
|
+
'<pre><code class="language-mermaid"><img src=x onerror=alert(1)></code></pre>',
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('a click on the refresh button re-renders that block and reports handled', () => {
|
|
59
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
60
|
+
const host = document.createElement('div');
|
|
61
|
+
// The raw render, not `sanitizeHtml`: happy-dom's purifier drops every
|
|
62
|
+
// `<div>`, which would remove the block this test is about.
|
|
63
|
+
host.innerHTML = renderMarkdown(FENCE);
|
|
64
|
+
document.body.append(host);
|
|
65
|
+
const block = host.querySelector<HTMLElement>('.mermaid-block')!;
|
|
66
|
+
block.querySelector('pre')!.setAttribute('data-marker', '1');
|
|
67
|
+
const button = block.querySelector<HTMLElement>('[data-mermaid-refresh]')!;
|
|
68
|
+
|
|
69
|
+
expect(refreshMermaidFromClick(button)).toBe(true);
|
|
70
|
+
// The block was reset to its placeholder, which is the retry starting.
|
|
71
|
+
expect(block.querySelector('[data-marker]')).toBeNull();
|
|
72
|
+
// The retry is in flight: `renderBlock` marks the block before awaiting.
|
|
73
|
+
expect(block.dataset.mermaidState).toBe('rendering');
|
|
74
|
+
|
|
75
|
+
// Any other click is not a refresh, so the caller keeps its own handling.
|
|
76
|
+
expect(refreshMermaidFromClick(host)).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The floating actions every mermaid block carries: copy the source, and
|
|
8
|
+
* re-render the diagram.
|
|
9
|
+
*
|
|
10
|
+
* Shared by the marked placeholder (`marked.ts`) and the hydrated block
|
|
11
|
+
* (`mermaid.ts`) because `applySvg` REPLACES the placeholder's innerHTML — a
|
|
12
|
+
* second copy of this markup is how the refresh button would exist before the
|
|
13
|
+
* first render and disappear after it, which is exactly when a blank diagram
|
|
14
|
+
* needs it.
|
|
15
|
+
*
|
|
16
|
+
* The refresh button is `data-mermaid-refresh`: the delegated click listener
|
|
17
|
+
* in `MarkdownRenderer` reads it, so no component handler is needed. It must
|
|
18
|
+
* stay a separate button from `data-copy` — the copy branch returns early on
|
|
19
|
+
* an empty `data-copy`, and a refresh that fell through to it would copy the
|
|
20
|
+
* empty string and drop the click.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const COPY_ICON =
|
|
24
|
+
'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';
|
|
25
|
+
|
|
26
|
+
const REFRESH_ICON =
|
|
27
|
+
'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-2.64-6.36"/><polyline points="21 3 21 9 15 9"/></svg>';
|
|
28
|
+
|
|
29
|
+
/** Both action buttons for a block whose source is `source`. */
|
|
30
|
+
export function mermaidActionsHtml(source: string): string {
|
|
31
|
+
const copyAttr = source.replace(/"/g, '"');
|
|
32
|
+
return (
|
|
33
|
+
`<button type="button" class="code-copy-float" data-copy="${copyAttr}" aria-label="Copy diagram source" title="Copy diagram source">${COPY_ICON}</button>` +
|
|
34
|
+
`<button type="button" class="code-copy-float mermaid-refresh-float" data-mermaid-refresh aria-label="Refresh diagram" title="Refresh diagram">${REFRESH_ICON}</button>`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The pending/error body: the raw source, hidden while a render is in flight. */
|
|
39
|
+
export function mermaidSourceHtml(source: string): string {
|
|
40
|
+
const escaped = source
|
|
41
|
+
.replace(/&/g, '&')
|
|
42
|
+
.replace(/</g, '<')
|
|
43
|
+
.replace(/>/g, '>');
|
|
44
|
+
return `<pre><code class="language-mermaid">${escaped}</code></pre>`;
|
|
45
|
+
}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { sanitizeMermaidSvg } from '@/shared/lib/markdown/sanitize';
|
|
21
|
+
import { mermaidActionsHtml, mermaidSourceHtml } from '@/shared/lib/markdown/mermaid-actions';
|
|
21
22
|
import { isDarkTheme } from '@/shared/lib/theme/catalog';
|
|
22
23
|
|
|
23
24
|
export interface MermaidRenderResult {
|
|
@@ -91,13 +92,10 @@ async function loadMermaid(themeKey: ThemeKey): Promise<MermaidModule['default']
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
function applySvg(block: HTMLElement, svg: string, themeKey: ThemeKey): void {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
block.
|
|
97
|
-
|
|
98
|
-
'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>' +
|
|
99
|
-
'</button>' +
|
|
100
|
-
svg;
|
|
95
|
+
// `dataset.mermaid` is URI-encoded for the attribute; the copy button must
|
|
96
|
+
// give the reader the diagram they can paste back, not its percent escape.
|
|
97
|
+
const source = decodeURIComponent(block.dataset.mermaid ?? '');
|
|
98
|
+
block.innerHTML = mermaidActionsHtml(source) + svg;
|
|
101
99
|
block.dataset.mermaidState = 'done';
|
|
102
100
|
block.dataset.mermaidTheme = themeKey;
|
|
103
101
|
|
|
@@ -167,3 +165,39 @@ export async function hydrateMermaidBlocks(
|
|
|
167
165
|
);
|
|
168
166
|
return { rendered: results.filter(Boolean).length, failed: results.filter((ok) => !ok).length };
|
|
169
167
|
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Re-render one block from scratch — the block's own Refresh button.
|
|
171
|
+
*
|
|
172
|
+
* The cached SVG is dropped first: a blank diagram is usually a cached blank
|
|
173
|
+
* (or an SVG whose sanitized markup lost a node), so re-applying the cache
|
|
174
|
+
* would reproduce the blank the reader just asked to fix. The block is reset
|
|
175
|
+
* to its placeholder before the retry, so a failed second attempt shows the
|
|
176
|
+
* source in the error colour instead of leaving the old blank SVG up.
|
|
177
|
+
*/
|
|
178
|
+
export async function refreshMermaidBlock(block: HTMLElement): Promise<void> {
|
|
179
|
+
const encoded = block.dataset.mermaid;
|
|
180
|
+
if (encoded == null) return;
|
|
181
|
+
const source = decodeURIComponent(encoded);
|
|
182
|
+
const themeKey = resolveThemeKey();
|
|
183
|
+
svgCache.delete(cacheKey(themeKey, source));
|
|
184
|
+
block.dataset.mermaidState = 'pending';
|
|
185
|
+
delete block.dataset.mermaidTheme;
|
|
186
|
+
block.innerHTML = `<div class="code-block">${mermaidActionsHtml(source)}${mermaidSourceHtml(source)}</div>`;
|
|
187
|
+
await renderBlock(block, false);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Handle a click that landed on a block's Refresh button.
|
|
192
|
+
*
|
|
193
|
+
* Returns true when the click WAS a refresh, so the caller stops there: the
|
|
194
|
+
* block is also a door into the zoom/pan viewer, and letting the click fall
|
|
195
|
+
* through would open a blank overlay instead of retrying the render.
|
|
196
|
+
*/
|
|
197
|
+
export function refreshMermaidFromClick(target: EventTarget | null): boolean {
|
|
198
|
+
const button = (target as HTMLElement | null)?.closest?.<HTMLButtonElement>('button[data-mermaid-refresh]');
|
|
199
|
+
if (!button) return false;
|
|
200
|
+
const block = button.closest<HTMLElement>('.mermaid-block');
|
|
201
|
+
if (block) void refreshMermaidBlock(block);
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
@@ -21,8 +21,13 @@
|
|
|
21
21
|
*
|
|
22
22
|
* There is no `LIBRARY` group: plugins, skills and the skills catalog are omp's
|
|
23
23
|
* own extension surface, so they file under `OMP` with the rest of its config.
|
|
24
|
+
*
|
|
25
|
+
* `CONNECT` sits directly after `KABMO` because it is about reaching this
|
|
26
|
+
* install, not about configuring the agent: tunnels, addresses and paired
|
|
27
|
+
* devices are the first thing a user sets up on a new machine, and burying them
|
|
28
|
+
* under `OMP` would file a network fact with the engine's own config.
|
|
24
29
|
*/
|
|
25
30
|
|
|
26
|
-
export const SETTINGS_SECTIONS = ['KABMO', 'WORKSPACE', 'OMP', 'HARNESSES'] as const;
|
|
31
|
+
export const SETTINGS_SECTIONS = ['KABMO', 'CONNECT', 'WORKSPACE', 'OMP', 'HARNESSES'] as const;
|
|
27
32
|
|
|
28
33
|
export type SettingsSection = (typeof SETTINGS_SECTIONS)[number];
|
|
@@ -44,6 +44,12 @@ export interface ChangedFile {
|
|
|
44
44
|
agent: string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/** One file's net `+`/`−` line counts inside a run window. */
|
|
48
|
+
export interface SessionChangeCounts {
|
|
49
|
+
added: number;
|
|
50
|
+
removed: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
47
53
|
/** The two sides of one file's net change in a run, plus a unified patch. */
|
|
48
54
|
export interface SessionChangeDiff {
|
|
49
55
|
path: string;
|
|
@@ -20,6 +20,8 @@ export type SettingsCategoryId =
|
|
|
20
20
|
* sandboxed panel views). Deliberately NOT under OMP → Plugins, which holds
|
|
21
21
|
* plugins: these are Kabmo surfaces omp has no concept of. */
|
|
22
22
|
| 'panel-plugins'
|
|
23
|
+
// CONNECT — how a device reaches this install: tunnels, addresses, pairing.
|
|
24
|
+
| 'connect'
|
|
23
25
|
// WORKSPACE
|
|
24
26
|
| 'projects'
|
|
25
27
|
// OMP
|