@kabmo-labs/kabmo 0.40.0 → 0.42.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 +533 -517
- package/dist/client/static/js/{CsvGrid-j9nvnhq1.js → CsvGrid-20k047ht.js} +2 -2
- package/dist/client/static/js/{DocxView-87gnpm81.js → DocxView-qpvhfcmg.js} +5 -5
- package/dist/client/static/js/{DrawioView-a351t8f8.js → DrawioView-178skky8.js} +2 -2
- package/dist/client/static/js/ImageView-460th5qa.js +1 -0
- package/dist/client/static/js/LayoutWrapper-5cv0dty8.js +2 -0
- package/dist/client/static/js/Modal-wks6p4r5.js +38 -0
- package/dist/client/static/js/{PdfView-n6bwcvc8.js → PdfView-y51g03nr.js} +1 -1
- package/dist/client/static/js/SessionsView-rsmvn7ks.js +1 -0
- package/dist/client/static/js/{SheetView-k8ymr87w.js → SheetView-z7yvb05v.js} +25 -25
- package/dist/client/static/js/{SvgPreview-5pcp444e.js → SvgPreview-yehgzhem.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-psav75bx.js → abnfDiagram-O67JEVCF-6zxpcy8b.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-9q06651f.js +1 -0
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-m98sgh3c.js +36 -0
- package/dist/client/static/js/{astro-0rh34hha.js → astro-nn7xg0we.js} +1 -1
- package/dist/client/static/js/bash-fjzhxy10.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-17xsf182.js → blockDiagram-BEXU5L5S-cp7rervg.js} +5 -5
- package/dist/client/static/js/c-wqtyezvw.js +1 -0
- package/dist/client/static/js/c4Diagram-YGBWAQC7-t31recqm.js +38 -0
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-663z1g1r.js → classDiagram-v2-NBCMYWYE-fy8x3dkx.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-vp4yvx8x.js → cose-bilkent-JH36ORCC-va7ybm9e.js} +1 -1
- package/dist/client/static/js/cpp-y0nzwner.js +1 -0
- package/dist/client/static/js/css-a13jmmnc.js +1 -0
- package/dist/client/static/js/css-n2waj098.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-w7a38g4g.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-dagkrjbh.js → cynefinDiagram-VND7K2PF-4k0k429c.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-8qgwpb5a.js → dagre-6A5THRUB-ykdhxq6t.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-671xtp0d.js → diagram-22UHCM2B-5nvwx7b6.js} +8 -8
- package/dist/client/static/js/{diagram-3UASUU5V-8nn5fha8.js → diagram-3UASUU5V-hc7zsjgw.js} +1 -1
- package/dist/client/static/js/diagram-ATOU4E4O-97ae07y7.js +3 -0
- package/dist/client/static/js/diagram-CDSNMT55-b56nnbbs.js +30 -0
- package/dist/client/static/js/{diagram-MLGK6HIB-tp6dwxdb.js → diagram-MLGK6HIB-37rygr9k.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-qgx8c8ee.js → diagram-MPIPVDR6-wv3vhhfk.js} +2 -2
- package/dist/client/static/js/{dockerfile-hk0s4qaw.js → dockerfile-0efb1z6e.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-nmf9r33z.js → ebnfDiagram-ZINNZB2B-13fv7vxg.js} +1 -1
- package/dist/client/static/js/{elixir-gpez1k9m.js → elixir-mabagxwa.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-dheh5ngz.js → elk-276RUBZZ-xam60ktz.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-8837mk18.js → erDiagram-OPXOYQCR-24ctv2ee.js} +6 -6
- package/dist/client/static/js/{erlang-w9gmf866.js → erlang-zwy7cqdk.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-6wrjccyw.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-19vjkg84.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-g68mvnje.js → ganttDiagram-FUAMR5RP-766a8fqw.js} +2 -2
- package/dist/client/static/js/gitGraph-4MIJSDKK-4je2p50v.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ymk81cdj.js → gitGraphDiagram-X574FWY7-fmwjkgh6.js} +2 -2
- package/dist/client/static/js/graphql-gvb7e2eb.js +1 -0
- package/dist/client/static/js/html-bwyt0ayy.js +1 -0
- package/dist/client/static/js/{index-rc8wrs2a.js → index-03pyvmcz.js} +2 -2
- package/dist/client/static/js/index-13dr1t1r.js +314 -0
- package/dist/client/static/js/{index-mxpgfj6p.js → index-13xbwcbz.js} +2 -2
- package/dist/client/static/js/{index-4j5jwb54.js → index-1c0pnsjd.js} +2 -2
- package/dist/client/static/js/index-1rxa9zxp.js +1 -0
- package/dist/client/static/js/{index-aznkfx1z.js → index-2hpy58d0.js} +2 -2
- package/dist/client/static/js/{index-4j1g7m8g.js → index-2x9eqztp.js} +1 -1
- package/dist/client/static/js/{index-vv9ytx0t.js → index-4cncqz8j.js} +2 -2
- package/dist/client/static/js/index-4j8rgr4p.js +1 -0
- package/dist/client/static/js/{index-pp6mss9b.js → index-4mstdh41.js} +3 -3
- package/dist/client/static/js/index-4z4ax55k.js +12 -0
- package/dist/client/static/js/{index-q1bqg4f6.js → index-6ge6gk9w.js} +1 -1
- package/dist/client/static/js/{index-c003wb3r.js → index-7t63akyt.js} +1 -1
- package/dist/client/static/js/{index-ys4t1am4.js → index-8b3t2y77.js} +2 -2
- package/dist/client/static/js/index-8hgm0abr.js +474 -0
- package/dist/client/static/js/index-8jqawh3r.js +2 -0
- package/dist/client/static/js/index-95en3p3g.js +9 -0
- package/dist/client/static/js/{index-dj7y2df7.js → index-97qst4k9.js} +2 -2
- package/dist/client/static/js/{index-018ehs1n.js → index-9vdbnvmk.js} +1 -1
- package/dist/client/static/js/{index-harsfp4x.js → index-a9t9gdew.js} +9 -9
- package/dist/client/static/js/{index-8888hgj8.js → index-b4y5g48d.js} +5 -5
- package/dist/client/static/js/{index-gx2xefdg.js → index-czagykbq.js} +2 -2
- package/dist/client/static/js/{index-r1fe56cn.js → index-dfqmwm7j.js} +2 -2
- package/dist/client/static/js/{index-cccrappc.js → index-dydwcp3n.js} +2 -2
- package/dist/client/static/js/{index-jy91r3ap.js → index-e1yz59fa.js} +2 -2
- package/dist/client/static/js/{index-ce4vytm6.js → index-e6any867.js} +2 -2
- package/dist/client/static/js/{index-wy05jt00.js → index-ejdnjh5c.js} +2 -2
- package/dist/client/static/js/index-f4vr1c6e.css +1 -0
- package/dist/client/static/js/{index-9wjnbb3q.js → index-feffxxss.js} +2 -2
- package/dist/client/static/js/{index-547h1b8j.js → index-grczkttn.js} +13 -13
- package/dist/client/static/js/{index-s78n0dtv.js → index-hga3e13s.js} +2 -2
- package/dist/client/static/js/{index-d1vearmk.js → index-hw14rhen.js} +2 -2
- package/dist/client/static/js/index-hzwr5fm9.js +4 -0
- package/dist/client/static/js/{index-sj4y8kj2.js → index-j17h4z6f.js} +2 -2
- package/dist/client/static/js/{index-y5hxhr7q.js → index-ka2rc2cr.js} +5 -5
- package/dist/client/static/js/{index-b612vske.js → index-ktbrmp29.js} +2 -2
- package/dist/client/static/js/{index-ag78jnva.js → index-nbexks3x.js} +1 -1
- package/dist/client/static/js/{index-vwc8pdy3.js → index-nh29fkk9.js} +2 -2
- package/dist/client/static/js/{index-gn92c6hp.js → index-p0ez6hqd.js} +2 -2
- package/dist/client/static/js/{index-173x4bh0.js → index-pkes9492.js} +2 -2
- package/dist/client/static/js/{index-fg965t62.js → index-pysqpc5n.js} +2 -2
- package/dist/client/static/js/index-qj34r6d0.js +1 -0
- package/dist/client/static/js/{index-ek4gwrm8.js → index-qx6x4z0y.js} +2 -2
- package/dist/client/static/js/{index-agdbjh5k.js → index-r8cc80w5.js} +2 -2
- package/dist/client/static/js/{index-2kg3r5jw.js → index-rab39785.js} +2 -2
- package/dist/client/static/js/{index-haaz8t7e.js → index-sk9ej289.js} +2 -2
- package/dist/client/static/js/{index-8ggxxp8c.js → index-sq3r1xhf.js} +2 -2
- package/dist/client/static/js/{index-wsqgp9jw.js → index-sx809d6d.js} +2 -2
- package/dist/client/static/js/{index-p2812ygk.js → index-sz3mxjvy.js} +1 -1
- package/dist/client/static/js/{index-69xe17c1.js → index-tqycj126.js} +2 -2
- package/dist/client/static/js/{index-js81yrmy.js → index-vcn1kcpy.js} +3 -3
- package/dist/client/static/js/{index-rvjc19x7.js → index-x7f5ysch.js} +2 -2
- package/dist/client/static/js/index-xe5cqwnf.js +1 -0
- package/dist/client/static/js/index-xxe52zrm.js +2 -0
- package/dist/client/static/js/{index-ek7hqfp0.js → index-yvxa7hd8.js} +2 -2
- package/dist/client/static/js/{index-qw5aqk2d.js → index-z6kpc98a.js} +1 -1
- package/dist/client/static/js/{index-yzg9mbsv.js → index-zjydzxhm.js} +1 -1
- package/dist/client/static/js/{index-6wtx7a9x.js → index-zvazj4va.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-k0z5qdew.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-11trzn8c.js → infoDiagram-VRGFBTTK-tqytmzp1.js} +1 -1
- package/dist/client/static/js/ini-2gvjwh83.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-8xnnymb5.js → ishikawaDiagram-OU5B5YK6-rp77ff6m.js} +1 -1
- package/dist/client/static/js/java-1xwcq79s.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-wd47j0hy.js → journeyDiagram-ZHPQQLJL-c7bxrhf1.js} +2 -2
- package/dist/client/static/js/json-4pqjabgq.js +1 -0
- package/dist/client/static/js/jsx-wcsss15s.js +1 -0
- package/dist/client/static/js/{julia-c2q0vwpd.js → julia-2eekpjq8.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-s5rgcp44.js → kanban-definition-PNTS6WVX-j2pxewqq.js} +8 -8
- package/dist/client/static/js/lua-h7vjcn0h.js +1 -0
- package/dist/client/static/js/markdown-f30jjjh9.js +1 -0
- package/dist/client/static/js/{mermaid.core-9fxp8nt2.js → mermaid.core-cqqe1krg.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-4fyewtst.js → mindmap-definition-NLK3R4M7-s03k32p9.js} +9 -9
- package/dist/client/static/js/one-dark-pro-9tt0a020.js +1 -0
- package/dist/client/static/js/one-light-5fg4r0ra.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-6cnvmb2z.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-s2xe2e2k.js → pegDiagram-GJSIUBJH-dfg2j0zc.js} +1 -1
- package/dist/client/static/js/{perl-6pa0tn3b.js → perl-5vxax0nr.js} +1 -1
- package/dist/client/static/js/{php-1zy994pz.js → php-hgrgdq63.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-m9z1mztn.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-1szpjbzy.js → pieDiagram-5QR66LMP-pshd1j79.js} +1 -1
- package/dist/client/static/js/properties-ymexza6q.js +1 -0
- package/dist/client/static/js/python-31ycwa66.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-mv3ee2qa.js → quadrantDiagram-O4NWA36T-cvvvmtk2.js} +4 -4
- package/dist/client/static/js/r-t2nne4xp.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-8m9rkex6.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-wc55emj8.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2y2rnrzq.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-zzcc9x0v.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-z82na5nb.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-hgdqjpm9.js → railroadDiagram-XR7U4H2S-h53p3sha.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-yrfjp9wx.js → requirementDiagram-PLB6GJNP-bdv2fkxd.js} +4 -4
- package/dist/client/static/js/{ruby-arvs7kz4.js → ruby-8pxcn21w.js} +1 -1
- package/dist/client/static/js/{rust-3ahjk339.js → rust-j80dxgjg.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-k7k871xa.js → sankeyDiagram-IPEJSGJF-xqnnvmhy.js} +2 -2
- package/dist/client/static/js/{sass-cmkf7nwd.js → sass-bm32bb5k.js} +1 -1
- package/dist/client/static/js/{scss-x7ddw6gb.js → scss-e2dndbfa.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-gd80m0as.js → sequenceDiagram-PO4LG4MO-3p67305f.js} +10 -10
- package/dist/client/static/js/{sizeCapture-INFHLROL-jv6p4834.js → sizeCapture-INFHLROL-f87525h7.js} +1 -1
- package/dist/client/static/js/sql-bwnasywx.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-tvphxq2h.js → stateDiagram-v2-GCMORJYK-e5st1fy3.js} +6 -6
- package/dist/client/static/js/{svelte-0hv6pak2.js → svelte-ztkaww47.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-3dt7nxj2.js → swimlanes-2SLR337P-ceghkbez.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-vc8hvfya.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-40vvf856.js → timeline-definition-EJHVYXUP-f7evs443.js} +3 -3
- package/dist/client/static/js/treeView-Q6P3EWNA-kzh6cm3f.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-wz5ed560.js +1 -0
- package/dist/client/static/js/tsx-zfy727zs.js +1 -0
- package/dist/client/static/js/typescript-p3syh43m.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-g1j5x0xh.js → usecaseDiagram-POWQR4AR-0gpn21p7.js} +27 -27
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-5b8789qk.js → vennDiagram-UO4OBE2U-4spzy428.js} +3 -3
- package/dist/client/static/js/{vue-zccj3qa5.js → vue-xm1dxpmy.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-zewbfccz.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-c7x3za3w.js → wardleyDiagram-VNRHLVJA-745xr2pa.js} +4 -4
- package/dist/client/static/js/xml-4enq788a.js +1 -0
- package/dist/client/static/js/xychartDiagram-PMCCYNJV-7dr9qwx5.js +7 -0
- package/dist/client/static/js/yaml-pjtt3jsc.js +1 -0
- package/package.json +1 -1
- package/src/client/components/common/batch-selection/folder-state.ts +2 -2
- package/src/client/components/common/server-control/Panel.tsx +16 -5
- package/src/client/components/common/server-control/index.test.tsx +63 -9
- package/src/client/components/common/session-row/TrailingSlot.tsx +8 -0
- package/src/client/components/common/session-row/index.tsx +16 -9
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +7 -0
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +1 -1
- package/src/client/components/layout/session-sidebar/ClassicView.tsx +13 -0
- package/src/client/components/layout/session-sidebar/HarnessFilter.tsx +175 -0
- package/src/client/components/layout/session-sidebar/SessionList.tsx +9 -1
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +8 -1
- package/src/client/components/layout/session-sidebar/about-modal/index.test.tsx +1 -1
- package/src/client/components/layout/session-sidebar/harness-filter.test.tsx +173 -0
- package/src/client/components/layout/session-sidebar/modern/FilterChips.tsx +63 -18
- package/src/client/components/layout/session-sidebar/modern/SearchField.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +21 -12
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/index.tsx +11 -2
- package/src/client/components/layout/session-sidebar/modern/search-field.test.tsx +96 -0
- package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +3 -0
- package/src/client/components/layout/session-sidebar/variant-props.ts +7 -0
- package/src/client/components/mobile/SessionSidebar.tsx +14 -21
- package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +19 -0
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +1 -1
- package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +19 -19
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.image.test.ts +147 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +51 -83
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +44 -63
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ReadDirectory.tsx +72 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ReadImage.tsx +51 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/read-test-util.ts +91 -0
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.test.ts +80 -62
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.tsx +15 -33
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +1 -1
- package/src/client/components/workspace/terminal-panel/copy.test.ts +179 -0
- package/src/client/components/workspace/terminal-panel/copy.ts +76 -0
- package/src/client/components/workspace/terminal-panel/mount.ts +13 -0
- package/src/client/data/settings/omp-schema.json +39 -18
- package/src/client/hooks/chat/omp/pending-child.test.ts +1 -1
- package/src/client/hooks/chat/omp/session-sidebar-controller.test.ts +61 -0
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +37 -39
- package/src/client/hooks/chat/omp/sidebar-filter.ts +62 -0
- package/src/client/hooks/chat/timeline/session-changes.test.ts +85 -0
- package/src/client/hooks/chat/timeline/session-changes.ts +8 -5
- package/src/client/hooks/commands/use-command-runtime.ts +15 -0
- package/src/client/hooks/shell/servers.ts +60 -2
- 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/updates/mobile-flow.ts +56 -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/main.tsx +9 -0
- package/src/client/tailwind.css +58 -0
- 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/harness/acp/commands.test.ts +1 -0
- package/src/server/lib/harness/acp/commands.ts +12 -4
- package/src/server/lib/harness/acp/replay-transcript.ts +32 -13
- package/src/server/lib/harness/acp/session-transcript.server.test.ts +162 -0
- package/src/server/lib/harness/acp/session-transcript.server.ts +350 -0
- package/src/server/lib/harness/acp/session.ts +6 -1
- package/src/server/lib/harness/schema.server.ts +18 -0
- package/src/server/lib/harness/spawn.server.ts +14 -1
- package/src/server/lib/models/provider-icon-fetch.ts +2 -2
- package/src/server/lib/models/provider-icon-parse.test.ts +0 -12
- package/src/server/lib/models/provider-icon-parse.ts +0 -8
- package/src/server/lib/omp/rpc/frame-fold.test.ts +16 -1
- package/src/server/lib/omp/rpc/frame-fold.ts +17 -4
- package/src/server/lib/omp/session/blobs.server.test.ts +34 -0
- package/src/server/lib/omp/session/blobs.server.ts +8 -3
- package/src/server/lib/omp/session/delete.server.ts +4 -0
- package/src/server/lib/omp/session/sidebar-activity.server.test.ts +2 -1
- package/src/server/routes/agent/harness-command.test.ts +71 -0
- package/src/server/routes/agent/harness-command.ts +27 -13
- package/src/server/routes/chat/imported.ts +5 -2
- package/src/server/routes/chat/live-meta.ts +42 -0
- package/src/server/routes/chat/session.test.ts +110 -0
- package/src/server/routes/chat/session.ts +31 -34
- package/src/shared/lib/chat/transcript-rows.ts +22 -0
- package/src/shared/lib/commands/catalog.test.ts +36 -0
- package/src/shared/lib/commands/catalog.ts +16 -0
- package/src/shared/lib/fs/file-kind.test.ts +46 -3
- package/src/shared/lib/fs/file-kind.ts +40 -9
- package/src/shared/lib/omp/config/schema-releases.test.ts +29 -0
- package/src/shared/lib/updates/popup-state.ts +11 -0
- package/src/shared/lib/workspace/harness-filter.test.ts +89 -0
- package/src/shared/lib/workspace/harness-filter.ts +75 -0
- package/src/{client/lib → shared/lib/workspace}/session-tree.test.ts +1 -1
- package/src/shared/lib/workspace/session-visibility.test.ts +71 -0
- package/src/shared/lib/workspace/session-visibility.ts +48 -23
- package/src/shared/lib/workspace/sidebar-filter-row.test.ts +64 -23
- package/src/shared/lib/workspace/sidebar-filter-row.ts +89 -31
- package/dist/client/static/js/ImageView-c139r891.js +0 -1
- package/dist/client/static/js/LayoutWrapper-08axzr3a.js +0 -2
- package/dist/client/static/js/Modal-0weqfqvk.js +0 -38
- package/dist/client/static/js/SessionsView-awef8ehj.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-6rbq97t9.js +0 -1
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-9bk6ykn7.js +0 -36
- package/dist/client/static/js/bash-vv2ysp0a.js +0 -1
- package/dist/client/static/js/c-67jyc7sg.js +0 -1
- package/dist/client/static/js/c4Diagram-YGBWAQC7-jn9j4n04.js +0 -38
- package/dist/client/static/js/cpp-crfbnwv8.js +0 -1
- package/dist/client/static/js/css-983fbv00.js +0 -1
- package/dist/client/static/js/css-zj4qzw6r.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-zafxcz2k.js +0 -1
- package/dist/client/static/js/diagram-ATOU4E4O-dnar0ktg.js +0 -3
- package/dist/client/static/js/diagram-CDSNMT55-bt0fhk7n.js +0 -30
- package/dist/client/static/js/eventmodeling-NTZA5JFV-cq3dvz7e.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-spzh2jxq.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-epgk26pj.js +0 -1
- package/dist/client/static/js/graphql-dewsj5g1.js +0 -1
- package/dist/client/static/js/html-1cpe2xc8.js +0 -1
- package/dist/client/static/js/index-bdz08fe2.js +0 -12
- package/dist/client/static/js/index-bgpcf3mr.js +0 -1
- package/dist/client/static/js/index-bj3wn9je.js +0 -1
- package/dist/client/static/js/index-dhrp656p.js +0 -1
- package/dist/client/static/js/index-g10nr8m6.js +0 -9
- package/dist/client/static/js/index-j4ks5s41.js +0 -474
- package/dist/client/static/js/index-jqs23cc7.css +0 -1
- package/dist/client/static/js/index-qnt118mp.js +0 -2
- package/dist/client/static/js/index-qntpsp98.js +0 -2
- package/dist/client/static/js/index-w130cs7d.js +0 -1
- package/dist/client/static/js/index-wv36ddd5.js +0 -314
- package/dist/client/static/js/index-y82bk3hr.js +0 -4
- package/dist/client/static/js/info-A6RAGUB7-0an46pag.js +0 -1
- package/dist/client/static/js/ini-09e0scxh.js +0 -1
- package/dist/client/static/js/java-vnaesxzs.js +0 -1
- package/dist/client/static/js/json-g5ggnd94.js +0 -1
- package/dist/client/static/js/jsx-xz71aed4.js +0 -1
- package/dist/client/static/js/lua-e4wenyzt.js +0 -1
- package/dist/client/static/js/markdown-yv3p1p7m.js +0 -1
- package/dist/client/static/js/one-dark-pro-ahch85zb.js +0 -1
- package/dist/client/static/js/one-light-9706jgqt.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-5e397pav.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-0zzmzg64.js +0 -1
- package/dist/client/static/js/properties-0ag74bdj.js +0 -1
- package/dist/client/static/js/python-zsn5tdbj.js +0 -1
- package/dist/client/static/js/r-mwtqhnw3.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-mtar9742.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-d6a6j9fq.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-1257kd8x.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-v8b6qmas.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-jxpbx410.js +0 -1
- package/dist/client/static/js/sql-aczp05f2.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-aqnh1hhp.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-q3qr7ew7.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-zgbdydeq.js +0 -1
- package/dist/client/static/js/tsx-s1shkfg9.js +0 -1
- package/dist/client/static/js/typescript-htx9v6bf.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-b230aajh.js +0 -1
- package/dist/client/static/js/xml-23y6pgvx.js +0 -1
- package/dist/client/static/js/xychartDiagram-PMCCYNJV-h0fy45tg.js +0 -7
- package/dist/client/static/js/yaml-vrayja34.js +0 -1
- /package/src/{client/lib → shared/lib/workspace}/session-tree.ts +0 -0
|
@@ -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);
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
* from the frame in place right after the raw listeners return.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
import path from 'node:path';
|
|
32
31
|
import { isRecord } from '@/shared/lib/util/guards';
|
|
33
32
|
import type { AgentEvent } from '@/server/lib/omp/rpc/constants';
|
|
34
33
|
import { classifyCommand } from '@/server/lib/changes/classify-command';
|
|
@@ -48,7 +47,8 @@ import type {
|
|
|
48
47
|
ShellTrace,
|
|
49
48
|
} from '@/server/lib/changes/capture-types';
|
|
50
49
|
import { readHeadContent, takeScan, type GitScan } from '@/server/lib/changes/scan.server';
|
|
51
|
-
import { isBuildPath, isExcludedTempPath } from '@/server/lib/changes/temp-path';
|
|
50
|
+
import { isBuildPath, isExcludedTempPath, isInside } from '@/server/lib/changes/temp-path';
|
|
51
|
+
import { captureTargets } from '@/server/lib/changes/capture-targets';
|
|
52
52
|
import { reconstructEdit, resolveRacedWrite } from '@/server/lib/changes/capture-write.server';
|
|
53
53
|
import { MAX_BLOB_BYTES } from '@/server/lib/changes/blobs.server';
|
|
54
54
|
|
|
@@ -166,15 +166,20 @@ export class ChangeCapture {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
async #snapshotBefore(pending: PendingCall): Promise<void> {
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
// ACP agents name their shell tool `exec_command`, `shell`, or even the
|
|
170
|
+
// command itself; the `command` argument is the one stable signal.
|
|
171
|
+
const command = typeof pending.args.command === 'string' ? pending.args.command : '';
|
|
172
|
+
if (pending.tool === 'bash' || command) {
|
|
171
173
|
pending.command = command;
|
|
172
|
-
pending.
|
|
174
|
+
const commandCwd = typeof pending.args.cwd === 'string' && isInside(pending.args.cwd, this.deps.cwd)
|
|
175
|
+
? pending.args.cwd
|
|
176
|
+
: this.deps.cwd;
|
|
177
|
+
pending.plan = classifyCommand(command, commandCwd, this.deps.home);
|
|
173
178
|
if (pending.plan.scan) {
|
|
174
179
|
pending.scan = await this.#takeScan(this.deps.cwd);
|
|
175
180
|
}
|
|
176
181
|
}
|
|
177
|
-
for (const absolute of
|
|
182
|
+
for (const absolute of captureTargets(pending, this.deps.cwd)) {
|
|
178
183
|
if (pending.before.has(absolute)) continue;
|
|
179
184
|
const info = await this.#statFile(absolute);
|
|
180
185
|
const text = await this.#readCapped(absolute);
|
|
@@ -182,27 +187,6 @@ export class ChangeCapture {
|
|
|
182
187
|
}
|
|
183
188
|
}
|
|
184
189
|
|
|
185
|
-
#targets(pending: PendingCall): string[] {
|
|
186
|
-
if (pending.tool === 'bash') {
|
|
187
|
-
const paths: string[] = [];
|
|
188
|
-
for (const mutation of pending.plan?.mutations ?? []) {
|
|
189
|
-
paths.push(mutation.path);
|
|
190
|
-
if (mutation.from) paths.push(mutation.from);
|
|
191
|
-
}
|
|
192
|
-
return paths;
|
|
193
|
-
}
|
|
194
|
-
const args = pending.args;
|
|
195
|
-
const raw: unknown[] = [args.path, args.file_path, args.moveTo, args.destination];
|
|
196
|
-
if (Array.isArray(args.paths)) raw.push(...args.paths);
|
|
197
|
-
if (Array.isArray(args.files)) raw.push(...args.files);
|
|
198
|
-
const paths: string[] = [];
|
|
199
|
-
for (const value of raw) {
|
|
200
|
-
if (typeof value !== 'string' || !value || value.includes('://')) continue;
|
|
201
|
-
paths.push(path.isAbsolute(value) ? path.normalize(value) : path.resolve(this.deps.cwd, value));
|
|
202
|
-
}
|
|
203
|
-
return paths;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
190
|
async #end(event: AgentEvent): Promise<void> {
|
|
207
191
|
const toolCallId = typeof event.toolCallId === 'string' ? event.toolCallId : '';
|
|
208
192
|
if (!toolCallId) return;
|
|
@@ -214,12 +198,13 @@ export class ChangeCapture {
|
|
|
214
198
|
// resumes later.
|
|
215
199
|
const trace = extractTrace(event);
|
|
216
200
|
await pending.ready;
|
|
217
|
-
|
|
201
|
+
const isShell = pending.tool === 'bash' || typeof pending.args.command === 'string';
|
|
202
|
+
if (isShell) await this.#endBash(pending, trace);
|
|
218
203
|
else await this.#endFileTool(pending);
|
|
219
204
|
}
|
|
220
205
|
|
|
221
206
|
async #endFileTool(pending: PendingCall): Promise<void> {
|
|
222
|
-
const targets =
|
|
207
|
+
const targets = captureTargets(pending, this.deps.cwd);
|
|
223
208
|
if (targets.length === 0) {
|
|
224
209
|
// A read-only tool (`read`, `glob`, `grep`) has no adapter and no
|
|
225
210
|
// mutation; only a tool whose NAME promises a write is worth a note.
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* The capture layer
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* command is a `note`, and a subagent's write is attributed to the child.
|
|
7
|
+
* The capture layer, at the tool adapter: an `edit`, a `write` and an
|
|
8
|
+
* `apply_patch` become journal records, an ACP agent's arg spellings are read,
|
|
9
|
+
* and a write under the OS temp dir or a build directory is not journaled.
|
|
10
|
+
* The shell half (trace, scan, subagents) is `capture-shell.test.ts`.
|
|
12
11
|
*
|
|
13
12
|
* The fake filesystem is a `Map`, so the before/after pair is deterministic:
|
|
14
13
|
* `flush()` after the start frame proves the snapshot ran before the test
|
|
@@ -21,7 +20,6 @@ import * as fsp from 'node:fs/promises';
|
|
|
21
20
|
import * as os from 'node:os';
|
|
22
21
|
import * as path from 'node:path';
|
|
23
22
|
import { makeCapture, records, REPO } from '@/server/lib/changes/capture-test-util';
|
|
24
|
-
import { ChangeJournal } from '@/server/lib/changes/journal.server';
|
|
25
23
|
import { readSessionChangeDiff } from '@/server/lib/changes/reader.server';
|
|
26
24
|
|
|
27
25
|
let dataDir = '';
|
|
@@ -135,199 +133,121 @@ describe('build paths', () => {
|
|
|
135
133
|
});
|
|
136
134
|
});
|
|
137
135
|
|
|
138
|
-
describe('
|
|
139
|
-
test('
|
|
140
|
-
const files = new Map([[at('
|
|
141
|
-
const capture = makeCapture('cap-
|
|
136
|
+
describe('apply_patch', () => {
|
|
137
|
+
test('a patch names its paths and the change is recorded', async () => {
|
|
138
|
+
const files = new Map([[at('a.txt'), 'old']]);
|
|
139
|
+
const capture = makeCapture('cap-patch', files);
|
|
142
140
|
capture.onFrame({
|
|
143
141
|
type: 'tool_execution_start',
|
|
144
142
|
toolCallId: 'c1',
|
|
145
|
-
toolName: '
|
|
146
|
-
args: {
|
|
143
|
+
toolName: 'apply_patch',
|
|
144
|
+
args: { input: '*** Begin Patch\n*** Update File: a.txt\n@@\n-old\n+new\n*** End Patch' },
|
|
147
145
|
});
|
|
148
146
|
await capture.flush();
|
|
149
|
-
files.
|
|
150
|
-
capture.onFrame({
|
|
151
|
-
type: 'tool_execution_end',
|
|
152
|
-
toolCallId: 'c1',
|
|
153
|
-
toolName: 'bash',
|
|
154
|
-
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['rm', '-f', 'c.ts'], st: 0 }] }] } } },
|
|
155
|
-
});
|
|
147
|
+
files.set(at('a.txt'), 'new');
|
|
148
|
+
capture.onFrame({ type: 'tool_execution_end', toolCallId: 'c1', toolName: 'apply_patch' });
|
|
156
149
|
await capture.flush();
|
|
157
150
|
|
|
158
|
-
const
|
|
159
|
-
expect(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
test('sed -i is an update', async () => {
|
|
164
|
-
const files = new Map([[at('d.ts'), 'a']]);
|
|
165
|
-
const capture = makeCapture('cap-sed', files);
|
|
166
|
-
capture.onFrame({
|
|
167
|
-
type: 'tool_execution_start',
|
|
168
|
-
toolCallId: 'c1',
|
|
169
|
-
toolName: 'bash',
|
|
170
|
-
args: { command: "sed -i 's/a/b/' d.ts" },
|
|
171
|
-
});
|
|
172
|
-
await capture.flush();
|
|
173
|
-
files.set(at('d.ts'), 'b');
|
|
174
|
-
capture.onFrame({
|
|
175
|
-
type: 'tool_execution_end',
|
|
176
|
-
toolCallId: 'c1',
|
|
177
|
-
toolName: 'bash',
|
|
178
|
-
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['sed', '-i', 's/a/b/', 'd.ts'], st: 0 }] }] } } },
|
|
179
|
-
});
|
|
180
|
-
await capture.flush();
|
|
181
|
-
|
|
182
|
-
const diff = await readSessionChangeDiff('cap-sed', at('d.ts'), 0, WINDOW_END);
|
|
183
|
-
expect(diff?.status).toBe('modified');
|
|
184
|
-
expect(diff?.oldContent).toBe('a');
|
|
185
|
-
expect(diff?.newContent).toBe('b');
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
test('a redirect is a create the trace does not name', async () => {
|
|
189
|
-
const files = new Map<string, string>();
|
|
190
|
-
const capture = makeCapture('cap-redirect', files);
|
|
191
|
-
capture.onFrame({
|
|
192
|
-
type: 'tool_execution_start',
|
|
193
|
-
toolCallId: 'c1',
|
|
194
|
-
toolName: 'bash',
|
|
195
|
-
args: { command: 'echo hi > e.txt' },
|
|
196
|
-
});
|
|
197
|
-
await capture.flush();
|
|
198
|
-
files.set(at('e.txt'), 'hi\n');
|
|
199
|
-
capture.onFrame({
|
|
200
|
-
type: 'tool_execution_end',
|
|
201
|
-
toolCallId: 'c1',
|
|
202
|
-
toolName: 'bash',
|
|
203
|
-
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['echo', 'hi'], st: 0 }] }] } } },
|
|
204
|
-
});
|
|
205
|
-
await capture.flush();
|
|
206
|
-
|
|
207
|
-
const diff = await readSessionChangeDiff('cap-redirect', at('e.txt'), 0, WINDOW_END);
|
|
208
|
-
expect(diff?.status).toBe('added');
|
|
209
|
-
expect(diff?.newContent).toBe('hi\n');
|
|
151
|
+
const change = (await records('cap-patch')).find((line) => line.type === 'change');
|
|
152
|
+
expect(change?.type).toBe('change');
|
|
153
|
+
if (change?.type !== 'change') throw new Error('expected a change');
|
|
154
|
+
expect(change.op).toBe('update');
|
|
155
|
+
expect(change.path).toBe(at('a.txt'));
|
|
210
156
|
});
|
|
157
|
+
});
|
|
211
158
|
|
|
212
|
-
|
|
159
|
+
describe('ACP shell tools', () => {
|
|
160
|
+
test('exec_command with a command is captured as a shell call', async () => {
|
|
213
161
|
const files = new Map<string, string>();
|
|
214
|
-
const capture = makeCapture('cap-
|
|
162
|
+
const capture = makeCapture('cap-acp-exec', files);
|
|
215
163
|
capture.onFrame({
|
|
216
164
|
type: 'tool_execution_start',
|
|
217
165
|
toolCallId: 'c1',
|
|
218
|
-
toolName: '
|
|
219
|
-
args: { command: '
|
|
166
|
+
toolName: 'exec_command',
|
|
167
|
+
args: { command: 'printf hello > a.txt', cwd: REPO },
|
|
220
168
|
});
|
|
221
169
|
await capture.flush();
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
toolCallId: 'c1',
|
|
225
|
-
toolName: 'bash',
|
|
226
|
-
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['bun', 'test'], st: 0 }] }] } } },
|
|
227
|
-
});
|
|
170
|
+
files.set(at('a.txt'), 'hello');
|
|
171
|
+
capture.onFrame({ type: 'tool_execution_end', toolCallId: 'c1', toolName: 'exec_command' });
|
|
228
172
|
await capture.flush();
|
|
229
173
|
|
|
230
|
-
const
|
|
231
|
-
expect(
|
|
232
|
-
|
|
233
|
-
expect(
|
|
234
|
-
|
|
235
|
-
expect(note.reason).toBe('opaque-command');
|
|
174
|
+
const change = (await records('cap-acp-exec')).find((line) => line.type === 'change');
|
|
175
|
+
expect(change?.type).toBe('change');
|
|
176
|
+
if (change?.type !== 'change') throw new Error('expected a change');
|
|
177
|
+
expect(change.op).toBe('create');
|
|
178
|
+
expect(change.path).toBe(at('a.txt'));
|
|
236
179
|
});
|
|
237
|
-
});
|
|
238
180
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const files = new Map([[at('g.ts'), 'old']]);
|
|
181
|
+
test('a shell tool named after the command is captured', async () => {
|
|
182
|
+
const files = new Map([[at('rm.txt'), 'hello']]);
|
|
242
183
|
const scans = [
|
|
243
|
-
{ root: REPO, dirty: new Map([[at('
|
|
244
|
-
{ root: REPO, dirty: new Map
|
|
184
|
+
{ root: REPO, dirty: new Map([[at('rm.txt'), 'hello']]), truncated: false },
|
|
185
|
+
{ root: REPO, dirty: new Map<string, string | null>(), truncated: false },
|
|
245
186
|
];
|
|
246
|
-
const capture = makeCapture('cap-
|
|
187
|
+
const capture = makeCapture('cap-acp-rm', files, {
|
|
247
188
|
takeScan: async () => scans.shift() ?? null,
|
|
248
189
|
readHead: async () => null,
|
|
249
190
|
});
|
|
250
191
|
capture.onFrame({
|
|
251
192
|
type: 'tool_execution_start',
|
|
252
193
|
toolCallId: 'c1',
|
|
253
|
-
toolName: '
|
|
254
|
-
args: { command: '
|
|
194
|
+
toolName: 'rm -f rm.txt',
|
|
195
|
+
args: { command: "/bin/zsh -lc 'rm -f rm.txt'", cwd: REPO },
|
|
255
196
|
});
|
|
256
197
|
await capture.flush();
|
|
257
|
-
files.
|
|
258
|
-
capture.onFrame({
|
|
259
|
-
type: 'tool_execution_end',
|
|
260
|
-
toolCallId: 'c1',
|
|
261
|
-
toolName: 'bash',
|
|
262
|
-
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['git', 'reset', '--hard'], st: 0 }] }] } } },
|
|
263
|
-
});
|
|
198
|
+
files.delete(at('rm.txt'));
|
|
199
|
+
capture.onFrame({ type: 'tool_execution_end', toolCallId: 'c1', toolName: 'rm -f rm.txt' });
|
|
264
200
|
await capture.flush();
|
|
265
201
|
|
|
266
|
-
const
|
|
267
|
-
expect(
|
|
268
|
-
|
|
269
|
-
expect(
|
|
202
|
+
const change = (await records('cap-acp-rm')).find((line) => line.type === 'change');
|
|
203
|
+
expect(change?.type).toBe('change');
|
|
204
|
+
if (change?.type !== 'change') throw new Error('expected a change');
|
|
205
|
+
expect(change.op).toBe('delete');
|
|
206
|
+
expect(change.path).toBe(at('rm.txt'));
|
|
270
207
|
});
|
|
271
208
|
});
|
|
272
209
|
|
|
273
|
-
describe('
|
|
274
|
-
test('a
|
|
275
|
-
const other = new ChangeJournal('cap-other', REPO);
|
|
276
|
-
await other.recordChange({
|
|
277
|
-
at: Date.now(), agent: 'Main', tool: 'edit', op: 'update', path: at('file4.txt'),
|
|
278
|
-
displayPath: 'file4.txt', before: 'a', after: 'b', source: 'tool',
|
|
279
|
-
});
|
|
280
|
-
await other.flush();
|
|
281
|
-
|
|
210
|
+
describe('ACP arg spellings', () => {
|
|
211
|
+
test('a write with filePath is recorded', async () => {
|
|
282
212
|
const files = new Map<string, string>();
|
|
283
|
-
const
|
|
284
|
-
{ root: REPO, dirty: new Map<string, string | null>(), truncated: false },
|
|
285
|
-
{ root: REPO, dirty: new Map([[at('file4.txt'), 'python']]), truncated: false },
|
|
286
|
-
];
|
|
287
|
-
const capture = makeCapture('cap-cross', files, {
|
|
288
|
-
takeScan: async () => scans.shift() ?? null,
|
|
289
|
-
readHead: async () => null,
|
|
290
|
-
});
|
|
213
|
+
const capture = makeCapture('cap-acp-write', files);
|
|
291
214
|
capture.onFrame({
|
|
292
215
|
type: 'tool_execution_start',
|
|
293
216
|
toolCallId: 'c1',
|
|
294
|
-
toolName: '
|
|
295
|
-
args: {
|
|
217
|
+
toolName: 'write',
|
|
218
|
+
args: { filePath: 'a.txt', content: 'hello' },
|
|
296
219
|
});
|
|
297
220
|
await capture.flush();
|
|
298
|
-
files.set(at('
|
|
299
|
-
capture.onFrame({
|
|
300
|
-
type: 'tool_execution_end',
|
|
301
|
-
toolCallId: 'c1',
|
|
302
|
-
toolName: 'bash',
|
|
303
|
-
result: { details: { trace: { status: 0, units: [{ nodes: [{ k: 'simple', argv: ['python3', '-'], st: 0 }] }] } } },
|
|
304
|
-
});
|
|
221
|
+
files.set(at('a.txt'), 'hello');
|
|
222
|
+
capture.onFrame({ type: 'tool_execution_end', toolCallId: 'c1', toolName: 'write' });
|
|
305
223
|
await capture.flush();
|
|
306
224
|
|
|
307
|
-
const
|
|
308
|
-
expect(
|
|
225
|
+
const change = (await records('cap-acp-write')).find((line) => line.type === 'change');
|
|
226
|
+
expect(change?.type).toBe('change');
|
|
227
|
+
if (change?.type !== 'change') throw new Error('expected a change');
|
|
228
|
+
expect(change.op).toBe('create');
|
|
229
|
+
expect(change.path).toBe(at('a.txt'));
|
|
309
230
|
});
|
|
310
|
-
});
|
|
311
231
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
const capture = makeCapture('cap-sub', files);
|
|
232
|
+
test('an edit with oldString/newString is reconstructed', async () => {
|
|
233
|
+
const files = new Map([[at('b.txt'), 'old']]);
|
|
234
|
+
const capture = makeCapture('cap-acp-edit', files);
|
|
316
235
|
capture.onFrame({
|
|
317
|
-
type: '
|
|
318
|
-
|
|
236
|
+
type: 'tool_execution_start',
|
|
237
|
+
toolCallId: 'c1',
|
|
238
|
+
toolName: 'edit',
|
|
239
|
+
args: { filePath: 'b.txt', oldString: 'old', newString: 'new' },
|
|
319
240
|
});
|
|
320
241
|
await capture.flush();
|
|
321
|
-
files.set(at('
|
|
322
|
-
capture.onFrame({
|
|
323
|
-
type: 'subagent_event',
|
|
324
|
-
payload: { type: 'tool_execution_end', toolCallId: 's1', toolName: 'edit', agent: 'Child' },
|
|
325
|
-
});
|
|
242
|
+
files.set(at('b.txt'), 'new');
|
|
243
|
+
capture.onFrame({ type: 'tool_execution_end', toolCallId: 'c1', toolName: 'edit' });
|
|
326
244
|
await capture.flush();
|
|
327
245
|
|
|
328
|
-
const change = (await records('cap-
|
|
246
|
+
const change = (await records('cap-acp-edit')).find((line) => line.type === 'change');
|
|
329
247
|
expect(change?.type).toBe('change');
|
|
330
248
|
if (change?.type !== 'change') throw new Error('expected a change');
|
|
331
|
-
expect(change.
|
|
249
|
+
expect(change.op).toBe('update');
|
|
250
|
+
expect(change.path).toBe(at('b.txt'));
|
|
332
251
|
});
|
|
333
252
|
});
|
|
253
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Paths named by an `apply_patch` payload.
|
|
8
|
+
*
|
|
9
|
+
* The codex/Claude patch tool sends the patch as text (`args.input`,
|
|
10
|
+
* `args.patch`, `args.patchText`), not as a path. The headers are the only
|
|
11
|
+
* place the paths appear:
|
|
12
|
+
*
|
|
13
|
+
* *** Begin Patch
|
|
14
|
+
* *** Update File: src/a.ts
|
|
15
|
+
* *** Add File: src/b.ts
|
|
16
|
+
* *** Delete File: src/c.ts
|
|
17
|
+
* *** Move to: src/d.ts
|
|
18
|
+
* *** End Patch
|
|
19
|
+
*
|
|
20
|
+
* A `Move to` names the destination; the source is the preceding `Update File`
|
|
21
|
+
* header, so both are returned and the capture snapshots both sides.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const FILE_HEADER = /^\*\*\* (?:Update|Add|Delete) File: (.+)$/;
|
|
25
|
+
const MOVE_HEADER = /^\*\*\* Move to: (.+)$/;
|
|
26
|
+
|
|
27
|
+
export function patchPaths(text: string): string[] {
|
|
28
|
+
const paths: string[] = [];
|
|
29
|
+
for (const line of text.split('\n')) {
|
|
30
|
+
const trimmed = line.trim();
|
|
31
|
+
const file = FILE_HEADER.exec(trimmed);
|
|
32
|
+
if (file?.[1]) paths.push(file[1].trim());
|
|
33
|
+
const move = MOVE_HEADER.exec(trimmed);
|
|
34
|
+
if (move?.[1]) paths.push(move[1].trim());
|
|
35
|
+
}
|
|
36
|
+
return paths;
|
|
37
|
+
}
|
|
@@ -46,6 +46,7 @@ function host(): AcpCommandHost & { writes: [string, string | boolean][]; access
|
|
|
46
46
|
isAlive: () => true,
|
|
47
47
|
destroyAndWait: async () => {},
|
|
48
48
|
steer: async () => ({}),
|
|
49
|
+
recordUserTurn: () => {},
|
|
49
50
|
cancelTurn: () => {},
|
|
50
51
|
setAccessMode: (mode) => {
|
|
51
52
|
accessModes.push(mode);
|
|
@@ -46,6 +46,8 @@ export interface AcpCommandHost {
|
|
|
46
46
|
isAlive(): boolean;
|
|
47
47
|
destroyAndWait(): Promise<void>;
|
|
48
48
|
steer(blocks: unknown[], queue: 'steering' | 'followUp'): Promise<unknown>;
|
|
49
|
+
/** Record a mid-turn user message in the session's own transcript. */
|
|
50
|
+
recordUserTurn(message: string, images: unknown): void;
|
|
49
51
|
cancelTurn(): void;
|
|
50
52
|
/** Adopt the composer's approval tier. ACP decides approvals in-process. */
|
|
51
53
|
setAccessMode(mode: ApprovalMode): void;
|
|
@@ -87,17 +89,23 @@ export interface AcpCommandHost {
|
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
case 'steer': {
|
|
90
|
-
const
|
|
92
|
+
const message = String(command.message ?? '');
|
|
93
|
+
const blocks = promptBlocks(message, command.images);
|
|
91
94
|
if (host.capabilities.steerMode !== 'steer') {
|
|
92
95
|
throw new Error(`This harness has no mid-turn steering (${host.harness})`);
|
|
93
96
|
}
|
|
94
|
-
|
|
97
|
+
const result = await host.steer(blocks, 'steering');
|
|
98
|
+
host.recordUserTurn(message, command.images);
|
|
99
|
+
return result;
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
case 'follow_up': {
|
|
98
|
-
const
|
|
103
|
+
const message = String(command.message ?? '');
|
|
104
|
+
const blocks = promptBlocks(message, command.images);
|
|
99
105
|
if (!host.capabilities.steerMode) throw new Error(`This harness cannot queue a follow-up (${host.harness})`);
|
|
100
|
-
|
|
106
|
+
const result = await host.steer(blocks, 'followUp');
|
|
107
|
+
host.recordUserTurn(message, command.images);
|
|
108
|
+
return result;
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
case 'abort':
|
|
@@ -24,12 +24,40 @@ import type { OmpMessageEntry } from '@/shared/lib/omp/session/messages-parse';
|
|
|
24
24
|
import type { ChatMessageData } from '@/shared/types/chat';
|
|
25
25
|
import type { AgentEvent } from '@/server/lib/omp/rpc/constants';
|
|
26
26
|
|
|
27
|
-
const
|
|
27
|
+
const MESSAGE_EVENT_TYPES: Record<string, true> = {
|
|
28
|
+
message_start: true,
|
|
29
|
+
message_update: true,
|
|
30
|
+
message_end: true,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* One frame's message as a timeline row, or null when it carries none.
|
|
35
|
+
*
|
|
36
|
+
* Shared by the replay reducer and the live recorder so a restored row and a
|
|
37
|
+
* recorded row are built by the same rule.
|
|
38
|
+
*/
|
|
39
|
+
export function chatMessageFromEvent(event: AgentEvent): ChatMessageData | null {
|
|
40
|
+
const message = event.message;
|
|
41
|
+
if (!message || typeof message !== 'object' || Array.isArray(message)) return null;
|
|
42
|
+
const record = message as Record<string, unknown>;
|
|
43
|
+
const id = typeof record.id === 'string' ? record.id : '';
|
|
44
|
+
if (!id) return null;
|
|
45
|
+
const timestamp = typeof record.timestamp === 'number' || typeof record.timestamp === 'string'
|
|
46
|
+
? record.timestamp
|
|
47
|
+
: undefined;
|
|
48
|
+
const entry = {
|
|
49
|
+
type: 'message',
|
|
50
|
+
id,
|
|
51
|
+
...(timestamp !== undefined ? { timestamp } : {}),
|
|
52
|
+
message: record,
|
|
53
|
+
} as unknown as OmpMessageEntry;
|
|
54
|
+
return toChatMessage(entry);
|
|
55
|
+
}
|
|
28
56
|
|
|
29
57
|
export function transcriptFromReplay(events: readonly AgentEvent[]): ChatMessageData[] {
|
|
30
58
|
const byId = new Map<string, Record<string, unknown>>();
|
|
31
59
|
for (const event of events) {
|
|
32
|
-
if (!
|
|
60
|
+
if (!MESSAGE_EVENT_TYPES[event.type]) continue;
|
|
33
61
|
const message = event.message;
|
|
34
62
|
if (!message || typeof message !== 'object' || Array.isArray(message)) continue;
|
|
35
63
|
const record = message as Record<string, unknown>;
|
|
@@ -38,17 +66,8 @@ export function transcriptFromReplay(events: readonly AgentEvent[]): ChatMessage
|
|
|
38
66
|
byId.set(id, record);
|
|
39
67
|
}
|
|
40
68
|
const out: ChatMessageData[] = [];
|
|
41
|
-
for (const
|
|
42
|
-
const
|
|
43
|
-
? message.timestamp
|
|
44
|
-
: undefined;
|
|
45
|
-
const entry = {
|
|
46
|
-
type: 'message',
|
|
47
|
-
id,
|
|
48
|
-
...(timestamp !== undefined ? { timestamp } : {}),
|
|
49
|
-
message,
|
|
50
|
-
} as unknown as OmpMessageEntry;
|
|
51
|
-
const converted = toChatMessage(entry);
|
|
69
|
+
for (const message of byId.values()) {
|
|
70
|
+
const converted = chatMessageFromEvent({ type: 'message_end', message });
|
|
52
71
|
if (converted) out.push(converted);
|
|
53
72
|
}
|
|
54
73
|
return out;
|