@kabmo-labs/kabmo 0.41.0 → 0.42.1
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 +647 -633
- package/dist/client/static/js/{CsvGrid-60njj97j.js → CsvGrid-8gdp5b49.js} +2 -2
- package/dist/client/static/js/{DocxView-rsv0j46a.js → DocxView-j9sphgra.js} +5 -5
- package/dist/client/static/js/{DrawioView-n2g5df3a.js → DrawioView-xsgjc7d8.js} +2 -2
- package/dist/client/static/js/ImageView-ve9hc519.js +1 -0
- package/dist/client/static/js/LayoutWrapper-5mqffvkc.js +2 -0
- package/dist/client/static/js/Modal-50whypff.js +38 -0
- package/dist/client/static/js/{PdfView-1r7a0qkp.js → PdfView-afd5cg54.js} +1 -1
- package/dist/client/static/js/SessionsView-7719nvy0.js +1 -0
- package/dist/client/static/js/{SheetView-bt5pp042.js → SheetView-gfzgxb4r.js} +25 -25
- package/dist/client/static/js/{SvgPreview-vfmqgmrx.js → SvgPreview-225pkb99.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-8k5hk1yx.js → abnfDiagram-O67JEVCF-z70sk69m.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +1 -0
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-pf1gpkje.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-04sbtdth.js → blockDiagram-BEXU5L5S-sr25kbn6.js} +6 -6
- package/dist/client/static/js/c-wqtyezvw.js +1 -0
- package/dist/client/static/js/c4Diagram-YGBWAQC7-znstpg86.js +38 -0
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-18cc0bsb.js → classDiagram-v2-NBCMYWYE-7n0pdcd8.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-dk683zvp.js → cose-bilkent-JH36ORCC-zn3qw4c4.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-6g2ydrss.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-m2sx8d8s.js → cynefinDiagram-VND7K2PF-3z41vtzs.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-qf3pr59p.js → dagre-6A5THRUB-5j3zn883.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-twnz23mt.js → diagram-22UHCM2B-ryw1w2kh.js} +10 -10
- package/dist/client/static/js/{diagram-3UASUU5V-417bas6t.js → diagram-3UASUU5V-p91q4gkh.js} +1 -1
- package/dist/client/static/js/diagram-ATOU4E4O-22dn73g4.js +3 -0
- package/dist/client/static/js/diagram-CDSNMT55-589p9n53.js +30 -0
- package/dist/client/static/js/{diagram-MLGK6HIB-7a0h1hs3.js → diagram-MLGK6HIB-ezw06wbx.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-w75bftmd.js → diagram-MPIPVDR6-cfwrsvk1.js} +2 -2
- package/dist/client/static/js/{dockerfile-g5qbaeq3.js → dockerfile-r4k7q34y.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-vdzm3tsv.js → ebnfDiagram-ZINNZB2B-3rv2wvbf.js} +1 -1
- package/dist/client/static/js/{elixir-gpez1k9m.js → elixir-szk51ehr.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-2fsbb484.js → elk-276RUBZZ-ma40kneq.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-vnkztq7d.js → erDiagram-OPXOYQCR-xwstsfqa.js} +6 -6
- package/dist/client/static/js/{erlang-jqqa3ehb.js → erlang-zwy7cqdk.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-evp84v09.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-pbvcch52.js → ganttDiagram-FUAMR5RP-qxyx9tr9.js} +2 -2
- package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-dkvktvzr.js → gitGraphDiagram-X574FWY7-v6sg7bkh.js} +2 -2
- package/dist/client/static/js/graphql-gvb7e2eb.js +1 -0
- package/dist/client/static/js/html-tbz83eke.js +1 -0
- package/dist/client/static/js/index-001vebsp.js +2 -0
- package/dist/client/static/js/{index-rc8wrs2a.js → index-03pyvmcz.js} +2 -2
- package/dist/client/static/js/index-0nca2nhp.js +1 -0
- package/dist/client/static/js/{index-3rymer2w.js → index-0p43qr4k.js} +1 -1
- package/dist/client/static/js/{index-amawahyh.js → index-2w9j2nj4.js} +2 -2
- package/dist/client/static/js/{index-f8pq132s.js → index-313ctswm.js} +1 -1
- package/dist/client/static/js/{index-a4ed3mks.js → index-3d40c0a7.js} +5 -5
- package/dist/client/static/js/{index-pn91shfp.js → index-4cncqz8j.js} +2 -2
- package/dist/client/static/js/{index-9fnzcg2x.js → index-4y0ayjfx.js} +2 -2
- package/dist/client/static/js/index-5599dngt.js +1 -0
- package/dist/client/static/js/index-5asf5625.js +4 -0
- package/dist/client/static/js/{index-tgper3yy.js → index-6dxs0tvg.js} +2 -2
- package/dist/client/static/js/{index-zfykeg7x.js → index-6eq445nn.js} +10 -10
- package/dist/client/static/js/index-869bpqcs.js +12 -0
- package/dist/client/static/js/{index-zye9309h.js → index-8b3t2y77.js} +2 -2
- package/dist/client/static/js/{index-rdqn92tc.js → index-8fvmyv7t.js} +2 -2
- package/dist/client/static/js/{index-0xaz2eyv.js → index-8pdz41yh.js} +3 -3
- package/dist/client/static/js/{index-ne131hmw.js → index-9hzfvjrb.js} +2 -2
- package/dist/client/static/js/{index-xfa5hswh.js → index-9ss64g4g.js} +1 -1
- package/dist/client/static/js/{index-yzg9mbsv.js → index-b0v6gwym.js} +2 -2
- package/dist/client/static/js/{index-j5ram1ve.js → index-b37ewyvk.js} +2 -2
- package/dist/client/static/js/{index-e6qjfcz9.js → index-b3d2k7ec.js} +1 -1
- package/dist/client/static/js/{index-6fx2t6y7.js → index-b42t14wk.js} +13 -13
- package/dist/client/static/js/{index-pbsm2vw7.js → index-cqaz1281.js} +2 -2
- package/dist/client/static/js/{index-pfbyfab5.js → index-df4yxfzd.js} +2 -2
- package/dist/client/static/js/{index-yq9vnd1y.js → index-dfqmwm7j.js} +2 -2
- package/dist/client/static/js/{index-0c6vpk89.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-f4vr1c6e.css +1 -0
- package/dist/client/static/js/{index-cytks03p.js → index-feffxxss.js} +2 -2
- package/dist/client/static/js/{index-c6kx7s6a.js → index-gsxebrq9.js} +2 -2
- package/dist/client/static/js/{index-s78n0dtv.js → index-hga3e13s.js} +2 -2
- package/dist/client/static/js/{index-ajjq0b8y.js → index-hw14rhen.js} +2 -2
- package/dist/client/static/js/{index-sj4y8kj2.js → index-j17h4z6f.js} +2 -2
- package/dist/client/static/js/{index-7w3gqw2b.js → index-kh6vp5w5.js} +1 -1
- package/dist/client/static/js/{index-djv15k5s.js → index-ktbrmp29.js} +2 -2
- package/dist/client/static/js/{index-2z9wrb46.js → index-mphhvgm9.js} +2 -2
- package/dist/client/static/js/{index-rebnv57p.js → index-mq6s2faf.js} +2 -2
- package/dist/client/static/js/index-mvykbyhe.js +1 -0
- package/dist/client/static/js/{index-ngk9h0v9.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-e7yf273s.js → index-pkes9492.js} +2 -2
- package/dist/client/static/js/{index-hz177dr2.js → index-pxtff3ez.js} +2 -2
- package/dist/client/static/js/{index-fg965t62.js → index-pysqpc5n.js} +2 -2
- package/dist/client/static/js/{index-4jk8ngjg.js → index-q3qpm7jn.js} +2 -2
- package/dist/client/static/js/{index-55hq7tnj.js → index-qh753ynv.js} +1 -1
- package/dist/client/static/js/{index-ntcqyqd5.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-9dnkfpx4.js → index-rab39785.js} +2 -2
- package/dist/client/static/js/index-rt6ac0kk.js +478 -0
- package/dist/client/static/js/{index-haaz8t7e.js → index-sk9ej289.js} +2 -2
- package/dist/client/static/js/{index-ds6a2cx7.js → index-sr7sdm2t.js} +5 -5
- package/dist/client/static/js/index-v5dbrq83.js +2 -0
- package/dist/client/static/js/index-w5q9ymf4.js +1 -0
- package/dist/client/static/js/{index-x2kb1kx5.js → index-x7a5jpvq.js} +3 -3
- package/dist/client/static/js/{index-re1xz433.js → index-x7m6dmt4.js} +1 -1
- package/dist/client/static/js/index-xsts4pqm.js +314 -0
- package/dist/client/static/js/index-y1p3bdsw.js +9 -0
- package/dist/client/static/js/info-A6RAGUB7-n495k952.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-mh6yks62.js → infoDiagram-VRGFBTTK-0anekyhb.js} +2 -2
- package/dist/client/static/js/ini-2gvjwh83.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-hnfqppnv.js → ishikawaDiagram-OU5B5YK6-zxpmfkjb.js} +2 -2
- package/dist/client/static/js/java-1xwcq79s.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-s4nv1f3q.js → journeyDiagram-ZHPQQLJL-1e86fzra.js} +3 -3
- 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-yre4bxb9.js → julia-2eekpjq8.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-t8kbfefp.js → kanban-definition-PNTS6WVX-e85hhmr1.js} +6 -6
- 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-0784021p.js → mermaid.core-jpcrnzyw.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-swkkze8c.js → mindmap-definition-NLK3R4M7-xwy5928e.js} +5 -5
- package/dist/client/static/js/one-dark-pro-r0tswz8r.js +1 -0
- package/dist/client/static/js/one-light-xzcfrptf.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-jqayzh7z.js → pegDiagram-GJSIUBJH-7dy6pw26.js} +1 -1
- package/dist/client/static/js/{perl-weeskn1v.js → perl-dtn1fccw.js} +1 -1
- package/dist/client/static/js/{php-vf3045p9.js → php-7av78hch.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-w03a65ky.js → pieDiagram-5QR66LMP-nrv2t5yn.js} +2 -2
- 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-2j7sfa9s.js → quadrantDiagram-O4NWA36T-3nt63xr8.js} +4 -4
- package/dist/client/static/js/r-t2nne4xp.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-jtkkgy34.js → railroadDiagram-XR7U4H2S-evm05hzp.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-t85ckjdb.js → requirementDiagram-PLB6GJNP-tzrcmktj.js} +4 -4
- package/dist/client/static/js/{ruby-1a2ryzy6.js → ruby-s2bqr910.js} +1 -1
- package/dist/client/static/js/{rust-736r0f0v.js → rust-pcvgybk3.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-5pfkw8ne.js → sankeyDiagram-IPEJSGJF-jvjd5rz8.js} +2 -2
- package/dist/client/static/js/{sass-tq4vw7hd.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-55vs9zv5.js → sequenceDiagram-PO4LG4MO-0zvjwx29.js} +10 -10
- package/dist/client/static/js/{sizeCapture-INFHLROL-pzqqd7f4.js → sizeCapture-INFHLROL-6t6g0edv.js} +1 -1
- package/dist/client/static/js/sql-bwnasywx.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-6nhrph8n.js → stateDiagram-v2-GCMORJYK-nb13b23a.js} +6 -6
- package/dist/client/static/js/{svelte-0hv6pak2.js → svelte-ztkaww47.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-6tcnxfbv.js → swimlanes-2SLR337P-ef8vmg6f.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-f4sx355z.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-1dz46nt5.js → timeline-definition-EJHVYXUP-3bfph698.js} +3 -3
- package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.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-b3jfveq6.js → usecaseDiagram-POWQR4AR-vj6yj6tc.js} +29 -29
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-dnc3jqvp.js → vennDiagram-UO4OBE2U-9xyyabaq.js} +2 -2
- package/dist/client/static/js/{vue-zccj3qa5.js → vue-cbqm4bed.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-466m8400.js → wardleyDiagram-VNRHLVJA-zpcwgv9d.js} +4 -4
- package/dist/client/static/js/xml-4enq788a.js +1 -0
- package/dist/client/static/js/xychartDiagram-PMCCYNJV-pdr2rms2.js +7 -0
- package/dist/client/static/js/yaml-pjtt3jsc.js +1 -0
- package/package.json +1 -1
- package/src/cli/lib/commands/session.js +12 -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/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 +6 -0
- 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 -25
- 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/MessageItem.tsx +14 -123
- package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +214 -0
- package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +126 -0
- package/src/client/components/workspace/chat-timeline/UserTurn.tsx +183 -0
- 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/composer-modes.ts +10 -7
- package/src/client/hooks/chat/timeline/plan-review-republish.test.ts +121 -0
- package/src/client/hooks/chat/timeline/plan-review.ts +12 -3
- 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/shell/servers.ts +60 -2
- package/src/client/hooks/ui/updates/mobile-flow.ts +56 -0
- package/src/client/tailwind.css +58 -0
- package/src/server/lib/harness/acp/acp-audit.server.ts +1 -1
- 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-exit.ts +39 -5
- 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-turns.ts +67 -12
- package/src/server/lib/harness/acp/session.test.ts +61 -0
- package/src/server/lib/harness/acp/session.ts +21 -26
- package/src/server/lib/harness/acp/turn-outcome.server.test.ts +97 -0
- package/src/server/lib/harness/acp/turn-outcome.server.ts +71 -0
- package/src/server/lib/harness/acp/turn-silence.ts +52 -0
- package/src/server/lib/harness/acp/turn.test.ts +85 -3
- package/src/server/lib/harness/acp/turn.ts +62 -4
- package/src/server/lib/harness/schema.server.ts +18 -0
- package/src/server/lib/harness/spawn.server.ts +14 -1
- package/src/server/lib/lifecycle/after-listen.ts +10 -0
- 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-contract.ts +21 -0
- package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +4 -0
- package/src/server/lib/omp/rpc/frame-fold.test.ts +16 -1
- package/src/server/lib/omp/rpc/frame-fold.ts +42 -6
- package/src/server/lib/omp/rpc/manager.ts +9 -8
- package/src/server/lib/omp/rpc/retry-saga.ts +54 -0
- package/src/server/lib/omp/rpc/run-settle.server.ts +38 -5
- package/src/server/lib/omp/rpc/run-settle.test.ts +5 -2
- package/src/server/lib/omp/rpc/session-commands-dialog.test.ts +6 -20
- package/src/server/lib/omp/rpc/session-commands-mapping.test.ts +131 -0
- package/src/server/lib/omp/rpc/session-commands.test.ts +95 -116
- package/src/server/lib/omp/rpc/session-commands.ts +38 -17
- package/src/server/lib/omp/rpc/terminal-settle.test.ts +223 -0
- package/src/server/lib/omp/rpc/terminal-settle.ts +127 -29
- 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/lib/sessions/notify.server.test.ts +11 -3
- package/src/server/lib/sessions/notify.server.ts +67 -42
- package/src/server/lib/sessions/spawn.server.test.ts +5 -1
- package/src/server/lib/sessions/spawn.server.ts +8 -3
- 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/server/routes/sessions/answer.test.ts +62 -0
- package/src/server/routes/sessions/answer.ts +13 -2
- package/src/shared/lib/chat/composer/delegation.ts +11 -7
- package/src/shared/lib/chat/export-markdown.ts +19 -0
- package/src/shared/lib/chat/orchestration/notice.test.ts +118 -0
- package/src/shared/lib/chat/orchestration/notice.ts +183 -0
- package/src/shared/lib/chat/timeline/omp-callbacks.ts +6 -1
- package/src/shared/lib/chat/transcript-rows.ts +22 -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/icons/tint-hues.generated.ts +36 -36
- package/src/shared/lib/omp/config/schema-releases.test.ts +29 -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-t330jx6y.js +0 -1
- package/dist/client/static/js/LayoutWrapper-qp6nsw65.js +0 -2
- package/dist/client/static/js/Modal-sbya4ahp.js +0 -38
- package/dist/client/static/js/SessionsView-yqs5m8tj.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-1wqga929.js +0 -1
- package/dist/client/static/js/architectureDiagram-NJMV4G6O-7jcb7fgy.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-vwac9za0.js +0 -38
- package/dist/client/static/js/cpp-crfbnwv8.js +0 -1
- package/dist/client/static/js/css-2re5mbea.js +0 -1
- package/dist/client/static/js/css-983fbv00.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-j2dpdgkh.js +0 -1
- package/dist/client/static/js/diagram-ATOU4E4O-n63cpdnx.js +0 -3
- package/dist/client/static/js/diagram-CDSNMT55-v86p14dd.js +0 -30
- package/dist/client/static/js/eventmodeling-NTZA5JFV-xjvjawd3.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-j21f2bfg.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-r0zbk95f.js +0 -1
- package/dist/client/static/js/graphql-npbd9fdx.js +0 -1
- package/dist/client/static/js/html-1cpe2xc8.js +0 -1
- package/dist/client/static/js/index-1sw00wm0.js +0 -2
- package/dist/client/static/js/index-7fwppdkn.js +0 -1
- package/dist/client/static/js/index-ae91g8ka.js +0 -9
- package/dist/client/static/js/index-b6cyn4hr.js +0 -314
- package/dist/client/static/js/index-efn233xp.js +0 -4
- package/dist/client/static/js/index-esx3zwnt.js +0 -1
- package/dist/client/static/js/index-fbbp5cwj.js +0 -2
- package/dist/client/static/js/index-g1cggqgx.js +0 -12
- package/dist/client/static/js/index-ghsdzs4m.js +0 -1
- package/dist/client/static/js/index-gs7ytgdw.js +0 -474
- package/dist/client/static/js/index-jqs23cc7.css +0 -1
- package/dist/client/static/js/index-qjsy6p86.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-a8xap43w.js +0 -1
- package/dist/client/static/js/ini-df5bw23e.js +0 -1
- package/dist/client/static/js/java-8j33rj1p.js +0 -1
- package/dist/client/static/js/json-g5ggnd94.js +0 -1
- package/dist/client/static/js/jsx-f6p72qpc.js +0 -1
- package/dist/client/static/js/lua-bahx6qze.js +0 -1
- package/dist/client/static/js/markdown-9dhg1fax.js +0 -1
- package/dist/client/static/js/one-dark-pro-h5tmw145.js +0 -1
- package/dist/client/static/js/one-light-x7vj1pxr.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-b5bvg6v1.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-77ee73zg.js +0 -1
- package/dist/client/static/js/properties-49mfnee4.js +0 -1
- package/dist/client/static/js/python-qb69wp1s.js +0 -1
- package/dist/client/static/js/r-s3mf2tch.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-cp79xtvb.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-dcpgqhcb.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-qasqv686.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-e46908rd.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-7009t6bk.js +0 -1
- package/dist/client/static/js/sql-aczp05f2.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-7xrkrkpa.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-tpn62q8j.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-w910f1g4.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-pt9tq808.js +0 -1
- package/dist/client/static/js/xml-wr1dxav5.js +0 -1
- package/dist/client/static/js/xychartDiagram-PMCCYNJV-kryrpqp1.js +0 -7
- package/dist/client/static/js/yaml-0y9fdskg.js +0 -1
- /package/src/{client/lib → shared/lib/workspace}/session-tree.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState } from 'preact/hooks';
|
|
2
|
-
import { FileCode, FileImage,
|
|
2
|
+
import { FileCode, FileImage, FolderOpen, Info, Loader2 } from 'lucide-preact';
|
|
3
3
|
import { getLanguageFromPath } from '@/shared/lib/code/language';
|
|
4
4
|
import { useDeferredHighlightLines } from '@/client/hooks/code/deferred-highlight';
|
|
5
5
|
import { parseDirListing, parseNumberedCode } from '@/shared/lib/code/parser';
|
|
6
|
-
import {
|
|
6
|
+
import { getPaintableImageMimeType, SVG_MIME } from '@/shared/lib/fs/file-kind';
|
|
7
7
|
import { buildFsRawUrl, isVirtualPath, stripReadSelector } from '@/shared/lib/fs/paths';
|
|
8
8
|
import { toolImageSrc } from '@/shared/lib/omp/session/tool-images';
|
|
9
9
|
import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
|
|
@@ -14,6 +14,8 @@ import { extractLineMeta } from '@/client/components/workspace/chat-timeline/too
|
|
|
14
14
|
import { ToolPanelHeader } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolPanelHeader';
|
|
15
15
|
import { NumberedCode } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/numbered-code';
|
|
16
16
|
import { getToolInputPath } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/tool-input';
|
|
17
|
+
import { ReadImage } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/ReadImage';
|
|
18
|
+
import { ReadDirectory } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/ReadDirectory';
|
|
17
19
|
import { isXdDocRead } from '@/client/components/workspace/chat-timeline/tool-renderers/registry';
|
|
18
20
|
|
|
19
21
|
interface ReadPanelProps {
|
|
@@ -56,12 +58,29 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
|
|
|
56
58
|
// over an output that is an error message. The failure renders as its own
|
|
57
59
|
// text instead.
|
|
58
60
|
const readFailed = tool?.status === 'error' || tool?.isError === true;
|
|
59
|
-
const
|
|
61
|
+
const pathImageMime = getPaintableImageMimeType(cleanFetchPath);
|
|
62
|
+
const isPathImage = !resultImage && !readFailed && pathImageMime !== null;
|
|
60
63
|
const isImage = Boolean(resultImage) || isPathImage;
|
|
61
64
|
const imageUrl = resultImage?.src ?? (isPathImage ? buildFsRawUrl({ path: cleanFetchPath }) : null);
|
|
65
|
+
/**
|
|
66
|
+
* An SVG read is the one picture the panel ALSO has text for: omp hands an
|
|
67
|
+
* `<svg>` back as source (it has no magic bytes, so the reader treats it as
|
|
68
|
+
* XML), and the file itself is a picture. So the preview is ADDED above the
|
|
69
|
+
* source instead of replacing it — the reader gets the rendering, and the
|
|
70
|
+
* markup the tool actually returned stays readable and copyable.
|
|
71
|
+
*/
|
|
72
|
+
const svgPreviewUrl = isPathImage && pathImageMime === SVG_MIME ? imageUrl : null;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* True when the card draws a picture and nothing else: a raster image (from
|
|
76
|
+
* the result's bytes or the path fallback) with no source text to show. An
|
|
77
|
+
* SVG is the exception — its preview sits above the markup — so the lazy text
|
|
78
|
+
* read still runs for it.
|
|
79
|
+
*/
|
|
80
|
+
const isPictureOnly = isImage && !svgPreviewUrl;
|
|
62
81
|
|
|
63
82
|
useEffect(() => {
|
|
64
|
-
if (cleanFetchPath && !virtualPath && !
|
|
83
|
+
if (cleanFetchPath && !virtualPath && !isPictureOnly && !output && lazyContent === null && !loadingFile) {
|
|
65
84
|
setLoadingFile(true);
|
|
66
85
|
fetch(`/api/fs/read?path=${encodeURIComponent(cleanFetchPath)}`)
|
|
67
86
|
.then(async (res) => {
|
|
@@ -85,7 +104,7 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
|
|
|
85
104
|
setLoadingFile(false);
|
|
86
105
|
});
|
|
87
106
|
}
|
|
88
|
-
}, [cleanFetchPath, virtualPath, output, lazyContent, loadingFile,
|
|
107
|
+
}, [cleanFetchPath, virtualPath, output, lazyContent, loadingFile, isPictureOnly]);
|
|
89
108
|
|
|
90
109
|
const details = (tool?.details ?? {}) as Record<string, any>;
|
|
91
110
|
/** omp's own display text: the rows it drew, WITHOUT the `1|` line-number
|
|
@@ -180,7 +199,15 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
|
|
|
180
199
|
// `xd://` device docs, whose payload is the same markdown behind a
|
|
181
200
|
// `text/plain` content type.
|
|
182
201
|
const isMarkdown = isDocRead && !isDir;
|
|
183
|
-
const kindLabel = isDir
|
|
202
|
+
const kindLabel = isDir
|
|
203
|
+
? 'Directory'
|
|
204
|
+
: svgPreviewUrl
|
|
205
|
+
? 'SVG'
|
|
206
|
+
: isImage
|
|
207
|
+
? 'Image'
|
|
208
|
+
: isMarkdown
|
|
209
|
+
? 'Markdown'
|
|
210
|
+
: lang;
|
|
184
211
|
/** The document a markdown read draws — and what Copy copies. omp's own
|
|
185
212
|
* `displayContent.text` first: it is the gutter-free text, and the gutter
|
|
186
213
|
* stripper that serves every other read keeps a one-row document's `1|`
|
|
@@ -215,11 +242,11 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
|
|
|
215
242
|
<div className="space-y-2">
|
|
216
243
|
{/* Header Info */}
|
|
217
244
|
<ToolPanelHeader
|
|
218
|
-
icon={isDir ? <FolderOpen size={12} /> : isImage ? <FileImage size={12} /> : <FileCode size={12} />}
|
|
245
|
+
icon={isDir ? <FolderOpen size={12} /> : isImage || svgPreviewUrl ? <FileImage size={12} /> : <FileCode size={12} />}
|
|
219
246
|
label={filePath || resultImage?.name || (isDir ? 'Directory Listing' : 'File Content')}
|
|
220
247
|
badge={kindLabel}
|
|
221
248
|
copyText={
|
|
222
|
-
rawContent && !
|
|
249
|
+
rawContent && !isPictureOnly
|
|
223
250
|
? isMarkdown
|
|
224
251
|
? markdownContent
|
|
225
252
|
: parsedCode.hasLineNumbers
|
|
@@ -230,18 +257,14 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
|
|
|
230
257
|
copyLabel="Copy file content"
|
|
231
258
|
/>
|
|
232
259
|
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
className="max-h-72 max-w-full object-contain"
|
|
242
|
-
/>
|
|
243
|
-
</div>
|
|
244
|
-
</div>
|
|
260
|
+
{/* An SVG is a picture AND text: omp returns the markup, and the file
|
|
261
|
+
renders. The preview goes above the source the reader can still copy. */}
|
|
262
|
+
{svgPreviewUrl && <ReadImage src={svgPreviewUrl} name={cleanFetchPath || 'Image'} />}
|
|
263
|
+
|
|
264
|
+
{isPictureOnly && imageUrl ? (
|
|
265
|
+
/* An image read has no code to show: paint the bytes, and open them at
|
|
266
|
+
full size on click — the same surface the `eval` screenshots use. */
|
|
267
|
+
<ReadImage src={imageUrl} name={resultImage?.name ?? cleanFetchPath ?? 'Image'} />
|
|
245
268
|
) : loadingFile ? (
|
|
246
269
|
<div className="flex items-center gap-2 rounded-lg border border-ink/8 bg-paper px-3 py-3 font-mono text-[11px] text-ink/50">
|
|
247
270
|
<Loader2 size={12} className="animate-spin" />
|
|
@@ -249,49 +272,7 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
|
|
|
249
272
|
</div>
|
|
250
273
|
) : isDir ? (
|
|
251
274
|
/* Render Directory Listing */
|
|
252
|
-
<
|
|
253
|
-
{skippedEntries > 0 && (
|
|
254
|
-
<div className="flex items-center gap-1.5 border-b border-ink/8 bg-canvas/60 px-3 py-1.5 text-[10px] text-ink/50">
|
|
255
|
-
<Info size={11} className="shrink-0" />
|
|
256
|
-
<span>… {skippedEntries} earlier entries hidden</span>
|
|
257
|
-
</div>
|
|
258
|
-
)}
|
|
259
|
-
<div className="max-h-72 divide-y divide-ink/[0.04] overflow-y-auto font-mono text-[11px]">
|
|
260
|
-
{visibleEntries.map((entry, idx) => (
|
|
261
|
-
<div
|
|
262
|
-
key={idx}
|
|
263
|
-
className="flex items-center gap-2 px-3 py-1.5 transition-colors hover:bg-ink/[0.02]"
|
|
264
|
-
style={{ paddingLeft: `${Math.max(12, (entry.indent + 1) * 16)}px` }}
|
|
265
|
-
>
|
|
266
|
-
{entry.isDir ? (
|
|
267
|
-
<Folder size={12} className="shrink-0 text-ink/60" />
|
|
268
|
-
) : (
|
|
269
|
-
<FileText size={12} className="shrink-0 text-ink/40" />
|
|
270
|
-
)}
|
|
271
|
-
<span
|
|
272
|
-
className={`min-w-0 flex-1 truncate ${
|
|
273
|
-
entry.isDir ? 'font-semibold text-ink' : 'text-ink/80'
|
|
274
|
-
}`}
|
|
275
|
-
>
|
|
276
|
-
{entry.name}
|
|
277
|
-
{entry.isDir && '/'}
|
|
278
|
-
</span>
|
|
279
|
-
{entry.size && <span className="shrink-0 font-mono text-[10px] text-ink/40">{entry.size}</span>}
|
|
280
|
-
{entry.time && (
|
|
281
|
-
<span className="shrink-0 rounded bg-ink/5 px-1 py-0.2 font-mono text-[10px] text-ink/45">
|
|
282
|
-
{entry.time}
|
|
283
|
-
</span>
|
|
284
|
-
)}
|
|
285
|
-
</div>
|
|
286
|
-
))}
|
|
287
|
-
</div>
|
|
288
|
-
{dirInfo.notice && (
|
|
289
|
-
<div className="flex items-center gap-1.5 border-t border-ink/8 bg-canvas/60 px-3 py-1.5 text-[10px] text-ink/50">
|
|
290
|
-
<Info size={11} className="shrink-0" />
|
|
291
|
-
<span>{dirInfo.notice}</span>
|
|
292
|
-
</div>
|
|
293
|
-
)}
|
|
294
|
-
</div>
|
|
275
|
+
<ReadDirectory entries={visibleEntries} skipped={skippedEntries} notice={dirInfo.notice} />
|
|
295
276
|
) : isMarkdown ? (
|
|
296
277
|
/* omp draws a `text/markdown` read (and an `xd://` doc read) as the
|
|
297
278
|
document it is: headings, lists, links and code fences, not a code
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A `read` of a directory, as the tree omp printed.
|
|
8
|
+
*
|
|
9
|
+
* Split out of `Read` for the file-size ceiling, not for reuse: the panel is
|
|
10
|
+
* one card and its branches are exclusive. The props are exactly what the
|
|
11
|
+
* listing needs — the rows already sliced to the tail, how many were dropped,
|
|
12
|
+
* and omp's own trailing notice — so the panel keeps its line-budget policy and
|
|
13
|
+
* this component only draws.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { FileText, Folder, Info } from 'lucide-preact';
|
|
17
|
+
import type { DirEntry } from '@/shared/lib/code/parser';
|
|
18
|
+
|
|
19
|
+
interface ReadDirectoryProps {
|
|
20
|
+
/** The rows to draw, tail-limited by the panel's line budget. */
|
|
21
|
+
entries: DirEntry[];
|
|
22
|
+
/** How many earlier rows the limit dropped. */
|
|
23
|
+
skipped: number;
|
|
24
|
+
/** omp's own footer line, when the listing carried one. */
|
|
25
|
+
notice?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function ReadDirectory({ entries, skipped, notice }: ReadDirectoryProps) {
|
|
29
|
+
return (
|
|
30
|
+
<div className="overflow-hidden rounded-lg border border-ink/8 bg-paper">
|
|
31
|
+
{skipped > 0 && (
|
|
32
|
+
<div className="flex items-center gap-1.5 border-b border-ink/8 bg-canvas/60 px-3 py-1.5 text-[10px] text-ink/50">
|
|
33
|
+
<Info size={11} className="shrink-0" />
|
|
34
|
+
<span>… {skipped} earlier entries hidden</span>
|
|
35
|
+
</div>
|
|
36
|
+
)}
|
|
37
|
+
<div className="max-h-72 divide-y divide-ink/[0.04] overflow-y-auto font-mono text-[11px]">
|
|
38
|
+
{entries.map((entry, idx) => (
|
|
39
|
+
<div
|
|
40
|
+
key={idx}
|
|
41
|
+
className="flex items-center gap-2 px-3 py-1.5 transition-colors hover:bg-ink/[0.02]"
|
|
42
|
+
style={{ paddingLeft: `${Math.max(12, (entry.indent + 1) * 16)}px` }}
|
|
43
|
+
>
|
|
44
|
+
{entry.isDir ? (
|
|
45
|
+
<Folder size={12} className="shrink-0 text-ink/60" />
|
|
46
|
+
) : (
|
|
47
|
+
<FileText size={12} className="shrink-0 text-ink/40" />
|
|
48
|
+
)}
|
|
49
|
+
<span
|
|
50
|
+
className={`min-w-0 flex-1 truncate ${entry.isDir ? 'font-semibold text-ink' : 'text-ink/80'}`}
|
|
51
|
+
>
|
|
52
|
+
{entry.name}
|
|
53
|
+
{entry.isDir && '/'}
|
|
54
|
+
</span>
|
|
55
|
+
{entry.size && <span className="shrink-0 font-mono text-[10px] text-ink/40">{entry.size}</span>}
|
|
56
|
+
{entry.time && (
|
|
57
|
+
<span className="shrink-0 rounded bg-ink/5 px-1 py-0.2 font-mono text-[10px] text-ink/45">
|
|
58
|
+
{entry.time}
|
|
59
|
+
</span>
|
|
60
|
+
)}
|
|
61
|
+
</div>
|
|
62
|
+
))}
|
|
63
|
+
</div>
|
|
64
|
+
{notice && (
|
|
65
|
+
<div className="flex items-center gap-1.5 border-t border-ink/8 bg-canvas/60 px-3 py-1.5 text-[10px] text-ink/50">
|
|
66
|
+
<Info size={11} className="shrink-0" />
|
|
67
|
+
<span>{notice}</span>
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The picture a `read` answers with, and the full-size view behind a click.
|
|
8
|
+
*
|
|
9
|
+
* The panel drew the result's own bytes with no affordance: a screenshot the
|
|
10
|
+
* tool returned sat at `max-h-72`, so fine text in a 4K capture was unreadable
|
|
11
|
+
* and there was no way to zoom it. The full-size surface is the same one the
|
|
12
|
+
* `eval` screenshot strip opens (`ImageFullscreen` → `FullscreenViewer`): a
|
|
13
|
+
* picture is one interaction wherever a tool returns one, and a second dialog
|
|
14
|
+
* shell for this card is how two previews drift apart.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useState } from 'preact/hooks';
|
|
18
|
+
import { ImageFullscreen } from '@/client/components/common/image-viewer/fullscreen';
|
|
19
|
+
|
|
20
|
+
interface ReadImageProps {
|
|
21
|
+
/** Raw-byte URL the result carries, or the raw-file route for the path fallback. */
|
|
22
|
+
src: string;
|
|
23
|
+
/** The file's name, used as the `alt`, the dialog's label and the title. */
|
|
24
|
+
name: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function ReadImage({ src, name }: ReadImageProps) {
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<div className="overflow-hidden rounded-lg border border-ink/8 bg-paper">
|
|
33
|
+
<button
|
|
34
|
+
type="button"
|
|
35
|
+
onClick={() => setOpen(true)}
|
|
36
|
+
title={`${name} — open full size`}
|
|
37
|
+
aria-label={`Open ${name} full size`}
|
|
38
|
+
className="group flex max-h-80 w-full cursor-pointer items-center justify-center overflow-auto bg-canvas/60 p-3"
|
|
39
|
+
>
|
|
40
|
+
<img
|
|
41
|
+
src={src}
|
|
42
|
+
alt={name}
|
|
43
|
+
className="max-h-72 max-w-full object-contain transition-opacity group-hover:opacity-90"
|
|
44
|
+
/>
|
|
45
|
+
</button>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
{open && <ImageFullscreen src={src} name={name} onClose={() => setOpen(false)} />}
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The DOM harness both `read` panel suites mount through.
|
|
8
|
+
*
|
|
9
|
+
* Two files share it because the panel answers two different questions — what
|
|
10
|
+
* it does with a result that carries no text (the lazy `/api/fs/read` fallback,
|
|
11
|
+
* the markdown branch) and what it paints when the result is a picture — and
|
|
12
|
+
* each suite is at the repo's per-file ceiling on its own.
|
|
13
|
+
*
|
|
14
|
+
* `happy-dom` is installed as globals here rather than in the suites so the two
|
|
15
|
+
* cannot drift on which globals a mounted panel needs. `fetch` is stubbed
|
|
16
|
+
* because the panel reads the status AND the body: a refused read is
|
|
17
|
+
* `ok: false` with an `error`, and the assertions are about which sentence the
|
|
18
|
+
* panel printed.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { Window } from 'happy-dom';
|
|
22
|
+
import { h, render } from 'preact';
|
|
23
|
+
import { act } from 'preact/test-utils';
|
|
24
|
+
import { Read } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/Read';
|
|
25
|
+
import type { ToolCallData } from '@/shared/types';
|
|
26
|
+
|
|
27
|
+
const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'HTMLInputElement', 'Event', 'MouseEvent', 'KeyboardEvent', 'fetch'] as const;
|
|
28
|
+
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
29
|
+
|
|
30
|
+
/** Every URL the panel asked `/api/fs/read` for, in order. */
|
|
31
|
+
export const fetchCalls: string[] = [];
|
|
32
|
+
|
|
33
|
+
/** The next response the stub hands back. Defaults to a 200 carrying `hello`. */
|
|
34
|
+
export let nextResponse: { ok: boolean; status: number; body: unknown } = {
|
|
35
|
+
ok: true,
|
|
36
|
+
status: 200,
|
|
37
|
+
body: { content: 'hello' },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Replace the stub's answer; call from `beforeEach` or inside a test. */
|
|
41
|
+
export function setNextResponse(response: { ok: boolean; status: number; body: unknown }): void {
|
|
42
|
+
nextResponse = response;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Install the browser globals and the fetch stub; call from `beforeAll`. */
|
|
46
|
+
export function installReadDom(): void {
|
|
47
|
+
const win = new Window({ url: 'http://localhost' });
|
|
48
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
49
|
+
for (const key of DOM_GLOBALS) {
|
|
50
|
+
nativeGlobals[key] = target[key];
|
|
51
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
52
|
+
}
|
|
53
|
+
const stub = (async (url: string) => {
|
|
54
|
+
fetchCalls.push(String(url));
|
|
55
|
+
const { ok, status, body } = nextResponse;
|
|
56
|
+
return { ok, status, json: async () => body };
|
|
57
|
+
}) as unknown as typeof globalThis.fetch;
|
|
58
|
+
globalThis.fetch = stub;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Put the previous globals back; call from `afterAll`. */
|
|
62
|
+
export function restoreReadDom(): void {
|
|
63
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
64
|
+
for (const key of DOM_GLOBALS) {
|
|
65
|
+
if (nativeGlobals[key] === undefined) delete target[key];
|
|
66
|
+
else target[key] = nativeGlobals[key];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Mount the panel for one call and flush the effect + its fetch microtask chain. */
|
|
71
|
+
export async function mountRead(tool: ToolCallData): Promise<HTMLElement> {
|
|
72
|
+
const container = document.createElement('div');
|
|
73
|
+
document.body.appendChild(container);
|
|
74
|
+
await act(async () => {
|
|
75
|
+
render(h(Read, { tool, output: tool.output ?? '' }), container);
|
|
76
|
+
});
|
|
77
|
+
// The reader awaits `fetch` and then `res.json()`, and each state write lands
|
|
78
|
+
// a turn later; a few separate `act` passes drain that chain without binding
|
|
79
|
+
// the test to the clock.
|
|
80
|
+
for (let pass = 0; pass < 4; pass += 1) {
|
|
81
|
+
await act(async () => {
|
|
82
|
+
await Promise.resolve();
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return container;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** A `read` call with the fields every case shares. */
|
|
89
|
+
export function readTool(partial: Partial<ToolCallData>): ToolCallData {
|
|
90
|
+
return { id: 'r1', type: 'read', name: 'read', title: 'read', output: '', status: 'success', details: {}, ...partial } as ToolCallData;
|
|
91
|
+
}
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Selection is the only state that reveals a commit's detail.
|
|
8
8
|
*
|
|
9
|
-
* The row
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* chevron that opens an empty block reads as a broken row.
|
|
9
|
+
* The row used to fire two events on one click: select the commit and toggle
|
|
10
|
+
* its expansion. The file list could then be open on a row that was not the
|
|
11
|
+
* selected one. These mounts pin the replacement contract: the body and the
|
|
12
|
+
* changed-file list render for the selected commit, and clicking a row only
|
|
13
|
+
* selects it.
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
16
|
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
|
|
18
17
|
import { Window } from 'happy-dom';
|
|
19
18
|
import { h, render } from 'preact';
|
|
19
|
+
import { useState } from 'preact/hooks';
|
|
20
20
|
import { act } from 'preact/test-utils';
|
|
21
21
|
import { CommitRow } from '@/client/components/workspace/git-panel/commit-modal/CommitRow';
|
|
22
22
|
import type { GitCommit } from '@/shared/types/git';
|
|
@@ -75,55 +75,69 @@ async function mount(commitRow: GitCommit, options: { isSelected?: boolean } = {
|
|
|
75
75
|
return container;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/** A parent that owns the selection, the way the modal does. */
|
|
79
|
+
function Harness({ commitRow }: { commitRow: GitCommit }) {
|
|
80
|
+
const [selected, setSelected] = useState(false);
|
|
81
|
+
return h(CommitRow, {
|
|
82
|
+
commit: commitRow,
|
|
83
|
+
isSelected: selected,
|
|
84
|
+
onSelect: () => setSelected(true),
|
|
85
|
+
onAction: () => {},
|
|
86
|
+
onToggleFile: () => {},
|
|
87
|
+
isExpandedFile: () => false,
|
|
88
|
+
isLoadingFile: () => false,
|
|
89
|
+
isFullContextFile: () => false,
|
|
90
|
+
onToggleContext: () => {},
|
|
91
|
+
fileDiffs: {},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function mountInteractive(commitRow: GitCommit): Promise<HTMLElement> {
|
|
96
|
+
const container = document.createElement('div');
|
|
97
|
+
document.body.appendChild(container);
|
|
98
|
+
await act(async () => {
|
|
99
|
+
render(h(Harness, { commitRow }), container);
|
|
100
|
+
});
|
|
101
|
+
return container;
|
|
102
|
+
}
|
|
103
|
+
|
|
78
104
|
async function click(el: Element): Promise<void> {
|
|
79
105
|
await act(async () => {
|
|
80
106
|
el.dispatchEvent(new window.MouseEvent('click', { bubbles: true }) as unknown as Event);
|
|
81
107
|
});
|
|
82
108
|
}
|
|
83
109
|
|
|
84
|
-
describe('CommitRow
|
|
85
|
-
test('the body is hidden until the
|
|
86
|
-
const
|
|
87
|
-
expect(
|
|
110
|
+
describe('CommitRow selected detail', () => {
|
|
111
|
+
test('the body is hidden until the commit is selected', async () => {
|
|
112
|
+
const unselected = await mount(commit('why the change was made'));
|
|
113
|
+
expect(unselected.textContent).toContain('feat(scope): the subject line');
|
|
114
|
+
expect(unselected.textContent).not.toContain('why the change was made');
|
|
115
|
+
|
|
116
|
+
const selected = await mount(commit('why the change was made'), { isSelected: true });
|
|
117
|
+
expect(selected.textContent).toContain('why the change was made');
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('clicking the row selects the commit and reveals its detail', async () => {
|
|
121
|
+
const el = await mountInteractive(commit('why the change was made'));
|
|
88
122
|
expect(el.textContent).not.toContain('why the change was made');
|
|
89
123
|
|
|
90
124
|
await click(el.firstElementChild!);
|
|
91
125
|
expect(el.textContent).toContain('why the change was made');
|
|
92
126
|
});
|
|
93
127
|
|
|
94
|
-
test('clicking again
|
|
95
|
-
const el = await
|
|
128
|
+
test('clicking the selected row again keeps the detail visible', async () => {
|
|
129
|
+
const el = await mountInteractive(commit('why the change was made'));
|
|
96
130
|
await click(el.firstElementChild!);
|
|
97
131
|
await click(el.firstElementChild!);
|
|
98
|
-
expect(el.textContent).
|
|
132
|
+
expect(el.textContent).toContain('why the change was made');
|
|
99
133
|
});
|
|
100
134
|
|
|
101
|
-
test('a one-line commit
|
|
135
|
+
test('a one-line commit with no files renders no detail affordance', async () => {
|
|
102
136
|
const el = await mount(commit(undefined));
|
|
103
137
|
expect(el.textContent).toContain('feat(scope): the subject line');
|
|
104
|
-
// The subject row carries no chevron, so the row never promises a
|
|
138
|
+
// The subject row carries no chevron, so the row never promises a detail.
|
|
105
139
|
expect(el.querySelectorAll('svg').length).toBe(1); // the copy-hash icon only
|
|
106
140
|
});
|
|
107
|
-
|
|
108
|
-
test('a click that ends a text selection does not collapse the body', async () => {
|
|
109
|
-
const el = await mount(commit('selectable text'));
|
|
110
|
-
await click(el.firstElementChild!);
|
|
111
|
-
expect(el.textContent).toContain('selectable text');
|
|
112
|
-
|
|
113
|
-
// Simulate selecting part of the body, then clicking to copy it.
|
|
114
|
-
const range = document.createRange();
|
|
115
|
-
range.selectNodeContents(el.querySelector('div.whitespace-pre-wrap')!);
|
|
116
|
-
const selection = window.getSelection()!;
|
|
117
|
-
selection.removeAllRanges();
|
|
118
|
-
selection.addRange(range);
|
|
119
|
-
|
|
120
|
-
await click(el.firstElementChild!);
|
|
121
|
-
expect(el.textContent).toContain('selectable text');
|
|
122
|
-
|
|
123
|
-
selection.removeAllRanges();
|
|
124
|
-
await click(el.firstElementChild!);
|
|
125
|
-
expect(el.textContent).not.toContain('selectable text');
|
|
126
|
-
});
|
|
127
141
|
});
|
|
128
142
|
|
|
129
143
|
describe('CommitRow changed-file list', () => {
|
|
@@ -132,54 +146,58 @@ describe('CommitRow changed-file list', () => {
|
|
|
132
146
|
{ file: 'src/two.ts', status: 'A', additions: 9, deletions: 0 },
|
|
133
147
|
];
|
|
134
148
|
|
|
135
|
-
test('the file list is hidden until the
|
|
136
|
-
const
|
|
137
|
-
expect(
|
|
149
|
+
test('the file list is hidden until the commit is selected', async () => {
|
|
150
|
+
const unselected = await mount(commit(undefined, files));
|
|
151
|
+
expect(unselected.textContent).toContain('feat(scope): the subject line');
|
|
152
|
+
expect(unselected.textContent).not.toContain('src/one.ts');
|
|
153
|
+
expect(unselected.textContent).not.toContain('src/two.ts');
|
|
154
|
+
|
|
155
|
+
const selected = await mount(commit(undefined, files), { isSelected: true });
|
|
156
|
+
expect(selected.textContent).toContain('src/one.ts');
|
|
157
|
+
expect(selected.textContent).toContain('src/two.ts');
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
test('clicking the row selects the commit and reveals the file list', async () => {
|
|
161
|
+
const el = await mountInteractive(commit(undefined, files));
|
|
138
162
|
expect(el.textContent).not.toContain('src/one.ts');
|
|
139
|
-
expect(el.textContent).not.toContain('src/two.ts');
|
|
140
163
|
|
|
141
164
|
await click(el.firstElementChild!);
|
|
142
165
|
expect(el.textContent).toContain('src/one.ts');
|
|
143
166
|
expect(el.textContent).toContain('src/two.ts');
|
|
144
167
|
});
|
|
145
168
|
|
|
146
|
-
test('a commit with files but no body still
|
|
147
|
-
const el = await mount(commit(undefined, files));
|
|
169
|
+
test('a commit with files but no body still shows the file list when selected', async () => {
|
|
170
|
+
const el = await mount(commit(undefined, files), { isSelected: true });
|
|
148
171
|
// The chevron is the affordance: without it the file list would be
|
|
149
172
|
// unreachable on a one-line commit.
|
|
150
|
-
|
|
151
|
-
|
|
173
|
+
const subject = Array.from(el.querySelectorAll('button[aria-expanded]')).find((button) =>
|
|
174
|
+
button.textContent?.includes('feat(scope): the subject line')
|
|
175
|
+
);
|
|
176
|
+
expect(subject?.querySelector('svg')).toBeTruthy();
|
|
152
177
|
expect(el.textContent).toContain('src/one.ts');
|
|
153
178
|
});
|
|
154
179
|
|
|
155
|
-
test('the
|
|
180
|
+
test('the unselected row states how many files the commit touched', async () => {
|
|
156
181
|
const el = await mount(commit(undefined, files));
|
|
157
182
|
expect(el.textContent).toContain('2 files');
|
|
158
183
|
});
|
|
159
184
|
|
|
160
|
-
test('
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
await click(el.firstElementChild!);
|
|
164
|
-
expect(el.textContent).not.toContain('src/one.ts');
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
test('the subject is a button that reports and toggles the expanded state', async () => {
|
|
168
|
-
const el = await mount(commit(undefined, files));
|
|
169
|
-
const subject = Array.from(el.querySelectorAll('button[aria-expanded]')).find((button) =>
|
|
185
|
+
test('the subject is a button that reports the selected state', async () => {
|
|
186
|
+
const unselected = await mount(commit(undefined, files));
|
|
187
|
+
const unselectedSubject = Array.from(unselected.querySelectorAll('button[aria-expanded]')).find((button) =>
|
|
170
188
|
button.textContent?.includes('feat(scope): the subject line')
|
|
171
189
|
) as HTMLButtonElement | undefined;
|
|
172
|
-
expect(
|
|
173
|
-
expect(subject?.getAttribute('aria-expanded')).toBe('false');
|
|
190
|
+
expect(unselectedSubject?.getAttribute('aria-expanded')).toBe('false');
|
|
174
191
|
|
|
175
|
-
await
|
|
176
|
-
|
|
177
|
-
|
|
192
|
+
const selected = await mount(commit(undefined, files), { isSelected: true });
|
|
193
|
+
const selectedSubject = Array.from(selected.querySelectorAll('button[aria-expanded]')).find((button) =>
|
|
194
|
+
button.textContent?.includes('feat(scope): the subject line')
|
|
195
|
+
) as HTMLButtonElement | undefined;
|
|
196
|
+
expect(selectedSubject?.getAttribute('aria-expanded')).toBe('true');
|
|
178
197
|
});
|
|
179
198
|
|
|
180
199
|
test('a file row is a button that reports its own expanded state', async () => {
|
|
181
|
-
const el = await mount(commit(undefined, files));
|
|
182
|
-
await click(el.firstElementChild!);
|
|
200
|
+
const el = await mount(commit(undefined, files), { isSelected: true });
|
|
183
201
|
const fileRow = Array.from(el.querySelectorAll('button[aria-expanded]')).find((button) =>
|
|
184
202
|
button.textContent?.includes('src/one.ts')
|
|
185
203
|
) as HTMLButtonElement | undefined;
|