@kabmo-labs/kabmo 0.32.1 → 0.34.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 +805 -637
- package/dist/client/static/js/{CsvGrid-4gx0jevc.js → CsvGrid-vze4m5ag.js} +2 -2
- package/dist/client/static/js/{DocxView-0667nr8h.js → DocxView-jbf21gmh.js} +5 -5
- package/dist/client/static/js/{DrawioView-522v0d0r.js → DrawioView-b52qybx5.js} +2 -2
- package/dist/client/static/js/{ImageView-t8xp60hm.js → ImageView-mdgzj8px.js} +1 -1
- package/dist/client/static/js/LayoutWrapper-3c49dvtt.js +2 -0
- package/dist/client/static/js/Modal-sqp864vd.js +38 -0
- package/dist/client/static/js/{PdfView-3fx172xh.js → PdfView-g06rxqb1.js} +1 -1
- package/dist/client/static/js/{SessionsView-n3agmf5t.js → SessionsView-521adxyr.js} +1 -1
- package/dist/client/static/js/{SheetView-nmrdb1b8.js → SheetView-h8xmsz7q.js} +22 -22
- package/dist/client/static/js/{SvgPreview-0xsc6xam.js → SvgPreview-1j4jvcvz.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-jj31rs62.js → abnfDiagram-O67JEVCF-pasxh4b6.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-fc9kmq1w.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ay3yr7pf.js → architectureDiagram-NJMV4G6O-ms14g0bm.js} +4 -4
- package/dist/client/static/js/{astro-qgx1r159.js → astro-80bs6hvg.js} +1 -1
- package/dist/client/static/js/bash-b3rwyg5p.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-4x33e16k.js → blockDiagram-BEXU5L5S-ycn78fcq.js} +4 -4
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-dtb81cgz.js → c4Diagram-YGBWAQC7-vn2gpjfm.js} +5 -5
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-vk5a2n9w.js → classDiagram-v2-NBCMYWYE-fyrm1pr5.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-6rbjbe19.js → cose-bilkent-JH36ORCC-ea5nwvgq.js} +1 -1
- package/dist/client/static/js/css-6vj0d308.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-a4t8992q.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-vyjksedr.js → cynefinDiagram-VND7K2PF-j6bsjpre.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-7hey38z5.js → dagre-6A5THRUB-4smdkwv8.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-aes06jde.js → diagram-22UHCM2B-9sm4kqwc.js} +19 -19
- package/dist/client/static/js/{diagram-3UASUU5V-3cfkgm3x.js → diagram-3UASUU5V-2h3qxaed.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-z8mfhwpy.js → diagram-ATOU4E4O-1981bc94.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-t4821ctz.js → diagram-CDSNMT55-3vgsxavc.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-23yxbfrx.js → diagram-MLGK6HIB-c9gf2r3f.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-chhtf7v0.js → diagram-MPIPVDR6-gjqeq92d.js} +2 -2
- package/dist/client/static/js/{dockerfile-5b87ghm7.js → dockerfile-8v935dkn.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-9jejcvfr.js → ebnfDiagram-ZINNZB2B-4vbsgh99.js} +1 -1
- package/dist/client/static/js/{elixir-rpa1g4gy.js → elixir-vcbg60wv.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-xhhtkf58.js → elk-276RUBZZ-nca3t891.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-mt2apjjb.js → erDiagram-OPXOYQCR-5kfkev03.js} +6 -6
- package/dist/client/static/js/{erlang-6m6tpt72.js → erlang-qt876zrq.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-18bdrkv5.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-fg0yqx0h.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-8cm7a29w.js → ganttDiagram-FUAMR5RP-mxc73wmq.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-8fa6y40p.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-5s0gbnx2.js → gitGraphDiagram-X574FWY7-7en3ag0e.js} +12 -12
- package/dist/client/static/js/graphql-n43pd5fs.js +1 -0
- package/dist/client/static/js/html-dbrwss36.js +1 -0
- package/dist/client/static/js/{index-ye3sr7db.js → index-0vm41je9.js} +4 -4
- package/dist/client/static/js/{index-5y7c62sm.js → index-1b0t1428.js} +5 -5
- package/dist/client/static/js/{index-9sd0vjmh.js → index-1ksg88qf.js} +2 -2
- package/dist/client/static/js/{index-brj8qwa6.js → index-1y9r4frb.js} +2 -2
- package/dist/client/static/js/index-231241f4.js +12 -0
- package/dist/client/static/js/index-2mx9ej4k.css +1 -0
- package/dist/client/static/js/{index-6q80csr0.js → index-2svnq5gg.js} +1 -1
- package/dist/client/static/js/{index-dt7e1328.js → index-354mqqra.js} +2 -2
- package/dist/client/static/js/{index-532btjmp.js → index-3zc1b0dv.js} +2 -2
- package/dist/client/static/js/{index-h06bcfds.js → index-4g46wbdw.js} +1 -1
- package/dist/client/static/js/{index-p7btwjvj.js → index-4qwzxj81.js} +3 -3
- package/dist/client/static/js/{index-3vhznzgr.js → index-52rqxgya.js} +1 -1
- package/dist/client/static/js/index-6sf2vsp2.js +1 -0
- package/dist/client/static/js/{index-xya34x4v.js → index-76zb4m0n.js} +2 -2
- package/dist/client/static/js/{index-jz9fpznk.js → index-7a64yjrm.js} +6 -6
- package/dist/client/static/js/{index-2xj14800.js → index-7y6rpsrp.js} +2 -2
- package/dist/client/static/js/{index-rg8jpbsw.js → index-8acv5b77.js} +2 -2
- package/dist/client/static/js/{index-ay34b398.js → index-a0fmsv1d.js} +19 -19
- package/dist/client/static/js/{index-2gfc25tq.js → index-ag2rmtas.js} +1 -1
- package/dist/client/static/js/{index-sa9cp6km.js → index-ahv9y42z.js} +2 -2
- package/dist/client/static/js/{index-g33knza2.js → index-b29afsjh.js} +1 -1
- package/dist/client/static/js/{index-629kfbcb.js → index-c3ek61zv.js} +2 -2
- package/dist/client/static/js/{index-360d7j0d.js → index-cd65zqba.js} +1 -1
- package/dist/client/static/js/{index-4s8ttfxj.js → index-cgzrpvzj.js} +211 -211
- package/dist/client/static/js/{index-gbfg0anm.js → index-dbe6afkf.js} +2 -2
- package/dist/client/static/js/{index-z4v1xmh1.js → index-ev3yt353.js} +2 -2
- package/dist/client/static/js/{index-ehcpzk5b.js → index-eyfcm0cy.js} +1 -1
- package/dist/client/static/js/{index-a733k69t.js → index-f7jhhqtk.js} +2 -2
- package/dist/client/static/js/{index-hc2jmzpx.js → index-fta1y9pc.js} +65 -65
- package/dist/client/static/js/{index-vd0e25p0.js → index-fvmfge3p.js} +1 -1
- package/dist/client/static/js/{index-a6k2hqke.js → index-g2dyfze9.js} +1 -1
- package/dist/client/static/js/index-h5bn97p6.js +2 -0
- package/dist/client/static/js/{index-7fdp9c7m.js → index-hf52f59k.js} +2 -2
- package/dist/client/static/js/{index-qkscve6n.js → index-j0r5hj0j.js} +2 -2
- package/dist/client/static/js/{index-ejgd8w3s.js → index-j51d5a5m.js} +28 -28
- package/dist/client/static/js/{index-kpspnztv.js → index-jsyekbx9.js} +2 -2
- package/dist/client/static/js/{index-a0bdavdr.js → index-km2zb6wk.js} +2 -2
- package/dist/client/static/js/{index-59jb53v3.js → index-nccwxv0s.js} +2 -2
- package/dist/client/static/js/{index-dnp07j57.js → index-p0nz38bm.js} +1 -1
- package/dist/client/static/js/{index-c0x6s6f7.js → index-pm6xxwz1.js} +2 -2
- package/dist/client/static/js/{index-5x95n3hx.js → index-ptcrwswj.js} +1 -1
- package/dist/client/static/js/{index-fdbfzshx.js → index-ptcwae2n.js} +2 -2
- package/dist/client/static/js/{index-h7pn9qw6.js → index-qckv9nte.js} +2 -2
- package/dist/client/static/js/{index-wzma5n54.js → index-r014brzs.js} +2 -2
- package/dist/client/static/js/{index-xj9649ac.js → index-ray2czf6.js} +7 -7
- package/dist/client/static/js/{index-qnwqaczk.js → index-rs80cwsv.js} +3 -3
- package/dist/client/static/js/{index-pf5sbesf.js → index-rytaa8ca.js} +2 -2
- package/dist/client/static/js/{index-c93sp4yh.js → index-rzxcj7cg.js} +1 -1
- package/dist/client/static/js/{index-a293pdg7.js → index-s7gkkkyz.js} +2 -2
- package/dist/client/static/js/{index-7n68yx6m.js → index-sd66wv26.js} +2 -2
- package/dist/client/static/js/{index-bbggh3f8.js → index-vhqe0y82.js} +2 -2
- package/dist/client/static/js/{index-dq1kdt03.js → index-vy6termr.js} +1 -1
- package/dist/client/static/js/{index-pf7syd7t.js → index-xx6mqpxm.js} +3 -3
- package/dist/client/static/js/{index-z5s27s26.js → index-ybm2x4vh.js} +1 -1
- package/dist/client/static/js/{index-jppt5mgc.js → index-zvfvqvn9.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-3hk844f7.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-3w1yz32c.js → infoDiagram-VRGFBTTK-sef80132.js} +2 -2
- package/dist/client/static/js/ini-j5dyq6gm.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ckt471dy.js → ishikawaDiagram-OU5B5YK6-yhvepp1q.js} +6 -6
- package/dist/client/static/js/java-g4dgwbfd.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kfvn4w7e.js → journeyDiagram-ZHPQQLJL-5w77y95w.js} +5 -5
- package/dist/client/static/js/jsx-7t5ecz9s.js +1 -0
- package/dist/client/static/js/{julia-0j0gsjvc.js → julia-d4j6wgvf.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-0q36cm83.js → kanban-definition-PNTS6WVX-02znqtna.js} +6 -6
- package/dist/client/static/js/lua-1g6w30de.js +1 -0
- package/dist/client/static/js/markdown-afx21x8c.js +1 -0
- package/dist/client/static/js/{mermaid.core-b1ssa824.js → mermaid.core-a6e6vck4.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-e2ym5en8.js → mindmap-definition-NLK3R4M7-y4n74q9x.js} +8 -8
- package/dist/client/static/js/one-dark-pro-vwhfpzr8.js +1 -0
- package/dist/client/static/js/one-light-y5t9x6zh.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-4nj2yy10.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-t8bbdyhe.js → pegDiagram-GJSIUBJH-pr7ehgzb.js} +1 -1
- package/dist/client/static/js/{perl-7n7e9ncg.js → perl-srptw5vm.js} +1 -1
- package/dist/client/static/js/{php-32vy69vd.js → php-n89g3fk7.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-k7rde3f9.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-envv4brj.js → pieDiagram-5QR66LMP-39wpsk08.js} +2 -2
- package/dist/client/static/js/properties-thd83wey.js +1 -0
- package/dist/client/static/js/python-264ns4xw.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-72rk137a.js → quadrantDiagram-O4NWA36T-esm913km.js} +4 -4
- package/dist/client/static/js/r-qw82kkv9.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-513dpw4f.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-9bqnst9c.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-7367d5bv.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-b806b1mj.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-5a67rwf8.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-1ej0f5hr.js → railroadDiagram-XR7U4H2S-wy2mgya6.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-rvdaknpd.js → requirementDiagram-PLB6GJNP-6z9xdgbq.js} +4 -4
- package/dist/client/static/js/{ruby-5ty7fys7.js → ruby-r81ytgcm.js} +1 -1
- package/dist/client/static/js/{rust-2geezrcs.js → rust-frn3szvc.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-nxvhtdaw.js → sankeyDiagram-IPEJSGJF-rtmxk3ys.js} +5 -5
- package/dist/client/static/js/{sass-mey5150f.js → sass-9bxped7y.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-n5cn5qrt.js → sequenceDiagram-PO4LG4MO-awzcrafg.js} +18 -18
- package/dist/client/static/js/{sizeCapture-INFHLROL-r074kj7s.js → sizeCapture-INFHLROL-03gy196j.js} +1 -1
- package/dist/client/static/js/sql-0e9mnrda.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vxghxdb0.js → stateDiagram-v2-GCMORJYK-an8v3q5n.js} +3 -3
- package/dist/client/static/js/{svelte-3ewx0hzx.js → svelte-mwtx07d9.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-qkkv894p.js → swimlanes-2SLR337P-n9yb4wcs.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-nx5nfnf0.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-5tbq4ex2.js → timeline-definition-EJHVYXUP-jceb575g.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-kcy40evb.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-fsrvqxf4.js +1 -0
- package/dist/client/static/js/tsx-nm94hed6.js +1 -0
- package/dist/client/static/js/typescript-0s2t05jj.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-6p8hf0b7.js → usecaseDiagram-POWQR4AR-888h3100.js} +39 -39
- package/dist/client/static/js/vennDiagram-UO4OBE2U-wbfz0rzv.js +34 -0
- package/dist/client/static/js/{vue-06rdf4wh.js → vue-c0rtg1wf.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-36dmxww4.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-km2x4er8.js → wardleyDiagram-VNRHLVJA-rn8c5qf9.js} +4 -4
- package/dist/client/static/js/xml-dz51p1m3.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-kr3sgr4m.js → xychartDiagram-PMCCYNJV-8sn1apt6.js} +5 -5
- package/dist/client/static/js/yaml-2cfkd30t.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/common/context-usage-button/McpSection.test.tsx +98 -0
- package/src/client/components/common/context-usage-button/McpSection.tsx +12 -5
- package/src/client/components/common/context-usage-button/SessionStats.tsx +80 -0
- package/src/client/components/common/context-usage-button/index.test.tsx +26 -0
- package/src/client/components/common/context-usage-button/index.tsx +36 -28
- package/src/client/components/common/harness-glyph/brands.ts +8 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +12 -3
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
- package/src/client/components/settings/Modal.tsx +14 -84
- package/src/client/components/settings/Sidebar.tsx +3 -1
- package/src/client/components/settings/apply-side-effects.test.ts +11 -0
- package/src/client/components/settings/apply-side-effects.ts +7 -0
- package/src/client/components/settings/categories/ChatSettings.test.tsx +1 -1
- package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
- package/src/client/components/settings/categories/ConnectSettings.tsx +105 -0
- package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/ChangedFilesSection.tsx +79 -0
- package/src/client/components/settings/categories/chat-settings/groups.ts +4 -3
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +145 -0
- package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +160 -0
- package/src/client/components/settings/categories/connect-settings/QrCode.tsx +73 -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/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 +137 -0
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +33 -1
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +22 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +13 -0
- package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
- package/src/client/components/workspace/diff-panel/Toolbar.tsx +17 -51
- package/src/client/components/workspace/diff-panel/index.tsx +23 -4
- package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +94 -0
- package/src/client/components/workspace/editor/Body.tsx +2 -0
- package/src/client/data/settings/omp-schema.json +73 -3
- package/src/client/hooks/chat/timeline/change-stats.ts +57 -0
- package/src/client/hooks/chat/timeline/changed-files-setting.test.ts +31 -0
- package/src/client/hooks/chat/timeline/changed-files-setting.ts +60 -0
- package/src/client/hooks/chat/timeline/session-changes.ts +51 -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/ui/clipboard.ts +26 -0
- package/src/client/hooks/ui/notification-events.test.ts +3 -0
- package/src/client/hooks/ui/notification-events.ts +3 -1
- package/src/client/hooks/ui/notification-sound.ts +13 -6
- package/src/client/hooks/ui/ui-sounds.test.ts +15 -0
- package/src/client/hooks/workspace/diff-file.ts +11 -4
- package/src/client/hooks/workspace/file-tabs.ts +13 -4
- package/src/client/hooks/workspace/journal-diff.ts +97 -0
- package/src/client/lib/notifications/native-banner-sound.test.ts +93 -0
- package/src/client/lib/notifications/native-banner-sound.ts +46 -0
- package/src/client/lib/notifications/os.test.ts +14 -5
- package/src/client/lib/notifications/os.ts +8 -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/harness/launch-table.ts +10 -0
- package/src/server/lib/omp/session/changes.test.ts +201 -0
- package/src/server/lib/omp/session/changes.ts +313 -0
- package/src/server/lib/omp/session/session-discovery.test.ts +4 -4
- package/src/server/lib/omp/session/sidebar-activity.server.test.ts +6 -2
- package/src/server/lib/omp/session/subagent-presence-scan.ts +54 -0
- package/src/server/lib/omp/session/subagent-presence-store.test.ts +1 -1
- package/src/server/lib/omp/session/subagent-presence.test.ts +115 -0
- package/src/server/lib/omp/session/subagent-presence.ts +12 -3
- package/src/server/lib/omp/session/telemetry/compute.ts +68 -0
- package/src/server/lib/omp/session/telemetry.test.ts +81 -0
- 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 +99 -0
- package/src/server/routes/sessions/changes.ts +79 -0
- package/src/server/routes/sessions/index.ts +7 -0
- package/src/shared/lib/chat/duration.ts +34 -0
- package/src/shared/lib/chat/timeline/changed-files.test.ts +121 -0
- package/src/shared/lib/chat/timeline/changed-files.ts +71 -0
- package/src/shared/lib/chat/timeline/fork-anchor.test.ts +3 -0
- 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/format/duration.test.ts +31 -0
- package/src/shared/lib/format/duration.ts +27 -0
- package/src/shared/lib/fs/unified-diff.test.ts +53 -0
- package/src/shared/lib/fs/unified-diff.ts +127 -0
- package/src/shared/lib/harness/brand-color.ts +3 -0
- package/src/shared/lib/harness/catalog.test.ts +13 -0
- package/src/shared/lib/harness/catalog.ts +8 -1
- package/src/shared/lib/harness/fork.ts +4 -2
- package/src/shared/lib/harness/mcp-facts.ts +3 -0
- package/src/shared/lib/harness/provider-facts.ts +14 -0
- package/src/shared/lib/harness/updates.ts +5 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +27 -27
- 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/omp/config/schema.test.ts +4 -2
- package/src/shared/lib/settings/defaults.ts +1 -0
- package/src/shared/lib/settings/sections.ts +6 -1
- package/src/shared/lib/workspace/file-tab-id.ts +9 -0
- package/src/shared/types/context.ts +18 -0
- package/src/shared/types/fs.ts +21 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/omp/session.ts +6 -0
- package/src/shared/types/session-changes.ts +64 -0
- package/src/shared/types/settings/state.ts +10 -0
- package/dist/client/static/js/LayoutWrapper-xjnveecv.js +0 -2
- package/dist/client/static/js/Modal-k2jr9hc4.js +0 -38
- package/dist/client/static/js/architecture-7GRP2DOG-1y9zvsyt.js +0 -1
- package/dist/client/static/js/bash-m0qjsyy0.js +0 -1
- package/dist/client/static/js/css-t4ngafan.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-k2188qcq.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-pdr0qn0n.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-zvz0mxne.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-wmqf046s.js +0 -1
- package/dist/client/static/js/graphql-692h0n2x.js +0 -1
- package/dist/client/static/js/html-pv88ny12.js +0 -1
- package/dist/client/static/js/index-61tm0v57.js +0 -1
- package/dist/client/static/js/index-e94a1en0.css +0 -1
- package/dist/client/static/js/index-kg86e3sy.js +0 -12
- package/dist/client/static/js/index-nmmxb4va.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-zg3twte6.js +0 -1
- package/dist/client/static/js/ini-cg0a5wm3.js +0 -1
- package/dist/client/static/js/java-vcck089n.js +0 -1
- package/dist/client/static/js/jsx-ht9zyzwa.js +0 -1
- package/dist/client/static/js/lua-ke895s2q.js +0 -1
- package/dist/client/static/js/markdown-gwmsh53r.js +0 -1
- package/dist/client/static/js/one-dark-pro-4geyzhjj.js +0 -1
- package/dist/client/static/js/one-light-tqssjm9t.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-3pav51g0.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-wqfh7zdk.js +0 -1
- package/dist/client/static/js/properties-mzvvbqg5.js +0 -1
- package/dist/client/static/js/python-3w64wsyd.js +0 -1
- package/dist/client/static/js/r-32re2zwb.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-w7qjdr2g.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-rhr99kkj.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-c4jeea3m.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-x2ee66ex.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yw8wjfwg.js +0 -1
- package/dist/client/static/js/sql-g8wcshpc.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y81h9n27.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-ekz05ccs.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-aq6qymjr.js +0 -1
- package/dist/client/static/js/tsx-0p183w2f.js +0 -1
- package/dist/client/static/js/typescript-t9a5jyvv.js +0 -1
- package/dist/client/static/js/vennDiagram-UO4OBE2U-7k5jsxf9.js +0 -34
- package/dist/client/static/js/wardley-WFR3VGLG-z34tj4y3.js +0 -1
- package/dist/client/static/js/xml-81hxjjt4.js +0 -1
- package/dist/client/static/js/yaml-yssayv8a.js +0 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The paired devices, and the one action that matters on each row.
|
|
8
|
+
*
|
|
9
|
+
* The route and round trip are what the DEVICE reported, not something the
|
|
10
|
+
* server measured — it cannot measure a phone's latency. Showing them is what
|
|
11
|
+
* makes the fallback order visible: a phone on Tailscale at home and the same
|
|
12
|
+
* phone on Cloudflare at a café are two different rows of the same device, and
|
|
13
|
+
* the user can see which one it is using right now.
|
|
14
|
+
*
|
|
15
|
+
* A table on a desktop, stacked rows on a phone. The columns are the same facts
|
|
16
|
+
* in both; only the arrangement changes, because a horizontally scrolling table
|
|
17
|
+
* on a phone hides the revoke button off-screen.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { Trash2 } from 'lucide-preact';
|
|
21
|
+
import type { PairedDevice } from '@/shared/lib/connect/types';
|
|
22
|
+
|
|
23
|
+
const ROUTE_LABEL: Record<NonNullable<PairedDevice['route']>, string> = {
|
|
24
|
+
tailscale: 'Tailscale',
|
|
25
|
+
lan: 'LAN',
|
|
26
|
+
cloudflare: 'Cloudflare',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function relative(iso: string | null): string {
|
|
30
|
+
if (!iso) return 'never';
|
|
31
|
+
const then = Date.parse(iso);
|
|
32
|
+
if (!Number.isFinite(then)) return 'never';
|
|
33
|
+
const seconds = Math.max(0, Math.round((Date.now() - then) / 1000));
|
|
34
|
+
if (seconds < 60) return 'just now';
|
|
35
|
+
const minutes = Math.round(seconds / 60);
|
|
36
|
+
if (minutes < 60) return `${minutes} min ago`;
|
|
37
|
+
const hours = Math.round(minutes / 60);
|
|
38
|
+
if (hours < 24) return `${hours} h ago`;
|
|
39
|
+
return `${Math.round(hours / 24)} d ago`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface DeviceTableProps {
|
|
43
|
+
devices: PairedDevice[];
|
|
44
|
+
busy: string | null;
|
|
45
|
+
onRevoke: (id: string) => void;
|
|
46
|
+
onAdd: () => void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function DeviceTable({ devices, busy, onRevoke, onAdd }: DeviceTableProps) {
|
|
50
|
+
return (
|
|
51
|
+
<section className="rounded-xl border border-ink/10 bg-paper">
|
|
52
|
+
<header className="flex items-center justify-between gap-2 border-b border-ink/10 px-4 py-3">
|
|
53
|
+
<h4 className="text-sm font-semibold text-ink">Paired devices</h4>
|
|
54
|
+
<button
|
|
55
|
+
type="button"
|
|
56
|
+
onClick={onAdd}
|
|
57
|
+
className="rounded-lg border border-ink/15 px-2.5 py-1 text-[11px] font-semibold text-ink transition-colors hover:bg-ink/5"
|
|
58
|
+
>
|
|
59
|
+
Add a device
|
|
60
|
+
</button>
|
|
61
|
+
</header>
|
|
62
|
+
|
|
63
|
+
{devices.length === 0 ? (
|
|
64
|
+
<div className="px-4 py-6">
|
|
65
|
+
<p className="text-[11px] leading-relaxed text-ink/60">
|
|
66
|
+
No device has been paired yet. Add one to reach this server from your phone without typing an
|
|
67
|
+
address or a password.
|
|
68
|
+
</p>
|
|
69
|
+
</div>
|
|
70
|
+
) : (
|
|
71
|
+
<>
|
|
72
|
+
{/* Desktop: one row per device. */}
|
|
73
|
+
<table className="hidden w-full md:table">
|
|
74
|
+
<thead>
|
|
75
|
+
<tr className="text-left text-[10px] font-bold uppercase tracking-wider text-ink/40">
|
|
76
|
+
<th className="px-4 py-2 font-bold">Device</th>
|
|
77
|
+
<th className="px-2 py-2 font-bold">Platform</th>
|
|
78
|
+
<th className="px-2 py-2 font-bold">Route</th>
|
|
79
|
+
<th className="px-2 py-2 font-bold">RTT</th>
|
|
80
|
+
<th className="px-2 py-2 font-bold">Last seen</th>
|
|
81
|
+
<th className="px-4 py-2" />
|
|
82
|
+
</tr>
|
|
83
|
+
</thead>
|
|
84
|
+
<tbody>
|
|
85
|
+
{devices.map((device) => (
|
|
86
|
+
<tr key={device.id} className="border-t border-ink/5">
|
|
87
|
+
<td className="px-4 py-2 text-[12px] font-medium text-ink">{device.name}</td>
|
|
88
|
+
<td className="px-2 py-2 text-[11px] text-ink/70">{device.platform}</td>
|
|
89
|
+
<td className="px-2 py-2 text-[11px] text-ink/70">
|
|
90
|
+
{device.route ? ROUTE_LABEL[device.route] : '—'}
|
|
91
|
+
</td>
|
|
92
|
+
<td className="px-2 py-2 font-mono text-[11px] tabular-nums text-ink/70">
|
|
93
|
+
{device.rttMs === null ? '—' : `${device.rttMs} ms`}
|
|
94
|
+
</td>
|
|
95
|
+
<td className="px-2 py-2 text-[11px] text-ink/60">{relative(device.lastSeenAt)}</td>
|
|
96
|
+
<td className="px-4 py-2 text-right">
|
|
97
|
+
<button
|
|
98
|
+
type="button"
|
|
99
|
+
onClick={() => onRevoke(device.id)}
|
|
100
|
+
disabled={busy === `device:${device.id}`}
|
|
101
|
+
aria-label={`Revoke ${device.name}`}
|
|
102
|
+
className="rounded-md p-1 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink disabled:opacity-50"
|
|
103
|
+
>
|
|
104
|
+
<Trash2 size={13} />
|
|
105
|
+
</button>
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
))}
|
|
109
|
+
</tbody>
|
|
110
|
+
</table>
|
|
111
|
+
|
|
112
|
+
{/* Phone: the same facts, stacked. */}
|
|
113
|
+
<ul className="divide-y divide-ink/5 md:hidden">
|
|
114
|
+
{devices.map((device) => (
|
|
115
|
+
<li key={device.id} className="flex items-start justify-between gap-3 px-4 py-3">
|
|
116
|
+
<div className="min-w-0">
|
|
117
|
+
<div className="text-[12px] font-medium text-ink">{device.name}</div>
|
|
118
|
+
<div className="mt-0.5 text-[11px] text-ink/60">
|
|
119
|
+
{device.platform}
|
|
120
|
+
{device.route ? ` · ${ROUTE_LABEL[device.route]}` : ''}
|
|
121
|
+
{device.rttMs === null ? '' : ` · ${device.rttMs} ms`}
|
|
122
|
+
{` · ${relative(device.lastSeenAt)}`}
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
<button
|
|
126
|
+
type="button"
|
|
127
|
+
onClick={() => onRevoke(device.id)}
|
|
128
|
+
disabled={busy === `device:${device.id}`}
|
|
129
|
+
aria-label={`Revoke ${device.name}`}
|
|
130
|
+
className="flex-shrink-0 rounded-md p-1.5 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink disabled:opacity-50"
|
|
131
|
+
>
|
|
132
|
+
<Trash2 size={14} />
|
|
133
|
+
</button>
|
|
134
|
+
</li>
|
|
135
|
+
))}
|
|
136
|
+
</ul>
|
|
137
|
+
</>
|
|
138
|
+
)}
|
|
139
|
+
|
|
140
|
+
<p className="border-t border-ink/10 px-4 py-2.5 text-[11px] leading-relaxed text-ink/55">
|
|
141
|
+
Each device holds its own token. Revoking cuts it off immediately; pair it again with a new code.
|
|
142
|
+
</p>
|
|
143
|
+
</section>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The pairing dialog: one QR, its clock, and the routes it carries.
|
|
8
|
+
*
|
|
9
|
+
* PORTALED TO `<body>`, not positioned inside the settings panel. The panel is
|
|
10
|
+
* `overflow-hidden` and the composer card can become a containing block for
|
|
11
|
+
* `position: fixed` through `backdrop-filter`, a `transform` or `contain:
|
|
12
|
+
* layout` — either one clips or mis-sizes a nested overlay, and the dialog then
|
|
13
|
+
* opens in front of the wrong thing. `createPortal` is the rule the Goal dialog
|
|
14
|
+
* already follows for the same reason.
|
|
15
|
+
*
|
|
16
|
+
* The routes are listed because the code carries all of them: a phone that
|
|
17
|
+
* cannot reach the LAN address still pairs over Tailscale, and the user should
|
|
18
|
+
* be able to see that before scanning.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { useEffect } from 'preact/hooks';
|
|
22
|
+
import { createPortal } from 'preact/compat';
|
|
23
|
+
import { X } from 'lucide-preact';
|
|
24
|
+
import { QrCode } from '@/client/components/settings/categories/connect-settings/QrCode';
|
|
25
|
+
import type { PairingCode } from '@/client/hooks/connect/use-pairing';
|
|
26
|
+
|
|
27
|
+
const ROUTE_LABEL: Record<string, string> = {
|
|
28
|
+
tailscale: 'Tailscale',
|
|
29
|
+
lan: 'LAN',
|
|
30
|
+
cloudflare: 'Cloudflare',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export interface PairDialogProps {
|
|
34
|
+
code: PairingCode | null;
|
|
35
|
+
error: string | null;
|
|
36
|
+
busy: boolean;
|
|
37
|
+
secondsLeft: number;
|
|
38
|
+
onClose: () => void;
|
|
39
|
+
onRetry: () => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function clock(seconds: number): string {
|
|
43
|
+
const minutes = Math.floor(seconds / 60);
|
|
44
|
+
const rest = seconds % 60;
|
|
45
|
+
return `${minutes}:${String(rest).padStart(2, '0')}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function PairDialog({ code, error, busy, secondsLeft, onClose, onRetry }: PairDialogProps) {
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const onKey = (event: KeyboardEvent) => {
|
|
51
|
+
if (event.key === 'Escape') onClose();
|
|
52
|
+
};
|
|
53
|
+
window.addEventListener('keydown', onKey);
|
|
54
|
+
return () => window.removeEventListener('keydown', onKey);
|
|
55
|
+
}, [onClose]);
|
|
56
|
+
|
|
57
|
+
const expired = code !== null && secondsLeft === 0;
|
|
58
|
+
|
|
59
|
+
return createPortal(
|
|
60
|
+
<div
|
|
61
|
+
className="fixed inset-0 z-[60] flex items-center justify-center bg-ink/40 p-4 backdrop-blur-[2px]"
|
|
62
|
+
onClick={onClose}
|
|
63
|
+
>
|
|
64
|
+
<div
|
|
65
|
+
role="dialog"
|
|
66
|
+
aria-modal="true"
|
|
67
|
+
aria-label="Add a device"
|
|
68
|
+
className="w-full max-w-md rounded-2xl border border-ink/15 bg-paper p-5 shadow-2xl"
|
|
69
|
+
onClick={(event) => event.stopPropagation()}
|
|
70
|
+
>
|
|
71
|
+
<div className="mb-3 flex items-start justify-between gap-3">
|
|
72
|
+
<div>
|
|
73
|
+
<h3 className="text-sm font-semibold text-ink">Add a device</h3>
|
|
74
|
+
<p className="mt-0.5 text-[11px] text-ink/60">Scan with Kabmo on your phone.</p>
|
|
75
|
+
</div>
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
onClick={onClose}
|
|
79
|
+
aria-label="Close"
|
|
80
|
+
className="rounded-lg p-1 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink"
|
|
81
|
+
>
|
|
82
|
+
<X size={16} />
|
|
83
|
+
</button>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
{error && (
|
|
87
|
+
<p className="mb-3 rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2 text-[11px] leading-relaxed text-ink/70">
|
|
88
|
+
{error}
|
|
89
|
+
</p>
|
|
90
|
+
)}
|
|
91
|
+
|
|
92
|
+
{busy && !code && <p className="py-10 text-center text-[11px] text-ink/60">Creating a code…</p>}
|
|
93
|
+
|
|
94
|
+
{code && (
|
|
95
|
+
<>
|
|
96
|
+
<div className={`flex justify-center ${expired ? 'opacity-30' : ''}`}>
|
|
97
|
+
<QrCode matrix={code.qr} label="Pairing QR code" />
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<p className="mt-3 text-center text-[11px] text-ink/60">
|
|
101
|
+
{expired ? (
|
|
102
|
+
'This code has expired.'
|
|
103
|
+
) : (
|
|
104
|
+
<>
|
|
105
|
+
Expires in <span className="font-mono tabular-nums text-ink">{clock(secondsLeft)}</span> · works once
|
|
106
|
+
</>
|
|
107
|
+
)}
|
|
108
|
+
</p>
|
|
109
|
+
|
|
110
|
+
<div className="mt-4">
|
|
111
|
+
<div className="mb-1.5 text-[10px] font-bold uppercase tracking-wider text-ink/40">
|
|
112
|
+
Routes in this code
|
|
113
|
+
</div>
|
|
114
|
+
<ul className="space-y-1">
|
|
115
|
+
{code.candidates.map((candidate) => (
|
|
116
|
+
<li key={`${candidate.kind}:${candidate.url}`} className="flex items-baseline gap-2">
|
|
117
|
+
<span aria-hidden="true" className="mt-1.5 h-1.5 w-1.5 flex-shrink-0 rounded-full bg-ink" />
|
|
118
|
+
<span className="w-[74px] flex-shrink-0 text-[11px] font-semibold text-ink">
|
|
119
|
+
{ROUTE_LABEL[candidate.kind] ?? candidate.kind}
|
|
120
|
+
</span>
|
|
121
|
+
<span className="truncate font-mono text-[11px] text-ink/70">{candidate.url}</span>
|
|
122
|
+
</li>
|
|
123
|
+
))}
|
|
124
|
+
</ul>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div className="mt-4 flex items-center justify-between gap-2">
|
|
128
|
+
<button
|
|
129
|
+
type="button"
|
|
130
|
+
onClick={() => void navigator.clipboard?.writeText(code.webLink).catch(() => {})}
|
|
131
|
+
className="rounded-lg border border-ink/15 px-2.5 py-1.5 text-[11px] font-semibold text-ink transition-colors hover:bg-ink/5"
|
|
132
|
+
>
|
|
133
|
+
Copy link
|
|
134
|
+
</button>
|
|
135
|
+
<div className="flex items-center gap-2">
|
|
136
|
+
{expired && (
|
|
137
|
+
<button
|
|
138
|
+
type="button"
|
|
139
|
+
onClick={onRetry}
|
|
140
|
+
className="rounded-lg border border-ink/15 px-2.5 py-1.5 text-[11px] font-semibold text-ink transition-colors hover:bg-ink/5"
|
|
141
|
+
>
|
|
142
|
+
New code
|
|
143
|
+
</button>
|
|
144
|
+
)}
|
|
145
|
+
<button
|
|
146
|
+
type="button"
|
|
147
|
+
onClick={onClose}
|
|
148
|
+
className="rounded-lg bg-ink px-3 py-1.5 text-[11px] font-semibold text-paper transition-opacity hover:opacity-90"
|
|
149
|
+
>
|
|
150
|
+
Done
|
|
151
|
+
</button>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</>
|
|
155
|
+
)}
|
|
156
|
+
</div>
|
|
157
|
+
</div>,
|
|
158
|
+
document.body,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The pairing QR, drawn from the server's module matrix.
|
|
8
|
+
*
|
|
9
|
+
* A matrix rather than an SVG string from the server: the payload is a deep link
|
|
10
|
+
* carrying a one-time secret, and injecting server-built markup to render it is
|
|
11
|
+
* the shortcut that turns a QR renderer into an injection point. Here the only
|
|
12
|
+
* thing that reaches the DOM is a `<rect>` per dark module.
|
|
13
|
+
*
|
|
14
|
+
* The quiet zone is part of the drawing, not padding on the container: a scanner
|
|
15
|
+
* needs four modules of margin, and a CSS padding that a theme or a layout rule
|
|
16
|
+
* can shrink is a code that scans on one screen and not another.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import type { JSX } from 'preact';
|
|
20
|
+
import type { QrMatrix } from '@/shared/lib/connect/types';
|
|
21
|
+
|
|
22
|
+
const QUIET_ZONE = 4;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The widest the code is drawn, in CSS pixels.
|
|
26
|
+
*
|
|
27
|
+
* A screenshot of this dialog is what a camera-less device uploads, so the size
|
|
28
|
+
* is a functional choice, not a layout one: at 260 px a ~100-module code is under
|
|
29
|
+
* 3 px per module, and `jsQR` failed to read a real capture of it ("no QR code
|
|
30
|
+
* found") while the same code at 4 px per module decoded every time.
|
|
31
|
+
*/
|
|
32
|
+
const TARGET_EDGE = 340;
|
|
33
|
+
|
|
34
|
+
export function QrCode({ matrix, label }: { matrix: QrMatrix; label: string }) {
|
|
35
|
+
const span = matrix.size + QUIET_ZONE * 2;
|
|
36
|
+
// An INTEGER number of pixels per module. A fractional size makes the browser
|
|
37
|
+
// antialias every module edge, which is exactly what a binarizer cannot read —
|
|
38
|
+
// and it is why the same code scanned from a phone camera but not from a
|
|
39
|
+
// screenshot.
|
|
40
|
+
const modulePx = Math.max(3, Math.floor(TARGET_EDGE / span));
|
|
41
|
+
const edge = span * modulePx;
|
|
42
|
+
const rects: JSX.Element[] = [];
|
|
43
|
+
for (let row = 0; row < matrix.size; row += 1) {
|
|
44
|
+
const line = matrix.rows[row] ?? '';
|
|
45
|
+
for (let column = 0; column < matrix.size; column += 1) {
|
|
46
|
+
if (line[column] !== '1') continue;
|
|
47
|
+
rects.push(
|
|
48
|
+
<rect
|
|
49
|
+
key={`${row}:${column}`}
|
|
50
|
+
x={column + QUIET_ZONE}
|
|
51
|
+
y={row + QUIET_ZONE}
|
|
52
|
+
width={1}
|
|
53
|
+
height={1}
|
|
54
|
+
/>,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<svg
|
|
61
|
+
role="img"
|
|
62
|
+
aria-label={label}
|
|
63
|
+
viewBox={`0 0 ${span} ${span}`}
|
|
64
|
+
width={edge}
|
|
65
|
+
height={edge}
|
|
66
|
+
className="block h-auto max-w-full rounded-lg bg-white"
|
|
67
|
+
shape-rendering="crispEdges"
|
|
68
|
+
>
|
|
69
|
+
<rect x={0} y={0} width={span} height={span} fill="#ffffff" />
|
|
70
|
+
<g fill="#141310">{rects}</g>
|
|
71
|
+
</svg>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This server's identity and the addresses it answers on.
|
|
8
|
+
*
|
|
9
|
+
* The identity is shown because a device pins it: when a phone refuses a server
|
|
10
|
+
* that "looks right", the two ids are what the user compares. The addresses are
|
|
11
|
+
* shown with their reason when they do not work — a LAN row on a loopback-only
|
|
12
|
+
* listener says so, rather than looking like a broken network.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { Copy } from 'lucide-preact';
|
|
16
|
+
import type { ConnectAddress, ConnectStatus } from '@/shared/lib/connect/types';
|
|
17
|
+
|
|
18
|
+
const ROUTE_LABEL: Record<ConnectAddress['kind'], string> = {
|
|
19
|
+
tailscale: 'Tailscale',
|
|
20
|
+
lan: 'LAN',
|
|
21
|
+
cloudflare: 'Cloudflare',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function copy(value: string): void {
|
|
25
|
+
void navigator.clipboard?.writeText(value).catch(() => {
|
|
26
|
+
// A clipboard the page cannot reach is not worth a dialog: the address is
|
|
27
|
+
// on screen and selectable.
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function ServerCard({ status }: { status: ConnectStatus }) {
|
|
32
|
+
return (
|
|
33
|
+
<section className="rounded-xl border border-ink/10 bg-paper">
|
|
34
|
+
<header className="flex flex-wrap items-baseline justify-between gap-2 border-b border-ink/10 px-4 py-3">
|
|
35
|
+
<div className="min-w-0">
|
|
36
|
+
<h4 className="text-sm font-semibold text-ink">{status.label}</h4>
|
|
37
|
+
<p className="mt-0.5 text-[11px] text-ink/60">kabmo {status.version}</p>
|
|
38
|
+
</div>
|
|
39
|
+
<div className="text-right">
|
|
40
|
+
<div className="text-[10px] font-mono uppercase tracking-wider text-ink/40">server id</div>
|
|
41
|
+
<div className="font-mono text-[11px] text-ink/70" title={status.serverId}>
|
|
42
|
+
{status.serverId.slice(0, 6)}…{status.serverId.slice(-4)}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</header>
|
|
46
|
+
|
|
47
|
+
<div className="px-4 py-3">
|
|
48
|
+
<div className="mb-2 text-[10px] font-bold uppercase tracking-wider text-ink/40">Addresses</div>
|
|
49
|
+
{status.addresses.length === 0 ? (
|
|
50
|
+
<p className="text-[11px] text-ink/60">
|
|
51
|
+
No address yet. Turn on Tailscale Serve, or start this server with --lan.
|
|
52
|
+
</p>
|
|
53
|
+
) : (
|
|
54
|
+
<ul className="space-y-1.5">
|
|
55
|
+
{status.addresses.map((address) => {
|
|
56
|
+
const usable = address.unavailable === null && address.url !== '';
|
|
57
|
+
return (
|
|
58
|
+
<li key={`${address.kind}:${address.url}`} className="flex items-start gap-2">
|
|
59
|
+
<span
|
|
60
|
+
aria-hidden="true"
|
|
61
|
+
className={`mt-1.5 h-1.5 w-1.5 flex-shrink-0 rounded-full ${usable ? 'bg-ink' : 'bg-ink/25'}`}
|
|
62
|
+
/>
|
|
63
|
+
<div className="min-w-0 flex-1">
|
|
64
|
+
<div className="flex items-baseline gap-2">
|
|
65
|
+
<span className="w-[74px] flex-shrink-0 text-[11px] font-semibold text-ink">
|
|
66
|
+
{ROUTE_LABEL[address.kind]}
|
|
67
|
+
</span>
|
|
68
|
+
<span className={`truncate font-mono text-[11px] ${usable ? 'text-ink/80' : 'text-ink/40'}`}>
|
|
69
|
+
{usable ? address.url : '—'}
|
|
70
|
+
</span>
|
|
71
|
+
</div>
|
|
72
|
+
{address.unavailable && (
|
|
73
|
+
<p className="mt-0.5 pl-[82px] text-[11px] leading-relaxed text-ink/55">{address.unavailable}</p>
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
{usable && (
|
|
77
|
+
<button
|
|
78
|
+
type="button"
|
|
79
|
+
onClick={() => copy(address.url)}
|
|
80
|
+
aria-label={`Copy ${ROUTE_LABEL[address.kind]} address`}
|
|
81
|
+
className="flex-shrink-0 rounded-md p-1 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink"
|
|
82
|
+
>
|
|
83
|
+
<Copy size={13} />
|
|
84
|
+
</button>
|
|
85
|
+
)}
|
|
86
|
+
</li>
|
|
87
|
+
);
|
|
88
|
+
})}
|
|
89
|
+
</ul>
|
|
90
|
+
)}
|
|
91
|
+
</div>
|
|
92
|
+
</section>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One tunnel provider: its switch, its state, and the sentence that explains it.
|
|
8
|
+
*
|
|
9
|
+
* The switch is the only control that changes anything, and it is disabled while
|
|
10
|
+
* its own request is in flight — not while the other provider's is, because the
|
|
11
|
+
* two are independent and a page that freezes both makes a slow Tailscale call
|
|
12
|
+
* look like a broken Cloudflare row.
|
|
13
|
+
*
|
|
14
|
+
* The Cloudflare card states what it costs: TLS terminates at Cloudflare's edge,
|
|
15
|
+
* so their machines read the console's password and every prompt. That belongs
|
|
16
|
+
* on the card, not in a wiki, because it is the fact that decides whether the
|
|
17
|
+
* user turns it on.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { Copy, ExternalLink } from 'lucide-preact';
|
|
21
|
+
import type { TunnelState } from '@/shared/lib/connect/types';
|
|
22
|
+
|
|
23
|
+
const PROVIDER_COPY: Record<TunnelState['provider'], { title: string; blurb: string }> = {
|
|
24
|
+
tailscale: {
|
|
25
|
+
title: 'Tailscale',
|
|
26
|
+
blurb: 'Serve to your tailnet only. TLS ends on this machine, so Tailscale never sees the traffic.',
|
|
27
|
+
},
|
|
28
|
+
cloudflare: {
|
|
29
|
+
title: 'Cloudflare',
|
|
30
|
+
blurb: 'A public URL. Cloudflare terminates TLS and can read every request, including your password.',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const PHASE_LABEL: Record<TunnelState['phase'], string> = {
|
|
35
|
+
off: 'off',
|
|
36
|
+
starting: 'starting…',
|
|
37
|
+
up: 'connected',
|
|
38
|
+
degraded: 'degraded',
|
|
39
|
+
failed: 'unavailable',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export interface TunnelRowProps {
|
|
43
|
+
tunnel: TunnelState;
|
|
44
|
+
busy: boolean;
|
|
45
|
+
onToggle: (next: 'start' | 'stop') => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function TunnelRow({ tunnel, busy, onToggle }: TunnelRowProps) {
|
|
49
|
+
const copy = PROVIDER_COPY[tunnel.provider];
|
|
50
|
+
const on = tunnel.phase === 'up' || tunnel.phase === 'degraded';
|
|
51
|
+
const canToggle = tunnel.phase !== 'failed';
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="px-4 py-3">
|
|
55
|
+
<div className="flex items-start justify-between gap-3">
|
|
56
|
+
<div className="min-w-0">
|
|
57
|
+
<div className="flex items-center gap-2">
|
|
58
|
+
<h5 className="text-sm font-semibold text-ink">{copy.title}</h5>
|
|
59
|
+
<span className="flex items-center gap-1 text-[11px] text-ink/60">
|
|
60
|
+
<span
|
|
61
|
+
aria-hidden="true"
|
|
62
|
+
className={`h-1.5 w-1.5 rounded-full ${on ? 'bg-ink' : 'bg-ink/25'}`}
|
|
63
|
+
/>
|
|
64
|
+
{PHASE_LABEL[tunnel.phase]}
|
|
65
|
+
</span>
|
|
66
|
+
</div>
|
|
67
|
+
<p className="mt-1 max-w-[52ch] text-[11px] leading-relaxed text-ink/60">{copy.blurb}</p>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
role="switch"
|
|
73
|
+
aria-checked={on}
|
|
74
|
+
aria-label={`${on ? 'Stop' : 'Start'} ${copy.title}`}
|
|
75
|
+
disabled={busy || !canToggle}
|
|
76
|
+
onClick={() => onToggle(on ? 'stop' : 'start')}
|
|
77
|
+
className={`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${
|
|
78
|
+
on ? 'bg-ink' : 'bg-ink/20'
|
|
79
|
+
}`}
|
|
80
|
+
>
|
|
81
|
+
<span
|
|
82
|
+
aria-hidden="true"
|
|
83
|
+
className={`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-paper shadow ring-0 transition duration-200 ease-in-out ${
|
|
84
|
+
on ? 'translate-x-5' : 'translate-x-0'
|
|
85
|
+
}`}
|
|
86
|
+
/>
|
|
87
|
+
</button>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
{tunnel.url && (
|
|
91
|
+
<div className="mt-2 flex items-center gap-1.5">
|
|
92
|
+
<a
|
|
93
|
+
href={tunnel.url}
|
|
94
|
+
target="_blank"
|
|
95
|
+
rel="noreferrer"
|
|
96
|
+
className="truncate font-mono text-[11px] text-ink/80 underline decoration-ink/20 underline-offset-2 hover:decoration-ink/60"
|
|
97
|
+
>
|
|
98
|
+
{tunnel.url}
|
|
99
|
+
</a>
|
|
100
|
+
<button
|
|
101
|
+
type="button"
|
|
102
|
+
onClick={() => void navigator.clipboard?.writeText(tunnel.url ?? '').catch(() => {})}
|
|
103
|
+
aria-label={`Copy ${copy.title} address`}
|
|
104
|
+
className="flex-shrink-0 rounded-md p-1 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink"
|
|
105
|
+
>
|
|
106
|
+
<Copy size={12} />
|
|
107
|
+
</button>
|
|
108
|
+
<a
|
|
109
|
+
href={tunnel.url}
|
|
110
|
+
target="_blank"
|
|
111
|
+
rel="noreferrer"
|
|
112
|
+
aria-label={`Open ${copy.title} address`}
|
|
113
|
+
className="flex-shrink-0 rounded-md p-1 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink"
|
|
114
|
+
>
|
|
115
|
+
<ExternalLink size={12} />
|
|
116
|
+
</a>
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
|
|
120
|
+
{tunnel.reason && (
|
|
121
|
+
<p className="mt-2 rounded-md border border-ink/10 bg-ink/[0.03] px-2.5 py-1.5 text-[11px] leading-relaxed text-ink/65">
|
|
122
|
+
{tunnel.reason}
|
|
123
|
+
</p>
|
|
124
|
+
)}
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
}
|