@kabmo-labs/kabmo 0.39.1 → 0.41.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 +364 -363
- package/dist/client/static/js/{CsvGrid-7synegzg.js → CsvGrid-60njj97j.js} +2 -2
- package/dist/client/static/js/{DocxView-v5d9n5yw.js → DocxView-rsv0j46a.js} +5 -5
- package/dist/client/static/js/{DrawioView-ww7y98tt.js → DrawioView-n2g5df3a.js} +2 -2
- package/dist/client/static/js/ImageView-t330jx6y.js +1 -0
- package/dist/client/static/js/LayoutWrapper-qp6nsw65.js +2 -0
- package/dist/client/static/js/{Modal-qj39shgb.js → Modal-sbya4ahp.js} +17 -17
- package/dist/client/static/js/{PdfView-t9v4datp.js → PdfView-1r7a0qkp.js} +1 -1
- package/dist/client/static/js/SessionsView-yqs5m8tj.js +1 -0
- package/dist/client/static/js/{SheetView-6zkxbjd4.js → SheetView-bt5pp042.js} +24 -24
- package/dist/client/static/js/{SvgPreview-7rt2p1y1.js → SvgPreview-vfmqgmrx.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-888zn5zg.js → abnfDiagram-O67JEVCF-8k5hk1yx.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-1wqga929.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-b04e26rb.js → architectureDiagram-NJMV4G6O-7jcb7fgy.js} +3 -3
- package/dist/client/static/js/{astro-4ybhkc9b.js → astro-0rh34hha.js} +1 -1
- package/dist/client/static/js/bash-vv2ysp0a.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-32ph2m52.js → blockDiagram-BEXU5L5S-04sbtdth.js} +5 -5
- package/dist/client/static/js/c-67jyc7sg.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-hwnaa333.js → c4Diagram-YGBWAQC7-vwac9za0.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-2kg7dqeb.js → classDiagram-v2-NBCMYWYE-18cc0bsb.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-tj2sbtyv.js → cose-bilkent-JH36ORCC-dk683zvp.js} +1 -1
- package/dist/client/static/js/cpp-crfbnwv8.js +1 -0
- package/dist/client/static/js/css-2re5mbea.js +1 -0
- package/dist/client/static/js/css-983fbv00.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-j2dpdgkh.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-wx2y8dhm.js → cynefinDiagram-VND7K2PF-m2sx8d8s.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-5v3rzdxd.js → dagre-6A5THRUB-qf3pr59p.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-7er2jwy1.js → diagram-22UHCM2B-twnz23mt.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-2b7nmdha.js → diagram-3UASUU5V-417bas6t.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-yf61ftn0.js → diagram-ATOU4E4O-n63cpdnx.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-cn3rs9xn.js → diagram-CDSNMT55-v86p14dd.js} +3 -3
- package/dist/client/static/js/{diagram-MLGK6HIB-7kvtsj6c.js → diagram-MLGK6HIB-7a0h1hs3.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-g3zg3r5e.js → diagram-MPIPVDR6-w75bftmd.js} +2 -2
- package/dist/client/static/js/{dockerfile-f9j396wm.js → dockerfile-g5qbaeq3.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-ft02nzne.js → ebnfDiagram-ZINNZB2B-vdzm3tsv.js} +1 -1
- package/dist/client/static/js/{elixir-v9bbxsgg.js → elixir-gpez1k9m.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-87fvkn2k.js → elk-276RUBZZ-2fsbb484.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-gh9mp6j8.js → erDiagram-OPXOYQCR-vnkztq7d.js} +5 -5
- package/dist/client/static/js/{erlang-55r0skxa.js → erlang-jqqa3ehb.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-xjvjawd3.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-j21f2bfg.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-227xs61z.js → ganttDiagram-FUAMR5RP-pbvcch52.js} +2 -2
- package/dist/client/static/js/{ghostty-web-2gt2tp72.js → ghostty-web-22pdvhta.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-r0zbk95f.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-4671gdym.js → gitGraphDiagram-X574FWY7-dkvktvzr.js} +2 -2
- package/dist/client/static/js/graphql-npbd9fdx.js +1 -0
- package/dist/client/static/js/html-1cpe2xc8.js +1 -0
- package/dist/client/static/js/{index-enmh3w27.js → index-0c6vpk89.js} +2 -2
- package/dist/client/static/js/{index-35mh9kbs.js → index-0xaz2eyv.js} +3 -3
- package/dist/client/static/js/{index-668chrpq.js → index-1sw00wm0.js} +1 -1
- package/dist/client/static/js/index-2z9wrb46.js +2 -0
- package/dist/client/static/js/{index-qbnd827h.js → index-3rymer2w.js} +1 -1
- package/dist/client/static/js/{index-f1nqk6z6.js → index-4jk8ngjg.js} +2 -2
- package/dist/client/static/js/index-55hq7tnj.js +1 -0
- package/dist/client/static/js/{index-8egjccbq.js → index-6fx2t6y7.js} +52 -52
- package/dist/client/static/js/{index-8xasfxf3.js → index-7fwppdkn.js} +1 -1
- package/dist/client/static/js/{index-28a5kf88.js → index-7w3gqw2b.js} +1 -1
- package/dist/client/static/js/{index-c1be3rva.js → index-9dnkfpx4.js} +2 -2
- package/dist/client/static/js/{index-s80x8d58.js → index-9fnzcg2x.js} +2 -2
- package/dist/client/static/js/{index-h8rr48px.js → index-a4ed3mks.js} +4 -4
- package/dist/client/static/js/{index-j2g39xq7.js → index-ae91g8ka.js} +5 -5
- package/dist/client/static/js/{index-xrp2zv8z.js → index-agdbjh5k.js} +2 -2
- package/dist/client/static/js/{index-2rs03vfy.js → index-ajjq0b8y.js} +2 -2
- package/dist/client/static/js/{index-xfr6r539.js → index-amawahyh.js} +2 -2
- package/dist/client/static/js/{index-y5ymgp20.js → index-b6cyn4hr.js} +50 -50
- package/dist/client/static/js/index-c6kx7s6a.js +2 -0
- package/dist/client/static/js/{index-k7sdsmgv.js → index-ce4vytm6.js} +2 -2
- package/dist/client/static/js/{index-b08hx4tw.js → index-cytks03p.js} +2 -2
- package/dist/client/static/js/{index-cfnxda13.js → index-djv15k5s.js} +2 -2
- package/dist/client/static/js/{index-kkfbd1db.js → index-ds6a2cx7.js} +5 -5
- package/dist/client/static/js/{index-tmnnafht.js → index-e6qjfcz9.js} +1 -1
- package/dist/client/static/js/{index-442mbhwb.js → index-e7yf273s.js} +2 -2
- package/dist/client/static/js/{index-f73v86a3.js → index-efn233xp.js} +4 -4
- package/dist/client/static/js/index-esx3zwnt.js +1 -0
- package/dist/client/static/js/{index-d3prrt2q.js → index-f8pq132s.js} +1 -1
- package/dist/client/static/js/index-fbbp5cwj.js +2 -0
- package/dist/client/static/js/{index-drjtwfp5.js → index-fg965t62.js} +2 -2
- package/dist/client/static/js/{index-xnk1500f.js → index-g1cggqgx.js} +12 -12
- package/dist/client/static/js/index-ghsdzs4m.js +1 -0
- package/dist/client/static/js/{index-4wvtar0v.js → index-gn92c6hp.js} +2 -2
- package/dist/client/static/js/{index-4c2zcvem.js → index-gs7ytgdw.js} +180 -180
- package/dist/client/static/js/{index-q0bph5x0.js → index-haaz8t7e.js} +2 -2
- package/dist/client/static/js/{index-t6gznaxm.js → index-hz177dr2.js} +2 -2
- package/dist/client/static/js/{index-7qc2avfy.js → index-j5ram1ve.js} +2 -2
- package/dist/client/static/js/{index-cst843zs.css → index-jqs23cc7.css} +1 -1
- package/dist/client/static/js/{index-y91j4t1q.js → index-ne131hmw.js} +2 -2
- package/dist/client/static/js/{index-1sgad84m.js → index-ngk9h0v9.js} +2 -2
- package/dist/client/static/js/{index-4wtr5wjp.js → index-ntcqyqd5.js} +2 -2
- package/dist/client/static/js/{index-m847wafq.js → index-pbsm2vw7.js} +2 -2
- package/dist/client/static/js/{index-vb3srfyc.js → index-pfbyfab5.js} +2 -2
- package/dist/client/static/js/{index-qsrw5c67.js → index-pn91shfp.js} +2 -2
- package/dist/client/static/js/{index-6rs8e8ng.js → index-qjsy6p86.js} +1 -1
- package/dist/client/static/js/{index-fjnkzk12.js → index-qsw5edtk.js} +5 -5
- package/dist/client/static/js/{index-72289dgx.js → index-rc8wrs2a.js} +2 -2
- package/dist/client/static/js/{index-w0rbyw47.js → index-rdqn92tc.js} +2 -2
- package/dist/client/static/js/{index-phm1zb8m.js → index-re1xz433.js} +1 -1
- package/dist/client/static/js/{index-mtadrbxt.js → index-rebnv57p.js} +2 -2
- package/dist/client/static/js/{index-9d6x1f3t.js → index-s78n0dtv.js} +2 -2
- package/dist/client/static/js/{index-c36pag9y.js → index-sj4y8kj2.js} +2 -2
- package/dist/client/static/js/{index-87qandgr.js → index-tgper3yy.js} +2 -2
- package/dist/client/static/js/index-x2kb1kx5.js +3 -0
- package/dist/client/static/js/{index-0j518hqm.js → index-xf36nmbm.js} +2 -2
- package/dist/client/static/js/{index-hdd8nqz8.js → index-xfa5hswh.js} +1 -1
- package/dist/client/static/js/{index-9gepbvdt.js → index-yq9vnd1y.js} +2 -2
- package/dist/client/static/js/{index-y3qxrs90.js → index-yzg9mbsv.js} +2 -2
- package/dist/client/static/js/{index-wgvysmnr.js → index-zfykeg7x.js} +10 -10
- package/dist/client/static/js/{index-rj81xrvw.js → index-zye9309h.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-a8xap43w.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-k1jnhhbp.js → infoDiagram-VRGFBTTK-mh6yks62.js} +1 -1
- package/dist/client/static/js/ini-df5bw23e.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ar94x2gr.js → ishikawaDiagram-OU5B5YK6-hnfqppnv.js} +2 -2
- package/dist/client/static/js/java-8j33rj1p.js +1 -0
- package/dist/client/static/js/javascript-zegm06a1.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-ntfp0w54.js → journeyDiagram-ZHPQQLJL-s4nv1f3q.js} +3 -3
- package/dist/client/static/js/json-g5ggnd94.js +1 -0
- package/dist/client/static/js/jsx-f6p72qpc.js +1 -0
- package/dist/client/static/js/{julia-jhe2vd4f.js → julia-yre4bxb9.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-q5rsr6j3.js → kanban-definition-PNTS6WVX-t8kbfefp.js} +8 -8
- package/dist/client/static/js/lua-bahx6qze.js +1 -0
- package/dist/client/static/js/markdown-9dhg1fax.js +1 -0
- package/dist/client/static/js/{mermaid.core-0gafsqrm.js → mermaid.core-0784021p.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-jgz6nyhk.js → mindmap-definition-NLK3R4M7-swkkze8c.js} +8 -8
- package/dist/client/static/js/one-dark-pro-h5tmw145.js +1 -0
- package/dist/client/static/js/one-light-x7vj1pxr.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-b5bvg6v1.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-b3e9ma2c.js → pegDiagram-GJSIUBJH-jqayzh7z.js} +1 -1
- package/dist/client/static/js/{perl-qhj6tk7k.js → perl-weeskn1v.js} +1 -1
- package/dist/client/static/js/{php-arycc4w7.js → php-vf3045p9.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-77ee73zg.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-66mn2qnt.js → pieDiagram-5QR66LMP-w03a65ky.js} +2 -2
- package/dist/client/static/js/properties-49mfnee4.js +1 -0
- package/dist/client/static/js/python-qb69wp1s.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-n7warg0e.js → quadrantDiagram-O4NWA36T-2j7sfa9s.js} +3 -3
- package/dist/client/static/js/r-s3mf2tch.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-cp79xtvb.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-dcpgqhcb.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-qasqv686.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-e46908rd.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-7009t6bk.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-k8j43rxj.js → railroadDiagram-XR7U4H2S-jtkkgy34.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-ef2v7nyq.js → requirementDiagram-PLB6GJNP-t85ckjdb.js} +3 -3
- package/dist/client/static/js/{ruby-fb6zzevm.js → ruby-1a2ryzy6.js} +1 -1
- package/dist/client/static/js/{rust-jvkbr060.js → rust-736r0f0v.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-3njbd1yd.js → sankeyDiagram-IPEJSGJF-5pfkw8ne.js} +3 -3
- package/dist/client/static/js/{sass-fzs6a0kr.js → sass-tq4vw7hd.js} +1 -1
- package/dist/client/static/js/{scss-gdb52d0c.js → scss-x7ddw6gb.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-k2wqc0qt.js → sequenceDiagram-PO4LG4MO-55vs9zv5.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-cpnd12ee.js → sizeCapture-INFHLROL-pzqqd7f4.js} +1 -1
- package/dist/client/static/js/sql-aczp05f2.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-1ydpxaeg.js → stateDiagram-v2-GCMORJYK-6nhrph8n.js} +3 -3
- package/dist/client/static/js/{svelte-8s3k6qjd.js → svelte-0hv6pak2.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-4md43da2.js → swimlanes-2SLR337P-6tcnxfbv.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-7xrkrkpa.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-sp32bf3e.js → timeline-definition-EJHVYXUP-1dz46nt5.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-tpn62q8j.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-w910f1g4.js +1 -0
- package/dist/client/static/js/tsx-s1shkfg9.js +1 -0
- package/dist/client/static/js/typescript-htx9v6bf.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-p2ssettn.js → usecaseDiagram-POWQR4AR-b3jfveq6.js} +28 -28
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-ejqq8b82.js → vennDiagram-UO4OBE2U-dnc3jqvp.js} +3 -3
- package/dist/client/static/js/{vue-k3f3chre.js → vue-zccj3qa5.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-pt9tq808.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-tkk79rsn.js → wardleyDiagram-VNRHLVJA-466m8400.js} +3 -3
- package/dist/client/static/js/xml-wr1dxav5.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-zhgrsqpb.js → xychartDiagram-PMCCYNJV-kryrpqp1.js} +3 -3
- package/dist/client/static/js/yaml-0y9fdskg.js +1 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/panel/Custom.test.tsx +1 -0
- package/marketplace/plugins/command-runner/src/panel/Groups.test.tsx +10 -0
- package/marketplace/plugins/command-runner/src/panel/Groups.tsx +24 -3
- package/marketplace/plugins/command-runner/src/panel/index.tsx +1 -0
- package/marketplace/plugins/command-runner/src/protocol.ts +10 -0
- package/marketplace/plugins/command-runner/src/server/discovery.test.ts +30 -0
- package/marketplace/plugins/command-runner/src/server/scan.ts +16 -3
- package/package.json +1 -1
- package/src/client/components/common/header-controls/MoreMenu.tsx +24 -14
- package/src/client/components/common/header-controls/index.test.tsx +22 -0
- package/src/client/components/common/header-controls/index.tsx +8 -2
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +7 -0
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +2 -1
- package/src/client/components/layout/session-sidebar/about-modal/index.test.tsx +1 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +19 -2
- package/src/client/components/mobile/RightSidebar.tsx +49 -1
- package/src/client/components/mobile/SessionSidebar.tsx +29 -1
- package/src/client/components/mobile/header-titlebar.test.tsx +17 -0
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +43 -0
- package/src/client/components/mobile/mobile-main-view/Header.tsx +30 -0
- package/src/client/components/mobile/mobile-session-sidebar/Dock.tsx +5 -1
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +12 -1
- package/src/client/components/mobile/panel-chips.test.tsx +13 -0
- package/src/client/components/mobile/panel-chips.tsx +9 -2
- package/src/client/components/settings/categories/connect-settings/DeviceTable.test.tsx +92 -0
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +22 -3
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +19 -19
- package/src/client/components/workspace/git-panel/commit-modal/Header.test.tsx +21 -0
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +13 -9
- package/src/client/components/workspace/terminal-panel/focus-target.test.ts +121 -0
- package/src/client/components/workspace/terminal-panel/focus-target.ts +54 -0
- package/src/client/components/workspace/terminal-panel/index.tsx +7 -1
- package/src/client/components/workspace/terminal-panel/instance.ts +82 -0
- package/src/client/components/workspace/terminal-panel/mount.ts +22 -63
- package/src/client/components/workspace/terminal-panel/soft-keyboard.ts +29 -0
- package/src/client/hooks/commands/use-command-runtime.ts +15 -0
- package/src/client/hooks/ui/touch-device.ts +8 -3
- package/src/client/hooks/ui/updates/check-request.ts +41 -0
- package/src/client/hooks/ui/updates/index.ts +13 -5
- package/src/client/hooks/ui/visibility-menu-trigger.test.ts +155 -0
- package/src/client/hooks/ui/visibility-menu-trigger.ts +85 -0
- package/src/client/hooks/workspace/panel-visibility-menu.ts +50 -0
- package/src/client/lib/native/run-command.test.ts +95 -0
- package/src/client/lib/native/run-command.ts +52 -0
- package/src/client/lib/router/open-session.test.ts +26 -1
- package/src/client/lib/router/open-session.ts +21 -0
- package/src/client/lib/ui/soft-keyboard.test.ts +103 -0
- package/src/client/lib/ui/soft-keyboard.ts +90 -0
- package/src/client/main.tsx +9 -0
- package/src/server/lib/auth/guard.ts +8 -2
- package/src/server/lib/changes/capture-shell.test.ts +253 -0
- package/src/server/lib/changes/capture-targets.test.ts +83 -0
- package/src/server/lib/changes/capture-targets.ts +51 -0
- package/src/server/lib/changes/capture-write.server.ts +2 -2
- package/src/server/lib/changes/capture.server.ts +14 -29
- package/src/server/lib/changes/capture.test.ts +69 -149
- package/src/server/lib/changes/patch-paths.ts +37 -0
- package/src/server/lib/connect/devices.server.test.ts +70 -0
- package/src/server/lib/connect/devices.server.ts +43 -1
- package/src/server/lib/connect/last-connect.gate.test.ts +52 -0
- package/src/server/routes/connect/devices.ts +5 -4
- package/src/shared/lib/commands/catalog.test.ts +36 -0
- package/src/shared/lib/commands/catalog.ts +16 -0
- package/src/shared/lib/connect/types.ts +1 -0
- package/src/shared/lib/updates/popup-state.ts +11 -0
- package/dist/client/static/js/ImageView-t3rkypzs.js +0 -1
- package/dist/client/static/js/LayoutWrapper-th2pd4yt.js +0 -2
- package/dist/client/static/js/SessionsView-yqy0a1xg.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-y0zb4vqa.js +0 -1
- package/dist/client/static/js/bash-k6p3y3pr.js +0 -1
- package/dist/client/static/js/c-ve09y19q.js +0 -1
- package/dist/client/static/js/cpp-vhqp7bcy.js +0 -1
- package/dist/client/static/js/css-77mvf0ca.js +0 -1
- package/dist/client/static/js/css-tys2rrny.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-nt1ed192.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-v4edaxx7.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-6gc6gd1d.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-adzhec96.js +0 -1
- package/dist/client/static/js/graphql-g97hycb3.js +0 -1
- package/dist/client/static/js/html-2syect3n.js +0 -1
- package/dist/client/static/js/index-1jeyjqkh.js +0 -2
- package/dist/client/static/js/index-4ry8kz8h.js +0 -3
- package/dist/client/static/js/index-fjqp03xe.js +0 -2
- package/dist/client/static/js/index-fs3pbqwn.js +0 -1
- package/dist/client/static/js/index-jze0zg3z.js +0 -2
- package/dist/client/static/js/index-w0xvdda9.js +0 -1
- package/dist/client/static/js/index-wfcgqjzr.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-2ye26vqn.js +0 -1
- package/dist/client/static/js/ini-7ffv28px.js +0 -1
- package/dist/client/static/js/java-4x5yky4a.js +0 -1
- package/dist/client/static/js/javascript-4kw2j9t3.js +0 -1
- package/dist/client/static/js/json-h3kwpty2.js +0 -1
- package/dist/client/static/js/jsx-jk20f0dr.js +0 -1
- package/dist/client/static/js/lua-k02dpxq8.js +0 -1
- package/dist/client/static/js/markdown-fhhg7ms6.js +0 -1
- package/dist/client/static/js/one-dark-pro-n0as47q7.js +0 -1
- package/dist/client/static/js/one-light-05nw3mzj.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-b0j3te0q.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-28qq62fn.js +0 -1
- package/dist/client/static/js/properties-qhvcxc13.js +0 -1
- package/dist/client/static/js/python-3qsrs510.js +0 -1
- package/dist/client/static/js/r-z2ng7mza.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-fyrcbpyd.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-9s62qncd.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-f7yjmhrk.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-sfrw8gkz.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-4mm4cern.js +0 -1
- package/dist/client/static/js/sql-ypk53ntb.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-d48g5gjf.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-a5vgg4gz.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-ctqhajgg.js +0 -1
- package/dist/client/static/js/tsx-zy7hb2hw.js +0 -1
- package/dist/client/static/js/typescript-2hr53c8j.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-ns7e0fqf.js +0 -1
- package/dist/client/static/js/xml-p4742r9b.js +0 -1
- package/dist/client/static/js/yaml-qbckg671.js +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The soft-keyboard bridge: one focusable element, focused inside the tap.
|
|
8
|
+
*
|
|
9
|
+
* The bug this pins is a phone one: the terminal's focus request lands after the
|
|
10
|
+
* renderer's async mount, which is after the tap that opened the panel, and a
|
|
11
|
+
* phone opens its keyboard only while a gesture is active. The bridge is the
|
|
12
|
+
* element that carries the gesture across that gap, so the assertions are about
|
|
13
|
+
* the three ways it can fail: it is not focusable (a hidden element), it piles
|
|
14
|
+
* up one element per tap, or it steals focus back from the terminal.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
|
|
18
|
+
import { Window } from 'happy-dom';
|
|
19
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
20
|
+
import {
|
|
21
|
+
openSoftKeyboard,
|
|
22
|
+
releaseSoftKeyboard,
|
|
23
|
+
SOFT_KEYBOARD_BRIDGE_ATTR,
|
|
24
|
+
} from '@/client/lib/ui/soft-keyboard';
|
|
25
|
+
|
|
26
|
+
let win: Window;
|
|
27
|
+
|
|
28
|
+
function setSoftKeyboardDevice(value: boolean): void {
|
|
29
|
+
win.matchMedia = ((query: string) => ({
|
|
30
|
+
matches: value && query === '(pointer: coarse)',
|
|
31
|
+
media: query,
|
|
32
|
+
onchange: null,
|
|
33
|
+
addListener() {},
|
|
34
|
+
removeListener() {},
|
|
35
|
+
addEventListener() {},
|
|
36
|
+
removeEventListener() {},
|
|
37
|
+
dispatchEvent: () => false,
|
|
38
|
+
})) as unknown as typeof win.matchMedia;
|
|
39
|
+
Object.defineProperty(win.navigator, 'maxTouchPoints', { value: 0, configurable: true });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function bridge(): HTMLTextAreaElement | null {
|
|
43
|
+
return document.querySelector<HTMLTextAreaElement>(`[${SOFT_KEYBOARD_BRIDGE_ATTR}]`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
beforeAll(() => {
|
|
47
|
+
win = new Window({ url: 'http://localhost' });
|
|
48
|
+
installDomGlobals(win);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
afterEach(() => {
|
|
52
|
+
releaseSoftKeyboard();
|
|
53
|
+
document.body.innerHTML = '';
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
afterAll(() => {
|
|
57
|
+
restoreDomGlobals();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('soft keyboard bridge', () => {
|
|
61
|
+
test('focuses a real, offscreen textarea on a soft-keyboard device', () => {
|
|
62
|
+
setSoftKeyboardDevice(true);
|
|
63
|
+
openSoftKeyboard();
|
|
64
|
+
|
|
65
|
+
const element = bridge();
|
|
66
|
+
expect(element).not.toBeNull();
|
|
67
|
+
expect(document.activeElement).toBe(element);
|
|
68
|
+
// `display:none`/`visibility:hidden` cannot take focus, and a font below
|
|
69
|
+
// 16px makes iOS zoom the page when the keyboard opens.
|
|
70
|
+
expect(element!.style.display).not.toBe('none');
|
|
71
|
+
expect(element!.style.visibility).not.toBe('hidden');
|
|
72
|
+
expect(element!.style.fontSize).toBe('16px');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('reuses one bridge across taps', () => {
|
|
76
|
+
setSoftKeyboardDevice(true);
|
|
77
|
+
openSoftKeyboard();
|
|
78
|
+
openSoftKeyboard();
|
|
79
|
+
expect(document.querySelectorAll(`[${SOFT_KEYBOARD_BRIDGE_ATTR}]`).length).toBe(1);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
test('release blurs the bridge but never steals focus from the terminal', () => {
|
|
83
|
+
setSoftKeyboardDevice(true);
|
|
84
|
+
openSoftKeyboard();
|
|
85
|
+
releaseSoftKeyboard();
|
|
86
|
+
expect(document.activeElement).not.toBe(bridge());
|
|
87
|
+
|
|
88
|
+
const terminal = document.createElement('div');
|
|
89
|
+
terminal.tabIndex = 0;
|
|
90
|
+
document.body.appendChild(terminal);
|
|
91
|
+
terminal.focus();
|
|
92
|
+
releaseSoftKeyboard();
|
|
93
|
+
expect(document.activeElement).toBe(terminal);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test('does nothing on a device with a hardware keyboard', () => {
|
|
97
|
+
setSoftKeyboardDevice(false);
|
|
98
|
+
const before = document.activeElement;
|
|
99
|
+
openSoftKeyboard();
|
|
100
|
+
expect(bridge()).toBeNull();
|
|
101
|
+
expect(document.activeElement).toBe(before);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Summon the soft keyboard from inside a tap.
|
|
8
|
+
*
|
|
9
|
+
* A phone opens its keyboard only while a user gesture is active. The terminal
|
|
10
|
+
* panel asks for focus the moment it becomes visible, but the element that takes
|
|
11
|
+
* focus is created by `mountTerminal`, whose ghostty-web import and font wait
|
|
12
|
+
* resolve long after the tap that opened the panel has ended — so the focus
|
|
13
|
+
* landed, the keyboard did not, and the first command needed a tap on the canvas
|
|
14
|
+
* first.
|
|
15
|
+
*
|
|
16
|
+
* `openSoftKeyboard()` focuses a 1px offscreen textarea synchronously in that
|
|
17
|
+
* tap. When the terminal mounts it takes focus from the bridge, and the keyboard
|
|
18
|
+
* stays up because focus moved between two editable elements. The bridge is not
|
|
19
|
+
* an input: it is cleared on every arm, and the terminal's own textarea is the
|
|
20
|
+
* surface that receives the keystrokes.
|
|
21
|
+
*
|
|
22
|
+
* The element is deliberately NOT `display:none`/`visibility:hidden` — a hidden
|
|
23
|
+
* element cannot take focus — and its font size is 16px, the size below which
|
|
24
|
+
* iOS zooms the page on focus.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { isSoftKeyboardDevice } from '@/client/hooks/ui/touch-device';
|
|
28
|
+
|
|
29
|
+
/** Marks the bridge for the tests; it is not a product hook. */
|
|
30
|
+
export const SOFT_KEYBOARD_BRIDGE_ATTR = 'data-soft-keyboard-bridge';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* How long the bridge may hold the keyboard with no terminal to hand it to.
|
|
34
|
+
*
|
|
35
|
+
* The terminal's mount is bounded by the font wait (2s) plus the import, so a
|
|
36
|
+
* bridge that is still focused after this long belongs to a panel that never
|
|
37
|
+
* opened (no workspace, a disabled view) and must not leave the keyboard up.
|
|
38
|
+
*/
|
|
39
|
+
const RELEASE_AFTER_MS = 8000;
|
|
40
|
+
|
|
41
|
+
let bridge: HTMLTextAreaElement | null = null;
|
|
42
|
+
let releaseTimer: ReturnType<typeof setTimeout> | undefined;
|
|
43
|
+
|
|
44
|
+
function createBridge(): HTMLTextAreaElement {
|
|
45
|
+
const element = document.createElement('textarea');
|
|
46
|
+
element.tabIndex = -1;
|
|
47
|
+
element.autocomplete = 'off';
|
|
48
|
+
element.setAttribute('autocorrect', 'off');
|
|
49
|
+
element.setAttribute('autocapitalize', 'off');
|
|
50
|
+
element.setAttribute('spellcheck', 'false');
|
|
51
|
+
element.setAttribute('aria-label', 'Terminal keyboard');
|
|
52
|
+
element.setAttribute(SOFT_KEYBOARD_BRIDGE_ATTR, '');
|
|
53
|
+
element.style.cssText = [
|
|
54
|
+
'position:fixed',
|
|
55
|
+
'top:0',
|
|
56
|
+
'left:0',
|
|
57
|
+
'width:1px',
|
|
58
|
+
'height:1px',
|
|
59
|
+
'padding:0',
|
|
60
|
+
'border:0',
|
|
61
|
+
'margin:0',
|
|
62
|
+
'opacity:0',
|
|
63
|
+
'font-size:16px',
|
|
64
|
+
'pointer-events:none',
|
|
65
|
+
'z-index:-1',
|
|
66
|
+
].join(';');
|
|
67
|
+
document.body.appendChild(element);
|
|
68
|
+
return element;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Focus the bridge now, while the caller's tap is still a user gesture. */
|
|
72
|
+
export function openSoftKeyboard(): void {
|
|
73
|
+
if (typeof document === 'undefined' || !isSoftKeyboardDevice()) return;
|
|
74
|
+
if (!bridge || !bridge.isConnected) bridge = createBridge();
|
|
75
|
+
clearTimeout(releaseTimer);
|
|
76
|
+
bridge.value = '';
|
|
77
|
+
bridge.focus({ preventScroll: true });
|
|
78
|
+
releaseTimer = setTimeout(releaseSoftKeyboard, RELEASE_AFTER_MS);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Drop the bridge's keyboard, but never steal focus from whatever holds it now.
|
|
83
|
+
*
|
|
84
|
+
* Called when the panel that asked for the keyboard turns out not to be the
|
|
85
|
+
* terminal, and by the terminal panel when it is not the visible view.
|
|
86
|
+
*/
|
|
87
|
+
export function releaseSoftKeyboard(): void {
|
|
88
|
+
clearTimeout(releaseTimer);
|
|
89
|
+
if (bridge && document.activeElement === bridge) bridge.blur();
|
|
90
|
+
}
|
package/src/client/main.tsx
CHANGED
|
@@ -21,6 +21,7 @@ import { readNotificationGrant } from '@/client/lib/notifications/os';
|
|
|
21
21
|
import { installOpenSessionDispatcher } from '@/client/lib/native/open-session';
|
|
22
22
|
import { installFileLaunchHandler } from '@/client/lib/launch/file-handlers';
|
|
23
23
|
import { installOpenPaths } from '@/client/lib/native/open-paths';
|
|
24
|
+
import { installCommandRunner } from '@/client/lib/native/run-command';
|
|
24
25
|
import { installDeviceFiles } from '@/client/lib/launch/device-files';
|
|
25
26
|
|
|
26
27
|
import '@/client/tailwind.css';
|
|
@@ -144,6 +145,14 @@ installOpenSessionDispatcher();
|
|
|
144
145
|
// drained by the same tick that registers the opener.
|
|
145
146
|
installOpenPaths();
|
|
146
147
|
|
|
148
|
+
// A native menu row can only report a click; the command it names lives in the
|
|
149
|
+
// page's catalog. The shell calls `window.__kabmoRunCommand(id)` and this is the
|
|
150
|
+
// transport — installed before the first render for the same reason as the other
|
|
151
|
+
// native hooks: a row pressed during hydration must find the runner, not
|
|
152
|
+
// `undefined`. The row carries NO key equivalent, so the page's own dispatcher
|
|
153
|
+
// keeps every chord (and the user's overrides) intact.
|
|
154
|
+
installCommandRunner();
|
|
155
|
+
|
|
147
156
|
// A document the PHONE handed over — picked in the Files app, or "Open with →
|
|
148
157
|
// Kabmo" from Gmail — arrives as BYTES, not a path: the console may be on
|
|
149
158
|
// another machine, so it could never read the file itself. The shell announces
|
|
@@ -31,7 +31,7 @@ import { hashPassword, deriveCredentialKey, readSessionSecret, writeSessionSecre
|
|
|
31
31
|
import { readSessionCookie, verifySessionToken } from '@/server/lib/auth/token';
|
|
32
32
|
import { agentGate } from '@/server/lib/auth/agent-gate.server';
|
|
33
33
|
import { bearerToken } from '@/server/lib/sessions/agent-token.server';
|
|
34
|
-
import { verifyDeviceToken, readDeviceCookie } from '@/server/lib/connect/devices.server';
|
|
34
|
+
import { markDeviceConnected, verifyDeviceToken, readDeviceCookie } from '@/server/lib/connect/devices.server';
|
|
35
35
|
import { rememberClientAddress } from '@/server/lib/auth/client-address';
|
|
36
36
|
import type { CredentialHandover } from '@/shared/lib/auth/handover';
|
|
37
37
|
|
|
@@ -332,7 +332,13 @@ export async function authGate(request: Request, clientAddress?: string): Promis
|
|
|
332
332
|
// the device removes the hash from the cache, so the next request fails here.
|
|
333
333
|
// The cookie form is what a webview can actually send — it cannot attach a
|
|
334
334
|
// header to its own page requests or to a WebSocket upgrade.
|
|
335
|
-
|
|
335
|
+
//
|
|
336
|
+
// Verification is also the only reliable "last connect" signal: no shell
|
|
337
|
+
// reports after pairing, so a timestamp written by the claim route alone
|
|
338
|
+
// would show the pairing date. Throttled to one write per device per minute.
|
|
339
|
+
const deviceId = verifyDeviceToken(bearerToken(request)) ?? verifyDeviceToken(readDeviceCookie(request));
|
|
340
|
+
if (deviceId) {
|
|
341
|
+
await markDeviceConnected(deviceId);
|
|
336
342
|
return undefined;
|
|
337
343
|
}
|
|
338
344
|
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The capture layer, at the shell: a `bash` call's frames become records.
|
|
8
|
+
*
|
|
9
|
+
* `capture.test.ts` covers the tool adapters (an `edit`, a `write`, an
|
|
10
|
+
* `apply_patch`); this file covers the three lower-authority layers — the trace
|
|
11
|
+
* that names a command's argv, the scan that reconciles an opaque one, and the
|
|
12
|
+
* subagent whose write is attributed to the child.
|
|
13
|
+
*
|
|
14
|
+
* The fake filesystem is a `Map`, so the before/after pair is deterministic:
|
|
15
|
+
* `flush()` after the start frame proves the snapshot ran before the test
|
|
16
|
+
* changes the file. Every path goes through `at()`, so the fixture is native
|
|
17
|
+
* on Windows too.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
|
|
21
|
+
import * as fsp from 'node:fs/promises';
|
|
22
|
+
import * as os from 'node:os';
|
|
23
|
+
import * as path from 'node:path';
|
|
24
|
+
import { makeCapture, records, REPO } from '@/server/lib/changes/capture-test-util';
|
|
25
|
+
import { ChangeJournal } from '@/server/lib/changes/journal.server';
|
|
26
|
+
import { readSessionChangeDiff } from '@/server/lib/changes/reader.server';
|
|
27
|
+
|
|
28
|
+
let dataDir = '';
|
|
29
|
+
let agentDir = '';
|
|
30
|
+
let original: string | undefined;
|
|
31
|
+
let originalAgent: string | undefined;
|
|
32
|
+
|
|
33
|
+
beforeAll(async () => {
|
|
34
|
+
original = Bun.env.KABMO_DATA_DIR;
|
|
35
|
+
originalAgent = Bun.env.PI_CODING_AGENT_DIR;
|
|
36
|
+
dataDir = await fsp.mkdtemp(path.join(os.tmpdir(), 'kabmo-changes-shell-'));
|
|
37
|
+
agentDir = await fsp.mkdtemp(path.join(os.tmpdir(), 'kabmo-changes-shell-agent-'));
|
|
38
|
+
Bun.env.KABMO_DATA_DIR = dataDir;
|
|
39
|
+
Bun.env.PI_CODING_AGENT_DIR = agentDir;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
afterAll(async () => {
|
|
43
|
+
if (original === undefined) delete Bun.env.KABMO_DATA_DIR;
|
|
44
|
+
else Bun.env.KABMO_DATA_DIR = original;
|
|
45
|
+
if (originalAgent === undefined) delete Bun.env.PI_CODING_AGENT_DIR;
|
|
46
|
+
else Bun.env.PI_CODING_AGENT_DIR = originalAgent;
|
|
47
|
+
await fsp.rm(dataDir, { recursive: true, force: true });
|
|
48
|
+
await fsp.rm(agentDir, { recursive: true, force: true });
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const WINDOW_END = Date.now() + 60_000;
|
|
52
|
+
|
|
53
|
+
/** A path inside the fixture repo, spelled the way the host spells it. */
|
|
54
|
+
function at(relative: string): string {
|
|
55
|
+
return path.join(REPO, relative);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
describe('bash capture', () => {
|
|
59
|
+
test('rm is a delete, from the trace argv', async () => {
|
|
60
|
+
const files = new Map([[at('c.ts'), 'C']]);
|
|
61
|
+
const capture = makeCapture('cap-rm', files);
|
|
62
|
+
capture.onFrame({
|
|
63
|
+
type: 'tool_execution_start',
|
|
64
|
+
toolCallId: 'c1',
|
|
65
|
+
toolName: 'bash',
|
|
66
|
+
args: { command: 'rm -f c.ts' },
|
|
67
|
+
});
|
|
68
|
+
await capture.flush();
|
|
69
|
+
files.delete(at('c.ts'));
|
|
70
|
+
capture.onFrame({
|
|
71
|
+
type: 'tool_execution_end',
|
|
72
|
+
toolCallId: 'c1',
|
|
73
|
+
toolName: 'bash',
|
|
74
|
+
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['rm', '-f', 'c.ts'], st: 0 }] }] } } },
|
|
75
|
+
});
|
|
76
|
+
await capture.flush();
|
|
77
|
+
|
|
78
|
+
const diff = await readSessionChangeDiff('cap-rm', at('c.ts'), 0, WINDOW_END);
|
|
79
|
+
expect(diff?.status).toBe('deleted');
|
|
80
|
+
expect(diff?.oldContent).toBe('C');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('sed -i is an update', async () => {
|
|
84
|
+
const files = new Map([[at('d.ts'), 'a']]);
|
|
85
|
+
const capture = makeCapture('cap-sed', files);
|
|
86
|
+
capture.onFrame({
|
|
87
|
+
type: 'tool_execution_start',
|
|
88
|
+
toolCallId: 'c1',
|
|
89
|
+
toolName: 'bash',
|
|
90
|
+
args: { command: "sed -i 's/a/b/' d.ts" },
|
|
91
|
+
});
|
|
92
|
+
await capture.flush();
|
|
93
|
+
files.set(at('d.ts'), 'b');
|
|
94
|
+
capture.onFrame({
|
|
95
|
+
type: 'tool_execution_end',
|
|
96
|
+
toolCallId: 'c1',
|
|
97
|
+
toolName: 'bash',
|
|
98
|
+
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['sed', '-i', 's/a/b/', 'd.ts'], st: 0 }] }] } } },
|
|
99
|
+
});
|
|
100
|
+
await capture.flush();
|
|
101
|
+
|
|
102
|
+
const diff = await readSessionChangeDiff('cap-sed', at('d.ts'), 0, WINDOW_END);
|
|
103
|
+
expect(diff?.status).toBe('modified');
|
|
104
|
+
expect(diff?.oldContent).toBe('a');
|
|
105
|
+
expect(diff?.newContent).toBe('b');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('a redirect is a create the trace does not name', async () => {
|
|
109
|
+
const files = new Map<string, string>();
|
|
110
|
+
const capture = makeCapture('cap-redirect', files);
|
|
111
|
+
capture.onFrame({
|
|
112
|
+
type: 'tool_execution_start',
|
|
113
|
+
toolCallId: 'c1',
|
|
114
|
+
toolName: 'bash',
|
|
115
|
+
args: { command: 'echo hi > e.txt' },
|
|
116
|
+
});
|
|
117
|
+
await capture.flush();
|
|
118
|
+
files.set(at('e.txt'), 'hi\n');
|
|
119
|
+
capture.onFrame({
|
|
120
|
+
type: 'tool_execution_end',
|
|
121
|
+
toolCallId: 'c1',
|
|
122
|
+
toolName: 'bash',
|
|
123
|
+
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['echo', 'hi'], st: 0 }] }] } } },
|
|
124
|
+
});
|
|
125
|
+
await capture.flush();
|
|
126
|
+
|
|
127
|
+
const diff = await readSessionChangeDiff('cap-redirect', at('e.txt'), 0, WINDOW_END);
|
|
128
|
+
expect(diff?.status).toBe('added');
|
|
129
|
+
expect(diff?.newContent).toBe('hi\n');
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test('an opaque command is a note, not a guess', async () => {
|
|
133
|
+
const files = new Map<string, string>();
|
|
134
|
+
const capture = makeCapture('cap-opaque', files);
|
|
135
|
+
capture.onFrame({
|
|
136
|
+
type: 'tool_execution_start',
|
|
137
|
+
toolCallId: 'c1',
|
|
138
|
+
toolName: 'bash',
|
|
139
|
+
args: { command: 'bun test' },
|
|
140
|
+
});
|
|
141
|
+
await capture.flush();
|
|
142
|
+
capture.onFrame({
|
|
143
|
+
type: 'tool_execution_end',
|
|
144
|
+
toolCallId: 'c1',
|
|
145
|
+
toolName: 'bash',
|
|
146
|
+
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['bun', 'test'], st: 0 }] }] } } },
|
|
147
|
+
});
|
|
148
|
+
await capture.flush();
|
|
149
|
+
|
|
150
|
+
const lines = await records('cap-opaque');
|
|
151
|
+
expect(lines.some((line) => line.type === 'change')).toBe(false);
|
|
152
|
+
const note = lines.find((line) => line.type === 'note');
|
|
153
|
+
expect(note?.type).toBe('note');
|
|
154
|
+
if (note?.type !== 'note') throw new Error('expected a note');
|
|
155
|
+
expect(note.reason).toBe('opaque-command');
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
describe('scan pass', () => {
|
|
160
|
+
test('an opaque git reset is reconciled from the two snapshots', async () => {
|
|
161
|
+
const files = new Map([[at('g.ts'), 'old']]);
|
|
162
|
+
const scans = [
|
|
163
|
+
{ root: REPO, dirty: new Map([[at('g.ts'), 'old']]), truncated: false },
|
|
164
|
+
{ root: REPO, dirty: new Map([[at('g.ts'), 'new']]), truncated: false },
|
|
165
|
+
];
|
|
166
|
+
const capture = makeCapture('cap-scan', files, {
|
|
167
|
+
takeScan: async () => scans.shift() ?? null,
|
|
168
|
+
readHead: async () => null,
|
|
169
|
+
});
|
|
170
|
+
capture.onFrame({
|
|
171
|
+
type: 'tool_execution_start',
|
|
172
|
+
toolCallId: 'c1',
|
|
173
|
+
toolName: 'bash',
|
|
174
|
+
args: { command: 'git reset --hard' },
|
|
175
|
+
});
|
|
176
|
+
await capture.flush();
|
|
177
|
+
files.set(at('g.ts'), 'new');
|
|
178
|
+
capture.onFrame({
|
|
179
|
+
type: 'tool_execution_end',
|
|
180
|
+
toolCallId: 'c1',
|
|
181
|
+
toolName: 'bash',
|
|
182
|
+
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['git', 'reset', '--hard'], st: 0 }] }] } } },
|
|
183
|
+
});
|
|
184
|
+
await capture.flush();
|
|
185
|
+
|
|
186
|
+
const diff = await readSessionChangeDiff('cap-scan', at('g.ts'), 0, WINDOW_END);
|
|
187
|
+
expect(diff?.status).toBe('modified');
|
|
188
|
+
expect(diff?.oldContent).toBe('old');
|
|
189
|
+
expect(diff?.newContent).toBe('new');
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
describe('cross-session scan', () => {
|
|
194
|
+
test('a scan skips a path another session in the same cwd recorded', async () => {
|
|
195
|
+
const other = new ChangeJournal('cap-other', REPO);
|
|
196
|
+
await other.recordChange({
|
|
197
|
+
at: Date.now(), agent: 'Main', tool: 'edit', op: 'update', path: at('file4.txt'),
|
|
198
|
+
displayPath: 'file4.txt', before: 'a', after: 'b', source: 'tool',
|
|
199
|
+
});
|
|
200
|
+
await other.flush();
|
|
201
|
+
|
|
202
|
+
const files = new Map<string, string>();
|
|
203
|
+
const scans = [
|
|
204
|
+
{ root: REPO, dirty: new Map<string, string | null>(), truncated: false },
|
|
205
|
+
{ root: REPO, dirty: new Map([[at('file4.txt'), 'python']]), truncated: false },
|
|
206
|
+
];
|
|
207
|
+
const capture = makeCapture('cap-cross', files, {
|
|
208
|
+
takeScan: async () => scans.shift() ?? null,
|
|
209
|
+
readHead: async () => null,
|
|
210
|
+
});
|
|
211
|
+
capture.onFrame({
|
|
212
|
+
type: 'tool_execution_start',
|
|
213
|
+
toolCallId: 'c1',
|
|
214
|
+
toolName: 'bash',
|
|
215
|
+
args: { command: "python3 - <<'PY'\nopen('file4.txt','w').write('python')\nPY" },
|
|
216
|
+
});
|
|
217
|
+
await capture.flush();
|
|
218
|
+
files.set(at('file4.txt'), 'python');
|
|
219
|
+
capture.onFrame({
|
|
220
|
+
type: 'tool_execution_end',
|
|
221
|
+
toolCallId: 'c1',
|
|
222
|
+
toolName: 'bash',
|
|
223
|
+
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['python3', '-'], st: 0 }] }] } } },
|
|
224
|
+
});
|
|
225
|
+
await capture.flush();
|
|
226
|
+
|
|
227
|
+
const lines = await records('cap-cross');
|
|
228
|
+
expect(lines.some((line) => line.type === 'change' && line.path === at('file4.txt'))).toBe(false);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
describe('subagents', () => {
|
|
233
|
+
test('a child edit is attributed to the child', async () => {
|
|
234
|
+
const files = new Map([[at('f.ts'), 'old']]);
|
|
235
|
+
const capture = makeCapture('cap-sub', files);
|
|
236
|
+
capture.onFrame({
|
|
237
|
+
type: 'subagent_event',
|
|
238
|
+
payload: { type: 'tool_execution_start', toolCallId: 's1', toolName: 'edit', args: { path: 'f.ts' }, agent: 'Child' },
|
|
239
|
+
});
|
|
240
|
+
await capture.flush();
|
|
241
|
+
files.set(at('f.ts'), 'new');
|
|
242
|
+
capture.onFrame({
|
|
243
|
+
type: 'subagent_event',
|
|
244
|
+
payload: { type: 'tool_execution_end', toolCallId: 's1', toolName: 'edit', agent: 'Child' },
|
|
245
|
+
});
|
|
246
|
+
await capture.flush();
|
|
247
|
+
|
|
248
|
+
const change = (await records('cap-sub')).find((line) => line.type === 'change');
|
|
249
|
+
expect(change?.type).toBe('change');
|
|
250
|
+
if (change?.type !== 'change') throw new Error('expected a change');
|
|
251
|
+
expect(change.agent).toBe('Child');
|
|
252
|
+
});
|
|
253
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The paths a tool call can touch, read from its args before it runs.
|
|
8
|
+
*
|
|
9
|
+
* Every case is a spelling a real agent sends: omp's `path`, ACP's `filePath`,
|
|
10
|
+
* Claude's `file_path`, an `apply_patch` that names them only in the patch text,
|
|
11
|
+
* and a `bash` call whose plan carries the mutations (plus the source side of a
|
|
12
|
+
* move, which is what makes a `mv` snapshot the file that disappears).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { describe, expect, test } from 'bun:test';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { captureTargets } from '@/server/lib/changes/capture-targets';
|
|
18
|
+
import type { PendingCall } from '@/server/lib/changes/capture-types';
|
|
19
|
+
|
|
20
|
+
const CWD = path.resolve('/work');
|
|
21
|
+
|
|
22
|
+
function pending(tool: string, args: Record<string, unknown>): PendingCall {
|
|
23
|
+
return {
|
|
24
|
+
toolCallId: 'c1',
|
|
25
|
+
tool,
|
|
26
|
+
agent: 'Main',
|
|
27
|
+
startedAt: 0,
|
|
28
|
+
args,
|
|
29
|
+
before: new Map(),
|
|
30
|
+
ready: Promise.resolve(),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
describe('captureTargets', () => {
|
|
35
|
+
test('a file tool resolves its relative path against the session cwd', () => {
|
|
36
|
+
expect(captureTargets(pending('edit', { path: 'src/a.ts' }), CWD)).toEqual([path.join(CWD, 'src/a.ts')]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('every arg spelling an agent uses is a target', () => {
|
|
40
|
+
const args = { path: 'a.ts', file_path: 'b.ts', filePath: 'c.ts', moveTo: 'd.ts', destination: 'e.ts' };
|
|
41
|
+
expect(captureTargets(pending('edit', args), CWD)).toEqual(['a', 'b', 'c', 'd', 'e'].map((name) => path.join(CWD, `${name}.ts`)));
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test('an absolute path is normalized, not re-rooted', () => {
|
|
45
|
+
const absolute = path.resolve('/other/x.ts');
|
|
46
|
+
expect(captureTargets(pending('write', { path: absolute }), CWD)).toEqual([absolute]);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('an apply_patch names its paths inside the patch text', () => {
|
|
50
|
+
const patch = [
|
|
51
|
+
'*** Begin Patch',
|
|
52
|
+
'*** Update File: src/one.ts',
|
|
53
|
+
'*** Move to: src/two.ts',
|
|
54
|
+
'*** Add File: src/three.ts',
|
|
55
|
+
'*** End Patch',
|
|
56
|
+
].join('\n');
|
|
57
|
+
expect(captureTargets(pending('apply_patch', { patch }), CWD)).toEqual(
|
|
58
|
+
['src/one.ts', 'src/two.ts', 'src/three.ts'].map((relative) => path.join(CWD, relative)),
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('a bash call takes its plan mutations, including the side a move leaves', () => {
|
|
63
|
+
const plan = {
|
|
64
|
+
scan: false,
|
|
65
|
+
opaque: false,
|
|
66
|
+
readOnly: false,
|
|
67
|
+
mutations: [
|
|
68
|
+
{ path: path.join(CWD, 'from.ts'), from: path.join(CWD, 'old.ts'), op: 'update' as const },
|
|
69
|
+
{ path: path.join(CWD, 'new.ts'), op: 'create' as const },
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
const call = { ...pending('bash', { command: 'mv old.ts from.ts' }), plan };
|
|
73
|
+
expect(captureTargets(call, CWD)).toEqual([path.join(CWD, 'from.ts'), path.join(CWD, 'old.ts'), path.join(CWD, 'new.ts')]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('a URL is not a path', () => {
|
|
77
|
+
expect(captureTargets(pending('read', { path: 'https://example.test/a.ts' }), CWD)).toEqual([]);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('a tool with no path arg has no target', () => {
|
|
81
|
+
expect(captureTargets(pending('read', {}), CWD)).toEqual([]);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The paths one tool call can touch, read from its `args`.
|
|
8
|
+
*
|
|
9
|
+
* A file tool names its path outright — `filePath` is the ACP/opencode
|
|
10
|
+
* spelling, `path`/`file_path` the omp and Claude ones, and a tool whose args
|
|
11
|
+
* use none of them is a note. `apply_patch` names its paths only inside the
|
|
12
|
+
* patch text, so the headers are read. A `bash` call instead takes the paths its
|
|
13
|
+
* classification found, plus the source side of a move, which is what makes the
|
|
14
|
+
* before-snapshot cover a redirect or an `mv` the trace does not model.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
import type { PendingCall } from '@/server/lib/changes/capture-types';
|
|
19
|
+
import { patchPaths } from '@/server/lib/changes/patch-paths';
|
|
20
|
+
|
|
21
|
+
/** Every absolute path the call could read or write, before it runs. */
|
|
22
|
+
export function captureTargets(pending: PendingCall, cwd: string): string[] {
|
|
23
|
+
if (pending.tool === 'bash') {
|
|
24
|
+
const paths: string[] = [];
|
|
25
|
+
for (const mutation of pending.plan?.mutations ?? []) {
|
|
26
|
+
paths.push(mutation.path);
|
|
27
|
+
if (mutation.from) paths.push(mutation.from);
|
|
28
|
+
}
|
|
29
|
+
return paths;
|
|
30
|
+
}
|
|
31
|
+
const args = pending.args;
|
|
32
|
+
const raw: unknown[] = [args.path, args.file_path, args.filePath, args.moveTo, args.destination];
|
|
33
|
+
if (Array.isArray(args.paths)) raw.push(...args.paths);
|
|
34
|
+
if (Array.isArray(args.files)) raw.push(...args.files);
|
|
35
|
+
const patch = typeof args.patch === 'string'
|
|
36
|
+
? args.patch
|
|
37
|
+
: typeof args.patchText === 'string'
|
|
38
|
+
? args.patchText
|
|
39
|
+
: typeof args.input === 'string'
|
|
40
|
+
? args.input
|
|
41
|
+
: '';
|
|
42
|
+
if (patch) raw.push(...patchPaths(patch));
|
|
43
|
+
const paths: string[] = [];
|
|
44
|
+
for (const value of raw) {
|
|
45
|
+
// A URL is not a path; a bare `://` inside a Windows path is not either,
|
|
46
|
+
// which is why this looks for the scheme separator rather than `:`.
|
|
47
|
+
if (typeof value !== 'string' || !value || value.includes('://')) continue;
|
|
48
|
+
paths.push(path.isAbsolute(value) ? path.normalize(value) : path.resolve(cwd, value));
|
|
49
|
+
}
|
|
50
|
+
return paths;
|
|
51
|
+
}
|
|
@@ -21,8 +21,8 @@ import { readOmpBefore } from '@/server/lib/changes/omp-fallback.server';
|
|
|
21
21
|
/** The before side of an `edit` whose write landed before the snapshot. */
|
|
22
22
|
export function reconstructEdit(pending: PendingCall, after: string | null | undefined): string | null {
|
|
23
23
|
if (after === null || after === undefined) return null;
|
|
24
|
-
const oldString = pending.args.old_string;
|
|
25
|
-
const newString = pending.args.new_string;
|
|
24
|
+
const oldString = pending.args.old_string ?? pending.args.oldString;
|
|
25
|
+
const newString = pending.args.new_string ?? pending.args.newString;
|
|
26
26
|
if (typeof oldString !== 'string' || typeof newString !== 'string' || !newString) return null;
|
|
27
27
|
if (!after.includes(newString)) return null;
|
|
28
28
|
return after.replace(newString, oldString);
|