@kabmo-labs/kabmo 0.32.1 → 0.33.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 +542 -535
- package/dist/client/static/js/{CsvGrid-4gx0jevc.js → CsvGrid-fncjbg6j.js} +2 -2
- package/dist/client/static/js/{DocxView-0667nr8h.js → DocxView-c9v2vr3r.js} +2 -2
- package/dist/client/static/js/{DrawioView-522v0d0r.js → DrawioView-vxjksm12.js} +2 -2
- package/dist/client/static/js/{ImageView-t8xp60hm.js → ImageView-a3g5k226.js} +1 -1
- package/dist/client/static/js/LayoutWrapper-hnjfwsjh.js +2 -0
- package/dist/client/static/js/Modal-qtftcp2t.js +38 -0
- package/dist/client/static/js/{PdfView-3fx172xh.js → PdfView-ksaes53y.js} +1 -1
- package/dist/client/static/js/{SessionsView-n3agmf5t.js → SessionsView-30vcr95v.js} +1 -1
- package/dist/client/static/js/{SheetView-nmrdb1b8.js → SheetView-vc484scg.js} +6 -6
- package/dist/client/static/js/{SvgPreview-0xsc6xam.js → SvgPreview-tph89jet.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-jj31rs62.js → abnfDiagram-O67JEVCF-xbar278c.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-tavtgb8a.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ay3yr7pf.js → architectureDiagram-NJMV4G6O-s171n2z6.js} +3 -3
- 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-gzx6rv9n.js} +2 -2
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-dtb81cgz.js → c4Diagram-YGBWAQC7-7f00skch.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-vk5a2n9w.js → classDiagram-v2-NBCMYWYE-j79v95nc.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-6rbjbe19.js → cose-bilkent-JH36ORCC-5fkn7ee5.js} +1 -1
- package/dist/client/static/js/css-6vj0d308.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-cdh3n2z2.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-vyjksedr.js → cynefinDiagram-VND7K2PF-cfs1yvrd.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-7hey38z5.js → dagre-6A5THRUB-44bgc48p.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-aes06jde.js → diagram-22UHCM2B-a4g4x83k.js} +14 -14
- package/dist/client/static/js/{diagram-3UASUU5V-3cfkgm3x.js → diagram-3UASUU5V-gm4rg5na.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-z8mfhwpy.js → diagram-ATOU4E4O-a95y41vk.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-t4821ctz.js → diagram-CDSNMT55-t3j93mmc.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-23yxbfrx.js → diagram-MLGK6HIB-c2wdez02.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-chhtf7v0.js → diagram-MPIPVDR6-gya9jhs5.js} +2 -2
- package/dist/client/static/js/{dockerfile-5b87ghm7.js → dockerfile-a7q6174s.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-9jejcvfr.js → ebnfDiagram-ZINNZB2B-jjhkza6t.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-xhhtkf58.js → elk-276RUBZZ-f7re45mw.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-mt2apjjb.js → erDiagram-OPXOYQCR-tpm9g5te.js} +6 -6
- package/dist/client/static/js/{erlang-6m6tpt72.js → erlang-qt876zrq.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-as97tpyp.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-ggm06d12.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-8cm7a29w.js → ganttDiagram-FUAMR5RP-fz43n12d.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-eqz7p9ng.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-5s0gbnx2.js → gitGraphDiagram-X574FWY7-f61hgbn6.js} +9 -9
- package/dist/client/static/js/graphql-n43pd5fs.js +1 -0
- package/dist/client/static/js/{index-z5s27s26.js → index-03h3bkcf.js} +1 -1
- package/dist/client/static/js/{index-360d7j0d.js → index-0e40xskg.js} +1 -1
- package/dist/client/static/js/{index-z4v1xmh1.js → index-0n5wwe60.js} +2 -2
- package/dist/client/static/js/{index-pf7syd7t.js → index-0tf0arsp.js} +3 -3
- package/dist/client/static/js/{index-fdbfzshx.js → index-14vndmcr.js} +2 -2
- package/dist/client/static/js/{index-7n68yx6m.js → index-1a0zkj8h.js} +2 -2
- package/dist/client/static/js/{index-p7btwjvj.js → index-1xqs14fr.js} +3 -3
- package/dist/client/static/js/{index-brj8qwa6.js → index-1y9r4frb.js} +2 -2
- package/dist/client/static/js/{index-6q80csr0.js → index-2svnq5gg.js} +1 -1
- package/dist/client/static/js/{index-9sd0vjmh.js → index-2x5f66t6.js} +2 -2
- package/dist/client/static/js/{index-dt7e1328.js → index-354mqqra.js} +2 -2
- package/dist/client/static/js/{index-5x95n3hx.js → index-3rcjx70v.js} +1 -1
- package/dist/client/static/js/{index-532btjmp.js → index-3zc1b0dv.js} +2 -2
- package/dist/client/static/js/{index-wzma5n54.js → index-5tgq7aqx.js} +1 -1
- package/dist/client/static/js/{index-xya34x4v.js → index-76zb4m0n.js} +2 -2
- package/dist/client/static/js/{index-2xj14800.js → index-7y6rpsrp.js} +2 -2
- package/dist/client/static/js/{index-h06bcfds.js → index-8239j2v1.js} +1 -1
- package/dist/client/static/js/{index-dq1kdt03.js → index-9fjt5anh.js} +1 -1
- package/dist/client/static/js/{index-ehcpzk5b.js → index-9y3gjdj7.js} +1 -1
- package/dist/client/static/js/{index-sa9cp6km.js → index-ahv9y42z.js} +2 -2
- package/dist/client/static/js/{index-vd0e25p0.js → index-ajs3jj6j.js} +1 -1
- package/dist/client/static/js/{index-qnwqaczk.js → index-apvkd37e.js} +3 -3
- package/dist/client/static/js/index-at6bhjyf.js +1 -0
- package/dist/client/static/js/index-bkye8mz4.js +2 -0
- package/dist/client/static/js/{index-dnp07j57.js → index-d495kfm0.js} +1 -1
- package/dist/client/static/js/{index-gbfg0anm.js → index-dbe6afkf.js} +2 -2
- package/dist/client/static/js/{index-g33knza2.js → index-djmg1d7h.js} +1 -1
- package/dist/client/static/js/{index-629kfbcb.js → index-e4p4cd3r.js} +2 -2
- package/dist/client/static/js/{index-5y7c62sm.js → index-eyzeya95.js} +5 -5
- package/dist/client/static/js/{index-3vhznzgr.js → index-gcs49f3p.js} +1 -1
- package/dist/client/static/js/{index-59jb53v3.js → index-gs6f0qwa.js} +2 -2
- 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-ay34b398.js → index-js7t1vb1.js} +17 -17
- package/dist/client/static/js/{index-a0bdavdr.js → index-km2zb6wk.js} +2 -2
- package/dist/client/static/js/{index-ye3sr7db.js → index-m73za75e.js} +2 -2
- package/dist/client/static/js/{index-kpspnztv.js → index-pbe4yed4.js} +2 -2
- package/dist/client/static/js/{index-a6k2hqke.js → index-pxv2nw9w.js} +1 -1
- package/dist/client/static/js/{index-jz9fpznk.js → index-q2w6s8n7.js} +5 -5
- package/dist/client/static/js/{index-h7pn9qw6.js → index-qckv9nte.js} +2 -2
- package/dist/client/static/js/{index-a733k69t.js → index-qsm2z36d.js} +2 -2
- package/dist/client/static/js/{index-pf5sbesf.js → index-rytaa8ca.js} +2 -2
- package/dist/client/static/js/{index-c0x6s6f7.js → index-sdtye3jy.js} +2 -2
- package/dist/client/static/js/index-sffjtm5w.js +12 -0
- package/dist/client/static/js/{index-ejgd8w3s.js → index-trm9x02n.js} +28 -28
- package/dist/client/static/js/{index-c93sp4yh.js → index-vw4brsdx.js} +1 -1
- package/dist/client/static/js/{index-hc2jmzpx.js → index-vw5k8csz.js} +46 -46
- package/dist/client/static/js/{index-2gfc25tq.js → index-w0fwb80e.js} +1 -1
- package/dist/client/static/js/{index-bbggh3f8.js → index-ypx3qmhq.js} +2 -2
- package/dist/client/static/js/{index-4s8ttfxj.js → index-zt75xpq0.js} +193 -193
- package/dist/client/static/js/{index-jppt5mgc.js → index-zvfvqvn9.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-4pkzh1qx.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-3w1yz32c.js → infoDiagram-VRGFBTTK-1qj804sn.js} +1 -1
- package/dist/client/static/js/ini-j5dyq6gm.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ckt471dy.js → ishikawaDiagram-OU5B5YK6-4j4qsnzw.js} +3 -3
- package/dist/client/static/js/java-g4dgwbfd.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kfvn4w7e.js → journeyDiagram-ZHPQQLJL-j0brnfft.js} +4 -4
- package/dist/client/static/js/jsx-7t5ecz9s.js +1 -0
- package/dist/client/static/js/{julia-0j0gsjvc.js → julia-4ghmfy3e.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-0q36cm83.js → kanban-definition-PNTS6WVX-qqc22br0.js} +2 -2
- 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-vv3wbe65.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-e2ym5en8.js → mindmap-definition-NLK3R4M7-y5b2z8zp.js} +2 -2
- package/dist/client/static/js/one-dark-pro-hm3f56n1.js +1 -0
- package/dist/client/static/js/one-light-xrz49rct.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-yg71sp88.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-t8bbdyhe.js → pegDiagram-GJSIUBJH-0be07mqs.js} +1 -1
- package/dist/client/static/js/{perl-7n7e9ncg.js → perl-sd00t4b4.js} +1 -1
- package/dist/client/static/js/{php-32vy69vd.js → php-2zfyqa61.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-89wd6np0.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-envv4brj.js → pieDiagram-5QR66LMP-544w86jk.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-p09e7z5s.js} +4 -4
- package/dist/client/static/js/r-qw82kkv9.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-avn0b8r9.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-de27xv5w.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-rg4zzj7x.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d84fhj8v.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-dvf8xrmc.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-1ej0f5hr.js → railroadDiagram-XR7U4H2S-de830ed2.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-rvdaknpd.js → requirementDiagram-PLB6GJNP-b47d74p1.js} +4 -4
- package/dist/client/static/js/{ruby-5ty7fys7.js → ruby-v9qaqhby.js} +1 -1
- package/dist/client/static/js/{rust-2geezrcs.js → rust-fkt0qyrs.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-nxvhtdaw.js → sankeyDiagram-IPEJSGJF-6ezc2fpj.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-by5zqj6w.js} +18 -18
- package/dist/client/static/js/{sizeCapture-INFHLROL-r074kj7s.js → sizeCapture-INFHLROL-q85r06j6.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vxghxdb0.js → stateDiagram-v2-GCMORJYK-ep5pyexs.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-95fcqkh8.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xs2en5dv.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-5tbq4ex2.js → timeline-definition-EJHVYXUP-461e615g.js} +2 -2
- package/dist/client/static/js/treeView-Q6P3EWNA-mham0bh6.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-mxrxax86.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-ftqfnvhg.js} +37 -37
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-7k5jsxf9.js → vennDiagram-UO4OBE2U-7t96h6ez.js} +7 -7
- package/dist/client/static/js/{vue-06rdf4wh.js → vue-j8vb9d7r.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-8vrvh9p3.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-km2x4er8.js → wardleyDiagram-VNRHLVJA-0de8w8c6.js} +4 -4
- package/dist/client/static/js/xml-dz51p1m3.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-kr3sgr4m.js → xychartDiagram-PMCCYNJV-dez9phkf.js} +5 -5
- package/dist/client/static/js/yaml-2cfkd30t.js +1 -0
- package/package.json +1 -1
- 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/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/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/workspace/chat-timeline/ChangedFilesSummary.tsx +101 -0
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +33 -1
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +21 -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/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/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/server/lib/harness/launch-table.ts +10 -0
- package/src/server/lib/omp/session/changes.test.ts +138 -0
- package/src/server/lib/omp/session/changes.ts +220 -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/sessions/changes.test.ts +90 -0
- package/src/server/routes/sessions/changes.ts +55 -0
- package/src/server/routes/sessions/index.ts +6 -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/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/omp/config/schema.test.ts +4 -2
- package/src/shared/lib/settings/defaults.ts +1 -0
- 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 +58 -0
- package/src/shared/types/settings/state.ts +8 -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/index-61tm0v57.js +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/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/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
|
@@ -38,6 +38,7 @@ afterEach(() => {
|
|
|
38
38
|
jest.useRealTimers();
|
|
39
39
|
FakeAudioContext.instances.length = 0;
|
|
40
40
|
(win as unknown as Record<string, unknown>).AudioContext = FakeAudioContext;
|
|
41
|
+
delete window.__kabmoCall;
|
|
41
42
|
});
|
|
42
43
|
/** The alert mounts the real hook, so every constructed context is a cue. */
|
|
43
44
|
|
|
@@ -241,6 +242,20 @@ describe('isChatSoundEnabled', () => {
|
|
|
241
242
|
triggerChatCompletionSound();
|
|
242
243
|
expect(FakeAudioContext.instances).toHaveLength(1);
|
|
243
244
|
});
|
|
245
|
+
|
|
246
|
+
test('inside a shell the banner plays the chime instead', () => {
|
|
247
|
+
window.__kabmoCall = () => Promise.resolve(null);
|
|
248
|
+
primeKabmoSettings({ chatCompletionSound: true, notifyOnFinish: true });
|
|
249
|
+
|
|
250
|
+
triggerChatCompletionSound();
|
|
251
|
+
expect(FakeAudioContext.instances).toEqual([]);
|
|
252
|
+
|
|
253
|
+
// The same setting with the shell's banner switched off: nothing else is
|
|
254
|
+
// making sound, so the page must.
|
|
255
|
+
primeKabmoSettings({ chatCompletionSound: true, notifyOnFinish: false });
|
|
256
|
+
triggerChatCompletionSound();
|
|
257
|
+
expect(FakeAudioContext.instances).toHaveLength(1);
|
|
258
|
+
});
|
|
244
259
|
});
|
|
245
260
|
|
|
246
261
|
/** The snapshot and the DOM globals are module/global state shared across the whole `bun test` process. */
|
|
@@ -6,6 +6,12 @@ interface UseFileDiffOptions {
|
|
|
6
6
|
isStaged: boolean;
|
|
7
7
|
repo: string;
|
|
8
8
|
root?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether this hook owns the read. A journal diff tab passes `false`: its two
|
|
11
|
+
* sides come from the session's change journal, and a git read would be a
|
|
12
|
+
* second, wrong answer for the same panel.
|
|
13
|
+
*/
|
|
14
|
+
enabled?: boolean;
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
export interface FileDiffState {
|
|
@@ -33,7 +39,7 @@ export interface FileDiffState {
|
|
|
33
39
|
* earlier read overwriting a newer one, and a dependency on the staged/status
|
|
34
40
|
* copies re-keying the callback and firing a fetch per render.
|
|
35
41
|
*/
|
|
36
|
-
export function useFileDiff({ filePath, status, isStaged, repo, root }: UseFileDiffOptions): FileDiffState {
|
|
42
|
+
export function useFileDiff({ filePath, status, isStaged, repo, root, enabled = true }: UseFileDiffOptions): FileDiffState {
|
|
37
43
|
const [rawDiff, setRawDiff] = useState<string>('');
|
|
38
44
|
const [oldContent, setOldContent] = useState<string>('');
|
|
39
45
|
const [newContent, setNewContent] = useState<string>('');
|
|
@@ -53,7 +59,7 @@ export function useFileDiff({ filePath, status, isStaged, repo, root }: UseFileD
|
|
|
53
59
|
const fetchSeqRef = useRef(0);
|
|
54
60
|
|
|
55
61
|
const fetchDiff = useCallback(async (overrides: { staged?: boolean; status?: string } = {}) => {
|
|
56
|
-
if (!filePath) return;
|
|
62
|
+
if (!enabled || !filePath) return;
|
|
57
63
|
const seq = ++fetchSeqRef.current;
|
|
58
64
|
setIsLoading(true);
|
|
59
65
|
setErrorMessage(null);
|
|
@@ -109,7 +115,7 @@ export function useFileDiff({ filePath, status, isStaged, repo, root }: UseFileD
|
|
|
109
115
|
} finally {
|
|
110
116
|
if (seq === fetchSeqRef.current) setIsLoading(false);
|
|
111
117
|
}
|
|
112
|
-
}, [filePath, repo, root]);
|
|
118
|
+
}, [filePath, repo, root, enabled]);
|
|
113
119
|
|
|
114
120
|
/**
|
|
115
121
|
* The read is keyed on the pair the caller asked for, not only on the path.
|
|
@@ -121,12 +127,13 @@ export function useFileDiff({ filePath, status, isStaged, repo, root }: UseFileD
|
|
|
121
127
|
* seeded first: `fetchDiff` reads them, and the state copies lag a render.
|
|
122
128
|
*/
|
|
123
129
|
useEffect(() => {
|
|
130
|
+
if (!enabled) return;
|
|
124
131
|
stagedRef.current = isStaged;
|
|
125
132
|
statusRef.current = status;
|
|
126
133
|
setCurrentStatus(status);
|
|
127
134
|
setCurrentStaged(isStaged);
|
|
128
135
|
void fetchDiff();
|
|
129
|
-
}, [fetchDiff, isStaged, status]);
|
|
136
|
+
}, [fetchDiff, isStaged, status, enabled]);
|
|
130
137
|
|
|
131
138
|
const adoptState = useCallback((next: { staged?: boolean; status?: string }) => {
|
|
132
139
|
if (typeof next.staged === 'boolean') {
|
|
@@ -2,14 +2,14 @@ import { useCallback, useEffect, useRef } from 'preact/hooks';
|
|
|
2
2
|
import { useSessionState } from '@/client/hooks/workspace/session-state';
|
|
3
3
|
import { useSessionStateContext } from '@/client/hooks/workspace/session-state/context';
|
|
4
4
|
import { useKabmoEvent } from '@/client/hooks/ui/window-event';
|
|
5
|
-
import { diffTabId, diffTabName, fileTabId } from '@/shared/lib/workspace/file-tab-id';
|
|
5
|
+
import { diffTabId, diffTabName, fileTabId, journalDiffTabId } from '@/shared/lib/workspace/file-tab-id';
|
|
6
6
|
import { getSessionValue, setSessionKey } from '@/shared/lib/workspace/session-state/store';
|
|
7
7
|
import {
|
|
8
8
|
SCROLL_POSITIONS_KEY,
|
|
9
9
|
dropScrollPosition,
|
|
10
10
|
type ScrollPositions,
|
|
11
11
|
} from '@/shared/lib/workspace/scroll-positions';
|
|
12
|
-
import type { OpenedFile } from '@/shared/types/fs';
|
|
12
|
+
import type { JournalDiffRef, OpenedFile } from '@/shared/types/fs';
|
|
13
13
|
|
|
14
14
|
export interface OpenFileInput {
|
|
15
15
|
id?: number | string;
|
|
@@ -135,10 +135,16 @@ export function useFileTabs(
|
|
|
135
135
|
status?: string;
|
|
136
136
|
repo?: string;
|
|
137
137
|
root?: string;
|
|
138
|
+
/** `journal` reads the agent's own before/after snapshots, not the worktree. */
|
|
139
|
+
source?: 'journal';
|
|
140
|
+
journal?: JournalDiffRef;
|
|
138
141
|
}) => {
|
|
139
142
|
const rawPath = diffInfo.file.replace(/^\/+/, '');
|
|
140
143
|
const isStaged = Boolean(diffInfo.staged);
|
|
141
|
-
const
|
|
144
|
+
const journal = diffInfo.source === 'journal' ? diffInfo.journal : undefined;
|
|
145
|
+
const diffId = journal
|
|
146
|
+
? journalDiffTabId(journal.path, journal.from, journal.to)
|
|
147
|
+
: diffTabId(rawPath, isStaged);
|
|
142
148
|
|
|
143
149
|
const diffEntry: OpenedFile = {
|
|
144
150
|
id: diffId,
|
|
@@ -149,11 +155,12 @@ export function useFileTabs(
|
|
|
149
155
|
diffStaged: isStaged,
|
|
150
156
|
repo: diffInfo.repo || '.',
|
|
151
157
|
root: diffInfo.root ?? activeProjectPath ?? undefined,
|
|
158
|
+
...(journal ? { diffSource: 'journal' as const, journalDiff: journal } : {}),
|
|
152
159
|
};
|
|
153
160
|
|
|
154
161
|
setOpenedFiles(prev => {
|
|
155
162
|
const existing = prev.find(
|
|
156
|
-
f => f.id === diffId || (f.isDiff && f.path === rawPath && f.diffStaged === isStaged)
|
|
163
|
+
f => f.id === diffId || (!journal && f.isDiff && f.path === rawPath && f.diffStaged === isStaged)
|
|
157
164
|
);
|
|
158
165
|
if (existing) {
|
|
159
166
|
setActiveFileId(existing.id);
|
|
@@ -289,6 +296,8 @@ export function useFileTabs(
|
|
|
289
296
|
status?: string;
|
|
290
297
|
repo?: string;
|
|
291
298
|
root?: string;
|
|
299
|
+
source?: 'journal';
|
|
300
|
+
journal?: JournalDiffRef;
|
|
292
301
|
}>;
|
|
293
302
|
if (!customEvent.detail || !customEvent.detail.file) return;
|
|
294
303
|
handleOpenDiff(customEvent.detail);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The diff panel's read for a journal tab: the agent's own before/after
|
|
8
|
+
* snapshots for one path inside one run window.
|
|
9
|
+
*
|
|
10
|
+
* Same shape as {@link useFileDiff} so the panel can swap the source without a
|
|
11
|
+
* second renderer. The two differences are the endpoint and the status
|
|
12
|
+
* vocabulary: the journal answers `added` / `modified` / `deleted`, which the
|
|
13
|
+
* panel's badge already understands as `A` / `M` / `D`.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
|
|
17
|
+
import type { FileDiffState } from '@/client/hooks/workspace/diff-file';
|
|
18
|
+
import type { JournalDiffRef } from '@/shared/types/fs';
|
|
19
|
+
|
|
20
|
+
interface JournalDiffResponse {
|
|
21
|
+
success?: boolean;
|
|
22
|
+
oldContent?: string;
|
|
23
|
+
newContent?: string;
|
|
24
|
+
diff?: string;
|
|
25
|
+
status?: 'added' | 'modified' | 'deleted';
|
|
26
|
+
unavailable?: boolean;
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** `A` / `M` / `D` for the panel's status badge. */
|
|
31
|
+
function statusLetter(status: JournalDiffResponse['status']): string {
|
|
32
|
+
if (status === 'added') return 'A';
|
|
33
|
+
if (status === 'deleted') return 'D';
|
|
34
|
+
return 'M';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function useJournalDiff(ref: JournalDiffRef | undefined): FileDiffState {
|
|
38
|
+
const [rawDiff, setRawDiff] = useState('');
|
|
39
|
+
const [oldContent, setOldContent] = useState('');
|
|
40
|
+
const [newContent, setNewContent] = useState('');
|
|
41
|
+
const [currentStatus, setCurrentStatus] = useState('M');
|
|
42
|
+
const [isLoading, setIsLoading] = useState(Boolean(ref));
|
|
43
|
+
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
|
44
|
+
const seqRef = useRef(0);
|
|
45
|
+
|
|
46
|
+
const sessionId = ref?.sessionId;
|
|
47
|
+
const path = ref?.path;
|
|
48
|
+
const from = ref?.from;
|
|
49
|
+
const to = ref?.to;
|
|
50
|
+
|
|
51
|
+
const fetchDiff = useCallback(async () => {
|
|
52
|
+
if (!sessionId || !path || from === undefined || to === undefined) return;
|
|
53
|
+
const seq = ++seqRef.current;
|
|
54
|
+
setIsLoading(true);
|
|
55
|
+
setErrorMessage(null);
|
|
56
|
+
try {
|
|
57
|
+
const params = new URLSearchParams({ path, from: String(from), to: String(to) });
|
|
58
|
+
const res = await fetch(`/api/sessions/${encodeURIComponent(sessionId)}/changes/diff?${params.toString()}`);
|
|
59
|
+
const data = (await res.json().catch(() => null)) as JournalDiffResponse | null;
|
|
60
|
+
if (seq !== seqRef.current) return;
|
|
61
|
+
if (data?.success) {
|
|
62
|
+
setOldContent(data.oldContent ?? '');
|
|
63
|
+
setNewContent(data.newContent ?? '');
|
|
64
|
+
setRawDiff(data.diff ?? '');
|
|
65
|
+
setCurrentStatus(statusLetter(data.status));
|
|
66
|
+
if (data.unavailable) {
|
|
67
|
+
setErrorMessage('The journal did not store this file’s content (over 8 MB), so the two sides are unknown.');
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
setErrorMessage(data?.error || `Failed to load the journal diff (HTTP ${res.status})`);
|
|
71
|
+
}
|
|
72
|
+
} catch (err: unknown) {
|
|
73
|
+
if (seq !== seqRef.current) return;
|
|
74
|
+
setErrorMessage(err instanceof Error ? err.message : 'Error fetching the journal diff');
|
|
75
|
+
} finally {
|
|
76
|
+
if (seq === seqRef.current) setIsLoading(false);
|
|
77
|
+
}
|
|
78
|
+
}, [sessionId, path, from, to]);
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
void fetchDiff();
|
|
82
|
+
}, [fetchDiff]);
|
|
83
|
+
|
|
84
|
+
const adoptState = useCallback(() => {}, []);
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
rawDiff,
|
|
88
|
+
oldContent,
|
|
89
|
+
newContent,
|
|
90
|
+
currentStatus,
|
|
91
|
+
currentStaged: false,
|
|
92
|
+
isLoading,
|
|
93
|
+
errorMessage,
|
|
94
|
+
fetchDiff,
|
|
95
|
+
adoptState,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The one rule that removes the double chime: a shell's banner plays the Kabmo
|
|
8
|
+
* sound itself, so the page must not play the cue on top of it.
|
|
9
|
+
*
|
|
10
|
+
* Every branch here is a sound the user either hears twice or never — neither
|
|
11
|
+
* throws, neither logs, so this is the only place the decision is visible.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
15
|
+
import { Window } from 'happy-dom';
|
|
16
|
+
|
|
17
|
+
import { nativeBannerPlaysSound } from '@/client/lib/notifications/native-banner-sound';
|
|
18
|
+
import { notificationPlatformForClient } from '@/client/lib/notifications/platform';
|
|
19
|
+
import { primeKabmoSettings } from '@/shared/lib/settings/client';
|
|
20
|
+
|
|
21
|
+
const DOM_GLOBALS = ['window', 'document', 'navigator'] as const;
|
|
22
|
+
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
23
|
+
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
const win = new Window({ url: 'http://localhost' });
|
|
26
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
27
|
+
for (const key of DOM_GLOBALS) {
|
|
28
|
+
if (!(key in nativeGlobals)) nativeGlobals[key] = target[key];
|
|
29
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
afterEach(() => {
|
|
34
|
+
primeKabmoSettings({});
|
|
35
|
+
delete window.__kabmoCall;
|
|
36
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
37
|
+
for (const key of DOM_GLOBALS) {
|
|
38
|
+
if (nativeGlobals[key] === undefined) delete target[key];
|
|
39
|
+
else target[key] = nativeGlobals[key];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/** A shell that answers everything, so `hasShellBridge()` is true. */
|
|
44
|
+
function installShell(): void {
|
|
45
|
+
window.__kabmoCall = () => Promise.resolve(null);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
describe('nativeBannerPlaysSound', () => {
|
|
49
|
+
test('a browser keeps the Web Audio cue', () => {
|
|
50
|
+
primeKabmoSettings({ notifyOnFinish: true, notifyOnAsk: true });
|
|
51
|
+
expect(nativeBannerPlaysSound('finish')).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('a shell with the event switch on owns the sound', () => {
|
|
55
|
+
installShell();
|
|
56
|
+
primeKabmoSettings({ notifyOnFinish: true });
|
|
57
|
+
expect(nativeBannerPlaysSound('finish')).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('the event switch ships off, so the page stays audible', () => {
|
|
61
|
+
installShell();
|
|
62
|
+
primeKabmoSettings({});
|
|
63
|
+
expect(nativeBannerPlaysSound('finish')).toBe(false);
|
|
64
|
+
expect(nativeBannerPlaysSound('ask')).toBe(false);
|
|
65
|
+
expect(nativeBannerPlaysSound('error')).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('a silenced device class falls back to the page cue', () => {
|
|
69
|
+
installShell();
|
|
70
|
+
const master = notificationPlatformForClient() === 'mobile'
|
|
71
|
+
? 'notifyMobileEnabled'
|
|
72
|
+
: 'notifyDesktopEnabled';
|
|
73
|
+
primeKabmoSettings({ notifyOnFinish: true, [master]: false });
|
|
74
|
+
expect(nativeBannerPlaysSound('finish')).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('the other device class does not silence this one', () => {
|
|
78
|
+
installShell();
|
|
79
|
+
const other = notificationPlatformForClient() === 'mobile'
|
|
80
|
+
? 'notifyDesktopEnabled'
|
|
81
|
+
: 'notifyMobileEnabled';
|
|
82
|
+
primeKabmoSettings({ notifyOnAsk: true, [other]: false });
|
|
83
|
+
expect(nativeBannerPlaysSound('ask')).toBe(true);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('each event is gated by its own switch', () => {
|
|
87
|
+
installShell();
|
|
88
|
+
primeKabmoSettings({ notifyOnAsk: true });
|
|
89
|
+
expect(nativeBannerPlaysSound('ask')).toBe(true);
|
|
90
|
+
expect(nativeBannerPlaysSound('finish')).toBe(false);
|
|
91
|
+
expect(nativeBannerPlaysSound('error')).toBe(false);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Whether the NATIVE banner owns the chime for this event.
|
|
8
|
+
*
|
|
9
|
+
* Inside a Kabmo shell the OS notification plays the Kabmo sound itself
|
|
10
|
+
* (`packages/notification-sound/`). The page must then NOT play its Web Audio
|
|
11
|
+
* cue: the two arrive for the same event within a few hundred milliseconds, and
|
|
12
|
+
* hearing the same chime twice is the bug this module exists to prevent.
|
|
13
|
+
*
|
|
14
|
+
* A browser — desktop Chrome, an installed PWA — has no sound slot on its
|
|
15
|
+
* `Notification`, so the page keeps playing the cue there. That is the whole
|
|
16
|
+
* rule: the sound follows whoever can carry it, exactly once.
|
|
17
|
+
*
|
|
18
|
+
* Three conditions, all required:
|
|
19
|
+
*
|
|
20
|
+
* - a shell bridge, because only a shell can put a sound in a notification;
|
|
21
|
+
* - the platform master ON for this device class, because a silenced shell posts
|
|
22
|
+
* no banner — and then the page's cue is the only sound there is;
|
|
23
|
+
* - the event switch ON, because the server does not even record a silenced
|
|
24
|
+
* event, so no banner (and no chime) would arrive.
|
|
25
|
+
*
|
|
26
|
+
* The event switches ship FALSE, which is why the page still plays its cue on a
|
|
27
|
+
* fresh install: nothing has been switched on, so nothing else is making sound.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { hasShellBridge } from '@/client/lib/shell/transport';
|
|
31
|
+
import { notificationPlatformForClient } from '@/client/lib/notifications/platform';
|
|
32
|
+
import {
|
|
33
|
+
isNotificationEnabled,
|
|
34
|
+
isNotificationPlatformEnabled,
|
|
35
|
+
type NotificationEvent,
|
|
36
|
+
} from '@/shared/lib/notifications/settings';
|
|
37
|
+
|
|
38
|
+
export function nativeBannerPlaysSound(
|
|
39
|
+
event: NotificationEvent,
|
|
40
|
+
appSettings?: Record<string, any>,
|
|
41
|
+
): boolean {
|
|
42
|
+
if (typeof window === 'undefined') return false;
|
|
43
|
+
if (!hasShellBridge()) return false;
|
|
44
|
+
if (!isNotificationPlatformEnabled(notificationPlatformForClient(), appSettings)) return false;
|
|
45
|
+
return isNotificationEnabled(event, appSettings);
|
|
46
|
+
}
|
|
@@ -37,7 +37,7 @@ describe('a browser without the Notification API', () => {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
test('drops the banner instead of throwing', async () => {
|
|
40
|
-
await expect(showOsNotification({ title: 'Kabmo', body: 'Done.' })).resolves.toBeUndefined();
|
|
40
|
+
await expect(showOsNotification({ title: 'Kabmo', body: 'Done.', kind: 'finish' })).resolves.toBeUndefined();
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -65,6 +65,7 @@ describe('inside a Kabmo shell', () => {
|
|
|
65
65
|
await showOsNotification({
|
|
66
66
|
title: 'Fix the build',
|
|
67
67
|
body: 'Waiting for you.',
|
|
68
|
+
kind: 'ask',
|
|
68
69
|
tag: 'ask:s1',
|
|
69
70
|
sessionId: 's1',
|
|
70
71
|
});
|
|
@@ -73,7 +74,13 @@ describe('inside a Kabmo shell', () => {
|
|
|
73
74
|
{ method: 'notification_request', params: {} },
|
|
74
75
|
{
|
|
75
76
|
method: 'notification_show',
|
|
76
|
-
params: {
|
|
77
|
+
params: {
|
|
78
|
+
title: 'Fix the build',
|
|
79
|
+
body: 'Waiting for you.',
|
|
80
|
+
kind: 'ask',
|
|
81
|
+
tag: 'ask:s1',
|
|
82
|
+
sessionId: 's1',
|
|
83
|
+
},
|
|
77
84
|
},
|
|
78
85
|
]);
|
|
79
86
|
});
|
|
@@ -84,6 +91,7 @@ describe('inside a Kabmo shell', () => {
|
|
|
84
91
|
await showOsNotification({
|
|
85
92
|
title: 'Fix the build',
|
|
86
93
|
body: 'The run finished.',
|
|
94
|
+
kind: 'finish',
|
|
87
95
|
tag: 'finish:s1',
|
|
88
96
|
sessionId: 's1',
|
|
89
97
|
at: 1_763_000_000_000,
|
|
@@ -95,6 +103,7 @@ describe('inside a Kabmo shell', () => {
|
|
|
95
103
|
expect(calls[0]?.params).toEqual({
|
|
96
104
|
title: 'Fix the build',
|
|
97
105
|
body: 'The run finished.',
|
|
106
|
+
kind: 'finish',
|
|
98
107
|
tag: 'finish:s1',
|
|
99
108
|
sessionId: 's1',
|
|
100
109
|
when: '1763000000000',
|
|
@@ -104,10 +113,10 @@ describe('inside a Kabmo shell', () => {
|
|
|
104
113
|
|
|
105
114
|
test('an untagged notification does not send an empty tag', async () => {
|
|
106
115
|
const calls = installShell(() => null);
|
|
107
|
-
await showOsNotification({ title: 'Kabmo', body: 'Done.' });
|
|
116
|
+
await showOsNotification({ title: 'Kabmo', body: 'Done.', kind: 'finish' });
|
|
108
117
|
expect(calls[0]).toEqual({
|
|
109
118
|
method: 'notification_show',
|
|
110
|
-
params: { title: 'Kabmo', body: 'Done.' },
|
|
119
|
+
params: { title: 'Kabmo', body: 'Done.', kind: 'finish' },
|
|
111
120
|
});
|
|
112
121
|
});
|
|
113
122
|
|
|
@@ -115,6 +124,6 @@ describe('inside a Kabmo shell', () => {
|
|
|
115
124
|
window.__kabmoCall = () => Promise.reject(new Error('This shell does not support notification_request.'));
|
|
116
125
|
expect(await requestNotificationPermission()).toBe(false);
|
|
117
126
|
// The refusal must not escape as an unhandled rejection.
|
|
118
|
-
await expect(showOsNotification({ title: 'Kabmo', body: 'Done.' })).resolves.toBeUndefined();
|
|
127
|
+
await expect(showOsNotification({ title: 'Kabmo', body: 'Done.', kind: 'finish' })).resolves.toBeUndefined();
|
|
119
128
|
});
|
|
120
129
|
});
|
|
@@ -23,10 +23,17 @@
|
|
|
23
23
|
|
|
24
24
|
import { callShell, hasShellBridge } from '@/client/lib/shell/transport';
|
|
25
25
|
import { openSessionInUrl } from '@/client/lib/router/open-session';
|
|
26
|
+
import type { NotificationKind } from '@/shared/lib/notifications/events';
|
|
26
27
|
|
|
27
28
|
export interface OsNotification {
|
|
28
29
|
title: string;
|
|
29
30
|
body: string;
|
|
31
|
+
/**
|
|
32
|
+
* Which event this is. The shells play a different chime for `ask` (the
|
|
33
|
+
* console's "the agent is blocked on you" cue) than for `finish`/`error`; a
|
|
34
|
+
* browser's own notification has no sound slot, so it is ignored there.
|
|
35
|
+
*/
|
|
36
|
+
kind: NotificationKind;
|
|
30
37
|
/** Replaces an earlier notification for the same thing (a session, a run). */
|
|
31
38
|
tag?: string;
|
|
32
39
|
/** The session a click opens, when the event is about one. */
|
|
@@ -90,6 +97,7 @@ export async function showOsNotification(notification: OsNotification): Promise<
|
|
|
90
97
|
await callShell('notification_show', {
|
|
91
98
|
title: notification.title,
|
|
92
99
|
body: notification.body,
|
|
100
|
+
kind: notification.kind,
|
|
93
101
|
...(notification.tag ? { tag: notification.tag } : {}),
|
|
94
102
|
...(notification.sessionId ? { sessionId: notification.sessionId } : {}),
|
|
95
103
|
// The shells render what they can: Android puts `when` on the shade's
|
|
@@ -212,4 +212,14 @@ export const HARNESS_LAUNCH: Readonly<Partial<Record<HarnessId, HarnessLaunch>>>
|
|
|
212
212
|
install: 'curl -fsSL https://x.ai/cli/install.sh | bash',
|
|
213
213
|
note: 'native ACP (`grok agent stdio`); xAI models need `grok login` once. A custom model as a [model.<name>] table in ~/.grok/config.toml (base_url + api_key) runs WITHOUT an xAI login — measured on 1.0.77. Sessions advertise model + reasoning_effort options',
|
|
214
214
|
},
|
|
215
|
+
// Hermes Agent ships its ACP adapter in-tree (`acp_adapter/`), but the stock
|
|
216
|
+
// install does not include the `agent-client-protocol` dependency: the `acp`
|
|
217
|
+
// extra has to be synced once, and until then `hermes acp` is not a command.
|
|
218
|
+
// The adapter logs to stderr, so stdout stays reserved for JSON-RPC.
|
|
219
|
+
hermes: {
|
|
220
|
+
id: 'hermes',
|
|
221
|
+
command: ['hermes', 'acp'],
|
|
222
|
+
install: 'curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash # then: cd ~/.hermes/hermes-agent && python -c "import pm; pm.sync_venv([\'acp\'], explicit=True)"',
|
|
223
|
+
note: 'native ACP (`hermes acp`); the `acp` extra must be synced once or the subcommand does not exist. Configure a provider with `hermes model` (or ~/.hermes/config.yaml / .env) before a turn succeeds; models are published as `provider:model`',
|
|
224
|
+
},
|
|
215
225
|
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reading the agent change journal behind the chat's per-run file list.
|
|
8
|
+
*
|
|
9
|
+
* The journal is a document omp writes, not one Kabmo wrote, so the tests pin
|
|
10
|
+
* the two things a wrong read would break: the display path (a file outside the
|
|
11
|
+
* session cwd must not be shown as `../…`) and the net change of a run (the
|
|
12
|
+
* first record's `before` to the last record's `after`, not one write's pair).
|
|
13
|
+
* The session dir is redirected through `PI_CODING_AGENT_DIR`, the same seam
|
|
14
|
+
* the artifact tests use.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
|
|
18
|
+
import * as fsp from 'node:fs/promises';
|
|
19
|
+
import * as os from 'node:os';
|
|
20
|
+
import * as path from 'node:path';
|
|
21
|
+
import { readSessionChangeDiff, readSessionChangeIndex } from '@/server/lib/omp/session/changes';
|
|
22
|
+
import { clearSessionFileCaches } from '@/server/lib/omp/session/files';
|
|
23
|
+
|
|
24
|
+
const SESSION_ID = '01a0cc50-fd62-7417-899c-e24ff8c8608c';
|
|
25
|
+
const CWD = '/tmp/project';
|
|
26
|
+
let agentDir = '';
|
|
27
|
+
let sessionFile = '';
|
|
28
|
+
let journalDir = '';
|
|
29
|
+
|
|
30
|
+
/** Write a gzip blob under the journal's `blobs/` and return its key. */
|
|
31
|
+
async function blob(key: string, text: string): Promise<string> {
|
|
32
|
+
await fsp.mkdir(path.join(journalDir, 'blobs'), { recursive: true });
|
|
33
|
+
await fsp.writeFile(path.join(journalDir, 'blobs', key), Bun.gzipSync(Buffer.from(text, 'utf8')));
|
|
34
|
+
return key;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function append(record: Record<string, unknown>): Promise<void> {
|
|
38
|
+
await fsp.appendFile(path.join(journalDir, 'changes.jsonl'), `${JSON.stringify(record)}\n`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
beforeAll(async () => {
|
|
42
|
+
agentDir = await fsp.mkdtemp(path.join(os.tmpdir(), 'omp-changes-test-'));
|
|
43
|
+
process.env.PI_CODING_AGENT_DIR = agentDir;
|
|
44
|
+
const cwdDir = path.join(agentDir, 'sessions', '-tmp-project');
|
|
45
|
+
await fsp.mkdir(cwdDir, { recursive: true });
|
|
46
|
+
sessionFile = path.join(cwdDir, `2026-01-01T00-00-00-000Z_${SESSION_ID}.jsonl`);
|
|
47
|
+
await fsp.writeFile(
|
|
48
|
+
sessionFile,
|
|
49
|
+
`${JSON.stringify({ type: 'session', version: 3, id: SESSION_ID, timestamp: '2026-01-01T00:00:00.000Z', cwd: CWD })}\n`,
|
|
50
|
+
);
|
|
51
|
+
journalDir = sessionFile.slice(0, -'.jsonl'.length);
|
|
52
|
+
await fsp.mkdir(journalDir, { recursive: true });
|
|
53
|
+
clearSessionFileCaches();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
afterAll(async () => {
|
|
57
|
+
delete process.env.PI_CODING_AGENT_DIR;
|
|
58
|
+
clearSessionFileCaches();
|
|
59
|
+
await fsp.rm(agentDir, { recursive: true, force: true });
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
describe('readSessionChangeIndex', () => {
|
|
63
|
+
test('a session with no journal answers an empty list', async () => {
|
|
64
|
+
expect(await readSessionChangeIndex(SESSION_ID)).toEqual([]);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('resolves a display path inside the cwd and keeps an outside path absolute', async () => {
|
|
68
|
+
const inside = await blob('a1', 'one\n');
|
|
69
|
+
const outside = await blob('a2', 'two\n');
|
|
70
|
+
await append({ type: 'change', at: 1000, agent: 'Main', tool: 'edit', path: `${CWD}/src/a.ts`, before: null, after: inside });
|
|
71
|
+
await append({ type: 'change', at: 1001, agent: 'Main', tool: 'edit', path: '/elsewhere/b.ts', before: null, after: outside });
|
|
72
|
+
// A `call` record is not a file change and must not reach the list.
|
|
73
|
+
await append({ type: 'call', agent: 'Main', tool: 'bash', start: 1002, end: 1003, label: 'bun test' });
|
|
74
|
+
|
|
75
|
+
const records = await readSessionChangeIndex(SESSION_ID);
|
|
76
|
+
expect(records.map((record) => record.displayPath)).toEqual(['src/a.ts', '/elsewhere/b.ts']);
|
|
77
|
+
expect(records[0]?.before).toBeNull();
|
|
78
|
+
expect(records[0]?.after).toBe(inside);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('a torn final line is skipped, not fatal', async () => {
|
|
82
|
+
await fsp.appendFile(path.join(journalDir, 'changes.jsonl'), '{"type":"change","at":\n');
|
|
83
|
+
const records = await readSessionChangeIndex(SESSION_ID);
|
|
84
|
+
expect(records.length).toBe(2);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('a Windows-style separator in the journal path is shown with forward slashes', async () => {
|
|
88
|
+
const after = await blob('a3', 'three\n');
|
|
89
|
+
await append({ type: 'change', at: 1004, agent: 'Main', tool: 'edit', path: `${CWD}/src\\win.ts`, before: null, after });
|
|
90
|
+
|
|
91
|
+
const records = await readSessionChangeIndex(SESSION_ID);
|
|
92
|
+
expect(records.at(-1)?.displayPath).toBe('src/win.ts');
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
describe('readSessionChangeDiff', () => {
|
|
97
|
+
test('returns the net change of a run: first before to last after', async () => {
|
|
98
|
+
const before = await blob('b1', 'line one\nline two\n');
|
|
99
|
+
const middle = await blob('b2', 'line one\nline TWO\n');
|
|
100
|
+
const after = await blob('b3', 'line one\nline TWO\nline three\n');
|
|
101
|
+
const file = `${CWD}/src/net.ts`;
|
|
102
|
+
await append({ type: 'change', at: 2000, agent: 'Main', tool: 'edit', path: file, before, after: middle });
|
|
103
|
+
await append({ type: 'change', at: 2001, agent: 'Main', tool: 'edit', path: file, before: middle, after });
|
|
104
|
+
|
|
105
|
+
const diff = await readSessionChangeDiff(SESSION_ID, file, 2000, 2001);
|
|
106
|
+
expect(diff?.status).toBe('modified');
|
|
107
|
+
expect(diff?.oldContent).toBe('line one\nline two\n');
|
|
108
|
+
expect(diff?.newContent).toBe('line one\nline TWO\nline three\n');
|
|
109
|
+
expect(diff?.diff).toContain('+line three');
|
|
110
|
+
expect(diff?.unavailable).toBe(false);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test('a created file is added, a deleted file is deleted', async () => {
|
|
114
|
+
const created = await blob('c1', 'new\n');
|
|
115
|
+
const addedPath = `${CWD}/src/added.ts`;
|
|
116
|
+
await append({ type: 'change', at: 3000, agent: 'Main', tool: 'write', path: addedPath, before: null, after: created });
|
|
117
|
+
const added = await readSessionChangeDiff(SESSION_ID, addedPath, 3000, 3000);
|
|
118
|
+
expect(added?.status).toBe('added');
|
|
119
|
+
expect(added?.oldContent).toBe('');
|
|
120
|
+
|
|
121
|
+
const deletedPath = `${CWD}/src/deleted.ts`;
|
|
122
|
+
await append({ type: 'change', at: 3001, agent: 'Main', tool: 'write', path: deletedPath, before: created, after: null });
|
|
123
|
+
const deleted = await readSessionChangeDiff(SESSION_ID, deletedPath, 3001, 3001);
|
|
124
|
+
expect(deleted?.status).toBe('deleted');
|
|
125
|
+
expect(deleted?.newContent).toBe('');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('a blob that was not stored reports unavailable instead of an empty diff', async () => {
|
|
129
|
+
const file = `${CWD}/src/huge.ts`;
|
|
130
|
+
await append({ type: 'change', at: 4000, agent: 'Main', tool: 'write', path: file, before: undefined, after: undefined });
|
|
131
|
+
const diff = await readSessionChangeDiff(SESSION_ID, file, 4000, 4000);
|
|
132
|
+
expect(diff?.unavailable).toBe(true);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test('a path with no record in the range answers null', async () => {
|
|
136
|
+
expect(await readSessionChangeDiff(SESSION_ID, `${CWD}/src/net.ts`, 9000, 9001)).toBeNull();
|
|
137
|
+
});
|
|
138
|
+
});
|