@kabmo-labs/kabmo 0.46.0 → 0.47.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 +439 -435
- package/dist/client/static/js/{CsvGrid-br4j001k.js → CsvGrid-vfgttmym.js} +2 -2
- package/dist/client/static/js/{DocxView-kmtkbmmw.js → DocxView-dc41t6rp.js} +2 -2
- package/dist/client/static/js/{DrawioView-3df0g3jr.js → DrawioView-wpwr38d9.js} +2 -2
- package/dist/client/static/js/HtmlPreview-23n7t5cs.js +1 -0
- package/dist/client/static/js/ImageView-mvjb3qh1.js +1 -0
- package/dist/client/static/js/LayoutWrapper-eenx0hp2.js +2 -0
- package/dist/client/static/js/{Modal-tmxhxd6q.js → Modal-dsqhas10.js} +13 -13
- package/dist/client/static/js/{PdfView-p5z7c7eg.js → PdfView-cpvsbfk0.js} +1 -1
- package/dist/client/static/js/{SessionsView-t06h6zfx.js → SessionsView-s0crtcm8.js} +1 -1
- package/dist/client/static/js/{SheetView-agw459v2.js → SheetView-n6mst0hq.js} +13 -13
- package/dist/client/static/js/{SvgPreview-b9rfy1h6.js → SvgPreview-g2aqq812.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-wbnhzcnj.js → abnfDiagram-O67JEVCF-3vac8sq4.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-b5w9mnn5.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-t2sgevea.js → architectureDiagram-NJMV4G6O-1nh4htz2.js} +3 -3
- package/dist/client/static/js/{astro-hyj5wege.js → astro-63zcysj7.js} +1 -1
- package/dist/client/static/js/bash-hv3167gh.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-v2nzp54a.js → blockDiagram-BEXU5L5S-62z6kaar.js} +2 -2
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-7h03146b.js → c4Diagram-YGBWAQC7-rts5zgx4.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-m57e9kp1.js → classDiagram-v2-NBCMYWYE-tnpww186.js} +1 -1
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-c4tnh4mg.js → cose-bilkent-JH36ORCC-8vsjbzwa.js} +1 -1
- package/dist/client/static/js/cpp-v2mqp8j7.js +1 -0
- package/dist/client/static/js/css-x7gyc3ta.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-kdj8rjc1.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-mjf6njey.js → cynefinDiagram-VND7K2PF-005gc8km.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-6yma9ch3.js → dagre-6A5THRUB-41zsteyd.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-1q4ce2gb.js → diagram-22UHCM2B-prsm18a1.js} +3 -3
- package/dist/client/static/js/{diagram-3UASUU5V-0ttps29p.js → diagram-3UASUU5V-5nx9wf04.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-1mzexgv1.js → diagram-ATOU4E4O-k3d4z3aq.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-4ae89t23.js → diagram-CDSNMT55-x2c5x5j2.js} +2 -2
- package/dist/client/static/js/{diagram-MLGK6HIB-057jaqvh.js → diagram-MLGK6HIB-nvr76jqh.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-p6yyq5sx.js → diagram-MPIPVDR6-v1jpzp9p.js} +1 -1
- package/dist/client/static/js/{dockerfile-00hqsk9c.js → dockerfile-vz6va73h.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-bsk7dvm4.js → ebnfDiagram-ZINNZB2B-0v4tqr9v.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-dsq91er5.js → elk-276RUBZZ-qfn4r7xj.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-p7p13mbh.js → erDiagram-OPXOYQCR-cd667n9f.js} +4 -4
- package/dist/client/static/js/{erlang-814e8qy5.js → erlang-vk66vt7q.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-m57b7ytw.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-fasj2gxy.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-bwgnttyk.js → ganttDiagram-FUAMR5RP-ps0h3drm.js} +1 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-wvzsc4ph.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ca0gj5am.js → gitGraphDiagram-X574FWY7-fts23jer.js} +2 -2
- package/dist/client/static/js/graphql-a4gbqpj9.js +1 -0
- package/dist/client/static/js/{index-y2z8nsvw.js → index-0dkc6z8e.js} +2 -2
- package/dist/client/static/js/{index-eqhjs1yv.js → index-1d8bxjsz.js} +4 -4
- package/dist/client/static/js/{index-kty4ncsr.js → index-1whzs9kb.js} +2 -2
- package/dist/client/static/js/{index-qfxn7yh5.js → index-396r53n0.js} +2 -2
- package/dist/client/static/js/{index-qn200x1b.js → index-39d8zbkx.js} +6 -6
- package/dist/client/static/js/{index-dn7hg4em.js → index-3nsrnyqr.js} +2 -2
- package/dist/client/static/js/{index-jkay7aw7.js → index-4jzsr1ky.js} +2 -2
- package/dist/client/static/js/{index-064vdkrs.js → index-4wnzs76g.js} +1 -1
- package/dist/client/static/js/{index-16sd19f0.js → index-4x9p7hf9.js} +2 -2
- package/dist/client/static/js/{index-zq0qxb17.js → index-52nd4hgm.js} +1 -1
- package/dist/client/static/js/{index-8pksqzwq.js → index-54mkp2r2.js} +1 -1
- package/dist/client/static/js/{index-abs635a1.js → index-56rtb871.js} +25 -25
- package/dist/client/static/js/{index-dxvtjn6a.js → index-5f4b44ay.js} +2 -2
- package/dist/client/static/js/{index-95kese1h.js → index-6009v8jf.js} +1 -1
- package/dist/client/static/js/{index-29npynva.js → index-62jgcgfd.js} +5 -5
- package/dist/client/static/js/{index-nw5mvcaj.js → index-64p1dncg.js} +2 -2
- package/dist/client/static/js/{index-fj5rsp5v.js → index-6d6hxwb5.js} +2 -2
- package/dist/client/static/js/{index-19x11s5w.js → index-70g527sb.js} +2 -2
- package/dist/client/static/js/{index-9d3n04vb.js → index-7zeah164.js} +2 -2
- package/dist/client/static/js/{index-5h8y54t6.js → index-7zedprz3.js} +1 -1
- package/dist/client/static/js/{index-g7s0wsag.js → index-9ab6xaxd.js} +2 -2
- package/dist/client/static/js/index-9vqkyj58.js +3 -0
- package/dist/client/static/js/{index-x1fqhhpp.js → index-9xsf8162.js} +35 -35
- package/dist/client/static/js/{index-j718pxb3.js → index-a4h5np9r.js} +2 -2
- package/dist/client/static/js/{index-bjv5ga2e.js → index-an2wv33f.js} +2 -2
- package/dist/client/static/js/{index-64sqfr4a.js → index-c5hjht5e.js} +2 -2
- package/dist/client/static/js/{index-aagt3382.js → index-c63qyysm.js} +1 -1
- package/dist/client/static/js/{index-red856x6.js → index-ccgzzydx.js} +1 -1
- package/dist/client/static/js/{index-ex5dtdx2.js → index-cra9mgkq.js} +4 -4
- package/dist/client/static/js/index-cvyqp8nz.css +1 -0
- package/dist/client/static/js/index-d2xtbabt.js +2 -0
- package/dist/client/static/js/{index-7055hdx1.js → index-dxkefysk.js} +1 -1
- package/dist/client/static/js/index-dxp2yvy7.js +2 -0
- package/dist/client/static/js/{index-vjmg7kn5.js → index-dyc886cc.js} +1 -1
- package/dist/client/static/js/{index-5wz0y88c.js → index-dzeyd153.js} +2 -2
- package/dist/client/static/js/{index-qf3y3ahx.js → index-e5j5gc4h.js} +2 -2
- package/dist/client/static/js/{index-2ks0m8ss.js → index-evmcc5qh.js} +2 -2
- package/dist/client/static/js/{index-f7te27n5.js → index-f2ahkev0.js} +5 -5
- package/dist/client/static/js/{index-5gf52a6d.js → index-fjex1y0t.js} +2 -2
- package/dist/client/static/js/{index-bafe7hmd.js → index-fxd8dfj4.js} +2 -2
- package/dist/client/static/js/{index-trvqvb1v.js → index-g4kkapka.js} +2 -2
- package/dist/client/static/js/{index-561gkvve.js → index-gzkzwgzv.js} +2 -2
- package/dist/client/static/js/{index-twsbv1yn.js → index-n1yr4khe.js} +1 -1
- package/dist/client/static/js/{index-d23eacf2.js → index-nkahe229.js} +2 -2
- package/dist/client/static/js/{index-3bf7r7z4.js → index-p6s3fz6b.js} +11 -11
- package/dist/client/static/js/{index-hnb66d3s.js → index-q4ke39rh.js} +2 -2
- package/dist/client/static/js/index-qtd0e38d.js +1 -0
- package/dist/client/static/js/{index-ncpwteyt.js → index-tqgj7rd9.js} +2 -2
- package/dist/client/static/js/{index-wbws16ag.js → index-x0xspam4.js} +2 -2
- package/dist/client/static/js/{index-amys498v.js → index-x2v1zmth.js} +186 -186
- package/dist/client/static/js/{index-pwe6chtp.js → index-x9hfvbz6.js} +1 -1
- package/dist/client/static/js/{index-dr5hca5b.js → index-xk1cqjkn.js} +3 -3
- package/dist/client/static/js/{index-k5zfzgez.js → index-y6ke70e6.js} +2 -2
- package/dist/client/static/js/{index-zedt16w7.js → index-zhjjpvcc.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-ym2xevn8.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-7q58qdf1.js → infoDiagram-VRGFBTTK-88qbtpq5.js} +1 -1
- package/dist/client/static/js/ini-80p6sp79.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-9jmeszag.js → ishikawaDiagram-OU5B5YK6-s8bagk00.js} +1 -1
- package/dist/client/static/js/java-mm2b3s9b.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-0d7xe845.js → journeyDiagram-ZHPQQLJL-hz8z0b9x.js} +2 -2
- package/dist/client/static/js/json-fzy76fkw.js +1 -0
- package/dist/client/static/js/jsx-c7v2f8s7.js +1 -0
- package/dist/client/static/js/{julia-yv2j8qd0.js → julia-dm0j9apa.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-7p83rwdn.js → kanban-definition-PNTS6WVX-sjjnjb51.js} +1 -1
- package/dist/client/static/js/lua-ppfdxrmv.js +1 -0
- package/dist/client/static/js/markdown-xed7y3ds.js +1 -0
- package/dist/client/static/js/{mermaid.core-hwhzw0wv.js → mermaid.core-zvwygxbh.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-hy0rtr7t.js → mindmap-definition-NLK3R4M7-kgj8enan.js} +2 -2
- package/dist/client/static/js/one-dark-pro-mq6sn6a2.js +1 -0
- package/dist/client/static/js/one-light-pt6t6vax.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-01vcsy6x.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-kd8t53tx.js → pegDiagram-GJSIUBJH-gxzw1qwa.js} +1 -1
- package/dist/client/static/js/{perl-917pjq5a.js → perl-4jcm2jxv.js} +1 -1
- package/dist/client/static/js/{php-hwz75qzt.js → php-q32mec74.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-053gzkmh.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-h3x03f80.js → pieDiagram-5QR66LMP-pdqwyqcm.js} +1 -1
- package/dist/client/static/js/properties-8ysbq2n2.js +1 -0
- package/dist/client/static/js/python-4ysexc8s.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-y2b1ncbg.js → quadrantDiagram-O4NWA36T-yx2t364p.js} +1 -1
- package/dist/client/static/js/r-hrsw5arc.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-bkpby8am.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-67bxrjgw.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-xj9ymacg.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-2xxpbnf6.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-78w88znz.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-x188rcxf.js → railroadDiagram-XR7U4H2S-800fdzkr.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-g5e9fk17.js → requirementDiagram-PLB6GJNP-vc5rpgtm.js} +1 -1
- package/dist/client/static/js/{ruby-er7ayhte.js → ruby-npmpb290.js} +1 -1
- package/dist/client/static/js/{rust-1v8xbxn9.js → rust-waks43wh.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-y9ht91gf.js → sankeyDiagram-IPEJSGJF-ccjk8zgn.js} +2 -2
- package/dist/client/static/js/{sass-n47tt136.js → sass-502a4r7y.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-pp8s63rt.js → sequenceDiagram-PO4LG4MO-c0tk7gfn.js} +6 -6
- package/dist/client/static/js/{sizeCapture-INFHLROL-k6dhfxex.js → sizeCapture-INFHLROL-fma9p1vy.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-y3akpsm4.js → stateDiagram-v2-GCMORJYK-d8f24b7j.js} +2 -2
- package/dist/client/static/js/{svelte-2pmz35vx.js → svelte-c15d0421.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-89081dr3.js → swimlanes-2SLR337P-sdt7qy36.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-rz309qrx.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-tz6r8g3q.js → timeline-definition-EJHVYXUP-rv8qyr8b.js} +2 -2
- package/dist/client/static/js/treeView-Q6P3EWNA-g2bkjr4z.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-pj7yw9rw.js +1 -0
- package/dist/client/static/js/tsx-xjp2ds8g.js +1 -0
- package/dist/client/static/js/typescript-yg97da8h.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-yq2y1b09.js → usecaseDiagram-POWQR4AR-w6ew1red.js} +2 -2
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-qdmjf6x3.js → vennDiagram-UO4OBE2U-p9axw7ch.js} +1 -1
- package/dist/client/static/js/{vue-d5gpjfgn.js → vue-xpemy62d.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-c7ekf8r2.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-3n2sm7rj.js → wardleyDiagram-VNRHLVJA-5ewc8s4p.js} +1 -1
- package/dist/client/static/js/xml-nrb23phz.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-d7n2av2t.js → xychartDiagram-PMCCYNJV-7n4gn7k6.js} +2 -2
- package/dist/client/static/js/yaml-sqs6pjpx.js +1 -0
- package/marketplace/marketplace.json +34 -7
- package/marketplace/plugins/kanban/README.md +143 -0
- package/marketplace/plugins/kanban/icon.svg +5 -0
- package/marketplace/plugins/kanban/package.json +30 -0
- package/marketplace/plugins/kanban/src/app.tsx +34 -0
- package/marketplace/plugins/kanban/src/mcp-tools.ts +296 -0
- package/marketplace/plugins/kanban/src/mcp.test.ts +199 -0
- package/marketplace/plugins/kanban/src/mcp.ts +148 -0
- package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +319 -0
- package/marketplace/plugins/kanban/src/panel/CardTile.tsx +97 -0
- package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +116 -0
- package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +249 -0
- package/marketplace/plugins/kanban/src/panel/catalogs.ts +114 -0
- package/marketplace/plugins/kanban/src/panel/index.tsx +327 -0
- package/marketplace/plugins/kanban/src/panel/panel.test.ts +219 -0
- package/marketplace/plugins/kanban/src/panel/start-work.ts +132 -0
- package/marketplace/plugins/kanban/src/panel/use-board.ts +148 -0
- package/marketplace/plugins/kanban/src/panel/use-card-detail.ts +70 -0
- package/marketplace/plugins/kanban/src/panel/use-writes.ts +123 -0
- package/marketplace/plugins/kanban/src/protocol.ts +180 -0
- package/marketplace/plugins/kanban/src/server.test.ts +113 -0
- package/marketplace/plugins/kanban/src/server.ts +227 -0
- package/marketplace/plugins/kanban/src/store/board.test.ts +311 -0
- package/marketplace/plugins/kanban/src/store/board.ts +147 -0
- package/marketplace/plugins/kanban/src/store/cards.ts +228 -0
- package/marketplace/plugins/kanban/src/store/fs.ts +159 -0
- package/marketplace/plugins/kanban/src/store/ops.ts +245 -0
- package/marketplace/plugins/kanban/src/store/resolve.test.ts +82 -0
- package/marketplace/plugins/kanban/src/store/resolve.ts +135 -0
- package/marketplace/plugins/kanban/tsconfig.json +26 -0
- package/package.json +2 -2
- package/src/client/components/common/file-icon/index.tsx +1 -1
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +14 -4
- package/src/client/components/layout/desktop-layout/RightColumn.test.tsx +204 -0
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +37 -16
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +34 -7
- package/src/client/components/layout/desktop-layout/index.tsx +17 -22
- package/src/client/components/mobile/RightSidebar.tsx +10 -8
- package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +2 -0
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +11 -3
- package/src/client/components/mobile/mobile-session-sidebar/use-drawer-tabs.ts +2 -1
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.test.tsx +21 -0
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +8 -4
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +8 -2
- package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +15 -4
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +11 -0
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +29 -21
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +21 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +7 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +1 -1
- package/src/client/components/workspace/editor/FilePane.tsx +4 -2
- package/src/client/components/workspace/editor/Tabs.tsx +7 -1
- package/src/client/components/workspace/editor/Toolbar.tsx +7 -1
- package/src/client/components/workspace/editor/chrome-rows.test.tsx +126 -0
- package/src/client/components/workspace/editor/viewers/HtmlPreview.test.tsx +94 -0
- package/src/client/components/workspace/editor/viewers/HtmlPreview.tsx +71 -0
- package/src/client/components/workspace/editor/viewers/bytes.ts +1 -1
- package/src/client/components/workspace/editor/viewers/dispatch.tsx +18 -2
- package/src/client/components/workspace/editor/viewers/viewers.test.ts +14 -1
- package/src/client/components/workspace/panel-header/index.test.tsx +2 -1
- package/src/client/components/workspace/panel-header/index.tsx +6 -4
- package/src/client/hooks/chat/timeline/row-measure.ts +75 -0
- package/src/client/hooks/chat/timeline/row-window.test.ts +41 -21
- package/src/client/hooks/chat/timeline/row-window.ts +6 -24
- package/src/client/hooks/editor/resolve-viewer.ts +1 -1
- package/src/client/hooks/editor/use-editor-drop.ts +14 -0
- package/src/client/hooks/editor/use-editor-tab-state.ts +5 -4
- package/src/client/hooks/ui/media-query.ts +27 -0
- package/src/client/hooks/workspace/file-tabs.ts +10 -0
- package/src/client/hooks/workspace/panel-tabs-reveal.test.tsx +20 -17
- package/src/client/hooks/workspace/panel-tabs-reveal.ts +29 -17
- package/src/client/hooks/workspace/panel-tabs.ts +3 -2
- package/src/client/hooks/workspace/right-panel-presence.test.ts +152 -0
- package/src/client/hooks/workspace/right-panel-presence.ts +119 -0
- package/src/client/hooks/workspace/session-state/index.test.tsx +145 -0
- package/src/client/hooks/workspace/session-state/index.ts +28 -16
- package/src/client/lib/router/search-params.test.ts +83 -0
- package/src/client/lib/router/search-params.ts +14 -3
- package/src/server/lib/mcp/session-mcp.test.ts +64 -1
- package/src/server/lib/mcp/session-overlay.server.ts +7 -4
- package/src/server/lib/omp/rpc/constants.test.ts +31 -0
- package/src/server/lib/omp/rpc/constants.ts +19 -0
- package/src/server/lib/omp/rpc/session-new.ts +78 -0
- package/src/server/lib/omp/rpc/session-registry.ts +22 -49
- package/src/server/lib/omp/rpc/spawn-mcp.ts +8 -1
- package/src/server/lib/omp/session/blobs.server.ts +2 -1
- package/src/server/lib/plugins/e2e.test.ts +71 -2
- package/src/server/lib/plugins/loader.server.ts +20 -1
- package/src/server/lib/plugins/module-import.server.ts +45 -0
- package/src/server/routes/agent/new-prompt.test.ts +81 -0
- package/src/server/routes/agent/new.ts +78 -4
- package/src/server/routes/fs/raw.test.ts +12 -0
- package/src/server/routes/fs/raw.ts +2 -6
- package/src/server/routes/wiki/asset.ts +1 -1
- package/src/shared/lib/fs/document-kind.test.ts +39 -2
- package/src/shared/lib/fs/document-kind.ts +49 -1
- package/src/shared/lib/fs/file-kind.test.ts +30 -3
- package/src/shared/lib/fs/file-kind.ts +7 -104
- package/src/shared/lib/fs/mime.ts +159 -0
- package/src/shared/lib/workspace/sidebar-width.test.ts +34 -0
- package/src/shared/lib/workspace/sidebar-width.ts +33 -0
- package/src/shared/lib/workspace/workspace-panel-widths.test.ts +124 -0
- package/src/shared/lib/workspace/workspace-panel-widths.ts +115 -18
- package/dist/client/static/js/ImageView-2r8p5z3y.js +0 -1
- package/dist/client/static/js/LayoutWrapper-rq3d2a4e.js +0 -2
- package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +0 -1
- package/dist/client/static/js/bash-8d8z8zrg.js +0 -1
- package/dist/client/static/js/cpp-620mvjkk.js +0 -1
- package/dist/client/static/js/css-bt76kxbq.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7b4w6phx.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +0 -1
- package/dist/client/static/js/graphql-j1a6zp7m.js +0 -1
- package/dist/client/static/js/index-3qnjdjg2.js +0 -1
- package/dist/client/static/js/index-4bqssvt6.js +0 -2
- package/dist/client/static/js/index-dpy3ewrn.css +0 -1
- package/dist/client/static/js/index-gq5w5w8x.js +0 -2
- package/dist/client/static/js/index-ta6gpcpw.js +0 -3
- package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +0 -1
- package/dist/client/static/js/ini-5f4zqtqr.js +0 -1
- package/dist/client/static/js/java-jj41mty3.js +0 -1
- package/dist/client/static/js/json-rnh2h17x.js +0 -1
- package/dist/client/static/js/jsx-4gecrt29.js +0 -1
- package/dist/client/static/js/lua-zszaw2f7.js +0 -1
- package/dist/client/static/js/markdown-nm6gw4v4.js +0 -1
- package/dist/client/static/js/one-dark-pro-4b8er03c.js +0 -1
- package/dist/client/static/js/one-light-e6r3vsz4.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +0 -1
- package/dist/client/static/js/properties-rkptax7r.js +0 -1
- package/dist/client/static/js/python-qf1se1mj.js +0 -1
- package/dist/client/static/js/r-ms0cygq2.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3q2a15wc.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +0 -1
- package/dist/client/static/js/tsx-gx7td06z.js +0 -1
- package/dist/client/static/js/typescript-1a808spn.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +0 -1
- package/dist/client/static/js/xml-3117mxd9.js +0 -1
- package/dist/client/static/js/yaml-dmvh8vyt.js +0 -1
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The stages sheet: what each lane DOES, not just what it is called.
|
|
8
|
+
*
|
|
9
|
+
* A stage owns three facts the rest of the board obeys — whether it runs a
|
|
10
|
+
* session, what agent a card landing there uses, and the system prompt that
|
|
11
|
+
* agent gets. The last two are why this sheet exists at all: decision 6 and 7 are
|
|
12
|
+
* configuration, and configuration that can only be edited by hand-editing
|
|
13
|
+
* `board.json` is not a feature.
|
|
14
|
+
*
|
|
15
|
+
* Every field left on "inherit" falls back to the board's defaults and then to
|
|
16
|
+
* the host, and the sheet says which level supplied the value it is showing.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { useState } from 'preact/hooks';
|
|
20
|
+
|
|
21
|
+
import { MAX_PROMPT_CHARS, type AgentSpec, type Board, type Stage } from '../protocol';
|
|
22
|
+
import type { Catalogs } from './catalogs';
|
|
23
|
+
import type { WriteOutcome } from './use-writes';
|
|
24
|
+
|
|
25
|
+
export interface StageSheetProps {
|
|
26
|
+
board: Board;
|
|
27
|
+
catalogs: Catalogs;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
onSave: (stages: Stage[]) => Promise<WriteOutcome<unknown>>;
|
|
30
|
+
onSaveDefaults: (defaults: Record<string, unknown>) => Promise<WriteOutcome<unknown>>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** A spec's own text, for the form fields. Every field is a STRING: empty means inherit. */
|
|
34
|
+
interface SpecText {
|
|
35
|
+
harness: string;
|
|
36
|
+
thinking: string;
|
|
37
|
+
access: string;
|
|
38
|
+
prompt: string;
|
|
39
|
+
model: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function specOf(stage: Stage): SpecText {
|
|
43
|
+
return {
|
|
44
|
+
harness: stage.agent?.harness ?? '',
|
|
45
|
+
thinking: stage.agent?.thinking ?? '',
|
|
46
|
+
access: stage.agent?.access ?? '',
|
|
47
|
+
prompt: stage.agent?.prompt ?? '',
|
|
48
|
+
model: stage.agent?.model ? `${stage.agent.model.provider}/${stage.agent.model.modelId}` : '',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The stages sheet. */
|
|
53
|
+
export function StageSheet({ board, catalogs, onClose, onSave, onSaveDefaults }: StageSheetProps) {
|
|
54
|
+
const [drafts, setDrafts] = useState<Stage[]>(board.stages.map((stage) => ({ ...stage })));
|
|
55
|
+
const [defaults, setDefaults] = useState<Record<string, unknown>>({ ...board.defaults });
|
|
56
|
+
const [busy, setBusy] = useState(false);
|
|
57
|
+
const [error, setError] = useState<string | null>(null);
|
|
58
|
+
const [notice, setNotice] = useState<string | null>(null);
|
|
59
|
+
|
|
60
|
+
const edit = (id: string, change: (stage: Stage) => Stage) => {
|
|
61
|
+
setDrafts((current) => current.map((stage) => (stage.id === id ? change(stage) : stage)));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const setAgentField = (id: string, key: 'harness' | 'thinking' | 'access' | 'prompt', value: string) => {
|
|
65
|
+
edit(id, (stage) => {
|
|
66
|
+
const agent: AgentSpec = { ...(stage.agent ?? {}) };
|
|
67
|
+
if (value) {
|
|
68
|
+
if (key === 'prompt') agent.prompt = value;
|
|
69
|
+
else if (key === 'harness') agent.harness = value;
|
|
70
|
+
else if (key === 'thinking') agent.thinking = value;
|
|
71
|
+
else agent.access = value;
|
|
72
|
+
} else if (key === 'prompt') delete agent.prompt;
|
|
73
|
+
else if (key === 'harness') delete agent.harness;
|
|
74
|
+
else if (key === 'thinking') delete agent.thinking;
|
|
75
|
+
else delete agent.access;
|
|
76
|
+
return { ...stage, ...(Object.keys(agent).length ? { agent } : { agent: undefined }) };
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const save = async () => {
|
|
81
|
+
setBusy(true);
|
|
82
|
+
setError(null);
|
|
83
|
+
setNotice(null);
|
|
84
|
+
const cleaned = drafts.map((stage) => ({ ...stage, agent: stage.agent && Object.keys(stage.agent).length ? stage.agent : undefined }));
|
|
85
|
+
const stagesOutcome = await onSave(cleaned);
|
|
86
|
+
if (!stagesOutcome.ok) {
|
|
87
|
+
setBusy(false);
|
|
88
|
+
setError(stagesOutcome.error);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const defaultsOutcome = await onSaveDefaults(defaults);
|
|
92
|
+
setBusy(false);
|
|
93
|
+
if (!defaultsOutcome.ok) setError(defaultsOutcome.error);
|
|
94
|
+
else setNotice('Stages saved.');
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<aside class="flex flex-col h-full min-h-0 w-full md:w-[460px] md:flex-none border-l border-ink/10 bg-paper">
|
|
99
|
+
<header class="flex items-center gap-2 px-3 h-10 flex-none border-b border-ink/10">
|
|
100
|
+
<span class="text-xs font-medium text-ink">Stages</span>
|
|
101
|
+
<span class="text-[10px] text-ink/45">a hidden stage with cards keeps showing</span>
|
|
102
|
+
<button type="button" class="ml-auto text-ink/50 hover:text-ink px-1" aria-label="Close" onClick={onClose}>
|
|
103
|
+
×
|
|
104
|
+
</button>
|
|
105
|
+
</header>
|
|
106
|
+
|
|
107
|
+
<div class="flex-1 min-h-0 overflow-y-auto px-3 py-3 flex flex-col gap-4">
|
|
108
|
+
<fieldset class="flex flex-col gap-2">
|
|
109
|
+
<legend class="text-[10px] uppercase font-mono text-ink/40">Board defaults</legend>
|
|
110
|
+
<label class="flex flex-col gap-1">
|
|
111
|
+
<span class="text-[10px] text-ink/45">Harness</span>
|
|
112
|
+
<select
|
|
113
|
+
class="rounded-md border border-ink/15 bg-paper px-2 py-1 text-xs text-ink"
|
|
114
|
+
value={typeof defaults.harness === 'string' ? defaults.harness : ''}
|
|
115
|
+
onChange={(event) => setDefaults({ ...defaults, harness: event.currentTarget.value || undefined })}
|
|
116
|
+
>
|
|
117
|
+
<option value="">host default (omp-rpc)</option>
|
|
118
|
+
{catalogs.harnesses.map((entry) => (
|
|
119
|
+
<option key={entry.id} value={entry.id}>
|
|
120
|
+
{entry.label}
|
|
121
|
+
</option>
|
|
122
|
+
))}
|
|
123
|
+
</select>
|
|
124
|
+
</label>
|
|
125
|
+
<label class="flex flex-col gap-1">
|
|
126
|
+
<span class="text-[10px] text-ink/45">System prompt every stage inherits</span>
|
|
127
|
+
<textarea
|
|
128
|
+
class="w-full min-h-[64px] rounded-md border border-ink/15 bg-paper px-2 py-1 text-[11px] text-ink resize-y"
|
|
129
|
+
maxLength={MAX_PROMPT_CHARS}
|
|
130
|
+
value={typeof defaults.prompt === 'string' ? defaults.prompt : ''}
|
|
131
|
+
onInput={(event) => setDefaults({ ...defaults, prompt: event.currentTarget.value || undefined })}
|
|
132
|
+
/>
|
|
133
|
+
</label>
|
|
134
|
+
</fieldset>
|
|
135
|
+
|
|
136
|
+
{drafts.map((stage) => {
|
|
137
|
+
const spec = specOf(stage);
|
|
138
|
+
return (
|
|
139
|
+
<fieldset key={stage.id} class="flex flex-col gap-2 border-t border-ink/10 pt-3">
|
|
140
|
+
<legend class="text-[10px] uppercase font-mono text-ink/40">{stage.id}</legend>
|
|
141
|
+
<div class="flex gap-2 items-end">
|
|
142
|
+
<label class="flex-1 flex flex-col gap-1">
|
|
143
|
+
<span class="text-[10px] text-ink/45">Label</span>
|
|
144
|
+
<input
|
|
145
|
+
class="rounded-md border border-ink/15 bg-paper px-2 py-1 text-xs text-ink"
|
|
146
|
+
value={stage.label}
|
|
147
|
+
onInput={(event) => {
|
|
148
|
+
const label = event.currentTarget.value;
|
|
149
|
+
edit(stage.id, (entry) => ({ ...entry, label }));
|
|
150
|
+
}}
|
|
151
|
+
/>
|
|
152
|
+
</label>
|
|
153
|
+
<label class="flex items-center gap-1 text-[11px] text-ink/60">
|
|
154
|
+
<input
|
|
155
|
+
type="checkbox"
|
|
156
|
+
checked={stage.hidden}
|
|
157
|
+
onChange={(event) => {
|
|
158
|
+
const hidden = event.currentTarget.checked;
|
|
159
|
+
edit(stage.id, (entry) => ({ ...entry, hidden }));
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
hidden
|
|
163
|
+
</label>
|
|
164
|
+
<label class="flex items-center gap-1 text-[11px] text-ink/60">
|
|
165
|
+
<input
|
|
166
|
+
type="checkbox"
|
|
167
|
+
checked={stage.session}
|
|
168
|
+
onChange={(event) => {
|
|
169
|
+
const session = event.currentTarget.checked;
|
|
170
|
+
edit(stage.id, (entry) => ({ ...entry, session }));
|
|
171
|
+
}}
|
|
172
|
+
/>
|
|
173
|
+
runs a session
|
|
174
|
+
</label>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<div class="flex gap-2">
|
|
178
|
+
<label class="flex-1 flex flex-col gap-1">
|
|
179
|
+
<span class="text-[10px] text-ink/45">Harness</span>
|
|
180
|
+
<select
|
|
181
|
+
class="rounded-md border border-ink/15 bg-paper px-2 py-1 text-xs text-ink"
|
|
182
|
+
value={spec.harness}
|
|
183
|
+
onChange={(event) => setAgentField(stage.id, 'harness', event.currentTarget.value)}
|
|
184
|
+
>
|
|
185
|
+
<option value="">inherit</option>
|
|
186
|
+
{catalogs.harnesses.map((entry) => (
|
|
187
|
+
<option key={entry.id} value={entry.id}>
|
|
188
|
+
{entry.label}
|
|
189
|
+
</option>
|
|
190
|
+
))}
|
|
191
|
+
</select>
|
|
192
|
+
</label>
|
|
193
|
+
<label class="flex-1 flex flex-col gap-1">
|
|
194
|
+
<span class="text-[10px] text-ink/45">Thinking</span>
|
|
195
|
+
<input
|
|
196
|
+
class="rounded-md border border-ink/15 bg-paper px-2 py-1 text-xs text-ink"
|
|
197
|
+
placeholder="inherit"
|
|
198
|
+
value={spec.thinking}
|
|
199
|
+
onInput={(event) => setAgentField(stage.id, 'thinking', event.currentTarget.value)}
|
|
200
|
+
/>
|
|
201
|
+
</label>
|
|
202
|
+
<label class="flex-1 flex flex-col gap-1">
|
|
203
|
+
<span class="text-[10px] text-ink/45">Access</span>
|
|
204
|
+
<select
|
|
205
|
+
class="rounded-md border border-ink/15 bg-paper px-2 py-1 text-xs text-ink"
|
|
206
|
+
value={spec.access}
|
|
207
|
+
onChange={(event) => setAgentField(stage.id, 'access', event.currentTarget.value)}
|
|
208
|
+
>
|
|
209
|
+
<option value="">inherit</option>
|
|
210
|
+
<option value="always-ask">always-ask</option>
|
|
211
|
+
<option value="write">write</option>
|
|
212
|
+
<option value="yolo">yolo</option>
|
|
213
|
+
</select>
|
|
214
|
+
</label>
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<label class="flex flex-col gap-1">
|
|
218
|
+
<span class="text-[10px] text-ink/45">
|
|
219
|
+
System prompt — appended on omp-rpc, prepended on an ACP harness
|
|
220
|
+
</span>
|
|
221
|
+
<textarea
|
|
222
|
+
class="w-full min-h-[72px] rounded-md border border-ink/15 bg-paper px-2 py-1 text-[11px] text-ink resize-y"
|
|
223
|
+
maxLength={MAX_PROMPT_CHARS}
|
|
224
|
+
value={spec.prompt}
|
|
225
|
+
placeholder="Leave empty to inherit."
|
|
226
|
+
onInput={(event) => setAgentField(stage.id, 'prompt', event.currentTarget.value)}
|
|
227
|
+
/>
|
|
228
|
+
</label>
|
|
229
|
+
</fieldset>
|
|
230
|
+
);
|
|
231
|
+
})}
|
|
232
|
+
|
|
233
|
+
{error ? <p class="text-[11px] text-[var(--theme-error)]">{error}</p> : null}
|
|
234
|
+
{notice ? <p class="text-[11px] text-ink/50">{notice}</p> : null}
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<footer class="flex items-center gap-2 px-3 h-11 flex-none border-t border-ink/10">
|
|
238
|
+
<button
|
|
239
|
+
type="button"
|
|
240
|
+
class="rounded-md border border-ink/20 bg-ink/5 px-2 py-1 text-[11px] text-ink disabled:opacity-40"
|
|
241
|
+
disabled={busy}
|
|
242
|
+
onClick={() => void save()}
|
|
243
|
+
>
|
|
244
|
+
{busy ? 'Saving…' : 'Save'}
|
|
245
|
+
</button>
|
|
246
|
+
</footer>
|
|
247
|
+
</aside>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The two catalogs the card sheet's pickers read, and the flattening they need.
|
|
8
|
+
*
|
|
9
|
+
* Both are Kabmo's own routes (`GET /api/harness`, `GET /api/models`), read
|
|
10
|
+
* through `useKabmoFetch` — the same endpoints the composer's pickers use, so the
|
|
11
|
+
* board cannot offer a harness or a model the chat would refuse. Nothing is
|
|
12
|
+
* cached here: the fetch hook pauses while the panel is hidden, which is the
|
|
13
|
+
* behaviour a plugin wants and a hand-rolled poll would forget.
|
|
14
|
+
*
|
|
15
|
+
* A harness whose models were never probed yields an EMPTY list plus the reason.
|
|
16
|
+
* Showing omp's registry under the `claude` tab would offer a model that agent
|
|
17
|
+
* cannot run — the rule `harnessModels` already enforces in the host.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { useKabmoFetch } from '@kabmo-labs/kabmo-ui';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The part of `GET /api/harness` this panel reads.
|
|
24
|
+
*
|
|
25
|
+
* Deliberately a SUBSET: the route's own type lives in the host, and a plugin
|
|
26
|
+
* cannot import it. Every field here is optional so a host that grows or drops
|
|
27
|
+
* one leaves the pickers usable rather than broken.
|
|
28
|
+
*/
|
|
29
|
+
interface HarnessSummary {
|
|
30
|
+
id: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
probe?: {
|
|
34
|
+
models?: { value: string; name: string }[];
|
|
35
|
+
thinking?: { value: string; name: string }[];
|
|
36
|
+
} | null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** One row a model picker draws. */
|
|
40
|
+
export interface ModelChoice {
|
|
41
|
+
provider: string;
|
|
42
|
+
modelId: string;
|
|
43
|
+
label: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** The pickers' data, and why a list may be empty. */
|
|
47
|
+
export interface Catalogs {
|
|
48
|
+
harnesses: { id: string; label: string; enabled: boolean }[];
|
|
49
|
+
modelsFor: (harness: string) => ModelChoice[];
|
|
50
|
+
thinkingFor: (harness: string) => string[];
|
|
51
|
+
/** A harness's own reason it cannot list models, when it has one. */
|
|
52
|
+
blockedFor: (harness: string) => string | null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** `provider/modelId` is how ACP spells a model; the row's provider is the prefix. */
|
|
56
|
+
function splitModel(value: string): { provider: string; modelId: string } {
|
|
57
|
+
const slash = value.indexOf('/');
|
|
58
|
+
if (slash <= 0) return { provider: '', modelId: value };
|
|
59
|
+
return { provider: value.slice(0, slash), modelId: value.slice(slash + 1) };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** ACP's `models[]` in the picker's shape. */
|
|
63
|
+
function acpChoices(summary: HarnessSummary): ModelChoice[] {
|
|
64
|
+
const models = summary.probe?.models ?? [];
|
|
65
|
+
return models.map((option) => {
|
|
66
|
+
const split = splitModel(option.value);
|
|
67
|
+
return { ...split, label: option.name || option.value };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** omp's registry in the picker's shape. */
|
|
72
|
+
function ompChoices(payload: unknown): ModelChoice[] {
|
|
73
|
+
const record = (payload ?? {}) as { modelList?: unknown };
|
|
74
|
+
const list = Array.isArray(record.modelList) ? record.modelList : [];
|
|
75
|
+
const choices: ModelChoice[] = [];
|
|
76
|
+
for (const entry of list) {
|
|
77
|
+
const row = (entry ?? {}) as Record<string, unknown>;
|
|
78
|
+
const provider = typeof row.provider === 'string' ? row.provider : '';
|
|
79
|
+
const modelId = typeof row.id === 'string' ? row.id : typeof row.modelId === 'string' ? row.modelId : '';
|
|
80
|
+
if (!provider || !modelId) continue;
|
|
81
|
+
choices.push({ provider, modelId, label: typeof row.name === 'string' && row.name ? row.name : modelId });
|
|
82
|
+
}
|
|
83
|
+
return choices;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Read both catalogs once, for the sheet's pickers. */
|
|
87
|
+
export function useCatalogs(enabled: boolean): Catalogs {
|
|
88
|
+
const harness = useKabmoFetch<HarnessSummary[]>('/api/harness', { enabled, pollMs: 0 });
|
|
89
|
+
const models = useKabmoFetch<unknown>('/api/models', { enabled, pollMs: 0 });
|
|
90
|
+
const summaries = Array.isArray(harness.data) ? harness.data : [];
|
|
91
|
+
const omp = ompChoices(models.data);
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
harnesses: summaries
|
|
95
|
+
.filter((summary) => summary.enabled !== false)
|
|
96
|
+
.map((summary) => ({ id: summary.id, label: summary.label || summary.id, enabled: summary.enabled !== false })),
|
|
97
|
+
modelsFor: (id) => {
|
|
98
|
+
if (id === 'omp-rpc') return omp;
|
|
99
|
+
const summary = summaries.find((entry) => entry.id === id);
|
|
100
|
+
return summary ? acpChoices(summary) : [];
|
|
101
|
+
},
|
|
102
|
+
thinkingFor: (id) => {
|
|
103
|
+
const summary = summaries.find((entry) => entry.id === id);
|
|
104
|
+
return (summary?.probe?.thinking ?? []).map((option) => option.value);
|
|
105
|
+
},
|
|
106
|
+
blockedFor: (id) => {
|
|
107
|
+
if (id === 'omp-rpc') return omp.length === 0 ? 'omp has not reported its models yet' : null;
|
|
108
|
+
const summary = summaries.find((entry) => entry.id === id);
|
|
109
|
+
if (!summary) return 'This harness is not in the catalog';
|
|
110
|
+
if (!summary.probe) return 'This harness has not reported its models yet';
|
|
111
|
+
return (summary.probe.models?.length ?? 0) === 0 ? 'This harness reported no models' : null;
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Kanban panel: the board, its lens chips, and the two sheets.
|
|
8
|
+
*
|
|
9
|
+
* ## What this view is
|
|
10
|
+
*
|
|
11
|
+
* A control surface. A card is a task — a prompt, an agent, a stage — and the
|
|
12
|
+
* board's job is to move it. There is no description, no comments and no
|
|
13
|
+
* labels, because a board that accumulates knowledge stops being read.
|
|
14
|
+
*
|
|
15
|
+
* ## Two writers, one board
|
|
16
|
+
*
|
|
17
|
+
* An agent can move its own cards through the plugin's MCP tools. That write
|
|
18
|
+
* happens in a DIFFERENT process, so the panel cannot learn about it from its own
|
|
19
|
+
* state: it follows the plugin topic, which the server half publishes whenever
|
|
20
|
+
* `cards/` changes. That is why a card can move while this view is open and
|
|
21
|
+
* nothing here polls.
|
|
22
|
+
*
|
|
23
|
+
* ## The lens
|
|
24
|
+
*
|
|
25
|
+
* One board, two lenses: this workspace (the default when one is open) and
|
|
26
|
+
* everything. A card carries the workspace it belongs to, so switching a lens
|
|
27
|
+
* filters rather than moving anything, and a card whose folder is gone is still
|
|
28
|
+
* on the board.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { useCallback, useMemo, useState } from 'preact/hooks';
|
|
32
|
+
import { experimental_useSidebarThreads, usePanelInfo } from '@kabmo-labs/kabmo-ui';
|
|
33
|
+
|
|
34
|
+
import type { Card, CardSummary, ResolvedAgent, Stage } from '../protocol';
|
|
35
|
+
import { useBoard, type Lens } from './use-board';
|
|
36
|
+
import { useWrites } from './use-writes';
|
|
37
|
+
import { useCatalogs } from './catalogs';
|
|
38
|
+
import { StageColumn } from './StageColumn';
|
|
39
|
+
import { CardSheet } from './CardSheet';
|
|
40
|
+
import { StageSheet } from './StageSheet';
|
|
41
|
+
import { useCardDetail } from './use-card-detail';
|
|
42
|
+
|
|
43
|
+
/** The chips' labels, in order. */
|
|
44
|
+
function lensLabel(lens: Lens, counts: Record<Lens, number>): string {
|
|
45
|
+
if (lens === 'all') return `All ${counts.all}`;
|
|
46
|
+
if (lens === 'workspace') return `This workspace ${counts.workspace}`;
|
|
47
|
+
return `Unfiled ${counts.unfiled}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Which stages to draw: hidden ones only while they hold cards. */
|
|
51
|
+
export function visibleStages(stages: readonly Stage[], cards: readonly CardSummary[]): Stage[] {
|
|
52
|
+
return stages.filter(
|
|
53
|
+
(stage) => !stage.hidden || cards.some((card) => card.status === stage.id),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Cards whose stage matches no stage id, shown rather than dropped. */
|
|
58
|
+
export function unplacedCards(stages: readonly Stage[], cards: readonly CardSummary[]): CardSummary[] {
|
|
59
|
+
const known = new Set(stages.map((stage) => stage.id));
|
|
60
|
+
return cards.filter((card) => !known.has(card.status));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The board panel. */
|
|
64
|
+
export function KanbanPanel() {
|
|
65
|
+
const board = useBoard();
|
|
66
|
+
const { workspacePath, sessionId } = usePanelInfo();
|
|
67
|
+
const writes = useWrites(board.reload);
|
|
68
|
+
const catalogs = useCatalogs(true);
|
|
69
|
+
const threads = experimental_useSidebarThreads();
|
|
70
|
+
const detail = useCardDetail();
|
|
71
|
+
const [openCardId, setOpenCardId] = useState<string | null>(null);
|
|
72
|
+
const [stagesOpen, setStagesOpen] = useState(false);
|
|
73
|
+
const [draggingId, setDraggingId] = useState<string | null>(null);
|
|
74
|
+
const [dropTarget, setDropTarget] = useState<string | null>(null);
|
|
75
|
+
const [notice, setNotice] = useState<string | null>(null);
|
|
76
|
+
|
|
77
|
+
const sessionStateOf = useCallback(
|
|
78
|
+
(card: CardSummary): 'running' | 'needs-you' | 'idle' | 'none' => {
|
|
79
|
+
if (!card.sessionId) return 'none';
|
|
80
|
+
const thread = threads.threads.find((entry) => entry.id === card.sessionId);
|
|
81
|
+
if (!thread) return 'idle';
|
|
82
|
+
if (thread.awaitingInput) return 'needs-you';
|
|
83
|
+
return thread.isRunning ? 'running' : 'idle';
|
|
84
|
+
},
|
|
85
|
+
[threads.threads],
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
// `exists` is checked ONCE here: everything below draws a real board.
|
|
89
|
+
const live = board.snapshot?.exists ? board.snapshot : null;
|
|
90
|
+
const stages = useMemo(
|
|
91
|
+
() => (live ? visibleStages(live.board.stages, board.cards) : []),
|
|
92
|
+
[live, board.cards],
|
|
93
|
+
);
|
|
94
|
+
const unplaced = useMemo(
|
|
95
|
+
() => (live ? unplacedCards(live.board.stages, board.cards) : []),
|
|
96
|
+
[live, board.cards],
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const drop = useCallback(
|
|
100
|
+
async (stageId: string) => {
|
|
101
|
+
const id = draggingId;
|
|
102
|
+
setDraggingId(null);
|
|
103
|
+
setDropTarget(null);
|
|
104
|
+
if (!id) return;
|
|
105
|
+
const card = board.cards.find((entry) => entry.id === id);
|
|
106
|
+
if (!card || card.status === stageId) return;
|
|
107
|
+
const outcome = await writes.moveCard(id, stageId);
|
|
108
|
+
if (!outcome.ok) setNotice(outcome.error);
|
|
109
|
+
else if (outcome.value.next === 'start_work_required') {
|
|
110
|
+
setNotice('Moved. This stage runs a chat — press Start work on the card.');
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
[board.cards, draggingId, writes],
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const startWork = useCallback(
|
|
117
|
+
async (card: Card, resolved: ResolvedAgent) => {
|
|
118
|
+
const outcome = await writes.startWork(card, resolved);
|
|
119
|
+
if (!outcome.ok) return { ok: false as const, error: outcome.error };
|
|
120
|
+
setOpenCardId(null);
|
|
121
|
+
return { ok: true as const, value: outcome };
|
|
122
|
+
},
|
|
123
|
+
[writes],
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
// The board is the plugin's only surface, so every state it can be in is here.
|
|
127
|
+
if (board.isLoading) {
|
|
128
|
+
return <p class="p-3 text-xs text-ink/45">Reading the board…</p>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (board.error) {
|
|
132
|
+
return (
|
|
133
|
+
<div class="flex flex-col gap-2 p-3">
|
|
134
|
+
<p class="text-xs text-ink">Could not read the board.</p>
|
|
135
|
+
<p class="text-[11px] text-[var(--theme-error)]">{board.error}</p>
|
|
136
|
+
<button type="button" class="self-start rounded-md border border-ink/20 px-2 py-1 text-[11px]" onClick={board.reload}>
|
|
137
|
+
Retry
|
|
138
|
+
</button>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (!live) {
|
|
144
|
+
return (
|
|
145
|
+
<div class="flex flex-col gap-2 p-3">
|
|
146
|
+
<p class="text-xs text-ink">No board yet.</p>
|
|
147
|
+
<p class="text-[11px] text-ink/50">It will be created in this Kabmo's data directory.</p>
|
|
148
|
+
<button
|
|
149
|
+
type="button"
|
|
150
|
+
class="self-start rounded-md border border-ink/20 bg-ink/5 px-2 py-1 text-[11px]"
|
|
151
|
+
onClick={() => void board.createBoard()}
|
|
152
|
+
>
|
|
153
|
+
Create board
|
|
154
|
+
</button>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const openCard = openCardId ? detail.card : null;
|
|
160
|
+
const showWorkspace = board.lens === 'all';
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<div class="flex h-full min-h-0 w-full bg-paper text-ink">
|
|
164
|
+
<div class="flex flex-col flex-1 min-w-0 min-h-0">
|
|
165
|
+
<header class="flex items-center gap-2 px-2.5 h-10 flex-none border-b border-ink/10">
|
|
166
|
+
<span class="text-xs font-semibold">Kanban</span>
|
|
167
|
+
<span class="text-[10px] text-ink/40">{live.cards.length}</span>
|
|
168
|
+
<div class="flex items-center gap-1 ml-2">
|
|
169
|
+
{(['all', 'workspace', 'unfiled'] as const).map((lens) => (
|
|
170
|
+
<button
|
|
171
|
+
key={lens}
|
|
172
|
+
type="button"
|
|
173
|
+
class={[
|
|
174
|
+
'rounded-full border px-2 py-0.5 text-[10px]',
|
|
175
|
+
board.lens === lens ? 'border-ink/30 bg-ink/5 text-ink' : 'border-ink/10 text-ink/55',
|
|
176
|
+
].join(' ')}
|
|
177
|
+
aria-pressed={board.lens === lens}
|
|
178
|
+
onClick={() => board.setLens(lens)}
|
|
179
|
+
>
|
|
180
|
+
{lensLabel(lens, board.counts)}
|
|
181
|
+
</button>
|
|
182
|
+
))}
|
|
183
|
+
</div>
|
|
184
|
+
<button
|
|
185
|
+
type="button"
|
|
186
|
+
class="ml-auto rounded-md border border-ink/15 px-2 py-0.5 text-[10px] text-ink/70"
|
|
187
|
+
onClick={() => setStagesOpen(true)}
|
|
188
|
+
>
|
|
189
|
+
Stages…
|
|
190
|
+
</button>
|
|
191
|
+
<button
|
|
192
|
+
type="button"
|
|
193
|
+
class="rounded-md border border-ink/15 px-2 py-0.5 text-[10px] text-ink/70"
|
|
194
|
+
onClick={board.reload}
|
|
195
|
+
>
|
|
196
|
+
Refresh
|
|
197
|
+
</button>
|
|
198
|
+
</header>
|
|
199
|
+
|
|
200
|
+
{live.errors.length > 0 ? (
|
|
201
|
+
<ul class="px-2.5 py-1.5 border-b border-ink/10 flex flex-col gap-0.5">
|
|
202
|
+
{live.errors.map((entry) => (
|
|
203
|
+
<li key={entry.path} class="text-[10px] text-[var(--theme-error)] font-mono">
|
|
204
|
+
{entry.path} — {entry.message}
|
|
205
|
+
</li>
|
|
206
|
+
))}
|
|
207
|
+
</ul>
|
|
208
|
+
) : null}
|
|
209
|
+
|
|
210
|
+
{notice ? (
|
|
211
|
+
<p class="px-2.5 py-1.5 border-b border-ink/10 text-[11px] text-ink/60" role="status">
|
|
212
|
+
{notice}
|
|
213
|
+
</p>
|
|
214
|
+
) : null}
|
|
215
|
+
|
|
216
|
+
<div class="flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-2">
|
|
217
|
+
<div class="flex gap-2 h-full min-h-0">
|
|
218
|
+
{stages.map((stage) => (
|
|
219
|
+
<StageColumn
|
|
220
|
+
key={stage.id}
|
|
221
|
+
stage={stage}
|
|
222
|
+
cards={board.cards.filter((card) => card.status === stage.id)}
|
|
223
|
+
showWorkspace={showWorkspace}
|
|
224
|
+
sessionStateOf={sessionStateOf}
|
|
225
|
+
draggingId={draggingId}
|
|
226
|
+
dropTarget={dropTarget}
|
|
227
|
+
onOpenCard={(id) => {
|
|
228
|
+
setOpenCardId(id);
|
|
229
|
+
void detail.load(id);
|
|
230
|
+
}}
|
|
231
|
+
onAddCard={(stageId) => {
|
|
232
|
+
void writes
|
|
233
|
+
.createCard({ title: 'New card', status: stageId, workspace: workspacePath })
|
|
234
|
+
.then((outcome) => {
|
|
235
|
+
if (outcome.ok) setNotice('Card created. Open it to write the task.');
|
|
236
|
+
else setNotice(outcome.error);
|
|
237
|
+
});
|
|
238
|
+
}}
|
|
239
|
+
onDragStart={setDraggingId}
|
|
240
|
+
onDragEnd={() => {
|
|
241
|
+
setDraggingId(null);
|
|
242
|
+
setDropTarget(null);
|
|
243
|
+
}}
|
|
244
|
+
onDropOn={(stageId) => void drop(stageId)}
|
|
245
|
+
onDragOver={setDropTarget}
|
|
246
|
+
/>
|
|
247
|
+
))}
|
|
248
|
+
{unplaced.length > 0 ? (
|
|
249
|
+
<StageColumn
|
|
250
|
+
stage={{ id: 'unplaced', label: 'Unplaced', hidden: false, session: false }}
|
|
251
|
+
cards={unplaced}
|
|
252
|
+
showWorkspace={showWorkspace}
|
|
253
|
+
sessionStateOf={sessionStateOf}
|
|
254
|
+
draggingId={draggingId}
|
|
255
|
+
dropTarget={dropTarget}
|
|
256
|
+
onOpenCard={(id) => {
|
|
257
|
+
setOpenCardId(id);
|
|
258
|
+
void detail.load(id);
|
|
259
|
+
}}
|
|
260
|
+
onAddCard={() => undefined}
|
|
261
|
+
onDragStart={setDraggingId}
|
|
262
|
+
onDragEnd={() => setDraggingId(null)}
|
|
263
|
+
onDropOn={(stageId) => void drop(stageId)}
|
|
264
|
+
onDragOver={setDropTarget}
|
|
265
|
+
/>
|
|
266
|
+
) : null}
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
{openCard ? (
|
|
272
|
+
<CardSheet
|
|
273
|
+
card={openCard}
|
|
274
|
+
stages={live.board.stages}
|
|
275
|
+
board={{ defaults: live.board.defaults as Record<string, unknown>, stages: live.board.stages }}
|
|
276
|
+
catalogs={catalogs}
|
|
277
|
+
activeSessionId={sessionId}
|
|
278
|
+
sessionState={sessionStateOf({
|
|
279
|
+
...openCard,
|
|
280
|
+
hasPrompt: openCard.task.prompt.length > 0,
|
|
281
|
+
imageCount: openCard.task.images.length,
|
|
282
|
+
})}
|
|
283
|
+
onClose={() => setOpenCardId(null)}
|
|
284
|
+
onSave={async (patch, base) => {
|
|
285
|
+
const outcome = await writes.updateCard(openCard.id, patch, base);
|
|
286
|
+
if (outcome.ok) void detail.load(openCard.id);
|
|
287
|
+
return outcome;
|
|
288
|
+
}}
|
|
289
|
+
onMove={async (status, base) => {
|
|
290
|
+
const outcome = await writes.moveCard(openCard.id, status, base);
|
|
291
|
+
if (outcome.ok) void detail.load(openCard.id);
|
|
292
|
+
return outcome;
|
|
293
|
+
}}
|
|
294
|
+
onDelete={async () => {
|
|
295
|
+
const outcome = await writes.deleteCard(openCard.id);
|
|
296
|
+
if (outcome.ok) setOpenCardId(null);
|
|
297
|
+
return outcome;
|
|
298
|
+
}}
|
|
299
|
+
onStartWork={startWork}
|
|
300
|
+
onLinkSession={async (linkId) => {
|
|
301
|
+
const outcome = await writes.linkSession(openCard.id, linkId);
|
|
302
|
+
if (outcome.ok) void detail.load(openCard.id);
|
|
303
|
+
return outcome;
|
|
304
|
+
}}
|
|
305
|
+
/>
|
|
306
|
+
) : null}
|
|
307
|
+
|
|
308
|
+
{stagesOpen ? (
|
|
309
|
+
<StageSheet
|
|
310
|
+
board={live.board}
|
|
311
|
+
catalogs={catalogs}
|
|
312
|
+
onClose={() => setStagesOpen(false)}
|
|
313
|
+
onSave={async (next) => {
|
|
314
|
+
const outcome = await writes.saveStages(next);
|
|
315
|
+
if (outcome.ok) board.reload();
|
|
316
|
+
return outcome;
|
|
317
|
+
}}
|
|
318
|
+
onSaveDefaults={async (next) => {
|
|
319
|
+
const outcome = await writes.saveDefaults(next);
|
|
320
|
+
if (outcome.ok) board.reload();
|
|
321
|
+
return outcome;
|
|
322
|
+
}}
|
|
323
|
+
/>
|
|
324
|
+
) : null}
|
|
325
|
+
</div>
|
|
326
|
+
);
|
|
327
|
+
}
|